@vkontakte/videoplayer-shared 1.0.100-dev.c1327f3bc.0 → 1.0.100-dev.ed76c949d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015.cjs +3 -3
- package/es2015.esm.js +3 -3
- package/esnext.cjs +3 -3
- package/esnext.esm.js +3 -3
- package/evergreen.esm.js +3 -3
- package/package.json +1 -1
- package/types/types/index.d.ts +6 -1
- package/types/utils/browser.d.ts +5 -1
- package/types/utils/index.d.ts +1 -0
- package/types/utils/timers/WorkerTimersBackend.d.ts +28 -0
- package/types/utils/timers/index.d.ts +3 -0
- package/types/utils/timers/sharedTimers.d.ts +1 -0
- package/types/utils/timers/timers.d.ts +6 -0
- package/types/utils/timers/types.d.ts +30 -0
- package/types/utils/timers/worker.d.ts +28 -0
package/es2015.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.100-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.100-dev.ed76c949d.0
|
|
3
|
+
* Fri, 21 Aug 2026 13:57:35 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-100/doc/
|
|
5
5
|
*/
|
|
6
|
-
function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}var t=e;function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol._oxc_toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@_oxc_toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}var t=e,r=n;function i(e){var n=r(e,`string`);return t(n)==`symbol`?n:n+``}var a=i;function o(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=o;function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){u(a,r,i,o,s,`next`,e)}function s(e){u(a,r,i,o,s,`throw`,e)}o(void 0)})}}var f=l,p=d;let m;var h=Object.defineProperty,ee=Object.getOwnPropertyNames,te=Object.getOwnPropertyDescriptor,g=Object.prototype.hasOwnProperty;function _(e){return this[e]}var v=e=>{var t=(y??=new WeakMap).get(e),n;if(t)return t;if(t=h({},`__esModule`,{value:!0}),e&&typeof e==`object`||typeof e==`function`)for(var r of ee(e))g.call(t,r)||h(t,r,{get:_.bind(e,r),enumerable:!(n=te(e,r))||n.enumerable});return y.set(e,t),t},y,ne=e=>e;function re(e,t){this[e]=ne.bind(null,t)}var b=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0,configurable:!0,set:re.bind(t,n)})},x={};b(x,{withoutNullable:()=>de,videoSizeToQuality:()=>Fe,videoQualityToHeight:()=>Ie,videoHeightToQuality:()=>Pe,urlCanParsePolyfilled:()=>pr,timeout:()=>Je,timeCodeToString:()=>Ve,throttleFn:()=>Ue,throttle:()=>ot,tap:()=>bt,suppressAbort:()=>Ft,stringTrimStart:()=>tr,stringTrimRight:()=>ir,stringTrimLeft:()=>rr,stringTrimEnd:()=>nr,stringReplaceAll:()=>er,stringPadStart:()=>$n,stringPadEnd:()=>Qn,stringMatchAll:()=>Zn,stringAt:()=>Xn,skip:()=>St,shareReplay:()=>wt,safeStorage:()=>be,requestIdleCallbackPolyfilled:()=>ur,promiseWithResolvers:()=>Ln,promiseTry:()=>In,promiseFinally:()=>Fn,promiseAny:()=>Pn,promiseAllSettled:()=>Nn,pairwise:()=>vt,once:()=>_t,observeElementSize:()=>Et,observableFrom:()=>Ze,objectValues:()=>Mn,objectHasOwn:()=>jn,objectFromEntries:()=>kn,objectEntries:()=>On,nowInt:()=>_e,now:()=>ge,noop:()=>w,merge:()=>qe,mapTo:()=>gt,map:()=>mt,loadVKLangPack:()=>qt,isValidURL:()=>Ot,isNullable:()=>O,isNonNullable:()=>D,isLowerOrEqual:()=>je,isLower:()=>F,isInvariantQuality:()=>I,isIntersecting:()=>kt,isHigherOrEqual:()=>Ae,isHigher:()=>ke,isBrowserWindow:()=>me,isAbortError:()=>Pt,interval:()=>Ye,interpolate:()=>Mt,includesPolyfilled:()=>fr,globalThisPolyfill:()=>Dn,getWindow:()=>k,getVideoQualityLabel:()=>ze,getTraceSubscriptionMethod:()=>Lt,getRangeAroundIndex:()=>Nt,getPlayerId:()=>jt,getMessageFromError:()=>It,getHighestQuality:()=>Me,getExponentialDelay:()=>ye,fromEvent:()=>Qe,flattenObject:()=>B,filterChanged:()=>ft,filter:()=>ct,fillWithDefault:()=>Be,fetchPolyfilled:()=>Kn,devNull:()=>Qt,detectEmbed:()=>De,debounceFn:()=>He,debounce:()=>rt,createDIContainer:()=>ln,combine:()=>Ke,cloneDeepWith:()=>L,cloneDeep:()=>We,clearVideoElement:()=>Dt,checkNever:()=>ae,cancelIdleCallbackPolyfilled:()=>dr,buffer:()=>et,atPolyfilled:()=>ar,assertQualityIsExact:()=>Re,assertNullable:()=>ue,assertNotEmptyArray:()=>fe,assertNonNullable:()=>le,assertNever:()=>C,assertEmptyArray:()=>pe,arrayWith:()=>En,arrayToSpliced:()=>Tn,arrayToSorted:()=>wn,arrayToReversed:()=>Cn,arrayIncludes:()=>Sn,arrayFlatMap:()=>xn,arrayFlat:()=>bn,arrayFindLastIndex:()=>yn,arrayFindLast:()=>vn,arrayAt:()=>_n,areQualitiesExact:()=>Le,addScript:()=>he,abortable:()=>ve,VolumeFaderPlugin:()=>pn,VideoQuality:()=>Oe,ValueSubject:()=>R,VKNumericLanguage:()=>Gt,VERSION:()=>ie,TracerFactory:()=>Ut,SubscriptionRemovable:()=>$e,Subscription:()=>S,Subject:()=>E,RequestPolyfilled:()=>qn,ReplaySubject:()=>Ge,Observable:()=>T,NormalizerPlugin:()=>gn,Logger:()=>ce,InternalsExposure:()=>Zt,InterfaceLanguage:()=>Xt,InjectionToken:()=>cn,INTERNAL_EXPOSE_GLOBAL_KEY:()=>K,ErrorCategory:()=>Wt,EqualizerPlugin:()=>Y,CircularBuffer:()=>V,AudioGraph:()=>fn,AppTracer:()=>J,AbortSignalPolyfilled:()=>Yn,AbortControllerPolyfilled:()=>Jn}),module.exports=v(x);var ie=`1.0.100-dev.c1327f3bc.0`;class S{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(e=>{typeof e==`function`?e():e.unsubscribe()})}add(e){return this.subscriptions.push(e),this}}var C=e=>{throw Error(`${e} is value of unexpected type`)},ae=e=>{},w=()=>{},oe=e=>{throw console.error(e),e},se=e=>{console.error(e)};class T{constructor(e){this.suppressErrors=!1,e&&(this._subscribe=e)}setSuppressErrors(e){this.suppressErrors=e}subscribe(e,t){let n=this.suppressErrors?se:oe,r;r=t?typeof t==`function`?{next:t,error:w}:{next:e=>t.next(e),error:e=>t.error?.call(t,e)}:{next:n,error:w};let i=typeof e==`function`?{next:t=>{try{let n=e(t);n instanceof Promise&&n.catch(e=>r.next(e))}catch(e){r.next(e)}},error:e=>r.next(e)}:{next:t=>e.next(t),error:t=>e.error?e.error(t):r.next(t)},a;try{a=this._subscribe(i)}catch(e){i.error?.call(i,e)}return new S().add(()=>{switch(i.next=w,i.error=w,typeof a){case`function`:a();return;case`object`:a.unsubscribe();return;case`undefined`:return;default:return C(a)}})}pipe(...e){return e.reduce((e,t)=>t(e),this)}_subscribe(e){}}class E extends T{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>t.error?.call(t,e))}_subscribe(e){let t=this.keyCounter++;return this.subscribers.set(t,e),new S().add(()=>this.subscribers.delete(t))}}class ce{constructor(){this.log$=new E,this.logs=[],this.log=e=>{let t=f(f({},e),{},{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch{n={message:"error in `createCustomLog`",component:`Logger`}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>f({component:e},t))}}function le(e,t=`Assertion "value is not nullable" failed`){if(e==null)throw Error(t)}function ue(e,t=`Assertion "value is nullable" failed`){if(e!=null)throw Error(t)}function D(e){return e!=null}function O(e){return e==null}var de=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>D(t)));function fe(e,t){if(!e?.length)throw Error(t)}function pe(e,t){if(e?.length)throw Error(t)}var k=()=>globalThis,me=(e=k())=>!!(e.window&&e.screen),he=(e,t,n)=>new Promise((r,i)=>{t.addEventListener(`abort`,()=>{s(),l.remove()});let a=()=>{s(),i(`error`)},o=()=>{s(),r()},s=()=>{c&&clearTimeout(c),l.removeEventListener(`load`,o),l.removeEventListener(`error`,a)},c;n&&(c=k().setTimeout(()=>{s(),i(`timeout`)},n));let l=document.createElement(`script`);l.addEventListener(`load`,o),l.addEventListener(`error`,a),l.src=e,document.head.appendChild(l)}),ge=typeof k().performance?.now==`function`?()=>k().performance.now():()=>Date.now(),_e=()=>Math.trunc(ge()),ve=(e,t)=>p(function*(...n){let r=t(...n),i=e.aborted,a;for(;!i&&!e.aborted;)try{let e=yield r.next(a);i=e.done??!1,a=e.value}catch(e){yield r.throw(e)}return a}),ye=(e,{start:t=0,factor:n=2,max:r=1/0,min:i=t,random:a=0}={})=>{let o=t;return o*=n**+e,o*=1+(Math.random()*a*2-a),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,i),o},be={};b(be,{set:()=>Ce,remove:()=>Te,isPersistent:()=>xe,has:()=>we,get:()=>Se,clear:()=>Ee});var A,j,M=`vk-videoplayer-dummy-key-${Math.random()}`,N=()=>{if(j!==void 0)return j;try{localStorage.setItem(M,`test`),localStorage.removeItem(M),j=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(M),j=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)j=2;else throw e}else throw e}return j===2&&(A=new Map),j},xe=()=>N()===0,Se=e=>{let t=N();switch(t){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return A?.get(e);default:C(t)}},Ce=(e,t)=>{let n=N();switch(n){case 0:try{localStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 1:try{sessionStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 2:A?.set(e,t);return;default:C(n)}},we=e=>{let t=N();switch(t){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return A?.has(e)??!1;default:return C(t),!1}},Te=e=>{let t=N();switch(t){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:A?.delete(e);return;default:C(t)}},Ee=()=>{let e=N();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return A?.clear();default:C(e)}},De=()=>{let e,t=[],n=k();try{e=n.self!==n.top}catch(t){t instanceof DOMException&&t.name===`SecurityError`?e=!0:(e=!1,console.error(t))}try{n.location?.ancestorOrigins&&(t=[...n.location.ancestorOrigins])}catch(e){console.error(e)}try{!t.length&&n.document.referrer&&(t=[new URL(n.document.referrer).origin])}catch(e){console.error(e)}return t=t.filter(e=>URL.canParse(e)),{isEmbed:e,origins:t,topOrigin:t.at(-1),immediateOrigin:t.at(0)}},Oe;(e=>{e.INVARIANT=`Invariant quality`,e.Q_144P=`144p`,e.Q_240P=`240p`,e.Q_360P=`360p`,e.Q_480P=`480p`,e.Q_576P=`576p`,e.Q_720P=`720p`,e.Q_1080P=`1080p`,e.Q_1440P=`1440p`,e.Q_2160P=`2160p`,e.Q_4320P=`4320p`})(Oe||={});var P={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},ke=(e,t)=>P[e].height>P[t].height,Ae=(e,t)=>P[e].height>=P[t].height,F=(e,t)=>P[e].height<P[t].height,je=(e,t)=>P[e].height<=P[t].height,Me=e=>e.sort((e,t)=>e===t?0:e===`Invariant quality`?1:t===`Invariant quality`?-1:F(e,t)?1:-1)[0],Ne=Object.keys(P).sort((e,t)=>F(e,t)?-1:1),Pe=(e,t=.02)=>[...Ne].find(n=>P[n].height*(1+t)>=e),Fe=({width:e,height:t})=>{let n=Math.min(e,t),r=Math.max(e,t);return Ne.find(e=>{let t=P[e];return t.width>=r&&t.height>=n})},Ie=e=>P[e].height,I=e=>e===`Invariant quality`,Le=e=>e.every(e=>!I(e));function Re(e){if(I(e))throw Error(`Expected exact quality`)}var ze=e=>{switch(e){case`4320p`:return`8K`;case`2160p`:return`4K`;case`1440p`:return`QHD`;case`1080p`:return`FHD`;case`720p`:return`HD`;default:return``}},Be=(e,t)=>{let n={};for(let r of Object.keys(t)){let i=t[r],a=e[r];Array.isArray(i)?n[r]=Array.isArray(a)?a:i:typeof i==`object`&&i?typeof a==`object`&&a&&!Array.isArray(a)?n[r]=Be(a,i):n[r]=a??i:n[r]=r in e?a:i}return n},Ve=e=>{let t=``;return e>=3600&&(t+=Math.floor(e/3600)+`h`,e%=3600),e>=60&&(t+=Math.floor(e/60)+`m`,e%=60),e>0&&(t+=Math.floor(e)+`s`),t};function He(e,t=0,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&typeof k().requestAnimationFrame==`function`;n&&(u=!!n.leading,d=`maxWait`in n,a=n?.maxWait?Math.max(+n?.maxWait||0,t):a,f=`trailing`in n?!!n.trailing:f);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(s&&k().cancelAnimationFrame(s),k().requestAnimationFrame(e)):setTimeout(e,t)}function ee(e){if(p){k().cancelAnimationFrame(e);return}clearTimeout(e)}function te(e){return l=e,s=h(v,t),u?m(e):o}function g(e){let n=e-c,r=e-l,i=t-n;return d?Math.min(i,a-r):i}function _(e){let n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function v(){let e=Date.now();if(_(e))return y(e);s=h(v,g(e))}function y(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function ne(){s!==void 0&&ee(s),l=0,r=c=i=s=void 0}function re(){return s===void 0?o:y(Date.now())}function b(){return s!==void 0}function x(...e){let n=Date.now(),a=_(n);if(r=e,i=this,c=n,a){if(s===void 0)return te(c);if(d)return s=h(v,t),m(c)}return s===void 0&&(s=h(v,t)),o}return x.cancel=ne,x.flush=re,x.pending=b,x}var Ue=(e,t=0,n)=>He(e,t,f(f(f({},{leading:!0,trailing:!0}),n),{},{maxWait:t})),L=(e,t)=>{if(typeof e!=`object`||!e)return e;let n=Array.isArray(e)?[]:{};for(let r in e){if(typeof t==`function`){let i=t(e[r],r,e,n);if(i!==void 0){n[r]=i;continue}}typeof e[r]==`object`?n[r]=L(e[r],t):n[r]=e[r]}return n},We=e=>L(e);class Ge extends E{constructor(e){super(),this.bufferSize=void 0,this.buffer=[],this.cursorEnd=-1,this.cursorStart=0,this.bufferSize=e,this.buffer=Array(e)}next(e){this.cursorEnd+=1,this.cursorStart=this.cursorEnd>=this.bufferSize?this.cursorStart+1:0,this.buffer[this.cursorEnd%this.bufferSize]=e,this.subscribers.forEach(t=>t.next(e))}_subscribe(e){for(let t=this.cursorStart;t<=this.cursorEnd;t++)e.next(this.buffer[t%this.bufferSize]);let t=this.keyCounter++;return this.subscribers.set(t,e),new S().add(()=>this.subscribers.delete(t))}}class R extends E{constructor(e){super(),this.value=void 0,this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){let t=super._subscribe(e);return e.next(this.value),t}}function Ke(e){return new T(t=>{let n={},r=Object.keys(e).length,i=e=>i=>{e in n||r--,n[e]=i,r===0&&t.next(n)};return Object.entries(e).reduce((e,[t,n])=>e.add(n.subscribe(i(t))),new S)})}function qe(...e){return new T(t=>e.reduce((e,n)=>e.add(n.subscribe(t)),new S))}var Je=e=>new T(t=>{let n=k().setTimeout(()=>{try{t.next()}catch(e){if(t.error)t.error(e);else throw e}},e);return()=>k().clearTimeout(n)}),Ye=e=>new T(t=>{let n=k(),r=n.setInterval(()=>t.next(),e);return()=>{r&&=(n.clearInterval(r),void 0)}});function Xe(e){return new T(t=>{if(e instanceof Promise){let n=!1;return e.then(e=>{n||t.next(e)}).catch(e=>{n||t.error?.call(t,e)}),()=>{n=!0}}for(let n=0;n<e.length;n++)t.next(e[n])})}var Ze=Xe,Qe=(e,t)=>new T(n=>{let r=e=>n.next(e);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});class $e extends S{remove(e){this.subscriptions=this.subscriptions.filter(t=>t!==e)}}function et(e){return t=>new T(n=>t.subscribe(new tt(n,e)))}class tt{constructor(e,t){this.destination=void 0,this.size=void 0,this.lastValues=[],this.destination=e,this.size=t}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t;(t=this.destination).error?.call(t,e)}}var nt={leading:!1,trailing:!0};function rt(e,t=nt){return n=>new T(r=>n.subscribe(new it(r,e,t)))}class it{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e;let t=k();D(this.timeout)?t.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=t.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(e){var t;(t=this.destination).error?.call(t,e)}}var at={leading:!0,trailing:!1};function ot(e,t=at){return n=>new T(r=>n.subscribe(new st(r,e,t)))}class st{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,O(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=k().setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var t;(t=this.destination).error?.call(t,e)}}function ct(e){return t=>new T(n=>t.subscribe(new lt(n,e)))}class lt{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}var ut=(e,t)=>{let n=(e,t)=>{let n=Object.keys(e);for(let r in t)if(!n.includes(r)||t[r]!==e[r])return!1;return!0};return n(e,t)&&n(t,e)},dt=(e,t)=>e instanceof Object&&t instanceof Object?ut(e,t):e===t;function ft(e=dt){return t=>new T(n=>t.subscribe(new pt(n,e)))}var z={};class pt{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.lastValue=z,this.destination=e,this.predicate=t}next(e){let t;try{t=this.lastValue===z||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object&&!Array.isArray(e)?f({},e):e}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function mt(e){return t=>new T(n=>t.subscribe(new ht(n,e)))}class ht{constructor(e,t){this.destination=void 0,this.mapper=void 0,this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(e){throw this.error(e),e}this.destination.next(t)}error(e){var t;(t=this.destination).error?.call(t,e)}}function gt(e){return mt(()=>e)}function _t(){return e=>new T(t=>{let n=!1,r=!1,i=e.subscribe(e=>{n||(n=!0,t.next(e)),r&&i.unsubscribe()},e=>{n=!0,t.error?.call(t,e),r&&i.unsubscribe()});return r=!0,n&&i.unsubscribe(),i})}function vt(){return e=>new T(t=>e.subscribe(new yt(t)))}class yt{constructor(e){this.destination=void 0,this.last=void 0,this.hasLast=!1,this.destination=e}next(e){let t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t;(t=this.destination).error?.call(t,e)}}function bt(e){return t=>new T(n=>t.subscribe(new xt(n,e)))}class xt{constructor(e,t){this.destination=void 0,this.effect=void 0,this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(e){throw this.error(e),e}this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function St(e){return t=>new T(n=>t.subscribe(new Ct(n,e)))}class Ct{constructor(e,t){if(this.destination=void 0,this.count=void 0,this.destination=e,this.count=t,t<0){var n;(n=this.destination).error?.call(n,Error(`Count can not be less than zero`))}}next(e){this.count===0?this.destination.next(e):this.count--}error(e){var t;(t=this.destination).error?.call(t,e)}}function wt(e=0){return t=>{let n=0,r=new Ge(e),i=t.subscribe(r),a=e=>()=>{e.unsubscribe(),n--,n===0&&i.unsubscribe()};return new T(e=>(n++,a(r.subscribe(e))))}}var Tt=300,Et=(e,t=Tt)=>new T(n=>{let r=k(),{width:i,height:a}=e.getBoundingClientRect();if(n.next({width:i,height:a}),!me(r))return;let o=new r.ResizeObserver(Ue(e=>{let t=e[0];if(!t)return;let r,i;t.contentBoxSize&&t.contentBoxSize[0]?(i=t.contentBoxSize[0].blockSize,r=t.contentBoxSize[0].inlineSize):t.contentRect&&(r=t.contentRect.width,i=t.contentRect.height),D(r)&&D(i)&&n.next({width:r,height:i})},t));return o.observe(e),()=>o.disconnect()}),B=(e,t=6,n=`.`)=>{let r={};for(let i in e)if(!(!e.hasOwnProperty(i)||e[i]instanceof HTMLElement||!t))if(typeof e[i]==`object`&&e[i]!==null){let a=B(e[i],t-1);for(let e in a)a.hasOwnProperty(e)&&(r[i+n+e]=a[e])}else r[i]=e[i];return r},Dt=e=>{e.innerHTML=``,e.removeAttribute(`src`),e.load()},Ot=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`},kt=(e,t)=>!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom),At=(()=>{let e=0;return()=>{let t=e;return e=(e+1)%(2**53-1),t}})(),jt=e=>e!==void 0&&e!==``?e:At().toString();function Mt(e,t,n){if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];let r=1;for(;r<t.length&&t[r]<e;)r++;r>=t.length&&(r=t.length-1);let i=t[r-1],a=t[r],o=n[r-1],s=n[r];return e===i?o:e===a?s:o+(e-i)/(a-i)*(s-o)}function Nt(e,t,n){if(e<=0||n<0)return[];let r=[],i=Math.floor((e-1)/2),a=Math.floor(e/2),o=t-i,s=t+a;o<0&&(s+=Math.abs(o),o=0),s>n&&(o-=s-n,s=n),o=Math.max(0,o),s=Math.min(n,s);for(let e=o;e<=s;e++)r.push(e);return r}var Pt=e=>e instanceof DOMException&&(e.name===`AbortError`||e.code===20),Ft=e=>{if(!Pt(e))throw e};function It(e){if(e&&typeof e==`object`){if(`message`in e)return String(e.message);try{return JSON.stringify(e)}catch{return`object serialization error`}}return String(e)}m=Symbol.iterator;class V{constructor(e){if(this.buffer=void 0,this.writeIndex=0,this.count=0,this.capacity=void 0,e<=0)throw Error(`Capacity must be greater than 0`);this.capacity=e,this.buffer=Array.from({length:e}).fill(null)}add(e){this.buffer[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.count<this.capacity&&this.count++}*[m](){if(this.count===0)return;let e=this.count<this.capacity?0:this.writeIndex;for(let t=0;t<this.count;t++){let t=this.buffer[e];D(t)&&(yield t),e=(e+1)%this.capacity}}clear(){this.buffer.fill(null),this.writeIndex=0,this.count=0}get size(){return this.count}get maxCapacity(){return this.capacity}}var Lt=e=>(t,n=!1)=>r=>{let i=typeof r==`object`;r==null||i&&!Object.keys(r).length||e(t,i?B(r):{value:r},n)},H=(e={})=>{let t=e=>{let t=e;return e===void 0?t=`undefined`:e===null?t=`null`:(typeof e==`number`||typeof e==`boolean`)&&(t=e.toString()),t},n={};for(let r in e)Array.isArray(e[r])?n[r]=e[r].map(t):n[r]=t(e[r]);return n};class U{constructor({name:e,getParentContext:t,getRootTracerContext:n,options:r}){this.dynamicImportTimeout=5e3,this.subscription=new S,this.options=void 0,this.span=void 0,this.context=void 0,this.childTracers=[],this.initPromise=void 0,this.getRootTracerContext=void 0,this.eventsBuffer=null,this.options=r??{};let{tracerEventsBufferSize:i}=this.options;D(i)&&i>0&&(this.eventsBuffer=new V(i)),U.dynamicImportStatus===`not_started`&&(U.dynamicImportPromise=this.loadOpentelemetry());let a=Date.now();this.initPromise=U.dynamicImportPromise.then(r=>{U.dynamicImportStatus===`completed`&&this.init({name:e,getParentContext:t,getRootTracerContext:n},a)})}init({name:e,getParentContext:t,getRootTracerContext:n},r){let i=n?.();if(O(i))return;let{opentelemetryApi:a}=U.dynamicImports,{context:o,trace:s}=a,{tracer:c,attributes$:l}=i;this.span=c.startSpan(e,{startTime:r},t?.()),this.context=s.setSpan(o.active(),this.span),this.getRootTracerContext=n,this.subscription.add(l.subscribe(e=>{D(e)&&this.span.setAttributes(e)}))}loadOpentelemetry(){var e=this;return p(function*(){if(U.dynamicImportStatus===`not_started`){U.dynamicImportStatus=`in_progress`;try{let t=new Promise((t,n)=>setTimeout(n,e.dynamicImportTimeout)),n=Promise.all([import(`@opentelemetry/api`),import(`@opentelemetry/sdk-trace-web`),import(`@apptracer/opentelemetry`),import(`@opentelemetry/resources`),import(`@opentelemetry/semantic-conventions`)]),[r,i,a,o,s]=yield Promise.race([n,t]);U.dynamicImports={opentelemetryApi:r,opentelemetrySdk:i,tracer:a,opentelemetryResources:o,opentelemetrySemanticConventions:s},U.dynamicImportStatus=`completed`}catch{U.dynamicImportStatus=`failed`}}})()}isComponentTracerNotInitialized(){return O(this.span)||U.dynamicImportStatus===`failed`}addEventToBuffer(e,t,n,r){D(this.eventsBuffer)&&this.eventsBuffer.add({name:e,attributes:t,type:n,timestamp:r})}addEventToSpan(e,t,n,r){this.span.addEvent(e,f(f({},H(t)),{},{type:n}),r)}log(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`log`,r)}):this.addEventToBuffer(e,t,`log`,r)}error(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`error`,r)}):this.addEventToBuffer(e,t,`error`,r)}critical(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`critical`,r)}):this.addEventToBuffer(e,t,`critical`,r)}createComponentTracer(e){let t=new U({name:e,getParentContext:()=>this.context,getRootTracerContext:()=>this.getRootTracerContext?.call(this),options:this.options});return this.childTracers.push(t),t}setSpanAttributes(e){this.span.setAttributes(H(e))}end(){this.initPromise.then(e=>{if(!this.isComponentTracerNotInitialized()){if(D(this.eventsBuffer))for(let e of this.eventsBuffer)this.addEventToSpan(e.name,e.attributes,e.type,e.timestamp);this.childTracers.forEach(e=>e.end()),this.span.end(),this.subscription.unsubscribe()}})}pause(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!0)}resume(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!1)}}U.dynamicImportStatus=`not_started`,U.dynamicImports=void 0,U.dynamicImportPromise=void 0;var Rt=`gW5EerTD5QhAnsbpF7Hd2NSMRteYIUUMjFbSyI68Pf5`,zt=e=>{class t extends e{constructor(e,t){super(e,t),this._isPaused=!1,this._pausedSpans=void 0,this.maxExportBatchSize=void 0,this.maxQueueSize=void 0,this.maxQueueSize=t?.maxQueueSize??2048,this.maxExportBatchSize=t?.maxExportBatchSize??512,this._pausedSpans=new V(this.maxQueueSize)}pause(){this._isPaused=!0}resume(){var e=()=>super.onEnd,t=this;return p(function*(){if(!t._isPaused)return;t._isPaused=!1;let n=t._pausedSpans;t._pausedSpans=new V(t.maxQueueSize);let r=0;for(let i of n)e().call(t,i),r+=1,r>=t.maxExportBatchSize&&(yield new Promise(e=>k().setTimeout(e,0)),r=0);n.clear(),yield t.forceFlush()})()}onEnd(e){if(this._isPaused){this._pausedSpans.add(e);return}super.onEnd(e)}}return t};class Bt extends U{constructor(e){super({name:`Root`,options:e}),this.attributes$=new R(null),this.paused$=new R(!1),this.paused$.next(!!this.options.tracerPausedAtInit)}init({name:e,getParentContext:t},n){let{tracer:r,opentelemetryResources:i,opentelemetrySdk:a,opentelemetrySemanticConventions:o}=U.dynamicImports,{TracerUploadSpanExporter:s}=r,{WebTracerProvider:c,BatchSpanProcessor:l}=a,{resourceFromAttributes:u}=i,{ATTR_SERVICE_NAME:d,ATTR_SERVICE_VERSION:f}=o,p=new(zt(l))(new s({appToken:Rt}));this.subscription.add(this.paused$.subscribe(e=>{e?p.pause():p.resume()}));let m=new c({resource:u({[d]:`videoplayer-sdk-web`,[f]:ie}),spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0},spanProcessors:[p]});m.register();let h=m.getTracer(`sdk-videoplayer-tracer`);super.init({name:e,getParentContext:t,getRootTracerContext:()=>({tracer:h,attributes$:this.attributes$,paused$:this.paused$})},n)}getTraceId(){return this.isComponentTracerNotInitialized()?``:this.span.spanContext().traceId}setSpanAttributes(e){this.attributes$.next(f(f({},this.attributes$.getValue()),H(e)))}addSubscription(e){this.subscription.add(e)}}class W{constructor(e){this.fakeTraceId=void 0}log(e,t,n){}error(e,t,n){}critical(e,t,n){}createComponentTracer(e){return new W({name:e})}end(){}getTraceId(){return this.fakeTraceId}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}var Vt=()=>!0,G={level:0,filter:Vt,name:`Noname Tracer`,outputMethod:`log`};class Ht{constructor({name:e,level:t,filter:n,outputMethod:r}={}){this.name=void 0,this.filter=Vt,this.level=G.level,this.outputMethod=G.outputMethod,this.childTracers=[],this.filter=n??this.filter,this.level=t??this.level,this.outputMethod=r??this.outputMethod,this.name=e??G.name}log(e,t,n){this.logDebug(e,t)}error(e,t,n){this.logError(e,t)}critical(e,t,n){this.logError(e,t)}createComponentTracer(e){let t=new Ht({filter:this.filter,level:this.level,name:`${this.name}/ ${e}`,outputMethod:this.outputMethod});return this.childTracers.push(t),t}end(){this.childTracers.forEach(e=>e.end()),this.childTracers=[]}setLevel(e){this.level=e,this.childTracers.forEach(t=>t.setLevel(e))}setOtputMethod(e){this.outputMethod=e,this.childTracers.forEach(t=>t.setOtputMethod(e))}setFilter(e){this.filter=e,this.childTracers.forEach(t=>t.setFilter(e))}getFinishedSpans(){}getTraceId(){return`debug_trace`}get verbose(){return this.level===0}createMessage(e,t){return[this.name,e,JSON.stringify(t)].join(`: `)}logDebug(e,t){!this.verbose||!this.filter(e,t)||k().console[this.outputMethod](this.createMessage(e,t))}logError(e,t){this.filter(e,t)&&k().console.error(this.createMessage(e,t))}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}class Ut{static createRootTracer(e=`fake`,t){switch(e){case`real`:return new Bt(t);case`debug`:return new Ht;default:return new W}}}var Wt;(e=>{e.NETWORK=`network`,e.VIDEO_PIPELINE=`video_pipeline`,e.EXTERNAL_API=`external_api`,e.PARSER=`parser`,e.DOM=`dom`,e.WTF=`wtf`,e.UI=`ui`,e.CALL_FROM_EXTERNAL=`call_from_external`,e.FATAL=`fatal`})(Wt||={});var Gt;(e=>{e.Armenian=`58`,e.Azerbaijani=`57`,e.Belarusian=`114`,e.English=`3`,e.Kazakh=`97`,e.Portuguese=`73`,e.Russian=`0`,e.Spanish=`4`,e.Ukrainian=`1`,e.Uzbek=`65`,e.Vietnamese=`75`})(Gt||={});var Kt=`vk.ru`,qt=function(){var e=p(function*(e,t,n){let r=new URL(`https://${Kt}/js/lang-pack.js`);return r.searchParams.set(`format`,`json`),r.searchParams.set(`name`,t),e!==void 0&&r.searchParams.set(`lang`,e),Jt(yield(yield fetch(r.toString())).json(),n)});return function(t,n,r){return e.apply(this,arguments)}}(),Jt=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([e,n])=>[e.substring(`${t}_`.length),Yt(n)])),Yt=e=>Array.isArray(e)?e[0]:e,Xt;(e=>{e.RU=`ru`,e.EN=`en`})(Xt||={});var K=`__vk_vp_internals_exposure`;class Zt{constructor(e,t){this.playerId=void 0,this.type=void 0,this.playerId=t,this.type=e,this.initWindowObjects()}getWindowObject(){var e;if(typeof window>`u`)return{};let t=this.playerId,n=this.type;return((e=window[K])==null||(e=e[t])==null?void 0:e[n])??{}}initWindowObjects(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[K]||(window[K]={}),window[K][e]||(window[K][e]={}),window[K][e][t]||(window[K][e][t]={})}expose(e){typeof window>`u`||Object.assign(this.getWindowObject(),e)}destroy(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[K]&&window[K][e]&&window[K][e][t]&&(delete window[K][e][t],Object.keys(window[K][e]).length||delete window[K][e],Object.keys(window[K]).length||delete window[K])}}var Qt={};b(Qt,{subscribe:()=>nn,push:()=>tn,destroy:()=>en,create:()=>$t});var q=new Map,$t=(e,t)=>q.set(e,t??[]),en=e=>q.delete(e),tn=(e,t)=>{let n=q.get(e);n&&(typeof n==`function`?n(t):n.push(t))},nn=(e,t)=>{let n=q.get(e);if(n){if(n&&Array.isArray(n))for(let e of n)t(e);q.set(e,t)}},rn=e=>de({id:e.id,message:e.message,category:e.category,data:an(e.data),httpCode:e.httpCode,UVBackendErrorCode:e.UVBackendErrorCode});function an(e){switch(typeof e){case`boolean`:case`string`:case`number`:return e;case`object`:try{return JSON.stringify(e)}catch{return}default:return}}var on=e=>{let t=e.thrown instanceof Error?e.thrown:Error(e.message),n=e.id.length>10240?e.id.substring(0,10240):e.id;try{t.name=n}catch{t=Error(e.message),t.name=n}return t},sn=()=>{try{var e;let{origin:t,pathname:n,search:r,hostname:i}=((e=k())==null||(e=e.document)==null?void 0:e.location)??{};return!i||i===`localhost`?void 0:f({url:t+n},new URLSearchParams(r).entries().reduce((e,[t,n])=>(e[`url.${t}`]=n,e),{}))}catch{}};class J{constructor(e,t,n,r){this.dynamicImportTimeout=5e3,this.componentName=void 0,this.subscription=new S,this.options=void 0,this.envParams=void 0,this.context=void 0,this.isEmbed=void 0,this.embedParent=void 0,this.beforeInitErrors=[],this.componentName=e,this.options=t,this.envParams=n,this.context=f({},r);let{isEmbed:i,topOrigin:a}=De();this.isEmbed=i,this.embedParent=a?new URL(a).hostname:void 0,this.options.enabled&&(this.loadModule(),this.init())}updateContext(e){Object.assign(this.context,e)}error(e,t){let n=J.tracerErrorMap.get(this.componentName);if(!n){this.beforeInitErrors.push([e,t]);return}let{blackErrorCategoryList:r,blackErrorIdList:i,sampleRate:a,whiteErrorCategoryList:o,whiteErrorIdList:s}=this.options,{id:c,category:l}=e;if(!(r.length&&r.includes(l)||i.length&&i.includes(c)||o.length&&!o.includes(l)||s.length&&!s.includes(c)||Math.random()>=a))try{let r=on(e);n?.error(r,f(f({crashIdSource:t?.crashIdSource??r.name,severity:t?.severity??(e.traceAsLog?`debug`:void 0)},t?.issueKey?{issueKey:t.issueKey}:{}),{},{keys:f(f(f(f({},this.context),rn(e)),sn()),this.isEmbed&&this.embedParent&&{iframe_host:this.embedParent})}))}catch(e){console.error(e)}}addSubscription(e){this.subscription.add(e)}destroy(){this.subscription.unsubscribe()}init(){var e=this;return p(function*(){try{if(yield J.loadPromise,J.tracerErrorMap.has(e.componentName)||O(J.appTracerModule))return;let{appTracerModule:t}=J,{initTracerError:n,initTracerErrorUploader:r,getTracerModules:i}=t,a=i(e.componentName),o=!a.error,s=a.error??n(e.componentName,{enableUnhandledErrorsListeners:!1,stringifyErrorDataObject:!0});D(e.options.userId)&&s.setUserId(e.options.userId),o&&r(e.componentName,{appToken:Rt,environment:e.envParams.env,versionCode:1,versionName:e.envParams.version}),J.tracerErrorMap.set(e.componentName,s),e.beforeInitErrors.forEach(t=>e.error.apply(e,t)),e.beforeInitErrors=[]}catch(e){console.error(e)}})()}loadModule(){var e=this;D(J.loadPromise)||(J.loadPromise=function(){var t=p(function*(){try{let t=new Promise((t,n)=>k().setTimeout(n,e.dynamicImportTimeout));J.appTracerModule=yield Promise.race([t,import(`@apptracer/sdk/lite`)])}catch(e){J.loadPromise=null,console.error(e)}});return function(){return t.apply(this,arguments)}}()())}}J.tracerErrorMap=new Map,J.appTracerModule=null,J.loadPromise=null;class cn{constructor(e,t){this.options=void 0,this.symbol=void 0,this.options=t,this.symbol=Symbol(e)}}var ln=()=>{let e=new Map,t=new Map,n=new Map,r=new Map,i=new Set;return{resolve(e){if(!r.has(e)){let t=n.get(e);if(!t)throw Error(`No constructor registered in DI container for ${e.name}`);r.set(e,new t)}return r.get(e)},resolveOptional(e){try{return this.resolve(e)}catch{return}},replace(e,t){r.forEach((t,n)=>{t instanceof e&&r.delete(n)}),n.set(e,t)},getToken(n){if(e.has(n.symbol))return e.get(n.symbol);if(t.has(n.symbol)){let r=t.get(n.symbol)();return e.set(n.symbol,r),r}if(n.options?.factory){let t=n.options.factory();return e.set(n.symbol,t),t}throw Error(`No value registered in DI container for token "${n.symbol.description}"`)},registerToken(t,n){e.set(t.symbol,n)},registerFactory(e,n){t.set(e.symbol,n)},hasToken(n){return e.has(n.symbol)||t.has(n.symbol)||!!n.options?.factory},registerCleanup(e){i.add(e)},clear(){i.forEach(e=>e()),i.clear(),e.clear(),t.clear(),r.clear(),n.clear()}}};class un{constructor(e){this._inputNode=void 0,this._outputNode=void 0,this._plugins=[],this._destination=null,this._taps=[],this._inputNode=e.createGain(),this._outputNode=e.createGain()}get input(){return this._inputNode}get plugins(){return this._plugins}connectTo(e){this._destination=e,this.rebuild()}addTap(e){this._taps.push(e),this._outputNode.connect(e)}hasPlugin(e){return this._plugins.some(t=>t.id===e)}addPlugin(e){this.hasPlugin(e.id)||(this._plugins.push(e),this.rebuild())}removePlugin(e){let t=this._plugins.findIndex(t=>t.id===e);t!==-1&&(this._plugins.splice(t,1),this.rebuild())}rebuild(){this._inputNode.disconnect();for(let e of this._plugins)e.outputNode.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._plugins)e.connect(t.inputNode),e=t.outputNode;e.connect(this._outputNode),this._destination!==null&&this._outputNode.connect(this._destination);for(let e of this._taps)this._outputNode.connect(e)}}class dn{constructor(e,t,n){this._pluginChain=void 0,this._element=void 0,this._ctx=void 0,this._sourceNode=null,this._isBound=!1,this._element=e,this._ctx=t,this._pluginChain=new un(t),this._pluginChain.connectTo(n)}get isBound(){return this._isBound}get plugins(){return this._pluginChain.plugins}bind(){this._isBound||=(this._sourceNode===null&&(this._sourceNode=this._ctx.createMediaElementSource(this._element)),this._sourceNode.disconnect(),this._sourceNode.connect(this._pluginChain.input),!0)}unbind(){this._isBound&&=(this._sourceNode?.disconnect(),this._sourceNode?.connect(this._ctx.destination),!1)}addPlugin(e){this._pluginChain.addPlugin(e)}removePlugin(e){this._pluginChain.removePlugin(e)}addAnalyser(e){this._pluginChain.addTap(e)}}class fn{constructor(){this._ctx=null,this._masterGain=null,this._connections=new Map,this._contextEnabled=!1,this._boundBeforeDisable=new Set}static isSupported(){let e=k();return D(e.AudioContext??e.webkitAudioContext)}get context(){if(O(this._ctx)){let e=k(),t=e.AudioContext??e.webkitAudioContext;this._ctx=new t}return this._ctx}get contextState(){return this._contextEnabled?this._ctx?.state??`suspended`:`suspended`}enableContext(){var e=this;return p(function*(){e.ensureContext(),yield e._ctx?.resume(),e._contextEnabled=!0;for(let t of e._boundBeforeDisable)e._connections.get(t)?.bind();e._boundBeforeDisable.clear()})()}disableContext(){var e=this;return p(function*(){e._contextEnabled=!1;for(let[t,n]of e._connections)n.isBound&&(e._boundBeforeDisable.add(t),n.unbind())})()}connectSource(e){var t=this;return p(function*(){t.ensureContext(),t._contextEnabled=!0,yield t._ctx?.resume();let n=t._connections.get(e);if(n!==void 0){n.isBound||n.bind();return}let r=new dn(e,t.context,t._masterGain);r.bind(),t._connections.set(e,r)})()}disconnectSource(e){this._connections.get(e)?.unbind()}isSourceConnected(e){return this._connections.get(e)?.isBound??!1}addPlugin(e,t){let n=this._connections.get(e);if(n===void 0)throw Error(`Source is not connected. Call connectSource() first.`);n.addPlugin(t)}removePlugin(e,t){this._connections.get(e)?.removePlugin(t)}getPlugins(e){return this._connections.get(e)?.plugins??[]}createAnalyser(e){let t=this._connections.get(e);if(t===void 0)return null;let n=this.context.createAnalyser();return n.fftSize=256,n.smoothingTimeConstant=.8,t.addAnalyser(n),n}setMasterVolume(e){this._masterGain!==null&&(this._masterGain.gain.value=e)}getMasterVolume(){return this._masterGain?.gain.value??1}dispose(){this._connections.clear(),this._boundBeforeDisable.clear(),this._masterGain=null,this._contextEnabled=!1,this._ctx?.close(),this._ctx=null}ensureContext(){let e=this.context;O(this._masterGain)&&(this._masterGain=e.createGain(),this._masterGain.gain.value=1,this._masterGain.connect(e.destination))}}class pn{constructor(e,t){this.id=`volume-fader`,this._gainNode=void 0,this._duration=void 0,this._curve=void 0,this._fade=null,this._gainNode=e.createGain(),this._gainNode.gain.value=1,this._duration=t.duration,this._curve=t.curve??this._buildEasingCurve(t.duration/1e3)}get inputNode(){return this._gainNode}get outputNode(){return this._gainNode}get faded(){return this._fade!==null}appear(){this._startFade(0,1)}disappear(){this._startFade(1,0)}pause(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime,n=t-this._fade.startTime,r=Math.max(0,this._fade.remaining-n);if(r<=.001){this._finishFade();return}let i=this._sampleIndex(this._fade,t),a=this._fade.curve[i];e.cancelScheduledValues(t),e.setValueAtTime(a,t),this._fade={from:a,target:this._fade.target,startTime:t,remaining:r,curve:this._fade.curve.subarray(i)}}resume(){if(this._fade===null)return;let e=this._gainNode.context.currentTime,{from:t,target:n,remaining:r,curve:i}=this._fade;if(r<=.001||Math.abs(n-t)<.001||i.length<2){this._finishFade();return}this._fade={from:t,target:n,startTime:e,remaining:r,curve:i},this._scheduleCurve(i,t,e,r)}cancel(){this._fade!==null&&this._finishFade()}_finishFade(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime;e.cancelScheduledValues(t),e.setValueAtTime(this._fade.target,t),this._fade=null}_startFade(e,t){let n=this._gainNode.gain,r=this._gainNode.context.currentTime,i=this._duration/1e3;if(i<=0){n.cancelScheduledValues(r),n.setValueAtTime(t,r),this._fade=null;return}let a=new Float32Array(this._curve.length);for(let n=0;n<this._curve.length;n++)a[n]=e+(t-e)*this._curve[n];this._fade={from:a[0],target:t,startTime:r,remaining:i,curve:a},this._scheduleCurve(a,a[0],r,i)}_buildEasingCurve(e){let t=Math.max(2,Math.ceil(e*60)),n=new Float32Array(t);for(let e=0;e<t;e++){let r=e/(t-1);n[e]=(1-Math.cos(Math.PI*r))/2}return n}_scheduleCurve(e,t,n,r){let i=this._gainNode.gain;i.cancelScheduledValues(n),i.setValueAtTime(t,n),i.setValueCurveAtTime(e,n,r)}_sampleIndex(e,t){let n=t-e.startTime,r=Math.max(0,Math.min(1,n/e.remaining));return Math.min(Math.round(r*(e.curve.length-1)),e.curve.length-1)}}class mn{constructor(e,t,n,r){this._filter=void 0,this._source=void 0,this._defaultGain=void 0,this.frequency=void 0,this.frequency=t,this._source=n,this._defaultGain=r,this._filter=e.createBiquadFilter(),this._filter.type=`peaking`,this._filter.frequency.value=t,this._filter.gain.value=0,this._filter.Q.value=1,this._source.connect(this._filter.gain)}get value(){return this._source.offset.value}get node(){return this._filter}set(e){this._source.offset.value=e}reset(){this.set(this._defaultGain)}dispose(){this._source.disconnect(this._filter.gain)}}class Y{constructor(e,t){this.id=`equalizer`,this._inputNode=void 0,this._outputNode=void 0,this._filterMap=new Map,this.equalizer=void 0,this._inputNode=e.createGain(),this._outputNode=e.createGain();let n=Object.entries(t).map(([e,t])=>[Number(e),t]).filter(([e])=>Number.isFinite(e)).sort((e,t)=>e[0]-t[0]),r=Y._sources.get(e);O(r)&&(r=new Map,Y._sources.set(e,r));for(let[t,i]of n)if(!r.has(t)){let n=e.createConstantSource();n.offset.value=i,n.start(),r.set(t,n)}let i={};for(let[t,a]of n){let n=r.get(t);if(!n)continue;let o=new mn(e,t,n,a);this._filterMap.set(t,o),i[t]=o}this.equalizer=i,this.rebuild()}get inputNode(){return this._inputNode}get outputNode(){return this._outputNode}resetAll(){for(let e of this._filterMap.values())e.reset()}dispose(){for(let e of this._filterMap.values())e.dispose()}rebuild(){this._inputNode.disconnect();for(let e of this._filterMap.values())e.node.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._filterMap.values())e.connect(t.node),e=t.node;e.connect(this._outputNode)}}Y._sources=new WeakMap;var hn=-14;class gn{constructor(e,t){this.id=`normalizer`,this._compressor=void 0,this._gainNode=void 0,this._compressor=e.createDynamicsCompressor(),this._gainNode=e.createGain(),this.applyConfig(t),this._compressor.connect(this._gainNode)}get inputNode(){return this._compressor}get outputNode(){return this._gainNode}applyConfig(e){if(!Number.isFinite(e.lufs)||!Number.isFinite(e.peak)){this._gainNode.gain.value=1;return}this._compressor.threshold.value=e.peak,this._compressor.knee.value=0,this._compressor.ratio.value=20,this._compressor.attack.value=.003,this._compressor.release.value=.25;let t=(e.targetLufs??hn)-e.lufs;this._gainNode.gain.value=10**(t/20)}}var _n=(e,t)=>{let n=e.length,r=t>=0?t:n+t;return r>=0&&r<n?e[r]:void 0},vn=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}},yn=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return n;return-1},bn=(e,t=1)=>{let n=[],r=(e,t)=>{for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i];t>0&&Array.isArray(a)?r(a,t-1):n.push(a)}};return r(e,t),n},xn=(e,t)=>{let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);if(Array.isArray(i))for(let e=0;e<i.length;e++)n.push(i[e]);else n.push(i)}return n},Sn=(e,t,n=0)=>{let r=e.length,i=n>=0?n:Math.max(r+n,0);for(;i<r;i++){let n=e[i];if(n===t||n!==n&&t!==t)return!0}return!1},Cn=e=>{let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=e[t-1-r];return n},wn=(e,t)=>{let n=e.slice();return t?n.sort(t):n.sort()},Tn=(e,t,n,...r)=>{let i=e.slice();return n===void 0?i.splice(t):i.splice(t,n,...r),i},En=(e,t,n)=>{let r=e.length,i=t>=0?t:r+t,a=e.slice();return a[i]=n,a},Dn=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof self<`u`?self:Function(`return this`)(),On=e=>{let t=[],n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r];t.push([i,e[i]])}return t},kn=e=>{let t={};for(let[n,r]of e)t[n]=r;return t},An=Object.prototype.hasOwnProperty,jn=(e,t)=>An.call(e,t),Mn=e=>{let t=Object.keys(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n},Nn=e=>{let t=Array.from(e);return t.length===0?Promise.resolve([]):Promise.all(t.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},Pn=e=>{let t=Array.from(e);return t.length===0?Promise.reject(AggregateError([],`All promises were rejected`)):new Promise((e,n)=>{let r=Array(t.length),i=t.length;t.forEach((t,a)=>{Promise.resolve(t).then(e,e=>{r[a]=e,--i,i===0&&n(AggregateError(r,`All promises were rejected`))})})})},Fn=(e,t)=>e.then(e=>Promise.resolve(t()).then(()=>e),e=>Promise.resolve(t()).then(()=>{throw e})),In=e=>{try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}},Ln=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},{NativeAbortSignal:Rn,NativeAbortController:zn}=function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}}(typeof self<`u`?self:global);function Bn(e){let t;try{t=new Event(`abort`)}catch{typeof document<`u`?document.createEvent?(t=document.createEvent(`Event`),t.initEvent(`abort`,!1,!1)):(t=document.createEventObject(),t.type=`abort`):t={type:`abort`,bubbles:!1,cancelable:!1}}return t.reason=e,t}function Vn(e){if(e===void 0)if(typeof document>`u`)e=Error(`This operation was aborted`),e.name=`AbortError`;else try{e=new DOMException(`signal is aborted without reason`),Object.defineProperty(e,"name",{value:`AbortError`})}catch{e=Error(`This operation was aborted`),e.name=`AbortError`}return e}class Hn{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;let n=this.listeners[e];for(let e=0,r=n.length;e<r;e++)if(n[e].callback===t){n.splice(e,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let t=this.listeners[e.type].slice();for(let n=0,r=t.length;n<r;n++){let r=t[n];try{r.callback.call(this,e)}catch(e){Promise.resolve().then(()=>{throw e})}r.options&&r.options.once&&this.removeEventListener(e.type,r.callback)}return!e.defaultPrevented}}class X extends Hn{constructor(){super(),this.listeners||Hn.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)}throwIfAborted(){let{aborted:e,reason:t=`Aborted`}=this;if(e)throw t}static timeout(e){let t=new Z;return setTimeout(()=>t.abort(new DOMException(`This signal is timeout in ${e}ms`,`TimeoutError`)),e),t.signal}static any(e){let t=new Z;function n(){t.abort(this.reason),r()}function r(){for(let t of e)t.removeEventListener(`abort`,n)}for(let r of e)if(r.aborted){t.abort(r.reason);break}else r.addEventListener(`abort`,n);return t.signal}}class Z{constructor(){Object.defineProperty(this,"signal",{value:new X,writable:!0,configurable:!0})}abort(e){let t=Vn(e),n=Bn(t);this.signal.reason=t,this.signal.dispatchEvent(n)}toString(){return`[object AbortController]`}}typeof Symbol<`u`&&Symbol.toStringTag&&(Z.prototype[Symbol.toStringTag]=`AbortController`,X.prototype[Symbol.toStringTag]=`AbortSignal`);function Un(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 Wn(e){typeof e==`function`&&(e={fetch:e});let{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!Un({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:a};let a=n;(a&&!a.prototype.hasOwnProperty(`signal`)||i)&&(a=function(e,t){let r;t&&t.signal&&(r=t.signal,delete t.signal);let i=new n(e,t);return r&&Object.defineProperty(i,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),i},a.prototype=n.prototype);let o=t;return{fetch:(e,t)=>{let n=a&&a.prototype.isPrototypeOf(e)?e.signal:t?t.signal:void 0;if(n){let r;try{r=new DOMException(`Aborted`,`AbortError`)}catch{r=Error(`Aborted`),r.name=`AbortError`}if(n.aborted)return Promise.reject(r);let i=new Promise((e,t)=>{n.addEventListener(`abort`,()=>t(r),{once:!0})});return t&&t.signal&&delete t.signal,Promise.race([i,o(e,t)])}return o(e,t)},Request:a}}var Q=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window,$=`fetch`in Q&&Un({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}),Gn=$?Wn({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}):void 0,Kn=$?Gn.fetch:Q.fetch,qn=$?Gn.Request:Q.Request,Jn=$?Z:Q.AbortController,Yn=$?X:Q.AbortSignal,Xn=(e,t)=>{let n=e.length,r=t>=0?t:n+t;if(r<0||r>=n)return;let i=e.charCodeAt(r);if(i>=55296&&i<=56319&&r+1<n){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343)return e[r]+e[r+1]}return e[r]};function*Zn(e,t){let n=t.flags.includes(`g`)?t.flags:t.flags+`g`,r=new RegExp(t.source,n),i;for(;(i=r.exec(e))!==null;)yield i,i[0].length===0&&r.lastIndex++}var Qn=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},$n=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return n.repeat(Math.ceil(r/n.length)).slice(0,r)+e},er=(e,t,n)=>{if(typeof t==`string`){if(typeof n==`string`)return t===``?n+e.split(``).join(n)+n:e.split(t).join(n);let r=[],i=0,a=e.indexOf(t,i);for(;a!==-1;)r.push(e.slice(i,a)),r.push(n(t,a,e)),i=a+t.length,a=e.indexOf(t,i);return r.push(e.slice(i)),r.join(``)}let r=t.flags.includes(`g`)?t.flags:t.flags+`g`,i=new RegExp(t.source,r);return e.replace(i,n)},tr=e=>e.replace(/^\s+/,``),nr=e=>e.replace(/\s+$/,``),rr=tr,ir=nr,ar=(e,t)=>typeof e==`string`?Xn(e,t):_n(e,t),or=(e,t={})=>{let n=t.timeout||1,r=performance.now();return Q.setTimeout(()=>{e({get didTimeout(){return t.timeout?!1:performance.now()-r-1>n},timeRemaining(){return Math.max(0,1+(performance.now()-r))}})},1)},sr=e=>Q.clearTimeout(e),cr=e=>typeof e==`function`&&e?.toString().endsWith(`{ [native code] }`),lr=!cr(Q.requestIdleCallback)||!cr(Q.cancelIdleCallback),ur=lr?or:Q.requestIdleCallback,dr=lr?sr:Q.cancelIdleCallback,fr=(e,t,n)=>typeof e==`string`?e.includes(t,n):Sn(e,t,n),pr=(e,t,n)=>{if(typeof e.canParse==`function`)return e.canParse(t,n);try{return new e(t,n),!0}catch{return!1}};
|
|
6
|
+
function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}var t=e;function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol._oxc_toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@_oxc_toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}var t=e,r=n;function i(e){var n=r(e,`string`);return t(n)==`symbol`?n:n+``}var a=i;function o(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=o;function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){u(a,r,i,o,s,`next`,e)}function s(e){u(a,r,i,o,s,`throw`,e)}o(void 0)})}}var f=l,p=d;let m;var h=Object.defineProperty,ee=Object.getOwnPropertyNames,te=Object.getOwnPropertyDescriptor,ne=Object.prototype.hasOwnProperty;function g(e){return this[e]}var _=e=>{var t=(v??=new WeakMap).get(e),n;if(t)return t;if(t=h({},`__esModule`,{value:!0}),e&&typeof e==`object`||typeof e==`function`)for(var r of ee(e))ne.call(t,r)||h(t,r,{get:g.bind(e,r),enumerable:!(n=te(e,r))||n.enumerable});return v.set(e,t),t},v,re=e=>e;function ie(e,t){this[e]=re.bind(null,t)}var y=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0,configurable:!0,set:ie.bind(t,n)})},b={};y(b,{withoutNullable:()=>fe,videoSizeToQuality:()=>tt,videoQualityToHeight:()=>nt,videoHeightToQuality:()=>et,urlCanParsePolyfilled:()=>Br,timeout:()=>ht,timeCodeToString:()=>st,throttleFn:()=>lt,throttle:()=>Dt,tap:()=>Ht,suppressAbort:()=>an,stringTrimStart:()=>Or,stringTrimRight:()=>jr,stringTrimLeft:()=>Ar,stringTrimEnd:()=>kr,stringReplaceAll:()=>Dr,stringPadStart:()=>Er,stringPadEnd:()=>Tr,stringMatchAll:()=>wr,stringAt:()=>Cr,skip:()=>Wt,shareReplay:()=>Kt,safeStorage:()=>Be,retainTimers:()=>Pe,requestIdleCallbackPolyfilled:()=>Lr,releaseTimers:()=>Fe,promiseWithResolvers:()=>ur,promiseTry:()=>lr,promiseFinally:()=>cr,promiseAny:()=>sr,promiseAllSettled:()=>or,pairwise:()=>Bt,once:()=>zt,observeElementSize:()=>Jt,observableFrom:()=>vt,objectValues:()=>ar,objectHasOwn:()=>ir,objectFromEntries:()=>nr,objectEntries:()=>tr,nowInt:()=>_e,now:()=>k,noop:()=>C,merge:()=>mt,mapTo:()=>Rt,map:()=>It,loadVKLangPack:()=>xn,isValidURL:()=>Zt,isNullable:()=>D,isNonNullable:()=>E,isLowerOrEqual:()=>Ze,isLower:()=>V,isInvariantQuality:()=>H,isIntersecting:()=>Qt,isHigherOrEqual:()=>Xe,isHigher:()=>Ye,isBrowserWindow:()=>ge,isAbortError:()=>rn,interval:()=>gt,interpolate:()=>tn,includesPolyfilled:()=>zr,globalThisPolyfill:()=>er,getWindow:()=>O,getVideoQualityLabel:()=>at,getTraceSubscriptionMethod:()=>sn,getTimersDiagnostics:()=>Ie,getTimerWindow:()=>he,getRangeAroundIndex:()=>nn,getPlayerId:()=>en,getMessageFromError:()=>on,getHighestQuality:()=>Qe,getExponentialDelay:()=>ze,fromEvent:()=>yt,flattenObject:()=>Yt,filterChanged:()=>Nt,filter:()=>kt,fillWithDefault:()=>ot,fetchPolyfilled:()=>yr,devNull:()=>En,detectEmbed:()=>qe,debounceFn:()=>ct,debounce:()=>wt,createTimers:()=>Me,createDIContainer:()=>In,combine:()=>pt,cloneDeepWith:()=>U,cloneDeep:()=>ut,clearVideoElement:()=>Xt,checkNever:()=>oe,cancelIdleCallbackPolyfilled:()=>Rr,buffer:()=>xt,atPolyfilled:()=>Mr,assertQualityIsExact:()=>it,assertNullable:()=>de,assertNotEmptyArray:()=>pe,assertNonNullable:()=>ue,assertNever:()=>S,assertEmptyArray:()=>me,arrayWith:()=>$n,arrayToSpliced:()=>Qn,arrayToSorted:()=>Zn,arrayToReversed:()=>Xn,arrayIncludes:()=>Yn,arrayFlatMap:()=>Jn,arrayFlat:()=>qn,arrayFindLastIndex:()=>Kn,arrayFindLast:()=>Gn,arrayAt:()=>Wn,areQualitiesExact:()=>rt,addScript:()=>Le,abortable:()=>Re,WorkerState:()=>Se,VolumeFaderPlugin:()=>Bn,VideoQuality:()=>Je,ValueSubject:()=>ft,VKNumericLanguage:()=>yn,VERSION:()=>ae,TracerFactory:()=>gn,TimerModule:()=>xe,SubscriptionRemovable:()=>bt,Subscription:()=>x,Subject:()=>T,RequestPolyfilled:()=>br,ReplaySubject:()=>dt,Observable:()=>w,NormalizerPlugin:()=>Un,Logger:()=>le,InternalsExposure:()=>Tn,InterfaceLanguage:()=>wn,InjectionToken:()=>Fn,INTERNAL_EXPOSE_GLOBAL_KEY:()=>K,ErrorOrigin:()=>_n,ErrorCategory:()=>vn,EqualizerPlugin:()=>Y,CircularBuffer:()=>W,AudioGraph:()=>zn,AppTracer:()=>J,AbortSignalPolyfilled:()=>Sr,AbortControllerPolyfilled:()=>xr}),module.exports=_(b);var ae=`1.0.100-dev.ed76c949d.0`;class x{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(e=>{typeof e==`function`?e():e.unsubscribe()})}add(e){return this.subscriptions.push(e),this}}var S=e=>{throw Error(`${e} is value of unexpected type`)},oe=e=>{},C=()=>{},se=e=>{throw console.error(e),e},ce=e=>{console.error(e)};class w{constructor(e){this.suppressErrors=!1,e&&(this._subscribe=e)}setSuppressErrors(e){this.suppressErrors=e}subscribe(e,t){let n=this.suppressErrors?ce:se,r;r=t?typeof t==`function`?{next:t,error:C}:{next:e=>t.next(e),error:e=>t.error?.call(t,e)}:{next:n,error:C};let i=typeof e==`function`?{next:t=>{try{let n=e(t);n instanceof Promise&&n.catch(e=>r.next(e))}catch(e){r.next(e)}},error:e=>r.next(e)}:{next:t=>e.next(t),error:t=>e.error?e.error(t):r.next(t)},a;try{a=this._subscribe(i)}catch(e){i.error?.call(i,e)}return new x().add(()=>{switch(i.next=C,i.error=C,typeof a){case`function`:a();return;case`object`:a.unsubscribe();return;case`undefined`:return;default:return S(a)}})}pipe(...e){return e.reduce((e,t)=>t(e),this)}_subscribe(e){}}class T extends w{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>t.error?.call(t,e))}_subscribe(e){let t=this.keyCounter++;return this.subscribers.set(t,e),new x().add(()=>this.subscribers.delete(t))}}class le{constructor(){this.log$=new T,this.logs=[],this.log=e=>{let t=f(f({},e),{},{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch{n={message:"error in `createCustomLog`",component:`Logger`}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>f({component:e},t))}}function ue(e,t=`Assertion "value is not nullable" failed`){if(e==null)throw Error(t)}function de(e,t=`Assertion "value is nullable" failed`){if(e!=null)throw Error(t)}function E(e){return e!=null}function D(e){return e==null}var fe=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>E(t)));function pe(e,t){if(!e?.length)throw Error(t)}function me(e,t){if(e?.length)throw Error(t)}var O=()=>globalThis,he=()=>globalThis,ge=(e=O())=>!!(e.window&&e.screen),k=typeof O().performance?.now==`function`?()=>O().performance.now():()=>Date.now(),_e=()=>Math.trunc(k());function ve(){var e=self,t=new Map;e.onmessage=function(n){var r=n.data;if(r.type===`ping`){e.postMessage({type:`ready`});return}if(r.type===`set`){var i=r.id;r.repeat?t.set(i,{repeat:!0,handle:e.setInterval(function(){e.postMessage({type:`tick`,id:i})},r.delay)}):t.set(i,{repeat:!1,handle:e.setTimeout(function(){t.delete(i),e.postMessage({type:`tick`,id:i})},r.delay)});return}var a=t.get(r.id);a&&(a.repeat?e.clearInterval(a.handle):e.clearTimeout(a.handle),t.delete(r.id))}}var ye=()=>`'use strict';(${ve.toString()})();`;class be{constructor(e,t){this.worker=void 0,this.handlers=void 0,this.records=new Map,this.ticks=0,this.handleMessage=e=>{if(e.data.type===`ready`){this.handlers.onReady();return}let{id:t}=e.data,n=this.records.get(t);D(n)||(this.ticks++,n.repeat||this.records.delete(t),n.callback())},this.handleError=()=>{this.handlers.onFatalError(this.destroy())},this.worker=e,this.handlers=t,this.worker.onmessage=this.handleMessage,this.worker.onerror=this.handleError,this.worker.onmessageerror=this.handleError,this.postCommand({type:`ping`})}static create(e){let t=O();if(typeof t.Worker!=`function`||typeof t.Blob!=`function`||D(t.URL?.createObjectURL))return null;let n=t.URL.createObjectURL(new t.Blob([ye()],{type:`text/javascript`}));try{return new be(new t.Worker(n),e)}catch{return null}finally{t.URL.revokeObjectURL(n)}}get activeCount(){return this.records.size}get deliveredTicks(){return this.ticks}set(e,t,n,r){this.records.set(e,{callback:t,repeat:r,delay:n,startedAt:k()}),this.postCommand({type:`set`,id:e,delay:n,repeat:r})}clear(e){this.records.delete(e)&&this.postCommand({type:`clear`,id:e})}destroy(){let e=new Map(this.records);return this.records.clear(),this.worker.onmessage=null,this.worker.onerror=null,this.worker.onmessageerror=null,this.worker.terminate(),e}postCommand(e){this.worker.postMessage(e)}}var xe;(e=>{e.SHARED=`shared`,e.CORE=`core`,e.STATISTICS=`statistics`,e.INTERACTIVE=`interactive`,e.UI=`ui`,e.UI_TV=`ui-tv`})(xe||={});var Se;(e=>{e.IDLE=`idle`,e.STARTING=`starting`,e.READY=`ready`,e.FAILED=`failed`})(Se||={});var Ce=1,A=0,j=`idle`,M=null,N=new Map,P=new Set,we=e=>{let t=k();for(let[n,r]of e){let e=r.repeat?r.delay:Math.max(0,r.delay-(t-r.startedAt));ke(n,r.callback,e,r.repeat)}},Te=e=>{j=`failed`,M=null,we(e)},Ee=()=>{D(M)||(we(M.destroy()),M=null),j=`idle`},De=()=>{j===`idle`&&(j=`starting`,M=be.create({onReady:()=>{j=`ready`},onFatalError:Te}))},Oe=e=>P.has(e)?(De(),j===`ready`?M:null):null,ke=(e,t,n,r)=>{let i=he();r?N.set(e,{repeat:!0,nativeId:i.setInterval(t,n)}):N.set(e,{repeat:!1,nativeId:i.setTimeout(()=>{N.delete(e),t()},n)})},Ae=(e,t,n,r)=>{let i=Ce++,a=Oe(e);return D(a)?ke(i,t,n,r):a.set(i,t,n,r),i},je=e=>{if(D(e))return;let t=N.get(e);if(D(t)){M?.clear(e);return}N.delete(e);let n=he();t.repeat?n.clearInterval(t.nativeId):n.clearTimeout(t.nativeId)},Me=e=>({setTimeout:(t,n=0)=>Ae(e,t,n,!1),setInterval:(t,n=0)=>Ae(e,t,n,!0),clearTimeout:je,clearInterval:je}),Ne=e=>{P.clear(),e.forEach(e=>P.add(e)),P.size===0&&Ee()},Pe=e=>{A++,Ne(e)},Fe=()=>{A!==0&&(A--,A===0&&Ne([]))},Ie=()=>({workerModules:[...P],workerState:j,liveConsumers:A,activeWindowTimers:N.size,activeWorkerTimers:M?.activeCount??0,workerTicks:M?.deliveredTicks??0}),F=Me(`shared`),Le=(e,t,n)=>new Promise((r,i)=>{t.addEventListener(`abort`,()=>{s(),l.remove()});let a=()=>{s(),i(`error`)},o=()=>{s(),r()},s=()=>{c&&F.clearTimeout(c),l.removeEventListener(`load`,o),l.removeEventListener(`error`,a)},c;n&&(c=F.setTimeout(()=>{s(),i(`timeout`)},n));let l=document.createElement(`script`);l.addEventListener(`load`,o),l.addEventListener(`error`,a),l.src=e,document.head.appendChild(l)}),Re=(e,t)=>p(function*(...n){let r=t(...n),i=e.aborted,a;for(;!i&&!e.aborted;)try{let e=yield r.next(a);i=e.done??!1,a=e.value}catch(e){yield r.throw(e)}return a}),ze=(e,{start:t=0,factor:n=2,max:r=1/0,min:i=t,random:a=0}={})=>{let o=t;return o*=n**+e,o*=1+(Math.random()*a*2-a),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,i),o},Be={};y(Be,{set:()=>Ue,remove:()=>Ge,isPersistent:()=>Ve,has:()=>We,get:()=>He,clear:()=>Ke});var I,L,R=`vk-videoplayer-dummy-key-${Math.random()}`,z=()=>{if(L!==void 0)return L;try{localStorage.setItem(R,`test`),localStorage.removeItem(R),L=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(R),L=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)L=2;else throw e}else throw e}return L===2&&(I=new Map),L},Ve=()=>z()===0,He=e=>{let t=z();switch(t){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return I?.get(e);default:S(t)}},Ue=(e,t)=>{let n=z();switch(n){case 0:try{localStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 1:try{sessionStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 2:I?.set(e,t);return;default:S(n)}},We=e=>{let t=z();switch(t){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return I?.has(e)??!1;default:return S(t),!1}},Ge=e=>{let t=z();switch(t){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:I?.delete(e);return;default:S(t)}},Ke=()=>{let e=z();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return I?.clear();default:S(e)}},qe=()=>{let e,t=[],n=O();try{e=n.self!==n.top}catch(t){t instanceof DOMException&&t.name===`SecurityError`?e=!0:(e=!1,console.error(t))}try{n.location?.ancestorOrigins&&(t=[...n.location.ancestorOrigins])}catch(e){console.error(e)}try{!t.length&&n.document.referrer&&(t=[new URL(n.document.referrer).origin])}catch(e){console.error(e)}return t=t.filter(e=>URL.canParse(e)),{isEmbed:e,origins:t,topOrigin:t.at(-1),immediateOrigin:t.at(0)}},Je;(e=>{e.INVARIANT=`Invariant quality`,e.Q_144P=`144p`,e.Q_240P=`240p`,e.Q_360P=`360p`,e.Q_480P=`480p`,e.Q_576P=`576p`,e.Q_720P=`720p`,e.Q_1080P=`1080p`,e.Q_1440P=`1440p`,e.Q_2160P=`2160p`,e.Q_4320P=`4320p`})(Je||={});var B={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},Ye=(e,t)=>B[e].height>B[t].height,Xe=(e,t)=>B[e].height>=B[t].height,V=(e,t)=>B[e].height<B[t].height,Ze=(e,t)=>B[e].height<=B[t].height,Qe=e=>e.sort((e,t)=>e===t?0:e===`Invariant quality`?1:t===`Invariant quality`?-1:V(e,t)?1:-1)[0],$e=Object.keys(B).sort((e,t)=>V(e,t)?-1:1),et=(e,t=.02)=>[...$e].find(n=>B[n].height*(1+t)>=e),tt=({width:e,height:t})=>{let n=Math.min(e,t),r=Math.max(e,t);return $e.find(e=>{let t=B[e];return t.width>=r&&t.height>=n})},nt=e=>B[e].height,H=e=>e===`Invariant quality`,rt=e=>e.every(e=>!H(e));function it(e){if(H(e))throw Error(`Expected exact quality`)}var at=e=>{switch(e){case`4320p`:return`8K`;case`2160p`:return`4K`;case`1440p`:return`QHD`;case`1080p`:return`FHD`;case`720p`:return`HD`;default:return``}},ot=(e,t)=>{let n={};for(let r of Object.keys(t)){let i=t[r],a=e[r];Array.isArray(i)?n[r]=Array.isArray(a)?a:i:typeof i==`object`&&i?typeof a==`object`&&a&&!Array.isArray(a)?n[r]=ot(a,i):n[r]=a??i:n[r]=r in e?a:i}return n},st=e=>{let t=``;return e>=3600&&(t+=Math.floor(e/3600)+`h`,e%=3600),e>=60&&(t+=Math.floor(e/60)+`m`,e%=60),e>0&&(t+=Math.floor(e)+`s`),t};function ct(e,t=0,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&typeof O().requestAnimationFrame==`function`;n&&(u=!!n.leading,d=`maxWait`in n,a=n?.maxWait?Math.max(+n?.maxWait||0,t):a,f=`trailing`in n?!!n.trailing:f);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(s&&O().cancelAnimationFrame(s),O().requestAnimationFrame(e)):F.setTimeout(e,t)}function ee(e){if(p){O().cancelAnimationFrame(e);return}F.clearTimeout(e)}function te(e){return l=e,s=h(_,t),u?m(e):o}function ne(e){let n=e-c,r=e-l,i=t-n;return d?Math.min(i,a-r):i}function g(e){let n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){let e=Date.now();if(g(e))return v(e);s=h(_,ne(e))}function v(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function re(){s!==void 0&&ee(s),l=0,r=c=i=s=void 0}function ie(){return s===void 0?o:v(Date.now())}function y(){return s!==void 0}function b(...e){let n=Date.now(),a=g(n);if(r=e,i=this,c=n,a){if(s===void 0)return te(c);if(d)return s=h(_,t),m(c)}return s===void 0&&(s=h(_,t)),o}return b.cancel=re,b.flush=ie,b.pending=y,b}var lt=(e,t=0,n)=>ct(e,t,f(f(f({},{leading:!0,trailing:!0}),n),{},{maxWait:t})),U=(e,t)=>{if(typeof e!=`object`||!e)return e;let n=Array.isArray(e)?[]:{};for(let r in e){if(typeof t==`function`){let i=t(e[r],r,e,n);if(i!==void 0){n[r]=i;continue}}typeof e[r]==`object`?n[r]=U(e[r],t):n[r]=e[r]}return n},ut=e=>U(e);class dt extends T{constructor(e){super(),this.bufferSize=void 0,this.buffer=[],this.cursorEnd=-1,this.cursorStart=0,this.bufferSize=e,this.buffer=Array(e)}next(e){this.cursorEnd+=1,this.cursorStart=this.cursorEnd>=this.bufferSize?this.cursorStart+1:0,this.buffer[this.cursorEnd%this.bufferSize]=e,this.subscribers.forEach(t=>t.next(e))}_subscribe(e){for(let t=this.cursorStart;t<=this.cursorEnd;t++)e.next(this.buffer[t%this.bufferSize]);let t=this.keyCounter++;return this.subscribers.set(t,e),new x().add(()=>this.subscribers.delete(t))}}class ft extends T{constructor(e){super(),this.value=void 0,this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){let t=super._subscribe(e);return e.next(this.value),t}}function pt(e){return new w(t=>{let n={},r=Object.keys(e).length,i=e=>i=>{e in n||r--,n[e]=i,r===0&&t.next(n)};return Object.entries(e).reduce((e,[t,n])=>e.add(n.subscribe(i(t))),new x)})}function mt(...e){return new w(t=>e.reduce((e,n)=>e.add(n.subscribe(t)),new x))}var ht=e=>new w(t=>{let n=F.setTimeout(()=>{try{t.next()}catch(e){if(t.error)t.error(e);else throw e}},e);return()=>F.clearTimeout(n)}),gt=e=>new w(t=>{let n=F.setInterval(()=>t.next(),e);return()=>{n&&=(F.clearInterval(n),void 0)}});function _t(e){return new w(t=>{if(e instanceof Promise){let n=!1;return e.then(e=>{n||t.next(e)}).catch(e=>{n||t.error?.call(t,e)}),()=>{n=!0}}for(let n=0;n<e.length;n++)t.next(e[n])})}var vt=_t,yt=(e,t)=>new w(n=>{let r=e=>n.next(e);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});class bt extends x{remove(e){this.subscriptions=this.subscriptions.filter(t=>t!==e)}}function xt(e){return t=>new w(n=>t.subscribe(new St(n,e)))}class St{constructor(e,t){this.destination=void 0,this.size=void 0,this.lastValues=[],this.destination=e,this.size=t}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t;(t=this.destination).error?.call(t,e)}}var Ct={leading:!1,trailing:!0};function wt(e,t=Ct){return n=>new w(r=>n.subscribe(new Tt(r,e,t)))}class Tt{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,E(this.timeout)?F.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=F.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(e){var t;(t=this.destination).error?.call(t,e)}}var Et={leading:!0,trailing:!1};function Dt(e,t=Et){return n=>new w(r=>n.subscribe(new Ot(r,e,t)))}class Ot{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,D(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=F.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var t;(t=this.destination).error?.call(t,e)}}function kt(e){return t=>new w(n=>t.subscribe(new At(n,e)))}class At{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}var jt=(e,t)=>{let n=(e,t)=>{let n=Object.keys(e);for(let r in t)if(!n.includes(r)||t[r]!==e[r])return!1;return!0};return n(e,t)&&n(t,e)},Mt=(e,t)=>e instanceof Object&&t instanceof Object?jt(e,t):e===t;function Nt(e=Mt){return t=>new w(n=>t.subscribe(new Ft(n,e)))}var Pt={};class Ft{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.lastValue=Pt,this.destination=e,this.predicate=t}next(e){let t;try{t=this.lastValue===Pt||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object&&!Array.isArray(e)?f({},e):e}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function It(e){return t=>new w(n=>t.subscribe(new Lt(n,e)))}class Lt{constructor(e,t){this.destination=void 0,this.mapper=void 0,this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(e){throw this.error(e),e}this.destination.next(t)}error(e){var t;(t=this.destination).error?.call(t,e)}}function Rt(e){return It(()=>e)}function zt(){return e=>new w(t=>{let n=!1,r=!1,i=e.subscribe(e=>{n||(n=!0,t.next(e)),r&&i.unsubscribe()},e=>{n=!0,t.error?.call(t,e),r&&i.unsubscribe()});return r=!0,n&&i.unsubscribe(),i})}function Bt(){return e=>new w(t=>e.subscribe(new Vt(t)))}class Vt{constructor(e){this.destination=void 0,this.last=void 0,this.hasLast=!1,this.destination=e}next(e){let t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t;(t=this.destination).error?.call(t,e)}}function Ht(e){return t=>new w(n=>t.subscribe(new Ut(n,e)))}class Ut{constructor(e,t){this.destination=void 0,this.effect=void 0,this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(e){throw this.error(e),e}this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function Wt(e){return t=>new w(n=>t.subscribe(new Gt(n,e)))}class Gt{constructor(e,t){if(this.destination=void 0,this.count=void 0,this.destination=e,this.count=t,t<0){var n;(n=this.destination).error?.call(n,Error(`Count can not be less than zero`))}}next(e){this.count===0?this.destination.next(e):this.count--}error(e){var t;(t=this.destination).error?.call(t,e)}}function Kt(e=0){return t=>{let n=0,r=new dt(e),i=t.subscribe(r),a=e=>()=>{e.unsubscribe(),n--,n===0&&i.unsubscribe()};return new w(e=>(n++,a(r.subscribe(e))))}}var qt=300,Jt=(e,t=qt)=>new w(n=>{let r=O(),{width:i,height:a}=e.getBoundingClientRect();if(n.next({width:i,height:a}),!ge(r))return;let o=new r.ResizeObserver(lt(e=>{let t=e[0];if(!t)return;let r,i;t.contentBoxSize&&t.contentBoxSize[0]?(i=t.contentBoxSize[0].blockSize,r=t.contentBoxSize[0].inlineSize):t.contentRect&&(r=t.contentRect.width,i=t.contentRect.height),E(r)&&E(i)&&n.next({width:r,height:i})},t));return o.observe(e),()=>o.disconnect()}),Yt=(e,t=6,n=`.`)=>{let r={};for(let i in e)if(!(!e.hasOwnProperty(i)||e[i]instanceof HTMLElement||!t))if(typeof e[i]==`object`&&e[i]!==null){let a=Yt(e[i],t-1);for(let e in a)a.hasOwnProperty(e)&&(r[i+n+e]=a[e])}else r[i]=e[i];return r},Xt=e=>{e.innerHTML=``,e.removeAttribute(`src`),e.load()},Zt=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`},Qt=(e,t)=>!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom),$t=(()=>{let e=0;return()=>{let t=e;return e=(e+1)%(2**53-1),t}})(),en=e=>e!==void 0&&e!==``?e:$t().toString();function tn(e,t,n){if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];let r=1;for(;r<t.length&&t[r]<e;)r++;r>=t.length&&(r=t.length-1);let i=t[r-1],a=t[r],o=n[r-1],s=n[r];return e===i?o:e===a?s:o+(e-i)/(a-i)*(s-o)}function nn(e,t,n){if(e<=0||n<0)return[];let r=[],i=Math.floor((e-1)/2),a=Math.floor(e/2),o=t-i,s=t+a;o<0&&(s+=Math.abs(o),o=0),s>n&&(o-=s-n,s=n),o=Math.max(0,o),s=Math.min(n,s);for(let e=o;e<=s;e++)r.push(e);return r}var rn=e=>e instanceof DOMException&&(e.name===`AbortError`||e.code===20),an=e=>{if(!rn(e))throw e};function on(e){if(e&&typeof e==`object`){if(`message`in e)return String(e.message);try{return JSON.stringify(e)}catch{return`object serialization error`}}return String(e)}m=Symbol.iterator;class W{constructor(e){if(this.buffer=void 0,this.writeIndex=0,this.count=0,this.capacity=void 0,e<=0)throw Error(`Capacity must be greater than 0`);this.capacity=e,this.buffer=Array.from({length:e}).fill(null)}add(e){this.buffer[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.count<this.capacity&&this.count++}*[m](){if(this.count===0)return;let e=this.count<this.capacity?0:this.writeIndex;for(let t=0;t<this.count;t++){let t=this.buffer[e];E(t)&&(yield t),e=(e+1)%this.capacity}}clear(){this.buffer.fill(null),this.writeIndex=0,this.count=0}get size(){return this.count}get maxCapacity(){return this.capacity}}var sn=e=>(t,n=!1)=>r=>{let i=typeof r==`object`;r==null||i&&!Object.keys(r).length||e(t,i?Yt(r):{value:r},n)},cn=(e={})=>{let t=e=>{let t=e;return e===void 0?t=`undefined`:e===null?t=`null`:(typeof e==`number`||typeof e==`boolean`)&&(t=e.toString()),t},n={};for(let r in e)Array.isArray(e[r])?n[r]=e[r].map(t):n[r]=t(e[r]);return n};class G{constructor({name:e,getParentContext:t,getRootTracerContext:n,options:r}){this.dynamicImportTimeout=5e3,this.subscription=new x,this.options=void 0,this.span=void 0,this.context=void 0,this.childTracers=[],this.initPromise=void 0,this.getRootTracerContext=void 0,this.eventsBuffer=null,this.options=r??{};let{tracerEventsBufferSize:i}=this.options;E(i)&&i>0&&(this.eventsBuffer=new W(i)),G.dynamicImportStatus===`not_started`&&(G.dynamicImportPromise=this.loadOpentelemetry());let a=Date.now();this.initPromise=G.dynamicImportPromise.then(r=>{G.dynamicImportStatus===`completed`&&this.init({name:e,getParentContext:t,getRootTracerContext:n},a)})}init({name:e,getParentContext:t,getRootTracerContext:n},r){let i=n?.();if(D(i))return;let{opentelemetryApi:a}=G.dynamicImports,{context:o,trace:s}=a,{tracer:c,attributes$:l}=i;this.span=c.startSpan(e,{startTime:r},t?.()),this.context=s.setSpan(o.active(),this.span),this.getRootTracerContext=n,this.subscription.add(l.subscribe(e=>{E(e)&&this.span.setAttributes(e)}))}loadOpentelemetry(){var e=this;return p(function*(){if(G.dynamicImportStatus===`not_started`){G.dynamicImportStatus=`in_progress`;try{let t=new Promise((t,n)=>F.setTimeout(n,e.dynamicImportTimeout)),n=Promise.all([import(`@opentelemetry/api`),import(`@opentelemetry/sdk-trace-web`),import(`@apptracer/opentelemetry`),import(`@opentelemetry/resources`),import(`@opentelemetry/semantic-conventions`)]),[r,i,a,o,s]=yield Promise.race([n,t]);G.dynamicImports={opentelemetryApi:r,opentelemetrySdk:i,tracer:a,opentelemetryResources:o,opentelemetrySemanticConventions:s},G.dynamicImportStatus=`completed`}catch{G.dynamicImportStatus=`failed`}}})()}isComponentTracerNotInitialized(){return D(this.span)||G.dynamicImportStatus===`failed`}addEventToBuffer(e,t,n,r){E(this.eventsBuffer)&&this.eventsBuffer.add({name:e,attributes:t,type:n,timestamp:r})}addEventToSpan(e,t,n,r){this.span.addEvent(e,f(f({},cn(t)),{},{type:n}),r)}log(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`log`,r)}):this.addEventToBuffer(e,t,`log`,r)}error(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`error`,r)}):this.addEventToBuffer(e,t,`error`,r)}critical(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`critical`,r)}):this.addEventToBuffer(e,t,`critical`,r)}createComponentTracer(e){let t=new G({name:e,getParentContext:()=>this.context,getRootTracerContext:()=>this.getRootTracerContext?.call(this),options:this.options});return this.childTracers.push(t),t}setSpanAttributes(e){this.span.setAttributes(cn(e))}end(){this.initPromise.then(e=>{if(!this.isComponentTracerNotInitialized()){if(E(this.eventsBuffer))for(let e of this.eventsBuffer)this.addEventToSpan(e.name,e.attributes,e.type,e.timestamp);this.childTracers.forEach(e=>e.end()),this.span.end(),this.subscription.unsubscribe()}})}pause(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!0)}resume(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!1)}}G.dynamicImportStatus=`not_started`,G.dynamicImports=void 0,G.dynamicImportPromise=void 0;var ln=`gW5EerTD5QhAnsbpF7Hd2NSMRteYIUUMjFbSyI68Pf5`,un=e=>{class t extends e{constructor(e,t){super(e,t),this._isPaused=!1,this._pausedSpans=void 0,this.maxExportBatchSize=void 0,this.maxQueueSize=void 0,this.maxQueueSize=t?.maxQueueSize??2048,this.maxExportBatchSize=t?.maxExportBatchSize??512,this._pausedSpans=new W(this.maxQueueSize)}pause(){this._isPaused=!0}resume(){var e=()=>super.onEnd,t=this;return p(function*(){if(!t._isPaused)return;t._isPaused=!1;let n=t._pausedSpans;t._pausedSpans=new W(t.maxQueueSize);let r=0;for(let i of n)e().call(t,i),r+=1,r>=t.maxExportBatchSize&&(yield new Promise(e=>F.setTimeout(()=>e(void 0),0)),r=0);n.clear(),yield t.forceFlush()})()}onEnd(e){if(this._isPaused){this._pausedSpans.add(e);return}super.onEnd(e)}}return t};class dn extends G{constructor(e){super({name:`Root`,options:e}),this.attributes$=new ft(null),this.paused$=new ft(!1),this.paused$.next(!!this.options.tracerPausedAtInit)}init({name:e,getParentContext:t},n){let{tracer:r,opentelemetryResources:i,opentelemetrySdk:a,opentelemetrySemanticConventions:o}=G.dynamicImports,{TracerUploadSpanExporter:s}=r,{WebTracerProvider:c,BatchSpanProcessor:l}=a,{resourceFromAttributes:u}=i,{ATTR_SERVICE_NAME:d,ATTR_SERVICE_VERSION:f}=o,p=new(un(l))(new s({appToken:ln}));this.subscription.add(this.paused$.subscribe(e=>{e?p.pause():p.resume()}));let m=new c({resource:u({[d]:`videoplayer-sdk-web`,[f]:ae}),spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0},spanProcessors:[p]});m.register();let h=m.getTracer(`sdk-videoplayer-tracer`);super.init({name:e,getParentContext:t,getRootTracerContext:()=>({tracer:h,attributes$:this.attributes$,paused$:this.paused$})},n)}getTraceId(){return this.isComponentTracerNotInitialized()?``:this.span.spanContext().traceId}setSpanAttributes(e){this.attributes$.next(f(f({},this.attributes$.getValue()),cn(e)))}addSubscription(e){this.subscription.add(e)}}class fn{constructor(e){this.fakeTraceId=void 0}log(e,t,n){}error(e,t,n){}critical(e,t,n){}createComponentTracer(e){return new fn({name:e})}end(){}getTraceId(){return this.fakeTraceId}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}var pn=()=>!0,mn={level:0,filter:pn,name:`Noname Tracer`,outputMethod:`log`};class hn{constructor({name:e,level:t,filter:n,outputMethod:r}={}){this.name=void 0,this.filter=pn,this.level=mn.level,this.outputMethod=mn.outputMethod,this.childTracers=[],this.filter=n??this.filter,this.level=t??this.level,this.outputMethod=r??this.outputMethod,this.name=e??mn.name}log(e,t,n){this.logDebug(e,t)}error(e,t,n){this.logError(e,t)}critical(e,t,n){this.logError(e,t)}createComponentTracer(e){let t=new hn({filter:this.filter,level:this.level,name:`${this.name}/ ${e}`,outputMethod:this.outputMethod});return this.childTracers.push(t),t}end(){this.childTracers.forEach(e=>e.end()),this.childTracers=[]}setLevel(e){this.level=e,this.childTracers.forEach(t=>t.setLevel(e))}setOtputMethod(e){this.outputMethod=e,this.childTracers.forEach(t=>t.setOtputMethod(e))}setFilter(e){this.filter=e,this.childTracers.forEach(t=>t.setFilter(e))}getFinishedSpans(){}getTraceId(){return`debug_trace`}get verbose(){return this.level===0}createMessage(e,t){return[this.name,e,JSON.stringify(t)].join(`: `)}logDebug(e,t){!this.verbose||!this.filter(e,t)||O().console[this.outputMethod](this.createMessage(e,t))}logError(e,t){this.filter(e,t)&&O().console.error(this.createMessage(e,t))}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}class gn{static createRootTracer(e=`fake`,t){switch(e){case`real`:return new dn(t);case`debug`:return new hn;default:return new fn}}}var _n;(e=>{e.MediaError=`mediaError`,e.SegmentFetcher=`segment_fetcher`,e.Hangup=`hangup`,e.Stall=`stall`})(_n||={});var vn;(e=>{e.NETWORK=`network`,e.VIDEO_PIPELINE=`video_pipeline`,e.EXTERNAL_API=`external_api`,e.PARSER=`parser`,e.DOM=`dom`,e.WTF=`wtf`,e.UI=`ui`,e.CALL_FROM_EXTERNAL=`call_from_external`,e.FATAL=`fatal`})(vn||={});var yn;(e=>{e.Armenian=`58`,e.Azerbaijani=`57`,e.Belarusian=`114`,e.English=`3`,e.Kazakh=`97`,e.Portuguese=`73`,e.Russian=`0`,e.Spanish=`4`,e.Ukrainian=`1`,e.Uzbek=`65`,e.Vietnamese=`75`})(yn||={});var bn=`vk.ru`,xn=function(){var e=p(function*(e,t,n){let r=new URL(`https://${bn}/js/lang-pack.js`);return r.searchParams.set(`format`,`json`),r.searchParams.set(`name`,t),e!==void 0&&r.searchParams.set(`lang`,e),Sn(yield(yield fetch(r.toString())).json(),n)});return function(t,n,r){return e.apply(this,arguments)}}(),Sn=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([e,n])=>[e.substring(`${t}_`.length),Cn(n)])),Cn=e=>Array.isArray(e)?e[0]:e,wn;(e=>{e.RU=`ru`,e.EN=`en`})(wn||={});var K=`__vk_vp_internals_exposure`;class Tn{constructor(e,t){this.playerId=void 0,this.type=void 0,this.playerId=t,this.type=e,this.initWindowObjects()}getWindowObject(){var e;if(typeof window>`u`)return{};let t=this.playerId,n=this.type;return((e=window[K])==null||(e=e[t])==null?void 0:e[n])??{}}initWindowObjects(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[K]||(window[K]={}),window[K][e]||(window[K][e]={}),window[K][e][t]||(window[K][e][t]={})}expose(e){typeof window>`u`||Object.assign(this.getWindowObject(),e)}destroy(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[K]&&window[K][e]&&window[K][e][t]&&(delete window[K][e][t],Object.keys(window[K][e]).length||delete window[K][e],Object.keys(window[K]).length||delete window[K])}}var En={};y(En,{subscribe:()=>An,push:()=>kn,destroy:()=>On,create:()=>Dn});var q=new Map,Dn=(e,t)=>q.set(e,t??[]),On=e=>q.delete(e),kn=(e,t)=>{let n=q.get(e);n&&(typeof n==`function`?n(t):n.push(t))},An=(e,t)=>{let n=q.get(e);if(n){if(n&&Array.isArray(n))for(let e of n)t(e);q.set(e,t)}},jn=e=>fe({id:e.id,message:e.message,category:e.category,data:Mn(e.data),httpCode:e.httpCode,UVBackendErrorCode:e.UVBackendErrorCode});function Mn(e){switch(typeof e){case`boolean`:case`string`:case`number`:return e;case`object`:try{return JSON.stringify(e)}catch{return}default:return}}var Nn=e=>{let t=e.thrown instanceof Error?e.thrown:Error(e.message),n=e.id.length>10240?e.id.substring(0,10240):e.id;try{t.name=n}catch{t=Error(e.message),t.name=n}return t},Pn=()=>{try{var e;let{origin:t,pathname:n,search:r,hostname:i}=((e=O())==null||(e=e.document)==null?void 0:e.location)??{};return!i||i===`localhost`?void 0:f({url:t+n},new URLSearchParams(r).entries().reduce((e,[t,n])=>(e[`url.${t}`]=n,e),{}))}catch{}};class J{constructor(e,t,n,r){this.dynamicImportTimeout=5e3,this.componentName=void 0,this.subscription=new x,this.options=void 0,this.envParams=void 0,this.context=void 0,this.isEmbed=void 0,this.embedParent=void 0,this.beforeInitErrors=[],this.componentName=e,this.options=t,this.envParams=n,this.context=f({},r);let{isEmbed:i,topOrigin:a}=qe();this.isEmbed=i,this.embedParent=a?new URL(a).hostname:void 0,this.options.enabled&&(this.loadModule(),this.init())}updateContext(e){Object.assign(this.context,e)}error(e,t){let n=J.tracerErrorMap.get(this.componentName);if(!n){this.beforeInitErrors.push([e,t]);return}let{blackErrorCategoryList:r,blackErrorIdList:i,sampleRate:a,whiteErrorCategoryList:o,whiteErrorIdList:s}=this.options,{id:c,category:l}=e;if(!(r.length&&r.includes(l)||i.length&&i.includes(c)||o.length&&!o.includes(l)||s.length&&!s.includes(c)||Math.random()>=a))try{let r=Nn(e);n?.error(r,f(f({crashIdSource:t?.crashIdSource??r.name,severity:t?.severity??(e.traceAsLog?`debug`:void 0)},t?.issueKey?{issueKey:t.issueKey}:{}),{},{keys:f(f(f(f({},this.context),jn(e)),Pn()),this.isEmbed&&this.embedParent&&{iframe_host:this.embedParent})}))}catch(e){console.error(e)}}addSubscription(e){this.subscription.add(e)}destroy(){this.subscription.unsubscribe()}init(){var e=this;return p(function*(){try{if(yield J.loadPromise,J.tracerErrorMap.has(e.componentName)||D(J.appTracerModule))return;let{appTracerModule:t}=J,{initTracerError:n,initTracerErrorUploader:r,getTracerModules:i}=t,a=i(e.componentName),o=!a.error,s=a.error??n(e.componentName,{enableUnhandledErrorsListeners:!1,stringifyErrorDataObject:!0});E(e.options.userId)&&s.setUserId(e.options.userId),o&&r(e.componentName,{appToken:ln,environment:e.envParams.env,versionCode:1,versionName:e.envParams.version}),J.tracerErrorMap.set(e.componentName,s),e.beforeInitErrors.forEach(t=>e.error.apply(e,t)),e.beforeInitErrors=[]}catch(e){console.error(e)}})()}loadModule(){var e=this;E(J.loadPromise)||(J.loadPromise=function(){var t=p(function*(){try{let t=new Promise((t,n)=>F.setTimeout(n,e.dynamicImportTimeout));J.appTracerModule=yield Promise.race([t,import(`@apptracer/sdk/lite`)])}catch(e){J.loadPromise=null,console.error(e)}});return function(){return t.apply(this,arguments)}}()())}}J.tracerErrorMap=new Map,J.appTracerModule=null,J.loadPromise=null;class Fn{constructor(e,t){this.options=void 0,this.symbol=void 0,this.options=t,this.symbol=Symbol(e)}}var In=()=>{let e=new Map,t=new Map,n=new Map,r=new Map,i=new Set;return{resolve(e){if(!r.has(e)){let t=n.get(e);if(!t)throw Error(`No constructor registered in DI container for ${e.name}`);r.set(e,new t)}return r.get(e)},resolveOptional(e){try{return this.resolve(e)}catch{return}},replace(e,t){r.forEach((t,n)=>{t instanceof e&&r.delete(n)}),n.set(e,t)},getToken(n){if(e.has(n.symbol))return e.get(n.symbol);if(t.has(n.symbol)){let r=t.get(n.symbol)();return e.set(n.symbol,r),r}if(n.options?.factory){let t=n.options.factory();return e.set(n.symbol,t),t}throw Error(`No value registered in DI container for token "${n.symbol.description}"`)},registerToken(t,n){e.set(t.symbol,n)},registerFactory(e,n){t.set(e.symbol,n)},hasToken(n){return e.has(n.symbol)||t.has(n.symbol)||!!n.options?.factory},registerCleanup(e){i.add(e)},clear(){i.forEach(e=>e()),i.clear(),e.clear(),t.clear(),r.clear(),n.clear()}}};class Ln{constructor(e){this._inputNode=void 0,this._outputNode=void 0,this._plugins=[],this._destination=null,this._taps=[],this._inputNode=e.createGain(),this._outputNode=e.createGain()}get input(){return this._inputNode}get plugins(){return this._plugins}connectTo(e){this._destination=e,this.rebuild()}addTap(e){this._taps.push(e),this._outputNode.connect(e)}hasPlugin(e){return this._plugins.some(t=>t.id===e)}addPlugin(e){this.hasPlugin(e.id)||(this._plugins.push(e),this.rebuild())}removePlugin(e){let t=this._plugins.findIndex(t=>t.id===e);t!==-1&&(this._plugins.splice(t,1),this.rebuild())}rebuild(){this._inputNode.disconnect();for(let e of this._plugins)e.outputNode.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._plugins)e.connect(t.inputNode),e=t.outputNode;e.connect(this._outputNode),this._destination!==null&&this._outputNode.connect(this._destination);for(let e of this._taps)this._outputNode.connect(e)}}class Rn{constructor(e,t,n){this._pluginChain=void 0,this._element=void 0,this._ctx=void 0,this._sourceNode=null,this._isBound=!1,this._element=e,this._ctx=t,this._pluginChain=new Ln(t),this._pluginChain.connectTo(n)}get isBound(){return this._isBound}get plugins(){return this._pluginChain.plugins}bind(){this._isBound||=(this._sourceNode===null&&(this._sourceNode=this._ctx.createMediaElementSource(this._element)),this._sourceNode.disconnect(),this._sourceNode.connect(this._pluginChain.input),!0)}unbind(){this._isBound&&=(this._sourceNode?.disconnect(),this._sourceNode?.connect(this._ctx.destination),!1)}addPlugin(e){this._pluginChain.addPlugin(e)}removePlugin(e){this._pluginChain.removePlugin(e)}addAnalyser(e){this._pluginChain.addTap(e)}}class zn{constructor(){this._ctx=null,this._masterGain=null,this._connections=new Map,this._contextEnabled=!1,this._boundBeforeDisable=new Set}static isSupported(){let e=O();return E(e.AudioContext??e.webkitAudioContext)}get context(){if(D(this._ctx)){let e=O(),t=e.AudioContext??e.webkitAudioContext;this._ctx=new t}return this._ctx}get contextState(){return this._contextEnabled?this._ctx?.state??`suspended`:`suspended`}enableContext(){var e=this;return p(function*(){e.ensureContext(),yield e._ctx?.resume(),e._contextEnabled=!0;for(let t of e._boundBeforeDisable)e._connections.get(t)?.bind();e._boundBeforeDisable.clear()})()}disableContext(){var e=this;return p(function*(){e._contextEnabled=!1;for(let[t,n]of e._connections)n.isBound&&(e._boundBeforeDisable.add(t),n.unbind())})()}connectSource(e){var t=this;return p(function*(){t.ensureContext(),t._contextEnabled=!0,yield t._ctx?.resume();let n=t._connections.get(e);if(n!==void 0){n.isBound||n.bind();return}let r=new Rn(e,t.context,t._masterGain);r.bind(),t._connections.set(e,r)})()}disconnectSource(e){this._connections.get(e)?.unbind()}isSourceConnected(e){return this._connections.get(e)?.isBound??!1}addPlugin(e,t){let n=this._connections.get(e);if(n===void 0)throw Error(`Source is not connected. Call connectSource() first.`);n.addPlugin(t)}removePlugin(e,t){this._connections.get(e)?.removePlugin(t)}getPlugins(e){return this._connections.get(e)?.plugins??[]}createAnalyser(e){let t=this._connections.get(e);if(t===void 0)return null;let n=this.context.createAnalyser();return n.fftSize=256,n.smoothingTimeConstant=.8,t.addAnalyser(n),n}setMasterVolume(e){this._masterGain!==null&&(this._masterGain.gain.value=e)}getMasterVolume(){return this._masterGain?.gain.value??1}dispose(){this._connections.clear(),this._boundBeforeDisable.clear(),this._masterGain=null,this._contextEnabled=!1,this._ctx?.close(),this._ctx=null}ensureContext(){let e=this.context;D(this._masterGain)&&(this._masterGain=e.createGain(),this._masterGain.gain.value=1,this._masterGain.connect(e.destination))}}class Bn{constructor(e,t){this.id=`volume-fader`,this._gainNode=void 0,this._duration=void 0,this._curve=void 0,this._fade=null,this._gainNode=e.createGain(),this._gainNode.gain.value=1,this._duration=t.duration,this._curve=t.curve??this._buildEasingCurve(t.duration/1e3)}get inputNode(){return this._gainNode}get outputNode(){return this._gainNode}get faded(){return this._fade!==null}appear(){this._startFade(0,1)}disappear(){this._startFade(1,0)}pause(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime,n=t-this._fade.startTime,r=Math.max(0,this._fade.remaining-n);if(r<=.001){this._finishFade();return}let i=this._sampleIndex(this._fade,t),a=this._fade.curve[i];e.cancelScheduledValues(t),e.setValueAtTime(a,t),this._fade={from:a,target:this._fade.target,startTime:t,remaining:r,curve:this._fade.curve.subarray(i)}}resume(){if(this._fade===null)return;let e=this._gainNode.context.currentTime,{from:t,target:n,remaining:r,curve:i}=this._fade;if(r<=.001||Math.abs(n-t)<.001||i.length<2){this._finishFade();return}this._fade={from:t,target:n,startTime:e,remaining:r,curve:i},this._scheduleCurve(i,t,e,r)}cancel(){this._fade!==null&&this._finishFade()}_finishFade(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime;e.cancelScheduledValues(t),e.setValueAtTime(this._fade.target,t),this._fade=null}_startFade(e,t){let n=this._gainNode.gain,r=this._gainNode.context.currentTime,i=this._duration/1e3;if(i<=0){n.cancelScheduledValues(r),n.setValueAtTime(t,r),this._fade=null;return}let a=new Float32Array(this._curve.length);for(let n=0;n<this._curve.length;n++)a[n]=e+(t-e)*this._curve[n];this._fade={from:a[0],target:t,startTime:r,remaining:i,curve:a},this._scheduleCurve(a,a[0],r,i)}_buildEasingCurve(e){let t=Math.max(2,Math.ceil(e*60)),n=new Float32Array(t);for(let e=0;e<t;e++){let r=e/(t-1);n[e]=(1-Math.cos(Math.PI*r))/2}return n}_scheduleCurve(e,t,n,r){let i=this._gainNode.gain;i.cancelScheduledValues(n),i.setValueAtTime(t,n),i.setValueCurveAtTime(e,n,r)}_sampleIndex(e,t){let n=t-e.startTime,r=Math.max(0,Math.min(1,n/e.remaining));return Math.min(Math.round(r*(e.curve.length-1)),e.curve.length-1)}}class Vn{constructor(e,t,n,r){this._filter=void 0,this._source=void 0,this._defaultGain=void 0,this.frequency=void 0,this.frequency=t,this._source=n,this._defaultGain=r,this._filter=e.createBiquadFilter(),this._filter.type=`peaking`,this._filter.frequency.value=t,this._filter.gain.value=0,this._filter.Q.value=1,this._source.connect(this._filter.gain)}get value(){return this._source.offset.value}get node(){return this._filter}set(e){this._source.offset.value=e}reset(){this.set(this._defaultGain)}dispose(){this._source.disconnect(this._filter.gain)}}class Y{constructor(e,t){this.id=`equalizer`,this._inputNode=void 0,this._outputNode=void 0,this._filterMap=new Map,this.equalizer=void 0,this._inputNode=e.createGain(),this._outputNode=e.createGain();let n=Object.entries(t).map(([e,t])=>[Number(e),t]).filter(([e])=>Number.isFinite(e)).sort((e,t)=>e[0]-t[0]),r=Y._sources.get(e);D(r)&&(r=new Map,Y._sources.set(e,r));for(let[t,i]of n)if(!r.has(t)){let n=e.createConstantSource();n.offset.value=i,n.start(),r.set(t,n)}let i={};for(let[t,a]of n){let n=r.get(t);if(!n)continue;let o=new Vn(e,t,n,a);this._filterMap.set(t,o),i[t]=o}this.equalizer=i,this.rebuild()}get inputNode(){return this._inputNode}get outputNode(){return this._outputNode}resetAll(){for(let e of this._filterMap.values())e.reset()}dispose(){for(let e of this._filterMap.values())e.dispose()}rebuild(){this._inputNode.disconnect();for(let e of this._filterMap.values())e.node.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._filterMap.values())e.connect(t.node),e=t.node;e.connect(this._outputNode)}}Y._sources=new WeakMap;var Hn=-14;class Un{constructor(e,t){this.id=`normalizer`,this._compressor=void 0,this._gainNode=void 0,this._compressor=e.createDynamicsCompressor(),this._gainNode=e.createGain(),this.applyConfig(t),this._compressor.connect(this._gainNode)}get inputNode(){return this._compressor}get outputNode(){return this._gainNode}applyConfig(e){if(!Number.isFinite(e.lufs)||!Number.isFinite(e.peak)){this._gainNode.gain.value=1;return}this._compressor.threshold.value=e.peak,this._compressor.knee.value=0,this._compressor.ratio.value=20,this._compressor.attack.value=.003,this._compressor.release.value=.25;let t=(e.targetLufs??Hn)-e.lufs;this._gainNode.gain.value=10**(t/20)}}var Wn=(e,t)=>{let n=e.length,r=t>=0?t:n+t;return r>=0&&r<n?e[r]:void 0},Gn=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}},Kn=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return n;return-1},qn=(e,t=1)=>{let n=[],r=(e,t)=>{for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i];t>0&&Array.isArray(a)?r(a,t-1):n.push(a)}};return r(e,t),n},Jn=(e,t)=>{let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);if(Array.isArray(i))for(let e=0;e<i.length;e++)n.push(i[e]);else n.push(i)}return n},Yn=(e,t,n=0)=>{let r=e.length,i=n>=0?n:Math.max(r+n,0);for(;i<r;i++){let n=e[i];if(n===t||n!==n&&t!==t)return!0}return!1},Xn=e=>{let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=e[t-1-r];return n},Zn=(e,t)=>{let n=e.slice();return t?n.sort(t):n.sort()},Qn=(e,t,n,...r)=>{let i=e.slice();return n===void 0?i.splice(t):i.splice(t,n,...r),i},$n=(e,t,n)=>{let r=e.length,i=t>=0?t:r+t,a=e.slice();return a[i]=n,a},er=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof self<`u`?self:Function(`return this`)(),tr=e=>{let t=[],n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r];t.push([i,e[i]])}return t},nr=e=>{let t={};for(let[n,r]of e)t[n]=r;return t},rr=Object.prototype.hasOwnProperty,ir=(e,t)=>rr.call(e,t),ar=e=>{let t=Object.keys(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n},or=e=>{let t=Array.from(e);return t.length===0?Promise.resolve([]):Promise.all(t.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},sr=e=>{let t=Array.from(e);return t.length===0?Promise.reject(AggregateError([],`All promises were rejected`)):new Promise((e,n)=>{let r=Array(t.length),i=t.length;t.forEach((t,a)=>{Promise.resolve(t).then(e,e=>{r[a]=e,--i,i===0&&n(AggregateError(r,`All promises were rejected`))})})})},cr=(e,t)=>e.then(e=>Promise.resolve(t()).then(()=>e),e=>Promise.resolve(t()).then(()=>{throw e})),lr=e=>{try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}},ur=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},{NativeAbortSignal:dr,NativeAbortController:fr}=function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}}(typeof self<`u`?self:global);function pr(e){let t;try{t=new Event(`abort`)}catch{typeof document<`u`?document.createEvent?(t=document.createEvent(`Event`),t.initEvent(`abort`,!1,!1)):(t=document.createEventObject(),t.type=`abort`):t={type:`abort`,bubbles:!1,cancelable:!1}}return t.reason=e,t}function mr(e){if(e===void 0)if(typeof document>`u`)e=Error(`This operation was aborted`),e.name=`AbortError`;else try{e=new DOMException(`signal is aborted without reason`),Object.defineProperty(e,"name",{value:`AbortError`})}catch{e=Error(`This operation was aborted`),e.name=`AbortError`}return e}class hr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;let n=this.listeners[e];for(let e=0,r=n.length;e<r;e++)if(n[e].callback===t){n.splice(e,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let t=this.listeners[e.type].slice();for(let n=0,r=t.length;n<r;n++){let r=t[n];try{r.callback.call(this,e)}catch(e){Promise.resolve().then(()=>{throw e})}r.options&&r.options.once&&this.removeEventListener(e.type,r.callback)}return!e.defaultPrevented}}class X extends hr{constructor(){super(),this.listeners||hr.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return`[object AbortSignal]`}dispatchEvent(e){e.type===`abort`&&(this.aborted=!0,typeof this.onabort==`function`&&this.onabort.call(this,e)),super.dispatchEvent(e)}throwIfAborted(){let{aborted:e,reason:t=`Aborted`}=this;if(e)throw t}static timeout(e){let t=new Z;return setTimeout(()=>t.abort(new DOMException(`This signal is timeout in ${e}ms`,`TimeoutError`)),e),t.signal}static any(e){let t=new Z;function n(){t.abort(this.reason),r()}function r(){for(let t of e)t.removeEventListener(`abort`,n)}for(let r of e)if(r.aborted){t.abort(r.reason);break}else r.addEventListener(`abort`,n);return t.signal}}class Z{constructor(){Object.defineProperty(this,"signal",{value:new X,writable:!0,configurable:!0})}abort(e){let t=mr(e),n=pr(t);this.signal.reason=t,this.signal.dispatchEvent(n)}toString(){return`[object AbortController]`}}typeof Symbol<`u`&&Symbol.toStringTag&&(Z.prototype[Symbol.toStringTag]=`AbortController`,X.prototype[Symbol.toStringTag]=`AbortSignal`);function gr(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 _r(e){typeof e==`function`&&(e={fetch:e});let{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!gr({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:a};let a=n;(a&&!a.prototype.hasOwnProperty(`signal`)||i)&&(a=function(e,t){let r;t&&t.signal&&(r=t.signal,delete t.signal);let i=new n(e,t);return r&&Object.defineProperty(i,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),i},a.prototype=n.prototype);let o=t;return{fetch:(e,t)=>{let n=a&&a.prototype.isPrototypeOf(e)?e.signal:t?t.signal:void 0;if(n){let r;try{r=new DOMException(`Aborted`,`AbortError`)}catch{r=Error(`Aborted`),r.name=`AbortError`}if(n.aborted)return Promise.reject(r);let i=new Promise((e,t)=>{n.addEventListener(`abort`,()=>t(r),{once:!0})});return t&&t.signal&&delete t.signal,Promise.race([i,o(e,t)])}return o(e,t)},Request:a}}var Q=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window,$=`fetch`in Q&&gr({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}),vr=$?_r({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}):void 0,yr=$?vr.fetch:Q.fetch,br=$?vr.Request:Q.Request,xr=$?Z:Q.AbortController,Sr=$?X:Q.AbortSignal,Cr=(e,t)=>{let n=e.length,r=t>=0?t:n+t;if(r<0||r>=n)return;let i=e.charCodeAt(r);if(i>=55296&&i<=56319&&r+1<n){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343)return e[r]+e[r+1]}return e[r]};function*wr(e,t){let n=t.flags.includes(`g`)?t.flags:t.flags+`g`,r=new RegExp(t.source,n),i;for(;(i=r.exec(e))!==null;)yield i,i[0].length===0&&r.lastIndex++}var Tr=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},Er=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return n.repeat(Math.ceil(r/n.length)).slice(0,r)+e},Dr=(e,t,n)=>{if(typeof t==`string`){if(typeof n==`string`)return t===``?n+e.split(``).join(n)+n:e.split(t).join(n);let r=[],i=0,a=e.indexOf(t,i);for(;a!==-1;)r.push(e.slice(i,a)),r.push(n(t,a,e)),i=a+t.length,a=e.indexOf(t,i);return r.push(e.slice(i)),r.join(``)}let r=t.flags.includes(`g`)?t.flags:t.flags+`g`,i=new RegExp(t.source,r);return e.replace(i,n)},Or=e=>e.replace(/^\s+/,``),kr=e=>e.replace(/\s+$/,``),Ar=Or,jr=kr,Mr=(e,t)=>typeof e==`string`?Cr(e,t):Wn(e,t),Nr=(e,t={})=>{let n=t.timeout||1,r=performance.now();return Q.setTimeout(()=>{e({get didTimeout(){return t.timeout?!1:performance.now()-r-1>n},timeRemaining(){return Math.max(0,1+(performance.now()-r))}})},1)},Pr=e=>Q.clearTimeout(e),Fr=e=>typeof e==`function`&&e?.toString().endsWith(`{ [native code] }`),Ir=!Fr(Q.requestIdleCallback)||!Fr(Q.cancelIdleCallback),Lr=Ir?Nr:Q.requestIdleCallback,Rr=Ir?Pr:Q.cancelIdleCallback,zr=(e,t,n)=>typeof e==`string`?e.includes(t,n):Yn(e,t,n),Br=(e,t,n)=>{if(typeof e.canParse==`function`)return e.canParse(t,n);try{return new e(t,n),!0}catch{return!1}};
|
package/es2015.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.100-dev.
|
|
3
|
-
*
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.100-dev.ed76c949d.0
|
|
3
|
+
* Fri, 21 Aug 2026 13:57:35 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-100/doc/
|
|
5
5
|
*/
|
|
6
|
-
var _oxcMode9z5nh=function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}var t=e;function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol._oxc_toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@_oxc_toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}var t=e,r=n;function i(e){var n=r(e,`string`);return t(n)==`symbol`?n:n+``}var a=i;function o(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=o;function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){u(a,r,i,o,s,`next`,e)}function s(e){u(a,r,i,o,s,`throw`,e)}o(void 0)})}}var f=l,p=d;let m;var h=Object.defineProperty,ee=e=>e;function te(e,t){this[e]=ee.bind(null,t)}var g=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0,configurable:!0,set:te.bind(t,n)})},_=`1.0.100-dev.c1327f3bc.0`;class v{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(e=>{typeof e==`function`?e():e.unsubscribe()})}add(e){return this.subscriptions.push(e),this}}var y=e=>{throw Error(`${e} is value of unexpected type`)},ne=e=>{},b=()=>{},re=e=>{throw console.error(e),e},x=e=>{console.error(e)};class S{constructor(e){this.suppressErrors=!1,e&&(this._subscribe=e)}setSuppressErrors(e){this.suppressErrors=e}subscribe(e,t){let n=this.suppressErrors?x:re,r;r=t?typeof t==`function`?{next:t,error:b}:{next:e=>t.next(e),error:e=>t.error?.call(t,e)}:{next:n,error:b};let i=typeof e==`function`?{next:t=>{try{let n=e(t);n instanceof Promise&&n.catch(e=>r.next(e))}catch(e){r.next(e)}},error:e=>r.next(e)}:{next:t=>e.next(t),error:t=>e.error?e.error(t):r.next(t)},a;try{a=this._subscribe(i)}catch(e){i.error?.call(i,e)}return new v().add(()=>{switch(i.next=b,i.error=b,typeof a){case`function`:a();return;case`object`:a.unsubscribe();return;case`undefined`:return;default:return y(a)}})}pipe(...e){return e.reduce((e,t)=>t(e),this)}_subscribe(e){}}class C extends S{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>t.error?.call(t,e))}_subscribe(e){let t=this.keyCounter++;return this.subscribers.set(t,e),new v().add(()=>this.subscribers.delete(t))}}class ie{constructor(){this.log$=new C,this.logs=[],this.log=e=>{let t=f(f({},e),{},{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch{n={message:"error in `createCustomLog`",component:`Logger`}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>f({component:e},t))}}function ae(e,t=`Assertion "value is not nullable" failed`){if(e==null)throw Error(t)}function oe(e,t=`Assertion "value is nullable" failed`){if(e!=null)throw Error(t)}function w(e){return e!=null}function T(e){return e==null}var se=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>w(t)));function ce(e,t){if(!e?.length)throw Error(t)}function le(e,t){if(e?.length)throw Error(t)}var E=()=>globalThis,ue=(e=E())=>!!(e.window&&e.screen),de=(e,t,n)=>new Promise((r,i)=>{t.addEventListener(`abort`,()=>{s(),l.remove()});let a=()=>{s(),i(`error`)},o=()=>{s(),r()},s=()=>{c&&clearTimeout(c),l.removeEventListener(`load`,o),l.removeEventListener(`error`,a)},c;n&&(c=E().setTimeout(()=>{s(),i(`timeout`)},n));let l=document.createElement(`script`);l.addEventListener(`load`,o),l.addEventListener(`error`,a),l.src=e,document.head.appendChild(l)}),fe=typeof E().performance?.now==`function`?()=>E().performance.now():()=>Date.now(),pe=()=>Math.trunc(fe()),me=(e,t)=>p(function*(...n){let r=t(...n),i=e.aborted,a;for(;!i&&!e.aborted;)try{let e=yield r.next(a);i=e.done??!1,a=e.value}catch(e){yield r.throw(e)}return a}),he=(e,{start:t=0,factor:n=2,max:r=1/0,min:i=t,random:a=0}={})=>{let o=t;return o*=n**+e,o*=1+(Math.random()*a*2-a),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,i),o},D={};g(D,{set:()=>ve,remove:()=>be,isPersistent:()=>ge,has:()=>ye,get:()=>_e,clear:()=>xe});var O,k,A=`vk-videoplayer-dummy-key-${Math.random()}`,j=()=>{if(k!==void 0)return k;try{localStorage.setItem(A,`test`),localStorage.removeItem(A),k=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(A),k=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)k=2;else throw e}else throw e}return k===2&&(O=new Map),k},ge=()=>j()===0,_e=e=>{let t=j();switch(t){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return O?.get(e);default:y(t)}},ve=(e,t)=>{let n=j();switch(n){case 0:try{localStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 1:try{sessionStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 2:O?.set(e,t);return;default:y(n)}},ye=e=>{let t=j();switch(t){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return O?.has(e)??!1;default:return y(t),!1}},be=e=>{let t=j();switch(t){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:O?.delete(e);return;default:y(t)}},xe=()=>{let e=j();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return O?.clear();default:y(e)}},Se=()=>{let e,t=[],n=E();try{e=n.self!==n.top}catch(t){t instanceof DOMException&&t.name===`SecurityError`?e=!0:(e=!1,console.error(t))}try{n.location?.ancestorOrigins&&(t=[...n.location.ancestorOrigins])}catch(e){console.error(e)}try{!t.length&&n.document.referrer&&(t=[new URL(n.document.referrer).origin])}catch(e){console.error(e)}return t=t.filter(e=>URL.canParse(e)),{isEmbed:e,origins:t,topOrigin:t.at(-1),immediateOrigin:t.at(0)}},M;(e=>{e.INVARIANT=`Invariant quality`,e.Q_144P=`144p`,e.Q_240P=`240p`,e.Q_360P=`360p`,e.Q_480P=`480p`,e.Q_576P=`576p`,e.Q_720P=`720p`,e.Q_1080P=`1080p`,e.Q_1440P=`1440p`,e.Q_2160P=`2160p`,e.Q_4320P=`4320p`})(M||={});var N={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},Ce=(e,t)=>N[e].height>N[t].height,we=(e,t)=>N[e].height>=N[t].height,P=(e,t)=>N[e].height<N[t].height,Te=(e,t)=>N[e].height<=N[t].height,Ee=e=>e.sort((e,t)=>e===t?0:e===`Invariant quality`?1:t===`Invariant quality`?-1:P(e,t)?1:-1)[0],F=Object.keys(N).sort((e,t)=>P(e,t)?-1:1),De=(e,t=.02)=>[...F].find(n=>N[n].height*(1+t)>=e),Oe=({width:e,height:t})=>{let n=Math.min(e,t),r=Math.max(e,t);return F.find(e=>{let t=N[e];return t.width>=r&&t.height>=n})},ke=e=>N[e].height,I=e=>e===`Invariant quality`,Ae=e=>e.every(e=>!I(e));function je(e){if(I(e))throw Error(`Expected exact quality`)}var Me=e=>{switch(e){case`4320p`:return`8K`;case`2160p`:return`4K`;case`1440p`:return`QHD`;case`1080p`:return`FHD`;case`720p`:return`HD`;default:return``}},Ne=(e,t)=>{let n={};for(let r of Object.keys(t)){let i=t[r],a=e[r];Array.isArray(i)?n[r]=Array.isArray(a)?a:i:typeof i==`object`&&i?typeof a==`object`&&a&&!Array.isArray(a)?n[r]=Ne(a,i):n[r]=a??i:n[r]=r in e?a:i}return n},Pe=e=>{let t=``;return e>=3600&&(t+=Math.floor(e/3600)+`h`,e%=3600),e>=60&&(t+=Math.floor(e/60)+`m`,e%=60),e>0&&(t+=Math.floor(e)+`s`),t};function Fe(e,t=0,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&typeof E().requestAnimationFrame==`function`;n&&(u=!!n.leading,d=`maxWait`in n,a=n?.maxWait?Math.max(+n?.maxWait||0,t):a,f=`trailing`in n?!!n.trailing:f);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(s&&E().cancelAnimationFrame(s),E().requestAnimationFrame(e)):setTimeout(e,t)}function ee(e){if(p){E().cancelAnimationFrame(e);return}clearTimeout(e)}function te(e){return l=e,s=h(v,t),u?m(e):o}function g(e){let n=e-c,r=e-l,i=t-n;return d?Math.min(i,a-r):i}function _(e){let n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function v(){let e=Date.now();if(_(e))return y(e);s=h(v,g(e))}function y(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function ne(){s!==void 0&&ee(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:y(Date.now())}function re(){return s!==void 0}function x(...e){let n=Date.now(),a=_(n);if(r=e,i=this,c=n,a){if(s===void 0)return te(c);if(d)return s=h(v,t),m(c)}return s===void 0&&(s=h(v,t)),o}return x.cancel=ne,x.flush=b,x.pending=re,x}var Ie=(e,t=0,n)=>Fe(e,t,f(f(f({},{leading:!0,trailing:!0}),n),{},{maxWait:t})),L=(e,t)=>{if(typeof e!=`object`||!e)return e;let n=Array.isArray(e)?[]:{};for(let r in e){if(typeof t==`function`){let i=t(e[r],r,e,n);if(i!==void 0){n[r]=i;continue}}typeof e[r]==`object`?n[r]=L(e[r],t):n[r]=e[r]}return n},Le=e=>L(e);class Re extends C{constructor(e){super(),this.bufferSize=void 0,this.buffer=[],this.cursorEnd=-1,this.cursorStart=0,this.bufferSize=e,this.buffer=Array(e)}next(e){this.cursorEnd+=1,this.cursorStart=this.cursorEnd>=this.bufferSize?this.cursorStart+1:0,this.buffer[this.cursorEnd%this.bufferSize]=e,this.subscribers.forEach(t=>t.next(e))}_subscribe(e){for(let t=this.cursorStart;t<=this.cursorEnd;t++)e.next(this.buffer[t%this.bufferSize]);let t=this.keyCounter++;return this.subscribers.set(t,e),new v().add(()=>this.subscribers.delete(t))}}class R extends C{constructor(e){super(),this.value=void 0,this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){let t=super._subscribe(e);return e.next(this.value),t}}function ze(e){return new S(t=>{let n={},r=Object.keys(e).length,i=e=>i=>{e in n||r--,n[e]=i,r===0&&t.next(n)};return Object.entries(e).reduce((e,[t,n])=>e.add(n.subscribe(i(t))),new v)})}function Be(...e){return new S(t=>e.reduce((e,n)=>e.add(n.subscribe(t)),new v))}var Ve=e=>new S(t=>{let n=E().setTimeout(()=>{try{t.next()}catch(e){if(t.error)t.error(e);else throw e}},e);return()=>E().clearTimeout(n)}),He=e=>new S(t=>{let n=E(),r=n.setInterval(()=>t.next(),e);return()=>{r&&=(n.clearInterval(r),void 0)}});function Ue(e){return new S(t=>{if(e instanceof Promise){let n=!1;return e.then(e=>{n||t.next(e)}).catch(e=>{n||t.error?.call(t,e)}),()=>{n=!0}}for(let n=0;n<e.length;n++)t.next(e[n])})}var We=Ue,Ge=(e,t)=>new S(n=>{let r=e=>n.next(e);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});class Ke extends v{remove(e){this.subscriptions=this.subscriptions.filter(t=>t!==e)}}function qe(e){return t=>new S(n=>t.subscribe(new Je(n,e)))}class Je{constructor(e,t){this.destination=void 0,this.size=void 0,this.lastValues=[],this.destination=e,this.size=t}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t;(t=this.destination).error?.call(t,e)}}var Ye={leading:!1,trailing:!0};function Xe(e,t=Ye){return n=>new S(r=>n.subscribe(new Ze(r,e,t)))}class Ze{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e;let t=E();w(this.timeout)?t.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=t.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(e){var t;(t=this.destination).error?.call(t,e)}}var Qe={leading:!0,trailing:!1};function $e(e,t=Qe){return n=>new S(r=>n.subscribe(new et(r,e,t)))}class et{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,T(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=E().setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var t;(t=this.destination).error?.call(t,e)}}function tt(e){return t=>new S(n=>t.subscribe(new nt(n,e)))}class nt{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}var rt=(e,t)=>{let n=(e,t)=>{let n=Object.keys(e);for(let r in t)if(!n.includes(r)||t[r]!==e[r])return!1;return!0};return n(e,t)&&n(t,e)},it=(e,t)=>e instanceof Object&&t instanceof Object?rt(e,t):e===t;function at(e=it){return t=>new S(n=>t.subscribe(new st(n,e)))}var ot={};class st{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.lastValue=ot,this.destination=e,this.predicate=t}next(e){let t;try{t=this.lastValue===ot||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object&&!Array.isArray(e)?f({},e):e}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function z(e){return t=>new S(n=>t.subscribe(new ct(n,e)))}class ct{constructor(e,t){this.destination=void 0,this.mapper=void 0,this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(e){throw this.error(e),e}this.destination.next(t)}error(e){var t;(t=this.destination).error?.call(t,e)}}function lt(e){return z(()=>e)}function ut(){return e=>new S(t=>{let n=!1,r=!1,i=e.subscribe(e=>{n||(n=!0,t.next(e)),r&&i.unsubscribe()},e=>{n=!0,t.error?.call(t,e),r&&i.unsubscribe()});return r=!0,n&&i.unsubscribe(),i})}function dt(){return e=>new S(t=>e.subscribe(new ft(t)))}class ft{constructor(e){this.destination=void 0,this.last=void 0,this.hasLast=!1,this.destination=e}next(e){let t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t;(t=this.destination).error?.call(t,e)}}function pt(e){return t=>new S(n=>t.subscribe(new mt(n,e)))}class mt{constructor(e,t){this.destination=void 0,this.effect=void 0,this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(e){throw this.error(e),e}this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function ht(e){return t=>new S(n=>t.subscribe(new gt(n,e)))}class gt{constructor(e,t){if(this.destination=void 0,this.count=void 0,this.destination=e,this.count=t,t<0){var n;(n=this.destination).error?.call(n,Error(`Count can not be less than zero`))}}next(e){this.count===0?this.destination.next(e):this.count--}error(e){var t;(t=this.destination).error?.call(t,e)}}function _t(e=0){return t=>{let n=0,r=new Re(e),i=t.subscribe(r),a=e=>()=>{e.unsubscribe(),n--,n===0&&i.unsubscribe()};return new S(e=>(n++,a(r.subscribe(e))))}}var vt=300,yt=(e,t=vt)=>new S(n=>{let r=E(),{width:i,height:a}=e.getBoundingClientRect();if(n.next({width:i,height:a}),!ue(r))return;let o=new r.ResizeObserver(Ie(e=>{let t=e[0];if(!t)return;let r,i;t.contentBoxSize&&t.contentBoxSize[0]?(i=t.contentBoxSize[0].blockSize,r=t.contentBoxSize[0].inlineSize):t.contentRect&&(r=t.contentRect.width,i=t.contentRect.height),w(r)&&w(i)&&n.next({width:r,height:i})},t));return o.observe(e),()=>o.disconnect()}),B=(e,t=6,n=`.`)=>{let r={};for(let i in e)if(!(!e.hasOwnProperty(i)||e[i]instanceof HTMLElement||!t))if(typeof e[i]==`object`&&e[i]!==null){let a=B(e[i],t-1);for(let e in a)a.hasOwnProperty(e)&&(r[i+n+e]=a[e])}else r[i]=e[i];return r},bt=e=>{e.innerHTML=``,e.removeAttribute(`src`),e.load()},xt=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`},St=(e,t)=>!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom),Ct=(()=>{let e=0;return()=>{let t=e;return e=(e+1)%(2**53-1),t}})(),wt=e=>e!==void 0&&e!==``?e:Ct().toString();function Tt(e,t,n){if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];let r=1;for(;r<t.length&&t[r]<e;)r++;r>=t.length&&(r=t.length-1);let i=t[r-1],a=t[r],o=n[r-1],s=n[r];return e===i?o:e===a?s:o+(e-i)/(a-i)*(s-o)}function Et(e,t,n){if(e<=0||n<0)return[];let r=[],i=Math.floor((e-1)/2),a=Math.floor(e/2),o=t-i,s=t+a;o<0&&(s+=Math.abs(o),o=0),s>n&&(o-=s-n,s=n),o=Math.max(0,o),s=Math.min(n,s);for(let e=o;e<=s;e++)r.push(e);return r}var V=e=>e instanceof DOMException&&(e.name===`AbortError`||e.code===20),Dt=e=>{if(!V(e))throw e};function Ot(e){if(e&&typeof e==`object`){if(`message`in e)return String(e.message);try{return JSON.stringify(e)}catch{return`object serialization error`}}return String(e)}m=Symbol.iterator;class H{constructor(e){if(this.buffer=void 0,this.writeIndex=0,this.count=0,this.capacity=void 0,e<=0)throw Error(`Capacity must be greater than 0`);this.capacity=e,this.buffer=Array.from({length:e}).fill(null)}add(e){this.buffer[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.count<this.capacity&&this.count++}*[m](){if(this.count===0)return;let e=this.count<this.capacity?0:this.writeIndex;for(let t=0;t<this.count;t++){let t=this.buffer[e];w(t)&&(yield t),e=(e+1)%this.capacity}}clear(){this.buffer.fill(null),this.writeIndex=0,this.count=0}get size(){return this.count}get maxCapacity(){return this.capacity}}var kt=e=>(t,n=!1)=>r=>{let i=typeof r==`object`;r==null||i&&!Object.keys(r).length||e(t,i?B(r):{value:r},n)},U=(e={})=>{let t=e=>{let t=e;return e===void 0?t=`undefined`:e===null?t=`null`:(typeof e==`number`||typeof e==`boolean`)&&(t=e.toString()),t},n={};for(let r in e)Array.isArray(e[r])?n[r]=e[r].map(t):n[r]=t(e[r]);return n};class W{constructor({name:e,getParentContext:t,getRootTracerContext:n,options:r}){this.dynamicImportTimeout=5e3,this.subscription=new v,this.options=void 0,this.span=void 0,this.context=void 0,this.childTracers=[],this.initPromise=void 0,this.getRootTracerContext=void 0,this.eventsBuffer=null,this.options=r??{};let{tracerEventsBufferSize:i}=this.options;w(i)&&i>0&&(this.eventsBuffer=new H(i)),W.dynamicImportStatus===`not_started`&&(W.dynamicImportPromise=this.loadOpentelemetry());let a=Date.now();this.initPromise=W.dynamicImportPromise.then(r=>{W.dynamicImportStatus===`completed`&&this.init({name:e,getParentContext:t,getRootTracerContext:n},a)})}init({name:e,getParentContext:t,getRootTracerContext:n},r){let i=n?.();if(T(i))return;let{opentelemetryApi:a}=W.dynamicImports,{context:o,trace:s}=a,{tracer:c,attributes$:l}=i;this.span=c.startSpan(e,{startTime:r},t?.()),this.context=s.setSpan(o.active(),this.span),this.getRootTracerContext=n,this.subscription.add(l.subscribe(e=>{w(e)&&this.span.setAttributes(e)}))}loadOpentelemetry(){var e=this;return p(function*(){if(W.dynamicImportStatus===`not_started`){W.dynamicImportStatus=`in_progress`;try{let t=new Promise((t,n)=>setTimeout(n,e.dynamicImportTimeout)),n=Promise.all([import(`@opentelemetry/api`),import(`@opentelemetry/sdk-trace-web`),import(`@apptracer/opentelemetry`),import(`@opentelemetry/resources`),import(`@opentelemetry/semantic-conventions`)]),[r,i,a,o,s]=yield Promise.race([n,t]);W.dynamicImports={opentelemetryApi:r,opentelemetrySdk:i,tracer:a,opentelemetryResources:o,opentelemetrySemanticConventions:s},W.dynamicImportStatus=`completed`}catch{W.dynamicImportStatus=`failed`}}})()}isComponentTracerNotInitialized(){return T(this.span)||W.dynamicImportStatus===`failed`}addEventToBuffer(e,t,n,r){w(this.eventsBuffer)&&this.eventsBuffer.add({name:e,attributes:t,type:n,timestamp:r})}addEventToSpan(e,t,n,r){this.span.addEvent(e,f(f({},U(t)),{},{type:n}),r)}log(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`log`,r)}):this.addEventToBuffer(e,t,`log`,r)}error(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`error`,r)}):this.addEventToBuffer(e,t,`error`,r)}critical(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`critical`,r)}):this.addEventToBuffer(e,t,`critical`,r)}createComponentTracer(e){let t=new W({name:e,getParentContext:()=>this.context,getRootTracerContext:()=>this.getRootTracerContext?.call(this),options:this.options});return this.childTracers.push(t),t}setSpanAttributes(e){this.span.setAttributes(U(e))}end(){this.initPromise.then(e=>{if(!this.isComponentTracerNotInitialized()){if(w(this.eventsBuffer))for(let e of this.eventsBuffer)this.addEventToSpan(e.name,e.attributes,e.type,e.timestamp);this.childTracers.forEach(e=>e.end()),this.span.end(),this.subscription.unsubscribe()}})}pause(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!0)}resume(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!1)}}W.dynamicImportStatus=`not_started`,W.dynamicImports=void 0,W.dynamicImportPromise=void 0;var At=`gW5EerTD5QhAnsbpF7Hd2NSMRteYIUUMjFbSyI68Pf5`,jt=e=>{class t extends e{constructor(e,t){super(e,t),this._isPaused=!1,this._pausedSpans=void 0,this.maxExportBatchSize=void 0,this.maxQueueSize=void 0,this.maxQueueSize=t?.maxQueueSize??2048,this.maxExportBatchSize=t?.maxExportBatchSize??512,this._pausedSpans=new H(this.maxQueueSize)}pause(){this._isPaused=!0}resume(){var e=()=>super.onEnd,t=this;return p(function*(){if(!t._isPaused)return;t._isPaused=!1;let n=t._pausedSpans;t._pausedSpans=new H(t.maxQueueSize);let r=0;for(let i of n)e().call(t,i),r+=1,r>=t.maxExportBatchSize&&(yield new Promise(e=>E().setTimeout(e,0)),r=0);n.clear(),yield t.forceFlush()})()}onEnd(e){if(this._isPaused){this._pausedSpans.add(e);return}super.onEnd(e)}}return t};class Mt extends W{constructor(e){super({name:`Root`,options:e}),this.attributes$=new R(null),this.paused$=new R(!1),this.paused$.next(!!this.options.tracerPausedAtInit)}init({name:e,getParentContext:t},n){let{tracer:r,opentelemetryResources:i,opentelemetrySdk:a,opentelemetrySemanticConventions:o}=W.dynamicImports,{TracerUploadSpanExporter:s}=r,{WebTracerProvider:c,BatchSpanProcessor:l}=a,{resourceFromAttributes:u}=i,{ATTR_SERVICE_NAME:d,ATTR_SERVICE_VERSION:f}=o,p=new(jt(l))(new s({appToken:At}));this.subscription.add(this.paused$.subscribe(e=>{e?p.pause():p.resume()}));let m=new c({resource:u({[d]:`videoplayer-sdk-web`,[f]:_}),spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0},spanProcessors:[p]});m.register();let h=m.getTracer(`sdk-videoplayer-tracer`);super.init({name:e,getParentContext:t,getRootTracerContext:()=>({tracer:h,attributes$:this.attributes$,paused$:this.paused$})},n)}getTraceId(){return this.isComponentTracerNotInitialized()?``:this.span.spanContext().traceId}setSpanAttributes(e){this.attributes$.next(f(f({},this.attributes$.getValue()),U(e)))}addSubscription(e){this.subscription.add(e)}}class Nt{constructor(e){this.fakeTraceId=void 0}log(e,t,n){}error(e,t,n){}critical(e,t,n){}createComponentTracer(e){return new Nt({name:e})}end(){}getTraceId(){return this.fakeTraceId}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}var Pt=()=>!0,G={level:0,filter:Pt,name:`Noname Tracer`,outputMethod:`log`};class Ft{constructor({name:e,level:t,filter:n,outputMethod:r}={}){this.name=void 0,this.filter=Pt,this.level=G.level,this.outputMethod=G.outputMethod,this.childTracers=[],this.filter=n??this.filter,this.level=t??this.level,this.outputMethod=r??this.outputMethod,this.name=e??G.name}log(e,t,n){this.logDebug(e,t)}error(e,t,n){this.logError(e,t)}critical(e,t,n){this.logError(e,t)}createComponentTracer(e){let t=new Ft({filter:this.filter,level:this.level,name:`${this.name}/ ${e}`,outputMethod:this.outputMethod});return this.childTracers.push(t),t}end(){this.childTracers.forEach(e=>e.end()),this.childTracers=[]}setLevel(e){this.level=e,this.childTracers.forEach(t=>t.setLevel(e))}setOtputMethod(e){this.outputMethod=e,this.childTracers.forEach(t=>t.setOtputMethod(e))}setFilter(e){this.filter=e,this.childTracers.forEach(t=>t.setFilter(e))}getFinishedSpans(){}getTraceId(){return`debug_trace`}get verbose(){return this.level===0}createMessage(e,t){return[this.name,e,JSON.stringify(t)].join(`: `)}logDebug(e,t){!this.verbose||!this.filter(e,t)||E().console[this.outputMethod](this.createMessage(e,t))}logError(e,t){this.filter(e,t)&&E().console.error(this.createMessage(e,t))}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}class It{static createRootTracer(e=`fake`,t){switch(e){case`real`:return new Mt(t);case`debug`:return new Ft;default:return new Nt}}}var Lt;(e=>{e.NETWORK=`network`,e.VIDEO_PIPELINE=`video_pipeline`,e.EXTERNAL_API=`external_api`,e.PARSER=`parser`,e.DOM=`dom`,e.WTF=`wtf`,e.UI=`ui`,e.CALL_FROM_EXTERNAL=`call_from_external`,e.FATAL=`fatal`})(Lt||={});var Rt;(e=>{e.Armenian=`58`,e.Azerbaijani=`57`,e.Belarusian=`114`,e.English=`3`,e.Kazakh=`97`,e.Portuguese=`73`,e.Russian=`0`,e.Spanish=`4`,e.Ukrainian=`1`,e.Uzbek=`65`,e.Vietnamese=`75`})(Rt||={});var zt=`vk.ru`,Bt=function(){var e=p(function*(e,t,n){let r=new URL(`https://${zt}/js/lang-pack.js`);return r.searchParams.set(`format`,`json`),r.searchParams.set(`name`,t),e!==void 0&&r.searchParams.set(`lang`,e),Vt(yield(yield fetch(r.toString())).json(),n)});return function(t,n,r){return e.apply(this,arguments)}}(),Vt=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([e,n])=>[e.substring(`${t}_`.length),Ht(n)])),Ht=e=>Array.isArray(e)?e[0]:e,Ut;(e=>{e.RU=`ru`,e.EN=`en`})(Ut||={});var K=`__vk_vp_internals_exposure`;class Wt{constructor(e,t){this.playerId=void 0,this.type=void 0,this.playerId=t,this.type=e,this.initWindowObjects()}getWindowObject(){var e;if(typeof window>`u`)return{};let t=this.playerId,n=this.type;return((e=window[K])==null||(e=e[t])==null?void 0:e[n])??{}}initWindowObjects(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[K]||(window[K]={}),window[K][e]||(window[K][e]={}),window[K][e][t]||(window[K][e][t]={})}expose(e){typeof window>`u`||Object.assign(this.getWindowObject(),e)}destroy(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[K]&&window[K][e]&&window[K][e][t]&&(delete window[K][e][t],Object.keys(window[K][e]).length||delete window[K][e],Object.keys(window[K]).length||delete window[K])}}var Gt={};g(Gt,{subscribe:()=>Yt,push:()=>Jt,destroy:()=>qt,create:()=>Kt});var q=new Map,Kt=(e,t)=>q.set(e,t??[]),qt=e=>q.delete(e),Jt=(e,t)=>{let n=q.get(e);n&&(typeof n==`function`?n(t):n.push(t))},Yt=(e,t)=>{let n=q.get(e);if(n){if(n&&Array.isArray(n))for(let e of n)t(e);q.set(e,t)}},Xt=e=>se({id:e.id,message:e.message,category:e.category,data:Zt(e.data),httpCode:e.httpCode,UVBackendErrorCode:e.UVBackendErrorCode});function Zt(e){switch(typeof e){case`boolean`:case`string`:case`number`:return e;case`object`:try{return JSON.stringify(e)}catch{return}default:return}}var Qt=e=>{let t=e.thrown instanceof Error?e.thrown:Error(e.message),n=e.id.length>10240?e.id.substring(0,10240):e.id;try{t.name=n}catch{t=Error(e.message),t.name=n}return t},$t=()=>{try{var e;let{origin:t,pathname:n,search:r,hostname:i}=((e=E())==null||(e=e.document)==null?void 0:e.location)??{};return!i||i===`localhost`?void 0:f({url:t+n},new URLSearchParams(r).entries().reduce((e,[t,n])=>(e[`url.${t}`]=n,e),{}))}catch{}};class J{constructor(e,t,n,r){this.dynamicImportTimeout=5e3,this.componentName=void 0,this.subscription=new v,this.options=void 0,this.envParams=void 0,this.context=void 0,this.isEmbed=void 0,this.embedParent=void 0,this.beforeInitErrors=[],this.componentName=e,this.options=t,this.envParams=n,this.context=f({},r);let{isEmbed:i,topOrigin:a}=Se();this.isEmbed=i,this.embedParent=a?new URL(a).hostname:void 0,this.options.enabled&&(this.loadModule(),this.init())}updateContext(e){Object.assign(this.context,e)}error(e,t){let n=J.tracerErrorMap.get(this.componentName);if(!n){this.beforeInitErrors.push([e,t]);return}let{blackErrorCategoryList:r,blackErrorIdList:i,sampleRate:a,whiteErrorCategoryList:o,whiteErrorIdList:s}=this.options,{id:c,category:l}=e;if(!(r.length&&r.includes(l)||i.length&&i.includes(c)||o.length&&!o.includes(l)||s.length&&!s.includes(c)||Math.random()>=a))try{let r=Qt(e);n?.error(r,f(f({crashIdSource:t?.crashIdSource??r.name,severity:t?.severity??(e.traceAsLog?`debug`:void 0)},t?.issueKey?{issueKey:t.issueKey}:{}),{},{keys:f(f(f(f({},this.context),Xt(e)),$t()),this.isEmbed&&this.embedParent&&{iframe_host:this.embedParent})}))}catch(e){console.error(e)}}addSubscription(e){this.subscription.add(e)}destroy(){this.subscription.unsubscribe()}init(){var e=this;return p(function*(){try{if(yield J.loadPromise,J.tracerErrorMap.has(e.componentName)||T(J.appTracerModule))return;let{appTracerModule:t}=J,{initTracerError:n,initTracerErrorUploader:r,getTracerModules:i}=t,a=i(e.componentName),o=!a.error,s=a.error??n(e.componentName,{enableUnhandledErrorsListeners:!1,stringifyErrorDataObject:!0});w(e.options.userId)&&s.setUserId(e.options.userId),o&&r(e.componentName,{appToken:At,environment:e.envParams.env,versionCode:1,versionName:e.envParams.version}),J.tracerErrorMap.set(e.componentName,s),e.beforeInitErrors.forEach(t=>e.error.apply(e,t)),e.beforeInitErrors=[]}catch(e){console.error(e)}})()}loadModule(){var e=this;w(J.loadPromise)||(J.loadPromise=function(){var t=p(function*(){try{let t=new Promise((t,n)=>E().setTimeout(n,e.dynamicImportTimeout));J.appTracerModule=yield Promise.race([t,import(`@apptracer/sdk/lite`)])}catch(e){J.loadPromise=null,console.error(e)}});return function(){return t.apply(this,arguments)}}()())}}J.tracerErrorMap=new Map,J.appTracerModule=null,J.loadPromise=null;class en{constructor(e,t){this.options=void 0,this.symbol=void 0,this.options=t,this.symbol=Symbol(e)}}var tn=()=>{let e=new Map,t=new Map,n=new Map,r=new Map,i=new Set;return{resolve(e){if(!r.has(e)){let t=n.get(e);if(!t)throw Error(`No constructor registered in DI container for ${e.name}`);r.set(e,new t)}return r.get(e)},resolveOptional(e){try{return this.resolve(e)}catch{return}},replace(e,t){r.forEach((t,n)=>{t instanceof e&&r.delete(n)}),n.set(e,t)},getToken(n){if(e.has(n.symbol))return e.get(n.symbol);if(t.has(n.symbol)){let r=t.get(n.symbol)();return e.set(n.symbol,r),r}if(n.options?.factory){let t=n.options.factory();return e.set(n.symbol,t),t}throw Error(`No value registered in DI container for token "${n.symbol.description}"`)},registerToken(t,n){e.set(t.symbol,n)},registerFactory(e,n){t.set(e.symbol,n)},hasToken(n){return e.has(n.symbol)||t.has(n.symbol)||!!n.options?.factory},registerCleanup(e){i.add(e)},clear(){i.forEach(e=>e()),i.clear(),e.clear(),t.clear(),r.clear(),n.clear()}}};class nn{constructor(e){this._inputNode=void 0,this._outputNode=void 0,this._plugins=[],this._destination=null,this._taps=[],this._inputNode=e.createGain(),this._outputNode=e.createGain()}get input(){return this._inputNode}get plugins(){return this._plugins}connectTo(e){this._destination=e,this.rebuild()}addTap(e){this._taps.push(e),this._outputNode.connect(e)}hasPlugin(e){return this._plugins.some(t=>t.id===e)}addPlugin(e){this.hasPlugin(e.id)||(this._plugins.push(e),this.rebuild())}removePlugin(e){let t=this._plugins.findIndex(t=>t.id===e);t!==-1&&(this._plugins.splice(t,1),this.rebuild())}rebuild(){this._inputNode.disconnect();for(let e of this._plugins)e.outputNode.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._plugins)e.connect(t.inputNode),e=t.outputNode;e.connect(this._outputNode),this._destination!==null&&this._outputNode.connect(this._destination);for(let e of this._taps)this._outputNode.connect(e)}}class rn{constructor(e,t,n){this._pluginChain=void 0,this._element=void 0,this._ctx=void 0,this._sourceNode=null,this._isBound=!1,this._element=e,this._ctx=t,this._pluginChain=new nn(t),this._pluginChain.connectTo(n)}get isBound(){return this._isBound}get plugins(){return this._pluginChain.plugins}bind(){this._isBound||=(this._sourceNode===null&&(this._sourceNode=this._ctx.createMediaElementSource(this._element)),this._sourceNode.disconnect(),this._sourceNode.connect(this._pluginChain.input),!0)}unbind(){this._isBound&&=(this._sourceNode?.disconnect(),this._sourceNode?.connect(this._ctx.destination),!1)}addPlugin(e){this._pluginChain.addPlugin(e)}removePlugin(e){this._pluginChain.removePlugin(e)}addAnalyser(e){this._pluginChain.addTap(e)}}class an{constructor(){this._ctx=null,this._masterGain=null,this._connections=new Map,this._contextEnabled=!1,this._boundBeforeDisable=new Set}static isSupported(){let e=E();return w(e.AudioContext??e.webkitAudioContext)}get context(){if(T(this._ctx)){let e=E(),t=e.AudioContext??e.webkitAudioContext;this._ctx=new t}return this._ctx}get contextState(){return this._contextEnabled?this._ctx?.state??`suspended`:`suspended`}enableContext(){var e=this;return p(function*(){e.ensureContext(),yield e._ctx?.resume(),e._contextEnabled=!0;for(let t of e._boundBeforeDisable)e._connections.get(t)?.bind();e._boundBeforeDisable.clear()})()}disableContext(){var e=this;return p(function*(){e._contextEnabled=!1;for(let[t,n]of e._connections)n.isBound&&(e._boundBeforeDisable.add(t),n.unbind())})()}connectSource(e){var t=this;return p(function*(){t.ensureContext(),t._contextEnabled=!0,yield t._ctx?.resume();let n=t._connections.get(e);if(n!==void 0){n.isBound||n.bind();return}let r=new rn(e,t.context,t._masterGain);r.bind(),t._connections.set(e,r)})()}disconnectSource(e){this._connections.get(e)?.unbind()}isSourceConnected(e){return this._connections.get(e)?.isBound??!1}addPlugin(e,t){let n=this._connections.get(e);if(n===void 0)throw Error(`Source is not connected. Call connectSource() first.`);n.addPlugin(t)}removePlugin(e,t){this._connections.get(e)?.removePlugin(t)}getPlugins(e){return this._connections.get(e)?.plugins??[]}createAnalyser(e){let t=this._connections.get(e);if(t===void 0)return null;let n=this.context.createAnalyser();return n.fftSize=256,n.smoothingTimeConstant=.8,t.addAnalyser(n),n}setMasterVolume(e){this._masterGain!==null&&(this._masterGain.gain.value=e)}getMasterVolume(){return this._masterGain?.gain.value??1}dispose(){this._connections.clear(),this._boundBeforeDisable.clear(),this._masterGain=null,this._contextEnabled=!1,this._ctx?.close(),this._ctx=null}ensureContext(){let e=this.context;T(this._masterGain)&&(this._masterGain=e.createGain(),this._masterGain.gain.value=1,this._masterGain.connect(e.destination))}}class on{constructor(e,t){this.id=`volume-fader`,this._gainNode=void 0,this._duration=void 0,this._curve=void 0,this._fade=null,this._gainNode=e.createGain(),this._gainNode.gain.value=1,this._duration=t.duration,this._curve=t.curve??this._buildEasingCurve(t.duration/1e3)}get inputNode(){return this._gainNode}get outputNode(){return this._gainNode}get faded(){return this._fade!==null}appear(){this._startFade(0,1)}disappear(){this._startFade(1,0)}pause(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime,n=t-this._fade.startTime,r=Math.max(0,this._fade.remaining-n);if(r<=.001){this._finishFade();return}let i=this._sampleIndex(this._fade,t),a=this._fade.curve[i];e.cancelScheduledValues(t),e.setValueAtTime(a,t),this._fade={from:a,target:this._fade.target,startTime:t,remaining:r,curve:this._fade.curve.subarray(i)}}resume(){if(this._fade===null)return;let e=this._gainNode.context.currentTime,{from:t,target:n,remaining:r,curve:i}=this._fade;if(r<=.001||Math.abs(n-t)<.001||i.length<2){this._finishFade();return}this._fade={from:t,target:n,startTime:e,remaining:r,curve:i},this._scheduleCurve(i,t,e,r)}cancel(){this._fade!==null&&this._finishFade()}_finishFade(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime;e.cancelScheduledValues(t),e.setValueAtTime(this._fade.target,t),this._fade=null}_startFade(e,t){let n=this._gainNode.gain,r=this._gainNode.context.currentTime,i=this._duration/1e3;if(i<=0){n.cancelScheduledValues(r),n.setValueAtTime(t,r),this._fade=null;return}let a=new Float32Array(this._curve.length);for(let n=0;n<this._curve.length;n++)a[n]=e+(t-e)*this._curve[n];this._fade={from:a[0],target:t,startTime:r,remaining:i,curve:a},this._scheduleCurve(a,a[0],r,i)}_buildEasingCurve(e){let t=Math.max(2,Math.ceil(e*60)),n=new Float32Array(t);for(let e=0;e<t;e++){let r=e/(t-1);n[e]=(1-Math.cos(Math.PI*r))/2}return n}_scheduleCurve(e,t,n,r){let i=this._gainNode.gain;i.cancelScheduledValues(n),i.setValueAtTime(t,n),i.setValueCurveAtTime(e,n,r)}_sampleIndex(e,t){let n=t-e.startTime,r=Math.max(0,Math.min(1,n/e.remaining));return Math.min(Math.round(r*(e.curve.length-1)),e.curve.length-1)}}class sn{constructor(e,t,n,r){this._filter=void 0,this._source=void 0,this._defaultGain=void 0,this.frequency=void 0,this.frequency=t,this._source=n,this._defaultGain=r,this._filter=e.createBiquadFilter(),this._filter.type=`peaking`,this._filter.frequency.value=t,this._filter.gain.value=0,this._filter.Q.value=1,this._source.connect(this._filter.gain)}get value(){return this._source.offset.value}get node(){return this._filter}set(e){this._source.offset.value=e}reset(){this.set(this._defaultGain)}dispose(){this._source.disconnect(this._filter.gain)}}class Y{constructor(e,t){this.id=`equalizer`,this._inputNode=void 0,this._outputNode=void 0,this._filterMap=new Map,this.equalizer=void 0,this._inputNode=e.createGain(),this._outputNode=e.createGain();let n=Object.entries(t).map(([e,t])=>[Number(e),t]).filter(([e])=>Number.isFinite(e)).sort((e,t)=>e[0]-t[0]),r=Y._sources.get(e);T(r)&&(r=new Map,Y._sources.set(e,r));for(let[t,i]of n)if(!r.has(t)){let n=e.createConstantSource();n.offset.value=i,n.start(),r.set(t,n)}let i={};for(let[t,a]of n){let n=r.get(t);if(!n)continue;let o=new sn(e,t,n,a);this._filterMap.set(t,o),i[t]=o}this.equalizer=i,this.rebuild()}get inputNode(){return this._inputNode}get outputNode(){return this._outputNode}resetAll(){for(let e of this._filterMap.values())e.reset()}dispose(){for(let e of this._filterMap.values())e.dispose()}rebuild(){this._inputNode.disconnect();for(let e of this._filterMap.values())e.node.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._filterMap.values())e.connect(t.node),e=t.node;e.connect(this._outputNode)}}Y._sources=new WeakMap;var cn=-14;class ln{constructor(e,t){this.id=`normalizer`,this._compressor=void 0,this._gainNode=void 0,this._compressor=e.createDynamicsCompressor(),this._gainNode=e.createGain(),this.applyConfig(t),this._compressor.connect(this._gainNode)}get inputNode(){return this._compressor}get outputNode(){return this._gainNode}applyConfig(e){if(!Number.isFinite(e.lufs)||!Number.isFinite(e.peak)){this._gainNode.gain.value=1;return}this._compressor.threshold.value=e.peak,this._compressor.knee.value=0,this._compressor.ratio.value=20,this._compressor.attack.value=.003,this._compressor.release.value=.25;let t=(e.targetLufs??cn)-e.lufs;this._gainNode.gain.value=10**(t/20)}}var un=(e,t)=>{let n=e.length,r=t>=0?t:n+t;return r>=0&&r<n?e[r]:void 0},dn=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}},fn=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return n;return-1},pn=(e,t=1)=>{let n=[],r=(e,t)=>{for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i];t>0&&Array.isArray(a)?r(a,t-1):n.push(a)}};return r(e,t),n},mn=(e,t)=>{let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);if(Array.isArray(i))for(let e=0;e<i.length;e++)n.push(i[e]);else n.push(i)}return n},hn=(e,t,n=0)=>{let r=e.length,i=n>=0?n:Math.max(r+n,0);for(;i<r;i++){let n=e[i];if(n===t||n!==n&&t!==t)return!0}return!1},gn=e=>{let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=e[t-1-r];return n},_n=(e,t)=>{let n=e.slice();return t?n.sort(t):n.sort()},vn=(e,t,n,...r)=>{let i=e.slice();return n===void 0?i.splice(t):i.splice(t,n,...r),i},yn=(e,t,n)=>{let r=e.length,i=t>=0?t:r+t,a=e.slice();return a[i]=n,a},bn=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof self<`u`?self:Function(`return this`)(),xn=e=>{let t=[],n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r];t.push([i,e[i]])}return t},Sn=e=>{let t={};for(let[n,r]of e)t[n]=r;return t},Cn=Object.prototype.hasOwnProperty,wn=(e,t)=>Cn.call(e,t),Tn=e=>{let t=Object.keys(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n},En=e=>{let t=Array.from(e);return t.length===0?Promise.resolve([]):Promise.all(t.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},Dn=e=>{let t=Array.from(e);return t.length===0?Promise.reject(AggregateError([],`All promises were rejected`)):new Promise((e,n)=>{let r=Array(t.length),i=t.length;t.forEach((t,a)=>{Promise.resolve(t).then(e,e=>{r[a]=e,--i,i===0&&n(AggregateError(r,`All promises were rejected`))})})})},On=(e,t)=>e.then(e=>Promise.resolve(t()).then(()=>e),e=>Promise.resolve(t()).then(()=>{throw e})),kn=e=>{try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}},An=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},{NativeAbortSignal:jn,NativeAbortController:Mn}=function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}}(typeof self<`u`?self:global);function Nn(e){let t;try{t=new Event(`abort`)}catch{typeof document<`u`?document.createEvent?(t=document.createEvent(`Event`),t.initEvent(`abort`,!1,!1)):(t=document.createEventObject(),t.type=`abort`):t={type:`abort`,bubbles:!1,cancelable:!1}}return t.reason=e,t}function Pn(e){if(e===void 0)if(typeof document>`u`)e=Error(`This operation was aborted`),e.name=`AbortError`;else try{e=new DOMException(`signal is aborted without reason`),Object.defineProperty(e,"name",{value:`AbortError`})}catch{e=Error(`This operation was aborted`),e.name=`AbortError`}return e}class Fn{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;let n=this.listeners[e];for(let e=0,r=n.length;e<r;e++)if(n[e].callback===t){n.splice(e,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let t=this.listeners[e.type].slice();for(let n=0,r=t.length;n<r;n++){let r=t[n];try{r.callback.call(this,e)}catch(e){Promise.resolve().then(()=>{throw e})}r.options&&r.options.once&&this.removeEventListener(e.type,r.callback)}return!e.defaultPrevented}}class X extends Fn{constructor(){super(),this.listeners||Fn.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)}throwIfAborted(){let{aborted:e,reason:t=`Aborted`}=this;if(e)throw t}static timeout(e){let t=new Z;return setTimeout(()=>t.abort(new DOMException(`This signal is timeout in ${e}ms`,`TimeoutError`)),e),t.signal}static any(e){let t=new Z;function n(){t.abort(this.reason),r()}function r(){for(let t of e)t.removeEventListener(`abort`,n)}for(let r of e)if(r.aborted){t.abort(r.reason);break}else r.addEventListener(`abort`,n);return t.signal}}class Z{constructor(){Object.defineProperty(this,"signal",{value:new X,writable:!0,configurable:!0})}abort(e){let t=Pn(e),n=Nn(t);this.signal.reason=t,this.signal.dispatchEvent(n)}toString(){return`[object AbortController]`}}typeof Symbol<`u`&&Symbol.toStringTag&&(Z.prototype[Symbol.toStringTag]=`AbortController`,X.prototype[Symbol.toStringTag]=`AbortSignal`);function In(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 Ln(e){typeof e==`function`&&(e={fetch:e});let{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!In({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:a};let a=n;(a&&!a.prototype.hasOwnProperty(`signal`)||i)&&(a=function(e,t){let r;t&&t.signal&&(r=t.signal,delete t.signal);let i=new n(e,t);return r&&Object.defineProperty(i,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),i},a.prototype=n.prototype);let o=t;return{fetch:(e,t)=>{let n=a&&a.prototype.isPrototypeOf(e)?e.signal:t?t.signal:void 0;if(n){let r;try{r=new DOMException(`Aborted`,`AbortError`)}catch{r=Error(`Aborted`),r.name=`AbortError`}if(n.aborted)return Promise.reject(r);let i=new Promise((e,t)=>{n.addEventListener(`abort`,()=>t(r),{once:!0})});return t&&t.signal&&delete t.signal,Promise.race([i,o(e,t)])}return o(e,t)},Request:a}}var Q=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window,$=`fetch`in Q&&In({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}),Rn=$?Ln({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}):void 0,zn=$?Rn.fetch:Q.fetch,Bn=$?Rn.Request:Q.Request,Vn=$?Z:Q.AbortController,Hn=$?X:Q.AbortSignal,Un=(e,t)=>{let n=e.length,r=t>=0?t:n+t;if(r<0||r>=n)return;let i=e.charCodeAt(r);if(i>=55296&&i<=56319&&r+1<n){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343)return e[r]+e[r+1]}return e[r]};function*Wn(e,t){let n=t.flags.includes(`g`)?t.flags:t.flags+`g`,r=new RegExp(t.source,n),i;for(;(i=r.exec(e))!==null;)yield i,i[0].length===0&&r.lastIndex++}var Gn=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},Kn=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return n.repeat(Math.ceil(r/n.length)).slice(0,r)+e},qn=(e,t,n)=>{if(typeof t==`string`){if(typeof n==`string`)return t===``?n+e.split(``).join(n)+n:e.split(t).join(n);let r=[],i=0,a=e.indexOf(t,i);for(;a!==-1;)r.push(e.slice(i,a)),r.push(n(t,a,e)),i=a+t.length,a=e.indexOf(t,i);return r.push(e.slice(i)),r.join(``)}let r=t.flags.includes(`g`)?t.flags:t.flags+`g`,i=new RegExp(t.source,r);return e.replace(i,n)},Jn=e=>e.replace(/^\s+/,``),Yn=e=>e.replace(/\s+$/,``),Xn=Jn,Zn=Yn,Qn=(e,t)=>typeof e==`string`?Un(e,t):un(e,t),$n=(e,t={})=>{let n=t.timeout||1,r=performance.now();return Q.setTimeout(()=>{e({get didTimeout(){return t.timeout?!1:performance.now()-r-1>n},timeRemaining(){return Math.max(0,1+(performance.now()-r))}})},1)},er=e=>Q.clearTimeout(e),tr=e=>typeof e==`function`&&e?.toString().endsWith(`{ [native code] }`),nr=!tr(Q.requestIdleCallback)||!tr(Q.cancelIdleCallback),rr=nr?$n:Q.requestIdleCallback,ir=nr?er:Q.cancelIdleCallback,ar=(e,t,n)=>typeof e==`string`?e.includes(t,n):hn(e,t,n),or=(e,t,n)=>{if(typeof e.canParse==`function`)return e.canParse(t,n);try{return new e(t,n),!0}catch{return!1}};;return{se,Oe,ke,De,or,Ve,Pe,Ie,$e,pt,Dt,Jn,Zn,Xn,Yn,qn,Kn,Gn,Wn,Un,ht,_t,D,rr,An,kn,On,Dn,En,dt,ut,yt,We,Tn,wn,Sn,xn,pe,fe,b,Be,lt,z,Bt,xt,T,w,Te,P,I,St,we,Ce,ue,V,He,Tt,ar,bn,E,Me,kt,Et,wt,Ot,Ee,he,Ge,B,at,tt,Ne,zn,Gt,Se,Fe,Xe,tn,ze,L,Le,bt,ne,ir,qe,Qn,je,oe,ce,ae,y,le,yn,vn,_n,gn,hn,mn,pn,fn,dn,un,Ae,de,me,on,M,R,Rt,_,It,Ke,v,C,Bn,Re,S,ln,ie,Wt,Ut,en,K,Lt,Y,H,an,J,Hn,Vn};}();var{se:_oxcMode9z5nh_se,Oe:_oxcMode9z5nh_Oe,ke:_oxcMode9z5nh_ke,De:_oxcMode9z5nh_De,or:_oxcMode9z5nh_or,Ve:_oxcMode9z5nh_Ve,Pe:_oxcMode9z5nh_Pe,Ie:_oxcMode9z5nh_Ie,$e:_oxcMode9z5nh_$e,pt:_oxcMode9z5nh_pt,Dt:_oxcMode9z5nh_Dt,Jn:_oxcMode9z5nh_Jn,Zn:_oxcMode9z5nh_Zn,Xn:_oxcMode9z5nh_Xn,Yn:_oxcMode9z5nh_Yn,qn:_oxcMode9z5nh_qn,Kn:_oxcMode9z5nh_Kn,Gn:_oxcMode9z5nh_Gn,Wn:_oxcMode9z5nh_Wn,Un:_oxcMode9z5nh_Un,ht:_oxcMode9z5nh_ht,_t:_oxcMode9z5nh__t,D:_oxcMode9z5nh_D,rr:_oxcMode9z5nh_rr,An:_oxcMode9z5nh_An,kn:_oxcMode9z5nh_kn,On:_oxcMode9z5nh_On,Dn:_oxcMode9z5nh_Dn,En:_oxcMode9z5nh_En,dt:_oxcMode9z5nh_dt,ut:_oxcMode9z5nh_ut,yt:_oxcMode9z5nh_yt,We:_oxcMode9z5nh_We,Tn:_oxcMode9z5nh_Tn,wn:_oxcMode9z5nh_wn,Sn:_oxcMode9z5nh_Sn,xn:_oxcMode9z5nh_xn,pe:_oxcMode9z5nh_pe,fe:_oxcMode9z5nh_fe,b:_oxcMode9z5nh_b,Be:_oxcMode9z5nh_Be,lt:_oxcMode9z5nh_lt,z:_oxcMode9z5nh_z,Bt:_oxcMode9z5nh_Bt,xt:_oxcMode9z5nh_xt,T:_oxcMode9z5nh_T,w:_oxcMode9z5nh_w,Te:_oxcMode9z5nh_Te,P:_oxcMode9z5nh_P,I:_oxcMode9z5nh_I,St:_oxcMode9z5nh_St,we:_oxcMode9z5nh_we,Ce:_oxcMode9z5nh_Ce,ue:_oxcMode9z5nh_ue,V:_oxcMode9z5nh_V,He:_oxcMode9z5nh_He,Tt:_oxcMode9z5nh_Tt,ar:_oxcMode9z5nh_ar,bn:_oxcMode9z5nh_bn,E:_oxcMode9z5nh_E,Me:_oxcMode9z5nh_Me,kt:_oxcMode9z5nh_kt,Et:_oxcMode9z5nh_Et,wt:_oxcMode9z5nh_wt,Ot:_oxcMode9z5nh_Ot,Ee:_oxcMode9z5nh_Ee,he:_oxcMode9z5nh_he,Ge:_oxcMode9z5nh_Ge,B:_oxcMode9z5nh_B,at:_oxcMode9z5nh_at,tt:_oxcMode9z5nh_tt,Ne:_oxcMode9z5nh_Ne,zn:_oxcMode9z5nh_zn,Gt:_oxcMode9z5nh_Gt,Se:_oxcMode9z5nh_Se,Fe:_oxcMode9z5nh_Fe,Xe:_oxcMode9z5nh_Xe,tn:_oxcMode9z5nh_tn,ze:_oxcMode9z5nh_ze,L:_oxcMode9z5nh_L,Le:_oxcMode9z5nh_Le,bt:_oxcMode9z5nh_bt,ne:_oxcMode9z5nh_ne,ir:_oxcMode9z5nh_ir,qe:_oxcMode9z5nh_qe,Qn:_oxcMode9z5nh_Qn,je:_oxcMode9z5nh_je,oe:_oxcMode9z5nh_oe,ce:_oxcMode9z5nh_ce,ae:_oxcMode9z5nh_ae,y:_oxcMode9z5nh_y,le:_oxcMode9z5nh_le,yn:_oxcMode9z5nh_yn,vn:_oxcMode9z5nh_vn,_n:_oxcMode9z5nh__n,gn:_oxcMode9z5nh_gn,hn:_oxcMode9z5nh_hn,mn:_oxcMode9z5nh_mn,pn:_oxcMode9z5nh_pn,fn:_oxcMode9z5nh_fn,dn:_oxcMode9z5nh_dn,un:_oxcMode9z5nh_un,Ae:_oxcMode9z5nh_Ae,de:_oxcMode9z5nh_de,me:_oxcMode9z5nh_me,on:_oxcMode9z5nh_on,M:_oxcMode9z5nh_M,R:_oxcMode9z5nh_R,Rt:_oxcMode9z5nh_Rt,_:_oxcMode9z5nh__,It:_oxcMode9z5nh_It,Ke:_oxcMode9z5nh_Ke,v:_oxcMode9z5nh_v,C:_oxcMode9z5nh_C,Bn:_oxcMode9z5nh_Bn,Re:_oxcMode9z5nh_Re,S:_oxcMode9z5nh_S,ln:_oxcMode9z5nh_ln,ie:_oxcMode9z5nh_ie,Wt:_oxcMode9z5nh_Wt,Ut:_oxcMode9z5nh_Ut,en:_oxcMode9z5nh_en,K:_oxcMode9z5nh_K,Lt:_oxcMode9z5nh_Lt,Y:_oxcMode9z5nh_Y,H:_oxcMode9z5nh_H,an:_oxcMode9z5nh_an,J:_oxcMode9z5nh_J,Hn:_oxcMode9z5nh_Hn,Vn:_oxcMode9z5nh_Vn}=_oxcMode9z5nh;export{_oxcMode9z5nh_se as withoutNullable,_oxcMode9z5nh_Oe as videoSizeToQuality,_oxcMode9z5nh_ke as videoQualityToHeight,_oxcMode9z5nh_De as videoHeightToQuality,_oxcMode9z5nh_or as urlCanParsePolyfilled,_oxcMode9z5nh_Ve as timeout,_oxcMode9z5nh_Pe as timeCodeToString,_oxcMode9z5nh_Ie as throttleFn,_oxcMode9z5nh_$e as throttle,_oxcMode9z5nh_pt as tap,_oxcMode9z5nh_Dt as suppressAbort,_oxcMode9z5nh_Jn as stringTrimStart,_oxcMode9z5nh_Zn as stringTrimRight,_oxcMode9z5nh_Xn as stringTrimLeft,_oxcMode9z5nh_Yn as stringTrimEnd,_oxcMode9z5nh_qn as stringReplaceAll,_oxcMode9z5nh_Kn as stringPadStart,_oxcMode9z5nh_Gn as stringPadEnd,_oxcMode9z5nh_Wn as stringMatchAll,_oxcMode9z5nh_Un as stringAt,_oxcMode9z5nh_ht as skip,_oxcMode9z5nh__t as shareReplay,_oxcMode9z5nh_D as safeStorage,_oxcMode9z5nh_rr as requestIdleCallbackPolyfilled,_oxcMode9z5nh_An as promiseWithResolvers,_oxcMode9z5nh_kn as promiseTry,_oxcMode9z5nh_On as promiseFinally,_oxcMode9z5nh_Dn as promiseAny,_oxcMode9z5nh_En as promiseAllSettled,_oxcMode9z5nh_dt as pairwise,_oxcMode9z5nh_ut as once,_oxcMode9z5nh_yt as observeElementSize,_oxcMode9z5nh_We as observableFrom,_oxcMode9z5nh_Tn as objectValues,_oxcMode9z5nh_wn as objectHasOwn,_oxcMode9z5nh_Sn as objectFromEntries,_oxcMode9z5nh_xn as objectEntries,_oxcMode9z5nh_pe as nowInt,_oxcMode9z5nh_fe as now,_oxcMode9z5nh_b as noop,_oxcMode9z5nh_Be as merge,_oxcMode9z5nh_lt as mapTo,_oxcMode9z5nh_z as map,_oxcMode9z5nh_Bt as loadVKLangPack,_oxcMode9z5nh_xt as isValidURL,_oxcMode9z5nh_T as isNullable,_oxcMode9z5nh_w as isNonNullable,_oxcMode9z5nh_Te as isLowerOrEqual,_oxcMode9z5nh_P as isLower,_oxcMode9z5nh_I as isInvariantQuality,_oxcMode9z5nh_St as isIntersecting,_oxcMode9z5nh_we as isHigherOrEqual,_oxcMode9z5nh_Ce as isHigher,_oxcMode9z5nh_ue as isBrowserWindow,_oxcMode9z5nh_V as isAbortError,_oxcMode9z5nh_He as interval,_oxcMode9z5nh_Tt as interpolate,_oxcMode9z5nh_ar as includesPolyfilled,_oxcMode9z5nh_bn as globalThisPolyfill,_oxcMode9z5nh_E as getWindow,_oxcMode9z5nh_Me as getVideoQualityLabel,_oxcMode9z5nh_kt as getTraceSubscriptionMethod,_oxcMode9z5nh_Et as getRangeAroundIndex,_oxcMode9z5nh_wt as getPlayerId,_oxcMode9z5nh_Ot as getMessageFromError,_oxcMode9z5nh_Ee as getHighestQuality,_oxcMode9z5nh_he as getExponentialDelay,_oxcMode9z5nh_Ge as fromEvent,_oxcMode9z5nh_B as flattenObject,_oxcMode9z5nh_at as filterChanged,_oxcMode9z5nh_tt as filter,_oxcMode9z5nh_Ne as fillWithDefault,_oxcMode9z5nh_zn as fetchPolyfilled,_oxcMode9z5nh_Gt as devNull,_oxcMode9z5nh_Se as detectEmbed,_oxcMode9z5nh_Fe as debounceFn,_oxcMode9z5nh_Xe as debounce,_oxcMode9z5nh_tn as createDIContainer,_oxcMode9z5nh_ze as combine,_oxcMode9z5nh_L as cloneDeepWith,_oxcMode9z5nh_Le as cloneDeep,_oxcMode9z5nh_bt as clearVideoElement,_oxcMode9z5nh_ne as checkNever,_oxcMode9z5nh_ir as cancelIdleCallbackPolyfilled,_oxcMode9z5nh_qe as buffer,_oxcMode9z5nh_Qn as atPolyfilled,_oxcMode9z5nh_je as assertQualityIsExact,_oxcMode9z5nh_oe as assertNullable,_oxcMode9z5nh_ce as assertNotEmptyArray,_oxcMode9z5nh_ae as assertNonNullable,_oxcMode9z5nh_y as assertNever,_oxcMode9z5nh_le as assertEmptyArray,_oxcMode9z5nh_yn as arrayWith,_oxcMode9z5nh_vn as arrayToSpliced,_oxcMode9z5nh__n as arrayToSorted,_oxcMode9z5nh_gn as arrayToReversed,_oxcMode9z5nh_hn as arrayIncludes,_oxcMode9z5nh_mn as arrayFlatMap,_oxcMode9z5nh_pn as arrayFlat,_oxcMode9z5nh_fn as arrayFindLastIndex,_oxcMode9z5nh_dn as arrayFindLast,_oxcMode9z5nh_un as arrayAt,_oxcMode9z5nh_Ae as areQualitiesExact,_oxcMode9z5nh_de as addScript,_oxcMode9z5nh_me as abortable,_oxcMode9z5nh_on as VolumeFaderPlugin,_oxcMode9z5nh_M as VideoQuality,_oxcMode9z5nh_R as ValueSubject,_oxcMode9z5nh_Rt as VKNumericLanguage,_oxcMode9z5nh__ as VERSION,_oxcMode9z5nh_It as TracerFactory,_oxcMode9z5nh_Ke as SubscriptionRemovable,_oxcMode9z5nh_v as Subscription,_oxcMode9z5nh_C as Subject,_oxcMode9z5nh_Bn as RequestPolyfilled,_oxcMode9z5nh_Re as ReplaySubject,_oxcMode9z5nh_S as Observable,_oxcMode9z5nh_ln as NormalizerPlugin,_oxcMode9z5nh_ie as Logger,_oxcMode9z5nh_Wt as InternalsExposure,_oxcMode9z5nh_Ut as InterfaceLanguage,_oxcMode9z5nh_en as InjectionToken,_oxcMode9z5nh_K as INTERNAL_EXPOSE_GLOBAL_KEY,_oxcMode9z5nh_Lt as ErrorCategory,_oxcMode9z5nh_Y as EqualizerPlugin,_oxcMode9z5nh_H as CircularBuffer,_oxcMode9z5nh_an as AudioGraph,_oxcMode9z5nh_J as AppTracer,_oxcMode9z5nh_Hn as AbortSignalPolyfilled,_oxcMode9z5nh_Vn as AbortControllerPolyfilled};
|
|
6
|
+
var _oxcMods5l7s3=function(){function e(t){"@babel/helpers - typeof";return e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},e(t)}var t=e;function n(e,n){if(t(e)!=`object`||!e)return e;var r=e[Symbol._oxc_toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(t(i)!=`object`)return i;throw TypeError(`@@_oxc_toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}var t=e,r=n;function i(e){var n=r(e,`string`);return t(n)==`symbol`?n:n+``}var a=i;function o(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=o;function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?c(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){u(a,r,i,o,s,`next`,e)}function s(e){u(a,r,i,o,s,`throw`,e)}o(void 0)})}}var f=l,p=d;let m;var h=Object.defineProperty,ee=e=>e;function te(e,t){this[e]=ee.bind(null,t)}var g=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0,configurable:!0,set:te.bind(t,n)})},_=`1.0.100-dev.ed76c949d.0`;class v{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(e=>{typeof e==`function`?e():e.unsubscribe()})}add(e){return this.subscriptions.push(e),this}}var y=e=>{throw Error(`${e} is value of unexpected type`)},ne=e=>{},b=()=>{},re=e=>{throw console.error(e),e},x=e=>{console.error(e)};class S{constructor(e){this.suppressErrors=!1,e&&(this._subscribe=e)}setSuppressErrors(e){this.suppressErrors=e}subscribe(e,t){let n=this.suppressErrors?x:re,r;r=t?typeof t==`function`?{next:t,error:b}:{next:e=>t.next(e),error:e=>t.error?.call(t,e)}:{next:n,error:b};let i=typeof e==`function`?{next:t=>{try{let n=e(t);n instanceof Promise&&n.catch(e=>r.next(e))}catch(e){r.next(e)}},error:e=>r.next(e)}:{next:t=>e.next(t),error:t=>e.error?e.error(t):r.next(t)},a;try{a=this._subscribe(i)}catch(e){i.error?.call(i,e)}return new v().add(()=>{switch(i.next=b,i.error=b,typeof a){case`function`:a();return;case`object`:a.unsubscribe();return;case`undefined`:return;default:return y(a)}})}pipe(...e){return e.reduce((e,t)=>t(e),this)}_subscribe(e){}}class C extends S{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>t.error?.call(t,e))}_subscribe(e){let t=this.keyCounter++;return this.subscribers.set(t,e),new v().add(()=>this.subscribers.delete(t))}}class ie{constructor(){this.log$=new C,this.logs=[],this.log=e=>{let t=f(f({},e),{},{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(e){return(...t)=>{let n;try{n=e(...t)}catch{n={message:"error in `createCustomLog`",component:`Logger`}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>f({component:e},t))}}function ae(e,t=`Assertion "value is not nullable" failed`){if(e==null)throw Error(t)}function oe(e,t=`Assertion "value is nullable" failed`){if(e!=null)throw Error(t)}function w(e){return e!=null}function T(e){return e==null}var se=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>w(t)));function ce(e,t){if(!e?.length)throw Error(t)}function le(e,t){if(e?.length)throw Error(t)}var E=()=>globalThis,D=()=>globalThis,ue=(e=E())=>!!(e.window&&e.screen),O=typeof E().performance?.now==`function`?()=>E().performance.now():()=>Date.now(),de=()=>Math.trunc(O());function fe(){var e=self,t=new Map;e.onmessage=function(n){var r=n.data;if(r.type===`ping`){e.postMessage({type:`ready`});return}if(r.type===`set`){var i=r.id;r.repeat?t.set(i,{repeat:!0,handle:e.setInterval(function(){e.postMessage({type:`tick`,id:i})},r.delay)}):t.set(i,{repeat:!1,handle:e.setTimeout(function(){t.delete(i),e.postMessage({type:`tick`,id:i})},r.delay)});return}var a=t.get(r.id);a&&(a.repeat?e.clearInterval(a.handle):e.clearTimeout(a.handle),t.delete(r.id))}}var pe=()=>`'use strict';(${fe.toString()})();`;class me{constructor(e,t){this.worker=void 0,this.handlers=void 0,this.records=new Map,this.ticks=0,this.handleMessage=e=>{if(e.data.type===`ready`){this.handlers.onReady();return}let{id:t}=e.data,n=this.records.get(t);T(n)||(this.ticks++,n.repeat||this.records.delete(t),n.callback())},this.handleError=()=>{this.handlers.onFatalError(this.destroy())},this.worker=e,this.handlers=t,this.worker.onmessage=this.handleMessage,this.worker.onerror=this.handleError,this.worker.onmessageerror=this.handleError,this.postCommand({type:`ping`})}static create(e){let t=E();if(typeof t.Worker!=`function`||typeof t.Blob!=`function`||T(t.URL?.createObjectURL))return null;let n=t.URL.createObjectURL(new t.Blob([pe()],{type:`text/javascript`}));try{return new me(new t.Worker(n),e)}catch{return null}finally{t.URL.revokeObjectURL(n)}}get activeCount(){return this.records.size}get deliveredTicks(){return this.ticks}set(e,t,n,r){this.records.set(e,{callback:t,repeat:r,delay:n,startedAt:O()}),this.postCommand({type:`set`,id:e,delay:n,repeat:r})}clear(e){this.records.delete(e)&&this.postCommand({type:`clear`,id:e})}destroy(){let e=new Map(this.records);return this.records.clear(),this.worker.onmessage=null,this.worker.onerror=null,this.worker.onmessageerror=null,this.worker.terminate(),e}postCommand(e){this.worker.postMessage(e)}}var he;(e=>{e.SHARED=`shared`,e.CORE=`core`,e.STATISTICS=`statistics`,e.INTERACTIVE=`interactive`,e.UI=`ui`,e.UI_TV=`ui-tv`})(he||={});var ge;(e=>{e.IDLE=`idle`,e.STARTING=`starting`,e.READY=`ready`,e.FAILED=`failed`})(ge||={});var _e=1,k=0,A=`idle`,j=null,M=new Map,N=new Set,ve=e=>{let t=O();for(let[n,r]of e){let e=r.repeat?r.delay:Math.max(0,r.delay-(t-r.startedAt));Ce(n,r.callback,e,r.repeat)}},ye=e=>{A=`failed`,j=null,ve(e)},be=()=>{T(j)||(ve(j.destroy()),j=null),A=`idle`},xe=()=>{A===`idle`&&(A=`starting`,j=me.create({onReady:()=>{A=`ready`},onFatalError:ye}))},Se=e=>N.has(e)?(xe(),A===`ready`?j:null):null,Ce=(e,t,n,r)=>{let i=D();r?M.set(e,{repeat:!0,nativeId:i.setInterval(t,n)}):M.set(e,{repeat:!1,nativeId:i.setTimeout(()=>{M.delete(e),t()},n)})},we=(e,t,n,r)=>{let i=_e++,a=Se(e);return T(a)?Ce(i,t,n,r):a.set(i,t,n,r),i},Te=e=>{if(T(e))return;let t=M.get(e);if(T(t)){j?.clear(e);return}M.delete(e);let n=D();t.repeat?n.clearInterval(t.nativeId):n.clearTimeout(t.nativeId)},Ee=e=>({setTimeout:(t,n=0)=>we(e,t,n,!1),setInterval:(t,n=0)=>we(e,t,n,!0),clearTimeout:Te,clearInterval:Te}),De=e=>{N.clear(),e.forEach(e=>N.add(e)),N.size===0&&be()},Oe=e=>{k++,De(e)},ke=()=>{k!==0&&(k--,k===0&&De([]))},Ae=()=>({workerModules:[...N],workerState:A,liveConsumers:k,activeWindowTimers:M.size,activeWorkerTimers:j?.activeCount??0,workerTicks:j?.deliveredTicks??0}),P=Ee(`shared`),je=(e,t,n)=>new Promise((r,i)=>{t.addEventListener(`abort`,()=>{s(),l.remove()});let a=()=>{s(),i(`error`)},o=()=>{s(),r()},s=()=>{c&&P.clearTimeout(c),l.removeEventListener(`load`,o),l.removeEventListener(`error`,a)},c;n&&(c=P.setTimeout(()=>{s(),i(`timeout`)},n));let l=document.createElement(`script`);l.addEventListener(`load`,o),l.addEventListener(`error`,a),l.src=e,document.head.appendChild(l)}),Me=(e,t)=>p(function*(...n){let r=t(...n),i=e.aborted,a;for(;!i&&!e.aborted;)try{let e=yield r.next(a);i=e.done??!1,a=e.value}catch(e){yield r.throw(e)}return a}),Ne=(e,{start:t=0,factor:n=2,max:r=1/0,min:i=t,random:a=0}={})=>{let o=t;return o*=n**+e,o*=1+(Math.random()*a*2-a),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,i),o},Pe={};g(Pe,{set:()=>Le,remove:()=>ze,isPersistent:()=>Fe,has:()=>Re,get:()=>Ie,clear:()=>Be});var F,I,L=`vk-videoplayer-dummy-key-${Math.random()}`,R=()=>{if(I!==void 0)return I;try{localStorage.setItem(L,`test`),localStorage.removeItem(L),I=0}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(L),I=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)I=2;else throw e}else throw e}return I===2&&(F=new Map),I},Fe=()=>R()===0,Ie=e=>{let t=R();switch(t){case 0:return localStorage.getItem(e)??void 0;case 1:return sessionStorage.getItem(e)??void 0;case 2:return F?.get(e);default:y(t)}},Le=(e,t)=>{let n=R();switch(n){case 0:try{localStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 1:try{sessionStorage.setItem(e,t)}catch(e){if(e instanceof DOMException)console.error(e);else throw e}break;case 2:F?.set(e,t);return;default:y(n)}},Re=e=>{let t=R();switch(t){case 0:return e in localStorage;case 1:return e in sessionStorage;case 2:return F?.has(e)??!1;default:return y(t),!1}},ze=e=>{let t=R();switch(t){case 0:return localStorage.removeItem(e);case 1:return sessionStorage.removeItem(e);case 2:F?.delete(e);return;default:y(t)}},Be=()=>{let e=R();switch(e){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return F?.clear();default:y(e)}},Ve=()=>{let e,t=[],n=E();try{e=n.self!==n.top}catch(t){t instanceof DOMException&&t.name===`SecurityError`?e=!0:(e=!1,console.error(t))}try{n.location?.ancestorOrigins&&(t=[...n.location.ancestorOrigins])}catch(e){console.error(e)}try{!t.length&&n.document.referrer&&(t=[new URL(n.document.referrer).origin])}catch(e){console.error(e)}return t=t.filter(e=>URL.canParse(e)),{isEmbed:e,origins:t,topOrigin:t.at(-1),immediateOrigin:t.at(0)}},He;(e=>{e.INVARIANT=`Invariant quality`,e.Q_144P=`144p`,e.Q_240P=`240p`,e.Q_360P=`360p`,e.Q_480P=`480p`,e.Q_576P=`576p`,e.Q_720P=`720p`,e.Q_1080P=`1080p`,e.Q_1440P=`1440p`,e.Q_2160P=`2160p`,e.Q_4320P=`4320p`})(He||={});var z={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},Ue=(e,t)=>z[e].height>z[t].height,We=(e,t)=>z[e].height>=z[t].height,B=(e,t)=>z[e].height<z[t].height,Ge=(e,t)=>z[e].height<=z[t].height,Ke=e=>e.sort((e,t)=>e===t?0:e===`Invariant quality`?1:t===`Invariant quality`?-1:B(e,t)?1:-1)[0],qe=Object.keys(z).sort((e,t)=>B(e,t)?-1:1),Je=(e,t=.02)=>[...qe].find(n=>z[n].height*(1+t)>=e),Ye=({width:e,height:t})=>{let n=Math.min(e,t),r=Math.max(e,t);return qe.find(e=>{let t=z[e];return t.width>=r&&t.height>=n})},Xe=e=>z[e].height,V=e=>e===`Invariant quality`,Ze=e=>e.every(e=>!V(e));function Qe(e){if(V(e))throw Error(`Expected exact quality`)}var $e=e=>{switch(e){case`4320p`:return`8K`;case`2160p`:return`4K`;case`1440p`:return`QHD`;case`1080p`:return`FHD`;case`720p`:return`HD`;default:return``}},et=(e,t)=>{let n={};for(let r of Object.keys(t)){let i=t[r],a=e[r];Array.isArray(i)?n[r]=Array.isArray(a)?a:i:typeof i==`object`&&i?typeof a==`object`&&a&&!Array.isArray(a)?n[r]=et(a,i):n[r]=a??i:n[r]=r in e?a:i}return n},tt=e=>{let t=``;return e>=3600&&(t+=Math.floor(e/3600)+`h`,e%=3600),e>=60&&(t+=Math.floor(e/60)+`m`,e%=60),e>0&&(t+=Math.floor(e)+`s`),t};function nt(e,t=0,n){let r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0,p=!t&&t!==0&&typeof E().requestAnimationFrame==`function`;n&&(u=!!n.leading,d=`maxWait`in n,a=n?.maxWait?Math.max(+n?.maxWait||0,t):a,f=`trailing`in n?!!n.trailing:f);function m(t){let n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function h(e,t){return p?(s&&E().cancelAnimationFrame(s),E().requestAnimationFrame(e)):P.setTimeout(e,t)}function ee(e){if(p){E().cancelAnimationFrame(e);return}P.clearTimeout(e)}function te(e){return l=e,s=h(v,t),u?m(e):o}function g(e){let n=e-c,r=e-l,i=t-n;return d?Math.min(i,a-r):i}function _(e){let n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function v(){let e=Date.now();if(_(e))return y(e);s=h(v,g(e))}function y(e){return s=void 0,f&&r?m(e):(r=i=void 0,o)}function ne(){s!==void 0&&ee(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:y(Date.now())}function re(){return s!==void 0}function x(...e){let n=Date.now(),a=_(n);if(r=e,i=this,c=n,a){if(s===void 0)return te(c);if(d)return s=h(v,t),m(c)}return s===void 0&&(s=h(v,t)),o}return x.cancel=ne,x.flush=b,x.pending=re,x}var rt=(e,t=0,n)=>nt(e,t,f(f(f({},{leading:!0,trailing:!0}),n),{},{maxWait:t})),H=(e,t)=>{if(typeof e!=`object`||!e)return e;let n=Array.isArray(e)?[]:{};for(let r in e){if(typeof t==`function`){let i=t(e[r],r,e,n);if(i!==void 0){n[r]=i;continue}}typeof e[r]==`object`?n[r]=H(e[r],t):n[r]=e[r]}return n},it=e=>H(e);class at extends C{constructor(e){super(),this.bufferSize=void 0,this.buffer=[],this.cursorEnd=-1,this.cursorStart=0,this.bufferSize=e,this.buffer=Array(e)}next(e){this.cursorEnd+=1,this.cursorStart=this.cursorEnd>=this.bufferSize?this.cursorStart+1:0,this.buffer[this.cursorEnd%this.bufferSize]=e,this.subscribers.forEach(t=>t.next(e))}_subscribe(e){for(let t=this.cursorStart;t<=this.cursorEnd;t++)e.next(this.buffer[t%this.bufferSize]);let t=this.keyCounter++;return this.subscribers.set(t,e),new v().add(()=>this.subscribers.delete(t))}}class U extends C{constructor(e){super(),this.value=void 0,this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){let t=super._subscribe(e);return e.next(this.value),t}}function ot(e){return new S(t=>{let n={},r=Object.keys(e).length,i=e=>i=>{e in n||r--,n[e]=i,r===0&&t.next(n)};return Object.entries(e).reduce((e,[t,n])=>e.add(n.subscribe(i(t))),new v)})}function st(...e){return new S(t=>e.reduce((e,n)=>e.add(n.subscribe(t)),new v))}var ct=e=>new S(t=>{let n=P.setTimeout(()=>{try{t.next()}catch(e){if(t.error)t.error(e);else throw e}},e);return()=>P.clearTimeout(n)}),lt=e=>new S(t=>{let n=P.setInterval(()=>t.next(),e);return()=>{n&&=(P.clearInterval(n),void 0)}});function ut(e){return new S(t=>{if(e instanceof Promise){let n=!1;return e.then(e=>{n||t.next(e)}).catch(e=>{n||t.error?.call(t,e)}),()=>{n=!0}}for(let n=0;n<e.length;n++)t.next(e[n])})}var dt=ut,ft=(e,t)=>new S(n=>{let r=e=>n.next(e);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});class pt extends v{remove(e){this.subscriptions=this.subscriptions.filter(t=>t!==e)}}function mt(e){return t=>new S(n=>t.subscribe(new ht(n,e)))}class ht{constructor(e,t){this.destination=void 0,this.size=void 0,this.lastValues=[],this.destination=e,this.size=t}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t;(t=this.destination).error?.call(t,e)}}var gt={leading:!1,trailing:!0};function _t(e,t=gt){return n=>new S(r=>n.subscribe(new vt(r,e,t)))}class vt{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,w(this.timeout)?P.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=P.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(e){if(this.destination.error)this.destination.error(e);else throw e}this.timeout=void 0},this.time)}error(e){var t;(t=this.destination).error?.call(t,e)}}var yt={leading:!0,trailing:!1};function bt(e,t=yt){return n=>new S(r=>n.subscribe(new xt(r,e,t)))}class xt{constructor(e,t,n){this.destination=void 0,this.time=void 0,this.config=void 0,this.lastValue=void 0,this.timeout=void 0,this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,T(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=P.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var t;(t=this.destination).error?.call(t,e)}}function St(e){return t=>new S(n=>t.subscribe(new Ct(n,e)))}class Ct{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}var wt=(e,t)=>{let n=(e,t)=>{let n=Object.keys(e);for(let r in t)if(!n.includes(r)||t[r]!==e[r])return!1;return!0};return n(e,t)&&n(t,e)},Tt=(e,t)=>e instanceof Object&&t instanceof Object?wt(e,t):e===t;function Et(e=Tt){return t=>new S(n=>t.subscribe(new Ot(n,e)))}var Dt={};class Ot{constructor(e,t){this.destination=void 0,this.predicate=void 0,this.lastValue=Dt,this.destination=e,this.predicate=t}next(e){let t;try{t=this.lastValue===Dt||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object&&!Array.isArray(e)?f({},e):e}catch(e){throw this.error(e),e}t&&this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function kt(e){return t=>new S(n=>t.subscribe(new At(n,e)))}class At{constructor(e,t){this.destination=void 0,this.mapper=void 0,this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(e){throw this.error(e),e}this.destination.next(t)}error(e){var t;(t=this.destination).error?.call(t,e)}}function jt(e){return kt(()=>e)}function Mt(){return e=>new S(t=>{let n=!1,r=!1,i=e.subscribe(e=>{n||(n=!0,t.next(e)),r&&i.unsubscribe()},e=>{n=!0,t.error?.call(t,e),r&&i.unsubscribe()});return r=!0,n&&i.unsubscribe(),i})}function Nt(){return e=>new S(t=>e.subscribe(new Pt(t)))}class Pt{constructor(e){this.destination=void 0,this.last=void 0,this.hasLast=!1,this.destination=e}next(e){let t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t;(t=this.destination).error?.call(t,e)}}function Ft(e){return t=>new S(n=>t.subscribe(new It(n,e)))}class It{constructor(e,t){this.destination=void 0,this.effect=void 0,this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(e){throw this.error(e),e}this.destination.next(e)}error(e){var t;(t=this.destination).error?.call(t,e)}}function Lt(e){return t=>new S(n=>t.subscribe(new Rt(n,e)))}class Rt{constructor(e,t){if(this.destination=void 0,this.count=void 0,this.destination=e,this.count=t,t<0){var n;(n=this.destination).error?.call(n,Error(`Count can not be less than zero`))}}next(e){this.count===0?this.destination.next(e):this.count--}error(e){var t;(t=this.destination).error?.call(t,e)}}function zt(e=0){return t=>{let n=0,r=new at(e),i=t.subscribe(r),a=e=>()=>{e.unsubscribe(),n--,n===0&&i.unsubscribe()};return new S(e=>(n++,a(r.subscribe(e))))}}var Bt=300,Vt=(e,t=Bt)=>new S(n=>{let r=E(),{width:i,height:a}=e.getBoundingClientRect();if(n.next({width:i,height:a}),!ue(r))return;let o=new r.ResizeObserver(rt(e=>{let t=e[0];if(!t)return;let r,i;t.contentBoxSize&&t.contentBoxSize[0]?(i=t.contentBoxSize[0].blockSize,r=t.contentBoxSize[0].inlineSize):t.contentRect&&(r=t.contentRect.width,i=t.contentRect.height),w(r)&&w(i)&&n.next({width:r,height:i})},t));return o.observe(e),()=>o.disconnect()}),W=(e,t=6,n=`.`)=>{let r={};for(let i in e)if(!(!e.hasOwnProperty(i)||e[i]instanceof HTMLElement||!t))if(typeof e[i]==`object`&&e[i]!==null){let a=W(e[i],t-1);for(let e in a)a.hasOwnProperty(e)&&(r[i+n+e]=a[e])}else r[i]=e[i];return r},Ht=e=>{e.innerHTML=``,e.removeAttribute(`src`),e.load()},Ut=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`},Wt=(e,t)=>!(e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom),Gt=(()=>{let e=0;return()=>{let t=e;return e=(e+1)%(2**53-1),t}})(),Kt=e=>e!==void 0&&e!==``?e:Gt().toString();function qt(e,t,n){if(e<=t[0])return n[0];if(e>=t[t.length-1])return n[n.length-1];let r=1;for(;r<t.length&&t[r]<e;)r++;r>=t.length&&(r=t.length-1);let i=t[r-1],a=t[r],o=n[r-1],s=n[r];return e===i?o:e===a?s:o+(e-i)/(a-i)*(s-o)}function Jt(e,t,n){if(e<=0||n<0)return[];let r=[],i=Math.floor((e-1)/2),a=Math.floor(e/2),o=t-i,s=t+a;o<0&&(s+=Math.abs(o),o=0),s>n&&(o-=s-n,s=n),o=Math.max(0,o),s=Math.min(n,s);for(let e=o;e<=s;e++)r.push(e);return r}var Yt=e=>e instanceof DOMException&&(e.name===`AbortError`||e.code===20),Xt=e=>{if(!Yt(e))throw e};function Zt(e){if(e&&typeof e==`object`){if(`message`in e)return String(e.message);try{return JSON.stringify(e)}catch{return`object serialization error`}}return String(e)}m=Symbol.iterator;class G{constructor(e){if(this.buffer=void 0,this.writeIndex=0,this.count=0,this.capacity=void 0,e<=0)throw Error(`Capacity must be greater than 0`);this.capacity=e,this.buffer=Array.from({length:e}).fill(null)}add(e){this.buffer[this.writeIndex]=e,this.writeIndex=(this.writeIndex+1)%this.capacity,this.count<this.capacity&&this.count++}*[m](){if(this.count===0)return;let e=this.count<this.capacity?0:this.writeIndex;for(let t=0;t<this.count;t++){let t=this.buffer[e];w(t)&&(yield t),e=(e+1)%this.capacity}}clear(){this.buffer.fill(null),this.writeIndex=0,this.count=0}get size(){return this.count}get maxCapacity(){return this.capacity}}var Qt=e=>(t,n=!1)=>r=>{let i=typeof r==`object`;r==null||i&&!Object.keys(r).length||e(t,i?W(r):{value:r},n)},$t=(e={})=>{let t=e=>{let t=e;return e===void 0?t=`undefined`:e===null?t=`null`:(typeof e==`number`||typeof e==`boolean`)&&(t=e.toString()),t},n={};for(let r in e)Array.isArray(e[r])?n[r]=e[r].map(t):n[r]=t(e[r]);return n};class K{constructor({name:e,getParentContext:t,getRootTracerContext:n,options:r}){this.dynamicImportTimeout=5e3,this.subscription=new v,this.options=void 0,this.span=void 0,this.context=void 0,this.childTracers=[],this.initPromise=void 0,this.getRootTracerContext=void 0,this.eventsBuffer=null,this.options=r??{};let{tracerEventsBufferSize:i}=this.options;w(i)&&i>0&&(this.eventsBuffer=new G(i)),K.dynamicImportStatus===`not_started`&&(K.dynamicImportPromise=this.loadOpentelemetry());let a=Date.now();this.initPromise=K.dynamicImportPromise.then(r=>{K.dynamicImportStatus===`completed`&&this.init({name:e,getParentContext:t,getRootTracerContext:n},a)})}init({name:e,getParentContext:t,getRootTracerContext:n},r){let i=n?.();if(T(i))return;let{opentelemetryApi:a}=K.dynamicImports,{context:o,trace:s}=a,{tracer:c,attributes$:l}=i;this.span=c.startSpan(e,{startTime:r},t?.()),this.context=s.setSpan(o.active(),this.span),this.getRootTracerContext=n,this.subscription.add(l.subscribe(e=>{w(e)&&this.span.setAttributes(e)}))}loadOpentelemetry(){var e=this;return p(function*(){if(K.dynamicImportStatus===`not_started`){K.dynamicImportStatus=`in_progress`;try{let t=new Promise((t,n)=>P.setTimeout(n,e.dynamicImportTimeout)),n=Promise.all([import(`@opentelemetry/api`),import(`@opentelemetry/sdk-trace-web`),import(`@apptracer/opentelemetry`),import(`@opentelemetry/resources`),import(`@opentelemetry/semantic-conventions`)]),[r,i,a,o,s]=yield Promise.race([n,t]);K.dynamicImports={opentelemetryApi:r,opentelemetrySdk:i,tracer:a,opentelemetryResources:o,opentelemetrySemanticConventions:s},K.dynamicImportStatus=`completed`}catch{K.dynamicImportStatus=`failed`}}})()}isComponentTracerNotInitialized(){return T(this.span)||K.dynamicImportStatus===`failed`}addEventToBuffer(e,t,n,r){w(this.eventsBuffer)&&this.eventsBuffer.add({name:e,attributes:t,type:n,timestamp:r})}addEventToSpan(e,t,n,r){this.span.addEvent(e,f(f({},$t(t)),{},{type:n}),r)}log(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`log`,r)}):this.addEventToBuffer(e,t,`log`,r)}error(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`error`,r)}):this.addEventToBuffer(e,t,`error`,r)}critical(e,t,n=!1){let r=Date.now();n?this.initPromise.then(n=>{this.isComponentTracerNotInitialized()||this.addEventToSpan(e,t,`critical`,r)}):this.addEventToBuffer(e,t,`critical`,r)}createComponentTracer(e){let t=new K({name:e,getParentContext:()=>this.context,getRootTracerContext:()=>this.getRootTracerContext?.call(this),options:this.options});return this.childTracers.push(t),t}setSpanAttributes(e){this.span.setAttributes($t(e))}end(){this.initPromise.then(e=>{if(!this.isComponentTracerNotInitialized()){if(w(this.eventsBuffer))for(let e of this.eventsBuffer)this.addEventToSpan(e.name,e.attributes,e.type,e.timestamp);this.childTracers.forEach(e=>e.end()),this.span.end(),this.subscription.unsubscribe()}})}pause(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!0)}resume(){var e;(e=this.getRootTracerContext)==null||(e=e.call(this))==null||e.paused$.next(!1)}}K.dynamicImportStatus=`not_started`,K.dynamicImports=void 0,K.dynamicImportPromise=void 0;var en=`gW5EerTD5QhAnsbpF7Hd2NSMRteYIUUMjFbSyI68Pf5`,tn=e=>{class t extends e{constructor(e,t){super(e,t),this._isPaused=!1,this._pausedSpans=void 0,this.maxExportBatchSize=void 0,this.maxQueueSize=void 0,this.maxQueueSize=t?.maxQueueSize??2048,this.maxExportBatchSize=t?.maxExportBatchSize??512,this._pausedSpans=new G(this.maxQueueSize)}pause(){this._isPaused=!0}resume(){var e=()=>super.onEnd,t=this;return p(function*(){if(!t._isPaused)return;t._isPaused=!1;let n=t._pausedSpans;t._pausedSpans=new G(t.maxQueueSize);let r=0;for(let i of n)e().call(t,i),r+=1,r>=t.maxExportBatchSize&&(yield new Promise(e=>P.setTimeout(()=>e(void 0),0)),r=0);n.clear(),yield t.forceFlush()})()}onEnd(e){if(this._isPaused){this._pausedSpans.add(e);return}super.onEnd(e)}}return t};class nn extends K{constructor(e){super({name:`Root`,options:e}),this.attributes$=new U(null),this.paused$=new U(!1),this.paused$.next(!!this.options.tracerPausedAtInit)}init({name:e,getParentContext:t},n){let{tracer:r,opentelemetryResources:i,opentelemetrySdk:a,opentelemetrySemanticConventions:o}=K.dynamicImports,{TracerUploadSpanExporter:s}=r,{WebTracerProvider:c,BatchSpanProcessor:l}=a,{resourceFromAttributes:u}=i,{ATTR_SERVICE_NAME:d,ATTR_SERVICE_VERSION:f}=o,p=new(tn(l))(new s({appToken:en}));this.subscription.add(this.paused$.subscribe(e=>{e?p.pause():p.resume()}));let m=new c({resource:u({[d]:`videoplayer-sdk-web`,[f]:_}),spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0},spanProcessors:[p]});m.register();let h=m.getTracer(`sdk-videoplayer-tracer`);super.init({name:e,getParentContext:t,getRootTracerContext:()=>({tracer:h,attributes$:this.attributes$,paused$:this.paused$})},n)}getTraceId(){return this.isComponentTracerNotInitialized()?``:this.span.spanContext().traceId}setSpanAttributes(e){this.attributes$.next(f(f({},this.attributes$.getValue()),$t(e)))}addSubscription(e){this.subscription.add(e)}}class rn{constructor(e){this.fakeTraceId=void 0}log(e,t,n){}error(e,t,n){}critical(e,t,n){}createComponentTracer(e){return new rn({name:e})}end(){}getTraceId(){return this.fakeTraceId}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}var an=()=>!0,on={level:0,filter:an,name:`Noname Tracer`,outputMethod:`log`};class sn{constructor({name:e,level:t,filter:n,outputMethod:r}={}){this.name=void 0,this.filter=an,this.level=on.level,this.outputMethod=on.outputMethod,this.childTracers=[],this.filter=n??this.filter,this.level=t??this.level,this.outputMethod=r??this.outputMethod,this.name=e??on.name}log(e,t,n){this.logDebug(e,t)}error(e,t,n){this.logError(e,t)}critical(e,t,n){this.logError(e,t)}createComponentTracer(e){let t=new sn({filter:this.filter,level:this.level,name:`${this.name}/ ${e}`,outputMethod:this.outputMethod});return this.childTracers.push(t),t}end(){this.childTracers.forEach(e=>e.end()),this.childTracers=[]}setLevel(e){this.level=e,this.childTracers.forEach(t=>t.setLevel(e))}setOtputMethod(e){this.outputMethod=e,this.childTracers.forEach(t=>t.setOtputMethod(e))}setFilter(e){this.filter=e,this.childTracers.forEach(t=>t.setFilter(e))}getFinishedSpans(){}getTraceId(){return`debug_trace`}get verbose(){return this.level===0}createMessage(e,t){return[this.name,e,JSON.stringify(t)].join(`: `)}logDebug(e,t){!this.verbose||!this.filter(e,t)||E().console[this.outputMethod](this.createMessage(e,t))}logError(e,t){this.filter(e,t)&&E().console.error(this.createMessage(e,t))}addSubscription(e){}setSpanAttributes(e){}pause(){}resume(){}}class cn{static createRootTracer(e=`fake`,t){switch(e){case`real`:return new nn(t);case`debug`:return new sn;default:return new rn}}}var ln;(e=>{e.MediaError=`mediaError`,e.SegmentFetcher=`segment_fetcher`,e.Hangup=`hangup`,e.Stall=`stall`})(ln||={});var un;(e=>{e.NETWORK=`network`,e.VIDEO_PIPELINE=`video_pipeline`,e.EXTERNAL_API=`external_api`,e.PARSER=`parser`,e.DOM=`dom`,e.WTF=`wtf`,e.UI=`ui`,e.CALL_FROM_EXTERNAL=`call_from_external`,e.FATAL=`fatal`})(un||={});var dn;(e=>{e.Armenian=`58`,e.Azerbaijani=`57`,e.Belarusian=`114`,e.English=`3`,e.Kazakh=`97`,e.Portuguese=`73`,e.Russian=`0`,e.Spanish=`4`,e.Ukrainian=`1`,e.Uzbek=`65`,e.Vietnamese=`75`})(dn||={});var fn=`vk.ru`,pn=function(){var e=p(function*(e,t,n){let r=new URL(`https://${fn}/js/lang-pack.js`);return r.searchParams.set(`format`,`json`),r.searchParams.set(`name`,t),e!==void 0&&r.searchParams.set(`lang`,e),mn(yield(yield fetch(r.toString())).json(),n)});return function(t,n,r){return e.apply(this,arguments)}}(),mn=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([e,n])=>[e.substring(`${t}_`.length),hn(n)])),hn=e=>Array.isArray(e)?e[0]:e,gn;(e=>{e.RU=`ru`,e.EN=`en`})(gn||={});var q=`__vk_vp_internals_exposure`;class _n{constructor(e,t){this.playerId=void 0,this.type=void 0,this.playerId=t,this.type=e,this.initWindowObjects()}getWindowObject(){var e;if(typeof window>`u`)return{};let t=this.playerId,n=this.type;return((e=window[q])==null||(e=e[t])==null?void 0:e[n])??{}}initWindowObjects(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[q]||(window[q]={}),window[q][e]||(window[q][e]={}),window[q][e][t]||(window[q][e][t]={})}expose(e){typeof window>`u`||Object.assign(this.getWindowObject(),e)}destroy(){if(typeof window>`u`)return;let e=this.playerId,t=this.type;window[q]&&window[q][e]&&window[q][e][t]&&(delete window[q][e][t],Object.keys(window[q][e]).length||delete window[q][e],Object.keys(window[q]).length||delete window[q])}}var vn={};g(vn,{subscribe:()=>Sn,push:()=>xn,destroy:()=>bn,create:()=>yn});var J=new Map,yn=(e,t)=>J.set(e,t??[]),bn=e=>J.delete(e),xn=(e,t)=>{let n=J.get(e);n&&(typeof n==`function`?n(t):n.push(t))},Sn=(e,t)=>{let n=J.get(e);if(n){if(n&&Array.isArray(n))for(let e of n)t(e);J.set(e,t)}},Cn=e=>se({id:e.id,message:e.message,category:e.category,data:wn(e.data),httpCode:e.httpCode,UVBackendErrorCode:e.UVBackendErrorCode});function wn(e){switch(typeof e){case`boolean`:case`string`:case`number`:return e;case`object`:try{return JSON.stringify(e)}catch{return}default:return}}var Tn=e=>{let t=e.thrown instanceof Error?e.thrown:Error(e.message),n=e.id.length>10240?e.id.substring(0,10240):e.id;try{t.name=n}catch{t=Error(e.message),t.name=n}return t},En=()=>{try{var e;let{origin:t,pathname:n,search:r,hostname:i}=((e=E())==null||(e=e.document)==null?void 0:e.location)??{};return!i||i===`localhost`?void 0:f({url:t+n},new URLSearchParams(r).entries().reduce((e,[t,n])=>(e[`url.${t}`]=n,e),{}))}catch{}};class Y{constructor(e,t,n,r){this.dynamicImportTimeout=5e3,this.componentName=void 0,this.subscription=new v,this.options=void 0,this.envParams=void 0,this.context=void 0,this.isEmbed=void 0,this.embedParent=void 0,this.beforeInitErrors=[],this.componentName=e,this.options=t,this.envParams=n,this.context=f({},r);let{isEmbed:i,topOrigin:a}=Ve();this.isEmbed=i,this.embedParent=a?new URL(a).hostname:void 0,this.options.enabled&&(this.loadModule(),this.init())}updateContext(e){Object.assign(this.context,e)}error(e,t){let n=Y.tracerErrorMap.get(this.componentName);if(!n){this.beforeInitErrors.push([e,t]);return}let{blackErrorCategoryList:r,blackErrorIdList:i,sampleRate:a,whiteErrorCategoryList:o,whiteErrorIdList:s}=this.options,{id:c,category:l}=e;if(!(r.length&&r.includes(l)||i.length&&i.includes(c)||o.length&&!o.includes(l)||s.length&&!s.includes(c)||Math.random()>=a))try{let r=Tn(e);n?.error(r,f(f({crashIdSource:t?.crashIdSource??r.name,severity:t?.severity??(e.traceAsLog?`debug`:void 0)},t?.issueKey?{issueKey:t.issueKey}:{}),{},{keys:f(f(f(f({},this.context),Cn(e)),En()),this.isEmbed&&this.embedParent&&{iframe_host:this.embedParent})}))}catch(e){console.error(e)}}addSubscription(e){this.subscription.add(e)}destroy(){this.subscription.unsubscribe()}init(){var e=this;return p(function*(){try{if(yield Y.loadPromise,Y.tracerErrorMap.has(e.componentName)||T(Y.appTracerModule))return;let{appTracerModule:t}=Y,{initTracerError:n,initTracerErrorUploader:r,getTracerModules:i}=t,a=i(e.componentName),o=!a.error,s=a.error??n(e.componentName,{enableUnhandledErrorsListeners:!1,stringifyErrorDataObject:!0});w(e.options.userId)&&s.setUserId(e.options.userId),o&&r(e.componentName,{appToken:en,environment:e.envParams.env,versionCode:1,versionName:e.envParams.version}),Y.tracerErrorMap.set(e.componentName,s),e.beforeInitErrors.forEach(t=>e.error.apply(e,t)),e.beforeInitErrors=[]}catch(e){console.error(e)}})()}loadModule(){var e=this;w(Y.loadPromise)||(Y.loadPromise=function(){var t=p(function*(){try{let t=new Promise((t,n)=>P.setTimeout(n,e.dynamicImportTimeout));Y.appTracerModule=yield Promise.race([t,import(`@apptracer/sdk/lite`)])}catch(e){Y.loadPromise=null,console.error(e)}});return function(){return t.apply(this,arguments)}}()())}}Y.tracerErrorMap=new Map,Y.appTracerModule=null,Y.loadPromise=null;class Dn{constructor(e,t){this.options=void 0,this.symbol=void 0,this.options=t,this.symbol=Symbol(e)}}var On=()=>{let e=new Map,t=new Map,n=new Map,r=new Map,i=new Set;return{resolve(e){if(!r.has(e)){let t=n.get(e);if(!t)throw Error(`No constructor registered in DI container for ${e.name}`);r.set(e,new t)}return r.get(e)},resolveOptional(e){try{return this.resolve(e)}catch{return}},replace(e,t){r.forEach((t,n)=>{t instanceof e&&r.delete(n)}),n.set(e,t)},getToken(n){if(e.has(n.symbol))return e.get(n.symbol);if(t.has(n.symbol)){let r=t.get(n.symbol)();return e.set(n.symbol,r),r}if(n.options?.factory){let t=n.options.factory();return e.set(n.symbol,t),t}throw Error(`No value registered in DI container for token "${n.symbol.description}"`)},registerToken(t,n){e.set(t.symbol,n)},registerFactory(e,n){t.set(e.symbol,n)},hasToken(n){return e.has(n.symbol)||t.has(n.symbol)||!!n.options?.factory},registerCleanup(e){i.add(e)},clear(){i.forEach(e=>e()),i.clear(),e.clear(),t.clear(),r.clear(),n.clear()}}};class kn{constructor(e){this._inputNode=void 0,this._outputNode=void 0,this._plugins=[],this._destination=null,this._taps=[],this._inputNode=e.createGain(),this._outputNode=e.createGain()}get input(){return this._inputNode}get plugins(){return this._plugins}connectTo(e){this._destination=e,this.rebuild()}addTap(e){this._taps.push(e),this._outputNode.connect(e)}hasPlugin(e){return this._plugins.some(t=>t.id===e)}addPlugin(e){this.hasPlugin(e.id)||(this._plugins.push(e),this.rebuild())}removePlugin(e){let t=this._plugins.findIndex(t=>t.id===e);t!==-1&&(this._plugins.splice(t,1),this.rebuild())}rebuild(){this._inputNode.disconnect();for(let e of this._plugins)e.outputNode.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._plugins)e.connect(t.inputNode),e=t.outputNode;e.connect(this._outputNode),this._destination!==null&&this._outputNode.connect(this._destination);for(let e of this._taps)this._outputNode.connect(e)}}class An{constructor(e,t,n){this._pluginChain=void 0,this._element=void 0,this._ctx=void 0,this._sourceNode=null,this._isBound=!1,this._element=e,this._ctx=t,this._pluginChain=new kn(t),this._pluginChain.connectTo(n)}get isBound(){return this._isBound}get plugins(){return this._pluginChain.plugins}bind(){this._isBound||=(this._sourceNode===null&&(this._sourceNode=this._ctx.createMediaElementSource(this._element)),this._sourceNode.disconnect(),this._sourceNode.connect(this._pluginChain.input),!0)}unbind(){this._isBound&&=(this._sourceNode?.disconnect(),this._sourceNode?.connect(this._ctx.destination),!1)}addPlugin(e){this._pluginChain.addPlugin(e)}removePlugin(e){this._pluginChain.removePlugin(e)}addAnalyser(e){this._pluginChain.addTap(e)}}class jn{constructor(){this._ctx=null,this._masterGain=null,this._connections=new Map,this._contextEnabled=!1,this._boundBeforeDisable=new Set}static isSupported(){let e=E();return w(e.AudioContext??e.webkitAudioContext)}get context(){if(T(this._ctx)){let e=E(),t=e.AudioContext??e.webkitAudioContext;this._ctx=new t}return this._ctx}get contextState(){return this._contextEnabled?this._ctx?.state??`suspended`:`suspended`}enableContext(){var e=this;return p(function*(){e.ensureContext(),yield e._ctx?.resume(),e._contextEnabled=!0;for(let t of e._boundBeforeDisable)e._connections.get(t)?.bind();e._boundBeforeDisable.clear()})()}disableContext(){var e=this;return p(function*(){e._contextEnabled=!1;for(let[t,n]of e._connections)n.isBound&&(e._boundBeforeDisable.add(t),n.unbind())})()}connectSource(e){var t=this;return p(function*(){t.ensureContext(),t._contextEnabled=!0,yield t._ctx?.resume();let n=t._connections.get(e);if(n!==void 0){n.isBound||n.bind();return}let r=new An(e,t.context,t._masterGain);r.bind(),t._connections.set(e,r)})()}disconnectSource(e){this._connections.get(e)?.unbind()}isSourceConnected(e){return this._connections.get(e)?.isBound??!1}addPlugin(e,t){let n=this._connections.get(e);if(n===void 0)throw Error(`Source is not connected. Call connectSource() first.`);n.addPlugin(t)}removePlugin(e,t){this._connections.get(e)?.removePlugin(t)}getPlugins(e){return this._connections.get(e)?.plugins??[]}createAnalyser(e){let t=this._connections.get(e);if(t===void 0)return null;let n=this.context.createAnalyser();return n.fftSize=256,n.smoothingTimeConstant=.8,t.addAnalyser(n),n}setMasterVolume(e){this._masterGain!==null&&(this._masterGain.gain.value=e)}getMasterVolume(){return this._masterGain?.gain.value??1}dispose(){this._connections.clear(),this._boundBeforeDisable.clear(),this._masterGain=null,this._contextEnabled=!1,this._ctx?.close(),this._ctx=null}ensureContext(){let e=this.context;T(this._masterGain)&&(this._masterGain=e.createGain(),this._masterGain.gain.value=1,this._masterGain.connect(e.destination))}}class Mn{constructor(e,t){this.id=`volume-fader`,this._gainNode=void 0,this._duration=void 0,this._curve=void 0,this._fade=null,this._gainNode=e.createGain(),this._gainNode.gain.value=1,this._duration=t.duration,this._curve=t.curve??this._buildEasingCurve(t.duration/1e3)}get inputNode(){return this._gainNode}get outputNode(){return this._gainNode}get faded(){return this._fade!==null}appear(){this._startFade(0,1)}disappear(){this._startFade(1,0)}pause(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime,n=t-this._fade.startTime,r=Math.max(0,this._fade.remaining-n);if(r<=.001){this._finishFade();return}let i=this._sampleIndex(this._fade,t),a=this._fade.curve[i];e.cancelScheduledValues(t),e.setValueAtTime(a,t),this._fade={from:a,target:this._fade.target,startTime:t,remaining:r,curve:this._fade.curve.subarray(i)}}resume(){if(this._fade===null)return;let e=this._gainNode.context.currentTime,{from:t,target:n,remaining:r,curve:i}=this._fade;if(r<=.001||Math.abs(n-t)<.001||i.length<2){this._finishFade();return}this._fade={from:t,target:n,startTime:e,remaining:r,curve:i},this._scheduleCurve(i,t,e,r)}cancel(){this._fade!==null&&this._finishFade()}_finishFade(){if(this._fade===null)return;let e=this._gainNode.gain,t=this._gainNode.context.currentTime;e.cancelScheduledValues(t),e.setValueAtTime(this._fade.target,t),this._fade=null}_startFade(e,t){let n=this._gainNode.gain,r=this._gainNode.context.currentTime,i=this._duration/1e3;if(i<=0){n.cancelScheduledValues(r),n.setValueAtTime(t,r),this._fade=null;return}let a=new Float32Array(this._curve.length);for(let n=0;n<this._curve.length;n++)a[n]=e+(t-e)*this._curve[n];this._fade={from:a[0],target:t,startTime:r,remaining:i,curve:a},this._scheduleCurve(a,a[0],r,i)}_buildEasingCurve(e){let t=Math.max(2,Math.ceil(e*60)),n=new Float32Array(t);for(let e=0;e<t;e++){let r=e/(t-1);n[e]=(1-Math.cos(Math.PI*r))/2}return n}_scheduleCurve(e,t,n,r){let i=this._gainNode.gain;i.cancelScheduledValues(n),i.setValueAtTime(t,n),i.setValueCurveAtTime(e,n,r)}_sampleIndex(e,t){let n=t-e.startTime,r=Math.max(0,Math.min(1,n/e.remaining));return Math.min(Math.round(r*(e.curve.length-1)),e.curve.length-1)}}class Nn{constructor(e,t,n,r){this._filter=void 0,this._source=void 0,this._defaultGain=void 0,this.frequency=void 0,this.frequency=t,this._source=n,this._defaultGain=r,this._filter=e.createBiquadFilter(),this._filter.type=`peaking`,this._filter.frequency.value=t,this._filter.gain.value=0,this._filter.Q.value=1,this._source.connect(this._filter.gain)}get value(){return this._source.offset.value}get node(){return this._filter}set(e){this._source.offset.value=e}reset(){this.set(this._defaultGain)}dispose(){this._source.disconnect(this._filter.gain)}}class X{constructor(e,t){this.id=`equalizer`,this._inputNode=void 0,this._outputNode=void 0,this._filterMap=new Map,this.equalizer=void 0,this._inputNode=e.createGain(),this._outputNode=e.createGain();let n=Object.entries(t).map(([e,t])=>[Number(e),t]).filter(([e])=>Number.isFinite(e)).sort((e,t)=>e[0]-t[0]),r=X._sources.get(e);T(r)&&(r=new Map,X._sources.set(e,r));for(let[t,i]of n)if(!r.has(t)){let n=e.createConstantSource();n.offset.value=i,n.start(),r.set(t,n)}let i={};for(let[t,a]of n){let n=r.get(t);if(!n)continue;let o=new Nn(e,t,n,a);this._filterMap.set(t,o),i[t]=o}this.equalizer=i,this.rebuild()}get inputNode(){return this._inputNode}get outputNode(){return this._outputNode}resetAll(){for(let e of this._filterMap.values())e.reset()}dispose(){for(let e of this._filterMap.values())e.dispose()}rebuild(){this._inputNode.disconnect();for(let e of this._filterMap.values())e.node.disconnect();this._outputNode.disconnect();let e=this._inputNode;for(let t of this._filterMap.values())e.connect(t.node),e=t.node;e.connect(this._outputNode)}}X._sources=new WeakMap;var Pn=-14;class Fn{constructor(e,t){this.id=`normalizer`,this._compressor=void 0,this._gainNode=void 0,this._compressor=e.createDynamicsCompressor(),this._gainNode=e.createGain(),this.applyConfig(t),this._compressor.connect(this._gainNode)}get inputNode(){return this._compressor}get outputNode(){return this._gainNode}applyConfig(e){if(!Number.isFinite(e.lufs)||!Number.isFinite(e.peak)){this._gainNode.gain.value=1;return}this._compressor.threshold.value=e.peak,this._compressor.knee.value=0,this._compressor.ratio.value=20,this._compressor.attack.value=.003,this._compressor.release.value=.25;let t=(e.targetLufs??Pn)-e.lufs;this._gainNode.gain.value=10**(t/20)}}var In=(e,t)=>{let n=e.length,r=t>=0?t:n+t;return r>=0&&r<n?e[r]:void 0},Ln=(e,t)=>{for(let n=e.length-1;n>=0;n--){let r=e[n];if(t(r,n,e))return r}},Rn=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return n;return-1},zn=(e,t=1)=>{let n=[],r=(e,t)=>{for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i];t>0&&Array.isArray(a)?r(a,t-1):n.push(a)}};return r(e,t),n},Bn=(e,t)=>{let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r,e);if(Array.isArray(i))for(let e=0;e<i.length;e++)n.push(i[e]);else n.push(i)}return n},Vn=(e,t,n=0)=>{let r=e.length,i=n>=0?n:Math.max(r+n,0);for(;i<r;i++){let n=e[i];if(n===t||n!==n&&t!==t)return!0}return!1},Hn=e=>{let t=e.length,n=Array(t);for(let r=0;r<t;r++)n[r]=e[t-1-r];return n},Un=(e,t)=>{let n=e.slice();return t?n.sort(t):n.sort()},Wn=(e,t,n,...r)=>{let i=e.slice();return n===void 0?i.splice(t):i.splice(t,n,...r),i},Gn=(e,t,n)=>{let r=e.length,i=t>=0?t:r+t,a=e.slice();return a[i]=n,a},Kn=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof self<`u`?self:Function(`return this`)(),qn=e=>{let t=[],n=Object.keys(e);for(let r=0;r<n.length;r++){let i=n[r];t.push([i,e[i]])}return t},Jn=e=>{let t={};for(let[n,r]of e)t[n]=r;return t},Yn=Object.prototype.hasOwnProperty,Xn=(e,t)=>Yn.call(e,t),Zn=e=>{let t=Object.keys(e),n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e[t[r]];return n},Qn=e=>{let t=Array.from(e);return t.length===0?Promise.resolve([]):Promise.all(t.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},$n=e=>{let t=Array.from(e);return t.length===0?Promise.reject(AggregateError([],`All promises were rejected`)):new Promise((e,n)=>{let r=Array(t.length),i=t.length;t.forEach((t,a)=>{Promise.resolve(t).then(e,e=>{r[a]=e,--i,i===0&&n(AggregateError(r,`All promises were rejected`))})})})},er=(e,t)=>e.then(e=>Promise.resolve(t()).then(()=>e),e=>Promise.resolve(t()).then(()=>{throw e})),tr=e=>{try{return Promise.resolve(e())}catch(e){return Promise.reject(e)}},nr=()=>{let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},{NativeAbortSignal:rr,NativeAbortController:ir}=function(e){return{NativeAbortSignal:e.AbortSignal,NativeAbortController:e.AbortController}}(typeof self<`u`?self:global);function ar(e){let t;try{t=new Event(`abort`)}catch{typeof document<`u`?document.createEvent?(t=document.createEvent(`Event`),t.initEvent(`abort`,!1,!1)):(t=document.createEventObject(),t.type=`abort`):t={type:`abort`,bubbles:!1,cancelable:!1}}return t.reason=e,t}function or(e){if(e===void 0)if(typeof document>`u`)e=Error(`This operation was aborted`),e.name=`AbortError`;else try{e=new DOMException(`signal is aborted without reason`),Object.defineProperty(e,"name",{value:`AbortError`})}catch{e=Error(`This operation was aborted`),e.name=`AbortError`}return e}class sr{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}removeEventListener(e,t){if(!(e in this.listeners))return;let n=this.listeners[e];for(let e=0,r=n.length;e<r;e++)if(n[e].callback===t){n.splice(e,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;let t=this.listeners[e.type].slice();for(let n=0,r=t.length;n<r;n++){let r=t[n];try{r.callback.call(this,e)}catch(e){Promise.resolve().then(()=>{throw e})}r.options&&r.options.once&&this.removeEventListener(e.type,r.callback)}return!e.defaultPrevented}}class cr extends sr{constructor(){super(),this.listeners||sr.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)}throwIfAborted(){let{aborted:e,reason:t=`Aborted`}=this;if(e)throw t}static timeout(e){let t=new Z;return setTimeout(()=>t.abort(new DOMException(`This signal is timeout in ${e}ms`,`TimeoutError`)),e),t.signal}static any(e){let t=new Z;function n(){t.abort(this.reason),r()}function r(){for(let t of e)t.removeEventListener(`abort`,n)}for(let r of e)if(r.aborted){t.abort(r.reason);break}else r.addEventListener(`abort`,n);return t.signal}}class Z{constructor(){Object.defineProperty(this,"signal",{value:new cr,writable:!0,configurable:!0})}abort(e){let t=or(e),n=ar(t);this.signal.reason=t,this.signal.dispatchEvent(n)}toString(){return`[object AbortController]`}}typeof Symbol<`u`&&Symbol.toStringTag&&(Z.prototype[Symbol.toStringTag]=`AbortController`,cr.prototype[Symbol.toStringTag]=`AbortSignal`);function lr(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 ur(e){typeof e==`function`&&(e={fetch:e});let{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!lr({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:a};let a=n;(a&&!a.prototype.hasOwnProperty(`signal`)||i)&&(a=function(e,t){let r;t&&t.signal&&(r=t.signal,delete t.signal);let i=new n(e,t);return r&&Object.defineProperty(i,"signal",{writable:!1,enumerable:!1,configurable:!0,value:r}),i},a.prototype=n.prototype);let o=t;return{fetch:(e,t)=>{let n=a&&a.prototype.isPrototypeOf(e)?e.signal:t?t.signal:void 0;if(n){let r;try{r=new DOMException(`Aborted`,`AbortError`)}catch{r=Error(`Aborted`),r.name=`AbortError`}if(n.aborted)return Promise.reject(r);let i=new Promise((e,t)=>{n.addEventListener(`abort`,()=>t(r),{once:!0})});return t&&t.signal&&delete t.signal,Promise.race([i,o(e,t)])}return o(e,t)},Request:a}}var Q=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window,$=`fetch`in Q&&lr({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}),dr=$?ur({fetch:Q.fetch,Request:Q.Request,AbortController:Q.AbortController}):void 0,fr=$?dr.fetch:Q.fetch,pr=$?dr.Request:Q.Request,mr=$?Z:Q.AbortController,hr=$?cr:Q.AbortSignal,gr=(e,t)=>{let n=e.length,r=t>=0?t:n+t;if(r<0||r>=n)return;let i=e.charCodeAt(r);if(i>=55296&&i<=56319&&r+1<n){let t=e.charCodeAt(r+1);if(t>=56320&&t<=57343)return e[r]+e[r+1]}return e[r]};function*_r(e,t){let n=t.flags.includes(`g`)?t.flags:t.flags+`g`,r=new RegExp(t.source,n),i;for(;(i=r.exec(e))!==null;)yield i,i[0].length===0&&r.lastIndex++}var vr=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},yr=(e,t,n=` `)=>{if(n===``||e.length>=t)return e;let r=t-e.length;return n.repeat(Math.ceil(r/n.length)).slice(0,r)+e},br=(e,t,n)=>{if(typeof t==`string`){if(typeof n==`string`)return t===``?n+e.split(``).join(n)+n:e.split(t).join(n);let r=[],i=0,a=e.indexOf(t,i);for(;a!==-1;)r.push(e.slice(i,a)),r.push(n(t,a,e)),i=a+t.length,a=e.indexOf(t,i);return r.push(e.slice(i)),r.join(``)}let r=t.flags.includes(`g`)?t.flags:t.flags+`g`,i=new RegExp(t.source,r);return e.replace(i,n)},xr=e=>e.replace(/^\s+/,``),Sr=e=>e.replace(/\s+$/,``),Cr=xr,wr=Sr,Tr=(e,t)=>typeof e==`string`?gr(e,t):In(e,t),Er=(e,t={})=>{let n=t.timeout||1,r=performance.now();return Q.setTimeout(()=>{e({get didTimeout(){return t.timeout?!1:performance.now()-r-1>n},timeRemaining(){return Math.max(0,1+(performance.now()-r))}})},1)},Dr=e=>Q.clearTimeout(e),Or=e=>typeof e==`function`&&e?.toString().endsWith(`{ [native code] }`),kr=!Or(Q.requestIdleCallback)||!Or(Q.cancelIdleCallback),Ar=kr?Er:Q.requestIdleCallback,jr=kr?Dr:Q.cancelIdleCallback,Mr=(e,t,n)=>typeof e==`string`?e.includes(t,n):Vn(e,t,n),Nr=(e,t,n)=>{if(typeof e.canParse==`function`)return e.canParse(t,n);try{return new e(t,n),!0}catch{return!1}};;return{se,Ye,Xe,Je,Nr,ct,tt,rt,bt,Ft,Xt,xr,wr,Cr,Sr,br,yr,vr,_r,gr,Lt,zt,Pe,Oe,Ar,ke,nr,tr,er,$n,Qn,Nt,Mt,Vt,dt,Zn,Xn,Jn,qn,de,O,b,st,jt,kt,pn,Ut,T,w,Ge,B,V,Wt,We,Ue,ue,Yt,lt,qt,Mr,Kn,E,$e,Qt,Ae,D,Jt,Kt,Zt,Ke,Ne,ft,W,Et,St,et,fr,vn,Ve,nt,_t,Ee,On,ot,H,it,Ht,ne,jr,mt,Tr,Qe,oe,ce,ae,y,le,Gn,Wn,Un,Hn,Vn,Bn,zn,Rn,Ln,In,Ze,je,Me,ge,Mn,He,U,dn,_,cn,he,pt,v,C,pr,at,S,Fn,ie,_n,gn,Dn,q,ln,un,X,G,jn,Y,hr,mr};}();var{se:_oxcMods5l7s3_se,Ye:_oxcMods5l7s3_Ye,Xe:_oxcMods5l7s3_Xe,Je:_oxcMods5l7s3_Je,Nr:_oxcMods5l7s3_Nr,ct:_oxcMods5l7s3_ct,tt:_oxcMods5l7s3_tt,rt:_oxcMods5l7s3_rt,bt:_oxcMods5l7s3_bt,Ft:_oxcMods5l7s3_Ft,Xt:_oxcMods5l7s3_Xt,xr:_oxcMods5l7s3_xr,wr:_oxcMods5l7s3_wr,Cr:_oxcMods5l7s3_Cr,Sr:_oxcMods5l7s3_Sr,br:_oxcMods5l7s3_br,yr:_oxcMods5l7s3_yr,vr:_oxcMods5l7s3_vr,_r:_oxcMods5l7s3__r,gr:_oxcMods5l7s3_gr,Lt:_oxcMods5l7s3_Lt,zt:_oxcMods5l7s3_zt,Pe:_oxcMods5l7s3_Pe,Oe:_oxcMods5l7s3_Oe,Ar:_oxcMods5l7s3_Ar,ke:_oxcMods5l7s3_ke,nr:_oxcMods5l7s3_nr,tr:_oxcMods5l7s3_tr,er:_oxcMods5l7s3_er,$n:_oxcMods5l7s3_$n,Qn:_oxcMods5l7s3_Qn,Nt:_oxcMods5l7s3_Nt,Mt:_oxcMods5l7s3_Mt,Vt:_oxcMods5l7s3_Vt,dt:_oxcMods5l7s3_dt,Zn:_oxcMods5l7s3_Zn,Xn:_oxcMods5l7s3_Xn,Jn:_oxcMods5l7s3_Jn,qn:_oxcMods5l7s3_qn,de:_oxcMods5l7s3_de,O:_oxcMods5l7s3_O,b:_oxcMods5l7s3_b,st:_oxcMods5l7s3_st,jt:_oxcMods5l7s3_jt,kt:_oxcMods5l7s3_kt,pn:_oxcMods5l7s3_pn,Ut:_oxcMods5l7s3_Ut,T:_oxcMods5l7s3_T,w:_oxcMods5l7s3_w,Ge:_oxcMods5l7s3_Ge,B:_oxcMods5l7s3_B,V:_oxcMods5l7s3_V,Wt:_oxcMods5l7s3_Wt,We:_oxcMods5l7s3_We,Ue:_oxcMods5l7s3_Ue,ue:_oxcMods5l7s3_ue,Yt:_oxcMods5l7s3_Yt,lt:_oxcMods5l7s3_lt,qt:_oxcMods5l7s3_qt,Mr:_oxcMods5l7s3_Mr,Kn:_oxcMods5l7s3_Kn,E:_oxcMods5l7s3_E,$e:_oxcMods5l7s3_$e,Qt:_oxcMods5l7s3_Qt,Ae:_oxcMods5l7s3_Ae,D:_oxcMods5l7s3_D,Jt:_oxcMods5l7s3_Jt,Kt:_oxcMods5l7s3_Kt,Zt:_oxcMods5l7s3_Zt,Ke:_oxcMods5l7s3_Ke,Ne:_oxcMods5l7s3_Ne,ft:_oxcMods5l7s3_ft,W:_oxcMods5l7s3_W,Et:_oxcMods5l7s3_Et,St:_oxcMods5l7s3_St,et:_oxcMods5l7s3_et,fr:_oxcMods5l7s3_fr,vn:_oxcMods5l7s3_vn,Ve:_oxcMods5l7s3_Ve,nt:_oxcMods5l7s3_nt,_t:_oxcMods5l7s3__t,Ee:_oxcMods5l7s3_Ee,On:_oxcMods5l7s3_On,ot:_oxcMods5l7s3_ot,H:_oxcMods5l7s3_H,it:_oxcMods5l7s3_it,Ht:_oxcMods5l7s3_Ht,ne:_oxcMods5l7s3_ne,jr:_oxcMods5l7s3_jr,mt:_oxcMods5l7s3_mt,Tr:_oxcMods5l7s3_Tr,Qe:_oxcMods5l7s3_Qe,oe:_oxcMods5l7s3_oe,ce:_oxcMods5l7s3_ce,ae:_oxcMods5l7s3_ae,y:_oxcMods5l7s3_y,le:_oxcMods5l7s3_le,Gn:_oxcMods5l7s3_Gn,Wn:_oxcMods5l7s3_Wn,Un:_oxcMods5l7s3_Un,Hn:_oxcMods5l7s3_Hn,Vn:_oxcMods5l7s3_Vn,Bn:_oxcMods5l7s3_Bn,zn:_oxcMods5l7s3_zn,Rn:_oxcMods5l7s3_Rn,Ln:_oxcMods5l7s3_Ln,In:_oxcMods5l7s3_In,Ze:_oxcMods5l7s3_Ze,je:_oxcMods5l7s3_je,Me:_oxcMods5l7s3_Me,ge:_oxcMods5l7s3_ge,Mn:_oxcMods5l7s3_Mn,He:_oxcMods5l7s3_He,U:_oxcMods5l7s3_U,dn:_oxcMods5l7s3_dn,_:_oxcMods5l7s3__,cn:_oxcMods5l7s3_cn,he:_oxcMods5l7s3_he,pt:_oxcMods5l7s3_pt,v:_oxcMods5l7s3_v,C:_oxcMods5l7s3_C,pr:_oxcMods5l7s3_pr,at:_oxcMods5l7s3_at,S:_oxcMods5l7s3_S,Fn:_oxcMods5l7s3_Fn,ie:_oxcMods5l7s3_ie,_n:_oxcMods5l7s3__n,gn:_oxcMods5l7s3_gn,Dn:_oxcMods5l7s3_Dn,q:_oxcMods5l7s3_q,ln:_oxcMods5l7s3_ln,un:_oxcMods5l7s3_un,X:_oxcMods5l7s3_X,G:_oxcMods5l7s3_G,jn:_oxcMods5l7s3_jn,Y:_oxcMods5l7s3_Y,hr:_oxcMods5l7s3_hr,mr:_oxcMods5l7s3_mr}=_oxcMods5l7s3;export{_oxcMods5l7s3_se as withoutNullable,_oxcMods5l7s3_Ye as videoSizeToQuality,_oxcMods5l7s3_Xe as videoQualityToHeight,_oxcMods5l7s3_Je as videoHeightToQuality,_oxcMods5l7s3_Nr as urlCanParsePolyfilled,_oxcMods5l7s3_ct as timeout,_oxcMods5l7s3_tt as timeCodeToString,_oxcMods5l7s3_rt as throttleFn,_oxcMods5l7s3_bt as throttle,_oxcMods5l7s3_Ft as tap,_oxcMods5l7s3_Xt as suppressAbort,_oxcMods5l7s3_xr as stringTrimStart,_oxcMods5l7s3_wr as stringTrimRight,_oxcMods5l7s3_Cr as stringTrimLeft,_oxcMods5l7s3_Sr as stringTrimEnd,_oxcMods5l7s3_br as stringReplaceAll,_oxcMods5l7s3_yr as stringPadStart,_oxcMods5l7s3_vr as stringPadEnd,_oxcMods5l7s3__r as stringMatchAll,_oxcMods5l7s3_gr as stringAt,_oxcMods5l7s3_Lt as skip,_oxcMods5l7s3_zt as shareReplay,_oxcMods5l7s3_Pe as safeStorage,_oxcMods5l7s3_Oe as retainTimers,_oxcMods5l7s3_Ar as requestIdleCallbackPolyfilled,_oxcMods5l7s3_ke as releaseTimers,_oxcMods5l7s3_nr as promiseWithResolvers,_oxcMods5l7s3_tr as promiseTry,_oxcMods5l7s3_er as promiseFinally,_oxcMods5l7s3_$n as promiseAny,_oxcMods5l7s3_Qn as promiseAllSettled,_oxcMods5l7s3_Nt as pairwise,_oxcMods5l7s3_Mt as once,_oxcMods5l7s3_Vt as observeElementSize,_oxcMods5l7s3_dt as observableFrom,_oxcMods5l7s3_Zn as objectValues,_oxcMods5l7s3_Xn as objectHasOwn,_oxcMods5l7s3_Jn as objectFromEntries,_oxcMods5l7s3_qn as objectEntries,_oxcMods5l7s3_de as nowInt,_oxcMods5l7s3_O as now,_oxcMods5l7s3_b as noop,_oxcMods5l7s3_st as merge,_oxcMods5l7s3_jt as mapTo,_oxcMods5l7s3_kt as map,_oxcMods5l7s3_pn as loadVKLangPack,_oxcMods5l7s3_Ut as isValidURL,_oxcMods5l7s3_T as isNullable,_oxcMods5l7s3_w as isNonNullable,_oxcMods5l7s3_Ge as isLowerOrEqual,_oxcMods5l7s3_B as isLower,_oxcMods5l7s3_V as isInvariantQuality,_oxcMods5l7s3_Wt as isIntersecting,_oxcMods5l7s3_We as isHigherOrEqual,_oxcMods5l7s3_Ue as isHigher,_oxcMods5l7s3_ue as isBrowserWindow,_oxcMods5l7s3_Yt as isAbortError,_oxcMods5l7s3_lt as interval,_oxcMods5l7s3_qt as interpolate,_oxcMods5l7s3_Mr as includesPolyfilled,_oxcMods5l7s3_Kn as globalThisPolyfill,_oxcMods5l7s3_E as getWindow,_oxcMods5l7s3_$e as getVideoQualityLabel,_oxcMods5l7s3_Qt as getTraceSubscriptionMethod,_oxcMods5l7s3_Ae as getTimersDiagnostics,_oxcMods5l7s3_D as getTimerWindow,_oxcMods5l7s3_Jt as getRangeAroundIndex,_oxcMods5l7s3_Kt as getPlayerId,_oxcMods5l7s3_Zt as getMessageFromError,_oxcMods5l7s3_Ke as getHighestQuality,_oxcMods5l7s3_Ne as getExponentialDelay,_oxcMods5l7s3_ft as fromEvent,_oxcMods5l7s3_W as flattenObject,_oxcMods5l7s3_Et as filterChanged,_oxcMods5l7s3_St as filter,_oxcMods5l7s3_et as fillWithDefault,_oxcMods5l7s3_fr as fetchPolyfilled,_oxcMods5l7s3_vn as devNull,_oxcMods5l7s3_Ve as detectEmbed,_oxcMods5l7s3_nt as debounceFn,_oxcMods5l7s3__t as debounce,_oxcMods5l7s3_Ee as createTimers,_oxcMods5l7s3_On as createDIContainer,_oxcMods5l7s3_ot as combine,_oxcMods5l7s3_H as cloneDeepWith,_oxcMods5l7s3_it as cloneDeep,_oxcMods5l7s3_Ht as clearVideoElement,_oxcMods5l7s3_ne as checkNever,_oxcMods5l7s3_jr as cancelIdleCallbackPolyfilled,_oxcMods5l7s3_mt as buffer,_oxcMods5l7s3_Tr as atPolyfilled,_oxcMods5l7s3_Qe as assertQualityIsExact,_oxcMods5l7s3_oe as assertNullable,_oxcMods5l7s3_ce as assertNotEmptyArray,_oxcMods5l7s3_ae as assertNonNullable,_oxcMods5l7s3_y as assertNever,_oxcMods5l7s3_le as assertEmptyArray,_oxcMods5l7s3_Gn as arrayWith,_oxcMods5l7s3_Wn as arrayToSpliced,_oxcMods5l7s3_Un as arrayToSorted,_oxcMods5l7s3_Hn as arrayToReversed,_oxcMods5l7s3_Vn as arrayIncludes,_oxcMods5l7s3_Bn as arrayFlatMap,_oxcMods5l7s3_zn as arrayFlat,_oxcMods5l7s3_Rn as arrayFindLastIndex,_oxcMods5l7s3_Ln as arrayFindLast,_oxcMods5l7s3_In as arrayAt,_oxcMods5l7s3_Ze as areQualitiesExact,_oxcMods5l7s3_je as addScript,_oxcMods5l7s3_Me as abortable,_oxcMods5l7s3_ge as WorkerState,_oxcMods5l7s3_Mn as VolumeFaderPlugin,_oxcMods5l7s3_He as VideoQuality,_oxcMods5l7s3_U as ValueSubject,_oxcMods5l7s3_dn as VKNumericLanguage,_oxcMods5l7s3__ as VERSION,_oxcMods5l7s3_cn as TracerFactory,_oxcMods5l7s3_he as TimerModule,_oxcMods5l7s3_pt as SubscriptionRemovable,_oxcMods5l7s3_v as Subscription,_oxcMods5l7s3_C as Subject,_oxcMods5l7s3_pr as RequestPolyfilled,_oxcMods5l7s3_at as ReplaySubject,_oxcMods5l7s3_S as Observable,_oxcMods5l7s3_Fn as NormalizerPlugin,_oxcMods5l7s3_ie as Logger,_oxcMods5l7s3__n as InternalsExposure,_oxcMods5l7s3_gn as InterfaceLanguage,_oxcMods5l7s3_Dn as InjectionToken,_oxcMods5l7s3_q as INTERNAL_EXPOSE_GLOBAL_KEY,_oxcMods5l7s3_ln as ErrorOrigin,_oxcMods5l7s3_un as ErrorCategory,_oxcMods5l7s3_X as EqualizerPlugin,_oxcMods5l7s3_G as CircularBuffer,_oxcMods5l7s3_jn as AudioGraph,_oxcMods5l7s3_Y as AppTracer,_oxcMods5l7s3_hr as AbortSignalPolyfilled,_oxcMods5l7s3_mr as AbortControllerPolyfilled};
|