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