@vkontakte/videoplayer-statistics 1.0.75-dev.346e0f89.0 → 1.0.75-dev.5de63ea3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/es2015.cjs.js +3 -3
  2. package/es2015.esm.js +3 -3
  3. package/es2018.cjs.js +3 -3
  4. package/es2018.esm.js +3 -3
  5. package/esnext.cjs.js +3 -3
  6. package/esnext.esm.js +3 -3
  7. package/evergreen.esm.js +3 -3
  8. package/package.json +3 -3
  9. package/types/index.d.ts +6 -2
  10. package/types/oneStat/index.d.ts +0 -6
  11. package/types/thinOneStat/Api.d.ts +0 -38
  12. package/types/thinOneStat/ApiTransport.d.ts +0 -25
  13. package/types/thinOneStat/Logger.d.ts +0 -42
  14. package/types/thinOneStat/ThinOneStat.d.ts +0 -83
  15. package/types/thinOneStat/config.d.ts +0 -17
  16. package/types/thinOneStat/env.d.ts +0 -7
  17. package/types/thinOneStat/index.d.ts +0 -1
  18. package/types/thinOneStat/types.d.ts +0 -54
  19. package/types/thinOneStat/utils/calculateTotalViewTime.d.ts +0 -5
  20. package/types/thinOneStat/utils/mappers.d.ts +0 -4
  21. package/types/thinOneStat/utils/timeSynchronisation.d.ts +0 -10
  22. package/types/thinOneStat/utils/uuid.d.ts +0 -1
  23. package/types/thinOneStat/utils/vsid.d.ts +0 -1
  24. package/types/thinOneStat/utils/watchCoverage.d.ts +0 -6
  25. package/types/thinOneStat/values.d.ts +0 -42
  26. /package/types/{oneStat/Api.d.ts → Api.d.ts} +0 -0
  27. /package/types/{oneStat/ApiTransport.d.ts → ApiTransport.d.ts} +0 -0
  28. /package/types/{oneStat/Logger.d.ts → Logger.d.ts} +0 -0
  29. /package/types/{oneStat/OneStat.d.ts → OneStat.d.ts} +0 -0
  30. /package/types/{oneStat/config.d.ts → config.d.ts} +0 -0
  31. /package/types/{oneStat/env.d.ts → env.d.ts} +0 -0
  32. /package/types/{oneStat/types.d.ts → types.d.ts} +0 -0
  33. /package/types/{oneStat/uiEvents.d.ts → uiEvents.d.ts} +0 -0
  34. /package/types/{oneStat/utils → utils}/mappers.d.ts +0 -0
  35. /package/types/{oneStat/utils → utils}/shorten.d.ts +0 -0
  36. /package/types/{oneStat/utils → utils}/timeSynchronisation.d.ts +0 -0
  37. /package/types/{oneStat/utils → utils}/uuid.d.ts +0 -0
  38. /package/types/{oneStat/utils → utils}/vsid.d.ts +0 -0
  39. /package/types/{oneStat/utils → utils}/watchCoverage.d.ts +0 -0
  40. /package/types/{oneStat/values.d.ts → values.d.ts} +0 -0
package/es2018.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-statistics v1.0.75-dev.346e0f89.0
3
- * Wed, 26 Mar 2025 00:45:38 GMT
2
+ * @vkontakte/videoplayer-statistics v1.0.75-dev.5de63ea3.0
3
+ * Thu, 27 Mar 2025 05:06:18 GMT
4
4
  * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-75/doc/
5
5
  */
