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