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