@vkontakte/videoplayer 1.1.61-dev.4affc441.0 → 1.1.61-dev.e1cb6686.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 v1.1.61-dev.4affc441.0
3
- * Tue, 15 Apr 2025 00:54:52 GMT
2
+ * @vkontakte/videoplayer v1.1.61-dev.e1cb6686.0
3
+ * Tue, 15 Apr 2025 01:45:49 GMT
4
4
  * https://st.mycdn.me/static/vkontakte-videoplayer/1-1-61/doc/
5
5
  */
6
6
  var ta="[",_a="[!",ba="]",Or={};var mi=Symbol(),oi=Symbol("filename"),hm=Symbol("hmr"),_m="http://www.w3.org/1999/xhtml",Jc="http://www.w3.org/2000/svg";var Td=!0;var eu=globalThis.process?.env?.NODE_ENV;eu||console.warn("If bundling, conditions should include development or production. If not bundling, conditions or NODE_ENV should include development or production. See https://www.npmjs.com/package/esm-env for tips on setting conditions in popular bundlers and runtimes.");var $e=eu&&!eu.toLowerCase().includes("prod");var bo=Symbol("$state"),Hr=Symbol("$state metadata"),Ks=Symbol("legacy props"),bm=Symbol("");var lr=Array.isArray,$m=Array.prototype.indexOf,Ws=Array.from,tu=Object.keys,Ri=Object.defineProperty,kn=Object.getOwnPropertyDescriptor,kd=Object.getOwnPropertyDescriptors,iu=Object.prototype,ym=Array.prototype,Fr=Object.getPrototypeOf;function ia(t){return typeof t=="function"}var J=()=>{};function xm(t){return t()}function oa(t){for(var e=0;e<t.length;e++)t[e]()}var Qs=[],ou=[];function wm(){var t=Qs;Qs=[],oa(t)}function t1(){var t=ou;ou=[],oa(t)}function Vo(t){Qs.length===0&&queueMicrotask(wm),Qs.push(t)}function nu(){Qs.length>0&&wm(),ou.length>0&&t1()}function Id(t){return t===this.v}function ts(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Sm(t,e){return t!==e}function is(t){return!ts(t,this.v)}function Cm(){if($e){let t=new Error(`derived_references_self
@@ -45,7 +45,7 @@ ${l}in ${u}`).join("")}
45
45
  `)){let o=p1.exec(i)??f1.exec(i);o&&e.push({file:o[1],line:+o[2],column:+o[3]})}return e}function uv(){let t=m1()?.slice(4);if(!t)return null;for(let e=0;e<t.length;e++){let i=t[e],o=u1[i.file];if(!o){if(e===0)return null;continue}for(let n of o){if(n.end==null)return null;if(n.start.line<i.line&&n.end.line>i.line)return n.component}}return null}var zd=Symbol("ADD_OWNER");function wu(t,e,i=!1,o=!1){if(t&&!i){let n=Ho,a=t[Hr];if(a&&!Su(a,n)){let s=Cu(a);e&&e[oi]!==n[oi]&&!o&&Qm(n[oi],e[oi],s[oi])}}qd(t,e,new Set)}function fu(t,e){if(e.owners!==null)for(;t;){if(t.owners===null){e.owners=null;break}for(let i of t.owners)e.owners.add(i);t=t.parent}}function qd(t,e,i){let o=t?.[Hr];if(o)"owners"in o&&o.owners!=null&&(e?o.owners.add(e):o.owners=null);else if(t&&typeof t=="object"){if(i.has(t))return;if(i.add(t),zd in t&&t[zd])Zi(()=>{t[zd](e)});else{var n=Fr(t);if(n===Object.prototype)for(let a in t)if(Object.getOwnPropertyDescriptor(t,a)?.get){let s=mi;Zi(()=>{let d=t[a];s!==d&&(s=d,qd(d,e,i))})}else qd(t[a],e,i);else if(n===Array.prototype)for(let a=0;a<t.length;a+=1)qd(t[a],e,i)}}}function Su(t,e){return t.owners===null?!0:t.owners.has(e)||oi in e&&[...t.owners].some(i=>i[oi]===e[oi])||t.parent!==null&&Su(t.parent,e)}function Cu(t){return t?.owners?.values().next().value??Cu(t.parent)}var v1=!1;function jm(t){if(v1)return;let e=uv();if(e&&!Su(t,e)){let i=Cu(t);i[oi]!==e[oi]?pu(e[oi],i[oi]):pu()}}function ps(t){if($e){let e=new Error(`lifecycle_outside_component
46
46
  \`${t}(...)\` can only be used during component initialisation
47
47
  https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var xt=null;function ol(t){xt=t}var Ho=null;function nl(t){Ho=t}function fs(t){return Tu("getContext").get(t)}function ms(t,e){let i=Tu("setContext");return $e&&ut(()=>wu(e,null,!0)),i.set(t,e),e}function al(){return Tu("getAllContexts")}function F(t,e=!1,i){var o=xt={p:xt,c:null,d:!1,e:null,m:!1,s:t,x:null,l:null};Er&&!e&&(xt.l={s:null,u:null,r1:[],r2:xi(!1)}),Fo(()=>{o.d=!0}),$e&&(xt.function=i,Ho=i)}function U(t){let e=xt;if(e!==null){t!==void 0&&(e.x=t);let s=e.e;if(s!==null){var i=vt,o=Tt;e.e=null;try{for(var n=0;n<s.length;n++){var a=s[n];Bi(a.effect),ji(a.reaction),nn(a.fn)}}finally{Bi(i),ji(o)}}xt=e.p,$e&&(Ho=e.p?.function??null),e.m=!0}return t||{}}function Pr(){return!Er||xt!==null&&xt.l===null}function Tu(t){return xt===null&&ps(t),xt.c??=new Map(h1(xt)||void 0)}function h1(t){let e=t.p;for(;e!==null;){let i=e.c;if(i!==null)return i;e=e.p}return null}var _1=/\r/g;function pv(t){t=t.replace(_1,"");let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return(e>>>0).toString(36)}function fv(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}var b1=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function mv(t){return b1.includes(t)}var $1=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var y1={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function vv(t){return t=t.toLowerCase(),y1[t]??t}var $w=[...$1,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var x1=["touchstart","touchmove"];function gv(t){return x1.includes(t)}var w1=["textarea","script","style","title"];function hv(t){return w1.includes(t)}function ku(t){return t?.replace(/\//g,"/\u200B")}var _v=new Map;function bv(t,e){var i=_v.get(t);i||(i=new Set,_v.set(t,i)),i.add(e)}function Iu(t,e){if(e){let i=document.body;t.autofocus=!0,Vo(()=>{document.activeElement===i&&t.focus()})}}function sl(t){var e=Tt,i=vt;ji(null),Bi(null);try{return t()}finally{ji(e),Bi(i)}}var Eu=new Set,Kd=new Set;function Ea(t){if(!We)return;t.onload&&t.removeAttribute("onload"),t.onerror&&t.removeAttribute("onerror");let e=t.__e;e!==void 0&&(t.__e=void 0,queueMicrotask(()=>{t.isConnected&&t.dispatchEvent(e)}))}function Au(t,e,i,o={}){function n(a){if(o.capture||vs.call(e,a),!a.cancelBubble)return sl(()=>i?.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Vo(()=>{e.addEventListener(t,n,o)}):e.addEventListener(t,n,o),n}function wt(t,e,i,o,n){var a={capture:o,passive:n},s=Au(t,e,i,a);(e===document.body||e===window||e===document)&&Fo(()=>{e.removeEventListener(t,s,a)})}function tt(t){for(var e=0;e<t.length;e++)Eu.add(t[e]);for(var i of Kd)i(t)}function vs(t){var e=this,i=e.ownerDocument,o=t.type,n=t.composedPath?.()||[],a=n[0]||t.target,s=0,d=t.__root;if(d){var l=n.indexOf(d);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var c=n.indexOf(e);if(c===-1)return;l<=c&&(s=l)}if(a=n[s]||t.target,a!==e){Ri(t,"currentTarget",{configurable:!0,get(){return a||i}});var u=Tt,_=vt;ji(null),Bi(null);try{for(var f,y=[];a!==null;){var x=a.assignedSlot||a.parentNode||a.host||null;try{var w=a["__"+o];if(w!=null&&(!a.disabled||t.target===a))if(lr(w)){var[S,...I]=w;S.apply(a,[t,...I])}else w.call(a,t)}catch(L){f?y.push(L):f=L}if(t.cancelBubble||x===e||x===null)break;a=x}if(f){for(let L of y)queueMicrotask(()=>{throw L});throw f}}finally{t.__root=e,delete t.currentTarget,ji(u),Bi(_)}}}var C1;function $v(){C1=void 0}function gs(t){var e=document.createElement("template");return e.innerHTML=t,e.content}function Xi(t,e){var i=vt;i.nodes_start===null&&(i.nodes_start=t,i.nodes_end=e)}function M(t,e){var i=(e&1)!==0,o=(e&2)!==0,n,a=!t.startsWith("<!>");return()=>{if(We)return Xi(st,null),st;n===void 0&&(n=gs(a?t:"<!>"+t),i||(n=ri(n)));var s=o||Zs?document.importNode(n,!0):n.cloneNode(!0);if(i){var d=ri(s),l=s.lastChild;Xi(d,l)}else Xi(s,s);return s}}function me(t,e,i="svg"){var o=!t.startsWith("<!>"),n=(e&1)!==0,a=`<${i}>${o?t:"<!>"+t}</${i}>`,s;return()=>{if(We)return Xi(st,null),st;if(!s){var d=gs(a),l=ri(d);if(n)for(s=document.createDocumentFragment();ri(l);)s.appendChild(ri(l));else s=ri(l)}var c=s.cloneNode(!0);if(n){var u=ri(c),_=c.lastChild;Xi(u,_)}else Xi(c,c);return c}}function zn(t=""){if(!We){var e=Do(t+"");return Xi(e,e),e}var i=st;return i.nodeType!==3&&(i.before(i=Do()),ni(i)),Xi(i,i),i}function qe(){if(We)return Xi(st,null),st;var t=document.createDocumentFragment(),e=document.createComment(""),i=Do();return t.append(e,i),Xi(e,i),t}function b(t,e){if(We){vt.nodes_end=st,_i();return}t!==null&&t.before(e)}var ll=!0;function Wd(t){ll=t}function le(t,e){var i=e==null?"":typeof e=="object"?e+"":e;i!==(t.__t??=t.nodeValue)&&(t.__t=i,t.nodeValue=i+"")}function Qr(t,e){return xv(t,e)}function Mu(t,e){Ld(),e.intro=e.intro??!1;let i=e.target,o=We,n=st;try{for(var a=ri(i);a&&(a.nodeType!==8||a.data!==ta);)a=co(a);if(!a)throw Or;Di(!0),ni(a),_i();let s=xv(t,{...e,anchor:a});if(st===null||st.nodeType!==8||st.data!==ba)throw Ca(),Or;return Di(!1),s}catch(s){if(s===Or)return e.recover===!1&&Am(),Ld(),Xs(i),Di(!1),Qr(t,e);throw s}finally{Di(o),ni(n),$v()}}var hs=new Map;function xv(t,{target:e,anchor:i,props:o={},events:n,context:a,intro:s=!0}){Ld();var d=new Set,l=_=>{for(var f=0;f<_.length;f++){var y=_[f];if(!d.has(y)){d.add(y);var x=gv(y);e.addEventListener(y,vs,{passive:x});var w=hs.get(y);w===void 0?(document.addEventListener(y,vs,{passive:x}),hs.set(y,1)):hs.set(y,w+1)}}};l(Ws(Eu)),Kd.add(l);var c=void 0,u=dv(()=>{var _=i??e.appendChild(Do());return wi(()=>{if(a){F({});var f=xt;f.c=a}n&&(o.$$events=n),We&&Xi(_,null),ll=s,c=t(_,o)||{},ll=!0,We&&(vt.nodes_end=st),a&&U()}),()=>{for(var f of d){e.removeEventListener(f,vs);var y=hs.get(f);--y===0?(document.removeEventListener(f,vs),hs.delete(f)):hs.set(f,y)}Kd.delete(l),_!==i&&_.parentNode?.removeChild(_)}});return Pu.set(c,u),c}var Pu=new WeakMap;function Aa(t,e){let i=Pu.get(t);return i?(Pu.delete(t),i(e)):($e&&Wm(),Promise.resolve())}function V(t,e,[i,o]=[0,0]){We&&i===0&&_i();var n=t,a=null,s=null,d=mi,l=i>0?65536:0,c=!1;let u=(f,y=!0)=>{c=!0,_(y,f)},_=(f,y)=>{if(d===(d=f))return;let x=!1;if(We&&o!==-1){if(i===0){let S=n.data;S===ta?o=0:S===_a?o=1/0:(o=parseInt(S.substring(1)),o!==o&&(o=d?1/0:-1))}let w=o>i;!!d===w&&(n=ss(),ni(n),Di(!1),x=!0,o=-1)}d?(a?Wr(a):y&&(a=wi(()=>y(n))),s&&rn(s,()=>{s=null})):(s?Wr(s):y&&(s=wi(()=>y(n,[i+1,o]))),a&&rn(a,()=>{a=null})),x&&Di(!0)};Oi(()=>{c=!1,e(u),c||_(null,null)},l),We&&(n=st)}function dl(t,e,i){We&&_i();var o=t,n=mi,a,s=Pr()?Sm:ts;Oi(()=>{s(n,n=e())&&(a&&rn(a),a=wi(()=>i(o)))}),We&&(o=st)}var aa=null;function Ru(t){aa=t}function cl(t,e){return e}function E1(t,e,i,o){for(var n=[],a=e.length,s=0;s<a;s++)Ud(e[s].e,n,!0);var d=a>0&&n.length===0&&i!==null;if(d){var l=i.parentNode;Xs(l),l.append(i),o.clear(),ra(t,e[0].prev,e[a-1].next)}xu(n,()=>{for(var c=0;c<a;c++){var u=e[c];d||(o.delete(u.k),ra(t,u.prev,u.next)),Ni(u.e,!d)}})}function ci(t,e,i,o,n,a=null){var s=t,d={flags:e,items:new Map,first:null},l=(e&4)!==0;if(l){var c=t;s=We?ni(ri(c)):c.appendChild(Do())}We&&_i();var u=null,_=!1,f=ur(()=>{var y=i();return lr(y)?y:y==null?[]:Ws(y)});Oi(()=>{var y=r(f),x=y.length;if(_&&x===0)return;_=x===0;let w=!1;if(We){var S=s.data===_a;S!==(x===0)&&(s=ss(),ni(s),Di(!1),w=!0)}if(We){for(var I=null,L,A=0;A<x;A++){if(st.nodeType===8&&st.data===ba){s=st,w=!0,Di(!1);break}var P=y[A],k=o(P,A);L=Cv(st,d,I,null,P,k,A,n,e,i),d.items.set(k,L),I=L}x>0&&ni(ss())}We||A1(y,d,s,n,e,o,i),a!==null&&(x===0?u?Wr(u):u=wi(()=>a(s)):u!==null&&rn(u,()=>{u=null})),w&&Di(!0),r(f)}),We&&(s=st)}function A1(t,e,i,o,n,a,s){var d=(n&8)!==0,l=(n&3)!==0,c=t.length,u=e.items,_=e.first,f=_,y,x=null,w,S=[],I=[],L,A,P,k;if(d)for(k=0;k<c;k+=1)L=t[k],A=a(L,k),P=u.get(A),P!==void 0&&(P.a?.measure(),(w??=new Set).add(P));for(k=0;k<c;k+=1){if(L=t[k],A=a(L,k),P=u.get(A),P===void 0){var N=f?f.e.nodes_start:i;x=Cv(N,e,x,x===null?e.first:x.next,L,A,k,o,n,s),u.set(A,x),S=[],I=[],f=x.next;continue}if(l&&P1(P,L,k,n),(P.e.f&8192)!==0&&(Wr(P.e),d&&(P.a?.unfix(),(w??=new Set).delete(P))),P!==f){if(y!==void 0&&y.has(P)){if(S.length<I.length){var Q=I[0],G;x=Q.prev;var ee=S[0],oe=S[S.length-1];for(G=0;G<S.length;G+=1)wv(S[G],Q,i);for(G=0;G<I.length;G+=1)y.delete(I[G]);ra(e,ee.prev,oe.next),ra(e,x,ee),ra(e,oe,Q),f=Q,x=oe,k-=1,S=[],I=[]}else y.delete(P),wv(P,f,i),ra(e,P.prev,P.next),ra(e,P,x===null?e.first:x.next),ra(e,x,P),x=P;continue}for(S=[],I=[];f!==null&&f.k!==A;)(f.e.f&8192)===0&&(y??=new Set).add(f),I.push(f),f=f.next;if(f===null)continue;P=f}S.push(P),x=P,f=P.next}if(f!==null||y!==void 0){for(var ne=y===void 0?[]:Ws(y);f!==null;)(f.e.f&8192)===0&&ne.push(f),f=f.next;var te=ne.length;if(te>0){var ge=(n&4)!==0&&c===0?i:null;if(d){for(k=0;k<te;k+=1)ne[k].a?.measure();for(k=0;k<te;k+=1)ne[k].a?.fix()}E1(e,ne,ge,u)}}d&&Vo(()=>{if(w!==void 0)for(P of w)P.a?.apply()}),vt.first=e.first&&e.first.e,vt.last=x&&x.e}function P1(t,e,i,o){(o&1)!==0&&ns(t.v,e),(o&2)!==0?ns(t.i,i):t.i=i}function Cv(t,e,i,o,n,a,s,d,l,c){var u=aa,_=(l&1)!==0,f=(l&16)===0,y=_?f?qr(n):xi(n):n,x=(l&2)===0?s:xi(s);$e&&_&&(y.debug=()=>{var S=typeof x=="number"?s:x.v;c()[S]});var w={i:x,v:y,k:a,a:null,e:null,prev:i,next:o};aa=w;try{return w.e=wi(()=>d(t,y,x,c),We),w.e.prev=i&&i.e,w.e.next=o&&o.e,i===null?e.first=w:(i.next=w,i.e.next=w.e),o!==null&&(o.prev=w,o.e.prev=w.e),w}finally{aa=u}}function wv(t,e,i){for(var o=t.next?t.next.e.nodes_start:i,n=e?e.e.nodes_start:i,a=t.e.nodes_start;a!==o;){var s=co(a);n.before(a),a=s}}function ra(t,e,i){e===null?t.first=i:(e.next=i,e.e.next=i&&i.e),i!==null&&(i.prev=e,i.e.prev=e&&e.e)}function M1(t,e,i){if(!e||e===pv(String(i??"")))return;let o,n=t.__svelte_meta?.loc;n?o=`near ${n.file}:${n.line}:${n.column}`:Ho?.[oi]&&(o=`in ${Ho[oi]}`),Km(ku(o))}function ul(t,e,i,o,n){var a=t,s="",d;Oi(()=>{if(s===(s=e()??"")){We&&_i();return}d!==void 0&&(Ni(d),d=void 0),s!==""&&(d=wi(()=>{if(We){for(var l=st.data,c=_i(),u=c;c!==null&&(c.nodeType!==8||c.data!=="");)u=c,c=co(c);if(c===null)throw Ca(),Or;$e&&!n&&M1(c.parentNode,l,s),Xi(st,u),a=ni(c);return}var _=s+"";i?_=`<svg>${_}</svg>`:o&&(_=`<math>${_}</math>`);var f=gs(_);if((i||o)&&(f=ri(f)),Xi(ri(f),f.lastChild),i||o)for(;ri(f);)a.before(ri(f));else a.before(f)}))})}function de(t,e,...i){var o=t,n=J,a;Oi(()=>{n!==(n=e())&&(a&&(Ni(a),a=null),$e&&n==null&&Pm(),a=wi(()=>n(o,...i)))},65536),We&&(o=st)}function bi(t,e,i){We&&_i();var o=t,n,a;Oi(()=>{n!==(n=e())&&(a&&(rn(a),a=null),n&&(a=wi(()=>i(o,n))))},65536),We&&(o=st)}function pl(t,e,i,o,n,a){let s=We;We&&_i();var d=$e&&a&&xt?.function[oi],l,c,u=null;We&&st.nodeType===1&&(u=st,_i());var _=We?st:t,f,y=aa;Oi(()=>{let x=e()||null;var w=n?n():i||x==="svg"?Jc:null;if(x!==l){var S=aa;Ru(y),f&&(x===null?rn(f,()=>{f=null,c=null}):x===c?Wr(f):(Ni(f),Wd(!1))),x&&x!==c&&(f=wi(()=>{if(u=We?u:w?document.createElementNS(w,x):document.createElement(x),$e&&a&&(u.__svelte_meta={loc:{file:d,line:a[0],column:a[1]}}),Xi(u,u),o){We&&hv(x)&&u.append(document.createComment(""));var I=We?ri(u):u.appendChild(Do());We&&(I===null?Di(!1):ni(I)),o(u,I)}vt.nodes_end=u,_.before(u)})),l=x,l&&(c=l),Wd(!0),Ru(S)}},65536),s&&(Di(!0),ni(_))}var Nu;function Tv(t){return Nu=t.target,new Bu(t)}var Bu=class{#t;#e;constructor(e){var i=new Map,o=(a,s)=>{var d=qr(s);return i.set(a,d),d};let n=new Proxy({...e.props||{},$$events:{}},{get(a,s){return r(i.get(s)??o(s,Reflect.get(a,s)))},has(a,s){return s===Ks?!0:(r(i.get(s)??o(s,Reflect.get(a,s))),Reflect.has(a,s))},set(a,s,d){return D(i.get(s)??o(s,d),d),Reflect.set(a,s,d)}});this.#e=(e.hydrate?Mu:Qr)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&cs(),this.#t=n.$$events;for(let a of Object.keys(this.#e))a==="$set"||a==="$destroy"||a==="$on"||Ri(this,a,{get(){return this.#e[a]},set(s){this.#e[a]=s},enumerable:!0});this.#e.$set=a=>{Object.assign(n,a)},this.#e.$destroy=()=>{Aa(this.#e)}}$set(e){this.#e.$set(e)}$on(e,i){this.#t[e]=this.#t[e]||[];let o=(...n)=>i.call(this,...n);return this.#t[e].push(o),()=>{this.#t[e]=this.#t[e].filter(n=>n!==o)}}$destroy(){this.#e.$destroy()}};function q(t,e){Vo(()=>{var i=t.getRootNode(),o=i.host?i:i.head??i.ownerDocument.head??Nu?.parentNode;if(!o?.querySelector("#"+e.hash)){let n=document.createElement("style");n.id=e.hash,n.textContent=e.code,o.appendChild(n),$e&&bv(e.hash,n)}})}function kv(t){var e,i,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(e=0;e<n;e++)t[e]&&(i=kv(t[e]))&&(o&&(o+=" "),o+=i)}else for(i in t)t[i]&&(o&&(o+=" "),o+=i);return o}function Iv(){for(var t,e,i=0,o="",n=arguments.length;i<n;i++)(t=arguments[i])&&(e=kv(t))&&(o&&(o+=" "),o+=e);return o}function fl(t){return typeof t=="object"?Iv(t):t??""}var Ev=[...`
48
- \r\f\xA0\v\uFEFF`];function Pv(t,e,i){var o=t==null?"":""+t;if(e&&(o=o?o+" "+e:e),i){for(var n in i)if(i[n])o=o?o+" "+n:n;else if(o.length)for(var a=n.length,s=0;(s=o.indexOf(n,s))>=0;){var d=s+a;(s===0||Ev.includes(o[s-1]))&&(d===o.length||Ev.includes(o[d]))?o=(s===0?"":o.substring(0,s))+o.substring(d+1):s=d}}return o===""?null:o}function Av(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var a=t[n];a!=null&&a!==""&&(o+=" "+n+": "+a+i)}return o}function Du(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Mv(t,e){if(e){var i="",o,n;if(Array.isArray(e)?(o=e[0],n=e[1]):o=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,s=0,d=!1,l=[];o&&l.push(...Object.keys(o).map(Du)),n&&l.push(...Object.keys(n).map(Du));var c=0,u=-1;let w=t.length;for(var _=0;_<w;_++){var f=t[_];if(d?f==="/"&&t[_-1]==="*"&&(d=!1):a?a===f&&(a=!1):f==="/"&&t[_+1]==="*"?d=!0:f==='"'||f==="'"?a=f:f==="("?s++:f===")"&&s--,!d&&a===!1&&s===0){if(f===":"&&u===-1)u=_;else if(f===";"||_===w-1){if(u!==-1){var y=Du(t.substring(c,u).trim());if(!l.includes(y)){f!==";"&&_++;var x=t.substring(c,_).trim();i+=" "+x+";"}}c=_+1,u=-1}}}}return o&&(i+=Av(o)),n&&(i+=Av(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function Z(t,e,i,o,n,a){var s=t.__className;if(We||s!==i){var d=Pv(i,o,a);(!We||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(a&&n!==a)for(var l in a){var c=!!a[l];(n==null||c!==!!n[l])&&t.classList.toggle(l,c)}return a}function Ou(t,e={},i,o){for(var n in i){var a=i[n];e[n]!==a&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,a,o))}}function et(t,e,i,o){var n=t.__style;if(We||n!==e){var a=Mv(e,o);(!We||a!==t.getAttribute("style"))&&(a==null?t.removeAttribute("style"):t.style.cssText=a),t.__style=e}else o&&(Array.isArray(o)?(Ou(t,i?.[0],o[0]),Ou(t,i?.[1],o[1],"important")):Ou(t,i,o));return o}var _s=Symbol("class"),bs=Symbol("style"),Rv=Symbol("is custom element"),Bv=Symbol("is html");function Nv(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ve(t,e,i,o){var n=Dv(t);if(We&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||O1(t,e,i??"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[bm]=i),i==null?t.removeAttribute(e):typeof i!="string"&&Ov(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function he(t,e,i,o,n=!1){var a=Dv(t),s=a[Rv],d=!a[Bv];let l=We&&s;l&&Di(!1);var c=e||{},u=t.tagName==="OPTION";for(var _ in e)_ in i||(i[_]=null);i.class?i.class=fl(i.class):(o||i[_s])&&(i.class=null),i[bs]&&(i.style??=null);var f=Ov(t);for(let P in i){let k=i[P];if(u&&P==="value"&&k==null){t.value=t.__value="",c[P]=k;continue}if(P==="class"){var y=t.namespaceURI==="http://www.w3.org/1999/xhtml";Z(t,y,k,o,e?.[_s],i[_s]),c[P]=k,c[_s]=i[_s];continue}if(P==="style"){et(t,k,e?.[bs],i[bs]),c[P]=k,c[bs]=i[bs];continue}var x=c[P];if(k!==x){c[P]=k;var w=P[0]+P[1];if(w!=="$$")if(w==="on"){let N={},Q="$$"+P,G=P.slice(2);var S=mv(G);if(fv(G)&&(G=G.slice(0,-7),N.capture=!0),!S&&x){if(k!=null)continue;t.removeEventListener(G,c[Q],N),c[Q]=null}if(k!=null)if(S)t[`__${G}`]=k,tt([G]);else{let ee=function(oe){c[P].call(this,oe)};var A=ee;c[Q]=Au(G,t,ee,N)}else S&&(t[`__${G}`]=void 0)}else if(P==="style")Ve(t,P,k);else if(P==="autofocus")Iu(t,!!k);else if(!s&&(P==="__value"||P==="value"&&k!=null))t.value=t.__value=k;else if(P==="selected"&&u)Nv(t,k);else{var I=P;d||(I=vv(I));var L=I==="defaultValue"||I==="defaultChecked";if(k==null&&!s&&!L)if(a[P]=null,I==="value"||I==="checked"){let N=t,Q=e===void 0;if(I==="value"){let G=N.defaultValue;N.removeAttribute(I),N.defaultValue=G,N.value=N.__value=Q?G:null}else{let G=N.defaultChecked;N.removeAttribute(I),N.defaultChecked=G,N.checked=Q?G:!1}}else t.removeAttribute(P);else L||f.includes(I)&&(s||typeof k!="string")?t[I]=k:typeof k!="function"&&Ve(t,I,k,n)}}}return l&&Di(!0),c}function Dv(t){return t.__attributes??={[Rv]:t.nodeName.includes("-"),[Bv]:t.namespaceURI===_m}}var Lv=new Map;function Ov(t){var e=Lv.get(t.nodeName);if(e)return e;Lv.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=kd(o);for(var a in i)i[a].set&&e.push(a);o=Fr(o)}return e}function O1(t,e,i){$e&&(e==="srcset"&&H1(t,i)||Hu(t.getAttribute(e)??"",i)||qm(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function Hu(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function Vv(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function H1(t,e){var i=Vv(t.srcset),o=Vv(e);return o.length===i.length&&o.every(([n,a],s)=>a===i[s][1]&&(Hu(i[s][0],n)||Hu(n,i[s][0])))}var F1=Td?()=>performance.now():()=>Date.now(),fr={tick:t=>(Td?requestAnimationFrame:J)(t),now:()=>F1(),tasks:new Set};function Hv(){let t=fr.now();fr.tasks.forEach(e=>{e.c(t)||(fr.tasks.delete(e),e.f())}),fr.tasks.size!==0&&fr.tick(Hv)}function Fv(t){let e;return fr.tasks.size===0&&fr.tick(Hv),{promise:new Promise(i=>{fr.tasks.add(e={c:t,f:i})}),abort(){fr.tasks.delete(e)}}}function Qd(t,e){sl(()=>{t.dispatchEvent(new CustomEvent(e))})}function K1(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;let e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(i=>i[0].toUpperCase()+i.slice(1)).join("")}function Uv(t){let e={},i=t.split(";");for(let o of i){let[n,a]=o.split(":");if(!n||a===void 0)break;let s=K1(n.trim());e[s]=a.trim()}return e}var W1=t=>t;function Uu(t,e,i,o){var n=(t&1)!==0,a=(t&2)!==0,s=n&&a,d=(t&4)!==0,l=s?"both":n?"in":"out",c,u=e.inert,_=e.style.overflow,f,y;function x(){var A=Tt,P=vt;ji(null),Bi(null);try{return c??=i()(e,o?.()??{},{direction:l})}finally{ji(A),Bi(P)}}var w={is_global:d,in(){if(e.inert=u,!n){y?.abort(),y?.reset?.();return}a||f?.abort(),Qd(e,"introstart"),f=Fu(e,x(),y,1,()=>{Qd(e,"introend"),f?.abort(),f=c=void 0,e.style.overflow=_})},out(A){if(!a){A?.(),c=void 0;return}e.inert=!0,Qd(e,"outrostart"),y=Fu(e,x(),f,0,()=>{Qd(e,"outroend"),A?.()})},stop:()=>{f?.abort(),y?.abort()}},S=vt;if((S.transitions??=[]).push(w),n&&ll){var I=d;if(!I){for(var L=S.parent;L&&(L.f&65536)!==0;)for(;(L=L.parent)&&(L.f&16)===0;);I=!L||(L.f&32768)!==0}I&&nn(()=>{ut(()=>w.in())})}}function Fu(t,e,i,o,n){var a=o===1;if(ia(e)){var s,d=!1;return Vo(()=>{if(!d){var S=e({direction:a?"in":"out"});s=Fu(t,S,i,o,n)}}),{abort:()=>{d=!0,s?.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(i?.deactivate(),!e?.duration)return n(),{abort:J,deactivate:J,reset:J,t:()=>o};let{delay:l=0,css:c,tick:u,easing:_=W1}=e;var f=[];if(a&&i===void 0&&(u&&u(0,1),c)){var y=Uv(c(0,1));f.push(y,y)}var x=()=>1-o,w=t.animate(f,{duration:l});return w.onfinish=()=>{var S=i?.t()??1-o;i?.abort();var I=o-S,L=e.duration*Math.abs(I),A=[];if(L>0){var P=!1;if(c)for(var k=Math.ceil(L/16.666666666666668),N=0;N<=k;N+=1){var Q=S+I*_(N/k),G=Uv(c(Q,1-Q));A.push(G),P||=G.overflow==="hidden"}P&&(t.style.overflow="hidden"),x=()=>{var ee=w.currentTime;return S+I*_(ee/L)},u&&Fv(()=>{if(w.playState!=="running")return!1;var ee=x();return u(ee,1-ee),!0})}w=t.animate(A,{duration:L,fill:"forwards"}),w.onfinish=()=>{x=()=>o,u?.(o,1-o),n()}},{abort:()=>{w&&(w.cancel(),w.effect=null,w.onfinish=J)},deactivate:()=>{n=J},reset:()=>{o===0&&u?.(1,0)},t:()=>x()}}var zu=class t{#t=new WeakMap;#e;#i;static entries=new WeakMap;constructor(e){this.#i=e}observe(e,i){var o=this.#t.get(e)||new Set;return o.add(i),this.#t.set(e,o),this.#o().observe(e,this.#i),()=>{var n=this.#t.get(e);n.delete(i),n.size===0&&(this.#t.delete(e),this.#e.unobserve(e))}}#o(){return this.#e??(this.#e=new ResizeObserver(e=>{for(var i of e){t.entries.set(i.target,i);for(var o of this.#t.get(i.target)||[])o(i)}}))}};var j1=new zu({box:"border-box"});function Mr(t,e,i){var o=j1.observe(t,()=>i(t[e]));nn(()=>(ut(()=>i(t[e])),o))}function zv(t,e){return t===e||t?.[bo]===e}function rt(t={},e,i,o){return nn(()=>{var n,a;return Zi(()=>{n=a,a=o?.()||[],ut(()=>{t!==i(...a)&&(e(t,...a),n&&zv(i(...n),t)&&e(null,...n))})}),()=>{Vo(()=>{a&&zv(i(...a),t)&&e(null,...a)})}}),t}function mr(t=!1){let e=xt,i=e.l.u;if(!i)return;let o=()=>Od(e.s);if(t){let n=0,a={},s=m(()=>{let d=!1,l=e.s;for(let c in l)l[c]!==a[c]&&(a[c]=l[c],d=!0);return d&&n++,n});o=()=>r(s)}i.b.length&&us(()=>{qv(e,o),oa(i.b)}),Qe(()=>{let n=ut(()=>i.m.map(xm));return()=>{for(let a of n)typeof a=="function"&&a()}}),i.a.length&&Qe(()=>{qv(e,o),oa(i.a)})}function qv(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}if($e){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;Vm(e)},set:o=>{i=o}})}};Z1=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var Z1;function It(t){xt===null&&ps("onMount"),Er&&xt.l!==null?Y1(xt).m.push(t):Qe(()=>{let e=ut(t);if(typeof e=="function")return e})}function an(t){xt===null&&ps("onDestroy"),It(()=>()=>ut(t))}function Y1(t){var e=t.l;return e.u??={a:[],b:[],m:[]}}function ml(t,e,i){if(t==null)return e(void 0),i&&i(void 0),J;let o=ut(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var $s=[];function qn(t,e){return{subscribe:ae(t,e).subscribe}}function ae(t,e=J){let i=null,o=new Set;function n(d){if(ts(t,d)&&(t=d,i)){let l=!$s.length;for(let c of o)c[1](),$s.push(c,t);if(l){for(let c=0;c<$s.length;c+=2)$s[c][0]($s[c+1]);$s.length=0}}}function a(d){n(d(t))}function s(d,l=J){let c=[d,l];return o.add(c),o.size===1&&(i=e(n,a)||J),d(t),()=>{o.delete(c),o.size===0&&i&&(i(),i=null)}}return{set:n,update:a,subscribe:s}}function ai(t,e,i){let o=!Array.isArray(t),n=o?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let a=e.length<2;return qn(i,(s,d)=>{let l=!1,c=[],u=0,_=J,f=()=>{if(u)return;_();let x=e(o?c[0]:c,s,d);a?s(x):_=typeof x=="function"?x:J},y=n.map((x,w)=>ml(x,S=>{c[w]=S,u&=~(1<<w),l&&f()},()=>{u|=1<<w}));return l=!0,f(),function(){oa(y),_(),l=!1}})}function ve(t){let e;return ml(t,i=>e=i)(),e}var jd=!1,qu=Symbol();function $(t,e,i){let o=i[e]??={store:null,source:qr(void 0),unsubscribe:J};if(o.store!==t&&!(qu in i))if(o.unsubscribe(),o.store=t??null,t==null)o.source.v=void 0,o.unsubscribe=J;else{var n=!0;o.unsubscribe=ml(t,a=>{n?o.source.v=a:D(o.source,a)}),n=!1}return t&&qu in i?ve(t):r(o.source)}function He(){let t={};function e(){Fo(()=>{for(var i in t)t[i].unsubscribe();Ri(t,qu,{enumerable:!1,value:!0})})}return[t,e]}function Ku(t){var e=jd;try{return jd=!1,[t(),jd]}finally{jd=e}}var n0={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return $e&&Lm(`${t.name}.${String(e)}`),!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function we(t,e,i){return new Proxy($e?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},n0)}var r0={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ia(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o)return o[e]}},set(t,e,i){let o=t.props.length;for(;o--;){let n=t.props[o];ia(n)&&(n=n());let a=kn(n,e);if(a&&a.set)return a.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ia(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=kn(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===bo||e===Ks)return!1;for(let i of t.props)if(ia(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props){ia(i)&&(i=i());for(let o in i)e.includes(o)||e.push(o)}return e}};function Gr(...t){return new Proxy({props:t},r0)}function Kv(t){return t.ctx?.d??!1}function v(t,e,i,o){var n=(i&1)!==0,a=!Er||(i&2)!==0,s=(i&8)!==0,d=(i&16)!==0,l=!1,c;s?[c,l]=Ku(()=>t[e]):c=t[e];var u=bo in t||Ks in t,_=s&&(kn(t,e)?.set??(u&&e in t&&(Q=>t[e]=Q)))||void 0,f=o,y=!0,x=!1,w=()=>(x=!0,y&&(y=!1,d?f=ut(o):f=o),f);c===void 0&&o!==void 0&&(_&&a&&Mm(e),c=w(),_&&_(c));var S;if(a)S=()=>{var Q=t[e];return Q===void 0?w():(y=!0,x=!1,Q)};else{var I=(n?m:ur)(()=>t[e]);I.f|=131072,S=()=>{var Q=r(I);return Q!==void 0&&(f=void 0),Q===void 0?f:Q}}if((i&4)===0)return S;if(_){var L=t.$$legacy;return function(Q,G){return arguments.length>0?((!a||!G||L||l)&&_(G?S():Q),Q):S()}}var A=!1,P=!1,k=qr(c),N=m(()=>{var Q=S(),G=r(k);return A?(A=!1,P=!0,G):(P=!1,k.v=Q)});return s&&r(N),n||(N.equals=is),function(Q,G){if(js!==null&&(A=P,S(),r(k)),arguments.length>0){let ee=G?r(N):a&&s?pe(Q):Q;if(!N.equals(ee)){if(A=!0,D(k,ee),x&&f!==void 0&&(f=ee),Kv(N))return Q;ut(()=>r(N))}return Q}return Kv(N)?N.v:r(N)}}var a0;typeof HTMLElement=="function"&&(a0=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,i){super(),this.$$ctor=t,this.$$s=e,i&&this.attachShadow({mode:"open"})}addEventListener(t,e,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){let o=this.$$c.$on(t,e);this.$$l_u.set(e,o)}super.addEventListener(t,e,i)}removeEventListener(t,e,i){if(super.removeEventListener(t,e,i),this.$$c){let o=this.$$l_u.get(e);o&&(o(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return a=>{let s=document.createElement("slot");n!=="default"&&(s.name=n),b(a,s)}};var t=e;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let i={},o=s0(this);for(let n of this.$$s)n in o&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),i.default=!0):i[n]=e(n));for(let n of this.attributes){let a=this.$$g_p(n.name);a in this.$$d||(this.$$d[a]=Wu(a,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Tv({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:i,$$host:this}}),this.$$me=Fd(()=>{Zi(()=>{this.$$r=!0;for(let n of tu(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let a=Wu(n,this.$$d[n],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,a)}this.$$r=!1})});for(let n in this.$$l)for(let a of this.$$l[n]){let s=this.$$c.$on(n,a);this.$$l_u.set(a,s)}this.$$l={}}}attributeChangedCallback(t,e,i){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Wu(t,i,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return tu(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Wu(t,e,i,o){let n=i[t]?.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!o||!i[t])return e;if(o==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function s0(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var Wv="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Wv);import{clientChecker as L3}from"@vkontakte/videoplayer-core/evergreen";import"@vkontakte/videoplayer-core/evergreen";import{noop as Uh,safeStorage as V3,throttleFn as R3}from"@vkontakte/videoplayer-shared/evergreen";import{SeekAction as B3}from"@vkontakte/videoplayer-statistics/evergreen";import{InterfaceLanguage as d0,fillWithDefault as c0,VideoQuality as Qv}from"@vkontakte/videoplayer-shared/evergreen";var u0={isMobile:void 0,debugLog:!1,devNullLog:!1,defaultLanguage:d0.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:Qv.Q_480P,highQualityLimit:Qv.Q_720P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,preventPauseOnVideoClick:!1,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,slots:!0,annotationsInside:!1,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,saveTraceInfoToFile:!1,additionalButtons:!0,additionalButtonsDesktopControlPanelRight:!0,additionalSettingsMenuItems:!0,additionalContextMenuItems:!0,contextMenuButton:!0,audioLanguages:!1,saveRate:!1,fullscreenInternalTargetPlayerContainer:!1,endScreen:!0,autoplayNext:!0,nextPrevButtons:!0,previewNoEmptySpace:!1,exposeInternalsToGlobal:!1,skipInitialPlaybackRateValue:!1,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!1},controls:{showOnStartupAtAutoplay:!0,hideTimeout:500,hideTimeoutMobile:3e3,hideTimeoutInitial:200,hideTimeoutFullscreen:3e3,hideTimeoutCursor:3e3,hideTimeoutTooltips:1e3,collapseMobileUnmute:6e3,hide360IconTimeout:3e3,hideHotKeyHelpers:2e3,playbackRateMin:.25,playbackRateMax:2,playbackRateStep:.25,volumeStepKeyboard:.05,volumeStepWheel:.05,volumeBarTimeout:300,seekStepKeyboard:1e4,seekStepMobile:15e3,seekStepFrame:400},ads:{enable:void 0,initTimeout:2e3,loadTimeout:2e3,runtimeTimeout:5e3,slot:void 0,preview:void 0,isMobileGoToSiteButton:!0,useAdmanFromNPM:!1,volumeMultiplier:1,isVsidOriginal:!1},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4},view:{timelineSliderColor:null,timelineSliderHandleColor:null,timelineSliderFilledColor:null,timelineSliderLoadedColor:null,volumeSliderColor:null,volumeSliderHandleColor:null,volumeSliderFilledColor:null,controlsTimeColor:null,timelineSliderFilledActiveLiveColor:null,timelineSliderHandleActiveLiveColor:null,buttonColor:null,buttonToggleOnColor:null,focusedColor:null}},Gv=t=>c0(t,u0),jv=t=>ms("ui-config",t),Vt=()=>fs("ui-config");var vl="vk_player_debug_panel_opened";var Yv="videoplayer",Zv="videoplayer";var Lr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},Xv=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Jv=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),eg=new Set(["ShiftRight","ShiftLeft"]);var tg=["TIMELINE"],gl=[...tg,"GRAPH_BUTTON"],Qu=[...tg,"PLAY_BUTTON"],hl=[...gl,"PLAY_BUTTON"];var Vr=(a=>(a.XS="xs",a.S="s",a.M="m",a.L="l",a.XL="xl",a))(Vr||{}),Ma={xs:0,s:1,m:2,l:3,xl:4};import{assertNonNullable as ig,VERSION as p0}from"@vkontakte/videoplayer-shared/evergreen";import{VERSION as f0}from"@vkontakte/videoplayer-core/evergreen";import{VERSION as m0}from"@vkontakte/videoplayer-statistics/evergreen";var Yd="prod",ys="1.1.61-dev.4affc441.0";var La=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var og=Symbol("storeContext"),ng=Symbol("microStoresContext"),rg=(t,e)=>{ms(og,t),ms(ng,e),Yd==="dev"&&(window.app={store:t,microStores:e})},ye=()=>{let t=fs(og);return ig(t,"Store context is empty!"),t},Hi=()=>{let t=fs(ng);return ig(t,"MicroStores context is empty!"),t},Ut=(t,e)=>Xd(t,t.getValue(),e),Xd=(t,e,i)=>qn(e,o=>{let n=t.subscribe(a=>{o(a),i?.(a)});return()=>n.unsubscribe()}),ag=(t,e,i)=>{let o=t.info,{width:n,height:a}=ve(i.ui.playerSize),s=o.throughputEstimation$.getValue()?.toFixed(0)??0,d=o.rttEstimation$.getValue()?.toFixed(0)??0,l=o.isAutoQualityEnabled$.getValue()?"auto":"manual",c=`${ys} (core: ${f0}, stat: ${m0}, shared: ${p0})`,u=ve(i.state.errorLog$),_=u.length?`
48
+ \r\f\xA0\v\uFEFF`];function Pv(t,e,i){var o=t==null?"":""+t;if(e&&(o=o?o+" "+e:e),i){for(var n in i)if(i[n])o=o?o+" "+n:n;else if(o.length)for(var a=n.length,s=0;(s=o.indexOf(n,s))>=0;){var d=s+a;(s===0||Ev.includes(o[s-1]))&&(d===o.length||Ev.includes(o[d]))?o=(s===0?"":o.substring(0,s))+o.substring(d+1):s=d}}return o===""?null:o}function Av(t,e=!1){var i=e?" !important;":";",o="";for(var n in t){var a=t[n];a!=null&&a!==""&&(o+=" "+n+": "+a+i)}return o}function Du(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Mv(t,e){if(e){var i="",o,n;if(Array.isArray(e)?(o=e[0],n=e[1]):o=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,s=0,d=!1,l=[];o&&l.push(...Object.keys(o).map(Du)),n&&l.push(...Object.keys(n).map(Du));var c=0,u=-1;let w=t.length;for(var _=0;_<w;_++){var f=t[_];if(d?f==="/"&&t[_-1]==="*"&&(d=!1):a?a===f&&(a=!1):f==="/"&&t[_+1]==="*"?d=!0:f==='"'||f==="'"?a=f:f==="("?s++:f===")"&&s--,!d&&a===!1&&s===0){if(f===":"&&u===-1)u=_;else if(f===";"||_===w-1){if(u!==-1){var y=Du(t.substring(c,u).trim());if(!l.includes(y)){f!==";"&&_++;var x=t.substring(c,_).trim();i+=" "+x+";"}}c=_+1,u=-1}}}}return o&&(i+=Av(o)),n&&(i+=Av(n,!0)),i=i.trim(),i===""?null:i}return t==null?null:String(t)}function Z(t,e,i,o,n,a){var s=t.__className;if(We||s!==i){var d=Pv(i,o,a);(!We||d!==t.getAttribute("class"))&&(d==null?t.removeAttribute("class"):e?t.className=d:t.setAttribute("class",d)),t.__className=i}else if(a&&n!==a)for(var l in a){var c=!!a[l];(n==null||c!==!!n[l])&&t.classList.toggle(l,c)}return a}function Ou(t,e={},i,o){for(var n in i){var a=i[n];e[n]!==a&&(i[n]==null?t.style.removeProperty(n):t.style.setProperty(n,a,o))}}function et(t,e,i,o){var n=t.__style;if(We||n!==e){var a=Mv(e,o);(!We||a!==t.getAttribute("style"))&&(a==null?t.removeAttribute("style"):t.style.cssText=a),t.__style=e}else o&&(Array.isArray(o)?(Ou(t,i?.[0],o[0]),Ou(t,i?.[1],o[1],"important")):Ou(t,i,o));return o}var _s=Symbol("class"),bs=Symbol("style"),Rv=Symbol("is custom element"),Bv=Symbol("is html");function Nv(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ve(t,e,i,o){var n=Dv(t);if(We&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||O1(t,e,i??"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[bm]=i),i==null?t.removeAttribute(e):typeof i!="string"&&Ov(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function he(t,e,i,o,n=!1){var a=Dv(t),s=a[Rv],d=!a[Bv];let l=We&&s;l&&Di(!1);var c=e||{},u=t.tagName==="OPTION";for(var _ in e)_ in i||(i[_]=null);i.class?i.class=fl(i.class):(o||i[_s])&&(i.class=null),i[bs]&&(i.style??=null);var f=Ov(t);for(let P in i){let k=i[P];if(u&&P==="value"&&k==null){t.value=t.__value="",c[P]=k;continue}if(P==="class"){var y=t.namespaceURI==="http://www.w3.org/1999/xhtml";Z(t,y,k,o,e?.[_s],i[_s]),c[P]=k,c[_s]=i[_s];continue}if(P==="style"){et(t,k,e?.[bs],i[bs]),c[P]=k,c[bs]=i[bs];continue}var x=c[P];if(k!==x){c[P]=k;var w=P[0]+P[1];if(w!=="$$")if(w==="on"){let N={},Q="$$"+P,G=P.slice(2);var S=mv(G);if(fv(G)&&(G=G.slice(0,-7),N.capture=!0),!S&&x){if(k!=null)continue;t.removeEventListener(G,c[Q],N),c[Q]=null}if(k!=null)if(S)t[`__${G}`]=k,tt([G]);else{let ee=function(oe){c[P].call(this,oe)};var A=ee;c[Q]=Au(G,t,ee,N)}else S&&(t[`__${G}`]=void 0)}else if(P==="style")Ve(t,P,k);else if(P==="autofocus")Iu(t,!!k);else if(!s&&(P==="__value"||P==="value"&&k!=null))t.value=t.__value=k;else if(P==="selected"&&u)Nv(t,k);else{var I=P;d||(I=vv(I));var L=I==="defaultValue"||I==="defaultChecked";if(k==null&&!s&&!L)if(a[P]=null,I==="value"||I==="checked"){let N=t,Q=e===void 0;if(I==="value"){let G=N.defaultValue;N.removeAttribute(I),N.defaultValue=G,N.value=N.__value=Q?G:null}else{let G=N.defaultChecked;N.removeAttribute(I),N.defaultChecked=G,N.checked=Q?G:!1}}else t.removeAttribute(P);else L||f.includes(I)&&(s||typeof k!="string")?t[I]=k:typeof k!="function"&&Ve(t,I,k,n)}}}return l&&Di(!0),c}function Dv(t){return t.__attributes??={[Rv]:t.nodeName.includes("-"),[Bv]:t.namespaceURI===_m}}var Lv=new Map;function Ov(t){var e=Lv.get(t.nodeName);if(e)return e;Lv.set(t.nodeName,e=[]);for(var i,o=t,n=Element.prototype;n!==o;){i=kd(o);for(var a in i)i[a].set&&e.push(a);o=Fr(o)}return e}function O1(t,e,i){$e&&(e==="srcset"&&H1(t,i)||Hu(t.getAttribute(e)??"",i)||qm(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function Hu(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function Vv(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function H1(t,e){var i=Vv(t.srcset),o=Vv(e);return o.length===i.length&&o.every(([n,a],s)=>a===i[s][1]&&(Hu(i[s][0],n)||Hu(n,i[s][0])))}var F1=Td?()=>performance.now():()=>Date.now(),fr={tick:t=>(Td?requestAnimationFrame:J)(t),now:()=>F1(),tasks:new Set};function Hv(){let t=fr.now();fr.tasks.forEach(e=>{e.c(t)||(fr.tasks.delete(e),e.f())}),fr.tasks.size!==0&&fr.tick(Hv)}function Fv(t){let e;return fr.tasks.size===0&&fr.tick(Hv),{promise:new Promise(i=>{fr.tasks.add(e={c:t,f:i})}),abort(){fr.tasks.delete(e)}}}function Qd(t,e){sl(()=>{t.dispatchEvent(new CustomEvent(e))})}function K1(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;let e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(i=>i[0].toUpperCase()+i.slice(1)).join("")}function Uv(t){let e={},i=t.split(";");for(let o of i){let[n,a]=o.split(":");if(!n||a===void 0)break;let s=K1(n.trim());e[s]=a.trim()}return e}var W1=t=>t;function Uu(t,e,i,o){var n=(t&1)!==0,a=(t&2)!==0,s=n&&a,d=(t&4)!==0,l=s?"both":n?"in":"out",c,u=e.inert,_=e.style.overflow,f,y;function x(){var A=Tt,P=vt;ji(null),Bi(null);try{return c??=i()(e,o?.()??{},{direction:l})}finally{ji(A),Bi(P)}}var w={is_global:d,in(){if(e.inert=u,!n){y?.abort(),y?.reset?.();return}a||f?.abort(),Qd(e,"introstart"),f=Fu(e,x(),y,1,()=>{Qd(e,"introend"),f?.abort(),f=c=void 0,e.style.overflow=_})},out(A){if(!a){A?.(),c=void 0;return}e.inert=!0,Qd(e,"outrostart"),y=Fu(e,x(),f,0,()=>{Qd(e,"outroend"),A?.()})},stop:()=>{f?.abort(),y?.abort()}},S=vt;if((S.transitions??=[]).push(w),n&&ll){var I=d;if(!I){for(var L=S.parent;L&&(L.f&65536)!==0;)for(;(L=L.parent)&&(L.f&16)===0;);I=!L||(L.f&32768)!==0}I&&nn(()=>{ut(()=>w.in())})}}function Fu(t,e,i,o,n){var a=o===1;if(ia(e)){var s,d=!1;return Vo(()=>{if(!d){var S=e({direction:a?"in":"out"});s=Fu(t,S,i,o,n)}}),{abort:()=>{d=!0,s?.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(i?.deactivate(),!e?.duration)return n(),{abort:J,deactivate:J,reset:J,t:()=>o};let{delay:l=0,css:c,tick:u,easing:_=W1}=e;var f=[];if(a&&i===void 0&&(u&&u(0,1),c)){var y=Uv(c(0,1));f.push(y,y)}var x=()=>1-o,w=t.animate(f,{duration:l});return w.onfinish=()=>{var S=i?.t()??1-o;i?.abort();var I=o-S,L=e.duration*Math.abs(I),A=[];if(L>0){var P=!1;if(c)for(var k=Math.ceil(L/16.666666666666668),N=0;N<=k;N+=1){var Q=S+I*_(N/k),G=Uv(c(Q,1-Q));A.push(G),P||=G.overflow==="hidden"}P&&(t.style.overflow="hidden"),x=()=>{var ee=w.currentTime;return S+I*_(ee/L)},u&&Fv(()=>{if(w.playState!=="running")return!1;var ee=x();return u(ee,1-ee),!0})}w=t.animate(A,{duration:L,fill:"forwards"}),w.onfinish=()=>{x=()=>o,u?.(o,1-o),n()}},{abort:()=>{w&&(w.cancel(),w.effect=null,w.onfinish=J)},deactivate:()=>{n=J},reset:()=>{o===0&&u?.(1,0)},t:()=>x()}}var zu=class t{#t=new WeakMap;#e;#i;static entries=new WeakMap;constructor(e){this.#i=e}observe(e,i){var o=this.#t.get(e)||new Set;return o.add(i),this.#t.set(e,o),this.#o().observe(e,this.#i),()=>{var n=this.#t.get(e);n.delete(i),n.size===0&&(this.#t.delete(e),this.#e.unobserve(e))}}#o(){return this.#e??(this.#e=new ResizeObserver(e=>{for(var i of e){t.entries.set(i.target,i);for(var o of this.#t.get(i.target)||[])o(i)}}))}};var j1=new zu({box:"border-box"});function Mr(t,e,i){var o=j1.observe(t,()=>i(t[e]));nn(()=>(ut(()=>i(t[e])),o))}function zv(t,e){return t===e||t?.[bo]===e}function rt(t={},e,i,o){return nn(()=>{var n,a;return Zi(()=>{n=a,a=o?.()||[],ut(()=>{t!==i(...a)&&(e(t,...a),n&&zv(i(...n),t)&&e(null,...n))})}),()=>{Vo(()=>{a&&zv(i(...a),t)&&e(null,...a)})}}),t}function mr(t=!1){let e=xt,i=e.l.u;if(!i)return;let o=()=>Od(e.s);if(t){let n=0,a={},s=m(()=>{let d=!1,l=e.s;for(let c in l)l[c]!==a[c]&&(a[c]=l[c],d=!0);return d&&n++,n});o=()=>r(s)}i.b.length&&us(()=>{qv(e,o),oa(i.b)}),Qe(()=>{let n=ut(()=>i.m.map(xm));return()=>{for(let a of n)typeof a=="function"&&a()}}),i.a.length&&Qe(()=>{qv(e,o),oa(i.a)})}function qv(t,e){if(t.l.s)for(let i of t.l.s)r(i);e()}if($e){let t=function(e){if(!(e in globalThis)){let i;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(i!==void 0)return i;Vm(e)},set:o=>{i=o}})}};Z1=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var Z1;function It(t){xt===null&&ps("onMount"),Er&&xt.l!==null?Y1(xt).m.push(t):Qe(()=>{let e=ut(t);if(typeof e=="function")return e})}function an(t){xt===null&&ps("onDestroy"),It(()=>()=>ut(t))}function Y1(t){var e=t.l;return e.u??={a:[],b:[],m:[]}}function ml(t,e,i){if(t==null)return e(void 0),i&&i(void 0),J;let o=ut(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var $s=[];function qn(t,e){return{subscribe:ae(t,e).subscribe}}function ae(t,e=J){let i=null,o=new Set;function n(d){if(ts(t,d)&&(t=d,i)){let l=!$s.length;for(let c of o)c[1](),$s.push(c,t);if(l){for(let c=0;c<$s.length;c+=2)$s[c][0]($s[c+1]);$s.length=0}}}function a(d){n(d(t))}function s(d,l=J){let c=[d,l];return o.add(c),o.size===1&&(i=e(n,a)||J),d(t),()=>{o.delete(c),o.size===0&&i&&(i(),i=null)}}return{set:n,update:a,subscribe:s}}function ai(t,e,i){let o=!Array.isArray(t),n=o?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");let a=e.length<2;return qn(i,(s,d)=>{let l=!1,c=[],u=0,_=J,f=()=>{if(u)return;_();let x=e(o?c[0]:c,s,d);a?s(x):_=typeof x=="function"?x:J},y=n.map((x,w)=>ml(x,S=>{c[w]=S,u&=~(1<<w),l&&f()},()=>{u|=1<<w}));return l=!0,f(),function(){oa(y),_(),l=!1}})}function ve(t){let e;return ml(t,i=>e=i)(),e}var jd=!1,qu=Symbol();function $(t,e,i){let o=i[e]??={store:null,source:qr(void 0),unsubscribe:J};if(o.store!==t&&!(qu in i))if(o.unsubscribe(),o.store=t??null,t==null)o.source.v=void 0,o.unsubscribe=J;else{var n=!0;o.unsubscribe=ml(t,a=>{n?o.source.v=a:D(o.source,a)}),n=!1}return t&&qu in i?ve(t):r(o.source)}function He(){let t={};function e(){Fo(()=>{for(var i in t)t[i].unsubscribe();Ri(t,qu,{enumerable:!1,value:!0})})}return[t,e]}function Ku(t){var e=jd;try{return jd=!1,[t(),jd]}finally{jd=e}}var n0={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return $e&&Lm(`${t.name}.${String(e)}`),!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function we(t,e,i){return new Proxy($e?{props:t,exclude:e,name:i,other:{},to_proxy:[]}:{props:t,exclude:e},n0)}var r0={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ia(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o)return o[e]}},set(t,e,i){let o=t.props.length;for(;o--;){let n=t.props[o];ia(n)&&(n=n());let a=kn(n,e);if(a&&a.set)return a.set(i),!0}return!1},getOwnPropertyDescriptor(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(ia(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=kn(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===bo||e===Ks)return!1;for(let i of t.props)if(ia(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props){ia(i)&&(i=i());for(let o in i)e.includes(o)||e.push(o)}return e}};function Gr(...t){return new Proxy({props:t},r0)}function Kv(t){return t.ctx?.d??!1}function v(t,e,i,o){var n=(i&1)!==0,a=!Er||(i&2)!==0,s=(i&8)!==0,d=(i&16)!==0,l=!1,c;s?[c,l]=Ku(()=>t[e]):c=t[e];var u=bo in t||Ks in t,_=s&&(kn(t,e)?.set??(u&&e in t&&(Q=>t[e]=Q)))||void 0,f=o,y=!0,x=!1,w=()=>(x=!0,y&&(y=!1,d?f=ut(o):f=o),f);c===void 0&&o!==void 0&&(_&&a&&Mm(e),c=w(),_&&_(c));var S;if(a)S=()=>{var Q=t[e];return Q===void 0?w():(y=!0,x=!1,Q)};else{var I=(n?m:ur)(()=>t[e]);I.f|=131072,S=()=>{var Q=r(I);return Q!==void 0&&(f=void 0),Q===void 0?f:Q}}if((i&4)===0)return S;if(_){var L=t.$$legacy;return function(Q,G){return arguments.length>0?((!a||!G||L||l)&&_(G?S():Q),Q):S()}}var A=!1,P=!1,k=qr(c),N=m(()=>{var Q=S(),G=r(k);return A?(A=!1,P=!0,G):(P=!1,k.v=Q)});return s&&r(N),n||(N.equals=is),function(Q,G){if(js!==null&&(A=P,S(),r(k)),arguments.length>0){let ee=G?r(N):a&&s?pe(Q):Q;if(!N.equals(ee)){if(A=!0,D(k,ee),x&&f!==void 0&&(f=ee),Kv(N))return Q;ut(()=>r(N))}return Q}return Kv(N)?N.v:r(N)}}var a0;typeof HTMLElement=="function"&&(a0=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,i){super(),this.$$ctor=t,this.$$s=e,i&&this.attachShadow({mode:"open"})}addEventListener(t,e,i){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){let o=this.$$c.$on(t,e);this.$$l_u.set(e,o)}super.addEventListener(t,e,i)}removeEventListener(t,e,i){if(super.removeEventListener(t,e,i),this.$$c){let o=this.$$l_u.get(e);o&&(o(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return a=>{let s=document.createElement("slot");n!=="default"&&(s.name=n),b(a,s)}};var t=e;if(await Promise.resolve(),!this.$$cn||this.$$c)return;let i={},o=s0(this);for(let n of this.$$s)n in o&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),i.default=!0):i[n]=e(n));for(let n of this.attributes){let a=this.$$g_p(n.name);a in this.$$d||(this.$$d[a]=Wu(a,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=Tv({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:i,$$host:this}}),this.$$me=Fd(()=>{Zi(()=>{this.$$r=!0;for(let n of tu(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let a=Wu(n,this.$$d[n],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[n].attribute||n):this.setAttribute(this.$$p_d[n].attribute||n,a)}this.$$r=!1})});for(let n in this.$$l)for(let a of this.$$l[n]){let s=this.$$c.$on(n,a);this.$$l_u.set(a,s)}this.$$l={}}}attributeChangedCallback(t,e,i){this.$$r||(t=this.$$g_p(t),this.$$d[t]=Wu(t,i,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return tu(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function Wu(t,e,i,o){let n=i[t]?.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!o||!i[t])return e;if(o==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function s0(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var Wv="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(Wv);import{clientChecker as L3}from"@vkontakte/videoplayer-core/evergreen";import"@vkontakte/videoplayer-core/evergreen";import{noop as Uh,safeStorage as V3,throttleFn as R3}from"@vkontakte/videoplayer-shared/evergreen";import{SeekAction as B3}from"@vkontakte/videoplayer-statistics/evergreen";import{InterfaceLanguage as d0,fillWithDefault as c0,VideoQuality as Qv}from"@vkontakte/videoplayer-shared/evergreen";var u0={isMobile:void 0,debugLog:!1,devNullLog:!1,defaultLanguage:d0.RU,downloadVKLanguages:!0,updateBuiltinLanguages:!0,isSmoothVideoRotate:!0,showSupport:!0,supportLink:"https://vk.com/support?act=new&from=v",showLogo:void 0,logoLink:"https://vk.com/video",logoType:"vk_video",volumeDefault:1,volumeMinRestore:.05,loaderDelay:500,minSubtitlesFontSize:13,autoSubtitlesTimeout:2e3,allowChangingFullscreenTarget:!0,trafficSavingLimit:Qv.Q_480P,highQualityLimit:Qv.Q_720P,episodeMinWidthPc:8,hideThumbTimerAfterTouch:!0,preventPauseOnVideoClick:!1,sentry:{dsn:"https://e349fd23c68f405388980d0868d0ff27@sentry.mvk.com/126",sampleRate:.01,whiteErrorCategoryList:[],blackErrorCategoryList:[],whiteErrorIdList:[],blackErrorIdList:[]},features:{autoplay:!0,statistics:!0,sentry:!0,preload:!0,subtitles:!0,episodes:!0,fullscreen:!0,timelinePreview:!0,mediaSession:!0,annotations:!0,slots:!0,annotationsInside:!1,pip:!0,dpip:!0,download:!0,liveRewind:!0,playbackRate:!0,trafficSaving:!0,episodesClustering:!0,copyVideoLink:!0,videoRotate:!0,interactiveGraph:!1,interactiveResponsiveUi:!1,seekToInteractive:!0,interactiveLastFrame:!1,interactiveTextPermanent:!0,interactiveHideTime:!0,interactivePlayPrevChapter:!0,interactiveTimeIndicator:!0,interactiveTimeOpenUri:!1,interactiveAreaControlShadow:!1,interactiveControlsExpectTimeBlinkAnimation:!1,thumbTimer:!0,hotKeyMapModal:!0,hotKeyHelpers:!0,saveDebugInfoToFile:!1,saveTraceInfoToFile:!1,additionalButtons:!0,additionalButtonsDesktopControlPanelRight:!0,additionalSettingsMenuItems:!0,additionalContextMenuItems:!0,contextMenuButton:!0,audioLanguages:!1,saveRate:!1,fullscreenInternalTargetPlayerContainer:!1,endScreen:!0,autoplayNext:!0,nextPrevButtons:!0,previewNoEmptySpace:!1,exposeInternalsToGlobal:!1,skipInitialPlaybackRateValue:!1,qualityDetailsSubMenuEnabled:!1,showSlowVideoNotification:!1,forceAutoQualityWhenSevereStallHappens:!1,timeoutShowSlowVideoNotification:0,maxCountShowSlowVideoNotification:1,forcePlayerDisplayBlock:!1},controls:{showOnStartupAtAutoplay:!0,hideTimeout:500,hideTimeoutMobile:3e3,hideTimeoutInitial:200,hideTimeoutFullscreen:3e3,hideTimeoutCursor:3e3,hideTimeoutTooltips:1e3,collapseMobileUnmute:6e3,hide360IconTimeout:3e3,hideHotKeyHelpers:2e3,playbackRateMin:.25,playbackRateMax:2,playbackRateStep:.25,volumeStepKeyboard:.05,volumeStepWheel:.05,volumeBarTimeout:300,seekStepKeyboard:1e4,seekStepMobile:15e3,seekStepFrame:400},ads:{enable:void 0,initTimeout:2e3,loadTimeout:2e3,runtimeTimeout:5e3,slot:void 0,preview:void 0,isMobileGoToSiteButton:!0,useAdmanFromNPM:!1,volumeMultiplier:1,isVsidOriginal:!1},interactive:{historyMaxLength:100,noInteractionEventTimeout:3e4},view:{timelineSliderColor:null,timelineSliderHandleColor:null,timelineSliderFilledColor:null,timelineSliderLoadedColor:null,volumeSliderColor:null,volumeSliderHandleColor:null,volumeSliderFilledColor:null,controlsTimeColor:null,timelineSliderFilledActiveLiveColor:null,timelineSliderHandleActiveLiveColor:null,buttonColor:null,buttonToggleOnColor:null,focusedColor:null}},Gv=t=>c0(t,u0),jv=t=>ms("ui-config",t),Vt=()=>fs("ui-config");var vl="vk_player_debug_panel_opened";var Yv="videoplayer",Zv="videoplayer";var Lr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},Xv=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Jv=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),eg=new Set(["ShiftRight","ShiftLeft"]);var tg=["TIMELINE"],gl=[...tg,"GRAPH_BUTTON"],Qu=[...tg,"PLAY_BUTTON"],hl=[...gl,"PLAY_BUTTON"];var Vr=(a=>(a.XS="xs",a.S="s",a.M="m",a.L="l",a.XL="xl",a))(Vr||{}),Ma={xs:0,s:1,m:2,l:3,xl:4};import{assertNonNullable as ig,VERSION as p0}from"@vkontakte/videoplayer-shared/evergreen";import{VERSION as f0}from"@vkontakte/videoplayer-core/evergreen";import{VERSION as m0}from"@vkontakte/videoplayer-statistics/evergreen";var Yd="prod",ys="1.1.61-dev.e1cb6686.0";var La=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var og=Symbol("storeContext"),ng=Symbol("microStoresContext"),rg=(t,e)=>{ms(og,t),ms(ng,e),Yd==="dev"&&(window.app={store:t,microStores:e})},ye=()=>{let t=fs(og);return ig(t,"Store context is empty!"),t},Hi=()=>{let t=fs(ng);return ig(t,"MicroStores context is empty!"),t},Ut=(t,e)=>Xd(t,t.getValue(),e),Xd=(t,e,i)=>qn(e,o=>{let n=t.subscribe(a=>{o(a),i?.(a)});return()=>n.unsubscribe()}),ag=(t,e,i)=>{let o=t.info,{width:n,height:a}=ve(i.ui.playerSize),s=o.throughputEstimation$.getValue()?.toFixed(0)??0,d=o.rttEstimation$.getValue()?.toFixed(0)??0,l=o.isAutoQualityEnabled$.getValue()?"auto":"manual",c=`${ys} (core: ${f0}, stat: ${m0}, shared: ${p0})`,u=ve(i.state.errorLog$),_=u.length?`
49
49
  `+u.map((I,L)=>{let A=`${L}) Type: ${I.id}
50
50
  `,P=`Message: ${I.message} (${I.thrown})
51
51
  `,k=`Trace: ${I.thrown?.stack}
@@ -361,4 +361,4 @@ Try switching the\xA0quality to\xA0Auto.`},Ig=_0;var jr=new Map;jr.set(Ag.EN,Ig)
361
361
  /* css reset end */.hidden {visibility:hidden;opacity:0;}.overlay-container {pointer-events:none;top:0;left:0;height:100%;width:100%;position:fixed;z-index:var(--overlay-container-z-index);}
362
362
 
363
363
  /* \u041A\u043B\u0430\u0441\u0441 \u0434\u043B\u044F \u0441\u043E\u043A\u0440\u044B\u0442\u0438\u0435 \u043A\u043E\u043D\u0442\u0435\u043D\u0442\u0430 \u0432\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u043E \u043D\u043E \u043D\u0435 \u0434\u043B\u044F \u043E\u0431\u0445\u043E\u0434\u0430 \u043F\u043E \u0442\u0430\u0431 \u0438 \u0441\u043A\u0440\u0438\u043D \u0440\u0438\u0434\u0435\u0440\u0430 */.out-of-view {position:absolute !important;left:-1000vh !important;}.icon.icon-error-stub {display:flex;justify-content:center;align-items:center;}`};function sm(t,e){F(e,!0),q(t,D3);let[i,o]=He(),n=()=>$(At,"$isLive$",i),a=v(e,"sources",7),s=v(e,"store",7),d=v(e,"microStoresRoot",7),l=v(e,"videoConfig",7),c=v(e,"uiConfig",7),u=v(e,"title",7),_=v(e,"thumbUrl",7),f=v(e,"interactiveContainer",7),y=v(e,"interactiveController",7),x=v(e,"subtitles",7),w=v(e,"live",7),S=v(e,"preload",7),I=v(e,"autoplay",7),L=v(e,"volume",7,void 0),A=v(e,"muted",7,void 0),P=v(e,"fromTime",7),k=v(e,"canRewindLive",7),N=v(e,"showAds",7),Q=v(e,"adsSlotId",7,void 0),G=v(e,"adsParams",7,void 0),ee=v(e,"adsPreviewParam",7,void 0),oe=v(e,"adsAutoplayParam",7,void 0),ne=v(e,"duration",7,void 0),te=v(e,"logoClickable",7),ge=v(e,"logoHidden",7),X=v(e,"isMobile",7),Re=v(e,"showNextPrevButtons",7,!1),Me=v(e,"nextButtonActive",7,!1),se=v(e,"prevButtonActive",7,!1),Fe=v(e,"endScreenVideoTitle",7,void 0),j=v(e,"endScreenVideoThumb",7,void 0),B=v(e,"isOneVideoPlaylist",7,!1),Be=v(e,"supportLink",7),_e=v(e,"shadowRootContainer",7,void 0),ke=v(e,"outerContainerRef",7,void 0),Oe=v(e,"fullScreenTarget",7,void 0),ce=v(e,"failoverHosts",7,void 0),R=v(e,"showMiniTimer",7,!1),be=v(e,"saveRate",7),Ae=v(e,"seekToInteractive",7,Uh),Ge=v(e,"playPrevChapter",7,Uh),Ke=v(e,"volumeMultiplier",7),Ie=v(e,"showAutoplayNext",7),Le=v(e,"showEndScreen",7,!0),De=v(e,"keyboardControls",15,void 0),{subscribers:dt,stores:gt}=d();jv(c());let it=Vt(),Ct=c().logoLink,ot=s().ui.debugPanelVisible,ct=s().ui.playerSize,At=s().state.isLive$,Ne=s().state.isInteractive&&L3.device.isAndroid,Ye=Y(void 0),W=null,re=Y(!1);s().getAdmanWrapper().init({switchFromAdsToVideo:s().actions.internal.switchFromAdsToVideo,switchFromVideoToAds:s().actions.internal.switchFromVideoToAds,setMuted:s().actions.external.setMuted},s().ads,{isMobile:s().ui.isMobile,mobileUnmuteButtonVisible:s().ui.mobileUnmuteButtonVisible,vsid:s().vsid}),rg(s(),gt),Qe(()=>{s().ui.isMobile.set(X())});let ie=(z=!1)=>{D(re,!0),z?s().actions.external.firstStart(N()):s().actions.internal.firstStart(N())},Ue=()=>{if(it.features.qualityDetailsSubMenuEnabled){let z=Cg(s().videoId);if(z)switch(z.type){case"high_quality":s().actions.internal.setHighQualityEnabled(!0,z.appliesTo);break;case"traffic_saving":s().actions.internal.setTrafficSavingEnabled(!0,z.appliesTo);break;case"exact_quality":s().actions.internal.setQuality(z.quality);break}}else{Tg(s().videoId),np()&&s().actions.internal.setTrafficSavingEnabled(!0);let Ht=ep(s().videoId);Ht&&s().actions.internal.setQuality(Ht)}};function je(z){let Ht=a()||z;Ht&&s().initVideo({container:r(Ye),sources:Ht,failoverHosts:ce(),subtitles:x(),volumeMultiplier:Ke()});let $i=V3.get(vl)==="true";ot.set($i),P()>0&&s().actions.external.seekTime(P());let to=X()?it.volumeDefault:L()??Jd()??it.volumeDefault,Xt=A()??bg();if(s().actions.external.setVolume(to),s().actions.external.setMuted(Xt),s().getAdmanWrapper().setInitialVolume(Xt?0:to),Ue(),it.features.saveRate&&be()){let ei=xg();ei&&!n()&&s().actions.internal.setPlaybackRate(ei)}if(Ie()){let ei=Sg();ei&&s().actions.internal.setAutoplayNextEnabled(ei)}s().ui.isAutoplay.set(I()),I()?ie():S()&&it.features.preload&&s().actions.internal.preload()}let Pt=z=>{if(window.ResizeObserver){let Ht,$i;W=new ResizeObserver(R3(to=>{let Xt=to[0];if(Xt.contentBoxSize){let ei=Array.isArray(Xt.contentBoxSize)?Xt.contentBoxSize[0]:Xt.contentBoxSize;Ht=ei.inlineSize,$i=ei.blockSize}else Xt.contentRect&&(Ht=Xt.contentRect.width,$i=Xt.contentRect.height);ct.set({width:Ht,height:$i})},300)),W.observe(z)}ct.set({width:z.clientWidth,height:z.clientHeight})},pt=()=>{document.hidden&&s().actions.external.stop()};It(()=>{Ne&&document.addEventListener("visibilitychange",pt),it.debugLog&&s().actions.internal.startLogging(),Pt(r(Ye));let z=dt.map($i=>$i.init({store:s(),microStores:gt,config:l(),interactiveController:y(),uiConfig:c()})),Ht=()=>{Ne&&document.removeEventListener("visibilitychange",pt),W?.disconnect(),z.forEach($i=>$i.unsubscribe()),s().destroy()};return w()?.status==="upcoming"?(s().actions.internal.setLiveWaitingStart(!0),Ht):w()?.status==="waiting"?(s().actions.internal.setLiveWaitingRecover(!0),Ht):(w()?.status==="finished"||w()?.status==="postlive")&&!Object.keys(a()||[]).length?(s().actions.internal.setLiveWaitingRecord(!0),Ht):(je(),Ht)});function Ee(){r(re)?s().actions.external.play():ie(!0)}function Ce(){s().actions.external.pause()}function lt(z){s().actions.external.setMuted(z)}function Rt(z){X()||z>=0&&z<=1&&s().actions.external.setVolume(z)}function jt(z){s().actions.internal.seekTime(z,B3.UNKNOWN)}function si(z){s().actions.external.seekEpisodeStartTime(z)}function li(){s().actions.external.returnFocusToEpisodes()}function Ci(z){s().actions.external.setPlaybackRate(z)}function Uo(z){s().actions.external.setAutoQualityLimits(z)}let dn=Oc(it.view);var eo=N3();et(eo,dn);var cn=h(eo);{var zo=z=>{am(z,{get store(){return s()},uiConfig:it,get thumbUrl(){return _()},get interactiveContainer(){return f()},get live(){return w()},get autoplay(){return I()},get canRewindLive(){return k()},get showAds(){return N()},get adsSlotId(){return Q()},get adsParams(){return G()},get adsPreviewParam(){return ee()},get adsAutoplayParam(){return oe()},get duration(){return ne()},get logoClickable(){return te()},get logoHidden(){return ge()},logoTargetUrl:Ct,get nextButtonActive(){return Me()},get prevButtonActive(){return se()},get endScreenVideoTitle(){return Fe()},get endScreenVideoThumb(){return j()},get isOneVideoPlaylist(){return B()},get supportLink(){return Be()},get shadowRootContainer(){return _e()},get outerContainerRef(){return ke()},get fullScreenTarget(){return Oe()},get showMiniTimer(){return R()},get playerStarted(){return r(re)},get seekToInteractive(){return Ae()},get playPrevChapter(){return Ge()},firstStart:ie,seekTime:jt,get showEndScreen(){return Le()},get showAutoplayNext(){return Ie()},get showNextPrevButtons(){return Re()},get videoContainer(){return r(Ye)},set videoContainer(Ht){D(Ye,pe(Ht))}})},qo=z=>{nm(z,{get store(){return s()},uiConfig:it,get title(){return u()},get thumbUrl(){return _()},get interactiveContainer(){return f()},get live(){return w()},get autoplay(){return I()},get canRewindLive(){return k()},get showAds(){return N()},get adsSlotId(){return Q()},get adsParams(){return G()},get adsPreviewParam(){return ee()},get adsAutoplayParam(){return oe()},get duration(){return ne()},get logoClickable(){return te()},get logoHidden(){return ge()},logoTargetUrl:Ct,get nextButtonActive(){return Me()},get prevButtonActive(){return se()},get endScreenVideoTitle(){return Fe()},get endScreenVideoThumb(){return j()},get isOneVideoPlaylist(){return B()},get supportLink(){return Be()},get shadowRootContainer(){return _e()},get outerContainerRef(){return ke()},get fullScreenTarget(){return Oe()},get showMiniTimer(){return R()},get playerStarted(){return r(re)},get seekToInteractive(){return Ae()},get playPrevChapter(){return Ge()},firstStart:ie,get showEndScreen(){return Le()},get showAutoplayNext(){return Ie()},get showNextPrevButtons(){return Re()},get videoContainer(){return r(Ye)},set videoContainer(Ht){D(Ye,pe(Ht))},get keyboardControls(){return De()},set keyboardControls(Ht){De(Ht)}})};V(cn,z=>{X()?z(zo):z(qo,!1)})}g(eo),b(t,eo);var Ko=U({initVideo:je,play:Ee,pause:Ce,setMuted:lt,setVolume:Rt,seekTime:jt,seekEpisodeStartTime:si,returnFocusToEpisodes:li,setPlaybackRate:Ci,setAutoQualityLimits:Uo,get sources(){return a()},set sources(z){a(z)},get store(){return s()},set store(z){s(z)},get microStoresRoot(){return d()},set microStoresRoot(z){d(z)},get videoConfig(){return l()},set videoConfig(z){l(z)},get uiConfig(){return c()},set uiConfig(z){c(z)},get title(){return u()},set title(z){u(z)},get thumbUrl(){return _()},set thumbUrl(z){_(z)},get interactiveContainer(){return f()},set interactiveContainer(z){f(z)},get interactiveController(){return y()},set interactiveController(z){y(z)},get subtitles(){return x()},set subtitles(z){x(z)},get live(){return w()},set live(z){w(z)},get preload(){return S()},set preload(z){S(z)},get autoplay(){return I()},set autoplay(z){I(z)},get volume(){return L()},set volume(z){L(z)},get muted(){return A()},set muted(z){A(z)},get fromTime(){return P()},set fromTime(z){P(z)},get canRewindLive(){return k()},set canRewindLive(z){k(z)},get showAds(){return N()},set showAds(z){N(z)},get adsSlotId(){return Q()},set adsSlotId(z){Q(z)},get adsParams(){return G()},set adsParams(z){G(z)},get adsPreviewParam(){return ee()},set adsPreviewParam(z){ee(z)},get adsAutoplayParam(){return oe()},set adsAutoplayParam(z){oe(z)},get duration(){return ne()},set duration(z){ne(z)},get logoClickable(){return te()},set logoClickable(z){te(z)},get logoHidden(){return ge()},set logoHidden(z){ge(z)},get isMobile(){return X()},set isMobile(z){X(z)},get showNextPrevButtons(){return Re()},set showNextPrevButtons(z){Re(z)},get nextButtonActive(){return Me()},set nextButtonActive(z){Me(z)},get prevButtonActive(){return se()},set prevButtonActive(z){se(z)},get endScreenVideoTitle(){return Fe()},set endScreenVideoTitle(z){Fe(z)},get endScreenVideoThumb(){return j()},set endScreenVideoThumb(z){j(z)},get isOneVideoPlaylist(){return B()},set isOneVideoPlaylist(z){B(z)},get supportLink(){return Be()},set supportLink(z){Be(z)},get shadowRootContainer(){return _e()},set shadowRootContainer(z){_e(z)},get outerContainerRef(){return ke()},set outerContainerRef(z){ke(z)},get fullScreenTarget(){return Oe()},set fullScreenTarget(z){Oe(z)},get failoverHosts(){return ce()},set failoverHosts(z){ce(z)},get showMiniTimer(){return R()},set showMiniTimer(z){R(z)},get saveRate(){return be()},set saveRate(z){be(z)},get showAutoplayNext(){return Ie()},set showAutoplayNext(z){Ie(z)},get seekToInteractive(){return Ae()},set seekToInteractive(z){Ae(z)},get playPrevChapter(){return Ge()},set playPrevChapter(z){Ge(z)},get volumeMultiplier(){return Ke()},set volumeMultiplier(z){Ke(z)},get showEndScreen(){return Le()},set showEndScreen(z){Le(z)},get keyboardControls(){return De()},set keyboardControls(z){De(z)}});return o(),Ko}var O3=me('<svg><!><path fill="currentColor" d="M38.245 6c3.566 0 4.859.371 6.162 1.069a7.27 7.27 0 0 1 3.025 3.024c.697 1.303 1.068 2.597 1.068 6.163v23.489c0 3.566-.371 4.859-1.069 6.162a7.27 7.27 0 0 1-3.024 3.025C43.104 49.629 41.811 50 38.245 50h-19.49c-3.565 0-4.859-.371-6.162-1.069a7.27 7.27 0 0 1-3.024-3.024C8.87 44.604 8.5 43.311 8.5 39.745v-23.49c0-3.565.371-4.859 1.069-6.162a7.27 7.27 0 0 1 3.024-3.024C13.896 6.37 15.19 6 18.756 6zm.314 3H18.756c-2.799 0-3.761.186-4.749.714a4.27 4.27 0 0 0-1.793 1.793c-.508.95-.7 1.876-.713 4.434L11.5 39.744c0 2.799.186 3.761.714 4.749a4.27 4.27 0 0 0 1.793 1.793c.988.528 1.95.714 4.749.714h19.489c2.798 0 3.76-.186 4.748-.714a4.27 4.27 0 0 0 1.793-1.793c.528-.988.714-1.95.714-4.748v-23.49c0-2.798-.186-3.76-.714-4.748a4.27 4.27 0 0 0-1.793-1.793c-.95-.508-1.876-.7-4.434-.713zM19.22 38c.445 0 .607.046.77.134a.9.9 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.163.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134zm-20-8c.445 0 .607.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.607-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.163-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134zm-20-8c.445 0 .607.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.608.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134zm-20-8c.445 0 .607.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.162.088-.324.134-.77.134h-1.436c-.446 0-.608-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.162-.088.324-.134.77-.134h1.436zm20 0c.445 0 .606.046.77.134a.9.9 0 0 1 .377.378c.088.162.134.324.134.77v1.436c0 .446-.046.608-.134.77a.9.9 0 0 1-.378.378c-.163.088-.324.134-.77.134h-1.436c-.446 0-.607-.046-.77-.134a.9.9 0 0 1-.378-.378c-.088-.162-.134-.324-.134-.77v-1.436c0-.446.046-.607.134-.77a.9.9 0 0 1 .378-.378c.163-.088.324-.134.77-.134z"></path></svg>');function lm(t,e){let i=we(e,["$$slots","$$events","$$legacy","children"]);var o=O3();let n;var a=h(o);de(a,()=>e.children??J),fe(),g(o),C(()=>n=he(o,n,{xmlns:"http://www.w3.org/2000/svg",width:"57",height:"60",fill:"none","aria-hidden":"true","data-testid":"stub-icon",role:"img",...i})),b(t,o)}function dm(t,e){let i=v(e,"isWhite",3,!1),o=m(()=>i()?"color: #fff;":"color: #909499;");lm(t,{get style(){return r(o)}})}var H3=M('<div class="title svelte-1y9fytq"> </div>'),F3=M('<div class="playerStub svelte-1y9fytq"><!> <!></div>'),U3={hash:"svelte-1y9fytq",code:".playerStub.svelte-1y9fytq {width:100%;height:100%;background-color:#222;display:flex;justify-content:center;align-items:center;position:relative;background-position:center;background-size:cover;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;}.title.svelte-1y9fytq {position:absolute;left:0;top:0;width:100%;font-size:15px;color:#fff;box-sizing:border-box;padding:18px 20px 10px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}"};function cm(t,e){q(t,U3);var i=F3(),o=h(i);{var n=d=>{var l=H3(),c=h(l,!0);g(l),C(()=>le(c,e.title)),b(d,l)};V(o,d=>{e.title&&d(n)})}var a=E(o,2);{var s=d=>{let l=m(()=>!!e.thumbUrl);dm(d,{get isWhite(){return r(l)}})};V(a,d=>{(!e.title||!e.thumbUrl)&&d(s)})}g(i),C(()=>et(i,e.thumbUrl?`background-image: url('${e.thumbUrl}')`:"")),b(t,i)}import{now as cx}from"@vkontakte/videoplayer-shared/evergreen";import{cloneDeepWith as ux,InterfaceLanguage as px,isNonNullable as gm,Logger as fx,Observable as mx,Subscription as Yh,once as vx,InternalsExposure as gx,skip as hx}from"@vkontakte/videoplayer-shared/evergreen";import{clientChecker as Zh,isMobile as _x}from"@vkontakte/videoplayer-core/evergreen";import{OneStat as bx,ThinOneStat as $x}from"@vkontakte/videoplayer-statistics/evergreen";import{Logger as z3,Subscription as q3}from"@vkontakte/videoplayer-shared/evergreen";var Hc=class{constructor(){this.subscription=new q3,this.logger=new z3,this.log=this.logger.createComponentLog("MediaSessionApi")}isSupported(){return"mediaSession"in navigator}setMetaData({title:e,artist:i="",thumbUrl:o=""}){this.isSupported()&&(navigator.mediaSession.metadata=new MediaMetadata({title:e,artist:i,artwork:[{src:o,sizes:"96x96",type:"image/png"},{src:o,sizes:"128x128",type:"image/png"},{src:o,sizes:"192x192",type:"image/png"},{src:o,sizes:"256x256",type:"image/png"},{src:o,sizes:"384x384",type:"image/png"},{src:o,sizes:"512x512",type:"image/png"}]}))}updateActionHandlers(e){this.resetActionHandlers(),this.setActionHandlers(e)}resetActionHandlers(){let e=[["play",null],["pause",null],["stop",null],["nexttrack",null],["previoustrack",null],["seekto",null],["seekbackward",null],["seekforward",null]];this.setActionHandlers(e)}setActionHandlers(e){if(this.isSupported())for(let[i,o]of e)try{navigator.mediaSession.setActionHandler?.(i,o)}catch{throw new Error(`The media session action "${i}" is not supported yet.`)}}attachToStore(e){!this.isSupported()||!e||(this.clearSubscriptions(),this.subscription.add(e.state.positionExact$.subscribe(i=>{let o=ve(e.state.currentPlaybackRate$),n=ve(e.state.duration$);if(!(!isFinite(i)||!isFinite(n)))try{navigator.mediaSession.setPositionState?.({position:i,playbackRate:o,duration:n})}catch{this.log({message:`MediaSession setPositionState can't call with position: ${i} and duration: ${n}`})}})))}clearSubscriptions(){this.subscription.unsubscribe()}destroy(){this.resetActionHandlers(),this.clearSubscriptions()}};import{ValueSubject as fm,detectEmbed as G3}from"@vkontakte/videoplayer-shared/evergreen";var K3=me('<svg><!><g fill="var(--btn-color, #fff)"><path d="m30.744 4 .744.005c2.981.046 4.526.385 6.127 1.24a8.77 8.77 0 0 1 3.475 3.347l.174.312.15.292c.772 1.553 1.066 3.18 1.085 6.251v9.045a1.5 1.5 0 0 1-3 .016l-.008-9.651c-.04-2.032-.228-3.12-.627-4.035l-.126-.27-.13-.252A5.77 5.77 0 0 0 36.2 7.891c-1.187-.635-2.339-.873-5.115-.89L22.255 7c-2.737 0-4.003.2-5.071.698l-.133.064-.251.13a5.77 5.77 0 0 0-2.409 2.408c-.635 1.187-.873 2.339-.89 5.114l-.001 20.83c0 2.738.2 4.004.698 5.072l.064.133.13.251a5.77 5.77 0 0 0 2.408 2.409c1.1.588 2.134.825 4.438.88l.323.006 3.695.005H26a1.5 1.5 0 0 1 0 3h-.756l-3.718-.005c-2.989-.047-4.526-.377-6.14-1.24a8.77 8.77 0 0 1-3.476-3.347l-.174-.312-.15-.292c-.731-1.472-1.036-3.016-1.08-5.803l-.006-.756v-20.49l.005-.743c.046-2.981.385-4.526 1.24-6.127a8.77 8.77 0 0 1 3.347-3.475l.312-.174.292-.15c1.472-.731 3.016-1.036 5.803-1.08L22.256 4z"></path><path d="M30.5 33.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C32.78 29 33.62 29 35.3 29h6.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311c.327.642.327 1.482.327 3.162v13.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C44.22 52 43.38 52 41.7 52h-6.4c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C30.5 49.72 30.5 48.88 30.5 47.2z"></path></g></svg>');function um(t,e){let i=we(e,["$$slots","$$events","$$legacy","children"]);var o=K3();let n;var a=h(o);de(a,()=>e.children??J),fe(),g(o),C(()=>n=he(o,n,{xmlns:"http://www.w3.org/2000/svg",width:"57",height:"56",fill:"none","aria-label":"dummy-image","data-testid":"pip-dummy-icon",role:"img",...i})),b(t,o)}var W3=M('<div><div><!></div> <span class="title svelte-1pbsod4"> </span></div>'),Q3={hash:"svelte-1pbsod4",code:".player-pip-dummy.svelte-1pbsod4 {width:100%;height:100%;background-color:#19191A;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;}.player-pip-dummy.is-pip-api.svelte-1pbsod4 {position:relative;}.dummy-image.svelte-1pbsod4 svg {transform:scale(1.07143);}.dummy-image.desktop.svelte-1pbsod4 {transform:scale(1.07143) rotate(-90deg) rotateY(180deg);}.title.svelte-1pbsod4 {font-size:16px;color:#fff;padding:18px 20px 10px;text-align:center;}"};function pm(t,e){F(e,!0),q(t,Q3);let[i,o]=He(),n=()=>$(c,"$interfaceLanguage$",i),a=()=>$(u,"$isMobile$",i),s=ye(),d=Vt(),l=!!s.webApi.pictureInPictureApi,c=s.interfaceLanguage$,u=s.ui.isMobile,_=s.ui.t,f=m(()=>n()&&_("pip_dummy_title")),y=Oc(d.view);var x=W3();Z(x,1,"player-pip-dummy svelte-1pbsod4",null,{},{"is-pip-api":l}),et(x,y);var w=h(x);let S;var I=h(w);um(I,{}),g(w);var L=E(w,2),A=h(L,!0);g(L),g(x),C(P=>{S=Z(w,1,"dummy-image svelte-1pbsod4",null,S,P),le(A,r(f))},[()=>({desktop:!a()})]),b(t,x),U(),o()}var j3=460,Y3=280,pd=class{playerDomElement;playerParentShadowRoot;playerDummyElement;svelteContext;pipWindow;info={isActive$:new fm(!1),isEnabled$:new fm(!1),type:1};constructor({enabled:e=!0}={enabled:!0}){this.info.isEnabled$=new fm(e)}isSupported(){let{isEmbed:e}=G3();return"documentPictureInPicture"in window&&!e}isActive(){return this.isSupported()&&!!documentPictureInPicture.window}setPlayerDomElement(e,i){this.playerDomElement=e,this.playerParentShadowRoot=i}setContext(e){this.svelteContext=e}async request(){if(!this.isSupported()||!this.playerDomElement||!this.playerParentShadowRoot)return;this.pipWindow=await documentPictureInPicture.requestWindow({width:j3,height:Y3,copyStyleSheets:!0}),this.pipWindow.document.body.style.margin="0";let e=[...this.playerParentShadowRoot.styleSheets].map(s=>[...s.cssRules].map(d=>d.cssText).join(" ")).filter(Boolean).join(`
364
- `),i=document.createElement("style");i.textContent=e;let o=this.createStretchedContainer(),n=o.attachShadow({mode:"open"});n.append(i),n.append(this.playerDomElement);let a={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=Qr(pm,a),this.pipWindow?.document.body.append(o),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",s=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Aa(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{documentPictureInPicture.window?.close(),e()})}async dispose(){await this.remove()}setEnabled(e){this.info.isEnabled$.next(e)}createStretchedContainer(){let e=document.createElement("div");return e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e}};function zh(t){return t instanceof pd}var Fc=class{static getLatestSupportedVersion(e){let i=new Ba,o=new pd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function fd(t,e){let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let n of i)o[n]=e[n]??t[n]??void 0;return o}var qh="Inner error. Unexpectedly root annotation container null reference exception",Kh="Annotation with such name already exists",Wh="Annotation with such name does not exist";var Rs=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};import{observeElementSize as Z3,Subscription as X3,throttleFn as J3}from"@vkontakte/videoplayer-shared/evergreen";var ex="1",tx=100,Uc=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new X3}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=J3(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},tx);this.subscriptions.add(Z3(this.rootAnnotationsContainer).subscribe(({width:o,height:n})=>{this.playerSize={width:o,height:n},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){if(!this.rootAnnotationsContainer)throw new Rs(qh);if(this.annotations.has(e))throw new Rs(Kh);i.style.zIndex=i.style.zIndex??ex,i.style.position="absolute",this.rootAnnotationsContainer.append(i),this.annotations.set(e,i)}get(e){let i=this.annotations.get(e);if(!i)throw new Rs(Wh);return i}remove(e){let i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(let e in this.annotations.keys())this.remove(e)}destroy(){this.annotations.clear(),this.subscriptions.unsubscribe(),this.mutationObserver?.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,o){let n=e.offsetTop,a=e.offsetLeft,s=e.offsetWidth,d=e.offsetHeight;return n<0||a<0||a+s>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};import{assertNonNullable as zc,Subscription as ix}from"@vkontakte/videoplayer-shared/evergreen";var yo=class{init({store:e,microStores:i,interactiveController:o,config:n}){return zc(e),zc(i),zc(n),n.interactiveData&&zc(o),this.subscription=new ix,this.subscription}};var md=class extends yo{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(a=>{this.state$.set(a?!0:null)})),o}};var vd=class extends yo{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:n,store:a}=i,{fakeIsPlaying$:s}=n,{isInteractiveExpectation$:d,isPlaying$:l}=a.state,{controlsVisible:c,isMobile:u}=a.ui,_=ve(u),f=()=>_&&ve(c);return o.add(c.subscribe(y=>{if(!_)return;let x=ve(s);ve(l)?this.state$.set(y):x!==null&&this.state$.set(!x||y)})),o.add(l.subscribe(y=>{this.state$.set(!y||f())})),o.add(s.subscribe(y=>{if(y===null)return;let x=ve(d);if(f()){this.state$.set(!0);return}x&&this.state$.set(!y)})),o}};var gd=class extends yo{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=ae("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(a=>{a.length&&(a.every(s=>s.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};import{combine as ox}from"@vkontakte/videoplayer-shared/evergreen";var mm=ae(!1),qc=null,hd=class extends yo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...mm,set:(i,o=!1)=>{i!==ve(mm)&&(this.clearTimeout(),mm.set(i),!i&&qc&&(qc=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:n,config:a}=i,{isInteractiveTime$:s,isPlaying$:d}=n.state,l=n.ui.controlsVisible,{interactiveTimeIndicator:c}=n.ui.controls;o.add(l.subscribe(_=>{ve(s)&&_&&this.state$.set(!1)}));let u=a?.interactiveData||{tooltipHelpHintActive:!1};return o.add(ox({isPlaying$:d,isInteractiveTime$:s,interactiveTimeIndicator:c}).subscribe(({isPlaying$:_,isInteractiveTime$:f,interactiveTimeIndicator:y})=>{if(!(!_||!y?.isDisplayed)){if(!f)return this.state$.set(!1);u.tooltipHelpHintActive&&qc===null&&(qc=!0,u.tooltipHelpHintActive=!1,this.state$.set(!0),n.callbacks?.onInteractiveTimeIndicatorHintDeactivated?.())}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};import{combine as nx,noop as rx}from"@vkontakte/videoplayer-shared/evergreen";var _d=class extends yo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ae(null),toggle:rx};this.checkIfShouldHide=i=>fa(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:a}=i,s=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(ve(s)))return;let l=ve(this.state$),{isEnded$:c,playbackState$:u}=n.state,{disabledControls$:_}=n.ui.controls,f=ve(c),y=ve(u);if(l)try{await a?.toggleGraphView(!1),this.state$.set(!1),_.remove(Qu),!f&&this.graphMadePause&&n.actions.internal.play()}catch{d({message:"Cant hide graph"})}else{this.graphMadePause=y==="playing";try{await a?.toggleGraphView(!0),this.state$.set(!0),_.add(Qu),!f&&this.graphMadePause&&n.actions.internal.pause()}catch{d({message:"Cant show graph"})}}},o.add(nx({graphIsOpened:this.state$,currentGridType:s}).subscribe(async({graphIsOpened:l,currentGridType:c})=>{if(this.checkIfShouldHide(c)&&l)try{await a?.toggleGraphView(!1),this.state$.set(!1)}catch{d({message:"Cant hide graph"})}})),o}};import{ValueSubject as Qh}from"@vkontakte/videoplayer-shared/evergreen";var bd=class extends yo{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:ae(!1),isEnabled$:ae(!1),type$:ae(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:a,isEnabled$:s,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new Qh(!1),isEnabled$:new Qh(!1)}};return o.add(a.subscribe(l=>{this.state$.isActive$.set(l)})),o.add(s.subscribe(l=>{this.state$.isEnabled$.set(l)})),this.state$.type$.set(d),o}};import{filter as lx,filterChanged as dx}from"@vkontakte/videoplayer-shared/evergreen";import{safeStorage as vm}from"@vkontakte/videoplayer-shared/evergreen";var Gh=({maxShowCount:t,timeout:e})=>{let i=[t!==0?ax({maxCount:t}):void 0,e!==0?sx({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},ax=({maxCount:t})=>{let e={};return{notificationShowed:i=>{e[i]=(e[i]??0)+1,vm.set("videoplayer_notifications_manager_count",JSON.stringify(e[i]??0))},canShowNotification:i=>(e[i]??0)<t}},sx=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(vm.get(e)||"{}")}catch{return{}}},o=a=>vm.set(e,JSON.stringify(a)),n=a=>{let s=i();delete s[a],o(s)};return{notificationShowed:a=>{o({...i(),[a]:{timeout:t,launchTime:Date.now()}})},canShowNotification:a=>{let s=i()[a];if(s){let d=Date.now()-s.launchTime>t;return d&&n(a),d}else return!0}}};var $d=class extends yo{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:ae({}),showNotification:i=>{this.state$.notificationsToShow$.update(o=>(o[i]=!0,o)),this.notificationManager.notificationShowed(i)},closeNotification:i=>{this.state$.notificationsToShow$.update(o=>(delete o[i],o))}}}init(i){let o=super.init(i),{store:n,uiConfig:{features:{maxCountShowSlowVideoNotification:a,timeoutShowSlowVideoNotification:s,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:l}}}=i;this.notificationManager=Gh({maxShowCount:a,timeout:s});let c=n.getPlayer();return o.add(c.events.severeStallOccured$.pipe(dx(),lx(u=>u)).subscribe(()=>{d&&!c.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(l&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var jh=()=>[md,vd,gd,hd,_d,bd,$d].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});import{devNull as yd}from"@vkontakte/videoplayer-shared/evergreen";var yx={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:px.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:_x(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},ln=Y(void 0),Kc=class extends HTMLElement{svelteStubComponent;svelteRootComponent;store;microStoresRoot;statistics;sentry;_shadowRoot;playerContainer;rootContainer;shadowRootContainer;uiConfig;coreConfig;statisticsConfig;interactiveController;interactiveContainer;graphMadePause;currentPlayingVideoIndex=0;needToRepeatPlaylist=!1;videoConfig=void 0;pictureInPictureApi=void 0;mediaSessionApi=void 0;unsubscribePlayerPhaseSubscription=void 0;logger;log;subscription;interactiveSubscription;annotationsApi=void 0;slotsApi;prevIsid=void 0;isInited=!1;internalsExposure=null;constructor(){super(),yd.create("ui"),this.logger=new fx,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new Yh,this.interactiveSubscription=new Yh,this.graphMadePause=!1}connectedCallback(){if(this.isInited)return;this.initPlayerRootContainers();let e=this.getAttribute("stub-title")??void 0,i=this.getAttribute("stub-thumb-url")??void 0,o=pe({title:e,thumbUrl:i}),n={target:this.playerContainer,props:o};this.svelteStubComponent=Qr(cm,n)}disconnectedCallback(){this.annotationsApi?.destroy(),this.mediaSessionApi?.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.subscription.unsubscribe(),this.unsubscribePlayerPhaseSubscription?.(),this.interactiveController?.destroy(),this.interactiveSubscription.unsubscribe(),this.internalsExposure?.destroy(),yd.destroy("ui")}initPlayerRootContainers(){this.rootContainer=document.createElement("div"),this.rootContainer.style.position="relative",this.rootContainer.className="root-container",this.rootContainer.style.width="100%",this.rootContainer.style.height="100%",this.rootContainer.style.minHeight="206px",this.shadowRootContainer=document.createElement("div"),this.shadowRootContainer.style.position="absolute",this.shadowRootContainer.className="shadow-root-container",this.shadowRootContainer.style.width="100%",this.shadowRootContainer.style.height="100%",this._shadowRoot=this.shadowRootContainer.attachShadow({mode:"open"}),this.playerContainer=document.createElement("div"),this.playerContainer.style.all="initial",this.playerContainer.style.display="block",this.playerContainer.style.contain="strict",this.playerContainer.style.width="100%",this.playerContainer.style.height="100%",this._shadowRoot.append(this.playerContainer),this.rootContainer.append(this.shadowRootContainer),this.append(this.rootContainer)}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1&&this.videoConfig.showNextPrevButtons:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){return this.store?.ui.controls.disabledControls$?.includes(e)||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};let e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createOneStat=(e,i={})=>{let{albumId:o,statPlace:n,statUserSalt:a,statTrackCode:s,statVKAppId:d,refreshStatAuthToken:l,autoplay:c,isMobile:u,isTouch:_,refDomain:f,deviceId:y,interactiveData:x}=fd(this.videoConfig,i),w=x?.projectInfo?.pid,S=this.interactiveController?.state.isReplay$.getValue()??!1;S&&(this.prevIsid=void 0);let{unitedVideoId:I,isClip:L=!1}=e;if(this.uiConfig.features.statistics&&I)return new bx({movieId:I,albumId:o,place:n,trackCode:s,vkAppId:d,autoplay:(c&&!this.interactiveController)??!1,mobile:_??u,clip:L,refDomain:f,deviceId:y,...w&&(!this.isInited||S)&&{projectId:Number(w)}},{refreshAuthToken:l,userSalt:a,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})};createThinOneStat(e,i={}){let{deviceId:o,preload:n,refreshStatAuthToken:a}=fd(this.videoConfig,i),{unitedVideoId:s}=e;return new $x.ThinOneStat({deviceId:o,movieId:s,preload:n},{config:this.statisticsConfig,refreshAuthToken:a})}createPlayer(e,i={},o){if(!this.videoConfig)return;let{albumId:n,statPlace:a,statAuthToken:s,preload:d,autoplay:l,volume:c,muted:u,fromTime:_,canRewindLive:f,supportLink:y,showAds:x,adsSlotId:w,adsParams:S={},adsPreviewParam:I,adsAutoplayParam:L,interfaceLanguage:A,isCyrillicRelatedInterface:P,logoClickable:k,logoHidden:N,isMobile:Q,isTouch:G,isAudioDisabled:ee,isLiveCatchUpMode:oe,fullScreenTarget:ne,failoverHosts:te,canDownload:ge,callbacks:X,interactiveData:Re,showThumbTimer:Me,additionalButtons:se=[],additionalSettingsMenuItems:Fe=[],additionalContextMenuItems:j=[],repeat:B,saveRate:Be,volumeMultiplier:_e,showEndScreen:ke,showAutoplayNext:Oe}=fd(this.videoConfig,i),{sources:ce,title:R,thumbUrl:be,unitedVideoId:Ae,isClip:Ge=!1,duration:Ke,adsParams:Ie={},videoEpisodes:Le,previewThumbsData:De,subtitles:dt,live:gt}=e,it={...S,...Ie},Ct=this.getNextVideoInfo(),ot={sources:ce,title:R,thumbUrl:be,subtitles:dt,unitedVideoId:Ae,isClip:Ge,live:gt,albumId:n,statPlace:a,autoplay:l,muted:u,volume:c,fromTime:_,canRewindLive:f,showAds:x,adsSlotId:w,adsParams:it,adsPreviewParam:I,adsAutoplayParam:L,duration:Ke,logoClickable:k,logoHidden:N,isTouch:G??Q,repeat:B,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Ct.nextVideoTitle,endScreenVideoThumb:Ct.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},ct={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(ot)}`});let At=this.interactiveController?.state.statistics$.getValue(),Se,Ne=this.createThinOneStat(e,i);(Se||Ne)&&(this.statistics=new Sc(Se,Ne,At?.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new Va(this.uiConfig.sentry,{version:ys,env:Yd},{movieId:Ae,albumId:n,place:a,autoplay:(l&&!this.interactiveController)??!1,mobile:G??Q,clip:Ge}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat?.isid$.getValue()),this.sentry={...this.sentry,...Va.getInstance()};let W=!!Re,re=[],ie="tooltip_interactive_go_back_disabled_first";if(W&&this.interactiveController){let pt=this.interactiveController.state.isInitialChapter$.getValue(),Ee=this.interactiveController.getHistoryState();pt&&re.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||re.push("SEEK_TO_INTERACTIVE_BUTTON"),Ee.hasPrevChapter$.getValue()||(re.push("PLAY_PREV_CHAPTER_BUTTON"),pt||(Ee.isGoBackLimited$.getValue()?ie="tooltip_interactive_go_back_disabled_limit":ie="tooltip_interactive_go_back_disabled"))}let Ue=()=>{this.isInited=!1,this.prevIsid=void 0;let pt=o?.info.isEnded$.getValue()&&this.interactiveController?.state.isEndChapter$.getValue();X.onReplayInteractiveVideo&&!pt?X.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=fh({player:o,interfaceLanguage:A,isCyrillicRelatedInterface:P,videoId:Ae,isClip:Ge,isLiveCatchUpMode:oe,isAudioDisabled:ee,statAuthToken:s,callbacks:X,webApi:ct,videoEpisodes:Le,previewThumbsData:De,canDownload:ge,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:re,isInteractive:W,saveRate:Be,interactiveRanges$:this.interactiveController?.state.interactiveRanges$,isInteractiveTime$:this.interactiveController?.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:Ue,playPrevChapterDisabledTooltip:ie,hasInteractiveBranches:!!this.interactiveController?.getChapterBranches()?.length,additionalButtons:this.uiConfig.features.additionalButtons?se:[],additionalSettingsMenuItems:Fe??[],additionalContextMenuItems:j??[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:B&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure});let{stores:je}=this.microStoresRoot=jh(),Pt=()=>{if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Ee=>X?.onCurrentFormatChanged?.(Ee))),this.subscription.add(je.interactiveControlsOpacity$.subscribe(Ee=>{Ee!==null&&this?.interactiveController?.setDisabledControls(Ee)})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Ee=>X?.onThroughputEstimationChanged?.(Ee))),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Ee=>X?.onTrafficSavingEnabledChanged?.(Ee))),this.subscription.add(new mx(Ee=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Ce=>Ee.next(Ce)))}).pipe(this.uiConfig.features.skipInitialPlaybackRateValue?hx(1):Ee=>Ee).subscribe(Ee=>X?.onCurrentPlaybackRateChanged?.(Ee))),this.subscription.add(this.store.state.volume$.subscribe(Ee=>X?.onVolumeChange?.(Ee))),this.subscription.add(this.store.state.muted$.subscribe(Ee=>Ee?X?.onMute?.():X?.onUnmute?.())),this.subscription.add(this.store.state.videoBitrate$.subscribe(Ee=>X?.onVideoBitrateChanged?.(Ee))),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Ee=>{let Ce=this.store?.ui.controls.disabledControls$;Ce&&(Ee&&!Ce.includes(gl)&&Ce.add(gl),Ee||Ce.remove(gl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Ee=>{if(!Zh.browser.isSamsungBrowser||!Ee||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter(this.videoConfig?.callbacks.onExternalFullscreenExit)})),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(Ee=>X?.onVSIDChanged?.(Ee))),this.initMediaSession(),D(ln,pe({interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:ce,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:R,thumbUrl:be,subtitles:dt,live:gt,preload:d,autoplay:l,muted:u,volume:c,fromTime:_,canRewindLive:f,supportLink:y,showAds:x,adsSlotId:w,adsParams:it,adsPreviewParam:I,adsAutoplayParam:L,duration:Ke,logoClickable:k,logoHidden:N,isMobile:G??Q,failoverHosts:te,fullScreenTarget:ne,saveRate:Be,shadowRootContainer:this.shadowRootContainer,showMiniTimer:Me,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Ct.nextVideoTitle,endScreenVideoThumb:Ct.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:_e,showEndScreen:ke,showAutoplayNext:Oe}));let pt={target:this.playerContainer,props:r(ln)};this.svelteRootComponent=Qr(sm,pt),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,this.videoConfig?.callbacks?.onInited?.()),this.internalsExposure?.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&this.videoConfig?.callbacks?.onDevNullLog?yd.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):yd.destroy("ui")};this.coreConfig.asyncResolveClientChecker?Zh.isInited$.subscribe(pt=>{pt&&(console.log("UI SDK async start"),Pt())}):Pt()}addPlayerInfoSubscriptions(){let e=this.store,i=this.microStoresRoot?.stores;if(!e||!i)return;let o=this.videoConfig?.callbacks;o&&this.subscription.add(e.playerPhase.subscribe(a=>o.onPlayerPhaseChanged?.(a))).add(e.state.playbackState$.subscribe(a=>a&&o.onPlaybackStateChanged?.(a))).add(e.state.isLive$.subscribe(a=>o.onIsLiveChanged?.(a))).add(e.state.isActiveLive$.subscribe(a=>o.onIsActiveLiveChanged?.(a))).add(e.state.isAudioAvailable$.subscribe(a=>o.onIsAudioAvailableChanged?.(a))).add(e.state.currentQuality$.subscribe(a=>o.onCurrentQualityChanged?.(a))).add(e.state.availableQualities$.subscribe(a=>o.onAvailableQualitiesChanged?.(a.map(({value:s})=>s).filter(s=>s!=="auto")))).add(e.state.availableAudioStreams$.subscribe(a=>{a.length>1&&o.onAudioLanguagesAvailable&&o.onAudioLanguagesAvailable()})).add(i.pictureInPicture$.isActive$.subscribe(a=>a?o.onPiPEnter?.():o.onPiPExit?.()));let n=o?.uiInfo;n&&this.subscription.add(e.ui.controlsVisible.subscribe(a=>n.onControlsVisibleChanged?.(a))).add(e.ui.isMobile.subscribe(a=>n.onIsMobileChanged?.(a))).add(e.ui.playerSize.subscribe(a=>n.onPlayerSizeChanged?.(a))).add(e.ui.controls.prevButton.subscribe(a=>n.onPrevButtonChanged?.(a))).add(e.ui.controls.playButton.subscribe(a=>n.onPlayButtonChanged?.(a))).add(e.ui.controls.replayButton.subscribe(a=>n.onReplayButtonChanged?.(a))).add(e.ui.controls.nextButton.subscribe(a=>n.onNextButtonChanged?.(a))).add(e.ui.controls.playPrevChapterButton.subscribe(a=>n.onPlayPrevChapterChanged?.(a))).add(e.ui.controls.seekToInteractiveButton.subscribe(a=>n.onSeekToInteractiveButtonChanged?.(a))).add(e.ui.controls.interactiveGraphButton.subscribe(a=>n.onGraphButtonChanged?.(a))).add(e.ui.controls.liveButton.subscribe(a=>n.onLiveButtonChanged?.(a))).add(e.ui.controls.time.subscribe(a=>n.onTimeUpdateChanged?.(a))).add(e.ui.controls.episodes.subscribe(a=>n.onEpisodesChanged?.(a))).add(e.ui.controls.subtitles.subscribe(a=>n.onSubtitlesChanged?.(a))).add(e.ui.controls.settings.subscribe(a=>n.onSettingsChanged?.(a))).add(e.ui.controls.fullscreen.subscribe(a=>n.onFullscreenChanged?.(a))).add(e.ui.controls.chromecast.subscribe(a=>n.onChromecastChanged?.(a))).add(e.ui.controls.pip.subscribe(a=>n.onPipChanged?.(a))).add(e.ui.controls.vkLogo.subscribe(a=>n.onVkLogoChanged?.(a))).add(e.ui.controls.interactiveTimeIndicator.subscribe(a=>n.onInteractiveTimeIndicatorChanged?.(a))).add(e.ui.controls.timeline.subscribe(a=>n.onTimelineChanged?.(a)))}playNextVideo(){this.videoConfig&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){this.videoConfig&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}createPlayerWithCurrentVideo(e,i=!0){if(!this.videoConfig)return;let o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&gm(o.unitedVideoId)&&this.store.actions.internal.nextMovie(o.unitedVideoId),this.unmountComponent(this.svelteRootComponent),this.createPlayer(o,{autoplay:i,fromTime:0},e)}playPrevChapter(){this.interactiveController?.playPrevChapter()}seekToInteractive(){let e=this.interactiveController?.getNextInteractiveStartTime();typeof e=="number"&&this.seekTime(e/1e3)}async initInteractives(){if(this.videoConfig?.interactiveData)try{let{Interactives:e}=await import("@vkontakte/videoplayer-interactive/evergreen");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let i=this.store?.interfaceLanguage$,o=i?ve(i):this.videoConfig.interfaceLanguage,{projectInfo:n,initChapterId:a,historyApi:s,videoLoader:d}=this.videoConfig.interactiveData;this.interactiveController=new e({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:o,graph:this.uiConfig.features.interactiveGraph,projectInfo:n,initChapterId:a,historyApi:s,vkVideoLoader:d,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,interactiveTimeOpenUri:this.uiConfig.features.interactiveTimeOpenUri,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig,createOneStat:this.createOneStat,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation}});let{isInteractiveExpectation$:l,isSeekable$:c}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(c.subscribe(_=>{if(!this.isInited)return;let f=this.store;_?f.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):f.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(l.subscribe(_=>{this.store&&this.store.state.isInteractiveExpectation$.set(_)}));let u=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(_=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={..._.config,title:n?.title||_.config.title};let f=u?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(_.player,f),u&&(u=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:_,actionType:f})=>{if(!this.store||!this.microStoresRoot)return;let y=l.getValue();if(_==="action-choice"&&f==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(hl)),_==="action-choice-canceled"){let x=ve(this.store.state.isPlaying$)||y;if((this.videoConfig?.isTouch??this.videoConfig?.isMobile)&&x){this.store.ui.interactiveHideMobileControls.set(!0);return}this.videoConfig?.callbacks.onDisabledInteractiveClick?.()}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:_,removeAllOpenURI:f})=>{this.store&&_==="container-fake-removed"&&f&&this.store.ui.controls.disabledControls$.remove(hl)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),this.videoConfig?.callbacks?.onInteractiveHistoryChanged){let _=this.interactiveController.getHistoryState();this.subscription.add(_.history$.subscribe(f=>{f.length&&this.videoConfig?.callbacks?.onInteractiveHistoryChanged?.(f)}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),this.videoConfig?.callbacks.onInteractiveTimeIndicatorClick?.()})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(_=>{this.log({message:_.toString()})}))}catch(e){this.log({message:e.message})}}initPlayer(e,i={}){if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");if(this.videoConfig=fd(yx,ux(e,o=>o instanceof HTMLElement?o:void 0)),this.uiConfig=Gv(i.ui??{}),this.coreConfig=i.core??{configName:[]},this.statisticsConfig=i.statistics??{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer.style.minHeight="unset",this.style.display="block",this.style.width="100%",this.style.height="100%"),this.sentry={config:this.uiConfig.sentry??{}},this.uiConfig.features.exposeInternalsToGlobal&&(this.internalsExposure??=new gx("UI")),yd.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+this.videoConfig?.showAds],numbers:[cx()]}),gm(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.uiConfig.features.mediaSession??this.videoConfig.isMediaSessionEnabled??!0),gm(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=this.uiConfig.features.pip??this.videoConfig.isPictureInPictureEnabled??!0,this.uiConfig.features.dpip=this.uiConfig.features.dpip??this.videoConfig.isPictureInPictureEnabled??!0),this.videoConfig.isTouch=this.uiConfig.isMobile??this.videoConfig.isTouch??this.videoConfig.isMobile,this.videoConfig.autoplay&&=this.uiConfig.features.autoplay,this.videoConfig.showAds=this.uiConfig.ads.enable??this.videoConfig.showAds,this.videoConfig.adsSlotId=this.uiConfig.ads.slot??this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=this.uiConfig.ads.preview??this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!(this.uiConfig.showLogo??!this.videoConfig.logoHidden),this.videoConfig.canRewindLive&&=this.uiConfig.features.liveRewind,this.videoConfig.supportLink=this.videoConfig.supportLink??this.uiConfig.supportLink,this.videoConfig.showEndScreen=this.uiConfig.features.endScreen??this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=this.uiConfig.features.autoplayNext??this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=this.uiConfig.features.nextPrevButtons??this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&this.videoConfig.videos?.[this.videoConfig.videoIndex]?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let o={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=Fc.getLatestSupportedVersion(o):this.pictureInPictureApi=new Ba(o)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new Hc:void 0,this.slotsApi=this.uiConfig.features.slots?new Bc:void 0,this.annotationsApi=this.uiConfig.features.annotations?new Uc(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),this.slotsApi?.init(this.shadowRootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveSubscription.unsubscribe()),this.videoConfig.interactiveData?this.initInteractives():this.createPlayer(this.videoConfig.videos[this.currentPlayingVideoIndex]),zh(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateVideos(e,i){if(!this.videoConfig)return;this.log({message:`update ${i} videos, videos: ${JSON.stringify(e)}`}),i==="prev"?(this.videoConfig.videos.splice(0,this.currentPlayingVideoIndex),this.videoConfig.videos.unshift(...e),this.currentPlayingVideoIndex=e.length):i==="next"&&(this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e));let o=this.getNextVideoInfo();r(ln)&&(r(ln).showNextPrevButtons=this.needToShowNextPrevButtons(),r(ln).nextButtonActive=this.isNextButtonActive(),r(ln).prevButtonActive=this.isPrevButtonActive(),r(ln).endScreenVideoTitle=o.nextVideoTitle,r(ln).endScreenVideoThumb=o.nextVideoThumb,r(ln).isOneVideoPlaylist=this.isOneVideoPlaylist())}updatePrevVideos(e){this.updateVideos(e,"prev")}updateNextVideos(e){this.updateVideos(e,"next")}initMediaSession(){this.mediaSessionApi&&(this.unsubscribePlayerPhaseSubscription?.(),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=this.store?.playerPhase.subscribe(e=>{e==="video"?this.setupMediaSessionForVideo():e==="ads"&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},o=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",n=>this.seekTime(n.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:i}),this.mediaSessionApi.updateActionHandlers(o),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}play(){this.isControlDisabled("PLAY_BUTTON")||this.store?.playerPhase.is("LiveWaitingStart")||this.store?.playerPhase.is("LiveWaitingRecover")||this.store?.playerPhase.is("LiveWaitingRecord")||(this.log({message:"play"}),this.svelteRootComponent?.play())}pause(){this.log({message:"pause"}),this.svelteRootComponent?.pause()}stop(){if(!this.videoConfig)return;this.log({message:"stop"});let e=!!this.interactiveController;e&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveContainer=void 0,this.interactiveSubscription.unsubscribe()),this.unmountComponent(this.svelteStubComponent),this.mediaSessionApi?.destroy();let i=this.videoConfig.videos[0];i&&(this.unmountComponent(this.svelteRootComponent),e?(this.videoConfig.autoplay=!1,this.initInteractives()):this.createPlayer(i))}setMuted(e){this.log({message:`set muted, muted: ${e}`}),this.svelteRootComponent?.setMuted(e)}setPiPEnabled(e){this.store?.webApi.pictureInPictureApi?.setEnabled(e)}setVolume(e){this.log({message:`set volume, volume: ${e}`}),this.svelteRootComponent?.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,r(ln)&&(r(ln).needToRepeatPlaylist=this.needToRepeatPlaylist,r(ln).showNextPrevButtons=this.needToShowNextPrevButtons(),r(ln).nextButtonActive=this.isNextButtonActive(),r(ln).prevButtonActive=this.isPrevButtonActive())}seekTime(e){this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${e}`}),this.svelteRootComponent?.seekTime(e))}seekEpisodeStartTime(e){this.log({message:`seek episode start time, time: ${e}`}),this.svelteRootComponent?.seekEpisodeStartTime(e)}returnFocusToEpisodes(){this.log({message:"return focus to episodes button"}),this.svelteRootComponent?.returnFocusToEpisodes()}setPlaybackRate(e){this.log({message:`set playback rate to: ${e}`}),this.svelteRootComponent?.setPlaybackRate(e)}setAutoQualityLimits(e){this.log({message:`set auto quality limitation. Max: ${e.max??"none"}. Min: ${e.min??"none"}`}),this.svelteRootComponent?.setAutoQualityLimits(e)}addLanguage(e){this.store?.actions.internal.addLanguage(e)}async setLanguage(e){await this.store?.actions.internal.setLanguage(e)}setLiveStart(e){this.log({message:"live started"}),this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingStart(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!0})}setLiveWaitingRecover(){this.log({message:"live waiting"}),this.store?.callbacks&&(this.store.callbacks.onLiveEnded=()=>{this.store?.actions.internal.setLiveWaitingRecover(!0),this.store?.destroy()})}setLiveWaitingRecord(){this.log({message:"post live"}),this.store?.callbacks&&(this.store.callbacks.onLiveEnded=()=>{this.store?.actions.internal.setLiveWaitingRecord(!0),this.store?.destroy()})}setLiveEnd(e){this.log({message:"live ended"}),this.store?.callbacks&&(this.store.callbacks.onLiveEnded=()=>{this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})})}setLiveLowLatency(e){this.log({message:"live switch to low latency "+e}),this.store?.actions.external.setLiveLowLatency(e)}getDeviceId(){return this.statistics?.oneStat?.getDeviceId()??void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}async replayInteractiveChapter(e){if(this.interactiveController&&this.store?.state.positionExact$){let i=ve(this.store.state.positionExact$),n=ve(this.store.state.interactiveEpisodes$).find(s=>!s.completed);this.interactiveController.events.playerChanged$.pipe(vx()).subscribe(()=>{n&&i>=n.time?this.seekTime(n.time):this.seekTime(i),e?.()});let a=this.interactiveController.getCurrentChapter();await this.interactiveController.setChapter({chapterId:a?.chapter?.id,pushToHistory:!1})}}showInteractiveIndicatorTooltip(e,i=!1){this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}switchToActiveLive(){this.store?.actions.internal.switchToActiveLive()}updateAdditionalSettingsItem(e,i){this.store?.actions.external.updateAdditionalSettingsItem(e,i)}addAdditionalSettingsItem(e){this.store?.actions.external.addAdditionalSettingsItem(e)}removeAdditionalSettingsItem(e){this.store?.actions.external.removeAdditionalSettingsItem(e)}updateAdditionalContextItem(e,i){this.store?.actions.external.updateAdditionalContextItem(e,i)}addAdditionalContextItem(e){this.store?.actions.external.addAdditionalContextItem(e)}removeAdditionalContextItem(e){this.store?.actions.external.removeAdditionalContextItem(e)}updateAdditionalButton(e,i){this.store?.actions.external.updateAdditionalButton(e,i)}addAdditionalButton(e){this.store?.actions.external.addAdditionalButton(e)}removeAdditionalButton(e){this.store?.actions.external.removeAdditionalButton(e)}updateStatContext(e){this.statistics&&this.statistics.oneStat&&this.statistics.oneStat.updateContext(e)}handleTimerNextVideo(e){this.store?.actions.internal.setTimerNextVideoRunning(e)}focus(){this.svelteRootComponent?.keyboardControls?.focus?.()}unmountComponent(e){e&&Aa(e)}};import{InterfaceLanguage as xY,VKNumericLanguage as wY,loadVKLangPack as SY}from"@vkontakte/videoplayer-shared/evergreen";import{VideoQuality as TY,VideoFormat as kY}from"@vkontakte/videoplayer-core/evergreen";var mY=()=>{window.customElements.define("vk-video-player",Kc)};export{Cc as ControlButtonType,Vr as GridTypes,xY as InterfaceLanguage,Tl as MenuItemType,Ra as PlayerPhase,ys as VERSION,wY as VKNumericLanguage,kY as VideoFormat,TY as VideoQuality,SY as loadVKLangPack,mY as registerPlayerWebComponent};
364
+ `),i=document.createElement("style");i.textContent=e;let o=this.createStretchedContainer(),n=o.attachShadow({mode:"open"});n.append(i),n.append(this.playerDomElement);let a={target:this.playerParentShadowRoot,context:this.svelteContext};this.playerDummyElement=Qr(pm,a),this.pipWindow?.document.body.append(o),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",s=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Aa(this.playerDummyElement),this.playerParentShadowRoot.append(this.playerDomElement),this.info.isActive$.next(!1))})}async remove(){return new Promise(e=>{documentPictureInPicture.window?.close(),e()})}async dispose(){await this.remove()}setEnabled(e){this.info.isEnabled$.next(e)}createStretchedContainer(){let e=document.createElement("div");return e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e}};function zh(t){return t instanceof pd}var Fc=class{static getLatestSupportedVersion(e){let i=new Ba,o=new pd(e);if(o.isSupported())return o;if(i.isSupported())return i}};function fd(t,e){let i=new Set([...Object.keys(t),...Object.keys(e)]),o={};for(let n of i)o[n]=e[n]??t[n]??void 0;return o}var qh="Inner error. Unexpectedly root annotation container null reference exception",Kh="Annotation with such name already exists",Wh="Annotation with such name does not exist";var Rs=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};import{observeElementSize as Z3,Subscription as X3,throttleFn as J3}from"@vkontakte/videoplayer-shared/evergreen";var ex="1",tx=100,Uc=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new X3}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=J3(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},tx);this.subscriptions.add(Z3(this.rootAnnotationsContainer).subscribe(({width:o,height:n})=>{this.playerSize={width:o,height:n},i()})),this.mutationObserver=new MutationObserver(i),this.mutationObserver.observe(this.rootAnnotationsContainer,{attributes:!0,childList:!0,subtree:!0,characterData:!0})}add(e,i){if(!this.rootAnnotationsContainer)throw new Rs(qh);if(this.annotations.has(e))throw new Rs(Kh);i.style.zIndex=i.style.zIndex??ex,i.style.position="absolute",this.rootAnnotationsContainer.append(i),this.annotations.set(e,i)}get(e){let i=this.annotations.get(e);if(!i)throw new Rs(Wh);return i}remove(e){let i=this.get(e);this.annotations.delete(e)&&i.remove()}clear(){for(let e in this.annotations.keys())this.remove(e)}destroy(){this.annotations.clear(),this.subscriptions.unsubscribe(),this.mutationObserver?.disconnect(),this.rootAnnotationsContainer=null}isElementExceedsBoundaries(e,i,o){let n=e.offsetTop,a=e.offsetLeft,s=e.offsetWidth,d=e.offsetHeight;return n<0||a<0||a+s>i||n+d>o}registryRootContainer(e){}addLayer(e){return document.createElement("div")}getLayer(e){}removeLayer(e){}clearLayer(e){}detach(){}reattach(){}};import{assertNonNullable as zc,Subscription as ix}from"@vkontakte/videoplayer-shared/evergreen";var yo=class{init({store:e,microStores:i,interactiveController:o,config:n}){return zc(e),zc(i),zc(n),n.interactiveData&&zc(o),this.subscription=new ix,this.subscription}};var md=class extends yo{constructor(){super(...arguments);this.stateName="fakeIsPlaying$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{isInteractiveExpectation$:n}=i.store.state;return o.add(n.subscribe(a=>{this.state$.set(a?!0:null)})),o}};var vd=class extends yo{constructor(){super(...arguments);this.stateName="interactiveControlsOpacity$";this.state$={...ae(null),toggle:()=>this.state$.update(i=>!i)}}init(i){let o=super.init(i),{microStores:n,store:a}=i,{fakeIsPlaying$:s}=n,{isInteractiveExpectation$:d,isPlaying$:l}=a.state,{controlsVisible:c,isMobile:u}=a.ui,_=ve(u),f=()=>_&&ve(c);return o.add(c.subscribe(y=>{if(!_)return;let x=ve(s);ve(l)?this.state$.set(y):x!==null&&this.state$.set(!x||y)})),o.add(l.subscribe(y=>{this.state$.set(!y||f())})),o.add(s.subscribe(y=>{if(y===null)return;let x=ve(d);if(f()){this.state$.set(!0);return}x&&this.state$.set(!y)})),o}};var gd=class extends yo{constructor(){super(...arguments);this.stateName="seekToInteractiveDisabledTooltip$";this.state$=ae("tooltip_chapter_without_interactive")}init(i){let o=super.init(i),{store:n}=i;return o.add(n.state.interactiveEpisodes$.subscribe(a=>{a.length&&(a.every(s=>s.completed)?this.state$.set("tooltip_interactive_of_chapter_completed"):this.state$.set("tooltip_disabled_when_interactive"))})),o}};import{combine as ox}from"@vkontakte/videoplayer-shared/evergreen";var mm=ae(!1),qc=null,hd=class extends yo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...mm,set:(i,o=!1)=>{i!==ve(mm)&&(this.clearTimeout(),mm.set(i),!i&&qc&&(qc=!1),i&&o&&(this.timeout=setTimeout(()=>{this.state$.set(!1)},3e3)))},clearTimeout:()=>this.clearTimeout()}}init(i){let o=super.init(i),{store:n,config:a}=i,{isInteractiveTime$:s,isPlaying$:d}=n.state,l=n.ui.controlsVisible,{interactiveTimeIndicator:c}=n.ui.controls;o.add(l.subscribe(_=>{ve(s)&&_&&this.state$.set(!1)}));let u=a?.interactiveData||{tooltipHelpHintActive:!1};return o.add(ox({isPlaying$:d,isInteractiveTime$:s,interactiveTimeIndicator:c}).subscribe(({isPlaying$:_,isInteractiveTime$:f,interactiveTimeIndicator:y})=>{if(!(!_||!y?.isDisplayed)){if(!f)return this.state$.set(!1);u.tooltipHelpHintActive&&qc===null&&(qc=!0,u.tooltipHelpHintActive=!1,this.state$.set(!0),n.callbacks?.onInteractiveTimeIndicatorHintDeactivated?.())}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};import{combine as nx,noop as rx}from"@vkontakte/videoplayer-shared/evergreen";var _d=class extends yo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ae(null),toggle:rx};this.checkIfShouldHide=i=>fa(i,"s")}init(i){let o=super.init(i),{store:n,interactiveController:a}=i,s=n.ui.currentGridType$,d=n.getLogger().createComponentLog("GraphIsOpened microStore");return this.state$.toggle=async()=>{if(this.checkIfShouldHide(ve(s)))return;let l=ve(this.state$),{isEnded$:c,playbackState$:u}=n.state,{disabledControls$:_}=n.ui.controls,f=ve(c),y=ve(u);if(l)try{await a?.toggleGraphView(!1),this.state$.set(!1),_.remove(Qu),!f&&this.graphMadePause&&n.actions.internal.play()}catch{d({message:"Cant hide graph"})}else{this.graphMadePause=y==="playing";try{await a?.toggleGraphView(!0),this.state$.set(!0),_.add(Qu),!f&&this.graphMadePause&&n.actions.internal.pause()}catch{d({message:"Cant show graph"})}}},o.add(nx({graphIsOpened:this.state$,currentGridType:s}).subscribe(async({graphIsOpened:l,currentGridType:c})=>{if(this.checkIfShouldHide(c)&&l)try{await a?.toggleGraphView(!1),this.state$.set(!1)}catch{d({message:"Cant hide graph"})}})),o}};import{ValueSubject as Qh}from"@vkontakte/videoplayer-shared/evergreen";var bd=class extends yo{constructor(){super(...arguments);this.stateName="pictureInPicture$";this.state$={isActive$:ae(!1),isEnabled$:ae(!1),type$:ae(void 0)}}init(i){let o=super.init(i),{store:n}=i,{info:{isActive$:a,isEnabled$:s,type:d}}=n.webApi.pictureInPictureApi||{info:{isActive$:new Qh(!1),isEnabled$:new Qh(!1)}};return o.add(a.subscribe(l=>{this.state$.isActive$.set(l)})),o.add(s.subscribe(l=>{this.state$.isEnabled$.set(l)})),this.state$.type$.set(d),o}};import{filter as lx,filterChanged as dx}from"@vkontakte/videoplayer-shared/evergreen";import{safeStorage as vm}from"@vkontakte/videoplayer-shared/evergreen";var Gh=({maxShowCount:t,timeout:e})=>{let i=[t!==0?ax({maxCount:t}):void 0,e!==0?sx({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},ax=({maxCount:t})=>{let e={};return{notificationShowed:i=>{e[i]=(e[i]??0)+1,vm.set("videoplayer_notifications_manager_count",JSON.stringify(e[i]??0))},canShowNotification:i=>(e[i]??0)<t}},sx=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(vm.get(e)||"{}")}catch{return{}}},o=a=>vm.set(e,JSON.stringify(a)),n=a=>{let s=i();delete s[a],o(s)};return{notificationShowed:a=>{o({...i(),[a]:{timeout:t,launchTime:Date.now()}})},canShowNotification:a=>{let s=i()[a];if(s){let d=Date.now()-s.launchTime>t;return d&&n(a),d}else return!0}}};var $d=class extends yo{constructor(){super(...arguments);this.stateName="notifications$";this.state$={notificationsToShow$:ae({}),showNotification:i=>{this.state$.notificationsToShow$.update(o=>(o[i]=!0,o)),this.notificationManager.notificationShowed(i)},closeNotification:i=>{this.state$.notificationsToShow$.update(o=>(delete o[i],o))}}}init(i){let o=super.init(i),{store:n,uiConfig:{features:{maxCountShowSlowVideoNotification:a,timeoutShowSlowVideoNotification:s,showSlowVideoNotification:d,forceAutoQualityWhenSevereStallHappens:l}}}=i;this.notificationManager=Gh({maxShowCount:a,timeout:s});let c=n.getPlayer();return o.add(c.events.severeStallOccured$.pipe(dx(),lx(u=>u)).subscribe(()=>{d&&!c.info.isAutoQualityEnabled$.getValue()&&this.notificationManager.canShowNotification("slow_video")&&(l&&n.actions.internal.setQuality("auto"),this.state$.showNotification("slow_video"))})),o}};var jh=()=>[md,vd,gd,hd,_d,bd,$d].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});import{devNull as yd}from"@vkontakte/videoplayer-shared/evergreen";var yx={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:px.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:_x(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},ln=Y(void 0),Kc=class extends HTMLElement{svelteStubComponent;svelteRootComponent;store;microStoresRoot;statistics;sentry;_shadowRoot;playerContainer;rootContainer;shadowRootContainer;uiConfig;coreConfig;statisticsConfig;interactiveController;interactiveContainer;graphMadePause;currentPlayingVideoIndex=0;needToRepeatPlaylist=!1;videoConfig=void 0;pictureInPictureApi=void 0;mediaSessionApi=void 0;unsubscribePlayerPhaseSubscription=void 0;logger;log;subscription;interactiveSubscription;annotationsApi=void 0;slotsApi;prevIsid=void 0;isInited=!1;internalsExposure=null;constructor(){super(),yd.create("ui"),this.logger=new fx,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new Yh,this.interactiveSubscription=new Yh,this.graphMadePause=!1}connectedCallback(){if(this.isInited)return;this.initPlayerRootContainers();let e=this.getAttribute("stub-title")??void 0,i=this.getAttribute("stub-thumb-url")??void 0,o=pe({title:e,thumbUrl:i}),n={target:this.playerContainer,props:o};this.svelteStubComponent=Qr(cm,n)}disconnectedCallback(){this.annotationsApi?.destroy(),this.mediaSessionApi?.destroy(),this.unmountComponent(this.svelteRootComponent),this.unmountComponent(this.svelteStubComponent),this.subscription.unsubscribe(),this.unsubscribePlayerPhaseSubscription?.(),this.interactiveController?.destroy(),this.interactiveSubscription.unsubscribe(),this.internalsExposure?.destroy(),yd.destroy("ui")}initPlayerRootContainers(){this.rootContainer=document.createElement("div"),this.rootContainer.style.position="relative",this.rootContainer.className="root-container",this.rootContainer.style.width="100%",this.rootContainer.style.height="100%",this.rootContainer.style.minHeight="206px",this.shadowRootContainer=document.createElement("div"),this.shadowRootContainer.style.position="absolute",this.shadowRootContainer.className="shadow-root-container",this.shadowRootContainer.style.width="100%",this.shadowRootContainer.style.height="100%",this._shadowRoot=this.shadowRootContainer.attachShadow({mode:"open"}),this.playerContainer=document.createElement("div"),this.playerContainer.style.all="initial",this.playerContainer.style.display="block",this.playerContainer.style.contain="strict",this.playerContainer.style.width="100%",this.playerContainer.style.height="100%",this._shadowRoot.append(this.playerContainer),this.rootContainer.append(this.shadowRootContainer),this.append(this.rootContainer)}needToShowNextPrevButtons(){return this.videoConfig?this.videoConfig.videos.length>1&&this.videoConfig.showNextPrevButtons:!1}isNextButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1||this.needToRepeatPlaylist):!1}isPrevButtonActive(){return this.videoConfig?this.needToShowNextPrevButtons()&&(this.currentPlayingVideoIndex>0||this.needToRepeatPlaylist):!1}isControlDisabled(e){return this.store?.ui.controls.disabledControls$?.includes(e)||!1}getNextVideoInfo(){if(!this.videoConfig)return{nextVideoTitle:void 0,nextVideoThumb:void 0};let e=this.videoConfig.videos[this.currentPlayingVideoIndex+1]||{};return{nextVideoTitle:e.title,nextVideoThumb:e.thumbUrl}}createOneStat=(e,i={})=>{let{albumId:o,statPlace:n,statUserSalt:a,statTrackCode:s,statVKAppId:d,refreshStatAuthToken:l,autoplay:c,isMobile:u,isTouch:_,refDomain:f,deviceId:y,interactiveData:x}=fd(this.videoConfig,i),w=x?.projectInfo?.pid,S=this.interactiveController?.state.isReplay$.getValue()??!1;S&&(this.prevIsid=void 0);let{unitedVideoId:I,isClip:L=!1}=e;if(this.uiConfig.features.statistics&&I)return new bx({movieId:I,albumId:o,place:n,trackCode:s,vkAppId:d,autoplay:(c&&!this.interactiveController)??!1,mobile:_??u,clip:L,refDomain:f,deviceId:y,...w&&(!this.isInited||S)&&{projectId:Number(w)}},{refreshAuthToken:l,userSalt:a,config:this.statisticsConfig,...this.interactiveController&&{useIsid:!0,isid:this.prevIsid}})};createThinOneStat(e,i={}){let{deviceId:o,preload:n,refreshStatAuthToken:a}=fd(this.videoConfig,i),{unitedVideoId:s}=e;return new $x.ThinOneStat({deviceId:o,movieId:s,preload:n},{config:this.statisticsConfig,refreshAuthToken:a})}createPlayer(e,i={},o){if(!this.videoConfig)return;let{albumId:n,statPlace:a,statAuthToken:s,preload:d,autoplay:l,volume:c,muted:u,fromTime:_,canRewindLive:f,supportLink:y,showAds:x,adsSlotId:w,adsParams:S={},adsPreviewParam:I,adsAutoplayParam:L,interfaceLanguage:A,isCyrillicRelatedInterface:P,logoClickable:k,logoHidden:N,isMobile:Q,isTouch:G,isAudioDisabled:ee,isLiveCatchUpMode:oe,fullScreenTarget:ne,failoverHosts:te,canDownload:ge,callbacks:X,interactiveData:Re,showThumbTimer:Me,additionalButtons:se=[],additionalSettingsMenuItems:Fe=[],additionalContextMenuItems:j=[],repeat:B,saveRate:Be,volumeMultiplier:_e,showEndScreen:ke,showAutoplayNext:Oe}=fd(this.videoConfig,i),{sources:ce,title:R,thumbUrl:be,unitedVideoId:Ae,isClip:Ge=!1,duration:Ke,adsParams:Ie={},videoEpisodes:Le,previewThumbsData:De,subtitles:dt,live:gt}=e,it={...S,...Ie},Ct=this.getNextVideoInfo(),ot={sources:ce,title:R,thumbUrl:be,subtitles:dt,unitedVideoId:Ae,isClip:Ge,live:gt,albumId:n,statPlace:a,autoplay:l,muted:u,volume:c,fromTime:_,canRewindLive:f,showAds:x,adsSlotId:w,adsParams:it,adsPreviewParam:I,adsAutoplayParam:L,duration:Ke,logoClickable:k,logoHidden:N,isTouch:G??Q,repeat:B,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Ct.nextVideoTitle,endScreenVideoThumb:Ct.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},ct={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(ot)}`});let At=this.interactiveController?.state.statistics$.getValue(),Se,Ne=this.createThinOneStat(e,i);(Se||Ne)&&(this.statistics=new Sc(Se,Ne,At?.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new Va(this.uiConfig.sentry,{version:ys,env:Yd},{movieId:Ae,albumId:n,place:a,autoplay:(l&&!this.interactiveController)??!1,mobile:G??Q,clip:Ge}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat?.isid$.getValue()),this.sentry={...this.sentry,...Va.getInstance()};let W=!!Re,re=[],ie="tooltip_interactive_go_back_disabled_first";if(W&&this.interactiveController){let pt=this.interactiveController.state.isInitialChapter$.getValue(),Ee=this.interactiveController.getHistoryState();pt&&re.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||re.push("SEEK_TO_INTERACTIVE_BUTTON"),Ee.hasPrevChapter$.getValue()||(re.push("PLAY_PREV_CHAPTER_BUTTON"),pt||(Ee.isGoBackLimited$.getValue()?ie="tooltip_interactive_go_back_disabled_limit":ie="tooltip_interactive_go_back_disabled"))}let Ue=()=>{this.isInited=!1,this.prevIsid=void 0;let pt=o?.info.isEnded$.getValue()&&this.interactiveController?.state.isEndChapter$.getValue();X.onReplayInteractiveVideo&&!pt?X.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=fh({player:o,interfaceLanguage:A,isCyrillicRelatedInterface:P,videoId:Ae,isClip:Ge,isLiveCatchUpMode:oe,isAudioDisabled:ee,statAuthToken:s,callbacks:X,webApi:ct,videoEpisodes:Le,previewThumbsData:De,canDownload:ge,uiConfig:this.uiConfig,coreConfig:this.coreConfig,disabledControls:re,isInteractive:W,saveRate:Be,interactiveRanges$:this.interactiveController?.state.interactiveRanges$,isInteractiveTime$:this.interactiveController?.state.isInteractiveTime$,stopPlayer:()=>this.stop(),replayInteractive:Ue,playPrevChapterDisabledTooltip:ie,hasInteractiveBranches:!!this.interactiveController?.getChapterBranches()?.length,additionalButtons:this.uiConfig.features.additionalButtons?se:[],additionalSettingsMenuItems:Fe??[],additionalContextMenuItems:j??[],playPrevVideo:()=>this.playPrevVideo(),playNextVideo:()=>this.playNextVideo(),looped:B&&this.videoConfig.videos.length===1,statistics:this.statistics,internalsExposure:this.internalsExposure});let{stores:je}=this.microStoresRoot=jh(),Pt=()=>{if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Ee=>X?.onCurrentFormatChanged?.(Ee))),this.subscription.add(je.interactiveControlsOpacity$.subscribe(Ee=>{Ee!==null&&this?.interactiveController?.setDisabledControls(Ee)})),this.subscription.add(this.store.state.throughputEstimation$.subscribe(Ee=>X?.onThroughputEstimationChanged?.(Ee))),this.subscription.add(this.store.state.trafficSavingEnabled$.subscribe(Ee=>X?.onTrafficSavingEnabledChanged?.(Ee))),this.subscription.add(new mx(Ee=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Ce=>Ee.next(Ce)))}).pipe(this.uiConfig.features.skipInitialPlaybackRateValue?hx(1):Ee=>Ee).subscribe(Ee=>X?.onCurrentPlaybackRateChanged?.(Ee))),this.subscription.add(this.store.state.volume$.subscribe(Ee=>X?.onVolumeChange?.(Ee))),this.subscription.add(this.store.state.muted$.subscribe(Ee=>Ee?X?.onMute?.():X?.onUnmute?.())),this.subscription.add(this.store.state.videoBitrate$.subscribe(Ee=>X?.onVideoBitrateChanged?.(Ee))),this.subscription.add(this.store.state.isInteractiveTime$.subscribe(Ee=>{let Ce=this.store?.ui.controls.disabledControls$;Ce&&(Ee&&!Ce.includes(gl)&&Ce.add(gl),Ee||Ce.remove(gl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Ee=>{if(!Zh.browser.isSamsungBrowser||!Ee||!this.interactiveController)return;document.fullscreenElement===this.shadowRootContainer&&await this.replayInteractiveChapter(this.videoConfig?.callbacks.onExternalFullscreenExit)})),this.statistics&&this.statistics.oneStat&&this.subscription.add(this.statistics.oneStat.vsid$.subscribe(Ee=>X?.onVSIDChanged?.(Ee))),this.initMediaSession(),D(ln,pe({interactiveController:this.interactiveController,interactiveContainer:this.interactiveContainer,sources:ce,store:this.store,microStoresRoot:this.microStoresRoot,videoConfig:this.videoConfig,uiConfig:this.uiConfig,title:R,thumbUrl:be,subtitles:dt,live:gt,preload:d,autoplay:l,muted:u,volume:c,fromTime:_,canRewindLive:f,supportLink:y,showAds:x,adsSlotId:w,adsParams:it,adsPreviewParam:I,adsAutoplayParam:L,duration:Ke,logoClickable:k,logoHidden:N,isMobile:G??Q,failoverHosts:te,fullScreenTarget:ne,saveRate:Be,shadowRootContainer:this.shadowRootContainer,showMiniTimer:Me,outerContainerRef:this.rootContainer,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:Ct.nextVideoTitle,endScreenVideoThumb:Ct.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:_e,showEndScreen:ke,showAutoplayNext:Oe}));let pt={target:this.playerContainer,props:r(ln)};this.svelteRootComponent=Qr(sm,pt),this.addPlayerInfoSubscriptions(),this.isInited||(this.isInited=!0,this.videoConfig?.callbacks?.onInited?.()),this.internalsExposure?.expose({player:this,videoConfig:this.videoConfig,coreConfig:this.coreConfig,uiConfig:this.uiConfig,statisticsConfig:this.statisticsConfig,logger:this.logger,log:this.log}),this.uiConfig.devNullLog&&this.videoConfig?.callbacks?.onDevNullLog?yd.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):yd.destroy("ui")};this.coreConfig.asyncResolveClientChecker?Zh.isInited$.subscribe(pt=>{pt&&(console.log("UI SDK async start"),Pt())}):Pt()}addPlayerInfoSubscriptions(){let e=this.store,i=this.microStoresRoot?.stores;if(!e||!i)return;let o=this.videoConfig?.callbacks;o&&this.subscription.add(e.playerPhase.subscribe(a=>o.onPlayerPhaseChanged?.(a))).add(e.state.playbackState$.subscribe(a=>a&&o.onPlaybackStateChanged?.(a))).add(e.state.isLive$.subscribe(a=>o.onIsLiveChanged?.(a))).add(e.state.isActiveLive$.subscribe(a=>o.onIsActiveLiveChanged?.(a))).add(e.state.isAudioAvailable$.subscribe(a=>o.onIsAudioAvailableChanged?.(a))).add(e.state.currentQuality$.subscribe(a=>o.onCurrentQualityChanged?.(a))).add(e.state.availableQualities$.subscribe(a=>o.onAvailableQualitiesChanged?.(a.map(({value:s})=>s).filter(s=>s!=="auto")))).add(e.state.availableAudioStreams$.subscribe(a=>{a.length>1&&o.onAudioLanguagesAvailable&&o.onAudioLanguagesAvailable()})).add(i.pictureInPicture$.isActive$.subscribe(a=>a?o.onPiPEnter?.():o.onPiPExit?.()));let n=o?.uiInfo;n&&this.subscription.add(e.ui.controlsVisible.subscribe(a=>n.onControlsVisibleChanged?.(a))).add(e.ui.isMobile.subscribe(a=>n.onIsMobileChanged?.(a))).add(e.ui.playerSize.subscribe(a=>n.onPlayerSizeChanged?.(a))).add(e.ui.controls.prevButton.subscribe(a=>n.onPrevButtonChanged?.(a))).add(e.ui.controls.playButton.subscribe(a=>n.onPlayButtonChanged?.(a))).add(e.ui.controls.replayButton.subscribe(a=>n.onReplayButtonChanged?.(a))).add(e.ui.controls.nextButton.subscribe(a=>n.onNextButtonChanged?.(a))).add(e.ui.controls.playPrevChapterButton.subscribe(a=>n.onPlayPrevChapterChanged?.(a))).add(e.ui.controls.seekToInteractiveButton.subscribe(a=>n.onSeekToInteractiveButtonChanged?.(a))).add(e.ui.controls.interactiveGraphButton.subscribe(a=>n.onGraphButtonChanged?.(a))).add(e.ui.controls.liveButton.subscribe(a=>n.onLiveButtonChanged?.(a))).add(e.ui.controls.time.subscribe(a=>n.onTimeUpdateChanged?.(a))).add(e.ui.controls.episodes.subscribe(a=>n.onEpisodesChanged?.(a))).add(e.ui.controls.subtitles.subscribe(a=>n.onSubtitlesChanged?.(a))).add(e.ui.controls.settings.subscribe(a=>n.onSettingsChanged?.(a))).add(e.ui.controls.fullscreen.subscribe(a=>n.onFullscreenChanged?.(a))).add(e.ui.controls.chromecast.subscribe(a=>n.onChromecastChanged?.(a))).add(e.ui.controls.pip.subscribe(a=>n.onPipChanged?.(a))).add(e.ui.controls.vkLogo.subscribe(a=>n.onVkLogoChanged?.(a))).add(e.ui.controls.interactiveTimeIndicator.subscribe(a=>n.onInteractiveTimeIndicatorChanged?.(a))).add(e.ui.controls.timeline.subscribe(a=>n.onTimelineChanged?.(a)))}playNextVideo(){this.videoConfig&&(this.currentPlayingVideoIndex++,this.currentPlayingVideoIndex>=this.videoConfig.videos.length&&(this.currentPlayingVideoIndex=0),this.log({message:`play next video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}playPrevVideo(){this.videoConfig&&(this.currentPlayingVideoIndex--,this.currentPlayingVideoIndex<0&&(this.currentPlayingVideoIndex=this.videoConfig.videos.length-1),this.log({message:`play prev video, index: ${this.currentPlayingVideoIndex}`}),this.createPlayerWithCurrentVideo())}createPlayerWithCurrentVideo(e,i=!0){if(!this.videoConfig)return;let o=this.videoConfig.videos[this.currentPlayingVideoIndex];if(!o){this.log({message:"no next video"});return}this.isInited&&gm(o.unitedVideoId)&&this.store.actions.internal.nextMovie(o.unitedVideoId),this.unmountComponent(this.svelteRootComponent),this.createPlayer(o,{autoplay:i,fromTime:0},e)}playPrevChapter(){this.interactiveController?.playPrevChapter()}seekToInteractive(){let e=this.interactiveController?.getNextInteractiveStartTime();typeof e=="number"&&this.seekTime(e/1e3)}async initInteractives(){if(this.videoConfig?.interactiveData)try{let{Interactives:e}=await import("@vkontakte/videoplayer-interactive/evergreen");this.interactiveContainer=document.createElement("div"),this.interactiveContainer.classList.add("interactive-root");let i=this.store?.interfaceLanguage$,o=i?ve(i):this.videoConfig.interfaceLanguage,{projectInfo:n,initChapterId:a,historyApi:s,videoLoader:d}=this.videoConfig.interactiveData;this.interactiveController=new e({parentElement:this.interactiveContainer,fullscreenTargetElement:this.playerContainer,lang:o,graph:this.uiConfig.features.interactiveGraph,projectInfo:n,initChapterId:a,historyApi:s,vkVideoLoader:d,lastFrame:this.uiConfig.features.interactiveLastFrame,permanentTextControls:this.uiConfig.features.interactiveTextPermanent,interactiveTimeOpenUri:this.uiConfig.features.interactiveTimeOpenUri,initSeamless:!0,config:this.uiConfig.interactive,coreConfig:this.coreConfig,createOneStat:this.createOneStat,animationsFeatureToggles:{areaControlShadow:this.uiConfig.features.interactiveAreaControlShadow,controlsExpectTimeBlinkAnimation:this.uiConfig.features.interactiveControlsExpectTimeBlinkAnimation}});let{isInteractiveExpectation$:l,isSeekable$:c}=this.interactiveController.state;this.uiConfig.features.seekToInteractive&&this.subscription.add(c.subscribe(_=>{if(!this.isInited)return;let f=this.store;_?f.ui.controls.disabledControls$.remove("SEEK_TO_INTERACTIVE_BUTTON"):f.ui.controls.disabledControls$.add("SEEK_TO_INTERACTIVE_BUTTON")})),this.subscription.add(l.subscribe(_=>{this.store&&this.store.state.isInteractiveExpectation$.set(_)}));let u=!0;if(this.subscription.add(this.interactiveController.events.playerChanged$.subscribe(_=>{if(!this.videoConfig)return;this.videoConfig.videos[this.currentPlayingVideoIndex]={..._.config,title:n?.title||_.config.title};let f=u?this.videoConfig.autoplay:!0;this.createPlayerWithCurrentVideo(_.player,f),u&&(u=!1)})),this.interactiveSubscription.add(this.interactiveController.events.interactiveActionChoice$.subscribe(({type:_,actionType:f})=>{if(!this.store||!this.microStoresRoot)return;let y=l.getValue();if(_==="action-choice"&&f==="setRandomBranch"&&(this.microStoresRoot.stores.graphIsOpened$.set(!1),this.store.ui.controls.disabledControls$.remove(hl)),_==="action-choice-canceled"){let x=ve(this.store.state.isPlaying$)||y;if((this.videoConfig?.isTouch??this.videoConfig?.isMobile)&&x){this.store.ui.interactiveHideMobileControls.set(!0);return}this.videoConfig?.callbacks.onDisabledInteractiveClick?.()}})),this.interactiveSubscription.add(this.interactiveController.events.interactiveContainerFakeRemoved$.subscribe(({type:_,removeAllOpenURI:f})=>{this.store&&_==="container-fake-removed"&&f&&this.store.ui.controls.disabledControls$.remove(hl)})),await this.interactiveController.setManifest(this.videoConfig.interactiveData.manifest),this.videoConfig?.callbacks?.onInteractiveHistoryChanged){let _=this.interactiveController.getHistoryState();this.subscription.add(_.history$.subscribe(f=>{f.length&&this.videoConfig?.callbacks?.onInteractiveHistoryChanged?.(f)}))}this.uiConfig.features.interactiveTimeIndicator&&this.subscription.add(this.interactiveController.events.noInteraction$.subscribe(()=>{this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(!0,!0),this.videoConfig?.callbacks.onInteractiveTimeIndicatorClick?.()})),this.interactiveSubscription.add(this.interactiveController.events.error$.subscribe(_=>{this.log({message:_.toString()})}))}catch(e){this.log({message:e.message})}}initPlayer(e,i={}){if(!Array.isArray(e.videos)||e.videos.length===0&&!e.interactiveData)throw new Error("empty videos");if(this.videoConfig=fd(yx,ux(e,o=>o instanceof HTMLElement?o:void 0)),this.uiConfig=Gv(i.ui??{}),this.coreConfig=i.core??{configName:[]},this.statisticsConfig=i.statistics??{},this.uiConfig.features.forcePlayerDisplayBlock&&(this.rootContainer.style.minHeight="unset",this.style.display="block",this.style.width="100%",this.style.height="100%"),this.sentry={config:this.uiConfig.sentry??{}},this.uiConfig.features.exposeInternalsToGlobal&&(this.internalsExposure??=new gx("UI")),yd.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+this.videoConfig?.showAds],numbers:[cx()]}),gm(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.uiConfig.features.mediaSession??this.videoConfig.isMediaSessionEnabled??!0),gm(this.videoConfig.isPictureInPictureEnabled)&&(this.uiConfig.features.pip=this.uiConfig.features.pip??this.videoConfig.isPictureInPictureEnabled??!0,this.uiConfig.features.dpip=this.uiConfig.features.dpip??this.videoConfig.isPictureInPictureEnabled??!0),this.videoConfig.isTouch=this.uiConfig.isMobile??this.videoConfig.isTouch??this.videoConfig.isMobile,this.videoConfig.autoplay&&=this.uiConfig.features.autoplay,this.videoConfig.showAds=this.uiConfig.ads.enable??this.videoConfig.showAds,this.videoConfig.adsSlotId=this.uiConfig.ads.slot??this.videoConfig.adsSlotId,this.videoConfig.adsPreviewParam=this.uiConfig.ads.preview??this.videoConfig.adsPreviewParam,this.videoConfig.logoHidden=!(this.uiConfig.showLogo??!this.videoConfig.logoHidden),this.videoConfig.canRewindLive&&=this.uiConfig.features.liveRewind,this.videoConfig.supportLink=this.videoConfig.supportLink??this.uiConfig.supportLink,this.videoConfig.showEndScreen=this.uiConfig.features.endScreen??this.videoConfig.showEndScreen,this.videoConfig.showAutoplayNext=this.uiConfig.features.autoplayNext??this.videoConfig.showAutoplayNext,this.videoConfig.showNextPrevButtons=this.uiConfig.features.nextPrevButtons??this.videoConfig.showNextPrevButtons,this.currentPlayingVideoIndex=this.videoConfig.videoIndex&&this.videoConfig.videos?.[this.videoConfig.videoIndex]?this.videoConfig.videoIndex:0,this.needToRepeatPlaylist=this.videoConfig.repeat,this.uiConfig.features.pip){let o={enabled:this.videoConfig.pipEnabled};this.uiConfig.features.dpip?this.pictureInPictureApi=Fc.getLatestSupportedVersion(o):this.pictureInPictureApi=new Ba(o)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new Hc:void 0,this.slotsApi=this.uiConfig.features.slots?new Bc:void 0,this.annotationsApi=this.uiConfig.features.annotations?new Uc(this.uiConfig.features.annotationsInside):void 0,this.annotationsApi&&!this.uiConfig.features.annotationsInside&&this.annotationsApi.init(this.rootContainer),this.slotsApi?.init(this.shadowRootContainer),this.unmountComponent(this.svelteStubComponent),this.unmountComponent(this.svelteRootComponent),this.isInited=!1,this.prevIsid=void 0,this.interactiveController&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveSubscription.unsubscribe()),this.videoConfig.interactiveData?this.initInteractives():this.createPlayer(this.videoConfig.videos[this.currentPlayingVideoIndex]),zh(this.pictureInPictureApi)&&this.pictureInPictureApi.setPlayerDomElement(this.playerContainer,this._shadowRoot)}isOneVideoPlaylist(){return this.videoConfig?this.videoConfig.videos.length===1:!1}updateVideos(e,i){if(!this.videoConfig)return;this.log({message:`update ${i} videos, videos: ${JSON.stringify(e)}`}),i==="prev"?(this.videoConfig.videos.splice(0,this.currentPlayingVideoIndex),this.videoConfig.videos.unshift(...e),this.currentPlayingVideoIndex=e.length):i==="next"&&(this.videoConfig.videos.splice(this.currentPlayingVideoIndex+1),this.videoConfig.videos.push(...e));let o=this.getNextVideoInfo();r(ln)&&(r(ln).showNextPrevButtons=this.needToShowNextPrevButtons(),r(ln).nextButtonActive=this.isNextButtonActive(),r(ln).prevButtonActive=this.isPrevButtonActive(),r(ln).endScreenVideoTitle=o.nextVideoTitle,r(ln).endScreenVideoThumb=o.nextVideoThumb,r(ln).isOneVideoPlaylist=this.isOneVideoPlaylist())}updatePrevVideos(e){this.updateVideos(e,"prev")}updateNextVideos(e){this.updateVideos(e,"next")}initMediaSession(){this.mediaSessionApi&&(this.unsubscribePlayerPhaseSubscription?.(),this.mediaSessionApi.clearSubscriptions(),this.unsubscribePlayerPhaseSubscription=this.store?.playerPhase.subscribe(e=>{e==="video"?this.setupMediaSessionForVideo():e==="ads"&&this.setupMediaSessionForAds()}))}setupMediaSessionForVideo(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let{title:e,thumbUrl:i}={...this.videoConfig.videos[this.currentPlayingVideoIndex]},o=[["play",()=>this.play()],["pause",()=>this.pause()],["seekto",n=>this.seekTime(n.seekTime)]];this.videoConfig.videos.length>1&&(this.currentPlayingVideoIndex<this.videoConfig.videos.length-1&&o.push(["nexttrack",()=>this.playNextVideo()]),this.currentPlayingVideoIndex>0&&o.push(["previoustrack",()=>this.playPrevVideo()])),this.mediaSessionApi.setMetaData({title:e,thumbUrl:i}),this.mediaSessionApi.updateActionHandlers(o),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}setupMediaSessionForAds(){if(!(!this.videoConfig||!this.mediaSessionApi))try{let e="\u0420\u0435\u043A\u043B\u0430\u043C\u0430",i=[["play",()=>this.play()],["pause",()=>this.pause()]];this.mediaSessionApi.setMetaData({title:e}),this.mediaSessionApi.updateActionHandlers(i),this.mediaSessionApi.attachToStore(this.store)}catch(e){this.log({message:e.message})}}play(){this.isControlDisabled("PLAY_BUTTON")||this.store?.playerPhase.is("LiveWaitingStart")||this.store?.playerPhase.is("LiveWaitingRecover")||this.store?.playerPhase.is("LiveWaitingRecord")||(this.log({message:"play"}),this.svelteRootComponent?.play())}pause(){this.log({message:"pause"}),this.svelteRootComponent?.pause()}stop(){if(!this.videoConfig)return;this.log({message:"stop"});let e=!!this.interactiveController;e&&(this.interactiveController.destroy(),this.interactiveController=void 0,this.interactiveContainer=void 0,this.interactiveSubscription.unsubscribe()),this.unmountComponent(this.svelteStubComponent),this.mediaSessionApi?.destroy();let i=this.videoConfig.videos[0];i&&(this.unmountComponent(this.svelteRootComponent),e?(this.videoConfig.autoplay=!1,this.initInteractives()):this.createPlayer(i))}setMuted(e){this.log({message:`set muted, muted: ${e}`}),this.svelteRootComponent?.setMuted(e)}setPiPEnabled(e){this.store?.webApi.pictureInPictureApi?.setEnabled(e)}setVolume(e){this.log({message:`set volume, volume: ${e}`}),this.svelteRootComponent?.setVolume(e)}setRepeat(e){this.log({message:`set repeat, repeat: ${e}`}),this.needToRepeatPlaylist=e,r(ln)&&(r(ln).needToRepeatPlaylist=this.needToRepeatPlaylist,r(ln).showNextPrevButtons=this.needToShowNextPrevButtons(),r(ln).nextButtonActive=this.isNextButtonActive(),r(ln).prevButtonActive=this.isPrevButtonActive())}seekTime(e){this.isControlDisabled("TIMELINE")||(this.log({message:`seek time, time: ${e}`}),this.svelteRootComponent?.seekTime(e))}seekEpisodeStartTime(e){this.log({message:`seek episode start time, time: ${e}`}),this.svelteRootComponent?.seekEpisodeStartTime(e)}returnFocusToEpisodes(){this.log({message:"return focus to episodes button"}),this.svelteRootComponent?.returnFocusToEpisodes()}setPlaybackRate(e){this.log({message:`set playback rate to: ${e}`}),this.svelteRootComponent?.setPlaybackRate(e)}setAutoQualityLimits(e){this.log({message:`set auto quality limitation. Max: ${e.max??"none"}. Min: ${e.min??"none"}`}),this.svelteRootComponent?.setAutoQualityLimits(e)}addLanguage(e){this.store?.actions.internal.addLanguage(e)}async setLanguage(e){await this.store?.actions.internal.setLanguage(e)}setLiveStart(e){this.log({message:"live started"}),this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingStart(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!0})}setLiveWaitingRecover(){this.log({message:"live waiting"}),this.store?.callbacks&&(this.store.callbacks.onLiveEnded=()=>{this.store?.actions.internal.setLiveWaitingRecover(!0),this.store?.destroy()})}setLiveWaitingRecord(){this.log({message:"post live"}),this.store?.callbacks&&(this.store.callbacks.onLiveEnded=()=>{this.store?.actions.internal.setLiveWaitingRecord(!0),this.store?.destroy()})}setLiveEnd(e){this.log({message:"live ended"}),this.store?.callbacks&&(this.store.callbacks.onLiveEnded=()=>{this.store?.actions.internal.setLiveWaitingRecover(!1),this.store?.actions.internal.setLiveWaitingRecord(!1),this.unmountComponent(this.svelteRootComponent),this.createPlayer(e,{autoplay:!1})})}setLiveLowLatency(e){this.log({message:"live switch to low latency "+e}),this.store?.actions.external.setLiveLowLatency(e)}getDeviceId(){return this.statistics?.oneStat?.getDeviceId()??void 0}replayInteractiveVideo(){this.interactiveController&&this.interactiveController.setChapter()}async replayInteractiveChapter(e){if(this.interactiveController&&this.store?.state.positionExact$){let i=ve(this.store.state.positionExact$),n=ve(this.store.state.interactiveEpisodes$).find(s=>!s.completed);this.interactiveController.events.playerChanged$.pipe(vx()).subscribe(()=>{n&&i>=n.time?this.seekTime(n.time):this.seekTime(i),e?.()});let a=this.interactiveController.getCurrentChapter();await this.interactiveController.setChapter({chapterId:a?.chapter?.id,pushToHistory:!1})}}showInteractiveIndicatorTooltip(e,i=!1){this.microStoresRoot?.stores.showInteractiveTimeIndicatorTooltip$.set(e,i)}switchToActiveLive(){this.store?.actions.internal.switchToActiveLive()}updateAdditionalSettingsItem(e,i){this.store?.actions.external.updateAdditionalSettingsItem(e,i)}addAdditionalSettingsItem(e){this.store?.actions.external.addAdditionalSettingsItem(e)}removeAdditionalSettingsItem(e){this.store?.actions.external.removeAdditionalSettingsItem(e)}updateAdditionalContextItem(e,i){this.store?.actions.external.updateAdditionalContextItem(e,i)}addAdditionalContextItem(e){this.store?.actions.external.addAdditionalContextItem(e)}removeAdditionalContextItem(e){this.store?.actions.external.removeAdditionalContextItem(e)}updateAdditionalButton(e,i){this.store?.actions.external.updateAdditionalButton(e,i)}addAdditionalButton(e){this.store?.actions.external.addAdditionalButton(e)}removeAdditionalButton(e){this.store?.actions.external.removeAdditionalButton(e)}updateStatContext(e){this.statistics&&(this.statistics.oneStat&&this.statistics.oneStat.updateContext(e),this.statistics.thinOneStat&&this.statistics.thinOneStat.updateContext(e))}handleTimerNextVideo(e){this.store?.actions.internal.setTimerNextVideoRunning(e)}focus(){this.svelteRootComponent?.keyboardControls?.focus?.()}unmountComponent(e){e&&Aa(e)}};import{InterfaceLanguage as xY,VKNumericLanguage as wY,loadVKLangPack as SY}from"@vkontakte/videoplayer-shared/evergreen";import{VideoQuality as TY,VideoFormat as kY}from"@vkontakte/videoplayer-core/evergreen";var mY=()=>{window.customElements.define("vk-video-player",Kc)};export{Cc as ControlButtonType,Vr as GridTypes,xY as InterfaceLanguage,Tl as MenuItemType,Ra as PlayerPhase,ys as VERSION,wY as VKNumericLanguage,kY as VideoFormat,TY as VideoQuality,SY as loadVKLangPack,mY as registerPlayerWebComponent};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer",
3
- "version": "1.1.61-dev.4affc441.0",
3
+ "version": "1.1.61-dev.e1cb6686.0",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -55,9 +55,9 @@
55
55
  ],
56
56
  "dependencies": {
57
57
  "@adtech/rbadman": "2.2.57",
58
- "@vkontakte/videoplayer-core": "2.0.131-dev.5dfc4a50.0",
59
- "@vkontakte/videoplayer-interactive": "1.0.36-dev.0b2b6978.0",
60
- "@vkontakte/videoplayer-shared": "1.0.59-dev.2e0f9025.0",
61
- "@vkontakte/videoplayer-statistics": "1.0.77-dev.38c1ddaf.0"
58
+ "@vkontakte/videoplayer-core": "2.0.131-dev.04beed26.0",
59
+ "@vkontakte/videoplayer-interactive": "1.0.36-dev.e16bef2c.0",
60
+ "@vkontakte/videoplayer-shared": "1.0.59-dev.66cb5ad5.0",
61
+ "@vkontakte/videoplayer-statistics": "1.0.77-dev.a8ce6708.0"
62
62
  }
63
63
  }
@@ -5,6 +5,7 @@ import { type QualityLimits } from '@vkontakte/videoplayer-shared';
5
5
  import { InterfaceLanguage } from '@vkontakte/videoplayer-shared';
6
6
  import { type PlaybackRate } from '@vkontakte/videoplayer-core';
7
7
  import type { IStatContext } from '@vkontakte/videoplayer-statistics';
8
+ import { ThinOneStat } from '@vkontakte/videoplayer-statistics';
8
9
  import { AnnotationsApi } from '../utils/webAPI/annotationsApi/annotationsApi';
9
10
  import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from '../components/Menus/subMenuTabs/types';
10
11
  import type { AdditionalButton } from '../components/Controls/types';
@@ -107,7 +108,7 @@ export declare class VKVideoPlayer extends HTMLElement {
107
108
  updateAdditionalButton(itemId: string, fields: Partial<Omit<AdditionalButton, 'id' | 'type'>>): void;
108
109
  addAdditionalButton(newButton: AdditionalButton): void;
109
110
  removeAdditionalButton(itemId: string): void;
110
- updateStatContext(statContext: Partial<IStatContext>): void;
111
+ updateStatContext(statContext: Partial<IStatContext | ThinOneStat.IStatContext>): void;
111
112
  handleTimerNextVideo(state: boolean): void;
112
113
  focus(): void;
113
114
  private unmountComponent;