@maveio/components 0.0.146 → 0.0.148

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.
Files changed (148) hide show
  1. package/dist/chunk-2C6BGW6H.js +10 -0
  2. package/dist/chunk-3GACH56T.js +20 -0
  3. package/dist/chunk-3GVDBAOP.cjs +1 -8
  4. package/dist/chunk-3PLBZPRP.js +1 -0
  5. package/dist/{chunk-AEKWMZ2I.js → chunk-3R7TX6NC.js} +2 -6
  6. package/dist/chunk-4GTAVYTC.cjs +93 -0
  7. package/dist/chunk-5KQJTT3P.cjs +24 -0
  8. package/dist/chunk-5NKBIUPL.cjs +1 -2
  9. package/dist/chunk-5NSCV6C2.cjs +53 -0
  10. package/dist/chunk-5OEIKFAN.js +93 -0
  11. package/dist/chunk-5STN56TL.cjs +2 -6
  12. package/dist/chunk-5UMTSGHI.cjs +37 -0
  13. package/dist/chunk-6NL5KOSJ.js +1209 -0
  14. package/dist/chunk-7LKYLXK5.js +104 -0
  15. package/dist/chunk-A4GZBQEB.js +53 -0
  16. package/dist/{chunk-JG6DKVEF.js → chunk-B6XMC3AJ.js} +2 -10
  17. package/dist/chunk-BRZI5I43.cjs +3 -8
  18. package/dist/chunk-COWZ7GYF.cjs +1 -0
  19. package/dist/chunk-CUGRXOA2.js +24 -0
  20. package/dist/chunk-DOR5AD7J.js +35 -0
  21. package/dist/{chunk-26S26OLO.cjs → chunk-FUBUUA7Y.cjs} +2 -10
  22. package/dist/chunk-GO5AXJUO.js +1 -6
  23. package/dist/chunk-H57FX4I6.cjs +9 -0
  24. package/dist/{chunk-R2QJ6RON.js → chunk-HMISRRKC.js} +2 -6
  25. package/dist/chunk-IPA5Q26W.cjs +1 -0
  26. package/dist/chunk-JBV2AYRP.js +2 -3
  27. package/dist/chunk-KCZRQ4AS.cjs +1 -10
  28. package/dist/chunk-KDE6VE72.js +37 -0
  29. package/dist/chunk-KTP5LV2E.cjs +1 -0
  30. package/dist/chunk-LCTGZL3L.js +2 -4
  31. package/dist/chunk-LG2O4WV2.cjs +2 -6
  32. package/dist/chunk-MAOTHFPC.js +1 -0
  33. package/dist/chunk-MK4VIJT3.js +1 -3
  34. package/dist/chunk-MMHEOMF5.js +1 -3
  35. package/dist/chunk-MS5NFI3Q.js +9 -0
  36. package/dist/{chunk-5XZY6X6O.cjs → chunk-N53P7KPA.cjs} +3 -14
  37. package/dist/chunk-NDDFZTBA.js +1 -0
  38. package/dist/chunk-O4SVRXZ6.cjs +20 -0
  39. package/dist/chunk-OOYAQ2X4.cjs +1209 -0
  40. package/dist/chunk-OZVIXWBD.cjs +104 -0
  41. package/dist/chunk-P4RYGSTU.cjs +35 -0
  42. package/dist/chunk-Q22T22LT.cjs +9 -0
  43. package/dist/chunk-RRCW5BBR.cjs +2 -8
  44. package/dist/chunk-SDKTBB4N.cjs +1 -5
  45. package/dist/chunk-TI75IJ2E.cjs +1 -7
  46. package/dist/chunk-TIOUPJWD.js +1 -0
  47. package/dist/chunk-TPP5OQFR.js +1 -5
  48. package/dist/chunk-U6N2SUDH.js +7 -0
  49. package/dist/chunk-URZX7GGF.cjs +7 -0
  50. package/dist/chunk-VW7IKXVI.cjs +1 -0
  51. package/dist/chunk-WE5NUDRY.js +0 -1
  52. package/dist/chunk-WLVMWIKH.cjs +10 -0
  53. package/dist/chunk-XSYWRQWB.js +1 -7
  54. package/dist/chunk-ZXCHPIGV.js +3 -6
  55. package/dist/components/clip.cjs +1 -21
  56. package/dist/components/clip.js +1 -12
  57. package/dist/components/files.cjs +1 -18
  58. package/dist/components/files.js +1 -9
  59. package/dist/components/img.cjs +1 -15
  60. package/dist/components/img.js +1 -6
  61. package/dist/components/list.cjs +1 -27
  62. package/dist/components/list.js +1 -18
  63. package/dist/components/player.cjs +1 -24
  64. package/dist/components/player.js +1 -15
  65. package/dist/components/pop.cjs +1 -30
  66. package/dist/components/pop.js +1 -17
  67. package/dist/components/text.cjs +1 -19
  68. package/dist/components/text.js +1 -10
  69. package/dist/components/upload.cjs +1 -20
  70. package/dist/components/upload.js +1 -11
  71. package/dist/config.cjs +1 -15
  72. package/dist/config.js +1 -2
  73. package/dist/embed/api.cjs +1 -12
  74. package/dist/embed/api.d.cts +1 -1
  75. package/dist/embed/api.d.ts +1 -1
  76. package/dist/embed/api.js +1 -3
  77. package/dist/embed/caption.cjs +1 -13
  78. package/dist/embed/caption.js +1 -4
  79. package/dist/embed/controller.cjs +1 -18
  80. package/dist/embed/controller.js +1 -5
  81. package/dist/embed/socket.cjs +1 -9
  82. package/dist/embed/socket.js +1 -3
  83. package/dist/generated/locales/de.cjs +1 -7
  84. package/dist/generated/locales/de.js +1 -5
  85. package/dist/generated/locales/en.cjs +1 -7
  86. package/dist/generated/locales/en.js +1 -5
  87. package/dist/generated/locales/fr.cjs +1 -7
  88. package/dist/generated/locales/fr.js +1 -5
  89. package/dist/generated/locales/nl.cjs +1 -7
  90. package/dist/generated/locales/nl.js +1 -5
  91. package/dist/index.cjs +1 -68
  92. package/dist/index.js +1 -27
  93. package/dist/lottie-player.esm-BBAKIFYQ.js +283 -0
  94. package/dist/lottie-player.esm-OYBEUNQX.cjs +283 -0
  95. package/dist/react.cjs +1 -50
  96. package/dist/react.js +1 -33
  97. package/dist/themes/default.cjs +12 -16
  98. package/dist/themes/default.js +12 -14
  99. package/dist/themes/dolphin.cjs +31 -19
  100. package/dist/themes/dolphin.js +31 -17
  101. package/dist/themes/loader.cjs +1 -13
  102. package/dist/themes/loader.js +1 -4
  103. package/dist/themes/synthwave.cjs +31 -19
  104. package/dist/themes/synthwave.js +31 -17
  105. package/dist/utils/localization.cjs +1 -24
  106. package/dist/utils/localization.js +1 -3
  107. package/dist/utils/mave_element.cjs +1 -14
  108. package/dist/utils/mave_element.js +1 -5
  109. package/dist/utils/origin.cjs +1 -11
  110. package/dist/utils/origin.d.cts +1 -1
  111. package/dist/utils/origin.d.ts +1 -1
  112. package/dist/utils/origin.js +1 -2
  113. package/dist/utils/video_events.cjs +1 -11
  114. package/dist/utils/video_events.js +1 -2
  115. package/package.json +4 -4
  116. package/dist/chunk-3TMDPPCI.cjs +0 -8
  117. package/dist/chunk-4OU2YZKL.cjs +0 -30
  118. package/dist/chunk-5C42H643.cjs +0 -10
  119. package/dist/chunk-5Y5M5ND5.cjs +0 -10
  120. package/dist/chunk-7NWFIY3O.cjs +0 -1218
  121. package/dist/chunk-A3PLFLYH.cjs +0 -46
  122. package/dist/chunk-B6BTCKVU.js +0 -16
  123. package/dist/chunk-BTPWX6DH.cjs +0 -17
  124. package/dist/chunk-CF5QCOBL.js +0 -14
  125. package/dist/chunk-E26F4RGL.js +0 -6
  126. package/dist/chunk-HZNWCQWL.js +0 -97
  127. package/dist/chunk-IFM2GZME.js +0 -55
  128. package/dist/chunk-JJNBEE42.js +0 -1216
  129. package/dist/chunk-KGTAAGUE.cjs +0 -65
  130. package/dist/chunk-LDQKDXUQ.js +0 -48
  131. package/dist/chunk-MHDCCX7Q.cjs +0 -34
  132. package/dist/chunk-MS3Q4WGR.cjs +0 -6
  133. package/dist/chunk-NR4EI5W5.js +0 -30
  134. package/dist/chunk-OLR7D3Q6.cjs +0 -15
  135. package/dist/chunk-OPVGT665.cjs +0 -114
  136. package/dist/chunk-P6GNG5DI.cjs +0 -18
  137. package/dist/chunk-QJP5WK2K.js +0 -44
  138. package/dist/chunk-R3PDNBU4.js +0 -3
  139. package/dist/chunk-RNHNE3HL.cjs +0 -101
  140. package/dist/chunk-UEEYC5OJ.cjs +0 -16
  141. package/dist/chunk-VOXORDG3.js +0 -8
  142. package/dist/chunk-XD2KSQMH.cjs +0 -50
  143. package/dist/chunk-XEE2D3NF.js +0 -28
  144. package/dist/chunk-ZFM2N7YP.js +0 -15
  145. package/dist/chunk-ZFZIJ4A5.js +0 -3
  146. package/dist/chunk-ZWBOG4VV.js +0 -114
  147. package/dist/lottie-player.esm-4DQZVY6A.cjs +0 -289
  148. package/dist/lottie-player.esm-5KD3VGXP.js +0 -287
