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