@vkontakte/videoplayer-shared 1.0.56-dev.65054ff5.0 → 1.0.56-dev.ca9f83cf.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/evergreen.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @vkontakte/videoplayer-shared v1.0.56-dev.65054ff5.0
3
- * Mon, 03 Mar 2025 09:02:53 GMT
2
+ * @vkontakte/videoplayer-shared v1.0.56-dev.ca9f83cf.0
3
+ * Wed, 05 Mar 2025 10:38:44 GMT
4
4
  * https://st.mycdn.me/static/vkontakte-videoplayer/1-0-56/doc/
5
5
  */
6
- var Pe=Object.defineProperty;var oe=(t,e)=>{for(var r in e)Pe(t,r,{get:e[r],enumerable:!0})};var Le="1.0.56-dev.65054ff5.0";var b=class{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(e){return this.subscriptions.push(e),this}};var T=t=>{throw new Error(`${t} is value of unexpected type`)},Me=t=>{};var g=()=>{};var c=class{constructor(e){e&&(this._subscribe=e)}subscribe(e,r){let n;r?typeof r=="function"?n={next:r,error:g}:n={next:o=>r.next(o),error:o=>r.error?.(o)}:n={next:g,error:g};let i=typeof e=="function"?{next:o=>{try{let a=e(o);a instanceof Promise&&a.catch(p=>n.next(p))}catch(a){n.next(a)}},error:o=>n.next(o)}:{next:o=>e.next(o),error:o=>e.error?e.error(o):n.next(o)},s;try{s=this._subscribe(i)}catch(o){i.error?.(o)}return new b().add(()=>{switch(i.next=g,i.error=g,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return T(s)}})}pipe(...e){return e.reduce((r,n)=>n(r),this)}_subscribe(e){}};var v=class extends c{constructor(){super();this.keyCounter=0;this.subscribers=new Map}next(r){this.subscribers.forEach(n=>n.next(r))}error(r){this.subscribers.forEach(n=>n.error?.(r))}_subscribe(r){let n=this.keyCounter++;return this.subscribers.set(n,r),new b().add(()=>this.subscribers.delete(n))}};var V=class{constructor(){this.log$=new v;this.logs=[];this.log=e=>{let r={...e,timestamp:Date.now()};this.logs.push(r),this.log$.next(r)};this.getAllLogs=()=>this.logs}createCustomLog(e){return(...r)=>{let n;try{n=e(...r)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(r=>({component:e,...r}))}};import{trace as Ve,context as _e}from"@opentelemetry/api";import{TracerAllSpansProcessor as Ne,TracerMemorySpanExporter as se,initTracerOpenTelemetry as De}from"@tracer/opentelemetry";var _=class t{constructor({name:e}){}log(e,r){}error(e,r){}critical(e,r){}createComponentTracer(e){return new t({name:e})}end(){}getFinishedSpans(){}getTraceId(){return this.fakeTraceId}},N=class t{constructor({name:e,parentContext:r,tracer:n}){this.childTracers=[];let i=!n;if(i){let o=De({serviceName:"videoplayer-sdk-web",appToken:"L9SBoka6ZWk4xPjaK7tmfSfYvMhcge7nvGDjpdMmscb",spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0}}).getProvider(),a=new se,p=new se;this.spanExporter=a,o.addSpanProcessor(new Ne({startedSpansExporter:a,endedSpansExporter:p})),this.tracer=o.getTracer("sdk-videoplayer-tracer")}else this.tracer=n;this.span=this.tracer.startSpan(e,{root:i},r),this.context=Ve.setSpan(_e.active(),this.span)}log(e,r){this.span.addEvent(e,{...r,type:"log"})}error(e,r){this.span.addEvent(e,{...r,type:"error"})}critical(e,r){this.span.addEvent(e,{...r,type:"critical"})}static createRootTracer(e=!1){return e?new t({name:"Root"}):new _({name:"Root"})}createComponentTracer(e){let r=new t({name:e,parentContext:this.context,tracer:this.tracer});return this.childTracers.push(r),r}end(){this.childTracers.forEach(e=>e.end()),this.span.end()}getFinishedSpans(){return this.spanExporter?.getJsonData()}getTraceId(){return this.span.spanContext().traceId}};function Qe(t,e='Assertion "value is not nullable" failed'){if(t==null)throw new Error(e)}function Ue(t,e='Assertion "value is nullable" failed'){if(t!=null)throw new Error(e)}function x(t){return typeof t<"u"&&t!==null}function D(t){return t==null}function je(t,e){if(!t?.length)throw new Error(e)}function Be(t,e){if(t?.length)throw new Error(e)}var Fe=(t,e,r)=>new Promise((n,i)=>{e.addEventListener("abort",()=>{a(),d.remove()});let s=()=>{a(),i("error")},o=()=>{a(),n()},a=()=>{p&&clearTimeout(p),d.removeEventListener("load",o),d.removeEventListener("error",s)},p;r&&(p=window.setTimeout(()=>{a(),i("timeout")},r));let d=document.createElement("script");d.addEventListener("load",o),d.addEventListener("error",s),d.src=t,document.head.appendChild(d)});var We=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now();var ze=(t,e)=>async(...r)=>{let n=e(...r),i=t.aborted,s;for(;!i&&!t.aborted;)try{let o=await n.next(s);i=o.done??!1,s=o.value}catch(o){await n.throw(o)}return s};var ae=()=>/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(navigator.appVersion??navigator.userAgent)||navigator?.userAgentData?.mobile,Q=class{constructor(){this.detect()}get browser(){return this._currentBrowser}get device(){return this._currentDevice}get isTouch(){return this._maxTouchPoints>0}get isIOS(){return["iPhone","iPad","iPod"].includes(this.device)}get isMac(){return this.device==="Mac"}get isApple(){return this.isIOS||this.isMac}get isIphoneOrOldIpad(){if(!this.isApple||!this.isTouch)return!1;let e=this.device==="iPad"||window?.screen.width>700,r=this._iosVersion;return!e||e&&!!r&&r<16}get isAndroid(){return this.device==="Android"}get isMobile(){return this._isMobile}get iOSVersion(){return this._iosVersion}get macVersion(){return this._macVersion}get isYandex(){return this.browser==="Yandex"}get isSafari(){return this.browser==="Safari"}get isSamsungBrowser(){return this.browser==="SamsungBrowser"}get isHDR(){return this._isHdr}detect(){let{userAgent:e,maxTouchPoints:r}=navigator;try{this._maxTouchPoints=r,this._isHdr=!!matchMedia("(dynamic-range: high)")?.matches}catch(n){console.error(n)}try{this._isMobile=ae()}catch(n){console.error(n)}this.detectBrowser(e),this.detectDevice(e),this.isIOS&&this.detectIOSVersion(),this.isMac&&this.detectMacVersion()}detectBrowser(e){try{let r=/yabrowser/i.test(e)?"Yandex":void 0,n=/samsungbrowser/i.test(e)?"SamsungBrowser":void 0,i=/chrome|crios/i.test(e)?"Chrome":void 0,s=/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,p=/opr\//i.test(e)?"Opera":void 0,d=/edg/i.test(e)?"Edge":void 0;this._currentBrowser=r||n||o||p||d||i||s||a||"Rest"}catch(r){console.error(r)}}detectDevice(e){try{let r=/android/i.test(e)?"Android":void 0,n=/iphone/i.test(e)?"iPhone":void 0,i=/ipad/i.test(e)?"iPad":void 0,s=/ipod/i.test(e)?"iPod":void 0,o=/mac/i.test(e)?"Mac":void 0,a=/webOS|BlackBerry|IEMobile|Opera Mini/i.test(e)?"RestMobile":void 0;this._currentDevice=r||n||i||s||a||o||"Desktop"}catch(r){console.error(r)}}detectIOSVersion(){try{let{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+(\.\d+)?)/i);if(!r)return;let n=r[1],i=parseFloat(n);if(isNaN(i))return;this._iosVersion=i}catch(e){console.error(e)}}detectMacVersion(){try{let{userAgent:e}=window.navigator,r=e.match(/Version\/(\d+)/);if(!r)return;let n=r[1],i=parseInt(n,10);if(isNaN(i))return;this._macVersion=i}catch(e){console.error(e)}}},Ge=new Q;var Ke=(t,{start:e=0,factor:r=2,max:n=1/0,min:i=e,random:s=0}={})=>{let o=e;return o*=r**t,o*=1+(Math.random()*s*2-s),o=Math.round(o),o=Math.min(o,n),o=Math.max(o,i),o};var ce={};oe(ce,{clear:()=>Je,get:()=>qe,has:()=>$e,isPersistent:()=>He,remove:()=>Xe,set:()=>Ye});var y,I,U=`vk-videoplayer-dummy-key-${Math.random()}`,O=()=>{if(I!==void 0)return I;try{localStorage.setItem(U,"test"),localStorage.removeItem(U),I=0}catch(t){if(t instanceof DOMException||t instanceof TypeError)try{sessionStorage.getItem(U),I=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)I=2;else throw e}else throw t}return I===2&&(y=new Map),I},He=()=>O()===0,qe=t=>{let e=O();switch(e){case 0:return localStorage.getItem(t)??void 0;case 1:return sessionStorage.getItem(t)??void 0;case 2:return y?.get(t);default:T(e)}},Ye=(t,e)=>{let r=O();switch(r){case 0:try{localStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 1:try{sessionStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 2:y?.set(t,e);return;default:T(r)}},$e=t=>{let e=O();switch(e){case 0:return t in localStorage;case 1:return t in sessionStorage;case 2:return y?.has(t)??!1;default:return T(e),!1}},Xe=t=>{let e=O();switch(e){case 0:return localStorage.removeItem(t);case 1:return sessionStorage.removeItem(t);case 2:y?.delete(t);return;default:T(e)}},Je=()=>{let t=O();switch(t){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return y?.clear();default:T(t)}};var Ze=()=>{let t,e=[];try{t=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?t=!0:(t=!1,console.error(r))}try{window.location.ancestorOrigins&&(e=[...window.location.ancestorOrigins])}catch(r){console.error(r)}try{!e.length&&document.referrer&&(e=[new URL(document.referrer).origin])}catch(r){console.error(r)}return{isEmbed:t,origins:e,topOrigin:e.at(-1),immediateOrigin:e.at(0)}};var j=(l=>(l.INVARIANT="Invariant quality",l.Q_144P="144p",l.Q_240P="240p",l.Q_360P="360p",l.Q_480P="480p",l.Q_576P="576p",l.Q_720P="720p",l.Q_1080P="1080p",l.Q_1440P="1440p",l.Q_2160P="2160p",l.Q_4320P="4320p",l))(j||{});var f={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},et=(t,e)=>f[t].height>f[e].height,tt=(t,e)=>f[t].height>=f[e].height,B=(t,e)=>f[t].height<f[e].height,rt=(t,e)=>f[t].height<=f[e].height,nt=t=>t.sort((e,r)=>e===r?0:e==="Invariant quality"?1:r==="Invariant quality"?-1:B(e,r)?1:-1)[0],le=Object.keys(f).sort((t,e)=>B(t,e)?-1:1),it=(t,e=.02)=>[...le].find(n=>f[n].height*(1+e)>=t),ot=({width:t,height:e})=>{let r=Math.min(t,e),n=Math.max(t,e);return le.find(i=>{let s=f[i];return s.width>=n&&s.height>=r})},st=t=>f[t].height,F=t=>t==="Invariant quality",at=t=>t.every(e=>!F(e));function ct(t){if(F(t))throw new Error("Expected exact quality")}var lt=(t,e)=>{let r={};for(let n of Object.keys(e)){let i=e[n],s=t[n];Array.isArray(i)&&Array.isArray(s)?r[n]=s:typeof i=="object"&&typeof s=="object"?r[n]=lt(s,i):r[n]=n in t?s:i}return r};var xr=t=>{let e="";return t>=3600&&(e+=Math.floor(t/3600)+"h",t=t%3600),t>=60&&(e+=Math.floor(t/60)+"m",t=t%60),t>0&&(e+=Math.floor(t)+"s"),e};function W(t,e=0,r){let n,i,s,o,a,p,d=0,ee=!1,l=!1,L=!0,te=!e&&e!==0&&typeof window.requestAnimationFrame=="function";r&&(ee=!!r.leading,l="maxWait"in r,s=r?.maxWait?Math.max(+r?.maxWait||0,e):s,L="trailing"in r?!!r.trailing:L);function M(u){let m=n,h=i;return n=i=void 0,d=u,o=t.apply(h,m),o}function E(u,m){return te?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(u)):setTimeout(u,m)}function Ee(u){if(te){window.cancelAnimationFrame(u);return}clearTimeout(u)}function Se(u){return d=u,a=E(S,e),ee?M(u):o}function Re(u){let m=u-p,h=u-d,ie=e-m;return l?Math.min(ie,s-h):ie}function re(u){let m=u-p,h=u-d;return p===void 0||m>=e||m<0||l&&h>=s}function S(){let u=Date.now();if(re(u))return ne(u);a=E(S,Re(u))}function ne(u){return a=void 0,L&&n?M(u):(n=i=void 0,o)}function ke(){a!==void 0&&Ee(a),d=0,n=p=i=a=void 0}function Ae(){return a===void 0?o:ne(Date.now())}function Ce(){return a!==void 0}function R(...u){let m=Date.now(),h=re(m);if(n=u,i=this,p=m,h){if(a===void 0)return Se(p);if(l)return a=E(S,e),M(p)}return a===void 0&&(a=E(S,e)),o}return R.cancel=ke,R.flush=Ae,R.pending=Ce,R}var z=(t,e=0,r)=>W(t,e,{...{leading:!0,trailing:!0},...r,maxWait:e});var k=(t,e)=>{if(t===null||typeof t!="object")return t;let r=Array.isArray(t)?[]:{};for(let n in t){if(typeof e=="function"){let i=e(t[n],n,t,r);if(i!==void 0){r[n]=i;continue}}typeof t[n]=="object"?r[n]=k(t[n],e):r[n]=t[n]}return r};var ut=t=>k(t);var pt=300,dt=(t,e=pt)=>new c(r=>{let{width:n,height:i}=t.getBoundingClientRect();if(r.next({width:n,height:i}),!window.ResizeObserver)return;let s=new ResizeObserver(z(o=>{let a=o[0];if(!a)return;let p,d;a.contentBoxSize&&a.contentBoxSize[0]?(d=a.contentBoxSize[0].blockSize,p=a.contentBoxSize[0].inlineSize):a.contentRect&&(p=a.contentRect.width,d=a.contentRect.height),x(p)&&x(d)&&r.next({width:p,height:d})},e));return s.observe(t),()=>s.disconnect()});var A=(t,e=6,r=".")=>{let n={};for(let i in t)if(!(!t.hasOwnProperty(i)||t[i]instanceof HTMLElement||!e))if(typeof t[i]=="object"&&t[i]!==null){let s=A(t[i],e-1);for(let o in s)s.hasOwnProperty(o)&&(n[i+r+o]=s[o])}else n[i]=t[i];return n};var bt=t=>{t.removeAttribute("src"),t.load()};var Vr=t=>{let e;try{e=new URL(t)}catch{return!1}return e.protocol==="https:"};var Nr=t=>{try{return new URL(t)}catch{return null}};var ft=t=>e=>r=>{let n=typeof r=="object";r==null||n&&!Object.keys(r).length||t(e,n?A(r):{value:r})};var C=class extends v{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){let r=super._subscribe(e);return e.next(this.value),r}};function ue(t){return new c(e=>{let r={},n=Object.keys(t).length,i=s=>o=>{s in r||n--,r[s]=o,n===0&&e.next(r)};return Object.entries(t).reduce((s,[o,a])=>s.add(a.subscribe(i(o))),new b)})}function pe(...t){return new c(e=>t.reduce((r,n)=>r.add(n.subscribe(e)),new b))}var mt=t=>new c(e=>{let r=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},t);return()=>window.clearTimeout(r)});var Tt=t=>new c(e=>{let r=window.setInterval(()=>e.next(),t);return()=>{r&&(window.clearInterval(r),r=void 0)}});var vt=t=>new c(e=>{t.forEach(r=>e.next(r))});var ht=(t,e)=>new c(r=>{let n=i=>r.next(i);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)});function de(t){return e=>new c(r=>e.subscribe(new G(r,t)))}var G=class{constructor(e,r){this.destination=e;this.size=r;this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){this.destination.error?.(e)}};var gt={leading:!1,trailing:!0};function be(t,e=gt){return r=>new c(n=>r.subscribe(new K(n,t,e)))}var K=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,x(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(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(e){this.destination.error?.(e)}};var It={leading:!0,trailing:!1};function fe(t,e=It){return r=>new c(n=>r.subscribe(new H(n,t,e)))}var H=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,D(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){this.destination.error?.(e)}};function me(t){return e=>new c(r=>e.subscribe(new q(r,t)))}var q=class{constructor(e,r){this.destination=e;this.predicate=r}next(e){let r;try{r=this.predicate(e)}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){this.destination.error?.(e)}};var xt=(t,e)=>{let r=(n,i)=>{let s=Object.keys(n);for(let o in i)if(!s.includes(o)||i[o]!==n[o])return!1;return!0};return r(t,e)&&r(e,t)},yt=(t,e)=>t instanceof Object&&e instanceof Object?xt(t,e):t===e;function ve(t=yt){return e=>new c(r=>e.subscribe(new Y(r,t)))}var Te={},Y=class{constructor(e,r){this.destination=e;this.predicate=r;this.lastValue=Te}next(e){let r;try{r=this.lastValue===Te||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object?{...e}:e}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){this.destination.error?.(e)}};function P(t){return e=>new c(r=>e.subscribe(new $(r,t)))}var $=class{constructor(e,r){this.destination=e;this.mapper=r}next(e){let r;try{r=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(r)}error(e){this.destination.error?.(e)}};function he(t){return P(()=>t)}function ge(){return t=>new c(e=>{let r=!1,n=!1,i=t.subscribe(s=>{r||(r=!0,e.next(s)),n&&i.unsubscribe()},s=>{r=!0,e.error?.(s),n&&i.unsubscribe()});return n=!0,r&&i.unsubscribe(),i})}function Ie(){return t=>new c(e=>t.subscribe(new X(e)))}var X=class{constructor(e){this.destination=e;this.hasLast=!1}next(e){let r=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,e])}error(e){this.destination.error?.(e)}};function xe(t){return e=>new c(r=>e.subscribe(new J(r,t)))}var J=class{constructor(e,r){this.destination=e;this.effect=r}next(e){try{this.effect(e)}catch(r){throw this.error(r),r}this.destination.next(e)}error(e){this.destination.error?.(e)}};function ye(t){return e=>new c(r=>e.subscribe(new Z(r,t)))}var Z=class{constructor(e,r){this.destination=e;this.count=r;r<0&&this.destination.error?.(new Error("Count can not be less than zero"))}next(e){this.count===0?this.destination.next(e):this.count--}error(e){this.destination.error?.(e)}};var Ot=(a=>(a.NETWORK="network",a.VIDEO_PIPELINE="video_pipeline",a.EXTERNAL_API="external_api",a.PARSER="parser",a.DOM="dom",a.WTF="wtf",a.FATAL="fatal",a))(Ot||{});var wt=(l=>(l.Armenian="58",l.Azerbaijani="57",l.Belarusian="114",l.English="3",l.Kazakh="97",l.Portuguese="73",l.Russian="0",l.Spanish="4",l.Ukrainian="1",l.Uzbek="65",l.Vietnamese="75",l))(wt||{}),Et="vk.com",Pi=async(t,e,r)=>{let n=new URL(`https://${Et}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),t!==void 0&&n.searchParams.set("lang",t);let s=await(await fetch(n.toString())).json();return St(s,r)},St=(t,e)=>Object.fromEntries(Object.entries(t.keys).map(([r,n])=>[r.substring(`${e}_`.length),Rt(n)])),Rt=t=>Array.isArray(t)?t[0]:t;var kt=(r=>(r.RU="ru",r.EN="en",r))(kt||{});var At={UI:"__vkVideoPlayer",CORE:"__vkVideoCore"},Ct=(()=>{let t=0;return()=>{let e=t;return t=(t+1)%Number.MAX_SAFE_INTEGER,e}})(),Oe=class{constructor(e){this.id=Ct();this.type=e,this.initWindowObjects()}getWindowObject(){let e=this.key();return window[e]?.[this.id]??{}}initWindowObjects(){let e=this.key();window[e]||(window[e]={}),window[e][this.id]={}}expose(e){Object.assign(this.getWindowObject(),e)}destroy(){let e=this.key();window&&window[e]&&window[e][this.id]&&(delete window[e][this.id],Object.keys(window[e]).length||delete window[e])}key(){let{type:e}=this;return At[e]}};var we={};oe(we,{create:()=>Pt,destroy:()=>Lt,push:()=>Mt,subscribe:()=>Vt});var w=new Map,Pt=(t,e)=>w.set(t,e??[]),Lt=t=>w.delete(t),Mt=(t,e)=>{let r=w.get(t);r&&(typeof r=="function"?r(e):r.push(e))},Vt=(t,e)=>{let r=w.get(t);if(r){if(r&&Array.isArray(r))for(let n of r)e(n);w.set(t,e)}};export{Ot as ErrorCategory,kt as InterfaceLanguage,Oe as InternalsExposure,V as Logger,c as Observable,v as Subject,b as Subscription,N as Tracer,Le as VERSION,wt as VKNumericLanguage,C as ValueSubject,j as VideoQuality,ze as abortable,Fe as addScript,at as areQualitiesExact,Be as assertEmptyArray,T as assertNever,Qe as assertNonNullable,je as assertNotEmptyArray,Ue as assertNullable,ct as assertQualityIsExact,de as buffer,Me as checkNever,bt as clearVideoElement,Ge as clientChecker,ut as cloneDeep,k as cloneDeepWith,ue as combine,Nr as createURL,be as debounce,W as debounceFn,Ze as detectEmbed,we as devNull,lt as fillWithDefault,me as filter,ve as filterChanged,A as flattenObject,ht as fromEvent,Ke as getExponentialDelay,nt as getHighestQuality,ft as getTraceSubscriptionMethod,Tt as interval,et as isHigher,tt as isHigherOrEqual,F as isInvariantQuality,B as isLower,rt as isLowerOrEqual,ae as isMobile,x as isNonNullable,D as isNullable,Vr as isValidURL,Pi as loadVKLangPack,P as map,he as mapTo,pe as merge,g as noop,We as now,vt as observableFrom,dt as observeElementSize,ge as once,Ie as pairwise,ce as safeStorage,ye as skip,xe as tap,fe as throttle,z as throttleFn,xr as timeCodeToString,mt as timeout,it as videoHeightToQuality,st as videoQualityToHeight,ot as videoSizeToQuality};
6
+ var ke=Object.defineProperty;var oe=(t,e)=>{for(var r in e)ke(t,r,{get:e[r],enumerable:!0})};var Le="1.0.56-dev.ca9f83cf.0";var d=class{constructor(){this.subscriptions=[]}unsubscribe(){let e=this.subscriptions;this.subscriptions=[],e.forEach(r=>typeof r=="function"?r():r.unsubscribe())}add(e){return this.subscriptions.push(e),this}};var T=t=>{throw new Error(`${t} is value of unexpected type`)},Pe=t=>{};var I=()=>{};var l=class{constructor(e){e&&(this._subscribe=e)}subscribe(e,r){let n;r?typeof r=="function"?n={next:r,error:I}:n={next:i=>r.next(i),error:i=>r.error?.(i)}:n={next:I,error:I};let o=typeof e=="function"?{next:i=>{try{let a=e(i);a instanceof Promise&&a.catch(p=>n.next(p))}catch(a){n.next(a)}},error:i=>n.next(i)}:{next:i=>e.next(i),error:i=>e.error?e.error(i):n.next(i)},s;try{s=this._subscribe(o)}catch(i){o.error?.(i)}return new d().add(()=>{switch(o.next=I,o.error=I,typeof s){case"function":s();return;case"object":s.unsubscribe();return;case"undefined":return;default:return T(s)}})}pipe(...e){return e.reduce((r,n)=>n(r),this)}_subscribe(e){}};var v=class extends l{constructor(){super();this.keyCounter=0;this.subscribers=new Map}next(r){this.subscribers.forEach(n=>n.next(r))}error(r){this.subscribers.forEach(n=>n.error?.(r))}_subscribe(r){let n=this.keyCounter++;return this.subscribers.set(n,r),new d().add(()=>this.subscribers.delete(n))}};var V=class{constructor(){this.log$=new v;this.logs=[];this.log=e=>{let r={...e,timestamp:Date.now()};this.logs.push(r),this.log$.next(r)};this.getAllLogs=()=>this.logs}createCustomLog(e){return(...r)=>{let n;try{n=e(...r)}catch{n={message:"error in `createCustomLog`",component:"Logger"}}this.log(n)}}createComponentLog(e){return this.createCustomLog(r=>({component:e,...r}))}};import{trace as Ne,context as Ce}from"@opentelemetry/api";import{TracerAllSpansProcessor as Ve,TracerMemorySpanExporter as ie,initTracerOpenTelemetry as _e}from"@tracer/opentelemetry";var _=class t{constructor({name:e}){}log(e,r){}error(e,r){}critical(e,r){}createComponentTracer(e){return new t({name:e})}end(){}getFinishedSpans(){}getTraceId(){return this.fakeTraceId}},M=class t{constructor({name:e,parentContext:r,tracer:n}){this.childTracers=[];let o=!n;if(o){let i=_e({serviceName:"videoplayer-sdk-web",appToken:"L9SBoka6ZWk4xPjaK7tmfSfYvMhcge7nvGDjpdMmscb",spanLimits:{attributeCountLimit:1/0,eventCountLimit:1/0,attributePerEventCountLimit:1/0}}).getProvider(),a=new ie,p=new ie;this.spanExporter=a,i.addSpanProcessor(new Ve({startedSpansExporter:a,endedSpansExporter:p})),this.tracer=i.getTracer("sdk-videoplayer-tracer")}else this.tracer=n;this.span=this.tracer.startSpan(e,{root:o},r),this.context=Ne.setSpan(Ce.active(),this.span)}log(e,r){this.span.addEvent(e,{...r,type:"log"})}error(e,r){this.span.addEvent(e,{...r,type:"error"})}critical(e,r){this.span.addEvent(e,{...r,type:"critical"})}static createRootTracer(e=!1){return e?new t({name:"Root"}):new _({name:"Root"})}createComponentTracer(e){let r=new t({name:e,parentContext:this.context,tracer:this.tracer});return this.childTracers.push(r),r}end(){this.childTracers.forEach(e=>e.end()),this.span.end()}getFinishedSpans(){return this.spanExporter?.getJsonData()}getTraceId(){return this.span.spanContext().traceId}};function Me(t,e='Assertion "value is not nullable" failed'){if(t==null)throw new Error(e)}function Qe(t,e='Assertion "value is nullable" failed'){if(t!=null)throw new Error(e)}function h(t){return typeof t<"u"&&t!==null}function Q(t){return t==null}function Ue(t,e){if(!t?.length)throw new Error(e)}function De(t,e){if(t?.length)throw new Error(e)}var je=(t,e,r)=>new Promise((n,o)=>{e.addEventListener("abort",()=>{a(),b.remove()});let s=()=>{a(),o("error")},i=()=>{a(),n()},a=()=>{p&&clearTimeout(p),b.removeEventListener("load",i),b.removeEventListener("error",s)},p;r&&(p=window.setTimeout(()=>{a(),o("timeout")},r));let b=document.createElement("script");b.addEventListener("load",i),b.addEventListener("error",s),b.src=t,document.head.appendChild(b)});var We=typeof window.performance?.now=="function"?()=>window.performance.now():()=>Date.now();var ze=(t,e)=>async(...r)=>{let n=e(...r),o=t.aborted,s;for(;!o&&!t.aborted;)try{let i=await n.next(s);o=i.done??!1,s=i.value}catch(i){await n.throw(i)}return s};var Ge=(t,{start:e=0,factor:r=2,max:n=1/0,min:o=e,random:s=0}={})=>{let i=e;return i*=r**t,i*=1+(Math.random()*s*2-s),i=Math.round(i),i=Math.min(i,n),i=Math.max(i,o),i};var se={};oe(se,{clear:()=>$e,get:()=>Ke,has:()=>He,isPersistent:()=>Fe,remove:()=>Be,set:()=>qe});var y,x,U=`vk-videoplayer-dummy-key-${Math.random()}`,O=()=>{if(x!==void 0)return x;try{localStorage.setItem(U,"test"),localStorage.removeItem(U),x=0}catch(t){if(t instanceof DOMException||t instanceof TypeError)try{sessionStorage.getItem(U),x=1}catch(e){if(e instanceof DOMException||e instanceof TypeError)x=2;else throw e}else throw t}return x===2&&(y=new Map),x},Fe=()=>O()===0,Ke=t=>{let e=O();switch(e){case 0:return localStorage.getItem(t)??void 0;case 1:return sessionStorage.getItem(t)??void 0;case 2:return y?.get(t);default:T(e)}},qe=(t,e)=>{let r=O();switch(r){case 0:try{localStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 1:try{sessionStorage.setItem(t,e)}catch(n){if(n instanceof DOMException)console.error(n);else throw n}break;case 2:y?.set(t,e);return;default:T(r)}},He=t=>{let e=O();switch(e){case 0:return t in localStorage;case 1:return t in sessionStorage;case 2:return y?.has(t)??!1;default:return T(e),!1}},Be=t=>{let e=O();switch(e){case 0:return localStorage.removeItem(t);case 1:return sessionStorage.removeItem(t);case 2:y?.delete(t);return;default:T(e)}},$e=()=>{let t=O();switch(t){case 0:return localStorage.clear();case 1:return sessionStorage.clear();case 2:return y?.clear();default:T(t)}};var Ye=()=>{let t,e=[];try{t=window.self!==window.top}catch(r){r instanceof DOMException&&r.name==="SecurityError"?t=!0:(t=!1,console.error(r))}try{window.location.ancestorOrigins&&(e=[...window.location.ancestorOrigins])}catch(r){console.error(r)}try{!e.length&&document.referrer&&(e=[new URL(document.referrer).origin])}catch(r){console.error(r)}return{isEmbed:t,origins:e,topOrigin:e.at(-1),immediateOrigin:e.at(0)}};var D=(c=>(c.INVARIANT="Invariant quality",c.Q_144P="144p",c.Q_240P="240p",c.Q_360P="360p",c.Q_480P="480p",c.Q_576P="576p",c.Q_720P="720p",c.Q_1080P="1080p",c.Q_1440P="1440p",c.Q_2160P="2160p",c.Q_4320P="4320p",c))(D||{});var f={"144p":{width:256,height:144},"240p":{width:428,height:240},"360p":{width:640,height:360},"480p":{width:856,height:480},"576p":{width:1024,height:576},"720p":{width:1280,height:720},"1080p":{width:1920,height:1080},"1440p":{width:2560,height:1440},"2160p":{width:3840,height:2160},"4320p":{width:7680,height:4320}},Xe=(t,e)=>f[t].height>f[e].height,Je=(t,e)=>f[t].height>=f[e].height,j=(t,e)=>f[t].height<f[e].height,Ze=(t,e)=>f[t].height<=f[e].height,et=t=>t.sort((e,r)=>e===r?0:e==="Invariant quality"?1:r==="Invariant quality"?-1:j(e,r)?1:-1)[0],ae=Object.keys(f).sort((t,e)=>j(t,e)?-1:1),tt=(t,e=.02)=>[...ae].find(n=>f[n].height*(1+e)>=t),rt=({width:t,height:e})=>{let r=Math.min(t,e),n=Math.max(t,e);return ae.find(o=>{let s=f[o];return s.width>=n&&s.height>=r})},nt=t=>f[t].height,W=t=>t==="Invariant quality",ot=t=>t.every(e=>!W(e));function it(t){if(W(t))throw new Error("Expected exact quality")}var st=(t,e)=>{let r={};for(let n of Object.keys(e)){let o=e[n],s=t[n];Array.isArray(o)&&Array.isArray(s)?r[n]=s:typeof o=="object"&&typeof s=="object"?r[n]=st(s,o):r[n]=n in t?s:o}return r};var vr=t=>{let e="";return t>=3600&&(e+=Math.floor(t/3600)+"h",t=t%3600),t>=60&&(e+=Math.floor(t/60)+"m",t=t%60),t>0&&(e+=Math.floor(t)+"s"),e};function z(t,e=0,r){let n,o,s,i,a,p,b=0,Z=!1,c=!1,N=!0,ee=!e&&e!==0&&typeof window.requestAnimationFrame=="function";r&&(Z=!!r.leading,c="maxWait"in r,s=r?.maxWait?Math.max(+r?.maxWait||0,e):s,N="trailing"in r?!!r.trailing:N);function C(u){let m=n,g=o;return n=o=void 0,b=u,i=t.apply(g,m),i}function w(u,m){return ee?(a&&window.cancelAnimationFrame(a),window.requestAnimationFrame(u)):setTimeout(u,m)}function Oe(u){if(ee){window.cancelAnimationFrame(u);return}clearTimeout(u)}function Ee(u){return b=u,a=w(S,e),Z?C(u):i}function we(u){let m=u-p,g=u-b,ne=e-m;return c?Math.min(ne,s-g):ne}function te(u){let m=u-p,g=u-b;return p===void 0||m>=e||m<0||c&&g>=s}function S(){let u=Date.now();if(te(u))return re(u);a=w(S,we(u))}function re(u){return a=void 0,N&&n?C(u):(n=o=void 0,i)}function Se(){a!==void 0&&Oe(a),b=0,n=p=o=a=void 0}function Re(){return a===void 0?i:re(Date.now())}function Ae(){return a!==void 0}function R(...u){let m=Date.now(),g=te(m);if(n=u,o=this,p=m,g){if(a===void 0)return Ee(p);if(c)return a=w(S,e),C(p)}return a===void 0&&(a=w(S,e)),i}return R.cancel=Se,R.flush=Re,R.pending=Ae,R}var G=(t,e=0,r)=>z(t,e,{...{leading:!0,trailing:!0},...r,maxWait:e});var A=(t,e)=>{if(t===null||typeof t!="object")return t;let r=Array.isArray(t)?[]:{};for(let n in t){if(typeof e=="function"){let o=e(t[n],n,t,r);if(o!==void 0){r[n]=o;continue}}typeof t[n]=="object"?r[n]=A(t[n],e):r[n]=t[n]}return r};var at=t=>A(t);var lt=300,ct=(t,e=lt)=>new l(r=>{let{width:n,height:o}=t.getBoundingClientRect();if(r.next({width:n,height:o}),!window.ResizeObserver)return;let s=new ResizeObserver(G(i=>{let a=i[0];if(!a)return;let p,b;a.contentBoxSize&&a.contentBoxSize[0]?(b=a.contentBoxSize[0].blockSize,p=a.contentBoxSize[0].inlineSize):a.contentRect&&(p=a.contentRect.width,b=a.contentRect.height),h(p)&&h(b)&&r.next({width:p,height:b})},e));return s.observe(t),()=>s.disconnect()});var k=(t,e=6,r=".")=>{let n={};for(let o in t)if(!(!t.hasOwnProperty(o)||t[o]instanceof HTMLElement||!e))if(typeof t[o]=="object"&&t[o]!==null){let s=k(t[o],e-1);for(let i in s)s.hasOwnProperty(i)&&(n[o+r+i]=s[i])}else n[o]=t[o];return n};var ut=t=>{t.removeAttribute("src"),t.load()};var Lr=t=>{let e;try{e=new URL(t)}catch{return!1}return e.protocol==="https:"};var Nr=t=>{try{return new URL(t)}catch{return null}};var pt=t=>e=>r=>{let n=typeof r=="object";r==null||n&&!Object.keys(r).length||t(e,n?k(r):{value:r})};var L=class extends v{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){let r=super._subscribe(e);return e.next(this.value),r}};function le(t){return new l(e=>{let r={},n=Object.keys(t).length,o=s=>i=>{s in r||n--,r[s]=i,n===0&&e.next(r)};return Object.entries(t).reduce((s,[i,a])=>s.add(a.subscribe(o(i))),new d)})}function ce(...t){return new l(e=>t.reduce((r,n)=>r.add(n.subscribe(e)),new d))}var bt=t=>new l(e=>{let r=window.setTimeout(()=>{try{e.next()}catch(n){if(e.error)e.error(n);else throw n}},t);return()=>window.clearTimeout(r)});var dt=t=>new l(e=>{let r=window.setInterval(()=>e.next(),t);return()=>{r&&(window.clearInterval(r),r=void 0)}});var ft=t=>new l(e=>{t.forEach(r=>e.next(r))});var mt=(t,e)=>new l(r=>{let n=o=>r.next(o);return t.addEventListener(e,n),()=>t.removeEventListener(e,n)});function ue(t){return e=>new l(r=>e.subscribe(new F(r,t)))}var F=class{constructor(e,r){this.destination=e;this.size=r;this.lastValues=[]}next(e){this.lastValues.length===this.size&&this.lastValues.shift(),this.lastValues.push(e),this.destination.next(this.lastValues)}error(e){this.destination.error?.(e)}};var Tt={leading:!1,trailing:!0};function pe(t,e=Tt){return r=>new l(n=>r.subscribe(new K(n,t,e)))}var K=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,h(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(r){if(this.destination.error)this.destination.error(r);else throw r}this.timeout=void 0},this.time)}error(e){this.destination.error?.(e)}};var vt={leading:!0,trailing:!1};function be(t,e=vt){return r=>new l(n=>r.subscribe(new q(n,t,e)))}var q=class{constructor(e,r,n){this.destination=e;this.time=r;this.config=n}next(e){this.lastValue=e,Q(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){this.destination.error?.(e)}};function de(t){return e=>new l(r=>e.subscribe(new H(r,t)))}var H=class{constructor(e,r){this.destination=e;this.predicate=r}next(e){let r;try{r=this.predicate(e)}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){this.destination.error?.(e)}};var gt=(t,e)=>{let r=(n,o)=>{let s=Object.keys(n);for(let i in o)if(!s.includes(i)||o[i]!==n[i])return!1;return!0};return r(t,e)&&r(e,t)},It=(t,e)=>t instanceof Object&&e instanceof Object?gt(t,e):t===e;function me(t=It){return e=>new l(r=>e.subscribe(new B(r,t)))}var fe={},B=class{constructor(e,r){this.destination=e;this.predicate=r;this.lastValue=fe}next(e){let r;try{r=this.lastValue===fe||!this.predicate(this.lastValue,e),this.lastValue=e instanceof Object?{...e}:e}catch(n){throw this.error(n),n}r&&this.destination.next(e)}error(e){this.destination.error?.(e)}};function P(t){return e=>new l(r=>e.subscribe(new $(r,t)))}var $=class{constructor(e,r){this.destination=e;this.mapper=r}next(e){let r;try{r=this.mapper(e)}catch(n){throw this.error(n),n}this.destination.next(r)}error(e){this.destination.error?.(e)}};function Te(t){return P(()=>t)}function ve(){return t=>new l(e=>{let r=!1,n=!1,o=t.subscribe(s=>{r||(r=!0,e.next(s)),n&&o.unsubscribe()},s=>{r=!0,e.error?.(s),n&&o.unsubscribe()});return n=!0,r&&o.unsubscribe(),o})}function ge(){return t=>new l(e=>t.subscribe(new Y(e)))}var Y=class{constructor(e){this.destination=e;this.hasLast=!1}next(e){let r=this.last;if(this.last=e,!this.hasLast){this.hasLast=!0;return}this.destination.next([r,e])}error(e){this.destination.error?.(e)}};function Ie(t){return e=>new l(r=>e.subscribe(new X(r,t)))}var X=class{constructor(e,r){this.destination=e;this.effect=r}next(e){try{this.effect(e)}catch(r){throw this.error(r),r}this.destination.next(e)}error(e){this.destination.error?.(e)}};function xe(t){return e=>new l(r=>e.subscribe(new J(r,t)))}var J=class{constructor(e,r){this.destination=e;this.count=r;r<0&&this.destination.error?.(new Error("Count can not be less than zero"))}next(e){this.count===0?this.destination.next(e):this.count--}error(e){this.destination.error?.(e)}};var xt=(a=>(a.NETWORK="network",a.VIDEO_PIPELINE="video_pipeline",a.EXTERNAL_API="external_api",a.PARSER="parser",a.DOM="dom",a.WTF="wtf",a.FATAL="fatal",a))(xt||{});var ht=(c=>(c.Armenian="58",c.Azerbaijani="57",c.Belarusian="114",c.English="3",c.Kazakh="97",c.Portuguese="73",c.Russian="0",c.Spanish="4",c.Ukrainian="1",c.Uzbek="65",c.Vietnamese="75",c))(ht||{}),yt="vk.com",Ro=async(t,e,r)=>{let n=new URL(`https://${yt}/js/lang-pack.js`);n.searchParams.set("format","json"),n.searchParams.set("name",e),t!==void 0&&n.searchParams.set("lang",t);let s=await(await fetch(n.toString())).json();return Ot(s,r)},Ot=(t,e)=>Object.fromEntries(Object.entries(t.keys).map(([r,n])=>[r.substring(`${e}_`.length),Et(n)])),Et=t=>Array.isArray(t)?t[0]:t;var wt=(r=>(r.RU="ru",r.EN="en",r))(wt||{});var St={UI:"__vkVideoPlayer",CORE:"__vkVideoCore"},Rt=(()=>{let t=0;return()=>{let e=t;return t=(t+1)%Number.MAX_SAFE_INTEGER,e}})(),he=class{constructor(e){this.id=Rt();this.type=e,this.initWindowObjects()}getWindowObject(){let e=this.key();return window[e]?.[this.id]??{}}initWindowObjects(){let e=this.key();window[e]||(window[e]={}),window[e][this.id]={}}expose(e){Object.assign(this.getWindowObject(),e)}destroy(){let e=this.key();window&&window[e]&&window[e][this.id]&&(delete window[e][this.id],Object.keys(window[e]).length||delete window[e])}key(){let{type:e}=this;return St[e]}};var ye={};oe(ye,{create:()=>At,destroy:()=>kt,push:()=>Lt,subscribe:()=>Pt});var E=new Map,At=(t,e)=>E.set(t,e??[]),kt=t=>E.delete(t),Lt=(t,e)=>{let r=E.get(t);r&&(typeof r=="function"?r(e):r.push(e))},Pt=(t,e)=>{let r=E.get(t);if(r){if(r&&Array.isArray(r))for(let n of r)e(n);E.set(t,e)}};export{xt as ErrorCategory,wt as InterfaceLanguage,he as InternalsExposure,V as Logger,l as Observable,v as Subject,d as Subscription,M as Tracer,Le as VERSION,ht as VKNumericLanguage,L as ValueSubject,D as VideoQuality,ze as abortable,je as addScript,ot as areQualitiesExact,De as assertEmptyArray,T as assertNever,Me as assertNonNullable,Ue as assertNotEmptyArray,Qe as assertNullable,it as assertQualityIsExact,ue as buffer,Pe as checkNever,ut as clearVideoElement,at as cloneDeep,A as cloneDeepWith,le as combine,Nr as createURL,pe as debounce,z as debounceFn,Ye as detectEmbed,ye as devNull,st as fillWithDefault,de as filter,me as filterChanged,k as flattenObject,mt as fromEvent,Ge as getExponentialDelay,et as getHighestQuality,pt as getTraceSubscriptionMethod,dt as interval,Xe as isHigher,Je as isHigherOrEqual,W as isInvariantQuality,j as isLower,Ze as isLowerOrEqual,h as isNonNullable,Q as isNullable,Lr as isValidURL,Ro as loadVKLangPack,P as map,Te as mapTo,ce as merge,I as noop,We as now,ft as observableFrom,ct as observeElementSize,ve as once,ge as pairwise,se as safeStorage,xe as skip,Ie as tap,be as throttle,G as throttleFn,vr as timeCodeToString,bt as timeout,tt as videoHeightToQuality,nt as videoQualityToHeight,rt as videoSizeToQuality};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-shared",
3
- "version": "1.0.56-dev.65054ff5.0",
3
+ "version": "1.0.56-dev.ca9f83cf.0",
4
4
  "author": "vk.com",
5
5
  "description": "Shared code for vk.com videoplayer",
6
6
  "homepage": "https://vk.com",
@@ -6,7 +6,6 @@ export { addScript } from './addScript';
6
6
  export type { Milliseconds, bps, Byte, Seconds, Kbps, Mbps, Percentage } from './semanticTypes';
7
7
  export { now } from './now';
8
8
  export { abortable } from './abortable';
9
- export { clientChecker, isMobile } from './clientChecker';
10
9
  export { getExponentialDelay, ExponentialBackoffConfig } from './exponentialBackoff';
11
10
  export * as safeStorage from './iframeSafeStorage';
12
11
  export { detectEmbed } from './detectEmbed';
@@ -1,54 +0,0 @@
1
- export declare enum CurrentClientBrowser {
2
- Unknown = "Unknown",
3
- Yandex = "Yandex",
4
- Chrome = "Chrome",
5
- Chromium = "Chromium",//Хром и хромиум разделяем специально. Почти единственное отличие, поддержка H.264 как раз важна для нас
6
- Firefox = "Firefox",
7
- Safari = "Safari",
8
- Opera = "Opera",
9
- Edge = "Edge",
10
- SamsungBrowser = "SamsungBrowser",
11
- Rest = "Rest"
12
- }
13
- export declare enum CurrentClientDevice {
14
- Unknown = "Unknown",
15
- Android = "Android",
16
- iPhone = "iPhone",
17
- iPad = "iPad",
18
- iPod = "iPod",
19
- RestMobile = "RestMobile",
20
- Mac = "Mac",
21
- Desktop = "Desktop"
22
- }
23
- export declare const isMobile: () => boolean;
24
- export declare class ClientChecker {
25
- private _currentBrowser;
26
- private _currentDevice;
27
- private _iosVersion;
28
- private _macVersion;
29
- private _maxTouchPoints;
30
- private _isHdr;
31
- private _isMobile;
32
- constructor();
33
- get browser(): CurrentClientBrowser;
34
- get device(): CurrentClientDevice;
35
- get isTouch(): boolean;
36
- get isIOS(): boolean;
37
- get isMac(): boolean;
38
- get isApple(): boolean;
39
- get isIphoneOrOldIpad(): boolean;
40
- get isAndroid(): boolean;
41
- get isMobile(): boolean;
42
- get iOSVersion(): number | undefined;
43
- get macVersion(): number | undefined;
44
- get isYandex(): boolean;
45
- get isSafari(): boolean;
46
- get isSamsungBrowser(): boolean;
47
- get isHDR(): boolean;
48
- detect(): void;
49
- private detectBrowser;
50
- private detectDevice;
51
- private detectIOSVersion;
52
- private detectMacVersion;
53
- }
54
- export declare const clientChecker: ClientChecker;