@@ -0,0 +1,24 @@
1
+ import {b,c,a as a$1}from'./chunk-MMHEOMF5.js';import {g,f}from'./chunk-A4GZBQEB.js';import {a}from'./chunk-NDDFZTBA.js';var De=a((xe,pe)=>{var se=Object.defineProperty,ke=Object.getOwnPropertyDescriptor,Te=Object.getOwnPropertyNames,ye=Object.prototype.hasOwnProperty,Ce=(e,t)=>{for(var s in t)se(e,s,{get:t[s],enumerable:true});},we=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Te(t))!ye.call(e,n)&&n!==s&&se(e,n,{get:()=>t[n],enumerable:!(i=ke(t,n))||i.enumerable});return e},Ae=e=>we(se({},"__esModule",{value:true}),e),ie=(e,t,s)=>{if(!t.has(e))throw TypeError("Cannot "+s)},h=(e,t,s)=>(ie(e,t,"read from private field"),s?s.call(e):t.get(e)),d=(e,t,s)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,s);},p=(e,t,s,i)=>(ie(e,t,"write to private field"),t.set(e,s),s),w=(e,t,s)=>(ie(e,t,"access private method"),s),he={};Ce(he,{Metrics:()=>Pe});pe.exports=Ae(he);var H=e=>typeof e=="function"?e:function(){return e},Ee=typeof self<"u"?self:null,R=typeof window<"u"?window:null,E=Ee||R||E,$e="2.0.0",g={connecting:0,open:1,closing:2,closed:3},je=1e4,_e=1e3,m={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},v={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},z={longpoll:"longpoll",websocket:"websocket"},Re={complete:4},P=class{constructor(e,t,s,i){this.channel=e,this.event=t,this.payload=s||function(){return {}},this.receivedResp=null,this.timeout=i,this.timeoutTimer=null,this.recHooks=[],this.sent=false;}resend(e){this.timeout=e,this.reset(),this.send();}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=true,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}));}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=false;}matchReceive({status:e,response:t,_ref:s}){this.recHooks.filter(i=>i.status===e).forEach(i=>i.callback(t));}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent);}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null;}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e);}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{});},this.timeout);}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t});}},ce=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0;}reset(){this.tries=0,clearTimeout(this.timer);}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback();},this.timerCalc(this.tries+1));}},Se=class{constructor(e,t,s){this.state=m.closed,this.topic=e,this.params=H(t||{}),this.socket=s,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=false,this.joinPush=new P(this,v.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new ce(()=>{this.socket.isConnected()&&this.rejoin();},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin();})),this.joinPush.receive("ok",()=>{this.state=m.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[];}),this.joinPush.receive("error",()=>{this.state=m.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout();}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=m.closed,this.socket.remove(this);}),this.onError(i=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,i),this.isJoining()&&this.joinPush.reset(),this.state=m.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout();}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new P(this,v.leave,H({}),this.timeout).send(),this.state=m.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout();}),this.on(v.reply,(i,n)=>{this.trigger(this.replyEventName(n),i);});}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=true,this.rejoin(),this.joinPush}onClose(e){this.on(v.close,e);}onError(e){return this.on(v.error,t=>e(t))}on(e,t){let s=this.bindingRef++;return this.bindings.push({event:e,ref:s,callback:t}),s}off(e,t){this.bindings=this.bindings.filter(s=>!(s.event===e&&(typeof t>"u"||t===s.ref)));}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,s=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let i=new P(this,e,function(){return t},s);return this.canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=m.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(v.close,"leave");},s=new P(this,v.leave,H({}),e);return s.receive("ok",()=>t()).receive("timeout",()=>t()),s.send(),this.canPush()||s.trigger("ok",{}),s}onMessage(e,t,s){return t}isMember(e,t,s,i){return this.topic!==e?false:i&&i!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:s,joinRef:i}),false):true}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=m.joining,this.joinPush.resend(e));}trigger(e,t,s,i){let n=this.onMessage(e,t,s,i);if(t&&!n)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let r=this.bindings.filter(a=>a.event===e);for(let a=0;a<r.length;a++)r[a].callback(n,s,i||this.joinRef());}replyEventName(e){return `chan_reply_${e}`}isClosed(){return this.state===m.closed}isErrored(){return this.state===m.errored}isJoined(){return this.state===m.joined}isJoining(){return this.state===m.joining}isLeaving(){return this.state===m.leaving}},x=class{static request(e,t,s,i,n,r,a){if(E.XDomainRequest){let o=new E.XDomainRequest;return this.xdomainRequest(o,e,t,i,n,r,a)}else {let o=new E.XMLHttpRequest;return this.xhrRequest(o,e,t,s,i,n,r,a)}}static xdomainRequest(e,t,s,i,n,r,a){return e.timeout=n,e.open(t,s),e.onload=()=>{let o=this.parseJSON(e.responseText);a&&a(o);},r&&(e.ontimeout=r),e.onprogress=()=>{},e.send(i),e}static xhrRequest(e,t,s,i,n,r,a,o){return e.open(t,s,true),e.timeout=r,e.setRequestHeader("Content-Type",i),e.onerror=()=>o&&o(null),e.onreadystatechange=()=>{if(e.readyState===Re.complete&&o){let l=this.parseJSON(e.responseText);o(l);}},a&&(e.ontimeout=a),e.send(n),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let s=[];for(var i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let n=t?`${t}[${i}]`:i,r=e[i];typeof r=="object"?s.push(this.serialize(r,n)):s.push(encodeURIComponent(n)+"="+encodeURIComponent(r));}return s.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let s=e.match(/\?/)?"&":"?";return `${e}${s}${this.serialize(t)}`}},Me=e=>{let t="",s=new Uint8Array(e),i=s.byteLength;for(let n=0;n<i;n++)t+=String.fromCharCode(s[n]);return btoa(t)},_=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=true,this.reqs=new Set,this.awaitingBatchAck=false,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=g.connecting,setTimeout(()=>this.poll(),0);}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+z.websocket),"$1/"+z.longpoll)}endpointURL(){return x.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,s){this.close(e,t,s),this.readyState=g.connecting;}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",false);}isActive(){return this.readyState===g.open||this.readyState===g.connecting}poll(){this.ajax("GET","application/json",null,()=>this.ontimeout(),e=>{if(e){var{status:t,token:s,messages:i}=e;this.token=s;}else t=0;switch(t){case 200:i.forEach(n=>{setTimeout(()=>this.onmessage({data:n}),0);}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=g.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",false);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}});}send(e){typeof e!="string"&&(e=Me(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null;},0));}batchSend(e){this.awaitingBatchAck=true,this.ajax("POST","application/x-ndjson",e.join(`
2
+ `),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=false,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",false)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]);});}close(e,t,s){for(let n of this.reqs)n.abort();this.readyState=g.closed;let i=Object.assign({code:1e3,reason:void 0,wasClean:true},{code:e,reason:t,wasClean:s});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",i)):this.onclose(i);}ajax(e,t,s,i,n){let r,a=()=>{this.reqs.delete(r),i();};r=x.request(e,this.endpointURL(),t,s,this.timeout,a,o=>{this.reqs.delete(r),this.isActive()&&n(o);}),this.reqs.add(r);}},D={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let s=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(s))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[s,i,n,r,a]=JSON.parse(e);return t({join_ref:s,ref:i,topic:n,event:r,payload:a})}},binaryEncode(e){let{join_ref:t,ref:s,event:i,topic:n,payload:r}=e,a=this.META_LENGTH+t.length+s.length+n.length+i.length,o=new ArrayBuffer(this.HEADER_LENGTH+a),l=new DataView(o),f=0;l.setUint8(f++,this.KINDS.push),l.setUint8(f++,t.length),l.setUint8(f++,s.length),l.setUint8(f++,n.length),l.setUint8(f++,i.length),Array.from(t,b=>l.setUint8(f++,b.charCodeAt(0))),Array.from(s,b=>l.setUint8(f++,b.charCodeAt(0))),Array.from(n,b=>l.setUint8(f++,b.charCodeAt(0))),Array.from(i,b=>l.setUint8(f++,b.charCodeAt(0)));var T=new Uint8Array(o.byteLength+r.byteLength);return T.set(new Uint8Array(o),0),T.set(new Uint8Array(r),o.byteLength),T.buffer},binaryDecode(e){let t=new DataView(e),s=t.getUint8(0),i=new TextDecoder;switch(s){case this.KINDS.push:return this.decodePush(e,t,i);case this.KINDS.reply:return this.decodeReply(e,t,i);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,i)}},decodePush(e,t,s){let i=t.getUint8(1),n=t.getUint8(2),r=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,o=s.decode(e.slice(a,a+i));a=a+i;let l=s.decode(e.slice(a,a+n));a=a+n;let f=s.decode(e.slice(a,a+r));a=a+r;let T=e.slice(a,e.byteLength);return {join_ref:o,ref:null,topic:l,event:f,payload:T}},decodeReply(e,t,s){let i=t.getUint8(1),n=t.getUint8(2),r=t.getUint8(3),a=t.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,l=s.decode(e.slice(o,o+i));o=o+i;let f=s.decode(e.slice(o,o+n));o=o+n;let T=s.decode(e.slice(o,o+r));o=o+r;let b=s.decode(e.slice(o,o+a));o=o+a;let ge=e.slice(o,e.byteLength),be={status:b,response:ge};return {join_ref:l,ref:f,topic:T,event:v.reply,payload:be}},decodeBroadcast(e,t,s){let i=t.getUint8(1),n=t.getUint8(2),r=this.HEADER_LENGTH+2,a=s.decode(e.slice(r,r+i));r=r+i;let o=s.decode(e.slice(r,r+n));r=r+n;let l=e.slice(r,e.byteLength);return {join_ref:null,ref:null,topic:a,event:o,payload:l}}},He=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||je,this.transport=t.transport||E.WebSocket||_,this.primaryPassedHealthCheck=false,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||E&&E.sessionStorage,this.establishedConnections=0,this.defaultEncoder=D.encode.bind(D),this.defaultDecoder=D.decode.bind(D),this.closeWasClean=false,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==_?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let s=null;R&&R.addEventListener&&(R.addEventListener("pagehide",i=>{this.conn&&(this.disconnect(),s=this.connectClock);}),R.addEventListener("pageshow",i=>{s===this.connectClock&&(s=null,this.connect());})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=i=>t.rejoinAfterMs?t.rejoinAfterMs(i):[1e3,2e3,5e3][i-1]||1e4,this.reconnectAfterMs=i=>t.reconnectAfterMs?t.reconnectAfterMs(i):[10,50,100,150,200,250,500,1e3,2e3][i-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(i,n,r)=>{console.log(`${i}: ${n}`,r);}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=H(t.params||{}),this.endPoint=`${e}/${z.websocket}`,this.vsn=t.vsn||$e,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new ce(()=>{this.teardown(()=>this.connect());},this.reconnectAfterMs);}getLongPollTransport(){return _}replaceTransport(e){this.connectClock++,this.closeWasClean=true,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e;}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=x.appendParams(x.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,s){this.connectClock++,this.closeWasClean=true,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(e,t,s);}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=H(e)),!this.conn&&(this.longPollFallbackMs&&this.transport!==_?this.connectWithFallback(_,this.longPollFallbackMs):this.transportConnect());}log(e,t,s){this.logger&&this.logger(e,t,s);}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return false;let t=this.makeRef(),s=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let i=this.onMessage(n=>{n.ref===t&&(this.off([i]),e(Date.now()-s));});return true}transportConnect(){this.connectClock++,this.closeWasClean=false,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e);}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t);}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let s=false,i=true,n,r,a=o=>{this.log("transport",`falling back to ${e.name}...`,o),this.off([n,r]),i=false,this.replaceTransport(e),this.transportConnect();};if(this.getSession(`phx:fallback:${e.name}`))return a("memorized");this.fallbackTimer=setTimeout(a,t),r=this.onError(o=>{this.log("transport","error",o),i&&!s&&(clearTimeout(this.fallbackTimer),a(o));}),this.onOpen(()=>{if(s=true,!i)return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${e.name}`,"true"),this.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,t),this.ping(o=>{this.log("transport","connected to primary after",o),this.primaryPassedHealthCheck=true,clearTimeout(this.fallbackTimer);});}),this.transportConnect();}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer);}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=false,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach(([,e])=>e());}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=false,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),_e,"heartbeat timeout"));}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs));}teardown(e,t,s){if(!this.conn)return e&&e();this.waitForBufferDone(()=>{this.conn&&(t?this.conn.close(t,s||""):this.conn.close()),this.waitForSocketClosed(()=>{this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e();});});}waitForBufferDone(e,t=1){if(t===5||!this.conn||!this.conn.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(e,t+1);},150*t);}waitForSocketClosed(e,t=1){if(t===5||!this.conn||this.conn.readyState===g.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(e,t+1);},150*t);}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),!this.closeWasClean&&t!==1e3&&this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(([,s])=>s(e));}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,s=this.establishedConnections;this.stateChangeCallbacks.error.forEach(([,i])=>{i(e,t,s);}),(t===this.transport||s>0)&&this.triggerChanError();}triggerChanError(){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(v.error);});}connectionState(){switch(this.conn&&this.conn.readyState){case g.connecting:return "connecting";case g.open:return "open";case g.closing:return "closing";default:return "closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e);}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([s])=>e.indexOf(s)===-1);}channel(e,t={}){let s=new Se(e,t,this);return this.channels.push(s),s}push(e){if(this.hasLogger()){let{topic:t,event:s,payload:i,ref:n,join_ref:r}=e;this.log("push",`${t} ${s} (${r}, ${n})`,i);}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)));}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs));}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[]);}onConnMessage(e){this.decode(e.data,t=>{let{topic:s,event:i,payload:n,ref:r,join_ref:a}=t;r&&r===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${n.status||""} ${s} ${i} ${r&&"("+r+")"||""}`,n);for(let o=0;o<this.channels.length;o++){let l=this.channels[o];l.isMember(s,i,n,a)&&l.trigger(i,n,r,a);}for(let o=0;o<this.stateChangeCallbacks.message.length;o++){let[,l]=this.stateChangeCallbacks.message[o];l(t);}});}leaveOpenTopic(e){let t=this.channels.find(s=>s.topic===e&&(s.isJoined()||s.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave());}};function Le(){return crypto.getRandomValues(new Uint8Array(21)).reduce((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t<63?"_":"-","")}var y,S,$,O,B,j,c=class{constructor(){d(this,y,void 0),d(this,S,void 0),d(this,$,void 0),d(this,O,false),d(this,B,false),d(this,j,new Map);}static set config(e){c.instance||(c.instance=new c),p(c.instance,S,e.socketPath),p(c.instance,$,e.apiKey);}static connect(){if(c.instance||(c.instance=new c),!h(c.instance,$)&&!h(c.instance,B)&&(console.warn("[metrics]: Set apiKey using `Metrics.config = {apiKey: 'your_key'}`"),p(c.instance,B,true)),!h(c.instance,S)&&!h(c.instance,O)&&(console.warn("[metrics]: Set path using `Metrics.config = {socketPath: 'ws://localhost:3000/socket`}"),p(c.instance,O,true)),!h(c.instance,y)&&window){let e=t=>[1e3,5e3,1e4][t-1]||25e3;p(c.instance,y,new He(h(c.instance,S)||"ws://localhost:3000/socket",{params:{source_url:`${window.location.protocol}//${window.location.host}${window.location.pathname}`,key:h(c.instance,$)},reconnectAfterMs:e,rejoinAfterMs:e})),h(c.instance,y).connect();}return h(c.instance,y)}static startSession(e,t){let s=h(c.instance,j).get(e);if(s)return s;let i=h(c.instance,y).channel(`session:${Le()}`,{...t,source_url:window.location.href,key:h(c.instance,$)});return h(c.instance,j).set(e,i),i.join(),i}static stopSession(e){let t=h(c.instance,j).get(e);t&&(t.leave(),h(c.instance,j).delete(e));}},I=c;y=new WeakMap,S=new WeakMap,$=new WeakMap,O=new WeakMap,B=new WeakMap,j=new WeakMap;var ae=class{static log(e){console.log(`[mave_metrics]: ${e}`);}static error(e){console.error(`[mave_metrics]: ${e}`);}},X=(e=>(e.DURATIONCHANGE="durationchange",e.LOADEDMETADATA="loadedmetadata",e.TIMEUPDATE="timeupdate",e.LOADEDDATA="loadeddata",e.CANPLAY="canplay",e.CANPLAYTHROUGH="canplaythrough",e.SEEKING="seeking",e.SEEKED="seeked",e.RATECHANGE="ratechange",e.VOLUMECHANGE="volumechange",e.PLAYING="playing",e.ENDED="ended",e.PLAY="play",e.PAUSE="pause",e.ERROR="error",e))(X||{}),u,A,C,k,Q,M,Z,le,ee,ue,te,de,N,V,U,K,Pe=class{constructor(...e){d(this,Z),d(this,ee),d(this,te),d(this,N),d(this,U),this.VERSION="0.1.5",this.timeout=1e4,d(this,u,void 0),d(this,A,void 0),d(this,C,void 0),d(this,k,null),this.bufferTimeInterval=50,this.bufferOffset=(this.bufferTimeInterval-40)/1e3,this.fullscreen=false,d(this,Q,void 0),d(this,M,false),e.length<=1?ae.error("Metrics requires at least two arguments: a querySelectorable, hls instance or HTMLMediaElement/HTMLVideoElement and a metadata object to identify your video."):(typeof e[0]=="string"&&(this.querySelectorable=e[0],this.identifier=e[1]),e[0]instanceof HTMLVideoElement||e[0]instanceof HTMLMediaElement?p(this,u,e[0]):typeof e[0]=="object"&&(this.hls=e[0]),e.length==2&&typeof e[1]=="object"?this.metadata=e[1]:this.identifier=e[1],e[2]&&(this.metadata=e[2]),e[3]&&(this.session_data=e[3]));}static set config(e){I.config=e;}monitor(){let e=this.querySelectorable?document.querySelector(this.querySelectorable):this.hls?.media;return h(this,M)?this:(e||h(this,u)?(h(this,u)||p(this,u,e),p(this,A,w(this,Z,le).call(this,h(this,u))),w(this,ee,ue).call(this),p(this,M,true)):ae.error(`${this.querySelectorable} is not a valid reference to a HTMLVideoElement.`),this)}demonitor(){h(this,M)&&(h(this,Q)?.unobserve(h(this,u)),w(this,te,de).call(this),h(this,A)&&h(this,u)&&I.stopSession(h(this,u)));}};u=new WeakMap,A=new WeakMap,C=new WeakMap,k=new WeakMap,Q=new WeakMap,M=new WeakMap,Z=new WeakSet,le=function(e){return I.connect(),I.startSession(e,{identifier:this.identifier,metadata:this.metadata,session_data:this.session_data})},ee=new WeakSet,ue=function(){for(let e of Object.values(X))h(this,u).addEventListener(e,w(this,N,V).bind(this));},te=new WeakSet,de=function(){for(let e of Object.values(X))h(this,u).removeEventListener(e,w(this,N,V).bind(this));},N=new WeakSet,V=function(e){let t={name:e.type,duration:h(this,u)?.duration};switch(e.type){case "playing":if(h(this,k)==="play")break;h(this,A)?.push("event",{...t,name:"play",from:h(this,u)?.currentTime<1?0:w(this,U,K).call(this)},this.timeout),p(this,k,"play");break;case "pause":if(h(this,u)?.readyState===4){if(h(this,k)==="pause")break;h(this,A)?.push("event",{...t,to:w(this,U,K).call(this)},this.timeout);}p(this,k,"pause");break;case "timeupdate":if(h(this,u)?.ended){p(this,C,void 0);break}if(h(this,C)&&!h(this,u).paused&&Math.abs(h(this,u)?.currentTime-h(this,C))>.5){if(h(this,k)==="pause")break;h(this,A)?.push("event",{...t,name:"pause",to:h(this,C)},this.timeout),p(this,k,"pause");}p(this,C,h(this,u)?.currentTime);break}},U=new WeakSet,K=function(){return h(this,u)?.currentTime.toFixed(2)};});var oe=class{constructor(t,{target:s,config:i,callback:n,skipInitial:r}){this.t=new Set,this.o=false,this.i=false,this.h=t,s!==null&&this.t.add(s??t),this.o=r??this.o,this.callback=n,window.IntersectionObserver?(this.u=new IntersectionObserver(a=>{let o=this.i;this.i=false,this.o&&o||(this.handleChanges(a),this.h.requestUpdate());},i),t.addController(this)):console.warn("IntersectionController error: browser does not support IntersectionObserver.");}handleChanges(t){this.value=this.callback?.(t,this.u);}hostConnected(){for(let t of this.t)this.observe(t);}hostDisconnected(){this.disconnect();}async hostUpdated(){let t=this.u.takeRecords();t.length&&this.handleChanges(t);}observe(t){this.t.add(t),this.u.observe(t),this.i=true;}unobserve(t){this.t.delete(t),this.u.unobserve(t);}disconnect(){this.u.disconnect();}};var{I:Xe}=g;var fe=e=>e.strings===void 0;var L=(e,t)=>{let s=e._$AN;if(s===void 0)return false;for(let i of s)i._$AO?.(t,false),L(i,t);return true},W=e=>{let t,s;do{if((t=e._$AM)===void 0)break;s=t._$AN,s.delete(e),e=t;}while(s?.size===0)},me=e=>{for(let t;t=e._$AM;e=t){let s=t._$AN;if(s===void 0)t._$AN=s=new Set;else if(s.has(e))break;s.add(e),Ne(t);}};function Oe(e){this._$AN!==void 0?(W(this),this._$AM=e,me(this)):this._$AM=e;}function Be(e,t=false,s=0){let i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(i))for(let r=s;r<i.length;r++)L(i[r],false),W(i[r]);else i!=null&&(L(i,false),W(i));else L(this,e);}var Ne=e=>{e.type==a$1.CHILD&&(e._$AP??(e._$AP=Be),e._$AQ??(e._$AQ=Oe));},q=class extends c{constructor(){super(...arguments),this._$AN=void 0;}_$AT(t,s,i){super._$AT(t,s,i),me(this),this.isConnected=t._$AU;}_$AO(t,s=true){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),s&&(L(this,t),W(this));}setValue(t){if(fe(this._$Ct))this._$Ct._$AI(t,this);else {let s=[...this._$Ct._$AH];s[this._$Ci]=t,this._$Ct._$AI(s,this,0);}}disconnected(){}reconnected(){}};var ne=new WeakMap,ot=b(class extends q{render(e){return f}update(e,[t]){let s=t!==this.Y;return s&&this.Y!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),f}rt(e){if(typeof this.Y=="function"){let t=this.ht??globalThis,s=ne.get(t);s===void 0&&(s=new WeakMap,ne.set(t,s)),s.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),s.set(this.Y,e),e!==void 0&&this.Y.call(this.ht,e);}else this.Y.value=e;}get lt(){return typeof this.Y=="function"?ne.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0);}reconnected(){this.rt(this.ct);}});/*! Bundled license information:
3
+
4
+ lit-html/directive-helpers.js:
5
+ (**
6
+ * @license
7
+ * Copyright 2020 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ *)
10
+
11
+ lit-html/async-directive.js:
12
+ (**
13
+ * @license
14
+ * Copyright 2017 Google LLC
15
+ * SPDX-License-Identifier: BSD-3-Clause
16
+ *)
17
+
18
+ lit-html/directives/ref.js:
19
+ (**
20
+ * @license
21
+ * Copyright 2020 Google LLC
22
+ * SPDX-License-Identifier: BSD-3-Clause
23
+ *)
24
+ */export{oe as a,De as b,ot as c};
@@ -0,0 +1,35 @@
1
+ import {a as a$1}from'./chunk-GO5AXJUO.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(){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);window&&window.customElements&&(window.customElements.get("mave-text")||window.customElements.define("mave-text",n));export{n as a};
@@ -1,8 +1,4 @@
1
- 'use strict';
2
-
3
- var chunkKGTAAGUE_cjs = require('./chunk-KGTAAGUE.cjs');
4
-
5
- var f={attribute:!0,type:String,converter:chunkKGTAAGUE_cjs.a,reflect:!1,hasChanged:chunkKGTAAGUE_cjs.b},h=(e=f,n,t)=>{let{kind:s,metadata:i}=t,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),a.set(t.name,e),s==="accessor"){let{name:r}=t;return {set(c){let o=n.get.call(this);n.set.call(this,c),this.requestUpdate(r,o,e);},init(c){return c!==void 0&&this.P(r,void 0,e),c}}}if(s==="setter"){let{name:r}=t;return function(c){let o=this[r];n.call(this,c),this.requestUpdate(r,o,e);}}throw Error("Unsupported decorator location: "+s)};function d(e){return (n,t)=>typeof t=="object"?h(e,n,t):((s,i,a)=>{let r=i.hasOwnProperty(a);return i.constructor.createProperty(a,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,a):void 0})(e,n,t)}function b(e){return d({...e,state:!0,attribute:!1})}var u=(e,n,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof n!="object"&&Object.defineProperty(e,n,t),t);function E(e,n){return (t,s,i)=>{let a=r=>r.renderRoot?.querySelector(e)??null;if(n){let{get:r,set:c}=typeof s=="object"?t:i??(()=>{let o=Symbol();return {get(){return this[o]},set(m){this[o]=m;}}})();return u(t,s,{get(){let o=r.call(this);return o===void 0&&(o=a(this),(o!==null||this.hasUpdated)&&c.call(this,o)),o}})}return u(t,s,{get(){return a(this)}})}}/*! Bundled license information:
1
+ 'use strict';var chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs');var f={attribute:true,type:String,converter:chunk5NSCV6C2_cjs.a,reflect:false,hasChanged:chunk5NSCV6C2_cjs.b},h=(e=f,n,t)=>{let{kind:s,metadata:i}=t,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),a.set(t.name,e),s==="accessor"){let{name:r}=t;return {set(c){let o=n.get.call(this);n.set.call(this,c),this.requestUpdate(r,o,e);},init(c){return c!==void 0&&this.P(r,void 0,e),c}}}if(s==="setter"){let{name:r}=t;return function(c){let o=this[r];n.call(this,c),this.requestUpdate(r,o,e);}}throw Error("Unsupported decorator location: "+s)};function d(e){return (n,t)=>typeof t=="object"?h(e,n,t):((s,i,a)=>{let r=i.hasOwnProperty(a);return i.constructor.createProperty(a,r?{...s,wrapped:true}:s),r?Object.getOwnPropertyDescriptor(i,a):void 0})(e,n,t)}function b(e){return d({...e,state:true,attribute:false})}var u=(e,n,t)=>(t.configurable=true,t.enumerable=true,Reflect.decorate&&typeof n!="object"&&Object.defineProperty(e,n,t),t);function E(e,n){return (t,s,i)=>{let a=r=>r.renderRoot?.querySelector(e)??null;if(n){let{get:r,set:c}=typeof s=="object"?t:i??(()=>{let o=Symbol();return {get(){return this[o]},set(m){this[o]=m;}}})();return u(t,s,{get(){let o=r.call(this);return o===void 0&&(o=a(this),(o!==null||this.hasUpdated)&&c.call(this,o)),o}})}return u(t,s,{get(){return a(this)}})}}/*! Bundled license information:
6
2
 
7
3
  @lit/reactive-element/decorators/property.js:
8
4
  (**
@@ -73,8 +69,4 @@ var f={attribute:!0,type:String,converter:chunkKGTAAGUE_cjs.a,reflect:!1,hasChan
73
69
  * Copyright 2017 Google LLC
74
70
  * SPDX-License-Identifier: BSD-3-Clause
75
71
  *)
76
- */
77
-
78
- exports.a = d;
79
- exports.b = b;
80
- exports.c = E;
72
+ */exports.a=d;exports.b=b;exports.c=E;
@@ -1,6 +1 @@
1
- import { a } from './chunk-LCTGZL3L.js';
2
- import { a as a$1 } from './chunk-JBV2AYRP.js';
3
-
4
- var p=class{constructor(e,d){this.host=e,this.embed=d,this.task=new a(this.host,async()=>{try{let o=this.embedFile("subtitle.json"),c=await fetch(o);if(c.status!==200)throw new Error;let u=await c.json(),l=u.segments.flatMap(t=>t.words).map(t=>({start:t.start,end:t.end,word:t.word.trim()})),r=[],n={start:0,end:0,text:"",words:[]};l.forEach(t=>{let{start:a,end:i,word:s}=t;n.start===0&&(n.start=a),n.end=i,n.words.push(t),n.text+=(n.text?" ":"")+s,/[.!?]$/.test(s)&&(r.push({...n}),n={start:0,end:0,text:"",words:[]});}),n.words.length>0&&r.push({...n});let h=[],f=1,w=5;if(r.length>0){let t={start:r[0].start,end:r[0].end,text:r[0].text,words:r[0].words},a=1;for(let i=1;i<r.length;i++){let s=r[i],b=r[i-1],S=s.start??0,k=b.end??0;S-k<=f&&a<w?(t.end=s.end,t.text+=" "+s.text,t.words=[...t.words,...s.words],a++):(h.push({...t}),t={start:s.start,end:s.end,text:s.text,words:s.words},a=1);}t.words.length>0&&h.push(t);}return {text:u.text,segments:h}}catch{throw console.warn(`Failed to fetch language file for "${this.embed}"`),new Error}},()=>[this.embed]);}set embed(e){this._embed!=e&&(this._embed=e,this.host.requestUpdate());}get embed(){return this._embed}set token(e){this._token!=e&&(this._token=e,this.host.requestUpdate());}get token(){return this._token}get spaceId(){return this.embed.substring(0,5)}get embedId(){return this.embed.substring(5,this.embed.length)}get version(){return this._version?`/v${this._version}/`:"/"}set version(e){this._version!=e&&(this._version=e,this.host.requestUpdate());}get cdnRoot(){return a$1.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}embedFile(e,d=new URLSearchParams){let o=new URL(`${this.cdnRoot}/${this.embedId}${e=="manifest"?"/":this.version}${e}`);return this.token&&d.append("token",this.token),o.search=d.toString(),o.toString()}render(e){return this.task?.render(e)}};
5
-
6
- export { p as a };
1
+ import {a}from'./chunk-LCTGZL3L.js';import {a as a$1}from'./chunk-JBV2AYRP.js';var p=class{constructor(e,d){this.host=e,this.embed=d,this.task=new a(this.host,async()=>{try{let o=this.embedFile("subtitle.json"),c=await fetch(o);if(c.status!==200)throw new Error;let u=await c.json(),l=u.segments.flatMap(t=>t.words).map(t=>({start:t.start,end:t.end,word:t.word.trim()})),r=[],n={start:0,end:0,text:"",words:[]};l.forEach(t=>{let{start:a,end:i,word:s}=t;n.start===0&&(n.start=a),n.end=i,n.words.push(t),n.text+=(n.text?" ":"")+s,/[.!?]$/.test(s)&&(r.push({...n}),n={start:0,end:0,text:"",words:[]});}),n.words.length>0&&r.push({...n});let h=[],f=1,w=5;if(r.length>0){let t={start:r[0].start,end:r[0].end,text:r[0].text,words:r[0].words},a=1;for(let i=1;i<r.length;i++){let s=r[i],b=r[i-1],S=s.start??0,k=b.end??0;S-k<=f&&a<w?(t.end=s.end,t.text+=" "+s.text,t.words=[...t.words,...s.words],a++):(h.push({...t}),t={start:s.start,end:s.end,text:s.text,words:s.words},a=1);}t.words.length>0&&h.push(t);}return {text:u.text,segments:h}}catch{throw console.warn(`Failed to fetch language file for "${this.embed}"`),new Error}},()=>[this.embed]);}set embed(e){this._embed!=e&&(this._embed=e,this.host.requestUpdate());}get embed(){return this._embed}set token(e){this._token!=e&&(this._token=e,this.host.requestUpdate());}get token(){return this._token}get spaceId(){return this.embed.substring(0,5)}get embedId(){return this.embed.substring(5,this.embed.length)}get version(){return this._version?`/v${this._version}/`:"/"}set version(e){this._version!=e&&(this._version=e,this.host.requestUpdate());}get cdnRoot(){return a$1.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}embedFile(e,d=new URLSearchParams){let o=new URL(`${this.cdnRoot}/${this.embedId}${e=="manifest"?"/":this.version}${e}`);return this.token&&d.append("token",this.token),o.search=d.toString(),o.toString()}render(e){return this.task?.render(e)}};export{p as a};
@@ -0,0 +1,9 @@
1
+ 'use strict';var chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs');var e=t=>t??chunk5NSCV6C2_cjs.f;/*! Bundled license information:
2
+
3
+ lit-html/directives/if-defined.js:
4
+ (**
5
+ * @license
6
+ * Copyright 2018 Google LLC
7
+ * SPDX-License-Identifier: BSD-3-Clause
8
+ *)
9
+ */exports.a=e;
@@ -1,6 +1,4 @@
1
- import { a, b as b$1 } from './chunk-IFM2GZME.js';
2
-
3
- var f={attribute:!0,type:String,converter:a,reflect:!1,hasChanged:b$1},h=(e=f,n,t)=>{let{kind:s,metadata:i}=t,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),a.set(t.name,e),s==="accessor"){let{name:r}=t;return {set(c){let o=n.get.call(this);n.set.call(this,c),this.requestUpdate(r,o,e);},init(c){return c!==void 0&&this.P(r,void 0,e),c}}}if(s==="setter"){let{name:r}=t;return function(c){let o=this[r];n.call(this,c),this.requestUpdate(r,o,e);}}throw Error("Unsupported decorator location: "+s)};function d(e){return (n,t)=>typeof t=="object"?h(e,n,t):((s,i,a)=>{let r=i.hasOwnProperty(a);return i.constructor.createProperty(a,r?{...s,wrapped:!0}:s),r?Object.getOwnPropertyDescriptor(i,a):void 0})(e,n,t)}function b(e){return d({...e,state:!0,attribute:!1})}var u=(e,n,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof n!="object"&&Object.defineProperty(e,n,t),t);function E(e,n){return (t,s,i)=>{let a=r=>r.renderRoot?.querySelector(e)??null;if(n){let{get:r,set:c}=typeof s=="object"?t:i??(()=>{let o=Symbol();return {get(){return this[o]},set(m){this[o]=m;}}})();return u(t,s,{get(){let o=r.call(this);return o===void 0&&(o=a(this),(o!==null||this.hasUpdated)&&c.call(this,o)),o}})}return u(t,s,{get(){return a(this)}})}}/*! Bundled license information:
1
+ import {b as b$1,a}from'./chunk-A4GZBQEB.js';var f={attribute:true,type:String,converter:a,reflect:false,hasChanged:b$1},h=(e=f,n,t)=>{let{kind:s,metadata:i}=t,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),a.set(t.name,e),s==="accessor"){let{name:r}=t;return {set(c){let o=n.get.call(this);n.set.call(this,c),this.requestUpdate(r,o,e);},init(c){return c!==void 0&&this.P(r,void 0,e),c}}}if(s==="setter"){let{name:r}=t;return function(c){let o=this[r];n.call(this,c),this.requestUpdate(r,o,e);}}throw Error("Unsupported decorator location: "+s)};function d(e){return (n,t)=>typeof t=="object"?h(e,n,t):((s,i,a)=>{let r=i.hasOwnProperty(a);return i.constructor.createProperty(a,r?{...s,wrapped:true}:s),r?Object.getOwnPropertyDescriptor(i,a):void 0})(e,n,t)}function b(e){return d({...e,state:true,attribute:false})}var u=(e,n,t)=>(t.configurable=true,t.enumerable=true,Reflect.decorate&&typeof n!="object"&&Object.defineProperty(e,n,t),t);function E(e,n){return (t,s,i)=>{let a=r=>r.renderRoot?.querySelector(e)??null;if(n){let{get:r,set:c}=typeof s=="object"?t:i??(()=>{let o=Symbol();return {get(){return this[o]},set(m){this[o]=m;}}})();return u(t,s,{get(){let o=r.call(this);return o===void 0&&(o=a(this),(o!==null||this.hasUpdated)&&c.call(this,o)),o}})}return u(t,s,{get(){return a(this)}})}}/*! Bundled license information:
4
2
 
5
3
  @lit/reactive-element/decorators/property.js:
6
4
  (**
@@ -71,6 +69,4 @@ var f={attribute:!0,type:String,converter:a,reflect:!1,hasChanged:b$1},h=(e=f,n,
71
69
  * Copyright 2017 Google LLC
72
70
  * SPDX-License-Identifier: BSD-3-Clause
73
71
  *)
74
- */
75
-
76
- export { d as a, b, E as c };
72
+ */export{d as a,b,E as c};
@@ -0,0 +1 @@
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;
@@ -1,3 +1,2 @@
1
- var t={metrics:{enabled:!0,socket:"wss://metrics.video-dns.com/socket"},upload:{socket:"wss://app.mave.io/api/v1/socket",endpoint:"https://upload.mave.io/files"},api:{endpoint:"https://mave.io/api/v1"},cdn:{endpoint:"https://space-${this.spaceId}.video-dns.com"}};function o(e){Object.assign(t,e);}
2
-
3
- export { t as a, o as b };
1
+ var t={metrics:{enabled:true,socket:"wss://metrics.video-dns.com/socket"},upload:{socket:"wss://app.mave.io/api/v1/socket",endpoint:"https://upload.mave.io/files"},api:{endpoint:"https://mave.io/api/v1"},cdn:{endpoint:"https://space-${this.spaceId}.video-dns.com"}};function o(e){Object.assign(t,e);}
2
+ export{t as a,o as b};
@@ -1,10 +1 @@
1
- 'use strict';
2
-
3
- var chunkTI75IJ2E_cjs = require('./chunk-TI75IJ2E.cjs');
4
- var chunkLG2O4WV2_cjs = require('./chunk-LG2O4WV2.cjs');
5
- var chunk5STN56TL_cjs = require('./chunk-5STN56TL.cjs');
6
-
7
- var c=(t=>(t[t.Collection=0]="Collection",t[t.Embed=1]="Embed",t))(c||{}),a=class{constructor(e,t=1){this.caching=!0;this.loading=!0;this.host=e,this.type=t,this.loading=!0,this.task=new chunkLG2O4WV2_cjs.a(this.host,async()=>{try{if(this.type==1&&!this.embed)return;if(this.type==0&&!this.token){console.warn("No token attr provided for mave-list");return}let i=await(await fetch(this.manifest_url)).json();return this.loading=!1,this.type==1?(this._embedData=i,this.version=this._embedData.video?.version||0,this._embedData):i}catch(s){throw console.log(s),new Error(`Failed to fetch "${this.embed}"`)}},()=>[this.embed]);}get manifest_url(){if(this.type==1)return this.embedFile("manifest.json");{let e=new URL(`${chunkTI75IJ2E_cjs.a}/collection/${this.token}`);return this.embed&&this.embed?.length>1&&e.searchParams.append("embed",this.embed),e.toString()}}set embed(e){this._embed!=e&&(this._embed=e,this.loading=!0,this.host.requestUpdate());}get embed(){return this._embed}set token(e){this._token!=e&&(this._token=e,this.host.requestUpdate());}get token(){return this._token}get spaceId(){return this.embed?.substring(0,5)}get embedId(){return this.embed?.substring(5,this.embed?.length)}get version(){return this._version?`/v${this._version}/`:"/"}set version(e){this._version!=e&&(this._version=e,this.host.requestUpdate());}get cdnRoot(){return chunk5STN56TL_cjs.a.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}refresh(){return this.loading=!0,this.task?.run()}embedFile(e,t=new URLSearchParams){let s=new URL(`${this.cdnRoot}/${this.embedId}${e=="manifest"?"/":this.version}${e}`);if(e.includes("?")){let[i,h]=e.split("?");new URLSearchParams(h).forEach((d,m)=>{t.append(m,d);});}if(this.token&&t.append("token",this.token),e=="manifest"&&(t.has("e")&&t.delete("e"),t.append("e",new Date().getTime().toString())),e!=="manifest"&&this._embedData?.created_at){let i=this.caching?new Date(this._embedData.created_at):new Date;t.has("e")||t.append("e",i.getTime().toString());}return s.search=t.toString(),s.toString()}render(e){return this.task?.render(e)}};
8
-
9
- exports.a = c;
10
- exports.b = a;
1
+ 'use strict';var chunkTI75IJ2E_cjs=require('./chunk-TI75IJ2E.cjs'),chunkLG2O4WV2_cjs=require('./chunk-LG2O4WV2.cjs'),chunk5STN56TL_cjs=require('./chunk-5STN56TL.cjs');var c=(t=>(t[t.Collection=0]="Collection",t[t.Embed=1]="Embed",t))(c||{}),a=class{constructor(e,t=1){this.caching=true;this.loading=true;this.host=e,this.type=t,this.loading=true,this.task=new chunkLG2O4WV2_cjs.a(this.host,async()=>{try{if(this.type==1&&!this.embed)return;if(this.type==0&&!this.token){console.warn("No token attr provided for mave-list");return}let i=await(await fetch(this.manifest_url)).json();return this.loading=!1,this.type==1?(this._embedData=i,this.version=this._embedData.video?.version||0,this._embedData):i}catch(s){throw console.log(s),new Error(`Failed to fetch "${this.embed}"`)}},()=>[this.embed]);}get manifest_url(){if(this.type==1)return this.embedFile("manifest.json");{let e=new URL(`${chunkTI75IJ2E_cjs.a}/collection/${this.token}`);return this.embed&&this.embed?.length>1&&e.searchParams.append("embed",this.embed),e.toString()}}set embed(e){this._embed!=e&&(this._embed=e,this.loading=true,this.host.requestUpdate());}get embed(){return this._embed}set token(e){this._token!=e&&(this._token=e,this.host.requestUpdate());}get token(){return this._token}get spaceId(){return this.embed?.substring(0,5)}get embedId(){return this.embed?.substring(5,this.embed?.length)}get version(){return this._version?`/v${this._version}/`:"/"}set version(e){this._version!=e&&(this._version=e,this.host.requestUpdate());}get cdnRoot(){return chunk5STN56TL_cjs.a.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}refresh(){return this.loading=true,this.task?.run()}embedFile(e,t=new URLSearchParams){let s=new URL(`${this.cdnRoot}/${this.embedId}${e=="manifest"?"/":this.version}${e}`);if(e.includes("?")){let[i,h]=e.split("?");new URLSearchParams(h).forEach((d,m)=>{t.append(m,d);});}if(this.token&&t.append("token",this.token),e=="manifest"&&(t.has("e")&&t.delete("e"),t.append("e",new Date().getTime().toString())),e!=="manifest"&&this._embedData?.created_at){let i=this.caching?new Date(this._embedData.created_at):new Date;t.has("e")||t.append("e",i.getTime().toString());}return s.search=t.toString(),s.toString()}render(e){return this.task?.render(e)}};exports.a=c;exports.b=a;
@@ -0,0 +1,37 @@
1
+ import {a as a$2}from'./chunk-3R7TX6NC.js';import {b as b$2,a as a$1,c as c$1}from'./chunk-CUGRXOA2.js';import {a as a$3}from'./chunk-MK4VIJT3.js';import {b as b$4}from'./chunk-XSYWRQWB.js';import {a,b as b$3}from'./chunk-HMISRRKC.js';import {h as h$1,i as i$1,c as c$2}from'./chunk-A4GZBQEB.js';import {a as a$4}from'./chunk-JBV2AYRP.js';import {b as b$1,c,e,f,d}from'./chunk-NDDFZTBA.js';var b=b$1(b$2(),1);var i,v,h,u,y,M,p,I,S,T,r=class extends i$1{constructor(){super(...arguments);e(this,i);this.autoplay="lazy";this.quality="auto";this.fallback="placeholder";this._queue=[];this._failedPlay=false;this._intersectionObserver=new a$1(this,{callback:f(this,i,S).bind(this)});this.embedController=new b$4(this);}get embed(){return this._embedId}set embed(t){this._embedId!=t&&(this._embedId=t,this.requestUpdate("embed"),this.embedController.embed=this.embed);}set loop(t){this._loop=(t===""||t=="true"||t==true)??false;}get loop(){return this._loop}get poster(){return this.embedController.embedFile(`${this.fallback}.jpg`)}set poster(t){if(t){let s=this._poster;this._poster=t,this.requestUpdate("poster",s);}}get token(){return this._token}set token(t){this._token!=t&&(this._token=t,this.requestUpdate("token"),this.embedController.token=this._token);}get sources(){let t=this.autoplay==="scroll"?["clip_keyframes"]:["video","clip"],s=this._embed.video.renditions.filter(e=>(this.quality=="auto"?e.size!=="uhd":d(this,i,h).indexOf(e.size)<=d(this,i,h).indexOf(this.quality))&&e.container==="mp4"&&d(this,i,u).includes(e.codec)&&(!e.type||t.includes(e.type))).sort((e,o)=>e.size===o.size?d(this,i,u).indexOf(e.codec)-d(this,i,u).indexOf(o.codec):d(this,i,h).indexOf(o.size)-d(this,i,h).indexOf(e.size)).map(e=>{let o=d(this,i,M).find(g=>g.size===e.size)?.media,c=`${e.codec}_${e.size}${e.type&&e.type!="video"?`_${e.type}`:""}.mp4`;return {media:o,src:this.embedController.embedFile(c),codec:d(this,i,y)[e.codec]}}),d$1=this._embed.video.renditions.filter(e=>d(this,i,h).indexOf(e.size)<=d(this,i,h).indexOf("fhd")&&e.container==="mp4"&&d(this,i,u).includes(e.codec)&&(!e.type||t.includes(e.type))).sort((e,o)=>d(this,i,h).indexOf(o.size)-d(this,i,h).indexOf(e.size));if(d$1.length>0){let e=d$1[0],o=`${e.codec}_${e.size}${e.type&&e.type!="video"?`_${e.type}`:""}.mp4`,c={media:void 0,src:this.embedController.embedFile(o),codec:d(this,i,y)[e.codec]};s.push(c);}return s}connectedCallback(){super.connectedCallback(),this.autoplay==="scroll"&&document.addEventListener("scroll",f(this,i,v).bind(this));}disconnectedCallback(){super.disconnectedCallback(),this.autoplay==="scroll"&&document.removeEventListener("scroll",f(this,i,v).bind(this)),this._metricsInstance?.demonitor();}set muted(t){this._videoElement?this._videoElement.muted=t:this._queue.push(()=>this._videoElement.muted=t);}get muted(){return this._videoElement?.muted||false}get paused(){return this._videoElement?.paused||true}get duration(){return new Promise((t,s)=>{if(this._videoElement&&!isNaN(this._videoElement.duration))return t(this._videoElement.duration);let d=()=>{this._videoElement?.addEventListener("loadedmetadata",()=>{this._videoElement&&t(this._videoElement.duration);}),this._videoElement?.addEventListener("error",e=>{s(new Error("Failed to load video metadata."));});};this._videoElement?d():this.addEventListener("mave:video_element_ready",()=>{d();});})}set currentTime(t){this._videoElement?this._videoElement.currentTime=t:this._queue.push(()=>this._videoElement.currentTime=t);}get currentTime(){return this._videoElement?this._videoElement?.currentTime:0}play(){this._videoElement?f(this,i,p).call(this):this._queue.push(()=>f(this,i,p).call(this));}pause(){this._videoElement?this._videoElement.pause():this._queue.push(()=>this._videoElement?.pause());}render(){return c$2`
2
+ ${this.embedController.render({complete:t=>{if(this._embed=t,!!t)return c$2`
3
+ <video
4
+ @click=${f(this,i,T)}
5
+ preload="metadata"
6
+ style=${a$2(this._failedPlay||this.autoplay==="off"?"cursor: pointer":void 0)}
7
+ muted
8
+ playsinline
9
+ poster=${a$2(this._failedPlay?this.poster:void 0)}
10
+ ${c$1(f(this,i,I))}
11
+ ?autoplay=${this.autoplay==="always"}
12
+ ?loop=${this.loop||true}
13
+ >
14
+ ${this.sources.map(s=>c$2`
15
+ <source
16
+ media=${a$2(s.media?`(min-width: ${s.media}px)`:void 0)}
17
+ src=${s.src}
18
+ type=${`video/mp4; ${s.codec}`}
19
+ />
20
+ `)}
21
+ </video>
22
+ `}})}
23
+ `}};i=new WeakSet,v=function(){let{height:t,top:s,bottom:d}=this.getBoundingClientRect(),e=window.innerHeight;if(this._videoElement){this._videoElement.duration||this._videoElement.load();let o=0;if(s<e&&d>0){let c=t+e;o=(e-s)/c*this._videoElement.duration;}o>=0&&o<=this._videoElement.duration&&(this._videoElement.currentTime=o);}},h=function(){return ["sd","hd","fhd","qhd","uhd"]},u=function(){let t=navigator.userAgent,s=/Edg/.test(t)&&/Mac OS/.test(t),d=/Safari/.test(t)&&!/Chrome/.test(t),e=/Mac OS/.test(t),o=/iPhone|iPad/.test(t);return e&&(d||s)||o?["hevc","h264"]:["av1","h264"]},y=function(){return {av1:"av01.0.08M.08.0.110.01.01.01.0,opus",hevc:"hevc.01.00.78,mp4a.40.2",h264:"avc1.64.00.28,mp4a.40.2"}},M=function(){return [{size:"qhd",media:1280},{size:"fhd",media:1080},{size:"hd",media:720},{size:"sd",media:640}]},p=function(){this._metricsInstance?.monitor(),this._videoElement&&(this._videoElement.muted=true,this._videoElement.play().catch(t=>{this._failedPlay=true;}));},I=function(t){if(this._videoElement||(this._videoElement=t,this.dispatchEvent(new CustomEvent("mave:video_element_ready",{detail:this._videoElement,bubbles:true,composed:true}))),this._intersectionObserver.observe(this._videoElement),this._videoElement&&this._embed){a$3.forEach(d=>{this._videoElement?.addEventListener(d,e=>{!this._canPlay&&this.autoplay==="scroll"&&d==="canplay"&&(this._canPlay=true,f(this,i,v).call(this)),this.dispatchEvent(new CustomEvent(d,{detail:e,bubbles:true,composed:true}));});});let s={component:"clip",video_id:this._embed.video.id,space_id:this._embed.space_id};b.Metrics.config={socketPath:a$4.metrics.socket,apiKey:this._embed.metrics_key},a$4.metrics.enabled&&(this._metricsInstance=new b.Metrics(this._videoElement,this.embed,s));}this._queue.length&&(this._queue.forEach(s=>s()),this._queue=[]);},S=function(t){for(let{isIntersecting:s}of t){if(this.autoplay==="always")return;s&&(this.autoplay==="lazy"||this.autoplay==="true")?this._videoElement?.paused&&f(this,i,p).call(this):this._videoElement?.paused||this._videoElement?.pause();}},T=function(){(this.autoplay==="off"||this._failedPlay)&&(this._videoElement?.paused?f(this,i,p).call(this):this._videoElement?.pause());},r.styles=h$1`
24
+ :host {
25
+ display: block;
26
+ position: relative;
27
+ overflow: hidden;
28
+ }
29
+
30
+ video {
31
+ all: initial;
32
+ display: block;
33
+ width: 100%;
34
+ height: 100%;
35
+ object-fit: cover;
36
+ }
37
+ `,c([a()],r.prototype,"embed",1),c([a()],r.prototype,"autoplay",2),c([a()],r.prototype,"quality",2),c([a()],r.prototype,"fallback",2),c([a()],r.prototype,"loop",1),c([a()],r.prototype,"poster",1),c([a()],r.prototype,"token",1),c([b$3()],r.prototype,"_failedPlay",2);window&&window.customElements&&(window.customElements.get("mave-clip")||window.customElements.define("mave-clip",r));export{r as a};
@@ -0,0 +1 @@
1
+ 'use strict';var chunkCOWZ7GYF_cjs=require('./chunk-COWZ7GYF.cjs'),chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs');var a=["default","synthwave","dolphin"],l=class s{constructor(){this.themes=[];}static async get(t,i,m=true){if(s.instance||(s.instance=new s),s.instance.themes.find(e=>e.name===t))return Promise.resolve(s.instance);s.instance.themes.push({name:t});try{if(m&&!a.includes(t)){let e=document.createElement("link");e.rel="stylesheet",e.href=`${i}/${t}.css`,document.head.appendChild(e);}if(i&&!a.includes(t)){let{build:e}=await import(`${i}/${t}.js`);e(t,chunk5NSCV6C2_cjs.i,chunk5NSCV6C2_cjs.c,chunk5NSCV6C2_cjs.h);}else {let e=`./${chunkCOWZ7GYF_cjs.a()}themes/${t}.js`,{build:d}=await import(e);d(t,chunk5NSCV6C2_cjs.i,chunk5NSCV6C2_cjs.c,chunk5NSCV6C2_cjs.h);}}catch(e){console.log("[mave-player]: theme not loaded",e);}return Promise.resolve(s.instance)}};exports.a=l;
@@ -1,4 +1,4 @@
1
- var h=window,c=h.ShadowRoot&&(h.ShadyCSS===void 0||h.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,m=Symbol(),_=new WeakMap,l=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==m)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o,e=this.t;if(c&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=_.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&_.set(e,t));}return t}toString(){return this.cssText}},g=r=>new l(typeof r=="string"?r:r+"",void 0,m);var v=(r,t)=>{c?r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let s=document.createElement("style"),i=h.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s);});},u=c?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return g(e)})(r):r;var f,d=window,$=d.trustedTypes,A=$?$.emptyScript:"",b=d.reactiveElementPolyfillSupport,y={toAttribute(r,t){switch(t){case Boolean:r=r?A:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r);}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r);}catch{e=null;}}return e}},p=(r,t)=>t!==r&&(t==t||r==r),S={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:p},n=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u();}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t);}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,s)=>{let i=this._$Ep(s,e);i!==void 0&&(this._$Ev.set(i,s),t.push(i));}),t}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let s=typeof t=="symbol"?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Object.defineProperty(this.prototype,t,i);}}static getPropertyDescriptor(t,e,s){return {get(){return this[e]},set(i){let o=this[t];this[e]=i,this.requestUpdate(t,o,s);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||S}static finalize(){if(this.hasOwnProperty("finalized"))return !1;this.finalized=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let i of s)this.createProperty(i,e[i]);}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(u(i));}else t!==void 0&&e.push(u(t));return e}static _$Ep(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this));}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t));}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e]);});}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return v(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return (s=e.hostConnected)===null||s===void 0?void 0:s.call(e)});}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return (s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)});}attributeChangedCallback(t,e,s){this._$AK(t,s);}_$EO(t,e,s=S){var i;let o=this.constructor._$Ep(t,s);if(o!==void 0&&s.reflect===!0){let a=(((i=s.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?s.converter:y).toAttribute(e,s.type);this._$El=t,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$El=null;}}_$AK(t,e){var s;let i=this.constructor,o=i._$Ev.get(t);if(o!==void 0&&this._$El!==o){let a=i.getPropertyOptions(o),U=typeof a.converter=="function"?{fromAttribute:a.converter}:((s=a.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?a.converter:y;this._$El=o,this[o]=U.fromAttribute(e,a.type),this._$El=null;}}requestUpdate(t,e,s){let i=!0;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||p)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_;}catch(e){Promise.reject(e);}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let e=!1,s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(i=>{var o;return (o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(s)):this._$Ek();}catch(i){throw e=!1,this._$Ek(),i}e&&this._$AE(s);}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var i;return (i=s.hostUpdated)===null||i===void 0?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return !0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek();}updated(t){}firstUpdated(t){}};n.finalized=!0,n.elementProperties=new Map,n.elementStyles=[],n.shadowRootOptions={mode:"open"},b?.({ReactiveElement:n}),((f=d.reactiveElementVersions)!==null&&f!==void 0?f:d.reactiveElementVersions=[]).push("1.6.1");var w=Symbol(),E=class{get taskComplete(){return this.t||(this.status===1?this.t=new Promise((t,e)=>{this.i=t,this.o=e;}):this.status===3?this.t=Promise.reject(this.h):this.t=Promise.resolve(this.l)),this.t}constructor(t,e,s){this.u=0,this.status=0,(this.p=t).addController(this);let i=typeof e=="object"?e:{task:e,args:s};this._=i.task,this.v=i.args,this.j=i.argsEqual??C,this.m=i.onComplete,this.g=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.l=i.initialValue,this.status=2,this.k=this.A?.());}hostUpdate(){this.autoRun===!0&&this.O();}hostUpdated(){this.autoRun==="afterUpdate"&&this.O();}A(){if(this.v===void 0)return;let t=this.v();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async O(){let t=this.A(),e=this.k;this.k=t,t===e||t===void 0||e!==void 0&&this.j(e,t)||await this.run(t);}async run(t){let e,s;t??(t=this.A()),this.k=t,this.status===1?this.T?.abort():(this.t=void 0,this.i=void 0,this.o=void 0),this.status=1,this.autoRun==="afterUpdate"?queueMicrotask(()=>this.p.requestUpdate()):this.p.requestUpdate();let i=++this.u;this.T=new AbortController;let o=!1;try{e=await this._(t,{signal:this.T.signal});}catch(a){o=!0,s=a;}if(this.u===i){if(e===w)this.status=0;else {if(o===!1){try{this.m?.(e);}catch{}this.status=2,this.i?.(e);}else {try{this.g?.(s);}catch{}this.status=3,this.o?.(s);}this.l=e,this.h=s;}this.p.requestUpdate();}}abort(t){this.status===1&&this.T?.abort(t);}get value(){return this.l}get error(){return this.h}render(t){switch(this.status){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.status)}}},C=(r,t)=>r===t||r.length===t.length&&r.every((e,s)=>!p(e,t[s]));/*! Bundled license information:
1
+ var h=window,c=h.ShadowRoot&&(h.ShadyCSS===void 0||h.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,m=Symbol(),_=new WeakMap,l=class{constructor(t,e,s){if(this._$cssResult$=true,s!==m)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o,e=this.t;if(c&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=_.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&_.set(e,t));}return t}toString(){return this.cssText}},g=r=>new l(typeof r=="string"?r:r+"",void 0,m);var v=(r,t)=>{c?r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let s=document.createElement("style"),i=h.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s);});},u=c?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return g(e)})(r):r;var f,d=window,$=d.trustedTypes,A=$?$.emptyScript:"",b=d.reactiveElementPolyfillSupport,y={toAttribute(r,t){switch(t){case Boolean:r=r?A:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r);}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r);}catch{e=null;}}return e}},p=(r,t)=>t!==r&&(t==t||r==r),S={attribute:true,type:String,converter:y,reflect:false,hasChanged:p},n=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=false,this.hasUpdated=false,this._$El=null,this.u();}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t);}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,s)=>{let i=this._$Ep(s,e);i!==void 0&&(this._$Ev.set(i,s),t.push(i));}),t}static createProperty(t,e=S){if(e.state&&(e.attribute=false),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let s=typeof t=="symbol"?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Object.defineProperty(this.prototype,t,i);}}static getPropertyDescriptor(t,e,s){return {get(){return this[e]},set(i){let o=this[t];this[e]=i,this.requestUpdate(t,o,s);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)||S}static finalize(){if(this.hasOwnProperty("finalized"))return false;this.finalized=true;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let i of s)this.createProperty(i,e[i]);}return this.elementStyles=this.finalizeStyles(this.styles),true}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(u(i));}else t!==void 0&&e.push(u(t));return e}static _$Ep(t,e){let s=e.attribute;return s===false?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this));}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t));}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e]);});}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return v(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(true),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return (s=e.hostConnected)===null||s===void 0?void 0:s.call(e)});}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return (s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)});}attributeChangedCallback(t,e,s){this._$AK(t,s);}_$EO(t,e,s=S){var i;let o=this.constructor._$Ep(t,s);if(o!==void 0&&s.reflect===true){let a=(((i=s.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?s.converter:y).toAttribute(e,s.type);this._$El=t,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$El=null;}}_$AK(t,e){var s;let i=this.constructor,o=i._$Ev.get(t);if(o!==void 0&&this._$El!==o){let a=i.getPropertyOptions(o),U=typeof a.converter=="function"?{fromAttribute:a.converter}:((s=a.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?a.converter:y;this._$El=o,this[o]=U.fromAttribute(e,a.type),this._$El=null;}}requestUpdate(t,e,s){let i=true;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||p)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===true&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):i=false),!this.isUpdatePending&&i&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=true;try{await this._$E_;}catch(e){Promise.reject(e);}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let e=false,s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(i=>{var o;return (o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(s)):this._$Ek();}catch(i){throw e=false,this._$Ek(),i}e&&this._$AE(s);}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var i;return (i=s.hostUpdated)===null||i===void 0?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$Ek(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return true}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek();}updated(t){}firstUpdated(t){}};n.finalized=true,n.elementProperties=new Map,n.elementStyles=[],n.shadowRootOptions={mode:"open"},b?.({ReactiveElement:n}),((f=d.reactiveElementVersions)!==null&&f!==void 0?f:d.reactiveElementVersions=[]).push("1.6.1");var w=Symbol(),E=class{get taskComplete(){return this.t||(this.status===1?this.t=new Promise((t,e)=>{this.i=t,this.o=e;}):this.status===3?this.t=Promise.reject(this.h):this.t=Promise.resolve(this.l)),this.t}constructor(t,e,s){this.u=0,this.status=0,(this.p=t).addController(this);let i=typeof e=="object"?e:{task:e,args:s};this._=i.task,this.v=i.args,this.j=i.argsEqual??C,this.m=i.onComplete,this.g=i.onError,this.autoRun=i.autoRun??true,"initialValue"in i&&(this.l=i.initialValue,this.status=2,this.k=this.A?.());}hostUpdate(){this.autoRun===true&&this.O();}hostUpdated(){this.autoRun==="afterUpdate"&&this.O();}A(){if(this.v===void 0)return;let t=this.v();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async O(){let t=this.A(),e=this.k;this.k=t,t===e||t===void 0||e!==void 0&&this.j(e,t)||await this.run(t);}async run(t){let e,s;t??(t=this.A()),this.k=t,this.status===1?this.T?.abort():(this.t=void 0,this.i=void 0,this.o=void 0),this.status=1,this.autoRun==="afterUpdate"?queueMicrotask(()=>this.p.requestUpdate()):this.p.requestUpdate();let i=++this.u;this.T=new AbortController;let o=false;try{e=await this._(t,{signal:this.T.signal});}catch(a){o=true,s=a;}if(this.u===i){if(e===w)this.status=0;else {if(o===false){try{this.m?.(e);}catch{}this.status=2,this.i?.(e);}else {try{this.g?.(s);}catch{}this.status=3,this.o?.(s);}this.l=e,this.h=s;}this.p.requestUpdate();}}abort(t){this.status===1&&this.T?.abort(t);}get value(){return this.l}get error(){return this.h}render(t){switch(this.status){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.status)}}},C=(r,t)=>r===t||r.length===t.length&&r.every((e,s)=>!p(e,t[s]));/*! Bundled license information:
2
2
 
3
3
  @lit/reactive-element/css-tag.js:
4
4
  (**
@@ -20,6 +20,4 @@ var h=window,c=h.ShadowRoot&&(h.ShadyCSS===void 0||h.ShadyCSS.nativeShadow)&&"ad
20
20
  * Copyright 2017 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
22
  *)
23
- */
24
-
25
- export { E as a };
23
+ */export{E as a};
@@ -1,6 +1,4 @@
1
- 'use strict';
2
-
3
- var h=window,c=h.ShadowRoot&&(h.ShadyCSS===void 0||h.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,m=Symbol(),_=new WeakMap,l=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==m)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o,e=this.t;if(c&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=_.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&_.set(e,t));}return t}toString(){return this.cssText}},g=r=>new l(typeof r=="string"?r:r+"",void 0,m);var v=(r,t)=>{c?r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let s=document.createElement("style"),i=h.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s);});},u=c?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return g(e)})(r):r;var f,d=window,$=d.trustedTypes,A=$?$.emptyScript:"",b=d.reactiveElementPolyfillSupport,y={toAttribute(r,t){switch(t){case Boolean:r=r?A:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r);}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r);}catch{e=null;}}return e}},p=(r,t)=>t!==r&&(t==t||r==r),S={attribute:!0,type:String,converter:y,reflect:!1,hasChanged:p},n=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u();}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t);}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,s)=>{let i=this._$Ep(s,e);i!==void 0&&(this._$Ev.set(i,s),t.push(i));}),t}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let s=typeof t=="symbol"?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Object.defineProperty(this.prototype,t,i);}}static getPropertyDescriptor(t,e,s){return {get(){return this[e]},set(i){let o=this[t];this[e]=i,this.requestUpdate(t,o,s);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||S}static finalize(){if(this.hasOwnProperty("finalized"))return !1;this.finalized=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let i of s)this.createProperty(i,e[i]);}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(u(i));}else t!==void 0&&e.push(u(t));return e}static _$Ep(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this));}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t));}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e]);});}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return v(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return (s=e.hostConnected)===null||s===void 0?void 0:s.call(e)});}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return (s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)});}attributeChangedCallback(t,e,s){this._$AK(t,s);}_$EO(t,e,s=S){var i;let o=this.constructor._$Ep(t,s);if(o!==void 0&&s.reflect===!0){let a=(((i=s.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?s.converter:y).toAttribute(e,s.type);this._$El=t,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$El=null;}}_$AK(t,e){var s;let i=this.constructor,o=i._$Ev.get(t);if(o!==void 0&&this._$El!==o){let a=i.getPropertyOptions(o),U=typeof a.converter=="function"?{fromAttribute:a.converter}:((s=a.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?a.converter:y;this._$El=o,this[o]=U.fromAttribute(e,a.type),this._$El=null;}}requestUpdate(t,e,s){let i=!0;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||p)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_;}catch(e){Promise.reject(e);}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let e=!1,s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(i=>{var o;return (o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(s)):this._$Ek();}catch(i){throw e=!1,this._$Ek(),i}e&&this._$AE(s);}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var i;return (i=s.hostUpdated)===null||i===void 0?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return !0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek();}updated(t){}firstUpdated(t){}};n.finalized=!0,n.elementProperties=new Map,n.elementStyles=[],n.shadowRootOptions={mode:"open"},b?.({ReactiveElement:n}),((f=d.reactiveElementVersions)!==null&&f!==void 0?f:d.reactiveElementVersions=[]).push("1.6.1");var w=Symbol(),E=class{get taskComplete(){return this.t||(this.status===1?this.t=new Promise((t,e)=>{this.i=t,this.o=e;}):this.status===3?this.t=Promise.reject(this.h):this.t=Promise.resolve(this.l)),this.t}constructor(t,e,s){this.u=0,this.status=0,(this.p=t).addController(this);let i=typeof e=="object"?e:{task:e,args:s};this._=i.task,this.v=i.args,this.j=i.argsEqual??C,this.m=i.onComplete,this.g=i.onError,this.autoRun=i.autoRun??!0,"initialValue"in i&&(this.l=i.initialValue,this.status=2,this.k=this.A?.());}hostUpdate(){this.autoRun===!0&&this.O();}hostUpdated(){this.autoRun==="afterUpdate"&&this.O();}A(){if(this.v===void 0)return;let t=this.v();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async O(){let t=this.A(),e=this.k;this.k=t,t===e||t===void 0||e!==void 0&&this.j(e,t)||await this.run(t);}async run(t){let e,s;t??(t=this.A()),this.k=t,this.status===1?this.T?.abort():(this.t=void 0,this.i=void 0,this.o=void 0),this.status=1,this.autoRun==="afterUpdate"?queueMicrotask(()=>this.p.requestUpdate()):this.p.requestUpdate();let i=++this.u;this.T=new AbortController;let o=!1;try{e=await this._(t,{signal:this.T.signal});}catch(a){o=!0,s=a;}if(this.u===i){if(e===w)this.status=0;else {if(o===!1){try{this.m?.(e);}catch{}this.status=2,this.i?.(e);}else {try{this.g?.(s);}catch{}this.status=3,this.o?.(s);}this.l=e,this.h=s;}this.p.requestUpdate();}}abort(t){this.status===1&&this.T?.abort(t);}get value(){return this.l}get error(){return this.h}render(t){switch(this.status){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.status)}}},C=(r,t)=>r===t||r.length===t.length&&r.every((e,s)=>!p(e,t[s]));/*! Bundled license information:
1
+ 'use strict';var h=window,c=h.ShadowRoot&&(h.ShadyCSS===void 0||h.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,m=Symbol(),_=new WeakMap,l=class{constructor(t,e,s){if(this._$cssResult$=true,s!==m)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o,e=this.t;if(c&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=_.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&_.set(e,t));}return t}toString(){return this.cssText}},g=r=>new l(typeof r=="string"?r:r+"",void 0,m);var v=(r,t)=>{c?r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let s=document.createElement("style"),i=h.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s);});},u=c?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return g(e)})(r):r;var f,d=window,$=d.trustedTypes,A=$?$.emptyScript:"",b=d.reactiveElementPolyfillSupport,y={toAttribute(r,t){switch(t){case Boolean:r=r?A:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r);}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r);}catch{e=null;}}return e}},p=(r,t)=>t!==r&&(t==t||r==r),S={attribute:true,type:String,converter:y,reflect:false,hasChanged:p},n=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=false,this.hasUpdated=false,this._$El=null,this.u();}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t);}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,s)=>{let i=this._$Ep(s,e);i!==void 0&&(this._$Ev.set(i,s),t.push(i));}),t}static createProperty(t,e=S){if(e.state&&(e.attribute=false),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let s=typeof t=="symbol"?Symbol():"__"+t,i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Object.defineProperty(this.prototype,t,i);}}static getPropertyDescriptor(t,e,s){return {get(){return this[e]},set(i){let o=this[t];this[e]=i,this.requestUpdate(t,o,s);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)||S}static finalize(){if(this.hasOwnProperty("finalized"))return false;this.finalized=true;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let i of s)this.createProperty(i,e[i]);}return this.elementStyles=this.finalizeStyles(this.styles),true}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let i of s)e.unshift(u(i));}else t!==void 0&&e.push(u(t));return e}static _$Ep(t,e){let s=e.attribute;return s===false?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this));}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t));}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e]);});}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return v(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(true),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return (s=e.hostConnected)===null||s===void 0?void 0:s.call(e)});}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return (s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)});}attributeChangedCallback(t,e,s){this._$AK(t,s);}_$EO(t,e,s=S){var i;let o=this.constructor._$Ep(t,s);if(o!==void 0&&s.reflect===true){let a=(((i=s.converter)===null||i===void 0?void 0:i.toAttribute)!==void 0?s.converter:y).toAttribute(e,s.type);this._$El=t,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$El=null;}}_$AK(t,e){var s;let i=this.constructor,o=i._$Ev.get(t);if(o!==void 0&&this._$El!==o){let a=i.getPropertyOptions(o),U=typeof a.converter=="function"?{fromAttribute:a.converter}:((s=a.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?a.converter:y;this._$El=o,this[o]=U.fromAttribute(e,a.type),this._$El=null;}}requestUpdate(t,e,s){let i=true;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||p)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===true&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):i=false),!this.isUpdatePending&&i&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=true;try{await this._$E_;}catch(e){Promise.reject(e);}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((i,o)=>this[o]=i),this._$Ei=void 0);let e=false,s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(i=>{var o;return (o=i.hostUpdate)===null||o===void 0?void 0:o.call(i)}),this.update(s)):this._$Ek();}catch(i){throw e=false,this._$Ek(),i}e&&this._$AE(s);}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var i;return (i=s.hostUpdated)===null||i===void 0?void 0:i.call(s)}),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$Ek(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return true}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek();}updated(t){}firstUpdated(t){}};n.finalized=true,n.elementProperties=new Map,n.elementStyles=[],n.shadowRootOptions={mode:"open"},b?.({ReactiveElement:n}),((f=d.reactiveElementVersions)!==null&&f!==void 0?f:d.reactiveElementVersions=[]).push("1.6.1");var w=Symbol(),E=class{get taskComplete(){return this.t||(this.status===1?this.t=new Promise((t,e)=>{this.i=t,this.o=e;}):this.status===3?this.t=Promise.reject(this.h):this.t=Promise.resolve(this.l)),this.t}constructor(t,e,s){this.u=0,this.status=0,(this.p=t).addController(this);let i=typeof e=="object"?e:{task:e,args:s};this._=i.task,this.v=i.args,this.j=i.argsEqual??C,this.m=i.onComplete,this.g=i.onError,this.autoRun=i.autoRun??true,"initialValue"in i&&(this.l=i.initialValue,this.status=2,this.k=this.A?.());}hostUpdate(){this.autoRun===true&&this.O();}hostUpdated(){this.autoRun==="afterUpdate"&&this.O();}A(){if(this.v===void 0)return;let t=this.v();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async O(){let t=this.A(),e=this.k;this.k=t,t===e||t===void 0||e!==void 0&&this.j(e,t)||await this.run(t);}async run(t){let e,s;t??(t=this.A()),this.k=t,this.status===1?this.T?.abort():(this.t=void 0,this.i=void 0,this.o=void 0),this.status=1,this.autoRun==="afterUpdate"?queueMicrotask(()=>this.p.requestUpdate()):this.p.requestUpdate();let i=++this.u;this.T=new AbortController;let o=false;try{e=await this._(t,{signal:this.T.signal});}catch(a){o=true,s=a;}if(this.u===i){if(e===w)this.status=0;else {if(o===false){try{this.m?.(e);}catch{}this.status=2,this.i?.(e);}else {try{this.g?.(s);}catch{}this.status=3,this.o?.(s);}this.l=e,this.h=s;}this.p.requestUpdate();}}abort(t){this.status===1&&this.T?.abort(t);}get value(){return this.l}get error(){return this.h}render(t){switch(this.status){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.status)}}},C=(r,t)=>r===t||r.length===t.length&&r.every((e,s)=>!p(e,t[s]));/*! Bundled license information:
4
2
 
5
3
  @lit/reactive-element/css-tag.js:
6
4
  (**
@@ -22,6 +20,4 @@ var h=window,c=h.ShadowRoot&&(h.ShadyCSS===void 0||h.ShadyCSS.nativeShadow)&&"ad
22
20
  * Copyright 2017 Google LLC
23
21
  * SPDX-License-Identifier: BSD-3-Clause
24
22
  *)
25
- */
26
-
27
- exports.a = E;
23
+ */exports.a=E;
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-TIOUPJWD.js';import {i,c,h}from'./chunk-A4GZBQEB.js';var a=["default","synthwave","dolphin"],l=class s{constructor(){this.themes=[];}static async get(t,i$1,m=true){if(s.instance||(s.instance=new s),s.instance.themes.find(e=>e.name===t))return Promise.resolve(s.instance);s.instance.themes.push({name:t});try{if(m&&!a.includes(t)){let e=document.createElement("link");e.rel="stylesheet",e.href=`${i$1}/${t}.css`,document.head.appendChild(e);}if(i$1&&!a.includes(t)){let{build:e}=await import(`${i$1}/${t}.js`);e(t,i,c,h);}else {let e=`./${a$1()}themes/${t}.js`,{build:d}=await import(e);d(t,i,c,h);}}catch(e){console.log("[mave-player]: theme not loaded",e);}return Promise.resolve(s.instance)}};export{l as a};
@@ -1,3 +1 @@
1
- var e=["audioprocess","canplay","canplaythrough","complete","duration_change","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"];
2
-
3
- export { e as a };
1
+ var e=["audioprocess","canplay","canplaythrough","complete","duration_change","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"];export{e as a};
@@ -6,6 +6,4 @@ lit-html/directive.js:
6
6
  * Copyright 2017 Google LLC
7
7
  * SPDX-License-Identifier: BSD-3-Clause
8
8
  *)