6
- "use strict";var pd=Object.create;var ar=Object.defineProperty;var hd=Object.getOwnPropertyDescriptor;var vd=Object.getOwnPropertyNames;var gd=Object.getPrototypeOf,md=Object.prototype.hasOwnProperty;var n=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Io=(r,e)=>{for(var t in e)ar(r,t,{get:e[t],enumerable:!0})},So=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of vd(e))!md.call(r,o)&&o!==t&&ar(r,o,{get:()=>e[o],enumerable:!(i=hd(e,o))||i.enumerable});return r};var x=(r,e,t)=>(t=r!=null?pd(gd(r)):{},So(e||!r||!r.__esModule?ar(t,"default",{value:r,enumerable:!0}):t,r)),bd=r=>So(ar({},"__esModule",{value:!0}),r);var O=n((dt,Eo)=>{"use strict";var Re=function(r){return r&&r.Math===Math&&r};Eo.exports=Re(typeof globalThis=="object"&&globalThis)||Re(typeof window=="object"&&window)||Re(typeof self=="object"&&self)||Re(typeof global=="object"&&global)||Re(typeof dt=="object"&&dt)||function(){return this}()||Function("return this")()});var R=n((yy,Po)=>{"use strict";Po.exports=function(r){try{return!!r()}catch(e){return!0}}});var Ce=n((Iy,_o)=>{"use strict";var yd=R();_o.exports=!yd(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var ft=n((Sy,qo)=>{"use strict";var Id=Ce(),wo=Function.prototype,To=wo.apply,Oo=wo.call;qo.exports=typeof Reflect=="object"&&Reflect.apply||(Id?Oo.bind(To):function(){return Oo.apply(To,arguments)})});var C=n((Ey,Ro)=>{"use strict";var Ao=Ce(),xo=Function.prototype,pt=xo.call,Sd=Ao&&xo.bind.bind(pt,pt);Ro.exports=Ao?Sd:function(r){return function(){return pt.apply(r,arguments)}}});var Le=n((Py,Lo)=>{"use strict";var Co=C(),Ed=Co({}.toString),Pd=Co("".slice);Lo.exports=function(r){return Pd(Ed(r),8,-1)}});var ht=n((_y,No)=>{"use strict";var _d=Le(),Td=C();No.exports=function(r){if(_d(r)==="Function")return Td(r)}});var w=n((Ty,ko)=>{"use strict";var vt=typeof document=="object"&&document.all;ko.exports=typeof vt=="undefined"&&vt!==void 0?function(r){return typeof r=="function"||r===vt}:function(r){return typeof r=="function"}});var N=n((Oy,Do)=>{"use strict";var Od=R();Do.exports=!Od(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var U=n((wy,$o)=>{"use strict";var wd=Ce(),ur=Function.prototype.call;$o.exports=wd?ur.bind(ur):function(){return ur.apply(ur,arguments)}});var gt=n(Fo=>{"use strict";var Mo={}.propertyIsEnumerable,Bo=Object.getOwnPropertyDescriptor,qd=Bo&&!Mo.call({1:2},1);Fo.f=qd?function(e){var t=Bo(this,e);return!!t&&t.enumerable}:Mo});var Ne=n((Ay,Uo)=>{"use strict";Uo.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var Vo=n((xy,jo)=>{"use strict";var Ad=C(),xd=R(),Rd=Le(),mt=Object,Cd=Ad("".split);jo.exports=xd(function(){return!mt("z").propertyIsEnumerable(0)})?function(r){return Rd(r)==="String"?Cd(r,""):mt(r)}:mt});var ke=n((Ry,Ko)=>{"use strict";Ko.exports=function(r){return r==null}});var de=n((Cy,Wo)=>{"use strict";var Ld=ke(),Nd=TypeError;Wo.exports=function(r){if(Ld(r))throw new Nd("Can't call method on "+r);return r}});var te=n((Ly,Ho)=>{"use strict";var kd=Vo(),Dd=de();Ho.exports=function(r){return kd(Dd(r))}});var j=n((Ny,Go)=>{"use strict";var $d=w();Go.exports=function(r){return typeof r=="object"?r!==null:$d(r)}});var De=n((ky,zo)=>{"use strict";zo.exports={}});var Q=n((Dy,Yo)=>{"use strict";var bt=De(),yt=O(),Md=w(),Qo=function(r){return Md(r)?r:void 0};Yo.exports=function(r,e){return arguments.length<2?Qo(bt[r])||Qo(yt[r]):bt[r]&&bt[r][e]||yt[r]&&yt[r][e]}});var cr=n(($y,Jo)=>{"use strict";var Bd=C();Jo.exports=Bd({}.isPrototypeOf)});var ie=n((My,en)=>{"use strict";var Fd=O(),Xo=Fd.navigator,Zo=Xo&&Xo.userAgent;en.exports=Zo?String(Zo):""});var St=n((By,an)=>{"use strict";var sn=O(),It=ie(),rn=sn.process,tn=sn.Deno,on=rn&&rn.versions||tn&&tn.version,nn=on&&on.v8,V,lr;nn&&(V=nn.split("."),lr=V[0]>0&&V[0]<4?1:+(V[0]+V[1]));!lr&&It&&(V=It.match(/Edge\/(\d+)/),(!V||V[1]>=74)&&(V=It.match(/Chrome\/(\d+)/),V&&(lr=+V[1])));an.exports=lr});var Et=n((Fy,cn)=>{"use strict";var un=St(),Ud=R(),jd=O(),Vd=jd.String;cn.exports=!!Object.getOwnPropertySymbols&&!Ud(function(){var r=Symbol("symbol detection");return!Vd(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&un&&un<41})});var Pt=n((Uy,ln)=>{"use strict";var Kd=Et();ln.exports=Kd&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var _t=n((jy,dn)=>{"use strict";var Wd=Q(),Hd=w(),Gd=cr(),zd=Pt(),Qd=Object;dn.exports=zd?function(r){return typeof r=="symbol"}:function(r){var e=Wd("Symbol");return Hd(e)&&Gd(e.prototype,Qd(r))}});var $e=n((Vy,fn)=>{"use strict";var Yd=String;fn.exports=function(r){try{return Yd(r)}catch(e){return"Object"}}});var Y=n((Ky,pn)=>{"use strict";var Jd=w(),Xd=$e(),Zd=TypeError;pn.exports=function(r){if(Jd(r))return r;throw new Zd(Xd(r)+" is not a function")}});var dr=n((Wy,hn)=>{"use strict";var ef=Y(),rf=ke();hn.exports=function(r,e){var t=r[e];return rf(t)?void 0:ef(t)}});var gn=n((Hy,vn)=>{"use strict";var Tt=U(),Ot=w(),wt=j(),tf=TypeError;vn.exports=function(r,e){var t,i;if(e==="string"&&Ot(t=r.toString)&&!wt(i=Tt(t,r))||Ot(t=r.valueOf)&&!wt(i=Tt(t,r))||e!=="string"&&Ot(t=r.toString)&&!wt(i=Tt(t,r)))return i;throw new tf("Can't convert object to primitive value")}});var G=n((Gy,mn)=>{"use strict";mn.exports=!0});var In=n((zy,yn)=>{"use strict";var bn=O(),of=Object.defineProperty;yn.exports=function(r,e){try{of(bn,r,{value:e,configurable:!0,writable:!0})}catch(t){bn[r]=e}return e}});var Me=n((Qy,Pn)=>{"use strict";var nf=G(),sf=O(),af=In(),Sn="__core-js_shared__",En=Pn.exports=sf[Sn]||af(Sn,{});(En.versions||(En.versions=[])).push({version:"3.38.0",mode:nf?"pure":"global",copyright:"\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var qt=n((Yy,Tn)=>{"use strict";var _n=Me();Tn.exports=function(r,e){return _n[r]||(_n[r]=e||{})}});var At=n((Jy,On)=>{"use strict";var uf=de(),cf=Object;On.exports=function(r){return cf(uf(r))}});var z=n((Xy,wn)=>{"use strict";var lf=C(),df=At(),ff=lf({}.hasOwnProperty);wn.exports=Object.hasOwn||function(e,t){return ff(df(e),t)}});var xt=n((Zy,qn)=>{"use strict";var pf=C(),hf=0,vf=Math.random(),gf=pf(1 .toString);qn.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+gf(++hf+vf,36)}});var k=n((eI,xn)=>{"use strict";var mf=O(),bf=qt(),An=z(),yf=xt(),If=Et(),Sf=Pt(),fe=mf.Symbol,Rt=bf("wks"),Ef=Sf?fe.for||fe:fe&&fe.withoutSetter||yf;xn.exports=function(r){return An(Rt,r)||(Rt[r]=If&&An(fe,r)?fe[r]:Ef("Symbol."+r)),Rt[r]}});var Nn=n((rI,Ln)=>{"use strict";var Pf=U(),Rn=j(),Cn=_t(),_f=dr(),Tf=gn(),Of=k(),wf=TypeError,qf=Of("toPrimitive");Ln.exports=function(r,e){if(!Rn(r)||Cn(r))return r;var t=_f(r,qf),i;if(t){if(e===void 0&&(e="default"),i=Pf(t,r,e),!Rn(i)||Cn(i))return i;throw new wf("Can't convert object to primitive value")}return e===void 0&&(e="number"),Tf(r,e)}});var Ct=n((tI,kn)=>{"use strict";var Af=Nn(),xf=_t();kn.exports=function(r){var e=Af(r,"string");return xf(e)?e:e+""}});var fr=n((iI,$n)=>{"use strict";var Rf=O(),Dn=j(),Lt=Rf.document,Cf=Dn(Lt)&&Dn(Lt.createElement);$n.exports=function(r){return Cf?Lt.createElement(r):{}}});var Nt=n((oI,Mn)=>{"use strict";var Lf=N(),Nf=R(),kf=fr();Mn.exports=!Lf&&!Nf(function(){return Object.defineProperty(kf("div"),"a",{get:function(){return 7}}).a!==7})});var Un=n(Fn=>{"use strict";var Df=N(),$f=U(),Mf=gt(),Bf=Ne(),Ff=te(),Uf=Ct(),jf=z(),Vf=Nt(),Bn=Object.getOwnPropertyDescriptor;Fn.f=Df?Bn:function(e,t){if(e=Ff(e),t=Uf(t),Vf)try{return Bn(e,t)}catch(i){}if(jf(e,t))return Bf(!$f(Mf.f,e,t),e[t])}});var kt=n((sI,jn)=>{"use strict";var Kf=R(),Wf=w(),Hf=/#|\.prototype\./,Be=function(r,e){var t=zf[Gf(r)];return t===Yf?!0:t===Qf?!1:Wf(e)?Kf(e):!!e},Gf=Be.normalize=function(r){return String(r).replace(Hf,".").toLowerCase()},zf=Be.data={},Qf=Be.NATIVE="N",Yf=Be.POLYFILL="P";jn.exports=Be});var Fe=n((aI,Kn)=>{"use strict";var Vn=ht(),Jf=Y(),Xf=Ce(),Zf=Vn(Vn.bind);Kn.exports=function(r,e){return Jf(r),e===void 0?r:Xf?Zf(r,e):function(){return r.apply(e,arguments)}}});var Dt=n((uI,Wn)=>{"use strict";var ep=N(),rp=R();Wn.exports=ep&&rp(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var J=n((cI,Hn)=>{"use strict";var tp=j(),ip=String,op=TypeError;Hn.exports=function(r){if(tp(r))return r;throw new op(ip(r)+" is not an object")}});var oe=n(zn=>{"use strict";var np=N(),sp=Nt(),ap=Dt(),pr=J(),Gn=Ct(),up=TypeError,$t=Object.defineProperty,cp=Object.getOwnPropertyDescriptor,Mt="enumerable",Bt="configurable",Ft="writable";zn.f=np?ap?function(e,t,i){if(pr(e),t=Gn(t),pr(i),typeof e=="function"&&t==="prototype"&&"value"in i&&Ft in i&&!i[Ft]){var o=cp(e,t);o&&o[Ft]&&(e[t]=i.value,i={configurable:Bt in i?i[Bt]:o[Bt],enumerable:Mt in i?i[Mt]:o[Mt],writable:!1})}return $t(e,t,i)}:$t:function(e,t,i){if(pr(e),t=Gn(t),pr(i),sp)try{return $t(e,t,i)}catch(o){}if("get"in i||"set"in i)throw new up("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var pe=n((dI,Qn)=>{"use strict";var lp=N(),dp=oe(),fp=Ne();Qn.exports=lp?function(r,e,t){return dp.f(r,e,fp(1,t))}:function(r,e,t){return r[e]=t,r}});var D=n((fI,Jn)=>{"use strict";var Ue=O(),pp=ft(),hp=ht(),vp=w(),gp=Un().f,mp=kt(),he=De(),bp=Fe(),ve=pe(),Yn=z();Me();var yp=function(r){var e=function(t,i,o){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,i)}return new r(t,i,o)}return pp(r,this,arguments)};return e.prototype=r.prototype,e};Jn.exports=function(r,e){var t=r.target,i=r.global,o=r.stat,s=r.proto,a=i?Ue:o?Ue[t]:Ue[t]&&Ue[t].prototype,d=i?he:he[t]||ve(he,t,{})[t],l=d.prototype,c,f,h,u,p,m,b,I,y;for(u in e)c=mp(i?u:t+(o?".":"#")+u,r.forced),f=!c&&a&&Yn(a,u),m=d[u],f&&(r.dontCallGetSet?(y=gp(a,u),b=y&&y.value):b=a[u]),p=f&&b?b:e[u],!(!c&&!s&&typeof m==typeof p)&&(r.bind&&f?I=bp(p,Ue):r.wrap&&f?I=yp(p):s&&vp(p)?I=hp(p):I=p,(r.sham||p&&p.sham||m&&m.sham)&&ve(I,"sham",!0),ve(d,u,I),s&&(h=t+"Prototype",Yn(he,h)||ve(he,h,{}),ve(he[h],u,p),r.real&&l&&(c||!l[u])&&ve(l,u,p)))}});var Zn=n((pI,Xn)=>{"use strict";var Ip=Math.ceil,Sp=Math.floor;Xn.exports=Math.trunc||function(e){var t=+e;return(t>0?Sp:Ip)(t)}});var hr=n((hI,es)=>{"use strict";var Ep=Zn();es.exports=function(r){var e=+r;return e!==e||e===0?0:Ep(e)}});var ts=n((vI,rs)=>{"use strict";var Pp=hr(),_p=Math.max,Tp=Math.min;rs.exports=function(r,e){var t=Pp(r);return t<0?_p(t+e,0):Tp(t,e)}});var Ut=n((gI,is)=>{"use strict";var Op=hr(),wp=Math.min;is.exports=function(r){var e=Op(r);return e>0?wp(e,9007199254740991):0}});var jt=n((mI,os)=>{"use strict";var qp=Ut();os.exports=function(r){return qp(r.length)}});var Vt=n((bI,ss)=>{"use strict";var Ap=te(),xp=ts(),Rp=jt(),ns=function(r){return function(e,t,i){var o=Ap(e),s=Rp(o);if(s===0)return!r&&-1;var a=xp(i,s),d;if(r&&t!==t){for(;s>a;)if(d=o[a++],d!==d)return!0}else for(;s>a;a++)if((r||a in o)&&o[a]===t)return r||a||0;return!r&&-1}};ss.exports={includes:ns(!0),indexOf:ns(!1)}});var Kt=n((yI,as)=>{"use strict";as.exports=function(){}});var us=n(()=>{"use strict";var Cp=D(),Lp=Vt().includes,Np=R(),kp=Kt(),Dp=Np(function(){return!Array(1).includes()});Cp({target:"Array",proto:!0,forced:Dp},{includes:function(e){return Lp(this,e,arguments.length>1?arguments[1]:void 0)}});kp("includes")});var vr=n((EI,cs)=>{"use strict";var $p=Q();cs.exports=$p});var ds=n((PI,ls)=>{"use strict";us();var Mp=vr();ls.exports=Mp("Array","includes")});var ps=n((_I,fs)=>{"use strict";var Bp=ds();fs.exports=Bp});var ge=n((TI,hs)=>{"use strict";var Fp=ps();hs.exports=Fp});var Es=n(()=>{"use strict"});var zt=n(($I,Ps)=>{"use strict";var Ve=O(),jp=ie(),Vp=Le(),Ir=function(r){return jp.slice(0,r.length)===r};Ps.exports=function(){return Ir("Bun/")?"BUN":Ir("Cloudflare-Workers")?"CLOUDFLARE":Ir("Deno/")?"DENO":Ir("Node.js/")?"NODE":Ve.Bun&&typeof Bun.version=="string"?"BUN":Ve.Deno&&typeof Deno.version=="object"?"DENO":Vp(Ve.process)==="process"?"NODE":Ve.window&&Ve.document?"BROWSER":"REST"}()});var Sr=n((MI,_s)=>{"use strict";var Kp=zt();_s.exports=Kp==="NODE"});var be=n((BI,Ts)=>{"use strict";var Wp=pe();Ts.exports=function(r,e,t,i){return i&&i.enumerable?r[e]=t:Wp(r,e,t),r}});var ws=n((FI,Os)=>{"use strict";var Hp=C(),Gp=Y();Os.exports=function(r,e,t){try{return Hp(Gp(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(i){}}});var As=n((UI,qs)=>{"use strict";var zp=j();qs.exports=function(r){return zp(r)||r===null}});var Rs=n((jI,xs)=>{"use strict";var Qp=As(),Yp=String,Jp=TypeError;xs.exports=function(r){if(Qp(r))return r;throw new Jp("Can't set "+Yp(r)+" as a prototype")}});var Qt=n((VI,Cs)=>{"use strict";var Xp=ws(),Zp=j(),eh=de(),rh=Rs();Cs.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=Xp(Object.prototype,"__proto__","set"),t(e,[]),r=e instanceof Array}catch(i){}return function(o,s){return eh(o),rh(s),Zp(o)&&(r?t(o,s):o.__proto__=s),o}}():void 0)});var Er=n((KI,Ns)=>{"use strict";var th=k(),ih=th("toStringTag"),Ls={};Ls[ih]="z";Ns.exports=String(Ls)==="[object z]"});var Ke=n((WI,ks)=>{"use strict";var oh=Er(),nh=w(),Pr=Le(),sh=k(),ah=sh("toStringTag"),uh=Object,ch=Pr(function(){return arguments}())==="Arguments",lh=function(r,e){try{return r[e]}catch(t){}};ks.exports=oh?Pr:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=lh(e=uh(r),ah))=="string"?t:ch?Pr(e):(i=Pr(e))==="Object"&&nh(e.callee)?"Arguments":i}});var $s=n((HI,Ds)=>{"use strict";var dh=Er(),fh=Ke();Ds.exports=dh?{}.toString:function(){return"[object "+fh(this)+"]"}});var We=n((GI,Bs)=>{"use strict";var ph=Er(),hh=oe().f,vh=pe(),gh=z(),mh=$s(),bh=k(),Ms=bh("toStringTag");Bs.exports=function(r,e,t,i){var o=t?r:r&&r.prototype;o&&(gh(o,Ms)||hh(o,Ms,{configurable:!0,value:e}),i&&!ph&&vh(o,"toString",mh))}});var Us=n((zI,Fs)=>{"use strict";var yh=oe();Fs.exports=function(r,e,t){return yh.f(r,e,t)}});var Ks=n((QI,Vs)=>{"use strict";var Ih=Q(),Sh=Us(),Eh=k(),Ph=N(),js=Eh("species");Vs.exports=function(r){var e=Ih(r);Ph&&e&&!e[js]&&Sh(e,js,{configurable:!0,get:function(){return this}})}});var Hs=n((YI,Ws)=>{"use strict";var _h=cr(),Th=TypeError;Ws.exports=function(r,e){if(_h(e,r))return r;throw new Th("Incorrect invocation")}});var Jt=n((JI,Gs)=>{"use strict";var Oh=C(),wh=w(),Yt=Me(),qh=Oh(Function.toString);wh(Yt.inspectSource)||(Yt.inspectSource=function(r){return qh(r)});Gs.exports=Yt.inspectSource});var Zs=n((XI,Xs)=>{"use strict";var Ah=C(),xh=R(),zs=w(),Rh=Ke(),Ch=Q(),Lh=Jt(),Qs=function(){},Ys=Ch("Reflect","construct"),Xt=/^\s*(?:class|function)\b/,Nh=Ah(Xt.exec),kh=!Xt.test(Qs),He=function(e){if(!zs(e))return!1;try{return Ys(Qs,[],e),!0}catch(t){return!1}},Js=function(e){if(!zs(e))return!1;switch(Rh(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return kh||!!Nh(Xt,Lh(e))}catch(t){return!0}};Js.sham=!0;Xs.exports=!Ys||xh(function(){var r;return He(He.call)||!He(Object)||!He(function(){r=!0})||r})?Js:He});var ra=n((ZI,ea)=>{"use strict";var Dh=Zs(),$h=$e(),Mh=TypeError;ea.exports=function(r){if(Dh(r))return r;throw new Mh($h(r)+" is not a constructor")}});var Zt=n((eS,ia)=>{"use strict";var ta=J(),Bh=ra(),Fh=ke(),Uh=k(),jh=Uh("species");ia.exports=function(r,e){var t=ta(r).constructor,i;return t===void 0||Fh(i=ta(t)[jh])?e:Bh(i)}});var ei=n((rS,oa)=>{"use strict";var Vh=Q();oa.exports=Vh("document","documentElement")});var sa=n((tS,na)=>{"use strict";var Kh=C();na.exports=Kh([].slice)});var ua=n((iS,aa)=>{"use strict";var Wh=TypeError;aa.exports=function(r,e){if(r<e)throw new Wh("Not enough arguments");return r}});var ri=n((oS,ca)=>{"use strict";var Hh=ie();ca.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(Hh)});var li=n((nS,ba)=>{"use strict";var $=O(),Gh=ft(),zh=Fe(),la=w(),Qh=z(),ma=R(),da=ei(),Yh=sa(),fa=fr(),Jh=ua(),Xh=ri(),Zh=Sr(),ai=$.setImmediate,ui=$.clearImmediate,ev=$.process,ti=$.Dispatch,rv=$.Function,pa=$.MessageChannel,tv=$.String,ii=0,Ge={},ha="onreadystatechange",ze,ne,oi,ni;ma(function(){ze=$.location});var ci=function(r){if(Qh(Ge,r)){var e=Ge[r];delete Ge[r],e()}},si=function(r){return function(){ci(r)}},va=function(r){ci(r.data)},ga=function(r){$.postMessage(tv(r),ze.protocol+"//"+ze.host)};(!ai||!ui)&&(ai=function(e){Jh(arguments.length,1);var t=la(e)?e:rv(e),i=Yh(arguments,1);return Ge[++ii]=function(){Gh(t,void 0,i)},ne(ii),ii},ui=function(e){delete Ge[e]},Zh?ne=function(r){ev.nextTick(si(r))}:ti&&ti.now?ne=function(r){ti.now(si(r))}:pa&&!Xh?(oi=new pa,ni=oi.port2,oi.port1.onmessage=va,ne=zh(ni.postMessage,ni)):$.addEventListener&&la($.postMessage)&&!$.importScripts&&ze&&ze.protocol!=="file:"&&!ma(ga)?(ne=ga,$.addEventListener("message",va,!1)):ha in fa("script")?ne=function(r){da.appendChild(fa("script"))[ha]=function(){da.removeChild(this),ci(r)}}:ne=function(r){setTimeout(si(r),0)});ba.exports={set:ai,clear:ui}});var Sa=n((sS,Ia)=>{"use strict";var ya=O(),iv=N(),ov=Object.getOwnPropertyDescriptor;Ia.exports=function(r){if(!iv)return ya[r];var e=ov(ya,r);return e&&e.value}});var di=n((aS,Pa)=>{"use strict";var Ea=function(){this.head=null,this.tail=null};Ea.prototype={add:function(r){var e={item:r,next:null},t=this.tail;t?t.next=e:this.head=e,this.tail=e},get:function(){var r=this.head;if(r){var e=this.head=r.next;return e===null&&(this.tail=null),r.item}}};Pa.exports=Ea});var Ta=n((uS,_a)=>{"use strict";var nv=ie();_a.exports=/ipad|iphone|ipod/i.test(nv)&&typeof Pebble!="undefined"});var wa=n((cS,Oa)=>{"use strict";var sv=ie();Oa.exports=/web0s(?!.*chrome)/i.test(sv)});var Na=n((lS,La)=>{"use strict";var Ie=O(),av=Sa(),qa=Fe(),fi=li().set,uv=di(),cv=ri(),lv=Ta(),dv=wa(),pi=Sr(),Aa=Ie.MutationObserver||Ie.WebKitMutationObserver,xa=Ie.document,Ra=Ie.process,_r=Ie.Promise,gi=av("queueMicrotask"),ye,hi,vi,Tr,Ca;gi||(Qe=new uv,Ye=function(){var r,e;for(pi&&(r=Ra.domain)&&r.exit();e=Qe.get();)try{e()}catch(t){throw Qe.head&&ye(),t}r&&r.enter()},!cv&&!pi&&!dv&&Aa&&xa?(hi=!0,vi=xa.createTextNode(""),new Aa(Ye).observe(vi,{characterData:!0}),ye=function(){vi.data=hi=!hi}):!lv&&_r&&_r.resolve?(Tr=_r.resolve(void 0),Tr.constructor=_r,Ca=qa(Tr.then,Tr),ye=function(){Ca(Ye)}):pi?ye=function(){Ra.nextTick(Ye)}:(fi=qa(fi,Ie),ye=function(){fi(Ye)}),gi=function(r){Qe.head||ye(),Qe.add(r)});var Qe,Ye;La.exports=gi});var Da=n((dS,ka)=>{"use strict";ka.exports=function(r,e){try{arguments.length===1?console.error(r):console.error(r,e)}catch(t){}}});var Or=n((fS,$a)=>{"use strict";$a.exports=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}}});var Fa=n((pS,Ba)=>{"use strict";var fv=O(),pv=w(),Ma=fv.WeakMap;Ba.exports=pv(Ma)&&/native code/.test(String(Ma))});var wr=n((hS,ja)=>{"use strict";var hv=qt(),vv=xt(),Ua=hv("keys");ja.exports=function(r){return Ua[r]||(Ua[r]=vv(r))}});var qr=n((vS,Va)=>{"use strict";Va.exports={}});var Ii=n((gS,Ha)=>{"use strict";var gv=Fa(),Wa=O(),mv=j(),bv=pe(),mi=z(),bi=Me(),yv=wr(),Iv=qr(),Ka="Object already initialized",yi=Wa.TypeError,Sv=Wa.WeakMap,Ar,Je,xr,Ev=function(r){return xr(r)?Je(r):Ar(r,{})},Pv=function(r){return function(e){var t;if(!mv(e)||(t=Je(e)).type!==r)throw new yi("Incompatible receiver, "+r+" required");return t}};gv||bi.state?(K=bi.state||(bi.state=new Sv),K.get=K.get,K.has=K.has,K.set=K.set,Ar=function(r,e){if(K.has(r))throw new yi(Ka);return e.facade=r,K.set(r,e),e},Je=function(r){return K.get(r)||{}},xr=function(r){return K.has(r)}):(se=yv("state"),Iv[se]=!0,Ar=function(r,e){if(mi(r,se))throw new yi(Ka);return e.facade=r,bv(r,se,e),e},Je=function(r){return mi(r,se)?r[se]:{}},xr=function(r){return mi(r,se)});var K,se;Ha.exports={set:Ar,get:Je,has:xr,enforce:Ev,getterFor:Pv}});var ae=n((mS,Ga)=>{"use strict";var _v=O();Ga.exports=_v.Promise});var Se=n((bS,Ja)=>{"use strict";var Tv=O(),Xe=ae(),Ov=w(),wv=kt(),qv=Jt(),Av=k(),za=zt(),xv=G(),Si=St(),Qa=Xe&&Xe.prototype,Rv=Av("species"),Ei=!1,Ya=Ov(Tv.PromiseRejectionEvent),Cv=wv("Promise",function(){var r=qv(Xe),e=r!==String(Xe);if(!e&&Si===66||xv&&!(Qa.catch&&Qa.finally))return!0;if(!Si||Si<51||!/native code/.test(r)){var t=new Xe(function(s){s(1)}),i=function(s){s(function(){},function(){})},o=t.constructor={};if(o[Rv]=i,Ei=t.then(function(){})instanceof i,!Ei)return!0}return!e&&(za==="BROWSER"||za==="DENO")&&!Ya});Ja.exports={CONSTRUCTOR:Cv,REJECTION_EVENT:Ya,SUBCLASSING:Ei}});var Ee=n((yS,Za)=>{"use strict";var Xa=Y(),Lv=TypeError,Nv=function(r){var e,t;this.promise=new r(function(i,o){if(e!==void 0||t!==void 0)throw new Lv("Bad Promise constructor");e=i,t=o}),this.resolve=Xa(e),this.reject=Xa(t)};Za.exports.f=function(r){return new Nv(r)}});var bu=n(()=>{"use strict";var kv=D(),Dv=G(),Nr=Sr(),re=O(),Oe=U(),eu=be(),ru=Qt(),$v=We(),Mv=Ks(),Bv=Y(),Lr=w(),Fv=j(),Uv=Hs(),jv=Zt(),su=li().set,wi=Na(),Vv=Da(),Kv=Or(),Wv=di(),au=Ii(),kr=ae(),qi=Se(),uu=Ee(),Dr="Promise",cu=qi.CONSTRUCTOR,Hv=qi.REJECTION_EVENT,Gv=qi.SUBCLASSING,Pi=au.getterFor(Dr),zv=au.set,Pe=kr&&kr.prototype,ue=kr,Rr=Pe,lu=re.TypeError,_i=re.document,Ai=re.process,Ti=uu.f,Qv=Ti,Yv=!!(_i&&_i.createEvent&&re.dispatchEvent),du="unhandledrejection",Jv="rejectionhandled",tu=0,fu=1,Xv=2,xi=1,pu=2,Cr,iu,Zv,ou,hu=function(r){var e;return Fv(r)&&Lr(e=r.then)?e:!1},vu=function(r,e){var t=e.value,i=e.state===fu,o=i?r.ok:r.fail,s=r.resolve,a=r.reject,d=r.domain,l,c,f;try{o?(i||(e.rejection===pu&&rg(e),e.rejection=xi),o===!0?l=t:(d&&d.enter(),l=o(t),d&&(d.exit(),f=!0)),l===r.promise?a(new lu("Promise-chain cycle")):(c=hu(l))?Oe(c,l,s,a):s(l)):a(t)}catch(h){d&&!f&&d.exit(),a(h)}},gu=function(r,e){r.notified||(r.notified=!0,wi(function(){for(var t=r.reactions,i;i=t.get();)vu(i,r);r.notified=!1,e&&!r.rejection&&eg(r)}))},mu=function(r,e,t){var i,o;Yv?(i=_i.createEvent("Event"),i.promise=e,i.reason=t,i.initEvent(r,!1,!0),re.dispatchEvent(i)):i={promise:e,reason:t},!Hv&&(o=re["on"+r])?o(i):r===du&&Vv("Unhandled promise rejection",t)},eg=function(r){Oe(su,re,function(){var e=r.facade,t=r.value,i=nu(r),o;if(i&&(o=Kv(function(){Nr?Ai.emit("unhandledRejection",t,e):mu(du,e,t)}),r.rejection=Nr||nu(r)?pu:xi,o.error))throw o.value})},nu=function(r){return r.rejection!==xi&&!r.parent},rg=function(r){Oe(su,re,function(){var e=r.facade;Nr?Ai.emit("rejectionHandled",e):mu(Jv,e,r.value)})},_e=function(r,e,t){return function(i){r(e,i,t)}},Te=function(r,e,t){r.done||(r.done=!0,t&&(r=t),r.value=e,r.state=Xv,gu(r,!0))},Oi=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw new lu("Promise can't be resolved itself");var i=hu(e);i?wi(function(){var o={done:!1};try{Oe(i,e,_e(Oi,o,r),_e(Te,o,r))}catch(s){Te(o,s,r)}}):(r.value=e,r.state=fu,gu(r,!1))}catch(o){Te({done:!1},o,r)}}};if(cu&&(ue=function(e){Uv(this,Rr),Bv(e),Oe(Cr,this);var t=Pi(this);try{e(_e(Oi,t),_e(Te,t))}catch(i){Te(t,i)}},Rr=ue.prototype,Cr=function(e){zv(this,{type:Dr,done:!1,notified:!1,parent:!1,reactions:new Wv,rejection:!1,state:tu,value:void 0})},Cr.prototype=eu(Rr,"then",function(e,t){var i=Pi(this),o=Ti(jv(this,ue));return i.parent=!0,o.ok=Lr(e)?e:!0,o.fail=Lr(t)&&t,o.domain=Nr?Ai.domain:void 0,i.state===tu?i.reactions.add(o):wi(function(){vu(o,i)}),o.promise}),iu=function(){var r=new Cr,e=Pi(r);this.promise=r,this.resolve=_e(Oi,e),this.reject=_e(Te,e)},uu.f=Ti=function(r){return r===ue||r===Zv?new iu(r):Qv(r)},!Dv&&Lr(kr)&&Pe!==Object.prototype)){ou=Pe.then,Gv||eu(Pe,"then",function(e,t){var i=this;return new ue(function(o,s){Oe(ou,i,o,s)}).then(e,t)},{unsafe:!0});try{delete Pe.constructor}catch(r){}ru&&ru(Pe,Rr)}kv({global:!0,constructor:!0,wrap:!0,forced:cu},{Promise:ue});$v(ue,Dr,!1,!0);Mv(Dr)});var ce=n((ES,yu)=>{"use strict";yu.exports={}});var Su=n((PS,Iu)=>{"use strict";var tg=k(),ig=ce(),og=tg("iterator"),ng=Array.prototype;Iu.exports=function(r){return r!==void 0&&(ig.Array===r||ng[og]===r)}});var Ri=n((_S,Pu)=>{"use strict";var sg=Ke(),Eu=dr(),ag=ke(),ug=ce(),cg=k(),lg=cg("iterator");Pu.exports=function(r){if(!ag(r))return Eu(r,lg)||Eu(r,"@@iterator")||ug[sg(r)]}});var Tu=n((TS,_u)=>{"use strict";var dg=U(),fg=Y(),pg=J(),hg=$e(),vg=Ri(),gg=TypeError;_u.exports=function(r,e){var t=arguments.length<2?vg(r):e;if(fg(t))return pg(dg(t,r));throw new gg(hg(r)+" is not iterable")}});var qu=n((OS,wu)=>{"use strict";var mg=U(),Ou=J(),bg=dr();wu.exports=function(r,e,t){var i,o;Ou(r);try{if(i=bg(r,"return"),!i){if(e==="throw")throw t;return t}i=mg(i,r)}catch(s){o=!0,i=s}if(e==="throw")throw t;if(o)throw i;return Ou(i),t}});var Mr=n((wS,Cu)=>{"use strict";var yg=Fe(),Ig=U(),Sg=J(),Eg=$e(),Pg=Su(),_g=jt(),Au=cr(),Tg=Tu(),Og=Ri(),xu=qu(),wg=TypeError,$r=function(r,e){this.stopped=r,this.result=e},Ru=$r.prototype;Cu.exports=function(r,e,t){var i=t&&t.that,o=!!(t&&t.AS_ENTRIES),s=!!(t&&t.IS_RECORD),a=!!(t&&t.IS_ITERATOR),d=!!(t&&t.INTERRUPTED),l=yg(e,i),c,f,h,u,p,m,b,I=function(S){return c&&xu(c,"normal",S),new $r(!0,S)},y=function(S){return o?(Sg(S),d?l(S[0],S[1],I):l(S[0],S[1])):d?l(S,I):l(S)};if(s)c=r.iterator;else if(a)c=r;else{if(f=Og(r),!f)throw new wg(Eg(r)+" is not iterable");if(Pg(f)){for(h=0,u=_g(r);u>h;h++)if(p=y(r[h]),p&&Au(Ru,p))return p;return new $r(!1)}c=Tg(r,f)}for(m=s?r.next:c.next;!(b=Ig(m,c)).done;){try{p=y(b.value)}catch(S){xu(c,"throw",S)}if(typeof p=="object"&&p&&Au(Ru,p))return p}return new $r(!1)}});var $u=n((qS,Du)=>{"use strict";var qg=k(),Nu=qg("iterator"),ku=!1;try{Lu=0,Ci={next:function(){return{done:!!Lu++}},return:function(){ku=!0}},Ci[Nu]=function(){return this},Array.from(Ci,function(){throw 2})}catch(r){}var Lu,Ci;Du.exports=function(r,e){try{if(!e&&!ku)return!1}catch(o){return!1}var t=!1;try{var i={};i[Nu]=function(){return{next:function(){return{done:t=!0}}}},r(i)}catch(o){}return t}});var Li=n((AS,Mu)=>{"use strict";var Ag=ae(),xg=$u(),Rg=Se().CONSTRUCTOR;Mu.exports=Rg||!xg(function(r){Ag.all(r).then(void 0,function(){})})});var Bu=n(()=>{"use strict";var Cg=D(),Lg=U(),Ng=Y(),kg=Ee(),Dg=Or(),$g=Mr(),Mg=Li();Cg({target:"Promise",stat:!0,forced:Mg},{all:function(e){var t=this,i=kg.f(t),o=i.resolve,s=i.reject,a=Dg(function(){var d=Ng(t.resolve),l=[],c=0,f=1;$g(e,function(h){var u=c++,p=!1;f++,Lg(d,t,h).then(function(m){p||(p=!0,l[u]=m,--f||o(l))},s)}),--f||o(l)});return a.error&&s(a.value),i.promise}})});var Uu=n(()=>{"use strict";var Bg=D(),Fg=G(),Ug=Se().CONSTRUCTOR,ki=ae(),jg=Q(),Vg=w(),Kg=be(),Fu=ki&&ki.prototype;Bg({target:"Promise",proto:!0,forced:Ug,real:!0},{catch:function(r){return this.then(void 0,r)}});!Fg&&Vg(ki)&&(Ni=jg("Promise").prototype.catch,Fu.catch!==Ni&&Kg(Fu,"catch",Ni,{unsafe:!0}));var Ni});var ju=n(()=>{"use strict";var Wg=D(),Hg=U(),Gg=Y(),zg=Ee(),Qg=Or(),Yg=Mr(),Jg=Li();Wg({target:"Promise",stat:!0,forced:Jg},{race:function(e){var t=this,i=zg.f(t),o=i.reject,s=Qg(function(){var a=Gg(t.resolve);Yg(e,function(d){Hg(a,t,d).then(i.resolve,o)})});return s.error&&o(s.value),i.promise}})});var Vu=n(()=>{"use strict";var Xg=D(),Zg=Ee(),em=Se().CONSTRUCTOR;Xg({target:"Promise",stat:!0,forced:em},{reject:function(e){var t=Zg.f(this),i=t.reject;return i(e),t.promise}})});var Di=n((MS,Ku)=>{"use strict";var rm=J(),tm=j(),im=Ee();Ku.exports=function(r,e){if(rm(r),tm(e)&&e.constructor===r)return e;var t=im.f(r),i=t.resolve;return i(e),t.promise}});var Gu=n(()=>{"use strict";var om=D(),nm=Q(),Wu=G(),sm=ae(),Hu=Se().CONSTRUCTOR,am=Di(),um=nm("Promise"),cm=Wu&&!Hu;om({target:"Promise",stat:!0,forced:Wu||Hu},{resolve:function(e){return am(cm&&this===um?sm:this,e)}})});var zu=n(()=>{"use strict";bu();Bu();Uu();ju();Vu();Gu()});var Xu=n(()=>{"use strict";var lm=D(),dm=G(),Br=ae(),fm=R(),Yu=Q(),Ju=w(),pm=Zt(),Qu=Di(),hm=be(),Mi=Br&&Br.prototype,vm=!!Br&&fm(function(){Mi.finally.call({then:function(){}},function(){})});lm({target:"Promise",proto:!0,real:!0,forced:vm},{finally:function(r){var e=pm(this,Yu("Promise")),t=Ju(r);return this.then(t?function(i){return Qu(e,r()).then(function(){return i})}:r,t?function(i){return Qu(e,r()).then(function(){throw i})}:r)}});!dm&&Ju(Br)&&($i=Yu("Promise").prototype.finally,Mi.finally!==$i&&hm(Mi,"finally",$i,{unsafe:!0}));var $i});var ec=n((WS,Zu)=>{"use strict";Es();zu();Xu();var gm=vr();Zu.exports=gm("Promise","finally")});var tc=n((HS,rc)=>{"use strict";var mm=ec();rc.exports=mm});var Bi=n((GS,ic)=>{"use strict";var bm=tc();ic.exports=bm});var nc=n((zS,oc)=>{"use strict";var ym=R();oc.exports=!ym(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var Fr=n((QS,ac)=>{"use strict";var Im=z(),Sm=w(),Em=At(),Pm=wr(),_m=nc(),sc=Pm("IE_PROTO"),Fi=Object,Tm=Fi.prototype;ac.exports=_m?Fi.getPrototypeOf:function(r){var e=Em(r);if(Im(e,sc))return e[sc];var t=e.constructor;return Sm(t)&&e instanceof t?t.prototype:e instanceof Fi?Tm:null}});var lc=n((YS,cc)=>{"use strict";var Om=C(),Ui=z(),wm=te(),qm=Vt().indexOf,Am=qr(),uc=Om([].push);cc.exports=function(r,e){var t=wm(r),i=0,o=[],s;for(s in t)!Ui(Am,s)&&Ui(t,s)&&uc(o,s);for(;e.length>i;)Ui(t,s=e[i++])&&(~qm(o,s)||uc(o,s));return o}});var ji=n((JS,dc)=>{"use strict";dc.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Vi=n((XS,fc)=>{"use strict";var xm=lc(),Rm=ji();fc.exports=Object.keys||function(e){return xm(e,Rm)}});var bc=n((ZS,mc)=>{"use strict";var hc=N(),Cm=R(),vc=C(),Lm=Fr(),Nm=Vi(),km=te(),Dm=gt().f,gc=vc(Dm),$m=vc([].push),Mm=hc&&Cm(function(){var r=Object.create(null);return r[2]=2,!gc(r,2)}),pc=function(r){return function(e){for(var t=km(e),i=Nm(t),o=Mm&&Lm(t)===null,s=i.length,a=0,d=[],l;s>a;)l=i[a++],(!hc||(o?l in t:gc(t,l)))&&$m(d,r?[l,t[l]]:t[l]);return d}};mc.exports={entries:pc(!0),values:pc(!1)}});var yc=n(()=>{"use strict";var Bm=D(),Fm=bc().entries;Bm({target:"Object",stat:!0},{entries:function(e){return Fm(e)}})});var Sc=n((tE,Ic)=>{"use strict";yc();var Um=De();Ic.exports=Um.Object.entries});var Pc=n((iE,Ec)=>{"use strict";var jm=Sc();Ec.exports=jm});var we=n((oE,_c)=>{"use strict";var Vm=Pc();_c.exports=Vm});var wc=n((nE,Oc)=>{"use strict";var Ki=N(),Km=z(),Tc=Function.prototype,Wm=Ki&&Object.getOwnPropertyDescriptor,Wi=Km(Tc,"name"),Hm=Wi&&function(){}.name==="something",Gm=Wi&&(!Ki||Ki&&Wm(Tc,"name").configurable);Oc.exports={EXISTS:Wi,PROPER:Hm,CONFIGURABLE:Gm}});var Ac=n(qc=>{"use strict";var zm=N(),Qm=Dt(),Ym=oe(),Jm=J(),Xm=te(),Zm=Vi();qc.f=zm&&!Qm?Object.defineProperties:function(e,t){Jm(e);for(var i=Xm(t),o=Zm(t),s=o.length,a=0,d;s>a;)Ym.f(e,d=o[a++],i[d]);return e}});var Qi=n((aE,Dc)=>{"use strict";var eb=J(),rb=Ac(),xc=ji(),tb=qr(),ib=ei(),ob=fr(),nb=wr(),Rc=">",Cc="<",Gi="prototype",zi="script",Nc=nb("IE_PROTO"),Hi=function(){},kc=function(r){return Cc+zi+Rc+r+Cc+"/"+zi+Rc},Lc=function(r){r.write(kc("")),r.close();var e=r.parentWindow.Object;return r=null,e},sb=function(){var r=ob("iframe"),e="java"+zi+":",t;return r.style.display="none",ib.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(kc("document.F=Object")),t.close(),t.F},Ur,jr=function(){try{Ur=new ActiveXObject("htmlfile")}catch(e){}jr=typeof document!="undefined"?document.domain&&Ur?Lc(Ur):sb():Lc(Ur);for(var r=xc.length;r--;)delete jr[Gi][xc[r]];return jr()};tb[Nc]=!0;Dc.exports=Object.create||function(e,t){var i;return e!==null?(Hi[Gi]=eb(e),i=new Hi,Hi[Gi]=null,i[Nc]=e):i=jr(),t===void 0?i:rb.f(i,t)}});var Zi=n((uE,Bc)=>{"use strict";var ab=R(),ub=w(),cb=j(),lb=Qi(),$c=Fr(),db=be(),fb=k(),pb=G(),Xi=fb("iterator"),Mc=!1,X,Yi,Ji;[].keys&&(Ji=[].keys(),"next"in Ji?(Yi=$c($c(Ji)),Yi!==Object.prototype&&(X=Yi)):Mc=!0);var hb=!cb(X)||ab(function(){var r={};return X[Xi].call(r)!==r});hb?X={}:pb&&(X=lb(X));ub(X[Xi])||db(X,Xi,function(){return this});Bc.exports={IteratorPrototype:X,BUGGY_SAFARI_ITERATORS:Mc}});var Uc=n((cE,Fc)=>{"use strict";var vb=Zi().IteratorPrototype,gb=Qi(),mb=Ne(),bb=We(),yb=ce(),Ib=function(){return this};Fc.exports=function(r,e,t,i){var o=e+" Iterator";return r.prototype=gb(vb,{next:mb(+!i,t)}),bb(r,o,!1,!0),yb[o]=Ib,r}});var Xc=n((lE,Jc)=>{"use strict";var Sb=D(),Eb=U(),Vr=G(),Qc=wc(),Pb=w(),_b=Uc(),jc=Fr(),Vc=Qt(),Tb=We(),Ob=pe(),eo=be(),wb=k(),Kc=ce(),Yc=Zi(),qb=Qc.PROPER,Ab=Qc.CONFIGURABLE,Wc=Yc.IteratorPrototype,Kr=Yc.BUGGY_SAFARI_ITERATORS,Ze=wb("iterator"),Hc="keys",er="values",Gc="entries",zc=function(){return this};Jc.exports=function(r,e,t,i,o,s,a){_b(t,e,i);var d=function(y){if(y===o&&u)return u;if(!Kr&&y&&y in f)return f[y];switch(y){case Hc:return function(){return new t(this,y)};case er:return function(){return new t(this,y)};case Gc:return function(){return new t(this,y)}}return function(){return new t(this)}},l=e+" Iterator",c=!1,f=r.prototype,h=f[Ze]||f["@@iterator"]||o&&f[o],u=!Kr&&h||d(o),p=e==="Array"&&f.entries||h,m,b,I;if(p&&(m=jc(p.call(new r)),m!==Object.prototype&&m.next&&(!Vr&&jc(m)!==Wc&&(Vc?Vc(m,Wc):Pb(m[Ze])||eo(m,Ze,zc)),Tb(m,l,!0,!0),Vr&&(Kc[l]=zc))),qb&&o===er&&h&&h.name!==er&&(!Vr&&Ab?Ob(f,"name",er):(c=!0,u=function(){return Eb(h,this)})),o)if(b={values:d(er),keys:s?u:d(Hc),entries:d(Gc)},a)for(I in b)(Kr||c||!(I in f))&&eo(f,I,b[I]);else Sb({target:e,proto:!0,forced:Kr||c},b);return(!Vr||a)&&f[Ze]!==u&&eo(f,Ze,u,{name:o}),Kc[e]=u,b}});var el=n((dE,Zc)=>{"use strict";Zc.exports=function(r,e){return{value:r,done:e}}});var to=n((fE,nl)=>{"use strict";var xb=te(),ro=Kt(),rl=ce(),il=Ii(),Rb=oe().f,Cb=Xc(),Wr=el(),Lb=G(),Nb=N(),ol="Array Iterator",kb=il.set,Db=il.getterFor(ol);nl.exports=Cb(Array,"Array",function(r,e){kb(this,{type:ol,target:xb(r),index:0,kind:e})},function(){var r=Db(this),e=r.target,t=r.index++;if(!e||t>=e.length)return r.target=void 0,Wr(void 0,!0);switch(r.kind){case"keys":return Wr(t,!1);case"values":return Wr(e[t],!1)}return Wr([t,e[t]],!1)},"values");var tl=rl.Arguments=rl.Array;ro("keys");ro("values");ro("entries");if(!Lb&&Nb&&tl.name!=="values")try{Rb(tl,"name",{value:"values"})}catch(r){}});var al=n((pE,sl)=>{"use strict";var $b=N(),Mb=oe(),Bb=Ne();sl.exports=function(r,e,t){$b?Mb.f(r,e,Bb(0,t)):r[e]=t}});var ul=n(()=>{"use strict";var Fb=D(),Ub=Mr(),jb=al();Fb({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Ub(e,function(i,o){jb(t,i,o)},{AS_ENTRIES:!0}),t}})});var ll=n((gE,cl)=>{"use strict";to();ul();var Vb=De();cl.exports=Vb.Object.fromEntries});var fl=n((mE,dl)=>{"use strict";dl.exports={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}});var hl=n(()=>{"use strict";to();var Kb=fl(),Wb=O(),Hb=We(),pl=ce();for(Hr in Kb)Hb(Wb[Hr],Hr),pl[Hr]=pl.Array;var Hr});var gl=n((IE,vl)=>{"use strict";var Gb=ll();hl();vl.exports=Gb});var bl=n((SE,ml)=>{"use strict";var zb=gl();ml.exports=zb});var ao=n((sP,xl)=>{"use strict";var Yb=Ke(),Jb=String;xl.exports=function(r){if(Yb(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Jb(r)}});var Cl=n((aP,Rl)=>{"use strict";var Xb=hr(),Zb=ao(),ey=de(),ry=RangeError;Rl.exports=function(e){var t=Zb(ey(this)),i="",o=Xb(e);if(o<0||o===1/0)throw new ry("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))o&1&&(i+=t);return i}});var $l=n((uP,Dl)=>{"use strict";var kl=C(),ty=Ut(),Ll=ao(),iy=Cl(),oy=de(),ny=kl(iy),sy=kl("".slice),ay=Math.ceil,Nl=function(r){return function(e,t,i){var o=Ll(oy(e)),s=ty(t),a=o.length,d=i===void 0?" ":Ll(i),l,c;return s<=a||d===""?o:(l=s-a,c=ny(d,ay(l/d.length)),c.length>l&&(c=sy(c,0,l)),r?o+c:c+o)}};Dl.exports={start:Nl(!1),end:Nl(!0)}});var Bl=n((cP,Ml)=>{"use strict";var uy=ie();Ml.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(uy)});var Fl=n(()=>{"use strict";var cy=D(),ly=$l().start,dy=Bl();cy({target:"String",proto:!0,forced:dy},{padStart:function(e){return ly(this,e,arguments.length>1?arguments[1]:void 0)}})});var jl=n((fP,Ul)=>{"use strict";Fl();var fy=vr();Ul.exports=fy("String","padStart")});var Kl=n((pP,Vl)=>{"use strict";var py=jl();Vl.exports=py});var uo=n((hP,Wl)=>{"use strict";var hy=Kl();Wl.exports=hy});var my={};Io(my,{ApiEnv:()=>me,ConnectionType:()=>br,ContentType:()=>mr,InteractiveInterfaceClick:()=>Wt,OneStat:()=>et,Quality:()=>gr,SeekAction:()=>yr,ThinOneStat:()=>ct,VERSION:()=>je});module.exports=bd(my);var po=x(ge(),1);var me=(a=>(a.PROD="prod",a.VK_ALIAS="vk_alias",a.VIDEOTEST="videotest",a.TEST="test",a.OKCDN="okcdn",a.AUTO="auto",a))(me||{}),gr=(c=>(c.Q144P="mobile",c.Q240P="lowest",c.Q360P="low",c.Q480P="medium",c.Q720P="high",c.Q1080P="fullhd",c.Q1440P="quadhd",c.Q2160P="ultrahd",c.UNKNOWN="unknown",c))(gr||{}),mr=(p=>(p.MP4="mp4",p.DASH="dash",p.DASH_SEP="dash_sep",p.ONDEMAND_DASH="ondemand_dash",p.HLS="hls",p.ONDEMAND_HLS="ondemand_hls",p.WEBM="webm",p.AV1="av1",p.ONDEMAND_DASH_LIVE="ondemand_dash_live",p.ONDEMAND_HLS_LIVE="ondemand_hls_live",p.WEBRTC="webrtc",p.UNKNOWN="unknown",p.RTMP="rtmp",p))(mr||{});var br=(i=>(i.HTTP1="http1",i.HTTP2="http2",i.HTTP3="http3",i))(br||{});var yr=(d=>(d.SLIDER="slider",d.DOUBLE_TAP="double_tap",d.TIME_CODE="time_code",d.EPISODE="episode",d.REWIND="rewind",d.LIVE="live",d.UNKNOWN="unknown",d))(yr||{}),Wt=(s=>(s.GRAPH_SHOW="iGraphShow",s.GRAPH_HIDE="iGraphHide",s.NEXT_AREA="iNextChapterArea",s.NEXT_BUTTON="iNextChapterBtn",s.WATCH_AGAIN="iWatchAgainBtn",s))(Wt||{}),vs={action_play:"ap",action_play_interactive:"api",first_bytes:"fb",player_ready:"pr",first_frame:"ff",seek:"sk",watch_coverage_record:"wr",watch_coverage_live:"wl",empty_buffer:"eb",action_stop:"as",close_at_empty_buffer:"cb",content_error:"er",player_interface_click:"pc",next_movie:"nm",track_switch:"ts",failover:"fo",quality:"qt"},gs={vsid:"si",isid:"is",vid:"vi",place:"pl",quality:"qt",cdn_host:"ch",stat_type:"st",param:"pm",vk_app_id:"va",track_code:"tc",connection_type:"cnt",connection_reused:"cr",cached_data:"cd",live:"lv",muted:"mu",mode:"mo",subtitles:"sb",failover:"fo",download_speed:"ds",manual_quality:"mq",ref_domain:"rd",direct_url:"du"},ms={unknown:"un",mobile:"m",lowest:"ls",low:"l",medium:"md",high:"h",fullhd:"f",quadhd:"q",ultrahd:"u"},bs={pip:"pi",fullscreen:"fs",external:"ex",prefetch:"pr",airplay:"ap",chromecast:"cc",invisible:"iv"};var Is=require("@vkontakte/videoplayer-shared/es2018");var je="__VERSION__",ys="CIOPGQJGDIHBABABA",Ht={prod:"https://api.ok.ru",vk_alias:"https://api.mycdn.me",videotest:"https://videotestapi.ok.ru/api",test:"https://apitest.ok.ru",okcdn:"https://api.okcdn.ru",auto:""};var Up={apiEnv:"vk_alias",apiKey:ys,requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageInterval:15e3,disabledOperations:["quality"],disabledCustomFields:[],shorten:!0,maxLoops:100,embedUrlParams:[],useBeacon:!0,synchronizeTime:!0,debugLog:!1,clearStorageAtUnload:!0,alwaysSendDesktop:!1,backoff:{start:1e3,factor:1.5,max:5*60*1e3,random:.1}},Ss=r=>(0,Is.fillWithDefault)(r,Up);function Gt(){let r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),t=0,i,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?e[o]="-":o===14?e[o]="4":(t<=2&&(t=33554432+Math.random()*16777216|0),i=t&15,t=t>>4,e[o]=r[o===19?i&3|8:i]);return e.join("")}var v=require("@vkontakte/videoplayer-shared/es2018"),rt=require("@vkontakte/videoplayer-shared/es2018");var Gr=x(Bi(),1);var yl=x(we(),1),Il=x(bl(),1);var Sl=r=>{var o;let{operation:e,custom:t}=r,i=(0,Il.default)((0,yl.default)(t).map(([s,a])=>{var c,f,h;let d=(c=gs[s])!=null?c:s,l=a;return a&&(s==="mode"?l=(f=bs[a])!=null?f:a:s==="quality"&&(l=(h=ms[a])!=null?h:a)),[d,l]}));return{...r,operation:(o=vs[e])!=null?o:e,custom:i}};var W=require("@vkontakte/videoplayer-shared/es2018");var rr=class{constructor(e){this.consequentAuthErrors=0;this.authorized$=new W.ValueSubject(!1);this.params=e}async authorize(e){return this.authToken=e!=null?e:await this.refreshAuthToken(),this._authorizeWithBackoff()}logBeacon(e){let t="log.externalLog",i=this.createLogParams(e),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(t,i,o)||this.logRequest(e).catch(()=>{})}async logRequest(e){var a;let t="log.externalLog",i=this.createLogParams(e),o=(a=this.sessionKey)!=null?a:await this._authorizeWithBackoff();if(!o)return;let s=async(d,l=this.params.config.requestRetryCount)=>{try{return await this.params.apiTransport.sendRequest(t,i,o)}catch(c){if(!c||!("error_code"in c)){this.params.error$.next({id:"logRequestUnknown",category:W.ErrorCategory.NETWORK,message:`Unknown ${t} error`,thrown:c});return}let f=c==null?void 0:c.error_code;switch(f){case 102:case 103:case 104:return this.authorized$.next(!1),this.sessionKey=await this._authorizeWithBackoff(),l>0?s(d,l-1):void 0;case 401:return this.authorized$.next(!1),this.authToken=await this.refreshAuthToken(),this.sessionKey=await this._authorizeWithBackoff(),l>0?s(d,l-1):void 0;default:{this.params.error$.next({id:`LogRequest#${f}`,category:W.ErrorCategory.EXTERNAL_API,message:`${t} error`,data:c});return}}}};return s(e)}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}async refreshAuthToken(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=(0,Gr.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){let t=this.params.config.alwaysSendDesktop||!this.params.mobile?"WEB":"M_WEB";return{collector:"ok.mobile.apps.video",data:JSON.stringify({application:`@vkontakte/videoplayer-statistics:${je}`,platform:t,items:this.params.config.shorten?e.map(Sl):e})}}_authorizeWithBackoff(){if(!this.consequentAuthErrors)return this._authorize();let e=(0,W.getExponentialDelay)(this.consequentAuthErrors,this.params.config.backoff);return new Promise(t=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(()=>{(0,Gr.default)(this._authorize().then(t).catch(i=>this.params.error$.next({id:"AuthorizeBackoff",category:W.ErrorCategory.NETWORK,message:"Otherwise unhandled error in authorization",thrown:i})),()=>this.backoffTimeoutId=0)},e))})}async _authorize(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);let e="auth.anonymLogin",t={session_data:{version:2,device_id:this.params.deviceId,client_version:je.split("-")[0],client_type:"SDK_JS"}};return this.authToken!==void 0&&(t.session_data.auth_token=this.authToken,t.session_data.version=3),this.authorizePromise=(0,Gr.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:W.ErrorCategory.EXTERNAL_API,message:"No session key",data:i}),this.sessionKey=(o=i==null?void 0:i.session_key)!=null?o:void 0,this.sessionKey}).catch(async i=>{this.sessionKey=void 0;let o=i==null?void 0:i.error_code;switch(o){case 401:return this.authToken=await this.refreshAuthToken(),this._authorizeWithBackoff()}o?this.params.error$.next({id:`Authorize#${o}`,category:W.ErrorCategory.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:W.ErrorCategory.NETWORK,message:"authorize error",thrown:i})}),()=>{this.authorizePromise=void 0,this.consequentAuthErrors=this.sessionKey?0:this.consequentAuthErrors+1,this.authorized$.next(this.sessionKey!==void 0)}),this.authorizePromise}};var zr=class{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,i){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:i})}removeEventListener(e,t){if(!(e in this.listeners))return;let i=this.listeners[e];for(let o=0,s=i.length;o<s;o++)if(i[o].callback===t){i.splice(o,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let i=this.listeners[e.type].slice();for(let o=0,s=i.length;o<s;o++){let a=i[o];try{a.callback.call(this,e)}catch(d){Promise.resolve().then(()=>{throw d})}a.options&&a.options.once&&this.removeEventListener(e.type,a.callback)}return!e.defaultPrevented}},qe=class extends zr{constructor(){super(),this.listeners||zr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,e)),super.dispatchEvent(e)}},tr=class{constructor(){Object.defineProperty(this,"signal",{value:new qe,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let i=e;if(i===void 0)if(typeof document=="undefined")i=new Error("This operation was aborted"),i.name="AbortError";else try{i=new DOMException("signal is aborted without reason")}catch(o){i=new Error("This operation was aborted"),i.name="AbortError"}this.signal.reason=i,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}};typeof Symbol!="undefined"&&Symbol.toStringTag&&(tr.prototype[Symbol.toStringTag]="AbortController",qe.prototype[Symbol.toStringTag]="AbortSignal");function Qr(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function io(r){typeof r=="function"&&(r={fetch:r});let{fetch:e,Request:t=e.Request,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!Qr({fetch:e,Request:t,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:s};let s=t;(s&&!s.prototype.hasOwnProperty("signal")||o)&&(s=function(c,f){let h;f&&f.signal&&(h=f.signal,delete f.signal);let u=new t(c,f);return h&&Object.defineProperty(u,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),u},s.prototype=t.prototype);let a=e;return{fetch:(l,c)=>{let f=s&&s.prototype.isPrototypeOf(l)?l.signal:c?c.signal:void 0;if(f){let h;try{h=new DOMException("Aborted","AbortError")}catch(p){h=new Error("Aborted"),h.name="AbortError"}if(f.aborted)return Promise.reject(h);let u=new Promise((p,m)=>{f.addEventListener("abort",()=>m(h),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([u,a(l,c)])}return a(l,c)},Request:s}}var ir=Qr({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),El=ir?io({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ae=ir?El.fetch:window.fetch,BE=ir?El.Request:window.Request,FE=ir?tr:window.AbortController,UE=ir?qe:window.AbortSignal;var Pl=x(ge(),1),_l=x(we(),1),Z=require("@vkontakte/videoplayer-shared/es2018");var or=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=Ht[this.apiEnv],this.timeSynchronisation=e.timeSynchronisation,this.isApiBaseUrlFetched=!1}async resolveApiBaseUrl(){var e;if(this.apiEnv!=="auto"||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{let t=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=await(await Ae(t,{method:"GET",mode:"cors",cache:"no-cache"})).json(),s=(e=o==null?void 0:o.Answer[0])==null?void 0:e.data;if(!s)throw new Error("Wrong DNS response");return s}catch(t){return this.params.error$.next({id:"OneStat:ApiTransport:resolveApiBaseUrl",category:Z.ErrorCategory.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),Ht.vk_alias}finally{this.isApiBaseUrlFetched=!0}}sendBeacon(e,t,i){if(!window.Blob||!window.navigator.sendBeacon)return!1;let o=this._prepareQueryParams({method:e,queryParams:t,sessionKey:i}),s=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,s)}catch(a){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:Z.ErrorCategory.NETWORK,message:"Unhandled beacon error",thrown:a,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i){let o=(0,Z.now)(),s=a=>{if(a instanceof TypeError&&(0,Pl.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],a.message)){this.params.error$.next({id:"Network",category:Z.ErrorCategory.NETWORK,message:"Request failed",thrown:a});return}this.params.error$.next({id:"OneStat:ApiTransport:sendRequest",category:Z.ErrorCategory.NETWORK,message:"Unhandled request error",thrown:a,data:{method:e,params:t,sessionKey:i,time:(0,Z.now)()-o}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),Ae(`${this.apiBaseUrl}/fb.do`,{method:"post",headers:{"Content-type":"application/x-www-form-urlencoded"},body:this._prepareQueryParams({method:e,queryParams:t,sessionKey:i})}).then(a=>{var f,h;let d=Number(a.headers.get("content-length"))===0,l=new Date((f=a.headers.get("date"))!=null?f:"").getTime(),c=(0,Z.now)()-o;if(isFinite(l)&&((h=this.timeSynchronisation)==null||h.addServerTime(l,c)),!d)return a.json().then(u=>Object.prototype.hasOwnProperty.call(u,"error_msg")?Promise.reject(u):u,s)},s)}_prepareQueryParams(e){let t=new URLSearchParams({format:"JSON",method:e.method,application_key:this.apiKey});return e.sessionKey!==void 0&&t.append("session_key",e.sessionKey),(0,_l.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var Tl=x(ge(),1),Ol=x(we(),1),M=require("@vkontakte/videoplayer-shared/es2018"),Yr="onestat_events",oo=r=>e=>e.timestamp+r>=(0,M.now)(),Jr=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{operation:t}=e;return(0,Tl.default)(["action_play","watch_coverage_record","watch_coverage_live"],t)};this.params=e,this.api=e.api,this.error$=e.error$,this.userSalt=e.userSalt,this.loggerDebugLog=e.debugLogger.createComponentLog("stat logger"),this.firstFlush=(0,M.debounceFn)(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=M.safeStorage.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=(0,M.debounceFn)(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:t}),this.subscription=this.api.authorized$.subscribe(i=>{i&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){var e;try{this.flush()}catch(t){this.error$.next({id:"LoggerError",category:M.ErrorCategory.WTF,message:(e=String(t))!=null?e:"Unknown logger error",thrown:t})}}readFromStorage(){let e=M.safeStorage.get(Yr);try{return e?JSON.parse(e):{}}catch(t){}return{}}addToStorage(e){var s;if(!this.userSalt){this.unsaltedStorage.push(e);return}let t=this.readFromStorage(),o=((s=t[this.userSalt])!=null?s:[]).filter(oo(this.params.config.storageExpiration));M.safeStorage.set(Yr,JSON.stringify({...t,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(oo(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],M.safeStorage.set(Yr,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of(0,Ol.default)(e)){let o=i.filter(oo(this.params.config.storageExpiration));o.length?e[t]=o:delete e[t],this.loggerDebugLog({message:`${i.length} retrieved from storage, ${o.length} of them actual`})}M.safeStorage.set(Yr,JSON.stringify(e))}log(e){this.addToStorage(e),!this.isPaused&&(this.isUrgent(e)?this.flush():this.lastVsid!==e.custom.vsid?this.firstFlush():this.debouncedFlush(),this.lastVsid=e.custom.vsid)}flush({wantBeacon:e,clearStorage:t}={wantBeacon:!1,clearStorage:!0}){let i=this.getFromStorage();i.length!==0&&(this.api.authorized$.getValue()?(e&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${i.length} events through beacon`}),this.api.logBeacon(i)):(this.loggerDebugLog({message:`Flushing ${i.length} events`}),this.api.logRequest(i)),t&&this.markStorageSent()):this.api.authorize(),this.firstFlush.cancel(),this.debouncedFlush.cancel())}pause(){this.isPaused=!0,this.debouncedFlush.cancel()}resume(){this.isPaused=!1,this.debouncedFlush()}destroy(){this.subscription.unsubscribe(),this.firstFlush.cancel(),this.debouncedFlush.cancel()}};var g=require("@vkontakte/videoplayer-core/es2018"),no=require("@vkontakte/videoplayer-shared/es2018");var wl=r=>r&&{[g.VideoQuality.INVARIANT]:"unknown",[g.VideoQuality.Q_144P]:"mobile",[g.VideoQuality.Q_240P]:"lowest",[g.VideoQuality.Q_360P]:"low",[g.VideoQuality.Q_480P]:"medium",[g.VideoQuality.Q_576P]:"unknown",[g.VideoQuality.Q_720P]:"high",[g.VideoQuality.Q_1080P]:"fullhd",[g.VideoQuality.Q_1440P]:"quadhd",[g.VideoQuality.Q_2160P]:"ultrahd",[g.VideoQuality.Q_4320P]:"unknown"}[r],so=r=>r&&{[g.HttpConnectionType.HTTP1]:"http1",[g.HttpConnectionType.HTTP2]:"http2",[g.HttpConnectionType.QUIC]:"http3"}[r],ql=r=>{if(r!==void 0)switch(r){case g.VideoFormat.MPEG:return"mp4";case g.VideoFormat.DASH:case g.VideoFormat.DASH_LIVE:case g.VideoFormat.DASH_STREAMS:return"dash";case g.VideoFormat.DASH_SEP:return"dash_sep";case g.VideoFormat.DASH_ONDEMAND:return"ondemand_dash";case g.VideoFormat.DASH_WEBM:case g.VideoFormat.DASH_LIVE_WEBM:return"webm";case g.VideoFormat.DASH_WEBM_AV1:return"av1";case g.VideoFormat.DASH_LIVE_CMAF:return"ondemand_dash_live";case g.VideoFormat.HLS:case g.VideoFormat.HLS_LIVE:return"hls";case g.VideoFormat.HLS_ONDEMAND:return"ondemand_hls";case g.VideoFormat.HLS_LIVE_CMAF:return"ondemand_hls_live";case g.VideoFormat.WEB_RTC_LIVE:return"webrtc";default:return(0,no.assertNever)(r)}},Xr=r=>{if(r!==void 0)switch(r){case g.Surface.NONE:case g.Surface.INLINE:return;case g.Surface.FULLSCREEN:return"fullscreen";case g.Surface.SECOND_SCREEN:return"chromecast";case g.Surface.PIP:return"pip";case g.Surface.INVISIBLE:return"invisible";default:return(0,no.assertNever)(r)}},Al=r=>{switch(r){case"slow-2g":return"poor";case"2g":return"poor";case"3g":return"good";case"4g":return"excellent"}};var Zr=class{constructor(e){this.offset=void 0;this.offset=e}getOffset(){var e;return(e=this.offset)!=null?e:0}setOffset(e){this.offset=e}now(){var e;return Date.now()+((e=this.offset)!=null?e:0)}date(e=new Date){var t;return e.setTime(e.getTime()+((t=this.offset)!=null?t:0)),e}addServerTime(e,t){let i=Date.now(),o=e-i-t/2;if(Math.abs(o)<1e3){this.offset=0;return}this.offset===void 0?this.offset=Math.round(o):this.offset=Math.round(.2*o+(1-.2)*this.offset)}};var co=x(uo(),1),Hl=()=>(0,co.default)(Math.floor(Math.random()*2**32).toString(36),7,"0"),Gl=()=>(0,co.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");var lo=require("@vkontakte/videoplayer-core/es2018"),P=require("@vkontakte/videoplayer-shared/es2018"),zl=(r,e)=>new P.Observable(t=>{let i=new P.Subscription,o=(0,P.merge)((0,P.fromEvent)(window,"beforeunload"),r.events.willDestruct$),s=new P.ValueSubject(void 0),a;i.add(r.info.isLive$.pipe((0,P.filterChanged)()).subscribe(T=>{a&&(a.unsubscribe(),s.next(void 0)),T?a=r.info.liveTime$.pipe((0,P.map)(A=>A&&A/1e3)).subscribe(s):a=r.info.position$.subscribe(s),i.add(a)}));let{playing$:d,paused$:l}=r.events,c=r.events.willSeek$.pipe((0,P.filter)(()=>r.info.playbackState$.getValue()===lo.PlaybackState.PLAYING)),f=r.events.seeked$.pipe((0,P.filter)(()=>r.info.playbackState$.getValue()===lo.PlaybackState.PLAYING)),h=!1,u=new P.Subject;i.add(c.subscribe(()=>{h||u.next(),h=!0})),i.add(f.subscribe(()=>h=!1));let p=new P.Subject,m=new P.Subject,b=(0,P.merge)(d,f,p),I=(0,P.merge)(l,u,o,r.events.looped$,m),y,S=()=>y=s.getValue(),L=()=>{let T=s.getValue();(0,P.isNullable)(y)||y===T||(0,P.isNullable)(T)||(t.next({from:y,to:T}),y=void 0)},F=()=>{m.next(),p.next()};if(i.add(b.subscribe(S)),i.add(I.subscribe(L)),e.forceInterval&&isFinite(e.forceInterval)){let T=0;i.add(b.subscribe(()=>T=window.setTimeout(F,e.forceInterval))),i.add(I.subscribe(()=>window.clearTimeout(T)))}return i});var Jl="_one-stat_",Ql=`${Jl}uuid`,Yl=`${Jl}deviceId`,fo=()=>{let r=new v.Subscription;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},et=class{constructor(e,t){this.subscription=new v.Subscription;this.debugLogger=new rt.Logger;this.oneStatDebugLog=this.debugLogger.createComponentLog("onestat");this.loopCounter=0;this.disabled=!1;this.vsid$=new v.ValueSubject(void 0);this.isid$=new v.ValueSubject(void 0);this.zenUid$=new v.ValueSubject(void 0);this.seekAction$=new v.ValueSubject("unknown");var c,f,h;this.statContext=e,this.config=Ss((c=t.config)!=null?c:{}),(0,v.isNonNullable)(t.apiEnv)&&(this.config.apiEnv=t.apiEnv),this.config.synchronizeTime&&(this.timeSynchronisation=new Zr);let i=new v.Subject;this.experimental={error$:i},v.safeStorage.get(Ql)&&v.safeStorage.remove(Ql);let s=v.safeStorage.get(Yl);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:s?this.deviceId=s:(this.deviceId=Gt(),v.safeStorage.set(Yl,this.deviceId)),this.resetViewSession(),t.useIsid&&this.isid$.next((f=t.isid)!=null?f:Gl()),this.zenUid$.next(t.zenUid);let a=new or({config:this.config,error$:i,timeSynchronisation:this.timeSynchronisation});this.api=new rr({config:this.config,apiTransport:a,refreshAuthToken:t.refreshAuthToken,mobile:(h=this.statContext.mobile)!=null?h:!1,deviceId:this.deviceId,error$:i}),this.logger=new Jr({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:t.userSalt});let{isEmbed:d,topOrigin:l}=(0,rt.detectEmbed)();this.isEmbed=d,this.embedParent=l?new URL(l).hostname:void 0,this.subscribe()}updateContext(e){this.statContext={...this.statContext,...e}}attachTo(e){let t=new v.Subscription,i=(u,p)=>t.add(u.subscribe(p));i(e.events.willStart$,()=>{let u=e.info.position$.getValue();this.logActionPlay({position:u}),this.statContext.projectId&&this.logActionPlayInteractive()}),i(e.events.looped$,()=>{this.resetViewSession(),++this.loopCounter>this.config.maxLoops&&(this.disabled=!0),this.logActionPlay({position:e.info.position$.getValue()})}),i(e.events.seeked$,()=>{this.logSeek({action:this.seekAction$.getValue(),time:e.info.position$.getValue()}),this.seekAction$.next("unknown")}),i(e.events.paused$,()=>{this.logPause({position:e.info.position$.getValue()})}),i(e.events.willResume$,()=>{this.logPlay()}),i(e.events.started$,()=>{this.statContext.clip&&this.logWatchCoverageRecord({start:0,end:0})}),i(e.events.playing$,()=>{this.logPlaying()}),i(zl(e,{forceInterval:this.config.watchCoverageInterval}),u=>{var I,y,S,L;let p=e.info.isLive$.getValue(),m=e.info.atLiveEdge$.getValue(),b={start:parseFloat(u.from.toFixed(3)),end:parseFloat(u.to.toFixed(3))};if(m){let F=(I=e.info.liveLatency$.getValue())!=null?I:0,T=(S=(y=e.info.currentBuffer$.getValue())==null?void 0:y.end)!=null?S:0,A=(L=e.info.liveBufferTime$.getValue())!=null?L:0,nr=Math.round((F-(T-A))*1e3),sr=Math.round(F*1e3);nr&&sr&&(b.latency=nr,b.bufferLatency=sr)}p?this.logWatchCoverageLive(b):this.logWatchCoverageRecord(b)});let o;i(e.info.isStalled$,u=>{u?o=(0,v.now)():((0,v.isNonNullable)(o)&&this.logEmptyBuffer({duration:(0,v.now)()-o}),o=void 0)});let s=!1;t.add(e.events.fatalError$.pipe((0,v.once)()).subscribe(()=>s=!0)),i(e.events.willStop$,()=>{if(e.info.isStalled$.getValue()){let p=(0,v.isNonNullable)(o)?(0,v.now)()-o:void 0;this.logCloseAtEmptyBuffer({duration:p!=null?p:0}),o=void 0}else s||this.logActionStop()}),i(e.events.managedError$,({id:u})=>{this.logError({fatal:!1,errorType:u})}),i(e.events.fatalError$,({id:u})=>{this.logError({fatal:!0,errorType:u})});let a,d,l=!1;i(e.events.firstBytes$,u=>{a=(0,v.now)(),this.logFirstBytes({time:u})}),i(e.events.willStart$,()=>d=(0,v.now)()),i(e.info.currentBuffer$,u=>{!l&&u&&u.end-u.start>0&&(0,v.isNonNullable)(a)&&(this.logPlayerReady({duration:(0,v.now)()-a}),l=!0)}),i(e.events.firstFrame$,()=>{(0,v.isNonNullable)(a)&&!l&&(this.logPlayerReady({duration:(0,v.now)()-a}),l=!0),(0,v.isNonNullable)(d)&&this.logFirstFrame({time:(0,v.now)()-d})});let c;i(e.info.currentVideoStream$,u=>{u&&(c&&u.id!==c&&this.logTrackSwitch(u),c=u.id)});let f;i(e.info.currentAudioStream$,u=>{u&&(f&&u.id!==f&&this.logTrackSwitch(u),f=u.id)}),i(e.info.atLiveEdge$,u=>this.updateContext({liveEdge:u})),i((0,v.combine)({muted:e.info.muted$,volume:e.info.volume$}),({muted:u,volume:p})=>this.updateContext({audible:!u&&p>0})),i(e.info.currentQuality$,u=>{let p=wl(u);this.updateContext({quality:p}),p&&this.logQuality(p)}),i(e.info.isAutoQualityEnabled$,u=>this.updateContext({autoQuality:u})),i(e.info.currentFormat$,u=>this.updateContext({contentType:ql(u)})),i(e.info.currentPlaybackRate$,u=>this.updateContext({rate:u})),i(e.info.is3DVideo$,u=>this.updateContext({is3d:u}));let h;return i(e.info.hostname$,u=>{let p=h!==void 0&&h!==u;this.updateContext({cdnHostname:u,failover:p}),p&&this.logFailover(u),h=u}),i(e.info.throughputEstimation$,u=>this.updateContext({downloadSpeed:u})),i(e.info.httpConnectionType$,u=>{this.statContext.firstConnectionType||this.updateContext({firstConnectionType:so(u)}),this.updateContext({connectionType:so(u)})}),i(e.info.httpConnectionReused$,u=>{(0,v.isNullable)(this.statContext.firstConnectionReused)&&this.updateContext({firstConnectionReused:u}),this.updateContext({connectionReused:u})}),i(e.info.surface$,u=>this.updateContext({mode:Xr(u)})),i((0,v.combine)({current:e.info.currentTextTrack$,available:e.info.availableTextTracks$}),({current:u,available:p})=>{let m=p.find(({id:I})=>I===u),b=m&&(m.isAuto?`${m.language}_auto`:m.language);this.updateContext({subtitles:b==null?void 0:b.split(".")[0]})}),this.player=e,this.uiEvents&&this.attachToUi(this.uiEvents),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToUi(e){this.uiEvents=e;let{subscription:t,subscribe:i}=fo();return this.player&&(i(e.actionRewind$,()=>{this.player&&(this.resetViewSession(),this.logActionPlay({position:this.player.info.position$.getValue()}))}),i(e.actionSeek$,this.seekAction$),i(e.inPiP$,o=>{var a;let s=o?"pip":Xr((a=this.player)==null?void 0:a.info.surface$.getValue());this.updateContext({mode:s})}),i(e.inFullscreen$,o=>{var a;let s=o?"fullscreen":Xr((a=this.player)==null?void 0:a.info.surface$.getValue());this.updateContext({mode:s})}),i(e.actionSetSubtitle$,o=>this.updateContext({subtitles:o.split(".")[0]})),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t)),t}attachToAds(e){let{subscription:t,subscribe:i}=fo();return i(e.slotRequested$,()=>this.logAdSlotRequest()),i(e.started$,o=>this.logAdStarted(o)),i(e.paused$,()=>this.logAdPaused()),i(e.resumed$,()=>this.logAdResumed()),i(e.ended$,()=>this.logAdEnded()),i(e.skipped$,()=>this.logAdSkipped()),i(e.clicked$,()=>this.logAdClicked()),i(e.error$,o=>this.logError({errorType:o,fatal:!1})),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToInteractive(e){let{subscription:t,subscribe:i}=fo();return i(e.click$,o=>this.logInterfaceClick(o)),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t),t}authorize(e){return this.api.authorize(e)}pause(){this.logger.pause(),this.oneStatDebugLog({message:"paused"})}resume(){this.logger.resume(),this.oneStatDebugLog({message:"resumed"})}destroy(){this.logger.flush(),this.subscription.unsubscribe(),this.api.destroy(),this.logger.destroy()}resetViewSession(){this.oneStatDebugLog({message:"VSID reset"}),this.vsid$.next(Hl())}getDeviceId(){return this.deviceId}setFieldBlacklist(){}logInited(){}logReady(e){this.log({operation:"player_ready",param:String(e.time)})}logStarted(...e){this.logActionPlay(...e)}logPlay(){this.log({operation:"play_toggle"})}logPlaying(){this.log({operation:"playing"})}logPause(e){this.log({operation:"pause",param:String(Math.round(e.position))})}logSeek(e){this.log({operation:"seek",param:e.action,time:e.time})}logFirstBytes(e){this.log({operation:"first_bytes",param:String(e.time)})}logFirstFrame(e){this.log({operation:"first_frame",param:String(e.time)})}logError(e){this.log({operation:"content_error",param:`${e.fatal?"fatal":"recoverable"}_${e.errorType}`})}logWatchCoverageRecord(e){this.log({operation:"watch_coverage_record",param:`${e.start}-${e.end}`},{in_history:this.statContext.inHistory?1:void 0})}logWatchCoverageLive(e){var s,a;let t=(a=(s=this.timeSynchronisation)==null?void 0:s.getOffset())!=null?a:0,i=e.start+t,o=e.end+t;this.log({operation:"watch_coverage_live",param:`${i}-${o}`},{in_history:this.statContext.inHistory?1:void 0,latency:e.latency,buffer_latency:e.bufferLatency})}logEmptyBuffer(e){this.log({operation:"empty_buffer",param:String(e.duration)})}logDownloadSpeed(){}logAdSlotRequest(){this.log({operation:"adv",param:"slot_request"})}logAdStarted(e){this.log({operation:"adv",param:e})}logAdPaused(){this.log({operation:"adv",param:"pause"})}logAdResumed(){this.log({operation:"adv",param:"resume"})}logAdEnded(){this.log({operation:"adv",param:"ended"})}logAdSkipped(){this.log({operation:"adv",param:"skip"})}logAdClicked(){this.log({operation:"adv",param:"click"})}logInterfaceClick(e){this.log({operation:"player_interface_click",param:e})}logNextMovie(e){this.log({operation:"next_movie",param:String(e)})}subscribe(){this.resubscribeBeforeunload();let e=window.navigator.connection;e&&"onchange"in e&&"effectiveType"in e&&this.subscription.add((0,v.merge)((0,v.fromEvent)(e,"change"),(0,v.observableFrom)(["init"])).subscribe(()=>this.updateContext({network:Al(e.effectiveType)}))),this.config.debugLog&&this.debugLogger.log$.subscribe(t=>{console.debug("%c stat ","background:#fa6470;",`component: ${t.component}.`,t.message)})}resubscribeBeforeunload(){var e;(e=this.beforeunloadSubscription)==null||e.unsubscribe(),this.beforeunloadSubscription=(0,v.fromEvent)(window,"beforeunload").subscribe(()=>this.logger.flush({wantBeacon:!0,clearStorage:this.config.clearStorageAtUnload})),this.subscription.add(this.beforeunloadSubscription)}logPlayerReady(e){this.log({operation:"player_ready",param:String(Math.round(e.duration))})}logActionPlay(e){this.log({operation:"action_play",param:String(Math.round(e.position))})}logActionPlayInteractive(){this.statContext.projectId&&this.log({operation:"action_play_interactive",param:String(this.statContext.movieId)},{vid:this.statContext.projectId})}logFailover(e){this.log({operation:"failover",param:e})}logCloseAtEmptyBuffer(e){this.log({operation:"close_at_empty_buffer",param:String(Math.round(e.duration))})}logActionStop(){this.log({operation:"action_stop"})}logTrackSwitch(e){this.log({operation:"track_switch",param:e.id})}logQuality(e){this.log({operation:"quality",param:e})}log(e,t={}){if(this.disabled){this.oneStatDebugLog({message:`operation ${e.operation} but statistics is disabled`});return}if((0,po.default)(this.config.disabledOperations,e.operation)){this.oneStatDebugLog({message:`operation ${e.operation} but it is disabled`});return}this.oneStatDebugLog({message:`operation ${e.operation} ${e.param}`});let i=this.createLogItem(e,t);this.logger.log(i)}createLogItem({operation:e,param:t,time:i},o={}){var p,m,b,I,y,S;let s=(m=(p=this.timeSynchronisation)==null?void 0:p.now())!=null?m:(0,v.now)(),a=this.vsid$.getValue();(0,v.assertNonNullable)(a);let d=this.isid$.getValue(),l=e==="empty_buffer"||e==="close_at_empty_buffer"?this.statContext.connectionType:this.statContext.firstConnectionType,c=this.statContext.firstConnectionReused,f,h;if(this.isEmbed||this.statContext.place==="embed"){f=this.embedParent;let L=[...new URLSearchParams(location.search).entries()].filter(([F,T])=>(0,po.default)(this.config.embedUrlParams,F));h=new URLSearchParams(L).toString()}else this.statContext.place==="direct"&&(this.statContext.refDomain?f=(I=(b=(0,v.createURL)(this.statContext.refDomain))==null?void 0:b.hostname)!=null?I:this.statContext.refDomain:document.referrer&&(f=(S=(y=(0,v.createURL)(document.referrer))==null?void 0:y.hostname)!=null?S:document.referrer),h=location.href.substring(0,1024));let u={vsid:a,isid:d,vid:this.statContext.movieId,uid:this.zenUid$.getValue(),ct:this.statContext.contentType,place:this.isEmbed?"embed":this.statContext.place,quality:this.statContext.quality,cdn_host:this.statContext.cdnHostname,stat_type:this.statContext.autoplay===!0?"auto":this.statContext.autoplay===!1?"":void 0,param:t,vk_app_id:this.statContext.vkAppId,track_code:this.statContext.trackCode,connection_type:l,connection_reused:c===!0?1:c===!1?0:void 0,cached_data:this.statContext.cached===!0?1:this.statContext.cached===!1?0:void 0,live:this.statContext.liveEdge?1:void 0,muted:this.statContext.audible===!1?1:void 0,mode:this.statContext.mode,subtitles:this.statContext.subtitles,download_speed:this.statContext.downloadSpeed,manual_quality:this.statContext.autoQuality?void 0:1,ref_domain:f,direct_url:h,rate:this.statContext.rate===1||(0,v.isNullable)(this.statContext.rate)?void 0:this.statContext.rate.toFixed(2),view_360:this.statContext.is3d?1:void 0,aid:this.statContext.albumId,vk_playlist_id:this.statContext.vkPlaylistId,...o};for(let L of this.config.disabledCustomFields)delete u[L];return{operation:e,type:1,time:i,network:this.statContext.network,timestamp:s,custom:u}}};var ct={};Io(ct,{ThinOneStat:()=>ut});var q=require("@vkontakte/videoplayer-shared/es2018"),at=require("@vkontakte/videoplayer-core/es2018");var ed=require("@vkontakte/videoplayer-shared/es2018");var xe="__VERSION__",Zl="CIOPGQJGDIHBABABA",ho={prod:"https://api.ok.ru",vk_alias:"https://api.mycdn.me",videotest:"https://videotestapi.ok.ru/api",test:"https://apitest.ok.ru",okcdn:"https://api.okcdn.ru",auto:""};var vy={apiKey:Zl,apiEnv:"vk_alias",requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageHeartbeatInterval:15,synchronizeTime:!0,useBeacon:!1,alwaysSendDesktop:!1},rd=r=>(0,ed.fillWithDefault)(r,vy);var vo=x(Bi(),1),H=require("@vkontakte/videoplayer-shared/es2018");var tt=class{constructor(e){this.params=e,this.authorized$=new H.ValueSubject(!1),this.consequentAuthErrors=0}async authorize(e){return this.authToken=e!=null?e:await this.refreshAuthToken(),this.authorizeWithBackoff()}logBeacon(e){let t="log.logUvStat",i=this.createLogParams(e),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(t,i,o)||this.logRequest(e).catch(()=>{})}async logRequest(e){var a;let t="log.logUvStat",i=this.createLogParams(e),o=(a=this.sessionKey)!=null?a:await this.authorizeWithBackoff();if(!o)return;let s=async(d,l=this.params.config.requestRetryCount)=>{try{return await this.params.apiTransport.sendRequest(t,i,o)}catch(c){if(!c||!("error_code"in c)){this.params.error$.next({id:"logRequestUnknown",category:H.ErrorCategory.NETWORK,message:`Unknown ${t} error`,thrown:c});return}let f=c==null?void 0:c.error_code;switch(f){case 102:case 103:case 104:return this.authorized$.next(!1),this.sessionKey=await this.authorizeWithBackoff(),l>0?s(d,l-1):void 0;case 401:return this.authorized$.next(!1),this.authToken=await this.refreshAuthToken(),this.sessionKey=await this.authorizeWithBackoff(),l>0?s(d,l-1):void 0;default:{this.params.error$.next({id:`LogRequest#${f}`,category:H.ErrorCategory.EXTERNAL_API,message:`${t} error`,data:c});return}}}};return s(e)}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}async refreshAuthToken(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=(0,vo.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){return{collector:"ok.mobile.apps.video",uv_stat_data:JSON.stringify({application:`@vkontakte/videoplayer-statistics:${xe}`,events:e})}}authorizeWithBackoff(){if(!this.consequentAuthErrors)return this.doAuthorize();let e=(0,H.getExponentialDelay)(this.consequentAuthErrors);return new Promise(t=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(async()=>{try{let i=await this.doAuthorize();t(i)}catch(i){this.params.error$.next({id:"AuthorizeBackoff",category:H.ErrorCategory.NETWORK,message:"Otherwise unhandled error in authorization",thrown:i})}finally{this.backoffTimeoutId=0}},e))})}doAuthorize(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);let e="auth.anonymLogin",t={session_data:{version:2,device_id:this.params.deviceId,client_version:xe.split("-")[0],client_type:"SDK_JS"}};return this.authToken!==void 0&&(t.session_data.auth_token=this.authToken,t.session_data.version=3),this.authorizePromise=(0,vo.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return console.log({it:i}),(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:H.ErrorCategory.EXTERNAL_API,message:"No session key",data:i}),this.sessionKey=(o=i==null?void 0:i.session_key)!=null?o:void 0,this.sessionKey}).catch(async i=>{this.sessionKey=void 0;let o=i==null?void 0:i.error_code;switch(o){case 401:return this.authToken=await this.refreshAuthToken(),this.authorizeWithBackoff()}o?this.params.error$.next({id:`Authorize#${o}`,category:H.ErrorCategory.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:H.ErrorCategory.NETWORK,message:"authorize error",thrown:i})}),()=>{console.log({sessionKey:this.sessionKey}),this.authorizePromise=void 0,this.consequentAuthErrors=this.sessionKey?0:this.consequentAuthErrors+1,this.authorized$.next(this.sessionKey!==void 0)}),this.authorizePromise}};var td=x(ge(),1);var id=x(we(),1),ee=require("@vkontakte/videoplayer-shared/es2018");var it=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=ho[this.apiEnv],this.timeSynchronisation=e.timeSynchronisation,this.isApiBaseUrlFetched=!1}sendBeacon(e,t,i){if(!window.Blob||!window.navigator.sendBeacon)return!1;let o=this.prepareQueryParams({method:e,queryParams:t,sessionKey:i}),s=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,s)}catch(a){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:ee.ErrorCategory.NETWORK,message:"Unhandled beacon error",thrown:a,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i){let o=(0,ee.now)(),s=a=>{if(a instanceof TypeError&&(0,td.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],a.message)){this.params.error$.next({id:"Network",category:ee.ErrorCategory.NETWORK,message:"Request failed",thrown:a});return}this.params.error$.next({id:"ThinOneStat:ApiTransport:sendRequest",category:ee.ErrorCategory.NETWORK,message:"Unhandled request error",thrown:a,data:{method:e,params:t,sessionKey:i,time:(0,ee.now)()-o}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),Ae("http://localhost:8080/fb.do",{method:"post",headers:{"Content-type":"application/x-www-form-urlencoded"},body:this.prepareQueryParams({method:e,queryParams:t,sessionKey:i})}).then(a=>{var f,h;let d=Number(a.headers.get("content-length"))===0,l=new Date((f=a.headers.get("date"))!=null?f:"").getTime(),c=(0,ee.now)()-o;if(isFinite(l)&&((h=this.timeSynchronisation)==null||h.addServerTime(l,c)),!d)return a.json().then(u=>Object.prototype.hasOwnProperty.call(u,"error_msg")?Promise.reject(u):u,s)},s)}async resolveApiBaseUrl(){var e;if(this.apiEnv!=="auto"||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{let t=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=await(await Ae(t,{method:"GET",mode:"cors",cache:"no-cache"})).json(),s=(e=o==null?void 0:o.Answer[0])==null?void 0:e.data;if(!s)throw new Error("Wrong DNS response");return s}catch(t){return this.params.error$.next({id:"ThinOneStat:ApiTransport:resolveApiBaseUrl",category:ee.ErrorCategory.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),ho.vk_alias}finally{this.isApiBaseUrlFetched=!0}}prepareQueryParams(e){let t=new URLSearchParams({format:"JSON",method:e.method,application_key:this.apiKey});return e.sessionKey!==void 0&&t.append("session_key",e.sessionKey),(0,id.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var od=x(ge(),1),nd=x(we(),1),B=require("@vkontakte/videoplayer-shared/es2018"),ot="thinonestat_events",go=r=>e=>e.client_time+r>=(0,B.now)(),nt=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{event_name:t}=e;return(0,od.default)(["watch_record"],t)};this.params=e,this.api=e.api,this.error$=e.error$,this.userSalt=e.userSalt,this.loggerDebugLog=e.debugLogger.createComponentLog("stat logger"),this.firstFlush=(0,B.debounceFn)(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=B.safeStorage.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=(0,B.debounceFn)(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:t}),this.subscription=this.api.authorized$.subscribe(i=>{i&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){var e;try{this.flush()}catch(t){this.error$.next({id:"LoggerError",category:B.ErrorCategory.WTF,message:(e=String(t))!=null?e:"Unknown logger error",thrown:t})}}readFromStorage(){let e=B.safeStorage.get(ot);try{return e?JSON.parse(e):{}}catch(t){}return{}}addToStorage(e){var s;if(!this.userSalt){this.unsaltedStorage.push(e);return}let t=this.readFromStorage(),o=((s=t[this.userSalt])!=null?s:[]).filter(go(this.params.config.storageExpiration));B.safeStorage.set(ot,JSON.stringify({...t,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(go(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],B.safeStorage.set(ot,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of(0,nd.default)(e)){let o=i.filter(go(this.params.config.storageExpiration));o.length?e[t]=o:delete e[t],this.loggerDebugLog({message:`${i.length} retrieved from storage, ${o.length} of them actual`})}B.safeStorage.set(ot,JSON.stringify(e))}log(e){this.addToStorage(e),!this.isPaused&&(this.isUrgent(e)?this.flush():this.lastVsid!==e.vsid?this.firstFlush():this.debouncedFlush(),this.lastVsid=e.vsid)}flush({wantBeacon:e,clearStorage:t}={wantBeacon:!1,clearStorage:!0}){let i=this.getFromStorage();i.length!==0&&(this.api.authorized$.getValue()?(e&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${i.length} events through beacon`}),this.api.logBeacon(i)):(this.loggerDebugLog({message:`Flushing ${i.length} events`}),this.api.logRequest(i)),t&&this.markStorageSent()):this.api.authorize(),this.firstFlush.cancel(),this.debouncedFlush.cancel())}pause(){this.isPaused=!0,this.debouncedFlush.cancel()}resume(){this.isPaused=!1,this.debouncedFlush()}destroy(){this.subscription.unsubscribe(),this.firstFlush.cancel(),this.debouncedFlush.cancel()}};function mo(){let r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),t=0,i,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?e[o]="-":o===14?e[o]="4":(t<=2&&(t=33554432+Math.random()*16777216|0),i=t&15,t=t>>4,e[o]=r[o===19?i&3|8:i]);return e.join("")}var st=class{constructor(e){this.offset=void 0;this.offset=e}getOffset(){var e;return(e=this.offset)!=null?e:0}setOffset(e){this.offset=e}now(){var e;return Date.now()+((e=this.offset)!=null?e:0)}date(e=new Date){var t;return e.setTime(e.getTime()+((t=this.offset)!=null?t:0)),e}addServerTime(e,t){let i=Date.now(),o=e-i-t/2;if(Math.abs(o)<1e3){this.offset=0;return}this.offset===void 0?this.offset=Math.round(o):this.offset=Math.round(.2*o+(1-.2)*this.offset)}};var bo=require("@vkontakte/videoplayer-core/es2018"),_=require("@vkontakte/videoplayer-shared/es2018"),sd=(r,e)=>new _.Observable(t=>{let i=new _.Subscription,o=new _.ValueSubject(void 0),s;i.add(r.info.isLive$.pipe((0,_.filterChanged)()).subscribe(A=>{s&&(s.unsubscribe(),o.next(void 0)),A?s=r.info.liveTime$.pipe((0,_.filterChanged)()).subscribe(o):s=r.info.position$.subscribe(o),i.add(s)}));let{playing$:a,paused$:d,ended$:l,looped$:c}=r.events,f=r.events.willSeek$.pipe((0,_.filter)(()=>r.info.playbackState$.getValue()===bo.PlaybackState.PLAYING)),h=r.events.seeked$.pipe((0,_.filter)(()=>r.info.playbackState$.getValue()===bo.PlaybackState.PLAYING)),u=!1,p=new _.Subject;i.add(f.subscribe(()=>{u||p.next(),u=!0})).add(h.subscribe(()=>u=!1));let m=(0,_.merge)((0,_.fromEvent)(window,"beforeunload"),r.events.willDestruct$),b,I=()=>b=o.getValue(),y=()=>{let A=o.getValue();(0,_.isNullable)(b)||(0,_.isNullable)(A)||b===A||(t.next({from:b,to:A}),b=void 0)},S=new _.Subject,L=new _.Subject,F=(0,_.merge)(a,p,S),T=(0,_.merge)(d,h,m,l,c,L);if(i.add(F.subscribe(I)).add(T.subscribe(y)),e.heartbeatInterval&&isFinite(e.heartbeatInterval)){let A=[],nr=e.heartbeatInterval*1e3,sr=()=>{L.next(),S.next()};i.add(F.subscribe(()=>{let lt=window.setTimeout(sr,nr);A.push(lt)})).add(T.subscribe(()=>{A.forEach(lt=>{window.clearTimeout(lt)}),A=[]}))}return i});var le=require("@vkontakte/videoplayer-shared/es2018"),ad=r=>new le.Observable(e=>{let t=new le.Subscription,i=0,o=1,s=0,a=!1,d=!1,l=()=>{if(!a)return;let T=Date.now();s+=(T-i)*o,i=T},c=()=>{(!a||d)&&(i=Date.now(),a=!0,d=!1)},f=()=>{a&&(l(),a=!1)},h=()=>{a&&(l(),a=!1,d=!0)},u=T=>{a&&l(),o=T,i=Date.now()},{started$:p,playing$:m,paused$:b,willSeek$:I,ended$:y,willDestruct$:S}=r.events,{currentPlaybackRate$:L}=r.info;t.add(I.subscribe(h)).add((0,le.merge)(p,m).subscribe(c)).add((0,le.merge)(b,y,S).subscribe(f)).add(L.subscribe(u));let F=()=>{let T=s;return a&&(T+=(Date.now()-i)*o),Math.floor(T/1e3)};return e.next(F),t});var yo=require("@vkontakte/videoplayer-shared/es2018"),E=require("@vkontakte/videoplayer-core/es2018");var ud=r=>{if(r!==void 0)switch(r){case E.VideoFormat.MPEG:return"MP4";case E.VideoFormat.DASH:case E.VideoFormat.DASH_LIVE:return"DASH";case E.VideoFormat.DASH_SEP:return"DASH_SEP";case E.VideoFormat.DASH_ONDEMAND:return"ONDEMAND_DASH";case E.VideoFormat.HLS_ONDEMAND:return"ONDEMAND_HLS";case E.VideoFormat.HLS:case E.VideoFormat.HLS_LIVE:return"HLS";case E.VideoFormat.DASH_WEBM:case E.VideoFormat.DASH_LIVE_WEBM:return"WEBM";case E.VideoFormat.DASH_LIVE_CMAF:return"ONDEMAND_DASH_LIVE";case E.VideoFormat.HLS_LIVE_CMAF:return"ONDEMAND_HLS_LIVE";case E.VideoFormat.WEB_RTC_LIVE:return"WEBRTC";case E.VideoFormat.DASH_WEBM_AV1:return"AV1";case E.VideoFormat.DASH_STREAMS:return"MULTI_DASH";default:return(0,yo.assertNever)(r)}},cd=r=>{if(r!==void 0)switch(r){case E.VideoQuality.Q_144P:return"144p";case E.VideoQuality.Q_240P:return"240p";case E.VideoQuality.Q_360P:return"360p";case E.VideoQuality.Q_480P:return"480p";case E.VideoQuality.Q_720P:return"720p";case E.VideoQuality.Q_1080P:return"1080p";case E.VideoQuality.Q_1440P:return"1440p";case E.VideoQuality.Q_2160P:return"2160p";case E.VideoQuality.INVARIANT:case E.VideoQuality.Q_576P:case E.VideoQuality.Q_4320P:return"UNKNOWN";default:return(0,yo.assertNever)(r)}};var ld=x(uo(),1),dd=()=>(0,ld.default)(Math.floor(Math.random()*2**32).toString(36),7,"0");var gy="_thin-one-stat_",fd=`${gy}deviceId`,ut=class{constructor(e,t){this.debugLogger=new q.Logger;this.thinOneStatDebugLog=this.debugLogger.createComponentLog("ThinOneStat");this.eventNumber=0;this.vsid$=new q.ValueSubject(void 0);var a;this.statContext=e,this.config=rd((a=t.config)!=null?a:{}),this.subscription=new q.Subscription,this.config.synchronizeTime&&(this.timeSynchronisation=new st);let i=new q.Subject,o=q.safeStorage.get(fd);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:o?this.deviceId=o:(this.deviceId=mo(),q.safeStorage.set(fd,this.deviceId)),this.resetViewSession();let s=new it({error$:i,config:this.config,timeSynchronisation:this.timeSynchronisation});this.api=new tt({config:this.config,apiTransport:s,error$:i,deviceId:this.deviceId,refreshAuthToken:t.refreshAuthToken}),this.logger=new nt({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:t.userSalt})}authorize(e){return this.api.authorize(e)}updateContext(e){this.statContext={...this.statContext,...e}}attachTo(e){let t=new q.Subscription,i=(o,s)=>t.add(o.subscribe(s));return i(ad(e),o=>{this.getTotalViewTime=o}),i(e.info.isLive$,o=>this.isLive=o),i(e.info.position$,o=>this.position=o),i(sd(e,{heartbeatInterval:this.config.watchCoverageHeartbeatInterval}),o=>{let s=Math.round(o.from*1e3),a=Math.round(o.to*1e3),d=`${s}-${a}`,l=!!this.statContext.inHistory,c=this.statContext.contentType,f=this.statContext.quality,h=this.statContext.recomInfo;this.logWatchCoverage({watch_interval:d,in_history:l,content_type:c,playback_quality:f,recom_info:h})}),i(e.info.currentFormat$,o=>this.updateContext({contentType:ud(o)})),i(e.info.currentQuality$,o=>this.updateContext({quality:cd(o)})),this.resubscribeBeforeunload(),this.subscription.add(t),t}getDeviceId(){return this.deviceId}resetViewSession(){this.thinOneStatDebugLog({message:"VSID reset"}),this.vsid$.next(dd()),this.eventNumber=0}destroy(){this.api.destroy()}createLogItem(e){let t=this.vsid$.getValue();return(0,q.assertNonNullable)(t),{vsid:t,uv_movie_id:this.statContext.movieId,user_id:this.statContext.userId,uv_user_id:this.statContext.uvUserId,device_id:this.statContext.deviceId,event_name:e,client_time:(0,q.now)(),application:`@vkontakte/videoplayer-statistics:${xe}`,platform:`web:${this.config.alwaysSendDesktop||!this.statContext.mobile?"desktop":"mobile"}`,product:this.statContext.product,event_number:this.eventNumber++,playback_position:this.isLive?void 0:this.position,current_tvt:this.getTotalViewTime()}}log(e,t){let i={stats_version:xe,user_agent:{browser:at.clientChecker.browser.current,browser_version:"",os:at.clientChecker.device.current,os_version:"",device_type:at.clientChecker.device.isMobile?"mobile":"desktop",navigation:this.statContext.navigation}},o=this.createLogItem(e);this.logger.log({...o,...t,...i})}logWatchCoverage(e){this.log("watch_coverage",e)}resubscribeBeforeunload(){var e;(e=this.beforeunloadSubscription)==null||e.unsubscribe(),this.beforeunloadSubscription=(0,q.fromEvent)(window,"beforeunload").subscribe(()=>{}),this.subscription.add(this.beforeunloadSubscription)}};
6
+ "use strict";var wl=Object.create;var ze=Object.defineProperty;var xl=Object.getOwnPropertyDescriptor;var Rl=Object.getOwnPropertyNames;var Cl=Object.getPrototypeOf,Al=Object.prototype.hasOwnProperty;var n=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Nl=(r,e)=>{for(var t in e)ze(r,t,{get:e[t],enumerable:!0})},zi=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Rl(e))!Al.call(r,o)&&o!==t&&ze(r,o,{get:()=>e[o],enumerable:!(i=xl(e,o))||i.enumerable});return r};var F=(r,e,t)=>(t=r!=null?wl(Cl(r)):{},zi(e||!r||!r.__esModule?ze(t,"default",{value:r,enumerable:!0}):t,r)),Ll=r=>zi(ze({},"__esModule",{value:!0}),r);var q=n((Kr,Qi)=>{"use strict";var Ie=function(r){return r&&r.Math===Math&&r};Qi.exports=Ie(typeof globalThis=="object"&&globalThis)||Ie(typeof window=="object"&&window)||Ie(typeof self=="object"&&self)||Ie(typeof global=="object"&&global)||Ie(typeof Kr=="object"&&Kr)||function(){return this}()||Function("return this")()});var T=n((Nb,Yi)=>{"use strict";Yi.exports=function(r){try{return!!r()}catch(e){return!0}}});var Se=n((Lb,Ji)=>{"use strict";var kl=T();Ji.exports=!kl(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var Wr=n((kb,ro)=>{"use strict";var Dl=Se(),eo=Function.prototype,Xi=eo.apply,Zi=eo.call;ro.exports=typeof Reflect=="object"&&Reflect.apply||(Dl?Zi.bind(Xi):function(){return Zi.apply(Xi,arguments)})});var O=n((Db,oo)=>{"use strict";var to=Se(),io=Function.prototype,Hr=io.call,$l=to&&io.bind.bind(Hr,Hr);oo.exports=to?$l:function(r){return function(){return Hr.apply(r,arguments)}}});var Ee=n(($b,ao)=>{"use strict";var no=O(),jl=no({}.toString),Ml=no("".slice);ao.exports=function(r){return Ml(jl(r),8,-1)}});var zr=n((jb,so)=>{"use strict";var Fl=Ee(),Bl=O();so.exports=function(r){if(Fl(r)==="Function")return Bl(r)}});var P=n((Mb,uo)=>{"use strict";var Qr=typeof document=="object"&&document.all;uo.exports=typeof Qr=="undefined"&&Qr!==void 0?function(r){return typeof r=="function"||r===Qr}:function(r){return typeof r=="function"}});var _=n((Fb,co)=>{"use strict";var Ul=T();co.exports=!Ul(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7})});var N=n((Bb,lo)=>{"use strict";var Vl=Se(),Qe=Function.prototype.call;lo.exports=Vl?Qe.bind(Qe):function(){return Qe.apply(Qe,arguments)}});var Yr=n(vo=>{"use strict";var fo={}.propertyIsEnumerable,po=Object.getOwnPropertyDescriptor,Gl=po&&!fo.call({1:2},1);vo.f=Gl?function(e){var t=po(this,e);return!!t&&t.enumerable}:fo});var qe=n((Vb,ho)=>{"use strict";ho.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var mo=n((Gb,go)=>{"use strict";var Kl=O(),Wl=T(),Hl=Ee(),Jr=Object,zl=Kl("".split);go.exports=Wl(function(){return!Jr("z").propertyIsEnumerable(0)})?function(r){return Hl(r)==="String"?zl(r,""):Jr(r)}:Jr});var Pe=n((Kb,bo)=>{"use strict";bo.exports=function(r){return r==null}});var ie=n((Wb,yo)=>{"use strict";var Ql=Pe(),Yl=TypeError;yo.exports=function(r){if(Ql(r))throw new Yl("Can't call method on "+r);return r}});var z=n((Hb,Io)=>{"use strict";var Jl=mo(),Xl=ie();Io.exports=function(r){return Jl(Xl(r))}});var L=n((zb,So)=>{"use strict";var Zl=P();So.exports=function(r){return typeof r=="object"?r!==null:Zl(r)}});var Te=n((Qb,Eo)=>{"use strict";Eo.exports={}});var B=n((Yb,Po)=>{"use strict";var Xr=Te(),Zr=q(),ef=P(),qo=function(r){return ef(r)?r:void 0};Po.exports=function(r,e){return arguments.length<2?qo(Xr[r])||qo(Zr[r]):Xr[r]&&Xr[r][e]||Zr[r]&&Zr[r][e]}});var Ye=n((Jb,To)=>{"use strict";var rf=O();To.exports=rf({}.isPrototypeOf)});var Q=n((Xb,wo)=>{"use strict";var tf=q(),Oo=tf.navigator,_o=Oo&&Oo.userAgent;wo.exports=_o?String(_o):""});var rt=n((Zb,Lo)=>{"use strict";var No=q(),et=Q(),xo=No.process,Ro=No.Deno,Co=xo&&xo.versions||Ro&&Ro.version,Ao=Co&&Co.v8,k,Je;Ao&&(k=Ao.split("."),Je=k[0]>0&&k[0]<4?1:+(k[0]+k[1]));!Je&&et&&(k=et.match(/Edge\/(\d+)/),(!k||k[1]>=74)&&(k=et.match(/Chrome\/(\d+)/),k&&(Je=+k[1])));Lo.exports=Je});var tt=n((ey,Do)=>{"use strict";var ko=rt(),of=T(),nf=q(),af=nf.String;Do.exports=!!Object.getOwnPropertySymbols&&!of(function(){var r=Symbol("symbol detection");return!af(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&ko&&ko<41})});var it=n((ry,$o)=>{"use strict";var sf=tt();$o.exports=sf&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var ot=n((ty,jo)=>{"use strict";var uf=B(),cf=P(),lf=Ye(),ff=it(),df=Object;jo.exports=ff?function(r){return typeof r=="symbol"}:function(r){var e=uf("Symbol");return cf(e)&&lf(e.prototype,df(r))}});var Oe=n((iy,Mo)=>{"use strict";var pf=String;Mo.exports=function(r){try{return pf(r)}catch(e){return"Object"}}});var U=n((oy,Fo)=>{"use strict";var vf=P(),hf=Oe(),gf=TypeError;Fo.exports=function(r){if(vf(r))return r;throw new gf(hf(r)+" is not a function")}});var Xe=n((ny,Bo)=>{"use strict";var mf=U(),bf=Pe();Bo.exports=function(r,e){var t=r[e];return bf(t)?void 0:mf(t)}});var Vo=n((ay,Uo)=>{"use strict";var nt=N(),at=P(),st=L(),yf=TypeError;Uo.exports=function(r,e){var t,i;if(e==="string"&&at(t=r.toString)&&!st(i=nt(t,r))||at(t=r.valueOf)&&!st(i=nt(t,r))||e!=="string"&&at(t=r.toString)&&!st(i=nt(t,r)))return i;throw new yf("Can't convert object to primitive value")}});var j=n((sy,Go)=>{"use strict";Go.exports=!0});var Ho=n((uy,Wo)=>{"use strict";var Ko=q(),If=Object.defineProperty;Wo.exports=function(r,e){try{If(Ko,r,{value:e,configurable:!0,writable:!0})}catch(t){Ko[r]=e}return e}});var _e=n((cy,Yo)=>{"use strict";var Sf=j(),Ef=q(),qf=Ho(),zo="__core-js_shared__",Qo=Yo.exports=Ef[zo]||qf(zo,{});(Qo.versions||(Qo.versions=[])).push({version:"3.38.0",mode:Sf?"pure":"global",copyright:"\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.0/LICENSE",source:"https://github.com/zloirock/core-js"})});var ut=n((ly,Xo)=>{"use strict";var Jo=_e();Xo.exports=function(r,e){return Jo[r]||(Jo[r]=e||{})}});var ct=n((fy,Zo)=>{"use strict";var Pf=ie(),Tf=Object;Zo.exports=function(r){return Tf(Pf(r))}});var M=n((dy,en)=>{"use strict";var Of=O(),_f=ct(),wf=Of({}.hasOwnProperty);en.exports=Object.hasOwn||function(e,t){return wf(_f(e),t)}});var lt=n((py,rn)=>{"use strict";var xf=O(),Rf=0,Cf=Math.random(),Af=xf(1 .toString);rn.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Af(++Rf+Cf,36)}});var w=n((vy,on)=>{"use strict";var Nf=q(),Lf=ut(),tn=M(),kf=lt(),Df=tt(),$f=it(),oe=Nf.Symbol,ft=Lf("wks"),jf=$f?oe.for||oe:oe&&oe.withoutSetter||kf;on.exports=function(r){return tn(ft,r)||(ft[r]=Df&&tn(oe,r)?oe[r]:jf("Symbol."+r)),ft[r]}});var un=n((hy,sn)=>{"use strict";var Mf=N(),nn=L(),an=ot(),Ff=Xe(),Bf=Vo(),Uf=w(),Vf=TypeError,Gf=Uf("toPrimitive");sn.exports=function(r,e){if(!nn(r)||an(r))return r;var t=Ff(r,Gf),i;if(t){if(e===void 0&&(e="default"),i=Mf(t,r,e),!nn(i)||an(i))return i;throw new Vf("Can't convert object to primitive value")}return e===void 0&&(e="number"),Bf(r,e)}});var dt=n((gy,cn)=>{"use strict";var Kf=un(),Wf=ot();cn.exports=function(r){var e=Kf(r,"string");return Wf(e)?e:e+""}});var Ze=n((my,fn)=>{"use strict";var Hf=q(),ln=L(),pt=Hf.document,zf=ln(pt)&&ln(pt.createElement);fn.exports=function(r){return zf?pt.createElement(r):{}}});var vt=n((by,dn)=>{"use strict";var Qf=_(),Yf=T(),Jf=Ze();dn.exports=!Qf&&!Yf(function(){return Object.defineProperty(Jf("div"),"a",{get:function(){return 7}}).a!==7})});var hn=n(vn=>{"use strict";var Xf=_(),Zf=N(),ed=Yr(),rd=qe(),td=z(),id=dt(),od=M(),nd=vt(),pn=Object.getOwnPropertyDescriptor;vn.f=Xf?pn:function(e,t){if(e=td(e),t=id(t),nd)try{return pn(e,t)}catch(i){}if(od(e,t))return rd(!Zf(ed.f,e,t),e[t])}});var ht=n((Iy,gn)=>{"use strict";var ad=T(),sd=P(),ud=/#|\.prototype\./,we=function(r,e){var t=ld[cd(r)];return t===dd?!0:t===fd?!1:sd(e)?ad(e):!!e},cd=we.normalize=function(r){return String(r).replace(ud,".").toLowerCase()},ld=we.data={},fd=we.NATIVE="N",dd=we.POLYFILL="P";gn.exports=we});var xe=n((Sy,bn)=>{"use strict";var mn=zr(),pd=U(),vd=Se(),hd=mn(mn.bind);bn.exports=function(r,e){return pd(r),e===void 0?r:vd?hd(r,e):function(){return r.apply(e,arguments)}}});var gt=n((Ey,yn)=>{"use strict";var gd=_(),md=T();yn.exports=gd&&md(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42})});var V=n((qy,In)=>{"use strict";var bd=L(),yd=String,Id=TypeError;In.exports=function(r){if(bd(r))return r;throw new Id(yd(r)+" is not an object")}});var Y=n(En=>{"use strict";var Sd=_(),Ed=vt(),qd=gt(),er=V(),Sn=dt(),Pd=TypeError,mt=Object.defineProperty,Td=Object.getOwnPropertyDescriptor,bt="enumerable",yt="configurable",It="writable";En.f=Sd?qd?function(e,t,i){if(er(e),t=Sn(t),er(i),typeof e=="function"&&t==="prototype"&&"value"in i&&It in i&&!i[It]){var o=Td(e,t);o&&o[It]&&(e[t]=i.value,i={configurable:yt in i?i[yt]:o[yt],enumerable:bt in i?i[bt]:o[bt],writable:!1})}return mt(e,t,i)}:mt:function(e,t,i){if(er(e),t=Sn(t),er(i),Ed)try{return mt(e,t,i)}catch(o){}if("get"in i||"set"in i)throw new Pd("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var ne=n((Ty,qn)=>{"use strict";var Od=_(),_d=Y(),wd=qe();qn.exports=Od?function(r,e,t){return _d.f(r,e,wd(1,t))}:function(r,e,t){return r[e]=t,r}});var x=n((Oy,Tn)=>{"use strict";var Re=q(),xd=Wr(),Rd=zr(),Cd=P(),Ad=hn().f,Nd=ht(),ae=Te(),Ld=xe(),se=ne(),Pn=M();_e();var kd=function(r){var e=function(t,i,o){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,i)}return new r(t,i,o)}return xd(r,this,arguments)};return e.prototype=r.prototype,e};Tn.exports=function(r,e){var t=r.target,i=r.global,o=r.stat,a=r.proto,u=i?Re:o?Re[t]:Re[t]&&Re[t].prototype,f=i?ae:ae[t]||se(ae,t,{})[t],d=f.prototype,c,p,h,s,l,m,b,S,y;for(s in e)c=Nd(i?s:t+(o?".":"#")+s,r.forced),p=!c&&u&&Pn(u,s),m=f[s],p&&(r.dontCallGetSet?(y=Ad(u,s),b=y&&y.value):b=u[s]),l=p&&b?b:e[s],!(!c&&!a&&typeof m==typeof l)&&(r.bind&&p?S=Ld(l,Re):r.wrap&&p?S=kd(l):a&&Cd(l)?S=Rd(l):S=l,(r.sham||l&&l.sham||m&&m.sham)&&se(S,"sham",!0),se(f,s,S),a&&(h=t+"Prototype",Pn(ae,h)||se(ae,h,{}),se(ae[h],s,l),r.real&&d&&(c||!d[s])&&se(d,s,l)))}});var _n=n((_y,On)=>{"use strict";var Dd=Math.ceil,$d=Math.floor;On.exports=Math.trunc||function(e){var t=+e;return(t>0?$d:Dd)(t)}});var rr=n((wy,wn)=>{"use strict";var jd=_n();wn.exports=function(r){var e=+r;return e!==e||e===0?0:jd(e)}});var Rn=n((xy,xn)=>{"use strict";var Md=rr(),Fd=Math.max,Bd=Math.min;xn.exports=function(r,e){var t=Md(r);return t<0?Fd(t+e,0):Bd(t,e)}});var St=n((Ry,Cn)=>{"use strict";var Ud=rr(),Vd=Math.min;Cn.exports=function(r){var e=Ud(r);return e>0?Vd(e,9007199254740991):0}});var Et=n((Cy,An)=>{"use strict";var Gd=St();An.exports=function(r){return Gd(r.length)}});var qt=n((Ay,Ln)=>{"use strict";var Kd=z(),Wd=Rn(),Hd=Et(),Nn=function(r){return function(e,t,i){var o=Kd(e),a=Hd(o);if(a===0)return!r&&-1;var u=Wd(i,a),f;if(r&&t!==t){for(;a>u;)if(f=o[u++],f!==f)return!0}else for(;a>u;u++)if((r||u in o)&&o[u]===t)return r||u||0;return!r&&-1}};Ln.exports={includes:Nn(!0),indexOf:Nn(!1)}});var Pt=n((Ny,kn)=>{"use strict";kn.exports=function(){}});var Dn=n(()=>{"use strict";var zd=x(),Qd=qt().includes,Yd=T(),Jd=Pt(),Xd=Yd(function(){return!Array(1).includes()});zd({target:"Array",proto:!0,forced:Xd},{includes:function(e){return Qd(this,e,arguments.length>1?arguments[1]:void 0)}});Jd("includes")});var tr=n((Dy,$n)=>{"use strict";var Zd=B();$n.exports=Zd});var Mn=n(($y,jn)=>{"use strict";Dn();var ep=tr();jn.exports=ep("Array","includes")});var Bn=n((jy,Fn)=>{"use strict";var rp=Mn();Fn.exports=rp});var ir=n((My,Un)=>{"use strict";var tp=Bn();Un.exports=tp});var Yn=n(()=>{"use strict"});var wt=n((Jy,Jn)=>{"use strict";var Ae=q(),op=Q(),np=Ee(),ur=function(r){return op.slice(0,r.length)===r};Jn.exports=function(){return ur("Bun/")?"BUN":ur("Cloudflare-Workers")?"CLOUDFLARE":ur("Deno/")?"DENO":ur("Node.js/")?"NODE":Ae.Bun&&typeof Bun.version=="string"?"BUN":Ae.Deno&&typeof Deno.version=="object"?"DENO":np(Ae.process)==="process"?"NODE":Ae.window&&Ae.document?"BROWSER":"REST"}()});var cr=n((Xy,Xn)=>{"use strict";var ap=wt();Xn.exports=ap==="NODE"});var ce=n((Zy,Zn)=>{"use strict";var sp=ne();Zn.exports=function(r,e,t,i){return i&&i.enumerable?r[e]=t:sp(r,e,t),r}});var ra=n((eI,ea)=>{"use strict";var up=O(),cp=U();ea.exports=function(r,e,t){try{return up(cp(Object.getOwnPropertyDescriptor(r,e)[t]))}catch(i){}}});var ia=n((rI,ta)=>{"use strict";var lp=L();ta.exports=function(r){return lp(r)||r===null}});var na=n((tI,oa)=>{"use strict";var fp=ia(),dp=String,pp=TypeError;oa.exports=function(r){if(fp(r))return r;throw new pp("Can't set "+dp(r)+" as a prototype")}});var xt=n((iI,aa)=>{"use strict";var vp=ra(),hp=L(),gp=ie(),mp=na();aa.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=vp(Object.prototype,"__proto__","set"),t(e,[]),r=e instanceof Array}catch(i){}return function(o,a){return gp(o),mp(a),hp(o)&&(r?t(o,a):o.__proto__=a),o}}():void 0)});var lr=n((oI,ua)=>{"use strict";var bp=w(),yp=bp("toStringTag"),sa={};sa[yp]="z";ua.exports=String(sa)==="[object z]"});var Ne=n((nI,ca)=>{"use strict";var Ip=lr(),Sp=P(),fr=Ee(),Ep=w(),qp=Ep("toStringTag"),Pp=Object,Tp=fr(function(){return arguments}())==="Arguments",Op=function(r,e){try{return r[e]}catch(t){}};ca.exports=Ip?fr:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=Op(e=Pp(r),qp))=="string"?t:Tp?fr(e):(i=fr(e))==="Object"&&Sp(e.callee)?"Arguments":i}});var fa=n((aI,la)=>{"use strict";var _p=lr(),wp=Ne();la.exports=_p?{}.toString:function(){return"[object "+wp(this)+"]"}});var Le=n((sI,pa)=>{"use strict";var xp=lr(),Rp=Y().f,Cp=ne(),Ap=M(),Np=fa(),Lp=w(),da=Lp("toStringTag");pa.exports=function(r,e,t,i){var o=t?r:r&&r.prototype;o&&(Ap(o,da)||Rp(o,da,{configurable:!0,value:e}),i&&!xp&&Cp(o,"toString",Np))}});var ha=n((uI,va)=>{"use strict";var kp=Y();va.exports=function(r,e,t){return kp.f(r,e,t)}});var ba=n((cI,ma)=>{"use strict";var Dp=B(),$p=ha(),jp=w(),Mp=_(),ga=jp("species");ma.exports=function(r){var e=Dp(r);Mp&&e&&!e[ga]&&$p(e,ga,{configurable:!0,get:function(){return this}})}});var Ia=n((lI,ya)=>{"use strict";var Fp=Ye(),Bp=TypeError;ya.exports=function(r,e){if(Fp(e,r))return r;throw new Bp("Incorrect invocation")}});var Ct=n((fI,Sa)=>{"use strict";var Up=O(),Vp=P(),Rt=_e(),Gp=Up(Function.toString);Vp(Rt.inspectSource)||(Rt.inspectSource=function(r){return Gp(r)});Sa.exports=Rt.inspectSource});var _a=n((dI,Oa)=>{"use strict";var Kp=O(),Wp=T(),Ea=P(),Hp=Ne(),zp=B(),Qp=Ct(),qa=function(){},Pa=zp("Reflect","construct"),At=/^\s*(?:class|function)\b/,Yp=Kp(At.exec),Jp=!At.test(qa),ke=function(e){if(!Ea(e))return!1;try{return Pa(qa,[],e),!0}catch(t){return!1}},Ta=function(e){if(!Ea(e))return!1;switch(Hp(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Jp||!!Yp(At,Qp(e))}catch(t){return!0}};Ta.sham=!0;Oa.exports=!Pa||Wp(function(){var r;return ke(ke.call)||!ke(Object)||!ke(function(){r=!0})||r})?Ta:ke});var xa=n((pI,wa)=>{"use strict";var Xp=_a(),Zp=Oe(),ev=TypeError;wa.exports=function(r){if(Xp(r))return r;throw new ev(Zp(r)+" is not a constructor")}});var Nt=n((vI,Ca)=>{"use strict";var Ra=V(),rv=xa(),tv=Pe(),iv=w(),ov=iv("species");Ca.exports=function(r,e){var t=Ra(r).constructor,i;return t===void 0||tv(i=Ra(t)[ov])?e:rv(i)}});var Lt=n((hI,Aa)=>{"use strict";var nv=B();Aa.exports=nv("document","documentElement")});var La=n((gI,Na)=>{"use strict";var av=O();Na.exports=av([].slice)});var Da=n((mI,ka)=>{"use strict";var sv=TypeError;ka.exports=function(r,e){if(r<e)throw new sv("Not enough arguments");return r}});var kt=n((bI,$a)=>{"use strict";var uv=Q();$a.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(uv)});var Gt=n((yI,Wa)=>{"use strict";var R=q(),cv=Wr(),lv=xe(),ja=P(),fv=M(),Ka=T(),Ma=Lt(),dv=La(),Fa=Ze(),pv=Da(),vv=kt(),hv=cr(),Bt=R.setImmediate,Ut=R.clearImmediate,gv=R.process,Dt=R.Dispatch,mv=R.Function,Ba=R.MessageChannel,bv=R.String,$t=0,De={},Ua="onreadystatechange",$e,J,jt,Mt;Ka(function(){$e=R.location});var Vt=function(r){if(fv(De,r)){var e=De[r];delete De[r],e()}},Ft=function(r){return function(){Vt(r)}},Va=function(r){Vt(r.data)},Ga=function(r){R.postMessage(bv(r),$e.protocol+"//"+$e.host)};(!Bt||!Ut)&&(Bt=function(e){pv(arguments.length,1);var t=ja(e)?e:mv(e),i=dv(arguments,1);return De[++$t]=function(){cv(t,void 0,i)},J($t),$t},Ut=function(e){delete De[e]},hv?J=function(r){gv.nextTick(Ft(r))}:Dt&&Dt.now?J=function(r){Dt.now(Ft(r))}:Ba&&!vv?(jt=new Ba,Mt=jt.port2,jt.port1.onmessage=Va,J=lv(Mt.postMessage,Mt)):R.addEventListener&&ja(R.postMessage)&&!R.importScripts&&$e&&$e.protocol!=="file:"&&!Ka(Ga)?(J=Ga,R.addEventListener("message",Va,!1)):Ua in Fa("script")?J=function(r){Ma.appendChild(Fa("script"))[Ua]=function(){Ma.removeChild(this),Vt(r)}}:J=function(r){setTimeout(Ft(r),0)});Wa.exports={set:Bt,clear:Ut}});var Qa=n((II,za)=>{"use strict";var Ha=q(),yv=_(),Iv=Object.getOwnPropertyDescriptor;za.exports=function(r){if(!yv)return Ha[r];var e=Iv(Ha,r);return e&&e.value}});var Kt=n((SI,Ja)=>{"use strict";var Ya=function(){this.head=null,this.tail=null};Ya.prototype={add:function(r){var e={item:r,next:null},t=this.tail;t?t.next=e:this.head=e,this.tail=e},get:function(){var r=this.head;if(r){var e=this.head=r.next;return e===null&&(this.tail=null),r.item}}};Ja.exports=Ya});var Za=n((EI,Xa)=>{"use strict";var Sv=Q();Xa.exports=/ipad|iphone|ipod/i.test(Sv)&&typeof Pebble!="undefined"});var rs=n((qI,es)=>{"use strict";var Ev=Q();es.exports=/web0s(?!.*chrome)/i.test(Ev)});var us=n((PI,ss)=>{"use strict";var fe=q(),qv=Qa(),ts=xe(),Wt=Gt().set,Pv=Kt(),Tv=kt(),Ov=Za(),_v=rs(),Ht=cr(),is=fe.MutationObserver||fe.WebKitMutationObserver,os=fe.document,ns=fe.process,dr=fe.Promise,Yt=qv("queueMicrotask"),le,zt,Qt,pr,as;Yt||(je=new Pv,Me=function(){var r,e;for(Ht&&(r=ns.domain)&&r.exit();e=je.get();)try{e()}catch(t){throw je.head&&le(),t}r&&r.enter()},!Tv&&!Ht&&!_v&&is&&os?(zt=!0,Qt=os.createTextNode(""),new is(Me).observe(Qt,{characterData:!0}),le=function(){Qt.data=zt=!zt}):!Ov&&dr&&dr.resolve?(pr=dr.resolve(void 0),pr.constructor=dr,as=ts(pr.then,pr),le=function(){as(Me)}):Ht?le=function(){ns.nextTick(Me)}:(Wt=ts(Wt,fe),le=function(){Wt(Me)}),Yt=function(r){je.head||le(),je.add(r)});var je,Me;ss.exports=Yt});var ls=n((TI,cs)=>{"use strict";cs.exports=function(r,e){try{arguments.length===1?console.error(r):console.error(r,e)}catch(t){}}});var vr=n((OI,fs)=>{"use strict";fs.exports=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}}});var vs=n((_I,ps)=>{"use strict";var wv=q(),xv=P(),ds=wv.WeakMap;ps.exports=xv(ds)&&/native code/.test(String(ds))});var hr=n((wI,gs)=>{"use strict";var Rv=ut(),Cv=lt(),hs=Rv("keys");gs.exports=function(r){return hs[r]||(hs[r]=Cv(r))}});var gr=n((xI,ms)=>{"use strict";ms.exports={}});var ei=n((RI,Is)=>{"use strict";var Av=vs(),ys=q(),Nv=L(),Lv=ne(),Jt=M(),Xt=_e(),kv=hr(),Dv=gr(),bs="Object already initialized",Zt=ys.TypeError,$v=ys.WeakMap,mr,Fe,br,jv=function(r){return br(r)?Fe(r):mr(r,{})},Mv=function(r){return function(e){var t;if(!Nv(e)||(t=Fe(e)).type!==r)throw new Zt("Incompatible receiver, "+r+" required");return t}};Av||Xt.state?(D=Xt.state||(Xt.state=new $v),D.get=D.get,D.has=D.has,D.set=D.set,mr=function(r,e){if(D.has(r))throw new Zt(bs);return e.facade=r,D.set(r,e),e},Fe=function(r){return D.get(r)||{}},br=function(r){return D.has(r)}):(X=kv("state"),Dv[X]=!0,mr=function(r,e){if(Jt(r,X))throw new Zt(bs);return e.facade=r,Lv(r,X,e),e},Fe=function(r){return Jt(r,X)?r[X]:{}},br=function(r){return Jt(r,X)});var D,X;Is.exports={set:mr,get:Fe,has:br,enforce:jv,getterFor:Mv}});var Z=n((CI,Ss)=>{"use strict";var Fv=q();Ss.exports=Fv.Promise});var de=n((AI,Ts)=>{"use strict";var Bv=q(),Be=Z(),Uv=P(),Vv=ht(),Gv=Ct(),Kv=w(),Es=wt(),Wv=j(),ri=rt(),qs=Be&&Be.prototype,Hv=Kv("species"),ti=!1,Ps=Uv(Bv.PromiseRejectionEvent),zv=Vv("Promise",function(){var r=Gv(Be),e=r!==String(Be);if(!e&&ri===66||Wv&&!(qs.catch&&qs.finally))return!0;if(!ri||ri<51||!/native code/.test(r)){var t=new Be(function(a){a(1)}),i=function(a){a(function(){},function(){})},o=t.constructor={};if(o[Hv]=i,ti=t.then(function(){})instanceof i,!ti)return!0}return!e&&(Es==="BROWSER"||Es==="DENO")&&!Ps});Ts.exports={CONSTRUCTOR:zv,REJECTION_EVENT:Ps,SUBCLASSING:ti}});var pe=n((NI,_s)=>{"use strict";var Os=U(),Qv=TypeError,Yv=function(r){var e,t;this.promise=new r(function(i,o){if(e!==void 0||t!==void 0)throw new Qv("Bad Promise constructor");e=i,t=o}),this.resolve=Os(e),this.reject=Os(t)};_s.exports.f=function(r){return new Yv(r)}});var Ws=n(()=>{"use strict";var Jv=x(),Xv=j(),Er=cr(),H=q(),me=N(),ws=ce(),xs=xt(),Zv=Le(),eh=ba(),rh=U(),Sr=P(),th=L(),ih=Ia(),oh=Nt(),Ls=Gt().set,si=us(),nh=ls(),ah=vr(),sh=Kt(),ks=ei(),qr=Z(),ui=de(),Ds=pe(),Pr="Promise",$s=ui.CONSTRUCTOR,uh=ui.REJECTION_EVENT,ch=ui.SUBCLASSING,ii=ks.getterFor(Pr),lh=ks.set,ve=qr&&qr.prototype,ee=qr,yr=ve,js=H.TypeError,oi=H.document,ci=H.process,ni=Ds.f,fh=ni,dh=!!(oi&&oi.createEvent&&H.dispatchEvent),Ms="unhandledrejection",ph="rejectionhandled",Rs=0,Fs=1,vh=2,li=1,Bs=2,Ir,Cs,hh,As,Us=function(r){var e;return th(r)&&Sr(e=r.then)?e:!1},Vs=function(r,e){var t=e.value,i=e.state===Fs,o=i?r.ok:r.fail,a=r.resolve,u=r.reject,f=r.domain,d,c,p;try{o?(i||(e.rejection===Bs&&mh(e),e.rejection=li),o===!0?d=t:(f&&f.enter(),d=o(t),f&&(f.exit(),p=!0)),d===r.promise?u(new js("Promise-chain cycle")):(c=Us(d))?me(c,d,a,u):a(d)):u(t)}catch(h){f&&!p&&f.exit(),u(h)}},Gs=function(r,e){r.notified||(r.notified=!0,si(function(){for(var t=r.reactions,i;i=t.get();)Vs(i,r);r.notified=!1,e&&!r.rejection&&gh(r)}))},Ks=function(r,e,t){var i,o;dh?(i=oi.createEvent("Event"),i.promise=e,i.reason=t,i.initEvent(r,!1,!0),H.dispatchEvent(i)):i={promise:e,reason:t},!uh&&(o=H["on"+r])?o(i):r===Ms&&nh("Unhandled promise rejection",t)},gh=function(r){me(Ls,H,function(){var e=r.facade,t=r.value,i=Ns(r),o;if(i&&(o=ah(function(){Er?ci.emit("unhandledRejection",t,e):Ks(Ms,e,t)}),r.rejection=Er||Ns(r)?Bs:li,o.error))throw o.value})},Ns=function(r){return r.rejection!==li&&!r.parent},mh=function(r){me(Ls,H,function(){var e=r.facade;Er?ci.emit("rejectionHandled",e):Ks(ph,e,r.value)})},he=function(r,e,t){return function(i){r(e,i,t)}},ge=function(r,e,t){r.done||(r.done=!0,t&&(r=t),r.value=e,r.state=vh,Gs(r,!0))},ai=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw new js("Promise can't be resolved itself");var i=Us(e);i?si(function(){var o={done:!1};try{me(i,e,he(ai,o,r),he(ge,o,r))}catch(a){ge(o,a,r)}}):(r.value=e,r.state=Fs,Gs(r,!1))}catch(o){ge({done:!1},o,r)}}};if($s&&(ee=function(e){ih(this,yr),rh(e),me(Ir,this);var t=ii(this);try{e(he(ai,t),he(ge,t))}catch(i){ge(t,i)}},yr=ee.prototype,Ir=function(e){lh(this,{type:Pr,done:!1,notified:!1,parent:!1,reactions:new sh,rejection:!1,state:Rs,value:void 0})},Ir.prototype=ws(yr,"then",function(e,t){var i=ii(this),o=ni(oh(this,ee));return i.parent=!0,o.ok=Sr(e)?e:!0,o.fail=Sr(t)&&t,o.domain=Er?ci.domain:void 0,i.state===Rs?i.reactions.add(o):si(function(){Vs(o,i)}),o.promise}),Cs=function(){var r=new Ir,e=ii(r);this.promise=r,this.resolve=he(ai,e),this.reject=he(ge,e)},Ds.f=ni=function(r){return r===ee||r===hh?new Cs(r):fh(r)},!Xv&&Sr(qr)&&ve!==Object.prototype)){As=ve.then,ch||ws(ve,"then",function(e,t){var i=this;return new ee(function(o,a){me(As,i,o,a)}).then(e,t)},{unsafe:!0});try{delete ve.constructor}catch(r){}xs&&xs(ve,yr)}Jv({global:!0,constructor:!0,wrap:!0,forced:$s},{Promise:ee});Zv(ee,Pr,!1,!0);eh(Pr)});var re=n((DI,Hs)=>{"use strict";Hs.exports={}});var Qs=n(($I,zs)=>{"use strict";var bh=w(),yh=re(),Ih=bh("iterator"),Sh=Array.prototype;zs.exports=function(r){return r!==void 0&&(yh.Array===r||Sh[Ih]===r)}});var fi=n((jI,Js)=>{"use strict";var Eh=Ne(),Ys=Xe(),qh=Pe(),Ph=re(),Th=w(),Oh=Th("iterator");Js.exports=function(r){if(!qh(r))return Ys(r,Oh)||Ys(r,"@@iterator")||Ph[Eh(r)]}});var Zs=n((MI,Xs)=>{"use strict";var _h=N(),wh=U(),xh=V(),Rh=Oe(),Ch=fi(),Ah=TypeError;Xs.exports=function(r,e){var t=arguments.length<2?Ch(r):e;if(wh(t))return xh(_h(t,r));throw new Ah(Rh(r)+" is not iterable")}});var tu=n((FI,ru)=>{"use strict";var Nh=N(),eu=V(),Lh=Xe();ru.exports=function(r,e,t){var i,o;eu(r);try{if(i=Lh(r,"return"),!i){if(e==="throw")throw t;return t}i=Nh(i,r)}catch(a){o=!0,i=a}if(e==="throw")throw t;if(o)throw i;return eu(i),t}});var Or=n((BI,au)=>{"use strict";var kh=xe(),Dh=N(),$h=V(),jh=Oe(),Mh=Qs(),Fh=Et(),iu=Ye(),Bh=Zs(),Uh=fi(),ou=tu(),Vh=TypeError,Tr=function(r,e){this.stopped=r,this.result=e},nu=Tr.prototype;au.exports=function(r,e,t){var i=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),u=!!(t&&t.IS_ITERATOR),f=!!(t&&t.INTERRUPTED),d=kh(e,i),c,p,h,s,l,m,b,S=function(E){return c&&ou(c,"normal",E),new Tr(!0,E)},y=function(E){return o?($h(E),f?d(E[0],E[1],S):d(E[0],E[1])):f?d(E,S):d(E)};if(a)c=r.iterator;else if(u)c=r;else{if(p=Uh(r),!p)throw new Vh(jh(r)+" is not iterable");if(Mh(p)){for(h=0,s=Fh(r);s>h;h++)if(l=y(r[h]),l&&iu(nu,l))return l;return new Tr(!1)}c=Bh(r,p)}for(m=a?r.next:c.next;!(b=Dh(m,c)).done;){try{l=y(b.value)}catch(E){ou(c,"throw",E)}if(typeof l=="object"&&l&&iu(nu,l))return l}return new Tr(!1)}});var fu=n((UI,lu)=>{"use strict";var Gh=w(),uu=Gh("iterator"),cu=!1;try{su=0,di={next:function(){return{done:!!su++}},return:function(){cu=!0}},di[uu]=function(){return this},Array.from(di,function(){throw 2})}catch(r){}var su,di;lu.exports=function(r,e){try{if(!e&&!cu)return!1}catch(o){return!1}var t=!1;try{var i={};i[uu]=function(){return{next:function(){return{done:t=!0}}}},r(i)}catch(o){}return t}});var pi=n((VI,du)=>{"use strict";var Kh=Z(),Wh=fu(),Hh=de().CONSTRUCTOR;du.exports=Hh||!Wh(function(r){Kh.all(r).then(void 0,function(){})})});var pu=n(()=>{"use strict";var zh=x(),Qh=N(),Yh=U(),Jh=pe(),Xh=vr(),Zh=Or(),eg=pi();zh({target:"Promise",stat:!0,forced:eg},{all:function(e){var t=this,i=Jh.f(t),o=i.resolve,a=i.reject,u=Xh(function(){var f=Yh(t.resolve),d=[],c=0,p=1;Zh(e,function(h){var s=c++,l=!1;p++,Qh(f,t,h).then(function(m){l||(l=!0,d[s]=m,--p||o(d))},a)}),--p||o(d)});return u.error&&a(u.value),i.promise}})});var hu=n(()=>{"use strict";var rg=x(),tg=j(),ig=de().CONSTRUCTOR,hi=Z(),og=B(),ng=P(),ag=ce(),vu=hi&&hi.prototype;rg({target:"Promise",proto:!0,forced:ig,real:!0},{catch:function(r){return this.then(void 0,r)}});!tg&&ng(hi)&&(vi=og("Promise").prototype.catch,vu.catch!==vi&&ag(vu,"catch",vi,{unsafe:!0}));var vi});var gu=n(()=>{"use strict";var sg=x(),ug=N(),cg=U(),lg=pe(),fg=vr(),dg=Or(),pg=pi();sg({target:"Promise",stat:!0,forced:pg},{race:function(e){var t=this,i=lg.f(t),o=i.reject,a=fg(function(){var u=cg(t.resolve);dg(e,function(f){ug(u,t,f).then(i.resolve,o)})});return a.error&&o(a.value),i.promise}})});var mu=n(()=>{"use strict";var vg=x(),hg=pe(),gg=de().CONSTRUCTOR;vg({target:"Promise",stat:!0,forced:gg},{reject:function(e){var t=hg.f(this),i=t.reject;return i(e),t.promise}})});var gi=n((XI,bu)=>{"use strict";var mg=V(),bg=L(),yg=pe();bu.exports=function(r,e){if(mg(r),bg(e)&&e.constructor===r)return e;var t=yg.f(r),i=t.resolve;return i(e),t.promise}});var Su=n(()=>{"use strict";var Ig=x(),Sg=B(),yu=j(),Eg=Z(),Iu=de().CONSTRUCTOR,qg=gi(),Pg=Sg("Promise"),Tg=yu&&!Iu;Ig({target:"Promise",stat:!0,forced:yu||Iu},{resolve:function(e){return qg(Tg&&this===Pg?Eg:this,e)}})});var Eu=n(()=>{"use strict";Ws();pu();hu();gu();mu();Su()});var Ou=n(()=>{"use strict";var Og=x(),_g=j(),_r=Z(),wg=T(),Pu=B(),Tu=P(),xg=Nt(),qu=gi(),Rg=ce(),bi=_r&&_r.prototype,Cg=!!_r&&wg(function(){bi.finally.call({then:function(){}},function(){})});Og({target:"Promise",proto:!0,real:!0,forced:Cg},{finally:function(r){var e=xg(this,Pu("Promise")),t=Tu(r);return this.then(t?function(i){return qu(e,r()).then(function(){return i})}:r,t?function(i){return qu(e,r()).then(function(){throw i})}:r)}});!_g&&Tu(_r)&&(mi=Pu("Promise").prototype.finally,bi.finally!==mi&&Rg(bi,"finally",mi,{unsafe:!0}));var mi});var wu=n((nS,_u)=>{"use strict";Yn();Eu();Ou();var Ag=tr();_u.exports=Ag("Promise","finally")});var Ru=n((aS,xu)=>{"use strict";var Ng=wu();xu.exports=Ng});var Au=n((sS,Cu)=>{"use strict";var Lg=Ru();Cu.exports=Lg});var Lu=n((uS,Nu)=>{"use strict";var kg=T();Nu.exports=!kg(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var wr=n((cS,Du)=>{"use strict";var Dg=M(),$g=P(),jg=ct(),Mg=hr(),Fg=Lu(),ku=Mg("IE_PROTO"),yi=Object,Bg=yi.prototype;Du.exports=Fg?yi.getPrototypeOf:function(r){var e=jg(r);if(Dg(e,ku))return e[ku];var t=e.constructor;return $g(t)&&e instanceof t?t.prototype:e instanceof yi?Bg:null}});var Mu=n((lS,ju)=>{"use strict";var Ug=O(),Ii=M(),Vg=z(),Gg=qt().indexOf,Kg=gr(),$u=Ug([].push);ju.exports=function(r,e){var t=Vg(r),i=0,o=[],a;for(a in t)!Ii(Kg,a)&&Ii(t,a)&&$u(o,a);for(;e.length>i;)Ii(t,a=e[i++])&&(~Gg(o,a)||$u(o,a));return o}});var Si=n((fS,Fu)=>{"use strict";Fu.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Ei=n((dS,Bu)=>{"use strict";var Wg=Mu(),Hg=Si();Bu.exports=Object.keys||function(e){return Wg(e,Hg)}});var Hu=n((pS,Wu)=>{"use strict";var Vu=_(),zg=T(),Gu=O(),Qg=wr(),Yg=Ei(),Jg=z(),Xg=Yr().f,Ku=Gu(Xg),Zg=Gu([].push),em=Vu&&zg(function(){var r=Object.create(null);return r[2]=2,!Ku(r,2)}),Uu=function(r){return function(e){for(var t=Jg(e),i=Yg(t),o=em&&Qg(t)===null,a=i.length,u=0,f=[],d;a>u;)d=i[u++],(!Vu||(o?d in t:Ku(t,d)))&&Zg(f,r?[d,t[d]]:t[d]);return f}};Wu.exports={entries:Uu(!0),values:Uu(!1)}});var zu=n(()=>{"use strict";var rm=x(),tm=Hu().entries;rm({target:"Object",stat:!0},{entries:function(e){return tm(e)}})});var Yu=n((gS,Qu)=>{"use strict";zu();var im=Te();Qu.exports=im.Object.entries});var Xu=n((mS,Ju)=>{"use strict";var om=Yu();Ju.exports=om});var xr=n((bS,Zu)=>{"use strict";var nm=Xu();Zu.exports=nm});var tc=n((yS,rc)=>{"use strict";var qi=_(),am=M(),ec=Function.prototype,sm=qi&&Object.getOwnPropertyDescriptor,Pi=am(ec,"name"),um=Pi&&function(){}.name==="something",cm=Pi&&(!qi||qi&&sm(ec,"name").configurable);rc.exports={EXISTS:Pi,PROPER:um,CONFIGURABLE:cm}});var oc=n(ic=>{"use strict";var lm=_(),fm=gt(),dm=Y(),pm=V(),vm=z(),hm=Ei();ic.f=lm&&!fm?Object.defineProperties:function(e,t){pm(e);for(var i=vm(t),o=hm(t),a=o.length,u=0,f;a>u;)dm.f(e,f=o[u++],i[f]);return e}});var wi=n((SS,fc)=>{"use strict";var gm=V(),mm=oc(),nc=Si(),bm=gr(),ym=Lt(),Im=Ze(),Sm=hr(),ac=">",sc="<",Oi="prototype",_i="script",cc=Sm("IE_PROTO"),Ti=function(){},lc=function(r){return sc+_i+ac+r+sc+"/"+_i+ac},uc=function(r){r.write(lc("")),r.close();var e=r.parentWindow.Object;return r=null,e},Em=function(){var r=Im("iframe"),e="java"+_i+":",t;return r.style.display="none",ym.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(lc("document.F=Object")),t.close(),t.F},Rr,Cr=function(){try{Rr=new ActiveXObject("htmlfile")}catch(e){}Cr=typeof document!="undefined"?document.domain&&Rr?uc(Rr):Em():uc(Rr);for(var r=nc.length;r--;)delete Cr[Oi][nc[r]];return Cr()};bm[cc]=!0;fc.exports=Object.create||function(e,t){var i;return e!==null?(Ti[Oi]=gm(e),i=new Ti,Ti[Oi]=null,i[cc]=e):i=Cr(),t===void 0?i:mm.f(i,t)}});var Ai=n((ES,vc)=>{"use strict";var qm=T(),Pm=P(),Tm=L(),Om=wi(),dc=wr(),_m=ce(),wm=w(),xm=j(),Ci=wm("iterator"),pc=!1,G,xi,Ri;[].keys&&(Ri=[].keys(),"next"in Ri?(xi=dc(dc(Ri)),xi!==Object.prototype&&(G=xi)):pc=!0);var Rm=!Tm(G)||qm(function(){var r={};return G[Ci].call(r)!==r});Rm?G={}:xm&&(G=Om(G));Pm(G[Ci])||_m(G,Ci,function(){return this});vc.exports={IteratorPrototype:G,BUGGY_SAFARI_ITERATORS:pc}});var gc=n((qS,hc)=>{"use strict";var Cm=Ai().IteratorPrototype,Am=wi(),Nm=qe(),Lm=Le(),km=re(),Dm=function(){return this};hc.exports=function(r,e,t,i){var o=e+" Iterator";return r.prototype=Am(Cm,{next:Nm(+!i,t)}),Lm(r,o,!1,!0),km[o]=Dm,r}});var _c=n((PS,Oc)=>{"use strict";var $m=x(),jm=N(),Ar=j(),Pc=tc(),Mm=P(),Fm=gc(),mc=wr(),bc=xt(),Bm=Le(),Um=ne(),Ni=ce(),Vm=w(),yc=re(),Tc=Ai(),Gm=Pc.PROPER,Km=Pc.CONFIGURABLE,Ic=Tc.IteratorPrototype,Nr=Tc.BUGGY_SAFARI_ITERATORS,Ue=Vm("iterator"),Sc="keys",Ve="values",Ec="entries",qc=function(){return this};Oc.exports=function(r,e,t,i,o,a,u){Fm(t,e,i);var f=function(y){if(y===o&&s)return s;if(!Nr&&y&&y in p)return p[y];switch(y){case Sc:return function(){return new t(this,y)};case Ve:return function(){return new t(this,y)};case Ec:return function(){return new t(this,y)}}return function(){return new t(this)}},d=e+" Iterator",c=!1,p=r.prototype,h=p[Ue]||p["@@iterator"]||o&&p[o],s=!Nr&&h||f(o),l=e==="Array"&&p.entries||h,m,b,S;if(l&&(m=mc(l.call(new r)),m!==Object.prototype&&m.next&&(!Ar&&mc(m)!==Ic&&(bc?bc(m,Ic):Mm(m[Ue])||Ni(m,Ue,qc)),Bm(m,d,!0,!0),Ar&&(yc[d]=qc))),Gm&&o===Ve&&h&&h.name!==Ve&&(!Ar&&Km?Um(p,"name",Ve):(c=!0,s=function(){return jm(h,this)})),o)if(b={values:f(Ve),keys:a?s:f(Sc),entries:f(Ec)},u)for(S in b)(Nr||c||!(S in p))&&Ni(p,S,b[S]);else $m({target:e,proto:!0,forced:Nr||c},b);return(!Ar||u)&&p[Ue]!==s&&Ni(p,Ue,s,{name:o}),yc[e]=s,b}});var xc=n((TS,wc)=>{"use strict";wc.exports=function(r,e){return{value:r,done:e}}});var ki=n((OS,Lc)=>{"use strict";var Wm=z(),Li=Pt(),Rc=re(),Ac=ei(),Hm=Y().f,zm=_c(),Lr=xc(),Qm=j(),Ym=_(),Nc="Array Iterator",Jm=Ac.set,Xm=Ac.getterFor(Nc);Lc.exports=zm(Array,"Array",function(r,e){Jm(this,{type:Nc,target:Wm(r),index:0,kind:e})},function(){var r=Xm(this),e=r.target,t=r.index++;if(!e||t>=e.length)return r.target=void 0,Lr(void 0,!0);switch(r.kind){case"keys":return Lr(t,!1);case"values":return Lr(e[t],!1)}return Lr([t,e[t]],!1)},"values");var Cc=Rc.Arguments=Rc.Array;Li("keys");Li("values");Li("entries");if(!Qm&&Ym&&Cc.name!=="values")try{Hm(Cc,"name",{value:"values"})}catch(r){}});var Dc=n((_S,kc)=>{"use strict";var Zm=_(),eb=Y(),rb=qe();kc.exports=function(r,e,t){Zm?eb.f(r,e,rb(0,t)):r[e]=t}});var $c=n(()=>{"use strict";var tb=x(),ib=Or(),ob=Dc();tb({target:"Object",stat:!0},{fromEntries:function(e){var t={};return ib(e,function(i,o){ob(t,i,o)},{AS_ENTRIES:!0}),t}})});var Mc=n((RS,jc)=>{"use strict";ki();$c();var nb=Te();jc.exports=nb.Object.fromEntries});var Bc=n((CS,Fc)=>{"use strict";Fc.exports={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}});var Vc=n(()=>{"use strict";ki();var ab=Bc(),sb=q(),ub=Le(),Uc=re();for(kr in ab)ub(sb[kr],kr),Uc[kr]=Uc.Array;var kr});var Kc=n((LS,Gc)=>{"use strict";var cb=Mc();Vc();Gc.exports=cb});var Hc=n((kS,Wc)=>{"use strict";var lb=Kc();Wc.exports=lb});var Bi=n((IE,nl)=>{"use strict";var db=Ne(),pb=String;nl.exports=function(r){if(db(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return pb(r)}});var sl=n((SE,al)=>{"use strict";var vb=rr(),hb=Bi(),gb=ie(),mb=RangeError;al.exports=function(e){var t=hb(gb(this)),i="",o=vb(e);if(o<0||o===1/0)throw new mb("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))o&1&&(i+=t);return i}});var dl=n((EE,fl)=>{"use strict";var ll=O(),bb=St(),ul=Bi(),yb=sl(),Ib=ie(),Sb=ll(yb),Eb=ll("".slice),qb=Math.ceil,cl=function(r){return function(e,t,i){var o=ul(Ib(e)),a=bb(t),u=o.length,f=i===void 0?" ":ul(i),d,c;return a<=u||f===""?o:(d=a-u,c=Sb(f,qb(d/f.length)),c.length>d&&(c=Eb(c,0,d)),r?o+c:c+o)}};fl.exports={start:cl(!1),end:cl(!0)}});var vl=n((qE,pl)=>{"use strict";var Pb=Q();pl.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(Pb)});var hl=n(()=>{"use strict";var Tb=x(),Ob=dl().start,_b=vl();Tb({target:"String",proto:!0,forced:_b},{padStart:function(e){return Ob(this,e,arguments.length>1?arguments[1]:void 0)}})});var ml=n((OE,gl)=>{"use strict";hl();var wb=tr();gl.exports=wb("String","padStart")});var yl=n((_E,bl)=>{"use strict";var xb=ml();bl.exports=xb});var Sl=n((wE,Il)=>{"use strict";var Rb=yl();Il.exports=Rb});var Cb={};Nl(Cb,{ApiEnv:()=>ue,ConnectionType:()=>ar,ContentType:()=>nr,InteractiveInterfaceClick:()=>Tt,OneStat:()=>Vr,Quality:()=>or,SeekAction:()=>sr,VERSION:()=>Ce});module.exports=Ll(Cb);var Ki=F(ir(),1);var ue=(u=>(u.PROD="prod",u.VK_ALIAS="vk_alias",u.VIDEOTEST="videotest",u.TEST="test",u.OKCDN="okcdn",u.AUTO="auto",u))(ue||{}),or=(c=>(c.Q144P="mobile",c.Q240P="lowest",c.Q360P="low",c.Q480P="medium",c.Q720P="high",c.Q1080P="fullhd",c.Q1440P="quadhd",c.Q2160P="ultrahd",c.UNKNOWN="unknown",c))(or||{}),nr=(l=>(l.MP4="mp4",l.DASH="dash",l.DASH_SEP="dash_sep",l.ONDEMAND_DASH="ondemand_dash",l.HLS="hls",l.ONDEMAND_HLS="ondemand_hls",l.WEBM="webm",l.AV1="av1",l.ONDEMAND_DASH_LIVE="ondemand_dash_live",l.ONDEMAND_HLS_LIVE="ondemand_hls_live",l.WEBRTC="webrtc",l.UNKNOWN="unknown",l.RTMP="rtmp",l))(nr||{});var ar=(i=>(i.HTTP1="http1",i.HTTP2="http2",i.HTTP3="http3",i))(ar||{});var sr=(f=>(f.SLIDER="slider",f.DOUBLE_TAP="double_tap",f.TIME_CODE="time_code",f.EPISODE="episode",f.REWIND="rewind",f.LIVE="live",f.UNKNOWN="unknown",f))(sr||{}),Tt=(a=>(a.GRAPH_SHOW="iGraphShow",a.GRAPH_HIDE="iGraphHide",a.NEXT_AREA="iNextChapterArea",a.NEXT_BUTTON="iNextChapterBtn",a.WATCH_AGAIN="iWatchAgainBtn",a))(Tt||{}),Vn={action_play:"ap",action_play_interactive:"api",first_bytes:"fb",player_ready:"pr",first_frame:"ff",seek:"sk",watch_coverage_record:"wr",watch_coverage_live:"wl",empty_buffer:"eb",action_stop:"as",close_at_empty_buffer:"cb",content_error:"er",player_interface_click:"pc",next_movie:"nm",track_switch:"ts",failover:"fo",quality:"qt"},Gn={vsid:"si",isid:"is",vid:"vi",place:"pl",quality:"qt",cdn_host:"ch",stat_type:"st",param:"pm",vk_app_id:"va",track_code:"tc",connection_type:"cnt",connection_reused:"cr",cached_data:"cd",live:"lv",muted:"mu",mode:"mo",subtitles:"sb",failover:"fo",download_speed:"ds",manual_quality:"mq",ref_domain:"rd",direct_url:"du"},Kn={unknown:"un",mobile:"m",lowest:"ls",low:"l",medium:"md",high:"h",fullhd:"f",quadhd:"q",ultrahd:"u"},Wn={pip:"pi",fullscreen:"fs",external:"ex",prefetch:"pr",airplay:"ap",chromecast:"cc",invisible:"iv"};var zn=require("@vkontakte/videoplayer-shared/es2018");var Ce="1.0.75-dev.5de63ea3.0",Hn="CIOPGQJGDIHBABABA",Ot={prod:"https://api.ok.ru",vk_alias:"https://api.mycdn.me",videotest:"https://videotestapi.ok.ru/api",test:"https://apitest.ok.ru",okcdn:"https://api.okcdn.ru",auto:""};var ip={apiEnv:"vk_alias",apiKey:Hn,requestRetryCount:1,firstFlushTime:5e3,flushDebounceTime:1e4,flushMaxWait:6e4,storageExpiration:36*60*60*1e3,watchCoverageInterval:15e3,disabledOperations:["quality"],disabledCustomFields:[],shorten:!0,maxLoops:100,embedUrlParams:[],useBeacon:!0,synchronizeTime:!0,debugLog:!1,clearStorageAtUnload:!0,alwaysSendDesktop:!1,backoff:{start:1e3,factor:1.5,max:5*60*1e3,random:.1}},Qn=r=>(0,zn.fillWithDefault)(r,ip);function _t(){let r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=new Array(36),t=0,i,o;for(o=0;o<36;o++)o===8||o===13||o===18||o===23?e[o]="-":o===14?e[o]="4":(t<=2&&(t=33554432+Math.random()*16777216|0),i=t&15,t=t>>4,e[o]=r[o===19?i&3|8:i]);return e.join("")}var v=require("@vkontakte/videoplayer-shared/es2018"),Gr=require("@vkontakte/videoplayer-shared/es2018");var Dr=F(Au(),1);var zc=F(xr(),1),Qc=F(Hc(),1);var Yc=r=>{var o;let{operation:e,custom:t}=r,i=(0,Qc.default)((0,zc.default)(t).map(([a,u])=>{var c,p,h;let f=(c=Gn[a])!=null?c:a,d=u;return u&&(a==="mode"?d=(p=Wn[u])!=null?p:u:a==="quality"&&(d=(h=Kn[u])!=null?h:u)),[f,d]}));return{...r,operation:(o=Vn[e])!=null?o:e,custom:i}};var $=require("@vkontakte/videoplayer-shared/es2018");var Ge=class{constructor(e){this.consequentAuthErrors=0;this.authorized$=new $.ValueSubject(!1);this.params=e}async authorize(e){return this.authToken=e!=null?e:await this.refreshAuthToken(),this._authorizeWithBackoff()}logBeacon(e){let t="log.externalLog",i=this.createLogParams(e),o=this.sessionKey;if(!o)return;this.params.apiTransport.sendBeacon(t,i,o)||this.logRequest(e).catch(()=>{})}async logRequest(e){var u;let t="log.externalLog",i=this.createLogParams(e),o=(u=this.sessionKey)!=null?u:await this._authorizeWithBackoff();if(!o)return;let a=async(f,d=this.params.config.requestRetryCount)=>{try{return await this.params.apiTransport.sendRequest(t,i,o)}catch(c){if(!c||!("error_code"in c)){this.params.error$.next({id:"logRequestUnknown",category:$.ErrorCategory.NETWORK,message:`Unknown ${t} error`,thrown:c});return}let p=c==null?void 0:c.error_code;switch(p){case 102:case 103:case 104:return this.authorized$.next(!1),this.sessionKey=await this._authorizeWithBackoff(),d>0?a(f,d-1):void 0;case 401:return this.authorized$.next(!1),this.authToken=await this.refreshAuthToken(),this.sessionKey=await this._authorizeWithBackoff(),d>0?a(f,d-1):void 0;default:{this.params.error$.next({id:`LogRequest#${p}`,category:$.ErrorCategory.EXTERNAL_API,message:`${t} error`,data:c});return}}}};return a(e)}destroy(){window.clearTimeout(this.backoffTimeoutId),this.backoffTimeoutId=0}async refreshAuthToken(){if(this.params.refreshAuthToken)return this.refreshAuthTokenPromise||(this.refreshAuthTokenPromise=(0,Dr.default)(this.params.refreshAuthToken(),()=>{this.refreshAuthTokenPromise=void 0})),this.refreshAuthTokenPromise}createLogParams(e){let t=this.params.config.alwaysSendDesktop||!this.params.mobile?"WEB":"M_WEB";return{collector:"ok.mobile.apps.video",data:JSON.stringify({application:`@vkontakte/videoplayer-statistics:${Ce}`,platform:t,items:this.params.config.shorten?e.map(Yc):e})}}_authorizeWithBackoff(){if(!this.consequentAuthErrors)return this._authorize();let e=(0,$.getExponentialDelay)(this.consequentAuthErrors,this.params.config.backoff);return new Promise(t=>{this.backoffTimeoutId||(this.backoffTimeoutId=window.setTimeout(()=>{(0,Dr.default)(this._authorize().then(t).catch(i=>this.params.error$.next({id:"AuthorizeBackoff",category:$.ErrorCategory.NETWORK,message:"Otherwise unhandled error in authorization",thrown:i})),()=>this.backoffTimeoutId=0)},e))})}async _authorize(){if(this.authorizePromise)return this.authorizePromise;this.sessionKey=void 0,this.authorized$.next(!1);let e="auth.anonymLogin",t={session_data:{version:2,device_id:this.params.deviceId,client_version:Ce.split("-")[0],client_type:"SDK_JS"}};return this.authToken!==void 0&&(t.session_data.auth_token=this.authToken,t.session_data.version=3),this.authorizePromise=(0,Dr.default)(this.params.apiTransport.sendRequest(e,t).then(i=>{var o;return(!i||!i.session_key)&&this.params.error$.next({id:"AuthorizeFailed",category:$.ErrorCategory.EXTERNAL_API,message:"No session key",data:i}),this.sessionKey=(o=i==null?void 0:i.session_key)!=null?o:void 0,this.sessionKey}).catch(async i=>{this.sessionKey=void 0;let o=i==null?void 0:i.error_code;switch(o){case 401:return this.authToken=await this.refreshAuthToken(),this._authorizeWithBackoff()}o?this.params.error$.next({id:`Authorize#${o}`,category:$.ErrorCategory.EXTERNAL_API,message:"authorize error",data:i}):this.params.error$.next({id:"AuthorizeUnknown",category:$.ErrorCategory.NETWORK,message:"authorize error",thrown:i})}),()=>{this.authorizePromise=void 0,this.consequentAuthErrors=this.sessionKey?0:this.consequentAuthErrors+1,this.authorized$.next(this.sessionKey!==void 0)}),this.authorizePromise}};var $r=class{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,i){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:i})}removeEventListener(e,t){if(!(e in this.listeners))return;let i=this.listeners[e];for(let o=0,a=i.length;o<a;o++)if(i[o].callback===t){i.splice(o,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let i=this.listeners[e.type].slice();for(let o=0,a=i.length;o<a;o++){let u=i[o];try{u.callback.call(this,e)}catch(f){Promise.resolve().then(()=>{throw f})}u.options&&u.options.once&&this.removeEventListener(e.type,u.callback)}return!e.defaultPrevented}},be=class extends $r{constructor(){super(),this.listeners||$r.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,e)),super.dispatchEvent(e)}},Ke=class{constructor(){Object.defineProperty(this,"signal",{value:new be,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let i=e;if(i===void 0)if(typeof document=="undefined")i=new Error("This operation was aborted"),i.name="AbortError";else try{i=new DOMException("signal is aborted without reason")}catch(o){i=new Error("This operation was aborted"),i.name="AbortError"}this.signal.reason=i,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}};typeof Symbol!="undefined"&&Symbol.toStringTag&&(Ke.prototype[Symbol.toStringTag]="AbortController",be.prototype[Symbol.toStringTag]="AbortSignal");function jr(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function Di(r){typeof r=="function"&&(r={fetch:r});let{fetch:e,Request:t=e.Request,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=r;if(!jr({fetch:e,Request:t,AbortController:i,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:e,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,p){let h;p&&p.signal&&(h=p.signal,delete p.signal);let s=new t(c,p);return h&&Object.defineProperty(s,"signal",{writable:!1,enumerable:!1,configurable:!0,value:h}),s},a.prototype=t.prototype);let u=e;return{fetch:(d,c)=>{let p=a&&a.prototype.isPrototypeOf(d)?d.signal:c?c.signal:void 0;if(p){let h;try{h=new DOMException("Aborted","AbortError")}catch(l){h=new Error("Aborted"),h.name="AbortError"}if(p.aborted)return Promise.reject(h);let s=new Promise((l,m)=>{p.addEventListener("abort",()=>m(h),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([s,u(d,c)])}return u(d,c)},Request:a}}var We=jr({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),Jc=We?Di({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,$i=We?Jc.fetch:window.fetch,ZS=We?Jc.Request:window.Request,eE=We?Ke:window.AbortController,rE=We?be:window.AbortSignal;var Xc=F(ir(),1),Zc=F(xr(),1),K=require("@vkontakte/videoplayer-shared/es2018");var He=class{constructor(e){this.params=e,this.apiKey=e.config.apiKey,this.apiEnv=e.config.apiEnv,this.apiBaseUrl=Ot[this.apiEnv],this.timeSynchronisation=e.timeSynchronisation,this.isApiBaseUrlFetched=!1}async resolveApiBaseUrl(){var e;if(this.apiEnv!=="auto"||this.isApiBaseUrlFetched)return this.apiBaseUrl;try{let t=atob("aHR0cHM6Ly9kbnMuZ29vZ2xlL3Jlc29sdmU/bmFtZT12aWRlby5fZW5kcG9pbnQub2sucnUmdHlwZT1UWFQ="),o=await(await $i(t,{method:"GET",mode:"cors",cache:"no-cache"})).json(),a=(e=o==null?void 0:o.Answer[0])==null?void 0:e.data;if(!a)throw new Error("Wrong DNS response");return a}catch(t){return this.params.error$.next({id:"OneStat:ApiTransport:resolveApiBaseUrl",category:K.ErrorCategory.NETWORK,message:"Unhandled resolve api base url error",thrown:t}),Ot.vk_alias}finally{this.isApiBaseUrlFetched=!0}}sendBeacon(e,t,i){if(!window.Blob||!window.navigator.sendBeacon)return!1;let o=this._prepareQueryParams({method:e,queryParams:t,sessionKey:i}),a=new window.Blob([o.toString()],{type:"application/x-www-form-urlencoded"});try{return window.navigator.sendBeacon(`${this.apiBaseUrl}/fb.do`,a)}catch(u){this.params.error$.next({id:"OneStat:ApiTransport:sendBeacon",category:K.ErrorCategory.NETWORK,message:"Unhandled beacon error",thrown:u,data:{method:e,params:t}})}return!1}async sendRequest(e,t,i){let o=(0,K.now)(),a=u=>{if(u instanceof TypeError&&(0,Xc.default)(["Failed to fetch","NetworkError when attempting to fetch resource."],u.message)){this.params.error$.next({id:"Network",category:K.ErrorCategory.NETWORK,message:"Request failed",thrown:u});return}this.params.error$.next({id:"OneStat:ApiTransport:sendRequest",category:K.ErrorCategory.NETWORK,message:"Unhandled request error",thrown:u,data:{method:e,params:t,sessionKey:i,time:(0,K.now)()-o}})};return this.apiBaseUrl=await this.resolveApiBaseUrl(),$i(`${this.apiBaseUrl}/fb.do`,{method:"post",headers:{"Content-type":"application/x-www-form-urlencoded"},body:this._prepareQueryParams({method:e,queryParams:t,sessionKey:i})}).then(u=>{var p,h;let f=Number(u.headers.get("content-length"))===0,d=new Date((p=u.headers.get("date"))!=null?p:"").getTime(),c=(0,K.now)()-o;if(isFinite(d)&&((h=this.timeSynchronisation)==null||h.addServerTime(d,c)),!f)return u.json().then(s=>Object.prototype.hasOwnProperty.call(s,"error_msg")?Promise.reject(s):s,a)},a)}_prepareQueryParams(e){let t=new URLSearchParams({format:"JSON",method:e.method,application_key:this.apiKey});return e.sessionKey!==void 0&&t.append("session_key",e.sessionKey),(0,Zc.default)(e.queryParams).forEach(([i,o])=>t.append(i,typeof o=="string"?o:JSON.stringify(o))),t}};var el=F(ir(),1),rl=F(xr(),1),C=require("@vkontakte/videoplayer-shared/es2018"),Mr="onestat_events",ji=r=>e=>e.timestamp+r>=(0,C.now)(),Fr=class{constructor(e){this.unsaltedStorage=[];this.isPaused=!1;this.isUrgent=e=>{let{operation:t}=e;return(0,el.default)(["action_play","watch_coverage_record","watch_coverage_live"],t)};this.params=e,this.api=e.api,this.error$=e.error$,this.userSalt=e.userSalt,this.loggerDebugLog=e.debugLogger.createComponentLog("stat logger"),this.firstFlush=(0,C.debounceFn)(()=>this.safeFlush(),this.params.config.firstFlushTime,{maxWait:this.params.config.firstFlushTime});let t=C.safeStorage.isPersistent()?this.params.config.flushMaxWait:0;this.debouncedFlush=(0,C.debounceFn)(()=>this.safeFlush(),this.params.config.flushDebounceTime,{maxWait:t}),this.subscription=this.api.authorized$.subscribe(i=>{i&&this.debouncedFlush()}),this.housekeepStorage()}safeFlush(){var e;try{this.flush()}catch(t){this.error$.next({id:"LoggerError",category:C.ErrorCategory.WTF,message:(e=String(t))!=null?e:"Unknown logger error",thrown:t})}}readFromStorage(){let e=C.safeStorage.get(Mr);try{return e?JSON.parse(e):{}}catch(t){}return{}}addToStorage(e){var a;if(!this.userSalt){this.unsaltedStorage.push(e);return}let t=this.readFromStorage(),o=((a=t[this.userSalt])!=null?a:[]).filter(ji(this.params.config.storageExpiration));C.safeStorage.set(Mr,JSON.stringify({...t,[this.userSalt]:[...o,e]}))}getFromStorage(){var i;return this.userSalt?((i=this.readFromStorage()[this.userSalt])!=null?i:[]).filter(ji(this.params.config.storageExpiration)):this.unsaltedStorage}markStorageSent(){if(!this.userSalt){this.unsaltedStorage=[];return}let e=this.readFromStorage();delete e[this.userSalt],C.safeStorage.set(Mr,JSON.stringify(e))}housekeepStorage(){let e=this.readFromStorage();for(let[t,i]of(0,rl.default)(e)){let o=i.filter(ji(this.params.config.storageExpiration));o.length?e[t]=o:delete e[t],this.loggerDebugLog({message:`${i.length} retrieved from storage, ${o.length} of them actual`})}C.safeStorage.set(Mr,JSON.stringify(e))}log(e){this.addToStorage(e),!this.isPaused&&(this.isUrgent(e)?this.flush():this.lastVsid!==e.custom.vsid?this.firstFlush():this.debouncedFlush(),this.lastVsid=e.custom.vsid)}flush({wantBeacon:e,clearStorage:t}={wantBeacon:!1,clearStorage:!0}){let i=this.getFromStorage();i.length!==0&&(this.api.authorized$.getValue()?(e&&this.params.config.useBeacon?(this.loggerDebugLog({message:`Flushing ${i.length} events through beacon`}),this.api.logBeacon(i)):(this.loggerDebugLog({message:`Flushing ${i.length} events`}),this.api.logRequest(i)),t&&this.markStorageSent()):this.api.authorize(),this.firstFlush.cancel(),this.debouncedFlush.cancel())}pause(){this.isPaused=!0,this.debouncedFlush.cancel()}resume(){this.isPaused=!1,this.debouncedFlush()}destroy(){this.subscription.unsubscribe(),this.firstFlush.cancel(),this.debouncedFlush.cancel()}};var g=require("@vkontakte/videoplayer-core/es2018"),Mi=require("@vkontakte/videoplayer-shared/es2018");var tl=r=>r&&{[g.VideoQuality.INVARIANT]:"unknown",[g.VideoQuality.Q_144P]:"mobile",[g.VideoQuality.Q_240P]:"lowest",[g.VideoQuality.Q_360P]:"low",[g.VideoQuality.Q_480P]:"medium",[g.VideoQuality.Q_576P]:"unknown",[g.VideoQuality.Q_720P]:"high",[g.VideoQuality.Q_1080P]:"fullhd",[g.VideoQuality.Q_1440P]:"quadhd",[g.VideoQuality.Q_2160P]:"ultrahd",[g.VideoQuality.Q_4320P]:"unknown"}[r],Fi=r=>r&&{[g.HttpConnectionType.HTTP1]:"http1",[g.HttpConnectionType.HTTP2]:"http2",[g.HttpConnectionType.QUIC]:"http3"}[r],il=r=>{if(r!==void 0)switch(r){case g.VideoFormat.MPEG:return"mp4";case g.VideoFormat.DASH:case g.VideoFormat.DASH_LIVE:case g.VideoFormat.DASH_STREAMS:return"dash";case g.VideoFormat.DASH_SEP:return"dash_sep";case g.VideoFormat.DASH_ONDEMAND:return"ondemand_dash";case g.VideoFormat.DASH_WEBM:case g.VideoFormat.DASH_LIVE_WEBM:return"webm";case g.VideoFormat.DASH_WEBM_AV1:return"av1";case g.VideoFormat.DASH_LIVE_CMAF:return"ondemand_dash_live";case g.VideoFormat.HLS:case g.VideoFormat.HLS_LIVE:return"hls";case g.VideoFormat.HLS_ONDEMAND:return"ondemand_hls";case g.VideoFormat.HLS_LIVE_CMAF:return"ondemand_hls_live";case g.VideoFormat.WEB_RTC_LIVE:return"webrtc";default:return(0,Mi.assertNever)(r)}},Br=r=>{if(r!==void 0)switch(r){case g.Surface.NONE:case g.Surface.INLINE:return;case g.Surface.FULLSCREEN:return"fullscreen";case g.Surface.SECOND_SCREEN:return"chromecast";case g.Surface.PIP:return"pip";case g.Surface.INVISIBLE:return"invisible";default:return(0,Mi.assertNever)(r)}},ol=r=>{switch(r){case"slow-2g":return"poor";case"2g":return"poor";case"3g":return"good";case"4g":return"excellent"}};var Ur=class{constructor(e){this.offset=void 0;this.offset=e}getOffset(){var e;return(e=this.offset)!=null?e:0}setOffset(e){this.offset=e}now(){var e;return Date.now()+((e=this.offset)!=null?e:0)}date(e=new Date){var t;return e.setTime(e.getTime()+((t=this.offset)!=null?t:0)),e}addServerTime(e,t){let i=Date.now(),o=e-i-t/2;if(Math.abs(o)<1e3){this.offset=0;return}this.offset===void 0?this.offset=Math.round(o):this.offset=Math.round(.2*o+(1-.2)*this.offset)}};var Ui=F(Sl(),1),El=()=>(0,Ui.default)(Math.floor(Math.random()*2**32).toString(36),7,"0"),ql=()=>(0,Ui.default)(Math.floor(Math.random()*2**64).toString(36),13,"0");var Vi=require("@vkontakte/videoplayer-core/es2018"),I=require("@vkontakte/videoplayer-shared/es2018"),Pl=(r,e)=>new I.Observable(t=>{let i=new I.Subscription,o=(0,I.merge)((0,I.fromEvent)(window,"beforeunload"),r.events.willDestruct$),a=new I.ValueSubject(void 0),u;i.add(r.info.isLive$.pipe((0,I.filterChanged)()).subscribe(A=>{u&&(u.unsubscribe(),a.next(void 0)),A?u=r.info.liveTime$.pipe((0,I.map)(ye=>ye&&ye/1e3)).subscribe(a):u=r.info.position$.subscribe(a),i.add(u)}));let{playing$:f,paused$:d}=r.events,c=r.events.willSeek$.pipe((0,I.filter)(()=>r.info.playbackState$.getValue()===Vi.PlaybackState.PLAYING)),p=r.events.seeked$.pipe((0,I.filter)(()=>r.info.playbackState$.getValue()===Vi.PlaybackState.PLAYING)),h=!1,s=new I.Subject;i.add(c.subscribe(()=>{h||s.next(),h=!0})),i.add(p.subscribe(()=>h=!1));let l=new I.Subject,m=new I.Subject,b=(0,I.merge)(f,p,l),S=(0,I.merge)(d,s,o,r.events.looped$,m),y,E=()=>y=a.getValue(),W=()=>{let A=a.getValue();(0,I.isNullable)(y)||y===A||(0,I.isNullable)(A)||(t.next({from:y,to:A}),y=void 0)},te=()=>{m.next(),l.next()};if(i.add(b.subscribe(E)),i.add(S.subscribe(W)),e.forceInterval&&isFinite(e.forceInterval)){let A=0;i.add(b.subscribe(()=>A=window.setTimeout(te,e.forceInterval))),i.add(S.subscribe(()=>window.clearTimeout(A)))}return i});var _l="_one-stat_",Tl=`${_l}uuid`,Ol=`${_l}deviceId`,Gi=()=>{let r=new v.Subscription;return{subscription:r,subscribe:(e,t)=>{e&&r.add(e.subscribe(t))}}},Vr=class{constructor(e,t){this.subscription=new v.Subscription;this.debugLogger=new Gr.Logger;this.oneStatDebugLog=this.debugLogger.createComponentLog("onestat");this.loopCounter=0;this.disabled=!1;this.vsid$=new v.ValueSubject(void 0);this.isid$=new v.ValueSubject(void 0);this.zenUid$=new v.ValueSubject(void 0);this.seekAction$=new v.ValueSubject("unknown");var c,p,h;this.statContext=e,this.config=Qn((c=t.config)!=null?c:{}),(0,v.isNonNullable)(t.apiEnv)&&(this.config.apiEnv=t.apiEnv),this.config.synchronizeTime&&(this.timeSynchronisation=new Ur);let i=new v.Subject;this.experimental={error$:i},v.safeStorage.get(Tl)&&v.safeStorage.remove(Tl);let a=v.safeStorage.get(Ol);this.statContext.deviceId?this.deviceId=this.statContext.deviceId:a?this.deviceId=a:(this.deviceId=_t(),v.safeStorage.set(Ol,this.deviceId)),this.resetViewSession(),t.useIsid&&this.isid$.next((p=t.isid)!=null?p:ql()),this.zenUid$.next(t.zenUid);let u=new He({config:this.config,error$:i,timeSynchronisation:this.timeSynchronisation});this.api=new Ge({config:this.config,apiTransport:u,refreshAuthToken:t.refreshAuthToken,mobile:(h=this.statContext.mobile)!=null?h:!1,deviceId:this.deviceId,error$:i}),this.logger=new Fr({config:this.config,debugLogger:this.debugLogger,api:this.api,error$:i,userSalt:t.userSalt});let{isEmbed:f,topOrigin:d}=(0,Gr.detectEmbed)();this.isEmbed=f,this.embedParent=d?new URL(d).hostname:void 0,this.subscribe()}updateContext(e){this.statContext={...this.statContext,...e}}attachTo(e){let t=new v.Subscription,i=(s,l)=>t.add(s.subscribe(l));i(e.events.willStart$,()=>{let s=e.info.position$.getValue();this.logActionPlay({position:s}),this.statContext.projectId&&this.logActionPlayInteractive()}),i(e.events.looped$,()=>{this.resetViewSession(),++this.loopCounter>this.config.maxLoops&&(this.disabled=!0),this.logActionPlay({position:e.info.position$.getValue()})}),i(e.events.seeked$,()=>{this.logSeek({action:this.seekAction$.getValue(),time:e.info.position$.getValue()}),this.seekAction$.next("unknown")}),i(e.events.paused$,()=>{this.logPause({position:e.info.position$.getValue()})}),i(e.events.willResume$,()=>{this.logPlay()}),i(e.events.started$,()=>{this.statContext.clip&&this.logWatchCoverageRecord({start:0,end:0})}),i(e.events.playing$,()=>{this.logPlaying()}),i(Pl(e,{forceInterval:this.config.watchCoverageInterval}),s=>{var S,y,E,W;let l=e.info.isLive$.getValue(),m=e.info.atLiveEdge$.getValue(),b={start:parseFloat(s.from.toFixed(3)),end:parseFloat(s.to.toFixed(3))};if(m){let te=(S=e.info.liveLatency$.getValue())!=null?S:0,A=(E=(y=e.info.currentBuffer$.getValue())==null?void 0:y.end)!=null?E:0,ye=(W=e.info.liveBufferTime$.getValue())!=null?W:0,Wi=Math.round((te-(A-ye))*1e3),Hi=Math.round(te*1e3);Wi&&Hi&&(b.latency=Wi,b.bufferLatency=Hi)}l?this.logWatchCoverageLive(b):this.logWatchCoverageRecord(b)});let o;i(e.info.isStalled$,s=>{s?o=(0,v.now)():((0,v.isNonNullable)(o)&&this.logEmptyBuffer({duration:(0,v.now)()-o}),o=void 0)});let a=!1;t.add(e.events.fatalError$.pipe((0,v.once)()).subscribe(()=>a=!0)),i(e.events.willStop$,()=>{if(e.info.isStalled$.getValue()){let l=(0,v.isNonNullable)(o)?(0,v.now)()-o:void 0;this.logCloseAtEmptyBuffer({duration:l!=null?l:0}),o=void 0}else a||this.logActionStop()}),i(e.events.managedError$,({id:s})=>{this.logError({fatal:!1,errorType:s})}),i(e.events.fatalError$,({id:s})=>{this.logError({fatal:!0,errorType:s})});let u,f,d=!1;i(e.events.firstBytes$,s=>{u=(0,v.now)(),this.logFirstBytes({time:s})}),i(e.events.willStart$,()=>f=(0,v.now)()),i(e.info.currentBuffer$,s=>{!d&&s&&s.end-s.start>0&&(0,v.isNonNullable)(u)&&(this.logPlayerReady({duration:(0,v.now)()-u}),d=!0)}),i(e.events.firstFrame$,()=>{(0,v.isNonNullable)(u)&&!d&&(this.logPlayerReady({duration:(0,v.now)()-u}),d=!0),(0,v.isNonNullable)(f)&&this.logFirstFrame({time:(0,v.now)()-f})});let c;i(e.info.currentVideoStream$,s=>{s&&(c&&s.id!==c&&this.logTrackSwitch(s),c=s.id)});let p;i(e.info.currentAudioStream$,s=>{s&&(p&&s.id!==p&&this.logTrackSwitch(s),p=s.id)}),i(e.info.atLiveEdge$,s=>this.updateContext({liveEdge:s})),i((0,v.combine)({muted:e.info.muted$,volume:e.info.volume$}),({muted:s,volume:l})=>this.updateContext({audible:!s&&l>0})),i(e.info.currentQuality$,s=>{let l=tl(s);this.updateContext({quality:l}),l&&this.logQuality(l)}),i(e.info.isAutoQualityEnabled$,s=>this.updateContext({autoQuality:s})),i(e.info.currentFormat$,s=>this.updateContext({contentType:il(s)})),i(e.info.currentPlaybackRate$,s=>this.updateContext({rate:s})),i(e.info.is3DVideo$,s=>this.updateContext({is3d:s}));let h;return i(e.info.hostname$,s=>{let l=h!==void 0&&h!==s;this.updateContext({cdnHostname:s,failover:l}),l&&this.logFailover(s),h=s}),i(e.info.throughputEstimation$,s=>this.updateContext({downloadSpeed:s})),i(e.info.httpConnectionType$,s=>{this.statContext.firstConnectionType||this.updateContext({firstConnectionType:Fi(s)}),this.updateContext({connectionType:Fi(s)})}),i(e.info.httpConnectionReused$,s=>{(0,v.isNullable)(this.statContext.firstConnectionReused)&&this.updateContext({firstConnectionReused:s}),this.updateContext({connectionReused:s})}),i(e.info.surface$,s=>this.updateContext({mode:Br(s)})),i((0,v.combine)({current:e.info.currentTextTrack$,available:e.info.availableTextTracks$}),({current:s,available:l})=>{let m=l.find(({id:S})=>S===s),b=m&&(m.isAuto?`${m.language}_auto`:m.language);this.updateContext({subtitles:b==null?void 0:b.split(".")[0]})}),this.player=e,this.uiEvents&&this.attachToUi(this.uiEvents),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToUi(e){this.uiEvents=e;let{subscription:t,subscribe:i}=Gi();return this.player&&(i(e.actionRewind$,()=>{this.player&&(this.resetViewSession(),this.logActionPlay({position:this.player.info.position$.getValue()}))}),i(e.actionSeek$,this.seekAction$),i(e.inPiP$,o=>{var u;let a=o?"pip":Br((u=this.player)==null?void 0:u.info.surface$.getValue());this.updateContext({mode:a})}),i(e.inFullscreen$,o=>{var u;let a=o?"fullscreen":Br((u=this.player)==null?void 0:u.info.surface$.getValue());this.updateContext({mode:a})}),i(e.actionSetSubtitle$,o=>this.updateContext({subtitles:o.split(".")[0]})),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t)),t}attachToAds(e){let{subscription:t,subscribe:i}=Gi();return i(e.slotRequested$,()=>this.logAdSlotRequest()),i(e.started$,o=>this.logAdStarted(o)),i(e.paused$,()=>this.logAdPaused()),i(e.resumed$,()=>this.logAdResumed()),i(e.ended$,()=>this.logAdEnded()),i(e.skipped$,()=>this.logAdSkipped()),i(e.clicked$,()=>this.logAdClicked()),i(e.error$,o=>this.logError({errorType:o,fatal:!1})),this.resubscribeBeforeunload(),this.subscription.add(t),t}attachToInteractive(e){let{subscription:t,subscribe:i}=Gi();return i(e.click$,o=>this.logInterfaceClick(o)),i(e.nextMovie$,o=>this.logNextMovie(o)),this.resubscribeBeforeunload(),this.subscription.add(t),t}authorize(e){return this.api.authorize(e)}pause(){this.logger.pause(),this.oneStatDebugLog({message:"paused"})}resume(){this.logger.resume(),this.oneStatDebugLog({message:"resumed"})}destroy(){this.logger.flush(),this.subscription.unsubscribe(),this.api.destroy(),this.logger.destroy()}resetViewSession(){this.oneStatDebugLog({message:"VSID reset"}),this.vsid$.next(El())}getDeviceId(){return this.deviceId}setFieldBlacklist(){}logInited(){}logReady(e){this.log({operation:"player_ready",param:String(e.time)})}logStarted(...e){this.logActionPlay(...e)}logPlay(){this.log({operation:"play_toggle"})}logPlaying(){this.log({operation:"playing"})}logPause(e){this.log({operation:"pause",param:String(Math.round(e.position))})}logSeek(e){this.log({operation:"seek",param:e.action,time:e.time})}logFirstBytes(e){this.log({operation:"first_bytes",param:String(e.time)})}logFirstFrame(e){this.log({operation:"first_frame",param:String(e.time)})}logError(e){this.log({operation:"content_error",param:`${e.fatal?"fatal":"recoverable"}_${e.errorType}`})}logWatchCoverageRecord(e){this.log({operation:"watch_coverage_record",param:`${e.start}-${e.end}`},{in_history:this.statContext.inHistory?1:void 0})}logWatchCoverageLive(e){var a,u;let t=(u=(a=this.timeSynchronisation)==null?void 0:a.getOffset())!=null?u:0,i=e.start+t,o=e.end+t;this.log({operation:"watch_coverage_live",param:`${i}-${o}`},{in_history:this.statContext.inHistory?1:void 0,latency:e.latency,buffer_latency:e.bufferLatency})}logEmptyBuffer(e){this.log({operation:"empty_buffer",param:String(e.duration)})}logDownloadSpeed(){}logAdSlotRequest(){this.log({operation:"adv",param:"slot_request"})}logAdStarted(e){this.log({operation:"adv",param:e})}logAdPaused(){this.log({operation:"adv",param:"pause"})}logAdResumed(){this.log({operation:"adv",param:"resume"})}logAdEnded(){this.log({operation:"adv",param:"ended"})}logAdSkipped(){this.log({operation:"adv",param:"skip"})}logAdClicked(){this.log({operation:"adv",param:"click"})}logInterfaceClick(e){this.log({operation:"player_interface_click",param:e})}logNextMovie(e){this.log({operation:"next_movie",param:String(e)})}subscribe(){this.resubscribeBeforeunload();let e=window.navigator.connection;e&&"onchange"in e&&"effectiveType"in e&&this.subscription.add((0,v.merge)((0,v.fromEvent)(e,"change"),(0,v.observableFrom)(["init"])).subscribe(()=>this.updateContext({network:ol(e.effectiveType)}))),this.config.debugLog&&this.debugLogger.log$.subscribe(t=>{console.debug("%c stat ","background:#fa6470;",`component: ${t.component}.`,t.message)})}resubscribeBeforeunload(){var e;(e=this.beforeunloadSubscription)==null||e.unsubscribe(),this.beforeunloadSubscription=(0,v.fromEvent)(window,"beforeunload").subscribe(()=>this.logger.flush({wantBeacon:!0,clearStorage:this.config.clearStorageAtUnload})),this.subscription.add(this.beforeunloadSubscription)}logPlayerReady(e){this.log({operation:"player_ready",param:String(Math.round(e.duration))})}logActionPlay(e){this.log({operation:"action_play",param:String(Math.round(e.position))})}logActionPlayInteractive(){this.statContext.projectId&&this.log({operation:"action_play_interactive",param:String(this.statContext.movieId)},{vid:this.statContext.projectId})}logFailover(e){this.log({operation:"failover",param:e})}logCloseAtEmptyBuffer(e){this.log({operation:"close_at_empty_buffer",param:String(Math.round(e.duration))})}logActionStop(){this.log({operation:"action_stop"})}logTrackSwitch(e){this.log({operation:"track_switch",param:e.id})}logQuality(e){this.log({operation:"quality",param:e})}log(e,t={}){if(this.disabled){this.oneStatDebugLog({message:`operation ${e.operation} but statistics is disabled`});return}if((0,Ki.default)(this.config.disabledOperations,e.operation)){this.oneStatDebugLog({message:`operation ${e.operation} but it is disabled`});return}this.oneStatDebugLog({message:`operation ${e.operation} ${e.param}`});let i=this.createLogItem(e,t);this.logger.log(i)}createLogItem({operation:e,param:t,time:i},o={}){var l,m,b,S,y,E;let a=(m=(l=this.timeSynchronisation)==null?void 0:l.now())!=null?m:(0,v.now)(),u=this.vsid$.getValue();(0,v.assertNonNullable)(u);let f=this.isid$.getValue(),d=e==="empty_buffer"||e==="close_at_empty_buffer"?this.statContext.connectionType:this.statContext.firstConnectionType,c=this.statContext.firstConnectionReused,p,h;if(this.isEmbed||this.statContext.place==="embed"){p=this.embedParent;let W=[...new URLSearchParams(location.search).entries()].filter(([te,A])=>(0,Ki.default)(this.config.embedUrlParams,te));h=new URLSearchParams(W).toString()}else this.statContext.place==="direct"&&(this.statContext.refDomain?p=(S=(b=(0,v.createURL)(this.statContext.refDomain))==null?void 0:b.hostname)!=null?S:this.statContext.refDomain:document.referrer&&(p=(E=(y=(0,v.createURL)(document.referrer))==null?void 0:y.hostname)!=null?E:document.referrer),h=location.href.substring(0,1024));let s={vsid:u,isid:f,vid:this.statContext.movieId,uid:this.zenUid$.getValue(),ct:this.statContext.contentType,place:this.isEmbed?"embed":this.statContext.place,quality:this.statContext.quality,cdn_host:this.statContext.cdnHostname,stat_type:this.statContext.autoplay===!0?"auto":this.statContext.autoplay===!1?"":void 0,param:t,vk_app_id:this.statContext.vkAppId,track_code:this.statContext.trackCode,connection_type:d,connection_reused:c===!0?1:c===!1?0:void 0,cached_data:this.statContext.cached===!0?1:this.statContext.cached===!1?0:void 0,live:this.statContext.liveEdge?1:void 0,muted:this.statContext.audible===!1?1:void 0,mode:this.statContext.mode,subtitles:this.statContext.subtitles,download_speed:this.statContext.downloadSpeed,manual_quality:this.statContext.autoQuality?void 0:1,ref_domain:p,direct_url:h,rate:this.statContext.rate===1||(0,v.isNullable)(this.statContext.rate)?void 0:this.statContext.rate.toFixed(2),view_360:this.statContext.is3d?1:void 0,aid:this.statContext.albumId,vk_playlist_id:this.statContext.vkPlaylistId,...o};for(let W of this.config.disabledCustomFields)delete s[W];return{operation:e,type:1,time:i,network:this.statContext.network,timestamp:a,custom:s}}};