@vkontakte/videoplayer-statistics 1.0.89 → 1.0.90

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