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