@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.
- package/dist/chunk-2C6BGW6H.js +10 -0
- package/dist/chunk-3GACH56T.js +20 -0
- package/dist/chunk-3GVDBAOP.cjs +1 -8
- package/dist/chunk-3PLBZPRP.js +1 -0
- package/dist/{chunk-AEKWMZ2I.js → chunk-3R7TX6NC.js} +2 -6
- package/dist/chunk-4GTAVYTC.cjs +93 -0
- package/dist/chunk-5KQJTT3P.cjs +24 -0
- package/dist/chunk-5NKBIUPL.cjs +1 -2
- package/dist/chunk-5NSCV6C2.cjs +53 -0
- package/dist/chunk-5OEIKFAN.js +93 -0
- package/dist/chunk-5STN56TL.cjs +2 -6
- package/dist/chunk-5UMTSGHI.cjs +37 -0
- package/dist/chunk-6NL5KOSJ.js +1209 -0
- package/dist/chunk-7LKYLXK5.js +104 -0
- package/dist/chunk-A4GZBQEB.js +53 -0
- package/dist/{chunk-JG6DKVEF.js → chunk-B6XMC3AJ.js} +2 -10
- package/dist/chunk-BRZI5I43.cjs +3 -8
- package/dist/chunk-COWZ7GYF.cjs +1 -0
- package/dist/chunk-CUGRXOA2.js +24 -0
- package/dist/chunk-DOR5AD7J.js +35 -0
- package/dist/{chunk-26S26OLO.cjs → chunk-FUBUUA7Y.cjs} +2 -10
- package/dist/chunk-GO5AXJUO.js +1 -6
- package/dist/chunk-H57FX4I6.cjs +9 -0
- package/dist/{chunk-R2QJ6RON.js → chunk-HMISRRKC.js} +2 -6
- package/dist/chunk-IPA5Q26W.cjs +1 -0
- package/dist/chunk-JBV2AYRP.js +2 -3
- package/dist/chunk-KCZRQ4AS.cjs +1 -10
- package/dist/chunk-KDE6VE72.js +37 -0
- package/dist/chunk-KTP5LV2E.cjs +1 -0
- package/dist/chunk-LCTGZL3L.js +2 -4
- package/dist/chunk-LG2O4WV2.cjs +2 -6
- package/dist/chunk-MAOTHFPC.js +1 -0
- package/dist/chunk-MK4VIJT3.js +1 -3
- package/dist/chunk-MMHEOMF5.js +1 -3
- package/dist/chunk-MS5NFI3Q.js +9 -0
- package/dist/{chunk-5XZY6X6O.cjs → chunk-N53P7KPA.cjs} +3 -14
- package/dist/chunk-NDDFZTBA.js +1 -0
- package/dist/chunk-O4SVRXZ6.cjs +20 -0
- package/dist/chunk-OOYAQ2X4.cjs +1209 -0
- package/dist/chunk-OZVIXWBD.cjs +104 -0
- package/dist/chunk-P4RYGSTU.cjs +35 -0
- package/dist/chunk-Q22T22LT.cjs +9 -0
- package/dist/chunk-RRCW5BBR.cjs +2 -8
- package/dist/chunk-SDKTBB4N.cjs +1 -5
- package/dist/chunk-TI75IJ2E.cjs +1 -7
- package/dist/chunk-TIOUPJWD.js +1 -0
- package/dist/chunk-TPP5OQFR.js +1 -5
- package/dist/chunk-U6N2SUDH.js +7 -0
- package/dist/chunk-URZX7GGF.cjs +7 -0
- package/dist/chunk-VW7IKXVI.cjs +1 -0
- package/dist/chunk-WE5NUDRY.js +0 -1
- package/dist/chunk-WLVMWIKH.cjs +10 -0
- package/dist/chunk-XSYWRQWB.js +1 -7
- package/dist/chunk-ZXCHPIGV.js +3 -6
- package/dist/components/clip.cjs +1 -21
- package/dist/components/clip.js +1 -12
- package/dist/components/files.cjs +1 -18
- package/dist/components/files.js +1 -9
- package/dist/components/img.cjs +1 -15
- package/dist/components/img.js +1 -6
- package/dist/components/list.cjs +1 -27
- package/dist/components/list.js +1 -18
- package/dist/components/player.cjs +1 -24
- package/dist/components/player.js +1 -15
- package/dist/components/pop.cjs +1 -30
- package/dist/components/pop.js +1 -17
- package/dist/components/text.cjs +1 -19
- package/dist/components/text.js +1 -10
- package/dist/components/upload.cjs +1 -20
- package/dist/components/upload.js +1 -11
- package/dist/config.cjs +1 -15
- package/dist/config.js +1 -2
- package/dist/embed/api.cjs +1 -12
- package/dist/embed/api.d.cts +1 -1
- package/dist/embed/api.d.ts +1 -1
- package/dist/embed/api.js +1 -3
- package/dist/embed/caption.cjs +1 -13
- package/dist/embed/caption.js +1 -4
- package/dist/embed/controller.cjs +1 -18
- package/dist/embed/controller.js +1 -5
- package/dist/embed/socket.cjs +1 -9
- package/dist/embed/socket.js +1 -3
- package/dist/generated/locales/de.cjs +1 -7
- package/dist/generated/locales/de.js +1 -5
- package/dist/generated/locales/en.cjs +1 -7
- package/dist/generated/locales/en.js +1 -5
- package/dist/generated/locales/fr.cjs +1 -7
- package/dist/generated/locales/fr.js +1 -5
- package/dist/generated/locales/nl.cjs +1 -7
- package/dist/generated/locales/nl.js +1 -5
- package/dist/index.cjs +1 -68
- package/dist/index.js +1 -27
- package/dist/lottie-player.esm-BBAKIFYQ.js +283 -0
- package/dist/lottie-player.esm-OYBEUNQX.cjs +283 -0
- package/dist/react.cjs +1 -50
- package/dist/react.js +1 -33
- package/dist/themes/default.cjs +12 -16
- package/dist/themes/default.js +12 -14
- package/dist/themes/dolphin.cjs +31 -19
- package/dist/themes/dolphin.js +31 -17
- package/dist/themes/loader.cjs +1 -13
- package/dist/themes/loader.js +1 -4
- package/dist/themes/synthwave.cjs +31 -19
- package/dist/themes/synthwave.js +31 -17
- package/dist/utils/localization.cjs +1 -24
- package/dist/utils/localization.js +1 -3
- package/dist/utils/mave_element.cjs +1 -14
- package/dist/utils/mave_element.js +1 -5
- package/dist/utils/origin.cjs +1 -11
- package/dist/utils/origin.d.cts +1 -1
- package/dist/utils/origin.d.ts +1 -1
- package/dist/utils/origin.js +1 -2
- package/dist/utils/video_events.cjs +1 -11
- package/dist/utils/video_events.js +1 -2
- package/package.json +4 -4
- package/dist/chunk-3TMDPPCI.cjs +0 -8
- package/dist/chunk-4OU2YZKL.cjs +0 -30
- package/dist/chunk-5C42H643.cjs +0 -10
- package/dist/chunk-5Y5M5ND5.cjs +0 -10
- package/dist/chunk-7NWFIY3O.cjs +0 -1218
- package/dist/chunk-A3PLFLYH.cjs +0 -46
- package/dist/chunk-B6BTCKVU.js +0 -16
- package/dist/chunk-BTPWX6DH.cjs +0 -17
- package/dist/chunk-CF5QCOBL.js +0 -14
- package/dist/chunk-E26F4RGL.js +0 -6
- package/dist/chunk-HZNWCQWL.js +0 -97
- package/dist/chunk-IFM2GZME.js +0 -55
- package/dist/chunk-JJNBEE42.js +0 -1216
- package/dist/chunk-KGTAAGUE.cjs +0 -65
- package/dist/chunk-LDQKDXUQ.js +0 -48
- package/dist/chunk-MHDCCX7Q.cjs +0 -34
- package/dist/chunk-MS3Q4WGR.cjs +0 -6
- package/dist/chunk-NR4EI5W5.js +0 -30
- package/dist/chunk-OLR7D3Q6.cjs +0 -15
- package/dist/chunk-OPVGT665.cjs +0 -114
- package/dist/chunk-P6GNG5DI.cjs +0 -18
- package/dist/chunk-QJP5WK2K.js +0 -44
- package/dist/chunk-R3PDNBU4.js +0 -3
- package/dist/chunk-RNHNE3HL.cjs +0 -101
- package/dist/chunk-UEEYC5OJ.cjs +0 -16
- package/dist/chunk-VOXORDG3.js +0 -8
- package/dist/chunk-XD2KSQMH.cjs +0 -50
- package/dist/chunk-XEE2D3NF.js +0 -28
- package/dist/chunk-ZFM2N7YP.js +0 -15
- package/dist/chunk-ZFZIJ4A5.js +0 -3
- package/dist/chunk-ZWBOG4VV.js +0 -114
- package/dist/lottie-player.esm-4DQZVY6A.cjs +0 -289
- package/dist/lottie-player.esm-5KD3VGXP.js +0 -287
package/dist/chunk-OPVGT665.cjs
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkRNHNE3HL_cjs = require('./chunk-RNHNE3HL.cjs');
|
|
4
|
-
var chunkBRZI5I43_cjs = require('./chunk-BRZI5I43.cjs');
|
|
5
|
-
var chunkUEEYC5OJ_cjs = require('./chunk-UEEYC5OJ.cjs');
|
|
6
|
-
var chunk26S26OLO_cjs = require('./chunk-26S26OLO.cjs');
|
|
7
|
-
var chunkKGTAAGUE_cjs = require('./chunk-KGTAAGUE.cjs');
|
|
8
|
-
var chunk5STN56TL_cjs = require('./chunk-5STN56TL.cjs');
|
|
9
|
-
var chunk5Y5M5ND5_cjs = require('./chunk-5Y5M5ND5.cjs');
|
|
10
|
-
|
|
11
|
-
var Pt=chunk5Y5M5ND5_cjs.a((ro,Et)=>{Et.exports=function(t,r){if(r=r.split(":")[0],t=+t,!t)return !1;switch(r){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return !1}return t!==0};});var Rt=chunk5Y5M5ND5_cjs.a(Te=>{var Wr=Object.prototype.hasOwnProperty,Xr;function Ot(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function kt(e){try{return encodeURIComponent(e)}catch{return null}}function Yr(e){for(var t=/([^=?#&]+)=?([^&]*)/g,r={},n;n=t.exec(e);){var o=Ot(n[1]),s=Ot(n[2]);o===null||s===null||o in r||(r[o]=s);}return r}function Zr(e,t){t=t||"";var r=[],n,o;typeof t!="string"&&(t="?");for(o in e)if(Wr.call(e,o)){if(n=e[o],!n&&(n===null||n===Xr||isNaN(n))&&(n=""),o=kt(o),n=kt(n),o===null||n===null)continue;r.push(o+"="+n);}return r.length?t+r.join("&"):""}Te.stringify=Zr;Te.parse=Yr;});var It=chunk5Y5M5ND5_cjs.a((oo,Ft)=>{var Ct=Pt(),ge=Rt(),Vr=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Lt=/[\n\r\t]/g,Jr=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Tt=/:\d+$/,Qr=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,en=/^[a-zA-Z]:/;function De(e){return (e||"").toString().replace(Vr,"")}var Ae=[["#","hash"],["?","query"],function(t,r){return A(r.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],jt={hash:1,query:1};function At(e){var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t={};var r=t.location||{};e=e||r;var n={},o=typeof e,s;if(e.protocol==="blob:")n=new D(unescape(e.pathname),{});else if(o==="string"){n=new D(e,{});for(s in jt)delete n[s];}else if(o==="object"){for(s in e)s in jt||(n[s]=e[s]);n.slashes===void 0&&(n.slashes=Jr.test(e.href));}return n}function A(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function Dt(e,t){e=De(e),e=e.replace(Lt,""),t=t||{};var r=Qr.exec(e),n=r[1]?r[1].toLowerCase():"",o=!!r[2],s=!!r[3],l=0,p;return o?s?(p=r[2]+r[3]+r[4],l=r[2].length+r[3].length):(p=r[2]+r[4],l=r[2].length):s?(p=r[3]+r[4],l=r[3].length):p=r[4],n==="file:"?l>=2&&(p=p.slice(2)):A(n)?p=r[4]:n?o&&(p=p.slice(2)):l>=2&&A(t.protocol)&&(p=r[4]),{protocol:n,slashes:o||A(n),slashesCount:l,rest:p}}function tn(e,t){if(e==="")return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],s=!1,l=0;n--;)r[n]==="."?r.splice(n,1):r[n]===".."?(r.splice(n,1),l++):l&&(n===0&&(s=!0),r.splice(n,1),l--);return s&&r.unshift(""),(o==="."||o==="..")&&r.push(""),r.join("/")}function D(e,t,r){if(e=De(e),e=e.replace(Lt,""),!(this instanceof D))return new D(e,t,r);var n,o,s,l,p,h,m=Ae.slice(),g=typeof t,y=this,j=0;for(g!=="object"&&g!=="string"&&(r=t,t=null),r&&typeof r!="function"&&(r=ge.parse),t=At(t),o=Dt(e||"",t),n=!o.protocol&&!o.slashes,y.slashes=o.slashes||n&&t.slashes,y.protocol=o.protocol||t.protocol||"",e=o.rest,(o.protocol==="file:"&&(o.slashesCount!==2||en.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!A(y.protocol)))&&(m[3]=[/(.*)/,"pathname"]);j<m.length;j++){if(l=m[j],typeof l=="function"){e=l(e,y);continue}s=l[0],h=l[1],s!==s?y[h]=e:typeof s=="string"?(p=s==="@"?e.lastIndexOf(s):e.indexOf(s),~p&&(typeof l[2]=="number"?(y[h]=e.slice(0,p),e=e.slice(p+l[2])):(y[h]=e.slice(p),e=e.slice(0,p)))):(p=s.exec(e))&&(y[h]=p[1],e=e.slice(0,p.index)),y[h]=y[h]||n&&l[3]&&t[h]||"",l[4]&&(y[h]=y[h].toLowerCase());}r&&(y.query=r(y.query)),n&&t.slashes&&y.pathname.charAt(0)!=="/"&&(y.pathname!==""||t.pathname!=="")&&(y.pathname=tn(y.pathname,t.pathname)),y.pathname.charAt(0)!=="/"&&A(y.protocol)&&(y.pathname="/"+y.pathname),Ct(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(p=y.auth.indexOf(":"),~p?(y.username=y.auth.slice(0,p),y.username=encodeURIComponent(decodeURIComponent(y.username)),y.password=y.auth.slice(p+1),y.password=encodeURIComponent(decodeURIComponent(y.password))):y.username=encodeURIComponent(decodeURIComponent(y.auth)),y.auth=y.password?y.username+":"+y.password:y.username),y.origin=y.protocol!=="file:"&&A(y.protocol)&&y.host?y.protocol+"//"+y.host:"null",y.href=y.toString();}function rn(e,t,r){var n=this;switch(e){case"query":typeof t=="string"&&t.length&&(t=(r||ge.parse)(t)),n[e]=t;break;case"port":n[e]=t,Ct(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,Tt.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!r;break;case"pathname":case"hash":if(t){var o=e==="pathname"?"/":"#";n[e]=t.charAt(0)!==o?o+t:t;}else n[e]=t;break;case"username":case"password":n[e]=encodeURIComponent(t);break;case"auth":var s=t.indexOf(":");~s?(n.username=t.slice(0,s),n.username=encodeURIComponent(decodeURIComponent(n.username)),n.password=t.slice(s+1),n.password=encodeURIComponent(decodeURIComponent(n.password))):n.username=encodeURIComponent(decodeURIComponent(t));}for(var l=0;l<Ae.length;l++){var p=Ae[l];p[4]&&(n[p[1]]=n[p[1]].toLowerCase());}return n.auth=n.password?n.username+":"+n.password:n.username,n.origin=n.protocol!=="file:"&&A(n.protocol)&&n.host?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function nn(e){(!e||typeof e!="function")&&(e=ge.stringify);var t,r=this,n=r.host,o=r.protocol;o&&o.charAt(o.length-1)!==":"&&(o+=":");var s=o+(r.protocol&&r.slashes||A(r.protocol)?"//":"");return r.username?(s+=r.username,r.password&&(s+=":"+r.password),s+="@"):r.password?(s+=":"+r.password,s+="@"):r.protocol!=="file:"&&A(r.protocol)&&!n&&r.pathname!=="/"&&(s+="@"),(n[n.length-1]===":"||Tt.test(r.hostname)&&!r.port)&&(n+=":"),s+=n+r.pathname,t=typeof r.query=="object"?e(r.query):r.query,t&&(s+=t.charAt(0)!=="?"?"?"+t:t),r.hash&&(s+=r.hash),s}D.prototype={set:rn,toString:nn};D.extractProtocol=Dt;D.location=At;D.trimLeft=De;D.qs=ge;Ft.exports=D;});function Z(e){"@babel/helpers - typeof";return Z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(e)}function nt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_r(n.key),n);}}function br(e,t,r){return t&&nt(e.prototype,t),r&&nt(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _r(e){var t=wr(e,"string");return Z(t)=="symbol"?t:t+""}function wr(e,t){if(Z(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Z(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}function xr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sr(e,t,r){return t=ue(t),Ur(e,ke()?Reflect.construct(t,r||[],ue(e).constructor):t.apply(e,r))}function Ur(e,t){if(t&&(Z(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Er(e)}function Er(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pr(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&se(e,t);}function Oe(e){var t=typeof Map=="function"?new Map:void 0;return Oe=function(n){if(n===null||!kr(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,o);}function o(){return Or(n,arguments,ue(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),se(o,n)},Oe(e)}function Or(e,t,r){if(ke())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,t);var o=new(e.bind.apply(e,n));return r&&se(o,r.prototype),o}function ke(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (ke=function(){return !!e})()}function kr(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function se(e,t){return se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},se(e,t)}function ue(e){return ue=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ue(e)}var Rr=function(e){function t(r){var n,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(xr(this,t),n=Sr(this,t,[r]),n.originalRequest=s,n.originalResponse=l,n.causingError=o,o!=null&&(r+=", caused by ".concat(o.toString())),s!=null){var p=s.getHeader("X-Request-ID")||"n/a",h=s.getMethod(),m=s.getURL(),g=l?l.getStatus():"n/a",y=l?l.getBody()||"":"n/a";r+=", originated from request (method: ".concat(h,", url: ").concat(m,", response code: ").concat(g,", response text: ").concat(y,", request id: ").concat(p,")");}return n.message=r,n}return Pr(t,e),br(t)}(Oe(Error)),V=Rr;function z(e){}function le(e){"@babel/helpers - typeof";return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},le(e)}function Cr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ot(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Tr(n.key),n);}}function Lr(e,t,r){return t&&ot(e.prototype,t),r&&ot(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tr(e){var t=Ar(e,"string");return le(t)=="symbol"?t:t+""}function Ar(e,t){if(le(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(le(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}var it=function(){function e(){Cr(this,e);}return Lr(e,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(r){return Promise.resolve([])}},{key:"removeUpload",value:function(r){return Promise.resolve()}},{key:"addUpload",value:function(r,n){return Promise.resolve(null)}}])}();var ct="3.7.5",Dr=ct,Fr=typeof atob=="function",Ir=typeof btoa=="function",Q=typeof Buffer=="function",at=typeof TextDecoder=="function"?new TextDecoder:void 0,st=typeof TextEncoder=="function"?new TextEncoder:void 0,Nr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",fe=Array.prototype.slice.call(Nr),me=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(fe),Br=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,U=String.fromCharCode.bind(String),ut=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),pt=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),ht=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),dt=e=>{let t,r,n,o,s="",l=e.length%3;for(let p=0;p<e.length;){if((r=e.charCodeAt(p++))>255||(n=e.charCodeAt(p++))>255||(o=e.charCodeAt(p++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|o,s+=fe[t>>18&63]+fe[t>>12&63]+fe[t>>6&63]+fe[t&63];}return l?s.slice(0,l-3)+"===".substring(l):s},Ce=Ir?e=>btoa(e):Q?e=>Buffer.from(e,"binary").toString("base64"):dt,Re=Q?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,o=e.length;n<o;n+=4096)r.push(U.apply(null,e.subarray(n,n+4096)));return Ce(r.join(""))},ve=(e,t=!1)=>t?pt(Re(e)):Re(e),zr=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?U(192|t>>>6)+U(128|t&63):U(224|t>>>12&15)+U(128|t>>>6&63)+U(128|t&63)}else {var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return U(240|t>>>18&7)+U(128|t>>>12&63)+U(128|t>>>6&63)+U(128|t&63)}},Hr=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,yt=e=>e.replace(Hr,zr),lt=Q?e=>Buffer.from(e,"utf8").toString("base64"):st?e=>Re(st.encode(e)):e=>Ce(yt(e)),J=(e,t=!1)=>t?pt(lt(e)):lt(e),ft=e=>J(e,!0),qr=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Mr=e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return U((r>>>10)+55296)+U((r&1023)+56320);case 3:return U((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return U((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},mt=e=>e.replace(qr,Mr),vt=e=>{if(e=e.replace(/\s+/g,""),!Br.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r="",n,o;for(let s=0;s<e.length;)t=me[e.charAt(s++)]<<18|me[e.charAt(s++)]<<12|(n=me[e.charAt(s++)])<<6|(o=me[e.charAt(s++)]),r+=n===64?U(t>>16&255):o===64?U(t>>16&255,t>>8&255):U(t>>16&255,t>>8&255,t&255);return r},Le=Fr?e=>atob(ht(e)):Q?e=>Buffer.from(e,"base64").toString("binary"):vt,gt=Q?e=>ut(Buffer.from(e,"base64")):e=>ut(Le(e).split("").map(t=>t.charCodeAt(0))),bt=e=>gt(_t(e)),Gr=Q?e=>Buffer.from(e,"base64").toString("utf8"):at?e=>at.decode(gt(e)):e=>mt(Le(e)),_t=e=>ht(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),je=e=>Gr(_t(e)),Kr=e=>{if(typeof e!="string")return !1;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return !/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},wt=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),xt=function(){let e=(t,r)=>Object.defineProperty(String.prototype,t,wt(r));e("fromBase64",function(){return je(this)}),e("toBase64",function(t){return J(this,t)}),e("toBase64URI",function(){return J(this,!0)}),e("toBase64URL",function(){return J(this,!0)}),e("toUint8Array",function(){return bt(this)});},St=function(){let e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,wt(r));e("toBase64",function(t){return ve(this,t)}),e("toBase64URI",function(){return ve(this,!0)}),e("toBase64URL",function(){return ve(this,!0)});},$r=()=>{xt(),St();},Ut={version:ct,VERSION:Dr,atob:Le,atobPolyfill:vt,btoa:Ce,btoaPolyfill:dt,fromBase64:je,toBase64:J,encode:J,encodeURI:ft,encodeURL:ft,utob:yt,btou:mt,decode:je,isValid:Kr,fromUint8Array:ve,toUint8Array:bt,extendString:xt,extendUint8Array:St,extendBuiltins:$r};var Zt=chunk5Y5M5ND5_cjs.b(It());function Fe(){return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}function Ie(){Ie=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(u,i,a){u[i]=a.value;},s=typeof Symbol=="function"?Symbol:{},l=s.iterator||"@@iterator",p=s.asyncIterator||"@@asyncIterator",h=s.toStringTag||"@@toStringTag";function m(u,i,a){return Object.defineProperty(u,i,{value:a,enumerable:!0,configurable:!0,writable:!0}),u[i]}try{m({},"");}catch{m=function(a,f,d){return a[f]=d};}function g(u,i,a,f){var d=i&&i.prototype instanceof F?i:F,c=Object.create(d.prototype),v=new G(f||[]);return o(c,"_invoke",{value:Ue(u,a,v)}),c}function y(u,i,a){try{return {type:"normal",arg:u.call(i,a)}}catch(f){return {type:"throw",arg:f}}}t.wrap=g;var j="suspendedStart",oe="suspendedYield",H="executing",L="completed",w={};function F(){}function k(){}function x(){}var C={};m(C,l,function(){return this});var q=Object.getPrototypeOf,I=q&&q(q(K([])));I&&I!==r&&n.call(I,l)&&(C=I);var R=x.prototype=F.prototype=Object.create(C);function ie(u){["next","throw","return"].forEach(function(i){m(u,i,function(a){return this._invoke(i,a)});});}function N(u,i){function a(d,c,v,b){var _=y(u[d],u,c);if(_.type!=="throw"){var E=_.arg,S=E.value;return S&&X(S)=="object"&&n.call(S,"__await")?i.resolve(S.__await).then(function(P){a("next",P,v,b);},function(P){a("throw",P,v,b);}):i.resolve(S).then(function(P){E.value=P,v(E);},function(P){return a("throw",P,v,b)})}b(_.arg);}var f;o(this,"_invoke",{value:function(c,v){function b(){return new i(function(_,E){a(c,v,_,E);})}return f=f?f.then(b,b):b()}});}function Ue(u,i,a){var f=j;return function(d,c){if(f===H)throw Error("Generator is already running");if(f===L){if(d==="throw")throw c;return {value:e,done:!0}}for(a.method=d,a.arg=c;;){var v=a.delegate;if(v){var b=ae(v,a);if(b){if(b===w)continue;return b}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(f===j)throw f=L,a.arg;a.dispatchException(a.arg);}else a.method==="return"&&a.abrupt("return",a.arg);f=H;var _=y(u,i,a);if(_.type==="normal"){if(f=a.done?L:oe,_.arg===w)continue;return {value:_.arg,done:a.done}}_.type==="throw"&&(f=L,a.method="throw",a.arg=_.arg);}}}function ae(u,i){var a=i.method,f=u.iterator[a];if(f===e)return i.delegate=null,a==="throw"&&u.iterator.return&&(i.method="return",i.arg=e,ae(u,i),i.method==="throw")||a!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+a+"' method")),w;var d=y(f,u.iterator,i.arg);if(d.type==="throw")return i.method="throw",i.arg=d.arg,i.delegate=null,w;var c=d.arg;return c?c.done?(i[u.resultName]=c.value,i.next=u.nextLoc,i.method!=="return"&&(i.method="next",i.arg=e),i.delegate=null,w):c:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,w)}function Ee(u){var i={tryLoc:u[0]};1 in u&&(i.catchLoc=u[1]),2 in u&&(i.finallyLoc=u[2],i.afterLoc=u[3]),this.tryEntries.push(i);}function M(u){var i=u.completion||{};i.type="normal",delete i.arg,u.completion=i;}function G(u){this.tryEntries=[{tryLoc:"root"}],u.forEach(Ee,this),this.reset(!0);}function K(u){if(u||u===""){var i=u[l];if(i)return i.call(u);if(typeof u.next=="function")return u;if(!isNaN(u.length)){var a=-1,f=function d(){for(;++a<u.length;)if(n.call(u,a))return d.value=u[a],d.done=!1,d;return d.value=e,d.done=!0,d};return f.next=f}}throw new TypeError(X(u)+" is not iterable")}return k.prototype=x,o(R,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:k,configurable:!0}),k.displayName=m(x,h,"GeneratorFunction"),t.isGeneratorFunction=function(u){var i=typeof u=="function"&&u.constructor;return !!i&&(i===k||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(u){return Object.setPrototypeOf?Object.setPrototypeOf(u,x):(u.__proto__=x,m(u,h,"GeneratorFunction")),u.prototype=Object.create(R),u},t.awrap=function(u){return {__await:u}},ie(N.prototype),m(N.prototype,p,function(){return this}),t.AsyncIterator=N,t.async=function(u,i,a,f,d){d===void 0&&(d=Promise);var c=new N(g(u,i,a,f),d);return t.isGeneratorFunction(i)?c:c.next().then(function(v){return v.done?v.value:c.next()})},ie(R),m(R,h,"Generator"),m(R,l,function(){return this}),m(R,"toString",function(){return "[object Generator]"}),t.keys=function(u){var i=Object(u),a=[];for(var f in i)a.push(f);return a.reverse(),function d(){for(;a.length;){var c=a.pop();if(c in i)return d.value=c,d.done=!1,d}return d.done=!0,d}},t.values=K,G.prototype={constructor:G,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!i)for(var a in this)a.charAt(0)==="t"&&n.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=e);},stop:function(){this.done=!0;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var a=this;function f(E,S){return v.type="throw",v.arg=i,a.next=E,S&&(a.method="next",a.arg=e),!!S}for(var d=this.tryEntries.length-1;d>=0;--d){var c=this.tryEntries[d],v=c.completion;if(c.tryLoc==="root")return f("end");if(c.tryLoc<=this.prev){var b=n.call(c,"catchLoc"),_=n.call(c,"finallyLoc");if(b&&_){if(this.prev<c.catchLoc)return f(c.catchLoc,!0);if(this.prev<c.finallyLoc)return f(c.finallyLoc)}else if(b){if(this.prev<c.catchLoc)return f(c.catchLoc,!0)}else {if(!_)throw Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return f(c.finallyLoc)}}}},abrupt:function(i,a){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&n.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var c=d;break}}c&&(i==="break"||i==="continue")&&c.tryLoc<=a&&a<=c.finallyLoc&&(c=null);var v=c?c.completion:{};return v.type=i,v.arg=a,c?(this.method="next",this.next=c.finallyLoc,w):this.complete(v)},complete:function(i,a){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&a&&(this.next=a),w},finish:function(i){for(var a=this.tryEntries.length-1;a>=0;--a){var f=this.tryEntries[a];if(f.finallyLoc===i)return this.complete(f.completion,f.afterLoc),M(f),w}},catch:function(i){for(var a=this.tryEntries.length-1;a>=0;--a){var f=this.tryEntries[a];if(f.tryLoc===i){var d=f.completion;if(d.type==="throw"){var c=d.arg;M(f);}return c}}throw Error("illegal catch attempt")},delegateYield:function(i,a,f){return this.delegate={iterator:K(i),resultName:a,nextLoc:f},this.method==="next"&&(this.arg=e),w}},t}function Nt(e,t,r,n,o,s,l){try{var p=e[s](l),h=p.value;}catch(m){r(m);return}p.done?t(h):Promise.resolve(h).then(n,o);}function on(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var s=e.apply(t,r);function l(h){Nt(s,n,o,l,p,"next",h);}function p(h){Nt(s,n,o,l,p,"throw",h);}l(void 0);})}}function Wt(e,t){return un(e)||sn(e,t)||Xt(e,t)||an()}function an(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sn(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,s,l,p=[],h=!0,m=!1;try{if(s=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;h=!1;}else for(;!(h=(n=s.call(r)).done)&&(p.push(n.value),p.length!==t);h=!0);}catch(g){m=!0,o=g;}finally{try{if(!h&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(m)throw o}}return p}}function un(e){if(Array.isArray(e))return e}function X(e){"@babel/helpers - typeof";return X=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X(e)}function ln(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Xt(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,o=function(){};return {s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(m){throw m},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
13
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,l=!1,p;return {s:function(){r=r.call(e);},n:function(){var m=r.next();return s=m.done,m},e:function(m){l=!0,p=m;},f:function(){try{!s&&r.return!=null&&r.return();}finally{if(l)throw p}}}}function Xt(e,t){if(e){if(typeof e=="string")return Bt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bt(e,t)}}function Bt(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n);}return r}function ee(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zt(Object(r),!0).forEach(function(n){fn(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zt(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function fn(e,t,r){return t=Yt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ht(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yt(n.key),n);}}function pn(e,t,r){return t&&Ht(e.prototype,t),r&&Ht(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yt(e){var t=hn(e,"string");return X(t)=="symbol"?t:t+""}function hn(e,t){if(X(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(X(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}var Ne="tus-v1",be="ietf-draft-03",dn={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:Jt,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:Ne},Vt=function(){function e(t,r){cn(this,e),"resume"in r&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=r,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=t,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null;}return pn(e,[{key:"findPreviousUploads",value:function(){var r=this;return this.options.fingerprint(this.file,this.options).then(function(n){return r._urlStorage.findUploadsByFingerprint(n)})}},{key:"resumeFromPreviousUpload",value:function(r){this.url=r.uploadUrl||null,this._parallelUploadUrls=r.parallelUploadUrls||null,this._urlStorageKey=r.urlStorageKey;}},{key:"start",value:function(){var r=this,n=this.file;if(!n){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![Ne,be].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var o=this.options.retryDelays;if(o!=null&&Object.prototype.toString.call(o)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var s=0,l=["uploadUrl","uploadSize","uploadLengthDeferred"];s<l.length;s++){var p=l[s];if(this.options[p]){this._emitError(new Error("tus: cannot use the ".concat(p," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(n,this.options).then(function(h){return r._fingerprint=h,r._source?r._source:r.options.fileReader.openFile(n,r.options.chunkSize)}).then(function(h){if(r._source=h,r.options.uploadLengthDeferred)r._size=null;else if(r.options.uploadSize!=null){if(r._size=Number(r.options.uploadSize),Number.isNaN(r._size)){r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(r._size=r._source.size,r._size==null){r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}r.options.parallelUploads>1||r._parallelUploadUrls!=null?r._startParallelUpload():r._startSingleUpload();}).catch(function(h){r._emitError(h);});}},{key:"_startParallelUpload",value:function(){var r,n=this,o=this._size,s=0;this._parallelUploads=[];var l=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,p=(r=this.options.parallelUploadBoundaries)!==null&&r!==void 0?r:mn(this._source.size,l);this._parallelUploadUrls&&p.forEach(function(g,y){g.uploadUrl=n._parallelUploadUrls[y]||null;}),this._parallelUploadUrls=new Array(p.length);var h=p.map(function(g,y){var j=0;return n._source.slice(g.start,g.end).then(function(oe){var H=oe.value;return new Promise(function(L,w){var F=ee(ee({},n.options),{},{uploadUrl:g.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:n.options.metadataForPartialUploads,headers:ee(ee({},n.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:L,onError:w,onProgress:function(C){s=s-j+C,j=C,n._emitProgress(s,o);},onUploadUrlAvailable:function(){n._parallelUploadUrls[y]=k.url,n._parallelUploadUrls.filter(function(C){return !!C}).length===p.length&&n._saveUploadInUrlStorage();}}),k=new e(H,F);k.start(),n._parallelUploads.push(k);})})}),m;Promise.all(h).then(function(){m=n._openRequest("POST",n.options.endpoint),m.setHeader("Upload-Concat","final;".concat(n._parallelUploadUrls.join(" ")));var g=qt(n.options.metadata);return g!==""&&m.setHeader("Upload-Metadata",g),n._sendRequest(m,null)}).then(function(g){if(!te(g.getStatus(),200)){n._emitHttpError(m,g,"tus: unexpected response while creating upload");return}var y=g.getHeader("Location");if(y==null){n._emitHttpError(m,g,"tus: invalid or missing Location header");return}n.url=$t(n.options.endpoint,y),z("Created upload at ".concat(n.url)),n._emitSuccess(g);}).catch(function(g){n._emitError(g);});}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){z("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){z("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}this._createUpload();}},{key:"abort",value:function(r){var n=this;if(this._parallelUploads!=null){var o=ln(this._parallelUploads),s;try{for(o.s();!(s=o.n()).done;){var l=s.value;l.abort(r);}}catch(p){o.e(p);}finally{o.f();}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!r||this.url==null?Promise.resolve():e.terminate(this.url,this.options).then(function(){return n._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(r,n,o,s){this._emitError(new V(o,s,r,n));}},{key:"_emitError",value:function(r){var n=this;if(!this._aborted){if(this.options.retryDelays!=null){var o=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(o&&(this._retryAttempt=0),Kt(r,this._retryAttempt,this.options)){var s=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){n.start();},s);return}}if(typeof this.options.onError=="function")this.options.onError(r);else throw r}}},{key:"_emitSuccess",value:function(r){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:r});}},{key:"_emitProgress",value:function(r,n){typeof this.options.onProgress=="function"&&this.options.onProgress(r,n);}},{key:"_emitChunkComplete",value:function(r,n,o){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(r,n,o);}},{key:"_createUpload",value:function(){var r=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var n=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?n.setHeader("Upload-Defer-Length","1"):n.setHeader("Upload-Length","".concat(this._size));var o=qt(this.options.metadata);o!==""&&n.setHeader("Upload-Metadata",o);var s;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,s=this._addChunkToRequest(n)):(this.options.protocol===be&&n.setHeader("Upload-Complete","?0"),s=this._sendRequest(n,null)),s.then(function(l){if(!te(l.getStatus(),200)){r._emitHttpError(n,l,"tus: unexpected response while creating upload");return}var p=l.getHeader("Location");if(p==null){r._emitHttpError(n,l,"tus: invalid or missing Location header");return}if(r.url=$t(r.options.endpoint,p),z("Created upload at ".concat(r.url)),typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._size===0){r._emitSuccess(l),r._source.close();return}r._saveUploadInUrlStorage().then(function(){r.options.uploadDataDuringCreation?r._handleUploadResponse(n,l):(r._offset=0,r._performUpload());});}).catch(function(l){r._emitHttpError(n,null,"tus: failed to create upload",l);});}},{key:"_resumeUpload",value:function(){var r=this,n=this._openRequest("HEAD",this.url),o=this._sendRequest(n,null);o.then(function(s){var l=s.getStatus();if(!te(l,200)){if(l===423){r._emitHttpError(n,s,"tus: upload is currently locked; retry later");return}if(te(l,400)&&r._removeFromUrlStorage(),!r.options.endpoint){r._emitHttpError(n,s,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}r.url=null,r._createUpload();return}var p=Number.parseInt(s.getHeader("Upload-Offset"),10);if(Number.isNaN(p)){r._emitHttpError(n,s,"tus: invalid or missing offset value");return}var h=Number.parseInt(s.getHeader("Upload-Length"),10);if(Number.isNaN(h)&&!r.options.uploadLengthDeferred&&r.options.protocol===Ne){r._emitHttpError(n,s,"tus: invalid or missing length value");return}typeof r.options.onUploadUrlAvailable=="function"&&r.options.onUploadUrlAvailable(),r._saveUploadInUrlStorage().then(function(){if(p===h){r._emitProgress(h,h),r._emitSuccess(s);return}r._offset=p,r._performUpload();});}).catch(function(s){r._emitHttpError(n,null,"tus: failed to resume upload",s);});}},{key:"_performUpload",value:function(){var r=this;if(!this._aborted){var n;this.options.overridePatchMethod?(n=this._openRequest("POST",this.url),n.setHeader("X-HTTP-Method-Override","PATCH")):n=this._openRequest("PATCH",this.url),n.setHeader("Upload-Offset","".concat(this._offset));var o=this._addChunkToRequest(n);o.then(function(s){if(!te(s.getStatus(),200)){r._emitHttpError(n,s,"tus: unexpected response while uploading chunk");return}r._handleUploadResponse(n,s);}).catch(function(s){r._aborted||r._emitHttpError(n,null,"tus: failed to upload chunk at offset ".concat(r._offset),s);});}}},{key:"_addChunkToRequest",value:function(r){var n=this,o=this._offset,s=this._offset+this.options.chunkSize;return r.setProgressHandler(function(l){n._emitProgress(o+l,n._size);}),r.setHeader("Content-Type","application/offset+octet-stream"),(s===Number.POSITIVE_INFINITY||s>this._size)&&!this.options.uploadLengthDeferred&&(s=this._size),this._source.slice(o,s).then(function(l){var p=l.value,h=l.done,m=p!=null&&p.size?p.size:0;n.options.uploadLengthDeferred&&h&&(n._size=n._offset+m,r.setHeader("Upload-Length","".concat(n._size)));var g=n._offset+m;return !n.options.uploadLengthDeferred&&h&&g!==n._size?Promise.reject(new Error("upload was configured with a size of ".concat(n._size," bytes, but the source is done after ").concat(g," bytes"))):p===null?n._sendRequest(r):(n.options.protocol===be&&r.setHeader("Upload-Complete",h?"?1":"?0"),n._emitProgress(n._offset,n._size),n._sendRequest(r,p))})}},{key:"_handleUploadResponse",value:function(r,n){var o=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(o)){this._emitHttpError(r,n,"tus: invalid or missing offset value");return}if(this._emitProgress(o,this._size),this._emitChunkComplete(o-this._offset,o,this._size),this._offset=o,o===this._size){this._emitSuccess(n),this._source.close();return}this._performUpload();}},{key:"_openRequest",value:function(r,n){var o=Mt(r,n,this.options);return this._req=o,o}},{key:"_removeFromUrlStorage",value:function(){var r=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n){r._emitError(n);}),this._urlStorageKey=null);}},{key:"_saveUploadInUrlStorage",value:function(){var r=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var n={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?n.parallelUploadUrls=this._parallelUploadUrls:n.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,n).then(function(o){r._urlStorageKey=o;})}},{key:"_sendRequest",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Gt(r,n,this.options)}}],[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=Mt("DELETE",r,n);return Gt(o,null,n).then(function(s){if(s.getStatus()!==204)throw new V("tus: unexpected response while terminating upload",null,o,s)}).catch(function(s){if(s instanceof V||(s=new V("tus: failed to terminate upload",s,o,null)),!Kt(s,0,n))throw s;var l=n.retryDelays[0],p=n.retryDelays.slice(1),h=ee(ee({},n),{},{retryDelays:p});return new Promise(function(m){return setTimeout(m,l)}).then(function(){return e.terminate(r,h)})})}}])}();function qt(e){return Object.entries(e).map(function(t){var r=Wt(t,2),n=r[0],o=r[1];return "".concat(n," ").concat(Ut.encode(String(o)))}).join(",")}function te(e,t){return e>=t&&e<t+100}function Mt(e,t,r){var n=r.httpStack.createRequest(e,t);r.protocol===be?n.setHeader("Upload-Draft-Interop-Version","5"):n.setHeader("Tus-Resumable","1.0.0");for(var o=r.headers||{},s=0,l=Object.entries(o);s<l.length;s++){var p=Wt(l[s],2),h=p[0],m=p[1];n.setHeader(h,m);}if(r.addRequestId){var g=Fe();n.setHeader("X-Request-ID",g);}return n}function Gt(e,t,r){return Be.apply(this,arguments)}function Be(){return Be=on(Ie().mark(function e(t,r,n){var o;return Ie().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(typeof n.onBeforeRequest!="function"){l.next=3;break}return l.next=3,n.onBeforeRequest(t);case 3:return l.next=5,t.send(r);case 5:if(o=l.sent,typeof n.onAfterResponse!="function"){l.next=9;break}return l.next=9,n.onAfterResponse(t,o);case 9:return l.abrupt("return",o);case 10:case"end":return l.stop()}},e)})),Be.apply(this,arguments)}function yn(){var e=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(e=!1),e}function Kt(e,t,r){return r.retryDelays==null||t>=r.retryDelays.length||e.originalRequest==null?!1:r&&typeof r.onShouldRetry=="function"?r.onShouldRetry(e,t,r):Jt(e)}function Jt(e){var t=e.originalResponse?e.originalResponse.getStatus():0;return (!te(t,400)||t===409||t===423)&&yn()}function $t(e,t){return new Zt.default(t,e).toString()}function mn(e,t){for(var r=Math.floor(e/t),n=[],o=0;o<t;o++)n.push({start:r*o,end:r*(o+1)});return n[t-1].end=e,n}Vt.defaultOptions=dn;var _e=Vt;var vn=function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"},we=vn;function ze(e){return new Promise(function(t,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var o=n.response;t(o);},n.onerror=function(o){r(o);},n.open("GET",e),n.send();})}var gn=function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")},Qt=gn;function He(e){return new Promise(function(t,r){var n=new FileReader;n.onload=function(){var o=new Uint8Array(n.result);t({value:o});},n.onerror=function(o){r(o);},n.readAsArrayBuffer(e);})}function ce(e){"@babel/helpers - typeof";return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ce(e)}function bn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function er(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wn(n.key),n);}}function _n(e,t,r){return t&&er(e.prototype,t),r&&er(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function wn(e){var t=xn(e,"string");return ce(t)=="symbol"?t:t+""}function xn(e,t){if(ce(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ce(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}var qe=function(){function e(t){bn(this,e),this._file=t,this.size=t.size;}return _n(e,[{key:"slice",value:function(r,n){if(Qt())return He(this._file.slice(r,n));var o=this._file.slice(r,n),s=n>=this.size;return Promise.resolve({value:o,done:s})}},{key:"close",value:function(){}}])}();function pe(e){"@babel/helpers - typeof";return pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pe(e)}function Sn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,En(n.key),n);}}function Un(e,t,r){return t&&tr(e.prototype,t),r&&tr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function En(e){var t=Pn(e,"string");return pe(t)=="symbol"?t:t+""}function Pn(e,t){if(pe(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pe(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}function rr(e){return e===void 0?0:e.size!==void 0?e.size:e.length}function On(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}throw new Error("Unknown data type")}var nr=function(){function e(t){Sn(this,e),this._buffer=void 0,this._bufferOffset=0,this._reader=t,this._done=!1;}return Un(e,[{key:"slice",value:function(r,n){return r<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(r,n)}},{key:"_readUntilEnoughDataOrDone",value:function(r,n){var o=this,s=n<=this._bufferOffset+rr(this._buffer);if(this._done||s){var l=this._getDataFromBuffer(r,n),p=l==null?this._done:!1;return Promise.resolve({value:l,done:p})}return this._reader.read().then(function(h){var m=h.value,g=h.done;return g?o._done=!0:o._buffer===void 0?o._buffer=m:o._buffer=On(o._buffer,m),o._readUntilEnoughDataOrDone(r,n)})}},{key:"_getDataFromBuffer",value:function(r,n){r>this._bufferOffset&&(this._buffer=this._buffer.slice(r-this._bufferOffset),this._bufferOffset=r);var o=rr(this._buffer)===0;return this._done&&o?null:this._buffer.slice(0,n-r)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel();}}])}();function Y(e){"@babel/helpers - typeof";return Y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(e)}function Me(){Me=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(u,i,a){u[i]=a.value;},s=typeof Symbol=="function"?Symbol:{},l=s.iterator||"@@iterator",p=s.asyncIterator||"@@asyncIterator",h=s.toStringTag||"@@toStringTag";function m(u,i,a){return Object.defineProperty(u,i,{value:a,enumerable:!0,configurable:!0,writable:!0}),u[i]}try{m({},"");}catch{m=function(a,f,d){return a[f]=d};}function g(u,i,a,f){var d=i&&i.prototype instanceof F?i:F,c=Object.create(d.prototype),v=new G(f||[]);return o(c,"_invoke",{value:Ue(u,a,v)}),c}function y(u,i,a){try{return {type:"normal",arg:u.call(i,a)}}catch(f){return {type:"throw",arg:f}}}t.wrap=g;var j="suspendedStart",oe="suspendedYield",H="executing",L="completed",w={};function F(){}function k(){}function x(){}var C={};m(C,l,function(){return this});var q=Object.getPrototypeOf,I=q&&q(q(K([])));I&&I!==r&&n.call(I,l)&&(C=I);var R=x.prototype=F.prototype=Object.create(C);function ie(u){["next","throw","return"].forEach(function(i){m(u,i,function(a){return this._invoke(i,a)});});}function N(u,i){function a(d,c,v,b){var _=y(u[d],u,c);if(_.type!=="throw"){var E=_.arg,S=E.value;return S&&Y(S)=="object"&&n.call(S,"__await")?i.resolve(S.__await).then(function(P){a("next",P,v,b);},function(P){a("throw",P,v,b);}):i.resolve(S).then(function(P){E.value=P,v(E);},function(P){return a("throw",P,v,b)})}b(_.arg);}var f;o(this,"_invoke",{value:function(c,v){function b(){return new i(function(_,E){a(c,v,_,E);})}return f=f?f.then(b,b):b()}});}function Ue(u,i,a){var f=j;return function(d,c){if(f===H)throw Error("Generator is already running");if(f===L){if(d==="throw")throw c;return {value:e,done:!0}}for(a.method=d,a.arg=c;;){var v=a.delegate;if(v){var b=ae(v,a);if(b){if(b===w)continue;return b}}if(a.method==="next")a.sent=a._sent=a.arg;else if(a.method==="throw"){if(f===j)throw f=L,a.arg;a.dispatchException(a.arg);}else a.method==="return"&&a.abrupt("return",a.arg);f=H;var _=y(u,i,a);if(_.type==="normal"){if(f=a.done?L:oe,_.arg===w)continue;return {value:_.arg,done:a.done}}_.type==="throw"&&(f=L,a.method="throw",a.arg=_.arg);}}}function ae(u,i){var a=i.method,f=u.iterator[a];if(f===e)return i.delegate=null,a==="throw"&&u.iterator.return&&(i.method="return",i.arg=e,ae(u,i),i.method==="throw")||a!=="return"&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+a+"' method")),w;var d=y(f,u.iterator,i.arg);if(d.type==="throw")return i.method="throw",i.arg=d.arg,i.delegate=null,w;var c=d.arg;return c?c.done?(i[u.resultName]=c.value,i.next=u.nextLoc,i.method!=="return"&&(i.method="next",i.arg=e),i.delegate=null,w):c:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,w)}function Ee(u){var i={tryLoc:u[0]};1 in u&&(i.catchLoc=u[1]),2 in u&&(i.finallyLoc=u[2],i.afterLoc=u[3]),this.tryEntries.push(i);}function M(u){var i=u.completion||{};i.type="normal",delete i.arg,u.completion=i;}function G(u){this.tryEntries=[{tryLoc:"root"}],u.forEach(Ee,this),this.reset(!0);}function K(u){if(u||u===""){var i=u[l];if(i)return i.call(u);if(typeof u.next=="function")return u;if(!isNaN(u.length)){var a=-1,f=function d(){for(;++a<u.length;)if(n.call(u,a))return d.value=u[a],d.done=!1,d;return d.value=e,d.done=!0,d};return f.next=f}}throw new TypeError(Y(u)+" is not iterable")}return k.prototype=x,o(R,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:k,configurable:!0}),k.displayName=m(x,h,"GeneratorFunction"),t.isGeneratorFunction=function(u){var i=typeof u=="function"&&u.constructor;return !!i&&(i===k||(i.displayName||i.name)==="GeneratorFunction")},t.mark=function(u){return Object.setPrototypeOf?Object.setPrototypeOf(u,x):(u.__proto__=x,m(u,h,"GeneratorFunction")),u.prototype=Object.create(R),u},t.awrap=function(u){return {__await:u}},ie(N.prototype),m(N.prototype,p,function(){return this}),t.AsyncIterator=N,t.async=function(u,i,a,f,d){d===void 0&&(d=Promise);var c=new N(g(u,i,a,f),d);return t.isGeneratorFunction(i)?c:c.next().then(function(v){return v.done?v.value:c.next()})},ie(R),m(R,h,"Generator"),m(R,l,function(){return this}),m(R,"toString",function(){return "[object Generator]"}),t.keys=function(u){var i=Object(u),a=[];for(var f in i)a.push(f);return a.reverse(),function d(){for(;a.length;){var c=a.pop();if(c in i)return d.value=c,d.done=!1,d}return d.done=!0,d}},t.values=K,G.prototype={constructor:G,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(M),!i)for(var a in this)a.charAt(0)==="t"&&n.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=e);},stop:function(){this.done=!0;var i=this.tryEntries[0].completion;if(i.type==="throw")throw i.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var a=this;function f(E,S){return v.type="throw",v.arg=i,a.next=E,S&&(a.method="next",a.arg=e),!!S}for(var d=this.tryEntries.length-1;d>=0;--d){var c=this.tryEntries[d],v=c.completion;if(c.tryLoc==="root")return f("end");if(c.tryLoc<=this.prev){var b=n.call(c,"catchLoc"),_=n.call(c,"finallyLoc");if(b&&_){if(this.prev<c.catchLoc)return f(c.catchLoc,!0);if(this.prev<c.finallyLoc)return f(c.finallyLoc)}else if(b){if(this.prev<c.catchLoc)return f(c.catchLoc,!0)}else {if(!_)throw Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return f(c.finallyLoc)}}}},abrupt:function(i,a){for(var f=this.tryEntries.length-1;f>=0;--f){var d=this.tryEntries[f];if(d.tryLoc<=this.prev&&n.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var c=d;break}}c&&(i==="break"||i==="continue")&&c.tryLoc<=a&&a<=c.finallyLoc&&(c=null);var v=c?c.completion:{};return v.type=i,v.arg=a,c?(this.method="next",this.next=c.finallyLoc,w):this.complete(v)},complete:function(i,a){if(i.type==="throw")throw i.arg;return i.type==="break"||i.type==="continue"?this.next=i.arg:i.type==="return"?(this.rval=this.arg=i.arg,this.method="return",this.next="end"):i.type==="normal"&&a&&(this.next=a),w},finish:function(i){for(var a=this.tryEntries.length-1;a>=0;--a){var f=this.tryEntries[a];if(f.finallyLoc===i)return this.complete(f.completion,f.afterLoc),M(f),w}},catch:function(i){for(var a=this.tryEntries.length-1;a>=0;--a){var f=this.tryEntries[a];if(f.tryLoc===i){var d=f.completion;if(d.type==="throw"){var c=d.arg;M(f);}return c}}throw Error("illegal catch attempt")},delegateYield:function(i,a,f){return this.delegate={iterator:K(i),resultName:a,nextLoc:f},this.method==="next"&&(this.arg=e),w}},t}function or(e,t,r,n,o,s,l){try{var p=e[s](l),h=p.value;}catch(m){r(m);return}p.done?t(h):Promise.resolve(h).then(n,o);}function kn(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var s=e.apply(t,r);function l(h){or(s,n,o,l,p,"next",h);}function p(h){or(s,n,o,l,p,"throw",h);}l(void 0);})}}function Rn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ir(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Cn(n.key),n);}}function jn(e,t,r){return t&&ir(e.prototype,t),r&&ir(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Cn(e){var t=Ln(e,"string");return Y(t)=="symbol"?t:t+""}function Ln(e,t){if(Y(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Y(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}var ar=function(){function e(){Rn(this,e);}return jn(e,[{key:"openFile",value:function(){var t=kn(Me().mark(function n(o,s){var l;return Me().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!(we()&&o&&typeof o.uri<"u")){h.next=11;break}return h.prev=1,h.next=4,ze(o.uri);case 4:return l=h.sent,h.abrupt("return",new qe(l));case 8:throw h.prev=8,h.t0=h.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(h.t0));case 11:if(!(typeof o.slice=="function"&&typeof o.size<"u")){h.next=13;break}return h.abrupt("return",Promise.resolve(new qe(o)));case 13:if(typeof o.read!="function"){h.next=18;break}if(s=Number(s),Number.isFinite(s)){h.next=17;break}return h.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return h.abrupt("return",Promise.resolve(new nr(o,s)));case 18:return h.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return h.stop()}},n,null,[[1,8]])}));function r(n,o){return t.apply(this,arguments)}return r}()}])}();function Ge(e,t){return we()?Promise.resolve(Tn(e,t)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))}function Tn(e,t){var r=e.exif?An(JSON.stringify(e.exif)):"noexif";return ["tus-rn",e.name||"noname",e.size||"nosize",r,t.endpoint].join("/")}function An(e){var t=0;if(e.length===0)return t;for(var r=0;r<e.length;r++){var n=e.charCodeAt(r);t=(t<<5)-t+n,t&=t;}return t}function he(e){"@babel/helpers - typeof";return he=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},he(e)}function Ke(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Dn(n.key),n);}}function $e(e,t,r){return t&&sr(e.prototype,t),r&&sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Dn(e){var t=Fn(e,"string");return he(t)=="symbol"?t:t+""}function Fn(e,t){if(he(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(he(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}var ur=function(){function e(){Ke(this,e);}return $e(e,[{key:"createRequest",value:function(r,n){return new In(r,n)}},{key:"getName",value:function(){return "XHRHttpStack"}}])}();var In=function(){function e(t,r){Ke(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,r,!0),this._method=t,this._url=r,this._headers={};}return $e(e,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(r,n){this._xhr.setRequestHeader(r,n),this._headers[r]=n;}},{key:"getHeader",value:function(r){return this._headers[r]}},{key:"setProgressHandler",value:function(r){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(n){n.lengthComputable&&r(n.loaded);});}},{key:"send",value:function(){var r=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(o,s){r._xhr.onload=function(){o(new Nn(r._xhr));},r._xhr.onerror=function(l){s(l);},r._xhr.send(n);})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])}(),Nn=function(){function e(t){Ke(this,e),this._xhr=t;}return $e(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(r){return this._xhr.getResponseHeader(r)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])}();function de(e){"@babel/helpers - typeof";return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},de(e)}function Bn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Hn(n.key),n);}}function zn(e,t,r){return t&&lr(e.prototype,t),r&&lr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hn(e){var t=qn(e,"string");return de(t)=="symbol"?t:t+""}function qn(e,t){if(de(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(de(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}var Xe=!1;try{Xe="localStorage"in window,xe="tusSupport",We=localStorage.getItem(xe),localStorage.setItem(xe,We),We===null&&localStorage.removeItem(xe);}catch(e){if(e.code===e.SECURITY_ERR||e.code===e.QUOTA_EXCEEDED_ERR)Xe=!1;else throw e}var xe,We,fr=Xe,cr=function(){function e(){Bn(this,e);}return zn(e,[{key:"findAllUploads",value:function(){var r=this._findEntries("tus::");return Promise.resolve(r)}},{key:"findUploadsByFingerprint",value:function(r){var n=this._findEntries("tus::".concat(r,"::"));return Promise.resolve(n)}},{key:"removeUpload",value:function(r){return localStorage.removeItem(r),Promise.resolve()}},{key:"addUpload",value:function(r,n){var o=Math.round(Math.random()*1e12),s="tus::".concat(r,"::").concat(o);return localStorage.setItem(s,JSON.stringify(n)),Promise.resolve(s)}},{key:"_findEntries",value:function(r){for(var n=[],o=0;o<localStorage.length;o++){var s=localStorage.key(o);if(s.indexOf(r)===0)try{var l=JSON.parse(localStorage.getItem(s));l.urlStorageKey=s,n.push(l);}catch{}}return n}}])}();function ne(e){"@babel/helpers - typeof";return ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ne(e)}function Mn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mr(n.key),n);}}function Gn(e,t,r){return t&&pr(e.prototype,t),r&&pr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Kn(e,t,r){return t=Se(t),$n(e,yr()?Reflect.construct(t,r||[],Se(e).constructor):t.apply(e,r))}function $n(e,t){if(t&&(ne(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wn(e)}function Wn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (yr=function(){return !!e})()}function Se(e){return Se=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Se(e)}function Xn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ye(e,t);}function Ye(e,t){return Ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ye(e,t)}function hr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n);}return r}function re(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?hr(Object(r),!0).forEach(function(n){Yn(e,n,r[n]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n));});}return e}function Yn(e,t,r){return t=mr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mr(e){var t=Zn(e,"string");return ne(t)=="symbol"?t:t+""}function Zn(e,t){if(ne(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ne(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return (t==="string"?String:Number)(e)}var dr=re(re({},_e.defaultOptions),{},{httpStack:new ur,fileReader:new ar,urlStorage:fr?new cr:new it,fingerprint:Ge}),vr=function(e){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Mn(this,t),n=re(re({},dr),n),Kn(this,t,[r,n])}return Xn(t,e),Gn(t,null,[{key:"terminate",value:function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o=re(re({},dr),o),_e.terminate(n,o)}}])}(_e);exports.a=class O extends chunkKGTAAGUE_cjs.i{constructor(){super(...arguments);this.disableCompletion=!1;this._completed=!1;this.languageController=new chunkRNHNE3HL_cjs.d(this);}connectedCallback(){super.connectedCallback(),window.customElements.get("lottie-player")||import('./lottie-player.esm-4DQZVY6A.cjs'),this.languageController.locale=this.locale||"en",this.embedChannel=chunkBRZI5I43_cjs.a.connect(this.token),this.embedChannel.upload_id&&(this._upload_id=this.embedChannel.upload_id),this.embedChannel.channel.on("initiate",({upload_id:r})=>{this._upload_id=r,this.embedChannel.upload_id=r;}),this.embedChannel.channel.on("completed",this.completed.bind(this)),this.embedChannel.channel.on("rendition",this.rendition.bind(this)),this.embedChannel.channel.on("error",this.error.bind(this));}requestUpdate(r,n){super.requestUpdate(r,n),r==="locale"&&(this.languageController.locale=this.locale);}reset(){this._progress=0,this._completed=!1,this.embedChannel.channel.push("reset",{});}disconnectedCallback(){super.disconnectedCallback();}handleDrop(r){if(r.preventDefault(),r.dataTransfer&&r.dataTransfer.items){for(let n of r.dataTransfer.items)if(n.kind==="file"){let o=n.getAsFile();o&&(o.type.startsWith("video/")||o.type.startsWith("audio/"))&&(this._progress=1,this.upload(o));}}else if(r.dataTransfer&&r.dataTransfer.files)for(let n of r.dataTransfer.files)(n.type.startsWith("video/")||n.type.startsWith("audio/"))&&(this._progress=1,this.upload(n));}handleForm(r){this._progress=1;let n=r.target;if(n.files)for(let o of n.files)(o.type.startsWith("video/")||o.type.startsWith("audio/"))&&this.upload(o);}upload(r){let n=new vr(r,{endpoint:chunk5STN56TL_cjs.a.upload.endpoint,retryDelays:[0,3e3,5e3,1e4,2e4,6e4,6e4],metadata:{title:r.name,filetype:r.type,token:this.token,upload_id:this._upload_id},onError:o=>{console.log(o);},onProgress:(o,s)=>{let l=Math.round(o/s*100);l>this._progress&&(this._progress=l);},onSuccess:()=>{this._progress=100;},removeFingerprintOnSuccess:!0});n.findPreviousUploads().then(o=>{o.length&&n.resumeFromPreviousUpload(o[0]),n.start();});}completed(r){this.disableCompletion||(this._completed=!0),this.dispatchEvent(new CustomEvent("completed",{bubbles:!0,composed:!0,detail:r}));}rendition(r){this.dispatchEvent(new CustomEvent("rendition",{bubbles:!0,composed:!0,detail:r}));}error(r){console.warn(`[mave-upload] ${r.message}`),this.dispatchEvent(new CustomEvent("error",{bubbles:!0,detail:r}));}render(){return chunkKGTAAGUE_cjs.c` ${this._progress?this.renderProgress():this.renderUpload()} `}styleOpacity(){return this.languageController.loaded?this._upload_id?{}:{pointerEvents:"none",opacity:"0.5"}:{pointerEvents:"none",opacity:"0"}}styleFont(){return this.font?{fontFamily:this.font}:{fontFamily:"system-ui"}}renderUpload(){return chunkKGTAAGUE_cjs.c`<form
|
|
14
|
-
class="state"
|
|
15
|
-
style=${chunkUEEYC5OJ_cjs.a({...this.styleOpacity(),...this.styleFont()})}
|
|
16
|
-
@dragover=${r=>r.preventDefault()}
|
|
17
|
-
@drop=${this.handleDrop}
|
|
18
|
-
onDragOver="this.style.boxShadow='inset 0 0 0 2px blue'"
|
|
19
|
-
onDragLeave="this.style.boxShadow='inset 0 0 0 2px transparent'"
|
|
20
|
-
>
|
|
21
|
-
<div style="font-size: 32px; padding-bottom: 14px; font-weight: 300; opacity: 0.9;">
|
|
22
|
-
${chunkRNHNE3HL_cjs.b("drop video here")}
|
|
23
|
-
</div>
|
|
24
|
-
<div style="padding-bottom: 40px; opacity: 0.5;">
|
|
25
|
-
${chunkRNHNE3HL_cjs.b("or browse your files")}
|
|
26
|
-
</div>
|
|
27
|
-
<div
|
|
28
|
-
style="position: relative; background: ${this.color?this.color:"#1997FF"}; width: 150px; height: 40px; overflow: hidden; border-radius: ${this.radius?this.radius:"16px"}; color: white;"
|
|
29
|
-
onMouseOver="this.style.opacity='0.9'"
|
|
30
|
-
onMouseOut="this.style.opacity='1'"
|
|
31
|
-
>
|
|
32
|
-
<input
|
|
33
|
-
.disabled=${!this._upload_id}
|
|
34
|
-
type="file"
|
|
35
|
-
accept="video/*, audio/*"
|
|
36
|
-
@change=${this.handleForm}
|
|
37
|
-
style="position: absolute; top: 0; left: -150px; display: block; width: 500px; height: 100%; opacity: 0; cursor: pointer;"
|
|
38
|
-
/>
|
|
39
|
-
<div
|
|
40
|
-
style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; text-align: center;"
|
|
41
|
-
>
|
|
42
|
-
<div style="padding-bottom: 2px;">${chunkRNHNE3HL_cjs.b("select file")}</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</form>`}renderProgress(){return chunkKGTAAGUE_cjs.c`
|
|
46
|
-
${this._progress==100?this.renderProcessing():chunkKGTAAGUE_cjs.c`
|
|
47
|
-
<div class="state">
|
|
48
|
-
<lottie-player
|
|
49
|
-
src="https://assets1.lottiefiles.com/packages/lf20_z7DhMX.json"
|
|
50
|
-
background="transparent"
|
|
51
|
-
speed="1"
|
|
52
|
-
style="width: 200px; height: 200px; padding-bottom: 20px;"
|
|
53
|
-
loop
|
|
54
|
-
autoplay
|
|
55
|
-
></lottie-player>
|
|
56
|
-
<div
|
|
57
|
-
style="width: 40%; height: 3px; border-radius: 3px; background: #ccc; overflow: hidden;"
|
|
58
|
-
>
|
|
59
|
-
<div
|
|
60
|
-
style="width: ${this._progress}%; height: 3px; background: #1997FF; transition-property: width; transition-duration: 200ms; transition-timing-function: cubic-bezier(0, 0, 0.2, 1);"
|
|
61
|
-
></div>
|
|
62
|
-
</div>
|
|
63
|
-
<div style="margin-top: 16px; opacity: 0.6; padding-bottom: 24px;">
|
|
64
|
-
${chunkRNHNE3HL_cjs.b("uploading...")}
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
`}
|
|
68
|
-
`}renderProcessing(){return chunkKGTAAGUE_cjs.c`<div class="state">
|
|
69
|
-
${this._completed?chunkKGTAAGUE_cjs.c` <lottie-player
|
|
70
|
-
src="https://assets1.lottiefiles.com/packages/lf20_tnlxlkom.json"
|
|
71
|
-
background="transparent"
|
|
72
|
-
style="width: 200px; height: 200px; padding-bottom: 20px;"
|
|
73
|
-
autoplay
|
|
74
|
-
></lottie-player>`:chunkKGTAAGUE_cjs.c` <lottie-player
|
|
75
|
-
src="https://assets10.lottiefiles.com/private_files/lf30_4kmk2efh.json"
|
|
76
|
-
background="transparent"
|
|
77
|
-
speed="2"
|
|
78
|
-
style="width: 200px; height: 200px; padding-bottom: 20px;"
|
|
79
|
-
loop
|
|
80
|
-
autoplay
|
|
81
|
-
></lottie-player>`}
|
|
82
|
-
<div style="width: 100%; height: 3px;"></div>
|
|
83
|
-
<div style="margin-top: 16px; opacity: 0.6; padding-bottom: 24px;">
|
|
84
|
-
${this._completed?chunkRNHNE3HL_cjs.b("done"):chunkRNHNE3HL_cjs.b("just a minute...")}
|
|
85
|
-
</div>
|
|
86
|
-
</div>`}};exports.a.styles=chunkKGTAAGUE_cjs.h`
|
|
87
|
-
:host {
|
|
88
|
-
all: initial;
|
|
89
|
-
display: block;
|
|
90
|
-
width: 100%;
|
|
91
|
-
aspect-ratio: 16 / 9;
|
|
92
|
-
overflow: hidden;
|
|
93
|
-
position: relative;
|
|
94
|
-
background: white;
|
|
95
|
-
box-shadow: inset 0 0 0 1px #eee;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.state {
|
|
99
|
-
display: flex;
|
|
100
|
-
flex-direction: column;
|
|
101
|
-
justify-content: center;
|
|
102
|
-
align-items: center;
|
|
103
|
-
background: white;
|
|
104
|
-
width: 100%;
|
|
105
|
-
height: 100%;
|
|
106
|
-
}
|
|
107
|
-
`,chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],exports.a.prototype,"token",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],exports.a.prototype,"locale",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],exports.a.prototype,"color",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],exports.a.prototype,"font",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],exports.a.prototype,"radius",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a({type:Boolean})],exports.a.prototype,"disableCompletion",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.b()],exports.a.prototype,"_progress",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.b()],exports.a.prototype,"_upload_id",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.b()],exports.a.prototype,"_completed",2),exports.a=chunk5Y5M5ND5_cjs.c([chunkRNHNE3HL_cjs.a()],exports.a);window&&window.customElements&&(window.customElements.get("mave-upload")||window.customElements.define("mave-upload",exports.a));/*! Bundled license information:
|
|
108
|
-
|
|
109
|
-
tus-js-client/lib.esm/upload.js:
|
|
110
|
-
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE *)
|
|
111
|
-
|
|
112
|
-
tus-js-client/lib.esm/browser/fileReader.js:
|
|
113
|
-
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE *)
|
|
114
|
-
*/
|
package/dist/chunk-P6GNG5DI.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunk5XZY6X6O_cjs = require('./chunk-5XZY6X6O.cjs');
|
|
4
|
-
var chunkKCZRQ4AS_cjs = require('./chunk-KCZRQ4AS.cjs');
|
|
5
|
-
var chunk5C42H643_cjs = require('./chunk-5C42H643.cjs');
|
|
6
|
-
var chunk26S26OLO_cjs = require('./chunk-26S26OLO.cjs');
|
|
7
|
-
var chunkKGTAAGUE_cjs = require('./chunk-KGTAAGUE.cjs');
|
|
8
|
-
var chunk5Y5M5ND5_cjs = require('./chunk-5Y5M5ND5.cjs');
|
|
9
|
-
|
|
10
|
-
var p,w,f,g,a,h,u=class extends chunk5C42H643_cjs.a{constructor(){super(...arguments);chunk5Y5M5ND5_cjs.e(this,p);chunk5Y5M5ND5_cjs.e(this,f);chunk5Y5M5ND5_cjs.e(this,a);this.order="newest";this.embedController=new chunkKCZRQ4AS_cjs.b(this,0);}connectedCallback(){super.connectedCallback(),this.embedController.token=this.token;}requestUpdate(t,o){super.requestUpdate(t,o),t==="embed"&&(this.embedController.token=this.token);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:!0})||[]}updated(){this.shadowRoot&&chunk5XZY6X6O_cjs.b(this.shadowRoot);}refresh(){return this.embedController.refresh()}containsEmbed(t){return this._collection?.videos?.some(o=>o.id===t)}getNextForEmbed(t){let o=chunk5Y5M5ND5_cjs.f(this,p,w).call(this),e=o.findIndex(n=>n.id===t);if(e!==-1)return o[e+1]}render(){return chunkKGTAAGUE_cjs.c`
|
|
11
|
-
${this.embedController.render({pending:this.renderPending,error:t=>chunkKGTAAGUE_cjs.c`<p>${t instanceof Error?t.message:chunkKGTAAGUE_cjs.f}</p>`,complete:t=>{if(this._collection=t,!t)return this.renderPending();if(t.error)return console.warn(t.error);let o=this._slottedChildren.map(e=>{function n(){let i;return e.nodeName==="TEMPLATE"?i=e.content.cloneNode(!0):i=e.cloneNode(!0),i}if(e.getAttribute("name")=="list-title"){let i=n();return i.textContent=this._collection?.name,chunkKGTAAGUE_cjs.c`${i}`}if(e.getAttribute("name")=="mave-list-root"&&this.embedController.embed){let i=n(),r=i.querySelector('[slot="root-link"]');return r&&(r.addEventListener("click",c=>{c.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"back",embedId:""}),this.embedController.embed="";}),r.removeAttribute("slot")),chunkKGTAAGUE_cjs.c`${i}`}if(e.getAttribute("name")=="mave-list-folder"){let i=this._collection.collections?.map(r=>{let c=n(),s=c.querySelector('[slot="folder-link"]');return [e,s].forEach(d=>{d&&(d.addEventListener("click",E=>{E.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"show_collection",collectionId:r.id}),this.embedController.embed=r.id;}),d.removeAttribute("slot"));}),chunk5Y5M5ND5_cjs.f(this,a,h).call(this,c,'[slot="folder-title"]',r.name),typeof r.video_count=="number"&&chunk5Y5M5ND5_cjs.f(this,a,h).call(this,c,'[slot="folder-count"]',r.video_count.toString()),chunkKGTAAGUE_cjs.c`${c}`});return chunkKGTAAGUE_cjs.c`${i}`}if(e.getAttribute("name")=="mave-list-item"||!["mave-list-folder","mave-list-item","mave-list-root","list-title"].includes(e.hasAttribute("name")?e.getAttribute("name"):"")&&e.nodeName=="TEMPLATE"){let i=chunk5Y5M5ND5_cjs.f(this,p,w).call(this).map((r,c)=>{let s=n(),d=c+1;chunk5Y5M5ND5_cjs.f(this,a,h).call(this,s,'[slot="item-title"]',r.name),chunk5Y5M5ND5_cjs.f(this,a,h).call(this,s,'[slot="item-position"]',d.toString()),chunk5Y5M5ND5_cjs.f(this,a,h).call(this,s,'[slot="item-duration"]',this.durationToTime(r.duration)),chunk5Y5M5ND5_cjs.f(this,f,g).call(this,s,"mave-clip",r.id),chunk5Y5M5ND5_cjs.f(this,f,g).call(this,s,"mave-player",r.id),chunk5Y5M5ND5_cjs.f(this,f,g).call(this,s,"mave-img",r.id);let E=s.querySelector("mave-clip"),S=s.querySelector('[slot="item-title"]'),P=s.querySelector("mave-img");return [E,S,P,s].forEach(q=>{q?.addEventListener("click",x=>{this.emit(this.EVENT_TYPES.CLICK,{action:"show_embed",embedId:r.id,position:d});});}),chunkKGTAAGUE_cjs.c`${s}`});return chunkKGTAAGUE_cjs.c`${i}`}}).filter(e=>e);return chunkKGTAAGUE_cjs.c`${this._stylesheets} ${o}`}})}
|
|
12
|
-
`}renderPending(){return chunkKGTAAGUE_cjs.c`<slot style="display: none"></slot>`}};p=new WeakSet,w=function(){if(!this._collection)return [];let t=this._collection.videos;return this.order=="newest"&&(t=this._collection.videos?.sort((o,e)=>e.created-o.created)),this.order=="oldest"&&(t=this._collection.videos?.sort((o,e)=>o.created-e.created)),this.order=="az"&&(t=this._collection.videos?.sort((o,e)=>o.name.localeCompare(e.name))),this.order=="za"&&(t=this._collection.videos?.sort((o,e)=>e.name.localeCompare(o.name))),t},f=new WeakSet,g=function(t,o,e){let n=t.querySelector(o);n&&(n.setAttribute("embed",e),n.removeAttribute("slot"));},a=new WeakSet,h=function(t,o,e){let n=t.querySelector(o);n&&(n.textContent=e,n.removeAttribute("slot"));},u.styles=chunkKGTAAGUE_cjs.h`
|
|
13
|
-
:host {
|
|
14
|
-
display: block;
|
|
15
|
-
}
|
|
16
|
-
`,chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],u.prototype,"token",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],u.prototype,"order",2);window&&window.customElements&&(window.customElements.get("mave-list")||window.customElements.define("mave-list",u));
|
|
17
|
-
|
|
18
|
-
exports.a = u;
|
package/dist/chunk-QJP5WK2K.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { a as a$1 } from './chunk-GO5AXJUO.js';
|
|
2
|
-
import { a as a$3 } from './chunk-AEKWMZ2I.js';
|
|
3
|
-
import { a as a$2 } from './chunk-CF5QCOBL.js';
|
|
4
|
-
import { a, b as b$1 } from './chunk-R2QJ6RON.js';
|
|
5
|
-
import { h, i, c as c$1, f as f$1 } from './chunk-IFM2GZME.js';
|
|
6
|
-
import { c, e, f } from './chunk-ZFZIJ4A5.js';
|
|
7
|
-
|
|
8
|
-
var p,S,u,x,b,v,n=class extends i{constructor(){super(...arguments);e(this,p);e(this,u);e(this,b);this._clickable=!0;this._autoscroll=!0;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 a=this.scrollTop+s;f(this,p,S).call(this,this,a-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,u,x).bind(this)),this.reset();}reset(){this.loop=!1,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=!0,this.loopUpdateTime();}),t.addEventListener("pause",()=>{this.loop=!1;}));}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||!0}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`
|
|
9
|
-
<div>
|
|
10
|
-
${this.captions.segments.map((e,r)=>c$1`
|
|
11
|
-
<p
|
|
12
|
-
data-segment-id="segment-${r}"
|
|
13
|
-
style=${a$2(this.segmentStyle())}
|
|
14
|
-
@click=${this.clickable?f(this,b,v):f$1}
|
|
15
|
-
part=${a$3(this.inRange(e,"segment"))}
|
|
16
|
-
x-caption-segment-start="${e.start}"
|
|
17
|
-
x-caption-segment-end="${e.end}"
|
|
18
|
-
>
|
|
19
|
-
${e.words.map((i,s)=>c$1`
|
|
20
|
-
<span
|
|
21
|
-
data-word-id="word-${r}-${s}"
|
|
22
|
-
style=${a$2(this.wordStyle(this.inRange(i)))}
|
|
23
|
-
part=${a$3(this.inRange(i,"word",r,s))}
|
|
24
|
-
x-caption-word-start="${i.start}"
|
|
25
|
-
x-caption-word-end="${i.end}"
|
|
26
|
-
>${i.word.trim()}</span
|
|
27
|
-
>
|
|
28
|
-
`)}
|
|
29
|
-
</p>
|
|
30
|
-
`)}
|
|
31
|
-
</div>
|
|
32
|
-
`)}):f$1}};p=new WeakSet,S=function(t,e,r=500){let i=this.scrollTop,s=e-i,a=null,g=!1;function T(o){a||(a=o);let I=o-a,R=Math.min(I/r,1);t.scrollTop=i+s*E(R),I<r&&g?requestAnimationFrame(T):g=!1;}function E(o){return o<.5?2*o*o:1-Math.pow(-2*o+2,2)/2}g=!0,requestAnimationFrame(T);},u=new WeakSet,x=function(){this._lastScrollTime=Date.now();},b=new WeakSet,v=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`
|
|
33
|
-
:host {
|
|
34
|
-
display: block;
|
|
35
|
-
width: 100%;
|
|
36
|
-
height: 100%;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
[part='word'] {
|
|
40
|
-
background-color: rgba(255, 210, 42, 0.5);
|
|
41
|
-
}
|
|
42
|
-
`,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$1()],n.prototype,"currentTime",2),c([b$1()],n.prototype,"captions",2);window&&window.customElements&&(window.customElements.get("mave-text")||window.customElements.define("mave-text",n));
|
|
43
|
-
|
|
44
|
-
export { n as a };
|
package/dist/chunk-R3PDNBU4.js
DELETED
package/dist/chunk-RNHNE3HL.cjs
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkMS3Q4WGR_cjs = require('./chunk-MS3Q4WGR.cjs');
|
|
4
|
-
|
|
5
|
-
var M=t=>typeof t!="string"&&"strTag"in t,p=(t,e,o)=>{let s=t[0];for(let r=1;r<t.length;r++)s+=e[o?o[r-1]:r-1],s+=t[r];return s};var c=t=>M(t)?p(t.strings,t.values):t;var d="lit-localize-status";var x=class{constructor(e){this.__litLocalizeEventHandler=o=>{o.detail.status==="ready"&&this.host.requestUpdate();},this.host=e;}hostConnected(){window.addEventListener(d,this.__litLocalizeEventHandler);}hostDisconnected(){window.removeEventListener(d,this.__litLocalizeEventHandler);}},N=t=>t.addController(new x(t)),C=N;var W=()=>(t,e)=>(t.addInitializer(C),t);var u=class{constructor(){this.settled=!1,this.promise=new Promise((e,o)=>{this._resolve=e,this._reject=o;});}resolve(e){this.settled=!0,this._resolve(e);}reject(e){this.settled=!0,this._reject(e);}};var i=[];for(let t=0;t<256;t++)i[t]=(t>>4&15).toString(16)+(t&15).toString(16);function z(t){let e=0,o=8997,s=0,r=33826,n=0,a=40164,v=0,f=52210;for(let L=0;L<t.length;L++)o^=t.charCodeAt(L),e=o*435,s=r*435,n=a*435,v=f*435,n+=o<<8,v+=r<<8,s+=e>>>16,o=e&65535,n+=s>>>16,r=s&65535,f=v+(n>>>16)&65535,a=n&65535;return i[f>>8]+i[f&255]+i[a>>8]+i[a&255]+i[r>>8]+i[r&255]+i[o>>8]+i[o&255]}var F="",O="h",b="s";function A(t,e){return (e?O:b)+z(typeof t=="string"?t:t.join(F))}var y=new WeakMap,j=new Map;function H(t,e,o){if(t){let s=o?.id??X(e),r=t[s];if(r){if(typeof r=="string")return r;if("strTag"in r)return p(r.strings,e.values,r.values);{let n=y.get(r);return n===void 0&&(n=r.values,y.set(r,n)),{...r,values:n.map(a=>e.values[a])}}}}return c(e)}function X(t){let e=typeof t=="string"?t:t.strings,o=j.get(e);return o===void 0&&(o=A(e,typeof t!="string"&&!("strTag"in t)),j.set(e,o)),o}function _(t){window.dispatchEvent(new CustomEvent(d,{detail:t}));}var g="",E,R,h,T,P,l=new u;l.resolve();var m=0,U=t=>(S((e,o)=>H(P,e,o)),g=R=t.sourceLocale,h=new Set(t.targetLocales),h.add(t.sourceLocale),T=t.loadLocale,{getLocale:$,setLocale:k}),$=()=>g,k=t=>{if(t===(E??g))return l.promise;if(!h||!T)throw new Error("Internal error");if(!h.has(t))throw new Error("Invalid locale code");m++;let e=m;return E=t,l.settled&&(l=new u),_({status:"loading",loadingLocale:t}),(t===R?Promise.resolve({templates:void 0}):T(t)).then(s=>{m===e&&(g=t,E=void 0,P=s.templates,_({status:"ready",readyLocale:t}),l.resolve());},s=>{m===e&&(_({status:"error",errorLocale:t,errorMessage:s.toString()}),l.reject(s));}),l.promise};exports.b=c;var V=!1;function S(t){if(V)throw new Error("lit-localize can only be configured once");exports.b=t,V=!0;}var G=U({sourceLocale:"default",targetLocales:["en","nl","de","fr"],loadLocale:t=>import(`./${chunkMS3Q4WGR_cjs.a()}generated/locales/${t}.js`)}),w=!1,D=class{constructor(e){this._onLoad=e=>{e.detail.status==="loading"?w=!1:e.detail.status==="ready"&&(w=!0),this.host.requestUpdate();};this.host=e,e.addController(this);}get loaded(){return w}set locale(e){this._locale!==e&&(G.setLocale(e),this.host.requestUpdate());}get locale(){return this._locale}hostConnected(){window.addEventListener("lit-localize-status",this._onLoad);}hostDisconnected(){window.removeEventListener("lit-localize-status",this._onLoad);}};/*! Bundled license information:
|
|
6
|
-
|
|
7
|
-
@lit/localize/internal/str-tag.js:
|
|
8
|
-
(**
|
|
9
|
-
* @license
|
|
10
|
-
* Copyright 2021 Google LLC
|
|
11
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
*)
|
|
13
|
-
|
|
14
|
-
@lit/localize/internal/default-msg.js:
|
|
15
|
-
(**
|
|
16
|
-
* @license
|
|
17
|
-
* Copyright 2021 Google LLC
|
|
18
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*)
|
|
20
|
-
|
|
21
|
-
@lit/localize/internal/locale-status-event.js:
|
|
22
|
-
(**
|
|
23
|
-
* @license
|
|
24
|
-
* Copyright 2021 Google LLC
|
|
25
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
26
|
-
*)
|
|
27
|
-
|
|
28
|
-
@lit/localize/internal/types.js:
|
|
29
|
-
(**
|
|
30
|
-
* @license
|
|
31
|
-
* Copyright 2021 Google LLC
|
|
32
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*)
|
|
34
|
-
|
|
35
|
-
@lit/localize/internal/localized-controller.js:
|
|
36
|
-
(**
|
|
37
|
-
* @license
|
|
38
|
-
* Copyright 2021 Google LLC
|
|
39
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
40
|
-
*)
|
|
41
|
-
|
|
42
|
-
@lit/localize/internal/localized-decorator.js:
|
|
43
|
-
(**
|
|
44
|
-
* @license
|
|
45
|
-
* Copyright 2021 Google LLC
|
|
46
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
-
*)
|
|
48
|
-
|
|
49
|
-
@lit/localize/internal/deferred.js:
|
|
50
|
-
(**
|
|
51
|
-
* @license
|
|
52
|
-
* Copyright 2020 Google LLC
|
|
53
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*)
|
|
55
|
-
|
|
56
|
-
@lit/localize/internal/fnv1a64.js:
|
|
57
|
-
(**
|
|
58
|
-
* @license
|
|
59
|
-
* Copyright 2014 Travis Webb
|
|
60
|
-
* SPDX-License-Identifier: MIT
|
|
61
|
-
*)
|
|
62
|
-
|
|
63
|
-
@lit/localize/internal/id-generation.js:
|
|
64
|
-
(**
|
|
65
|
-
* @license
|
|
66
|
-
* Copyright 2020 Google LLC
|
|
67
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
|
-
*)
|
|
69
|
-
|
|
70
|
-
@lit/localize/internal/runtime-msg.js:
|
|
71
|
-
(**
|
|
72
|
-
* @license
|
|
73
|
-
* Copyright 2021 Google LLC
|
|
74
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
75
|
-
*)
|
|
76
|
-
|
|
77
|
-
@lit/localize/init/runtime.js:
|
|
78
|
-
(**
|
|
79
|
-
* @license
|
|
80
|
-
* Copyright 2021 Google LLC
|
|
81
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
82
|
-
*)
|
|
83
|
-
|
|
84
|
-
@lit/localize/init/transform.js:
|
|
85
|
-
(**
|
|
86
|
-
* @license
|
|
87
|
-
* Copyright 2021 Google LLC
|
|
88
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
89
|
-
*)
|
|
90
|
-
|
|
91
|
-
@lit/localize/lit-localize.js:
|
|
92
|
-
(**
|
|
93
|
-
* @license
|
|
94
|
-
* Copyright 2020 Google LLC
|
|
95
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
96
|
-
*)
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
exports.a = W;
|
|
100
|
-
exports.c = G;
|
|
101
|
-
exports.d = D;
|
package/dist/chunk-UEEYC5OJ.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkRRCW5BBR_cjs = require('./chunk-RRCW5BBR.cjs');
|
|
4
|
-
var chunkKGTAAGUE_cjs = require('./chunk-KGTAAGUE.cjs');
|
|
5
|
-
|
|
6
|
-
var u="important",d=" !"+u,h=chunkRRCW5BBR_cjs.b(class extends chunkRRCW5BBR_cjs.c{constructor(s){if(super(s),s.type!==chunkRRCW5BBR_cjs.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 chunkKGTAAGUE_cjs.e}});/*! Bundled license information:
|
|
7
|
-
|
|
8
|
-
lit-html/directives/style-map.js:
|
|
9
|
-
(**
|
|
10
|
-
* @license
|
|
11
|
-
* Copyright 2018 Google LLC
|
|
12
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*)
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
exports.a = h;
|
package/dist/chunk-VOXORDG3.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-R2QJ6RON.js';
|
|
2
|
-
import { i, c as c$1 } from './chunk-IFM2GZME.js';
|
|
3
|
-
import { a as a$1 } from './chunk-JBV2AYRP.js';
|
|
4
|
-
import { c } from './chunk-ZFZIJ4A5.js';
|
|
5
|
-
|
|
6
|
-
var r=class extends i{constructor(){super(...arguments);this.EVENT_TYPES={CLICK:"user_click"};}get embed(){return this._embed}set embed(t){this._embed=t;}get embedId(){return this._embed?.substring(5,this._embed?.length)}get spaceId(){return this.embed?.substring(0,5)}get cdn_root(){return a$1.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}get _stylesheets(){let t=document.querySelectorAll('style, link[rel="stylesheet"]');return c$1`${Array.from(t).map(e=>e.cloneNode(!0))}`}durationToTime(t){let e=Math.floor(t),s=Math.floor(e/3600),n=Math.floor(e%3600/60),i=e%60;return s>0?`${s}:${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`:`${n}:${i.toString().padStart(2,"0")}`}emit(t,e){this.dispatchEvent(new CustomEvent(`mave:${t}`,{detail:{...e,eventType:t}})),this.dispatchEvent(new CustomEvent("mave:*",{detail:{...e,eventType:t}}));}};c([a({type:String})],r.prototype,"embed",1);
|
|
7
|
-
|
|
8
|
-
export { r as a };
|
package/dist/chunk-XD2KSQMH.cjs
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkOLR7D3Q6_cjs = require('./chunk-OLR7D3Q6.cjs');
|
|
4
|
-
var chunkMHDCCX7Q_cjs = require('./chunk-MHDCCX7Q.cjs');
|
|
5
|
-
var chunkSDKTBB4N_cjs = require('./chunk-SDKTBB4N.cjs');
|
|
6
|
-
var chunkKCZRQ4AS_cjs = require('./chunk-KCZRQ4AS.cjs');
|
|
7
|
-
var chunk26S26OLO_cjs = require('./chunk-26S26OLO.cjs');
|
|
8
|
-
var chunkKGTAAGUE_cjs = require('./chunk-KGTAAGUE.cjs');
|
|
9
|
-
var chunk5STN56TL_cjs = require('./chunk-5STN56TL.cjs');
|
|
10
|
-
var chunk5Y5M5ND5_cjs = require('./chunk-5Y5M5ND5.cjs');
|
|
11
|
-
|
|
12
|
-
var P=chunk5Y5M5ND5_cjs.b(chunkMHDCCX7Q_cjs.b(),1);var f,k,l,m,u,v,b,x,w,H,p,E,$,N,z,R,O,U,d=class extends chunkKGTAAGUE_cjs.i{constructor(){super(...arguments);chunk5Y5M5ND5_cjs.e(this,f);chunk5Y5M5ND5_cjs.e(this,l);chunk5Y5M5ND5_cjs.e(this,u);chunk5Y5M5ND5_cjs.e(this,b);chunk5Y5M5ND5_cjs.e(this,w);chunk5Y5M5ND5_cjs.e(this,p);chunk5Y5M5ND5_cjs.e(this,$);chunk5Y5M5ND5_cjs.e(this,z);chunk5Y5M5ND5_cjs.e(this,O);this.autoplay="lazy";this.quality="auto";this.fallback="placeholder";this._queue=[];this._failedPlay=!1;this._intersectionObserver=new chunkMHDCCX7Q_cjs.a(this,{callback:chunk5Y5M5ND5_cjs.f(this,z,R).bind(this)});this.embedController=new chunkKCZRQ4AS_cjs.b(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==!0)??!1;}get loop(){return this._loop}get poster(){return this.embedController.embedFile(`${this.fallback}.jpg`)}set poster(t){if(t){let i=this._poster;this._poster=t,this.requestUpdate("poster",i);}}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"],i=this._embed.video.renditions.filter(e=>(this.quality=="auto"?e.size!=="uhd":chunk5Y5M5ND5_cjs.d(this,l,m).indexOf(e.size)<=chunk5Y5M5ND5_cjs.d(this,l,m).indexOf(this.quality))&&e.container==="mp4"&&chunk5Y5M5ND5_cjs.d(this,u,v).includes(e.codec)&&(!e.type||t.includes(e.type))).sort((e,s)=>e.size===s.size?chunk5Y5M5ND5_cjs.d(this,u,v).indexOf(e.codec)-chunk5Y5M5ND5_cjs.d(this,u,v).indexOf(s.codec):chunk5Y5M5ND5_cjs.d(this,l,m).indexOf(s.size)-chunk5Y5M5ND5_cjs.d(this,l,m).indexOf(e.size)).map(e=>{let s=chunk5Y5M5ND5_cjs.d(this,w,H).find(M=>M.size===e.size)?.media,_=`${e.codec}_${e.size}${e.type&&e.type!="video"?`_${e.type}`:""}.mp4`;return {media:s,src:this.embedController.embedFile(_),codec:chunk5Y5M5ND5_cjs.d(this,b,x)[e.codec]}}),n=this._embed.video.renditions.filter(e=>chunk5Y5M5ND5_cjs.d(this,l,m).indexOf(e.size)<=chunk5Y5M5ND5_cjs.d(this,l,m).indexOf("fhd")&&e.container==="mp4"&&chunk5Y5M5ND5_cjs.d(this,u,v).includes(e.codec)&&(!e.type||t.includes(e.type))).sort((e,s)=>chunk5Y5M5ND5_cjs.d(this,l,m).indexOf(s.size)-chunk5Y5M5ND5_cjs.d(this,l,m).indexOf(e.size));if(n.length>0){let e=n[0],s=`${e.codec}_${e.size}${e.type&&e.type!="video"?`_${e.type}`:""}.mp4`,_={media:void 0,src:this.embedController.embedFile(s),codec:chunk5Y5M5ND5_cjs.d(this,b,x)[e.codec]};i.push(_);}return i}connectedCallback(){super.connectedCallback(),this.autoplay==="scroll"&&document.addEventListener("scroll",chunk5Y5M5ND5_cjs.f(this,f,k).bind(this));}disconnectedCallback(){super.disconnectedCallback(),this.autoplay==="scroll"&&document.removeEventListener("scroll",chunk5Y5M5ND5_cjs.f(this,f,k).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||!1}get paused(){return this._videoElement?.paused||!0}get duration(){return new Promise((t,i)=>{if(this._videoElement&&!isNaN(this._videoElement.duration))return t(this._videoElement.duration);let n=()=>{this._videoElement?.addEventListener("loadedmetadata",()=>{this._videoElement&&t(this._videoElement.duration);}),this._videoElement?.addEventListener("error",e=>{i(new Error("Failed to load video metadata."));});};this._videoElement?n():this.addEventListener("mave:video_element_ready",()=>{n();});})}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?chunk5Y5M5ND5_cjs.f(this,p,E).call(this):this._queue.push(()=>chunk5Y5M5ND5_cjs.f(this,p,E).call(this));}pause(){this._videoElement?this._videoElement.pause():this._queue.push(()=>this._videoElement?.pause());}render(){return chunkKGTAAGUE_cjs.c`
|
|
13
|
-
${this.embedController.render({complete:t=>{if(this._embed=t,!!t)return chunkKGTAAGUE_cjs.c`
|
|
14
|
-
<video
|
|
15
|
-
@click=${chunk5Y5M5ND5_cjs.f(this,O,U)}
|
|
16
|
-
preload="metadata"
|
|
17
|
-
style=${chunkOLR7D3Q6_cjs.a(this._failedPlay||this.autoplay==="off"?"cursor: pointer":void 0)}
|
|
18
|
-
muted
|
|
19
|
-
playsinline
|
|
20
|
-
poster=${chunkOLR7D3Q6_cjs.a(this._failedPlay?this.poster:void 0)}
|
|
21
|
-
${chunkMHDCCX7Q_cjs.c(chunk5Y5M5ND5_cjs.f(this,$,N))}
|
|
22
|
-
?autoplay=${this.autoplay==="always"}
|
|
23
|
-
?loop=${this.loop||!0}
|
|
24
|
-
>
|
|
25
|
-
${this.sources.map(i=>chunkKGTAAGUE_cjs.c`
|
|
26
|
-
<source
|
|
27
|
-
media=${chunkOLR7D3Q6_cjs.a(i.media?`(min-width: ${i.media}px)`:void 0)}
|
|
28
|
-
src=${i.src}
|
|
29
|
-
type=${`video/mp4; ${i.codec}`}
|
|
30
|
-
/>
|
|
31
|
-
`)}
|
|
32
|
-
</video>
|
|
33
|
-
`}})}
|
|
34
|
-
`}};f=new WeakSet,k=function(){let{height:t,top:i,bottom:n}=this.getBoundingClientRect(),e=window.innerHeight;if(this._videoElement){this._videoElement.duration||this._videoElement.load();let s=0;if(i<e&&n>0){let _=t+e;s=(e-i)/_*this._videoElement.duration;}s>=0&&s<=this._videoElement.duration&&(this._videoElement.currentTime=s);}},l=new WeakSet,m=function(){return ["sd","hd","fhd","qhd","uhd"]},u=new WeakSet,v=function(){let t=navigator.userAgent,i=/Edg/.test(t)&&/Mac OS/.test(t),n=/Safari/.test(t)&&!/Chrome/.test(t),e=/Mac OS/.test(t),s=/iPhone|iPad/.test(t);return e&&(n||i)||s?["hevc","h264"]:["av1","h264"]},b=new WeakSet,x=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"}},w=new WeakSet,H=function(){return [{size:"qhd",media:1280},{size:"fhd",media:1080},{size:"hd",media:720},{size:"sd",media:640}]},p=new WeakSet,E=function(){this._metricsInstance?.monitor(),this._videoElement&&(this._videoElement.muted=!0,this._videoElement.play().catch(t=>{this._failedPlay=!0;}));},$=new WeakSet,N=function(t){if(this._videoElement||(this._videoElement=t,this.dispatchEvent(new CustomEvent("mave:video_element_ready",{detail:this._videoElement,bubbles:!0,composed:!0}))),this._intersectionObserver.observe(this._videoElement),this._videoElement&&this._embed){chunkSDKTBB4N_cjs.a.forEach(n=>{this._videoElement?.addEventListener(n,e=>{!this._canPlay&&this.autoplay==="scroll"&&n==="canplay"&&(this._canPlay=!0,chunk5Y5M5ND5_cjs.f(this,f,k).call(this)),this.dispatchEvent(new CustomEvent(n,{detail:e,bubbles:!0,composed:!0}));});});let i={component:"clip",video_id:this._embed.video.id,space_id:this._embed.space_id};P.Metrics.config={socketPath:chunk5STN56TL_cjs.a.metrics.socket,apiKey:this._embed.metrics_key},chunk5STN56TL_cjs.a.metrics.enabled&&(this._metricsInstance=new P.Metrics(this._videoElement,this.embed,i));}this._queue.length&&(this._queue.forEach(i=>i()),this._queue=[]);},z=new WeakSet,R=function(t){for(let{isIntersecting:i}of t){if(this.autoplay==="always")return;i&&(this.autoplay==="lazy"||this.autoplay==="true")?this._videoElement?.paused&&chunk5Y5M5ND5_cjs.f(this,p,E).call(this):this._videoElement?.paused||this._videoElement?.pause();}},O=new WeakSet,U=function(){(this.autoplay==="off"||this._failedPlay)&&(this._videoElement?.paused?chunk5Y5M5ND5_cjs.f(this,p,E).call(this):this._videoElement?.pause());},d.styles=chunkKGTAAGUE_cjs.h`
|
|
35
|
-
:host {
|
|
36
|
-
display: block;
|
|
37
|
-
position: relative;
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
video {
|
|
42
|
-
all: initial;
|
|
43
|
-
display: block;
|
|
44
|
-
width: 100%;
|
|
45
|
-
height: 100%;
|
|
46
|
-
object-fit: cover;
|
|
47
|
-
}
|
|
48
|
-
`,chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],d.prototype,"embed",1),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],d.prototype,"autoplay",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],d.prototype,"quality",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],d.prototype,"fallback",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],d.prototype,"loop",1),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],d.prototype,"poster",1),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],d.prototype,"token",1),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.b()],d.prototype,"_failedPlay",2);window&&window.customElements&&(window.customElements.get("mave-clip")||window.customElements.define("mave-clip",d));
|
|
49
|
-
|
|
50
|
-
exports.a = d;
|
package/dist/chunk-XEE2D3NF.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { b as b$1 } from './chunk-XSYWRQWB.js';
|
|
2
|
-
import { a as a$2 } from './chunk-VOXORDG3.js';
|
|
3
|
-
import { a as a$1 } from './chunk-R2QJ6RON.js';
|
|
4
|
-
import { h as h$1, c as c$2 } from './chunk-IFM2GZME.js';
|
|
5
|
-
import { c as c$1, e, f as f$1 } from './chunk-ZFZIJ4A5.js';
|
|
6
|
-
|
|
7
|
-
var a,d,f,$,b,D,c,p,h=class extends a$2{constructor(){super(...arguments);e(this,a);e(this,f);e(this,b);e(this,c);this.embedController=new b$1(this);}get embed(){return this._embed}set embed(i){this._embed!==i&&(this._embed=i,this.requestUpdate("embed"),this.embedController.embed=this.embed);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:!0})||[]}render(){return c$2`
|
|
8
|
-
${this.embedController.render({pending:this.renderPending,complete:i=>{if(this._data=i,!i)return;let s=this._slottedChildren.map(t=>{function e(){let n;return t.nodeName==="TEMPLATE"?n=t.content.cloneNode(!0):n=t.cloneNode(!0),n}if(t.getAttribute("name")=="mave-files-video"){let n=e(),r=new Date(this._data.created_at);r&&f$1(this,a,d).call(this,n,'[slot="date"]',r.toLocaleDateString().replaceAll("/","-"));let w=this._data.video.duration;w&&f$1(this,a,d).call(this,n,'[slot="duration"]',this.durationToTime(w));let v=this._data.video.filetype;v&&f$1(this,a,d).call(this,n,'[slot="filetype"]',v);let k=this._data.video.size,L=k/1e6;k&&f$1(this,a,d).call(this,n,'[slot="size"]',`${L.toFixed(1)} MB`);let g=f$1(this,c,p).call(this,`${this.cdn_root}/${this.embedId}/h264_hd.mp4`,`${this._data.name}.mp4`);return g.setAttribute("aria-label","Download video"),g.appendChild(n),c$2`${g}`}if(this._data.video.audio&&t.getAttribute("name")=="mave-files-audio"){let n=e();f$1(this,a,d).call(this,n,'[slot="filetype"]',"mp3");let r=f$1(this,c,p).call(this,`${this.cdn_root}/${this.embedId}/audio.mp3`,`${this._data.name}.mp3`);return r.setAttribute("aria-label","Download audio"),r.appendChild(n),c$2`${r}`}let u=this._data.subtitles.find(n=>n.language==this._data.video.language);if(u&&t.getAttribute("name")=="mave-files-subtitles"){let n=e();f$1(this,a,d).call(this,n,'[slot="filetype"]',"vtt");let r=f$1(this,c,p).call(this,u.path,`${this._data.name}.vtt`);return r.setAttribute("aria-label","Download subtitles"),r.appendChild(n),c$2`${r}`}});return c$2`${this._stylesheets} ${s}`}})}
|
|
9
|
-
`}renderPending(){return c$2`<slot style="display: none"></slot>`}};a=new WeakSet,d=function(i,s,t){let e=i.querySelector(s);e&&(e.textContent=t,e.removeAttribute("slot"));},f=new WeakSet,$=function(i,s){let t=window.URL.createObjectURL(i),e=document.createElement("a");e.style.display="none",e.href=t,e.download=s,this.appendChild(e),e.click(),window.URL.revokeObjectURL(t),this.removeChild(e);},b=new WeakSet,D=function(i,s){return fetch(i).then(t=>{if(!t.ok)throw new Error("Network response was not ok");return t.blob()}).then(t=>f$1(this,f,$).call(this,t,s)).catch(t=>console.error("Something went wrong:",t))},c=new WeakSet,p=function(i,s){let t=document.createElement("a");t.classList.add("link"),t.setAttribute("href",i),t.setAttribute("download",s),t.setAttribute("target","new");let e=!1;return t.addEventListener("click",u=>{u.preventDefault(),!e&&(e=!0,t.style.cursor="wait",t.style.opacity="0.5",f$1(this,b,D).call(this,i,s).then(()=>{e=!1,t.style.cursor="pointer",t.style.opacity="1";}));}),t},h.styles=h$1`
|
|
10
|
-
:host {
|
|
11
|
-
display: block;
|
|
12
|
-
--link-color: #006fc6;
|
|
13
|
-
--link-decoration: underline;
|
|
14
|
-
--link-decoration-thickness: 1px;
|
|
15
|
-
--link-decoration-offset: 1px;
|
|
16
|
-
--link-cursor: pointer;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
a {
|
|
20
|
-
text-decoration: var(--link-decoration);
|
|
21
|
-
text-decoration-thickness: var(--link-decoration-thickness);
|
|
22
|
-
text-underline-offset: var(--link-decoration-thickness);
|
|
23
|
-
color: var(--link-color);
|
|
24
|
-
cursor: var(--link-cursor);
|
|
25
|
-
}
|
|
26
|
-
`,c$1([a$1({type:String})],h.prototype,"embed",1);window&&window.customElements&&(window.customElements.get("mave-files")||window.customElements.define("mave-files",h));
|
|
27
|
-
|
|
28
|
-
export { h as a };
|
package/dist/chunk-ZFM2N7YP.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { a } from './chunk-VOXORDG3.js';
|
|
2
|
-
import { h, c } from './chunk-IFM2GZME.js';
|
|
3
|
-
|
|
4
|
-
var e=class extends a{get poster(){return `${this.cdn_root}/${this.embedId}/poster.webp`}render(){return c`<img src=${this.poster} />`}};e.styles=h`
|
|
5
|
-
:host {
|
|
6
|
-
display: block;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
img {
|
|
10
|
-
width: 100%;
|
|
11
|
-
max-height: 100vh;
|
|
12
|
-
}
|
|
13
|
-
`;window&&window.customElements&&(window.customElements.get("mave-img")||window.customElements.define("mave-img",e));
|
|
14
|
-
|
|
15
|
-
export { e as a };
|
package/dist/chunk-ZFZIJ4A5.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var k=Object.create;var h=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,n=Object.prototype.hasOwnProperty;var p=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var o=(b,a,c,e)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of l(a))!n.call(b,d)&&d!==c&&h(b,d,{get:()=>a[d],enumerable:!(e=i(a,d))||e.enumerable});return b};var q=(b,a,c)=>(c=b!=null?k(m(b)):{},o(a||!b||!b.__esModule?h(c,"default",{value:b,enumerable:!0}):c,b));var r=(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 j=(b,a,c)=>{if(!a.has(b))throw TypeError("Cannot "+c)};var s=(b,a,c)=>(j(b,a,"read from private field"),c?c.call(b):a.get(b)),t=(b,a,c)=>{if(a.has(b))throw TypeError("Cannot add the same private member more than once");a instanceof WeakSet?a.add(b):a.set(b,c);};var u=(b,a,c)=>(j(b,a,"access private method"),c);
|
|
2
|
-
|
|
3
|
-
export { p as a, q as b, r as c, s as d, t as e, u as f };
|