@vkontakte/videoplayer-statistics 1.0.81-beta.0 → 1.0.81-beta.1

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