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