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