@vkontakte/videoplayer-statistics 1.0.52 → 1.0.53-dev.07a23d13.0

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