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