Файловый менеджер - Редактировать - /home/sibcards/public_html/Modules/LandingPage/Resources/assets/js/plugins/uppy.min.js
Назад
!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,n,r=function(e){var t;return function(n){return t||e(t={exports:{},parent:n},t.exports),t.exports}},o=r((function(e,t){var n=gp("socket.io-client");e.exports=t=o;var r=t.managers={};function o(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var o,i=bp(e),a=i.source,s=i.id,l=i.path,u=r[s]&&l in r[s].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||u?(n("ignoring socket cache for %s",a),o=dh(a,t)):(r[s]||(n("new io instance for %s",a),r[s]=dh(a,t)),o=r[s]),i.query&&!t.query&&(t.query=i.query),o.socket(i.path,t)}t.protocol=Ap.protocol,t.connect=o,t.Manager=dh,t.Socket=ih})),i=r((function(e,t){})),a=r((function(e,t){(function(e){(function(){"use strict";t.Buffer=n,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__=n.prototype,t}function n(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return i(e)}return r(e,t,n)}function r(t,r,o){if("string"==typeof t)return function(t,r){if("string"==typeof r&&""!==r||(r="utf8"),!n.isEncoding(r))throw new TypeError("Unknown encoding: "+r);var o=0|l(t,r),i=e(o),a=i.write(t,r);return a!==o&&(i=i.slice(0,a)),i}(t,r);if(ArrayBuffer.isView(t))return a(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(F(t,ArrayBuffer)||t&&F(t.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var o;return(o=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r)).__proto__=n.prototype,o}(t,r,o);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=t.valueOf&&t.valueOf();if(null!=i&&i!==t)return n.from(i,r,o);var u=function(t){if(n.isBuffer(t)){var r=0|s(t.length),o=e(r);return 0===o.length||t.copy(o,0,0,r),o}return void 0!==t.length?"number"!=typeof t.length||D(t.length)?e(0):a(t):"Buffer"===t.type&&Array.isArray(t.data)?a(t.data):void 0}(t);if(u)return u;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return n.from(t[Symbol.toPrimitive]("string"),r,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function i(t){return o(t),e(t<0?0:0|s(t))}function a(t){for(var n=t.length<0?0:0|s(t.length),r=e(n),o=0;o<n;o+=1)r[o]=255&t[o];return r}function s(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function l(e,t){if(n.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||F(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 r=e.length,o=arguments.length>2&&!0===arguments[2];if(!o&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return T(e).length;default:if(i)return o?-1:N(e).length;t=(""+t).toLowerCase(),i=!0}}function u(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function c(e,t,r,o,i){if(0===e.length)return-1;if("string"==typeof r?(o=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),D(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=n.from(t,o)),n.isBuffer(t))return 0===t.length?-1:p(e,t,r,o,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):p(e,[t],r,o,i);throw new TypeError("val must be string, number or Buffer")}function p(e,t,n,r,o){var i,a=1,s=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var c=-1;for(i=n;i<s;i++)if(u(e,i)===u(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===l)return c*a}else-1!==c&&(i-=i-c),c=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){for(var p=!0,d=0;d<l;d++)if(u(e,i+d)!==u(t,d)){p=!1;break}if(p)return i}return-1}function d(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(D(s))return a;e[n+a]=s}return a}function h(e,t,n,r){return R(N(t,e.length-n),e,n,r)}function f(e,t,n,r){return R(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function m(e,t,n,r){return f(e,t,n,r)}function v(e,t,n,r){return R(T(t),e,n,r)}function g(e,t,n,r){return R(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function y(e,t,n){return 0===t&&n===e.length?io.fromByteArray(e):io.fromByteArray(e.slice(t,n))}function b(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,l,u=e[o],c=null,p=u>239?4:u>223?3:u>191?2:1;if(o+p<=n)switch(p){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(l=(15&u)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,p=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),o+=p}return function(e){var t=e.length;if(t<=_)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=_));return n}(r)}n.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(t){return!1}}(),n.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.buffer}}),Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){if(n.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&n[Symbol.species]===n&&Object.defineProperty(n,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),n.poolSize=8192,n.from=function(e,t,n){return r(e,t,n)},n.prototype.__proto__=Uint8Array.prototype,n.__proto__=Uint8Array,n.alloc=function(t,n,r){return function(t,n,r){return o(t),t<=0?e(t):void 0!==n?"string"==typeof r?e(t).fill(n,r):e(t).fill(n):e(t)}(t,n,r)},n.allocUnsafe=function(e){return i(e)},n.allocUnsafeSlow=function(e){return i(e)},n.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==n.prototype},n.compare=function(e,t){if(F(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),F(t,Uint8Array)&&(t=n.from(t,t.offset,t.byteLength)),!n.isBuffer(e)||!n.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,o=t.length,i=0,a=Math.min(r,o);i<a;++i)if(e[i]!==t[i]){r=e[i],o=t[i];break}return r<o?-1:o<r?1:0},n.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return n.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var o=n.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(F(a,Uint8Array)&&(a=n.from(a)),!n.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(o,i),i+=a.length}return o},n.byteLength=l,n.prototype._isBuffer=!0,n.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)u(this,t,t+1);return this},n.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)u(this,t,t+3),u(this,t+1,t+2);return this},n.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)u(this,t,t+7),u(this,t+1,t+6),u(this,t+2,t+5),u(this,t+3,t+4);return this},n.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?b(this,0,e):function(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,n);case"utf8":case"utf-8":return b(this,t,n);case"ascii":return w(this,t,n);case"latin1":case"binary":return C(this,t,n);case"base64":return y(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},n.prototype.toLocaleString=n.prototype.toString,n.prototype.equals=function(e){if(!n.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===n.compare(this,e)},n.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},n.prototype.compare=function(e,t,r,o,i){if(F(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),!n.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===r&&(r=e?e.length:0),void 0===o&&(o=0),void 0===i&&(i=this.length),t<0||r>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&t>=r)return 0;if(o>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(o>>>=0),s=(r>>>=0)-(t>>>=0),l=Math.min(a,s),u=this.slice(o,i),c=e.slice(t,r),p=0;p<l;++p)if(u[p]!==c[p]){a=u[p],s=c[p];break}return a<s?-1:s<a?1:0},n.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},n.prototype.indexOf=function(e,t,n){return c(this,e,t,n,!0)},n.prototype.lastIndexOf=function(e,t,n){return c(this,e,t,n,!1)},n.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return d(this,e,t,n);case"utf8":case"utf-8":return h(this,e,t,n);case"ascii":return f(this,e,t,n);case"latin1":case"binary":return m(this,e,t,n);case"base64":return v(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _=4096;function w(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function C(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function S(e,t,n){var r,o=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>o)&&(n=o);for(var i="",a=t;a<n;++a)i+=(r=e[a])<16?"0"+r.toString(16):r.toString(16);return i}function k(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function x(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,o,i,a){if(!n.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+o>e.length)throw new RangeError("Index out of range")}function E(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(e,t,n,r,o){return t=+t,n>>>=0,o||E(e,0,n,4),go.write(e,t,n,r,23,4),n+4}function A(e,t,n,r,o){return t=+t,n>>>=0,o||E(e,0,n,8),go.write(e,t,n,r,52,8),n+8}n.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var o=this.subarray(e,t);return o.__proto__=n.prototype,o},n.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},n.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},n.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},n.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},n.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},n.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},n.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},n.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},n.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||x(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},n.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},n.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},n.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},n.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},n.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},n.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),go.read(this,e,!0,23,4)},n.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),go.read(this,e,!1,23,4)},n.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),go.read(this,e,!0,52,8)},n.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),go.read(this,e,!1,52,8)},n.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},n.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||P(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},n.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,255,0),this[t]=255&e,t+1},n.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(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},n.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(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},n.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);P(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},n.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);P(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},n.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},n.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||P(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},n.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||P(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},n.prototype.writeFloatLE=function(e,t,n){return O(this,e,t,!0,n)},n.prototype.writeFloatBE=function(e,t,n){return O(this,e,t,!1,n)},n.prototype.writeDoubleLE=function(e,t,n){return A(this,e,t,!0,n)},n.prototype.writeDoubleBE=function(e,t,n){return A(this,e,t,!1,n)},n.prototype.copy=function(e,t,r,o){if(!n.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),o||0===o||(o=this.length),t>=e.length&&(t=e.length),t||(t=0),o>0&&o<r&&(o=r),o===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-t<o-r&&(o=e.length-t+r);var i=o-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,o);else if(this===e&&r<t&&t<o)for(var a=i-1;a>=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,o),t);return i},n.prototype.fill=function(e,t,r,o){if("string"==typeof e){if("string"==typeof t?(o=t,t=0,r=this.length):"string"==typeof r&&(o=r,r=this.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("string"==typeof o&&!n.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(1===e.length){var i=e.charCodeAt(0);("utf8"===o&&i<128||"latin1"===o)&&(e=i)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var s=n.isBuffer(e)?e:n.from(e,o),l=s.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=s[a%l]}return this};var U=/[^+/0-9A-Za-z-_]/g;function N(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function T(e){return io.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function R(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function F(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function D(e){return e!=e}}).call(this)}).call(this,a({}).Buffer)})),s=e={};function l(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===l||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:l}catch(e){t=l}try{n="function"==typeof clearTimeout?clearTimeout:u}catch(e){n=u}}();var p,d=[],h=!1,f=-1;function m(){h&&p&&(h=!1,p.length?d=p.concat(d):f=-1,d.length&&v())}function v(){if(!h){var e=c(m);h=!0;for(var t=d.length;t;){for(p=d,d=[];++f<t;)p&&p[f].run();f=-1,t=d.length}p=null,h=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===u||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function y(){}s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new g(e,t)),1!==d.length||h||c(v)},g.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=y,s.addListener=y,s.once=y,s.off=y,s.removeListener=y,s.removeAllListeners=y,s.emit=y,s.prependListener=y,s.prependOnceListener=y,s.listeners=function(e){return[]},s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0};var b={exports:{}};(function(e,t){(function(){!function(e,t){"object"==typeof b.exports?b.exports=t():e.ES6Promise=t()}(this,(function(){"use strict";function n(e){return"function"==typeof e}var r=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=0,i=void 0,a=void 0,s=function(e,t){f[o]=e,f[o+1]=t,2===(o+=2)&&(a?a(m):_())},l="undefined"!=typeof window?window:void 0,u=l||{},c=u.MutationObserver||u.WebKitMutationObserver,p="undefined"==typeof self&&void 0!==e&&"[object process]"==={}.toString.call(e),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function h(){var e=setTimeout;return function(){return e(m,1)}}var f=new Array(1e3);function m(){for(var e=0;e<o;e+=2)(0,f[e])(f[e+1]),f[e]=void 0,f[e+1]=void 0;o=0}var v,g,y,b,_=void 0;function w(e,t){var n=this,r=new this.constructor(k);void 0===r[S]&&F(r);var o=n._state;if(o){var i=arguments[o-1];s((function(){return T(o,r,i,n._result)}))}else U(n,r,e,t);return r}function C(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=new this(k);return P(t,e),t}p?_=function(){return e.nextTick(m)}:c?(g=0,y=new c(m),b=document.createTextNode(""),y.observe(b,{characterData:!0}),_=function(){b.data=g=++g%2}):d?((v=new MessageChannel).port1.onmessage=m,_=function(){return v.port2.postMessage(0)}):_=void 0===l?function(){try{var e=Function("return this")().require("vertx");return void 0!==(i=e.runOnLoop||e.runOnContext)?function(){i(m)}:h()}catch(t){return h()}}():h();var S=Math.random().toString(36).substring(2);function k(){}function x(e,t,r){t.constructor===e.constructor&&r===w&&t.constructor.resolve===C?function(e,t){1===t._state?O(e,t._result):2===t._state?A(e,t._result):U(t,void 0,(function(t){return P(e,t)}),(function(t){return A(e,t)}))}(e,t):void 0===r?O(e,t):n(r)?function(e,t,n){s((function(e){var r=!1,o=function(n,o,i,a){try{n.call(o,(function(n){r||(r=!0,t!==n?P(e,n):O(e,n))}),(function(t){r||(r=!0,A(e,t))}))}catch(s){return s}}(n,t,0,0,e._label);!r&&o&&(r=!0,A(e,o))}),e)}(e,t,r):O(e,t)}function P(e,t){if(e===t)A(e,new TypeError("You cannot resolve a promise with itself"));else if(o=typeof(r=t),null===r||"object"!==o&&"function"!==o)O(e,t);else{var n=void 0;try{n=t.then}catch(Mp){return void A(e,Mp)}x(e,t,n)}var r,o}function E(e){e._onerror&&e._onerror(e._result),N(e)}function O(e,t){void 0===e._state&&(e._result=t,e._state=1,0!==e._subscribers.length&&s(N,e))}function A(e,t){void 0===e._state&&(e._state=2,e._result=t,s(E,e))}function U(e,t,n,r){var o=e._subscribers,i=o.length;e._onerror=null,o[i]=t,o[i+1]=n,o[i+2]=r,0===i&&e._state&&s(N,e)}function N(e){var t=e._subscribers,n=e._state;if(0!==t.length){for(var r=void 0,o=void 0,i=e._result,a=0;a<t.length;a+=3)r=t[a],o=t[a+n],r?T(n,r,o,i):o(i);e._subscribers.length=0}}function T(e,t,r,o){var i=n(r),a=void 0,s=void 0,l=!0;if(i){try{a=r(o)}catch(u){l=!1,s=u}if(t===a)return void A(t,new TypeError("A promises callback cannot return that same promise."))}else a=o;void 0!==t._state||(i&&l?P(t,a):!1===l?A(t,s):1===e?O(t,a):2===e&&A(t,a))}var R=0;function F(e){e[S]=R++,e._state=void 0,e._result=void 0,e._subscribers=[]}var D=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(k),this.promise[S]||F(this.promise),r(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&O(this.promise,this._result))):A(this.promise,new Error("Array Methods must be provided an Array"))}return e.prototype._enumerate=function(e){for(var t=0;void 0===this._state&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var n=this._instanceConstructor,r=n.resolve;if(r===C){var o=void 0,i=void 0,a=!1;try{o=e.then}catch(l){a=!0,i=l}if(o===w&&void 0!==e._state)this._settledAt(e._state,t,e._result);else if("function"!=typeof o)this._remaining--,this._result[t]=e;else if(n===M){var s=new n(k);a?A(s,i):x(s,e,o),this._willSettleAt(s,t)}else this._willSettleAt(new n((function(t){return t(e)})),t)}else this._willSettleAt(r(e),t)},e.prototype._settledAt=function(e,t,n){var r=this.promise;void 0===r._state&&(this._remaining--,2===e?A(r,n):this._result[t]=n),0===this._remaining&&O(r,this._result)},e.prototype._willSettleAt=function(e,t){var n=this;U(e,void 0,(function(e){return n._settledAt(1,t,e)}),(function(e){return n._settledAt(2,t,e)}))},e}(),M=function(){function e(t){this[S]=R++,this._result=this._state=void 0,this._subscribers=[],k!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(e,t){try{t((function(t){P(e,t)}),(function(t){A(e,t)}))}catch(n){A(e,n)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var t=this.constructor;return n(e)?this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){throw n}))})):this.then(e,e)},e}();return M.prototype.then=w,M.all=function(e){return new D(this,e).promise},M.race=function(e){var t=this;return r(e)?new t((function(n,r){for(var o=e.length,i=0;i<o;i++)t.resolve(e[i]).then(n,r)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))},M.resolve=C,M.reject=function(e){var t=new this(k);return A(t,e),t},M._setScheduler=function(e){a=e},M._setAsap=function(e){s=e},M._asap=s,M.polyfill=function(){var e=void 0;if(void 0!==t)e=t;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(o){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=e.Promise;if(n){var r=null;try{r=Object.prototype.toString.call(n.resolve())}catch(o){}if("[object Promise]"===r&&!n.cast)return}e.Promise=M},M.Promise=M,M}))}).call(this)}).call(this,e,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});(b=b.exports).polyfill();var _,w={exports:{}};_=function(e){"use strict";var t="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==t&&t,n="URLSearchParams"in t,r="Symbol"in t&&"iterator"in Symbol,o="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),i="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function u(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 r&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?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 h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function m(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&o&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=v(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):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=h(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?h(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(m)}),this.text=function(){var e,t,n,r=h(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,n=f(t=new FileReader),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i&&(this.formData=function(){return this.text().then(_)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=u(e),t=c(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},d.prototype.delete=function(e){delete this.map[u(e)]},d.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},d.prototype.set=function(e,t){this.map[u(e)]=c(t)},d.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),p(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),p(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),p(e)},r&&(d.prototype[Symbol.iterator]=d.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,o=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,o||null==e._bodyInit||(o=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(r=(n=t.method||this.method||"GET").toUpperCase(),y.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var i=/([?&])_=[^&]*/;i.test(this.url)?this.url=this.url.replace(i,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function _(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function w(e,t){if(!(this instanceof w))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 d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var C=[301,302,303,307,308];w.redirect=function(e,t){if(-1===C.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(Cd){e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function S(n,r){return new Promise((function(i,s){var l=new b(n,r);if(l.signal&&l.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var u=new XMLHttpRequest;function p(){u.abort()}u.onload=function(){var e,t,n={status:u.status,statusText:u.statusText,headers:(e=u.getAllResponseHeaders()||"",t=new d,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 n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in u?u.responseURL:n.headers.get("X-Request-URL");var r="response"in u?u.response:u.responseText;setTimeout((function(){i(new w(r,n))}),0)},u.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},u.onabort=function(){setTimeout((function(){s(new e.DOMException("Aborted","AbortError"))}),0)},u.open(l.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(n){return e}}(l.url),!0),"include"===l.credentials?u.withCredentials=!0:"omit"===l.credentials&&(u.withCredentials=!1),"responseType"in u&&(o?u.responseType="blob":a&&l.headers.get("Content-Type")&&-1!==l.headers.get("Content-Type").indexOf("application/octet-stream")&&(u.responseType="arraybuffer")),!r||"object"!=typeof r.headers||r.headers instanceof d?l.headers.forEach((function(e,t){u.setRequestHeader(t,e)})):Object.getOwnPropertyNames(r.headers).forEach((function(e){u.setRequestHeader(e,c(r.headers[e]))})),l.signal&&(l.signal.addEventListener("abort",p),u.onreadystatechange=function(){4===u.readyState&&l.signal.removeEventListener("abort",p)}),u.send(void 0===l._bodyInit?null:l._bodyInit)}))}S.polyfill=!0,t.fetch||(t.fetch=S,t.Headers=d,t.Request=b,t.Response=w),e.Headers=d,e.Request=b,e.Response=w,e.fetch=S,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof w.exports?_(w.exports):_(this.WHATWGFetch={}),w=w.exports;var C=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function S(){return(S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var k,x=function(){function e(e){var t=this;this.locale={strings:{},pluralize:function(e){return 1===e?0:1}},Array.isArray(e)?e.forEach((function(e){return t._apply(e)})):this._apply(e)}var t=e.prototype;return t._apply=function(e){if(e&&e.strings){var t=this.locale;this.locale=S({},t,{strings:S({},t.strings,e.strings)}),this.locale.pluralize=e.pluralize||t.pluralize}},t.interpolate=function(e,t){var n=String.prototype,r=n.split,o=n.replace,i=/\$/g,a=[e];for(var s in t)if("_"!==s&&C(t,s)){var l=t[s];"string"==typeof l&&(l=o.call(t[s],i,"$$$$")),a=u(a,new RegExp("%\\{"+s+"\\}","g"),l)}return a;function u(e,t,n){var o=[];return e.forEach((function(e){if("string"!=typeof e)return o.push(e);r.call(e,t).forEach((function(e,t,r){""!==e&&o.push(e),t<r.length-1&&o.push(n)}))})),o}},t.translate=function(e,t){return this.translateArray(e,t).join("")},t.translateArray=function(e,t){if(!C(this.locale.strings,e))throw new Error("missing string: "+e);var n=this.locale.strings[e];if("object"==typeof n){if(t&&void 0!==t.smart_count){var r=this.locale.pluralize(t.smart_count);return this.interpolate(n[r],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}return this.interpolate(n,t)},e}(),P=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,o,i,a,s){var l=function(e){for(var n=t[e]?t[e]:[],r=e.indexOf(":"),o=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],i=Object.keys(t),a=0,s=i.length;a<s;a++){var l=i[a];if("*"===l&&(n=n.concat(t[l])),2===o.length&&o[0]===l){n=n.concat(t[l]);break}}return n}(e);l.length&&function(e,t,n){for(var r=0,o=t.length;r<o&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}(e,l,[n,r,o,i,a,s])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,(function r(){n.apply(this,arguments),e.off(t,r)}))},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],o=0,i=r?r.length:0;o<i;o++)r[o]!==t&&n.push(r[o]);n.length?this._fns[e]=n:delete this._fns[e]},e},E=function(e,t){var n="000000000"+e;return n.substr(n.length-t)},O="object"==typeof window?window:self,A=Object.keys(O).length,U=E(((navigator.mimeTypes?navigator.mimeTypes.length:0)+navigator.userAgent.length).toString(36)+A.toString(36),4),N=function(){return U},T="undefined"!=typeof window&&(window.crypto||window.msCrypto)||"undefined"!=typeof self&&self.crypto;if(T){var R=Math.pow(2,32)-1;k=function(){return Math.abs(T.getRandomValues(new Uint32Array(1))[0]/R)}}else k=Math.random;var F=k,D={},M=0,B=Math.pow(36,4);function I(){return E((F()*B<<0).toString(36),4)}function L(){return M=M<B?M:0,++M-1}function j(){return"c"+(new Date).getTime().toString(36)+E(L().toString(36),4)+N()+(I()+I())}j.slug=function(){var e=(new Date).getTime().toString(36),t=L().toString(36).slice(-4),n=N().slice(0,1)+N().slice(-1),r=I().slice(-2);return e.slice(-2)+t+n+r},j.isCuid=function(e){return"string"==typeof e&&!!e.startsWith("c")},j.isSlug=function(e){if("string"!=typeof e)return!1;var t=e.length;return t>=7&&t<=10},j.fingerprint=N,D=j;var z={};(function(e){(function(){var t=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt,a="object"==typeof e&&e&&e.Object===Object&&e,s="object"==typeof self&&self&&self.Object===Object&&self,l=a||s||Function("return this")(),u=Object.prototype.toString,c=Math.max,p=Math.min,d=function(){return l.Date.now()};function h(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]"==u.call(e)}(e))return NaN;if(h(e)){var a="function"==typeof e.valueOf?e.valueOf():e;e=h(a)?a+"":a}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var s=r.test(e);return s||o.test(e)?i(e.slice(2),s?2:8):n.test(e)?NaN:+e}z=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return h(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),function(e,t,n){var r,o,i,a,s,l,u=0,m=!1,v=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,i=o;return r=o=void 0,u=t,a=e.apply(i,n)}function b(e){var n=e-l;return void 0===l||n>=t||n<0||v&&e-u>=i}function _(){var e=d();if(b(e))return w(e);s=setTimeout(_,function(e){var n=t-(e-l);return v?p(n,i-(e-u)):n}(e))}function w(e){return s=void 0,g&&r?y(e):(r=o=void 0,a)}function C(){var e=d(),n=b(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(_,t),m?y(e):a}(l);if(v)return s=setTimeout(_,t),y(l)}return void 0===s&&(s=setTimeout(_,t)),a}return t=f(t)||0,h(n)&&(m=!!n.leading,i=(v="maxWait"in n)?c(f(n.maxWait)||0,t):i,g="trailing"in n?!!n.trailing:g),C.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=o=s=void 0},C.flush=function(){return void 0===s?a:w(d())},C}(e,t,{leading:r,maxWait:t,trailing:o})}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var H,W=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1);e=Number(e/Math.pow(1024,r));var o=n[r];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+o:(t?"-":"")+e.toFixed(1)+" "+o};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,n,r=!0,o=this.parts,i=o.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;r&&t<i;t++)"*"!==o[t]&&(r=t<n.length&&o[t]===n[t]);r=r&&n}else r=!1;else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var a in r={},e)this.match(a)&&(r[a]=e[a]);return r},H=function(e,t,n){var r=new V(e,n||/[\/\.]/);return void 0!==t?r.match(t):r};var q,X=/[\/\+\.]/;function G(){return(G=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Y=function(){function e(){this.state={},this.callbacks=[]}var t=e.prototype;return t.getState=function(){return this.state},t.setState=function(e){var t=G({},this.state),n=G({},this.state,e);this.state=n,this._publish(t,n,e)},t.subscribe=function(e){var t=this;return this.callbacks.push(e),function(){t.callbacks.splice(t.callbacks.indexOf(e),1)}},t._publish=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach((function(e){e.apply(void 0,t)}))},e}();Y.VERSION="1.2.7",q=function(){return new Y};var $=function(e){var t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}},K={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"},J=function(e){var t=e.name?$(e.name).extension:null;return t=t?t.toLowerCase():null,e.type?e.type:t&&K[t]?K[t]:"application/octet-stream"};function Q(e){var t="";return e.replace(/[^A-Z0-9]/gi,(function(e){return t+="-"+function(e){return e.charCodeAt(0).toString(32)}(e),"/"}))+t}var Z=function(e){var t="uppy";return"string"==typeof e.name&&(t+="-"+Q(e.name.toLowerCase())),void 0!==e.type&&(t+="-"+e.type),e.meta&&"string"==typeof e.meta.relativePath&&(t+="-"+Q(e.meta.relativePath.toLowerCase())),void 0!==e.data.size&&(t+="-"+e.data.size),void 0!==e.data.lastModified&&(t+="-"+e.data.lastModified),t},ee=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1},te=function(e){if(null==e&&(e="undefined"!=typeof navigator?navigator.userAgent:null),!e)return!0;var t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;var n=t[1].split("."),r=n[0],o=n[1];return r=parseInt(r,10),o=parseInt(o,10),r<15||15===r&&o<15063||r>18||18===r&&o>=18218};function ne(e){return 2!==e.length?0+e:e}var re=function(){var e=new Date;return ne(e.getHours().toString())+":"+ne(e.getMinutes().toString())+":"+ne(e.getSeconds().toString())},oe={justErrorsLogger:{debug:function(){},warn:function(){},error:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).error.apply(e,["[Uppy] ["+re()+"]"].concat(n))}},debugLogger:{debug:function(){for(var e=console.debug||console.log,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];e.call.apply(e,[console,"[Uppy] ["+re()+"]"].concat(n))},warn:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).warn.apply(e,["[Uppy] ["+re()+"]"].concat(n))},error:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=console).error.apply(e,["[Uppy] ["+re()+"]"].concat(n))}}},ie={exports:{}};!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};ie.exports=N}(),ie=ie.exports;var ae=function(e){return e&&"object"==typeof e&&e.nodeType===Node.ELEMENT_NODE},se=function(e,t){return void 0===t&&(t=document),"string"==typeof e?t.querySelector(e):ae(e)?e:void 0};function le(){return(le=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ue,ce=function(){function e(e,t){this.uppy=e,this.opts=t||{},this.update=this.update.bind(this),this.mount=this.mount.bind(this),this.install=this.install.bind(this),this.uninstall=this.uninstall.bind(this)}var t=e.prototype;return t.getPluginState=function(){return this.uppy.getState().plugins[this.id]||{}},t.setPluginState=function(e){var t,n=this.uppy.getState().plugins;this.uppy.setState({plugins:le({},n,(t={},t[this.id]=le({},n[this.id],e),t))})},t.setOptions=function(e){this.opts=le({},this.opts,e),this.setPluginState()},t.update=function(e){void 0!==this.el&&this._updateUI&&this._updateUI(e)},t.afterUpdate=function(){},t.onMount=function(){},t.mount=function(t,n){var r,o,i,a,s=this,l=n.id,u=se(t);if(u)return this.isTargetDOMEl=!0,this.rerender=function(e){s.uppy.getPlugin(s.id)&&(s.el=ie.render(s.render(e),u,s.el),s.afterUpdate())},this._updateUI=(r=this.rerender,o=null,i=null,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i=t,o||(o=Promise.resolve().then((function(){return o=null,r.apply(void 0,i)}))),o}),this.uppy.log("Installing "+l+" to a DOM element '"+t+"'"),this.opts.replaceTargetContent&&(u.innerHTML=""),this.el=ie.render(this.render(this.uppy.getState()),u),this.onMount(),this.el;if("object"==typeof t&&t instanceof e)a=t;else if("function"==typeof t){var c=t;this.uppy.iteratePlugins((function(e){if(e instanceof c)return a=e,!1}))}if(a)return this.uppy.log("Installing "+l+" to "+a.id),this.parent=a,this.el=a.addTarget(n),this.onMount(),this.el;this.uppy.log("Not installing "+l);var p="Invalid target option given to "+l+".";throw new Error(p+="function"==typeof t?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> 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;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function de(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function he(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ve(e,t)}function fe(e){var t="function"==typeof Map?new Map:void 0;return(fe=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return me(e,arguments,ge(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),ve(r,e)})(e)}function me(e,t,n){return(me=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&ve(o,n.prototype),o}).apply(null,arguments)}function ve(e,t){return(ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ge(e){return(ge=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ye=oe.justErrorsLogger,be=oe.debugLogger,_e=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).isRestriction=!0,t}return he(t,e),t}(fe(Error));"undefined"==typeof AggregateError&&(AggregateError=function(e){function t(t,n){var r;return(r=e.call(this,t)||this).errors=n,r}return he(t,e),t}(fe(Error)));var we=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).isRestriction=!0,t}return he(t,e),t}(AggregateError),Ce=function(){function e(e){var t=this;this.defaultLocale={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",exceedsSize2:"%{backwardsCompat} %{size}",exceedsSize:"%{file} exceeds maximum allowed size of",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noNewAlreadyUploading:"Cannot add new files: already uploading",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},selectAllFilesFromFolderNamed:"Select all files from folder %{name}",unselectAllFilesFromFolderNamed:"Unselect all files from folder %{name}",selectFileNamed:"Select file %{name}",unselectFileNamed:"Unselect file %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",backToSearch:"Back to Search",emptyFolderAdded:"No files were added from empty folder",folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}};var n={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,debug:!1,restrictions:{maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},meta:{},onBeforeFileAdded:function(e){return e},onBeforeUpload:function(e){return e},store:q(),logger:ye,infoTimeout:5e3};if(this.opts=pe({},n,e,{restrictions:pe({},n.restrictions,e&&e.restrictions)}),e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=be),this.log("Using Core v"+this.constructor.VERSION),this.opts.restrictions.allowedFileTypes&&null!==this.opts.restrictions.allowedFileTypes&&!Array.isArray(this.opts.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");this.i18nInit(),this.plugins={},this.getState=this.getState.bind(this),this.getPlugin=this.getPlugin.bind(this),this.setFileMeta=this.setFileMeta.bind(this),this.setFileState=this.setFileState.bind(this),this.log=this.log.bind(this),this.info=this.info.bind(this),this.hideInfo=this.hideInfo.bind(this),this.addFile=this.addFile.bind(this),this.removeFile=this.removeFile.bind(this),this.pauseResume=this.pauseResume.bind(this),this.validateRestrictions=this.validateRestrictions.bind(this),this.calculateProgress=z(this.calculateProgress.bind(this),500,{leading:!0,trailing:!0}),this.updateOnlineStatus=this.updateOnlineStatus.bind(this),this.resetProgress=this.resetProgress.bind(this),this.pauseAll=this.pauseAll.bind(this),this.resumeAll=this.resumeAll.bind(this),this.retryAll=this.retryAll.bind(this),this.cancelAll=this.cancelAll.bind(this),this.retryUpload=this.retryUpload.bind(this),this.upload=this.upload.bind(this),this.emitter=P(),this.on=this.on.bind(this),this.off=this.off.bind(this),this.once=this.emitter.once.bind(this.emitter),this.emit=this.emitter.emit.bind(this.emitter),this.preProcessors=[],this.uploaders=[],this.postProcessors=[],this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{uploadProgress:te(),individualCancellation:!0,resumableUploads:!1},totalProgress:0,meta:pe({},this.opts.meta),info:{isHidden:!0,type:"info",message:""},recoveredState:null}),this.storeUnsubscribe=this.store.subscribe((function(e,n,r){t.emit("state-update",e,n,r),t.updateAll(n)})),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),this.addListeners()}var t,n,r=e.prototype;return r.on=function(e,t){return this.emitter.on(e,t),this},r.off=function(e,t){return this.emitter.off(e,t),this},r.updateAll=function(e){this.iteratePlugins((function(t){t.update(e)}))},r.setState=function(e){this.store.setState(e)},r.getState=function(){return this.store.getState()},r.setFileState=function(e,t){var n;if(!this.getState().files[e])throw new Error("Can\u2019t set state for "+e+" (the file could have been removed)");this.setState({files:pe({},this.getState().files,(n={},n[e]=pe({},this.getState().files[e],t),n))})},r.i18nInit=function(){this.translator=new x([this.defaultLocale,this.opts.locale]),this.locale=this.translator.locale,this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator)},r.setOptions=function(e){this.opts=pe({},this.opts,e,{restrictions:pe({},this.opts.restrictions,e&&e.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((function(e){e.setOptions()})),this.setState()},r.resetProgress=function(){var e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t=pe({},this.getState().files),n={};Object.keys(t).forEach((function(r){var o=pe({},t[r]);o.progress=pe({},o.progress,e),n[r]=o})),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")},r.addPreProcessor=function(e){this.preProcessors.push(e)},r.removePreProcessor=function(e){var t=this.preProcessors.indexOf(e);-1!==t&&this.preProcessors.splice(t,1)},r.addPostProcessor=function(e){this.postProcessors.push(e)},r.removePostProcessor=function(e){var t=this.postProcessors.indexOf(e);-1!==t&&this.postProcessors.splice(t,1)},r.addUploader=function(e){this.uploaders.push(e)},r.removeUploader=function(e){var t=this.uploaders.indexOf(e);-1!==t&&this.uploaders.splice(t,1)},r.setMeta=function(e){var t=pe({},this.getState().meta,e),n=pe({},this.getState().files);Object.keys(n).forEach((function(t){n[t]=pe({},n[t],{meta:pe({},n[t].meta,e)})})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})},r.setFileMeta=function(e,t){var n=pe({},this.getState().files);if(n[e]){var r=pe({},n[e].meta,t);n[e]=pe({},n[e],{meta:r}),this.setState({files:n})}else this.log("Was trying to set metadata for a file that has been removed: ",e)},r.getFile=function(e){return this.getState().files[e]},r.getFiles=function(){var e=this.getState().files;return Object.keys(e).map((function(t){return e[t]}))},r.validateRestrictions=function(e,t){try{return this.checkRestrictions(e,t),{result:!0}}catch(Cd){return{result:!1,reason:Cd.message}}},r.checkRestrictions=function(e,t){void 0===t&&(t=this.getFiles());var n=this.opts.restrictions,r=n.maxFileSize,o=n.minFileSize,i=n.maxTotalFileSize,a=n.maxNumberOfFiles,s=n.allowedFileTypes;if(a&&t.length+1>a)throw new _e(""+this.i18n("youCanOnlyUploadX",{smart_count:a}));if(s&&!s.some((function(t){return t.indexOf("/")>-1?!!e.type&&function(e,t){function n(t){var n=H(t,e,X);return n&&n.length>=2}return t?n(t.split(";")[0]):n}(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.substr(1).toLowerCase()}))){var l=s.join(", ");throw new _e(this.i18n("youCanOnlyUploadFileTypes",{types:l}))}if(i&&null!=e.size){var u=0;if(u+=e.size,t.forEach((function(e){u+=e.size})),u>i)throw new _e(this.i18n("exceedsSize2",{backwardsCompat:this.i18n("exceedsSize"),size:W(i),file:e.name}))}if(r&&null!=e.size&&e.size>r)throw new _e(this.i18n("exceedsSize2",{backwardsCompat:this.i18n("exceedsSize"),size:W(r),file:e.name}));if(o&&null!=e.size&&e.size<o)throw new _e(this.i18n("inferiorSize",{size:W(o)}))},r.checkMinNumberOfFiles=function(e){var t=this.opts.restrictions.minNumberOfFiles;if(Object.keys(e).length<t)throw new _e(""+this.i18n("youHaveToAtLeastSelectX",{smart_count:t}))},r.checkRequiredMetaFields=function(e){for(var t=this.opts.restrictions.requiredMetaFields,n=Object.prototype.hasOwnProperty,r=[],o=Object.keys(e),i=0;i<o.length;i++)for(var a=this.getFile(o[i]),s=0;s<t.length;s++)if(!n.call(a.meta,t[s])||""===a.meta[t[s]]){var l=new _e(""+this.i18n("missingRequiredMetaFieldOnFile",{fileName:a.name}));r.push(l),this.showOrLogErrorAndThrow(l,{file:a,throwErr:!1})}if(r.length)throw new we(""+this.i18n("missingRequiredMetaField"),r)},r.showOrLogErrorAndThrow=function(e,t){var n=void 0===t?{}:t,r=n.showInformer,o=void 0===r||r,i=n.file,a=void 0===i?null:i,s=n.throwErr,l=void 0===s||s,u="object"==typeof e?e.message:e,c="object"==typeof e&&e.details?e.details:"",p=u;if(c&&(p+=" "+c),e.isRestriction?(this.log(p),this.emit("restriction-failed",a,e)):this.log(p,"error"),o&&this.info({message:u,details:c},"error",this.opts.infoTimeout),l)throw"object"==typeof e?e:new Error(e)},r.assertNewUploadAllowed=function(e){!1===this.getState().allowNewUpload&&this.showOrLogErrorAndThrow(new _e(this.i18n("noNewAlreadyUploading")),{file:e})},r.checkAndCreateFileStateObject=function(e,t){var n=J(t),r=t;r.type=n;var o,i=this.opts.onBeforeFileAdded(r,e);!1===i&&this.showOrLogErrorAndThrow(new _e("Cannot add the file because onBeforeFileAdded returned false."),{showInformer:!1,file:r}),"object"==typeof i&&i&&(r=i),o=r.name?r.name:"image"===n.split("/")[0]?n.split("/")[0]+"."+n.split("/")[1]:"noname";var a=$(o).extension,s=r.isRemote||!1,l=Z(r);e[l]&&!e[l].isGhost&&this.showOrLogErrorAndThrow(new _e(this.i18n("noDuplicates",{fileName:o})),{file:r});var u=r.meta||{};u.name=o,u.type=n;var c=isFinite(r.data.size)?r.data.size:null,p={source:r.source||"",id:l,name:o,extension:a||"",meta:pe({},this.getState().meta,u),type:n,data:r.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:c,uploadComplete:!1,uploadStarted:null},size:c,isRemote:s,remote:r.remote||"",preview:r.preview};try{var d=Object.keys(e).map((function(t){return e[t]}));this.checkRestrictions(p,d)}catch(Cd){this.showOrLogErrorAndThrow(Cd,{file:p})}return p},r.startIfAutoProceed=function(){var e=this;this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((function(){e.scheduledAutoProceed=null,e.upload().catch((function(t){t.isRestriction||e.log(t.stack||t.message||t)}))}),4))},r.addFile=function(e){var t;this.assertNewUploadAllowed(e);var n=this.getState().files,r=this.checkAndCreateFileStateObject(n,e);return n[r.id]&&n[r.id].isGhost&&(r=pe({},n[r.id],{data:e.data,isGhost:!1}),this.log("Replaced the blob in the restored ghost file: "+r.name+", "+r.id)),this.setState({files:pe({},n,(t={},t[r.id]=r,t))}),this.emit("file-added",r),this.emit("files-added",[r]),this.log("Added file: "+r.name+", "+r.id+", mime type: "+r.type),this.startIfAutoProceed(),r.id},r.addFiles=function(e){var t=this;this.assertNewUploadAllowed();for(var n=pe({},this.getState().files),r=[],o=[],i=0;i<e.length;i++)try{var a=this.checkAndCreateFileStateObject(n,e[i]);n[a.id]&&n[a.id].isGhost&&(a=pe({},n[a.id],{data:e[i].data,isGhost:!1}),this.log("Replaced blob in a ghost file: "+a.name+", "+a.id)),n[a.id]=a,r.push(a)}catch(l){l.isRestriction||o.push(l)}if(this.setState({files:n}),r.forEach((function(e){t.emit("file-added",e)})),this.emit("files-added",r),r.length>5?this.log("Added batch of "+r.length+" files"):Object.keys(r).forEach((function(e){t.log("Added file: "+r[e].name+"\n id: "+r[e].id+"\n type: "+r[e].type)})),r.length>0&&this.startIfAutoProceed(),o.length>0){var s="Multiple errors occurred while adding files:\n";if(o.forEach((function(e){s+="\n * "+e.message})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:s},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(o,s);var l=new Error(s);throw l.errors=o,l}},r.removeFiles=function(e,t){var n=this,r=this.getState(),o=r.files,i=r.currentUploads,a=pe({},o),s=pe({},i),l=Object.create(null);function u(e){return void 0===l[e]}e.forEach((function(e){o[e]&&(l[e]=o[e],delete a[e])})),Object.keys(s).forEach((function(e){var t=i[e].fileIDs.filter(u);0!==t.length?s[e]=pe({},i[e],{fileIDs:t}):delete s[e]}));var c={currentUploads:s,files:a};0===Object.keys(a).length&&(c.allowNewUpload=!0,c.error=null,c.recoveredState=null),this.setState(c),this.calculateTotalProgress();var p=Object.keys(l);p.forEach((function(e){n.emit("file-removed",l[e],t)})),p.length>5?this.log("Removed "+p.length+" files"):this.log("Removed files: "+p.join(", "))},r.removeFile=function(e,t){void 0===t&&(t=null),this.removeFiles([e],t)},r.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}},r.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 n=pe({},e[t],{isPaused:!0});e[t]=n})),this.setState({files:e}),this.emit("pause-all")},r.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 n=pe({},e[t],{isPaused:!1,error:null});e[t]=n})),this.setState({files:e}),this.emit("resume-all")},r.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 n=pe({},e[t],{isPaused:!1,error:null});e[t]=n})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});var n=this.createUpload(t,{forceAllowNewUpload:!0});return this.runUpload(n)},r.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})},r.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)},r.reset=function(){this.cancelAll()},r.logout=function(){this.iteratePlugins((function(e){e.provider&&e.provider.logout&&e.provider.logout()}))},r.calculateProgress=function(e,t){if(this.getFile(e.id)){var n=isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:pe({},this.getFile(e.id).progress,{bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:n?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)},r.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})),n=e.filter((function(e){return null==e.progress.bytesTotal}));if(0!==t.length){var r=t.reduce((function(e,t){return e+t.progress.bytesTotal}),0),o=r/t.length;r+=o*n.length;var i=0;t.forEach((function(e){i+=e.progress.bytesUploaded})),n.forEach((function(e){i+=o*(e.progress.percentage||0)/100}));var a=0===r?0:Math.round(i/r*100);a>100&&(a=100),this.setState({totalProgress:a}),this.emit("progress",a)}else{var s=100*e.length,l=n.reduce((function(e,t){return e+t.progress.percentage}),0),u=Math.round(l/s*100);this.setState({totalProgress:u})}},r.addListeners=function(){var e=this,t=function(t,n,r){var o=t.message||"Unknown error";t.details&&(o+=" "+t.details),e.setState({error:o}),null!=n&&"string"==typeof n.id&&e.setFileState(n.id,{error:o,response:r})};this.on("error",t),this.on("upload-error",(function(n,r,o){if(t(r,n,o),"object"==typeof r&&r.message){var i=new Error(r.message);i.details=r.message,r.details&&(i.details+=" "+r.details),i.message=e.i18n("failedToUpload",{file:n.name}),e.showOrLogErrorAndThrow(i,{throwErr:!1})}else e.showOrLogErrorAndThrow(r,{throwErr:!1})})),this.on("upload",(function(){e.setState({error:null})})),this.on("upload-started",(function(t){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,n){if(e.getFile(t.id)){var r=e.getFile(t.id).progress;e.setFileState(t.id,{progress:pe({},r,{postprocess:e.postProcessors.length>0?{mode:"indeterminate"}:null,uploadComplete:!0,percentage:100,bytesUploaded:r.bytesTotal}),response:n,uploadURL:n.uploadURL,isPaused:!1}),null==t.size&&e.setFileState(t.id,{size:n.bytesUploaded||r.bytesTotal}),e.calculateTotalProgress()}else e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("preprocess-progress",(function(t,n){e.getFile(t.id)?e.setFileState(t.id,{progress:pe({},e.getFile(t.id).progress,{preprocess:n})}):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 n=pe({},e.getState().files);n[t.id]=pe({},n[t.id],{progress:pe({},n[t.id].progress)}),delete n[t.id].progress.preprocess,e.setState({files:n})}else e.log("Not setting progress for a file that has been removed: "+t.id)})),this.on("postprocess-progress",(function(t,n){e.getFile(t.id)?e.setFileState(t.id,{progress:pe({},e.getState().files[t.id].progress,{postprocess:n})}):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 n=pe({},e.getState().files);n[t.id]=pe({},n[t.id],{progress:pe({},n[t.id].progress)}),delete n[t.id].progress.postprocess,e.setState({files:n})}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))},r.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)},r.getID=function(){return this.opts.id},r.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 n=new e(this,t),r=n.id;if(this.plugins[n.type]=this.plugins[n.type]||[],!r)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");var o=this.getPlugin(r);if(o){var i="Already found a plugin named '"+o.id+"'. Tried to use: '"+r+"'.\nUppy plugins must have unique `id` options. See https://uppy.io/docs/plugins/#id.";throw new Error(i)}return e.VERSION&&this.log("Using "+r+" v"+e.VERSION),this.plugins[n.type].push(n),n.install(),this},r.getPlugin=function(e){var t=null;return this.iteratePlugins((function(n){if(n.id===e)return t=n,!1})),t},r.iteratePlugins=function(e){var t=this;Object.keys(this.plugins).forEach((function(n){t.plugins[n].forEach(e)}))},r.removePlugin=function(e){var t;this.log("Removing plugin "+e.id),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();var n=this.plugins[e.type].slice(),r=ee(n,(function(t){return t.id===e.id}));-1!==r&&(n.splice(r,1),this.plugins[e.type]=n);var o={plugins:pe({},this.getState().plugins,(t={},t[e.id]=void 0,t))};this.setState(o)},r.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)}))},r.info=function(e,t,n){void 0===t&&(t="info"),void 0===n&&(n=3e3);var r="object"==typeof e;this.setState({info:{isHidden:!1,type:t,message:r?e.message:e,details:r?e.details:null}}),this.emit("info-visible"),clearTimeout(this.infoTimeoutID),this.infoTimeoutID=0!==n?setTimeout(this.hideInfo,n):void 0},r.hideInfo=function(){var e=pe({},this.getState().info,{isHidden:!0});this.setState({info:e}),this.emit("info-hidden")},r.log=function(e,t){var n=this.opts.logger;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e)}},r.run=function(){return this.log("Calling run() is no longer necessary.","warning"),this},r.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")))},r.createUpload=function(e,t){var n;void 0===t&&(t={});var r=t.forceAllowNewUpload,o=void 0!==r&&r,i=this.getState(),a=i.allowNewUpload,s=i.currentUploads;if(!a&&!o)throw new Error("Cannot create a new upload: already uploading.");var l=D();return this.emit("upload",{id:l,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploads,currentUploads:pe({},s,(n={},n[l]={fileIDs:e,step:0,result:{}},n))}),l},r.getUpload=function(e){return this.getState().currentUploads[e]},r.addResultData=function(e,t){var n;if(this.getUpload(e)){var r=this.getState().currentUploads,o=pe({},r[e],{result:pe({},r[e].result,t)});this.setState({currentUploads:pe({},r,(n={},n[e]=o,n))})}else this.log("Not setting result for an upload that has been removed: "+e)},r.removeUpload=function(e){var t=pe({},this.getState().currentUploads);delete t[e],this.setState({currentUploads:t})},r.runUpload=function(e){var t=this,n=this.getState().currentUploads[e].step,r=[].concat(this.preProcessors,this.uploaders,this.postProcessors),o=Promise.resolve();return r.forEach((function(r,i){i<n||(o=o.then((function(){var n,o=t.getState().currentUploads,a=o[e];if(a){var s=pe({},a,{step:i});return t.setState({currentUploads:pe({},o,(n={},n[e]=s,n))}),r(s.fileIDs,e)}})).then((function(){return null})))})),o.catch((function(n){t.emit("error",n),t.removeUpload(e)})),o.then((function(){var n=t.getState().currentUploads[e];if(n){n.fileIDs.forEach((function(e){var n=t.getFile(e);n&&n.progress.postprocess&&t.emit("postprocess-complete",n)}));var r=n.fileIDs.map((function(e){return t.getFile(e)})),o=r.filter((function(e){return!e.error})),i=r.filter((function(e){return e.error}));t.addResultData(e,{successful:o,failed:i,uploadID:e})}})).then((function(){var n=t.getState().currentUploads;if(n[e]){var r=n[e].result;return t.emit("complete",r),t.removeUpload(e),r}})).then((function(n){return null==n&&t.log("Not setting result for an upload that has been removed: "+e),n}))},r.upload=function(){var e=this;this.plugins.uploader||this.log("No uploader type plugins are used","warning");var t=this.getState().files,n=this.opts.onBeforeUpload(t);return!1===n?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&"object"==typeof n&&(t=n,this.setState({files:t})),Promise.resolve().then((function(){e.checkMinNumberOfFiles(t),e.checkRequiredMetaFields(t)})).catch((function(t){e.showOrLogErrorAndThrow(t)})).then((function(){var n=e.getState().currentUploads,r=Object.keys(n).reduce((function(e,t){return e.concat(n[t].fileIDs)}),[]),o=[];Object.keys(t).forEach((function(t){var n=e.getFile(t);n.progress.uploadStarted||-1!==r.indexOf(t)||o.push(n.id)}));var i=e.createUpload(o);return e.runUpload(i)})).catch((function(t){e.showOrLogErrorAndThrow(t,{showInformer:!1})})))},t=e,(n=[{key:"state",get:function(){return this.getState()}}])&&de(t.prototype,n),e}();function Se(e){var t="function"==typeof Map?new Map:void 0;return(Se=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return ke(e,arguments,Pe(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),xe(r,e)})(e)}function ke(e,t,n){return(ke=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&xe(o,n.prototype),o}).apply(null,arguments)}function xe(e,t){return(xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pe(e){return(Pe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Ce.VERSION="1.20.1",(ue=function(e){return new Ce(e)}).Uppy=Ce,ue.Plugin=ce,ue.debugLogger=be;var Ee=function(e){var t,n;function r(){var t;return(t=e.call(this,"Authorization required")||this).name="AuthError",t.isAuthError=!0,t}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,xe(t,n),r}(Se(Error));function Oe(e){var t="function"==typeof Map?new Map:void 0;return(Oe=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Ae(e,arguments,Ne(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ue(r,e)})(e)}function Ae(e,t,n){return(Ae=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Ue(o,n.prototype),o}).apply(null,arguments)}function Ue(e,t){return(Ue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ne(e){return(Ne=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Te,Re,Fe=function(e){var t,n;function r(t,n){var r;return void 0===n&&(n=null),(r=e.call(this,"This looks like a network error, the endpoint might be blocked by an internet provider or a firewall.\n\nSource error: ["+t+"]")||this).isNetworkError=!0,r.request=n,r}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Ue(t,n),r}(Oe(Error)),De=function(){return fetch.apply(void 0,arguments).catch((function(e){throw"AbortError"===e.name?e:new Fe(e)}))};function Me(){return(Me=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Ie=(Re=Te=function(){function e(e,t){this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.allowedHeaders=["accept","content-type","uppy-auth-token"],this.preflightDone=!1}var t,n,r=e.prototype;return r.headers=function(){var e=this.opts.companionHeaders||this.opts.serverHeaders||{};return Promise.resolve(Me({},this.defaultHeaders,e))},r._getPostResponseFunc=function(e){var t=this;return function(n){return e?n:t.onReceiveResponse(n)}},r.onReceiveResponse=function(e){var t,n=this.uppy.getState().companion||{},r=this.opts.companionUrl,o=e.headers;return o.has("i-am")&&o.get("i-am")!==n[r]&&this.uppy.setState({companion:Me({},n,(t={},t[r]=o.get("i-am"),t))}),e},r._getUrl=function(e){return/^(https?:|)\/\//.test(e)?e:this.hostname+"/"+e},r._json=function(e){if(401===e.status)throw new Ee;if(e.status<200||e.status>300){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()},r.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()}))},r.preflightAndHeaders=function(e){var t=this;return Promise.all([this.preflight(e),this.headers()]).then((function(e){var n=e[0],r=e[1];return Object.keys(r).forEach((function(e){-1===n.indexOf(e.toLowerCase())&&(t.uppy.log("[CompanionClient] excluding unallowed header "+e),delete r[e])})),r}))},r.get=function(e,t){var n=this;return this.preflightAndHeaders(e).then((function(t){return De(n._getUrl(e),{method:"get",headers:t,credentials:n.opts.companionCookiesRule||"same-origin"})})).then(this._getPostResponseFunc(t)).then((function(e){return n._json(e)})).catch((function(t){return t.isAuthError||(t.message="Could not get "+n._getUrl(e)+". "+t.message),Promise.reject(t)}))},r.post=function(e,t,n){var r=this;return this.preflightAndHeaders(e).then((function(n){return De(r._getUrl(e),{method:"post",headers:n,credentials:r.opts.companionCookiesRule||"same-origin",body:JSON.stringify(t)})})).then(this._getPostResponseFunc(n)).then((function(e){return r._json(e)})).catch((function(t){return t.isAuthError||(t.message="Could not post "+r._getUrl(e)+". "+t.message),Promise.reject(t)}))},r.delete=function(e,t,n){var r=this;return this.preflightAndHeaders(e).then((function(n){return De(r.hostname+"/"+e,{method:"delete",headers:n,credentials:r.opts.companionCookiesRule||"same-origin",body:t?JSON.stringify(t):null})})).then(this._getPostResponseFunc(n)).then((function(e){return r._json(e)})).catch((function(t){return t.isAuthError||(t.message="Could not delete "+r._getUrl(e)+". "+t.message),Promise.reject(t)}))},t=e,(n=[{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,n),e}(),Te.VERSION="1.10.2",Re),Le=Object.prototype.hasOwnProperty,je=function e(t,n){var r=[];for(var o in t)if(Le.call(t,o)){var i,a=t[o],s=encodeURIComponent(o);i="object"==typeof a?e(a,n?n+"["+s+"]":s):(n?n+"["+s+"]":s)+"="+encodeURIComponent(a),r.push(i)}return r.join("&")},ze=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},He={},We=Object.prototype.hasOwnProperty;function Ve(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function qe(e){try{return encodeURIComponent(e)}catch(t){return null}}He.stringify=function(e,t){t=t||"";var n,r,o=[];for(r in"string"!=typeof t&&(t="?"),e)if(We.call(e,r)){if((n=e[r])||null!=n&&!isNaN(n)||(n=""),r=qe(r),n=qe(n),null===r||null===n)continue;o.push(r+"="+n)}return o.length?t+o.join("&"):""},He.parse=function(e){for(var t,n=/([^=?#&]+)=?([^&]*)/g,r={};t=n.exec(e);){var o=Ve(t[1]),i=Ve(t[2]);null===o||null===i||o in r||(r[o]=i)}return r};var Xe={};(function(e){(function(){"use strict";var t=/^[A-Za-z][A-Za-z0-9+-.]*:[\\/]+/,n=/^([a-z][a-z0-9.+-]*:)?([\\/]{1,})?([\S\s]*)/i,r=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 o(e){return(e||"").toString().replace(r,"")}var i=[["#","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]],a={hash:1,query:1};function s(n){var r,o=("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{}).location||{},i={},s=typeof(n=n||o);if("blob:"===n.protocol)i=new u(unescape(n.pathname),{});else if("string"===s)for(r in i=new u(n,{}),a)delete i[r];else if("object"===s){for(r in n)r in a||(i[r]=n[r]);void 0===i.slashes&&(i.slashes=t.test(n.href))}return i}function l(e){e=o(e);var t=n.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 u(e,t,n){if(e=o(e),!(this instanceof u))return new u(e,t,n);var r,a,c,p,d,h,f=i.slice(),m=typeof t,v=this,g=0;for("object"!==m&&"string"!==m&&(n=t,t=null),n&&"function"!=typeof n&&(n=He.parse),t=s(t),r=!(a=l(e||"")).protocol&&!a.slashes,v.slashes=a.slashes||r&&t.slashes,v.protocol=a.protocol||t.protocol||"",e=a.rest,a.slashes||(f[3]=[/(.*)/,"pathname"]);g<f.length;g++)"function"!=typeof(p=f[g])?(c=p[0],h=p[1],c!=c?v[h]=e:"string"==typeof c?~(d=e.indexOf(c))&&("number"==typeof p[2]?(v[h]=e.slice(0,d),e=e.slice(d+p[2])):(v[h]=e.slice(d),e=e.slice(0,d))):(d=c.exec(e))&&(v[h]=d[1],e=e.slice(0,d.index)),v[h]=v[h]||r&&p[3]&&t[h]||"",p[4]&&(v[h]=v[h].toLowerCase())):e=p(e);n&&(v.query=n(v.query)),r&&t.slashes&&"/"!==v.pathname.charAt(0)&&(""!==v.pathname||""!==t.pathname)&&(v.pathname=function(e,t){if(""===e)return t;for(var n=(t||"/").split("/").slice(0,-1).concat(e.split("/")),r=n.length,o=n[r-1],i=!1,a=0;r--;)"."===n[r]?n.splice(r,1):".."===n[r]?(n.splice(r,1),a++):a&&(0===r&&(i=!0),n.splice(r,1),a--);return i&&n.unshift(""),"."!==o&&".."!==o||n.push(""),n.join("/")}(v.pathname,t.pathname)),"/"!==v.pathname.charAt(0)&&v.hostname&&(v.pathname="/"+v.pathname),ze(v.port,v.protocol)||(v.host=v.hostname,v.port=""),v.username=v.password="",v.auth&&(p=v.auth.split(":"),v.username=p[0]||"",v.password=p[1]||""),v.origin=v.protocol&&v.host&&"file:"!==v.protocol?v.protocol+"//"+v.host:"null",v.href=v.toString()}u.prototype={set:function(e,t,n){var r=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||He.parse)(t)),r[e]=t;break;case"port":r[e]=t,ze(t,r.protocol)?t&&(r.host=r.hostname+":"+t):(r.host=r.hostname,r[e]="");break;case"hostname":r[e]=t,r.port&&(t+=":"+r.port),r.host=t;break;case"host":r[e]=t,/:\d+$/.test(t)?(t=t.split(":"),r.port=t.pop(),r.hostname=t.join(":")):(r.hostname=t,r.port="");break;case"protocol":r.protocol=t.toLowerCase(),r.slashes=!n;break;case"pathname":case"hash":if(t){var o="pathname"===e?"/":"#";r[e]=t.charAt(0)!==o?o+t:t}else r[e]=t;break;default:r[e]=t}for(var a=0;a<i.length;a++){var s=i[a];s[4]&&(r[s[1]]=r[s[1]].toLowerCase())}return r.origin=r.protocol&&r.host&&"file:"!==r.protocol?r.protocol+"//"+r.host:"null",r.href=r.toString(),r},toString:function(e){e&&"function"==typeof e||(e=He.stringify);var t,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var o=r+(n.slashes?"//":"");return n.username&&(o+=n.username,n.password&&(o+=":"+n.password),o+="@"),o+=n.host+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(o+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(o+=n.hash),o}},u.extractProtocol=l,u.location=s,u.trimLeft=o,u.qs=He,Xe=u}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Ge={};function Ye(){return(Ye=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function $e(e,t){return($e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Ge.setItem=function(e,t){return new Promise((function(n){localStorage.setItem(e,t),n()}))},Ge.getItem=function(e){return Promise.resolve(localStorage.getItem(e))},Ge.removeItem=function(e){return new Promise((function(t){localStorage.removeItem(e),t()}))};var Ke=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).provider=n.provider,r.id=r.provider,r.name=r.opts.name||r.id.split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(" "),r.pluginId=r.opts.pluginId,r.tokenKey="companion-"+r.pluginId+"-auth-token",r.companionKeysParams=r.opts.companionKeysParams,r.preAuthToken=null,r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,$e(t,n);var o=r.prototype;return o.headers=function(){var t=this;return Promise.all([e.prototype.headers.call(this),this.getAuthToken()]).then((function(e){var n=e[0],r=e[1],o={};return r&&(o["uppy-auth-token"]=r),t.companionKeysParams&&(o["uppy-credentials-params"]=btoa(JSON.stringify({params:t.companionKeysParams}))),Ye({},n,o)}))},o.onReceiveResponse=function(t){t=e.prototype.onReceiveResponse.call(this,t);var n=this.uppy.getPlugin(this.pluginId),r=n.getPluginState().authenticated?401!==t.status:t.status<400;return n.setPluginState({authenticated:r}),t},o.setAuthToken=function(e){return this.uppy.getPlugin(this.pluginId).storage.setItem(this.tokenKey,e)},o.getAuthToken=function(){return this.uppy.getPlugin(this.pluginId).storage.getItem(this.tokenKey)},o.authUrl=function(e){void 0===e&&(e={}),this.preAuthToken&&(e.uppyPreAuthToken=this.preAuthToken);var t=je(e);return t=t?"?"+t:t,this.hostname+"/"+this.id+"/connect"+t},o.fileUrl=function(e){return this.hostname+"/"+this.id+"/get/"+e},o.fetchPreAuthToken=function(){var e=this;return this.companionKeysParams?this.post(this.id+"/preauth/",{params:this.companionKeysParams}).then((function(t){e.preAuthToken=t.token})).catch((function(t){e.uppy.log("[CompanionClient] unable to fetch preAuthToken "+t,"warning")})):Promise.resolve()},o.list=function(e){return this.get(this.id+"/list/"+(e||""))},o.logout=function(){var e=this;return this.get(this.id+"/logout").then((function(t){return Promise.all([t,e.uppy.getPlugin(e.pluginId).storage.removeItem(e.tokenKey)])})).then((function(e){return e[0]}))},r.initPlugin=function(e,t,n){if(e.type="acquirer",e.files=[],n&&(e.opts=Ye({},n,t)),t.serverUrl||t.serverPattern)throw new Error("`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in the 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for the Instagram plugin) and use the updated options.`");if(t.companionAllowedHosts){var r=t.companionAllowedHosts;if(!("string"==typeof r||Array.isArray(r)||r instanceof RegExp))throw new TypeError(e.id+': the option "companionAllowedHosts" must be one of string, Array, RegExp');e.opts.companionAllowedHosts=r}else/^(?!https?:\/\/).*$/i.test(t.companionUrl)?e.opts.companionAllowedHosts="https://"+t.companionUrl.replace(/^\/\//,""):e.opts.companionAllowedHosts=new Xe(t.companionUrl).origin;e.storage=e.opts.storage||Ge},r}(Ie);function Je(e,t){return(Je=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Qe={RequestClient:Ie,Provider:Ke,SearchProvider:function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).provider=n.provider,r.id=r.provider,r.name=r.opts.name||r.id.split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join(" "),r.pluginId=r.opts.pluginId,r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Je(t,n);var o=r.prototype;return o.fileUrl=function(e){return this.hostname+"/search/"+this.id+"/get/"+e},o.search=function(e,t){return t=t?"&"+t:"",this.get("search/"+this.id+"/list?q="+encodeURIComponent(e)+t)},r}(Ie),Socket:function(){function e(e){this.opts=e,this._queued=[],this.isOpen=!1,this.emitter=P(),this._handleMessage=this._handleMessage.bind(this),this.close=this.close.bind(this),this.emit=this.emit.bind(this),this.on=this.on.bind(this),this.once=this.once.bind(this),this.send=this.send.bind(this),e&&!1===e.autoOpen||this.open()}var t=e.prototype;return t.open=function(){var e=this;this.socket=new WebSocket(this.opts.target),this.socket.onopen=function(t){for(e.isOpen=!0;e._queued.length>0&&e.isOpen;){var n=e._queued[0];e.send(n.action,n.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(Cd){console.log(Cd)}},e}()},Ze={exports:{}};function et(e,t){return(et=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};Ze.exports=N}();var tt=(Ze=Ze.exports).h,nt=function(e){var t,n;function r(){return e.apply(this,arguments)||this}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,et(t,n),r.prototype.render=function(){var e=tt("span",{className:"uppy-Provider-authTitleName"},this.props.pluginName,tt("br",null));return tt("div",{className:"uppy-Provider-auth"},tt("div",{className:"uppy-Provider-authIcon"},this.props.pluginIcon()),tt("div",{className:"uppy-Provider-authTitle"},this.props.i18nArray("authenticateWithTitle",{pluginName:e})),tt("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})))},r}(Ze.Component),rt=Ze.h,ot=Ze.h,it=function(e){return ot("span",null,ot("button",{type:"button",className:"uppy-u-reset",onClick:e.getFolder},e.title),e.isLast?"":" / ")},at=function(e){var t=[];return e.showBreadcrumbs&&t.push(function(e){return ot("div",{className:"uppy-Provider-breadcrumbs"},ot("div",{className:"uppy-Provider-breadcrumbsIcon"},e.breadcrumbsIcon),e.directories.map((function(t,n){return ot(it,{key:t.id,getFolder:function(){return e.getFolder(t.id)},title:0===n?e.title:t.title,isLast:n+1===e.directories.length})})))}({getFolder:e.getFolder,directories:e.directories,breadcrumbsIcon:e.pluginIcon&&e.pluginIcon(),title:e.title})),t.push(function(e){return[rt("span",{className:"uppy-ProviderBrowser-user",key:"username"},e.username),rt("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},st={exports:{}};function lt(e,t){return(lt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var a=t.apply(null,o);a&&n.push(a)}}else if("object"===i)if(o.toString===Object.prototype.toString)for(var s in o)e.call(o,s)&&o[s]&&n.push(s);else n.push(o.toString())}}return n.join(" ")}st.exports?(t.default=t,st.exports=t):window.classNames=t}(),st=st.exports;var ut=Ze.h,ct=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).preventEnterPress=n.preventEnterPress.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,lt(t,n);var o=r.prototype;return o.preventEnterPress=function(e){13===e.keyCode&&(e.stopPropagation(),e.preventDefault())},o.render=function(){var e=this;return ut("div",{className:"uppy-ProviderBrowser-search"},ut("input",{className:"uppy-u-reset uppy-ProviderBrowser-searchInput",type:"text",placeholder:this.props.i18n("filter"),"aria-label":this.props.i18n("filter"),onKeyUp:this.preventEnterPress,onKeyDown:this.preventEnterPress,onKeyPress:this.preventEnterPress,onInput:function(t){return e.props.filterQuery(t)},value:this.props.filterInput}),ut("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchIcon",width:"12",height:"12",viewBox:"0 0 12 12"},ut("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),this.props.filterInput&&ut("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchClose",type:"button","aria-label":this.props.i18n("resetFilter"),title:this.props.i18n("resetFilter"),onClick:this.props.filterQuery},ut("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},ut("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))))},r}(Ze.Component);function pt(){return(pt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var dt=function(e){return pt({},e,{type:e.mimeType,extension:e.name?$(e.name).extension:null})},ht=Ze.h;function ft(){return ht("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},ht("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function mt(){return ht("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},ht("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function vt(){return ht("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},ht("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),ht("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}var gt=function(e){if(null!==e.itemIconString)switch(e.itemIconString){case"file":return ht(ft,null);case"folder":return ht(mt,null);case"video":return ht(vt,null);default:return ht("img",{src:e.itemIconString})}},yt=Ze.h,bt=function(e){return yt("li",{className:e.className,title:e.isDisabled?e.restrictionReason:null},yt("div",{"aria-hidden":!0,className:"uppy-ProviderBrowserItem-fakeCheckbox "+(e.isChecked?"uppy-ProviderBrowserItem-fakeCheckbox--is-checked":"")}),yt("button",{type:"button",className:"uppy-u-reset uppy-ProviderBrowserItem-inner",onClick:e.toggleCheckbox,role:"option","aria-label":e.isChecked?e.i18n("unselectFileNamed",{name:e.title}):e.i18n("selectFileNamed",{name:e.title}),"aria-selected":e.isChecked,"aria-disabled":e.isDisabled,disabled:e.isDisabled,"data-uppy-super-focusable":!0},e.itemIconEl,e.showTitles&&e.title))},_t=Ze.h,wt=function(e){return"folder"===e.type?e.isChecked?e.i18n("unselectAllFilesFromFolderNamed",{name:e.title}):e.i18n("selectAllFilesFromFolderNamed",{name:e.title}):e.isChecked?e.i18n("unselectFileNamed",{name:e.title}):e.i18n("selectFileNamed",{name:e.title})},Ct=function(e){return _t("li",{className:e.className,title:e.isDisabled?e.restrictionReason:null},e.isCheckboxDisabled?null:_t("button",{type:"button",className:"uppy-u-reset uppy-ProviderBrowserItem-fakeCheckbox "+(e.isChecked?"uppy-ProviderBrowserItem-fakeCheckbox--is-checked":""),onClick:e.toggleCheckbox,id:e.id,role:"option","aria-label":wt(e),"aria-selected":e.isChecked,"aria-disabled":e.isDisabled,disabled:e.isDisabled,"data-uppy-super-focusable":!0}),"file"===e.type?_t("label",{htmlFor:e.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},_t("div",{className:"uppy-ProviderBrowserItem-iconWrap"},e.itemIconEl),e.showTitles&&e.title):_t("button",{type:"button",className:"uppy-u-reset uppy-ProviderBrowserItem-inner",onClick:e.handleFolderClick,"aria-label":e.i18n("openFolderNamed",{name:e.title})},_t("div",{className:"uppy-ProviderBrowserItem-iconWrap"},e.itemIconEl),e.showTitles&&_t("span",null,e.title)))};function St(){return(St=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var kt=Ze.h,xt=function(e){var t=e.getItemIcon(),n=st("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--selected":e.isChecked},{"uppy-ProviderBrowserItem--disabled":e.isDisabled},{"uppy-ProviderBrowserItem--noPreview":"video"===t}),r=kt(gt,{itemIconString:t});switch(e.viewType){case"grid":return kt(bt,St({},e,{className:n,itemIconEl:r}));case"list":return kt(Ct,St({},e,{className:n,itemIconEl:r}));default:throw new Error("There is no such type "+e.viewType)}};function Pt(){return(Pt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Et=Ze.h,Ot=function(e,t){return{id:e.id,title:e.name,getItemIcon:function(){return e.icon},isChecked:t.isChecked(e),toggleCheckbox:function(n){return t.toggleCheckbox(n,e)},columns:t.columns,showTitles:t.showTitles,viewType:t.viewType,i18n:t.i18n}},At=function(e){var t=e.folders,n=e.files,r=e.handleScroll,o=e.isChecked;return t.length||n.length?Et("div",{className:"uppy-ProviderBrowser-body"},Et("ul",{className:"uppy-ProviderBrowser-list",onScroll:r,role:"listbox",tabIndex:"-1"},t.map((function(t){return xt(Pt({},Ot(t,e),{type:"folder",isDisabled:!!o(t)&&o(t).loading,isCheckboxDisabled:"shared-with-me"===t.id,handleFolderClick:function(){return e.handleFolderClick(t)}}))})),n.map((function(t){var n=e.validateRestrictions(dt(t),[].concat(e.uppyFiles,e.currentSelection)),r=Ot(t,e),o=n.reason;return xt(Pt({},r,{type:"file",isDisabled:!n.result&&!r.isChecked,restrictionReason:o}))})))):Et("div",{className:"uppy-Provider-empty"},e.i18n("noFilesFound"))},Ut=Ze.h,Nt=function(e){return Ut("div",{className:"uppy-ProviderBrowser-footer"},Ut("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary",onClick:e.done},e.i18n("selectX",{smart_count:e.selected})),Ut("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e.cancel},e.i18n("cancel")))};function Tt(){return(Tt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Rt=Ze.h,Ft=function(e){var t=e.currentSelection,n=e.folders,r=e.files,o=e.uppyFiles,i=e.filterItems,a=n,s=r;""!==e.filterInput&&(a=i(n),s=i(r));var l=t.length;return Rt("div",{className:st("uppy-ProviderBrowser","uppy-ProviderBrowser-viewType--"+e.viewType)},Rt("div",{className:"uppy-ProviderBrowser-header"},Rt("div",{className:st("uppy-ProviderBrowser-headerBar",!e.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},e.headerComponent)),e.showFilter&&Rt(ct,e),Rt(At,{columns:[{name:"Name",key:"title"}],folders:a,files:s,sortByTitle:e.sortByTitle,sortByDate:e.sortByDate,isChecked:e.isChecked,handleFolderClick:e.getNextFolder,toggleCheckbox:e.toggleCheckbox,handleScroll:e.handleScroll,title:e.title,showTitles:e.showTitles,i18n:e.i18n,viewType:e.viewType,validateRestrictions:e.validateRestrictions,uppyFiles:o,currentSelection:t}),l>0&&Rt(Nt,Tt({selected:l},e)))},Dt=Ze.h,Mt=function(e){return Dt("div",{className:"uppy-Provider-loading"},Dt("span",null,e.i18n("loading")))},Bt=function(e){if(!e)return!1;var t=e.split("/")[1];return!!/^(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(t)},It=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 n=this;e.stopPropagation(),e.preventDefault(),e.currentTarget.focus();var r=this.plugin.getPluginState(),o=r.folders,i=r.files,a=this.filterItems(o.concat(i));if(this.lastCheckbox&&e.shiftKey){var s,l=a.indexOf(this.lastCheckbox),u=a.indexOf(t);return s=(s=l<u?a.slice(l,u+1):a.slice(u,l+1)).reduce((function(e,t){var r=n.plugin.uppy,o=r.validateRestrictions(dt(t),[].concat(r.getFiles(),e));return o.result?[].concat(e,[t]):(r.info({message:o.reason},"error",r.opts.infoTimeout),e)})),void this.plugin.setPluginState({currentSelection:s})}this.lastCheckbox=t;var c=this.plugin.getPluginState().currentSelection;this.isChecked(t)?this.plugin.setPluginState({currentSelection:c.filter((function(e){return e.id!==t.id}))}):this.plugin.setPluginState({currentSelection:c.concat([t])})},t.isChecked=function(e){return this.plugin.getPluginState().currentSelection.some((function(t){return t.id===e.id}))},t.loaderWrapper=function(e,t,n){var r=this;e.then((function(e){r.plugin.setPluginState({loading:!1}),t(e)})).catch((function(e){r.plugin.setPluginState({loading:!1}),n(e)})),this.plugin.setPluginState({loading:!0})},e}();function Lt(e,t){return(Lt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var jt,zt,Ht=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Lt(t,n);var o=r.prototype;return o.componentWillUnmount=function(){this.props.onUnmount()},o.render=function(){return this.props.children[0]},r}(Ze.Component);function Wt(){return(Wt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Vt,qt,Xt=Ze.h,Gt=(zt=jt=function(){function e(e,t){this.plugin=e,this.provider=t.provider,this._sharedHandler=new It(e),this.opts=Wt({},{viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0},t),this.addFile=this.addFile.bind(this),this.filterQuery=this.filterQuery.bind(this),this.getFolder=this.getFolder.bind(this),this.getNextFolder=this.getNextFolder.bind(this),this.logout=this.logout.bind(this),this.preFirstRender=this.preFirstRender.bind(this),this.handleAuth=this.handleAuth.bind(this),this.sortByTitle=this.sortByTitle.bind(this),this.sortByDate=this.sortByDate.bind(this),this.handleError=this.handleError.bind(this),this.handleScroll=this.handleScroll.bind(this),this.listAllFiles=this.listAllFiles.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelPicking=this.cancelPicking.bind(this),this.clearSelection=this.clearSelection.bind(this),this.render=this.render.bind(this),this.clearSelection(),this.plugin.setPluginState({authenticated:!1,files:[],folders:[],directories:[],filterInput:"",isSearchVisible:!1})}var t=e.prototype;return t.tearDown=function(){},t._updateFilesAndFolders=function(e,t,n){this.nextPagePath=e.nextPagePath,e.items.forEach((function(e){e.isFolder?n.push(e):t.push(e)})),this.plugin.setPluginState({folders:n,files:t})},t.preFirstRender=function(){this.plugin.setPluginState({didFirstRender:!0}),this.plugin.onFirstRender()},t.getFolder=function(e,t){var n=this;return this._sharedHandler.loaderWrapper(this.provider.list(e),(function(r){var o,i=n.plugin.getPluginState(),a=ee(i.directories,(function(t){return e===t.id}));o=-1!==a?i.directories.slice(0,a+1):i.directories.concat([{id:e,title:t}]),n.username=r.username||n.username,n._updateFilesAndFolders(r,[],[]),n.plugin.setPluginState({directories:o})}),this.handleError)},t.getNextFolder=function(e){this.getFolder(e.requestPath,e.name),this.lastCheckbox=void 0},t.addFile=function(e){var t={id:this.providerFileToId(e),source:this.plugin.id,data:e,name:e.name||e.id,type:e.mimeType,isRemote:!0,body:{fileId:e.id},remote:{companionUrl:this.plugin.opts.companionUrl,url:""+this.provider.fileUrl(e.requestPath),body:{fileId:e.id},providerOptions:this.provider.opts}},n=J(t);n&&Bt(n)&&(t.preview=e.thumbnail),this.plugin.uppy.log("Adding remote file");try{return this.plugin.uppy.addFile(t),!0}catch(Cd){return Cd.isRestriction||this.plugin.uppy.log(Cd),!1}},t.logout=function(){var e=this;this.provider.logout().then((function(t){if(t.ok){if(!t.revoked){var n=e.plugin.uppy.i18n("companionUnauthorizeHint",{provider:e.plugin.title,url:t.manual_revoke_url});e.plugin.uppy.info(n,"info",7e3)}e.plugin.setPluginState({authenticated:!1,files:[],folders:[],directories:[]})}})).catch(this.handleError)},t.filterQuery=function(e){var t=this.plugin.getPluginState();this.plugin.setPluginState(Wt({},t,{filterInput:e?e.target.value:""}))},t.sortByTitle=function(){var e=Wt({},this.plugin.getPluginState()),t=e.files,n=e.folders,r=e.sorting,o=t.sort((function(e,t){return"titleDescending"===r?t.name.localeCompare(e.name):e.name.localeCompare(t.name)})),i=n.sort((function(e,t){return"titleDescending"===r?t.name.localeCompare(e.name):e.name.localeCompare(t.name)}));this.plugin.setPluginState(Wt({},e,{files:o,folders:i,sorting:"titleDescending"===r?"titleAscending":"titleDescending"}))},t.sortByDate=function(){var e=Wt({},this.plugin.getPluginState()),t=e.files,n=e.folders,r=e.sorting,o=t.sort((function(e,t){var n=new Date(e.modifiedDate),o=new Date(t.modifiedDate);return"dateDescending"===r?n>o?-1:n<o?1:0:n>o?1:n<o?-1:0})),i=n.sort((function(e,t){var n=new Date(e.modifiedDate),o=new Date(t.modifiedDate);return"dateDescending"===r?n>o?-1:n<o?1:0:n>o?1:n<o?-1:0}));this.plugin.setPluginState(Wt({},e,{files:o,folders:i,sorting:"dateDescending"===r?"dateAscending":"dateDescending"}))},t.sortBySize=function(){var e=Wt({},this.plugin.getPluginState()),t=e.files,n=e.sorting;if(t.length&&this.plugin.getItemData(t[0]).size){var r=t.sort((function(e,t){var r=e.size,o=t.size;return"sizeDescending"===n?r>o?-1:r<o?1:0:r>o?1:r<o?-1:0}));this.plugin.setPluginState(Wt({},e,{files:r,sorting:"sizeDescending"===n?"sizeAscending":"sizeDescending"}))}},t.addFolder=function(e){var t=this,n=this.providerFileToId(e),r=Wt({},this.plugin.getPluginState().selectedFolders);if(!(n in r)||!r[n].loading)return r[n]={loading:!0,files:[]},this.plugin.setPluginState({selectedFolders:Wt({},r)}),this.listAllFiles(e.requestPath).then((function(o){var i=0;o.forEach((function(e){t.addFile(e)&&i++}));var a,s=o.map(t.providerFileToId);r[n]={loading:!1,files:s},t.plugin.setPluginState({selectedFolders:r}),a=o.length?t.plugin.uppy.i18n("folderAdded",{smart_count:i,folder:e.name}):t.plugin.uppy.i18n("emptyFolderAdded"),t.plugin.uppy.info(a)})).catch((function(e){var r=Wt({},t.plugin.getPluginState().selectedFolders);delete r[n],t.plugin.setPluginState({selectedFolders:r}),t.handleError(e)}))},t.providerFileToId=function(e){return Z({data:e,name:e.name||e.id,type:e.mimeType})},t.handleAuth=function(){var t=this,n=btoa(JSON.stringify({origin:"origin"in location?location.origin:location.protocol+"//"+location.hostname+(location.port?":"+location.port:"")})),r="@uppy/provider-views="+e.VERSION,o=this.provider.authUrl({state:n,uppyVersions:r}),i=window.open(o,"_blank");window.addEventListener("message",(function e(n){if(t._isOriginAllowed(n.origin,t.plugin.opts.companionAllowedHosts)&&n.source===i){var r="string"==typeof n.data?JSON.parse(n.data):n.data;r.token?(i.close(),window.removeEventListener("message",e),t.provider.setAuthToken(r.token),t.preFirstRender()):t.plugin.uppy.log("did not receive token from auth window")}else t.plugin.uppy.log("rejecting event from "+n.origin+" vs allowed pattern "+t.plugin.opts.companionAllowedHosts)}))},t._isOriginAllowed=function(e,t){var n=function(e){return"string"==typeof e?new RegExp("^"+e+"$"):e instanceof RegExp?e:void 0};return(Array.isArray(t)?t.map(n):[n(t)]).filter((function(e){return null!=e})).some((function(t){return t.test(e)||t.test(e+"/")}))},t.handleError=function(e){var t=this.plugin.uppy;if(t.log(e.toString()),!e.isAuthError){var n=t.i18n("companionError");t.info({message:n,details:e.toString()},"error",5e3)}},t.handleScroll=function(e){var t=this,n=e.target.scrollHeight-(e.target.scrollTop+e.target.offsetHeight),r=this.nextPagePath||null;n<50&&r&&!this._isHandlingScroll&&(this.provider.list(r).then((function(e){var n=t.plugin.getPluginState(),r=n.files,o=n.folders;t._updateFilesAndFolders(e,r,o)})).catch(this.handleError).then((function(){t._isHandlingScroll=!1})),this._isHandlingScroll=!0)},t.listAllFiles=function(e,t){var n=this;return void 0===t&&(t=null),t=t||[],new Promise((function(r,o){n.provider.list(e).then((function(e){e.items.forEach((function(e){e.isFolder?n.addFolder(e):t.push(e)}));var i=e.nextPagePath||null;return i?n.listAllFiles(i,t).then((function(e){return r(e)})).catch((function(e){return o(e)})):r(t)})).catch((function(e){return o(e)}))}))},t.donePicking=function(){var e=this,t=this.plugin.getPluginState().currentSelection.map((function(t){return t.isFolder?e.addFolder(t):e.addFile(t)}));this._sharedHandler.loaderWrapper(Promise.all(t),(function(){e.clearSelection()}),(function(){}))},t.cancelPicking=function(){this.clearSelection();var e=this.plugin.uppy.getPlugin("Dashboard");e&&e.hideAllPanels()},t.clearSelection=function(){this.plugin.setPluginState({currentSelection:[]})},t.render=function(e,t){void 0===t&&(t={});var n=this.plugin.getPluginState(),r=n.authenticated;if(n.didFirstRender||this.preFirstRender(),this.plugin.getPluginState().loading)return Xt(Ht,{onUnmount:this.clearSelection},Xt(Mt,{i18n:this.plugin.uppy.i18n}));if(!r)return Xt(Ht,{onUnmount:this.clearSelection},Xt(nt,{pluginName:this.plugin.title,pluginIcon:this.plugin.icon,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,i18nArray:this.plugin.uppy.i18nArray}));var o=Wt({},this.opts,t),i={showBreadcrumbs:o.showBreadcrumbs,getFolder:this.getFolder,directories:this.plugin.getPluginState().directories,pluginIcon:this.plugin.icon,title:this.plugin.title,logout:this.logout,username:this.username,i18n:this.plugin.uppy.i18n},a=Wt({},this.plugin.getPluginState(),{username:this.username,getNextFolder:this.getNextFolder,getFolder:this.getFolder,filterItems:this._sharedHandler.filterItems,filterQuery:this.filterQuery,sortByTitle:this.sortByTitle,sortByDate:this.sortByDate,logout:this.logout,isChecked:this._sharedHandler.isChecked,toggleCheckbox:this._sharedHandler.toggleCheckbox,handleScroll:this.handleScroll,listAllFiles:this.listAllFiles,done:this.donePicking,cancel:this.cancelPicking,headerComponent:at(i),title:this.plugin.title,viewType:o.viewType,showTitles:o.showTitles,showFilter:o.showFilter,showBreadcrumbs:o.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:this.plugin.uppy.i18n,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:this.plugin.uppy.validateRestrictions});return Xt(Ht,{onUnmount:this.clearSelection},Xt(Ft,a))},e}(),jt.VERSION="1.12.3",zt),Yt=Ze.h,$t=function(e){var t,n=function(){t.value&&e.search(t.value)};return Yt("div",{className:"uppy-SearchProvider"},Yt("input",{className:"uppy-u-reset uppy-c-textInput uppy-SearchProvider-input",type:"text","aria-label":e.i18n("enterTextToSearch"),placeholder:e.i18n("enterTextToSearch"),onKeyUp:function(e){13===e.keyCode&&n()},ref:function(e){t=e},"data-uppy-super-focusable":!0}),Yt("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-SearchProvider-searchButton",type:"button",onClick:n},e.i18n("searchImages")))},Kt=Ze.h;function Jt(){return(Jt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Qt,Zt=Ze.h,en={ProviderViews:Gt,SearchProviderViews:(qt=Vt=function(){function e(e,t){this.plugin=e,this.provider=t.provider,this._sharedHandler=new It(e),this.opts=Jt({},{viewType:"grid",showTitles:!1,showFilter:!1,showBreadcrumbs:!1},t),this.search=this.search.bind(this),this.triggerSearchInput=this.triggerSearchInput.bind(this),this.addFile=this.addFile.bind(this),this.preFirstRender=this.preFirstRender.bind(this),this.handleError=this.handleError.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelPicking=this.cancelPicking.bind(this),this.clearSelection=this.clearSelection.bind(this),this.render=this.render.bind(this),this.clearSelection(),this.plugin.setPluginState({isInputMode:!0,files:[],folders:[],directories:[],filterInput:"",isSearchVisible:!1})}var t=e.prototype;return t.tearDown=function(){},t._updateFilesAndInputMode=function(e,t){this.nextPageQuery=e.nextPageQuery,this._searchTerm=e.searchedFor,e.items.forEach((function(e){t.push(e)})),this.plugin.setPluginState({isInputMode:!1,files:t})},t.preFirstRender=function(){this.plugin.setPluginState({didFirstRender:!0}),this.plugin.onFirstRender()},t.search=function(e){var t=this;if(!e||e!==this._searchTerm)return this._sharedHandler.loaderWrapper(this.provider.search(e),(function(e){t._updateFilesAndInputMode(e,[])}),this.handleError);this.plugin.setPluginState({isInputMode:!1})},t.triggerSearchInput=function(){this.plugin.setPluginState({isInputMode:!0})},t.addFile=function(e){var t={id:this.providerFileToId(e),source:this.plugin.id,data:e,name:e.name||e.id,type:e.mimeType,isRemote:!0,body:{fileId:e.id},remote:{companionUrl:this.plugin.opts.companionUrl,url:""+this.provider.fileUrl(e.requestPath),body:{fileId:e.id},providerOptions:Jt({},this.provider.opts,{provider:null})}},n=J(t);n&&Bt(n)&&(t.preview=e.thumbnail),this.plugin.uppy.log("Adding remote file");try{this.plugin.uppy.addFile(t)}catch(Cd){Cd.isRestriction||this.plugin.uppy.log(Cd)}},t.providerFileToId=function(e){return Z({data:e,name:e.name||e.id,type:e.mimeType})},t.handleError=function(e){var t=this.plugin.uppy;t.log(e.toString());var n=t.i18n("companionError");t.info({message:n,details:e.toString()},"error",5e3)},t.handleScroll=function(e){var t=this,n=e.target.scrollHeight-(e.target.scrollTop+e.target.offsetHeight),r=this.nextPageQuery||null;n<50&&r&&!this._isHandlingScroll&&(this.provider.search(this._searchTerm,r).then((function(e){var n=t.plugin.getPluginState().files;t._updateFilesAndInputMode(e,n)})).catch(this.handleError).then((function(){t._isHandlingScroll=!1})),this._isHandlingScroll=!0)},t.donePicking=function(){var e=this,t=this.plugin.getPluginState().currentSelection.map((function(t){return e.addFile(t)}));this._sharedHandler.loaderWrapper(Promise.all(t),(function(){e.clearSelection()}),(function(){}))},t.cancelPicking=function(){this.clearSelection();var e=this.plugin.uppy.getPlugin("Dashboard");e&&e.hideAllPanels()},t.clearSelection=function(){this.plugin.setPluginState({currentSelection:[]})},t.render=function(e,t){void 0===t&&(t={});var n=this.plugin.getPluginState(),r=n.didFirstRender,o=n.isInputMode;if(r||this.preFirstRender(),this.plugin.getPluginState().loading)return Zt(Ht,{onUnmount:this.clearSelection},Zt(Mt,{i18n:this.plugin.uppy.i18n}));if(o)return Zt(Ht,{onUnmount:this.clearSelection},Zt($t,{search:this.search,i18n:this.plugin.uppy.i18n}));var i,a=Jt({},this.opts,t),s=Jt({},this.plugin.getPluginState(),{isChecked:this._sharedHandler.isChecked,toggleCheckbox:this._sharedHandler.toggleCheckbox,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,headerComponent:(i={triggerSearchInput:this.triggerSearchInput,i18n:this.plugin.uppy.i18n},Kt("button",{type:"button",onClick:i.triggerSearchInput,className:"uppy-u-reset uppy-ProviderBrowser-userLogout"},i.i18n("backToSearch"))),title:this.plugin.title,viewType:a.viewType,showTitles:a.showTitles,showFilter:a.showFilter,showBreadcrumbs:a.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:this.plugin.uppy.i18n,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:this.plugin.uppy.validateRestrictions});return Zt(Ht,{onUnmount:this.clearSelection},Zt(Ft,s))},e}(),Vt.VERSION="1.12.3",qt)};function tn(){return(tn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var nn=function(){function e(e){var t;this._store=e.store,this._id=e.id||D(),this._selector=e.selector||(t=this._id,function(e){return e.uppy[t]}),this.setState({})}var t=e.prototype;return t.setState=function(e){this._store.dispatch({type:"uppy/STATE_UPDATE",id:this._id,payload:e})},t.getState=function(){return this._selector(this._store.getState())},t.subscribe=function(e){var t=this,n=this.getState();return this._store.subscribe((function(){var r=t.getState();if(n!==r){var o=function(e,t){var n=Object.keys(t),r={};return n.forEach((function(n){e[n]!==t[n]&&(r[n]=t[n])})),r}(n,r);e(n,r,o),n=r}}))},e}();nn.VERSION="1.2.8",(Qt=function(e){return new nn(e)}).STATE_UPDATE="uppy/STATE_UPDATE",Qt.reducer=function(e,t){if(void 0===e&&(e={}),"uppy/STATE_UPDATE"===t.type){var n,r=tn({},e[t.id],t.payload);return tn({},e,((n={})[t.id]=r,n))}return e},Qt.middleware=function(){return function(){return function(e){return function(t){e(t)}}}};var rn={exports:{}};!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};rn.exports=N}(),rn=rn.exports;var on=rn.h,an=function(e){var t={color:"#838999",icon:on("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},on("g",{fill:"#A7AFB7",fillRule:"nonzero"},on("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),on("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))};if(!e)return t;var n=e.split("/")[0],r=e.split("/")[1];return"text"===n?{color:"#5a5e69",icon:on("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},on("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}:"image"===n?{color:"#686de0",icon:on("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},on("g",{fill:"#686DE0",fillRule:"evenodd"},on("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),on("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),on("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}:"audio"===n?{color:"#068dbb",icon:on("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},on("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}:"video"===n?{color:"#19af67",icon:on("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},on("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}:"application"===n&&"pdf"===r?{color:"#e25149",icon:on("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},on("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}:"application"===n&&-1!==["zip","x-7z-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)?{color:"#00C469",icon:on("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},on("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}:t},sn=rn.h,ln=function(e){var t=e.file;if(t.preview)return sn("img",{className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});var n=an(t.type),r=n.color,o=n.icon;return sn("div",{className:"uppy-Dashboard-Item-previewIconWrap"},sn("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:r}},o),sn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},sn("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))},un=rn.h,cn=function(e){return un("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:an(e.file.type).color}},e.showLinkToFileUploadResult&&e.file.uploadURL&&un("a",{className:"uppy-Dashboard-Item-previewLink",href:e.file.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.file.meta.name}),un(ln,{file:e.file}))},pn=rn.h;function dn(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function hn(e){return pn("div",{className:"uppy-Dashboard-Item-progress"},pn("button",{className:"uppy-u-reset uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":dn(e),title:dn(e),onClick:function(){return function(e){e.isUploaded||(!e.error||e.hideRetryButton?e.resumableUploads&&!e.hidePauseResumeButton?e.pauseUpload(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.cancelUpload(e.file.id):e.retryUpload(e.file.id))}(e)}},e.children))}function fn(e){var t=e.children;return pn("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},t)}function mn(e){var t=e.progress,n=2*Math.PI*15;return pn("g",null,pn("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),pn("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":n,"stroke-dashoffset":n-n/100*t}))}var vn=function(e){return e.file.progress.uploadStarted?e.isUploaded?pn("div",{className:"uppy-Dashboard-Item-progress"},pn("div",{className:"uppy-Dashboard-Item-progressIndicator"},pn(fn,null,pn("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),pn("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):e.recoveredState?void 0:e.error&&!e.hideRetryButton?pn(hn,e,pn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},pn("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),pn("path",{d:"M7.9 3H10v2H7.9z"}),pn("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),pn("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):e.resumableUploads&&!e.hidePauseResumeButton?pn(hn,e,pn(fn,null,pn(mn,{progress:e.file.progress.percentage}),e.file.isPaused?pn("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):pn("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},pn("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),pn("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?pn("div",{className:"uppy-Dashboard-Item-progress"},pn("div",{className:"uppy-Dashboard-Item-progressIndicator"},pn(fn,null,pn(mn,{progress:e.file.progress.percentage})))):pn(hn,e,pn(fn,null,pn(mn,{progress:e.file.progress.percentage}),pn("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):null},gn=rn.h,yn=function(e){var t=e.file,n=e.onClick;return t.error?gn("span",{className:"uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",role:"tooltip",onClick:n},"?"):null},bn=function(e){return gn("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.file.source},function(e){var t;return t=e.containerWidth<=352?35:e.containerWidth<=576?60:30,gn("div",{className:"uppy-Dashboard-Item-name",title:e.file.meta.name},function(e,t){if(e.length<=t)return e;if(t<="...".length)return e.substr(0,t);var n=t-"...".length,r=Math.ceil(n/2),o=Math.floor(n/2);return e.substr(0,r)+"..."+e.substr(e.length-o)}(e.file.meta.name,t))}(e),gn("div",{className:"uppy-Dashboard-Item-status"},function(e){return e.file.size&&gn("div",{className:"uppy-Dashboard-Item-statusSize"},W(e.file.size))}(e),function(e){return e.file.isGhost&&gn("span",null," \u2022 ",gn("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:e.toggleAddFilesPanel},e.i18n("reSelect")))}(e),gn(yn,{file:e.file,onClick:function(){alert(e.file.error)}})))},_n=rn.h;function wn(e){var t=e.file,n=e.uploadInProgressOrComplete,r=e.metaFields,o=e.canEditFile,i=e.i18n,a=e.onClick;return!n&&r&&r.length>0||!n&&o(t)?_n("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":i("editFile")+" "+t.meta.name,title:i("editFile"),onClick:function(){return a()}},_n("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},_n("g",{fillRule:"evenodd"},_n("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"}),_n("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),_n("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function Cn(e){var t=e.i18n,n=e.onClick;return _n("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 n()}},_n("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},_n("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"}),_n("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 Sn=function(e,t){var n,r;(n=t.file.uploadURL,r=t.i18n("copyLinkToClipboardFallback"),r=r||"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=n,document.body.appendChild(t),t.select();var o=function(){document.body.removeChild(t),window.prompt(r,n),e()};try{return document.execCommand("copy")?(document.body.removeChild(t),e()):o()}catch(Cd){return document.body.removeChild(t),o()}}))).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 kn(e){return _n("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 Sn(t,e)}},_n("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},_n("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 xn=function(e){var t=e.file,n=e.uploadInProgressOrComplete,r=e.canEditFile,o=e.metaFields,i=e.showLinkToFileUploadResult,a=e.showRemoveButton,s=e.i18n,l=e.removeFile,u=e.toggleFileCard,c=e.openFileEditor,p=e.log,d=e.info;return _n("div",{className:"uppy-Dashboard-Item-actionWrapper"},_n(wn,{i18n:s,file:t,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,onClick:function(){o&&o.length>0?u(!0,t.id):c(t)}}),i&&t.uploadURL?_n(kn,{file:t,i18n:s,info:d,log:p}):null,a?_n(Cn,{i18n:s,info:e.info,log:e.log,onClick:function(){return l(t.id,"removed-by-user")}}):null)};function Pn(e,t){return(Pn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var En=rn.h,On=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Pn(t,n);var o=r.prototype;return o.shouldComponentUpdate=function(e){return!function(e,t){if(e===t)return!0;for(var n in e)if(!(n in t))return!1;for(var n in t)if(e[n]!==t[n])return!1;return!0}(this.props,e)},o.componentDidMount=function(){var e=this.props.file;e.preview||this.props.handleRequestThumbnail(e)},o.componentDidUpdate=function(){var e=this.props.file;e.preview||this.props.handleRequestThumbnail(e)},o.componentWillUnmount=function(){var e=this.props.file;e.preview||this.props.handleCancelThumbnail(e)},o.render=function(){var e=this.props.file,t=e.progress.preprocess||e.progress.postprocess,n=e.progress.uploadComplete&&!t&&!e.error,r=e.progress.uploadStarted||t,o=e.progress.uploadStarted&&!e.progress.uploadComplete||t,i=e.error||!1,a=e.isGhost,s=(this.props.individualCancellation||!o)&&!n;n&&this.props.showRemoveButtonAfterComplete&&(s=!0);var l=st({"uppy-Dashboard-Item":!0,"is-inprogress":o&&!this.props.recoveredState,"is-processing":t,"is-complete":n,"is-error":!!i,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return En("div",{className:l,id:"uppy_"+e.id,role:this.props.role},En("div",{className:"uppy-Dashboard-Item-preview"},En(cn,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult}),En(vn,{file:e,error:i,isUploaded:n,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})),En("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},En(bn,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel}),En(xn,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:s,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,removeFile:this.props.removeFile,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,i18n:this.props.i18n,log:this.props.log,info:this.props.info})))},r}(rn.Component),An=["data","rowHeight","renderRow","overscanCount","sync"];function Un(){return(Un=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Nn(e,t){return(Nn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Tn=rn.h,Rn=rn.Component,Fn={position:"relative",width:"100%",minHeight:"100%"},Dn={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Mn=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).handleResize=function(){n.resize()},n.handleScroll=function(){n.setState({offset:n.base.scrollTop}),n.props.sync&&n.forceUpdate()},n.focusElement=null,n.state={offset:0,height:0},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Nn(t,n);var o=r.prototype;return o.resize=function(){this.state.height!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})},o.componentWillUpdate=function(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)},o.componentDidUpdate=function(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()},o.componentDidMount=function(){this.resize(),window.addEventListener("resize",this.handleResize)},o.componentWillUnmount=function(){window.removeEventListener("resize",this.handleResize)},o.render=function(e){var t=e.data,n=e.rowHeight,r=e.renderRow,o=e.overscanCount,i=void 0===o?10:o,a=(e.sync,function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,An)),s=this.state,l=s.offset,u=s.height,c=Math.floor(l/n),p=Math.floor(u/n);i&&(c=Math.max(0,c-c%i),p+=i);var d=c+p+4,h=t.slice(c,d),f=Un({},Fn,{height:t.length*n}),m=Un({},Dn,{top:c*n});return Tn("div",Un({onScroll:this.handleScroll},a),Tn("div",{role:"presentation",style:f},Tn("div",{role:"presentation",style:m},h.map(r))))},r}(Rn);function Bn(){return(Bn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var In=rn.h,Ln=function(e){var t=0===e.totalFileCount,n=st("uppy-Dashboard-files",{"uppy-Dashboard-files--noFiles":t}),r=1===e.itemsPerRow?71:200,o={id:e.id,error:e.error,i18n:e.i18n,log:e.log,info:e.info,acquirers:e.acquirers,resumableUploads:e.resumableUploads,individualCancellation:e.individualCancellation,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,isWide:e.isWide,metaFields:e.metaFields,recoveredState:e.recoveredState,retryUpload:e.retryUpload,pauseUpload:e.pauseUpload,cancelUpload:e.cancelUpload,toggleFileCard:e.toggleFileCard,removeFile:e.removeFile,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail},i=Object.keys(e.files);e.recoveredState&&i.sort((function(t,n){return e.files[n].isGhost-e.files[t].isGhost}));var a,s,l,u,c=(a=i,s=e.itemsPerRow,l=[],u=[],a.forEach((function(e,t){u.length<s?u.push(e):(l.push(u),u=[e])})),u.length&&l.push(u),l);return In(Mn,{class:n,role:"list",data:c,renderRow:function(t){return In("div",{role:"presentation",key:t[0]},t.map((function(t){return In(On,Bn({key:t},o,{role:"listitem",openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,file:e.files[t]}))})))},rowHeight:r})};function jn(e,t){return(jn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var zn=rn.h,Hn=function(e){var t,n;function r(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).triggerFileInputClick=function(){t.fileInput.click()},t.triggerFolderInputClick=function(){t.folderInput.click()},t.onFileInputChange=function(e){t.props.handleInputChange(e),e.target.value=null},t.renderHiddenInput=function(e,n){return zn("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==t.props.maxNumberOfFiles,onChange:t.onFileInputChange,accept:t.props.allowedFileTypes,ref:n})},t.renderMyDeviceAcquirer=function(){return zn("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},zn("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:t.triggerFileInputClick},zn("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},zn("g",{fill:"none",fillRule:"evenodd"},zn("rect",{className:"uppy-ProviderIconBg",width:"32",height:"32",rx:"16",fill:"#2275D7"}),zn("path",{d:"M21.973 21.152H9.863l-1.108-5.087h14.464l-1.246 5.087zM9.935 11.37h3.958l.886 1.444a.673.673 0 0 0 .585.316h6.506v1.37H9.935v-3.13zm14.898 3.44a.793.793 0 0 0-.616-.31h-.978v-2.126c0-.379-.275-.613-.653-.613H15.75l-.886-1.445a.673.673 0 0 0-.585-.316H9.232c-.378 0-.667.209-.667.587V14.5h-.782a.793.793 0 0 0-.61.303.795.795 0 0 0-.155.663l1.45 6.633c.078.36.396.618.764.618h13.354c.36 0 .674-.246.76-.595l1.631-6.636a.795.795 0 0 0-.144-.675z",fill:"#FFF"}))),zn("div",{className:"uppy-DashboardTab-name"},t.props.i18n("myDevice"))))},t.renderBrowseButton=function(e,n){var r=t.props.acquirers.length;return zn("button",{type:"button",className:"uppy-u-reset uppy-Dashboard-browse",onClick:n,"data-uppy-super-focusable":0===r},e)},t.renderDropPasteBrowseTagline=function(){var e=t.props.acquirers.length,n=t.props.fileManagerSelectionType,r=n.charAt(0).toUpperCase()+n.slice(1),o="browse",i="browse",a="browse";if("files"===n)try{o=t.props.i18n("browse"),i=t.props.i18n("browse"),a=t.props.i18n("browse")}catch(p){}try{i=t.props.i18n("browseFiles"),a=t.props.i18n("browseFolders")}catch(d){}var s,l=t.renderBrowseButton(o,t.triggerFileInputClick),u=t.renderBrowseButton(i,t.triggerFileInputClick),c=t.renderBrowseButton(a,t.triggerFolderInputClick);if(s=e>0?t.props.i18nArray("dropPasteImport"+r,{browseFiles:u,browseFolders:c,browse:l}):t.props.i18nArray("dropPaste"+r,{browseFiles:u,browseFolders:c,browse:l}),"files"===n)try{s=e>0?t.props.i18nArray("dropPasteImport",{browse:l}):t.props.i18nArray("dropPaste",{browse:l})}catch(h){}return t.props.disableLocalFiles&&(s=t.props.i18n("importFiles")),zn("div",{className:"uppy-Dashboard-AddFiles-title"},s)},t.renderAcquirer=function(e){return zn("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},zn("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(),zn("div",{className:"uppy-DashboardTab-name"},e.name)))},t.renderAcquirers=function(e,n){var r=[].concat(e),o=r.splice(e.length-2,e.length);return zn("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},!n&&t.renderMyDeviceAcquirer(),r.map((function(e){return t.renderAcquirer(e)})),zn("span",{role:"presentation",style:"white-space: nowrap;"},o.map((function(e){return t.renderAcquirer(e)}))))},t}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,jn(t,n);var o=r.prototype;return o.renderPoweredByUppy=function(){var e=zn("span",null,zn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},zn("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),zn("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),t=this.props.i18nArray("poweredBy2",{backwardsCompat:this.props.i18n("poweredBy"),uppy:e});return zn("a",{tabIndex:"-1",href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},t)},o.render=function(){var e=this;return zn("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),zn("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&zn("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))},r}(rn.Component),Wn=rn.h,Vn=function(e){return Wn("div",{className:st("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":e.showAddFilesPanel},Wn("div",{className:"uppy-DashboardContent-bar"},Wn("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("addingMoreFiles")),Wn("button",{className:"uppy-DashboardContent-back",type:"button",onClick:function(t){return e.toggleAddFilesPanel(!1)}},e.i18n("back"))),Wn(Hn,e))},qn=function(e){var t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()},Xn=rn.h,Gn=function(e){return Xn("div",{className:st("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:"uppy-DashboardContent-panel--"+e.activePickerPanel.id,onDragOver:qn,onDragLeave:qn,onDrop:qn,onPaste:qn},Xn("div",{className:"uppy-DashboardContent-bar"},Xn("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("importFrom",{name:e.activePickerPanel.name})),Xn("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.hideAllPanels},e.i18n("cancel"))),Xn("div",{className:"uppy-DashboardContent-panelBody"},e.getPlugin(e.activePickerPanel.id).render(e.state)))},Yn=rn.h,$n=function(e){var t=this.props.files[this.props.fileCardFor];return Yn("div",{className:st("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},Yn("div",{className:"uppy-DashboardContent-bar"},Yn("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18nArray("editing",{file:Yn("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),Yn("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.hideAllPanels},e.i18n("cancel")),Yn("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor},e.i18n("save"))),Yn("div",{className:"uppy-DashboardContent-panelBody"},e.editors.map((function(t){return e.getPlugin(t.id).render(e.state)}))))},Kn=rn.h,Jn="error",Qn="waiting",Zn="preprocessing",er="uploading",tr="postprocessing",nr="complete",rr="paused";function or(e){switch(function(e,t,n,r){if(void 0===r&&(r={}),e)return Jn;if(t)return nr;if(n)return rr;for(var o=Qn,i=Object.keys(r),a=0;a<i.length;a++){var s=r[i[a]].progress;if(s.uploadStarted&&!s.uploadComplete)return er;s.preprocess&&o!==er&&(o=Zn),s.postprocess&&o!==er&&o!==Zn&&(o=tr)}return o}(e.isAllErrored,e.isAllComplete,e.isAllPaused,e.files)){case"uploading":return e.i18n("uploadingXFiles",{smart_count:e.inProgressNotPausedFiles.length});case"preprocessing":case"postprocessing":return e.i18n("processingXFiles",{smart_count:e.processingFiles.length});case"paused":return e.i18n("uploadPaused");case"waiting":return e.i18n("xFilesSelected",{smart_count:e.newFiles.length});case"complete":return e.i18n("uploadComplete")}}var ir=function(e){var t=e.allowNewUpload;return t&&e.maxNumberOfFiles&&(t=e.totalFileCount<e.maxNumberOfFiles),Kn("div",{className:"uppy-DashboardContent-bar"},e.isAllComplete||e.hideCancelButton?Kn("div",null):Kn("button",{className:"uppy-DashboardContent-back",type:"button",onClick:e.cancelAll},e.i18n("cancel")),Kn("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},Kn(or,e)),t?Kn("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e.i18n("addMoreFiles"),title:e.i18n("addMoreFiles"),onClick:function(){return e.toggleAddFilesPanel(!0)}},Kn("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},Kn("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),Kn("span",{className:"uppy-DashboardContent-addMoreCaption"},e.i18n("addMore"))):Kn("div",null))};function ar(){return(ar=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function sr(e,t){return(sr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var lr=rn.h,ur=function(e){var t,n;function r(t){var n;(n=e.call(this,t)||this).updateMeta=function(e,t){var r;n.setState({formState:ar({},n.state.formState,(r={},r[t]=e,r))})},n.handleSave=function(e){e.preventDefault();var t=n.props.fileCardFor;n.props.saveFileCard(n.state.formState,t)},n.handleCancel=function(){n.props.toggleFileCard(!1)},n.saveOnEnter=function(e){if(13===e.keyCode){e.stopPropagation(),e.preventDefault();var t=n.props.files[n.props.fileCardFor];n.props.saveFileCard(n.state.formState,t.id)}},n.renderMetaFields=function(){var e=n.getMetaFields()||[],t={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map((function(e){var r="uppy-Dashboard-FileCard-input-"+e.id,o=n.props.requiredMetaFields.includes(e.id);return lr("fieldset",{key:e.id,className:"uppy-Dashboard-FileCard-fieldset"},lr("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:r},e.name),void 0!==e.render?e.render({value:n.state.formState[e.id],onChange:function(t){return n.updateMeta(t,e.id)},fieldCSSClasses:t,required:o},lr):lr("input",{className:t.text,id:r,type:e.type||"text",required:o,value:n.state.formState[e.id],placeholder:e.placeholder,onKeyUp:n.saveOnEnter,onKeyDown:n.saveOnEnter,onKeyPress:n.saveOnEnter,onInput:function(t){return n.updateMeta(t.target.value,e.id)},"data-uppy-super-focusable":!0}))}))};var r=n.props.files[n.props.fileCardFor],o=n.getMetaFields()||[],i={};return o.forEach((function(e){i[e.id]=r.meta[e.id]||""})),n.state={formState:i},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,sr(t,n);var o=r.prototype;return o.getMetaFields=function(){return"function"==typeof this.props.metaFields?this.props.metaFields(this.props.files[this.props.fileCardFor]):this.props.metaFields},o.render=function(){var e=this,t=this.props.files[this.props.fileCardFor],n=this.props.canEditFile(t);return lr("div",{className:st("uppy-Dashboard-FileCard",this.props.className),"data-uppy-panelType":"FileCard",onDragOver:qn,onDragLeave:qn,onDrop:qn,onPaste:qn},lr("div",{className:"uppy-DashboardContent-bar"},lr("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},this.props.i18nArray("editing",{file:lr("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),lr("button",{className:"uppy-DashboardContent-back",type:"button",title:this.props.i18n("finishEditingFile"),onClick:this.handleCancel},this.props.i18n("cancel"))),lr("div",{className:"uppy-Dashboard-FileCard-inner"},lr("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:an(t.type).color}},lr(ln,{file:t}),n&&lr("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:function(){return e.props.openFileEditor(t)}},this.props.i18n("editFile"))),lr("div",{className:"uppy-Dashboard-FileCard-info"},this.renderMetaFields()),lr("div",{className:"uppy-Dashboard-FileCard-actions"},lr("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:this.handleSave},this.props.i18n("saveChanges")),lr("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:this.handleCancel},this.props.i18n("cancel")))))},r}(rn.Component);function cr(e,t){return(cr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var pr=rn.cloneElement,dr=rn.Component,hr="uppy-transition-slideDownUp",fr=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).state={cachedChildren:null,className:""},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,cr(t,n);var o=r.prototype;return o.componentWillUpdate=function(e){var t=this,n=this.state.cachedChildren,r=e.children[0];if(n!==r){var o={cachedChildren:r};r&&!n&&(o.className=hr+"-enter",cancelAnimationFrame(this.animationFrame),clearTimeout(this.leaveTimeout),this.leaveTimeout=void 0,this.animationFrame=requestAnimationFrame((function(){t.base.getBoundingClientRect(),t.setState({className:hr+"-enter "+hr+"-enter-active"}),t.enterTimeout=setTimeout((function(){t.setState({className:""})}),250)}))),n&&!r&&void 0===this.leaveTimeout&&(o.cachedChildren=n,o.className=hr+"-leave",cancelAnimationFrame(this.animationFrame),clearTimeout(this.enterTimeout),this.enterTimeout=void 0,this.animationFrame=requestAnimationFrame((function(){t.setState({className:hr+"-leave "+hr+"-leave-active"}),t.leaveTimeout=setTimeout((function(){t.setState({cachedChildren:null,className:""})}),250)}))),this.setState(o)}},o.render=function(){var e=this.state,t=e.cachedChildren,n=e.className;return t?pr(t,{className:st(n,t.attributes.className)}):null},r}(dr),mr=function(){var e=document.createElement("div");return"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&"FormData"in window&&"FileReader"in window};function vr(){return(vr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var gr=rn.h,yr="error",br="waiting",_r="preprocessing",wr="uploading",Cr="postprocessing",Sr="complete",kr=function(e){var t,n=(t=e,{hours:Math.floor(t/3600)%24,minutes:Math.floor(t/60)%60,seconds:Math.floor(t%60)}),r=n.hours?n.hours+"h ":"",o=n.hours?("0"+n.minutes).substr(-2):n.minutes,i=o?o+"m":"",a=o?("0"+n.seconds).substr(-2):n.seconds;return""+r+i+(n.hours?"":o?" "+a+"s":a+"s")},xr={exports:{}};function Pr(){return(Pr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};xr.exports=N}();var Er,Or,Ar=(xr=xr.exports).h,Ur=function(e){var t=st("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":e.uploadState===br},{"uppy-StatusBar-actionBtn--disabled":e.isSomeGhost}),n=e.newFiles&&e.isUploadStarted&&!e.recoveredState?e.i18n("uploadXNewFiles",{smart_count:e.newFiles}):e.i18n("uploadXFiles",{smart_count:e.newFiles});return Ar("button",{type:"button",className:t,"aria-label":e.i18n("uploadXFiles",{smart_count:e.newFiles}),onClick:e.startUpload,disabled:e.isSomeGhost,"data-uppy-super-focusable":!0},n)},Nr=function(e){return Ar("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e.i18n("retryUpload"),onClick:e.retryAll,"data-uppy-super-focusable":!0},Ar("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},Ar("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),e.i18n("retry"))},Tr=function(e){return Ar("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e.i18n("cancel"),"aria-label":e.i18n("cancel"),onClick:e.cancelAll,"data-uppy-super-focusable":!0},Ar("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},Ar("g",{fill:"none",fillRule:"evenodd"},Ar("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Ar("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))},Rr=function(e){var t=e.isAllPaused,n=(0,e.i18n)(t?"resume":"pause");return Ar("button",{title:n,"aria-label":n,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){return function(e){if(!e.isAllComplete)return e.resumableUploads?e.isAllPaused?e.resumeAll():e.pauseAll():e.cancelAll()}(e)},"data-uppy-super-focusable":!0},Ar("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},Ar("g",{fill:"none",fillRule:"evenodd"},Ar("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Ar("path",t?{fill:"#FFF",d:"M6 4.25L11.5 8 6 11.75z"}:{d:"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z",fill:"#FFF"}))))},Fr=function(e){var t=e.i18n;return Ar("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:e.doneButtonHandler,"data-uppy-super-focusable":!0},t("done"))},Dr=function(){return Ar("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},Ar("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))},Mr=function(e){var t=Math.round(100*e.value);return Ar("div",{className:"uppy-StatusBar-content"},Ar(Dr,null),"determinate"===e.mode?t+"% \xb7 ":"",e.message)},Br=function(e){return Ar("div",{className:"uppy-StatusBar-statusSecondary"},e.i18n("filesUploadedOfTotal",{complete:e.complete,smart_count:e.numUploads}))},Ir=function(e){var t=st("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return Ar("div",{className:"uppy-StatusBar-statusSecondary"},Ar("div",{className:"uppy-StatusBar-statusSecondaryHint"},e.i18n("xMoreFilesAdded",{smart_count:e.newFiles})),Ar("button",{type:"button",className:t,"aria-label":e.i18n("uploadXFiles",{smart_count:e.newFiles}),onClick:e.startUpload},e.i18n("upload")))},Lr=z((function(e){var t=e.numUploads>1;return Ar("div",{className:"uppy-StatusBar-statusSecondary"},t&&e.i18n("filesUploadedOfTotal",{complete:e.complete,smart_count:e.numUploads}),Ar("span",{className:"uppy-StatusBar-additionalInfo"},t&&" \xb7 ",e.i18n("dataUploadedOfTotal",{complete:W(e.totalUploadedSize),total:W(e.totalSize)})," \xb7 ",e.i18n("xTimeLeft",{time:kr(e.totalETA)})))}),500,{leading:!0,trailing:!0}),jr=function(e){if(!e.isUploadStarted||e.isAllComplete)return null;var t=e.isAllPaused?e.i18n("paused"):e.i18n("uploading"),n=e.newFiles&&e.isUploadStarted;return Ar("div",{className:"uppy-StatusBar-content","aria-label":t,title:t},e.isAllPaused?null:Ar(Dr,null),Ar("div",{className:"uppy-StatusBar-status"},Ar("div",{className:"uppy-StatusBar-statusPrimary"},e.supportsUploadProgress?t+": "+e.totalProgress+"%":t),e.isAllPaused||n||!e.showProgressDetails?null:e.supportsUploadProgress?Ar(Lr,e):Ar(Br,e),n?Ar(Ir,e):null))},zr=function(e){e.totalProgress;var t=e.i18n;return Ar("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},Ar("div",{className:"uppy-StatusBar-status"},Ar("div",{className:"uppy-StatusBar-statusPrimary"},Ar("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},Ar("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))},Hr=function(e){var t=e.error,n=(e.retryAll,e.hideRetryButton,e.i18n);return Ar("div",{className:"uppy-StatusBar-content",role:"alert",title:n("uploadFailed")},Ar("div",{className:"uppy-StatusBar-status"},Ar("div",{className:"uppy-StatusBar-statusPrimary"},Ar("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},Ar("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"})),n("uploadFailed"))),Ar("span",{className:"uppy-StatusBar-details","aria-label":t,"data-microtip-position":"top-right","data-microtip-size":"medium",role:"tooltip",onClick:function(){var e=n("uploadFailed")+" \n\n "+t;alert(e)}},"?"))},Wr=function(e){for(;e&&!e.dir;)e=e.parentNode;return e?e.dir:void 0};function Vr(){return(Vr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function qr(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xr(e,t){return(Xr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Gr,Yr,$r=(Or=Er=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).startUpload=function(){if(!r.uppy.getState().recoveredState)return r.uppy.upload().catch((function(){}));r.uppy.emit("restore-confirmed")},r.id=r.opts.id||"StatusBar",r.title="StatusBar",r.type="progressindicator",r.defaultLocale={strings:{uploading:"Uploading",upload:"Upload",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",retryUpload:"Retry upload",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"}}},r.opts=Vr({},{target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},n),r.i18nInit(),r.render=r.render.bind(qr(r)),r.install=r.install.bind(qr(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Xr(t,n);var o=r.prototype;return o.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},o.i18nInit=function(){this.translator=new x([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},o.getTotalSpeed=function(e){var t=0;return e.forEach((function(e){t+=function(e){if(!e.bytesUploaded)return 0;var t=new Date-e.uploadStarted;return e.bytesUploaded/(t/1e3)}(e.progress)})),t},o.getTotalETA=function(e){var t=this.getTotalSpeed(e);if(0===t)return 0;var n=e.reduce((function(e,t){return e+((n=t.progress).bytesTotal-n.bytesUploaded);var n}),0);return Math.round(n/t*10)/10},o.getUploadingState=function(e,t,n,r){if(e)return yr;if(t)return Sr;if(n)return br;for(var o=br,i=Object.keys(r),a=0;a<i.length;a++){var s=r[i[a]].progress;if(s.uploadStarted&&!s.uploadComplete)return wr;s.preprocess&&o!==wr&&(o=_r),s.postprocess&&o!==wr&&o!==_r&&(o=Cr)}return o},o.render=function(e){var t=e.capabilities,n=e.files,r=e.allowNewUpload,o=e.totalProgress,i=e.error,a=e.recoveredState,s=Object.keys(n).map((function(e){return n[e]})),l=s.filter((function(e){return!e.progress.uploadStarted&&!e.progress.preprocess&&!e.progress.postprocess}));a&&(l=s);var u=s.filter((function(e){return e.progress.uploadStarted})).filter((function(e){return e.isPaused})),c=s.filter((function(e){return e.progress.uploadComplete})),p=s.filter((function(e){return e.error})),d=s.filter((function(e){return!e.progress.uploadComplete&&e.progress.uploadStarted})),h=d.filter((function(e){return!e.isPaused})),f=s.filter((function(e){return e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess})),m=s.filter((function(e){return e.progress.preprocess||e.progress.postprocess})),v=this.getTotalETA(h),g=0,y=0;f.forEach((function(e){g+=e.progress.bytesTotal||0,y+=e.progress.bytesUploaded||0}));var b=f.length>0,_=100===o&&c.length===Object.keys(n).length&&0===m.length,w=i&&p.length===s.length,C=0!==d.length&&u.length===d.length,S=d.length>0,k=t.resumableUploads||!1,x=!1!==t.uploadProgress,P=s.some((function(e){return e.isGhost}));return function(e){var t,n,r=e=e||{},o=r.newFiles,i=r.allowNewUpload,a=r.isUploadInProgress,s=r.isAllPaused,l=r.resumableUploads,u=r.error,c=r.hideUploadButton,p=r.hidePauseResumeButton,d=r.hideCancelButton,h=r.hideRetryButton,f=r.recoveredState,m=e.uploadState,v=e.totalProgress;if(m===_r||m===Cr){var g=function(e){var t=[];Object.keys(e).forEach((function(n){var r=e[n].progress;r.preprocess&&t.push(r.preprocess),r.postprocess&&t.push(r.postprocess)}));var n=t[0];return{mode:n.mode,message:n.message,value:t.filter((function(e){return"determinate"===e.mode})).reduce((function(e,t,n,r){return e+t.value/r.length}),0)}}(e.files);"determinate"===(t=g.mode)&&(v=100*g.value),n=Mr(g)}else m===Sr?n=zr(e):m===wr?(e.supportsUploadProgress||(t="indeterminate",v=null),n=jr(e)):m===yr&&(v=void 0,n=Hr(e));var y="number"==typeof v?v:100,b=m===br&&e.hideUploadButton||m===br&&!e.newFiles>0||m===Sr&&e.hideAfterFinish,_=!u&&o&&!a&&!s&&i&&!c;f&&(b=!1,_=!0);var w=!d&&m!==br&&m!==Sr,C=l&&!p&&m===wr,S=u&&!h,k=e.doneButtonHandler&&m===Sr,x="uppy-StatusBar-progress\n "+(t?"is-"+t:""),P=st({"uppy-Root":e.isTargetDOMEl},"uppy-StatusBar","is-"+m,{"has-ghosts":e.isSomeGhost});return Ar("div",{className:P,"aria-hidden":b},Ar("div",{className:x,style:{width:y+"%"},role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":v}),n,Ar("div",{className:"uppy-StatusBar-actions"},_?Ar(Ur,Pr({},e,{uploadState:m})):null,S?Ar(Nr,e):null,C?Ar(Rr,e):null,w?Ar(Tr,e):null,k?Ar(Fr,e):null))}({error:i,uploadState:this.getUploadingState(w,_,a,e.files||{}),allowNewUpload:r,totalProgress:o,totalSize:g,totalUploadedSize:y,isAllComplete:_,isAllPaused:C,isAllErrored:w,isUploadStarted:b,isUploadInProgress:S,isSomeGhost:P,recoveredState:a,complete:c.length,newFiles:l.length,numUploads:f.length,totalETA:v,files:n,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:x,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})},o.onMount=function(){var e=this.el;Wr(e)||(e.dir="ltr")},o.install=function(){var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.unmount()},r}(ue.Plugin),Er.VERSION="1.9.6",Or),Kr={exports:{}};function Jr(){return(Jr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Qr(e,t){return(Qr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};Kr.exports=N}(),Kr=Kr.exports;for(var Zr=ue.Plugin,eo=Kr.h,to=(Yr=Gr=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).render=function(e){var t=e.info,n=t.isHidden,o=t.message,i=t.details;return eo("div",{className:"uppy uppy-Informer","aria-hidden":n},eo("p",{role:"alert"},o," ",i&&eo("span",{"aria-label":i,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:function(){alert(o+" \n\n "+i)},onMouseOver:function(){clearTimeout(r.uppy.infoTimeoutID)},onMouseLeave:function(){r.uppy.infoTimeoutID=setTimeout(r.uppy.hideInfo,2e3)}},"?")))},r.type="progressindicator",r.id=r.opts.id||"Informer",r.title="Informer",r.opts=Jr({},{},n),r}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Qr(t,n),r.prototype.install=function(){var e=this.opts.target;e&&this.mount(e,this)},r}(Zr),Gr.VERSION="1.6.6",Yr),no=function(e,t,n){var r=e.split(",")[1],o=t.mimeType||e.split(",")[0].split(":")[1].split(";")[0];null==o&&(o="plain/text");for(var i,a=atob(r),s=[],l=0;l<a.length;l++)s.push(a.charCodeAt(l));try{i=new Uint8Array(s)}catch(Cd){return null}return n?new File([i],t.name||"",{type:o}):new Blob([i],{type:o})},ro=function(e){return 0===e.indexOf("blob:")},oo=Math.log2||function(e){return Math.log(e)*Math.LOG2E},io={toByteArray:function(e){var t,n,r=ho(e),o=r[0],i=r[1],a=new lo(function(e,t,n){return 3*(t+n)/4-n}(0,o,i)),s=0,l=i>0?o-4:o;for(n=0;n<l;n+=4)t=so[e.charCodeAt(n)]<<18|so[e.charCodeAt(n+1)]<<12|so[e.charCodeAt(n+2)]<<6|so[e.charCodeAt(n+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=255&t;return 2===i&&(t=so[e.charCodeAt(n)]<<2|so[e.charCodeAt(n+1)]>>4,a[s++]=255&t),1===i&&(t=so[e.charCodeAt(n)]<<10|so[e.charCodeAt(n+1)]<<4|so[e.charCodeAt(n+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t),a},fromByteArray:function(e){for(var t,n=e.length,r=n%3,o=[],i=0,a=n-r;i<a;i+=16383)o.push(fo(e,i,i+16383>a?a:i+16383));return 1===r?(t=e[n-1],o.push(ao[t>>2]+ao[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],o.push(ao[t>>10]+ao[t>>4&63]+ao[t<<2&63]+"=")),o.join("")}},ao=[],so=[],lo="undefined"!=typeof Uint8Array?Uint8Array:Array,uo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",co=0,po=uo.length;co<po;++co)ao[co]=uo[co],so[uo.charCodeAt(co)]=co;function ho(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function fo(e,t,n){for(var r,o,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(ao[(o=r)>>18&63]+ao[o>>12&63]+ao[o>>6&63]+ao[63&o]);return i.join("")}so["-".charCodeAt(0)]=62,so["_".charCodeAt(0)]=63;var mo,vo,go={read:function(e,t,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,u=l>>1,c=-7,p=n?o-1:0,d=n?-1:1,h=e[t+p];for(p+=d,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+e[t+p],p+=d,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=r;c>0;a=256*a+e[t+p],p+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),i-=u}return(h?-1:1)*a*Math.pow(2,i-r)},write:function(e,t,n,r,o,i){var a,s,l,u=8*i-o-1,c=(1<<u)-1,p=c>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+p>=1?d/l:d*Math.pow(2,1-p))*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*l-1)*Math.pow(2,o),a+=p):(s=t*Math.pow(2,p-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=f,s/=256,o-=8);for(a=a<<o|s,u+=o;u>0;e[n+h]=255&a,h+=f,a/=256,u-=8);e[n+h-f]|=128*m}},yo={exports:{}};function bo(){return(bo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _o(e,t){return(_o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(function(e,t,n){(function(){var r,o;r=this,o=function(r){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}});var n=["prototype","__proto__","caller","arguments","length","name"];Object.getOwnPropertyNames(t).forEach((function(r){-1===n.indexOf(r)&&e[r]!==t[r]&&(e[r]=t[r])})),t&&c(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}function d(e,t,n){return(d=p()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&c(o,n.prototype),o}).apply(null,arguments)}function h(e){var t="function"==typeof Map?new Map:void 0;return(h=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return d(e,arguments,u(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)})(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){var t=p();return function(){var n,r=u(e);if(t){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?f(e):t}(this,n)}}function v(e,t,n){return(v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}var g=Object.values||function(e){var t=[];for(var n in e)t.push(e[n]);return t},y=Object.entries||function(e){var t=[];for(var n in e)t.push([n,e[n]]);return t},b=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.forEach((function(t){for(var n in t)e[n]=t[n]})),e},_=Object.fromEntries||function(e){var t={};return w(e).forEach((function(e){var n=e[0],r=e[1];t[n]=r})),t},w=Array.from||function(e){if(e instanceof E){var t=[];return e.forEach((function(e,n){return t.push([n,e])})),t}return Array.prototype.slice.call(e)};function C(e){return-1!==this.indexOf(e)}Array.prototype.includes||(Array.prototype.includes=C),String.prototype.includes||(String.prototype.includes=C),String.prototype.startsWith||(String.prototype.startsWith=function(e){var t=arguments.length>1&&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 S="undefined"!=typeof self?self:t,k=S.fetch||function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,r){var o=new XMLHttpRequest;if(o.open("get",e,!0),o.responseType="arraybuffer",o.onerror=r,t.headers)for(var i in t.headers)o.setRequestHeader(i,t.headers[i]);o.onload=function(){n({ok:o.status>=200&&o.status<300,status:o.status,arrayBuffer:function(){return Promise.resolve(o.response)}})},o.send(null)}))},x=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 n=0;n<e.length;n++)t.add(e[n]);return t},P=function(e){return new E(e)},E=void 0!==S.Map&&void 0!==S.Map.prototype.keys?S.Map:function(){function e(t){if(o(this,e),this.clear(),t)for(var n=0;n<t.length;n++)this.set(t[n][0],t[n][1])}return a(e,[{key:"clear",value:function(){this._map={},this._keys=[]}},{key:"size",get:function(){return this._keys.length}},{key:"get",value:function(e){return this._map["map_"+e]}},{key:"set",value:function(e,t){return this._map["map_"+e]=t,this._keys.indexOf(e)<0&&this._keys.push(e),this}},{key:"has",value:function(e){return this._keys.indexOf(e)>=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 n=0;n<this._keys.length;n++)e.call(t,this._map["map_"+this._keys[n]],this._keys[n],this)}}]),e}(),O="undefined"!=typeof self?self:t,A="undefined"!=typeof navigator,U=A&&"undefined"==typeof HTMLImageElement,N=!(void 0===t||void 0===e||!e.versions||!e.versions.node),T=O.Buffer,R=!!T,F=function(e){return void 0!==e};function D(e){return void 0===e||(e instanceof E?0===e.size:0===g(e).filter(F).length)}function M(e){var t=new Error(e);throw delete t.stack,t}function B(e){var t=function(e){var t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}var I=function(e){return String.fromCharCode.apply(null,e)},L="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0,j=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;if(o(this,e),"boolean"==typeof i&&(this.le=i),Array.isArray(t)&&(t=new Uint8Array(t)),0===t)this.byteOffset=0,this.byteLength=0;else if(t instanceof ArrayBuffer){void 0===r&&(r=t.byteLength-n);var a=new DataView(t,n,r);this._swapDataView(a)}else if(t instanceof Uint8Array||t instanceof DataView||t instanceof e){void 0===r&&(r=t.byteLength-n),(n+=t.byteOffset)+r>t.byteOffset+t.byteLength&&M("Creating view outside of available memory in ArrayBuffer");var s=new DataView(t.buffer,n,r);this._swapDataView(s)}else if("number"==typeof t){var l=new DataView(new ArrayBuffer(t));this._swapDataView(l)}else M("Invalid input argument for BufferView: "+t)}return a(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,n){var r=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||M("BufferView.set(): Invalid data argument."),this.toUint8().set(t,n),new r(this,n,t.byteLength)}},{key:"subarray",value:function(t,n){return new e(this,t,n=n||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 L?L.decode(e):R?n.from(e).toString("utf8"):decodeURIComponent(escape(I(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,n=this.getUint8Array(e,t);return I(n)}},{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,n=[],r=0;r<t&&e+r<this.byteLength;r+=2)n.push(this.getUint16(e+r));return I(n)}},{key:"getInt8",value:function(e){return this.dataView.getInt8(e)}},{key:"getUint8",value:function(e){return this.dataView.getUint8(e)}},{key:"getInt16",value:function(e){var t=arguments.length>1&&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,n){switch(t){case 1:return this.getUint8(e,n);case 2:return this.getUint16(e,n);case 4:return this.getUint32(e,n);case 8:return this.getUint64&&this.getUint64(e,n)}}},{key:"getUint",value:function(e,t,n){switch(t){case 8:return this.getUint8(e,n);case 16:return this.getUint16(e,n);case 32:return this.getUint32(e,n);case 64:return this.getUint64&&this.getUint64(e,n)}}},{key:"toString",value:function(e){return this.dataView.toString(e,this.constructor.name)}},{key:"ensureChunk",value:function(){}}],[{key:"from",value:function(t,n){return t instanceof this&&t.le===n?t:new e(t,void 0,void 0,n)}}]),e}();function z(e,t){M("".concat(e," '").concat(t,"' was not loaded, try using full build of exifr."))}var H=function(e){l(n,h(E));var t=m(n);function n(e){var r;return o(this,n),(r=t.call(this)).kind=e,r}return a(n,[{key:"get",value:function(e,t){return this.has(e)||z(this.kind,e),t&&(e in t||function(e,t){M("Unknown ".concat(e," '").concat(t,"'."))}(this.kind,e),t[e].enabled||z(this.kind,e)),v(u(n.prototype),"get",this).call(this,e)}},{key:"keyList",value:function(){return w(this.keys())}}]),n}(),W=new H("file parser"),V=new H("segment parser"),q=new H("file reader");function X(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function G(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var Y=X((function(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){return t(r.result||new ArrayBuffer)},r.onerror=n,r.readAsArrayBuffer(e)}))})),$=X((function(e){return k(e).then((function(e){return e.arrayBuffer()}))})),K=X((function(e,t){return G(t(e),(function(e){return new j(e)}))})),J=X((function(e,t,n){var r=new(q.get(n))(e,t);return G(r.read(),(function(){return r}))})),Q=X((function(e,t,n,r){return q.has(n)?J(e,t,n):r?K(e,r):(M("Parser ".concat(n," is not loaded")),G())})),Z="Invalid input argument";function ee(e,t){return(n=e).startsWith("data:")||n.length>1e4?J(e,t,"base64"):A?Q(e,t,"url",$):N?J(e,t,"fs"):void M(Z);var n}var te=function(e){l(n,h(E));var t=m(n);function n(){return o(this,n),t.apply(this,arguments)}return a(n,[{key:"tagKeys",get:function(){return this.allKeys||(this.allKeys=w(this.keys())),this.allKeys}},{key:"tagValues",get:function(){return this.allValues||(this.allValues=w(this.values())),this.allValues}}]),n}();function ne(e,t,n){var r=new te,o=n;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=w(o));for(var i=0;i<o.length;i++){var a=o[i],s=a[0],l=a[1];r.set(s,l)}if(Array.isArray(t)){var u=t;Array.isArray(u)||("function"==typeof u.entries&&(u=u.entries()),u=w(u));for(var c=0;c<u.length;c++){var p=u[c];e.set(p,r)}}else e.set(t,r);return r}function re(e,t,n){var r,o=e.get(t),i=n;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=w(i));for(var a=0;a<i.length;a++)r=i[a],o.set(r[0],r[1])}var oe=P(),ie=P(),ae=P(),se=37500,le=37510,ue=40965,ce=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],pe=["jfif","xmp","icc","iptc","ihdr"],de=["tiff"].concat(pe),he=["ifd0","ifd1","exif","gps","interop"],fe=[].concat(de,he),me=["makerNote","userComment"],ve=["translateKeys","translateValues","reviveValues","multiSegment"],ge=[].concat(ve,["sanitize","mergeOutput","silentErrors"]),ye=function(){function e(){o(this,e)}return a(e,[{key:"translate",get:function(){return this.translateKeys||this.translateValues||this.reviveValues}}]),e}(),be=function(e){l(n,ye);var t=m(n);function n(e,r,i,a){var l;if(o(this,n),s(f(l=t.call(this)),"enabled",!1),s(f(l),"skip",x()),s(f(l),"pick",x()),s(f(l),"deps",x()),s(f(l),"translateKeys",!1),s(f(l),"translateValues",!1),s(f(l),"reviveValues",!1),l.key=e,l.enabled=r,l.parse=l.enabled,l.applyInheritables(a),l.canBeFiltered=he.includes(e),l.canBeFiltered&&(l.dict=oe.get(e)),void 0!==i)if(Array.isArray(i))l.parse=l.enabled=!0,l.canBeFiltered&&i.length>0&&l.translateTagSet(i,l.pick);else if("object"==typeof i){if(l.enabled=!0,l.parse=!1!==i.parse,l.canBeFiltered){var u=i.pick,c=i.skip;u&&u.length>0&&l.translateTagSet(u,l.pick),c&&c.length>0&&l.translateTagSet(c,l.skip)}l.applyInheritables(i)}else!0===i||!1===i?l.parse=l.enabled=i:M("Invalid options argument: ".concat(i));return l}return a(n,[{key:"needed",get:function(){return this.enabled||this.deps.size>0}},{key:"applyInheritables",value:function(e){var t,n,r=ve;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=w(r));for(var o=0;o<r.length;o++)void 0!==(n=e[t=r[o]])&&(this[t]=n)}},{key:"translateTagSet",value:function(e,t){if(this.dict){var n,r,o=this.dict,i=o.tagKeys,a=o.tagValues,s=e;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=w(s));for(var l=0;l<s.length;l++)"string"==typeof(n=s[l])?(-1===(r=a.indexOf(n))&&(r=i.indexOf(Number(n))),-1!==r&&t.add(Number(i[r]))):t.add(n)}else{var u=e;Array.isArray(u)||("function"==typeof u.entries&&(u=u.entries()),u=w(u));for(var c=0;c<u.length;c++){var p=u[c];t.add(p)}}}},{key:"finalizeFilters",value:function(){!this.enabled&&this.deps.size>0?(this.enabled=!0,xe(this.pick,this.deps)):this.enabled&&this.pick.size>0&&xe(this.pick,this.deps)}}]),n}(),_e={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},we=P(),Ce=function(e){l(n,ye);var t=m(n);function n(e){var r;return o(this,n),r=t.call(this),!0===e?r.setupFromTrue():void 0===e?r.setupFromUndefined():Array.isArray(e)?r.setupFromArray(e):"object"==typeof e?r.setupFromObject(e):M("Invalid options argument ".concat(e)),void 0===r.firstChunkSize&&(r.firstChunkSize=A?r.firstChunkSizeBrowser:r.firstChunkSizeNode),r.mergeOutput&&(r.ifd1.enabled=!1),r.filterNestedSegmentTags(),r.traverseTiffDependencyTree(),r.checkLoadedPlugins(),r}return a(n,[{key:"setupFromUndefined",value:function(){var e,t=ce;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=w(t));for(var n=0;n<t.length;n++)this[e=t[n]]=_e[e];var r=ge;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=w(r));for(var o=0;o<r.length;o++)this[e=r[o]]=_e[e];var i=me;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=w(i));for(var a=0;a<i.length;a++)this[e=i[a]]=_e[e];var s=fe;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=w(s));for(var l=0;l<s.length;l++)this[e=s[l]]=new be(e,_e[e],void 0,this)}},{key:"setupFromTrue",value:function(){var e,t=ce;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=w(t));for(var n=0;n<t.length;n++)this[e=t[n]]=_e[e];var r=ge;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=w(r));for(var o=0;o<r.length;o++)this[e=r[o]]=_e[e];var i=me;Array.isArray(i)||("function"==typeof i.entries&&(i=i.entries()),i=w(i));for(var a=0;a<i.length;a++)this[e=i[a]]=!0;var s=fe;Array.isArray(s)||("function"==typeof s.entries&&(s=s.entries()),s=w(s));for(var l=0;l<s.length;l++)this[e=s[l]]=new be(e,!0,void 0,this)}},{key:"setupFromArray",value:function(e){var t,n=ce;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=w(n));for(var r=0;r<n.length;r++)this[t=n[r]]=_e[t];var o=ge;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=w(o));for(var i=0;i<o.length;i++)this[t=o[i]]=_e[t];var a=me;Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=w(a));for(var s=0;s<a.length;s++)this[t=a[s]]=_e[t];var l=fe;Array.isArray(l)||("function"==typeof l.entries&&(l=l.entries()),l=w(l));for(var u=0;u<l.length;u++)this[t=l[u]]=new be(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,he)}},{key:"setupFromObject",value:function(e){var t;he.ifd0=he.ifd0||he.image,he.ifd1=he.ifd1||he.thumbnail,b(this,e);var n=ce;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=w(n));for(var r=0;r<n.length;r++)this[t=n[r]]=ke(e[t],_e[t]);var o=ge;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=w(o));for(var i=0;i<o.length;i++)this[t=o[i]]=ke(e[t],_e[t]);var a=me;Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=w(a));for(var s=0;s<a.length;s++)this[t=a[s]]=ke(e[t],_e[t]);var l=de;Array.isArray(l)||("function"==typeof l.entries&&(l=l.entries()),l=w(l));for(var u=0;u<l.length;u++)this[t=l[u]]=new be(t,_e[t],e[t],this);var c=he;Array.isArray(c)||("function"==typeof c.entries&&(c=c.entries()),c=w(c));for(var p=0;p<c.length;p++)this[t=c[p]]=new be(t,_e[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,he,fe),!0===e.tiff?this.batchEnableWithBool(he,!0):!1===e.tiff?this.batchEnableWithUserValue(he,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,he):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,he)}},{key:"batchEnableWithBool",value:function(e,t){var n=e;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=w(n));for(var r=0;r<n.length;r++)this[n[r]].enabled=t}},{key:"batchEnableWithUserValue",value:function(e,t){var n=e;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=w(n));for(var r=0;r<n.length;r++){var o=n[r],i=t[o];this[o].enabled=!1!==i&&void 0!==i}}},{key:"setupGlobalFilters",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;if(e&&e.length){var o=r;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=w(o));for(var i=0;i<o.length;i++)this[o[i]].enabled=!1;var a=Se(e,n);Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=w(a));for(var s=0;s<a.length;s++){var l=a[s],u=l[0],c=l[1];xe(this[u].pick,c),this[u].enabled=!0}}else if(t&&t.length){var p=Se(t,n);Array.isArray(p)||("function"==typeof p.entries&&(p=p.entries()),p=w(p));for(var d=0;d<p.length;d++){var h=p[d],f=h[0],m=h[1];xe(this[f].skip,m)}}}},{key:"filterNestedSegmentTags",value:function(){var e=this.ifd0,t=this.exif,n=this.xmp,r=this.iptc,o=this.icc;this.makerNote?t.deps.add(se):t.skip.add(se),this.userComment?t.deps.add(le):t.skip.add(le),n.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),o.enabled||e.skip.add(34675)}},{key:"traverseTiffDependencyTree",value:function(){var e=this,t=this.ifd0,n=this.exif,r=this.gps;this.interop.needed&&(n.deps.add(ue),t.deps.add(ue)),n.needed&&t.deps.add(34665),r.needed&&t.deps.add(34853),this.tiff.enabled=he.some((function(t){return!0===e[t].enabled}))||this.makerNote||this.userComment;var o=he;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=w(o));for(var i=0;i<o.length;i++)this[o[i]].finalizeFilters()}},{key:"onlyTiff",get:function(){var e=this;return!pe.map((function(t){return e[t].enabled})).some((function(e){return!0===e}))&&this.tiff.enabled}},{key:"checkLoadedPlugins",value:function(){var e=de;Array.isArray(e)||("function"==typeof e.entries&&(e=e.entries()),e=w(e));for(var t=0;t<e.length;t++){var n=e[t];this[n].enabled&&!V.has(n)&&z("segment parser",n)}}}],[{key:"useCached",value:function(e){var t=we.get(e);return void 0!==t||(t=new this(e),we.set(e,t)),t}}]),n}();function Se(e,t){var n,r,o,i=[],a=t;Array.isArray(a)||("function"==typeof a.entries&&(a=a.entries()),a=w(a));for(var s=0;s<a.length;s++){r=a[s],n=[];var l=oe.get(r);Array.isArray(l)||("function"==typeof l.entries&&(l=l.entries()),l=w(l));for(var u=0;u<l.length;u++)o=l[u],(e.includes(o[0])||e.includes(o[1]))&&n.push(o[0]);n.length&&i.push([r,n])}return i}function ke(e,t){return void 0!==e?e:void 0!==t?t:void 0}function xe(e,t){var n=t;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=w(n));for(var r=0;r<n.length;r++){var o=n[r];e.add(o)}}function Pe(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Ee(){}function Oe(e,t){if(!t)return e&&e.then?e.then(Ee):Promise.resolve()}function Ae(e,t){var n=e();return n&&n.then?n.then(t):t(n)}s(Ce,"default",_e);var Ue,Ne=function(){function e(t){o(this,e),s(this,"parsers",{}),this.options=Ce.useCached(t)}return a(e,[{key:"setup",value:function(){if(!this.fileParser){var e=this.file,t=e.getUint16(0),n=W;Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=w(n));for(var r=0;r<n.length;r++){var o=n[r],i=o[0],a=o[1];if(a.canHandle(e,t))return this.fileParser=new a(this.options,this.file,this.parsers),e[i]=!0}M("Unknown file format")}}},{key:"read",value:function(e){try{var t=this;return Pe(function(e,t){return"string"==typeof e?ee(e,t):A&&!U&&e instanceof HTMLImageElement?ee(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new j(e):A&&e instanceof Blob?Q(e,t,"blob",Y):void M(Z)}(e,t.options),(function(e){t.file=e}))}catch(e){return Promise.reject(e)}}},{key:"parse",value:function(){try{var e=this;e.setup();var t={},n=[];return Ae((function(){return e.options.silentErrors?Pe(e.doParse(t,n).catch((function(e){return n.push(e)})),(function(){n.push.apply(n,e.fileParser.errors)})):Oe(e.doParse(t,n))}),(function(){return e.file.close&&e.file.close(),e.options.silentErrors&&n.length>0&&(t.errors=n),D(r=t)?void 0:r;var r}))}catch(e){return Promise.reject(e)}}},{key:"doParse",value:function(e,t){try{var n=this;return Pe(n.fileParser.parse(),(function(){var r,o=g(n.parsers).map((r=function(t){return Pe(t.parse(),(function(n){t.assignToOutput(e,n)}))},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(r.apply(this,e))}catch(e){return Promise.reject(e)}}));if(n.options.silentErrors){var i=function(e){return t.push(e)};o=o.map((function(e){return e.catch(i)}))}return Oe(Promise.all(o))}))}catch(e){return Promise.reject(e)}}},{key:"extractThumbnail",value:function(){try{var e=this;e.setup();var t,n=e.options,r=e.file,o=V.get("tiff",n);return Ae((function(){if(!r.tiff)return function(e){var t=e();if(t&&t.then)return t.then(Ee)}((function(){if(r.jpeg)return Pe(e.fileParser.getOrFindSegment("tiff"),(function(e){t=e}))}));t={start:0,type:"tiff"}}),(function(){if(void 0!==t)return Pe(e.fileParser.ensureSegmentChunk(t),(function(t){return Pe((e.parsers.tiff=new o(t,n,r)).extractThumbnail(),(function(e){return r.close&&r.close(),e}))}))}))}catch(e){return Promise.reject(e)}}}]),e}(),Te=(Ue=function(e,t){var n,r,o=new Ne(t);return r=function(){return o.parse()},(n=o.read(e))&&n.then||(n=Promise.resolve(n)),r?n.then(r):n},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(Ue.apply(this,e))}catch(e){return Promise.reject(e)}}),Re=Object.freeze({__proto__:null,parse:Te,Exifr:Ne,fileParsers:W,segmentParsers:V,fileReaders:q,tagKeys:oe,tagValues:ie,tagRevivers:ae,createDictionary:ne,extendDictionary:re,fetchUrlAsArrayBuffer:$,readBlobAsArrayBuffer:Y,chunkedProps:ce,otherSegments:pe,segments:de,tiffBlocks:he,segmentsAndBlocks:fe,tiffExtractables:me,inheritables:ve,allFormatters:ge,Options:Ce});function Fe(){}var De=function(){function e(t,n,r){var i=this;o(this,e),s(this,"errors",[]),s(this,"ensureSegmentChunk",(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(function(e){var t,n,r,o=e.start,a=e.size||65536;return t=function(){if(i.file.chunked)return function(e){var t=e();if(t&&t.then)return t.then(Fe)}((function(){if(!i.file.available(o,a))return function(e){if(e&&e.then)return e.then(Fe)}(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return n=function(t){e.chunk=t},(t=i.file.readChunk(o,a))&&t.then||(t=Promise.resolve(t)),n?t.then(n):t;var t,n}),(function(t){M("Couldn't read segment: ".concat(JSON.stringify(e),". ").concat(t.message))})));e.chunk=i.file.subarray(o,a)}));i.file.byteLength>o+a?e.chunk=i.file.subarray(o,a):void 0===e.size?e.chunk=i.file.subarray(o):M("Segment unreachable: "+JSON.stringify(e))},n=function(){return e.chunk},(r=t())&&r.then?r.then(n):n()}.apply(this,t))}catch(e){return Promise.reject(e)}})),this.extendOptions&&this.extendOptions(t),this.options=t,this.file=n,this.parsers=r}return a(e,[{key:"injectSegment",value:function(e,t){this.options[e].enabled&&this.createParser(e,t)}},{key:"createParser",value:function(e,t){var n=new(V.get(e))(t,this.options,this.file);return this.parsers[e]=n}},{key:"createParsers",value:function(e){var t=e;Array.isArray(t)||("function"==typeof t.entries&&(t=t.entries()),t=w(t));for(var n=0;n<t.length;n++){var r=t[n],o=r.type,i=r.chunk,a=this.options[o];if(a&&a.enabled){var s=this.parsers[o];s&&s.append||s||this.createParser(o,i)}}}},{key:"readSegments",value:function(e){try{var t=e.map(this.ensureSegmentChunk);return function(e,t){return e&&e.then?e.then(Fe):Promise.resolve()}(Promise.all(t))}catch(e){return Promise.reject(e)}}}]),e}(),Me=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;o(this,e),s(this,"errors",[]),s(this,"raw",P()),s(this,"handleError",(function(e){if(!n.options.silentErrors)throw e;n.errors.push(e.message)})),this.chunk=this.normalizeInput(t),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=r,this.localOptions=r[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}return a(e,[{key:"normalizeInput",value:function(e){return e instanceof j?e:new j(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?_(this.raw):void 0}},{key:"translateBlock",value:function(e,t){var n=ae.get(t),r=ie.get(t),o=oe.get(t),i=this.options[t],a=i.reviveValues&&!!n,s=i.translateValues&&!!r,l=i.translateKeys&&!!o,u={},c=e;Array.isArray(c)||("function"==typeof c.entries&&(c=c.entries()),c=w(c));for(var p=0;p<c.length;p++){var d=c[p],h=d[0],f=d[1];a&&n.has(h)?f=n.get(h)(f):s&&r.has(h)&&(f=this.translateValue(f,r.get(h))),l&&o.has(h)&&(h=o.get(h)||h),u[h]=f}return u}},{key:"translateValue",value:function(e,t){return t[e]||t.DEFAULT||e}},{key:"assignToOutput",value:function(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}},{key:"assignObjectToOutput",value:function(e,t,n){if(this.globalOptions.mergeOutput)return b(e,n);e[t]?b(e[t],n):e[t]=n}}],[{key:"findPosition",value:function(e,t){var n=e.getUint16(t+2)+2,r="function"==typeof this.headerLength?this.headerLength(e,t,n):this.headerLength,o=t+r,i=n-r;return{offset:t,length:n,headerLength:r,start:o,size:i,end:o+i}}},{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new this(e,new Ce(s({},this.type,t))).parse()}}]),e}();function Be(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function Ie(){}function Le(e,t){var n=e();return n&&n.then?n.then(t):t(n)}function je(e,t,n){if(!e.s){if(n instanceof ze){if(!n.s)return void(n.o=je.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(je.bind(null,e,t),je.bind(null,e,2));e.s=t,e.v=n;var r=e.o;r&&r(e)}}s(Me,"headerLength",4),s(Me,"type",void 0),s(Me,"multiSegment",!1),s(Me,"canHandle",(function(){return!1}));var ze=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,o=this.s;if(o){var i=1&o?t:n;if(i){try{je(r,1,i(this.v))}catch(e){je(r,2,e)}return r}return this}return this.o=function(e){try{var o=e.v;1&e.s?je(r,1,t?t(o):o):n?je(r,1,n(o)):je(r,2,o)}catch(e){je(r,2,e)}},r},e}();function He(e){return e instanceof ze&&1&e.s}function We(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 qe(e,t,n){var r=V;Array.isArray(r)||("function"==typeof r.entries&&(r=r.entries()),r=w(r));for(var o=0;o<r.length;o++){var i=r[o],a=i[0];if(i[1].canHandle(e,t,n))return a}}var Xe=function(e){l(n,De);var t=m(n);function n(){var e;o(this,n);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return s(f(e=t.call.apply(t,[this].concat(i))),"appSegments",[]),s(f(e),"jpegSegments",[]),s(f(e),"unknownSegments",[]),e}return a(n,[{key:"parse",value:function(){try{var e=this;return Be(e.findAppSegments(),(function(){return Be(e.readSegments(e.appSegments),(function(){e.mergeMultiSegments(),e.createParsers(e.mergedAppSegments||e.appSegments)}))}))}catch(e){return Promise.reject(e)}}},{key:"setupSegmentFinderArgs",value:function(e){var t=this;!0===e?(this.findAll=!0,this.wanted=x(V.keyList())):(e=void 0===e?V.keyList().filter((function(e){return t.options[e].enabled})):e.filter((function(e){return t.options[e].enabled&&V.has(e)})),this.findAll=!1,this.remaining=x(e),this.wanted=x(e)),this.unfinishedMultiSegment=!1}},{key:"findAppSegments",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;try{var n=this;n.setupSegmentFinderArgs(t);var r=n.file,o=n.findAll,i=n.wanted,a=n.remaining;return Le((function(){if(!o&&n.file.chunked)return o=w(i).some((function(e){var t=V.get(e),r=n.options[e];return t.multiSegment&&r.multiSegment})),function(e){var t=function(){if(o)return function(e,t){return e&&e.then?e.then(Ie):Promise.resolve()}(n.file.readWhole())}();if(t&&t.then)return t.then(Ie)}()}),(function(){var t=!1;if(e=n.findAppSegmentsInRange(e,r.byteLength),!n.options.onlyTiff)return function(){if(r.chunked){var o=!1;return function(e,t,n){for(var r;;){var o=e();if(He(o)&&(o=o.v),!o)return a;if(o.then){r=0;break}var i,a=n();if(a&&a.then){if(!He(a)){r=1;break}a=a.s}}var s=new ze,l=je.bind(null,s,2);return(0===r?o.then(c):1===r?a.then(u):i.then(p)).then(void 0,l),s;function u(t){a=t;do{if(!(o=e())||He(o)&&!o.v)return void je(s,1,a);if(o.then)return void o.then(c).then(void 0,l);He(a=n())&&(a=a.v)}while(!a||!a.then);a.then(u).then(void 0,l)}function c(e){e?(a=n())&&a.then?a.then(u).then(void 0,l):u(a):je(s,1,a)}function p(){(o=e())?o.then?o.then(c).then(void 0,l):c(o):je(s,1,a)}}((function(){return!t&&a.size>0&&!o&&(!!r.canReadNextChunk||!!n.unfinishedMultiSegment)}),0,(function(){var i=r.nextChunkOffset,a=n.appSegments.some((function(e){return!n.file.available(e.offset||e.start,e.length||e.size)}));return Le((function(){return Be(e>i&&!a?r.readNextChunk(e):r.readNextChunk(i),(function(e){o=!e}))}),(function(){void 0===(e=n.findAppSegmentsInRange(e,r.byteLength))&&(t=!0)}))}))}}()}))}catch(e){return Promise.reject(e)}}},{key:"findAppSegmentsInRange",value:function(e,t){t-=2;for(var n,r,o,i,a,s,l=this.file,u=this.findAll,c=this.wanted,p=this.remaining,d=this.options;e<t;e++)if(255===l.getUint8(e))if(Ve(n=l.getUint8(e+1))){if(r=l.getUint16(e+2),(o=qe(l,e,r))&&c.has(o)&&(a=(i=V.get(o)).findPosition(l,e),s=d[o],a.type=o,this.appSegments.push(a),!u&&(i.multiSegment&&s.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||p.delete(o)):p.delete(o),0===p.size)))break;d.recordUnknownSegments&&((a=Me.findPosition(l,e)).marker=n,this.unknownSegments.push(a)),e+=r+1}else if(We(n)){if(r=l.getUint16(e+2),218===n&&!1!==d.stopAfterSos)return;d.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:n}),e+=r+1}return e}},{key:"mergeMultiSegments",value:function(){var e=this;if(this.appSegments.some((function(e){return e.multiSegment}))){var t=function(e,t){for(var n,r,o,i=P(),a=0;a<e.length;a++)r=(n=e[a]).type,i.has(r)?o=i.get(r):i.set(r,o=[]),o.push(n);return w(i)}(this.appSegments);this.mergedAppSegments=t.map((function(t){var n=t[0],r=t[1],o=V.get(n,e.options);return o.handleMultiSegments?{type:n,chunk:o.handleMultiSegments(r)}:r[0]}))}}},{key:"getSegment",value:function(e){return this.appSegments.find((function(t){return t.type===e}))}},{key:"getOrFindSegment",value:function(e){try{var t=this,n=t.getSegment(e);return Le((function(){if(void 0===n)return Be(t.findAppSegments(0,[e]),(function(){n=t.getSegment(e)}))}),(function(){return n}))}catch(e){return Promise.reject(e)}}}],[{key:"canHandle",value:function(e,t){return 65496===t}}]),n}();function Ge(){}function Ye(e,t){if(!t)return e&&e.then?e.then(Ge):Promise.resolve()}function $e(e,t){var n=e();return n&&n.then?n.then(t):t(n)}s(Xe,"type","jpeg"),W.set("jpeg",Xe);var Ke=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Je=function(e){l(n,e);var t=m(n);function n(){return o(this,n),t.apply(this,arguments)}return a(n,[{key:"parse",value:function(){try{var e=this;e.parseHeader();var t=e.options;return $e((function(){if(t.ifd0.enabled)return Ye(e.parseIfd0Block())}),(function(){return $e((function(){if(t.exif.enabled)return Ye(e.safeParse("parseExifBlock"))}),(function(){return $e((function(){if(t.gps.enabled)return Ye(e.safeParse("parseGpsBlock"))}),(function(){return $e((function(){if(t.interop.enabled)return Ye(e.safeParse("parseInteropBlock"))}),(function(){return $e((function(){if(t.ifd1.enabled)return Ye(e.safeParse("parseThumbnailBlock"))}),(function(){return e.createOutput()}))}))}))}))}))}catch(e){return Promise.reject(e)}}},{key:"safeParse",value:function(e){var t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}},{key:"findIfd0Offset",value:function(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}},{key:"findIfd1Offset",value:function(){if(void 0===this.ifd1Offset){this.findIfd0Offset();var e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}},{key:"parseBlock",value:function(e,t){var n=P();return this[t]=n,this.parseTags(e,t,n),n}},{key:"parseIfd0Block",value:function(){try{var e=this;if(e.ifd0)return;var t=e.file;return e.findIfd0Offset(),e.ifd0Offset<8&&M("Malformed EXIF data"),!t.chunked&&e.ifd0Offset>t.byteLength&&M("IFD0 offset points to outside of file.\nthis.ifd0Offset: ".concat(e.ifd0Offset,", file.byteLength: ").concat(t.byteLength)),$e((function(){if(t.tiff)return Ye(t.ensureChunk(e.ifd0Offset,B(e.options)))}),(function(){var t=e.parseBlock(e.ifd0Offset,"ifd0");if(0!==t.size)return e.exifOffset=t.get(34665),e.interopOffset=t.get(ue),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(ue),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 $e((function(){if(!e.ifd0)return Ye(e.parseIfd0Block())}),(function(){if(void 0!==e.exifOffset)return $e((function(){if(e.file.tiff)return Ye(e.file.ensureChunk(e.exifOffset,B(e.options)))}),(function(){var t=e.parseBlock(e.exifOffset,"exif");return e.interopOffset||(e.interopOffset=t.get(ue)),e.makerNote=t.get(se),e.userComment=t.get(le),e.options.sanitize&&(t.delete(ue),t.delete(se),t.delete(le)),e.unpack(t,41728),e.unpack(t,41729),t}))}))}catch(e){return Promise.reject(e)}}},{key:"unpack",value:function(e,t){var n=e.get(t);n&&1===n.length&&e.set(t,n[0])}},{key:"parseGpsBlock",value:function(){try{var e=this;if(e.gps)return;return $e((function(){if(!e.ifd0)return Ye(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 $e((function(){if(!e.ifd0)return Ye(e.parseIfd0Block())}),(function(){return $e((function(){if(void 0===e.interopOffset&&!e.exif)return Ye(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(),$e((function(){if(!e.ifd1Parsed)return Ye(e.parseThumbnailBlock(!0))}),(function(){if(void 0!==e.ifd1){var t=e.ifd1.get(513),n=e.ifd1.get(514);return e.chunk.getUint8Array(t,n)}}))}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,n,r={},o=he;Array.isArray(o)||("function"==typeof o.entries&&(o=o.entries()),o=w(o));for(var i=0;i<o.length;i++)if(!D(e=this[t=o[i]]))if(n=this.canTranslate?this.translateBlock(e,t):_(e),this.options.mergeOutput){if("ifd1"===t)continue;b(r,n)}else r[t]=n;return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}},{key:"assignToOutput",value:function(e,t){if(this.globalOptions.mergeOutput)b(e,t);else{var n=y(t);Array.isArray(n)||("function"==typeof n.entries&&(n=n.entries()),n=w(n));for(var r=0;r<n.length;r++){var o=n[r],i=o[0],a=o[1];this.assignObjectToOutput(e,i,a)}}}}],[{key:"canHandle",value:function(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}}]),n}(function(e){l(n,Me);var t=m(n);function n(){return o(this,n),t.apply(this,arguments)}return a(n,[{key:"parseHeader",value:function(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}},{key:"parseTags",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:P(),r=this.options[t],o=r.pick,i=r.skip,a=(o=x(o)).size>0,s=0===i.size,l=this.chunk.getUint16(e);e+=2;for(var u=0;u<l;u++){var c=this.chunk.getUint16(e);if(a){if(o.has(c)&&(n.set(c,this.parseTag(e,c,t)),o.delete(c),0===o.size))break}else!s&&i.has(c)||n.set(c,this.parseTag(e,c,t));e+=12}return n}},{key:"parseTag",value:function(e,t,n){var r,o=this.chunk,i=o.getUint16(e+2),a=o.getUint32(e+4),s=Ke[i];if(s*a<=4?e+=8:e=o.getUint32(e+8),(i<1||i>13)&&M("Invalid TIFF value type. block: ".concat(n.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(i,", offset ").concat(e)),e>o.byteLength&&M("Invalid TIFF value offset. block: ".concat(n.toUpperCase(),", tag: ").concat(t.toString(16),", type: ").concat(i,", offset ").concat(e," is outside of chunk size ").concat(o.byteLength)),1===i)return o.getUint8Array(e,a);if(2===i)return""===(r=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(r=o.getString(e,a)).trim())?void 0:r;if(7===i)return o.getUint8Array(e,a);if(1===a)return this.parseTagValue(i,e);for(var l=new(function(e){switch(i){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}}())(a),u=s,c=0;c<a;c++)l[c]=this.parseTagValue(i,e),e+=u;return l}},{key:"parseTagValue",value:function(e,t){var n=this.chunk;switch(e){case 1:return n.getUint8(t);case 3:return n.getUint16(t);case 4:return n.getUint32(t);case 5:return n.getUint32(t)/n.getUint32(t+4);case 6:return n.getInt8(t);case 8:return n.getInt16(t);case 9:return n.getInt32(t);case 10:return n.getInt32(t)/n.getInt32(t+4);case 11:return n.getFloat(t);case 12:return n.getDouble(t);case 13:return n.getUint32(t);default:M("Invalid tiff type ".concat(e))}}}]),n}());function Qe(e,t,n,r){var o=e+t/60+n/3600;return"S"!==r&&"W"!==r||(o*=-1),o}s(Je,"type","tiff"),s(Je,"headerLength",10),V.set("tiff",Je);var Ze=Object.freeze({__proto__:null,default:Re,Exifr:Ne,fileParsers:W,segmentParsers:V,fileReaders:q,tagKeys:oe,tagValues:ie,tagRevivers:ae,createDictionary:ne,extendDictionary:re,fetchUrlAsArrayBuffer:$,readBlobAsArrayBuffer:Y,chunkedProps:ce,otherSegments:pe,segments:de,tiffBlocks:he,segmentsAndBlocks:fe,tiffExtractables:me,inheritables:ve,allFormatters:ge,Options:Ce,parse:Te});function et(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function tt(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}var nt=tt((function(e){var t=new Ne(lt);return et(t.read(e),(function(){return et(t.parse(),(function(e){if(e&&e.ifd0)return e.ifd0[274]}))}))})),rt=tt((function(e){var t=new Ne(st);return et(t.read(e),(function(){return et(t.parse(),(function(e){if(e&&e.gps){var t=e.gps;return{latitude:t.latitude,longitude:t.longitude}}}))}))})),ot=tt((function(e){return et(this.thumbnail(e),(function(e){if(void 0!==e){var t=new Blob([e]);return URL.createObjectURL(t)}}))})),it=tt((function(e){var t=new Ne(ut);return et(t.read(e),(function(){return et(t.extractThumbnail(),(function(e){return e&&R?T.from(e):e}))}))})),at={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},st=b({},at,{firstChunkSize:4e4,gps:[1,2,3,4]}),lt=b({},at,{firstChunkSize:4e4,ifd0:[274]}),ut=b({},at,{tiff:!1,ifd1:!0,mergeOutput:!1}),ct=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});if(r.rotateCanvas=!0,r.rotateCss=!0,"object"==typeof navigator){var pt=navigator.userAgent;if(pt.includes("iPad")||pt.includes("iPhone")){var dt=pt.match(/OS (\d+)_(\d+)/);if(dt){var ht=dt[1],ft=dt[2],mt=Number(ht)+.1*Number(ft);r.rotateCanvas=mt<13.4,r.rotateCss=!1}}else if(pt.includes("OS X 10")){var vt=pt.match(/OS X 10[_.](\d+)/)[1];r.rotateCanvas=r.rotateCss=Number(vt)<15}if(pt.includes("Chrome/")){var gt=pt.match(/Chrome\/(\d+)/)[1];r.rotateCanvas=r.rotateCss=Number(gt)<81}else if(pt.includes("Firefox/")){var yt=pt.match(/Firefox\/(\d+)/)[1];r.rotateCanvas=r.rotateCss=Number(yt)<77}}function bt(){}var _t=function(e){l(n,j);var t=m(n);function n(){var e;o(this,n);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return s(f(e=t.call.apply(t,[this].concat(i))),"ranges",new wt),0!==e.byteLength&&e.ranges.add(0,e.byteLength),e}return a(n,[{key:"_tryExtend",value:function(e,t,n){if(0===e&&0===this.byteLength&&n){var r=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(r)}else{var o=e+t;if(o>this.byteLength){var i=this._extend(o).dataView;this._swapDataView(i)}}}},{key:"_extend",value:function(e){var t;t=R?T.allocUnsafe(e):new Uint8Array(e);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:n}}},{key:"subarray",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),v(u(n.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 r=v(u(n.prototype),"set",this).call(this,e,t);return this.ranges.add(t,r.byteLength),r}},{key:"ensureChunk",value:function(e,t){try{var n=this;if(!n.chunked)return;if(n.ranges.available(e,t))return;return function(e,t){return e&&e.then?e.then(bt):Promise.resolve()}(n.readChunk(e,t))}catch(e){return Promise.reject(e)}}},{key:"available",value:function(e,t){return this.ranges.available(e,t)}}]),n}(),wt=function(){function e(){o(this,e),s(this,"list",[])}return a(e,[{key:"length",get:function(){return this.list.length}},{key:"add",value:function(e,t){var n=e+t,r=this.list.filter((function(t){return Ct(e,t.offset,n)||Ct(e,t.end,n)}));if(r.length>0){e=Math.min.apply(Math,[e].concat(r.map((function(e){return e.offset})))),t=(n=Math.max.apply(Math,[n].concat(r.map((function(e){return e.end})))))-e;var o=r.shift();o.offset=e,o.length=t,o.end=n,this.list=this.list.filter((function(e){return!r.includes(e)}))}else this.list.push({offset:e,length:t,end:n})}},{key:"available",value:function(e,t){var n=e+t;return this.list.some((function(t){return t.offset<=e&&n<=t.end}))}}]),e}();function Ct(e,t,n){return e<=t&&t<=n}function St(){}function kt(e,t){if(!t)return e&&e.then?e.then(St):Promise.resolve()}function xt(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}var Pt=function(e){l(n,e);var t=m(n);function n(){return o(this,n),t.apply(this,arguments)}return a(n,[{key:"readWhole",value:function(){try{var e=this;return e.chunked=!1,xt(Y(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,v(u(n.prototype),"readChunked",this).call(this)}},{key:"_readChunk",value:function(e,t){try{var n=this,r=t?e+t:void 0,o=n.input.slice(e,r);return xt(Y(o),(function(t){return n.set(t,e,!0)}))}catch(e){return Promise.reject(e)}}}]),n}(function(e){l(n,_t);var t=m(n);function n(e,r){var i;return o(this,n),s(f(i=t.call(this,0)),"chunksRead",0),i.input=e,i.options=r,i}return a(n,[{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 n=t.options.chunkSize;return r=t.readChunk(e,n),o=function(e){return!!e&&e.byteLength===n},r&&r.then||(r=Promise.resolve(r)),o?r.then(o):r}catch(e){return Promise.reject(e)}var r,o}},{key:"readChunk",value:function(e,t){try{var n=this;if(n.chunksRead++,0===(t=n.safeWrapAddress(e,t)))return;return n._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.chunksRead<this.options.chunkLimit}},{key:"fullyRead",get:function(){return void 0!==this.size&&this.nextChunkOffset===this.size}},{key:"read",value:function(){return this.options.chunked?this.readChunked():this.readWhole()}},{key:"close",value:function(){}}]),n}());q.set("blob",Pt),r.Exifr=Ne,r.Options=Ce,r.allFormatters=ge,r.chunkedProps=ce,r.createDictionary=ne,r.default=Ze,r.disableAllOptions=at,r.extendDictionary=re,r.fetchUrlAsArrayBuffer=$,r.fileParsers=W,r.fileReaders=q,r.gps=rt,r.gpsOnlyOptions=st,r.inheritables=ve,r.orientation=nt,r.orientationOnlyOptions=lt,r.otherSegments=pe,r.parse=Te,r.readBlobAsArrayBuffer=Y,r.rotation=function(e){return et(nt(e),(function(e){return b({canvas:r.rotateCanvas,css:r.rotateCss},ct[e])}))},r.rotations=ct,r.segmentParsers=V,r.segments=de,r.segmentsAndBlocks=fe,r.tagKeys=oe,r.tagRevivers=ae,r.tagValues=ie,r.thumbnail=it,r.thumbnailOnlyOptions=ut,r.thumbnailUrl=ot,r.tiffBlocks=he,r.tiffExtractables=me,Object.defineProperty(r,"__esModule",{value:!0})},"object"==typeof yo.exports?o(yo.exports):o((r="undefined"!=typeof globalThis?globalThis:r||self).exifr={})}).call(this)}).call(this,e,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},a({}).Buffer),yo=yo.exports;var wo=(vo=mo=function(e){var t,n;function r(t,n){var r;if((r=e.call(this,t,n)||this).onFileAdded=function(e){!e.preview&&e.data&&Bt(e.type)&&!e.isRemote&&r.addToQueue(e.id)},r.onCancelRequest=function(e){var t=r.queue.indexOf(e.id);-1!==t&&r.queue.splice(t,1)},r.onFileRemoved=function(e){var t=r.queue.indexOf(e.id);-1!==t&&r.queue.splice(t,1),e.preview&&ro(e.preview)&&URL.revokeObjectURL(e.preview)},r.onRestored=function(){r.uppy.getFiles().filter((function(e){return e.isRestored})).forEach((function(e){e.preview&&!ro(e.preview)||r.addToQueue(e.id)}))},r.waitUntilAllProcessed=function(e){e.forEach((function(e){var t=r.uppy.getFile(e);r.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:r.i18n("generatingThumbnails")})}));var t=function(){e.forEach((function(e){var t=r.uppy.getFile(e);r.uppy.emit("preprocess-complete",t)}))};return new Promise((function(e,n){r.queueProcessing?r.uppy.once("thumbnail:all-generated",(function(){t(),e()})):(t(),e())}))},r.type="modifier",r.id=r.opts.id||"ThumbnailGenerator",r.title="Thumbnail Generator",r.queue=[],r.queueProcessing=!1,r.defaultThumbnailDimension=200,r.thumbnailType=r.opts.thumbnailType||"image/jpeg",r.defaultLocale={strings:{generatingThumbnails:"Generating thumbnails..."}},r.opts=bo({},{thumbnailWidth:null,thumbnailHeight:null,waitForThumbnailsBeforeUpload:!1,lazy:!1},n),r.opts.lazy&&r.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.");return r.i18nInit(),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,_o(t,n);var o=r.prototype;return o.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},o.i18nInit=function(){this.translator=new x([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},o.createThumbnail=function(e,t,n){var r=this,o=URL.createObjectURL(e.data),i=new Promise((function(e,t){var n=new Image;n.src=o,n.addEventListener("load",(function(){URL.revokeObjectURL(o),e(n)})),n.addEventListener("error",(function(e){URL.revokeObjectURL(o),t(e.error||new Error("Could not create thumbnail"))}))})),a=yo.rotation(e.data).catch((function(e){return 1}));return Promise.all([i,a]).then((function(e){var o=e[0],i=e[1],a=r.getProportionalDimensions(o,t,n,i.deg),s=r.rotateImage(o,i),l=r.resizeImage(s,a.width,a.height);return r.canvasToBlob(l,r.thumbnailType,80)})).then((function(e){return URL.createObjectURL(e)}))},o.getProportionalDimensions=function(e,t,n,r){var o=e.width/e.height;return 90!==r&&270!==r||(o=e.height/e.width),null!=t?{width:t,height:Math.round(t/o)}:null!=n?{width:Math.round(n*o),height:n}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/o)}},o.protect=function(e){var t=e.width/e.height,n=Math.floor(Math.sqrt(5e6*t)),r=Math.floor(5e6/Math.sqrt(5e6*t));if(n>4096&&(n=4096,r=Math.round(n/t)),r>4096&&(r=4096,n=Math.round(t*r)),e.width>n){var o=document.createElement("canvas");o.width=n,o.height=r,o.getContext("2d").drawImage(e,0,0,n,r),e=o}return e},o.resizeImage=function(e,t,n){e=this.protect(e);var r=Math.ceil(oo(e.width/t));r<1&&(r=1);for(var o=t*Math.pow(2,r-1),i=n*Math.pow(2,r-1);r--;){var a=document.createElement("canvas");a.width=o,a.height=i,a.getContext("2d").drawImage(e,0,0,o,i),e=a,o=Math.round(o/2),i=Math.round(i/2)}return e},o.rotateImage=function(e,t){var n=e.width,r=e.height;90!==t.deg&&270!==t.deg||(n=e.height,r=e.width);var o=document.createElement("canvas");o.width=n,o.height=r;var i=o.getContext("2d");return i.translate(n/2,r/2),t.canvas&&(i.rotate(t.rad),i.scale(t.scaleX,t.scaleY)),i.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),o},o.canvasToBlob=function(e,t,n){try{e.getContext("2d").getImageData(0,0,1,1)}catch(Cd){if(18===Cd.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise((function(r){e.toBlob(r,t,n)})).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 no(e.toDataURL(t,n),{})})).then((function(e){if(null===e)throw new Error("could not extract blob, probably an old browser");return e}))},o.setPreviewURL=function(e,t){this.uppy.setFileState(e,{preview:t})},o.addToQueue=function(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()},o.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")},o.requestThumbnail=function(e){var t=this;return Bt(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then((function(n){t.setPreviewURL(e.id,n),t.uppy.log("[ThumbnailGenerator] Generated thumbnail for "+e.id),t.uppy.emit("thumbnail:generated",t.uppy.getFile(e.id),n)})).catch((function(n){t.uppy.log("[ThumbnailGenerator] Failed thumbnail for "+e.id+":","warning"),t.uppy.log(n,"warning"),t.uppy.emit("thumbnail:error",t.uppy.getFile(e.id),n)})):Promise.resolve()},o.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)},o.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)},r}(ue.Plugin),mo.VERSION="1.7.11",vo),Co=function(e){if("string"==typeof e){var t=[].slice.call(document.querySelectorAll(e));return t.length>0?t:null}if("object"==typeof e&&ae(e))return[e]},So=function(e){return Array.prototype.slice.call(e||[],0)},ko=function(e,t){var n=[],r=[];return So(e.items).forEach((function(e){var o=e.webkitGetAsEntry();o&&r.push(function e(r){return new Promise((function(o){if(r.isFile)r.file((function(e){var t;e.relativePath=(t=r).fullPath&&t.fullPath!=="/"+t.name?t.fullPath:null,n.push(e),o()}),(function(e){t(e),o()}));else if(r.isDirectory){!function e(t,n,r,o){var i=o.onSuccess;t.readEntries((function(o){var a=[].concat(n,o);o.length?setTimeout((function(){e(t,a,r,{onSuccess:i})}),0):i(a)}),(function(e){r(e),i(n)}))}(r.createReader(),[],t,{onSuccess:function(t){var n=t.map((function(t){return e(t)}));Promise.all(n).then((function(){return o()}))}})}}))}(o))})),Promise.all(r).then((function(){return n}))},xo=function(e,t){var n=(void 0===t?{}:t).logDropError,r=void 0===n?function(){}:n;return e.items&&e.items[0]&&"webkitGetAsEntry"in e.items[0]?ko(e,r):function(e){var t=So(e.files);return Promise.resolve(t)}(e)},Po=function(e,t){if(t){var n=e.querySelector('[data-uppy-paneltype="'+t+'"]');if(n)return n}return e},Eo=['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 Oo(e,t){var n=t[0];n&&(n.focus(),e.preventDefault())}function Ao(e,t,n){var r=Po(n,t),o=So(r.querySelectorAll(Eo)),i=o.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(r)?Oo(e,o):e.shiftKey&&0===i?function(e,t){var n=t[t.length-1];n&&(n.focus(),e.preventDefault())}(e,o):e.shiftKey||i!==o.length-1||Oo(e,o)}var Uo=function(e,t,n){Ao(e,t,n)},No=function(e,t,n){null===t||Ao(e,t,n)},To={exports:{}};(function(e){(function(){!function(e,t){"object"==typeof To.exports?To.exports=t():e.ResizeObserver=t()}(this,(function(){"use strict";var t=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}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 n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,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 n=0,r=this.__entries__;n<r.length;n++){var o=r[n];e.call(t,o[1],o[0])}},t}()}(),n="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,r=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(r):function(e){return setTimeout((function(){return e(Date.now())}),1e3/60)},i=["top","right","bottom","left","width","height","size","weight"],a="undefined"!=typeof MutationObserver,s=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,i=0;function a(){n&&(n=!1,e()),r&&l()}function s(){o(a)}function l(){var e=Date.now();if(n){if(e-i<2)return;r=!0}else n=!0,r=!1,setTimeout(s,20);i=e}return l}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter((function(e){return e.gatherActive(),e.hasActive()}));return e.forEach((function(e){return e.broadcastActive()})),e.length>0},e.prototype.connect_=function(){n&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),a?(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(){n&&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,n=void 0===t?"":t;i.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),l=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},u=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||r},c=m(0,0,0,0);function p(e){return parseFloat(e)||0}function d(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(t,n){return t+p(e["border-"+n+"-width"])}),0)}var h="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof u(e).SVGGraphicsElement}:function(e){return e instanceof u(e).SVGElement&&"function"==typeof e.getBBox};function f(e){return n?h(e)?function(e){var t=e.getBBox();return m(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return c;var r=u(e).getComputedStyle(e),o=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=e["padding-"+o];t[o]=p(i)}return t}(r),i=o.left+o.right,a=o.top+o.bottom,s=p(r.width),l=p(r.height);if("border-box"===r.boxSizing&&(Math.round(s+i)!==t&&(s-=d(r,"left","right")+i),Math.round(l+a)!==n&&(l-=d(r,"top","bottom")+a)),!function(e){return e===u(e).document.documentElement}(e)){var h=Math.round(s+i)-t,f=Math.round(l+a)-n;1!==Math.abs(h)&&(s-=h),1!==Math.abs(f)&&(l-=f)}return m(o.left,o.top,s,l)}(e):c}function m(e,t,n,r){return{x:e,y:t,width:n,height:r}}var v=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=m(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=f(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),g=function(e,t){var n,r,o,i,a,s,u,c=(r=(n=t).x,o=n.y,i=n.width,a=n.height,s="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,u=Object.create(s.prototype),l(u,{x:r,y:o,width:i,height:a,top:o,right:r+i,bottom:a+o,left:r}),u);l(this,{target:e,contentRect:c})},y=function(){function e(e,n,r){if(this.activeObservations_=[],this.observations_=new t,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new v(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof u(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach((function(t){t.isActive()&&e.activeObservations_.push(t)}))},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map((function(e){return new g(e.target,e.broadcastRect())}));this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),b="undefined"!=typeof WeakMap?new WeakMap:new t,_=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 n=s.getInstance(),r=new y(t,n,this);b.set(this,r)};return["observe","unobserve","disconnect"].forEach((function(e){_.prototype[e]=function(){var t;return(t=b.get(this))[e].apply(t,arguments)}})),void 0!==r.ResizeObserver?r.ResizeObserver:_}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),To=To.exports;var Ro={};(function(e){(function(){var t=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt,a="object"==typeof e&&e&&e.Object===Object&&e,s="object"==typeof self&&self&&self.Object===Object&&self,l=a||s||Function("return this")(),u=Object.prototype.toString,c=Math.max,p=Math.min,d=function(){return l.Date.now()};function h(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]"==u.call(e)}(e))return NaN;if(h(e)){var a="function"==typeof e.valueOf?e.valueOf():e;e=h(a)?a+"":a}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(t,"");var s=r.test(e);return s||o.test(e)?i(e.slice(2),s?2:8):n.test(e)?NaN:+e}Ro=function(e,t,n){var r,o,i,a,s,l,u=0,m=!1,v=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,i=o;return r=o=void 0,u=t,a=e.apply(i,n)}function b(e){var n=e-l;return void 0===l||n>=t||n<0||v&&e-u>=i}function _(){var e=d();if(b(e))return w(e);s=setTimeout(_,function(e){var n=t-(e-l);return v?p(n,i-(e-u)):n}(e))}function w(e){return s=void 0,g&&r?y(e):(r=o=void 0,a)}function C(){var e=d(),n=b(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(_,t),m?y(e):a}(l);if(v)return s=setTimeout(_,t),y(l)}return void 0===s&&(s=setTimeout(_,t)),a}return t=f(t)||0,h(n)&&(m=!!n.leading,i=(v="maxWait"in n)?c(f(n.maxWait)||0,t):i,g="trailing"in n?!!n.trailing:g),C.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=o=s=void 0},C.flush=function(){return void 0===s?a:w(d())},C}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});function Fo(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Do,Mo,Bo=function(e,t){var n;void 0===t&&(t=Fo);var r,o=[],i=!1;return function(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];return i&&n===this&&t(a,o)||(r=e.apply(this,a),i=!0,n=this,o=a),r}};function Io(){return(Io=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Lo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jo(e,t){return(jo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var zo=rn.h,Ho=ue.Plugin,Wo=To.default||To,Vo=Bo.default||Bo;function qo(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}function Xo(){return zo("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},zo("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var Go,Yo,$o=(Mo=Do=function(e){var t,n;function r(t,n){var r;(r=e.call(this,t,n)||this).setOptions=function(t){e.prototype.setOptions.call(Lo(r),t),r.i18nInit()},r.i18nInit=function(){r.translator=new x([r.defaultLocale,r.uppy.locale,r.opts.locale]),r.i18n=r.translator.translate.bind(r.translator),r.i18nArray=r.translator.translateArray.bind(r.translator),r.setPluginState()},r.removeTarget=function(e){var t=r.getPluginState().targets.filter((function(t){return t.id!==e.id}));r.setPluginState({targets:t})},r.addTarget=function(e){var t=e.id||e.constructor.name,n=e.title||t,o=e.type;if("acquirer"===o||"progressindicator"===o||"editor"===o){var i={id:t,name:n,type:o},a=r.getPluginState().targets.slice();return a.push(i),r.setPluginState({targets:a}),r.el}r.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error")},r.hideAllPanels=function(){var e={activePickerPanel:!1,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1},t=r.getPluginState();t.activePickerPanel===e.activePickerPanel&&t.showAddFilesPanel===e.showAddFilesPanel&&t.showFileEditor===e.showFileEditor&&t.activeOverlayType===e.activeOverlayType||r.setPluginState(e)},r.showPanel=function(e){var t=r.getPluginState().targets.filter((function(t){return"acquirer"===t.type&&t.id===e}))[0];r.setPluginState({activePickerPanel:t,activeOverlayType:"PickerPanel"})},r.canEditFile=function(e){var t=r.getPluginState().targets;return r._getEditors(t).some((function(t){return r.uppy.getPlugin(t.id).canEditFile(e)}))},r.openFileEditor=function(e){var t=r.getPluginState().targets,n=r._getEditors(t);r.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),n.forEach((function(t){r.uppy.getPlugin(t.id).selectFile(e)}))},r.saveFileEditor=function(){var e=r.getPluginState().targets;r._getEditors(e).forEach((function(e){r.uppy.getPlugin(e.id).save()})),r.hideAllPanels()},r.openModal=function(){var e=qo(),t=e.promise,n=e.resolve;return r.savedScrollPosition=window.pageYOffset,r.savedActiveElement=document.activeElement,r.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),r.opts.animateOpenClose&&r.getPluginState().isClosing?r.el.addEventListener("animationend",(function e(){r.setPluginState({isHidden:!1}),r.el.removeEventListener("animationend",e,!1),n()}),!1):(r.setPluginState({isHidden:!1}),n()),r.opts.browserBackButtonClose&&r.updateBrowserHistory(),document.addEventListener("keydown",r.handleKeyDownInModal),r.uppy.emit("dashboard:modal-open"),t},r.closeModal=function(e){void 0===e&&(e={});var t=e.manualClose,n=void 0===t||t,o=r.getPluginState(),i=o.isHidden,a=o.isClosing;if(!i&&!a){var s=qo(),l=s.promise,u=s.resolve;return r.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),r.opts.animateOpenClose?(r.setPluginState({isClosing:!0}),r.el.addEventListener("animationend",(function e(){r.setPluginState({isHidden:!0,isClosing:!1}),r.superFocus.cancel(),r.savedActiveElement.focus(),r.el.removeEventListener("animationend",e,!1),u()}),!1)):(r.setPluginState({isHidden:!0}),r.superFocus.cancel(),r.savedActiveElement.focus(),u()),document.removeEventListener("keydown",r.handleKeyDownInModal),n&&r.opts.browserBackButtonClose&&history.state&&history.state[r.modalName]&&history.go(-1),r.uppy.emit("dashboard:modal-closed"),l}},r.isModalOpen=function(){return!r.getPluginState().isHidden||!1},r.requestCloseModal=function(){return r.opts.onRequestCloseModal?r.opts.onRequestCloseModal():r.closeModal()},r.setDarkModeCapability=function(e){var t=r.uppy.getState().capabilities;r.uppy.setState({capabilities:Io({},t,{darkMode:e})})},r.handleSystemDarkModeChange=function(e){var t=e.matches;r.uppy.log("[Dashboard] Dark mode is "+(t?"on":"off")),r.setDarkModeCapability(t)},r.toggleFileCard=function(e,t){var n=r.uppy.getFile(t);e?r.uppy.emit("dashboard:file-edit-start",n):r.uppy.emit("dashboard:file-edit-complete",n),r.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})},r.toggleAddFilesPanel=function(e){r.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})},r.addFiles=function(e){var t=e.map((function(e){return{source:r.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}}}));try{r.uppy.addFiles(t)}catch(Cd){r.uppy.log(Cd)}},r.startListeningToResize=function(){r.resizeObserver=new Wo((function(e,t){var n=e[0].contentRect,o=n.width,i=n.height;r.uppy.log("[Dashboard] resized: "+o+" / "+i,"debug"),r.setPluginState({containerWidth:o,containerHeight:i,areInsidesReadyToBeVisible:!0})})),r.resizeObserver.observe(r.el.querySelector(".uppy-Dashboard-inner")),r.makeDashboardInsidesVisibleAnywayTimeout=setTimeout((function(){var e=r.getPluginState(),t=!r.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(r.uppy.log("[Dashboard] resize event didn't fire on time: defaulted to mobile layout","debug"),r.setPluginState({areInsidesReadyToBeVisible:!0}))}),1e3)},r.stopListeningToResize=function(){r.resizeObserver.disconnect(),clearTimeout(r.makeDashboardInsidesVisibleAnywayTimeout)},r.recordIfFocusedOnUppyRecently=function(e){r.el.contains(e.target)?r.ifFocusedOnUppyRecently=!0:(r.ifFocusedOnUppyRecently=!1,r.superFocus.cancel())},r.disableAllFocusableElements=function(e){var t=So(r.el.querySelectorAll(Eo));e?t.forEach((function(e){var t=e.getAttribute("tabindex");t&&(e.dataset.inertTabindex=t),e.setAttribute("tabindex","-1")})):t.forEach((function(e){"inertTabindex"in e.dataset?e.setAttribute("tabindex",e.dataset.inertTabindex):e.removeAttribute("tabindex")})),r.dashboardIsDisabled=e},r.updateBrowserHistory=function(){var e;history.state&&history.state[r.modalName]||history.pushState(Io({},history.state,((e={})[r.modalName]=!0,e)),""),window.addEventListener("popstate",r.handlePopState,!1)},r.handlePopState=function(e){!r.isModalOpen()||e.state&&e.state[r.modalName]||r.closeModal({manualClose:!1}),!r.isModalOpen()&&e.state&&e.state[r.modalName]&&history.go(-1)},r.handleKeyDownInModal=function(e){27===e.keyCode&&r.requestCloseModal(e),9===e.keyCode&&Uo(e,r.getPluginState().activeOverlayType,r.el)},r.handleClickOutside=function(){r.opts.closeModalOnClickOutside&&r.requestCloseModal()},r.handlePaste=function(e){r.uppy.iteratePlugins((function(t){"acquirer"===t.type&&t.handleRootPaste&&t.handleRootPaste(e)}));var t=So(e.clipboardData.files);r.addFiles(t)},r.handleInputChange=function(e){e.preventDefault();var t=So(e.target.files);r.addFiles(t)},r.handleDragOver=function(e){e.preventDefault(),e.stopPropagation(),r.opts.disabled||r.opts.disableLocalFiles||(e.dataTransfer.dropEffect="copy",clearTimeout(r.removeDragOverClassTimeout),r.setPluginState({isDraggingOver:!0}))},r.handleDragLeave=function(e){e.preventDefault(),e.stopPropagation(),r.opts.disabled||r.opts.disableLocalFiles||(clearTimeout(r.removeDragOverClassTimeout),r.removeDragOverClassTimeout=setTimeout((function(){r.setPluginState({isDraggingOver:!1})}),50))},r.handleDrop=function(e,t){if(e.preventDefault(),e.stopPropagation(),!r.opts.disabled&&!r.opts.disableLocalFiles){clearTimeout(r.removeDragOverClassTimeout),r.setPluginState({isDraggingOver:!1}),r.uppy.iteratePlugins((function(t){"acquirer"===t.type&&t.handleRootDrop&&t.handleRootDrop(e)}));var n=!1;xo(e.dataTransfer,{logDropError:function(e){r.uppy.log(e,"error"),n||(r.uppy.info(e.message,"error"),n=!0)}}).then((function(e){e.length>0&&(r.uppy.log("[Dashboard] Files were dropped"),r.addFiles(e))}))}},r.handleRequestThumbnail=function(e){r.opts.waitForThumbnailsBeforeUpload||r.uppy.emit("thumbnail:request",e)},r.handleCancelThumbnail=function(e){r.opts.waitForThumbnailsBeforeUpload||r.uppy.emit("thumbnail:cancel",e)},r.handleKeyDownInInline=function(e){9===e.keyCode&&No(e,r.getPluginState().activeOverlayType,r.el)},r.handlePasteOnBody=function(e){r.el.contains(document.activeElement)&&r.handlePaste(e)},r.handleComplete=function(e){var t=e.failed;r.opts.closeAfterFinish&&0===t.length&&r.requestCloseModal()},r.handleCancelRestore=function(){r.uppy.emit("restore-canceled")},r._openFileEditorWhenFilesAdded=function(e){var t=e[0];r.canEditFile(t)&&r.openFileEditor(t)},r.initEvents=function(){if(r.opts.trigger&&!r.opts.inline){var e=Co(r.opts.trigger);e?e.forEach((function(e){return e.addEventListener("click",r.openModal)})):r.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")}r.startListeningToResize(),document.addEventListener("paste",r.handlePasteOnBody),r.uppy.on("plugin-remove",r.removeTarget),r.uppy.on("file-added",r.hideAllPanels),r.uppy.on("dashboard:modal-closed",r.hideAllPanels),r.uppy.on("file-editor:complete",r.hideAllPanels),r.uppy.on("complete",r.handleComplete),document.addEventListener("focus",r.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",r.recordIfFocusedOnUppyRecently,!0),r.opts.inline&&r.el.addEventListener("keydown",r.handleKeyDownInInline),r.opts.autoOpenFileEditor&&r.uppy.on("files-added",r._openFileEditorWhenFilesAdded)},r.removeEvents=function(){var e=Co(r.opts.trigger);!r.opts.inline&&e&&e.forEach((function(e){return e.removeEventListener("click",r.openModal)})),r.stopListeningToResize(),document.removeEventListener("paste",r.handlePasteOnBody),window.removeEventListener("popstate",r.handlePopState,!1),r.uppy.off("plugin-remove",r.removeTarget),r.uppy.off("file-added",r.hideAllPanels),r.uppy.off("dashboard:modal-closed",r.hideAllPanels),r.uppy.off("file-editor:complete",r.hideAllPanels),r.uppy.off("complete",r.handleComplete),document.removeEventListener("focus",r.recordIfFocusedOnUppyRecently),document.removeEventListener("click",r.recordIfFocusedOnUppyRecently),r.opts.inline&&r.el.removeEventListener("keydown",r.handleKeyDownInInline),r.opts.autoOpenFileEditor&&r.uppy.off("files-added",r._openFileEditorWhenFilesAdded)},r.superFocusOnEachUpdate=function(){var e=r.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,n=r.uppy.getState().info.isHidden,o=!r.opts.inline;n&&(o||e||t&&r.ifFocusedOnUppyRecently)?r.superFocus(r.el,r.getPluginState().activeOverlayType):r.superFocus.cancel()},r.afterUpdate=function(){!r.opts.disabled||r.dashboardIsDisabled?(!r.opts.disabled&&r.dashboardIsDisabled&&r.disableAllFocusableElements(!1),r.superFocusOnEachUpdate()):r.disableAllFocusableElements(!0)},r.cancelUpload=function(e){r.uppy.removeFile(e)},r.saveFileCard=function(e,t){r.uppy.setFileMeta(t,e),r.toggleFileCard(!1,t)},r._attachRenderFunctionToTarget=function(e){var t=r.uppy.getPlugin(e.id);return Io({},e,{icon:t.icon||r.opts.defaultPickerIcon,render:t.render})},r._isTargetSupported=function(e){var t=r.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()},r._getAcquirers=Vo((function(e){return e.filter((function(e){return"acquirer"===e.type&&r._isTargetSupported(e)})).map(r._attachRenderFunctionToTarget)})),r._getProgressIndicators=Vo((function(e){return e.filter((function(e){return"progressindicator"===e.type})).map(r._attachRenderFunctionToTarget)})),r._getEditors=Vo((function(e){return e.filter((function(e){return"editor"===e.type})).map(r._attachRenderFunctionToTarget)})),r.render=function(e){var t,n=r.getPluginState(),o=e.files,i=e.capabilities,a=e.allowNewUpload,s=Object.keys(o).filter((function(e){return!o[e].progress.uploadStarted})),l=Object.keys(o).filter((function(e){return o[e].progress.uploadStarted})),u=Object.keys(o).filter((function(e){return o[e].isPaused})),c=Object.keys(o).filter((function(e){return o[e].progress.uploadComplete})),p=Object.keys(o).filter((function(e){return o[e].error})),d=Object.keys(o).filter((function(e){return!o[e].progress.uploadComplete&&o[e].progress.uploadStarted})),h=d.filter((function(e){return!o[e].isPaused})),f=Object.keys(o).filter((function(e){return o[e].progress.preprocess||o[e].progress.postprocess})),m=l.length>0,v=100===e.totalProgress&&c.length===Object.keys(o).length&&0===f.length,g=m&&p.length===l.length,y=0!==d.length&&u.length===d.length,b=r._getAcquirers(n.targets),_=r._getProgressIndicators(n.targets),w=r._getEditors(n.targets);return t="auto"===r.opts.theme?i.darkMode?"dark":"light":r.opts.theme,["files","folders","both"].indexOf(r.opts.fileManagerSelectionType)<0&&(r.opts.fileManagerSelectionType="files",console.error('Unsupported option for "fileManagerSelectionType". Using default of "'+r.opts.fileManagerSelectionType+'".')),function(e){var t=0===e.totalFileCount,n=e.containerWidth>576,r=st({"uppy-Root":e.isTargetDOMEl}),o=st({"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}),i=1;e.containerWidth>900?i=5:e.containerWidth>700?i=4:e.containerWidth>576&&(i=3);var a=e.showSelectedFiles&&!t,s=e.recoveredState?Object.keys(e.recoveredState.files).length:null,l=e.files?Object.keys(e.files).filter((function(t){return e.files[t].isGhost})).length:null,u=gr("div",{className:o,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&mr(),"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},gr("div",{className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),gr("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:gr("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal},gr("span",{"aria-hidden":"true"},"\xd7")),gr("div",{className:"uppy-Dashboard-innerWrap"},gr("div",{className:"uppy-Dashboard-dropFilesHereHint"},e.i18n("dropHint")),a&&gr(ir,e),s&&gr("div",{className:"uppy-Dashboard-serviceMsg"},gr("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},gr("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},gr("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"}),gr("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),gr("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),gr("strong",{className:"uppy-Dashboard-serviceMsg-title"},e.i18n("sessionRestored")),gr("div",{class:"uppy-Dashboard-serviceMsg-text"},l>0?e.i18n("recoveredXFiles",{smart_count:l}):e.i18n("recoveredAllFiles"))),a?gr(Ln,vr({},e,{itemsPerRow:i})):gr(Hn,vr({},e,{isSizeMD:n})),gr(fr,null,e.showAddFilesPanel?gr(Vn,vr({key:"AddFiles"},e,{isSizeMD:n})):null),gr(fr,null,e.fileCardFor?gr(ur,vr({key:"FileCard"},e)):null),gr(fr,null,e.activePickerPanel?gr(Gn,vr({key:"Picker"},e)):null),gr(fr,null,e.showFileEditor?gr($n,vr({key:"Editor"},e)):null),gr("div",{className:"uppy-Dashboard-progressindicators"},e.progressindicators.map((function(t){return e.getPlugin(t.id).render(e.state)}))))));return gr("div",{className:r,dir:e.direction},u)}({state:e,isHidden:n.isHidden,files:o,newFiles:s,uploadStartedFiles:l,completeFiles:c,erroredFiles:p,inProgressFiles:d,inProgressNotPausedFiles:h,processingFiles:f,isUploadStarted:m,isAllComplete:v,isAllErrored:g,isAllPaused:y,totalFileCount:Object.keys(o).length,totalProgress:e.totalProgress,allowNewUpload:a,acquirers:b,theme:t,disabled:r.opts.disabled,disableLocalFiles:r.opts.disableLocalFiles,direction:r.opts.direction,activePickerPanel:n.activePickerPanel,showFileEditor:n.showFileEditor,saveFileEditor:r.saveFileEditor,disableAllFocusableElements:r.disableAllFocusableElements,animateOpenClose:r.opts.animateOpenClose,isClosing:n.isClosing,getPlugin:r.uppy.getPlugin,progressindicators:_,editors:w,autoProceed:r.uppy.opts.autoProceed,id:r.id,closeModal:r.requestCloseModal,handleClickOutside:r.handleClickOutside,handleInputChange:r.handleInputChange,handlePaste:r.handlePaste,inline:r.opts.inline,showPanel:r.showPanel,hideAllPanels:r.hideAllPanels,log:r.uppy.log,i18n:r.i18n,i18nArray:r.i18nArray,removeFile:r.uppy.removeFile,uppy:r.uppy,info:r.uppy.info,note:r.opts.note,recoveredState:e.recoveredState,metaFields:n.metaFields,resumableUploads:i.resumableUploads||!1,individualCancellation:i.individualCancellation,isMobileDevice:i.isMobileDevice,pauseUpload:r.uppy.pauseResume,retryUpload:r.uppy.retryUpload,cancelUpload:r.cancelUpload,cancelAll:r.uppy.cancelAll,fileCardFor:n.fileCardFor,toggleFileCard:r.toggleFileCard,toggleAddFilesPanel:r.toggleAddFilesPanel,showAddFilesPanel:n.showAddFilesPanel,saveFileCard:r.saveFileCard,openFileEditor:r.openFileEditor,canEditFile:r.canEditFile,width:r.opts.width,height:r.opts.height,showLinkToFileUploadResult:r.opts.showLinkToFileUploadResult,fileManagerSelectionType:r.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:r.opts.proudlyDisplayPoweredByUppy,hideCancelButton:r.opts.hideCancelButton,hideRetryButton:r.opts.hideRetryButton,hidePauseResumeButton:r.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:r.opts.showRemoveButtonAfterComplete,containerWidth:n.containerWidth,containerHeight:n.containerHeight,areInsidesReadyToBeVisible:n.areInsidesReadyToBeVisible,isTargetDOMEl:r.isTargetDOMEl,parentElement:r.el,allowedFileTypes:r.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:r.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:r.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:r.opts.showSelectedFiles,handleCancelRestore:r.handleCancelRestore,handleRequestThumbnail:r.handleRequestThumbnail,handleCancelThumbnail:r.handleCancelThumbnail,isDraggingOver:n.isDraggingOver,handleDragOver:r.handleDragOver,handleDragLeave:r.handleDragLeave,handleDrop:r.handleDrop})},r.discoverProviderPlugins=function(){r.uppy.iteratePlugins((function(e){e&&!e.target&&e.opts&&e.opts.target===r.constructor&&r.addTarget(e)}))},r.install=function(){r.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:!1,showFileEditor:!1,metaFields:r.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});var e=r.opts,t=e.inline,n=e.closeAfterFinish;if(t&&n)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.");r.uppy.opts.allowMultipleUploads&&n&&r.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 o=r.opts.target;o&&r.mount(o,Lo(r)),(r.opts.plugins||[]).forEach((function(e){var t=r.uppy.getPlugin(e);t&&t.mount(Lo(r),t)})),r.opts.disableStatusBar||r.uppy.use($r,{id:r.id+":StatusBar",target:Lo(r),hideUploadButton:r.opts.hideUploadButton,hideRetryButton:r.opts.hideRetryButton,hidePauseResumeButton:r.opts.hidePauseResumeButton,hideCancelButton:r.opts.hideCancelButton,showProgressDetails:r.opts.showProgressDetails,hideAfterFinish:r.opts.hideProgressAfterFinish,locale:r.opts.locale,doneButtonHandler:r.opts.doneButtonHandler}),r.opts.disableInformer||r.uppy.use(to,{id:r.id+":Informer",target:Lo(r)}),r.opts.disableThumbnailGenerator||r.uppy.use(wo,{id:r.id+":ThumbnailGenerator",thumbnailWidth:r.opts.thumbnailWidth,thumbnailType:r.opts.thumbnailType,waitForThumbnailsBeforeUpload:r.opts.waitForThumbnailsBeforeUpload,lazy:!r.opts.waitForThumbnailsBeforeUpload}),r.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;var i=!!r.darkModeMediaQuery&&r.darkModeMediaQuery.matches;r.uppy.log("[Dashboard] Dark mode is "+(i?"on":"off")),r.setDarkModeCapability(i),"auto"===r.opts.theme&&r.darkModeMediaQuery.addListener(r.handleSystemDarkModeChange),r.discoverProviderPlugins(),r.initEvents()},r.uninstall=function(){if(!r.opts.disableInformer){var e=r.uppy.getPlugin(r.id+":Informer");e&&r.uppy.removePlugin(e)}if(!r.opts.disableStatusBar){var t=r.uppy.getPlugin(r.id+":StatusBar");t&&r.uppy.removePlugin(t)}if(!r.opts.disableThumbnailGenerator){var n=r.uppy.getPlugin(r.id+":ThumbnailGenerator");n&&r.uppy.removePlugin(n)}(r.opts.plugins||[]).forEach((function(e){var t=r.uppy.getPlugin(e);t&&t.unmount()})),"auto"===r.opts.theme&&r.darkModeMediaQuery.removeListener(r.handleSystemDarkModeChange),r.unmount(),r.removeEvents()},r.id=r.opts.id||"Dashboard",r.title="Dashboard",r.type="orchestrator",r.modalName="uppy-Dashboard-"+D(),r.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}",back:"Back",addMore:"Add more",removeFile:"Remove file",editFile:"Edit file",editing:"Editing %{file}",finishEditingFile:"Finish editing file",save:"Save",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 o,i={target:"body",metaFields:[],trigger:"#uppy-select-files",inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Xo,showLinkToFileUploadResult:!0,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,doneButtonHandler:function(){r.uppy.reset(),r.requestCloseModal()},note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,onRequestCloseModal:function(){return r.closeModal()},showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,theme:"light",autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1};return r.opts=Io({},i,n),r.i18nInit(),r.superFocus=(o=!1,Ro((function(e,t){var n=Po(e,t),r=n.contains(document.activeElement);if(!r||!o){var i=n.querySelector("[data-uppy-super-focusable]");if(!r||i)if(i)i.focus({preventScroll:!0}),o=!0;else{var a=n.querySelector(Eo);a&&a.focus({preventScroll:!0}),o=!1}}}),260)),r.ifFocusedOnUppyRecently=!1,r.makeDashboardInsidesVisibleAnywayTimeout=null,r.removeDragOverClassTimeout=null,r}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,jo(t,n),r.prototype.onMount=function(){var e=this.el;Wr(e)||(e.dir="ltr")},r}(Ho),Do.VERSION="1.21.1",Mo),Ko={exports:{}};function Jo(){return(Jo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Qo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zo(e,t){return(Zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};Ko.exports=N}(),Ko=Ko.exports;var ei,ti,ni=ue.Plugin,ri=Ko.h,oi=(Yo=Go=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).type="acquirer",r.id=r.opts.id||"DragDrop",r.title="Drag & Drop",r.defaultLocale={strings:{dropHereOr:"Drop files here or %{browse}",browse:"browse"}},r.opts=Jo({},{target:null,inputName:"files[]",width:"100%",height:"100%",note:null},n),r.isDragDropSupported=mr(),r.removeDragOverClassTimeout=null,r.i18nInit(),r.onInputChange=r.onInputChange.bind(Qo(r)),r.handleDragOver=r.handleDragOver.bind(Qo(r)),r.handleDragLeave=r.handleDragLeave.bind(Qo(r)),r.handleDrop=r.handleDrop.bind(Qo(r)),r.addFiles=r.addFiles.bind(Qo(r)),r.render=r.render.bind(Qo(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Zo(t,n);var o=r.prototype;return o.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},o.i18nInit=function(){this.translator=new x([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},o.addFiles=function(e){var t=this,n=e.map((function(e){return{source:t.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}}}));try{this.uppy.addFiles(n)}catch(Cd){this.uppy.log(Cd)}},o.onInputChange=function(e){this.uppy.log("[DragDrop] Files selected through input");var t=So(e.target.files);this.addFiles(t),e.target.value=null},o.handleDrop=function(e){var t=this;this.opts.onDrop&&this.opts.onDrop(e),e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.log("[DragDrop] Files were dropped"),xo(e.dataTransfer,{logDropError:function(e){t.uppy.log(e,"error")}}).then((function(e){return t.addFiles(e)}))},o.handleDragOver=function(e){this.opts.onDragOver&&this.opts.onDragOver(e),e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0})},o.handleDragLeave=function(e){var t=this;this.opts.onDragLeave&&this.opts.onDragLeave(e),e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((function(){t.setPluginState({isDraggingOver:!1})}),50)},o.renderHiddenFileInput=function(){var e=this,t=this.uppy.opts.restrictions;return ri("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:function(t){e.fileInputRef=t},name:this.opts.inputName,multiple:1!==t.maxNumberOfFiles,accept:t.allowedFileTypes,onChange:this.onInputChange})},r.renderArrowSvg=function(){return ri("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},ri("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))},o.renderLabel=function(){return ri("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:ri("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))},o.renderNote=function(){return ri("span",{className:"uppy-DragDrop-note"},this.opts.note)},o.render=function(){var e=this,t="uppy-Root\n uppy-u-reset\n uppy-DragDrop-container\n "+(this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":"")+"\n "+(this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":"")+"\n ",n={width:this.opts.width,height:this.opts.height};return ri("button",{type:"button",className:t,style:n,onClick:function(){return e.fileInputRef.click()},onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),ri("div",{className:"uppy-DragDrop-inner"},r.renderArrowSvg(),this.renderLabel(),this.renderNote()))},o.install=function(){var e=this.opts.target;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)},o.uninstall=function(){this.unmount()},r}(ni),Go.VERSION="1.4.31",Yo);function ii(){return(ii=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ai(e,t){return(ai=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var si,li,ui=(ti=ei=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).addFiles=function(e){var t=e.map((function(e){return{source:r.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}}}));try{r.uppy.addFiles(t)}catch(Cd){r.uppy.log(Cd)}},r.handleDrop=function(e){e.preventDefault(),e.stopPropagation(),clearTimeout(r.removeDragOverClassTimeout),e.currentTarget.classList.remove("uppy-is-drag-over"),r.setPluginState({isDraggingOver:!1}),r.uppy.log("[DropTarget] Files were dropped"),xo(e.dataTransfer,{logDropError:function(e){r.uppy.log(e,"error")}}).then((function(e){return r.addFiles(e)}))},r.handleDragOver=function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy",clearTimeout(r.removeDragOverClassTimeout),e.currentTarget.classList.add("uppy-is-drag-over"),r.setPluginState({isDraggingOver:!0})},r.handleDragLeave=function(e){e.preventDefault(),e.stopPropagation();var t=e.currentTarget;clearTimeout(r.removeDragOverClassTimeout),r.removeDragOverClassTimeout=setTimeout((function(){t.classList.remove("uppy-is-drag-over"),r.setPluginState({isDraggingOver:!1})}),50)},r.addListeners=function(){var e=r.opts.target;if(e instanceof Element?r.nodes=[e]:"string"==typeof e&&(r.nodes=So(document.querySelectorAll(e))),!r.nodes&&!r.nodes.length>0)throw new Error('"'+e+'" does not match any HTML elements');r.nodes.forEach((function(e){e.addEventListener("dragover",r.handleDragOver,!1),e.addEventListener("dragleave",r.handleDragLeave,!1),e.addEventListener("drop",r.handleDrop,!1)}))},r.removeListeners=function(){r.nodes&&r.nodes.forEach((function(e){e.removeEventListener("dragover",r.handleDragOver,!1),e.removeEventListener("dragleave",r.handleDragLeave,!1),e.removeEventListener("drop",r.handleDrop,!1)}))},r.type="acquirer",r.id=r.opts.id||"DropTarget",r.title="Drop Target",r.opts=ii({},{target:null},n),r.removeDragOverClassTimeout=null,r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,ai(t,n);var o=r.prototype;return o.install=function(){this.setPluginState({isDraggingOver:!1}),this.addListeners()},o.uninstall=function(){this.removeListeners()},r}(ue.Plugin),ei.VERSION="0.2.4",ti),ci={exports:{}};function pi(){return(pi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function di(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hi(e,t){return(hi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};ci.exports=N}(),ci=ci.exports;var fi,mi,vi=ue.Plugin,gi=ci.h,yi=(li=si=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).id=r.opts.id||"FileInput",r.title="File Input",r.type="acquirer",r.defaultLocale={strings:{chooseFiles:"Choose files"}},r.opts=pi({},{target:null,pretty:!0,inputName:"files[]"},n),r.i18nInit(),r.render=r.render.bind(di(r)),r.handleInputChange=r.handleInputChange.bind(di(r)),r.handleClick=r.handleClick.bind(di(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,hi(t,n);var o=r.prototype;return o.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},o.i18nInit=function(){this.translator=new x([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},o.addFiles=function(e){var t=this,n=e.map((function(e){return{source:t.id,name:e.name,type:e.type,data:e}}));try{this.uppy.addFiles(n)}catch(Cd){this.uppy.log(Cd)}},o.handleInputChange=function(e){this.uppy.log("[FileInput] Something selected through input...");var t=So(e.target.files);this.addFiles(t),e.target.value=null},o.handleClick=function(e){this.input.click()},o.render=function(e){var t=this,n=this.uppy.opts.restrictions,r=n.allowedFileTypes?n.allowedFileTypes.join(","):null;return gi("div",{className:"uppy-Root uppy-FileInput-container"},gi("input",{className:"uppy-FileInput-input",style:this.opts.pretty&&{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:1!==n.maxNumberOfFiles,accept:r,ref:function(e){t.input=e}}),this.opts.pretty&&gi("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick},this.i18n("chooseFiles")))},o.install=function(){var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.unmount()},r}(vi),si.VERSION="1.5.2",li),bi={exports:{}};function _i(){return(_i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function wi(e,t){return(wi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};bi.exports=N}(),bi=bi.exports;var Ci,Si,ki=ue.Plugin,xi=bi.h,Pi=(mi=fi=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).id=r.opts.id||"ProgressBar",r.title="Progress Bar",r.type="progressindicator",r.opts=_i({},{target:"body",replaceTargetContent:!1,fixed:!1,hideAfterFinish:!0},n),r.render=r.render.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,wi(t,n);var o=r.prototype;return o.render=function(e){var t=e.totalProgress||0,n=(0===t||100===t)&&this.opts.hideAfterFinish;return xi("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":n},xi("div",{className:"uppy-ProgressBar-inner",style:{width:t+"%"}}),xi("div",{className:"uppy-ProgressBar-percentage"},t))},o.install=function(){var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.unmount()},r}(ki),fi.VERSION="1.3.30",mi),Ei={exports:{}};Ci=this,Si=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?r(Object(o),!0).forEach((function(t){n(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function i(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,void 0):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var s="undefined"!=typeof window&&void 0!==window.document,l=s?window:{},u=!(!s||!l.document.documentElement)&&"ontouchstart"in l.document.documentElement,c=!!s&&"PointerEvent"in l,p="".concat("cropper","-crop"),d="".concat("cropper","-disabled"),h="".concat("cropper","-hidden"),f="".concat("cropper","-hide"),m="".concat("cropper","-invisible"),v="".concat("cropper","-modal"),g="".concat("cropper","-move"),y="".concat("cropper","Action"),b="".concat("cropper","Preview"),_=c?"pointerdown":u?"touchstart":"mousedown",w=c?"pointermove":u?"touchmove":"mousemove",C=c?"pointerup pointercancel":u?"touchend touchcancel":"mouseup",S=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,k=/^data:/,x=/^data:image\/jpeg;base64,/,P=/^img|canvas$/i,E={viewMode:0,dragMode:"crop",initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},O=Number.isNaN||l.isNaN;function A(e){return"number"==typeof e&&!O(e)}var U=function(e){return e>0&&e<1/0};function N(e){return void 0===e}function T(t){return"object"===e(t)&&null!==t}var R=Object.prototype.hasOwnProperty;function F(e){if(!T(e))return!1;try{var t=e.constructor,n=t.prototype;return t&&n&&R.call(n,"isPrototypeOf")}catch(Mp){return!1}}function D(e){return"function"==typeof e}var M=Array.prototype.slice;function B(e){return Array.from?Array.from(e):M.call(e)}function I(e,t){return e&&D(t)&&(Array.isArray(e)||A(e.length)?B(e).forEach((function(n,r){t.call(e,n,r,e)})):T(e)&&Object.keys(e).forEach((function(n){t.call(e,e[n],n,e)}))),e}var L=Object.assign||function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return T(e)&&n.length>0&&n.forEach((function(t){T(t)&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e},j=/\.\d*(?:0|9){12}\d*$/;function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return j.test(e)?Math.round(e*t)/t:e}var H=/^width|height|left|top|marginLeft|marginTop$/;function W(e,t){var n=e.style;I(t,(function(e,t){H.test(t)&&A(e)&&(e="".concat(e,"px")),n[t]=e}))}function V(e,t){if(t)if(A(e.length))I(e,(function(e){V(e,t)}));else if(e.classList)e.classList.add(t);else{var n=e.className.trim();n?n.indexOf(t)<0&&(e.className="".concat(n," ").concat(t)):e.className=t}}function q(e,t){t&&(A(e.length)?I(e,(function(e){q(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function X(e,t,n){t&&(A(e.length)?I(e,(function(e){X(e,t,n)})):n?V(e,t):q(e,t))}var G=/([a-z\d])([A-Z])/g;function Y(e){return e.replace(G,"$1-$2").toLowerCase()}function $(e,t){return T(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Y(t)))}function K(e,t,n){T(n)?e[t]=n:e.dataset?e.dataset[t]=n:e.setAttribute("data-".concat(Y(t)),n)}var J=/\s\s*/,Q=function(){var e=!1;if(s){var t=!1,n=function(){},r=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});l.addEventListener("test",n,r),l.removeEventListener("test",n,r)}return e}();function Z(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n;t.trim().split(J).forEach((function(t){if(!Q){var i=e.listeners;i&&i[t]&&i[t][n]&&(o=i[t][n],delete i[t][n],0===Object.keys(i[t]).length&&delete i[t],0===Object.keys(i).length&&delete e.listeners)}e.removeEventListener(t,o,r)}))}function ee(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=n;t.trim().split(J).forEach((function(t){if(r.once&&!Q){var i=e.listeners,a=void 0===i?{}:i;o=function(){delete a[t][n],e.removeEventListener(t,o,r);for(var i=arguments.length,s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];n.apply(e,s)},a[t]||(a[t]={}),a[t][n]&&e.removeEventListener(t,a[t][n],r),a[t][n]=o,e.listeners=a}e.addEventListener(t,o,r)}))}function te(e,t,n){var r;return D(Event)&&D(CustomEvent)?r=new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0}):(r=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,n),e.dispatchEvent(r)}function ne(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var re=l.location,oe=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function ie(e){var t=e.match(oe);return null!==t&&(t[1]!==re.protocol||t[2]!==re.hostname||t[3]!==re.port)}function ae(e){var t="timestamp=".concat((new Date).getTime());return e+(-1===e.indexOf("?")?"?":"&")+t}function se(e){var t=e.rotate,n=e.scaleX,r=e.scaleY,o=e.translateX,i=e.translateY,a=[];A(o)&&0!==o&&a.push("translateX(".concat(o,"px)")),A(i)&&0!==i&&a.push("translateY(".concat(i,"px)")),A(t)&&0!==t&&a.push("rotate(".concat(t,"deg)")),A(n)&&1!==n&&a.push("scaleX(".concat(n,")")),A(r)&&1!==r&&a.push("scaleY(".concat(r,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function le(e,t){var n=e.pageX,r=e.pageY,i={endX:n,endY:r};return t?i:o({startX:n,startY:r},i)}function ue(e){var t=e.aspectRatio,n=e.height,r=e.width,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",i=U(r),a=U(n);if(i&&a){var s=n*t;"contain"===o&&s>r||"cover"===o&&s<r?n=r/t:r=n*t}else i?n=r/t:a&&(r=n*t);return{width:r,height:n}}var ce=String.fromCharCode,pe=/^data:.*,/;var de={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,n=this.container,r=this.cropper;V(r,h),q(e,h);var o={width:Math.max(n.offsetWidth,Number(t.minContainerWidth)||200),height:Math.max(n.offsetHeight,Number(t.minContainerHeight)||100)};this.containerData=o,W(r,{width:o.width,height:o.height}),V(e,h),q(r,h)},initCanvas:function(){var e=this.containerData,t=this.imageData,n=this.options.viewMode,r=Math.abs(t.rotate)%180==90,o=r?t.naturalHeight:t.naturalWidth,i=r?t.naturalWidth:t.naturalHeight,a=o/i,s=e.width,l=e.height;e.height*a>e.width?3===n?s=e.height*a:l=e.width/a:3===n?l=e.width/a:s=e.height*a;var u={aspectRatio:a,naturalWidth:o,naturalHeight:i,width:s,height:l};u.left=(e.width-s)/2,u.top=(e.height-l)/2,u.oldLeft=u.left,u.oldTop=u.top,this.canvasData=u,this.limited=1===n||2===n,this.limitCanvas(!0,!0),this.initialImageData=L({},t),this.initialCanvasData=L({},u)},limitCanvas:function(e,t){var n=this.options,r=this.containerData,o=this.canvasData,i=this.cropBoxData,a=n.viewMode,s=o.aspectRatio,l=this.cropped&&i;if(e){var u=Number(n.minCanvasWidth)||0,c=Number(n.minCanvasHeight)||0;a>1?(u=Math.max(u,r.width),c=Math.max(c,r.height),3===a&&(c*s>u?u=c*s:c=u/s)):a>0&&(u?u=Math.max(u,l?i.width:0):c?c=Math.max(c,l?i.height:0):l&&(u=i.width,(c=i.height)*s>u?u=c*s:c=u/s));var p=ue({aspectRatio:s,width:u,height:c});u=p.width,c=p.height,o.minWidth=u,o.minHeight=c,o.maxWidth=1/0,o.maxHeight=1/0}if(t)if(a>(l?0:1)){var d=r.width-o.width,h=r.height-o.height;o.minLeft=Math.min(0,d),o.minTop=Math.min(0,h),o.maxLeft=Math.max(0,d),o.maxTop=Math.max(0,h),l&&this.limited&&(o.minLeft=Math.min(i.left,i.left+(i.width-o.width)),o.minTop=Math.min(i.top,i.top+(i.height-o.height)),o.maxLeft=i.left,o.maxTop=i.top,2===a&&(o.width>=r.width&&(o.minLeft=Math.min(0,d),o.maxLeft=Math.max(0,d)),o.height>=r.height&&(o.minTop=Math.min(0,h),o.maxTop=Math.max(0,h))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=r.width,o.maxTop=r.height},renderCanvas:function(e,t){var n=this.canvasData,r=this.imageData;if(t){var o=function(e){var t=e.width,n=e.height,r=e.degree;if(90==(r=Math.abs(r)%180))return{width:n,height:t};var o=r%90*Math.PI/180,i=Math.sin(o),a=Math.cos(o),s=t*a+n*i,l=t*i+n*a;return r>90?{width:l,height:s}:{width:s,height:l}}({width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0}),i=o.width,a=o.height,s=n.width*(i/n.naturalWidth),l=n.height*(a/n.naturalHeight);n.left-=(s-n.width)/2,n.top-=(l-n.height)/2,n.width=s,n.height=l,n.aspectRatio=i/a,n.naturalWidth=i,n.naturalHeight=a,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCanvas(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,W(this.canvas,L({width:n.width,height:n.height},se({translateX:n.left,translateY:n.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,n=this.imageData,r=n.naturalWidth*(t.width/t.naturalWidth),o=n.naturalHeight*(t.height/t.naturalHeight);L(n,{width:r,height:o,left:(t.width-r)/2,top:(t.height-o)/2}),W(this.image,L({width:n.width,height:n.height},se(L({translateX:n.left,translateY:n.top},n)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,n=e.aspectRatio||e.initialAspectRatio,r=Number(e.autoCropArea)||.8,o={width:t.width,height:t.height};n&&(t.height*n>t.width?o.height=o.width/n:o.width=o.height*n),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*r),o.height=Math.max(o.minHeight,o.height*r),o.left=t.left+(t.width-o.width)/2,o.top=t.top+(t.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=L({},o)},limitCropBox:function(e,t){var n=this.options,r=this.containerData,o=this.canvasData,i=this.cropBoxData,a=this.limited,s=n.aspectRatio;if(e){var l=Number(n.minCropBoxWidth)||0,u=Number(n.minCropBoxHeight)||0,c=a?Math.min(r.width,o.width,o.width+o.left,r.width-o.left):r.width,p=a?Math.min(r.height,o.height,o.height+o.top,r.height-o.top):r.height;l=Math.min(l,r.width),u=Math.min(u,r.height),s&&(l&&u?u*s>l?u=l/s:l=u*s:l?u=l/s:u&&(l=u*s),p*s>c?p=c/s:c=p*s),i.minWidth=Math.min(l,c),i.minHeight=Math.min(u,p),i.maxWidth=c,i.maxHeight=p}t&&(a?(i.minLeft=Math.max(0,o.left),i.minTop=Math.max(0,o.top),i.maxLeft=Math.min(r.width,o.left+o.width)-i.width,i.maxTop=Math.min(r.height,o.top+o.height)-i.height):(i.minLeft=0,i.minTop=0,i.maxLeft=r.width-i.width,i.maxTop=r.height-i.height))},renderCropBox:function(){var e=this.options,t=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.width<n.minWidth)&&(n.left=n.oldLeft),(n.height>n.maxHeight||n.height<n.minHeight)&&(n.top=n.oldTop),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),this.limitCropBox(!1,!0),n.left=Math.min(Math.max(n.left,n.minLeft),n.maxLeft),n.top=Math.min(Math.max(n.top,n.minTop),n.maxTop),n.oldLeft=n.left,n.oldTop=n.top,e.movable&&e.cropBoxMovable&&K(this.face,y,n.width>=t.width&&n.height>=t.height?"move":"all"),W(this.cropBox,L({width:n.width,height:n.height},se({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),te(this.element,"crop",this.getData())}},he={initPreview:function(){var e=this.element,t=this.crossOrigin,n=this.options.preview,r=t?this.crossOriginUrl:this.url,o=e.alt||"The image to preview",i=document.createElement("img");if(t&&(i.crossOrigin=t),i.src=r,i.alt=o,this.viewBox.appendChild(i),this.viewBoxImage=i,n){var a=n;"string"==typeof n?a=e.ownerDocument.querySelectorAll(n):n.querySelector&&(a=[n]),this.previews=a,I(a,(function(e){var n=document.createElement("img");K(e,b,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(n.crossOrigin=t),n.src=r,n.alt=o,n.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(n)}))}},resetPreview:function(){I(this.previews,(function(e){var t=$(e,b);W(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(T(e[t]))try{delete e[t]}catch(Mp){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(Mp){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(Y(t)))}(e,b)}))},preview:function(){var e=this.imageData,t=this.canvasData,n=this.cropBoxData,r=n.width,o=n.height,i=e.width,a=e.height,s=n.left-t.left-e.left,l=n.top-t.top-e.top;this.cropped&&!this.disabled&&(W(this.viewBoxImage,L({width:i,height:a},se(L({translateX:-s,translateY:-l},e)))),I(this.previews,(function(t){var n=$(t,b),u=n.width,c=n.height,p=u,d=c,h=1;r&&(d=o*(h=u/r)),o&&d>c&&(p=r*(h=c/o),d=c),W(t,{width:p,height:d}),W(t.getElementsByTagName("img")[0],L({width:i*h,height:a*h},se(L({translateX:-s*h,translateY:-l*h},e))))})))}},fe={bind:function(){var e=this.element,t=this.options,n=this.cropper;D(t.cropstart)&&ee(e,"cropstart",t.cropstart),D(t.cropmove)&&ee(e,"cropmove",t.cropmove),D(t.cropend)&&ee(e,"cropend",t.cropend),D(t.crop)&&ee(e,"crop",t.crop),D(t.zoom)&&ee(e,"zoom",t.zoom),ee(n,_,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&ee(n,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&ee(n,"dblclick",this.onDblclick=this.dblclick.bind(this)),ee(e.ownerDocument,w,this.onCropMove=this.cropMove.bind(this)),ee(e.ownerDocument,C,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,n=this.cropper;D(t.cropstart)&&Z(e,"cropstart",t.cropstart),D(t.cropmove)&&Z(e,"cropmove",t.cropmove),D(t.cropend)&&Z(e,"cropend",t.cropend),D(t.crop)&&Z(e,"crop",t.crop),D(t.zoom)&&Z(e,"zoom",t.zoom),Z(n,_,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Z(n,"wheel",this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Z(n,"dblclick",this.onDblclick),Z(e.ownerDocument,w,this.onCropMove),Z(e.ownerDocument,C,this.onCropEnd),t.responsive&&Z(window,"resize",this.onResize)}},me={resize:function(){if(!this.disabled){var e,t,n=this.options,r=this.container,o=this.containerData,i=r.offsetWidth/o.width;1===i&&r.offsetHeight===o.height||(n.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),n.restore&&(this.setCanvasData(I(e,(function(t,n){e[n]=t*i}))),this.setCropBoxData(I(t,(function(e,n){t[n]=e*i})))))}},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,n=Number(this.options.wheelZoomRatio)||.1,r=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1}),50),e.deltaY?r=e.deltaY>0?1:-1:e.wheelDelta?r=-e.wheelDelta/120:e.detail&&(r=e.detail>0?1:-1),this.zoom(-r*n,e)))},cropStart:function(e){var t=e.buttons,n=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(A(t)&&1!==t||A(n)&&0!==n||e.ctrlKey))){var r,o=this.options,i=this.pointers;e.changedTouches?I(e.changedTouches,(function(e){i[e.identifier]=le(e)})):i[e.pointerId||0]=le(e),r=Object.keys(i).length>1&&o.zoomable&&o.zoomOnTouch?"zoom":$(e.target,y),S.test(r)&&!1!==te(this.element,"cropstart",{originalEvent:e,action:r})&&(e.preventDefault(),this.action=r,this.cropping=!1,"crop"===r&&(this.cropping=!0,V(this.dragBox,v)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var n=this.pointers;e.preventDefault(),!1!==te(this.element,"cropmove",{originalEvent:e,action:t})&&(e.changedTouches?I(e.changedTouches,(function(e){L(n[e.identifier]||{},le(e,!0))})):L(n[e.pointerId||0]||{},le(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,n=this.pointers;e.changedTouches?I(e.changedTouches,(function(e){delete n[e.identifier]})):delete n[e.pointerId||0],t&&(e.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,X(this.dragBox,v,this.cropped&&this.options.modal)),te(this.element,"cropend",{originalEvent:e,action:t}))}}},ve={change:function(e){var t,n=this.options,r=this.canvasData,i=this.containerData,a=this.cropBoxData,s=this.pointers,l=this.action,u=n.aspectRatio,c=a.left,p=a.top,d=a.width,f=a.height,m=c+d,v=p+f,g=0,y=0,b=i.width,_=i.height,w=!0;!u&&e.shiftKey&&(u=d&&f?d/f:1),this.limited&&(g=a.minLeft,y=a.minTop,b=g+Math.min(i.width,r.width,r.left+r.width),_=y+Math.min(i.height,r.height,r.top+r.height));var C=s[Object.keys(s)[0]],S={x:C.endX-C.startX,y:C.endY-C.startY},k=function(e){switch(e){case"e":m+S.x>b&&(S.x=b-m);break;case"w":c+S.x<g&&(S.x=g-c);break;case"n":p+S.y<y&&(S.y=y-p);break;case"s":v+S.y>_&&(S.y=_-v)}};switch(l){case"all":c+=S.x,p+=S.y;break;case"e":if(S.x>=0&&(m>=b||u&&(p<=y||v>=_))){w=!1;break}k("e"),(d+=S.x)<0&&(l="w",c-=d=-d),u&&(f=d/u,p+=(a.height-f)/2);break;case"n":if(S.y<=0&&(p<=y||u&&(c<=g||m>=b))){w=!1;break}k("n"),f-=S.y,p+=S.y,f<0&&(l="s",p-=f=-f),u&&(d=f*u,c+=(a.width-d)/2);break;case"w":if(S.x<=0&&(c<=g||u&&(p<=y||v>=_))){w=!1;break}k("w"),d-=S.x,c+=S.x,d<0&&(l="e",c-=d=-d),u&&(f=d/u,p+=(a.height-f)/2);break;case"s":if(S.y>=0&&(v>=_||u&&(c<=g||m>=b))){w=!1;break}k("s"),(f+=S.y)<0&&(l="n",p-=f=-f),u&&(d=f*u,c+=(a.width-d)/2);break;case"ne":if(u){if(S.y<=0&&(p<=y||m>=b)){w=!1;break}k("n"),f-=S.y,p+=S.y,d=f*u}else k("n"),k("e"),S.x>=0?m<b?d+=S.x:S.y<=0&&p<=y&&(w=!1):d+=S.x,S.y<=0?p>y&&(f-=S.y,p+=S.y):(f-=S.y,p+=S.y);d<0&&f<0?(l="sw",p-=f=-f,c-=d=-d):d<0?(l="nw",c-=d=-d):f<0&&(l="se",p-=f=-f);break;case"nw":if(u){if(S.y<=0&&(p<=y||c<=g)){w=!1;break}k("n"),f-=S.y,p+=S.y,d=f*u,c+=a.width-d}else k("n"),k("w"),S.x<=0?c>g?(d-=S.x,c+=S.x):S.y<=0&&p<=y&&(w=!1):(d-=S.x,c+=S.x),S.y<=0?p>y&&(f-=S.y,p+=S.y):(f-=S.y,p+=S.y);d<0&&f<0?(l="se",p-=f=-f,c-=d=-d):d<0?(l="ne",c-=d=-d):f<0&&(l="sw",p-=f=-f);break;case"sw":if(u){if(S.x<=0&&(c<=g||v>=_)){w=!1;break}k("w"),d-=S.x,c+=S.x,f=d/u}else k("s"),k("w"),S.x<=0?c>g?(d-=S.x,c+=S.x):S.y>=0&&v>=_&&(w=!1):(d-=S.x,c+=S.x),S.y>=0?v<_&&(f+=S.y):f+=S.y;d<0&&f<0?(l="ne",p-=f=-f,c-=d=-d):d<0?(l="se",c-=d=-d):f<0&&(l="nw",p-=f=-f);break;case"se":if(u){if(S.x>=0&&(m>=b||v>=_)){w=!1;break}k("e"),f=(d+=S.x)/u}else k("s"),k("e"),S.x>=0?m<b?d+=S.x:S.y>=0&&v>=_&&(w=!1):d+=S.x,S.y>=0?v<_&&(f+=S.y):f+=S.y;d<0&&f<0?(l="nw",p-=f=-f,c-=d=-d):d<0?(l="sw",c-=d=-d):f<0&&(l="ne",p-=f=-f);break;case"move":this.move(S.x,S.y),w=!1;break;case"zoom":this.zoom(function(e){var t=o({},e),n=[];return I(e,(function(e,r){delete t[r],I(t,(function(t){var r=Math.abs(e.startX-t.startX),o=Math.abs(e.startY-t.startY),i=Math.abs(e.endX-t.endX),a=Math.abs(e.endY-t.endY),s=Math.sqrt(r*r+o*o),l=(Math.sqrt(i*i+a*a)-s)/s;n.push(l)}))})),n.sort((function(e,t){return Math.abs(e)<Math.abs(t)})),n[0]}(s),e),w=!1;break;case"crop":if(!S.x||!S.y){w=!1;break}t=ne(this.cropper),c=C.startX-t.left,p=C.startY-t.top,d=a.minWidth,f=a.minHeight,S.x>0?l=S.y>0?"se":"ne":S.x<0&&(c-=d,l=S.y>0?"sw":"nw"),S.y<0&&(p-=f),this.cropped||(q(this.cropBox,h),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}w&&(a.width=d,a.height=f,a.left=c,a.top=p,this.action=l,this.renderCropBox()),I(s,(function(e){e.startX=e.endX,e.startY=e.endY}))}},ge={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&V(this.dragBox,v),q(this.cropBox,h),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=L({},this.initialImageData),this.canvasData=L({},this.initialCanvasData),this.cropBoxData=L({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(L(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),q(this.dragBox,v),V(this.cropBox,h)),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,I(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,q(this.cropper,d)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,V(this.cropper,d)),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,n=this.canvasData,r=n.left,o=n.top;return this.moveTo(N(e)?e:r+Number(e),N(t)?t:o+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.canvasData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(A(e)&&(n.left=e,r=!0),A(t)&&(n.top=t,r=!0),r&&this.renderCanvas(!0)),this},zoom:function(e,t){var n=this.canvasData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(n.width*e/n.naturalWidth,null,t)},zoomTo:function(e,t,n){var r=this.options,o=this.canvasData,i=o.width,a=o.height,s=o.naturalWidth,l=o.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&r.zoomable){var u=s*e,c=l*e;if(!1===te(this.element,"zoom",{ratio:e,oldRatio:i/s,originalEvent:n}))return this;if(n){var p=this.pointers,d=ne(this.cropper),h=p&&Object.keys(p).length?function(e){var t=0,n=0,r=0;return I(e,(function(e){var o=e.startX,i=e.startY;t+=o,n+=i,r+=1})),{pageX:t/=r,pageY:n/=r}}(p):{pageX:n.pageX,pageY:n.pageY};o.left-=(u-i)*((h.pageX-d.left-o.left)/i),o.top-=(c-a)*((h.pageY-d.top-o.top)/a)}else F(t)&&A(t.x)&&A(t.y)?(o.left-=(u-i)*((t.x-o.left)/i),o.top-=(c-a)*((t.y-o.top)/a)):(o.left-=(u-i)/2,o.top-=(c-a)/2);o.width=u,o.height=c,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return A(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,A(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(A(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=this.imageData,r=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(A(e)&&(n.scaleX=e,r=!0),A(t)&&(n.scaleY=t,r=!0),r&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.options,r=this.imageData,o=this.canvasData,i=this.cropBoxData;if(this.ready&&this.cropped){e={x:i.left-o.left,y:i.top-o.top,width:i.width,height:i.height};var a=r.width/r.naturalWidth;if(I(e,(function(t,n){e[n]=t/a})),t){var s=Math.round(e.y+e.height),l=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=l-e.x,e.height=s-e.y}}else e={x:0,y:0,width:0,height:0};return n.rotatable&&(e.rotate=r.rotate||0),n.scalable&&(e.scaleX=r.scaleX||1,e.scaleY=r.scaleY||1),e},setData:function(e){var t=this.options,n=this.imageData,r=this.canvasData,o={};if(this.ready&&!this.disabled&&F(e)){var i=!1;t.rotatable&&A(e.rotate)&&e.rotate!==n.rotate&&(n.rotate=e.rotate,i=!0),t.scalable&&(A(e.scaleX)&&e.scaleX!==n.scaleX&&(n.scaleX=e.scaleX,i=!0),A(e.scaleY)&&e.scaleY!==n.scaleY&&(n.scaleY=e.scaleY,i=!0)),i&&this.renderCanvas(!0,!0);var a=n.width/n.naturalWidth;A(e.x)&&(o.left=e.x*a+r.left),A(e.y)&&(o.top=e.y*a+r.top),A(e.width)&&(o.width=e.width*a),A(e.height)&&(o.height=e.height*a),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?L({},this.containerData):{}},getImageData:function(){return this.sized?L({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&I(["left","top","width","height","naturalWidth","naturalHeight"],(function(n){t[n]=e[n]})),t},setCanvasData:function(e){var t=this.canvasData,n=t.aspectRatio;return this.ready&&!this.disabled&&F(e)&&(A(e.left)&&(t.left=e.left),A(e.top)&&(t.top=e.top),A(e.width)?(t.width=e.width,t.height=e.width/n):A(e.height)&&(t.height=e.height,t.width=e.height*n),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,n,r=this.cropBoxData,o=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&F(e)&&(A(e.left)&&(r.left=e.left),A(e.top)&&(r.top=e.top),A(e.width)&&e.width!==r.width&&(t=!0,r.width=e.width),A(e.height)&&e.height!==r.height&&(n=!0,r.height=e.height),o&&(t?r.height=r.width/o:n&&(r.width=r.height*o)),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,n=function(e,t,n,r){var o=t.aspectRatio,a=t.naturalWidth,s=t.naturalHeight,l=t.rotate,u=void 0===l?0:l,c=t.scaleX,p=void 0===c?1:c,d=t.scaleY,h=void 0===d?1:d,f=n.aspectRatio,m=n.naturalWidth,v=n.naturalHeight,g=r.fillColor,y=void 0===g?"transparent":g,b=r.imageSmoothingEnabled,_=void 0===b||b,w=r.imageSmoothingQuality,C=void 0===w?"low":w,S=r.maxWidth,k=void 0===S?1/0:S,x=r.maxHeight,P=void 0===x?1/0:x,E=r.minWidth,O=void 0===E?0:E,A=r.minHeight,U=void 0===A?0:A,N=document.createElement("canvas"),T=N.getContext("2d"),R=ue({aspectRatio:f,width:k,height:P}),F=ue({aspectRatio:f,width:O,height:U},"cover"),D=Math.min(R.width,Math.max(F.width,m)),M=Math.min(R.height,Math.max(F.height,v)),B=ue({aspectRatio:o,width:k,height:P}),I=ue({aspectRatio:o,width:O,height:U},"cover"),L=Math.min(B.width,Math.max(I.width,a)),j=Math.min(B.height,Math.max(I.height,s)),H=[-L/2,-j/2,L,j];return N.width=z(D),N.height=z(M),T.fillStyle=y,T.fillRect(0,0,D,M),T.save(),T.translate(D/2,M/2),T.rotate(u*Math.PI/180),T.scale(p,h),T.imageSmoothingEnabled=_,T.imageSmoothingQuality=C,T.drawImage.apply(T,[e].concat(i(H.map((function(e){return Math.floor(z(e))}))))),T.restore(),N}(this.image,this.imageData,t,e);if(!this.cropped)return n;var r=this.getData(),o=r.x,a=r.y,s=r.width,l=r.height,u=n.width/Math.floor(t.naturalWidth);1!==u&&(o*=u,a*=u,s*=u,l*=u);var c=s/l,p=ue({aspectRatio:c,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),d=ue({aspectRatio:c,width:e.minWidth||0,height:e.minHeight||0},"cover"),h=ue({aspectRatio:c,width:e.width||(1!==u?n.width:s),height:e.height||(1!==u?n.height:l)}),f=h.width,m=h.height;f=Math.min(p.width,Math.max(d.width,f)),m=Math.min(p.height,Math.max(d.height,m));var v=document.createElement("canvas"),g=v.getContext("2d");v.width=z(f),v.height=z(m),g.fillStyle=e.fillColor||"transparent",g.fillRect(0,0,f,m);var y=e.imageSmoothingEnabled,b=void 0===y||y,_=e.imageSmoothingQuality;g.imageSmoothingEnabled=b,_&&(g.imageSmoothingQuality=_);var w,C,S,k,x,P,E=n.width,O=n.height,A=o,U=a;A<=-s||A>E?(A=0,w=0,S=0,x=0):A<=0?(S=-A,A=0,x=w=Math.min(E,s+A)):A<=E&&(S=0,x=w=Math.min(s,E-A)),w<=0||U<=-l||U>O?(U=0,C=0,k=0,P=0):U<=0?(k=-U,U=0,P=C=Math.min(O,l+U)):U<=O&&(k=0,P=C=Math.min(l,O-U));var N=[A,U,w,C];if(x>0&&P>0){var T=f/s;N.push(S*T,k*T,x*T,P*T)}return g.drawImage.apply(g,[n].concat(i(N.map((function(e){return Math.floor(z(e))}))))),v},setAspectRatio:function(e){var t=this.options;return this.disabled||N(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,n=this.dragBox,r=this.face;if(this.ready&&!this.disabled){var o="crop"===e,i=t.movable&&"move"===e;e=o||i?e:"none",t.dragMode=e,K(n,y,e),X(n,p,o),X(n,g,i),t.cropBoxMovable||(K(r,y,e),X(r,p,o),X(r,g,i))}return this}},ye=l.Cropper,be=function(){function e(t){var n=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||!P.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=L({},E,F(n)&&n),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 n,r,o;return n=e,o=[{key:"noConflict",value:function(){return window.Cropper=ye,e}},{key:"setDefaults",value:function(e){L(E,F(e)&&e)}}],(r=[{key:"init",value:function(){var e,t=this.element,n=t.tagName.toLowerCase();if(!t.cropper){if(t.cropper=this,"img"===n){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===n&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var n=this.element,r=this.options;if(r.rotatable||r.scalable||(r.checkOrientation=!1),r.checkOrientation&&window.ArrayBuffer)if(k.test(e))x.test(e)?this.read((o=e.replace(pe,""),i=atob(o),a=new ArrayBuffer(i.length),I(s=new Uint8Array(a),(function(e,t){s[t]=i.charCodeAt(t)})),a)):this.clone();else{var o,i,a,s,l=new XMLHttpRequest,u=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=u,l.onerror=u,l.ontimeout=u,l.onprogress=function(){"image/jpeg"!==l.getResponseHeader("content-type")&&l.abort()},l.onload=function(){t.read(l.response)},l.onloadend=function(){t.reloading=!1,t.xhr=null},r.checkCrossOrigin&&ie(e)&&n.crossOrigin&&(e=ae(e)),l.open("GET",e),l.responseType="arraybuffer",l.withCredentials="use-credentials"===n.crossOrigin,l.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,n=this.imageData,r=function(e){var t,n=new DataView(e);try{var r,o,i;if(255===n.getUint8(0)&&216===n.getUint8(1))for(var a=n.byteLength,s=2;s+1<a;){if(255===n.getUint8(s)&&225===n.getUint8(s+1)){o=s;break}s+=1}if(o){var l=o+10;if("Exif"===function(e,t,n){var r="";n+=t;for(var o=t;o<n;o+=1)r+=ce(e.getUint8(o));return r}(n,o+4,4)){var u=n.getUint16(l);if(((r=18761===u)||19789===u)&&42===n.getUint16(l+2,r)){var c=n.getUint32(l+4,r);c>=8&&(i=l+c)}}}if(i){var p,d,h=n.getUint16(i,r);for(d=0;d<h;d+=1)if(p=i+12*d+2,274===n.getUint16(p,r)){p+=8,t=n.getUint16(p,r),n.setUint16(p,1,r);break}}}catch(Mp){t=1}return t}(e),o=0,i=1,a=1;if(r>1){this.url=function(e,t){for(var n=[],r=new Uint8Array(e);r.length>0;)n.push(ce.apply(null,B(r.subarray(0,8192)))),r=r.subarray(8192);return"data:".concat("image/jpeg",";base64,").concat(btoa(n.join("")))}(e);var s=function(e){var t=0,n=1,r=1;switch(e){case 2:n=-1;break;case 3:t=-180;break;case 4:r=-1;break;case 5:t=90,r=-1;break;case 6:t=90;break;case 7:t=90,n=-1;break;case 8:t=-90}return{rotate:t,scaleX:n,scaleY:r}}(r);o=s.rotate,i=s.scaleX,a=s.scaleY}t.rotatable&&(n.rotate=o),t.scalable&&(n.scaleX=i,n.scaleY=a),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,n=e.crossOrigin,r=t;this.options.checkCrossOrigin&&ie(t)&&(n||(n="anonymous"),r=ae(t)),this.crossOrigin=n,this.crossOriginUrl=r;var o=document.createElement("img");n&&(o.crossOrigin=n),o.src=r||t,o.alt=e.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),V(o,f),e.parentNode.insertBefore(o,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var n=l.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(l.navigator.userAgent),r=function(t,n){L(e.imageData,{naturalWidth:t,naturalHeight:n,aspectRatio:t/n}),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||n){var o=document.createElement("img"),i=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){r(o.width,o.height),n||i.removeChild(o)},o.src=t.src,n||(o.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;",i.appendChild(o))}else r(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,n=this.image,r=e.parentNode,o=document.createElement("div");o.innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';var i=o.querySelector(".".concat("cropper","-container")),a=i.querySelector(".".concat("cropper","-canvas")),s=i.querySelector(".".concat("cropper","-drag-box")),l=i.querySelector(".".concat("cropper","-crop-box")),u=l.querySelector(".".concat("cropper","-face"));this.container=r,this.cropper=i,this.canvas=a,this.dragBox=s,this.cropBox=l,this.viewBox=i.querySelector(".".concat("cropper","-view-box")),this.face=u,a.appendChild(n),V(e,h),r.insertBefore(i,e.nextSibling),this.isImg||q(n,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(l,h),t.guides||V(l.getElementsByClassName("".concat("cropper","-dashed")),h),t.center||V(l.getElementsByClassName("".concat("cropper","-center")),h),t.background&&V(i,"".concat("cropper","-bg")),t.highlight||V(u,m),t.cropBoxMovable&&(V(u,g),K(u,y,"all")),t.cropBoxResizable||(V(l.getElementsByClassName("".concat("cropper","-line")),h),V(l.getElementsByClassName("".concat("cropper","-point")),h)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),D(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),q(this.element,h))}},{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(n.prototype,r),o&&t(n,o),e}();return L(be.prototype,de,he,fe,me,ve,ge),be},"object"==typeof Ei.exports?Ei.exports=Si():(Ci=Ci||self).Cropper=Si(),Ei=Ei.exports;var Oi={exports:{}};function Ai(e,t){return(Ai=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};Oi.exports=N}();var Ui,Ni,Ti=(Oi=Oi.exports).h,Ri=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).granularRotateOnChange=function(e){var t=n.state,r=t.rotationAngle,o=t.rotationDelta,i=Number(e.target.value)-o;if(cancelAnimationFrame(n.granularRotateOnInputNextFrame),0!==i){var a=r+i;n.granularRotateOnInputNextFrame=requestAnimationFrame((function(){n.cropper.rotateTo(a)}))}},n.state={rotationAngle:0,rotationDelta:0},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Ai(t,n);var o=r.prototype;return o.componentDidMount=function(){var e=this,t=this.props,n=t.opts,r=t.storeCropperInstance;this.cropper=new Ei(this.imgElement,n.cropperOptions),r(this.cropper),n.actions.granularRotate&&this.imgElement.addEventListener("crop",(function(t){var n=t.detail.rotate;e.setState({rotationAngle:n,rotationDelta:(n+405)%90-45})}))},o.componentWillUnmount=function(){this.cropper.destroy()},o.renderRevert=function(){var e=this;return Ti("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("revert"),"data-microtip-position":"top",role:"tooltip",onClick:function(){e.cropper.reset(),e.cropper.setAspectRatio(0)}},Ti("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},Ti("path",{d:"M0 0h24v24H0z",fill:"none"}),Ti("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))},o.renderRotate=function(){var e=this;return Ti("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:function(){return e.cropper.rotate(-90)},"aria-label":this.props.i18n("rotate"),"data-microtip-position":"top",role:"tooltip"},Ti("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},Ti("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),Ti("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))},o.renderGranularRotate=function(){return Ti("label",{"data-microtip-position":"top",role:"tooltip","aria-label":this.state.rotationAngle+"\xba",className:"uppy-ImageCropper-rangeWrapper uppy-u-reset"},Ti("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.granularRotateOnChange,onChange:this.granularRotateOnChange,value:this.state.rotationDelta,min:"-45",max:"44","aria-label":this.props.i18n("rotate")}))},o.renderFlip=function(){var e=this;return Ti("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("flipHorizontal"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.scaleX(-e.cropper.getData().scaleX||-1)}},Ti("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},Ti("path",{d:"M0 0h24v24H0z",fill:"none"}),Ti("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))},o.renderZoomIn=function(){var e=this;return Ti("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("zoomIn"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.zoom(.1)}},Ti("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},Ti("path",{d:"M0 0h24v24H0V0z",fill:"none"}),Ti("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),Ti("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))},o.renderZoomOut=function(){var e=this;return Ti("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("zoomOut"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.zoom(-.1)}},Ti("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},Ti("path",{d:"M0 0h24v24H0V0z",fill:"none"}),Ti("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))},o.renderCropSquare=function(){var e=this;return Ti("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("aspectRatioSquare"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.setAspectRatio(1)}},Ti("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},Ti("path",{d:"M0 0h24v24H0z",fill:"none"}),Ti("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))},o.renderCropWidescreen=function(){var e=this;return Ti("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("aspectRatioLandscape"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.setAspectRatio(16/9)}},Ti("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},Ti("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),Ti("path",{fill:"none",d:"M0 0h24v24H0z"})))},o.renderCropWidescreenVertical=function(){var e=this;return Ti("button",{type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":this.props.i18n("aspectRatioPortrait"),"data-microtip-position":"top",role:"tooltip",onClick:function(){return e.cropper.setAspectRatio(9/16)}},Ti("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},Ti("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),Ti("path",{d:"M0 0h24v24H0z",fill:"none"})))},o.render=function(){var e=this,t=this.props,n=t.currentImage,r=(t.i18n,t.opts.actions),o=URL.createObjectURL(n.data);return Ti("div",{className:"uppy-ImageCropper"},Ti("div",{className:"uppy-ImageCropper-container"},Ti("img",{className:"uppy-ImageCropper-image",alt:n.name,src:o,ref:function(t){e.imgElement=t}})),Ti("div",{className:"uppy-ImageCropper-controls"},r.revert&&this.renderRevert(),r.rotate&&this.renderRotate(),r.granularRotate&&this.renderGranularRotate(),r.flip&&this.renderFlip(),r.zoomIn&&this.renderZoomIn(),r.zoomOut&&this.renderZoomOut(),r.cropSquare&&this.renderCropSquare(),r.cropWidescreen&&this.renderCropWidescreen(),r.cropWidescreenVertical&&this.renderCropWidescreenVertical()))},r}(Oi.Component);function Fi(){return(Fi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Di(e,t){return(Di=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Mi,Bi,Ii=ue.Plugin,Li=Oi.h,ji=(Ni=Ui=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).save=function(){var e=r.getPluginState().currentImage;r.cropper.getCroppedCanvas().toBlob((function(e){var t=r.getPluginState().currentImage;r.uppy.setFileState(t.id,{data:e,size:e.size,preview:null});var n=r.uppy.getFile(t.id);r.uppy.emit("thumbnail:request",n),r.setPluginState({currentImage:n}),r.uppy.emit("file-editor:complete",n)}),e.type,r.opts.quality)},r.storeCropperInstance=function(e){r.cropper=e},r.selectFile=function(e){r.uppy.emit("file-editor:start",e),r.setPluginState({currentImage:e})},r.id=r.opts.id||"ImageEditor",r.title="Image Editor",r.type="editor",r.defaultLocale={strings:{revert:"Revert",rotate:"Rotate",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontal",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}},r.opts=Fi({},{quality:.8},n,{actions:Fi({},{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},n.actions),cropperOptions:Fi({},{viewMode:1,background:!1,autoCropArea:1,responsive:!0},n.cropperOptions)}),r.i18nInit(),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Di(t,n);var o=r.prototype;return o.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},o.i18nInit=function(){this.translator=new x([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},o.canEditFile=function(e){if(!e.type||e.isRemote)return!1;var t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)},o.install=function(){this.setPluginState({currentImage:null});var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.unmount()},o.render=function(){var e=this.getPluginState().currentImage;if(null!==e&&!e.isRemote)return Li(Ri,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})},r}(Ii),Ui.VERSION="0.4.0",Ni),zi={exports:{}};function Hi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wi(e,t){return(Wi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};zi.exports=N}(),zi=zi.exports;var Vi=ue.Plugin,qi=Qe.Provider,Xi=en.ProviderViews,Gi=zi.h,Yi=(Bi=Mi=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).id=r.opts.id||"Dropbox",qi.initPlugin(Hi(r),n),r.title=r.opts.title||"Dropbox",r.icon=function(){return Gi("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Gi("g",{fill:"none",fillRule:"evenodd"},Gi("rect",{className:"uppy-ProviderIconBg",fill:"#0D2481",width:"32",height:"32",rx:"16"}),Gi("path",{d:"M11 8l5 3.185-5 3.186-5-3.186L11 8zm10 0l5 3.185-5 3.186-5-3.186L21 8zM6 17.556l5-3.185 5 3.185-5 3.186-5-3.186zm15-3.185l5 3.185-5 3.186-5-3.186 5-3.185zm-10 7.432l5-3.185 5 3.185-5 3.186-5-3.186z",fill:"#FFF",fillRule:"nonzero"})))},r.provider=new qi(t,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,companionKeysParams:r.opts.companionKeysParams,companionCookiesRule:r.opts.companionCookiesRule,provider:"dropbox",pluginId:r.id}),r.onFirstRender=r.onFirstRender.bind(Hi(r)),r.render=r.render.bind(Hi(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Wi(t,n);var o=r.prototype;return o.install=function(){this.view=new Xi(this,{provider:this.provider});var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.view.tearDown(),this.unmount()},o.onFirstRender=function(){return Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder()])},o.render=function(e){return this.view.render(e)},r}(Vi),Mi.VERSION="1.5.2",Bi);function $i(e,t){return($i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ki,Ji,Qi=function(e){var t,n;function r(){return e.apply(this,arguments)||this}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,$i(t,n),r.prototype.toggleCheckbox=function(t,n){t.stopPropagation(),t.preventDefault(),n.custom.isTeamDrive||n.custom.isSharedDrive||e.prototype.toggleCheckbox.call(this,t,n)},r}(en.ProviderViews),Zi={exports:{}};function ea(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ta(e,t){return(ta=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};Zi.exports=N}(),Zi=Zi.exports;var na,ra,oa=ue.Plugin,ia=Qe.Provider,aa=Zi.h,sa=(Ji=Ki=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).id=r.opts.id||"GoogleDrive",r.title=r.opts.title||"Google Drive",ia.initPlugin(ea(r),n),r.title=r.opts.title||"Google Drive",r.icon=function(){return aa("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},aa("g",{fill:"none",fillRule:"evenodd"},aa("rect",{className:"uppy-ProviderIconBg",fill:"#4285F4",width:"32",height:"32",rx:"16"}),aa("path",{d:"M10.324 23.3l3-5.1H25l-3 5.1H10.324zM13 18.2l-3 5.1-3-5.1 5.839-9.924 2.999 5.1L13 18.2zm11.838-.276h-6L13 8h6l5.84 9.924h-.002z",fill:"#FFF"})))},r.provider=new ia(t,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,companionKeysParams:r.opts.companionKeysParams,companionCookiesRule:r.opts.companionCookiesRule,provider:"drive",pluginId:r.id}),r.onFirstRender=r.onFirstRender.bind(ea(r)),r.render=r.render.bind(ea(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,ta(t,n);var o=r.prototype;return o.install=function(){this.view=new Qi(this,{provider:this.provider});var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.view.tearDown(),this.unmount()},o.onFirstRender=function(){return Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder("root","/")])},o.render=function(e){return this.view.render(e)},r}(oa),Ki.VERSION="1.7.2",Ji),la={exports:{}};function ua(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ca(e,t){return(ca=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};la.exports=N}(),la=la.exports;var pa,da,ha=ue.Plugin,fa=Qe.Provider,ma=en.ProviderViews,va=la.h,ga=(ra=na=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).id=r.opts.id||"Instagram",fa.initPlugin(ua(r),n),r.title=r.opts.title||"Instagram",r.icon=function(){return va("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},va("g",{fill:"none",fillRule:"evenodd"},va("rect",{className:"uppy-ProviderIconBg",fill:"#E1306C",width:"32",height:"32",rx:"16"}),va("path",{d:"M16 8.622c2.403 0 2.688.009 3.637.052.877.04 1.354.187 1.67.31.392.144.745.374 1.036.673.299.29.529.644.673 1.035.123.317.27.794.31 1.671.043.95.052 1.234.052 3.637s-.009 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.671a2.98 2.98 0 0 1-1.708 1.708c-.317.123-.794.27-1.671.31-.95.043-1.234.053-3.637.053s-2.688-.01-3.637-.053c-.877-.04-1.354-.187-1.671-.31a2.788 2.788 0 0 1-1.035-.673 2.788 2.788 0 0 1-.673-1.035c-.123-.317-.27-.794-.31-1.671-.043-.949-.052-1.234-.052-3.637s.009-2.688.052-3.637c.04-.877.187-1.354.31-1.67.144-.392.374-.745.673-1.036.29-.299.644-.529 1.035-.673.317-.123.794-.27 1.671-.31.95-.043 1.234-.052 3.637-.052zM16 7c-2.444 0-2.75.01-3.71.054-.959.044-1.613.196-2.185.419-.6.225-1.145.58-1.594 1.038-.458.45-.813.993-1.039 1.594-.222.572-.374 1.226-.418 2.184C7.01 13.25 7 13.556 7 16s.01 2.75.054 3.71c.044.959.196 1.613.419 2.185.226.6.58 1.145 1.038 1.594.45.458.993.813 1.594 1.038.572.223 1.227.375 2.184.419.96.044 1.267.054 3.711.054s2.75-.01 3.71-.054c.959-.044 1.613-.196 2.185-.419a4.602 4.602 0 0 0 2.632-2.632c.223-.572.375-1.226.419-2.184.044-.96.054-1.267.054-3.711s-.01-2.75-.054-3.71c-.044-.959-.196-1.613-.419-2.185A4.412 4.412 0 0 0 23.49 8.51a4.412 4.412 0 0 0-1.594-1.039c-.572-.222-1.226-.374-2.184-.418C18.75 7.01 18.444 7 16 7zm0 4.5a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9zm0 7.421a2.921 2.921 0 1 1 0-5.842 2.921 2.921 0 0 1 0 5.842zm4.875-6.671a1.125 1.125 0 1 1 0-2.25 1.125 1.125 0 0 1 0 2.25z",fill:"#FFF"})))},r.provider=new fa(t,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,companionKeysParams:r.opts.companionKeysParams,companionCookiesRule:r.opts.companionCookiesRule,provider:"instagram",pluginId:r.id}),r.onFirstRender=r.onFirstRender.bind(ua(r)),r.render=r.render.bind(ua(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,ca(t,n);var o=r.prototype;return o.install=function(){this.view=new ma(this,{provider:this.provider,viewType:"grid",showTitles:!1,showFilter:!1,showBreadcrumbs:!1});var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.view.tearDown(),this.unmount()},o.onFirstRender=function(){return Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder("recent")])},o.render=function(e){return this.view.render(e)},r}(ha),na.VERSION="1.5.2",ra),ya={exports:{}};function ba(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _a(e,t){return(_a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};ya.exports=N}(),ya=ya.exports;var wa,Ca,Sa=ue.Plugin,ka=Qe.Provider,xa=en.ProviderViews,Pa=ya.h,Ea=(da=pa=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).id=r.opts.id||"OneDrive",ka.initPlugin(ba(r),n),r.title=r.opts.title||"OneDrive",r.icon=function(){return Pa("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Pa("g",{fill:"none",fillRule:"evenodd"},Pa("rect",{className:"uppy-ProviderIconBg",width:"32",height:"32",rx:"16",fill:"#0262C0"}),Pa("g",{fill:"#FFF",fillRule:"nonzero"},Pa("path",{d:"M24.157 22s1.492-.205 1.79-1.655a2.624 2.624 0 0 0 .03-.878c-.22-1.64-1.988-2.01-1.988-2.01s.307-1.765-1.312-2.69c-1.62-.925-3.1 0-3.1 0S18.711 13 16.366 13c-3.016 0-3.519 3.448-3.519 3.448S10 16.618 10 19.14c0 2.523 2.597 2.86 2.597 2.86h11.56z"}),Pa("path",{d:"M9.421 19.246c0-2.197 1.606-3.159 2.871-3.472.44-1.477 1.654-3.439 4.135-3.439H16.445c1.721 0 2.79.823 3.368 1.476a3.99 3.99 0 0 1 1.147-.171h.01l.03.002C21.017 13.5 20.691 10 16.757 10c-2.69 0-3.639 2.345-3.639 2.345s-1.95-1.482-3.955.567c-1.028 1.052-.79 2.669-.79 2.669S6 15.824 6 18.412C6 20.757 8.452 21 8.452 21h1.372a3.77 3.77 0 0 1-.403-1.754z"}))))},r.provider=new ka(t,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,companionCookiesRule:r.opts.companionCookiesRule,provider:"onedrive",pluginId:r.id}),r.onFirstRender=r.onFirstRender.bind(ba(r)),r.render=r.render.bind(ba(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,_a(t,n);var o=r.prototype;return o.install=function(){this.view=new xa(this,{provider:this.provider});var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.view.tearDown(),this.unmount()},o.onFirstRender=function(){return Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder()])},o.render=function(e){return this.view.render(e)},r}(Sa),pa.VERSION="1.2.2",da),Oa={exports:{}};function Aa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ua(e,t){return(Ua=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};Oa.exports=N}(),Oa=Oa.exports;var Na,Ta,Ra=ue.Plugin,Fa=Qe.Provider,Da=en.ProviderViews,Ma=Oa.h,Ba=(Ca=wa=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).id=r.opts.id||"Box",Fa.initPlugin(Aa(r),n),r.title=r.opts.title||"Box",r.icon=function(){return Ma("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Ma("g",{fill:"none",fillRule:"evenodd"},Ma("rect",{className:"uppy-ProviderIconBg",fill:"#0061D5",width:"32",height:"32",rx:"16"}),Ma("g",{fill:"#fff",fillRule:"nonzero"},Ma("path",{d:"m16.4 13.5c-1.6 0-3 0.9-3.7 2.2-0.7-1.3-2.1-2.2-3.7-2.2-1 0-1.8 0.3-2.5 0.8v-3.6c-0.1-0.3-0.5-0.7-1-0.7s-0.8 0.4-0.8 0.8v7c0 2.3 1.9 4.2 4.2 4.2 1.6 0 3-0.9 3.7-2.2 0.7 1.3 2.1 2.2 3.7 2.2 2.3 0 4.2-1.9 4.2-4.2 0.1-2.4-1.8-4.3-4.1-4.3m-7.5 6.8c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5m7.5 0c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5"}),Ma("path",{d:"m27.2 20.6l-2.3-2.8 2.3-2.8c0.3-0.4 0.2-0.9-0.2-1.2s-1-0.2-1.3 0.2l-2 2.4-2-2.4c-0.3-0.4-0.9-0.4-1.3-0.2-0.4 0.3-0.5 0.8-0.2 1.2l2.3 2.8-2.3 2.8c-0.3 0.4-0.2 0.9 0.2 1.2s1 0.2 1.3-0.2l2-2.4 2 2.4c0.3 0.4 0.9 0.4 1.3 0.2 0.4-0.3 0.4-0.8 0.2-1.2"}))))},r.provider=new Fa(t,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,companionKeysParams:r.opts.companionKeysParams,companionCookiesRule:r.opts.companionCookiesRule,provider:"box",pluginId:r.id}),r.onFirstRender=r.onFirstRender.bind(Aa(r)),r.render=r.render.bind(Aa(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Ua(t,n);var o=r.prototype;return o.install=function(){this.view=new Da(this,{provider:this.provider});var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.view.tearDown(),this.unmount()},o.onFirstRender=function(){return this.view.getFolder()},o.render=function(e){return this.view.render(e)},r}(Ra),wa.VERSION="0.3.12",Ca),Ia={exports:{}};function La(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ja(e,t){return(ja=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};Ia.exports=N}(),Ia=Ia.exports;var za,Ha,Wa=ue.Plugin,Va=Qe.Provider,qa=en.ProviderViews,Xa=Ia.h,Ga=(Ta=Na=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).id=r.opts.id||"Facebook",Va.initPlugin(La(r),n),r.title=r.opts.title||"Facebook",r.icon=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",width:"32",height:"32",rx:"16",fill:"#3C5A99"}),Xa("path",{d:"M17.842 26v-8.667h2.653l.398-3.377h-3.051v-2.157c0-.978.248-1.644 1.527-1.644H21V7.132A19.914 19.914 0 0 0 18.623 7c-2.352 0-3.963 1.574-3.963 4.465v2.49H12v3.378h2.66V26h3.182z",fill:"#FFF",fillRule:"nonzero"})))},r.provider=new Va(t,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,companionKeysParams:r.opts.companionKeysParams,companionCookiesRule:r.opts.companionCookiesRule,provider:"facebook",pluginId:r.id}),r.onFirstRender=r.onFirstRender.bind(La(r)),r.render=r.render.bind(La(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,ja(t,n);var o=r.prototype;return o.install=function(){this.view=new qa(this,{provider:this.provider});var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.view.tearDown(),this.unmount()},o.onFirstRender=function(){return Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder()])},o.render=function(e){var t={};return this.getPluginState().files.length&&!this.getPluginState().folders.length&&(t.viewType="grid",t.showFilter=!1,t.showTitles=!1),this.view.render(e,t)},r}(Wa),Na.VERSION="1.2.2",Ta),Ya={exports:{}};function $a(){return($a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ka(e,t){return(Ka=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};Ya.exports=N}(),Ya=Ya.exports;var Ja=ue.Plugin,Qa=Ya.h,Za=Qe.SearchProvider,es=en.SearchProviderViews,ts=(Ha=za=function(e){var t,n;function r(t,n){var r;if((r=e.call(this,t,n)||this).id=r.opts.id||"Unsplash",r.title=r.opts.title||"Unsplash",r.type="acquirer",r.icon=function(){return Qa("svg",{viewBox:"0 0 32 32",height:"32",width:"32","aria-hidden":"true"},Qa("path",{d:"M46.575 10.883v-9h12v9zm12 5h10v18h-32v-18h10v9h12z",fill:"#fff"}),Qa("rect",{className:"uppy-ProviderIconBg",width:"32",height:"32",rx:"16"}),Qa("path",{d:"M13 12.5V8h6v4.5zm6 2.5h5v9H8v-9h5v4.5h6z",fill:"#fff"}))},r.opts=$a({},{},n),r.hostname=r.opts.companionUrl,!r.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");return r.provider=new Za(t,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders,companionCookiesRule:r.opts.companionCookiesRule,provider:"unsplash",pluginId:r.id}),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Ka(t,n);var o=r.prototype;return o.install=function(){this.view=new es(this,{provider:this.provider});var e=this.opts.target;e&&this.mount(e,this)},o.onFirstRender=function(){},o.render=function(e){return this.view.render(e)},o.uninstall=function(){this.unmount()},r}(Ja),za.VERSION="0.1.13",Ha),ns={exports:{}};function rs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function os(e,t){return(os=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};ns.exports=N}();var is,as,ss=(ns=ns.exports).h,ls=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).handleKeyPress=n.handleKeyPress.bind(rs(n)),n.handleClick=n.handleClick.bind(rs(n)),n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,os(t,n);var o=r.prototype;return o.componentDidMount=function(){this.input.value=""},o.handleKeyPress=function(e){13===e.keyCode&&this.props.addFile(this.input.value)},o.handleClick=function(){this.props.addFile(this.input.value)},o.render=function(){var e=this;return ss("div",{className:"uppy-Url"},ss("input",{className:"uppy-u-reset uppy-c-textInput uppy-Url-input",type:"text","aria-label":this.props.i18n("enterUrlToImport"),placeholder:this.props.i18n("enterUrlToImport"),onKeyUp:this.handleKeyPress,ref:function(t){e.input=t},"data-uppy-super-focusable":!0}),ss("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Url-importButton",type:"button",onClick:this.handleClick},this.props.i18n("import")))},r}(ns.Component),us=function(e,t,n){var r,o=So(e.items);switch(t){case"paste":if(o.some((function(e){return"file"===e.kind})))return;r=o.filter((function(e){return"string"===e.kind&&"text/plain"===e.type}));break;case"drop":r=o.filter((function(e){return"string"===e.kind&&"text/uri-list"===e.type}));break;default:throw new Error("isDropOrPaste must be either 'drop' or 'paste', but it's "+t)}r.forEach((function(e){e.getAsString((function(e){return n(e)}))}))};function cs(){return(cs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ps(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ds(e,t){return(ds=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var hs=ue.Plugin,fs=ns.h,ms=Qe.RequestClient;function vs(){return fs("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},fs("g",{fill:"none",fillRule:"evenodd"},fs("rect",{className:"uppy-ProviderIconBg",fill:"#FF753E",width:"32",height:"32",rx:"16"}),fs("path",{d:"M22.788 15.389l-2.199 2.19a3.184 3.184 0 0 1-.513.437c-.806.584-1.686.876-2.638.876a4.378 4.378 0 0 1-3.519-1.752c-.22-.292-.146-.802.147-1.021.293-.22.806-.146 1.026.146.953 1.313 2.785 1.532 4.105.583a.571.571 0 0 0 .293-.292l2.199-2.189c1.1-1.167 1.1-2.992-.073-4.086a2.976 2.976 0 0 0-4.105 0l-1.246 1.24a.71.71 0 0 1-1.026 0 .703.703 0 0 1 0-1.022l1.246-1.24a4.305 4.305 0 0 1 6.083 0c1.833 1.605 1.906 4.451.22 6.13zm-7.183 5.035l-1.246 1.24a2.976 2.976 0 0 1-4.105 0c-1.172-1.094-1.172-2.991-.073-4.086l2.2-2.19.292-.291c.66-.438 1.393-.657 2.2-.584.805.146 1.465.51 1.905 1.168.22.292.733.365 1.026.146.293-.22.367-.73.147-1.022-.733-.949-1.76-1.532-2.859-1.678-1.1-.22-2.272.073-3.225.802l-.44.438-2.199 2.19c-1.686 1.75-1.612 4.524.074 6.202.88.803 1.979 1.241 3.078 1.241 1.1 0 2.199-.438 3.079-1.24l1.246-1.241a.703.703 0 0 0 0-1.022c-.294-.292-.807-.365-1.1-.073z",fill:"#FFF",fillRule:"nonzero"})))}var gs=(as=is=function(e){var t,n;function r(t,n){var r;if((r=e.call(this,t,n)||this).id=r.opts.id||"Url",r.title=r.opts.title||"Link",r.type="acquirer",r.icon=function(){return fs(vs,null)},r.defaultLocale={strings:{import:"Import",enterUrlToImport:"Enter URL to import a file",failedToFetch:"Companion failed to fetch this URL, please make sure it\u2019s correct",enterCorrectUrl:"Incorrect URL: Please make sure you are entering a direct link to a file"}},r.opts=cs({},{},n),r.i18nInit(),r.hostname=r.opts.companionUrl,!r.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");return r.getMeta=r.getMeta.bind(ps(r)),r.addFile=r.addFile.bind(ps(r)),r.handleRootDrop=r.handleRootDrop.bind(ps(r)),r.handleRootPaste=r.handleRootPaste.bind(ps(r)),r.client=new ms(t,{companionUrl:r.opts.companionUrl,companionHeaders:r.opts.companionHeaders||r.opts.serverHeaders,companionCookiesRule:r.opts.companionCookiesRule}),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,ds(t,n);var o=r.prototype;return o.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},o.i18nInit=function(){this.translator=new x([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},o.getFileNameFromUrl=function(e){return e.substring(e.lastIndexOf("/")+1)},o.checkIfCorrectURL=function(e){if(!e)return!1;var t=e.match(/^([a-z0-9]+):\/\//)[1];return"http"===t||"https"===t},o.addProtocolToURL=function(e){return/^[a-z0-9]+:\/\//.test(e)?e:"http://"+e},o.getMeta=function(e){var t=this;return this.client.post("url/meta",{url:e}).then((function(e){if(e.error)throw t.uppy.log("[URL] Error:"),t.uppy.log(e.error),new Error("Failed to fetch the file");return e}))},o.addFile=function(e){var t=this;return e=this.addProtocolToURL(e),this.checkIfCorrectURL(e)?this.getMeta(e).then((function(n){return{source:t.id,name:t.getFileNameFromUrl(e),type:n.type,data:{size:n.size},isRemote:!0,body:{url:e},remote:{companionUrl:t.opts.companionUrl,url:t.hostname+"/url/get",body:{fileId:e,url:e},providerOptions:t.client.opts}}})).then((function(e){t.uppy.log("[Url] Adding remote file");try{return t.uppy.addFile(e)}catch(Cd){return Cd.isRestriction||t.uppy.log(Cd),Cd}})).catch((function(e){return t.uppy.log(e),t.uppy.info({message:t.i18n("failedToFetch"),details:e},"error",4e3),e})):(this.uppy.log("[URL] Incorrect URL entered: "+e),void this.uppy.info(this.i18n("enterCorrectUrl"),"error",4e3))},o.handleRootDrop=function(e){var t=this;us(e.dataTransfer,"drop",(function(e){t.uppy.log("[URL] Adding file from dropped url: "+e),t.addFile(e)}))},o.handleRootPaste=function(e){var t=this;us(e.clipboardData,"paste",(function(e){t.uppy.log("[URL] Adding file from pasted url: "+e),t.addFile(e)}))},o.render=function(e){return fs(ls,{i18n:this.i18n,addFile:this.addFile})},o.install=function(){var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.unmount()},r}(hs),is.VERSION="1.5.23",as),ys={exports:{}};!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};ys.exports=N}(),ys=ys.exports;var bs={"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"},_s=function(e){return e=e.replace(/;.*$/,""),bs[e]||null},ws=ys.h,Cs=function(e){return ws("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},ws("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z",fillRule:"evenodd"}))},Ss=ys.h,ks=function(e){var t=e.onSnapshot,n=e.i18n;return Ss("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:n("takePicture"),"aria-label":n("takePicture"),onClick:t,"data-uppy-super-focusable":!0},Cs())},xs=ys.h,Ps=function(e){var t=e.recording,n=e.onStartRecording,r=e.onStopRecording,o=e.i18n;return t?xs("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:o("stopRecording"),"aria-label":o("stopRecording"),onClick:r,"data-uppy-super-focusable":!0},xs("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},xs("rect",{x:"15",y:"15",width:"70",height:"70"}))):xs("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:o("startRecording"),"aria-label":o("startRecording"),onClick:n,"data-uppy-super-focusable":!0},xs("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},xs("circle",{cx:"50",cy:"50",r:"40"})))},Es=ys.h,Os=function(e){var t,n=e.recordingLengthSeconds,r=e.i18n,o=(t=n,Math.floor(t/60)+":"+String(t%60).padStart(2,0));return Es("span",{"aria-label":r("recordingLength",{recording_length:o})},o)},As=ys.h,Us=ys.h,Ns=function(e){var t=e.onSubmit,n=e.i18n;return Us("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:n("submitRecordedFile"),"aria-label":n("submitRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},Us("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"},Us("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))},Ts=ys.h,Rs=function(e){var t=e.onDiscard,n=e.i18n;return Ts("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:n("discardRecordedFile"),"aria-label":n("discardRecordedFile"),onClick:t,"data-uppy-super-focusable":!0},Ts("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon"},Ts("g",{fill:"#FFF",fillRule:"evenodd"},Ts("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),Ts("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))};function Fs(){return(Fs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ds(e,t){return(Ds=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ms=ys.h;function Bs(e,t){return-1!==e.indexOf(t)}var Is,Ls,js=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Ds(t,n);var o=r.prototype;return o.componentDidMount=function(){(0,this.props.onFocus)()},o.componentWillUnmount=function(){(0,this.props.onStop)()},o.render=function(){var e=this,t=this.props,n=t.src,r=t.recordedVideo,o=t.recording,i=t.modes,a=t.supportsRecording,s=t.videoSources,l=t.showVideoSourceDropdown,u=t.showRecordingLength,c=t.onSubmit,p=t.i18n,d=t.mirror,h=t.onSnapshot,f=t.onStartRecording,m=t.onStopRecording,v=t.onDiscardRecordedVideo,g=t.recordingLengthSeconds,y=!!r,b=!y&&a&&(Bs(i,"video-only")||Bs(i,"audio-only")||Bs(i,"video-audio")),_=!y&&Bs(i,"picture"),w=a&&u,C=l&&s&&s.length>1,S={playsinline:!0};return r?(S.muted=!1,S.controls=!0,S.src=r,this.videoElement&&(this.videoElement.srcObject=void 0)):(S.muted=!0,S.autoplay=!0,S.srcObject=n),Ms("div",{className:"uppy uppy-Webcam-container"},Ms("div",{className:"uppy-Webcam-videoContainer"},Ms("video",Fs({ref:function(t){return e.videoElement=t},className:"uppy-Webcam-video "+(d?"uppy-Webcam-video--mirrored":"")},S))),Ms("div",{className:"uppy-Webcam-footer"},Ms("div",{className:"uppy-Webcam-videoSourceContainer"},C?function(e){var t=e.currentDeviceId,n=e.videoSources,r=e.onChangeVideoSource;return As("div",{className:"uppy-Webcam-videoSource"},As("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:function(e){r(e.target.value)}},n.map((function(e){return As("option",{key:e.deviceId,value:e.deviceId,selected:e.deviceId===t},e.label)}))))}(this.props):null),Ms("div",{className:"uppy-Webcam-buttonContainer"},_&&Ms(ks,{onSnapshot:h,i18n:p}),b&&Ms(Ps,{recording:o,onStartRecording:f,onStopRecording:m,i18n:p}),y&&Ms(Ns,{onSubmit:c,i18n:p}),y&&Ms(Rs,{onDiscard:v,i18n:p})),w&&Ms("div",{className:"uppy-Webcam-recordingLength"},Ms(Os,{recordingLengthSeconds:g,i18n:p}))))},r}(ys.Component),zs=ys.h,Hs=function(e){return zs("div",{className:"uppy-Webcam-permissons"},zs("div",{className:"uppy-Webcam-permissonsIcon"},e.icon()),zs("h1",{className:"uppy-Webcam-title"},e.hasCamera?e.i18n("allowAccessTitle"):e.i18n("noCameraTitle")),zs("p",null,e.hasCamera?e.i18n("allowAccessDescription"):e.i18n("noCameraDescription")))};function Ws(){return(Ws=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Vs(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qs(e,t){return(qs=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Xs=ys.h;function Gs(e){return"."===e[0]?K[e.slice(1)]:e}function Ys(e){return/^video\/[^*]+$/.test(e)}function $s(e){return/^image\/[^*]+$/.test(e)}var Ks=(Ls=Is=function(e){var t,n;function r(t,n){var r;(r=e.call(this,t,n)||this).mediaDevices=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise((function(n,r){e.call(navigator,t,n,r)}))}}:null}(),r.supportsUserMedia=!!r.mediaDevices,r.protocol=location.protocol.match(/https/i)?"https":"http",r.id=r.opts.id||"Webcam",r.title=r.opts.title||"Camera",r.type="acquirer",r.capturedMediaFile=null,r.icon=function(){return Xs("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Xs("g",{fill:"none",fillRule:"evenodd"},Xs("rect",{className:"uppy-ProviderIconBg",fill:"#03BFEF",width:"32",height:"32",rx:"16"}),Xs("path",{d:"M22 11c1.133 0 2 .867 2 2v7.333c0 1.134-.867 2-2 2H10c-1.133 0-2-.866-2-2V13c0-1.133.867-2 2-2h2.333l1.134-1.733C13.6 9.133 13.8 9 14 9h4c.2 0 .4.133.533.267L19.667 11H22zm-6 1.533a3.764 3.764 0 0 0-3.8 3.8c0 2.129 1.672 3.801 3.8 3.801s3.8-1.672 3.8-3.8c0-2.13-1.672-3.801-3.8-3.801zm0 6.261c-1.395 0-2.46-1.066-2.46-2.46 0-1.395 1.065-2.461 2.46-2.461s2.46 1.066 2.46 2.46c0 1.395-1.065 2.461-2.46 2.461z",fill:"#FFF",fillRule:"nonzero"})))},r.defaultLocale={strings:{smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site.",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",recordingLength:"Recording length %{recording_length}",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file"}};var o={onBeforeSnapshot:function(){return Promise.resolve()},countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,facingMode:"user",preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1};return r.opts=Ws({},o,n),r.i18nInit(),r.install=r.install.bind(Vs(r)),r.setPluginState=r.setPluginState.bind(Vs(r)),r.render=r.render.bind(Vs(r)),r.start=r.start.bind(Vs(r)),r.stop=r.stop.bind(Vs(r)),r.takeSnapshot=r.takeSnapshot.bind(Vs(r)),r.startRecording=r.startRecording.bind(Vs(r)),r.stopRecording=r.stopRecording.bind(Vs(r)),r.discardRecordedVideo=r.discardRecordedVideo.bind(Vs(r)),r.submit=r.submit.bind(Vs(r)),r.oneTwoThreeSmile=r.oneTwoThreeSmile.bind(Vs(r)),r.focus=r.focus.bind(Vs(r)),r.changeVideoSource=r.changeVideoSource.bind(Vs(r)),r.webcamActive=!1,r.opts.countdown&&(r.opts.onBeforeSnapshot=r.oneTwoThreeSmile),r.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null}),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,qs(t,n);var o=r.prototype;return o.setOptions=function(t){e.prototype.setOptions.call(this,Ws({},t,{videoConstraints:Ws({},this.opts.videoConstraints,null==t?void 0:t.videoConstraints)})),this.i18nInit()},o.i18nInit=function(){this.translator=new x([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},o.hasCameraCheck=function(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then((function(e){return e.some((function(e){return"videoinput"===e.kind}))})):Promise.resolve(!1)},o.isAudioOnly=function(){return 1===this.opts.modes.length&&"audio-only"===this.opts.modes[0]},o.getConstraints=function(e){var t;void 0===e&&(e=null);var n=-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("audio-only"),r=!this.isAudioOnly()&&(-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("video-only")||-1!==this.opts.modes.indexOf("picture")),o=Ws({},null!=(t=this.opts.videoConstraints)?t:{facingMode:this.opts.facingMode},e?{deviceId:e,facingMode:null}:{});return{audio:n,video:!!r&&o}},o.start=function(e){var t=this;if(void 0===e&&(e=null),!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror=!0;var n=this.getConstraints(e&&e.deviceId?e.deviceId:null);this.hasCameraCheck().then((function(r){return t.setPluginState({hasCamera:r}),t.mediaDevices.getUserMedia(n).then((function(n){t.stream=n;var r=null,o=t.isAudioOnly()?n.getAudioTracks():n.getVideoTracks();e&&e.deviceId?o.forEach((function(t){t.getSettings().deviceId===e.deviceId&&(r=t.getSettings().deviceId)})):r=o[0].getSettings().deviceId,t.updateVideoSources(),t.setPluginState({currentDeviceId:r,cameraReady:!0})})).catch((function(e){t.setPluginState({cameraReady:!1,cameraError:e}),t.uppy.info(e.message,"error")}))}))},o.getMediaRecorderOptions=function(){var e={};if(MediaRecorder.isTypeSupported){var t=this.uppy.opts.restrictions,n=[];this.opts.preferredVideoMimeType?n=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(n=t.allowedFileTypes.map(Gs).filter(Ys));var r=n.filter((function(e){return MediaRecorder.isTypeSupported(e)&&_s(e)}));r.length>0&&(e.mimeType=r[0])}return e},o.startRecording=function(){var e=this;this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];var t=!1;this.recorder.addEventListener("dataavailable",(function(n){e.recordingChunks.push(n.data);var r=e.uppy.opts.restrictions;if(e.recordingChunks.length>1&&null!=r.maxFileSize&&!t){var o=e.recordingChunks.reduce((function(e,t){return e+t.size}),0),i=(o-e.recordingChunks[0].size)/(e.recordingChunks.length-1)*3;o>Math.max(0,r.maxFileSize-i)&&(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})},o.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(Cd){Cd.isRestriction||e.uppy.log(Cd)}})).then((function(){e.recordingChunks=null,e.recorder=null}),(function(t){throw e.recordingChunks=null,e.recorder=null,t}))},o.discardRecordedVideo=function(){this.setPluginState({recordedVideo:null}),this.opts.mirror=!0,this.capturedMediaFile=null},o.submit=function(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(Cd){Cd.isRestriction||this.uppy.log(Cd,"error")}},o.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})},o.getVideoElement=function(){return this.el.querySelector(".uppy-Webcam-video")},o.oneTwoThreeSmile=function(){var e=this;return new Promise((function(t,n){var r=e.opts.countdown,o=setInterval((function(){if(!e.webcamActive)return clearInterval(o),e.captureInProgress=!1,n(new Error("Webcam is not active"));r>0?(e.uppy.info(r+"...","warning",800),r--):(clearInterval(o),e.uppy.info(e.i18n("smile"),"success",1500),setTimeout((function(){return t()}),1500))}),1e3)}))},o.takeSnapshot=function(){var e=this;this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch((function(t){var n="object"==typeof t?t.message:t;return e.uppy.info(n,"error",5e3),Promise.reject(new Error("onBeforeSnapshot: "+n))})).then((function(){return e.getImage()})).then((function(t){e.captureInProgress=!1;try{e.uppy.addFile(t)}catch(Cd){Cd.isRestriction||e.uppy.log(Cd)}}),(function(t){throw e.captureInProgress=!1,t})))},o.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 n=t.videoWidth,r=t.videoHeight,o=document.createElement("canvas");o.width=n,o.height=r,o.getContext("2d").drawImage(t,0,0);var i=this.uppy.opts.restrictions,a=[];this.opts.preferredImageMimeType?a=[this.opts.preferredImageMimeType]:i.allowedFileTypes&&(a=i.allowedFileTypes.map(Gs).filter($s));var s=a[0]||"image/jpeg",l=_s(s)||"jpg",u="cam-"+Date.now()+"."+l;return function(e,t,n){return e.toBlob?new Promise((function(r){e.toBlob(r,t,n)})):Promise.resolve().then((function(){return no(e.toDataURL(t,n),{})}))}(o,s).then((function(t){return{source:e.id,name:u,data:new Blob([t],{type:s}),type:s}}))},o.getVideo=function(){var e=this.recordingChunks.find((function(e){var t;return(null==(t=e.type)?void 0:t.length)>0})).type,t=_s(e);if(!t)return Promise.reject(new Error('Could not retrieve recording: Unsupported media type "'+e+'"'));var n="webcam-"+Date.now()+"."+t,r=new Blob(this.recordingChunks,{type:e}),o={source:this.id,name:n,data:new Blob([r],{type:e}),type:e};return Promise.resolve(o)},o.focus=function(){var e=this;this.opts.countdown&&setTimeout((function(){e.uppy.info(e.i18n("smile"),"success",1500)}),1e3)},o.changeVideoSource=function(e){this.stop(),this.start({deviceId:e})},o.updateVideoSources=function(){var e=this;this.mediaDevices.enumerateDevices().then((function(t){e.setPluginState({videoSources:t.filter((function(e){return"videoinput"===e.kind}))})}))},o.render=function(){this.webcamActive||this.start();var e=this.getPluginState();return e.cameraReady&&e.hasCamera?Xs(js,Ws({},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})):Xs(Hs,{icon:Cs,i18n:this.i18n,hasCamera:e.hasCamera})},o.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,n=e.getPluginState(),r=n.videoSources,o=n.currentDeviceId;r.forEach((function(e){o===e.deviceId&&(t=!1)})),t&&(e.stop(),e.start())}})},o.uninstall=function(){this.stream&&this.stop(),this.unmount()},r}(ue.Plugin),Is.VERSION="1.8.13",Ls),Js={exports:{}};!function(){"use strict";function e(){}function t(t,n){var r,o,i,a,s=C;for(a=arguments.length;a-- >2;)w.push(arguments[a]);for(n&&null!=n.children&&(w.length||w.push(n.children),delete n.children);w.length;)if((o=w.pop())&&void 0!==o.pop)for(a=o.length;a--;)w.push(o[a]);else"boolean"==typeof o&&(o=null),(i="function"!=typeof t)&&(null==o?o="":"number"==typeof o?o=String(o):"string"!=typeof o&&(i=!1)),i&&r?s[s.length-1]+=o:s===C?s=[o]:s.push(o),r=i;var l=new e;return l.nodeName=t,l.children=s,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==_.vnode&&_.vnode(l),l}function n(e,t){for(var n in t)e[n]=t[n];return e}function r(e){!e.__d&&(e.__d=!0)&&1==x.push(e)&&(_.debounceRendering||S)(o)}function o(){var e,t=x;for(x=[];e=t.pop();)e.__d&&g(e)}function i(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function a(e){var t=n({},e.attributes);t.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===t[o]&&(t[o]=r[o]);return t}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function l(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===k.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,u,a):e.removeEventListener(t,u,a),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e)!function(e,t,n){try{e[t]=n}catch(r){}}(e,t,null==r?"":r),null!=r&&!1!==r||e.removeAttribute(t);else{var s=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function u(e){return this.__l[e.type](_.event&&_.event(e)||e)}function c(){for(var e;e=P.pop();)_.afterMount&&_.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,o,u){E++||(O=null!=o&&void 0!==o.ownerSVGElement,A=null!=e&&!("__preactattr_"in e));var p=function e(t,n,r,o,u){var c=t,p=O;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(c=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0))),c.__preactattr_=!0,c;var h,m,g=n.nodeName;if("function"==typeof g)return function(e,t,n,r){for(var o=e&&e._component,i=o,s=e,l=o&&e._componentConstructor===t.nodeName,u=l,c=a(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(v(o,c,3,n,r),e=o.base):(i&&!l&&(y(i),e=s=null),o=f(t.nodeName,c,n),e&&!o.__b&&(o.__b=e,s=null),v(o,c,1,n,r),e=o.base,s&&e!==s&&(s._component=null,d(s,!1))),e}(t,n,r,o);if(O="svg"===g||"foreignObject"!==g&&O,g=String(g),(!t||!i(t,g))&&(h=g,(m=O?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h)).__n=h,c=m,t)){for(;t.firstChild;)c.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(c,t),d(t,!0)}var b=c.firstChild,_=c.__preactattr_,w=n.children;if(null==_){_=c.__preactattr_={};for(var C=c.attributes,S=C.length;S--;)_[C[S].name]=C[S].value}return!A&&w&&1===w.length&&"string"==typeof w[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=w[0]&&(b.nodeValue=w[0]):(w&&w.length||null!=b)&&function(t,n,r,o,a){var l,u,c,p,h,f,m,v,g=t.childNodes,y=[],b={},_=0,w=0,C=g.length,S=0,k=n?n.length:0;if(0!==C)for(var x=0;x<C;x++){var P=g[x],E=P.__preactattr_;null!=(O=k&&E?P._component?P._component.__k:E.key:null)?(_++,b[O]=P):(E||(void 0!==P.splitText?!a||P.nodeValue.trim():a))&&(y[S++]=P)}if(0!==k)for(x=0;x<k;x++){var O;if(h=null,null!=(O=(p=n[x]).key))_&&void 0!==b[O]&&(h=b[O],b[O]=void 0,_--);else if(!h&&w<S)for(l=w;l<S;l++)if(void 0!==y[l]&&(f=u=y[l],v=a,"string"==typeof(m=p)||"number"==typeof m?void 0!==f.splitText:"string"==typeof m.nodeName?!f._componentConstructor&&i(f,m.nodeName):v||f._componentConstructor===m.nodeName)){h=u,y[l]=void 0,l===S-1&&S--,l===w&&w++;break}h=e(h,p,r,o),c=g[x],h&&h!==t&&h!==c&&(null==c?t.appendChild(h):h===c.nextSibling?s(c):t.insertBefore(h,c))}if(_)for(var x in b)void 0!==b[x]&&d(b[x],!1);for(;w<=S;)void 0!==(h=y[S--])&&d(h,!1)}(c,w,r,o,A||null!=_.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||l(e,r,n[r],n[r]=void 0,O);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||l(e,r,n[r],n[r]=t[r],O)}(c,n.attributes,_),O=p,c}(e,t,n,r,u);return o&&p.parentNode!==o&&o.appendChild(p),--E||(A=!1,u||c()),p}function d(e,t){var n=e._component;n?y(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;d(e,!0),e=t}}function f(e,t,n){var r,o=U[e.name];if(e.prototype&&e.prototype.render?(r=new e(t,n),b.call(r,t,n)):((r=new b(t,n)).constructor=e,r.render=m),o)for(var i=o.length;i--;)if(o[i].constructor===e){r.__b=o[i].__b,o.splice(i,1);break}return r}function m(e,t,n){return this.constructor(e,n)}function v(e,t,n,o,i){e.__x||(e.__x=!0,(e.__r=t.ref)&&delete t.ref,(e.__k=t.key)&&delete t.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==n&&(1!==n&&!1===_.syncComponentUpdates&&e.base?r(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,t,r,o){if(!e.__x){var i,s,l,u=e.props,h=e.state,m=e.context,b=e.__p||u,w=e.__s||h,C=e.__c||m,S=e.base,k=e.__b,x=S||k,O=e._component,A=!1;if(S&&(e.props=b,e.state=w,e.context=C,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,h,m)?A=!0:e.componentWillUpdate&&e.componentWillUpdate(u,h,m),e.props=u,e.state=h,e.context=m),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!A){i=e.render(u,h,m),e.getChildContext&&(m=n(n({},m),e.getChildContext()));var U,N,T=i&&i.nodeName;if("function"==typeof T){var R=a(i);(s=O)&&s.constructor===T&&R.key==s.__k?v(s,R,1,m,!1):(U=s,e._component=s=f(T,R,m),s.__b=s.__b||k,s.__u=e,v(s,R,0,m,!1),g(s,1,r,!0)),N=s.base}else l=x,(U=O)&&(l=e._component=null),(x||1===t)&&(l&&(l._component=null),N=p(l,i,m,r||!S,x&&x.parentNode,!0));if(x&&N!==x&&s!==O){var F=x.parentNode;F&&N!==F&&(F.replaceChild(N,x),U||(x._component=null,d(x,!1)))}if(U&&y(U),e.base=N,N&&!o){for(var D=e,M=e;M=M.__u;)(D=M).base=N;N._component=D,N._componentConstructor=D.constructor}}if(!S||r?P.unshift(e):A||(e.componentDidUpdate&&e.componentDidUpdate(b,w,C),_.afterUpdate&&_.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);E||o||c()}}function y(e){_.beforeUnmount&&_.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?y(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),function(e){var t=e.constructor.name;(U[t]||(U[t]=[])).push(e)}(e),h(t)),e.__r&&e.__r(null)}function b(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{}}var _={},w=[],C=[],S="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,k=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,x=[],P=[],E=0,O=!1,A=!1,U={};n(b.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),r(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),g(this,2)},render:function(){}});var N={h:t,createElement:t,cloneElement:function(e,r){return t(e.nodeName,n(n({},e.attributes),r),arguments.length>2?[].slice.call(arguments,2):e.children)},Component:b,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:o,options:_};Js.exports=N}();var Qs=(Js=Js.exports).h,Zs=function(){return Qs("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Qs("g",{fill:"none",fillRule:"evenodd"},Qs("rect",{className:"uppy-ProviderIconBg",fill:"#2C3E50",width:"32",height:"32",rx:"16"}),Qs("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"}),Qs("circle",{fill:"#FFF",cx:"16",cy:"16",r:"2"})))},el=Js.h,tl=function(e){var t=e.recording,n=e.onStartRecording,r=e.onStopRecording,o=e.i18n;return t?el("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video uppy-ScreenCapture-button--stop-rec",type:"button",title:o("stopCapturing"),"aria-label":o("stopCapturing"),onClick:r,"data-uppy-super-focusable":!0},el("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},el("rect",{x:"15",y:"15",width:"70",height:"70"}))):el("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video",type:"button",title:o("startCapturing"),"aria-label":o("startCapturing"),onClick:n,"data-uppy-super-focusable":!0},el("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},el("circle",{cx:"50",cy:"50",r:"40"})))},nl=Js.h,rl=function(e){var t=e.recording,n=e.recordedVideo,r=e.onSubmit,o=e.i18n;return n&&!t?nl("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--submit",type:"button",title:o("submitRecordedFile"),"aria-label":o("submitRecordedFile"),onClick:r,"data-uppy-super-focusable":!0},nl("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"},nl("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 ol(){return(ol=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function il(e,t){return(il=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var al=Js.h,sl=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).state={elapsedTime:0},n.wrapperStyle={width:"100%",height:"100%",display:"flex"},n.overlayStyle={position:"absolute",width:"100%",height:"100%",background:"black",opacity:.7},n.infoContainerStyle={marginLeft:"auto",marginRight:"auto",marginTop:"auto",marginBottom:"auto",zIndex:1,color:"white"},n.infotextStyle={marginLeft:"auto",marginRight:"auto",marginBottom:"1rem",fontSize:"1.5rem"},n.timeStyle={display:"block",fontWeight:"bold",marginLeft:"auto",marginRight:"auto",fontSize:"3rem",fontFamily:"Courier New"},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,il(t,n);var o=r.prototype;return o.startTimer=function(){this.timerTick(),this.timerRunning=!0},o.resetTimer=function(){clearTimeout(this.timer),this.setState({elapsedTime:0}),this.timerRunning=!1},o.timerTick=function(){var e=this;this.timer=setTimeout((function(){e.setState({elapsedTime:e.state.elapsedTime+1}),e.timerTick()}),1e3)},o.fmtMSS=function(e){return(e-(e%=60))/60+(e>9?":":":0")+e},o.render=function(){var e=ol({},this.props),t=e.recording,n=e.i18n,r=this.fmtMSS(this.state.elapsedTime);return t&&!this.timerRunning&&this.startTimer(),!t&&this.timerRunning&&this.resetTimer(),t?al("div",{style:this.wrapperStyle},al("div",{style:this.overlayStyle}),al("div",{style:this.infoContainerStyle},al("div",{style:this.infotextStyle},n("recording")),al("div",{style:this.timeStyle},r))):null},r}(Js.Component),ll=Js.h,ul=function(e){var t=e.streamActive,n=e.i18n;return t?ll("div",{title:n("streamActive"),"aria-label":n("streamActive"),className:"uppy-ScreenCapture-icon--stream uppy-ScreenCapture-icon--streamActive"},ll("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},ll("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),ll("path",{d:"M0 0h24v24H0z",fill:"none"}),ll("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"}))):ll("div",{title:n("streamPassive"),"aria-label":n("streamPassive"),className:"uppy-ScreenCapture-icon--stream"},ll("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},ll("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),ll("path",{d:"M0 0h24v24H0z",fill:"none"}),ll("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 cl(){return(cl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function pl(e,t){return(pl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var dl,hl,fl=Js.h,ml=function(e){var t,n;function r(){return e.apply(this,arguments)||this}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,pl(t,n);var o=r.prototype;return o.componentWillUnmount=function(){this.props.onStop()},o.render=function(){var e=this,t=this.props,n=t.recording,r=t.stream,o=t.recordedVideo,i={playsinline:!0};return(n||!o&&!n)&&(i.muted=!0,i.autoplay=!0,i.srcObject=r),o&&!n&&(i.muted=!1,i.controls=!0,i.src=o,this.videoElement&&(this.videoElement.srcObject=void 0)),fl("div",{className:"uppy uppy-ScreenCapture-container"},fl("div",{className:"uppy-ScreenCapture-videoContainer"},fl(ul,this.props),fl("video",cl({ref:function(t){return e.videoElement=t},className:"uppy-ScreenCapture-video"},i)),fl(sl,this.props)),fl("div",{className:"uppy-ScreenCapture-buttonContainer"},fl(tl,this.props),fl(rl,this.props)))},r}(Js.Component);function vl(){return(vl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function gl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yl(e,t){return(yl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var bl=Js.h,_l=(hl=dl=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).mediaDevices=navigator&&navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia&&window&&window.MediaRecorder?navigator.mediaDevices:null,r.protocol=location.protocol.match(/https/i)?"https":"http",r.id=r.opts.id||"ScreenCapture",r.title=r.opts.title||"Screencast",r.type="acquirer",r.icon=Zs,r.defaultLocale={strings:{startCapturing:"Begin screen capturing",stopCapturing:"Stop screen capturing",submitRecordedFile:"Submit recorded file",streamActive:"Stream active",streamPassive:"Stream passive",micDisabled:"Microphone access denied by user",recording:"Recording"}},r.opts=vl({},{displayMediaConstraints:{video:{width:1280,height:720,frameRate:{ideal:3,max:5},cursor:"motion",displaySurface:"monitor"}},userMediaConstraints:{audio:!0},preferredVideoMimeType:"video/webm"},n),r.translator=new x([r.defaultLocale,r.uppy.locale,r.opts.locale]),r.i18n=r.translator.translate.bind(r.translator),r.i18nArray=r.translator.translateArray.bind(r.translator),r.install=r.install.bind(gl(r)),r.setPluginState=r.setPluginState.bind(gl(r)),r.render=r.render.bind(gl(r)),r.start=r.start.bind(gl(r)),r.stop=r.stop.bind(gl(r)),r.startRecording=r.startRecording.bind(gl(r)),r.stopRecording=r.stopRecording.bind(gl(r)),r.submit=r.submit.bind(gl(r)),r.streamInterrupted=r.streamInactivated.bind(gl(r)),r.captureActive=!1,r.capturedMediaFile=null,r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,yl(t,n);var o=r.prototype;return o.install=function(){if(!this.mediaDevices)return this.uppy.log("Screen recorder access is not supported","error"),null;this.setPluginState({streamActive:!1,audioStreamActive:!1});var e=this.opts.target;e&&this.mount(e,this)},o.uninstall=function(){this.videoStream&&this.stop(),this.unmount()},o.start=function(){var e=this;if(!this.mediaDevices)return Promise.reject(new Error("Screen recorder access not supported"));this.captureActive=!0,this.selectAudioStreamSource(),this.selectVideoStreamSource().then((function(t){!1===t&&e.parent&&e.parent.hideAllPanels&&(e.parent.hideAllPanels(),e.captureActive=!1)}))},o.selectVideoStreamSource=function(){var e=this;return this.videoStream?new Promise((function(t){return t(e.videoStream)})):this.mediaDevices.getDisplayMedia(this.opts.displayMediaConstraints).then((function(t){return e.videoStream=t,e.videoStream.addEventListener("inactive",(function(t){e.streamInactivated()})),e.setPluginState({streamActive:!0}),t})).catch((function(t){return e.setPluginState({screenRecError:t}),e.userDenied=!0,setTimeout((function(){e.userDenied=!1}),1e3),!1}))},o.selectAudioStreamSource=function(){var e=this;return this.audioStream?new Promise((function(t){return t(e.audioStream)})):this.mediaDevices.getUserMedia(this.opts.userMediaConstraints).then((function(t){return e.audioStream=t,e.setPluginState({audioStreamActive:!0}),t})).catch((function(t){return"NotAllowedError"===t.name&&e.uppy.info(e.i18n("micDisabled"),"error",5e3),!1}))},o.startRecording=function(){var e=this,t={};this.capturedMediaFile=null,this.recordingChunks=[];var n=this.opts.preferredVideoMimeType;this.selectVideoStreamSource().then((function(r){n&&MediaRecorder.isTypeSupported(n)&&_s(n)&&(t.mimeType=n);var o=[r.getVideoTracks()[0]];e.audioStream&&o.push(e.audioStream.getAudioTracks()[0]),e.outputStream=new MediaStream(o),e.recorder=new MediaRecorder(e.outputStream,t),e.recorder.addEventListener("dataavailable",(function(t){e.recordingChunks.push(t.data)})),e.recorder.start(),e.setPluginState({recording:!0})})).catch((function(t){e.uppy.log(t,"error")}))},o.streamInactivated=function(){var e=vl({},this.getPluginState()),t=e.recordedVideo,n=e.recording;t||n?n&&(this.uppy.log("Capture stream inactive \u2014 stop recording"),this.stopRecording()):this.parent&&this.parent.hideAllPanels&&this.parent.hideAllPanels(),this.videoStream=null,this.audioStream=null,this.setPluginState({streamActive:!1,audioStreamActive:!1})},o.stopRecording=function(){var e=this;return new Promise((function(t,n){e.recorder.addEventListener("stop",(function(){t()})),e.recorder.stop()})).then((function(){return e.setPluginState({recording:!1}),e.getVideo()})).then((function(t){e.capturedMediaFile=t,e.setPluginState({recordedVideo:URL.createObjectURL(t.data)})})).then((function(){e.recordingChunks=null,e.recorder=null}),(function(t){throw e.recordingChunks=null,e.recorder=null,t}))},o.submit=function(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(Cd){Cd.isRestriction||this.uppy.log(Cd,"error")}},o.stop=function(){this.videoStream&&(this.videoStream.getVideoTracks().forEach((function(e){e.stop()})),this.videoStream.getAudioTracks().forEach((function(e){e.stop()})),this.videoStream=null),this.audioStream&&(this.audioStream.getAudioTracks().forEach((function(e){e.stop()})),this.audioStream.getVideoTracks().forEach((function(e){e.stop()})),this.audioStream=null),this.outputStream&&(this.outputStream.getAudioTracks().forEach((function(e){e.stop()})),this.outputStream.getVideoTracks().forEach((function(e){e.stop()})),this.outputStream=null),this.setPluginState({recordedVideo:null}),this.captureActive=!1},o.getVideo=function(){var e=this.recordingChunks[0].type,t=_s(e);if(!t)return Promise.reject(new Error('Could not retrieve recording: Unsupported media type "'+e+'"'));var n="screencap-"+Date.now()+"."+t,r=new Blob(this.recordingChunks,{type:e}),o={source:this.id,name:n,data:new Blob([r],{type:e}),type:e};return Promise.resolve(o)},o.render=function(e){var t=this.getPluginState();return t.streamActive||this.captureActive||this.userDenied||this.start(),bl(ml,vl({},t,{onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onStop:this.stop,onSubmit:this.submit,i18n:this.i18n,stream:this.videoStream}))},r}(ue.Plugin),dl.VERSION="1.1.0",hl),wl=function(){function e(e){this.limit="number"!=typeof e||0===e?1/0:e,this.activeRequests=0,this.queuedHandlers=[]}var t=e.prototype;return t._call=function(e){var t=this;this.activeRequests+=1;var n,r=!1;try{n=e()}catch(Cd){throw this.activeRequests-=1,Cd}return{abort:function(){r||(r=!0,t.activeRequests-=1,n(),t._queueNext())},done:function(){r||(r=!0,t.activeRequests-=1,t._queueNext())}}},t._queueNext=function(){var e=this;Promise.resolve().then((function(){e._next()}))},t._next=function(){if(!(this.activeRequests>=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 n=this;void 0===t&&(t={});var r={fn:e,priority:t.priority||0,abort:function(){n._dequeue(r)},done:function(){throw new Error("Cannot mark a queued request as done: this indicates a bug")}},o=ee(this.queuedHandlers,(function(e){return r.priority>e.priority}));return-1===o?this.queuedHandlers.push(r):this.queuedHandlers.splice(o,0,r),r},t._dequeue=function(e){var t=this.queuedHandlers.indexOf(e);-1!==t&&this.queuedHandlers.splice(t,1)},t.run=function(e,t){return this.activeRequests<this.limit?this._call(e):this._queue(e,t)},t.wrapPromiseFunction=function(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];var a,s=new Promise((function(r,i){a=n.run((function(){var t,n;try{n=Promise.resolve(e.apply(void 0,o))}catch(Cd){n=Promise.reject(Cd)}return n.then((function(e){t?i(t):(a.done(),r(e))}),(function(e){t?i(t):(a.done(),i(e))})),function(){t=new Error("Cancelled")}}),t)}));return s.abort=function(){a.abort()},s}},e}(),Cl=function(e){var t=[],n=[];function r(e){t.push(e)}function o(e){n.push(e)}return Promise.all(e.map((function(e){return e.then(r,o)}))).then((function(){return{successful:t,failed:n}}))},Sl=z((function(e,t,n){var r=t.progress,o=t.bytesUploaded,i=t.bytesTotal;r&&(e.uppy.log("Upload progress: "+r),e.uppy.emit("upload-progress",n,{uploader:e,bytesUploaded:o,bytesTotal:i}))}),300,{leading:!0,trailing:!0}),kl=function(e){var t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(e)[1];return(/^http:\/\//i.test(e)?"ws":"wss")+"://"+t},xl=function(){function e(e){this._events=[],this._emitter=e}var t=e.prototype;return t.on=function(e,t){return this._events.push([e,t]),this._emitter.on(e,t)},t.remove=function(){var e=this;this._events.forEach((function(t){var n=t[0],r=t[1];e._emitter.off(n,r)}))},e}(),Pl=function(){function e(e,t){this._timeout=e,this._onTimedOut=t,this._isDone=!1,this._aliveTimer=null,this._onTimedOut=this._onTimedOut.bind(this)}var t=e.prototype;return t.progress=function(){this._isDone||this._timeout>0&&(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}(),El=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)};function Ol(){return(Ol=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Al=Qe.Provider,Ul=Qe.RequestClient,Nl=Qe.Socket;function Tl(e,t){return t||(t=new Error("Upload error")),"string"==typeof t&&(t=new Error(t)),t instanceof Error||(t=Ol(new Error("Upload error"),{data:t})),El(e)?t=new Fe(t,e):(t.request=e,t)}var Rl,Fl,Dl=function(){function e(e,t){this.uppy=e,this.opts=Ol({validateStatus:function(e,t,n){return e>=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,n=Ol({},this.opts,t||{},e.xhrUpload||{},{headers:{}});return Ol(n.headers,this.opts.headers),t&&Ol(n.headers,t.headers),e.xhrUpload&&Ol(n.headers,e.xhrUpload.headers),n},t.uploadFile=function(e,t,n){var r=this.uppy.getFile(e);if(r.error)throw new Error(r.error);return r.isRemote?this._uploadRemoteFile(r,t,n):this._uploadLocalFile(r,t,n)},t._addMetadata=function(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach((function(n){e.append(n,t[n])}))},t._createFormDataUpload=function(e,t){var n=new FormData;this._addMetadata(n,e.meta,t);var r=function(e){return e.data.slice(0,e.data.size,e.meta.type)}(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n},t._createBareUpload=function(e,t){return e.data},t._onFileRemoved=function(e,t){this.uploaderEvents[e].on("file-removed",(function(n){e===n.id&&t(n.id)}))},t._onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",(function(n){e===n&&t()}))},t._onRetryAll=function(e,t){var n=this;this.uploaderEvents[e].on("retry-all",(function(r){n.uppy.getFile(e)&&t()}))},t._onCancelAll=function(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",(function(){n.uppy.getFile(e)&&t()}))},t._uploadLocalFile=function(e,t,n){var r=this,o=this._getOptions(e);return this.uppy.log("uploading "+t+" of "+n),new Promise((function(t,n){var i=o.formData?r._createFormDataUpload(e,o):r._createBareUpload(e,o),a=new XMLHttpRequest;r.uploaderEvents[e.id]=new xl(r.uppy);var s=new Pl(o.timeout,(function(){a.abort(),u.done();var t=new Error(r.i18n("timedOut",{seconds:Math.ceil(o.timeout/1e3)}));r.uppy.emit("upload-error",e,t),n(t)})),l=D();a.upload.addEventListener("loadstart",(function(e){r.uppy.log("[AwsS3/XHRUpload] "+l+" started")})),a.upload.addEventListener("progress",(function(t){r.uppy.log("[AwsS3/XHRUpload] "+l+" progress: "+t.loaded+" / "+t.total),s.progress(),t.lengthComputable&&r.uppy.emit("upload-progress",e,{uploader:r,bytesUploaded:t.loaded,bytesTotal:t.total})})),a.addEventListener("load",(function(i){if(r.uppy.log("[AwsS3/XHRUpload] "+l+" finished"),s.done(),u.done(),r.uploaderEvents[e.id]&&(r.uploaderEvents[e.id].remove(),r.uploaderEvents[e.id]=null),o.validateStatus(i.target.status,a.responseText,a)){var c=o.getResponseData(a.responseText,a),p=c[o.responseUrlFieldName],d={status:i.target.status,body:c,uploadURL:p};return r.uppy.emit("upload-success",e,d),p&&r.uppy.log("Download "+e.name+" from "+p),t(e)}var h=o.getResponseData(a.responseText,a),f=Tl(a,o.getResponseError(a.responseText,a)),m={status:i.target.status,body:h};return r.uppy.emit("upload-error",e,f,m),n(f)})),a.addEventListener("error",(function(t){r.uppy.log("[AwsS3/XHRUpload] "+l+" errored"),s.done(),u.done(),r.uploaderEvents[e.id]&&(r.uploaderEvents[e.id].remove(),r.uploaderEvents[e.id]=null);var i=Tl(a,o.getResponseError(a.responseText,a));return r.uppy.emit("upload-error",e,i),n(i)})),a.open(o.method.toUpperCase(),o.endpoint,!0),a.withCredentials=o.withCredentials,""!==o.responseType&&(a.responseType=o.responseType),Object.keys(o.headers).forEach((function(e){a.setRequestHeader(e,o.headers[e])}));var u=r.requests.run((function(){return a.send(i),function(){s.done(),a.abort()}}),{priority:1});r._onFileRemoved(e.id,(function(){u.abort(),n(new Error("File removed"))})),r._onCancelAll(e.id,(function(){u.abort(),n(new Error("Upload cancelled"))}))}))},t._uploadRemoteFile=function(e,t,n){var r=this,o=this._getOptions(e);return new Promise((function(t,n){var i={};(Array.isArray(o.metaFields)?o.metaFields:Object.keys(e.meta)).forEach((function(t){i[t]=e.meta[t]})),new(e.remote.providerOptions.provider?Al:Ul)(r.uppy,e.remote.providerOptions).post(e.remote.url,Ol({},e.remote.body,{endpoint:o.endpoint,size:e.data.size,fieldname:o.fieldName,metadata:i,httpMethod:o.method,useFormData:o.formData,headers:o.headers})).then((function(i){var a=i.token,s=kl(e.remote.companionUrl),l=new Nl({target:s+"/api/"+a,autoOpen:!1});r.uploaderEvents[e.id]=new xl(r.uppy),r._onFileRemoved(e.id,(function(){l.send("pause",{}),u.abort(),t("upload "+e.id+" was removed")})),r._onCancelAll(e.id,(function(){l.send("pause",{}),u.abort(),t("upload "+e.id+" was canceled")})),r._onRetry(e.id,(function(){l.send("pause",{}),l.send("resume",{})})),r._onRetryAll(e.id,(function(){l.send("pause",{}),l.send("resume",{})})),l.on("progress",(function(t){return Sl(r,t,e)})),l.on("success",(function(n){var i=o.getResponseData(n.response.responseText,n.response),a=i[o.responseUrlFieldName],s={status:n.response.status,body:i,uploadURL:a,bytesUploaded:n.bytesUploaded};return r.uppy.emit("upload-success",e,s),u.done(),r.uploaderEvents[e.id]&&(r.uploaderEvents[e.id].remove(),r.uploaderEvents[e.id]=null),t()})),l.on("error",(function(t){var i=t.response,a=i?o.getResponseError(i.responseText,i):Ol(new Error(t.error.message),{cause:t.error});r.uppy.emit("upload-error",e,a),u.done(),r.uploaderEvents[e.id]&&(r.uploaderEvents[e.id].remove(),r.uploaderEvents[e.id]=null),n(a)}));var u=r.requests.run((function(){return l.open(),e.isPaused&&l.send("pause",{}),function(){return l.close()}}))})).catch((function(t){r.uppy.emit("upload-error",e,t),n(t)}))}))},e}(),Ml=function(e,t){var n,r=t.headers?t.headers["content-type"]:t.getResponseHeader("Content-Type");if("string"==typeof r){var o=(n=r,n.replace(/;.*$/,"")).toLowerCase();if("application/xml"===o||"text/xml"===o)return!0;if("text/html"===o&&/^<\?xml /.test(e))return!0}return!1};function Bl(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Il(e,t){return(Il=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ll(){return(Ll=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var jl="function"==typeof URL?URL:Xe,zl=Qe.RequestClient;function Hl(e,t){var n=e.indexOf("<"+t+">"),r=e.indexOf("</"+t+">",n);return-1!==n&&-1!==r?e.slice(n+t.length+2,r):""}function Wl(e){if(e&&e.error){var t=new Error(e.message);throw Ll(t,e.error),t}return e}var Vl=!1,ql=(Fl=Rl=function(e){var t,n;function r(t,n){var r;(r=e.call(this,t,n)||this).type="uploader",r.id=r.opts.id||"AwsS3",r.title="AWS S3",r.defaultLocale={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}};var o={timeout:3e4,limit:0,metaFields:[],getUploadParameters:r.getUploadParameters.bind(Bl(r))};return r.opts=Ll({},o,n),r.i18nInit(),r.client=new zl(t,n),r.handleUpload=r.handleUpload.bind(Bl(r)),r.requests=new wl(r.opts.limit),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Il(t,n);var o=r.prototype;return o.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},o.i18nInit=function(){this.translator=new x([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},o.getUploadParameters=function(e){if(!this.opts.companionUrl)throw new Error("Expected a `companionUrl` option containing a Companion address.");var t=e.meta.name,n=e.meta.type,r={};this.opts.metaFields.forEach((function(t){null!=e.meta[t]&&(r[t]=e.meta[t].toString())}));var o=je({filename:t,type:n,metadata:r});return this.client.get("s3/params?"+o).then(Wl)},o.validateParameters=function(e,t){if("object"!=typeof t||!t||"string"!=typeof t.url||"object"!=typeof t.fields&&null!=t.fields){var n=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(n),n}if(null!=t.method&&!/^(put|post)$/i.test(t.method)){var r=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(r),r}},o.handleUpload=function(e){var t=this,n=Object.create(null);function r(e){var t=e.id;C(n,t)&&n[t].abort()}this.uppy.on("file-removed",r),e.forEach((function(e){var n=t.uppy.getFile(e);t.uppy.emit("upload-started",n)}));var o=this.requests.wrapPromiseFunction((function(e){return t.opts.getUploadParameters(e)})),i=e.length;return Cl(e.map((function(e,r){return n[e]=o(t.uppy.getFile(e)),n[e].then((function(o){delete n[e];var a=t.uppy.getFile(e);t.validateParameters(a,o);var s=o.method,l=void 0===s?"post":s,u=o.url,c=o.fields,p=o.headers,d={method:l,formData:"post"===l.toLowerCase(),endpoint:u,metaFields:c?Object.keys(c):[]};return p&&(d.headers=p),t.uppy.setFileState(a.id,{meta:Ll({},a.meta,c),xhrUpload:d}),t._uploader.uploadFile(a.id,r,i)})).catch((function(r){delete n[e];var o=t.uppy.getFile(e);t.uppy.emit("upload-error",o,r)}))}))).then((function(e){return t.uppy.off("file-removed",r),e}))},o.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,n){var r,o;return Ml(t,n)?{location:(r=n.responseURL,o=Hl(t,"Location"),r?new jl(o,r).toString():new jl(o).toString()),bucket:Hl(t,"Bucket"),key:Hl(t,"Key"),etag:Hl(t,"ETag")}:"POST"===this.method.toUpperCase()?(Vl||(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"),Vl=!0),{location:null}):n.responseURL?{location:n.responseURL.replace(/\?.*$/,"")}:{location:null}},getResponseError:function(e,t){if(Ml(e,t)){var n=Hl(e,"Message");return new Error(n)}}};t.i18n=this.i18n,this._uploader=new Dl(this.uppy,t)},o.uninstall=function(){this.uppy.removeUploader(this.handleUpload)},r}(ue.Plugin),Rl.VERSION="1.8.0",Fl),Xl={};function Gl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $l(e,t,n){return t&&Yl(e.prototype,t),n&&Yl(e,n),e}function Kl(e){return(Kl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Jl(e,t){return(Jl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ql(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Zl(e,t,n){return(Zl="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kl(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}Object.defineProperty(Xl,"__esModule",{value:!0});var eu=function(){function e(){Gl(this,e),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return $l(e,[{key:"addEventListener",value:function(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var n=this.listeners[e],r=0,o=n.length;r<o;r++)if(n[r].callback===t)return void n.splice(r,1)}},{key:"dispatchEvent",value:function(e){if(e.type in this.listeners){for(var t=this.listeners[e.type].slice(),n=0,r=t.length;n<r;n++){var o=t[n];try{o.callback.call(this,e)}catch(i){Promise.resolve().then((function(){throw i}))}o.options&&o.options.once&&this.removeEventListener(e.type,o.callback)}return!e.defaultPrevented}}}]),e}(),tu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Jl(e,t)}(o,eu);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r,o,i=Kl(t);if(n){var a=Kl(this).constructor;e=Reflect.construct(i,arguments,a)}else e=i.apply(this,arguments);return r=this,!(o=e)||"object"!=typeof o&&"function"!=typeof o?Ql(r):o});function o(){var e;return Gl(this,o),(e=r.call(this)).listeners||eu.call(Ql(e)),Object.defineProperty(Ql(e),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(Ql(e),"onabort",{value:null,writable:!0,configurable:!0}),e}return $l(o,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),Zl(Kl(o.prototype),"dispatchEvent",this).call(this,e)}}]),o}(),nu=function(){function e(){Gl(this,e),Object.defineProperty(this,"signal",{value:new tu,writable:!0,configurable:!0})}return $l(e,[{key:"abort",value:function(){var e;try{e=new Event("abort")}catch(t){"undefined"!=typeof document?document.createEvent?(e=document.createEvent("Event")).initEvent("abort",!1,!1):(e=document.createEventObject()).type="abort":e={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(e)}},{key:"toString",value:function(){return"[object AbortController]"}}]),e}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(nu.prototype[Symbol.toStringTag]="AbortController",tu.prototype[Symbol.toStringTag]="AbortSignal"),Xl.AbortController=nu,Xl.AbortSignal=tu;var ru={},ou=Xl.AbortController;Xl.AbortSignal;ru.AbortController=ou,ru.createAbortError=function(e){void 0===e&&(e="Aborted");try{return new DOMException(e,"AbortError")}catch(n){var t=new Error(e);return t.name="AbortError",t}};var iu=ru.createAbortError;function au(){return(au=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var su=ru.AbortController,lu=ru.createAbortError,uu={limit:1,retryDelays:[0,1e3,3e3,5e3],getChunkSize:function(e){return Math.ceil(e.size/1e4)},onStart:function(){},onProgress:function(){},onPartComplete:function(){},onSuccess:function(){},onError:function(e){throw e}};function cu(e){if("string"==typeof e)return parseInt(e,10);if("number"==typeof e)return e;throw new TypeError("Expected a number")}var pu,du,hu=function(){function e(e,t){this.options=au({},uu,t),this.options.getChunkSize||(this.options.getChunkSize=uu.getChunkSize),this.file=e,this.abortController=new su,this.key=this.options.key||null,this.uploadId=this.options.uploadId||null,this.parts=[],this.createdPromise=Promise.reject(),this.isPaused=!1,this.partsInProgress=0,this.chunks=null,this.chunkState=null,this._initChunks(),this.createdPromise.catch((function(){}))}var t=e.prototype;return t._aborted=function(){return this.abortController.signal.aborted},t._initChunks=function(){var e=[],t=this.options.getChunkSize(this.file),n=Math.max(5242880,Math.ceil(this.file.size/1e4)),r=Math.max(t,n);if(0===this.file.size)e.push(this.file);else for(var o=0;o<this.file.size;o+=r){var i=Math.min(this.file.size,o+r);e.push(this.file.slice(o,i))}this.chunks=e,this.chunkState=e.map((function(){return{uploaded:0,busy:!1,done:!1}}))},t._createUpload=function(){var e=this;return this.createdPromise=Promise.resolve().then((function(){return e.options.createMultipartUpload()})),this.createdPromise.then((function(t){if(e._aborted())throw lu();if("object"!=typeof t||!t||"string"!=typeof t.uploadId||"string"!=typeof t.key)throw new TypeError("AwsS3/Multipart: Got incorrect result from `createMultipartUpload()`, expected an object `{ uploadId, key }`.");e.key=t.key,e.uploadId=t.uploadId,e.options.onStart(t),e._uploadParts()})).catch((function(t){e._onError(t)}))},t._resumeUpload=function(){var e=this;return Promise.resolve().then((function(){return e.options.listParts({uploadId:e.uploadId,key:e.key})})).then((function(t){if(e._aborted())throw lu();t.forEach((function(t){var n=t.PartNumber-1;e.chunkState[n]={uploaded:cu(t.Size),etag:t.ETag,done:!0},e.parts.some((function(e){return e.PartNumber===t.PartNumber}))||e.parts.push({PartNumber:t.PartNumber,ETag:t.ETag})})),e._uploadParts()})).catch((function(t){e._onError(t)}))},t._uploadParts=function(){var e=this;if(!this.isPaused){var t=this.options.limit-this.partsInProgress;if(0!==t)if(this.chunkState.every((function(e){return e.done})))this._completeUpload();else{for(var n=[],r=0;r<this.chunkState.length;r++){var o=this.chunkState[r];if(!o.done&&!o.busy&&(n.push(r),n.length>=t))break}n.forEach((function(t){e._uploadPartRetryable(t).then((function(){e._uploadParts()}),(function(t){e._onError(t)}))}))}}},t._retryable=function(e){var t=this,n=e.before,r=e.attempt,o=e.after,i=this.options.retryDelays,a=this.abortController.signal;return n&&n(),function e(n){return r().catch((function(r){if(t._aborted())throw lu();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}(r)&&n<i.length)return(o=i[n],s={signal:a},new Promise((function(e,t){if(s&&s.signal&&s.signal.aborted)return t(iu());function n(){clearTimeout(r),i(),t(iu())}var r=setTimeout((function(){i(),e()}),o);function i(){s&&s.signal&&s.signal.removeEventListener("abort",n)}s&&s.signal&&s.signal.addEventListener("abort",n)}))).then((function(){return e(n+1)}));var o,s;throw r}))}(0).then((function(e){return o&&o(),e}),(function(e){throw o&&o(),e}))},t._uploadPartRetryable=function(e){var t=this;return this._retryable({before:function(){t.partsInProgress+=1},attempt:function(){return t._uploadPart(e)},after:function(){t.partsInProgress-=1}})},t._uploadPart=function(e){var t=this,n=this.chunks[e];return this.chunkState[e].busy=!0,Promise.resolve().then((function(){return t.options.prepareUploadPart({key:t.key,uploadId:t.uploadId,body:n,number:e+1})})).then((function(e){if("object"!=typeof e||!e||"string"!=typeof e.url)throw new TypeError("AwsS3/Multipart: Got incorrect result from `prepareUploadPart()`, expected an object `{ url }`.");return e})).then((function(n){var r=n.url,o=n.headers;if(t._aborted())throw t.chunkState[e].busy=!1,lu();return t._uploadPartBytes(e,r,o)}))},t._onPartProgress=function(e,t,n){this.chunkState[e].uploaded=cu(t);var r=this.chunkState.reduce((function(e,t){return e+t.uploaded}),0);this.options.onProgress(r,this.file.size)},t._onPartComplete=function(e,t){this.chunkState[e].etag=t,this.chunkState[e].done=!0;var n={PartNumber:e+1,ETag:t};this.parts.push(n),this.options.onPartComplete(n)},t._uploadPartBytes=function(e,t,n){var r,o=this,i=this.chunks[e],a=this.abortController.signal,s=new Promise((function(e,t){r={resolve:e,reject:t}})),l=new XMLHttpRequest;function u(){a.removeEventListener("abort",c)}function c(){l.abort()}return l.open("PUT",t,!0),n&&Object.keys(n).map((function(e){l.setRequestHeader(e,n[e])})),l.responseType="text",a.addEventListener("abort",c),l.upload.addEventListener("progress",(function(t){t.lengthComputable&&o._onPartProgress(e,t.loaded,t.total)})),l.addEventListener("abort",(function(t){u(),o.chunkState[e].busy=!1,r.reject(lu())})),l.addEventListener("load",(function(t){if(u(),o.chunkState[e].busy=!1,t.target.status<200||t.target.status>=300){var n=new Error("Non 2xx");return n.source=t.target,void r.reject(n)}o._onPartProgress(e,i.size,i.size);var a=t.target.getResponseHeader("ETag");null!==a?(o._onPartComplete(e,a),r.resolve()):r.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."))})),l.addEventListener("error",(function(t){u(),o.chunkState[e].busy=!1;var n=new Error("Unknown error");n.source=t.target,r.reject(n)})),l.send(i),s},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 su,this.isPaused=!0},t.abort=function(e){if(void 0===e&&(e={}),!e.really)return this.pause();this._abortUpload()},e}();function fu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mu(e,t){return(mu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vu(){return(vu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var gu=Qe.Socket,yu=Qe.Provider,bu=Qe.RequestClient;function _u(e){if(e&&e.error){var t=new Error(e.message);throw vu(t,e.error),t}return e}var wu=(du=pu=function(e){var t,n;function r(t,n){var r;(r=e.call(this,t,n)||this).type="uploader",r.id=r.opts.id||"AwsS3Multipart",r.title="AWS S3 Multipart",r.client=new bu(t,n);var o={timeout:3e4,limit:0,retryDelays:[0,1e3,3e3,5e3],createMultipartUpload:r.createMultipartUpload.bind(fu(r)),listParts:r.listParts.bind(fu(r)),prepareUploadPart:r.prepareUploadPart.bind(fu(r)),abortMultipartUpload:r.abortMultipartUpload.bind(fu(r)),completeMultipartUpload:r.completeMultipartUpload.bind(fu(r))};return r.opts=vu({},o,n),r.upload=r.upload.bind(fu(r)),r.requests=new wl(r.opts.limit),r.uploaders=Object.create(null),r.uploaderEvents=Object.create(null),r.uploaderSockets=Object.create(null),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,mu(t,n);var o=r.prototype;return o.resetUploaderReferences=function(e,t){void 0===t&&(t={}),this.uploaders[e]&&(this.uploaders[e].abort({really:t.abort||!1}),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null),this.uploaderSockets[e]&&(this.uploaderSockets[e].close(),this.uploaderSockets[e]=null)},o.assertHost=function(e){if(!this.opts.companionUrl)throw new Error("Expected a `companionUrl` option containing a Companion address, or if you are not using Companion, a custom `"+e+"` implementation.")},o.createMultipartUpload=function(e){this.assertHost("createMultipartUpload");var t={};return Object.keys(e.meta).map((function(n){null!=e.meta[n]&&(t[n]=e.meta[n].toString())})),this.client.post("s3/multipart",{filename:e.name,type:e.type,metadata:t}).then(_u)},o.listParts=function(e,t){var n=t.key,r=t.uploadId;this.assertHost("listParts");var o=encodeURIComponent(n);return this.client.get("s3/multipart/"+r+"?key="+o).then(_u)},o.prepareUploadPart=function(e,t){var n=t.key,r=t.uploadId,o=t.number;this.assertHost("prepareUploadPart");var i=encodeURIComponent(n);return this.client.get("s3/multipart/"+r+"/"+o+"?key="+i).then(_u)},o.completeMultipartUpload=function(e,t){var n=t.key,r=t.uploadId,o=t.parts;this.assertHost("completeMultipartUpload");var i=encodeURIComponent(n),a=encodeURIComponent(r);return this.client.post("s3/multipart/"+a+"/complete?key="+i,{parts:o}).then(_u)},o.abortMultipartUpload=function(e,t){var n=t.key,r=t.uploadId;this.assertHost("abortMultipartUpload");var o=encodeURIComponent(n),i=encodeURIComponent(r);return this.client.delete("s3/multipart/"+i+"?key="+o).then(_u)},o.uploadFile=function(e){var t=this;return new Promise((function(n,r){var o=new hu(e.data,vu({createMultipartUpload:t.opts.createMultipartUpload.bind(t,e),listParts:t.opts.listParts.bind(t,e),prepareUploadPart:t.opts.prepareUploadPart.bind(t,e),completeMultipartUpload:t.opts.completeMultipartUpload.bind(t,e),abortMultipartUpload:t.opts.abortMultipartUpload.bind(t,e),getChunkSize:t.opts.getChunkSize?t.opts.getChunkSize.bind(t):null,onStart:function(n){var r=t.uppy.getFile(e.id);t.uppy.setFileState(e.id,{s3Multipart:vu({},r.s3Multipart,{key:n.key,uploadId:n.uploadId})})},onProgress:function(n,r){t.uppy.emit("upload-progress",e,{uploader:t,bytesUploaded:n,bytesTotal:r})},onError:function(n){t.uppy.log(n),t.uppy.emit("upload-error",e,n),i.done(),t.resetUploaderReferences(e.id),r(n)},onSuccess:function(r){var a={body:vu({},r),uploadURL:r.location};i.done(),t.resetUploaderReferences(e.id);var s=t.uppy.getFile(e.id);t.uppy.emit("upload-success",s||e,a),r.location&&t.uppy.log("Download "+o.file.name+" from "+r.location),n(o)},onPartComplete:function(n){var r=t.uppy.getFile(e.id);r&&t.uppy.emit("s3-multipart:part-uploaded",r,n)},limit:t.opts.limit||5,retryDelays:t.opts.retryDelays||[]},e.s3Multipart));t.uploaders[e.id]=o,t.uploaderEvents[e.id]=new xl(t.uppy);var i=t.requests.run((function(){return e.isPaused||o.start(),function(){}}));t.onFileRemove(e.id,(function(r){i.abort(),t.resetUploaderReferences(e.id,{abort:!0}),n("upload "+r.id+" was removed")})),t.onCancelAll(e.id,(function(){i.abort(),t.resetUploaderReferences(e.id,{abort:!0}),n("upload "+e.id+" was canceled")})),t.onFilePause(e.id,(function(e){e?(i.abort(),o.pause()):(i.abort(),i=t.requests.run((function(){return o.start(),function(){}})))})),t.onPauseAll(e.id,(function(){i.abort(),o.pause()})),t.onResumeAll(e.id,(function(){i.abort(),e.error&&o.abort(),i=t.requests.run((function(){return o.start(),function(){}}))})),e.progress.uploadStarted&&e.isRestored||t.uppy.emit("upload-started",e)}))},o.uploadRemote=function(e){var t=this;return this.resetUploaderReferences(e.id),e.progress.uploadStarted&&e.isRestored||this.uppy.emit("upload-started",e),e.serverToken?this.connectToServerSocket(e):new Promise((function(n,r){new(e.remote.providerOptions.provider?yu:bu)(t.uppy,e.remote.providerOptions).post(e.remote.url,vu({},e.remote.body,{protocol:"s3-multipart",size:e.data.size,metadata:e.meta})).then((function(n){return t.uppy.setFileState(e.id,{serverToken:n.token}),e=t.uppy.getFile(e.id)})).then((function(e){return t.connectToServerSocket(e)})).then((function(){n()})).catch((function(n){t.uppy.emit("upload-error",e,n),r(n)}))}))},o.connectToServerSocket=function(e){var t=this;return new Promise((function(n,r){var o=e.serverToken,i=kl(e.remote.companionUrl),a=new gu({target:i+"/api/"+o,autoOpen:!1});t.uploaderSockets[e.id]=a,t.uploaderEvents[e.id]=new xl(t.uppy),t.onFileRemove(e.id,(function(r){s.abort(),a.send("pause",{}),t.resetUploaderReferences(e.id,{abort:!0}),n("upload "+e.id+" was removed")})),t.onFilePause(e.id,(function(e){e?(s.abort(),a.send("pause",{})):(s.abort(),s=t.requests.run((function(){return a.send("resume",{}),function(){}})))})),t.onPauseAll(e.id,(function(){s.abort(),a.send("pause",{})})),t.onCancelAll(e.id,(function(){s.abort(),a.send("pause",{}),t.resetUploaderReferences(e.id),n("upload "+e.id+" was canceled")})),t.onResumeAll(e.id,(function(){s.abort(),e.error&&a.send("pause",{}),s=t.requests.run((function(){a.send("resume",{})}))})),t.onRetry(e.id,(function(){a.isOpen&&(a.send("pause",{}),a.send("resume",{}))})),t.onRetryAll(e.id,(function(){a.isOpen&&(a.send("pause",{}),a.send("resume",{}))})),a.on("progress",(function(n){return Sl(t,n,e)})),a.on("error",(function(n){t.uppy.emit("upload-error",e,new Error(n.error)),t.resetUploaderReferences(e.id),s.done(),r(new Error(n.error))})),a.on("success",(function(r){var o={uploadURL:r.url};t.uppy.emit("upload-success",e,o),t.resetUploaderReferences(e.id),s.done(),n()}));var s=t.requests.run((function(){return a.open(),e.isPaused&&a.send("pause",{}),function(){}}))}))},o.upload=function(e){var t=this;if(0===e.length)return Promise.resolve();var n=e.map((function(e){var n=t.uppy.getFile(e);return n.isRemote?t.uploadRemote(n):t.uploadFile(n)}));return Promise.all(n)},o.onFileRemove=function(e,t){this.uploaderEvents[e].on("file-removed",(function(n){e===n.id&&t(n.id)}))},o.onFilePause=function(e,t){this.uploaderEvents[e].on("upload-pause",(function(n,r){e===n&&t(r)}))},o.onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",(function(n){e===n&&t()}))},o.onRetryAll=function(e,t){var n=this;this.uploaderEvents[e].on("retry-all",(function(r){n.uppy.getFile(e)&&t()}))},o.onPauseAll=function(e,t){var n=this;this.uploaderEvents[e].on("pause-all",(function(){n.uppy.getFile(e)&&t()}))},o.onCancelAll=function(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",(function(){n.uppy.getFile(e)&&t()}))},o.onResumeAll=function(e,t){var n=this;this.uploaderEvents[e].on("resume-all",(function(){n.uppy.getFile(e)&&t()}))},o.install=function(){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:vu({},e,{resumableUploads:!0})}),this.uppy.addUploader(this.upload)},o.uninstall=function(){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:vu({},e,{resumableUploads:!1})}),this.uppy.removeUploader(this.upload)},r}(ue.Plugin),pu.VERSION="1.8.18",du),Cu={};function Su(e){return(Su="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ku(e){var t="function"==typeof Map?new Map:void 0;return(ku=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return xu(e,arguments,Ou(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Eu(r,e)})(e)}function xu(e,t,n){return(xu=Pu()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Eu(o,n.prototype),o}).apply(null,arguments)}function Pu(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function Eu(e,t){return(Eu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ou(e){return(Ou=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.default=void 0;var Au=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Eu(e,t)}(r,ku(Error));var t,n=(t=r,function(){var e,n=Ou(t);if(Pu()){var r=Ou(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return function(e,t){return!t||"object"!==Su(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function r(e){var t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=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,r),(t=n.call(this,e)).originalRequest=i,t.originalResponse=a,t.causingError=o,null!=o&&(e+=", caused by ".concat(o.toString())),null!=i){var s=i.getHeader("X-Request-ID")||"n/a",l=i.getMethod(),u=i.getURL(),c=a?a.getStatus():"n/a",p=a?a.getBody()||"":"n/a";e+=", originated from request (method: ".concat(l,", url: ").concat(u,", response code: ").concat(c,", response text: ").concat(p,", request id: ").concat(s,")")}return t.message=e,t}return r}();Cu.default=Au;var Uu={};Object.defineProperty(Uu,"__esModule",{value:!0}),Uu.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 Nu={exports:{}};(function(e){(function(){!function(e,t){"object"==typeof Nu.exports?Nu.exports=t(e):t(e)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:this,(function(e){"use strict";var t,n=(e=e||{}).Base64,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=function(e){for(var t={},n=0,r=e.length;n<r;n++)t[e.charAt(n)]=n;return t}(r),i=String.fromCharCode,a=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?i(192|t>>>6)+i(128|63&t):i(224|t>>>12&15)+i(128|t>>>6&63)+i(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return i(240|t>>>18&7)+i(128|t>>>12&63)+i(128|t>>>6&63)+i(128|63&t)},s=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,l=function(e){return e.replace(s,a)},u=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[r.charAt(n>>>18),r.charAt(n>>>12&63),t>=2?"=":r.charAt(n>>>6&63),t>=1?"=":r.charAt(63&n)].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,u)},p=function(e){return c(l(String(e)))},d=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},h=function(e,t){return t?d(p(e)):p(e)};e.Uint8Array&&(t=function(e,t){for(var n="",o=0,i=e.length;o<i;o+=3){var a=e[o],s=e[o+1],l=e[o+2],u=a<<16|s<<8|l;n+=r.charAt(u>>>18)+r.charAt(u>>>12&63)+(void 0!==s?r.charAt(u>>>6&63):"=")+(void 0!==l?r.charAt(63&u):"=")}return t?d(n):n});var f,m=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=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 i(55296+(t>>>10))+i(56320+(1023&t));case 3:return i((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return i((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},g=function(e){return e.replace(m,v)},y=function(e){var t=e.length,n=t%4,r=(t>0?o[e.charAt(0)]<<18:0)|(t>1?o[e.charAt(1)]<<12:0)|(t>2?o[e.charAt(2)]<<6:0)|(t>3?o[e.charAt(3)]:0),a=[i(r>>>16),i(r>>>8&255),i(255&r)];return a.length-=[0,0,2,1][n],a.join("")},b=e.atob&&"function"==typeof e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/\S{1,4}/g,y)},_=function(e){return b(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},w=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},C=function(e){return function(e){return g(b(e))}(w(e))};if(e.Uint8Array&&(f=function(e){return Uint8Array.from(_(w(e)),(function(e){return e.charCodeAt(0)}))}),e.Base64={VERSION:"2.6.4",atob:_,btoa:c,fromBase64:C,toBase64:h,utob:l,encode:h,encodeURI:function(e){return h(e,!0)},btou:g,decode:C,noConflict:function(){var t=e.Base64;return e.Base64=n,t},fromUint8Array:t,toUint8Array:f},"function"==typeof Object.defineProperty){var S=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};e.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",S((function(){return C(this)}))),Object.defineProperty(String.prototype,"toBase64",S((function(e){return h(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",S((function(){return h(this,!0)})))}}return e.Meteor&&(Base64=e.Base64),!!Nu.exports&&(Nu.exports.Base64=e.Base64),{Base64:e.Base64}}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),Nu=Nu.exports;var Tu={};Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.enableDebugLog=function(){Ru=!0},Tu.log=function(e){Ru&&console.log(e)};var Ru=!1,Fu={};Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.default=void 0;var Du=Iu(Cu),Mu=Iu(Uu),Bu=Iu(Xe);function Iu(e){return e&&e.__esModule?e:{default:e}}function Lu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ju(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lu(Object(n),!0).forEach((function(t){zu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function zu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hu(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Wu=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"resume"in n&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=n,this._urlStorage=this.options.urlStorage,this.file=t,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}var t,n,r;return t=e,r=[{key:"terminate",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if("function"==typeof n||"function"==typeof r)throw new Error("tus: the terminate function does not accept a callback since v2 anymore; please use the returned Promise instead");var o=Xu("DELETE",t,n);return o.send().then((function(e){if(204!==e.getStatus())throw new Du.default("tus: unexpected response while terminating upload",null,o,e)})).catch((function(r){if(r instanceof Du.default||(r=new Du.default("tus: failed to terminate upload",r,o,null)),!Gu(r,0,n))throw r;var i=n.retryDelays[0],a=n.retryDelays.slice(1),s=ju({},n,{retryDelays:a});return new Promise((function(e){return setTimeout(e,i)})).then((function(){return e.terminate(t,s)}))}))}}],(n=[{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 n=this.options.retryDelays;null==n||"[object Array]"===Object.prototype.toString.call(n)?(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(n){return null==n?(0,Tu.log)("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):(0,Tu.log)("Calculated fingerprint: ".concat(n)),e._fingerprint=n,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,n=this._size=this._source.size,r=0;this._parallelUploads=[];var o=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,i=function(e,t,n){for(var r=Math.floor(e/t),o=[],i=0;i<t;i++)o.push({start:r*i,end:r*(i+1)});return o[t-1].end=e,n&&o.forEach((function(e,t){e.uploadUrl=n[t]||null})),o}(this._source.size,o,this._parallelUploadUrls);this._parallelUploadUrls=new Array(i.length);var a,s=i.map((function(o,a){var s=0;return t._source.slice(o.start,o.end).then((function(l){var u=l.value;return new Promise((function(l,c){var p=ju({},t.options,{uploadUrl:o.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,metadata:{},headers:ju({},t.options.headers,{"Upload-Concat":"partial"}),onSuccess:l,onError:c,onProgress:function(e){r=r-s+e,s=e,t._emitProgress(r,n)},_onUploadUrlAvailable:function(){t._parallelUploadUrls[a]=d.url,t._parallelUploadUrls.filter((function(e){return!!e})).length===i.length&&t._saveUploadInUrlStorage()}}),d=new e(u,p);d.start(),t._parallelUploads.push(d)}))}))}));Promise.all(s).then((function(){(a=t._openRequest("POST",t.options.endpoint)).setHeader("Upload-Concat","final;".concat(t._parallelUploadUrls.join(" ")));var e=Vu(t.options.metadata);return""!==e&&a.setHeader("Upload-Metadata",e),t._sendRequest(a,null)})).then((function(e){if(qu(e.getStatus(),200)){var n=e.getHeader("Location");null!=n?(t.url=Yu(t.options.endpoint,n),(0,Tu.log)("Created upload at ".concat(t.url)),t._emitSuccess()):t._emitHttpError(a,e,"tus: invalid or missing Location header")}else t._emitHttpError(a,e,"tus: unexpected response while creating upload")})).catch((function(e){t._emitError(e)}))}},{key:"_startSingleUpload",value:function(){if(this.options.uploadLengthDeferred)this._size=null;else if(null!=this.options.uploadSize){if(this._size=+this.options.uploadSize,isNaN(this._size))return void this._emitError(new Error("tus: cannot convert `uploadSize` option into a number"))}else if(this._size=this._source.size,null==this._size)return void this._emitError(new Error("tus: cannot automatically derive upload's size from input and must be specified manually using the `uploadSize` option"));return this._aborted=!1,null!=this.url?((0,Tu.log)("Resuming upload from previous URL: ".concat(this.url)),void this._resumeUpload()):null!=this.options.uploadUrl?((0,Tu.log)("Resuming upload from provided URL: ".concat(this.options.url)),this.url=this.options.uploadUrl,void this._resumeUpload()):((0,Tu.log)("Creating a new upload"),void this._createUpload())}},{key:"abort",value:function(t,n){var r=this;if("function"==typeof n)throw new Error("tus: the abort function does not accept a callback since v2 anymore; please use the returned Promise instead");return null!=this._parallelUploads&&this._parallelUploads.forEach((function(e){e.abort(t)})),null!==this._req&&(this._req.abort(),this._source.close()),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),t&&null!=this.url?e.terminate(this.url,this.options).then((function(){return r._removeFromUrlStorage()})):Promise.resolve()}},{key:"_emitHttpError",value:function(e,t,n,r){this._emitError(new Du.default(n,r,e,t))}},{key:"_emitError",value:function(e){var t=this;if(!this._aborted){if(null!=this.options.retryDelays&&(null!=this._offset&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),Gu(e,this._retryAttempt,this.options))){var n=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout((function(){t.start()}),n))}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,n){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(e,t,n)}},{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 n,r=Vu(this.options.metadata);""!==r&&t.setHeader("Upload-Metadata",r),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,n=this._addChunkToRequest(t)):n=this._sendRequest(t,null),n.then((function(n){if(qu(n.getStatus(),200)){var r=n.getHeader("Location");if(null!=r){if(e.url=Yu(e.options.endpoint,r),(0,Tu.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,n):(e._offset=0,e._performUpload())}else e._emitHttpError(t,n,"tus: invalid or missing Location header")}else e._emitHttpError(t,n,"tus: unexpected response while creating upload")})).catch((function(n){e._emitHttpError(t,null,"tus: failed to create upload",n)}))}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(n){var r=n.getStatus();if(!qu(r,200))return qu(r,400)&&e._removeFromUrlStorage(),423===r?void e._emitHttpError(t,n,"tus: upload is currently locked; retry later"):e.options.endpoint?(e.url=null,void e._createUpload()):void e._emitHttpError(t,n,"tus: unable to resume upload (new upload cannot be created without an endpoint)");var o=parseInt(n.getHeader("Upload-Offset"),10);if(isNaN(o))e._emitHttpError(t,n,"tus: invalid or missing offset value");else{var i=parseInt(n.getHeader("Upload-Length"),10);if(!isNaN(i)||e.options.uploadLengthDeferred){if("function"==typeof e.options._onUploadUrlAvailable&&e.options._onUploadUrlAvailable(),o===i)return e._emitProgress(i,i),void e._emitSuccess();e._offset=o,e._performUpload()}else e._emitHttpError(t,n,"tus: invalid or missing length value")}})).catch((function(n){e._emitHttpError(t,null,"tus: failed to resume upload",n)}))}},{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(n){qu(n.getStatus(),200)?t._handleUploadResponse(e,n):t._emitHttpError(e,n,"tus: unexpected response while uploading chunk")})).catch((function(n){t._aborted||t._emitHttpError(e,null,"tus: failed to upload chunk at offset "+t._offset,n)})))}},{key:"_addChunkToRequest",value:function(e){var t=this,n=this._offset,r=this._offset+this.options.chunkSize;return e.setProgressHandler((function(e){t._emitProgress(n+e,t._size)})),e.setHeader("Content-Type","application/offset+octet-stream"),(r===1/0||r>this._size)&&!this.options.uploadLengthDeferred&&(r=this._size),this._source.slice(n,r).then((function(n){var r=n.value,o=n.done;return t.options.uploadLengthDeferred&&o&&(t._size=t._offset+(r&&r.size?r.size:0),e.setHeader("Upload-Length",t._size)),null===r?t._sendRequest(e):(t._emitProgress(t._offset,t._size),t._sendRequest(e,r))}))}},{key:"_handleUploadResponse",value:function(e,t){var n=parseInt(t.getHeader("Upload-Offset"),10);if(isNaN(n))this._emitHttpError(e,t,"tus: invalid or missing offset value");else{if(this._emitProgress(n,this._size),this._emitChunkComplete(n-this._offset,n,this._size),this._offset=n,n==this._size)return this._emitSuccess(),void this._source.close();this._performUpload()}}},{key:"_openRequest",value:function(e,t){var n=Xu(e,t,this.options);return this._req=n,n}},{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,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"function"==typeof this.options.onBeforeRequest&&this.options.onBeforeRequest(e),e.send(n).then((function(n){return"function"==typeof t.options.onAfterResponse&&t.options.onAfterResponse(e,n),n}))}}])&&Hu(t.prototype,n),r&&Hu(t,r),e}();function Vu(e){var t=[];for(var n in e)t.push(n+" "+Nu.Base64.encode(e[n]));return t.join(",")}function qu(e,t){return e>=t&&e<t+100}function Xu(e,t,n){var r=n.httpStack.createRequest(e,t);r.setHeader("Tus-Resumable","1.0.0");var o=n.headers||{};for(var i in o)r.setHeader(i,o[i]);if(n.addRequestId){var a=(0,Mu.default)();r.setHeader("X-Request-ID",a)}return r}function Gu(e,t,n){var r,o=e.originalResponse?e.originalResponse.getStatus():0,i=!qu(o,400)||409===o||423===o;return null!=n.retryDelays&&t<n.retryDelays.length&&null!=e.originalRequest&&i&&(r=!0,"undefined"!=typeof window&&"navigator"in window&&!1===window.navigator.onLine&&(r=!1),r)}function Yu(e,t){return new Bu.default(t,e).toString()}Wu.defaultOptions={endpoint:null,uploadUrl:null,metadata:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,_onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,chunkSize:1/0,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null};var $u=Wu;Fu.default=$u;var Ku={};function Ju(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(Ku,"__esModule",{value:!0}),Ku.default=void 0;var Qu=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(e){return Promise.resolve([])}},{key:"removeUpload",value:function(e){return Promise.resolve()}},{key:"addUpload",value:function(e,t){return Promise.resolve(null)}}])&&Ju(t.prototype,n),e}();Ku.default=Qu;var Zu={};function ec(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.WebStorageUrlStorage=Zu.canStoreURLs=void 0;var tc=!1;try{tc="localStorage"in window;var nc="tusSupport";localStorage.setItem(nc,localStorage.getItem(nc))}catch(Hf){if(Hf.code!==Hf.SECURITY_ERR&&Hf.code!==Hf.QUOTA_EXCEEDED_ERR)throw Hf;tc=!1}var rc=tc;Zu.canStoreURLs=rc;var oc=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"findAllUploads",value:function(){var e=this._findEntries("tus::");return Promise.resolve(e)}},{key:"findUploadsByFingerprint",value:function(e){var t=this._findEntries("tus::".concat(e,"::"));return Promise.resolve(t)}},{key:"removeUpload",value:function(e){return localStorage.removeItem(e),Promise.resolve()}},{key:"addUpload",value:function(e,t){var n=Math.round(1e12*Math.random()),r="tus::".concat(e,"::").concat(n);return localStorage.setItem(r,JSON.stringify(t)),Promise.resolve(r)}},{key:"_findEntries",value:function(e){for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);if(0===r.indexOf(e))try{var o=JSON.parse(localStorage.getItem(r));o.urlStorageKey=r,t.push(o)}catch(Hf){}}return t}}])&&ec(t.prototype,n),e}();Zu.WebStorageUrlStorage=oc;var ic={};function ac(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function lc(e,t,n){return t&&sc(e.prototype,t),n&&sc(e,n),e}Object.defineProperty(ic,"__esModule",{value:!0}),ic.default=void 0;var uc=function(){function e(){ac(this,e)}return lc(e,[{key:"createRequest",value:function(e,t){return new cc(e,t)}},{key:"getName",value:function(){return"XHRHttpStack"}}]),e}();ic.default=uc;var cc=function(){function e(t,n){ac(this,e),this._xhr=new XMLHttpRequest,this._xhr.open(t,n,!0),this._method=t,this._url=n,this._headers={}}return lc(e,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(e,t){this._xhr.setRequestHeader(e,t),this._headers[e]=t}},{key:"getHeader",value:function(e){return this._headers[e]}},{key:"setProgressHandler",value:function(e){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(t){t.lengthComputable&&e(t.loaded)})}},{key:"send",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise((function(n,r){e._xhr.onload=function(){n(new pc(e._xhr))},e._xhr.onerror=function(e){r(e)},e._xhr.send(t)}))}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}]),e}(),pc=function(){function e(t){ac(this,e),this._xhr=t}return lc(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}(),dc={};Object.defineProperty(dc,"__esModule",{value:!0}),dc.default=void 0;dc.default=function(){return"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase()};var hc={};Object.defineProperty(hc,"__esModule",{value:!0}),hc.default=function(e){return new Promise((function(t,n){var r=new XMLHttpRequest;r.responseType="blob",r.onload=function(){var e=r.response;t(e)},r.onerror=function(e){n(e)},r.open("GET",e),r.send()}))};var fc={};Object.defineProperty(fc,"__esModule",{value:!0}),fc.default=void 0;fc.default=function(){return"undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)};var mc={};Object.defineProperty(mc,"__esModule",{value:!0}),mc.default=function(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(){var e=new Uint8Array(r.result);t({value:e})},r.onerror=function(e){n(e)},r.readAsArrayBuffer(e)}))};var vc={};Object.defineProperty(vc,"__esModule",{value:!0}),vc.default=void 0;var gc=wc(dc),yc=wc(hc),bc=wc(fc),_c=wc(mc);function wc(e){return e&&e.__esModule?e:{default:e}}function Cc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function kc(e,t,n){return t&&Sc(e.prototype,t),n&&Sc(e,n),e}var xc=function(){function e(t){Cc(this,e),this._file=t,this.size=t.size}return kc(e,[{key:"slice",value:function(e,t){if((0,bc.default)())return(0,_c.default)(this._file.slice(e,t));var n=this._file.slice(e,t);return Promise.resolve({value:n})}},{key:"close",value:function(){}}]),e}(),Pc=function(){function e(t,n){Cc(this,e),this._chunkSize=n,this._buffer=void 0,this._bufferOffset=0,this._reader=t,this._done=!1}return kc(e,[{key:"slice",value:function(e,t){return e<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(e,t)}},{key:"_readUntilEnoughDataOrDone",value:function(e,t){var n=this,r=t<=this._bufferOffset+Ec(this._buffer);if(this._done||r){var o=this._getDataFromBuffer(e,t),i=null==o&&this._done;return Promise.resolve({value:o,done:i})}return this._reader.read().then((function(r){var o=r.value;return r.done?n._done=!0:void 0===n._buffer?n._buffer=o:n._buffer=function(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){var n=new e.constructor(e.length+t.length);return n.set(e),n.set(t,e.length),n}throw new Error("Unknown data type")}(n._buffer,o),n._readUntilEnoughDataOrDone(e,t)}))}},{key:"_getDataFromBuffer",value:function(e,t){e>this._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);var n=0===Ec(this._buffer);return this._done&&n?null:this._buffer.slice(0,t-e)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}]),e}();function Ec(e){return void 0===e?0:void 0!==e.size?e.size:e.length}var Oc=function(){function e(){Cc(this,e)}return kc(e,[{key:"openFile",value:function(e,t){return(0,gc.default)()&&e&&void 0!==e.uri?(0,yc.default)(e.uri).then((function(e){return new xc(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 xc(e)):"function"==typeof e.read?(t=+t,isFinite(t)?Promise.resolve(new Pc(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}();vc.default=Oc;var Ac={};Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.default=function(e,t){return(0,Nc.default)()?Promise.resolve(function(e,t){var n=e.exif?function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n),t&=t}return t}(JSON.stringify(e.exif)):"noexif";return["tus-rn",e.name||"noname",e.size||"nosize",n,t.endpoint].join("/")}(e,t)):Promise.resolve(["tus-br",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-"))};var Uc,Nc=(Uc=dc)&&Uc.__esModule?Uc:{default:Uc},Tc={};Object.defineProperty(Tc,"__esModule",{value:!0}),Object.defineProperty(Tc,"enableDebugLog",{enumerable:!0,get:function(){return Tu.enableDebugLog}}),Object.defineProperty(Tc,"canStoreURLs",{enumerable:!0,get:function(){return Zu.canStoreURLs}}),Tc.defaultOptions=Tc.Upload=void 0;var Rc=Ic(Fu),Fc=Ic(Ku),Dc=Ic(ic),Mc=Ic(vc),Bc=Ic(Ac);function Ic(e){return e&&e.__esModule?e:{default:e}}function Lc(e){return(Lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function zc(e,t){return(zc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hc(e){return(Hc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Wc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Vc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Wc(Object(n),!0).forEach((function(t){qc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Xc=Vc({},Rc.default.defaultOptions,{httpStack:new Dc.default,fileReader:new Mc.default,urlStorage:Zu.canStoreURLs?new Zu.WebStorageUrlStorage:new Fc.default,fingerprint:Bc.default});Tc.defaultOptions=Xc;var Gc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&zc(e,t)}(i,Rc.default);var t,n,r,o=(r=i,function(){var e,t=Hc(r);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(Hf){return!1}}()){var n=Hc(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){return!t||"object"!==Lc(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,e)});function i(){var e=arguments.length>0&&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,i),t=Vc({},Xc,{},t),o.call(this,e,t)}return t=i,n=[{key:"terminate",value:function(e,t,n){return t=Vc({},Xc,{},t),Rc.default.terminate(e,t,n)}}],null&&jc(t.prototype,null),n&&jc(t,n),i}();Tc.Upload=Gc;var Yc,$c,Kc=window,Jc=Kc.XMLHttpRequest,Qc=Kc.Blob;Jc&&Qc&&Qc.prototype.slice;function Zc(){return(Zc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ep(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tp(e,t){return(tp=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var np=Qe.Provider,rp=Qe.RequestClient,op=Qe.Socket,ip={endpoint:"",uploadUrl:null,metadata:{},uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,overridePatchMethod:!1,headers:{},addRequestId:!1,chunkSize:1/0,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1},ap=($c=Yc=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).type="uploader",r.id=r.opts.id||"Tus",r.title="Tus",r.opts=Zc({},{autoRetry:!0,resume:!0,useFastRemoteRetry:!0,limit:0,retryDelays:[0,1e3,3e3,5e3],withCredentials:!1},n),r.requests=new wl(r.opts.limit),r.uploaders=Object.create(null),r.uploaderEvents=Object.create(null),r.uploaderSockets=Object.create(null),r.handleResetProgress=r.handleResetProgress.bind(ep(r)),r.handleUpload=r.handleUpload.bind(ep(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,tp(t,n);var o=r.prototype;return o.handleResetProgress=function(){var e=Zc({},this.uppy.getState().files);Object.keys(e).forEach((function(t){if(e[t].tus&&e[t].tus.uploadUrl){var n=Zc({},e[t].tus);delete n.uploadUrl,e[t]=Zc({},e[t],{tus:n})}})),this.uppy.setState({files:e})},o.resetUploaderReferences=function(e,t){if(void 0===t&&(t={}),this.uploaders[e]){var n=this.uploaders[e];n.abort(),t.abort&&setTimeout((function(){return n.abort(!0)}),1e3),this.uploaders[e]=null}this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null),this.uploaderSockets[e]&&(this.uploaderSockets[e].close(),this.uploaderSockets[e]=null)},o.upload=function(e,t,n){var r=this;return this.resetUploaderReferences(e.id),new Promise((function(t,n){r.uppy.emit("upload-started",e);var o,i=Zc({},r.opts,e.tus||{}),a=Zc({},ip,i);delete a.resume,i.resume&&(a.storeFingerprintForResuming=!0),a.fingerprint=(o=e,function(e,t){if("undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova)||"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase())return Tc.defaultOptions.fingerprint(e,t);var n=["tus",o.id,t.endpoint].join("-");return Promise.resolve(n)}),a.onBeforeRequest=function(e){e.getUnderlyingObject().withCredentials=!!i.withCredentials,"function"==typeof i.onBeforeRequest&&i.onBeforeRequest(e)},a.onError=function(t){r.uppy.log(t);var o=t.originalRequest?t.originalRequest.getUnderlyingObject():null;El(o)&&(t=new Fe(t,o)),r.resetUploaderReferences(e.id),c.done(),r.uppy.emit("upload-error",e,t),n(t)},a.onProgress=function(t,n){r.onReceiveUploadUrl(e,u.url),r.uppy.emit("upload-progress",e,{uploader:r,bytesUploaded:t,bytesTotal:n})},a.onSuccess=function(){var n={uploadURL:u.url};r.resetUploaderReferences(e.id),c.done(),r.uppy.emit("upload-success",e,n),u.url&&r.uppy.log("Download "+u.file.name+" from "+u.url),t(u)};var s=function(e,t,n){C(e,t)&&!C(e,n)&&(e[n]=e[t])},l={};(Array.isArray(i.metaFields)?i.metaFields:Object.keys(e.meta)).forEach((function(t){l[t]=e.meta[t]})),s(l,"type","filetype"),s(l,"name","filename"),a.metadata=l;var u=new Tc.Upload(e.data,a);r.uploaders[e.id]=u,r.uploaderEvents[e.id]=new xl(r.uppy),i.resume&&u.findPreviousUploads().then((function(t){var n=t[0];n&&(r.uppy.log("[Tus] Resuming upload of "+e.id+" started at "+n.creationTime),u.resumeFromPreviousUpload(n))}));var c=r.requests.run((function(){return e.isPaused||Promise.resolve().then((function(){u.start()})),function(){}}));r.onFileRemove(e.id,(function(n){c.abort(),r.resetUploaderReferences(e.id,{abort:!!u.url}),t("upload "+n+" was removed")})),r.onPause(e.id,(function(e){e?(c.abort(),u.abort()):(c.abort(),c=r.requests.run((function(){return u.start(),function(){}})))})),r.onPauseAll(e.id,(function(){c.abort(),u.abort()})),r.onCancelAll(e.id,(function(){c.abort(),r.resetUploaderReferences(e.id,{abort:!!u.url}),t("upload "+e.id+" was canceled")})),r.onResumeAll(e.id,(function(){c.abort(),e.error&&u.abort(),c=r.requests.run((function(){return u.start(),function(){}}))}))})).catch((function(t){throw r.uppy.emit("upload-error",e,t),t}))},o.uploadRemote=function(e,t,n){var r=this;this.resetUploaderReferences(e.id);var o=Zc({},this.opts);return e.tus&&Zc(o,e.tus),this.uppy.emit("upload-started",e),this.uppy.log(e.remote.url),e.serverToken?this.connectToServerSocket(e):new Promise((function(t,n){new(e.remote.providerOptions.provider?np:rp)(r.uppy,e.remote.providerOptions).post(e.remote.url,Zc({},e.remote.body,{endpoint:o.endpoint,uploadUrl:o.uploadUrl,protocol:"tus",size:e.data.size,headers:o.headers,metadata:e.meta})).then((function(t){return r.uppy.setFileState(e.id,{serverToken:t.token}),e=r.uppy.getFile(e.id),r.connectToServerSocket(e)})).then((function(){t()})).catch((function(t){r.uppy.emit("upload-error",e,t),n(t)}))}))},o.connectToServerSocket=function(e){var t=this;return new Promise((function(n,r){var o=e.serverToken,i=kl(e.remote.companionUrl),a=new op({target:i+"/api/"+o,autoOpen:!1});t.uploaderSockets[e.id]=a,t.uploaderEvents[e.id]=new xl(t.uppy),t.onFileRemove(e.id,(function(){s.abort(),a.send("pause",{}),a.send("cancel",{}),t.resetUploaderReferences(e.id),n("upload "+e.id+" was removed")})),t.onPause(e.id,(function(e){e?(s.abort(),a.send("pause",{})):(s.abort(),s=t.requests.run((function(){return a.send("resume",{}),function(){}})))})),t.onPauseAll(e.id,(function(){s.abort(),a.send("pause",{})})),t.onCancelAll(e.id,(function(){s.abort(),a.send("pause",{}),a.send("cancel",{}),t.resetUploaderReferences(e.id),n("upload "+e.id+" was canceled")})),t.onResumeAll(e.id,(function(){s.abort(),e.error&&a.send("pause",{}),s=t.requests.run((function(){return a.send("resume",{}),function(){}}))})),t.onRetry(e.id,(function(){a.isOpen&&(a.send("pause",{}),a.send("resume",{}))})),t.onRetryAll(e.id,(function(){a.isOpen&&(a.send("pause",{}),a.send("resume",{}))})),a.on("progress",(function(n){return Sl(t,n,e)})),a.on("error",(function(n){var o=n.error.message,i=Zc(new Error(o),{cause:n.error});t.opts.useFastRemoteRetry?a.close():(t.resetUploaderReferences(e.id),t.uppy.setFileState(e.id,{serverToken:null})),t.uppy.emit("upload-error",e,i),s.done(),r(i)})),a.on("success",(function(r){var o={uploadURL:r.url};t.uppy.emit("upload-success",e,o),t.resetUploaderReferences(e.id),s.done(),n()}));var s=t.requests.run((function(){return a.open(),e.isPaused&&a.send("pause",{}),function(){}}))}))},o.onReceiveUploadUrl=function(e,t){var n=this.uppy.getFile(e.id);n&&(n.tus&&n.tus.uploadUrl===t||(this.uppy.log("[Tus] Storing upload url"),this.uppy.setFileState(n.id,{tus:Zc({},n.tus,{uploadUrl:t})})))},o.onFileRemove=function(e,t){this.uploaderEvents[e].on("file-removed",(function(n){e===n.id&&t(n.id)}))},o.onPause=function(e,t){this.uploaderEvents[e].on("upload-pause",(function(n,r){e===n&&t(r)}))},o.onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",(function(n){e===n&&t()}))},o.onRetryAll=function(e,t){var n=this;this.uploaderEvents[e].on("retry-all",(function(r){n.uppy.getFile(e)&&t()}))},o.onPauseAll=function(e,t){var n=this;this.uploaderEvents[e].on("pause-all",(function(){n.uppy.getFile(e)&&t()}))},o.onCancelAll=function(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",(function(){n.uppy.getFile(e)&&t()}))},o.onResumeAll=function(e,t){var n=this;this.uploaderEvents[e].on("resume-all",(function(){n.uppy.getFile(e)&&t()}))},o.uploadFiles=function(e){var t=this,n=e.map((function(n,r){var o=r+1,i=e.length;return"error"in n&&n.error?Promise.reject(new Error(n.error)):n.isRemote?(n.progress.uploadStarted&&n.isRestored||t.uppy.emit("upload-started",n),t.uploadRemote(n,o,i)):(n.progress.uploadStarted&&n.isRestored||t.uppy.emit("upload-started",n),t.upload(n,o,i))}));return Cl(n)},o.handleUpload=function(e){var t=this;if(0===e.length)return this.uppy.log("[Tus] No files to upload"),Promise.resolve();0===this.opts.limit&&this.uppy.log("[Tus] 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/tus/#limit-0","warning"),this.uppy.log("[Tus] Uploading...");var n=e.map((function(e){return t.uppy.getFile(e)}));return this.uploadFiles(n).then((function(){return null}))},o.install=function(){this.uppy.setState({capabilities:Zc({},this.uppy.getState().capabilities,{resumableUploads:!0})}),this.uppy.addUploader(this.handleUpload),this.uppy.on("reset-progress",this.handleResetProgress),this.opts.autoRetry&&this.uppy.on("back-online",this.uppy.retryAll)},o.uninstall=function(){this.uppy.setState({capabilities:Zc({},this.uppy.getState().capabilities,{resumableUploads:!1})}),this.uppy.removeUploader(this.handleUpload),this.opts.autoRetry&&this.uppy.off("back-online",this.uppy.retryAll)},r}(ue.Plugin),Yc.VERSION="1.9.2",$c),sp=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,lp=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],up=function(e){var t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));for(var o=sp.exec(e||""),i={},a=14;a--;)i[lp[a]]=o[a]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i},cp=1e3,pp=6e4,dp=864e5;function hp(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var fp={};function mp(e){var t;function n(){if(n.enabled){var e=n,r=+new Date,o=r-(t||r);e.diff=o,e.prev=t,e.curr=r,t=r;for(var i=new Array(arguments.length),a=0;a<i.length;a++)i[a]=arguments[a];i[0]=fp.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var s=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,(function(t,n){if("%%"===t)return t;s++;var r=fp.formatters[n];if("function"==typeof r){var o=i[s];t=r.call(e,o),i.splice(s,1),s--}return t})),fp.formatArgs.call(e,i),(n.log||fp.log||console.log.bind(console)).apply(e,i)}}return n.namespace=e,n.enabled=fp.enabled(e),n.useColors=fp.useColors(),n.color=function(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return fp.colors[Math.abs(n)%fp.colors.length]}(e),n.destroy=vp,"function"==typeof fp.init&&fp.init(n),fp.instances.push(n),n}function vp(){var e=fp.instances.indexOf(this);return-1!==e&&(fp.instances.splice(e,1),!0)}(fp=fp=mp.debug=mp.default=mp).coerce=function(e){return e instanceof Error?e.stack||e.message:e},fp.disable=function(){fp.enable("")},fp.enable=function(e){var t;fp.save(e),fp.names=[],fp.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length;for(t=0;t<r;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?fp.skips.push(new RegExp("^"+e.substr(1)+"$")):fp.names.push(new RegExp("^"+e+"$")));for(t=0;t<fp.instances.length;t++){var o=fp.instances[t];o.enabled=fp.enabled(o.namespace)}},fp.enabled=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=fp.skips.length;t<n;t++)if(fp.skips[t].test(e))return!1;for(t=0,n=fp.names.length;t<n;t++)if(fp.names[t].test(e))return!0;return!1},fp.humanize=function(e,t){t=t||{};var n,r=typeof e;if("string"===r&&e.length>0)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 n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"days":case"day":case"d":return n*dp;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*n;case"minutes":case"minute":case"mins":case"min":case"m":return n*pp;case"seconds":case"second":case"secs":case"sec":case"s":return n*cp;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===r&&!1===isNaN(e))return t.long?hp(n=e,dp,"day")||hp(n,36e5,"hour")||hp(n,pp,"minute")||hp(n,cp,"second")||n+" ms":function(e){return e>=dp?Math.round(e/dp)+"d":e>=36e5?Math.round(e/36e5)+"h":e>=pp?Math.round(e/pp)+"m":e>=cp?Math.round(e/cp)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},fp.instances=[],fp.names=[],fp.skips=[],fp.formatters={};var gp={};(function(e){(function(){function t(){var t;try{t=gp.storage.debug}catch(Hf){}return!t&&void 0!==e&&"env"in e&&(t=e.env.DEBUG),t}(gp=gp=fp).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},gp.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+gp.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(o=r))})),e.splice(o,0,n)}},gp.save=function(e){try{null==e?gp.storage.removeItem("debug"):gp.storage.debug=e}catch(Hf){}},gp.load=t,gp.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+)/))},gp.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(Hf){}}(),gp.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"],gp.formatters.j=function(e){try{return JSON.stringify(e)}catch(Cd){return"[UnexpectedJSONParseError]: "+Cd.message}},gp.enable(t())}).call(this)}).call(this,e);var yp=gp("socket.io-client:url"),bp=function(e,t){var n=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)||(yp("protocol-less url %s",e),e=void 0!==t?t.protocol+"//"+e:"https://"+e),yp("parse %s",e),n=up(e)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";var r=-1!==n.host.indexOf(":")?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+r+":"+n.port,n.href=n.protocol+"://"+r+(t&&t.port===n.port?"":":"+n.port),n},_p={exports:{}};function wp(e){if(e)return function(e){for(var t in wp.prototype)e[t]=wp.prototype[t];return e}(e)}_p.exports=wp,wp.prototype.on=wp.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},wp.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},wp.prototype.off=wp.prototype.removeListener=wp.prototype.removeAllListeners=wp.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},wp.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},wp.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},wp.prototype.hasListeners=function(e){return!!this.listeners(e).length},_p=_p.exports;var Cp={}.toString,Sp=Array.isArray||function(e){return"[object Array]"==Cp.call(e)},kp={};(function(e){(function(){kp=function(o){return t&&e.isBuffer(o)||n&&(o instanceof ArrayBuffer||r(o))};var t="function"==typeof e&&"function"==typeof e.isBuffer,n="function"==typeof ArrayBuffer,r=function(e){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer}}).call(this)}).call(this,a({}).Buffer);var xp={},Pp=Object.prototype.toString,Ep="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Pp.call(Blob),Op="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===Pp.call(File);xp.deconstructPacket=function(e){var t=[],n=e.data,r=e;return r.data=function e(t,n){if(!t)return t;if(kp(t)){var r={_placeholder:!0,num:n.length};return n.push(t),r}if(Sp(t)){for(var o=new Array(t.length),i=0;i<t.length;i++)o[i]=e(t[i],n);return o}if("object"==typeof t&&!(t instanceof Date)){o={};for(var a in t)o[a]=e(t[a],n);return o}return t}(n,t),r.attachments=t.length,{packet:r,buffers:t}},xp.reconstructPacket=function(e,t){return e.data=function e(t,n){if(!t)return t;if(t&&t._placeholder)return n[t.num];if(Sp(t))for(var r=0;r<t.length;r++)t[r]=e(t[r],n);else if("object"==typeof t)for(var o in t)t[o]=e(t[o],n);return t}(e.data,t),e.attachments=void 0,e},xp.removeBlobs=function(e,t){var n=0,r=e;!function e(o,i,a){if(!o)return o;if(Ep&&o instanceof Blob||Op&&o instanceof File){n++;var s=new FileReader;s.onload=function(){a?a[i]=this.result:r=this.result,--n||t(r)},s.readAsArrayBuffer(o)}else if(Sp(o))for(var l=0;l<o.length;l++)e(o[l],l,o);else if("object"==typeof o&&!kp(o))for(var u in o)e(o[u],u,o)}(r),n||t(r)};var Ap={},Up=gp("socket.io-parser");function Np(){}Ap.protocol=4,Ap.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],Ap.CONNECT=0,Ap.DISCONNECT=1,Ap.EVENT=2,Ap.ACK=3,Ap.ERROR=4,Ap.BINARY_EVENT=5,Ap.BINARY_ACK=6,Ap.Encoder=Np,Ap.Decoder=Fp;var Tp=Ap.ERROR+'"encode error"';function Rp(e){var t=""+e.type;if(Ap.BINARY_EVENT!==e.type&&Ap.BINARY_ACK!==e.type||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data){var n=function(e){try{return JSON.stringify(e)}catch(Hf){return!1}}(e.data);if(!1===n)return Tp;t+=n}return Up("encoded %j as %s",e,t),t}function Fp(){this.reconstructor=null}function Dp(e){this.reconPack=e,this.buffers=[]}function Mp(e){return{type:Ap.ERROR,data:"parser error: "+e}}Np.prototype.encode=function(e,t){Up("encoding packet %j",e),Ap.BINARY_EVENT===e.type||Ap.BINARY_ACK===e.type?function(e,t){xp.removeBlobs(e,(function(e){var n=xp.deconstructPacket(e),r=Rp(n.packet),o=n.buffers;o.unshift(r),t(o)}))}(e,t):t([Rp(e)])},_p(Fp.prototype),Fp.prototype.add=function(e){var t;if("string"==typeof e)t=function(e){var t=0,n={type:Number(e.charAt(0))};if(null==Ap.types[n.type])return Mp("unknown packet type "+n.type);if(Ap.BINARY_EVENT===n.type||Ap.BINARY_ACK===n.type){for(var r=t+1;"-"!==e.charAt(++t)&&t!=e.length;);var o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){for(r=t+1;++t;){if(","===(a=e.charAt(t)))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";var i=e.charAt(t+1);if(""!==i&&Number(i)==i){for(r=t+1;++t;){var a;if(null==(a=e.charAt(t))||Number(a)!=a){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){var s=function(e){try{return JSON.parse(e)}catch(Hf){return!1}}(e.substr(t));if(!(!1!==s&&(n.type===Ap.ERROR||Sp(s))))return Mp("invalid payload");n.data=s}return Up("decoded %s as %j",e,n),n}(e),Ap.BINARY_EVENT===t.type||Ap.BINARY_ACK===t.type?(this.reconstructor=new Dp(t),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",t)):this.emit("decoded",t);else{if(!kp(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,this.emit("decoded",t))}},Fp.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},Dp.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=xp.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},Dp.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]};var Bp={exports:{}};function Ip(e){if(e)return function(e){for(var t in Ip.prototype)e[t]=Ip.prototype[t];return e}(e)}Bp.exports=Ip,Ip.prototype.on=Ip.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Ip.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},Ip.prototype.off=Ip.prototype.removeListener=Ip.prototype.removeAllListeners=Ip.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return this},Ip.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t);return this},Ip.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},Ip.prototype.hasListeners=function(e){return!!this.listeners(e).length},Bp=Bp.exports;var Lp=[].indexOf,jp=function(e,t){if(Lp)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},zp={encode:function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},decode:function(e){for(var t={},n=e.split("&"),r=0,o=n.length;r<o;r++){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}},Hp=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t},Wp={}.toString,Vp=Array.isArray||function(e){return"[object Array]"==Wp.call(e)},qp={};(function(e){(function(){var t=Object.prototype.toString,n="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===t.call(Blob),r="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===t.call(File);qp=function t(o){if(!o||"object"!=typeof o)return!1;if(Vp(o)){for(var i=0,a=o.length;i<a;i++)if(t(o[i]))return!0;return!1}if("function"==typeof e&&e.isBuffer&&e.isBuffer(o)||"function"==typeof ArrayBuffer&&o instanceof ArrayBuffer||n&&o instanceof Blob||r&&o instanceof File)return!0;if(o.toJSON&&"function"==typeof o.toJSON&&1===arguments.length)return t(o.toJSON(),!0);for(var s in o)if(Object.prototype.hasOwnProperty.call(o,s)&&t(o[s]))return!0;return!1}}).call(this)}).call(this,a({}).Buffer);var Xp=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(t<0&&(t+=r),n<0&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(e),i=new Uint8Array(n-t),a=t,s=0;a<n;a++,s++)i[s]=o[a];return i.buffer};function Gp(){}var Yp,$p,Kp,Jp=String.fromCharCode;function Qp(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function Zp(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function ed(e,t){return Jp(e>>t&63|128)}function td(e,t){if(0==(4294967168&e))return Jp(e);var n="";return 0==(4294965248&e)?n=Jp(e>>6&31|192):0==(4294901760&e)?(Zp(e,t)||(e=65533),n=Jp(e>>12&15|224),n+=ed(e,6)):0==(4292870144&e)&&(n=Jp(e>>18&7|240),n+=ed(e,12),n+=ed(e,6)),n+Jp(63&e|128)}function nd(){if(Kp>=$p)throw Error("Invalid byte index");var e=255&Yp[Kp];if(Kp++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function rd(e){var t,n;if(Kp>$p)throw Error("Invalid byte index");if(Kp==$p)return!1;if(t=255&Yp[Kp],Kp++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|nd())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|nd()<<6|nd())>=2048)return Zp(n,e)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|nd()<<12|nd()<<6|nd())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}var od=function(e,t){for(var n=!1!==(t=t||{}).strict,r=Qp(e),o=r.length,i=-1,a="";++i<o;)a+=td(r[i],n);return a},id=function(e,t){var n=!1!==(t=t||{}).strict;Yp=Qp(e),$p=Yp.length,Kp=0;for(var r,o=[];!1!==(r=rd(n));)o.push(r);return function(e){for(var t,n=e.length,r=-1,o="";++r<n;)(t=e[r])>65535&&(o+=Jp((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=Jp(t);return o}(o)},ad={};!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),n=0;n<e.length;n++)t[e.charCodeAt(n)]=n;ad.encode=function(t){var n,r=new Uint8Array(t),o=r.length,i="";for(n=0;n<o;n+=3)i+=e[r[n]>>2],i+=e[(3&r[n])<<4|r[n+1]>>4],i+=e[(15&r[n+1])<<2|r[n+2]>>6],i+=e[63&r[n+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i},ad.decode=function(e){var n,r,o,i,a,s=.75*e.length,l=e.length,u=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var c=new ArrayBuffer(s),p=new Uint8Array(c);for(n=0;n<l;n+=4)r=t[e.charCodeAt(n)],o=t[e.charCodeAt(n+1)],i=t[e.charCodeAt(n+2)],a=t[e.charCodeAt(n+3)],p[u++]=r<<2|o>>4,p[u++]=(15&o)<<4|i>>2,p[u++]=(3&i)<<6|63&a;return c}}();var sd={},ld=void 0!==ld?ld:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,ud=function(){try{return 2===new Blob(["hi"]).size}catch(Hf){return!1}}(),cd=ud&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(Hf){return!1}}(),pd=ld&&ld.prototype.append&&ld.prototype.getBlob;function dd(e){return e.map((function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var n=new Uint8Array(e.byteLength);n.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=n.buffer}return t}return e}))}function hd(e,t){t=t||{};var n=new ld;return dd(e).forEach((function(e){n.append(e)})),t.type?n.getBlob(t.type):n.getBlob()}function fd(e,t){return new Blob(dd(e),t||{})}"undefined"!=typeof Blob&&(hd.prototype=Blob.prototype,fd.prototype=Blob.prototype),sd=ud?cd?Blob:fd:pd?hd:void 0;var md,vd={};"undefined"!=typeof ArrayBuffer&&(md=ad);var gd="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),yd="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),bd=gd||yd;vd.protocol=3;var _d=vd.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},wd=Hp(_d),Cd={type:"error",data:"parser error"};function Sd(e,t,n){for(var r=new Array(e.length),o=function(e,t,n){var r=!1;return n=n||Gp,o.count=e,0===e?t():o;function o(e,i){if(o.count<=0)throw new Error("after called too many times");--o.count,e?(r=!0,t(e),t=n):0!==o.count||r||t(null,i)}}(e.length,n),i=function(e,n,o){t(n,(function(t,n){r[e]=n,o(t,r)}))},a=0;a<e.length;a++)i(a,e[a],o)}vd.encodePacket=function(e,t,n,r){"function"==typeof t&&(r=t,t=!1),"function"==typeof n&&(r=n,n=null);var o=void 0===e.data?void 0:e.data.buffer||e.data;if("undefined"!=typeof ArrayBuffer&&o instanceof ArrayBuffer)return function(e,t,n){if(!t)return vd.encodeBase64Packet(e,n);var r=e.data,o=new Uint8Array(r),i=new Uint8Array(1+r.byteLength);i[0]=_d[e.type];for(var a=0;a<o.length;a++)i[a+1]=o[a];return n(i.buffer)}(e,t,r);if(void 0!==sd&&o instanceof sd)return function(e,t,n){if(!t)return vd.encodeBase64Packet(e,n);if(bd)return function(e,t,n){if(!t)return vd.encodeBase64Packet(e,n);var r=new FileReader;return r.onload=function(){vd.encodePacket({type:e.type,data:r.result},t,!0,n)},r.readAsArrayBuffer(e.data)}(e,t,n);var r=new Uint8Array(1);return r[0]=_d[e.type],n(new sd([r.buffer,e.data]))}(e,t,r);if(o&&o.base64)return function(e,t){return t("b"+vd.packets[e.type]+e.data.data)}(e,r);var i=_d[e.type];return void 0!==e.data&&(i+=n?od(String(e.data),{strict:!1}):String(e.data)),r(""+i)},vd.encodeBase64Packet=function(e,t){var n,r="b"+vd.packets[e.type];if(void 0!==sd&&e.data instanceof sd){var o=new FileReader;return o.onload=function(){var e=o.result.split(",")[1];t(r+e)},o.readAsDataURL(e.data)}try{n=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(Hf){for(var i=new Uint8Array(e.data),a=new Array(i.length),s=0;s<i.length;s++)a[s]=i[s];n=String.fromCharCode.apply(null,a)}return r+=btoa(n),t(r)},vd.decodePacket=function(e,t,n){if(void 0===e)return Cd;if("string"==typeof e){if("b"===e.charAt(0))return vd.decodeBase64Packet(e.substr(1),t);if(n&&!1===(e=function(e){try{e=id(e,{strict:!1})}catch(Hf){return!1}return e}(e)))return Cd;var r=e.charAt(0);return Number(r)==r&&wd[r]?e.length>1?{type:wd[r],data:e.substring(1)}:{type:wd[r]}:Cd}r=new Uint8Array(e)[0];var o=Xp(e,1);return sd&&"blob"===t&&(o=new sd([o])),{type:wd[r],data:o}},vd.decodeBase64Packet=function(e,t){var n=wd[e.charAt(0)];if(!md)return{type:n,data:{base64:!0,data:e.substr(1)}};var r=md.decode(e.substr(1));return"blob"===t&&sd&&(r=new sd([r])),{type:n,data:r}},vd.encodePayload=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=qp(e);return t&&r?sd&&!bd?vd.encodePayloadAsBlob(e,n):vd.encodePayloadAsArrayBuffer(e,n):e.length?void Sd(e,(function(e,n){vd.encodePacket(e,!!r&&t,!1,(function(e){n(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return n(t.join(""))})):n("0:")},vd.decodePayload=function(e,t,n){if("string"!=typeof e)return vd.decodePayloadAsBinary(e,t,n);var r;if("function"==typeof t&&(n=t,t=null),""===e)return n(Cd,0,1);for(var o,i,a="",s=0,l=e.length;s<l;s++){var u=e.charAt(s);if(":"===u){if(""===a||a!=(o=Number(a)))return n(Cd,0,1);if(a!=(i=e.substr(s+1,o)).length)return n(Cd,0,1);if(i.length){if(r=vd.decodePacket(i,t,!1),Cd.type===r.type&&Cd.data===r.data)return n(Cd,0,1);if(!1===n(r,s+o,l))return}s+=o,a=""}else a+=u}return""!==a?n(Cd,0,1):void 0},vd.encodePayloadAsArrayBuffer=function(e,t){if(!e.length)return t(new ArrayBuffer(0));Sd(e,(function(e,t){vd.encodePacket(e,!0,!0,(function(e){return t(null,e)}))}),(function(e,n){var r=n.reduce((function(e,t){var n;return e+(n="string"==typeof t?t.length:t.byteLength).toString().length+n+2}),0),o=new Uint8Array(r),i=0;return n.forEach((function(e){var t="string"==typeof e,n=e;if(t){for(var r=new Uint8Array(e.length),a=0;a<e.length;a++)r[a]=e.charCodeAt(a);n=r.buffer}o[i++]=t?0:1;var s=n.byteLength.toString();for(a=0;a<s.length;a++)o[i++]=parseInt(s[a]);for(o[i++]=255,r=new Uint8Array(n),a=0;a<r.length;a++)o[i++]=r[a]})),t(o.buffer)}))},vd.encodePayloadAsBlob=function(e,t){Sd(e,(function(e,t){vd.encodePacket(e,!0,!0,(function(e){var n=new Uint8Array(1);if(n[0]=1,"string"==typeof e){for(var r=new Uint8Array(e.length),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);e=r.buffer,n[0]=0}var i=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),a=new Uint8Array(i.length+1);for(o=0;o<i.length;o++)a[o]=parseInt(i[o]);if(a[i.length]=255,sd){var s=new sd([n.buffer,a.buffer,e]);t(null,s)}}))}),(function(e,n){return t(new sd(n))}))},vd.decodePayloadAsBinary=function(e,t,n){"function"==typeof t&&(n=t,t=null);for(var r=e,o=[];r.byteLength>0;){for(var i=new Uint8Array(r),a=0===i[0],s="",l=1;255!==i[l];l++){if(s.length>310)return n(Cd,0,1);s+=i[l]}r=Xp(r,2+s.length),s=parseInt(s);var u=Xp(r,0,s);if(a)try{u=String.fromCharCode.apply(null,new Uint8Array(u))}catch(Hf){var c=new Uint8Array(u);for(u="",l=0;l<c.length;l++)u+=String.fromCharCode(c[l])}o.push(u),r=Xp(r,s)}var p=o.length;o.forEach((function(e,r){n(vd.decodePacket(e,t,!0),r,p)}))};var kd={};function xd(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.isReactNative=e.isReactNative,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}kd=xd,Bp(xd.prototype),xd.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},xd.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},xd.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},xd.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},xd.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},xd.prototype.onData=function(e){var t=vd.decodePacket(e,this.socket.binaryType);this.onPacket(t)},xd.prototype.onPacket=function(e){this.emit("packet",e)},xd.prototype.onClose=function(){this.readyState="closed",this.emit("close")};var Pd={};try{Pd="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(Cd){Pd=!1}var Ed,Od=function(e){var t=e.xdomain,n=e.xscheme,r=e.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!t||Pd))return new XMLHttpRequest}catch(Hf){}try{if("undefined"!=typeof XDomainRequest&&!n&&r)return new XDomainRequest}catch(Hf){}if(!t)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(Hf){}},Ad=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},Ud={},Nd="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Td={},Rd=0,Fd=0;function Dd(e){var t="";do{t=Nd[e%64]+t,e=Math.floor(e/64)}while(e>0);return t}function Md(){var e=Dd(+new Date);return e!==Ed?(Rd=0,Ed=e):e+"."+Dd(Rd++)}for(;Fd<64;Fd++)Td[Nd[Fd]]=Fd;Md.encode=Dd,Md.decode=function(e){var t=0;for(Fd=0;Fd<e.length;Fd++)t=64*t+Td[e.charAt(Fd)];return t},Ud=Md;var Bd=gp("engine.io-client:polling"),Id=jd,Ld=null!=new Od({xdomain:!1}).responseType;function jd(e){var t=e&&e.forceBase64;Ld&&!t||(this.supportsBinary=!1),kd.call(this,e)}Ad(jd,kd),jd.prototype.name="polling",jd.prototype.doOpen=function(){this.poll()},jd.prototype.pause=function(e){var t=this;function n(){Bd("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(Bd("we are currently polling - waiting to pause"),r++,this.once("pollComplete",(function(){Bd("pre-pause polling complete"),--r||n()}))),this.writable||(Bd("we are currently writing - waiting to pause"),r++,this.once("drain",(function(){Bd("pre-pause writing complete"),--r||n()})))}else n()},jd.prototype.poll=function(){Bd("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},jd.prototype.onData=function(e){var t=this;Bd("polling got data %s",e),vd.decodePayload(e,this.socket.binaryType,(function(e,n,r){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():Bd('ignoring poll - transport state "%s"',this.readyState))},jd.prototype.doClose=function(){var e=this;function t(){Bd("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(Bd("transport open - closing"),t()):(Bd("transport not open - deferring close"),this.once("open",t))},jd.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};vd.encodePayload(e,this.supportsBinary,(function(e){t.doWrite(e,n)}))},jd.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=Ud()),this.supportsBinary||e.sid||(e.b64=1),e=zp.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e};var zd={},Hd=gp("engine.io-client:polling-xhr");function Wd(){}function Vd(e){if(Id.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,"undefined"!=typeof location){var t="https:"===location.protocol,n=location.port;n||(n=t?443:80),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}}function qd(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}if((zd=Vd).Request=qd,Ad(Vd,Id),Vd.prototype.supportsBinary=!0,Vd.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new qd(e)},Vd.prototype.doWrite=function(e,t){var n="string"!=typeof e&&void 0!==e,r=this.request({method:"POST",data:e,isBinary:n}),o=this;r.on("success",t),r.on("error",(function(e){o.onError("xhr post error",e)})),this.sendXhr=r},Vd.prototype.doPoll=function(){Hd("xhr poll");var e=this.request(),t=this;e.on("data",(function(e){t.onData(e)})),e.on("error",(function(e){t.onError("xhr poll error",e)})),this.pollXhr=e},Bp(qd.prototype),qd.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new Od(e),n=this;try{Hd("xhr open %s: %s",this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var r in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(r)&&t.setRequestHeader(r,this.extraHeaders[r])}catch(Hf){}if("POST"===this.method)try{this.isBinary?t.setRequestHeader("Content-type","application/octet-stream"):t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(Hf){}try{t.setRequestHeader("Accept","*/*")}catch(Hf){}"withCredentials"in t&&(t.withCredentials=!0),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){n.onLoad()},t.onerror=function(){n.onError(t.responseText)}):t.onreadystatechange=function(){if(2===t.readyState)try{var e=t.getResponseHeader("Content-Type");n.supportsBinary&&"application/octet-stream"===e&&(t.responseType="arraybuffer")}catch(Hf){}4===t.readyState&&(200===t.status||1223===t.status?n.onLoad():setTimeout((function(){n.onError(t.status)}),0))},Hd("xhr data %s",this.data),t.send(this.data)}catch(Hf){return void setTimeout((function(){n.onError(Hf)}),0)}"undefined"!=typeof document&&(this.index=qd.requestsCount++,qd.requests[this.index]=this)},qd.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},qd.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},qd.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},qd.prototype.cleanup=function(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=Wd:this.xhr.onreadystatechange=Wd,e)try{this.xhr.abort()}catch(Hf){}"undefined"!=typeof document&&delete qd.requests[this.index],this.xhr=null}},qd.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(Hf){}e="application/octet-stream"===t&&this.xhr.response||this.xhr.responseText}catch(Hf){this.onError(Hf)}null!=e&&this.onData(e)},qd.prototype.hasXDR=function(){return"undefined"!=typeof XDomainRequest&&!this.xs&&this.enablesXDR},qd.prototype.abort=function(){this.cleanup()},qd.requestsCount=0,qd.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",Gd);else if("function"==typeof addEventListener){var Xd="onpagehide"in self?"pagehide":"unload";addEventListener(Xd,Gd,!1)}function Gd(){for(var e in qd.requests)qd.requests.hasOwnProperty(e)&&qd.requests[e].abort()}var Yd={};(function(e){(function(){Yd=a;var t,n=/\n/g,r=/\\n/g;function o(){}function i(){return"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:{}}function a(e){if(Id.call(this,e),this.query=this.query||{},!t){var n=i();t=n.___eio=n.___eio||[]}this.index=t.length;var r=this;t.push((function(e){r.onData(e)})),this.query.j=this.index,"function"==typeof addEventListener&&addEventListener("beforeunload",(function(){r.script&&(r.script.onerror=o)}),!1)}Ad(a,Id),a.prototype.supportsBinary=!1,a.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),Id.prototype.doClose.call(this)},a.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout((function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)}),100)},a.prototype.doWrite=function(e,t){var o=this;if(!this.form){var i,a=document.createElement("form"),s=document.createElement("textarea"),l=this.iframeId="eio_iframe_"+this.index;a.className="socketio",a.style.position="absolute",a.style.top="-1000px",a.style.left="-1000px",a.target=l,a.method="POST",a.setAttribute("accept-charset","utf-8"),s.name="d",a.appendChild(s),document.body.appendChild(a),this.form=a,this.area=s}function u(){c(),t()}function c(){if(o.iframe)try{o.form.removeChild(o.iframe)}catch(Hf){o.onError("jsonp polling iframe removal error",Hf)}try{var e='<iframe src="javascript:0" name="'+o.iframeId+'">';i=document.createElement(e)}catch(Hf){(i=document.createElement("iframe")).name=o.iframeId,i.src="javascript:0"}i.id=o.iframeId,o.form.appendChild(i),o.iframe=i}this.form.action=this.uri(),c(),e=e.replace(r,"\\\n"),this.area.value=e.replace(n,"\\n");try{this.form.submit()}catch(Hf){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===o.iframe.readyState&&u()}:this.iframe.onload=u}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var $d={};(function(e){(function(){var t,n,r=gp("engine.io-client:websocket");if("undefined"!=typeof WebSocket)t=WebSocket;else if("undefined"!=typeof self)t=self.WebSocket||self.MozWebSocket;else try{n=i({})}catch(Hf){}var o=t||n;function a(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=t&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(o=n),kd.call(this,e)}$d=a,Ad(a,kd),a.prototype.name="websocket",a.prototype.supportsBinary=!0,a.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new o(e,t):new o(e):new o(e,t,n)}catch(Cd){return this.emit("error",Cd)}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()}},a.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)}},a.prototype.write=function(t){var n=this;this.writable=!1;for(var o=t.length,i=0,a=o;i<a;i++)!function(t){vd.encodePacket(t,n.supportsBinary,(function(i){if(!n.usingBrowserWebSocket){var a={};t.options&&(a.compress=t.options.compress),n.perMessageDeflate&&("string"==typeof i?e.byteLength(i):i.length)<n.perMessageDeflate.threshold&&(a.compress=!1)}try{n.usingBrowserWebSocket?n.ws.send(i):n.ws.send(i,a)}catch(Hf){r("websocket closed before onclose event")}--o||(n.emit("flush"),setTimeout((function(){n.writable=!0,n.emit("drain")}),0))}))}(t[i])},a.prototype.onClose=function(){kd.prototype.onClose.call(this)},a.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},a.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=Ud()),this.supportsBinary||(e.b64=1),(e=zp.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e},a.prototype.check=function(){return!(!o||"__initialize"in o&&this.name===a.prototype.name)}}).call(this)}).call(this,a({}).Buffer);var Kd={polling:function(e){var t=!1,n=!1,r=!1!==e.jsonp;if("undefined"!=typeof location){var o="https:"===location.protocol,i=location.port;i||(i=o?443:80),t=e.hostname!==location.hostname||i!==e.port,n=e.secure!==o}if(e.xdomain=t,e.xscheme=n,"open"in new Od(e)&&!e.forceJSONP)return new zd(e);if(!r)throw new Error("JSONP disabled");return new Yd(e)}};Kd.websocket=$d;var Jd,Qd=gp("engine.io-client:socket");function Zd(e,t){if(!(this instanceof Zd))return new Zd(e,t);t=t||{},e&&"object"==typeof e&&(t=e,e=null),e?(e=up(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=up(t.host).host),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.agent=t.agent||!1,this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},"string"==typeof this.query&&(this.query=zp.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.timestampParam=t.timestampParam||"t",this.timestampRequests=t.timestampRequests,this.transports=t.transports||["polling","websocket"],this.transportOptions=t.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1!==t.perMessageDeflate&&(t.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||null,this.key=t.key||null,this.passphrase=t.passphrase||null,this.cert=t.cert||null,this.ca=t.ca||null,this.ciphers=t.ciphers||null,this.rejectUnauthorized=void 0===t.rejectUnauthorized||t.rejectUnauthorized,this.forceNode=!!t.forceNode,this.isReactNative="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),("undefined"==typeof self||this.isReactNative)&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(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()}Jd=Zd,Zd.priorWebsocketSuccess=!1,Bp(Zd.prototype),Zd.protocol=vd.protocol,Zd.Socket=Zd,Zd.Transport=kd,Zd.transports=Kd,Zd.parser=vd,Zd.prototype.createTransport=function(e){Qd('creating transport "%s"',e);var t=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}(this.query);t.EIO=vd.protocol,t.transport=e;var n=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new Kd[e]({query:t,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0,isReactNative:this.isReactNative})},Zd.prototype.open=function(){var e;if(this.rememberUpgrade&&Zd.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(Hf){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},Zd.prototype.setTransport=function(e){Qd("setting transport %s",e.name);var t=this;this.transport&&(Qd("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")}))},Zd.prototype.probe=function(e){Qd('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),n=!1,r=this;function o(){if(r.onlyBinaryUpgrades){var o=!this.supportsBinary&&r.transport.supportsBinary;n=n||o}n||(Qd('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",(function(o){if(!n)if("pong"===o.type&&"probe"===o.data){if(Qd('probe transport "%s" pong',e),r.upgrading=!0,r.emit("upgrading",t),!t)return;Zd.priorWebsocketSuccess="websocket"===t.name,Qd('pausing current transport "%s"',r.transport.name),r.transport.pause((function(){n||"closed"!==r.readyState&&(Qd("changing transport and sending upgrade packet"),c(),r.setTransport(t),t.send([{type:"upgrade"}]),r.emit("upgrade",t),t=null,r.upgrading=!1,r.flush())}))}else{Qd('probe transport "%s" failed',e);var i=new Error("probe error");i.transport=t.name,r.emit("upgradeError",i)}})))}function i(){n||(n=!0,c(),t.close(),t=null)}function a(n){var o=new Error("probe error: "+n);o.transport=t.name,i(),Qd('probe transport "%s" failed because of error: %s',e,n),r.emit("upgradeError",o)}function s(){a("transport closed")}function l(){a("socket closed")}function u(e){t&&e.name!==t.name&&(Qd('"%s" works - aborting "%s"',e.name,t.name),i())}function c(){t.removeListener("open",o),t.removeListener("error",a),t.removeListener("close",s),r.removeListener("close",l),r.removeListener("upgrading",u)}Zd.priorWebsocketSuccess=!1,t.once("open",o),t.once("error",a),t.once("close",s),this.once("close",l),this.once("upgrading",u),t.open()},Zd.prototype.onOpen=function(){if(Qd("socket open"),this.readyState="open",Zd.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){Qd("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},Zd.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(Qd('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else Qd('packet received with socket readyState "%s"',this.readyState)},Zd.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},Zd.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout((function(){"closed"!==t.readyState&&t.onClose("ping timeout")}),e||t.pingInterval+t.pingTimeout)},Zd.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout((function(){Qd("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)}),e.pingInterval)},Zd.prototype.ping=function(){var e=this;this.sendPacket("ping",(function(){e.emit("ping")}))},Zd.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},Zd.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(Qd("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},Zd.prototype.write=Zd.prototype.send=function(e,t,n){return this.sendPacket("message",e,t,n),this},Zd.prototype.sendPacket=function(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var o={type:e,data:t,options:n};this.emit("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}},Zd.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",(function(){this.upgrading?r():t()})):this.upgrading?r():t()}function t(){e.onClose("forced close"),Qd("socket closing - telling transport to close"),e.transport.close()}function n(){e.removeListener("upgrade",n),e.removeListener("upgradeError",n),t()}function r(){e.once("upgrade",n),e.once("upgradeError",n)}return this},Zd.prototype.onError=function(e){Qd("socket error %j",e),Zd.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},Zd.prototype.onClose=function(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(Qd('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)},Zd.prototype.filterUpgrades=function(e){for(var t=[],n=0,r=e.length;n<r;n++)~jp(this.transports,e[n])&&t.push(e[n]);return t};var eh={};(eh=Jd).parser=vd;var th=function(e,t){for(var n=[],r=(t=t||0)||0;r<e.length;r++)n[r-t]=e[r];return n},nh=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}},rh=[].slice,oh=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var n=rh.call(arguments,2);return function(){return t.apply(e,n.concat(rh.call(arguments)))}},ih={},ah=gp("socket.io-client:socket");ih=ih=uh;var sh={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},lh=Bp.prototype.emit;function uh(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}Bp(uh.prototype),uh.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[nh(e,"open",oh(this,"onopen")),nh(e,"packet",oh(this,"onpacket")),nh(e,"close",oh(this,"onclose"))]}},uh.prototype.open=uh.prototype.connect=function(){return this.connected||(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting")),this},uh.prototype.send=function(){var e=th(arguments);return e.unshift("message"),this.emit.apply(this,e),this},uh.prototype.emit=function(e){if(sh.hasOwnProperty(e))return lh.apply(this,arguments),this;var t=th(arguments),n={type:(void 0!==this.flags.binary?this.flags.binary:qp(t))?Ap.BINARY_EVENT:Ap.EVENT,data:t,options:{}};return n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(ah("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this.flags={},this},uh.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},uh.prototype.onopen=function(){if(ah("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?zp.encode(this.query):this.query;ah("sending connect packet with query %s",e),this.packet({type:Ap.CONNECT,query:e})}else this.packet({type:Ap.CONNECT})},uh.prototype.onclose=function(e){ah("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},uh.prototype.onpacket=function(e){var t=e.nsp===this.nsp,n=e.type===Ap.ERROR&&"/"===e.nsp;if(t||n)switch(e.type){case Ap.CONNECT:this.onconnect();break;case Ap.EVENT:case Ap.BINARY_EVENT:this.onevent(e);break;case Ap.ACK:case Ap.BINARY_ACK:this.onack(e);break;case Ap.DISCONNECT:this.ondisconnect();break;case Ap.ERROR:this.emit("error",e.data)}},uh.prototype.onevent=function(e){var t=e.data||[];ah("emitting event %j",t),null!=e.id&&(ah("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?lh.apply(this,t):this.receiveBuffer.push(t)},uh.prototype.ack=function(e){var t=this,n=!1;return function(){if(!n){n=!0;var r=th(arguments);ah("sending ack %j",r),t.packet({type:qp(r)?Ap.BINARY_ACK:Ap.ACK,id:e,data:r})}}},uh.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(ah("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):ah("bad ack %s",e.id)},uh.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},uh.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)lh.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},uh.prototype.ondisconnect=function(){ah("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},uh.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},uh.prototype.close=uh.prototype.disconnect=function(){return this.connected&&(ah("performing disconnect (%s)",this.nsp),this.packet({type:Ap.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},uh.prototype.compress=function(e){return this.flags.compress=e,this},uh.prototype.binary=function(e){return this.flags.binary=e,this};var ch={};function ph(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}ch=ph,ph.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},ph.prototype.reset=function(){this.attempts=0},ph.prototype.setMin=function(e){this.ms=e},ph.prototype.setMax=function(e){this.max=e},ph.prototype.setJitter=function(e){this.jitter=e};var dh={},hh=gp("socket.io-client:manager"),fh=Object.prototype.hasOwnProperty;function mh(e,t){if(!(this instanceof mh))return new mh(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 ch({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 n=t.parser||Ap;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}dh=mh,mh.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)fh.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},mh.prototype.updateSocketIds=function(){for(var e in this.nsps)fh.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},mh.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},Bp(mh.prototype),mh.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},mh.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},mh.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},mh.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},mh.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},mh.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},mh.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},mh.prototype.open=mh.prototype.connect=function(e,t){if(hh("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;hh("opening %s",this.uri),this.engine=eh(this.uri,this.opts);var n=this.engine,r=this;this.readyState="opening",this.skipReconnect=!1;var o=nh(n,"open",(function(){r.onopen(),e&&e()})),i=nh(n,"error",(function(t){if(hh("connect_error"),r.cleanup(),r.readyState="closed",r.emitAll("connect_error",t),e){var n=new Error("Connection error");n.data=t,e(n)}else r.maybeReconnectOnOpen()}));if(!1!==this._timeout){var a=this._timeout;hh("connect attempt will timeout after %d",a);var s=setTimeout((function(){hh("connect attempt timed out after %d",a),o.destroy(),n.close(),n.emit("error","timeout"),r.emitAll("connect_timeout",a)}),a);this.subs.push({destroy:function(){clearTimeout(s)}})}return this.subs.push(o),this.subs.push(i),this},mh.prototype.onopen=function(){hh("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(nh(e,"data",oh(this,"ondata"))),this.subs.push(nh(e,"ping",oh(this,"onping"))),this.subs.push(nh(e,"pong",oh(this,"onpong"))),this.subs.push(nh(e,"error",oh(this,"onerror"))),this.subs.push(nh(e,"close",oh(this,"onclose"))),this.subs.push(nh(this.decoder,"decoded",oh(this,"ondecoded")))},mh.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},mh.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},mh.prototype.ondata=function(e){this.decoder.add(e)},mh.prototype.ondecoded=function(e){this.emit("packet",e)},mh.prototype.onerror=function(e){hh("error",e),this.emitAll("error",e)},mh.prototype.socket=function(e,t){var n=this.nsps[e];if(!n){n=new ih(this,e,t),this.nsps[e]=n;var r=this;n.on("connecting",o),n.on("connect",(function(){n.id=r.generateId(e)})),this.autoConnect&&o()}function o(){~jp(r.connecting,n)||r.connecting.push(n)}return n},mh.prototype.destroy=function(e){var t=jp(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},mh.prototype.packet=function(e){hh("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(n){for(var r=0;r<n.length;r++)t.engine.write(n[r],e.options);t.encoding=!1,t.processPacketQueue()})))},mh.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},mh.prototype.cleanup=function(){hh("cleanup");for(var e=this.subs.length,t=0;t<e;t++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},mh.prototype.close=mh.prototype.disconnect=function(){hh("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},mh.prototype.onclose=function(e){hh("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},mh.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)hh("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();hh("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout((function(){e.skipReconnect||(hh("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open((function(t){t?(hh("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(hh("reconnect success"),e.onreconnect())})))}),t);this.subs.push({destroy:function(){clearTimeout(n)}})}},mh.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)};function vh(){return(vh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function gh(e,t){return(gh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var yh,bh=["ASSEMBLY_UPLOADING","ASSEMBLY_EXECUTING","ASSEMBLY_COMPLETED"];function _h(e,t){return bh.indexOf(e)>=bh.indexOf(t)}var wh=function(e){var t,n;function r(t){var n;return(n=e.call(this)||this).status=t,n.socket=null,n.pollInterval=null,n.closed=!1,n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,gh(t,n);var i=r.prototype;return i.connect=function(){this._connectSocket(),this._beginPolling()},i._onFinished=function(){this.emit("finished"),this.close()},i._connectSocket=function(){var e=this,t=function(e){var t=/^\w+:\/\//.exec(e),n=0;t&&(n=t[0].length+1);var r=e.indexOf("/",n);return-1===r?{origin:e,pathname:"/"}:{origin:e.slice(0,r),pathname:e.slice(r)}}(this.status.websocket_url),n=(yh||(yh=o({})),yh).connect(t.origin,{transports:["websocket"],path:t.pathname});n.on("connect",(function(){n.emit("assembly_connect",{id:e.status.assembly_id}),e.emit("connect")})),n.on("connect_failed",(function(){e._onError(new Fe("Transloadit Socket.io connection error")),e.socket=null})),n.on("error",(function(){n.disconnect(),e.socket=null})),n.on("assembly_finished",(function(){e._onFinished()})),n.on("assembly_upload_finished",(function(t){e.emit("upload",t),e.status.uploads.push(t)})),n.on("assembly_uploading_finished",(function(){e.emit("executing")})),n.on("assembly_upload_meta_data_extracted",(function(){e.emit("metadata"),e._fetchStatus({diff:!1})})),n.on("assembly_result_finished",(function(t,n){e.emit("result",t,n),e.status.results[t]||(e.status.results[t]=[]),e.status.results[t].push(n)})),n.on("assembly_error",(function(t){e._onError(t),e._fetchStatus({diff:!1})})),this.socket=n},i._onError=function(e){this.emit("error",vh(new Error(e.message),e))},i._beginPolling=function(){var e=this;this.pollInterval=setInterval((function(){e.socket&&e.socket.connected||e._fetchStatus()}),2e3)},i._fetchStatus=function(e){var t=this,n=(void 0===e?{}:e).diff,r=void 0===n||n;return De(this.status.assembly_ssl_url).then((function(e){return e.json()})).then((function(e){t.closed||(t.emit("status",e),r?t.updateStatus(e):t.status=e)})).catch((function(e){return t._onError(e)}))},i.update=function(){return this._fetchStatus({diff:!0})},i.updateStatus=function(e){this._diffStatus(this.status,e),this.status=e},i._diffStatus=function(e,t){var n=this,r=e.ok,o=t.ok;if(t.error&&!e.error)return this._onError(t);var i=_h(o,"ASSEMBLY_EXECUTING")&&!_h(r,"ASSEMBLY_EXECUTING");i&&this.emit("executing"),Object.keys(t.uploads).filter((function(t){return!C(e.uploads,t)})).map((function(e){return t.uploads[e]})).forEach((function(e){n.emit("upload",e)})),i&&this.emit("metadata"),Object.keys(t.results).forEach((function(r){var o=t.results[r],i=e.results[r];o.filter((function(e){return!i||!i.some((function(t){return t.id===e.id}))})).forEach((function(e){n.emit("result",r,e)}))})),_h(o,"ASSEMBLY_COMPLETED")&&!_h(r,"ASSEMBLY_COMPLETED")&&this.emit("finished")},i.close=function(){this.closed=!0,this.socket&&(this.socket.disconnect(),this.socket=null),clearInterval(this.pollInterval)},r}(Bp),Ch=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,n=e.params,r=e.fields,o=e.signature,i=e.expectedFiles,a=new FormData;a.append("params","string"==typeof n?n:JSON.stringify(n)),o&&a.append("signature",o),Object.keys(r).forEach((function(e){a.append(e,r[e])})),a.append("num_expected_upload_files",i);var s=new Xe("/assemblies",""+this.opts.service).href;return De(s,{method:"post",headers:this._headers,body:a}).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:s,type:"API_ERROR"})}))},t.reserveFile=function(e,t){var n=this,r=encodeURIComponent(t.size),o=e.assembly_ssl_url+"/reserve_file?size="+r;return De(o,{method:"post",headers:this._headers}).then((function(e){return e.json()})).catch((function(r){return n._reportError(r,{assembly:e,file:t,url:o,type:"API_ERROR"})}))},t.addFile=function(e,t){var n=this;if(!t.uploadURL)return Promise.reject(new Error("File does not have an `uploadURL`."));var r=encodeURIComponent(t.size),o=encodeURIComponent(t.uploadURL),i="size="+r+"&filename="+encodeURIComponent(t.name)+"&fieldname=file&s3Url="+o,a=e.assembly_ssl_url+"/add_file?"+i;return De(a,{method:"post",headers:this._headers}).then((function(e){return e.json()})).catch((function(r){return n._reportError(r,{assembly:e,file:t,url:a,type:"API_ERROR"})}))},t.cancelAssembly=function(e){var t=this,n=e.assembly_ssl_url;return De(n,{method:"delete",headers:this._headers}).then((function(e){return e.json()})).catch((function(e){return t._reportError(e,{url:n,type:"API_ERROR"})}))},t.getAssemblyStatus=function(e){var t=this;return De(e,{headers:this._headers}).then((function(e){return e.json()})).catch((function(n){return t._reportError(n,{url:e,type:"STATUS_ERROR"})}))},t.submitError=function(e,t){var n=t.endpoint,r=t.instance,o=t.assembly,i=e.details?e.message+" ("+e.details+")":e.message;return De("https://transloaditstatus.com/client_error",{method:"post",body:JSON.stringify({endpoint:n,instance:r,assembly_id:o,agent:"undefined"!=typeof navigator?navigator.userAgent:"",client:this.opts.client,error:i})}).then((function(e){return e.json()}))},t._reportError=function(e,t){if(!1===this.opts.errorReporting)throw e;var n={type:t.type};throw t.assembly&&(n.assembly=t.assembly.assembly_id,n.instance=t.assembly.instance),t.url&&(n.endpoint=t.url),this.submitError(e,n).catch((function(e){})),e},e}(),Sh={};function kh(e){if(!e)throw new Error("Transloadit: The `params` option is required.");if("string"==typeof e)try{e=JSON.parse(e)}catch(Cd){throw Cd.message="Transloadit: The `params` option is a malformed JSON string: "+Cd.message,Cd}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 xh=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 n=t.fields;t.fields={},n.forEach((function(n){t.fields[n]=e.meta[n]}))}return t.fields||(t.fields={}),t},t._getAssemblyOptions=function(e){var t=this,n=this.opts;return Promise.resolve().then((function(){return n.getAssemblyOptions(e,n)})).then((function(n){return t._normalizeAssemblyOptions(e,n)})).then((function(t){return kh(t.params),{fileIDs:[e.id],options:t}}))},t._dedupe=function(e){var t=Object.create(null);return e.forEach((function(e){var n,r=e.fileIDs,o=e.options,i=JSON.stringify(o);t[i]?(n=t[i].fileIDs).push.apply(n,r):t[i]={options:o,fileIDs:[].concat(r)}})),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 kh(t.params),[{fileIDs:e.files.map((function(e){return e.id})),options:t}]})):Promise.resolve([])},e}();function Ph(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Eh(e,t){return(Eh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(Sh=xh).validateParams=kh;var Oh,Ah,Uh=function(e){var t,n;function r(t,n){var r;return(r=e.call(this)||this)._uppy=t,r._assemblyIDs=n,r._remaining=n.length,r.promise=new Promise((function(e,t){r._resolve=e,r._reject=t})),r._onAssemblyComplete=r._onAssemblyComplete.bind(Ph(r)),r._onAssemblyCancel=r._onAssemblyCancel.bind(Ph(r)),r._onAssemblyError=r._onAssemblyError.bind(Ph(r)),r._onImportError=r._onImportError.bind(Ph(r)),r._addListeners(),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Eh(t,n);var o=r.prototype;return o._watching=function(e){return-1!==this._assemblyIDs.indexOf(e)},o._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())},o._onAssemblyCancel=function(e){this._watching(e.assembly_id)&&this._checkAllComplete()},o._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())},o._onImportError=function(e,t,n){this._watching(e.assembly_id)&&this._onAssemblyError(e,n)},o._checkAllComplete=function(){this._remaining-=1,0===this._remaining&&(this._removeListeners(),this._resolve())},o._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)},o._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)},r}(Bp),Nh={};function Th(){return(Th=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Rh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fh(e,t){return(Fh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dh(e,t){return{params:t.params,signature:t.signature,fields:t.fields}}var Mh,Bh,Ih="https://api2.transloadit.com/companion",Lh=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/companion/,jh=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/uppy-server/;function zh(e,t){return(zh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hh(){return(Hh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}Ah=Oh=function(e){var t,n;function r(t,n){var r;(r=e.call(this,t,n)||this).type="uploader",r.id=r.opts.id||"Transloadit",r.title="Transloadit",r.defaultLocale={strings:{creatingAssembly:"Preparing upload...",creatingAssemblyFailed:"Transloadit: Could not create Assembly",encoding:"Encoding..."}};var o={service:"https://api2.transloadit.com",errorReporting:!0,waitForEncoding:!1,waitForMetadata:!1,alwaysRunAssembly:!1,importFromUploadURLs:!1,signature:null,params:null,fields:{},getAssemblyOptions:Dh,limit:0};r.opts=Th({},o,n),r.i18nInit(),r._prepareUpload=r._prepareUpload.bind(Rh(r)),r._afterUpload=r._afterUpload.bind(Rh(r)),r._onError=r._onError.bind(Rh(r)),r._onTusError=r._onTusError.bind(Rh(r)),r._onCancelAll=r._onCancelAll.bind(Rh(r)),r._onFileUploadURLAvailable=r._onFileUploadURLAvailable.bind(Rh(r)),r._onRestored=r._onRestored.bind(Rh(r)),r._getPersistentData=r._getPersistentData.bind(Rh(r));var i=r.opts.getAssemblyOptions!==o.getAssemblyOptions;return r.opts.params?Sh.validateParams(r.opts.params):i||Sh.validateParams(null),r.client=new Ch({service:r.opts.service,client:r._getClientVersion(),errorReporting:r.opts.errorReporting}),r.activeAssemblies={},r.assemblyWatchers={},r.completedFiles=Object.create(null),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Fh(t,n);var o=r.prototype;return o.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},o.i18nInit=function(){this.translator=new x([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.i18nArray=this.translator.translateArray.bind(this.translator),this.setPluginState()},o._getClientVersion=function(){var e=this,t=["uppy-core:"+this.uppy.constructor.VERSION,"uppy-transloadit:"+this.constructor.VERSION,"uppy-tus:"+ap.VERSION],n=function(n,r){var o=e.uppy.getPlugin(n);o&&t.push(r+":"+o.constructor.VERSION)};return this.opts.importFromUploadURLs&&(n("XHRUpload","uppy-xhr-upload"),n("AwsS3","uppy-aws-s3"),n("AwsS3Multipart","uppy-aws-s3-multipart")),n("Dropbox","uppy-dropbox"),n("Box","uppy-box"),n("Facebook","uppy-facebook"),n("GoogleDrive","uppy-google-drive"),n("Instagram","uppy-instagram"),n("OneDrive","uppy-onedrive"),n("Zoom","uppy-zoom"),n("Url","uppy-url"),t.join(",")},o._attachAssemblyMetadata=function(e,t){var n=Th({},e.meta,{assembly_url:t.assembly_url,filename:e.name,fieldname:"file"}),r=Th({},e.tus,{endpoint:t.tus_url,addRequestId:!0}),o=e.remote;if(e.remote&&jh.test(e.remote.companionUrl)){var i=new Error("The https://api2.transloadit.com/uppy-server endpoint was renamed to https://api2.transloadit.com/companion, please update your `companionUrl` options accordingly.");throw this.uppy.log(i),i}if(e.remote&&Lh.test(e.remote.companionUrl)){var a=t.companion_url.replace(/\/$/,""),s=e.remote.url.replace(e.remote.companionUrl,"").replace(/^\//,"");o=Th({},e.remote,{companionUrl:a,url:a+"/"+s})}var l=Th({},e,{transloadit:{assembly:t.assembly_id}});return this.opts.importFromUploadURLs||Th(l,{meta:n,tus:r,remote:o}),l},o._createAssembly=function(e,t,n){var r=this;return this.uppy.log("[Transloadit] Create Assembly"),this.client.createAssembly({params:n.params,fields:n.fields,expectedFiles:e.length,signature:n.signature}).then((function(n){var o,i,a=new wh(n),s=a.status,l=s.assembly_id,u=r.getPluginState(),c=u.assemblies,p=u.uploadsAssemblies;r.setPluginState({assemblies:Th({},c,(o={},o[l]=s,o)),uploadsAssemblies:Th({},p,(i={},i[t]=[].concat(p[t],[l]),i))});var d=r.uppy.getState().files,h={};return e.forEach((function(e){h[e]=r._attachAssemblyMetadata(r.uppy.getFile(e),s)})),r.uppy.setState({files:Th({},d,h)}),r.uppy.emit("transloadit:assembly-created",s,e),r.uppy.log("[Transloadit] Created Assembly "+l),a})).catch((function(e){throw e.message=r.i18n("creatingAssemblyFailed")+": "+e.message,e}))},o._createAssemblyWatcher=function(e,t,n){var r=this,o=new Uh(this.uppy,e);o.on("assembly-complete",(function(e){r.getAssemblyFiles(e).forEach((function(e){r.completedFiles[e.id]=!0,r.uppy.emit("postprocess-complete",e)}))})),o.on("assembly-error",(function(e,t){r.getAssemblyFiles(e).forEach((function(e){r.uppy.emit("upload-error",e,t),r.uppy.emit("postprocess-complete",e)}))})),this.assemblyWatchers[n]=o},o._shouldWaitAfterUpload=function(){return this.opts.waitForEncoding||this.opts.waitForMetadata},o._reserveFiles=function(e,t){var n=this;return Promise.all(t.map((function(t){var r=n.uppy.getFile(t);return n.client.reserveFile(e.status,r)})))},o._onFileUploadURLAvailable=function(e){var t=this,n=this.uppy.getFile(e.id);if(n&&n.transloadit&&n.transloadit.assembly){var r=this.getPluginState().assemblies[n.transloadit.assembly];this.client.addFile(r,n).catch((function(e){t.uppy.log(e),t.uppy.emit("transloadit:import-error",r,n.id,e)}))}},o._findFile=function(e){for(var t=this.uppy.getFiles(),n=0;n<t.length;n++){var r=t[n];if(r.uploadURL===e.tus_upload_url)return r;if(r.tus&&r.tus.uploadUrl===e.tus_upload_url)return r;if(!e.is_tus_file&&r.name===e.name&&r.size===e.size)return r}},o._onFileUploadComplete=function(e,t){var n,r=this.getPluginState(),o=this._findFile(t);o?(this.setPluginState({files:Th({},r.files,(n={},n[t.id]={assembly:e,id:o.id,uploadedFile:t},n))}),this.uppy.emit("transloadit:upload",t,this.getAssembly(e))):this.uppy.log("[Transloadit] Couldn\u2019t file the file, it was likely removed in the process")},o._onResult=function(e,t,n){var r=this.getPluginState(),o=r.files[n.original_id];n.localId=o?o.id:null;var i={result:n,stepName:t,id:n.id,assembly:e};this.setPluginState({results:[].concat(r.results,[i])}),this.uppy.emit("transloadit:result",t,n,this.getAssembly(e))},o._onAssemblyFinished=function(e){var t=this,n=e.assembly_ssl_url;this.client.getAssemblyStatus(n).then((function(e){var n,r=e.assembly_id,o=t.getPluginState();t.setPluginState({assemblies:Th({},o.assemblies,(n={},n[r]=e,n))}),t.uppy.emit("transloadit:complete",e)}))},o._cancelAssembly=function(e){var t=this;return this.client.cancelAssembly(e).then((function(){t.uppy.emit("transloadit:assembly-cancelled",e)}))},o._onCancelAll=function(){var e=this,t=this.getPluginState().uploadsAssemblies,n=Object.keys(t).reduce((function(e,n){return e.push.apply(e,t[n]),e}),[]).map((function(t){var n=e.getAssembly(t);return e._cancelAssembly(n)}));Promise.all(n).catch((function(t){e.uppy.log(t)}))},o._getPersistentData=function(e){var t,n=this.getPluginState(),r=n.assemblies,o=n.uploadsAssemblies;e(((t={})[this.id]={assemblies:r,uploadsAssemblies:o},t))},o._onRestored=function(e){var t=this,n=e&&e[this.id]?e[this.id]:{},r=n.assemblies||{},o=n.uploadsAssemblies||{};0!==Object.keys(o).length&&(this.restored=Promise.resolve().then((function(){var e,n,i;return e=r,n={},i=[],Object.keys(e).forEach((function(r){var o=e[r];o.uploads.forEach((function(e){var o=t._findFile(e);n[e.id]={id:o.id,assembly:r,uploadedFile:e}}));var a=t.getPluginState();Object.keys(o.results).forEach((function(e){o.results[e].forEach((function(t){var n=a.files[t.original_id];t.localId=n?n.id:null,i.push({id:t.id,result:t,stepName:e,assembly:r})}))}))})),t.setPluginState({assemblies:e,files:n,results:i,uploadsAssemblies:o}),function(){var e=t.getPluginState(),n=e.assemblies,r=e.uploadsAssemblies;Object.keys(r).forEach((function(e){var n=r[e],o=n.reduce((function(e,n){var r=t.getAssemblyFiles(n).map((function(e){return e.id}));return e.push.apply(e,r),e}),[]);t._createAssemblyWatcher(n,o,e)})),Object.keys(n).forEach((function(e){var r=new wh(n[e]);t._connectAssembly(r)}))}(),function(){var e=t.getPluginState().assemblies;return Promise.all(Object.keys(e).map((function(e){return t.activeAssemblies[e].update()})))}()})),this.restored.then((function(){t.restored=null})))},o._connectAssembly=function(e){var t=this,n=e.status.assembly_id;return this.activeAssemblies[n]=e,e.on("status",(function(e){var r,o=t.getPluginState().assemblies;t.setPluginState({assemblies:Th({},o,(r={},r[n]=e,r))})})),e.on("upload",(function(e){t._onFileUploadComplete(n,e)})),e.on("error",(function(n){n.assembly=e.status,t.uppy.emit("transloadit:assembly-error",e.status,n)})),e.on("executing",(function(){t.uppy.emit("transloadit:assembly-executing",e.status)})),this.opts.waitForEncoding&&e.on("result",(function(e,r){t._onResult(n,e,r)})),this.opts.waitForEncoding?e.on("finished",(function(){t._onAssemblyFinished(e.status)})):this.opts.waitForMetadata&&e.on("metadata",(function(){t._onAssemblyFinished(e.status)})),"ASSEMBLY_COMPLETE"===e.ok||(new Promise((function(t,n){e.once("connect",t),e.once("status",t),e.once("error",n)})).then((function(){t.uppy.log("[Transloadit] Socket is ready")})),e.connect()),e},o._prepareUpload=function(e,t){var n,r=this;(e=e.filter((function(e){return!e.error}))).forEach((function(e){var t=r.uppy.getFile(e);r.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:r.i18n("creatingAssembly")})}));var o=function(e){var n,o=e.fileIDs,i=e.options;return r._createAssembly(o,t,i).then((function(e){if(n=e,r.opts.importFromUploadURLs)return r._reserveFiles(e,o)})).then((function(){return o.forEach((function(e){var t=r.uppy.getFile(e);r.uppy.emit("preprocess-complete",t)})),n})).catch((function(e){throw o.forEach((function(t){var n=r.uppy.getFile(t);r.uppy.emit("preprocess-complete",n),r.uppy.emit("upload-error",n,e)})),e}))},i=this.getPluginState().uploadsAssemblies;this.setPluginState({uploadsAssemblies:Th({},i,(n={},n[t]=[],n))});var a=e.map((function(e){return r.uppy.getFile(e)}));return new Sh(a,this.opts).build().then((function(n){return Promise.all(n.map(o)).then((function(n){var o=n.map((function(e){return e.status.assembly_id}));r._createAssemblyWatcher(o,e,t),n.map((function(e){return r._connectAssembly(e)}))}))}),(function(t){throw e.forEach((function(e){var n=r.uppy.getFile(e);r.uppy.emit("preprocess-complete",n),r.uppy.emit("upload-error",n,t)})),t}))},o._afterUpload=function(e,t){var n=this,r=e.map((function(e){return n.uppy.getFile(e)}));e=r.filter((function(e){return!e.error})).map((function(e){return e.id}));var o=this.getPluginState();if(this.restored)return this.restored.then((function(){return n._afterUpload(e,t)}));var i=o.uploadsAssemblies[t],a=function(){i.forEach((function(e){n.activeAssemblies[e].close(),delete n.activeAssemblies[e]}))};if(!this._shouldWaitAfterUpload()){a();var s=i.map((function(e){return n.getAssembly(e)}));return this.uppy.addResultData(t,{transloadit:s}),Promise.resolve()}return 0===i.length?(this.uppy.addResultData(t,{transloadit:[]}),Promise.resolve()):(r.filter((function(e){return!C(n.completedFiles,e.id)})).forEach((function(e){n.uppy.emit("postprocess-progress",e,{mode:"indeterminate",message:n.i18n("encoding")})})),this.assemblyWatchers[t].promise.then((function(){a();var e=i.map((function(e){return n.getAssembly(e)})),r=Th({},n.getPluginState().uploadsAssemblies);delete r[t],n.setPluginState({uploadsAssemblies:r}),n.uppy.addResultData(t,{transloadit:e})})))},o._onError=function(e,t){var n=this;void 0===e&&(e=null),this.getPluginState().uploadsAssemblies[t].forEach((function(e){n.activeAssemblies[e]&&n.activeAssemblies[e].close()}))},o._onTusError=function(e){if(e&&/^tus: /.test(e.message)){var t=e.originalRequest?e.originalRequest.getUnderlyingObject():null,n=t&&t.responseURL?t.responseURL:null;this.client.submitError(e,{url:n,type:"TUS_ERROR"}).then((function(e){}))}},o.install=function(){this.uppy.addPreProcessor(this._prepareUpload),this.uppy.addPostProcessor(this._afterUpload),this.uppy.on("error",this._onError),this.uppy.on("cancel-all",this._onCancelAll),this.uppy.on("upload-error",this._onTusError),this.opts.importFromUploadURLs?this.uppy.on("upload-success",this._onFileUploadURLAvailable):this.uppy.use(ap,{storeFingerprintForResuming:!1,resume:!1,useFastRemoteRetry:!1,metaFields:["assembly_url","filename","fieldname"],limit:this.opts.limit}),this.uppy.on("restore:get-data",this._getPersistentData),this.uppy.on("restored",this._onRestored),this.setPluginState({assemblies:{},uploadsAssemblies:{},files:{},results:[]});var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Th({},e,{individualCancellation:!1})})},o.uninstall=function(){this.uppy.removePreProcessor(this._prepareUpload),this.uppy.removePostProcessor(this._afterUpload),this.uppy.off("error",this._onError),this.opts.importFromUploadURLs&&this.uppy.off("upload-success",this._onFileUploadURLAvailable);var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Th({},e,{individualCancellation:!0})})},o.getAssembly=function(e){return this.getPluginState().assemblies[e]},o.getAssemblyFiles=function(e){return this.uppy.getFiles().filter((function(t){return t&&t.transloadit&&t.transloadit.assembly===e}))},r}(ue.Plugin),Oh.VERSION="1.7.0",(Nh=Ah).COMPANION=Ih,Nh.UPPY_SERVER=Ih,Nh.COMPANION_PATTERN=/\.transloadit\.com$/;var Wh=Qe.Provider,Vh=Qe.RequestClient,qh=Qe.Socket;function Xh(e,t){return t||(t=new Error("Upload error")),"string"==typeof t&&(t=new Error(t)),t instanceof Error||(t=Hh(new Error("Upload error"),{data:t})),El(e)?t=new Fe(t,e):(t.request=e,t)}function Gh(e){return e.data.slice(0,e.data.size,e.meta.type)}var Yh=(Bh=Mh=function(e){var t,n;function r(t,n){var r;(r=e.call(this,t,n)||this).type="uploader",r.id=r.opts.id||"XHRUpload",r.title="XHRUpload",r.defaultLocale={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}};var o={formData:!0,fieldName:"files[]",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:0,withCredentials:!1,responseType:"",getResponseData:function(e,t){var n={};try{n=JSON.parse(e)}catch(Cd){console.log(Cd)}return n},getResponseError:function(e,t){var n=new Error("Upload error");return El(t)&&(n=new Fe(n,t)),n},validateStatus:function(e,t,n){return e>=200&&e<300}};if(r.opts=Hh({},o,n),r.i18nInit(),r.handleUpload=r.handleUpload.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r)),r.opts.__queue instanceof wl?r.requests=r.opts.__queue:r.requests=new wl(r.opts.limit),r.opts.bundle&&!r.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");return r.uploaderEvents=Object.create(null),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,zh(t,n);var o=r.prototype;return o.setOptions=function(t){e.prototype.setOptions.call(this,t),this.i18nInit()},o.i18nInit=function(){this.translator=new x([this.defaultLocale,this.uppy.locale,this.opts.locale]),this.i18n=this.translator.translate.bind(this.translator),this.setPluginState()},o.getOptions=function(e){var t=this.uppy.getState().xhrUpload,n=this.opts.headers,r=Hh({},this.opts,t||{},e.xhrUpload||{},{headers:{}});return"function"==typeof n?r.headers=n(e):Hh(r.headers,this.opts.headers),t&&Hh(r.headers,t.headers),e.xhrUpload&&Hh(r.headers,e.xhrUpload.headers),r},o.addMetadata=function(e,t,n){(Array.isArray(n.metaFields)?n.metaFields:Object.keys(t)).forEach((function(n){e.append(n,t[n])}))},o.createFormDataUpload=function(e,t){var n=new FormData;this.addMetadata(n,e.meta,t);var r=Gh(e);return e.name?n.append(t.fieldName,r,e.meta.name):n.append(t.fieldName,r),n},o.createBundledUpload=function(e,t){var n=this,r=new FormData,o=this.uppy.getState().meta;return this.addMetadata(r,o,t),e.forEach((function(e){var t=n.getOptions(e),o=Gh(e);e.name?r.append(t.fieldName,o,e.name):r.append(t.fieldName,o)})),r},o.createBareUpload=function(e,t){return e.data},o.upload=function(e,t,n){var r=this,o=this.getOptions(e);return this.uppy.log("uploading "+t+" of "+n),new Promise((function(t,n){r.uppy.emit("upload-started",e);var i=o.formData?r.createFormDataUpload(e,o):r.createBareUpload(e,o),a=new XMLHttpRequest;r.uploaderEvents[e.id]=new xl(r.uppy);var s=new Pl(o.timeout,(function(){a.abort(),u.done();var t=new Error(r.i18n("timedOut",{seconds:Math.ceil(o.timeout/1e3)}));r.uppy.emit("upload-error",e,t),n(t)})),l=D();a.upload.addEventListener("loadstart",(function(e){r.uppy.log("[XHRUpload] "+l+" started")})),a.upload.addEventListener("progress",(function(t){r.uppy.log("[XHRUpload] "+l+" progress: "+t.loaded+" / "+t.total),s.progress(),t.lengthComputable&&r.uppy.emit("upload-progress",e,{uploader:r,bytesUploaded:t.loaded,bytesTotal:t.total})})),a.addEventListener("load",(function(i){if(r.uppy.log("[XHRUpload] "+l+" finished"),s.done(),u.done(),r.uploaderEvents[e.id]&&(r.uploaderEvents[e.id].remove(),r.uploaderEvents[e.id]=null),o.validateStatus(i.target.status,a.responseText,a)){var c=o.getResponseData(a.responseText,a),p=c[o.responseUrlFieldName],d={status:i.target.status,body:c,uploadURL:p};return r.uppy.emit("upload-success",e,d),p&&r.uppy.log("Download "+e.name+" from "+p),t(e)}var h=o.getResponseData(a.responseText,a),f=Xh(a,o.getResponseError(a.responseText,a)),m={status:i.target.status,body:h};return r.uppy.emit("upload-error",e,f,m),n(f)})),a.addEventListener("error",(function(t){r.uppy.log("[XHRUpload] "+l+" errored"),s.done(),u.done(),r.uploaderEvents[e.id]&&(r.uploaderEvents[e.id].remove(),r.uploaderEvents[e.id]=null);var i=Xh(a,o.getResponseError(a.responseText,a));return r.uppy.emit("upload-error",e,i),n(i)})),a.open(o.method.toUpperCase(),o.endpoint,!0),a.withCredentials=o.withCredentials,""!==o.responseType&&(a.responseType=o.responseType);var u=r.requests.run((function(){var t=r.getOptions(e);return Object.keys(t.headers).forEach((function(e){a.setRequestHeader(e,t.headers[e])})),a.send(i),function(){s.done(),a.abort()}}));r.onFileRemove(e.id,(function(){u.abort(),n(new Error("File removed"))})),r.onCancelAll(e.id,(function(){u.abort(),n(new Error("Upload cancelled"))}))}))},o.uploadRemote=function(e,t,n){var r=this,o=this.getOptions(e);return new Promise((function(t,n){r.uppy.emit("upload-started",e);var i={};(Array.isArray(o.metaFields)?o.metaFields:Object.keys(e.meta)).forEach((function(t){i[t]=e.meta[t]})),new(e.remote.providerOptions.provider?Wh:Vh)(r.uppy,e.remote.providerOptions).post(e.remote.url,Hh({},e.remote.body,{endpoint:o.endpoint,size:e.data.size,fieldname:o.fieldName,metadata:i,httpMethod:o.method,useFormData:o.formData,headers:o.headers})).then((function(i){var a=i.token,s=kl(e.remote.companionUrl),l=new qh({target:s+"/api/"+a,autoOpen:!1});r.uploaderEvents[e.id]=new xl(r.uppy),r.onFileRemove(e.id,(function(){l.send("pause",{}),u.abort(),t("upload "+e.id+" was removed")})),r.onCancelAll(e.id,(function(){l.send("pause",{}),u.abort(),t("upload "+e.id+" was canceled")})),r.onRetry(e.id,(function(){l.send("pause",{}),l.send("resume",{})})),r.onRetryAll(e.id,(function(){l.send("pause",{}),l.send("resume",{})})),l.on("progress",(function(t){return Sl(r,t,e)})),l.on("success",(function(n){var i=o.getResponseData(n.response.responseText,n.response),a=i[o.responseUrlFieldName],s={status:n.response.status,body:i,uploadURL:a};return r.uppy.emit("upload-success",e,s),u.done(),r.uploaderEvents[e.id]&&(r.uploaderEvents[e.id].remove(),r.uploaderEvents[e.id]=null),t()})),l.on("error",(function(t){var i=t.response,a=i?o.getResponseError(i.responseText,i):Hh(new Error(t.error.message),{cause:t.error});r.uppy.emit("upload-error",e,a),u.done(),r.uploaderEvents[e.id]&&(r.uploaderEvents[e.id].remove(),r.uploaderEvents[e.id]=null),n(a)}));var u=r.requests.run((function(){return l.open(),e.isPaused&&l.send("pause",{}),function(){return l.close()}}))})).catch((function(t){r.uppy.emit("upload-error",e,t),n(t)}))}))},o.uploadBundle=function(e){var t=this;return new Promise((function(n,r){var o=t.opts.endpoint,i=t.opts.method,a=t.uppy.getState().xhrUpload,s=t.createBundledUpload(e,Hh({},t.opts,a||{})),l=new XMLHttpRequest,u=new Pl(t.opts.timeout,(function(){l.abort();var e=new Error(t.i18n("timedOut",{seconds:Math.ceil(t.opts.timeout/1e3)}));c(e),r(e)})),c=function(n){e.forEach((function(e){t.uppy.emit("upload-error",e,n)}))};l.upload.addEventListener("loadstart",(function(e){t.uppy.log("[XHRUpload] started uploading bundle"),u.progress()})),l.upload.addEventListener("progress",(function(n){u.progress(),n.lengthComputable&&e.forEach((function(e){t.uppy.emit("upload-progress",e,{uploader:t,bytesUploaded:n.loaded/n.total*e.size,bytesTotal:e.size})}))})),l.addEventListener("load",(function(o){if(u.done(),t.opts.validateStatus(o.target.status,l.responseText,l)){var i=t.opts.getResponseData(l.responseText,l),a={status:o.target.status,body:i};return e.forEach((function(e){t.uppy.emit("upload-success",e,a)})),n()}var s=t.opts.getResponseError(l.responseText,l)||new Error("Upload error");return s.request=l,c(s),r(s)})),l.addEventListener("error",(function(e){u.done();var n=t.opts.getResponseError(l.responseText,l)||new Error("Upload error");return c(n),r(n)})),t.uppy.on("cancel-all",(function(){u.done(),l.abort()})),l.open(i.toUpperCase(),o,!0),l.withCredentials=t.opts.withCredentials,""!==t.opts.responseType&&(l.responseType=t.opts.responseType),Object.keys(t.opts.headers).forEach((function(e){l.setRequestHeader(e,t.opts.headers[e])})),l.send(s),e.forEach((function(e){t.uppy.emit("upload-started",e)}))}))},o.uploadFiles=function(e){var t=this,n=e.map((function(n,r){var o=parseInt(r,10)+1,i=e.length;return n.error?Promise.reject(new Error(n.error)):n.isRemote?t.uploadRemote(n,o,i):t.upload(n,o,i)}));return Cl(n)},o.onFileRemove=function(e,t){this.uploaderEvents[e].on("file-removed",(function(n){e===n.id&&t(n.id)}))},o.onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",(function(n){e===n&&t()}))},o.onRetryAll=function(e,t){var n=this;this.uploaderEvents[e].on("retry-all",(function(r){n.uppy.getFile(e)&&t()}))},o.onCancelAll=function(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",(function(){n.uppy.getFile(e)&&t()}))},o.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 n=e.map((function(e){return t.uppy.getFile(e)}));if(this.opts.bundle){if(n.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(n)}return this.uploadFiles(n).then((function(){return null}))},o.install=function(){if(this.opts.bundle){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Hh({},e,{individualCancellation:!1})})}this.uppy.addUploader(this.handleUpload)},o.uninstall=function(){if(this.opts.bundle){var e=this.uppy.getState().capabilities;this.uppy.setState({capabilities:Hh({},e,{individualCancellation:!0})})}this.uppy.removeUploader(this.handleUpload)},r}(ue.Plugin),Mh.VERSION="1.7.5",Bh),$h={__esModule:!0};$h.default=of,$h.getFieldData=af;var Kh,Jh,Qh={"[object HTMLCollection]":!0,"[object NodeList]":!0,"[object RadioNodeList]":!0},Zh={button:!0,fieldset:!0,reset:!0,submit:!0},ef={checkbox:!0,radio:!0},tf=/^\s+|\s+$/g,nf=Array.prototype.slice,rf=Object.prototype.toString;function of(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 n={},r=void 0,o=[],i={},a=0,s=e.elements.length;a<s;a++){var l=e.elements[a];Zh[l.type]||l.disabled||(r=l.name||l.id)&&!i[r]&&(o.push(r),i[r]=!0)}for(var u=0,c=o.length;u<c;u++){var p=af(e,r=o[u],t);null!=p&&(n[r]=p)}return n}function af(e,t){var n=arguments.length>2&&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]"!==rf.call(t))throw new Error("A field name is required by getFieldData, was given fieldName="+t);var r=e.elements[t];if(!r||r.disabled)return null;if(!Qh[rf.call(r)])return sf(r,n.trim);for(var o=[],i=!0,a=0,s=r.length;a<s;a++)if(!r[a].disabled){i&&"radio"!==r[a].type&&(i=!1);var l=sf(r[a],n.trim);null!=l&&(o=o.concat(l))}return i&&1===o.length?o[0]:o.length>0?o:null}function sf(e,t){var n=null,r=e.type;if("select-one"===r)return e.options.length&&(n=e.options[e.selectedIndex].value),n;if("select-multiple"===r){n=[];for(var o=0,i=e.options.length;o<i;o++)e.options[o].selected&&n.push(e.options[o].value);return 0===n.length&&(n=null),n}return"file"===r&&"files"in e?(e.multiple?0===(n=nf.call(e.files)).length&&(n=null):n=e.files[0],n):(ef[r]?e.checked&&(n=e.value):n=t?e.value.replace(tf,""):e.value,n)}function lf(){return(lf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function uf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function cf(e,t){return(cf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}of.getFieldData=af;var pf=ue.Plugin,df=$h.default||$h,hf=(Jh=Kh=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).type="acquirer",r.id=r.opts.id||"Form",r.title="Form",r.opts=lf({},{target:null,resultName:"uppyResult",getMetaFromForm:!0,addResultToForm:!0,multipleResults:!1,submitOnSuccess:!1,triggerUploadOnSubmit:!1},n),r.handleFormSubmit=r.handleFormSubmit.bind(uf(r)),r.handleUploadStart=r.handleUploadStart.bind(uf(r)),r.handleSuccess=r.handleSuccess.bind(uf(r)),r.addResultToForm=r.addResultToForm.bind(uf(r)),r.getMetaFromForm=r.getMetaFromForm.bind(uf(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,cf(t,n);var o=r.prototype;return o.handleUploadStart=function(){this.opts.getMetaFromForm&&this.getMetaFromForm()},o.handleSuccess=function(e){this.opts.addResultToForm&&this.addResultToForm(e),this.opts.submitOnSuccess&&this.form.submit()},o.handleFormSubmit=function(e){var t=this;if(this.opts.triggerUploadOnSubmit){e.preventDefault();var n=So(e.target.elements),r=[];n.forEach((function(e){("BUTTON"===e.tagName||"INPUT"===e.tagName&&"submit"===e.type)&&!e.disabled&&(e.disabled=!0,r.push(e))})),this.uppy.upload().then((function(){r.forEach((function(e){e.disabled=!1}))}),(function(e){return r.forEach((function(e){e.disabled=!1})),Promise.reject(e)})).catch((function(e){t.uppy.log(e.stack||e.message||e)}))}},o.addResultToForm=function(e){this.uppy.log("[Form] Adding result to the original form:"),this.uppy.log(e);var t=this.form.querySelector('[name="'+this.opts.resultName+'"]');if(t)if(this.opts.multipleResults){var n;try{n=JSON.parse(t.value)}catch(Cd){}Array.isArray(n)||(n=[]),n.push(e),t.value=JSON.stringify(n)}else t.value=JSON.stringify(e);else(t=document.createElement("input")).name=this.opts.resultName,t.type="hidden",this.opts.multipleResults?t.value=JSON.stringify([e]):t.value=JSON.stringify(e),this.form.appendChild(t)},o.getMetaFromForm=function(){var e=df(this.form);delete e[this.opts.resultName],this.uppy.setMeta(e)},o.install=function(){this.form=se(this.opts.target),this.form&&"FORM"===this.form.nodeName?(this.form.addEventListener("submit",this.handleFormSubmit),this.uppy.on("upload",this.handleUploadStart),this.uppy.on("complete",this.handleSuccess)):this.uppy.log("Form plugin requires a <form> target element passed in options to operate, none was found","error")},o.uninstall=function(){this.form.removeEventListener("submit",this.handleFormSubmit),this.uppy.off("upload",this.handleUploadStart),this.uppy.off("complete",this.handleSuccess)},r}(pf),Kh.VERSION="1.3.31",Jh),ff={},mf="undefined"!=typeof navigator&&"serviceWorker"in navigator,vf=function(){function e(e){this.ready=new Promise((function(e,t){mf?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={},n=new Promise((function(e,n){t.resolve=e,t.reject=n}));console.log("Loading stored blobs from Service Worker");var r=function n(r){if(r.data.store===e.name)switch(r.data.type){case"uppy/ALL_FILES":t.resolve(r.data.files),navigator.serviceWorker.removeEventListener("message",n)}};return this.ready.then((function(){navigator.serviceWorker.addEventListener("message",r),navigator.serviceWorker.controller.postMessage({type:"uppy/GET_FILES",store:e.name})})),n},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}();vf.isSupported=mf,ff=vf;var gf={};function yf(){return(yf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var bf="undefined"!=typeof window&&(window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB),_f=!!bf;function wf(e){var t=bf.open(e,3);return new Promise((function(e,n){t.onupgradeneeded=function(t){var n=t.target.result,r=t.currentTarget.transaction;if(t.oldVersion<2&&n.createObjectStore("files",{keyPath:"id"}).createIndex("store","store",{unique:!1}),t.oldVersion<3){var o=r.objectStore("files");o.createIndex("expires","expires",{unique:!1}),o.openCursor().onsuccess=function(e){var t=e.target.result;if(t){var n=t.value;n.expires=Date.now()+864e5,t.update(n)}}}r.oncomplete=function(){e(n)}},t.onsuccess=function(t){e(t.target.result)},t.onerror=n}))}function Cf(e){return new Promise((function(t,n){e.onsuccess=function(e){t(e.target.result)},e.onerror=n}))}var Sf=!1,kf=function(){function e(t){var n=this;this.opts=yf({dbName:"uppy-blobs",storeName:"default",expires:864e5,maxFileSize:10485760,maxTotalSize:314572800},t),this.name=this.opts.storeName;var r=function(){return wf(n.opts.dbName)};Sf?this.ready=r():(Sf=!0,this.ready=e.cleanup().then(r,r))}var t=e.prototype;return t.key=function(e){return this.name+"!"+e},t.list=function(){var e=this;return this.ready.then((function(t){return Cf(t.transaction(["files"],"readonly").objectStore("files").index("store").getAll(IDBKeyRange.only(e.name)))})).then((function(e){var t={};return e.forEach((function(e){t[e.fileID]=e.data})),t}))},t.get=function(e){var t=this;return this.ready.then((function(n){return Cf(n.transaction(["files"],"readonly").objectStore("files").get(t.key(e)))})).then((function(e){return{id:e.data.fileID,data:e.data.data}}))},t.getSize=function(){var e=this;return this.ready.then((function(t){var n=t.transaction(["files"],"readonly").objectStore("files").index("store").openCursor(IDBKeyRange.only(e.name));return new Promise((function(e,t){var r=0;n.onsuccess=function(t){var n=t.target.result;n?(r+=n.value.data.size,n.continue()):e(r)},n.onerror=function(){t(new Error("Could not retrieve stored blobs size"))}}))}))},t.put=function(e){var t=this;return e.data.size>this.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(n){return Cf(n.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(n){return Cf(n.transaction(["files"],"readwrite").objectStore("files").delete(t.key(e)))}))},e.cleanup=function(){return wf("uppy-blobs").then((function(e){var t=e.transaction(["files"],"readwrite").objectStore("files").index("expires").openCursor(IDBKeyRange.upperBound(Date.now()));return new Promise((function(n,r){t.onsuccess=function(t){var r=t.target.result;if(r){var o=r.value;console.log("[IndexedDBStore] Deleting record",o.fileID,"of size",W(o.data.size),"- expired on",new Date(o.expires)),r.delete(),r.continue()}else n(e)},t.onerror=r}))})).then((function(e){e.close()}))},e}();function xf(){return(xf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Pf(e){try{return JSON.parse(e)}catch(Cd){return null}}kf.isSupported=_f,gf=kf;var Ef,Of,Af=!1,Uf=function(){function e(t){this.opts=xf({expires:864e5},t),this.name="uppyState:"+t.storeName,Af||(Af=!0,e.cleanup())}var t=e.prototype;return t.load=function(){var e=localStorage.getItem(this.name);if(!e)return null;var t=Pf(e);return t?t.metadata?t.metadata:(this.save(t),t):null},t.save=function(e){var t=Date.now()+this.opts.expires,n=JSON.stringify({metadata:e,expires:t});localStorage.setItem(this.name,n)},e.cleanup=function(e){if(e)localStorage.removeItem("uppyState:"+e);else{var t=function(){for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);/^uppyState:/.test(n)&&e.push(n.slice("uppyState:".length))}return e}(),n=Date.now();t.forEach((function(e){var t=localStorage.getItem("uppyState:"+e);if(!t)return null;var r=Pf(t);if(!r)return null;r.expires&&r.expires<n&&localStorage.removeItem("uppyState:"+e)}))}},e}();function Nf(){return(Nf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tf(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rf(e,t){return(Rf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Ff,Df,Mf=(Of=Ef=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).addBlobToStores=function(e){e.isRemote||(r.ServiceWorkerStore&&r.ServiceWorkerStore.put(e).catch((function(e){r.uppy.log("[GoldenRetriever] Could not store file","warning"),r.uppy.log(e)})),r.IndexedDBStore.put(e).catch((function(e){r.uppy.log("[GoldenRetriever] Could not store file","warning"),r.uppy.log(e)})))},r.removeBlobFromStores=function(e){r.ServiceWorkerStore&&r.ServiceWorkerStore.delete(e.id).catch((function(e){r.uppy.log("[GoldenRetriever] Failed to remove file","warning"),r.uppy.log(e)})),r.IndexedDBStore.delete(e.id).catch((function(e){r.uppy.log("[GoldenRetriever] Failed to remove file","warning"),r.uppy.log(e)}))},r.replaceBlobInStores=function(e){r.removeBlobFromStores(e),r.addBlobToStores(e)},r.handleRestoreConfirmed=function(){r.uppy.log("[GoldenRetriever] Restore confirmed, proceeding...");var e=r.uppy.getState().currentUploads;e&&(Object.keys(e).forEach((function(t){r.uppy.restore(t,e[t])})),r.uppy.resumeAll()),r.uppy.upload(),r.uppy.setState({recoveredState:null})},r.abortRestore=function(){r.uppy.log("[GoldenRetriever] Aborting restore...");var e=Object.keys(r.uppy.getState().files);r.deleteBlobs(e).then((function(){r.uppy.log("[GoldenRetriever] Removed "+e.length+" files")})).catch((function(t){r.uppy.log("[GoldenRetriever] Could not remove "+e.length+" files","warning"),r.uppy.log(t)})),r.uppy.cancelAll(),r.uppy.setState({recoveredState:null}),Uf.cleanup(r.uppy.opts.id)},r.handleComplete=function(e){var t=e.successful,n=t.map((function(e){return e.id}));r.deleteBlobs(n).then((function(){r.uppy.log("[GoldenRetriever] Removed "+t.length+" files that finished uploading")})).catch((function(e){r.uppy.log("[GoldenRetriever] Could not remove "+t.length+" files that finished uploading","warning"),r.uppy.log(e)})),r.uppy.setState({recoveredState:null}),Uf.cleanup(r.uppy.opts.id)},r.restoreBlobs=function(){r.uppy.getFiles().length>0?Promise.all([r.loadFileBlobsFromServiceWorker(),r.loadFileBlobsFromIndexedDB()]).then((function(e){var t=Nf({},e[0],e[1]);r.onBlobsLoaded(t)})):(r.uppy.log("[GoldenRetriever] No files need to be loaded, only restoring processing state..."),r.onBlobsLoaded([]))},r.type="debugger",r.id=r.opts.id||"GoldenRetriever",r.title="Golden Retriever",r.opts=Nf({},{expires:864e5,serviceWorker:!1},n),r.MetaDataStore=new Uf({expires:r.opts.expires,storeName:t.getID()}),r.ServiceWorkerStore=null,r.opts.serviceWorker&&(r.ServiceWorkerStore=new ff({storeName:t.getID()})),r.IndexedDBStore=new gf(Nf({expires:r.opts.expires},r.opts.indexedDB||{},{storeName:t.getID()})),r.saveFilesStateToLocalStorage=z(r.saveFilesStateToLocalStorage.bind(Tf(r)),500,{leading:!0,trailing:!0}),r.restoreState=r.restoreState.bind(Tf(r)),r.loadFileBlobsFromServiceWorker=r.loadFileBlobsFromServiceWorker.bind(Tf(r)),r.loadFileBlobsFromIndexedDB=r.loadFileBlobsFromIndexedDB.bind(Tf(r)),r.onBlobsLoaded=r.onBlobsLoaded.bind(Tf(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Rf(t,n);var o=r.prototype;return o.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)},o.getWaitingFiles=function(){var e={};return this.uppy.getFiles().forEach((function(t){t.progress&&t.progress.uploadStarted||(e[t.id]=t)})),e},o.getUploadingFiles=function(){var e=this,t={},n=this.uppy.getState().currentUploads;return n&&Object.keys(n).forEach((function(r){n[r].fileIDs.forEach((function(n){t[n]=e.uppy.getFile(n)}))})),t},o.saveFilesStateToLocalStorage=function(){var e=Nf({},this.getWaitingFiles(),this.getUploadingFiles());if(0===Object.keys(e).length)return this.uppy.setState({recoveredState:null}),void Uf.cleanup(this.uppy.opts.id);var t={};Object.keys(e).forEach((function(n){e[n].isRemote?t[n]=Nf({},e[n],{isRestored:!0}):t[n]=Nf({},e[n],{isRestored:!0,data:null,preview:null})}));var n={};this.uppy.emit("restore:get-data",(function(e){Nf(n,e)}));var r=this.uppy.getState().currentUploads;this.MetaDataStore.save({currentUploads:r,files:t,pluginData:n})},o.loadFileBlobsFromServiceWorker=function(){var e=this;return this.ServiceWorkerStore?this.ServiceWorkerStore.list().then((function(t){var n=e.uppy.getFiles().filter((function(e){return!e.isRemote})),r=Object.keys(t).length;return r===n.length?(e.uppy.log("[GoldenRetriever] Successfully recovered "+r+" 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({})},o.loadFileBlobsFromIndexedDB=function(){var e=this;return this.IndexedDBStore.list().then((function(t){var n=Object.keys(t).length;return n>0?(e.uppy.log("[GoldenRetriever] Successfully recovered "+n+" 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),{}}))},o.onBlobsLoaded=function(e){var t=this,n=[],r=Nf({},this.uppy.getState().files);Object.keys(e).forEach((function(o){var i=t.uppy.getFile(o);if(i){var a={data:e[o],isRestored:!0,isGhost:!1};r[o]=Nf({},i,a)}else n.push(o)})),Object.keys(r).forEach((function(e){null===r[e].data&&(r[e]=Nf({},r[e],{isGhost:!0}))})),this.uppy.setState({files:r}),this.uppy.emit("restored",this.savedPluginData),n.length&&this.deleteBlobs(n).then((function(){t.uppy.log("[GoldenRetriever] Cleaned up "+n.length+" old files")})).catch((function(e){t.uppy.log("[GoldenRetriever] Could not clean up "+n.length+" old files","warning"),t.uppy.log(e)}))},o.deleteBlobs=function(e){var t=this,n=[];return e.forEach((function(e){t.ServiceWorkerStore&&n.push(t.ServiceWorkerStore.delete(e)),t.IndexedDBStore&&n.push(t.IndexedDBStore.delete(e))})),Promise.all(n)},o.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)},o.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)},r}(ue.Plugin),Ef.VERSION="1.4.2",Of);function Bf(){return(Bf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function If(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Lf(e,t){return(Lf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var jf=(Df=Ff=function(e){var t,n;function r(t,n){var r;return(r=e.call(this,t,n)||this).type="debugger",r.id=r.opts.id||"ReduxDevTools",r.title="Redux DevTools",r.opts=Bf({},{},n),r.handleStateChange=r.handleStateChange.bind(If(r)),r.initDevTools=r.initDevTools.bind(If(r)),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Lf(t,n);var o=r.prototype;return o.handleStateChange=function(e,t,n){this.devTools.send("UPPY_STATE_UPDATE",t)},o.initDevTools=function(){var e=this;this.devTools=window.devToolsExtension.connect(),this.devToolsUnsubscribe=this.devTools.subscribe((function(t){if("DISPATCH"===t.type)switch(t.payload.type){case"RESET":return void e.uppy.reset();case"IMPORT_STATE":var n=t.payload.nextLiftedState.computedStates;return e.uppy.store.state=Bf({},e.uppy.getState(),n[n.length-1].state),void e.uppy.updateAll(e.uppy.getState());case"JUMP_TO_STATE":case"JUMP_TO_ACTION":e.uppy.store.state=Bf({},e.uppy.getState(),JSON.parse(t.state)),e.uppy.updateAll(e.uppy.getState())}}))},o.install=function(){this.withDevTools="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__,this.withDevTools&&(this.initDevTools(),this.uppy.on("state-update",this.handleStateChange))},o.uninstall=function(){this.withDevTools&&(this.devToolsUnsubscribe(),this.uppy.off("state-update",this.handleStateUpdate))},r}(ue.Plugin),Ff.VERSION="1.3.9",Df),zf={};zf.Core=ue,zf.debugLogger=zf.Core.debugLogger,zf.server=Qe,zf.views={ProviderView:en},zf.DefaultStore=q,zf.ReduxStore=Qt,zf.Dashboard=$o,zf.DragDrop=oi,zf.DropTarget=ui,zf.FileInput=yi,zf.Informer=to,zf.ProgressBar=Pi,zf.StatusBar=$r,zf.ImageEditor=ji,zf.Dropbox=Yi,zf.GoogleDrive=sa,zf.Instagram=ga,zf.OneDrive=Ea,zf.Box=Ba,zf.Facebook=Ga,zf.Unsplash=ts,zf.Url=gs,zf.Webcam=Ks,zf.ScreenCapture=_l,zf.AwsS3=ql,zf.AwsS3Multipart=wu,zf.Transloadit=Nh,zf.Tus=ap,zf.XHRUpload=Yh,zf.Form=hf,zf.GoldenRetriever=Mf,zf.ReduxDevTools=jf,zf.ThumbnailGenerator=wo,zf.locales={};return zf})); //# sourceMappingURL=uppy.min.js.map
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0.02 |
proxy
|
phpinfo
|
Настройка