9
- */
10
-
11
- export { T as a, _ as b, s as c };
9
+ */export{T as a,_ as b,s as c};
@@ -0,0 +1,9 @@
1
+ import {b,c,a}from'./chunk-MMHEOMF5.js';import {e}from'./chunk-A4GZBQEB.js';var u="important",d=" !"+u,h=b(class extends c{constructor(s){if(super(s),s.type!==a.ATTRIBUTE||s.name!=="style"||s.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((n,t)=>{let e=s[t];return e==null?n:n+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${e};`},"")}update(s,[n]){let{style:t}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(n)),this.render(n);for(let e of this.ft)n[e]==null&&(this.ft.delete(e),e.includes("-")?t.removeProperty(e):t[e]=null);for(let e in n){let r=n[e];if(r!=null){this.ft.add(e);let i=typeof r=="string"&&r.endsWith(d);e.includes("-")||i?t.setProperty(e,i?r.slice(0,-11):r,i?u:""):t[e]=r;}}return e}});/*! Bundled license information:
2
+
3
+ lit-html/directives/style-map.js:
4
+ (**
5
+ * @license
6
+ * Copyright 2018 Google LLC
7
+ * SPDX-License-Identifier: BSD-3-Clause
8
+ *)
9
+ */export{h as a};
@@ -1,12 +1,4 @@
1
- 'use strict';
2
-
3
- var chunk7NWFIY3O_cjs = require('./chunk-7NWFIY3O.cjs');
4
- var chunkUEEYC5OJ_cjs = require('./chunk-UEEYC5OJ.cjs');
5
- var chunk26S26OLO_cjs = require('./chunk-26S26OLO.cjs');
6
- var chunkKGTAAGUE_cjs = require('./chunk-KGTAAGUE.cjs');
7
- var chunk5Y5M5ND5_cjs = require('./chunk-5Y5M5ND5.cjs');
8
-
9
- var i=class extends chunkKGTAAGUE_cjs.i{get backdrop(){return this._backdropColor||"black"}set backdrop(t){this._backdropColor!=t&&(this._backdropColor=t);}get backdropFilter(){return this._backdropFilter}set backdropFilter(t){this._backdropFilter!=t&&(this._backdropFilter=t);}get styles(){let t={"--backdrop":this.backdrop,"--backdrop-filter":this.backdropFilter};return chunkUEEYC5OJ_cjs.a(t)}open(t){if(this._player=t,t.aspect_ratio){let[s,o]=t.aspect_ratio.split("/");this.style.setProperty("--frame-ratio-w",s),this.style.setProperty("--frame-ratio-h",o);}this.style.display="block";let a=s=>{this._frame.appendChild(t),setTimeout(()=>{this._dialog.showModal();},25),this._dialog.addEventListener("close",o=>{o.preventDefault(),this.close();},{once:!0}),s(this);};return new Promise(s=>{if(this._dialog)a(s);else {let o=setInterval(()=>{this._dialog&&(a(s),clearInterval(o));},100);return}})}possibleClose(t){t.target!=this._player&&this.close();}close(){this._dialog.close(),this._backdrop.addEventListener("transitionend",()=>{this._frame.innerHTML="",this.dispatchEvent(new Event("closed",{bubbles:!0}));},{once:!0});}render(){return chunkKGTAAGUE_cjs.c`
1
+ 'use strict';var chunkOOYAQ2X4_cjs=require('./chunk-OOYAQ2X4.cjs'),chunkQ22T22LT_cjs=require('./chunk-Q22T22LT.cjs'),chunkFUBUUA7Y_cjs=require('./chunk-FUBUUA7Y.cjs'),chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs'),chunkIPA5Q26W_cjs=require('./chunk-IPA5Q26W.cjs');var i=class extends chunk5NSCV6C2_cjs.i{get backdrop(){return this._backdropColor||"black"}set backdrop(t){this._backdropColor!=t&&(this._backdropColor=t);}get backdropFilter(){return this._backdropFilter}set backdropFilter(t){this._backdropFilter!=t&&(this._backdropFilter=t);}get styles(){let t={"--backdrop":this.backdrop,"--backdrop-filter":this.backdropFilter};return chunkQ22T22LT_cjs.a(t)}open(t){if(this._player=t,t.aspect_ratio){let[o,d]=t.aspect_ratio.split("/");this.style.setProperty("--frame-ratio-w",o),this.style.setProperty("--frame-ratio-h",d);}this.style.display="block";let n=o=>{this._frame.appendChild(t),setTimeout(()=>{this._dialog.showModal();},25),this._dialog.addEventListener("close",d=>{d.preventDefault(),this.close();},{once:true}),o(this);};return new Promise(o=>{if(this._dialog)n(o);else {let d=setInterval(()=>{this._dialog&&(n(o),clearInterval(d));},100);return}})}possibleClose(t){t.target!=this._player&&this.close();}close(){this._dialog.close(),this._backdrop.addEventListener("transitionend",()=>{this._frame.innerHTML="",this.dispatchEvent(new Event("closed",{bubbles:true}));},{once:true});}render(){return chunk5NSCV6C2_cjs.c`
10
2
  <dialog style=${this.styles}>
11
3
  <div class="backdrop"></div>
12
4
  <div class="content" @click=${this.possibleClose}>
@@ -35,7 +27,7 @@ var i=class extends chunkKGTAAGUE_cjs.i{get backdrop(){return this._backdropColo
35
27
  </svg>
36
28
  </div>
37
29
  </dialog>
38
- `}};i.styles=chunkKGTAAGUE_cjs.h`
30
+ `}};i.styles=chunk5NSCV6C2_cjs.h`
39
31
  :host {
40
32
  all: initial;
41
33
  --backdrop: black;
@@ -159,7 +151,4 @@ var i=class extends chunkKGTAAGUE_cjs.i{get backdrop(){return this._backdropColo
159
151
  background-position: center center;
160
152
  background-repeat: no-repeat;
161
153
  }
162
- `,chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c("dialog")],i.prototype,"_dialog",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c(".content")],i.prototype,"_content",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c(".frame")],i.prototype,"_frame",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c(".backdrop")],i.prototype,"_backdrop",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],i.prototype,"backdrop",1),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a({attribute:"backdrop-filter"})],i.prototype,"backdropFilter",1);window&&window.customElements&&(window.customElements.get("mave-pop")||window.customElements.define("mave-pop",i));function k(l){let d={};if(!l)return d;for(let t=0;t<l.attributes.length;t++){let a=l.attributes[t];d[a.name]=a.value;}return d}var w=l=>{function d(o){let e,r,n=document.querySelector(`mave-pop[embed="${o}"]`);if(n)return r=k(n.querySelector("mave-player")),e=n,{pop:e,attributes:r};let p=document.querySelector("mave-pop:not([embed])");return p?(r=k(p.querySelector("mave-player")),e=p,{pop:e,attributes:r}):(e=new i,document.body.appendChild(e),{pop:e})}function t(o,e){let r=new chunk7NWFIY3O_cjs.a;if(e)for(let n in e)r.setAttribute(n,e[n]);return r.embed=o,r}function a(o){o.querySelectorAll("[x-mave-pop]").forEach(e=>{let r=e.getAttribute("x-mave-pop")||e.getAttribute("embed");if(!r)return;let{pop:n,attributes:p}=d(r);t(r,p),e.addEventListener("click",E=>{E.preventDefault();let _=document.querySelectorAll("mave-player");if(!Array.from(_).find(m=>m.popped)){let m=t(r,p);n.open(m).then(()=>{m.play();}),n.addEventListener("closed",()=>{m.pause();});}});});}a(l),new MutationObserver(o=>{for(let e of o)e.type==="childList"&&e.addedNodes.forEach(r=>{r instanceof HTMLElement&&a(r);});}).observe(document.body,{childList:!0,subtree:!0});};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{w(document);}):setTimeout(()=>w(document),500);
163
-
164
- exports.a = i;
165
- exports.b = w;
154
+ `,chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.c("dialog")],i.prototype,"_dialog",2),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.c(".content")],i.prototype,"_content",2),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.c(".frame")],i.prototype,"_frame",2),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.c(".backdrop")],i.prototype,"_backdrop",2),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a()],i.prototype,"backdrop",1),chunkIPA5Q26W_cjs.c([chunkFUBUUA7Y_cjs.a({attribute:"backdrop-filter"})],i.prototype,"backdropFilter",1);window&&window.customElements&&(window.customElements.get("mave-pop")||window.customElements.define("mave-pop",i));function k(l){let t={};if(!l)return t;for(let n=0;n<l.attributes.length;n++){let o=l.attributes[n];t[o.name]=o.value;}return t}var w=l=>{function t(s){let e,r,a=document.querySelector(`mave-pop[embed="${s}"]`);if(a)return r=k(a.querySelector("mave-player")),e=a,{pop:e,attributes:r};let p=document.querySelector("mave-pop:not([embed])");return p?(r=k(p.querySelector("mave-player")),e=p,{pop:e,attributes:r}):(e=new i,document.body.appendChild(e),{pop:e})}function n(s,e){let r=new chunkOOYAQ2X4_cjs.a;if(e)for(let a in e)r.setAttribute(a,e[a]);return r.embed=s,r}function o(s){s.querySelectorAll("[x-mave-pop]").forEach(e=>{let r=e.getAttribute("x-mave-pop")||e.getAttribute("embed");if(!r)return;let{pop:a,attributes:p}=t(r);n(r,p),e.addEventListener("click",E=>{E.preventDefault();let _=document.querySelectorAll("mave-player");if(!Array.from(_).find(m=>m.popped)){let m=n(r,p);a.open(m).then(()=>{m.play();}),a.addEventListener("closed",()=>{m.pause();});}});});}o(l),new MutationObserver(s=>{for(let e of s)e.type==="childList"&&e.addedNodes.forEach(r=>{r instanceof HTMLElement&&o(r);});}).observe(document.body,{childList:true,subtree:true});};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{w(document);}):setTimeout(()=>w(document),500);exports.a=i;exports.b=w;
@@ -0,0 +1 @@
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};
@@ -0,0 +1,20 @@
1
+ 'use strict';var chunkKCZRQ4AS_cjs=require('./chunk-KCZRQ4AS.cjs'),chunkVW7IKXVI_cjs=require('./chunk-VW7IKXVI.cjs'),chunkFUBUUA7Y_cjs=require('./chunk-FUBUUA7Y.cjs'),chunk5NSCV6C2_cjs=require('./chunk-5NSCV6C2.cjs'),chunkIPA5Q26W_cjs=require('./chunk-IPA5Q26W.cjs');var i,d,E,A,h,c=class extends chunkVW7IKXVI_cjs.a{constructor(){super(...arguments);chunkIPA5Q26W_cjs.e(this,i);this.embedController=new chunkKCZRQ4AS_cjs.b(this);}get embed(){return this._embed}set embed(o){this._embed!==o&&(this._embed=o,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:o=>{if(this._data=o,!o)return;let r=this._slottedChildren.map(t=>{function e(){let n;return t.nodeName==="TEMPLATE"?n=t.content.cloneNode(true):n=t.cloneNode(true),n}if(t.getAttribute("name")=="mave-files-video"){let n=e(),a=new Date(this._data.created_at);a&&chunkIPA5Q26W_cjs.f(this,i,d).call(this,n,'[slot="date"]',a.toLocaleDateString().replaceAll("/","-"));let p=this._data.video.duration;p&&chunkIPA5Q26W_cjs.f(this,i,d).call(this,n,'[slot="duration"]',this.durationToTime(p));let f=this._data.video.filetype;f&&chunkIPA5Q26W_cjs.f(this,i,d).call(this,n,'[slot="filetype"]',f);let b=this._data.video.size,C=b/1e6;b&&chunkIPA5Q26W_cjs.f(this,i,d).call(this,n,'[slot="size"]',`${C.toFixed(1)} MB`);let u=chunkIPA5Q26W_cjs.f(this,i,h).call(this,`${this.cdn_root}/${this.embedId}/h264_hd.mp4`,`${this._data.name}.mp4`);return u.setAttribute("aria-label","Download video"),u.appendChild(n),chunk5NSCV6C2_cjs.c`${u}`}if(this._data.video.audio&&t.getAttribute("name")=="mave-files-audio"){let n=e();chunkIPA5Q26W_cjs.f(this,i,d).call(this,n,'[slot="filetype"]',"mp3");let a=chunkIPA5Q26W_cjs.f(this,i,h).call(this,`${this.cdn_root}/${this.embedId}/audio.mp3`,`${this._data.name}.mp3`);return a.setAttribute("aria-label","Download audio"),a.appendChild(n),chunk5NSCV6C2_cjs.c`${a}`}let m=this._data.subtitles.find(n=>n.language==this._data.video.language);if(m&&t.getAttribute("name")=="mave-files-subtitles"){let n=e();chunkIPA5Q26W_cjs.f(this,i,d).call(this,n,'[slot="filetype"]',"vtt");let a=chunkIPA5Q26W_cjs.f(this,i,h).call(this,m.path,`${this._data.name}.vtt`);return a.setAttribute("aria-label","Download subtitles"),a.appendChild(n),chunk5NSCV6C2_cjs.c`${a}`}});return chunk5NSCV6C2_cjs.c`${this._stylesheets} ${r}`}})}
3
+ `}renderPending(){return chunk5NSCV6C2_cjs.c`<slot style="display: none"></slot>`}};i=new WeakSet,d=function(o,r,t){let e=o.querySelector(r);e&&(e.textContent=t,e.removeAttribute("slot"));},E=function(o,r){let t=window.URL.createObjectURL(o),e=document.createElement("a");e.style.display="none",e.href=t,e.download=r,this.appendChild(e),e.click(),window.URL.revokeObjectURL(t),this.removeChild(e);},A=function(o,r){return fetch(o).then(t=>{if(!t.ok)throw new Error("Network response was not ok");return t.blob()}).then(t=>chunkIPA5Q26W_cjs.f(this,i,E).call(this,t,r)).catch(t=>console.error("Something went wrong:",t))},h=function(o,r){let t=document.createElement("a");t.classList.add("link"),t.setAttribute("href",o),t.setAttribute("download",r),t.setAttribute("target","new");let e=false;return t.addEventListener("click",m=>{m.preventDefault(),!e&&(e=true,t.style.cursor="wait",t.style.opacity="0.5",chunkIPA5Q26W_cjs.f(this,i,A).call(this,o,r).then(()=>{e=false,t.style.cursor="pointer",t.style.opacity="1";}));}),t},c.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})],c.prototype,"embed",1);window&&window.customElements&&(window.customElements.get("mave-files")||window.customElements.define("mave-files",c));exports.a=c;