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