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