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