@vkontakte/videoplayer-shared 1.0.31-dev.88984b6.0 → 1.0.31-dev.c49c485.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.js +3 -3
- package/es2015.esm.js +3 -3
- package/es2018.cjs.js +3 -3
- package/es2018.esm.js +3 -3
- package/esnext.cjs.js +3 -3
- package/esnext.esm.js +3 -3
- package/evergreen.esm.js +3 -3
- package/package.json +1 -1
package/es2015.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.31-dev.
|
|
3
|
-
* Fri, 27 Oct 2023 13:
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.31-dev.c49c485.0
|
|
3
|
+
* Fri, 27 Oct 2023 13:12:50 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-31/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const sn="1.0.31-dev.88984b6.0";class Y{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const C=e=>{throw new Error(`${e} is value of unexpected type`)},ln=e=>{},G=()=>{};class b{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:G}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:G,error:G};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new Y().add(()=>{switch(a.next=G,a.error=G,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return C(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class qe extends b{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new Y().add(()=>this.subscribers.delete(t))}}class cn{constructor(){this.log$=new qe,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},r),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function un(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function vn(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function tt(e){return typeof e!="undefined"&&e!==null}function nt(e){return e==null}const fn=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),c.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),c.removeEventListener("load",i),c.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",a),c.src=e,document.head.appendChild(c)});var de;const dn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now();function ot(e,r,t,n){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(l){try{c(n.next(l))}catch(u){i(u)}}function v(l){try{c(n.throw(l))}catch(u){i(u)}}function c(l){l.done?a(l.value):o(l.value).then(s,v)}c((n=n.apply(e,r||[])).next())})}const hn=(e,r)=>(...t)=>ot(void 0,void 0,void 0,function*(){var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;){const s=yield o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i});exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const Ye=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,i=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,v=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,l=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,u=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,f=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||exports.CurrentClientBrowser.Rest,device:v||c||l||u||d||f||exports.CurrentClientDevice.Desktop}},bn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},pn=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},yn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),gn=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(h||(h={}));let p,j;const he=`vk-videoplayer-dummy-key-${Math.random()}`,k=()=>{if(j!==void 0)return j;try{localStorage.setItem(he,"test"),localStorage.removeItem(he),j=h.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(he),j=h.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)j=h.RUNTIME;else throw r}else throw e}return j===h.RUNTIME&&(p=new Map),j},On=()=>k()===h.LOCAL_STORAGE,wn=e=>{var r,t;const n=k();switch(n){case h.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return p==null?void 0:p.get(e);default:C(n)}},mn=(e,r)=>{const t=k();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(p==null?void 0:p.set(e,r));default:C(t)}},$n=e=>{var r;const t=k();switch(t){case h.LOCAL_STORAGE:return e in localStorage;case h.SESSION_STORAGE:return e in sessionStorage;case h.RUNTIME:return(r=p==null?void 0:p.has(e))!==null&&r!==void 0?r:!1;default:return C(t),!1}},En=e=>{const r=k();switch(r){case h.LOCAL_STORAGE:return localStorage.removeItem(e);case h.SESSION_STORAGE:return sessionStorage.removeItem(e);case h.RUNTIME:return void(p==null?void 0:p.delete(e));default:C(r)}},Sn=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return p==null?void 0:p.clear();default:C(e)}};var Tn=Object.freeze({__proto__:null,clear:Sn,get:wn,has:$n,isPersistent:On,remove:En,set:mn});exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const $={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},In=(e,r)=>$[e].height>$[r].height,Rn=(e,r)=>$[e].height>=$[r].height,He=(e,r)=>$[e].height<$[r].height,Pn=(e,r)=>$[e].height<=$[r].height,_n=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:He(r,t)?1:-1)[0],at=Object.keys($).sort((e,r)=>He(e,r)?-1:1),An=(e,r=.02)=>[...at].find(n=>$[n].height*(1+r)>=e),jn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return at.find(o=>{const a=$[o];return a.width>=n&&a.height>=t})},Cn=e=>$[e].height,ze=e=>e===exports.VideoQuality.INVARIANT,Ln=e=>e.every(r=>!ze(r));function xn(e){if(ze(e))throw new Error("Expected exact quality")}const it=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=it(a,o):t[n]=n in e?a:o}return t};class Nn extends qe{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function Mn(e){return new b(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new Y)})}function Dn(...e){return new b(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var Fn=e=>new b(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Gn=e=>new b(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Vn=e=>new b(r=>{e.forEach(t=>r.next(t))}),kn=(e,r)=>new b(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Bn(e){return r=>new b(t=>r.subscribe(new Un(t,e)))}class Un{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Qn={leading:!1,trailing:!0};function Kn(e,r=Qn){return t=>new b(n=>t.subscribe(new qn(n,e,r)))}class qn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,tt(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Yn={leading:!0,trailing:!1};function Hn(e,r=Yn){return t=>new b(n=>t.subscribe(new zn(n,e,r)))}class zn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,nt(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Wn(e){return r=>new b(t=>r.subscribe(new Xn(t,e)))}class Xn{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Jn(e=(r,t)=>r===t){return r=>new b(t=>r.subscribe(new Zn(t,e)))}const cr={};class Zn{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=cr}next(r){let t;try{t=this.lastValue===cr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function st(e){return r=>new b(t=>r.subscribe(new eo(t,e)))}let eo=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function ro(e){return st(()=>e)}function to(){return e=>new b(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function no(){return e=>new b(r=>e.subscribe(new oo(r)))}class oo{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function ao(e){return r=>new b(t=>r.subscribe(new io(t,e)))}class io{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class ur{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class lt extends ur{constructor(){super(),this.listeners||ur.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class so{constructor(){Object.defineProperty(this,"signal",{value:new lt,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(so.prototype[Symbol.toStringTag]="AbortController",lt.prototype[Symbol.toStringTag]="AbortSignal");function ct(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 lo(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!ct({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(c,l){let u;l&&l.signal&&(u=l.signal,delete l.signal);const f=new t(c,l);return u&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:u}),f},a.prototype=t.prototype);const i=r;return{fetch:(v,c)=>{const l=a&&a.prototype.isPrototypeOf(v)?v.signal:c?c.signal:void 0;if(l){let u;try{u=new DOMException("Aborted","AbortError")}catch(d){u=new Error("Aborted"),u.name="AbortError"}if(l.aborted)return Promise.reject(u);const f=new Promise((d,O)=>{l.addEventListener("abort",()=>O(u),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([f,i(v,c)])}return i(v,c)},Request:a}}const We=ct({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ut=We?lo({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,co=We?ut.fetch:window.fetch;We?ut.Request:window.Request;var be=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P=function(e){try{return!!e()}catch(r){return!0}},vo=P,ve=!vo(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),vt=ve,ft=Function.prototype,De=ft.call,fo=vt&&ft.bind.bind(De,De),L=vt?fo:function(e){return function(){return De.apply(e,arguments)}},dt=L,ho=dt({}.toString),bo=dt("".slice),Xe=function(e){return bo(ho(e),8,-1)},po=L,yo=P,go=Xe,pe=Object,Oo=po("".split),wo=yo(function(){return!pe("z").propertyIsEnumerable(0)})?function(e){return go(e)=="String"?Oo(e,""):pe(e)}:pe,Je=function(e){return e==null},mo=Je,$o=TypeError,ht=function(e){if(mo(e))throw $o("Can't call method on "+e);return e},Eo=wo,So=ht,H=function(e){return Eo(So(e))},B={},X=function(e){return e&&e.Math==Math&&e},S=X(typeof globalThis=="object"&&globalThis)||X(typeof window=="object"&&window)||X(typeof self=="object"&&self)||X(typeof be=="object"&&be)||function(){return this}()||be||Function("return this")(),Fe=typeof document=="object"&&document.all,To=typeof Fe=="undefined"&&Fe!==void 0,bt={all:Fe,IS_HTMLDDA:To},pt=bt,Io=pt.all,T=pt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Io}:function(e){return typeof e=="function"},Ro=S,Po=T,vr=Ro.WeakMap,_o=Po(vr)&&/native code/.test(String(vr)),fr=T,yt=bt,Ao=yt.all,U=yt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===Ao}:function(e){return typeof e=="object"?e!==null:fr(e)},jo=P,x=!jo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},Co=S,dr=U,Ge=Co.document,Lo=dr(Ge)&&dr(Ge.createElement),gt=function(e){return Lo?Ge.createElement(e):{}},xo=x,No=P,Mo=gt,Ot=!xo&&!No(function(){return Object.defineProperty(Mo("div"),"a",{get:function(){return 7}}).a!=7}),Do=x,Fo=P,wt=Do&&Fo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Go=U,Vo=String,ko=TypeError,K=function(e){if(Go(e))return e;throw ko(Vo(e)+" is not an object")},Bo=ve,J=Function.prototype.call,N=Bo?J.bind(J):function(){return J.apply(J,arguments)},Ze={},ye=Ze,ge=S,Uo=T,hr=function(e){return Uo(e)?e:void 0},mt=function(e,r){return arguments.length<2?hr(ye[e])||hr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},Qo=L,$t=Qo({}.isPrototypeOf),Ko=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Et=S,Oe=Ko,br=Et.process,pr=Et.Deno,yr=br&&br.versions||pr&&pr.version,gr=yr&&yr.v8,E,le;gr&&(E=gr.split("."),le=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!le&&Oe&&(E=Oe.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=Oe.match(/Chrome\/(\d+)/),E&&(le=+E[1])));var qo=le,Or=qo,Yo=P,Ho=S,zo=Ho.String,St=!!Object.getOwnPropertySymbols&&!Yo(function(){var e=Symbol();return!zo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Or&&Or<41}),Wo=St,Tt=Wo&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Xo=mt,Jo=T,Zo=$t,ea=Tt,ra=Object,It=ea?function(e){return typeof e=="symbol"}:function(e){var r=Xo("Symbol");return Jo(r)&&Zo(r.prototype,ra(e))},ta=String,er=function(e){try{return ta(e)}catch(r){return"Object"}},na=T,oa=er,aa=TypeError,rr=function(e){if(na(e))return e;throw aa(oa(e)+" is not a function")},ia=rr,sa=Je,tr=function(e,r){var t=e[r];return sa(t)?void 0:ia(t)},we=N,me=T,$e=U,la=TypeError,ca=function(e,r){var t,n;if(r==="string"&&me(t=e.toString)&&!$e(n=we(t,e))||me(t=e.valueOf)&&!$e(n=we(t,e))||r!=="string"&&me(t=e.toString)&&!$e(n=we(t,e)))return n;throw la("Can't convert object to primitive value")},Rt={exports:{}},wr=S,ua=Object.defineProperty,va=function(e,r){try{ua(wr,e,{value:r,configurable:!0,writable:!0})}catch(t){wr[e]=r}return r},fa=S,da=va,mr="__core-js_shared__",ha=fa[mr]||da(mr,{}),Pt=ha,$r=Pt;(Rt.exports=function(e,r){return $r[e]||($r[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var _t=Rt.exports,ba=ht,pa=Object,At=function(e){return pa(ba(e))},ya=L,ga=At,Oa=ya({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return Oa(ga(r),t)},wa=L,ma=0,$a=Math.random(),Ea=wa(1 .toString),jt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Ea(++ma+$a,36)},Sa=S,Ta=_t,Er=A,Ia=jt,Ra=St,Pa=Tt,V=Sa.Symbol,Ee=Ta("wks"),_a=Pa?V.for||V:V&&V.withoutSetter||Ia,_=function(e){return Er(Ee,e)||(Ee[e]=Ra&&Er(V,e)?V[e]:_a("Symbol."+e)),Ee[e]},Aa=N,Sr=U,Tr=It,ja=tr,Ca=ca,La=_,xa=TypeError,Na=La("toPrimitive"),Ma=function(e,r){if(!Sr(e)||Tr(e))return e;var t=ja(e,Na),n;if(t){if(r===void 0&&(r="default"),n=Aa(t,e,r),!Sr(n)||Tr(n))return n;throw xa("Can't convert object to primitive value")}return r===void 0&&(r="number"),Ca(e,r)},Da=Ma,Fa=It,nr=function(e){var r=Da(e,"string");return Fa(r)?r:r+""},Ga=x,Va=Ot,ka=wt,Z=K,Ir=nr,Ba=TypeError,Se=Object.defineProperty,Ua=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Re="writable";Q.f=Ga?ka?function(r,t,n){if(Z(r),t=Ir(t),Z(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Re in n&&!n[Re]){var o=Ua(r,t);o&&o[Re]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:o[Ie],enumerable:Te in n?n[Te]:o[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Ir(t),Z(n),Va)try{return Se(r,t,n)}catch(o){}if("get"in n||"set"in n)throw Ba("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var fe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Qa=x,Ka=Q,qa=fe,z=Qa?function(e,r,t){return Ka.f(e,r,qa(1,t))}:function(e,r,t){return e[r]=t,e},Ya=_t,Ha=jt,Rr=Ya("keys"),or=function(e){return Rr[e]||(Rr[e]=Ha(e))},ar={},za=_o,Ct=S,Wa=U,Xa=z,Pe=A,_e=Pt,Ja=or,Za=ar,Pr="Object already initialized",Ve=Ct.TypeError,ei=Ct.WeakMap,ce,q,ue,ri=function(e){return ue(e)?q(e):ce(e,{})},ti=function(e){return function(r){var t;if(!Wa(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(za||_e.state){var I=_e.state||(_e.state=new ei);I.get=I.get,I.has=I.has,I.set=I.set,ce=function(e,r){if(I.has(e))throw Ve(Pr);return r.facade=e,I.set(e,r),r},q=function(e){return I.get(e)||{}},ue=function(e){return I.has(e)}}else{var M=Ja("state");Za[M]=!0,ce=function(e,r){if(Pe(e,M))throw Ve(Pr);return r.facade=e,Xa(e,M,r),r},q=function(e){return Pe(e,M)?e[M]:{}},ue=function(e){return Pe(e,M)}}var ni={set:ce,get:q,has:ue,enforce:ri,getterFor:ti},oi=ve,Lt=Function.prototype,_r=Lt.apply,Ar=Lt.call,ai=typeof Reflect=="object"&&Reflect.apply||(oi?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),ii=Xe,si=L,xt=function(e){if(ii(e)==="Function")return si(e)},Nt={},Mt={},Dt={}.propertyIsEnumerable,Ft=Object.getOwnPropertyDescriptor,li=Ft&&!Dt.call({1:2},1);Mt.f=li?function(r){var t=Ft(this,r);return!!t&&t.enumerable}:Dt;var ci=x,ui=N,vi=Mt,fi=fe,di=H,hi=nr,bi=A,pi=Ot,jr=Object.getOwnPropertyDescriptor;Nt.f=ci?jr:function(r,t){if(r=di(r),t=hi(t),pi)try{return jr(r,t)}catch(n){}if(bi(r,t))return fi(!ui(vi.f,r,t),r[t])};var yi=P,gi=T,Oi=/#|\.prototype\./,W=function(e,r){var t=mi[wi(e)];return t==Ei?!0:t==$i?!1:gi(r)?yi(r):!!r},wi=W.normalize=function(e){return String(e).replace(Oi,".").toLowerCase()},mi=W.data={},$i=W.NATIVE="N",Ei=W.POLYFILL="P",Si=W,Cr=xt,Ti=rr,Ii=ve,Ri=Cr(Cr.bind),Gt=function(e,r){return Ti(e),r===void 0?e:Ii?Ri(e,r):function(){return e.apply(r,arguments)}},ee=S,Pi=ai,_i=xt,Ai=T,ji=Nt.f,Ci=Si,D=Ze,Li=Gt,F=z,Lr=A,xi=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return Pi(e,this,arguments)};return r.prototype=e.prototype,r},Vt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?ee:o?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,c,l,u,f,d,O,m,w,y;for(f in r)c=Ci(n?f:t+(o?".":"#")+f,e.forced),l=!c&&i&&Lr(i,f),O=s[f],l&&(e.dontCallGetSet?(y=ji(i,f),m=y&&y.value):m=i[f]),d=l&&m?m:r[f],!(l&&typeof O==typeof d)&&(e.bind&&l?w=Li(d,ee):e.wrap&&l?w=xi(d):a&&Ai(d)?w=_i(d):w=d,(e.sham||d&&d.sham||O&&O.sham)&&F(w,"sham",!0),F(s,f,w),a&&(u=t+"Prototype",Lr(D,u)||F(D,u,{}),F(D[u],f,d),e.real&&v&&(c||!v[f])&&F(v,f,d)))},ke=x,Ni=A,kt=Function.prototype,Mi=ke&&Object.getOwnPropertyDescriptor,ir=Ni(kt,"name"),Di=ir&&function(){}.name==="something",Fi=ir&&(!ke||ke&&Mi(kt,"name").configurable),Gi={EXISTS:ir,PROPER:Di,CONFIGURABLE:Fi},Bt={},Vi=Math.ceil,ki=Math.floor,Bi=Math.trunc||function(r){var t=+r;return(t>0?ki:Vi)(t)},Ui=Bi,Ut=function(e){var r=+e;return r!==r||r===0?0:Ui(r)},Qi=Ut,Ki=Math.max,qi=Math.min,Yi=function(e,r){var t=Qi(e);return t<0?Ki(t+r,0):qi(t,r)},Hi=Ut,zi=Math.min,Wi=function(e){return e>0?zi(Hi(e),9007199254740991):0},Xi=Wi,Qt=function(e){return Xi(e.length)},Ji=H,Zi=Yi,es=Qt,xr=function(e){return function(r,t,n){var o=Ji(r),a=es(o),i=Zi(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},rs={includes:xr(!0),indexOf:xr(!1)},ts=L,Ae=A,ns=H,os=rs.indexOf,as=ar,Nr=ts([].push),is=function(e,r){var t=ns(e),n=0,o=[],a;for(a in t)!Ae(as,a)&&Ae(t,a)&&Nr(o,a);for(;r.length>n;)Ae(t,a=r[n++])&&(~os(o,a)||Nr(o,a));return o},Kt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ss=is,ls=Kt,cs=Object.keys||function(r){return ss(r,ls)},us=x,vs=wt,fs=Q,ds=K,hs=H,bs=cs;Bt.f=us&&!vs?Object.defineProperties:function(r,t){ds(r);for(var n=hs(t),o=bs(t),a=o.length,i=0,s;a>i;)fs.f(r,s=o[i++],n[s]);return r};var ps=mt,ys=ps("document","documentElement"),gs=K,Os=Bt,Mr=Kt,ws=ar,ms=ys,$s=gt,Es=or,Dr=">",Fr="<",Be="prototype",Ue="script",qt=Es("IE_PROTO"),je=function(){},Yt=function(e){return Fr+Ue+Dr+e+Fr+"/"+Ue+Dr},Gr=function(e){e.write(Yt("")),e.close();var r=e.parentWindow.Object;return e=null,r},Ss=function(){var e=$s("iframe"),r="java"+Ue+":",t;return e.style.display="none",ms.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Yt("document.F=Object")),t.close(),t.F},re,ae=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}ae=typeof document!="undefined"?document.domain&&re?Gr(re):Ss():Gr(re);for(var e=Mr.length;e--;)delete ae[Be][Mr[e]];return ae()};ws[qt]=!0;var Ht=Object.create||function(r,t){var n;return r!==null?(je[Be]=gs(r),n=new je,je[Be]=null,n[qt]=r):n=ae(),t===void 0?n:Os.f(n,t)},Ts=P,Is=!Ts(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Rs=A,Ps=T,_s=At,As=or,js=Is,Vr=As("IE_PROTO"),Qe=Object,Cs=Qe.prototype,zt=js?Qe.getPrototypeOf:function(e){var r=_s(e);if(Rs(r,Vr))return r[Vr];var t=r.constructor;return Ps(t)&&r instanceof t?t.prototype:r instanceof Qe?Cs:null},Ls=z,Wt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Ls(e,r,t),e},xs=P,Ns=T,Ms=U,Ds=Ht,kr=zt,Fs=Wt,Gs=_,Ke=Gs("iterator"),Xt=!1,R,Ce,Le;[].keys&&(Le=[].keys(),"next"in Le?(Ce=kr(kr(Le)),Ce!==Object.prototype&&(R=Ce)):Xt=!0);var Vs=!Ms(R)||xs(function(){var e={};return R[Ke].call(e)!==e});Vs?R={}:R=Ds(R);Ns(R[Ke])||Fs(R,Ke,function(){return this});var Jt={IteratorPrototype:R,BUGGY_SAFARI_ITERATORS:Xt},ks=_,Bs=ks("toStringTag"),Zt={};Zt[Bs]="z";var sr=String(Zt)==="[object z]",Us=sr,Qs=T,ie=Xe,Ks=_,qs=Ks("toStringTag"),Ys=Object,Hs=ie(function(){return arguments}())=="Arguments",zs=function(e,r){try{return e[r]}catch(t){}},lr=Us?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=zs(r=Ys(e),qs))=="string"?t:Hs?ie(r):(n=ie(r))=="Object"&&Qs(r.callee)?"Arguments":n},Ws=sr,Xs=lr,Js=Ws?{}.toString:function(){return"[object "+Xs(this)+"]"},Zs=sr,el=Q.f,rl=z,tl=A,nl=Js,ol=_,Br=ol("toStringTag"),en=function(e,r,t,n){if(e){var o=t?e:e.prototype;tl(o,Br)||el(o,Br,{configurable:!0,value:r}),n&&!Zs&&rl(o,"toString",nl)}},al=Jt.IteratorPrototype,il=Ht,sl=fe,ll=en,cl=B,ul=function(){return this},vl=function(e,r,t,n){var o=r+" Iterator";return e.prototype=il(al,{next:sl(+!n,t)}),ll(e,o,!1,!0),cl[o]=ul,e},fl=Vt,dl=N,rn=Gi,hl=vl,bl=zt,pl=en,Ur=Wt,yl=_,Qr=B,tn=Jt,gl=rn.PROPER;rn.CONFIGURABLE;tn.IteratorPrototype;var te=tn.BUGGY_SAFARI_ITERATORS,xe=yl("iterator"),Kr="keys",ne="values",qr="entries",Ol=function(){return this},wl=function(e,r,t,n,o,a,i){hl(t,r,n);var s=function(y){if(y===o&&f)return f;if(!te&&y in l)return l[y];switch(y){case Kr:return function(){return new t(this,y)};case ne:return function(){return new t(this,y)};case qr:return function(){return new t(this,y)}}return function(){return new t(this)}},v=r+" Iterator",c=!1,l=e.prototype,u=l[xe]||l["@@iterator"]||o&&l[o],f=!te&&u||s(o),d=r=="Array"&&l.entries||u,O,m,w;if(d&&(O=bl(d.call(new e)),O!==Object.prototype&&O.next&&(pl(O,v,!0,!0),Qr[v]=Ol)),gl&&o==ne&&u&&u.name!==ne&&(c=!0,f=function(){return dl(u,this)}),o)if(m={values:s(ne),keys:a?f:s(Kr),entries:s(qr)},i)for(w in m)(te||c||!(w in l))&&Ur(l,w,m[w]);else fl({target:r,proto:!0,forced:te||c},m);return i&&l[xe]!==f&&Ur(l,xe,f,{name:o}),Qr[r]=f,m},ml=function(e,r){return{value:e,done:r}},$l=H,Yr=B,nn=ni;Q.f;var El=wl,oe=ml,on="Array Iterator",Sl=nn.set,Tl=nn.getterFor(on);El(Array,"Array",function(e,r){Sl(this,{type:on,target:$l(e),index:0,kind:r})},function(){var e=Tl(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,oe(void 0,!0)):t=="keys"?oe(n,!1):t=="values"?oe(r[n],!1):oe([n,r[n]],!1)},"values");Yr.Arguments=Yr.Array;var Il=_,Rl=B,Pl=Il("iterator"),_l=Array.prototype,Al=function(e){return e!==void 0&&(Rl.Array===e||_l[Pl]===e)},jl=lr,Hr=tr,Cl=Je,Ll=B,xl=_,Nl=xl("iterator"),an=function(e){if(!Cl(e))return Hr(e,Nl)||Hr(e,"@@iterator")||Ll[jl(e)]},Ml=N,Dl=rr,Fl=K,Gl=er,Vl=an,kl=TypeError,Bl=function(e,r){var t=arguments.length<2?Vl(e):r;if(Dl(t))return Fl(Ml(t,e));throw kl(Gl(e)+" is not iterable")},Ul=N,zr=K,Ql=tr,Kl=function(e,r,t){var n,o;zr(e);try{if(n=Ql(e,"return"),!n){if(r==="throw")throw t;return t}n=Ul(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return zr(n),t},ql=Gt,Yl=N,Hl=K,zl=er,Wl=Al,Xl=Qt,Wr=$t,Jl=Bl,Zl=an,Xr=Kl,ec=TypeError,se=function(e,r){this.stopped=e,this.result=r},Jr=se.prototype,rc=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=ql(r,n),c,l,u,f,d,O,m,w=function(g){return c&&Xr(c,"normal",g),new se(!0,g)},y=function(g){return o?(Hl(g),s?v(g[0],g[1],w):v(g[0],g[1])):s?v(g,w):v(g)};if(a)c=e.iterator;else if(i)c=e;else{if(l=Zl(e),!l)throw ec(zl(e)+" is not iterable");if(Wl(l)){for(u=0,f=Xl(e);f>u;u++)if(d=y(e[u]),d&&Wr(Jr,d))return d;return new se(!1)}c=Jl(e,l)}for(O=a?e.next:c.next;!(m=Yl(O,c)).done;){try{d=y(m.value)}catch(g){Xr(c,"throw",g)}if(typeof d=="object"&&d&&Wr(Jr,d))return d}return new se(!1)},tc=nr,nc=Q,oc=fe,ac=function(e,r,t){var n=tc(r);n in e?nc.f(e,n,oc(0,t)):e[n]=t},ic=Vt,sc=rc,lc=ac;ic({target:"Object",stat:!0},{fromEntries:function(r){var t={};return sc(r,function(n,o){lc(t,n,o)},{AS_ENTRIES:!0}),t}});var cc=Ze,uc=cc.Object.fromEntries,vc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},fc=vc,dc=S,hc=lr,bc=z,Zr=B,pc=_,et=pc("toStringTag");for(var Ne in fc){var rt=dc[Ne],Me=rt&&rt.prototype;Me&&hc(Me)!==et&&bc(Me,et,Ne),Zr[Ne]=Zr.Array}var yc=uc,gc=yc,Oc=gc,wc=Oc,mc=uo(wc);exports.VKNumericLanguage=void 0;(function(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"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const $c="vk.com",Ec=(e,r,t)=>ot(void 0,void 0,void 0,function*(){const n=new URL(`https://${$c}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=yield(yield co(n.toString())).json();return Sc(a,t)}),Sc=(e,r)=>mc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Tc(n)])),Tc=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=cn;exports.Observable=b;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=sn;exports.ValueSubject=Nn;exports.abortable=hn;exports.addScript=fn;exports.areQualitiesExact=Ln;exports.assertNever=C;exports.assertNonNullable=un;exports.assertNullable=vn;exports.assertQualityIsExact=xn;exports.buffer=Bn;exports.checkNever=ln;exports.combine=Mn;exports.debounce=Kn;exports.fillWithDefault=it;exports.filter=Wn;exports.filterChanged=Jn;exports.fromEvent=kn;exports.getCurrentBrowser=Ye;exports.getExponentialDelay=gn;exports.getHighestQuality=_n;exports.getIOSVersion=pn;exports.interval=Gn;exports.isHigher=In;exports.isHigherOrEqual=Rn;exports.isIOS=bn;exports.isInvariantQuality=ze;exports.isLower=He;exports.isLowerOrEqual=Pn;exports.isMacLike=yn;exports.isNonNullable=tt;exports.isNullable=nt;exports.loadVKLangPack=Ec;exports.map=st;exports.mapTo=ro;exports.merge=Dn;exports.noop=G;exports.now=dn;exports.observableFrom=Vn;exports.once=to;exports.pairwise=no;exports.safeStorage=Tn;exports.tap=ao;exports.throttle=Hn;exports.timeout=Fn;exports.videoHeightToQuality=An;exports.videoQualityToHeight=Cn;exports.videoSizeToQuality=jn;
|
|
6
|
+
"use strict";const sn="1.0.31-dev.c49c485.0";class Y{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const C=e=>{throw new Error(`${e} is value of unexpected type`)},cn=e=>{},G=()=>{};class b{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:G}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:G,error:G};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new Y().add(()=>{switch(a.next=G,a.error=G,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return C(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class qe extends b{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new Y().add(()=>this.subscribers.delete(t))}}class ln{constructor(){this.log$=new qe,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},r),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function un(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function vn(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function tt(e){return typeof e!="undefined"&&e!==null}function nt(e){return e==null}const fn=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),l.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var de;const dn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now();function ot(e,r,t,n){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(c){try{l(n.next(c))}catch(u){i(u)}}function v(c){try{l(n.throw(c))}catch(u){i(u)}}function l(c){c.done?a(c.value):o(c.value).then(s,v)}l((n=n.apply(e,r||[])).next())})}const hn=(e,r)=>(...t)=>ot(void 0,void 0,void 0,function*(){var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;){const s=yield o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i});exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const Ye=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,o=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,i=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,v=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,l=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,c=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,u=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,f=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||exports.CurrentClientBrowser.Rest,device:v||l||c||u||d||f||exports.CurrentClientDevice.Desktop}},bn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},pn=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},yn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),gn=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(h||(h={}));let p,j;const he=`vk-videoplayer-dummy-key-${Math.random()}`,k=()=>{if(j!==void 0)return j;try{localStorage.setItem(he,"test"),localStorage.removeItem(he),j=h.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(he),j=h.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)j=h.RUNTIME;else throw r}else throw e}return j===h.RUNTIME&&(p=new Map),j},On=()=>k()===h.LOCAL_STORAGE,wn=e=>{var r,t;const n=k();switch(n){case h.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return p==null?void 0:p.get(e);default:C(n)}},mn=(e,r)=>{const t=k();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(p==null?void 0:p.set(e,r));default:C(t)}},$n=e=>{var r;const t=k();switch(t){case h.LOCAL_STORAGE:return e in localStorage;case h.SESSION_STORAGE:return e in sessionStorage;case h.RUNTIME:return(r=p==null?void 0:p.has(e))!==null&&r!==void 0?r:!1;default:return C(t),!1}},En=e=>{const r=k();switch(r){case h.LOCAL_STORAGE:return localStorage.removeItem(e);case h.SESSION_STORAGE:return sessionStorage.removeItem(e);case h.RUNTIME:return void(p==null?void 0:p.delete(e));default:C(r)}},Sn=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return p==null?void 0:p.clear();default:C(e)}};var Tn=Object.freeze({__proto__:null,clear:Sn,get:wn,has:$n,isPersistent:On,remove:En,set:mn});exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const $={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},In=(e,r)=>$[e].height>$[r].height,Rn=(e,r)=>$[e].height>=$[r].height,He=(e,r)=>$[e].height<$[r].height,Pn=(e,r)=>$[e].height<=$[r].height,_n=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:He(r,t)?1:-1)[0],at=Object.keys($).sort((e,r)=>He(e,r)?-1:1),An=(e,r=.02)=>[...at].find(n=>$[n].height*(1+r)>=e),jn=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return at.find(o=>{const a=$[o];return a.width>=n&&a.height>=t})},Cn=e=>$[e].height,ze=e=>e===exports.VideoQuality.INVARIANT,Ln=e=>e.every(r=>!ze(r));function xn(e){if(ze(e))throw new Error("Expected exact quality")}const it=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=it(a,o):t[n]=n in e?a:o}return t};class Nn extends qe{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function Mn(e){return new b(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new Y)})}function Dn(...e){return new b(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var Fn=e=>new b(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Gn=e=>new b(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Vn=e=>new b(r=>{e.forEach(t=>r.next(t))}),kn=(e,r)=>new b(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function Bn(e){return r=>new b(t=>r.subscribe(new Un(t,e)))}class Un{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Qn={leading:!1,trailing:!0};function Kn(e,r=Qn){return t=>new b(n=>t.subscribe(new qn(n,e,r)))}class qn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,tt(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Yn={leading:!0,trailing:!1};function Hn(e,r=Yn){return t=>new b(n=>t.subscribe(new zn(n,e,r)))}class zn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,nt(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Wn(e){return r=>new b(t=>r.subscribe(new Xn(t,e)))}class Xn{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Jn(e=(r,t)=>r===t){return r=>new b(t=>r.subscribe(new Zn(t,e)))}const lr={};class Zn{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=lr}next(r){let t;try{t=this.lastValue===lr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function st(e){return r=>new b(t=>r.subscribe(new eo(t,e)))}let eo=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function ro(e){return st(()=>e)}function to(){return e=>new b(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function no(){return e=>new b(r=>e.subscribe(new oo(r)))}class oo{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function ao(e){return r=>new b(t=>r.subscribe(new io(t,e)))}class io{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class ur{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class ct extends ur{constructor(){super(),this.listeners||ur.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class so{constructor(){Object.defineProperty(this,"signal",{value:new ct,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(so.prototype[Symbol.toStringTag]="AbortController",ct.prototype[Symbol.toStringTag]="AbortSignal");function lt(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 co(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!lt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(l,c){let u;c&&c.signal&&(u=c.signal,delete c.signal);const f=new t(l,c);return u&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:u}),f},a.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=a&&a.prototype.isPrototypeOf(v)?v.signal:l?l.signal:void 0;if(c){let u;try{u=new DOMException("Aborted","AbortError")}catch(d){u=new Error("Aborted"),u.name="AbortError"}if(c.aborted)return Promise.reject(u);const f=new Promise((d,O)=>{c.addEventListener("abort",()=>O(u),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([f,i(v,l)])}return i(v,l)},Request:a}}const We=lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ut=We?co({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,lo=We?ut.fetch:window.fetch;We?ut.Request:window.Request;var be=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function uo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P=function(e){try{return!!e()}catch(r){return!0}},vo=P,ve=!vo(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),vt=ve,ft=Function.prototype,De=ft.call,fo=vt&&ft.bind.bind(De,De),L=vt?fo:function(e){return function(){return De.apply(e,arguments)}},dt=L,ho=dt({}.toString),bo=dt("".slice),Xe=function(e){return bo(ho(e),8,-1)},po=L,yo=P,go=Xe,pe=Object,Oo=po("".split),wo=yo(function(){return!pe("z").propertyIsEnumerable(0)})?function(e){return go(e)=="String"?Oo(e,""):pe(e)}:pe,Je=function(e){return e==null},mo=Je,$o=TypeError,ht=function(e){if(mo(e))throw $o("Can't call method on "+e);return e},Eo=wo,So=ht,H=function(e){return Eo(So(e))},B={},X=function(e){return e&&e.Math==Math&&e},S=X(typeof globalThis=="object"&&globalThis)||X(typeof window=="object"&&window)||X(typeof self=="object"&&self)||X(typeof be=="object"&&be)||function(){return this}()||be||Function("return this")(),Fe=typeof document=="object"&&document.all,To=typeof Fe=="undefined"&&Fe!==void 0,bt={all:Fe,IS_HTMLDDA:To},pt=bt,Io=pt.all,T=pt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Io}:function(e){return typeof e=="function"},Ro=S,Po=T,vr=Ro.WeakMap,_o=Po(vr)&&/native code/.test(String(vr)),fr=T,yt=bt,Ao=yt.all,U=yt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===Ao}:function(e){return typeof e=="object"?e!==null:fr(e)},jo=P,x=!jo(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},Co=S,dr=U,Ge=Co.document,Lo=dr(Ge)&&dr(Ge.createElement),gt=function(e){return Lo?Ge.createElement(e):{}},xo=x,No=P,Mo=gt,Ot=!xo&&!No(function(){return Object.defineProperty(Mo("div"),"a",{get:function(){return 7}}).a!=7}),Do=x,Fo=P,wt=Do&&Fo(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Go=U,Vo=String,ko=TypeError,K=function(e){if(Go(e))return e;throw ko(Vo(e)+" is not an object")},Bo=ve,J=Function.prototype.call,N=Bo?J.bind(J):function(){return J.apply(J,arguments)},Ze={},ye=Ze,ge=S,Uo=T,hr=function(e){return Uo(e)?e:void 0},mt=function(e,r){return arguments.length<2?hr(ye[e])||hr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},Qo=L,$t=Qo({}.isPrototypeOf),Ko=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Et=S,Oe=Ko,br=Et.process,pr=Et.Deno,yr=br&&br.versions||pr&&pr.version,gr=yr&&yr.v8,E,ce;gr&&(E=gr.split("."),ce=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!ce&&Oe&&(E=Oe.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=Oe.match(/Chrome\/(\d+)/),E&&(ce=+E[1])));var qo=ce,Or=qo,Yo=P,Ho=S,zo=Ho.String,St=!!Object.getOwnPropertySymbols&&!Yo(function(){var e=Symbol();return!zo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Or&&Or<41}),Wo=St,Tt=Wo&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Xo=mt,Jo=T,Zo=$t,ea=Tt,ra=Object,It=ea?function(e){return typeof e=="symbol"}:function(e){var r=Xo("Symbol");return Jo(r)&&Zo(r.prototype,ra(e))},ta=String,er=function(e){try{return ta(e)}catch(r){return"Object"}},na=T,oa=er,aa=TypeError,rr=function(e){if(na(e))return e;throw aa(oa(e)+" is not a function")},ia=rr,sa=Je,tr=function(e,r){var t=e[r];return sa(t)?void 0:ia(t)},we=N,me=T,$e=U,ca=TypeError,la=function(e,r){var t,n;if(r==="string"&&me(t=e.toString)&&!$e(n=we(t,e))||me(t=e.valueOf)&&!$e(n=we(t,e))||r!=="string"&&me(t=e.toString)&&!$e(n=we(t,e)))return n;throw ca("Can't convert object to primitive value")},Rt={exports:{}},wr=S,ua=Object.defineProperty,va=function(e,r){try{ua(wr,e,{value:r,configurable:!0,writable:!0})}catch(t){wr[e]=r}return r},fa=S,da=va,mr="__core-js_shared__",ha=fa[mr]||da(mr,{}),Pt=ha,$r=Pt;(Rt.exports=function(e,r){return $r[e]||($r[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var _t=Rt.exports,ba=ht,pa=Object,At=function(e){return pa(ba(e))},ya=L,ga=At,Oa=ya({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return Oa(ga(r),t)},wa=L,ma=0,$a=Math.random(),Ea=wa(1 .toString),jt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Ea(++ma+$a,36)},Sa=S,Ta=_t,Er=A,Ia=jt,Ra=St,Pa=Tt,V=Sa.Symbol,Ee=Ta("wks"),_a=Pa?V.for||V:V&&V.withoutSetter||Ia,_=function(e){return Er(Ee,e)||(Ee[e]=Ra&&Er(V,e)?V[e]:_a("Symbol."+e)),Ee[e]},Aa=N,Sr=U,Tr=It,ja=tr,Ca=la,La=_,xa=TypeError,Na=La("toPrimitive"),Ma=function(e,r){if(!Sr(e)||Tr(e))return e;var t=ja(e,Na),n;if(t){if(r===void 0&&(r="default"),n=Aa(t,e,r),!Sr(n)||Tr(n))return n;throw xa("Can't convert object to primitive value")}return r===void 0&&(r="number"),Ca(e,r)},Da=Ma,Fa=It,nr=function(e){var r=Da(e,"string");return Fa(r)?r:r+""},Ga=x,Va=Ot,ka=wt,Z=K,Ir=nr,Ba=TypeError,Se=Object.defineProperty,Ua=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Re="writable";Q.f=Ga?ka?function(r,t,n){if(Z(r),t=Ir(t),Z(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Re in n&&!n[Re]){var o=Ua(r,t);o&&o[Re]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:o[Ie],enumerable:Te in n?n[Te]:o[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Ir(t),Z(n),Va)try{return Se(r,t,n)}catch(o){}if("get"in n||"set"in n)throw Ba("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var fe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Qa=x,Ka=Q,qa=fe,z=Qa?function(e,r,t){return Ka.f(e,r,qa(1,t))}:function(e,r,t){return e[r]=t,e},Ya=_t,Ha=jt,Rr=Ya("keys"),or=function(e){return Rr[e]||(Rr[e]=Ha(e))},ar={},za=_o,Ct=S,Wa=U,Xa=z,Pe=A,_e=Pt,Ja=or,Za=ar,Pr="Object already initialized",Ve=Ct.TypeError,ei=Ct.WeakMap,le,q,ue,ri=function(e){return ue(e)?q(e):le(e,{})},ti=function(e){return function(r){var t;if(!Wa(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(za||_e.state){var I=_e.state||(_e.state=new ei);I.get=I.get,I.has=I.has,I.set=I.set,le=function(e,r){if(I.has(e))throw Ve(Pr);return r.facade=e,I.set(e,r),r},q=function(e){return I.get(e)||{}},ue=function(e){return I.has(e)}}else{var M=Ja("state");Za[M]=!0,le=function(e,r){if(Pe(e,M))throw Ve(Pr);return r.facade=e,Xa(e,M,r),r},q=function(e){return Pe(e,M)?e[M]:{}},ue=function(e){return Pe(e,M)}}var ni={set:le,get:q,has:ue,enforce:ri,getterFor:ti},oi=ve,Lt=Function.prototype,_r=Lt.apply,Ar=Lt.call,ai=typeof Reflect=="object"&&Reflect.apply||(oi?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),ii=Xe,si=L,xt=function(e){if(ii(e)==="Function")return si(e)},Nt={},Mt={},Dt={}.propertyIsEnumerable,Ft=Object.getOwnPropertyDescriptor,ci=Ft&&!Dt.call({1:2},1);Mt.f=ci?function(r){var t=Ft(this,r);return!!t&&t.enumerable}:Dt;var li=x,ui=N,vi=Mt,fi=fe,di=H,hi=nr,bi=A,pi=Ot,jr=Object.getOwnPropertyDescriptor;Nt.f=li?jr:function(r,t){if(r=di(r),t=hi(t),pi)try{return jr(r,t)}catch(n){}if(bi(r,t))return fi(!ui(vi.f,r,t),r[t])};var yi=P,gi=T,Oi=/#|\.prototype\./,W=function(e,r){var t=mi[wi(e)];return t==Ei?!0:t==$i?!1:gi(r)?yi(r):!!r},wi=W.normalize=function(e){return String(e).replace(Oi,".").toLowerCase()},mi=W.data={},$i=W.NATIVE="N",Ei=W.POLYFILL="P",Si=W,Cr=xt,Ti=rr,Ii=ve,Ri=Cr(Cr.bind),Gt=function(e,r){return Ti(e),r===void 0?e:Ii?Ri(e,r):function(){return e.apply(r,arguments)}},ee=S,Pi=ai,_i=xt,Ai=T,ji=Nt.f,Ci=Si,D=Ze,Li=Gt,F=z,Lr=A,xi=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return Pi(e,this,arguments)};return r.prototype=e.prototype,r},Vt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?ee:o?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,l,c,u,f,d,O,m,w,y;for(f in r)l=Ci(n?f:t+(o?".":"#")+f,e.forced),c=!l&&i&&Lr(i,f),O=s[f],c&&(e.dontCallGetSet?(y=ji(i,f),m=y&&y.value):m=i[f]),d=c&&m?m:r[f],!(c&&typeof O==typeof d)&&(e.bind&&c?w=Li(d,ee):e.wrap&&c?w=xi(d):a&&Ai(d)?w=_i(d):w=d,(e.sham||d&&d.sham||O&&O.sham)&&F(w,"sham",!0),F(s,f,w),a&&(u=t+"Prototype",Lr(D,u)||F(D,u,{}),F(D[u],f,d),e.real&&v&&(l||!v[f])&&F(v,f,d)))},ke=x,Ni=A,kt=Function.prototype,Mi=ke&&Object.getOwnPropertyDescriptor,ir=Ni(kt,"name"),Di=ir&&function(){}.name==="something",Fi=ir&&(!ke||ke&&Mi(kt,"name").configurable),Gi={EXISTS:ir,PROPER:Di,CONFIGURABLE:Fi},Bt={},Vi=Math.ceil,ki=Math.floor,Bi=Math.trunc||function(r){var t=+r;return(t>0?ki:Vi)(t)},Ui=Bi,Ut=function(e){var r=+e;return r!==r||r===0?0:Ui(r)},Qi=Ut,Ki=Math.max,qi=Math.min,Yi=function(e,r){var t=Qi(e);return t<0?Ki(t+r,0):qi(t,r)},Hi=Ut,zi=Math.min,Wi=function(e){return e>0?zi(Hi(e),9007199254740991):0},Xi=Wi,Qt=function(e){return Xi(e.length)},Ji=H,Zi=Yi,es=Qt,xr=function(e){return function(r,t,n){var o=Ji(r),a=es(o),i=Zi(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},rs={includes:xr(!0),indexOf:xr(!1)},ts=L,Ae=A,ns=H,os=rs.indexOf,as=ar,Nr=ts([].push),is=function(e,r){var t=ns(e),n=0,o=[],a;for(a in t)!Ae(as,a)&&Ae(t,a)&&Nr(o,a);for(;r.length>n;)Ae(t,a=r[n++])&&(~os(o,a)||Nr(o,a));return o},Kt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ss=is,cs=Kt,ls=Object.keys||function(r){return ss(r,cs)},us=x,vs=wt,fs=Q,ds=K,hs=H,bs=ls;Bt.f=us&&!vs?Object.defineProperties:function(r,t){ds(r);for(var n=hs(t),o=bs(t),a=o.length,i=0,s;a>i;)fs.f(r,s=o[i++],n[s]);return r};var ps=mt,ys=ps("document","documentElement"),gs=K,Os=Bt,Mr=Kt,ws=ar,ms=ys,$s=gt,Es=or,Dr=">",Fr="<",Be="prototype",Ue="script",qt=Es("IE_PROTO"),je=function(){},Yt=function(e){return Fr+Ue+Dr+e+Fr+"/"+Ue+Dr},Gr=function(e){e.write(Yt("")),e.close();var r=e.parentWindow.Object;return e=null,r},Ss=function(){var e=$s("iframe"),r="java"+Ue+":",t;return e.style.display="none",ms.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Yt("document.F=Object")),t.close(),t.F},re,ae=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}ae=typeof document!="undefined"?document.domain&&re?Gr(re):Ss():Gr(re);for(var e=Mr.length;e--;)delete ae[Be][Mr[e]];return ae()};ws[qt]=!0;var Ht=Object.create||function(r,t){var n;return r!==null?(je[Be]=gs(r),n=new je,je[Be]=null,n[qt]=r):n=ae(),t===void 0?n:Os.f(n,t)},Ts=P,Is=!Ts(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Rs=A,Ps=T,_s=At,As=or,js=Is,Vr=As("IE_PROTO"),Qe=Object,Cs=Qe.prototype,zt=js?Qe.getPrototypeOf:function(e){var r=_s(e);if(Rs(r,Vr))return r[Vr];var t=r.constructor;return Ps(t)&&r instanceof t?t.prototype:r instanceof Qe?Cs:null},Ls=z,Wt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Ls(e,r,t),e},xs=P,Ns=T,Ms=U,Ds=Ht,kr=zt,Fs=Wt,Gs=_,Ke=Gs("iterator"),Xt=!1,R,Ce,Le;[].keys&&(Le=[].keys(),"next"in Le?(Ce=kr(kr(Le)),Ce!==Object.prototype&&(R=Ce)):Xt=!0);var Vs=!Ms(R)||xs(function(){var e={};return R[Ke].call(e)!==e});Vs?R={}:R=Ds(R);Ns(R[Ke])||Fs(R,Ke,function(){return this});var Jt={IteratorPrototype:R,BUGGY_SAFARI_ITERATORS:Xt},ks=_,Bs=ks("toStringTag"),Zt={};Zt[Bs]="z";var sr=String(Zt)==="[object z]",Us=sr,Qs=T,ie=Xe,Ks=_,qs=Ks("toStringTag"),Ys=Object,Hs=ie(function(){return arguments}())=="Arguments",zs=function(e,r){try{return e[r]}catch(t){}},cr=Us?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=zs(r=Ys(e),qs))=="string"?t:Hs?ie(r):(n=ie(r))=="Object"&&Qs(r.callee)?"Arguments":n},Ws=sr,Xs=cr,Js=Ws?{}.toString:function(){return"[object "+Xs(this)+"]"},Zs=sr,ec=Q.f,rc=z,tc=A,nc=Js,oc=_,Br=oc("toStringTag"),en=function(e,r,t,n){if(e){var o=t?e:e.prototype;tc(o,Br)||ec(o,Br,{configurable:!0,value:r}),n&&!Zs&&rc(o,"toString",nc)}},ac=Jt.IteratorPrototype,ic=Ht,sc=fe,cc=en,lc=B,uc=function(){return this},vc=function(e,r,t,n){var o=r+" Iterator";return e.prototype=ic(ac,{next:sc(+!n,t)}),cc(e,o,!1,!0),lc[o]=uc,e},fc=Vt,dc=N,rn=Gi,hc=vc,bc=zt,pc=en,Ur=Wt,yc=_,Qr=B,tn=Jt,gc=rn.PROPER;rn.CONFIGURABLE;tn.IteratorPrototype;var te=tn.BUGGY_SAFARI_ITERATORS,xe=yc("iterator"),Kr="keys",ne="values",qr="entries",Oc=function(){return this},wc=function(e,r,t,n,o,a,i){hc(t,r,n);var s=function(y){if(y===o&&f)return f;if(!te&&y in c)return c[y];switch(y){case Kr:return function(){return new t(this,y)};case ne:return function(){return new t(this,y)};case qr:return function(){return new t(this,y)}}return function(){return new t(this)}},v=r+" Iterator",l=!1,c=e.prototype,u=c[xe]||c["@@iterator"]||o&&c[o],f=!te&&u||s(o),d=r=="Array"&&c.entries||u,O,m,w;if(d&&(O=bc(d.call(new e)),O!==Object.prototype&&O.next&&(pc(O,v,!0,!0),Qr[v]=Oc)),gc&&o==ne&&u&&u.name!==ne&&(l=!0,f=function(){return dc(u,this)}),o)if(m={values:s(ne),keys:a?f:s(Kr),entries:s(qr)},i)for(w in m)(te||l||!(w in c))&&Ur(c,w,m[w]);else fc({target:r,proto:!0,forced:te||l},m);return i&&c[xe]!==f&&Ur(c,xe,f,{name:o}),Qr[r]=f,m},mc=function(e,r){return{value:e,done:r}},$c=H,Yr=B,nn=ni;Q.f;var Ec=wc,oe=mc,on="Array Iterator",Sc=nn.set,Tc=nn.getterFor(on);Ec(Array,"Array",function(e,r){Sc(this,{type:on,target:$c(e),index:0,kind:r})},function(){var e=Tc(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,oe(void 0,!0)):t=="keys"?oe(n,!1):t=="values"?oe(r[n],!1):oe([n,r[n]],!1)},"values");Yr.Arguments=Yr.Array;var Ic=_,Rc=B,Pc=Ic("iterator"),_c=Array.prototype,Ac=function(e){return e!==void 0&&(Rc.Array===e||_c[Pc]===e)},jc=cr,Hr=tr,Cc=Je,Lc=B,xc=_,Nc=xc("iterator"),an=function(e){if(!Cc(e))return Hr(e,Nc)||Hr(e,"@@iterator")||Lc[jc(e)]},Mc=N,Dc=rr,Fc=K,Gc=er,Vc=an,kc=TypeError,Bc=function(e,r){var t=arguments.length<2?Vc(e):r;if(Dc(t))return Fc(Mc(t,e));throw kc(Gc(e)+" is not iterable")},Uc=N,zr=K,Qc=tr,Kc=function(e,r,t){var n,o;zr(e);try{if(n=Qc(e,"return"),!n){if(r==="throw")throw t;return t}n=Uc(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return zr(n),t},qc=Gt,Yc=N,Hc=K,zc=er,Wc=Ac,Xc=Qt,Wr=$t,Jc=Bc,Zc=an,Xr=Kc,el=TypeError,se=function(e,r){this.stopped=e,this.result=r},Jr=se.prototype,rl=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=qc(r,n),l,c,u,f,d,O,m,w=function(g){return l&&Xr(l,"normal",g),new se(!0,g)},y=function(g){return o?(Hc(g),s?v(g[0],g[1],w):v(g[0],g[1])):s?v(g,w):v(g)};if(a)l=e.iterator;else if(i)l=e;else{if(c=Zc(e),!c)throw el(zc(e)+" is not iterable");if(Wc(c)){for(u=0,f=Xc(e);f>u;u++)if(d=y(e[u]),d&&Wr(Jr,d))return d;return new se(!1)}l=Jc(e,c)}for(O=a?e.next:l.next;!(m=Yc(O,l)).done;){try{d=y(m.value)}catch(g){Xr(l,"throw",g)}if(typeof d=="object"&&d&&Wr(Jr,d))return d}return new se(!1)},tl=nr,nl=Q,ol=fe,al=function(e,r,t){var n=tl(r);n in e?nl.f(e,n,ol(0,t)):e[n]=t},il=Vt,sl=rl,cl=al;il({target:"Object",stat:!0},{fromEntries:function(r){var t={};return sl(r,function(n,o){cl(t,n,o)},{AS_ENTRIES:!0}),t}});var ll=Ze,ul=ll.Object.fromEntries,vl={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},fl=vl,dl=S,hl=cr,bl=z,Zr=B,pl=_,et=pl("toStringTag");for(var Ne in fl){var rt=dl[Ne],Me=rt&&rt.prototype;Me&&hl(Me)!==et&&bl(Me,et,Ne),Zr[Ne]=Zr.Array}var yl=ul,gl=yl,Ol=gl,wl=Ol,ml=uo(wl);exports.VKNumericLanguage=void 0;(function(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"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const $l="vk.com",El=(e,r,t)=>ot(void 0,void 0,void 0,function*(){const n=new URL(`https://${$l}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=yield(yield lo(n.toString())).json();return Sl(a,t)}),Sl=(e,r)=>ml(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Tl(n)])),Tl=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=ln;exports.Observable=b;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=sn;exports.ValueSubject=Nn;exports.abortable=hn;exports.addScript=fn;exports.areQualitiesExact=Ln;exports.assertNever=C;exports.assertNonNullable=un;exports.assertNullable=vn;exports.assertQualityIsExact=xn;exports.buffer=Bn;exports.checkNever=cn;exports.combine=Mn;exports.debounce=Kn;exports.fillWithDefault=it;exports.filter=Wn;exports.filterChanged=Jn;exports.fromEvent=kn;exports.getCurrentBrowser=Ye;exports.getExponentialDelay=gn;exports.getHighestQuality=_n;exports.getIOSVersion=pn;exports.interval=Gn;exports.isHigher=In;exports.isHigherOrEqual=Rn;exports.isIOS=bn;exports.isInvariantQuality=ze;exports.isLower=He;exports.isLowerOrEqual=Pn;exports.isMacLike=yn;exports.isNonNullable=tt;exports.isNullable=nt;exports.loadVKLangPack=El;exports.map=st;exports.mapTo=ro;exports.merge=Dn;exports.noop=G;exports.now=dn;exports.observableFrom=Vn;exports.once=to;exports.pairwise=no;exports.safeStorage=Tn;exports.tap=ao;exports.throttle=Hn;exports.timeout=Fn;exports.videoHeightToQuality=An;exports.videoQualityToHeight=Cn;exports.videoSizeToQuality=jn;
|
package/es2015.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.31-dev.
|
|
3
|
-
* Fri, 27 Oct 2023 13:
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.31-dev.c49c485.0
|
|
3
|
+
* Fri, 27 Oct 2023 13:12:50 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-31/doc/
|
|
5
5
|
*/
|
|
6
|
-
const zc="1.0.31-dev.88984b6.0";class de{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const V=e=>{throw new Error(`${e} is value of unexpected type`)},Qc=e=>{},Q=()=>{};class y{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:Q}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:Q,error:Q};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new de().add(()=>{switch(a.next=Q,a.error=Q,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return V(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class ot extends y{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new de().add(()=>this.subscribers.delete(t))}}class Wc{constructor(){this.log$=new ot,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},r),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function Hc(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function Xc(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function ln(e){return typeof e!="undefined"&&e!==null}function un(e){return e==null}const Jc=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),l.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var be;const Zc=typeof((be=window.performance)===null||be===void 0?void 0:be.now)=="function"?()=>window.performance.now():()=>Date.now();function at(e,r,t,n){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(c){try{l(n.next(c))}catch(u){i(u)}}function v(c){try{l(n.throw(c))}catch(u){i(u)}}function l(c){c.done?a(c.value):o(c.value).then(s,v)}l((n=n.apply(e,r||[])).next())})}const el=(e,r)=>(...t)=>at(void 0,void 0,void 0,function*(){var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;){const s=yield o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i});var _;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(_||(_={}));var p;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(p||(p={}));const it=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?_.Yandex:void 0,t=/chrome|crios/i.test(e)?_.Chrome:void 0,n=/chromium/i.test(e)?_.Chromium:void 0,o=/firefox|fxios/i.test(e)?_.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?_.Safari:void 0,i=/opr\//i.test(e)?_.Opera:void 0,s=/edg/i.test(e)?_.Edge:void 0,v=/android/i.test(e)?p.Android:void 0,l=/iphone/i.test(e)?p.iPhone:void 0,c=/ipad/i.test(e)?p.iPad:void 0,u=/ipod/i.test(e)?p.iPod:void 0,f=/mac/i.test(e)?p.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?p.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||_.Rest,device:v||l||c||u||d||f||p.Desktop}},rl=(e=!1)=>{const t=[p.iPhone,p.iPad,p.iPod].includes(it().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},tl=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},nl=()=>[p.Mac,p.iPhone,p.iPad,p.iPod].includes(it().device),ol=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,M;const ye=`vk-videoplayer-dummy-key-${Math.random()}`,B=()=>{if(M!==void 0)return M;try{localStorage.setItem(ye,"test"),localStorage.removeItem(ye),M=h.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(ye),M=h.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)M=h.RUNTIME;else throw r}else throw e}return M===h.RUNTIME&&(b=new Map),M},vn=()=>B()===h.LOCAL_STORAGE,fn=e=>{var r,t;const n=B();switch(n){case h.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(e);default:V(n)}},dn=(e,r)=>{const t=B();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(e,r));default:V(t)}},hn=e=>{var r;const t=B();switch(t){case h.LOCAL_STORAGE:return e in localStorage;case h.SESSION_STORAGE:return e in sessionStorage;case h.RUNTIME:return(r=b==null?void 0:b.has(e))!==null&&r!==void 0?r:!1;default:return V(t),!1}},pn=e=>{const r=B();switch(r){case h.LOCAL_STORAGE:return localStorage.removeItem(e);case h.SESSION_STORAGE:return sessionStorage.removeItem(e);case h.RUNTIME:return void(b==null?void 0:b.delete(e));default:V(r)}},bn=()=>{const e=B();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:V(e)}};var al=Object.freeze({__proto__:null,clear:bn,get:fn,has:hn,isPersistent:vn,remove:pn,set:dn}),m;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(m||(m={}));const E={[m.Q_144P]:{width:256,height:144},[m.Q_240P]:{width:428,height:240},[m.Q_360P]:{width:640,height:360},[m.Q_480P]:{width:856,height:480},[m.Q_720P]:{width:1280,height:720},[m.Q_1080P]:{width:1920,height:1080},[m.Q_1440P]:{width:2560,height:1440},[m.Q_2160P]:{width:3840,height:2160},[m.Q_4320P]:{width:7680,height:4320}},il=(e,r)=>E[e].height>E[r].height,sl=(e,r)=>E[e].height>=E[r].height,st=(e,r)=>E[e].height<E[r].height,cl=(e,r)=>E[e].height<=E[r].height,ll=e=>e.sort((r,t)=>r===t?0:r===m.INVARIANT?1:t===m.INVARIANT?-1:st(r,t)?1:-1)[0],ct=Object.keys(E).sort((e,r)=>st(e,r)?-1:1),ul=(e,r=.02)=>[...ct].find(n=>E[n].height*(1+r)>=e),vl=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return ct.find(o=>{const a=E[o];return a.width>=n&&a.height>=t})},fl=e=>E[e].height,lt=e=>e===m.INVARIANT,dl=e=>e.every(r=>!lt(r));function hl(e){if(lt(e))throw new Error("Expected exact quality")}const yn=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=yn(a,o):t[n]=n in e?a:o}return t};class pl extends ot{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function bl(e){return new y(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new de)})}function yl(...e){return new y(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new de))}var gl=e=>new y(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Ol=e=>new y(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),$l=e=>new y(r=>{e.forEach(t=>r.next(t))}),wl=(e,r)=>new y(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function ml(e){return r=>new y(t=>r.subscribe(new gn(t,e)))}class gn{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const On={leading:!1,trailing:!0};function Sl(e,r=On){return t=>new y(n=>t.subscribe(new $n(n,e,r)))}class $n{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,ln(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const wn={leading:!0,trailing:!1};function El(e,r=wn){return t=>new y(n=>t.subscribe(new mn(n,e,r)))}class mn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,un(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Tl(e){return r=>new y(t=>r.subscribe(new Sn(t,e)))}class Sn{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Il(e=(r,t)=>r===t){return r=>new y(t=>r.subscribe(new En(t,e)))}const cr={};class En{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=cr}next(r){let t;try{t=this.lastValue===cr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Tn(e){return r=>new y(t=>r.subscribe(new In(t,e)))}let In=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function Pl(e){return Tn(()=>e)}function _l(){return e=>new y(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Al(){return e=>new y(r=>e.subscribe(new Rn(r)))}class Rn{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function jl(e){return r=>new y(t=>r.subscribe(new Pn(t,e)))}class Pn{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}var lr;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(lr||(lr={}));class ur{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class ut extends ur{constructor(){super(),this.listeners||ur.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class _n{constructor(){Object.defineProperty(this,"signal",{value:new ut,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(_n.prototype[Symbol.toStringTag]="AbortController",ut.prototype[Symbol.toStringTag]="AbortSignal");function vt(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 An(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!vt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(l,c){let u;c&&c.signal&&(u=c.signal,delete c.signal);const f=new t(l,c);return u&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:u}),f},a.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=a&&a.prototype.isPrototypeOf(v)?v.signal:l?l.signal:void 0;if(c){let u;try{u=new DOMException("Aborted","AbortError")}catch(d){u=new Error("Aborted"),u.name="AbortError"}if(c.aborted)return Promise.reject(u);const f=new Promise((d,$)=>{c.addEventListener("abort",()=>$(u),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([f,i(v,l)])}return i(v,l)},Request:a}}const We=vt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ft=We?An({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,jn=We?ft.fetch:window.fetch;We?ft.Request:window.Request;var ge=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j=function(e){try{return!!e()}catch(r){return!0}},xn=j,he=!xn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),dt=he,ht=Function.prototype,ke=ht.call,Mn=dt&&ht.bind.bind(ke,ke),N=dt?Mn:function(e){return function(){return ke.apply(e,arguments)}},pt=N,Nn=pt({}.toString),Cn=pt("".slice),He=function(e){return Cn(Nn(e),8,-1)},Fn=N,Gn=j,Dn=He,Oe=Object,kn=Fn("".split),Un=Gn(function(){return!Oe("z").propertyIsEnumerable(0)})?function(e){return Dn(e)=="String"?kn(e,""):Oe(e)}:Oe,Xe=function(e){return e==null},Vn=Xe,Bn=TypeError,bt=function(e){if(Vn(e))throw Bn("Can't call method on "+e);return e},Kn=Un,qn=bt,H=function(e){return Kn(qn(e))},K={},Z=function(e){return e&&e.Math==Math&&e},I=Z(typeof globalThis=="object"&&globalThis)||Z(typeof window=="object"&&window)||Z(typeof self=="object"&&self)||Z(typeof ge=="object"&&ge)||function(){return this}()||ge||Function("return this")(),Ue=typeof document=="object"&&document.all,Yn=typeof Ue=="undefined"&&Ue!==void 0,yt={all:Ue,IS_HTMLDDA:Yn},gt=yt,zn=gt.all,R=gt.IS_HTMLDDA?function(e){return typeof e=="function"||e===zn}:function(e){return typeof e=="function"},Qn=I,Wn=R,vr=Qn.WeakMap,Hn=Wn(vr)&&/native code/.test(String(vr)),fr=R,Ot=yt,Xn=Ot.all,q=Ot.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===Xn}:function(e){return typeof e=="object"?e!==null:fr(e)},Jn=j,C=!Jn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Zn=I,dr=q,Ve=Zn.document,eo=dr(Ve)&&dr(Ve.createElement),$t=function(e){return eo?Ve.createElement(e):{}},ro=C,to=j,no=$t,wt=!ro&&!to(function(){return Object.defineProperty(no("div"),"a",{get:function(){return 7}}).a!=7}),oo=C,ao=j,mt=oo&&ao(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),io=q,so=String,co=TypeError,z=function(e){if(io(e))return e;throw co(so(e)+" is not an object")},lo=he,ee=Function.prototype.call,F=lo?ee.bind(ee):function(){return ee.apply(ee,arguments)},Je={},$e=Je,we=I,uo=R,hr=function(e){return uo(e)?e:void 0},St=function(e,r){return arguments.length<2?hr($e[e])||hr(we[e]):$e[e]&&$e[e][r]||we[e]&&we[e][r]},vo=N,Et=vo({}.isPrototypeOf),fo=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Tt=I,me=fo,pr=Tt.process,br=Tt.Deno,yr=pr&&pr.versions||br&&br.version,gr=yr&&yr.v8,T,ue;gr&&(T=gr.split("."),ue=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!ue&&me&&(T=me.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=me.match(/Chrome\/(\d+)/),T&&(ue=+T[1])));var ho=ue,Or=ho,po=j,bo=I,yo=bo.String,It=!!Object.getOwnPropertySymbols&&!po(function(){var e=Symbol();return!yo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Or&&Or<41}),go=It,Rt=go&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Oo=St,$o=R,wo=Et,mo=Rt,So=Object,Pt=mo?function(e){return typeof e=="symbol"}:function(e){var r=Oo("Symbol");return $o(r)&&wo(r.prototype,So(e))},Eo=String,Ze=function(e){try{return Eo(e)}catch(r){return"Object"}},To=R,Io=Ze,Ro=TypeError,er=function(e){if(To(e))return e;throw Ro(Io(e)+" is not a function")},Po=er,_o=Xe,rr=function(e,r){var t=e[r];return _o(t)?void 0:Po(t)},Se=F,Ee=R,Te=q,Ao=TypeError,jo=function(e,r){var t,n;if(r==="string"&&Ee(t=e.toString)&&!Te(n=Se(t,e))||Ee(t=e.valueOf)&&!Te(n=Se(t,e))||r!=="string"&&Ee(t=e.toString)&&!Te(n=Se(t,e)))return n;throw Ao("Can't convert object to primitive value")},_t={exports:{}},$r=I,Lo=Object.defineProperty,xo=function(e,r){try{Lo($r,e,{value:r,configurable:!0,writable:!0})}catch(t){$r[e]=r}return r},Mo=I,No=xo,wr="__core-js_shared__",Co=Mo[wr]||No(wr,{}),At=Co,mr=At;(_t.exports=function(e,r){return mr[e]||(mr[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var jt=_t.exports,Fo=bt,Go=Object,Lt=function(e){return Go(Fo(e))},Do=N,ko=Lt,Uo=Do({}.hasOwnProperty),x=Object.hasOwn||function(r,t){return Uo(ko(r),t)},Vo=N,Bo=0,Ko=Math.random(),qo=Vo(1 .toString),xt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+qo(++Bo+Ko,36)},Yo=I,zo=jt,Sr=x,Qo=xt,Wo=It,Ho=Rt,U=Yo.Symbol,Ie=zo("wks"),Xo=Ho?U.for||U:U&&U.withoutSetter||Qo,L=function(e){return Sr(Ie,e)||(Ie[e]=Wo&&Sr(U,e)?U[e]:Xo("Symbol."+e)),Ie[e]},Jo=F,Er=q,Tr=Pt,Zo=rr,ea=jo,ra=L,ta=TypeError,na=ra("toPrimitive"),oa=function(e,r){if(!Er(e)||Tr(e))return e;var t=Zo(e,na),n;if(t){if(r===void 0&&(r="default"),n=Jo(t,e,r),!Er(n)||Tr(n))return n;throw ta("Can't convert object to primitive value")}return r===void 0&&(r="number"),ea(e,r)},aa=oa,ia=Pt,tr=function(e){var r=aa(e,"string");return ia(r)?r:r+""},sa=C,ca=wt,la=mt,re=z,Ir=tr,ua=TypeError,Re=Object.defineProperty,va=Object.getOwnPropertyDescriptor,Pe="enumerable",_e="configurable",Ae="writable";Y.f=sa?la?function(r,t,n){if(re(r),t=Ir(t),re(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Ae in n&&!n[Ae]){var o=va(r,t);o&&o[Ae]&&(r[t]=n.value,n={configurable:_e in n?n[_e]:o[_e],enumerable:Pe in n?n[Pe]:o[Pe],writable:!1})}return Re(r,t,n)}:Re:function(r,t,n){if(re(r),t=Ir(t),re(n),ca)try{return Re(r,t,n)}catch(o){}if("get"in n||"set"in n)throw ua("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var pe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},fa=C,da=Y,ha=pe,X=fa?function(e,r,t){return da.f(e,r,ha(1,t))}:function(e,r,t){return e[r]=t,e},pa=jt,ba=xt,Rr=pa("keys"),nr=function(e){return Rr[e]||(Rr[e]=ba(e))},or={},ya=Hn,Mt=I,ga=q,Oa=X,je=x,Le=At,$a=nr,wa=or,Pr="Object already initialized",Be=Mt.TypeError,ma=Mt.WeakMap,ve,W,fe,Sa=function(e){return fe(e)?W(e):ve(e,{})},Ea=function(e){return function(r){var t;if(!ga(r)||(t=W(r)).type!==e)throw Be("Incompatible receiver, "+e+" required");return t}};if(ya||Le.state){var P=Le.state||(Le.state=new ma);P.get=P.get,P.has=P.has,P.set=P.set,ve=function(e,r){if(P.has(e))throw Be(Pr);return r.facade=e,P.set(e,r),r},W=function(e){return P.get(e)||{}},fe=function(e){return P.has(e)}}else{var G=$a("state");wa[G]=!0,ve=function(e,r){if(je(e,G))throw Be(Pr);return r.facade=e,Oa(e,G,r),r},W=function(e){return je(e,G)?e[G]:{}},fe=function(e){return je(e,G)}}var Ta={set:ve,get:W,has:fe,enforce:Sa,getterFor:Ea},Ia=he,Nt=Function.prototype,_r=Nt.apply,Ar=Nt.call,Ra=typeof Reflect=="object"&&Reflect.apply||(Ia?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),Pa=He,_a=N,Ct=function(e){if(Pa(e)==="Function")return _a(e)},Ft={},Gt={},Dt={}.propertyIsEnumerable,kt=Object.getOwnPropertyDescriptor,Aa=kt&&!Dt.call({1:2},1);Gt.f=Aa?function(r){var t=kt(this,r);return!!t&&t.enumerable}:Dt;var ja=C,La=F,xa=Gt,Ma=pe,Na=H,Ca=tr,Fa=x,Ga=wt,jr=Object.getOwnPropertyDescriptor;Ft.f=ja?jr:function(r,t){if(r=Na(r),t=Ca(t),Ga)try{return jr(r,t)}catch(n){}if(Fa(r,t))return Ma(!La(xa.f,r,t),r[t])};var Da=j,ka=R,Ua=/#|\.prototype\./,J=function(e,r){var t=Ba[Va(e)];return t==qa?!0:t==Ka?!1:ka(r)?Da(r):!!r},Va=J.normalize=function(e){return String(e).replace(Ua,".").toLowerCase()},Ba=J.data={},Ka=J.NATIVE="N",qa=J.POLYFILL="P",Ya=J,Lr=Ct,za=er,Qa=he,Wa=Lr(Lr.bind),Ut=function(e,r){return za(e),r===void 0?e:Qa?Wa(e,r):function(){return e.apply(r,arguments)}},te=I,Ha=Ra,Xa=Ct,Ja=R,Za=Ft.f,ei=Ya,D=Je,ri=Ut,k=X,xr=x,ti=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return Ha(e,this,arguments)};return r.prototype=e.prototype,r},Vt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?te:o?te[t]:(te[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,l,c,u,f,d,$,S,w,g;for(f in r)l=ei(n?f:t+(o?".":"#")+f,e.forced),c=!l&&i&&xr(i,f),$=s[f],c&&(e.dontCallGetSet?(g=Za(i,f),S=g&&g.value):S=i[f]),d=c&&S?S:r[f],!(c&&typeof $==typeof d)&&(e.bind&&c?w=ri(d,te):e.wrap&&c?w=ti(d):a&&Ja(d)?w=Xa(d):w=d,(e.sham||d&&d.sham||$&&$.sham)&&k(w,"sham",!0),k(s,f,w),a&&(u=t+"Prototype",xr(D,u)||k(D,u,{}),k(D[u],f,d),e.real&&v&&(l||!v[f])&&k(v,f,d)))},Ke=C,ni=x,Bt=Function.prototype,oi=Ke&&Object.getOwnPropertyDescriptor,ar=ni(Bt,"name"),ai=ar&&function(){}.name==="something",ii=ar&&(!Ke||Ke&&oi(Bt,"name").configurable),si={EXISTS:ar,PROPER:ai,CONFIGURABLE:ii},Kt={},ci=Math.ceil,li=Math.floor,ui=Math.trunc||function(r){var t=+r;return(t>0?li:ci)(t)},vi=ui,qt=function(e){var r=+e;return r!==r||r===0?0:vi(r)},fi=qt,di=Math.max,hi=Math.min,pi=function(e,r){var t=fi(e);return t<0?di(t+r,0):hi(t,r)},bi=qt,yi=Math.min,gi=function(e){return e>0?yi(bi(e),9007199254740991):0},Oi=gi,Yt=function(e){return Oi(e.length)},$i=H,wi=pi,mi=Yt,Mr=function(e){return function(r,t,n){var o=$i(r),a=mi(o),i=wi(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},Si={includes:Mr(!0),indexOf:Mr(!1)},Ei=N,xe=x,Ti=H,Ii=Si.indexOf,Ri=or,Nr=Ei([].push),Pi=function(e,r){var t=Ti(e),n=0,o=[],a;for(a in t)!xe(Ri,a)&&xe(t,a)&&Nr(o,a);for(;r.length>n;)xe(t,a=r[n++])&&(~Ii(o,a)||Nr(o,a));return o},zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_i=Pi,Ai=zt,ji=Object.keys||function(r){return _i(r,Ai)},Li=C,xi=mt,Mi=Y,Ni=z,Ci=H,Fi=ji;Kt.f=Li&&!xi?Object.defineProperties:function(r,t){Ni(r);for(var n=Ci(t),o=Fi(t),a=o.length,i=0,s;a>i;)Mi.f(r,s=o[i++],n[s]);return r};var Gi=St,Di=Gi("document","documentElement"),ki=z,Ui=Kt,Cr=zt,Vi=or,Bi=Di,Ki=$t,qi=nr,Fr=">",Gr="<",qe="prototype",Ye="script",Qt=qi("IE_PROTO"),Me=function(){},Wt=function(e){return Gr+Ye+Fr+e+Gr+"/"+Ye+Fr},Dr=function(e){e.write(Wt("")),e.close();var r=e.parentWindow.Object;return e=null,r},Yi=function(){var e=Ki("iframe"),r="java"+Ye+":",t;return e.style.display="none",Bi.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Wt("document.F=Object")),t.close(),t.F},ne,se=function(){try{ne=new ActiveXObject("htmlfile")}catch(r){}se=typeof document!="undefined"?document.domain&&ne?Dr(ne):Yi():Dr(ne);for(var e=Cr.length;e--;)delete se[qe][Cr[e]];return se()};Vi[Qt]=!0;var Ht=Object.create||function(r,t){var n;return r!==null?(Me[qe]=ki(r),n=new Me,Me[qe]=null,n[Qt]=r):n=se(),t===void 0?n:Ui.f(n,t)},zi=j,Qi=!zi(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Wi=x,Hi=R,Xi=Lt,Ji=nr,Zi=Qi,kr=Ji("IE_PROTO"),ze=Object,es=ze.prototype,Xt=Zi?ze.getPrototypeOf:function(e){var r=Xi(e);if(Wi(r,kr))return r[kr];var t=r.constructor;return Hi(t)&&r instanceof t?t.prototype:r instanceof ze?es:null},rs=X,Jt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:rs(e,r,t),e},ts=j,ns=R,os=q,as=Ht,Ur=Xt,is=Jt,ss=L,Qe=ss("iterator"),Zt=!1,A,Ne,Ce;[].keys&&(Ce=[].keys(),"next"in Ce?(Ne=Ur(Ur(Ce)),Ne!==Object.prototype&&(A=Ne)):Zt=!0);var cs=!os(A)||ts(function(){var e={};return A[Qe].call(e)!==e});cs?A={}:A=as(A);ns(A[Qe])||is(A,Qe,function(){return this});var en={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:Zt},ls=L,us=ls("toStringTag"),rn={};rn[us]="z";var ir=String(rn)==="[object z]",vs=ir,fs=R,ce=He,ds=L,hs=ds("toStringTag"),ps=Object,bs=ce(function(){return arguments}())=="Arguments",ys=function(e,r){try{return e[r]}catch(t){}},sr=vs?ce:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=ys(r=ps(e),hs))=="string"?t:bs?ce(r):(n=ce(r))=="Object"&&fs(r.callee)?"Arguments":n},gs=ir,Os=sr,$s=gs?{}.toString:function(){return"[object "+Os(this)+"]"},ws=ir,ms=Y.f,Ss=X,Es=x,Ts=$s,Is=L,Vr=Is("toStringTag"),tn=function(e,r,t,n){if(e){var o=t?e:e.prototype;Es(o,Vr)||ms(o,Vr,{configurable:!0,value:r}),n&&!ws&&Ss(o,"toString",Ts)}},Rs=en.IteratorPrototype,Ps=Ht,_s=pe,As=tn,js=K,Ls=function(){return this},xs=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Ps(Rs,{next:_s(+!n,t)}),As(e,o,!1,!0),js[o]=Ls,e},Ms=Vt,Ns=F,nn=si,Cs=xs,Fs=Xt,Gs=tn,Br=Jt,Ds=L,Kr=K,on=en,ks=nn.PROPER;nn.CONFIGURABLE;on.IteratorPrototype;var oe=on.BUGGY_SAFARI_ITERATORS,Fe=Ds("iterator"),qr="keys",ae="values",Yr="entries",Us=function(){return this},Vs=function(e,r,t,n,o,a,i){Cs(t,r,n);var s=function(g){if(g===o&&f)return f;if(!oe&&g in c)return c[g];switch(g){case qr:return function(){return new t(this,g)};case ae:return function(){return new t(this,g)};case Yr:return function(){return new t(this,g)}}return function(){return new t(this)}},v=r+" Iterator",l=!1,c=e.prototype,u=c[Fe]||c["@@iterator"]||o&&c[o],f=!oe&&u||s(o),d=r=="Array"&&c.entries||u,$,S,w;if(d&&($=Fs(d.call(new e)),$!==Object.prototype&&$.next&&(Gs($,v,!0,!0),Kr[v]=Us)),ks&&o==ae&&u&&u.name!==ae&&(l=!0,f=function(){return Ns(u,this)}),o)if(S={values:s(ae),keys:a?f:s(qr),entries:s(Yr)},i)for(w in S)(oe||l||!(w in c))&&Br(c,w,S[w]);else Ms({target:r,proto:!0,forced:oe||l},S);return i&&c[Fe]!==f&&Br(c,Fe,f,{name:o}),Kr[r]=f,S},Bs=function(e,r){return{value:e,done:r}},Ks=H,zr=K,an=Ta;Y.f;var qs=Vs,ie=Bs,sn="Array Iterator",Ys=an.set,zs=an.getterFor(sn);qs(Array,"Array",function(e,r){Ys(this,{type:sn,target:Ks(e),index:0,kind:r})},function(){var e=zs(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,ie(void 0,!0)):t=="keys"?ie(n,!1):t=="values"?ie(r[n],!1):ie([n,r[n]],!1)},"values");zr.Arguments=zr.Array;var Qs=L,Ws=K,Hs=Qs("iterator"),Xs=Array.prototype,Js=function(e){return e!==void 0&&(Ws.Array===e||Xs[Hs]===e)},Zs=sr,Qr=rr,ec=Xe,rc=K,tc=L,nc=tc("iterator"),cn=function(e){if(!ec(e))return Qr(e,nc)||Qr(e,"@@iterator")||rc[Zs(e)]},oc=F,ac=er,ic=z,sc=Ze,cc=cn,lc=TypeError,uc=function(e,r){var t=arguments.length<2?cc(e):r;if(ac(t))return ic(oc(t,e));throw lc(sc(e)+" is not iterable")},vc=F,Wr=z,fc=rr,dc=function(e,r,t){var n,o;Wr(e);try{if(n=fc(e,"return"),!n){if(r==="throw")throw t;return t}n=vc(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return Wr(n),t},hc=Ut,pc=F,bc=z,yc=Ze,gc=Js,Oc=Yt,Hr=Et,$c=uc,wc=cn,Xr=dc,mc=TypeError,le=function(e,r){this.stopped=e,this.result=r},Jr=le.prototype,Sc=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=hc(r,n),l,c,u,f,d,$,S,w=function(O){return l&&Xr(l,"normal",O),new le(!0,O)},g=function(O){return o?(bc(O),s?v(O[0],O[1],w):v(O[0],O[1])):s?v(O,w):v(O)};if(a)l=e.iterator;else if(i)l=e;else{if(c=wc(e),!c)throw mc(yc(e)+" is not iterable");if(gc(c)){for(u=0,f=Oc(e);f>u;u++)if(d=g(e[u]),d&&Hr(Jr,d))return d;return new le(!1)}l=$c(e,c)}for($=a?e.next:l.next;!(S=pc($,l)).done;){try{d=g(S.value)}catch(O){Xr(l,"throw",O)}if(typeof d=="object"&&d&&Hr(Jr,d))return d}return new le(!1)},Ec=tr,Tc=Y,Ic=pe,Rc=function(e,r,t){var n=Ec(r);n in e?Tc.f(e,n,Ic(0,t)):e[n]=t},Pc=Vt,_c=Sc,Ac=Rc;Pc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return _c(r,function(n,o){Ac(t,n,o)},{AS_ENTRIES:!0}),t}});var jc=Je,Lc=jc.Object.fromEntries,xc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Mc=xc,Nc=I,Cc=sr,Fc=X,Zr=K,Gc=L,et=Gc("toStringTag");for(var Ge in Mc){var rt=Nc[Ge],De=rt&&rt.prototype;De&&Cc(De)!==et&&Fc(De,et,Ge),Zr[Ge]=Zr.Array}var Dc=Lc,kc=Dc,Uc=kc,Vc=Uc,Bc=Ln(Vc),tt;(function(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"})(tt||(tt={}));const Kc="vk.com",Ll=(e,r,t)=>at(void 0,void 0,void 0,function*(){const n=new URL(`https://${Kc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=yield(yield jn(n.toString())).json();return qc(a,t)}),qc=(e,r)=>Bc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Yc(n)])),Yc=e=>Array.isArray(e)?e[0]:e;var nt;(function(e){e.RU="ru",e.EN="en"})(nt||(nt={}));export{_ as CurrentClientBrowser,p as CurrentClientDevice,lr as ErrorCategory,nt as InterfaceLanguage,Wc as Logger,y as Observable,ot as Subject,de as Subscription,zc as VERSION,tt as VKNumericLanguage,pl as ValueSubject,m as VideoQuality,el as abortable,Jc as addScript,dl as areQualitiesExact,V as assertNever,Hc as assertNonNullable,Xc as assertNullable,hl as assertQualityIsExact,ml as buffer,Qc as checkNever,bl as combine,Sl as debounce,yn as fillWithDefault,Tl as filter,Il as filterChanged,wl as fromEvent,it as getCurrentBrowser,ol as getExponentialDelay,ll as getHighestQuality,tl as getIOSVersion,Ol as interval,il as isHigher,sl as isHigherOrEqual,rl as isIOS,lt as isInvariantQuality,st as isLower,cl as isLowerOrEqual,nl as isMacLike,ln as isNonNullable,un as isNullable,Ll as loadVKLangPack,Tn as map,Pl as mapTo,yl as merge,Q as noop,Zc as now,$l as observableFrom,_l as once,Al as pairwise,al as safeStorage,jl as tap,El as throttle,gl as timeout,ul as videoHeightToQuality,fl as videoQualityToHeight,vl as videoSizeToQuality};
|
|
6
|
+
const zc="1.0.31-dev.c49c485.0";class de{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const V=e=>{throw new Error(`${e} is value of unexpected type`)},Qc=e=>{},Q=()=>{};class y{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let o;t?typeof t=="function"?o={next:t,error:Q}:o={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:o={next:Q,error:Q};const a=typeof r=="function"?{next:s=>{try{r(s)}catch(v){o.next(v)}},error:s=>o.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):o.next(s)};let i;try{i=this._subscribe(a)}catch(s){(n=a.error)===null||n===void 0||n.call(a,s)}return new de().add(()=>{switch(a.next=Q,a.error=Q,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return V(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class ot extends y{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new de().add(()=>this.subscribers.delete(t))}}class Wc{constructor(){this.log$=new ot,this.logs=[],this.log=r=>{const t=Object.assign(Object.assign({},r),{timestamp:Date.now()});this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(o){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>Object.assign({component:r},t))}}function Hc(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function Xc(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function ln(e){return typeof e!="undefined"&&e!==null}function un(e){return e==null}const Jc=(e,r,t)=>new Promise((n,o)=>{r.addEventListener("abort",()=>{s(),l.remove()});const a=()=>{s(),o()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",a)};let v;t&&(v=window.setTimeout(a,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",a),l.src=e,document.head.appendChild(l)});var be;const Zc=typeof((be=window.performance)===null||be===void 0?void 0:be.now)=="function"?()=>window.performance.now():()=>Date.now();function at(e,r,t,n){function o(a){return a instanceof t?a:new t(function(i){i(a)})}return new(t||(t=Promise))(function(a,i){function s(c){try{l(n.next(c))}catch(u){i(u)}}function v(c){try{l(n.throw(c))}catch(u){i(u)}}function l(c){c.done?a(c.value):o(c.value).then(s,v)}l((n=n.apply(e,r||[])).next())})}const el=(e,r)=>(...t)=>at(void 0,void 0,void 0,function*(){var n;const o=r(...t);let a=e.aborted,i;for(;!a&&!e.aborted;){const s=yield o.next(i);a=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i});var _;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(_||(_={}));var p;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(p||(p={}));const it=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?_.Yandex:void 0,t=/chrome|crios/i.test(e)?_.Chrome:void 0,n=/chromium/i.test(e)?_.Chromium:void 0,o=/firefox|fxios/i.test(e)?_.Firefox:void 0,a=/webkit|safari|khtml/i.test(e)?_.Safari:void 0,i=/opr\//i.test(e)?_.Opera:void 0,s=/edg/i.test(e)?_.Edge:void 0,v=/android/i.test(e)?p.Android:void 0,l=/iphone/i.test(e)?p.iPhone:void 0,c=/ipad/i.test(e)?p.iPad:void 0,u=/ipod/i.test(e)?p.iPod:void 0,f=/mac/i.test(e)?p.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?p.RestMobile:void 0;return{browser:r||o||i||s||t||n||a||_.Rest,device:v||l||c||u||d||f||p.Desktop}},rl=(e=!1)=>{const t=[p.iPhone,p.iPad,p.iPod].includes(it().device);if(!e)return t;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(t||/macintosh/i.test(n)&&o>0)},tl=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},nl=()=>[p.Mac,p.iPhone,p.iPad,p.iPod].includes(it().device),ol=(e,{start:r=0,factor:t=2,max:n=1/0,min:o=r,random:a=0}={})=>{let i=r;return i*=Math.pow(t,e),i*=1+(Math.random()*a*2-a),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var h;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,M;const ye=`vk-videoplayer-dummy-key-${Math.random()}`,B=()=>{if(M!==void 0)return M;try{localStorage.setItem(ye,"test"),localStorage.removeItem(ye),M=h.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(ye),M=h.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)M=h.RUNTIME;else throw r}else throw e}return M===h.RUNTIME&&(b=new Map),M},vn=()=>B()===h.LOCAL_STORAGE,fn=e=>{var r,t;const n=B();switch(n){case h.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(e);default:V(n)}},dn=(e,r)=>{const t=B();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(e,r));default:V(t)}},hn=e=>{var r;const t=B();switch(t){case h.LOCAL_STORAGE:return e in localStorage;case h.SESSION_STORAGE:return e in sessionStorage;case h.RUNTIME:return(r=b==null?void 0:b.has(e))!==null&&r!==void 0?r:!1;default:return V(t),!1}},pn=e=>{const r=B();switch(r){case h.LOCAL_STORAGE:return localStorage.removeItem(e);case h.SESSION_STORAGE:return sessionStorage.removeItem(e);case h.RUNTIME:return void(b==null?void 0:b.delete(e));default:V(r)}},bn=()=>{const e=B();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:V(e)}};var al=Object.freeze({__proto__:null,clear:bn,get:fn,has:hn,isPersistent:vn,remove:pn,set:dn}),m;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(m||(m={}));const E={[m.Q_144P]:{width:256,height:144},[m.Q_240P]:{width:428,height:240},[m.Q_360P]:{width:640,height:360},[m.Q_480P]:{width:856,height:480},[m.Q_720P]:{width:1280,height:720},[m.Q_1080P]:{width:1920,height:1080},[m.Q_1440P]:{width:2560,height:1440},[m.Q_2160P]:{width:3840,height:2160},[m.Q_4320P]:{width:7680,height:4320}},il=(e,r)=>E[e].height>E[r].height,sl=(e,r)=>E[e].height>=E[r].height,st=(e,r)=>E[e].height<E[r].height,cl=(e,r)=>E[e].height<=E[r].height,ll=e=>e.sort((r,t)=>r===t?0:r===m.INVARIANT?1:t===m.INVARIANT?-1:st(r,t)?1:-1)[0],ct=Object.keys(E).sort((e,r)=>st(e,r)?-1:1),ul=(e,r=.02)=>[...ct].find(n=>E[n].height*(1+r)>=e),vl=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return ct.find(o=>{const a=E[o];return a.width>=n&&a.height>=t})},fl=e=>E[e].height,lt=e=>e===m.INVARIANT,dl=e=>e.every(r=>!lt(r));function hl(e){if(lt(e))throw new Error("Expected exact quality")}const yn=(e,r)=>{const t={};for(const n of Object.keys(r)){const o=r[n],a=e[n];Array.isArray(o)&&Array.isArray(a)?t[n]=a:typeof o=="object"&&typeof a=="object"?t[n]=yn(a,o):t[n]=n in e?a:o}return t};class pl extends ot{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function bl(e){return new y(r=>{const t={};let n=Object.keys(e).length;const o=a=>i=>{a in t||n--,t[a]=i,n===0&&r.next(t)};return Object.entries(e).reduce((a,[i,s])=>a.add(s.subscribe(o(i))),new de)})}function yl(...e){return new y(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new de))}var gl=e=>new y(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Ol=e=>new y(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),$l=e=>new y(r=>{e.forEach(t=>r.next(t))}),wl=(e,r)=>new y(t=>{const n=o=>t.next(o);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function ml(e){return r=>new y(t=>r.subscribe(new gn(t,e)))}class gn{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const On={leading:!1,trailing:!0};function Sl(e,r=On){return t=>new y(n=>t.subscribe(new $n(n,e,r)))}class $n{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,ln(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const wn={leading:!0,trailing:!1};function El(e,r=wn){return t=>new y(n=>t.subscribe(new mn(n,e,r)))}class mn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,un(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Tl(e){return r=>new y(t=>r.subscribe(new Sn(t,e)))}class Sn{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Il(e=(r,t)=>r===t){return r=>new y(t=>r.subscribe(new En(t,e)))}const cr={};class En{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=cr}next(r){let t;try{t=this.lastValue===cr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Tn(e){return r=>new y(t=>r.subscribe(new In(t,e)))}let In=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function Pl(e){return Tn(()=>e)}function _l(){return e=>new y(r=>{let t=!1,n=!1;const o=e.subscribe(a=>{t||(t=!0,r.next(a)),n&&o.unsubscribe()},a=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,a),n&&o.unsubscribe()});return n=!0,t&&o.unsubscribe(),o})}function Al(){return e=>new y(r=>e.subscribe(new Rn(r)))}class Rn{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function jl(e){return r=>new y(t=>r.subscribe(new Pn(t,e)))}class Pn{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}var lr;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(lr||(lr={}));class ur{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let o=0,a=n.length;o<a;o++)if(n[o].callback===t){n.splice(o,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let o=0,a=n.length;o<a;o++){const i=n[o];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class ut extends ur{constructor(){super(),this.listeners||ur.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class _n{constructor(){Object.defineProperty(this,"signal",{value:new ut,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(o){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(o){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(_n.prototype[Symbol.toStringTag]="AbortController",ut.prototype[Symbol.toStringTag]="AbortSignal");function vt(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 An(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o=!1}=e;if(!vt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:o}))return{fetch:r,Request:a};let a=t;(a&&!a.prototype.hasOwnProperty("signal")||o)&&(a=function(l,c){let u;c&&c.signal&&(u=c.signal,delete c.signal);const f=new t(l,c);return u&&Object.defineProperty(f,"signal",{writable:!1,enumerable:!1,configurable:!0,value:u}),f},a.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=a&&a.prototype.isPrototypeOf(v)?v.signal:l?l.signal:void 0;if(c){let u;try{u=new DOMException("Aborted","AbortError")}catch(d){u=new Error("Aborted"),u.name="AbortError"}if(c.aborted)return Promise.reject(u);const f=new Promise((d,$)=>{c.addEventListener("abort",()=>$(u),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([f,i(v,l)])}return i(v,l)},Request:a}}const We=vt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ft=We?An({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,jn=We?ft.fetch:window.fetch;We?ft.Request:window.Request;var ge=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var j=function(e){try{return!!e()}catch(r){return!0}},xn=j,he=!xn(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),dt=he,ht=Function.prototype,ke=ht.call,Mn=dt&&ht.bind.bind(ke,ke),N=dt?Mn:function(e){return function(){return ke.apply(e,arguments)}},pt=N,Nn=pt({}.toString),Cn=pt("".slice),He=function(e){return Cn(Nn(e),8,-1)},Fn=N,Gn=j,Dn=He,Oe=Object,kn=Fn("".split),Un=Gn(function(){return!Oe("z").propertyIsEnumerable(0)})?function(e){return Dn(e)=="String"?kn(e,""):Oe(e)}:Oe,Xe=function(e){return e==null},Vn=Xe,Bn=TypeError,bt=function(e){if(Vn(e))throw Bn("Can't call method on "+e);return e},Kn=Un,qn=bt,H=function(e){return Kn(qn(e))},K={},Z=function(e){return e&&e.Math==Math&&e},I=Z(typeof globalThis=="object"&&globalThis)||Z(typeof window=="object"&&window)||Z(typeof self=="object"&&self)||Z(typeof ge=="object"&&ge)||function(){return this}()||ge||Function("return this")(),Ue=typeof document=="object"&&document.all,Yn=typeof Ue=="undefined"&&Ue!==void 0,yt={all:Ue,IS_HTMLDDA:Yn},gt=yt,zn=gt.all,R=gt.IS_HTMLDDA?function(e){return typeof e=="function"||e===zn}:function(e){return typeof e=="function"},Qn=I,Wn=R,vr=Qn.WeakMap,Hn=Wn(vr)&&/native code/.test(String(vr)),fr=R,Ot=yt,Xn=Ot.all,q=Ot.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===Xn}:function(e){return typeof e=="object"?e!==null:fr(e)},Jn=j,C=!Jn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Zn=I,dr=q,Ve=Zn.document,eo=dr(Ve)&&dr(Ve.createElement),$t=function(e){return eo?Ve.createElement(e):{}},ro=C,to=j,no=$t,wt=!ro&&!to(function(){return Object.defineProperty(no("div"),"a",{get:function(){return 7}}).a!=7}),oo=C,ao=j,mt=oo&&ao(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),io=q,so=String,co=TypeError,z=function(e){if(io(e))return e;throw co(so(e)+" is not an object")},lo=he,ee=Function.prototype.call,F=lo?ee.bind(ee):function(){return ee.apply(ee,arguments)},Je={},$e=Je,we=I,uo=R,hr=function(e){return uo(e)?e:void 0},St=function(e,r){return arguments.length<2?hr($e[e])||hr(we[e]):$e[e]&&$e[e][r]||we[e]&&we[e][r]},vo=N,Et=vo({}.isPrototypeOf),fo=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Tt=I,me=fo,pr=Tt.process,br=Tt.Deno,yr=pr&&pr.versions||br&&br.version,gr=yr&&yr.v8,T,ue;gr&&(T=gr.split("."),ue=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!ue&&me&&(T=me.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=me.match(/Chrome\/(\d+)/),T&&(ue=+T[1])));var ho=ue,Or=ho,po=j,bo=I,yo=bo.String,It=!!Object.getOwnPropertySymbols&&!po(function(){var e=Symbol();return!yo(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Or&&Or<41}),go=It,Rt=go&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Oo=St,$o=R,wo=Et,mo=Rt,So=Object,Pt=mo?function(e){return typeof e=="symbol"}:function(e){var r=Oo("Symbol");return $o(r)&&wo(r.prototype,So(e))},Eo=String,Ze=function(e){try{return Eo(e)}catch(r){return"Object"}},To=R,Io=Ze,Ro=TypeError,er=function(e){if(To(e))return e;throw Ro(Io(e)+" is not a function")},Po=er,_o=Xe,rr=function(e,r){var t=e[r];return _o(t)?void 0:Po(t)},Se=F,Ee=R,Te=q,Ao=TypeError,jo=function(e,r){var t,n;if(r==="string"&&Ee(t=e.toString)&&!Te(n=Se(t,e))||Ee(t=e.valueOf)&&!Te(n=Se(t,e))||r!=="string"&&Ee(t=e.toString)&&!Te(n=Se(t,e)))return n;throw Ao("Can't convert object to primitive value")},_t={exports:{}},$r=I,Lo=Object.defineProperty,xo=function(e,r){try{Lo($r,e,{value:r,configurable:!0,writable:!0})}catch(t){$r[e]=r}return r},Mo=I,No=xo,wr="__core-js_shared__",Co=Mo[wr]||No(wr,{}),At=Co,mr=At;(_t.exports=function(e,r){return mr[e]||(mr[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var jt=_t.exports,Fo=bt,Go=Object,Lt=function(e){return Go(Fo(e))},Do=N,ko=Lt,Uo=Do({}.hasOwnProperty),x=Object.hasOwn||function(r,t){return Uo(ko(r),t)},Vo=N,Bo=0,Ko=Math.random(),qo=Vo(1 .toString),xt=function(e){return"Symbol("+(e===void 0?"":e)+")_"+qo(++Bo+Ko,36)},Yo=I,zo=jt,Sr=x,Qo=xt,Wo=It,Ho=Rt,U=Yo.Symbol,Ie=zo("wks"),Xo=Ho?U.for||U:U&&U.withoutSetter||Qo,L=function(e){return Sr(Ie,e)||(Ie[e]=Wo&&Sr(U,e)?U[e]:Xo("Symbol."+e)),Ie[e]},Jo=F,Er=q,Tr=Pt,Zo=rr,ea=jo,ra=L,ta=TypeError,na=ra("toPrimitive"),oa=function(e,r){if(!Er(e)||Tr(e))return e;var t=Zo(e,na),n;if(t){if(r===void 0&&(r="default"),n=Jo(t,e,r),!Er(n)||Tr(n))return n;throw ta("Can't convert object to primitive value")}return r===void 0&&(r="number"),ea(e,r)},aa=oa,ia=Pt,tr=function(e){var r=aa(e,"string");return ia(r)?r:r+""},sa=C,ca=wt,la=mt,re=z,Ir=tr,ua=TypeError,Re=Object.defineProperty,va=Object.getOwnPropertyDescriptor,Pe="enumerable",_e="configurable",Ae="writable";Y.f=sa?la?function(r,t,n){if(re(r),t=Ir(t),re(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Ae in n&&!n[Ae]){var o=va(r,t);o&&o[Ae]&&(r[t]=n.value,n={configurable:_e in n?n[_e]:o[_e],enumerable:Pe in n?n[Pe]:o[Pe],writable:!1})}return Re(r,t,n)}:Re:function(r,t,n){if(re(r),t=Ir(t),re(n),ca)try{return Re(r,t,n)}catch(o){}if("get"in n||"set"in n)throw ua("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var pe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},fa=C,da=Y,ha=pe,X=fa?function(e,r,t){return da.f(e,r,ha(1,t))}:function(e,r,t){return e[r]=t,e},pa=jt,ba=xt,Rr=pa("keys"),nr=function(e){return Rr[e]||(Rr[e]=ba(e))},or={},ya=Hn,Mt=I,ga=q,Oa=X,je=x,Le=At,$a=nr,wa=or,Pr="Object already initialized",Be=Mt.TypeError,ma=Mt.WeakMap,ve,W,fe,Sa=function(e){return fe(e)?W(e):ve(e,{})},Ea=function(e){return function(r){var t;if(!ga(r)||(t=W(r)).type!==e)throw Be("Incompatible receiver, "+e+" required");return t}};if(ya||Le.state){var P=Le.state||(Le.state=new ma);P.get=P.get,P.has=P.has,P.set=P.set,ve=function(e,r){if(P.has(e))throw Be(Pr);return r.facade=e,P.set(e,r),r},W=function(e){return P.get(e)||{}},fe=function(e){return P.has(e)}}else{var G=$a("state");wa[G]=!0,ve=function(e,r){if(je(e,G))throw Be(Pr);return r.facade=e,Oa(e,G,r),r},W=function(e){return je(e,G)?e[G]:{}},fe=function(e){return je(e,G)}}var Ta={set:ve,get:W,has:fe,enforce:Sa,getterFor:Ea},Ia=he,Nt=Function.prototype,_r=Nt.apply,Ar=Nt.call,Ra=typeof Reflect=="object"&&Reflect.apply||(Ia?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),Pa=He,_a=N,Ct=function(e){if(Pa(e)==="Function")return _a(e)},Ft={},Gt={},Dt={}.propertyIsEnumerable,kt=Object.getOwnPropertyDescriptor,Aa=kt&&!Dt.call({1:2},1);Gt.f=Aa?function(r){var t=kt(this,r);return!!t&&t.enumerable}:Dt;var ja=C,La=F,xa=Gt,Ma=pe,Na=H,Ca=tr,Fa=x,Ga=wt,jr=Object.getOwnPropertyDescriptor;Ft.f=ja?jr:function(r,t){if(r=Na(r),t=Ca(t),Ga)try{return jr(r,t)}catch(n){}if(Fa(r,t))return Ma(!La(xa.f,r,t),r[t])};var Da=j,ka=R,Ua=/#|\.prototype\./,J=function(e,r){var t=Ba[Va(e)];return t==qa?!0:t==Ka?!1:ka(r)?Da(r):!!r},Va=J.normalize=function(e){return String(e).replace(Ua,".").toLowerCase()},Ba=J.data={},Ka=J.NATIVE="N",qa=J.POLYFILL="P",Ya=J,Lr=Ct,za=er,Qa=he,Wa=Lr(Lr.bind),Ut=function(e,r){return za(e),r===void 0?e:Qa?Wa(e,r):function(){return e.apply(r,arguments)}},te=I,Ha=Ra,Xa=Ct,Ja=R,Za=Ft.f,ei=Ya,D=Je,ri=Ut,k=X,xr=x,ti=function(e){var r=function(t,n,o){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return Ha(e,this,arguments)};return r.prototype=e.prototype,r},Vt=function(e,r){var t=e.target,n=e.global,o=e.stat,a=e.proto,i=n?te:o?te[t]:(te[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,l,c,u,f,d,$,S,w,g;for(f in r)l=ei(n?f:t+(o?".":"#")+f,e.forced),c=!l&&i&&xr(i,f),$=s[f],c&&(e.dontCallGetSet?(g=Za(i,f),S=g&&g.value):S=i[f]),d=c&&S?S:r[f],!(c&&typeof $==typeof d)&&(e.bind&&c?w=ri(d,te):e.wrap&&c?w=ti(d):a&&Ja(d)?w=Xa(d):w=d,(e.sham||d&&d.sham||$&&$.sham)&&k(w,"sham",!0),k(s,f,w),a&&(u=t+"Prototype",xr(D,u)||k(D,u,{}),k(D[u],f,d),e.real&&v&&(l||!v[f])&&k(v,f,d)))},Ke=C,ni=x,Bt=Function.prototype,oi=Ke&&Object.getOwnPropertyDescriptor,ar=ni(Bt,"name"),ai=ar&&function(){}.name==="something",ii=ar&&(!Ke||Ke&&oi(Bt,"name").configurable),si={EXISTS:ar,PROPER:ai,CONFIGURABLE:ii},Kt={},ci=Math.ceil,li=Math.floor,ui=Math.trunc||function(r){var t=+r;return(t>0?li:ci)(t)},vi=ui,qt=function(e){var r=+e;return r!==r||r===0?0:vi(r)},fi=qt,di=Math.max,hi=Math.min,pi=function(e,r){var t=fi(e);return t<0?di(t+r,0):hi(t,r)},bi=qt,yi=Math.min,gi=function(e){return e>0?yi(bi(e),9007199254740991):0},Oi=gi,Yt=function(e){return Oi(e.length)},$i=H,wi=pi,mi=Yt,Mr=function(e){return function(r,t,n){var o=$i(r),a=mi(o),i=wi(n,a),s;if(e&&t!=t){for(;a>i;)if(s=o[i++],s!=s)return!0}else for(;a>i;i++)if((e||i in o)&&o[i]===t)return e||i||0;return!e&&-1}},Si={includes:Mr(!0),indexOf:Mr(!1)},Ei=N,xe=x,Ti=H,Ii=Si.indexOf,Ri=or,Nr=Ei([].push),Pi=function(e,r){var t=Ti(e),n=0,o=[],a;for(a in t)!xe(Ri,a)&&xe(t,a)&&Nr(o,a);for(;r.length>n;)xe(t,a=r[n++])&&(~Ii(o,a)||Nr(o,a));return o},zt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],_i=Pi,Ai=zt,ji=Object.keys||function(r){return _i(r,Ai)},Li=C,xi=mt,Mi=Y,Ni=z,Ci=H,Fi=ji;Kt.f=Li&&!xi?Object.defineProperties:function(r,t){Ni(r);for(var n=Ci(t),o=Fi(t),a=o.length,i=0,s;a>i;)Mi.f(r,s=o[i++],n[s]);return r};var Gi=St,Di=Gi("document","documentElement"),ki=z,Ui=Kt,Cr=zt,Vi=or,Bi=Di,Ki=$t,qi=nr,Fr=">",Gr="<",qe="prototype",Ye="script",Qt=qi("IE_PROTO"),Me=function(){},Wt=function(e){return Gr+Ye+Fr+e+Gr+"/"+Ye+Fr},Dr=function(e){e.write(Wt("")),e.close();var r=e.parentWindow.Object;return e=null,r},Yi=function(){var e=Ki("iframe"),r="java"+Ye+":",t;return e.style.display="none",Bi.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(Wt("document.F=Object")),t.close(),t.F},ne,se=function(){try{ne=new ActiveXObject("htmlfile")}catch(r){}se=typeof document!="undefined"?document.domain&&ne?Dr(ne):Yi():Dr(ne);for(var e=Cr.length;e--;)delete se[qe][Cr[e]];return se()};Vi[Qt]=!0;var Ht=Object.create||function(r,t){var n;return r!==null?(Me[qe]=ki(r),n=new Me,Me[qe]=null,n[Qt]=r):n=se(),t===void 0?n:Ui.f(n,t)},zi=j,Qi=!zi(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Wi=x,Hi=R,Xi=Lt,Ji=nr,Zi=Qi,kr=Ji("IE_PROTO"),ze=Object,es=ze.prototype,Xt=Zi?ze.getPrototypeOf:function(e){var r=Xi(e);if(Wi(r,kr))return r[kr];var t=r.constructor;return Hi(t)&&r instanceof t?t.prototype:r instanceof ze?es:null},rs=X,Jt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:rs(e,r,t),e},ts=j,ns=R,os=q,as=Ht,Ur=Xt,is=Jt,ss=L,Qe=ss("iterator"),Zt=!1,A,Ne,Ce;[].keys&&(Ce=[].keys(),"next"in Ce?(Ne=Ur(Ur(Ce)),Ne!==Object.prototype&&(A=Ne)):Zt=!0);var cs=!os(A)||ts(function(){var e={};return A[Qe].call(e)!==e});cs?A={}:A=as(A);ns(A[Qe])||is(A,Qe,function(){return this});var en={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:Zt},ls=L,us=ls("toStringTag"),rn={};rn[us]="z";var ir=String(rn)==="[object z]",vs=ir,fs=R,ce=He,ds=L,hs=ds("toStringTag"),ps=Object,bs=ce(function(){return arguments}())=="Arguments",ys=function(e,r){try{return e[r]}catch(t){}},sr=vs?ce:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=ys(r=ps(e),hs))=="string"?t:bs?ce(r):(n=ce(r))=="Object"&&fs(r.callee)?"Arguments":n},gs=ir,Os=sr,$s=gs?{}.toString:function(){return"[object "+Os(this)+"]"},ws=ir,ms=Y.f,Ss=X,Es=x,Ts=$s,Is=L,Vr=Is("toStringTag"),tn=function(e,r,t,n){if(e){var o=t?e:e.prototype;Es(o,Vr)||ms(o,Vr,{configurable:!0,value:r}),n&&!ws&&Ss(o,"toString",Ts)}},Rs=en.IteratorPrototype,Ps=Ht,_s=pe,As=tn,js=K,Ls=function(){return this},xs=function(e,r,t,n){var o=r+" Iterator";return e.prototype=Ps(Rs,{next:_s(+!n,t)}),As(e,o,!1,!0),js[o]=Ls,e},Ms=Vt,Ns=F,nn=si,Cs=xs,Fs=Xt,Gs=tn,Br=Jt,Ds=L,Kr=K,on=en,ks=nn.PROPER;nn.CONFIGURABLE;on.IteratorPrototype;var oe=on.BUGGY_SAFARI_ITERATORS,Fe=Ds("iterator"),qr="keys",ae="values",Yr="entries",Us=function(){return this},Vs=function(e,r,t,n,o,a,i){Cs(t,r,n);var s=function(g){if(g===o&&f)return f;if(!oe&&g in c)return c[g];switch(g){case qr:return function(){return new t(this,g)};case ae:return function(){return new t(this,g)};case Yr:return function(){return new t(this,g)}}return function(){return new t(this)}},v=r+" Iterator",l=!1,c=e.prototype,u=c[Fe]||c["@@iterator"]||o&&c[o],f=!oe&&u||s(o),d=r=="Array"&&c.entries||u,$,S,w;if(d&&($=Fs(d.call(new e)),$!==Object.prototype&&$.next&&(Gs($,v,!0,!0),Kr[v]=Us)),ks&&o==ae&&u&&u.name!==ae&&(l=!0,f=function(){return Ns(u,this)}),o)if(S={values:s(ae),keys:a?f:s(qr),entries:s(Yr)},i)for(w in S)(oe||l||!(w in c))&&Br(c,w,S[w]);else Ms({target:r,proto:!0,forced:oe||l},S);return i&&c[Fe]!==f&&Br(c,Fe,f,{name:o}),Kr[r]=f,S},Bs=function(e,r){return{value:e,done:r}},Ks=H,zr=K,an=Ta;Y.f;var qs=Vs,ie=Bs,sn="Array Iterator",Ys=an.set,zs=an.getterFor(sn);qs(Array,"Array",function(e,r){Ys(this,{type:sn,target:Ks(e),index:0,kind:r})},function(){var e=zs(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,ie(void 0,!0)):t=="keys"?ie(n,!1):t=="values"?ie(r[n],!1):ie([n,r[n]],!1)},"values");zr.Arguments=zr.Array;var Qs=L,Ws=K,Hs=Qs("iterator"),Xs=Array.prototype,Js=function(e){return e!==void 0&&(Ws.Array===e||Xs[Hs]===e)},Zs=sr,Qr=rr,ec=Xe,rc=K,tc=L,nc=tc("iterator"),cn=function(e){if(!ec(e))return Qr(e,nc)||Qr(e,"@@iterator")||rc[Zs(e)]},oc=F,ac=er,ic=z,sc=Ze,cc=cn,lc=TypeError,uc=function(e,r){var t=arguments.length<2?cc(e):r;if(ac(t))return ic(oc(t,e));throw lc(sc(e)+" is not iterable")},vc=F,Wr=z,fc=rr,dc=function(e,r,t){var n,o;Wr(e);try{if(n=fc(e,"return"),!n){if(r==="throw")throw t;return t}n=vc(n,e)}catch(a){o=!0,n=a}if(r==="throw")throw t;if(o)throw n;return Wr(n),t},hc=Ut,pc=F,bc=z,yc=Ze,gc=Js,Oc=Yt,Hr=Et,$c=uc,wc=cn,Xr=dc,mc=TypeError,le=function(e,r){this.stopped=e,this.result=r},Jr=le.prototype,Sc=function(e,r,t){var n=t&&t.that,o=!!(t&&t.AS_ENTRIES),a=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=hc(r,n),l,c,u,f,d,$,S,w=function(O){return l&&Xr(l,"normal",O),new le(!0,O)},g=function(O){return o?(bc(O),s?v(O[0],O[1],w):v(O[0],O[1])):s?v(O,w):v(O)};if(a)l=e.iterator;else if(i)l=e;else{if(c=wc(e),!c)throw mc(yc(e)+" is not iterable");if(gc(c)){for(u=0,f=Oc(e);f>u;u++)if(d=g(e[u]),d&&Hr(Jr,d))return d;return new le(!1)}l=$c(e,c)}for($=a?e.next:l.next;!(S=pc($,l)).done;){try{d=g(S.value)}catch(O){Xr(l,"throw",O)}if(typeof d=="object"&&d&&Hr(Jr,d))return d}return new le(!1)},Ec=tr,Tc=Y,Ic=pe,Rc=function(e,r,t){var n=Ec(r);n in e?Tc.f(e,n,Ic(0,t)):e[n]=t},Pc=Vt,_c=Sc,Ac=Rc;Pc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return _c(r,function(n,o){Ac(t,n,o)},{AS_ENTRIES:!0}),t}});var jc=Je,Lc=jc.Object.fromEntries,xc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Mc=xc,Nc=I,Cc=sr,Fc=X,Zr=K,Gc=L,et=Gc("toStringTag");for(var Ge in Mc){var rt=Nc[Ge],De=rt&&rt.prototype;De&&Cc(De)!==et&&Fc(De,et,Ge),Zr[Ge]=Zr.Array}var Dc=Lc,kc=Dc,Uc=kc,Vc=Uc,Bc=Ln(Vc),tt;(function(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"})(tt||(tt={}));const Kc="vk.com",Ll=(e,r,t)=>at(void 0,void 0,void 0,function*(){const n=new URL(`https://${Kc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const a=yield(yield jn(n.toString())).json();return qc(a,t)}),qc=(e,r)=>Bc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Yc(n)])),Yc=e=>Array.isArray(e)?e[0]:e;var nt;(function(e){e.RU="ru",e.EN="en"})(nt||(nt={}));export{_ as CurrentClientBrowser,p as CurrentClientDevice,lr as ErrorCategory,nt as InterfaceLanguage,Wc as Logger,y as Observable,ot as Subject,de as Subscription,zc as VERSION,tt as VKNumericLanguage,pl as ValueSubject,m as VideoQuality,el as abortable,Jc as addScript,dl as areQualitiesExact,V as assertNever,Hc as assertNonNullable,Xc as assertNullable,hl as assertQualityIsExact,ml as buffer,Qc as checkNever,bl as combine,Sl as debounce,yn as fillWithDefault,Tl as filter,Il as filterChanged,wl as fromEvent,it as getCurrentBrowser,ol as getExponentialDelay,ll as getHighestQuality,tl as getIOSVersion,Ol as interval,il as isHigher,sl as isHigherOrEqual,rl as isIOS,lt as isInvariantQuality,st as isLower,cl as isLowerOrEqual,nl as isMacLike,ln as isNonNullable,un as isNullable,Ll as loadVKLangPack,Tn as map,Pl as mapTo,yl as merge,Q as noop,Zc as now,$l as observableFrom,_l as once,Al as pairwise,al as safeStorage,jl as tap,El as throttle,gl as timeout,ul as videoHeightToQuality,fl as videoQualityToHeight,vl as videoSizeToQuality};
|
package/es2018.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.31-dev.
|
|
3
|
-
* Fri, 27 Oct 2023 13:
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.31-dev.c49c485.0
|
|
3
|
+
* Fri, 27 Oct 2023 13:12:50 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-31/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const on="1.0.31-dev.88984b6.0";class Y{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const C=e=>{throw new Error(`${e} is value of unexpected type`)},sn=e=>{},G=()=>{};class b{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let a;t?typeof t=="function"?a={next:t,error:G}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:G,error:G};const o=typeof r=="function"?{next:s=>{try{r(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new Y().add(()=>{switch(o.next=G,o.error=G,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return C(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class qe extends b{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new Y().add(()=>this.subscribers.delete(t))}}class ln{constructor(){this.log$=new qe,this.logs=[],this.log=r=>{const t={...r,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(a){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}}function cn(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function un(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function tt(e){return typeof e!="undefined"&&e!==null}function nt(e){return e==null}const vn=(e,r,t)=>new Promise((n,a)=>{r.addEventListener("abort",()=>{s(),l.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",o),l.src=e,document.head.appendChild(l)});var de;const fn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now(),dn=(e,r)=>async(...t)=>{var n;const a=r(...t);let o=e.aborted,i;for(;!o&&!e.aborted;){const s=await a.next(i);o=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i};exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const Ye=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,a=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,o=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,i=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,v=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,l=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,c=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,f=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,u=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||a||i||s||t||n||o||exports.CurrentClientBrowser.Rest,device:v||l||c||f||d||u||exports.CurrentClientDevice.Desktop}},hn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device);if(!e)return t;const{userAgent:n,maxTouchPoints:a}=window.navigator;return!!(t||/macintosh/i.test(n)&&a>0)},bn=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},pn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),yn=(e,{start:r=0,factor:t=2,max:n=1/0,min:a=r,random:o=0}={})=>{let i=r;return i*=t**e,i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),i};var h;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(h||(h={}));let p,j;const he=`vk-videoplayer-dummy-key-${Math.random()}`,k=()=>{if(j!==void 0)return j;try{localStorage.setItem(he,"test"),localStorage.removeItem(he),j=h.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(he),j=h.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)j=h.RUNTIME;else throw r}else throw e}return j===h.RUNTIME&&(p=new Map),j},gn=()=>k()===h.LOCAL_STORAGE,On=e=>{var r,t;const n=k();switch(n){case h.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return p==null?void 0:p.get(e);default:C(n)}},wn=(e,r)=>{const t=k();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(p==null?void 0:p.set(e,r));default:C(t)}},$n=e=>{var r;const t=k();switch(t){case h.LOCAL_STORAGE:return e in localStorage;case h.SESSION_STORAGE:return e in sessionStorage;case h.RUNTIME:return(r=p==null?void 0:p.has(e))!==null&&r!==void 0?r:!1;default:return C(t),!1}},mn=e=>{const r=k();switch(r){case h.LOCAL_STORAGE:return localStorage.removeItem(e);case h.SESSION_STORAGE:return sessionStorage.removeItem(e);case h.RUNTIME:return void(p==null?void 0:p.delete(e));default:C(r)}},En=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return p==null?void 0:p.clear();default:C(e)}};var Sn=Object.freeze({__proto__:null,clear:En,get:On,has:$n,isPersistent:gn,remove:mn,set:wn});exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const m={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},Tn=(e,r)=>m[e].height>m[r].height,In=(e,r)=>m[e].height>=m[r].height,He=(e,r)=>m[e].height<m[r].height,Pn=(e,r)=>m[e].height<=m[r].height,Rn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:He(r,t)?1:-1)[0],at=Object.keys(m).sort((e,r)=>He(e,r)?-1:1),_n=(e,r=.02)=>[...at].find(n=>m[n].height*(1+r)>=e),An=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return at.find(a=>{const o=m[a];return o.width>=n&&o.height>=t})},jn=e=>m[e].height,ze=e=>e===exports.VideoQuality.INVARIANT,Cn=e=>e.every(r=>!ze(r));function Ln(e){if(ze(e))throw new Error("Expected exact quality")}const ot=(e,r)=>{const t={};for(const n of Object.keys(r)){const a=r[n],o=e[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=ot(o,a):t[n]=n in e?o:a}return t};class xn extends qe{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function Nn(e){return new b(r=>{const t={};let n=Object.keys(e).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&r.next(t)};return Object.entries(e).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new Y)})}function Mn(...e){return new b(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var Dn=e=>new b(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Fn=e=>new b(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Gn=e=>new b(r=>{e.forEach(t=>r.next(t))}),Vn=(e,r)=>new b(t=>{const n=a=>t.next(a);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function kn(e){return r=>new b(t=>r.subscribe(new Bn(t,e)))}class Bn{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Un={leading:!1,trailing:!0};function Qn(e,r=Un){return t=>new b(n=>t.subscribe(new Kn(n,e,r)))}class Kn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,tt(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const qn={leading:!0,trailing:!1};function Yn(e,r=qn){return t=>new b(n=>t.subscribe(new Hn(n,e,r)))}class Hn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,nt(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function zn(e){return r=>new b(t=>r.subscribe(new Wn(t,e)))}class Wn{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Xn(e=(r,t)=>r===t){return r=>new b(t=>r.subscribe(new Jn(t,e)))}const cr={};class Jn{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=cr}next(r){let t;try{t=this.lastValue===cr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function it(e){return r=>new b(t=>r.subscribe(new Zn(t,e)))}let Zn=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function ea(e){return it(()=>e)}function ra(){return e=>new b(r=>{let t=!1,n=!1;const a=e.subscribe(o=>{t||(t=!0,r.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function ta(){return e=>new b(r=>e.subscribe(new na(r)))}class na{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function aa(e){return r=>new b(t=>r.subscribe(new oa(t,e)))}class oa{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class ur{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class st extends ur{constructor(){super(),this.listeners||ur.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class ia{constructor(){Object.defineProperty(this,"signal",{value:new st,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(a){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(a){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(ia.prototype[Symbol.toStringTag]="AbortController",st.prototype[Symbol.toStringTag]="AbortSignal");function lt(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 sa(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a=!1}=e;if(!lt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:r,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=function(l,c){let f;c&&c.signal&&(f=c.signal,delete c.signal);const u=new t(l,c);return f&&Object.defineProperty(u,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),u},o.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=o&&o.prototype.isPrototypeOf(v)?v.signal:l?l.signal:void 0;if(c){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(c.aborted)return Promise.reject(f);const u=new Promise((d,O)=>{c.addEventListener("abort",()=>O(f),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([u,i(v,l)])}return i(v,l)},Request:o}}const We=lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ct=We?sa({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,la=We?ct.fetch:window.fetch;We?ct.Request:window.Request;var be=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ca(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var R=function(e){try{return!!e()}catch(r){return!0}},ua=R,ve=!ua(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),ut=ve,vt=Function.prototype,De=vt.call,va=ut&&vt.bind.bind(De,De),L=ut?va:function(e){return function(){return De.apply(e,arguments)}},ft=L,fa=ft({}.toString),da=ft("".slice),Xe=function(e){return da(fa(e),8,-1)},ha=L,ba=R,pa=Xe,pe=Object,ya=ha("".split),ga=ba(function(){return!pe("z").propertyIsEnumerable(0)})?function(e){return pa(e)=="String"?ya(e,""):pe(e)}:pe,Je=function(e){return e==null},Oa=Je,wa=TypeError,dt=function(e){if(Oa(e))throw wa("Can't call method on "+e);return e},$a=ga,ma=dt,H=function(e){return $a(ma(e))},B={},X=function(e){return e&&e.Math==Math&&e},S=X(typeof globalThis=="object"&&globalThis)||X(typeof window=="object"&&window)||X(typeof self=="object"&&self)||X(typeof be=="object"&&be)||function(){return this}()||be||Function("return this")(),Fe=typeof document=="object"&&document.all,Ea=typeof Fe=="undefined"&&Fe!==void 0,ht={all:Fe,IS_HTMLDDA:Ea},bt=ht,Sa=bt.all,T=bt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Sa}:function(e){return typeof e=="function"},Ta=S,Ia=T,vr=Ta.WeakMap,Pa=Ia(vr)&&/native code/.test(String(vr)),fr=T,pt=ht,Ra=pt.all,U=pt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===Ra}:function(e){return typeof e=="object"?e!==null:fr(e)},_a=R,x=!_a(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},Aa=S,dr=U,Ge=Aa.document,ja=dr(Ge)&&dr(Ge.createElement),yt=function(e){return ja?Ge.createElement(e):{}},Ca=x,La=R,xa=yt,gt=!Ca&&!La(function(){return Object.defineProperty(xa("div"),"a",{get:function(){return 7}}).a!=7}),Na=x,Ma=R,Ot=Na&&Ma(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Da=U,Fa=String,Ga=TypeError,K=function(e){if(Da(e))return e;throw Ga(Fa(e)+" is not an object")},Va=ve,J=Function.prototype.call,N=Va?J.bind(J):function(){return J.apply(J,arguments)},Ze={},ye=Ze,ge=S,ka=T,hr=function(e){return ka(e)?e:void 0},wt=function(e,r){return arguments.length<2?hr(ye[e])||hr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},Ba=L,$t=Ba({}.isPrototypeOf),Ua=typeof navigator!="undefined"&&String(navigator.userAgent)||"",mt=S,Oe=Ua,br=mt.process,pr=mt.Deno,yr=br&&br.versions||pr&&pr.version,gr=yr&&yr.v8,E,le;gr&&(E=gr.split("."),le=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!le&&Oe&&(E=Oe.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=Oe.match(/Chrome\/(\d+)/),E&&(le=+E[1])));var Qa=le,Or=Qa,Ka=R,qa=S,Ya=qa.String,Et=!!Object.getOwnPropertySymbols&&!Ka(function(){var e=Symbol();return!Ya(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Or&&Or<41}),Ha=Et,St=Ha&&!Symbol.sham&&typeof Symbol.iterator=="symbol",za=wt,Wa=T,Xa=$t,Ja=St,Za=Object,Tt=Ja?function(e){return typeof e=="symbol"}:function(e){var r=za("Symbol");return Wa(r)&&Xa(r.prototype,Za(e))},eo=String,er=function(e){try{return eo(e)}catch(r){return"Object"}},ro=T,to=er,no=TypeError,rr=function(e){if(ro(e))return e;throw no(to(e)+" is not a function")},ao=rr,oo=Je,tr=function(e,r){var t=e[r];return oo(t)?void 0:ao(t)},we=N,$e=T,me=U,io=TypeError,so=function(e,r){var t,n;if(r==="string"&&$e(t=e.toString)&&!me(n=we(t,e))||$e(t=e.valueOf)&&!me(n=we(t,e))||r!=="string"&&$e(t=e.toString)&&!me(n=we(t,e)))return n;throw io("Can't convert object to primitive value")},It={exports:{}},wr=S,lo=Object.defineProperty,co=function(e,r){try{lo(wr,e,{value:r,configurable:!0,writable:!0})}catch(t){wr[e]=r}return r},uo=S,vo=co,$r="__core-js_shared__",fo=uo[$r]||vo($r,{}),Pt=fo,mr=Pt;(It.exports=function(e,r){return mr[e]||(mr[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Rt=It.exports,ho=dt,bo=Object,_t=function(e){return bo(ho(e))},po=L,yo=_t,go=po({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return go(yo(r),t)},Oo=L,wo=0,$o=Math.random(),mo=Oo(1 .toString),At=function(e){return"Symbol("+(e===void 0?"":e)+")_"+mo(++wo+$o,36)},Eo=S,So=Rt,Er=A,To=At,Io=Et,Po=St,V=Eo.Symbol,Ee=So("wks"),Ro=Po?V.for||V:V&&V.withoutSetter||To,_=function(e){return Er(Ee,e)||(Ee[e]=Io&&Er(V,e)?V[e]:Ro("Symbol."+e)),Ee[e]},_o=N,Sr=U,Tr=Tt,Ao=tr,jo=so,Co=_,Lo=TypeError,xo=Co("toPrimitive"),No=function(e,r){if(!Sr(e)||Tr(e))return e;var t=Ao(e,xo),n;if(t){if(r===void 0&&(r="default"),n=_o(t,e,r),!Sr(n)||Tr(n))return n;throw Lo("Can't convert object to primitive value")}return r===void 0&&(r="number"),jo(e,r)},Mo=No,Do=Tt,nr=function(e){var r=Mo(e,"string");return Do(r)?r:r+""},Fo=x,Go=gt,Vo=Ot,Z=K,Ir=nr,ko=TypeError,Se=Object.defineProperty,Bo=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Pe="writable";Q.f=Fo?Vo?function(r,t,n){if(Z(r),t=Ir(t),Z(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Pe in n&&!n[Pe]){var a=Bo(r,t);a&&a[Pe]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:a[Ie],enumerable:Te in n?n[Te]:a[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Ir(t),Z(n),Go)try{return Se(r,t,n)}catch(a){}if("get"in n||"set"in n)throw ko("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var fe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Uo=x,Qo=Q,Ko=fe,z=Uo?function(e,r,t){return Qo.f(e,r,Ko(1,t))}:function(e,r,t){return e[r]=t,e},qo=Rt,Yo=At,Pr=qo("keys"),ar=function(e){return Pr[e]||(Pr[e]=Yo(e))},or={},Ho=Pa,jt=S,zo=U,Wo=z,Re=A,_e=Pt,Xo=ar,Jo=or,Rr="Object already initialized",Ve=jt.TypeError,Zo=jt.WeakMap,ce,q,ue,ei=function(e){return ue(e)?q(e):ce(e,{})},ri=function(e){return function(r){var t;if(!zo(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(Ho||_e.state){var I=_e.state||(_e.state=new Zo);I.get=I.get,I.has=I.has,I.set=I.set,ce=function(e,r){if(I.has(e))throw Ve(Rr);return r.facade=e,I.set(e,r),r},q=function(e){return I.get(e)||{}},ue=function(e){return I.has(e)}}else{var M=Xo("state");Jo[M]=!0,ce=function(e,r){if(Re(e,M))throw Ve(Rr);return r.facade=e,Wo(e,M,r),r},q=function(e){return Re(e,M)?e[M]:{}},ue=function(e){return Re(e,M)}}var ti={set:ce,get:q,has:ue,enforce:ei,getterFor:ri},ni=ve,Ct=Function.prototype,_r=Ct.apply,Ar=Ct.call,ai=typeof Reflect=="object"&&Reflect.apply||(ni?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),oi=Xe,ii=L,Lt=function(e){if(oi(e)==="Function")return ii(e)},xt={},Nt={},Mt={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,si=Dt&&!Mt.call({1:2},1);Nt.f=si?function(r){var t=Dt(this,r);return!!t&&t.enumerable}:Mt;var li=x,ci=N,ui=Nt,vi=fe,fi=H,di=nr,hi=A,bi=gt,jr=Object.getOwnPropertyDescriptor;xt.f=li?jr:function(r,t){if(r=fi(r),t=di(t),bi)try{return jr(r,t)}catch(n){}if(hi(r,t))return vi(!ci(ui.f,r,t),r[t])};var pi=R,yi=T,gi=/#|\.prototype\./,W=function(e,r){var t=wi[Oi(e)];return t==mi?!0:t==$i?!1:yi(r)?pi(r):!!r},Oi=W.normalize=function(e){return String(e).replace(gi,".").toLowerCase()},wi=W.data={},$i=W.NATIVE="N",mi=W.POLYFILL="P",Ei=W,Cr=Lt,Si=rr,Ti=ve,Ii=Cr(Cr.bind),Ft=function(e,r){return Si(e),r===void 0?e:Ti?Ii(e,r):function(){return e.apply(r,arguments)}},ee=S,Pi=ai,Ri=Lt,_i=T,Ai=xt.f,ji=Ei,D=Ze,Ci=Ft,F=z,Lr=A,Li=function(e){var r=function(t,n,a){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,a)}return Pi(e,this,arguments)};return r.prototype=e.prototype,r},Gt=function(e,r){var t=e.target,n=e.global,a=e.stat,o=e.proto,i=n?ee:a?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,l,c,f,u,d,O,$,w,y;for(u in r)l=ji(n?u:t+(a?".":"#")+u,e.forced),c=!l&&i&&Lr(i,u),O=s[u],c&&(e.dontCallGetSet?(y=Ai(i,u),$=y&&y.value):$=i[u]),d=c&&$?$:r[u],!(c&&typeof O==typeof d)&&(e.bind&&c?w=Ci(d,ee):e.wrap&&c?w=Li(d):o&&_i(d)?w=Ri(d):w=d,(e.sham||d&&d.sham||O&&O.sham)&&F(w,"sham",!0),F(s,u,w),o&&(f=t+"Prototype",Lr(D,f)||F(D,f,{}),F(D[f],u,d),e.real&&v&&(l||!v[u])&&F(v,u,d)))},ke=x,xi=A,Vt=Function.prototype,Ni=ke&&Object.getOwnPropertyDescriptor,ir=xi(Vt,"name"),Mi=ir&&function(){}.name==="something",Di=ir&&(!ke||ke&&Ni(Vt,"name").configurable),Fi={EXISTS:ir,PROPER:Mi,CONFIGURABLE:Di},kt={},Gi=Math.ceil,Vi=Math.floor,ki=Math.trunc||function(r){var t=+r;return(t>0?Vi:Gi)(t)},Bi=ki,Bt=function(e){var r=+e;return r!==r||r===0?0:Bi(r)},Ui=Bt,Qi=Math.max,Ki=Math.min,qi=function(e,r){var t=Ui(e);return t<0?Qi(t+r,0):Ki(t,r)},Yi=Bt,Hi=Math.min,zi=function(e){return e>0?Hi(Yi(e),9007199254740991):0},Wi=zi,Ut=function(e){return Wi(e.length)},Xi=H,Ji=qi,Zi=Ut,xr=function(e){return function(r,t,n){var a=Xi(r),o=Zi(a),i=Ji(n,o),s;if(e&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===t)return e||i||0;return!e&&-1}},es={includes:xr(!0),indexOf:xr(!1)},rs=L,Ae=A,ts=H,ns=es.indexOf,as=or,Nr=rs([].push),os=function(e,r){var t=ts(e),n=0,a=[],o;for(o in t)!Ae(as,o)&&Ae(t,o)&&Nr(a,o);for(;r.length>n;)Ae(t,o=r[n++])&&(~ns(a,o)||Nr(a,o));return a},Qt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],is=os,ss=Qt,ls=Object.keys||function(r){return is(r,ss)},cs=x,us=Ot,vs=Q,fs=K,ds=H,hs=ls;kt.f=cs&&!us?Object.defineProperties:function(r,t){fs(r);for(var n=ds(t),a=hs(t),o=a.length,i=0,s;o>i;)vs.f(r,s=a[i++],n[s]);return r};var bs=wt,ps=bs("document","documentElement"),ys=K,gs=kt,Mr=Qt,Os=or,ws=ps,$s=yt,ms=ar,Dr=">",Fr="<",Be="prototype",Ue="script",Kt=ms("IE_PROTO"),je=function(){},qt=function(e){return Fr+Ue+Dr+e+Fr+"/"+Ue+Dr},Gr=function(e){e.write(qt("")),e.close();var r=e.parentWindow.Object;return e=null,r},Es=function(){var e=$s("iframe"),r="java"+Ue+":",t;return e.style.display="none",ws.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(qt("document.F=Object")),t.close(),t.F},re,oe=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}oe=typeof document!="undefined"?document.domain&&re?Gr(re):Es():Gr(re);for(var e=Mr.length;e--;)delete oe[Be][Mr[e]];return oe()};Os[Kt]=!0;var Yt=Object.create||function(r,t){var n;return r!==null?(je[Be]=ys(r),n=new je,je[Be]=null,n[Kt]=r):n=oe(),t===void 0?n:gs.f(n,t)},Ss=R,Ts=!Ss(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Is=A,Ps=T,Rs=_t,_s=ar,As=Ts,Vr=_s("IE_PROTO"),Qe=Object,js=Qe.prototype,Ht=As?Qe.getPrototypeOf:function(e){var r=Rs(e);if(Is(r,Vr))return r[Vr];var t=r.constructor;return Ps(t)&&r instanceof t?t.prototype:r instanceof Qe?js:null},Cs=z,zt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Cs(e,r,t),e},Ls=R,xs=T,Ns=U,Ms=Yt,kr=Ht,Ds=zt,Fs=_,Ke=Fs("iterator"),Wt=!1,P,Ce,Le;[].keys&&(Le=[].keys(),"next"in Le?(Ce=kr(kr(Le)),Ce!==Object.prototype&&(P=Ce)):Wt=!0);var Gs=!Ns(P)||Ls(function(){var e={};return P[Ke].call(e)!==e});Gs?P={}:P=Ms(P);xs(P[Ke])||Ds(P,Ke,function(){return this});var Xt={IteratorPrototype:P,BUGGY_SAFARI_ITERATORS:Wt},Vs=_,ks=Vs("toStringTag"),Jt={};Jt[ks]="z";var sr=String(Jt)==="[object z]",Bs=sr,Us=T,ie=Xe,Qs=_,Ks=Qs("toStringTag"),qs=Object,Ys=ie(function(){return arguments}())=="Arguments",Hs=function(e,r){try{return e[r]}catch(t){}},lr=Bs?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Hs(r=qs(e),Ks))=="string"?t:Ys?ie(r):(n=ie(r))=="Object"&&Us(r.callee)?"Arguments":n},zs=sr,Ws=lr,Xs=zs?{}.toString:function(){return"[object "+Ws(this)+"]"},Js=sr,Zs=Q.f,el=z,rl=A,tl=Xs,nl=_,Br=nl("toStringTag"),Zt=function(e,r,t,n){if(e){var a=t?e:e.prototype;rl(a,Br)||Zs(a,Br,{configurable:!0,value:r}),n&&!Js&&el(a,"toString",tl)}},al=Xt.IteratorPrototype,ol=Yt,il=fe,sl=Zt,ll=B,cl=function(){return this},ul=function(e,r,t,n){var a=r+" Iterator";return e.prototype=ol(al,{next:il(+!n,t)}),sl(e,a,!1,!0),ll[a]=cl,e},vl=Gt,fl=N,en=Fi,dl=ul,hl=Ht,bl=Zt,Ur=zt,pl=_,Qr=B,rn=Xt,yl=en.PROPER;en.CONFIGURABLE;rn.IteratorPrototype;var te=rn.BUGGY_SAFARI_ITERATORS,xe=pl("iterator"),Kr="keys",ne="values",qr="entries",gl=function(){return this},Ol=function(e,r,t,n,a,o,i){dl(t,r,n);var s=function(y){if(y===a&&u)return u;if(!te&&y in c)return c[y];switch(y){case Kr:return function(){return new t(this,y)};case ne:return function(){return new t(this,y)};case qr:return function(){return new t(this,y)}}return function(){return new t(this)}},v=r+" Iterator",l=!1,c=e.prototype,f=c[xe]||c["@@iterator"]||a&&c[a],u=!te&&f||s(a),d=r=="Array"&&c.entries||f,O,$,w;if(d&&(O=hl(d.call(new e)),O!==Object.prototype&&O.next&&(bl(O,v,!0,!0),Qr[v]=gl)),yl&&a==ne&&f&&f.name!==ne&&(l=!0,u=function(){return fl(f,this)}),a)if($={values:s(ne),keys:o?u:s(Kr),entries:s(qr)},i)for(w in $)(te||l||!(w in c))&&Ur(c,w,$[w]);else vl({target:r,proto:!0,forced:te||l},$);return i&&c[xe]!==u&&Ur(c,xe,u,{name:a}),Qr[r]=u,$},wl=function(e,r){return{value:e,done:r}},$l=H,Yr=B,tn=ti;Q.f;var ml=Ol,ae=wl,nn="Array Iterator",El=tn.set,Sl=tn.getterFor(nn);ml(Array,"Array",function(e,r){El(this,{type:nn,target:$l(e),index:0,kind:r})},function(){var e=Sl(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,ae(void 0,!0)):t=="keys"?ae(n,!1):t=="values"?ae(r[n],!1):ae([n,r[n]],!1)},"values");Yr.Arguments=Yr.Array;var Tl=_,Il=B,Pl=Tl("iterator"),Rl=Array.prototype,_l=function(e){return e!==void 0&&(Il.Array===e||Rl[Pl]===e)},Al=lr,Hr=tr,jl=Je,Cl=B,Ll=_,xl=Ll("iterator"),an=function(e){if(!jl(e))return Hr(e,xl)||Hr(e,"@@iterator")||Cl[Al(e)]},Nl=N,Ml=rr,Dl=K,Fl=er,Gl=an,Vl=TypeError,kl=function(e,r){var t=arguments.length<2?Gl(e):r;if(Ml(t))return Dl(Nl(t,e));throw Vl(Fl(e)+" is not iterable")},Bl=N,zr=K,Ul=tr,Ql=function(e,r,t){var n,a;zr(e);try{if(n=Ul(e,"return"),!n){if(r==="throw")throw t;return t}n=Bl(n,e)}catch(o){a=!0,n=o}if(r==="throw")throw t;if(a)throw n;return zr(n),t},Kl=Ft,ql=N,Yl=K,Hl=er,zl=_l,Wl=Ut,Wr=$t,Xl=kl,Jl=an,Xr=Ql,Zl=TypeError,se=function(e,r){this.stopped=e,this.result=r},Jr=se.prototype,ec=function(e,r,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=Kl(r,n),l,c,f,u,d,O,$,w=function(g){return l&&Xr(l,"normal",g),new se(!0,g)},y=function(g){return a?(Yl(g),s?v(g[0],g[1],w):v(g[0],g[1])):s?v(g,w):v(g)};if(o)l=e.iterator;else if(i)l=e;else{if(c=Jl(e),!c)throw Zl(Hl(e)+" is not iterable");if(zl(c)){for(f=0,u=Wl(e);u>f;f++)if(d=y(e[f]),d&&Wr(Jr,d))return d;return new se(!1)}l=Xl(e,c)}for(O=o?e.next:l.next;!($=ql(O,l)).done;){try{d=y($.value)}catch(g){Xr(l,"throw",g)}if(typeof d=="object"&&d&&Wr(Jr,d))return d}return new se(!1)},rc=nr,tc=Q,nc=fe,ac=function(e,r,t){var n=rc(r);n in e?tc.f(e,n,nc(0,t)):e[n]=t},oc=Gt,ic=ec,sc=ac;oc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return ic(r,function(n,a){sc(t,n,a)},{AS_ENTRIES:!0}),t}});var lc=Ze,cc=lc.Object.fromEntries,uc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},vc=uc,fc=S,dc=lr,hc=z,Zr=B,bc=_,et=bc("toStringTag");for(var Ne in vc){var rt=fc[Ne],Me=rt&&rt.prototype;Me&&dc(Me)!==et&&hc(Me,et,Ne),Zr[Ne]=Zr.Array}var pc=cc,yc=pc,gc=yc,Oc=gc,wc=ca(Oc);exports.VKNumericLanguage=void 0;(function(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"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const $c="vk.com",mc=async(e,r,t)=>{const n=new URL(`https://${$c}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const o=await(await la(n.toString())).json();return Ec(o,t)},Ec=(e,r)=>wc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Sc(n)])),Sc=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=ln;exports.Observable=b;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=on;exports.ValueSubject=xn;exports.abortable=dn;exports.addScript=vn;exports.areQualitiesExact=Cn;exports.assertNever=C;exports.assertNonNullable=cn;exports.assertNullable=un;exports.assertQualityIsExact=Ln;exports.buffer=kn;exports.checkNever=sn;exports.combine=Nn;exports.debounce=Qn;exports.fillWithDefault=ot;exports.filter=zn;exports.filterChanged=Xn;exports.fromEvent=Vn;exports.getCurrentBrowser=Ye;exports.getExponentialDelay=yn;exports.getHighestQuality=Rn;exports.getIOSVersion=bn;exports.interval=Fn;exports.isHigher=Tn;exports.isHigherOrEqual=In;exports.isIOS=hn;exports.isInvariantQuality=ze;exports.isLower=He;exports.isLowerOrEqual=Pn;exports.isMacLike=pn;exports.isNonNullable=tt;exports.isNullable=nt;exports.loadVKLangPack=mc;exports.map=it;exports.mapTo=ea;exports.merge=Mn;exports.noop=G;exports.now=fn;exports.observableFrom=Gn;exports.once=ra;exports.pairwise=ta;exports.safeStorage=Sn;exports.tap=aa;exports.throttle=Yn;exports.timeout=Dn;exports.videoHeightToQuality=_n;exports.videoQualityToHeight=jn;exports.videoSizeToQuality=An;
|
|
6
|
+
"use strict";const on="1.0.31-dev.c49c485.0";class Y{constructor(){this.subscriptions=[]}unsubscribe(){const r=this.subscriptions;this.subscriptions=[],r.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(r){return this.subscriptions.push(r),this}}const C=e=>{throw new Error(`${e} is value of unexpected type`)},sn=e=>{},G=()=>{};class b{constructor(r){r&&(this._subscribe=r)}subscribe(r,t){var n;let a;t?typeof t=="function"?a={next:t,error:G}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:G,error:G};const o=typeof r=="function"?{next:s=>{try{r(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>r.next(s),error:s=>r.error?r.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new Y().add(()=>{switch(o.next=G,o.error=G,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return C(i)}})}pipe(...r){return r.reduce((t,n)=>n(t),this)}_subscribe(r){}}class qe extends b{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(r){this.subscribers.forEach(t=>t.next(r))}error(r){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,r)})}_subscribe(r){const t=this.keyCounter++;return this.subscribers.set(t,r),new Y().add(()=>this.subscribers.delete(t))}}class ln{constructor(){this.log$=new qe,this.logs=[],this.log=r=>{const t={...r,timestamp:Date.now()};this.logs.push(t),this.log$.next(t)},this.getAllLogs=()=>this.logs}createCustomLog(r){return(...t)=>{let n;try{n=r(...t)}catch(a){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(r){return this.createCustomLog(t=>({component:r,...t}))}}function cn(e,r='Assertion "value is not nullable" failed'){if(e==null)throw new Error(r)}function un(e,r='Assertion "value is nullable" failed'){if(e!=null)throw new Error(r)}function tt(e){return typeof e!="undefined"&&e!==null}function nt(e){return e==null}const vn=(e,r,t)=>new Promise((n,a)=>{r.addEventListener("abort",()=>{s(),l.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),l.removeEventListener("load",i),l.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const l=document.createElement("script");l.addEventListener("load",i),l.addEventListener("error",o),l.src=e,document.head.appendChild(l)});var de;const fn=typeof((de=window.performance)===null||de===void 0?void 0:de.now)=="function"?()=>window.performance.now():()=>Date.now(),dn=(e,r)=>async(...t)=>{var n;const a=r(...t);let o=e.aborted,i;for(;!o&&!e.aborted;){const s=await a.next(i);o=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i};exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const Ye=()=>{const{userAgent:e}=window.navigator,r=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,t=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,a=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,o=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,i=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,s=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,v=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,l=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,c=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,f=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,u=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:r||a||i||s||t||n||o||exports.CurrentClientBrowser.Rest,device:v||l||c||f||d||u||exports.CurrentClientDevice.Desktop}},hn=(e=!1)=>{const t=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device);if(!e)return t;const{userAgent:n,maxTouchPoints:a}=window.navigator;return!!(t||/macintosh/i.test(n)&&a>0)},bn=()=>{const{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return null;const t=r[1],n=parseFloat(t);return isNaN(n)?null:n},pn=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(Ye().device),yn=(e,{start:r=0,factor:t=2,max:n=1/0,min:a=r,random:o=0}={})=>{let i=r;return i*=t**e,i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),i};var h;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(h||(h={}));let p,j;const he=`vk-videoplayer-dummy-key-${Math.random()}`,k=()=>{if(j!==void 0)return j;try{localStorage.setItem(he,"test"),localStorage.removeItem(he),j=h.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(he),j=h.SESSION_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)j=h.RUNTIME;else throw r}else throw e}return j===h.RUNTIME&&(p=new Map),j},gn=()=>k()===h.LOCAL_STORAGE,On=e=>{var r,t;const n=k();switch(n){case h.LOCAL_STORAGE:return(r=localStorage.getItem(e))!==null&&r!==void 0?r:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(e))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return p==null?void 0:p.get(e);default:C(n)}},wn=(e,r)=>{const t=k();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(e,r)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(p==null?void 0:p.set(e,r));default:C(t)}},$n=e=>{var r;const t=k();switch(t){case h.LOCAL_STORAGE:return e in localStorage;case h.SESSION_STORAGE:return e in sessionStorage;case h.RUNTIME:return(r=p==null?void 0:p.has(e))!==null&&r!==void 0?r:!1;default:return C(t),!1}},mn=e=>{const r=k();switch(r){case h.LOCAL_STORAGE:return localStorage.removeItem(e);case h.SESSION_STORAGE:return sessionStorage.removeItem(e);case h.RUNTIME:return void(p==null?void 0:p.delete(e));default:C(r)}},En=()=>{const e=k();switch(e){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return p==null?void 0:p.clear();default:C(e)}};var Sn=Object.freeze({__proto__:null,clear:En,get:On,has:$n,isPersistent:gn,remove:mn,set:wn});exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const m={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},Tn=(e,r)=>m[e].height>m[r].height,In=(e,r)=>m[e].height>=m[r].height,He=(e,r)=>m[e].height<m[r].height,Pn=(e,r)=>m[e].height<=m[r].height,Rn=e=>e.sort((r,t)=>r===t?0:r===exports.VideoQuality.INVARIANT?1:t===exports.VideoQuality.INVARIANT?-1:He(r,t)?1:-1)[0],at=Object.keys(m).sort((e,r)=>He(e,r)?-1:1),_n=(e,r=.02)=>[...at].find(n=>m[n].height*(1+r)>=e),An=({width:e,height:r})=>{const t=Math.min(e,r),n=Math.max(e,r);return at.find(a=>{const o=m[a];return o.width>=n&&o.height>=t})},jn=e=>m[e].height,ze=e=>e===exports.VideoQuality.INVARIANT,Cn=e=>e.every(r=>!ze(r));function Ln(e){if(ze(e))throw new Error("Expected exact quality")}const ot=(e,r)=>{const t={};for(const n of Object.keys(r)){const a=r[n],o=e[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=ot(o,a):t[n]=n in e?o:a}return t};class xn extends qe{constructor(r){super(),this.value=r}next(r){super.next(this.value=r)}error(r){super.error(this.value=r)}getValue(){return this.value}_subscribe(r){const t=super._subscribe(r);return r.next(this.value),t}}function Nn(e){return new b(r=>{const t={};let n=Object.keys(e).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&r.next(t)};return Object.entries(e).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new Y)})}function Mn(...e){return new b(r=>e.reduce((t,n)=>t.add(n.subscribe(r)),new Y))}var Dn=e=>new b(r=>{const t=window.setTimeout(()=>{try{r.next()}catch(n){if(r.error)r.error(n);else throw n}},e);return()=>window.clearTimeout(t)}),Fn=e=>new b(r=>{const t=window.setInterval(()=>r.next(),e);return()=>window.clearInterval(t)}),Gn=e=>new b(r=>{e.forEach(t=>r.next(t))}),Vn=(e,r)=>new b(t=>{const n=a=>t.next(a);return e.addEventListener(r,n),()=>e.removeEventListener(r,n)});function kn(e){return r=>new b(t=>r.subscribe(new Bn(t,e)))}class Bn{constructor(r,t){this.destination=r,this.size=t,this.lastValues=[]}next(r){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(r),this.destination.next(this.lastValues)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const Un={leading:!1,trailing:!0};function Qn(e,r=Un){return t=>new b(n=>t.subscribe(new Kn(n,e,r)))}class Kn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,tt(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}const qn={leading:!0,trailing:!1};function Yn(e,r=qn){return t=>new b(n=>t.subscribe(new Hn(n,e,r)))}class Hn{constructor(r,t,n){this.destination=r,this.time=t,this.config=n}next(r){this.lastValue=r,nt(this.timeout)&&(this.config.leading&&this.destination.next(r),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function zn(e){return r=>new b(t=>r.subscribe(new Wn(t,e)))}class Wn{constructor(r,t){this.destination=r,this.predicate=t}next(r){let t;try{t=this.predicate(r)}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function Xn(e=(r,t)=>r===t){return r=>new b(t=>r.subscribe(new Jn(t,e)))}const cr={};class Jn{constructor(r,t){this.destination=r,this.predicate=t,this.lastValue=cr}next(r){let t;try{t=this.lastValue===cr||!this.predicate(this.lastValue,r),this.lastValue=r}catch(n){throw this.error(n),n}t&&this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function it(e){return r=>new b(t=>r.subscribe(new Zn(t,e)))}let Zn=class{constructor(r,t){this.destination=r,this.mapper=t}next(r){let t;try{t=this.mapper(r)}catch(n){throw this.error(n),n}this.destination.next(t)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}};function ea(e){return it(()=>e)}function ra(){return e=>new b(r=>{let t=!1,n=!1;const a=e.subscribe(o=>{t||(t=!0,r.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=r.error)===null||i===void 0||i.call(r,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function ta(){return e=>new b(r=>e.subscribe(new na(r)))}class na{constructor(r){this.destination=r,this.hasLast=!1}next(r){const t=this.last;if(this.last=r,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,r])}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}function aa(e){return r=>new b(t=>r.subscribe(new oa(t,e)))}class oa{constructor(r,t){this.destination=r,this.effect=t}next(r){try{this.effect(r)}catch(t){throw this.error(t),t}this.destination.next(r)}error(r){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,r)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class ur{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(r,t,n){r in this.listeners||(this.listeners[r]=[]),this.listeners[r].push({callback:t,options:n})}removeEventListener(r,t){if(!(r in this.listeners))return;const n=this.listeners[r];for(let a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(r){if(!(r.type in this.listeners))return;const n=this.listeners[r.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];try{i.callback.call(this,r)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(r.type,i.callback)}return!r.defaultPrevented}}class st extends ur{constructor(){super(),this.listeners||ur.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(r){r.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,r)),super.dispatchEvent(r)}}class ia{constructor(){Object.defineProperty(this,"signal",{value:new st,writable:!0,configurable:!0})}abort(r){let t;try{t=new Event("abort")}catch(a){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=r;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(a){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(ia.prototype[Symbol.toStringTag]="AbortController",st.prototype[Symbol.toStringTag]="AbortSignal");function lt(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 sa(e){typeof e=="function"&&(e={fetch:e});const{fetch:r,Request:t=r.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a=!1}=e;if(!lt({fetch:r,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:r,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=function(l,c){let f;c&&c.signal&&(f=c.signal,delete c.signal);const u=new t(l,c);return f&&Object.defineProperty(u,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),u},o.prototype=t.prototype);const i=r;return{fetch:(v,l)=>{const c=o&&o.prototype.isPrototypeOf(v)?v.signal:l?l.signal:void 0;if(c){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(c.aborted)return Promise.reject(f);const u=new Promise((d,O)=>{c.addEventListener("abort",()=>O(f),{once:!0})});return l&&l.signal&&delete l.signal,Promise.race([u,i(v,l)])}return i(v,l)},Request:o}}const We=lt({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),ct=We?sa({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,la=We?ct.fetch:window.fetch;We?ct.Request:window.Request;var be=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ca(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var R=function(e){try{return!!e()}catch(r){return!0}},ua=R,ve=!ua(function(){var e=function(){}.bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),ut=ve,vt=Function.prototype,De=vt.call,va=ut&&vt.bind.bind(De,De),L=ut?va:function(e){return function(){return De.apply(e,arguments)}},ft=L,fa=ft({}.toString),da=ft("".slice),Xe=function(e){return da(fa(e),8,-1)},ha=L,ba=R,pa=Xe,pe=Object,ya=ha("".split),ga=ba(function(){return!pe("z").propertyIsEnumerable(0)})?function(e){return pa(e)=="String"?ya(e,""):pe(e)}:pe,Je=function(e){return e==null},Oa=Je,wa=TypeError,dt=function(e){if(Oa(e))throw wa("Can't call method on "+e);return e},$a=ga,ma=dt,H=function(e){return $a(ma(e))},B={},X=function(e){return e&&e.Math==Math&&e},S=X(typeof globalThis=="object"&&globalThis)||X(typeof window=="object"&&window)||X(typeof self=="object"&&self)||X(typeof be=="object"&&be)||function(){return this}()||be||Function("return this")(),Fe=typeof document=="object"&&document.all,Ea=typeof Fe=="undefined"&&Fe!==void 0,ht={all:Fe,IS_HTMLDDA:Ea},bt=ht,Sa=bt.all,T=bt.IS_HTMLDDA?function(e){return typeof e=="function"||e===Sa}:function(e){return typeof e=="function"},Ta=S,Ia=T,vr=Ta.WeakMap,Pa=Ia(vr)&&/native code/.test(String(vr)),fr=T,pt=ht,Ra=pt.all,U=pt.IS_HTMLDDA?function(e){return typeof e=="object"?e!==null:fr(e)||e===Ra}:function(e){return typeof e=="object"?e!==null:fr(e)},_a=R,x=!_a(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Q={},Aa=S,dr=U,Ge=Aa.document,ja=dr(Ge)&&dr(Ge.createElement),yt=function(e){return ja?Ge.createElement(e):{}},Ca=x,La=R,xa=yt,gt=!Ca&&!La(function(){return Object.defineProperty(xa("div"),"a",{get:function(){return 7}}).a!=7}),Na=x,Ma=R,Ot=Na&&Ma(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),Da=U,Fa=String,Ga=TypeError,K=function(e){if(Da(e))return e;throw Ga(Fa(e)+" is not an object")},Va=ve,J=Function.prototype.call,N=Va?J.bind(J):function(){return J.apply(J,arguments)},Ze={},ye=Ze,ge=S,ka=T,hr=function(e){return ka(e)?e:void 0},wt=function(e,r){return arguments.length<2?hr(ye[e])||hr(ge[e]):ye[e]&&ye[e][r]||ge[e]&&ge[e][r]},Ba=L,$t=Ba({}.isPrototypeOf),Ua=typeof navigator!="undefined"&&String(navigator.userAgent)||"",mt=S,Oe=Ua,br=mt.process,pr=mt.Deno,yr=br&&br.versions||pr&&pr.version,gr=yr&&yr.v8,E,le;gr&&(E=gr.split("."),le=E[0]>0&&E[0]<4?1:+(E[0]+E[1]));!le&&Oe&&(E=Oe.match(/Edge\/(\d+)/),(!E||E[1]>=74)&&(E=Oe.match(/Chrome\/(\d+)/),E&&(le=+E[1])));var Qa=le,Or=Qa,Ka=R,qa=S,Ya=qa.String,Et=!!Object.getOwnPropertySymbols&&!Ka(function(){var e=Symbol();return!Ya(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Or&&Or<41}),Ha=Et,St=Ha&&!Symbol.sham&&typeof Symbol.iterator=="symbol",za=wt,Wa=T,Xa=$t,Ja=St,Za=Object,Tt=Ja?function(e){return typeof e=="symbol"}:function(e){var r=za("Symbol");return Wa(r)&&Xa(r.prototype,Za(e))},eo=String,er=function(e){try{return eo(e)}catch(r){return"Object"}},ro=T,to=er,no=TypeError,rr=function(e){if(ro(e))return e;throw no(to(e)+" is not a function")},ao=rr,oo=Je,tr=function(e,r){var t=e[r];return oo(t)?void 0:ao(t)},we=N,$e=T,me=U,io=TypeError,so=function(e,r){var t,n;if(r==="string"&&$e(t=e.toString)&&!me(n=we(t,e))||$e(t=e.valueOf)&&!me(n=we(t,e))||r!=="string"&&$e(t=e.toString)&&!me(n=we(t,e)))return n;throw io("Can't convert object to primitive value")},It={exports:{}},wr=S,lo=Object.defineProperty,co=function(e,r){try{lo(wr,e,{value:r,configurable:!0,writable:!0})}catch(t){wr[e]=r}return r},uo=S,vo=co,$r="__core-js_shared__",fo=uo[$r]||vo($r,{}),Pt=fo,mr=Pt;(It.exports=function(e,r){return mr[e]||(mr[e]=r!==void 0?r:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Rt=It.exports,ho=dt,bo=Object,_t=function(e){return bo(ho(e))},po=L,yo=_t,go=po({}.hasOwnProperty),A=Object.hasOwn||function(r,t){return go(yo(r),t)},Oo=L,wo=0,$o=Math.random(),mo=Oo(1 .toString),At=function(e){return"Symbol("+(e===void 0?"":e)+")_"+mo(++wo+$o,36)},Eo=S,So=Rt,Er=A,To=At,Io=Et,Po=St,V=Eo.Symbol,Ee=So("wks"),Ro=Po?V.for||V:V&&V.withoutSetter||To,_=function(e){return Er(Ee,e)||(Ee[e]=Io&&Er(V,e)?V[e]:Ro("Symbol."+e)),Ee[e]},_o=N,Sr=U,Tr=Tt,Ao=tr,jo=so,Co=_,Lo=TypeError,xo=Co("toPrimitive"),No=function(e,r){if(!Sr(e)||Tr(e))return e;var t=Ao(e,xo),n;if(t){if(r===void 0&&(r="default"),n=_o(t,e,r),!Sr(n)||Tr(n))return n;throw Lo("Can't convert object to primitive value")}return r===void 0&&(r="number"),jo(e,r)},Mo=No,Do=Tt,nr=function(e){var r=Mo(e,"string");return Do(r)?r:r+""},Fo=x,Go=gt,Vo=Ot,Z=K,Ir=nr,ko=TypeError,Se=Object.defineProperty,Bo=Object.getOwnPropertyDescriptor,Te="enumerable",Ie="configurable",Pe="writable";Q.f=Fo?Vo?function(r,t,n){if(Z(r),t=Ir(t),Z(n),typeof r=="function"&&t==="prototype"&&"value"in n&&Pe in n&&!n[Pe]){var a=Bo(r,t);a&&a[Pe]&&(r[t]=n.value,n={configurable:Ie in n?n[Ie]:a[Ie],enumerable:Te in n?n[Te]:a[Te],writable:!1})}return Se(r,t,n)}:Se:function(r,t,n){if(Z(r),t=Ir(t),Z(n),Go)try{return Se(r,t,n)}catch(a){}if("get"in n||"set"in n)throw ko("Accessors not supported");return"value"in n&&(r[t]=n.value),r};var fe=function(e,r){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:r}},Uo=x,Qo=Q,Ko=fe,z=Uo?function(e,r,t){return Qo.f(e,r,Ko(1,t))}:function(e,r,t){return e[r]=t,e},qo=Rt,Yo=At,Pr=qo("keys"),ar=function(e){return Pr[e]||(Pr[e]=Yo(e))},or={},Ho=Pa,jt=S,zo=U,Wo=z,Re=A,_e=Pt,Xo=ar,Jo=or,Rr="Object already initialized",Ve=jt.TypeError,Zo=jt.WeakMap,ce,q,ue,ei=function(e){return ue(e)?q(e):ce(e,{})},ri=function(e){return function(r){var t;if(!zo(r)||(t=q(r)).type!==e)throw Ve("Incompatible receiver, "+e+" required");return t}};if(Ho||_e.state){var I=_e.state||(_e.state=new Zo);I.get=I.get,I.has=I.has,I.set=I.set,ce=function(e,r){if(I.has(e))throw Ve(Rr);return r.facade=e,I.set(e,r),r},q=function(e){return I.get(e)||{}},ue=function(e){return I.has(e)}}else{var M=Xo("state");Jo[M]=!0,ce=function(e,r){if(Re(e,M))throw Ve(Rr);return r.facade=e,Wo(e,M,r),r},q=function(e){return Re(e,M)?e[M]:{}},ue=function(e){return Re(e,M)}}var ti={set:ce,get:q,has:ue,enforce:ei,getterFor:ri},ni=ve,Ct=Function.prototype,_r=Ct.apply,Ar=Ct.call,ai=typeof Reflect=="object"&&Reflect.apply||(ni?Ar.bind(_r):function(){return Ar.apply(_r,arguments)}),oi=Xe,ii=L,Lt=function(e){if(oi(e)==="Function")return ii(e)},xt={},Nt={},Mt={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,si=Dt&&!Mt.call({1:2},1);Nt.f=si?function(r){var t=Dt(this,r);return!!t&&t.enumerable}:Mt;var li=x,ci=N,ui=Nt,vi=fe,fi=H,di=nr,hi=A,bi=gt,jr=Object.getOwnPropertyDescriptor;xt.f=li?jr:function(r,t){if(r=fi(r),t=di(t),bi)try{return jr(r,t)}catch(n){}if(hi(r,t))return vi(!ci(ui.f,r,t),r[t])};var pi=R,yi=T,gi=/#|\.prototype\./,W=function(e,r){var t=wi[Oi(e)];return t==mi?!0:t==$i?!1:yi(r)?pi(r):!!r},Oi=W.normalize=function(e){return String(e).replace(gi,".").toLowerCase()},wi=W.data={},$i=W.NATIVE="N",mi=W.POLYFILL="P",Ei=W,Cr=Lt,Si=rr,Ti=ve,Ii=Cr(Cr.bind),Ft=function(e,r){return Si(e),r===void 0?e:Ti?Ii(e,r):function(){return e.apply(r,arguments)}},ee=S,Pi=ai,Ri=Lt,_i=T,Ai=xt.f,ji=Ei,D=Ze,Ci=Ft,F=z,Lr=A,Li=function(e){var r=function(t,n,a){if(this instanceof r){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,a)}return Pi(e,this,arguments)};return r.prototype=e.prototype,r},Gt=function(e,r){var t=e.target,n=e.global,a=e.stat,o=e.proto,i=n?ee:a?ee[t]:(ee[t]||{}).prototype,s=n?D:D[t]||F(D,t,{})[t],v=s.prototype,l,c,f,u,d,O,$,w,y;for(u in r)l=ji(n?u:t+(a?".":"#")+u,e.forced),c=!l&&i&&Lr(i,u),O=s[u],c&&(e.dontCallGetSet?(y=Ai(i,u),$=y&&y.value):$=i[u]),d=c&&$?$:r[u],!(c&&typeof O==typeof d)&&(e.bind&&c?w=Ci(d,ee):e.wrap&&c?w=Li(d):o&&_i(d)?w=Ri(d):w=d,(e.sham||d&&d.sham||O&&O.sham)&&F(w,"sham",!0),F(s,u,w),o&&(f=t+"Prototype",Lr(D,f)||F(D,f,{}),F(D[f],u,d),e.real&&v&&(l||!v[u])&&F(v,u,d)))},ke=x,xi=A,Vt=Function.prototype,Ni=ke&&Object.getOwnPropertyDescriptor,ir=xi(Vt,"name"),Mi=ir&&function(){}.name==="something",Di=ir&&(!ke||ke&&Ni(Vt,"name").configurable),Fi={EXISTS:ir,PROPER:Mi,CONFIGURABLE:Di},kt={},Gi=Math.ceil,Vi=Math.floor,ki=Math.trunc||function(r){var t=+r;return(t>0?Vi:Gi)(t)},Bi=ki,Bt=function(e){var r=+e;return r!==r||r===0?0:Bi(r)},Ui=Bt,Qi=Math.max,Ki=Math.min,qi=function(e,r){var t=Ui(e);return t<0?Qi(t+r,0):Ki(t,r)},Yi=Bt,Hi=Math.min,zi=function(e){return e>0?Hi(Yi(e),9007199254740991):0},Wi=zi,Ut=function(e){return Wi(e.length)},Xi=H,Ji=qi,Zi=Ut,xr=function(e){return function(r,t,n){var a=Xi(r),o=Zi(a),i=Ji(n,o),s;if(e&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((e||i in a)&&a[i]===t)return e||i||0;return!e&&-1}},es={includes:xr(!0),indexOf:xr(!1)},rs=L,Ae=A,ts=H,ns=es.indexOf,as=or,Nr=rs([].push),os=function(e,r){var t=ts(e),n=0,a=[],o;for(o in t)!Ae(as,o)&&Ae(t,o)&&Nr(a,o);for(;r.length>n;)Ae(t,o=r[n++])&&(~ns(a,o)||Nr(a,o));return a},Qt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],is=os,ss=Qt,ls=Object.keys||function(r){return is(r,ss)},cs=x,us=Ot,vs=Q,fs=K,ds=H,hs=ls;kt.f=cs&&!us?Object.defineProperties:function(r,t){fs(r);for(var n=ds(t),a=hs(t),o=a.length,i=0,s;o>i;)vs.f(r,s=a[i++],n[s]);return r};var bs=wt,ps=bs("document","documentElement"),ys=K,gs=kt,Mr=Qt,Os=or,ws=ps,$s=yt,ms=ar,Dr=">",Fr="<",Be="prototype",Ue="script",Kt=ms("IE_PROTO"),je=function(){},qt=function(e){return Fr+Ue+Dr+e+Fr+"/"+Ue+Dr},Gr=function(e){e.write(qt("")),e.close();var r=e.parentWindow.Object;return e=null,r},Es=function(){var e=$s("iframe"),r="java"+Ue+":",t;return e.style.display="none",ws.appendChild(e),e.src=String(r),t=e.contentWindow.document,t.open(),t.write(qt("document.F=Object")),t.close(),t.F},re,oe=function(){try{re=new ActiveXObject("htmlfile")}catch(r){}oe=typeof document!="undefined"?document.domain&&re?Gr(re):Es():Gr(re);for(var e=Mr.length;e--;)delete oe[Be][Mr[e]];return oe()};Os[Kt]=!0;var Yt=Object.create||function(r,t){var n;return r!==null?(je[Be]=ys(r),n=new je,je[Be]=null,n[Kt]=r):n=oe(),t===void 0?n:gs.f(n,t)},Ss=R,Ts=!Ss(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Is=A,Ps=T,Rs=_t,_s=ar,As=Ts,Vr=_s("IE_PROTO"),Qe=Object,js=Qe.prototype,Ht=As?Qe.getPrototypeOf:function(e){var r=Rs(e);if(Is(r,Vr))return r[Vr];var t=r.constructor;return Ps(t)&&r instanceof t?t.prototype:r instanceof Qe?js:null},Cs=z,zt=function(e,r,t,n){return n&&n.enumerable?e[r]=t:Cs(e,r,t),e},Ls=R,xs=T,Ns=U,Ms=Yt,kr=Ht,Ds=zt,Fs=_,Ke=Fs("iterator"),Wt=!1,P,Ce,Le;[].keys&&(Le=[].keys(),"next"in Le?(Ce=kr(kr(Le)),Ce!==Object.prototype&&(P=Ce)):Wt=!0);var Gs=!Ns(P)||Ls(function(){var e={};return P[Ke].call(e)!==e});Gs?P={}:P=Ms(P);xs(P[Ke])||Ds(P,Ke,function(){return this});var Xt={IteratorPrototype:P,BUGGY_SAFARI_ITERATORS:Wt},Vs=_,ks=Vs("toStringTag"),Jt={};Jt[ks]="z";var sr=String(Jt)==="[object z]",Bs=sr,Us=T,ie=Xe,Qs=_,Ks=Qs("toStringTag"),qs=Object,Ys=ie(function(){return arguments}())=="Arguments",Hs=function(e,r){try{return e[r]}catch(t){}},lr=Bs?ie:function(e){var r,t,n;return e===void 0?"Undefined":e===null?"Null":typeof(t=Hs(r=qs(e),Ks))=="string"?t:Ys?ie(r):(n=ie(r))=="Object"&&Us(r.callee)?"Arguments":n},zs=sr,Ws=lr,Xs=zs?{}.toString:function(){return"[object "+Ws(this)+"]"},Js=sr,Zs=Q.f,el=z,rl=A,tl=Xs,nl=_,Br=nl("toStringTag"),Zt=function(e,r,t,n){if(e){var a=t?e:e.prototype;rl(a,Br)||Zs(a,Br,{configurable:!0,value:r}),n&&!Js&&el(a,"toString",tl)}},al=Xt.IteratorPrototype,ol=Yt,il=fe,sl=Zt,ll=B,cl=function(){return this},ul=function(e,r,t,n){var a=r+" Iterator";return e.prototype=ol(al,{next:il(+!n,t)}),sl(e,a,!1,!0),ll[a]=cl,e},vl=Gt,fl=N,en=Fi,dl=ul,hl=Ht,bl=Zt,Ur=zt,pl=_,Qr=B,rn=Xt,yl=en.PROPER;en.CONFIGURABLE;rn.IteratorPrototype;var te=rn.BUGGY_SAFARI_ITERATORS,xe=pl("iterator"),Kr="keys",ne="values",qr="entries",gl=function(){return this},Ol=function(e,r,t,n,a,o,i){dl(t,r,n);var s=function(y){if(y===a&&u)return u;if(!te&&y in c)return c[y];switch(y){case Kr:return function(){return new t(this,y)};case ne:return function(){return new t(this,y)};case qr:return function(){return new t(this,y)}}return function(){return new t(this)}},v=r+" Iterator",l=!1,c=e.prototype,f=c[xe]||c["@@iterator"]||a&&c[a],u=!te&&f||s(a),d=r=="Array"&&c.entries||f,O,$,w;if(d&&(O=hl(d.call(new e)),O!==Object.prototype&&O.next&&(bl(O,v,!0,!0),Qr[v]=gl)),yl&&a==ne&&f&&f.name!==ne&&(l=!0,u=function(){return fl(f,this)}),a)if($={values:s(ne),keys:o?u:s(Kr),entries:s(qr)},i)for(w in $)(te||l||!(w in c))&&Ur(c,w,$[w]);else vl({target:r,proto:!0,forced:te||l},$);return i&&c[xe]!==u&&Ur(c,xe,u,{name:a}),Qr[r]=u,$},wl=function(e,r){return{value:e,done:r}},$l=H,Yr=B,tn=ti;Q.f;var ml=Ol,ae=wl,nn="Array Iterator",El=tn.set,Sl=tn.getterFor(nn);ml(Array,"Array",function(e,r){El(this,{type:nn,target:$l(e),index:0,kind:r})},function(){var e=Sl(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,ae(void 0,!0)):t=="keys"?ae(n,!1):t=="values"?ae(r[n],!1):ae([n,r[n]],!1)},"values");Yr.Arguments=Yr.Array;var Tl=_,Il=B,Pl=Tl("iterator"),Rl=Array.prototype,_l=function(e){return e!==void 0&&(Il.Array===e||Rl[Pl]===e)},Al=lr,Hr=tr,jl=Je,Cl=B,Ll=_,xl=Ll("iterator"),an=function(e){if(!jl(e))return Hr(e,xl)||Hr(e,"@@iterator")||Cl[Al(e)]},Nl=N,Ml=rr,Dl=K,Fl=er,Gl=an,Vl=TypeError,kl=function(e,r){var t=arguments.length<2?Gl(e):r;if(Ml(t))return Dl(Nl(t,e));throw Vl(Fl(e)+" is not iterable")},Bl=N,zr=K,Ul=tr,Ql=function(e,r,t){var n,a;zr(e);try{if(n=Ul(e,"return"),!n){if(r==="throw")throw t;return t}n=Bl(n,e)}catch(o){a=!0,n=o}if(r==="throw")throw t;if(a)throw n;return zr(n),t},Kl=Ft,ql=N,Yl=K,Hl=er,zl=_l,Wl=Ut,Wr=$t,Xl=kl,Jl=an,Xr=Ql,Zl=TypeError,se=function(e,r){this.stopped=e,this.result=r},Jr=se.prototype,ec=function(e,r,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=Kl(r,n),l,c,f,u,d,O,$,w=function(g){return l&&Xr(l,"normal",g),new se(!0,g)},y=function(g){return a?(Yl(g),s?v(g[0],g[1],w):v(g[0],g[1])):s?v(g,w):v(g)};if(o)l=e.iterator;else if(i)l=e;else{if(c=Jl(e),!c)throw Zl(Hl(e)+" is not iterable");if(zl(c)){for(f=0,u=Wl(e);u>f;f++)if(d=y(e[f]),d&&Wr(Jr,d))return d;return new se(!1)}l=Xl(e,c)}for(O=o?e.next:l.next;!($=ql(O,l)).done;){try{d=y($.value)}catch(g){Xr(l,"throw",g)}if(typeof d=="object"&&d&&Wr(Jr,d))return d}return new se(!1)},rc=nr,tc=Q,nc=fe,ac=function(e,r,t){var n=rc(r);n in e?tc.f(e,n,nc(0,t)):e[n]=t},oc=Gt,ic=ec,sc=ac;oc({target:"Object",stat:!0},{fromEntries:function(r){var t={};return ic(r,function(n,a){sc(t,n,a)},{AS_ENTRIES:!0}),t}});var lc=Ze,cc=lc.Object.fromEntries,uc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},vc=uc,fc=S,dc=lr,hc=z,Zr=B,bc=_,et=bc("toStringTag");for(var Ne in vc){var rt=fc[Ne],Me=rt&&rt.prototype;Me&&dc(Me)!==et&&hc(Me,et,Ne),Zr[Ne]=Zr.Array}var pc=cc,yc=pc,gc=yc,Oc=gc,wc=ca(Oc);exports.VKNumericLanguage=void 0;(function(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"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const $c="vk.com",mc=async(e,r,t)=>{const n=new URL(`https://${$c}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",r),e!==void 0&&n.searchParams.set("lang",e);const o=await(await la(n.toString())).json();return Ec(o,t)},Ec=(e,r)=>wc(Object.entries(e.keys).map(([t,n])=>[t.substring(`${r}_`.length),Sc(n)])),Sc=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=ln;exports.Observable=b;exports.Subject=qe;exports.Subscription=Y;exports.VERSION=on;exports.ValueSubject=xn;exports.abortable=dn;exports.addScript=vn;exports.areQualitiesExact=Cn;exports.assertNever=C;exports.assertNonNullable=cn;exports.assertNullable=un;exports.assertQualityIsExact=Ln;exports.buffer=kn;exports.checkNever=sn;exports.combine=Nn;exports.debounce=Qn;exports.fillWithDefault=ot;exports.filter=zn;exports.filterChanged=Xn;exports.fromEvent=Vn;exports.getCurrentBrowser=Ye;exports.getExponentialDelay=yn;exports.getHighestQuality=Rn;exports.getIOSVersion=bn;exports.interval=Fn;exports.isHigher=Tn;exports.isHigherOrEqual=In;exports.isIOS=hn;exports.isInvariantQuality=ze;exports.isLower=He;exports.isLowerOrEqual=Pn;exports.isMacLike=pn;exports.isNonNullable=tt;exports.isNullable=nt;exports.loadVKLangPack=mc;exports.map=it;exports.mapTo=ea;exports.merge=Mn;exports.noop=G;exports.now=fn;exports.observableFrom=Gn;exports.once=ra;exports.pairwise=ta;exports.safeStorage=Sn;exports.tap=aa;exports.throttle=Yn;exports.timeout=Dn;exports.videoHeightToQuality=_n;exports.videoQualityToHeight=jn;exports.videoSizeToQuality=An;
|
package/es2018.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.31-dev.
|
|
3
|
-
* Fri, 27 Oct 2023 13:
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.31-dev.c49c485.0
|
|
3
|
+
* Fri, 27 Oct 2023 13:12:50 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-31/doc/
|
|
5
5
|
*/
|
|
6
|
-
const Yc="1.0.31-dev.88984b6.0";class dr{constructor(){this.subscriptions=[]}unsubscribe(){const e=this.subscriptions;this.subscriptions=[],e.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(e){return this.subscriptions.push(e),this}}const V=r=>{throw new Error(`${r} is value of unexpected type`)},zc=r=>{},Q=()=>{};class y{constructor(e){e&&(this._subscribe=e)}subscribe(e,t){var n;let a;t?typeof t=="function"?a={next:t,error:Q}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:Q,error:Q};const o=typeof e=="function"?{next:s=>{try{e(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>e.next(s),error:s=>e.error?e.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new dr().add(()=>{switch(o.next=Q,o.error=Q,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return V(i)}})}pipe(...e){return e.reduce((t,n)=>n(t),this)}_subscribe(e){}}class at extends y{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,e)})}_subscribe(e){const t=this.keyCounter++;return this.subscribers.set(t,e),new dr().add(()=>this.subscribers.delete(t))}}class Qc{constructor(){this.log$=new at,this.logs=[],this.log=e=>{const t={...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(a){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>({component:e,...t}))}}function Wc(r,e='Assertion "value is not nullable" failed'){if(r==null)throw new Error(e)}function Hc(r,e='Assertion "value is nullable" failed'){if(r!=null)throw new Error(e)}function cn(r){return typeof r!="undefined"&&r!==null}function ln(r){return r==null}const Xc=(r,e,t)=>new Promise((n,a)=>{e.addEventListener("abort",()=>{s(),c.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),c.removeEventListener("load",i),c.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",o),c.src=r,document.head.appendChild(c)});var br;const Jc=typeof((br=window.performance)===null||br===void 0?void 0:br.now)=="function"?()=>window.performance.now():()=>Date.now(),Zc=(r,e)=>async(...t)=>{var n;const a=e(...t);let o=r.aborted,i;for(;!o&&!r.aborted;){const s=await a.next(i);o=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i};var _;(function(r){r.Unknown="Unknown",r.Yandex="Yandex",r.Chrome="Chrome",r.Chromium="Chromium",r.Firefox="Firefox",r.Safari="Safari",r.Opera="Opera",r.Edge="Edge",r.Rest="Rest"})(_||(_={}));var p;(function(r){r.Unknown="Unknown",r.Android="Android",r.iPhone="iPhone",r.iPad="iPad",r.iPod="iPod",r.RestMobile="RestMobile",r.Mac="Mac",r.Desktop="Desktop"})(p||(p={}));const ot=()=>{const{userAgent:r}=window.navigator,e=/yabrowser/i.test(r)?_.Yandex:void 0,t=/chrome|crios/i.test(r)?_.Chrome:void 0,n=/chromium/i.test(r)?_.Chromium:void 0,a=/firefox|fxios/i.test(r)?_.Firefox:void 0,o=/webkit|safari|khtml/i.test(r)?_.Safari:void 0,i=/opr\//i.test(r)?_.Opera:void 0,s=/edg/i.test(r)?_.Edge:void 0,v=/android/i.test(r)?p.Android:void 0,c=/iphone/i.test(r)?p.iPhone:void 0,l=/ipad/i.test(r)?p.iPad:void 0,f=/ipod/i.test(r)?p.iPod:void 0,u=/mac/i.test(r)?p.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(r)?p.RestMobile:void 0;return{browser:e||a||i||s||t||n||o||_.Rest,device:v||c||l||f||d||u||p.Desktop}},rl=(r=!1)=>{const t=[p.iPhone,p.iPad,p.iPod].includes(ot().device);if(!r)return t;const{userAgent:n,maxTouchPoints:a}=window.navigator;return!!(t||/macintosh/i.test(n)&&a>0)},el=()=>{const{userAgent:r}=window.navigator,e=r.match(/Version\/(\d+(\.\d+)?)/i);if(!e)return null;const t=e[1],n=parseFloat(t);return isNaN(n)?null:n},tl=()=>[p.Mac,p.iPhone,p.iPad,p.iPod].includes(ot().device),nl=(r,{start:e=0,factor:t=2,max:n=1/0,min:a=e,random:o=0}={})=>{let i=e;return i*=t**r,i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),i};var h;(function(r){r[r.LOCAL_STORAGE=0]="LOCAL_STORAGE",r[r.SESSION_STORAGE=1]="SESSION_STORAGE",r[r.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,M;const yr=`vk-videoplayer-dummy-key-${Math.random()}`,B=()=>{if(M!==void 0)return M;try{localStorage.setItem(yr,"test"),localStorage.removeItem(yr),M=h.LOCAL_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)try{sessionStorage.getItem(yr),M=h.SESSION_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)M=h.RUNTIME;else throw e}else throw r}return M===h.RUNTIME&&(b=new Map),M},un=()=>B()===h.LOCAL_STORAGE,vn=r=>{var e,t;const n=B();switch(n){case h.LOCAL_STORAGE:return(e=localStorage.getItem(r))!==null&&e!==void 0?e:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(r))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(r);default:V(n)}},fn=(r,e)=>{const t=B();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(r,e));default:V(t)}},dn=r=>{var e;const t=B();switch(t){case h.LOCAL_STORAGE:return r in localStorage;case h.SESSION_STORAGE:return r in sessionStorage;case h.RUNTIME:return(e=b==null?void 0:b.has(r))!==null&&e!==void 0?e:!1;default:return V(t),!1}},hn=r=>{const e=B();switch(e){case h.LOCAL_STORAGE:return localStorage.removeItem(r);case h.SESSION_STORAGE:return sessionStorage.removeItem(r);case h.RUNTIME:return void(b==null?void 0:b.delete(r));default:V(e)}},pn=()=>{const r=B();switch(r){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:V(r)}};var al=Object.freeze({__proto__:null,clear:pn,get:vn,has:dn,isPersistent:un,remove:hn,set:fn}),w;(function(r){r.INVARIANT="Invariant quality",r.Q_144P="144p",r.Q_240P="240p",r.Q_360P="360p",r.Q_480P="480p",r.Q_720P="720p",r.Q_1080P="1080p",r.Q_1440P="1440p",r.Q_2160P="2160p",r.Q_4320P="4320p"})(w||(w={}));const E={[w.Q_144P]:{width:256,height:144},[w.Q_240P]:{width:428,height:240},[w.Q_360P]:{width:640,height:360},[w.Q_480P]:{width:856,height:480},[w.Q_720P]:{width:1280,height:720},[w.Q_1080P]:{width:1920,height:1080},[w.Q_1440P]:{width:2560,height:1440},[w.Q_2160P]:{width:3840,height:2160},[w.Q_4320P]:{width:7680,height:4320}},ol=(r,e)=>E[r].height>E[e].height,il=(r,e)=>E[r].height>=E[e].height,it=(r,e)=>E[r].height<E[e].height,sl=(r,e)=>E[r].height<=E[e].height,cl=r=>r.sort((e,t)=>e===t?0:e===w.INVARIANT?1:t===w.INVARIANT?-1:it(e,t)?1:-1)[0],st=Object.keys(E).sort((r,e)=>it(r,e)?-1:1),ll=(r,e=.02)=>[...st].find(n=>E[n].height*(1+e)>=r),ul=({width:r,height:e})=>{const t=Math.min(r,e),n=Math.max(r,e);return st.find(a=>{const o=E[a];return o.width>=n&&o.height>=t})},vl=r=>E[r].height,ct=r=>r===w.INVARIANT,fl=r=>r.every(e=>!ct(e));function dl(r){if(ct(r))throw new Error("Expected exact quality")}const bn=(r,e)=>{const t={};for(const n of Object.keys(e)){const a=e[n],o=r[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=bn(o,a):t[n]=n in r?o:a}return t};class hl extends at{constructor(e){super(),this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){const t=super._subscribe(e);return e.next(this.value),t}}function pl(r){return new y(e=>{const t={};let n=Object.keys(r).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&e.next(t)};return Object.entries(r).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new dr)})}function bl(...r){return new y(e=>r.reduce((t,n)=>t.add(n.subscribe(e)),new dr))}var yl=r=>new y(e=>{const t=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},r);return()=>window.clearTimeout(t)}),gl=r=>new y(e=>{const t=window.setInterval(()=>e.next(),r);return()=>window.clearInterval(t)}),Ol=r=>new y(e=>{r.forEach(t=>e.next(t))}),$l=(r,e)=>new y(t=>{const n=a=>t.next(a);return r.addEventListener(e,n),()=>r.removeEventListener(e,n)});function ml(r){return e=>new y(t=>e.subscribe(new yn(t,r)))}class yn{constructor(e,t){this.destination=e,this.size=t,this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const gn={leading:!1,trailing:!0};function wl(r,e=gn){return t=>new y(n=>t.subscribe(new On(n,r,e)))}class On{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,cn(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const $n={leading:!0,trailing:!1};function Sl(r,e=$n){return t=>new y(n=>t.subscribe(new mn(n,r,e)))}class mn{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,ln(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function El(r){return e=>new y(t=>e.subscribe(new wn(t,r)))}class wn{constructor(e,t){this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Tl(r=(e,t)=>e===t){return e=>new y(t=>e.subscribe(new Sn(t,r)))}const ce={};class Sn{constructor(e,t){this.destination=e,this.predicate=t,this.lastValue=ce}next(e){let t;try{t=this.lastValue===ce||!this.predicate(this.lastValue,e),this.lastValue=e}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function En(r){return e=>new y(t=>e.subscribe(new Tn(t,r)))}let Tn=class{constructor(e,t){this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(t)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}};function Pl(r){return En(()=>r)}function Rl(){return r=>new y(e=>{let t=!1,n=!1;const a=r.subscribe(o=>{t||(t=!0,e.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=e.error)===null||i===void 0||i.call(e,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function _l(){return r=>new y(e=>r.subscribe(new In(e)))}class In{constructor(e){this.destination=e,this.hasLast=!1}next(e){const t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Al(r){return e=>new y(t=>e.subscribe(new Pn(t,r)))}class Pn{constructor(e,t){this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(t){throw this.error(t),t}this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}var le;(function(r){r.NETWORK="network",r.VIDEO_PIPELINE="video_pipeline",r.EXTERNAL_API="external_api",r.PARSER="parser",r.DOM="dom",r.WTF="wtf"})(le||(le={}));class ue{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;const n=this.listeners[e];for(let a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;const n=this.listeners[e.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];try{i.callback.call(this,e)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(e.type,i.callback)}return!e.defaultPrevented}}class lt extends ue{constructor(){super(),this.listeners||ue.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)}}class Rn{constructor(){Object.defineProperty(this,"signal",{value:new lt,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(a){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=e;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(a){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(Rn.prototype[Symbol.toStringTag]="AbortController",lt.prototype[Symbol.toStringTag]="AbortSignal");function ut(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function _n(r){typeof r=="function"&&(r={fetch:r});const{fetch:e,Request:t=e.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a=!1}=r;if(!ut({fetch:e,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:e,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=function(c,l){let f;l&&l.signal&&(f=l.signal,delete l.signal);const u=new t(c,l);return f&&Object.defineProperty(u,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),u},o.prototype=t.prototype);const i=e;return{fetch:(v,c)=>{const l=o&&o.prototype.isPrototypeOf(v)?v.signal:c?c.signal:void 0;if(l){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(l.aborted)return Promise.reject(f);const u=new Promise((d,$)=>{l.addEventListener("abort",()=>$(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([u,i(v,c)])}return i(v,c)},Request:o}}const Wr=ut({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),vt=Wr?_n({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,An=Wr?vt.fetch:window.fetch;Wr?vt.Request:window.Request;var gr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function jn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var j=function(r){try{return!!r()}catch(e){return!0}},Ln=j,hr=!Ln(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),ft=hr,dt=Function.prototype,kr=dt.call,xn=ft&&dt.bind.bind(kr,kr),N=ft?xn:function(r){return function(){return kr.apply(r,arguments)}},ht=N,Mn=ht({}.toString),Nn=ht("".slice),Hr=function(r){return Nn(Mn(r),8,-1)},Cn=N,Fn=j,Gn=Hr,Or=Object,Dn=Cn("".split),kn=Fn(function(){return!Or("z").propertyIsEnumerable(0)})?function(r){return Gn(r)=="String"?Dn(r,""):Or(r)}:Or,Xr=function(r){return r==null},Un=Xr,Vn=TypeError,pt=function(r){if(Un(r))throw Vn("Can't call method on "+r);return r},Bn=kn,Kn=pt,H=function(r){return Bn(Kn(r))},K={},Z=function(r){return r&&r.Math==Math&&r},I=Z(typeof globalThis=="object"&&globalThis)||Z(typeof window=="object"&&window)||Z(typeof self=="object"&&self)||Z(typeof gr=="object"&&gr)||function(){return this}()||gr||Function("return this")(),Ur=typeof document=="object"&&document.all,qn=typeof Ur=="undefined"&&Ur!==void 0,bt={all:Ur,IS_HTMLDDA:qn},yt=bt,Yn=yt.all,P=yt.IS_HTMLDDA?function(r){return typeof r=="function"||r===Yn}:function(r){return typeof r=="function"},zn=I,Qn=P,ve=zn.WeakMap,Wn=Qn(ve)&&/native code/.test(String(ve)),fe=P,gt=bt,Hn=gt.all,q=gt.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:fe(r)||r===Hn}:function(r){return typeof r=="object"?r!==null:fe(r)},Xn=j,C=!Xn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Jn=I,de=q,Vr=Jn.document,Zn=de(Vr)&&de(Vr.createElement),Ot=function(r){return Zn?Vr.createElement(r):{}},ra=C,ea=j,ta=Ot,$t=!ra&&!ea(function(){return Object.defineProperty(ta("div"),"a",{get:function(){return 7}}).a!=7}),na=C,aa=j,mt=na&&aa(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),oa=q,ia=String,sa=TypeError,z=function(r){if(oa(r))return r;throw sa(ia(r)+" is not an object")},ca=hr,rr=Function.prototype.call,F=ca?rr.bind(rr):function(){return rr.apply(rr,arguments)},Jr={},$r=Jr,mr=I,la=P,he=function(r){return la(r)?r:void 0},wt=function(r,e){return arguments.length<2?he($r[r])||he(mr[r]):$r[r]&&$r[r][e]||mr[r]&&mr[r][e]},ua=N,St=ua({}.isPrototypeOf),va=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Et=I,wr=va,pe=Et.process,be=Et.Deno,ye=pe&&pe.versions||be&&be.version,ge=ye&&ye.v8,T,ur;ge&&(T=ge.split("."),ur=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!ur&&wr&&(T=wr.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=wr.match(/Chrome\/(\d+)/),T&&(ur=+T[1])));var fa=ur,Oe=fa,da=j,ha=I,pa=ha.String,Tt=!!Object.getOwnPropertySymbols&&!da(function(){var r=Symbol();return!pa(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Oe&&Oe<41}),ba=Tt,It=ba&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ya=wt,ga=P,Oa=St,$a=It,ma=Object,Pt=$a?function(r){return typeof r=="symbol"}:function(r){var e=ya("Symbol");return ga(e)&&Oa(e.prototype,ma(r))},wa=String,Zr=function(r){try{return wa(r)}catch(e){return"Object"}},Sa=P,Ea=Zr,Ta=TypeError,re=function(r){if(Sa(r))return r;throw Ta(Ea(r)+" is not a function")},Ia=re,Pa=Xr,ee=function(r,e){var t=r[e];return Pa(t)?void 0:Ia(t)},Sr=F,Er=P,Tr=q,Ra=TypeError,_a=function(r,e){var t,n;if(e==="string"&&Er(t=r.toString)&&!Tr(n=Sr(t,r))||Er(t=r.valueOf)&&!Tr(n=Sr(t,r))||e!=="string"&&Er(t=r.toString)&&!Tr(n=Sr(t,r)))return n;throw Ra("Can't convert object to primitive value")},Rt={exports:{}},$e=I,Aa=Object.defineProperty,ja=function(r,e){try{Aa($e,r,{value:e,configurable:!0,writable:!0})}catch(t){$e[r]=e}return e},La=I,xa=ja,me="__core-js_shared__",Ma=La[me]||xa(me,{}),_t=Ma,we=_t;(Rt.exports=function(r,e){return we[r]||(we[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var At=Rt.exports,Na=pt,Ca=Object,jt=function(r){return Ca(Na(r))},Fa=N,Ga=jt,Da=Fa({}.hasOwnProperty),x=Object.hasOwn||function(e,t){return Da(Ga(e),t)},ka=N,Ua=0,Va=Math.random(),Ba=ka(1 .toString),Lt=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Ba(++Ua+Va,36)},Ka=I,qa=At,Se=x,Ya=Lt,za=Tt,Qa=It,U=Ka.Symbol,Ir=qa("wks"),Wa=Qa?U.for||U:U&&U.withoutSetter||Ya,L=function(r){return Se(Ir,r)||(Ir[r]=za&&Se(U,r)?U[r]:Wa("Symbol."+r)),Ir[r]},Ha=F,Ee=q,Te=Pt,Xa=ee,Ja=_a,Za=L,ro=TypeError,eo=Za("toPrimitive"),to=function(r,e){if(!Ee(r)||Te(r))return r;var t=Xa(r,eo),n;if(t){if(e===void 0&&(e="default"),n=Ha(t,r,e),!Ee(n)||Te(n))return n;throw ro("Can't convert object to primitive value")}return e===void 0&&(e="number"),Ja(r,e)},no=to,ao=Pt,te=function(r){var e=no(r,"string");return ao(e)?e:e+""},oo=C,io=$t,so=mt,er=z,Ie=te,co=TypeError,Pr=Object.defineProperty,lo=Object.getOwnPropertyDescriptor,Rr="enumerable",_r="configurable",Ar="writable";Y.f=oo?so?function(e,t,n){if(er(e),t=Ie(t),er(n),typeof e=="function"&&t==="prototype"&&"value"in n&&Ar in n&&!n[Ar]){var a=lo(e,t);a&&a[Ar]&&(e[t]=n.value,n={configurable:_r in n?n[_r]:a[_r],enumerable:Rr in n?n[Rr]:a[Rr],writable:!1})}return Pr(e,t,n)}:Pr:function(e,t,n){if(er(e),t=Ie(t),er(n),io)try{return Pr(e,t,n)}catch(a){}if("get"in n||"set"in n)throw co("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var pr=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},uo=C,vo=Y,fo=pr,X=uo?function(r,e,t){return vo.f(r,e,fo(1,t))}:function(r,e,t){return r[e]=t,r},ho=At,po=Lt,Pe=ho("keys"),ne=function(r){return Pe[r]||(Pe[r]=po(r))},ae={},bo=Wn,xt=I,yo=q,go=X,jr=x,Lr=_t,Oo=ne,$o=ae,Re="Object already initialized",Br=xt.TypeError,mo=xt.WeakMap,vr,W,fr,wo=function(r){return fr(r)?W(r):vr(r,{})},So=function(r){return function(e){var t;if(!yo(e)||(t=W(e)).type!==r)throw Br("Incompatible receiver, "+r+" required");return t}};if(bo||Lr.state){var R=Lr.state||(Lr.state=new mo);R.get=R.get,R.has=R.has,R.set=R.set,vr=function(r,e){if(R.has(r))throw Br(Re);return e.facade=r,R.set(r,e),e},W=function(r){return R.get(r)||{}},fr=function(r){return R.has(r)}}else{var G=Oo("state");$o[G]=!0,vr=function(r,e){if(jr(r,G))throw Br(Re);return e.facade=r,go(r,G,e),e},W=function(r){return jr(r,G)?r[G]:{}},fr=function(r){return jr(r,G)}}var Eo={set:vr,get:W,has:fr,enforce:wo,getterFor:So},To=hr,Mt=Function.prototype,_e=Mt.apply,Ae=Mt.call,Io=typeof Reflect=="object"&&Reflect.apply||(To?Ae.bind(_e):function(){return Ae.apply(_e,arguments)}),Po=Hr,Ro=N,Nt=function(r){if(Po(r)==="Function")return Ro(r)},Ct={},Ft={},Gt={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,_o=Dt&&!Gt.call({1:2},1);Ft.f=_o?function(e){var t=Dt(this,e);return!!t&&t.enumerable}:Gt;var Ao=C,jo=F,Lo=Ft,xo=pr,Mo=H,No=te,Co=x,Fo=$t,je=Object.getOwnPropertyDescriptor;Ct.f=Ao?je:function(e,t){if(e=Mo(e),t=No(t),Fo)try{return je(e,t)}catch(n){}if(Co(e,t))return xo(!jo(Lo.f,e,t),e[t])};var Go=j,Do=P,ko=/#|\.prototype\./,J=function(r,e){var t=Vo[Uo(r)];return t==Ko?!0:t==Bo?!1:Do(e)?Go(e):!!e},Uo=J.normalize=function(r){return String(r).replace(ko,".").toLowerCase()},Vo=J.data={},Bo=J.NATIVE="N",Ko=J.POLYFILL="P",qo=J,Le=Nt,Yo=re,zo=hr,Qo=Le(Le.bind),kt=function(r,e){return Yo(r),e===void 0?r:zo?Qo(r,e):function(){return r.apply(e,arguments)}},tr=I,Wo=Io,Ho=Nt,Xo=P,Jo=Ct.f,Zo=qo,D=Jr,ri=kt,k=X,xe=x,ei=function(r){var e=function(t,n,a){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,n)}return new r(t,n,a)}return Wo(r,this,arguments)};return e.prototype=r.prototype,e},Ut=function(r,e){var t=r.target,n=r.global,a=r.stat,o=r.proto,i=n?tr:a?tr[t]:(tr[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,c,l,f,u,d,$,S,m,g;for(u in e)c=Zo(n?u:t+(a?".":"#")+u,r.forced),l=!c&&i&&xe(i,u),$=s[u],l&&(r.dontCallGetSet?(g=Jo(i,u),S=g&&g.value):S=i[u]),d=l&&S?S:e[u],!(l&&typeof $==typeof d)&&(r.bind&&l?m=ri(d,tr):r.wrap&&l?m=ei(d):o&&Xo(d)?m=Ho(d):m=d,(r.sham||d&&d.sham||$&&$.sham)&&k(m,"sham",!0),k(s,u,m),o&&(f=t+"Prototype",xe(D,f)||k(D,f,{}),k(D[f],u,d),r.real&&v&&(c||!v[u])&&k(v,u,d)))},Kr=C,ti=x,Vt=Function.prototype,ni=Kr&&Object.getOwnPropertyDescriptor,oe=ti(Vt,"name"),ai=oe&&function(){}.name==="something",oi=oe&&(!Kr||Kr&&ni(Vt,"name").configurable),ii={EXISTS:oe,PROPER:ai,CONFIGURABLE:oi},Bt={},si=Math.ceil,ci=Math.floor,li=Math.trunc||function(e){var t=+e;return(t>0?ci:si)(t)},ui=li,Kt=function(r){var e=+r;return e!==e||e===0?0:ui(e)},vi=Kt,fi=Math.max,di=Math.min,hi=function(r,e){var t=vi(r);return t<0?fi(t+e,0):di(t,e)},pi=Kt,bi=Math.min,yi=function(r){return r>0?bi(pi(r),9007199254740991):0},gi=yi,qt=function(r){return gi(r.length)},Oi=H,$i=hi,mi=qt,Me=function(r){return function(e,t,n){var a=Oi(e),o=mi(a),i=$i(n,o),s;if(r&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((r||i in a)&&a[i]===t)return r||i||0;return!r&&-1}},wi={includes:Me(!0),indexOf:Me(!1)},Si=N,xr=x,Ei=H,Ti=wi.indexOf,Ii=ae,Ne=Si([].push),Pi=function(r,e){var t=Ei(r),n=0,a=[],o;for(o in t)!xr(Ii,o)&&xr(t,o)&&Ne(a,o);for(;e.length>n;)xr(t,o=e[n++])&&(~Ti(a,o)||Ne(a,o));return a},Yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ri=Pi,_i=Yt,Ai=Object.keys||function(e){return Ri(e,_i)},ji=C,Li=mt,xi=Y,Mi=z,Ni=H,Ci=Ai;Bt.f=ji&&!Li?Object.defineProperties:function(e,t){Mi(e);for(var n=Ni(t),a=Ci(t),o=a.length,i=0,s;o>i;)xi.f(e,s=a[i++],n[s]);return e};var Fi=wt,Gi=Fi("document","documentElement"),Di=z,ki=Bt,Ce=Yt,Ui=ae,Vi=Gi,Bi=Ot,Ki=ne,Fe=">",Ge="<",qr="prototype",Yr="script",zt=Ki("IE_PROTO"),Mr=function(){},Qt=function(r){return Ge+Yr+Fe+r+Ge+"/"+Yr+Fe},De=function(r){r.write(Qt("")),r.close();var e=r.parentWindow.Object;return r=null,e},qi=function(){var r=Bi("iframe"),e="java"+Yr+":",t;return r.style.display="none",Vi.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Qt("document.F=Object")),t.close(),t.F},nr,sr=function(){try{nr=new ActiveXObject("htmlfile")}catch(e){}sr=typeof document!="undefined"?document.domain&&nr?De(nr):qi():De(nr);for(var r=Ce.length;r--;)delete sr[qr][Ce[r]];return sr()};Ui[zt]=!0;var Wt=Object.create||function(e,t){var n;return e!==null?(Mr[qr]=Di(e),n=new Mr,Mr[qr]=null,n[zt]=e):n=sr(),t===void 0?n:ki.f(n,t)},Yi=j,zi=!Yi(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),Qi=x,Wi=P,Hi=jt,Xi=ne,Ji=zi,ke=Xi("IE_PROTO"),zr=Object,Zi=zr.prototype,Ht=Ji?zr.getPrototypeOf:function(r){var e=Hi(r);if(Qi(e,ke))return e[ke];var t=e.constructor;return Wi(t)&&e instanceof t?t.prototype:e instanceof zr?Zi:null},rs=X,Xt=function(r,e,t,n){return n&&n.enumerable?r[e]=t:rs(r,e,t),r},es=j,ts=P,ns=q,as=Wt,Ue=Ht,os=Xt,is=L,Qr=is("iterator"),Jt=!1,A,Nr,Cr;[].keys&&(Cr=[].keys(),"next"in Cr?(Nr=Ue(Ue(Cr)),Nr!==Object.prototype&&(A=Nr)):Jt=!0);var ss=!ns(A)||es(function(){var r={};return A[Qr].call(r)!==r});ss?A={}:A=as(A);ts(A[Qr])||os(A,Qr,function(){return this});var Zt={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:Jt},cs=L,ls=cs("toStringTag"),rn={};rn[ls]="z";var ie=String(rn)==="[object z]",us=ie,vs=P,cr=Hr,fs=L,ds=fs("toStringTag"),hs=Object,ps=cr(function(){return arguments}())=="Arguments",bs=function(r,e){try{return r[e]}catch(t){}},se=us?cr:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=bs(e=hs(r),ds))=="string"?t:ps?cr(e):(n=cr(e))=="Object"&&vs(e.callee)?"Arguments":n},ys=ie,gs=se,Os=ys?{}.toString:function(){return"[object "+gs(this)+"]"},$s=ie,ms=Y.f,ws=X,Ss=x,Es=Os,Ts=L,Ve=Ts("toStringTag"),en=function(r,e,t,n){if(r){var a=t?r:r.prototype;Ss(a,Ve)||ms(a,Ve,{configurable:!0,value:e}),n&&!$s&&ws(a,"toString",Es)}},Is=Zt.IteratorPrototype,Ps=Wt,Rs=pr,_s=en,As=K,js=function(){return this},Ls=function(r,e,t,n){var a=e+" Iterator";return r.prototype=Ps(Is,{next:Rs(+!n,t)}),_s(r,a,!1,!0),As[a]=js,r},xs=Ut,Ms=F,tn=ii,Ns=Ls,Cs=Ht,Fs=en,Be=Xt,Gs=L,Ke=K,nn=Zt,Ds=tn.PROPER;tn.CONFIGURABLE;nn.IteratorPrototype;var ar=nn.BUGGY_SAFARI_ITERATORS,Fr=Gs("iterator"),qe="keys",or="values",Ye="entries",ks=function(){return this},Us=function(r,e,t,n,a,o,i){Ns(t,e,n);var s=function(g){if(g===a&&u)return u;if(!ar&&g in l)return l[g];switch(g){case qe:return function(){return new t(this,g)};case or:return function(){return new t(this,g)};case Ye:return function(){return new t(this,g)}}return function(){return new t(this)}},v=e+" Iterator",c=!1,l=r.prototype,f=l[Fr]||l["@@iterator"]||a&&l[a],u=!ar&&f||s(a),d=e=="Array"&&l.entries||f,$,S,m;if(d&&($=Cs(d.call(new r)),$!==Object.prototype&&$.next&&(Fs($,v,!0,!0),Ke[v]=ks)),Ds&&a==or&&f&&f.name!==or&&(c=!0,u=function(){return Ms(f,this)}),a)if(S={values:s(or),keys:o?u:s(qe),entries:s(Ye)},i)for(m in S)(ar||c||!(m in l))&&Be(l,m,S[m]);else xs({target:e,proto:!0,forced:ar||c},S);return i&&l[Fr]!==u&&Be(l,Fr,u,{name:a}),Ke[e]=u,S},Vs=function(r,e){return{value:r,done:e}},Bs=H,ze=K,an=Eo;Y.f;var Ks=Us,ir=Vs,on="Array Iterator",qs=an.set,Ys=an.getterFor(on);Ks(Array,"Array",function(r,e){qs(this,{type:on,target:Bs(r),index:0,kind:e})},function(){var r=Ys(this),e=r.target,t=r.kind,n=r.index++;return!e||n>=e.length?(r.target=void 0,ir(void 0,!0)):t=="keys"?ir(n,!1):t=="values"?ir(e[n],!1):ir([n,e[n]],!1)},"values");ze.Arguments=ze.Array;var zs=L,Qs=K,Ws=zs("iterator"),Hs=Array.prototype,Xs=function(r){return r!==void 0&&(Qs.Array===r||Hs[Ws]===r)},Js=se,Qe=ee,Zs=Xr,rc=K,ec=L,tc=ec("iterator"),sn=function(r){if(!Zs(r))return Qe(r,tc)||Qe(r,"@@iterator")||rc[Js(r)]},nc=F,ac=re,oc=z,ic=Zr,sc=sn,cc=TypeError,lc=function(r,e){var t=arguments.length<2?sc(r):e;if(ac(t))return oc(nc(t,r));throw cc(ic(r)+" is not iterable")},uc=F,We=z,vc=ee,fc=function(r,e,t){var n,a;We(r);try{if(n=vc(r,"return"),!n){if(e==="throw")throw t;return t}n=uc(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return We(n),t},dc=kt,hc=F,pc=z,bc=Zr,yc=Xs,gc=qt,He=St,Oc=lc,$c=sn,Xe=fc,mc=TypeError,lr=function(r,e){this.stopped=r,this.result=e},Je=lr.prototype,wc=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=dc(e,n),c,l,f,u,d,$,S,m=function(O){return c&&Xe(c,"normal",O),new lr(!0,O)},g=function(O){return a?(pc(O),s?v(O[0],O[1],m):v(O[0],O[1])):s?v(O,m):v(O)};if(o)c=r.iterator;else if(i)c=r;else{if(l=$c(r),!l)throw mc(bc(r)+" is not iterable");if(yc(l)){for(f=0,u=gc(r);u>f;f++)if(d=g(r[f]),d&&He(Je,d))return d;return new lr(!1)}c=Oc(r,l)}for($=o?r.next:c.next;!(S=hc($,c)).done;){try{d=g(S.value)}catch(O){Xe(c,"throw",O)}if(typeof d=="object"&&d&&He(Je,d))return d}return new lr(!1)},Sc=te,Ec=Y,Tc=pr,Ic=function(r,e,t){var n=Sc(e);n in r?Ec.f(r,n,Tc(0,t)):r[n]=t},Pc=Ut,Rc=wc,_c=Ic;Pc({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Rc(e,function(n,a){_c(t,n,a)},{AS_ENTRIES:!0}),t}});var Ac=Jr,jc=Ac.Object.fromEntries,Lc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},xc=Lc,Mc=I,Nc=se,Cc=X,Ze=K,Fc=L,rt=Fc("toStringTag");for(var Gr in xc){var et=Mc[Gr],Dr=et&&et.prototype;Dr&&Nc(Dr)!==rt&&Cc(Dr,rt,Gr),Ze[Gr]=Ze.Array}var Gc=jc,Dc=Gc,kc=Dc,Uc=kc,Vc=jn(Uc),tt;(function(r){r.Armenian="58",r.Azerbaijani="57",r.Belarusian="114",r.English="3",r.Kazakh="97",r.Portuguese="73",r.Russian="0",r.Spanish="4",r.Ukrainian="1",r.Uzbek="65",r.Vietnamese="75"})(tt||(tt={}));const Bc="vk.com",jl=async(r,e,t)=>{const n=new URL(`https://${Bc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),r!==void 0&&n.searchParams.set("lang",r);const o=await(await An(n.toString())).json();return Kc(o,t)},Kc=(r,e)=>Vc(Object.entries(r.keys).map(([t,n])=>[t.substring(`${e}_`.length),qc(n)])),qc=r=>Array.isArray(r)?r[0]:r;var nt;(function(r){r.RU="ru",r.EN="en"})(nt||(nt={}));export{_ as CurrentClientBrowser,p as CurrentClientDevice,le as ErrorCategory,nt as InterfaceLanguage,Qc as Logger,y as Observable,at as Subject,dr as Subscription,Yc as VERSION,tt as VKNumericLanguage,hl as ValueSubject,w as VideoQuality,Zc as abortable,Xc as addScript,fl as areQualitiesExact,V as assertNever,Wc as assertNonNullable,Hc as assertNullable,dl as assertQualityIsExact,ml as buffer,zc as checkNever,pl as combine,wl as debounce,bn as fillWithDefault,El as filter,Tl as filterChanged,$l as fromEvent,ot as getCurrentBrowser,nl as getExponentialDelay,cl as getHighestQuality,el as getIOSVersion,gl as interval,ol as isHigher,il as isHigherOrEqual,rl as isIOS,ct as isInvariantQuality,it as isLower,sl as isLowerOrEqual,tl as isMacLike,cn as isNonNullable,ln as isNullable,jl as loadVKLangPack,En as map,Pl as mapTo,bl as merge,Q as noop,Jc as now,Ol as observableFrom,Rl as once,_l as pairwise,al as safeStorage,Al as tap,Sl as throttle,yl as timeout,ll as videoHeightToQuality,vl as videoQualityToHeight,ul as videoSizeToQuality};
|
|
6
|
+
const Yc="1.0.31-dev.c49c485.0";class dr{constructor(){this.subscriptions=[]}unsubscribe(){const e=this.subscriptions;this.subscriptions=[],e.forEach(t=>typeof t=="function"?t():t.unsubscribe())}add(e){return this.subscriptions.push(e),this}}const V=r=>{throw new Error(`${r} is value of unexpected type`)},zc=r=>{},Q=()=>{};class y{constructor(e){e&&(this._subscribe=e)}subscribe(e,t){var n;let a;t?typeof t=="function"?a={next:t,error:Q}:a={next:s=>t.next(s),error:s=>{var v;return(v=t.error)===null||v===void 0?void 0:v.call(t,s)}}:a={next:Q,error:Q};const o=typeof e=="function"?{next:s=>{try{e(s)}catch(v){a.next(v)}},error:s=>a.next(s)}:{next:s=>e.next(s),error:s=>e.error?e.error(s):a.next(s)};let i;try{i=this._subscribe(o)}catch(s){(n=o.error)===null||n===void 0||n.call(o,s)}return new dr().add(()=>{switch(o.next=Q,o.error=Q,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return V(i)}})}pipe(...e){return e.reduce((t,n)=>n(t),this)}_subscribe(e){}}class at extends y{constructor(){super(),this.keyCounter=0,this.subscribers=new Map}next(e){this.subscribers.forEach(t=>t.next(e))}error(e){this.subscribers.forEach(t=>{var n;return(n=t.error)===null||n===void 0?void 0:n.call(t,e)})}_subscribe(e){const t=this.keyCounter++;return this.subscribers.set(t,e),new dr().add(()=>this.subscribers.delete(t))}}class Qc{constructor(){this.log$=new at,this.logs=[],this.log=e=>{const t={...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(a){n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(t=>({component:e,...t}))}}function Wc(r,e='Assertion "value is not nullable" failed'){if(r==null)throw new Error(e)}function Hc(r,e='Assertion "value is nullable" failed'){if(r!=null)throw new Error(e)}function cn(r){return typeof r!="undefined"&&r!==null}function ln(r){return r==null}const Xc=(r,e,t)=>new Promise((n,a)=>{e.addEventListener("abort",()=>{s(),c.remove()});const o=()=>{s(),a()},i=()=>{s(),n()},s=()=>{v&&clearTimeout(v),c.removeEventListener("load",i),c.removeEventListener("error",o)};let v;t&&(v=window.setTimeout(o,t));const c=document.createElement("script");c.addEventListener("load",i),c.addEventListener("error",o),c.src=r,document.head.appendChild(c)});var br;const Jc=typeof((br=window.performance)===null||br===void 0?void 0:br.now)=="function"?()=>window.performance.now():()=>Date.now(),Zc=(r,e)=>async(...t)=>{var n;const a=e(...t);let o=r.aborted,i;for(;!o&&!r.aborted;){const s=await a.next(i);o=(n=s.done)!==null&&n!==void 0?n:!1,i=s.value}return i};var _;(function(r){r.Unknown="Unknown",r.Yandex="Yandex",r.Chrome="Chrome",r.Chromium="Chromium",r.Firefox="Firefox",r.Safari="Safari",r.Opera="Opera",r.Edge="Edge",r.Rest="Rest"})(_||(_={}));var p;(function(r){r.Unknown="Unknown",r.Android="Android",r.iPhone="iPhone",r.iPad="iPad",r.iPod="iPod",r.RestMobile="RestMobile",r.Mac="Mac",r.Desktop="Desktop"})(p||(p={}));const ot=()=>{const{userAgent:r}=window.navigator,e=/yabrowser/i.test(r)?_.Yandex:void 0,t=/chrome|crios/i.test(r)?_.Chrome:void 0,n=/chromium/i.test(r)?_.Chromium:void 0,a=/firefox|fxios/i.test(r)?_.Firefox:void 0,o=/webkit|safari|khtml/i.test(r)?_.Safari:void 0,i=/opr\//i.test(r)?_.Opera:void 0,s=/edg/i.test(r)?_.Edge:void 0,v=/android/i.test(r)?p.Android:void 0,c=/iphone/i.test(r)?p.iPhone:void 0,l=/ipad/i.test(r)?p.iPad:void 0,f=/ipod/i.test(r)?p.iPod:void 0,u=/mac/i.test(r)?p.Mac:void 0,d=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(r)?p.RestMobile:void 0;return{browser:e||a||i||s||t||n||o||_.Rest,device:v||c||l||f||d||u||p.Desktop}},rl=(r=!1)=>{const t=[p.iPhone,p.iPad,p.iPod].includes(ot().device);if(!r)return t;const{userAgent:n,maxTouchPoints:a}=window.navigator;return!!(t||/macintosh/i.test(n)&&a>0)},el=()=>{const{userAgent:r}=window.navigator,e=r.match(/Version\/(\d+(\.\d+)?)/i);if(!e)return null;const t=e[1],n=parseFloat(t);return isNaN(n)?null:n},tl=()=>[p.Mac,p.iPhone,p.iPad,p.iPod].includes(ot().device),nl=(r,{start:e=0,factor:t=2,max:n=1/0,min:a=e,random:o=0}={})=>{let i=e;return i*=t**r,i*=1+(Math.random()*o*2-o),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,a),i};var h;(function(r){r[r.LOCAL_STORAGE=0]="LOCAL_STORAGE",r[r.SESSION_STORAGE=1]="SESSION_STORAGE",r[r.RUNTIME=2]="RUNTIME"})(h||(h={}));let b,M;const yr=`vk-videoplayer-dummy-key-${Math.random()}`,B=()=>{if(M!==void 0)return M;try{localStorage.setItem(yr,"test"),localStorage.removeItem(yr),M=h.LOCAL_STORAGE}catch(r){if(r instanceof DOMException||r instanceof TypeError)try{sessionStorage.getItem(yr),M=h.SESSION_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)M=h.RUNTIME;else throw e}else throw r}return M===h.RUNTIME&&(b=new Map),M},un=()=>B()===h.LOCAL_STORAGE,vn=r=>{var e,t;const n=B();switch(n){case h.LOCAL_STORAGE:return(e=localStorage.getItem(r))!==null&&e!==void 0?e:void 0;case h.SESSION_STORAGE:return(t=sessionStorage.getItem(r))!==null&&t!==void 0?t:void 0;case h.RUNTIME:return b==null?void 0:b.get(r);default:V(n)}},fn=(r,e)=>{const t=B();switch(t){case h.LOCAL_STORAGE:try{localStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.SESSION_STORAGE:try{sessionStorage.setItem(r,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case h.RUNTIME:return void(b==null?void 0:b.set(r,e));default:V(t)}},dn=r=>{var e;const t=B();switch(t){case h.LOCAL_STORAGE:return r in localStorage;case h.SESSION_STORAGE:return r in sessionStorage;case h.RUNTIME:return(e=b==null?void 0:b.has(r))!==null&&e!==void 0?e:!1;default:return V(t),!1}},hn=r=>{const e=B();switch(e){case h.LOCAL_STORAGE:return localStorage.removeItem(r);case h.SESSION_STORAGE:return sessionStorage.removeItem(r);case h.RUNTIME:return void(b==null?void 0:b.delete(r));default:V(e)}},pn=()=>{const r=B();switch(r){case h.LOCAL_STORAGE:return localStorage.clear();case h.SESSION_STORAGE:return sessionStorage.clear();case h.RUNTIME:return b==null?void 0:b.clear();default:V(r)}};var al=Object.freeze({__proto__:null,clear:pn,get:vn,has:dn,isPersistent:un,remove:hn,set:fn}),w;(function(r){r.INVARIANT="Invariant quality",r.Q_144P="144p",r.Q_240P="240p",r.Q_360P="360p",r.Q_480P="480p",r.Q_720P="720p",r.Q_1080P="1080p",r.Q_1440P="1440p",r.Q_2160P="2160p",r.Q_4320P="4320p"})(w||(w={}));const E={[w.Q_144P]:{width:256,height:144},[w.Q_240P]:{width:428,height:240},[w.Q_360P]:{width:640,height:360},[w.Q_480P]:{width:856,height:480},[w.Q_720P]:{width:1280,height:720},[w.Q_1080P]:{width:1920,height:1080},[w.Q_1440P]:{width:2560,height:1440},[w.Q_2160P]:{width:3840,height:2160},[w.Q_4320P]:{width:7680,height:4320}},ol=(r,e)=>E[r].height>E[e].height,il=(r,e)=>E[r].height>=E[e].height,it=(r,e)=>E[r].height<E[e].height,sl=(r,e)=>E[r].height<=E[e].height,cl=r=>r.sort((e,t)=>e===t?0:e===w.INVARIANT?1:t===w.INVARIANT?-1:it(e,t)?1:-1)[0],st=Object.keys(E).sort((r,e)=>it(r,e)?-1:1),ll=(r,e=.02)=>[...st].find(n=>E[n].height*(1+e)>=r),ul=({width:r,height:e})=>{const t=Math.min(r,e),n=Math.max(r,e);return st.find(a=>{const o=E[a];return o.width>=n&&o.height>=t})},vl=r=>E[r].height,ct=r=>r===w.INVARIANT,fl=r=>r.every(e=>!ct(e));function dl(r){if(ct(r))throw new Error("Expected exact quality")}const bn=(r,e)=>{const t={};for(const n of Object.keys(e)){const a=e[n],o=r[n];Array.isArray(a)&&Array.isArray(o)?t[n]=o:typeof a=="object"&&typeof o=="object"?t[n]=bn(o,a):t[n]=n in r?o:a}return t};class hl extends at{constructor(e){super(),this.value=e}next(e){super.next(this.value=e)}error(e){super.error(this.value=e)}getValue(){return this.value}_subscribe(e){const t=super._subscribe(e);return e.next(this.value),t}}function pl(r){return new y(e=>{const t={};let n=Object.keys(r).length;const a=o=>i=>{o in t||n--,t[o]=i,n===0&&e.next(t)};return Object.entries(r).reduce((o,[i,s])=>o.add(s.subscribe(a(i))),new dr)})}function bl(...r){return new y(e=>r.reduce((t,n)=>t.add(n.subscribe(e)),new dr))}var yl=r=>new y(e=>{const t=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},r);return()=>window.clearTimeout(t)}),gl=r=>new y(e=>{const t=window.setInterval(()=>e.next(),r);return()=>window.clearInterval(t)}),Ol=r=>new y(e=>{r.forEach(t=>e.next(t))}),$l=(r,e)=>new y(t=>{const n=a=>t.next(a);return r.addEventListener(e,n),()=>r.removeEventListener(e,n)});function ml(r){return e=>new y(t=>e.subscribe(new yn(t,r)))}class yn{constructor(e,t){this.destination=e,this.size=t,this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const gn={leading:!1,trailing:!0};function wl(r,e=gn){return t=>new y(n=>t.subscribe(new On(n,r,e)))}class On{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,cn(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(t){if(this.destination.error)this.destination.error(t);else throw t}this.timeout=void 0},this.time)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}const $n={leading:!0,trailing:!1};function Sl(r,e=$n){return t=>new y(n=>t.subscribe(new mn(n,r,e)))}class mn{constructor(e,t,n){this.destination=e,this.time=t,this.config=n}next(e){this.lastValue=e,ln(this.timeout)&&(this.config.leading&&this.destination.next(e),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function El(r){return e=>new y(t=>e.subscribe(new wn(t,r)))}class wn{constructor(e,t){this.destination=e,this.predicate=t}next(e){let t;try{t=this.predicate(e)}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Tl(r=(e,t)=>e===t){return e=>new y(t=>e.subscribe(new Sn(t,r)))}const ce={};class Sn{constructor(e,t){this.destination=e,this.predicate=t,this.lastValue=ce}next(e){let t;try{t=this.lastValue===ce||!this.predicate(this.lastValue,e),this.lastValue=e}catch(n){throw this.error(n),n}t&&this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function En(r){return e=>new y(t=>e.subscribe(new Tn(t,r)))}let Tn=class{constructor(e,t){this.destination=e,this.mapper=t}next(e){let t;try{t=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(t)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}};function Pl(r){return En(()=>r)}function Rl(){return r=>new y(e=>{let t=!1,n=!1;const a=r.subscribe(o=>{t||(t=!0,e.next(o)),n&&a.unsubscribe()},o=>{var i;t=!0,(i=e.error)===null||i===void 0||i.call(e,o),n&&a.unsubscribe()});return n=!0,t&&a.unsubscribe(),a})}function _l(){return r=>new y(e=>r.subscribe(new In(e)))}class In{constructor(e){this.destination=e,this.hasLast=!1}next(e){const t=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([t,e])}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}function Al(r){return e=>new y(t=>e.subscribe(new Pn(t,r)))}class Pn{constructor(e,t){this.destination=e,this.effect=t}next(e){try{this.effect(e)}catch(t){throw this.error(t),t}this.destination.next(e)}error(e){var t,n;(n=(t=this.destination).error)===null||n===void 0||n.call(t,e)}}var le;(function(r){r.NETWORK="network",r.VIDEO_PIPELINE="video_pipeline",r.EXTERNAL_API="external_api",r.PARSER="parser",r.DOM="dom",r.WTF="wtf"})(le||(le={}));class ue{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;const n=this.listeners[e];for(let a=0,o=n.length;a<o;a++)if(n[a].callback===t){n.splice(a,1);return}}dispatchEvent(e){if(!(e.type in this.listeners))return;const n=this.listeners[e.type].slice();for(let a=0,o=n.length;a<o;a++){const i=n[a];try{i.callback.call(this,e)}catch(s){Promise.resolve().then(()=>{throw s})}i.options&&i.options.once&&this.removeEventListener(e.type,i.callback)}return!e.defaultPrevented}}class lt extends ue{constructor(){super(),this.listeners||ue.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)}}class Rn{constructor(){Object.defineProperty(this,"signal",{value:new lt,writable:!0,configurable:!0})}abort(e){let t;try{t=new Event("abort")}catch(a){typeof document!="undefined"?document.createEvent?(t=document.createEvent("Event"),t.initEvent("abort",!1,!1)):(t=document.createEventObject(),t.type="abort"):t={type:"abort",bubbles:!1,cancelable:!1}}let n=e;if(n===void 0)if(typeof document=="undefined")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch(a){n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(t)}toString(){return"[object AbortController]"}}typeof Symbol!="undefined"&&Symbol.toStringTag&&(Rn.prototype[Symbol.toStringTag]="AbortController",lt.prototype[Symbol.toStringTag]="AbortSignal");function ut(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function _n(r){typeof r=="function"&&(r={fetch:r});const{fetch:e,Request:t=e.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a=!1}=r;if(!ut({fetch:e,Request:t,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:a}))return{fetch:e,Request:o};let o=t;(o&&!o.prototype.hasOwnProperty("signal")||a)&&(o=function(c,l){let f;l&&l.signal&&(f=l.signal,delete l.signal);const u=new t(c,l);return f&&Object.defineProperty(u,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),u},o.prototype=t.prototype);const i=e;return{fetch:(v,c)=>{const l=o&&o.prototype.isPrototypeOf(v)?v.signal:c?c.signal:void 0;if(l){let f;try{f=new DOMException("Aborted","AbortError")}catch(d){f=new Error("Aborted"),f.name="AbortError"}if(l.aborted)return Promise.reject(f);const u=new Promise((d,$)=>{l.addEventListener("abort",()=>$(f),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([u,i(v,c)])}return i(v,c)},Request:o}}const Wr=ut({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),vt=Wr?_n({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,An=Wr?vt.fetch:window.fetch;Wr?vt.Request:window.Request;var gr=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function jn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var j=function(r){try{return!!r()}catch(e){return!0}},Ln=j,hr=!Ln(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),ft=hr,dt=Function.prototype,kr=dt.call,xn=ft&&dt.bind.bind(kr,kr),N=ft?xn:function(r){return function(){return kr.apply(r,arguments)}},ht=N,Mn=ht({}.toString),Nn=ht("".slice),Hr=function(r){return Nn(Mn(r),8,-1)},Cn=N,Fn=j,Gn=Hr,Or=Object,Dn=Cn("".split),kn=Fn(function(){return!Or("z").propertyIsEnumerable(0)})?function(r){return Gn(r)=="String"?Dn(r,""):Or(r)}:Or,Xr=function(r){return r==null},Un=Xr,Vn=TypeError,pt=function(r){if(Un(r))throw Vn("Can't call method on "+r);return r},Bn=kn,Kn=pt,H=function(r){return Bn(Kn(r))},K={},Z=function(r){return r&&r.Math==Math&&r},I=Z(typeof globalThis=="object"&&globalThis)||Z(typeof window=="object"&&window)||Z(typeof self=="object"&&self)||Z(typeof gr=="object"&&gr)||function(){return this}()||gr||Function("return this")(),Ur=typeof document=="object"&&document.all,qn=typeof Ur=="undefined"&&Ur!==void 0,bt={all:Ur,IS_HTMLDDA:qn},yt=bt,Yn=yt.all,P=yt.IS_HTMLDDA?function(r){return typeof r=="function"||r===Yn}:function(r){return typeof r=="function"},zn=I,Qn=P,ve=zn.WeakMap,Wn=Qn(ve)&&/native code/.test(String(ve)),fe=P,gt=bt,Hn=gt.all,q=gt.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:fe(r)||r===Hn}:function(r){return typeof r=="object"?r!==null:fe(r)},Xn=j,C=!Xn(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7}),Y={},Jn=I,de=q,Vr=Jn.document,Zn=de(Vr)&&de(Vr.createElement),Ot=function(r){return Zn?Vr.createElement(r):{}},ra=C,ea=j,ta=Ot,$t=!ra&&!ea(function(){return Object.defineProperty(ta("div"),"a",{get:function(){return 7}}).a!=7}),na=C,aa=j,mt=na&&aa(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42}),oa=q,ia=String,sa=TypeError,z=function(r){if(oa(r))return r;throw sa(ia(r)+" is not an object")},ca=hr,rr=Function.prototype.call,F=ca?rr.bind(rr):function(){return rr.apply(rr,arguments)},Jr={},$r=Jr,mr=I,la=P,he=function(r){return la(r)?r:void 0},wt=function(r,e){return arguments.length<2?he($r[r])||he(mr[r]):$r[r]&&$r[r][e]||mr[r]&&mr[r][e]},ua=N,St=ua({}.isPrototypeOf),va=typeof navigator!="undefined"&&String(navigator.userAgent)||"",Et=I,wr=va,pe=Et.process,be=Et.Deno,ye=pe&&pe.versions||be&&be.version,ge=ye&&ye.v8,T,ur;ge&&(T=ge.split("."),ur=T[0]>0&&T[0]<4?1:+(T[0]+T[1]));!ur&&wr&&(T=wr.match(/Edge\/(\d+)/),(!T||T[1]>=74)&&(T=wr.match(/Chrome\/(\d+)/),T&&(ur=+T[1])));var fa=ur,Oe=fa,da=j,ha=I,pa=ha.String,Tt=!!Object.getOwnPropertySymbols&&!da(function(){var r=Symbol();return!pa(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Oe&&Oe<41}),ba=Tt,It=ba&&!Symbol.sham&&typeof Symbol.iterator=="symbol",ya=wt,ga=P,Oa=St,$a=It,ma=Object,Pt=$a?function(r){return typeof r=="symbol"}:function(r){var e=ya("Symbol");return ga(e)&&Oa(e.prototype,ma(r))},wa=String,Zr=function(r){try{return wa(r)}catch(e){return"Object"}},Sa=P,Ea=Zr,Ta=TypeError,re=function(r){if(Sa(r))return r;throw Ta(Ea(r)+" is not a function")},Ia=re,Pa=Xr,ee=function(r,e){var t=r[e];return Pa(t)?void 0:Ia(t)},Sr=F,Er=P,Tr=q,Ra=TypeError,_a=function(r,e){var t,n;if(e==="string"&&Er(t=r.toString)&&!Tr(n=Sr(t,r))||Er(t=r.valueOf)&&!Tr(n=Sr(t,r))||e!=="string"&&Er(t=r.toString)&&!Tr(n=Sr(t,r)))return n;throw Ra("Can't convert object to primitive value")},Rt={exports:{}},$e=I,Aa=Object.defineProperty,ja=function(r,e){try{Aa($e,r,{value:e,configurable:!0,writable:!0})}catch(t){$e[r]=e}return e},La=I,xa=ja,me="__core-js_shared__",Ma=La[me]||xa(me,{}),_t=Ma,we=_t;(Rt.exports=function(r,e){return we[r]||(we[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.31.0",mode:"pure",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE",source:"https://github.com/zloirock/core-js"});var At=Rt.exports,Na=pt,Ca=Object,jt=function(r){return Ca(Na(r))},Fa=N,Ga=jt,Da=Fa({}.hasOwnProperty),x=Object.hasOwn||function(e,t){return Da(Ga(e),t)},ka=N,Ua=0,Va=Math.random(),Ba=ka(1 .toString),Lt=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Ba(++Ua+Va,36)},Ka=I,qa=At,Se=x,Ya=Lt,za=Tt,Qa=It,U=Ka.Symbol,Ir=qa("wks"),Wa=Qa?U.for||U:U&&U.withoutSetter||Ya,L=function(r){return Se(Ir,r)||(Ir[r]=za&&Se(U,r)?U[r]:Wa("Symbol."+r)),Ir[r]},Ha=F,Ee=q,Te=Pt,Xa=ee,Ja=_a,Za=L,ro=TypeError,eo=Za("toPrimitive"),to=function(r,e){if(!Ee(r)||Te(r))return r;var t=Xa(r,eo),n;if(t){if(e===void 0&&(e="default"),n=Ha(t,r,e),!Ee(n)||Te(n))return n;throw ro("Can't convert object to primitive value")}return e===void 0&&(e="number"),Ja(r,e)},no=to,ao=Pt,te=function(r){var e=no(r,"string");return ao(e)?e:e+""},oo=C,io=$t,so=mt,er=z,Ie=te,co=TypeError,Pr=Object.defineProperty,lo=Object.getOwnPropertyDescriptor,Rr="enumerable",_r="configurable",Ar="writable";Y.f=oo?so?function(e,t,n){if(er(e),t=Ie(t),er(n),typeof e=="function"&&t==="prototype"&&"value"in n&&Ar in n&&!n[Ar]){var a=lo(e,t);a&&a[Ar]&&(e[t]=n.value,n={configurable:_r in n?n[_r]:a[_r],enumerable:Rr in n?n[Rr]:a[Rr],writable:!1})}return Pr(e,t,n)}:Pr:function(e,t,n){if(er(e),t=Ie(t),er(n),io)try{return Pr(e,t,n)}catch(a){}if("get"in n||"set"in n)throw co("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var pr=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},uo=C,vo=Y,fo=pr,X=uo?function(r,e,t){return vo.f(r,e,fo(1,t))}:function(r,e,t){return r[e]=t,r},ho=At,po=Lt,Pe=ho("keys"),ne=function(r){return Pe[r]||(Pe[r]=po(r))},ae={},bo=Wn,xt=I,yo=q,go=X,jr=x,Lr=_t,Oo=ne,$o=ae,Re="Object already initialized",Br=xt.TypeError,mo=xt.WeakMap,vr,W,fr,wo=function(r){return fr(r)?W(r):vr(r,{})},So=function(r){return function(e){var t;if(!yo(e)||(t=W(e)).type!==r)throw Br("Incompatible receiver, "+r+" required");return t}};if(bo||Lr.state){var R=Lr.state||(Lr.state=new mo);R.get=R.get,R.has=R.has,R.set=R.set,vr=function(r,e){if(R.has(r))throw Br(Re);return e.facade=r,R.set(r,e),e},W=function(r){return R.get(r)||{}},fr=function(r){return R.has(r)}}else{var G=Oo("state");$o[G]=!0,vr=function(r,e){if(jr(r,G))throw Br(Re);return e.facade=r,go(r,G,e),e},W=function(r){return jr(r,G)?r[G]:{}},fr=function(r){return jr(r,G)}}var Eo={set:vr,get:W,has:fr,enforce:wo,getterFor:So},To=hr,Mt=Function.prototype,_e=Mt.apply,Ae=Mt.call,Io=typeof Reflect=="object"&&Reflect.apply||(To?Ae.bind(_e):function(){return Ae.apply(_e,arguments)}),Po=Hr,Ro=N,Nt=function(r){if(Po(r)==="Function")return Ro(r)},Ct={},Ft={},Gt={}.propertyIsEnumerable,Dt=Object.getOwnPropertyDescriptor,_o=Dt&&!Gt.call({1:2},1);Ft.f=_o?function(e){var t=Dt(this,e);return!!t&&t.enumerable}:Gt;var Ao=C,jo=F,Lo=Ft,xo=pr,Mo=H,No=te,Co=x,Fo=$t,je=Object.getOwnPropertyDescriptor;Ct.f=Ao?je:function(e,t){if(e=Mo(e),t=No(t),Fo)try{return je(e,t)}catch(n){}if(Co(e,t))return xo(!jo(Lo.f,e,t),e[t])};var Go=j,Do=P,ko=/#|\.prototype\./,J=function(r,e){var t=Vo[Uo(r)];return t==Ko?!0:t==Bo?!1:Do(e)?Go(e):!!e},Uo=J.normalize=function(r){return String(r).replace(ko,".").toLowerCase()},Vo=J.data={},Bo=J.NATIVE="N",Ko=J.POLYFILL="P",qo=J,Le=Nt,Yo=re,zo=hr,Qo=Le(Le.bind),kt=function(r,e){return Yo(r),e===void 0?r:zo?Qo(r,e):function(){return r.apply(e,arguments)}},tr=I,Wo=Io,Ho=Nt,Xo=P,Jo=Ct.f,Zo=qo,D=Jr,ri=kt,k=X,xe=x,ei=function(r){var e=function(t,n,a){if(this instanceof e){switch(arguments.length){case 0:return new r;case 1:return new r(t);case 2:return new r(t,n)}return new r(t,n,a)}return Wo(r,this,arguments)};return e.prototype=r.prototype,e},Ut=function(r,e){var t=r.target,n=r.global,a=r.stat,o=r.proto,i=n?tr:a?tr[t]:(tr[t]||{}).prototype,s=n?D:D[t]||k(D,t,{})[t],v=s.prototype,c,l,f,u,d,$,S,m,g;for(u in e)c=Zo(n?u:t+(a?".":"#")+u,r.forced),l=!c&&i&&xe(i,u),$=s[u],l&&(r.dontCallGetSet?(g=Jo(i,u),S=g&&g.value):S=i[u]),d=l&&S?S:e[u],!(l&&typeof $==typeof d)&&(r.bind&&l?m=ri(d,tr):r.wrap&&l?m=ei(d):o&&Xo(d)?m=Ho(d):m=d,(r.sham||d&&d.sham||$&&$.sham)&&k(m,"sham",!0),k(s,u,m),o&&(f=t+"Prototype",xe(D,f)||k(D,f,{}),k(D[f],u,d),r.real&&v&&(c||!v[u])&&k(v,u,d)))},Kr=C,ti=x,Vt=Function.prototype,ni=Kr&&Object.getOwnPropertyDescriptor,oe=ti(Vt,"name"),ai=oe&&function(){}.name==="something",oi=oe&&(!Kr||Kr&&ni(Vt,"name").configurable),ii={EXISTS:oe,PROPER:ai,CONFIGURABLE:oi},Bt={},si=Math.ceil,ci=Math.floor,li=Math.trunc||function(e){var t=+e;return(t>0?ci:si)(t)},ui=li,Kt=function(r){var e=+r;return e!==e||e===0?0:ui(e)},vi=Kt,fi=Math.max,di=Math.min,hi=function(r,e){var t=vi(r);return t<0?fi(t+e,0):di(t,e)},pi=Kt,bi=Math.min,yi=function(r){return r>0?bi(pi(r),9007199254740991):0},gi=yi,qt=function(r){return gi(r.length)},Oi=H,$i=hi,mi=qt,Me=function(r){return function(e,t,n){var a=Oi(e),o=mi(a),i=$i(n,o),s;if(r&&t!=t){for(;o>i;)if(s=a[i++],s!=s)return!0}else for(;o>i;i++)if((r||i in a)&&a[i]===t)return r||i||0;return!r&&-1}},wi={includes:Me(!0),indexOf:Me(!1)},Si=N,xr=x,Ei=H,Ti=wi.indexOf,Ii=ae,Ne=Si([].push),Pi=function(r,e){var t=Ei(r),n=0,a=[],o;for(o in t)!xr(Ii,o)&&xr(t,o)&&Ne(a,o);for(;e.length>n;)xr(t,o=e[n++])&&(~Ti(a,o)||Ne(a,o));return a},Yt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ri=Pi,_i=Yt,Ai=Object.keys||function(e){return Ri(e,_i)},ji=C,Li=mt,xi=Y,Mi=z,Ni=H,Ci=Ai;Bt.f=ji&&!Li?Object.defineProperties:function(e,t){Mi(e);for(var n=Ni(t),a=Ci(t),o=a.length,i=0,s;o>i;)xi.f(e,s=a[i++],n[s]);return e};var Fi=wt,Gi=Fi("document","documentElement"),Di=z,ki=Bt,Ce=Yt,Ui=ae,Vi=Gi,Bi=Ot,Ki=ne,Fe=">",Ge="<",qr="prototype",Yr="script",zt=Ki("IE_PROTO"),Mr=function(){},Qt=function(r){return Ge+Yr+Fe+r+Ge+"/"+Yr+Fe},De=function(r){r.write(Qt("")),r.close();var e=r.parentWindow.Object;return r=null,e},qi=function(){var r=Bi("iframe"),e="java"+Yr+":",t;return r.style.display="none",Vi.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Qt("document.F=Object")),t.close(),t.F},nr,sr=function(){try{nr=new ActiveXObject("htmlfile")}catch(e){}sr=typeof document!="undefined"?document.domain&&nr?De(nr):qi():De(nr);for(var r=Ce.length;r--;)delete sr[qr][Ce[r]];return sr()};Ui[zt]=!0;var Wt=Object.create||function(e,t){var n;return e!==null?(Mr[qr]=Di(e),n=new Mr,Mr[qr]=null,n[zt]=e):n=sr(),t===void 0?n:ki.f(n,t)},Yi=j,zi=!Yi(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}),Qi=x,Wi=P,Hi=jt,Xi=ne,Ji=zi,ke=Xi("IE_PROTO"),zr=Object,Zi=zr.prototype,Ht=Ji?zr.getPrototypeOf:function(r){var e=Hi(r);if(Qi(e,ke))return e[ke];var t=e.constructor;return Wi(t)&&e instanceof t?t.prototype:e instanceof zr?Zi:null},rs=X,Xt=function(r,e,t,n){return n&&n.enumerable?r[e]=t:rs(r,e,t),r},es=j,ts=P,ns=q,as=Wt,Ue=Ht,os=Xt,is=L,Qr=is("iterator"),Jt=!1,A,Nr,Cr;[].keys&&(Cr=[].keys(),"next"in Cr?(Nr=Ue(Ue(Cr)),Nr!==Object.prototype&&(A=Nr)):Jt=!0);var ss=!ns(A)||es(function(){var r={};return A[Qr].call(r)!==r});ss?A={}:A=as(A);ts(A[Qr])||os(A,Qr,function(){return this});var Zt={IteratorPrototype:A,BUGGY_SAFARI_ITERATORS:Jt},cs=L,ls=cs("toStringTag"),rn={};rn[ls]="z";var ie=String(rn)==="[object z]",us=ie,vs=P,cr=Hr,fs=L,ds=fs("toStringTag"),hs=Object,ps=cr(function(){return arguments}())=="Arguments",bs=function(r,e){try{return r[e]}catch(t){}},se=us?cr:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=bs(e=hs(r),ds))=="string"?t:ps?cr(e):(n=cr(e))=="Object"&&vs(e.callee)?"Arguments":n},ys=ie,gs=se,Os=ys?{}.toString:function(){return"[object "+gs(this)+"]"},$s=ie,ms=Y.f,ws=X,Ss=x,Es=Os,Ts=L,Ve=Ts("toStringTag"),en=function(r,e,t,n){if(r){var a=t?r:r.prototype;Ss(a,Ve)||ms(a,Ve,{configurable:!0,value:e}),n&&!$s&&ws(a,"toString",Es)}},Is=Zt.IteratorPrototype,Ps=Wt,Rs=pr,_s=en,As=K,js=function(){return this},Ls=function(r,e,t,n){var a=e+" Iterator";return r.prototype=Ps(Is,{next:Rs(+!n,t)}),_s(r,a,!1,!0),As[a]=js,r},xs=Ut,Ms=F,tn=ii,Ns=Ls,Cs=Ht,Fs=en,Be=Xt,Gs=L,Ke=K,nn=Zt,Ds=tn.PROPER;tn.CONFIGURABLE;nn.IteratorPrototype;var ar=nn.BUGGY_SAFARI_ITERATORS,Fr=Gs("iterator"),qe="keys",or="values",Ye="entries",ks=function(){return this},Us=function(r,e,t,n,a,o,i){Ns(t,e,n);var s=function(g){if(g===a&&u)return u;if(!ar&&g in l)return l[g];switch(g){case qe:return function(){return new t(this,g)};case or:return function(){return new t(this,g)};case Ye:return function(){return new t(this,g)}}return function(){return new t(this)}},v=e+" Iterator",c=!1,l=r.prototype,f=l[Fr]||l["@@iterator"]||a&&l[a],u=!ar&&f||s(a),d=e=="Array"&&l.entries||f,$,S,m;if(d&&($=Cs(d.call(new r)),$!==Object.prototype&&$.next&&(Fs($,v,!0,!0),Ke[v]=ks)),Ds&&a==or&&f&&f.name!==or&&(c=!0,u=function(){return Ms(f,this)}),a)if(S={values:s(or),keys:o?u:s(qe),entries:s(Ye)},i)for(m in S)(ar||c||!(m in l))&&Be(l,m,S[m]);else xs({target:e,proto:!0,forced:ar||c},S);return i&&l[Fr]!==u&&Be(l,Fr,u,{name:a}),Ke[e]=u,S},Vs=function(r,e){return{value:r,done:e}},Bs=H,ze=K,an=Eo;Y.f;var Ks=Us,ir=Vs,on="Array Iterator",qs=an.set,Ys=an.getterFor(on);Ks(Array,"Array",function(r,e){qs(this,{type:on,target:Bs(r),index:0,kind:e})},function(){var r=Ys(this),e=r.target,t=r.kind,n=r.index++;return!e||n>=e.length?(r.target=void 0,ir(void 0,!0)):t=="keys"?ir(n,!1):t=="values"?ir(e[n],!1):ir([n,e[n]],!1)},"values");ze.Arguments=ze.Array;var zs=L,Qs=K,Ws=zs("iterator"),Hs=Array.prototype,Xs=function(r){return r!==void 0&&(Qs.Array===r||Hs[Ws]===r)},Js=se,Qe=ee,Zs=Xr,rc=K,ec=L,tc=ec("iterator"),sn=function(r){if(!Zs(r))return Qe(r,tc)||Qe(r,"@@iterator")||rc[Js(r)]},nc=F,ac=re,oc=z,ic=Zr,sc=sn,cc=TypeError,lc=function(r,e){var t=arguments.length<2?sc(r):e;if(ac(t))return oc(nc(t,r));throw cc(ic(r)+" is not iterable")},uc=F,We=z,vc=ee,fc=function(r,e,t){var n,a;We(r);try{if(n=vc(r,"return"),!n){if(e==="throw")throw t;return t}n=uc(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return We(n),t},dc=kt,hc=F,pc=z,bc=Zr,yc=Xs,gc=qt,He=St,Oc=lc,$c=sn,Xe=fc,mc=TypeError,lr=function(r,e){this.stopped=r,this.result=e},Je=lr.prototype,wc=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),s=!!(t&&t.INTERRUPTED),v=dc(e,n),c,l,f,u,d,$,S,m=function(O){return c&&Xe(c,"normal",O),new lr(!0,O)},g=function(O){return a?(pc(O),s?v(O[0],O[1],m):v(O[0],O[1])):s?v(O,m):v(O)};if(o)c=r.iterator;else if(i)c=r;else{if(l=$c(r),!l)throw mc(bc(r)+" is not iterable");if(yc(l)){for(f=0,u=gc(r);u>f;f++)if(d=g(r[f]),d&&He(Je,d))return d;return new lr(!1)}c=Oc(r,l)}for($=o?r.next:c.next;!(S=hc($,c)).done;){try{d=g(S.value)}catch(O){Xe(c,"throw",O)}if(typeof d=="object"&&d&&He(Je,d))return d}return new lr(!1)},Sc=te,Ec=Y,Tc=pr,Ic=function(r,e,t){var n=Sc(e);n in r?Ec.f(r,n,Tc(0,t)):r[n]=t},Pc=Ut,Rc=wc,_c=Ic;Pc({target:"Object",stat:!0},{fromEntries:function(e){var t={};return Rc(e,function(n,a){_c(t,n,a)},{AS_ENTRIES:!0}),t}});var Ac=Jr,jc=Ac.Object.fromEntries,Lc={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},xc=Lc,Mc=I,Nc=se,Cc=X,Ze=K,Fc=L,rt=Fc("toStringTag");for(var Gr in xc){var et=Mc[Gr],Dr=et&&et.prototype;Dr&&Nc(Dr)!==rt&&Cc(Dr,rt,Gr),Ze[Gr]=Ze.Array}var Gc=jc,Dc=Gc,kc=Dc,Uc=kc,Vc=jn(Uc),tt;(function(r){r.Armenian="58",r.Azerbaijani="57",r.Belarusian="114",r.English="3",r.Kazakh="97",r.Portuguese="73",r.Russian="0",r.Spanish="4",r.Ukrainian="1",r.Uzbek="65",r.Vietnamese="75"})(tt||(tt={}));const Bc="vk.com",jl=async(r,e,t)=>{const n=new URL(`https://${Bc}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),r!==void 0&&n.searchParams.set("lang",r);const o=await(await An(n.toString())).json();return Kc(o,t)},Kc=(r,e)=>Vc(Object.entries(r.keys).map(([t,n])=>[t.substring(`${e}_`.length),qc(n)])),qc=r=>Array.isArray(r)?r[0]:r;var nt;(function(r){r.RU="ru",r.EN="en"})(nt||(nt={}));export{_ as CurrentClientBrowser,p as CurrentClientDevice,le as ErrorCategory,nt as InterfaceLanguage,Qc as Logger,y as Observable,at as Subject,dr as Subscription,Yc as VERSION,tt as VKNumericLanguage,hl as ValueSubject,w as VideoQuality,Zc as abortable,Xc as addScript,fl as areQualitiesExact,V as assertNever,Wc as assertNonNullable,Hc as assertNullable,dl as assertQualityIsExact,ml as buffer,zc as checkNever,pl as combine,wl as debounce,bn as fillWithDefault,El as filter,Tl as filterChanged,$l as fromEvent,ot as getCurrentBrowser,nl as getExponentialDelay,cl as getHighestQuality,el as getIOSVersion,gl as interval,ol as isHigher,il as isHigherOrEqual,rl as isIOS,ct as isInvariantQuality,it as isLower,sl as isLowerOrEqual,tl as isMacLike,cn as isNonNullable,ln as isNullable,jl as loadVKLangPack,En as map,Pl as mapTo,bl as merge,Q as noop,Jc as now,Ol as observableFrom,Rl as once,_l as pairwise,al as safeStorage,Al as tap,Sl as throttle,yl as timeout,ll as videoHeightToQuality,vl as videoQualityToHeight,ul as videoSizeToQuality};
|
package/esnext.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.31-dev.
|
|
3
|
-
* Fri, 27 Oct 2023 13:
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.31-dev.c49c485.0
|
|
3
|
+
* Fri, 27 Oct 2023 13:12:50 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-31/doc/
|
|
5
5
|
*/
|
|
6
|
-
"use strict";const q="1.0.31-dev.88984b6.0";class y{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const p=e=>{throw new Error(`${e} is value of unexpected type`)},F=e=>{},m=()=>{};class l{constructor(t){t&&(this._subscribe=t)}subscribe(t,r){let n;r?typeof r=="function"?n={next:r,error:m}:n={next:o=>r.next(o),error:o=>r.error?.(o)}:n={next:m,error:m};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(u){n.next(u)}},error:o=>n.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):n.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new y().add(()=>{switch(s.next=m,s.error=m,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return p(i)}})}pipe(...t){return t.reduce((r,n)=>n(r),this)}_subscribe(t){}}class A extends l{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(r=>r.next(t))}error(t){this.subscribers.forEach(r=>r.error?.(t))}_subscribe(t){const r=this.keyCounter++;return this.subscribers.set(r,t),new y().add(()=>this.subscribers.delete(r))}}class U{log$=new A;logs=[];log=t=>{const r={...t,timestamp:Date.now()};this.logs.push(r),this.log$.next(r)};createCustomLog(t){return(...r)=>{let n;try{n=t(...r)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(r=>({component:t,...r}))}getAllLogs=()=>this.logs}function G(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function B(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function T(e){return typeof e<"u"&&e!==null}function I(e){return e==null}const z=(e,t,r)=>new Promise((n,s)=>{t.addEventListener("abort",()=>{u(),c.remove()});const i=()=>{u(),s()},o=()=>{u(),n()},u=()=>{h&&clearTimeout(h),c.removeEventListener("load",o),c.removeEventListener("error",i)};let h;r&&(h=window.setTimeout(i,r));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),H=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),$=(e,t)=>async(...r)=>{const n=t(...r);let s=e.aborted,i;for(;!s&&!e.aborted;){const o=await n.next(i);s=o.done??!1,i=o.value}return i};exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const x=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,r=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,s=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,o=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,u=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,h=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,f=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,b=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,g=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,S=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:t||s||o||u||r||n||i||exports.CurrentClientBrowser.Rest,device:h||c||f||b||S||g||exports.CurrentClientDevice.Desktop}},Y=(e=!1)=>{const r=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(x().device);if(!e)return r;const{userAgent:n,maxTouchPoints:s}=window.navigator;return!!(r||/macintosh/i.test(n)&&s>0)},W=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const r=t[1],n=parseFloat(r);return isNaN(n)?null:n},K=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(x().device),X=(e,{start:t=0,factor:r=2,max:n=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=r**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,n),o=Math.max(o,s),o};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let E,w;const O=`vk-videoplayer-dummy-key-${Math.random()}`,v=()=>{if(w!==void 0)return w;try{localStorage.setItem(O,"test"),localStorage.removeItem(O),w=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(O),w=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)w=a.RUNTIME;else throw t}else throw e}return w===a.RUNTIME&&(E=new Map),w},J=()=>v()===a.LOCAL_STORAGE,Z=e=>{const t=v();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return E?.get(e);default:p(t)}},ee=(e,t)=>{const r=v();switch(r){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.RUNTIME:return void E?.set(e,t);default:p(r)}},te=e=>{const t=v();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return E?.has(e)??!1;default:return p(t),!1}},re=e=>{const t=v();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void E?.delete(e);default:p(t)}},ne=()=>{const e=v();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return E?.clear();default:p(e)}};var ie=Object.freeze({__proto__:null,clear:ne,get:Z,has:te,isPersistent:J,remove:re,set:ee});exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const d={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},se=(e,t)=>d[e].height>d[t].height,oe=(e,t)=>d[e].height>=d[t].height,R=(e,t)=>d[e].height<d[t].height,ae=(e,t)=>d[e].height<=d[t].height,ce=e=>e.sort((t,r)=>t===r?0:t===exports.VideoQuality.INVARIANT?1:r===exports.VideoQuality.INVARIANT?-1:R(t,r)?1:-1)[0],N=Object.keys(d).sort((e,t)=>R(e,t)?-1:1),le=(e,t=.02)=>[...N].find(n=>d[n].height*(1+t)>=e),ue=({width:e,height:t})=>{const r=Math.min(e,t),n=Math.max(e,t);return N.find(s=>{const i=d[s];return i.width>=n&&i.height>=r})},de=e=>d[e].height,C=e=>e===exports.VideoQuality.INVARIANT,he=e=>e.every(t=>!C(t));function fe(e){if(C(e))throw new Error("Expected exact quality")}const M=(e,t)=>{const r={};for(const n of Object.keys(t)){const s=t[n],i=e[n];Array.isArray(s)&&Array.isArray(i)?r[n]=i:typeof s=="object"&&typeof i=="object"?r[n]=M(i,s):r[n]=n in e?i:s}return r};class be extends A{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const r=super._subscribe(t);return t.next(this.value),r}}function we(e){return new l(t=>{const r={};let n=Object.keys(e).length;const s=i=>o=>{i in r||n--,r[i]=o,n===0&&t.next(r)};return Object.entries(e).reduce((i,[o,u])=>i.add(u.subscribe(s(o))),new y)})}function pe(...e){return new l(t=>e.reduce((r,n)=>r.add(n.subscribe(t)),new y))}var ge=e=>new l(t=>{const r=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},e);return()=>window.clearTimeout(r)}),me=e=>new l(t=>{const r=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(r)}),Ee=e=>new l(t=>{e.forEach(r=>t.next(r))}),ve=(e,t)=>new l(r=>{const n=s=>r.next(s);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function ye(e){return t=>new l(r=>t.subscribe(new Se(r,e)))}class Se{destination;size;lastValues=[];constructor(t,r){this.destination=t,this.size=r}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const Oe={leading:!1,trailing:!0};function Ae(e,t=Oe){return r=>new l(n=>r.subscribe(new xe(n,e,t)))}class xe{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,T(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const Re={leading:!0,trailing:!1};function Ce(e,t=Re){return r=>new l(n=>r.subscribe(new Le(n,e,t)))}class Le{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,I(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function _e(e){return t=>new l(r=>t.subscribe(new Pe(r,e)))}class Pe{destination;predicate;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.predicate(t)}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Te(e=(t,r)=>t===r){return t=>new l(r=>t.subscribe(new Ie(r,e)))}const _={};class Ie{destination;predicate;lastValue=_;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.lastValue===_||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Q(e){return t=>new l(r=>t.subscribe(new Ne(r,e)))}let Ne=class{destination;mapper;constructor(t,r){this.destination=t,this.mapper=r}next(t){let r;try{r=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(r)}error(t){this.destination.error?.(t)}};function Me(e){return Q(()=>e)}function Qe(){return e=>new l(t=>{let r=!1,n=!1;const s=e.subscribe(i=>{r||(r=!0,t.next(i)),n&&s.unsubscribe()},i=>{r=!0,t.error?.(i),n&&s.unsubscribe()});return n=!0,r&&s.unsubscribe(),s})}function Ve(){return e=>new l(t=>e.subscribe(new De(t)))}class De{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const r=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,t])}error(t){this.destination.error?.(t)}}function je(e){return t=>new l(r=>t.subscribe(new ke(r,e)))}class ke{destination;effect;constructor(t,r){this.destination=t,this.effect=r}next(t){try{this.effect(t)}catch(r){throw this.error(r),r}this.destination.next(t)}error(t){this.destination.error?.(t)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class P{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,r,n){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:r,options:n})}removeEventListener(t,r){if(!(t in this.listeners))return;const n=this.listeners[t];for(let s=0,i=n.length;s<i;s++)if(n[s].callback===r){n.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const n=this.listeners[t.type].slice();for(let s=0,i=n.length;s<i;s++){const o=n[s];try{o.callback.call(this,t)}catch(u){Promise.resolve().then(()=>{throw u})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class V extends P{constructor(){super(),this.listeners||P.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class qe{constructor(){Object.defineProperty(this,"signal",{value:new V,writable:!0,configurable:!0})}abort(t){let r;try{r=new Event("abort")}catch{typeof document<"u"?document.createEvent?(r=document.createEvent("Event"),r.initEvent("abort",!1,!1)):(r=document.createEventObject(),r.type="abort"):r={type:"abort",bubbles:!1,cancelable:!1}}let n=t;if(n===void 0)if(typeof document>"u")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch{n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(r)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(qe.prototype[Symbol.toStringTag]="AbortController",V.prototype[Symbol.toStringTag]="AbortSignal");function D(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 Fe(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:r=t.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!D({fetch:t,Request:r,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=r;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,f){let b;f&&f.signal&&(b=f.signal,delete f.signal);const g=new r(c,f);return b&&Object.defineProperty(g,"signal",{writable:!1,enumerable:!1,configurable:!0,value:b}),g},i.prototype=r.prototype);const o=t;return{fetch:(h,c)=>{const f=i&&i.prototype.isPrototypeOf(h)?h.signal:c?c.signal:void 0;if(f){let b;try{b=new DOMException("Aborted","AbortError")}catch{b=new Error("Aborted"),b.name="AbortError"}if(f.aborted)return Promise.reject(b);const g=new Promise((S,k)=>{f.addEventListener("abort",()=>k(b),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([g,o(h,c)])}return o(h,c)},Request:i}}const L=D({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),j=L?Fe({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ue=L?j.fetch:window.fetch;L?j.Request:window.Request;exports.VKNumericLanguage=void 0;(function(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"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const Ge="vk.com",Be=async(e,t,r)=>{const n=new URL(`https://${Ge}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",t),e!==void 0&&n.searchParams.set("lang",e);const i=await(await Ue(n.toString())).json();return ze(i,r)},ze=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([r,n])=>[r.substring(`${t}_`.length),He(n)])),He=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=U;exports.Observable=l;exports.Subject=A;exports.Subscription=y;exports.VERSION=q;exports.ValueSubject=be;exports.abortable=$;exports.addScript=z;exports.areQualitiesExact=he;exports.assertNever=p;exports.assertNonNullable=G;exports.assertNullable=B;exports.assertQualityIsExact=fe;exports.buffer=ye;exports.checkNever=F;exports.combine=we;exports.debounce=Ae;exports.fillWithDefault=M;exports.filter=_e;exports.filterChanged=Te;exports.fromEvent=ve;exports.getCurrentBrowser=x;exports.getExponentialDelay=X;exports.getHighestQuality=ce;exports.getIOSVersion=W;exports.interval=me;exports.isHigher=se;exports.isHigherOrEqual=oe;exports.isIOS=Y;exports.isInvariantQuality=C;exports.isLower=R;exports.isLowerOrEqual=ae;exports.isMacLike=K;exports.isNonNullable=T;exports.isNullable=I;exports.loadVKLangPack=Be;exports.map=Q;exports.mapTo=Me;exports.merge=pe;exports.noop=m;exports.now=H;exports.observableFrom=Ee;exports.once=Qe;exports.pairwise=Ve;exports.safeStorage=ie;exports.tap=je;exports.throttle=Ce;exports.timeout=ge;exports.videoHeightToQuality=le;exports.videoQualityToHeight=de;exports.videoSizeToQuality=ue;
|
|
6
|
+
"use strict";const q="1.0.31-dev.c49c485.0";class y{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const p=e=>{throw new Error(`${e} is value of unexpected type`)},F=e=>{},m=()=>{};class l{constructor(t){t&&(this._subscribe=t)}subscribe(t,r){let n;r?typeof r=="function"?n={next:r,error:m}:n={next:o=>r.next(o),error:o=>r.error?.(o)}:n={next:m,error:m};const s=typeof t=="function"?{next:o=>{try{t(o)}catch(u){n.next(u)}},error:o=>n.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):n.next(o)};let i;try{i=this._subscribe(s)}catch(o){s.error?.(o)}return new y().add(()=>{switch(s.next=m,s.error=m,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return p(i)}})}pipe(...t){return t.reduce((r,n)=>n(r),this)}_subscribe(t){}}class A extends l{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(r=>r.next(t))}error(t){this.subscribers.forEach(r=>r.error?.(t))}_subscribe(t){const r=this.keyCounter++;return this.subscribers.set(r,t),new y().add(()=>this.subscribers.delete(r))}}class U{log$=new A;logs=[];log=t=>{const r={...t,timestamp:Date.now()};this.logs.push(r),this.log$.next(r)};createCustomLog(t){return(...r)=>{let n;try{n=t(...r)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(r=>({component:t,...r}))}getAllLogs=()=>this.logs}function G(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function B(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function T(e){return typeof e<"u"&&e!==null}function I(e){return e==null}const z=(e,t,r)=>new Promise((n,s)=>{t.addEventListener("abort",()=>{u(),c.remove()});const i=()=>{u(),s()},o=()=>{u(),n()},u=()=>{h&&clearTimeout(h),c.removeEventListener("load",o),c.removeEventListener("error",i)};let h;r&&(h=window.setTimeout(i,r));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",i),c.src=e,document.head.appendChild(c)}),H=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),$=(e,t)=>async(...r)=>{const n=t(...r);let s=e.aborted,i;for(;!s&&!e.aborted;){const o=await n.next(i);s=o.done??!1,i=o.value}return i};exports.CurrentClientBrowser=void 0;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(exports.CurrentClientBrowser||(exports.CurrentClientBrowser={}));exports.CurrentClientDevice=void 0;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(exports.CurrentClientDevice||(exports.CurrentClientDevice={}));const x=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?exports.CurrentClientBrowser.Yandex:void 0,r=/chrome|crios/i.test(e)?exports.CurrentClientBrowser.Chrome:void 0,n=/chromium/i.test(e)?exports.CurrentClientBrowser.Chromium:void 0,s=/firefox|fxios/i.test(e)?exports.CurrentClientBrowser.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?exports.CurrentClientBrowser.Safari:void 0,o=/opr\//i.test(e)?exports.CurrentClientBrowser.Opera:void 0,u=/edg/i.test(e)?exports.CurrentClientBrowser.Edge:void 0,h=/android/i.test(e)?exports.CurrentClientDevice.Android:void 0,c=/iphone/i.test(e)?exports.CurrentClientDevice.iPhone:void 0,f=/ipad/i.test(e)?exports.CurrentClientDevice.iPad:void 0,b=/ipod/i.test(e)?exports.CurrentClientDevice.iPod:void 0,g=/mac/i.test(e)?exports.CurrentClientDevice.Mac:void 0,S=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?exports.CurrentClientDevice.RestMobile:void 0;return{browser:t||s||o||u||r||n||i||exports.CurrentClientBrowser.Rest,device:h||c||f||b||S||g||exports.CurrentClientDevice.Desktop}},Y=(e=!1)=>{const r=[exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(x().device);if(!e)return r;const{userAgent:n,maxTouchPoints:s}=window.navigator;return!!(r||/macintosh/i.test(n)&&s>0)},W=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const r=t[1],n=parseFloat(r);return isNaN(n)?null:n},K=()=>[exports.CurrentClientDevice.Mac,exports.CurrentClientDevice.iPhone,exports.CurrentClientDevice.iPad,exports.CurrentClientDevice.iPod].includes(x().device),X=(e,{start:t=0,factor:r=2,max:n=1/0,min:s=t,random:i=0}={})=>{let o=t;return o*=r**e,o*=1+(Math.random()*i*2-i),o=Math.round(o),o=Math.min(o,n),o=Math.max(o,s),o};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let E,w;const O=`vk-videoplayer-dummy-key-${Math.random()}`,v=()=>{if(w!==void 0)return w;try{localStorage.setItem(O,"test"),localStorage.removeItem(O),w=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(O),w=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)w=a.RUNTIME;else throw t}else throw e}return w===a.RUNTIME&&(E=new Map),w},J=()=>v()===a.LOCAL_STORAGE,Z=e=>{const t=v();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return E?.get(e);default:p(t)}},ee=(e,t)=>{const r=v();switch(r){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.RUNTIME:return void E?.set(e,t);default:p(r)}},te=e=>{const t=v();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return E?.has(e)??!1;default:return p(t),!1}},re=e=>{const t=v();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void E?.delete(e);default:p(t)}},ne=()=>{const e=v();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return E?.clear();default:p(e)}};var ie=Object.freeze({__proto__:null,clear:ne,get:Z,has:te,isPersistent:J,remove:re,set:ee});exports.VideoQuality=void 0;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(exports.VideoQuality||(exports.VideoQuality={}));const d={[exports.VideoQuality.Q_144P]:{width:256,height:144},[exports.VideoQuality.Q_240P]:{width:428,height:240},[exports.VideoQuality.Q_360P]:{width:640,height:360},[exports.VideoQuality.Q_480P]:{width:856,height:480},[exports.VideoQuality.Q_720P]:{width:1280,height:720},[exports.VideoQuality.Q_1080P]:{width:1920,height:1080},[exports.VideoQuality.Q_1440P]:{width:2560,height:1440},[exports.VideoQuality.Q_2160P]:{width:3840,height:2160},[exports.VideoQuality.Q_4320P]:{width:7680,height:4320}},se=(e,t)=>d[e].height>d[t].height,oe=(e,t)=>d[e].height>=d[t].height,R=(e,t)=>d[e].height<d[t].height,ae=(e,t)=>d[e].height<=d[t].height,ce=e=>e.sort((t,r)=>t===r?0:t===exports.VideoQuality.INVARIANT?1:r===exports.VideoQuality.INVARIANT?-1:R(t,r)?1:-1)[0],N=Object.keys(d).sort((e,t)=>R(e,t)?-1:1),le=(e,t=.02)=>[...N].find(n=>d[n].height*(1+t)>=e),ue=({width:e,height:t})=>{const r=Math.min(e,t),n=Math.max(e,t);return N.find(s=>{const i=d[s];return i.width>=n&&i.height>=r})},de=e=>d[e].height,C=e=>e===exports.VideoQuality.INVARIANT,he=e=>e.every(t=>!C(t));function fe(e){if(C(e))throw new Error("Expected exact quality")}const M=(e,t)=>{const r={};for(const n of Object.keys(t)){const s=t[n],i=e[n];Array.isArray(s)&&Array.isArray(i)?r[n]=i:typeof s=="object"&&typeof i=="object"?r[n]=M(i,s):r[n]=n in e?i:s}return r};class be extends A{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const r=super._subscribe(t);return t.next(this.value),r}}function we(e){return new l(t=>{const r={};let n=Object.keys(e).length;const s=i=>o=>{i in r||n--,r[i]=o,n===0&&t.next(r)};return Object.entries(e).reduce((i,[o,u])=>i.add(u.subscribe(s(o))),new y)})}function pe(...e){return new l(t=>e.reduce((r,n)=>r.add(n.subscribe(t)),new y))}var ge=e=>new l(t=>{const r=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},e);return()=>window.clearTimeout(r)}),me=e=>new l(t=>{const r=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(r)}),Ee=e=>new l(t=>{e.forEach(r=>t.next(r))}),ve=(e,t)=>new l(r=>{const n=s=>r.next(s);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function ye(e){return t=>new l(r=>t.subscribe(new Se(r,e)))}class Se{destination;size;lastValues=[];constructor(t,r){this.destination=t,this.size=r}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const Oe={leading:!1,trailing:!0};function Ae(e,t=Oe){return r=>new l(n=>r.subscribe(new xe(n,e,t)))}class xe{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,T(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const Re={leading:!0,trailing:!1};function Ce(e,t=Re){return r=>new l(n=>r.subscribe(new Le(n,e,t)))}class Le{destination;time;config;lastValue;timeout;constructor(t,r,n){this.destination=t,this.time=r,this.config=n}next(t){this.lastValue=t,I(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function _e(e){return t=>new l(r=>t.subscribe(new Pe(r,e)))}class Pe{destination;predicate;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.predicate(t)}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Te(e=(t,r)=>t===r){return t=>new l(r=>t.subscribe(new Ie(r,e)))}const _={};class Ie{destination;predicate;lastValue=_;constructor(t,r){this.destination=t,this.predicate=r}next(t){let r;try{r=this.lastValue===_||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}r&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Q(e){return t=>new l(r=>t.subscribe(new Ne(r,e)))}let Ne=class{destination;mapper;constructor(t,r){this.destination=t,this.mapper=r}next(t){let r;try{r=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(r)}error(t){this.destination.error?.(t)}};function Me(e){return Q(()=>e)}function Qe(){return e=>new l(t=>{let r=!1,n=!1;const s=e.subscribe(i=>{r||(r=!0,t.next(i)),n&&s.unsubscribe()},i=>{r=!0,t.error?.(i),n&&s.unsubscribe()});return n=!0,r&&s.unsubscribe(),s})}function Ve(){return e=>new l(t=>e.subscribe(new De(t)))}class De{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const r=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,t])}error(t){this.destination.error?.(t)}}function je(e){return t=>new l(r=>t.subscribe(new ke(r,e)))}class ke{destination;effect;constructor(t,r){this.destination=t,this.effect=r}next(t){try{this.effect(t)}catch(r){throw this.error(r),r}this.destination.next(t)}error(t){this.destination.error?.(t)}}exports.ErrorCategory=void 0;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(exports.ErrorCategory||(exports.ErrorCategory={}));class P{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,r,n){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:r,options:n})}removeEventListener(t,r){if(!(t in this.listeners))return;const n=this.listeners[t];for(let s=0,i=n.length;s<i;s++)if(n[s].callback===r){n.splice(s,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const n=this.listeners[t.type].slice();for(let s=0,i=n.length;s<i;s++){const o=n[s];try{o.callback.call(this,t)}catch(u){Promise.resolve().then(()=>{throw u})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class V extends P{constructor(){super(),this.listeners||P.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class qe{constructor(){Object.defineProperty(this,"signal",{value:new V,writable:!0,configurable:!0})}abort(t){let r;try{r=new Event("abort")}catch{typeof document<"u"?document.createEvent?(r=document.createEvent("Event"),r.initEvent("abort",!1,!1)):(r=document.createEventObject(),r.type="abort"):r={type:"abort",bubbles:!1,cancelable:!1}}let n=t;if(n===void 0)if(typeof document>"u")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch{n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(r)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(qe.prototype[Symbol.toStringTag]="AbortController",V.prototype[Symbol.toStringTag]="AbortSignal");function D(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 Fe(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:r=t.Request,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s=!1}=e;if(!D({fetch:t,Request:r,AbortController:n,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:s}))return{fetch:t,Request:i};let i=r;(i&&!i.prototype.hasOwnProperty("signal")||s)&&(i=function(c,f){let b;f&&f.signal&&(b=f.signal,delete f.signal);const g=new r(c,f);return b&&Object.defineProperty(g,"signal",{writable:!1,enumerable:!1,configurable:!0,value:b}),g},i.prototype=r.prototype);const o=t;return{fetch:(h,c)=>{const f=i&&i.prototype.isPrototypeOf(h)?h.signal:c?c.signal:void 0;if(f){let b;try{b=new DOMException("Aborted","AbortError")}catch{b=new Error("Aborted"),b.name="AbortError"}if(f.aborted)return Promise.reject(b);const g=new Promise((S,k)=>{f.addEventListener("abort",()=>k(b),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([g,o(h,c)])}return o(h,c)},Request:i}}const L=D({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),j=L?Fe({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,Ue=L?j.fetch:window.fetch;L?j.Request:window.Request;exports.VKNumericLanguage=void 0;(function(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"})(exports.VKNumericLanguage||(exports.VKNumericLanguage={}));const Ge="vk.com",Be=async(e,t,r)=>{const n=new URL(`https://${Ge}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",t),e!==void 0&&n.searchParams.set("lang",e);const i=await(await Ue(n.toString())).json();return ze(i,r)},ze=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([r,n])=>[r.substring(`${t}_`.length),He(n)])),He=e=>Array.isArray(e)?e[0]:e;exports.InterfaceLanguage=void 0;(function(e){e.RU="ru",e.EN="en"})(exports.InterfaceLanguage||(exports.InterfaceLanguage={}));exports.Logger=U;exports.Observable=l;exports.Subject=A;exports.Subscription=y;exports.VERSION=q;exports.ValueSubject=be;exports.abortable=$;exports.addScript=z;exports.areQualitiesExact=he;exports.assertNever=p;exports.assertNonNullable=G;exports.assertNullable=B;exports.assertQualityIsExact=fe;exports.buffer=ye;exports.checkNever=F;exports.combine=we;exports.debounce=Ae;exports.fillWithDefault=M;exports.filter=_e;exports.filterChanged=Te;exports.fromEvent=ve;exports.getCurrentBrowser=x;exports.getExponentialDelay=X;exports.getHighestQuality=ce;exports.getIOSVersion=W;exports.interval=me;exports.isHigher=se;exports.isHigherOrEqual=oe;exports.isIOS=Y;exports.isInvariantQuality=C;exports.isLower=R;exports.isLowerOrEqual=ae;exports.isMacLike=K;exports.isNonNullable=T;exports.isNullable=I;exports.loadVKLangPack=Be;exports.map=Q;exports.mapTo=Me;exports.merge=pe;exports.noop=m;exports.now=H;exports.observableFrom=Ee;exports.once=Qe;exports.pairwise=Ve;exports.safeStorage=ie;exports.tap=je;exports.throttle=Ce;exports.timeout=ge;exports.videoHeightToQuality=le;exports.videoQualityToHeight=de;exports.videoSizeToQuality=ue;
|
package/esnext.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.31-dev.
|
|
3
|
-
* Fri, 27 Oct 2023 13:
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.31-dev.c49c485.0
|
|
3
|
+
* Fri, 27 Oct 2023 13:12:50 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-31/doc/
|
|
5
5
|
*/
|
|
6
|
-
const be="1.0.31-dev.88984b6.0";class v{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const S=e=>{throw new Error(`${e} is value of unexpected type`)},pe=e=>{},y=()=>{};class u{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:y}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:y,error:y};const i=typeof t=="function"?{next:o=>{try{t(o)}catch(d){r.next(d)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let s;try{s=this._subscribe(i)}catch(o){i.error?.(o)}return new v().add(()=>{switch(i.next=y,i.error=y,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return S(s)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class N extends u{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new v().add(()=>this.subscribers.delete(n))}}class we{log$=new N;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function me(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ge(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function V(e){return typeof e<"u"&&e!==null}function D(e){return e==null}const Ee=(e,t,n)=>new Promise((r,i)=>{t.addEventListener("abort",()=>{d(),c.remove()});const s=()=>{d(),i()},o=()=>{d(),r()},d=()=>{b&&clearTimeout(b),c.removeEventListener("load",o),c.removeEventListener("error",s)};let b;n&&(b=window.setTimeout(s,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",s),c.src=e,document.head.appendChild(c)}),Se=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),Oe=(e,t)=>async(...n)=>{const r=t(...n);let i=e.aborted,s;for(;!i&&!e.aborted;){const o=await r.next(s);i=o.done??!1,s=o.value}return s};var m;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(m||(m={}));var l;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(l||(l={}));const j=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?m.Yandex:void 0,n=/chrome|crios/i.test(e)?m.Chrome:void 0,r=/chromium/i.test(e)?m.Chromium:void 0,i=/firefox|fxios/i.test(e)?m.Firefox:void 0,s=/webkit|safari|khtml/i.test(e)?m.Safari:void 0,o=/opr\//i.test(e)?m.Opera:void 0,d=/edg/i.test(e)?m.Edge:void 0,b=/android/i.test(e)?l.Android:void 0,c=/iphone/i.test(e)?l.iPhone:void 0,p=/ipad/i.test(e)?l.iPad:void 0,w=/ipod/i.test(e)?l.iPod:void 0,E=/mac/i.test(e)?l.Mac:void 0,x=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?l.RestMobile:void 0;return{browser:t||i||o||d||n||r||s||m.Rest,device:b||c||p||w||x||E||l.Desktop}},Ae=(e=!1)=>{const n=[l.iPhone,l.iPad,l.iPod].includes(j().device);if(!e)return n;const{userAgent:r,maxTouchPoints:i}=window.navigator;return!!(n||/macintosh/i.test(r)&&i>0)},ye=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},ve=()=>[l.Mac,l.iPhone,l.iPad,l.iPod].includes(j().device),xe=(e,{start:t=0,factor:n=2,max:r=1/0,min:i=t,random:s=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*s*2-s),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,i),o};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let O,g;const R=`vk-videoplayer-dummy-key-${Math.random()}`,A=()=>{if(g!==void 0)return g;try{localStorage.setItem(R,"test"),localStorage.removeItem(R),g=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(R),g=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)g=a.RUNTIME;else throw t}else throw e}return g===a.RUNTIME&&(O=new Map),g},z=()=>A()===a.LOCAL_STORAGE,$=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return O?.get(e);default:S(t)}},Y=(e,t)=>{const n=A();switch(n){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case a.RUNTIME:return void O?.set(e,t);default:S(n)}},H=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return O?.has(e)??!1;default:return S(t),!1}},W=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void O?.delete(e);default:S(t)}},B=()=>{const e=A();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return O?.clear();default:S(e)}};var Re=Object.freeze({__proto__:null,clear:B,get:$,has:H,isPersistent:z,remove:W,set:Y}),h;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(h||(h={}));const f={[h.Q_144P]:{width:256,height:144},[h.Q_240P]:{width:428,height:240},[h.Q_360P]:{width:640,height:360},[h.Q_480P]:{width:856,height:480},[h.Q_720P]:{width:1280,height:720},[h.Q_1080P]:{width:1920,height:1080},[h.Q_1440P]:{width:2560,height:1440},[h.Q_2160P]:{width:3840,height:2160},[h.Q_4320P]:{width:7680,height:4320}},_e=(e,t)=>f[e].height>f[t].height,Pe=(e,t)=>f[e].height>=f[t].height,k=(e,t)=>f[e].height<f[t].height,Le=(e,t)=>f[e].height<=f[t].height,Te=e=>e.sort((t,n)=>t===n?0:t===h.INVARIANT?1:n===h.INVARIANT?-1:k(t,n)?1:-1)[0],q=Object.keys(f).sort((e,t)=>k(e,t)?-1:1),Ie=(e,t=.02)=>[...q].find(r=>f[r].height*(1+t)>=e),Me=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return q.find(i=>{const s=f[i];return s.width>=r&&s.height>=n})},Ne=e=>f[e].height,F=e=>e===h.INVARIANT,je=e=>e.every(t=>!F(t));function ke(e){if(F(e))throw new Error("Expected exact quality")}const X=(e,t)=>{const n={};for(const r of Object.keys(t)){const i=t[r],s=e[r];Array.isArray(i)&&Array.isArray(s)?n[r]=s:typeof i=="object"&&typeof s=="object"?n[r]=X(s,i):n[r]=r in e?s:i}return n};class qe extends N{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function Fe(e){return new u(t=>{const n={};let r=Object.keys(e).length;const i=s=>o=>{s in n||r--,n[s]=o,r===0&&t.next(n)};return Object.entries(e).reduce((s,[o,d])=>s.add(d.subscribe(i(o))),new v)})}function Ce(...e){return new u(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new v))}var Qe=e=>new u(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),Ue=e=>new u(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),Ge=e=>new u(t=>{e.forEach(n=>t.next(n))}),Ve=(e,t)=>new u(n=>{const r=i=>n.next(i);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function De(e){return t=>new u(n=>t.subscribe(new J(n,e)))}class J{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const Z={leading:!1,trailing:!0};function ze(e,t=Z){return n=>new u(r=>n.subscribe(new K(r,e,t)))}class K{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,V(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const ee={leading:!0,trailing:!1};function $e(e,t=ee){return n=>new u(r=>n.subscribe(new te(r,e,t)))}class te{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,D(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function Ye(e){return t=>new u(n=>t.subscribe(new ne(n,e)))}class ne{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function He(e=(t,n)=>t===n){return t=>new u(n=>t.subscribe(new re(n,e)))}const P={};class re{destination;predicate;lastValue=P;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===P||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function se(e){return t=>new u(n=>t.subscribe(new ie(n,e)))}let ie=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function Be(e){return se(()=>e)}function Xe(){return e=>new u(t=>{let n=!1,r=!1;const i=e.subscribe(s=>{n||(n=!0,t.next(s)),r&&i.unsubscribe()},s=>{n=!0,t.error?.(s),r&&i.unsubscribe()});return r=!0,n&&i.unsubscribe(),i})}function Je(){return e=>new u(t=>e.subscribe(new oe(t)))}class oe{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function Ze(e){return t=>new u(n=>t.subscribe(new ae(n,e)))}class ae{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var L;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(L||(L={}));class T{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let i=0,s=r.length;i<s;i++)if(r[i].callback===n){r.splice(i,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let i=0,s=r.length;i<s;i++){const o=r[i];try{o.callback.call(this,t)}catch(d){Promise.resolve().then(()=>{throw d})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class C extends T{constructor(){super(),this.listeners||T.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class ce{constructor(){Object.defineProperty(this,"signal",{value:new C,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(ce.prototype[Symbol.toStringTag]="AbortController",C.prototype[Symbol.toStringTag]="AbortSignal");function Q(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 le(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!Q({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:s};let s=n;(s&&!s.prototype.hasOwnProperty("signal")||i)&&(s=function(c,p){let w;p&&p.signal&&(w=p.signal,delete p.signal);const E=new n(c,p);return w&&Object.defineProperty(E,"signal",{writable:!1,enumerable:!1,configurable:!0,value:w}),E},s.prototype=n.prototype);const o=t;return{fetch:(b,c)=>{const p=s&&s.prototype.isPrototypeOf(b)?b.signal:c?c.signal:void 0;if(p){let w;try{w=new DOMException("Aborted","AbortError")}catch{w=new Error("Aborted"),w.name="AbortError"}if(p.aborted)return Promise.reject(w);const E=new Promise((x,G)=>{p.addEventListener("abort",()=>G(w),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([E,o(b,c)])}return o(b,c)},Request:s}}const _=Q({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),U=_?le({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,ue=_?U.fetch:window.fetch;_?U.Request:window.Request;var I;(function(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"})(I||(I={}));const he="vk.com",Ke=async(e,t,n)=>{const r=new URL(`https://${he}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const s=await(await ue(r.toString())).json();return de(s,n)},de=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),fe(r)])),fe=e=>Array.isArray(e)?e[0]:e;var M;(function(e){e.RU="ru",e.EN="en"})(M||(M={}));export{m as CurrentClientBrowser,l as CurrentClientDevice,L as ErrorCategory,M as InterfaceLanguage,we as Logger,u as Observable,N as Subject,v as Subscription,be as VERSION,I as VKNumericLanguage,qe as ValueSubject,h as VideoQuality,Oe as abortable,Ee as addScript,je as areQualitiesExact,S as assertNever,me as assertNonNullable,ge as assertNullable,ke as assertQualityIsExact,De as buffer,pe as checkNever,Fe as combine,ze as debounce,X as fillWithDefault,Ye as filter,He as filterChanged,Ve as fromEvent,j as getCurrentBrowser,xe as getExponentialDelay,Te as getHighestQuality,ye as getIOSVersion,Ue as interval,_e as isHigher,Pe as isHigherOrEqual,Ae as isIOS,F as isInvariantQuality,k as isLower,Le as isLowerOrEqual,ve as isMacLike,V as isNonNullable,D as isNullable,Ke as loadVKLangPack,se as map,Be as mapTo,Ce as merge,y as noop,Se as now,Ge as observableFrom,Xe as once,Je as pairwise,Re as safeStorage,Ze as tap,$e as throttle,Qe as timeout,Ie as videoHeightToQuality,Ne as videoQualityToHeight,Me as videoSizeToQuality};
|
|
6
|
+
const be="1.0.31-dev.c49c485.0";class v{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(n=>typeof n=="function"?n():n.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const S=e=>{throw new Error(`${e} is value of unexpected type`)},pe=e=>{},y=()=>{};class u{constructor(t){t&&(this._subscribe=t)}subscribe(t,n){let r;n?typeof n=="function"?r={next:n,error:y}:r={next:o=>n.next(o),error:o=>n.error?.(o)}:r={next:y,error:y};const i=typeof t=="function"?{next:o=>{try{t(o)}catch(d){r.next(d)}},error:o=>r.next(o)}:{next:o=>t.next(o),error:o=>t.error?t.error(o):r.next(o)};let s;try{s=this._subscribe(i)}catch(o){i.error?.(o)}return new v().add(()=>{switch(i.next=y,i.error=y,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return S(s)}})}pipe(...t){return t.reduce((n,r)=>r(n),this)}_subscribe(t){}}class N extends u{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(n=>n.next(t))}error(t){this.subscribers.forEach(n=>n.error?.(t))}_subscribe(t){const n=this.keyCounter++;return this.subscribers.set(n,t),new v().add(()=>this.subscribers.delete(n))}}class we{log$=new N;logs=[];log=t=>{const n={...t,timestamp:Date.now()};this.logs.push(n),this.log$.next(n)};createCustomLog(t){return(...n)=>{let r;try{r=t(...n)}catch{r={message:"error in `createCustomLog`",component:"Logger"}}this.log(r)}}createComponentLog(t){return this.createCustomLog(n=>({component:t,...n}))}getAllLogs=()=>this.logs}function me(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ge(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function V(e){return typeof e<"u"&&e!==null}function D(e){return e==null}const Ee=(e,t,n)=>new Promise((r,i)=>{t.addEventListener("abort",()=>{d(),c.remove()});const s=()=>{d(),i()},o=()=>{d(),r()},d=()=>{b&&clearTimeout(b),c.removeEventListener("load",o),c.removeEventListener("error",s)};let b;n&&(b=window.setTimeout(s,n));const c=document.createElement("script");c.addEventListener("load",o),c.addEventListener("error",s),c.src=e,document.head.appendChild(c)}),Se=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),Oe=(e,t)=>async(...n)=>{const r=t(...n);let i=e.aborted,s;for(;!i&&!e.aborted;){const o=await r.next(s);i=o.done??!1,s=o.value}return s};var m;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(m||(m={}));var l;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(l||(l={}));const j=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?m.Yandex:void 0,n=/chrome|crios/i.test(e)?m.Chrome:void 0,r=/chromium/i.test(e)?m.Chromium:void 0,i=/firefox|fxios/i.test(e)?m.Firefox:void 0,s=/webkit|safari|khtml/i.test(e)?m.Safari:void 0,o=/opr\//i.test(e)?m.Opera:void 0,d=/edg/i.test(e)?m.Edge:void 0,b=/android/i.test(e)?l.Android:void 0,c=/iphone/i.test(e)?l.iPhone:void 0,p=/ipad/i.test(e)?l.iPad:void 0,w=/ipod/i.test(e)?l.iPod:void 0,E=/mac/i.test(e)?l.Mac:void 0,x=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?l.RestMobile:void 0;return{browser:t||i||o||d||n||r||s||m.Rest,device:b||c||p||w||x||E||l.Desktop}},Ae=(e=!1)=>{const n=[l.iPhone,l.iPad,l.iPod].includes(j().device);if(!e)return n;const{userAgent:r,maxTouchPoints:i}=window.navigator;return!!(n||/macintosh/i.test(r)&&i>0)},ye=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const n=t[1],r=parseFloat(n);return isNaN(r)?null:r},ve=()=>[l.Mac,l.iPhone,l.iPad,l.iPod].includes(j().device),xe=(e,{start:t=0,factor:n=2,max:r=1/0,min:i=t,random:s=0}={})=>{let o=t;return o*=n**e,o*=1+(Math.random()*s*2-s),o=Math.round(o),o=Math.min(o,r),o=Math.max(o,i),o};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let O,g;const R=`vk-videoplayer-dummy-key-${Math.random()}`,A=()=>{if(g!==void 0)return g;try{localStorage.setItem(R,"test"),localStorage.removeItem(R),g=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(R),g=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)g=a.RUNTIME;else throw t}else throw e}return g===a.RUNTIME&&(O=new Map),g},z=()=>A()===a.LOCAL_STORAGE,$=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return O?.get(e);default:S(t)}},Y=(e,t)=>{const n=A();switch(n){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(r){if(r instanceof DOMException)console.error(r);else throw r}break;case a.RUNTIME:return void O?.set(e,t);default:S(n)}},H=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return O?.has(e)??!1;default:return S(t),!1}},W=e=>{const t=A();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void O?.delete(e);default:S(t)}},B=()=>{const e=A();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return O?.clear();default:S(e)}};var Re=Object.freeze({__proto__:null,clear:B,get:$,has:H,isPersistent:z,remove:W,set:Y}),h;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(h||(h={}));const f={[h.Q_144P]:{width:256,height:144},[h.Q_240P]:{width:428,height:240},[h.Q_360P]:{width:640,height:360},[h.Q_480P]:{width:856,height:480},[h.Q_720P]:{width:1280,height:720},[h.Q_1080P]:{width:1920,height:1080},[h.Q_1440P]:{width:2560,height:1440},[h.Q_2160P]:{width:3840,height:2160},[h.Q_4320P]:{width:7680,height:4320}},_e=(e,t)=>f[e].height>f[t].height,Pe=(e,t)=>f[e].height>=f[t].height,k=(e,t)=>f[e].height<f[t].height,Le=(e,t)=>f[e].height<=f[t].height,Te=e=>e.sort((t,n)=>t===n?0:t===h.INVARIANT?1:n===h.INVARIANT?-1:k(t,n)?1:-1)[0],q=Object.keys(f).sort((e,t)=>k(e,t)?-1:1),Ie=(e,t=.02)=>[...q].find(r=>f[r].height*(1+t)>=e),Me=({width:e,height:t})=>{const n=Math.min(e,t),r=Math.max(e,t);return q.find(i=>{const s=f[i];return s.width>=r&&s.height>=n})},Ne=e=>f[e].height,F=e=>e===h.INVARIANT,je=e=>e.every(t=>!F(t));function ke(e){if(F(e))throw new Error("Expected exact quality")}const X=(e,t)=>{const n={};for(const r of Object.keys(t)){const i=t[r],s=e[r];Array.isArray(i)&&Array.isArray(s)?n[r]=s:typeof i=="object"&&typeof s=="object"?n[r]=X(s,i):n[r]=r in e?s:i}return n};class qe extends N{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const n=super._subscribe(t);return t.next(this.value),n}}function Fe(e){return new u(t=>{const n={};let r=Object.keys(e).length;const i=s=>o=>{s in n||r--,n[s]=o,r===0&&t.next(n)};return Object.entries(e).reduce((s,[o,d])=>s.add(d.subscribe(i(o))),new v)})}function Ce(...e){return new u(t=>e.reduce((n,r)=>n.add(r.subscribe(t)),new v))}var Qe=e=>new u(t=>{const n=window.setTimeout(()=>{try{t.next()}catch(r){if(t.error)t.error(r);else throw r}},e);return()=>window.clearTimeout(n)}),Ue=e=>new u(t=>{const n=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(n)}),Ge=e=>new u(t=>{e.forEach(n=>t.next(n))}),Ve=(e,t)=>new u(n=>{const r=i=>n.next(i);return e.addEventListener(t,r),()=>e.removeEventListener(t,r)});function De(e){return t=>new u(n=>t.subscribe(new J(n,e)))}class J{destination;size;lastValues=[];constructor(t,n){this.destination=t,this.size=n}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const Z={leading:!1,trailing:!0};function ze(e,t=Z){return n=>new u(r=>n.subscribe(new K(r,e,t)))}class K{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,V(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(n){if(this.destination.error)this.destination.error(n);else throw n}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const ee={leading:!0,trailing:!1};function $e(e,t=ee){return n=>new u(r=>n.subscribe(new te(r,e,t)))}class te{destination;time;config;lastValue;timeout;constructor(t,n,r){this.destination=t,this.time=n,this.config=r}next(t){this.lastValue=t,D(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function Ye(e){return t=>new u(n=>t.subscribe(new ne(n,e)))}class ne{destination;predicate;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.predicate(t)}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function He(e=(t,n)=>t===n){return t=>new u(n=>t.subscribe(new re(n,e)))}const P={};class re{destination;predicate;lastValue=P;constructor(t,n){this.destination=t,this.predicate=n}next(t){let n;try{n=this.lastValue===P||!this.predicate(this.lastValue,t),this.lastValue=t}catch(r){throw this.error(r),r}n&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function se(e){return t=>new u(n=>t.subscribe(new ie(n,e)))}let ie=class{destination;mapper;constructor(t,n){this.destination=t,this.mapper=n}next(t){let n;try{n=this.mapper(t)}catch(r){throw this.error(r),r}this.destination.next(n)}error(t){this.destination.error?.(t)}};function Be(e){return se(()=>e)}function Xe(){return e=>new u(t=>{let n=!1,r=!1;const i=e.subscribe(s=>{n||(n=!0,t.next(s)),r&&i.unsubscribe()},s=>{n=!0,t.error?.(s),r&&i.unsubscribe()});return r=!0,n&&i.unsubscribe(),i})}function Je(){return e=>new u(t=>e.subscribe(new oe(t)))}class oe{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const n=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([n,t])}error(t){this.destination.error?.(t)}}function Ze(e){return t=>new u(n=>t.subscribe(new ae(n,e)))}class ae{destination;effect;constructor(t,n){this.destination=t,this.effect=n}next(t){try{this.effect(t)}catch(n){throw this.error(n),n}this.destination.next(t)}error(t){this.destination.error?.(t)}}var L;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(L||(L={}));class T{constructor(){Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}addEventListener(t,n,r){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:n,options:r})}removeEventListener(t,n){if(!(t in this.listeners))return;const r=this.listeners[t];for(let i=0,s=r.length;i<s;i++)if(r[i].callback===n){r.splice(i,1);return}}dispatchEvent(t){if(!(t.type in this.listeners))return;const r=this.listeners[t.type].slice();for(let i=0,s=r.length;i<s;i++){const o=r[i];try{o.callback.call(this,t)}catch(d){Promise.resolve().then(()=>{throw d})}o.options&&o.options.once&&this.removeEventListener(t.type,o.callback)}return!t.defaultPrevented}}class C extends T{constructor(){super(),this.listeners||T.call(this),Object.defineProperty(this,"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"onabort",{value:null,writable:!0,configurable:!0}),Object.defineProperty(this,"reason",{value:void 0,writable:!0,configurable:!0})}toString(){return"[object AbortSignal]"}dispatchEvent(t){t.type==="abort"&&(this.aborted=!0,typeof this.onabort=="function"&&this.onabort.call(this,t)),super.dispatchEvent(t)}}class ce{constructor(){Object.defineProperty(this,"signal",{value:new C,writable:!0,configurable:!0})}abort(t){let n;try{n=new Event("abort")}catch{typeof document<"u"?document.createEvent?(n=document.createEvent("Event"),n.initEvent("abort",!1,!1)):(n=document.createEventObject(),n.type="abort"):n={type:"abort",bubbles:!1,cancelable:!1}}let r=t;if(r===void 0)if(typeof document>"u")r=new Error("This operation was aborted"),r.name="AbortError";else try{r=new DOMException("signal is aborted without reason")}catch{r=new Error("This operation was aborted"),r.name="AbortError"}this.signal.reason=r,this.signal.dispatchEvent(n)}toString(){return"[object AbortController]"}}typeof Symbol<"u"&&Symbol.toStringTag&&(ce.prototype[Symbol.toStringTag]="AbortController",C.prototype[Symbol.toStringTag]="AbortSignal");function Q(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 le(e){typeof e=="function"&&(e={fetch:e});const{fetch:t,Request:n=t.Request,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i=!1}=e;if(!Q({fetch:t,Request:n,AbortController:r,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:s};let s=n;(s&&!s.prototype.hasOwnProperty("signal")||i)&&(s=function(c,p){let w;p&&p.signal&&(w=p.signal,delete p.signal);const E=new n(c,p);return w&&Object.defineProperty(E,"signal",{writable:!1,enumerable:!1,configurable:!0,value:w}),E},s.prototype=n.prototype);const o=t;return{fetch:(b,c)=>{const p=s&&s.prototype.isPrototypeOf(b)?b.signal:c?c.signal:void 0;if(p){let w;try{w=new DOMException("Aborted","AbortError")}catch{w=new Error("Aborted"),w.name="AbortError"}if(p.aborted)return Promise.reject(w);const E=new Promise((x,G)=>{p.addEventListener("abort",()=>G(w),{once:!0})});return c&&c.signal&&delete c.signal,Promise.race([E,o(b,c)])}return o(b,c)},Request:s}}const _=Q({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}),U=_?le({fetch:window.fetch,Request:window.Request,AbortController:window.AbortController}):void 0,ue=_?U.fetch:window.fetch;_?U.Request:window.Request;var I;(function(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"})(I||(I={}));const he="vk.com",Ke=async(e,t,n)=>{const r=new URL(`https://${he}/js/lang-pack.js`);r.searchParams.set("format","json"),r.searchParams.set("name",t),e!==void 0&&r.searchParams.set("lang",e);const s=await(await ue(r.toString())).json();return de(s,n)},de=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([n,r])=>[n.substring(`${t}_`.length),fe(r)])),fe=e=>Array.isArray(e)?e[0]:e;var M;(function(e){e.RU="ru",e.EN="en"})(M||(M={}));export{m as CurrentClientBrowser,l as CurrentClientDevice,L as ErrorCategory,M as InterfaceLanguage,we as Logger,u as Observable,N as Subject,v as Subscription,be as VERSION,I as VKNumericLanguage,qe as ValueSubject,h as VideoQuality,Oe as abortable,Ee as addScript,je as areQualitiesExact,S as assertNever,me as assertNonNullable,ge as assertNullable,ke as assertQualityIsExact,De as buffer,pe as checkNever,Fe as combine,ze as debounce,X as fillWithDefault,Ye as filter,He as filterChanged,Ve as fromEvent,j as getCurrentBrowser,xe as getExponentialDelay,Te as getHighestQuality,ye as getIOSVersion,Ue as interval,_e as isHigher,Pe as isHigherOrEqual,Ae as isIOS,F as isInvariantQuality,k as isLower,Le as isLowerOrEqual,ve as isMacLike,V as isNonNullable,D as isNullable,Ke as loadVKLangPack,se as map,Be as mapTo,Ce as merge,y as noop,Se as now,Ge as observableFrom,Xe as once,Je as pairwise,Re as safeStorage,Ze as tap,$e as throttle,Qe as timeout,Ie as videoHeightToQuality,Ne as videoQualityToHeight,Me as videoSizeToQuality};
|
package/evergreen.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vkontakte/videoplayer-shared v1.0.31-dev.
|
|
3
|
-
* Fri, 27 Oct 2023 13:
|
|
2
|
+
* @vkontakte/videoplayer-shared v1.0.31-dev.c49c485.0
|
|
3
|
+
* Fri, 27 Oct 2023 13:12:50 GMT
|
|
4
4
|
* https://st.mycdn.me/static/vkontakte-videoplayer/1-0-31/doc/
|
|
5
5
|
*/
|
|
6
|
-
const re="1.0.31-dev.88984b6.0";class x{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(s=>typeof s=="function"?s():s.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const w=e=>{throw new Error(`${e} is value of unexpected type`)},oe=e=>{},S=()=>{};class u{constructor(t){t&&(this._subscribe=t)}subscribe(t,s){let n;s?typeof s=="function"?n={next:s,error:S}:n={next:r=>s.next(r),error:r=>s.error?.(r)}:n={next:S,error:S};const o=typeof t=="function"?{next:r=>{try{t(r)}catch(f){n.next(f)}},error:r=>n.next(r)}:{next:r=>t.next(r),error:r=>t.error?t.error(r):n.next(r)};let i;try{i=this._subscribe(o)}catch(r){o.error?.(r)}return new x().add(()=>{switch(o.next=S,o.error=S,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return w(i)}})}pipe(...t){return t.reduce((s,n)=>n(s),this)}_subscribe(t){}}class I extends u{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(s=>s.next(t))}error(t){this.subscribers.forEach(s=>s.error?.(t))}_subscribe(t){const s=this.keyCounter++;return this.subscribers.set(s,t),new x().add(()=>this.subscribers.delete(s))}}class ae{log$=new I;logs=[];log=t=>{const s={...t,timestamp:Date.now()};this.logs.push(s),this.log$.next(s)};createCustomLog(t){return(...s)=>{let n;try{n=t(...s)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(s=>({component:t,...s}))}getAllLogs=()=>this.logs}function ce(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ue(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function U(e){return typeof e<"u"&&e!==null}function j(e){return e==null}const he=(e,t,s)=>new Promise((n,o)=>{t.addEventListener("abort",()=>{f(),b.remove()});const i=()=>{f(),o()},r=()=>{f(),n()},f=()=>{E&&clearTimeout(E),b.removeEventListener("load",r),b.removeEventListener("error",i)};let E;s&&(E=window.setTimeout(i,s));const b=document.createElement("script");b.addEventListener("load",r),b.addEventListener("error",i),b.src=e,document.head.appendChild(b)}),de=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),le=(e,t)=>async(...s)=>{const n=t(...s);let o=e.aborted,i;for(;!o&&!e.aborted;){const r=await n.next(i);o=r.done??!1,i=r.value}return i};var l;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(l||(l={}));var c;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(c||(c={}));const T=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?l.Yandex:void 0,s=/chrome|crios/i.test(e)?l.Chrome:void 0,n=/chromium/i.test(e)?l.Chromium:void 0,o=/firefox|fxios/i.test(e)?l.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?l.Safari:void 0,r=/opr\//i.test(e)?l.Opera:void 0,f=/edg/i.test(e)?l.Edge:void 0,E=/android/i.test(e)?c.Android:void 0,b=/iphone/i.test(e)?c.iPhone:void 0,L=/ipad/i.test(e)?c.iPad:void 0,N=/ipod/i.test(e)?c.iPod:void 0,k=/mac/i.test(e)?c.Mac:void 0,Q=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?c.RestMobile:void 0;return{browser:t||o||r||f||s||n||i||l.Rest,device:E||b||L||N||Q||k||c.Desktop}},fe=(e=!1)=>{const s=[c.iPhone,c.iPad,c.iPod].includes(T().device);if(!e)return s;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(s||/macintosh/i.test(n)&&o>0)},be=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const s=t[1],n=parseFloat(s);return isNaN(n)?null:n},me=()=>[c.Mac,c.iPhone,c.iPad,c.iPod].includes(T().device),we=(e,{start:t=0,factor:s=2,max:n=1/0,min:o=t,random:i=0}={})=>{let r=t;return r*=s**e,r*=1+(Math.random()*i*2-i),r=Math.round(r),r=Math.min(r,n),r=Math.max(r,o),r};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let p,m;const O=`vk-videoplayer-dummy-key-${Math.random()}`,g=()=>{if(m!==void 0)return m;try{localStorage.setItem(O,"test"),localStorage.removeItem(O),m=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(O),m=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)m=a.RUNTIME;else throw t}else throw e}return m===a.RUNTIME&&(p=new Map),m},G=()=>g()===a.LOCAL_STORAGE,V=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return p?.get(e);default:w(t)}},D=(e,t)=>{const s=g();switch(s){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.RUNTIME:return void p?.set(e,t);default:w(s)}},F=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return p?.has(e)??!1;default:return w(t),!1}},z=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void p?.delete(e);default:w(t)}},$=()=>{const e=g();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return p?.clear();default:w(e)}};var pe=Object.freeze({__proto__:null,clear:$,get:V,has:F,isPersistent:G,remove:z,set:D}),h;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(h||(h={}));const d={[h.Q_144P]:{width:256,height:144},[h.Q_240P]:{width:428,height:240},[h.Q_360P]:{width:640,height:360},[h.Q_480P]:{width:856,height:480},[h.Q_720P]:{width:1280,height:720},[h.Q_1080P]:{width:1920,height:1080},[h.Q_1440P]:{width:2560,height:1440},[h.Q_2160P]:{width:3840,height:2160},[h.Q_4320P]:{width:7680,height:4320}},ge=(e,t)=>d[e].height>d[t].height,Ee=(e,t)=>d[e].height>=d[t].height,R=(e,t)=>d[e].height<d[t].height,Se=(e,t)=>d[e].height<=d[t].height,xe=e=>e.sort((t,s)=>t===s?0:t===h.INVARIANT?1:s===h.INVARIANT?-1:R(t,s)?1:-1)[0],y=Object.keys(d).sort((e,t)=>R(e,t)?-1:1),Oe=(e,t=.02)=>[...y].find(n=>d[n].height*(1+t)>=e),Ae=({width:e,height:t})=>{const s=Math.min(e,t),n=Math.max(e,t);return y.find(o=>{const i=d[o];return i.width>=n&&i.height>=s})},ve=e=>d[e].height,M=e=>e===h.INVARIANT,_e=e=>e.every(t=>!M(t));function Pe(e){if(M(e))throw new Error("Expected exact quality")}const q=(e,t)=>{const s={};for(const n of Object.keys(t)){const o=t[n],i=e[n];Array.isArray(o)&&Array.isArray(i)?s[n]=i:typeof o=="object"&&typeof i=="object"?s[n]=q(i,o):s[n]=n in e?i:o}return s};class Ie extends I{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const s=super._subscribe(t);return t.next(this.value),s}}function Te(e){return new u(t=>{const s={};let n=Object.keys(e).length;const o=i=>r=>{i in s||n--,s[i]=r,n===0&&t.next(s)};return Object.entries(e).reduce((i,[r,f])=>i.add(f.subscribe(o(r))),new x)})}function Re(...e){return new u(t=>e.reduce((s,n)=>s.add(n.subscribe(t)),new x))}var ye=e=>new u(t=>{const s=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},e);return()=>window.clearTimeout(s)}),Me=e=>new u(t=>{const s=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(s)}),Le=e=>new u(t=>{e.forEach(s=>t.next(s))}),Ne=(e,t)=>new u(s=>{const n=o=>s.next(o);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function ke(e){return t=>new u(s=>t.subscribe(new H(s,e)))}class H{destination;size;lastValues=[];constructor(t,s){this.destination=t,this.size=s}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const Y={leading:!1,trailing:!0};function Qe(e,t=Y){return s=>new u(n=>s.subscribe(new W(n,e,t)))}class W{destination;time;config;lastValue;timeout;constructor(t,s,n){this.destination=t,this.time=s,this.config=n}next(t){this.lastValue=t,U(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(s){if(this.destination.error)this.destination.error(s);else throw s}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const X={leading:!0,trailing:!1};function Ue(e,t=X){return s=>new u(n=>s.subscribe(new C(n,e,t)))}class C{destination;time;config;lastValue;timeout;constructor(t,s,n){this.destination=t,this.time=s,this.config=n}next(t){this.lastValue=t,j(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function je(e){return t=>new u(s=>t.subscribe(new J(s,e)))}class J{destination;predicate;constructor(t,s){this.destination=t,this.predicate=s}next(t){let s;try{s=this.predicate(t)}catch(n){throw this.error(n),n}s&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Ge(e=(t,s)=>t===s){return t=>new u(s=>t.subscribe(new Z(s,e)))}const A={};class Z{destination;predicate;lastValue=A;constructor(t,s){this.destination=t,this.predicate=s}next(t){let s;try{s=this.lastValue===A||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}s&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function B(e){return t=>new u(s=>t.subscribe(new K(s,e)))}let K=class{destination;mapper;constructor(t,s){this.destination=t,this.mapper=s}next(t){let s;try{s=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(s)}error(t){this.destination.error?.(t)}};function De(e){return B(()=>e)}function Fe(){return e=>new u(t=>{let s=!1,n=!1;const o=e.subscribe(i=>{s||(s=!0,t.next(i)),n&&o.unsubscribe()},i=>{s=!0,t.error?.(i),n&&o.unsubscribe()});return n=!0,s&&o.unsubscribe(),o})}function ze(){return e=>new u(t=>e.subscribe(new ee(t)))}class ee{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const s=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([s,t])}error(t){this.destination.error?.(t)}}function $e(e){return t=>new u(s=>t.subscribe(new te(s,e)))}class te{destination;effect;constructor(t,s){this.destination=t,this.effect=s}next(t){try{this.effect(t)}catch(s){throw this.error(s),s}this.destination.next(t)}error(t){this.destination.error?.(t)}}var v;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(v||(v={}));var _;(function(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"})(_||(_={}));const se="vk.com",qe=async(e,t,s)=>{const n=new URL(`https://${se}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",t),e!==void 0&&n.searchParams.set("lang",e);const i=await(await fetch(n.toString())).json();return ne(i,s)},ne=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([s,n])=>[s.substring(`${t}_`.length),ie(n)])),ie=e=>Array.isArray(e)?e[0]:e;var P;(function(e){e.RU="ru",e.EN="en"})(P||(P={}));export{l as CurrentClientBrowser,c as CurrentClientDevice,v as ErrorCategory,P as InterfaceLanguage,ae as Logger,u as Observable,I as Subject,x as Subscription,re as VERSION,_ as VKNumericLanguage,Ie as ValueSubject,h as VideoQuality,le as abortable,he as addScript,_e as areQualitiesExact,w as assertNever,ce as assertNonNullable,ue as assertNullable,Pe as assertQualityIsExact,ke as buffer,oe as checkNever,Te as combine,Qe as debounce,q as fillWithDefault,je as filter,Ge as filterChanged,Ne as fromEvent,T as getCurrentBrowser,we as getExponentialDelay,xe as getHighestQuality,be as getIOSVersion,Me as interval,ge as isHigher,Ee as isHigherOrEqual,fe as isIOS,M as isInvariantQuality,R as isLower,Se as isLowerOrEqual,me as isMacLike,U as isNonNullable,j as isNullable,qe as loadVKLangPack,B as map,De as mapTo,Re as merge,S as noop,de as now,Le as observableFrom,Fe as once,ze as pairwise,pe as safeStorage,$e as tap,Ue as throttle,ye as timeout,Oe as videoHeightToQuality,ve as videoQualityToHeight,Ae as videoSizeToQuality};
|
|
6
|
+
const re="1.0.31-dev.c49c485.0";class x{subscriptions=[];unsubscribe(){const t=this.subscriptions;this.subscriptions=[],t.forEach(s=>typeof s=="function"?s():s.unsubscribe())}add(t){return this.subscriptions.push(t),this}}const w=e=>{throw new Error(`${e} is value of unexpected type`)},oe=e=>{},S=()=>{};class u{constructor(t){t&&(this._subscribe=t)}subscribe(t,s){let n;s?typeof s=="function"?n={next:s,error:S}:n={next:r=>s.next(r),error:r=>s.error?.(r)}:n={next:S,error:S};const o=typeof t=="function"?{next:r=>{try{t(r)}catch(f){n.next(f)}},error:r=>n.next(r)}:{next:r=>t.next(r),error:r=>t.error?t.error(r):n.next(r)};let i;try{i=this._subscribe(o)}catch(r){o.error?.(r)}return new x().add(()=>{switch(o.next=S,o.error=S,typeof i){case"function":i();return;case"object":i.unsubscribe();return;case"undefined":return;default:return w(i)}})}pipe(...t){return t.reduce((s,n)=>n(s),this)}_subscribe(t){}}class I extends u{keyCounter=0;subscribers=new Map;constructor(){super()}next(t){this.subscribers.forEach(s=>s.next(t))}error(t){this.subscribers.forEach(s=>s.error?.(t))}_subscribe(t){const s=this.keyCounter++;return this.subscribers.set(s,t),new x().add(()=>this.subscribers.delete(s))}}class ae{log$=new I;logs=[];log=t=>{const s={...t,timestamp:Date.now()};this.logs.push(s),this.log$.next(s)};createCustomLog(t){return(...s)=>{let n;try{n=t(...s)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(t){return this.createCustomLog(s=>({component:t,...s}))}getAllLogs=()=>this.logs}function ce(e,t='Assertion "value is not nullable" failed'){if(e==null)throw new Error(t)}function ue(e,t='Assertion "value is nullable" failed'){if(e!=null)throw new Error(t)}function U(e){return typeof e<"u"&&e!==null}function j(e){return e==null}const he=(e,t,s)=>new Promise((n,o)=>{t.addEventListener("abort",()=>{f(),b.remove()});const i=()=>{f(),o()},r=()=>{f(),n()},f=()=>{E&&clearTimeout(E),b.removeEventListener("load",r),b.removeEventListener("error",i)};let E;s&&(E=window.setTimeout(i,s));const b=document.createElement("script");b.addEventListener("load",r),b.addEventListener("error",i),b.src=e,document.head.appendChild(b)}),de=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now(),le=(e,t)=>async(...s)=>{const n=t(...s);let o=e.aborted,i;for(;!o&&!e.aborted;){const r=await n.next(i);o=r.done??!1,i=r.value}return i};var l;(function(e){e.Unknown="Unknown",e.Yandex="Yandex",e.Chrome="Chrome",e.Chromium="Chromium",e.Firefox="Firefox",e.Safari="Safari",e.Opera="Opera",e.Edge="Edge",e.Rest="Rest"})(l||(l={}));var c;(function(e){e.Unknown="Unknown",e.Android="Android",e.iPhone="iPhone",e.iPad="iPad",e.iPod="iPod",e.RestMobile="RestMobile",e.Mac="Mac",e.Desktop="Desktop"})(c||(c={}));const T=()=>{const{userAgent:e}=window.navigator,t=/yabrowser/i.test(e)?l.Yandex:void 0,s=/chrome|crios/i.test(e)?l.Chrome:void 0,n=/chromium/i.test(e)?l.Chromium:void 0,o=/firefox|fxios/i.test(e)?l.Firefox:void 0,i=/webkit|safari|khtml/i.test(e)?l.Safari:void 0,r=/opr\//i.test(e)?l.Opera:void 0,f=/edg/i.test(e)?l.Edge:void 0,E=/android/i.test(e)?c.Android:void 0,b=/iphone/i.test(e)?c.iPhone:void 0,L=/ipad/i.test(e)?c.iPad:void 0,N=/ipod/i.test(e)?c.iPod:void 0,k=/mac/i.test(e)?c.Mac:void 0,Q=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?c.RestMobile:void 0;return{browser:t||o||r||f||s||n||i||l.Rest,device:E||b||L||N||Q||k||c.Desktop}},fe=(e=!1)=>{const s=[c.iPhone,c.iPad,c.iPod].includes(T().device);if(!e)return s;const{userAgent:n,maxTouchPoints:o}=window.navigator;return!!(s||/macintosh/i.test(n)&&o>0)},be=()=>{const{userAgent:e}=window.navigator,t=e.match(/Version\/(\d+(\.\d+)?)/i);if(!t)return null;const s=t[1],n=parseFloat(s);return isNaN(n)?null:n},me=()=>[c.Mac,c.iPhone,c.iPad,c.iPod].includes(T().device),we=(e,{start:t=0,factor:s=2,max:n=1/0,min:o=t,random:i=0}={})=>{let r=t;return r*=s**e,r*=1+(Math.random()*i*2-i),r=Math.round(r),r=Math.min(r,n),r=Math.max(r,o),r};var a;(function(e){e[e.LOCAL_STORAGE=0]="LOCAL_STORAGE",e[e.SESSION_STORAGE=1]="SESSION_STORAGE",e[e.RUNTIME=2]="RUNTIME"})(a||(a={}));let p,m;const O=`vk-videoplayer-dummy-key-${Math.random()}`,g=()=>{if(m!==void 0)return m;try{localStorage.setItem(O,"test"),localStorage.removeItem(O),m=a.LOCAL_STORAGE}catch(e){if(e instanceof DOMException||e instanceof TypeError)try{sessionStorage.getItem(O),m=a.SESSION_STORAGE}catch(t){if(t instanceof DOMException||t instanceof TypeError)m=a.RUNTIME;else throw t}else throw e}return m===a.RUNTIME&&(p=new Map),m},G=()=>g()===a.LOCAL_STORAGE,V=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return localStorage.getItem(e)??void 0;case a.SESSION_STORAGE:return sessionStorage.getItem(e)??void 0;case a.RUNTIME:return p?.get(e);default:w(t)}},D=(e,t)=>{const s=g();switch(s){case a.LOCAL_STORAGE:try{localStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.SESSION_STORAGE:try{sessionStorage.setItem(e,t)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case a.RUNTIME:return void p?.set(e,t);default:w(s)}},F=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return e in localStorage;case a.SESSION_STORAGE:return e in sessionStorage;case a.RUNTIME:return p?.has(e)??!1;default:return w(t),!1}},z=e=>{const t=g();switch(t){case a.LOCAL_STORAGE:return localStorage.removeItem(e);case a.SESSION_STORAGE:return sessionStorage.removeItem(e);case a.RUNTIME:return void p?.delete(e);default:w(t)}},$=()=>{const e=g();switch(e){case a.LOCAL_STORAGE:return localStorage.clear();case a.SESSION_STORAGE:return sessionStorage.clear();case a.RUNTIME:return p?.clear();default:w(e)}};var pe=Object.freeze({__proto__:null,clear:$,get:V,has:F,isPersistent:G,remove:z,set:D}),h;(function(e){e.INVARIANT="Invariant quality",e.Q_144P="144p",e.Q_240P="240p",e.Q_360P="360p",e.Q_480P="480p",e.Q_720P="720p",e.Q_1080P="1080p",e.Q_1440P="1440p",e.Q_2160P="2160p",e.Q_4320P="4320p"})(h||(h={}));const d={[h.Q_144P]:{width:256,height:144},[h.Q_240P]:{width:428,height:240},[h.Q_360P]:{width:640,height:360},[h.Q_480P]:{width:856,height:480},[h.Q_720P]:{width:1280,height:720},[h.Q_1080P]:{width:1920,height:1080},[h.Q_1440P]:{width:2560,height:1440},[h.Q_2160P]:{width:3840,height:2160},[h.Q_4320P]:{width:7680,height:4320}},ge=(e,t)=>d[e].height>d[t].height,Ee=(e,t)=>d[e].height>=d[t].height,R=(e,t)=>d[e].height<d[t].height,Se=(e,t)=>d[e].height<=d[t].height,xe=e=>e.sort((t,s)=>t===s?0:t===h.INVARIANT?1:s===h.INVARIANT?-1:R(t,s)?1:-1)[0],y=Object.keys(d).sort((e,t)=>R(e,t)?-1:1),Oe=(e,t=.02)=>[...y].find(n=>d[n].height*(1+t)>=e),Ae=({width:e,height:t})=>{const s=Math.min(e,t),n=Math.max(e,t);return y.find(o=>{const i=d[o];return i.width>=n&&i.height>=s})},ve=e=>d[e].height,M=e=>e===h.INVARIANT,_e=e=>e.every(t=>!M(t));function Pe(e){if(M(e))throw new Error("Expected exact quality")}const q=(e,t)=>{const s={};for(const n of Object.keys(t)){const o=t[n],i=e[n];Array.isArray(o)&&Array.isArray(i)?s[n]=i:typeof o=="object"&&typeof i=="object"?s[n]=q(i,o):s[n]=n in e?i:o}return s};class Ie extends I{value;constructor(t){super(),this.value=t}next(t){super.next(this.value=t)}error(t){super.error(this.value=t)}getValue(){return this.value}_subscribe(t){const s=super._subscribe(t);return t.next(this.value),s}}function Te(e){return new u(t=>{const s={};let n=Object.keys(e).length;const o=i=>r=>{i in s||n--,s[i]=r,n===0&&t.next(s)};return Object.entries(e).reduce((i,[r,f])=>i.add(f.subscribe(o(r))),new x)})}function Re(...e){return new u(t=>e.reduce((s,n)=>s.add(n.subscribe(t)),new x))}var ye=e=>new u(t=>{const s=window.setTimeout(()=>{try{t.next()}catch(n){if(t.error)t.error(n);else throw n}},e);return()=>window.clearTimeout(s)}),Me=e=>new u(t=>{const s=window.setInterval(()=>t.next(),e);return()=>window.clearInterval(s)}),Le=e=>new u(t=>{e.forEach(s=>t.next(s))}),Ne=(e,t)=>new u(s=>{const n=o=>s.next(o);return e.addEventListener(t,n),()=>e.removeEventListener(t,n)});function ke(e){return t=>new u(s=>t.subscribe(new H(s,e)))}class H{destination;size;lastValues=[];constructor(t,s){this.destination=t,this.size=s}next(t){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(t),this.destination.next(this.lastValues)}error(t){this.destination.error?.(t)}}const Y={leading:!1,trailing:!0};function Qe(e,t=Y){return s=>new u(n=>s.subscribe(new W(n,e,t)))}class W{destination;time;config;lastValue;timeout;constructor(t,s,n){this.destination=t,this.time=s,this.config=n}next(t){this.lastValue=t,U(this.timeout)?window.clearTimeout(this.timeout):this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{if(this.config.trailing)try{this.destination.next(this.lastValue)}catch(s){if(this.destination.error)this.destination.error(s);else throw s}this.timeout=void 0},this.time)}error(t){this.destination.error?.(t)}}const X={leading:!0,trailing:!1};function Ue(e,t=X){return s=>new u(n=>s.subscribe(new C(n,e,t)))}class C{destination;time;config;lastValue;timeout;constructor(t,s,n){this.destination=t,this.time=s,this.config=n}next(t){this.lastValue=t,j(this.timeout)&&(this.config.leading&&this.destination.next(t),this.timeout=window.setTimeout(()=>{this.config.trailing&&this.destination.next(this.lastValue),this.timeout=void 0},this.time))}error(t){this.destination.error?.(t)}}function je(e){return t=>new u(s=>t.subscribe(new J(s,e)))}class J{destination;predicate;constructor(t,s){this.destination=t,this.predicate=s}next(t){let s;try{s=this.predicate(t)}catch(n){throw this.error(n),n}s&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function Ge(e=(t,s)=>t===s){return t=>new u(s=>t.subscribe(new Z(s,e)))}const A={};class Z{destination;predicate;lastValue=A;constructor(t,s){this.destination=t,this.predicate=s}next(t){let s;try{s=this.lastValue===A||!this.predicate(this.lastValue,t),this.lastValue=t}catch(n){throw this.error(n),n}s&&this.destination.next(t)}error(t){this.destination.error?.(t)}}function B(e){return t=>new u(s=>t.subscribe(new K(s,e)))}let K=class{destination;mapper;constructor(t,s){this.destination=t,this.mapper=s}next(t){let s;try{s=this.mapper(t)}catch(n){throw this.error(n),n}this.destination.next(s)}error(t){this.destination.error?.(t)}};function De(e){return B(()=>e)}function Fe(){return e=>new u(t=>{let s=!1,n=!1;const o=e.subscribe(i=>{s||(s=!0,t.next(i)),n&&o.unsubscribe()},i=>{s=!0,t.error?.(i),n&&o.unsubscribe()});return n=!0,s&&o.unsubscribe(),o})}function ze(){return e=>new u(t=>e.subscribe(new ee(t)))}class ee{destination;last;hasLast=!1;constructor(t){this.destination=t}next(t){const s=this.last;if(this.last=t,!this.hasLast){this.hasLast=!0;return}this.destination.next([s,t])}error(t){this.destination.error?.(t)}}function $e(e){return t=>new u(s=>t.subscribe(new te(s,e)))}class te{destination;effect;constructor(t,s){this.destination=t,this.effect=s}next(t){try{this.effect(t)}catch(s){throw this.error(s),s}this.destination.next(t)}error(t){this.destination.error?.(t)}}var v;(function(e){e.NETWORK="network",e.VIDEO_PIPELINE="video_pipeline",e.EXTERNAL_API="external_api",e.PARSER="parser",e.DOM="dom",e.WTF="wtf"})(v||(v={}));var _;(function(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"})(_||(_={}));const se="vk.com",qe=async(e,t,s)=>{const n=new URL(`https://${se}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",t),e!==void 0&&n.searchParams.set("lang",e);const i=await(await fetch(n.toString())).json();return ne(i,s)},ne=(e,t)=>Object.fromEntries(Object.entries(e.keys).map(([s,n])=>[s.substring(`${t}_`.length),ie(n)])),ie=e=>Array.isArray(e)?e[0]:e;var P;(function(e){e.RU="ru",e.EN="en"})(P||(P={}));export{l as CurrentClientBrowser,c as CurrentClientDevice,v as ErrorCategory,P as InterfaceLanguage,ae as Logger,u as Observable,I as Subject,x as Subscription,re as VERSION,_ as VKNumericLanguage,Ie as ValueSubject,h as VideoQuality,le as abortable,he as addScript,_e as areQualitiesExact,w as assertNever,ce as assertNonNullable,ue as assertNullable,Pe as assertQualityIsExact,ke as buffer,oe as checkNever,Te as combine,Qe as debounce,q as fillWithDefault,je as filter,Ge as filterChanged,Ne as fromEvent,T as getCurrentBrowser,we as getExponentialDelay,xe as getHighestQuality,be as getIOSVersion,Me as interval,ge as isHigher,Ee as isHigherOrEqual,fe as isIOS,M as isInvariantQuality,R as isLower,Se as isLowerOrEqual,me as isMacLike,U as isNonNullable,j as isNullable,qe as loadVKLangPack,B as map,De as mapTo,Re as merge,S as noop,de as now,Le as observableFrom,Fe as once,ze as pairwise,pe as safeStorage,$e as tap,Ue as throttle,ye as timeout,Oe as videoHeightToQuality,ve as videoQualityToHeight,Ae as videoSizeToQuality};
|