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