@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/es2024.cjs.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
  "use strict";var I1=Object.create;var zd=Object.defineProperty;var E1=Object.getOwnPropertyDescriptor;var A1=Object.getOwnPropertyNames;var P1=Object.getPrototypeOf,M1=Object.prototype.hasOwnProperty;var L1=(t,e)=>{for(var i in e)zd(t,i,{get:e[i],enumerable:!0})},Fm=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of A1(e))!M1.call(t,n)&&n!==i&&zd(t,n,{get:()=>e[n],enumerable:!(o=E1(e,n))||o.enumerable});return t};var Um=(t,e,i)=>(i=t!=null?I1(P1(t)):{},Fm(e||!t||!t.__esModule?zd(i,"default",{value:t,enumerable:!0}):i,t)),V1=t=>Fm(zd({},"__esModule",{value:!0}),t);var I3={};L1(I3,{ControlButtonType:()=>sd,GridTypes:()=>hr,InterfaceLanguage:()=>Js.InterfaceLanguage,MenuItemType:()=>Os,PlayerPhase:()=>la,VERSION:()=>Da,VKNumericLanguage:()=>Js.VKNumericLanguage,VideoFormat:()=>uu.VideoFormat,VideoQuality:()=>uu.VideoQuality,loadVKLangPack:()=>Js.loadVKLangPack,registerPlayerWebComponent:()=>k3});module.exports=V1(I3);var ia="[",xa="[!",wa="]",Hr={};var vi=Symbol(),ni=Symbol("filename"),zm=Symbol("hmr"),qm="http://www.w3.org/1999/xhtml",bu="http://www.w3.org/2000/svg";var qd=!0;var $u=globalThis.process?.env?.NODE_ENV;$u||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=$u&&!$u.toLowerCase().includes("prod");var xo=Symbol("$state"),Fr=Symbol("$state metadata"),dl=Symbol("legacy props"),Km=Symbol("");var cr=Array.isArray,Wm=Array.prototype.indexOf,cl=Array.from,yu=Object.keys,Oi=Object.defineProperty,An=Object.getOwnPropertyDescriptor,Kd=Object.getOwnPropertyDescriptors,xu=Object.prototype,Qm=Array.prototype,Ur=Object.getPrototypeOf;function oa(t){return typeof t=="function"}var J=()=>{};function Gm(t){return t()}function na(t){for(var e=0;e<t.length;e++)t[e]()}var ul=[],wu=[];function jm(){var t=ul;ul=[],na(t)}function R1(){var t=wu;wu=[],na(t)}function Bo(t){ul.length===0&&queueMicrotask(jm),ul.push(t)}function Su(){ul.length>0&&jm(),wu.length>0&&R1()}function Wd(t){return t===this.v}function us(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Ym(t,e){return t!==e}function ps(t){return!us(t,this.v)}function Zm(){if($e){let t=new Error(`derived_references_self
@@ -45,7 +45,7 @@ ${l}in ${u}`).join("")}
45
45
  `)){let o=W1.exec(i)??Q1.exec(i);o&&e.push({file:o[1],line:+o[2],column:+o[3]})}return e}function Nv(){let t=G1()?.slice(4);if(!t)return null;for(let e=0;e<t.length;e++){let i=t[e],o=K1[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 sc=Symbol("ADD_OWNER");function zu(t,e,i=!1,o=!1){if(t&&!i){let n=Uo,a=t[Fr];if(a&&!qu(a,n)){let s=Ku(a);e&&e[ni]!==n[ni]&&!o&&bv(n[ni],e[ni],s[ni])}}lc(t,e,new Set)}function Lu(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 lc(t,e,i){let o=t?.[Fr];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),sc in t&&t[sc])to(()=>{t[sc](e)});else{var n=Ur(t);if(n===Object.prototype)for(let a in t)if(Object.getOwnPropertyDescriptor(t,a)?.get){let s=vi;to(()=>{let d=t[a];s!==d&&(s=d,lc(d,e,i))})}else lc(t[a],e,i);else if(n===Array.prototype)for(let a=0;a<t.length;a+=1)lc(t[a],e,i)}}}function qu(t,e){return t.owners===null?!0:t.owners.has(e)||ni in e&&[...t.owners].some(i=>i[ni]===e[ni])||t.parent!==null&&qu(t.parent,e)}function Ku(t){return t?.owners?.values().next().value??Ku(t.parent)}var j1=!1;function yv(t){if(j1)return;let e=Nv();if(e&&!qu(t,e)){let i=Ku(t);i[ni]!==e[ni]?Mu(e[ni],i[ni]):Mu()}}function xs(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 St=null;function yl(t){St=t}var Uo=null;function xl(t){Uo=t}function ws(t){return Wu("getContext").get(t)}function Ss(t,e){let i=Wu("setContext");return $e&&ft(()=>zu(e,null,!0)),i.set(t,e),e}function Sl(){return Wu("getAllContexts")}function F(t,e=!1,i){var o=St={p:St,c:null,d:!1,e:null,m:!1,s:t,x:null,l:null};Pr&&!e&&(St.l={s:null,u:null,r1:[],r2:Si(!1)}),zo(()=>{o.d=!0}),$e&&(St.function=i,Uo=i)}function U(t){let e=St;if(e!==null){t!==void 0&&(e.x=t);let s=e.e;if(s!==null){var i=ht,o=It;e.e=null;try{for(var n=0;n<s.length;n++){var a=s[n];Hi(a.effect),Ji(a.reaction),ln(a.fn)}}finally{Hi(i),Ji(o)}}St=e.p,$e&&(Uo=e.p?.function??null),e.m=!0}return t||{}}function Lr(){return!Pr||St!==null&&St.l===null}function Wu(t){return St===null&&xs(t),St.c??=new Map(Z1(St)||void 0)}function Z1(t){let e=t.p;for(;e!==null;){let i=e.c;if(i!==null)return i;e=e.p}return null}var X1=/\r/g;function Dv(t){t=t.replace(X1,"");let e=5381,i=t.length;for(;i--;)e=(e<<5)-e^t.charCodeAt(i);return(e>>>0).toString(36)}function Ov(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}var J1=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Hv(t){return J1.includes(t)}var e0=["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 t0={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 Fv(t){return t=t.toLowerCase(),t0[t]??t}var I5=[...e0,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var i0=["touchstart","touchmove"];function Uv(t){return i0.includes(t)}var o0=["textarea","script","style","title"];function zv(t){return o0.includes(t)}function Qu(t){return t?.replace(/\//g,"/\u200B")}var qv=new Map;function Kv(t,e){var i=qv.get(t);i||(i=new Set,qv.set(t,i)),i.add(e)}function Gu(t,e){if(e){let i=document.body;t.autofocus=!0,Bo(()=>{document.activeElement===i&&t.focus()})}}function Cl(t){var e=It,i=ht;Ji(null),Hi(null);try{return t()}finally{Ji(e),Hi(i)}}var ju=new Set,dc=new Set;function La(t){if(!Qe)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 Yu(t,e,i,o={}){function n(a){if(o.capture||Cs.call(e,a),!a.cancelBubble)return Cl(()=>i?.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Bo(()=>{e.addEventListener(t,n,o)}):e.addEventListener(t,n,o),n}function Ct(t,e,i,o,n){var a={capture:o,passive:n},s=Yu(t,e,i,a);(e===document.body||e===window||e===document)&&zo(()=>{e.removeEventListener(t,s,a)})}function it(t){for(var e=0;e<t.length;e++)ju.add(t[e]);for(var i of dc)i(t)}function Cs(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){Oi(t,"currentTarget",{configurable:!0,get(){return a||i}});var u=It,_=ht;Ji(null),Hi(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(cr(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),Hi(_)}}}var r0;function Wv(){r0=void 0}function Ts(t){var e=document.createElement("template");return e.innerHTML=t,e.content}function io(t,e){var i=ht;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(Qe)return io(lt,null),lt;n===void 0&&(n=Ts(a?t:"<!>"+t),i||(n=ai(n)));var s=o||vl?document.importNode(n,!0):n.cloneNode(!0);if(i){var d=ai(s),l=s.lastChild;io(d,l)}else io(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(Qe)return io(lt,null),lt;if(!s){var d=Ts(a),l=ai(d);if(n)for(s=document.createDocumentFragment();ai(l);)s.appendChild(ai(l));else s=ai(l)}var c=s.cloneNode(!0);if(n){var u=ai(c),_=c.lastChild;io(u,_)}else io(c,c);return c}}function Kn(t=""){if(!Qe){var e=Ho(t+"");return io(e,e),e}var i=lt;return i.nodeType!==3&&(i.before(i=Ho()),ri(i)),io(i,i),i}function Ke(){if(Qe)return io(lt,null),lt;var t=document.createDocumentFragment(),e=document.createComment(""),i=Ho();return t.append(e,i),io(e,i),t}function b(t,e){if(Qe){ht.nodes_end=lt,$i();return}t!==null&&t.before(e)}var Tl=!0;function cc(t){Tl=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 Gr(t,e){return Gv(t,e)}function Xu(t,e){Zd(),e.intro=e.intro??!1;let i=e.target,o=Qe,n=lt;try{for(var a=ai(i);a&&(a.nodeType!==8||a.data!==ia);)a=fo(a);if(!a)throw Hr;Ui(!0),ri(a),$i();let s=Gv(t,{...e,anchor:a});if(lt===null||lt.nodeType!==8||lt.data!==wa)throw Ea(),Hr;return Ui(!1),s}catch(s){if(s===Hr)return e.recover===!1&&iv(),Zd(),gl(i),Ui(!1),Gr(t,e);throw s}finally{Ui(o),ri(n),Wv()}}var ks=new Map;function Gv(t,{target:e,anchor:i,props:o={},events:n,context:a,intro:s=!0}){Zd();var d=new Set,l=_=>{for(var f=0;f<_.length;f++){var y=_[f];if(!d.has(y)){d.add(y);var x=Uv(y);e.addEventListener(y,Cs,{passive:x});var w=ks.get(y);w===void 0?(document.addEventListener(y,Cs,{passive:x}),ks.set(y,1)):ks.set(y,w+1)}}};l(cl(ju)),dc.add(l);var c=void 0,u=Rv(()=>{var _=i??e.appendChild(Ho());return Ci(()=>{if(a){F({});var f=St;f.c=a}n&&(o.$$events=n),Qe&&io(_,null),Tl=s,c=t(_,o)||{},Tl=!0,Qe&&(ht.nodes_end=lt),a&&U()}),()=>{for(var f of d){e.removeEventListener(f,Cs);var y=ks.get(f);--y===0?(document.removeEventListener(f,Cs),ks.delete(f)):ks.set(f,y)}dc.delete(l),_!==i&&_.parentNode?.removeChild(_)}});return Zu.set(c,u),c}var Zu=new WeakMap;function Va(t,e){let i=Zu.get(t);return i?(Zu.delete(t),i(e)):($e&&_v(),Promise.resolve())}function V(t,e,[i,o]=[0,0]){Qe&&i===0&&$i();var n=t,a=null,s=null,d=vi,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(Qe&&o!==-1){if(i===0){let S=n.data;S===ia?o=0:S===xa?o=1/0:(o=parseInt(S.substring(1)),o!==o&&(o=d?1/0:-1))}let w=o>i;!!d===w&&(n=hs(),ri(n),Ui(!1),x=!0,o=-1)}d?(a?Qr(a):y&&(a=Ci(()=>y(n))),s&&dn(s,()=>{s=null})):(s?Qr(s):y&&(s=Ci(()=>y(n,[i+1,o]))),a&&dn(a,()=>{a=null})),x&&Ui(!0)};zi(()=>{c=!1,e(u),c||_(null,null)},l),Qe&&(n=lt)}function kl(t,e,i){Qe&&$i();var o=t,n=vi,a,s=Lr()?Ym:us;zi(()=>{s(n,n=e())&&(a&&dn(a),a=Ci(()=>i(o)))}),Qe&&(o=lt)}var sa=null;function tp(t){sa=t}function Il(t,e){return e}function d0(t,e,i,o){for(var n=[],a=e.length,s=0;s<a;s++)ac(e[s].e,n,!0);var d=a>0&&n.length===0&&i!==null;if(d){var l=i.parentNode;gl(l),l.append(i),o.clear(),aa(t,e[0].prev,e[a-1].next)}Uu(n,()=>{for(var c=0;c<a;c++){var u=e[c];d||(o.delete(u.k),aa(t,u.prev,u.next)),Fi(u.e,!d)}})}function ui(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=Qe?ri(ai(c)):c.appendChild(Ho())}Qe&&$i();var u=null,_=!1,f=fr(()=>{var y=i();return cr(y)?y:y==null?[]:cl(y)});zi(()=>{var y=r(f),x=y.length;if(_&&x===0)return;_=x===0;let w=!1;if(Qe){var S=s.data===xa;S!==(x===0)&&(s=hs(),ri(s),Ui(!1),w=!0)}if(Qe){for(var I=null,L,A=0;A<x;A++){if(lt.nodeType===8&&lt.data===wa){s=lt,w=!0,Ui(!1);break}var P=y[A],k=o(P,A);L=Zv(lt,d,I,null,P,k,A,n,e,i),d.items.set(k,L),I=L}x>0&&ri(hs())}Qe||c0(y,d,s,n,e,o,i),a!==null&&(x===0?u?Qr(u):u=Ci(()=>a(s)):u!==null&&dn(u,()=>{u=null})),w&&Ui(!0),r(f)}),Qe&&(s=lt)}function c0(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=Zv(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&&u0(P,L,k,n),(P.e.f&8192)!==0&&(Qr(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)jv(S[G],Q,i);for(G=0;G<I.length;G+=1)y.delete(I[G]);aa(e,ee.prev,oe.next),aa(e,x,ee),aa(e,oe,Q),f=Q,x=oe,k-=1,S=[],I=[]}else y.delete(P),jv(P,f,i),aa(e,P.prev,P.next),aa(e,P,x===null?e.first:x.next),aa(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?[]:cl(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()}d0(e,ne,ge,u)}}d&&Bo(()=>{if(w!==void 0)for(P of w)P.a?.apply()}),ht.first=e.first&&e.first.e,ht.last=x&&x.e}function u0(t,e,i,o){(o&1)!==0&&ms(t.v,e),(o&2)!==0?ms(t.i,i):t.i=i}function Zv(t,e,i,o,n,a,s,d,l,c){var u=sa,_=(l&1)!==0,f=(l&16)===0,y=_?f?Kr(n):Si(n):n,x=(l&2)===0?s:Si(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};sa=w;try{return w.e=Ci(()=>d(t,y,x,c),Qe),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{sa=u}}function jv(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=fo(a);n.before(a),a=s}}function aa(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 p0(t,e,i){if(!e||e===Dv(String(i??"")))return;let o,n=t.__svelte_meta?.loc;n?o=`near ${n.file}:${n.line}:${n.column}`:Uo?.[ni]&&(o=`in ${Uo[ni]}`),hv(Qu(o))}function El(t,e,i,o,n){var a=t,s="",d;zi(()=>{if(s===(s=e()??"")){Qe&&$i();return}d!==void 0&&(Fi(d),d=void 0),s!==""&&(d=Ci(()=>{if(Qe){for(var l=lt.data,c=$i(),u=c;c!==null&&(c.nodeType!==8||c.data!=="");)u=c,c=fo(c);if(c===null)throw Ea(),Hr;$e&&!n&&p0(c.parentNode,l,s),io(lt,u),a=ri(c);return}var _=s+"";i?_=`<svg>${_}</svg>`:o&&(_=`<math>${_}</math>`);var f=Ts(_);if((i||o)&&(f=ai(f)),io(ai(f),f.lastChild),i||o)for(;ai(f);)a.before(ai(f));else a.before(f)}))})}function de(t,e,...i){var o=t,n=J,a;zi(()=>{n!==(n=e())&&(a&&(Fi(a),a=null),$e&&n==null&&ov(),a=Ci(()=>n(o,...i)))},65536),Qe&&(o=lt)}function yi(t,e,i){Qe&&$i();var o=t,n,a;zi(()=>{n!==(n=e())&&(a&&(dn(a),a=null),n&&(a=Ci(()=>i(o,n))))},65536),Qe&&(o=lt)}function Al(t,e,i,o,n,a){let s=Qe;Qe&&$i();var d=$e&&a&&St?.function[ni],l,c,u=null;Qe&&lt.nodeType===1&&(u=lt,$i());var _=Qe?lt:t,f,y=sa;zi(()=>{let x=e()||null;var w=n?n():i||x==="svg"?bu:null;if(x!==l){var S=sa;tp(y),f&&(x===null?dn(f,()=>{f=null,c=null}):x===c?Qr(f):(Fi(f),cc(!1))),x&&x!==c&&(f=Ci(()=>{if(u=Qe?u:w?document.createElementNS(w,x):document.createElement(x),$e&&a&&(u.__svelte_meta={loc:{file:d,line:a[0],column:a[1]}}),io(u,u),o){Qe&&zv(x)&&u.append(document.createComment(""));var I=Qe?ai(u):u.appendChild(Ho());Qe&&(I===null?Ui(!1):ri(I)),o(u,I)}ht.nodes_end=u,_.before(u)})),l=x,l&&(c=l),cc(!0),tp(S)}},65536),s&&(Ui(!0),ri(_))}var op;function Xv(t){return op=t.target,new ip(t)}var ip=class{#t;#e;constructor(e){var i=new Map,o=(a,s)=>{var d=Kr(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===dl?!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?Xu:Gr)(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)&&$s(),this.#t=n.$$events;for(let a of Object.keys(this.#e))a==="$set"||a==="$destroy"||a==="$on"||Oi(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=()=>{Va(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){Bo(()=>{var i=t.getRootNode(),o=i.host?i:i.head??i.ownerDocument.head??op?.parentNode;if(!o?.querySelector("#"+e.hash)){let n=document.createElement("style");n.id=e.hash,n.textContent=e.code,o.appendChild(n),$e&&Kv(e.hash,n)}})}function Jv(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=Jv(t[e]))&&(o&&(o+=" "),o+=i)}else for(i in t)t[i]&&(o&&(o+=" "),o+=i);return o}function eg(){for(var t,e,i=0,o="",n=arguments.length;i<n;i++)(t=arguments[i])&&(e=Jv(t))&&(o&&(o+=" "),o+=e);return o}function Pl(t){return typeof t=="object"?eg(t):t??""}var tg=[...`
48
- \r\f\xA0\v\uFEFF`];function og(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||tg.includes(o[s-1]))&&(d===o.length||tg.includes(o[d]))?o=(s===0?"":o.substring(0,s))+o.substring(d+1):s=d}}return o===""?null:o}function ig(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 np(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function ng(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(np)),n&&l.push(...Object.keys(n).map(np));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=np(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+=ig(o)),n&&(i+=ig(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(Qe||s!==i){var d=og(i,o,a);(!Qe||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 rp(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 tt(t,e,i,o){var n=t.__style;if(Qe||n!==e){var a=ng(e,o);(!Qe||a!==t.getAttribute("style"))&&(a==null?t.removeAttribute("style"):t.style.cssText=a),t.__style=e}else o&&(Array.isArray(o)?(rp(t,i?.[0],o[0]),rp(t,i?.[1],o[1],"important")):rp(t,i,o));return o}var Is=Symbol("class"),Es=Symbol("style"),sg=Symbol("is custom element"),lg=Symbol("is html");function dg(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ve(t,e,i,o){var n=cg(t);if(Qe&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||b0(t,e,i??"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[Km]=i),i==null?t.removeAttribute(e):typeof i!="string"&&ug(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function he(t,e,i,o,n=!1){var a=cg(t),s=a[sg],d=!a[lg];let l=Qe&&s;l&&Ui(!1);var c=e||{},u=t.tagName==="OPTION";for(var _ in e)_ in i||(i[_]=null);i.class?i.class=Pl(i.class):(o||i[Is])&&(i.class=null),i[Es]&&(i.style??=null);var f=ug(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?.[Is],i[Is]),c[P]=k,c[Is]=i[Is];continue}if(P==="style"){tt(t,k,e?.[Es],i[Es]),c[P]=k,c[Es]=i[Es];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=Hv(G);if(Ov(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,it([G]);else{let ee=function(oe){c[P].call(this,oe)};var A=ee;c[Q]=Yu(G,t,ee,N)}else S&&(t[`__${G}`]=void 0)}else if(P==="style")Ve(t,P,k);else if(P==="autofocus")Gu(t,!!k);else if(!s&&(P==="__value"||P==="value"&&k!=null))t.value=t.__value=k;else if(P==="selected"&&u)dg(t,k);else{var I=P;d||(I=Fv(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&&Ui(!0),c}function cg(t){return t.__attributes??={[sg]:t.nodeName.includes("-"),[lg]:t.namespaceURI===qm}}var rg=new Map;function ug(t){var e=rg.get(t.nodeName);if(e)return e;rg.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=Ur(o)}return e}function b0(t,e,i){$e&&(e==="srcset"&&$0(t,i)||ap(t.getAttribute(e)??"",i)||gv(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function ap(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function ag(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function $0(t,e){var i=ag(t.srcset),o=ag(e);return o.length===i.length&&o.every(([n,a],s)=>a===i[s][1]&&(ap(i[s][0],n)||ap(n,i[s][0])))}var y0=qd?()=>performance.now():()=>Date.now(),vr={tick:t=>(qd?requestAnimationFrame:J)(t),now:()=>y0(),tasks:new Set};function pg(){let t=vr.now();vr.tasks.forEach(e=>{e.c(t)||(vr.tasks.delete(e),e.f())}),vr.tasks.size!==0&&vr.tick(pg)}function fg(t){let e;return vr.tasks.size===0&&vr.tick(pg),{promise:new Promise(i=>{vr.tasks.add(e={c:t,f:i})}),abort(){vr.tasks.delete(e)}}}function uc(t,e){Cl(()=>{t.dispatchEvent(new CustomEvent(e))})}function C0(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 mg(t){let e={},i=t.split(";");for(let o of i){let[n,a]=o.split(":");if(!n||a===void 0)break;let s=C0(n.trim());e[s]=a.trim()}return e}var T0=t=>t;function lp(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=It,P=ht;Ji(null),Hi(null);try{return c??=i()(e,o?.()??{},{direction:l})}finally{Ji(A),Hi(P)}}var w={is_global:d,in(){if(e.inert=u,!n){y?.abort(),y?.reset?.();return}a||f?.abort(),uc(e,"introstart"),f=sp(e,x(),y,1,()=>{uc(e,"introend"),f?.abort(),f=c=void 0,e.style.overflow=_})},out(A){if(!a){A?.(),c=void 0;return}e.inert=!0,uc(e,"outrostart"),y=sp(e,x(),f,0,()=>{uc(e,"outroend"),A?.()})},stop:()=>{f?.abort(),y?.abort()}},S=ht;if((S.transitions??=[]).push(w),n&&Tl){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&&ln(()=>{ft(()=>w.in())})}}function sp(t,e,i,o,n){var a=o===1;if(oa(e)){var s,d=!1;return Bo(()=>{if(!d){var S=e({direction:a?"in":"out"});s=sp(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:_=T0}=e;var f=[];if(a&&i===void 0&&(u&&u(0,1),c)){var y=mg(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=mg(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&&fg(()=>{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 dp=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 E0=new dp({box:"border-box"});function Vr(t,e,i){var o=E0.observe(t,()=>i(t[e]));ln(()=>(ft(()=>i(t[e])),o))}function vg(t,e){return t===e||t?.[xo]===e}function at(t={},e,i,o){return ln(()=>{var n,a;return to(()=>{n=a,a=o?.()||[],ft(()=>{t!==i(...a)&&(e(t,...a),n&&vg(i(...n),t)&&e(null,...n))})}),()=>{Bo(()=>{a&&vg(i(...a),t)&&e(null,...a)})}}),t}function gr(t=!1){let e=St,i=e.l.u;if(!i)return;let o=()=>oc(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&&ys(()=>{gg(e,o),na(i.b)}),Ge(()=>{let n=ft(()=>i.m.map(Gm));return()=>{for(let a of n)typeof a=="function"&&a()}}),i.a.length&&Ge(()=>{gg(e,o),na(i.a)})}function gg(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;av(e)},set:o=>{i=o}})}};P0=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var P0;function At(t){St===null&&xs("onMount"),Pr&&St.l!==null?A0(St).m.push(t):Ge(()=>{let e=ft(t);if(typeof e=="function")return e})}function cn(t){St===null&&xs("onDestroy"),At(()=>()=>ft(t))}function A0(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=ft(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var As=[];function Wn(t,e){return{subscribe:ae(t,e).subscribe}}function ae(t,e=J){let i=null,o=new Set;function n(d){if(us(t,d)&&(t=d,i)){let l=!As.length;for(let c of o)c[1](),As.push(c,t);if(l){for(let c=0;c<As.length;c+=2)As[c][0](As[c+1]);As.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 si(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 Wn(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(){na(y),_(),l=!1}})}function ve(t){let e;return Ml(t,i=>e=i)(),e}var fc=!1,cp=Symbol();function $(t,e,i){let o=i[e]??={store:null,source:Kr(void 0),unsubscribe:J};if(o.store!==t&&!(cp 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&&cp in i?ve(t):r(o.source)}function He(){let t={};function e(){zo(()=>{for(var i in t)t[i].unsubscribe();Oi(t,cp,{enumerable:!1,value:!0})})}return[t,e]}function up(t){var e=fc;try{return fc=!1,[t(),fc]}finally{fc=e}}var D0={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return $e&&rv(`${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},D0)}var O0={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(oa(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];oa(n)&&(n=n());let a=An(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(oa(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=An(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===xo||e===dl)return!1;for(let i of t.props)if(oa(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props){oa(i)&&(i=i());for(let o in i)e.includes(o)||e.push(o)}return e}};function jr(...t){return new Proxy({props:t},O0)}function hg(t){return t.ctx?.d??!1}function v(t,e,i,o){var n=(i&1)!==0,a=!Pr||(i&2)!==0,s=(i&8)!==0,d=(i&16)!==0,l=!1,c;s?[c,l]=up(()=>t[e]):c=t[e];var u=xo in t||dl in t,_=s&&(An(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=ft(o):f=o),f);c===void 0&&o!==void 0&&(_&&a&&nv(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:fr)(()=>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=Kr(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=ps),function(Q,G){if(fl!==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),hg(N))return Q;ft(()=>r(N))}return Q}return hg(N)?N.v:r(N)}}var H0;typeof HTMLElement=="function"&&(H0=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=F0(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]=pp(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=Xv({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:i,$$host:this}}),this.$$me=rc(()=>{to(()=>{this.$$r=!0;for(let n of yu(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let a=pp(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]=pp(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 yu(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function pp(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 F0(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var _g="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(_g);var v1=require("@vkontakte/videoplayer-core/es2024"),aW=require("@vkontakte/videoplayer-core/es2024"),as=require("@vkontakte/videoplayer-shared/es2024"),g1=require("@vkontakte/videoplayer-statistics/es2024");var Ra=require("@vkontakte/videoplayer-shared/es2024");var z0={isMobile:void 0,debugLog:!1,devNullLog:!1,defaultLanguage:Ra.InterfaceLanguage.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:Ra.VideoQuality.Q_480P,highQualityLimit:Ra.VideoQuality.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}},bg=t=>(0,Ra.fillWithDefault)(t,z0),$g=t=>Ss("ui-config",t),Bt=()=>ws("ui-config");var Ll="vk_player_debug_panel_opened";var yg="videoplayer",xg="videoplayer";var Rr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},wg=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Sg=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),Cg=new Set(["ShiftRight","ShiftLeft"]);var Tg=["TIMELINE"],Vl=[...Tg,"GRAPH_BUTTON"],fp=[...Tg,"PLAY_BUTTON"],Rl=[...Vl,"PLAY_BUTTON"];var hr=(a=>(a.XS="xs",a.S="s",a.M="m",a.L="l",a.XL="xl",a))(hr||{}),Na={xs:0,s:1,m:2,l:3,xl:4};var Bl=require("@vkontakte/videoplayer-shared/es2024"),kg=require("@vkontakte/videoplayer-core/es2024"),Ig=require("@vkontakte/videoplayer-statistics/es2024");var mc="prod",Da="1.1.61-dev.4affc441.0";var Oa=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var Eg=Symbol("storeContext"),Ag=Symbol("microStoresContext"),Pg=(t,e)=>{Ss(Eg,t),Ss(Ag,e),mc==="dev"&&(window.app={store:t,microStores:e})},ye=()=>{let t=ws(Eg);return(0,Bl.assertNonNullable)(t,"Store context is empty!"),t},qi=()=>{let t=ws(Ag);return(0,Bl.assertNonNullable)(t,"MicroStores context is empty!"),t},Ut=(t,e)=>gc(t,t.getValue(),e),gc=(t,e,i)=>Wn(e,o=>{let n=t.subscribe(a=>{o(a),i?.(a)});return()=>n.unsubscribe()}),Mg=(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=`${Da} (core: ${kg.VERSION}, stat: ${Ig.VERSION}, shared: ${Bl.VERSION})`,u=ve(i.state.errorLog$),_=u.length?`
48
+ \r\f\xA0\v\uFEFF`];function og(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||tg.includes(o[s-1]))&&(d===o.length||tg.includes(o[d]))?o=(s===0?"":o.substring(0,s))+o.substring(d+1):s=d}}return o===""?null:o}function ig(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 np(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function ng(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(np)),n&&l.push(...Object.keys(n).map(np));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=np(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+=ig(o)),n&&(i+=ig(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(Qe||s!==i){var d=og(i,o,a);(!Qe||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 rp(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 tt(t,e,i,o){var n=t.__style;if(Qe||n!==e){var a=ng(e,o);(!Qe||a!==t.getAttribute("style"))&&(a==null?t.removeAttribute("style"):t.style.cssText=a),t.__style=e}else o&&(Array.isArray(o)?(rp(t,i?.[0],o[0]),rp(t,i?.[1],o[1],"important")):rp(t,i,o));return o}var Is=Symbol("class"),Es=Symbol("style"),sg=Symbol("is custom element"),lg=Symbol("is html");function dg(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ve(t,e,i,o){var n=cg(t);if(Qe&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){o||b0(t,e,i??"");return}n[e]!==(n[e]=i)&&(e==="loading"&&(t[Km]=i),i==null?t.removeAttribute(e):typeof i!="string"&&ug(t).includes(e)?t[e]=i:t.setAttribute(e,i))}function he(t,e,i,o,n=!1){var a=cg(t),s=a[sg],d=!a[lg];let l=Qe&&s;l&&Ui(!1);var c=e||{},u=t.tagName==="OPTION";for(var _ in e)_ in i||(i[_]=null);i.class?i.class=Pl(i.class):(o||i[Is])&&(i.class=null),i[Es]&&(i.style??=null);var f=ug(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?.[Is],i[Is]),c[P]=k,c[Is]=i[Is];continue}if(P==="style"){tt(t,k,e?.[Es],i[Es]),c[P]=k,c[Es]=i[Es];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=Hv(G);if(Ov(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,it([G]);else{let ee=function(oe){c[P].call(this,oe)};var A=ee;c[Q]=Yu(G,t,ee,N)}else S&&(t[`__${G}`]=void 0)}else if(P==="style")Ve(t,P,k);else if(P==="autofocus")Gu(t,!!k);else if(!s&&(P==="__value"||P==="value"&&k!=null))t.value=t.__value=k;else if(P==="selected"&&u)dg(t,k);else{var I=P;d||(I=Fv(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&&Ui(!0),c}function cg(t){return t.__attributes??={[sg]:t.nodeName.includes("-"),[lg]:t.namespaceURI===qm}}var rg=new Map;function ug(t){var e=rg.get(t.nodeName);if(e)return e;rg.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=Ur(o)}return e}function b0(t,e,i){$e&&(e==="srcset"&&$0(t,i)||ap(t.getAttribute(e)??"",i)||gv(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(i)))}function ap(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function ag(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function $0(t,e){var i=ag(t.srcset),o=ag(e);return o.length===i.length&&o.every(([n,a],s)=>a===i[s][1]&&(ap(i[s][0],n)||ap(n,i[s][0])))}var y0=qd?()=>performance.now():()=>Date.now(),vr={tick:t=>(qd?requestAnimationFrame:J)(t),now:()=>y0(),tasks:new Set};function pg(){let t=vr.now();vr.tasks.forEach(e=>{e.c(t)||(vr.tasks.delete(e),e.f())}),vr.tasks.size!==0&&vr.tick(pg)}function fg(t){let e;return vr.tasks.size===0&&vr.tick(pg),{promise:new Promise(i=>{vr.tasks.add(e={c:t,f:i})}),abort(){vr.tasks.delete(e)}}}function uc(t,e){Cl(()=>{t.dispatchEvent(new CustomEvent(e))})}function C0(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 mg(t){let e={},i=t.split(";");for(let o of i){let[n,a]=o.split(":");if(!n||a===void 0)break;let s=C0(n.trim());e[s]=a.trim()}return e}var T0=t=>t;function lp(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=It,P=ht;Ji(null),Hi(null);try{return c??=i()(e,o?.()??{},{direction:l})}finally{Ji(A),Hi(P)}}var w={is_global:d,in(){if(e.inert=u,!n){y?.abort(),y?.reset?.();return}a||f?.abort(),uc(e,"introstart"),f=sp(e,x(),y,1,()=>{uc(e,"introend"),f?.abort(),f=c=void 0,e.style.overflow=_})},out(A){if(!a){A?.(),c=void 0;return}e.inert=!0,uc(e,"outrostart"),y=sp(e,x(),f,0,()=>{uc(e,"outroend"),A?.()})},stop:()=>{f?.abort(),y?.abort()}},S=ht;if((S.transitions??=[]).push(w),n&&Tl){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&&ln(()=>{ft(()=>w.in())})}}function sp(t,e,i,o,n){var a=o===1;if(oa(e)){var s,d=!1;return Bo(()=>{if(!d){var S=e({direction:a?"in":"out"});s=sp(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:_=T0}=e;var f=[];if(a&&i===void 0&&(u&&u(0,1),c)){var y=mg(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=mg(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&&fg(()=>{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 dp=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 E0=new dp({box:"border-box"});function Vr(t,e,i){var o=E0.observe(t,()=>i(t[e]));ln(()=>(ft(()=>i(t[e])),o))}function vg(t,e){return t===e||t?.[xo]===e}function at(t={},e,i,o){return ln(()=>{var n,a;return to(()=>{n=a,a=o?.()||[],ft(()=>{t!==i(...a)&&(e(t,...a),n&&vg(i(...n),t)&&e(null,...n))})}),()=>{Bo(()=>{a&&vg(i(...a),t)&&e(null,...a)})}}),t}function gr(t=!1){let e=St,i=e.l.u;if(!i)return;let o=()=>oc(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&&ys(()=>{gg(e,o),na(i.b)}),Ge(()=>{let n=ft(()=>i.m.map(Gm));return()=>{for(let a of n)typeof a=="function"&&a()}}),i.a.length&&Ge(()=>{gg(e,o),na(i.a)})}function gg(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;av(e)},set:o=>{i=o}})}};P0=t,t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}var P0;function At(t){St===null&&xs("onMount"),Pr&&St.l!==null?A0(St).m.push(t):Ge(()=>{let e=ft(t);if(typeof e=="function")return e})}function cn(t){St===null&&xs("onDestroy"),At(()=>()=>ft(t))}function A0(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=ft(()=>t.subscribe(e,i));return o.unsubscribe?()=>o.unsubscribe():o}var As=[];function Wn(t,e){return{subscribe:ae(t,e).subscribe}}function ae(t,e=J){let i=null,o=new Set;function n(d){if(us(t,d)&&(t=d,i)){let l=!As.length;for(let c of o)c[1](),As.push(c,t);if(l){for(let c=0;c<As.length;c+=2)As[c][0](As[c+1]);As.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 si(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 Wn(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(){na(y),_(),l=!1}})}function ve(t){let e;return Ml(t,i=>e=i)(),e}var fc=!1,cp=Symbol();function $(t,e,i){let o=i[e]??={store:null,source:Kr(void 0),unsubscribe:J};if(o.store!==t&&!(cp 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&&cp in i?ve(t):r(o.source)}function He(){let t={};function e(){zo(()=>{for(var i in t)t[i].unsubscribe();Oi(t,cp,{enumerable:!1,value:!0})})}return[t,e]}function up(t){var e=fc;try{return fc=!1,[t(),fc]}finally{fc=e}}var D0={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return $e&&rv(`${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},D0)}var O0={get(t,e){let i=t.props.length;for(;i--;){let o=t.props[i];if(oa(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];oa(n)&&(n=n());let a=An(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(oa(o)&&(o=o()),typeof o=="object"&&o!==null&&e in o){let n=An(o,e);return n&&!n.configurable&&(n.configurable=!0),n}}},has(t,e){if(e===xo||e===dl)return!1;for(let i of t.props)if(oa(i)&&(i=i()),i!=null&&e in i)return!0;return!1},ownKeys(t){let e=[];for(let i of t.props){oa(i)&&(i=i());for(let o in i)e.includes(o)||e.push(o)}return e}};function jr(...t){return new Proxy({props:t},O0)}function hg(t){return t.ctx?.d??!1}function v(t,e,i,o){var n=(i&1)!==0,a=!Pr||(i&2)!==0,s=(i&8)!==0,d=(i&16)!==0,l=!1,c;s?[c,l]=up(()=>t[e]):c=t[e];var u=xo in t||dl in t,_=s&&(An(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=ft(o):f=o),f);c===void 0&&o!==void 0&&(_&&a&&nv(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:fr)(()=>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=Kr(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=ps),function(Q,G){if(fl!==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),hg(N))return Q;ft(()=>r(N))}return Q}return hg(N)?N.v:r(N)}}var H0;typeof HTMLElement=="function"&&(H0=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=F0(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]=pp(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=Xv({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:i,$$host:this}}),this.$$me=rc(()=>{to(()=>{this.$$r=!0;for(let n of yu(this.$$c)){if(!this.$$p_d[n]?.reflect)continue;this.$$d[n]=this.$$c[n];let a=pp(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]=pp(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 yu(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function pp(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 F0(t){let e={};return t.childNodes.forEach(i=>{e[i.slot||"default"]=!0}),e}var _g="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(_g);var v1=require("@vkontakte/videoplayer-core/es2024"),aW=require("@vkontakte/videoplayer-core/es2024"),as=require("@vkontakte/videoplayer-shared/es2024"),g1=require("@vkontakte/videoplayer-statistics/es2024");var Ra=require("@vkontakte/videoplayer-shared/es2024");var z0={isMobile:void 0,debugLog:!1,devNullLog:!1,defaultLanguage:Ra.InterfaceLanguage.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:Ra.VideoQuality.Q_480P,highQualityLimit:Ra.VideoQuality.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}},bg=t=>(0,Ra.fillWithDefault)(t,z0),$g=t=>Ss("ui-config",t),Bt=()=>ws("ui-config");var Ll="vk_player_debug_panel_opened";var yg="videoplayer",xg="videoplayer";var Rr={KeyF:"f",KeyK:"k",KeyC:"c",KeyM:"m"},wg=new Set(["ArrowLeft","ArrowRight","KeyL","KeyJ"]),Sg=new Set(["Tab","Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]),Cg=new Set(["ShiftRight","ShiftLeft"]);var Tg=["TIMELINE"],Vl=[...Tg,"GRAPH_BUTTON"],fp=[...Tg,"PLAY_BUTTON"],Rl=[...Vl,"PLAY_BUTTON"];var hr=(a=>(a.XS="xs",a.S="s",a.M="m",a.L="l",a.XL="xl",a))(hr||{}),Na={xs:0,s:1,m:2,l:3,xl:4};var Bl=require("@vkontakte/videoplayer-shared/es2024"),kg=require("@vkontakte/videoplayer-core/es2024"),Ig=require("@vkontakte/videoplayer-statistics/es2024");var mc="prod",Da="1.1.61-dev.e1cb6686.0";var Oa=(t,e,i)=>{let o=document.createElement("a");o.href=t,o.download=`${e}.${i}`,o.style.display="none",o.click()};var Eg=Symbol("storeContext"),Ag=Symbol("microStoresContext"),Pg=(t,e)=>{Ss(Eg,t),Ss(Ag,e),mc==="dev"&&(window.app={store:t,microStores:e})},ye=()=>{let t=ws(Eg);return(0,Bl.assertNonNullable)(t,"Store context is empty!"),t},qi=()=>{let t=ws(Ag);return(0,Bl.assertNonNullable)(t,"MicroStores context is empty!"),t},Ut=(t,e)=>gc(t,t.getValue(),e),gc=(t,e,i)=>Wn(e,o=>{let n=t.subscribe(a=>{o(a),i?.(a)});return()=>n.unsubscribe()}),Mg=(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=`${Da} (core: ${kg.VERSION}, stat: ${Ig.VERSION}, shared: ${Bl.VERSION})`,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.`},eh=Q0;var Yr=new Map;Yr.set(Ps.Interf
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 Lm(t,e){F(e,!0),q(t,p3);let[i,o]=He(),n=()=>$(Mt,"$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,as.noop),je=v(e,"playPrevChapter",7,as.noop),We=v(e,"volumeMultiplier",7),Ie=v(e,"showAutoplayNext",7),Le=v(e,"showEndScreen",7,!0),De=v(e,"keyboardControls",15,void 0),{subscribers:ct,stores:_t}=d();$g(c());let ot=Bt(),kt=c().logoLink,nt=s().ui.debugPanelVisible,ut=s().ui.playerSize,Mt=s().state.isLive$,Ne=s().state.isInteractive&&v1.clientChecker.device.isAndroid,Ze=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}),Pg(s(),_t),Ge(()=>{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(ot.features.qualityDetailsSubMenuEnabled){let z=Zg(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{Xg(s().videoId),wp()&&s().actions.internal.setTrafficSavingEnabled(!0);let Ht=bp(s().videoId);Ht&&s().actions.internal.setQuality(Ht)}};function Ye(z){let Ht=a()||z;Ht&&s().initVideo({container:r(Ze),sources:Ht,failoverHosts:ce(),subtitles:x(),volumeMultiplier:We()});let xi=as.safeStorage.get(Ll)==="true";nt.set(xi),P()>0&&s().actions.external.seekTime(P());let no=X()?ot.volumeDefault:L()??hc()??ot.volumeDefault,Jt=A()??Kg();if(s().actions.external.setVolume(no),s().actions.external.setMuted(Jt),s().getAdmanWrapper().setInitialVolume(Jt?0:no),Ue(),ot.features.saveRate&&be()){let ti=Gg();ti&&!n()&&s().actions.internal.setPlaybackRate(ti)}if(Ie()){let ti=Yg();ti&&s().actions.internal.setAutoplayNextEnabled(ti)}s().ui.isAutoplay.set(I()),I()?ie():S()&&ot.features.preload&&s().actions.internal.preload()}let Lt=z=>{if(window.ResizeObserver){let Ht,xi;W=new ResizeObserver((0,as.throttleFn)(no=>{let Jt=no[0];if(Jt.contentBoxSize){let ti=Array.isArray(Jt.contentBoxSize)?Jt.contentBoxSize[0]:Jt.contentBoxSize;Ht=ti.inlineSize,xi=ti.blockSize}else Jt.contentRect&&(Ht=Jt.contentRect.width,xi=Jt.contentRect.height);ut.set({width:Ht,height:xi})},300)),W.observe(z)}ut.set({width:z.clientWidth,height:z.clientHeight})},mt=()=>{document.hidden&&s().actions.external.stop()};At(()=>{Ne&&document.addEventListener("visibilitychange",mt),ot.debugLog&&s().actions.internal.startLogging(),Lt(r(Ze));let z=ct.map(xi=>xi.init({store:s(),microStores:_t,config:l(),interactiveController:y(),uiConfig:c()})),Ht=()=>{Ne&&document.removeEventListener("visibilitychange",mt),W?.disconnect(),z.forEach(xi=>xi.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):(Ye(),Ht)});function Ee(){r(re)?s().actions.external.play():ie(!0)}function Ce(){s().actions.external.pause()}function dt(z){s().actions.external.setMuted(z)}function Nt(z){X()||z>=0&&z<=1&&s().actions.external.setVolume(z)}function Yt(z){s().actions.internal.seekTime(z,g1.SeekAction.UNKNOWN)}function li(z){s().actions.external.seekEpisodeStartTime(z)}function di(){s().actions.external.returnFocusToEpisodes()}function Ei(z){s().actions.external.setPlaybackRate(z)}function Wo(z){s().actions.external.setAutoQualityLimits(z)}let pn=eu(ot.view);var oo=u3();tt(oo,pn);var fn=h(oo);{var Qo=z=>{Mm(z,{get store(){return s()},uiConfig:ot,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:kt,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 je()},firstStart:ie,seekTime:Yt,get showEndScreen(){return Le()},get showAutoplayNext(){return Ie()},get showNextPrevButtons(){return Re()},get videoContainer(){return r(Ze)},set videoContainer(Ht){D(Ze,pe(Ht))}})},Go=z=>{Am(z,{get store(){return s()},uiConfig:ot,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:kt,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 je()},firstStart:ie,get showEndScreen(){return Le()},get showAutoplayNext(){return Ie()},get showNextPrevButtons(){return Re()},get videoContainer(){return r(Ze)},set videoContainer(Ht){D(Ze,pe(Ht))},get keyboardControls(){return De()},set keyboardControls(Ht){De(Ht)}})};V(fn,z=>{X()?z(Qo):z(Go,!1)})}g(oo),b(t,oo);var jo=U({initVideo:Ye,play:Ee,pause:Ce,setMuted:dt,setVolume:Nt,seekTime:Yt,seekEpisodeStartTime:li,returnFocusToEpisodes:di,setPlaybackRate:Ei,setAutoQualityLimits:Wo,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 je()},set playPrevChapter(z){je(z)},get volumeMultiplier(){return We()},set volumeMultiplier(z){We(z)},get showEndScreen(){return Le()},set showEndScreen(z){Le(z)},get keyboardControls(){return De()},set keyboardControls(z){De(z)}});return o(),jo}var f3=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 Vm(t,e){let i=we(e,["$$slots","$$events","$$legacy","children"]);var o=f3();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 Rm(t,e){let i=v(e,"isWhite",3,!1),o=m(()=>i()?"color: #fff;":"color: #909499;");Vm(t,{get style(){return r(o)}})}var m3=M('<div class="title svelte-1y9fytq"> </div>'),v3=M('<div class="playerStub svelte-1y9fytq"><!> <!></div>'),g3={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 Bm(t,e){q(t,g3);var i=v3(),o=h(i);{var n=d=>{var l=m3(),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);Rm(d,{get isWhite(){return r(l)}})};V(a,d=>{(!e.title||!e.thumbUrl)&&d(s)})}g(i),C(()=>tt(i,e.thumbUrl?`background-image: url('${e.thumbUrl}')`:"")),b(t,i)}var S1=require("@vkontakte/videoplayer-shared/es2024"),Ii=require("@vkontakte/videoplayer-shared/es2024"),Dd=require("@vkontakte/videoplayer-core/es2024"),cu=require("@vkontakte/videoplayer-statistics/es2024");var iu=require("@vkontakte/videoplayer-shared/es2024"),tu=class{constructor(){this.subscription=new iu.Subscription,this.logger=new iu.Logger,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()}};var js=require("@vkontakte/videoplayer-shared/es2024");var h3=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 Nm(t,e){let i=we(e,["$$slots","$$events","$$legacy","children"]);var o=h3();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 _3=M('<div><div><!></div> <span class="title svelte-1pbsod4"> </span></div>'),b3={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 Dm(t,e){F(e,!0),q(t,b3);let[i,o]=He(),n=()=>$(c,"$interfaceLanguage$",i),a=()=>$(u,"$isMobile$",i),s=ye(),d=Bt(),l=!!s.webApi.pictureInPictureApi,c=s.interfaceLanguage$,u=s.ui.isMobile,_=s.ui.t,f=m(()=>n()&&_("pip_dummy_title")),y=eu(d.view);var x=_3();Z(x,1,"player-pip-dummy svelte-1pbsod4",null,{},{"is-pip-api":l}),tt(x,y);var w=h(x);let S;var I=h(w);Nm(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 $3=460,y3=280,Ed=class{playerDomElement;playerParentShadowRoot;playerDummyElement;svelteContext;pipWindow;info={isActive$:new js.ValueSubject(!1),isEnabled$:new js.ValueSubject(!1),type:1};constructor({enabled:e=!0}={enabled:!0}){this.info.isEnabled$=new js.ValueSubject(e)}isSupported(){let{isEmbed:e}=(0,js.detectEmbed)();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:$3,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=Gr(Dm,a),this.pipWindow?.document.body.append(o),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",s=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Va(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 h1(t){return t instanceof Ed}var ou=class{static getLatestSupportedVersion(e){let i=new Ua,o=new Ed(e);if(o.isSupported())return o;if(i.isSupported())return i}};function Ad(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 _1="Inner error. Unexpectedly root annotation container null reference exception",b1="Annotation with such name already exists",$1="Annotation with such name does not exist";var Ys=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};var Zs=require("@vkontakte/videoplayer-shared/es2024"),x3="1",w3=100,nu=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new Zs.Subscription}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=(0,Zs.throttleFn)(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},w3);this.subscriptions.add((0,Zs.observeElementSize)(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 Ys(_1);if(this.annotations.has(e))throw new Ys(b1);i.style.zIndex=i.style.zIndex??x3,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 Ys($1);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(){}};var ss=require("@vkontakte/videoplayer-shared/es2024"),wo=class{init({store:e,microStores:i,interactiveController:o,config:n}){return(0,ss.assertNonNullable)(e),(0,ss.assertNonNullable)(i),(0,ss.assertNonNullable)(n),n.interactiveData&&(0,ss.assertNonNullable)(o),this.subscription=new ss.Subscription,this.subscription}};var Pd=class extends wo{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 Md=class extends wo{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 Ld=class extends wo{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}};var y1=require("@vkontakte/videoplayer-shared/es2024"),Om=ae(!1),ru=null,Vd=class extends wo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Om,set:(i,o=!1)=>{i!==ve(Om)&&(this.clearTimeout(),Om.set(i),!i&&ru&&(ru=!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((0,y1.combine)({isPlaying$:d,isInteractiveTime$:s,interactiveTimeIndicator:c}).subscribe(({isPlaying$:_,isInteractiveTime$:f,interactiveTimeIndicator:y})=>{if(!(!_||!y?.isDisplayed)){if(!f)return this.state$.set(!1);u.tooltipHelpHintActive&&ru===null&&(ru=!0,u.tooltipHelpHintActive=!1,this.state$.set(!0),n.callbacks?.onInteractiveTimeIndicatorHintDeactivated?.())}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};var au=require("@vkontakte/videoplayer-shared/es2024");var Rd=class extends wo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ae(null),toggle:au.noop};this.checkIfShouldHide=i=>ga(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(fp),!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(fp),!f&&this.graphMadePause&&n.actions.internal.pause()}catch{d({message:"Cant show graph"})}}},o.add((0,au.combine)({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}};var Hm=require("@vkontakte/videoplayer-shared/es2024"),Bd=class extends wo{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 Hm.ValueSubject(!1),isEnabled$:new Hm.ValueSubject(!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}};var lu=require("@vkontakte/videoplayer-shared/es2024");var su=require("@vkontakte/videoplayer-shared/es2024"),x1=({maxShowCount:t,timeout:e})=>{let i=[t!==0?S3({maxCount:t}):void 0,e!==0?C3({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},S3=({maxCount:t})=>{let e={};return{notificationShowed:i=>{e[i]=(e[i]??0)+1,su.safeStorage.set("videoplayer_notifications_manager_count",JSON.stringify(e[i]??0))},canShowNotification:i=>(e[i]??0)<t}},C3=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(su.safeStorage.get(e)||"{}")}catch{return{}}},o=a=>su.safeStorage.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 Nd=class extends wo{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=x1({maxShowCount:a,timeout:s});let c=n.getPlayer();return o.add(c.events.severeStallOccured$.pipe((0,lu.filterChanged)(),(0,lu.filter)(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 w1=()=>[Pd,Md,Ld,Vd,Rd,Bd,Nd].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});var Xs=require("@vkontakte/videoplayer-shared/es2024");var T3={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Ii.InterfaceLanguage.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:(0,Dd.isMobile)(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},un=Y(void 0),du=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(),Xs.devNull.create("ui"),this.logger=new Ii.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new Ii.Subscription,this.interactiveSubscription=new Ii.Subscription,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=Gr(Bm,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(),Xs.devNull.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}=Ad(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 cu.OneStat({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}=Ad(this.videoConfig,i),{unitedVideoId:s}=e;return new cu.ThinOneStat.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}=Ad(this.videoConfig,i),{sources:ce,title:R,thumbUrl:be,unitedVideoId:Ae,isClip:je=!1,duration:We,adsParams:Ie={},videoEpisodes:Le,previewThumbsData:De,subtitles:ct,live:_t}=e,ot={...S,...Ie},kt=this.getNextVideoInfo(),nt={sources:ce,title:R,thumbUrl:be,subtitles:ct,unitedVideoId:Ae,isClip:je,live:_t,albumId:n,statPlace:a,autoplay:l,muted:u,volume:c,fromTime:_,canRewindLive:f,showAds:x,adsSlotId:w,adsParams:ot,adsPreviewParam:I,adsAutoplayParam:L,duration:We,logoClickable:k,logoHidden:N,isTouch:G??Q,repeat:B,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:kt.nextVideoTitle,endScreenVideoThumb:kt.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},ut={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(nt)}`});let Mt=this.interactiveController?.state.statistics$.getValue(),Se,Ne=this.createThinOneStat(e,i);(Se||Ne)&&(this.statistics=new Fc(Se,Ne,Mt?.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new Fa(this.uiConfig.sentry,{version:Da,env:mc},{movieId:Ae,albumId:n,place:a,autoplay:(l&&!this.interactiveController)??!1,mobile:G??Q,clip:je}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat?.isid$.getValue()),this.sentry={...this.sentry,...Fa.getInstance()};let W=!!Re,re=[],ie="tooltip_interactive_go_back_disabled_first";if(W&&this.interactiveController){let mt=this.interactiveController.state.isInitialChapter$.getValue(),Ee=this.interactiveController.getHistoryState();mt&&re.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||re.push("SEEK_TO_INTERACTIVE_BUTTON"),Ee.hasPrevChapter$.getValue()||(re.push("PLAY_PREV_CHAPTER_BUTTON"),mt||(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 mt=o?.info.isEnded$.getValue()&&this.interactiveController?.state.isEndChapter$.getValue();X.onReplayInteractiveVideo&&!mt?X.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=Oh({player:o,interfaceLanguage:A,isCyrillicRelatedInterface:P,videoId:Ae,isClip:je,isLiveCatchUpMode:oe,isAudioDisabled:ee,statAuthToken:s,callbacks:X,webApi:ut,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:Ye}=this.microStoresRoot=w1(),Lt=()=>{if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Ee=>X?.onCurrentFormatChanged?.(Ee))),this.subscription.add(Ye.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 Ii.Observable(Ee=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Ce=>Ee.next(Ce)))}).pipe(this.uiConfig.features.skipInitialPlaybackRateValue?(0,Ii.skip)(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(Vl)&&Ce.add(Vl),Ee||Ce.remove(Vl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Ee=>{if(!Dd.clientChecker.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(un,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:ct,live:_t,preload:d,autoplay:l,muted:u,volume:c,fromTime:_,canRewindLive:f,supportLink:y,showAds:x,adsSlotId:w,adsParams:ot,adsPreviewParam:I,adsAutoplayParam:L,duration:We,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:kt.nextVideoTitle,endScreenVideoThumb:kt.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:_e,showEndScreen:ke,showAutoplayNext:Oe}));let mt={target:this.playerContainer,props:r(un)};this.svelteRootComponent=Gr(Lm,mt),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?Xs.devNull.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):Xs.devNull.destroy("ui")};this.coreConfig.asyncResolveClientChecker?Dd.clientChecker.isInited$.subscribe(mt=>{mt&&(console.log("UI SDK async start"),Lt())}):Lt()}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&&(0,Ii.isNonNullable)(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/es2024");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(Rl)),_==="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(Rl)})),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=Ad(T3,(0,Ii.cloneDeepWith)(e,o=>o instanceof HTMLElement?o:void 0)),this.uiConfig=bg(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 Ii.InternalsExposure("UI")),Xs.devNull.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+this.videoConfig?.showAds],numbers:[(0,S1.now)()]}),(0,Ii.isNonNullable)(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.uiConfig.features.mediaSession??this.videoConfig.isMediaSessionEnabled??!0),(0,Ii.isNonNullable)(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=ou.getLatestSupportedVersion(o):this.pictureInPictureApi=new Ua(o)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new tu:void 0,this.slotsApi=this.uiConfig.features.slots?new Zc:void 0,this.annotationsApi=this.uiConfig.features.annotations?new nu(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]),h1(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(un)&&(r(un).showNextPrevButtons=this.needToShowNextPrevButtons(),r(un).nextButtonActive=this.isNextButtonActive(),r(un).prevButtonActive=this.isPrevButtonActive(),r(un).endScreenVideoTitle=o.nextVideoTitle,r(un).endScreenVideoThumb=o.nextVideoThumb,r(un).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(un)&&(r(un).needToRepeatPlaylist=this.needToRepeatPlaylist,r(un).showNextPrevButtons=this.needToShowNextPrevButtons(),r(un).nextButtonActive=this.isNextButtonActive(),r(un).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((0,Ii.once)()).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&&Va(e)}};var Js=require("@vkontakte/videoplayer-shared/es2024"),uu=require("@vkontakte/videoplayer-core/es2024"),k3=()=>{window.customElements.define("vk-video-player",du)};
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=Gr(Dm,a),this.pipWindow?.document.body.append(o),this.info.isActive$.next(!0),this.pipWindow?.addEventListener("unload",s=>{!this.playerDomElement||!this.playerParentShadowRoot||!this.playerDummyElement||(Va(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 h1(t){return t instanceof Ed}var ou=class{static getLatestSupportedVersion(e){let i=new Ua,o=new Ed(e);if(o.isSupported())return o;if(i.isSupported())return i}};function Ad(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 _1="Inner error. Unexpectedly root annotation container null reference exception",b1="Annotation with such name already exists",$1="Annotation with such name does not exist";var Ys=class extends Error{constructor(e){super(e),this.name="AnnotationError"}};var Zs=require("@vkontakte/videoplayer-shared/es2024"),x3="1",w3=100,nu=class{constructor(e){this.annotationsInside=e;this.annotations=new Map;this.subscriptions=new Zs.Subscription}init(e){if(this.rootAnnotationsContainer=e,this.annotationsInside)return;let i=(0,Zs.throttleFn)(()=>{for(let o of this.annotations.values())this.isElementExceedsBoundaries(o,this.playerSize.width,this.playerSize.height)?o.style.visibility="hidden":o.style.visibility="visible"},w3);this.subscriptions.add((0,Zs.observeElementSize)(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 Ys(_1);if(this.annotations.has(e))throw new Ys(b1);i.style.zIndex=i.style.zIndex??x3,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 Ys($1);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(){}};var ss=require("@vkontakte/videoplayer-shared/es2024"),wo=class{init({store:e,microStores:i,interactiveController:o,config:n}){return(0,ss.assertNonNullable)(e),(0,ss.assertNonNullable)(i),(0,ss.assertNonNullable)(n),n.interactiveData&&(0,ss.assertNonNullable)(o),this.subscription=new ss.Subscription,this.subscription}};var Pd=class extends wo{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 Md=class extends wo{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 Ld=class extends wo{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}};var y1=require("@vkontakte/videoplayer-shared/es2024"),Om=ae(!1),ru=null,Vd=class extends wo{constructor(){super(...arguments);this.stateName="showInteractiveTimeIndicatorTooltip$";this.state$={...Om,set:(i,o=!1)=>{i!==ve(Om)&&(this.clearTimeout(),Om.set(i),!i&&ru&&(ru=!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((0,y1.combine)({isPlaying$:d,isInteractiveTime$:s,interactiveTimeIndicator:c}).subscribe(({isPlaying$:_,isInteractiveTime$:f,interactiveTimeIndicator:y})=>{if(!(!_||!y?.isDisplayed)){if(!f)return this.state$.set(!1);u.tooltipHelpHintActive&&ru===null&&(ru=!0,u.tooltipHelpHintActive=!1,this.state$.set(!0),n.callbacks?.onInteractiveTimeIndicatorHintDeactivated?.())}})),o}clearTimeout(){window.clearTimeout(this.timeout)}};var au=require("@vkontakte/videoplayer-shared/es2024");var Rd=class extends wo{constructor(){super(...arguments);this.stateName="graphIsOpened$";this.graphMadePause=!1;this.state$={...ae(null),toggle:au.noop};this.checkIfShouldHide=i=>ga(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(fp),!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(fp),!f&&this.graphMadePause&&n.actions.internal.pause()}catch{d({message:"Cant show graph"})}}},o.add((0,au.combine)({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}};var Hm=require("@vkontakte/videoplayer-shared/es2024"),Bd=class extends wo{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 Hm.ValueSubject(!1),isEnabled$:new Hm.ValueSubject(!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}};var lu=require("@vkontakte/videoplayer-shared/es2024");var su=require("@vkontakte/videoplayer-shared/es2024"),x1=({maxShowCount:t,timeout:e})=>{let i=[t!==0?S3({maxCount:t}):void 0,e!==0?C3({timeout:e}):void 0].filter(o=>!!o);return{notificationShowed:o=>i.forEach(n=>n.notificationShowed(o)),canShowNotification:o=>i.every(n=>n.canShowNotification(o))}},S3=({maxCount:t})=>{let e={};return{notificationShowed:i=>{e[i]=(e[i]??0)+1,su.safeStorage.set("videoplayer_notifications_manager_count",JSON.stringify(e[i]??0))},canShowNotification:i=>(e[i]??0)<t}},C3=({timeout:t})=>{let e="videoplayer_notifications_manager",i=()=>{try{return JSON.parse(su.safeStorage.get(e)||"{}")}catch{return{}}},o=a=>su.safeStorage.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 Nd=class extends wo{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=x1({maxShowCount:a,timeout:s});let c=n.getPlayer();return o.add(c.events.severeStallOccured$.pipe((0,lu.filterChanged)(),(0,lu.filter)(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 w1=()=>[Pd,Md,Ld,Vd,Rd,Bd,Nd].reduce(({subscribers:t,stores:e},i)=>{let o=new i;return{subscribers:[...t,o],stores:{...e,[o.stateName]:o.state$}}},{subscribers:[],stores:{}});var Xs=require("@vkontakte/videoplayer-shared/es2024");var T3={preload:!0,autoplay:!1,repeat:!1,fromTime:0,canRewindLive:!0,showAds:!1,interfaceLanguage:Ii.InterfaceLanguage.RU,isCyrillicRelatedInterface:!0,logoClickable:!1,logoHidden:!1,isTouch:(0,Dd.isMobile)(),isMediaSessionEnabled:!0,isPictureInPictureEnabled:!0,isAudioDisabled:!1,callbacks:{uiInfo:{}},tuningConfig:{configName:[]},saveRate:!0,volumeMultiplier:1,showEndScreen:!0,showAutoplayNext:!0,showNextPrevButtons:!0},un=Y(void 0),du=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(),Xs.devNull.create("ui"),this.logger=new Ii.Logger,this.log=this.logger.createComponentLog("VKVideoPlayer"),this.subscription=new Ii.Subscription,this.interactiveSubscription=new Ii.Subscription,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=Gr(Bm,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(),Xs.devNull.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}=Ad(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 cu.OneStat({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}=Ad(this.videoConfig,i),{unitedVideoId:s}=e;return new cu.ThinOneStat.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}=Ad(this.videoConfig,i),{sources:ce,title:R,thumbUrl:be,unitedVideoId:Ae,isClip:je=!1,duration:We,adsParams:Ie={},videoEpisodes:Le,previewThumbsData:De,subtitles:ct,live:_t}=e,ot={...S,...Ie},kt=this.getNextVideoInfo(),nt={sources:ce,title:R,thumbUrl:be,subtitles:ct,unitedVideoId:Ae,isClip:je,live:_t,albumId:n,statPlace:a,autoplay:l,muted:u,volume:c,fromTime:_,canRewindLive:f,showAds:x,adsSlotId:w,adsParams:ot,adsPreviewParam:I,adsAutoplayParam:L,duration:We,logoClickable:k,logoHidden:N,isTouch:G??Q,repeat:B,showNextPrevButtons:this.needToShowNextPrevButtons(),nextButtonActive:this.isNextButtonActive(),prevButtonActive:this.isPrevButtonActive(),endScreenVideoTitle:kt.nextVideoTitle,endScreenVideoThumb:kt.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist()},ut={pictureInPictureApi:this.pictureInPictureApi,annotationsApi:this.annotationsApi};this.log({message:`create player, props: ${JSON.stringify(nt)}`});let Mt=this.interactiveController?.state.statistics$.getValue(),Se,Ne=this.createThinOneStat(e,i);(Se||Ne)&&(this.statistics=new Fc(Se,Ne,Mt?.statSubscription)),this.uiConfig.features.sentry&&this.uiConfig.sentry.dsn&&new Fa(this.uiConfig.sentry,{version:Da,env:mc},{movieId:Ae,albumId:n,place:a,autoplay:(l&&!this.interactiveController)??!1,mobile:G??Q,clip:je}),this.interactiveController&&(this.prevIsid??=this.statistics?.oneStat?.isid$.getValue()),this.sentry={...this.sentry,...Fa.getInstance()};let W=!!Re,re=[],ie="tooltip_interactive_go_back_disabled_first";if(W&&this.interactiveController){let mt=this.interactiveController.state.isInitialChapter$.getValue(),Ee=this.interactiveController.getHistoryState();mt&&re.push("REPLAY_BUTTON"),this.interactiveController.getIsSeekable().getValue()||re.push("SEEK_TO_INTERACTIVE_BUTTON"),Ee.hasPrevChapter$.getValue()||(re.push("PLAY_PREV_CHAPTER_BUTTON"),mt||(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 mt=o?.info.isEnded$.getValue()&&this.interactiveController?.state.isEndChapter$.getValue();X.onReplayInteractiveVideo&&!mt?X.onReplayInteractiveVideo():this.replayInteractiveVideo()};this.store=Oh({player:o,interfaceLanguage:A,isCyrillicRelatedInterface:P,videoId:Ae,isClip:je,isLiveCatchUpMode:oe,isAudioDisabled:ee,statAuthToken:s,callbacks:X,webApi:ut,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:Ye}=this.microStoresRoot=w1(),Lt=()=>{if(!this.store||!this.microStoresRoot||!this.videoConfig)return;this.subscription.add(this.store.state.currentFormat$.subscribe(Ee=>X?.onCurrentFormatChanged?.(Ee))),this.subscription.add(Ye.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 Ii.Observable(Ee=>{this.store&&this.subscription.add(this.store.state.currentPlaybackRate$.subscribe(Ce=>Ee.next(Ce)))}).pipe(this.uiConfig.features.skipInitialPlaybackRateValue?(0,Ii.skip)(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(Vl)&&Ce.add(Vl),Ee||Ce.remove(Vl))})),this.subscription.add(this.store.ui.isFullscreen.subscribe(async Ee=>{if(!Dd.clientChecker.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(un,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:ct,live:_t,preload:d,autoplay:l,muted:u,volume:c,fromTime:_,canRewindLive:f,supportLink:y,showAds:x,adsSlotId:w,adsParams:ot,adsPreviewParam:I,adsAutoplayParam:L,duration:We,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:kt.nextVideoTitle,endScreenVideoThumb:kt.nextVideoThumb,isOneVideoPlaylist:this.isOneVideoPlaylist(),playPrevChapter:()=>this.playPrevChapter(),seekToInteractive:()=>this.seekToInteractive(),volumeMultiplier:_e,showEndScreen:ke,showAutoplayNext:Oe}));let mt={target:this.playerContainer,props:r(un)};this.svelteRootComponent=Gr(Lm,mt),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?Xs.devNull.subscribe("ui",this.videoConfig.callbacks.onDevNullLog):Xs.devNull.destroy("ui")};this.coreConfig.asyncResolveClientChecker?Dd.clientChecker.isInited$.subscribe(mt=>{mt&&(console.log("UI SDK async start"),Lt())}):Lt()}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&&(0,Ii.isNonNullable)(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/es2024");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(Rl)),_==="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(Rl)})),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=Ad(T3,(0,Ii.cloneDeepWith)(e,o=>o instanceof HTMLElement?o:void 0)),this.uiConfig=bg(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 Ii.InternalsExposure("UI")),Xs.devNull.push("ui",{key:"videoplayer_embed",strings:["new","player_init_player","ads.enable: "+this.uiConfig.ads.enable,"showAds: "+this.videoConfig?.showAds],numbers:[(0,S1.now)()]}),(0,Ii.isNonNullable)(this.videoConfig.isMediaSessionEnabled)&&(this.uiConfig.features.mediaSession=this.uiConfig.features.mediaSession??this.videoConfig.isMediaSessionEnabled??!0),(0,Ii.isNonNullable)(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=ou.getLatestSupportedVersion(o):this.pictureInPictureApi=new Ua(o)}this.mediaSessionApi=this.uiConfig.features.mediaSession?new tu:void 0,this.slotsApi=this.uiConfig.features.slots?new Zc:void 0,this.annotationsApi=this.uiConfig.features.annotations?new nu(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]),h1(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(un)&&(r(un).showNextPrevButtons=this.needToShowNextPrevButtons(),r(un).nextButtonActive=this.isNextButtonActive(),r(un).prevButtonActive=this.isPrevButtonActive(),r(un).endScreenVideoTitle=o.nextVideoTitle,r(un).endScreenVideoThumb=o.nextVideoThumb,r(un).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(un)&&(r(un).needToRepeatPlaylist=this.needToRepeatPlaylist,r(un).showNextPrevButtons=this.needToShowNextPrevButtons(),r(un).nextButtonActive=this.isNextButtonActive(),r(un).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((0,Ii.once)()).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&&Va(e)}};var Js=require("@vkontakte/videoplayer-shared/es2024"),uu=require("@vkontakte/videoplayer-core/es2024"),k3=()=>{window.customElements.define("vk-video-player",du)};