@maveio/components 0.0.157 → 0.0.159
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/dist/{chunk-45FW5DBN.js → chunk-24TUG5TP.js} +1 -1
- package/dist/{chunk-KZOVSI7R.cjs → chunk-2UJ446RI.cjs} +13 -29
- package/dist/{chunk-Z5AM3NST.cjs → chunk-32WXLTTE.cjs} +2 -2
- package/dist/{chunk-4CDE2QCJ.js → chunk-6XR2OUZW.js} +1 -1
- package/dist/chunk-7ZRXZY5C.js +20 -0
- package/dist/{chunk-TVNAG7X4.cjs → chunk-B3QILQEE.cjs} +3 -3
- package/dist/{chunk-6MCTUE3H.js → chunk-CHHWULL2.js} +4 -4
- package/dist/chunk-DITZCOYN.cjs +379 -0
- package/dist/{chunk-MKZYI5TY.cjs → chunk-EOHKHSQ3.cjs} +1 -1
- package/dist/{chunk-KTGL4HLA.cjs → chunk-FUSQ4EZG.cjs} +2 -2
- package/dist/chunk-JHSFSCC2.cjs +1 -0
- package/dist/chunk-KA24PL7V.js +1 -0
- package/dist/{chunk-VZKW2VWI.js → chunk-KNAAIER3.js} +2 -2
- package/dist/{chunk-5KQJTT3P.cjs → chunk-KVMGCTLR.cjs} +1 -1
- package/dist/{chunk-JBRRVOTV.cjs → chunk-MLZIA6JO.cjs} +5 -5
- package/dist/chunk-MSWONVA7.cjs +20 -0
- package/dist/{chunk-4AYP3SUJ.js → chunk-NKEVN7FX.js} +1 -1
- package/dist/{chunk-PLCF3Z5Q.cjs → chunk-OTRPT6Y4.cjs} +4 -4
- package/dist/{chunk-PC26CFMJ.cjs → chunk-PHGKLFNF.cjs} +1 -1
- package/dist/{chunk-2AXZ5ZCT.js → chunk-QNX3YAVY.js} +7 -23
- package/dist/chunk-QSQE5WBN.js +35 -0
- package/dist/chunk-QZSLJNS4.js +7 -0
- package/dist/chunk-STJ6CEFZ.cjs +1468 -0
- package/dist/chunk-T2P4BAWY.js +379 -0
- package/dist/chunk-ULZI6OGL.js +1468 -0
- package/dist/{chunk-CUGRXOA2.js → chunk-XLUB3ATV.js} +1 -1
- package/dist/{chunk-6NWQAHZT.cjs → chunk-ZLS57S3I.cjs} +1 -1
- package/dist/components/audio-track-menu.cjs +1 -0
- package/dist/components/audio-track-menu.d.cts +27 -0
- package/dist/components/audio-track-menu.d.ts +27 -0
- package/dist/components/audio-track-menu.js +1 -0
- package/dist/components/clip.cjs +1 -1
- package/dist/components/clip.js +1 -1
- package/dist/components/files.cjs +1 -1
- package/dist/components/files.js +1 -1
- package/dist/components/img.cjs +1 -1
- package/dist/components/img.js +1 -1
- package/dist/components/list.cjs +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/player.cjs +1 -1
- package/dist/components/player.d.cts +8 -0
- package/dist/components/player.d.ts +8 -0
- package/dist/components/player.js +1 -1
- package/dist/components/pop.cjs +1 -1
- package/dist/components/pop.js +1 -1
- package/dist/components/text.cjs +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/upload.cjs +1 -1
- package/dist/components/upload.d.cts +5 -0
- package/dist/components/upload.d.ts +5 -0
- package/dist/components/upload.js +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.js +1 -1
- package/dist/embed/api.cjs +1 -1
- package/dist/embed/api.d.cts +11 -1
- package/dist/embed/api.d.ts +11 -1
- package/dist/embed/api.js +1 -1
- package/dist/embed/caption.cjs +1 -1
- package/dist/embed/caption.js +1 -1
- package/dist/embed/controller.cjs +1 -1
- package/dist/embed/controller.js +1 -1
- package/dist/embed/socket.cjs +1 -1
- package/dist/embed/socket.d.cts +3 -5
- package/dist/embed/socket.d.ts +3 -5
- package/dist/embed/socket.js +1 -1
- package/dist/generated/locales/de.cjs +1 -1
- package/dist/generated/locales/de.js +1 -1
- package/dist/generated/locales/en.cjs +1 -1
- package/dist/generated/locales/en.js +1 -1
- package/dist/generated/locales/fr.cjs +1 -1
- package/dist/generated/locales/fr.js +1 -1
- package/dist/generated/locales/nl.cjs +1 -1
- package/dist/generated/locales/nl.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/themes/default.cjs +53 -1
- package/dist/themes/default.js +53 -1
- package/dist/themes/dolphin.cjs +1 -1
- package/dist/themes/dolphin.js +1 -1
- package/dist/themes/loader.cjs +1 -1
- package/dist/themes/loader.js +1 -1
- package/dist/themes/synthwave.cjs +1 -1
- package/dist/themes/synthwave.js +1 -1
- package/dist/utils/localization.cjs +1 -1
- package/dist/utils/localization.js +1 -1
- package/dist/utils/mave_element.cjs +1 -1
- package/dist/utils/mave_element.js +1 -1
- package/dist/utils/origin.cjs +1 -1
- package/dist/utils/origin.js +1 -1
- package/dist/utils/video_events.cjs +1 -1
- package/dist/utils/video_events.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-5IPIXU3O.js +0 -1807
- package/dist/chunk-IBTJ5OMP.js +0 -35
- package/dist/chunk-IPA5Q26W.cjs +0 -1
- package/dist/chunk-LGWESJBJ.cjs +0 -20
- package/dist/chunk-NDDFZTBA.js +0 -1
- package/dist/chunk-SRXHXTDF.js +0 -7
- package/dist/chunk-ZMMJMM4X.cjs +0 -1807
- package/dist/chunk-ZT2E4EC7.js +0 -20
- /package/dist/{chunk-NI57YLPL.cjs → chunk-BVMU4ZXD.cjs} +0 -0
- /package/dist/{chunk-EXNM5EV2.js → chunk-DFLPNNA4.js} +0 -0
- /package/dist/{chunk-4GKJNXUA.js → chunk-FRPU6QLJ.js} +0 -0
package/dist/chunk-IBTJ5OMP.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-ZWTODZDA.js';import {a as a$3}from'./chunk-3R7TX6NC.js';import {a as a$2}from'./chunk-MS5NFI3Q.js';import {a,b}from'./chunk-HMISRRKC.js';import {h,i,f as f$1,c as c$1}from'./chunk-A4GZBQEB.js';import {c,e,f}from'./chunk-NDDFZTBA.js';var o,k,C,S,n=class extends i{constructor(){super(...arguments);e(this,o);this._clickable=true;this._autoscroll=true;this._lastScrollTime=0;this.currentTime=0;}get embed(){return this._embedId}set embed(t){this._embedId!=t&&(this._embedId=t,this.captionController=new a$1(this,this.embed),this.reset(),this.requestUpdate("embed"));}get clickable(){return this._clickable}set clickable(t){this._clickable!=t&&(typeof t=="string"?this._clickable=t==="true"||t==="":this._clickable=t,this.requestUpdate("clickable"));}get autoscroll(){return this._autoscroll}set autoscroll(t){this._autoscroll!=t&&(typeof t=="string"?this._autoscroll=t==="true"||t==="":this._autoscroll=t,this.requestUpdate("autoscroll"));}get wordIndex(){return this._wordIndex}set wordIndex(t){if(this._wordIndex!=t&&(this._wordIndex=t,this.autoscroll)){let e=this.shadowRoot?.querySelector(`[data-word-id="word-${this.segmentIndex}-${this.wordIndex}"]`);if(e&&this._lastScrollTime+2500<Date.now()){let r=this.getBoundingClientRect(),i=e.getBoundingClientRect(),s=i.top-r.top;if(s>0){let c=this.scrollTop+s;f(this,o,k).call(this,this,c-i.height/2);}}}}get segmentIndex(){return this._segmentIndex}set segmentIndex(t){this._segmentIndex!=t&&(this._segmentIndex=t);}connectedCallback(){super.connectedCallback(),this.addEventListener("scroll",f(this,o,C).bind(this)),this.reset();}reset(){if(typeof document>"u")return;this.loop=false,this.currentTime=0,this.wordIndex=0,this.segmentIndex=0;let t=document.querySelector(`mave-player[embed="${this.embed}"]`);t&&(this.player=t,t.addEventListener("play",()=>{this.loop=true,this.loopUpdateTime();}),t.addEventListener("pause",()=>{this.loop=false;}));}updateTime(){this.currentTime=this.player.currentTime;}loopUpdateTime(){this.updateTime(),setTimeout(()=>{this.loop&&requestAnimationFrame(this.loopUpdateTime.bind(this));},10);}inRange({start:t,end:e},r,i,s){if(this.currentTime>=t&&this.currentTime<=e)return s&&(this.wordIndex=s),i&&(this.segmentIndex=i),r||true}segmentStyle(){return this.clickable?{cursor:"pointer"}:{}}wordStyle(t){return t?{"background-color":this.highlight}:{}}render(){return this.captionController?this.captionController.render({complete:t=>(this.captions=t,c$1`
|
|
2
|
-
<div>
|
|
3
|
-
${this.captions.segments.map((e,r)=>c$1`
|
|
4
|
-
<p
|
|
5
|
-
data-segment-id="segment-${r}"
|
|
6
|
-
style=${a$2(this.segmentStyle())}
|
|
7
|
-
@click=${this.clickable?f(this,o,S):f$1}
|
|
8
|
-
part=${a$3(this.inRange(e,"segment"))}
|
|
9
|
-
x-caption-segment-start="${e.start}"
|
|
10
|
-
x-caption-segment-end="${e.end}"
|
|
11
|
-
>
|
|
12
|
-
${e.words.map((i,s)=>c$1`
|
|
13
|
-
<span
|
|
14
|
-
data-word-id="word-${r}-${s}"
|
|
15
|
-
style=${a$2(this.wordStyle(this.inRange(i)))}
|
|
16
|
-
part=${a$3(this.inRange(i,"word",r,s))}
|
|
17
|
-
x-caption-word-start="${i.start}"
|
|
18
|
-
x-caption-word-end="${i.end}"
|
|
19
|
-
>${i.word.trim()}</span
|
|
20
|
-
>
|
|
21
|
-
`)}
|
|
22
|
-
</p>
|
|
23
|
-
`)}
|
|
24
|
-
</div>
|
|
25
|
-
`)}):f$1}};o=new WeakSet,k=function(t,e,r=500){let i=this.scrollTop,s=e-i,c=null,p=false;function w(l){c||(c=l);let y=l-c,v=Math.min(y/r,1);t.scrollTop=i+s*x(v),y<r&&p?requestAnimationFrame(w):p=false;}function x(l){return l<.5?2*l*l:1-Math.pow(-2*l+2,2)/2}p=true,requestAnimationFrame(w);},C=function(){this._lastScrollTime=Date.now();},S=function(t){if(this.clickable){let e=t.target.closest("p");if(e&&this.player){let r=e.getAttribute("x-caption-segment-start");this.player.currentTime=Number(r),this.player.paused&&this.player.play();}}},n.styles=h`
|
|
26
|
-
:host {
|
|
27
|
-
display: block;
|
|
28
|
-
width: 100%;
|
|
29
|
-
height: 100%;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
[part='word'] {
|
|
33
|
-
background-color: rgba(255, 210, 42, 0.5);
|
|
34
|
-
}
|
|
35
|
-
`,c([a()],n.prototype,"embed",1),c([a()],n.prototype,"highlight",2),c([a()],n.prototype,"clickable",1),c([a()],n.prototype,"autoscroll",1),c([b()],n.prototype,"currentTime",2),c([b()],n.prototype,"captions",2);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-text")||window.customElements.define("mave-text",n));export{n as a};
|
package/dist/chunk-IPA5Q26W.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var l=Object.create;var h=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var n=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty;var j=b=>{throw TypeError(b)};var q=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var p=(b,a,c,e)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of m(a))!o.call(b,d)&&d!==c&&h(b,d,{get:()=>a[d],enumerable:!(e=i(a,d))||e.enumerable});return b};var r=(b,a,c)=>(c=b!=null?l(n(b)):{},p(a||!b||!b.__esModule?h(c,"default",{value:b,enumerable:true}):c,b));var s=(b,a,c,e)=>{for(var d=e>1?void 0:e?i(a,c):a,f=b.length-1,g;f>=0;f--)(g=b[f])&&(d=(e?g(a,c,d):g(d))||d);return e&&d&&h(a,c,d),d};var k=(b,a,c)=>a.has(b)||j("Cannot "+c);var t=(b,a,c)=>(k(b,a,"read from private field"),c?c.call(b):a.get(b)),u=(b,a,c)=>a.has(b)?j("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(b):a.set(b,c);var v=(b,a,c)=>(k(b,a,"access private method"),c);exports.a=q;exports.b=r;exports.c=s;exports.d=t;exports.e=u;exports.f=v;
|
package/dist/chunk-LGWESJBJ.cjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkYT56YDUY_cjs=require('./chunk-YT56YDUY.cjs'),chunkMKZYI5TY_cjs=require('./chunk-MKZYI5TY.cjs'),chunkFUBUUA7Y_cjs=require('./chunk-FUBUUA7Y.cjs'),chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs'),chunkIPA5Q26W_cjs=require('./chunk-IPA5Q26W.cjs');var t,l,C,x,b,v,y,z,L,T,U,f=class extends chunkMKZYI5TY_cjs.a{constructor(){super(...arguments);chunkIPA5Q26W_cjs.e(this,t);this.embedController=new chunkYT56YDUY_cjs.b(this);}get embed(){return this._embed}set embed(e){this._embed!==e&&(this._embed=e,this.requestUpdate("embed"),this.embedController.embed=this.embed);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:true})||[]}render(){return chunk5NSCV6C2_cjs.c`
|
|
2
|
-
${this.embedController.render({pending:this.renderPending,complete:e=>{if(this._data=e,!e)return;let i=chunkIPA5Q26W_cjs.f(this,t,T).call(this),n=chunkIPA5Q26W_cjs.f(this,t,U).call(this),o=this._slottedChildren.map(d=>{function m(){let r;return d.nodeName==="TEMPLATE"?r=d.content.cloneNode(true):r=d.cloneNode(true),r}if(d.getAttribute("name")=="mave-files-video"){if(!i)return;let r=m(),a=Number(this._data.created_at),h=a&&a<1e12?a*1e3:a;Number.isFinite(h)&&chunkIPA5Q26W_cjs.f(this,t,l).call(this,r,"date",new Date(h).toLocaleDateString().replaceAll("/","-"));let p=this._data.video.duration;p&&chunkIPA5Q26W_cjs.f(this,t,l).call(this,r,"duration",this.durationToTime(p));let u=this._data.video.filetype;u&&chunkIPA5Q26W_cjs.f(this,t,l).call(this,r,"filetype",u);let _=i.file_size||this._data.video.size;_&&chunkIPA5Q26W_cjs.f(this,t,l).call(this,r,"size",chunkIPA5Q26W_cjs.f(this,t,v).call(this,_));let M=chunkIPA5Q26W_cjs.f(this,t,z).call(this,i),S=i.container||"mp4",g=chunkIPA5Q26W_cjs.f(this,t,b).call(this,M,`${this._data.name}.${S}`);return g.setAttribute("aria-label","Download video"),g.appendChild(r),chunk5NSCV6C2_cjs.c`${g}`}if(n&&this._data.video.audio&&d.getAttribute("name")=="mave-files-audio"){let r=m(),a=n.container||"mp3";chunkIPA5Q26W_cjs.f(this,t,l).call(this,r,"filetype",a);let h=n.file_size;h&&chunkIPA5Q26W_cjs.f(this,t,l).call(this,r,"size",chunkIPA5Q26W_cjs.f(this,t,v).call(this,h));let p=chunkIPA5Q26W_cjs.f(this,t,L).call(this,n),u=chunkIPA5Q26W_cjs.f(this,t,b).call(this,p,`${this._data.name}.${a}`);return u.setAttribute("aria-label","Download audio"),u.appendChild(r),chunk5NSCV6C2_cjs.c`${u}`}let w=this._data.subtitles.find(r=>r.language==this._data.video.language);if(w&&d.getAttribute("name")=="mave-files-subtitles"){let r=m();chunkIPA5Q26W_cjs.f(this,t,l).call(this,r,"filetype","vtt");let a=chunkIPA5Q26W_cjs.f(this,t,b).call(this,w.path,`${this._data.name}.vtt`);return a.setAttribute("aria-label","Download subtitles"),a.appendChild(r),chunk5NSCV6C2_cjs.c`${a}`}});return chunk5NSCV6C2_cjs.c`${this._stylesheets} ${o}`}})}
|
|
3
|
-
`}renderPending(){return chunk5NSCV6C2_cjs.c`<slot style="display: none"></slot>`}};t=new WeakSet,l=function(e,i,n){let o=e.querySelector(`[slot="${i}"], [data-slot="${i}"]`);o&&(o.textContent=n,o.removeAttribute("slot"),o.removeAttribute("data-slot"));},C=function(e,i){let n=window.URL.createObjectURL(e),o=document.createElement("a");o.style.display="none",o.href=n,o.download=i,this.appendChild(o),o.click(),window.URL.revokeObjectURL(n),this.removeChild(o);},x=function(e,i){return fetch(e).then(n=>{if(!n.ok)throw new Error("Network response was not ok");return n.blob()}).then(n=>chunkIPA5Q26W_cjs.f(this,t,C).call(this,n,i)).catch(n=>console.error("Something went wrong:",n))},b=function(e,i){let n=document.createElement("a");n.classList.add("link"),n.setAttribute("href",e),n.setAttribute("download",i),n.setAttribute("target","new");let o=false;return n.addEventListener("click",d=>{d.preventDefault(),!o&&(o=true,n.style.cursor="wait",n.style.opacity="0.5",chunkIPA5Q26W_cjs.f(this,t,x).call(this,e,i).then(()=>{o=false,n.style.cursor="pointer",n.style.opacity="1";}));}),n},v=function(e){let i=e/1e6;return i>=10?`${i.toFixed(0)} MB`:`${i.toFixed(1)} MB`},y=function(e){let i=this._data?.video?.version&&this._data.video.version>0?`v${this._data.video.version}/`:"";return `${this.cdn_root}/${this.embedId}/${i}${e}`},z=function(e){let i=e?.codec||"h264",n=e?.size||"hd",o=e?.container||"mp4";return chunkIPA5Q26W_cjs.f(this,t,y).call(this,`${i}_${n}.${o}`)},L=function(e){let i=e?.container||"mp3";return chunkIPA5Q26W_cjs.f(this,t,y).call(this,`audio.${i}`)},T=function(){let e=this._data?.video?.renditions||[];if(!e.length)return;let i=e.filter(o=>o.container==="mp4"&&o.codec==="h264"&&(!o.type||o.type==="video")),n=["hd","fhd","sd","qhd","uhd"];for(let o of n){let d=i.find(m=>m.size===o);if(d)return d}return i[0]||e.find(o=>o.type==="video")},U=function(){let e=this._data?.video?.renditions||[];if(e.length)return e.find(i=>i.type==="audio"||i.container==="mp3"||i.codec==="mp3")},f.styles=chunk5NSCV6C2_cjs.h`
|
|
4
|
-
:host {
|
|
5
|
-
display: block;
|
|
6
|
-
--link-color: #006fc6;
|
|
7
|
-
--link-decoration: underline;
|
|
8
|
-
--link-decoration-thickness: 1px;
|
|
9
|
-
--link-decoration-offset: 1px;
|
|
10
|
-
--link-cursor: pointer;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
a {
|
|
14
|
-
text-decoration: var(--link-decoration);
|
|
15
|
-
text-decoration-thickness: var(--link-decoration-thickness);
|
|
16
|
-
text-underline-offset: var(--link-decoration-thickness);
|
|
17
|
-
color: var(--link-color);
|
|
18
|
-
cursor: var(--link-cursor);
|
|
19
|
-
}
|
|
20
|
-
`,chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a({type:String})],f.prototype,"embed",1);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-files")||window.customElements.define("mave-files",f));exports.a=f;
|
package/dist/chunk-NDDFZTBA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var l=Object.create;var h=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var n=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty;var j=b=>{throw TypeError(b)};var q=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var p=(b,a,c,e)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of m(a))!o.call(b,d)&&d!==c&&h(b,d,{get:()=>a[d],enumerable:!(e=i(a,d))||e.enumerable});return b};var r=(b,a,c)=>(c=b!=null?l(n(b)):{},p(a||!b||!b.__esModule?h(c,"default",{value:b,enumerable:true}):c,b));var s=(b,a,c,e)=>{for(var d=e>1?void 0:e?i(a,c):a,f=b.length-1,g;f>=0;f--)(g=b[f])&&(d=(e?g(a,c,d):g(d))||d);return e&&d&&h(a,c,d),d};var k=(b,a,c)=>a.has(b)||j("Cannot "+c);var t=(b,a,c)=>(k(b,a,"read from private field"),c?c.call(b):a.get(b)),u=(b,a,c)=>a.has(b)?j("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(b):a.set(b,c);var v=(b,a,c)=>(k(b,a,"access private method"),c);export{q as a,r as b,s as c,t as d,u as e,v as f};
|
package/dist/chunk-SRXHXTDF.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import {b as b$2}from'./chunk-4AYP3SUJ.js';import {b as b$1}from'./chunk-HX6F65VL.js';import {a as a$1}from'./chunk-45FW5DBN.js';import {a}from'./chunk-HMISRRKC.js';import {h as h$1,c as c$1,f as f$2}from'./chunk-A4GZBQEB.js';import {c,e,f as f$1}from'./chunk-NDDFZTBA.js';var n,C,b,h,f,p,u=class extends a$1{constructor(){super(...arguments);e(this,n);this.order="newest";this.embedController=new b$1(this,0);}connectedCallback(){super.connectedCallback(),this.embedController.token=this.token;}requestUpdate(e,o){super.requestUpdate(e,o),e==="embed"&&(this.embedController.token=this.token);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:true})||[]}updated(){this.shadowRoot&&b$2(this.shadowRoot);}refresh(){return this.embedController.refresh()}containsEmbed(e){return this._collection?.videos?.some(o=>o.id===e)}getNextForEmbed(e){let o=f$1(this,n,C).call(this),t=o.findIndex(s=>s.id===e);if(t!==-1)return o[t+1]}render(){return c$1`
|
|
2
|
-
${this.embedController.render({pending:this.renderPending,error:e=>c$1`<p>${e instanceof Error?e.message:f$2}</p>`,complete:e=>{if(this._collection=e,!e)return this.renderPending();if(e.error)return console.warn(e.error);let o=this._slottedChildren.map(t=>{function s(){let l;return t.nodeName==="TEMPLATE"?l=t.content.cloneNode(true):l=t.cloneNode(true),l}if(t.getAttribute("name")=="list-title"){let l=s();return l.textContent=this._collection?.name,c$1`${l}`}if(t.getAttribute("name")=="mave-list-root"&&this.embedController.embed){let l=s(),i=f$1(this,n,f).call(this,l,"root-link");return i&&(i.addEventListener("click",a=>{a.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"back",embedId:""}),this.embedController.embed="";}),f$1(this,n,p).call(this,i)),c$1`${l}`}if(t.getAttribute("name")=="mave-list-folder"){let l=this._collection.collections?.map(i=>{let a=s(),m=f$1(this,n,f).call(this,a,"folder-link");return [t,m].forEach(d=>{d instanceof Element&&(d.addEventListener("click",g=>{g.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"show_collection",collectionId:i.id}),this.embedController.embed=i.id;}),f$1(this,n,p).call(this,d));}),f$1(this,n,h).call(this,a,"folder-title",i.name),typeof i.video_count=="number"&&f$1(this,n,h).call(this,a,"folder-count",i.video_count.toString()),c$1`${a}`});return c$1`${l}`}if(t.getAttribute("name")=="mave-list-item"||!["mave-list-folder","mave-list-item","mave-list-root","list-title"].includes(t.hasAttribute("name")?t.getAttribute("name"):"")&&t.nodeName=="TEMPLATE"){let l=f$1(this,n,C).call(this).map((i,a)=>{let m=s(),d=a+1;f$1(this,n,h).call(this,m,"item-title",i.name),f$1(this,n,h).call(this,m,"item-position",d.toString()),f$1(this,n,h).call(this,m,"item-duration",this.durationToTime(i.duration)),f$1(this,n,b).call(this,m,"mave-clip",i.id),f$1(this,n,b).call(this,m,"mave-player",i.id),f$1(this,n,b).call(this,m,"mave-img",i.id);let g=m.querySelector("mave-clip"),S=f$1(this,n,f).call(this,m,"item-title"),$=m.querySelector("mave-img");return [g,S,$,m].forEach(P=>{P?.addEventListener("click",x=>{this.emit(this.EVENT_TYPES.CLICK,{action:"show_embed",embedId:i.id,position:d});});}),c$1`${m}`});return c$1`${l}`}}).filter(t=>t);return c$1`${this._stylesheets} ${o}`}})}
|
|
3
|
-
`}renderPending(){return c$1`<slot style="display: none"></slot>`}};n=new WeakSet,C=function(){if(!this._collection)return [];let e=this._collection.videos;return this.order=="newest"&&(e=this._collection.videos?.sort((o,t)=>t.created-o.created)),this.order=="oldest"&&(e=this._collection.videos?.sort((o,t)=>o.created-t.created)),this.order=="az"&&(e=this._collection.videos?.sort((o,t)=>o.name.localeCompare(t.name))),this.order=="za"&&(e=this._collection.videos?.sort((o,t)=>t.name.localeCompare(o.name))),e},b=function(e,o,t){let s=e.querySelector(o);s&&(s.setAttribute("embed",t),f$1(this,n,p).call(this,s));},h=function(e,o,t){let s=f$1(this,n,f).call(this,e,o);s&&(s.textContent=t,f$1(this,n,p).call(this,s));},f=function(e,o){return e.querySelector(`[slot="${o}"], [data-slot="${o}"]`)},p=function(e){e&&(e.removeAttribute("slot"),e.removeAttribute("data-slot"));},u.styles=h$1`
|
|
4
|
-
:host {
|
|
5
|
-
display: block;
|
|
6
|
-
}
|
|
7
|
-
`,c([a()],u.prototype,"token",2),c([a()],u.prototype,"order",2);typeof window<"u"&&window.customElements&&(window.customElements.get("mave-list")||window.customElements.define("mave-list",u));export{u as a};
|