/var/www/vhosts/bsbdokum.com.tr/httpdocs/admin/assets/plugins/custom/uppy
NameSizeModeActions
uppy.bundle.css1074520644editdlrm
uppy.bundle.js5764570644editdlrm
Edit: /var/www/vhosts/bsbdokum.com.tr/httpdocs/admin/assets/plugins/custom/uppy/uppy.bundle.js (576457B)
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Uppy=e()}}((function(){var e,t,r,n=function(e){var t;return function(r){return t||e(t={exports:{},parent:r},t.exports),t.exports}},i=n((function(e,t){var r=$c("socket.io-client");e.exports=t=i;var n=t.managers={};function i(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var i,o=Qc(e),s=o.source,a=o.id,u=o.path,l=n[a]&&u in n[a].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||l?(r("ignoring socket cache for %s",s),i=Wh(s,t)):(n[a]||(r("new io instance for %s",s),n[a]=Wh(s,t)),i=n[a]),o.query&&!t.query&&(t.query=o.query),i.socket(o.path,t)}t.protocol=up.protocol,t.connect=i,t.Manager=Wh,t.Socket=Mh})),o=n((function(e,t){})),s=n((function(e,t){(function(e){(function(){"use strict";t.Buffer=r,t.INSPECT_MAX_BYTES=50;function e(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=r.prototype,t}function r(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return o(e)}return n(e,t,r)}function n(t,n,i){if("string"==typeof t)return function(t,n){if("string"==typeof n&&""!==n||(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i=0|u(t,n),o=e(i),s=o.write(t,n);return s!==i&&(o=o.slice(0,s)),o}(t,n);if(ArrayBuffer.isView(t))return s(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(D(t,ArrayBuffer)||t&&D(t.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function u(e,t){if(r.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return x(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(o)return i?-1:x(e).length;t=(""+t).toLowerCase(),o=!0}}function l(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function c(e,t,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),B(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=r.from(t,i)),r.isBuffer(t))return 0===t.length?-1:p(e,t,n,i,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):p(e,[t],n,i,o);throw new TypeError("val must be string, number or Buffer")}function p(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var p=!0,h=0;hi&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function y(e,t,r){return 0===t&&r===e.length?Qn.fromByteArray(e):Qn.fromByteArray(e.slice(t,r))}function b(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+p<=r)switch(p){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=p}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return b(this,t,r);case"ascii":return S(this,t,r);case"latin1":case"binary":return _(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(e){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===r.compare(this,e)},r.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),""},r.prototype.compare=function(e,t,n,i,o){if(D(e,Uint8Array)&&(e=r.from(e,e.offset,e.byteLength)),!r.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0),u=Math.min(s,a),l=this.slice(i,o),c=e.slice(t,n),p=0;p>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return h(this,e,t,r);case"utf8":case"utf-8":return d(this,e,t,r);case"ascii":return f(this,e,t,r);case"latin1":case"binary":return g(this,e,t,r);case"base64":return m(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function S(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;ii)&&(r=i);for(var o="",s=t;sr)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,i,o,s){if(!r.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function E(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function A(e,t,r,n,i){return t=+t,r>>>=0,i||E(e,0,r,4),li.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,i){return t=+t,r>>>=0,i||E(e,0,r,8),li.write(e,t,r,n,52,8),r+8}r.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},r.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},r.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},r.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},r.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},r.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),li.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),li.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),li.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),li.read(this,e,!1,52,8)},r.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||O(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},r.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,255,0),this[t]=255&e,t+1},r.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},r.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},r.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},r.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},r.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>0)-a&255;return t+r},r.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+r},r.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},r.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},r.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},r.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},r.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},r.prototype.writeFloatLE=function(e,t,r){return A(this,e,t,!0,r)},r.prototype.writeFloatBE=function(e,t,r){return A(this,e,t,!1,r)},r.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},r.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},r.prototype.copy=function(e,t,n,i){if(!r.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--s)e[s+t]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,i),t);return o},r.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!r.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var o=e.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(e=o)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(e){return Qn.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(R,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function T(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function B(e){return e!=e}}).call(this)}).call(this,s({}).Buffer)})),a=e={};function u(){throw new Error("setTimeout has not been defined")}function l(){throw new Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===u||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:u}catch(e){t=u}try{r="function"==typeof clearTimeout?clearTimeout:l}catch(e){r=l}}();var p,h=[],d=!1,f=-1;function g(){d&&p&&(d=!1,p.length?h=p.concat(h):f=-1,h.length&&m())}function m(){if(!d){var e=c(g);d=!0;for(var t=h.length;t;){for(p=h,h=[];++f1)for(var r=1;r-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function m(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=m(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=m(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(g)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];S.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(th){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function P(r,n){return new Promise((function(o,a){var u=new b(r,n);if(u.signal&&u.signal.aborted)return a(new e.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function p(){l.abort()}l.onload=function(){var e,t,r={status:l.status,statusText:l.statusText,headers:(e=l.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in l?l.responseURL:r.headers.get("X-Request-URL");var n="response"in l?l.response:l.responseText;setTimeout((function(){o(new S(n,r))}),0)},l.onerror=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},l.ontimeout=function(){setTimeout((function(){a(new TypeError("Network request failed"))}),0)},l.onabort=function(){setTimeout((function(){a(new e.DOMException("Aborted","AbortError"))}),0)},l.open(u.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(r){return e}}(u.url),!0),"include"===u.credentials?l.withCredentials=!0:"omit"===u.credentials&&(l.withCredentials=!1),"responseType"in l&&(i?l.responseType="blob":s&&u.headers.get("Content-Type")&&-1!==u.headers.get("Content-Type").indexOf("application/octet-stream")&&(l.responseType="arraybuffer")),!n||"object"!=typeof n.headers||n.headers instanceof h?u.headers.forEach((function(e,t){l.setRequestHeader(t,e)})):Object.getOwnPropertyNames(n.headers).forEach((function(e){l.setRequestHeader(e,c(n.headers[e]))})),u.signal&&(u.signal.addEventListener("abort",p),l.onreadystatechange=function(){4===l.readyState&&u.signal.removeEventListener("abort",p)}),l.send(void 0===u._bodyInit?null:u._bodyInit)}))}P.polyfill=!0,t.fetch||(t.fetch=P,t.Headers=h,t.Request=b,t.Response=S),e.Headers=h,e.Request=b,e.Response=S,e.fetch=P,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof S.exports?w(S.exports):w(this.WHATWGFetch={}),S=S.exports;var _=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function P(){return(P=Object.assign||function(e){for(var t=1;t=7&&t<=10},L.fingerprint=x,B=L;var z={};(function(e){(function(){var t=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,i=/^0o[0-7]+$/i,o=parseInt,s="object"==typeof e&&e&&e.Object===Object&&e,a="object"==typeof self&&self&&self.Object===Object&&self,u=s||a||Function("return this")(),l=Object.prototype.toString,c=Math.max,p=Math.min,h=function(){return u.Date.now()};function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(d(e)){var s="function"==typeof e.valueOf?e.valueOf():e;e=d(s)?s+"":s}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var a=n.test(e);return a||i.test(e)?o(e.slice(2),a?2:8):r.test(e)?NaN:+e}z=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return d(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),function(e,t,r){var n,i,o,s,a,u,l=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var r=n,o=i;return n=i=void 0,l=t,s=e.apply(o,r)}function b(e){var r=e-u;return void 0===u||r>=t||r<0||m&&e-l>=o}function w(){var e=h();if(b(e))return S(e);a=setTimeout(w,function(e){var r=t-(e-u);return m?p(r,o-(e-l)):r}(e))}function S(e){return a=void 0,v&&n?y(e):(n=i=void 0,s)}function _(){var e=h(),r=b(e);if(n=arguments,i=this,u=e,r){if(void 0===a)return function(e){return l=e,a=setTimeout(w,t),g?y(e):s}(u);if(m)return a=setTimeout(w,t),y(u)}return void 0===a&&(a=setTimeout(w,t)),s}return t=f(t)||0,d(r)&&(g=!!r.leading,o=(m="maxWait"in r)?c(f(r.maxWait)||0,t):o,v="trailing"in r?!!r.trailing:v),_.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=u=i=a=void 0},_.flush=function(){return void 0===a?s:S(h())},_}(e,t,{leading:n,maxWait:t,trailing:i})}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var H,q=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,n));var i=r[n];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+i:(t?"-":"")+e.toFixed(1)+" "+i};function V(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}V.prototype.match=function(e){var t,r,n=!0,i=this.parts,o=i.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(r=(e||"").split(this.separator),t=0;n&&t18||18===n&&i>=18218};function re(e){return 2!==e.length?0+e:e}var ne=function(){var e=new Date;return re(e.getHours().toString())+":"+re(e.getMinutes().toString())+":"+re(e.getSeconds().toString())},ie={justErrorsLogger:{debug:function(){},warn:function(){},error:function(){for(var e,t=arguments.length,r=new Array(t),n=0;n2;)S.push(arguments[s]);for(r&&null!=r.children&&(S.length||S.push(r.children),delete r.children);S.length;)if((i=S.pop())&&void 0!==i.pop)for(s=i.length;s--;)S.push(i[s]);else"boolean"==typeof i&&(i=null),(o="function"!=typeof t)&&(null==i?i="":"number"==typeof i?i=String(i):"string"!=typeof i&&(o=!1)),o&&n?a[a.length-1]+=i:a===_?a=[i]:a.push(i),n=o;var u=new e;return u.nodeName=t,u.children=a,u.attributes=null==r?void 0:r,u.key=null==r?void 0:r.key,void 0!==w.vnode&&w.vnode(u),u}function r(e,t){for(var r in t)e[r]=t[r];return e}function n(e){!e.__d&&(e.__d=!0)&&1==C.push(e)&&(w.debounceRendering||P)(i)}function i(){var e,t=C;for(C=[];e=t.pop();)e.__d&&v(e)}function o(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function s(e){var t=r({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var i in n)void 0===t[i]&&(t[i]=n[i]);return t}function a(e){var t=e.parentNode;t&&t.removeChild(e)}function u(e,t,r,n,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)r&&r(null),n&&n(e);else if("class"!==t||i)if("style"===t){if(n&&"string"!=typeof n&&"string"!=typeof r||(e.style.cssText=n||""),n&&"object"==typeof n){if("string"!=typeof r)for(var o in r)o in n||(e.style[o]="");for(var o in n)e.style[o]="number"==typeof n[o]&&!1===k.test(o)?n[o]+"px":n[o]}}else if("dangerouslySetInnerHTML"===t)n&&(e.innerHTML=n.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),n?r||e.addEventListener(t,l,s):e.removeEventListener(t,l,s),(e.__l||(e.__l={}))[t]=n}else if("list"!==t&&"type"!==t&&!i&&t in e)!function(e,t,r){try{e[t]=r}catch(n){}}(e,t,null==n?"":n),null!=n&&!1!==n||e.removeAttribute(t);else{var a=i&&t!==(t=t.replace(/^xlink:?/,""));null==n||!1===n?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof n&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),n):e.setAttribute(t,n))}else e.className=n||""}function l(e){return this.__l[e.type](w.event&&w.event(e)||e)}function c(){for(var e;e=O.pop();)w.afterMount&&w.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,r,n,i,l){E++||(A=null!=i&&void 0!==i.ownerSVGElement,F=null!=e&&!("__preactattr_"in e));var p=function e(t,r,n,i,l){var c=t,p=A;if(null!=r&&"boolean"!=typeof r||(r=""),"string"==typeof r||"number"==typeof r)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||l)?t.nodeValue!=r&&(t.nodeValue=r):(c=document.createTextNode(r),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),h(t,!0))),c.__preactattr_=!0,c;var d,g,v=r.nodeName;if("function"==typeof v)return function(e,t,r,n){for(var i=e&&e._component,o=i,a=e,u=i&&e._componentConstructor===t.nodeName,l=u,c=s(t);i&&!l&&(i=i.__u);)l=i.constructor===t.nodeName;return i&&l&&(!n||i._component)?(m(i,c,3,r,n),e=i.base):(o&&!u&&(y(o),e=a=null),i=f(t.nodeName,c,r),e&&!i.__b&&(i.__b=e,a=null),m(i,c,1,r,n),e=i.base,a&&e!==a&&(a._component=null,h(a,!1))),e}(t,r,n,i);if(A="svg"===v||"foreignObject"!==v&&A,v=String(v),(!t||!o(t,v))&&(d=v,(g=A?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d)).__n=d,c=g,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),h(t,!0)}var b=c.firstChild,w=c.__preactattr_,S=r.children;if(null==w){w=c.__preactattr_={};for(var _=c.attributes,P=_.length;P--;)w[_[P].name]=_[P].value}return!F&&S&&1===S.length&&"string"==typeof S[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=S[0]&&(b.nodeValue=S[0]):(S&&S.length||null!=b)&&function(t,r,n,i,s){var u,l,c,p,d,f,g,m,v=t.childNodes,y=[],b={},w=0,S=0,_=v.length,P=0,k=r?r.length:0;if(0!==_)for(var C=0;C<_;C++){var O=v[C],E=O.__preactattr_;null!=(A=k&&E?O._component?O._component.__k:E.key:null)?(w++,b[A]=O):(E||(void 0!==O.splitText?!s||O.nodeValue.trim():s))&&(y[P++]=O)}if(0!==k)for(C=0;C2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,r){return p(r,e,{},!1,t,!1)},rerender:i,options:w};oe.exports=x}(),oe=oe.exports;var se=function(e){return e&&"object"==typeof e&&e.nodeType===Node.ELEMENT_NODE},ae=function(e,t){return void 0===t&&(t=document),"string"==typeof e?t.querySelector(e):se(e)?e:void 0};function ue(){return(ue=Object.assign||function(e){for(var t=1;t tag initializing Uppy is right before the closing tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.")},t.render=function(e){throw new Error("Extend the render method to add your plugin to a DOM element")},t.addTarget=function(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")},t.unmount=function(){this.isTargetDOMEl&&this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},t.install=function(){},t.uninstall=function(){this.unmount()},e}();function pe(){return(pe=Object.assign||function(e){for(var t=1;ts)throw new be(""+this.i18n("youCanOnlyUploadX",{smart_count:s}));if(a&&!a.some((function(t){return t.indexOf("/")>-1?!!e.type&&function(e,t){function r(t){var r=H(t,e,X);return r&&r.length>=2}return t?r(t.split(";")[0]):r}(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.substr(1).toLowerCase()}))){var u=a.join(", ");throw new be(this.i18n("youCanOnlyUploadFileTypes",{types:u}))}if(o&&null!=e.size){var l=0;if(l+=e.size,t.forEach((function(e){l+=e.size})),l>o)throw new be(this.i18n("exceedsSize2",{backwardsCompat:this.i18n("exceedsSize"),size:q(o)}))}if(n&&null!=e.size&&e.size>n)throw new be(this.i18n("exceedsSize2",{backwardsCompat:this.i18n("exceedsSize"),size:q(n)}));if(i&&null!=e.size&&e.size5?this.log("Added batch of "+n.length+" files"):Object.keys(n).forEach((function(e){t.log("Added file: "+n[e].name+"\n id: "+n[e].id+"\n type: "+n[e].type)})),n.length>0&&this._startIfAutoProceed(),i.length>0){var a="Multiple errors occurred while adding files:\n";if(i.forEach((function(e){a+="\n * "+e.message})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:i.length}),details:a},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(i,a);var u=new Error(a);throw u.errors=i,u}},n.removeFiles=function(e,t){var r=this,n=this.getState(),i=n.files,o=n.currentUploads,s=pe({},i),a=pe({},o),u=Object.create(null);function l(e){return void 0===u[e]}e.forEach((function(e){i[e]&&(u[e]=i[e],delete s[e])})),Object.keys(a).forEach((function(e){var t=o[e].fileIDs.filter(l);0!==t.length?a[e]=pe({},o[e],{fileIDs:t}):delete a[e]}));var c={currentUploads:a,files:s};0===Object.keys(s).length&&(c.allowNewUpload=!0,c.error=null,c.recoveredState=null),this.setState(c),this._calculateTotalProgress();var p=Object.keys(u);p.forEach((function(e){r.emit("file-removed",u[e],t)})),p.length>5?this.log("Removed "+p.length+" files"):this.log("Removed files: "+p.join(", "))},n.removeFile=function(e,t){void 0===t&&(t=null),this.removeFiles([e],t)},n.pauseResume=function(e){if(this.getState().capabilities.resumableUploads&&!this.getFile(e).uploadComplete){var t=!this.getFile(e).isPaused;return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}},n.pauseAll=function(){var e=pe({},this.getState().files);Object.keys(e).filter((function(t){return!e[t].progress.uploadComplete&&e[t].progress.uploadStarted})).forEach((function(t){var r=pe({},e[t],{isPaused:!0});e[t]=r})),this.setState({files:e}),this.emit("pause-all")},n.resumeAll=function(){var e=pe({},this.getState().files);Object.keys(e).filter((function(t){return!e[t].progress.uploadComplete&&e[t].progress.uploadStarted})).forEach((function(t){var r=pe({},e[t],{isPaused:!1,error:null});e[t]=r})),this.setState({files:e}),this.emit("resume-all")},n.retryAll=function(){var e=pe({},this.getState().files),t=Object.keys(e).filter((function(t){return e[t].error}));if(t.forEach((function(t){var r=pe({},e[t],{isPaused:!1,error:null});e[t]=r})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});var r=this._createUpload(t,{forceAllowNewUpload:!0});return this._runUpload(r)},n.cancelAll=function(){this.emit("cancel-all");var e=this.getState().files,t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState({totalProgress:0,error:null,recoveredState:null})},n.retryUpload=function(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);var t=this._createUpload([e],{forceAllowNewUpload:!0});return this._runUpload(t)},n.reset=function(){this.cancelAll()},n.logout=function(){this.iteratePlugins((function(e){e.provider&&e.provider.logout&&e.provider.logout()}))},n._calculateProgress=function(e,t){if(this.getFile(e.id)){var r=isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:pe({},this.getFile(e.id).progress,{bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:r?Math.round(t.bytesUploaded/t.bytesTotal*100):0})}),this._calculateTotalProgress()}else this.log("Not setting progress for a file that has been removed: "+e.id)},n._calculateTotalProgress=function(){var e=this.getFiles().filter((function(e){return e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess}));if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});var t=e.filter((function(e){return null!=e.progress.bytesTotal})),r=e.filter((function(e){return null==e.progress.bytesTotal}));if(0!==t.length){var n=t.reduce((function(e,t){return e+t.progress.bytesTotal}),0),i=n/t.length;n+=i*r.length;var o=0;t.forEach((function(e){o+=e.progress.bytesUploaded})),r.forEach((function(e){o+=i*(e.progress.percentage||0)/100}));var s=0===n?0:Math.round(o/n*100);s>100&&(s=100),this.setState({totalProgress:s}),this.emit("progress",s)}else{var a=100*e.length,u=r.reduce((function(e,t){return e+t.progress.percentage}),0),l=Math.round(u/a*100);this.setState({totalProgress:l})}},n._addListeners=function(){var e=this;this.on("error",(function(t){var r="Unknown error";t.message&&(r=t.message),t.details&&(r+=" "+t.details),e.setState({error:r})})),this.on("upload-error",(function(t,r,n){var i="Unknown error";if(r.message&&(i=r.message),r.details&&(i+=" "+r.details),e.setFileState(t.id,{error:i,response:n}),e.setState({error:r.message}),"object"==typeof r&&r.message){var o=new Error(r.message);o.details=r.message,r.details&&(o.details+=" "+r.details),o.message=e.i18n("failedToUpload",{file:t.name}),e._showOrLogErrorAndThrow(o,{throwErr:!1})}else e._showOrLogErrorAndThrow(r,{throwErr:!1})})),this.on("upload",(function(){e.setState({error:null})})),this.on("upload-started",(function(t,r){e.getFile(t.id)?e.setFileState(t.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:t.size}}):e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("upload-progress",this._calculateProgress),this.on("upload-success",(function(t,r){if(e.getFile(t.id)){var n=e.getFile(t.id).progress;e.setFileState(t.id,{progress:pe({},n,{postprocess:e.postProcessors.length>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),e._calculateTotalProgress()}else e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("preprocess-progress",(function(t,r){e.getFile(t.id)?e.setFileState(t.id,{progress:pe({},e.getFile(t.id).progress,{preprocess:r})}):e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("preprocess-complete",(function(t){if(e.getFile(t.id)){var r=pe({},e.getState().files);r[t.id]=pe({},r[t.id],{progress:pe({},r[t.id].progress)}),delete r[t.id].progress.preprocess,e.setState({files:r})}else e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("postprocess-progress",(function(t,r){e.getFile(t.id)?e.setFileState(t.id,{progress:pe({},e.getState().files[t.id].progress,{postprocess:r})}):e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("postprocess-complete",(function(t){if(e.getFile(t.id)){var r=pe({},e.getState().files);r[t.id]=pe({},r[t.id],{progress:pe({},r[t.id].progress)}),delete r[t.id].progress.postprocess,e.setState({files:r})}else e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("restored",(function(){e._calculateTotalProgress()})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",(function(){return e.updateOnlineStatus()})),window.addEventListener("offline",(function(){return e.updateOnlineStatus()})),setTimeout((function(){return e.updateOnlineStatus()}),3e3))},n.updateOnlineStatus=function(){void 0===window.navigator.onLine||window.navigator.onLine?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)},n.getID=function(){return this.opts.id},n.use=function(e,t){if("function"!=typeof e)throw new TypeError("Expected a plugin class, but got "+(null===e?"null":typeof e)+". Please verify that the plugin was imported and spelled correctly.");var r=new e(this,t),n=r.id;if(this.plugins[r.type]=this.plugins[r.type]||[],!n)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");var i=this.getPlugin(n);if(i){var o="Already found a plugin named '"+i.id+"'. Tried to use: '"+n+"'.\nUppy plugins must have unique `id` options. See https://uppy.io/docs/plugins/#id.";throw new Error(o)}return e.VERSION&&this.log("Using "+n+" v"+e.VERSION),this.plugins[r.type].push(r),r.install(),this},n.getPlugin=function(e){var t=null;return this.iteratePlugins((function(r){if(r.id===e)return t=r,!1})),t},n.iteratePlugins=function(e){var t=this;Object.keys(this.plugins).forEach((function(r){t.plugins[r].forEach(e)}))},n.removePlugin=function(e){var t;this.log("Removing plugin "+e.id),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();var r=this.plugins[e.type].slice(),n=ee(r,(function(t){return t.id===e.id}));-1!==n&&(r.splice(n,1),this.plugins[e.type]=r);var i={plugins:pe({},this.getState().plugins,(t={},t[e.id]=void 0,t))};this.setState(i)},n.close=function(){var e=this;this.log("Closing Uppy instance "+this.opts.id+": removing all files and uninstalling plugins"),this.reset(),this._storeUnsubscribe(),this.iteratePlugins((function(t){e.removePlugin(t)}))},n.info=function(e,t,r){void 0===t&&(t="info"),void 0===r&&(r=3e3);var n="object"==typeof e;this.setState({info:{isHidden:!1,type:t,message:n?e.message:e,details:n?e.details:null}}),this.emit("info-visible"),clearTimeout(this.infoTimeoutID),this.infoTimeoutID=0!==r?setTimeout(this.hideInfo,r):void 0},n.hideInfo=function(){var e=pe({},this.getState().info,{isHidden:!0});this.setState({info:e}),this.emit("info-hidden")},n.log=function(e,t){var r=this.opts.logger;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e)}},n.run=function(){return this.log("Calling run() is no longer necessary.","warning"),this},n.restore=function(e){return this.log('Core: attempting to restore upload "'+e+'"'),this.getState().currentUploads[e]?this._runUpload(e):(this._removeUpload(e),Promise.reject(new Error("Nonexistent upload")))},n._createUpload=function(e,t){var r;void 0===t&&(t={});var n=t.forceAllowNewUpload,i=void 0!==n&&n,o=this.getState(),s=o.allowNewUpload,a=o.currentUploads;if(!s&&!i)throw new Error("Cannot create a new upload: already uploading.");var u=B();return this.emit("upload",{id:u,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploads,currentUploads:pe({},a,(r={},r[u]={fileIDs:e,step:0,result:{}},r))}),u},n._getUpload=function(e){return this.getState().currentUploads[e]},n.addResultData=function(e,t){var r;if(this._getUpload(e)){var n=this.getState().currentUploads,i=pe({},n[e],{result:pe({},n[e].result,t)});this.setState({currentUploads:pe({},n,(r={},r[e]=i,r))})}else this.log("Not setting result for an upload that has been removed: "+e)},n._removeUpload=function(e){var t=pe({},this.getState().currentUploads);delete t[e],this.setState({currentUploads:t})},n._runUpload=function(e){var t=this,r=this.getState().currentUploads[e].step,n=[].concat(this.preProcessors,this.uploaders,this.postProcessors),i=Promise.resolve();return n.forEach((function(n,o){o300){var t="Failed request with status: "+e.status+". "+e.statusText;return e.json().then((function(e){throw t=e.message?t+" message: "+e.message:t,t=e.requestId?t+" request-Id: "+e.requestId:t,new Error(t)})).catch((function(){throw new Error(t)}))}return e.json()},n.preflight=function(e){var t=this;return this.preflightDone?Promise.resolve(this.allowedHeaders.slice()):fetch(this._getUrl(e),{method:"OPTIONS"}).then((function(e){return e.headers.has("access-control-allow-headers")&&(t.allowedHeaders=e.headers.get("access-control-allow-headers").split(",").map((function(e){return e.trim().toLowerCase()}))),t.preflightDone=!0,t.allowedHeaders.slice()})).catch((function(e){return t.uppy.log("[CompanionClient] unable to make preflight request "+e,"warning"),t.preflightDone=!0,t.allowedHeaders.slice()}))},n.preflightAndHeaders=function(e){var t=this;return Promise.all([this.preflight(e),this.headers()]).then((function(e){var r=e[0],n=e[1];return Object.keys(n).forEach((function(e){-1===r.indexOf(e.toLowerCase())&&(t.uppy.log("[CompanionClient] excluding unallowed header "+e),delete n[e])})),n}))},n.get=function(e,t){var r=this;return this.preflightAndHeaders(e).then((function(t){return Te(r._getUrl(e),{method:"get",headers:t,credentials:r.opts.companionCookiesRule||"same-origin"})})).then(this._getPostResponseFunc(t)).then((function(e){return r._json(e)})).catch((function(t){return t.isAuthError||(t.message="Could not get "+r._getUrl(e)+". "+t.message),Promise.reject(t)}))},n.post=function(e,t,r){var n=this;return this.preflightAndHeaders(e).then((function(r){return Te(n._getUrl(e),{method:"post",headers:r,credentials:n.opts.companionCookiesRule||"same-origin",body:JSON.stringify(t)})})).then(this._getPostResponseFunc(r)).then((function(e){return n._json(e)})).catch((function(t){return t.isAuthError||(t.message="Could not post "+n._getUrl(e)+". "+t.message),Promise.reject(t)}))},n.delete=function(e,t,r){var n=this;return this.preflightAndHeaders(e).then((function(r){return Te(n.hostname+"/"+e,{method:"delete",headers:r,credentials:n.opts.companionCookiesRule||"same-origin",body:t?JSON.stringify(t):null})})).then(this._getPostResponseFunc(r)).then((function(e){return n._json(e)})).catch((function(t){return t.isAuthError||(t.message="Could not delete "+n._getUrl(e)+". "+t.message),Promise.reject(t)}))},t=e,(r=[{key:"hostname",get:function(){var e=this.uppy.getState().companion,t=this.opts.companionUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}},{key:"defaultHeaders",get:function(){return{Accept:"application/json","Content-Type":"application/json","Uppy-Versions":"@uppy/companion-client="+e.VERSION}}}])&&Be(t.prototype,r),e}(),Re.VERSION="1.10.1",xe),Ne=Object.prototype.hasOwnProperty,Me=function e(t,r){var n=[];for(var i in t)if(Ne.call(t,i)){var o,s=t[i],a=encodeURIComponent(i);o="object"==typeof s?e(s,r?r+"["+a+"]":a):(r?r+"["+a+"]":a)+"="+encodeURIComponent(s),n.push(o)}return n.join("&")},je=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e},Le={},ze=Object.prototype.hasOwnProperty;function He(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function qe(e){try{return encodeURIComponent(e)}catch(t){return null}}Le.stringify=function(e,t){t=t||"";var r,n,i=[];for(n in"string"!=typeof t&&(t="?"),e)if(ze.call(e,n)){if((r=e[n])||null!=r&&!isNaN(r)||(r=""),n=qe(n),r=qe(r),null===n||null===r)continue;i.push(n+"="+r)}return i.length?t+i.join("&"):""},Le.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,n={};t=r.exec(e);){var i=He(t[1]),o=He(t[2]);null===i||null===o||i in n||(n[i]=o)}return n};var Ve={};(function(e){(function(){"use strict";var t=/^[A-Za-z][A-Za-z0-9+-.]*:[\\/]+/,r=/^([a-z][a-z0-9.+-]*:)?([\\/]{1,})?([\S\s]*)/i,n=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function i(e){return(e||"").toString().replace(n,"")}var o=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],s={hash:1,query:1};function a(r){var n,i=("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{}).location||{},o={},a=typeof(r=r||i);if("blob:"===r.protocol)o=new l(unescape(r.pathname),{});else if("string"===a)for(n in o=new l(r,{}),s)delete o[n];else if("object"===a){for(n in r)n in s||(o[n]=r[n]);void 0===o.slashes&&(o.slashes=t.test(r.href))}return o}function u(e){e=i(e);var t=r.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!(t[2]&&t[2].length>=2),rest:t[2]&&1===t[2].length?"/"+t[3]:t[3]}}function l(e,t,r){if(e=i(e),!(this instanceof l))return new l(e,t,r);var n,s,c,p,h,d,f=o.slice(),g=typeof t,m=this,v=0;for("object"!==g&&"string"!==g&&(r=t,t=null),r&&"function"!=typeof r&&(r=Le.parse),t=a(t),n=!(s=u(e||"")).protocol&&!s.slashes,m.slashes=s.slashes||n&&t.slashes,m.protocol=s.protocol||t.protocol||"",e=s.rest,s.slashes||(f[3]=[/(.*)/,"pathname"]);v0&&e.isOpen;){var r=e._queued[0];e.send(r.action,r.payload),e._queued=e._queued.slice(1)}},this.socket.onclose=function(t){e.isOpen=!1},this.socket.onmessage=this._handleMessage},t.close=function(){this.socket&&this.socket.close()},t.send=function(e,t){this.isOpen?this.socket.send(JSON.stringify({action:e,payload:t})):this._queued.push({action:e,payload:t})},t.on=function(e,t){this.emitter.on(e,t)},t.emit=function(e,t){this.emitter.emit(e,t)},t.once=function(e,t){this.emitter.once(e,t)},t._handleMessage=function(e){try{var t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(th){console.log(th)}},e}()};function Je(e,t){return(Je=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qe=oe.h,Ze=function(e){var t,r;function n(){return e.apply(this,arguments)||this}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Je(t,r),n.prototype.render=function(){var e=Qe("span",{className:"uppy-Provider-authTitleName"},this.props.pluginName,Qe("br",null));return Qe("div",{className:"uppy-Provider-auth"},Qe("div",{className:"uppy-Provider-authIcon"},this.props.pluginIcon()),Qe("div",{className:"uppy-Provider-authTitle"},this.props.i18nArray("authenticateWithTitle",{pluginName:e})),Qe("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn",onClick:this.props.handleAuth,"data-uppy-super-focusable":!0},this.props.i18nArray("authenticateWith",{pluginName:this.props.pluginName})))},n}(oe.Component),et=oe.h,tt=oe.h,rt=function(e){return tt("span",null,tt("button",{type:"button",className:"uppy-u-reset",onClick:e.getFolder},e.title),e.isLast?"":" / ")},nt=function(e){var t=[];return e.showBreadcrumbs&&t.push(function(e){return tt("div",{className:"uppy-Provider-breadcrumbs"},tt("div",{className:"uppy-Provider-breadcrumbsIcon"},e.breadcrumbsIcon),e.directories.map((function(t,r){return tt(rt,{key:t.id,getFolder:function(){return e.getFolder(t.id)},title:0===r?e.title:t.title,isLast:r+1===e.directories.length})})))}({getFolder:e.getFolder,directories:e.directories,breadcrumbsIcon:e.pluginIcon&&e.pluginIcon(),title:e.title})),t.push(function(e){return[et("span",{className:"uppy-ProviderBrowser-user",key:"username"},e.username),et("button",{type:"button",onClick:e.logout,className:"uppy-u-reset uppy-ProviderBrowser-userLogout",key:"logout"},e.i18n("logOut"))]}({logout:e.logout,username:e.username,i18n:e.i18n})),t},it={exports:{}};function ot(e,t){return(ot=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";var e={}.hasOwnProperty;function t(){for(var r=[],n=0;n0&&Rt(At,Ft({selected:u},e)))},Ut=oe.h,Tt=function(e){return Ut("div",{className:"uppy-Provider-loading"},Ut("span",null,e.i18n("loading")))},Dt=function(e){if(!e)return!1;var t=e.split("/")[1];return!!/^(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(t)},Bt=function(){function e(e){this.plugin=e,this.filterItems=this.filterItems.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.isChecked=this.isChecked.bind(this),this.loaderWrapper=this.loaderWrapper.bind(this)}var t=e.prototype;return t.filterItems=function(e){var t=this.plugin.getPluginState();return t.filterInput&&""!==t.filterInput?e.filter((function(e){return-1!==e.name.toLowerCase().indexOf(t.filterInput.toLowerCase())})):e},t.toggleCheckbox=function(e,t){var r=this;e.stopPropagation(),e.preventDefault(),e.currentTarget.focus();var n=this.plugin.getPluginState(),i=n.folders,o=n.files,s=this.filterItems(i.concat(o));if(this.lastCheckbox&&e.shiftKey){var a,u=s.indexOf(this.lastCheckbox),l=s.indexOf(t);return a=(a=ui?-1:ri?1:ri?-1:ri?1:ri?-1:ni?1:n0||!r&&i(t)?gr("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFile")+" "+t.meta.name,title:o("editFile"),onClick:function(){return s()}},gr("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},gr("g",{fillRule:"evenodd"},gr("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),gr("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),gr("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function vr(e){var t=e.i18n,r=e.onClick;return gr("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile"),title:t("removeFile"),onClick:function(){return r()}},gr("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},gr("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),gr("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}var yr=function(e,t){var r,n;(r=t.file.uploadURL,n=t.i18n("copyLinkToClipboardFallback"),n=n||"Copy the URL below",new Promise((function(e){var t=document.createElement("textarea");t.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),t.value=r,document.body.appendChild(t),t.select();var i=function(){document.body.removeChild(t),window.prompt(n,r),e()};try{return document.execCommand("copy")?(document.body.removeChild(t),e()):i()}catch(th){return document.body.removeChild(t),i()}}))).then((function(){t.log("Link copied to clipboard."),t.info(t.i18n("copyLinkToClipboardSuccess"),"info",3e3)})).catch(t.log).then((function(){return e.target.focus({preventScroll:!0})}))};function br(e){return gr("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":e.i18n("copyLink"),title:e.i18n("copyLink"),onClick:function(t){return yr(t,e)}},gr("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},gr("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}var wr=function(e){var t=e.file,r=e.uploadInProgressOrComplete,n=e.canEditFile,i=e.metaFields,o=e.showLinkToFileUploadResult,s=e.showRemoveButton,a=e.i18n,u=e.removeFile,l=e.toggleFileCard,c=e.openFileEditor,p=e.log,h=e.info;return gr("div",{className:"uppy-Dashboard-Item-actionWrapper"},gr(mr,{i18n:a,file:t,uploadInProgressOrComplete:r,canEditFile:n,metaFields:i,onClick:function(){i&&i.length>0?l(!0,t.id):c(t)}}),o&&t.uploadURL?gr(br,{file:t,i18n:a,info:h,log:p}):null,s?gr(vr,{i18n:a,info:e.info,log:e.log,onClick:function(){return u(t.id,"removed-by-user")}}):null)};function Sr(e,t){return(Sr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var _r=oe.h,Pr=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Sr(t,r);var i=n.prototype;return i.shouldComponentUpdate=function(e){return!function(e,t){if(e===t)return!0;for(var r in e)if(!(r in t))return!1;for(var r in t)if(e[r]!==t[r])return!1;return!0}(this.props,e)},i.componentDidMount=function(){var e=this.props.file;e.preview||this.props.handleRequestThumbnail(e)},i.componentDidUpdate=function(){var e=this.props.file;e.preview||this.props.handleRequestThumbnail(e)},i.componentWillUnmount=function(){var e=this.props.file;e.preview||this.props.handleCancelThumbnail(e)},i.render=function(){var e=this.props.file,t=e.progress.preprocess||e.progress.postprocess,r=e.progress.uploadComplete&&!t&&!e.error,n=e.progress.uploadStarted||t,i=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,s=e.isGhost,a=(this.props.individualCancellation||!i)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(a=!0);var u=it({"uppy-Dashboard-Item":!0,"is-inprogress":i&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return _r("div",{className:u,id:"uppy_"+e.id,role:this.props.role},_r("div",{className:"uppy-Dashboard-Item-preview"},_r(or,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult}),_r(pr,{file:e,error:o,isUploaded:r,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,showRemoveButtonAfterComplete:this.props.showRemoveButtonAfterComplete,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,pauseUpload:this.props.pauseUpload,cancelUpload:this.props.cancelUpload,retryUpload:this.props.retryUpload,i18n:this.props.i18n})),_r("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},_r(fr,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel}),_r(wr,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:a,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:n,removeFile:this.props.removeFile,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,i18n:this.props.i18n,log:this.props.log,info:this.props.info})))},n}(oe.Component);function kr(){return(kr=Object.assign||function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,["data","rowHeight","renderRow","overscanCount","sync"])),a=this.state,u=a.offset,l=a.height,c=Math.floor(u/r),p=Math.floor(l/r);o&&(c=Math.max(0,c-c%o),p+=o);var h=c+p+4,d=t.slice(c,h),f=kr({},Ar,{height:t.length*r}),g=kr({},Fr,{top:c*r});return Or("div",kr({onScroll:this.handleScroll},s),Or("div",{role:"presentation",style:f},Or("div",{role:"presentation",style:g},d.map(n))))},n}(Er);function xr(){return(xr=Object.assign||function(e){for(var t=1;t0?t.props.i18nArray("dropPasteImport"+n,{browseFiles:l,browseFolders:c,browse:u}):t.props.i18nArray("dropPaste"+n,{browseFiles:l,browseFolders:c,browse:u}),"files"===r)try{a=e>0?t.props.i18nArray("dropPasteImport",{browse:u}):t.props.i18nArray("dropPaste",{browse:u})}catch(d){}return t.props.disableLocalFiles&&(a=t.props.i18n("importFiles")),Br("div",{className:"uppy-Dashboard-AddFiles-title"},a)},t.renderAcquirer=function(e){return Br("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},Br("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"aria-controls":"uppy-DashboardContent-panel--"+e.id,"aria-selected":t.props.activePickerPanel.id===e.id,"data-uppy-super-focusable":!0,onClick:function(){return t.props.showPanel(e.id)}},e.icon(),Br("div",{className:"uppy-DashboardTab-name"},e.name)))},t.renderAcquirers=function(e,r){var n=[].concat(e),i=n.splice(e.length-2,e.length);return Br("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},!r&&t.renderMyDeviceAcquirer(),n.map((function(e){return t.renderAcquirer(e)})),Br("span",{role:"presentation",style:"white-space: nowrap;"},i.map((function(e){return t.renderAcquirer(e)}))))},t}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Dr(t,r);var i=n.prototype;return i.renderPoweredByUppy=function(){var e=Br("span",null,Br("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},Br("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),Br("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),t=this.props.i18nArray("poweredBy2",{backwardsCompat:this.props.i18n("poweredBy"),uppy:e});return Br("a",{tabIndex:"-1",href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},t)},i.render=function(){var e=this;return Br("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,(function(t){e.fileInput=t})),this.renderHiddenInput(!0,(function(t){e.folderInput=t})),this.renderDropPasteBrowseTagline(),this.props.acquirers.length>0&&this.renderAcquirers(this.props.acquirers,this.props.disableLocalFiles),Br("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&Br("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))},n}(oe.Component),Nr=oe.h,Mr=function(e){return Nr("div",{className:it("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":e.showAddFilesPanel},Nr("div",{className:"uppy-DashboardContent-bar"},Nr("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("addingMoreFiles")),Nr("button",{className:"uppy-DashboardContent-back",type:"button",onClick:function(t){return e.toggleAddFilesPanel(!1)}},e.i18n("back"))),Nr(Ir,e))},jr=function(e){var t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()},Lr=oe.h,zr=function(e){return Lr("div",{className:it("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:"uppy-DashboardContent-panel--"+e.activePickerPanel.id,onDragOver:jr,onDragLeave:jr,onDrop:jr,onPaste:jr},Lr("div",{className:"uppy-DashboardContent-bar"},Lr("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("importFrom",{name:e.activePickerPanel.name})),Lr("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.hideAllPanels},e.i18n("done"))),Lr("div",{className:"uppy-DashboardContent-panelBody"},e.getPlugin(e.activePickerPanel.id).render(e.state)))},Hr=oe.h,qr=function(e){var t=this.props.files[this.props.fileCardFor];return Hr("div",{className:it("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},Hr("div",{className:"uppy-DashboardContent-bar"},Hr("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18nArray("editing",{file:Hr("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),Hr("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.hideAllPanels},e.i18n("done"))),Hr("div",{className:"uppy-DashboardContent-panelBody"},e.editors.map((function(t){return e.getPlugin(t.id).render(e.state)}))))},Vr=oe.h,Wr="error",Xr="waiting",Yr="preprocessing",Gr="uploading",Kr="postprocessing",$r="complete",Jr="paused";function Qr(e){switch(function(e,t,r,n){if(void 0===n&&(n={}),e)return Wr;if(t)return $r;if(r)return Jr;for(var i=Xr,o=Object.keys(n),s=0;s1;return Pn("div",{className:"uppy-StatusBar-statusSecondary"},t&&e.i18n("filesUploadedOfTotal",{complete:e.complete,smart_count:e.numUploads}),Pn("span",{className:"uppy-StatusBar-additionalInfo"},t&&" \xb7 ",e.i18n("dataUploadedOfTotal",{complete:q(e.totalUploadedSize),total:q(e.totalSize)})," \xb7 ",e.i18n("xTimeLeft",{time:bn(e.totalETA)})))}),500,{leading:!0,trailing:!0}),Dn=function(e){if(!e.isUploadStarted||e.isAllComplete)return null;var t=e.isAllPaused?e.i18n("paused"):e.i18n("uploading"),r=e.newFiles&&e.isUploadStarted;return Pn("div",{className:"uppy-StatusBar-content","aria-label":t,title:t},e.isAllPaused?null:Pn(Fn,null),Pn("div",{className:"uppy-StatusBar-status"},Pn("div",{className:"uppy-StatusBar-statusPrimary"},e.supportsUploadProgress?t+": "+e.totalProgress+"%":t),e.isAllPaused||r||!e.showProgressDetails?null:e.supportsUploadProgress?Pn(Tn,e):Pn(xn,e),r?Pn(Un,e):null))},Bn=function(e){e.totalProgress;var t=e.i18n;return Pn("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},Pn("div",{className:"uppy-StatusBar-status"},Pn("div",{className:"uppy-StatusBar-statusPrimary"},Pn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},Pn("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))},In=function(e){var t=e.error,r=(e.retryAll,e.hideRetryButton,e.i18n);return Pn("div",{className:"uppy-StatusBar-content",role:"alert",title:r("uploadFailed")},Pn("div",{className:"uppy-StatusBar-status"},Pn("div",{className:"uppy-StatusBar-statusPrimary"},Pn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},Pn("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),r("uploadFailed"))),Pn("span",{className:"uppy-StatusBar-details","aria-label":t,"data-microtip-position":"top-right","data-microtip-size":"medium",role:"tooltip",onClick:function(){var e=r("uploadFailed")+" \n\n "+t;alert(e)}},"?"))},Nn=function(e){for(;e&&!e.dir;)e=e.parentNode;return e?e.dir:void 0};function Mn(){return(Mn=Object.assign||function(e){for(var t=1;t0,w=100===i&&c.length===Object.keys(r).length&&0===g.length,S=o&&p.length===a.length,_=0!==h.length&&l.length===h.length,P=h.length>0,k=t.resumableUploads||!1,C=!1!==t.uploadProgress,O=a.some((function(e){return e.isGhost}));return function(e){var t,r,n=e=e||{},i=n.newFiles,o=n.allowNewUpload,s=n.isUploadInProgress,a=n.isAllPaused,u=n.resumableUploads,l=n.error,c=n.hideUploadButton,p=n.hidePauseResumeButton,h=n.hideCancelButton,d=n.hideRetryButton,f=n.recoveredState,g=e.uploadState,m=e.totalProgress;if(g===gn||g===vn){var v=function(e){var t=[];Object.keys(e).forEach((function(r){var n=e[r].progress;n.preprocess&&t.push(n.preprocess),n.postprocess&&t.push(n.postprocess)}));var r=t[0];return{mode:r.mode,message:r.message,value:t.filter((function(e){return"determinate"===e.mode})).reduce((function(e,t,r,n){return e+t.value/n.length}),0)}}(e.files);"determinate"===(t=v.mode)&&(m=100*v.value),r=Rn(v)}else g===yn?r=Bn(e):g===mn?(e.supportsUploadProgress||(t="indeterminate",m=null),r=Dn(e)):g===dn&&(m=void 0,r=In(e));var y="number"==typeof m?m:100,b=g===fn&&e.hideUploadButton||g===fn&&!e.newFiles>0||g===yn&&e.hideAfterFinish,w=!l&&i&&!s&&!a&&o&&!c;f&&(b=!1,w=!0);var S=!h&&g!==fn&&g!==yn,_=u&&!p&&g===mn,P=l&&!d,k=e.doneButtonHandler&&g===yn,C="uppy-StatusBar-progress\n "+(t?"is-"+t:""),O=it({"uppy-Root":e.isTargetDOMEl},"uppy-StatusBar","is-"+g,{"has-ghosts":e.isSomeGhost});return Pn("div",{className:O,"aria-hidden":b},Pn("div",{className:C,style:{width:y+"%"},role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":m}),r,Pn("div",{className:"uppy-StatusBar-actions"},w?Pn(kn,wn({},e,{uploadState:g})):null,P?Pn(Cn,e):null,_?Pn(En,e):null,S?Pn(On,e):null,k?Pn(An,e):null))}({error:o,uploadState:this.getUploadingState(S,w,s,e.files||{}),allowNewUpload:n,totalProgress:i,totalSize:v,totalUploadedSize:y,isAllComplete:w,isAllPaused:_,isAllErrored:S,isUploadStarted:b,isUploadInProgress:P,isSomeGhost:O,recoveredState:s,complete:c.length,newFiles:u.length,numUploads:f.length,totalETA:m,files:r,i18n:this.i18n,pauseAll:this.uppy.pauseAll,resumeAll:this.uppy.resumeAll,retryAll:this.uppy.retryAll,cancelAll:this.uppy.cancelAll,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:k,supportsUploadProgress:C,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})},i.onMount=function(){var e=this.el;Nn(e)||(e.dir="ltr")},i.install=function(){var e=this.opts.target;e&&this.mount(e,this)},i.uninstall=function(){this.unmount()},n}(le.Plugin),Sn.VERSION="1.9.5",_n);function Vn(){return(Vn=Object.assign||function(e){for(var t=1;t0?i-4:i;for(r=0;r>16&255,s[a++]=t>>8&255,s[a++]=255&t;return 2===o&&(t=ei[e.charCodeAt(r)]<<2|ei[e.charCodeAt(r+1)]>>4,s[a++]=255&t),1===o&&(t=ei[e.charCodeAt(r)]<<10|ei[e.charCodeAt(r+1)]<<4|ei[e.charCodeAt(r+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s},fromByteArray:function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));return 1===n?(t=e[r-1],i.push(Zn[t>>2]+Zn[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(Zn[t>>10]+Zn[t>>4&63]+Zn[t<<2&63]+"=")),i.join("")}},Zn=[],ei=[],ti="undefined"!=typeof Uint8Array?Uint8Array:Array,ri="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ni=0,ii=ri.length;ni0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function si(e,t,r){for(var n,i,o=[],s=t;s>18&63]+Zn[i>>12&63]+Zn[i>>6&63]+Zn[63&i]);return o.join("")}ei["-".charCodeAt(0)]=62,ei["_".charCodeAt(0)]=63;var ai,ui,li={read:function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,c=-7,p=r?i-1:0,h=r?-1:1,d=e[t+p];for(p+=h,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+p],p+=h,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=l}return(d?-1:1)*s*Math.pow(2,o-n)},write:function(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,f=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+p>=1?h/u:h*Math.pow(2,1-p))*u>=2&&(s++,u/=2),s+p>=c?(a=0,s=c):s+p>=1?(a=(t*u-1)*Math.pow(2,i),s+=p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=f,a/=256,i-=8);for(s=s<0;e[r+d]=255&s,d+=f,s/=256,l-=8);e[r+d-f]|=128*g}},ci={exports:{}};function pi(){return(pi=Object.assign||function(e){for(var t=1;t1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:0;return this.substring(t,t+e.length)===e}),String.prototype.endsWith||(String.prototype.endsWith=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.length;return this.substring(t-e.length,t)===e});var P="undefined"!=typeof self?self:t,k=P.fetch||function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var i=new XMLHttpRequest;if(i.open("get",e,!0),i.responseType="arraybuffer",i.onerror=n,t.headers)for(var o in t.headers)i.setRequestHeader(o,t.headers[o]);i.onload=function(){r({ok:i.status>=200&&i.status<300,status:i.status,arrayBuffer:function(){return Promise.resolve(i.response)}})},i.send(null)}))},C=function(e){var t=[];if(Object.defineProperties(t,{size:{get:function(){return this.length}},has:{value:function(e){return-1!==this.indexOf(e)}},add:{value:function(e){this.has(e)||this.push(e)}},delete:{value:function(e){if(this.has(e)){var t=this.indexOf(e);this.splice(t,1)}}}}),Array.isArray(e))for(var r=0;r=0}},{key:"delete",value:function(e){var t=this._keys.indexOf(e);return!(t<0||(delete this._map["map_"+e],this._keys.splice(t,1),0))}},{key:"keys",value:function(){return this._keys.slice(0)}},{key:"values",value:function(){var e=this;return this._keys.map((function(t){return e.get(t)}))}},{key:"entries",value:function(){var e=this;return this._keys.map((function(t){return[t,e.get(t)]}))}},{key:"forEach",value:function(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0;if(i(this,e),"boolean"==typeof o&&(this.le=o),Array.isArray(t)&&(t=new Uint8Array(t)),0===t)this.byteOffset=0,this.byteLength=0;else if(t instanceof ArrayBuffer){void 0===n&&(n=t.byteLength-r);var s=new DataView(t,r,n);this._swapDataView(s)}else if(t instanceof Uint8Array||t instanceof DataView||t instanceof e){void 0===n&&(n=t.byteLength-r),(r+=t.byteOffset)+n>t.byteOffset+t.byteLength&&I("Creating view outside of available memory in ArrayBuffer");var a=new DataView(t.buffer,r,n);this._swapDataView(a)}else if("number"==typeof t){var u=new DataView(new ArrayBuffer(t));this._swapDataView(u)}else I("Invalid input argument for BufferView: "+t)}return s(e,[{key:"_swapArrayBuffer",value:function(e){this._swapDataView(new DataView(e))}},{key:"_swapBuffer",value:function(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}},{key:"_swapDataView",value:function(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}},{key:"_lengthToEnd",value:function(e){return this.byteLength-e}},{key:"set",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return t instanceof DataView||t instanceof e?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t instanceof Uint8Array||I("BufferView.set(): Invalid data argument."),this.toUint8().set(t,r),new n(this,r,t.byteLength)}},{key:"subarray",value:function(t,r){return new e(this,t,r=r||this._lengthToEnd(t))}},{key:"toUint8",value:function(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}},{key:"getUint8Array",value:function(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}},{key:"getString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.byteLength;return function(e){return j?j.decode(e):T?r.from(e).toString("utf8"):decodeURIComponent(escape(M(e)))}(this.getUint8Array(e,t))}},{key:"getLatin1String",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.byteLength,r=this.getUint8Array(e,t);return M(r)}},{key:"getUnicodeString",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.byteLength,r=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getInt16(e,t)}},{key:"getInt32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getInt32(e,t)}},{key:"getUint16",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getUint16(e,t)}},{key:"getUint32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getUint32(e,t)}},{key:"getFloat32",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat32(e,t)}},{key:"getFloat64",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat64(e,t)}},{key:"getFloat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat32(e,t)}},{key:"getDouble",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.le;return this.dataView.getFloat64(e,t)}},{key:"getUintBytes",value:function(e,t,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64&&this.getUint64(e,r)}}},{key:"getUint",value:function(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64&&this.getUint64(e,r)}}},{key:"toString",value:function(e){return this.dataView.toString(e,this.constructor.name)}},{key:"ensureChunk",value:function(){}}],[{key:"from",value:function(t,r){return t instanceof this&&t.le===r?t:new e(t,void 0,void 0,r)}}]),e}();function z(e,t){I("".concat(e," '").concat(t,"' was not loaded, try using full build of exifr."))}var H=function(e){u(r,d(E));var t=g(r);function r(e){var n;return i(this,r),(n=t.call(this)).kind=e,n}return s(r,[{key:"get",value:function(e,t){return this.has(e)||z(this.kind,e),t&&(e in t||function(e,t){I("Unknown ".concat(e," '").concat(t,"'."))}(this.kind,e),t[e].enabled||z(this.kind,e)),m(l(r.prototype),"get",this).call(this,e)}},{key:"keyList",value:function(){return S(this.keys())}}]),r}(),q=new H("file parser"),V=new H("segment parser"),W=new H("file reader");function X(e){return function(){for(var t=[],r=0;r1e4?J(e,t,"base64"):F?Q(e,t,"url",K):x?J(e,t,"fs"):void I(Z);var r}var te=function(e){u(r,d(E));var t=g(r);function r(){return i(this,r),t.apply(this,arguments)}return s(r,[{key:"tagKeys",get:function(){return this.allKeys||(this.allKeys=S(this.keys())),this.allKeys}},{key:"tagValues",get:function(){return this.allValues||(this.allValues=S(this.values())),this.allValues}}]),r}();function re(e,t,r){var n=new te,i=r;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=S(i));for(var o=0;o0&&u.translateTagSet(o,u.pick);else if("object"==typeof o){if(u.enabled=!0,u.parse=!1!==o.parse,u.canBeFiltered){var l=o.pick,c=o.skip;l&&l.length>0&&u.translateTagSet(l,u.pick),c&&c.length>0&&u.translateTagSet(c,u.skip)}u.applyInheritables(o)}else!0===o||!1===o?u.parse=u.enabled=o:I("Invalid options argument: ".concat(o));return u}return s(r,[{key:"needed",get:function(){return this.enabled||this.deps.size>0}},{key:"applyInheritables",value:function(e){var t,r,n=me;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=S(n));for(var i=0;i0?(this.enabled=!0,Ce(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ce(this.pick,this.deps)}}]),r}(),we={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},Se=O(),_e=function(e){u(r,ye);var t=g(r);function r(e){var n;return i(this,r),n=t.call(this),!0===e?n.setupFromTrue():void 0===e?n.setupFromUndefined():Array.isArray(e)?n.setupFromArray(e):"object"==typeof e?n.setupFromObject(e):I("Invalid options argument ".concat(e)),void 0===n.firstChunkSize&&(n.firstChunkSize=F?n.firstChunkSizeBrowser:n.firstChunkSizeNode),n.mergeOutput&&(n.ifd1.enabled=!1),n.filterNestedSegmentTags(),n.traverseTiffDependencyTree(),n.checkLoadedPlugins(),n}return s(r,[{key:"setupFromUndefined",value:function(){var e,t=ce;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=S(t));for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:r;if(e&&e.length){var i=n;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=S(i));for(var o=0;o0&&(t.errors=r),B(n=t)?void 0:n;var n}))}catch(e){return Promise.reject(e)}}},{key:"doParse",value:function(e,t){try{var r=this;return Oe(r.fileParser.parse(),(function(){var n,i=v(r.parsers).map((n=function(t){return Oe(t.parse(),(function(r){t.assignToOutput(e,r)}))},function(){for(var e=[],t=0;ti+s?e.chunk=o.file.subarray(i,s):void 0===e.size?e.chunk=o.file.subarray(i):I("Segment unreachable: "+JSON.stringify(e))},r=function(){return e.chunk},(n=t())&&n.then?n.then(r):r()}.apply(this,t))}catch(e){return Promise.reject(e)}})),this.extendOptions&&this.extendOptions(t),this.options=t,this.file=r,this.parsers=n}return s(e,[{key:"injectSegment",value:function(e,t){this.options[e].enabled&&this.createParser(e,t)}},{key:"createParser",value:function(e,t){var r=new(V.get(e))(t,this.options,this.file);return this.parsers[e]=r}},{key:"createParsers",value:function(e){var t=e;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=S(t));for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;i(this,e),a(this,"errors",[]),a(this,"raw",O()),a(this,"handleError",(function(e){if(!r.options.silentErrors)throw e;r.errors.push(e.message)})),this.chunk=this.normalizeInput(t),this.file=o,this.type=this.constructor.type,this.globalOptions=this.options=n,this.localOptions=n[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}return s(e,[{key:"normalizeInput",value:function(e){return e instanceof L?e:new L(e)}},{key:"translate",value:function(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}},{key:"output",get:function(){return this.translated?this.translated:this.raw?w(this.raw):void 0}},{key:"translateBlock",value:function(e,t){var r=se.get(t),n=oe.get(t),i=ie.get(t),o=this.options[t],s=o.reviveValues&&!!r,a=o.translateValues&&!!n,u=o.translateKeys&&!!i,l={},c=e;Array.isArray(c)||("function"==typeof c.entries&&(c=c.entries()),c=S(c));for(var p=0;p1&&void 0!==arguments[1]?arguments[1]:{};return new this(e,new _e(a({},this.type,t))).parse()}}]),e}();function Ne(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Me(){}function je(e,t){var r=e();return r&&r.then?r.then(t):t(r)}function Le(e,t,r){if(!e.s){if(r instanceof ze){if(!r.s)return void(r.o=Le.bind(null,e,t));1&t&&(t=r.s),r=r.v}if(r&&r.then)return void r.then(Le.bind(null,e,t),Le.bind(null,e,2));e.s=t,e.v=r;var n=e.o;n&&n(e)}}a(Ie,"headerLength",4),a(Ie,"type",void 0),a(Ie,"multiSegment",!1),a(Ie,"canHandle",(function(){return!1}));var ze=function(){function e(){}return e.prototype.then=function(t,r){var n=new e,i=this.s;if(i){var o=1&i?t:r;if(o){try{Le(n,1,o(this.v))}catch(e){Le(n,2,e)}return n}return this}return this.o=function(e){try{var i=e.v;1&e.s?Le(n,1,t?t(i):i):r?Le(n,1,r(i)):Le(n,2,i)}catch(e){Le(n,2,e)}},n},e}();function He(e){return e instanceof ze&&1&e.s}function qe(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function Ve(e){return e>=224&&e<=239}function We(e,t,r){var n=V;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=S(n));for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;try{var r=this;r.setupSegmentFinderArgs(t);var n=r.file,i=r.findAll,o=r.wanted,s=r.remaining;return je((function(){if(!i&&r.file.chunked)return i=S(o).some((function(e){var t=V.get(e),n=r.options[e];return t.multiSegment&&n.multiSegment})),function(e){var t=function(){if(i)return function(e,t){return e&&e.then?e.then(Me):Promise.resolve()}(r.file.readWhole())}();if(t&&t.then)return t.then(Me)}()}),(function(){var t=!1;if(e=r.findAppSegmentsInRange(e,n.byteLength),!r.options.onlyTiff)return function(){if(n.chunked){var i=!1;return function(e,t,r){for(var n;;){var i=e();if(He(i)&&(i=i.v),!i)return s;if(i.then){n=0;break}var o,s=r();if(s&&s.then){if(!He(s)){n=1;break}s=s.s}}var a=new ze,u=Le.bind(null,a,2);return(0===n?i.then(c):1===n?s.then(l):o.then(p)).then(void 0,u),a;function l(t){s=t;do{if(!(i=e())||He(i)&&!i.v)return void Le(a,1,s);if(i.then)return void i.then(c).then(void 0,u);He(s=r())&&(s=s.v)}while(!s||!s.then);s.then(l).then(void 0,u)}function c(e){e?(s=r())&&s.then?s.then(l).then(void 0,u):l(s):Le(a,1,s)}function p(){(i=e())?i.then?i.then(c).then(void 0,u):c(i):Le(a,1,s)}}((function(){return!t&&s.size>0&&!i&&(!!n.canReadNextChunk||!!r.unfinishedMultiSegment)}),0,(function(){var o=n.nextChunkOffset,s=r.appSegments.some((function(e){return!r.file.available(e.offset||e.start,e.length||e.size)}));return je((function(){return Ne(e>o&&!s?n.readNextChunk(e):n.readNextChunk(o),(function(e){i=!e}))}),(function(){void 0===(e=r.findAppSegmentsInRange(e,n.byteLength))&&(t=!0)}))}))}}()}))}catch(e){return Promise.reject(e)}}},{key:"findAppSegmentsInRange",value:function(e,t){t-=2;for(var r,n,i,o,s,a,u=this.file,l=this.findAll,c=this.wanted,p=this.remaining,h=this.options;et.byteLength&&I("IFD0 offset points to outside of file.\nthis.ifd0Offset: ".concat(e.ifd0Offset,", file.byteLength: ").concat(t.byteLength)),Ke((function(){if(t.tiff)return Ge(t.ensureChunk(e.ifd0Offset,N(e.options)))}),(function(){var t=e.parseBlock(e.ifd0Offset,"ifd0");if(0!==t.size)return e.exifOffset=t.get(34665),e.interopOffset=t.get(le),e.gpsOffset=t.get(34853),e.xmp=t.get(700),e.iptc=t.get(33723),e.icc=t.get(34675),e.options.sanitize&&(t.delete(34665),t.delete(le),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t}))}catch(e){return Promise.reject(e)}}},{key:"parseExifBlock",value:function(){try{var e=this;if(e.exif)return;return Ke((function(){if(!e.ifd0)return Ge(e.parseIfd0Block())}),(function(){if(void 0!==e.exifOffset)return Ke((function(){if(e.file.tiff)return Ge(e.file.ensureChunk(e.exifOffset,N(e.options)))}),(function(){var t=e.parseBlock(e.exifOffset,"exif");return e.interopOffset||(e.interopOffset=t.get(le)),e.makerNote=t.get(ae),e.userComment=t.get(ue),e.options.sanitize&&(t.delete(le),t.delete(ae),t.delete(ue)),e.unpack(t,41728),e.unpack(t,41729),t}))}))}catch(e){return Promise.reject(e)}}},{key:"unpack",value:function(e,t){var r=e.get(t);r&&1===r.length&&e.set(t,r[0])}},{key:"parseGpsBlock",value:function(){try{var e=this;if(e.gps)return;return Ke((function(){if(!e.ifd0)return Ge(e.parseIfd0Block())}),(function(){if(void 0!==e.gpsOffset){var t=e.parseBlock(e.gpsOffset,"gps");return t&&t.has(2)&&t.has(4)&&(t.set("latitude",Qe.apply(void 0,t.get(2).concat([t.get(1)]))),t.set("longitude",Qe.apply(void 0,t.get(4).concat([t.get(3)])))),t}}))}catch(e){return Promise.reject(e)}}},{key:"parseInteropBlock",value:function(){try{var e=this;if(e.interop)return;return Ke((function(){if(!e.ifd0)return Ge(e.parseIfd0Block())}),(function(){return Ke((function(){if(void 0===e.interopOffset&&!e.exif)return Ge(e.parseExifBlock())}),(function(){if(void 0!==e.interopOffset)return e.parseBlock(e.interopOffset,"interop")}))}))}catch(e){return Promise.reject(e)}}},{key:"parseThumbnailBlock",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{var t=this;if(t.ifd1||t.ifd1Parsed)return;if(t.options.mergeOutput&&!e)return;return t.findIfd1Offset(),t.ifd1Offset>0&&(t.parseBlock(t.ifd1Offset,"ifd1"),t.ifd1Parsed=!0),t.ifd1}catch(e){return Promise.reject(e)}}},{key:"extractThumbnail",value:function(){try{var e=this;return e.headerParsed||e.parseHeader(),Ke((function(){if(!e.ifd1Parsed)return Ge(e.parseThumbnailBlock(!0))}),(function(){if(void 0!==e.ifd1){var t=e.ifd1.get(513),r=e.ifd1.get(514);return e.chunk.getUint8Array(t,r)}}))}catch(e){return Promise.reject(e)}}},{key:"image",get:function(){return this.ifd0}},{key:"thumbnail",get:function(){return this.ifd1}},{key:"createOutput",value:function(){var e,t,r,n={},i=de;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=S(i));for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:O(),n=this.options[t],i=n.pick,o=n.skip,s=(i=C(i)).size>0,a=0===o.size,u=this.chunk.getUint16(e);e+=2;for(var l=0;l13)&&I("Invalid TIFF value type. block: ".concat(r.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(o,", offset ").concat(e)),e>i.byteLength&&I("Invalid TIFF value offset. block: ".concat(r.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(o,", offset ").concat(e," is outside of chunk size ").concat(i.byteLength)),1===o)return i.getUint8Array(e,s);if(2===o)return""===(n=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(n=i.getString(e,s)).trim())?void 0:n;if(7===o)return i.getUint8Array(e,s);if(1===s)return this.parseTagValue(o,e);for(var u=new(function(e){switch(o){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}())(s),l=a,c=0;cthis.byteLength){var o=this._extend(i).dataView;this._swapDataView(o)}}}},{key:"_extend",value:function(e){var t;t=T?U.allocUnsafe(e):new Uint8Array(e);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}},{key:"subarray",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t=t||this._lengthToEnd(e),n&&this._tryExtend(e,t),this.ranges.add(e,t),m(l(r.prototype),"subarray",this).call(this,e,t)}},{key:"set",value:function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&this._tryExtend(t,e.byteLength,e);var n=m(l(r.prototype),"set",this).call(this,e,t);return this.ranges.add(t,n.byteLength),n}},{key:"ensureChunk",value:function(e,t){try{var r=this;if(!r.chunked)return;if(r.ranges.available(e,t))return;return function(e,t){return e&&e.then?e.then(bt):Promise.resolve()}(r.readChunk(e,t))}catch(e){return Promise.reject(e)}}},{key:"available",value:function(e,t){return this.ranges.available(e,t)}}]),r}(),St=function(){function e(){i(this,e),a(this,"list",[])}return s(e,[{key:"length",get:function(){return this.list.length}},{key:"add",value:function(e,t){var r=e+t,n=this.list.filter((function(t){return _t(e,t.offset,r)||_t(e,t.end,r)}));if(n.length>0){e=Math.min.apply(Math,[e].concat(n.map((function(e){return e.offset})))),t=(r=Math.max.apply(Math,[r].concat(n.map((function(e){return e.end})))))-e;var i=n.shift();i.offset=e,i.length=t,i.end=r,this.list=this.list.filter((function(e){return!n.includes(e)}))}else this.list.push({offset:e,length:t,end:r})}},{key:"available",value:function(e,t){var r=e+t;return this.list.some((function(t){return t.offset<=e&&r<=t.end}))}}]),e}();function _t(e,t,r){return e<=t&&t<=r}function Pt(){}function kt(e,t){if(!t)return e&&e.then?e.then(Pt):Promise.resolve()}function Ct(e,t,r){return r?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var Ot=function(e){u(r,e);var t=g(r);function r(){return i(this,r),t.apply(this,arguments)}return s(r,[{key:"readWhole",value:function(){try{var e=this;return e.chunked=!1,Ct(G(e.input),(function(t){e._swapArrayBuffer(t)}))}catch(e){return Promise.reject(e)}}},{key:"readChunked",value:function(){return this.chunked=!0,this.size=this.input.size,m(l(r.prototype),"readChunked",this).call(this)}},{key:"_readChunk",value:function(e,t){try{var r=this,n=t?e+t:void 0,i=r.input.slice(e,n);return Ct(G(i),(function(t){return r.set(t,e,!0)}))}catch(e){return Promise.reject(e)}}}]),r}(function(e){u(r,wt);var t=g(r);function r(e,n){var o;return i(this,r),a(f(o=t.call(this,0)),"chunksRead",0),o.input=e,o.options=n,o}return s(r,[{key:"readWhole",value:function(){try{var e=this;return e.chunked=!1,kt(e.readChunk(e.nextChunkOffset))}catch(e){return Promise.reject(e)}}},{key:"readChunked",value:function(){try{var e=this;return e.chunked=!0,kt(e.readChunk(0,e.options.firstChunkSize))}catch(e){return Promise.reject(e)}}},{key:"readNextChunk",value:function(e){try{var t=this;if(void 0===e&&(e=t.nextChunkOffset),t.fullyRead)return t.chunksRead++,!1;var r=t.options.chunkSize;return n=t.readChunk(e,r),i=function(e){return!!e&&e.byteLength===r},n&&n.then||(n=Promise.resolve(n)),i?n.then(i):n}catch(e){return Promise.reject(e)}var n,i}},{key:"readChunk",value:function(e,t){try{var r=this;if(r.chunksRead++,0===(t=r.safeWrapAddress(e,t)))return;return r._readChunk(e,t)}catch(e){return Promise.reject(e)}}},{key:"safeWrapAddress",value:function(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}},{key:"nextChunkOffset",get:function(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}},{key:"canReadNextChunk",get:function(){return this.chunksRead4096&&(r=4096,n=Math.round(r/t)),n>4096&&(n=4096,r=Math.round(t*n)),e.width>r){var i=document.createElement("canvas");i.width=r,i.height=n,i.getContext("2d").drawImage(e,0,0,r,n),e=i}return e},i.resizeImage=function(e,t,r){e=this.protect(e);var n=Math.ceil(Jn(e.width/t));n<1&&(n=1);for(var i=t*Math.pow(2,n-1),o=r*Math.pow(2,n-1);n--;){var s=document.createElement("canvas");s.width=i,s.height=o,s.getContext("2d").drawImage(e,0,0,i,o),e=s,i=Math.round(i/2),o=Math.round(o/2)}return e},i.rotateImage=function(e,t){var r=e.width,n=e.height;90!==t.deg&&270!==t.deg||(r=e.height,n=e.width);var i=document.createElement("canvas");i.width=r,i.height=n;var o=i.getContext("2d");return o.translate(r/2,n/2),t.canvas&&(o.rotate(t.rad),o.scale(t.scaleX,t.scaleY)),o.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),i},i.canvasToBlob=function(e,t,r){try{e.getContext("2d").getImageData(0,0,1,1)}catch(th){if(18===th.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise((function(n){e.toBlob(n,t,r)})).then((function(e){if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e})):Promise.resolve().then((function(){return Kn(e.toDataURL(t,r),{})})).then((function(e){if(null===e)throw new Error("could not extract blob, probably an old browser");return e}))},i.setPreviewURL=function(e,t){this.uppy.setFileState(e,{preview:t})},i.addToQueue=function(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()},i.processQueue=function(){var e=this;if(this.queueProcessing=!0,this.queue.length>0){var t=this.uppy.getFile(this.queue.shift());return t?this.requestThumbnail(t).catch((function(e){})).then((function(){return e.processQueue()})):void this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error")}this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated")},i.requestThumbnail=function(e){var t=this;return Dt(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then((function(r){t.setPreviewURL(e.id,r),t.uppy.log("[ThumbnailGenerator] Generated thumbnail for "+e.id),t.uppy.emit("thumbnail:generated",t.uppy.getFile(e.id),r)})).catch((function(r){t.uppy.log("[ThumbnailGenerator] Failed thumbnail for "+e.id+":","warning"),t.uppy.log(r,"warning"),t.uppy.emit("thumbnail:error",t.uppy.getFile(e.id),r)})):Promise.resolve()},i.install=function(){this.uppy.on("file-removed",this.onFileRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)},i.uninstall=function(){this.uppy.off("file-removed",this.onFileRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)},n}(le.Plugin),ai.VERSION="1.7.10",ui),fi=function(e){if("string"==typeof e){var t=[].slice.call(document.querySelectorAll(e));return t.length>0?t:null}if("object"==typeof e&&se(e))return[e]},gi=function(e){return Array.prototype.slice.call(e||[],0)},mi=function(e,t){var r=[],n=[];return gi(e.items).forEach((function(e){var i=e.webkitGetAsEntry();i&&n.push(function e(n){return new Promise((function(i){if(n.isFile)n.file((function(e){var t;e.relativePath=(t=n).fullPath&&t.fullPath!=="/"+t.name?t.fullPath:null,r.push(e),i()}),(function(e){t(e),i()}));else if(n.isDirectory){!function e(t,r,n,i){var o=i.onSuccess;t.readEntries((function(i){var s=[].concat(r,i);i.length?setTimeout((function(){e(t,s,n,{onSuccess:o})}),0):o(s)}),(function(e){n(e),o(r)}))}(n.createReader(),[],t,{onSuccess:function(t){var r=t.map((function(t){return e(t)}));Promise.all(r).then((function(){return i()}))}})}}))}(i))})),Promise.all(n).then((function(){return r}))},vi=function(e,t){var r=(void 0===t?{}:t).logDropError,n=void 0===r?function(){}:r;return e.items&&e.items[0]&&"webkitGetAsEntry"in e.items[0]?mi(e,n):function(e){var t=gi(e.files);return Promise.resolve(t)}(e)},yi=function(e,t){if(t){var r=e.querySelector('[data-uppy-paneltype="'+t+'"]');if(r)return r}return e},bi=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function wi(e,t){var r=t[0];r&&(r.focus(),e.preventDefault())}function Si(e,t,r){var n=yi(r,t),i=gi(n.querySelectorAll(bi)),o=i.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(n)?wi(e,i):e.shiftKey&&0===o?function(e,t){var r=t[t.length-1];r&&(r.focus(),e.preventDefault())}(e,i):e.shiftKey||o!==i.length-1||wi(e,i)}var _i=function(e,t,r){Si(e,t,r)},Pi=function(e,t,r){null===t||Si(e,t,r)},ki={exports:{}};(function(e){(function(){!function(e,t){"object"==typeof ki.exports?ki.exports=t():e.ResizeObserver=t()}(this,(function(){"use strict";var t=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var r=-1;return e.some((function(e,n){return e[0]===t&&(r=n,!0)})),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=e(this.__entries__,t),n=this.__entries__[r];return n&&n[1]},t.prototype.set=function(t,r){var n=e(this.__entries__,t);~n?this.__entries__[n][1]=r:this.__entries__.push([t,r])},t.prototype.delete=function(t){var r=this.__entries__,n=e(r,t);~n&&r.splice(n,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var r=0,n=this.__entries__;r0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,r=void 0===t?"":t;o.some((function(e){return!!~r.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),u=function(e,t){for(var r=0,n=Object.keys(t);r0},e}(),b="undefined"!=typeof WeakMap?new WeakMap:new t,w=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=a.getInstance(),n=new y(t,r,this);b.set(this,n)};return["observe","unobserve","disconnect"].forEach((function(e){w.prototype[e]=function(){var t;return(t=b.get(this))[e].apply(t,arguments)}})),void 0!==n.ResizeObserver?n.ResizeObserver:w}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),ki=ki.exports;var Ci={};(function(e){(function(){var t=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,i=/^0o[0-7]+$/i,o=parseInt,s="object"==typeof e&&e&&e.Object===Object&&e,a="object"==typeof self&&self&&self.Object===Object&&self,u=s||a||Function("return this")(),l=Object.prototype.toString,c=Math.max,p=Math.min,h=function(){return u.Date.now()};function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(d(e)){var s="function"==typeof e.valueOf?e.valueOf():e;e=d(s)?s+"":s}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var a=n.test(e);return a||i.test(e)?o(e.slice(2),a?2:8):r.test(e)?NaN:+e}Ci=function(e,t,r){var n,i,o,s,a,u,l=0,g=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var r=n,o=i;return n=i=void 0,l=t,s=e.apply(o,r)}function b(e){var r=e-u;return void 0===u||r>=t||r<0||m&&e-l>=o}function w(){var e=h();if(b(e))return S(e);a=setTimeout(w,function(e){var r=t-(e-u);return m?p(r,o-(e-l)):r}(e))}function S(e){return a=void 0,v&&n?y(e):(n=i=void 0,s)}function _(){var e=h(),r=b(e);if(n=arguments,i=this,u=e,r){if(void 0===a)return function(e){return l=e,a=setTimeout(w,t),g?y(e):s}(u);if(m)return a=setTimeout(w,t),y(u)}return void 0===a&&(a=setTimeout(w,t)),s}return t=f(t)||0,d(r)&&(g=!!r.leading,o=(m="maxWait"in r)?c(f(r.maxWait)||0,t):o,v="trailing"in r?!!r.trailing:v),_.cancel=function(){void 0!==a&&clearTimeout(a),l=0,n=u=i=a=void 0},_.flush=function(){return void 0===a?s:S(h())},_}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});function Oi(e,t){if(e.length!==t.length)return!1;for(var r=0;r0&&(n.uppy.log("[Dashboard] Files were dropped"),n.addFiles(e))}))}},n.handleRequestThumbnail=function(e){n.opts.waitForThumbnailsBeforeUpload||n.uppy.emit("thumbnail:request",e)},n.handleCancelThumbnail=function(e){n.opts.waitForThumbnailsBeforeUpload||n.uppy.emit("thumbnail:cancel",e)},n.handleKeyDownInInline=function(e){9===e.keyCode&&Pi(e,n.getPluginState().activeOverlayType,n.el)},n.handlePasteOnBody=function(e){n.el.contains(document.activeElement)&&n.handlePaste(e)},n.handleComplete=function(e){var t=e.failed;n.opts.closeAfterFinish&&0===t.length&&n.requestCloseModal()},n.handleCancelRestore=function(){n.uppy.emit("restore-canceled")},n._openFileEditorWhenFilesAdded=function(e){var t=e[0];n.canEditFile(t)&&n.openFileEditor(t)},n.initEvents=function(){if(n.opts.trigger&&!n.opts.inline){var e=fi(n.opts.trigger);e?e.forEach((function(e){return e.addEventListener("click",n.openModal)})):n.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}n.startListeningToResize(),document.addEventListener("paste",n.handlePasteOnBody),n.uppy.on("plugin-remove",n.removeTarget),n.uppy.on("file-added",n.hideAllPanels),n.uppy.on("dashboard:modal-closed",n.hideAllPanels),n.uppy.on("file-editor:complete",n.hideAllPanels),n.uppy.on("complete",n.handleComplete),document.addEventListener("focus",n.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",n.recordIfFocusedOnUppyRecently,!0),n.opts.inline&&n.el.addEventListener("keydown",n.handleKeyDownInInline),n.opts.autoOpenFileEditor&&n.uppy.on("files-added",n._openFileEditorWhenFilesAdded)},n.removeEvents=function(){var e=fi(n.opts.trigger);!n.opts.inline&&e&&e.forEach((function(e){return e.removeEventListener("click",n.openModal)})),n.stopListeningToResize(),document.removeEventListener("paste",n.handlePasteOnBody),window.removeEventListener("popstate",n.handlePopState,!1),n.uppy.off("plugin-remove",n.removeTarget),n.uppy.off("file-added",n.hideAllPanels),n.uppy.off("dashboard:modal-closed",n.hideAllPanels),n.uppy.off("file-editor:complete",n.hideAllPanels),n.uppy.off("complete",n.handleComplete),document.removeEventListener("focus",n.recordIfFocusedOnUppyRecently),document.removeEventListener("click",n.recordIfFocusedOnUppyRecently),n.opts.inline&&n.el.removeEventListener("keydown",n.handleKeyDownInInline),n.opts.autoOpenFileEditor&&n.uppy.off("files-added",n._openFileEditorWhenFilesAdded)},n.superFocusOnEachUpdate=function(){var e=n.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,r=n.uppy.getState().info.isHidden,i=!n.opts.inline;r&&(i||e||t&&n.ifFocusedOnUppyRecently)?n.superFocus(n.el,n.getPluginState().activeOverlayType):n.superFocus.cancel()},n.afterUpdate=function(){!n.opts.disabled||n.dashboardIsDisabled?(!n.opts.disabled&&n.dashboardIsDisabled&&n.disableAllFocusableElements(!1),n.superFocusOnEachUpdate()):n.disableAllFocusableElements(!0)},n.cancelUpload=function(e){n.uppy.removeFile(e)},n.saveFileCard=function(e,t){n.uppy.setFileMeta(t,e),n.toggleFileCard(!1,t)},n._attachRenderFunctionToTarget=function(e){var t=n.uppy.getPlugin(e.id);return Ri({},e,{icon:t.icon||n.opts.defaultPickerIcon,render:t.render})},n._isTargetSupported=function(e){var t=n.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()},n._getAcquirers=Ii((function(e){return e.filter((function(e){return"acquirer"===e.type&&n._isTargetSupported(e)})).map(n._attachRenderFunctionToTarget)})),n._getProgressIndicators=Ii((function(e){return e.filter((function(e){return"progressindicator"===e.type})).map(n._attachRenderFunctionToTarget)})),n._getEditors=Ii((function(e){return e.filter((function(e){return"editor"===e.type})).map(n._attachRenderFunctionToTarget)})),n.render=function(e){var t,r=n.getPluginState(),i=e.files,o=e.capabilities,s=e.allowNewUpload,a=Object.keys(i).filter((function(e){return!i[e].progress.uploadStarted})),u=Object.keys(i).filter((function(e){return i[e].progress.uploadStarted})),l=Object.keys(i).filter((function(e){return i[e].isPaused})),c=Object.keys(i).filter((function(e){return i[e].progress.uploadComplete})),p=Object.keys(i).filter((function(e){return i[e].error})),h=Object.keys(i).filter((function(e){return!i[e].progress.uploadComplete&&i[e].progress.uploadStarted})),d=h.filter((function(e){return!i[e].isPaused})),f=Object.keys(i).filter((function(e){return i[e].progress.preprocess||i[e].progress.postprocess})),g=u.length>0,m=100===e.totalProgress&&c.length===Object.keys(i).length&&0===f.length,v=g&&p.length===u.length,y=0!==h.length&&l.length===h.length,b=n._getAcquirers(r.targets),w=n._getProgressIndicators(r.targets),S=n._getEditors(r.targets);return t="auto"===n.opts.theme?o.darkMode?"dark":"light":n.opts.theme,["files","folders","both"].indexOf(n.opts.fileManagerSelectionType)<0&&(n.opts.fileManagerSelectionType="files",console.error('Unsupported option for "fileManagerSelectionType". Using default of "'+n.opts.fileManagerSelectionType+'".')),function(e){var t=0===e.totalFileCount,r=e.containerWidth>576,n=it({"uppy-Root":e.isTargetDOMEl}),i=it({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>576,"uppy-size--lg":e.containerWidth>700,"uppy-size--xl":e.containerWidth>900,"uppy-size--height-md":e.containerHeight>400,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible}),o=1;e.containerWidth>900?o=5:e.containerWidth>700?o=4:e.containerWidth>576&&(o=3);var s=e.showSelectedFiles&&!t,a=e.recoveredState?Object.keys(e.recoveredState.files).length:null,u=e.files?Object.keys(e.files).filter((function(t){return e.files[t].isGhost})).length:null,l=hn("div",{className:i,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&cn(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop},hn("div",{className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),hn("div",{className:"uppy-Dashboard-inner","aria-modal":!e.inline&&"true",role:!e.inline&&"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""}},e.inline?null:hn("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal},hn("span",{"aria-hidden":"true"},"\xd7")),hn("div",{className:"uppy-Dashboard-innerWrap"},hn("div",{className:"uppy-Dashboard-dropFilesHereHint"},e.i18n("dropHint")),s&&hn(Zr,e),a&&hn("div",{className:"uppy-Dashboard-serviceMsg"},hn("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},hn("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},hn("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),hn("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),hn("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),hn("strong",{className:"uppy-Dashboard-serviceMsg-title"},e.i18n("sessionRestored")),hn("div",{class:"uppy-Dashboard-serviceMsg-text"},u>0?e.i18n("recoveredXFiles",{smart_count:u}):e.i18n("recoveredAllFiles"))),s?hn(Tr,pn({},e,{itemsPerRow:o})):hn(Ir,pn({},e,{isSizeMD:r})),hn(ln,null,e.showAddFilesPanel?hn(Mr,pn({key:"AddFiles"},e,{isSizeMD:r})):null),hn(ln,null,e.fileCardFor?hn(nn,pn({key:"FileCard"},e)):null),hn(ln,null,e.activePickerPanel?hn(zr,pn({key:"Picker"},e)):null),hn(ln,null,e.showFileEditor?hn(qr,pn({key:"Editor"},e)):null),hn("div",{className:"uppy-Dashboard-progressindicators"},e.progressindicators.map((function(t){return e.getPlugin(t.id).render(e.state)}))))));return hn("div",{className:n,dir:e.direction},l)}({state:e,isHidden:r.isHidden,files:i,newFiles:a,uploadStartedFiles:u,completeFiles:c,erroredFiles:p,inProgressFiles:h,inProgressNotPausedFiles:d,processingFiles:f,isUploadStarted:g,isAllComplete:m,isAllErrored:v,isAllPaused:y,totalFileCount:Object.keys(i).length,totalProgress:e.totalProgress,allowNewUpload:s,acquirers:b,theme:t,disabled:n.opts.disabled,disableLocalFiles:n.opts.disableLocalFiles,direction:n.opts.direction,activePickerPanel:r.activePickerPanel,showFileEditor:r.showFileEditor,disableAllFocusableElements:n.disableAllFocusableElements,animateOpenClose:n.opts.animateOpenClose,isClosing:r.isClosing,getPlugin:n.uppy.getPlugin,progressindicators:w,editors:S,autoProceed:n.uppy.opts.autoProceed,id:n.id,closeModal:n.requestCloseModal,handleClickOutside:n.handleClickOutside,handleInputChange:n.handleInputChange,handlePaste:n.handlePaste,inline:n.opts.inline,showPanel:n.showPanel,hideAllPanels:n.hideAllPanels,log:n.uppy.log,i18n:n.i18n,i18nArray:n.i18nArray,removeFile:n.uppy.removeFile,uppy:n.uppy,info:n.uppy.info,note:n.opts.note,recoveredState:e.recoveredState,metaFields:r.metaFields,resumableUploads:o.resumableUploads||!1,individualCancellation:o.individualCancellation,isMobileDevice:o.isMobileDevice,pauseUpload:n.uppy.pauseResume,retryUpload:n.uppy.retryUpload,cancelUpload:n.cancelUpload,cancelAll:n.uppy.cancelAll,fileCardFor:r.fileCardFor,toggleFileCard:n.toggleFileCard,toggleAddFilesPanel:n.toggleAddFilesPanel,showAddFilesPanel:r.showAddFilesPanel,saveFileCard:n.saveFileCard,openFileEditor:n.openFileEditor,canEditFile:n.canEditFile,width:n.opts.width,height:n.opts.height,showLinkToFileUploadResult:n.opts.showLinkToFileUploadResult,fileManagerSelectionType:n.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:n.opts.proudlyDisplayPoweredByUppy,hideCancelButton:n.opts.hideCancelButton,hideRetryButton:n.opts.hideRetryButton,hidePauseResumeButton:n.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:n.opts.showRemoveButtonAfterComplete,containerWidth:r.containerWidth,containerHeight:r.containerHeight,areInsidesReadyToBeVisible:r.areInsidesReadyToBeVisible,isTargetDOMEl:n.isTargetDOMEl,parentElement:n.el,allowedFileTypes:n.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:n.uppy.opts.restrictions.maxNumberOfFiles,showSelectedFiles:n.opts.showSelectedFiles,handleCancelRestore:n.handleCancelRestore,handleRequestThumbnail:n.handleRequestThumbnail,handleCancelThumbnail:n.handleCancelThumbnail,isDraggingOver:r.isDraggingOver,handleDragOver:n.handleDragOver,handleDragLeave:n.handleDragLeave,handleDrop:n.handleDrop})},n.discoverProviderPlugins=function(){n.uppy.iteratePlugins((function(e){e&&!e.target&&e.opts&&e.opts.target===n.constructor&&n.addTarget(e)}))},n.install=function(){n.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:!1,showFileEditor:!1,metaFields:n.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});var e=n.opts,t=e.inline,r=e.closeAfterFinish;if(t&&r)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");n.uppy.opts.allowMultipleUploads&&r&&n.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploads` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");var i=n.opts.target;i&&n.mount(i,xi(n)),(n.opts.plugins||[]).forEach((function(e){var t=n.uppy.getPlugin(e);t&&t.mount(xi(n),t)})),n.opts.disableStatusBar||n.uppy.use(qn,{id:n.id+":StatusBar",target:xi(n),hideUploadButton:n.opts.hideUploadButton,hideRetryButton:n.opts.hideRetryButton,hidePauseResumeButton:n.opts.hidePauseResumeButton,hideCancelButton:n.opts.hideCancelButton,showProgressDetails:n.opts.showProgressDetails,hideAfterFinish:n.opts.hideProgressAfterFinish,locale:n.opts.locale,doneButtonHandler:n.opts.doneButtonHandler}),n.opts.disableInformer||n.uppy.use(Gn,{id:n.id+":Informer",target:xi(n)}),n.opts.disableThumbnailGenerator||n.uppy.use(di,{id:n.id+":ThumbnailGenerator",thumbnailWidth:n.opts.thumbnailWidth,thumbnailType:n.opts.thumbnailType,waitForThumbnailsBeforeUpload:n.opts.waitForThumbnailsBeforeUpload,lazy:!n.opts.waitForThumbnailsBeforeUpload}),n.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;var o=!!n.darkModeMediaQuery&&n.darkModeMediaQuery.matches;n.uppy.log("[Dashboard] Dark mode is "+(o?"on":"off")),n.setDarkModeCapability(o),"auto"===n.opts.theme&&n.darkModeMediaQuery.addListener(n.handleSystemDarkModeChange),n.discoverProviderPlugins(),n.initEvents()},n.uninstall=function(){if(!n.opts.disableInformer){var e=n.uppy.getPlugin(n.id+":Informer");e&&n.uppy.removePlugin(e)}if(!n.opts.disableStatusBar){var t=n.uppy.getPlugin(n.id+":StatusBar");t&&n.uppy.removePlugin(t)}if(!n.opts.disableThumbnailGenerator){var r=n.uppy.getPlugin(n.id+":ThumbnailGenerator");r&&n.uppy.removePlugin(r)}(n.opts.plugins||[]).forEach((function(e){var t=n.uppy.getPlugin(e);t&&t.unmount()})),"auto"===n.opts.theme&&n.darkModeMediaQuery.removeListener(n.handleSystemDarkModeChange),n.unmount(),n.removeEvents()},n.id=n.opts.id||"Dashboard",n.title="Dashboard",n.type="orchestrator",n.modalName="uppy-Dashboard-"+B(),n.defaultLocale={strings:{closeModal:"Close Modal",importFrom:"Import from %{name}",addingMoreFiles:"Adding more files",addMoreFiles:"Add more files",dashboardWindowTitle:"File Uploader Window (Press escape to close)",dashboardTitle:"File Uploader",copyLinkToClipboardSuccess:"Link copied to clipboard",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",fileSource:"File source: %{name}",done:"Done",back:"Back",addMore:"Add more",removeFile:"Remove file",editFile:"Edit file",editing:"Editing %{file}",finishEditingFile:"Finish editing file",saveChanges:"Save changes",cancel:"Cancel",myDevice:"My Device",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",dropHint:"Drop your files here",browseFiles:"browse files",browseFolders:"browse folders",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",poweredBy2:"%{backwardsCompat} %{uppy}",poweredBy:"Powered by"}};var i,o={target:"body",metaFields:[],trigger:"#uppy-select-files",inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Mi,showLinkToFileUploadResult:!0,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,doneButtonHandler:function(){n.uppy.reset(),n.requestCloseModal()},note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,onRequestCloseModal:function(){return n.closeModal()},showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,theme:"light",autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1};return n.opts=Ri({},o,r),n.i18nInit(),n.superFocus=(i=!1,Ci((function(e,t){var r=yi(e,t),n=r.contains(document.activeElement);if(!n||!i){var o=r.querySelector("[data-uppy-super-focusable]");if(!n||o)if(o)o.focus({preventScroll:!0}),i=!0;else{var s=r.querySelector(bi);s&&s.focus({preventScroll:!0}),i=!1}}}),260)),n.ifFocusedOnUppyRecently=!1,n.makeDashboardInsidesVisibleAnywayTimeout=null,n.removeDragOverClassTimeout=null,n}return r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ui(t,r),n.prototype.onMount=function(){var e=this.el;Nn(e)||(e.dir="ltr")},n}(Di),Ei.VERSION="1.20.1",Ai);function Hi(){return(Hi=Object.assign||function(e){for(var t=1;t0)throw new Error('"'+e+'" does not match any HTML elements');n.nodes.forEach((function(e){e.addEventListener("dragover",n.handleDragOver,!1),e.addEventListener("dragleave",n.handleDragLeave,!1),e.addEventListener("drop",n.handleDrop,!1)}))},n.removeListeners=function(){n.nodes&&n.nodes.forEach((function(e){e.removeEventListener("dragover",n.handleDragOver,!1),e.removeEventListener("dragleave",n.handleDragLeave,!1),e.removeEventListener("drop",n.handleDrop,!1)}))},n.type="acquirer",n.id=n.opts.id||"DropTarget",n.title="Drop Target",n.opts=$i({},{target:null},r),n.removeDragOverClassTimeout=null,n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Ji(t,r);var i=n.prototype;return i.install=function(){this.setPluginState({isDraggingOver:!1}),this.addListeners()},i.uninstall=function(){this.removeListeners()},n}(le.Plugin),Wi.VERSION="0.2.3",Xi);function to(){return(to=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&e<1/0};function x(e){return void 0===e}function U(t){return"object"===e(t)&&null!==t}var T=Object.prototype.hasOwnProperty;function D(e){if(!U(e))return!1;try{var t=e.constructor,r=t.prototype;return t&&r&&T.call(r,"isPrototypeOf")}catch(gp){return!1}}function B(e){return"function"==typeof e}var I=Array.prototype.slice;function N(e){return Array.from?Array.from(e):I.call(e)}function M(e,t){return e&&B(t)&&(Array.isArray(e)||F(e.length)?N(e).forEach((function(r,n){t.call(e,r,n,e)})):U(e)&&Object.keys(e).forEach((function(r){t.call(e,e[r],r,e)}))),e}var j=Object.assign||function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0&&r.forEach((function(t){U(t)&&Object.keys(t).forEach((function(r){e[r]=t[r]}))})),e},L=/\.\d*(?:0|9){12}\d*$/;function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return L.test(e)?Math.round(e*t)/t:e}var H=/^width|height|left|top|marginLeft|marginTop$/;function q(e,t){var r=e.style;M(t,(function(e,t){H.test(t)&&F(e)&&(e="".concat(e,"px")),r[t]=e}))}function V(e,t){if(t)if(F(e.length))M(e,(function(e){V(e,t)}));else if(e.classList)e.classList.add(t);else{var r=e.className.trim();r?r.indexOf(t)<0&&(e.className="".concat(r," ").concat(t)):e.className=t}}function W(e,t){t&&(F(e.length)?M(e,(function(e){W(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function X(e,t,r){t&&(F(e.length)?M(e,(function(e){X(e,t,r)})):r?V(e,t):W(e,t))}var Y=/([a-z\d])([A-Z])/g;function G(e){return e.replace(Y,"$1-$2").toLowerCase()}function K(e,t){return U(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(G(t)))}function $(e,t,r){U(r)?e[t]=r:e.dataset?e.dataset[t]=r:e.setAttribute("data-".concat(G(t)),r)}var J=/\s\s*/,Q=function(){var e=!1;if(a){var t=!1,r=function(){},n=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});u.addEventListener("test",r,n),u.removeEventListener("test",r,n)}return e}();function Z(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r;t.trim().split(J).forEach((function(t){if(!Q){var o=e.listeners;o&&o[t]&&o[t][r]&&(i=o[t][r],delete o[t][r],0===Object.keys(o[t]).length&&delete o[t],0===Object.keys(o).length&&delete e.listeners)}e.removeEventListener(t,i,n)}))}function ee(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r;t.trim().split(J).forEach((function(t){if(n.once&&!Q){var o=e.listeners,s=void 0===o?{}:o;i=function(){delete s[t][r],e.removeEventListener(t,i,n);for(var o=arguments.length,a=new Array(o),u=0;u1&&void 0!==arguments[1]?arguments[1]:"contain",o=R(n),s=R(r);if(o&&s){var a=r*t;"contain"===i&&a>n||"cover"===i&&ae.width?3===r?a=e.height*s:u=e.width/s:3===r?u=e.width/s:a=e.height*s;var l={aspectRatio:s,naturalWidth:i,naturalHeight:o,width:a,height:u};l.left=(e.width-a)/2,l.top=(e.height-u)/2,l.oldLeft=l.left,l.oldTop=l.top,this.canvasData=l,this.limited=1===r||2===r,this.limitCanvas(!0,!0),this.initialImageData=j({},t),this.initialCanvasData=j({},l)},limitCanvas:function(e,t){var r=this.options,n=this.containerData,i=this.canvasData,o=this.cropBoxData,s=r.viewMode,a=i.aspectRatio,u=this.cropped&&o;if(e){var l=Number(r.minCanvasWidth)||0,c=Number(r.minCanvasHeight)||0;s>1?(l=Math.max(l,n.width),c=Math.max(c,n.height),3===s&&(c*a>l?l=c*a:c=l/a)):s>0&&(l?l=Math.max(l,u?o.width:0):c?c=Math.max(c,u?o.height:0):u&&(l=o.width,(c=o.height)*a>l?l=c*a:c=l/a));var p=le({aspectRatio:a,width:l,height:c});l=p.width,c=p.height,i.minWidth=l,i.minHeight=c,i.maxWidth=1/0,i.maxHeight=1/0}if(t)if(s>(u?0:1)){var h=n.width-i.width,d=n.height-i.height;i.minLeft=Math.min(0,h),i.minTop=Math.min(0,d),i.maxLeft=Math.max(0,h),i.maxTop=Math.max(0,d),u&&this.limited&&(i.minLeft=Math.min(o.left,o.left+(o.width-i.width)),i.minTop=Math.min(o.top,o.top+(o.height-i.height)),i.maxLeft=o.left,i.maxTop=o.top,2===s&&(i.width>=n.width&&(i.minLeft=Math.min(0,h),i.maxLeft=Math.max(0,h)),i.height>=n.height&&(i.minTop=Math.min(0,d),i.maxTop=Math.max(0,d))))}else i.minLeft=-i.width,i.minTop=-i.height,i.maxLeft=n.width,i.maxTop=n.height},renderCanvas:function(e,t){var r=this.canvasData,n=this.imageData;if(t){var i=function(e){var t=e.width,r=e.height,n=e.degree;if(90==(n=Math.abs(n)%180))return{width:r,height:t};var i=n%90*Math.PI/180,o=Math.sin(i),s=Math.cos(i),a=t*s+r*o,u=t*o+r*s;return n>90?{width:u,height:a}:{width:a,height:u}}({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),o=i.width,s=i.height,a=r.width*(o/r.naturalWidth),u=r.height*(s/r.naturalHeight);r.left-=(a-r.width)/2,r.top-=(u-r.height)/2,r.width=a,r.height=u,r.aspectRatio=o/s,r.naturalWidth=o,r.naturalHeight=s,this.limitCanvas(!0,!1)}(r.width>r.maxWidth||r.widthr.maxHeight||r.heightt.width?i.height=i.width/r:i.width=i.height*r),this.cropBoxData=i,this.limitCropBox(!0,!0),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),i.width=Math.max(i.minWidth,i.width*n),i.height=Math.max(i.minHeight,i.height*n),i.left=t.left+(t.width-i.width)/2,i.top=t.top+(t.height-i.height)/2,i.oldLeft=i.left,i.oldTop=i.top,this.initialCropBoxData=j({},i)},limitCropBox:function(e,t){var r=this.options,n=this.containerData,i=this.canvasData,o=this.cropBoxData,s=this.limited,a=r.aspectRatio;if(e){var u=Number(r.minCropBoxWidth)||0,l=Number(r.minCropBoxHeight)||0,c=s?Math.min(n.width,i.width,i.width+i.left,n.width-i.left):n.width,p=s?Math.min(n.height,i.height,i.height+i.top,n.height-i.top):n.height;u=Math.min(u,n.width),l=Math.min(l,n.height),a&&(u&&l?l*a>u?l=u/a:u=l*a:u?l=u/a:l&&(u=l*a),p*a>c?p=c/a:c=p*a),o.minWidth=Math.min(u,c),o.minHeight=Math.min(l,p),o.maxWidth=c,o.maxHeight=p}t&&(s?(o.minLeft=Math.max(0,i.left),o.minTop=Math.max(0,i.top),o.maxLeft=Math.min(n.width,i.left+i.width)-o.width,o.maxTop=Math.min(n.height,i.top+i.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=n.width-o.width,o.maxTop=n.height-o.height))},renderCropBox:function(){var e=this.options,t=this.containerData,r=this.cropBoxData;(r.width>r.maxWidth||r.widthr.maxHeight||r.height=t.width&&r.height>=t.height?"move":"all"),q(this.cropBox,j({width:r.width,height:r.height},ae({translateX:r.left,translateY:r.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),te(this.element,"crop",this.getData())}},de={initPreview:function(){var e=this.element,t=this.crossOrigin,r=this.options.preview,n=t?this.crossOriginUrl:this.url,i=e.alt||"The image to preview",o=document.createElement("img");if(t&&(o.crossOrigin=t),o.src=n,o.alt=i,this.viewBox.appendChild(o),this.viewBoxImage=o,r){var s=r;"string"==typeof r?s=e.ownerDocument.querySelectorAll(r):r.querySelector&&(s=[r]),this.previews=s,M(s,(function(e){var r=document.createElement("img");$(e,b,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(r.crossOrigin=t),r.src=n,r.alt=i,r.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(r)}))}},resetPreview:function(){M(this.previews,(function(e){var t=K(e,b);q(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(U(e[t]))try{delete e[t]}catch(gp){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(gp){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(G(t)))}(e,b)}))},preview:function(){var e=this.imageData,t=this.canvasData,r=this.cropBoxData,n=r.width,i=r.height,o=e.width,s=e.height,a=r.left-t.left-e.left,u=r.top-t.top-e.top;this.cropped&&!this.disabled&&(q(this.viewBoxImage,j({width:o,height:s},ae(j({translateX:-a,translateY:-u},e)))),M(this.previews,(function(t){var r=K(t,b),l=r.width,c=r.height,p=l,h=c,d=1;n&&(h=i*(d=l/n)),i&&h>c&&(p=n*(d=c/i),h=c),q(t,{width:p,height:h}),q(t.getElementsByTagName("img")[0],j({width:o*d,height:s*d},ae(j({translateX:-a*d,translateY:-u*d},e))))})))}},fe={bind:function(){var e=this.element,t=this.options,r=this.cropper;B(t.cropstart)&&ee(e,"cropstart",t.cropstart),B(t.cropmove)&&ee(e,"cropmove",t.cropmove),B(t.cropend)&&ee(e,"cropend",t.cropend),B(t.crop)&&ee(e,"crop",t.crop),B(t.zoom)&&ee(e,"zoom",t.zoom),ee(r,w,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&ee(r,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&ee(r,"dblclick",this.onDblclick=this.dblclick.bind(this)),ee(e.ownerDocument,S,this.onCropMove=this.cropMove.bind(this)),ee(e.ownerDocument,_,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&ee(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,r=this.cropper;B(t.cropstart)&&Z(e,"cropstart",t.cropstart),B(t.cropmove)&&Z(e,"cropmove",t.cropmove),B(t.cropend)&&Z(e,"cropend",t.cropend),B(t.crop)&&Z(e,"crop",t.crop),B(t.zoom)&&Z(e,"zoom",t.zoom),Z(r,w,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Z(r,"wheel",this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Z(r,"dblclick",this.onDblclick),Z(e.ownerDocument,S,this.onCropMove),Z(e.ownerDocument,_,this.onCropEnd),t.responsive&&Z(window,"resize",this.onResize)}},ge={resize:function(){if(!this.disabled){var e,t,r=this.options,n=this.container,i=this.containerData,o=n.offsetWidth/i.width;1===o&&n.offsetHeight===i.height||(r.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),r.restore&&(this.setCanvasData(M(e,(function(t,r){e[r]=t*o}))),this.setCropBoxData(M(t,(function(e,r){t[r]=e*o})))))}},dblclick:function(){var e,t;this.disabled||"none"===this.options.dragMode||this.setDragMode((e=this.dragBox,t=p,(e.classList?e.classList.contains(t):e.className.indexOf(t)>-1)?"move":"crop"))},wheel:function(e){var t=this,r=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1}),50),e.deltaY?n=e.deltaY>0?1:-1:e.wheelDelta?n=-e.wheelDelta/120:e.detail&&(n=e.detail>0?1:-1),this.zoom(-n*r,e)))},cropStart:function(e){var t=e.buttons,r=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(F(t)&&1!==t||F(r)&&0!==r||e.ctrlKey))){var n,i=this.options,o=this.pointers;e.changedTouches?M(e.changedTouches,(function(e){o[e.identifier]=ue(e)})):o[e.pointerId||0]=ue(e),n=Object.keys(o).length>1&&i.zoomable&&i.zoomOnTouch?"zoom":K(e.target,y),P.test(n)&&!1!==te(this.element,"cropstart",{originalEvent:e,action:n})&&(e.preventDefault(),this.action=n,this.cropping=!1,"crop"===n&&(this.cropping=!0,V(this.dragBox,m)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var r=this.pointers;e.preventDefault(),!1!==te(this.element,"cropmove",{originalEvent:e,action:t})&&(e.changedTouches?M(e.changedTouches,(function(e){j(r[e.identifier]||{},ue(e,!0))})):j(r[e.pointerId||0]||{},ue(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,r=this.pointers;e.changedTouches?M(e.changedTouches,(function(e){delete r[e.identifier]})):delete r[e.pointerId||0],t&&(e.preventDefault(),Object.keys(r).length||(this.action=""),this.cropping&&(this.cropping=!1,X(this.dragBox,m,this.cropped&&this.options.modal)),te(this.element,"cropend",{originalEvent:e,action:t}))}}},me={change:function(e){var t,r=this.options,n=this.canvasData,o=this.containerData,s=this.cropBoxData,a=this.pointers,u=this.action,l=r.aspectRatio,c=s.left,p=s.top,h=s.width,f=s.height,g=c+h,m=p+f,v=0,y=0,b=o.width,w=o.height,S=!0;!l&&e.shiftKey&&(l=h&&f?h/f:1),this.limited&&(v=s.minLeft,y=s.minTop,b=v+Math.min(o.width,n.width,n.left+n.width),w=y+Math.min(o.height,n.height,n.top+n.height));var _=a[Object.keys(a)[0]],P={x:_.endX-_.startX,y:_.endY-_.startY},k=function(e){switch(e){case"e":g+P.x>b&&(P.x=b-g);break;case"w":c+P.xw&&(P.y=w-m)}};switch(u){case"all":c+=P.x,p+=P.y;break;case"e":if(P.x>=0&&(g>=b||l&&(p<=y||m>=w))){S=!1;break}k("e"),(h+=P.x)<0&&(u="w",c-=h=-h),l&&(f=h/l,p+=(s.height-f)/2);break;case"n":if(P.y<=0&&(p<=y||l&&(c<=v||g>=b))){S=!1;break}k("n"),f-=P.y,p+=P.y,f<0&&(u="s",p-=f=-f),l&&(h=f*l,c+=(s.width-h)/2);break;case"w":if(P.x<=0&&(c<=v||l&&(p<=y||m>=w))){S=!1;break}k("w"),h-=P.x,c+=P.x,h<0&&(u="e",c-=h=-h),l&&(f=h/l,p+=(s.height-f)/2);break;case"s":if(P.y>=0&&(m>=w||l&&(c<=v||g>=b))){S=!1;break}k("s"),(f+=P.y)<0&&(u="n",p-=f=-f),l&&(h=f*l,c+=(s.width-h)/2);break;case"ne":if(l){if(P.y<=0&&(p<=y||g>=b)){S=!1;break}k("n"),f-=P.y,p+=P.y,h=f*l}else k("n"),k("e"),P.x>=0?gy&&(f-=P.y,p+=P.y):(f-=P.y,p+=P.y);h<0&&f<0?(u="sw",p-=f=-f,c-=h=-h):h<0?(u="nw",c-=h=-h):f<0&&(u="se",p-=f=-f);break;case"nw":if(l){if(P.y<=0&&(p<=y||c<=v)){S=!1;break}k("n"),f-=P.y,p+=P.y,h=f*l,c+=s.width-h}else k("n"),k("w"),P.x<=0?c>v?(h-=P.x,c+=P.x):P.y<=0&&p<=y&&(S=!1):(h-=P.x,c+=P.x),P.y<=0?p>y&&(f-=P.y,p+=P.y):(f-=P.y,p+=P.y);h<0&&f<0?(u="se",p-=f=-f,c-=h=-h):h<0?(u="ne",c-=h=-h):f<0&&(u="sw",p-=f=-f);break;case"sw":if(l){if(P.x<=0&&(c<=v||m>=w)){S=!1;break}k("w"),h-=P.x,c+=P.x,f=h/l}else k("s"),k("w"),P.x<=0?c>v?(h-=P.x,c+=P.x):P.y>=0&&m>=w&&(S=!1):(h-=P.x,c+=P.x),P.y>=0?m=0&&(g>=b||m>=w)){S=!1;break}k("e"),f=(h+=P.x)/l}else k("s"),k("e"),P.x>=0?g=0&&m>=w&&(S=!1):h+=P.x,P.y>=0?m0?u=P.y>0?"se":"ne":P.x<0&&(c-=h,u=P.y>0?"sw":"nw"),P.y<0&&(p-=f),this.cropped||(W(this.cropBox,d),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}S&&(s.width=h,s.height=f,s.left=c,s.top=p,this.action=u,this.renderCropBox()),M(a,(function(e){e.startX=e.endX,e.startY=e.endY}))}},ve={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&V(this.dragBox,m),W(this.cropBox,d),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=j({},this.initialImageData),this.canvasData=j({},this.initialCanvasData),this.cropBoxData=j({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(j(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),W(this.dragBox,m),V(this.cropBox,d)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,M(this.previews,(function(t){t.getElementsByTagName("img")[0].src=e})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,W(this.cropper,h)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,V(this.cropper,h)),this},destroy:function(){var e=this.element;return e.cropper?(e.cropper=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=this.canvasData,n=r.left,i=r.top;return this.moveTo(x(e)?e:n+Number(e),x(t)?t:i+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=this.canvasData,n=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(F(e)&&(r.left=e,n=!0),F(t)&&(r.top=t,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(e,t){var r=this.canvasData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(r.width*e/r.naturalWidth,null,t)},zoomTo:function(e,t,r){var n=this.options,i=this.canvasData,o=i.width,s=i.height,a=i.naturalWidth,u=i.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&n.zoomable){var l=a*e,c=u*e;if(!1===te(this.element,"zoom",{ratio:e,oldRatio:o/a,originalEvent:r}))return this;if(r){var p=this.pointers,h=re(this.cropper),d=p&&Object.keys(p).length?function(e){var t=0,r=0,n=0;return M(e,(function(e){var i=e.startX,o=e.startY;t+=i,r+=o,n+=1})),{pageX:t/=n,pageY:r/=n}}(p):{pageX:r.pageX,pageY:r.pageY};i.left-=(l-o)*((d.pageX-h.left-i.left)/o),i.top-=(c-s)*((d.pageY-h.top-i.top)/s)}else D(t)&&F(t.x)&&F(t.y)?(i.left-=(l-o)*((t.x-i.left)/o),i.top-=(c-s)*((t.y-i.top)/s)):(i.left-=(l-o)/2,i.top-=(c-s)/2);i.width=l,i.height=c,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return F(e=Number(e))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,F(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(F(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=this.imageData,n=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(F(e)&&(r.scaleX=e,n=!0),F(t)&&(r.scaleY=t,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=this.options,n=this.imageData,i=this.canvasData,o=this.cropBoxData;if(this.ready&&this.cropped){e={x:o.left-i.left,y:o.top-i.top,width:o.width,height:o.height};var s=n.width/n.naturalWidth;if(M(e,(function(t,r){e[r]=t/s})),t){var a=Math.round(e.y+e.height),u=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=u-e.x,e.height=a-e.y}}else e={x:0,y:0,width:0,height:0};return r.rotatable&&(e.rotate=n.rotate||0),r.scalable&&(e.scaleX=n.scaleX||1,e.scaleY=n.scaleY||1),e},setData:function(e){var t=this.options,r=this.imageData,n=this.canvasData,i={};if(this.ready&&!this.disabled&&D(e)){var o=!1;t.rotatable&&F(e.rotate)&&e.rotate!==r.rotate&&(r.rotate=e.rotate,o=!0),t.scalable&&(F(e.scaleX)&&e.scaleX!==r.scaleX&&(r.scaleX=e.scaleX,o=!0),F(e.scaleY)&&e.scaleY!==r.scaleY&&(r.scaleY=e.scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var s=r.width/r.naturalWidth;F(e.x)&&(i.left=e.x*s+n.left),F(e.y)&&(i.top=e.y*s+n.top),F(e.width)&&(i.width=e.width*s),F(e.height)&&(i.height=e.height*s),this.setCropBoxData(i)}return this},getContainerData:function(){return this.ready?j({},this.containerData):{}},getImageData:function(){return this.sized?j({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&M(["left","top","width","height","naturalWidth","naturalHeight"],(function(r){t[r]=e[r]})),t},setCanvasData:function(e){var t=this.canvasData,r=t.aspectRatio;return this.ready&&!this.disabled&&D(e)&&(F(e.left)&&(t.left=e.left),F(e.top)&&(t.top=e.top),F(e.width)?(t.width=e.width,t.height=e.width/r):F(e.height)&&(t.height=e.height,t.width=e.height*r),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,r,n=this.cropBoxData,i=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&D(e)&&(F(e.left)&&(n.left=e.left),F(e.top)&&(n.top=e.top),F(e.width)&&e.width!==n.width&&(t=!0,n.width=e.width),F(e.height)&&e.height!==n.height&&(r=!0,n.height=e.height),i&&(t?n.height=n.width/i:r&&(n.width=n.height*i)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,r=function(e,t,r,n){var i=t.aspectRatio,s=t.naturalWidth,a=t.naturalHeight,u=t.rotate,l=void 0===u?0:u,c=t.scaleX,p=void 0===c?1:c,h=t.scaleY,d=void 0===h?1:h,f=r.aspectRatio,g=r.naturalWidth,m=r.naturalHeight,v=n.fillColor,y=void 0===v?"transparent":v,b=n.imageSmoothingEnabled,w=void 0===b||b,S=n.imageSmoothingQuality,_=void 0===S?"low":S,P=n.maxWidth,k=void 0===P?1/0:P,C=n.maxHeight,O=void 0===C?1/0:C,E=n.minWidth,A=void 0===E?0:E,F=n.minHeight,R=void 0===F?0:F,x=document.createElement("canvas"),U=x.getContext("2d"),T=le({aspectRatio:f,width:k,height:O}),D=le({aspectRatio:f,width:A,height:R},"cover"),B=Math.min(T.width,Math.max(D.width,g)),I=Math.min(T.height,Math.max(D.height,m)),N=le({aspectRatio:i,width:k,height:O}),M=le({aspectRatio:i,width:A,height:R},"cover"),j=Math.min(N.width,Math.max(M.width,s)),L=Math.min(N.height,Math.max(M.height,a)),H=[-j/2,-L/2,j,L];return x.width=z(B),x.height=z(I),U.fillStyle=y,U.fillRect(0,0,B,I),U.save(),U.translate(B/2,I/2),U.rotate(l*Math.PI/180),U.scale(p,d),U.imageSmoothingEnabled=w,U.imageSmoothingQuality=_,U.drawImage.apply(U,[e].concat(o(H.map((function(e){return Math.floor(z(e))}))))),U.restore(),x}(this.image,this.imageData,t,e);if(!this.cropped)return r;var n=this.getData(),i=n.x,s=n.y,a=n.width,u=n.height,l=r.width/Math.floor(t.naturalWidth);1!==l&&(i*=l,s*=l,a*=l,u*=l);var c=a/u,p=le({aspectRatio:c,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),h=le({aspectRatio:c,width:e.minWidth||0,height:e.minHeight||0},"cover"),d=le({aspectRatio:c,width:e.width||(1!==l?r.width:a),height:e.height||(1!==l?r.height:u)}),f=d.width,g=d.height;f=Math.min(p.width,Math.max(h.width,f)),g=Math.min(p.height,Math.max(h.height,g));var m=document.createElement("canvas"),v=m.getContext("2d");m.width=z(f),m.height=z(g),v.fillStyle=e.fillColor||"transparent",v.fillRect(0,0,f,g);var y=e.imageSmoothingEnabled,b=void 0===y||y,w=e.imageSmoothingQuality;v.imageSmoothingEnabled=b,w&&(v.imageSmoothingQuality=w);var S,_,P,k,C,O,E=r.width,A=r.height,F=i,R=s;F<=-a||F>E?(F=0,S=0,P=0,C=0):F<=0?(P=-F,F=0,C=S=Math.min(E,a+F)):F<=E&&(P=0,C=S=Math.min(a,E-F)),S<=0||R<=-u||R>A?(R=0,_=0,k=0,O=0):R<=0?(k=-R,R=0,O=_=Math.min(A,u+R)):R<=A&&(k=0,O=_=Math.min(u,A-R));var x=[F,R,S,_];if(C>0&&O>0){var U=f/a;x.push(P*U,k*U,C*U,O*U)}return v.drawImage.apply(v,[r].concat(o(x.map((function(e){return Math.floor(z(e))}))))),m},setAspectRatio:function(e){var t=this.options;return this.disabled||x(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,r=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var i="crop"===e,o=t.movable&&"move"===e;e=i||o?e:"none",t.dragMode=e,$(r,y,e),X(r,p,i),X(r,v,o),t.cropBoxMovable||($(n,y,e),X(n,p,i),X(n,v,o))}return this}},ye=u.Cropper,be=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t||!O.test(t.tagName))throw new Error("The first argument is required and must be an or element.");this.element=t,this.options=j({},E,D(r)&&r),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var r,n,i;return r=e,i=[{key:"noConflict",value:function(){return window.Cropper=ye,e}},{key:"setDefaults",value:function(e){j(E,D(e)&&e)}}],(n=[{key:"init",value:function(){var e,t=this.element,r=t.tagName.toLowerCase();if(!t.cropper){if(t.cropper=this,"img"===r){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===r&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var r=this.element,n=this.options;if(n.rotatable||n.scalable||(n.checkOrientation=!1),n.checkOrientation&&window.ArrayBuffer)if(k.test(e))C.test(e)?this.read((i=e.replace(pe,""),o=atob(i),s=new ArrayBuffer(o.length),M(a=new Uint8Array(s),(function(e,t){a[t]=o.charCodeAt(t)})),s)):this.clone();else{var i,o,s,a,u=new XMLHttpRequest,l=this.clone.bind(this);this.reloading=!0,this.xhr=u,u.onabort=l,u.onerror=l,u.ontimeout=l,u.onprogress=function(){"image/jpeg"!==u.getResponseHeader("content-type")&&u.abort()},u.onload=function(){t.read(u.response)},u.onloadend=function(){t.reloading=!1,t.xhr=null},n.checkCrossOrigin&&oe(e)&&r.crossOrigin&&(e=se(e)),u.open("GET",e),u.responseType="arraybuffer",u.withCredentials="use-credentials"===r.crossOrigin,u.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,r=this.imageData,n=function(e){var t,r=new DataView(e);try{var n,i,o;if(255===r.getUint8(0)&&216===r.getUint8(1))for(var s=r.byteLength,a=2;a+1=8&&(o=u+c)}}}if(o){var p,h,d=r.getUint16(o,n);for(h=0;h1){this.url=function(e,t){for(var r=[],n=new Uint8Array(e);n.length>0;)r.push(ce.apply(null,N(n.subarray(0,8192)))),n=n.subarray(8192);return"data:".concat("image/jpeg",";base64,").concat(btoa(r.join("")))}(e);var a=function(e){var t=0,r=1,n=1;switch(e){case 2:r=-1;break;case 3:t=-180;break;case 4:n=-1;break;case 5:t=90,n=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90}return{rotate:t,scaleX:r,scaleY:n}}(n);i=a.rotate,o=a.scaleX,s=a.scaleY}t.rotatable&&(r.rotate=i),t.scalable&&(r.scaleX=o,r.scaleY=s),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,r=e.crossOrigin,n=t;this.options.checkCrossOrigin&&oe(t)&&(r||(r="anonymous"),n=se(t)),this.crossOrigin=r,this.crossOriginUrl=n;var i=document.createElement("img");r&&(i.crossOrigin=r),i.src=n||t,i.alt=e.alt||"The image to crop",this.image=i,i.onload=this.start.bind(this),i.onerror=this.stop.bind(this),V(i,f),e.parentNode.insertBefore(i,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var r=u.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(u.navigator.userAgent),n=function(t,r){j(e.imageData,{naturalWidth:t,naturalHeight:r,aspectRatio:t/r}),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||r){var i=document.createElement("img"),o=document.body||document.documentElement;this.sizingImage=i,i.onload=function(){n(i.width,i.height),r||o.removeChild(i)},i.src=t.src,r||(i.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",o.appendChild(i))}else n(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,r=this.image,n=e.parentNode,i=document.createElement("div");i.innerHTML='
';var o=i.querySelector(".".concat("cropper","-container")),s=o.querySelector(".".concat("cropper","-canvas")),a=o.querySelector(".".concat("cropper","-drag-box")),u=o.querySelector(".".concat("cropper","-crop-box")),l=u.querySelector(".".concat("cropper","-face"));this.container=n,this.cropper=o,this.canvas=s,this.dragBox=a,this.cropBox=u,this.viewBox=o.querySelector(".".concat("cropper","-view-box")),this.face=l,s.appendChild(r),V(e,d),n.insertBefore(o,e.nextSibling),this.isImg||W(r,f),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,V(u,d),t.guides||V(u.getElementsByClassName("".concat("cropper","-dashed")),d),t.center||V(u.getElementsByClassName("".concat("cropper","-center")),d),t.background&&V(o,"".concat("cropper","-bg")),t.highlight||V(l,g),t.cropBoxMovable&&(V(l,v),$(l,y,"all")),t.cropBoxResizable||(V(u.getElementsByClassName("".concat("cropper","-line")),d),V(u.getElementsByClassName("".concat("cropper","-point")),d)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),B(t.ready)&&ee(e,"ready",t.ready,{once:!0}),te(e,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),W(this.element,d))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&t(r.prototype,n),i&&t(r,i),e}();return j(be.prototype,he,de,fe,ge,me,ve),be},"object"==typeof vo.exports?vo.exports=ho():(po=po||self).Cropper=ho(),vo=vo.exports;var bo,wo,So=oe.h,_o=function(e){var t,r;function n(){for(var t,r=arguments.length,n=new Array(r),i=0;i1,P={playsinline:!0};return n?(P.muted=!1,P.controls=!0,P.src=n,this.videoElement&&(this.videoElement.srcObject=void 0)):(P.muted=!0,P.autoplay=!0,P.srcObject=r),ma("div",{className:"uppy uppy-Webcam-container"},ma("div",{className:"uppy-Webcam-videoContainer"},ma("video",fa({ref:function(t){return e.videoElement=t},className:"uppy-Webcam-video "+(h?"uppy-Webcam-video--mirrored":"")},P))),ma("div",{className:"uppy-Webcam-footer"},ma("div",{className:"uppy-Webcam-videoSourceContainer"},_?function(e){var t=e.currentDeviceId,r=e.videoSources,n=e.onChangeVideoSource;return la("div",{className:"uppy-Webcam-videoSource"},la("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:function(e){n(e.target.value)}},r.map((function(e){return la("option",{key:e.deviceId,value:e.deviceId,selected:e.deviceId===t},e.label)}))))}(this.props):null),ma("div",{className:"uppy-Webcam-buttonContainer"},w&&ma(ia,{onSnapshot:d,i18n:p}),b&&ma(sa,{recording:i,onStartRecording:f,onStopRecording:g,i18n:p}),y&&ma(pa,{onSubmit:c,i18n:p}),y&&ma(da,{onDiscard:m,i18n:p})),S&&ma("div",{className:"uppy-Webcam-recordingLength"},ma(ua,{recordingLengthSeconds:v,i18n:p}))))},n}(oe.Component),Sa=oe.h,_a=function(e){return Sa("div",{className:"uppy-Webcam-permissons"},Sa("div",{className:"uppy-Webcam-permissonsIcon"},e.icon()),Sa("h1",{className:"uppy-Webcam-title"},e.hasCamera?e.i18n("allowAccessTitle"):e.i18n("noCameraTitle")),Sa("p",null,e.hasCamera?e.i18n("allowAccessDescription"):e.i18n("noCameraDescription")))};function Pa(){return(Pa=Object.assign||function(e){for(var t=1;t0&&(e.mimeType=n[0])}return e},i.startRecording=function(){var e=this;this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];var t=!1;this.recorder.addEventListener("dataavailable",(function(r){e.recordingChunks.push(r.data);var n=e.uppy.opts.restrictions;if(e.recordingChunks.length>1&&null!=n.maxFileSize&&!t){var i=e.recordingChunks.reduce((function(e,t){return e+t.size}),0),o=(i-e.recordingChunks[0].size)/(e.recordingChunks.length-1)*3;i>Math.max(0,n.maxFileSize-o)&&(t=!0,e.uppy.info(e.i18n("recordingStoppedMaxSize"),"warning",4e3),e.stopRecording())}})),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval((function(){var t=e.getPluginState().recordingLengthSeconds;e.setPluginState({recordingLengthSeconds:t+1})}),1e3)),this.setPluginState({isRecording:!0})},i.stopRecording=function(){var e=this;return new Promise((function(t){e.recorder.addEventListener("stop",(function(){t()})),e.recorder.stop(),e.opts.showRecordingLength&&(clearInterval(e.recordingLengthTimer),e.setPluginState({recordingLengthSeconds:0}))})).then((function(){return e.setPluginState({isRecording:!1}),e.getVideo()})).then((function(t){try{e.capturedMediaFile=t,e.setPluginState({recordedVideo:URL.createObjectURL(t.data)}),e.opts.mirror=!1}catch(th){th.isRestriction||e.uppy.log(th)}})).then((function(){e.recordingChunks=null,e.recorder=null}),(function(t){throw e.recordingChunks=null,e.recorder=null,t}))},i.discardRecordedVideo=function(){this.setPluginState({recordedVideo:null}),this.opts.mirror=!0,this.capturedMediaFile=null},i.submit=function(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(th){th.isRestriction||this.uppy.log(th,"error")}},i.stop=function(){this.stream&&(this.stream.getAudioTracks().forEach((function(e){e.stop()})),this.stream.getVideoTracks().forEach((function(e){e.stop()}))),this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null})},i.getVideoElement=function(){return this.el.querySelector(".uppy-Webcam-video")},i.oneTwoThreeSmile=function(){var e=this;return new Promise((function(t,r){var n=e.opts.countdown,i=setInterval((function(){if(!e.webcamActive)return clearInterval(i),e.captureInProgress=!1,r(new Error("Webcam is not active"));n>0?(e.uppy.info(n+"...","warning",800),n--):(clearInterval(i),e.uppy.info(e.i18n("smile"),"success",1500),setTimeout((function(){return t()}),1500))}),1e3)}))},i.takeSnapshot=function(){var e=this;this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch((function(t){var r="object"==typeof t?t.message:t;return e.uppy.info(r,"error",5e3),Promise.reject(new Error("onBeforeSnapshot: "+r))})).then((function(){return e.getImage()})).then((function(t){e.captureInProgress=!1;try{e.uppy.addFile(t)}catch(th){th.isRestriction||e.uppy.log(th)}}),(function(t){throw e.captureInProgress=!1,t})))},i.getImage=function(){var e=this,t=this.getVideoElement();if(!t)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));var r=t.videoWidth,n=t.videoHeight,i=document.createElement("canvas");i.width=r,i.height=n,i.getContext("2d").drawImage(t,0,0);var o=this.uppy.opts.restrictions,s=[];this.opts.preferredImageMimeType?s=[this.opts.preferredImageMimeType]:o.allowedFileTypes&&(s=o.allowedFileTypes.map(Ea).filter(Fa));var a=s[0]||"image/jpeg",u=ea(a)||"jpg",l="cam-"+Date.now()+"."+u;return function(e,t,r){return e.toBlob?new Promise((function(n){e.toBlob(n,t,r)})):Promise.resolve().then((function(){return Kn(e.toDataURL(t,r),{})}))}(i,a).then((function(t){return{source:e.id,name:l,data:new Blob([t],{type:a}),type:a}}))},i.getVideo=function(){var e=this.recordingChunks.find((function(e){var t;return(null==(t=e.type)?void 0:t.length)>0})).type,t=ea(e);if(!t)return Promise.reject(new Error('Could not retrieve recording: Unsupported media type "'+e+'"'));var r="webcam-"+Date.now()+"."+t,n=new Blob(this.recordingChunks,{type:e}),i={source:this.id,name:r,data:new Blob([n],{type:e}),type:e};return Promise.resolve(i)},i.focus=function(){var e=this;this.opts.countdown&&setTimeout((function(){e.uppy.info(e.i18n("smile"),"success",1500)}),1e3)},i.changeVideoSource=function(e){this.stop(),this.start({deviceId:e})},i.updateVideoSources=function(){var e=this;this.mediaDevices.enumerateDevices().then((function(t){e.setPluginState({videoSources:t.filter((function(e){return"videoinput"===e.kind}))})}))},i.render=function(){this.webcamActive||this.start();var e=this.getPluginState();return e.cameraReady&&e.hasCamera?Oa(wa,Pa({},e,{onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedVideo:this.discardRecordedVideo,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:"function"==typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"==typeof MediaRecorder.prototype.start,recording:e.isRecording,mirror:this.opts.mirror,src:this.stream})):Oa(_a,{icon:ra,i18n:this.i18n,hasCamera:e.hasCamera})},i.install=function(){var e=this;this.setPluginState({cameraReady:!1,recordingLengthSeconds:0});var t=this.opts.target;t&&this.mount(t,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=function(){if(e.updateVideoSources(),e.stream){var t=!0,r=e.getPluginState(),n=r.videoSources,i=r.currentDeviceId;n.forEach((function(e){i===e.deviceId&&(t=!1)})),t&&(e.stop(),e.start())}})},i.uninstall=function(){this.stream&&this.stop(),this.unmount()},n}(le.Plugin),ya.VERSION="1.8.11",ba),xa=oe.h,Ua=function(){return xa("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},xa("g",{fill:"none",fillRule:"evenodd"},xa("rect",{className:"uppy-ProviderIconBg",fill:"#2C3E50",width:"32",height:"32",rx:"16"}),xa("path",{d:"M24.182 9H7.818C6.81 9 6 9.742 6 10.667v10c0 .916.81 1.666 1.818 1.666h4.546V24h7.272v-1.667h4.546c1 0 1.809-.75 1.809-1.666l.009-10C26 9.742 25.182 9 24.182 9zM24 21H8V11h16v10z",fill:"#FFF",fillRule:"nonzero"}),xa("circle",{fill:"#FFF",cx:"16",cy:"16",r:"2"})))},Ta=oe.h,Da=function(e){var t=e.recording,r=e.onStartRecording,n=e.onStopRecording,i=e.i18n;return t?Ta("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video uppy-ScreenCapture-button--stop-rec",type:"button",title:i("stopCapturing"),"aria-label":i("stopCapturing"),onClick:n,"data-uppy-super-focusable":!0},Ta("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},Ta("rect",{x:"15",y:"15",width:"70",height:"70"}))):Ta("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video",type:"button",title:i("startCapturing"),"aria-label":i("startCapturing"),onClick:r,"data-uppy-super-focusable":!0},Ta("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},Ta("circle",{cx:"50",cy:"50",r:"40"})))},Ba=oe.h,Ia=function(e){var t=e.recording,r=e.recordedVideo,n=e.onSubmit,i=e.i18n;return r&&!t?Ba("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--submit",type:"button",title:i("submitRecordedFile"),"aria-label":i("submitRecordedFile"),onClick:n,"data-uppy-super-focusable":!0},Ba("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},Ba("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"}))):null};function Na(){return(Na=Object.assign||function(e){for(var t=1;t9?":":":0")+e},i.render=function(){var e=Na({},this.props),t=e.recording,r=e.i18n,n=this.fmtMSS(this.state.elapsedTime);return t&&!this.timerRunning&&this.startTimer(),!t&&this.timerRunning&&this.resetTimer(),t?ja("div",{style:this.wrapperStyle},ja("div",{style:this.overlayStyle}),ja("div",{style:this.infoContainerStyle},ja("div",{style:this.infotextStyle},r("recording")),ja("div",{style:this.timeStyle},n))):null},n}(oe.Component),za=oe.h,Ha=function(e){var t=e.streamActive,r=e.i18n;return t?za("div",{title:r("streamActive"),"aria-label":r("streamActive"),className:"uppy-ScreenCapture-icon--stream uppy-ScreenCapture-icon--streamActive"},za("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},za("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),za("path",{d:"M0 0h24v24H0z",fill:"none"}),za("path",{d:"M1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm18-7H5v1.63c3.96 1.28 7.09 4.41 8.37 8.37H19V7zM1 10v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11zm20-7H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}))):za("div",{title:r("streamPassive"),"aria-label":r("streamPassive"),className:"uppy-ScreenCapture-icon--stream"},za("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},za("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),za("path",{d:"M0 0h24v24H0z",fill:"none"}),za("path",{d:"M21 3H3c-1.1 0-2 .9-2 2v3h2V5h18v14h-7v2h7c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM1 18v3h3c0-1.66-1.34-3-3-3zm0-4v2c2.76 0 5 2.24 5 5h2c0-3.87-3.13-7-7-7zm0-4v2c4.97 0 9 4.03 9 9h2c0-6.08-4.93-11-11-11z"})))};function qa(){return(qa=Object.assign||function(e){for(var t=1;t=this.limit)&&0!==this.queuedHandlers.length){var e=this.queuedHandlers.shift(),t=this._call(e.fn);e.abort=t.abort,e.done=t.done}},t._queue=function(e,t){var r=this;void 0===t&&(t={});var n={fn:e,priority:t.priority||0,abort:function(){r._dequeue(n)},done:function(){throw new Error("Cannot mark a queued request as done: this indicates a bug")}},i=ee(this.queuedHandlers,(function(e){return n.priority>e.priority}));return-1===i?this.queuedHandlers.push(n):this.queuedHandlers.splice(i,0,n),n},t._dequeue=function(e){var t=this.queuedHandlers.indexOf(e);-1!==t&&this.queuedHandlers.splice(t,1)},t.run=function(e,t){return this.activeRequests0&&(this._aliveTimer&&clearTimeout(this._aliveTimer),this._aliveTimer=setTimeout(this._onTimedOut,this._timeout))},t.done=function(){this._aliveTimer&&(clearTimeout(this._aliveTimer),this._aliveTimer=null),this._isDone=!0},e}(),su=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)};function au(){return(au=Object.assign||function(e){for(var t=1;t=200&&e<300}},t),this.requests=t.__queue,this.uploaderEvents=Object.create(null),this.i18n=t.i18n}var t=e.prototype;return t._getOptions=function(e){var t=this.uppy.getState().xhrUpload,r=au({},this.opts,t||{},e.xhrUpload||{},{headers:{}});return au(r.headers,this.opts.headers),t&&au(r.headers,t.headers),e.xhrUpload&&au(r.headers,e.xhrUpload.headers),r},t.uploadFile=function(e,t,r){var n=this.uppy.getFile(e);if(n.error)throw new Error(n.error);return n.isRemote?this._uploadRemoteFile(n,t,r):this._uploadLocalFile(n,t,r)},t._addMetadata=function(e,t,r){(Array.isArray(r.metaFields)?r.metaFields:Object.keys(t)).forEach((function(r){e.append(r,t[r])}))},t._createFormDataUpload=function(e,t){var r=new FormData;this._addMetadata(r,e.meta,t);var n=function(e){return e.data.slice(0,e.data.size,e.meta.type)}(e);return e.name?r.append(t.fieldName,n,e.meta.name):r.append(t.fieldName,n),r},t._createBareUpload=function(e,t){return e.data},t._onFileRemoved=function(e,t){this.uploaderEvents[e].on("file-removed",(function(r){e===r.id&&t(r.id)}))},t._onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",(function(r){e===r&&t()}))},t._onRetryAll=function(e,t){var r=this;this.uploaderEvents[e].on("retry-all",(function(n){r.uppy.getFile(e)&&t()}))},t._onCancelAll=function(e,t){var r=this;this.uploaderEvents[e].on("cancel-all",(function(){r.uppy.getFile(e)&&t()}))},t._uploadLocalFile=function(e,t,r){var n=this,i=this._getOptions(e);return this.uppy.log("uploading "+t+" of "+r),new Promise((function(t,r){var o=i.formData?n._createFormDataUpload(e,i):n._createBareUpload(e,i),s=new XMLHttpRequest;n.uploaderEvents[e.id]=new iu(n.uppy);var a=new ou(i.timeout,(function(){s.abort(),l.done();var t=new Error(n.i18n("timedOut",{seconds:Math.ceil(i.timeout/1e3)}));n.uppy.emit("upload-error",e,t),r(t)})),u=B();s.upload.addEventListener("loadstart",(function(e){n.uppy.log("[AwsS3/XHRUpload] "+u+" started")})),s.upload.addEventListener("progress",(function(t){n.uppy.log("[AwsS3/XHRUpload] "+u+" progress: "+t.loaded+" / "+t.total),a.progress(),t.lengthComputable&&n.uppy.emit("upload-progress",e,{uploader:n,bytesUploaded:t.loaded,bytesTotal:t.total})})),s.addEventListener("load",(function(o){if(n.uppy.log("[AwsS3/XHRUpload] "+u+" finished"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),i.validateStatus(o.target.status,s.responseText,s)){var c=i.getResponseData(s.responseText,s),p=c[i.responseUrlFieldName],h={status:o.target.status,body:c,uploadURL:p};return n.uppy.emit("upload-success",e,h),p&&n.uppy.log("Download "+e.name+" from "+p),t(e)}var d=i.getResponseData(s.responseText,s),f=pu(s,i.getResponseError(s.responseText,s)),g={status:o.target.status,body:d};return n.uppy.emit("upload-error",e,f,g),r(f)})),s.addEventListener("error",(function(t){n.uppy.log("[AwsS3/XHRUpload] "+u+" errored"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null);var o=pu(s,i.getResponseError(s.responseText,s));return n.uppy.emit("upload-error",e,o),r(o)})),s.open(i.method.toUpperCase(),i.endpoint,!0),s.withCredentials=i.withCredentials,""!==i.responseType&&(s.responseType=i.responseType),Object.keys(i.headers).forEach((function(e){s.setRequestHeader(e,i.headers[e])}));var l=n.requests.run((function(){return s.send(o),function(){a.done(),s.abort()}}),{priority:1});n._onFileRemoved(e.id,(function(){l.abort(),r(new Error("File removed"))})),n._onCancelAll(e.id,(function(){l.abort(),r(new Error("Upload cancelled"))}))}))},t._uploadRemoteFile=function(e,t,r){var n=this,i=this._getOptions(e);return new Promise((function(t,r){var o={};(Array.isArray(i.metaFields)?i.metaFields:Object.keys(e.meta)).forEach((function(t){o[t]=e.meta[t]})),new(e.remote.providerOptions.provider?uu:lu)(n.uppy,e.remote.providerOptions).post(e.remote.url,au({},e.remote.body,{endpoint:i.endpoint,size:e.data.size,fieldname:i.fieldName,metadata:o,httpMethod:i.method,useFormData:i.formData,headers:i.headers})).then((function(o){var s=o.token,a=nu(e.remote.companionUrl),u=new cu({target:a+"/api/"+s,autoOpen:!1});n.uploaderEvents[e.id]=new iu(n.uppy),n._onFileRemoved(e.id,(function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was removed")})),n._onCancelAll(e.id,(function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was canceled")})),n._onRetry(e.id,(function(){u.send("pause",{}),u.send("resume",{})})),n._onRetryAll(e.id,(function(){u.send("pause",{}),u.send("resume",{})})),u.on("progress",(function(t){return ru(n,t,e)})),u.on("success",(function(r){var o=i.getResponseData(r.response.responseText,r.response),s=o[i.responseUrlFieldName],a={status:r.response.status,body:o,uploadURL:s};return n.uppy.emit("upload-success",e,a),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),t()})),u.on("error",(function(t){var o=t.response,s=o?i.getResponseError(o.responseText,o):au(new Error(t.error.message),{cause:t.error});n.uppy.emit("upload-error",e,s),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),r(s)}));var l=n.requests.run((function(){return u.open(),e.isPaused&&u.send("pause",{}),function(){return u.close()}}))})).catch((function(t){n.uppy.emit("upload-error",e,t),r(t)}))}))},e}(),gu=function(e,t){var r,n=t.headers?t.headers["content-type"]:t.getResponseHeader("Content-Type");if("string"==typeof n){var i=(r=n,r.replace(/;.*$/,"")).toLowerCase();if("application/xml"===i||"text/xml"===i)return!0;if("text/html"===i&&/^<\?xml /.test(e))return!0}return!1};function mu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vu(e,t){return(vu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function yu(){return(yu=Object.assign||function(e){for(var t=1;t"),n=e.indexOf("",r);return-1!==r&&-1!==n?e.slice(r+t.length+2,n):""}function _u(e){if(e&&e.error){var t=new Error(e.message);throw yu(t,e.error),t}return e}var Pu=!1,ku=(du=hu=function(e){var t,r;function n(t,r){var n;(n=e.call(this,t,r)||this).type="uploader",n.id=n.opts.id||"AwsS3",n.title="AWS S3",n.defaultLocale={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}};var i={timeout:3e4,limit:0,metaFields:[],getUploadParameters:n.getUploadParameters.bind(mu(n))};return n.opts=yu({},i,r),n.i18nInit(),n.client=new wu(t,r),n.handleUpload=n.handleUpload.bind(mu(n)),n.requests=new eu(n.opts.limit),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,vu(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new C([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},i.getUploadParameters=function(e){if(!this.opts.companionUrl)throw new Error("Expected a `companionUrl` option containing a Companion address.");var t=e.meta.name,r=e.meta.type,n={};this.opts.metaFields.forEach((function(t){null!=e.meta[t]&&(n[t]=e.meta[t].toString())}));var i=Me({filename:t,type:r,metadata:n});return this.client.get("s3/params?"+i).then(_u)},i.validateParameters=function(e,t){if("object"!=typeof t||!t||"string"!=typeof t.url||"object"!=typeof t.fields&&null!=t.fields){var r=new TypeError("AwsS3: got incorrect result from 'getUploadParameters()' for file '"+e.name+"', expected an object '{ url, method, fields, headers }' but got '"+JSON.stringify(t)+"' instead.\nSee https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.");throw console.error(r),r}if(null!=t.method&&!/^(put|post)$/i.test(t.method)){var n=new TypeError("AwsS3: got incorrect method from 'getUploadParameters()' for file '"+e.name+"', expected 'put' or 'post' but got '"+t.method+"' instead.\nSee https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.");throw console.error(n),n}},i.handleUpload=function(e){var t=this,r=Object.create(null);function n(e){var t=e.id;_(r,t)&&r[t].abort()}this.uppy.on("file-removed",n),e.forEach((function(e){var r=t.uppy.getFile(e);t.uppy.emit("upload-started",r)}));var i=this.requests.wrapPromiseFunction((function(e){return t.opts.getUploadParameters(e)})),o=e.length;return tu(e.map((function(e,n){return r[e]=i(t.uppy.getFile(e)),r[e].then((function(i){delete r[e];var s=t.uppy.getFile(e);t.validateParameters(s,i);var a=i.method,u=void 0===a?"post":a,l=i.url,c=i.fields,p=i.headers,h={method:u,formData:"post"===u.toLowerCase(),endpoint:l,metaFields:c?Object.keys(c):[]};return p&&(h.headers=p),t.uppy.setFileState(s.id,{meta:yu({},s.meta,c),xhrUpload:h}),t._uploader.uploadFile(s.id,n,o)})).catch((function(n){delete r[e];var i=t.uppy.getFile(e);t.uppy.emit("upload-error",i,n)}))}))).then((function(e){return t.uppy.off("file-removed",n),e}))},i.install=function(){var e=this.uppy;this.uppy.addUploader(this.handleUpload);var t={fieldName:"file",responseUrlFieldName:"location",timeout:this.opts.timeout,__queue:this.requests,responseType:"text",getResponseData:this.opts.getResponseData||function(t,r){var n,i;return gu(t,r)?{location:(n=r.responseURL,i=Su(t,"Location"),n?new bu(i,n).toString():new bu(i).toString()),bucket:Su(t,"Bucket"),key:Su(t,"Key"),etag:Su(t,"ETag")}:"POST"===this.method.toUpperCase()?(Pu||(e.log("[AwsS3] No response data found, make sure to set the success_action_status AWS SDK option to 201. See https://uppy.io/docs/aws-s3/#POST-Uploads","warning"),Pu=!0),{location:null}):r.responseURL?{location:r.responseURL.replace(/\?.*$/,"")}:{location:null}},getResponseError:function(e,t){if(gu(e,t)){var r=Su(e,"Message");return new Error(r)}}};t.i18n=this.i18n,this._uploader=new fu(this.uppy,t)},i.uninstall=function(){this.uppy.removeUploader(this.handleUpload)},n}(le.Plugin),hu.VERSION="1.7.11",du),Cu={};function Ou(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eu(e,t){for(var r=0;r=t))break}r.forEach((function(t){e._uploadPartRetryable(t).then((function(){e._uploadParts()}),(function(t){e._onError(t)}))}))}}},t._retryable=function(e){var t=this,r=e.before,n=e.attempt,i=e.after,o=this.options.retryDelays,s=this.abortController.signal;return r&&r(),function e(r){return n().catch((function(n){if(t._aborted())throw zu();if(function(e){if(e.source&&"number"==typeof e.source.status){var t=e.source.status;return 0===t||409===t||423===t||t>=500&&t<600}return!1}(n)&&r=300){var r=new Error("Non 2xx");return r.source=t.target,void n.reject(r)}i._onPartProgress(e,o.size,o.size);var s=t.target.getResponseHeader("ETag");null!==s?(i._onPartComplete(e,s),n.resolve()):n.reject(new Error("AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions."))})),u.addEventListener("error",(function(t){l(),i.chunkState[e].busy=!1;var r=new Error("Unknown error");r.source=t.target,n.reject(r)})),u.send(o),a},t._completeUpload=function(){var e=this;return this.parts.sort((function(e,t){return e.PartNumber-t.PartNumber})),Promise.resolve().then((function(){return e.options.completeMultipartUpload({key:e.key,uploadId:e.uploadId,parts:e.parts})})).then((function(t){e.options.onSuccess(t)}),(function(t){e._onError(t)}))},t._abortUpload=function(){var e=this;this.abortController.abort(),this.createdPromise.then((function(){e.options.abortMultipartUpload({key:e.key,uploadId:e.uploadId})}),(function(){}))},t._onError=function(e){e&&"AbortError"===e.name||this.options.onError(e)},t.start=function(){this.isPaused=!1,this.uploadId?this._resumeUpload():this._createUpload()},t.pause=function(){this.abortController.abort(),this.abortController=new Lu,this.isPaused=!0},t.abort=function(e){if(void 0===e&&(e={}),!e.really)return this.pause();this._abortUpload()},e}();function Yu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gu(e,t){return(Gu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ku(){return(Ku=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(t=r.call(this,e)).originalRequest=o,t.originalResponse=s,t.causingError=i,null!=i&&(e+=", caused by ".concat(i.toString())),null!=o){var a=o.getHeader("X-Request-ID")||"n/a",u=o.getMethod(),l=o.getURL(),c=s?s.getStatus():"n/a",p=s?s.getBody()||"":"n/a";e+=", originated from request (method: ".concat(u,", url: ").concat(l,", response code: ").concat(c,", response text: ").concat(p,", request id: ").concat(a,")")}return t.message=e,t}return n}();tl.default=ul;var ll={};Object.defineProperty(ll,"__esModule",{value:!0}),ll.default=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))};var cl={exports:{}};(function(e){(function(){!function(e,t){"object"==typeof cl.exports?cl.exports=t(e):t(e)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:this,(function(e){"use strict";var t,r=(e=e||{}).Base64,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t={},r=0,n=e.length;r>>6)+o(128|63&t):o(224|t>>>12&15)+o(128|t>>>6&63)+o(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|t>>>18&7)+o(128|t>>>12&63)+o(128|t>>>6&63)+o(128|63&t)},a=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,u=function(e){return e.replace(a,s)},l=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[n.charAt(r>>>18),n.charAt(r>>>12&63),t>=2?"=":n.charAt(r>>>6&63),t>=1?"=":n.charAt(63&r)].join("")},c=e.btoa&&"function"==typeof e.btoa?function(t){return e.btoa(t)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,l)},p=function(e){return c(u(String(e)))},h=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},d=function(e,t){return t?h(p(e)):p(e)};e.Uint8Array&&(t=function(e,t){for(var r="",i=0,o=e.length;i>>18)+n.charAt(l>>>12&63)+(void 0!==a?n.charAt(l>>>6&63):"=")+(void 0!==u?n.charAt(63&l):"=")}return t?h(r):r});var f,g=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,m=function(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))-65536;return o(55296+(t>>>10))+o(56320+(1023&t));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},v=function(e){return e.replace(g,m)},y=function(e){var t=e.length,r=t%4,n=(t>0?i[e.charAt(0)]<<18:0)|(t>1?i[e.charAt(1)]<<12:0)|(t>2?i[e.charAt(2)]<<6:0)|(t>3?i[e.charAt(3)]:0),s=[o(n>>>16),o(n>>>8&255),o(255&n)];return s.length-=[0,0,2,1][r],s.join("")},b=e.atob&&"function"==typeof e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/\S{1,4}/g,y)},w=function(e){return b(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},S=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},_=function(e){return function(e){return v(b(e))}(S(e))};if(e.Uint8Array&&(f=function(e){return Uint8Array.from(w(S(e)),(function(e){return e.charCodeAt(0)}))}),e.Base64={VERSION:"2.6.4",atob:w,btoa:c,fromBase64:_,toBase64:d,utob:u,encode:d,encodeURI:function(e){return d(e,!0)},btou:v,decode:_,noConflict:function(){var t=e.Base64;return e.Base64=r,t},fromUint8Array:t,toUint8Array:f},"function"==typeof Object.defineProperty){var P=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};e.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",P((function(){return _(this)}))),Object.defineProperty(String.prototype,"toBase64",P((function(e){return d(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",P((function(){return d(this,!0)})))}}return e.Meteor&&(Base64=e.Base64),!!cl.exports&&(cl.exports.Base64=e.Base64),{Base64:e.Base64}}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),cl=cl.exports;var pl={};Object.defineProperty(pl,"__esModule",{value:!0}),pl.enableDebugLog=function(){hl=!0},pl.log=function(e){hl&&console.log(e)};var hl=!1,dl={};Object.defineProperty(dl,"__esModule",{value:!0}),dl.default=void 0;var fl=vl(tl),gl=vl(ll),ml=vl(Ve);function vl(e){return e&&e.__esModule?e:{default:e}}function yl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bl(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;if("function"==typeof r||"function"==typeof n)throw new Error("tus: the terminate function does not accept a callback since v2 anymore; please use the returned Promise instead");var i=Cl("DELETE",t,r);return i.send().then((function(e){if(204!==e.getStatus())throw new fl.default("tus: unexpected response while terminating upload",null,i,e)})).catch((function(n){if(n instanceof fl.default||(n=new fl.default("tus: failed to terminate upload",n,i,null)),!Ol(n,0,r))throw n;var o=r.retryDelays[0],s=r.retryDelays.slice(1),a=bl({},r,{retryDelays:s});return new Promise((function(e){return setTimeout(e,o)})).then((function(){return e.terminate(t,a)}))}))}}],(r=[{key:"findPreviousUploads",value:function(){var e=this;return this.options.fingerprint(this.file,this.options).then((function(t){return e._urlStorage.findUploadsByFingerprint(t)}))}},{key:"resumeFromPreviousUpload",value:function(e){this.url=e.uploadUrl||null,this._parallelUploadUrls=e.parallelUploadUrls||null,this._urlStorageKey=e.urlStorageKey}},{key:"start",value:function(){var e=this,t=this.file;if(t)if(this.options.endpoint||this.options.uploadUrl){var r=this.options.retryDelays;null==r||"[object Array]"===Object.prototype.toString.call(r)?(this.options.parallelUploads>1&&["uploadUrl","uploadSize","uploadLengthDeferred"].forEach((function(t){e.options[t]&&e._emitError(new Error("tus: cannot use the ".concat(t," option when parallelUploads is enabled")))})),this.options.fingerprint(t,this.options).then((function(r){return null==r?(0,pl.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,pl.log)("Calculated fingerprint: ".concat(r)),e._fingerprint=r,e._source?e._source:e.options.fileReader.openFile(t,e.options.chunkSize)})).then((function(t){e._source=t,e.options.parallelUploads>1||null!=e._parallelUploadUrls?e._startParallelUpload():e._startSingleUpload()})).catch((function(t){e._emitError(t)}))):this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"))}else this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));else this._emitError(new Error("tus: no file or stream to upload provided"))}},{key:"_startParallelUpload",value:function(){var t=this,r=this._size=this._source.size,n=0;this._parallelUploads=[];var i=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,o=function(e,t,r){for(var n=Math.floor(e/t),i=[],o=0;othis._offsetBeforeRetry&&(this._retryAttempt=0),Ol(e,this._retryAttempt,this.options))){var r=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout((function(){t.start()}),r))}if("function"!=typeof this.options.onError)throw e;this.options.onError(e)}}},{key:"_emitSuccess",value:function(){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"function"==typeof this.options.onSuccess&&this.options.onSuccess()}},{key:"_emitProgress",value:function(e,t){"function"==typeof this.options.onProgress&&this.options.onProgress(e,t)}},{key:"_emitChunkComplete",value:function(e,t,r){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(e,t,r)}},{key:"_createUpload",value:function(){var e=this;if(this.options.endpoint){var t=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?t.setHeader("Upload-Defer-Length",1):t.setHeader("Upload-Length",this._size);var r,n=Pl(this.options.metadata);""!==n&&t.setHeader("Upload-Metadata",n),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,r=this._addChunkToRequest(t)):r=this._sendRequest(t,null),r.then((function(r){if(kl(r.getStatus(),200)){var n=r.getHeader("Location");if(null!=n){if(e.url=El(e.options.endpoint,n),(0,pl.log)("Created upload at ".concat(e.url)),"function"==typeof e.options._onUploadUrlAvailable&&e.options._onUploadUrlAvailable(),0===e._size)return e._emitSuccess(),void e._source.close();e._saveUploadInUrlStorage(),e.options.uploadDataDuringCreation?e._handleUploadResponse(t,r):(e._offset=0,e._performUpload())}else e._emitHttpError(t,r,"tus: invalid or missing Location header")}else e._emitHttpError(t,r,"tus: unexpected response while creating upload")})).catch((function(r){e._emitHttpError(t,null,"tus: failed to create upload",r)}))}else this._emitError(new Error("tus: unable to create upload because no endpoint is provided"))}},{key:"_resumeUpload",value:function(){var e=this,t=this._openRequest("HEAD",this.url);this._sendRequest(t,null).then((function(r){var n=r.getStatus();if(!kl(n,200))return kl(n,400)&&e._removeFromUrlStorage(),423===n?void e._emitHttpError(t,r,"tus: upload is currently locked; retry later"):e.options.endpoint?(e.url=null,void e._createUpload()):void e._emitHttpError(t,r,"tus: unable to resume upload (new upload cannot be created without an endpoint)");var i=parseInt(r.getHeader("Upload-Offset"),10);if(isNaN(i))e._emitHttpError(t,r,"tus: invalid or missing offset value");else{var o=parseInt(r.getHeader("Upload-Length"),10);if(!isNaN(o)||e.options.uploadLengthDeferred){if("function"==typeof e.options._onUploadUrlAvailable&&e.options._onUploadUrlAvailable(),i===o)return e._emitProgress(o,o),void e._emitSuccess();e._offset=i,e._performUpload()}else e._emitHttpError(t,r,"tus: invalid or missing length value")}})).catch((function(r){e._emitHttpError(t,null,"tus: failed to resume upload",r)}))}},{key:"_performUpload",value:function(){var e,t=this;this._aborted||(this.options.overridePatchMethod?(e=this._openRequest("POST",this.url)).setHeader("X-HTTP-Method-Override","PATCH"):e=this._openRequest("PATCH",this.url),e.setHeader("Upload-Offset",this._offset),this._addChunkToRequest(e).then((function(r){kl(r.getStatus(),200)?t._handleUploadResponse(e,r):t._emitHttpError(e,r,"tus: unexpected response while uploading chunk")})).catch((function(r){t._aborted||t._emitHttpError(e,null,"tus: failed to upload chunk at offset "+t._offset,r)})))}},{key:"_addChunkToRequest",value:function(e){var t=this,r=this._offset,n=this._offset+this.options.chunkSize;return e.setProgressHandler((function(e){t._emitProgress(r+e,t._size)})),e.setHeader("Content-Type","application/offset+octet-stream"),(n===1/0||n>this._size)&&!this.options.uploadLengthDeferred&&(n=this._size),this._source.slice(r,n).then((function(r){var n=r.value,i=r.done;return t.options.uploadLengthDeferred&&i&&(t._size=t._offset+(n&&n.size?n.size:0),e.setHeader("Upload-Length",t._size)),null===n?t._sendRequest(e):(t._emitProgress(t._offset,t._size),t._sendRequest(e,n))}))}},{key:"_handleUploadResponse",value:function(e,t){var r=parseInt(t.getHeader("Upload-Offset"),10);if(isNaN(r))this._emitHttpError(e,t,"tus: invalid or missing offset value");else{if(this._emitProgress(r,this._size),this._emitChunkComplete(r-this._offset,r,this._size),this._offset=r,r==this._size)return this._emitSuccess(),void this._source.close();this._performUpload()}}},{key:"_openRequest",value:function(e,t){var r=Cl(e,t,this.options);return this._req=r,r}},{key:"_removeFromUrlStorage",value:function(){var e=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch((function(t){e._emitError(t)})),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var e=this;if(this.options.storeFingerprintForResuming&&this._fingerprint){var t={size:this._size,metadata:this.options.metadata,creationTime:(new Date).toString()};this._parallelUploads?t.parallelUploadUrls=this._parallelUploadUrls:t.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,t).then((function(t){return e._urlStorageKey=t})).catch((function(t){e._emitError(t)}))}}},{key:"_sendRequest",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"function"==typeof this.options.onBeforeRequest&&this.options.onBeforeRequest(e),e.send(r).then((function(r){return"function"==typeof t.options.onAfterResponse&&t.options.onAfterResponse(e,r),r}))}}])&&Sl(t.prototype,r),n&&Sl(t,n),e}();function Pl(e){var t=[];for(var r in e)t.push(r+" "+cl.Base64.encode(e[r]));return t.join(",")}function kl(e,t){return e>=t&&e0&&void 0!==arguments[0]?arguments[0]:null;return new Promise((function(r,n){e._xhr.onload=function(){r(new Vl(e._xhr))},e._xhr.onerror=function(e){n(e)},e._xhr.send(t)}))}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),Vl=function(){function e(t){jl(this,e),this._xhr=t}return zl(e,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(e){return this._xhr.getResponseHeader(e)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),Wl={};Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.default=void 0;Wl.default=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()};var Xl={};Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.default=function(e){return new Promise((function(t,r){var n=new XMLHttpRequest;n.responseType="blob",n.onload=function(){var e=n.response;t(e)},n.onerror=function(e){r(e)},n.open("GET",e),n.send()}))};var Yl={};Object.defineProperty(Yl,"__esModule",{value:!0}),Yl.default=void 0;Yl.default=function(){return"undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)};var Gl={};Object.defineProperty(Gl,"__esModule",{value:!0}),Gl.default=function(e){return new Promise((function(t,r){var n=new FileReader;n.onload=function(){var e=new Uint8Array(n.result);t({value:e})},n.onerror=function(e){r(e)},n.readAsArrayBuffer(e)}))};var Kl={};Object.defineProperty(Kl,"__esModule",{value:!0}),Kl.default=void 0;var $l=ec(Wl),Jl=ec(Xl),Ql=ec(Yl),Zl=ec(Gl);function ec(e){return e&&e.__esModule?e:{default:e}}function tc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rc(e,t){for(var r=0;rthis._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);var r=0===sc(this._buffer);return this._done&&r?null:this._buffer.slice(0,t-e)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}]),e}();function sc(e){return void 0===e?0:void 0!==e.size?e.size:e.length}var ac=function(){function e(){tc(this,e)}return nc(e,[{key:"openFile",value:function(e,t){return(0,$l.default)()&&e&&void 0!==e.uri?(0,Jl.default)(e.uri).then((function(e){return new ic(e)})).catch((function(e){throw new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. "+e)})):"function"==typeof e.slice&&void 0!==e.size?Promise.resolve(new ic(e)):"function"==typeof e.read?(t=+t,isFinite(t)?Promise.resolve(new oc(e,t)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option"))):Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment"))}}]),e}();Kl.default=ac;var uc={};Object.defineProperty(uc,"__esModule",{value:!0}),uc.default=function(e,t){return(0,cc.default)()?Promise.resolve(function(e,t){var r=e.exif?function(e){var t=0;if(0===e.length)return t;for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=Pc({},Cc,{},t),i.call(this,e,t)}return t=o,r=[{key:"terminate",value:function(e,t,r){return t=Pc({},Cc,{},t),hc.default.terminate(e,t,r)}}],null&&bc(t.prototype,null),r&&bc(t,r),o}();pc.Upload=Oc;var Ec,Ac,Fc=window,Rc=Fc.XMLHttpRequest,xc=Fc.Blob;Rc&&xc&&xc.prototype.slice;function Uc(){return(Uc=Object.assign||function(e){for(var t=1;t0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"days":case"day":case"d":return r*Wc;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*r;case"minutes":case"minute":case"mins":case"min":case"m":return r*Vc;case"seconds":case"second":case"secs":case"sec":case"s":return r*qc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===n&&!1===isNaN(e))return t.long?Xc(r=e,Wc,"day")||Xc(r,36e5,"hour")||Xc(r,Vc,"minute")||Xc(r,qc,"second")||r+" ms":function(e){return e>=Wc?Math.round(e/Wc)+"d":e>=36e5?Math.round(e/36e5)+"h":e>=Vc?Math.round(e/Vc)+"m":e>=qc?Math.round(e/qc)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},Yc.instances=[],Yc.names=[],Yc.skips=[],Yc.formatters={};var $c={};(function(e){(function(){function t(){var t;try{t=$c.storage.debug}catch(Sf){}return!t&&void 0!==e&&"env"in e&&(t=e.env.DEBUG),t}($c=$c=Yc).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},$c.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+$c.humanize(this.diff),t){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(i=n))})),e.splice(i,0,r)}},$c.save=function(e){try{null==e?$c.storage.removeItem("debug"):$c.storage.debug=e}catch(Sf){}},$c.load=t,$c.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},$c.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(Sf){}}(),$c.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],$c.formatters.j=function(e){try{return JSON.stringify(e)}catch(th){return"[UnexpectedJSONParseError]: "+th.message}},$c.enable(t())}).call(this)}).call(this,e);var Jc=$c("socket.io-client:url"),Qc=function(e,t){var r=e;t=t||"undefined"!=typeof location&&location,null==e&&(e=t.protocol+"//"+t.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(Jc("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),Jc("parse %s",e),r=Hc(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var n=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+n+":"+r.port,r.href=r.protocol+"://"+n+(t&&t.port===r.port?"":":"+r.port),r},Zc={exports:{}};function ep(e){if(e)return function(e){for(var t in ep.prototype)e[t]=ep.prototype[t];return e}(e)}Zc.exports=ep,ep.prototype.on=ep.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},ep.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},ep.prototype.off=ep.prototype.removeListener=ep.prototype.removeAllListeners=ep.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;in&&(r=n),t>=n||t>=r||0===n)return new ArrayBuffer(0);for(var i=new Uint8Array(e),o=new Uint8Array(r-t),s=t,a=0;s=55296&&t<=56319&&i=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Tp(e,t){return Rp(e>>t&63|128)}function Dp(e,t){if(0==(4294967168&e))return Rp(e);var r="";return 0==(4294965248&e)?r=Rp(e>>6&31|192):0==(4294901760&e)?(Up(e,t)||(e=65533),r=Rp(e>>12&15|224),r+=Tp(e,6)):0==(4292870144&e)&&(r=Rp(e>>18&7|240),r+=Tp(e,12),r+=Tp(e,6)),r+Rp(63&e|128)}function Bp(){if(Fp>=Ap)throw Error("Invalid byte index");var e=255&Ep[Fp];if(Fp++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function Ip(e){var t,r;if(Fp>Ap)throw Error("Invalid byte index");if(Fp==Ap)return!1;if(t=255&Ep[Fp],Fp++,0==(128&t))return t;if(192==(224&t)){if((r=(31&t)<<6|Bp())>=128)return r;throw Error("Invalid continuation byte")}if(224==(240&t)){if((r=(15&t)<<12|Bp()<<6|Bp())>=2048)return Up(r,e)?r:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(r=(7&t)<<18|Bp()<<12|Bp()<<6|Bp())>=65536&&r<=1114111)return r;throw Error("Invalid UTF-8 detected")}var Np=function(e,t){for(var r=!1!==(t=t||{}).strict,n=xp(e),i=n.length,o=-1,s="";++o65535&&(i+=Rp((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=Rp(t);return i}(i)},jp={};!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),r=0;r>2],o+=e[(3&n[r])<<4|n[r+1]>>4],o+=e[(15&n[r+1])<<2|n[r+2]>>6],o+=e[63&n[r+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},jp.decode=function(e){var r,n,i,o,s,a=.75*e.length,u=e.length,l=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var c=new ArrayBuffer(a),p=new Uint8Array(c);for(r=0;r>4,p[l++]=(15&i)<<4|o>>2,p[l++]=(3&o)<<6|63&s;return c}}();var Lp={},zp=void 0!==zp?zp:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,Hp=function(){try{return 2===new Blob(["hi"]).size}catch(Sf){return!1}}(),qp=Hp&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(Sf){return!1}}(),Vp=zp&&zp.prototype.append&&zp.prototype.getBlob;function Wp(e){return e.map((function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var r=new Uint8Array(e.byteLength);r.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=r.buffer}return t}return e}))}function Xp(e,t){t=t||{};var r=new zp;return Wp(e).forEach((function(e){r.append(e)})),t.type?r.getBlob(t.type):r.getBlob()}function Yp(e,t){return new Blob(Wp(e),t||{})}"undefined"!=typeof Blob&&(Xp.prototype=Blob.prototype,Yp.prototype=Blob.prototype),Lp=Hp?qp?Blob:Yp:Vp?Xp:void 0;var Gp,Kp={};"undefined"!=typeof ArrayBuffer&&(Gp=jp);var $p="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),Jp="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),Qp=$p||Jp;Kp.protocol=3;var Zp=Kp.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},eh=Sp(Zp),th={type:"error",data:"parser error"};function rh(e,t,r){for(var n=new Array(e.length),i=function(e,t,r){var n=!1;return r=r||Op,i.count=e,0===e?t():i;function i(e,o){if(i.count<=0)throw new Error("after called too many times");--i.count,e?(n=!0,t(e),t=r):0!==i.count||n||t(null,o)}}(e.length,r),o=function(e,r,i){t(r,(function(t,r){n[e]=r,i(t,n)}))},s=0;s1?{type:eh[n],data:e.substring(1)}:{type:eh[n]}:th}n=new Uint8Array(e)[0];var i=Cp(e,1);return Lp&&"blob"===t&&(i=new Lp([i])),{type:eh[n],data:i}},Kp.decodeBase64Packet=function(e,t){var r=eh[e.charAt(0)];if(!Gp)return{type:r,data:{base64:!0,data:e.substr(1)}};var n=Gp.decode(e.substr(1));return"blob"===t&&Lp&&(n=new Lp([n])),{type:r,data:n}},Kp.encodePayload=function(e,t,r){"function"==typeof t&&(r=t,t=null);var n=kp(e);return t&&n?Lp&&!Qp?Kp.encodePayloadAsBlob(e,r):Kp.encodePayloadAsArrayBuffer(e,r):e.length?void rh(e,(function(e,r){Kp.encodePacket(e,!!n&&t,!1,(function(e){r(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return r(t.join(""))})):r("0:")},Kp.decodePayload=function(e,t,r){if("string"!=typeof e)return Kp.decodePayloadAsBinary(e,t,r);var n;if("function"==typeof t&&(r=t,t=null),""===e)return r(th,0,1);for(var i,o,s="",a=0,u=e.length;a0;){for(var o=new Uint8Array(n),s=0===o[0],a="",u=1;255!==o[u];u++){if(a.length>310)return r(th,0,1);a+=o[u]}n=Cp(n,2+a.length),a=parseInt(a);var l=Cp(n,0,a);if(s)try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(Sf){var c=new Uint8Array(l);for(l="",u=0;u0);return t}function gh(){var e=fh(+new Date);return e!==sh?(hh=0,sh=e):e+"."+fh(hh++)}for(;dh<64;dh++)ph[ch[dh]]=dh;gh.encode=fh,gh.decode=function(e){var t=0;for(dh=0;dh';o=document.createElement(e)}catch(Sf){(o=document.createElement("iframe")).name=i.iframeId,o.src="javascript:0"}o.id=i.iframeId,i.form.appendChild(o),i.iframe=o}this.form.action=this.uri(),c(),e=e.replace(n,"\\\n"),this.area.value=e.replace(r,"\\n");try{this.form.submit()}catch(Sf){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===i.iframe.readyState&&l()}:this.iframe.onload=l}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Ah={};(function(e){(function(){var t,r,n=$c("engine.io-client:websocket");if("undefined"!=typeof WebSocket)t=WebSocket;else if("undefined"!=typeof self)t=self.WebSocket||self.MozWebSocket;else try{r=o({})}catch(Sf){}var i=t||r;function s(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=t&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(i=r),nh.call(this,e)}Ah=s,uh(s,nh),s.prototype.name="websocket",s.prototype.supportsBinary=!0,s.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new i(e,t):new i(e):new i(e,t,r)}catch(th){return this.emit("error",th)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},s.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},s.prototype.write=function(t){var r=this;this.writable=!1;for(var i=t.length,o=0,s=i;o0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}Rh=Uh,Uh.priorWebsocketSuccess=!1,mp(Uh.prototype),Uh.protocol=Kp.protocol,Uh.Socket=Uh,Uh.Transport=nh,Uh.transports=Fh,Uh.parser=Kp,Uh.prototype.createTransport=function(e){xh('creating transport "%s"',e);var t=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}(this.query);t.EIO=Kp.protocol,t.transport=e;var r=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new Fh[e]({query:t,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0,isReactNative:this.isReactNative})},Uh.prototype.open=function(){var e;if(this.rememberUpgrade&&Uh.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout((function(){t.emit("error","No transports available")}),0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(Sf){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},Uh.prototype.setTransport=function(e){xh("setting transport %s",e.name);var t=this;this.transport&&(xh("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",(function(){t.onDrain()})).on("packet",(function(e){t.onPacket(e)})).on("error",(function(e){t.onError(e)})).on("close",(function(){t.onClose("transport close")}))},Uh.prototype.probe=function(e){xh('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),r=!1,n=this;function i(){if(n.onlyBinaryUpgrades){var i=!this.supportsBinary&&n.transport.supportsBinary;r=r||i}r||(xh('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(i){if(!r)if("pong"===i.type&&"probe"===i.data){if(xh('probe transport "%s" pong',e),n.upgrading=!0,n.emit("upgrading",t),!t)return;Uh.priorWebsocketSuccess="websocket"===t.name,xh('pausing current transport "%s"',n.transport.name),n.transport.pause((function(){r||"closed"!==n.readyState&&(xh("changing transport and sending upgrade packet"),c(),n.setTransport(t),t.send([{type:"upgrade"}]),n.emit("upgrade",t),t=null,n.upgrading=!1,n.flush())}))}else{xh('probe transport "%s" failed',e);var o=new Error("probe error");o.transport=t.name,n.emit("upgradeError",o)}})))}function o(){r||(r=!0,c(),t.close(),t=null)}function s(r){var i=new Error("probe error: "+r);i.transport=t.name,o(),xh('probe transport "%s" failed because of error: %s',e,r),n.emit("upgradeError",i)}function a(){s("transport closed")}function u(){s("socket closed")}function l(e){t&&e.name!==t.name&&(xh('"%s" works - aborting "%s"',e.name,t.name),o())}function c(){t.removeListener("open",i),t.removeListener("error",s),t.removeListener("close",a),n.removeListener("close",u),n.removeListener("upgrading",l)}Uh.priorWebsocketSuccess=!1,t.once("open",i),t.once("error",s),t.once("close",a),this.once("close",u),this.once("upgrading",l),t.open()},Uh.prototype.onOpen=function(){if(xh("socket open"),this.readyState="open",Uh.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){xh("starting upgrade probes");for(var e=0,t=this.upgrades.length;e0&&e.jitter<=1?e.jitter:0,this.attempts=0}qh=Vh,Vh.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-r:e+r}return 0|Math.min(e,this.max)},Vh.prototype.reset=function(){this.attempts=0},Vh.prototype.setMin=function(e){this.ms=e},Vh.prototype.setMax=function(e){this.max=e},Vh.prototype.setJitter=function(e){this.jitter=e};var Wh={},Xh=$c("socket.io-client:manager"),Yh=Object.prototype.hasOwnProperty;function Gh(e,t){if(!(this instanceof Gh))return new Gh(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new qh({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=t.parser||up;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}Wh=Gh,Gh.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)Yh.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},Gh.prototype.updateSocketIds=function(){for(var e in this.nsps)Yh.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},Gh.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},mp(Gh.prototype),Gh.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},Gh.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},Gh.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},Gh.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},Gh.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},Gh.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},Gh.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},Gh.prototype.open=Gh.prototype.connect=function(e,t){if(Xh("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;Xh("opening %s",this.uri),this.engine=Th(this.uri,this.opts);var r=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var i=Bh(r,"open",(function(){n.onopen(),e&&e()})),o=Bh(r,"error",(function(t){if(Xh("connect_error"),n.cleanup(),n.readyState="closed",n.emitAll("connect_error",t),e){var r=new Error("Connection error");r.data=t,e(r)}else n.maybeReconnectOnOpen()}));if(!1!==this._timeout){var s=this._timeout;Xh("connect attempt will timeout after %d",s);var a=setTimeout((function(){Xh("connect attempt timed out after %d",s),i.destroy(),r.close(),r.emit("error","timeout"),n.emitAll("connect_timeout",s)}),s);this.subs.push({destroy:function(){clearTimeout(a)}})}return this.subs.push(i),this.subs.push(o),this},Gh.prototype.onopen=function(){Xh("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(Bh(e,"data",Nh(this,"ondata"))),this.subs.push(Bh(e,"ping",Nh(this,"onping"))),this.subs.push(Bh(e,"pong",Nh(this,"onpong"))),this.subs.push(Bh(e,"error",Nh(this,"onerror"))),this.subs.push(Bh(e,"close",Nh(this,"onclose"))),this.subs.push(Bh(this.decoder,"decoded",Nh(this,"ondecoded")))},Gh.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},Gh.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},Gh.prototype.ondata=function(e){this.decoder.add(e)},Gh.prototype.ondecoded=function(e){this.emit("packet",e)},Gh.prototype.onerror=function(e){Xh("error",e),this.emitAll("error",e)},Gh.prototype.socket=function(e,t){var r=this.nsps[e];if(!r){r=new Mh(this,e,t),this.nsps[e]=r;var n=this;r.on("connecting",i),r.on("connect",(function(){r.id=n.generateId(e)})),this.autoConnect&&i()}function i(){~bp(n.connecting,r)||n.connecting.push(r)}return r},Gh.prototype.destroy=function(e){var t=bp(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},Gh.prototype.packet=function(e){Xh("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,(function(r){for(var n=0;n0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},Gh.prototype.cleanup=function(){Xh("cleanup");for(var e=this.subs.length,t=0;t=this._reconnectionAttempts)Xh("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();Xh("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var r=setTimeout((function(){e.skipReconnect||(Xh("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(Xh("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(Xh("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(r)}})}},Gh.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)};function Kh(){return(Kh=Object.assign||function(e){for(var t=1;t=Qh.indexOf(t)}var ed=function(e){var t,r;function n(t){var r;return(r=e.call(this)||this).status=t,r.socket=null,r.pollInterval=null,r.closed=!1,r}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,$h(t,r);var o=n.prototype;return o.connect=function(){this._connectSocket(),this._beginPolling()},o._onFinished=function(){this.emit("finished"),this.close()},o._connectSocket=function(){var e=this,t=function(e){var t=/^\w+:\/\//.exec(e),r=0;t&&(r=t[0].length+1);var n=e.indexOf("/",r);return-1===n?{origin:e,pathname:"/"}:{origin:e.slice(0,n),pathname:e.slice(n)}}(this.status.websocket_url),r=(Jh||(Jh=i({})),Jh).connect(t.origin,{transports:["websocket"],path:t.pathname});r.on("connect",(function(){r.emit("assembly_connect",{id:e.status.assembly_id}),e.emit("connect")})),r.on("connect_failed",(function(){e._onError(new Ue("Transloadit Socket.io connection error")),e.socket=null})),r.on("error",(function(){r.disconnect(),e.socket=null})),r.on("assembly_finished",(function(){e._onFinished()})),r.on("assembly_upload_finished",(function(t){e.emit("upload",t),e.status.uploads.push(t)})),r.on("assembly_uploading_finished",(function(){e.emit("executing")})),r.on("assembly_upload_meta_data_extracted",(function(){e.emit("metadata"),e._fetchStatus({diff:!1})})),r.on("assembly_result_finished",(function(t,r){e.emit("result",t,r),e.status.results[t]||(e.status.results[t]=[]),e.status.results[t].push(r)})),r.on("assembly_error",(function(t){e._onError(t),e._fetchStatus({diff:!1})})),this.socket=r},o._onError=function(e){this.emit("error",Kh(new Error(e.message),e))},o._beginPolling=function(){var e=this;this.pollInterval=setInterval((function(){e.socket&&e.socket.connected||e._fetchStatus()}),2e3)},o._fetchStatus=function(e){var t=this,r=(void 0===e?{}:e).diff,n=void 0===r||r;return Te(this.status.assembly_ssl_url).then((function(e){return e.json()})).then((function(e){t.closed||(t.emit("status",e),n?t.updateStatus(e):t.status=e)})).catch((function(e){return t._onError(e)}))},o.update=function(){return this._fetchStatus({diff:!0})},o.updateStatus=function(e){this._diffStatus(this.status,e),this.status=e},o._diffStatus=function(e,t){var r=this,n=e.ok,i=t.ok;if(t.error&&!e.error)return this._onError(t);var o=Zh(i,"ASSEMBLY_EXECUTING")&&!Zh(n,"ASSEMBLY_EXECUTING");o&&this.emit("executing"),Object.keys(t.uploads).filter((function(t){return!_(e.uploads,t)})).map((function(e){return t.uploads[e]})).forEach((function(e){r.emit("upload",e)})),o&&this.emit("metadata"),Object.keys(t.results).forEach((function(n){var i=t.results[n],o=e.results[n];i.filter((function(e){return!o||!o.some((function(t){return t.id===e.id}))})).forEach((function(e){r.emit("result",n,e)}))})),Zh(i,"ASSEMBLY_COMPLETED")&&!Zh(n,"ASSEMBLY_COMPLETED")&&this.emit("finished")},o.close=function(){this.closed=!0,this.socket&&(this.socket.disconnect(),this.socket=null),clearInterval(this.pollInterval)},n}(mp),td=function(){function e(e){void 0===e&&(e={}),this.opts=e,this._reportError=this._reportError.bind(this),this._headers={"Transloadit-Client":this.opts.client}}var t=e.prototype;return t.createAssembly=function(e){var t=this,r=e.params,n=e.fields,i=e.signature,o=e.expectedFiles,s=new FormData;s.append("params","string"==typeof r?r:JSON.stringify(r)),i&&s.append("signature",i),Object.keys(n).forEach((function(e){s.append(e,n[e])})),s.append("num_expected_upload_files",o);var a=new Ve("/assemblies",""+this.opts.service).href;return Te(a,{method:"post",headers:this._headers,body:s}).then((function(e){return e.json()})).then((function(e){if(e.error){var t=new Error(e.error);throw t.details=e.message,t.assembly=e,e.assembly_id&&(t.details+=" Assembly ID: "+e.assembly_id),t}return e})).catch((function(e){return t._reportError(e,{url:a,type:"API_ERROR"})}))},t.reserveFile=function(e,t){var r=this,n=encodeURIComponent(t.size),i=e.assembly_ssl_url+"/reserve_file?size="+n;return Te(i,{method:"post",headers:this._headers}).then((function(e){return e.json()})).catch((function(n){return r._reportError(n,{assembly:e,file:t,url:i,type:"API_ERROR"})}))},t.addFile=function(e,t){var r=this;if(!t.uploadURL)return Promise.reject(new Error("File does not have an `uploadURL`."));var n=encodeURIComponent(t.size),i=encodeURIComponent(t.uploadURL),o="size="+n+"&filename="+encodeURIComponent(t.name)+"&fieldname=file&s3Url="+i,s=e.assembly_ssl_url+"/add_file?"+o;return Te(s,{method:"post",headers:this._headers}).then((function(e){return e.json()})).catch((function(n){return r._reportError(n,{assembly:e,file:t,url:s,type:"API_ERROR"})}))},t.cancelAssembly=function(e){var t=this,r=e.assembly_ssl_url;return Te(r,{method:"delete",headers:this._headers}).then((function(e){return e.json()})).catch((function(e){return t._reportError(e,{url:r,type:"API_ERROR"})}))},t.getAssemblyStatus=function(e){var t=this;return Te(e,{headers:this._headers}).then((function(e){return e.json()})).catch((function(r){return t._reportError(r,{url:e,type:"STATUS_ERROR"})}))},t.submitError=function(e,t){var r=t.endpoint,n=t.instance,i=t.assembly,o=e.details?e.message+" ("+e.details+")":e.message;return Te("https://transloaditstatus.com/client_error",{method:"post",body:JSON.stringify({endpoint:r,instance:n,assembly_id:i,agent:"undefined"!=typeof navigator?navigator.userAgent:"",client:this.opts.client,error:o})}).then((function(e){return e.json()}))},t._reportError=function(e,t){if(!1===this.opts.errorReporting)throw e;var r={type:t.type};throw t.assembly&&(r.assembly=t.assembly.assembly_id,r.instance=t.assembly.instance),t.url&&(r.endpoint=t.url),this.submitError(e,r).catch((function(e){})),e},e}(),rd={};function nd(e){if(!e)throw new Error("Transloadit: The `params` option is required.");if("string"==typeof e)try{e=JSON.parse(e)}catch(th){throw th.message="Transloadit: The `params` option is a malformed JSON string: "+th.message,th}if(!e.auth||!e.auth.key)throw new Error("Transloadit: The `params.auth.key` option is required. You can find your Transloadit API key at https://transloadit.com/account/api-settings.")}var id=function(){function e(e,t){this.files=e,this.opts=t}var t=e.prototype;return t._normalizeAssemblyOptions=function(e,t){if(Array.isArray(t.fields)){var r=t.fields;t.fields={},r.forEach((function(r){t.fields[r]=e.meta[r]}))}return t.fields||(t.fields={}),t},t._getAssemblyOptions=function(e){var t=this,r=this.opts;return Promise.resolve().then((function(){return r.getAssemblyOptions(e,r)})).then((function(r){return t._normalizeAssemblyOptions(e,r)})).then((function(t){return nd(t.params),{fileIDs:[e.id],options:t}}))},t._dedupe=function(e){var t=Object.create(null);return e.forEach((function(e){var r,n=e.fileIDs,i=e.options,o=JSON.stringify(i);t[o]?(r=t[o].fileIDs).push.apply(r,n):t[o]={options:i,fileIDs:[].concat(n)}})),Object.keys(t).map((function(e){return t[e]}))},t.build=function(){var e=this,t=this.opts;return this.files.length>0?Promise.all(this.files.map((function(t){return e._getAssemblyOptions(t)}))).then((function(t){return e._dedupe(t)})):t.alwaysRunAssembly?Promise.resolve(t.getAssemblyOptions(null,t)).then((function(t){return nd(t.params),[{fileIDs:e.files.map((function(e){return e.id})),options:t}]})):Promise.resolve([])},e}();function od(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sd(e,t){return(sd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(rd=id).validateParams=nd;var ad,ud,ld=function(e){var t,r;function n(t,r){var n;return(n=e.call(this)||this)._uppy=t,n._assemblyIDs=r,n._remaining=r.length,n.promise=new Promise((function(e,t){n._resolve=e,n._reject=t})),n._onAssemblyComplete=n._onAssemblyComplete.bind(od(n)),n._onAssemblyCancel=n._onAssemblyCancel.bind(od(n)),n._onAssemblyError=n._onAssemblyError.bind(od(n)),n._onImportError=n._onImportError.bind(od(n)),n._addListeners(),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,sd(t,r);var i=n.prototype;return i._watching=function(e){return-1!==this._assemblyIDs.indexOf(e)},i._onAssemblyComplete=function(e){this._watching(e.assembly_id)&&(this._uppy.log("[Transloadit] AssemblyWatcher: Got Assembly finish "+e.assembly_id),this.emit("assembly-complete",e.assembly_id),this._checkAllComplete())},i._onAssemblyCancel=function(e){this._watching(e.assembly_id)&&this._checkAllComplete()},i._onAssemblyError=function(e,t){this._watching(e.assembly_id)&&(this._uppy.log("[Transloadit] AssemblyWatcher: Got Assembly error "+e.assembly_id),this._uppy.log(t),this.emit("assembly-error",e.assembly_id,t),this._checkAllComplete())},i._onImportError=function(e,t,r){this._watching(e.assembly_id)&&this._onAssemblyError(e,r)},i._checkAllComplete=function(){this._remaining-=1,0===this._remaining&&(this._removeListeners(),this._resolve())},i._removeListeners=function(){this._uppy.off("transloadit:complete",this._onAssemblyComplete),this._uppy.off("transloadit:assembly-cancel",this._onAssemblyCancel),this._uppy.off("transloadit:assembly-error",this._onAssemblyError),this._uppy.off("transloadit:import-error",this._onImportError)},i._addListeners=function(){this._uppy.on("transloadit:complete",this._onAssemblyComplete),this._uppy.on("transloadit:assembly-cancel",this._onAssemblyCancel),this._uppy.on("transloadit:assembly-error",this._onAssemblyError),this._uppy.on("transloadit:import-error",this._onImportError)},n}(mp),cd={};function pd(){return(pd=Object.assign||function(e){for(var t=1;t=200&&e<300}};if(n.opts=Sd({},i,r),n.i18nInit(),n.handleUpload=n.handleUpload.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)),n.opts.__queue instanceof eu?n.requests=n.opts.__queue:n.requests=new eu(n.opts.limit),n.opts.bundle&&!n.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");return n.uploaderEvents=Object.create(null),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,wd(t,r);var i=n.prototype;return i.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},i.i18nInit=function(){this.translator=new C([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},i.getOptions=function(e){var t=this.uppy.getState().xhrUpload,r=this.opts.headers,n=Sd({},this.opts,t||{},e.xhrUpload||{},{headers:{}});return"function"==typeof r?n.headers=r(e):Sd(n.headers,this.opts.headers),t&&Sd(n.headers,t.headers),e.xhrUpload&&Sd(n.headers,e.xhrUpload.headers),n},i.addMetadata=function(e,t,r){(Array.isArray(r.metaFields)?r.metaFields:Object.keys(t)).forEach((function(r){e.append(r,t[r])}))},i.createFormDataUpload=function(e,t){var r=new FormData;this.addMetadata(r,e.meta,t);var n=Od(e);return e.name?r.append(t.fieldName,n,e.meta.name):r.append(t.fieldName,n),r},i.createBundledUpload=function(e,t){var r=this,n=new FormData,i=this.uppy.getState().meta;return this.addMetadata(n,i,t),e.forEach((function(e){var t=r.getOptions(e),i=Od(e);e.name?n.append(t.fieldName,i,e.name):n.append(t.fieldName,i)})),n},i.createBareUpload=function(e,t){return e.data},i.upload=function(e,t,r){var n=this,i=this.getOptions(e);return this.uppy.log("uploading "+t+" of "+r),new Promise((function(t,r){n.uppy.emit("upload-started",e);var o=i.formData?n.createFormDataUpload(e,i):n.createBareUpload(e,i),s=new XMLHttpRequest;n.uploaderEvents[e.id]=new iu(n.uppy);var a=new ou(i.timeout,(function(){s.abort(),l.done();var t=new Error(n.i18n("timedOut",{seconds:Math.ceil(i.timeout/1e3)}));n.uppy.emit("upload-error",e,t),r(t)})),u=B();s.upload.addEventListener("loadstart",(function(e){n.uppy.log("[XHRUpload] "+u+" started")})),s.upload.addEventListener("progress",(function(t){n.uppy.log("[XHRUpload] "+u+" progress: "+t.loaded+" / "+t.total),a.progress(),t.lengthComputable&&n.uppy.emit("upload-progress",e,{uploader:n,bytesUploaded:t.loaded,bytesTotal:t.total})})),s.addEventListener("load",(function(o){if(n.uppy.log("[XHRUpload] "+u+" finished"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),i.validateStatus(o.target.status,s.responseText,s)){var c=i.getResponseData(s.responseText,s),p=c[i.responseUrlFieldName],h={status:o.target.status,body:c,uploadURL:p};return n.uppy.emit("upload-success",e,h),p&&n.uppy.log("Download "+e.name+" from "+p),t(e)}var d=i.getResponseData(s.responseText,s),f=Cd(s,i.getResponseError(s.responseText,s)),g={status:o.target.status,body:d};return n.uppy.emit("upload-error",e,f,g),r(f)})),s.addEventListener("error",(function(t){n.uppy.log("[XHRUpload] "+u+" errored"),a.done(),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null);var o=Cd(s,i.getResponseError(s.responseText,s));return n.uppy.emit("upload-error",e,o),r(o)})),s.open(i.method.toUpperCase(),i.endpoint,!0),s.withCredentials=i.withCredentials,""!==i.responseType&&(s.responseType=i.responseType);var l=n.requests.run((function(){var t=n.getOptions(e);return Object.keys(t.headers).forEach((function(e){s.setRequestHeader(e,t.headers[e])})),s.send(o),function(){a.done(),s.abort()}}));n.onFileRemove(e.id,(function(){l.abort(),r(new Error("File removed"))})),n.onCancelAll(e.id,(function(){l.abort(),r(new Error("Upload cancelled"))}))}))},i.uploadRemote=function(e,t,r){var n=this,i=this.getOptions(e);return new Promise((function(t,r){n.uppy.emit("upload-started",e);var o={};(Array.isArray(i.metaFields)?i.metaFields:Object.keys(e.meta)).forEach((function(t){o[t]=e.meta[t]})),new(e.remote.providerOptions.provider?_d:Pd)(n.uppy,e.remote.providerOptions).post(e.remote.url,Sd({},e.remote.body,{endpoint:i.endpoint,size:e.data.size,fieldname:i.fieldName,metadata:o,httpMethod:i.method,useFormData:i.formData,headers:i.headers})).then((function(o){var s=o.token,a=nu(e.remote.companionUrl),u=new kd({target:a+"/api/"+s,autoOpen:!1});n.uploaderEvents[e.id]=new iu(n.uppy),n.onFileRemove(e.id,(function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was removed")})),n.onCancelAll(e.id,(function(){u.send("pause",{}),l.abort(),t("upload "+e.id+" was canceled")})),n.onRetry(e.id,(function(){u.send("pause",{}),u.send("resume",{})})),n.onRetryAll(e.id,(function(){u.send("pause",{}),u.send("resume",{})})),u.on("progress",(function(t){return ru(n,t,e)})),u.on("success",(function(r){var o=i.getResponseData(r.response.responseText,r.response),s=o[i.responseUrlFieldName],a={status:r.response.status,body:o,uploadURL:s};return n.uppy.emit("upload-success",e,a),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),t()})),u.on("error",(function(t){var o=t.response,s=o?i.getResponseError(o.responseText,o):Sd(new Error(t.error.message),{cause:t.error});n.uppy.emit("upload-error",e,s),l.done(),n.uploaderEvents[e.id]&&(n.uploaderEvents[e.id].remove(),n.uploaderEvents[e.id]=null),r(s)}));var l=n.requests.run((function(){return u.open(),e.isPaused&&u.send("pause",{}),function(){return u.close()}}))})).catch((function(t){n.uppy.emit("upload-error",e,t),r(t)}))}))},i.uploadBundle=function(e){var t=this;return new Promise((function(r,n){var i=t.opts.endpoint,o=t.opts.method,s=t.uppy.getState().xhrUpload,a=t.createBundledUpload(e,Sd({},t.opts,s||{})),u=new XMLHttpRequest,l=new ou(t.opts.timeout,(function(){u.abort();var e=new Error(t.i18n("timedOut",{seconds:Math.ceil(t.opts.timeout/1e3)}));c(e),n(e)})),c=function(r){e.forEach((function(e){t.uppy.emit("upload-error",e,r)}))};u.upload.addEventListener("loadstart",(function(e){t.uppy.log("[XHRUpload] started uploading bundle"),l.progress()})),u.upload.addEventListener("progress",(function(r){l.progress(),r.lengthComputable&&e.forEach((function(e){t.uppy.emit("upload-progress",e,{uploader:t,bytesUploaded:r.loaded/r.total*e.size,bytesTotal:e.size})}))})),u.addEventListener("load",(function(i){if(l.done(),t.opts.validateStatus(i.target.status,u.responseText,u)){var o=t.opts.getResponseData(u.responseText,u),s={status:i.target.status,body:o};return e.forEach((function(e){t.uppy.emit("upload-success",e,s)})),r()}var a=t.opts.getResponseError(u.responseText,u)||new Error("Upload error");return a.request=u,c(a),n(a)})),u.addEventListener("error",(function(e){l.done();var r=t.opts.getResponseError(u.responseText,u)||new Error("Upload error");return c(r),n(r)})),t.uppy.on("cancel-all",(function(){l.done(),u.abort()})),u.open(o.toUpperCase(),i,!0),u.withCredentials=t.opts.withCredentials,""!==t.opts.responseType&&(u.responseType=t.opts.responseType),Object.keys(t.opts.headers).forEach((function(e){u.setRequestHeader(e,t.opts.headers[e])})),u.send(a),e.forEach((function(e){t.uppy.emit("upload-started",e)}))}))},i.uploadFiles=function(e){var t=this,r=e.map((function(r,n){var i=parseInt(n,10)+1,o=e.length;return r.error?Promise.reject(new Error(r.error)):r.isRemote?t.uploadRemote(r,i,o):t.upload(r,i,o)}));return tu(r)},i.onFileRemove=function(e,t){this.uploaderEvents[e].on("file-removed",(function(r){e===r.id&&t(r.id)}))},i.onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",(function(r){e===r&&t()}))},i.onRetryAll=function(e,t){var r=this;this.uploaderEvents[e].on("retry-all",(function(n){r.uppy.getFile(e)&&t()}))},i.onCancelAll=function(e,t){var r=this;this.uploaderEvents[e].on("cancel-all",(function(){r.uppy.getFile(e)&&t()}))},i.handleUpload=function(e){var t=this;if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();0!==this.opts.limit||this.opts.__queue||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");var r=e.map((function(e){return t.uppy.getFile(e)}));if(this.opts.bundle){if(r.some((function(e){return e.isRemote})))throw new Error("Can\u2019t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");return this.uploadBundle(r)}return this.uploadFiles(r).then((function(){return null}))},i.install=function(){if(this.opts.bundle){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Sd({},e,{individualCancellation:!1})})}this.uppy.addUploader(this.handleUpload)},i.uninstall=function(){if(this.opts.bundle){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Sd({},e,{individualCancellation:!0})})}this.uppy.removeUploader(this.handleUpload)},n}(le.Plugin),gd.VERSION="1.7.4",md),Ad={__esModule:!0};Ad.default=Nd,Ad.getFieldData=Md;var Fd,Rd,xd={"[object HTMLCollection]":!0,"[object NodeList]":!0,"[object RadioNodeList]":!0},Ud={button:!0,fieldset:!0,reset:!0,submit:!0},Td={checkbox:!0,radio:!0},Dd=/^\s+|\s+$/g,Bd=Array.prototype.slice,Id=Object.prototype.toString;function Nd(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{trim:!1};if(!e)throw new Error("A form is required by getFormData, was given form="+e);for(var r={},n=void 0,i=[],o={},s=0,a=e.elements.length;s2&&void 0!==arguments[2]?arguments[2]:{trim:!1};if(!e)throw new Error("A form is required by getFieldData, was given form="+e);if(!t&&"[object String]"!==Id.call(t))throw new Error("A field name is required by getFieldData, was given fieldName="+t);var n=e.elements[t];if(!n||n.disabled)return null;if(!xd[Id.call(n)])return jd(n,r.trim);for(var i=[],o=!0,s=0,a=n.length;s0?i:null}function jd(e,t){var r=null,n=e.type;if("select-one"===n)return e.options.length&&(r=e.options[e.selectedIndex].value),r;if("select-multiple"===n){r=[];for(var i=0,o=e.options.length;i target element passed in options to operate, none was found","error")},i.uninstall=function(){this.form.removeEventListener("submit",this.handleFormSubmit),this.uppy.off("upload",this.handleUploadStart),this.uppy.off("complete",this.handleSuccess)},n}(qd),Fd.VERSION="1.3.30",Rd),Xd={},Yd="undefined"!=typeof navigator&&"serviceWorker"in navigator,Gd=function(){function e(e){this.ready=new Promise((function(e,t){Yd?navigator.serviceWorker.controller?e():navigator.serviceWorker.addEventListener("controllerchange",(function(){e()})):t(new Error("Unsupported"))})),this.name=e.storeName}var t=e.prototype;return t.list=function(){var e=this,t={},r=new Promise((function(e,r){t.resolve=e,t.reject=r}));console.log("Loading stored blobs from Service Worker");var n=function r(n){if(n.data.store===e.name)switch(n.data.type){case"uppy/ALL_FILES":t.resolve(n.data.files),navigator.serviceWorker.removeEventListener("message",r)}};return this.ready.then((function(){navigator.serviceWorker.addEventListener("message",n),navigator.serviceWorker.controller.postMessage({type:"uppy/GET_FILES",store:e.name})})),r},t.put=function(e){var t=this;return this.ready.then((function(){navigator.serviceWorker.controller.postMessage({type:"uppy/ADD_FILE",store:t.name,file:e})}))},t.delete=function(e){var t=this;return this.ready.then((function(){navigator.serviceWorker.controller.postMessage({type:"uppy/REMOVE_FILE",store:t.name,fileID:e})}))},e}();Gd.isSupported=Yd,Xd=Gd;var Kd={};function $d(){return($d=Object.assign||function(e){for(var t=1;tthis.opts.maxFileSize?Promise.reject(new Error("File is too big to store.")):this.getSize().then((function(e){return e>t.opts.maxTotalSize?Promise.reject(new Error("No space left")):t.ready})).then((function(r){return ef(r.transaction(["files"],"readwrite").objectStore("files").add({id:t.key(e.id),fileID:e.id,store:t.name,expires:Date.now()+t.opts.expires,data:e.data}))}))},t.delete=function(e){var t=this;return this.ready.then((function(r){return ef(r.transaction(["files"],"readwrite").objectStore("files").delete(t.key(e)))}))},e.cleanup=function(){return Zd("uppy-blobs").then((function(e){var t=e.transaction(["files"],"readwrite").objectStore("files").index("expires").openCursor(IDBKeyRange.upperBound(Date.now()));return new Promise((function(r,n){t.onsuccess=function(t){var n=t.target.result;if(n){var i=n.value;console.log("[IndexedDBStore] Deleting record",i.fileID,"of size",q(i.data.size),"- expired on",new Date(i.expires)),n.delete(),n.continue()}else r(e)},t.onerror=n}))})).then((function(e){e.close()}))},e}();function nf(){return(nf=Object.assign||function(e){for(var t=1;t0?Promise.all([n.loadFileBlobsFromServiceWorker(),n.loadFileBlobsFromIndexedDB()]).then((function(e){var t=cf({},e[0],e[1]);n.onBlobsLoaded(t)})):(n.uppy.log("[GoldenRetriever] No files need to be loaded, only restoring processing state..."),n.onBlobsLoaded([]))},n.type="debugger",n.id=n.opts.id||"GoldenRetriever",n.title="Golden Retriever",n.opts=cf({},{expires:864e5,serviceWorker:!1},r),n.MetaDataStore=new lf({expires:n.opts.expires,storeName:t.getID()}),n.ServiceWorkerStore=null,n.opts.serviceWorker&&(n.ServiceWorkerStore=new Xd({storeName:t.getID()})),n.IndexedDBStore=new Kd(cf({expires:n.opts.expires},n.opts.indexedDB||{},{storeName:t.getID()})),n.saveFilesStateToLocalStorage=z(n.saveFilesStateToLocalStorage.bind(pf(n)),500,{leading:!0,trailing:!0}),n.restoreState=n.restoreState.bind(pf(n)),n.loadFileBlobsFromServiceWorker=n.loadFileBlobsFromServiceWorker.bind(pf(n)),n.loadFileBlobsFromIndexedDB=n.loadFileBlobsFromIndexedDB.bind(pf(n)),n.onBlobsLoaded=n.onBlobsLoaded.bind(pf(n)),n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,hf(t,r);var i=n.prototype;return i.restoreState=function(){var e=this.MetaDataStore.load();e&&(this.uppy.log("[GoldenRetriever] Recovered some state from Local Storage"),this.uppy.setState({currentUploads:e.currentUploads||{},files:e.files||{},recoveredState:e}),this.savedPluginData=e.pluginData)},i.getWaitingFiles=function(){var e={};return this.uppy.getFiles().forEach((function(t){t.progress&&t.progress.uploadStarted||(e[t.id]=t)})),e},i.getUploadingFiles=function(){var e=this,t={},r=this.uppy.getState().currentUploads;return r&&Object.keys(r).forEach((function(n){r[n].fileIDs.forEach((function(r){t[r]=e.uppy.getFile(r)}))})),t},i.saveFilesStateToLocalStorage=function(){var e=cf({},this.getWaitingFiles(),this.getUploadingFiles());if(0===Object.keys(e).length)return this.uppy.setState({recoveredState:null}),void lf.cleanup(this.uppy.opts.id);var t={};Object.keys(e).forEach((function(r){e[r].isRemote?t[r]=cf({},e[r],{isRestored:!0}):t[r]=cf({},e[r],{isRestored:!0,data:null,preview:null})}));var r={};this.uppy.emit("restore:get-data",(function(e){cf(r,e)}));var n=this.uppy.getState().currentUploads;this.MetaDataStore.save({currentUploads:n,files:t,pluginData:r})},i.loadFileBlobsFromServiceWorker=function(){var e=this;return this.ServiceWorkerStore?this.ServiceWorkerStore.list().then((function(t){var r=e.uppy.getFiles().filter((function(e){return!e.isRemote})),n=Object.keys(t).length;return n===r.length?(e.uppy.log("[GoldenRetriever] Successfully recovered "+n+" blobs from Service Worker!"),t):(e.uppy.log("[GoldenRetriever] No blobs found in Service Worker, trying IndexedDB now..."),{})})).catch((function(t){return e.uppy.log("[GoldenRetriever] Failed to recover blobs from Service Worker","warning"),e.uppy.log(t),{}})):Promise.resolve({})},i.loadFileBlobsFromIndexedDB=function(){var e=this;return this.IndexedDBStore.list().then((function(t){var r=Object.keys(t).length;return r>0?(e.uppy.log("[GoldenRetriever] Successfully recovered "+r+" blobs from IndexedDB!"),t):(e.uppy.log("[GoldenRetriever] No blobs found in IndexedDB"),{})})).catch((function(t){return e.uppy.log("[GoldenRetriever] Failed to recover blobs from IndexedDB","warning"),e.uppy.log(t),{}}))},i.onBlobsLoaded=function(e){var t=this,r=[],n=cf({},this.uppy.getState().files);Object.keys(e).forEach((function(i){var o=t.uppy.getFile(i);if(o){var s={data:e[i],isRestored:!0,isGhost:!1};n[i]=cf({},o,s)}else r.push(i)})),Object.keys(n).forEach((function(e){null===n[e].data&&(n[e]=cf({},n[e],{isGhost:!0}))})),this.uppy.setState({files:n}),this.uppy.emit("restored",this.savedPluginData),r.length&&this.deleteBlobs(r).then((function(){t.uppy.log("[GoldenRetriever] Cleaned up "+r.length+" old files")})).catch((function(e){t.uppy.log("[GoldenRetriever] Could not clean up "+r.length+" old files","warning"),t.uppy.log(e)}))},i.deleteBlobs=function(e){var t=this,r=[];return e.forEach((function(e){t.ServiceWorkerStore&&r.push(t.ServiceWorkerStore.delete(e)),t.IndexedDBStore&&r.push(t.IndexedDBStore.delete(e))})),Promise.all(r)},i.install=function(){this.restoreState(),this.restoreBlobs(),this.uppy.on("file-added",this.addBlobToStores),this.uppy.on("file-editor:complete",this.replaceBlobInStores),this.uppy.on("file-removed",this.removeBlobFromStores),this.uppy.on("state-update",this.saveFilesStateToLocalStorage),this.uppy.on("restore-confirmed",this.handleRestoreConfirmed),this.uppy.on("restore-canceled",this.abortRestore),this.uppy.on("complete",this.handleComplete)},i.uninstall=function(){this.uppy.off("file-added",this.addBlobToStores),this.uppy.off("file-editor:complete",this.replaceBlobInStores),this.uppy.off("file-removed",this.removeBlobFromStores),this.uppy.off("state-update",this.saveFilesStateToLocalStorage),this.uppy.off("restore-confirmed",this.handleRestoreConfirmed),this.uppy.off("restore-canceled",this.abortRestore),this.uppy.off("complete",this.handleComplete)},n}(le.Plugin),sf.VERSION="1.4.1",af);function mf(){return(mf=Object.assign||function(e){for(var t=1;t