xgplayer 3.0.0-alpha.115-2 → 3.0.0-alpha.115-2-2

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.
@@ -1 +1 @@
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}()||e||Function("return this")(),i={exports:{}},r=n,o=Object.defineProperty,s=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t},a=s,c="__core-js_shared__",u=n[c]||a(c,{}),l=u;(i.exports=function(e,t){return l[e]||(l[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var f,h,d=function(e){try{return!!e()}catch(e){return!0}},p=!d((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),g=p,v=Function.prototype,y=v.call,m=g&&v.bind.bind(y,y),k=g?m:function(e){return function(){return y.apply(e,arguments)}},b=function(e){return null==e},w=b,C=TypeError,_=function(e){if(w(e))throw C("Can't call method on "+e);return e},x=_,S=Object,T=function(e){return S(x(e))},E=T,P=k({}.hasOwnProperty),R=Object.hasOwn||function(e,t){return P(E(e),t)},O=k,L=0,I=Math.random(),A=O(1..toString),D=function(e){return"Symbol("+(void 0===e?"":e)+")_"+A(++L+I,36)},M="undefined"!=typeof navigator&&String(navigator.userAgent)||"",N=n,F=M,B=N.process,j=N.Deno,U=B&&B.versions||j&&j.version,H=U&&U.v8;H&&(h=(f=H.split("."))[0]>0&&f[0]<4?1:+(f[0]+f[1])),!h&&F&&(!(f=F.match(/Edge\/(\d+)/))||f[1]>=74)&&(f=F.match(/Chrome\/(\d+)/))&&(h=+f[1]);var G=h,V=G,W=d,K=n.String,z=!!Object.getOwnPropertySymbols&&!W((function(){var e=Symbol();return!K(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V&&V<41})),Y=z&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,X=n,q=i.exports,$=R,J=D,Z=z,Q=Y,ee=X.Symbol,te=q("wks"),ne=Q?ee.for||ee:ee&&ee.withoutSetter||J,ie=function(e){return $(te,e)||(te[e]=Z&&$(ee,e)?ee[e]:ne("Symbol."+e)),te[e]},re={};re[ie("toStringTag")]="z";var oe="[object z]"===String(re),se="object"==typeof document&&document.all,ae={all:se,IS_HTMLDDA:void 0===se&&void 0!==se},ce=ae.all,ue=ae.IS_HTMLDDA?function(e){return"function"==typeof e||e===ce}:function(e){return"function"==typeof e},le={},fe=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),he=ue,de=ae.all,pe=ae.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:he(e)||e===de}:function(e){return"object"==typeof e?null!==e:he(e)},ge=pe,ve=n.document,ye=ge(ve)&&ge(ve.createElement),me=function(e){return ye?ve.createElement(e):{}},ke=me,be=!fe&&!d((function(){return 7!=Object.defineProperty(ke("div"),"a",{get:function(){return 7}}).a})),we=fe&&d((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ce=pe,_e=String,xe=TypeError,Se=function(e){if(Ce(e))return e;throw xe(_e(e)+" is not an object")},Te=p,Ee=Function.prototype.call,Pe=Te?Ee.bind(Ee):function(){return Ee.apply(Ee,arguments)},Re=n,Oe=ue,Le=function(e,t){return arguments.length<2?(n=Re[e],Oe(n)?n:void 0):Re[e]&&Re[e][t];var n},Ie=k({}.isPrototypeOf),Ae=Le,De=ue,Me=Ie,Ne=Object,Fe=Y?function(e){return"symbol"==typeof e}:function(e){var t=Ae("Symbol");return De(t)&&Me(t.prototype,Ne(e))},Be=String,je=function(e){try{return Be(e)}catch(e){return"Object"}},Ue=ue,He=je,Ge=TypeError,Ve=function(e){if(Ue(e))return e;throw Ge(He(e)+" is not a function")},We=Ve,Ke=b,ze=function(e,t){var n=e[t];return Ke(n)?void 0:We(n)},Ye=Pe,Xe=ue,qe=pe,$e=TypeError,Je=Pe,Ze=pe,Qe=Fe,et=ze,tt=function(e,t){var n,i;if("string"===t&&Xe(n=e.toString)&&!qe(i=Ye(n,e)))return i;if(Xe(n=e.valueOf)&&!qe(i=Ye(n,e)))return i;if("string"!==t&&Xe(n=e.toString)&&!qe(i=Ye(n,e)))return i;throw $e("Can't convert object to primitive value")},nt=TypeError,it=ie("toPrimitive"),rt=function(e,t){if(!Ze(e)||Qe(e))return e;var n,i=et(e,it);if(i){if(void 0===t&&(t="default"),n=Je(i,e,t),!Ze(n)||Qe(n))return n;throw nt("Can't convert object to primitive value")}return void 0===t&&(t="number"),tt(e,t)},ot=rt,st=Fe,at=function(e){var t=ot(e,"string");return st(t)?t:t+""},ct=fe,ut=be,lt=we,ft=Se,ht=at,dt=TypeError,pt=Object.defineProperty,gt=Object.getOwnPropertyDescriptor,vt="enumerable",yt="configurable",mt="writable";le.f=ct?lt?function(e,t,n){if(ft(e),t=ht(t),ft(n),"function"==typeof e&&"prototype"===t&&"value"in n&&mt in n&&!n[mt]){var i=gt(e,t);i&&i[mt]&&(e[t]=n.value,n={configurable:yt in n?n[yt]:i[yt],enumerable:vt in n?n[vt]:i[vt],writable:!1})}return pt(e,t,n)}:pt:function(e,t,n){if(ft(e),t=ht(t),ft(n),ut)try{return pt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw dt("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var kt={exports:{}},bt=fe,wt=R,Ct=Function.prototype,_t=bt&&Object.getOwnPropertyDescriptor,xt=wt(Ct,"name"),St={EXISTS:xt,PROPER:xt&&"something"===function(){}.name,CONFIGURABLE:xt&&(!bt||bt&&_t(Ct,"name").configurable)},Tt=ue,Et=u,Pt=k(Function.toString);Tt(Et.inspectSource)||(Et.inspectSource=function(e){return Pt(e)});var Rt,Ot,Lt,It=Et.inspectSource,At=ue,Dt=n.WeakMap,Mt=At(Dt)&&/native code/.test(String(Dt)),Nt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Ft=le,Bt=Nt,jt=fe?function(e,t,n){return Ft.f(e,t,Bt(1,n))}:function(e,t,n){return e[t]=n,e},Ut=i.exports,Ht=D,Gt=Ut("keys"),Vt=function(e){return Gt[e]||(Gt[e]=Ht(e))},Wt={},Kt=Mt,zt=n,Yt=pe,Xt=jt,qt=R,$t=u,Jt=Vt,Zt=Wt,Qt="Object already initialized",en=zt.TypeError,tn=zt.WeakMap;if(Kt||$t.state){var nn=$t.state||($t.state=new tn);nn.get=nn.get,nn.has=nn.has,nn.set=nn.set,Rt=function(e,t){if(nn.has(e))throw en(Qt);return t.facade=e,nn.set(e,t),t},Ot=function(e){return nn.get(e)||{}},Lt=function(e){return nn.has(e)}}else{var rn=Jt("state");Zt[rn]=!0,Rt=function(e,t){if(qt(e,rn))throw en(Qt);return t.facade=e,Xt(e,rn,t),t},Ot=function(e){return qt(e,rn)?e[rn]:{}},Lt=function(e){return qt(e,rn)}}var on={set:Rt,get:Ot,has:Lt,enforce:function(e){return Lt(e)?Ot(e):Rt(e,{})},getterFor:function(e){return function(t){var n;if(!Yt(t)||(n=Ot(t)).type!==e)throw en("Incompatible receiver, "+e+" required");return n}}},sn=k,an=d,cn=ue,un=R,ln=fe,fn=St.CONFIGURABLE,hn=It,dn=on.enforce,pn=on.get,gn=String,vn=Object.defineProperty,yn=sn("".slice),mn=sn("".replace),kn=sn([].join),bn=ln&&!an((function(){return 8!==vn((function(){}),"length",{value:8}).length})),wn=String(String).split("String"),Cn=kt.exports=function(e,t,n){"Symbol("===yn(gn(t),0,7)&&(t="["+mn(gn(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!un(e,"name")||fn&&e.name!==t)&&(ln?vn(e,"name",{value:t,configurable:!0}):e.name=t),bn&&n&&un(n,"arity")&&e.length!==n.arity&&vn(e,"length",{value:n.arity});try{n&&un(n,"constructor")&&n.constructor?ln&&vn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=dn(e);return un(i,"source")||(i.source=kn(wn,"string"==typeof t?t:"")),e};Function.prototype.toString=Cn((function(){return cn(this)&&pn(this).source||hn(this)}),"toString");var _n=ue,xn=le,Sn=kt.exports,Tn=s,En=function(e,t,n,i){i||(i={});var r=i.enumerable,o=void 0!==i.name?i.name:t;if(_n(n)&&Sn(n,o,i),i.global)r?e[t]=n:Tn(t,n);else{try{i.unsafe?e[t]&&(r=!0):delete e[t]}catch(e){}r?e[t]=n:xn.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},Pn=k,Rn=Pn({}.toString),On=Pn("".slice),Ln=function(e){return On(Rn(e),8,-1)},In=oe,An=ue,Dn=Ln,Mn=ie("toStringTag"),Nn=Object,Fn="Arguments"==Dn(function(){return arguments}()),Bn=In?Dn: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=Nn(e),Mn))?n:Fn?Dn(t):"Object"==(i=Dn(t))&&An(t.callee)?"Arguments":i},jn=Bn,Un=oe?{}.toString:function(){return"[object "+jn(this)+"]"};oe||En(Object.prototype,"toString",Un,{unsafe:!0});var Hn={},Gn={},Vn={}.propertyIsEnumerable,Wn=Object.getOwnPropertyDescriptor,Kn=Wn&&!Vn.call({1:2},1);Gn.f=Kn?function(e){var t=Wn(this,e);return!!t&&t.enumerable}:Vn;var zn=d,Yn=Ln,Xn=Object,qn=k("".split),$n=zn((function(){return!Xn("z").propertyIsEnumerable(0)}))?function(e){return"String"==Yn(e)?qn(e,""):Xn(e)}:Xn,Jn=$n,Zn=_,Qn=function(e){return Jn(Zn(e))},ei=fe,ti=Pe,ni=Gn,ii=Nt,ri=Qn,oi=at,si=R,ai=be,ci=Object.getOwnPropertyDescriptor;Hn.f=ei?ci:function(e,t){if(e=ri(e),t=oi(t),ai)try{return ci(e,t)}catch(e){}if(si(e,t))return ii(!ti(ni.f,e,t),e[t])};var ui={},li=Math.ceil,fi=Math.floor,hi=Math.trunc||function(e){var t=+e;return(t>0?fi:li)(t)},di=function(e){var t=+e;return t!=t||0===t?0:hi(t)},pi=di,gi=Math.max,vi=Math.min,yi=function(e,t){var n=pi(e);return n<0?gi(n+t,0):vi(n,t)},mi=di,ki=Math.min,bi=function(e){return e>0?ki(mi(e),9007199254740991):0},wi=bi,Ci=function(e){return wi(e.length)},_i=Qn,xi=yi,Si=Ci,Ti=function(e){return function(t,n,i){var r,o=_i(t),s=Si(o),a=xi(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}},Ei={includes:Ti(!0),indexOf:Ti(!1)},Pi=R,Ri=Qn,Oi=Ei.indexOf,Li=Wt,Ii=k([].push),Ai=function(e,t){var n,i=Ri(e),r=0,o=[];for(n in i)!Pi(Li,n)&&Pi(i,n)&&Ii(o,n);for(;t.length>r;)Pi(i,n=t[r++])&&(~Oi(o,n)||Ii(o,n));return o},Di=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mi=Ai,Ni=Di.concat("length","prototype");ui.f=Object.getOwnPropertyNames||function(e){return Mi(e,Ni)};var Fi={};Fi.f=Object.getOwnPropertySymbols;var Bi=Le,ji=ui,Ui=Fi,Hi=Se,Gi=k([].concat),Vi=Bi("Reflect","ownKeys")||function(e){var t=ji.f(Hi(e)),n=Ui.f;return n?Gi(t,n(e)):t},Wi=R,Ki=Vi,zi=Hn,Yi=le,Xi=d,qi=ue,$i=/#|\.prototype\./,Ji=function(e,t){var n=Qi[Zi(e)];return n==tr||n!=er&&(qi(t)?Xi(t):!!t)},Zi=Ji.normalize=function(e){return String(e).replace($i,".").toLowerCase()},Qi=Ji.data={},er=Ji.NATIVE="N",tr=Ji.POLYFILL="P",nr=Ji,ir=n,rr=Hn.f,or=jt,sr=En,ar=s,cr=function(e,t,n){for(var i=Ki(t),r=Yi.f,o=zi.f,s=0;s<i.length;s++){var a=i[s];Wi(e,a)||n&&Wi(n,a)||r(e,a,o(t,a))}},ur=nr,lr=function(e,t){var n,i,r,o,s,a=e.target,c=e.global,u=e.stat;if(n=c?ir:u?ir[a]||ar(a,{}):(ir[a]||{}).prototype)for(i in t){if(o=t[i],r=e.dontCallGetSet?(s=rr(n,i))&&s.value:n[i],!ur(c?i:a+(u?".":"#")+i,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;cr(o,r)}(e.sham||r&&r.sham)&&or(o,"sham",!0),sr(n,i,o,e)}},fr=p,hr=Function.prototype,dr=hr.apply,pr=hr.call,gr="object"==typeof Reflect&&Reflect.apply||(fr?pr.bind(dr):function(){return pr.apply(dr,arguments)}),vr=k([].slice),yr=k,mr=Ve,kr=pe,br=R,wr=vr,Cr=p,_r=Function,xr=yr([].concat),Sr=yr([].join),Tr={},Er=Cr?_r.bind:function(e){var t=mr(this),n=t.prototype,i=wr(arguments,1),r=function(){var n=xr(i,wr(arguments));return this instanceof r?function(e,t,n){if(!br(Tr,t)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";Tr[t]=_r("C,a","return new C("+Sr(i,",")+")")}return Tr[t](e,n)}(t,n.length,n):t.apply(e,n)};return kr(n)&&(r.prototype=n),r},Pr=k,Rr=d,Or=ue,Lr=Bn,Ir=It,Ar=function(){},Dr=[],Mr=Le("Reflect","construct"),Nr=/^\s*(?:class|function)\b/,Fr=Pr(Nr.exec),Br=!Nr.exec(Ar),jr=function(e){if(!Or(e))return!1;try{return Mr(Ar,Dr,e),!0}catch(e){return!1}},Ur=function(e){if(!Or(e))return!1;switch(Lr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Br||!!Fr(Nr,Ir(e))}catch(e){return!0}};Ur.sham=!0;var Hr=!Mr||Rr((function(){var e;return jr(jr.call)||!jr(Object)||!jr((function(){e=!0}))||e}))?Ur:jr,Gr=Hr,Vr=je,Wr=TypeError,Kr=function(e){if(Gr(e))return e;throw Wr(Vr(e)+" is not a constructor")},zr={},Yr=Ai,Xr=Di,qr=Object.keys||function(e){return Yr(e,Xr)},$r=fe,Jr=we,Zr=le,Qr=Se,eo=Qn,to=qr;zr.f=$r&&!Jr?Object.defineProperties:function(e,t){Qr(e);for(var n,i=eo(t),r=to(t),o=r.length,s=0;o>s;)Zr.f(e,n=r[s++],i[n]);return e};var no,io=Le("document","documentElement"),ro=Se,oo=zr,so=Di,ao=Wt,co=io,uo=me,lo="prototype",fo="script",ho=Vt("IE_PROTO"),po=function(){},go=function(e){return"<"+fo+">"+e+"</"+fo+">"},vo=function(e){e.write(go("")),e.close();var t=e.parentWindow.Object;return e=null,t},yo=function(){try{no=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;yo="undefined"!=typeof document?document.domain&&no?vo(no):(t=uo("iframe"),n="java"+fo+":",t.style.display="none",co.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(go("document.F=Object")),e.close(),e.F):vo(no);for(var i=so.length;i--;)delete yo[lo][so[i]];return yo()};ao[ho]=!0;var mo=Object.create||function(e,t){var n;return null!==e?(po[lo]=ro(e),n=new po,po[lo]=null,n[ho]=e):n=yo(),void 0===t?n:oo.f(n,t)},ko=lr,bo=gr,wo=Er,Co=Kr,_o=Se,xo=pe,So=mo,To=d,Eo=Le("Reflect","construct"),Po=Object.prototype,Ro=[].push,Oo=To((function(){function e(){}return!(Eo((function(){}),[],e)instanceof e)})),Lo=!To((function(){Eo((function(){}))})),Io=Oo||Lo;function Ao(e){return Ao="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},Ao(e)}function Do(e){var t=function(e,t){if("object"!==Ao(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==Ao(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ao(t)?t:String(t)}function Mo(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,Do(i.key),i)}}function No(e,t,n){return t&&Mo(e.prototype,t),n&&Mo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bo(e,t){return Bo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bo(e,t)}function jo(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bo(e,t)}function Uo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ho(e,t){if(t&&("object"===Ao(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Uo(e)}function Go(e){return Go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Go(e)}function Vo(e,t,n){return(t=Do(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}ko({target:"Reflect",stat:!0,forced:Io,sham:Io},{construct:function(e,t){Co(e),_o(t);var n=arguments.length<3?e:Co(arguments[2]);if(Lo&&!Oo)return Eo(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 bo(Ro,i,t),new(bo(wo,e,i))}var r=n.prototype,o=So(xo(r)?r:Po),s=bo(e,o,t);return xo(s)?s:o}});var Wo=Bn,Ko=String,zo=function(e){if("Symbol"===Wo(e))throw TypeError("Cannot convert a Symbol value to a string");return Ko(e)},Yo={},Xo=at,qo=le,$o=Nt,Jo=function(e,t,n){var i=Xo(t);i in e?qo.f(e,i,$o(0,n)):e[i]=n},Zo=yi,Qo=Ci,es=Jo,ts=Array,ns=Math.max,is=function(e,t,n){for(var i=Qo(e),r=Zo(t,i),o=Zo(void 0===n?i:n,i),s=ts(ns(o-r,0)),a=0;r<o;r++,a++)es(s,a,e[r]);return s.length=a,s},rs=Ln,os=Qn,ss=ui.f,as=is,cs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Yo.f=function(e){return cs&&"Window"==rs(e)?function(e){try{return ss(e)}catch(e){return as(cs)}}(e):ss(os(e))};var us=kt.exports,ls=le,fs=function(e,t,n){return n.get&&us(n.get,t,{getter:!0}),n.set&&us(n.set,t,{setter:!0}),ls.f(e,t,n)},hs={},ds=ie;hs.f=ds;var ps=n,gs=ps,vs=R,ys=hs,ms=le.f,ks=Pe,bs=Le,ws=ie,Cs=En,_s=le.f,xs=R,Ss=ie("toStringTag"),Ts=function(e,t,n){e&&!n&&(e=e.prototype),e&&!xs(e,Ss)&&_s(e,Ss,{configurable:!0,value:t})},Es=Ln,Ps=k,Rs=function(e){if("Function"===Es(e))return Ps(e)},Os=Ve,Ls=p,Is=Rs(Rs.bind),As=function(e,t){return Os(e),void 0===t?e:Ls?Is(e,t):function(){return e.apply(t,arguments)}},Ds=Ln,Ms=Array.isArray||function(e){return"Array"==Ds(e)},Ns=Ms,Fs=Hr,Bs=pe,js=ie("species"),Us=Array,Hs=function(e){var t;return Ns(e)&&(t=e.constructor,(Fs(t)&&(t===Us||Ns(t.prototype))||Bs(t)&&null===(t=t[js]))&&(t=void 0)),void 0===t?Us:t},Gs=function(e,t){return new(Hs(e))(0===t?0:t)},Vs=As,Ws=$n,Ks=T,zs=Ci,Ys=Gs,Xs=k([].push),qs=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,u,l,f){for(var h,d,p=Ks(c),g=Ws(p),v=Vs(u,l),y=zs(g),m=0,k=f||Ys,b=t?k(c,y):n||s?k(c,0):void 0;y>m;m++)if((a||m in g)&&(d=v(h=g[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return m;case 2:Xs(b,h)}else switch(e){case 4:return!1;case 7:Xs(b,h)}return o?-1:i||r?r:b}},$s={forEach:qs(0),map:qs(1),filter:qs(2),some:qs(3),every:qs(4),find:qs(5),findIndex:qs(6),filterReject:qs(7)},Js=lr,Zs=n,Qs=Pe,ea=k,ta=fe,na=z,ia=d,ra=R,oa=Ie,sa=Se,aa=Qn,ca=at,ua=zo,la=Nt,fa=mo,ha=qr,da=ui,pa=Yo,ga=Fi,va=Hn,ya=le,ma=zr,ka=Gn,ba=En,wa=fs,Ca=i.exports,_a=Wt,xa=D,Sa=ie,Ta=hs,Ea=function(e){var t=gs.Symbol||(gs.Symbol={});vs(t,e)||ms(t,e,{value:ys.f(e)})},Pa=function(){var e=bs("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,i=ws("toPrimitive");t&&!t[i]&&Cs(t,i,(function(e){return ks(n,this)}),{arity:1})},Ra=Ts,Oa=on,La=$s.forEach,Ia=Vt("hidden"),Aa="Symbol",Da="prototype",Ma=Oa.set,Na=Oa.getterFor(Aa),Fa=Object[Da],Ba=Zs.Symbol,ja=Ba&&Ba[Da],Ua=Zs.TypeError,Ha=Zs.QObject,Ga=va.f,Va=ya.f,Wa=pa.f,Ka=ka.f,za=ea([].push),Ya=Ca("symbols"),Xa=Ca("op-symbols"),qa=Ca("wks"),$a=!Ha||!Ha[Da]||!Ha[Da].findChild,Ja=ta&&ia((function(){return 7!=fa(Va({},"a",{get:function(){return Va(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=Ga(Fa,t);i&&delete Fa[t],Va(e,t,n),i&&e!==Fa&&Va(Fa,t,i)}:Va,Za=function(e,t){var n=Ya[e]=fa(ja);return Ma(n,{type:Aa,tag:e,description:t}),ta||(n.description=t),n},Qa=function(e,t,n){e===Fa&&Qa(Xa,t,n),sa(e);var i=ca(t);return sa(n),ra(Ya,i)?(n.enumerable?(ra(e,Ia)&&e[Ia][i]&&(e[Ia][i]=!1),n=fa(n,{enumerable:la(0,!1)})):(ra(e,Ia)||Va(e,Ia,la(1,{})),e[Ia][i]=!0),Ja(e,i,n)):Va(e,i,n)},ec=function(e,t){sa(e);var n=aa(t),i=ha(n).concat(rc(n));return La(i,(function(t){ta&&!Qs(tc,n,t)||Qa(e,t,n[t])})),e},tc=function(e){var t=ca(e),n=Qs(Ka,this,t);return!(this===Fa&&ra(Ya,t)&&!ra(Xa,t))&&(!(n||!ra(this,t)||!ra(Ya,t)||ra(this,Ia)&&this[Ia][t])||n)},nc=function(e,t){var n=aa(e),i=ca(t);if(n!==Fa||!ra(Ya,i)||ra(Xa,i)){var r=Ga(n,i);return!r||!ra(Ya,i)||ra(n,Ia)&&n[Ia][i]||(r.enumerable=!0),r}},ic=function(e){var t=Wa(aa(e)),n=[];return La(t,(function(e){ra(Ya,e)||ra(_a,e)||za(n,e)})),n},rc=function(e){var t=e===Fa,n=Wa(t?Xa:aa(e)),i=[];return La(n,(function(e){!ra(Ya,e)||t&&!ra(Fa,e)||za(i,Ya[e])})),i};na||(Ba=function(){if(oa(ja,this))throw Ua("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ua(arguments[0]):void 0,t=xa(e),n=function(e){this===Fa&&Qs(n,Xa,e),ra(this,Ia)&&ra(this[Ia],t)&&(this[Ia][t]=!1),Ja(this,t,la(1,e))};return ta&&$a&&Ja(Fa,t,{configurable:!0,set:n}),Za(t,e)},ba(ja=Ba[Da],"toString",(function(){return Na(this).tag})),ba(Ba,"withoutSetter",(function(e){return Za(xa(e),e)})),ka.f=tc,ya.f=Qa,ma.f=ec,va.f=nc,da.f=pa.f=ic,ga.f=rc,Ta.f=function(e){return Za(Sa(e),e)},ta&&(wa(ja,"description",{configurable:!0,get:function(){return Na(this).description}}),ba(Fa,"propertyIsEnumerable",tc,{unsafe:!0}))),Js({global:!0,constructor:!0,wrap:!0,forced:!na,sham:!na},{Symbol:Ba}),La(ha(qa),(function(e){Ea(e)})),Js({target:Aa,stat:!0,forced:!na},{useSetter:function(){$a=!0},useSimple:function(){$a=!1}}),Js({target:"Object",stat:!0,forced:!na,sham:!ta},{create:function(e,t){return void 0===t?fa(e):ec(fa(e),t)},defineProperty:Qa,defineProperties:ec,getOwnPropertyDescriptor:nc}),Js({target:"Object",stat:!0,forced:!na},{getOwnPropertyNames:ic}),Pa(),Ra(Ba,Aa),_a[Ia]=!0;var oc=z&&!!Symbol.for&&!!Symbol.keyFor,sc=lr,ac=Le,cc=R,uc=zo,lc=i.exports,fc=oc,hc=lc("string-to-symbol-registry"),dc=lc("symbol-to-string-registry");sc({target:"Symbol",stat:!0,forced:!fc},{for:function(e){var t=uc(e);if(cc(hc,t))return hc[t];var n=ac("Symbol")(t);return hc[t]=n,dc[n]=t,n}});var pc=lr,gc=R,vc=Fe,yc=je,mc=oc,kc=(0,i.exports)("symbol-to-string-registry");pc({target:"Symbol",stat:!0,forced:!mc},{keyFor:function(e){if(!vc(e))throw TypeError(yc(e)+" is not a symbol");if(gc(kc,e))return kc[e]}});var bc=Ms,wc=ue,Cc=Ln,_c=zo,xc=k([].push),Sc=lr,Tc=Le,Ec=gr,Pc=Pe,Rc=k,Oc=d,Lc=ue,Ic=Fe,Ac=vr,Dc=function(e){if(wc(e))return e;if(bc(e)){for(var t=e.length,n=[],i=0;i<t;i++){var r=e[i];"string"==typeof r?xc(n,r):"number"!=typeof r&&"Number"!=Cc(r)&&"String"!=Cc(r)||xc(n,_c(r))}var o=n.length,s=!0;return function(e,t){if(s)return s=!1,t;if(bc(this))return t;for(var i=0;i<o;i++)if(n[i]===e)return t}}},Mc=z,Nc=String,Fc=Tc("JSON","stringify"),Bc=Rc(/./.exec),jc=Rc("".charAt),Uc=Rc("".charCodeAt),Hc=Rc("".replace),Gc=Rc(1..toString),Vc=/[\uD800-\uDFFF]/g,Wc=/^[\uD800-\uDBFF]$/,Kc=/^[\uDC00-\uDFFF]$/,zc=!Mc||Oc((function(){var e=Tc("Symbol")();return"[null]"!=Fc([e])||"{}"!=Fc({a:e})||"{}"!=Fc(Object(e))})),Yc=Oc((function(){return'"\\udf06\\ud834"'!==Fc("\udf06\ud834")||'"\\udead"'!==Fc("\udead")})),Xc=function(e,t){var n=Ac(arguments),i=Dc(t);if(Lc(i)||void 0!==e&&!Ic(e))return n[1]=function(e,t){if(Lc(i)&&(t=Pc(i,this,Nc(e),t)),!Ic(t))return t},Ec(Fc,null,n)},qc=function(e,t,n){var i=jc(n,t-1),r=jc(n,t+1);return Bc(Wc,e)&&!Bc(Kc,r)||Bc(Kc,e)&&!Bc(Wc,i)?"\\u"+Gc(Uc(e,0),16):e};Fc&&Sc({target:"JSON",stat:!0,arity:3,forced:zc||Yc},{stringify:function(e,t,n){var i=Ac(arguments),r=Ec(zc?Xc:Fc,null,i);return Yc&&"string"==typeof r?Hc(r,Vc,qc):r}});var $c=Fi,Jc=T;lr({target:"Object",stat:!0,forced:!z||d((function(){$c.f(1)}))},{getOwnPropertySymbols:function(e){var t=$c.f;return t?t(Jc(e)):[]}});var Zc=lr,Qc=d,eu=Qn,tu=Hn.f,nu=fe;Zc({target:"Object",stat:!0,forced:!nu||Qc((function(){tu(1)})),sham:!nu},{getOwnPropertyDescriptor:function(e,t){return tu(eu(e),t)}});var iu=Vi,ru=Qn,ou=Hn,su=Jo;function au(){return au="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Go(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},au.apply(this,arguments)}lr({target:"Object",stat:!0,sham:!fe},{getOwnPropertyDescriptors:function(e){for(var t,n,i=ru(e),r=ou.f,o=iu(i),s={},a=0;o.length>a;)void 0!==(n=r(i,t=o[a++]))&&su(s,t,n);return s}});var cu=TypeError,uu=function(e){if(e>9007199254740991)throw cu("Maximum allowed index exceeded");return e},lu=d,fu=G,hu=ie("species"),du=function(e){return fu>=51||!lu((function(){var t=[];return(t.constructor={})[hu]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},pu=lr,gu=d,vu=Ms,yu=pe,mu=T,ku=Ci,bu=uu,wu=Jo,Cu=Gs,_u=du,xu=G,Su=ie("isConcatSpreadable"),Tu=xu>=51||!gu((function(){var e=[];return e[Su]=!1,e.concat()[0]!==e})),Eu=function(e){if(!yu(e))return!1;var t=e[Su];return void 0!==t?!!t:vu(e)};pu({target:"Array",proto:!0,arity:1,forced:!Tu||!_u("concat")},{concat:function(e){var t,n,i,r,o,s=mu(this),a=Cu(s,0),c=0;for(t=-1,i=arguments.length;t<i;t++)if(Eu(o=-1===t?s:arguments[t]))for(r=ku(o),bu(c+r),n=0;n<r;n++,c++)n in o&&wu(a,c,o[n]);else bu(c+1),wu(a,c++,o);return a.length=c,a}});var Pu=$s.map;lr({target:"Array",proto:!0,forced:!du("map")},{map:function(e){return Pu(this,e,arguments.length>1?arguments[1]:void 0)}});var Ru=T,Ou=qr;lr({target:"Object",stat:!0,forced:d((function(){Ou(1)}))},{keys:function(e){return Ou(Ru(e))}});var Lu=lr,Iu=Ms,Au=Hr,Du=pe,Mu=yi,Nu=Ci,Fu=Qn,Bu=Jo,ju=ie,Uu=vr,Hu=du("slice"),Gu=ju("species"),Vu=Array,Wu=Math.max;Lu({target:"Array",proto:!0,forced:!Hu},{slice:function(e,t){var n,i,r,o=Fu(this),s=Nu(o),a=Mu(e,s),c=Mu(void 0===t?s:t,s);if(Iu(o)&&(n=o.constructor,(Au(n)&&(n===Vu||Iu(n.prototype))||Du(n)&&null===(n=n[Gu]))&&(n=void 0),n===Vu||void 0===n))return Uu(o,a,c);for(i=new(void 0===n?Vu:n)(Wu(c-a,0)),r=0;a<c;a++,r++)a in o&&Bu(i,r,o[a]);return i.length=r,i}});var Ku={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},zu=me("span").classList,Yu=zu&&zu.constructor&&zu.constructor.prototype,Xu=Yu===Object.prototype?void 0:Yu,qu=d,$u=function(e,t){var n=[][e];return!!n&&qu((function(){n.call(null,t||function(){return 1},1)}))},Ju=$s.forEach,Zu=$u("forEach")?[].forEach:function(e){return Ju(this,e,arguments.length>1?arguments[1]:void 0)},Qu=n,el=Ku,tl=Xu,nl=Zu,il=jt,rl=function(e){if(e&&e.forEach!==nl)try{il(e,"forEach",nl)}catch(t){e.forEach=nl}};for(var ol in el)el[ol]&&rl(Qu[ol]&&Qu[ol].prototype);rl(tl);var sl=Se,al=function(){var e=sl(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},cl=d,ul=n.RegExp,ll=cl((function(){var e=ul("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),fl=ll||cl((function(){return!ul("a","y").sticky})),hl={BROKEN_CARET:ll||cl((function(){var e=ul("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:fl,UNSUPPORTED_Y:ll},dl=d,pl=n.RegExp,gl=dl((function(){var e=pl(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),vl=d,yl=n.RegExp,ml=vl((function(){var e=yl("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),kl=Pe,bl=k,wl=zo,Cl=al,_l=hl,xl=i.exports,Sl=mo,Tl=on.get,El=gl,Pl=ml,Rl=xl("native-string-replace",String.prototype.replace),Ol=RegExp.prototype.exec,Ll=Ol,Il=bl("".charAt),Al=bl("".indexOf),Dl=bl("".replace),Ml=bl("".slice),Nl=function(){var e=/a/,t=/b*/g;return kl(Ol,e,"a"),kl(Ol,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Fl=_l.BROKEN_CARET,Bl=void 0!==/()??/.exec("")[1];(Nl||Bl||Fl||El||Pl)&&(Ll=function(e){var t,n,i,r,o,s,a,c=this,u=Tl(c),l=wl(e),f=u.raw;if(f)return f.lastIndex=c.lastIndex,t=kl(Ll,f,l),c.lastIndex=f.lastIndex,t;var h=u.groups,d=Fl&&c.sticky,p=kl(Cl,c),g=c.source,v=0,y=l;if(d&&(p=Dl(p,"y",""),-1===Al(p,"g")&&(p+="g"),y=Ml(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Il(l,c.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,v++),n=new RegExp("^(?:"+g+")",p)),Bl&&(n=new RegExp("^"+g+"$(?!\\s)",p)),Nl&&(i=c.lastIndex),r=kl(Ol,d?n:c,y),d?r?(r.input=Ml(r.input,v),r[0]=Ml(r[0],v),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:Nl&&r&&(c.lastIndex=c.global?r.index+r[0].length:i),Bl&&r&&r.length>1&&kl(Rl,r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&h)for(r.groups=s=Sl(null),o=0;o<h.length;o++)s[(a=h[o])[0]]=r[a[1]];return r});var jl=Ll;lr({target:"RegExp",proto:!0,forced:/./.exec!==jl},{exec:jl});var Ul=lr,Hl=$n,Gl=Qn,Vl=$u,Wl=k([].join);Ul({target:"Array",proto:!0,forced:Hl!=Object||!Vl("join",",")},{join:function(e){return Wl(Gl(this),void 0===e?",":e)}});var Kl=fe,zl=Ms,Yl=TypeError,Xl=Object.getOwnPropertyDescriptor,ql=Kl&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),$l=je,Jl=TypeError,Zl=function(e,t){if(!delete e[t])throw Jl("Cannot delete property "+$l(t)+" of "+$l(e))},Ql=lr,ef=T,tf=yi,nf=di,rf=Ci,of=ql?function(e,t){if(zl(e)&&!Xl(e,"length").writable)throw Yl("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},sf=uu,af=Gs,cf=Jo,uf=Zl,lf=du("splice"),ff=Math.max,hf=Math.min;Ql({target:"Array",proto:!0,forced:!lf},{splice:function(e,t){var n,i,r,o,s,a,c=ef(this),u=rf(c),l=tf(e,u),f=arguments.length;for(0===f?n=i=0:1===f?(n=0,i=u-l):(n=f-2,i=hf(ff(nf(t),0),u-l)),sf(u+n-i),r=af(c,i),o=0;o<i;o++)(s=l+o)in c&&cf(r,o,c[s]);if(r.length=i,n<i){for(o=l;o<u-i;o++)a=o+n,(s=o+i)in c?c[a]=c[s]:uf(c,a);for(o=u;o>u-i+n;o--)uf(c,o-1)}else if(n>i)for(o=u-i;o>l;o--)a=o+n-1,(s=o+i-1)in c?c[a]=c[s]:uf(c,a);for(o=0;o<n;o++)c[o+l]=arguments[o+2];return of(c,u-i+n),r}});var df,pf,gf,vf,yf="undefined"!=typeof process&&"process"==Ln(process),mf=k,kf=Ve,bf=ue,wf=String,Cf=TypeError,_f=function(e,t,n){try{return mf(kf(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}},xf=Se,Sf=function(e){if("object"==typeof e||bf(e))return e;throw Cf("Can't set "+wf(e)+" as a prototype")},Tf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=_f(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return xf(n),Sf(i),t?e(n,i):n.__proto__=i,n}}():void 0),Ef=Le,Pf=fs,Rf=fe,Of=ie("species"),Lf=function(e){var t=Ef(e);Rf&&t&&!t[Of]&&Pf(t,Of,{configurable:!0,get:function(){return this}})},If=Ie,Af=TypeError,Df=function(e,t){if(If(t,e))return e;throw Af("Incorrect invocation")},Mf=Se,Nf=Kr,Ff=b,Bf=ie("species"),jf=function(e,t){var n,i=Mf(e).constructor;return void 0===i||Ff(n=Mf(i)[Bf])?t:Nf(n)},Uf=TypeError,Hf=function(e,t){if(e<t)throw Uf("Not enough arguments");return e},Gf=/(?:ipad|iphone|ipod).*applewebkit/i.test(M),Vf=n,Wf=gr,Kf=As,zf=ue,Yf=R,Xf=d,qf=io,$f=vr,Jf=me,Zf=Hf,Qf=Gf,eh=yf,th=Vf.setImmediate,nh=Vf.clearImmediate,ih=Vf.process,rh=Vf.Dispatch,oh=Vf.Function,sh=Vf.MessageChannel,ah=Vf.String,ch=0,uh={},lh="onreadystatechange";Xf((function(){df=Vf.location}));var fh=function(e){if(Yf(uh,e)){var t=uh[e];delete uh[e],t()}},hh=function(e){return function(){fh(e)}},dh=function(e){fh(e.data)},ph=function(e){Vf.postMessage(ah(e),df.protocol+"//"+df.host)};th&&nh||(th=function(e){Zf(arguments.length,1);var t=zf(e)?e:oh(e),n=$f(arguments,1);return uh[++ch]=function(){Wf(t,void 0,n)},pf(ch),ch},nh=function(e){delete uh[e]},eh?pf=function(e){ih.nextTick(hh(e))}:rh&&rh.now?pf=function(e){rh.now(hh(e))}:sh&&!Qf?(vf=(gf=new sh).port2,gf.port1.onmessage=dh,pf=Kf(vf.postMessage,vf)):Vf.addEventListener&&zf(Vf.postMessage)&&!Vf.importScripts&&df&&"file:"!==df.protocol&&!Xf(ph)?(pf=ph,Vf.addEventListener("message",dh,!1)):pf=lh in Jf("script")?function(e){qf.appendChild(Jf("script"))[lh]=function(){qf.removeChild(this),fh(e)}}:function(e){setTimeout(hh(e),0)});var gh={set:th,clear:nh},vh=function(){this.head=null,this.tail=null};vh.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var yh,mh,kh,bh,wh,Ch=vh,_h=/ipad|iphone|ipod/i.test(M)&&"undefined"!=typeof Pebble,xh=/web0s(?!.*chrome)/i.test(M),Sh=n,Th=As,Eh=Hn.f,Ph=gh.set,Rh=Ch,Oh=Gf,Lh=_h,Ih=xh,Ah=yf,Dh=Sh.MutationObserver||Sh.WebKitMutationObserver,Mh=Sh.document,Nh=Sh.process,Fh=Sh.Promise,Bh=Eh(Sh,"queueMicrotask"),jh=Bh&&Bh.value;if(!jh){var Uh=new Rh,Hh=function(){var e,t;for(Ah&&(e=Nh.domain)&&e.exit();t=Uh.get();)try{t()}catch(e){throw Uh.head&&yh(),e}e&&e.enter()};Oh||Ah||Ih||!Dh||!Mh?!Lh&&Fh&&Fh.resolve?((bh=Fh.resolve(void 0)).constructor=Fh,wh=Th(bh.then,bh),yh=function(){wh(Hh)}):Ah?yh=function(){Nh.nextTick(Hh)}:(Ph=Th(Ph,Sh),yh=function(){Ph(Hh)}):(mh=!0,kh=Mh.createTextNode(""),new Dh(Hh).observe(kh,{characterData:!0}),yh=function(){kh.data=mh=!mh}),jh=function(e){Uh.head||yh(),Uh.add(e)}}var Gh=jh,Vh=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Wh=n.Promise,Kh="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,zh=!Kh&&!yf&&"object"==typeof window&&"object"==typeof document,Yh=n,Xh=Wh,qh=ue,$h=nr,Jh=It,Zh=ie,Qh=zh,ed=Kh,td=G;Xh&&Xh.prototype;var nd=Zh("species"),id=!1,rd=qh(Yh.PromiseRejectionEvent),od=$h("Promise",(function(){var e=Jh(Xh),t=e!==String(Xh);if(!t&&66===td)return!0;if(!td||td<51||!/native code/.test(e)){var n=new Xh((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((n.constructor={})[nd]=i,!(id=n.then((function(){}))instanceof i))return!0}return!t&&(Qh||ed)&&!rd})),sd={CONSTRUCTOR:od,REJECTION_EVENT:rd,SUBCLASSING:id},ad={},cd=Ve,ud=TypeError,ld=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw ud("Bad Promise constructor");t=e,n=i})),this.resolve=cd(t),this.reject=cd(n)};ad.f=function(e){return new ld(e)};var fd,hd,dd,pd=lr,gd=yf,vd=n,yd=Pe,md=En,kd=Tf,bd=Ts,wd=Lf,Cd=Ve,_d=ue,xd=pe,Sd=Df,Td=jf,Ed=gh.set,Pd=Gh,Rd=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},Od=Vh,Ld=Ch,Id=on,Ad=Wh,Dd=ad,Md="Promise",Nd=sd.CONSTRUCTOR,Fd=sd.REJECTION_EVENT,Bd=sd.SUBCLASSING,jd=Id.getterFor(Md),Ud=Id.set,Hd=Ad&&Ad.prototype,Gd=Ad,Vd=Hd,Wd=vd.TypeError,Kd=vd.document,zd=vd.process,Yd=Dd.f,Xd=Yd,qd=!!(Kd&&Kd.createEvent&&vd.dispatchEvent),$d="unhandledrejection",Jd=function(e){var t;return!(!xd(e)||!_d(t=e.then))&&t},Zd=function(e,t){var n,i,r,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{a?(s||(2===t.rejection&&ip(t),t.rejection=1),!0===a?n=o:(l&&l.enter(),n=a(o),l&&(l.exit(),r=!0)),n===e.promise?u(Wd("Promise-chain cycle")):(i=Jd(n))?yd(i,n,c,u):c(n)):u(o)}catch(e){l&&!r&&l.exit(),u(e)}},Qd=function(e,t){e.notified||(e.notified=!0,Pd((function(){for(var n,i=e.reactions;n=i.get();)Zd(n,e);e.notified=!1,t&&!e.rejection&&tp(e)})))},ep=function(e,t,n){var i,r;qd?((i=Kd.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),vd.dispatchEvent(i)):i={promise:t,reason:n},!Fd&&(r=vd["on"+e])?r(i):e===$d&&Rd("Unhandled promise rejection",n)},tp=function(e){yd(Ed,vd,(function(){var t,n=e.facade,i=e.value;if(np(e)&&(t=Od((function(){gd?zd.emit("unhandledRejection",i,n):ep($d,n,i)})),e.rejection=gd||np(e)?2:1,t.error))throw t.value}))},np=function(e){return 1!==e.rejection&&!e.parent},ip=function(e){yd(Ed,vd,(function(){var t=e.facade;gd?zd.emit("rejectionHandled",t):ep("rejectionhandled",t,e.value)}))},rp=function(e,t,n){return function(i){e(t,i,n)}},op=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Qd(e,!0))},sp=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Wd("Promise can't be resolved itself");var i=Jd(t);i?Pd((function(){var n={done:!1};try{yd(i,t,rp(sp,n,e),rp(op,n,e))}catch(t){op(n,t,e)}})):(e.value=t,e.state=1,Qd(e,!1))}catch(t){op({done:!1},t,e)}}};if(Nd&&(Vd=(Gd=function(e){Sd(this,Vd),Cd(e),yd(fd,this);var t=jd(this);try{e(rp(sp,t),rp(op,t))}catch(e){op(t,e)}}).prototype,(fd=function(e){Ud(this,{type:Md,done:!1,notified:!1,parent:!1,reactions:new Ld,rejection:!1,state:0,value:void 0})}).prototype=md(Vd,"then",(function(e,t){var n=jd(this),i=Yd(Td(this,Gd));return n.parent=!0,i.ok=!_d(e)||e,i.fail=_d(t)&&t,i.domain=gd?zd.domain:void 0,0==n.state?n.reactions.add(i):Pd((function(){Zd(i,n)})),i.promise})),hd=function(){var e=new fd,t=jd(e);this.promise=e,this.resolve=rp(sp,t),this.reject=rp(op,t)},Dd.f=Yd=function(e){return e===Gd||undefined===e?new hd(e):Xd(e)},_d(Ad)&&Hd!==Object.prototype)){dd=Hd.then,Bd||md(Hd,"then",(function(e,t){var n=this;return new Gd((function(e,t){yd(dd,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete Hd.constructor}catch(e){}kd&&kd(Hd,Vd)}pd({global:!0,constructor:!0,wrap:!0,forced:Nd},{Promise:Gd}),bd(Gd,Md,!1),wd(Md);var ap={},cp=ap,up=ie("iterator"),lp=Array.prototype,fp=function(e){return void 0!==e&&(cp.Array===e||lp[up]===e)},hp=Bn,dp=ze,pp=b,gp=ap,vp=ie("iterator"),yp=function(e){if(!pp(e))return dp(e,vp)||dp(e,"@@iterator")||gp[hp(e)]},mp=Pe,kp=Ve,bp=Se,wp=je,Cp=yp,_p=TypeError,xp=function(e,t){var n=arguments.length<2?Cp(e):t;if(kp(n))return bp(mp(n,e));throw _p(wp(e)+" is not iterable")},Sp=Pe,Tp=Se,Ep=ze,Pp=function(e,t,n){var i,r;Tp(e);try{if(!(i=Ep(e,"return"))){if("throw"===t)throw n;return n}i=Sp(i,e)}catch(e){r=!0,i=e}if("throw"===t)throw n;if(r)throw i;return Tp(i),n},Rp=As,Op=Pe,Lp=Se,Ip=je,Ap=fp,Dp=Ci,Mp=Ie,Np=xp,Fp=yp,Bp=Pp,jp=TypeError,Up=function(e,t){this.stopped=e,this.result=t},Hp=Up.prototype,Gp=function(e,t,n){var i,r,o,s,a,c,u,l=n&&n.that,f=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),g=Rp(t,l),v=function(e){return i&&Bp(i,"normal",e),new Up(!0,e)},y=function(e){return f?(Lp(e),p?g(e[0],e[1],v):g(e[0],e[1])):p?g(e,v):g(e)};if(h)i=e.iterator;else if(d)i=e;else{if(!(r=Fp(e)))throw jp(Ip(e)+" is not iterable");if(Ap(r)){for(o=0,s=Dp(e);s>o;o++)if((a=y(e[o]))&&Mp(Hp,a))return a;return new Up(!1)}i=Np(e,r)}for(c=h?e.next:i.next;!(u=Op(c,i)).done;){try{a=y(u.value)}catch(e){Bp(i,"throw",e)}if("object"==typeof a&&a&&Mp(Hp,a))return a}return new Up(!1)},Vp=ie("iterator"),Wp=!1;try{var Kp=0,zp={next:function(){return{done:!!Kp++}},return:function(){Wp=!0}};zp[Vp]=function(){return this},Array.from(zp,(function(){throw 2}))}catch(e){}var Yp=Wh,Xp=function(e,t){if(!t&&!Wp)return!1;var n=!1;try{var i={};i[Vp]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n},qp=sd.CONSTRUCTOR||!Xp((function(e){Yp.all(e).then(void 0,(function(){}))})),$p=Pe,Jp=Ve,Zp=ad,Qp=Vh,eg=Gp;lr({target:"Promise",stat:!0,forced:qp},{all:function(e){var t=this,n=Zp.f(t),i=n.resolve,r=n.reject,o=Qp((function(){var n=Jp(t.resolve),o=[],s=0,a=1;eg(e,(function(e){var c=s++,u=!1;a++,$p(n,t,e).then((function(e){u||(u=!0,o[c]=e,--a||i(o))}),r)})),--a||i(o)}));return o.error&&r(o.value),n.promise}});var tg=lr,ng=sd.CONSTRUCTOR,ig=Wh,rg=Le,og=ue,sg=En,ag=ig&&ig.prototype;if(tg({target:"Promise",proto:!0,forced:ng,real:!0},{catch:function(e){return this.then(void 0,e)}}),og(ig)){var cg=rg("Promise").prototype.catch;ag.catch!==cg&&sg(ag,"catch",cg,{unsafe:!0})}var ug=Pe,lg=Ve,fg=ad,hg=Vh,dg=Gp;lr({target:"Promise",stat:!0,forced:qp},{race:function(e){var t=this,n=fg.f(t),i=n.reject,r=hg((function(){var r=lg(t.resolve);dg(e,(function(e){ug(r,t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var pg=Pe,gg=ad;lr({target:"Promise",stat:!0,forced:sd.CONSTRUCTOR},{reject:function(e){var t=gg.f(this);return pg(t.reject,void 0,e),t.promise}});var vg=Se,yg=pe,mg=ad,kg=lr,bg=sd.CONSTRUCTOR,wg=function(e,t){if(vg(e),yg(t)&&t.constructor===e)return t;var n=mg.f(e);return(0,n.resolve)(t),n.promise};Le("Promise"),kg({target:"Promise",stat:!0,forced:bg},{resolve:function(e){return wg(this,e)}});var Cg=fe,_g=St.EXISTS,xg=k,Sg=fs,Tg=Function.prototype,Eg=xg(Tg.toString),Pg=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Rg=xg(Pg.exec);Cg&&!_g&&Sg(Tg,"name",{configurable:!0,get:function(){try{return Rg(Pg,Eg(this))[1]}catch(e){return""}}}),lr({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Og=ue,Lg=pe,Ig=Tf,Ag=function(e,t,n){var i,r;return Ig&&Og(i=t.constructor)&&i!==n&&Lg(r=i.prototype)&&r!==n.prototype&&Ig(e,r),e},Dg=k(1..valueOf),Mg="\t\n\v\f\r                 \u2028\u2029\ufeff",Ng=_,Fg=zo,Bg=Mg,jg=k("".replace),Ug=RegExp("^["+Bg+"]+"),Hg=RegExp("(^|[^"+Bg+"])["+Bg+"]+$"),Gg=function(e){return function(t){var n=Fg(Ng(t));return 1&e&&(n=jg(n,Ug,"")),2&e&&(n=jg(n,Hg,"$1")),n}},Vg={start:Gg(1),end:Gg(2),trim:Gg(3)},Wg=lr,Kg=fe,zg=n,Yg=ps,Xg=k,qg=nr,$g=R,Jg=Ag,Zg=Ie,Qg=Fe,ev=rt,tv=d,nv=ui.f,iv=Hn.f,rv=le.f,ov=Dg,sv=Vg.trim,av="Number",cv=zg[av];Yg[av];var uv=cv.prototype,lv=zg.TypeError,fv=Xg("".slice),hv=Xg("".charCodeAt),dv=function(e){var t,n,i,r,o,s,a,c,u=ev(e,"number");if(Qg(u))throw lv("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=sv(u),43===(t=hv(u,0))||45===t){if(88===(n=hv(u,2))||120===n)return NaN}else if(48===t){switch(hv(u,1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+u}for(s=(o=fv(u,2)).length,a=0;a<s;a++)if((c=hv(o,a))<48||c>r)return NaN;return parseInt(o,i)}return+u},pv=qg(av,!cv(" 0o1")||!cv("0b1")||cv("+0x1")),gv=function(e){var t,n=arguments.length<1?0:cv(function(e){var t=ev(e,"number");return"bigint"==typeof t?t:dv(t)}(e));return Zg(uv,t=this)&&tv((function(){ov(t)}))?Jg(Object(n),this,gv):n};gv.prototype=uv,pv&&(uv.constructor=gv),Wg({global:!0,constructor:!0,wrap:!0,forced:pv},{Number:gv});pv&&function(e,t){for(var n,i=Kg?nv(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),r=0;i.length>r;r++)$g(t,n=i[r])&&!$g(e,n)&&rv(e,n,iv(t,n))}(Yg[av],cv);var vv=ie,yv=mo,mv=le.f,kv=vv("unscopables"),bv=Array.prototype;null==bv[kv]&&mv(bv,kv,{configurable:!0,value:yv(null)});var wv,Cv,_v,xv=function(e){bv[kv][e]=!0},Sv=!d((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Tv=R,Ev=ue,Pv=T,Rv=Sv,Ov=Vt("IE_PROTO"),Lv=Object,Iv=Lv.prototype,Av=Rv?Lv.getPrototypeOf:function(e){var t=Pv(e);if(Tv(t,Ov))return t[Ov];var n=t.constructor;return Ev(n)&&t instanceof n?n.prototype:t instanceof Lv?Iv:null},Dv=d,Mv=ue,Nv=pe,Fv=Av,Bv=En,jv=ie("iterator"),Uv=!1;[].keys&&("next"in(_v=[].keys())?(Cv=Fv(Fv(_v)))!==Object.prototype&&(wv=Cv):Uv=!0);var Hv=!Nv(wv)||Dv((function(){var e={};return wv[jv].call(e)!==e}));Hv&&(wv={}),Mv(wv[jv])||Bv(wv,jv,(function(){return this}));var Gv={IteratorPrototype:wv,BUGGY_SAFARI_ITERATORS:Uv},Vv=Gv.IteratorPrototype,Wv=mo,Kv=Nt,zv=Ts,Yv=ap,Xv=function(){return this},qv=function(e,t,n,i){var r=t+" Iterator";return e.prototype=Wv(Vv,{next:Kv(+!i,n)}),zv(e,r,!1),Yv[r]=Xv,e},$v=lr,Jv=Pe,Zv=ue,Qv=qv,ey=Av,ty=Tf,ny=Ts,iy=jt,ry=En,oy=ap,sy=St.PROPER,ay=St.CONFIGURABLE,cy=Gv.IteratorPrototype,uy=Gv.BUGGY_SAFARI_ITERATORS,ly=ie("iterator"),fy="keys",hy="values",dy="entries",py=function(){return this},gy=function(e,t,n,i,r,o,s){Qv(n,t,i);var a,c,u,l=function(e){if(e===r&&g)return g;if(!uy&&e in d)return d[e];switch(e){case fy:case hy:case dy:return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",h=!1,d=e.prototype,p=d[ly]||d["@@iterator"]||r&&d[r],g=!uy&&p||l(r),v="Array"==t&&d.entries||p;if(v&&(a=ey(v.call(new e)))!==Object.prototype&&a.next&&(ey(a)!==cy&&(ty?ty(a,cy):Zv(a[ly])||ry(a,ly,py)),ny(a,f,!0)),sy&&r==hy&&p&&p.name!==hy&&(ay?iy(d,"name",hy):(h=!0,g=function(){return Jv(p,this)})),r)if(c={values:l(hy),keys:o?g:l(fy),entries:l(dy)},s)for(u in c)(uy||h||!(u in d))&&ry(d,u,c[u]);else $v({target:t,proto:!0,forced:uy||h},c);return d[ly]!==g&&ry(d,ly,g,{name:r}),oy[t]=g,c},vy=function(e,t){return{value:e,done:t}},yy=Qn,my=xv,ky=ap,by=on,wy=le.f,Cy=gy,_y=vy,xy=fe,Sy="Array Iterator",Ty=by.set,Ey=by.getterFor(Sy),Py=Cy(Array,"Array",(function(e,t){Ty(this,{type:Sy,target:yy(e),index:0,kind:t})}),(function(){var e=Ey(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,_y(void 0,!0)):_y("keys"==n?i:"values"==n?t[i]:[i,t[i]],!1)}),"values"),Ry=ky.Arguments=ky.Array;if(my("keys"),my("values"),my("entries"),xy&&"values"!==Ry.name)try{wy(Ry,"name",{value:"values"})}catch(e){}var Oy=n,Ly=Ku,Iy=Xu,Ay=Py,Dy=jt,My=ie,Ny=My("iterator"),Fy=My("toStringTag"),By=Ay.values,jy=function(e,t){if(e){if(e[Ny]!==By)try{Dy(e,Ny,By)}catch(t){e[Ny]=By}if(e[Fy]||Dy(e,Fy,t),Ly[t])for(var n in Ay)if(e[n]!==Ay[n])try{Dy(e,n,Ay[n])}catch(t){e[n]=Ay[n]}}};for(var Uy in Ly)jy(Oy[Uy]&&Oy[Uy].prototype,Uy);jy(Iy,"DOMTokenList");var Hy=$s.filter;lr({target:"Array",proto:!0,forced:!du("filter")},{filter:function(e){return Hy(this,e,arguments.length>1?arguments[1]:void 0)}});var Gy=fe,Vy=k,Wy=Pe,Ky=d,zy=qr,Yy=Fi,Xy=Gn,qy=T,$y=$n,Jy=Object.assign,Zy=Object.defineProperty,Qy=Vy([].concat),em=!Jy||Ky((function(){if(Gy&&1!==Jy({b:1},Jy(Zy({},"a",{enumerable:!0,get:function(){Zy(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!=Jy({},e)[n]||zy(Jy({},t)).join("")!=i}))?function(e,t){for(var n=qy(e),i=arguments.length,r=1,o=Yy.f,s=Xy.f;i>r;)for(var a,c=$y(arguments[r++]),u=o?Qy(zy(c),o(c)):zy(c),l=u.length,f=0;l>f;)a=u[f++],Gy&&!Wy(s,c,a)||(n[a]=c[a]);return n}:Jy,tm=em;lr({target:"Object",stat:!0,arity:2,forced:Object.assign!==tm},{assign:tm});var nm={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,u,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,i),!0;case 4:return l.fn.call(l.context,t,i,r),!0;case 5:return l.fn.call(l.context,t,i,r,o),!0;case 6:return l.fn.call(l.context,t,i,r,o,s),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,i);break;case 4:l[u].fn.call(l[u].context,t,i,r);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].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,u=[],l=a.length;c<l;c++)(a[c].fn!==t||r&&!a[c].once||i&&a[c].context!==i)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u: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}(nm);var im=nm.exports;function rm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function om(e){return function(e){if(Array.isArray(e))return rm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return rm(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)?rm(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 sm=Rs,am=En,cm=jl,um=d,lm=ie,fm=jt,hm=lm("species"),dm=RegExp.prototype,pm=function(e,t,n,i){var r=lm(e),o=!um((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),s=o&&!um((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[hm]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!o||!s||n){var a=sm(/./[r]),c=t(r,""[e],(function(e,t,n,i,r){var s=sm(e),c=t.exec;return c===cm||c===dm.exec?o&&!r?{done:!0,value:a(t,n,i)}:{done:!0,value:s(n,t,i)}:{done:!1}}));am(String.prototype,e,c[0]),am(dm,r,c[1])}i&&fm(dm[r],"sham",!0)},gm=k,vm=di,ym=zo,mm=_,km=gm("".charAt),bm=gm("".charCodeAt),wm=gm("".slice),Cm=function(e){return function(t,n){var i,r,o=ym(mm(t)),s=vm(n),a=o.length;return s<0||s>=a?e?"":void 0:(i=bm(o,s))<55296||i>56319||s+1===a||(r=bm(o,s+1))<56320||r>57343?e?km(o,s):i:e?wm(o,s,s+2):r-56320+(i-55296<<10)+65536}},_m={codeAt:Cm(!1),charAt:Cm(!0)},xm=_m.charAt,Sm=function(e,t,n){return t+(n?xm(e,t).length:1)},Tm=Pe,Em=Se,Pm=ue,Rm=Ln,Om=jl,Lm=TypeError,Im=function(e,t){var n=e.exec;if(Pm(n)){var i=Tm(n,e,t);return null!==i&&Em(i),i}if("RegExp"===Rm(e))return Tm(Om,e,t);throw Lm("RegExp#exec called on incompatible receiver")},Am=Pe,Dm=Se,Mm=b,Nm=bi,Fm=zo,Bm=_,jm=ze,Um=Sm,Hm=Im;pm("match",(function(e,t,n){return[function(t){var n=Bm(this),i=Mm(t)?void 0:jm(t,e);return i?Am(i,t,n):new RegExp(t)[e](Fm(n))},function(e){var i=Dm(this),r=Fm(e),o=n(t,i,r);if(o.done)return o.value;if(!i.global)return Hm(i,r);var s=i.unicode;i.lastIndex=0;for(var a,c=[],u=0;null!==(a=Hm(i,r));){var l=Fm(a[0]);c[u]=l,""===l&&(i.lastIndex=Um(r,Nm(i.lastIndex),s)),u++}return 0===u?null:c}]}));var Gm=pe,Vm=Ln,Wm=ie("match"),Km=function(e){var t;return Gm(e)&&(void 0!==(t=e[Wm])?!!t:"RegExp"==Vm(e))},zm=Pe,Ym=R,Xm=Ie,qm=al,$m=RegExp.prototype,Jm=function(e){var t=e.flags;return void 0!==t||"flags"in $m||Ym(e,"flags")||!Xm($m,e)?t:zm(qm,e)},Zm=le.f,Qm=fe,ek=n,tk=k,nk=nr,ik=Ag,rk=jt,ok=ui.f,sk=Ie,ak=Km,ck=zo,uk=Jm,lk=hl,fk=function(e,t,n){n in e||Zm(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},hk=En,dk=d,pk=R,gk=on.enforce,vk=Lf,yk=gl,mk=ml,kk=ie("match"),bk=ek.RegExp,wk=bk.prototype,Ck=ek.SyntaxError,_k=tk(wk.exec),xk=tk("".charAt),Sk=tk("".replace),Tk=tk("".indexOf),Ek=tk("".slice),Pk=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Rk=/a/g,Ok=/a/g,Lk=new bk(Rk)!==Rk,Ik=lk.MISSED_STICKY,Ak=lk.UNSUPPORTED_Y,Dk=Qm&&(!Lk||Ik||yk||mk||dk((function(){return Ok[kk]=!1,bk(Rk)!=Rk||bk(Ok)==Ok||"/a/i"!=bk(Rk,"i")})));if(nk("RegExp",Dk)){for(var Mk=function(e,t){var n,i,r,o,s,a,c=sk(wk,this),u=ak(e),l=void 0===t,f=[],h=e;if(!c&&u&&l&&e.constructor===Mk)return e;if((u||sk(wk,e))&&(e=e.source,l&&(t=uk(h))),e=void 0===e?"":ck(e),t=void 0===t?"":ck(t),h=e,yk&&"dotAll"in Rk&&(i=!!t&&Tk(t,"s")>-1)&&(t=Sk(t,/s/g,"")),n=t,Ik&&"sticky"in Rk&&(r=!!t&&Tk(t,"y")>-1)&&Ak&&(t=Sk(t,/y/g,"")),mk&&(o=function(e){for(var t,n=e.length,i=0,r="",o=[],s={},a=!1,c=!1,u=0,l="";i<=n;i++){if("\\"===(t=xk(e,i)))t+=xk(e,++i);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:_k(Pk,Ek(e,i+1))&&(i+=2,c=!0),r+=t,u++;continue;case">"===t&&c:if(""===l||pk(s,l))throw new Ck("Invalid capture group name");s[l]=!0,o[o.length]=[l,u],c=!1,l="";continue}c?l+=t:r+=t}return[r,o]}(e),e=o[0],f=o[1]),s=ik(bk(e,t),c?this:wk,Mk),(i||r||f.length)&&(a=gk(s),i&&(a.dotAll=!0,a.raw=Mk(function(e){for(var t,n=e.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(t=xk(e,i))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+xk(e,++i);return r}(e),n)),r&&(a.sticky=!0),f.length&&(a.groups=f)),e!==h)try{rk(s,"source",""===h?"(?:)":h)}catch(e){}return s},Nk=ok(bk),Fk=0;Nk.length>Fk;)fk(Mk,bk,Nk[Fk++]);wk.constructor=Mk,Mk.prototype=wk,hk(ek,"RegExp",Mk,{constructor:!0})}vk("RegExp");var Bk=St.PROPER,jk=En,Uk=Se,Hk=zo,Gk=d,Vk=Jm,Wk="toString",Kk=RegExp.prototype[Wk],zk=Gk((function(){return"/a/b"!=Kk.call({source:"a",flags:"b"})})),Yk=Bk&&Kk.name!=Wk;(zk||Yk)&&jk(RegExp.prototype,Wk,(function(){var e=Uk(this);return"/"+Hk(e.source)+"/"+Hk(Vk(e))}),{unsafe:!0});var Xk=gr,qk=Pe,$k=k,Jk=pm,Zk=Se,Qk=b,eb=Km,tb=_,nb=jf,ib=Sm,rb=bi,ob=zo,sb=ze,ab=is,cb=Im,ub=jl,lb=d,fb=hl.UNSUPPORTED_Y,hb=4294967295,db=Math.min,pb=[].push,gb=$k(/./.exec),vb=$k(pb),yb=$k("".slice),mb=!lb((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]}));Jk("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=ob(tb(this)),r=void 0===n?hb:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!eb(e))return qk(t,i,e,r);for(var o,s,a,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,u+"g");(o=qk(ub,f,i))&&!((s=f.lastIndex)>l&&(vb(c,yb(i,l,o.index)),o.length>1&&o.index<i.length&&Xk(pb,c,ab(o,1)),a=o[0].length,l=s,c.length>=r));)f.lastIndex===o.index&&f.lastIndex++;return l===i.length?!a&&gb(f,"")||vb(c,""):vb(c,yb(i,l)),c.length>r?ab(c,0,r):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:qk(t,this,e,n)}:t,[function(t,n){var r=tb(this),o=Qk(t)?void 0:sb(t,e);return o?qk(o,t,r,n):qk(i,ob(r),t,n)},function(e,r){var o=Zk(this),s=ob(e),a=n(i,o,s,r,i!==t);if(a.done)return a.value;var c=nb(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(fb?"g":"y"),f=new c(fb?"^(?:"+o.source+")":o,l),h=void 0===r?hb:r>>>0;if(0===h)return[];if(0===s.length)return null===cb(f,s)?[s]:[];for(var d=0,p=0,g=[];p<s.length;){f.lastIndex=fb?0:p;var v,y=cb(f,fb?yb(s,p):s);if(null===y||(v=db(rb(f.lastIndex+(fb?p:0)),s.length))===d)p=ib(s,p,u);else{if(vb(g,yb(s,d,p)),g.length===h)return g;for(var m=1;m<=y.length-1;m++)if(vb(g,y[m]),g.length===h)return g;p=d=v}}return vb(g,yb(s,d)),g}]}),!mb,fb);var kb=k,bb=T,wb=Math.floor,Cb=kb("".charAt),_b=kb("".replace),xb=kb("".slice),Sb=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Tb=/\$([$&'`]|\d{1,2})/g,Eb=gr,Pb=Pe,Rb=k,Ob=pm,Lb=d,Ib=Se,Ab=ue,Db=b,Mb=di,Nb=bi,Fb=zo,Bb=_,jb=Sm,Ub=ze,Hb=function(e,t,n,i,r,o){var s=n+e.length,a=i.length,c=Tb;return void 0!==r&&(r=bb(r),c=Sb),_b(o,c,(function(o,c){var u;switch(Cb(c,0)){case"$":return"$";case"&":return e;case"`":return xb(t,0,n);case"'":return xb(t,s);case"<":u=r[xb(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>a){var f=wb(l/10);return 0===f?o:f<=a?void 0===i[f-1]?Cb(c,1):i[f-1]+Cb(c,1):o}u=i[l-1]}return void 0===u?"":u}))},Gb=Im,Vb=ie("replace"),Wb=Math.max,Kb=Math.min,zb=Rb([].concat),Yb=Rb([].push),Xb=Rb("".indexOf),qb=Rb("".slice),$b="$0"==="a".replace(/./,"$0"),Jb=!!/./[Vb]&&""===/./[Vb]("a","$0");Ob("replace",(function(e,t,n){var i=Jb?"$":"$0";return[function(e,n){var i=Bb(this),r=Db(e)?void 0:Ub(e,Vb);return r?Pb(r,e,i,n):Pb(t,Fb(i),e,n)},function(e,r){var o=Ib(this),s=Fb(e);if("string"==typeof r&&-1===Xb(r,i)&&-1===Xb(r,"$<")){var a=n(t,o,s,r);if(a.done)return a.value}var c=Ab(r);c||(r=Fb(r));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var f=[];;){var h=Gb(o,s);if(null===h)break;if(Yb(f,h),!u)break;""===Fb(h[0])&&(o.lastIndex=jb(s,Nb(o.lastIndex),l))}for(var d,p="",g=0,v=0;v<f.length;v++){for(var y=Fb((h=f[v])[0]),m=Wb(Kb(Mb(h.index),s.length),0),k=[],b=1;b<h.length;b++)Yb(k,void 0===(d=h[b])?d:String(d));var w=h.groups;if(c){var C=zb([y],k,m,s);void 0!==w&&Yb(C,w);var _=Fb(Eb(r,void 0,C))}else _=Hb(y,s,m,k,w,r);m>=g&&(p+=qb(s,g,m)+_,g=m+y.length)}return p+qb(s,g)}]}),!!Lb((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!$b||Jb);var Zb=St.PROPER,Qb=d,ew=Mg,tw=Vg.trim;lr({target:"String",proto:!0,forced:function(e){return Qb((function(){return!!ew[e]()||"​…᠎"!=="​…᠎"[e]()||Zb&&ew[e].name!==e}))}("trim")},{trim:function(){return tw(this)}});var nw=is,iw=Math.floor,rw=function(e,t){var n=e.length,i=iw(n/2);return n<8?ow(e,t):sw(e,rw(nw(e,0,i),t),rw(nw(e,i),t),t)},ow=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},sw=function(e,t,n,i){for(var r=t.length,o=n.length,s=0,a=0;s<r||a<o;)e[s+a]=s<r&&a<o?i(t[s],n[a])<=0?t[s++]:n[a++]:s<r?t[s++]:n[a++];return e},aw=rw,cw=M.match(/firefox\/(\d+)/i),uw=!!cw&&+cw[1],lw=/MSIE|Trident/.test(M),fw=M.match(/AppleWebKit\/(\d+)\./),hw=!!fw&&+fw[1],dw=lr,pw=k,gw=Ve,vw=T,yw=Ci,mw=Zl,kw=zo,bw=d,ww=aw,Cw=$u,_w=uw,xw=lw,Sw=G,Tw=hw,Ew=[],Pw=pw(Ew.sort),Rw=pw(Ew.push),Ow=bw((function(){Ew.sort(void 0)})),Lw=bw((function(){Ew.sort(null)})),Iw=Cw("sort"),Aw=!bw((function(){if(Sw)return Sw<70;if(!(_w&&_w>3)){if(xw)return!0;if(Tw)return Tw<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++)Ew.push({k:t+i,v:n})}for(Ew.sort((function(e,t){return t.v-e.v})),i=0;i<Ew.length;i++)t=Ew[i].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));dw({target:"Array",proto:!0,forced:Ow||!Lw||!Iw||!Aw},{sort:function(e){void 0!==e&&gw(e);var t=vw(this);if(Aw)return void 0===e?Pw(t):Pw(t,e);var n,i,r=[],o=yw(t);for(i=0;i<o;i++)i in t&&Rw(r,t[i]);for(ww(r,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:kw(t)>kw(n)?1:-1}}(e)),n=yw(r),i=0;i<n;)t[i]=r[i++];for(;i<o;)mw(t,i++);return t}});var Dw="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Mw={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Nw="%c[xgplayer]",Fw={config:{debug:Dw?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,[Nw,Mw.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,[Nw,Mw.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,[Nw,Mw.error,e].concat(r))}}};var Bw=function(){function e(t){Fo(this,e),this.bufferedList=t}return No(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}(),jw={};function Uw(e){var t=Ao(e);return null!==e&&("object"===t||"function"===t)}function Hw(e,t,n){var i,r,o,s,a,c,u=0,l=!1,f=!1,h=!0,d=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,o=r;return i=r=void 0,u=t,s=e.apply(o,n)}function g(e,t){return d?(window.cancelAnimationFrame(a),window.requestAnimationFrame(e)):setTimeout(e,t)}function v(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-u>=o}function y(){var e=Date.now();if(v(e))return m(e);a=g(y,function(e){var n=e-u,i=t-(e-c);return f?Math.min(i,o-n):i}(e))}function m(e){return a=void 0,h&&i?p(e):(i=r=void 0,s)}function k(){for(var e=Date.now(),n=v(e),o=arguments.length,h=new Array(o),d=0;d<o;d++)h[d]=arguments[d];if(i=h,r=this,c=e,n){if(void 0===a)return function(e){return u=e,a=g(y,t),l?p(e):s}(c);if(f)return a=g(y,t),p(c)}return void 0===a&&(a=g(y,t)),s}return t=+t||0,Uw(n)&&(l=!!n.leading,o=(f="maxWait"in n)?Math.max(+n.maxWait||0,t):o,h="trailing"in n?!!n.trailing:h),k.cancel=function(){void 0!==a&&function(e){if(d)return window.cancelAnimationFrame(e);clearTimeout(e)}(a),u=0,i=c=r=a=void 0},k.flush=function(){return void 0===a?s:m(Date.now())},k.pending=function(){return void 0!==a},k}jw.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},jw.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&&jw.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(e){return Fw.logError("util.createDomFromHtml",e),null}},jw.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"===Ao(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},jw.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(n){jw.hasClass(e,t)||(e.className&&"object"===Ao(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},jw.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(n){jw.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Ao(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},jw.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){jw.hasClass(e,t)?jw.removeClass(e,t):jw.addClass(e,t)}))},jw.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===jw.typeOf(e[n])?t.push(e[n]):"Object"===jw.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(" ")},jw.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){Fw.logError("util.findDom",i),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},jw.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},jw.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},jw.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=jw.padStart(Math.floor(e/3600),2,0),n=jw.padStart(Math.floor((e-3600*t)/60),2,0),i=jw.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},jw.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},jw.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},jw.deepCopy=function(e,t){if("Object"===jw.typeOf(t)&&"Object"===jw.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==jw.typeOf(t[n])||t[n]instanceof Node?"Array"===jw.typeOf(t[n])?e[n]="Array"===jw.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]:jw.deepCopy(e[n],t[n])})),e},jw.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i;"Array"===jw.typeOf(t[n])&&"Array"===jw.typeOf(e[n])?"Array"===jw.typeOf(e[n])&&(i=e[n]).push.apply(i,om(t[n])):jw.typeOf(e[n])!==jw.typeOf(t[n])||null===e[n]||"Object"!==jw.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):jw.deepMerge(e[n],t[n])})),e},jw.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},jw.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""},jw.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),i))},jw.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},jw.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),jw.clearTimeout(e,i)}),n);return e._timers.push(i),i},jw.clearTimeout=function(e,t){var n=e._timers;if("Array"===jw.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1),clearTimeout(t);break}}else clearTimeout(t)},jw.clearAllTimers=function(e){var t=e._timers;"Array"===jw.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},jw.createImgBtn=function(e,t,n,i){var r,o,s,a=jw.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},jw.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)"},jw.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},jw.checkIsFunction=function(e){return e&&"function"==typeof e},jw.checkIsObject=function(e){return null!==e&&"object"===Ao(e)},jw.hide=function(e){e.style.display="none"},jw.show=function(e,t){e.style.display=t||"block"},jw.isUndefined=function(e){if(null==e)return!0},jw.setStyleFromCsstext=function(e,t){t&&("String"===jw.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]})))},jw.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&&(!function(e,t){for(var n=0,i=t.length;n<i;n++)if(e.indexOf(t[n])>-1)return!0;return!1}(n[0],t)?o[n[0]]=n[1]:r[n[0]]=n[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},jw.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},jw.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)},i.src=e}},jw.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},jw.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},jw.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},jw.checkTouchSupport=function(){return"ontouchstart"in window},jw.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 Bw(r)},jw.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.touches&&e.touches.length>0&&(e=e.touches[0]),{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},jw.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},jw.getHostFromUrl=function(e){if("String"!==jw.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},jw.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},jw.isMSE=function(e){return!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},jw.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},jw.adjustTimeByDuration=function(e,t,n){return t&&e&&(e>t||n&&e<t)?t:e};var Gw=/(Android)\s([\d.]+)/,Vw=/(Version)\/([\d.]+)/,Ww=["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"],Kw={get device(){return Kw.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(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?Vw:Gw)?t.exec(e):[];if(n&&n.length>=3){var i=n[2].split(".");return i.length>0?parseInt(i[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;return!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&Ww.map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var n=e.video||{},i=e.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}}},zw=Kw,Yw=JSON.parse('"3.0.0-alpha.115-2"'),Xw={1:"network",2:"network",3:"decoder",4:"format"},qw=No((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null,src:null};Fo(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,u=t.currentSrc,l=t.video,f=l.readyState,h=l.networkState,d={playerVersion:Yw,domain:document.domain,currentTime:s,duration:o,ended:a,readyState:f,networkState:h,src:n.src||c||u,errorType:n.errorType,errorCode:n.errorCode||r.code,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:"",host:jw.getHostFromUrl(c||u)};return n.ext&&Object.keys(n.ext).map((function(e){d[e]=n.ext[e]})),d}if(arguments.length>1){for(var p={playerVersion:Yw,domain:document.domain},g=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],v=0;v<arguments.length;v++)p[g[v]]=arguments[v];return p.ex=i?(i[arguments[0]]||{}).msg:"",p}})),$w="play",Jw="playing",Zw="ended",Qw="pause",eC="error",tC="seeking",nC="seeked",iC="timeupdate",rC="waiting",oC="canplay",sC="durationchange",aC="volumechange",cC="loadeddata",uC="ratechange",lC="progress",fC="loadstart",hC="emptied",dC="focus",pC="blur",gC="ready",vC="urlNull",yC="autoplay_started",mC="autoplay_was_prevented",kC="complete",bC="replay",wC="destroy",CC="urlchange",_C="download_speed_change",xC="buffer_control",SC="fullscreen_change",TC="cssFullscreen_change",EC="mini_state_change",PC="definition_change",RC="after_definition_change",OC="video_resize",LC="pip_change",IC="rotate",AC="screenShot",DC="playnext",MC="shortcut",NC="xglog",FC="user_action",BC="reset",jC="source_error",UC="source_success",HC=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],GC={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},VC="fps_stuck",WC=Object.freeze({__proto__:null,PLAY:$w,PLAYING:Jw,ENDED:Zw,PAUSE:Qw,ERROR:eC,SEEKING:tC,SEEKED:nC,TIME_UPDATE:iC,WAITING:rC,CANPLAY:oC,CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:sC,VOLUME_CHANGE:aC,LOADED_DATA:cC,LOADED_METADATA:"loadedmetadata",RATE_CHANGE:uC,PROGRESS:lC,LOAD_START:fC,EMPTIED:hC,STALLED:"stalled",SUSPEND:"suspend",ABORT:"abort",BUFFER_CHANGE:"bufferedChange",PLAYER_FOCUS:dC,PLAYER_BLUR:pC,READY:gC,URL_NULL:vC,AUTOPLAY_STARTED:yC,AUTOPLAY_PREVENTED:mC,COMPLETE:kC,REPLAY:bC,DESTROY:wC,URL_CHANGE:CC,DOWNLOAD_SPEED_CHANGE:_C,BUFFER_CONTROLS:xC,FULLSCREEN_CHANGE:SC,CSS_FULLSCREEN_CHANGE:TC,MINI_STATE_CHANGE:EC,DEFINITION_CHANGE:PC,BEFORE_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:RC,SEI_PARSED:"SEI_PARSED",RETRY:"retry",VIDEO_RESIZE:OC,PIP_CHANGE:LC,ROTATE:IC,SCREEN_SHOT:AC,PLAYNEXT:DC,SHORTCUT:MC,XGLOG:NC,USER_ACTION:FC,RESET:BC,SOURCE_ERROR:jC,SOURCE_SUCCESS:UC,SWITCH_SUBTITLE:"switch_subtitle",VIDEO_EVENTS:HC,STATS_EVENTS:GC,FPS_STUCK:VC});function KC(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}function zC(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var YC=function(e){jo(n,e);var t=KC(n);function n(e){var i;Fo(this,n),(i=t.call(this,e))._hasStart=!1,i._currentTime=0,i._duration=0,i._internalOp={},i._lastMuted=!1,i.vtype=e.vtype||"MP4",i._rate=-1,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:0|e.tabindex,mediaType:e.mediaType||"video","data-index":-1},e.videoConfig,e.videoAttributes);var r=e["x5-video-player-type"]||e.x5VideoPlayerType;return zw.isWeixin&&zw.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=jw.createDom(i.videoConfig.mediaType,"",i.videoConfig,""),e.defaultPlaybackRate&&(i.video.defaultPlaybackRate=i.video.playbackRate=e.defaultPlaybackRate),"Number"===jw.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 No(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(e){var t=this;this.evHandlers||(this._evHandlers=HC.map((function(e){return Vo({},e,(i=t,r="on".concat((n=e).charAt(0).toUpperCase()).concat(n.slice(1)),i[r]&&"function"==typeof i[r]&&i.on(n,i[r]),function(e,t){var r=n,o={player:i,eventName:r,originalEvent:e,detail:e.detail||{},timeStamp:e.timeStamp,currentTime:i.currentTime,duration:i.duration,paused:i.paused,ended:i.ended,isInternalOp:!!i._internalOp[e.type],muted:i.muted,volume:i.volume,host:jw.getHostFromUrl(i.currentSrc),vtype:i.vtype};if(i.removeInnerOP(e.type),"timeupdate"===r&&(i._currentTime=i.video&&i.video.currentTime),"ratechange"===r){var s=i.video?i.video.playbackRate:0;if(s&&i._rate===s)return;i._rate=i.video&&i.video.playbackRate}if("durationchange"===r&&(i._duration=i.video.duration),"volumechange"===r&&(o.isMutedChange=i._lastMuted!==i.muted,i._lastMuted=i.muted),"error"===r&&(o.error=t||i.video.error),i.videoEventMiddleware[n]){var a=zC.bind(i,n,o);try{i.videoEventMiddleware[n].call(i,o,a)}catch(e){throw zC.call(i,r,o),e}}else zC.call(i,r,o)}));var n,i,r}))),e||(e=this.video),this._evHandlers.forEach((function(t){var n=Object.keys(t)[0];e.addEventListener(n,t[n],!1)}))}},{key:"detachVideoEvents",value:function(e){e||(e=this.video),this._evHandlers.map((function(t){var n=Object.keys(t)[0];e.removeEventListener(Object.keys(t)[0],t[n],!1)}))}},{key:"_attachSourceEvents",value:function(e,t){var n=this;e.removeAttribute("src"),e.load(),e.removeEventListener("loadeddata",this._vLoadeddata),t.forEach((function(e){n.video.appendChild(jw.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||"")}))}));var i=e.children;if(i){this._videoSourceCount=i.length,this._vLoadeddata=function(e){n.emit(UC,{src:e.target.currentSrc,host:jw.getHostFromUrl(e.target.currentSrc)})};for(var r=null,o=0;o<this._evHandlers.length;o++)if("error"===Object.keys(this._evHandlers[o])[0]){r=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){if(n._videoSourceCount--,0===n._videoSourceCount){var t={code:4,message:"sources_load_error"};r?r.error(e,t):n.errorHandler("error",t)}var i=Xw[4];n.emit(jC,new qw(n,{errorType:i,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var s=0;s<i.length;s++)i[s].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var n=0;n<t.length;n++)t[n].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.video&&(this.video.error||t)){var n=this.video.error||t,i=n.code?Xw[n.code]:"other";n.message;this.video.currentSrc||(n={code:6,message:"empty_src_".concat(n.message)}),this.emit(e,new qw(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,this.emit("hasstart"))}},{key:"destroy",value:function(){var e=this;for(var t 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._hasStart=!1,this.videoConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,t)&&(clearInterval(this._interval[t]),this._interval[t]=null);this.detachVideoEvents(),this._evHandlers.map((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,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:"load",value:function(){this.video&&this.video.load()}},{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?jw.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(){if(!this.video||!this.video.error)return null;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?this.video.networkState:0}},{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?this.video.readyState:0}},{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(CC,e),this.emit(rC),this._currentTime=0,this._duration=0,/^blob/.test(this.video.currentSrc)||/^blob/.test(this.video.src)?this.onWaiting():(this._detachSourceEvents(this.video),"Array"===jw.typeOf(e)?this._attachSourceEvents(this.video,e):e?this.video.src=e:this.video.removeAttribute("src"),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=au(Go(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=au(Go(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=au(Go(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=au(Go(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){au(Go(n.prototype),"removeAllListeners",this).call(this)}}]),n}(im),XC=YC,qC=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"}};Fo(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return No(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}(),$C=qC,JC=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],ZC=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],QC=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],e_="data-xgplayerid",t_={BUFFER_CONTROLS:"buffer_control"},n_={PLAYING:"playing",WAITING:"waiting"},i_=lr,r_=$s.find,o_=xv,s_="find",a_=!0;function c_(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 u_(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&&c_.apply(void 0,[r,t,n.next].concat(om(i)))})).catch((function(e){throw e})):c_.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&c_.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 c_.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function l_(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 f_(e,t){var n=this.__hooks;n&&delete n[e]}function h_(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 d_(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,i)}}}function p_(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 g_(e){e.__hooks=null}function v_(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 y_(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 m_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y_(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k_(e,t){Fw.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}s_ in[]&&Array(1)[s_]((function(){a_=!1})),i_({target:"Array",proto:!0,forced:a_},{find:function(e){return r_(this,e,arguments.length>1?arguments[1]:void 0)}}),o_(s_);var b_=function(){function e(t){Fo(this,e),jw.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),p_(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return No(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){e||(e=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=jw.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)})):k_(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(i){n.__onceEvents[i]=t,n.player.once(e,t)})):k_(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)})):k_(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(n){e[t][n]&&e.off(n,e[t][n]),n&&delete e[t][n]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(i))}}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=m_(m_({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return u_.call.apply(u_,[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 l_.call.apply(l_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return f_.call.apply(f_,[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(),jw.clearAllTimers(this),jw.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),g_(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var w_=Element.prototype;w_.matches=w_.matchesSelector||w_.mozMatchesSelector||w_.msMatchesSelector||w_.oMatchesSelector||w_.webkitMatchesSelector}var C_=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function __(e,t,n,i,r){var o=x_.apply(this,arguments);return e.addEventListener(n,o,r),{destroy:function(){e.removeEventListener(n,o,r)}}}function x_(e,t,n,i){return function(n){n.delegateTarget=C_(n.target,t),n.delegateTarget&&i.call(e,n)}}var S_=function(e,t,n,i,r){return"function"==typeof e.addEventListener?__.apply(null,arguments):"function"==typeof n?__.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return __(e,t,n,i,r)})))};function T_(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var E_={CONTROLS:"controls",ROOT:"root"},P_={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"},R_="xg-icon-disable";function O_(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function L_(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 jw.addClass(e,n),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(O_(e)||O_(e.url))return i.src=O_(e)?e:e.url||"",o=jw.createDom(e.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof e)try{return(o=e())instanceof window.Element?(jw.addClass(o,n),Object.keys(i).map((function(e){o.setAttribute(e,i[e])})),o):(Fw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(e){return Fw.logError("Plugin named [".concat(r,"]:createIcon"),e),null}return"string"==typeof e?jw.createDomFromHtml(e,i,n):(Fw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function I_(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"===Ao(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],o),s=function(e,t){return"object"===Ao(e)&&e.attr&&"object"===Ao(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],s),a=L_(n[i],i,o,s,t.pluginName)),!a&&r&&(a=L_(r.icon?r.icon:r,s,o,{},t.pluginName)),t.icons[i]=a}))}var A_=function(e){jo(n,e);var t=T_(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Fo(this,n),(e=t.call(this,i)).__delegates=[],e}return No(n,[{key:"__init",value:function(e){if(au(Go(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,i=null;this.icons={},this.root=null,this.parent=null,I_(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 Fw.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=jw.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||{},u=this.config.style||{};this.setAttr(c),this.setStyle(u),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"===Ao(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"===Ao(s)&&"function"==typeof s.plugin&&(i=s.options?jw.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:"disable",value:function(){this.config.disable=!0,jw.addClass(this.find(".xgplayer-icon"),R_)}},{key:"enable",value:function(){this.config.disable=!1,jw.removeClass(this.find(".xgplayer-icon"),R_)}},{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=au(Go(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"===jw.typeOf(e)?this.root.style[e]=t:void("Object"===jw.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"===jw.typeOf(e)?this.root.setAttribute(e,t):void("Object"===jw.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 Fw.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)),au(Go(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 u=Number(a.getAttribute("data-index"));if(u>=r){c="beforebegin";break}u<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=S_(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}));else{var s=S_(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}return o}},{key:"ROOT_TYPES",get:function(){return E_}},{key:"POSITIONS",get:function(){return P_}}]),n}(b_),D_=_m.charAt,M_=zo,N_=on,F_=gy,B_=vy,j_="String Iterator",U_=N_.set,H_=N_.getterFor(j_);F_(String,"String",(function(e){U_(this,{type:j_,string:M_(e),index:0})}),(function(){var e,t=H_(this),n=t.string,i=t.index;return i>=n.length?B_(void 0,!0):(e=D_(n,i),t.index+=e.length,B_(e,!1))}));var G_=function(){function e(){var t=this;if(Fo(this,e),Vo(this,"__trigger",(function(e){var n=(new Date).getTime();t.timeStamp=n;for(var i=0;i<e.length;i++)t.__runHandler(e[i].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Uw(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Hw(e,t,{leading:i,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(e){console.error(e)}}return No(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=e.getAttribute(e_),i=this.__handlers,r=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(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}}]),e}(),V_=null;var W_={pluginGroup:{},init:function(e){var t,n,i=e._pluginInfoId;i||(i=(new Date).getTime(),e._pluginInfoId=i),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.getVideoSize()},V_||(V_=new G_),V_.addObserver(t,n)),0===Object.keys(this.pluginGroup).length&&(e.isUserActive=!0),this.pluginGroup[i]={_player:e,_originalOptions:e.config||{},_plugins:{}}},checkPlayerRoot:function(e){if(this.pluginGroup){for(var t=Object.keys(this.pluginGroup),n=0;n<t.length;n++){var i=this.pluginGroup[t[n]]._player;if(i.root===e)return i}return null}return null},formatPluginInfo:function(e,t){var n=null,i=null;return e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),t&&(i.config=t||{}),{PLUFGIN:n,options:i}},checkPluginIfExits:function(e,t){for(var n=0;n<t.length;n++)if(e.toLowerCase()===t[n].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var n=Object.keys(t),i=null,r=0;r<n.length;r++)if(e.toLowerCase()===n[r].toLowerCase()){i=t[n[r]];break}return"Object"===jw.typeOf(i)?{root:i.root,position:i.position}:{}},lazyRegister:function(e,t){var n=this,i=t.timeout||1500;return Promise.race([t.loader().then((function(t){var i;i=t&&t.__esModule?t.default:t,n.register(e,i,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),i)}))])},register:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var r=this.pluginGroup[i]._plugins,o=this.pluginGroup[i]._originalOptions;n.player=this.pluginGroup[i]._player;var 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 u=o[a[c]];"Object"===jw.typeOf(u)&&(n.config=Object.assign({},n.config,o[a[c]]));break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===n.config[e]&&(n.config[e]=t.defaultConfig[e])})),n.root?"string"==typeof n.root&&(n.root=e[n.root]):n.root=e.root,n.index=n.config.index||0;try{r[s.toLowerCase()]&&(this.unRegister(i,s.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(s,"] exist, destroy the old instance")));var l=new t(n);return r[s.toLowerCase()]=l,r[s.toLowerCase()].func=t,l&&"function"==typeof l.afterCreate&&l.afterCreate(),l}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[n]&&this.pluginGroup[n]._plugins&&delete this.pluginGroup[n]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var n=e._pluginInfoId;if(!n||!this.pluginGroup[n])return null;var i=t.toLowerCase();return this.pluginGroup[n]._plugins[i]},beforeInit:function(e){var t=this;function n(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(i){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var r=e._pluginInfoId;if(t.pluginGroup[r]){var o=t.pluginGroup[r]._plugins,s=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();s.push(n(t))}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(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins;Object.keys(n).forEach((function(e){n[e]&&n[e].afterPlayerInit&&n[e].afterPlayerInit()}))}},setLang:function(e,t){var n=t._pluginInfoId;if(n&&this.pluginGroup[n]){var i=this.pluginGroup[n]._plugins;Object.keys(i).forEach((function(t){if(i[t].updateLang)i[t].updateLang(e);else try{i[t].lang=e}catch(e){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,n=e._pluginInfoId;if(n&&this.pluginGroup[n]){var i=[],r=this.pluginGroup[n]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(i.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(n,e))})),i.forEach((function(n){t.register(e,n.plugin,n.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins||{};Object.keys(n).forEach((function(e){n[e].onPluginsReady&&"function"==typeof n[e].onPluginsReady&&n[e].onPluginsReady()}))}},setCurrentUserActive:function(e,t){if(this.pluginGroup[e]){if(!t)return this.pluginGroup[e]._player.isUserActive=t,e;for(var n=Object.keys(this.pluginGroup),i=0;i<n.length;i++){var r=this.pluginGroup[n[i]];r&&r._player&&(this.pluginGroup[n[i]]._player.isUserActive=!1)}return this.pluginGroup[e]._player.isUserActive=t,e}},getCurrentUseActiveId:function(){if(this.pluginGroup){for(var e=Object.keys(this.pluginGroup),t=0;t<e.length;t++){var n=this.pluginGroup[e[t]];if(n&&n._player&&n._player.isUserActive)return e[t]}return null}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var n,i;n=e.root,V_.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 u=Object.keys(this.pluginGroup);u.length>0&&this.setCurrentUserActive(u[u.length-1],!0)}}}},K_=W_,z_={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"};function Y_(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},ignores:[],whitelist:[],inactive:3e3,lang:(e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),"zh-cn"===e&&(e="zh"),e),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}};var e}function X_(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var q_=function(e){jo(n,e);var t=X_(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var n=Uo(e),i=n.player;n.playerConfig.closeControlsBlur&&i.focus({autoHide:!1})})),Vo(Uo(e),"onMouseLeave",(function(){Uo(e).player.focus()})),e}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.controls&&(e.config.disable=!e.player.config.controls),e.config.mode||"mobile"!==zw.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,o=t.autoHide;if(!n){"flex"===r&&this.player.addClass(z_.FLEX_CONTROLS),o&&this.player.addClass(z_.AUTOHIDE);var s={height:"".concat(i,"px")};Object.keys(s).map((function(t){e.root.style[t]=s[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(EC,(function(t){t?jw.addClass(e.root,"mini-controls"):jw.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==zw.device&&"mobile"!==a&&(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&&jw.addClass(this.root,"control_autohide")}},{key:"pauseAutoHide",value:function(){jw.removeClass(this.root,"control_autohide")}},{key:"show",value:function(){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:r.position){case P_.CONTROLS_LEFT:t.root=this.left;break;case P_.CONTROLS_RIGHT:t.root=this.right;break;case P_.CONTROLS_CENTER:t.root=this.center;break;case P_.CONTROLS:t.root=this.root;break;default:t.root=this.left}return au(Go(n.prototype),"registerPlugin",this).call(this,e,t,i)}}}},{key:"destroy",value:function(){"mobile"!==zw.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=jw.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},{control_autohide:n},{controls_permanent:!n},{"xgplayer-controls-initshow":i||!n});return'<xg-controls class="'.concat(r,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),n}(A_),$_=q_,J_={lang:{},langKeys:[],textKeys:[]};function Z_(e,t){return Object.keys(t).forEach((function(n){var i,r=jw.typeOf(t[n]),o=jw.typeOf(e[n]);"Array"===r?("Array"!==o&&(e[n]=[]),(i=e[n]).push.apply(i,om(t[n]))):"Object"===r?("Object"!==o&&(e[n]={}),Z_(e[n],t[n])):e[n]=t[n]})),e}function Q_(){Object.keys(J_.lang.en).map((function(e){J_.textKeys[e]=e}))}function ex(e,t){var n=e.LANG;if(t||(t=J_),t.lang){var i=e.TEXT||{};"zh"===n&&(n="zh-cn"),t.lang[n]?Z_(t.lang[n],i):(t.langKeys.push(n),t.lang[n]=i),Q_()}}ex({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 tx={get textKeys(){return J_.textKeys},get langKeys(){return J_.langKeys},get lang(){var e={};return J_.langKeys.map((function(t){e[t]=J_.lang[t]})),J_.lang["zh-cn"]&&(e.zh=J_.lang["zh-cn"]||{}),e},extend:function(e,t){var n=[];if(t||(t=J_),t.lang){n="Array"!==jw.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var i=t.lang;n.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?Z_(i[e.LANG]||{},e.TEXT||{}):ex(e,t)})),Q_()}},use:ex,init:function(e){var t,n={lang:{},langKeys:[],textKeys:{},pId:e};return Z_(n.lang,J_.lang),(t=n.langKeys).push.apply(t,om(J_.langKeys)),Z_(n.textKeys,J_.textKeys),n}},nx=tx;function ix(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 rx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ix(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ix(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ox(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var sx=["play","pause","replay","retry","playnext"],ax=0,cx=0,ux=function(e){jo(n,e);var t=ox(n);function n(e){var i;Fo(this,n);var r,o=jw.deepMerge(Y_(),e);Vo(Uo(i=t.call(this,o)),"canPlayFunc",(function(){if(i.config){var e=i.config,t=e.autoplay,n=e.startTime,r=e.defaultPlaybackRate;Fw.logInfo("player","canPlayFunc, startTime",n),n&&(i.currentTime=n>i.duration?i.duration:n,i.config.startTime=0),i.playbackRate=r,t&&i.videoPlay(),i.off(oC,i.canPlayFunc),i.removeClass(z_.ENTER)}})),Vo(Uo(i),"onFullscreenChange",(function(e,t){var n=function(){jw.setTimeout(Uo(i),(function(){i.getVideoSize()}),100)},r=jw.getFullScreenEl();i._fullActionFrom?i._fullActionFrom="":i.emit(FC,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:i.currentTime,duration:i.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,n){if(e){var i=e.getAttribute(n);return!(!i||i!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,i.playerId,e_);if(t||r&&(r===i._fullscreenEl||o))n(),!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!0,i.emit(SC,!0,i._fullScreenOffset),i.cssfullscreen&&i.exitCssFullscreen();else if(i.fullscreen){n();var s=Uo(i),a=s._fullScreenOffset;s.config.needFullscreenScroll?(window.scrollTo(a.left,a.top),jw.setTimeout(Uo(i),(function(){i.fullscreen=!1,i._fullScreenOffset=null}),100)):(!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!1,i._fullScreenOffset=null),i.cssfullscreen?i.removeClass(z_.FULLSCREEN):i.recoverFullStyle(i.root,i._fullscreenEl,z_.FULLSCREEN),i._fullscreenEl=null,i.emit(SC,!1)}})),Vo(Uo(i),"_onWebkitbeginfullscreen",(function(e){i._fullscreenEl=i.video,i.onFullscreenChange(e,!0)})),Vo(Uo(i),"_onWebkitendfullscreen",(function(e){i.onFullscreenChange(e,!1)})),p_(Uo(i),sx),i.config=o,i._pluginInfoId=jw.generateSessionId(),(r=Uo(i)).logInfo=Fw.logInfo.bind(r),r.logWarn=Fw.logWarn.bind(r),r.logError=Fw.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);return i.userTimer=null,i.waitTimer=null,i.isReady=!1,i.isPlaying=!1,i.isError=!1,i.isSeeking=!1,i.isCanplay=!1,i._runPending=!1,i.rotateDeg=0,i.isActive=!1,i.isBufferControlPaused=!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._accPlayed={t:0,acc:0,loopAcc:0},i.innerContainer=null,i.controls=null,i.topBar=null,i.topBar=null,i.root=null,i.__i18n=nx.init(),zw.os.isAndroid&&zw.osVersion>0&&zw.osVersion<6&&(i.config.autoplay=!1),i.database=new $C,i.isUserActive=!1,i._onceSeekCanplay=null,i._isPauseBeforeSeek=0,i.innerStates={isActiveLocked:!1},i._initDOM()?(i._bindEvents(),i._registerPresets(),i._registerPlugins(),K_.onPluginsReady(Uo(i)),jw.setTimeout(Uo(i),(function(){i.emit(gC),i.onReady&&i.onReady(),i.isReady=!0}),0),i.getInitDefinition(),(i.config.videoInit||i.config.autoplay)&&(i.hasStart||i.start()),i):(console.error(new Error("can't find the dom which id is ".concat(i.config.id," or this.config.el does not exist"))),Ho(i))}return No(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(eC,new qw("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=K_.checkPlayerRoot(this.root);n&&(Fw.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(e_,this.playerId),K_.init(this),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.video.setAttribute(e_,this.playerId),this.config.controls){var s=K_.register(this,$_);this.controls=s}var a="mobile"===this.config.isMobileSimulateMode?"mobile":zw.device;if(this.addClass("".concat(z_.DEFAULT," ").concat(z_.ACTIVE," xgplayer-").concat(a," ").concat(this.config.controls?"":z_.NO_CONTROLS)),this.config.autoplay?this.addClass(z_.ENTER):this.addClass(z_.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(t){e.root.style[t]=c[t]}))}else["width","height"].map((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=jw.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=jw.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=jw.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=jw.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 e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),JC.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),zw.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once("loadeddata",this.getVideoSize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.video.focus()},this.once("play",this.playFunc),this.on(xC,this.onBufferControl)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),JC.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off("play",this.playFunc),this.off("canplay",this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.video&&(e&&""!==e&&("Array"!==jw.typeOf(e)||0!==e.length)||(e="",this.emit(vC),Fw.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.video),"Array"===jw.typeOf(e)&&e.length>0?this._attachSourceEvents(this.video,e):this.video.src&&this.video.src===e?e||this.video.removeAttribute("src"):this.video.src=e,"Number"===jw.typeOf(this.config.volume)&&(this.volume=this.config.volume);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;Fw.logInfo("_startInit readyState",i),this.config.autoplay&&(!/^blob/.test(this.video.currentSrc)&&!/^blob/.test(this.video.src)&&this.load(),(zw.os.isIpad||zw.os.isPhone)&&this.videoPlay()),i>=2?this.canPlayFunc():this.once(oC,this.canPlayFunc),jw.setTimeout(this,(function(){t.emit(kC)}),1),this.hasStart||K_.afterInit(this),this.hasStart=!0}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var n=this.config.ignores||[],i=this.config.plugins||[],r=this.config.i18n||[];t&&nx.extend(r,this.__i18n);var o=n.join("||").toLowerCase().split("||"),s=this.plugins;i.forEach((function(n){try{var i=n.plugin?n.plugin.pluginName:n.pluginName;if(!i)return;var r=i.toLowerCase(),a=e.config[r]||e.config[i];if("Boolean"===jw.typeOf(a)&&!a||o.indexOf(r)>-1)return;if(!t&&s[r])return;if(n.lazy&&n.loader){var c=K_.lazyRegister(e,n);return void(n.forceBeforeInit&&(c.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})).catch((function(t){Fw.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})),e._loadingPlugins.push(c)))}return e.registerPlugin(n)}catch(e){Fw.logError("_registerPlugins:",e)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,i,r=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=r.plugins,s=void 0===o?[]:o,a=r.ignores,c=void 0===a?[]:a,u=r.icons,l=void 0===u?{}:u,f=r.i18n,h=void 0===f?[]:f;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(n=e.config.plugins).push.apply(n,om(s)),(i=e.config.ignores).push.apply(i,om(c)),Object.keys(l).map((function(t){e.config.icons[t]||(e.config.icons[t]=l[t])}));var d=e.config.i18n||[];h.push.apply(h,om(d)),e.config.i18n=h}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case P_.ROOT_RIGHT:t=this.rightBar;break;case P_.ROOT_LEFT:t=this.leftBar;break;case P_.ROOT_TOP:t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=K_.formatPluginInfo(e,t),i=n.PLUFGIN,r=n.options,o=this.config.plugins;!K_.checkPluginIfExits(i.pluginName,o)&&o.push(i);var s=K_.getRootByConfig(i.pluginName,this.config);s.root&&(r.root=s.root),s.position&&(r.position=s.position);var a=r.position?r.position:r.config&&r.config.position||i.defaultConfig&&i.defaultConfig.position;return!r.root&&"string"==typeof a&&a.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,r,i.pluginName):(r.root||(r.root=this._getRootByPosition(a)),K_.register(this,i,r))}},{key:"deregister",value:function(e){"string"==typeof e?K_.unRegister(this,e):e instanceof b_&&K_.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.deregister(e),t&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof b_&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--){if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return K_.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=K_.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(jw.hasClass(this.root,e)||jw.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&jw.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return jw.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!this.hasStart)return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this._registerPlugins(!1),K_.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",Fw.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e){var t=this,n=e;"Object"===jw.typeOf(e)&&(n=e.url);var i=this.currentTime,r=this.paused&&!this.isError;return this.src=n,new Promise((function(e){var n=function(){t.currentTime=i,r&&t.once("canplay",(function(){t.pause()})),e()};zw.os.isAndroid?t.once("timeupdate",(function(){n()})):t.once("canplay",(function(){n()})),t.play()}))}},{key:"videoPlay",value:function(){var e=this;if(this.hasStart){this.isPlaying||(this.removeClass(z_.NO_START),!this.isCanplay&&this.addClass(z_.ENTER));var t=au(Go(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(z_.NOT_ALLOW_AUTOPLAY),e.addClass(z_.PLAYING),e.isPlaying||(Fw.logInfo(">>>>playPromise.then"),e.isPlaying=!0,e.emit(yC))})).catch((function(t){if(Fw.logWarn(">>>>playPromise.catch",t.name),e.video&&e.video.error)return e.onError(),void e.removeClass(z_.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=jw.setTimeout(e,(function(){e._errorTimer=null,e.emit(mC),e.addClass(z_.NOT_ALLOW_AUTOPLAY),e.removeClass(z_.ENTER),e.pause()}),0))})):(Fw.logWarn("video.play not return promise"),this.isPlaying||(this.isPlaying=!0,this.removeClass(z_.NOT_ALLOW_AUTOPLAY),this.removeClass(z_.NO_START),this.removeClass(z_.ENTER),this.addClass(z_.PLAYING),this.emit(yC))),t}this.removeClass(z_.NO_START),this.addClass(z_.ENTER);var i=this.start();i&&i.then((function(t){!e.config.autoplay&&e.videoPlay()}))}},{key:"videoPause",value:function(){au(Go(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;this.removeClass(z_.PAUSED),v_(this,"play",(function(){e.videoPlay()}))}},{key:"pause",value:function(e){var t=this;v_(this,"pause",(function(){e===t_.BUFFER_CONTROLS?t.isBufferControlPaused||(t.isBufferControlPaused=!0,t.emit(xC,{type:n_.WAITING})):t.isBufferControlPaused&&(t.isBufferControlPaused=!1,t.emit(xC,{type:n_.PLAYING})),au(Go(n.prototype),"pause",t).call(t)}),e)}},{key:"seek",value:function(e,t){var n=this;if(this.video&&!Number.isNaN(Number(e))&&this.hasStart){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._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(nC,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(z_.ENTER),n.isSeeking=!1,s){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(nC,this._onceSeekCanplay),this.isPlaying?this.currentTime=e:(this.removeClass(z_.NO_START),this.currentTime=e,this.play())}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,n=t.definition;!t.url&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map((function(t){t.definition===n.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t.definition)}))}},{key:"changeDefinition",value:function(e,t){var n=this;if(this.emit(PC,{from:t,to:e}),this.curDefinition=e.definition,this.hasStart){var i=this.switchURL(e.url);i&&i.then?i.then((function(){n.emit(RC,{from:t,to:e})})):this.emit(RC,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once("loadeddata",this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[z_.NOT_ALLOW_AUTOPLAY,z_.PLAYING,z_.NO_START,z_.PAUSED,z_.REPLAY,z_.ENTER,z_.ENDED,z_.ERROR,z_.LOADING];this.hasStart=!1,this.isError=!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(z_.ENTER),this.emit(BC)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),n)){var i=Y_();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=i[t])}))}}},{key:"destroy",value:function(){var e=this,t=this.innerContainer,i=this.root,r=this.video;if(i&&r){if(i.removeAttribute(e_),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.video),jw.clearAllTimers(this),this.emit(wC),K_.destroy(this),g_(this),au(Go(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root)try{this.exitFullscreen()}catch(e){}if(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"),["isReady","isPlaying","isSeeking","isCanplay","isActive","isCssfullScreen","fullscreen"].map((function(t){e[t]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(z_.ENDED),this.currentTime=0,this.isSeeking=!1,v_(this,"replay",(function(){e.once(nC,(function(){var t=e.videoPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(bC),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(z_.ERROR),this.addClass(z_.LOADING),v_(this,"retry",(function(){var t=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(oC,(function(){e.videoPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,n,i){e&&(i||(i=z_.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=jw.filterStyleFromText(e)),jw.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=jw.filterStyleFromText(t),jw.addClass(t,i),t.setAttribute(e_,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,i){i||(i=z_.PARENT_FULLSCREEN),this._orgCss&&(jw.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),jw.removeClass(e,n),t&&t!==e&&this._orgPCss&&(jw.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",jw.removeClass(t,i),t.removeAttribute(e_))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,n=this.video;if(e||(e=t),this._fullScreenOffset={top:jw.scrollTop(),left:jw.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",jw.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{this.changeFullStyle(this.root,e,z_.FULLSCREEN);for(var i=0;i<ZC.length;i++){var r=ZC[i];if(e[r]){var o="webkitRequestFullscreen"===r?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[r]();return o&&o.then?o:Promise.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Promise.resolve()):(this.recoverFullStyle(this.root,this._fullscreenEl,z_.FULLSCREEN),Promise.reject(new Error("call getFullscreen fail")))}catch(e){return this.recoverFullStyle(this.root,this._fullscreenEl,z_.FULLSCREEN),Promise.reject(e)}}},{key:"exitFullscreen",value:function(e){if(this._fullscreenEl||jw.getFullScreenEl()){this.root;var t=this.video;this._fullActionFrom="exit";for(var n=0;n<QC.length;n++){var i=QC[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"))}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.fullscreen&&this.exitFullscreen(),this._cssfullscreenEl=e,this.changeFullStyle(this.root,e,e?z_.INNER_FULLSCREEN:z_.CSS_FULLSCREEN),this.isCssfullScreen=!0,this.emit(TC,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?z_.INNER_FULLSCREEN:z_.CSS_FULLSCREEN;this.fullscreen?this.removeClass(e):this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this._cssfullscreenEl=null,this.isCssfullScreen=!1,this.emit(TC,!1)}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(dC,rx({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(pC,rx({paused:this.paused,ended:this.ended},e)):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3},n=this.innerStates;if(this.isActive=!0,this.removeClass(z_.ACTIVE),this.userTimer&&(jw.clearTimeout(this,this.userTimer),this.userTimer=null),void 0!==t.isLock&&(n.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||n.isActiveLocked)this.userTimer&&(jw.clearTimeout(this,this.userTimer),this.userTimer=null);else{var i=t&&t.delay?t.delay:this.config.inactive;this.userTimer=jw.setTimeout(this,(function(){e.userTimer=null,e.blur()}),i)}}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};if(this.isActive&&!this.innerStates.isActiveLocked){var t=this.config.closePauseVideoFocus;this.isActive=!1,(e.ignorePaused||t||!this.paused&&!this.ended)&&this.addClass(z_.ACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.hasStart&&this.removeClass(z_.ENTER),!this.isBufferControlPaused&&this.removeClass(z_.LOADING),this.isCanplay=!0,this.waitTimer&&jw.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1}},{key:"onPlay",value:function(){this.removeClass(z_.PAUSED),this.ended&&this.removeClass(z_.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){!this.isBufferControlPaused&&this.addClass(z_.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(jw.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.isBufferControlPaused=!1,this.updateAcc("ended"),this.addClass(z_.ENDED)}},{key:"onError",value:function(){this.isBufferControlPaused=!1,this.isError=!0,this.updateAcc("error"),this.removeClass(z_.NOT_ALLOW_AUTOPLAY),this.removeClass(z_.NO_START),this.removeClass(z_.ENTER),this.removeClass(z_.LOADING),this.addClass(z_.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(z_.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&jw.clearTimeout(this,this.waitTimer),this.removeClass(z_.LOADING),this.removeClass(z_.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&jw.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=jw.setTimeout(this,(function(){e.addClass(z_.LOADING),jw.clearTimeout(e,e.waitTimer),e.waitTimer=null}),200)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[z_.NO_START,z_.PAUSED,z_.ENDED,z_.ERROR,z_.REPLAY,z_.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.getVideoSize(),(this.waitTimer||this.hasClass(z_.LOADING))&&this.video.readyState>2&&(!this.isBufferControlPaused&&this.removeClass(z_.LOADING),jw.clearTimeout(this,this.waitTimer),this.waitTimer=null),this.paused||this.isPlaying||!this.duration||(this.isPlaying=!0,this.emit(yC)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===jw.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"onBufferControl",value:function(e){this.isPlaying&&("waiting"===e.type?(this.isBufferControlPaused=!0,this.addClass(z_.LOADING),this.removeClass(z_.PAUSED)):"playing"===e.type&&(this.isBufferControlPaused=!1,this.removeClass(z_.LOADING),this.paused&&this.addClass(z_.PAUSED)))}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.video&&t&&e){var i="String"===jw.typeOf(e)?e:e.type||"";"switch_play_pause"===t&&("Undefined"===jw.typeOf(n.paused)&&(n.paused=this.paused),n.isFirstStart=!this.playing),this.emit(FC,rx({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=parseInt(1e3*(e||this.video.currentTime||0),10),i=t.length,r=0;r<i;r++)if(parseInt(1e3*t.start(r),10)+200<=n&&parseInt(1e3*t.end(r),10)-200>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).map((function(n){if("plugins"!==n){t.config[n]=e[n];var i=t.plugins[n.toLowerCase()];i&&"Function"===jw.typeOf(i.setConfig)&&i.setConfig(e[n])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this._currentTime=0,this._duration=0,this.isPlaying=!1,this.setConfig(e),v_(this,"playnext",(function(){t.start(),t.emit(DC,e)}))}},{key:"getVideoSize",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,u=a.width,l=a.height-c,f=parseInt(n/i*1e3,10),h=parseInt(u/l*1e3,10),d=u,p=l,g={};"auto"===o&&h>f||"fixWidth"===o?(p=u/f*1e3,this.config.fluid?g.paddingTop="".concat(100*p/d,"%"):g.height="".concat(p+c,"px")):("auto"===o&&h<f||"fixHeight"===o)&&(d=f*l/1e3,g.width="".concat(d,"px")),this.fullscreen||this.isCssfullScreen||Object.keys(g).map((function(t){e.root.style[t]=g[t]})),("fillHeight"===s&&h<f||"fillWidth"===s&&h>f)&&this.setAttribute("data-xgfill","cover");var v={videoScale:f,vWidth:d,vHeight:p,cWidth:d,cHeight:p+c};this.emit(OC,v)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.video.updateObjectPosition?this.video.updateObjectPosition(e,t):this.video.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&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.map((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:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.video||!this.video.getVideoPlaybackQuality)return e;var t=this.video.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){0!==nx.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,K_.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(nx.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return Yw}},{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=au(Go(n.prototype),"readyState",this);return this.i18n[e]||e}},{key:"error",get:function(){var e=au(Go(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){var e=au(Go(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:"avgSpeed",get:function(){return cx},set:function(e){cx=e}},{key:"realTimeSpeed",get:function(){return ax},set:function(e){ax=e}},{key:"hook",value:function(e,t){return u_.call.apply(u_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return l_.call.apply(l_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return f_.call.apply(f_,[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 h_.call.apply(h_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return d_.call.apply(d_,[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),K_.setCurrentUserActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Fw.config.debug},set:function(e){Fw.config.debug=e}},{key:"pluginsManager",get:function(){return K_}},{key:"getCurrentUserActivePlayerId",value:function(){return K_.getCurrentUseActiveId()}},{key:"setCurrentUserActive",value:function(e,t){K_.setCurrentUserActive(e,t)}},{key:"isHevcSupported",value:function(){return zw.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return zw.probeConfigSupported(e)}},{key:"install",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]||(n.plugins[e]=t)}},{key:"use",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]=t}}]),n}(XC);function lx(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 fx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}function hx(){return(new Date).getTime()}Vo(ux,"defaultPreset",null),Vo(ux,"XgVideoProxy",null);var dx="loadstart",px="loadeddata",gx="firstFrame",vx="waitingStart",yx="waitingEnd",mx="seekStart",kx="seekEnd",bx="waitingEndExt",wx="seekEndEndExt",Cx=function(e){jo(n,e);var t=fx(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(Fw.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),Vo(Uo(e),"_onAutoplayStart",(function(){Fw.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),Vo(Uo(e),"_onReset",(function(){e._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=hx(),e.loadedCostTime=0,e.startCostTime=0,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&jw.clearTimeout(Uo(e),e._waitTimer),e._waittTimer&&jw.clearTimeout(Uo(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),Vo(Uo(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=hx(),e.emitLog(mx,{start:hx()}))})),Vo(Uo(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),Vo(Uo(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=hx(),e.fixedWaitingStart=hx(),e._waitType=1,e.emitLog(vx,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),Vo(Uo(e),"_onWaiting",(function(){!e._isWaiting&&e.vt&&(e._isWaiting=!0,e.vt?e.seekingStart?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=hx(),e._waitTimer=jw.setTimeout(Uo(e),(function(){e._isWaiting&&(e.waitingStart=hx(),jw.clearTimeout(Uo(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(vx,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),Vo(Uo(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),Vo(Uo(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=hx(),this.loadedCostTime=0,this.startCostTime=0,this.on(fC,(function(){var t=e._state,n=t.autoplayStart,i=t.isFFSend;e.startCostTime=hx()-e.newPointTime,Fw.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(n," isFFSend:").concat(i," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),i||(!t.isLs&&e.emitLog(dx,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=hx(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(cC,(function(){e.vt=hx(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var t=e._state,n=t.isTimeUpdate,i=t.isFFSend,r=t.autoplayStart;Fw.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(n||r)&&e._sendFF("loadedData"),i||e.emitLog(px,{}),e.suspendWaitingStatus("loadeddata")})),this.on(tC,this._onSeeking),this.on(nC,this._onSeeked),this.on(wC,(function(){e.endState("destroy")})),this.on(Zw,(function(){e.endState("ended")})),this.on(Qw,(function(){e.endState("pause")})),this.on(CC,(function(){e.endState("urlChange"),Fw.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([Jw,oC],this._onPlaying),this.on(rC,this._onWaiting),this.on(eC,this._onError),this.on(BC,(function(){Fw.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(yC,this._onAutoplayStart),this.off(iC,this._onTimeupdate),this.once(yC,this._onAutoplayStart),this.once(iC,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=hx();var t=this._state,n=t.isFFLoading,i=t.isFFSend;Fw.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!i)),this.vt>0&&n&&!i&&(Fw.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(gx,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&jw.clearTimeout(this,this._waittTimer),this._waittTimer=jw.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),jw.clearTimeout(e,e._waittTimer),e._waittTimer=null}),this.config.waitTimeout)}},{key:"endState",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=i-n,o=!(i>0&&n>0&&r<1);Fw.logInfo("[xgLogger]".concat(this.player.playerId," endState"),"".concat(e," duration - currentTime:").concat(r," _emit:").concat(o)),this.suspendWaitingStatus(e,o),this.suspendSeekingStatus(e,o)}},{key:"suspendSeekingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.seekingStart){var n=hx(),i=n-this.seekingStart;this.seekingStart=0;var r=t?kx:wx;this.emitLog(r,{end:n,costTime:i,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._waitTimer&&(jw.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(jw.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var n=hx(),i=n-this.waitingStart,r=n-this.fixedWaitingStart,o=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0;var s=t?yx:bx;this.emitLog(s,{fixedCostTime:r>o?o:r,costTime:i>o?o:i,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var n=this.player;this.emit(NC,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lx(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({t:hx(),host:jw.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:e,currentTime:this.player.currentTime,readyState:n.video.readyState,networkState:n.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),n}(A_);function _x(){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 xx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var Sx=function(e){jo(n,e);var t=xx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"registerIcons",value:function(){return{replay:_x}}},{key:"afterCreate",value:function(){var e=this;A_.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayHandler",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(Zw,(function(){if(e.playerConfig.loop||jw.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($w,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),jw.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}(A_),Tx=Sx;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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var Px=function(e){jo(n,e);var t=Ex(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){jw.addClass(this.root,"hide")}},{key:"show",value:function(){jw.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(Zw,(function(){e.isEndedShow&&jw.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(iC,(function(){e.onTimeUpdate()})),this.on(CC,(function(){jw.removeClass(e.root,"hide"),jw.addClass(e.root,"xg-showplay"),e.once(iC,(function(){e.onTimeUpdate()}))}))):this.on($w,(function(){jw.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?jw.removeClass(this.root,"xg-showplay"):this.once(iC,(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}(A_),Rx=Px;function Ox(){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 Lx(){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 Ix(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var Ax={};var Dx=function(e){jo(n,e);var t=Ix(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onPlayerReset",(function(){i.autoPlayStart=!1;var e="auto"===i.config.mode?"auto-hide":"hide";i.setAttr("data-state","play"),jw.removeClass(i.root,e),i.show()})),Vo(Uo(i),"onAutoplayStart",(function(){if(!i.autoPlayStart){var e="auto"===i.config.mode?"auto-hide":"hide";jw.addClass(i.root,e),i.autoPlayStart=!0,i.onPlayPause("play")}})),i.autoPlayStart=!1,i._lastState="",i}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(gC,(function(){n&&(n.lang&&"en"===n.lang?jw.addClass(t.root,"lang-is-en"):"jp"===n.lang&&jw.addClass(t.root,"lang-is-jp"))})),this.on(yC,this.onAutoplayStart),n.autoplay||this.show(),this.on(mC,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),jw.removeClass(e.root,t),e.show()})),this.on($w,(function(){e.onPlayPause("play")})),this.on(Qw,(function(){e.onPlayPause("pause")})),this.on(xC,(function(){e.onPlayPause(t.paused?"pause":"play")})),this.on(BC,(function(){e.onPlayerReset()})),this.clickHandler=this.hook("click",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause")}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:Ox,class:"xg-icon-play"},startPause:{icon:Lx,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(){jw.addClass(this.root,"hide")}},{key:"show",value:function(){jw.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){jw.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){jw.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};Ax[e]&&window.clearTimeout(Ax[e].id),Ax[e]={},n.start&&n.start(),Ax[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(Ax[e].id),delete Ax[e]}),t)}("pauseplay",400,{start:function(){jw.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){jw.removeClass(t.root,"interact"),!e&&t.hide()}})}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.isReady)&&(!this.player.paused&&t.isPlaying?t.pause():t.play())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(n.isPlaying&&this.autoPlayStart&&("pause"!==e||this._lastState!==e&&!n.isBufferControlPaused)){if(this._lastState=e,"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(Ax).map((function(e){window.clearTimeout(Ax[e].id),delete Ax[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}(A_),Mx=Dx;function Nx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var Fx=function(e){jo(n,e);var t=Nx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=jw.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}(A_),Bx=Fx;function jx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var Ux=function(e){jo(n,e);var t=jx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(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:P_.CONTROLS_RIGHT,index:10}}}]),n}(A_),Hx=Ux;function Gx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}function Vx(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var Wx=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],Kx=Wx.length;function zx(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===Ao(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<Kx;t++)e[Wx[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<Kx;r++){var o=Wx[r],s=t[o],a=parseFloat(s);n[o]=Number.isNaN(a)?0:a}var c=n.paddingLeft+n.paddingRight,u=n.paddingTop+n.paddingBottom,l=n.marginLeft+n.marginRight,f=n.marginTop+n.marginBottom,h=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,p=i,g=Vx(t.width);!1!==g&&(n.width=g+(p?0:c+h));var v=Vx(t.height);return!1!==v&&(n.height=v+(p?0:u+d)),n.innerWidth=n.width-(c+h),n.innerHeight=n.height-(u+d),n.outerWidth=n.width+l,n.outerHeight=n.height+f,n}}function Yx(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.identifier===t)return i}}var Xx="dragStart",qx="dragMove",$x="dragEnded",Jx={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},Zx=function(e){jo(n,e);var t=Gx(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Fo(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):Ho(i)}return No(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)]),Jx[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=Jx[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=Yx(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=Yx(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=Yx(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=zx(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(Xx,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit($x)),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(qx,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,n){return t+n<0?0-n:"x"===e&&t+n>this.startPos.maxX?this.startPos.maxX-n:"y"===e&&t+n>this.startPos.maxY?this.startPos.maxY-n:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var n=t.split(","),i=0===t.indexOf("matrix3d")?12:4,r=parseInt(n[i],10),o=parseInt(n[i+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var n=zx(this._root.parentNode);return n?parseFloat(e)/100*n[t]:0}return parseInt(e,10)}}]),n}(im);function Qx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var eS=function(e){jo(n,e);var t=Qx(n);function n(e){var i;Fo(this,n),Vo(Uo(i=t.call(this,e)),"onCancelClick",(function(e){i.exitMini(),i.isClose=!0})),Vo(Uo(i),"onCenterClick",(function(e){var t=Uo(i).player;t.paused?t.play():t.pause()})),Vo(Uo(i),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var t=parseInt(jw.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=Uo(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 No(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(Qw,(function(){e.setAttr("data-state","pause")})),this.on($w,(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(Hx,n,Hx.pluginName)}var i=jw.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new Zx(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:Ox,class:"xg-icon-play"},pause:{icon:Lx,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={},jw.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(EC,!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;jw.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(EC,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=jw.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}(A_);function tS(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var nS={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},iS=["videoClick","videoDbClick"],rS=function(e){jo(n,e);var t=tS(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var n=Uo(e),i=n.player,r=n.playerConfig;i.isActive||(i.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&i.video.focus())})),Vo(Uo(e),"onMouseEnter",(function(t){var n=Uo(e),i=n.playerConfig,r=n.player;!i.closeFocusVideoFocus&&r.video.focus(),i.closeDelayBlur?r.focus({autoHide:!1}):r.focus()})),Vo(Uo(e),"onMouseLeave",(function(t){var n=e.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime,o=n.closeDelayBlur;i||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur())})),Vo(Uo(e),"onVideoClick",(function(t){var n=Uo(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--,v_(Uo(e),iS[0],(function(t,n){e.switchPlayPause(n.e)}),{e:t,paused:i.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),Vo(Uo(e),"onVideoDblClick",(function(t){var n=Uo(e),i=n.player;n.playerConfig.closeVideoDblclick||!t.target||t.target!==i.video&&t.target!==i.video.__canvas||(e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),v_(Uo(e),iS[1],(function(t,n){e.emitUserAction(n.e,"switch_fullscreen",{fullscreen:i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()}),{e:t,fullscreen:i.fullscreen})))})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,iS.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===zw.device&&!zw.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,n=t.video,i=t.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(nS).map((function(t){i.addEventListener(t,e[nS[t]],!1)})),r&&n&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause"),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),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(nS).map((function(t){i.removeEventListener(t,e[nS[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n}(b_),oS=di,sS=zo,aS=_,cS=RangeError,uS=function(e){var t=sS(aS(this)),n="",i=oS(e);if(i<0||i==1/0)throw cS("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},lS=lr,fS=k,hS=di,dS=Dg,pS=uS,gS=d,vS=RangeError,yS=String,mS=Math.floor,kS=fS(pS),bS=fS("".slice),wS=fS(1..toFixed),CS=function(e,t,n){return 0===t?n:t%2==1?CS(e,t-1,n*e):CS(e*e,t/2,n)},_S=function(e,t,n){for(var i=-1,r=n;++i<6;)r+=t*e[i],e[i]=r%1e7,r=mS(r/1e7)},xS=function(e,t){for(var n=6,i=0;--n>=0;)i+=e[n],e[n]=mS(i/t),i=i%t*1e7},SS=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var i=yS(e[t]);n=""===n?i:n+kS("0",7-i.length)+i}return n};lS({target:"Number",proto:!0,forced:gS((function(){return"0.000"!==wS(8e-5,3)||"1"!==wS(.9,0)||"1.25"!==wS(1.255,2)||"1000000000000000128"!==wS(0xde0b6b3a7640080,0)}))||!gS((function(){wS({})}))},{toFixed:function(e){var t,n,i,r,o=dS(this),s=hS(e),a=[0,0,0,0,0,0],c="",u="0";if(s<0||s>20)throw vS("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return yS(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*CS(2,69,1))-69)<0?o*CS(2,-t,1):o/CS(2,t,1),n*=4503599627370496,(t=52-t)>0){for(_S(a,0,n),i=s;i>=7;)_S(a,1e7,0),i-=7;for(_S(a,CS(10,i,1),0),i=t-1;i>=23;)xS(a,1<<23),i-=23;xS(a,1<<i),_S(a,1,1),xS(a,2),u=SS(a)}else _S(a,0,n),_S(a,1<<-t,0),u=SS(a)+kS("0",s);return u=s>0?c+((r=u.length)<=s?"0."+kS("0",s-r)+u:bS(u,0,r-s)+"."+bS(u,r-s)):c+u}});var TS="press",ES="pressend",PS="doubleclick",RS="click",OS="touchmove",LS="touchstart",IS="touchend",AS={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},DS={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function MS(e){return e&&e.length>0?e[e.length-1]:null}function NS(e){var t=navigator.userAgent;/(?:iPhone|iPad)/.test(t)&&e.cancelable&&e.preventDefault()}var FS=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};Fo(this,e),Vo(this,"onTouchStart",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&NS(e);var r=MS(e.touches);t.x=r?parseInt(r.pageX,10):e.pageX,t.y=r?parseInt(r.pageX,10):e.pageX,t.start=!0,n.__setPress(e),i.addEventListener(n.events.end,n.onTouchEnd),i.addEventListener(n.events.cancel,n.onTouchCancel),i.addEventListener(n.events.move,n.onTouchMove),n.trigger(LS,e)})),Vo(this,"onTouchCancel",(function(e){n.onTouchEnd(e)})),Vo(this,"onTouchEnd",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&NS(e),n.__clearPress(),i.removeEventListener(n.events.cancel,n.onTouchCancel),i.removeEventListener(n.events.end,n.onTouchEnd),i.removeEventListener(n.events.move,n.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&n.trigger(ES,e),n.trigger(IS,e),!t.press&&!t.moving&&n.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),Vo(this,"onTouchMove",(function(e){var t=n._pos,i=n.config,r=MS(e.touches),o=r?parseInt(r.pageX,10):e.pageX,s=r?parseInt(r.pageY,10):e.pageX,a=o-t.x,c=s-t.y;Math.abs(c)<i.miniStep&&Math.abs(a)<i.miniStep||(n.__clearPress(),t.press&&n.trigger(ES,e),t.press=!1,t.moving=!0,n.trigger(OS,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?DS:AS,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return No(e,[{key:"_initEvent",value:function(){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(TS,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(PS,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(RS,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:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(n){e.root.removeEventListener(n,e[t[n]])}))}}]),e}(),BS=FS;function jS(){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 US(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var HS="auto",GS="seeking",VS="playbackrate",WS=["videoClick","videoDbClick"],KS=function(e){jo(n,e);var t=US(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onTouchStart",(function(e){var t=Uo(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,jw.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),i.find(".xg-dur").innerHTML=jw.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 u=parseInt(a.pageX-o.left,10),l=parseInt(a.pageY-o.top,10);o.x=90===n.rotateDeg?l:u,o.y=90===n.rotateDeg?u:l,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}})),Vo(Uo(i),"onTouchMove",(function(e){var t=i.getTouche(e),n=Uo(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,u=parseInt(t.pageX-r.left,10),l=parseInt(t.pageY-r.top,10),f=90===s.rotateDeg?l:u,h=90===s.rotateDeg?u:l;if(Math.abs(f-r.x)>a||Math.abs(h-r.y)>a){var d=f-r.x,p=h-r.y,g=r.scope;if(-1===g&&(0===(g=i.checkScope(f,h,d,p,r))&&(c?s.blur():s.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*s.currentTime,10)+1e3*i.timeOffset)),r.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;e.cancelable&&e.preventDefault(),i.executeMove(d,p,g,r.width,r.height),r.x=f,r.y=h}}})),Vo(Uo(i),"onTouchEnd",(function(e){var t=Uo(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(),jw.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction(HS))})),Vo(Uo(i),"onRootTouchMove",(function(e){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.pos.isStart?i.onTouchMove(e):i.onTouchStart(e))})),Vo(Uo(i),"onRootTouchEnd",(function(e){if(i.pos.isStart&&i.checkIsRootTarget(e)){e.stopPropagation(),i.onTouchEnd(e);var t=i.player.controls;t&&t.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 No(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:jS,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;WS.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,n=this.config,i=this.player;!0===t.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),jw.isUndefined(t.disableGesture)||(n.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=jw.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new BS(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(sC,(function(){var t=e.player,n=e.config;1e3*t.duration<n.moveDuration&&(n.moveDuration=1e3*t.duration)})),this.on([oC,Zw],(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).forEach((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(HS)})))}}},{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&&jw.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:zw.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,i=this.player,r=this.config,o=(n.time-this.timeOffset)/1e3;if(0===e)i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction(HS)}},{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:"clickHandler",value:function(e){var t=this.player,n=this.config,i=this.playerConfig;t.isPlaying?!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()):i.closeVideoClick||(this.emitUserAction("click","switch_play_pause"),t.play())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.isPlaying&&(this.emitUserAction("dblclick","switch_play_pause"),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;v_(this,WS[0],(function(e,n){t.clickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;v_(this,WS[1],(function(e,n){t.dbClickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onPress",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction(VS))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{from:i.playbackRate,to:t.rate}),i.playbackRate=t.rate,t.rate=1,this.changeAction(HS))}},{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(GS);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=jw.format(this.duration),this.find(".xg-cur").innerHTML=jw.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?jw.removeClass(this.find(".xg-seek-show"),"xg-back"):jw.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.hasStart)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{stopPropagation:!0,index:0,disableGesture:!1,gestureX:!0,gestureY:!0,updateGesture:function(){},onTouchStart:function(){},onTouchEnd:function(){},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}(A_),zS=KS;function YS(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 XS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?YS(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YS(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qS(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}lr({target:"String",proto:!0},{repeat:uS});var $S=function(e){jo(n,e);var t=qS(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var n,i,r=t||window.event,o=r.keyCode,s=Uo(e)._keyState;if(!t.repeat){if(s.isKeyDown||e.config.disable||e.config.disableBodyTrigger||!e.player.isUserActive&&!e.config.isIgnoreUserActive||!e.checkIsVisible()||r.metaKey||r.altKey||r.ctrlKey)return;(r.target===document.body||e.config.isGlobalTrigger&&(n=r.target,"INPUT"!==(i=n.tagName)&&"TEXTAREA"!==i&&!n.isContentEditable))&&e.checkCode(o,!0)&&(s.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)}s.isBodyKeyDown&&e.handleKeyDown(r)}})),Vo(Uo(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),Vo(Uo(e),"onKeydown",(function(t){if(e.player){var n=t||window.event,i=Uo(e)._keyState;if(!n.repeat){if(e.config.disable||e.config.disableRootTrigger||n.metaKey||n.altKey||n.ctrlKey)return;if(!e.player.isUserActive&&!e.config.isIgnoreUserActive)return;!n||37!==n.keyCode&&!e.checkCode(n.keyCode)||n.target!==e.player.root&&n.target!==e.player.video&&n.target!==e.player.controls.el||(i.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}i.isKeyDown&&e.handleKeyDown(n)}})),Vo(Uo(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return No(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","pressAction","disablePress","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,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"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;if(!(t.volume<=0)){var 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;if(!(t.volume>=1)){var 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=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep,s={currentTime:{from:n,to:r=n+o<=i?n+o:i}};this.emitUserAction(e,"seek",{props:s}),this.player.currentTime=r}},{key:"seekBack",value:function(e){var t=this.player.currentTime,n=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,i=0;t-n>=0&&(i=t-n);var r={currentTime:{from:t,to:i}};this.emitUserAction(e,"seek",{props:r}),this.player.currentTime=i}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,n=this.config,i=this.player;0===t.playbackRate&&(t.playbackRate=i.playbackRate,i.playbackRate=n.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,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:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var n=Date.now();if(n-t.tt<200)return;t.tt=n}!function(e){e.preventDefault(),e.returnValue=!1}(e),this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,n){for(var i=Object.keys(this.keyCodeMap),r=0;r<i.length;r++){var o=this.keyCodeMap[i[r]],s=o.action,a=o.keyCode,c=o.disable,u=o.pressAction,l=o.disablePress;if(a===e){if(!(c||n&&l)){var f=n&&u||s;"function"==typeof f?s(t,this.player,n):"string"==typeof f&&"function"==typeof this[f]&&this[f](t,this.player,n),this.emit(MC,XS({key:i[r],target:t.target,isPress:n},this.keyCodeMap[i[r]]))}break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!1,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!1}}}]),n}(b_),JS=$S;function ZS(){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 QS(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var eT=function(e){jo(n,e);var t=QS(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"registerIcons",value:function(){return{loadingIcon:ZS}}},{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:P_.ROOT}}}]),n}(A_),tT=eT,nT=lr,iT=$s.findIndex,rT=xv,oT="findIndex",sT=!0;oT in[]&&Array(1)[oT]((function(){sT=!1})),nT({target:"Array",proto:!0,forced:sT},{findIndex:function(e){return iT(this,e,arguments.length>1?arguments[1]:void 0)}}),rT(oT);var aT=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],cT=function(){function e(t){Fo(this,e),this.fragments=t.fragments||[],0===this.fragments.length&&this.fragments.push({percent:1}),this._callBack=t.actionCallback,this.fragConfig={fragFocusClass:t.fragFocusClass||"inner-focus-point",fragAutoFocus:!!t.fragAutoFocus,fragClass:t.fragClass||""},this.style=t.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return No(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var n=0,i=this.fragments;this.fragments=i.map((function(e){return e.start=parseInt(n,10),e.end=parseInt(n+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),n+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},n=this.progressList,i=this.fragments;if(!(n.length<1)){var r=t.newIndex,o=t.curIndex,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:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var n={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(n)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var i={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(i),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==jw.typeOf(e.played)){var r=this.findIndex(1e3*e.played,n);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==jw.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var n=this.fragments;if(!n||0===n.length)return-1;if(1===n.length)return 0;if(t>-1&&t<n.length&&e>n[t].start&&e<n[t].end)return t;if(e>n[n.length-1].start)return n.length-1;for(var i=0;i<n.length;i++)if(e>n[i].start&&e<=n[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(jw.hasClass(e[t],this.fragConfig.fragFocusClass))return{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"findFragment",value:function(e){var t=this.root.children;return e<0||e>=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)jw.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return jw.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(n){void 0!==e[n]&&(t.fragConfig[n]=e[n])})),e.fragments){if(this.fragments=0===e.fragments.length?[{percent:1}]:e.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var n=this.root.children;n.length>0;)this.root.removeChild(n[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=jw.createDom("xg-inners","",{},"progress-list")),this.fragments){var n=this.fragConfig,i=n.fragClass,r=n.fragFocusClass;this.progressList=this.fragments.map((function(n){var o=jw.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?r:""," xgplayer-progress-inner ").concat(i));return e.root.appendChild(o),aT.forEach((function(t){o.appendChild(jw.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:o.children[0],played:o.children[1]}}))}return this.root}}]),e}();function uT(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 lT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uT(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var hT={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},dT=function(e){jo(n,e);var t=fT(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onMoveOnly",(function(e,t){var n=Uo(i),r=n.pos,o=n.config,s=n.player,a=t;if(e){jw.event(e);var c=jw.getEventPos(e,s.zoom),u=90===s.rotateDeg?c.clientY:c.clientX;if(r.moving&&Math.abs(r.x-u)<o.miniMoveStep)return;r.moving=!0,r.x=u,a=i.computeTime(e,u)}i.triggerCallbacks("dragmove",a,e),i._updateInnerFocus(a)})),Vo(Uo(i),"onBodyClick",(function(e){e.preventDefault(),e.stopPropagation()})),Vo(Uo(i),"_mouseDownHandler",(function(e,t){i._state.time=t.currentTime,i.updateWidth(t.currentTime,t.percent,0),i._updateInnerFocus(t)})),Vo(Uo(i),"_mouseUpHandler",(function(e,t){Uo(i).pos.moving&&i.updateWidth(t.currentTime,t.percent,2)})),Vo(Uo(i),"_mouseMoveHandler",(function(e,t){var n=Uo(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.emitUserAction("drag","dragstart",t)),i.updateWidth(t.currentTime,t.percent,1),i.triggerCallbacks("dragmove",t,e),i._updateInnerFocus(t)})),Vo(Uo(i),"onMouseDown",(function(e){var t=Uo(i),n=t._state,r=t.player,o=t.pos,s=t.config,a=t.playerConfig,c=jw.getEventPos(e,r.zoom),u=90===r.rotateDeg?c.clientY:c.clientX;if(!(r.isMini||s.closeMoveSeek||!a.allowSeekAfterEnded&&r.ended)){e.stopPropagation(),i.focus(),jw.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),jw.checkIsFunction(s.onMoveStart)&&s.onMoveStart(),jw.event(e),o.x=u,o.isDown=!0,o.moving=!1,n.prePlayTime=r.currentTime,r.focus({autoHide:!1}),i.isProgressMoving=!0,jw.addClass(i.progressBtn,"active");var l=i.computeTime(e,u);return l.prePlayTime=n.prePlayTime,i._mouseDownHandlerHook(e,l),"touchstart"===e.type?(i.root.addEventListener("touchmove",i.onMouseMove),i.root.addEventListener("touchend",i.onMouseUp)):(i.unbind("mousemove",i.onMoveOnly),document.addEventListener("mousemove",i.onMouseMove,!1),document.addEventListener("mouseup",i.onMouseUp,!1),r.root.addEventListener("click",i.onBodyClick,!1)),!0}})),Vo(Uo(i),"onMouseUp",(function(e){var t=Uo(i),n=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=t._state;e.stopPropagation(),e.preventDefault(),jw.checkIsFunction(s.enableSwipeHandler)&&s.enableSwipeHandler(),jw.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),jw.event(e),jw.removeClass(i.progressBtn,"active");var c=i.computeTime(e,o.x);c.prePlayTime=a.prePlayTime,o.moving?(i.triggerCallbacks("dragend",c,e),i.emitUserAction("drag","dragend",c)):(i.triggerCallbacks("click",c,e),i.emitUserAction("click","click",c)),i._mouseUpHandlerHook(e,c),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,a.prePlayTime=0,a.time=0,"touchend"===e.type?(i.root.removeEventListener("touchmove",i.onMouseMove),i.root.removeEventListener("touchend",i.onMouseUp),i.blur()):(document.removeEventListener("mousemove",i.onMouseMove,!1),document.removeEventListener("mouseup",i.onMouseUp,!1),n.root.removeEventListener("click",i.onBodyClick,!1),o.isEnter?"mobile"!==s.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(e)),jw.setTimeout(Uo(i),(function(){i.resetSeekState()}),10),n.focus()})),Vo(Uo(i),"onMouseMove",(function(e){var t=Uo(i),n=t._state,r=t.pos,o=t.player,s=t.config;jw.checkTouchSupport()&&e.preventDefault(),jw.event(e);var a=jw.getEventPos(e,o.zoom),c=90===o.rotateDeg?a.clientY:a.clientX,u=Math.abs(r.x-c);if(!(r.moving&&u<s.miniMoveStep||!r.moving&&u<s.miniStartStep)){r.x=c;var l=i.computeTime(e,c);l.prePlayTime=n.prePlayTime,i._mouseMoveHandlerHook(e,l)}})),Vo(Uo(i),"onMouseOut",(function(e){i.triggerCallbacks("mouseout",null,e)})),Vo(Uo(i),"onMouseOver",(function(e){i.triggerCallbacks("mouseover",null,e)})),Vo(Uo(i),"onMouseEnter",(function(e){var t=Uo(i),n=t.player,r=t.pos;if(!(r.isDown||r.isEnter||n.isMini||!n.config.allowSeekAfterEnded&&n.ended)){r.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),jw.event(e);var o=jw.getEventPos(e,n.zoom),s=90===n.rotateDeg?o.clientY:o.clientX,a=i.computeTime(e,s);i.triggerCallbacks("mouseenter",a,e),i.focus()}})),Vo(Uo(i),"onMouseLeave",(function(e){i.triggerCallbacks("mouseleave",null,e),i.unlock(),i._updateInnerFocus(null)})),Vo(Uo(i),"onVideoResize",(function(){var e=i.pos,t=e.x,n=e.isDown;if(e.isEnter&&!n){var r=i.computeTime(null,t);i.onMoveOnly(null,r)}})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0,prePlayTime:-1},i._disableBlur=!1,i}return No(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:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.progress&&(e.config.disable=!e.player.config.progress)}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var i=lT(lT({fragments:t},n),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(i):(this.innerList=new cT(i),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){var e=this;if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer");var t=this.config,n=t.fragFocusClass,i=t.fragAutoFocus,r=t.fragClass;this._initInner(this.config.fragments,{fragFocusClass:n,fragAutoFocus:i,fragClass:r,style:this.playerConfig.commonStyle||{}}),"mobile"===zw.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(sC,(function(){e.onMouseLeave()})),this.on(iC,(function(){e.onTimeupdate()})),this.on(nC,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(lC,(function(){e.onCacheUpdate()})),this.on(Zw,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(hC,(function(){e.onReset()})),this.on(OC,(function(){e.onVideoResize()})),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var t=this,n=null;Object.keys(e).forEach((function(i){t.config[i]=e[i],"fragments"===i&&(n=e[i])})),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===Ao(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:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player,t=e.controls,n=e.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",jw.stopPropagation),t.center&&t.center.addEventListener("touchend",jw.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),jw.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),jw.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,n){var i=this.config,r=this.player;if(!i.isCloseClickSeek||0!==n){var o=e>=r.duration?r.duration-i.endedDiff:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==n||i.isDragingSeek&&"audio"!==r.videoConfig.mediaType)&&(this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o))}}},{key:"computeTime",value:function(e,t){var n,i,r=this.player,o=this.root.getBoundingClientRect(),s=o.width,a=o.height,c=o.top,u=o.left,l=t;90===r.rotateDeg?(n=a,i=c):(n=s,i=u);var f=l-i,h=(f=f>n?n:f<0?0:f)/n;return{percent:h=h<0?0:h>1?1:h,currentTime:parseInt(h*this.duration*1e3,10)/1e3,offset:f,width:n,left:i,e:e}}},{key:"updateTime",value:function(e){var t=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var i=t.plugins.time;i&&i.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,n=this._state,i=this.duration;if(!(t.isSeeking&&t.video.seeking||this.isProgressMoving)&&t.hasStart){if(n.now>-1){var r=parseInt(1e3*n.now,10)-parseInt(1e3*t.currentTime,10);if(0===n.direc&&r>300||1===n.direc&&r>-300)return void(n.now=-1);n.now=-1}var o=this.timeOffset+t.currentTime;o=jw.adjustTimeByDuration(o,i,e),this.innerList.update({played:o},i),this.progressBtn.style.left="".concat(o/i*100,"%");var s=this.player.plugins.miniprogress;s&&s.update({played:o},i)}}},{key:"onCacheUpdate",value:function(e){var t=this.player,n=this.duration;if(t){var i=t.bufferedPoint.end;i=jw.adjustTimeByDuration(i,n,e),this.innerList.update({cached:i},n);var r=this.player.plugins.miniprogress;r&&r.update({cached:i},n)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var n=this.domEventType;"touch"!==n&&"compatible"!==n||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",jw.stopPropagation),t.center&&t.center.removeEventListener("touchend",jw.stopPropagation))),"mouse"!==n&&"compatible"!==n||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!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:P_.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:hT.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return hT}}]),n}(A_),pT=dT;function gT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var vT=function(e){jo(n,e);var t=gT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Vo(Uo(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return No(n,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),n}(A_);function yT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var mT=function(e){jo(n,e);var t=yT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){var n=Uo(e),i=n.player;if(!n.config.disable)return t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause"),i.ended?i.replay():i.paused&&!i.isBufferControlPaused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Go(n.prototype),"afterCreate",this).call(this);var t=this.player;this._isPaused=!1,this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.on([Qw,hC,$w],(function(){e.animate(t.paused)})),this.on(xC,(function(){e.animate(t.paused)})),this.animate(!0)}},{key:"registerIcons",value:function(){return{play:{icon:Ox,class:"xg-icon-play"},pause:{icon:Lx,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){var t=this.i18nKeys,n=this.player;e&&n.isBufferControlPaused||(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(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){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:P_.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(vT),kT=mT;function bT(){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 wT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var CT=function(e){jo(n,e);var t=wT(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(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:bT,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){jw.addClass(this.root,"show")}},{key:"hide",value:function(){jw.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:P_.ROOT_TOP,index:0}}}]),n}(A_);function _T(){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 xT(){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 ST(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var TT=function(e){jo(n,e);var t=ST(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.setRotateDeg(0):e.setRotateDeg(90))})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Go(n.prototype),"afterCreate",this).call(this);var t=this.config,i=this.playerConfig;t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=jw.getFullScreenEl();i.fullscreenTarget===r&&this.player.getFullscreen().catch((function(){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreen_change",this.changeFullScreen,{pre:function(t){e.config.disable||e.emitUserAction(t,"switch_fullscreen",{fullscreen:e.player.fullscreen})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(SC,(function(t){e.changeLangTextKey(e.find(".xg-tips"),t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t),e.config.needBackIcon&&e.show()})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:CT,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===zw.device&&window.addEventListener("orientationchange",this._onOrientationChange)}},{key:"registerIcons",value:function(){return{fullscreen:{icon:_T,class:"xg-get-fullscreen"},exitFullscreen:{icon:xT,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===zw.device?"touchend":"click",this.handleFullscreen),"mobile"===zw.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:"setRotateDeg",value:function(e){var t=this.player;90===window.orientation||-90===window.orientation?t.rotateDeg=0:t.rotateDeg=e}},{key:"getRotateFullscreen",value:function(e){var t=this.player;t.isCssfullScreen&&t.exitCssFullscreen(e);var n=e?z_.INNER_FULLSCREEN:z_.ROTATE_FULLSCREEN;t._fullscreenEl=e||t.root,t.changeFullStyle(t.root,e,n,z_.PARENT_ROTATE_FULLSCREEN),t.fullscreen=!0,this.setRotateDeg(90),this.emit(SC,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this.player;t.fullscreen=!1;var n=t._fullscreenEl!==t.root?z_.INNER_FULLSCREEN:z_.ROTATE_FULLSCREEN;t.recoverFullStyle(t.root,t._fullscreenEl,n,z_.PARENT_ROTATE_FULLSCREEN),this.setRotateDeg(0),this.emit(SC,!1)}},{key:"changeFullScreen",value:function(e){var t=this.player,n=this.config;if(!n.disable){e&&(e.preventDefault(),e.stopPropagation());var i=!1;if((!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(i=!0),i)t.fullscreen?(t.fullscreen=!1,t.exitCssFullscreen(),this.emit(SC,!1)):(t.fullscreen=!0,t.getCssFullscreen(),this.emit(SC,!0)),this.animate(t.fullscreen);else if(n.rotateFullscreen)t.fullscreen?this.exitRotateFullscreen():this.getRotateFullscreen(),this.animate(t.fullscreen);else{if(n.switchCallback&&"function"==typeof n.switchCallback)return void n.switchCallback(t.fullscreen);t.fullscreen?t.exitFullscreen():t.getFullscreen().catch((function(){}))}}}},{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(){au(Go(n.prototype),"show",this).call(this)}},{key:"hide",value:function(){au(Go(n.prototype),"hide",this).call(this)}},{key:"render",value:function(){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:P_.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(vT);function ET(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var PT=function(e){jo(n,e);var t=ET(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).isActiving=!1,i}return No(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 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(sC,(function(){e.onTimeUpdate()})),this.on(iC,(function(){e.onTimeUpdate()})),this.on(Zw,(function(){e.onTimeUpdate(!0)})),this.on(hC,(function(){e.onReset()})))}},{key:"show",value:function(){"flex"!==this.mode&&au(Go(n.prototype),"show",this).call(this)}},{key:"onTimeUpdate",value:function(e){var t=this.player,n=this.config,i=this.duration;if(!n.disable&&!this.isActiving&&t.hasStart){var r=t.currentTime+this.timeOffset;r=jw.adjustTimeByDuration(r,i,e),"flex"===this.mode?(this.centerCurDom.innerHTML=jw.format(r),i!==1/0&&i>0&&(this.centerDurDom.innerHTML=jw.format(i))):(this.timeDom.innerHTML=jw.format(r),i!==1/0&&i>0&&(this.durationDom.innerHTML=jw.format(i)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=jw.format(0),this.centerDurDom.innerHTML=jw.format(0)):(this.timeDom.innerHTML=jw.format(0),this.durationDom.innerHTML=jw.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=jw.createDom("xg-icon","00:00",{},"xgplayer-time left"),this.centerDurDom=jw.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?(jw.hide(this.durationDom),jw.hide(this.timeDom),jw.hide(this.find(".time-separator")),jw.show(this.find(".time-live-tag"))):jw.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(jw.hide(this.durationDom),jw.hide(this.timeDom),jw.hide(this.find(".time-separator")),jw.show(this.find(".time-live-tag"))):(jw.hide(this.find(".time-live-tag")),jw.show(this.find(".time-separator")),jw.show(this.durationDom),jw.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=jw.format(e):this.centerCurDom.innerHTML=jw.format(e))}},{key:"resetActive",value:function(){var e=this,t=this.player,n=function(){e.isActiving=!1};this.off(nC,n),t.isSeeking?this.once(nC,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:P_.CONTROLS_LEFT,index:2,disable:!1}}}]),n}(A_);function RT(){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 OT(){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 LT(){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 IT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var AT=function(e){jo(n,e);var t=IT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var n=Uo(e).player,i=e.find(".xgplayer-bar");jw.event(t);var r=i.getBoundingClientRect(),o=jw.getEventPos(t,n.zoom),s=r.height-(o.clientY-r.top);if(o.h=s,o.barH=r.height,e.pos=o,!(s<-2))return e.updateVolumePos(s,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),Vo(Uo(e),"onBarMouseMove",(function(t){var n=Uo(e)._d;if(n.isStart){var i=Uo(e),r=i.pos,o=i.player;t.preventDefault(),t.stopPropagation(),jw.event(t);var s=jw.getEventPos(t,o.zoom);n.isMoving=!0;var a=r.h-s.clientY+r.clientY;a>r.barH||e.updateVolumePos(a,t)}})),Vo(Uo(e),"onBarMouseUp",(function(t){jw.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var n=Uo(e)._d;n.isStart=!1,n.isMoving=!1})),Vo(Uo(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Vo(Uo(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),Vo(Uo(e),"onVolumeChange",(function(t){if(e.player){var n=e.player,i=n.muted,r=n.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=i||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(i,r)}})),e}return No(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:OT,class:"xg-volume-small"},volumeLarge:{icon:RT,class:"xg-volume"},volumeMuted:{icon:LT,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},this.initIcons();var t=this.playerConfig,n=t.commonStyle,i=t.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==zw.device&&"mobile"!==this.playerConfig.isMobileSimulateMode&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(aC,this.onVolumeChange),this.once(cC,this.onVolumeChange),"Number"!==jw.typeOf(i)&&(this.player.volume=this.config.default),this.onVolumeChange(),this.config.disable&&this.disable()}},{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:"focus",value:function(){var e=this.player;this.config.disable||(e.focus({autoHide:!1}),this._timerId&&(jw.clearTimeout(this,this._timerId),this._timerId=null),jw.addClass(this.root,"slide-show"))}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(jw.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=jw.setTimeout(this,(function(){r.isActive||(n?o.blur():o.focus(),jw.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(i)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){if(!this.config.disable){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(jw.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===zw.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){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:P_.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(A_),DT=AT;function MT(){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 NT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var FT=function(e){jo(n,e);var t=NT(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onBtnClick",(function(e){i.config.disable||(e.preventDefault(),e.stopPropagation(),i.emitUserAction(e,"rotate"),i.rotate(i.config.clockwise,i.config.innerRotate,1))})),i.rotateDeg=i.config.rotateDeg||0,i}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Go(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(OC,(function(){e.rotateDeg&&jw.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)})),this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{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,u="100%",l="100%",f=0,h=0;.75!==e&&.25!==e||(u="".concat(c,"px"),l="".concat(a,"px"),f=-(c-a)/2,h=-(a-c)/2);var d="translate(".concat(f,"px,").concat(h,"px) rotate(").concat(e,"turn)"),p={transformOrigin:"center center",transform:d,webKitTransform:d,height:l,width:u},g=t?s:r,v=t?n.getPlugin("poster"):null;Object.keys(p).map((function(e){g.style[e]=p[e],v&&v.root&&(v.root.style[e]=p[e])}))}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*n)%1,this.updateRotateDeg(this.rotateDeg,t),i.emit(IC,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:MT}}},{key:"render",value:function(){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:P_.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(vT);function BT(){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 jT(){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 UT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var HT="picture-in-picture",GT="inline",VT="fullscreen",WT=function(e){jo(n,e);var t=UT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable()||e.config.disable)return!1;t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{from:"pip",to:"normal"}),e.setAttr("data-state","normal")):4===e.player.video.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{from:"normal",to:"pip"}),e.setAttr("data-state","pip"))})),e}return No(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()&&(au(Go(n.prototype),"afterCreate",this).call(this),this.pMode=GT,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(kC,(function(){e.config.showIcon&&(jw.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:BT,class:"xg-get-pip"},pipIconExit:{icon:jT,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;jw.setTimeout(e,(function(){!n&&t.videoPlay()}),0),!n&&t.videoPlay(),e.setAttr("data-state","normal"),t.emit(LC,!1)},this.enterPIPCallback=function(n){t.emit(LC,!0),e.pipWindow=n.pictureInPictureWindow,e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var i=t.video.webkitPresentationMode;e.pMode===VT&&i!==VT&&t.onFullscreenChange(null,!1),e.pMode=i,i===HT?e.enterPIPCallback(n):i===GT&&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"===jw.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===HT}},{key:"isPIPAvailable",value:function(){var e=this.player.video;return("Boolean"!==jw.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===jw.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===jw.typeOf(e.webkitSetPresentationMode))}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this);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:P_.CONTROLS_RIGHT,index:6,showIcon:!1}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),n}(vT),KT=WT;function zT(){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 YT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var XT=function(e){jo(n,e);var t=YT(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"playNext",(function(e){var t=Uo(i).player;e.preventDefault(),e.stopPropagation(),i.idx+1<i.config.urlList.length?(i.idx++,t.emit(DC,i.idx+1),i.nextHandler(i.config.urlList[i.idx],i.idx)):(i.nextHandler(),t.emit(DC))})),i.idx=-1,i}return No(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:zT}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("playNext",this.changeSrc);var e="mobile"===zw.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.autoplay=!0,t.src=e)}},{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:P_.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(A_),qT={exports:{}};!function(e,t){e.exports=function e(t,n,i){var r,o,s=window,a="application/octet-stream",c=i||a,u=t,l=!n&&!i&&u,f=document.createElement("a"),h=function(e){return String(e)},d=s.Blob||s.MozBlob||s.WebKitBlob||h,p=n||"download";if(d=d.call?d.bind(s):Blob,"true"===String(this)&&(c=(u=[u,c])[0],u=u[1]),l&&l.length<2048&&(p=l.split("/").pop().split("?")[0],f.href=l,-1!==f.href.indexOf(l))){var g=new XMLHttpRequest;return g.open("GET",l,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,p,a)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&d!==h))return navigator.msSaveBlob?navigator.msSaveBlob(k(u),p):b(u);c=(u=k(u)).type||a}else if(/([\x80-\xff])/.test(u)){for(var v=0,y=new Uint8Array(u.length),m=y.length;v<m;++v)y[v]=u.charCodeAt(v);u=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 f)return f.href=e,f.setAttribute("download",p),f.className="download-js-link",f.innerHTML="downloading...",f.style.display="none",document.body.appendChild(f),setTimeout((function(){f.click(),document.body.removeChild(f),!0===t&&setTimeout((function(){s.URL.revokeObjectURL(f.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=u instanceof d?u:new d([u],{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===h)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}}(qT);var $T=qT.exports;function JT(){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 ZT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var QT=function(e){jo(n,e);var t=ZT(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"download",(function(e){if(!i.isLock&&!i.config.disable){i.emitUserAction(e,"download");var t=i.getAbsoluteURL(i.player.src);$T(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 No(n,[{key:"afterCreate",value:function(){au(Go(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this.bind(["click","touchend"],this.download))}},{key:"registerIcons",value:function(){return{download:JT}}},{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(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){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:P_.CONTROLS_RIGHT,index:3,disable:!0}}}]),n}(vT);function eE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var tE=function(e){jo(n,e);var t=eE(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){au(Go(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(OC,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(AC,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 u=n.canvas.toDataURL(a,s).replace(a,"image/octet-stream");i(u=u.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(OC,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:P_.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot"}}}]),n}(vT),nE=function(){function e(t){Fo(this,e),this.config=t.config,this.parent=t.root,this.root=jw.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"===zw.device?"touchend":"click";this._delegates=A_.delegate.call(this,this.root,"li",n,this.onItemClick)}return No(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(jw.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&&jw.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");jw.addClass(t,"selected"),i&&jw.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(){jw.removeClass(this.root,"hide"),jw.addClass(this.root,"active")}},{key:"hide",value:function(){jw.removeClass(this.root,"active"),jw.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.root.style[n]=e[n]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}();function iE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var rE="mobile"===zw.device,oE=function(e){jo(n,e);var t=iE(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onEnter",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseenter",{pluginName:i.pluginName}),i.onToggle(!0)})),Vo(Uo(i),"onLeave",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseleave",{pluginName:i.pluginName}),i.isActive&&i.onToggle(!1)})),i.isIcons=!1,i.isActive=!1,i.curValue=null,i.curIndex=0,i}return No(n,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),rE&&"middle"!==t.listType&&(t.listType="rightSide"),t.hidePortrait&&jw.addClass(this.root,"portrait"),this.once(oC,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),rE&&this.on(dC,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),this.activeEvent=rE?"touchend":"mouseenter",this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave),this.isIcons&&this.bind("click",this.onIconClick),this.config.disable&&this.disable()}},{key:"initIcons",value:function(){var e=this,t=this.icons,n=Object.keys(t),i=!1;n.length>0&&(n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n]),!i&&(i=t[n])})),this.isIcons=i),i||(this.appendChild(".xgplayer-icon",jw.createDom("span","",{},"icon-text")),jw.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<1||jw.addClass(this.root,"show")}},{key:"hide",value:function(){jw.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var i=this.config.list;!n&&(n=this.player.lang),t=!t||jw.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]);try{return"object"===Ao(e[t])?e[t][n]||e[t].zh:e[t]}catch(e){return console.warn(e),""}}},{key:"onToggle",value:function(e){if(e!==this.isActive&&!this.config.disable){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.unFocus(),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;(rE||"rightSide"===i)&&this.onToggle(!1),this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),this.onToggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var n=this,i=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=i.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var 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 nE(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">\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:P_.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1}}}]),n}(A_);function sE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var aE=function(e){jo(n,e);var t=sE(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).curTime=0,i.isPaused=!0,i}return No(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;au(Go(n.prototype),"afterCreate",this).call(this);var t=this.config,i=t.list,r=t.defaultDefinition,o=this.playerConfig.defaultConfig;i.forEach((function(e){e.definition!==r&&e.definition!==o||(e.selected=!0)})),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(PC,(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,i=this.playerConfig.defaultConfig;if(t.length>0){var r=null;t.map((function(e){e.definition!==n&&e.definition!==i||(r=e,e.selected=!0)})),r||(r=t[0]),this.changeDefinition(r)}}},{key:"renderItemList",value:function(e,t){var i=this,r=t&&t.definition?t.definition:"";t&&!Array.isArray(t)&&e.forEach((function(e){e.selected=!1}));var o=0,s=e.map((function(e,t){var n={url:e.url,definition:e.definition||"",showText:i.getTextByLang(e)||e.definition,selected:!1};return(e.selected||!jw.isUndefined(e.definition)&&e.definition===r)&&(n.selected=!0,o=t),n}));au(Go(n.prototype),"renderItemList",this).call(this,s,o)}},{key:"changeDefinitionList",value:function(e){if(Array.isArray(e)){var t=this.playerConfig,n=t.definition,i=t.defaultDefinition,r=n||this.config.defaultDefinition||"";this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e.definition!==r&&e.definition!==i||(e.selected=!0),e})),n.list=e,this.renderItemList(e),this.config.list.length<2?this.hide():this.show()}}},{key:"changeDefinition",value:function(e,t){var n=this.player;n.switchURL?n.switchUrl(e.url):n.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var i=this.player.definitionList;au(Go(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<i.length;r++)t.to&&i[r].definition===t.to.definition&&(t.to.url=i[r].url),t.from&&i[r].definition===t.from.definition&&(t.from.url=i[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return{position:P_.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0}}}]),n}(oE);function cE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var uE=function(e){jo(n,e);var t=cE(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).curRate=1,i}return No(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;au(Go(n.prototype),"afterCreate",this).call(this),this.on(uC,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&au(Go(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){au(Go(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}));au(Go(n.prototype),"renderItemList",this).call(this,r,i)}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return{position:P_.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1}}}]),n}(oE);function lE(){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 fE(){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 hE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var dE=function(e){jo(n,e);var t=hE(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Go(n.prototype),"afterCreate",this).call(this),this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(TC,(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){if(!this.config.disable){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:lE,class:"xg-get-cssfull"},exitCssFullscreen:{icon:fE,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class=\'xgplayer-cssfullscreen\'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.CSSFULLSCREEN_TIPS,'">').concat(this.i18n.CSSFULLSCREEN_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:P_.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n}(vT);function pE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var gE=function(e){jo(n,e);var t=pE(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(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("errorHandler",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(oC,(function(){e.handleCanPlay()})),this.on(eC,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleCanPlay",value:function(){jw.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.error;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}(A_);function vE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var yE=function(e){jo(n,e);var t=vE(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(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;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),jw.addClass(this.root,"show"),"arrow"===n.mode&&jw.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),"boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide){var o=n.interval||r;this.intervalId=setTimeout((function(){t.hide()}),o)}}}},{key:"hide",value:function(){jw.removeClass(this.root,"show"),jw.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(z_.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}(A_),mE=yE,kE={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function bE(e){Object.keys(kE).map((function(t){void 0===e[t]&&(e[t]=kE[t])}))}var wE={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&&(bE(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=jw.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?jw.addClass(r,"mini"):jw.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 CE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var _E={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMove"},xE=function(e){jo(n,e);var t=CE(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onMousemove",(function(e){i.config.disable||(jw.hasClass(e.target,"xg-spot-content")&&i.config.isHideThumbnailHover?i.player.plugins.progress.onMouseLeave(e):(i._state.f||jw.hasClass(e.target,"xg-spot-content"))&&(jw.event(e),e.stopPropagation()))})),Vo(Uo(i),"onMousedown",(function(e){i.config.disable||(i._state.f||jw.hasClass(e.target,"xg-spot-content"))&&(jw.event(e),e.stopPropagation())})),Vo(Uo(i),"onMouseup",(function(e){if(i.isDrag){var t=i.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),Vo(Uo(i),"onDotMouseLeave",(function(e){if(!i.config.disable){i._curDot.removeEventListener("mouseleave",i.onDotMouseLeave),i.blurDot(e.target),i._curDot=null;var t=i.player.plugins.progress;t&&t.enableBlur(),i.show()}})),Vo(Uo(i),"onProgressMouseOver",(function(e,t){if(!i.config.disable&&jw.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 No(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(wE).map((function(t){e[t]=wE[t].bind(e)}));var i=n.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return bE(e),e})),e._ispotsInit=!1,n.once(sC,(function(){e.initDots()}))}(this),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){t.config[n]=e[n]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(_E).map((function(n){e[_E[n]]=e[_E[n]].bind(e),t.addCallBack(n,e[_E[n]])})),"mobile"!==zw.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var n=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),n(parseInt(1e3*e._state.now,10)/1e3,t)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&jw.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&jw.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){if(!this.config.disable&&jw.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=this.root,i=this.previewLine,r=this.timePoint,o=this.player,s=this.config,a="flex"===o.controls.mode,c=n.getBoundingClientRect().width;if(c||!this._hasThumnail){var u,l,f=r.getBoundingClientRect().width,h=e-(c=this._hasThumnail&&c<s.width?s.width:c)/2;h<0&&!a?(h=0,u=e-c/2,!this.thumbnail&&(l=e-c/2-f/2)):h>t-c&&!a?(u=h-(t-c),!this.thumbnail&&(l=h-(t-c)-f/2),h=t-c):(u=0,!this.thumbnail&&(l=-f/2)),void 0!==u&&(i.style.transform="translateX(".concat(u.toFixed(2),"px)")),void 0!==l&&(r.style.transform="translateX(".concat(l.toFixed(2),"px)")),n.style.transform="translateX(".concat(h.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,n=this.timePoint;t.textContent=e,!this.thumbnail&&(n.textContent=e)}},{key:"updatePosition",value:function(e,t,n,i){var r=this.root,o=this.config,s=this._state;if(r){this.updateLinePos(e,t),s.now=n;var a=jw.format(n);i&&i.target&&jw.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=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,i.width,i.height);var o=n&&n.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==zw.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i&&i.setConfig(e),i&&i.usable&&n.isShowThumbnail){jw.removeClass(this.root,"short-line no-thumbnail"),"short"===n.mode&&jw.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=jw.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else jw.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")),jw.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(jw.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";jw.addClass(this.root,"no-timepoint"),e&&(jw.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(jw.addClass(this.root,"product"),this.tipText.textContent=e):(jw.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){jw.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",jw.removeClass(this.find(".xg-spot-content"),"show-text"),jw.removeClass(this.root,"product")}},{key:"hide",value:function(){jw.addClass(this.root,"hide")}},{key:"show",value:function(){jw.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(_E).map((function(n){t.removeCallBack(n,e[_E[n]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===zw.device||"mobile"===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-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),n}(A_);function SE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var TE=function(e){jo(n,e);var t=SE(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).ratio=1,i.interval=null,i._preloadMark={},i}return No(n,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([sC],(function(){var t=e.config,n=t.pic_num,i=t.interval;e.usable&&(e.interval=i>0?i:Math.round(1e3*e.player.duration/n)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach((function(n){t.config[n]=e[n]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,n=e.pic_num;return t&&t.length>0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,n=e.height,i=e.pic_num,r=e.interval;this.ratio=t/n*100,this.interval=r||Math.round(this.player.duration/i),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var n=this.config.urls,i=n.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<i-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<i&&(t._preloadMark[e]=1,jw.preloadImg(n[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,r=i.pic_num,o=i.row,s=i.col,a=i.width,c=i.height;this.interval=Math.round(this.player.duration/r);var u=Math.ceil(e/this.interval),l=(u=u>r?r:u)<o*s?0:Math.ceil(u/(o*s))-1,f=u-l*(s*o),h=f>0?Math.ceil(f/s)-1:0,d=f>0?f-h*s-1:0,p=0,g=0;t&&n?t/n<a/c?p=(g=n)*(a/c):g=(p=t)/(a/c):n?t||(p=(g=n||c)*(a/c)):g=(p=t||a)/(a/c);var v=this.getUrlByIndex(l);return{urlIndex:l,rowIndex:h,colIndex:d,url:v,height:g,width:p,style:{backgroundImage:"url(".concat(v,")"),backgroundSize:"".concat(p*s,"px auto"),backgroundPosition:"-".concat(d*p,"px -").concat(h*g,"px"),width:"".concat(p,"px"),height:"".concat(g,"px")}}}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,s=o.pic_num,a=o.urls;if(!(s<=0)&&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=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var n=jw.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(n),n}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),n}(A_);function EE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var PE=function(e){jo(n,e);var t=EE(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(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}(A_),RE=PE;function OE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var LE="realtime",IE="firstframe",AE="poster";var DE=null,ME=function(e){jo(n,e);var t=OE(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.stop(),e.renderOnTimeupdate(t),e.off(iC,e.renderOnTimeupdate),e.on(iC,e.renderOnTimeupdate))})),Vo(Uo(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),Vo(Uo(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(iC,e.renderOnTimeupdate);var n=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(n)}})),Vo(Uo(e),"start",(function(t){var n=e.player.video,i=function(){try{return parseInt(window.performance.now(),10)}catch(e){return(new Date).getTime()}}(),r=e.checkVideoIsSupport(n);r&&e.canvasCtx&&(t||(t=e.interval),e.stop(),n.videoWidth&&n.videoHeight&&(e.videoPI=n.videoHeight>0?parseInt(n.videoWidth/n.videoHeight*100,10):0,(e.config.mode===LE||i-e.preTime>=t)&&(n&&n.videoWidth&&e.update(r,e.videoPI),e.preTime=i)),e.frameId="timer"===e._loopType?jw.setTimeout(Uo(e),e.start,t):jw.requestAnimationFrame(e.start))})),Vo(Uo(e),"stop",(function(){e.frameId&&("timer"===e._loopType?jw.clearTimeout(Uo(e),e.frameId):jw.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var t=this.config,i=t.disable,r=t.mode,o=t.frameRate;i||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/o,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==LE&&this.interval>=1e3?"timer":"animation",this.once(kC,(function(){e.player&&(e.init(),e.player.paused||e.start())})),r!==AE&&(r!==IE&&(this.on(hC,(function(){e.stop()})),this.on($w,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(t)})),this.on(Qw,(function(){e.stop()}))),this.on(cC,this.onLoadedData),this.on(fC,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange)))}},{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" data-index="'.concat(t.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=i.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=t.filter,this.canvas.style.webkitFilter=t.filter),this.mask=this.find("xgmask"),t.addMask&&(this.mask.style.background=t.maskBg),this.canvasCtx=this.canvas.getContext("2d"),this.renderByPoster()}catch(e){Fw.logError("plugin:DynamicBg",e)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==zw.browser||!/^blob/.test(t.currentSrc)&&!/^blob/.test(t.src)))return t;var n=t?t.tagName.toLowerCase():"";return"canvas"===n||"img"===n?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===jw.typeOf(e)?e:"String"===jw.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==IE&&e!==AE}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&e.videoWidth&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=i;var e=parseInt(i/r*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var n=this._pos,i=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,s=r.height;if(o!==n.width||s!==n.height||n.pi!==t){var a=parseInt(o/s*100,10);n.pi=t,n.width!==o&&(n.width=this.canvas.width=o),n.height!==s&&(n.height=this.canvas.height=s);var c=s,u=o;a<t?u=parseInt(s*t/100,10):a>t&&(c=parseInt(100*o/t,10)),n.rwidth=u*i.multiple,n.rheight=c*i.multiple,n.x=(o-n.rwidth)/2,n.y=(s-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(e){Fw.logError("plugin:DynamicBg",e)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:1,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof DE?DE:DE=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===zw.browser||"firefox"===zw.browser)}}]),n}(A_),NE=ME,FE=d,BE=fe,jE=ie("iterator"),UE=!FE((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.size&&!BE||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[jE]||"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})),HE=Se,GE=Pp,VE=As,WE=Pe,KE=T,zE=function(e,t,n,i){try{return i?t(HE(n)[0],n[1]):t(n)}catch(t){GE(e,"throw",t)}},YE=fp,XE=Hr,qE=Ci,$E=Jo,JE=xp,ZE=yp,QE=Array,eP=k,tP=2147483647,nP=/[^\0-\u007E]/,iP=/[.\u3002\uFF0E\uFF61]/g,rP="Overflow: input needs wider integers to process",oP=RangeError,sP=eP(iP.exec),aP=Math.floor,cP=String.fromCharCode,uP=eP("".charCodeAt),lP=eP([].join),fP=eP([].push),hP=eP("".replace),dP=eP("".split),pP=eP("".toLowerCase),gP=function(e){return e+22+75*(e<26)},vP=function(e,t,n){var i=0;for(e=n?aP(e/700):e>>1,e+=aP(e/t);e>455;)e=aP(e/35),i+=36;return aP(i+36*e/(e+38))},yP=function(e){var t=[];e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=uP(e,n++);if(r>=55296&&r<=56319&&n<i){var o=uP(e,n++);56320==(64512&o)?fP(t,((1023&r)<<10)+(1023&o)+65536):(fP(t,r),n--)}else fP(t,r)}return t}(e);var n,i,r=e.length,o=128,s=0,a=72;for(n=0;n<e.length;n++)(i=e[n])<128&&fP(t,cP(i));var c=t.length,u=c;for(c&&fP(t,"-");u<r;){var l=tP;for(n=0;n<e.length;n++)(i=e[n])>=o&&i<l&&(l=i);var f=u+1;if(l-o>aP((tP-s)/f))throw oP(rP);for(s+=(l-o)*f,o=l,n=0;n<e.length;n++){if((i=e[n])<o&&++s>tP)throw oP(rP);if(i==o){for(var h=s,d=36;;){var p=d<=a?1:d>=a+26?26:d-a;if(h<p)break;var g=h-p,v=36-p;fP(t,cP(gP(p+g%v))),h=aP(g/v),d+=36}fP(t,cP(gP(h))),a=vP(s,f,u==c),s=0,u++}}s++,o++}return lP(t,"")},mP=En,kP=lr,bP=n,wP=Pe,CP=k,_P=fe,xP=UE,SP=En,TP=fs,EP=function(e,t,n){for(var i in t)mP(e,i,t[i],n);return e},PP=Ts,RP=qv,OP=on,LP=Df,IP=ue,AP=R,DP=As,MP=Bn,NP=Se,FP=pe,BP=zo,jP=mo,UP=Nt,HP=xp,GP=yp,VP=Hf,WP=aw,KP=ie("iterator"),zP="URLSearchParams",YP=zP+"Iterator",XP=OP.set,qP=OP.getterFor(zP),$P=OP.getterFor(YP),JP=Object.getOwnPropertyDescriptor,ZP=function(e){if(!_P)return bP[e];var t=JP(bP,e);return t&&t.value},QP=ZP("fetch"),eR=ZP("Request"),tR=ZP("Headers"),nR=eR&&eR.prototype,iR=tR&&tR.prototype,rR=bP.RegExp,oR=bP.TypeError,sR=bP.decodeURIComponent,aR=bP.encodeURIComponent,cR=CP("".charAt),uR=CP([].join),lR=CP([].push),fR=CP("".replace),hR=CP([].shift),dR=CP([].splice),pR=CP("".split),gR=CP("".slice),vR=/\+/g,yR=Array(4),mR=function(e){return yR[e-1]||(yR[e-1]=rR("((?:%[\\da-f]{2}){"+e+"})","gi"))},kR=function(e){try{return sR(e)}catch(t){return e}},bR=function(e){var t=fR(e,vR," "),n=4;try{return sR(t)}catch(e){for(;n;)t=fR(t,mR(n--),kR);return t}},wR=/[!'()~]|%20/g,CR={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},_R=function(e){return CR[e]},xR=function(e){return fR(aR(e),wR,_R)},SR=RP((function(e,t){XP(this,{type:YP,iterator:HP(qP(e).entries),kind:t})}),"Iterator",(function(){var e=$P(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n}),!0),TR=function(e){this.entries=[],this.url=null,void 0!==e&&(FP(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===cR(e,0)?gR(e,1):e:BP(e)))};TR.prototype={type:zP,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,i,r,o,s,a,c=GP(e);if(c)for(n=(t=HP(e,c)).next;!(i=wP(n,t)).done;){if(o=(r=HP(NP(i.value))).next,(s=wP(o,r)).done||(a=wP(o,r)).done||!wP(o,r).done)throw oR("Expected sequence with length 2");lR(this.entries,{key:BP(s.value),value:BP(a.value)})}else for(var u in e)AP(e,u)&&lR(this.entries,{key:u,value:BP(e[u])})},parseQuery:function(e){if(e)for(var t,n,i=pR(e,"&"),r=0;r<i.length;)(t=i[r++]).length&&(n=pR(t,"="),lR(this.entries,{key:bR(hR(n)),value:bR(uR(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],i=0;i<t.length;)e=t[i++],lR(n,xR(e.key)+"="+xR(e.value));return uR(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ER=function(){LP(this,PR);var e=XP(this,new TR(arguments.length>0?arguments[0]:void 0));_P||(this.length=e.entries.length)},PR=ER.prototype;if(EP(PR,{append:function(e,t){VP(arguments.length,2);var n=qP(this);lR(n.entries,{key:BP(e),value:BP(t)}),_P||this.length++,n.updateURL()},delete:function(e){VP(arguments.length,1);for(var t=qP(this),n=t.entries,i=BP(e),r=0;r<n.length;)n[r].key===i?dR(n,r,1):r++;_P||(this.length=n.length),t.updateURL()},get:function(e){VP(arguments.length,1);for(var t=qP(this).entries,n=BP(e),i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){VP(arguments.length,1);for(var t=qP(this).entries,n=BP(e),i=[],r=0;r<t.length;r++)t[r].key===n&&lR(i,t[r].value);return i},has:function(e){VP(arguments.length,1);for(var t=qP(this).entries,n=BP(e),i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){VP(arguments.length,1);for(var n,i=qP(this),r=i.entries,o=!1,s=BP(e),a=BP(t),c=0;c<r.length;c++)(n=r[c]).key===s&&(o?dR(r,c--,1):(o=!0,n.value=a));o||lR(r,{key:s,value:a}),_P||(this.length=r.length),i.updateURL()},sort:function(){var e=qP(this);WP(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=qP(this).entries,i=DP(e,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new SR(this,"keys")},values:function(){return new SR(this,"values")},entries:function(){return new SR(this,"entries")}},{enumerable:!0}),SP(PR,KP,PR.entries,{name:"entries"}),SP(PR,"toString",(function(){return qP(this).serialize()}),{enumerable:!0}),_P&&TP(PR,"size",{get:function(){return qP(this).entries.length},configurable:!0,enumerable:!0}),PP(ER,zP),kP({global:!0,constructor:!0,forced:!xP},{URLSearchParams:ER}),!xP&&IP(tR)){var RR=CP(iR.has),OR=CP(iR.set),LR=function(e){if(FP(e)){var t,n=e.body;if(MP(n)===zP)return t=e.headers?new tR(e.headers):new tR,RR(t,"content-type")||OR(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),jP(e,{body:UP(0,BP(n)),headers:UP(0,t)})}return e};if(IP(QP)&&kP({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return QP(e,arguments.length>1?LR(arguments[1]):{})}}),IP(eR)){var IR=function(e){return LP(this,nR),new eR(e,arguments.length>1?LR(arguments[1]):{})};nR.constructor=IR,IR.prototype=nR,kP({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:IR})}}var AR,DR=lr,MR=fe,NR=UE,FR=n,BR=As,jR=k,UR=En,HR=fs,GR=Df,VR=R,WR=em,KR=function(e){var t=KE(e),n=XE(this),i=arguments.length,r=i>1?arguments[1]:void 0,o=void 0!==r;o&&(r=VE(r,i>2?arguments[2]:void 0));var s,a,c,u,l,f,h=ZE(t),d=0;if(!h||this===QE&&YE(h))for(s=qE(t),a=n?new this(s):QE(s);s>d;d++)f=o?r(t[d],d):t[d],$E(a,d,f);else for(l=(u=JE(t,h)).next,a=n?new this:[];!(c=WE(l,u)).done;d++)f=o?zE(u,r,[c.value,d],!0):c.value,$E(a,d,f);return a.length=d,a},zR=is,YR=_m.codeAt,XR=function(e){var t,n,i=[],r=dP(hP(pP(e),iP,"."),".");for(t=0;t<r.length;t++)n=r[t],fP(i,sP(nP,n)?"xn--"+yP(n):n);return lP(i,".")},qR=zo,$R=Ts,JR=Hf,ZR={URLSearchParams:ER,getState:qP},QR=on,eO=QR.set,tO=QR.getterFor("URL"),nO=ZR.URLSearchParams,iO=ZR.getState,rO=FR.URL,oO=FR.TypeError,sO=FR.parseInt,aO=Math.floor,cO=Math.pow,uO=jR("".charAt),lO=jR(/./.exec),fO=jR([].join),hO=jR(1..toString),dO=jR([].pop),pO=jR([].push),gO=jR("".replace),vO=jR([].shift),yO=jR("".split),mO=jR("".slice),kO=jR("".toLowerCase),bO=jR([].unshift),wO="Invalid scheme",CO="Invalid host",_O="Invalid port",xO=/[a-z]/i,SO=/[\d+-.a-z]/i,TO=/\d/,EO=/^0x/i,PO=/^[0-7]+$/,RO=/^\d+$/,OO=/^[\da-f]+$/i,LO=/[\0\t\n\r #%/:<>?@[\\\]^|]/,IO=/[\0\t\n\r #/:<>?@[\\\]^|]/,AO=/^[\u0000-\u0020]+/,DO=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,MO=/[\t\n\r]/g,NO=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)bO(t,e%256),e=aO(e/256);return fO(t,".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,o=0;o<8;o++)0!==e[o]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=hO(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},FO={},BO=WR({},FO,{" ":1,'"':1,"<":1,">":1,"`":1}),jO=WR({},BO,{"#":1,"?":1,"{":1,"}":1}),UO=WR({},jO,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),HO=function(e,t){var n=YR(e,0);return n>32&&n<127&&!VR(t,e)?e:encodeURIComponent(e)},GO={ftp:21,file:null,http:80,https:443,ws:80,wss:443},VO=function(e,t){var n;return 2==e.length&&lO(xO,uO(e,0))&&(":"==(n=uO(e,1))||!t&&"|"==n)},WO=function(e){var t;return e.length>1&&VO(mO(e,0,2))&&(2==e.length||"/"===(t=uO(e,2))||"\\"===t||"?"===t||"#"===t)},KO=function(e){return"."===e||"%2e"===kO(e)},zO={},YO={},XO={},qO={},$O={},JO={},ZO={},QO={},eL={},tL={},nL={},iL={},rL={},oL={},sL={},aL={},cL={},uL={},lL={},fL={},hL={},dL=function(e,t,n){var i,r,o,s=qR(e);if(t){if(r=this.parse(s))throw oO(r);this.searchParams=null}else{if(void 0!==n&&(i=new dL(n,!0)),r=this.parse(s,null,i))throw oO(r);(o=iO(new nO)).bindURL(this),this.searchParams=o}};dL.prototype={type:"URL",parse:function(e,t,n){var i,r,o,s,a,c=this,u=t||zO,l=0,f="",h=!1,d=!1,p=!1;for(e=qR(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=gO(e,AO,""),e=gO(e,DO,"$1")),e=gO(e,MO,""),i=KR(e);l<=i.length;){switch(r=i[l],u){case zO:if(!r||!lO(xO,r)){if(t)return wO;u=XO;continue}f+=kO(r),u=YO;break;case YO:if(r&&(lO(SO,r)||"+"==r||"-"==r||"."==r))f+=kO(r);else{if(":"!=r){if(t)return wO;f="",u=XO,l=0;continue}if(t&&(c.isSpecial()!=VR(GO,f)||"file"==f&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=f,t)return void(c.isSpecial()&&GO[c.scheme]==c.port&&(c.port=null));f="","file"==c.scheme?u=oL:c.isSpecial()&&n&&n.scheme==c.scheme?u=qO:c.isSpecial()?u=QO:"/"==i[l+1]?(u=$O,l++):(c.cannotBeABaseURL=!0,pO(c.path,""),u=lL)}break;case XO:if(!n||n.cannotBeABaseURL&&"#"!=r)return wO;if(n.cannotBeABaseURL&&"#"==r){c.scheme=n.scheme,c.path=zR(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,u=hL;break}u="file"==n.scheme?oL:JO;continue;case qO:if("/"!=r||"/"!=i[l+1]){u=JO;continue}u=eL,l++;break;case $O:if("/"==r){u=tL;break}u=uL;continue;case JO:if(c.scheme=n.scheme,r==AR)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=zR(n.path),c.query=n.query;else if("/"==r||"\\"==r&&c.isSpecial())u=ZO;else if("?"==r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=zR(n.path),c.query="",u=fL;else{if("#"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=zR(n.path),c.path.length--,u=uL;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=zR(n.path),c.query=n.query,c.fragment="",u=hL}break;case ZO:if(!c.isSpecial()||"/"!=r&&"\\"!=r){if("/"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,u=uL;continue}u=tL}else u=eL;break;case QO:if(u=eL,"/"!=r||"/"!=uO(f,l+1))continue;l++;break;case eL:if("/"!=r&&"\\"!=r){u=tL;continue}break;case tL:if("@"==r){h&&(f="%40"+f),h=!0,o=KR(f);for(var g=0;g<o.length;g++){var v=o[g];if(":"!=v||p){var y=HO(v,UO);p?c.password+=y:c.username+=y}else p=!0}f=""}else if(r==AR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(h&&""==f)return"Invalid authority";l-=KR(f).length+1,f="",u=nL}else f+=r;break;case nL:case iL:if(t&&"file"==c.scheme){u=aL;continue}if(":"!=r||d){if(r==AR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(c.isSpecial()&&""==f)return CO;if(t&&""==f&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(f))return s;if(f="",u=cL,t)return;continue}"["==r?d=!0:"]"==r&&(d=!1),f+=r}else{if(""==f)return CO;if(s=c.parseHost(f))return s;if(f="",u=rL,t==iL)return}break;case rL:if(!lO(TO,r)){if(r==AR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()||t){if(""!=f){var m=sO(f,10);if(m>65535)return _O;c.port=c.isSpecial()&&m===GO[c.scheme]?null:m,f=""}if(t)return;u=cL;continue}return _O}f+=r;break;case oL:if(c.scheme="file","/"==r||"\\"==r)u=sL;else{if(!n||"file"!=n.scheme){u=uL;continue}if(r==AR)c.host=n.host,c.path=zR(n.path),c.query=n.query;else if("?"==r)c.host=n.host,c.path=zR(n.path),c.query="",u=fL;else{if("#"!=r){WO(fO(zR(i,l),""))||(c.host=n.host,c.path=zR(n.path),c.shortenPath()),u=uL;continue}c.host=n.host,c.path=zR(n.path),c.query=n.query,c.fragment="",u=hL}}break;case sL:if("/"==r||"\\"==r){u=aL;break}n&&"file"==n.scheme&&!WO(fO(zR(i,l),""))&&(VO(n.path[0],!0)?pO(c.path,n.path[0]):c.host=n.host),u=uL;continue;case aL:if(r==AR||"/"==r||"\\"==r||"?"==r||"#"==r){if(!t&&VO(f))u=uL;else if(""==f){if(c.host="",t)return;u=cL}else{if(s=c.parseHost(f))return s;if("localhost"==c.host&&(c.host=""),t)return;f="",u=cL}continue}f+=r;break;case cL:if(c.isSpecial()){if(u=uL,"/"!=r&&"\\"!=r)continue}else if(t||"?"!=r)if(t||"#"!=r){if(r!=AR&&(u=uL,"/"!=r))continue}else c.fragment="",u=hL;else c.query="",u=fL;break;case uL:if(r==AR||"/"==r||"\\"==r&&c.isSpecial()||!t&&("?"==r||"#"==r)){if(".."===(a=kO(a=f))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(c.shortenPath(),"/"==r||"\\"==r&&c.isSpecial()||pO(c.path,"")):KO(f)?"/"==r||"\\"==r&&c.isSpecial()||pO(c.path,""):("file"==c.scheme&&!c.path.length&&VO(f)&&(c.host&&(c.host=""),f=uO(f,0)+":"),pO(c.path,f)),f="","file"==c.scheme&&(r==AR||"?"==r||"#"==r))for(;c.path.length>1&&""===c.path[0];)vO(c.path);"?"==r?(c.query="",u=fL):"#"==r&&(c.fragment="",u=hL)}else f+=HO(r,jO);break;case lL:"?"==r?(c.query="",u=fL):"#"==r?(c.fragment="",u=hL):r!=AR&&(c.path[0]+=HO(r,FO));break;case fL:t||"#"!=r?r!=AR&&("'"==r&&c.isSpecial()?c.query+="%27":c.query+="#"==r?"%23":HO(r,FO)):(c.fragment="",u=hL);break;case hL:r!=AR&&(c.fragment+=HO(r,BO))}l++}},parseHost:function(e){var t,n,i;if("["==uO(e,0)){if("]"!=uO(e,e.length-1))return CO;if(t=function(e){var t,n,i,r,o,s,a,c=[0,0,0,0,0,0,0,0],u=0,l=null,f=0,h=function(){return uO(e,f)};if(":"==h()){if(":"!=uO(e,1))return;f+=2,l=++u}for(;h();){if(8==u)return;if(":"!=h()){for(t=n=0;n<4&&lO(OO,h());)t=16*t+sO(h(),16),f++,n++;if("."==h()){if(0==n)return;if(f-=n,u>6)return;for(i=0;h();){if(r=null,i>0){if(!("."==h()&&i<4))return;f++}if(!lO(TO,h()))return;for(;lO(TO,h());){if(o=sO(h(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;f++}c[u]=256*c[u]+r,2!=++i&&4!=i||u++}if(4!=i)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;c[u++]=t}else{if(null!==l)return;f++,l=++u}}if(null!==l)for(s=u-l,u=7;0!=u&&s>0;)a=c[u],c[u--]=c[l+s-1],c[l+--s]=a;else if(8!=u)return;return c}(mO(e,1,-1)),!t)return CO;this.host=t}else if(this.isSpecial()){if(e=XR(e),lO(LO,e))return CO;if(t=function(e){var t,n,i,r,o,s,a,c=yO(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(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"==uO(r,0)&&(o=lO(EO,r)?16:8,r=mO(r,8==o?1:2)),""===r)s=0;else{if(!lO(10==o?RO:8==o?PO:OO,r))return e;s=sO(r,o)}pO(n,s)}for(i=0;i<t;i++)if(s=n[i],i==t-1){if(s>=cO(256,5-t))return null}else if(s>255)return null;for(a=dO(n),i=0;i<n.length;i++)a+=n[i]*cO(256,3-i);return a}(e),null===t)return CO;this.host=t}else{if(lO(IO,e))return CO;for(t="",n=KR(e),i=0;i<n.length;i++)t+=HO(n[i],FO);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return VR(GO,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&VO(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,i=e.password,r=e.host,o=e.port,s=e.path,a=e.query,c=e.fragment,u=t+":";return null!==r?(u+="//",e.includesCredentials()&&(u+=n+(i?":"+i:"")+"@"),u+=NO(r),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?s[0]:s.length?"/"+fO(s,"/"):"",null!==a&&(u+="?"+a),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw oO(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new pL(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+NO(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(qR(e)+":",zO)},getUsername:function(){return this.username},setUsername:function(e){var t=KR(qR(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=HO(t[n],UO)}},getPassword:function(){return this.password},setPassword:function(e){var t=KR(qR(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=HO(t[n],UO)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?NO(e):NO(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,nL)},getHostname:function(){var e=this.host;return null===e?"":NO(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,iL)},getPort:function(){var e=this.port;return null===e?"":qR(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=qR(e))?this.port=null:this.parse(e,rL))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+fO(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,cL))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=qR(e))?this.query=null:("?"==uO(e,0)&&(e=mO(e,1)),this.query="",this.parse(e,fL)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=qR(e))?("#"==uO(e,0)&&(e=mO(e,1)),this.fragment="",this.parse(e,hL)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var pL=function(e){var t=GR(this,gL),n=JR(arguments.length,1)>1?arguments[1]:void 0,i=eO(t,new dL(e,!1,n));MR||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},gL=pL.prototype,vL=function(e,t){return{get:function(){return tO(this)[e]()},set:t&&function(e){return tO(this)[t](e)},configurable:!0,enumerable:!0}};if(MR&&(HR(gL,"href",vL("serialize","setHref")),HR(gL,"origin",vL("getOrigin")),HR(gL,"protocol",vL("getProtocol","setProtocol")),HR(gL,"username",vL("getUsername","setUsername")),HR(gL,"password",vL("getPassword","setPassword")),HR(gL,"host",vL("getHost","setHost")),HR(gL,"hostname",vL("getHostname","setHostname")),HR(gL,"port",vL("getPort","setPort")),HR(gL,"pathname",vL("getPathname","setPathname")),HR(gL,"search",vL("getSearch","setSearch")),HR(gL,"searchParams",vL("getSearchParams")),HR(gL,"hash",vL("getHash","setHash"))),UR(gL,"toJSON",(function(){return tO(this).serialize()}),{enumerable:!0}),UR(gL,"toString",(function(){return tO(this).serialize()}),{enumerable:!0}),rO){var yL=rO.createObjectURL,mL=rO.revokeObjectURL;yL&&UR(pL,"createObjectURL",BR(yL,rO)),mL&&UR(pL,"revokeObjectURL",BR(mL,rO))}function kL(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 bL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kL(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kL(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}$R(pL,"URL"),DR({global:!0,constructor:!0,forced:!NR,sham:!MR},{URL:pL});var CL="info",_L=GC,xL=function(e){jo(n,e);var t=wL(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(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[CL].push(bL(bL({type:"userAction"},n),{},{payload:i}))})),Vo(Uo(e),"_onReset",(function(){e.reset()})),Vo(Uo(e),"_recordInfo",(function(t){e.info(t)})),Vo(Uo(e),"_downloadStats",(function(){var t=e.getStats(),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=window.URL.createObjectURL(n),r=document.createElement("a");r.style.display="none",r.href=i,r.download="player.txt",r.disabled=!1,r.click()})),e}return No(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(FC,this._recordUserActions),this.on(_L.STATS_INFO,this._recordInfo),this.on(_L.STATS_DOWNLOAD,this._downloadStats),this.on(_L.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[CL].push(bL(bL({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=bL({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=(Vo(e={},CL,[]),Vo(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(){var e=this._stats[CL].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," ")}));return e}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[CL].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),n}(b_);function SL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var TL=function(e){jo(n,e);var t=SL(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Uo(e),i=t.player,r=t.config;if(i.video.readyState!==HTMLMediaElement.HAVE_NOTHING){if(i.video.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!i.video.paused||0===i.video.currentTime||!e.hasPlayed){var o=i.video.buffered,s=r.smallGapLimit||.5,a=r.gapDetectionThreshold||.3,c=i.video.currentTime,u=e._getIndex(o,c,a);if(null!==u&&0!==u){console.log("GapJump bufferRange ",o.start(u),o.end(u));var l=o.start(u)+.1;if(!(l>i.video.duration)){var f=l-c,h=f<=s;f<n.BROWSER_GAP_TOLERANCE||h&&(!1!==r.useGapJump&&(i.video.currentTime=e.isSafari?l+.1:l),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",u," isGapSamll:",h," currentTime:",i.video.currentTime," jumpSize:",c-i.video.currentTime),.08!==l&&i&&i.emit("log",{type:"oneevent",end_type:"gap",vid:i.config.vid,ext:{video_postion:Math.floor(1e3*l)}}))}}}}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(rC,this.onGapJump),this.on($w,(function(){e.hasPlayed=!0})),this.on(tC,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,n){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var i=this._getBuffered(e),r=null,o=0;o<i.length;o++){if(i[o].start>t&&(0===o||i[o-1].end-t<=n)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),n}(A_);function EL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}TL.BROWSER_GAP_TOLERANCE=.001;var PL=function(e){jo(n,e);var t=EL(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Uo(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),Vo(Uo(e),"onJump",(function(){var t=Uo(e),n=t.player,i=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||n.video.paused&&0!==n.video.currentTime&&e.hasPlayed)){e.jumpSize=i.jumpSize*(e.jumpCnt+1),e.jumpCnt===i.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=n.currentTime+e.jumpSize;r>n.video.duration||(e.jumpCnt++,n.currentTime=r)}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.useWaitingTimeoutJump,i=t.jumpSize;!1!==n&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on(rC,this.onWaiting),this.on([Jw,oC],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on($w,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n}(A_);function RL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var OL="cdn",LL=["cdn"],IL=function(e){jo(n,e);var t=RL(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:OL;if(!e.speedListCache||!e.speedListCache[t])return 0;if(e.speedListCache[t].length<=0)return 0;var n=0;return e.speedListCache[t].map((function(e){n+=e})),Math.floor(n/e.speedListCache[t].length)})),Vo(Uo(e),"startTimer",(function(){jw.isMSE(e.player.video)||(e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),Vo(Uo(e),"initSpeedList",(function(){e.speedListCache={},LL.forEach((function(t){e.speedListCache[t]=[]}))})),Vo(Uo(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||OL)})),Vo(Uo(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,n=t.url,i=t.loadSize,r=t.testCnt,o=t.testTimeStep,s=n+(n.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var a=(new Date).getTime(),c=null,u=new XMLHttpRequest;e.xhr=u,u.open("GET",s);var l={},f=Math.floor(10*Math.random());l.Range="bytes="+f+"-"+(i+f),l&&Object.keys(l).forEach((function(e){u.setRequestHeader(e,l[e])})),u.onreadystatechange=function(){if(4===u.readyState){e.xhr=null,c=(new Date).getTime();var t=u.getResponseHeader("Content-Length")/1024*8,n=Math.round(1e3*t/(c-a));e.appendList(n),e.timer=setTimeout(e.testSpeed,o)}},u.send()}catch(e){console.error(e)}}}})),Vo(Uo(e),"appendList",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:OL;if(e.speedListCache&&e.speedListCache[n]){var i=e.config.saveSpeedMax;e.speedListCache[n].length>=i&&e.speedListCache[n].shift(),e.speedListCache[n].push(t);var r=Uo(e).player;r&&(n===OL?r.realTimeSpeed=t:r[e.getSpeedName("realTime",n)]=t),e.updateSpeed(n)}})),Vo(Uo(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:OL,n=e.getSpeed(t),i=Uo(e).player;if(i)if(t===OL)i.avgSpeed&&n===i.avgSpeed||(i.avgSpeed=n,i.emit(_C,{speed:n,realTimeSpeed:i.realTimeSpeed}));else{var r=e.getSpeedName("avg",t);i[r]&&n===i[r]||(i[r]=n,i.emit(_C,{speed:n,realTimeSpeed:i.realTimeSpeed}))}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,n=e.addSpeedTypeList,i=e.testCnt;(null==n?void 0:n.length)>0&&LL.push.apply(LL,om(n)),this.initSpeedList(),t&&(this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i>0&&this.on([cC,bC],this.startTimer))}},{key:"getSpeedName",value:function(e,t){return e+"Speed"+t.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([cC,bC],this.startTimer),LL.forEach((function(t){e.speedListCache&&e.speedListCache[t]&&(e.speedListCache[t]=[])})),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),n}(A_);function AL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var DL=function(e){jo(n,e);var t=AL(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.config;(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],n.disabled)||t.video.getVideoPlaybackQuality&&(this.on($w,(function(){e._startTick()})),this.on(Qw,(function(){e._stopTick()})),this.on(Zw,(function(){e._stopTick()})),this.on(hC,(function(){e._stopTick()})))}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout((function(){e._checkDecodeFPS(),e._startTick()}),this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkStuck",value:function(e,t,n,i){var r=this.player.video,o=document.hidden,s=r.paused;if("boolean"==typeof o&&!o&&!s){for(var a=r.currentTime,c=r.buffered,u=!1,l=[],f=0;f<c.length;f++){var h=c.start(f),d=c.end(f);if(l.push({start:h,end:d}),h<=a&&a<=d-1){u=!0;break}}4===r.readyState&&u&&(this._currentStuckCount>this.config.stuckCount?(this.emit(VC,this._payload),this._reset()):e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({bufs:l,currentTime:r.currentTime,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:n,checkInterval:i})):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){if(this.player.video){var e=this.player.video.getVideoPlaybackQuality(),t=e.totalVideoFrames,n=e.droppedVideoFrames,i=performance.now();if(t&&this._lastCheckPoint){var r=t-this._lastDecodedFrames,o=i-this._lastCheckPoint;this._checkStuck(r,t,n,o)}this._lastDecodedFrames=t,this._lastCheckPoint=i}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),n}(A_);nx.use({LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}});var ML=No((function e(t,n){var i,r,o;Fo(this,e);var s=n&&"mobile"===n.isMobileSimulateMode,a=n.isLive,c=[].concat(a?[]:[pT,RE,xE,PT],[kT,TT,FT,XT,aE,uE,QT,tE,DT,KT]),u=[Tx,Rx,Mx,tT,Bx,gE,mE,TE,eS];this.plugins=[Cx,xL,PL,TL].concat(om(c),u);var l=s?"mobile":zw.device;switch(l){case"pc":(i=this.plugins).push.apply(i,[JS,rS,dE,IL,DL]);break;case"mobile":(r=this.plugins).push.apply(r,[zS]);break;default:(o=this.plugins).push.apply(o,[JS,rS,dE])}(zw.os.isIpad||"pc"===l)&&this.plugins.push(NE),zw.os.isIpad&&this.plugins.push(rS),this.ignores=[],this.i18n=[]}));function NL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var FL=function(e){jo(n,e);var t=NL(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n)}(ux);return Vo(FL,"defaultPreset",ML),Vo(FL,"Util",jw),Vo(FL,"Sniffer",zw),Vo(FL,"Errors",qw),Vo(FL,"Events",WC),Vo(FL,"Plugin",A_),Vo(FL,"BasePlugin",b_),Vo(FL,"I18N",nx),Vo(FL,"STATE_CLASS",z_),Vo(FL,"PAUSE_TYPES",t_),Vo(FL,"BUFFER_CONTROL_TYPES",n_),FL}));
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}()||e||Function("return this")(),i={exports:{}},r=n,o=Object.defineProperty,s=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t},a=s,c="__core-js_shared__",u=n[c]||a(c,{}),l=u;(i.exports=function(e,t){return l[e]||(l[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.2/LICENSE",source:"https://github.com/zloirock/core-js"});var f,h,d=function(e){try{return!!e()}catch(e){return!0}},p=!d((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),g=p,v=Function.prototype,y=v.call,m=g&&v.bind.bind(y,y),k=g?m:function(e){return function(){return y.apply(e,arguments)}},b=function(e){return null==e},w=b,C=TypeError,_=function(e){if(w(e))throw C("Can't call method on "+e);return e},x=_,S=Object,T=function(e){return S(x(e))},E=T,P=k({}.hasOwnProperty),R=Object.hasOwn||function(e,t){return P(E(e),t)},O=k,L=0,I=Math.random(),A=O(1..toString),D=function(e){return"Symbol("+(void 0===e?"":e)+")_"+A(++L+I,36)},M="undefined"!=typeof navigator&&String(navigator.userAgent)||"",N=n,F=M,B=N.process,j=N.Deno,U=B&&B.versions||j&&j.version,H=U&&U.v8;H&&(h=(f=H.split("."))[0]>0&&f[0]<4?1:+(f[0]+f[1])),!h&&F&&(!(f=F.match(/Edge\/(\d+)/))||f[1]>=74)&&(f=F.match(/Chrome\/(\d+)/))&&(h=+f[1]);var G=h,V=G,W=d,K=n.String,z=!!Object.getOwnPropertySymbols&&!W((function(){var e=Symbol();return!K(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V&&V<41})),Y=z&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,X=n,q=i.exports,$=R,J=D,Z=z,Q=Y,ee=X.Symbol,te=q("wks"),ne=Q?ee.for||ee:ee&&ee.withoutSetter||J,ie=function(e){return $(te,e)||(te[e]=Z&&$(ee,e)?ee[e]:ne("Symbol."+e)),te[e]},re={};re[ie("toStringTag")]="z";var oe="[object z]"===String(re),se="object"==typeof document&&document.all,ae={all:se,IS_HTMLDDA:void 0===se&&void 0!==se},ce=ae.all,ue=ae.IS_HTMLDDA?function(e){return"function"==typeof e||e===ce}:function(e){return"function"==typeof e},le={},fe=!d((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),he=ue,de=ae.all,pe=ae.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:he(e)||e===de}:function(e){return"object"==typeof e?null!==e:he(e)},ge=pe,ve=n.document,ye=ge(ve)&&ge(ve.createElement),me=function(e){return ye?ve.createElement(e):{}},ke=me,be=!fe&&!d((function(){return 7!=Object.defineProperty(ke("div"),"a",{get:function(){return 7}}).a})),we=fe&&d((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ce=pe,_e=String,xe=TypeError,Se=function(e){if(Ce(e))return e;throw xe(_e(e)+" is not an object")},Te=p,Ee=Function.prototype.call,Pe=Te?Ee.bind(Ee):function(){return Ee.apply(Ee,arguments)},Re=n,Oe=ue,Le=function(e,t){return arguments.length<2?(n=Re[e],Oe(n)?n:void 0):Re[e]&&Re[e][t];var n},Ie=k({}.isPrototypeOf),Ae=Le,De=ue,Me=Ie,Ne=Object,Fe=Y?function(e){return"symbol"==typeof e}:function(e){var t=Ae("Symbol");return De(t)&&Me(t.prototype,Ne(e))},Be=String,je=function(e){try{return Be(e)}catch(e){return"Object"}},Ue=ue,He=je,Ge=TypeError,Ve=function(e){if(Ue(e))return e;throw Ge(He(e)+" is not a function")},We=Ve,Ke=b,ze=function(e,t){var n=e[t];return Ke(n)?void 0:We(n)},Ye=Pe,Xe=ue,qe=pe,$e=TypeError,Je=Pe,Ze=pe,Qe=Fe,et=ze,tt=function(e,t){var n,i;if("string"===t&&Xe(n=e.toString)&&!qe(i=Ye(n,e)))return i;if(Xe(n=e.valueOf)&&!qe(i=Ye(n,e)))return i;if("string"!==t&&Xe(n=e.toString)&&!qe(i=Ye(n,e)))return i;throw $e("Can't convert object to primitive value")},nt=TypeError,it=ie("toPrimitive"),rt=function(e,t){if(!Ze(e)||Qe(e))return e;var n,i=et(e,it);if(i){if(void 0===t&&(t="default"),n=Je(i,e,t),!Ze(n)||Qe(n))return n;throw nt("Can't convert object to primitive value")}return void 0===t&&(t="number"),tt(e,t)},ot=rt,st=Fe,at=function(e){var t=ot(e,"string");return st(t)?t:t+""},ct=fe,ut=be,lt=we,ft=Se,ht=at,dt=TypeError,pt=Object.defineProperty,gt=Object.getOwnPropertyDescriptor,vt="enumerable",yt="configurable",mt="writable";le.f=ct?lt?function(e,t,n){if(ft(e),t=ht(t),ft(n),"function"==typeof e&&"prototype"===t&&"value"in n&&mt in n&&!n[mt]){var i=gt(e,t);i&&i[mt]&&(e[t]=n.value,n={configurable:yt in n?n[yt]:i[yt],enumerable:vt in n?n[vt]:i[vt],writable:!1})}return pt(e,t,n)}:pt:function(e,t,n){if(ft(e),t=ht(t),ft(n),ut)try{return pt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw dt("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var kt={exports:{}},bt=fe,wt=R,Ct=Function.prototype,_t=bt&&Object.getOwnPropertyDescriptor,xt=wt(Ct,"name"),St={EXISTS:xt,PROPER:xt&&"something"===function(){}.name,CONFIGURABLE:xt&&(!bt||bt&&_t(Ct,"name").configurable)},Tt=ue,Et=u,Pt=k(Function.toString);Tt(Et.inspectSource)||(Et.inspectSource=function(e){return Pt(e)});var Rt,Ot,Lt,It=Et.inspectSource,At=ue,Dt=n.WeakMap,Mt=At(Dt)&&/native code/.test(String(Dt)),Nt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},Ft=le,Bt=Nt,jt=fe?function(e,t,n){return Ft.f(e,t,Bt(1,n))}:function(e,t,n){return e[t]=n,e},Ut=i.exports,Ht=D,Gt=Ut("keys"),Vt=function(e){return Gt[e]||(Gt[e]=Ht(e))},Wt={},Kt=Mt,zt=n,Yt=pe,Xt=jt,qt=R,$t=u,Jt=Vt,Zt=Wt,Qt="Object already initialized",en=zt.TypeError,tn=zt.WeakMap;if(Kt||$t.state){var nn=$t.state||($t.state=new tn);nn.get=nn.get,nn.has=nn.has,nn.set=nn.set,Rt=function(e,t){if(nn.has(e))throw en(Qt);return t.facade=e,nn.set(e,t),t},Ot=function(e){return nn.get(e)||{}},Lt=function(e){return nn.has(e)}}else{var rn=Jt("state");Zt[rn]=!0,Rt=function(e,t){if(qt(e,rn))throw en(Qt);return t.facade=e,Xt(e,rn,t),t},Ot=function(e){return qt(e,rn)?e[rn]:{}},Lt=function(e){return qt(e,rn)}}var on={set:Rt,get:Ot,has:Lt,enforce:function(e){return Lt(e)?Ot(e):Rt(e,{})},getterFor:function(e){return function(t){var n;if(!Yt(t)||(n=Ot(t)).type!==e)throw en("Incompatible receiver, "+e+" required");return n}}},sn=k,an=d,cn=ue,un=R,ln=fe,fn=St.CONFIGURABLE,hn=It,dn=on.enforce,pn=on.get,gn=String,vn=Object.defineProperty,yn=sn("".slice),mn=sn("".replace),kn=sn([].join),bn=ln&&!an((function(){return 8!==vn((function(){}),"length",{value:8}).length})),wn=String(String).split("String"),Cn=kt.exports=function(e,t,n){"Symbol("===yn(gn(t),0,7)&&(t="["+mn(gn(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!un(e,"name")||fn&&e.name!==t)&&(ln?vn(e,"name",{value:t,configurable:!0}):e.name=t),bn&&n&&un(n,"arity")&&e.length!==n.arity&&vn(e,"length",{value:n.arity});try{n&&un(n,"constructor")&&n.constructor?ln&&vn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var i=dn(e);return un(i,"source")||(i.source=kn(wn,"string"==typeof t?t:"")),e};Function.prototype.toString=Cn((function(){return cn(this)&&pn(this).source||hn(this)}),"toString");var _n=ue,xn=le,Sn=kt.exports,Tn=s,En=function(e,t,n,i){i||(i={});var r=i.enumerable,o=void 0!==i.name?i.name:t;if(_n(n)&&Sn(n,o,i),i.global)r?e[t]=n:Tn(t,n);else{try{i.unsafe?e[t]&&(r=!0):delete e[t]}catch(e){}r?e[t]=n:xn.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e},Pn=k,Rn=Pn({}.toString),On=Pn("".slice),Ln=function(e){return On(Rn(e),8,-1)},In=oe,An=ue,Dn=Ln,Mn=ie("toStringTag"),Nn=Object,Fn="Arguments"==Dn(function(){return arguments}()),Bn=In?Dn: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=Nn(e),Mn))?n:Fn?Dn(t):"Object"==(i=Dn(t))&&An(t.callee)?"Arguments":i},jn=Bn,Un=oe?{}.toString:function(){return"[object "+jn(this)+"]"};oe||En(Object.prototype,"toString",Un,{unsafe:!0});var Hn={},Gn={},Vn={}.propertyIsEnumerable,Wn=Object.getOwnPropertyDescriptor,Kn=Wn&&!Vn.call({1:2},1);Gn.f=Kn?function(e){var t=Wn(this,e);return!!t&&t.enumerable}:Vn;var zn=d,Yn=Ln,Xn=Object,qn=k("".split),$n=zn((function(){return!Xn("z").propertyIsEnumerable(0)}))?function(e){return"String"==Yn(e)?qn(e,""):Xn(e)}:Xn,Jn=$n,Zn=_,Qn=function(e){return Jn(Zn(e))},ei=fe,ti=Pe,ni=Gn,ii=Nt,ri=Qn,oi=at,si=R,ai=be,ci=Object.getOwnPropertyDescriptor;Hn.f=ei?ci:function(e,t){if(e=ri(e),t=oi(t),ai)try{return ci(e,t)}catch(e){}if(si(e,t))return ii(!ti(ni.f,e,t),e[t])};var ui={},li=Math.ceil,fi=Math.floor,hi=Math.trunc||function(e){var t=+e;return(t>0?fi:li)(t)},di=function(e){var t=+e;return t!=t||0===t?0:hi(t)},pi=di,gi=Math.max,vi=Math.min,yi=function(e,t){var n=pi(e);return n<0?gi(n+t,0):vi(n,t)},mi=di,ki=Math.min,bi=function(e){return e>0?ki(mi(e),9007199254740991):0},wi=bi,Ci=function(e){return wi(e.length)},_i=Qn,xi=yi,Si=Ci,Ti=function(e){return function(t,n,i){var r,o=_i(t),s=Si(o),a=xi(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}},Ei={includes:Ti(!0),indexOf:Ti(!1)},Pi=R,Ri=Qn,Oi=Ei.indexOf,Li=Wt,Ii=k([].push),Ai=function(e,t){var n,i=Ri(e),r=0,o=[];for(n in i)!Pi(Li,n)&&Pi(i,n)&&Ii(o,n);for(;t.length>r;)Pi(i,n=t[r++])&&(~Oi(o,n)||Ii(o,n));return o},Di=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mi=Ai,Ni=Di.concat("length","prototype");ui.f=Object.getOwnPropertyNames||function(e){return Mi(e,Ni)};var Fi={};Fi.f=Object.getOwnPropertySymbols;var Bi=Le,ji=ui,Ui=Fi,Hi=Se,Gi=k([].concat),Vi=Bi("Reflect","ownKeys")||function(e){var t=ji.f(Hi(e)),n=Ui.f;return n?Gi(t,n(e)):t},Wi=R,Ki=Vi,zi=Hn,Yi=le,Xi=d,qi=ue,$i=/#|\.prototype\./,Ji=function(e,t){var n=Qi[Zi(e)];return n==tr||n!=er&&(qi(t)?Xi(t):!!t)},Zi=Ji.normalize=function(e){return String(e).replace($i,".").toLowerCase()},Qi=Ji.data={},er=Ji.NATIVE="N",tr=Ji.POLYFILL="P",nr=Ji,ir=n,rr=Hn.f,or=jt,sr=En,ar=s,cr=function(e,t,n){for(var i=Ki(t),r=Yi.f,o=zi.f,s=0;s<i.length;s++){var a=i[s];Wi(e,a)||n&&Wi(n,a)||r(e,a,o(t,a))}},ur=nr,lr=function(e,t){var n,i,r,o,s,a=e.target,c=e.global,u=e.stat;if(n=c?ir:u?ir[a]||ar(a,{}):(ir[a]||{}).prototype)for(i in t){if(o=t[i],r=e.dontCallGetSet?(s=rr(n,i))&&s.value:n[i],!ur(c?i:a+(u?".":"#")+i,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;cr(o,r)}(e.sham||r&&r.sham)&&or(o,"sham",!0),sr(n,i,o,e)}},fr=p,hr=Function.prototype,dr=hr.apply,pr=hr.call,gr="object"==typeof Reflect&&Reflect.apply||(fr?pr.bind(dr):function(){return pr.apply(dr,arguments)}),vr=k([].slice),yr=k,mr=Ve,kr=pe,br=R,wr=vr,Cr=p,_r=Function,xr=yr([].concat),Sr=yr([].join),Tr={},Er=Cr?_r.bind:function(e){var t=mr(this),n=t.prototype,i=wr(arguments,1),r=function(){var n=xr(i,wr(arguments));return this instanceof r?function(e,t,n){if(!br(Tr,t)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";Tr[t]=_r("C,a","return new C("+Sr(i,",")+")")}return Tr[t](e,n)}(t,n.length,n):t.apply(e,n)};return kr(n)&&(r.prototype=n),r},Pr=k,Rr=d,Or=ue,Lr=Bn,Ir=It,Ar=function(){},Dr=[],Mr=Le("Reflect","construct"),Nr=/^\s*(?:class|function)\b/,Fr=Pr(Nr.exec),Br=!Nr.exec(Ar),jr=function(e){if(!Or(e))return!1;try{return Mr(Ar,Dr,e),!0}catch(e){return!1}},Ur=function(e){if(!Or(e))return!1;switch(Lr(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Br||!!Fr(Nr,Ir(e))}catch(e){return!0}};Ur.sham=!0;var Hr=!Mr||Rr((function(){var e;return jr(jr.call)||!jr(Object)||!jr((function(){e=!0}))||e}))?Ur:jr,Gr=Hr,Vr=je,Wr=TypeError,Kr=function(e){if(Gr(e))return e;throw Wr(Vr(e)+" is not a constructor")},zr={},Yr=Ai,Xr=Di,qr=Object.keys||function(e){return Yr(e,Xr)},$r=fe,Jr=we,Zr=le,Qr=Se,eo=Qn,to=qr;zr.f=$r&&!Jr?Object.defineProperties:function(e,t){Qr(e);for(var n,i=eo(t),r=to(t),o=r.length,s=0;o>s;)Zr.f(e,n=r[s++],i[n]);return e};var no,io=Le("document","documentElement"),ro=Se,oo=zr,so=Di,ao=Wt,co=io,uo=me,lo="prototype",fo="script",ho=Vt("IE_PROTO"),po=function(){},go=function(e){return"<"+fo+">"+e+"</"+fo+">"},vo=function(e){e.write(go("")),e.close();var t=e.parentWindow.Object;return e=null,t},yo=function(){try{no=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;yo="undefined"!=typeof document?document.domain&&no?vo(no):(t=uo("iframe"),n="java"+fo+":",t.style.display="none",co.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(go("document.F=Object")),e.close(),e.F):vo(no);for(var i=so.length;i--;)delete yo[lo][so[i]];return yo()};ao[ho]=!0;var mo=Object.create||function(e,t){var n;return null!==e?(po[lo]=ro(e),n=new po,po[lo]=null,n[ho]=e):n=yo(),void 0===t?n:oo.f(n,t)},ko=lr,bo=gr,wo=Er,Co=Kr,_o=Se,xo=pe,So=mo,To=d,Eo=Le("Reflect","construct"),Po=Object.prototype,Ro=[].push,Oo=To((function(){function e(){}return!(Eo((function(){}),[],e)instanceof e)})),Lo=!To((function(){Eo((function(){}))})),Io=Oo||Lo;function Ao(e){return Ao="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},Ao(e)}function Do(e){var t=function(e,t){if("object"!==Ao(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==Ao(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ao(t)?t:String(t)}function Mo(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,Do(i.key),i)}}function No(e,t,n){return t&&Mo(e.prototype,t),n&&Mo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bo(e,t){return Bo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bo(e,t)}function jo(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bo(e,t)}function Uo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ho(e,t){if(t&&("object"===Ao(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Uo(e)}function Go(e){return Go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Go(e)}function Vo(e,t,n){return(t=Do(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}ko({target:"Reflect",stat:!0,forced:Io,sham:Io},{construct:function(e,t){Co(e),_o(t);var n=arguments.length<3?e:Co(arguments[2]);if(Lo&&!Oo)return Eo(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 bo(Ro,i,t),new(bo(wo,e,i))}var r=n.prototype,o=So(xo(r)?r:Po),s=bo(e,o,t);return xo(s)?s:o}});var Wo=Bn,Ko=String,zo=function(e){if("Symbol"===Wo(e))throw TypeError("Cannot convert a Symbol value to a string");return Ko(e)},Yo={},Xo=at,qo=le,$o=Nt,Jo=function(e,t,n){var i=Xo(t);i in e?qo.f(e,i,$o(0,n)):e[i]=n},Zo=yi,Qo=Ci,es=Jo,ts=Array,ns=Math.max,is=function(e,t,n){for(var i=Qo(e),r=Zo(t,i),o=Zo(void 0===n?i:n,i),s=ts(ns(o-r,0)),a=0;r<o;r++,a++)es(s,a,e[r]);return s.length=a,s},rs=Ln,os=Qn,ss=ui.f,as=is,cs="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];Yo.f=function(e){return cs&&"Window"==rs(e)?function(e){try{return ss(e)}catch(e){return as(cs)}}(e):ss(os(e))};var us=kt.exports,ls=le,fs=function(e,t,n){return n.get&&us(n.get,t,{getter:!0}),n.set&&us(n.set,t,{setter:!0}),ls.f(e,t,n)},hs={},ds=ie;hs.f=ds;var ps=n,gs=ps,vs=R,ys=hs,ms=le.f,ks=Pe,bs=Le,ws=ie,Cs=En,_s=le.f,xs=R,Ss=ie("toStringTag"),Ts=function(e,t,n){e&&!n&&(e=e.prototype),e&&!xs(e,Ss)&&_s(e,Ss,{configurable:!0,value:t})},Es=Ln,Ps=k,Rs=function(e){if("Function"===Es(e))return Ps(e)},Os=Ve,Ls=p,Is=Rs(Rs.bind),As=function(e,t){return Os(e),void 0===t?e:Ls?Is(e,t):function(){return e.apply(t,arguments)}},Ds=Ln,Ms=Array.isArray||function(e){return"Array"==Ds(e)},Ns=Ms,Fs=Hr,Bs=pe,js=ie("species"),Us=Array,Hs=function(e){var t;return Ns(e)&&(t=e.constructor,(Fs(t)&&(t===Us||Ns(t.prototype))||Bs(t)&&null===(t=t[js]))&&(t=void 0)),void 0===t?Us:t},Gs=function(e,t){return new(Hs(e))(0===t?0:t)},Vs=As,Ws=$n,Ks=T,zs=Ci,Ys=Gs,Xs=k([].push),qs=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,u,l,f){for(var h,d,p=Ks(c),g=Ws(p),v=Vs(u,l),y=zs(g),m=0,k=f||Ys,b=t?k(c,y):n||s?k(c,0):void 0;y>m;m++)if((a||m in g)&&(d=v(h=g[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return m;case 2:Xs(b,h)}else switch(e){case 4:return!1;case 7:Xs(b,h)}return o?-1:i||r?r:b}},$s={forEach:qs(0),map:qs(1),filter:qs(2),some:qs(3),every:qs(4),find:qs(5),findIndex:qs(6),filterReject:qs(7)},Js=lr,Zs=n,Qs=Pe,ea=k,ta=fe,na=z,ia=d,ra=R,oa=Ie,sa=Se,aa=Qn,ca=at,ua=zo,la=Nt,fa=mo,ha=qr,da=ui,pa=Yo,ga=Fi,va=Hn,ya=le,ma=zr,ka=Gn,ba=En,wa=fs,Ca=i.exports,_a=Wt,xa=D,Sa=ie,Ta=hs,Ea=function(e){var t=gs.Symbol||(gs.Symbol={});vs(t,e)||ms(t,e,{value:ys.f(e)})},Pa=function(){var e=bs("Symbol"),t=e&&e.prototype,n=t&&t.valueOf,i=ws("toPrimitive");t&&!t[i]&&Cs(t,i,(function(e){return ks(n,this)}),{arity:1})},Ra=Ts,Oa=on,La=$s.forEach,Ia=Vt("hidden"),Aa="Symbol",Da="prototype",Ma=Oa.set,Na=Oa.getterFor(Aa),Fa=Object[Da],Ba=Zs.Symbol,ja=Ba&&Ba[Da],Ua=Zs.TypeError,Ha=Zs.QObject,Ga=va.f,Va=ya.f,Wa=pa.f,Ka=ka.f,za=ea([].push),Ya=Ca("symbols"),Xa=Ca("op-symbols"),qa=Ca("wks"),$a=!Ha||!Ha[Da]||!Ha[Da].findChild,Ja=ta&&ia((function(){return 7!=fa(Va({},"a",{get:function(){return Va(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=Ga(Fa,t);i&&delete Fa[t],Va(e,t,n),i&&e!==Fa&&Va(Fa,t,i)}:Va,Za=function(e,t){var n=Ya[e]=fa(ja);return Ma(n,{type:Aa,tag:e,description:t}),ta||(n.description=t),n},Qa=function(e,t,n){e===Fa&&Qa(Xa,t,n),sa(e);var i=ca(t);return sa(n),ra(Ya,i)?(n.enumerable?(ra(e,Ia)&&e[Ia][i]&&(e[Ia][i]=!1),n=fa(n,{enumerable:la(0,!1)})):(ra(e,Ia)||Va(e,Ia,la(1,{})),e[Ia][i]=!0),Ja(e,i,n)):Va(e,i,n)},ec=function(e,t){sa(e);var n=aa(t),i=ha(n).concat(rc(n));return La(i,(function(t){ta&&!Qs(tc,n,t)||Qa(e,t,n[t])})),e},tc=function(e){var t=ca(e),n=Qs(Ka,this,t);return!(this===Fa&&ra(Ya,t)&&!ra(Xa,t))&&(!(n||!ra(this,t)||!ra(Ya,t)||ra(this,Ia)&&this[Ia][t])||n)},nc=function(e,t){var n=aa(e),i=ca(t);if(n!==Fa||!ra(Ya,i)||ra(Xa,i)){var r=Ga(n,i);return!r||!ra(Ya,i)||ra(n,Ia)&&n[Ia][i]||(r.enumerable=!0),r}},ic=function(e){var t=Wa(aa(e)),n=[];return La(t,(function(e){ra(Ya,e)||ra(_a,e)||za(n,e)})),n},rc=function(e){var t=e===Fa,n=Wa(t?Xa:aa(e)),i=[];return La(n,(function(e){!ra(Ya,e)||t&&!ra(Fa,e)||za(i,Ya[e])})),i};na||(Ba=function(){if(oa(ja,this))throw Ua("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?ua(arguments[0]):void 0,t=xa(e),n=function(e){this===Fa&&Qs(n,Xa,e),ra(this,Ia)&&ra(this[Ia],t)&&(this[Ia][t]=!1),Ja(this,t,la(1,e))};return ta&&$a&&Ja(Fa,t,{configurable:!0,set:n}),Za(t,e)},ba(ja=Ba[Da],"toString",(function(){return Na(this).tag})),ba(Ba,"withoutSetter",(function(e){return Za(xa(e),e)})),ka.f=tc,ya.f=Qa,ma.f=ec,va.f=nc,da.f=pa.f=ic,ga.f=rc,Ta.f=function(e){return Za(Sa(e),e)},ta&&(wa(ja,"description",{configurable:!0,get:function(){return Na(this).description}}),ba(Fa,"propertyIsEnumerable",tc,{unsafe:!0}))),Js({global:!0,constructor:!0,wrap:!0,forced:!na,sham:!na},{Symbol:Ba}),La(ha(qa),(function(e){Ea(e)})),Js({target:Aa,stat:!0,forced:!na},{useSetter:function(){$a=!0},useSimple:function(){$a=!1}}),Js({target:"Object",stat:!0,forced:!na,sham:!ta},{create:function(e,t){return void 0===t?fa(e):ec(fa(e),t)},defineProperty:Qa,defineProperties:ec,getOwnPropertyDescriptor:nc}),Js({target:"Object",stat:!0,forced:!na},{getOwnPropertyNames:ic}),Pa(),Ra(Ba,Aa),_a[Ia]=!0;var oc=z&&!!Symbol.for&&!!Symbol.keyFor,sc=lr,ac=Le,cc=R,uc=zo,lc=i.exports,fc=oc,hc=lc("string-to-symbol-registry"),dc=lc("symbol-to-string-registry");sc({target:"Symbol",stat:!0,forced:!fc},{for:function(e){var t=uc(e);if(cc(hc,t))return hc[t];var n=ac("Symbol")(t);return hc[t]=n,dc[n]=t,n}});var pc=lr,gc=R,vc=Fe,yc=je,mc=oc,kc=(0,i.exports)("symbol-to-string-registry");pc({target:"Symbol",stat:!0,forced:!mc},{keyFor:function(e){if(!vc(e))throw TypeError(yc(e)+" is not a symbol");if(gc(kc,e))return kc[e]}});var bc=Ms,wc=ue,Cc=Ln,_c=zo,xc=k([].push),Sc=lr,Tc=Le,Ec=gr,Pc=Pe,Rc=k,Oc=d,Lc=ue,Ic=Fe,Ac=vr,Dc=function(e){if(wc(e))return e;if(bc(e)){for(var t=e.length,n=[],i=0;i<t;i++){var r=e[i];"string"==typeof r?xc(n,r):"number"!=typeof r&&"Number"!=Cc(r)&&"String"!=Cc(r)||xc(n,_c(r))}var o=n.length,s=!0;return function(e,t){if(s)return s=!1,t;if(bc(this))return t;for(var i=0;i<o;i++)if(n[i]===e)return t}}},Mc=z,Nc=String,Fc=Tc("JSON","stringify"),Bc=Rc(/./.exec),jc=Rc("".charAt),Uc=Rc("".charCodeAt),Hc=Rc("".replace),Gc=Rc(1..toString),Vc=/[\uD800-\uDFFF]/g,Wc=/^[\uD800-\uDBFF]$/,Kc=/^[\uDC00-\uDFFF]$/,zc=!Mc||Oc((function(){var e=Tc("Symbol")();return"[null]"!=Fc([e])||"{}"!=Fc({a:e})||"{}"!=Fc(Object(e))})),Yc=Oc((function(){return'"\\udf06\\ud834"'!==Fc("\udf06\ud834")||'"\\udead"'!==Fc("\udead")})),Xc=function(e,t){var n=Ac(arguments),i=Dc(t);if(Lc(i)||void 0!==e&&!Ic(e))return n[1]=function(e,t){if(Lc(i)&&(t=Pc(i,this,Nc(e),t)),!Ic(t))return t},Ec(Fc,null,n)},qc=function(e,t,n){var i=jc(n,t-1),r=jc(n,t+1);return Bc(Wc,e)&&!Bc(Kc,r)||Bc(Kc,e)&&!Bc(Wc,i)?"\\u"+Gc(Uc(e,0),16):e};Fc&&Sc({target:"JSON",stat:!0,arity:3,forced:zc||Yc},{stringify:function(e,t,n){var i=Ac(arguments),r=Ec(zc?Xc:Fc,null,i);return Yc&&"string"==typeof r?Hc(r,Vc,qc):r}});var $c=Fi,Jc=T;lr({target:"Object",stat:!0,forced:!z||d((function(){$c.f(1)}))},{getOwnPropertySymbols:function(e){var t=$c.f;return t?t(Jc(e)):[]}});var Zc=lr,Qc=d,eu=Qn,tu=Hn.f,nu=fe;Zc({target:"Object",stat:!0,forced:!nu||Qc((function(){tu(1)})),sham:!nu},{getOwnPropertyDescriptor:function(e,t){return tu(eu(e),t)}});var iu=Vi,ru=Qn,ou=Hn,su=Jo;function au(){return au="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Go(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},au.apply(this,arguments)}lr({target:"Object",stat:!0,sham:!fe},{getOwnPropertyDescriptors:function(e){for(var t,n,i=ru(e),r=ou.f,o=iu(i),s={},a=0;o.length>a;)void 0!==(n=r(i,t=o[a++]))&&su(s,t,n);return s}});var cu=TypeError,uu=function(e){if(e>9007199254740991)throw cu("Maximum allowed index exceeded");return e},lu=d,fu=G,hu=ie("species"),du=function(e){return fu>=51||!lu((function(){var t=[];return(t.constructor={})[hu]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},pu=lr,gu=d,vu=Ms,yu=pe,mu=T,ku=Ci,bu=uu,wu=Jo,Cu=Gs,_u=du,xu=G,Su=ie("isConcatSpreadable"),Tu=xu>=51||!gu((function(){var e=[];return e[Su]=!1,e.concat()[0]!==e})),Eu=function(e){if(!yu(e))return!1;var t=e[Su];return void 0!==t?!!t:vu(e)};pu({target:"Array",proto:!0,arity:1,forced:!Tu||!_u("concat")},{concat:function(e){var t,n,i,r,o,s=mu(this),a=Cu(s,0),c=0;for(t=-1,i=arguments.length;t<i;t++)if(Eu(o=-1===t?s:arguments[t]))for(r=ku(o),bu(c+r),n=0;n<r;n++,c++)n in o&&wu(a,c,o[n]);else bu(c+1),wu(a,c++,o);return a.length=c,a}});var Pu=$s.map;lr({target:"Array",proto:!0,forced:!du("map")},{map:function(e){return Pu(this,e,arguments.length>1?arguments[1]:void 0)}});var Ru=T,Ou=qr;lr({target:"Object",stat:!0,forced:d((function(){Ou(1)}))},{keys:function(e){return Ou(Ru(e))}});var Lu=lr,Iu=Ms,Au=Hr,Du=pe,Mu=yi,Nu=Ci,Fu=Qn,Bu=Jo,ju=ie,Uu=vr,Hu=du("slice"),Gu=ju("species"),Vu=Array,Wu=Math.max;Lu({target:"Array",proto:!0,forced:!Hu},{slice:function(e,t){var n,i,r,o=Fu(this),s=Nu(o),a=Mu(e,s),c=Mu(void 0===t?s:t,s);if(Iu(o)&&(n=o.constructor,(Au(n)&&(n===Vu||Iu(n.prototype))||Du(n)&&null===(n=n[Gu]))&&(n=void 0),n===Vu||void 0===n))return Uu(o,a,c);for(i=new(void 0===n?Vu:n)(Wu(c-a,0)),r=0;a<c;a++,r++)a in o&&Bu(i,r,o[a]);return i.length=r,i}});var Ku={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},zu=me("span").classList,Yu=zu&&zu.constructor&&zu.constructor.prototype,Xu=Yu===Object.prototype?void 0:Yu,qu=d,$u=function(e,t){var n=[][e];return!!n&&qu((function(){n.call(null,t||function(){return 1},1)}))},Ju=$s.forEach,Zu=$u("forEach")?[].forEach:function(e){return Ju(this,e,arguments.length>1?arguments[1]:void 0)},Qu=n,el=Ku,tl=Xu,nl=Zu,il=jt,rl=function(e){if(e&&e.forEach!==nl)try{il(e,"forEach",nl)}catch(t){e.forEach=nl}};for(var ol in el)el[ol]&&rl(Qu[ol]&&Qu[ol].prototype);rl(tl);var sl=Se,al=function(){var e=sl(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},cl=d,ul=n.RegExp,ll=cl((function(){var e=ul("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),fl=ll||cl((function(){return!ul("a","y").sticky})),hl={BROKEN_CARET:ll||cl((function(){var e=ul("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:fl,UNSUPPORTED_Y:ll},dl=d,pl=n.RegExp,gl=dl((function(){var e=pl(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),vl=d,yl=n.RegExp,ml=vl((function(){var e=yl("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),kl=Pe,bl=k,wl=zo,Cl=al,_l=hl,xl=i.exports,Sl=mo,Tl=on.get,El=gl,Pl=ml,Rl=xl("native-string-replace",String.prototype.replace),Ol=RegExp.prototype.exec,Ll=Ol,Il=bl("".charAt),Al=bl("".indexOf),Dl=bl("".replace),Ml=bl("".slice),Nl=function(){var e=/a/,t=/b*/g;return kl(Ol,e,"a"),kl(Ol,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Fl=_l.BROKEN_CARET,Bl=void 0!==/()??/.exec("")[1];(Nl||Bl||Fl||El||Pl)&&(Ll=function(e){var t,n,i,r,o,s,a,c=this,u=Tl(c),l=wl(e),f=u.raw;if(f)return f.lastIndex=c.lastIndex,t=kl(Ll,f,l),c.lastIndex=f.lastIndex,t;var h=u.groups,d=Fl&&c.sticky,p=kl(Cl,c),g=c.source,v=0,y=l;if(d&&(p=Dl(p,"y",""),-1===Al(p,"g")&&(p+="g"),y=Ml(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Il(l,c.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,v++),n=new RegExp("^(?:"+g+")",p)),Bl&&(n=new RegExp("^"+g+"$(?!\\s)",p)),Nl&&(i=c.lastIndex),r=kl(Ol,d?n:c,y),d?r?(r.input=Ml(r.input,v),r[0]=Ml(r[0],v),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:Nl&&r&&(c.lastIndex=c.global?r.index+r[0].length:i),Bl&&r&&r.length>1&&kl(Rl,r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&h)for(r.groups=s=Sl(null),o=0;o<h.length;o++)s[(a=h[o])[0]]=r[a[1]];return r});var jl=Ll;lr({target:"RegExp",proto:!0,forced:/./.exec!==jl},{exec:jl});var Ul=lr,Hl=$n,Gl=Qn,Vl=$u,Wl=k([].join);Ul({target:"Array",proto:!0,forced:Hl!=Object||!Vl("join",",")},{join:function(e){return Wl(Gl(this),void 0===e?",":e)}});var Kl=fe,zl=Ms,Yl=TypeError,Xl=Object.getOwnPropertyDescriptor,ql=Kl&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),$l=je,Jl=TypeError,Zl=function(e,t){if(!delete e[t])throw Jl("Cannot delete property "+$l(t)+" of "+$l(e))},Ql=lr,ef=T,tf=yi,nf=di,rf=Ci,of=ql?function(e,t){if(zl(e)&&!Xl(e,"length").writable)throw Yl("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},sf=uu,af=Gs,cf=Jo,uf=Zl,lf=du("splice"),ff=Math.max,hf=Math.min;Ql({target:"Array",proto:!0,forced:!lf},{splice:function(e,t){var n,i,r,o,s,a,c=ef(this),u=rf(c),l=tf(e,u),f=arguments.length;for(0===f?n=i=0:1===f?(n=0,i=u-l):(n=f-2,i=hf(ff(nf(t),0),u-l)),sf(u+n-i),r=af(c,i),o=0;o<i;o++)(s=l+o)in c&&cf(r,o,c[s]);if(r.length=i,n<i){for(o=l;o<u-i;o++)a=o+n,(s=o+i)in c?c[a]=c[s]:uf(c,a);for(o=u;o>u-i+n;o--)uf(c,o-1)}else if(n>i)for(o=u-i;o>l;o--)a=o+n-1,(s=o+i-1)in c?c[a]=c[s]:uf(c,a);for(o=0;o<n;o++)c[o+l]=arguments[o+2];return of(c,u-i+n),r}});var df,pf,gf,vf,yf="undefined"!=typeof process&&"process"==Ln(process),mf=k,kf=Ve,bf=ue,wf=String,Cf=TypeError,_f=function(e,t,n){try{return mf(kf(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}},xf=Se,Sf=function(e){if("object"==typeof e||bf(e))return e;throw Cf("Can't set "+wf(e)+" as a prototype")},Tf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=_f(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return xf(n),Sf(i),t?e(n,i):n.__proto__=i,n}}():void 0),Ef=Le,Pf=fs,Rf=fe,Of=ie("species"),Lf=function(e){var t=Ef(e);Rf&&t&&!t[Of]&&Pf(t,Of,{configurable:!0,get:function(){return this}})},If=Ie,Af=TypeError,Df=function(e,t){if(If(t,e))return e;throw Af("Incorrect invocation")},Mf=Se,Nf=Kr,Ff=b,Bf=ie("species"),jf=function(e,t){var n,i=Mf(e).constructor;return void 0===i||Ff(n=Mf(i)[Bf])?t:Nf(n)},Uf=TypeError,Hf=function(e,t){if(e<t)throw Uf("Not enough arguments");return e},Gf=/(?:ipad|iphone|ipod).*applewebkit/i.test(M),Vf=n,Wf=gr,Kf=As,zf=ue,Yf=R,Xf=d,qf=io,$f=vr,Jf=me,Zf=Hf,Qf=Gf,eh=yf,th=Vf.setImmediate,nh=Vf.clearImmediate,ih=Vf.process,rh=Vf.Dispatch,oh=Vf.Function,sh=Vf.MessageChannel,ah=Vf.String,ch=0,uh={},lh="onreadystatechange";Xf((function(){df=Vf.location}));var fh=function(e){if(Yf(uh,e)){var t=uh[e];delete uh[e],t()}},hh=function(e){return function(){fh(e)}},dh=function(e){fh(e.data)},ph=function(e){Vf.postMessage(ah(e),df.protocol+"//"+df.host)};th&&nh||(th=function(e){Zf(arguments.length,1);var t=zf(e)?e:oh(e),n=$f(arguments,1);return uh[++ch]=function(){Wf(t,void 0,n)},pf(ch),ch},nh=function(e){delete uh[e]},eh?pf=function(e){ih.nextTick(hh(e))}:rh&&rh.now?pf=function(e){rh.now(hh(e))}:sh&&!Qf?(vf=(gf=new sh).port2,gf.port1.onmessage=dh,pf=Kf(vf.postMessage,vf)):Vf.addEventListener&&zf(Vf.postMessage)&&!Vf.importScripts&&df&&"file:"!==df.protocol&&!Xf(ph)?(pf=ph,Vf.addEventListener("message",dh,!1)):pf=lh in Jf("script")?function(e){qf.appendChild(Jf("script"))[lh]=function(){qf.removeChild(this),fh(e)}}:function(e){setTimeout(hh(e),0)});var gh={set:th,clear:nh},vh=function(){this.head=null,this.tail=null};vh.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var yh,mh,kh,bh,wh,Ch=vh,_h=/ipad|iphone|ipod/i.test(M)&&"undefined"!=typeof Pebble,xh=/web0s(?!.*chrome)/i.test(M),Sh=n,Th=As,Eh=Hn.f,Ph=gh.set,Rh=Ch,Oh=Gf,Lh=_h,Ih=xh,Ah=yf,Dh=Sh.MutationObserver||Sh.WebKitMutationObserver,Mh=Sh.document,Nh=Sh.process,Fh=Sh.Promise,Bh=Eh(Sh,"queueMicrotask"),jh=Bh&&Bh.value;if(!jh){var Uh=new Rh,Hh=function(){var e,t;for(Ah&&(e=Nh.domain)&&e.exit();t=Uh.get();)try{t()}catch(e){throw Uh.head&&yh(),e}e&&e.enter()};Oh||Ah||Ih||!Dh||!Mh?!Lh&&Fh&&Fh.resolve?((bh=Fh.resolve(void 0)).constructor=Fh,wh=Th(bh.then,bh),yh=function(){wh(Hh)}):Ah?yh=function(){Nh.nextTick(Hh)}:(Ph=Th(Ph,Sh),yh=function(){Ph(Hh)}):(mh=!0,kh=Mh.createTextNode(""),new Dh(Hh).observe(kh,{characterData:!0}),yh=function(){kh.data=mh=!mh}),jh=function(e){Uh.head||yh(),Uh.add(e)}}var Gh=jh,Vh=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Wh=n.Promise,Kh="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,zh=!Kh&&!yf&&"object"==typeof window&&"object"==typeof document,Yh=n,Xh=Wh,qh=ue,$h=nr,Jh=It,Zh=ie,Qh=zh,ed=Kh,td=G;Xh&&Xh.prototype;var nd=Zh("species"),id=!1,rd=qh(Yh.PromiseRejectionEvent),od=$h("Promise",(function(){var e=Jh(Xh),t=e!==String(Xh);if(!t&&66===td)return!0;if(!td||td<51||!/native code/.test(e)){var n=new Xh((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};if((n.constructor={})[nd]=i,!(id=n.then((function(){}))instanceof i))return!0}return!t&&(Qh||ed)&&!rd})),sd={CONSTRUCTOR:od,REJECTION_EVENT:rd,SUBCLASSING:id},ad={},cd=Ve,ud=TypeError,ld=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw ud("Bad Promise constructor");t=e,n=i})),this.resolve=cd(t),this.reject=cd(n)};ad.f=function(e){return new ld(e)};var fd,hd,dd,pd=lr,gd=yf,vd=n,yd=Pe,md=En,kd=Tf,bd=Ts,wd=Lf,Cd=Ve,_d=ue,xd=pe,Sd=Df,Td=jf,Ed=gh.set,Pd=Gh,Rd=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},Od=Vh,Ld=Ch,Id=on,Ad=Wh,Dd=ad,Md="Promise",Nd=sd.CONSTRUCTOR,Fd=sd.REJECTION_EVENT,Bd=sd.SUBCLASSING,jd=Id.getterFor(Md),Ud=Id.set,Hd=Ad&&Ad.prototype,Gd=Ad,Vd=Hd,Wd=vd.TypeError,Kd=vd.document,zd=vd.process,Yd=Dd.f,Xd=Yd,qd=!!(Kd&&Kd.createEvent&&vd.dispatchEvent),$d="unhandledrejection",Jd=function(e){var t;return!(!xd(e)||!_d(t=e.then))&&t},Zd=function(e,t){var n,i,r,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{a?(s||(2===t.rejection&&ip(t),t.rejection=1),!0===a?n=o:(l&&l.enter(),n=a(o),l&&(l.exit(),r=!0)),n===e.promise?u(Wd("Promise-chain cycle")):(i=Jd(n))?yd(i,n,c,u):c(n)):u(o)}catch(e){l&&!r&&l.exit(),u(e)}},Qd=function(e,t){e.notified||(e.notified=!0,Pd((function(){for(var n,i=e.reactions;n=i.get();)Zd(n,e);e.notified=!1,t&&!e.rejection&&tp(e)})))},ep=function(e,t,n){var i,r;qd?((i=Kd.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),vd.dispatchEvent(i)):i={promise:t,reason:n},!Fd&&(r=vd["on"+e])?r(i):e===$d&&Rd("Unhandled promise rejection",n)},tp=function(e){yd(Ed,vd,(function(){var t,n=e.facade,i=e.value;if(np(e)&&(t=Od((function(){gd?zd.emit("unhandledRejection",i,n):ep($d,n,i)})),e.rejection=gd||np(e)?2:1,t.error))throw t.value}))},np=function(e){return 1!==e.rejection&&!e.parent},ip=function(e){yd(Ed,vd,(function(){var t=e.facade;gd?zd.emit("rejectionHandled",t):ep("rejectionhandled",t,e.value)}))},rp=function(e,t,n){return function(i){e(t,i,n)}},op=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Qd(e,!0))},sp=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Wd("Promise can't be resolved itself");var i=Jd(t);i?Pd((function(){var n={done:!1};try{yd(i,t,rp(sp,n,e),rp(op,n,e))}catch(t){op(n,t,e)}})):(e.value=t,e.state=1,Qd(e,!1))}catch(t){op({done:!1},t,e)}}};if(Nd&&(Vd=(Gd=function(e){Sd(this,Vd),Cd(e),yd(fd,this);var t=jd(this);try{e(rp(sp,t),rp(op,t))}catch(e){op(t,e)}}).prototype,(fd=function(e){Ud(this,{type:Md,done:!1,notified:!1,parent:!1,reactions:new Ld,rejection:!1,state:0,value:void 0})}).prototype=md(Vd,"then",(function(e,t){var n=jd(this),i=Yd(Td(this,Gd));return n.parent=!0,i.ok=!_d(e)||e,i.fail=_d(t)&&t,i.domain=gd?zd.domain:void 0,0==n.state?n.reactions.add(i):Pd((function(){Zd(i,n)})),i.promise})),hd=function(){var e=new fd,t=jd(e);this.promise=e,this.resolve=rp(sp,t),this.reject=rp(op,t)},Dd.f=Yd=function(e){return e===Gd||undefined===e?new hd(e):Xd(e)},_d(Ad)&&Hd!==Object.prototype)){dd=Hd.then,Bd||md(Hd,"then",(function(e,t){var n=this;return new Gd((function(e,t){yd(dd,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete Hd.constructor}catch(e){}kd&&kd(Hd,Vd)}pd({global:!0,constructor:!0,wrap:!0,forced:Nd},{Promise:Gd}),bd(Gd,Md,!1),wd(Md);var ap={},cp=ap,up=ie("iterator"),lp=Array.prototype,fp=function(e){return void 0!==e&&(cp.Array===e||lp[up]===e)},hp=Bn,dp=ze,pp=b,gp=ap,vp=ie("iterator"),yp=function(e){if(!pp(e))return dp(e,vp)||dp(e,"@@iterator")||gp[hp(e)]},mp=Pe,kp=Ve,bp=Se,wp=je,Cp=yp,_p=TypeError,xp=function(e,t){var n=arguments.length<2?Cp(e):t;if(kp(n))return bp(mp(n,e));throw _p(wp(e)+" is not iterable")},Sp=Pe,Tp=Se,Ep=ze,Pp=function(e,t,n){var i,r;Tp(e);try{if(!(i=Ep(e,"return"))){if("throw"===t)throw n;return n}i=Sp(i,e)}catch(e){r=!0,i=e}if("throw"===t)throw n;if(r)throw i;return Tp(i),n},Rp=As,Op=Pe,Lp=Se,Ip=je,Ap=fp,Dp=Ci,Mp=Ie,Np=xp,Fp=yp,Bp=Pp,jp=TypeError,Up=function(e,t){this.stopped=e,this.result=t},Hp=Up.prototype,Gp=function(e,t,n){var i,r,o,s,a,c,u,l=n&&n.that,f=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),d=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),g=Rp(t,l),v=function(e){return i&&Bp(i,"normal",e),new Up(!0,e)},y=function(e){return f?(Lp(e),p?g(e[0],e[1],v):g(e[0],e[1])):p?g(e,v):g(e)};if(h)i=e.iterator;else if(d)i=e;else{if(!(r=Fp(e)))throw jp(Ip(e)+" is not iterable");if(Ap(r)){for(o=0,s=Dp(e);s>o;o++)if((a=y(e[o]))&&Mp(Hp,a))return a;return new Up(!1)}i=Np(e,r)}for(c=h?e.next:i.next;!(u=Op(c,i)).done;){try{a=y(u.value)}catch(e){Bp(i,"throw",e)}if("object"==typeof a&&a&&Mp(Hp,a))return a}return new Up(!1)},Vp=ie("iterator"),Wp=!1;try{var Kp=0,zp={next:function(){return{done:!!Kp++}},return:function(){Wp=!0}};zp[Vp]=function(){return this},Array.from(zp,(function(){throw 2}))}catch(e){}var Yp=Wh,Xp=function(e,t){if(!t&&!Wp)return!1;var n=!1;try{var i={};i[Vp]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n},qp=sd.CONSTRUCTOR||!Xp((function(e){Yp.all(e).then(void 0,(function(){}))})),$p=Pe,Jp=Ve,Zp=ad,Qp=Vh,eg=Gp;lr({target:"Promise",stat:!0,forced:qp},{all:function(e){var t=this,n=Zp.f(t),i=n.resolve,r=n.reject,o=Qp((function(){var n=Jp(t.resolve),o=[],s=0,a=1;eg(e,(function(e){var c=s++,u=!1;a++,$p(n,t,e).then((function(e){u||(u=!0,o[c]=e,--a||i(o))}),r)})),--a||i(o)}));return o.error&&r(o.value),n.promise}});var tg=lr,ng=sd.CONSTRUCTOR,ig=Wh,rg=Le,og=ue,sg=En,ag=ig&&ig.prototype;if(tg({target:"Promise",proto:!0,forced:ng,real:!0},{catch:function(e){return this.then(void 0,e)}}),og(ig)){var cg=rg("Promise").prototype.catch;ag.catch!==cg&&sg(ag,"catch",cg,{unsafe:!0})}var ug=Pe,lg=Ve,fg=ad,hg=Vh,dg=Gp;lr({target:"Promise",stat:!0,forced:qp},{race:function(e){var t=this,n=fg.f(t),i=n.reject,r=hg((function(){var r=lg(t.resolve);dg(e,(function(e){ug(r,t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var pg=Pe,gg=ad;lr({target:"Promise",stat:!0,forced:sd.CONSTRUCTOR},{reject:function(e){var t=gg.f(this);return pg(t.reject,void 0,e),t.promise}});var vg=Se,yg=pe,mg=ad,kg=lr,bg=sd.CONSTRUCTOR,wg=function(e,t){if(vg(e),yg(t)&&t.constructor===e)return t;var n=mg.f(e);return(0,n.resolve)(t),n.promise};Le("Promise"),kg({target:"Promise",stat:!0,forced:bg},{resolve:function(e){return wg(this,e)}});var Cg=fe,_g=St.EXISTS,xg=k,Sg=fs,Tg=Function.prototype,Eg=xg(Tg.toString),Pg=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Rg=xg(Pg.exec);Cg&&!_g&&Sg(Tg,"name",{configurable:!0,get:function(){try{return Rg(Pg,Eg(this))[1]}catch(e){return""}}}),lr({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Og=ue,Lg=pe,Ig=Tf,Ag=function(e,t,n){var i,r;return Ig&&Og(i=t.constructor)&&i!==n&&Lg(r=i.prototype)&&r!==n.prototype&&Ig(e,r),e},Dg=k(1..valueOf),Mg="\t\n\v\f\r                 \u2028\u2029\ufeff",Ng=_,Fg=zo,Bg=Mg,jg=k("".replace),Ug=RegExp("^["+Bg+"]+"),Hg=RegExp("(^|[^"+Bg+"])["+Bg+"]+$"),Gg=function(e){return function(t){var n=Fg(Ng(t));return 1&e&&(n=jg(n,Ug,"")),2&e&&(n=jg(n,Hg,"$1")),n}},Vg={start:Gg(1),end:Gg(2),trim:Gg(3)},Wg=lr,Kg=fe,zg=n,Yg=ps,Xg=k,qg=nr,$g=R,Jg=Ag,Zg=Ie,Qg=Fe,ev=rt,tv=d,nv=ui.f,iv=Hn.f,rv=le.f,ov=Dg,sv=Vg.trim,av="Number",cv=zg[av];Yg[av];var uv=cv.prototype,lv=zg.TypeError,fv=Xg("".slice),hv=Xg("".charCodeAt),dv=function(e){var t,n,i,r,o,s,a,c,u=ev(e,"number");if(Qg(u))throw lv("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=sv(u),43===(t=hv(u,0))||45===t){if(88===(n=hv(u,2))||120===n)return NaN}else if(48===t){switch(hv(u,1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+u}for(s=(o=fv(u,2)).length,a=0;a<s;a++)if((c=hv(o,a))<48||c>r)return NaN;return parseInt(o,i)}return+u},pv=qg(av,!cv(" 0o1")||!cv("0b1")||cv("+0x1")),gv=function(e){var t,n=arguments.length<1?0:cv(function(e){var t=ev(e,"number");return"bigint"==typeof t?t:dv(t)}(e));return Zg(uv,t=this)&&tv((function(){ov(t)}))?Jg(Object(n),this,gv):n};gv.prototype=uv,pv&&(uv.constructor=gv),Wg({global:!0,constructor:!0,wrap:!0,forced:pv},{Number:gv});pv&&function(e,t){for(var n,i=Kg?nv(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),r=0;i.length>r;r++)$g(t,n=i[r])&&!$g(e,n)&&rv(e,n,iv(t,n))}(Yg[av],cv);var vv=ie,yv=mo,mv=le.f,kv=vv("unscopables"),bv=Array.prototype;null==bv[kv]&&mv(bv,kv,{configurable:!0,value:yv(null)});var wv,Cv,_v,xv=function(e){bv[kv][e]=!0},Sv=!d((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Tv=R,Ev=ue,Pv=T,Rv=Sv,Ov=Vt("IE_PROTO"),Lv=Object,Iv=Lv.prototype,Av=Rv?Lv.getPrototypeOf:function(e){var t=Pv(e);if(Tv(t,Ov))return t[Ov];var n=t.constructor;return Ev(n)&&t instanceof n?n.prototype:t instanceof Lv?Iv:null},Dv=d,Mv=ue,Nv=pe,Fv=Av,Bv=En,jv=ie("iterator"),Uv=!1;[].keys&&("next"in(_v=[].keys())?(Cv=Fv(Fv(_v)))!==Object.prototype&&(wv=Cv):Uv=!0);var Hv=!Nv(wv)||Dv((function(){var e={};return wv[jv].call(e)!==e}));Hv&&(wv={}),Mv(wv[jv])||Bv(wv,jv,(function(){return this}));var Gv={IteratorPrototype:wv,BUGGY_SAFARI_ITERATORS:Uv},Vv=Gv.IteratorPrototype,Wv=mo,Kv=Nt,zv=Ts,Yv=ap,Xv=function(){return this},qv=function(e,t,n,i){var r=t+" Iterator";return e.prototype=Wv(Vv,{next:Kv(+!i,n)}),zv(e,r,!1),Yv[r]=Xv,e},$v=lr,Jv=Pe,Zv=ue,Qv=qv,ey=Av,ty=Tf,ny=Ts,iy=jt,ry=En,oy=ap,sy=St.PROPER,ay=St.CONFIGURABLE,cy=Gv.IteratorPrototype,uy=Gv.BUGGY_SAFARI_ITERATORS,ly=ie("iterator"),fy="keys",hy="values",dy="entries",py=function(){return this},gy=function(e,t,n,i,r,o,s){Qv(n,t,i);var a,c,u,l=function(e){if(e===r&&g)return g;if(!uy&&e in d)return d[e];switch(e){case fy:case hy:case dy:return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",h=!1,d=e.prototype,p=d[ly]||d["@@iterator"]||r&&d[r],g=!uy&&p||l(r),v="Array"==t&&d.entries||p;if(v&&(a=ey(v.call(new e)))!==Object.prototype&&a.next&&(ey(a)!==cy&&(ty?ty(a,cy):Zv(a[ly])||ry(a,ly,py)),ny(a,f,!0)),sy&&r==hy&&p&&p.name!==hy&&(ay?iy(d,"name",hy):(h=!0,g=function(){return Jv(p,this)})),r)if(c={values:l(hy),keys:o?g:l(fy),entries:l(dy)},s)for(u in c)(uy||h||!(u in d))&&ry(d,u,c[u]);else $v({target:t,proto:!0,forced:uy||h},c);return d[ly]!==g&&ry(d,ly,g,{name:r}),oy[t]=g,c},vy=function(e,t){return{value:e,done:t}},yy=Qn,my=xv,ky=ap,by=on,wy=le.f,Cy=gy,_y=vy,xy=fe,Sy="Array Iterator",Ty=by.set,Ey=by.getterFor(Sy),Py=Cy(Array,"Array",(function(e,t){Ty(this,{type:Sy,target:yy(e),index:0,kind:t})}),(function(){var e=Ey(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,_y(void 0,!0)):_y("keys"==n?i:"values"==n?t[i]:[i,t[i]],!1)}),"values"),Ry=ky.Arguments=ky.Array;if(my("keys"),my("values"),my("entries"),xy&&"values"!==Ry.name)try{wy(Ry,"name",{value:"values"})}catch(e){}var Oy=n,Ly=Ku,Iy=Xu,Ay=Py,Dy=jt,My=ie,Ny=My("iterator"),Fy=My("toStringTag"),By=Ay.values,jy=function(e,t){if(e){if(e[Ny]!==By)try{Dy(e,Ny,By)}catch(t){e[Ny]=By}if(e[Fy]||Dy(e,Fy,t),Ly[t])for(var n in Ay)if(e[n]!==Ay[n])try{Dy(e,n,Ay[n])}catch(t){e[n]=Ay[n]}}};for(var Uy in Ly)jy(Oy[Uy]&&Oy[Uy].prototype,Uy);jy(Iy,"DOMTokenList");var Hy=$s.filter;lr({target:"Array",proto:!0,forced:!du("filter")},{filter:function(e){return Hy(this,e,arguments.length>1?arguments[1]:void 0)}});var Gy=fe,Vy=k,Wy=Pe,Ky=d,zy=qr,Yy=Fi,Xy=Gn,qy=T,$y=$n,Jy=Object.assign,Zy=Object.defineProperty,Qy=Vy([].concat),em=!Jy||Ky((function(){if(Gy&&1!==Jy({b:1},Jy(Zy({},"a",{enumerable:!0,get:function(){Zy(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!=Jy({},e)[n]||zy(Jy({},t)).join("")!=i}))?function(e,t){for(var n=qy(e),i=arguments.length,r=1,o=Yy.f,s=Xy.f;i>r;)for(var a,c=$y(arguments[r++]),u=o?Qy(zy(c),o(c)):zy(c),l=u.length,f=0;l>f;)a=u[f++],Gy&&!Wy(s,c,a)||(n[a]=c[a]);return n}:Jy,tm=em;lr({target:"Object",stat:!0,arity:2,forced:Object.assign!==tm},{assign:tm});var nm={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,u,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,i),!0;case 4:return l.fn.call(l.context,t,i,r),!0;case 5:return l.fn.call(l.context,t,i,r,o),!0;case 6:return l.fn.call(l.context,t,i,r,o,s),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,i);break;case 4:l[u].fn.call(l[u].context,t,i,r);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].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,u=[],l=a.length;c<l;c++)(a[c].fn!==t||r&&!a[c].once||i&&a[c].context!==i)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u: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}(nm);var im=nm.exports;function rm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function om(e){return function(e){if(Array.isArray(e))return rm(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return rm(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)?rm(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 sm=Rs,am=En,cm=jl,um=d,lm=ie,fm=jt,hm=lm("species"),dm=RegExp.prototype,pm=function(e,t,n,i){var r=lm(e),o=!um((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),s=o&&!um((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[hm]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!o||!s||n){var a=sm(/./[r]),c=t(r,""[e],(function(e,t,n,i,r){var s=sm(e),c=t.exec;return c===cm||c===dm.exec?o&&!r?{done:!0,value:a(t,n,i)}:{done:!0,value:s(n,t,i)}:{done:!1}}));am(String.prototype,e,c[0]),am(dm,r,c[1])}i&&fm(dm[r],"sham",!0)},gm=k,vm=di,ym=zo,mm=_,km=gm("".charAt),bm=gm("".charCodeAt),wm=gm("".slice),Cm=function(e){return function(t,n){var i,r,o=ym(mm(t)),s=vm(n),a=o.length;return s<0||s>=a?e?"":void 0:(i=bm(o,s))<55296||i>56319||s+1===a||(r=bm(o,s+1))<56320||r>57343?e?km(o,s):i:e?wm(o,s,s+2):r-56320+(i-55296<<10)+65536}},_m={codeAt:Cm(!1),charAt:Cm(!0)},xm=_m.charAt,Sm=function(e,t,n){return t+(n?xm(e,t).length:1)},Tm=Pe,Em=Se,Pm=ue,Rm=Ln,Om=jl,Lm=TypeError,Im=function(e,t){var n=e.exec;if(Pm(n)){var i=Tm(n,e,t);return null!==i&&Em(i),i}if("RegExp"===Rm(e))return Tm(Om,e,t);throw Lm("RegExp#exec called on incompatible receiver")},Am=Pe,Dm=Se,Mm=b,Nm=bi,Fm=zo,Bm=_,jm=ze,Um=Sm,Hm=Im;pm("match",(function(e,t,n){return[function(t){var n=Bm(this),i=Mm(t)?void 0:jm(t,e);return i?Am(i,t,n):new RegExp(t)[e](Fm(n))},function(e){var i=Dm(this),r=Fm(e),o=n(t,i,r);if(o.done)return o.value;if(!i.global)return Hm(i,r);var s=i.unicode;i.lastIndex=0;for(var a,c=[],u=0;null!==(a=Hm(i,r));){var l=Fm(a[0]);c[u]=l,""===l&&(i.lastIndex=Um(r,Nm(i.lastIndex),s)),u++}return 0===u?null:c}]}));var Gm=pe,Vm=Ln,Wm=ie("match"),Km=function(e){var t;return Gm(e)&&(void 0!==(t=e[Wm])?!!t:"RegExp"==Vm(e))},zm=Pe,Ym=R,Xm=Ie,qm=al,$m=RegExp.prototype,Jm=function(e){var t=e.flags;return void 0!==t||"flags"in $m||Ym(e,"flags")||!Xm($m,e)?t:zm(qm,e)},Zm=le.f,Qm=fe,ek=n,tk=k,nk=nr,ik=Ag,rk=jt,ok=ui.f,sk=Ie,ak=Km,ck=zo,uk=Jm,lk=hl,fk=function(e,t,n){n in e||Zm(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},hk=En,dk=d,pk=R,gk=on.enforce,vk=Lf,yk=gl,mk=ml,kk=ie("match"),bk=ek.RegExp,wk=bk.prototype,Ck=ek.SyntaxError,_k=tk(wk.exec),xk=tk("".charAt),Sk=tk("".replace),Tk=tk("".indexOf),Ek=tk("".slice),Pk=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Rk=/a/g,Ok=/a/g,Lk=new bk(Rk)!==Rk,Ik=lk.MISSED_STICKY,Ak=lk.UNSUPPORTED_Y,Dk=Qm&&(!Lk||Ik||yk||mk||dk((function(){return Ok[kk]=!1,bk(Rk)!=Rk||bk(Ok)==Ok||"/a/i"!=bk(Rk,"i")})));if(nk("RegExp",Dk)){for(var Mk=function(e,t){var n,i,r,o,s,a,c=sk(wk,this),u=ak(e),l=void 0===t,f=[],h=e;if(!c&&u&&l&&e.constructor===Mk)return e;if((u||sk(wk,e))&&(e=e.source,l&&(t=uk(h))),e=void 0===e?"":ck(e),t=void 0===t?"":ck(t),h=e,yk&&"dotAll"in Rk&&(i=!!t&&Tk(t,"s")>-1)&&(t=Sk(t,/s/g,"")),n=t,Ik&&"sticky"in Rk&&(r=!!t&&Tk(t,"y")>-1)&&Ak&&(t=Sk(t,/y/g,"")),mk&&(o=function(e){for(var t,n=e.length,i=0,r="",o=[],s={},a=!1,c=!1,u=0,l="";i<=n;i++){if("\\"===(t=xk(e,i)))t+=xk(e,++i);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:_k(Pk,Ek(e,i+1))&&(i+=2,c=!0),r+=t,u++;continue;case">"===t&&c:if(""===l||pk(s,l))throw new Ck("Invalid capture group name");s[l]=!0,o[o.length]=[l,u],c=!1,l="";continue}c?l+=t:r+=t}return[r,o]}(e),e=o[0],f=o[1]),s=ik(bk(e,t),c?this:wk,Mk),(i||r||f.length)&&(a=gk(s),i&&(a.dotAll=!0,a.raw=Mk(function(e){for(var t,n=e.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(t=xk(e,i))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+xk(e,++i);return r}(e),n)),r&&(a.sticky=!0),f.length&&(a.groups=f)),e!==h)try{rk(s,"source",""===h?"(?:)":h)}catch(e){}return s},Nk=ok(bk),Fk=0;Nk.length>Fk;)fk(Mk,bk,Nk[Fk++]);wk.constructor=Mk,Mk.prototype=wk,hk(ek,"RegExp",Mk,{constructor:!0})}vk("RegExp");var Bk=St.PROPER,jk=En,Uk=Se,Hk=zo,Gk=d,Vk=Jm,Wk="toString",Kk=RegExp.prototype[Wk],zk=Gk((function(){return"/a/b"!=Kk.call({source:"a",flags:"b"})})),Yk=Bk&&Kk.name!=Wk;(zk||Yk)&&jk(RegExp.prototype,Wk,(function(){var e=Uk(this);return"/"+Hk(e.source)+"/"+Hk(Vk(e))}),{unsafe:!0});var Xk=gr,qk=Pe,$k=k,Jk=pm,Zk=Se,Qk=b,eb=Km,tb=_,nb=jf,ib=Sm,rb=bi,ob=zo,sb=ze,ab=is,cb=Im,ub=jl,lb=d,fb=hl.UNSUPPORTED_Y,hb=4294967295,db=Math.min,pb=[].push,gb=$k(/./.exec),vb=$k(pb),yb=$k("".slice),mb=!lb((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]}));Jk("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=ob(tb(this)),r=void 0===n?hb:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!eb(e))return qk(t,i,e,r);for(var o,s,a,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,u+"g");(o=qk(ub,f,i))&&!((s=f.lastIndex)>l&&(vb(c,yb(i,l,o.index)),o.length>1&&o.index<i.length&&Xk(pb,c,ab(o,1)),a=o[0].length,l=s,c.length>=r));)f.lastIndex===o.index&&f.lastIndex++;return l===i.length?!a&&gb(f,"")||vb(c,""):vb(c,yb(i,l)),c.length>r?ab(c,0,r):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:qk(t,this,e,n)}:t,[function(t,n){var r=tb(this),o=Qk(t)?void 0:sb(t,e);return o?qk(o,t,r,n):qk(i,ob(r),t,n)},function(e,r){var o=Zk(this),s=ob(e),a=n(i,o,s,r,i!==t);if(a.done)return a.value;var c=nb(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(fb?"g":"y"),f=new c(fb?"^(?:"+o.source+")":o,l),h=void 0===r?hb:r>>>0;if(0===h)return[];if(0===s.length)return null===cb(f,s)?[s]:[];for(var d=0,p=0,g=[];p<s.length;){f.lastIndex=fb?0:p;var v,y=cb(f,fb?yb(s,p):s);if(null===y||(v=db(rb(f.lastIndex+(fb?p:0)),s.length))===d)p=ib(s,p,u);else{if(vb(g,yb(s,d,p)),g.length===h)return g;for(var m=1;m<=y.length-1;m++)if(vb(g,y[m]),g.length===h)return g;p=d=v}}return vb(g,yb(s,d)),g}]}),!mb,fb);var kb=k,bb=T,wb=Math.floor,Cb=kb("".charAt),_b=kb("".replace),xb=kb("".slice),Sb=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Tb=/\$([$&'`]|\d{1,2})/g,Eb=gr,Pb=Pe,Rb=k,Ob=pm,Lb=d,Ib=Se,Ab=ue,Db=b,Mb=di,Nb=bi,Fb=zo,Bb=_,jb=Sm,Ub=ze,Hb=function(e,t,n,i,r,o){var s=n+e.length,a=i.length,c=Tb;return void 0!==r&&(r=bb(r),c=Sb),_b(o,c,(function(o,c){var u;switch(Cb(c,0)){case"$":return"$";case"&":return e;case"`":return xb(t,0,n);case"'":return xb(t,s);case"<":u=r[xb(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>a){var f=wb(l/10);return 0===f?o:f<=a?void 0===i[f-1]?Cb(c,1):i[f-1]+Cb(c,1):o}u=i[l-1]}return void 0===u?"":u}))},Gb=Im,Vb=ie("replace"),Wb=Math.max,Kb=Math.min,zb=Rb([].concat),Yb=Rb([].push),Xb=Rb("".indexOf),qb=Rb("".slice),$b="$0"==="a".replace(/./,"$0"),Jb=!!/./[Vb]&&""===/./[Vb]("a","$0");Ob("replace",(function(e,t,n){var i=Jb?"$":"$0";return[function(e,n){var i=Bb(this),r=Db(e)?void 0:Ub(e,Vb);return r?Pb(r,e,i,n):Pb(t,Fb(i),e,n)},function(e,r){var o=Ib(this),s=Fb(e);if("string"==typeof r&&-1===Xb(r,i)&&-1===Xb(r,"$<")){var a=n(t,o,s,r);if(a.done)return a.value}var c=Ab(r);c||(r=Fb(r));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var f=[];;){var h=Gb(o,s);if(null===h)break;if(Yb(f,h),!u)break;""===Fb(h[0])&&(o.lastIndex=jb(s,Nb(o.lastIndex),l))}for(var d,p="",g=0,v=0;v<f.length;v++){for(var y=Fb((h=f[v])[0]),m=Wb(Kb(Mb(h.index),s.length),0),k=[],b=1;b<h.length;b++)Yb(k,void 0===(d=h[b])?d:String(d));var w=h.groups;if(c){var C=zb([y],k,m,s);void 0!==w&&Yb(C,w);var _=Fb(Eb(r,void 0,C))}else _=Hb(y,s,m,k,w,r);m>=g&&(p+=qb(s,g,m)+_,g=m+y.length)}return p+qb(s,g)}]}),!!Lb((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!$b||Jb);var Zb=St.PROPER,Qb=d,ew=Mg,tw=Vg.trim;lr({target:"String",proto:!0,forced:function(e){return Qb((function(){return!!ew[e]()||"​…᠎"!=="​…᠎"[e]()||Zb&&ew[e].name!==e}))}("trim")},{trim:function(){return tw(this)}});var nw=is,iw=Math.floor,rw=function(e,t){var n=e.length,i=iw(n/2);return n<8?ow(e,t):sw(e,rw(nw(e,0,i),t),rw(nw(e,i),t),t)},ow=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},sw=function(e,t,n,i){for(var r=t.length,o=n.length,s=0,a=0;s<r||a<o;)e[s+a]=s<r&&a<o?i(t[s],n[a])<=0?t[s++]:n[a++]:s<r?t[s++]:n[a++];return e},aw=rw,cw=M.match(/firefox\/(\d+)/i),uw=!!cw&&+cw[1],lw=/MSIE|Trident/.test(M),fw=M.match(/AppleWebKit\/(\d+)\./),hw=!!fw&&+fw[1],dw=lr,pw=k,gw=Ve,vw=T,yw=Ci,mw=Zl,kw=zo,bw=d,ww=aw,Cw=$u,_w=uw,xw=lw,Sw=G,Tw=hw,Ew=[],Pw=pw(Ew.sort),Rw=pw(Ew.push),Ow=bw((function(){Ew.sort(void 0)})),Lw=bw((function(){Ew.sort(null)})),Iw=Cw("sort"),Aw=!bw((function(){if(Sw)return Sw<70;if(!(_w&&_w>3)){if(xw)return!0;if(Tw)return Tw<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++)Ew.push({k:t+i,v:n})}for(Ew.sort((function(e,t){return t.v-e.v})),i=0;i<Ew.length;i++)t=Ew[i].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));dw({target:"Array",proto:!0,forced:Ow||!Lw||!Iw||!Aw},{sort:function(e){void 0!==e&&gw(e);var t=vw(this);if(Aw)return void 0===e?Pw(t):Pw(t,e);var n,i,r=[],o=yw(t);for(i=0;i<o;i++)i in t&&Rw(r,t[i]);for(ww(r,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:kw(t)>kw(n)?1:-1}}(e)),n=yw(r),i=0;i<n;)t[i]=r[i++];for(;i<o;)mw(t,i++);return t}});var Dw="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Mw={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Nw="%c[xgplayer]",Fw={config:{debug:Dw?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,[Nw,Mw.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,[Nw,Mw.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,[Nw,Mw.error,e].concat(r))}}};var Bw=function(){function e(t){Fo(this,e),this.bufferedList=t}return No(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}(),jw={};function Uw(e){var t=Ao(e);return null!==e&&("object"===t||"function"===t)}function Hw(e,t,n){var i,r,o,s,a,c,u=0,l=!1,f=!1,h=!0,d=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,o=r;return i=r=void 0,u=t,s=e.apply(o,n)}function g(e,t){return d?(window.cancelAnimationFrame(a),window.requestAnimationFrame(e)):setTimeout(e,t)}function v(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-u>=o}function y(){var e=Date.now();if(v(e))return m(e);a=g(y,function(e){var n=e-u,i=t-(e-c);return f?Math.min(i,o-n):i}(e))}function m(e){return a=void 0,h&&i?p(e):(i=r=void 0,s)}function k(){for(var e=Date.now(),n=v(e),o=arguments.length,h=new Array(o),d=0;d<o;d++)h[d]=arguments[d];if(i=h,r=this,c=e,n){if(void 0===a)return function(e){return u=e,a=g(y,t),l?p(e):s}(c);if(f)return a=g(y,t),p(c)}return void 0===a&&(a=g(y,t)),s}return t=+t||0,Uw(n)&&(l=!!n.leading,o=(f="maxWait"in n)?Math.max(+n.maxWait||0,t):o,h="trailing"in n?!!n.trailing:h),k.cancel=function(){void 0!==a&&function(e){if(d)return window.cancelAnimationFrame(e);clearTimeout(e)}(a),u=0,i=c=r=a=void 0},k.flush=function(){return void 0===a?s:m(Date.now())},k.pending=function(){return void 0!==a},k}jw.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},jw.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&&jw.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(e){return Fw.logError("util.createDomFromHtml",e),null}},jw.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"===Ao(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},jw.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(n){jw.hasClass(e,t)||(e.className&&"object"===Ao(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},jw.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(n){jw.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Ao(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},jw.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){jw.hasClass(e,t)?jw.removeClass(e,t):jw.addClass(e,t)}))},jw.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===jw.typeOf(e[n])?t.push(e[n]):"Object"===jw.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(" ")},jw.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){Fw.logError("util.findDom",i),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},jw.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},jw.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},jw.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=jw.padStart(Math.floor(e/3600),2,0),n=jw.padStart(Math.floor((e-3600*t)/60),2,0),i=jw.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},jw.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},jw.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},jw.deepCopy=function(e,t){if("Object"===jw.typeOf(t)&&"Object"===jw.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==jw.typeOf(t[n])||t[n]instanceof Node?"Array"===jw.typeOf(t[n])?e[n]="Array"===jw.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]:jw.deepCopy(e[n],t[n])})),e},jw.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i;"Array"===jw.typeOf(t[n])&&"Array"===jw.typeOf(e[n])?"Array"===jw.typeOf(e[n])&&(i=e[n]).push.apply(i,om(t[n])):jw.typeOf(e[n])!==jw.typeOf(t[n])||null===e[n]||"Object"!==jw.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):jw.deepMerge(e[n],t[n])})),e},jw.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},jw.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""},jw.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),i))},jw.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},jw.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),jw.clearTimeout(e,i)}),n);return e._timers.push(i),i},jw.clearTimeout=function(e,t){var n=e._timers;if("Array"===jw.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1),clearTimeout(t);break}}else clearTimeout(t)},jw.clearAllTimers=function(e){var t=e._timers;"Array"===jw.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},jw.createImgBtn=function(e,t,n,i){var r,o,s,a=jw.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},jw.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)"},jw.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},jw.checkIsFunction=function(e){return e&&"function"==typeof e},jw.checkIsObject=function(e){return null!==e&&"object"===Ao(e)},jw.hide=function(e){e.style.display="none"},jw.show=function(e,t){e.style.display=t||"block"},jw.isUndefined=function(e){if(null==e)return!0},jw.setStyleFromCsstext=function(e,t){t&&("String"===jw.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]})))},jw.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&&(!function(e,t){for(var n=0,i=t.length;n<i;n++)if(e.indexOf(t[n])>-1)return!0;return!1}(n[0],t)?o[n[0]]=n[1]:r[n[0]]=n[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},jw.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},jw.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)},i.src=e}},jw.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},jw.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},jw.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},jw.checkTouchSupport=function(){return"ontouchstart"in window},jw.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 Bw(r)},jw.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.touches&&e.touches.length>0&&(e=e.touches[0]),{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},jw.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},jw.getHostFromUrl=function(e){if("String"!==jw.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},jw.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},jw.isMSE=function(e){return!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},jw.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(t){e=0}return t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now())),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}))},jw.adjustTimeByDuration=function(e,t,n){return t&&e&&(e>t||n&&e<t)?t:e};var Gw=/(Android)\s([\d.]+)/,Vw=/(Version)\/([\d.]+)/,Ww=["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"],Kw={get device(){return Kw.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(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?Vw:Gw)?t.exec(e):[];if(n&&n.length>=3){var i=n[2].split(".");return i.length>0?parseInt(i[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;return!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&Ww.map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var n=e.video||{},i=e.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}}},zw=Kw,Yw=JSON.parse('"3.0.0-alpha.115-2-2"'),Xw={1:"network",2:"network",3:"decoder",4:"format"},qw=No((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null,src:null};Fo(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,u=t.currentSrc,l=t.video,f=l.readyState,h=l.networkState,d={playerVersion:Yw,domain:document.domain,currentTime:s,duration:o,ended:a,readyState:f,networkState:h,src:n.src||c||u,errorType:n.errorType,errorCode:n.errorCode||r.code,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:"",host:jw.getHostFromUrl(c||u)};return n.ext&&Object.keys(n.ext).map((function(e){d[e]=n.ext[e]})),d}if(arguments.length>1){for(var p={playerVersion:Yw,domain:document.domain},g=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],v=0;v<arguments.length;v++)p[g[v]]=arguments[v];return p.ex=i?(i[arguments[0]]||{}).msg:"",p}})),$w="play",Jw="playing",Zw="ended",Qw="pause",eC="error",tC="seeking",nC="seeked",iC="timeupdate",rC="waiting",oC="canplay",sC="durationchange",aC="volumechange",cC="loadeddata",uC="ratechange",lC="progress",fC="loadstart",hC="emptied",dC="focus",pC="blur",gC="ready",vC="urlNull",yC="autoplay_started",mC="autoplay_was_prevented",kC="complete",bC="replay",wC="destroy",CC="urlchange",_C="download_speed_change",xC="buffer_control",SC="fullscreen_change",TC="cssFullscreen_change",EC="mini_state_change",PC="definition_change",RC="after_definition_change",OC="video_resize",LC="pip_change",IC="rotate",AC="screenShot",DC="playnext",MC="shortcut",NC="xglog",FC="user_action",BC="reset",jC="source_error",UC="source_success",HC=["play","playing","ended","pause","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadedmetadata","ratechange","progress","loadstart","emptied","stalled","suspend","abort","lowdecode"],GC={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},VC="fps_stuck",WC=Object.freeze({__proto__:null,PLAY:$w,PLAYING:Jw,ENDED:Zw,PAUSE:Qw,ERROR:eC,SEEKING:tC,SEEKED:nC,TIME_UPDATE:iC,WAITING:rC,CANPLAY:oC,CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:sC,VOLUME_CHANGE:aC,LOADED_DATA:cC,LOADED_METADATA:"loadedmetadata",RATE_CHANGE:uC,PROGRESS:lC,LOAD_START:fC,EMPTIED:hC,STALLED:"stalled",SUSPEND:"suspend",ABORT:"abort",BUFFER_CHANGE:"bufferedChange",PLAYER_FOCUS:dC,PLAYER_BLUR:pC,READY:gC,URL_NULL:vC,AUTOPLAY_STARTED:yC,AUTOPLAY_PREVENTED:mC,COMPLETE:kC,REPLAY:bC,DESTROY:wC,URL_CHANGE:CC,DOWNLOAD_SPEED_CHANGE:_C,BUFFER_CONTROLS:xC,FULLSCREEN_CHANGE:SC,CSS_FULLSCREEN_CHANGE:TC,MINI_STATE_CHANGE:EC,DEFINITION_CHANGE:PC,BEFORE_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:RC,SEI_PARSED:"SEI_PARSED",RETRY:"retry",VIDEO_RESIZE:OC,PIP_CHANGE:LC,ROTATE:IC,SCREEN_SHOT:AC,PLAYNEXT:DC,SHORTCUT:MC,XGLOG:NC,USER_ACTION:FC,RESET:BC,SOURCE_ERROR:jC,SOURCE_SUCCESS:UC,SWITCH_SUBTITLE:"switch_subtitle",VIDEO_EVENTS:HC,STATS_EVENTS:GC,FPS_STUCK:VC});function KC(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}function zC(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var YC=function(e){jo(n,e);var t=KC(n);function n(e){var i;Fo(this,n),(i=t.call(this,e))._hasStart=!1,i._currentTime=0,i._duration=0,i._internalOp={},i._lastMuted=!1,i.vtype=e.vtype||"MP4",i._rate=-1,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:0|e.tabindex,mediaType:e.mediaType||"video","data-index":-1},e.videoConfig,e.videoAttributes);var r=e["x5-video-player-type"]||e.x5VideoPlayerType;return zw.isWeixin&&zw.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=jw.createDom(i.videoConfig.mediaType,"",i.videoConfig,""),e.defaultPlaybackRate&&(i.video.defaultPlaybackRate=i.video.playbackRate=e.defaultPlaybackRate),"Number"===jw.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 No(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(e){var t=this;this.evHandlers||(this._evHandlers=HC.map((function(e){return Vo({},e,(i=t,r="on".concat((n=e).charAt(0).toUpperCase()).concat(n.slice(1)),i[r]&&"function"==typeof i[r]&&i.on(n,i[r]),function(e,t){var r=n,o={player:i,eventName:r,originalEvent:e,detail:e.detail||{},timeStamp:e.timeStamp,currentTime:i.currentTime,duration:i.duration,paused:i.paused,ended:i.ended,isInternalOp:!!i._internalOp[e.type],muted:i.muted,volume:i.volume,host:jw.getHostFromUrl(i.currentSrc),vtype:i.vtype};if(i.removeInnerOP(e.type),"timeupdate"===r&&(i._currentTime=i.video&&i.video.currentTime),"ratechange"===r){var s=i.video?i.video.playbackRate:0;if(s&&i._rate===s)return;i._rate=i.video&&i.video.playbackRate}if("durationchange"===r&&(i._duration=i.video.duration),"volumechange"===r&&(o.isMutedChange=i._lastMuted!==i.muted,i._lastMuted=i.muted),"error"===r&&(o.error=t||i.video.error),i.videoEventMiddleware[n]){var a=zC.bind(i,n,o);try{i.videoEventMiddleware[n].call(i,o,a)}catch(e){throw zC.call(i,r,o),e}}else zC.call(i,r,o)}));var n,i,r}))),e||(e=this.video),this._evHandlers.forEach((function(t){var n=Object.keys(t)[0];e.addEventListener(n,t[n],!1)}))}},{key:"detachVideoEvents",value:function(e){e||(e=this.video),this._evHandlers.map((function(t){var n=Object.keys(t)[0];e.removeEventListener(Object.keys(t)[0],t[n],!1)}))}},{key:"_attachSourceEvents",value:function(e,t){var n=this;e.removeAttribute("src"),e.load(),e.removeEventListener("loadeddata",this._vLoadeddata),t.forEach((function(e){n.video.appendChild(jw.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||"")}))}));var i=e.children;if(i){this._videoSourceCount=i.length,this._vLoadeddata=function(e){n.emit(UC,{src:e.target.currentSrc,host:jw.getHostFromUrl(e.target.currentSrc)})};for(var r=null,o=0;o<this._evHandlers.length;o++)if("error"===Object.keys(this._evHandlers[o])[0]){r=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){if(n._videoSourceCount--,0===n._videoSourceCount){var t={code:4,message:"sources_load_error"};r?r.error(e,t):n.errorHandler("error",t)}var i=Xw[4];n.emit(jC,new qw(n,{errorType:i,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var s=0;s<i.length;s++)i[s].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var n=0;n<t.length;n++)t[n].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0]);this._vLoadeddata&&e.removeEventListener("loadeddata",this._vLoadeddata)}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.video&&(this.video.error||t)){var n=this.video.error||t,i=n.code?Xw[n.code]:"other";n.message;this.video.currentSrc||(n={code:6,message:"empty_src_".concat(n.message)}),this.emit(e,new qw(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,this.emit("hasstart"))}},{key:"destroy",value:function(){var e=this;for(var t 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._hasStart=!1,this.videoConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,t)&&(clearInterval(this._interval[t]),this._interval[t]=null);this.detachVideoEvents(),this._evHandlers.map((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,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:"load",value:function(){this.video&&this.video.load()}},{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?jw.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(){if(!this.video||!this.video.error)return null;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?this.video.networkState:0}},{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?this.video.readyState:0}},{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(CC,e),this.emit(rC),this._currentTime=0,this._duration=0,/^blob/.test(this.video.currentSrc)||/^blob/.test(this.video.src)?this.onWaiting():(this._detachSourceEvents(this.video),"Array"===jw.typeOf(e)?this._attachSourceEvents(this.video,e):e?this.video.src=e:this.video.removeAttribute("src"),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=au(Go(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=au(Go(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=au(Go(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=au(Go(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){au(Go(n.prototype),"removeAllListeners",this).call(this)}}]),n}(im),XC=YC,qC=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"}};Fo(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return No(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}(),$C=qC,JC=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],ZC=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],QC=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],e_="data-xgplayerid",t_={BUFFER_CONTROLS:"buffer_control"},n_={PLAYING:"playing",WAITING:"waiting"},i_=lr,r_=$s.find,o_=xv,s_="find",a_=!0;function c_(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 u_(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&&c_.apply(void 0,[r,t,n.next].concat(om(i)))})).catch((function(e){throw e})):c_.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&c_.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 c_.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function l_(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 f_(e,t){var n=this.__hooks;n&&delete n[e]}function h_(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 d_(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,i)}}}function p_(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 g_(e){e.__hooks=null}function v_(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 y_(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 m_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y_(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k_(e,t){Fw.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}s_ in[]&&Array(1)[s_]((function(){a_=!1})),i_({target:"Array",proto:!0,forced:a_},{find:function(e){return r_(this,e,arguments.length>1?arguments[1]:void 0)}}),o_(s_);var b_=function(){function e(t){Fo(this,e),jw.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),p_(this),this.__args=t,this.__events={},this.__onceEvents={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return No(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){e||(e=this.lang)}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=jw.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)})):k_(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__onceEvents[e]=t,this.player.once(e,t)):Array.isArray(e)&&e.forEach((function(i){n.__onceEvents[i]=t,n.player.once(e,t)})):k_(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)})):k_(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;["__events","__onceEvents"].forEach((function(t){Object.keys(e[t]).forEach((function(n){e[t][n]&&e.off(n,e[t][n]),n&&delete e[t][n]}))})),this.__events={},this.__onceEvents={}}},{key:"emit",value:function(e){var t;if(this.player){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(i))}}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=m_(m_({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return u_.call.apply(u_,[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 l_.call.apply(l_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return f_.call.apply(f_,[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(),jw.clearAllTimers(this),jw.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),g_(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var w_=Element.prototype;w_.matches=w_.matchesSelector||w_.mozMatchesSelector||w_.msMatchesSelector||w_.oMatchesSelector||w_.webkitMatchesSelector}var C_=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function __(e,t,n,i,r){var o=x_.apply(this,arguments);return e.addEventListener(n,o,r),{destroy:function(){e.removeEventListener(n,o,r)}}}function x_(e,t,n,i){return function(n){n.delegateTarget=C_(n.target,t),n.delegateTarget&&i.call(e,n)}}var S_=function(e,t,n,i,r){return"function"==typeof e.addEventListener?__.apply(null,arguments):"function"==typeof n?__.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return __(e,t,n,i,r)})))};function T_(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var E_={CONTROLS:"controls",ROOT:"root"},P_={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"},R_="xg-icon-disable";function O_(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function L_(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 jw.addClass(e,n),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(O_(e)||O_(e.url))return i.src=O_(e)?e:e.url||"",o=jw.createDom(e.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof e)try{return(o=e())instanceof window.Element?(jw.addClass(o,n),Object.keys(i).map((function(e){o.setAttribute(e,i[e])})),o):(Fw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(e){return Fw.logError("Plugin named [".concat(r,"]:createIcon"),e),null}return"string"==typeof e?jw.createDomFromHtml(e,i,n):(Fw.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function I_(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"===Ao(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],o),s=function(e,t){return"object"===Ao(e)&&e.attr&&"object"===Ao(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],s),a=L_(n[i],i,o,s,t.pluginName)),!a&&r&&(a=L_(r.icon?r.icon:r,s,o,{},t.pluginName)),t.icons[i]=a}))}var A_=function(e){jo(n,e);var t=T_(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Fo(this,n),(e=t.call(this,i)).__delegates=[],e}return No(n,[{key:"__init",value:function(e){if(au(Go(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,i=null;this.icons={},this.root=null,this.parent=null,I_(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 Fw.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=jw.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||{},u=this.config.style||{};this.setAttr(c),this.setStyle(u),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"===Ao(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"===Ao(s)&&"function"==typeof s.plugin&&(i=s.options?jw.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:"disable",value:function(){this.config.disable=!0,jw.addClass(this.find(".xgplayer-icon"),R_)}},{key:"enable",value:function(){this.config.disable=!1,jw.removeClass(this.find(".xgplayer-icon"),R_)}},{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=au(Go(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"===jw.typeOf(e)?this.root.style[e]=t:void("Object"===jw.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"===jw.typeOf(e)?this.root.setAttribute(e,t):void("Object"===jw.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 Fw.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)),au(Go(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 u=Number(a.getAttribute("data-index"));if(u>=r){c="beforebegin";break}u<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=S_(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}));else{var s=S_(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}return o}},{key:"ROOT_TYPES",get:function(){return E_}},{key:"POSITIONS",get:function(){return P_}}]),n}(b_),D_=_m.charAt,M_=zo,N_=on,F_=gy,B_=vy,j_="String Iterator",U_=N_.set,H_=N_.getterFor(j_);F_(String,"String",(function(e){U_(this,{type:j_,string:M_(e),index:0})}),(function(){var e,t=H_(this),n=t.string,i=t.index;return i>=n.length?B_(void 0,!0):(e=D_(n,i),t.index+=e.length,B_(e,!1))}));var G_=function(){function e(){var t=this;if(Fo(this,e),Vo(this,"__trigger",(function(e){var n=(new Date).getTime();t.timeStamp=n;for(var i=0;i<e.length;i++)t.__runHandler(e[i].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Uw(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Hw(e,t,{leading:i,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(e){console.error(e)}}return No(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=e.getAttribute(e_),i=this.__handlers,r=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(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}}]),e}(),V_=null;var W_={pluginGroup:{},init:function(e){var t,n,i=e._pluginInfoId;i||(i=(new Date).getTime(),e._pluginInfoId=i),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.getVideoSize()},V_||(V_=new G_),V_.addObserver(t,n)),0===Object.keys(this.pluginGroup).length&&(e.isUserActive=!0),this.pluginGroup[i]={_player:e,_originalOptions:e.config||{},_plugins:{}}},checkPlayerRoot:function(e){if(this.pluginGroup){for(var t=Object.keys(this.pluginGroup),n=0;n<t.length;n++){var i=this.pluginGroup[t[n]]._player;if(i.root===e)return i}return null}return null},formatPluginInfo:function(e,t){var n=null,i=null;return e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),t&&(i.config=t||{}),{PLUFGIN:n,options:i}},checkPluginIfExits:function(e,t){for(var n=0;n<t.length;n++)if(e.toLowerCase()===t[n].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var n=Object.keys(t),i=null,r=0;r<n.length;r++)if(e.toLowerCase()===n[r].toLowerCase()){i=t[n[r]];break}return"Object"===jw.typeOf(i)?{root:i.root,position:i.position}:{}},lazyRegister:function(e,t){var n=this,i=t.timeout||1500;return Promise.race([t.loader().then((function(t){var i;i=t&&t.__esModule?t.default:t,n.register(e,i,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),i)}))])},register:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var r=this.pluginGroup[i]._plugins,o=this.pluginGroup[i]._originalOptions;n.player=this.pluginGroup[i]._player;var 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 u=o[a[c]];"Object"===jw.typeOf(u)&&(n.config=Object.assign({},n.config,o[a[c]]));break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===n.config[e]&&(n.config[e]=t.defaultConfig[e])})),n.root?"string"==typeof n.root&&(n.root=e[n.root]):n.root=e.root,n.index=n.config.index||0;try{r[s.toLowerCase()]&&(this.unRegister(i,s.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(s,"] exist, destroy the old instance")));var l=new t(n);return r[s.toLowerCase()]=l,r[s.toLowerCase()].func=t,l&&"function"==typeof l.afterCreate&&l.afterCreate(),l}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[n]&&this.pluginGroup[n]._plugins&&delete this.pluginGroup[n]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var n=e._pluginInfoId;if(!n||!this.pluginGroup[n])return null;var i=t.toLowerCase();return this.pluginGroup[n]._plugins[i]},beforeInit:function(e){var t=this;function n(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(i){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var r=e._pluginInfoId;if(t.pluginGroup[r]){var o=t.pluginGroup[r]._plugins,s=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();s.push(n(t))}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(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins;Object.keys(n).forEach((function(e){n[e]&&n[e].afterPlayerInit&&n[e].afterPlayerInit()}))}},setLang:function(e,t){var n=t._pluginInfoId;if(n&&this.pluginGroup[n]){var i=this.pluginGroup[n]._plugins;Object.keys(i).forEach((function(t){if(i[t].updateLang)i[t].updateLang(e);else try{i[t].lang=e}catch(e){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,n=e._pluginInfoId;if(n&&this.pluginGroup[n]){var i=[],r=this.pluginGroup[n]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(i.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(n,e))})),i.forEach((function(n){t.register(e,n.plugin,n.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins||{};Object.keys(n).forEach((function(e){n[e].onPluginsReady&&"function"==typeof n[e].onPluginsReady&&n[e].onPluginsReady()}))}},setCurrentUserActive:function(e,t){if(this.pluginGroup[e]){if(!t)return this.pluginGroup[e]._player.isUserActive=t,e;for(var n=Object.keys(this.pluginGroup),i=0;i<n.length;i++){var r=this.pluginGroup[n[i]];r&&r._player&&(this.pluginGroup[n[i]]._player.isUserActive=!1)}return this.pluginGroup[e]._player.isUserActive=t,e}},getCurrentUseActiveId:function(){if(this.pluginGroup){for(var e=Object.keys(this.pluginGroup),t=0;t<e.length;t++){var n=this.pluginGroup[e[t]];if(n&&n._player&&n._player.isUserActive)return e[t]}return null}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var n,i;n=e.root,V_.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 u=Object.keys(this.pluginGroup);u.length>0&&this.setCurrentUserActive(u[u.length-1],!0)}}}},K_=W_,z_={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"};function Y_(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},ignores:[],whitelist:[],inactive:3e3,lang:(e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),"zh-cn"===e&&(e="zh"),e),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}};var e}function X_(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var q_=function(e){jo(n,e);var t=X_(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var n=Uo(e),i=n.player;n.playerConfig.closeControlsBlur&&i.focus({autoHide:!1})})),Vo(Uo(e),"onMouseLeave",(function(){Uo(e).player.focus()})),e}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.controls&&(e.config.disable=!e.player.config.controls),e.config.mode||"mobile"!==zw.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,o=t.autoHide;if(!n){"flex"===r&&this.player.addClass(z_.FLEX_CONTROLS),o&&this.player.addClass(z_.AUTOHIDE);var s={height:"".concat(i,"px")};Object.keys(s).map((function(t){e.root.style[t]=s[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(EC,(function(t){t?jw.addClass(e.root,"mini-controls"):jw.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==zw.device&&"mobile"!==a&&(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&&jw.addClass(this.root,"control_autohide")}},{key:"pauseAutoHide",value:function(){jw.removeClass(this.root,"control_autohide")}},{key:"show",value:function(){this.root.style.display="",this.player.focus()}},{key:"hide",value:function(){this.root.style.display="none"}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){switch(t.position?t.position:t.config&&t.config.position?t.config.position:r.position){case P_.CONTROLS_LEFT:t.root=this.left;break;case P_.CONTROLS_RIGHT:t.root=this.right;break;case P_.CONTROLS_CENTER:t.root=this.center;break;case P_.CONTROLS:t.root=this.root;break;default:t.root=this.left}return au(Go(n.prototype),"registerPlugin",this).call(this,e,t,i)}}}},{key:"destroy",value:function(){"mobile"!==zw.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=jw.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},{control_autohide:n},{controls_permanent:!n},{"xgplayer-controls-initshow":i||!n});return'<xg-controls class="'.concat(r,'" unselectable="on">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),n}(A_),$_=q_,J_={lang:{},langKeys:[],textKeys:[]};function Z_(e,t){return Object.keys(t).forEach((function(n){var i,r=jw.typeOf(t[n]),o=jw.typeOf(e[n]);"Array"===r?("Array"!==o&&(e[n]=[]),(i=e[n]).push.apply(i,om(t[n]))):"Object"===r?("Object"!==o&&(e[n]={}),Z_(e[n],t[n])):e[n]=t[n]})),e}function Q_(){Object.keys(J_.lang.en).map((function(e){J_.textKeys[e]=e}))}function ex(e,t){var n=e.LANG;if(t||(t=J_),t.lang){var i=e.TEXT||{};"zh"===n&&(n="zh-cn"),t.lang[n]?Z_(t.lang[n],i):(t.langKeys.push(n),t.lang[n]=i),Q_()}}ex({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 tx={get textKeys(){return J_.textKeys},get langKeys(){return J_.langKeys},get lang(){var e={};return J_.langKeys.map((function(t){e[t]=J_.lang[t]})),J_.lang["zh-cn"]&&(e.zh=J_.lang["zh-cn"]||{}),e},extend:function(e,t){var n=[];if(t||(t=J_),t.lang){n="Array"!==jw.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var i=t.lang;n.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?Z_(i[e.LANG]||{},e.TEXT||{}):ex(e,t)})),Q_()}},use:ex,init:function(e){var t,n={lang:{},langKeys:[],textKeys:{},pId:e};return Z_(n.lang,J_.lang),(t=n.langKeys).push.apply(t,om(J_.langKeys)),Z_(n.textKeys,J_.textKeys),n}},nx=tx;function ix(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 rx(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ix(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ix(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ox(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var sx=["play","pause","replay","retry","playnext"],ax=0,cx=0,ux=function(e){jo(n,e);var t=ox(n);function n(e){var i;Fo(this,n);var r,o=jw.deepMerge(Y_(),e);Vo(Uo(i=t.call(this,o)),"canPlayFunc",(function(){if(i.config){var e=i.config,t=e.autoplay,n=e.startTime,r=e.defaultPlaybackRate;Fw.logInfo("player","canPlayFunc, startTime",n),n&&(i.currentTime=n>i.duration?i.duration:n,i.config.startTime=0),i.playbackRate=r,t&&i.videoPlay(),i.off(oC,i.canPlayFunc),i.removeClass(z_.ENTER)}})),Vo(Uo(i),"onFullscreenChange",(function(e,t){var n=function(){jw.setTimeout(Uo(i),(function(){i.getVideoSize()}),100)},r=jw.getFullScreenEl();i._fullActionFrom?i._fullActionFrom="":i.emit(FC,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:i.currentTime,duration:i.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,n){if(e){var i=e.getAttribute(n);return!(!i||i!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,i.playerId,e_);if(t||r&&(r===i._fullscreenEl||o))n(),!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!0,i.emit(SC,!0,i._fullScreenOffset),i.cssfullscreen&&i.exitCssFullscreen();else if(i.fullscreen){n();var s=Uo(i),a=s._fullScreenOffset;s.config.needFullscreenScroll?(window.scrollTo(a.left,a.top),jw.setTimeout(Uo(i),(function(){i.fullscreen=!1,i._fullScreenOffset=null}),100)):(!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!1,i._fullScreenOffset=null),i.cssfullscreen?i.removeClass(z_.FULLSCREEN):i.recoverFullStyle(i.root,i._fullscreenEl,z_.FULLSCREEN),i._fullscreenEl=null,i.emit(SC,!1)}})),Vo(Uo(i),"_onWebkitbeginfullscreen",(function(e){i._fullscreenEl=i.video,i.onFullscreenChange(e,!0)})),Vo(Uo(i),"_onWebkitendfullscreen",(function(e){i.onFullscreenChange(e,!1)})),p_(Uo(i),sx),i.config=o,i._pluginInfoId=jw.generateSessionId(),(r=Uo(i)).logInfo=Fw.logInfo.bind(r),r.logWarn=Fw.logWarn.bind(r),r.logError=Fw.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);return i.userTimer=null,i.waitTimer=null,i.isReady=!1,i.isPlaying=!1,i.isError=!1,i.isSeeking=!1,i.isCanplay=!1,i._runPending=!1,i.rotateDeg=0,i.isActive=!1,i.isBufferControlPaused=!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._accPlayed={t:0,acc:0,loopAcc:0},i.innerContainer=null,i.controls=null,i.topBar=null,i.topBar=null,i.root=null,i.__i18n=nx.init(),zw.os.isAndroid&&zw.osVersion>0&&zw.osVersion<6&&(i.config.autoplay=!1),i.database=new $C,i.isUserActive=!1,i._onceSeekCanplay=null,i._isPauseBeforeSeek=0,i.innerStates={isActiveLocked:!1},i._initDOM()?(i._bindEvents(),i._registerPresets(),i._registerPlugins(),K_.onPluginsReady(Uo(i)),jw.setTimeout(Uo(i),(function(){i.emit(gC),i.onReady&&i.onReady(),i.isReady=!0}),0),i.getInitDefinition(),(i.config.videoInit||i.config.autoplay)&&(i.hasStart||i.start()),i):(console.error(new Error("can't find the dom which id is ".concat(i.config.id," or this.config.el does not exist"))),Ho(i))}return No(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(eC,new qw("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=K_.checkPlayerRoot(this.root);n&&(Fw.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(e_,this.playerId),K_.init(this),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.video.setAttribute(e_,this.playerId),this.config.controls){var s=K_.register(this,$_);this.controls=s}var a="mobile"===this.config.isMobileSimulateMode?"mobile":zw.device;if(this.addClass("".concat(z_.DEFAULT," ").concat(z_.ACTIVE," xgplayer-").concat(a," ").concat(this.config.controls?"":z_.NO_CONTROLS)),this.config.autoplay?this.addClass(z_.ENTER):this.addClass(z_.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(t){e.root.style[t]=c[t]}))}else["width","height"].map((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=jw.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=jw.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=jw.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=jw.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 e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),JC.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),zw.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once("loadeddata",this.getVideoSize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.video.focus()},this.once("play",this.playFunc),this.on(xC,this.onBufferControl)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),JC.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off("play",this.playFunc),this.off("canplay",this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.video&&(e&&""!==e&&("Array"!==jw.typeOf(e)||0!==e.length)||(e="",this.emit(vC),Fw.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.video),"Array"===jw.typeOf(e)&&e.length>0?this._attachSourceEvents(this.video,e):this.video.src&&this.video.src===e?e||this.video.removeAttribute("src"):this.video.src=e,"Number"===jw.typeOf(this.config.volume)&&(this.volume=this.config.volume);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;Fw.logInfo("_startInit readyState",i),this.config.autoplay&&(!/^blob/.test(this.video.currentSrc)&&!/^blob/.test(this.video.src)&&this.load(),(zw.os.isIpad||zw.os.isPhone)&&this.videoPlay()),i>=2?this.canPlayFunc():this.once(oC,this.canPlayFunc),jw.setTimeout(this,(function(){t.emit(kC)}),1),this.hasStart||K_.afterInit(this),this.hasStart=!0}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var n=this.config.ignores||[],i=this.config.plugins||[],r=this.config.i18n||[];t&&nx.extend(r,this.__i18n);var o=n.join("||").toLowerCase().split("||"),s=this.plugins;i.forEach((function(n){try{var i=n.plugin?n.plugin.pluginName:n.pluginName;if(!i)return;var r=i.toLowerCase(),a=e.config[r]||e.config[i];if("Boolean"===jw.typeOf(a)&&!a||o.indexOf(r)>-1)return;if(!t&&s[r])return;if(n.lazy&&n.loader){var c=K_.lazyRegister(e,n);return void(n.forceBeforeInit&&(c.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})).catch((function(t){Fw.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(c),1)})),e._loadingPlugins.push(c)))}return e.registerPlugin(n)}catch(e){Fw.logError("_registerPlugins:",e)}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,i,r=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=r.plugins,s=void 0===o?[]:o,a=r.ignores,c=void 0===a?[]:a,u=r.icons,l=void 0===u?{}:u,f=r.i18n,h=void 0===f?[]:f;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(n=e.config.plugins).push.apply(n,om(s)),(i=e.config.ignores).push.apply(i,om(c)),Object.keys(l).map((function(t){e.config.icons[t]||(e.config.icons[t]=l[t])}));var d=e.config.i18n||[];h.push.apply(h,om(d)),e.config.i18n=h}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case P_.ROOT_RIGHT:t=this.rightBar;break;case P_.ROOT_LEFT:t=this.leftBar;break;case P_.ROOT_TOP:t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=K_.formatPluginInfo(e,t),i=n.PLUFGIN,r=n.options,o=this.config.plugins;!K_.checkPluginIfExits(i.pluginName,o)&&o.push(i);var s=K_.getRootByConfig(i.pluginName,this.config);s.root&&(r.root=s.root),s.position&&(r.position=s.position);var a=r.position?r.position:r.config&&r.config.position||i.defaultConfig&&i.defaultConfig.position;return!r.root&&"string"==typeof a&&a.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,r,i.pluginName):(r.root||(r.root=this._getRootByPosition(a)),K_.register(this,i,r))}},{key:"deregister",value:function(e){"string"==typeof e?K_.unRegister(this,e):e instanceof b_&&K_.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.deregister(e),t&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof b_&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--){if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return K_.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=K_.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(jw.hasClass(this.root,e)||jw.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&jw.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return jw.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!this.hasStart)return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this._registerPlugins(!1),K_.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",Fw.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e){var t=this,n=e;"Object"===jw.typeOf(e)&&(n=e.url);var i=this.currentTime,r=this.paused&&!this.isError;return this.src=n,new Promise((function(e){var n=function(){t.currentTime=i,r&&t.once("canplay",(function(){t.pause()})),e()};zw.os.isAndroid?t.once("timeupdate",(function(){n()})):t.once("canplay",(function(){n()})),t.play()}))}},{key:"videoPlay",value:function(){var e=this;if(this.hasStart){this.isPlaying||(this.removeClass(z_.NO_START),!this.isCanplay&&this.addClass(z_.ENTER));var t=au(Go(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(z_.NOT_ALLOW_AUTOPLAY),e.addClass(z_.PLAYING),e.isPlaying||(Fw.logInfo(">>>>playPromise.then"),e.isPlaying=!0,e.emit(yC))})).catch((function(t){if(Fw.logWarn(">>>>playPromise.catch",t.name),e.video&&e.video.error)return e.onError(),void e.removeClass(z_.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=jw.setTimeout(e,(function(){e._errorTimer=null,e.emit(mC),e.addClass(z_.NOT_ALLOW_AUTOPLAY),e.removeClass(z_.ENTER),e.pause()}),0))})):(Fw.logWarn("video.play not return promise"),this.isPlaying||(this.isPlaying=!0,this.removeClass(z_.NOT_ALLOW_AUTOPLAY),this.removeClass(z_.NO_START),this.removeClass(z_.ENTER),this.addClass(z_.PLAYING),this.emit(yC))),t}this.removeClass(z_.NO_START),this.addClass(z_.ENTER);var i=this.start();i&&i.then((function(t){!e.config.autoplay&&e.videoPlay()}))}},{key:"videoPause",value:function(){au(Go(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;this.removeClass(z_.PAUSED),v_(this,"play",(function(){e.videoPlay()}))}},{key:"pause",value:function(e){var t=this;v_(this,"pause",(function(){e===t_.BUFFER_CONTROLS?t.isBufferControlPaused||(t.isBufferControlPaused=!0,t.emit(xC,{type:n_.WAITING})):t.isBufferControlPaused&&(t.isBufferControlPaused=!1,t.emit(xC,{type:n_.PLAYING})),au(Go(n.prototype),"pause",t).call(t)}),e)}},{key:"seek",value:function(e,t){var n=this;if(this.video&&!Number.isNaN(Number(e))&&this.hasStart){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._isPauseBeforeSeek&&(this._isPauseBeforeSeek=this.paused?2:1),this._onceSeekCanplay&&this.off(nC,this._onceSeekCanplay),this._onceSeekCanplay=function(){switch(n.removeClass(z_.ENTER),n.isSeeking=!1,s){case"play":n.play();break;case"pause":n.pause();break;default:n._isPauseBeforeSeek>1||n.paused?n.pause():n.play()}n._isPauseBeforeSeek=0,n._onceSeekCanplay=null},this.once(nC,this._onceSeekCanplay),this.isPlaying?this.currentTime=e:(this.removeClass(z_.NO_START),this.currentTime=e,this.play())}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,n=t.definition;!t.url&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map((function(t){t.definition===n.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t.definition)}))}},{key:"changeDefinition",value:function(e,t){var n=this;if(this.emit(PC,{from:t,to:e}),this.curDefinition=e.definition,this.hasStart){var i=this.switchURL(e.url);i&&i.then?i.then((function(){n.emit(RC,{from:t,to:e})})):this.emit(RC,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once("loadeddata",this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[z_.NOT_ALLOW_AUTOPLAY,z_.PLAYING,z_.NO_START,z_.PAUSED,z_.REPLAY,z_.ENTER,z_.ENDED,z_.ERROR,z_.LOADING];this.hasStart=!1,this.isError=!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(z_.ENTER),this.emit(BC)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(this.resetState(),this.plugins&&(t.map((function(t){e.deregister(t)})),n)){var i=Y_();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=i[t])}))}}},{key:"destroy",value:function(){var e=this,t=this.innerContainer,i=this.root,r=this.video;if(i&&r){if(i.removeAttribute(e_),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.video),jw.clearAllTimers(this),this.emit(wC),K_.destroy(this),g_(this),au(Go(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root)try{this.exitFullscreen()}catch(e){}if(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"),["isReady","isPlaying","isSeeking","isCanplay","isActive","isCssfullScreen","fullscreen"].map((function(t){e[t]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(z_.ENDED),this.currentTime=0,this.isSeeking=!1,v_(this,"replay",(function(){e.once(nC,(function(){var t=e.videoPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(bC),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(z_.ERROR),this.addClass(z_.LOADING),v_(this,"retry",(function(){var t=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(oC,(function(){e.videoPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,n,i){e&&(i||(i=z_.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=jw.filterStyleFromText(e)),jw.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=jw.filterStyleFromText(t),jw.addClass(t,i),t.setAttribute(e_,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,i){i||(i=z_.PARENT_FULLSCREEN),this._orgCss&&(jw.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),jw.removeClass(e,n),t&&t!==e&&this._orgPCss&&(jw.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",jw.removeClass(t,i),t.removeAttribute(e_))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,n=this.video;if(e||(e=t),this._fullScreenOffset={top:jw.scrollTop(),left:jw.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get",jw.getFullScreenEl()===this._fullscreenEl)return this.onFullscreenChange(),Promise.resolve();try{this.changeFullStyle(this.root,e,z_.FULLSCREEN);for(var i=0;i<ZC.length;i++){var r=ZC[i];if(e[r]){var o="webkitRequestFullscreen"===r?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[r]();return o&&o.then?o:Promise.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Promise.resolve()):(this.recoverFullStyle(this.root,this._fullscreenEl,z_.FULLSCREEN),Promise.reject(new Error("call getFullscreen fail")))}catch(e){return this.recoverFullStyle(this.root,this._fullscreenEl,z_.FULLSCREEN),Promise.reject(e)}}},{key:"exitFullscreen",value:function(e){if(this._fullscreenEl||jw.getFullScreenEl()){this.root;var t=this.video;this._fullActionFrom="exit";for(var n=0;n<QC.length;n++){var i=QC[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"))}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.fullscreen&&this.exitFullscreen(),this._cssfullscreenEl=e,this.changeFullStyle(this.root,e,e?z_.INNER_FULLSCREEN:z_.CSS_FULLSCREEN),this.isCssfullScreen=!0,this.emit(TC,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?z_.INNER_FULLSCREEN:z_.CSS_FULLSCREEN;this.fullscreen?this.removeClass(e):this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this._cssfullscreenEl=null,this.isCssfullScreen=!1,this.emit(TC,!1)}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(dC,rx({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(pC,rx({paused:this.paused,ended:this.ended},e)):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3},n=this.innerStates;if(this.isActive=!0,this.removeClass(z_.ACTIVE),this.userTimer&&(jw.clearTimeout(this,this.userTimer),this.userTimer=null),void 0!==t.isLock&&(n.isActiveLocked=t.isLock),!1===t.autoHide||!0===t.isLock||n.isActiveLocked)this.userTimer&&(jw.clearTimeout(this,this.userTimer),this.userTimer=null);else{var i=t&&t.delay?t.delay:this.config.inactive;this.userTimer=jw.setTimeout(this,(function(){e.userTimer=null,e.blur()}),i)}}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};if(this.isActive&&!this.innerStates.isActiveLocked){var t=this.config.closePauseVideoFocus;this.isActive=!1,(e.ignorePaused||t||!this.paused&&!this.ended)&&this.addClass(z_.ACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.hasStart&&this.removeClass(z_.ENTER),!this.isBufferControlPaused&&this.removeClass(z_.LOADING),this.isCanplay=!0,this.waitTimer&&jw.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1}},{key:"onPlay",value:function(){this.removeClass(z_.PAUSED),this.ended&&this.removeClass(z_.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){!this.isBufferControlPaused&&this.addClass(z_.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(jw.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.isBufferControlPaused=!1,this.updateAcc("ended"),this.addClass(z_.ENDED)}},{key:"onError",value:function(){this.isBufferControlPaused=!1,this.isError=!0,this.updateAcc("error"),this.removeClass(z_.NOT_ALLOW_AUTOPLAY),this.removeClass(z_.NO_START),this.removeClass(z_.ENTER),this.removeClass(z_.LOADING),this.addClass(z_.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(z_.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&jw.clearTimeout(this,this.waitTimer),this.removeClass(z_.LOADING),this.removeClass(z_.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&jw.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=jw.setTimeout(this,(function(){e.addClass(z_.LOADING),jw.clearTimeout(e,e.waitTimer),e.waitTimer=null}),200)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[z_.NO_START,z_.PAUSED,z_.ENDED,z_.ERROR,z_.REPLAY,z_.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.getVideoSize(),(this.waitTimer||this.hasClass(z_.LOADING))&&this.video.readyState>2&&(!this.isBufferControlPaused&&this.removeClass(z_.LOADING),jw.clearTimeout(this,this.waitTimer),this.waitTimer=null),this.paused||this.isPlaying||!this.duration||(this.isPlaying=!0,this.emit(yC)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===jw.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"onBufferControl",value:function(e){this.isPlaying&&("waiting"===e.type?(this.isBufferControlPaused=!0,this.addClass(z_.LOADING),this.removeClass(z_.PAUSED)):"playing"===e.type&&(this.isBufferControlPaused=!1,this.removeClass(z_.LOADING),this.paused&&this.addClass(z_.PAUSED)))}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.video&&t&&e){var i="String"===jw.typeOf(e)?e:e.type||"";"switch_play_pause"===t&&("Undefined"===jw.typeOf(n.paused)&&(n.paused=this.paused),n.isFirstStart=!this.playing),this.emit(FC,rx({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=parseInt(1e3*(e||this.video.currentTime||0),10),i=t.length,r=0;r<i;r++)if(parseInt(1e3*t.start(r),10)+200<=n&&parseInt(1e3*t.end(r),10)-200>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).map((function(n){if("plugins"!==n){t.config[n]=e[n];var i=t.plugins[n.toLowerCase()];i&&"Function"===jw.typeOf(i.setConfig)&&i.setConfig(e[n])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this._currentTime=0,this._duration=0,this.isPlaying=!1,this.setConfig(e),v_(this,"playnext",(function(){t.start(),t.emit(DC,e)}))}},{key:"getVideoSize",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,u=a.width,l=a.height-c,f=parseInt(n/i*1e3,10),h=parseInt(u/l*1e3,10),d=u,p=l,g={};"auto"===o&&h>f||"fixWidth"===o?(p=u/f*1e3,this.config.fluid?g.paddingTop="".concat(100*p/d,"%"):g.height="".concat(p+c,"px")):("auto"===o&&h<f||"fixHeight"===o)&&(d=f*l/1e3,g.width="".concat(d,"px")),this.fullscreen||this.isCssfullScreen||Object.keys(g).map((function(t){e.root.style[t]=g[t]})),("fillHeight"===s&&h<f||"fillWidth"===s&&h>f)&&this.setAttribute("data-xgfill","cover");var v={videoScale:f,vWidth:d,vHeight:p,cWidth:d,cHeight:p+c};this.emit(OC,v)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.video.updateObjectPosition?this.video.updateObjectPosition(e,t):this.video.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&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.map((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:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.video||!this.video.getVideoPlaybackQuality)return e;var t=this.video.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){0!==nx.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,K_.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(nx.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return Yw}},{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=au(Go(n.prototype),"readyState",this);return this.i18n[e]||e}},{key:"error",get:function(){var e=au(Go(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){var e=au(Go(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:"avgSpeed",get:function(){return cx},set:function(e){cx=e}},{key:"realTimeSpeed",get:function(){return ax},set:function(e){ax=e}},{key:"hook",value:function(e,t){return u_.call.apply(u_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return l_.call.apply(l_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return f_.call.apply(f_,[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 h_.call.apply(h_,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return d_.call.apply(d_,[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),K_.setCurrentUserActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Fw.config.debug},set:function(e){Fw.config.debug=e}},{key:"pluginsManager",get:function(){return K_}},{key:"getCurrentUserActivePlayerId",value:function(){return K_.getCurrentUseActiveId()}},{key:"setCurrentUserActive",value:function(e,t){K_.setCurrentUserActive(e,t)}},{key:"isHevcSupported",value:function(){return zw.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return zw.probeConfigSupported(e)}},{key:"install",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]||(n.plugins[e]=t)}},{key:"use",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]=t}}]),n}(XC);function lx(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 fx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}function hx(){return(new Date).getTime()}Vo(ux,"defaultPreset",null),Vo(ux,"XgVideoProxy",null);var dx="loadstart",px="loadeddata",gx="firstFrame",vx="waitingStart",yx="waitingEnd",mx="seekStart",kx="seekEnd",bx="waitingEndExt",wx="seekEndEndExt",Cx=function(e){jo(n,e);var t=fx(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(Fw.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),Vo(Uo(e),"_onAutoplayStart",(function(){Fw.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),Vo(Uo(e),"_onReset",(function(){e._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},e.vt=0,e.pt=0,e.fvt=0,e.newPointTime=hx(),e.loadedCostTime=0,e.startCostTime=0,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&jw.clearTimeout(Uo(e),e._waitTimer),e._waittTimer&&jw.clearTimeout(Uo(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),Vo(Uo(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=hx(),e.emitLog(mx,{start:hx()}))})),Vo(Uo(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),Vo(Uo(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=hx(),e.fixedWaitingStart=hx(),e._waitType=1,e.emitLog(vx,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),Vo(Uo(e),"_onWaiting",(function(){!e._isWaiting&&e.vt&&(e._isWaiting=!0,e.vt?e.seekingStart?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=hx(),e._waitTimer=jw.setTimeout(Uo(e),(function(){e._isWaiting&&(e.waitingStart=hx(),jw.clearTimeout(Uo(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(vx,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),Vo(Uo(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),Vo(Uo(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.newPointTime=hx(),this.loadedCostTime=0,this.startCostTime=0,this.on(fC,(function(){var t=e._state,n=t.autoplayStart,i=t.isFFSend;e.startCostTime=hx()-e.newPointTime,Fw.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(n," isFFSend:").concat(i," startCostTime:").concat(e.startCostTime," newPointTime").concat(e.newPointTime)),i||(!t.isLs&&e.emitLog(dx,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=hx(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(cC,(function(){e.vt=hx(),e.fvt=e.vt-e.pt,e.loadedCostTime=e.vt-e.newPointTime;var t=e._state,n=t.isTimeUpdate,i=t.isFFSend,r=t.autoplayStart;Fw.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate," loadedCostTime:").concat(e.loadedCostTime)),(n||r)&&e._sendFF("loadedData"),i||e.emitLog(px,{}),e.suspendWaitingStatus("loadeddata")})),this.on(tC,this._onSeeking),this.on(nC,this._onSeeked),this.on(wC,(function(){e.endState("destroy")})),this.on(Zw,(function(){e.endState("ended")})),this.on(Qw,(function(){e.endState("pause")})),this.on(CC,(function(){e.endState("urlChange"),Fw.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([Jw,oC],this._onPlaying),this.on(rC,this._onWaiting),this.on(eC,this._onError),this.on(BC,(function(){Fw.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(yC,this._onAutoplayStart),this.off(iC,this._onTimeupdate),this.once(yC,this._onAutoplayStart),this.once(iC,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=hx();var t=this._state,n=t.isFFLoading,i=t.isFFSend;Fw.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!i)),this.vt>0&&n&&!i&&(Fw.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(gx,{fvt:this.fvt,costTime:this.fvt,vt:this.vt,startCostTime:this.startCostTime,loadedCostTime:this.loadedCostTime}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&jw.clearTimeout(this,this._waittTimer),this._waittTimer=jw.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),jw.clearTimeout(e,e._waittTimer),e._waittTimer=null}),this.config.waitTimeout)}},{key:"endState",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=i-n,o=!(i>0&&n>0&&r<1);Fw.logInfo("[xgLogger]".concat(this.player.playerId," endState"),"".concat(e," duration - currentTime:").concat(r," _emit:").concat(o)),this.suspendWaitingStatus(e,o),this.suspendSeekingStatus(e,o)}},{key:"suspendSeekingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.seekingStart){var n=hx(),i=n-this.seekingStart;this.seekingStart=0;var r=t?kx:wx;this.emitLog(r,{end:n,costTime:i,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._waitTimer&&(jw.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(jw.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var n=hx(),i=n-this.waitingStart,r=n-this.fixedWaitingStart,o=this.config.waitTimeout;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0;var s=t?yx:bx;this.emitLog(s,{fixedCostTime:r>o?o:r,costTime:i>o?o:i,type:"loadeddata"===e?1:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var n=this.player;this.emit(NC,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lx(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({t:hx(),host:jw.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:e,currentTime:this.player.currentTime,readyState:n.video.readyState,networkState:n.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:1e4}}}]),n}(A_);function _x(){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 xx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var Sx=function(e){jo(n,e);var t=xx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"registerIcons",value:function(){return{replay:_x}}},{key:"afterCreate",value:function(){var e=this;A_.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayHandler",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(Zw,(function(){if(e.playerConfig.loop||jw.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($w,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),jw.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}(A_),Tx=Sx;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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var Px=function(e){jo(n,e);var t=Ex(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){jw.addClass(this.root,"hide")}},{key:"show",value:function(){jw.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(Zw,(function(){e.isEndedShow&&jw.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(iC,(function(){e.onTimeUpdate()})),this.on(CC,(function(){jw.removeClass(e.root,"hide"),jw.addClass(e.root,"xg-showplay"),e.once(iC,(function(){e.onTimeUpdate()}))}))):this.on($w,(function(){jw.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?jw.removeClass(this.root,"xg-showplay"):this.once(iC,(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}(A_),Rx=Px;function Ox(){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 Lx(){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 Ix(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var Ax={};var Dx=function(e){jo(n,e);var t=Ix(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onPlayerReset",(function(){i.autoPlayStart=!1;var e="auto"===i.config.mode?"auto-hide":"hide";i.setAttr("data-state","play"),jw.removeClass(i.root,e),i.show()})),Vo(Uo(i),"onAutoplayStart",(function(){if(!i.autoPlayStart){var e="auto"===i.config.mode?"auto-hide":"hide";jw.addClass(i.root,e),i.autoPlayStart=!0,i.onPlayPause("play")}})),i.autoPlayStart=!1,i._lastState="",i}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(gC,(function(){n&&(n.lang&&"en"===n.lang?jw.addClass(t.root,"lang-is-en"):"jp"===n.lang&&jw.addClass(t.root,"lang-is-jp"))})),this.on(yC,this.onAutoplayStart),n.autoplay||this.show(),this.on(mC,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),jw.removeClass(e.root,t),e.show()})),this.on($w,(function(){e.onPlayPause("play")})),this.on(Qw,(function(){e.onPlayPause("pause")})),this.on(xC,(function(){e.onPlayPause(t.paused?"pause":"play")})),this.on(BC,(function(){e.onPlayerReset()})),this.clickHandler=this.hook("click",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause")}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:Ox,class:"xg-icon-play"},startPause:{icon:Lx,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(){jw.addClass(this.root,"hide")}},{key:"show",value:function(){jw.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){jw.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){jw.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};Ax[e]&&window.clearTimeout(Ax[e].id),Ax[e]={},n.start&&n.start(),Ax[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(Ax[e].id),delete Ax[e]}),t)}("pauseplay",400,{start:function(){jw.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){jw.removeClass(t.root,"interact"),!e&&t.hide()}})}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.isReady)&&(!this.player.paused&&t.isPlaying?t.pause():t.play())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(n.isPlaying&&this.autoPlayStart&&("pause"!==e||this._lastState!==e&&!n.isBufferControlPaused)){if(this._lastState=e,"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(Ax).map((function(e){window.clearTimeout(Ax[e].id),delete Ax[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}(A_),Mx=Dx;function Nx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var Fx=function(e){jo(n,e);var t=Nx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=jw.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}(A_),Bx=Fx;function jx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var Ux=function(e){jo(n,e);var t=jx(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(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:P_.CONTROLS_RIGHT,index:10}}}]),n}(A_),Hx=Ux;function Gx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}function Vx(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var Wx=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],Kx=Wx.length;function zx(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===Ao(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<Kx;t++)e[Wx[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<Kx;r++){var o=Wx[r],s=t[o],a=parseFloat(s);n[o]=Number.isNaN(a)?0:a}var c=n.paddingLeft+n.paddingRight,u=n.paddingTop+n.paddingBottom,l=n.marginLeft+n.marginRight,f=n.marginTop+n.marginBottom,h=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,p=i,g=Vx(t.width);!1!==g&&(n.width=g+(p?0:c+h));var v=Vx(t.height);return!1!==v&&(n.height=v+(p?0:u+d)),n.innerWidth=n.width-(c+h),n.innerHeight=n.height-(u+d),n.outerWidth=n.width+l,n.outerHeight=n.height+f,n}}function Yx(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.identifier===t)return i}}var Xx="dragStart",qx="dragMove",$x="dragEnded",Jx={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},Zx=function(e){jo(n,e);var t=Gx(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Fo(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):Ho(i)}return No(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)]),Jx[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=Jx[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=Yx(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=Yx(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=Yx(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=zx(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(Xx,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit($x)),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(qx,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,n){return t+n<0?0-n:"x"===e&&t+n>this.startPos.maxX?this.startPos.maxX-n:"y"===e&&t+n>this.startPos.maxY?this.startPos.maxY-n:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var n=t.split(","),i=0===t.indexOf("matrix3d")?12:4,r=parseInt(n[i],10),o=parseInt(n[i+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var n=zx(this._root.parentNode);return n?parseFloat(e)/100*n[t]:0}return parseInt(e,10)}}]),n}(im);function Qx(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var eS=function(e){jo(n,e);var t=Qx(n);function n(e){var i;Fo(this,n),Vo(Uo(i=t.call(this,e)),"onCancelClick",(function(e){i.exitMini(),i.isClose=!0})),Vo(Uo(i),"onCenterClick",(function(e){var t=Uo(i).player;t.paused?t.play():t.pause()})),Vo(Uo(i),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var t=parseInt(jw.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=Uo(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 No(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(Qw,(function(){e.setAttr("data-state","pause")})),this.on($w,(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(Hx,n,Hx.pluginName)}var i=jw.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new Zx(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:Ox,class:"xg-icon-play"},pause:{icon:Lx,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={},jw.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(EC,!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;jw.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(EC,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=jw.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}(A_);function tS(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var nS={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},iS=["videoClick","videoDbClick"],rS=function(e){jo(n,e);var t=tS(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var n=Uo(e),i=n.player,r=n.playerConfig;i.isActive||(i.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&i.video.focus())})),Vo(Uo(e),"onMouseEnter",(function(t){var n=Uo(e),i=n.playerConfig,r=n.player;!i.closeFocusVideoFocus&&r.video.focus(),i.closeDelayBlur?r.focus({autoHide:!1}):r.focus()})),Vo(Uo(e),"onMouseLeave",(function(t){var n=e.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime,o=n.closeDelayBlur;i||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur())})),Vo(Uo(e),"onVideoClick",(function(t){var n=Uo(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--,v_(Uo(e),iS[0],(function(t,n){e.switchPlayPause(n.e)}),{e:t,paused:i.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),Vo(Uo(e),"onVideoDblClick",(function(t){var n=Uo(e),i=n.player;n.playerConfig.closeVideoDblclick||!t.target||t.target!==i.video&&t.target!==i.video.__canvas||(e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),v_(Uo(e),iS[1],(function(t,n){e.emitUserAction(n.e,"switch_fullscreen",{fullscreen:i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()}),{e:t,fullscreen:i.fullscreen})))})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,iS.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===zw.device&&!zw.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,n=t.video,i=t.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(nS).map((function(t){i.addEventListener(t,e[nS[t]],!1)})),r&&n&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause"),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),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(nS).map((function(t){i.removeEventListener(t,e[nS[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n}(b_),oS=di,sS=zo,aS=_,cS=RangeError,uS=function(e){var t=sS(aS(this)),n="",i=oS(e);if(i<0||i==1/0)throw cS("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},lS=lr,fS=k,hS=di,dS=Dg,pS=uS,gS=d,vS=RangeError,yS=String,mS=Math.floor,kS=fS(pS),bS=fS("".slice),wS=fS(1..toFixed),CS=function(e,t,n){return 0===t?n:t%2==1?CS(e,t-1,n*e):CS(e*e,t/2,n)},_S=function(e,t,n){for(var i=-1,r=n;++i<6;)r+=t*e[i],e[i]=r%1e7,r=mS(r/1e7)},xS=function(e,t){for(var n=6,i=0;--n>=0;)i+=e[n],e[n]=mS(i/t),i=i%t*1e7},SS=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var i=yS(e[t]);n=""===n?i:n+kS("0",7-i.length)+i}return n};lS({target:"Number",proto:!0,forced:gS((function(){return"0.000"!==wS(8e-5,3)||"1"!==wS(.9,0)||"1.25"!==wS(1.255,2)||"1000000000000000128"!==wS(0xde0b6b3a7640080,0)}))||!gS((function(){wS({})}))},{toFixed:function(e){var t,n,i,r,o=dS(this),s=hS(e),a=[0,0,0,0,0,0],c="",u="0";if(s<0||s>20)throw vS("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return yS(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*CS(2,69,1))-69)<0?o*CS(2,-t,1):o/CS(2,t,1),n*=4503599627370496,(t=52-t)>0){for(_S(a,0,n),i=s;i>=7;)_S(a,1e7,0),i-=7;for(_S(a,CS(10,i,1),0),i=t-1;i>=23;)xS(a,1<<23),i-=23;xS(a,1<<i),_S(a,1,1),xS(a,2),u=SS(a)}else _S(a,0,n),_S(a,1<<-t,0),u=SS(a)+kS("0",s);return u=s>0?c+((r=u.length)<=s?"0."+kS("0",s-r)+u:bS(u,0,r-s)+"."+bS(u,r-s)):c+u}});var TS="press",ES="pressend",PS="doubleclick",RS="click",OS="touchmove",LS="touchstart",IS="touchend",AS={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},DS={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function MS(e){return e&&e.length>0?e[e.length-1]:null}function NS(e){var t=navigator.userAgent;/(?:iPhone|iPad)/.test(t)&&e.cancelable&&e.preventDefault()}var FS=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};Fo(this,e),Vo(this,"onTouchStart",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&NS(e);var r=MS(e.touches);t.x=r?parseInt(r.pageX,10):e.pageX,t.y=r?parseInt(r.pageX,10):e.pageX,t.start=!0,n.__setPress(e),i.addEventListener(n.events.end,n.onTouchEnd),i.addEventListener(n.events.cancel,n.onTouchCancel),i.addEventListener(n.events.move,n.onTouchMove),n.trigger(LS,e)})),Vo(this,"onTouchCancel",(function(e){n.onTouchEnd(e)})),Vo(this,"onTouchEnd",(function(e){var t=n._pos,i=n.root;n.config.needPreventDefault&&NS(e),n.__clearPress(),i.removeEventListener(n.events.cancel,n.onTouchCancel),i.removeEventListener(n.events.end,n.onTouchEnd),i.removeEventListener(n.events.move,n.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&n.trigger(ES,e),n.trigger(IS,e),!t.press&&!t.moving&&n.__setDb(e),t.press=!1,t.start=!1,t.moving=!1})),Vo(this,"onTouchMove",(function(e){var t=n._pos,i=n.config,r=MS(e.touches),o=r?parseInt(r.pageX,10):e.pageX,s=r?parseInt(r.pageY,10):e.pageX,a=o-t.x,c=s-t.y;Math.abs(c)<i.miniStep&&Math.abs(a)<i.miniStep||(n.__clearPress(),t.press&&n.trigger(ES,e),t.press=!1,t.moving=!0,n.trigger(OS,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?DS:AS,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return No(e,[{key:"_initEvent",value:function(){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(TS,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(PS,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(RS,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:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).forEach((function(n){e.root.removeEventListener(n,e[t[n]])}))}}]),e}(),BS=FS;function jS(){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 US(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var HS="auto",GS="seeking",VS="playbackrate",WS=["videoClick","videoDbClick"],KS=function(e){jo(n,e);var t=US(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onTouchStart",(function(e){var t=Uo(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,jw.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),i.find(".xg-dur").innerHTML=jw.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 u=parseInt(a.pageX-o.left,10),l=parseInt(a.pageY-o.top,10);o.x=90===n.rotateDeg?l:u,o.y=90===n.rotateDeg?u:l,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}})),Vo(Uo(i),"onTouchMove",(function(e){var t=i.getTouche(e),n=Uo(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,u=parseInt(t.pageX-r.left,10),l=parseInt(t.pageY-r.top,10),f=90===s.rotateDeg?l:u,h=90===s.rotateDeg?u:l;if(Math.abs(f-r.x)>a||Math.abs(h-r.y)>a){var d=f-r.x,p=h-r.y,g=r.scope;if(-1===g&&(0===(g=i.checkScope(f,h,d,p,r))&&(c?s.blur():s.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*s.currentTime,10)+1e3*i.timeOffset)),r.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;e.cancelable&&e.preventDefault(),i.executeMove(d,p,g,r.width,r.height),r.x=f,r.y=h}}})),Vo(Uo(i),"onTouchEnd",(function(e){var t=Uo(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(),jw.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction(HS))})),Vo(Uo(i),"onRootTouchMove",(function(e){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.pos.isStart?i.onTouchMove(e):i.onTouchStart(e))})),Vo(Uo(i),"onRootTouchEnd",(function(e){if(i.pos.isStart&&i.checkIsRootTarget(e)){e.stopPropagation(),i.onTouchEnd(e);var t=i.player.controls;t&&t.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 No(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:jS,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;WS.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,n=this.config,i=this.player;!0===t.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),jw.isUndefined(t.disableGesture)||(n.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=jw.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new BS(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(sC,(function(){var t=e.player,n=e.config;1e3*t.duration<n.moveDuration&&(n.moveDuration=1e3*t.duration)})),this.on([oC,Zw],(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).forEach((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(HS)})))}}},{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&&jw.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:zw.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,i=this.player,r=this.config,o=(n.time-this.timeOffset)/1e3;if(0===e)i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500);this.changeAction(HS)}},{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:"clickHandler",value:function(e){var t=this.player,n=this.config,i=this.playerConfig;t.isPlaying?!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()):i.closeVideoClick||(this.emitUserAction("click","switch_play_pause"),t.play())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.isPlaying&&(this.emitUserAction("dblclick","switch_play_pause"),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;v_(this,WS[0],(function(e,n){t.clickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;v_(this,WS[1],(function(e,n){t.dbClickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onPress",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction(VS))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{from:i.playbackRate,to:t.rate}),i.playbackRate=t.rate,t.rate=1,this.changeAction(HS))}},{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(GS);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=jw.format(this.duration),this.find(".xg-cur").innerHTML=jw.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?jw.removeClass(this.find(".xg-seek-show"),"xg-back"):jw.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.hasStart)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{stopPropagation:!0,index:0,disableGesture:!1,gestureX:!0,gestureY:!0,updateGesture:function(){},onTouchStart:function(){},onTouchEnd:function(){},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}(A_),zS=KS;function YS(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 XS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?YS(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YS(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qS(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}lr({target:"String",proto:!0},{repeat:uS});var $S=function(e){jo(n,e);var t=qS(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){if(e.player){var n,i,r=t||window.event,o=r.keyCode,s=Uo(e)._keyState;if(!t.repeat){if(s.isKeyDown||e.config.disable||e.config.disableBodyTrigger||!e.player.isUserActive&&!e.config.isIgnoreUserActive||!e.checkIsVisible()||r.metaKey||r.altKey||r.ctrlKey)return;(r.target===document.body||e.config.isGlobalTrigger&&(n=r.target,"INPUT"!==(i=n.tagName)&&"TEXTAREA"!==i&&!n.isContentEditable))&&e.checkCode(o,!0)&&(s.isBodyKeyDown=!0),document.addEventListener("keyup",e.onBodyKeyUp)}s.isBodyKeyDown&&e.handleKeyDown(r)}})),Vo(Uo(e),"onBodyKeyUp",(function(t){e.player&&(document.removeEventListener("keyup",e.onBodyKeyUp),e.handleKeyUp(t))})),Vo(Uo(e),"onKeydown",(function(t){if(e.player){var n=t||window.event,i=Uo(e)._keyState;if(!n.repeat){if(e.config.disable||e.config.disableRootTrigger||n.metaKey||n.altKey||n.ctrlKey)return;if(!e.player.isUserActive&&!e.config.isIgnoreUserActive)return;!n||37!==n.keyCode&&!e.checkCode(n.keyCode)||n.target!==e.player.root&&n.target!==e.player.video&&n.target!==e.player.controls.el||(i.isKeyDown=!0),e.player.root.addEventListener("keyup",e.onKeyup)}i.isKeyDown&&e.handleKeyDown(n)}})),Vo(Uo(e),"onKeyup",(function(t){e.player&&(e.player.root.removeEventListener("keyup",e.onKeyup),e.handleKeyUp(t))})),e}return No(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","pressAction","disablePress","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,disablePress:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,disablePress:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,disablePress:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disablePress:!1,disable:!1},right:{keyCode:39,action:"seek",pressAction:"changePlaybackRate",disablePress:!1,disable:!1},esc:{keyCode:27,action:"exitFullscreen",disablePress:!0,disable:!1}},this.mergekeyCodeMap(),this._keyState={isKeyDown:!1,isBodyKeyDown:!1,isPress:!1,tt:0,playbackRate:0},this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"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;if(!(t.volume<=0)){var 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;if(!(t.volume>=1)){var 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=e.repeat&&this.seekStep>=4?parseInt(this.seekStep/2,10):this.seekStep,s={currentTime:{from:n,to:r=n+o<=i?n+o:i}};this.emitUserAction(e,"seek",{props:s}),this.player.currentTime=r}},{key:"seekBack",value:function(e){var t=this.player.currentTime,n=e.repeat?parseInt(this.seekStep/2,10):this.seekStep,i=0;t-n>=0&&(i=t-n);var r={currentTime:{from:t,to:i}};this.emitUserAction(e,"seek",{props:r}),this.player.currentTime=i}},{key:"changePlaybackRate",value:function(e){var t=this._keyState,n=this.config,i=this.player;0===t.playbackRate&&(t.playbackRate=i.playbackRate,i.playbackRate=n.playbackRate)}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,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:"handleKeyDown",value:function(e){var t=this._keyState;if(e.repeat){t.isPress=!0;var n=Date.now();if(n-t.tt<200)return;t.tt=n}!function(e){e.preventDefault(),e.returnValue=!1}(e),this.handleKeyCode(e.keyCode,e,t.isPress)}},{key:"handleKeyUp",value:function(e){var t=this._keyState;t.playbackRate>0&&(this.player.playbackRate=t.playbackRate,t.playbackRate=0),t.isKeyDown=!1,t.isPress=!1,t.tt=0}},{key:"handleKeyCode",value:function(e,t,n){for(var i=Object.keys(this.keyCodeMap),r=0;r<i.length;r++){var o=this.keyCodeMap[i[r]],s=o.action,a=o.keyCode,c=o.disable,u=o.pressAction,l=o.disablePress;if(a===e){if(!(c||n&&l)){var f=n&&u||s;"function"==typeof f?s(t,this.player,n):"string"==typeof f&&"function"==typeof this[f]&&this[f](t,this.player,n),this.emit(MC,XS({key:i[r],target:t.target,isPress:n},this.keyCodeMap[i[r]]))}break}}}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown),this.player.root.removeEventListener("keyup",this.onKeyup),document.removeEventListener("keyup",this.onBodyKeyUp)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!1,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!1,keyCodeMap:{},disable:!1,playbackRate:2,isIgnoreUserActive:!1}}}]),n}(b_),JS=$S;function ZS(){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 QS(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var eT=function(e){jo(n,e);var t=QS(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"registerIcons",value:function(){return{loadingIcon:ZS}}},{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:P_.ROOT}}}]),n}(A_),tT=eT,nT=lr,iT=$s.findIndex,rT=xv,oT="findIndex",sT=!0;oT in[]&&Array(1)[oT]((function(){sT=!1})),nT({target:"Array",proto:!0,forced:sT},{findIndex:function(e){return iT(this,e,arguments.length>1?arguments[1]:void 0)}}),rT(oT);var aT=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],cT=function(){function e(t){Fo(this,e),this.fragments=t.fragments||[],0===this.fragments.length&&this.fragments.push({percent:1}),this._callBack=t.actionCallback,this.fragConfig={fragFocusClass:t.fragFocusClass||"inner-focus-point",fragAutoFocus:!!t.fragAutoFocus,fragClass:t.fragClass||""},this.style=t.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0,this.focusIndex=-1}return No(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=e;var n=0,i=this.fragments;this.fragments=i.map((function(e){return e.start=parseInt(n,10),e.end=parseInt(n+e.percent*t.duration,10),e.duration=parseInt(e.percent*t.duration,10),n+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},n=this.progressList,i=this.fragments;if(!(n.length<1)){var r=t.newIndex,o=t.curIndex,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:"updateFocus",value:function(e){if(this.fragConfig.fragAutoFocus&&!(this.fragments.length<2))if(e){var t=this.findIndex(1e3*e.currentTime,this.focusIndex);if(t>=0&&t!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(t);var n={index:t,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=t,this._callBack&&this._callBack(n)}}else if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var i={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(i),this.focusIndex=-1}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==jw.typeOf(e.played)){var r=this.findIndex(1e3*e.played,n);if(r<0)return;this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==jw.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,i);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var n=this.fragments;if(!n||0===n.length)return-1;if(1===n.length)return 0;if(t>-1&&t<n.length&&e>n[t].start&&e<n[t].end)return t;if(e>n[n.length-1].start)return n.length-1;for(var i=0;i<n.length;i++)if(e>n[i].start&&e<=n[i].end){t=i;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(jw.hasClass(e[t],this.fragConfig.fragFocusClass))return{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"findFragment",value:function(e){var t=this.root.children;return e<0||e>=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)jw.removeClass(e[t],this.fragConfig.fragFocusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return jw.addClass(t[e],this.fragConfig.fragFocusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"reset",value:function(e){var t=this;if(Object.keys(this.fragConfig).forEach((function(n){void 0!==e[n]&&(t.fragConfig[n]=e[n])})),e.fragments){if(this.fragments=0===e.fragments.length?[{percent:1}]:e.fragments,this.updateDuration(this.duration),this.playedIndex=0,this.cachedIndex=0,this.root)for(var n=this.root.children;n.length>0;)this.root.removeChild(n[0]);this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(this.root||(this.root=jw.createDom("xg-inners","",{},"progress-list")),this.fragments){var n=this.fragConfig,i=n.fragClass,r=n.fragFocusClass;this.progressList=this.fragments.map((function(n){var o=jw.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?r:""," xgplayer-progress-inner ").concat(i));return e.root.appendChild(o),aT.forEach((function(t){o.appendChild(jw.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:o.children[0],played:o.children[1]}}))}return this.root}}]),e}();function uT(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 lT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uT(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var hT={POINT:"inner-focus-point",HIGHLIGHT:"inner-focus-highlight"},dT=function(e){jo(n,e);var t=fT(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onMoveOnly",(function(e,t){var n=Uo(i),r=n.pos,o=n.config,s=n.player,a=t;if(e){jw.event(e);var c=jw.getEventPos(e,s.zoom),u=90===s.rotateDeg?c.clientY:c.clientX;if(r.moving&&Math.abs(r.x-u)<o.miniMoveStep)return;r.moving=!0,r.x=u,a=i.computeTime(e,u)}i.triggerCallbacks("dragmove",a,e),i._updateInnerFocus(a)})),Vo(Uo(i),"onBodyClick",(function(e){e.preventDefault(),e.stopPropagation()})),Vo(Uo(i),"_mouseDownHandler",(function(e,t){i._state.time=t.currentTime,i.updateWidth(t.currentTime,t.percent,0),i._updateInnerFocus(t)})),Vo(Uo(i),"_mouseUpHandler",(function(e,t){Uo(i).pos.moving&&i.updateWidth(t.currentTime,t.percent,2)})),Vo(Uo(i),"_mouseMoveHandler",(function(e,t){var n=Uo(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.emitUserAction("drag","dragstart",t)),i.updateWidth(t.currentTime,t.percent,1),i.triggerCallbacks("dragmove",t,e),i._updateInnerFocus(t)})),Vo(Uo(i),"onMouseDown",(function(e){var t=Uo(i),n=t._state,r=t.player,o=t.pos,s=t.config,a=t.playerConfig,c=jw.getEventPos(e,r.zoom),u=90===r.rotateDeg?c.clientY:c.clientX;if(!(r.isMini||s.closeMoveSeek||!a.allowSeekAfterEnded&&r.ended)){e.stopPropagation(),i.focus(),jw.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),jw.checkIsFunction(s.onMoveStart)&&s.onMoveStart(),jw.event(e),o.x=u,o.isDown=!0,o.moving=!1,n.prePlayTime=r.currentTime,r.focus({autoHide:!1}),i.isProgressMoving=!0,jw.addClass(i.progressBtn,"active");var l=i.computeTime(e,u);return l.prePlayTime=n.prePlayTime,i._mouseDownHandlerHook(e,l),"touchstart"===e.type?(i.root.addEventListener("touchmove",i.onMouseMove),i.root.addEventListener("touchend",i.onMouseUp)):(i.unbind("mousemove",i.onMoveOnly),document.addEventListener("mousemove",i.onMouseMove,!1),document.addEventListener("mouseup",i.onMouseUp,!1),r.root.addEventListener("click",i.onBodyClick,!1)),!0}})),Vo(Uo(i),"onMouseUp",(function(e){var t=Uo(i),n=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=t._state;e.stopPropagation(),e.preventDefault(),jw.checkIsFunction(s.enableSwipeHandler)&&s.enableSwipeHandler(),jw.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),jw.event(e),jw.removeClass(i.progressBtn,"active");var c=i.computeTime(e,o.x);c.prePlayTime=a.prePlayTime,o.moving?(i.triggerCallbacks("dragend",c,e),i.emitUserAction("drag","dragend",c)):(i.triggerCallbacks("click",c,e),i.emitUserAction("click","click",c)),i._mouseUpHandlerHook(e,c),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,a.prePlayTime=0,a.time=0,"touchend"===e.type?(i.root.removeEventListener("touchmove",i.onMouseMove),i.root.removeEventListener("touchend",i.onMouseUp),i.blur()):(document.removeEventListener("mousemove",i.onMouseMove,!1),document.removeEventListener("mouseup",i.onMouseUp,!1),n.root.removeEventListener("click",i.onBodyClick,!1),o.isEnter?"mobile"!==s.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(e)),jw.setTimeout(Uo(i),(function(){i.resetSeekState()}),10),n.focus()})),Vo(Uo(i),"onMouseMove",(function(e){var t=Uo(i),n=t._state,r=t.pos,o=t.player,s=t.config;jw.checkTouchSupport()&&e.preventDefault(),jw.event(e);var a=jw.getEventPos(e,o.zoom),c=90===o.rotateDeg?a.clientY:a.clientX,u=Math.abs(r.x-c);if(!(r.moving&&u<s.miniMoveStep||!r.moving&&u<s.miniStartStep)){r.x=c;var l=i.computeTime(e,c);l.prePlayTime=n.prePlayTime,i._mouseMoveHandlerHook(e,l)}})),Vo(Uo(i),"onMouseOut",(function(e){i.triggerCallbacks("mouseout",null,e)})),Vo(Uo(i),"onMouseOver",(function(e){i.triggerCallbacks("mouseover",null,e)})),Vo(Uo(i),"onMouseEnter",(function(e){var t=Uo(i),n=t.player,r=t.pos;if(!(r.isDown||r.isEnter||n.isMini||!n.config.allowSeekAfterEnded&&n.ended)){r.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),jw.event(e);var o=jw.getEventPos(e,n.zoom),s=90===n.rotateDeg?o.clientY:o.clientX,a=i.computeTime(e,s);i.triggerCallbacks("mouseenter",a,e),i.focus()}})),Vo(Uo(i),"onMouseLeave",(function(e){i.triggerCallbacks("mouseleave",null,e),i.unlock(),i._updateInnerFocus(null)})),Vo(Uo(i),"onVideoResize",(function(){var e=i.pos,t=e.x,n=e.isDown;if(e.isEnter&&!n){var r=i.computeTime(null,t);i.onMoveOnly(null,r)}})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0,prePlayTime:-1},i._disableBlur=!1,i}return No(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:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.progress&&(e.config.disable=!e.player.config.progress)}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&0!==t.length||(t=[{percent:1}]);var i=lT(lT({fragments:t},n),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(i):(this.innerList=new cT(i),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)})))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){var e=this;if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer");var t=this.config,n=t.fragFocusClass,i=t.fragAutoFocus,r=t.fragClass;this._initInner(this.config.fragments,{fragFocusClass:n,fragAutoFocus:i,fragClass:r,style:this.playerConfig.commonStyle||{}}),"mobile"===zw.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(sC,(function(){e.onMouseLeave()})),this.on(iC,(function(){e.onTimeupdate()})),this.on(nC,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(lC,(function(){e.onCacheUpdate()})),this.on(Zw,(function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0})),this.on(hC,(function(){e.onReset()})),this.on(OC,(function(){e.onVideoResize()})),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var t=this,n=null;Object.keys(e).forEach((function(i){t.config[i]=e[i],"fragments"===i&&(n=e[i])})),n&&this._initInner(n,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===Ao(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:"unlock",value:function(){var e=this.player,t=this.pos;t.isEnter=!1,e.isMini||(this.unbind("mousemove",this.onMoveOnly),t.isDown?this.unbind("mouseleave",this.onMouseLeave):this.blur())}},{key:"bindDomEvents",value:function(){var e=this.player,t=e.controls,n=e.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",jw.stopPropagation),t.center&&t.center.addEventListener("touchend",jw.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),jw.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),jw.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,n){var i=this.config,r=this.player;if(!i.isCloseClickSeek||0!==n){var o=e>=r.duration?r.duration-i.endedDiff:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==n||i.isDragingSeek&&"audio"!==r.videoConfig.mediaType)&&(this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o))}}},{key:"computeTime",value:function(e,t){var n,i,r=this.player,o=this.root.getBoundingClientRect(),s=o.width,a=o.height,c=o.top,u=o.left,l=t;90===r.rotateDeg?(n=a,i=c):(n=s,i=u);var f=l-i,h=(f=f>n?n:f<0?0:f)/n;return{percent:h=h<0?0:h>1?1:h,currentTime:parseInt(h*this.duration*1e3,10)/1e3,offset:f,width:n,left:i,e:e}}},{key:"updateTime",value:function(e){var t=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var i=t.plugins.time;i&&i.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,n=this._state,i=this.duration;if(!(t.isSeeking&&t.video.seeking||this.isProgressMoving)&&t.hasStart){if(n.now>-1){var r=parseInt(1e3*n.now,10)-parseInt(1e3*t.currentTime,10);if(0===n.direc&&r>300||1===n.direc&&r>-300)return void(n.now=-1);n.now=-1}var o=this.timeOffset+t.currentTime;o=jw.adjustTimeByDuration(o,i,e),this.innerList.update({played:o},i),this.progressBtn.style.left="".concat(o/i*100,"%");var s=this.player.plugins.miniprogress;s&&s.update({played:o},i)}}},{key:"onCacheUpdate",value:function(e){var t=this.player,n=this.duration;if(t){var i=t.bufferedPoint.end;i=jw.adjustTimeByDuration(i,n,e),this.innerList.update({cached:i},n);var r=this.player.plugins.miniprogress;r&&r.update({cached:i},n)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var n=this.domEventType;"touch"!==n&&"compatible"!==n||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",jw.stopPropagation),t.center&&t.center.removeEventListener("touchend",jw.stopPropagation))),"mouse"!==n&&"compatible"!==n||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!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:P_.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:hT.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return hT}}]),n}(A_),pT=dT;function gT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var vT=function(e){jo(n,e);var t=gT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Vo(Uo(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return No(n,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave),this.config.disable&&this.disable()}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),n}(A_);function yT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var mT=function(e){jo(n,e);var t=yT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"btnClick",(function(t){var n=Uo(e),i=n.player;if(!n.config.disable)return t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause"),i.ended?i.replay():i.paused&&!i.isBufferControlPaused?(i.play(),e.animate(!1)):(i.pause(),e.animate(!0)),!1})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Go(n.prototype),"afterCreate",this).call(this);var t=this.player;this._isPaused=!1,this.initIcons(),this.bind(["touchend","click"],this.btnClick),this.on([Qw,hC,$w],(function(){e.animate(t.paused)})),this.on(xC,(function(){e.animate(t.paused)})),this.animate(!0)}},{key:"registerIcons",value:function(){return{play:{icon:Ox,class:"xg-icon-play"},pause:{icon:Lx,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){var t=this.i18nKeys,n=this.player;e&&n.isBufferControlPaused||(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(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){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:P_.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(vT),kT=mT;function bT(){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 wT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var CT=function(e){jo(n,e);var t=wT(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(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:bT,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){jw.addClass(this.root,"show")}},{key:"hide",value:function(){jw.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:P_.ROOT_TOP,index:0}}}]),n}(A_);function _T(){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 xT(){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 ST(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var TT=function(e){jo(n,e);var t=ST(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.setRotateDeg(0):e.setRotateDeg(90))})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Go(n.prototype),"afterCreate",this).call(this);var t=this.config,i=this.playerConfig;t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=jw.getFullScreenEl();i.fullscreenTarget===r&&this.player.getFullscreen().catch((function(){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreen_change",this.changeFullScreen,{pre:function(t){e.config.disable||e.emitUserAction(t,"switch_fullscreen",{fullscreen:e.player.fullscreen})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(SC,(function(t){e.changeLangTextKey(e.find(".xg-tips"),t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t),e.config.needBackIcon&&e.show()})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:CT,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===zw.device&&window.addEventListener("orientationchange",this._onOrientationChange)}},{key:"registerIcons",value:function(){return{fullscreen:{icon:_T,class:"xg-get-fullscreen"},exitFullscreen:{icon:xT,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===zw.device?"touchend":"click",this.handleFullscreen),"mobile"===zw.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:"setRotateDeg",value:function(e){var t=this.player;90===window.orientation||-90===window.orientation?t.rotateDeg=0:t.rotateDeg=e}},{key:"getRotateFullscreen",value:function(e){var t=this.player;t.isCssfullScreen&&t.exitCssFullscreen(e);var n=e?z_.INNER_FULLSCREEN:z_.ROTATE_FULLSCREEN;t._fullscreenEl=e||t.root,t.changeFullStyle(t.root,e,n,z_.PARENT_ROTATE_FULLSCREEN),t.fullscreen=!0,this.setRotateDeg(90),this.emit(SC,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this.player;t.fullscreen=!1;var n=t._fullscreenEl!==t.root?z_.INNER_FULLSCREEN:z_.ROTATE_FULLSCREEN;t.recoverFullStyle(t.root,t._fullscreenEl,n,z_.PARENT_ROTATE_FULLSCREEN),this.setRotateDeg(0),this.emit(SC,!1)}},{key:"changeFullScreen",value:function(e){var t=this.player,n=this.config;if(!n.disable){e&&(e.preventDefault(),e.stopPropagation());var i=!1;if((!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(i=!0),i)t.fullscreen?(t.fullscreen=!1,t.exitCssFullscreen(),this.emit(SC,!1)):(t.fullscreen=!0,t.getCssFullscreen(),this.emit(SC,!0)),this.animate(t.fullscreen);else if(n.rotateFullscreen)t.fullscreen?this.exitRotateFullscreen():this.getRotateFullscreen(),this.animate(t.fullscreen);else{if(n.switchCallback&&"function"==typeof n.switchCallback)return void n.switchCallback(t.fullscreen);t.fullscreen?t.exitFullscreen():t.getFullscreen().catch((function(){}))}}}},{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(){au(Go(n.prototype),"show",this).call(this)}},{key:"hide",value:function(){au(Go(n.prototype),"hide",this).call(this)}},{key:"render",value:function(){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:P_.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(vT);function ET(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var PT=function(e){jo(n,e);var t=ET(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).isActiving=!1,i}return No(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 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(sC,(function(){e.onTimeUpdate()})),this.on(iC,(function(){e.onTimeUpdate()})),this.on(Zw,(function(){e.onTimeUpdate(!0)})),this.on(hC,(function(){e.onReset()})))}},{key:"show",value:function(){"flex"!==this.mode&&au(Go(n.prototype),"show",this).call(this)}},{key:"onTimeUpdate",value:function(e){var t=this.player,n=this.config,i=this.duration;if(!n.disable&&!this.isActiving&&t.hasStart){var r=t.currentTime+this.timeOffset;r=jw.adjustTimeByDuration(r,i,e),"flex"===this.mode?(this.centerCurDom.innerHTML=jw.format(r),i!==1/0&&i>0&&(this.centerDurDom.innerHTML=jw.format(i))):(this.timeDom.innerHTML=jw.format(r),i!==1/0&&i>0&&(this.durationDom.innerHTML=jw.format(i)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=jw.format(0),this.centerDurDom.innerHTML=jw.format(0)):(this.timeDom.innerHTML=jw.format(0),this.durationDom.innerHTML=jw.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=jw.createDom("xg-icon","00:00",{},"xgplayer-time left"),this.centerDurDom=jw.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?(jw.hide(this.durationDom),jw.hide(this.timeDom),jw.hide(this.find(".time-separator")),jw.show(this.find(".time-live-tag"))):jw.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(jw.hide(this.durationDom),jw.hide(this.timeDom),jw.hide(this.find(".time-separator")),jw.show(this.find(".time-live-tag"))):(jw.hide(this.find(".time-live-tag")),jw.show(this.find(".time-separator")),jw.show(this.durationDom),jw.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=jw.format(e):this.centerCurDom.innerHTML=jw.format(e))}},{key:"resetActive",value:function(){var e=this,t=this.player,n=function(){e.isActiving=!1};this.off(nC,n),t.isSeeking?this.once(nC,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:P_.CONTROLS_LEFT,index:2,disable:!1}}}]),n}(A_);function RT(){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 OT(){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 LT(){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 IT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var AT=function(e){jo(n,e);var t=IT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var n=Uo(e).player,i=e.find(".xgplayer-bar");jw.event(t);var r=i.getBoundingClientRect(),o=jw.getEventPos(t,n.zoom),s=r.height-(o.clientY-r.top);if(o.h=s,o.barH=r.height,e.pos=o,!(s<-2))return e.updateVolumePos(s,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),Vo(Uo(e),"onBarMouseMove",(function(t){var n=Uo(e)._d;if(n.isStart){var i=Uo(e),r=i.pos,o=i.player;t.preventDefault(),t.stopPropagation(),jw.event(t);var s=jw.getEventPos(t,o.zoom);n.isMoving=!0;var a=r.h-s.clientY+r.clientY;a>r.barH||e.updateVolumePos(a,t)}})),Vo(Uo(e),"onBarMouseUp",(function(t){jw.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var n=Uo(e)._d;n.isStart=!1,n.isMoving=!1})),Vo(Uo(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Vo(Uo(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),Vo(Uo(e),"onVolumeChange",(function(t){if(e.player){var n=e.player,i=n.muted,r=n.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=i||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(i,r)}})),e}return No(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:OT,class:"xg-volume-small"},volumeLarge:{icon:RT,class:"xg-volume"},volumeMuted:{icon:LT,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},this.initIcons();var t=this.playerConfig,n=t.commonStyle,i=t.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("mutedChange",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==zw.device&&"mobile"!==this.playerConfig.isMobileSimulateMode&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(aC,this.onVolumeChange),this.once(cC,this.onVolumeChange),"Number"!==jw.typeOf(i)&&(this.player.volume=this.config.default),this.onVolumeChange(),this.config.disable&&this.disable()}},{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:"focus",value:function(){var e=this.player;this.config.disable||(e.focus({autoHide:!1}),this._timerId&&(jw.clearTimeout(this,this._timerId),this._timerId=null),jw.addClass(this.root,"slide-show"))}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(jw.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=jw.setTimeout(this,(function(){r.isActive||(n?o.blur():o.focus(),jw.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(i)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){if(!this.config.disable){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(jw.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===zw.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){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:P_.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(A_),DT=AT;function MT(){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 NT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var FT=function(e){jo(n,e);var t=NT(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onBtnClick",(function(e){i.config.disable||(e.preventDefault(),e.stopPropagation(),i.emitUserAction(e,"rotate"),i.rotate(i.config.clockwise,i.config.innerRotate,1))})),i.rotateDeg=i.config.rotateDeg||0,i}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Go(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(OC,(function(){e.rotateDeg&&jw.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)})),this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate)}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{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,u="100%",l="100%",f=0,h=0;.75!==e&&.25!==e||(u="".concat(c,"px"),l="".concat(a,"px"),f=-(c-a)/2,h=-(a-c)/2);var d="translate(".concat(f,"px,").concat(h,"px) rotate(").concat(e,"turn)"),p={transformOrigin:"center center",transform:d,webKitTransform:d,height:l,width:u},g=t?s:r,v=t?n.getPlugin("poster"):null;Object.keys(p).map((function(e){g.style[e]=p[e],v&&v.root&&(v.root.style[e]=p[e])}))}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*n)%1,this.updateRotateDeg(this.rotateDeg,t),i.emit(IC,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:MT}}},{key:"render",value:function(){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:P_.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(vT);function BT(){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 jT(){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 UT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var HT="picture-in-picture",GT="inline",VT="fullscreen",WT=function(e){jo(n,e);var t=UT(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable()||e.config.disable)return!1;t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{from:"pip",to:"normal"}),e.setAttr("data-state","normal")):4===e.player.video.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{from:"normal",to:"pip"}),e.setAttr("data-state","pip"))})),e}return No(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()&&(au(Go(n.prototype),"afterCreate",this).call(this),this.pMode=GT,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(kC,(function(){e.config.showIcon&&(jw.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:BT,class:"xg-get-pip"},pipIconExit:{icon:jT,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;jw.setTimeout(e,(function(){!n&&t.videoPlay()}),0),!n&&t.videoPlay(),e.setAttr("data-state","normal"),t.emit(LC,!1)},this.enterPIPCallback=function(n){t.emit(LC,!0),e.pipWindow=n.pictureInPictureWindow,e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var i=t.video.webkitPresentationMode;e.pMode===VT&&i!==VT&&t.onFullscreenChange(null,!1),e.pMode=i,i===HT?e.enterPIPCallback(n):i===GT&&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"===jw.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===HT}},{key:"isPIPAvailable",value:function(){var e=this.player.video;return("Boolean"!==jw.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===jw.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===jw.typeOf(e.webkitSetPresentationMode))}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this);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:P_.CONTROLS_RIGHT,index:6,showIcon:!1}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),n}(vT),KT=WT;function zT(){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 YT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var XT=function(e){jo(n,e);var t=YT(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"playNext",(function(e){var t=Uo(i).player;e.preventDefault(),e.stopPropagation(),i.idx+1<i.config.urlList.length?(i.idx++,t.emit(DC,i.idx+1),i.nextHandler(i.config.urlList[i.idx],i.idx)):(i.nextHandler(),t.emit(DC))})),i.idx=-1,i}return No(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:zT}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("playNext",this.changeSrc);var e="mobile"===zw.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.autoplay=!0,t.src=e)}},{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:P_.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(A_),qT={exports:{}};!function(e,t){e.exports=function e(t,n,i){var r,o,s=window,a="application/octet-stream",c=i||a,u=t,l=!n&&!i&&u,f=document.createElement("a"),h=function(e){return String(e)},d=s.Blob||s.MozBlob||s.WebKitBlob||h,p=n||"download";if(d=d.call?d.bind(s):Blob,"true"===String(this)&&(c=(u=[u,c])[0],u=u[1]),l&&l.length<2048&&(p=l.split("/").pop().split("?")[0],f.href=l,-1!==f.href.indexOf(l))){var g=new XMLHttpRequest;return g.open("GET",l,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,p,a)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&d!==h))return navigator.msSaveBlob?navigator.msSaveBlob(k(u),p):b(u);c=(u=k(u)).type||a}else if(/([\x80-\xff])/.test(u)){for(var v=0,y=new Uint8Array(u.length),m=y.length;v<m;++v)y[v]=u.charCodeAt(v);u=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 f)return f.href=e,f.setAttribute("download",p),f.className="download-js-link",f.innerHTML="downloading...",f.style.display="none",document.body.appendChild(f),setTimeout((function(){f.click(),document.body.removeChild(f),!0===t&&setTimeout((function(){s.URL.revokeObjectURL(f.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=u instanceof d?u:new d([u],{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===h)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}}(qT);var $T=qT.exports;function JT(){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 ZT(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var QT=function(e){jo(n,e);var t=ZT(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"download",(function(e){if(!i.isLock&&!i.config.disable){i.emitUserAction(e,"download");var t=i.getAbsoluteURL(i.player.src);$T(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 No(n,[{key:"afterCreate",value:function(){au(Go(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this.bind(["click","touchend"],this.download))}},{key:"registerIcons",value:function(){return{download:JT}}},{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(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){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:P_.CONTROLS_RIGHT,index:3,disable:!0}}}]),n}(vT);function eE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var tE=function(e){jo(n,e);var t=eE(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){au(Go(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(OC,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(AC,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 u=n.canvas.toDataURL(a,s).replace(a,"image/octet-stream");i(u=u.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(OC,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:P_.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot"}}}]),n}(vT),nE=function(){function e(t){Fo(this,e),this.config=t.config,this.parent=t.root,this.root=jw.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"===zw.device?"touchend":"click";this._delegates=A_.delegate.call(this,this.root,"li",n,this.onItemClick)}return No(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(jw.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&&jw.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");jw.addClass(t,"selected"),i&&jw.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(){jw.removeClass(this.root,"hide"),jw.addClass(this.root,"active")}},{key:"hide",value:function(){jw.removeClass(this.root,"active"),jw.addClass(this.root,"hide")}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.root.style[n]=e[n]}))}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}();function iE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var rE="mobile"===zw.device,oE=function(e){jo(n,e);var t=iE(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onEnter",(function(e){e.preventDefault(),e.stopPropagation(),console.log(">>>[".concat(i.pluginName,"]onEnter")),i.emit("icon_mouseenter",{pluginName:i.pluginName}),i.onToggle(!i.isActive)})),Vo(Uo(i),"onLeave",(function(e){e.preventDefault(),e.stopPropagation(),console.log(">>>[".concat(i.pluginName,"]onLeave")),i.emit("icon_mouseleave",{pluginName:i.pluginName}),i.isActive&&i.onToggle(!1)})),i.isIcons=!1,i.isActive=!1,i.curValue=null,i.curIndex=0,i}return No(n,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),rE&&"middle"!==t.listType&&(t.listType="rightSide"),t.hidePortrait&&jw.addClass(this.root,"portrait"),this.once(oC,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),rE&&this.on(dC,(function(){console.log(">>>[".concat(e.pluginName,"]PLAYER_FOCUS"),!e.isActive),e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),this.activeEvent=rE?"touchend":"mouseenter",console.log(">>>[".concat(this.pluginName,"]afterCreate"),"domEventType:".concat(this.domEventType," IS_MOBILE:").concat(rE," activeEvent:").concat(this.activeEvent)),this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave),this.isIcons&&this.bind("click",this.onIconClick),this.config.disable&&this.disable()}},{key:"initIcons",value:function(){var e=this,t=this.icons,n=Object.keys(t),i=!1;n.length>0&&(n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n]),!i&&(i=t[n])})),this.isIcons=i),i||(this.appendChild(".xgplayer-icon",jw.createDom("span","",{},"icon-text")),jw.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<1||jw.addClass(this.root,"show")}},{key:"hide",value:function(){jw.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var i=this.config.list;!n&&(n=this.player.lang),t=!t||jw.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]);try{return"object"===Ao(e[t])?e[t][n]||e[t].zh:e[t]}catch(e){return console.warn(e),""}}},{key:"onToggle",value:function(e){if(console.log(">>>[".concat(this.pluginName,"]onToggle"),e),e!==this.isActive&&!this.config.disable){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.unFocus(),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;(rE||"rightSide"===i)&&this.onToggle(!1),this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),this.onToggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var n=this,i=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=i.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var 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 nE(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">\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:P_.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1}}}]),n}(A_);function sE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var aE=function(e){jo(n,e);var t=sE(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).curTime=0,i.isPaused=!0,i}return No(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;au(Go(n.prototype),"afterCreate",this).call(this);var t=this.config,i=t.list,r=t.defaultDefinition,o=this.playerConfig.defaultConfig;i.forEach((function(e){e.definition!==r&&e.definition!==o||(e.selected=!0)})),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(PC,(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,i=this.playerConfig.defaultConfig;if(t.length>0){var r=null;t.map((function(e){e.definition!==n&&e.definition!==i||(r=e,e.selected=!0)})),r||(r=t[0]),this.changeDefinition(r)}}},{key:"renderItemList",value:function(e,t){var i=this,r=t&&t.definition?t.definition:"";t&&!Array.isArray(t)&&e.forEach((function(e){e.selected=!1}));var o=0,s=e.map((function(e,t){var n={url:e.url,definition:e.definition||"",showText:i.getTextByLang(e)||e.definition,selected:!1};return(e.selected||!jw.isUndefined(e.definition)&&e.definition===r)&&(n.selected=!0,o=t),n}));au(Go(n.prototype),"renderItemList",this).call(this,s,o)}},{key:"changeDefinitionList",value:function(e){if(Array.isArray(e)){var t=this.playerConfig,n=t.definition,i=t.defaultDefinition,r=n||this.config.defaultDefinition||"";this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e.definition!==r&&e.definition!==i||(e.selected=!0),e})),n.list=e,this.renderItemList(e),this.config.list.length<2?this.hide():this.show()}}},{key:"changeDefinition",value:function(e,t){var n=this.player;n.switchURL?n.switchUrl(e.url):n.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var i=this.player.definitionList;au(Go(n.prototype),"onItemClick",this).apply(this,arguments),console.log(">>>>onItemClick",e,t),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<i.length;r++)t.to&&i[r].definition===t.to.definition&&(t.to.url=i[r].url),t.from&&i[r].definition===t.from.definition&&(t.from.url=i[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return{position:P_.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0}}}]),n}(oE);function cE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var uE=function(e){jo(n,e);var t=cE(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).curRate=1,i}return No(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;au(Go(n.prototype),"afterCreate",this).call(this),this.on(uC,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&au(Go(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){au(Go(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}));au(Go(n.prototype),"renderItemList",this).call(this,r,i)}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return{position:P_.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1}}}]),n}(oE);function lE(){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 fE(){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 hE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var dE=function(e){jo(n,e);var t=hE(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this;au(Go(n.prototype),"afterCreate",this).call(this),this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(TC,(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){if(!this.config.disable){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:lE,class:"xg-get-cssfull"},exitCssFullscreen:{icon:fE,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){au(Go(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){return'<xg-icon class=\'xgplayer-cssfullscreen\'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.CSSFULLSCREEN_TIPS,'">').concat(this.i18n.CSSFULLSCREEN_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:P_.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n}(vT);function pE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var gE=function(e){jo(n,e);var t=pE(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(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("errorHandler",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(oC,(function(){e.handleCanPlay()})),this.on(eC,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleCanPlay",value:function(){jw.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.error;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}(A_);function vE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var yE=function(e){jo(n,e);var t=vE(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(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;if(this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),jw.addClass(this.root,"show"),"arrow"===n.mode&&jw.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),"boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide){var o=n.interval||r;this.intervalId=setTimeout((function(){t.hide()}),o)}}}},{key:"hide",value:function(){jw.removeClass(this.root,"show"),jw.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(z_.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}(A_),mE=yE,kE={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function bE(e){Object.keys(kE).map((function(t){void 0===e[t]&&(e[t]=kE[t])}))}var wE={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&&(bE(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=jw.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?jw.addClass(r,"mini"):jw.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 CE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var _E={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMove"},xE=function(e){jo(n,e);var t=CE(n);function n(e){var i;return Fo(this,n),Vo(Uo(i=t.call(this,e)),"onMousemove",(function(e){i.config.disable||(jw.hasClass(e.target,"xg-spot-content")&&i.config.isHideThumbnailHover?i.player.plugins.progress.onMouseLeave(e):(i._state.f||jw.hasClass(e.target,"xg-spot-content"))&&(jw.event(e),e.stopPropagation()))})),Vo(Uo(i),"onMousedown",(function(e){i.config.disable||(i._state.f||jw.hasClass(e.target,"xg-spot-content"))&&(jw.event(e),e.stopPropagation())})),Vo(Uo(i),"onMouseup",(function(e){if(i.isDrag){var t=i.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),Vo(Uo(i),"onDotMouseLeave",(function(e){if(!i.config.disable){i._curDot.removeEventListener("mouseleave",i.onDotMouseLeave),i.blurDot(e.target),i._curDot=null;var t=i.player.plugins.progress;t&&t.enableBlur(),i.show()}})),Vo(Uo(i),"onProgressMouseOver",(function(e,t){if(!i.config.disable&&jw.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 No(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(wE).map((function(t){e[t]=wE[t].bind(e)}));var i=n.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return bE(e),e})),e._ispotsInit=!1,n.once(sC,(function(){e.initDots()}))}(this),this.config.disable&&this.disable(),this.extTextRoot=this.find(".xg-spot-ext-text")}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){t.config[n]=e[n]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(_E).map((function(n){e[_E[n]]=e[_E[n]].bind(e),t.addCallBack(n,e[_E[n]])})),"mobile"!==zw.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var n=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),n(parseInt(1e3*e._state.now,10)/1e3,t)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&jw.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&jw.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){if(!this.config.disable&&jw.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=this.root,i=this.previewLine,r=this.timePoint,o=this.player,s=this.config,a="flex"===o.controls.mode,c=n.getBoundingClientRect().width;if(c||!this._hasThumnail){var u,l,f=r.getBoundingClientRect().width,h=e-(c=this._hasThumnail&&c<s.width?s.width:c)/2;h<0&&!a?(h=0,u=e-c/2,!this.thumbnail&&(l=e-c/2-f/2)):h>t-c&&!a?(u=h-(t-c),!this.thumbnail&&(l=h-(t-c)-f/2),h=t-c):(u=0,!this.thumbnail&&(l=-f/2)),void 0!==u&&(i.style.transform="translateX(".concat(u.toFixed(2),"px)")),void 0!==l&&(r.style.transform="translateX(".concat(l.toFixed(2),"px)")),n.style.transform="translateX(".concat(h.toFixed(2),"px) translateZ(0)")}}},{key:"updateTimeText",value:function(e){var t=this.timeText,n=this.timePoint;t.textContent=e,!this.thumbnail&&(n.textContent=e)}},{key:"updatePosition",value:function(e,t,n,i){var r=this.root,o=this.config,s=this._state;if(r){this.updateLinePos(e,t),s.now=n;var a=jw.format(n);i&&i.target&&jw.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=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,i.width,i.height);var o=n&&n.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==zw.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i&&i.setConfig(e),i&&i.usable&&n.isShowThumbnail){jw.removeClass(this.root,"short-line no-thumbnail"),"short"===n.mode&&jw.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=jw.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else jw.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")),jw.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(jw.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";jw.addClass(this.root,"no-timepoint"),e&&(jw.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(jw.addClass(this.root,"product"),this.tipText.textContent=e):(jw.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){jw.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",jw.removeClass(this.find(".xg-spot-content"),"show-text"),jw.removeClass(this.root,"product")}},{key:"hide",value:function(){jw.addClass(this.root,"hide")}},{key:"show",value:function(){jw.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(_E).map((function(n){t.removeCallBack(n,e[_E[n]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===zw.device||"mobile"===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-ext-text"></div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),n}(A_);function SE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var TE=function(e){jo(n,e);var t=SE(n);function n(e){var i;return Fo(this,n),(i=t.call(this,e)).ratio=1,i.interval=null,i._preloadMark={},i}return No(n,[{key:"afterCreate",value:function(){var e=this;this.usable&&this.initThumbnail(),this.on([sC],(function(){var t=e.config,n=t.pic_num,i=t.interval;e.usable&&(e.interval=i>0?i:Math.round(1e3*e.player.duration/n)/1e3)}))}},{key:"setConfig",value:function(e){var t=this;if(e){var n=Object.keys(e);n.length<1||(n.forEach((function(n){t.config[n]=e[n]})),this.usable&&this.initThumbnail())}}},{key:"usable",get:function(){var e=this.config,t=e.urls,n=e.pic_num;return t&&t.length>0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,n=e.height,i=e.pic_num,r=e.interval;this.ratio=t/n*100,this.interval=r||Math.round(this.player.duration/i),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var n=this.config.urls,i=n.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<i-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<i&&(t._preloadMark[e]=1,jw.preloadImg(n[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,r=i.pic_num,o=i.row,s=i.col,a=i.width,c=i.height;this.interval=Math.round(this.player.duration/r);var u=Math.ceil(e/this.interval),l=(u=u>r?r:u)<o*s?0:Math.ceil(u/(o*s))-1,f=u-l*(s*o),h=f>0?Math.ceil(f/s)-1:0,d=f>0?f-h*s-1:0,p=0,g=0;t&&n?t/n<a/c?p=(g=n)*(a/c):g=(p=t)/(a/c):n?t||(p=(g=n||c)*(a/c)):g=(p=t||a)/(a/c);var v=this.getUrlByIndex(l);return{urlIndex:l,rowIndex:h,colIndex:d,url:v,height:g,width:p,style:{backgroundImage:"url(".concat(v,")"),backgroundSize:"".concat(p*s,"px auto"),backgroundPosition:"-".concat(d*p,"px -").concat(h*g,"px"),width:"".concat(p,"px"),height:"".concat(g,"px")}}}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,s=o.pic_num,a=o.urls;if(!(s<=0)&&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=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setConfig(e)}},{key:"createThumbnail",value:function(e,t){var n=jw.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(n),n}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),n}(A_);function EE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var PE=function(e){jo(n,e);var t=EE(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(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}(A_),RE=PE;function OE(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var LE="realtime",IE="firstframe",AE="poster";var DE=null,ME=function(e){jo(n,e);var t=OE(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onLoadedData",(function(t){e.player&&(e._frameCount=e.config.startFrameCount,e.stop(),e.renderOnTimeupdate(t),e.off(iC,e.renderOnTimeupdate),e.on(iC,e.renderOnTimeupdate))})),Vo(Uo(e),"onVisibilitychange",(function(t){"visible"===document.visibilityState?e._checkIfCanStart()&&e.start():"hidden"===document.visibilityState&&e.stop()})),Vo(Uo(e),"renderOnTimeupdate",(function(t){if(e._frameCount>0)e.renderOnce(),e._frameCount--;else{e._isLoaded=!0,e.off(iC,e.renderOnTimeupdate);var n=e.config.startInterval;!e.player.paused&&e._checkIfCanStart()&&e.start(n)}})),Vo(Uo(e),"start",(function(t){var n=e.player.video,i=function(){try{return parseInt(window.performance.now(),10)}catch(e){return(new Date).getTime()}}(),r=e.checkVideoIsSupport(n);r&&e.canvasCtx&&(t||(t=e.interval),e.stop(),n.videoWidth&&n.videoHeight&&(e.videoPI=n.videoHeight>0?parseInt(n.videoWidth/n.videoHeight*100,10):0,(e.config.mode===LE||i-e.preTime>=t)&&(n&&n.videoWidth&&e.update(r,e.videoPI),e.preTime=i)),e.frameId="timer"===e._loopType?jw.setTimeout(Uo(e),e.start,t):jw.requestAnimationFrame(e.start))})),Vo(Uo(e),"stop",(function(){e.frameId&&("timer"===e._loopType?jw.clearTimeout(Uo(e),e.frameId):jw.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var t=this.config,i=t.disable,r=t.mode,o=t.frameRate;i||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this._isLoaded=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/o,10),this.canvas=null,this.canvasCtx=null,this._frameCount=0,this._loopType=this.config.mode!==LE&&this.interval>=1e3?"timer":"animation",this.once(kC,(function(){e.player&&(e.init(),e.player.paused||e.start())})),r!==AE&&(r!==IE&&(this.on(hC,(function(){e.stop()})),this.on($w,(function(){var t=e.config.startInterval;e._checkIfCanStart()&&e.start(t)})),this.on(Qw,(function(){e.stop()}))),this.on(cC,this.onLoadedData),this.on(fC,(function(){e._isLoaded=!1,e.stop()})),document.addEventListener("visibilitychange",this.onVisibilitychange)))}},{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" data-index="'.concat(t.index,'"><canvas>\n </canvas><xgmask></xgmask></div>')),this.root=i.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=t.filter,this.canvas.style.webkitFilter=t.filter),this.mask=this.find("xgmask"),t.addMask&&(this.mask.style.background=t.maskBg),this.canvasCtx=this.canvas.getContext("2d"),this.renderByPoster()}catch(e){Fw.logError("plugin:DynamicBg",e)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==zw.browser||!/^blob/.test(t.currentSrc)&&!/^blob/.test(t.src)))return t;var n=t?t.tagName.toLowerCase():"";return"canvas"===n||"img"===n?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===jw.typeOf(e)?e:"String"===jw.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"_checkIfCanStart",value:function(){var e=this.config.mode;return this._isLoaded&&!this.player.paused&&e!==IE&&e!==AE}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&e.videoWidth&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=i;var e=parseInt(i/r*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var n=this._pos,i=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,s=r.height;if(o!==n.width||s!==n.height||n.pi!==t){var a=parseInt(o/s*100,10);n.pi=t,n.width!==o&&(n.width=this.canvas.width=o),n.height!==s&&(n.height=this.canvas.height=s);var c=s,u=o;a<t?u=parseInt(s*t/100,10):a>t&&(c=parseInt(100*o/t,10)),n.rwidth=u*i.multiple,n.rheight=c*i.multiple,n.x=(o-n.rwidth)/2,n.y=(s-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(e){Fw.logError("plugin:DynamicBg",e)}}},{key:"destroy",value:function(){this.stop(),document.removeEventListener("visibilitychange",this.onVisibilitychange),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,index:-1,mode:"framerate",frameRate:10,filter:"blur(50px)",startFrameCount:1,startInterval:0,addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof DE?DE:DE=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===zw.browser||"firefox"===zw.browser)}}]),n}(A_),NE=ME,FE=d,BE=fe,jE=ie("iterator"),UE=!FE((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.size&&!BE||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[jE]||"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})),HE=Se,GE=Pp,VE=As,WE=Pe,KE=T,zE=function(e,t,n,i){try{return i?t(HE(n)[0],n[1]):t(n)}catch(t){GE(e,"throw",t)}},YE=fp,XE=Hr,qE=Ci,$E=Jo,JE=xp,ZE=yp,QE=Array,eP=k,tP=2147483647,nP=/[^\0-\u007E]/,iP=/[.\u3002\uFF0E\uFF61]/g,rP="Overflow: input needs wider integers to process",oP=RangeError,sP=eP(iP.exec),aP=Math.floor,cP=String.fromCharCode,uP=eP("".charCodeAt),lP=eP([].join),fP=eP([].push),hP=eP("".replace),dP=eP("".split),pP=eP("".toLowerCase),gP=function(e){return e+22+75*(e<26)},vP=function(e,t,n){var i=0;for(e=n?aP(e/700):e>>1,e+=aP(e/t);e>455;)e=aP(e/35),i+=36;return aP(i+36*e/(e+38))},yP=function(e){var t=[];e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=uP(e,n++);if(r>=55296&&r<=56319&&n<i){var o=uP(e,n++);56320==(64512&o)?fP(t,((1023&r)<<10)+(1023&o)+65536):(fP(t,r),n--)}else fP(t,r)}return t}(e);var n,i,r=e.length,o=128,s=0,a=72;for(n=0;n<e.length;n++)(i=e[n])<128&&fP(t,cP(i));var c=t.length,u=c;for(c&&fP(t,"-");u<r;){var l=tP;for(n=0;n<e.length;n++)(i=e[n])>=o&&i<l&&(l=i);var f=u+1;if(l-o>aP((tP-s)/f))throw oP(rP);for(s+=(l-o)*f,o=l,n=0;n<e.length;n++){if((i=e[n])<o&&++s>tP)throw oP(rP);if(i==o){for(var h=s,d=36;;){var p=d<=a?1:d>=a+26?26:d-a;if(h<p)break;var g=h-p,v=36-p;fP(t,cP(gP(p+g%v))),h=aP(g/v),d+=36}fP(t,cP(gP(h))),a=vP(s,f,u==c),s=0,u++}}s++,o++}return lP(t,"")},mP=En,kP=lr,bP=n,wP=Pe,CP=k,_P=fe,xP=UE,SP=En,TP=fs,EP=function(e,t,n){for(var i in t)mP(e,i,t[i],n);return e},PP=Ts,RP=qv,OP=on,LP=Df,IP=ue,AP=R,DP=As,MP=Bn,NP=Se,FP=pe,BP=zo,jP=mo,UP=Nt,HP=xp,GP=yp,VP=Hf,WP=aw,KP=ie("iterator"),zP="URLSearchParams",YP=zP+"Iterator",XP=OP.set,qP=OP.getterFor(zP),$P=OP.getterFor(YP),JP=Object.getOwnPropertyDescriptor,ZP=function(e){if(!_P)return bP[e];var t=JP(bP,e);return t&&t.value},QP=ZP("fetch"),eR=ZP("Request"),tR=ZP("Headers"),nR=eR&&eR.prototype,iR=tR&&tR.prototype,rR=bP.RegExp,oR=bP.TypeError,sR=bP.decodeURIComponent,aR=bP.encodeURIComponent,cR=CP("".charAt),uR=CP([].join),lR=CP([].push),fR=CP("".replace),hR=CP([].shift),dR=CP([].splice),pR=CP("".split),gR=CP("".slice),vR=/\+/g,yR=Array(4),mR=function(e){return yR[e-1]||(yR[e-1]=rR("((?:%[\\da-f]{2}){"+e+"})","gi"))},kR=function(e){try{return sR(e)}catch(t){return e}},bR=function(e){var t=fR(e,vR," "),n=4;try{return sR(t)}catch(e){for(;n;)t=fR(t,mR(n--),kR);return t}},wR=/[!'()~]|%20/g,CR={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},_R=function(e){return CR[e]},xR=function(e){return fR(aR(e),wR,_R)},SR=RP((function(e,t){XP(this,{type:YP,iterator:HP(qP(e).entries),kind:t})}),"Iterator",(function(){var e=$P(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n}),!0),TR=function(e){this.entries=[],this.url=null,void 0!==e&&(FP(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===cR(e,0)?gR(e,1):e:BP(e)))};TR.prototype={type:zP,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,i,r,o,s,a,c=GP(e);if(c)for(n=(t=HP(e,c)).next;!(i=wP(n,t)).done;){if(o=(r=HP(NP(i.value))).next,(s=wP(o,r)).done||(a=wP(o,r)).done||!wP(o,r).done)throw oR("Expected sequence with length 2");lR(this.entries,{key:BP(s.value),value:BP(a.value)})}else for(var u in e)AP(e,u)&&lR(this.entries,{key:u,value:BP(e[u])})},parseQuery:function(e){if(e)for(var t,n,i=pR(e,"&"),r=0;r<i.length;)(t=i[r++]).length&&(n=pR(t,"="),lR(this.entries,{key:bR(hR(n)),value:bR(uR(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],i=0;i<t.length;)e=t[i++],lR(n,xR(e.key)+"="+xR(e.value));return uR(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ER=function(){LP(this,PR);var e=XP(this,new TR(arguments.length>0?arguments[0]:void 0));_P||(this.length=e.entries.length)},PR=ER.prototype;if(EP(PR,{append:function(e,t){VP(arguments.length,2);var n=qP(this);lR(n.entries,{key:BP(e),value:BP(t)}),_P||this.length++,n.updateURL()},delete:function(e){VP(arguments.length,1);for(var t=qP(this),n=t.entries,i=BP(e),r=0;r<n.length;)n[r].key===i?dR(n,r,1):r++;_P||(this.length=n.length),t.updateURL()},get:function(e){VP(arguments.length,1);for(var t=qP(this).entries,n=BP(e),i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){VP(arguments.length,1);for(var t=qP(this).entries,n=BP(e),i=[],r=0;r<t.length;r++)t[r].key===n&&lR(i,t[r].value);return i},has:function(e){VP(arguments.length,1);for(var t=qP(this).entries,n=BP(e),i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){VP(arguments.length,1);for(var n,i=qP(this),r=i.entries,o=!1,s=BP(e),a=BP(t),c=0;c<r.length;c++)(n=r[c]).key===s&&(o?dR(r,c--,1):(o=!0,n.value=a));o||lR(r,{key:s,value:a}),_P||(this.length=r.length),i.updateURL()},sort:function(){var e=qP(this);WP(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=qP(this).entries,i=DP(e,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new SR(this,"keys")},values:function(){return new SR(this,"values")},entries:function(){return new SR(this,"entries")}},{enumerable:!0}),SP(PR,KP,PR.entries,{name:"entries"}),SP(PR,"toString",(function(){return qP(this).serialize()}),{enumerable:!0}),_P&&TP(PR,"size",{get:function(){return qP(this).entries.length},configurable:!0,enumerable:!0}),PP(ER,zP),kP({global:!0,constructor:!0,forced:!xP},{URLSearchParams:ER}),!xP&&IP(tR)){var RR=CP(iR.has),OR=CP(iR.set),LR=function(e){if(FP(e)){var t,n=e.body;if(MP(n)===zP)return t=e.headers?new tR(e.headers):new tR,RR(t,"content-type")||OR(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),jP(e,{body:UP(0,BP(n)),headers:UP(0,t)})}return e};if(IP(QP)&&kP({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return QP(e,arguments.length>1?LR(arguments[1]):{})}}),IP(eR)){var IR=function(e){return LP(this,nR),new eR(e,arguments.length>1?LR(arguments[1]):{})};nR.constructor=IR,IR.prototype=nR,kP({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:IR})}}var AR,DR=lr,MR=fe,NR=UE,FR=n,BR=As,jR=k,UR=En,HR=fs,GR=Df,VR=R,WR=em,KR=function(e){var t=KE(e),n=XE(this),i=arguments.length,r=i>1?arguments[1]:void 0,o=void 0!==r;o&&(r=VE(r,i>2?arguments[2]:void 0));var s,a,c,u,l,f,h=ZE(t),d=0;if(!h||this===QE&&YE(h))for(s=qE(t),a=n?new this(s):QE(s);s>d;d++)f=o?r(t[d],d):t[d],$E(a,d,f);else for(l=(u=JE(t,h)).next,a=n?new this:[];!(c=WE(l,u)).done;d++)f=o?zE(u,r,[c.value,d],!0):c.value,$E(a,d,f);return a.length=d,a},zR=is,YR=_m.codeAt,XR=function(e){var t,n,i=[],r=dP(hP(pP(e),iP,"."),".");for(t=0;t<r.length;t++)n=r[t],fP(i,sP(nP,n)?"xn--"+yP(n):n);return lP(i,".")},qR=zo,$R=Ts,JR=Hf,ZR={URLSearchParams:ER,getState:qP},QR=on,eO=QR.set,tO=QR.getterFor("URL"),nO=ZR.URLSearchParams,iO=ZR.getState,rO=FR.URL,oO=FR.TypeError,sO=FR.parseInt,aO=Math.floor,cO=Math.pow,uO=jR("".charAt),lO=jR(/./.exec),fO=jR([].join),hO=jR(1..toString),dO=jR([].pop),pO=jR([].push),gO=jR("".replace),vO=jR([].shift),yO=jR("".split),mO=jR("".slice),kO=jR("".toLowerCase),bO=jR([].unshift),wO="Invalid scheme",CO="Invalid host",_O="Invalid port",xO=/[a-z]/i,SO=/[\d+-.a-z]/i,TO=/\d/,EO=/^0x/i,PO=/^[0-7]+$/,RO=/^\d+$/,OO=/^[\da-f]+$/i,LO=/[\0\t\n\r #%/:<>?@[\\\]^|]/,IO=/[\0\t\n\r #/:<>?@[\\\]^|]/,AO=/^[\u0000-\u0020]+/,DO=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,MO=/[\t\n\r]/g,NO=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)bO(t,e%256),e=aO(e/256);return fO(t,".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,o=0;o<8;o++)0!==e[o]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=hO(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},FO={},BO=WR({},FO,{" ":1,'"':1,"<":1,">":1,"`":1}),jO=WR({},BO,{"#":1,"?":1,"{":1,"}":1}),UO=WR({},jO,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),HO=function(e,t){var n=YR(e,0);return n>32&&n<127&&!VR(t,e)?e:encodeURIComponent(e)},GO={ftp:21,file:null,http:80,https:443,ws:80,wss:443},VO=function(e,t){var n;return 2==e.length&&lO(xO,uO(e,0))&&(":"==(n=uO(e,1))||!t&&"|"==n)},WO=function(e){var t;return e.length>1&&VO(mO(e,0,2))&&(2==e.length||"/"===(t=uO(e,2))||"\\"===t||"?"===t||"#"===t)},KO=function(e){return"."===e||"%2e"===kO(e)},zO={},YO={},XO={},qO={},$O={},JO={},ZO={},QO={},eL={},tL={},nL={},iL={},rL={},oL={},sL={},aL={},cL={},uL={},lL={},fL={},hL={},dL=function(e,t,n){var i,r,o,s=qR(e);if(t){if(r=this.parse(s))throw oO(r);this.searchParams=null}else{if(void 0!==n&&(i=new dL(n,!0)),r=this.parse(s,null,i))throw oO(r);(o=iO(new nO)).bindURL(this),this.searchParams=o}};dL.prototype={type:"URL",parse:function(e,t,n){var i,r,o,s,a,c=this,u=t||zO,l=0,f="",h=!1,d=!1,p=!1;for(e=qR(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=gO(e,AO,""),e=gO(e,DO,"$1")),e=gO(e,MO,""),i=KR(e);l<=i.length;){switch(r=i[l],u){case zO:if(!r||!lO(xO,r)){if(t)return wO;u=XO;continue}f+=kO(r),u=YO;break;case YO:if(r&&(lO(SO,r)||"+"==r||"-"==r||"."==r))f+=kO(r);else{if(":"!=r){if(t)return wO;f="",u=XO,l=0;continue}if(t&&(c.isSpecial()!=VR(GO,f)||"file"==f&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=f,t)return void(c.isSpecial()&&GO[c.scheme]==c.port&&(c.port=null));f="","file"==c.scheme?u=oL:c.isSpecial()&&n&&n.scheme==c.scheme?u=qO:c.isSpecial()?u=QO:"/"==i[l+1]?(u=$O,l++):(c.cannotBeABaseURL=!0,pO(c.path,""),u=lL)}break;case XO:if(!n||n.cannotBeABaseURL&&"#"!=r)return wO;if(n.cannotBeABaseURL&&"#"==r){c.scheme=n.scheme,c.path=zR(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,u=hL;break}u="file"==n.scheme?oL:JO;continue;case qO:if("/"!=r||"/"!=i[l+1]){u=JO;continue}u=eL,l++;break;case $O:if("/"==r){u=tL;break}u=uL;continue;case JO:if(c.scheme=n.scheme,r==AR)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=zR(n.path),c.query=n.query;else if("/"==r||"\\"==r&&c.isSpecial())u=ZO;else if("?"==r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=zR(n.path),c.query="",u=fL;else{if("#"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=zR(n.path),c.path.length--,u=uL;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=zR(n.path),c.query=n.query,c.fragment="",u=hL}break;case ZO:if(!c.isSpecial()||"/"!=r&&"\\"!=r){if("/"!=r){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,u=uL;continue}u=tL}else u=eL;break;case QO:if(u=eL,"/"!=r||"/"!=uO(f,l+1))continue;l++;break;case eL:if("/"!=r&&"\\"!=r){u=tL;continue}break;case tL:if("@"==r){h&&(f="%40"+f),h=!0,o=KR(f);for(var g=0;g<o.length;g++){var v=o[g];if(":"!=v||p){var y=HO(v,UO);p?c.password+=y:c.username+=y}else p=!0}f=""}else if(r==AR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(h&&""==f)return"Invalid authority";l-=KR(f).length+1,f="",u=nL}else f+=r;break;case nL:case iL:if(t&&"file"==c.scheme){u=aL;continue}if(":"!=r||d){if(r==AR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()){if(c.isSpecial()&&""==f)return CO;if(t&&""==f&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(f))return s;if(f="",u=cL,t)return;continue}"["==r?d=!0:"]"==r&&(d=!1),f+=r}else{if(""==f)return CO;if(s=c.parseHost(f))return s;if(f="",u=rL,t==iL)return}break;case rL:if(!lO(TO,r)){if(r==AR||"/"==r||"?"==r||"#"==r||"\\"==r&&c.isSpecial()||t){if(""!=f){var m=sO(f,10);if(m>65535)return _O;c.port=c.isSpecial()&&m===GO[c.scheme]?null:m,f=""}if(t)return;u=cL;continue}return _O}f+=r;break;case oL:if(c.scheme="file","/"==r||"\\"==r)u=sL;else{if(!n||"file"!=n.scheme){u=uL;continue}if(r==AR)c.host=n.host,c.path=zR(n.path),c.query=n.query;else if("?"==r)c.host=n.host,c.path=zR(n.path),c.query="",u=fL;else{if("#"!=r){WO(fO(zR(i,l),""))||(c.host=n.host,c.path=zR(n.path),c.shortenPath()),u=uL;continue}c.host=n.host,c.path=zR(n.path),c.query=n.query,c.fragment="",u=hL}}break;case sL:if("/"==r||"\\"==r){u=aL;break}n&&"file"==n.scheme&&!WO(fO(zR(i,l),""))&&(VO(n.path[0],!0)?pO(c.path,n.path[0]):c.host=n.host),u=uL;continue;case aL:if(r==AR||"/"==r||"\\"==r||"?"==r||"#"==r){if(!t&&VO(f))u=uL;else if(""==f){if(c.host="",t)return;u=cL}else{if(s=c.parseHost(f))return s;if("localhost"==c.host&&(c.host=""),t)return;f="",u=cL}continue}f+=r;break;case cL:if(c.isSpecial()){if(u=uL,"/"!=r&&"\\"!=r)continue}else if(t||"?"!=r)if(t||"#"!=r){if(r!=AR&&(u=uL,"/"!=r))continue}else c.fragment="",u=hL;else c.query="",u=fL;break;case uL:if(r==AR||"/"==r||"\\"==r&&c.isSpecial()||!t&&("?"==r||"#"==r)){if(".."===(a=kO(a=f))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(c.shortenPath(),"/"==r||"\\"==r&&c.isSpecial()||pO(c.path,"")):KO(f)?"/"==r||"\\"==r&&c.isSpecial()||pO(c.path,""):("file"==c.scheme&&!c.path.length&&VO(f)&&(c.host&&(c.host=""),f=uO(f,0)+":"),pO(c.path,f)),f="","file"==c.scheme&&(r==AR||"?"==r||"#"==r))for(;c.path.length>1&&""===c.path[0];)vO(c.path);"?"==r?(c.query="",u=fL):"#"==r&&(c.fragment="",u=hL)}else f+=HO(r,jO);break;case lL:"?"==r?(c.query="",u=fL):"#"==r?(c.fragment="",u=hL):r!=AR&&(c.path[0]+=HO(r,FO));break;case fL:t||"#"!=r?r!=AR&&("'"==r&&c.isSpecial()?c.query+="%27":c.query+="#"==r?"%23":HO(r,FO)):(c.fragment="",u=hL);break;case hL:r!=AR&&(c.fragment+=HO(r,BO))}l++}},parseHost:function(e){var t,n,i;if("["==uO(e,0)){if("]"!=uO(e,e.length-1))return CO;if(t=function(e){var t,n,i,r,o,s,a,c=[0,0,0,0,0,0,0,0],u=0,l=null,f=0,h=function(){return uO(e,f)};if(":"==h()){if(":"!=uO(e,1))return;f+=2,l=++u}for(;h();){if(8==u)return;if(":"!=h()){for(t=n=0;n<4&&lO(OO,h());)t=16*t+sO(h(),16),f++,n++;if("."==h()){if(0==n)return;if(f-=n,u>6)return;for(i=0;h();){if(r=null,i>0){if(!("."==h()&&i<4))return;f++}if(!lO(TO,h()))return;for(;lO(TO,h());){if(o=sO(h(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;f++}c[u]=256*c[u]+r,2!=++i&&4!=i||u++}if(4!=i)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;c[u++]=t}else{if(null!==l)return;f++,l=++u}}if(null!==l)for(s=u-l,u=7;0!=u&&s>0;)a=c[u],c[u--]=c[l+s-1],c[l+--s]=a;else if(8!=u)return;return c}(mO(e,1,-1)),!t)return CO;this.host=t}else if(this.isSpecial()){if(e=XR(e),lO(LO,e))return CO;if(t=function(e){var t,n,i,r,o,s,a,c=yO(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(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"==uO(r,0)&&(o=lO(EO,r)?16:8,r=mO(r,8==o?1:2)),""===r)s=0;else{if(!lO(10==o?RO:8==o?PO:OO,r))return e;s=sO(r,o)}pO(n,s)}for(i=0;i<t;i++)if(s=n[i],i==t-1){if(s>=cO(256,5-t))return null}else if(s>255)return null;for(a=dO(n),i=0;i<n.length;i++)a+=n[i]*cO(256,3-i);return a}(e),null===t)return CO;this.host=t}else{if(lO(IO,e))return CO;for(t="",n=KR(e),i=0;i<n.length;i++)t+=HO(n[i],FO);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return VR(GO,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&VO(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,i=e.password,r=e.host,o=e.port,s=e.path,a=e.query,c=e.fragment,u=t+":";return null!==r?(u+="//",e.includesCredentials()&&(u+=n+(i?":"+i:"")+"@"),u+=NO(r),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?s[0]:s.length?"/"+fO(s,"/"):"",null!==a&&(u+="?"+a),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw oO(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new pL(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+NO(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(qR(e)+":",zO)},getUsername:function(){return this.username},setUsername:function(e){var t=KR(qR(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=HO(t[n],UO)}},getPassword:function(){return this.password},setPassword:function(e){var t=KR(qR(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=HO(t[n],UO)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?NO(e):NO(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,nL)},getHostname:function(){var e=this.host;return null===e?"":NO(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,iL)},getPort:function(){var e=this.port;return null===e?"":qR(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=qR(e))?this.port=null:this.parse(e,rL))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+fO(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,cL))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=qR(e))?this.query=null:("?"==uO(e,0)&&(e=mO(e,1)),this.query="",this.parse(e,fL)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=qR(e))?("#"==uO(e,0)&&(e=mO(e,1)),this.fragment="",this.parse(e,hL)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var pL=function(e){var t=GR(this,gL),n=JR(arguments.length,1)>1?arguments[1]:void 0,i=eO(t,new dL(e,!1,n));MR||(t.href=i.serialize(),t.origin=i.getOrigin(),t.protocol=i.getProtocol(),t.username=i.getUsername(),t.password=i.getPassword(),t.host=i.getHost(),t.hostname=i.getHostname(),t.port=i.getPort(),t.pathname=i.getPathname(),t.search=i.getSearch(),t.searchParams=i.getSearchParams(),t.hash=i.getHash())},gL=pL.prototype,vL=function(e,t){return{get:function(){return tO(this)[e]()},set:t&&function(e){return tO(this)[t](e)},configurable:!0,enumerable:!0}};if(MR&&(HR(gL,"href",vL("serialize","setHref")),HR(gL,"origin",vL("getOrigin")),HR(gL,"protocol",vL("getProtocol","setProtocol")),HR(gL,"username",vL("getUsername","setUsername")),HR(gL,"password",vL("getPassword","setPassword")),HR(gL,"host",vL("getHost","setHost")),HR(gL,"hostname",vL("getHostname","setHostname")),HR(gL,"port",vL("getPort","setPort")),HR(gL,"pathname",vL("getPathname","setPathname")),HR(gL,"search",vL("getSearch","setSearch")),HR(gL,"searchParams",vL("getSearchParams")),HR(gL,"hash",vL("getHash","setHash"))),UR(gL,"toJSON",(function(){return tO(this).serialize()}),{enumerable:!0}),UR(gL,"toString",(function(){return tO(this).serialize()}),{enumerable:!0}),rO){var yL=rO.createObjectURL,mL=rO.revokeObjectURL;yL&&UR(pL,"createObjectURL",BR(yL,rO)),mL&&UR(pL,"revokeObjectURL",BR(mL,rO))}function kL(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 bL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kL(Object(n),!0).forEach((function(t){Vo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kL(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}$R(pL,"URL"),DR({global:!0,constructor:!0,forced:!NR,sham:!MR},{URL:pL});var CL="info",_L=GC,xL=function(e){jo(n,e);var t=wL(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(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[CL].push(bL(bL({type:"userAction"},n),{},{payload:i}))})),Vo(Uo(e),"_onReset",(function(){e.reset()})),Vo(Uo(e),"_recordInfo",(function(t){e.info(t)})),Vo(Uo(e),"_downloadStats",(function(){var t=e.getStats(),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=window.URL.createObjectURL(n),r=document.createElement("a");r.style.display="none",r.href=i,r.download="player.txt",r.disabled=!1,r.click()})),e}return No(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(FC,this._recordUserActions),this.on(_L.STATS_INFO,this._recordInfo),this.on(_L.STATS_DOWNLOAD,this._downloadStats),this.on(_L.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[CL].push(bL(bL({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=bL({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=(Vo(e={},CL,[]),Vo(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(){var e=this._stats[CL].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," ")}));return e}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats[CL].forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),n}(b_);function SL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var TL=function(e){jo(n,e);var t=SL(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Uo(e),i=t.player,r=t.config;if(i.video.readyState!==HTMLMediaElement.HAVE_NOTHING){if(i.video.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!i.video.paused||0===i.video.currentTime||!e.hasPlayed){var o=i.video.buffered,s=r.smallGapLimit||.5,a=r.gapDetectionThreshold||.3,c=i.video.currentTime,u=e._getIndex(o,c,a);if(null!==u&&0!==u){console.log("GapJump bufferRange ",o.start(u),o.end(u));var l=o.start(u)+.1;if(!(l>i.video.duration)){var f=l-c,h=f<=s;f<n.BROWSER_GAP_TOLERANCE||h&&(!1!==r.useGapJump&&(i.video.currentTime=e.isSafari?l+.1:l),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",u," isGapSamll:",h," currentTime:",i.video.currentTime," jumpSize:",c-i.video.currentTime),.08!==l&&i&&i.emit("log",{type:"oneevent",end_type:"gap",vid:i.config.vid,ext:{video_postion:Math.floor(1e3*l)}}))}}}}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on(rC,this.onGapJump),this.on($w,(function(){e.hasPlayed=!0})),this.on(tC,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,n){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var i=this._getBuffered(e),r=null,o=0;o<i.length;o++){if(i[o].start>t&&(0===o||i[o-1].end-t<=n)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),n}(A_);function EL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}TL.BROWSER_GAP_TOLERANCE=.001;var PL=function(e){jo(n,e);var t=EL(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Uo(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),Vo(Uo(e),"onJump",(function(){var t=Uo(e),n=t.player,i=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||n.video.paused&&0!==n.video.currentTime&&e.hasPlayed)){e.jumpSize=i.jumpSize*(e.jumpCnt+1),e.jumpCnt===i.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=n.currentTime+e.jumpSize;r>n.video.duration||(e.jumpCnt++,n.currentTime=r)}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.useWaitingTimeoutJump,i=t.jumpSize;!1!==n&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on(rC,this.onWaiting),this.on([Jw,oC],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on($w,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n}(A_);function RL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var OL="cdn",LL=["cdn"],IL=function(e){jo(n,e);var t=RL(n);function n(){var e;Fo(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Vo(Uo(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:OL;if(!e.speedListCache||!e.speedListCache[t])return 0;if(e.speedListCache[t].length<=0)return 0;var n=0;return e.speedListCache[t].map((function(e){n+=e})),Math.floor(n/e.speedListCache[t].length)})),Vo(Uo(e),"startTimer",(function(){jw.isMSE(e.player.video)||(e.cnt=0,e.timer=setTimeout(e.testSpeed,e.config.testTimeStep))})),Vo(Uo(e),"initSpeedList",(function(){e.speedListCache={},LL.forEach((function(t){e.speedListCache[t]=[]}))})),Vo(Uo(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed,t.type||OL)})),Vo(Uo(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,n=t.url,i=t.loadSize,r=t.testCnt,o=t.testTimeStep,s=n+(n.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var a=(new Date).getTime(),c=null,u=new XMLHttpRequest;e.xhr=u,u.open("GET",s);var l={},f=Math.floor(10*Math.random());l.Range="bytes="+f+"-"+(i+f),l&&Object.keys(l).forEach((function(e){u.setRequestHeader(e,l[e])})),u.onreadystatechange=function(){if(4===u.readyState){e.xhr=null,c=(new Date).getTime();var t=u.getResponseHeader("Content-Length")/1024*8,n=Math.round(1e3*t/(c-a));e.appendList(n),e.timer=setTimeout(e.testSpeed,o)}},u.send()}catch(e){console.error(e)}}}})),Vo(Uo(e),"appendList",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:OL;if(e.speedListCache&&e.speedListCache[n]){var i=e.config.saveSpeedMax;e.speedListCache[n].length>=i&&e.speedListCache[n].shift(),e.speedListCache[n].push(t);var r=Uo(e).player;r&&(n===OL?r.realTimeSpeed=t:r[e.getSpeedName("realTime",n)]=t),e.updateSpeed(n)}})),Vo(Uo(e),"updateSpeed",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:OL,n=e.getSpeed(t),i=Uo(e).player;if(i)if(t===OL)i.avgSpeed&&n===i.avgSpeed||(i.avgSpeed=n,i.emit(_C,{speed:n,realTimeSpeed:i.realTimeSpeed}));else{var r=e.getSpeedName("avg",t);i[r]&&n===i[r]||(i[r]=n,i.emit(_C,{speed:n,realTimeSpeed:i.realTimeSpeed}))}})),e}return No(n,[{key:"afterCreate",value:function(){var e=this.config,t=e.openSpeed,n=e.addSpeedTypeList,i=e.testCnt;(null==n?void 0:n.length)>0&&LL.push.apply(LL,om(n)),this.initSpeedList(),t&&(this.on("real_time_speed",this._onRealSpeedChange),this.timer=null,this.cnt=0,this.xhr=null,i>0&&this.on([cC,bC],this.startTimer))}},{key:"getSpeedName",value:function(e,t){return e+"Speed"+t.toUpperCase()}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){var e=this;this.off("real_time_speed",this._onRealSpeedChange),this.off([cC,bC],this.startTimer),LL.forEach((function(t){e.speedListCache&&e.speedListCache[t]&&(e.speedListCache[t]=[])})),this.speedListCache&&(this.speedListCache={}),clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel&&this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:5,addSpeedTypeList:[]}}}]),n}(A_);function AL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var DL=function(e){jo(n,e);var t=AL(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.config;(this.timer=null,this._lastDecodedFrames=0,this._currentStuckCount=0,this._lastCheckPoint=null,this._payload=[],n.disabled)||t.video.getVideoPlaybackQuality&&(this.on($w,(function(){e._startTick()})),this.on(Qw,(function(){e._stopTick()})),this.on(Zw,(function(){e._stopTick()})),this.on(hC,(function(){e._stopTick()})))}},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._timer=setTimeout((function(){e._checkDecodeFPS(),e._startTick()}),this.config.tick)}},{key:"_stopTick",value:function(){clearTimeout(this._timer),this._timer=null}},{key:"_checkStuck",value:function(e,t,n,i){var r=this.player.video,o=document.hidden,s=r.paused;if("boolean"==typeof o&&!o&&!s){for(var a=r.currentTime,c=r.buffered,u=!1,l=[],f=0;f<c.length;f++){var h=c.start(f),d=c.end(f);if(l.push({start:h,end:d}),h<=a&&a<=d-1){u=!0;break}}4===r.readyState&&u&&(this._currentStuckCount>this.config.stuckCount?(this.emit(VC,this._payload),this._reset()):e<=this.config.reportFrame?(this._currentStuckCount++,this._payload.push({bufs:l,currentTime:r.currentTime,curDecodedFrames:e,totalVideoFrames:t,droppedVideoFrames:n,checkInterval:i})):this._reset())}}},{key:"_reset",value:function(){this._payload=[],this._currentStuckCount=0}},{key:"_checkDecodeFPS",value:function(){if(this.player.video){var e=this.player.video.getVideoPlaybackQuality(),t=e.totalVideoFrames,n=e.droppedVideoFrames,i=performance.now();if(t&&this._lastCheckPoint){var r=t-this._lastDecodedFrames,o=i-this._lastCheckPoint;this._checkStuck(r,t,n,o)}this._lastDecodedFrames=t,this._lastCheckPoint=i}}},{key:"destroy",value:function(){this._stopTick()}}],[{key:"pluginName",get:function(){return"FpsDetect"}},{key:"defaultConfig",get:function(){return{disabled:!1,tick:1e3,stuckCount:3,reportFrame:0}}}]),n}(A_);nx.use({LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}});var ML=No((function e(t,n){var i,r,o;Fo(this,e);var s=n&&"mobile"===n.isMobileSimulateMode,a=n.isLive,c=[].concat(a?[]:[pT,RE,xE,PT],[kT,TT,FT,XT,aE,uE,QT,tE,DT,KT]),u=[Tx,Rx,Mx,tT,Bx,gE,mE,TE,eS];this.plugins=[Cx,xL,PL,TL].concat(om(c),u);var l=s?"mobile":zw.device;switch(l){case"pc":(i=this.plugins).push.apply(i,[JS,rS,dE,IL,DL]);break;case"mobile":(r=this.plugins).push.apply(r,[zS]);break;default:(o=this.plugins).push.apply(o,[JS,rS,dE])}(zw.os.isIpad||"pc"===l)&&this.plugins.push(NE),zw.os.isIpad&&this.plugins.push(rS),this.ignores=[],this.i18n=[]}));function NL(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=Go(e);if(t){var r=Go(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Ho(this,n)}}var FL=function(e){jo(n,e);var t=NL(n);function n(){return Fo(this,n),t.apply(this,arguments)}return No(n)}(ux);return Vo(FL,"defaultPreset",ML),Vo(FL,"Util",jw),Vo(FL,"Sniffer",zw),Vo(FL,"Errors",qw),Vo(FL,"Events",WC),Vo(FL,"Plugin",A_),Vo(FL,"BasePlugin",b_),Vo(FL,"I18N",nx),Vo(FL,"STATE_CLASS",z_),Vo(FL,"PAUSE_TYPES",t_),Vo(FL,"BUFFER_CONTROL_TYPES",n_),FL}));