@deep-eye/core 0.9.0 → 1.0.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/CHANGELOG.md +100 -0
- package/README.md +140 -86
- package/dist/components/chat/ChatBot.vue.d.ts +48 -17
- package/dist/components/chat/ChatBot.vue.d.ts.map +1 -1
- package/dist/components/chat/attachmentController.d.ts +25 -0
- package/dist/components/chat/attachmentController.d.ts.map +1 -0
- package/dist/components/chat/attachments.d.ts +12 -0
- package/dist/components/chat/attachments.d.ts.map +1 -0
- package/dist/components/chat/chatContext.d.ts +14 -0
- package/dist/components/chat/chatContext.d.ts.map +1 -0
- package/dist/components/chat/chatErrors.d.ts +16 -0
- package/dist/components/chat/chatErrors.d.ts.map +1 -0
- package/dist/components/chat/chatQueue.d.ts +6 -0
- package/dist/components/chat/chatQueue.d.ts.map +1 -0
- package/dist/components/chat/components/ArtifactPreview.vue.d.ts +15 -0
- package/dist/components/chat/components/ArtifactPreview.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatActionbar.vue.d.ts +3 -3
- package/dist/components/chat/components/ChatActionbar.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatAttachments.vue.d.ts +12 -0
- package/dist/components/chat/components/ChatAttachments.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatFilePreview.vue.d.ts +45 -0
- package/dist/components/chat/components/ChatFilePreview.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatFilePreviewPanel.vue.d.ts +24 -0
- package/dist/components/chat/components/ChatFilePreviewPanel.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatImageLightbox.vue.d.ts +16 -0
- package/dist/components/chat/components/ChatImageLightbox.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatMediaPreview.vue.d.ts +9 -0
- package/dist/components/chat/components/ChatMediaPreview.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatMessage.vue.d.ts +43 -2
- package/dist/components/chat/components/ChatMessage.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatOfficePreview.vue.d.ts +9 -0
- package/dist/components/chat/components/ChatOfficePreview.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatProvider.vue.d.ts +73 -0
- package/dist/components/chat/components/ChatProvider.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatQueue.vue.d.ts +16 -0
- package/dist/components/chat/components/ChatQueue.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatReasoning.vue.d.ts +21 -0
- package/dist/components/chat/components/ChatReasoning.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatSender.vue.d.ts +34 -17
- package/dist/components/chat/components/ChatSender.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ChatSidebarResizeHandle.vue.d.ts +13 -0
- package/dist/components/chat/components/ChatSidebarResizeHandle.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ChatToolGroup.vue.d.ts +28 -0
- package/dist/components/chat/components/ChatToolGroup.vue.d.ts.map +1 -0
- package/dist/components/chat/components/ConversationList.vue.d.ts +129 -0
- package/dist/components/chat/components/ConversationList.vue.d.ts.map +1 -0
- package/dist/components/chat/components/InputContentParts.vue.d.ts +8 -0
- package/dist/components/chat/components/InputContentParts.vue.d.ts.map +1 -0
- package/dist/components/chat/components/MessageBubble.vue.d.ts +43 -2
- package/dist/components/chat/components/MessageBubble.vue.d.ts.map +1 -1
- package/dist/components/chat/components/TextPartRenderer.vue.d.ts.map +1 -1
- package/dist/components/chat/components/ToolCallPart.vue.d.ts +12 -3
- package/dist/components/chat/components/ToolCallPart.vue.d.ts.map +1 -1
- package/dist/components/chat/components/index.d.ts +9 -0
- package/dist/components/chat/components/index.d.ts.map +1 -1
- package/dist/components/chat/composables/index.d.ts +0 -1
- package/dist/components/chat/composables/index.d.ts.map +1 -1
- package/dist/components/chat/composables/useChatVoice.d.ts +45 -0
- package/dist/components/chat/composables/useChatVoice.d.ts.map +1 -0
- package/dist/components/chat/composables/useConversation.d.ts +1 -5
- package/dist/components/chat/composables/useConversation.d.ts.map +1 -1
- package/dist/components/chat/composables/useMeasuredHeight.d.ts +11 -0
- package/dist/components/chat/composables/useMeasuredHeight.d.ts.map +1 -0
- package/dist/components/chat/composables/useStreamSmoothing.d.ts +13 -0
- package/dist/components/chat/composables/useStreamSmoothing.d.ts.map +1 -0
- package/dist/components/chat/index.d.ts +12 -4
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/mdoc/ContentNodes.vue.d.ts.map +1 -1
- package/dist/components/chat/mdoc/MediaImageStack.vue.d.ts.map +1 -1
- package/dist/components/chat/previewRenderers.d.ts +6 -0
- package/dist/components/chat/previewRenderers.d.ts.map +1 -0
- package/dist/components/chat/qiniuUpload.d.ts +10 -0
- package/dist/components/chat/qiniuUpload.d.ts.map +1 -0
- package/dist/components/chat/responseStream.d.ts +17 -0
- package/dist/components/chat/responseStream.d.ts.map +1 -0
- package/dist/components/chat/toolLabels.d.ts +4 -0
- package/dist/components/chat/toolLabels.d.ts.map +1 -0
- package/dist/components/chat/toolStatus.d.ts +16 -0
- package/dist/components/chat/toolStatus.d.ts.map +1 -0
- package/dist/components/chat/types.d.ts +457 -144
- package/dist/components/chat/types.d.ts.map +1 -1
- package/dist/components/visualization/types.d.ts +8 -7
- package/dist/components/visualization/types.d.ts.map +1 -1
- package/dist/components/visualization/utils.d.ts +4 -2
- package/dist/components/visualization/utils.d.ts.map +1 -1
- package/dist/composables/useMindMapTheme.d.ts +4 -7
- package/dist/composables/useMindMapTheme.d.ts.map +1 -1
- package/dist/errors-CHzikrqu.js +70 -0
- package/dist/errors-upLl4kf2.cjs +1 -0
- package/dist/index-B4hgICk-.cjs +198 -0
- package/dist/index-BJdNN1GV.cjs +33 -0
- package/dist/index-Bj9h-xEr.cjs +112 -0
- package/dist/index-BufnUXnQ.js +5071 -0
- package/dist/index-CnxZBHPD.js +42825 -0
- package/dist/index-DF8KmkKX.js +38392 -0
- package/dist/index-DPhuLMkO.cjs +1 -0
- package/dist/index-Dq4cniDm.cjs +5 -0
- package/dist/index-cW_BnxHR.js +1722 -0
- package/dist/index-iCVvFIlX.js +28 -0
- package/dist/index.cjs +275 -49
- package/dist/index.js +18895 -8273
- package/dist/media-community-skin-Djo8L1G9.js +302 -0
- package/dist/media-community-skin-YI6NjsJg.cjs +1 -0
- package/dist/media-core-CkW37AYl.js +3827 -0
- package/dist/media-core-Rxz2MNwG.cjs +1 -0
- package/dist/media-outlet-CZTh6XmJ.cjs +1 -0
- package/dist/media-outlet-D2rcuhYN.js +2 -0
- package/dist/media-player-BZrIM0O_.js +387 -0
- package/dist/media-player-D_USOhtK.cjs +1 -0
- package/dist/media-ui-DfPbRfFS.js +2832 -0
- package/dist/media-ui-zZVnK1ts.cjs +1 -0
- package/dist/prod-Ba2x-T01.cjs +4 -0
- package/dist/prod-DBMM0zDd.js +992 -0
- package/dist/provider-B7wAEcCR.js +163 -0
- package/dist/provider-BPphQwpc.cjs +1 -0
- package/dist/provider-BSeBwvzM.cjs +1 -0
- package/dist/provider-DgSZc2dM.js +162 -0
- package/dist/provider-EKFFiZS1.js +27 -0
- package/dist/provider-O8r0RFmF.cjs +1 -0
- package/dist/provider-WrRdjcjY.js +483 -0
- package/dist/provider-sqICX3H9.cjs +1 -0
- package/dist/srt-parser-BECMkbXb.cjs +2 -0
- package/dist/srt-parser-BR28Llpk.js +27 -0
- package/dist/ssa-parser-BJTK0kd-.js +209 -0
- package/dist/ssa-parser-CuKkTpK_.cjs +4 -0
- package/dist/style.css +1 -1
- package/package.json +8 -2
- package/dist/components/chat/AiConversation.vue.d.ts +0 -28
- package/dist/components/chat/AiConversation.vue.d.ts.map +0 -1
- package/dist/components/chat/components/AssistantTrace.vue.d.ts +0 -27
- package/dist/components/chat/components/AssistantTrace.vue.d.ts.map +0 -1
- package/dist/components/chat/composables/useConversationStream.d.ts +0 -3
- package/dist/components/chat/composables/useConversationStream.d.ts.map +0 -1
- package/dist/components/chat/presentation.d.ts +0 -27
- package/dist/components/chat/presentation.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var Fi=Object.defineProperty;var Hi=(e,i,t)=>i in e?Fi(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var l=(e,i,t)=>Hi(e,typeof i!="symbol"?i+"":i,t);const I=Symbol(0);let wt=!1,Ht=!1,C=null,U=null,k=null,T=0,H=[],Wt={};const Vi=()=>{},G=0,je=1,at=2,It=3;function Ui(){wt=!0,queueMicrotask(Le)}function Le(){if(!H.length){wt=!1;return}Ht=!0;for(let e=0;e<H.length;e++)H[e].$st!==G&&Bi(H[e]);H=[],wt=!1,Ht=!1}function Bi(e){let i=[e];for(;e=e[I];)e.$e&&e.$st!==G&&i.push(e);for(let t=i.length-1;t>=0;t--)Jt(i[t])}function De(e){const i=Zi();return ht(i,e.length?e.bind(null,Z.bind(i)):e,null)}function u(e){return ht(C,e,null)}function zi(e){return ht(null,e,null)}function R(){Ht||Le()}function ct(){return C}function w(e,i){try{return ht(i,e,null)}catch(t){Zt(i,t);return}}function Re(e,i=C){return i==null?void 0:i.$cx[e]}function Ki(e,i,t=C){t&&(t.$cx={...t.$cx,[e]:i})}function j(e){if(!e||!C)return e||Vi;const i=C;return i.$d?Array.isArray(i.$d)?i.$d.push(e):i.$d=[i.$d,e]:i.$d=e,function(){i.$st!==It&&(e.call(null),q(i.$d)?i.$d=null:Array.isArray(i.$d)&&i.$d.splice(i.$d.indexOf(e),1))}}function Z(e=!0){if(this.$st!==It){if(this.$h)if(Array.isArray(this.$h))for(let i=this.$h.length-1;i>=0;i--)Z.call(this.$h[i]);else Z.call(this.$h);if(e){const i=this[I];i&&(Array.isArray(i.$h)?i.$h.splice(i.$h.indexOf(this),1):i.$h=null),Wi(this)}}}function Wi(e){e.$st=It,e.$d&&Fe(e),e.$s&&bt(e,0),e[I]=null,e.$s=null,e.$o=null,e.$h=null,e.$cx=Wt,e.$eh=null}function Fe(e){try{if(Array.isArray(e.$d))for(let i=e.$d.length-1;i>=0;i--){const t=e.$d[i];t.call(t)}else e.$d.call(e.$d);e.$d=null}catch(i){Zt(e,i)}}function ht(e,i,t){const s=C,n=U;C=e,U=t;try{return i.call(e)}finally{C=s,U=n}}function Zt(e,i){if(!e||!e.$eh)throw i;let t=0,s=e.$eh.length,n=me(i);for(t=0;t<s;t++)try{e.$eh[t](n);break}catch(r){n=me(r)}if(t===s)throw n}function me(e){return e instanceof Error?e:Error(JSON.stringify(e))}function Xt(){return this.$st===It?this.$v:(U&&!this.$e&&(!k&&U.$s&&U.$s[T]==this?T++:k?k.push(this):k=[this]),this.$c&&Jt(this),this.$v)}function He(e){const i=q(e)?e(this.$v):e;if(this.$ch(this.$v,i)&&(this.$v=i,this.$o))for(let t=0;t<this.$o.length;t++)Be(this.$o[t],at);return this.$v}const Yt=function(){this[I]=null,this.$h=null,C&&C.append(this)},F=Yt.prototype;F.$cx=Wt;F.$eh=null;F.$c=null;F.$d=null;F.append=function(e){e[I]=this,this.$h?Array.isArray(this.$h)?this.$h.push(e):this.$h=[this.$h,e]:this.$h=e,e.$cx=e.$cx===Wt?this.$cx:{...this.$cx,...e.$cx},this.$eh&&(e.$eh=e.$eh?[...e.$eh,...this.$eh]:this.$eh)};F.dispose=function(){Z.call(this)};function Zi(){return new Yt}const Ve=function(i,t,s){Yt.call(this),this.$st=t?at:G,this.$i=!1,this.$e=!1,this.$s=null,this.$o=null,this.$v=i,t&&(this.$c=t),s&&s.dirty&&(this.$ch=s.dirty)},Gt=Ve.prototype;Object.setPrototypeOf(Gt,F);Gt.$ch=Xi;Gt.call=Xt;function Qt(e,i,t){return new Ve(e,i,t)}function Xi(e,i){return e!==i}function q(e){return typeof e=="function"}function Jt(e){if(e.$st===je)for(let i=0;i<e.$s.length&&(Jt(e.$s[i]),e.$st!==at);i++);e.$st===at?Ue(e):e.$st=G}function ye(e){e.$h&&Z.call(e,!1),e.$d&&Fe(e),e.$eh=e[I]?e[I].$eh:null}function Ue(e){let i=k,t=T;k=null,T=0;try{ye(e);const s=ht(e,e.$c,e);if(k){if(e.$s&&bt(e,T),e.$s&&T>0){e.$s.length=T+k.length;for(let r=0;r<k.length;r++)e.$s[T+r]=k[r]}else e.$s=k;let n;for(let r=T;r<e.$s.length;r++)n=e.$s[r],n.$o?n.$o.push(e):n.$o=[e]}else e.$s&&T<e.$s.length&&(bt(e,T),e.$s.length=T);!e.$e&&e.$i?He.call(e,s):(e.$v=s,e.$i=!0)}catch(s){Zt(e,s),e.$st===at&&(ye(e),e.$s&&bt(e,0));return}k=i,T=t,e.$st=G}function Be(e,i){if(!(e.$st>=i)&&(e.$e&&e.$st===G&&(H.push(e),wt||Ui()),e.$st=i,e.$o))for(let t=0;t<e.$o.length;t++)Be(e.$o[t],je)}function bt(e,i){let t,s;for(let n=i;n<e.$s.length;n++)t=e.$s[n],t.$o&&(s=t.$o.indexOf(e),t.$o[s]=t.$o[t.$o.length-1],t.$o.pop())}function O(e,i){const t=Qt(e,null,i),s=Xt.bind(t);return s[I]=!0,s.set=He.bind(t),s}function Yi(e){return q(e)&&I in e}function ut(e,i){const t=Qt(i==null?void 0:i.initial,e,i),s=Xt.bind(t);return s[I]=!0,s}function et(e,i){const t=Qt(null,function(){let n=e();return q(n)&&j(n),null},void 0);return t.$e=!0,Ue(t),Z.bind(t,!0)}function Gi(e){return Yi(e)&&"set"in e}function Ot(...e){}function ft(e){return e===null}function v(e){return typeof e>"u"}function ze(e){return ft(e)||v(e)}function ot(e){return typeof e=="number"&&!Number.isNaN(e)}function P(e){return typeof e=="string"}function Ke(e){return typeof e=="boolean"}function g(e){return typeof e=="function"}function x(e){return Array.isArray(e)}function We(e){return{id:Symbol(),provide:e}}function Ze(e,i,t=ct()){var n;const s=!v(i);Ki(e.id,s?i:(n=e.provide)==null?void 0:n.call(e),t)}function te(e){return Re(e.id)}function Qi(e){return!v(Re(e.id))}var Xe=class{constructor(e){this.id=Symbol(0),this.record=e,this.v=Object.getOwnPropertyDescriptors(e)}create(){const e={},i=new Proxy(e,{get:(t,s)=>e[s]()});for(const t of Object.keys(this.record)){const s=this.v[t].get;e[t]=s?ut(s.bind(i)):O(this.record[t])}return e}reset(e,i){for(const t of Object.keys(e))!this.v[t].get&&(!i||i(t))&&e[t].set(this.record[t])}};function Ji(e){return te(e)}var d=et;function Ye(e){let i=e;for(;typeof i=="function";)i=i();return i}var ts=Event,Ge=Symbol("DOM_EVENT"),Qe,y=class extends ts{constructor(e,...i){var t,s;super(e,i[0]),this[Qe]=!0,this.detail=(t=i[0])==null?void 0:t.detail,this.trigger=(s=i[0])==null?void 0:s.trigger}get originEvent(){return St(this)??this}get isOriginTrusted(){var e;return((e=St(this))==null?void 0:e.isTrusted)??!1}};Qe=Ge;function Je(e){return!!(e!=null&&e[Ge])}function St(e){let i=e.trigger;for(;i&&i.trigger;)i=i.trigger;return i}function m(e,i){const t=St(e)??e;if(t===i)throw Error("");Object.defineProperty(t,"trigger",{configurable:!0,enumerable:!0,get:()=>i})}var ee=class extends EventTarget{addEventListener(e,i,t){return super.addEventListener(e,i,t)}removeEventListener(e,i,t){return super.removeEventListener(e,i,t)}};function f(e,i,t,s){return e.addEventListener(i,t,s),j(()=>e.removeEventListener(i,t,s))}function ti(e){return!!(e!=null&&e.type.startsWith("pointer"))}function ei(e){return!!(e!=null&&e.type.startsWith("touch"))}function ii(e){return/^(click|mouse)/.test((e==null?void 0:e.type)??"")}function Nt(e){return!!(e!=null&&e.type.startsWith("key"))}function ie(e){return Nt(e)&&(e.key==="Enter"||e.key===" ")}function qt(e){return e instanceof Node}function se(e){return qt(e)&&e.nodeType===1}function si(){return document.createDocumentFragment()}function ne(e){return document.createComment(e)}function X(e,i,t){if(!t&&t!==""&&t!==0)e.removeAttribute(i);else{const s=t+"";e.getAttribute(i)!==s&&e.setAttribute(i,s)}}function Y(e,i,t){!t&&t!==0?e.style.removeProperty(i):e.style.setProperty(i,t+"")}function ni(e,i){for(const t of e)t(i)}function re(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ri(e){return e.replace(/-./g,i=>i[1].toUpperCase())}function ai(e){return e.charAt(0).toUpperCase()+e.slice(1)}function ae(e){const i=[];for(let t=0;t<e.length;t++)x(e[t])?i.push(...ae(e[t])):(e[t]||e[t]===0)&&i.push(e[t]);return i}var _=class{get el(){return this.instance.m}get $props(){return this.instance.e}get $store(){return this.instance.k}constructor(e){this.instance=e,this.onAttach&&e.d.push(this.onAttach.bind(this)),this.onConnect&&e.p.push(this.onConnect.bind(this)),this.onDisconnect&&e.i.push(this.onDisconnect.bind(this)),this.onDestroy&&e.x.push(this.onDestroy.bind(this))}setAttributes(e){this.instance.f&&Object.assign(this.instance.f,e)}setStyles(e){this.instance.q&&Object.assign(this.instance.q,e)}setCSSVars(e){this.setStyles(e)}createEvent(e,...i){return new y(e,i[0])}dispatch(e,...i){if(!this.el)return;const t=new y(e,i[0]);this.el.dispatchEvent(t)}listen(e,i,t){return this.el?f(this.el,e,i,t):Ot}},oi=class extends _{constructor(e){super(e),this.render&&!e.F&&!e.h&&(e.h=this.render.bind(this))}destroy(){this.instance.y()}},li=e=>document.createTreeWalker(e,NodeFilter.SHOW_COMMENT,i=>i.nodeValue==="$"),A=null;function es(e,i){const t=A;A={w:li(i.target)};const s=e();return A=t,s}var Vt=Symbol(0),is=ne("$$"),Ut=Symbol(0),ss=ne("/$"),ns="/[]";function oe(e,i,t){let s=g(i);s&&i[ys]&&(i=i(),s=g(i)),s?hi(e,i,t):!A&&(i||i===0)&&ci(e,x(i)?ui(i):qt(i)?i:document.createTextNode(i+""),t)}function ci(e,i,t){i&&(t?e.insertBefore(i,t):e.appendChild(i))}function hi(e,i,t){const s=t&&t.nodeType===8?t:is.cloneNode();s!==t&&ci(e,s,t),d(()=>void rs(s,Ye(i)))}function rs(e,i){const t=e[Ut];if(x(i))if(A)e[Ut]=as(e);else{t&&pt(e,t);const s=ui(i);if(!s)return;t||s.appendChild(Lt(e)),e.after(s)}else if(qt(i))t&&pt(e,t),A||e.after(i),t||i.after(Lt(e));else if(P(i)||ot(i)){if(e[Vt]){e.nextSibling.data=i+"";return}t&&pt(e,t);let s;A?s=e.nextSibling:(s=document.createTextNode(i+""),e.after(s)),e[Vt]=!0,t||s.after(Lt(e))}else t&&pt(e,t)}function Lt(e){return e[Ut]=ss.cloneNode()}function as(e){for(;e;){if(e.nodeType===8&&e.nodeValue===ns)return e;e=e.nextSibling}}function pt(e,i){for(;e.nextSibling!==i;)e.nextSibling.remove();e[Vt]=!1}function ui(e){const i=ae(e);if(!i.length)return null;const t=si();for(let s=0;s<i.length;s++){const n=i[s];g(n)?hi(t,n):t.append(n)}return t}function os(e){fi(e,{insert:oe})}var Et=Symbol(0);function fi(e,i){const t=e.el.tagName;window.customElements.get(t)||(window[Et]||(window[Et]=new Map),window[Et].set(t,e),window.customElements.define(t,As(e,i)))}function le(e){const i=document.createElement("template");return i.innerHTML=e,i.content}function dt(e,i=A==null?void 0:A.w){try{return[di(i),i]}catch{return dt(e,li(document.importNode(e,!0)))}}function ls(e){return dt(e)[0]}function di(e){let i=e.nextNode().nextSibling;if(i.localName.indexOf("-")>0&&i.firstChild&&i.firstChild.nodeName==="SHADOW-ROOT"){let t=i.firstChild.nextSibling||i.nextSibling;t&&(e.currentNode=t)}return i}var cs=A;function hs(e,i){var n;const t=(n=window[Et])==null?void 0:n.get(e.localName);if(!t)throw Error(e.localName);const s=pi(t,{props:i});return e.attachComponent(s),s.instance.c}function us(e){return document.importNode(e,!0).firstElementChild}function fs(e){return document.createElement(e)}var ds=oe;function ps(e,i){oe(e.parentElement,i,e)}function ms(e,i={}){return u(()=>e(i))}var ys=Symbol(0);function ce(e,i){x(i)?i.filter(g).forEach(t=>t(e)):g(i)&&i(e)}var B=X;function gs(e,i,t,s=!1){g(t)&&f(e,i,t,{capture:s})}var bs=u,Es=w,z=d,Ts=ut,K=Symbol(0),it=Symbol(0),st=Symbol(0);function pi(e,i){const t=new $s(e,i);return w(()=>new e(t),t.c)}var $s=class{constructor(e,i={}){this.m=null,this.h=null,this.F=!1,this.j=!1,this.f={},this.q={},this.e={},this.z=null,this.k=null,this.d=[],this.p=[],this.i=[],this.x=[],De(t=>{var r;this.c=ct(),this.G=t,i.scope&&i.scope.append(this.c);const s=e.el.store;s&&(this.k=s.create(),this.z=new Proxy(this.k,{get:(a,o)=>this.k[o]()}),Ze(s,this.k));const n=e.el.props;if(n&&(this.e=ks(n),i.props)){for(const a of Object.keys(i.props))if(a in n){const o=i.props[a];q(o)?et(()=>void this.e[a].set(o())):this.e[a].set(o)}}(r=i.props)!=null&&r.innerHTML&&(this.F=!0),j(this.y.bind(this))})}y(){var e;if(!this.j){this.j=!0;for(const i of this.x)w(()=>i(this.m),this.c);(e=this.m)==null||e.destroy(),this.d.length=0,this.p.length=0,this.i.length=0,this.x.length=0,R(),this.G(),this.m=null,this.h=null}}};function ks(e){const i={};for(const t of Object.keys(e)){const s=e[t];i[t]=O(s.value,s)}return i}async function ws(e){var n;const i=vs(e),t=e.constructor,s=t.a;i&&(await customElements.whenDefined(i.localName),i[K]===!0||await new Promise(r=>i[K].push(r))),e.isConnected&&(i!=null&&i.keepAlive&&(e.keepAlive=!0),e.attachComponent(pi(s,{scope:(n=i==null?void 0:i.component)==null?void 0:n.instance.c})))}function Ss(e){var n;const i=e.constructor,t=i.a,s={};if(!i.f)return s;for(const r of e.attributes){let a=i.f.get(r.name),o=a&&((n=t.el.props[a].type)==null?void 0:n.from);if(o){let h=e.getAttribute(r.name);s[a]=o(h)}}return s}function vs(e){let i=e.constructor,t=i.a,s=e.parentNode,n=t.el.tagName.split("-",1)[0]+"-";for(;s;){if(s.nodeType===1&&s.localName.startsWith(n))return s;s=s.parentNode}return null}function As(e,i){const t=e.register;if(e.register){const o=x(t)?t:t==null?void 0:t();if(x(o))for(const h of o)fi(h,i)}let s;if(e.el.props){s=new Map;for(const o of Object.keys(e.el.props)){const c=e.el.props[o].attribute;if(c!==!1){const p=c??re(o);s.set(p,o)}}}class n extends Cs{static get a(){return e}}n.H=i,n.f=s;const r=n.prototype,a=e.prototype;if(e.el.props)for(const o of Object.keys(e.el.props))Object.defineProperty(r,o,{enumerable:!0,configurable:!0,get(){return this.component?this.component.instance.e[o]():e.el.props[o].value},set(h){const c=()=>this.component.instance.e[o].set(h);if(!this.component){this.l.delete(o),this.l.set(o,c);return}c()}});if(a[it])for(const o of a[it])Object.defineProperty(r,o,{enumerable:!0,configurable:!0,get(){return this.component?this.component[o]:void 0},set(h){if(!this.component){this.l.delete(o),this.l.set(o,()=>{this.component[o]=h});return}this.component[o]=h}});if(a[st])for(const o of a[st])r[o]=function(...h){return this.component[o](...h)};return n}var _s=HTMLElement,mi,Cs=class extends _s{constructor(){super(...arguments),this.r=!1,this.j=!1,this.a=null,this.s=null,this.d=new Set,this.i=[],this.l=new Map,this.keepAlive=!1,this[mi]=[],this.B=!1}get A(){return this.hasAttribute("mk-d")}get component(){return this.a}get $store(){var e;return(e=this.a)==null?void 0:e.instance.k}get state(){return this.a.instance.z}static get observedAttributes(){return this.f?Array.from(this.f.keys()):[]}attributeChangedCallback(e,i,t){var a,o;const s=this.constructor;if(!this.a||!s.f)return;const n=s.f.get(e),r=(o=(a=s.a.el.props[n])==null?void 0:a.type)==null?void 0:o.from;r&&this.a.instance.e[n].set(r(t))}connectedCallback(){var i;const e=(i=this.a)==null?void 0:i.instance;if(!this.A&&!e)return this.N();!e||!this.isConnected||this.r||this.j||(this.hasAttribute("keep-alive")&&(this.keepAlive=!0),this.r=!0,e.p.length&&w(()=>{De(t=>{this.s=ct();for(const s of e.p)w(()=>{const n=s(this);q(n)&&this.i.push(n)},this.s);this.i.push(t)})},e.c),x(this[K])&&(ni(this[K],this),this[K]=!0))}disconnectedCallback(){var i;const e=(i=this.a)==null?void 0:i.instance;if(!(!this.r||this.j)){this.r=!1;for(const t of this.i)w(t,this.s);if(e!=null&&e.i.length)for(const t of e.i)w(()=>t(this),e.c);this.s=null,!this.A&&!this.keepAlive&&requestAnimationFrame(()=>{this.isConnected||(e==null||e.y(),this.j=!0)})}}attachComponent(e){const i=e.instance,t=this.constructor,s=t.a.el,n=t.H;this.a||this.j||w(()=>{var h;this.o=i.h?s.shadowRoot?this.shadowRoot??this.attachShadow(Ke(s.shadowRoot)?{mode:"open"}:s.shadowRoot):Ps(this):null,!A&&s.shadowRoot&&s.css&&(n!=null&&n.adoptCSS)&&n.adoptCSS(this.o,s.css),i.m=this,this.a=e;const r=Ss(this);for(const c of Object.keys(r))i.e[c].set(r[c]);if((h=this.l)!=null&&h.size)for(const c of this.l.values())c();this.l=null;for(const c of[...i.d,...this.d])w(()=>c(this),i.c);i.d.length=0,this.d=null;const a=i.f,o=i.q;if(a)for(const c of Object.keys(a))q(a[c])?et(()=>X(this,c,a[c]())):X(this,c,a[c]);if(o)for(const c of Object.keys(o))q(o[c])?et(()=>Y(this,c,o[c]())):Y(this,c,o[c]);if(this.dispatchEvent(new Event("attached")),this.o&&n&&i.h){const c=()=>n.insert(this.o,i.h);this.hasAttribute("mk-h")&&!t.a.el.nohydrate?es(c,{target:this.o}):c()}this.connectedCallback()},i.c)}subscribe(e){return w(()=>et(()=>e(this.a.instance.z)),this.a.instance.c)}onAttach(e){return this.a?(e(this),Ot):(this.d.add(e),()=>{var i;return(i=this.d)==null?void 0:i.delete(e)})}onEventDispatch(e){const i=this.constructor;if(i.n)for(const t of i.n)e(t);this.I=e}destroy(){var e;this.disconnectedCallback(),(e=this.a)==null||e.destroy(),this.a=null,this.j=!0}dispatchEvent(e){var i;if(this.A){const t=this.constructor;t.n||(t.n=new Set),t.n.has(e.type)||((i=this.I)==null||i.call(this,e.type),t.n.add(e.type))}return zi(()=>super.dispatchEvent(e))}async N(){this.B||(this.B=!0,await ws(this),this.B=!1)}P(e){}};mi=K;function Ps(e){if(e.firstChild&&se(e.firstChild)&&e.firstChild.localName==="shadow-root")return e.firstChild;{const i=fs("shadow-root");return e.prepend(i),i}}var Bt=Symbol(0);function Tt(e){return{[Bt]:!0,...e}}function yi(e){var i;if("props"in e){const t=e.props;for(const s of Object.keys(t)){const n=(i=t[s])!=null&&i[Bt]?t[s]:{[Bt]:!0,value:t[s]};n.attribute!==!1&&!n.type&&(n.type=Ms(n.value)),t[s]=n}}return e}var mt={from:e=>e===null?"":e+""},xs={from:e=>e===null?0:Number(e)},Is={from:e=>e!==null,to:e=>e?"":null},Os={from:!1,to:()=>null},Ns={from:e=>e===null?[]:JSON.parse(e),to:e=>JSON.stringify(e)},qs={from:e=>e===null?{}:JSON.parse(e),to:e=>JSON.stringify(e)};function Ms(e){if(e===null)return mt;switch(typeof e){case"undefined":return mt;case"string":return mt;case"boolean":return Is;case"number":return xs;case"function":return Os;case"object":return x(e)?Ns:qs;default:return mt}}function js(e,i,t){e[it]||(e[it]=new Set),e[it].add(i)}function Ls(e,i,t){e[st]||(e[st]=new Set),e[st].add(i)}function gi(e){return e?"true":"false"}function he(){const e=new Set;return{add(...i){for(const t of i)e.add(t)},empty(){for(const i of e)i();e.clear()}}}function bi(){const e=he();return j(e.empty),e}function ue(){let e,i;return{promise:new Promise((s,n)=>{e=s,i=n}),resolve:e,reject:i}}function Ei(e){return new Promise(i=>setTimeout(i,e))}function fe(e){let i=-1,t;function s(...n){t=n,!(i>=0)&&(i=window.requestAnimationFrame(()=>{e.apply(this,t),i=-1,t=void 0}))}return s}var Ds="requestIdleCallback"in window?window.requestIdleCallback:e=>window.requestAnimationFrame(e);function Rs(e,i){return new Promise(t=>{Ds(s=>{e==null||e(s),t()},i)})}const Fs=Object.freeze(Object.defineProperty({__proto__:null,DOMEvent:y,EventsTarget:ee,animationFrameThrottle:fe,appendTriggerEvent:m,ariaBool:gi,camelToKebabCase:re,createComment:ne,createDisposalBin:he,createFragment:si,deferredPromise:ue,flattenArray:ae,getOriginEvent:St,isArray:x,isBoolean:Ke,isDOMElement:se,isDOMEvent:Je,isDOMNode:qt,isFunction:g,isKeyboardClick:ie,isKeyboardEvent:Nt,isMouseEvent:ii,isNil:ze,isNull:ft,isNumber:ot,isPointerEvent:ti,isString:P,isTouchEvent:ei,isUndefined:v,kebabToCamelCase:ri,listenEvent:f,noop:Ot,runAll:ni,setAttribute:X,setStyle:Y,unwrapDeep:Ye,uppercaseFirstChar:ai,useDisposalBin:bi,waitIdlePeriod:Rs,waitTimeout:Ei},Symbol.toStringTag,{value:"Module"}));function Hs(e){return e instanceof HTMLAudioElement}function Vs(e){return e instanceof HTMLVideoElement}function Us(e){return Hs(e)||Vs(e)}const Bs=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,zs=new Set(["audio/mpeg","audio/ogg","audio/3gp","audio/mp4","audio/webm","audio/flac"]),Ks=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,Ws=new Set(["video/mp4","video/webm","video/3gp","video/ogg","video/avi","video/mpeg"]),Ti=/\.(m3u8)($|\?)/i,$i=new Set(["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"]);function ki({src:e,type:i}){return typeof e=="string"&&Ti.test(e)||$i.has(i)}function Zs(e){return typeof window.MediaStream<"u"&&e instanceof window.MediaStream}const Xs=le('<!$><audio preload="none" aria-hidden="true"></audio>'),Ys=Xs;class Gs{constructor(){l(this,"kh")}canPlay({src:i,type:t}){return P(i)?Bs.test(i)||zs.has(t)||i.startsWith("blob:")&&t==="audio/object":t==="audio/object"}mediaType(){return"audio"}async load(){return new(await Promise.resolve().then(()=>require("./provider-BSeBwvzM.cjs"))).AudioProvider(this.kh)}render(i){return(()=>{const[t,s]=dt(Ys);return z(()=>B(t,"controls",i.controls())),z(()=>B(t,"crossorigin",i.crossorigin())),ce(t,n=>void(this.kh=n)),t})()}}const Qs=le('<!$><video preload="none" aria-hidden="true"></video>'),Js=Qs;class wi{constructor(){l(this,"qa")}canPlay(i){return P(i.src)?Ks.test(i.src)||Ws.has(i.type)||i.src.startsWith("blob:")&&i.type==="video/object"||ki(i)&&Pi():i.type==="video/object"}mediaType(){return"video"}async load(i){return new(await Promise.resolve().then(()=>require("./provider-O8r0RFmF.cjs"))).VideoProvider(this.qa,i)}render(i){const t=ut(()=>i.poster()&&i.controls()?i.poster():null);return(()=>{const[s,n]=dt(Js);return z(()=>B(s,"controls",i.controls())),z(()=>B(s,"crossorigin",i.crossorigin())),z(()=>B(s,"poster",t())),ce(s,r=>void(this.qa=r)),s})()}}const xt=class xt extends wi{preconnect(){de("https://cdn.jsdelivr.net","preconnect")}canPlay({src:i,type:t}){return xt.supported&&P(i)&&(Ti.test(i)||$i.has(t))}async load(i){return new(await Promise.resolve().then(()=>require("./provider-BPphQwpc.cjs"))).HLSProvider(this.qa,i)}};l(xt,"supported",xi());let zt=xt;const lt=Symbol(0),vt=Symbol(0),Kt=Symbol(0),$t=Symbol(0),yt=Symbol(0),ge=Symbol(0),Si=Symbol(0),vi=Symbol(0),Ai=Symbol(0);var Pe;class _i extends ee{constructor(){super(...arguments);l(this,"a",[]);l(this,Pe,!1)}get length(){return this.a.length}get readonly(){return this[yt]}toArray(){return[...this.a]}[(Pe=yt,Symbol.iterator)](){return this.a.values()}[lt](t,s){const n=this.a.length;""+n in this||Object.defineProperty(this,n,{get(){return this.a[n]}}),!this.a.includes(t)&&(this.a.push(t),this.dispatchEvent(new y("add",{detail:t,trigger:s})))}[vt](t,s){var r;const n=this.a.indexOf(t);n>=0&&((r=this[vi])==null||r.call(this,t,s),this.a.splice(n,1),this.dispatchEvent(new y("remove",{detail:t,trigger:s})))}[Kt](t){var s;for(const n of[...this.a])this[vt](n,t);this.a=[],this[ge](!1,t),(s=this[Si])==null||s.call(this)}[ge](t,s){this[yt]!==t&&(this[yt]=t,this.dispatchEvent(new y("readonly-change",{detail:t,trigger:s})))}}var E={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},be=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],Ee=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],Te=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],b=typeof window<"u"&&typeof window.document<"u"?window.document:{},$="fullscreenEnabled"in b&&Object.keys(E)||be[0]in b&&be||Ee[0]in b&&Ee||Te[0]in b&&Te||[],tn={requestFullscreen:function(e){return e[$[E.requestFullscreen]]()},requestFullscreenFunction:function(e){return e[$[E.requestFullscreen]]},get exitFullscreen(){return b[$[E.exitFullscreen]].bind(b)},get fullscreenPseudoClass(){return":"+$[E.fullscreen]},addEventListener:function(e,i,t){return b.addEventListener($[E[e]],i,t)},removeEventListener:function(e,i,t){return b.removeEventListener($[E[e]],i,t)},get fullscreenEnabled(){return!!b[$[E.fullscreenEnabled]]},set fullscreenEnabled(e){},get fullscreenElement(){return b[$[E.fullscreenElement]]},set fullscreenElement(e){},get onfullscreenchange(){return b[("on"+$[E.fullscreenchange]).toLowerCase()]},set onfullscreenchange(e){return b[("on"+$[E.fullscreenchange]).toLowerCase()]=e},get onfullscreenerror(){return b[("on"+$[E.fullscreenerror]).toLowerCase()]},set onfullscreenerror(e){return b[("on"+$[E.fullscreenerror]).toLowerCase()]=e}},D=tn;const At=D.fullscreenEnabled;class en extends _{constructor(){super(...arguments);l(this,"b",!1);l(this,"c",!1)}get active(){return this.c}get supported(){return At}onConnect(){f(D,"fullscreenchange",this.d.bind(this)),f(D,"fullscreenerror",this.e.bind(this))}async onDisconnect(){At&&await this.exit()}d(t){const s=Dt(this.el);s!==this.c&&(s||(this.b=!1),this.c=s,this.dispatch("fullscreen-change",{detail:s,trigger:t}))}e(t){this.b&&(this.dispatch("fullscreen-error",{detail:null,trigger:t}),this.b=!1)}async enter(){try{return this.b=!0,!this.el||Dt(this.el)?void 0:($e(),D.requestFullscreen(this.el))}catch(t){throw this.b=!1,t}}async exit(){if(!(!this.el||!Dt(this.el)))return $e(),D.exitFullscreen()}}function sn(){return At}function Dt(e){if(D.fullscreenElement===e)return!0;try{return e.matches(D.fullscreenPseudoClass)}catch{return!1}}function $e(){if(!At)throw Error("[vidstack] no fullscreen API")}const nn=navigator==null?void 0:navigator.userAgent.toLowerCase(),rn=/iphone|ipad|ipod|ios|crios|fxios/i.test(nn),an=/(iphone|ipod)/gi.test(navigator==null?void 0:navigator.platform),on=!!window.chrome,Ci=!!window.safari||rn;function ln(){return!v(screen.orientation)&&g(screen.orientation.lock)&&g(screen.orientation.unlock)}function Pi(e){return e||(e=document.createElement("video")),e.canPlayType("application/vnd.apple.mpegurl").length>0}function cn(e){return!!document.pictureInPictureEnabled&&!e.disablePictureInPicture}function hn(e){return g(e.webkitSupportsPresentationMode)&&g(e.webkitSetPresentationMode)}async function un(){const e=document.createElement("video");return e.volume=.5,await Ei(0),e.volume===.5}function fn(){return(window==null?void 0:window.MediaSource)??(window==null?void 0:window.WebKitMediaSource)}function dn(){return(window==null?void 0:window.SourceBuffer)??(window==null?void 0:window.WebKitSourceBuffer)}function xi(){const e=fn();if(v(e))return!1;const i=e&&g(e.isTypeSupported)&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),t=dn(),s=v(t)||!v(t.prototype)&&g(t.prototype.appendBuffer)&&g(t.prototype.remove);return!!i&&!!s}const nt=ln();class Ii extends _{constructor(){super(...arguments);l(this,"g",O(we()));l(this,"f",O(!1));l(this,"h")}get type(){return this.g()}get locked(){return this.f()}get portrait(){return this.g().startsWith("portrait")}get landscape(){return this.g().startsWith("landscape")}get supported(){return nt}onConnect(){if(nt)f(screen.orientation,"change",this.i.bind(this));else{const t=window.matchMedia("(orientation: landscape)");return t.onchange=this.i.bind(this),()=>t.onchange=null}}async onDisconnect(){nt&&this.f()&&await this.unlock()}i(t){this.g.set(we()),this.dispatch("orientation-change",{detail:{orientation:u(this.g),lock:this.h},trigger:t})}async lock(t){u(this.f)||this.h===t||(ke(),await screen.orientation.lock(t),this.f.set(!0),this.h=t)}async unlock(){u(this.f)&&(ke(),this.h=void 0,await screen.orientation.unlock(),this.f.set(!1))}}function ke(){if(!nt)throw Error("[vidstack] no orientation API")}function we(){return nt?window.screen.orientation.type:window.innerWidth>=window.innerHeight?"landscape-primary":"portrait-primary"}function pn(e,i,t){e.hasAttribute(i)||e.setAttribute(i,t)}function mn(e,i){if(e.hasAttribute("aria-label")||e.hasAttribute("aria-describedby"))return;function t(){X(e,"aria-label",i())}d(t)}function yn(e,i,t){for(;i;){if(i===e)return!0;if(i.localName===e.localName||t!=null&&t(i))break;i=i.parentElement}return!1}function gn(e,i){f(e,"pointerup",t=>{t.button===0&&i(t)}),f(e,"keydown",t=>{ie(t)&&i(t)})}function Oi(e){const i=ct();requestAnimationFrame(()=>w(e,i))}const Ni=We();function Mt(){return te(Ni)}const bn=["autoplay","autoplayError","canFullscreen","canPictureInPicture","canLoad","canPlay","canSeek","ended","error","fullscreen","loop","live","liveEdge","mediaType","muted","paused","pictureInPicture","playing","playsinline","seeking","started","streamType","userIdle","viewType","waiting"],En={togglePaused:"k Space",toggleMuted:"m",toggleFullscreen:"f",togglePictureInPicture:"i",toggleCaptions:"c",seekBackward:"ArrowLeft",seekForward:"ArrowRight",volumeUp:"ArrowUp",volumeDown:"ArrowDown"},Se=new Set(["Shift","Alt","Meta","Control"]),Tn='button, [role="button"]',ve='input, textarea, select, [contenteditable], [role^="menuitem"]';class $n extends _{constructor(t,s){super(t);l(this,"Ua");l(this,"Ta",null);this.j=s}onConnect(){d(this.Xa.bind(this))}Xa(){const{keyDisabled:t,keyTarget:s}=this.$props;if(t())return;const n=s()==="player"?this.el:document,r=O(!1);n===this.el?(this.listen("focusin",()=>r.set(!0)),this.listen("focusout",a=>{this.el.contains(a.target)||r.set(!1)})):(u(r)||r.set(document.querySelector("media-player")===this.el),f(document,"focusin",a=>{const o=a.composedPath().find(h=>h instanceof Element&&h.localName==="media-player");o!==void 0&&r.set(this.el===o)})),d(()=>{r()&&(f(n,"keyup",this.Ya.bind(this)),f(n,"keydown",this.Za.bind(this)),f(n,"keydown",this._a.bind(this),{capture:!0}))})}Ya(t){const s=document.activeElement,n=s==null?void 0:s.hasAttribute("data-media-slider");if(!t.key||!this.$store.canSeek()||n||s!=null&&s.matches(ve))return;const r=this.Va(t);if(r!=null&&r.startsWith("seek")&&(t.preventDefault(),t.stopPropagation(),this.Ta?(this.Wa(t),this.Ta=null):(this.j.remote.seek(this.Ua,t),this.Ua=void 0)),r!=null&&r.startsWith("volume")){const a=this.el.querySelector("media-volume-slider");a==null||a.dispatchEvent(new y("keyup",{trigger:t}))}}Za(t){var a,o;if(!t.key||Se.has(t.key))return;const s=document.activeElement;if(s!=null&&s.matches(ve)||ie(t)&&(s!=null&&s.matches(Tn)))return;const n=s==null?void 0:s.hasAttribute("data-media-slider"),r=this.Va(t);if(!r&&!t.metaKey&&/[0-9]/.test(t.key)&&!n){t.preventDefault(),t.stopPropagation(),this.j.remote.seek(this.$store.duration()/10*Number(t.key),t);return}if(!(!r||/volume|seek/.test(r)&&n))switch(t.preventDefault(),t.stopPropagation(),r){case"seekForward":case"seekBackward":this.$a(t,r);break;case"volumeUp":case"volumeDown":const h=this.el.querySelector("media-volume-slider");if(h)h.dispatchEvent(new y("keydown",{trigger:t}));else{const c=t.shiftKey?.1:.05;this.j.remote.changeVolume(this.$store.volume()+(r==="volumeUp"?+c:-c),t)}break;case"toggleFullscreen":this.j.remote.toggleFullscreen("prefer-media",t);break;default:(o=(a=this.j.remote)[r])==null||o.call(a,t)}}_a(t){Us(t.target)&&this.Va(t)&&t.preventDefault()}Va(t){const s={...this.$props.keyShortcuts(),...this.j.ariaKeys};return Object.keys(s).find(n=>s[n].split(" ").some(r=>wn(r).replace(/Control/g,"Ctrl").split("+").every(a=>Se.has(a)?t[a.toLowerCase()+"Key"]:t.key===a.replace("Space"," "))))}ab(t,s){const n=t.shiftKey?10:5;return this.Ua=Math.max(0,Math.min((this.Ua??this.$store.currentTime())+(s==="seekForward"?+n:-n),this.$store.duration()))}Wa(t){var s;(s=this.Ta)==null||s.dispatchEvent(new y(t.type,{trigger:t}))}$a(t,s){this.$store.canSeek()&&(this.Ta||(this.Ta=this.el.querySelector("media-time-slider")),this.Ta?this.Wa(t):this.j.remote.seeking(this.ab(t,s),t))}}const kn=["!","@","#","$","%","^","&","*","(",")"];function wn(e){return e.replace(/Shift\+(\d)/g,(i,t)=>kn[t-1])}const Sn={autoplay:!1,aspectRatio:Tt({value:null,type:{from(e){if(!e)return null;if(!e.includes("/"))return+e;const[i,t]=e.split("/").map(Number);return+(i/t).toFixed(4)}}}),controls:!1,currentTime:0,crossorigin:null,fullscreenOrientation:"landscape",load:"visible",logLevel:"silent",loop:!1,muted:!1,paused:!0,playsinline:!1,playbackRate:1,poster:"",preload:"metadata",preferNativeHLS:Tt({value:!1,attribute:"prefer-native-hls"}),src:"",userIdleDelay:2e3,viewType:"unknown",streamType:"unknown",volume:1,liveEdgeTolerance:10,minLiveDVRWindow:60,keyDisabled:!1,keyTarget:"player",keyShortcuts:En,title:"",thumbnails:null,textTracks:Tt({value:[],attribute:!1}),smallBreakpointX:600,largeBreakpointX:980,smallBreakpointY:380,largeBreakpointY:600};class Rt{constructor(i,t){l(this,"W");x(i)?this.W=i:!v(i)&&!v(t)?this.W=[[i,t]]:this.W=[]}get length(){return this.W.length}start(i){return this.W[i][0]??1/0}end(i){return this.W[i][1]??1/0}}function Ae(e){if(!e.length)return null;let i=e.start(0);for(let t=1;t<e.length;t++){const s=e.start(t);s<i&&(i=s)}return i}function _e(e){if(!e.length)return null;let i=e.end(0);for(let t=1;t<e.length;t++){const s=e.end(t);s>i&&(i=s)}return i}const qi=new Xe({audioTracks:[],audioTrack:null,autoplay:!1,autoplayError:void 0,buffered:new Rt,duration:0,canLoad:!1,canFullscreen:!1,canPictureInPicture:!1,canPlay:!1,controls:!1,crossorigin:null,poster:"",currentTime:0,ended:!1,error:void 0,fullscreen:!1,loop:!1,logLevel:"silent",mediaType:"unknown",muted:!1,paused:!0,played:new Rt,playing:!1,playsinline:!1,pictureInPicture:!1,preload:"metadata",playbackRate:1,qualities:[],quality:null,autoQuality:!1,canSetQuality:!0,seekable:new Rt,seeking:!1,source:{src:"",type:""},sources:[],started:!1,title:"",textTracks:[],textTrack:null,thumbnails:null,thumbnailCues:[],volume:1,waiting:!1,get viewType(){return this.providedViewType!=="unknown"?this.providedViewType:this.mediaType},get streamType(){return this.providedStreamType!=="unknown"?this.providedStreamType:this.inferredStreamType},get currentSrc(){return this.source},get bufferedStart(){return Ae(this.buffered)??0},get bufferedEnd(){return _e(this.buffered)??0},get seekableStart(){return Ae(this.seekable)??0},get seekableEnd(){return this.canPlay?_e(this.seekable)??1/0:0},get seekableWindow(){return Math.max(0,this.seekableEnd-this.seekableStart)},touchPointer:!1,orientation:"landscape",mediaWidth:0,mediaHeight:0,breakpointX:"sm",breakpointY:"sm",userIdle:!1,userBehindLiveEdge:!1,liveEdgeTolerance:10,minLiveDVRWindow:60,get canSeek(){return/unknown|on-demand|:dvr/.test(this.streamType)&&Number.isFinite(this.seekableWindow)&&(!this.live||/:dvr/.test(this.streamType)&&this.seekableWindow>=this.minLiveDVRWindow)},get live(){return this.streamType.includes("live")||!Number.isFinite(this.duration)},get liveEdgeStart(){return this.live&&Number.isFinite(this.seekableEnd)?Math.max(0,(this.liveSyncPosition??this.seekableEnd)-this.liveEdgeTolerance):0},get liveEdge(){return this.live&&(!this.canSeek||!this.userBehindLiveEdge&&this.currentTime>=this.liveEdgeStart)},get liveEdgeWindow(){return this.live&&Number.isFinite(this.seekableEnd)?this.seekableEnd-this.liveEdgeStart:0},autoplaying:!1,providedViewType:"unknown",providedStreamType:"unknown",inferredStreamType:"unknown",liveSyncPosition:null}),vn=new Set(["autoplay","breakpointX","breakpointY","canFullscreen","canLoad","canPictureInPicture","controls","fullscreen","logLevel","loop","mediaHeight","mediaWidth","muted","orientation","pictureInPicture","playsinline","poster","preload","providedStreamType","providedViewType","source","sources","textTrack","textTracks","thumbnailCues","thumbnails","title","touchPointer","volume"]);function An(e){qi.reset(e,i=>!vn.has(i)),R()}const Q=Symbol(0);class Mi extends _i{get selected(){return this.a.find(i=>i.selected)??null}get selectedIndex(){return this.a.findIndex(i=>i.selected)}[vi](i,t){this[$t](i,!1,t)}[lt](i,t){i[Q]=!1,Object.defineProperty(i,"selected",{get(){return this[Q]},set:s=>{var n;this.readonly||((n=this[Ai])==null||n.call(this),this[$t](i,s))}}),super[lt](i,t)}[$t](i,t,s){if(t===i[Q])return;const n=this.selected;i[Q]=t,(t?n!==i:n===i)&&(n&&(n[Q]=!1),this.dispatchEvent(new y("change",{detail:{prev:n,current:this.selected},trigger:s})))}}const J=Symbol(0),kt=Symbol(0);var xe;class _n extends Mi{constructor(){super(...arguments);l(this,"Sa",!1);l(this,"switch","current");l(this,xe)}get auto(){return this.Sa||this.readonly}[(xe=kt,Ai)](){this[J](!1)}[Si](t){this[J](!1,t)}autoSelect(t){this.readonly||this.Sa||!this[kt]||(this[kt](),this[J](!0,t))}[J](t,s){this.Sa!==t&&(this.Sa=t,this.dispatchEvent(new y("auto-change",{detail:t,trigger:s})))}}class Cn extends _{constructor(i,t){super(i),this.jf=t}async onAttach(i){const t=this.$props.load();if(t==="eager")requestAnimationFrame(this.jf);else if(t==="idle"){const{waitIdlePeriod:s}=await Promise.resolve().then(()=>Fs);s(this.jf)}else if(t==="visible"){const s=new IntersectionObserver(n=>{n[0].isIntersecting&&(s.disconnect(),this.jf())});return s.observe(i),s.disconnect.bind(s)}}}class Pn{constructor(i,t){this.N=i,this.j=t}p(i,...t){this.N(new y(i,t==null?void 0:t[0]))}async lf(i,t){const{$store:s,logger:n}=this.j;u(s.canPlay)||(this.p("can-play",{detail:i,trigger:t}),R(),s.canPlay()&&s.autoplay()&&!s.started()&&await this.kf())}async kf(){const{player:i,$store:t}=this.j;t.autoplaying.set(!0);try{await i.play(),this.p("autoplay",{detail:{muted:t.muted()}})}catch(s){this.p("autoplay-fail",{detail:{muted:t.muted(),error:s}})}finally{t.autoplaying.set(!1)}}}class xn{constructor(){l(this,"Ze",new Map)}t(i,t){this.Ze.has(i)||this.Ze.set(i,new Set),this.Ze.get(i).add(t)}cf(i,t){const s=this.Ze.get(i);if(s)for(const n of s)t(n);this.Ze.delete(i)}yf(i){this.Ze.delete(i)}df(i){var t;return((t=this.Ze.get(i))==null?void 0:t.size)??0}gf(){this.Ze.clear()}}function tt(e){return e instanceof Error?e:Error(JSON.stringify(e))}class In extends _{constructor(){super(...arguments);l(this,"da",-2);l(this,"ba",2e3);l(this,"ea",!1);l(this,"ca",null)}get idling(){return this.$store.userIdle()}get idleDelay(){return this.ba}set idleDelay(t){this.ba=t}idle(t,s=this.ba,n){this.fa(),this.ea||this.ga(t,s,n)}pauseIdleTracking(t,s){this.ea=t,t&&(this.fa(),this.ga(!1,0,s))}onConnect(){d(this.C.bind(this)),f(this.el,"play",this.ia.bind(this)),f(this.el,"pause",this.ja.bind(this))}C(){if(this.$store.paused())return;const t=this.ka.bind(this);for(const s of["pointerup","keydown"])f(this.el,s,t);d(()=>{this.$store.touchPointer()||f(this.el,"pointermove",t)})}ia(t){this.idle(!0,this.ba,t)}ja(t){this.idle(!1,0,t)}fa(){window.clearTimeout(this.da),this.da=-1}ka(t){var s;t.MEDIA_GESTURE||(Nt(t)&&(t.key==="Escape"?((s=this.el)==null||s.focus(),this.ca=null):this.ca&&(t.preventDefault(),requestAnimationFrame(()=>{var n;(n=this.ca)==null||n.focus(),this.ca=null}))),this.idle(!1,0,t),this.idle(!0,this.ba,t))}ga(t,s,n){if(s===0){this.ha(t,n);return}this.da=window.setTimeout(()=>{this.ha(t&&!this.ea,n)},s)}ha(t,s){var n;this.$store.userIdle()!==t&&(this.$store.userIdle.set(t),t&&document.activeElement&&((n=this.el)!=null&&n.contains(document.activeElement))&&(this.ca=document.activeElement,requestAnimationFrame(()=>{var r;return(r=this.el)==null?void 0:r.focus()})),this.dispatch("user-idle-change",{detail:t,trigger:s}))}}class On{constructor(){l(this,"$a",!1);l(this,"rf",!1);l(this,"pf",!1);l(this,"Ze",new xn)}}class Nn extends _{constructor(t,s,n,r){super(t);l(this,"Q");l(this,"of");l(this,"nb");l(this,"nf");l(this,"q");l(this,"qf",!1);this.u=s,this.mf=n,this.j=r,this.nf=r.$store,this.q=r.$provider,this.Q=new In(t),this.of=new en(t),this.nb=new Ii(t)}onConnect(){d(this.uf.bind(this)),d(this.vf.bind(this)),d(this.wf.bind(this));const t=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),s=this.xf.bind(this);for(const n of t)n.startsWith("media-")&&this.listen(n,s);this.listen("fullscreen-change",this.d.bind(this))}xf(t){var s;t.stopPropagation(),u(this.q)&&((s=this[t.type])==null||s.call(this,t))}async M(){const{canPlay:t,paused:s,ended:n,autoplaying:r,seekableStart:a}=this.nf;if(u(s))try{const o=u(this.q);return Ft(o,u(t)),u(n)&&(o.currentTime=a()+.1),o.play()}catch(o){const h=this.createEvent("play-fail",{detail:tt(o)});throw h.autoplay=r(),this.u.N(h),o}}async L(){const{canPlay:t,paused:s}=this.nf;if(u(s))return;const n=u(this.q);return Ft(n,u(t)),n.pause()}V(){const{canPlay:t,live:s,liveEdge:n,canSeek:r,liveSyncPosition:a,seekableEnd:o,userBehindLiveEdge:h}=this.nf;if(h.set(!1),u(()=>!s()||n()||!r()))return;const c=u(this.q);Ft(c,u(t)),c.currentTime=a()??o()-2}async R(t="prefer-media"){const s=u(this.q),n=t==="prefer-media"&&this.of.supported||t==="media"?this.of:s==null?void 0:s.fullscreen;if(Ce(t,n),!n.active)return u(this.nf.pictureInPicture)&&(this.qf=!0,await this.U()),n.enter()}async S(t="prefer-media"){const s=u(this.q),n=t==="prefer-media"&&this.of.supported||t==="media"?this.of:s==null?void 0:s.fullscreen;if(Ce(t,n),!!n.active){this.nb.locked&&await this.nb.unlock();try{const r=await n.exit();return this.qf&&u(this.nf.canPictureInPicture)&&await this.T(),r}finally{this.qf=!1}}}async T(){if(this.sf(),!this.nf.pictureInPicture())return await this.q().pictureInPicture.enter()}async U(){if(this.sf(),!!this.nf.pictureInPicture())return await this.q().pictureInPicture.exit()}sf(){if(!this.nf.canPictureInPicture())throw Error("[vidstack] no pip support")}uf(){this.Q.idleDelay=this.$props.userIdleDelay()}vf(){var r,a;const{canLoad:t,canFullscreen:s}=this.nf,n=this.of.supported||((a=(r=this.q())==null?void 0:r.fullscreen)==null?void 0:a.supported)||!1;t()&&u(s)===n||s.set(n)}wf(){var r,a;const{canLoad:t,canPictureInPicture:s}=this.nf,n=((a=(r=this.q())==null?void 0:r.pictureInPicture)==null?void 0:a.supported)||!1;t()&&u(s)===n||s.set(n)}"media-audio-track-change-request"(t){if(this.j.audioTracks.readonly)return;const s=t.detail,n=this.j.audioTracks[s];n&&(this.mf.Ze.t("audioTrack",t),n.selected=!0)}async"media-enter-fullscreen-request"(t){try{this.mf.Ze.t("fullscreen",t),await this.R(t.detail)}catch(s){this.e(s)}}async"media-exit-fullscreen-request"(t){try{this.mf.Ze.t("fullscreen",t),await this.S(t.detail)}catch(s){this.e(s)}}async d(t){if(t.detail)try{const s=u(this.$props.fullscreenOrientation);this.nb.supported&&!v(s)&&await this.nb.lock(s)}catch{}}e(t){this.u.N(this.createEvent("fullscreen-error",{detail:tt(t)}))}async"media-enter-pip-request"(t){try{this.mf.Ze.t("pip",t),await this.T()}catch(s){this.tf(s)}}async"media-exit-pip-request"(t){try{this.mf.Ze.t("pip",t),await this.U()}catch(s){this.tf(s)}}tf(t){this.u.N(this.createEvent("picture-in-picture-error",{detail:tt(t)}))}"media-live-edge-request"(t){const{live:s,liveEdge:n,canSeek:r}=this.nf;if(!(!s()||n()||!r())){this.mf.Ze.t("seeked",t);try{this.V()}catch{}}}"media-loop-request"(){window.requestAnimationFrame(async()=>{try{this.mf.rf=!0,this.mf.pf=!0,await this.M()}catch{this.mf.rf=!1,this.mf.pf=!1}})}async"media-pause-request"(t){if(!this.nf.paused())try{this.mf.Ze.t("pause",t),await this.q().pause()}catch{this.mf.Ze.yf("pause")}}async"media-play-request"(t){if(this.nf.paused())try{this.mf.Ze.t("play",t),await this.q().play()}catch(s){const n=this.createEvent("play-fail",{detail:tt(s)});this.u.N(n)}}"media-rate-change-request"(t){this.nf.playbackRate()!==t.detail&&(this.mf.Ze.t("rate",t),this.q().playbackRate=t.detail)}"media-quality-change-request"(t){if(this.j.qualities.readonly)return;this.mf.Ze.t("quality",t);const s=t.detail;if(s<0)this.j.qualities.autoSelect(t);else{const n=this.j.qualities[s];n&&(n.selected=!0)}}"media-resume-user-idle-request"(t){this.mf.Ze.t("userIdle",t),this.Q.pauseIdleTracking(!1,t)}"media-pause-user-idle-request"(t){this.mf.Ze.t("userIdle",t),this.Q.pauseIdleTracking(!0,t)}"media-seek-request"(t){const{seekableStart:s,seekableEnd:n,ended:r,canSeek:a,live:o,userBehindLiveEdge:h}=this.nf;r()&&(this.mf.pf=!0),this.mf.$a=!1,this.mf.Ze.yf("seeking");const c=Math.min(Math.max(s()+.1,t.detail),n()-.1);!Number.isFinite(c)||!a()||(this.mf.Ze.t("seeked",t),this.q().currentTime=c,o()&&t.isOriginTrusted&&Math.abs(n()-c)>=2&&h.set(!0))}"media-seeking-request"(t){this.mf.Ze.t("seeking",t),this.nf.seeking.set(!0),this.mf.$a=!0}"media-start-loading"(t){this.nf.canLoad()||(this.mf.Ze.t("load",t),this.u.N(this.createEvent("can-load")))}"media-text-track-change-request"(t){const{index:s,mode:n}=t.detail,r=this.j.textTracks[s];r&&(this.mf.Ze.t("textTrack",t),r.setMode(n,t))}"media-mute-request"(t){this.nf.muted()||(this.mf.Ze.t("volume",t),this.q().muted=!0)}"media-unmute-request"(t){const{muted:s,volume:n}=this.nf;s()&&(this.mf.Ze.t("volume",t),this.j.$provider().muted=!1,n()===0&&(this.mf.Ze.t("volume",t),this.q().volume=.25))}"media-volume-change-request"(t){const{muted:s,volume:n}=this.nf,r=t.detail;n()!==r&&(this.mf.Ze.t("volume",t),this.q().volume=r,r>0&&s()&&(this.mf.Ze.t("volume",t),this.q().muted=!1))}}function Ft(e,i){if(!(e&&i))throw Error("[vidstack] media not ready")}function Ce(e,i){if(!(i!=null&&i.supported))throw Error("[vidstack] no fullscreen support")}var qn=Mn;function Mn(e,i,t){var s=null,n=null,r=function(){s&&(clearTimeout(s),n=null,s=null)},a=function(){var h=n;r(),h&&h()},o=function(){if(!i)return e.apply(this,arguments);var h=this,c=arguments,p=t&&!s;if(r(),n=function(){e.apply(h,c)},s=setTimeout(function(){if(s=null,!p){var L=n;return n=null,L()}},i),p)return n()};return o.cancel=r,o.flush=a,o}var ji=jn;function jn(e,i,t){var s=null,n=null,r=t&&t.leading,a=t&&t.trailing;r==null&&(r=!0),a==null&&(a=!r),r==!0&&(a=!1);var o=function(){s&&(clearTimeout(s),s=null)},h=function(){var p=n;o(),p&&p()},c=function(){var p=r&&!s,L=this,jt=arguments;if(n=function(){return e.apply(L,jt)},s||(s=setTimeout(function(){if(s=null,a)return n()},i)),p)return p=!1,n()};return c.cancel=o,c.flush=h,c}const Li=Symbol(0),W=Symbol(0),N=Symbol(0),V=Symbol(0),rt=Symbol(0),_t=Symbol(0),S=Symbol(0),Di=Symbol(0),Ln=new Set(["autoplay","autoplay-fail","can-load","sources-change","source-change","load-start","abort","error","loaded-metadata","loaded-data","can-play","play","play-fail","pause","playing","seeking","seeked","waiting"]);class Dn extends _{constructor(t,s,n){super(t);l(this,"nf");l(this,"zf",new Map);l(this,"Gf",!0);l(this,"Df",!1);l(this,"Bf");l(this,"seeking",ji(t=>{const{seeking:s,currentTime:n,paused:r}=this.nf;s.set(!0),n.set(t.detail),this.Af("seeking",t),r()&&(this.Bf=t,this.Ff())},150,{leading:!0}));l(this,"Ff",qn(()=>{if(!this.Bf)return;this.Df=!0;const{waiting:t,playing:s}=this.nf;t.set(!0),s.set(!1);const n=this.createEvent("waiting",{trigger:this.Bf});this.zf.set("waiting",n),this.el.dispatchEvent(n),this.Bf=void 0,this.Df=!1},300));this.mf=s,this.j=n,this.nf=n.$store}onAttach(t){t.setAttribute("aria-busy","true")}onConnect(t){this.Mf(),this.Nf(),this.Of(),this.listen("fullscreen-change",this["fullscreen-change"].bind(this)),this.listen("fullscreen-error",this["fullscreen-error"].bind(this))}N(t){var n,r;const s=t.type;(n=this[t.type])==null||n.call(this,t),Ln.has(s)&&this.zf.set(s,t),(r=this.el)==null||r.dispatchEvent(t)}Cf(){this.Hf(),this.mf.pf=!1,this.mf.rf=!1,this.Df=!1,this.Bf=void 0,this.zf.clear()}Af(t,s){this.mf.Ze.cf(t,n=>{s.request=n,m(s,n)})}Mf(){this.Ef(),this.If();const t=this.j.textTracks;f(t,"add",this.Ef.bind(this)),f(t,"remove",this.Ef.bind(this)),f(t,"mode-change",this.If.bind(this))}Nf(){const t=this.j.qualities;f(t,"add",this.Jf.bind(this)),f(t,"remove",this.Jf.bind(this)),f(t,"change",this.Pf.bind(this)),f(t,"auto-change",this.Qf.bind(this)),f(t,"readonly-change",this.Rf.bind(this))}Of(){const t=this.j.audioTracks;f(t,"add",this.Kf.bind(this)),f(t,"remove",this.Kf.bind(this)),f(t,"change",this.Sf.bind(this))}Ef(t){const{textTracks:s}=this.nf;s.set(this.j.textTracks.toArray()),this.dispatch("text-tracks-change",{detail:s(),trigger:t})}If(t){t&&this.Af("textTrack",t);const s=this.j.textTracks.selected,{textTrack:n}=this.nf;n()!==s&&(n.set(s),this.dispatch("text-track-change",{detail:s,trigger:t}))}Kf(t){const{audioTracks:s}=this.nf;s.set(this.j.audioTracks.toArray()),this.dispatch("audio-tracks-change",{detail:s(),trigger:t})}Sf(t){const{audioTrack:s}=this.nf;s.set(this.j.audioTracks.selected),this.Af("audioTrack",t),this.dispatch("audio-track-change",{detail:s(),trigger:t})}Jf(t){const{qualities:s}=this.nf;s.set(this.j.qualities.toArray()),this.dispatch("qualities-change",{detail:s(),trigger:t})}Pf(t){const{quality:s}=this.nf;s.set(this.j.qualities.selected),this.Af("quality",t),this.dispatch("quality-change",{detail:s(),trigger:t})}Qf(){this.nf.autoQuality.set(this.j.qualities.auto)}Rf(){this.nf.canSetQuality.set(!this.j.qualities.readonly)}"provider-change"(t){this.j.$provider.set(t.detail)}autoplay(t){m(t,this.zf.get("play")),m(t,this.zf.get("can-play")),this.nf.autoplayError.set(void 0)}"autoplay-fail"(t){m(t,this.zf.get("play-fail")),m(t,this.zf.get("can-play")),this.nf.autoplayError.set(t.detail),this.Cf()}"can-load"(t){this.nf.canLoad.set(!0),this.zf.set("can-load",t),this.Af("load",t),this.j.textTracks[rt]()}"media-type-change"(t){m(t,this.zf.get("source-change"));const s=this.nf.viewType();this.nf.mediaType.set(t.detail),s!==this.nf.viewType()&&setTimeout(()=>this.dispatch("view-type-change",{detail:this.nf.viewType(),trigger:t}),0)}"stream-type-change"(t){const{streamType:s,inferredStreamType:n}=this.nf;m(t,this.zf.get("source-change")),n.set(t.detail),t.detail=s()}"rate-change"(t){this.nf.playbackRate.set(t.detail),this.Af("rate",t)}"sources-change"(t){this.nf.sources.set(t.detail)}"source-change"(t){var s;if(m(t,this.zf.get("sources-change")),this.nf.source.set(t.detail),(s=this.el)==null||s.setAttribute("aria-busy","true"),this.Gf){this.Gf=!1;return}this.j.audioTracks[Kt](t),this.j.qualities[Kt](t),this.Cf(),An(this.j.$store),this.zf.set(t.type,t)}abort(t){m(t,this.zf.get("source-change")),m(t,this.zf.get("can-load"))}"load-start"(t){m(t,this.zf.get("source-change"))}error(t){this.nf.error.set(t.detail),m(t,this.zf.get("abort"))}"loaded-metadata"(t){m(t,this.zf.get("load-start"))}"loaded-data"(t){m(t,this.zf.get("load-start"))}"can-play"(t){var s,n;((s=t.trigger)==null?void 0:s.type)!=="loadedmetadata"&&m(t,this.zf.get("loaded-metadata")),this.Lf(t.detail),(n=this.el)==null||n.setAttribute("aria-busy","false")}"can-play-through"(t){this.Lf(t.detail),m(t,this.zf.get("can-play"))}Lf(t){const{seekable:s,seekableEnd:n,buffered:r,duration:a,canPlay:o}=this.nf;s.set(t.seekable),r.set(t.buffered),a.set(n),o.set(!0)}"duration-change"(t){const{live:s,duration:n}=this.nf,r=t.detail;s()||n.set(Number.isNaN(r)?0:r)}progress(t){const{buffered:s,seekable:n,live:r,duration:a,seekableEnd:o}=this.nf,h=t.detail;s.set(h.buffered),n.set(h.seekable),r()&&(a.set(o),this.dispatch("duration-change",{detail:o(),trigger:t}))}play(t){const{paused:s,autoplayError:n,ended:r,autoplaying:a}=this.nf;if(t.autoplay=a(),this.mf.rf||!s()){t.stopImmediatePropagation();return}m(t,this.zf.get("waiting")),this.Af("play",t),s.set(!1),n.set(void 0),(r()||this.mf.pf)&&(this.mf.pf=!1,r.set(!1),this.N(this.createEvent("replay",{trigger:t})))}"play-fail"(t){m(t,this.zf.get("play")),this.Af("play",t);const{paused:s,playing:n}=this.nf;s.set(!0),n.set(!1),this.Cf()}playing(t){const s=this.zf.get("play");s?(m(t,this.zf.get("waiting")),m(t,s)):m(t,this.zf.get("seeked")),setTimeout(()=>this.Cf(),0);const{paused:n,playing:r,seeking:a,ended:o}=this.nf;if(n.set(!1),r.set(!0),a.set(!1),o.set(!1),this.mf.rf){t.stopImmediatePropagation(),this.mf.rf=!1;return}this.started(t)}started(t){const{started:s,live:n,liveSyncPosition:r,seekableEnd:a}=this.nf;if(!s()){if(n()){const o=r()??a()-2;Number.isFinite(o)&&(this.j.$provider().currentTime=o)}s.set(!0),this.N(this.createEvent("started",{trigger:t}))}}pause(t){if(this.mf.rf){t.stopImmediatePropagation();return}m(t,this.zf.get("seeked")),this.Af("pause",t);const{paused:s,playing:n,seeking:r}=this.nf;s.set(!0),n.set(!1),r.set(!1),this.Cf()}"time-update"(t){const{currentTime:s,played:n,waiting:r}=this.nf,a=t.detail;s.set(a.currentTime),n.set(a.played),r.set(!1);for(const o of this.j.textTracks)o[V](a.currentTime,t)}"volume-change"(t){const{volume:s,muted:n}=this.nf,r=t.detail;s.set(r.volume),n.set(r.muted||r.volume===0),this.Af("volume",t)}seeked(t){var h;const{seeking:s,currentTime:n,paused:r,duration:a,ended:o}=this.nf;if(this.mf.$a)s.set(!0),t.stopImmediatePropagation();else if(s()){const c=this.zf.get("waiting");m(t,c),((h=c==null?void 0:c.trigger)==null?void 0:h.type)!=="seeking"&&m(t,this.zf.get("seeking")),r()&&this.Hf(),s.set(!1),t.detail!==a()&&o.set(!1),n.set(t.detail),this.Af("seeked",t);const p=t.originEvent;p&&p.isTrusted&&!/seek/.test(p.type)&&this.started(t)}}waiting(t){this.Df||this.mf.$a||(t.stopImmediatePropagation(),this.Bf=t,this.Ff())}ended(t){if(this.mf.rf){t.stopImmediatePropagation();return}const{paused:s,playing:n,seeking:r,ended:a}=this.nf;s.set(!0),n.set(!1),r.set(!1),a.set(!0),this.Cf()}Hf(){this.Ff.cancel(),this.nf.waiting.set(!1)}"fullscreen-change"(t){this.nf.fullscreen.set(t.detail),this.Af("fullscreen",t)}"fullscreen-error"(t){this.Af("fullscreen",t)}"picture-in-picture-change"(t){this.nf.pictureInPicture.set(t.detail),this.Af("pip",t)}"picture-in-picture-error"(t){this.Af("pip",t)}}class Rn extends _{onAttach(i){d(this.Tf.bind(this)),d(this.Uf.bind(this)),d(this.Vf.bind(this)),d(this.Wf.bind(this)),d(this.Xf.bind(this)),d(this.Yf.bind(this)),d(this.Zf.bind(this)),d(this._f.bind(this)),d(this.$f.bind(this)),d(this.ag.bind(this))}bg(){}Tf(){const i=this.$props.autoplay();this.$store.autoplay.set(i),this.dispatch("autoplay-change",{detail:i})}Vf(){const i=this.$props.loop();this.$store.loop.set(i),this.dispatch("loop-change",{detail:i})}Wf(){const i=this.$props.controls();this.$store.controls.set(i),this.dispatch("controls-change",{detail:i})}Uf(){const i=this.$props.poster();this.$store.poster.set(i),this.dispatch("poster-change",{detail:i})}Xf(){this.$store.crossorigin.set(this.$props.crossorigin())}Yf(){const i=this.$props.playsinline();this.$store.playsinline.set(i),this.dispatch("playsinline-change",{detail:i})}_f(){this.dispatch("live-change",{detail:this.$store.live()})}Zf(){this.$store.liveEdgeTolerance.set(this.$props.liveEdgeTolerance()),this.$store.minLiveDVRWindow.set(this.$props.minLiveDVRWindow())}$f(){this.dispatch("live-edge-change",{detail:this.$store.liveEdge()})}ag(){this.$store.thumbnails.set(this.$props.thumbnails())}}function de(e,i="preconnect"){const t=document.querySelector(`link[href="${e}"]`);if(!ft(t))return!0;const s=document.createElement("link");return s.rel=i,s.href=e,s.crossOrigin="true",document.head.append(s),!0}const gt={};function Fn(e){if(gt[e])return gt[e].promise;const i=ue(),t=document.querySelector(`script[src="${e}"]`);if(!ft(t))return i.resolve(),i.promise;const s=document.createElement("script");return s.src=e,s.onload=()=>{i.resolve(),delete gt[e]},s.onerror=()=>{i.reject(),delete gt[e]},setTimeout(()=>document.head.append(s),0),i.promise}function pe(e){return e==="use-credentials"?"include":P(e)?"same-origin":void 0}function Hn(e,i){for(let t=0,s=i.length;t<s;t++)if(Ct(i[t],e))return i[t];return null}function Ct(e,i){return i>=e.startTime&&i<e.endTime}function Vn(e,i,t){const s=e.toArray().find(n=>n.kind==="chapters"&&n.mode==="showing");if(s!==i){if(!s){t(null);return}s.readyState==2?t(s):(t(null),s.addEventListener("load",()=>t(s),{once:!0}))}}var Ie,Oe,Ne,qe;class Pt extends ee{constructor(t){super();l(this,"src");l(this,"content");l(this,"type");l(this,"encoding");l(this,"id","");l(this,"label","");l(this,"language","");l(this,"kind");l(this,"default",!1);l(this,"Ia",!1);l(this,"Ea",0);l(this,"Ga","disabled");l(this,"Ja",{});l(this,"Ha",[]);l(this,"Da",[]);l(this,"Fa",[]);l(this,qe,0);l(this,Ne);l(this,Oe,null);l(this,Ie,null);for(const s of Object.keys(t))this[s]=t[s];this.type||(this.type="vtt"),t.content?Promise.resolve().then(()=>require("./prod-Ba2x-T01.cjs")).then(s=>s.prod).then(({parseText:s,VTTCue:n,VTTRegion:r})=>{t.type==="json"?this.Ka(t.content,n,r):s(t.content,{type:t.type}).then(({cues:a,regions:o})=>{this.Da=a,this.Ha=o,this.La()})}):t.src||(this[N]=2)}static createId(t){return`id::${t.type}-${t.kind}-${t.src??t.label}`}get metadata(){return this.Ja}get regions(){return this.Ha}get cues(){return this.Da}get activeCues(){return this.Fa}get readyState(){return this[N]}get mode(){return this.Ga}set mode(t){this.setMode(t)}addCue(t,s){var a;let n=0,r=this.Da.length;for(n=0;n<r&&!(t.endTime<=this.Da[n].startTime);n++);n===r?this.Da.push(t):this.Da.splice(n,0,t),(s==null?void 0:s.type)!=="cuechange"&&((a=this[S])==null||a.track.addCue(t)),this.dispatchEvent(new y("add-cue",{detail:t,trigger:s})),Ct(t,this.Ea)&&this[V](this.Ea,s)}removeCue(t,s){var r;const n=this.Da.indexOf(t);if(n>=0){const a=this.Fa.includes(t);this.Da.splice(n,1),(r=this[S])==null||r.track.removeCue(t),this.dispatchEvent(new y("remove-cue",{detail:t,trigger:s})),a&&this[V](this.Ea,s)}}setMode(t,s){var n;this.Ga!==t&&(this.Ga=t,t==="disabled"?(this.Fa=[],this.Ma()):this.readyState===2?this[V](this.Ea,s):this.Na(),this.dispatchEvent(new y("mode-change",{detail:this,trigger:s})),(n=this[_t])==null||n.call(this))}[(qe=N,Ne=W,Oe=_t,Ie=S,V)](t,s){if(this.Ea=t,this.mode==="disabled"||!this.Da.length)return;const n=[];for(let a=0,o=this.Da.length;a<o;a++){const h=this.Da[a];Ct(h,t)&&n.push(h)}let r=n.length!==this.Fa.length;if(!r){for(let a=0;a<n.length;a++)if(!this.Fa.includes(n[a])){r=!0;break}}this.Fa=n,r&&this.Ma(s)}[rt](){this.Ia=!0,this.Ga!=="disabled"&&this.Na()}async Na(){var t,s;if(!(!this.Ia||!this.src||this[N]>0)){this[N]=1,this.dispatchEvent(new y("load-start"));try{const{parseResponse:n,VTTCue:r,VTTRegion:a}=await Promise.resolve().then(()=>require("./prod-Ba2x-T01.cjs")).then(c=>c.prod),o=(t=this[W])==null?void 0:t.call(this),h=fetch(this.src,{headers:this.type==="json"?{"Content-Type":"application/json"}:void 0,credentials:pe(o)});if(this.type==="json")this.Ka(await(await h).text(),r,a);else{const{errors:c,metadata:p,regions:L,cues:jt}=await n(h,{type:this.type,encoding:this.encoding});if(((s=c[0])==null?void 0:s.code)===0)throw c[0];this.Ja=p,this.Ha=L,this.Da=jt}this.La()}catch(n){this.Oa(n)}}}La(){var s;if(this[N]=2,!this.src||this.type!=="vtt"){const n=(s=this[S])==null?void 0:s.track;if(n)for(const r of this.Da)n.addCue(r)}const t=new y("load");this[V](this.Ea,t),this.dispatchEvent(t)}Oa(t){this[N]=3,this.dispatchEvent(new y("error",{detail:t}))}Ka(t,s,n){try{t=JSON.parse(t),t.regions&&(this.Ha=t.regions.map(r=>Object.assign(new n,r))),t.cues&&(this.Da=t.cues.filter(r=>ot(r.startTime)&&ot(r.endTime)).map(r=>Object.assign(new s(0,0,""),r)))}catch(r){this.Oa(r)}}Ma(t){this.dispatchEvent(new y("cue-change",{trigger:t}))}}const Un=/captions|subtitles/;function M(e){return Un.test(e.kind)}class Bn{constructor(i){l(this,"Z",null);l(this,"Y",null);l(this,"_",-1);this.$=i}setTarget(i){this.Z=i}getPlayer(i){var t;return this.Y?this.Y:((t=i??this.Z)==null||t.dispatchEvent(new y("find-media-player",{detail:s=>void(this.Y=s),bubbles:!0,composed:!0})),this.Y)}setPlayer(i){this.Y=i}startLoading(i){this.X("media-start-loading",i)}play(i){this.X("media-play-request",i)}pause(i){this.X("media-pause-request",i)}mute(i){this.X("media-mute-request",i)}unmute(i){this.X("media-unmute-request",i)}enterFullscreen(i,t){this.X("media-enter-fullscreen-request",t,i)}exitFullscreen(i,t){this.X("media-exit-fullscreen-request",t,i)}enterPictureInPicture(i){this.X("media-enter-pip-request",i)}exitPictureInPicture(i){this.X("media-exit-pip-request",i)}seeking(i,t){this.X("media-seeking-request",t,i)}seek(i,t){this.X("media-seek-request",t,i)}seekToLiveEdge(i){this.X("media-live-edge-request",i)}changeVolume(i,t){this.X("media-volume-change-request",t,Math.max(0,Math.min(1,i)))}changeAudioTrack(i,t){this.X("media-audio-track-change-request",t,i)}changeQuality(i,t){this.X("media-quality-change-request",t,i)}changeTextTrackMode(i,t,s){this.X("media-text-track-change-request",s,{index:i,mode:t})}changePlaybackRate(i,t){this.X("media-rate-change-request",t,i)}resumeUserIdle(i){this.X("media-resume-user-idle-request",i)}pauseUserIdle(i){this.X("media-pause-user-idle-request",i)}togglePaused(i){const t=this.getPlayer(i==null?void 0:i.target);t&&(t.state.paused?this.play(i):this.pause(i))}toggleUserIdle(i){const t=this.getPlayer(i==null?void 0:i.target);t&&t.user.idle(!t.user.idling,0,i)}toggleMuted(i){const t=this.getPlayer(i==null?void 0:i.target);t&&(t.state.muted?this.unmute(i):this.mute(i))}toggleFullscreen(i,t){const s=this.getPlayer(t==null?void 0:t.target);s&&(s.state.fullscreen?this.exitFullscreen(i,t):this.enterFullscreen(i,t))}togglePictureInPicture(i){const t=this.getPlayer(i==null?void 0:i.target);t&&(t.state.pictureInPicture?this.exitPictureInPicture(i):this.enterPictureInPicture(i))}toggleCaptions(i){const t=this.getPlayer(i==null?void 0:i.target);if(!t)return;const s=t.state.textTracks,n=t.state.textTrack;if(n){const r=s.indexOf(n);this.changeTextTrackMode(r,"disabled",i),this._=r}else{let r=this._;(!s[r]||!M(s[r]))&&(r=-1),r===-1&&(r=s.findIndex(a=>M(a)&&a.default)),r===-1&&(r=s.findIndex(a=>M(a))),r>=0&&this.changeTextTrackMode(r,"showing",i),this._=-1}}X(i,t,s){const n=new y(i,{bubbles:!0,composed:!0,detail:s,trigger:t}),a=(t==null?void 0:t.target)&&(t.target===document||t.target===window||t.target===document.body||this.Y&&!this.Y.contains(t.target))?this.Z??this.getPlayer():(t==null?void 0:t.target)??this.Z;a==null||a.dispatchEvent(n)}aa(i){}}class zn extends _{constructor(){super(...arguments);l(this,"j")}onConnect(){this.j=Mt(),d(this.cg.bind(this))}cg(){const{canLoad:t,thumbnailCues:s}=this.j.$store;if(!t())return;const n=new AbortController,{crossorigin:r,thumbnails:a}=this.j.$store,o=a();if(o)return Promise.resolve().then(()=>require("./prod-Ba2x-T01.cjs")).then(h=>h.prod).then(({parseResponse:h})=>{h(fetch(o,{signal:n.signal,credentials:pe(r())})).then(({cues:c})=>s.set(c)).catch(Ot)}),()=>{n.abort(),s.set([])}}}class Kn extends Mi{getById(i){return i===""?null:this.a.find(t=>t.id===i)??null}}class Wn{constructor(){l(this,"priority",0);l(this,"eg",!0);l(this,"qa",null);l(this,"ya",null);l(this,"dg",new Set)}canRender(){return!0}attach(i){this.qa=i,i.textTracks.onchange=this.Hc.bind(this)}addTrack(i){this.dg.add(i),this.gg(i)}removeTrack(i){var t,s;(s=(t=i[S])==null?void 0:t.remove)==null||s.call(t),i[S]=null,this.dg.delete(i)}changeTrack(i){const t=i==null?void 0:i[S];t&&t.track.mode!=="showing"&&(t.track.mode="showing"),this.ya=i}setDisplay(i){this.eg=i,this.Hc()}detach(){this.qa&&(this.qa.textTracks.onchange=null);for(const i of this.dg)this.removeTrack(i);this.dg.clear(),this.qa=null,this.ya=null}gg(i){if(!this.qa)return;const t=i[S]??(i[S]=this.hg(i));t instanceof HTMLElement&&(this.qa.append(t),t.track.mode=t.default?"showing":"hidden")}hg(i){const t=document.createElement("track"),s=i.default||i.mode==="showing",n=i.src&&i.type==="vtt";return t.id=i.id,t.src=n?i.src:"https://cdn.jsdelivr.net/npm/vidstack@0.6.12/empty.vtt",t.label=i.label,t.kind=i.kind,t.default=s,i.language&&(t.srclang=i.language),s&&!n&&this.fg(i,t.track),t}fg(i,t){var s;if(!(i.src&&i.type==="vtt"||(s=t.cues)!=null&&s.length))for(const n of i.cues)t.addCue(n)}Hc(i){var t;for(const s of this.dg){const n=(t=s[S])==null?void 0:t.track;if(!n)continue;if(!this.eg){n.mode="disabled";continue}const r=n.mode==="showing";r&&this.fg(s,n),s.setMode(r?"showing":"disabled",i)}}}class Zn{constructor(i){l(this,"qa",null);l(this,"pa");l(this,"oa",[]);l(this,"sa",!1);l(this,"la",null);l(this,"ma",null);this.j=i;const t=i.textTracks;this.pa=t,d(this.ua.bind(this)),j(this.ra.bind(this)),f(t,"add",this.va.bind(this)),f(t,"remove",this.wa.bind(this)),f(t,"mode-change",this.na.bind(this))}ua(){const{$store:i,$iosControls:t}=this.j;this.sa=i.controls()||t(),this.na()}add(i){this.oa.push(i),this.na()}remove(i){i.detach(),this.oa.splice(this.oa.indexOf(i),1),this.na()}[Li](i){requestAnimationFrame(()=>{if(this.qa=i,i){this.la=new Wn,this.la.attach(i);for(const t of this.pa)this.ta(t)}this.na()})}ta(i){var t;M(i)&&((t=this.la)==null||t.addTrack(i))}xa(i){var t;M(i)&&((t=this.la)==null||t.removeTrack(i))}va(i){this.ta(i.detail)}wa(i){this.xa(i.detail)}na(){var s,n,r;if(!this.qa){this.ra();return}const i=this.pa.selected;if(this.sa||i!=null&&i[Di]){(s=this.ma)==null||s.changeTrack(null),this.la.setDisplay(!0),this.la.changeTrack(i);return}if(this.la.setDisplay(!1),this.la.changeTrack(null),!i){(n=this.ma)==null||n.changeTrack(null);return}const t=this.oa.sort((a,o)=>a.priority-o.priority).find(a=>a.canRender(i));this.ma!==t&&((r=this.ma)==null||r.detach(),t==null||t.attach(this.qa),this.ma=t??null),t==null||t.changeTrack(i)}ra(){var i,t;(i=this.la)==null||i.detach(),this.la=null,(t=this.ma)==null||t.detach(),this.ma=null}}var Me;class Xn extends _i{constructor(){super(...arguments);l(this,"Ia",!1);l(this,"Pa",{});l(this,Me);l(this,"Qa",this.Ra.bind(this))}get selected(){return this.a.find(s=>s.mode==="showing"&&M(s))??null}add(t,s){const n=t instanceof Pt,r=n?t:new Pt(t);return this.Pa[t.kind]&&t.default&&delete t.default,r.addEventListener("mode-change",this.Qa),this[lt](r,s),r[W]=this[W],this.Ia&&r[rt](),t.default&&(this.Pa[t.kind]=r,r.mode="showing"),this}remove(t,s){if(this.a.includes(t))return t===this.Pa[t.kind]&&delete this.Pa[t.kind],t.mode="disabled",t[_t]=null,t.removeEventListener("mode-change",this.Qa),this[vt](t,s),this}clear(t){for(const s of this.a)this.remove(s,t);return this}getById(t){return this.a.find(s=>s.id===t)??null}getByKind(t){const s=Array.isArray(t)?t:[t];return this.a.filter(n=>s.includes(n.kind))}[(Me=W,rt)](){if(!this.Ia){for(const t of this.a)t[rt]();this.Ia=!0}}Ra(t){const s=t.detail;if(s.mode==="showing"){const n=M(s)?["captions","subtitles"]:[s.kind];for(const r of this.a)r.mode==="showing"&&r!=s&&n.includes(r.kind)&&(r.mode="disabled")}this.dispatchEvent(new y("mode-change",{detail:t.detail,trigger:t}))}}class Yn{constructor(i,t,s){l(this,"Ie");this.l=i,this.j=t,this.k=s;const n=new zt,r=new wi,a=new Gs;this.Ie=ut(()=>t.$props.preferNativeHLS()?[r,a,n]:[n,r,a]),d(this.Ke.bind(this)),d(this.Le.bind(this)),d(this.Me.bind(this)),d(this.Ne.bind(this))}Ke(){this.j.delegate.p("sources-change",{detail:[...Gn(this.j.$props.src()),...this.l()]})}Le(){var a;const{$store:i}=this.j,t=i.sources(),s=u(i.source),n=this.Je(s,t);if(((a=t[0])==null?void 0:a.src)&&!n.src&&!n.type){const{crossorigin:o}=i,h=pe(o()),c=new AbortController;return Promise.all(t.map(p=>P(p.src)&&p.type==="?"?fetch(p.src,{method:"HEAD",credentials:h,signal:c.signal}).then(L=>(p.type=L.headers.get("content-type")||"??",p)).catch(()=>p):p)).then(p=>{c.signal.aborted||(this.Je(u(i.source),p),R())}),()=>c.abort()}R()}Je(i,t){let s={src:"",type:""},n=null;for(const r of t){const a=u(this.Ie).find(o=>o.canPlay(r));a&&(s=r,n=a)}return this.Oe(i,s,n),this.Pe(u(this.k),n),s}Oe(i,t,s){t.src===i.src&&t.type===i.type||(this.j.delegate.p("source-change",{detail:t}),this.j.delegate.p("media-type-change",{detail:(s==null?void 0:s.mediaType(t))||"unknown"}))}Pe(i,t){t!==i&&(this.j.delegate.p("provider-change",{detail:null}),t&&u(()=>{var s;return(s=t.preconnect)==null?void 0:s.call(t,this.j)}),this.k.set(t),this.j.delegate.p("provider-loader-change",{detail:t}))}Me(){const i=this.j.$provider();if(i){if(this.j.$store.canLoad()){u(()=>i.setup({...this.j,player:this.j.player}));return}u(()=>{var t;return(t=i.preconnect)==null?void 0:t.call(i,this.j)})}}Ne(){const i=this.j.$provider(),t=this.j.$store.source();if(this.j.$store.canLoad()){u(()=>i==null?void 0:i.loadSource(t,u(this.j.$store.preload)));return}try{P(t.src)&&de(new URL(t.src).origin,"preconnect")}catch{}}}function Gn(e){return(x(e)?e:[!P(e)&&"src"in e?e:{src:e}]).map(({src:i,type:t})=>({src:i,type:t??(!P(i)||i.startsWith("blob:")?"video/object":"?")}))}class Qn{constructor(i,t){l(this,"Ge",[]);this.m=i,this.j=t,d(this.He.bind(this))}He(){const i=[...this.j.$props.textTracks(),...this.m()];for(const t of this.Ge)if(!i.some(s=>s.id===t.id)){const s=t.id&&this.j.textTracks.getById(t.id);s&&this.j.textTracks.remove(s)}for(const t of i){const s=t.id||Pt.createId(t);this.j.textTracks.getById(s)||(t.id=s,this.j.textTracks.add(t))}this.Ge=i}}class Ri extends oi{constructor(t){super(t);l(this,"j");l(this,"l",O([]));l(this,"m",O([]));l(this,"k",O(null));this.j=Mt(),new Yn(this.l,this.j,this.k),new Qn(this.m,this.j)}onAttach(t){t.setAttribute("keep-alive","")}onConnect(t){const s=new ResizeObserver(fe(this.n.bind(this)));s.observe(t);const n=new MutationObserver(this.o.bind(this));return n.observe(t,{attributes:!0,childList:!0}),Ci&&f(t,"touchstart",r=>r.preventDefault(),{passive:!1}),Oi(()=>{this.n(),this.o()}),()=>{s.disconnect(),n.disconnect()}}onDestroy(){this.j.$store.currentTime.set(0)}n(){const t=this.j.player,s=this.el.offsetWidth,n=this.el.offsetHeight;t&&(t.$store.mediaWidth.set(s),t.$store.mediaHeight.set(n),Y(t,"--media-width",s+"px"),Y(t,"--media-height",n+"px"))}o(){const t=[],s=[],n=this.el.children;for(const r of n)r instanceof HTMLSourceElement?t.push({src:r.src,type:r.type}):r instanceof HTMLTrackElement&&s.push({id:r.id,src:r.src,kind:r.track.kind,language:r.srclang,label:r.label,default:r.default,type:r.getAttribute("data-type")});this.l.set(t),this.m.set(s),R()}render(){let t;return j(()=>{var s;return(s=t==null?void 0:t.destroy)==null?void 0:s.call(t)}),()=>{t==null||t.destroy();const s=this.k();if(!s)return null;const n=s.render(this.j.$store);return u(()=>{s.load(this.j).then(r=>{u(this.k)===s&&(this.j.delegate.p("provider-change",{detail:r}),t=r)})}),n}}}l(Ri,"el",yi({tagName:"media-outlet"}));class Jn extends _{constructor(i,t){super(i),this.ig=t}onAttach(i){const{$props:t,ariaKeys:s}=Mt(),n=i.getAttribute("aria-keyshortcuts");if(n){s[this.ig]=n,j(()=>{delete s[this.ig]});return}const r=t.keyShortcuts()[this.ig];r&&i.setAttribute("aria-keyshortcuts",r)}}exports.$$_attr=B;exports.$$_clone=us;exports.$$_computed=Ts;exports.$$_create_component=ms;exports.$$_create_template=le;exports.$$_create_walker=dt;exports.$$_effect=z;exports.$$_hydrating=cs;exports.$$_insert_at_marker_lite=ps;exports.$$_insert_lite=ds;exports.$$_listen=gs;exports.$$_next_element=di;exports.$$_next_template=ls;exports.$$_peek=bs;exports.$$_ref=ce;exports.$$_scoped=Es;exports.$$_setup_custom_element=hs;exports.ARIAKeyShortcuts=Jn;exports.ATTACH_VIDEO=Li;exports.AudioTrackList=Kn;exports.Component=oi;exports.ComponentController=_;exports.DOMEvent=y;exports.ENABLE_AUTO_QUALITY=kt;exports.IS_CHROME=on;exports.IS_IPHONE=an;exports.IS_SAFARI=Ci;exports.LIST_ADD=lt;exports.LIST_REMOVE=vt;exports.LIST_SELECT=$t;exports.MEDIA_ATTRIBUTES=bn;exports.MediaKeyboardController=$n;exports.MediaLoadController=Cn;exports.MediaPlayerDelegate=Pn;exports.MediaRemoteControl=Bn;exports.MediaRequestContext=On;exports.MediaRequestManager=Nn;exports.MediaStateManager=Dn;exports.MediaStoreFactory=qi;exports.MediaStoreSync=Rn;exports.Outlet=Ri;exports.SET_AUTO_QUALITY=J;exports.ScreenOrientationController=Ii;exports.StoreFactory=Xe;exports.TEXT_TRACK_CROSSORIGIN=W;exports.TEXT_TRACK_NATIVE=S;exports.TEXT_TRACK_NATIVE_HLS=Di;exports.TEXT_TRACK_ON_MODE_CHANGE=_t;exports.TEXT_TRACK_READY_STATE=N;exports.TextRenderers=Zn;exports.TextTrack=Pt;exports.TextTrackList=Xn;exports.ThumbnailsLoader=zn;exports.VideoQualityList=_n;exports.animationFrameThrottle=fe;exports.ariaBool=gi;exports.camelToKebabCase=re;exports.canChangeVolume=un;exports.canFullscreen=sn;exports.canPlayHLSNatively=Pi;exports.canUsePictureInPicture=cn;exports.canUseVideoPresentation=hn;exports.coerceToError=tt;exports.computed=ut;exports.createContext=We;exports.createDisposalBin=he;exports.deferredPromise=ue;exports.defineElement=yi;exports.defineProp=Tt;exports.effect=d;exports.findActiveCue=Hn;exports.functionThrottle=ji;exports.getScope=ct;exports.hasProvidedContext=Qi;exports.isCueActive=Ct;exports.isDOMElement=se;exports.isDOMEvent=Je;exports.isElementParent=yn;exports.isFunction=g;exports.isHLSSrc=ki;exports.isHLSSupported=xi;exports.isKeyboardEvent=Nt;exports.isMediaStream=Zs;exports.isMouseEvent=ii;exports.isNil=ze;exports.isNull=ft;exports.isNumber=ot;exports.isPointerEvent=ti;exports.isString=P;exports.isTouchEvent=ei;exports.isTrackCaptionKind=M;exports.isUndefined=v;exports.isWriteSignal=Gi;exports.kebabToCamelCase=ri;exports.listenEvent=f;exports.loadScript=Fn;exports.mediaContext=Ni;exports.mediaPlayerProps=Sn;exports.method=Ls;exports.onDispose=j;exports.onPress=gn;exports.onTrackChapterChange=Vn;exports.peek=u;exports.preconnect=de;exports.prop=js;exports.provideContext=Ze;exports.registerLiteCustomElement=os;exports.scoped=w;exports.scopedRaf=Oi;exports.setARIALabel=mn;exports.setAttribute=X;exports.setAttributeIfEmpty=pn;exports.setStyle=Y;exports.signal=O;exports.tick=R;exports.uppercaseFirstChar=ai;exports.useContext=te;exports.useDisposalBin=bi;exports.useMedia=Mt;exports.useStore=Ji;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./media-core-Rxz2MNwG.cjs");e.registerLiteCustomElement(e.Outlet);
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
|
+
var x = (p, r, t) => r in p ? w(p, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[r] = t;
|
|
3
|
+
var l = (p, r, t) => x(p, typeof r != "symbol" ? r + "" : r, t);
|
|
4
|
+
import { C as k, d as P, M as R, m as q, a as C, s as M, A as S, V as j, c as A, T as I, b as L, e as _, p as E, f as F, S as O, g as Z, h as B, i as N, j as z, k as D, l as K, n as V, o as H, q as n, t as G, I as Q, u as y, v as X, w as U, x as Y, y as J, z as W, B as o, D as d, E as tt, F as et, G as st, H as v, r as g, O as it } from "./media-core-CkW37AYl.js";
|
|
5
|
+
import { F as rt, c as at } from "./media-ui-DfPbRfFS.js";
|
|
6
|
+
class ot {
|
|
7
|
+
constructor() {
|
|
8
|
+
l(this, "_e", !1);
|
|
9
|
+
l(this, "$e", v());
|
|
10
|
+
l(this, "Ze", /* @__PURE__ */ new Map());
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The number of callbacks that are currently in queue.
|
|
14
|
+
*/
|
|
15
|
+
get df() {
|
|
16
|
+
return this.Ze.size;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Whether items in the queue are being served immediately, otherwise they're queued to
|
|
20
|
+
* be processed later.
|
|
21
|
+
*/
|
|
22
|
+
get ef() {
|
|
23
|
+
return this._e;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Waits for the queue to be flushed (ie: start serving).
|
|
27
|
+
*/
|
|
28
|
+
async ff() {
|
|
29
|
+
this._e || await this.$e.promise;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Queue the given `callback` to be invoked at a later time by either calling the `serve()` or
|
|
33
|
+
* `start()` methods. If the queue has started serving (i.e., `start()` was already called),
|
|
34
|
+
* then the callback will be invoked immediately.
|
|
35
|
+
*
|
|
36
|
+
* @param key - Uniquely identifies this callback so duplicates are ignored.
|
|
37
|
+
* @param callback - The function to call when this item in the queue is being served.
|
|
38
|
+
*/
|
|
39
|
+
t(r, t) {
|
|
40
|
+
if (this._e) {
|
|
41
|
+
t();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.Ze.delete(r), this.Ze.set(r, t);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Invokes the callback with the given `key` in the queue (if it exists).
|
|
48
|
+
*/
|
|
49
|
+
cf(r) {
|
|
50
|
+
var t;
|
|
51
|
+
(t = this.Ze.get(r)) == null || t(), this.Ze.delete(r);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Flush all queued items and start serving future requests immediately until `stop()` is called.
|
|
55
|
+
*/
|
|
56
|
+
O() {
|
|
57
|
+
this.af(), this._e = !0, this.Ze.size > 0 && this.af();
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Stop serving requests, they'll be queued until you begin processing again by calling `start()`.
|
|
61
|
+
*/
|
|
62
|
+
P() {
|
|
63
|
+
this._e = !1;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Stop serving requests, empty the request queue, and release any promises waiting for the
|
|
67
|
+
* queue to flush.
|
|
68
|
+
*/
|
|
69
|
+
gf() {
|
|
70
|
+
this.P(), this.Ze.clear(), this.bf();
|
|
71
|
+
}
|
|
72
|
+
af() {
|
|
73
|
+
for (const r of this.Ze.keys())
|
|
74
|
+
this.cf(r);
|
|
75
|
+
this.bf();
|
|
76
|
+
}
|
|
77
|
+
bf() {
|
|
78
|
+
this.$e.resolve(), this.$e = v();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
var nt = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, a = (p, r, t, e) => {
|
|
82
|
+
for (var s = e > 1 ? void 0 : e ? pt(r, t) : r, h = p.length - 1, u; h >= 0; h--)
|
|
83
|
+
(u = p[h]) && (s = (e ? u(r, t, s) : u(s)) || s);
|
|
84
|
+
return e && s && nt(r, t, s), s;
|
|
85
|
+
};
|
|
86
|
+
class i extends k {
|
|
87
|
+
constructor(t) {
|
|
88
|
+
super(t);
|
|
89
|
+
l(this, "j");
|
|
90
|
+
l(this, "u");
|
|
91
|
+
l(this, "r");
|
|
92
|
+
l(this, "s", new ot());
|
|
93
|
+
l(this, "orientation");
|
|
94
|
+
this.w(), new C(t);
|
|
95
|
+
const e = {
|
|
96
|
+
player: null,
|
|
97
|
+
scope: tt(),
|
|
98
|
+
qualities: new j(),
|
|
99
|
+
audioTracks: new S(),
|
|
100
|
+
$provider: M(null),
|
|
101
|
+
$props: this.$props,
|
|
102
|
+
$store: this.$store
|
|
103
|
+
};
|
|
104
|
+
e.remote = new et(void 0), e.$iosControls = A(this.x.bind(this)), e.textTracks = new I(), e.textTracks[L] = this.$props.crossorigin, e.textRenderers = new _(e), e.ariaKeys = {}, this.j = e, E(F, e), this.orientation = new O(t), new rt(t), new Z(t, e), new B(t);
|
|
105
|
+
const s = new z();
|
|
106
|
+
this.u = new N(t, s, e), this.r = new D(t, this.u, s, e), e.delegate = new K(
|
|
107
|
+
this.u.N.bind(this.u),
|
|
108
|
+
e
|
|
109
|
+
), new V(t, this.startLoading.bind(this));
|
|
110
|
+
}
|
|
111
|
+
get q() {
|
|
112
|
+
return this.j.$provider();
|
|
113
|
+
}
|
|
114
|
+
onAttach(t) {
|
|
115
|
+
t.setAttribute("tabindex", "0"), H(t, "role", "region"), n(this.y.bind(this)), n(this.z.bind(this)), n(this.A.bind(this)), n(this.B.bind(this)), n(this.C.bind(this)), n(this.D.bind(this)), n(this.E.bind(this)), n(this.F.bind(this)), n(this.G.bind(this)), this.H(), this.I(), this.j.player = t, this.j.remote.setTarget(t), this.j.remote.setPlayer(t), G(t, "find-media-player", this.J.bind(this));
|
|
116
|
+
}
|
|
117
|
+
onConnect(t) {
|
|
118
|
+
Q && y(t, "data-iphone", "");
|
|
119
|
+
const e = window.matchMedia("(pointer: coarse)");
|
|
120
|
+
this.v(e), e.onchange = this.v.bind(this);
|
|
121
|
+
const s = new ResizeObserver(this.n.bind(this));
|
|
122
|
+
return s.observe(t), n(this.n.bind(this)), this.dispatch("media-player-connect", {
|
|
123
|
+
detail: this.el,
|
|
124
|
+
bubbles: !0,
|
|
125
|
+
composed: !0
|
|
126
|
+
}), () => {
|
|
127
|
+
s.disconnect(), e.onchange = null;
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
w() {
|
|
131
|
+
var e;
|
|
132
|
+
const t = {
|
|
133
|
+
viewType: "providedViewType",
|
|
134
|
+
streamType: "providedStreamType"
|
|
135
|
+
};
|
|
136
|
+
for (const s of Object.keys(this.$props))
|
|
137
|
+
(e = this.$store[t[s] ?? s]) == null || e.set(this.$props[s]());
|
|
138
|
+
n(this.K.bind(this)), this.$store.muted.set(this.$props.muted() || this.$props.volume() === 0);
|
|
139
|
+
}
|
|
140
|
+
y() {
|
|
141
|
+
var $, T, f;
|
|
142
|
+
const { title: t } = this.$props, { live: e, viewType: s } = this.$store, h = e(), u = X(s()), b = u !== "Unknown" ? `${h ? "Live " : ""}${u}` : h ? "Live" : "Media", m = t();
|
|
143
|
+
m && (($ = this.el) == null || $.setAttribute("data-title", m), (T = this.el) == null || T.removeAttribute("title"));
|
|
144
|
+
const c = ((f = this.el) == null ? void 0 : f.getAttribute("data-title")) || "";
|
|
145
|
+
this.$store.title.set(c), y(
|
|
146
|
+
this.el,
|
|
147
|
+
"aria-label",
|
|
148
|
+
c ? `${b} - ${c}` : b + " Player"
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
z() {
|
|
152
|
+
const t = this.orientation.landscape ? "landscape" : "portrait";
|
|
153
|
+
this.$store.orientation.set(t), y(this.el, "data-orientation", t), this.n();
|
|
154
|
+
}
|
|
155
|
+
A() {
|
|
156
|
+
this.$store.canPlay() && this.q ? this.s.O() : this.s.P();
|
|
157
|
+
}
|
|
158
|
+
K() {
|
|
159
|
+
this.$store.providedViewType.set(this.$props.viewType()), this.$store.providedStreamType.set(this.$props.streamType());
|
|
160
|
+
}
|
|
161
|
+
H() {
|
|
162
|
+
const t = {
|
|
163
|
+
"aspect-ratio": this.$props.aspectRatio,
|
|
164
|
+
"data-captions": () => {
|
|
165
|
+
const s = this.$store.textTrack();
|
|
166
|
+
return !!s && st(s);
|
|
167
|
+
},
|
|
168
|
+
"data-ios-controls": this.j.$iosControls
|
|
169
|
+
}, e = {
|
|
170
|
+
canPictureInPicture: "can-pip",
|
|
171
|
+
pictureInPicture: "pip"
|
|
172
|
+
};
|
|
173
|
+
for (const s of U) {
|
|
174
|
+
const h = "data-" + (e[s] ?? Y(s));
|
|
175
|
+
t[h] = this.$store[s];
|
|
176
|
+
}
|
|
177
|
+
delete t.title, this.setAttributes(t);
|
|
178
|
+
}
|
|
179
|
+
I() {
|
|
180
|
+
this.setCSSVars({
|
|
181
|
+
"--media-aspect-ratio": () => {
|
|
182
|
+
const t = this.$props.aspectRatio();
|
|
183
|
+
return t ? +t.toFixed(4) : null;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
J(t) {
|
|
188
|
+
t.detail(this.el);
|
|
189
|
+
}
|
|
190
|
+
n() {
|
|
191
|
+
if (!this.el)
|
|
192
|
+
return;
|
|
193
|
+
const t = this.el.clientWidth, e = this.el.clientHeight, { smallBreakpointX: s, smallBreakpointY: h, largeBreakpointX: u, largeBreakpointY: b } = this.$props, m = t < s() ? "sm" : t < u() ? "md" : "lg", c = e < h() ? "sm" : e < b() ? "md" : "lg";
|
|
194
|
+
this.$store.breakpointX.set(m), this.$store.breakpointY.set(c), y(this.el, "data-bp-x", m), y(this.el, "data-bp-y", c);
|
|
195
|
+
}
|
|
196
|
+
v(t) {
|
|
197
|
+
const e = t.matches;
|
|
198
|
+
y(this.el, "data-touch", e), this.$store.touchPointer.set(e), this.n();
|
|
199
|
+
}
|
|
200
|
+
x() {
|
|
201
|
+
return !J() && this.$store.mediaType() === "video" && (this.$store.controls() && !this.$props.playsinline() || this.$store.fullscreen());
|
|
202
|
+
}
|
|
203
|
+
get provider() {
|
|
204
|
+
return this.q;
|
|
205
|
+
}
|
|
206
|
+
get user() {
|
|
207
|
+
return this.r.Q;
|
|
208
|
+
}
|
|
209
|
+
get qualities() {
|
|
210
|
+
return this.j.qualities;
|
|
211
|
+
}
|
|
212
|
+
get audioTracks() {
|
|
213
|
+
return this.j.audioTracks;
|
|
214
|
+
}
|
|
215
|
+
get textTracks() {
|
|
216
|
+
return this.j.textTracks;
|
|
217
|
+
}
|
|
218
|
+
get textRenderers() {
|
|
219
|
+
return this.j.textRenderers;
|
|
220
|
+
}
|
|
221
|
+
get paused() {
|
|
222
|
+
var t;
|
|
223
|
+
return ((t = this.q) == null ? void 0 : t.paused) ?? !0;
|
|
224
|
+
}
|
|
225
|
+
set paused(t) {
|
|
226
|
+
t ? this.s.t("paused", () => this.r.L()) : this.s.t("paused", () => this.r.M());
|
|
227
|
+
}
|
|
228
|
+
C() {
|
|
229
|
+
this.paused = this.$props.paused();
|
|
230
|
+
}
|
|
231
|
+
get muted() {
|
|
232
|
+
var t;
|
|
233
|
+
return ((t = this.q) == null ? void 0 : t.muted) ?? !1;
|
|
234
|
+
}
|
|
235
|
+
set muted(t) {
|
|
236
|
+
this.s.t("muted", () => this.q.muted = t);
|
|
237
|
+
}
|
|
238
|
+
B() {
|
|
239
|
+
this.muted = this.$props.muted();
|
|
240
|
+
}
|
|
241
|
+
get currentTime() {
|
|
242
|
+
var t;
|
|
243
|
+
return ((t = this.q) == null ? void 0 : t.currentTime) ?? 0;
|
|
244
|
+
}
|
|
245
|
+
set currentTime(t) {
|
|
246
|
+
this.s.t("currentTime", () => {
|
|
247
|
+
const e = this.q;
|
|
248
|
+
t !== e.currentTime && W(() => {
|
|
249
|
+
const s = Math.min(
|
|
250
|
+
Math.max(this.$store.seekableStart() + 0.1, t),
|
|
251
|
+
this.$store.seekableEnd() - 0.1
|
|
252
|
+
);
|
|
253
|
+
Number.isFinite(s) && (e.currentTime = s);
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
E() {
|
|
258
|
+
this.currentTime = this.$props.currentTime();
|
|
259
|
+
}
|
|
260
|
+
get volume() {
|
|
261
|
+
var t;
|
|
262
|
+
return ((t = this.q) == null ? void 0 : t.volume) ?? 1;
|
|
263
|
+
}
|
|
264
|
+
set volume(t) {
|
|
265
|
+
this.s.t("volume", () => this.q.volume = t);
|
|
266
|
+
}
|
|
267
|
+
D() {
|
|
268
|
+
this.volume = at(0, this.$props.volume(), 1);
|
|
269
|
+
}
|
|
270
|
+
get playsinline() {
|
|
271
|
+
var t;
|
|
272
|
+
return ((t = this.q) == null ? void 0 : t.playsinline) ?? !1;
|
|
273
|
+
}
|
|
274
|
+
set playsinline(t) {
|
|
275
|
+
this.s.t("playsinline", () => this.q.playsinline = t);
|
|
276
|
+
}
|
|
277
|
+
F() {
|
|
278
|
+
this.playsinline = this.$props.playsinline();
|
|
279
|
+
}
|
|
280
|
+
get playbackRate() {
|
|
281
|
+
var t;
|
|
282
|
+
return ((t = this.q) == null ? void 0 : t.playbackRate) ?? 1;
|
|
283
|
+
}
|
|
284
|
+
set playbackRate(t) {
|
|
285
|
+
this.s.t("rate", () => this.q.playbackRate = t);
|
|
286
|
+
}
|
|
287
|
+
G() {
|
|
288
|
+
this.playbackRate = this.$props.playbackRate();
|
|
289
|
+
}
|
|
290
|
+
async play() {
|
|
291
|
+
return this.r.M();
|
|
292
|
+
}
|
|
293
|
+
async pause() {
|
|
294
|
+
return this.r.L();
|
|
295
|
+
}
|
|
296
|
+
async enterFullscreen(t) {
|
|
297
|
+
return this.r.R(t);
|
|
298
|
+
}
|
|
299
|
+
async exitFullscreen(t) {
|
|
300
|
+
return this.r.S(t);
|
|
301
|
+
}
|
|
302
|
+
enterPictureInPicture() {
|
|
303
|
+
return this.r.T();
|
|
304
|
+
}
|
|
305
|
+
exitPictureInPicture() {
|
|
306
|
+
return this.r.U();
|
|
307
|
+
}
|
|
308
|
+
seekToLiveEdge() {
|
|
309
|
+
this.r.V();
|
|
310
|
+
}
|
|
311
|
+
startLoading() {
|
|
312
|
+
this.j.delegate.p("can-load");
|
|
313
|
+
}
|
|
314
|
+
destroy() {
|
|
315
|
+
this.dispatch("destroy");
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
l(i, "el", P({
|
|
319
|
+
tagName: "media-player",
|
|
320
|
+
props: q,
|
|
321
|
+
store: R
|
|
322
|
+
}));
|
|
323
|
+
a([
|
|
324
|
+
o
|
|
325
|
+
], i.prototype, "provider", 1);
|
|
326
|
+
a([
|
|
327
|
+
o
|
|
328
|
+
], i.prototype, "user", 1);
|
|
329
|
+
a([
|
|
330
|
+
o
|
|
331
|
+
], i.prototype, "orientation", 2);
|
|
332
|
+
a([
|
|
333
|
+
o
|
|
334
|
+
], i.prototype, "qualities", 1);
|
|
335
|
+
a([
|
|
336
|
+
o
|
|
337
|
+
], i.prototype, "audioTracks", 1);
|
|
338
|
+
a([
|
|
339
|
+
o
|
|
340
|
+
], i.prototype, "textTracks", 1);
|
|
341
|
+
a([
|
|
342
|
+
o
|
|
343
|
+
], i.prototype, "textRenderers", 1);
|
|
344
|
+
a([
|
|
345
|
+
o
|
|
346
|
+
], i.prototype, "paused", 1);
|
|
347
|
+
a([
|
|
348
|
+
o
|
|
349
|
+
], i.prototype, "muted", 1);
|
|
350
|
+
a([
|
|
351
|
+
o
|
|
352
|
+
], i.prototype, "currentTime", 1);
|
|
353
|
+
a([
|
|
354
|
+
o
|
|
355
|
+
], i.prototype, "volume", 1);
|
|
356
|
+
a([
|
|
357
|
+
o
|
|
358
|
+
], i.prototype, "playsinline", 1);
|
|
359
|
+
a([
|
|
360
|
+
o
|
|
361
|
+
], i.prototype, "playbackRate", 1);
|
|
362
|
+
a([
|
|
363
|
+
d
|
|
364
|
+
], i.prototype, "play", 1);
|
|
365
|
+
a([
|
|
366
|
+
d
|
|
367
|
+
], i.prototype, "pause", 1);
|
|
368
|
+
a([
|
|
369
|
+
d
|
|
370
|
+
], i.prototype, "enterFullscreen", 1);
|
|
371
|
+
a([
|
|
372
|
+
d
|
|
373
|
+
], i.prototype, "exitFullscreen", 1);
|
|
374
|
+
a([
|
|
375
|
+
d
|
|
376
|
+
], i.prototype, "enterPictureInPicture", 1);
|
|
377
|
+
a([
|
|
378
|
+
d
|
|
379
|
+
], i.prototype, "exitPictureInPicture", 1);
|
|
380
|
+
a([
|
|
381
|
+
d
|
|
382
|
+
], i.prototype, "seekToLiveEdge", 1);
|
|
383
|
+
a([
|
|
384
|
+
d
|
|
385
|
+
], i.prototype, "startLoading", 1);
|
|
386
|
+
g(i);
|
|
387
|
+
g(it);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var $=Object.defineProperty;var T=(a,o,t)=>o in a?$(a,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[o]=t;var h=(a,o,t)=>T(a,typeof o!="symbol"?o+"":o,t);const e=require("./media-core-Rxz2MNwG.cjs"),b=require("./media-ui-zZVnK1ts.cjs");class g{constructor(){h(this,"_e",!1);h(this,"$e",e.deferredPromise());h(this,"Ze",new Map)}get df(){return this.Ze.size}get ef(){return this._e}async ff(){this._e||await this.$e.promise}t(o,t){if(this._e){t();return}this.Ze.delete(o),this.Ze.set(o,t)}cf(o){var t;(t=this.Ze.get(o))==null||t(),this.Ze.delete(o)}O(){this.af(),this._e=!0,this.Ze.size>0&&this.af()}P(){this._e=!1}gf(){this.P(),this.Ze.clear(),this.bf()}af(){for(const o of this.Ze.keys())this.cf(o);this.bf()}bf(){this.$e.resolve(),this.$e=e.deferredPromise()}}var v=Object.defineProperty,w=Object.getOwnPropertyDescriptor,n=(a,o,t,s)=>{for(var i=s>1?void 0:s?w(o,t):o,p=a.length-1,u;p>=0;p--)(u=a[p])&&(i=(s?u(o,t,i):u(i))||i);return s&&i&&v(o,t,i),i};class r extends e.Component{constructor(t){super(t);h(this,"j");h(this,"u");h(this,"r");h(this,"s",new g);h(this,"orientation");this.w(),new e.MediaStoreSync(t);const s={player:null,scope:e.getScope(),qualities:new e.VideoQualityList,audioTracks:new e.AudioTrackList,$provider:e.signal(null),$props:this.$props,$store:this.$store};s.remote=new e.MediaRemoteControl(void 0),s.$iosControls=e.computed(this.x.bind(this)),s.textTracks=new e.TextTrackList,s.textTracks[e.TEXT_TRACK_CROSSORIGIN]=this.$props.crossorigin,s.textRenderers=new e.TextRenderers(s),s.ariaKeys={},this.j=s,e.provideContext(e.mediaContext,s),this.orientation=new e.ScreenOrientationController(t),new b.FocusVisibleController(t),new e.MediaKeyboardController(t,s),new e.ThumbnailsLoader(t);const i=new e.MediaRequestContext;this.u=new e.MediaStateManager(t,i,s),this.r=new e.MediaRequestManager(t,this.u,i,s),s.delegate=new e.MediaPlayerDelegate(this.u.N.bind(this.u),s),new e.MediaLoadController(t,this.startLoading.bind(this))}get q(){return this.j.$provider()}onAttach(t){t.setAttribute("tabindex","0"),e.setAttributeIfEmpty(t,"role","region"),e.effect(this.y.bind(this)),e.effect(this.z.bind(this)),e.effect(this.A.bind(this)),e.effect(this.B.bind(this)),e.effect(this.C.bind(this)),e.effect(this.D.bind(this)),e.effect(this.E.bind(this)),e.effect(this.F.bind(this)),e.effect(this.G.bind(this)),this.H(),this.I(),this.j.player=t,this.j.remote.setTarget(t),this.j.remote.setPlayer(t),e.listenEvent(t,"find-media-player",this.J.bind(this))}onConnect(t){e.IS_IPHONE&&e.setAttribute(t,"data-iphone","");const s=window.matchMedia("(pointer: coarse)");this.v(s),s.onchange=this.v.bind(this);const i=new ResizeObserver(this.n.bind(this));return i.observe(t),e.effect(this.n.bind(this)),this.dispatch("media-player-connect",{detail:this.el,bubbles:!0,composed:!0}),()=>{i.disconnect(),s.onchange=null}}w(){var s;const t={viewType:"providedViewType",streamType:"providedStreamType"};for(const i of Object.keys(this.$props))(s=this.$store[t[i]??i])==null||s.set(this.$props[i]());e.effect(this.K.bind(this)),this.$store.muted.set(this.$props.muted()||this.$props.volume()===0)}y(){var m,y,f;const{title:t}=this.$props,{live:s,viewType:i}=this.$store,p=s(),u=e.uppercaseFirstChar(i()),c=u!=="Unknown"?`${p?"Live ":""}${u}`:p?"Live":"Media",d=t();d&&((m=this.el)==null||m.setAttribute("data-title",d),(y=this.el)==null||y.removeAttribute("title"));const l=((f=this.el)==null?void 0:f.getAttribute("data-title"))||"";this.$store.title.set(l),e.setAttribute(this.el,"aria-label",l?`${c} - ${l}`:c+" Player")}z(){const t=this.orientation.landscape?"landscape":"portrait";this.$store.orientation.set(t),e.setAttribute(this.el,"data-orientation",t),this.n()}A(){this.$store.canPlay()&&this.q?this.s.O():this.s.P()}K(){this.$store.providedViewType.set(this.$props.viewType()),this.$store.providedStreamType.set(this.$props.streamType())}H(){const t={"aspect-ratio":this.$props.aspectRatio,"data-captions":()=>{const i=this.$store.textTrack();return!!i&&e.isTrackCaptionKind(i)},"data-ios-controls":this.j.$iosControls},s={canPictureInPicture:"can-pip",pictureInPicture:"pip"};for(const i of e.MEDIA_ATTRIBUTES){const p="data-"+(s[i]??e.camelToKebabCase(i));t[p]=this.$store[i]}delete t.title,this.setAttributes(t)}I(){this.setCSSVars({"--media-aspect-ratio":()=>{const t=this.$props.aspectRatio();return t?+t.toFixed(4):null}})}J(t){t.detail(this.el)}n(){if(!this.el)return;const t=this.el.clientWidth,s=this.el.clientHeight,{smallBreakpointX:i,smallBreakpointY:p,largeBreakpointX:u,largeBreakpointY:c}=this.$props,d=t<i()?"sm":t<u()?"md":"lg",l=s<p()?"sm":s<c()?"md":"lg";this.$store.breakpointX.set(d),this.$store.breakpointY.set(l),e.setAttribute(this.el,"data-bp-x",d),e.setAttribute(this.el,"data-bp-y",l)}v(t){const s=t.matches;e.setAttribute(this.el,"data-touch",s),this.$store.touchPointer.set(s),this.n()}x(){return!e.canFullscreen()&&this.$store.mediaType()==="video"&&(this.$store.controls()&&!this.$props.playsinline()||this.$store.fullscreen())}get provider(){return this.q}get user(){return this.r.Q}get qualities(){return this.j.qualities}get audioTracks(){return this.j.audioTracks}get textTracks(){return this.j.textTracks}get textRenderers(){return this.j.textRenderers}get paused(){var t;return((t=this.q)==null?void 0:t.paused)??!0}set paused(t){t?this.s.t("paused",()=>this.r.L()):this.s.t("paused",()=>this.r.M())}C(){this.paused=this.$props.paused()}get muted(){var t;return((t=this.q)==null?void 0:t.muted)??!1}set muted(t){this.s.t("muted",()=>this.q.muted=t)}B(){this.muted=this.$props.muted()}get currentTime(){var t;return((t=this.q)==null?void 0:t.currentTime)??0}set currentTime(t){this.s.t("currentTime",()=>{const s=this.q;t!==s.currentTime&&e.peek(()=>{const i=Math.min(Math.max(this.$store.seekableStart()+.1,t),this.$store.seekableEnd()-.1);Number.isFinite(i)&&(s.currentTime=i)})})}E(){this.currentTime=this.$props.currentTime()}get volume(){var t;return((t=this.q)==null?void 0:t.volume)??1}set volume(t){this.s.t("volume",()=>this.q.volume=t)}D(){this.volume=b.clampNumber(0,this.$props.volume(),1)}get playsinline(){var t;return((t=this.q)==null?void 0:t.playsinline)??!1}set playsinline(t){this.s.t("playsinline",()=>this.q.playsinline=t)}F(){this.playsinline=this.$props.playsinline()}get playbackRate(){var t;return((t=this.q)==null?void 0:t.playbackRate)??1}set playbackRate(t){this.s.t("rate",()=>this.q.playbackRate=t)}G(){this.playbackRate=this.$props.playbackRate()}async play(){return this.r.M()}async pause(){return this.r.L()}async enterFullscreen(t){return this.r.R(t)}async exitFullscreen(t){return this.r.S(t)}enterPictureInPicture(){return this.r.T()}exitPictureInPicture(){return this.r.U()}seekToLiveEdge(){this.r.V()}startLoading(){this.j.delegate.p("can-load")}destroy(){this.dispatch("destroy")}}h(r,"el",e.defineElement({tagName:"media-player",props:e.mediaPlayerProps,store:e.MediaStoreFactory}));n([e.prop],r.prototype,"provider",1);n([e.prop],r.prototype,"user",1);n([e.prop],r.prototype,"orientation",2);n([e.prop],r.prototype,"qualities",1);n([e.prop],r.prototype,"audioTracks",1);n([e.prop],r.prototype,"textTracks",1);n([e.prop],r.prototype,"textRenderers",1);n([e.prop],r.prototype,"paused",1);n([e.prop],r.prototype,"muted",1);n([e.prop],r.prototype,"currentTime",1);n([e.prop],r.prototype,"volume",1);n([e.prop],r.prototype,"playsinline",1);n([e.prop],r.prototype,"playbackRate",1);n([e.method],r.prototype,"play",1);n([e.method],r.prototype,"pause",1);n([e.method],r.prototype,"enterFullscreen",1);n([e.method],r.prototype,"exitFullscreen",1);n([e.method],r.prototype,"enterPictureInPicture",1);n([e.method],r.prototype,"exitPictureInPicture",1);n([e.method],r.prototype,"seekToLiveEdge",1);n([e.method],r.prototype,"startLoading",1);e.registerLiteCustomElement(r);e.registerLiteCustomElement(e.Outlet);
|