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