Files
fs a101b0c3ec Stadionzeitung, Veranstaltungen, News-Artikel, Lightbox und Anzeigen-Verteilung
Stadionzeitung: Live-Seiten (Tabellen, Ergebnisse, Vorschau, Termine, News,
Kontakt, Historie, Sportheim, Partner, Momente, Impressum), automatisches Cover,
Swipe-Viewer mit Vollbildmodus und die Druckfassung als Falt-Heft. Anzeigen
kommen jetzt aus dem Bestand und werden gleichmäßig verteilt, nie mehr als zwei
hintereinander (vorher vier Blöcke à fünf). Die Doppelseiten-Regel rechnet das
Skript selbst, statt sie von Hand zu prüfen.

Veranstaltungen: Bereich /veranstaltungen mit Detailseite pro Fest, Lebenszyklus
über das Datum (Ankündigung vor dem Fest, Rückblick danach), Galerie mit
Lightbox. veranstaltungen.json ist dritte Termin-Quelle, damit ein Fest nie
doppelt gepflegt wird.

News-Artikel als dritte dynamische Prefix-Route, gemeinsamer detail-head.

Behobene Fehler:
- Wappen-Kontexte setzten Zeilen-Layout auf .crest statt auf die Zeile; das
  Wappen wurde zum Grid, Vereinsname und Tore rutschten darunter zusammen
  (Ergebnis-Rückblick, Vorschau, Cover).
- --header-h (60px) unterschätzt die Kopfleiste um 32px (Logo 72px + 20px
  Versatz): neues abgeleitetes --header-space, sonst klebten Zurück-Links
  unter dem Logo.
- base_url in der Produktions-Config ohne www, während .htaccess auf www
  umleitet; preflight prüft das jetzt.
- .lightbox brauchte display:none mit (0,2,0), sonst lag das Overlay offen.

Neue Werkzeuge: bin/anzeige-add.php (Anzeigen-Bestand), bin/veranstaltung-bilder.php
(Plakate und Galerien, Alt-Texte folgen der Quelldatei), bin/qr.php (Druck-QR mit
Warnung, wenn base_url nicht auf die echte Domain zeigt).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NzeVVgMCrzCDJAKeLEdKr7
2026-07-31 14:55:27 +02:00

70 lines
552 KiB
JavaScript

"use strict";(()=>{var b1=Object.create;var Hl=Object.defineProperty;var w1=Object.getOwnPropertyDescriptor;var S1=Object.getOwnPropertyNames;var P1=Object.getPrototypeOf,_1=Object.prototype.hasOwnProperty;var o=(i,e)=>Hl(i,"name",{value:e,configurable:!0});var ve=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),ql=(i,e)=>{for(var t in e)Hl(i,t,{get:e[t],enumerable:!0})},x1=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of S1(e))!_1.call(i,s)&&s!==t&&Hl(i,s,{get:()=>e[s],enumerable:!(r=w1(e,s))||r.enumerable});return i};var be=(i,e,t)=>(t=i!=null?b1(P1(i)):{},x1(e||!i||!i.__esModule?Hl(t,"default",{value:i,enumerable:!0}):t,i));var bc=ve((PE,qf)=>{qf.exports=o(function(){var e={},t=e._fns={};e.emit=o(function(a,l,u,h,d,f,y){var w=r(a);w.length&&s(a,w,[l,u,h,d,f,y])},"emit"),e.on=o(function(a,l){t[a]||(t[a]=[]),t[a].push(l)},"on"),e.once=o(function(a,l){function u(){l.apply(this,arguments),e.off(a,u)}o(u,"one"),this.on(a,u)},"once"),e.off=o(function(a,l){var u=[];if(a&&l){var h=this._fns[a],d=0,f=h?h.length:0;for(d;d<f;d++)h[d]!==l&&u.push(h[d])}u.length?this._fns[a]=u:delete this._fns[a]},"off");function r(n){var a=t[n]?t[n]:[],l=n.indexOf(":"),u=l===-1?[n]:[n.substring(0,l),n.substring(l+1)],h=Object.keys(t),d=0,f=h.length;for(d;d<f;d++){var y=h[d];if(y==="*"&&(a=a.concat(t[y])),u.length===2&&u[0]===y){a=a.concat(t[y]);break}}return a}o(r,"getListeners");function s(n,a,l){var u=0,h=a.length;for(u;u<h&&a[u];u++)a[u].event=n,a[u].apply(a[u],l)}return o(s,"emitAll"),e},"createNamespaceEmitter")});var Vl=ve((EE,$f)=>{function T1(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}o(T1,"isObject");$f.exports=T1});var Wf=ve((CE,Vf)=>{var R1=typeof global=="object"&&global&&global.Object===Object&&global;Vf.exports=R1});var wc=ve((AE,Gf)=>{var k1=Wf(),U1=typeof self=="object"&&self&&self.Object===Object&&self,D1=k1||U1||Function("return this")();Gf.exports=D1});var Xf=ve((TE,Kf)=>{var I1=wc(),L1=o(function(){return I1.Date.now()},"now");Kf.exports=L1});var Qf=ve((kE,Yf)=>{var N1=/\s/;function M1(i){for(var e=i.length;e--&&N1.test(i.charAt(e)););return e}o(M1,"trimmedEndIndex");Yf.exports=M1});var Zf=ve((DE,Jf)=>{var B1=Qf(),j1=/^\s+/;function z1(i){return i&&i.slice(0,B1(i)+1).replace(j1,"")}o(z1,"baseTrim");Jf.exports=z1});var Sc=ve((LE,em)=>{var H1=wc(),q1=H1.Symbol;em.exports=q1});var sm=ve((NE,rm)=>{var tm=Sc(),im=Object.prototype,$1=im.hasOwnProperty,V1=im.toString,bn=tm?tm.toStringTag:void 0;function W1(i){var e=$1.call(i,bn),t=i[bn];try{i[bn]=void 0;var r=!0}catch{}var s=V1.call(i);return r&&(e?i[bn]=t:delete i[bn]),s}o(W1,"getRawTag");rm.exports=W1});var nm=ve((BE,om)=>{var G1=Object.prototype,K1=G1.toString;function X1(i){return K1.call(i)}o(X1,"objectToString");om.exports=X1});var cm=ve((zE,um)=>{var am=Sc(),Y1=sm(),Q1=nm(),J1="[object Null]",Z1="[object Undefined]",lm=am?am.toStringTag:void 0;function ew(i){return i==null?i===void 0?Z1:J1:lm&&lm in Object(i)?Y1(i):Q1(i)}o(ew,"baseGetTag");um.exports=ew});var dm=ve((qE,hm)=>{function tw(i){return i!=null&&typeof i=="object"}o(tw,"isObjectLike");hm.exports=tw});var fm=ve((VE,pm)=>{var iw=cm(),rw=dm(),sw="[object Symbol]";function ow(i){return typeof i=="symbol"||rw(i)&&iw(i)==sw}o(ow,"isSymbol");pm.exports=ow});var vm=ve((GE,ym)=>{var nw=Zf(),mm=Vl(),aw=fm(),gm=NaN,lw=/^[-+]0x[0-9a-f]+$/i,uw=/^0b[01]+$/i,cw=/^0o[0-7]+$/i,hw=parseInt;function dw(i){if(typeof i=="number")return i;if(aw(i))return gm;if(mm(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=mm(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=nw(i);var t=uw.test(i);return t||cw.test(i)?hw(i.slice(2),t?2:8):lw.test(i)?gm:+i}o(dw,"toNumber");ym.exports=dw});var _c=ve((XE,wm)=>{var pw=Vl(),Pc=Xf(),bm=vm(),fw="Expected a function",mw=Math.max,gw=Math.min;function yw(i,e,t){var r,s,n,a,l,u,h=0,d=!1,f=!1,y=!0;if(typeof i!="function")throw new TypeError(fw);e=bm(e)||0,pw(t)&&(d=!!t.leading,f="maxWait"in t,n=f?mw(bm(t.maxWait)||0,e):n,y="trailing"in t?!!t.trailing:y);function w($){var G=r,te=s;return r=s=void 0,h=$,a=i.apply(te,G),a}o(w,"invokeFunc");function S($){return h=$,l=setTimeout(_,e),d?w($):a}o(S,"leadingEdge");function T($){var G=$-u,te=$-h,re=e-G;return f?gw(re,n-te):re}o(T,"remainingWait");function C($){var G=$-u,te=$-h;return u===void 0||G>=e||G<0||f&&te>=n}o(C,"shouldInvoke");function _(){var $=Pc();if(C($))return R($);l=setTimeout(_,T($))}o(_,"timerExpired");function R($){return l=void 0,y&&r?w($):(r=s=void 0,a)}o(R,"trailingEdge");function q(){l!==void 0&&clearTimeout(l),h=0,r=u=s=l=void 0}o(q,"cancel");function W(){return l===void 0?a:R(Pc())}o(W,"flush");function K(){var $=Pc(),G=C($);if(r=arguments,s=this,u=$,G){if(l===void 0)return S(u);if(f)return clearTimeout(l),l=setTimeout(_,e),w(u)}return l===void 0&&(l=setTimeout(_,e)),a}return o(K,"debounced"),K.cancel=q,K.flush=W,K}o(yw,"debounce");wm.exports=yw});var Wl=ve((QE,Sm)=>{var vw=_c(),bw=Vl(),ww="Expected a function";function Sw(i,e,t){var r=!0,s=!0;if(typeof i!="function")throw new TypeError(ww);return bw(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),vw(i,e,{leading:r,maxWait:e,trailing:s})}o(Sw,"throttle");Sm.exports=Sw});var _n=ve((b3,Em)=>{"use strict";Em.exports=o(function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return`${(t?"-":"")+e} B`;let s=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/1024**s);let n=r[s];return e>=10||e%1===0?`${(t?"-":"")+e.toFixed(0)} ${n}`:`${(t?"-":"")+e.toFixed(1)} ${n}`},"prettierBytes")});var Am=ve((S3,Cm)=>{"use strict";function Om(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}o(Om,"WildcardMatcher");Om.prototype.match=function(i){var e=!0,t=this.parts,r,s=t.length,n;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)e=!1;else{for(n=(i||"").split(this.separator),r=0;e&&r<s;r++)t[r]!=="*"&&(r<n.length?e=t[r]===n[r]:e=!1);e=e&&n}else if(typeof i.splice=="function")for(e=[],r=i.length;r--;)this.match(i[r])&&(e[e.length]=i[r]);else if(typeof i=="object"){e={};for(var a in i)this.match(a)&&(e[a]=i[a])}return e};Cm.exports=function(i,e,t){var r=new Om(i,t||/[\/\.]/);return typeof e<"u"?r.match(e):r}});var Rm=ve((_3,Tm)=>{var Ow=Am(),Cw=/[\/\+\.]/;Tm.exports=function(i,e){function t(r){var s=Ow(r,i,Cw);return s&&s.length>=2}return o(t,"test"),e?t(e.split(";")[0]):t}});var sg=ve((dO,rg)=>{function _i(i,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}o(_i,"RetryOperation");rg.exports=_i;_i.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};_i.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};_i.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var e=new Date().getTime();if(i&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(i),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};_i.prototype.attempt=function(i,e){this._fn=i,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};_i.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)};_i.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)};_i.prototype.start=_i.prototype.try;_i.prototype.errors=function(){return this._errors};_i.prototype.attempts=function(){return this._attempts};_i.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},e=null,t=0,r=0;r<this._errors.length;r++){var s=this._errors[r],n=s.message,a=(i[n]||0)+1;i[n]=a,a>=t&&(e=s,t=a)}return e}});var og=ve(Fs=>{var eS=sg();Fs.operation=function(i){var e=Fs.timeouts(i);return new eS(e,{forever:i&&(i.forever||i.retries===1/0),unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};Fs.timeouts=function(i){if(i instanceof Array)return[].concat(i);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in i)e[t]=i[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s<e.retries;s++)r.push(this.createTimeout(s,e));return i&&i.forever&&!r.length&&r.push(this.createTimeout(s,e)),r.sort(function(n,a){return n-a}),r};Fs.createTimeout=function(i,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,i));return r=Math.min(r,e.maxTimeout),r};Fs.wrap=function(i,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in i)typeof i[r]=="function"&&t.push(r)}for(var s=0;s<t.length;s++){var n=t[s],a=i[n];i[n]=o(function(u){var h=Fs.operation(e),d=Array.prototype.slice.call(arguments,1),f=d.pop();d.push(function(y){h.retry(y)||(y&&(arguments[0]=h.mainError()),f.apply(this,arguments))}),h.attempt(function(){u.apply(i,d)})},"retryWrapper").bind(i,a),i[n].options=e}}});var ag=ve((gO,ng)=>{ng.exports=og()});var wg=ve((uC,Kc)=>{"use strict";var _S=Object.prototype.hasOwnProperty,Nt="~";function zn(){}o(zn,"Events");Object.create&&(zn.prototype=Object.create(null),new zn().__proto__||(Nt=!1));function xS(i,e,t){this.fn=i,this.context=e,this.once=t||!1}o(xS,"EE");function bg(i,e,t,r,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new xS(t,r||i,s),a=Nt?Nt+e:e;return i._events[a]?i._events[a].fn?i._events[a]=[i._events[a],n]:i._events[a].push(n):(i._events[a]=n,i._eventsCount++),i}o(bg,"addListener");function lu(i,e){--i._eventsCount===0?i._events=new zn:delete i._events[e]}o(lu,"clearEvent");function Lt(){this._events=new zn,this._eventsCount=0}o(Lt,"EventEmitter");Lt.prototype.eventNames=o(function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)_S.call(t,r)&&e.push(Nt?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},"eventNames");Lt.prototype.listeners=o(function(e){var t=Nt?Nt+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,a=new Array(n);s<n;s++)a[s]=r[s].fn;return a},"listeners");Lt.prototype.listenerCount=o(function(e){var t=Nt?Nt+e:e,r=this._events[t];return r?r.fn?1:r.length:0},"listenerCount");Lt.prototype.emit=o(function(e,t,r,s,n,a){var l=Nt?Nt+e:e;if(!this._events[l])return!1;var u=this._events[l],h=arguments.length,d,f;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,s),!0;case 5:return u.fn.call(u.context,t,r,s,n),!0;case 6:return u.fn.call(u.context,t,r,s,n,a),!0}for(f=1,d=new Array(h-1);f<h;f++)d[f-1]=arguments[f];u.fn.apply(u.context,d)}else{var y=u.length,w;for(f=0;f<y;f++)switch(u[f].once&&this.removeListener(e,u[f].fn,void 0,!0),h){case 1:u[f].fn.call(u[f].context);break;case 2:u[f].fn.call(u[f].context,t);break;case 3:u[f].fn.call(u[f].context,t,r);break;case 4:u[f].fn.call(u[f].context,t,r,s);break;default:if(!d)for(w=1,d=new Array(h-1);w<h;w++)d[w-1]=arguments[w];u[f].fn.apply(u[f].context,d)}}return!0},"emit");Lt.prototype.on=o(function(e,t,r){return bg(this,e,t,r,!1)},"on");Lt.prototype.once=o(function(e,t,r){return bg(this,e,t,r,!0)},"once");Lt.prototype.removeListener=o(function(e,t,r,s){var n=Nt?Nt+e:e;if(!this._events[n])return this;if(!t)return lu(this,n),this;var a=this._events[n];if(a.fn)a.fn===t&&(!s||a.once)&&(!r||a.context===r)&&lu(this,n);else{for(var l=0,u=[],h=a.length;l<h;l++)(a[l].fn!==t||s&&!a[l].once||r&&a[l].context!==r)&&u.push(a[l]);u.length?this._events[n]=u.length===1?u[0]:u:lu(this,n)}return this},"removeListener");Lt.prototype.removeAllListeners=o(function(e){var t;return e?(t=Nt?Nt+e:e,this._events[t]&&lu(this,t)):(this._events=new zn,this._eventsCount=0),this},"removeAllListeners");Lt.prototype.off=Lt.prototype.removeListener;Lt.prototype.addListener=Lt.prototype.on;Lt.prefixed=Nt;Lt.EventEmitter=Lt;typeof Kc<"u"&&(Kc.exports=Lt)});var li=ve((HC,wu)=>{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var t=[],r=0;r<arguments.length;r++){var s=arguments[r];if(s){var n=typeof s;if(n==="string"||n==="number")t.push(s);else if(Array.isArray(s)){if(s.length){var a=e.apply(null,s);a&&t.push(a)}}else if(n==="object")if(s.toString===Object.prototype.toString)for(var l in s)i.call(s,l)&&s[l]&&t.push(l);else t.push(s.toString())}}return t.join(" ")}o(e,"classNames"),typeof wu<"u"&&wu.exports?(e.default=e,wu.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var Ly=ve((Q4,Iy)=>{Iy.exports=o(function(e,t){if(e===t)return!0;for(var r in e)if(!(r in t))return!1;for(var r in t)if(e[r]!==t[r])return!1;return!0},"isShallowEqual")});var av=ve((fd,md)=>{(function(i,e){typeof fd=="object"&&typeof md<"u"?md.exports=e():typeof define=="function"&&define.amd?define(e):(i=i||self,i.Cropper=e())})(fd,function(){"use strict";function i(v){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?i=o(function(p){return typeof p},"_typeof"):i=o(function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},"_typeof"),i(v)}o(i,"_typeof");function e(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}o(e,"_classCallCheck");function t(v,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(v,m.key,m)}}o(t,"_defineProperties");function r(v,p,g){return p&&t(v.prototype,p),g&&t(v,g),v}o(r,"_createClass");function s(v,p,g){return p in v?Object.defineProperty(v,p,{value:g,enumerable:!0,configurable:!0,writable:!0}):v[p]=g,v}o(s,"_defineProperty");function n(v,p){var g=Object.keys(v);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(v);p&&(m=m.filter(function(x){return Object.getOwnPropertyDescriptor(v,x).enumerable})),g.push.apply(g,m)}return g}o(n,"ownKeys");function a(v){for(var p=1;p<arguments.length;p++){var g=arguments[p]!=null?arguments[p]:{};p%2?n(Object(g),!0).forEach(function(m){s(v,m,g[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(g)):n(Object(g)).forEach(function(m){Object.defineProperty(v,m,Object.getOwnPropertyDescriptor(g,m))})}return v}o(a,"_objectSpread2");function l(v){return u(v)||h(v)||d(v)||y()}o(l,"_toConsumableArray");function u(v){if(Array.isArray(v))return f(v)}o(u,"_arrayWithoutHoles");function h(v){if(typeof Symbol<"u"&&Symbol.iterator in Object(v))return Array.from(v)}o(h,"_iterableToArray");function d(v,p){if(v){if(typeof v=="string")return f(v,p);var g=Object.prototype.toString.call(v).slice(8,-1);if(g==="Object"&&v.constructor&&(g=v.constructor.name),g==="Map"||g==="Set")return Array.from(v);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return f(v,p)}}o(d,"_unsupportedIterableToArray");function f(v,p){(p==null||p>v.length)&&(p=v.length);for(var g=0,m=new Array(p);g<p;g++)m[g]=v[g];return m}o(f,"_arrayLikeToArray");function y(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}o(y,"_nonIterableSpread");var w=typeof window<"u"&&typeof window.document<"u",S=w?window:{},T=w&&S.document.documentElement?"ontouchstart"in S.document.documentElement:!1,C=w?"PointerEvent"in S:!1,_="cropper",R="all",q="crop",W="move",K="zoom",$="e",G="w",te="s",re="n",Te="ne",Ke="nw",He="se",we="sw",Pe="".concat(_,"-crop"),Ie="".concat(_,"-disabled"),O="".concat(_,"-hidden"),P="".concat(_,"-hide"),E="".concat(_,"-invisible"),L="".concat(_,"-modal"),z="".concat(_,"-move"),B="".concat(_,"Action"),D="".concat(_,"Preview"),A="crop",k="move",N="none",Y="crop",Q="cropend",Oe="cropmove",ge="cropstart",ue="dblclick",ce=T?"touchstart":"mousedown",ke=T?"touchmove":"mousemove",Le=T?"touchend touchcancel":"mouseup",Rt=C?"pointerdown":ce,qe=C?"pointermove":ke,oe=C?"pointerup pointercancel":Le,kt="ready",rt="resize",rr="wheel",ds="zoom",Jr="image/jpeg",ps=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,fs=/^data:/,ms=/^data:image\/jpeg;base64,/,Zr=/^img|canvas$/i,lt={viewMode:0,dragMode:A,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},mt='<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>',Dl=Number.isNaN||S.isNaN;function he(v){return typeof v=="number"&&!Dl(v)}o(he,"isNumber");var dn=o(function(p){return p>0&&p<1/0},"isPositiveNumber");function Ro(v){return typeof v>"u"}o(Ro,"isUndefined");function $i(v){return i(v)==="object"&&v!==null}o($i,"isObject");var Il=Object.prototype.hasOwnProperty;function sr(v){if(!$i(v))return!1;try{var p=v.constructor,g=p.prototype;return p&&g&&Il.call(g,"isPrototypeOf")}catch{return!1}}o(sr,"isPlainObject");function St(v){return typeof v=="function"}o(St,"isFunction");var Ll=Array.prototype.slice;function Nl(v){return Array.from?Array.from(v):Ll.call(v)}o(Nl,"toArray");function $e(v,p){return v&&St(p)&&(Array.isArray(v)||he(v.length)?Nl(v).forEach(function(g,m){p.call(v,g,m,v)}):$i(v)&&Object.keys(v).forEach(function(g){p.call(v,v[g],g,v)})),v}o($e,"forEach");var Ce=Object.assign||o(function(p){for(var g=arguments.length,m=new Array(g>1?g-1:0),x=1;x<g;x++)m[x-1]=arguments[x];return $i(p)&&m.length>0&&m.forEach(function(b){$i(b)&&Object.keys(b).forEach(function(F){p[F]=b[F]})}),p},"assign"),mc=/\.\d*(?:0|9){12}\d*$/;function Vi(v){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return mc.test(v)?Math.round(v*p)/p:v}o(Vi,"normalizeDecimalNumber");var Ml=/^width|height|left|top|marginLeft|marginTop$/;function Ai(v,p){var g=v.style;$e(p,function(m,x){Ml.test(x)&&he(m)&&(m="".concat(m,"px")),g[x]=m})}o(Ai,"setStyle");function pn(v,p){return v.classList?v.classList.contains(p):v.className.indexOf(p)>-1}o(pn,"hasClass");function Ve(v,p){if(p){if(he(v.length)){$e(v,function(m){Ve(m,p)});return}if(v.classList){v.classList.add(p);return}var g=v.className.trim();g?g.indexOf(p)<0&&(v.className="".concat(g," ").concat(p)):v.className=p}}o(Ve,"addClass");function ti(v,p){if(p){if(he(v.length)){$e(v,function(g){ti(g,p)});return}if(v.classList){v.classList.remove(p);return}v.className.indexOf(p)>=0&&(v.className=v.className.replace(p,""))}}o(ti,"removeClass");function or(v,p,g){if(p){if(he(v.length)){$e(v,function(m){or(m,p,g)});return}g?Ve(v,p):ti(v,p)}}o(or,"toggleClass");var Bl=/([a-z\d])([A-Z])/g;function ko(v){return v.replace(Bl,"$1-$2").toLowerCase()}o(ko,"toParamCase");function Uo(v,p){return $i(v[p])?v[p]:v.dataset?v.dataset[p]:v.getAttribute("data-".concat(ko(p)))}o(Uo,"getData");function Do(v,p,g){$i(g)?v[p]=g:v.dataset?v.dataset[p]=g:v.setAttribute("data-".concat(ko(p)),g)}o(Do,"setData");function gs(v,p){if($i(v[p]))try{delete v[p]}catch{v[p]=void 0}else if(v.dataset)try{delete v.dataset[p]}catch{v.dataset[p]=void 0}else v.removeAttribute("data-".concat(ko(p)))}o(gs,"removeData");var fn=/\s\s*/,mn=function(){var v=!1;if(w){var p=!1,g=o(function(){},"listener"),m=Object.defineProperty({},"once",{get:o(function(){return v=!0,p},"get"),set:o(function(b){p=b},"set")});S.addEventListener("test",g,m),S.removeEventListener("test",g,m)}return v}();function gt(v,p,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},x=g;p.trim().split(fn).forEach(function(b){if(!mn){var F=v.listeners;F&&F[b]&&F[b][g]&&(x=F[b][g],delete F[b][g],Object.keys(F[b]).length===0&&delete F[b],Object.keys(F).length===0&&delete v.listeners)}v.removeEventListener(b,x,m)})}o(gt,"removeListener");function Ut(v,p,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},x=g;p.trim().split(fn).forEach(function(b){if(m.once&&!mn){var F=v.listeners,U=F===void 0?{}:F;x=o(function(){delete U[b][g],v.removeEventListener(b,x,m);for(var j=arguments.length,M=new Array(j),I=0;I<j;I++)M[I]=arguments[I];g.apply(v,M)},"handler"),U[b]||(U[b]={}),U[b][g]&&v.removeEventListener(b,U[b][g],m),U[b][g]=x,v.listeners=U}v.addEventListener(b,x,m)})}o(Ut,"addListener");function wi(v,p,g){var m;return St(Event)&&St(CustomEvent)?m=new CustomEvent(p,{detail:g,bubbles:!0,cancelable:!0}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(p,!0,!0,g)),v.dispatchEvent(m)}o(wi,"dispatchEvent");function kf(v){var p=v.getBoundingClientRect();return{left:p.left+(window.pageXOffset-document.documentElement.clientLeft),top:p.top+(window.pageYOffset-document.documentElement.clientTop)}}o(kf,"getOffset");var gc=S.location,Z0=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Uf(v){var p=v.match(Z0);return p!==null&&(p[1]!==gc.protocol||p[2]!==gc.hostname||p[3]!==gc.port)}o(Uf,"isCrossOriginURL");function Df(v){var p="timestamp=".concat(new Date().getTime());return v+(v.indexOf("?")===-1?"?":"&")+p}o(Df,"addTimestamp");function gn(v){var p=v.rotate,g=v.scaleX,m=v.scaleY,x=v.translateX,b=v.translateY,F=[];he(x)&&x!==0&&F.push("translateX(".concat(x,"px)")),he(b)&&b!==0&&F.push("translateY(".concat(b,"px)")),he(p)&&p!==0&&F.push("rotate(".concat(p,"deg)")),he(g)&&g!==1&&F.push("scaleX(".concat(g,")")),he(m)&&m!==1&&F.push("scaleY(".concat(m,")"));var U=F.length?F.join(" "):"none";return{WebkitTransform:U,msTransform:U,transform:U}}o(gn,"getTransforms");function e1(v){var p=a({},v),g=[];return $e(v,function(m,x){delete p[x],$e(p,function(b){var F=Math.abs(m.startX-b.startX),U=Math.abs(m.startY-b.startY),V=Math.abs(m.endX-b.endX),j=Math.abs(m.endY-b.endY),M=Math.sqrt(F*F+U*U),I=Math.sqrt(V*V+j*j),H=(I-M)/M;g.push(H)})}),g.sort(function(m,x){return Math.abs(m)<Math.abs(x)}),g[0]}o(e1,"getMaxZoomRatio");function jl(v,p){var g=v.pageX,m=v.pageY,x={endX:g,endY:m};return p?x:a({startX:g,startY:m},x)}o(jl,"getPointer");function t1(v){var p=0,g=0,m=0;return $e(v,function(x){var b=x.startX,F=x.startY;p+=b,g+=F,m+=1}),p/=m,g/=m,{pageX:p,pageY:g}}o(t1,"getPointersCenter");function es(v){var p=v.aspectRatio,g=v.height,m=v.width,x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",b=dn(m),F=dn(g);if(b&&F){var U=g*p;x==="contain"&&U>m||x==="cover"&&U<m?g=m/p:m=g*p}else b?g=m/p:F&&(m=g*p);return{width:m,height:g}}o(es,"getAdjustedSizes");function i1(v){var p=v.width,g=v.height,m=v.degree;if(m=Math.abs(m)%180,m===90)return{width:g,height:p};var x=m%90*Math.PI/180,b=Math.sin(x),F=Math.cos(x),U=p*F+g*b,V=p*b+g*F;return m>90?{width:V,height:U}:{width:U,height:V}}o(i1,"getRotatedSizes");function r1(v,p,g,m){var x=p.aspectRatio,b=p.naturalWidth,F=p.naturalHeight,U=p.rotate,V=U===void 0?0:U,j=p.scaleX,M=j===void 0?1:j,I=p.scaleY,H=I===void 0?1:I,ye=g.aspectRatio,fe=g.naturalWidth,Ue=g.naturalHeight,_e=m.fillColor,ut=_e===void 0?"transparent":_e,yt=m.imageSmoothingEnabled,st=yt===void 0?!0:yt,nr=m.imageSmoothingQuality,ii=nr===void 0?"low":nr,X=m.maxWidth,xe=X===void 0?1/0:X,ct=m.maxHeight,Si=ct===void 0?1/0:ct,ar=m.minWidth,ys=ar===void 0?0:ar,vs=m.minHeight,ts=vs===void 0?0:vs,Wi=document.createElement("canvas"),Kt=Wi.getContext("2d"),bs=es({aspectRatio:ye,width:xe,height:Si}),zl=es({aspectRatio:ye,width:ys,height:ts},"cover"),yc=Math.min(bs.width,Math.max(zl.width,fe)),vc=Math.min(bs.height,Math.max(zl.height,Ue)),Nf=es({aspectRatio:x,width:xe,height:Si}),Mf=es({aspectRatio:x,width:ys,height:ts},"cover"),Bf=Math.min(Nf.width,Math.max(Mf.width,b)),jf=Math.min(Nf.height,Math.max(Mf.height,F)),y1=[-Bf/2,-jf/2,Bf,jf];return Wi.width=Vi(yc),Wi.height=Vi(vc),Kt.fillStyle=ut,Kt.fillRect(0,0,yc,vc),Kt.save(),Kt.translate(yc/2,vc/2),Kt.rotate(V*Math.PI/180),Kt.scale(M,H),Kt.imageSmoothingEnabled=st,Kt.imageSmoothingQuality=ii,Kt.drawImage.apply(Kt,[v].concat(l(y1.map(function(v1){return Math.floor(Vi(v1))})))),Kt.restore(),Wi}o(r1,"getSourceCanvas");var If=String.fromCharCode;function s1(v,p,g){var m="";g+=p;for(var x=p;x<g;x+=1)m+=If(v.getUint8(x));return m}o(s1,"getStringFromCharCode");var o1=/^data:.*,/;function n1(v){var p=v.replace(o1,""),g=atob(p),m=new ArrayBuffer(g.length),x=new Uint8Array(m);return $e(x,function(b,F){x[F]=g.charCodeAt(F)}),m}o(n1,"dataURLToArrayBuffer");function a1(v,p){for(var g=[],m=8192,x=new Uint8Array(v);x.length>0;)g.push(If.apply(null,Nl(x.subarray(0,m)))),x=x.subarray(m);return"data:".concat(p,";base64,").concat(btoa(g.join("")))}o(a1,"arrayBufferToDataURL");function l1(v){var p=new DataView(v),g;try{var m,x,b;if(p.getUint8(0)===255&&p.getUint8(1)===216)for(var F=p.byteLength,U=2;U+1<F;){if(p.getUint8(U)===255&&p.getUint8(U+1)===225){x=U;break}U+=1}if(x){var V=x+4,j=x+10;if(s1(p,V,4)==="Exif"){var M=p.getUint16(j);if(m=M===18761,(m||M===19789)&&p.getUint16(j+2,m)===42){var I=p.getUint32(j+4,m);I>=8&&(b=j+I)}}}if(b){var H=p.getUint16(b,m),ye,fe;for(fe=0;fe<H;fe+=1)if(ye=b+fe*12+2,p.getUint16(ye,m)===274){ye+=8,g=p.getUint16(ye,m),p.setUint16(ye,1,m);break}}}catch{g=1}return g}o(l1,"resetAndGetOrientation");function u1(v){var p=0,g=1,m=1;switch(v){case 2:g=-1;break;case 3:p=-180;break;case 4:m=-1;break;case 5:p=90,m=-1;break;case 6:p=90;break;case 7:p=90,g=-1;break;case 8:p=-90;break}return{rotate:p,scaleX:g,scaleY:m}}o(u1,"parseOrientation");var c1={render:o(function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},"render"),initContainer:o(function(){var p=this.element,g=this.options,m=this.container,x=this.cropper;Ve(x,O),ti(p,O);var b={width:Math.max(m.offsetWidth,Number(g.minContainerWidth)||200),height:Math.max(m.offsetHeight,Number(g.minContainerHeight)||100)};this.containerData=b,Ai(x,{width:b.width,height:b.height}),Ve(p,O),ti(x,O)},"initContainer"),initCanvas:o(function(){var p=this.containerData,g=this.imageData,m=this.options.viewMode,x=Math.abs(g.rotate)%180===90,b=x?g.naturalHeight:g.naturalWidth,F=x?g.naturalWidth:g.naturalHeight,U=b/F,V=p.width,j=p.height;p.height*U>p.width?m===3?V=p.height*U:j=p.width/U:m===3?j=p.width/U:V=p.height*U;var M={aspectRatio:U,naturalWidth:b,naturalHeight:F,width:V,height:j};M.left=(p.width-V)/2,M.top=(p.height-j)/2,M.oldLeft=M.left,M.oldTop=M.top,this.canvasData=M,this.limited=m===1||m===2,this.limitCanvas(!0,!0),this.initialImageData=Ce({},g),this.initialCanvasData=Ce({},M)},"initCanvas"),limitCanvas:o(function(p,g){var m=this.options,x=this.containerData,b=this.canvasData,F=this.cropBoxData,U=m.viewMode,V=b.aspectRatio,j=this.cropped&&F;if(p){var M=Number(m.minCanvasWidth)||0,I=Number(m.minCanvasHeight)||0;U>1?(M=Math.max(M,x.width),I=Math.max(I,x.height),U===3&&(I*V>M?M=I*V:I=M/V)):U>0&&(M?M=Math.max(M,j?F.width:0):I?I=Math.max(I,j?F.height:0):j&&(M=F.width,I=F.height,I*V>M?M=I*V:I=M/V));var H=es({aspectRatio:V,width:M,height:I});M=H.width,I=H.height,b.minWidth=M,b.minHeight=I,b.maxWidth=1/0,b.maxHeight=1/0}if(g)if(U>(j?0:1)){var ye=x.width-b.width,fe=x.height-b.height;b.minLeft=Math.min(0,ye),b.minTop=Math.min(0,fe),b.maxLeft=Math.max(0,ye),b.maxTop=Math.max(0,fe),j&&this.limited&&(b.minLeft=Math.min(F.left,F.left+(F.width-b.width)),b.minTop=Math.min(F.top,F.top+(F.height-b.height)),b.maxLeft=F.left,b.maxTop=F.top,U===2&&(b.width>=x.width&&(b.minLeft=Math.min(0,ye),b.maxLeft=Math.max(0,ye)),b.height>=x.height&&(b.minTop=Math.min(0,fe),b.maxTop=Math.max(0,fe))))}else b.minLeft=-b.width,b.minTop=-b.height,b.maxLeft=x.width,b.maxTop=x.height},"limitCanvas"),renderCanvas:o(function(p,g){var m=this.canvasData,x=this.imageData;if(g){var b=i1({width:x.naturalWidth*Math.abs(x.scaleX||1),height:x.naturalHeight*Math.abs(x.scaleY||1),degree:x.rotate||0}),F=b.width,U=b.height,V=m.width*(F/m.naturalWidth),j=m.height*(U/m.naturalHeight);m.left-=(V-m.width)/2,m.top-=(j-m.height)/2,m.width=V,m.height=j,m.aspectRatio=F/U,m.naturalWidth=F,m.naturalHeight=U,this.limitCanvas(!0,!1)}(m.width>m.maxWidth||m.width<m.minWidth)&&(m.left=m.oldLeft),(m.height>m.maxHeight||m.height<m.minHeight)&&(m.top=m.oldTop),m.width=Math.min(Math.max(m.width,m.minWidth),m.maxWidth),m.height=Math.min(Math.max(m.height,m.minHeight),m.maxHeight),this.limitCanvas(!1,!0),m.left=Math.min(Math.max(m.left,m.minLeft),m.maxLeft),m.top=Math.min(Math.max(m.top,m.minTop),m.maxTop),m.oldLeft=m.left,m.oldTop=m.top,Ai(this.canvas,Ce({width:m.width,height:m.height},gn({translateX:m.left,translateY:m.top}))),this.renderImage(p),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},"renderCanvas"),renderImage:o(function(p){var g=this.canvasData,m=this.imageData,x=m.naturalWidth*(g.width/g.naturalWidth),b=m.naturalHeight*(g.height/g.naturalHeight);Ce(m,{width:x,height:b,left:(g.width-x)/2,top:(g.height-b)/2}),Ai(this.image,Ce({width:m.width,height:m.height},gn(Ce({translateX:m.left,translateY:m.top},m)))),p&&this.output()},"renderImage"),initCropBox:o(function(){var p=this.options,g=this.canvasData,m=p.aspectRatio||p.initialAspectRatio,x=Number(p.autoCropArea)||.8,b={width:g.width,height:g.height};m&&(g.height*m>g.width?b.height=b.width/m:b.width=b.height*m),this.cropBoxData=b,this.limitCropBox(!0,!0),b.width=Math.min(Math.max(b.width,b.minWidth),b.maxWidth),b.height=Math.min(Math.max(b.height,b.minHeight),b.maxHeight),b.width=Math.max(b.minWidth,b.width*x),b.height=Math.max(b.minHeight,b.height*x),b.left=g.left+(g.width-b.width)/2,b.top=g.top+(g.height-b.height)/2,b.oldLeft=b.left,b.oldTop=b.top,this.initialCropBoxData=Ce({},b)},"initCropBox"),limitCropBox:o(function(p,g){var m=this.options,x=this.containerData,b=this.canvasData,F=this.cropBoxData,U=this.limited,V=m.aspectRatio;if(p){var j=Number(m.minCropBoxWidth)||0,M=Number(m.minCropBoxHeight)||0,I=U?Math.min(x.width,b.width,b.width+b.left,x.width-b.left):x.width,H=U?Math.min(x.height,b.height,b.height+b.top,x.height-b.top):x.height;j=Math.min(j,x.width),M=Math.min(M,x.height),V&&(j&&M?M*V>j?M=j/V:j=M*V:j?M=j/V:M&&(j=M*V),H*V>I?H=I/V:I=H*V),F.minWidth=Math.min(j,I),F.minHeight=Math.min(M,H),F.maxWidth=I,F.maxHeight=H}g&&(U?(F.minLeft=Math.max(0,b.left),F.minTop=Math.max(0,b.top),F.maxLeft=Math.min(x.width,b.left+b.width)-F.width,F.maxTop=Math.min(x.height,b.top+b.height)-F.height):(F.minLeft=0,F.minTop=0,F.maxLeft=x.width-F.width,F.maxTop=x.height-F.height))},"limitCropBox"),renderCropBox:o(function(){var p=this.options,g=this.containerData,m=this.cropBoxData;(m.width>m.maxWidth||m.width<m.minWidth)&&(m.left=m.oldLeft),(m.height>m.maxHeight||m.height<m.minHeight)&&(m.top=m.oldTop),m.width=Math.min(Math.max(m.width,m.minWidth),m.maxWidth),m.height=Math.min(Math.max(m.height,m.minHeight),m.maxHeight),this.limitCropBox(!1,!0),m.left=Math.min(Math.max(m.left,m.minLeft),m.maxLeft),m.top=Math.min(Math.max(m.top,m.minTop),m.maxTop),m.oldLeft=m.left,m.oldTop=m.top,p.movable&&p.cropBoxMovable&&Do(this.face,B,m.width>=g.width&&m.height>=g.height?W:R),Ai(this.cropBox,Ce({width:m.width,height:m.height},gn({translateX:m.left,translateY:m.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},"renderCropBox"),output:o(function(){this.preview(),wi(this.element,Y,this.getData())},"output")},h1={initPreview:o(function(){var p=this.element,g=this.crossOrigin,m=this.options.preview,x=g?this.crossOriginUrl:this.url,b=p.alt||"The image to preview",F=document.createElement("img");if(g&&(F.crossOrigin=g),F.src=x,F.alt=b,this.viewBox.appendChild(F),this.viewBoxImage=F,!!m){var U=m;typeof m=="string"?U=p.ownerDocument.querySelectorAll(m):m.querySelector&&(U=[m]),this.previews=U,$e(U,function(V){var j=document.createElement("img");Do(V,D,{width:V.offsetWidth,height:V.offsetHeight,html:V.innerHTML}),g&&(j.crossOrigin=g),j.src=x,j.alt=b,j.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;"',V.innerHTML="",V.appendChild(j)})}},"initPreview"),resetPreview:o(function(){$e(this.previews,function(p){var g=Uo(p,D);Ai(p,{width:g.width,height:g.height}),p.innerHTML=g.html,gs(p,D)})},"resetPreview"),preview:o(function(){var p=this.imageData,g=this.canvasData,m=this.cropBoxData,x=m.width,b=m.height,F=p.width,U=p.height,V=m.left-g.left-p.left,j=m.top-g.top-p.top;!this.cropped||this.disabled||(Ai(this.viewBoxImage,Ce({width:F,height:U},gn(Ce({translateX:-V,translateY:-j},p)))),$e(this.previews,function(M){var I=Uo(M,D),H=I.width,ye=I.height,fe=H,Ue=ye,_e=1;x&&(_e=H/x,Ue=b*_e),b&&Ue>ye&&(_e=ye/b,fe=x*_e,Ue=ye),Ai(M,{width:fe,height:Ue}),Ai(M.getElementsByTagName("img")[0],Ce({width:F*_e,height:U*_e},gn(Ce({translateX:-V*_e,translateY:-j*_e},p))))}))},"preview")},d1={bind:o(function(){var p=this.element,g=this.options,m=this.cropper;St(g.cropstart)&&Ut(p,ge,g.cropstart),St(g.cropmove)&&Ut(p,Oe,g.cropmove),St(g.cropend)&&Ut(p,Q,g.cropend),St(g.crop)&&Ut(p,Y,g.crop),St(g.zoom)&&Ut(p,ds,g.zoom),Ut(m,Rt,this.onCropStart=this.cropStart.bind(this)),g.zoomable&&g.zoomOnWheel&&Ut(m,rr,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&Ut(m,ue,this.onDblclick=this.dblclick.bind(this)),Ut(p.ownerDocument,qe,this.onCropMove=this.cropMove.bind(this)),Ut(p.ownerDocument,oe,this.onCropEnd=this.cropEnd.bind(this)),g.responsive&&Ut(window,rt,this.onResize=this.resize.bind(this))},"bind"),unbind:o(function(){var p=this.element,g=this.options,m=this.cropper;St(g.cropstart)&&gt(p,ge,g.cropstart),St(g.cropmove)&&gt(p,Oe,g.cropmove),St(g.cropend)&&gt(p,Q,g.cropend),St(g.crop)&&gt(p,Y,g.crop),St(g.zoom)&&gt(p,ds,g.zoom),gt(m,Rt,this.onCropStart),g.zoomable&&g.zoomOnWheel&&gt(m,rr,this.onWheel,{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&gt(m,ue,this.onDblclick),gt(p.ownerDocument,qe,this.onCropMove),gt(p.ownerDocument,oe,this.onCropEnd),g.responsive&&gt(window,rt,this.onResize)},"unbind")},p1={resize:o(function(){if(!this.disabled){var p=this.options,g=this.container,m=this.containerData,x=g.offsetWidth/m.width;if(x!==1||g.offsetHeight!==m.height){var b,F;p.restore&&(b=this.getCanvasData(),F=this.getCropBoxData()),this.render(),p.restore&&(this.setCanvasData($e(b,function(U,V){b[V]=U*x})),this.setCropBoxData($e(F,function(U,V){F[V]=U*x})))}}},"resize"),dblclick:o(function(){this.disabled||this.options.dragMode===N||this.setDragMode(pn(this.dragBox,Pe)?k:A)},"dblclick"),wheel:o(function(p){var g=this,m=Number(this.options.wheelZoomRatio)||.1,x=1;this.disabled||(p.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){g.wheeling=!1},50),p.deltaY?x=p.deltaY>0?1:-1:p.wheelDelta?x=-p.wheelDelta/120:p.detail&&(x=p.detail>0?1:-1),this.zoom(-x*m,p)))},"wheel"),cropStart:o(function(p){var g=p.buttons,m=p.button;if(!(this.disabled||(p.type==="mousedown"||p.type==="pointerdown"&&p.pointerType==="mouse")&&(he(g)&&g!==1||he(m)&&m!==0||p.ctrlKey))){var x=this.options,b=this.pointers,F;p.changedTouches?$e(p.changedTouches,function(U){b[U.identifier]=jl(U)}):b[p.pointerId||0]=jl(p),Object.keys(b).length>1&&x.zoomable&&x.zoomOnTouch?F=K:F=Uo(p.target,B),ps.test(F)&&wi(this.element,ge,{originalEvent:p,action:F})!==!1&&(p.preventDefault(),this.action=F,this.cropping=!1,F===q&&(this.cropping=!0,Ve(this.dragBox,L)))}},"cropStart"),cropMove:o(function(p){var g=this.action;if(!(this.disabled||!g)){var m=this.pointers;p.preventDefault(),wi(this.element,Oe,{originalEvent:p,action:g})!==!1&&(p.changedTouches?$e(p.changedTouches,function(x){Ce(m[x.identifier]||{},jl(x,!0))}):Ce(m[p.pointerId||0]||{},jl(p,!0)),this.change(p))}},"cropMove"),cropEnd:o(function(p){if(!this.disabled){var g=this.action,m=this.pointers;p.changedTouches?$e(p.changedTouches,function(x){delete m[x.identifier]}):delete m[p.pointerId||0],g&&(p.preventDefault(),Object.keys(m).length||(this.action=""),this.cropping&&(this.cropping=!1,or(this.dragBox,L,this.cropped&&this.options.modal)),wi(this.element,Q,{originalEvent:p,action:g}))}},"cropEnd")},f1={change:o(function(p){var g=this.options,m=this.canvasData,x=this.containerData,b=this.cropBoxData,F=this.pointers,U=this.action,V=g.aspectRatio,j=b.left,M=b.top,I=b.width,H=b.height,ye=j+I,fe=M+H,Ue=0,_e=0,ut=x.width,yt=x.height,st=!0,nr;!V&&p.shiftKey&&(V=I&&H?I/H:1),this.limited&&(Ue=b.minLeft,_e=b.minTop,ut=Ue+Math.min(x.width,m.width,m.left+m.width),yt=_e+Math.min(x.height,m.height,m.top+m.height));var ii=F[Object.keys(F)[0]],X={x:ii.endX-ii.startX,y:ii.endY-ii.startY},xe=o(function(Si){switch(Si){case $:ye+X.x>ut&&(X.x=ut-ye);break;case G:j+X.x<Ue&&(X.x=Ue-j);break;case re:M+X.y<_e&&(X.y=_e-M);break;case te:fe+X.y>yt&&(X.y=yt-fe);break}},"check");switch(U){case R:j+=X.x,M+=X.y;break;case $:if(X.x>=0&&(ye>=ut||V&&(M<=_e||fe>=yt))){st=!1;break}xe($),I+=X.x,I<0&&(U=G,I=-I,j-=I),V&&(H=I/V,M+=(b.height-H)/2);break;case re:if(X.y<=0&&(M<=_e||V&&(j<=Ue||ye>=ut))){st=!1;break}xe(re),H-=X.y,M+=X.y,H<0&&(U=te,H=-H,M-=H),V&&(I=H*V,j+=(b.width-I)/2);break;case G:if(X.x<=0&&(j<=Ue||V&&(M<=_e||fe>=yt))){st=!1;break}xe(G),I-=X.x,j+=X.x,I<0&&(U=$,I=-I,j-=I),V&&(H=I/V,M+=(b.height-H)/2);break;case te:if(X.y>=0&&(fe>=yt||V&&(j<=Ue||ye>=ut))){st=!1;break}xe(te),H+=X.y,H<0&&(U=re,H=-H,M-=H),V&&(I=H*V,j+=(b.width-I)/2);break;case Te:if(V){if(X.y<=0&&(M<=_e||ye>=ut)){st=!1;break}xe(re),H-=X.y,M+=X.y,I=H*V}else xe(re),xe($),X.x>=0?ye<ut?I+=X.x:X.y<=0&&M<=_e&&(st=!1):I+=X.x,X.y<=0?M>_e&&(H-=X.y,M+=X.y):(H-=X.y,M+=X.y);I<0&&H<0?(U=we,H=-H,I=-I,M-=H,j-=I):I<0?(U=Ke,I=-I,j-=I):H<0&&(U=He,H=-H,M-=H);break;case Ke:if(V){if(X.y<=0&&(M<=_e||j<=Ue)){st=!1;break}xe(re),H-=X.y,M+=X.y,I=H*V,j+=b.width-I}else xe(re),xe(G),X.x<=0?j>Ue?(I-=X.x,j+=X.x):X.y<=0&&M<=_e&&(st=!1):(I-=X.x,j+=X.x),X.y<=0?M>_e&&(H-=X.y,M+=X.y):(H-=X.y,M+=X.y);I<0&&H<0?(U=He,H=-H,I=-I,M-=H,j-=I):I<0?(U=Te,I=-I,j-=I):H<0&&(U=we,H=-H,M-=H);break;case we:if(V){if(X.x<=0&&(j<=Ue||fe>=yt)){st=!1;break}xe(G),I-=X.x,j+=X.x,H=I/V}else xe(te),xe(G),X.x<=0?j>Ue?(I-=X.x,j+=X.x):X.y>=0&&fe>=yt&&(st=!1):(I-=X.x,j+=X.x),X.y>=0?fe<yt&&(H+=X.y):H+=X.y;I<0&&H<0?(U=Te,H=-H,I=-I,M-=H,j-=I):I<0?(U=He,I=-I,j-=I):H<0&&(U=Ke,H=-H,M-=H);break;case He:if(V){if(X.x>=0&&(ye>=ut||fe>=yt)){st=!1;break}xe($),I+=X.x,H=I/V}else xe(te),xe($),X.x>=0?ye<ut?I+=X.x:X.y>=0&&fe>=yt&&(st=!1):I+=X.x,X.y>=0?fe<yt&&(H+=X.y):H+=X.y;I<0&&H<0?(U=Ke,H=-H,I=-I,M-=H,j-=I):I<0?(U=we,I=-I,j-=I):H<0&&(U=Te,H=-H,M-=H);break;case W:this.move(X.x,X.y),st=!1;break;case K:this.zoom(e1(F),p),st=!1;break;case q:if(!X.x||!X.y){st=!1;break}nr=kf(this.cropper),j=ii.startX-nr.left,M=ii.startY-nr.top,I=b.minWidth,H=b.minHeight,X.x>0?U=X.y>0?He:Te:X.x<0&&(j-=I,U=X.y>0?we:Ke),X.y<0&&(M-=H),this.cropped||(ti(this.cropBox,O),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}st&&(b.width=I,b.height=H,b.left=j,b.top=M,this.action=U,this.renderCropBox()),$e(F,function(ct){ct.startX=ct.endX,ct.startY=ct.endY})},"change")},m1={crop:o(function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Ve(this.dragBox,L),ti(this.cropBox,O),this.setCropBoxData(this.initialCropBoxData)),this},"crop"),reset:o(function(){return this.ready&&!this.disabled&&(this.imageData=Ce({},this.initialImageData),this.canvasData=Ce({},this.initialCanvasData),this.cropBoxData=Ce({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},"reset"),clear:o(function(){return this.cropped&&!this.disabled&&(Ce(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),ti(this.dragBox,L),Ve(this.cropBox,O)),this},"clear"),replace:o(function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&p&&(this.isImg&&(this.element.src=p),g?(this.url=p,this.image.src=p,this.ready&&(this.viewBoxImage.src=p,$e(this.previews,function(m){m.getElementsByTagName("img")[0].src=p}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(p))),this},"replace"),enable:o(function(){return this.ready&&this.disabled&&(this.disabled=!1,ti(this.cropper,Ie)),this},"enable"),disable:o(function(){return this.ready&&!this.disabled&&(this.disabled=!0,Ve(this.cropper,Ie)),this},"disable"),destroy:o(function(){var p=this.element;return p[_]?(p[_]=void 0,this.isImg&&this.replaced&&(p.src=this.originalUrl),this.uncreate(),this):this},"destroy"),move:o(function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p,m=this.canvasData,x=m.left,b=m.top;return this.moveTo(Ro(p)?p:x+Number(p),Ro(g)?g:b+Number(g))},"move"),moveTo:o(function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p,m=this.canvasData,x=!1;return p=Number(p),g=Number(g),this.ready&&!this.disabled&&this.options.movable&&(he(p)&&(m.left=p,x=!0),he(g)&&(m.top=g,x=!0),x&&this.renderCanvas(!0)),this},"moveTo"),zoom:o(function(p,g){var m=this.canvasData;return p=Number(p),p<0?p=1/(1-p):p=1+p,this.zoomTo(m.width*p/m.naturalWidth,null,g)},"zoom"),zoomTo:o(function(p,g,m){var x=this.options,b=this.canvasData,F=b.width,U=b.height,V=b.naturalWidth,j=b.naturalHeight;if(p=Number(p),p>=0&&this.ready&&!this.disabled&&x.zoomable){var M=V*p,I=j*p;if(wi(this.element,ds,{ratio:p,oldRatio:F/V,originalEvent:m})===!1)return this;if(m){var H=this.pointers,ye=kf(this.cropper),fe=H&&Object.keys(H).length?t1(H):{pageX:m.pageX,pageY:m.pageY};b.left-=(M-F)*((fe.pageX-ye.left-b.left)/F),b.top-=(I-U)*((fe.pageY-ye.top-b.top)/U)}else sr(g)&&he(g.x)&&he(g.y)?(b.left-=(M-F)*((g.x-b.left)/F),b.top-=(I-U)*((g.y-b.top)/U)):(b.left-=(M-F)/2,b.top-=(I-U)/2);b.width=M,b.height=I,this.renderCanvas(!0)}return this},"zoomTo"),rotate:o(function(p){return this.rotateTo((this.imageData.rotate||0)+Number(p))},"rotate"),rotateTo:o(function(p){return p=Number(p),he(p)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=p%360,this.renderCanvas(!0,!0)),this},"rotateTo"),scaleX:o(function(p){var g=this.imageData.scaleY;return this.scale(p,he(g)?g:1)},"scaleX"),scaleY:o(function(p){var g=this.imageData.scaleX;return this.scale(he(g)?g:1,p)},"scaleY"),scale:o(function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p,m=this.imageData,x=!1;return p=Number(p),g=Number(g),this.ready&&!this.disabled&&this.options.scalable&&(he(p)&&(m.scaleX=p,x=!0),he(g)&&(m.scaleY=g,x=!0),x&&this.renderCanvas(!0,!0)),this},"scale"),getData:o(function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=this.options,m=this.imageData,x=this.canvasData,b=this.cropBoxData,F;if(this.ready&&this.cropped){F={x:b.left-x.left,y:b.top-x.top,width:b.width,height:b.height};var U=m.width/m.naturalWidth;if($e(F,function(M,I){F[I]=M/U}),p){var V=Math.round(F.y+F.height),j=Math.round(F.x+F.width);F.x=Math.round(F.x),F.y=Math.round(F.y),F.width=j-F.x,F.height=V-F.y}}else F={x:0,y:0,width:0,height:0};return g.rotatable&&(F.rotate=m.rotate||0),g.scalable&&(F.scaleX=m.scaleX||1,F.scaleY=m.scaleY||1),F},"getData"),setData:o(function(p){var g=this.options,m=this.imageData,x=this.canvasData,b={};if(this.ready&&!this.disabled&&sr(p)){var F=!1;g.rotatable&&he(p.rotate)&&p.rotate!==m.rotate&&(m.rotate=p.rotate,F=!0),g.scalable&&(he(p.scaleX)&&p.scaleX!==m.scaleX&&(m.scaleX=p.scaleX,F=!0),he(p.scaleY)&&p.scaleY!==m.scaleY&&(m.scaleY=p.scaleY,F=!0)),F&&this.renderCanvas(!0,!0);var U=m.width/m.naturalWidth;he(p.x)&&(b.left=p.x*U+x.left),he(p.y)&&(b.top=p.y*U+x.top),he(p.width)&&(b.width=p.width*U),he(p.height)&&(b.height=p.height*U),this.setCropBoxData(b)}return this},"setData"),getContainerData:o(function(){return this.ready?Ce({},this.containerData):{}},"getContainerData"),getImageData:o(function(){return this.sized?Ce({},this.imageData):{}},"getImageData"),getCanvasData:o(function(){var p=this.canvasData,g={};return this.ready&&$e(["left","top","width","height","naturalWidth","naturalHeight"],function(m){g[m]=p[m]}),g},"getCanvasData"),setCanvasData:o(function(p){var g=this.canvasData,m=g.aspectRatio;return this.ready&&!this.disabled&&sr(p)&&(he(p.left)&&(g.left=p.left),he(p.top)&&(g.top=p.top),he(p.width)?(g.width=p.width,g.height=p.width/m):he(p.height)&&(g.height=p.height,g.width=p.height*m),this.renderCanvas(!0)),this},"setCanvasData"),getCropBoxData:o(function(){var p=this.cropBoxData,g;return this.ready&&this.cropped&&(g={left:p.left,top:p.top,width:p.width,height:p.height}),g||{}},"getCropBoxData"),setCropBoxData:o(function(p){var g=this.cropBoxData,m=this.options.aspectRatio,x,b;return this.ready&&this.cropped&&!this.disabled&&sr(p)&&(he(p.left)&&(g.left=p.left),he(p.top)&&(g.top=p.top),he(p.width)&&p.width!==g.width&&(x=!0,g.width=p.width),he(p.height)&&p.height!==g.height&&(b=!0,g.height=p.height),m&&(x?g.height=g.width/m:b&&(g.width=g.height*m)),this.renderCropBox()),this},"setCropBoxData"),getCroppedCanvas:o(function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var g=this.canvasData,m=r1(this.image,this.imageData,g,p);if(!this.cropped)return m;var x=this.getData(),b=x.x,F=x.y,U=x.width,V=x.height,j=m.width/Math.floor(g.naturalWidth);j!==1&&(b*=j,F*=j,U*=j,V*=j);var M=U/V,I=es({aspectRatio:M,width:p.maxWidth||1/0,height:p.maxHeight||1/0}),H=es({aspectRatio:M,width:p.minWidth||0,height:p.minHeight||0},"cover"),ye=es({aspectRatio:M,width:p.width||(j!==1?m.width:U),height:p.height||(j!==1?m.height:V)}),fe=ye.width,Ue=ye.height;fe=Math.min(I.width,Math.max(H.width,fe)),Ue=Math.min(I.height,Math.max(H.height,Ue));var _e=document.createElement("canvas"),ut=_e.getContext("2d");_e.width=Vi(fe),_e.height=Vi(Ue),ut.fillStyle=p.fillColor||"transparent",ut.fillRect(0,0,fe,Ue);var yt=p.imageSmoothingEnabled,st=yt===void 0?!0:yt,nr=p.imageSmoothingQuality;ut.imageSmoothingEnabled=st,nr&&(ut.imageSmoothingQuality=nr);var ii=m.width,X=m.height,xe=b,ct=F,Si,ar,ys,vs,ts,Wi;xe<=-U||xe>ii?(xe=0,Si=0,ys=0,ts=0):xe<=0?(ys=-xe,xe=0,Si=Math.min(ii,U+xe),ts=Si):xe<=ii&&(ys=0,Si=Math.min(U,ii-xe),ts=Si),Si<=0||ct<=-V||ct>X?(ct=0,ar=0,vs=0,Wi=0):ct<=0?(vs=-ct,ct=0,ar=Math.min(X,V+ct),Wi=ar):ct<=X&&(vs=0,ar=Math.min(V,X-ct),Wi=ar);var Kt=[xe,ct,Si,ar];if(ts>0&&Wi>0){var bs=fe/U;Kt.push(ys*bs,vs*bs,ts*bs,Wi*bs)}return ut.drawImage.apply(ut,[m].concat(l(Kt.map(function(zl){return Math.floor(Vi(zl))})))),_e},"getCroppedCanvas"),setAspectRatio:o(function(p){var g=this.options;return!this.disabled&&!Ro(p)&&(g.aspectRatio=Math.max(0,p)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},"setAspectRatio"),setDragMode:o(function(p){var g=this.options,m=this.dragBox,x=this.face;if(this.ready&&!this.disabled){var b=p===A,F=g.movable&&p===k;p=b||F?p:N,g.dragMode=p,Do(m,B,p),or(m,Pe,b),or(m,z,F),g.cropBoxMovable||(Do(x,B,p),or(x,Pe,b),or(x,z,F))}return this},"setDragMode")},g1=S.Cropper,Lf=function(){function v(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e(this,v),!p||!Zr.test(p.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=p,this.options=Ce({},lt,sr(g)&&g),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()}return o(v,"Cropper"),r(v,[{key:"init",value:o(function(){var g=this.element,m=g.tagName.toLowerCase(),x;if(!g[_]){if(g[_]=this,m==="img"){if(this.isImg=!0,x=g.getAttribute("src")||"",this.originalUrl=x,!x)return;x=g.src}else m==="canvas"&&window.HTMLCanvasElement&&(x=g.toDataURL());this.load(x)}},"init")},{key:"load",value:o(function(g){var m=this;if(g){this.url=g,this.imageData={};var x=this.element,b=this.options;if(!b.rotatable&&!b.scalable&&(b.checkOrientation=!1),!b.checkOrientation||!window.ArrayBuffer){this.clone();return}if(fs.test(g)){ms.test(g)?this.read(n1(g)):this.clone();return}var F=new XMLHttpRequest,U=this.clone.bind(this);this.reloading=!0,this.xhr=F,F.onabort=U,F.onerror=U,F.ontimeout=U,F.onprogress=function(){F.getResponseHeader("content-type")!==Jr&&F.abort()},F.onload=function(){m.read(F.response)},F.onloadend=function(){m.reloading=!1,m.xhr=null},b.checkCrossOrigin&&Uf(g)&&x.crossOrigin&&(g=Df(g)),F.open("GET",g),F.responseType="arraybuffer",F.withCredentials=x.crossOrigin==="use-credentials",F.send()}},"load")},{key:"read",value:o(function(g){var m=this.options,x=this.imageData,b=l1(g),F=0,U=1,V=1;if(b>1){this.url=a1(g,Jr);var j=u1(b);F=j.rotate,U=j.scaleX,V=j.scaleY}m.rotatable&&(x.rotate=F),m.scalable&&(x.scaleX=U,x.scaleY=V),this.clone()},"read")},{key:"clone",value:o(function(){var g=this.element,m=this.url,x=g.crossOrigin,b=m;this.options.checkCrossOrigin&&Uf(m)&&(x||(x="anonymous"),b=Df(m)),this.crossOrigin=x,this.crossOriginUrl=b;var F=document.createElement("img");x&&(F.crossOrigin=x),F.src=b||m,F.alt=g.alt||"The image to crop",this.image=F,F.onload=this.start.bind(this),F.onerror=this.stop.bind(this),Ve(F,P),g.parentNode.insertBefore(F,g.nextSibling)},"clone")},{key:"start",value:o(function(){var g=this,m=this.image;m.onload=null,m.onerror=null,this.sizing=!0;var x=S.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(S.navigator.userAgent),b=o(function(j,M){Ce(g.imageData,{naturalWidth:j,naturalHeight:M,aspectRatio:j/M}),g.sizing=!1,g.sized=!0,g.build()},"done");if(m.naturalWidth&&!x){b(m.naturalWidth,m.naturalHeight);return}var F=document.createElement("img"),U=document.body||document.documentElement;this.sizingImage=F,F.onload=function(){b(F.width,F.height),x||U.removeChild(F)},F.src=m.src,x||(F.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;",U.appendChild(F))},"start")},{key:"stop",value:o(function(){var g=this.image;g.onload=null,g.onerror=null,g.parentNode.removeChild(g),this.image=null},"stop")},{key:"build",value:o(function(){if(!(!this.sized||this.ready)){var g=this.element,m=this.options,x=this.image,b=g.parentNode,F=document.createElement("div");F.innerHTML=mt;var U=F.querySelector(".".concat(_,"-container")),V=U.querySelector(".".concat(_,"-canvas")),j=U.querySelector(".".concat(_,"-drag-box")),M=U.querySelector(".".concat(_,"-crop-box")),I=M.querySelector(".".concat(_,"-face"));this.container=b,this.cropper=U,this.canvas=V,this.dragBox=j,this.cropBox=M,this.viewBox=U.querySelector(".".concat(_,"-view-box")),this.face=I,V.appendChild(x),Ve(g,O),b.insertBefore(U,g.nextSibling),this.isImg||ti(x,P),this.initPreview(),this.bind(),m.initialAspectRatio=Math.max(0,m.initialAspectRatio)||NaN,m.aspectRatio=Math.max(0,m.aspectRatio)||NaN,m.viewMode=Math.max(0,Math.min(3,Math.round(m.viewMode)))||0,Ve(M,O),m.guides||Ve(M.getElementsByClassName("".concat(_,"-dashed")),O),m.center||Ve(M.getElementsByClassName("".concat(_,"-center")),O),m.background&&Ve(U,"".concat(_,"-bg")),m.highlight||Ve(I,E),m.cropBoxMovable&&(Ve(I,z),Do(I,B,R)),m.cropBoxResizable||(Ve(M.getElementsByClassName("".concat(_,"-line")),O),Ve(M.getElementsByClassName("".concat(_,"-point")),O)),this.render(),this.ready=!0,this.setDragMode(m.dragMode),m.autoCrop&&this.crop(),this.setData(m.data),St(m.ready)&&Ut(g,kt,m.ready,{once:!0}),wi(g,kt)}},"build")},{key:"unbuild",value:o(function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),ti(this.element,O))},"unbuild")},{key:"uncreate",value:o(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()},"uncreate")}],[{key:"noConflict",value:o(function(){return window.Cropper=g1,v},"noConflict")},{key:"setDefaults",value:o(function(g){Ce(lt,sr(g)&&g)},"setDefaults")}]),v}();return Ce(Lf.prototype,c1,h1,d1,p1,f1,m1),Lf})});var Nv=ve((W7,Vu)=>{"use strict";Vu.exports=jd;Vu.exports.isMobile=jd;Vu.exports.default=jd;var y_=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,v_=/CrOS/,b_=/android|ipad|playbook|silk/i;function jd(i){i||(i={});let e=i.ua;if(!e&&typeof navigator<"u"&&(e=navigator.userAgent),e&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string")return!1;let t=y_.test(e)&&!v_.test(e)||!!i.tablet&&b_.test(e);return!t&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.indexOf("Macintosh")!==-1&&e.indexOf("Safari")!==-1&&(t=!0),t}o(jd,"isMobile")});var Fb=ve((nL,xb)=>{"use strict";xb.exports=o(function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0},"required")});var Cb=ve(xp=>{"use strict";var U5=Object.prototype.hasOwnProperty,D5;function Eb(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch{return null}}o(Eb,"decode");function Ob(i){try{return encodeURIComponent(i)}catch{return null}}o(Ob,"encode");function I5(i){for(var e=/([^=?#&]+)=?([^&]*)/g,t={},r;r=e.exec(i);){var s=Eb(r[1]),n=Eb(r[2]);s===null||n===null||s in t||(t[s]=n)}return t}o(I5,"querystring");function L5(i,e){e=e||"";var t=[],r,s;typeof e!="string"&&(e="?");for(s in i)if(U5.call(i,s)){if(r=i[s],!r&&(r===null||r===D5||isNaN(r))&&(r=""),s=Ob(s),r=Ob(r),s===null||r===null)continue;t.push(s+"="+r)}return t.length?e+t.join("&"):""}o(L5,"querystringify");xp.stringify=L5;xp.parse=I5});var Lb=ve((cL,Ib)=>{"use strict";var Tb=Fb(),ec=Cb(),N5=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Rb=/[\n\r\t]/g,M5=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,kb=/:\d+$/,B5=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,j5=/^[a-zA-Z]:/;function Ep(i){return(i||"").toString().replace(N5,"")}o(Ep,"trimLeft");var Fp=[["#","hash"],["?","query"],o(function(e,t){return Zi(t.protocol)?e.replace(/\\/g,"/"):e},"sanitize"),["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Ab={hash:1,query:1};function Ub(i){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var t=e.location||{};i=i||t;var r={},s=typeof i,n;if(i.protocol==="blob:")r=new er(unescape(i.pathname),{});else if(s==="string"){r=new er(i,{});for(n in Ab)delete r[n]}else if(s==="object"){for(n in i)n in Ab||(r[n]=i[n]);r.slashes===void 0&&(r.slashes=M5.test(i.href))}return r}o(Ub,"lolcation");function Zi(i){return i==="file:"||i==="ftp:"||i==="http:"||i==="https:"||i==="ws:"||i==="wss:"}o(Zi,"isSpecial");function Db(i,e){i=Ep(i),i=i.replace(Rb,""),e=e||{};var t=B5.exec(i),r=t[1]?t[1].toLowerCase():"",s=!!t[2],n=!!t[3],a=0,l;return s?n?(l=t[2]+t[3]+t[4],a=t[2].length+t[3].length):(l=t[2]+t[4],a=t[2].length):n?(l=t[3]+t[4],a=t[3].length):l=t[4],r==="file:"?a>=2&&(l=l.slice(2)):Zi(r)?l=t[4]:r?s&&(l=l.slice(2)):a>=2&&Zi(e.protocol)&&(l=t[4]),{protocol:r,slashes:s||Zi(r),slashesCount:a,rest:l}}o(Db,"extractProtocol");function z5(i,e){if(i==="")return e;for(var t=(e||"/").split("/").slice(0,-1).concat(i.split("/")),r=t.length,s=t[r-1],n=!1,a=0;r--;)t[r]==="."?t.splice(r,1):t[r]===".."?(t.splice(r,1),a++):a&&(r===0&&(n=!0),t.splice(r,1),a--);return n&&t.unshift(""),(s==="."||s==="..")&&t.push(""),t.join("/")}o(z5,"resolve");function er(i,e,t){if(i=Ep(i),i=i.replace(Rb,""),!(this instanceof er))return new er(i,e,t);var r,s,n,a,l,u,h=Fp.slice(),d=typeof e,f=this,y=0;for(d!=="object"&&d!=="string"&&(t=e,e=null),t&&typeof t!="function"&&(t=ec.parse),e=Ub(e),s=Db(i||"",e),r=!s.protocol&&!s.slashes,f.slashes=s.slashes||r&&e.slashes,f.protocol=s.protocol||e.protocol||"",i=s.rest,(s.protocol==="file:"&&(s.slashesCount!==2||j5.test(i))||!s.slashes&&(s.protocol||s.slashesCount<2||!Zi(f.protocol)))&&(h[3]=[/(.*)/,"pathname"]);y<h.length;y++){if(a=h[y],typeof a=="function"){i=a(i,f);continue}n=a[0],u=a[1],n!==n?f[u]=i:typeof n=="string"?(l=n==="@"?i.lastIndexOf(n):i.indexOf(n),~l&&(typeof a[2]=="number"?(f[u]=i.slice(0,l),i=i.slice(l+a[2])):(f[u]=i.slice(l),i=i.slice(0,l)))):(l=n.exec(i))&&(f[u]=l[1],i=i.slice(0,l.index)),f[u]=f[u]||r&&a[3]&&e[u]||"",a[4]&&(f[u]=f[u].toLowerCase())}t&&(f.query=t(f.query)),r&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=z5(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&Zi(f.protocol)&&(f.pathname="/"+f.pathname),Tb(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(l=f.auth.indexOf(":"),~l?(f.username=f.auth.slice(0,l),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(l+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&Zi(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}o(er,"Url");function H5(i,e,t){var r=this;switch(i){case"query":typeof e=="string"&&e.length&&(e=(t||ec.parse)(e)),r[i]=e;break;case"port":r[i]=e,Tb(e,r.protocol)?e&&(r.host=r.hostname+":"+e):(r.host=r.hostname,r[i]="");break;case"hostname":r[i]=e,r.port&&(e+=":"+r.port),r.host=e;break;case"host":r[i]=e,kb.test(e)?(e=e.split(":"),r.port=e.pop(),r.hostname=e.join(":")):(r.hostname=e,r.port="");break;case"protocol":r.protocol=e.toLowerCase(),r.slashes=!t;break;case"pathname":case"hash":if(e){var s=i==="pathname"?"/":"#";r[i]=e.charAt(0)!==s?s+e:e}else r[i]=e;break;case"username":case"password":r[i]=encodeURIComponent(e);break;case"auth":var n=e.indexOf(":");~n?(r.username=e.slice(0,n),r.username=encodeURIComponent(decodeURIComponent(r.username)),r.password=e.slice(n+1),r.password=encodeURIComponent(decodeURIComponent(r.password))):r.username=encodeURIComponent(decodeURIComponent(e))}for(var a=0;a<Fp.length;a++){var l=Fp[a];l[4]&&(r[l[1]]=r[l[1]].toLowerCase())}return r.auth=r.password?r.username+":"+r.password:r.username,r.origin=r.protocol!=="file:"&&Zi(r.protocol)&&r.host?r.protocol+"//"+r.host:"null",r.href=r.toString(),r}o(H5,"set");function q5(i){(!i||typeof i!="function")&&(i=ec.stringify);var e,t=this,r=t.host,s=t.protocol;s&&s.charAt(s.length-1)!==":"&&(s+=":");var n=s+(t.protocol&&t.slashes||Zi(t.protocol)?"//":"");return t.username?(n+=t.username,t.password&&(n+=":"+t.password),n+="@"):t.password?(n+=":"+t.password,n+="@"):t.protocol!=="file:"&&Zi(t.protocol)&&!r&&t.pathname!=="/"&&(n+="@"),(r[r.length-1]===":"||kb.test(t.hostname)&&!t.port)&&(r+=":"),n+=r+t.pathname,e=typeof t.query=="object"?i(t.query):t.query,e&&(n+=e.charAt(0)!=="?"?"?"+e:e),t.hash&&(n+=t.hash),n}o(q5,"toString");er.prototype={set:H5,toString:q5};er.extractProtocol=Db;er.location=Ub;er.trimLeft=Ep;er.qs=ec;Ib.exports=er});var Wp=ve((PN,Vp)=>{typeof Vp<"u"&&(Vp.exports=yi);function yi(i){if(i)return aF(i)}o(yi,"Emitter");function aF(i){for(var e in yi.prototype)i[e]=yi.prototype[e];return i}o(aF,"mixin");yi.prototype.on=yi.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this};yi.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return o(t,"on"),t.fn=e,this.on(i,t),this};yi.prototype.off=yi.prototype.removeListener=yi.prototype.removeAllListeners=yi.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var r,s=0;s<t.length;s++)if(r=t[s],r===e||r.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+i],this};yi.prototype.emit=function(i){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+i],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(t){t=t.slice(0);for(var r=0,s=t.length;r<s;++r)t[r].apply(this,e)}return this};yi.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};yi.prototype.hasListeners=function(i){return!!this.listeners(i).length}});var D0=ve((Cf,Af)=>{(function(i,e){typeof Cf=="object"&&typeof Af<"u"?Af.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Compressor=e())})(Cf,function(){"use strict";function i(D,A){var k=Object.keys(D);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(D);A&&(N=N.filter(function(Y){return Object.getOwnPropertyDescriptor(D,Y).enumerable})),k.push.apply(k,N)}return k}o(i,"ownKeys");function e(D){for(var A=1;A<arguments.length;A++){var k=arguments[A]!=null?arguments[A]:{};A%2?i(Object(k),!0).forEach(function(N){n(D,N,k[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(k)):i(Object(k)).forEach(function(N){Object.defineProperty(D,N,Object.getOwnPropertyDescriptor(k,N))})}return D}o(e,"_objectSpread2");function t(D,A){if(!(D instanceof A))throw new TypeError("Cannot call a class as a function")}o(t,"_classCallCheck");function r(D,A){for(var k=0;k<A.length;k++){var N=A[k];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(D,u(N.key),N)}}o(r,"_defineProperties");function s(D,A,k){return A&&r(D.prototype,A),k&&r(D,k),Object.defineProperty(D,"prototype",{writable:!1}),D}o(s,"_createClass");function n(D,A,k){return A=u(A),A in D?Object.defineProperty(D,A,{value:k,enumerable:!0,configurable:!0,writable:!0}):D[A]=k,D}o(n,"_defineProperty");function a(){return a=Object.assign?Object.assign.bind():function(D){for(var A=1;A<arguments.length;A++){var k=arguments[A];for(var N in k)Object.prototype.hasOwnProperty.call(k,N)&&(D[N]=k[N])}return D},a.apply(this,arguments)}o(a,"_extends");function l(D,A){if(typeof D!="object"||D===null)return D;var k=D[Symbol.toPrimitive];if(k!==void 0){var N=k.call(D,A||"default");if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(D)}o(l,"_toPrimitive");function u(D){var A=l(D,"string");return typeof A=="symbol"?A:String(A)}o(u,"_toPropertyKey");var h={exports:{}};(function(D){typeof window>"u"||function(A){var k=A.HTMLCanvasElement&&A.HTMLCanvasElement.prototype,N=A.Blob&&function(){try{return!!new Blob}catch{return!1}}(),Y=N&&A.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),Q=A.BlobBuilder||A.WebKitBlobBuilder||A.MozBlobBuilder||A.MSBlobBuilder,Oe=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,ge=(N||Q)&&A.atob&&A.ArrayBuffer&&A.Uint8Array&&function(ue){var ce,ke,Le,Rt,qe,oe,kt,rt,rr;if(ce=ue.match(Oe),!ce)throw new Error("invalid data URI");for(ke=ce[2]?ce[1]:"text/plain"+(ce[3]||";charset=US-ASCII"),Le=!!ce[4],Rt=ue.slice(ce[0].length),Le?qe=atob(Rt):qe=decodeURIComponent(Rt),oe=new ArrayBuffer(qe.length),kt=new Uint8Array(oe),rt=0;rt<qe.length;rt+=1)kt[rt]=qe.charCodeAt(rt);return N?new Blob([Y?kt:oe],{type:ke}):(rr=new Q,rr.append(oe),rr.getBlob(ke))};A.HTMLCanvasElement&&!k.toBlob&&(k.mozGetAsFile?k.toBlob=function(ue,ce,ke){var Le=this;setTimeout(function(){ke&&k.toDataURL&&ge?ue(ge(Le.toDataURL(ce,ke))):ue(Le.mozGetAsFile("blob",ce))})}:k.toDataURL&&ge&&(k.msToBlob?k.toBlob=function(ue,ce,ke){var Le=this;setTimeout(function(){(ce&&ce!=="image/png"||ke)&&k.toDataURL&&ge?ue(ge(Le.toDataURL(ce,ke))):ue(Le.msToBlob(ce))})}:k.toBlob=function(ue,ce,ke){var Le=this;setTimeout(function(){ue(ge(Le.toDataURL(ce,ke)))})})),D.exports?D.exports=ge:A.dataURLtoBlob=ge}(window)})(h);var d=h.exports,f=o(function(A){return typeof Blob>"u"?!1:A instanceof Blob||Object.prototype.toString.call(A)==="[object Blob]"},"isBlob"),y={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},w=typeof window<"u"&&typeof window.document<"u",S=w?window:{},T=o(function(A){return A>0&&A<1/0},"isPositiveNumber"),C=Array.prototype.slice;function _(D){return Array.from?Array.from(D):C.call(D)}o(_,"toArray");var R=/^image\/.+$/;function q(D){return R.test(D)}o(q,"isImageType");function W(D){var A=q(D)?D.substr(6):"";return A==="jpeg"&&(A="jpg"),".".concat(A)}o(W,"imageTypeToExtension");var K=String.fromCharCode;function $(D,A,k){var N="",Y;for(k+=A,Y=A;Y<k;Y+=1)N+=K(D.getUint8(Y));return N}o($,"getStringFromCharCode");var G=S.btoa;function te(D,A){for(var k=[],N=8192,Y=new Uint8Array(D);Y.length>0;)k.push(K.apply(null,_(Y.subarray(0,N)))),Y=Y.subarray(N);return"data:".concat(A,";base64,").concat(G(k.join("")))}o(te,"arrayBufferToDataURL");function re(D){var A=new DataView(D),k;try{var N,Y,Q;if(A.getUint8(0)===255&&A.getUint8(1)===216)for(var Oe=A.byteLength,ge=2;ge+1<Oe;){if(A.getUint8(ge)===255&&A.getUint8(ge+1)===225){Y=ge;break}ge+=1}if(Y){var ue=Y+4,ce=Y+10;if($(A,ue,4)==="Exif"){var ke=A.getUint16(ce);if(N=ke===18761,(N||ke===19789)&&A.getUint16(ce+2,N)===42){var Le=A.getUint32(ce+4,N);Le>=8&&(Q=ce+Le)}}}if(Q){var Rt=A.getUint16(Q,N),qe,oe;for(oe=0;oe<Rt;oe+=1)if(qe=Q+oe*12+2,A.getUint16(qe,N)===274){qe+=8,k=A.getUint16(qe,N),A.setUint16(qe,1,N);break}}}catch{k=1}return k}o(re,"resetAndGetOrientation");function Te(D){var A=0,k=1,N=1;switch(D){case 2:k=-1;break;case 3:A=-180;break;case 4:N=-1;break;case 5:A=90,N=-1;break;case 6:A=90;break;case 7:A=90,k=-1;break;case 8:A=-90;break}return{rotate:A,scaleX:k,scaleY:N}}o(Te,"parseOrientation");var Ke=/\.\d*(?:0|9){12}\d*$/;function He(D){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Ke.test(D)?Math.round(D*A)/A:D}o(He,"normalizeDecimalNumber");function we(D){var A=D.aspectRatio,k=D.height,N=D.width,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",Q=T(N),Oe=T(k);if(Q&&Oe){var ge=k*A;(Y==="contain"||Y==="none")&&ge>N||Y==="cover"&&ge<N?k=N/A:N=k*A}else Q?k=N/A:Oe&&(N=k*A);return{width:N,height:k}}o(we,"getAdjustedSizes");function Pe(D){for(var A=_(new Uint8Array(D)),k=A.length,N=[],Y=0;Y+3<k;){var Q=A[Y],Oe=A[Y+1];if(Q===255&&Oe===218)break;if(Q===255&&Oe===216)Y+=2;else{var ge=A[Y+2]*256+A[Y+3],ue=Y+ge+2,ce=A.slice(Y,ue);N.push(ce),Y=ue}}return N.reduce(function(ke,Le){return Le[0]===255&&Le[1]===225?ke.concat(Le):ke},[])}o(Pe,"getExif");function Ie(D,A){var k=_(new Uint8Array(D));if(k[2]!==255||k[3]!==224)return D;var N=k[4]*256+k[5],Y=[255,216].concat(A,k.slice(4+N));return new Uint8Array(Y)}o(Ie,"insertExif");var O=S.ArrayBuffer,P=S.FileReader,E=S.URL||S.webkitURL,L=/\.\w+$/,z=S.Compressor,B=function(){function D(A,k){t(this,D),this.file=A,this.exif=[],this.image=new Image,this.options=e(e({},y),k),this.aborted=!1,this.result=null,this.init()}return o(D,"Compressor"),s(D,[{key:"init",value:o(function(){var k=this,N=this.file,Y=this.options;if(!f(N)){this.fail(new Error("The first argument must be a File or Blob object."));return}var Q=N.type;if(!q(Q)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!E||!P){this.fail(new Error("The current browser does not support image compression."));return}O||(Y.checkOrientation=!1,Y.retainExif=!1);var Oe=Q==="image/jpeg",ge=Oe&&Y.checkOrientation,ue=Oe&&Y.retainExif;if(E&&!ge&&!ue)this.load({url:E.createObjectURL(N)});else{var ce=new P;this.reader=ce,ce.onload=function(ke){var Le=ke.target,Rt=Le.result,qe={},oe=1;ge&&(oe=re(Rt),oe>1&&a(qe,Te(oe))),ue&&(k.exif=Pe(Rt)),ge||ue?!E||oe>1?qe.url=te(Rt,Q):qe.url=E.createObjectURL(N):qe.url=Rt,k.load(qe)},ce.onabort=function(){k.fail(new Error("Aborted to read the image with FileReader."))},ce.onerror=function(){k.fail(new Error("Failed to read the image with FileReader."))},ce.onloadend=function(){k.reader=null},ge||ue?ce.readAsArrayBuffer(N):ce.readAsDataURL(N)}},"init")},{key:"load",value:o(function(k){var N=this,Y=this.file,Q=this.image;Q.onload=function(){N.draw(e(e({},k),{},{naturalWidth:Q.naturalWidth,naturalHeight:Q.naturalHeight}))},Q.onabort=function(){N.fail(new Error("Aborted to load the image."))},Q.onerror=function(){N.fail(new Error("Failed to load the image."))},S.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(S.navigator.userAgent)&&(Q.crossOrigin="anonymous"),Q.alt=Y.name,Q.src=k.url},"load")},{key:"draw",value:o(function(k){var N=this,Y=k.naturalWidth,Q=k.naturalHeight,Oe=k.rotate,ge=Oe===void 0?0:Oe,ue=k.scaleX,ce=ue===void 0?1:ue,ke=k.scaleY,Le=ke===void 0?1:ke,Rt=this.file,qe=this.image,oe=this.options,kt=document.createElement("canvas"),rt=kt.getContext("2d"),rr=Math.abs(ge)%180===90,ds=(oe.resize==="contain"||oe.resize==="cover")&&T(oe.width)&&T(oe.height),Jr=Math.max(oe.maxWidth,0)||1/0,ps=Math.max(oe.maxHeight,0)||1/0,fs=Math.max(oe.minWidth,0)||0,ms=Math.max(oe.minHeight,0)||0,Zr=Y/Q,lt=oe.width,mt=oe.height;if(rr){var Dl=[ps,Jr];Jr=Dl[0],ps=Dl[1];var he=[ms,fs];fs=he[0],ms=he[1];var dn=[mt,lt];lt=dn[0],mt=dn[1]}ds&&(Zr=lt/mt);var Ro=we({aspectRatio:Zr,width:Jr,height:ps},"contain");Jr=Ro.width,ps=Ro.height;var $i=we({aspectRatio:Zr,width:fs,height:ms},"cover");if(fs=$i.width,ms=$i.height,ds){var Il=we({aspectRatio:Zr,width:lt,height:mt},oe.resize);lt=Il.width,mt=Il.height}else{var sr=we({aspectRatio:Zr,width:lt,height:mt}),St=sr.width;lt=St===void 0?Y:St;var Ll=sr.height;mt=Ll===void 0?Q:Ll}lt=Math.floor(He(Math.min(Math.max(lt,fs),Jr))),mt=Math.floor(He(Math.min(Math.max(mt,ms),ps)));var Nl=-lt/2,$e=-mt/2,Ce=lt,mc=mt,Vi=[];if(ds){var Ml=0,Ai=0,pn=Y,Ve=Q,ti=we({aspectRatio:Zr,width:Y,height:Q},{contain:"cover",cover:"contain"}[oe.resize]);pn=ti.width,Ve=ti.height,Ml=(Y-pn)/2,Ai=(Q-Ve)/2,Vi.push(Ml,Ai,pn,Ve)}if(Vi.push(Nl,$e,Ce,mc),rr){var or=[mt,lt];lt=or[0],mt=or[1]}kt.width=lt,kt.height=mt,q(oe.mimeType)||(oe.mimeType=Rt.type);var Bl="transparent";Rt.size>oe.convertSize&&oe.convertTypes.indexOf(oe.mimeType)>=0&&(oe.mimeType="image/jpeg");var ko=oe.mimeType==="image/jpeg";if(ko&&(Bl="#fff"),rt.fillStyle=Bl,rt.fillRect(0,0,lt,mt),oe.beforeDraw&&oe.beforeDraw.call(this,rt,kt),!this.aborted&&(rt.save(),rt.translate(lt/2,mt/2),rt.rotate(ge*Math.PI/180),rt.scale(ce,Le),rt.drawImage.apply(rt,[qe].concat(Vi)),rt.restore(),oe.drew&&oe.drew.call(this,rt,kt),!this.aborted)){var Uo=o(function(gs){if(!N.aborted){var fn=o(function(wi){return N.done({naturalWidth:Y,naturalHeight:Q,result:wi})},"done");if(gs&&ko&&oe.retainExif&&N.exif&&N.exif.length>0){var mn=o(function(wi){return fn(d(te(Ie(wi,N.exif),oe.mimeType)))},"next");if(gs.arrayBuffer)gs.arrayBuffer().then(mn).catch(function(){N.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var gt=new P;N.reader=gt,gt.onload=function(Ut){var wi=Ut.target;mn(wi.result)},gt.onabort=function(){N.fail(new Error("Aborted to read the compressed image with FileReader."))},gt.onerror=function(){N.fail(new Error("Failed to read the compressed image with FileReader."))},gt.onloadend=function(){N.reader=null},gt.readAsArrayBuffer(gs)}}else fn(gs)}},"callback");kt.toBlob?kt.toBlob(Uo,oe.mimeType,oe.quality):Uo(d(kt.toDataURL(oe.mimeType,oe.quality)))}},"draw")},{key:"done",value:o(function(k){var N=k.naturalWidth,Y=k.naturalHeight,Q=k.result,Oe=this.file,ge=this.image,ue=this.options;if(E&&ge.src.indexOf("blob:")===0&&E.revokeObjectURL(ge.src),Q)if(ue.strict&&!ue.retainExif&&Q.size>Oe.size&&ue.mimeType===Oe.type&&!(ue.width>N||ue.height>Y||ue.minWidth>N||ue.minHeight>Y||ue.maxWidth<N||ue.maxHeight<Y))Q=Oe;else{var ce=new Date;Q.lastModified=ce.getTime(),Q.lastModifiedDate=ce,Q.name=Oe.name,Q.name&&Q.type!==Oe.type&&(Q.name=Q.name.replace(L,W(Q.type)))}else Q=Oe;this.result=Q,ue.success&&ue.success.call(this,Q)},"done")},{key:"fail",value:o(function(k){var N=this.options;if(N.error)N.error.call(this,k);else throw k},"fail")},{key:"abort",value:o(function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))},"abort")}],[{key:"noConflict",value:o(function(){return window.Compressor=z,D},"noConflict")},{key:"setDefaults",value:o(function(k){a(y,k)},"setDefaults")}]),D}();return B})});var Rf={};ql(Rf,{Audio:()=>Ys,AwsS3:()=>Yo,AwsS3Multipart:()=>us,BasePlugin:()=>Ee,Box:()=>Rr,Compressor:()=>Ul,Core:()=>gE,Dashboard:()=>qs,DefaultStore:()=>Xl,DragDrop:()=>$s,DropTarget:()=>Go,Dropbox:()=>kr,Facebook:()=>Ur,FileInput:()=>Vs,Form:()=>un,GoldenRetriever:()=>cn,GoogleDrive:()=>Dr,GooglePhotos:()=>Ir,ImageEditor:()=>Ws,Informer:()=>Fr,Instagram:()=>Lr,OneDrive:()=>Nr,ProgressBar:()=>Gs,ReduxDevTools:()=>hn,ReduxStore:()=>Gg,RemoteSources:()=>Ko,ScreenCapture:()=>Js,StatusBar:()=>xr,ThumbnailGenerator:()=>os,Transloadit:()=>qi,Tus:()=>Kr,UIPlugin:()=>ne,Unsplash:()=>Mr,Uppy:()=>kc,Url:()=>Ei,Webcam:()=>Zs,XHRUpload:()=>an,Zoom:()=>Br,debugLogger:()=>Pn,locales:()=>vE,server:()=>Gc,views:()=>yE});function $l(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o($l,"_classPrivateFieldLooseBase");var F1=0;function Hf(i){return"__private_"+F1+++"_"+i}o(Hf,"_classPrivateFieldLooseKey");function E1(i,e,t){let r=[];return i.forEach(s=>typeof s!="string"?r.push(s):e[Symbol.split](s).forEach((n,a,l)=>{n!==""&&r.push(n),a<l.length-1&&r.push(t)})),r}o(E1,"insertReplacement");function zf(i,e){let t=/\$/g,r="$$$$",s=[i];if(e==null)return s;for(let n of Object.keys(e))if(n!=="_"){let a=e[n];typeof a=="string"&&(a=t[Symbol.replace](a,r)),s=E1(s,new RegExp(`%\\{${n}\\}`,"g"),a)}return s}o(zf,"interpolate");var O1=o(i=>{throw new Error(`missing string: ${i}`)},"defaultOnMissingKey"),yn=Hf("onMissingKey"),vn=Hf("apply"),ws=class{static{o(this,"Translator")}constructor(e,t){let{onMissingKey:r=O1}=t===void 0?{}:t;Object.defineProperty(this,vn,{value:C1}),Object.defineProperty(this,yn,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach($l(this,vn)[vn],this):$l(this,vn)[vn](e),$l(this,yn)[yn]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&($l(this,yn)[yn](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){let n=this.locale.pluralize(t.smart_count);return zf(r[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return zf(r,t)}};function C1(i){if(!(i!=null&&i.strings))return;let e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}o(C1,"_apply2");var Nm=be(bc(),1);var A1="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Xt=o((i=21)=>{let e="",t=i;for(;t--;)e+=A1[Math.random()*64|0];return e},"nanoid");var Mm=be(Wl(),1);function Gl(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Gl,"_classPrivateFieldLooseBase");var Pw=0;function Pm(i){return"__private_"+Pw+++"_"+i}o(Pm,"_classPrivateFieldLooseKey");var _w={version:"3.2.2"},Ss=Pm("callbacks"),xc=Pm("publish"),Kl=class{static{o(this,"DefaultStore")}constructor(){Object.defineProperty(this,xc,{value:xw}),this.state={},Object.defineProperty(this,Ss,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t={...this.state},r={...this.state,...e};this.state=r,Gl(this,xc)[xc](t,r,e)}subscribe(e){return Gl(this,Ss)[Ss].add(e),()=>{Gl(this,Ss)[Ss].delete(e)}}};function xw(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Gl(this,Ss)[Ss].forEach(r=>{r(...e)})}o(xw,"_publish2");Kl.VERSION=_w.version;var Xl=Kl;function Gi(i){let e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}o(Gi,"getFileNameAndExtension");var wn={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",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",dicom:"application/dicom",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"};function Sn(i){var e;if(i.type)return i.type;let t=i.name?(e=Gi(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in wn?wn[t]:"application/octet-stream"}o(Sn,"getFileType");function Fw(i){return i.charCodeAt(0).toString(32)}o(Fw,"encodeCharacter");function _m(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${Fw(t)}`,"/"))+e}o(_m,"encodeFilename");function xm(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${_m(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${_m(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}o(xm,"generateFileID");function Ew(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}o(Ew,"hasFileStableId");function Yl(i,e){if(Ew(i))return i.id;let t=Sn(i);return xm({...i,type:t},e)}o(Yl,"getSafeFileId");function Fc(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;let r=e[1].split(".",2),s=parseInt(r[0],10),n=parseInt(r[1],10);return s<15||s===15&&n<15063||s>18||s===18&&n>=18218}o(Fc,"supportsUploadProgress");function Ec(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}o(Ec,"getFileName");function Oc(i){return i<10?`0${i}`:i.toString()}o(Oc,"pad");function Io(){let i=new Date,e=Oc(i.getHours()),t=Oc(i.getMinutes()),r=Oc(i.getSeconds());return`${e}:${t}:${r}`}o(Io,"getTimeStamp");var Fm={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Io()}]`,...e)}},Pn={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${Io()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${Io()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${Io()}]`,...e)}};var xn=be(_n(),1),km=be(Rm(),1);var Um={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},Yt=class extends Error{static{o(this,"RestrictionError")}constructor(e,t){var r;super(e),this.isRestriction=!0,this.isUserFacing=(r=t?.isUserFacing)!=null?r:!0,t!=null&&t.file&&(this.file=t.file)}},Ql=class{static{o(this,"Restricter")}constructor(e,t){this.getI18n=t,this.getOpts=()=>{var r;let s=e();if(((r=s.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:r,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(a=>!a.isGhost).length+t.length>s)throw new Yt(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){let n=[...e,...t].reduce((a,l)=>{var u;return a+((u=l.size)!=null?u:0)},0);if(n>r)throw new Yt(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,xn.default)(r),size:(0,xn.default)(n)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(a=>a.includes("/")?e.type?(0,km.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=s.join(", ");throw new Yt(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new Yt(this.getI18n()("exceedsSize",{size:(0,xn.default)(t),file:e.name}),{file:e});if(r&&e.size!=null&&e.size<r)throw new Yt(this.getI18n()("inferiorSize",{size:(0,xn.default)(r)}),{file:e})}validate(e,t){t.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new Yt(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){let t=new Yt(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name})),{requiredMetaFields:r}=this.getOpts().restrictions,s=[];for(let n of r)(!Object.hasOwn(e.meta,n)||e.meta[n]==="")&&s.push(n);return{missingFields:s,error:t}}};var Dm={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"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",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",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed"}};var Im,Lm;function J(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(J,"_classPrivateFieldLooseBase");var Aw=0;function Xe(i){return"__private_"+Aw+++"_"+i}o(Xe,"_classPrivateFieldLooseKey");var Tw={version:"3.13.1"},Jl={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},Pt=Xe("plugins"),ri=Xe("restricter"),Fn=Xe("storeUnsubscribe"),lr=Xe("emitter"),Ps=Xe("preProcessors"),_s=Xe("uploaders"),hr=Xe("postProcessors"),si=Xe("informAndEmit"),Tn=Xe("checkRequiredMetaFieldsOnFile"),Cc=Xe("checkRequiredMetaFields"),En=Xe("assertNewUploadAllowed"),Rc=Xe("transformFile"),On=Xe("startIfAutoProceed"),Cn=Xe("checkAndUpdateFileState"),Ac=Xe("addListeners"),Ti=Xe("updateOnlineStatus"),An=Xe("requestClientById"),ur=Xe("createUpload"),Tc=Xe("getUpload"),xs=Xe("removeUpload"),cr=Xe("runUpload");Im=Symbol.for("uppy test: getPlugins");Lm=Symbol.for("uppy test: createUpload");var Zl=class i{static{o(this,"Uppy")}constructor(e){Object.defineProperty(this,cr,{value:Hw}),Object.defineProperty(this,xs,{value:zw}),Object.defineProperty(this,Tc,{value:jw}),Object.defineProperty(this,ur,{value:Bw}),Object.defineProperty(this,Ac,{value:Mw}),Object.defineProperty(this,Cn,{value:Nw}),Object.defineProperty(this,On,{value:Lw}),Object.defineProperty(this,Rc,{value:Iw}),Object.defineProperty(this,En,{value:Dw}),Object.defineProperty(this,Cc,{value:Uw}),Object.defineProperty(this,Tn,{value:kw}),Object.defineProperty(this,si,{value:Rw}),Object.defineProperty(this,Pt,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,ri,{writable:!0,value:void 0}),Object.defineProperty(this,Fn,{writable:!0,value:void 0}),Object.defineProperty(this,lr,{writable:!0,value:(0,Nm.default)()}),Object.defineProperty(this,Ps,{writable:!0,value:new Set}),Object.defineProperty(this,_s,{writable:!0,value:new Set}),Object.defineProperty(this,hr,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,this.calculateProgress=(0,Mm.default)((s,n)=>{let a=this.getFile(s?.id);if(s==null||!a){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}if(a.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}let l=Number.isFinite(n.bytesTotal)&&n.bytesTotal>0;this.setFileState(s.id,{progress:{...a.progress,bytesUploaded:n.bytesUploaded,bytesTotal:n.bytesTotal,percentage:l?Math.round(n.bytesUploaded/n.bytesTotal*100):0}}),this.calculateTotalProgress()},500,{leading:!0,trailing:!0}),Object.defineProperty(this,Ti,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,An,{writable:!0,value:new Map}),this.defaultLocale=Dm;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Um,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new Xl,logger:Fm,infoTimeout:5e3},r={...t,...e};this.opts={...r,restrictions:{...t.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=Pn),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Jl,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Fc(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),J(this,ri)[ri]=new Ql(()=>this.opts,()=>this.i18n),J(this,Fn)[Fn]=this.store.subscribe((s,n,a)=>{this.emit("state-update",s,n,a),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),J(this,Ac)[Ac]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];J(this,lr)[lr].emit(e,...r)}on(e,t){return J(this,lr)[lr].on(e,t),this}once(e,t){return J(this,lr)[lr].once(e,t),this}off(e,t){return J(this,lr)[lr].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(r=>{let[s,n]=r;return[s,{...t[s],...n}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=o(r=>this.log(`Missing i18n string: ${r}`,"error"),"onMissingKey"),t=new ws([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},r={};Object.keys(t).forEach(s=>{r[s]={...t[s],progress:{...t[s].progress,...e}}}),this.setState({files:r,...Jl}),this.emit("reset-progress")}clearUploadedFiles(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Jl,files:{}})}addPreProcessor(e){J(this,Ps)[Ps].add(e)}removePreProcessor(e){return J(this,Ps)[Ps].delete(e)}addPostProcessor(e){J(this,hr)[hr].add(e)}removePostProcessor(e){return J(this,hr)[hr].delete(e)}addUploader(e){J(this,_s)[_s].add(e)}removeUploader(e){return J(this,_s)[_s].delete(e)}setMeta(e){let t={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(s=>{r[s]={...r[s],meta:{...r[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){let r={...this.getState().files};if(!r[e]){this.log("Was trying to set metadata for a file that has been removed: ",e);return}let s={...r[e].meta,...t};r[e]={...r[e],meta:s},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:r}=this.getState(),s=Object.values(e),n=[],a=[],l=[],u=[],h=[],d=[],f=[],y=[],w=[];for(let S of s){let{progress:T}=S;!T.uploadComplete&&T.uploadStarted&&(n.push(S),S.isPaused||y.push(S)),T.uploadStarted||a.push(S),(T.uploadStarted||T.preprocess||T.postprocess)&&l.push(S),T.uploadStarted&&u.push(S),S.isPaused&&h.push(S),T.uploadComplete&&d.push(S),S.error&&f.push(S),(T.preprocess||T.postprocess)&&w.push(S)}return{newFiles:a,startedFiles:l,uploadStartedFiles:u,pausedFiles:h,completeFiles:d,erroredFiles:f,inProgressFiles:n,inProgressNotPausedFiles:y,processingFiles:w,isUploadStarted:u.length>0,isAllComplete:t===100&&d.length===s.length&&w.length===0,isAllErrored:!!r&&f.length===s.length,isAllPaused:n.length!==0&&h.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some(S=>S.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{J(this,ri)[ri].validate(t,[e])}catch(r){return r}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){J(this,En)[En](e);let{nextFilesState:t,validFilesToAdd:r,errors:s}=J(this,Cn)[Cn]([e]),n=s.filter(l=>l.isRestriction);if(J(this,si)[si](n),s.length>0)throw s[0];this.setState({files:t});let[a]=r;return this.emit("file-added",a),this.emit("files-added",r),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),J(this,On)[On](),a.id}addFiles(e){J(this,En)[En]();let{nextFilesState:t,validFilesToAdd:r,errors:s}=J(this,Cn)[Cn](e),n=s.filter(l=>l.isRestriction);J(this,si)[si](n);let a=s.filter(l=>!l.isRestriction);if(a.length>0){let l=`Multiple errors occurred while adding files:
`;if(a.forEach(u=>{l+=`
* ${u.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:l},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,l);{let u=new Error(l);throw u.errors=a,u}}this.setState({files:t}),r.forEach(l=>{this.emit("file-added",l)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(l=>{this.log(`Added file: ${l.name}
id: ${l.id}
type: ${l.type}`)}),r.length>0&&J(this,On)[On]()}removeFiles(e,t){let{files:r,currentUploads:s}=this.getState(),n={...r},a={...s},l=Object.create(null);e.forEach(f=>{r[f]&&(l[f]=r[f],delete n[f])});function u(f){return l[f]===void 0}o(u,"fileIsNotRemoved"),Object.keys(a).forEach(f=>{let y=s[f].fileIDs.filter(u);if(y.length===0){delete a[f];return}let{capabilities:w}=this.getState();if(y.length!==s[f].fileIDs.length&&!w.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");a[f]={...s[f],fileIDs:y}});let h={currentUploads:a,files:n};Object.keys(n).length===0&&(h.allowNewUpload=!0,h.error=null,h.recoveredState=null),this.setState(h),this.calculateTotalProgress();let d=Object.keys(l);d.forEach(f=>{this.emit("file-removed",l[f],t)}),d.length>5?this.log(`Removed ${d.length} files`):this.log(`Removed files: ${d.join(", ")}`)}removeFile(e,t){this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let r=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:r}),this.emit("upload-pause",e,r),r}pauseAll(){let e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{let s={...e[r],isPaused:!0};e[r]=s}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{let s={...e[r],isPaused:!1,error:null};e[r]=s}),this.setState({files:e}),this.emit("resume-all")}retryAll(){let e={...this.getState().files},t=Object.keys(e).filter(s=>e[s].error);if(t.forEach(s=>{let n={...e[s],isPaused:!1,error:null};e[s]=n}),this.setState({files:e,error:null}),this.emit("retry-all",t),t.length===0)return Promise.resolve({successful:[],failed:[]});let r=J(this,ur)[ur](t,{forceAllowNewUpload:!0});return J(this,cr)[cr](r)}cancelAll(e){let{reason:t="user"}=e===void 0?{}:e;if(this.emit("cancel-all",{reason:t}),t==="user"){let{files:r}=this.getState(),s=Object.keys(r);s.length&&this.removeFiles(s,"cancel-all"),this.setState(Jl)}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);let t=J(this,ur)[ur]([e],{forceAllowNewUpload:!0});return J(this,cr)[cr](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}calculateTotalProgress(){let t=this.getFiles().filter(h=>h.progress.uploadStarted||h.progress.preprocess||h.progress.postprocess);if(t.length===0){this.emit("progress",0),this.setState({totalProgress:0});return}let r=t.filter(h=>h.progress.bytesTotal!=null),s=t.filter(h=>h.progress.bytesTotal==null);if(r.length===0){let h=t.length*100,d=s.reduce((y,w)=>y+w.progress.percentage,0),f=Math.round(d/h*100);this.setState({totalProgress:f});return}let n=r.reduce((h,d)=>{var f;return h+((f=d.progress.bytesTotal)!=null?f:0)},0),a=n/r.length;n+=a*s.length;let l=0;r.forEach(h=>{l+=h.progress.bytesUploaded}),s.forEach(h=>{l+=a*(h.progress.percentage||0)/100});let u=n===0?0:Math.round(l/n*100);u>100&&(u=100),this.setState({totalProgress:u}),this.emit("progress",u)}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!0)?(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)}getID(){return this.opts.id}use(e,t){if(typeof e!="function"){let a=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(a)}let r=new e(this,t),s=r.id;if(!s)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");let n=this.getPlugin(s);if(n){let a=`Already found a plugin named '${n.id}'. Tried to use: '${s}'.
Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(a)}return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),r.type in J(this,Pt)[Pt]?J(this,Pt)[Pt][r.type].push(r):J(this,Pt)[Pt][r.type]=[r],r.install(),this.emit("plugin-added",r),this}getPlugin(e){for(let t of Object.values(J(this,Pt)[Pt])){let r=t.find(s=>s.id===e);if(r!=null)return r}}[Im](e){return J(this,Pt)[Pt][e]}iteratePlugins(e){Object.values(J(this,Pt)[Pt]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=J(this,Pt)[Pt][e.type],r=t.findIndex(a=>a.id===e.id);r!==-1&&t.splice(r,1);let n={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(n)}close(e){let{reason:t}=e===void 0?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),J(this,Fn)[Fn](),this.iteratePlugins(r=>{this.removePlugin(r)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",J(this,Ti)[Ti]),window.removeEventListener("offline",J(this,Ti)[Ti]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,r){t===void 0&&(t="info"),r===void 0&&(r=3e3);let s=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:s?e.message:e,details:s?e.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(e,t){let{logger:r}=this.opts;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e);break}}registerRequestClient(e,t){J(this,An)[An].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=J(this,An)[An].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?J(this,cr)[cr](e):(J(this,xs)[xs](e),Promise.reject(new Error("Nonexistent upload")))}[Lm](){return J(this,ur)[ur](...arguments)}addResultData(e,t){if(!J(this,Tc)[Tc](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:r}=this.getState(),s={...r[e],result:{...r[e].result,...t}};this.setState({currentUploads:{...r,[e]:s}})}upload(){var e;(e=J(this,Pt)[Pt].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState(),r=this.opts.onBeforeUpload(t);return r===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&typeof r=="object"&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>J(this,ri)[ri].validateMinNumberOfFiles(t)).catch(s=>{throw J(this,si)[si]([s]),s}).then(()=>{if(!J(this,Cc)[Cc](t))throw new Yt(this.i18n("missingRequiredMetaField"))}).catch(s=>{throw s}).then(()=>{let{currentUploads:s}=this.getState(),n=Object.values(s).flatMap(u=>u.fileIDs),a=[];Object.keys(t).forEach(u=>{let h=this.getFile(u);!h.progress.uploadStarted&&n.indexOf(u)===-1&&a.push(h.id)});let l=J(this,ur)[ur](a);return J(this,cr)[cr](l)}).catch(s=>{throw this.emit("error",s),this.log(s,"error"),s}))}};function Rw(i){for(let n of i)n.isRestriction?this.emit("restriction-failed",n.file,n):this.emit("error",n,n.file),this.log(n,"warning");let e=i.filter(n=>n.isUserFacing),t=4,r=e.slice(0,t),s=e.slice(t);r.forEach(n=>{let{message:a,details:l=""}=n;this.info({message:a,details:l},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}o(Rw,"_informAndEmit2");function kw(i){let{missingFields:e,error:t}=J(this,ri)[ri].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}o(kw,"_checkRequiredMetaFieldsOnFile2");function Uw(i){let e=!0;for(let t of Object.values(i))J(this,Tn)[Tn](t)||(e=!1);return e}o(Uw,"_checkRequiredMetaFields2");function Dw(i){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new Yt(this.i18n("noMoreFilesAllowed"),{file:i});throw J(this,si)[si]([t]),t}}o(Dw,"_assertNewUploadAllowed2");function Iw(i){let e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=Sn(e),r=Ec(t,e),s=Gi(r).extension,n=Yl(e,this.getID()),a=e.meta||{};a.name=r,a.type=t;let l=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:n,name:r,extension:s||"",meta:{...this.getState().meta,...a},type:t,data:e.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote||"",preview:e.preview}}o(Iw,"_transformFile2");function Lw(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}o(Lw,"_startIfAutoProceed2");function Nw(i){let{files:e}=this.getState(),t={...e},r=[],s=[];for(let a of i)try{var n;let l=J(this,Rc)[Rc](a),u=(n=e[l.id])==null?void 0:n.isGhost;u&&(l={...e[l.id],isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`));let h=this.opts.onBeforeFileAdded(l,t);if(!h&&this.checkIfFileAlreadyExists(l.id))throw new Yt(this.i18n("noDuplicates",{fileName:l.name}),{file:a});if(h===!1&&!u)throw new Yt("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof h=="object"&&h!==null&&(l=h),J(this,ri)[ri].validateSingleFile(l),t[l.id]=l,r.push(l)}catch(l){s.push(l)}try{J(this,ri)[ri].validateAggregateRestrictions(Object.values(e),r)}catch(a){return s.push(a),{nextFilesState:e,validFilesToAdd:[],errors:s}}return{nextFilesState:t,validFilesToAdd:r,errors:s}}o(Nw,"_checkAndUpdateFileState2");function Mw(){let i=o((r,s,n)=>{let a=r.message||"Unknown error";r.details&&(a+=` ${r.details}`),this.setState({error:a}),s!=null&&s.id in this.getState().files&&this.setFileState(s.id,{error:a,response:n})},"errorHandler");this.on("error",i),this.on("upload-error",(r,s,n)=>{if(i(s,r,n),typeof s=="object"&&s.message){var a;this.log(s.message,"error");let l=new Error(this.i18n("failedToUpload",{file:(a=r?.name)!=null?a:""}));l.isUserFacing=!0,l.details=s.message,s.details&&(l.details+=` ${s.details}`),J(this,si)[si]([l])}else J(this,si)[si]([s])});let e=null;this.on("upload-stalled",(r,s)=>{let{message:n}=r,a=s.map(l=>l.meta.name).join(", ");e||(this.info({message:n,details:a},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${n} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let t=o(r=>{let s=r.filter(a=>{let l=a!=null&&this.getFile(a.id);return l||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),l}),n=Object.fromEntries(s.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(n)},"onUploadStarted");this.on("upload-start",r=>{r.forEach(s=>{this.emit("upload-started",s)}),t(r)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let n=this.getFile(r.id).progress;this.setFileState(r.id,{progress:{...n,postprocess:J(this,hr)[hr].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),r.size==null&&this.setFileState(r.id,{size:s.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getFile(r.id).progress,preprocess:s}})}),this.on("preprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getState().files[r.id].progress,postprocess:s}})}),this.on("postprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.postprocess,this.setState({files:s})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",r=>{r&&J(this,Tn)[Tn](r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",J(this,Ti)[Ti]),window.addEventListener("offline",J(this,Ti)[Ti]),setTimeout(J(this,Ti)[Ti],3e3))}o(Mw,"_addListeners2");function Bw(i,e){e===void 0&&(e={});let{forceAllowNewUpload:t=!1}=e,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!t)throw new Error("Cannot create a new upload: already uploading.");let n=Xt();return this.emit("upload",{id:n,fileIDs:i}),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[n]:{fileIDs:i,step:0,result:{}}}}),n}o(Bw,"_createUpload2");function jw(i){let{currentUploads:e}=this.getState();return e[i]}o(jw,"_getUpload2");function zw(i){let e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}o(zw,"_removeUpload2");async function Hw(i){let e=o(()=>{let{currentUploads:n}=this.getState();return n[i]},"getCurrentUpload"),t=e(),r=[...J(this,Ps)[Ps],...J(this,_s)[_s],...J(this,hr)[hr]];try{for(let n=t.step||0;n<r.length&&t;n++){let a=r[n];this.setState({currentUploads:{...this.getState().currentUploads,[i]:{...t,step:n}}});let{fileIDs:l}=t;await a(l,i),t=e()}}catch(n){throw J(this,xs)[xs](i),n}if(t){t.fileIDs.forEach(u=>{let h=this.getFile(u);h&&h.progress.postprocess&&this.emit("postprocess-complete",h)});let n=t.fileIDs.map(u=>this.getFile(u)),a=n.filter(u=>!u.error),l=n.filter(u=>u.error);this.addResultData(i,{successful:a,failed:l,uploadID:i}),t=e()}let s;return t&&(s=t.result,this.emit("complete",s),J(this,xs)[xs](i)),s==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),s}o(Hw,"_runUpload2");Zl.VERSION=Tw.version;var kc=Zl;var Un,le,$m,qw,Rn,Bm,$w,eu={},Vm=[],Vw=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function dr(i,e){for(var t in e)i[t]=e[t];return i}o(dr,"s");function Wm(i){var e=i.parentNode;e&&e.removeChild(i)}o(Wm,"a");function c(i,e,t){var r,s,n,a={};for(n in e)n=="key"?r=e[n]:n=="ref"?s=e[n]:a[n]=e[n];if(arguments.length>2&&(a.children=arguments.length>3?Un.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(n in i.defaultProps)a[n]===void 0&&(a[n]=i.defaultProps[n]);return kn(i,a,r,s,null)}o(c,"h");function kn(i,e,t,r,s){var n={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:s??++$m};return s==null&&le.vnode!=null&&le.vnode(n),n}o(kn,"v");function Gm(){return{current:null}}o(Gm,"y");function vt(i){return i.children}o(vt,"p");function Ae(i,e){this.props=i,this.context=e}o(Ae,"d");function Lo(i,e){if(e==null)return i.__?Lo(i.__,i.__.__k.indexOf(i)+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?Lo(i):null}o(Lo,"_");function Km(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return Km(i)}}o(Km,"k");function jm(i){(!i.__d&&(i.__d=!0)&&Rn.push(i)&&!tu.__r++||Bm!==le.debounceRendering)&&((Bm=le.debounceRendering)||setTimeout)(tu)}o(jm,"b");function tu(){for(var i;tu.__r=Rn.length;)i=Rn.sort(function(e,t){return e.__v.__b-t.__v.__b}),Rn=[],i.some(function(e){var t,r,s,n,a,l;e.__d&&(a=(n=(t=e).__v).__e,(l=t.__P)&&(r=[],(s=dr({},n)).__v=n.__v+1,Uc(l,n,s,t.__n,l.ownerSVGElement!==void 0,n.__h!=null?[a]:null,r,a??Lo(n),n.__h),Jm(r,n),n.__e!=a&&Km(n)))})}o(tu,"g");function Xm(i,e,t,r,s,n,a,l,u,h){var d,f,y,w,S,T,C,_=r&&r.__k||Vm,R=_.length;for(t.__k=[],d=0;d<e.length;d++)if((w=t.__k[d]=(w=e[d])==null||typeof w=="boolean"?null:typeof w=="string"||typeof w=="number"||typeof w=="bigint"?kn(null,w,null,null,w):Array.isArray(w)?kn(vt,{children:w},null,null,null):w.__b>0?kn(w.type,w.props,w.key,null,w.__v):w)!=null){if(w.__=t,w.__b=t.__b+1,(y=_[d])===null||y&&w.key==y.key&&w.type===y.type)_[d]=void 0;else for(f=0;f<R;f++){if((y=_[f])&&w.key==y.key&&w.type===y.type){_[f]=void 0;break}y=null}Uc(i,w,y=y||eu,s,n,a,l,u,h),S=w.__e,(f=w.ref)&&y.ref!=f&&(C||(C=[]),y.ref&&C.push(y.ref,null,w),C.push(f,w.__c||S,w)),S!=null?(T==null&&(T=S),typeof w.type=="function"&&w.__k===y.__k?w.__d=u=Ym(w,u,i):u=Qm(i,w,y,_,S,u),typeof t.type=="function"&&(t.__d=u)):u&&y.__e==u&&u.parentNode!=i&&(u=Lo(y))}for(t.__e=T,d=R;d--;)_[d]!=null&&(typeof t.type=="function"&&_[d].__e!=null&&_[d].__e==t.__d&&(t.__d=Lo(r,d+1)),eg(_[d],_[d]));if(C)for(d=0;d<C.length;d++)Zm(C[d],C[++d],C[++d])}o(Xm,"w");function Ym(i,e,t){for(var r,s=i.__k,n=0;s&&n<s.length;n++)(r=s[n])&&(r.__=i,e=typeof r.type=="function"?Ym(r,e,t):Qm(t,r,r,s,r.__e,e));return e}o(Ym,"m");function Pi(i,e){return e=e||[],i==null||typeof i=="boolean"||(Array.isArray(i)?i.some(function(t){Pi(t,e)}):e.push(i)),e}o(Pi,"x");function Qm(i,e,t,r,s,n){var a,l,u;if(e.__d!==void 0)a=e.__d,e.__d=void 0;else if(t==null||s!=n||s.parentNode==null)e:if(n==null||n.parentNode!==i)i.appendChild(s),a=null;else{for(l=n,u=0;(l=l.nextSibling)&&u<r.length;u+=2)if(l==s)break e;i.insertBefore(s,n),a=n}return a!==void 0?a:s.nextSibling}o(Qm,"A");function Ww(i,e,t,r,s){var n;for(n in t)n==="children"||n==="key"||n in e||iu(i,n,null,t[n],r);for(n in e)s&&typeof e[n]!="function"||n==="children"||n==="key"||n==="value"||n==="checked"||t[n]===e[n]||iu(i,n,e[n],t[n],r)}o(Ww,"C");function zm(i,e,t){e[0]==="-"?i.setProperty(e,t):i[e]=t==null?"":typeof t!="number"||Vw.test(e)?t:t+"px"}o(zm,"$");function iu(i,e,t,r,s){var n;e:if(e==="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||zm(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||zm(i.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")n=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in i?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+n]=t,t?r||i.addEventListener(e,n?qm:Hm,n):i.removeEventListener(e,n?qm:Hm,n);else if(e!=="dangerouslySetInnerHTML"){if(s)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t!=null&&(t!==!1||e[0]==="a"&&e[1]==="r")?i.setAttribute(e,t):i.removeAttribute(e))}}o(iu,"H");function Hm(i){this.l[i.type+!1](le.event?le.event(i):i)}o(Hm,"I");function qm(i){this.l[i.type+!0](le.event?le.event(i):i)}o(qm,"T");function Uc(i,e,t,r,s,n,a,l,u){var h,d,f,y,w,S,T,C,_,R,q,W,K,$=e.type;if(e.constructor!==void 0)return null;t.__h!=null&&(u=t.__h,l=e.__e=t.__e,e.__h=null,n=[l]),(h=le.__b)&&h(e);try{e:if(typeof $=="function"){if(C=e.props,_=(h=$.contextType)&&r[h.__c],R=h?_?_.props.value:h.__:r,t.__c?T=(d=e.__c=t.__c).__=d.__E:("prototype"in $&&$.prototype.render?e.__c=d=new $(C,R):(e.__c=d=new Ae(C,R),d.constructor=$,d.render=Kw),_&&_.sub(d),d.props=C,d.state||(d.state={}),d.context=R,d.__n=r,f=d.__d=!0,d.__h=[]),d.__s==null&&(d.__s=d.state),$.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=dr({},d.__s)),dr(d.__s,$.getDerivedStateFromProps(C,d.__s))),y=d.props,w=d.state,f)$.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if($.getDerivedStateFromProps==null&&C!==y&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(C,R),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(C,d.__s,R)===!1||e.__v===t.__v){d.props=C,d.state=d.__s,e.__v!==t.__v&&(d.__d=!1),d.__v=e,e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(G){G&&(G.__=e)}),d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(C,d.__s,R),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(y,w,S)})}if(d.context=R,d.props=C,d.__v=e,d.__P=i,q=le.__r,W=0,"prototype"in $&&$.prototype.render)d.state=d.__s,d.__d=!1,q&&q(e),h=d.render(d.props,d.state,d.context);else do d.__d=!1,q&&q(e),h=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++W<25);d.state=d.__s,d.getChildContext!=null&&(r=dr(dr({},r),d.getChildContext())),f||d.getSnapshotBeforeUpdate==null||(S=d.getSnapshotBeforeUpdate(y,w)),K=h!=null&&h.type===vt&&h.key==null?h.props.children:h,Xm(i,Array.isArray(K)?K:[K],e,t,r,s,n,a,l,u),d.base=e.__e,e.__h=null,d.__h.length&&a.push(d),T&&(d.__E=d.__=null),d.__e=!1}else n==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=Gw(t.__e,e,t,r,s,n,a,u);(h=le.diffed)&&h(e)}catch(G){e.__v=null,(u||n!=null)&&(e.__e=l,e.__h=!!u,n[n.indexOf(l)]=null),le.__e(G,e,t)}}o(Uc,"j");function Jm(i,e){le.__c&&le.__c(e,i),i.some(function(t){try{i=t.__h,t.__h=[],i.some(function(r){r.call(t)})}catch(r){le.__e(r,t.__v)}})}o(Jm,"z");function Gw(i,e,t,r,s,n,a,l){var u,h,d,f=t.props,y=e.props,w=e.type,S=0;if(w==="svg"&&(s=!0),n!=null){for(;S<n.length;S++)if((u=n[S])&&"setAttribute"in u==!!w&&(w?u.localName===w:u.nodeType===3)){i=u,n[S]=null;break}}if(i==null){if(w===null)return document.createTextNode(y);i=s?document.createElementNS("http://www.w3.org/2000/svg",w):document.createElement(w,y.is&&y),n=null,l=!1}if(w===null)f===y||l&&i.data===y||(i.data=y);else{if(n=n&&Un.call(i.childNodes),h=(f=t.props||eu).dangerouslySetInnerHTML,d=y.dangerouslySetInnerHTML,!l){if(n!=null)for(f={},S=0;S<i.attributes.length;S++)f[i.attributes[S].name]=i.attributes[S].value;(d||h)&&(d&&(h&&d.__html==h.__html||d.__html===i.innerHTML)||(i.innerHTML=d&&d.__html||""))}if(Ww(i,y,f,s,l),d)e.__k=[];else if(S=e.props.children,Xm(i,Array.isArray(S)?S:[S],e,t,r,s&&w!=="foreignObject",n,a,n?n[0]:t.__k&&Lo(t,0),l),n!=null)for(S=n.length;S--;)n[S]!=null&&Wm(n[S]);l||("value"in y&&(S=y.value)!==void 0&&(S!==i.value||w==="progress"&&!S||w==="option"&&S!==f.value)&&iu(i,"value",S,f.value,!1),"checked"in y&&(S=y.checked)!==void 0&&S!==i.checked&&iu(i,"checked",S,f.checked,!1))}return i}o(Gw,"L");function Zm(i,e,t){try{typeof i=="function"?i(e):i.current=e}catch(r){le.__e(r,t)}}o(Zm,"M");function eg(i,e,t){var r,s;if(le.unmount&&le.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||Zm(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){le.__e(n,e)}r.base=r.__P=null}if(r=i.__k)for(s=0;s<r.length;s++)r[s]&&eg(r[s],e,typeof i.type!="function");t||i.__e==null||Wm(i.__e),i.__e=i.__d=void 0}o(eg,"N");function Kw(i,e,t){return this.constructor(i,t)}o(Kw,"O");function Dc(i,e,t){var r,s,n;le.__&&le.__(i,e),s=(r=typeof t=="function")?null:t&&t.__k||e.__k,n=[],Uc(e,i=(!r&&t||e).__k=c(vt,null,[i]),s||eu,eu,e.ownerSVGElement!==void 0,!r&&t?[t]:s?null:e.firstChild?Un.call(e.childNodes):null,n,!r&&t?t:s?s.__e:e.firstChild,r),Jm(n,i)}o(Dc,"P");function ru(i,e,t){var r,s,n,a=dr({},i.props);for(n in e)n=="key"?r=e[n]:n=="ref"?s=e[n]:a[n]=e[n];return arguments.length>2&&(a.children=arguments.length>3?Un.call(arguments,2):t),kn(i.type,a,r||i.key,s||i.ref,null)}o(ru,"q");Un=Vm.slice,le={__e:function(i,e,t,r){for(var s,n,a;e=e.__;)if((s=e.__c)&&!s.__)try{if((n=s.constructor)&&n.getDerivedStateFromError!=null&&(s.setState(n.getDerivedStateFromError(i)),a=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(i,r||{}),a=s.__d),a)return s.__E=s}catch(l){i=l}throw i}},$m=0,qw=o(function(i){return i!=null&&i.constructor===void 0},"i"),Ae.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=dr({},this.state),typeof i=="function"&&(i=i(dr({},t),this.props)),i&&dr(t,i),i!=null&&this.__v&&(e&&this.__h.push(e),jm(this))},Ae.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),jm(this))},Ae.prototype.render=vt,Rn=[],tu.__r=0,$w=0;function Dn(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}o(Dn,"isDOMElement");function Xw(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):Dn(i)?i:null}o(Xw,"findDOMElement");var su=Xw;function Yw(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}o(Yw,"getTextDirection");var ou=Yw;var Ee=class{static{o(this,"BasePlugin")}constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new ws([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}};function tg(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(tg,"_classPrivateFieldLooseBase");var Qw=0;function Jw(i){return"__private_"+Qw+++"_"+i}o(Jw,"_classPrivateFieldLooseKey");function Zw(i){let e=null,t;return function(){for(var r=arguments.length,s=new Array(r),n=0;n<r;n++)s[n]=arguments[n];return t=s,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}o(Zw,"debounce");var In=Jw("updateUI"),Ic=class i extends Ee{static{o(this,"UIPlugin")}constructor(){super(...arguments),Object.defineProperty(this,In,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof i||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:i}}));else if(typeof e=="function"){let r=e;this.uppy.iteratePlugins(s=>{s instanceof r&&(t=s)})}return t}mount(e,t){let r=t.id,s=su(e);if(s){this.isTargetDOMEl=!0;let l=document.createElement("div");return l.classList.add("uppy-Root"),tg(this,In)[In]=Zw(u=>{this.uppy.getPlugin(this.id)&&(Dc(this.render(u),l),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),Dc(this.render(this.uppy.getState()),l),this.el=l,s.appendChild(l),l.dir=this.opts.direction||ou(l)||"ltr",this.onMount(),this.el}let n=this.getTargetPlugin(e);if(n)return this.uppy.log(`Installing ${r} to ${n.id}`),this.parent=n,this.el=n.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let a=`Invalid target option given to ${r}.`;throw typeof e=="function"?a+=" 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.":a+="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.",new Error(a)}render(e){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,r;(t=(r=tg(this,In))[In])==null||t.call(r,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},ne=Ic;var Gc={};ql(Gc,{Provider:()=>Ye,RequestClient:()=>It,SearchProvider:()=>Os,Socket:()=>Bn,getAllowedHosts:()=>Qe,tokenStorage:()=>Je});var Lc=class extends Error{static{o(this,"UserFacingApiError")}constructor(){super(...arguments),this.name="UserFacingApiError"}},ig=Lc;var ug=be(ag(),1);var tS=Object.prototype.toString,iS=o(i=>tS.call(i)==="[object Error]","isError"),rS=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed"]);function Nc(i){return i&&iS(i)&&i.name==="TypeError"&&typeof i.message=="string"?i.message==="Load failed"?i.stack===void 0:rS.has(i.message):!1}o(Nc,"isNetworkError");var No=class extends Error{static{o(this,"AbortError")}constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},lg=o((i,e,t)=>{let r=t.retries-(e-1);return i.attemptNumber=e,i.retriesLeft=r,i},"decorateErrorWithCounts");async function nu(i,e){return new Promise((t,r)=>{e={onFailedAttempt(){},retries:10,...e};let s=ug.default.operation(e),n=o(()=>{s.stop(),r(e.signal?.reason)},"abortHandler");e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",n,{once:!0});let a=o(()=>{e.signal?.removeEventListener("abort",n),s.stop()},"cleanUp");s.attempt(async l=>{try{let u=await i(l);a(),t(u)}catch(u){try{if(!(u instanceof Error))throw new TypeError(`Non-error was thrown: "${u}". You should only throw errors.`);if(u instanceof No)throw u.originalError;if(u instanceof TypeError&&!Nc(u))throw u;if(await e.onFailedAttempt(lg(u,l,e)),!s.retry(u))throw s.mainError()}catch(h){lg(h,l,e),a(),r(h)}}})})}o(nu,"pRetry");var Mc=class extends Error{static{o(this,"NetworkError")}constructor(e,t){t===void 0&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}},Dt=Mc;function Es(){return fetch(...arguments).catch(i=>{throw i.name==="AbortError"?i:new Dt(i)})}o(Es,"fetchWithNetworkError");function oi(i,e){return Object.prototype.hasOwnProperty.call(i,e)}o(oi,"has");var Bc=class extends Error{static{o(this,"ErrorWithCause")}constructor(e,t){super(e),this.cause=t?.cause,this.cause&&oi(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}},pr=Bc;var cg=be(Wl(),1);function sS(i,e,t){let{progress:r,bytesUploaded:s,bytesTotal:n}=e;r&&(i.uppy.log(`Upload progress: ${r}`),i.uppy.emit("upload-progress",t,{uploader:i,bytesUploaded:s,bytesTotal:n}))}o(sS,"emitSocketProgress");var hg=(0,cg.default)(sS,300,{leading:!0,trailing:!0});function jc(i){var e;let r=(e=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/i.exec(i))==null?void 0:e[1];return`${/^http:\/\//i.test(i)?"ws":"wss"}://${r}`}o(jc,"getSocketHost");var zc=class extends Error{static{o(this,"AuthError")}constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}},dg=zc;var pg;function fr(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(fr,"_classPrivateFieldLooseBase");var oS=0;function au(i){return"__private_"+oS+++"_"+i}o(au,"_classPrivateFieldLooseKey");var nS={version:"3.8.2"};function aS(i){return i.replace(/\/$/,"")}o(aS,"stripSlash");var fg=10,lS=5*60*1e3,$c=401,qc=class extends Error{static{o(this,"HttpError")}constructor(e){let{statusCode:t,message:r}=e;super(r),this.name="HttpError",this.statusCode=t}};async function uS(i){if(i.status===$c)throw new dg;if(i.ok)return i.json();let e=`Failed request with status: ${i.status}. ${i.statusText}`,t;try{t=await i.json(),t.message&&(e=`${e} message: ${t.message}`),t.requestId&&(e=`${e} request-Id: ${t.requestId}`)}catch(r){throw new Error(e,{cause:r})}throw i.status>=400&&i.status<=499&&t.message?new ig(t.message):new qc({statusCode:i.status,message:e})}o(uS,"handleJSONResponse");var mr=au("companionHeaders"),Ln=au("getUrl"),Hc=au("requestSocketToken"),Nn=au("awaitRemoteFileUpload");pg=Symbol.for("uppy test: getCompanionHeaders");var It=class{static{o(this,"RequestClient")}constructor(e,t){Object.defineProperty(this,Nn,{value:hS}),Object.defineProperty(this,Ln,{value:cS}),Object.defineProperty(this,mr,{writable:!0,value:void 0}),Object.defineProperty(this,Hc,{writable:!0,value:async r=>{var s;let{file:n,postBody:a,signal:l}=r;if(((s=n.remote)==null?void 0:s.url)==null)throw new Error("Cannot connect to an undefined URL");return(await this.post(n.remote.url,{...n.remote.body,...a},{signal:l})).token}}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),fr(this,mr)[mr]=t?.companionHeaders}setCompanionHeaders(e){fr(this,mr)[mr]=e}[pg](){return fr(this,mr)[mr]}get hostname(){let{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return aS(e&&e[t]?e[t]:t)}async headers(e){return e===void 0&&(e=!1),{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...fr(this,mr)[mr]}}onReceiveResponse(e){let{headers:t}=e,s=this.uppy.getState().companion||{},n=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==s[n]&&this.uppy.setState({companion:{...s,[n]:t.get("i-am")}})}async request(e){let{path:t,method:r="GET",data:s,skipPostResponse:n,signal:a}=e;try{let l=await this.headers(!s),u=await Es(fr(this,Ln)[Ln](t),{method:r,signal:a,headers:l,credentials:this.opts.companionCookiesRule||"same-origin",body:s?JSON.stringify(s):null});return n||this.onReceiveResponse(u),await uS(u)}catch(l){throw l.isAuthError||l.name==="UserFacingApiError"||l.name==="AbortError"?l:new pr(`Could not ${r} ${fr(this,Ln)[Ln](t)}`,{cause:l})}}async get(e,t){return typeof t=="boolean"&&(t={skipPostResponse:t}),this.request({...t,path:e})}async post(e,t,r){return typeof r=="boolean"&&(r={skipPostResponse:r}),this.request({...r,path:e,method:"POST",data:t})}async delete(e,t,r){return typeof r=="boolean"&&(r={skipPostResponse:r}),this.request({...r,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,r){var s=this;try{let{signal:n,getQueue:a}=r||{};return await nu(async()=>{var l;let u=(l=this.uppy.getFile(e.id))==null?void 0:l.serverToken;if(u!=null)return this.uppy.log(`Connecting to exiting websocket ${u}`),fr(this,Nn)[Nn]({file:e,queue:a(),signal:n});let d=await a().wrapPromiseFunction(async function(){try{return await fr(s,Hc)[Hc](...arguments)}catch(f){if(f.isAuthError)throw new No(f);if(f.cause==null)throw f;let y=f.cause,w=o(()=>[408,409,429,418,423].includes(y.statusCode)||y.statusCode>=500&&y.statusCode<=599&&![501,505].includes(y.statusCode),"isRetryableHttpError");throw y.name==="HttpError"&&!w()?new No(y):y}},{priority:-1})({file:e,postBody:t,signal:n}).abortOn(n);if(this.uppy.getFile(e.id))return this.uppy.setFileState(e.id,{serverToken:d}),fr(this,Nn)[Nn]({file:this.uppy.getFile(e.id),queue:a(),signal:n})},{retries:fg,signal:n,onFailedAttempt:l=>this.uppy.log(`Retrying upload due to: ${l.message}`,"warning")})}catch(n){if(n.name==="AbortError")return;throw this.uppy.emit("upload-error",e,n),n}}};function cS(i){return/^(https?:|)\/\//.test(i)?i:`${this.hostname}/${i}`}o(cS,"_getUrl2");async function hS(i){let{file:e,queue:t,signal:r}=i,s,{capabilities:n}=this.uppy.getState();try{return await new Promise((a,l)=>{let u=e.serverToken,h=jc(e.remote.companionUrl),d,f,y,{isPaused:w}=e,S=o((G,te)=>{if(d==null||d.readyState!==d.OPEN){var re;this.uppy.log(`Cannot send "${G}" to socket ${e.id} because the socket state was ${String((re=d)==null?void 0:re.readyState)}`,"warning");return}d.send(JSON.stringify({action:G,payload:te??{}}))},"socketSend");function T(){n.resumableUploads&&S(w?"pause":"resume")}o(T,"sendState");let C=o(async()=>{f&&f.abort(),f=new AbortController;let G=o(re=>{var Te;this.uppy.setFileState(e.id,{serverToken:null}),(Te=f)==null||Te.abort==null||Te.abort(),l(re)},"onFatalError");function te(){clearTimeout(y),!w&&(y=setTimeout(()=>G(new Error("Timeout waiting for message from Companion socket")),lS))}o(te,"resetActivityTimeout");try{await t.wrapPromiseFunction(async()=>{await nu(o(async()=>new Promise((Te,Ke)=>{d=new WebSocket(`${h}/api/${u}`),te(),d.addEventListener("close",()=>{d=void 0,Ke(new Error("Socket closed unexpectedly"))}),d.addEventListener("error",we=>{var Pe;this.uppy.log(`Companion socket error ${JSON.stringify(we)}, closing socket`,"warning"),(Pe=d)==null||Pe.close()}),d.addEventListener("open",()=>{T()}),d.addEventListener("message",we=>{te();try{let{action:E,payload:L}=JSON.parse(we.data);switch(E){case"progress":{hg(this,L,this.uppy.getFile(e.id));break}case"success":{var Pe,Ie,O,P;let z=(Pe=L.response)==null?void 0:Pe.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:L.url,status:(Ie=(O=L.response)==null?void 0:O.status)!=null?Ie:200,body:z?JSON.parse(z):void 0}),(P=f)==null||P.abort==null||P.abort(),a();break}case"error":{let{message:z}=L.error;throw Object.assign(new Error(z),{cause:L.error})}default:this.uppy.log(`Companion socket unknown action ${E}`,"warning")}}catch(E){G(E)}});let He=o(()=>{this.uppy.log(`Closing socket ${e.id}`,"info"),clearTimeout(y),d&&d.close(),d=void 0},"closeSocket");f.signal.addEventListener("abort",()=>{He()})}),"reconnectWebsocket"),{retries:fg,signal:f.signal,onFailedAttempt:()=>{f.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`,"info")}})})().abortOn(f.signal)}catch(re){if(f.signal.aborted)return;G(re)}},"createWebsocket"),_=o(G=>{if(n.resumableUploads)if(w=G,d&&T(),G){var te;(te=f)==null||te.abort==null||te.abort()}else C()},"pause"),R=o(G=>{var te;n.individualCancellation&&G.id===e.id&&(S("cancel"),(te=f)==null||te.abort==null||te.abort(),this.uppy.log(`upload ${e.id} was removed`,"info"),a())},"onFileRemove"),q=o(G=>{var te;let{reason:re}=G;re==="user"&&S("cancel"),(te=f)==null||te.abort==null||te.abort(),this.uppy.log(`upload ${e.id} was canceled`,"info"),a()},"onCancelAll"),W=o((G,te)=>{G===e.id&&_(te)},"onFilePausedChange"),K=o(()=>_(!0),"onPauseAll"),$=o(()=>_(!1),"onResumeAll");this.uppy.on("file-removed",R),this.uppy.on("cancel-all",q),this.uppy.on("upload-pause",W),this.uppy.on("pause-all",K),this.uppy.on("resume-all",$),s=o(()=>{this.uppy.off("file-removed",R),this.uppy.off("cancel-all",q),this.uppy.off("upload-pause",W),this.uppy.off("pause-all",K),this.uppy.off("resume-all",$)},"removeEventHandlers"),r.addEventListener("abort",()=>{var G;(G=f)==null||G.abort()}),C()})}finally{s?.()}}o(hS,"_awaitRemoteFileUpload2");It.VERSION=nS.version;function xi(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(xi,"_classPrivateFieldLooseBase");var dS=0;function Vc(i){return"__private_"+dS+++"_"+i}o(Vc,"_classPrivateFieldLooseKey");var pS=o(i=>i.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),"getName");function fS(){return location.origin}o(fS,"getOrigin");function mg(i){if(typeof i=="string")return new RegExp(`^${i}$`);if(i instanceof RegExp)return i}o(mg,"getRegex");function mS(i,e){return(Array.isArray(e)?e.map(mg):[mg(e)]).some(r=>r?.test(i)||r?.test(`${i}/`))}o(mS,"isOriginAllowed");var Ri=Vc("refreshingTokenPromise"),Mn=Vc("getAuthToken"),ki=Vc("getPlugin"),Ye=class extends It{static{o(this,"Provider")}constructor(e,t){var r;super(e,t),Object.defineProperty(this,ki,{value:yS}),Object.defineProperty(this,Mn,{value:gS}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||pS(this.id),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null,this.supportsRefreshToken=(r=t.supportsRefreshToken)!=null?r:!0}async headers(){let[e,t]=await Promise.all([super.headers(),xi(this,Mn)[Mn]()]),r={};return t&&(r["uppy-auth-token"]=t),this.companionKeysParams&&(r["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...e,...r}}onReceiveResponse(e){super.onReceiveResponse(e);let t=xi(this,ki)[ki](),s=t.getPluginState().authenticated?e.status!==$c:e.status<400;return t.setPluginState({authenticated:s}),e}async setAuthToken(e){return xi(this,ki)[ki]().storage.setItem(this.tokenKey,e)}async removeAuthToken(){return xi(this,ki)[ki]().storage.removeItem(this.tokenKey)}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authQuery(e){return{}}authUrl(e){let{authFormData:t,query:r}=e,s=new URLSearchParams({...r,state:btoa(JSON.stringify({origin:fS()})),...this.authQuery({authFormData:t})});return this.preAuthToken&&s.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${s}`}async loginSimpleAuth(e){let{uppyVersions:t,authFormData:r,signal:s}=e,n=await this.post(`${this.id}/simple-auth`,{form:r},{qs:{uppyVersions:t},signal:s});this.setAuthToken(n.uppyAuthToken)}async loginOAuth(e){let{uppyVersions:t,authFormData:r,signal:s}=e;return await this.ensurePreAuth(),s.throwIfAborted(),new Promise((n,a)=>{let l=this.authUrl({query:{uppyVersions:t},authFormData:r}),u=window.open(l,"_blank"),h,d=o(f=>{if(f.source!==u){let S="";try{S=JSON.stringify(f.data)}catch{}this.uppy.log(`ignoring event from unknown source ${S}`,"warning");return}let{companionAllowedHosts:y}=xi(this,ki)[ki]().opts;if(!mS(f.origin,y)){a(new Error(`rejecting event from ${f.origin} vs allowed pattern ${y}`));return}let w=typeof f.data=="string"?JSON.parse(f.data):f.data;if(w.error){let{uppy:S}=this,T=S.i18n("authAborted");S.info({message:T},"warning",5e3),a(new Error("auth aborted"));return}if(!w.token){a(new Error("did not receive token from auth window"));return}h(),n(this.setAuthToken(w.token))},"handleToken");h=o(()=>{u?.close(),window.removeEventListener("message",d),s.removeEventListener("abort",h)},"cleanup"),s.addEventListener("abort",h),window.addEventListener("message",d)})}async login(e){let{uppyVersions:t,authFormData:r,signal:s}=e;return this.loginOAuth({uppyVersions:t,authFormData:r,signal:s})}refreshTokenUrl(){return`${this.hostname}/${this.id}/refresh-token`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async request(){await xi(this,Ri)[Ri];try{return await super.request(...arguments)}catch(e){if(!this.supportsRefreshToken)throw e;let t=await xi(this,Mn)[Mn]();if(!e.isAuthError||!t)throw e;return xi(this,Ri)[Ri]==null&&(xi(this,Ri)[Ri]=(async()=>{try{this.uppy.log("[CompanionClient] Refreshing expired auth token","info");let r=await super.request({path:this.refreshTokenUrl(),method:"POST"});await this.setAuthToken(r.uppyAuthToken)}catch(r){throw r.isAuthError&&await this.removeAuthToken(),e}finally{xi(this,Ri)[Ri]=void 0}})()),await xi(this,Ri)[Ri],super.request(...arguments)}}async fetchPreAuthToken(){if(this.companionKeysParams)try{let e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}}list(e,t){return this.get(`${this.id}/list/${e||""}`,t)}async logout(e){let t=await this.get(`${this.id}/logout`,e);return await this.removeAuthToken(),t}};async function gS(){return xi(this,ki)[ki]().storage.getItem(this.tokenKey)}o(gS,"_getAuthToken2");function yS(){let i=this.uppy.getPlugin(this.pluginId);if(i==null)throw new Error("Plugin was nullish");return i}o(yS,"_getPlugin2");var vS=o(i=>i.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),"getName"),Os=class extends It{static{o(this,"SearchProvider")}constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||vS(this.id),this.pluginId=this.opts.pluginId}fileUrl(e){return`${this.hostname}/search/${this.id}/get/${e}`}search(e,t){return this.get(`search/${this.id}/list?q=${encodeURIComponent(e)}${t?`&${t}`:""}`)}};function Qe(i,e){if(i){if(typeof i!="string"&&!Array.isArray(i)&&!(i instanceof RegExp))throw new TypeError('The option "companionAllowedHosts" must be one of string, Array, RegExp');return i}return/^(?!https?:\/\/).*$/i.test(e)?`https://${e.replace(/^\/\//,"")}`:new URL(e).origin}o(Qe,"getAllowedHosts");var Je={};ql(Je,{getItem:()=>wS,removeItem:()=>SS,setItem:()=>bS});function bS(i,e){return new Promise(t=>{localStorage.setItem(i,e),t()})}o(bS,"setItem");function wS(i){return Promise.resolve(localStorage.getItem(i))}o(wS,"getItem");function SS(i){return new Promise(e=>{localStorage.removeItem(i),e()})}o(SS,"removeItem");var vg=be(bc(),1);var gg,yg;function We(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(We,"_classPrivateFieldLooseBase");var PS=0;function jn(i){return"__private_"+PS+++"_"+i}o(jn,"_classPrivateFieldLooseKey");var gr=jn("queued"),Cs=jn("emitter"),Ui=jn("isOpen"),ht=jn("socket"),Wc=jn("handleMessage");gg=Symbol.for("uppy test: getSocket");yg=Symbol.for("uppy test: getQueued");var Bn=class{static{o(this,"UppySocket")}constructor(e){Object.defineProperty(this,gr,{writable:!0,value:[]}),Object.defineProperty(this,Cs,{writable:!0,value:(0,vg.default)()}),Object.defineProperty(this,Ui,{writable:!0,value:!1}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,Wc,{writable:!0,value:t=>{try{let r=JSON.parse(t.data);this.emit(r.action,r.payload)}catch(r){console.log(r)}}}),this.opts=e,(!e||e.autoOpen!==!1)&&this.open()}get isOpen(){return We(this,Ui)[Ui]}[gg](){return We(this,ht)[ht]}[yg](){return We(this,gr)[gr]}open(){We(this,ht)[ht]==null&&(We(this,ht)[ht]=new WebSocket(this.opts.target),We(this,ht)[ht].onopen=()=>{for(We(this,Ui)[Ui]=!0;We(this,gr)[gr].length>0&&We(this,Ui)[Ui];){let e=We(this,gr)[gr].shift();this.send(e.action,e.payload)}},We(this,ht)[ht].onclose=()=>{We(this,Ui)[Ui]=!1,We(this,ht)[ht]=null},We(this,ht)[ht].onmessage=We(this,Wc)[Wc])}close(){var e;(e=We(this,ht)[ht])==null||e.close()}send(e,t){if(!We(this,Ui)[Ui]){We(this,gr)[gr].push({action:e,payload:t});return}We(this,ht)[ht].send(JSON.stringify({action:e,payload:t}))}on(e,t){We(this,Cs)[Cs].on(e,t)}emit(e,t){We(this,Cs)[Cs].emit(e,t)}once(e,t){We(this,Cs)[Cs].once(e,t)}};var vh={};ql(vh,{ProviderViews:()=>Me,SearchProviderViews:()=>wr,defaultPickerIcon:()=>Bo});var Xc=be(wg(),1);var Hn=class extends Error{static{o(this,"TimeoutError")}constructor(e){super(e),this.name="TimeoutError"}},Yc=class extends Error{static{o(this,"AbortError")}constructor(e){super(),this.name="AbortError",this.message=e}},Sg=o(i=>globalThis.DOMException===void 0?new Yc(i):new DOMException(i),"getDOMException"),Pg=o(i=>{let e=i.reason===void 0?Sg("This operation was aborted."):i.reason;return e instanceof Error?e:Sg(e)},"getAbortedReason");function Qc(i,e,t,r){let s,n=new Promise((a,l)=>{if(typeof e!="number"||Math.sign(e)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);if(e===Number.POSITIVE_INFINITY){a(i);return}if(r={customTimers:{setTimeout,clearTimeout},...r},r.signal){let{signal:u}=r;u.aborted&&l(Pg(u)),u.addEventListener("abort",()=>{l(Pg(u))})}s=r.customTimers.setTimeout.call(void 0,()=>{if(typeof t=="function"){try{a(t())}catch(d){l(d)}return}let u=typeof t=="string"?t:`Promise timed out after ${e} milliseconds`,h=t instanceof Error?t:new Hn(u);typeof i.cancel=="function"&&i.cancel(),l(h)},e),(async()=>{try{a(await i)}catch(u){l(u)}finally{r.customTimers.clearTimeout.call(void 0,s)}})()});return n.clear=()=>{clearTimeout(s),s=void 0},n}o(Qc,"pTimeout");function Jc(i,e,t){let r=0,s=i.length;for(;s>0;){let n=Math.trunc(s/2),a=r+n;t(i[a],e)<=0?(r=++a,s-=n+1):s=n}return r}o(Jc,"lowerBound");var As=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},yr,Zc=class{static{o(this,"PriorityQueue")}constructor(){yr.set(this,[])}enqueue(e,t){t={priority:0,...t};let r={priority:t.priority,run:e};if(this.size&&As(this,yr,"f")[this.size-1].priority>=t.priority){As(this,yr,"f").push(r);return}let s=Jc(As(this,yr,"f"),r,(n,a)=>a.priority-n.priority);As(this,yr,"f").splice(s,0,r)}dequeue(){let e=As(this,yr,"f").shift();return e?.run}filter(e){return As(this,yr,"f").filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return As(this,yr,"f").length}};yr=new WeakMap;var _g=Zc;var Ne=function(i,e,t,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(i,t):s?s.value=t:e.set(i,t),t},ie=function(i,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!r:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(i):r?r.value:e.get(i)},Ze,$n,Vn,rs,fu,Wn,uu,Di,qn,ni,cu,ai,Gn,is,hu,xg,Fg,Cg,Eg,Og,du,eh,th,mu,Ag,pu,gu=class extends Error{static{o(this,"AbortError")}},ih=class extends Xc.default{static{o(this,"PQueue")}constructor(e){var t,r,s,n;if(super(),Ze.add(this),$n.set(this,void 0),Vn.set(this,void 0),rs.set(this,0),fu.set(this,void 0),Wn.set(this,void 0),uu.set(this,0),Di.set(this,void 0),qn.set(this,void 0),ni.set(this,void 0),cu.set(this,void 0),ai.set(this,0),Gn.set(this,void 0),is.set(this,void 0),hu.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:_g,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(r=(t=e.intervalCap)===null||t===void 0?void 0:t.toString())!==null&&r!==void 0?r:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(n=(s=e.interval)===null||s===void 0?void 0:s.toString())!==null&&n!==void 0?n:""}\` (${typeof e.interval})`);Ne(this,$n,e.carryoverConcurrencyCount,"f"),Ne(this,Vn,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),Ne(this,fu,e.intervalCap,"f"),Ne(this,Wn,e.interval,"f"),Ne(this,ni,new e.queueClass,"f"),Ne(this,cu,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,Ne(this,hu,e.throwOnTimeout===!0,"f"),Ne(this,is,e.autoStart===!1,"f")}get concurrency(){return ie(this,Gn,"f")}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);Ne(this,Gn,e,"f"),ie(this,Ze,"m",mu).call(this)}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:ie(this,hu,"f"),...t},new Promise((r,s)=>{ie(this,ni,"f").enqueue(async()=>{var n,a,l;Ne(this,ai,(a=ie(this,ai,"f"),a++,a),"f"),Ne(this,rs,(l=ie(this,rs,"f"),l++,l),"f");try{if(!((n=t.signal)===null||n===void 0)&&n.aborted)throw new gu("The task was aborted.");let u=e({signal:t.signal});t.timeout&&(u=Qc(Promise.resolve(u),t.timeout)),t.signal&&(u=Promise.race([u,ie(this,Ze,"m",Ag).call(this,t.signal)]));let h=await u;r(h),this.emit("completed",h)}catch(u){if(u instanceof Hn&&!t.throwOnTimeout){r();return}s(u),this.emit("error",u)}finally{ie(this,Ze,"m",Cg).call(this)}},t),this.emit("add"),ie(this,Ze,"m",du).call(this)})}async addAll(e,t){return Promise.all(e.map(async r=>this.add(r,t)))}start(){return ie(this,is,"f")?(Ne(this,is,!1,"f"),ie(this,Ze,"m",mu).call(this),this):this}pause(){Ne(this,is,!0,"f")}clear(){Ne(this,ni,new(ie(this,cu,"f")),"f")}async onEmpty(){ie(this,ni,"f").size!==0&&await ie(this,Ze,"m",pu).call(this,"empty")}async onSizeLessThan(e){ie(this,ni,"f").size<e||await ie(this,Ze,"m",pu).call(this,"next",()=>ie(this,ni,"f").size<e)}async onIdle(){ie(this,ai,"f")===0&&ie(this,ni,"f").size===0||await ie(this,Ze,"m",pu).call(this,"idle")}get size(){return ie(this,ni,"f").size}sizeBy(e){return ie(this,ni,"f").filter(e).length}get pending(){return ie(this,ai,"f")}get isPaused(){return ie(this,is,"f")}};$n=new WeakMap,Vn=new WeakMap,rs=new WeakMap,fu=new WeakMap,Wn=new WeakMap,uu=new WeakMap,Di=new WeakMap,qn=new WeakMap,ni=new WeakMap,cu=new WeakMap,ai=new WeakMap,Gn=new WeakMap,is=new WeakMap,hu=new WeakMap,Ze=new WeakSet,xg=o(function(){return ie(this,Vn,"f")||ie(this,rs,"f")<ie(this,fu,"f")},"_PQueue_doesIntervalAllowAnother_get"),Fg=o(function(){return ie(this,ai,"f")<ie(this,Gn,"f")},"_PQueue_doesConcurrentAllowAnother_get"),Cg=o(function(){var e;Ne(this,ai,(e=ie(this,ai,"f"),e--,e),"f"),ie(this,Ze,"m",du).call(this),this.emit("next")},"_PQueue_next"),Eg=o(function(){ie(this,Ze,"m",th).call(this),ie(this,Ze,"m",eh).call(this),Ne(this,qn,void 0,"f")},"_PQueue_onResumeInterval"),Og=o(function(){let e=Date.now();if(ie(this,Di,"f")===void 0){let t=ie(this,uu,"f")-e;if(t<0)Ne(this,rs,ie(this,$n,"f")?ie(this,ai,"f"):0,"f");else return ie(this,qn,"f")===void 0&&Ne(this,qn,setTimeout(()=>{ie(this,Ze,"m",Eg).call(this)},t),"f"),!0}return!1},"_PQueue_isIntervalPaused_get"),du=o(function(){if(ie(this,ni,"f").size===0)return ie(this,Di,"f")&&clearInterval(ie(this,Di,"f")),Ne(this,Di,void 0,"f"),this.emit("empty"),ie(this,ai,"f")===0&&this.emit("idle"),!1;if(!ie(this,is,"f")){let e=!ie(this,Ze,"a",Og);if(ie(this,Ze,"a",xg)&&ie(this,Ze,"a",Fg)){let t=ie(this,ni,"f").dequeue();return t?(this.emit("active"),t(),e&&ie(this,Ze,"m",eh).call(this),!0):!1}}return!1},"_PQueue_tryToStartAnother"),eh=o(function(){ie(this,Vn,"f")||ie(this,Di,"f")!==void 0||(Ne(this,Di,setInterval(()=>{ie(this,Ze,"m",th).call(this)},ie(this,Wn,"f")),"f"),Ne(this,uu,Date.now()+ie(this,Wn,"f"),"f"))},"_PQueue_initializeIntervalIfNeeded"),th=o(function(){ie(this,rs,"f")===0&&ie(this,ai,"f")===0&&ie(this,Di,"f")&&(clearInterval(ie(this,Di,"f")),Ne(this,Di,void 0,"f")),Ne(this,rs,ie(this,$n,"f")?ie(this,ai,"f"):0,"f"),ie(this,Ze,"m",mu).call(this)},"_PQueue_onInterval"),mu=o(function(){for(;ie(this,Ze,"m",du).call(this););},"_PQueue_processQueue"),Ag=o(async function(e){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(new gu("The task was aborted."))},{once:!0})})},"_PQueue_throwOnAbort"),pu=o(async function(e,t){return new Promise(r=>{let s=o(()=>{t&&!t()||(this.off(e,s),r())},"listener");this.on(e,s)})},"_PQueue_onEvent");var Tg=ih;var bu,Mt,rh,Rg,Kn=0,Mg=[],yu=[],kg=le.__b,Ug=le.__r,Dg=le.diffed,Ig=le.__c,Lg=le.unmount;function oh(i,e){le.__h&&le.__h(Mt,i,Kn||e),Kn=0;var t=Mt.__H||(Mt.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({__V:yu}),t.__[i]}o(oh,"p");function vr(i){return Kn=1,FS(jg,i)}o(vr,"y");function FS(i,e,t){var r=oh(bu++,2);return r.t=i,r.__c||(r.__=[t?t(e):jg(void 0,e),function(s){var n=r.t(r.__[0],s);r.__[0]!==n&&(r.__=[n,r.__[1]],r.__c.setState({}))}],r.__c=Mt),r.__}o(FS,"d");function Ki(i,e){var t=oh(bu++,3);!le.__s&&Bg(t.__H,e)&&(t.__=i,t.u=e,Mt.__H.__h.push(t))}o(Ki,"_");function Ts(i){return Kn=5,Mo(function(){return{current:i}},[])}o(Ts,"s");function Mo(i,e){var t=oh(bu++,7);return Bg(t.__H,e)?(t.__V=i(),t.u=e,t.__h=i,t.__V):t.__}o(Mo,"F");function Rs(i,e){return Kn=8,Mo(function(){return i},e)}o(Rs,"T");function ES(){for(var i;i=Mg.shift();)if(i.__P)try{i.__H.__h.forEach(vu),i.__H.__h.forEach(sh),i.__H.__h=[]}catch(e){i.__H.__h=[],le.__e(e,i.__v)}}o(ES,"b");le.__b=function(i){Mt=null,kg&&kg(i)},le.__r=function(i){Ug&&Ug(i),bu=0;var e=(Mt=i.__c).__H;e&&(rh===Mt?(e.__h=[],Mt.__h=[],e.__.forEach(function(t){t.__V=yu,t.u=void 0})):(e.__h.forEach(vu),e.__h.forEach(sh),e.__h=[])),rh=Mt},le.diffed=function(i){Dg&&Dg(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(Mg.push(e)!==1&&Rg===le.requestAnimationFrame||((Rg=le.requestAnimationFrame)||function(t){var r,s=o(function(){clearTimeout(n),Ng&&cancelAnimationFrame(r),setTimeout(t)},"u"),n=setTimeout(s,100);Ng&&(r=requestAnimationFrame(s))})(ES)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.__V!==yu&&(t.__=t.__V),t.u=void 0,t.__V=yu})),rh=Mt=null},le.__c=function(i,e){e.some(function(t){try{t.__h.forEach(vu),t.__h=t.__h.filter(function(r){return!r.__||sh(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],le.__e(r,t.__v)}}),Ig&&Ig(i,e)},le.unmount=function(i){Lg&&Lg(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{vu(r)}catch(s){e=s}}),e&&le.__e(e,t.__v))};var Ng=typeof requestAnimationFrame=="function";function vu(i){var e=Mt,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),Mt=e}o(vu,"j");function sh(i){var e=Mt;i.__c=i.__(),Mt=e}o(sh,"k");function Bg(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}o(Bg,"w");function jg(i,e){return typeof e=="function"?e(i):e}o(jg,"z");function OS(){return c("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},c("g",{fill:"none","fill-rule":"evenodd"},c("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),c("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),c("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),c("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),c("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),c("path",{d:"M4 4h18v18H4z"})))}o(OS,"GoogleIcon");function CS(i){let{pluginName:e,i18n:t,onAuth:r}=i,s=e==="Google Drive",n=Rs(a=>{a.preventDefault(),r()},[r]);return c("form",{onSubmit:n},s?c("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},c(OS,null),t("signInWithGoogle")):c("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}o(CS,"DefaultForm");var AS=o(i=>{let{pluginName:e,i18n:t,onAuth:r}=i;return c(CS,{pluginName:e,i18n:t,onAuth:r})},"defaultRenderForm");function nh(i){let{loading:e,pluginName:t,pluginIcon:r,i18n:s,handleAuth:n,renderForm:a=AS}=i;return c("div",{className:"uppy-Provider-auth"},c("div",{className:"uppy-Provider-authIcon"},r()),c("div",{className:"uppy-Provider-authTitle"},s("authenticateWithTitle",{pluginName:t})),c("div",{className:"uppy-Provider-authForm"},a({pluginName:t,i18n:s,loading:e,onAuth:n})))}o(nh,"AuthView");function ah(i){let{i18n:e,logout:t,username:r}=i;return c(vt,null,c("span",{className:"uppy-ProviderBrowser-user",key:"username"},r),c("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}o(ah,"User");var TS=o(i=>{let{getFolder:e,title:t,isLast:r}=i;return c(vt,null,c("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:e},t),r?"":" / ")},"Breadcrumb");function lh(i){let{getFolder:e,title:t,breadcrumbsIcon:r,breadcrumbs:s}=i;return c("div",{className:"uppy-Provider-breadcrumbs"},c("div",{className:"uppy-Provider-breadcrumbsIcon"},r),s.map((n,a)=>c(TS,{key:n.id,getFolder:()=>e(n.requestPath,n.name),title:a===0?t:n.name,isLast:a+1===s.length})))}o(lh,"Breadcrumbs");function uh(i){return c(vt,null,i.showBreadcrumbs&&c(lh,{getFolder:i.getFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title}),c(ah,{logout:i.logout,username:i.username,i18n:i.i18n}))}o(uh,"Header");var gh=be(li(),1);function Xn(i){return{...i,type:i.mimeType,extension:i.name?Gi(i.name).extension:null}}o(Xn,"remoteFileObjToLocal");function ch(){return ch=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},ch.apply(this,arguments)}o(ch,"_extends");var RS={position:"relative",width:"100%",minHeight:"100%"},kS={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},hh=class extends Ae{static{o(this,"VirtualList")}constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:r,renderRow:s,overscanCount:n=10,...a}=e,{offset:l,height:u}=this.state,h=Math.floor(l/r),d=Math.floor(u/r);n&&(h=Math.max(0,h-h%n),d+=n);let f=h+d+4,y=t.slice(h,f),w={...RS,height:t.length*r},S={...kS,top:h*r};return c("div",ch({onScroll:this.handleScroll},a),c("div",{role:"presentation",style:w},c("div",{role:"presentation",style:S},y.map(s))))}},Su=hh;function Yn(i){let{search:e,searchOnInput:t,searchTerm:r,showButton:s,inputLabel:n,clearSearchLabel:a,buttonLabel:l,clearSearch:u,inputClassName:h,buttonCSSClassName:d}=i,[f,y]=vr(r??""),w=Rs(_=>{_.preventDefault(),e(f)},[e,f]),S=Rs(_=>{let R=_.target.value;y(R),t&&e(R)},[y,t,e]),T=o(()=>{y(""),u&&u()},"handleReset"),[C]=vr(()=>{let _=document.createElement("form");return _.setAttribute("tabindex","-1"),_.id=Xt(),_});return Ki(()=>(document.body.appendChild(C),C.addEventListener("submit",w),()=>{C.removeEventListener("submit",w),document.body.removeChild(C)}),[C,w]),c(vt,null,c("input",{className:`uppy-u-reset ${h}`,type:"search","aria-label":n,placeholder:n,value:f,onInput:S,form:C.id,"data-uppy-super-focusable":!0}),!s&&c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},c("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"})),!s&&f&&c("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:T},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},c("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"}))),s&&c("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:C.id},l))}o(Yn,"SearchFilterInput");function dh(i){let{cancel:e,done:t,i18n:r,selected:s}=i;return c("div",{className:"uppy-ProviderBrowser-footer"},c("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary",onClick:t,type:"button"},r("selectX",{smart_count:s})),c("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},r("cancel")))}o(dh,"FooterActions");var Hg=be(li(),1);function US(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},c("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"}))}o(US,"FileIcon");function DS(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},c("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"}))}o(DS,"FolderIcon");function IS(){return c("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},c("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"}),c("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"}))}o(IS,"VideoIcon");function ph(i){let{itemIconString:e}=i;if(e===null)return null;switch(e){case"file":return c(US,null);case"folder":return c(DS,null);case"video":return c(IS,null);default:{let{alt:t}=i;return c("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}}o(ph,"ItemIcon");var zg=be(li(),1);function LS(i){let{className:e,isDisabled:t,restrictionError:r,isChecked:s,title:n,itemIconEl:a,showTitles:l,toggleCheckbox:u,recordShiftKeyPress:h,id:d,children:f}=i,y=(0,zg.default)("uppy-u-reset","uppy-ProviderBrowserItem-checkbox","uppy-ProviderBrowserItem-checkbox--grid",{"uppy-ProviderBrowserItem-checkbox--is-checked":s});return c("li",{className:e,title:t?r?.message:void 0},c("input",{type:"checkbox",className:y,onChange:u,onKeyDown:h,onMouseDown:h,name:"listitem",id:d,checked:s,disabled:t,"data-uppy-super-focusable":!0}),c("label",{htmlFor:d,"aria-label":n,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},a,l&&n,f))}o(LS,"GridListItem");var fh=LS;function mh(i){let{className:e,isDisabled:t,restrictionError:r,isCheckboxDisabled:s,isChecked:n,toggleCheckbox:a,recordShiftKeyPress:l,type:u,id:h,itemIconEl:d,title:f,handleFolderClick:y,showTitles:w,i18n:S}=i;return c("li",{className:e,title:t?r?.message:void 0},s?null:c("input",{type:"checkbox",className:`uppy-u-reset uppy-ProviderBrowserItem-checkbox ${n?"uppy-ProviderBrowserItem-checkbox--is-checked":""}`,onChange:a,onKeyDown:l,onMouseDown:l,name:"listitem",id:h,checked:n,"aria-label":u==="file"?null:S("allFilesFromFolderNamed",{name:f}),disabled:t,"data-uppy-super-focusable":!0}),u==="file"?c("label",{htmlFor:h,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},c("div",{className:"uppy-ProviderBrowserItem-iconWrap"},d),w&&f):c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:y,"aria-label":S("openFolderNamed",{name:f})},c("div",{className:"uppy-ProviderBrowserItem-iconWrap"},d),w&&f?c("span",null,f):S("unnamed")))}o(mh,"ListItem");function Qn(){return Qn=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Qn.apply(this,arguments)}o(Qn,"_extends");function Pu(i){let{author:e,getItemIcon:t,isChecked:r,isDisabled:s,viewType:n}=i,a=t(),l=(0,Hg.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--selected":r},{"uppy-ProviderBrowserItem--disabled":s},{"uppy-ProviderBrowserItem--noPreview":a==="video"}),u=c(ph,{itemIconString:a});switch(n){case"grid":return c(fh,Qn({},i,{className:l,itemIconEl:u}));case"list":return c(mh,Qn({},i,{className:l,itemIconEl:u}));case"unsplash":return c(fh,Qn({},i,{className:l,itemIconEl:u}),c("a",{href:`${e.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},e.name));default:throw new Error(`There is no such type ${n}`)}}o(Pu,"Item");var NS="shared-with-me";function qg(i){let{currentSelection:e,uppyFiles:t,viewType:r,isChecked:s,toggleCheckbox:n,recordShiftKeyPress:a,showTitles:l,i18n:u,validateRestrictions:h,getNextFolder:d,f}=i;if(f.isFolder)return Pu({showTitles:l,viewType:r,i18n:u,id:f.id,title:f.name,getItemIcon:()=>f.icon,isChecked:s(f),toggleCheckbox:w=>n(w,f),recordShiftKeyPress:a,type:"folder",isDisabled:!1,isCheckboxDisabled:f.id===NS,handleFolderClick:()=>d(f)});let y=h(Xn(f),[...t,...e]);return Pu({id:f.id,title:f.name,author:f.author,getItemIcon:()=>r==="grid"&&f.thumbnail?f.thumbnail:f.icon,isChecked:s(f),toggleCheckbox:w=>n(w,f),isCheckboxDisabled:!1,recordShiftKeyPress:a,showTitles:l,viewType:r,i18n:u,type:"file",isDisabled:!!y&&!s(f),restrictionError:y})}o(qg,"ListItem");function MS(i){let{currentSelection:e,folders:t,files:r,uppyFiles:s,viewType:n,headerComponent:a,showBreadcrumbs:l,isChecked:u,toggleCheckbox:h,recordShiftKeyPress:d,handleScroll:f,showTitles:y,i18n:w,validateRestrictions:S,isLoading:T,showSearchFilter:C,search:_,searchTerm:R,clearSearch:q,searchOnInput:W,searchInputLabel:K,clearSearchLabel:$,getNextFolder:G,cancel:te,done:re,noResultsLabel:Te,virtualList:Ke}=i,He=e.length,we=Mo(()=>[...t,...r],[t,r]);return c("div",{className:(0,gh.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n}`)},a&&c("div",{className:"uppy-ProviderBrowser-header"},c("div",{className:(0,gh.default)("uppy-ProviderBrowser-headerBar",!l&&"uppy-ProviderBrowser-headerBar--simple")},a)),C&&c("div",{class:"uppy-ProviderBrowser-searchFilter"},c(Yn,{search:_,searchTerm:R,clearSearch:q,inputLabel:K,clearSearchLabel:$,inputClassName:"uppy-ProviderBrowser-searchFilterInput",searchOnInput:W})),T?c("div",{className:"uppy-Provider-loading"},c("span",null,typeof T=="string"?T:w("loading"))):!t.length&&!r.length?c("div",{className:"uppy-Provider-empty"},Te):Ke?c("div",{className:"uppy-ProviderBrowser-body"},c("ul",{className:"uppy-ProviderBrowser-list"},c(Su,{data:we,renderRow:Pe=>c(qg,{currentSelection:e,uppyFiles:s,viewType:n,isChecked:u,toggleCheckbox:h,recordShiftKeyPress:d,showTitles:y,i18n:w,validateRestrictions:S,getNextFolder:G,f:Pe}),rowHeight:31}))):c("div",{className:"uppy-ProviderBrowser-body"},c("ul",{className:"uppy-ProviderBrowser-list",onScroll:f,role:"listbox",tabIndex:-1},we.map(Pe=>c(qg,{currentSelection:e,uppyFiles:s,viewType:n,isChecked:u,toggleCheckbox:h,recordShiftKeyPress:d,showTitles:y,i18n:w,validateRestrictions:S,getNextFolder:G,f:Pe})))),He>0&&c(dh,{selected:He,done:re,cancel:te,i18n:w}))}o(MS,"Browser");var _u=MS;var br=class extends Ae{static{o(this,"CloseWrapper")}componentWillUnmount(){let{onUnmount:e}=this.props;e()}render(){let{children:e}=this.props;return Pi(e)[0]}};var ks=class{static{o(this,"View")}constructor(e,t){this.filterItems=r=>{let s=this.plugin.getPluginState();return!s.filterInput||s.filterInput===""?r:r.filter(n=>n.name.toLowerCase().indexOf(s.filterInput.toLowerCase())!==-1)},this.recordShiftKeyPress=r=>{this.isShiftKeyPressed=r.shiftKey},this.isChecked=r=>{let{currentSelection:s}=this.plugin.getPluginState();return s.some(n=>n.id===r.id)},this.plugin=e,this.provider=t.provider,this.opts=t,this.isHandlingScroll=!1,this.preFirstRender=this.preFirstRender.bind(this),this.handleError=this.handleError.bind(this),this.clearSelection=this.clearSelection.bind(this),this.cancelPicking=this.cancelPicking.bind(this)}preFirstRender(){this.plugin.setPluginState({didFirstRender:!0}),this.plugin.onFirstRender()}shouldHandleScroll(e){let{scrollHeight:t,scrollTop:r,offsetHeight:s}=e.target;return t-(r+s)<50&&!this.isHandlingScroll}clearSelection(){this.plugin.setPluginState({currentSelection:[],filterInput:""})}cancelPicking(){this.clearSelection();let e=this.plugin.uppy.getPlugin("Dashboard");e&&e.hideAllPanels()}handleError(e){var t;let{uppy:r}=this.plugin,s=r.i18n("companionError");r.log(e.toString()),!(e.isAuthError||((t=e.cause)==null?void 0:t.name)==="AbortError")&&r.info({message:s,details:e.toString()},"error",5e3)}registerRequestClient(){this.requestClientId=this.provider.provider,this.plugin.uppy.registerRequestClient(this.requestClientId,this.provider)}getTagFile(e){let t={id:e.id,source:this.plugin.id,name:e.name||e.id,type:e.mimeType,isRemote:!0,data:e,meta:{},body:{fileId:e.id},remote:{companionUrl:this.plugin.opts.companionUrl,url:`${this.provider.fileUrl(e.requestPath)}`,body:{fileId:e.id},providerName:this.provider.name,provider:this.provider.provider,requestClientId:this.requestClientId}};return e.thumbnail&&(t.preview=e.thumbnail),e.author&&(e.author.name!=null&&(t.meta.authorName=String(e.author.name)),e.author.url&&(t.meta.authorUrl=e.author.url)),e.relDirPath!=null&&(t.meta.relativePath=e.relDirPath?`${e.relDirPath}/${t.name}`:null),e.absDirPath!=null&&(t.meta.absolutePath=e.absDirPath?`/${e.absDirPath}/${t.name}`:`/${t.name}`),t}toggleCheckbox(e,t){e.stopPropagation(),e.preventDefault(),e.currentTarget.focus();let{folders:r,files:s}=this.plugin.getPluginState(),n=this.filterItems(r.concat(s));if(this.lastCheckbox&&this.isShiftKeyPressed){let{currentSelection:l}=this.plugin.getPluginState(),u=n.indexOf(this.lastCheckbox),h=n.indexOf(t),d=u<h?n.slice(u,h+1):n.slice(h,u+1),f=[];for(let y of d){let{uppy:w}=this.plugin,S=w.validateRestrictions(Xn(y),[...w.getFiles(),...f]);S?w.info({message:S.message},"error",w.opts.infoTimeout):f.push(y)}this.plugin.setPluginState({currentSelection:[...new Set([...l,...f])]});return}this.lastCheckbox=t;let{currentSelection:a}=this.plugin.getPluginState();this.isChecked(t)?this.plugin.setPluginState({currentSelection:a.filter(l=>l.id!==t.id)}):this.plugin.setPluginState({currentSelection:a.concat([t])})}setLoading(e){this.plugin.setPluginState({loading:e})}};function Qt(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Qt,"_classPrivateFieldLooseBase");var BS=0;function ta(i){return"__private_"+BS+++"_"+i}o(ta,"_classPrivateFieldLooseKey");var jS={version:"3.13.0"};function zS(i){return i.slice(1).map(e=>e.name).join("/")}o(zS,"formatBreadcrumbs");function yh(i,e){return i?`${i}/${e}`:e}o(yh,"prependPath");function Bo(){return c("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},c("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"}))}o(Bo,"defaultPickerIcon");var HS={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1},Us=ta("abortController"),Ii=ta("withAbort"),ea=ta("list"),Jn=ta("listFilesAndFolders"),Zn=ta("recursivelyListAllFiles"),Me=class extends ks{static{o(this,"ProviderView")}constructor(e,t){super(e,{...HS,...t}),Object.defineProperty(this,Zn,{value:WS}),Object.defineProperty(this,Jn,{value:VS}),Object.defineProperty(this,ea,{value:$S}),Object.defineProperty(this,Ii,{value:qS}),Object.defineProperty(this,Us,{writable:!0,value:void 0}),this.filterQuery=this.filterQuery.bind(this),this.clearFilter=this.clearFilter.bind(this),this.getFolder=this.getFolder.bind(this),this.getNextFolder=this.getNextFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.plugin.setPluginState({authenticated:void 0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[]}),this.registerRequestClient()}tearDown(){}async getFolder(e,t){this.setLoading(!0);try{await Qt(this,Ii)[Ii](async r=>{this.lastCheckbox=void 0;let{breadcrumbs:s}=this.plugin.getPluginState(),n=s.findIndex(u=>e===u.requestPath);n!==-1?s=s.slice(0,n+1):s=[...s,{requestPath:e,name:t}],this.nextPagePath=e;let a=[],l=[];do{let{files:u,folders:h}=await Qt(this,Jn)[Jn]({breadcrumbs:s,signal:r});a=a.concat(u),l=l.concat(h),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:a.length+l.length}))}while(this.opts.loadAllFiles&&this.nextPagePath);this.plugin.setPluginState({folders:l,files:a,breadcrumbs:s,filterInput:""})})}catch(r){if(r?.name==="UserFacingApiError"){this.plugin.uppy.info({message:this.plugin.uppy.i18n(r.message)},"warning",5e3);return}this.handleError(r)}finally{this.setLoading(!1)}}getNextFolder(e){this.getFolder(e.requestPath,e.name),this.lastCheckbox=void 0}async logout(){try{await Qt(this,Ii)[Ii](async e=>{let t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let s=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(s,"info",7e3)}let r={authenticated:!1,files:[],folders:[],breadcrumbs:[],filterInput:""};this.plugin.setPluginState(r)}})}catch(e){this.handleError(e)}}filterQuery(e){this.plugin.setPluginState({filterInput:e})}clearFilter(){this.plugin.setPluginState({filterInput:""})}async handleAuth(e){try{await Qt(this,Ii)[Ii](async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),this.preFirstRender()})}catch(t){if(t.name==="UserFacingApiError"){this.plugin.uppy.info({message:this.plugin.uppy.i18n(t.message)},"warning",5e3);return}this.plugin.uppy.log(`login failed: ${t.message}`)}finally{this.setLoading(!1)}}async handleScroll(e){if(this.shouldHandleScroll(e)&&this.nextPagePath){this.isHandlingScroll=!0;try{await Qt(this,Ii)[Ii](async t=>{let{files:r,folders:s,breadcrumbs:n}=this.plugin.getPluginState(),{files:a,folders:l}=await Qt(this,Jn)[Jn]({breadcrumbs:n,signal:t}),u=r.concat(a),h=s.concat(l);this.plugin.setPluginState({folders:h,files:u})})}catch(t){this.handleError(t)}finally{this.isHandlingScroll=!1}}}async donePicking(){this.setLoading(!0);try{await Qt(this,Ii)[Ii](async e=>{let{currentSelection:t}=this.plugin.getPluginState(),r=[],s=[];for(let n of t){let{requestPath:a}=n,l=o(u=>({...u,relDirPath:u.absDirPath.replace(n.absDirPath,"").replace(/^\//,"")}),"withRelDirPath");if(n.isFolder){let u=!0,h=0,d=new Tg({concurrency:6}),f=o(w=>{for(let S of w){let T=this.getTagFile(S),C=Yl(T,this.plugin.uppy.getID());this.plugin.uppy.checkIfFileAlreadyExists(C)||(s.push(l(S)),h++,this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:h}))),u=!1}},"onFiles");await Qt(this,Zn)[Zn]({requestPath:a,absDirPath:yh(n.absDirPath,n.name),relDirPath:n.name,queue:d,onFiles:f,signal:e}),await d.onIdle();let y;u?y=this.plugin.uppy.i18n("emptyFolderAdded"):h===0?y=this.plugin.uppy.i18n("folderAlreadyAdded",{folder:n.name}):y=this.plugin.uppy.i18n("folderAdded",{smart_count:h,folder:n.name}),r.push(y)}else s.push(l(n))}this.plugin.uppy.log("Adding files from a remote provider"),this.plugin.uppy.addFiles(s.map(n=>this.getTagFile(n,this.requestClientId))),this.plugin.setPluginState({filterInput:""}),r.forEach(n=>this.plugin.uppy.info(n)),this.clearSelection()})}catch(e){this.handleError(e)}finally{this.setLoading(!1)}}render(e,t){var r=this;t===void 0&&(t={});let{authenticated:s,didFirstRender:n}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy;n||this.preFirstRender();let l={...this.opts,...t},{files:u,folders:h,filterInput:d,loading:f,currentSelection:y}=this.plugin.getPluginState(),{isChecked:w,recordShiftKeyPress:S,filterItems:T}=this,C=d!=="",_=this.plugin.icon||Bo,R={showBreadcrumbs:l.showBreadcrumbs,getFolder:this.getFolder,breadcrumbs:this.plugin.getPluginState().breadcrumbs,pluginIcon:_,title:this.plugin.title,logout:this.logout,username:this.username,i18n:a},q={isChecked:w,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:S,currentSelection:y,files:C?T(u):u,folders:C?T(h):h,getNextFolder:this.getNextFolder,getFolder:this.getFolder,loadAllFiles:this.opts.loadAllFiles,virtualList:this.opts.virtualList,showSearchFilter:l.showFilter,search:this.filterQuery,clearSearch:this.clearFilter,searchTerm:d,searchOnInput:!0,searchInputLabel:a("filter"),clearSearchLabel:a("resetFilter"),noResultsLabel:a("noFilesFound"),logout:this.logout,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,headerComponent:c(uh,R),title:this.plugin.title,viewType:l.viewType,showTitles:l.showTitles,showBreadcrumbs:l.showBreadcrumbs,pluginIcon:_,i18n:this.plugin.uppy.i18n,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return r.plugin.uppy.validateRestrictions(...arguments)},isLoading:f};return s===!1?c(br,{onUnmount:this.clearSelection},c(nh,{pluginName:this.plugin.title,pluginIcon:_,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18nArray,renderForm:this.opts.renderAuthForm,loading:f})):c(br,{onUnmount:this.clearSelection},c(_u,q))}};async function qS(i){var e;(e=Qt(this,Us)[Us])==null||e.abort();let t=new AbortController;Qt(this,Us)[Us]=t;let r=o(()=>{t.abort(),this.clearSelection()},"cancelRequest");try{this.plugin.uppy.on("dashboard:close-panel",r),this.plugin.uppy.on("cancel-all",r),await i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",r),this.plugin.uppy.off("cancel-all",r),Qt(this,Us)[Us]=void 0}}o(qS,"_withAbort2");async function $S(i){let{requestPath:e,absDirPath:t,signal:r}=i,{username:s,nextPagePath:n,items:a}=await this.provider.list(e,{signal:r});return this.username=s||this.username,{items:a.map(l=>({...l,absDirPath:t})),nextPagePath:n}}o($S,"_list2");async function VS(i){let{breadcrumbs:e,signal:t}=i,r=zS(e),{items:s,nextPagePath:n}=await Qt(this,ea)[ea]({requestPath:this.nextPagePath,absDirPath:r,signal:t});this.nextPagePath=n;let a=[],l=[];return s.forEach(u=>{u.isFolder?l.push(u):a.push(u)}),{files:a,folders:l}}o(VS,"_listFilesAndFolders2");async function WS(i){let{requestPath:e,absDirPath:t,relDirPath:r,queue:s,onFiles:n,signal:a}=i,l=e;for(;l;){let u=await Qt(this,ea)[ea]({requestPath:l,absDirPath:t,signal:a});l=u.nextPagePath;let h=u.items.filter(y=>!y.isFolder),d=u.items.filter(y=>y.isFolder);n(h);let f=d.map(async y=>s.add(async()=>Qt(this,Zn)[Zn]({requestPath:y.requestPath,absDirPath:yh(t,y.name),relDirPath:yh(r,y.name),queue:s,onFiles:n,signal:a})));await Promise.all(f)}}o(WS,"_recursivelyListAllFiles2");Me.VERSION=jS.version;function $g(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o($g,"_classPrivateFieldLooseBase");var GS=0;function KS(i){return"__private_"+GS+++"_"+i}o(KS,"_classPrivateFieldLooseKey");var XS={version:"3.13.0"},Vg={isInputMode:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",currentSelection:[],searchTerm:null},YS={viewType:"grid",showTitles:!0,showFilter:!0,showBreadcrumbs:!0},ia=KS("updateFilesAndInputMode"),wr=class extends ks{static{o(this,"SearchProviderView")}constructor(e,t){super(e,{...YS,...t}),Object.defineProperty(this,ia,{value:QS}),this.nextPageQuery=null,this.search=this.search.bind(this),this.clearSearch=this.clearSearch.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.plugin.setPluginState(Vg),this.registerRequestClient()}tearDown(){}resetPluginState(){this.plugin.setPluginState(Vg)}async search(e){let{searchTerm:t}=this.plugin.getPluginState();if(!(e&&e===t)){this.setLoading(!0);try{let r=await this.provider.search(e);$g(this,ia)[ia](r,[])}catch(r){this.handleError(r)}finally{this.setLoading(!1)}}}clearSearch(){this.plugin.setPluginState({currentSelection:[],files:[],searchTerm:null})}async handleScroll(e){let t=this.nextPageQuery||null;if(this.shouldHandleScroll(e)&&t){this.isHandlingScroll=!0;try{let{files:r,searchTerm:s}=this.plugin.getPluginState(),n=await this.provider.search(s,t);$g(this,ia)[ia](n,r)}catch(r){this.handleError(r)}finally{this.isHandlingScroll=!1}}}donePicking(){let{currentSelection:e}=this.plugin.getPluginState();this.plugin.uppy.log("Adding remote search provider files"),this.plugin.uppy.addFiles(e.map(t=>this.getTagFile(t))),this.resetPluginState()}render(e,t){var r=this;t===void 0&&(t={});let{didFirstRender:s,isInputMode:n,searchTerm:a}=this.plugin.getPluginState(),{i18n:l}=this.plugin.uppy;s||this.preFirstRender();let u={...this.opts,...t},{files:h,folders:d,filterInput:f,loading:y,currentSelection:w}=this.plugin.getPluginState(),{isChecked:S,filterItems:T,recordShiftKeyPress:C}=this,_=f!=="",R={isChecked:S,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:C,currentSelection:w,files:_?T(h):h,folders:_?T(d):d,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,showSearchFilter:u.showFilter,search:this.search,clearSearch:this.clearSearch,searchTerm:a,searchOnInput:!1,searchInputLabel:l("search"),clearSearchLabel:l("resetSearch"),noResultsLabel:l("noSearchResults"),title:this.plugin.title,viewType:u.viewType,showTitles:u.showTitles,showFilter:u.showFilter,isLoading:y,showBreadcrumbs:u.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:l,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return r.plugin.uppy.validateRestrictions(...arguments)}};return n?c(br,{onUnmount:this.resetPluginState},c("div",{className:"uppy-SearchProvider"},c(Yn,{search:this.search,inputLabel:l("enterTextToSearch"),buttonLabel:l("searchImages"),inputClassName:"uppy-c-textInput uppy-SearchProvider-input",buttonCSSClassName:"uppy-SearchProvider-searchButton",showButton:!0}))):c(br,{onUnmount:this.resetPluginState},c(_u,R))}};function QS(i,e){this.nextPageQuery=i.nextPageQuery,i.items.forEach(t=>{e.push(t)}),this.plugin.setPluginState({currentSelection:[],isInputMode:!1,files:e,searchTerm:i.searchedFor})}o(QS,"_updateFilesAndInputMode2");wr.VERSION=XS.version;var Wg;function Xi(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Xi,"_classPrivateFieldLooseBase");var JS=0;function bh(i){return"__private_"+JS+++"_"+i}o(bh,"_classPrivateFieldLooseKey");var ZS={version:"3.0.7"},e2="uppy/STATE_UPDATE",t2=o(i=>e=>e.uppy[i],"defaultSelector");function i2(i,e){let t=Object.keys(e),r={};return t.forEach(s=>{i[s]!==e[s]&&(r[s]=e[s])}),r}o(i2,"getPatch");var Sr=bh("id"),ra=bh("selector"),Pr=bh("store");Wg=Symbol.for("uppy test: get id");var xu=class{static{o(this,"ReduxStore")}constructor(e){Object.defineProperty(this,Sr,{writable:!0,value:void 0}),Object.defineProperty(this,ra,{writable:!0,value:void 0}),Object.defineProperty(this,Pr,{writable:!0,value:void 0}),Xi(this,Pr)[Pr]=e.store,Xi(this,Sr)[Sr]=e.id||Xt(),Xi(this,ra)[ra]=e.selector||t2(Xi(this,Sr)[Sr]),this.setState({})}setState(e){Xi(this,Pr)[Pr].dispatch({type:e2,id:Xi(this,Sr)[Sr],payload:e})}getState(){return Xi(this,ra)[ra](Xi(this,Pr)[Pr].getState())}subscribe(e){let t=this.getState();return Xi(this,Pr)[Pr].subscribe(()=>{let r=this.getState();if(t!==r){let s=i2(t,r);e(t,r,s),t=r}})}[Wg](){return Xi(this,Sr)[Sr]}};xu.VERSION=ZS.version;var Gg=xu;function Fu(i,e,t,r){return t===0||i===e?i:r===0?e:i+(e-i)*2**(-r/t)}o(Fu,"emaFilter");var ui={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var Eh=be(li(),1);function sa(i){let e=[],t="indeterminate",r;for(let{progress:n}of Object.values(i)){let{preprocess:a,postprocess:l}=n;r==null&&(a||l)&&({mode:t,message:r}=a||l),a?.mode==="determinate"&&e.push(a.value),l?.mode==="determinate"&&e.push(l.value)}let s=e.reduce((n,a)=>n+a/e.length,0);return{mode:t,message:r,value:s}}o(sa,"calculateProcessingProgress");var _h=be(li(),1),Ph=be(_n(),1);function wh(i){let e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,r=Math.floor(i%60);return{hours:e,minutes:t,seconds:r}}o(wh,"secondsToTime");function Sh(i){let e=wh(i),t=e.hours===0?"":`${e.hours}h`,r=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,s=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${r}${s}`}o(Sh,"prettyETA");var r2="\xB7",Kg=o(()=>` ${r2} `,"renderDot");function Xg(i){let{newFiles:e,isUploadStarted:t,recoveredState:r,i18n:s,uploadState:n,isSomeGhost:a,startUpload:l}=i,u=(0,_h.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===ui.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),h=e&&t&&!r?s("uploadXNewFiles",{smart_count:e}):s("uploadXFiles",{smart_count:e});return c("button",{type:"button",className:u,"aria-label":s("uploadXFiles",{smart_count:e}),onClick:l,disabled:a,"data-uppy-super-focusable":!0},h)}o(Xg,"UploadBtn");function Yg(i){let{i18n:e,uppy:t}=i;return c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},c("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("retry"))}o(Yg,"RetryBtn");function Qg(i){let{i18n:e,uppy:t}=i;return c("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},c("g",{fill:"none",fillRule:"evenodd"},c("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),c("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"}))))}o(Qg,"CancelBtn");function Jg(i){let{isAllPaused:e,i18n:t,isAllComplete:r,resumableUploads:s,uppy:n}=i,a=t(e?"resume":"pause");function l(){if(!r){if(!s){n.cancelAll();return}if(e){n.resumeAll();return}n.pauseAll()}}return o(l,"togglePauseResume"),c("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:l,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},c("g",{fill:"none",fillRule:"evenodd"},c("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),c("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}o(Jg,"PauseResumeButton");function Zg(i){let{i18n:e,doneButtonHandler:t}=i;return c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}o(Zg,"DoneBtn");function ey(){return c("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},c("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"}))}o(ey,"LoadingSpinner");function ty(i){let{progress:e}=i,{value:t,mode:r,message:s}=e;return c("div",{className:"uppy-StatusBar-content"},c(ey,null),r==="determinate"?`${Math.round(t*100)}% \xB7 `:"",s)}o(ty,"ProgressBarProcessing");function s2(i){let{numUploads:e,complete:t,totalUploadedSize:r,totalSize:s,totalETA:n,i18n:a}=i,l=e>1;return c("div",{className:"uppy-StatusBar-statusSecondary"},l&&a("filesUploadedOfTotal",{complete:t,smart_count:e}),c("span",{className:"uppy-StatusBar-additionalInfo"},l&&Kg(),a("dataUploadedOfTotal",{complete:(0,Ph.default)(r),total:(0,Ph.default)(s)}),Kg(),a("xTimeLeft",{time:Sh(n)})))}o(s2,"ProgressDetails");function iy(i){let{i18n:e,complete:t,numUploads:r}=i;return c("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:r}))}o(iy,"FileUploadCount");function o2(i){let{i18n:e,newFiles:t,startUpload:r}=i,s=(0,_h.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return c("div",{className:"uppy-StatusBar-statusSecondary"},c("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),c("button",{type:"button",className:s,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:r},e("upload")))}o(o2,"UploadNewlyAddedFiles");function ry(i){let{i18n:e,supportsUploadProgress:t,totalProgress:r,showProgressDetails:s,isUploadStarted:n,isAllComplete:a,isAllPaused:l,newFiles:u,numUploads:h,complete:d,totalUploadedSize:f,totalSize:y,totalETA:w,startUpload:S}=i,T=u&&n;if(!n||a)return null;let C=e(l?"paused":"uploading");function _(){return!l&&!T&&s?t?c(s2,{numUploads:h,complete:d,totalUploadedSize:f,totalSize:y,totalETA:w,i18n:e}):c(iy,{i18n:e,complete:d,numUploads:h}):null}return o(_,"renderProgressDetails"),c("div",{className:"uppy-StatusBar-content","aria-label":C,title:C},l?null:c(ey,null),c("div",{className:"uppy-StatusBar-status"},c("div",{className:"uppy-StatusBar-statusPrimary"},t?`${C}: ${r}%`:C),_(),T?c(o2,{i18n:e,newFiles:u,startUpload:S}):null))}o(ry,"ProgressBarUploading");function sy(i){let{i18n:e}=i;return c("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},c("div",{className:"uppy-StatusBar-status"},c("div",{className:"uppy-StatusBar-statusPrimary"},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},c("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}o(sy,"ProgressBarComplete");function oy(i){let{error:e,i18n:t,complete:r,numUploads:s}=i;function n(){let a=`${t("uploadFailed")}
${e}`;alert(a)}return o(n,"displayErrorAlert"),c("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},c("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"})),c("div",{className:"uppy-StatusBar-status"},c("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),c("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:n,type:"button"},"?")),c(iy,{i18n:t,complete:r,numUploads:s})))}o(oy,"ProgressBarError");var{STATE_ERROR:ny,STATE_WAITING:ay,STATE_PREPROCESSING:xh,STATE_UPLOADING:Eu,STATE_POSTPROCESSING:Fh,STATE_COMPLETE:Ou}=ui;function Cu(i){let{newFiles:e,allowNewUpload:t,isUploadInProgress:r,isAllPaused:s,resumableUploads:n,error:a,hideUploadButton:l,hidePauseResumeButton:u,hideCancelButton:h,hideRetryButton:d,recoveredState:f,uploadState:y,totalProgress:w,files:S,supportsUploadProgress:T,hideAfterFinish:C,isSomeGhost:_,doneButtonHandler:R,isUploadStarted:q,i18n:W,startUpload:K,uppy:$,isAllComplete:G,showProgressDetails:te,numUploads:re,complete:Te,totalSize:Ke,totalETA:He,totalUploadedSize:we}=i;function Pe(){switch(y){case Fh:case xh:{let Q=sa(S);return Q.mode==="determinate"?Q.value*100:w}case ny:return null;case Eu:return T?w:null;default:return w}}o(Pe,"getProgressValue");function Ie(){switch(y){case Fh:case xh:{let{mode:Q}=sa(S);return Q==="indeterminate"}case Eu:return!T;default:return!1}}o(Ie,"getIsIndeterminate");function O(){if(f)return!1;switch(y){case ay:return l||e===0;case Ou:return C;default:return!1}}o(O,"getIsHidden");let P=Pe(),E=O(),L=P??100,z=!a&&e&&!r&&!s&&t&&!l,B=!h&&y!==ay&&y!==Ou,D=n&&!u&&y===Eu,A=a&&!G&&!d,k=R&&y===Ou,N=(0,Eh.default)("uppy-StatusBar-progress",{"is-indeterminate":Ie()}),Y=(0,Eh.default)("uppy-StatusBar",`is-${y}`,{"has-ghosts":_});return c("div",{className:Y,"aria-hidden":E},c("div",{className:N,style:{width:`${L}%`},role:"progressbar","aria-label":`${L}%`,"aria-valuetext":`${L}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":P}),(()=>{switch(y){case xh:case Fh:return c(ty,{progress:sa(S)});case Ou:return c(sy,{i18n:W});case ny:return c(oy,{error:a,i18n:W,numUploads:re,complete:Te});case Eu:return c(ry,{i18n:W,supportsUploadProgress:T,totalProgress:w,showProgressDetails:te,isUploadStarted:q,isAllComplete:G,isAllPaused:s,newFiles:e,numUploads:re,complete:Te,totalUploadedSize:we,totalSize:Ke,totalETA:He,startUpload:K});default:return null}})(),c("div",{className:"uppy-StatusBar-actions"},f||z?c(Xg,{newFiles:e,isUploadStarted:q,recoveredState:f,i18n:W,isSomeGhost:_,startUpload:K,uploadState:y}):null,A?c(Yg,{i18n:W,uppy:$}):null,D?c(Jg,{isAllPaused:s,i18n:W,isAllComplete:G,resumableUploads:n,uppy:$}):null,B?c(Qg,{i18n:W,uppy:$}):null,k?c(Zg,{i18n:W,doneButtonHandler:R}):null))}o(Cu,"StatusBar");Cu.defaultProps={doneButtonHandler:void 0,hideAfterFinish:!1,hideCancelButton:!1,hidePauseResumeButton:!1,hideRetryButton:!1,hideUploadButton:void 0,showProgressDetails:void 0};var ly={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",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"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Be(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Be,"_classPrivateFieldLooseBase");var n2=0;function jo(i){return"__private_"+n2+++"_"+i}o(jo,"_classPrivateFieldLooseKey");var a2={version:"3.3.3"},l2=2e3,u2=2e3;function c2(i,e,t,r){if(i)return ui.STATE_ERROR;if(e)return ui.STATE_COMPLETE;if(t)return ui.STATE_WAITING;let s=ui.STATE_WAITING,n=Object.keys(r);for(let a=0;a<n.length;a++){let{progress:l}=r[n[a]];if(l.uploadStarted&&!l.uploadComplete)return ui.STATE_UPLOADING;l.preprocess&&(s=ui.STATE_PREPROCESSING),l.postprocess&&s!==ui.STATE_PREPROCESSING&&(s=ui.STATE_POSTPROCESSING)}return s}o(c2,"getUploadingState");var h2={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},Fi=jo("lastUpdateTime"),Li=jo("previousUploadedBytes"),_r=jo("previousSpeed"),ci=jo("previousETA"),Oh=jo("computeSmoothETA"),oa=jo("onUploadStart"),xr=class extends ne{static{o(this,"StatusBar")}constructor(e,t){super(e,{...h2,...t}),Object.defineProperty(this,Oh,{value:d2}),Object.defineProperty(this,Fi,{writable:!0,value:void 0}),Object.defineProperty(this,Li,{writable:!0,value:void 0}),Object.defineProperty(this,_r,{writable:!0,value:void 0}),Object.defineProperty(this,ci,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,oa,{writable:!0,value:()=>{let{recoveredState:r}=this.uppy.getState();if(Be(this,_r)[_r]=null,Be(this,ci)[ci]=null,r){Be(this,Li)[Li]=Object.values(r.files).reduce((s,n)=>{let{progress:a}=n;return s+a.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Be(this,Fi)[Fi]=performance.now(),Be(this,Li)[Li]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=ly,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:t,files:r,allowNewUpload:s,totalProgress:n,error:a,recoveredState:l}=e,{newFiles:u,startedFiles:h,completeFiles:d,isUploadStarted:f,isAllComplete:y,isAllErrored:w,isAllPaused:S,isUploadInProgress:T,isSomeGhost:C}=this.uppy.getObjectOfFilesPerState(),_=l?Object.values(r):u,R=!!t.resumableUploads,q=t.uploadProgress!==!1,W=0,K=0;h.forEach(G=>{W+=G.progress.bytesTotal||0,K+=G.progress.bytesUploaded||0});let $=Be(this,Oh)[Oh]({uploaded:K,total:W,remaining:W-K});return Cu({error:a,uploadState:c2(a,y,l,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:W,totalUploadedSize:K,isAllComplete:!1,isAllPaused:S,isAllErrored:w,isUploadStarted:f,isUploadInProgress:T,isSomeGhost:C,recoveredState:l,complete:d.length,newFiles:_.length,numUploads:h.length,totalETA:$,files:r,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:R,supportsUploadProgress:q,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})}onMount(){let e=this.el;ou(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Be(this,oa)[oa]),Be(this,Fi)[Fi]=performance.now(),Be(this,Li)[Li]=this.uppy.getFiles().reduce((t,r)=>t+r.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Be(this,oa)[oa])}};function d2(i){var e,t;if(i.total===0||i.remaining===0)return 0;(t=(e=Be(this,Fi))[Fi])!=null||(e[Fi]=performance.now());let r=performance.now()-Be(this,Fi)[Fi];if(r===0){var s;return Math.round(((s=Be(this,ci)[ci])!=null?s:0)/100)/10}let n=i.uploaded-Be(this,Li)[Li];if(Be(this,Li)[Li]=i.uploaded,n<=0){var a;return Math.round(((a=Be(this,ci)[ci])!=null?a:0)/100)/10}let l=n/r,u=Be(this,_r)[_r]==null?l:Fu(l,Be(this,_r)[_r],l2,r);Be(this,_r)[_r]=u;let h=i.remaining/u,d=Math.max(Be(this,ci)[ci]-r,0),f=Be(this,ci)[ci]==null?h:Fu(h,d,u2,r);return Be(this,ci)[ci]=f,Be(this,Fi)[Fi]=performance.now(),Math.round(f/100)/10}o(d2,"_computeSmoothETA2");xr.VERSION=a2.version;var uy=300,na=class extends Ae{static{o(this,"FadeIn")}constructor(){super(...arguments),this.ref=Gm()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,uy)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,uy)}render(){let{children:e}=this.props;return c("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function p2(i,e){return Object.assign(i,e)}o(p2,"assign");function f2(i,e){var t;return(t=i?.key)!=null?t:e}o(f2,"getKey");function m2(i,e){let t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=r=>{i.refs[e]=r})}o(m2,"linkRef");function aa(i){let e={};for(let t=0;t<i.length;t++)if(i[t]!=null){let r=f2(i[t],t.toString(36));e[r]=i[t]}return e}o(aa,"getChildMapping");function g2(i,e){i=i||{},e=e||{};let t=o(a=>e.hasOwnProperty(a)?e[a]:i[a],"getValueForKey"),r={},s=[];for(let a in i)e.hasOwnProperty(a)?s.length&&(r[a]=s,s=[]):s.push(a);let n={};for(let a in e){if(r.hasOwnProperty(a))for(let l=0;l<r[a].length;l++){let u=r[a][l];n[r[a][l]]=t(u)}n[a]=t(a)}for(let a=0;a<s.length;a++)n[s[a]]=t(s[a]);return n}o(g2,"mergeChildMappings");var y2=o(i=>i,"identity"),Au=class extends Ae{static{o(this,"TransitionGroup")}constructor(e,t){super(e,t),this.refs={},this.state={children:aa(Pi(Pi(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let e=this.state.children;for(let t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){let t=aa(Pi(e.children)||[]),r=this.state.children;this.setState(n=>({children:g2(n.children,t)}));let s;for(s in t)if(t.hasOwnProperty(s)){let n=r&&r.hasOwnProperty(s);t[s]&&n&&this.currentlyTransitioningKeys[s]?(this.keysToEnter.push(s),this.keysToAbortLeave.push(s)):t[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToEnter.push(s)}for(s in r)if(r.hasOwnProperty(s)){let n=t&&t.hasOwnProperty(s);r[s]&&!n&&!this.currentlyTransitioningKeys[s]&&this.keysToLeave.push(s)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){let t=this.keysToAbortLeave.indexOf(e);t!==-1&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t!=null&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let t=this.refs[e];t!=null&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=aa(Pi(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t!=null&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let t=this.refs[e];t!=null&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let r=aa(Pi(this.props.children)||[]);(!r||!r.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;let r=this.refs[e];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;let r=this.refs[e];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let s=aa(Pi(this.props.children)||[]);if(s&&s.hasOwnProperty(e))this.performEnter(e);else{let n=p2({},this.state.children);delete n[e],this.setState({children:n})}}render(e,t){let{childFactory:r,transitionLeave:s,transitionName:n,transitionAppear:a,transitionEnter:l,transitionLeaveTimeout:u,transitionEnterTimeout:h,transitionAppearTimeout:d,component:f,...y}=e,{children:w}=t,S=Object.entries(w).map(T=>{let[C,_]=T;if(!_)return;let R=m2(this,C);return ru(r(_),{ref:R,key:C})}).filter(Boolean);return c(f,y,S)}};Au.defaultProps={component:"span",childFactory:y2};var cy=Au;var v2={version:"3.1.0"},Fr=class extends ne{static{o(this,"Informer")}constructor(e,t){super(e,t),this.render=r=>c("div",{className:"uppy uppy-Informer"},c(cy,null,r.info.map(s=>c(na,{key:s.message},c("p",{role:"alert"},s.message," ",s.details&&c("span",{"aria-label":s.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${s.message}
${s.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};Fr.VERSION=v2.version;var b2=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function w2(i,e,t){var r,s;let n=b2.exec(i),a=(r=(s=e.mimeType)!=null?s:n?.[1])!=null?r:"plain/text",l;if(n?.[2]!=null){let u=atob(decodeURIComponent(n[3])),h=new Uint8Array(u.length);for(let d=0;d<u.length;d++)h[d]=u.charCodeAt(d);l=[h]}else n?.[3]!=null&&(l=[decodeURIComponent(n[3])]);return t?new File(l,e.name||"",{type:a}):new Blob(l,{type:a})}o(w2,"dataURItoBlob");var hy=w2;function Tu(i){return i.startsWith("blob:")}o(Tu,"isObjectURL");function Ru(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}o(Ru,"isPreviewSupported");function Fe(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}o(Fe,"e");var wy=typeof self<"u"?self:global,ha=typeof navigator<"u",S2=ha&&typeof HTMLImageElement>"u",dy=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),Sy=wy.Buffer,Py=!!Sy,P2=o(i=>i!==void 0,"h");function _y(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(P2).length===0)}o(_y,"f");function bt(i){let e=new Error(i);throw delete e.stack,e}o(bt,"l");function py(i){let e=function(t){let r=0;return t.ifd0.enabled&&(r+=1024),t.exif.enabled&&(r+=2048),t.makerNote&&(r+=2048),t.userComment&&(r+=1024),t.gps.enabled&&(r+=512),t.interop.enabled&&(r+=100),t.ifd1.enabled&&(r+=1024),r+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}o(py,"o");var Ch=o(i=>String.fromCharCode.apply(null,i),"u"),fy=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,Is=class i{static{o(this,"c")}static from(e,t){return e instanceof this&&e.le===t?e:new i(e,void 0,void 0,t)}constructor(e,t=0,r,s){if(typeof s=="boolean"&&(this.le=s),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){r===void 0&&(r=e.byteLength-t);let n=new DataView(e,t,r);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof i){r===void 0&&(r=e.byteLength-t),(t+=e.byteOffset)+r>e.byteOffset+e.byteLength&&bt("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,r);this._swapDataView(n)}else if(typeof e=="number"){let n=new DataView(new ArrayBuffer(e));this._swapDataView(n)}else bt("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,r=i){return e instanceof DataView||e instanceof i?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||bt("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new r(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new i(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return s=this.getUint8Array(e,t),fy?fy.decode(s):Py?Buffer.from(s).toString("utf8"):decodeURIComponent(escape(Ch(s)));var s}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return Ch(r)}getUnicodeString(e=0,t=this.byteLength){let r=[];for(let s=0;s<t&&e+s<this.byteLength;s+=2)r.push(this.getUint16(e+s));return Ch(r)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64&&this.getUint64(e,r)}}getUint(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64&&this.getUint64(e,r)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function Th(i,e){bt(`${i} '${e}' was not loaded, try using full build of exifr.`)}o(Th,"p");var da=class extends Map{static{o(this,"g")}constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||Th(this.kind,e),t&&(e in t||function(r,s){bt(`Unknown ${r} '${s}'.`)}(this.kind,e),t[e].enabled||Th(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},Lu=new da("file parser"),hi=new da("segment parser"),ma=new da("file reader"),_2=wy.fetch;function my(i,e){return(t=i).startsWith("data:")||t.length>1e4?kh(i,e,"base64"):dy&&i.includes("://")?Rh(i,e,"url",ku):dy?kh(i,e,"fs"):ha?Rh(i,e,"url",ku):void bt("Invalid input argument");var t}o(my,"k");async function Rh(i,e,t,r){return ma.has(t)?kh(i,e,t):r?async function(s,n){let a=await n(s);return new Is(a)}(i,r):void bt(`Parser ${t} is not loaded`)}o(Rh,"O");async function kh(i,e,t){let r=new(ma.get(t))(i,e);return await r.read(),r}o(kh,"v");var ku=o(i=>_2(i).then(e=>e.arrayBuffer()),"S"),pa=o(i=>new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result||new ArrayBuffer),r.onerror=t,r.readAsArrayBuffer(i)}),"A"),Uh=class extends Map{static{o(this,"U")}get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}};function xy(i,e,t){let r=new Uh;for(let[s,n]of t)r.set(s,n);if(Array.isArray(e))for(let s of e)i.set(s,r);else i.set(e,r);return r}o(xy,"x");function Fy(i,e,t){let r,s=i.get(e);for(r of t)s.set(r[0],r[1])}o(Fy,"C");var ga=new Map,Mh=new Map,Bh=new Map,zo=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Nu=["jfif","xmp","icc","iptc","ihdr"],fa=["tiff",...Nu],ot=["ifd0","ifd1","exif","gps","interop"],Ho=[...fa,...ot],qo=["makerNote","userComment"],Mu=["translateKeys","translateValues","reviveValues","multiSegment"],$o=[...Mu,"sanitize","mergeOutput","silentErrors"],Uu=class{static{o(this,"_")}get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},Ds=class extends Uu{static{o(this,"D")}get needed(){return this.enabled||this.deps.size>0}constructor(e,t,r,s){if(super(),Fe(this,"enabled",!1),Fe(this,"skip",new Set),Fe(this,"pick",new Set),Fe(this,"deps",new Set),Fe(this,"translateKeys",!1),Fe(this,"translateValues",!1),Fe(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=ot.includes(e),this.canBeFiltered&&(this.dict=ga.get(e)),r!==void 0)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if(typeof r=="object"){if(this.enabled=!0,this.parse=r.parse!==!1,this.canBeFiltered){let{pick:n,skip:a}=r;n&&n.length>0&&this.translateTagSet(n,this.pick),a&&a.length>0&&this.translateTagSet(a,this.skip)}this.applyInheritables(r)}else r===!0||r===!1?this.parse=this.enabled=r:bt(`Invalid options argument: ${r}`)}applyInheritables(e){let t,r;for(t of Mu)r=e[t],r!==void 0&&(this[t]=r)}translateTagSet(e,t){if(this.dict){let r,s,{tagKeys:n,tagValues:a}=this.dict;for(r of e)typeof r=="string"?(s=a.indexOf(r),s===-1&&(s=n.indexOf(Number(r))),s!==-1&&t.add(Number(n[s]))):t.add(r)}else for(let r of e)t.add(r)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Du(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Du(this.pick,this.deps)}},Bt={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},gy=new Map,Ls=class extends Uu{static{o(this,"R")}static useCached(e){let t=gy.get(e);return t!==void 0||(t=new this(e),gy.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):bt(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=ha?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of zo)this[e]=Bt[e];for(e of $o)this[e]=Bt[e];for(e of qo)this[e]=Bt[e];for(e of Ho)this[e]=new Ds(e,Bt[e],void 0,this)}setupFromTrue(){let e;for(e of zo)this[e]=Bt[e];for(e of $o)this[e]=Bt[e];for(e of qo)this[e]=!0;for(e of Ho)this[e]=new Ds(e,!0,void 0,this)}setupFromArray(e){let t;for(t of zo)this[t]=Bt[t];for(t of $o)this[t]=Bt[t];for(t of qo)this[t]=Bt[t];for(t of Ho)this[t]=new Ds(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,ot)}setupFromObject(e){let t;for(t of(ot.ifd0=ot.ifd0||ot.image,ot.ifd1=ot.ifd1||ot.thumbnail,Object.assign(this,e),zo))this[t]=Ah(e[t],Bt[t]);for(t of $o)this[t]=Ah(e[t],Bt[t]);for(t of qo)this[t]=Ah(e[t],Bt[t]);for(t of fa)this[t]=new Ds(t,Bt[t],e[t],this);for(t of ot)this[t]=new Ds(t,Bt[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,ot,Ho),e.tiff===!0?this.batchEnableWithBool(ot,!0):e.tiff===!1?this.batchEnableWithUserValue(ot,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,ot):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,ot)}batchEnableWithBool(e,t){for(let r of e)this[r].enabled=t}batchEnableWithUserValue(e,t){for(let r of e){let s=t[r];this[r].enabled=s!==!1&&s!==void 0}}setupGlobalFilters(e,t,r,s=r){if(e&&e.length){for(let a of s)this[a].enabled=!1;let n=yy(e,r);for(let[a,l]of n)Du(this[a].pick,l),this[a].enabled=!0}else if(t&&t.length){let n=yy(t,r);for(let[a,l]of n)Du(this[a].skip,l)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:r,iptc:s,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),r.enabled||e.skip.add(700),s.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:r,interop:s}=this;s.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),r.needed&&e.deps.add(34853),this.tiff.enabled=ot.some(n=>this[n].enabled===!0)||this.makerNote||this.userComment;for(let n of ot)this[n].finalizeFilters()}get onlyTiff(){return!Nu.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of fa)this[e].enabled&&!hi.has(e)&&Th("segment parser",e)}};function yy(i,e){let t,r,s,n,a=[];for(s of e){for(n of(t=ga.get(s),r=[],t))(i.includes(n[0])||i.includes(n[1]))&&r.push(n[0]);r.length&&a.push([s,r])}return a}o(yy,"K");function Ah(i,e){return i!==void 0?i:e!==void 0?e:void 0}o(Ah,"W");function Du(i,e){for(let t of e)i.add(t)}o(Du,"X");Fe(Ls,"default",Bt);var Vo=class{static{o(this,"H")}constructor(e){Fe(this,"parsers",{}),Fe(this,"output",{}),Fe(this,"errors",[]),Fe(this,"pushToErrors",t=>this.errors.push(t)),this.options=Ls.useCached(e)}async read(e){this.file=await function(t,r){return typeof t=="string"?my(t,r):ha&&!S2&&t instanceof HTMLImageElement?my(t.src,r):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Is(t):ha&&t instanceof Blob?Rh(t,r,"blob",pa):void bt("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[r,s]of Lu)if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[r]=!0;this.file.close&&this.file.close(),bt("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),_y(r=e)?void 0:r;var r}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async r=>{let s=await r.parse();r.assignToOutput(e,s)});this.options.silentErrors&&(t=t.map(r=>r.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,r=hi.get("tiff",e);var s;if(t.tiff?s={start:0,type:"tiff"}:t.jpeg&&(s=await this.fileParser.getOrFindSegment("tiff")),s===void 0)return;let n=await this.fileParser.ensureSegmentChunk(s),a=this.parsers.tiff=new r(n,e,t),l=await a.extractThumbnail();return t.close&&t.close(),l}};async function Ey(i,e){let t=new Vo(e);return await t.read(i),t.parse()}o(Ey,"Y");var x2=Object.freeze({__proto__:null,parse:Ey,Exifr:Vo,fileParsers:Lu,segmentParsers:hi,fileReaders:ma,tagKeys:ga,tagValues:Mh,tagRevivers:Bh,createDictionary:xy,extendDictionary:Fy,fetchUrlAsArrayBuffer:ku,readBlobAsArrayBuffer:pa,chunkedProps:zo,otherSegments:Nu,segments:fa,tiffBlocks:ot,segmentsAndBlocks:Ho,tiffExtractables:qo,inheritables:Mu,allFormatters:$o,Options:Ls}),ss=class{static{o(this,"J")}static findPosition(e,t){let r=e.getUint16(t+2)+2,s=typeof this.headerLength=="function"?this.headerLength(e,t,r):this.headerLength,n=t+s,a=r-s;return{offset:t,length:r,headerLength:s,start:n,size:a,end:n+a}}static parse(e,t={}){return new this(e,new Ls({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Is?e:new Is(e)}constructor(e,t={},r){Fe(this,"errors",[]),Fe(this,"raw",new Map),Fe(this,"handleError",s=>{if(!this.options.silentErrors)throw s;this.errors.push(s.message)}),this.chunk=this.normalizeInput(e),this.file=r,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let r=Bh.get(t),s=Mh.get(t),n=ga.get(t),a=this.options[t],l=a.reviveValues&&!!r,u=a.translateValues&&!!s,h=a.translateKeys&&!!n,d={};for(let[f,y]of e)l&&r.has(f)?y=r.get(f)(y):u&&s.has(f)&&(y=this.translateValue(y,s.get(f))),h&&n.has(f)&&(f=n.get(f)||f),d[f]=y;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,r){if(this.globalOptions.mergeOutput)return Object.assign(e,r);e[t]?Object.assign(e[t],r):e[t]=r}};Fe(ss,"headerLength",4),Fe(ss,"type",void 0),Fe(ss,"multiSegment",!1),Fe(ss,"canHandle",()=>!1);function F2(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}o(F2,"q");function E2(i){return i>=224&&i<=239}o(E2,"Q");function O2(i,e,t){for(let[r,s]of hi)if(s.canHandle(i,e,t))return r}o(O2,"Z");var Iu=class extends class{constructor(e,t,r){Fe(this,"errors",[]),Fe(this,"ensureSegmentChunk",async s=>{let n=s.start,a=s.size||65536;if(this.file.chunked)if(this.file.available(n,a))s.chunk=this.file.subarray(n,a);else try{s.chunk=await this.file.readChunk(n,a)}catch(l){bt(`Couldn't read segment: ${JSON.stringify(s)}. ${l.message}`)}else this.file.byteLength>n+a?s.chunk=this.file.subarray(n,a):s.size===void 0?s.chunk=this.file.subarray(n):bt("Segment unreachable: "+JSON.stringify(s));return s.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let r=new(hi.get(e))(t,this.options,this.file);return this.parsers[e]=r}createParsers(e){for(let t of e){let{type:r,chunk:s}=t,n=this.options[r];if(n&&n.enabled){let a=this.parsers[r];a&&a.append||a||this.createParser(r,s)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{static{o(this,"ee")}constructor(...e){super(...e),Fe(this,"appSegments",[]),Fe(this,"jpegSegments",[]),Fe(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(hi.keyList())):(e=e===void 0?hi.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&hi.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:r,findAll:s,wanted:n,remaining:a}=this;if(!s&&this.file.chunked&&(s=Array.from(n).some(l=>{let u=hi.get(l),h=this.options[l];return u.multiSegment&&h.multiSegment}),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,r.byteLength),!this.options.onlyTiff&&r.chunked){let l=!1;for(;a.size>0&&!l&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:u}=r,h=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(l=e>u&&!h?!await r.readNextChunk(e):!await r.readNextChunk(u),(e=this.findAppSegmentsInRange(e,r.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let r,s,n,a,l,u,{file:h,findAll:d,wanted:f,remaining:y,options:w}=this;for(;e<t;e++)if(h.getUint8(e)===255){if(r=h.getUint8(e+1),E2(r)){if(s=h.getUint16(e+2),n=O2(h,e,s),n&&f.has(n)&&(a=hi.get(n),l=a.findPosition(h,e),u=w[n],l.type=n,this.appSegments.push(l),!d&&(a.multiSegment&&u.multiSegment?(this.unfinishedMultiSegment=l.chunkNumber<l.chunkCount,this.unfinishedMultiSegment||y.delete(n)):y.delete(n),y.size===0)))break;w.recordUnknownSegments&&(l=ss.findPosition(h,e),l.marker=r,this.unknownSegments.push(l)),e+=s+1}else if(F2(r)){if(s=h.getUint16(e+2),r===218&&w.stopAfterSos!==!1)return;w.recordJpegSegments&&this.jpegSegments.push({offset:e,length:s,marker:r}),e+=s+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,r){let s,n,a,l=new Map;for(let u=0;u<t.length;u++)s=t[u],n=s[r],l.has(n)?a=l.get(n):l.set(n,a=[]),a.push(s);return Array.from(l)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,r])=>{let s=hi.get(t,this.options);return s.handleMultiSegments?{type:t,chunk:s.handleMultiSegments(r)}:r[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}};Fe(Iu,"type","jpeg"),Lu.set("jpeg",Iu);var C2=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Dh=class extends ss{static{o(this,"se")}parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,r=new Map){let{pick:s,skip:n}=this.options[t];s=new Set(s);let a=s.size>0,l=n.size===0,u=this.chunk.getUint16(e);e+=2;for(let h=0;h<u;h++){let d=this.chunk.getUint16(e);if(a){if(s.has(d)&&(r.set(d,this.parseTag(e,d,t)),s.delete(d),s.size===0))break}else!l&&n.has(d)||r.set(d,this.parseTag(e,d,t));e+=12}return r}parseTag(e,t,r){let{chunk:s}=this,n=s.getUint16(e+2),a=s.getUint32(e+4),l=C2[n];if(l*a<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&bt(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&bt(`Invalid TIFF value offset. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),n===1)return s.getUint8Array(e,a);if(n===2)return(u=function(h){for(;h.endsWith("\0");)h=h.slice(0,-1);return h}(u=s.getString(e,a)).trim())===""?void 0:u;var u;if(n===7)return s.getUint8Array(e,a);if(a===1)return this.parseTagValue(n,e);{let h=new(function(f){switch(f){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}}(n))(a),d=l;for(let f=0;f<a;f++)h[f]=this.parseTagValue(n,e),e+=d;return h}}parseTagValue(e,t){let{chunk:r}=this;switch(e){case 1:return r.getUint8(t);case 3:return r.getUint16(t);case 4:return r.getUint32(t);case 5:return r.getUint32(t)/r.getUint32(t+4);case 6:return r.getInt8(t);case 8:return r.getInt16(t);case 9:return r.getInt32(t);case 10:return r.getInt32(t)/r.getInt32(t+4);case 11:return r.getFloat(t);case 12:return r.getDouble(t);case 13:return r.getUint32(t);default:bt(`Invalid tiff type ${e}`)}}},ca=class extends Dh{static{o(this,"ie")}static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let r=new Map;return this[t]=r,this.parseTags(e,t,r),r}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&bt("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&bt(`IFD0 offset points to outside of file.
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,py(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,py(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let r=e.get(t);r&&r.length===1&&e.set(t,r[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",vy(...e.get(2),e.get(1))),e.set("longitude",vy(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,r,s={};for(t of ot)if(e=this[t],!_y(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(s,r)}else s[t]=r;return this.makerNote&&(s.makerNote=this.makerNote),this.userComment&&(s.userComment=this.userComment),s}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[r,s]of Object.entries(t))this.assignObjectToOutput(e,r,s)}};function vy(i,e,t,r){var s=i+e/60+t/3600;return r!=="S"&&r!=="W"||(s*=-1),s}o(vy,"ne");Fe(ca,"type","tiff"),Fe(ca,"headerLength",10),hi.set("tiff",ca);var s4=Object.freeze({__proto__:null,default:x2,Exifr:Vo,fileParsers:Lu,segmentParsers:hi,fileReaders:ma,tagKeys:ga,tagValues:Mh,tagRevivers:Bh,createDictionary:xy,extendDictionary:Fy,fetchUrlAsArrayBuffer:ku,readBlobAsArrayBuffer:pa,chunkedProps:zo,otherSegments:Nu,segments:fa,tiffBlocks:ot,segmentsAndBlocks:Ho,tiffExtractables:qo,inheritables:Mu,allFormatters:$o,Options:Ls,parse:Ey}),jh={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},o4=Object.assign({},jh,{firstChunkSize:4e4,gps:[1,2,3,4]});var n4=Object.assign({},jh,{tiff:!1,ifd1:!0,mergeOutput:!1});var A2=Object.assign({},jh,{firstChunkSize:4e4,ifd0:[274]});async function T2(i){let e=new Vo(A2);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}o(T2,"ce");var R2=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}}),la=!0,ua=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,r]=e;la=Number(t)+.1*Number(r)<13.4,ua=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);la=ua=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);la=ua=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);la=ua=Number(e)<77}}async function Oy(i){let e=await T2(i);return Object.assign({canvas:la,css:ua},R2[e])}o(Oy,"ye");var Ih=class extends Is{static{o(this,"be")}constructor(...e){super(...e),Fe(this,"ranges",new Lh),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let s=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(s)}else{let s=e+t;if(s>this.byteLength){let{dataView:n}=this._extend(s);this._swapDataView(n)}}}_extend(e){let t;t=Py?Sy.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&this._tryExtend(t,e.byteLength,e);let s=super.set(e,t);return this.ranges.add(t,s.byteLength),s}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}},Lh=class{static{o(this,"we")}constructor(){Fe(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let s=e+t,n=this.list.filter(a=>by(e,a.offset,s)||by(e,a.end,s));if(n.length>0){e=Math.min(e,...n.map(l=>l.offset)),s=Math.max(s,...n.map(l=>l.end)),t=s-e;let a=n.shift();a.offset=e,a.length=t,a.end=s,this.list=this.list.filter(l=>!n.includes(l))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let r=e+t;return this.list.some(s=>s.offset<=e&&r<=s.end)}};function by(i,e,t){return i<=e&&e<=t}o(by,"ke");var Nh=class extends Ih{static{o(this,"Oe")}constructor(e,t){super(0),Fe(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,r=await this.readChunk(e,t);return!!r&&r.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};ma.set("blob",class extends Nh{async readWhole(){this.chunked=!1;let i=await pa(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(i,e){let t=e?i+e:void 0,r=this.input.slice(i,t),s=await pa(r);return this.set(s,i,!0)}});var Cy={strings:{generatingThumbnails:"Generating thumbnails..."}};var k2={version:"3.1.0"};function U2(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(r){if(r.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(r=>{i.toBlob(r,e,t)}).then(r=>{if(r===null)throw new Error("cannot read image, probably an svg with external resources");return r}):Promise.resolve().then(()=>hy(i.toDataURL(e,t),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}o(U2,"canvasToBlob");function D2(i,e){let t=i.width,r=i.height;(e.deg===90||e.deg===270)&&(t=i.height,r=i.width);let s=document.createElement("canvas");s.width=t,s.height=r;let n=s.getContext("2d");return n.translate(t/2,r/2),e.canvas&&(n.rotate(e.rad),n.scale(e.scaleX,e.scaleY)),n.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),s}o(D2,"rotateImage");function I2(i){let e=i.width/i.height,t=5e6,r=4096,s=Math.floor(Math.sqrt(t*e)),n=Math.floor(t/Math.sqrt(t*e));if(s>r&&(s=r,n=Math.round(s/e)),n>r&&(n=r,s=Math.round(e*n)),i.width>s){let a=document.createElement("canvas");return a.width=s,a.height=n,a.getContext("2d").drawImage(i,0,0,s,n),a}return i}o(I2,"protect");var L2={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},os=class extends ne{static{o(this,"ThumbnailGenerator")}constructor(e,t){if(super(e,{...L2,...t}),this.onFileAdded=r=>{!r.preview&&r.data&&Ru(r.type)&&!r.isRemote&&this.addToQueue(r.id)},this.onCancelRequest=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1)},this.onFileRemoved=r=>{let s=this.queue.indexOf(r.id);s!==-1&&this.queue.splice(s,1),r.preview&&Tu(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(s=>s.isRestored).forEach(s=>{(!s.preview||Tu(s.preview))&&this.addToQueue(s.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=r=>{r.forEach(n=>{let a=this.uppy.getFile(n);this.uppy.emit("preprocess-progress",a,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let s=o(()=>{r.forEach(n=>{let a=this.uppy.getFile(n);this.uppy.emit("preprocess-complete",a)})},"emitPreprocessCompleteForAll");return new Promise(n=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{s(),n()}):(s(),n())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=Cy,this.i18nInit(),this.opts.lazy&&this.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`.")}createThumbnail(e,t,r){let s=URL.createObjectURL(e.data),n=new Promise((l,u)=>{let h=new Image;h.src=s,h.addEventListener("load",()=>{URL.revokeObjectURL(s),l(h)}),h.addEventListener("error",d=>{URL.revokeObjectURL(s),u(d.error||new Error("Could not create thumbnail"))})}),a=Oy(e.data).catch(()=>1);return Promise.all([n,a]).then(l=>{let[u,h]=l,d=this.getProportionalDimensions(u,t,r,h.deg),f=D2(u,h),y=this.resizeImage(f,d.width,d.height);return U2(y,this.thumbnailType,80)}).then(l=>URL.createObjectURL(l))}getProportionalDimensions(e,t,r,s){let n=e.width/e.height;return(s===90||s===270)&&(n=e.height/e.width),t!=null?{width:t,height:Math.round(t/n)}:r!=null?{width:Math.round(r*n),height:r}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,r){let s=I2(e),n=Math.ceil(Math.log2(s.width/t));n<1&&(n=1);let a=t*2**(n-1),l=r*2**(n-1),u=2;for(;n--;){let h=document.createElement("canvas");h.width=a,h.height=l,h.getContext("2d").drawImage(s,0,0,a,l),s=h,a=Math.round(a/u),l=Math.round(l/u)}return s}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(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"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return Ru(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};os.VERSION=k2.version;function N2(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&Dn(i)?[i]:null}o(N2,"findAllDOMElements");var zh=N2;var nt=Array.from;function Bu(i,e,t,r){let{onSuccess:s}=r;i.readEntries(n=>{let a=[...e,...n];n.length?queueMicrotask(()=>{Bu(i,a,t,{onSuccess:s})}):s(a)},n=>{t(n),s(e)})}o(Bu,"getFilesAndDirectoriesFromDirectory");function Ay(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,r)=>i.file(t,r))},async*values(){let t=i.createReader();yield*await new Promise(s=>{Bu(t,[],e,{onSuccess:n=>s(n.map(a=>Ay(a,e)))})})},isSameEntry:void 0}}o(Ay,"getAsFileSystemHandleFromEntry");function Ty(i,e,t){try{return t===void 0&&(t=void 0),async function*(){let r=o(()=>`${e}/${i.name}`,"getNextRelativePath");if(i.kind==="file"){let s=await i.getFile();s!=null?(s.relativePath=e?r():null,yield s):t!=null&&(yield t)}else if(i.kind==="directory")for await(let s of i.values())yield*Ty(s,e?r():i.name);else t!=null&&(yield t)}()}catch(r){return Promise.reject(r)}}o(Ty,"createPromiseToAddFileOrParseDirectory");async function*Hh(i,e){let t=await Promise.all(Array.from(i.items,async r=>{var s;let n,a=o(()=>typeof r.getAsEntry=="function"?r.getAsEntry():r.webkitGetAsEntry(),"getAsEntry");return(s=n)!=null||(n=Ay(a(),e)),{fileSystemHandle:n,lastResortFile:r.getAsFile()}}));for(let{lastResortFile:r,fileSystemHandle:s}of t)if(s!=null)try{yield*Ty(s,"",r)}catch(n){r!=null?yield r:e(n)}else r!=null&&(yield r)}o(Hh,"getFilesFromDataTransfer");function qh(i){let e=nt(i.files);return Promise.resolve(e)}o(qh,"fallbackApi");async function Ns(i,e){var t;let r=(t=e?.logDropError)!=null?t:Function.prototype;try{let s=[];for await(let n of Hh(i,r))s.push(n);return s}catch{return qh(i)}}o(Ns,"getDroppedFiles");var Ry=Number.isNaN||o(function(e){return typeof e=="number"&&e!==e},"ponyfill");function M2(i,e){return!!(i===e||Ry(i)&&Ry(e))}o(M2,"isEqual");function B2(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!M2(i[t],e[t]))return!1;return!0}o(B2,"areInputsEqual");function $h(i,e){e===void 0&&(e=B2);var t=null;function r(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];if(t&&t.lastThis===this&&e(s,t.lastArgs))return t.lastResult;var a=i.apply(this,s);return t={lastResult:a,lastArgs:s,lastThis:this},a}return o(r,"memoized"),r.clear=o(function(){t=null},"clear"),r}o($h,"memoizeOne");var ju=['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 ya(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}o(ya,"getActiveOverlayEl");function ky(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}o(ky,"focusOnFirstNode");function j2(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}o(j2,"focusOnLastNode");function z2(i){return i.contains(document.activeElement)}o(z2,"isFocusInOverlay");function Vh(i,e,t){let r=ya(t,e),s=nt(r.querySelectorAll(ju)),n=s.indexOf(document.activeElement);z2(r)?i.shiftKey&&n===0?j2(i,s):!i.shiftKey&&n===s.length-1&&ky(i,s):ky(i,s)}o(Vh,"trapFocus");function Uy(i,e,t){e===null||Vh(i,e,t)}o(Uy,"forInline");var Dy=be(_c(),1);function Wh(){let i=!1;return(0,Dy.default)(o((t,r)=>{let s=ya(t,r),n=s.contains(document.activeElement);if(n&&i)return;let a=s.querySelector("[data-uppy-super-focusable]");if(!(n&&!a))if(a)a.focus({preventScroll:!0}),i=!0;else{let l=s.querySelector(ju);l?.focus({preventScroll:!0}),i=!1}},"superFocus"),260)}o(Wh,"createSuperFocus");var tv=be(li(),1);function va(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}o(va,"isDragDropSupported");var By=be(li(),1),jy=be(Ly(),1);function q2(){return c("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},c("g",{fill:"#686DE0",fillRule:"evenodd"},c("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"}),c("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"}),c("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}o(q2,"iconImage");function $2(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},c("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"}))}o($2,"iconAudio");function V2(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},c("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"}))}o(V2,"iconVideo");function W2(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},c("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"}))}o(W2,"iconPDF");function G2(){return c("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},c("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"}))}o(G2,"iconArchive");function K2(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},c("g",{fill:"#A7AFB7",fillRule:"nonzero"},c("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"}),c("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}o(K2,"iconFile");function X2(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},c("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"}))}o(X2,"iconText");function Ms(i){let e={color:"#838999",icon:K2()};if(!i)return e;let t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:X2()}:t==="image"?{color:"#686de0",icon:q2()}:t==="audio"?{color:"#068dbb",icon:$2()}:t==="video"?{color:"#19af67",icon:V2()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:W2()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:G2()}:e}o(Ms,"getIconByMime");function ba(i){let{file:e}=i;if(e.preview)return c("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:r}=Ms(e.type);return c("div",{className:"uppy-Dashboard-Item-previewIconWrap"},c("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},r),c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},c("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}o(ba,"FilePreview");var Y2=o((i,e)=>(typeof e=="function"?e():e).filter(s=>s.id===i)[0].name,"metaFieldIdToName");function wa(i){let{file:e,toggleFileCard:t,i18n:r,metaFields:s}=i,{missingRequiredMetaFields:n}=e;if(!(n!=null&&n.length))return null;let a=n.map(l=>Y2(l,s)).join(", ");return c("div",{className:"uppy-Dashboard-Item-errorMessage"},r("missingRequiredMetaFields",{smart_count:n.length,fields:a})," ",c("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},r("editFile")))}o(wa,"MetaErrorMessage");function Gh(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=i,l=e.preview?"rgba(255, 255, 255, 0.5)":Ms(e.type).color;return c("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:l}},n&&e.uploadURL&&c("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},c("span",{hidden:!0},e.meta.name)),c(ba,{file:e}),c(wa,{file:e,i18n:t,toggleFileCard:r,metaFields:s}))}o(Gh,"FilePreviewAndLink");function Q2(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}o(Q2,"onPauseResumeCancelRetry");function Ny(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}o(Ny,"progressIndicatorTitle");function Kh(i){return c("div",{className:"uppy-Dashboard-Item-progress"},c("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":Ny(i),title:Ny(i),onClick:()=>Q2(i)},i.children))}o(Kh,"ProgressIndicatorButton");function zu(i){let{children:e}=i;return c("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}o(zu,"ProgressCircleContainer");function Xh(i){let{progress:e}=i,t=2*Math.PI*15;return c("g",null,c("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),c("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":t,"stroke-dashoffset":t-t/100*e}))}o(Xh,"ProgressCircle");function Yh(i){if(!i.file.progress.uploadStarted)return null;if(i.isUploaded)return c("div",{className:"uppy-Dashboard-Item-progress"},c("div",{className:"uppy-Dashboard-Item-progressIndicator"},c(zu,null,c("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),c("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"}))));if(!i.recoveredState)return i.error&&!i.hideRetryButton?c(Kh,i,c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},c("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),c("path",{d:"M7.9 3H10v2H7.9z"}),c("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),c("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?c(Kh,i,c(zu,null,c(Xh,{progress:i.file.progress.percentage}),i.file.isPaused?c("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):c("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},c("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),c("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?c(Kh,i,c(zu,null,c(Xh,{progress:i.file.progress.percentage}),c("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"}))):c("div",{className:"uppy-Dashboard-Item-progress"},c("div",{className:"uppy-Dashboard-Item-progressIndicator"},c(zu,null,c(Xh,{progress:i.file.progress.percentage}))))}o(Yh,"FileProgress");var My=be(_n(),1);var Qh="...";function Hu(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=Qh.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-Qh.length,r=Math.ceil(t/2),s=Math.floor(t/2);return i.slice(0,r)+Qh+i.slice(-s)}o(Hu,"truncateString");var J2=o(i=>{let{author:e,name:t}=i.file.meta;function r(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return o(r,"getMaxNameLength"),c("div",{className:"uppy-Dashboard-Item-name",title:t},Hu(t,r()))},"renderFileName"),Z2=o(i=>{var e;let{author:t}=i.file.meta,r=(e=i.file.remote)==null?void 0:e.providerName,s="\xB7";return t?c("div",{className:"uppy-Dashboard-Item-author"},c("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Hu(t.name,13)),r?c(vt,null,` ${s} `,r,` ${s} `):null):null},"renderAuthor"),eP=o(i=>i.file.size&&c("div",{className:"uppy-Dashboard-Item-statusSize"},(0,My.default)(i.file.size)),"renderFileSize"),tP=o(i=>i.file.isGhost&&c("span",null," \u2022 ",c("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:i.toggleAddFilesPanel},i.i18n("reSelect"))),"ReSelectButton"),iP=o(i=>{let{file:e,onClick:t}=i;return e.error?c("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null},"ErrorButton");function Jh(i){let{file:e}=i;return c("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},c("div",{className:"uppy-Dashboard-Item-fileName"},J2(i),c(iP,{file:i.file,onClick:()=>alert(i.file.error)})),c("div",{className:"uppy-Dashboard-Item-status"},Z2(i),eP(i),tP(i)),c(wa,{file:i.file,i18n:i.i18n,toggleFileCard:i.toggleFileCard,metaFields:i.metaFields}))}o(Jh,"FileInfo");function Zh(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=i,document.body.appendChild(r),r.select();let s=o(()=>{document.body.removeChild(r),window.prompt(e,i),t()},"magicCopyFailed");try{return document.execCommand("copy")?(document.body.removeChild(r),t()):s()}catch{return document.body.removeChild(r),s()}})}o(Zh,"copyToClipboard");function rP(i){let{file:e,uploadInProgressOrComplete:t,metaFields:r,canEditFile:s,i18n:n,onClick:a}=i;return!t&&r&&r.length>0||!t&&s(e)?c("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":n("editFileWithFilename",{file:e.meta.name}),title:n("editFileWithFilename",{file:e.meta.name}),onClick:()=>a()},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},c("g",{fillRule:"evenodd"},c("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"}),c("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),c("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}o(rP,"EditButton");function sP(i){let{i18n:e,onClick:t,file:r}=i;return c("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:r.meta.name}),title:e("removeFile",{file:r.meta.name}),onClick:()=>t()},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},c("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"}),c("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"})))}o(sP,"RemoveButton");var oP=o((i,e)=>{Zh(e.file.uploadURL,e.i18n("copyLinkToClipboardFallback")).then(()=>{e.uppy.log("Link copied to clipboard."),e.uppy.info(e.i18n("copyLinkToClipboardSuccess"),"info",3e3)}).catch(e.uppy.log).then(()=>i.target.focus({preventScroll:!0}))},"copyLinkToClipboard");function nP(i){let{i18n:e}=i;return c("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":e("copyLink"),title:e("copyLink"),onClick:t=>oP(t,i)},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},c("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"})))}o(nP,"CopyLinkButton");function ed(i){let{uppy:e,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,showLinkToFileUploadResult:a,showRemoveButton:l,i18n:u,toggleFileCard:h,openFileEditor:d}=i;return c("div",{className:"uppy-Dashboard-Item-actionWrapper"},c(rP,{i18n:u,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,onClick:o(()=>{n&&n.length>0?h(!0,t.id):d(t)},"editAction")}),a&&t.uploadURL?c(nP,{file:t,uppy:e,i18n:u}):null,l?c(sP,{i18n:u,file:t,uppy:e,onClick:()=>e.removeFile(t.id,"removed-by-user")}):null)}o(ed,"Buttons");var Sa=class extends Ae{static{o(this,"FileItem")}componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!(0,jy.default)(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,r=e.progress.uploadComplete&&!t&&!e.error,s=e.progress.uploadStarted||t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,a=e.error||!1,{isGhost:l}=e,u=(this.props.individualCancellation||!n)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(u=!0);let h=(0,By.default)({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!a,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":l});return c("div",{className:h,id:`uppy_${e.id}`,role:this.props.role},c("div",{className:"uppy-Dashboard-Item-preview"},c(Gh,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),c(Yh,{uppy:this.props.uppy,file:e,error:a,isUploaded:r,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,showRemoveButtonAfterComplete:this.props.showRemoveButtonAfterComplete,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),c("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},c(Jh,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),c(ed,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:u,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function aP(i,e){let t=[],r=[];return i.forEach(s=>{r.length<e?r.push(s):(t.push(r),r=[s])}),r.length&&t.push(r),t}o(aP,"chunks");function td(i){let{id:e,error:t,i18n:r,uppy:s,files:n,acquirers:a,resumableUploads:l,hideRetryButton:u,hidePauseResumeButton:h,hideCancelButton:d,showLinkToFileUploadResult:f,showRemoveButtonAfterComplete:y,isWide:w,metaFields:S,isSingleFile:T,toggleFileCard:C,handleRequestThumbnail:_,handleCancelThumbnail:R,recoveredState:q,individualCancellation:W,itemsPerRow:K,openFileEditor:$,canEditFile:G,toggleAddFilesPanel:te,containerWidth:re,containerHeight:Te}=i,Ke=K===1?71:200,He=Mo(()=>{let Pe=o((O,P)=>n[P].isGhost-n[O].isGhost,"sortByGhostComesFirst"),Ie=Object.keys(n);return q&&Ie.sort(Pe),aP(Ie,K)},[n,K,q]),we=o(Pe=>c("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:Pe[0]},Pe.map(Ie=>c(Sa,{key:Ie,uppy:s,id:e,error:t,i18n:r,acquirers:a,resumableUploads:l,individualCancellation:W,hideRetryButton:u,hidePauseResumeButton:h,hideCancelButton:d,showLinkToFileUploadResult:f,showRemoveButtonAfterComplete:y,isWide:w,metaFields:S,recoveredState:q,isSingleFile:T,containerWidth:re,containerHeight:Te,toggleFileCard:C,handleRequestThumbnail:_,handleCancelThumbnail:R,role:"listitem",openFileEditor:$,canEditFile:G,toggleAddFilesPanel:te,file:n[Ie]}))),"renderRow");return T?c("div",{class:"uppy-Dashboard-files"},we(He[0])):c(Su,{class:"uppy-Dashboard-files",role:"list",data:He,renderRow:we,rowHeight:Ke})}o(td,"FileList");var zy;zy=Symbol.for("uppy test: disable unused locale key warning");var id=class extends Ae{static{o(this,"AddFiles")}constructor(){super(...arguments),this.triggerFileInputClick=()=>{this.fileInput.click()},this.triggerFolderInputClick=()=>{this.folderInput.click()},this.triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput.click()},this.triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.target.value=null},this.renderHiddenInput=(e,t)=>c("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes,ref:t}),this.renderHiddenCameraInput=(e,t,r)=>{let n={photo:"image/*",video:"video/*"}[e];return c("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:n,ref:r})},this.renderMyDeviceAcquirer=()=>c("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},c("div",{className:"uppy-DashboardTab-inner"},c("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),c("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>c("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},c("div",{className:"uppy-DashboardTab-inner"},c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),c("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>c("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},c("div",{className:"uppy-DashboardTab-inner"},c("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},c("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),c("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let r=this.props.acquirers.length;return c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":r===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),s=this.props.fileManagerSelectionType,n=s.charAt(0).toUpperCase()+s.slice(1);return c("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:t,browseFolders:r,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:r,browse:t}))},this.renderAcquirer=e=>{var t;return c("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},c("div",{className:"uppy-DashboardTab-inner"},e.icon()),c("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],r=t.splice(e.length-2,e.length);return c(vt,null,t.map(s=>this.renderAcquirer(s)),c("span",{role:"presentation",style:{"white-space":"nowrap"}},r.map(s=>this.renderAcquirer(s))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:r,showNativeVideoCameraButton:s}=this.props,n=[],a="myDevice";t||n.push({key:a,elements:this.renderMyDeviceAcquirer()}),r&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),s&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map(f=>({key:f.id,elements:this.renderAcquirer(f)}))),n.length===1&&n[0].key===a&&(n=[]);let u=[...n],h=u.splice(n.length-2,n.length),d=o(f=>f.map(y=>{let{key:w,elements:S}=y;return c(vt,{key:w},S)}),"renderList");return c(vt,null,this.renderDropPasteBrowseTagline(n.length),c("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},d(u),c("span",{role:"presentation",style:{"white-space":"nowrap"}},d(h))))}}[zy](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=c("span",null,c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},c("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),c("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),r=e("poweredBy",{uppy:t});return c("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},r)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:r}=this.props;return c("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,s=>{this.fileInput=s}),this.renderHiddenInput(!0,s=>{this.folderInput=s}),e&&this.renderHiddenCameraInput("photo",r,s=>{this.mobilePhotoFileInput=s}),t&&this.renderHiddenCameraInput("video",r,s=>{this.mobileVideoFileInput=s}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),c("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&c("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))}},qu=id;var Hy=be(li(),1);var lP=o(i=>c("div",{className:(0,Hy.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},c("div",{className:"uppy-DashboardContent-bar"},c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),c("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),c(qu,i)),"AddFilesPanel"),qy=lP;var $y=be(li(),1);function uP(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}o(uP,"ignoreEvent");var Yi=uP;function cP(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:s,state:n,uppy:a}=i;return c("div",{className:(0,$y.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:Yi,onDragLeave:Yi,onDrop:Yi,onPaste:Yi},c("div",{className:"uppy-DashboardContent-bar"},c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},s("importFrom",{name:e.name})),c("button",{className:"uppy-DashboardContent-back",type:"button",onClick:r},s("cancel"))),c("div",{className:"uppy-DashboardContent-panelBody"},a.getPlugin(e.id).render(n)))}o(cP,"PickerPanelContent");var Vy=cP;var Wy=be(li(),1);function hP(i){let e=i.files[i.fileCardFor],t=o(()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()},"handleCancel");return c("div",{className:(0,Wy.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},c("div",{className:"uppy-DashboardContent-bar"},c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:c("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),c("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),c("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),c("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(r=>i.uppy.getPlugin(r.id).render(i.state))))}o(hP,"EditorPanel");var Gy=hP;var Qi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function dP(i,e,t,r){if(r===void 0&&(r={}),i)return Qi.STATE_ERROR;if(e)return Qi.STATE_COMPLETE;if(t)return Qi.STATE_PAUSED;let s=Qi.STATE_WAITING,n=Object.keys(r);for(let a=0;a<n.length;a++){let{progress:l}=r[n[a]];if(l.uploadStarted&&!l.uploadComplete)return Qi.STATE_UPLOADING;l.preprocess&&s!==Qi.STATE_UPLOADING&&(s=Qi.STATE_PREPROCESSING),l.postprocess&&s!==Qi.STATE_UPLOADING&&s!==Qi.STATE_PREPROCESSING&&(s=Qi.STATE_POSTPROCESSING)}return s}o(dP,"getUploadingState");function pP(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:a,newFiles:l,processingFiles:u}=i;switch(dP(s,r,n,e)){case"uploading":return t("uploadingXFiles",{smart_count:a.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:u.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:l.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}o(pP,"UploadStatus");function fP(i){let{i18n:e,isAllComplete:t,hideCancelButton:r,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:a}=i,{allowNewUpload:l}=i;return l&&s&&(l=i.totalFileCount<i.maxNumberOfFiles),c("div",{className:"uppy-DashboardContent-bar"},!t&&!r?c("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll()},e("cancel")):c("div",null),c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},c(pP,i)),l?c("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>n(!0)},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},c("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"})),c("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):c("div",null))}o(fP,"PanelTopBar");var Ky=fP;var Xy=be(li(),1);function rd(i){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:r,form:s,formState:n}=i,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(l=>{let u=`uppy-Dashboard-FileCard-input-${l.id}`,h=t.includes(l.id);return c("fieldset",{key:l.id,className:"uppy-Dashboard-FileCard-fieldset"},c("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:u},l.name),l.render!==void 0?l.render({value:n[l.id],onChange:d=>r(d,l.id),fieldCSSClasses:a,required:h,form:s.id},c):c("input",{className:a.text,id:u,form:s.id,type:l.type||"text",required:h,value:n[l.id],placeholder:l.placeholder,onInput:d=>r(d.target.value,l.id),"data-uppy-super-focusable":!0}))})}o(rd,"RenderMetaFields");function sd(i){var e;let{files:t,fileCardFor:r,toggleFileCard:s,saveFileCard:n,metaFields:a,requiredMetaFields:l,openFileEditor:u,i18n:h,i18nArray:d,className:f,canEditFile:y}=i,w=o(()=>typeof a=="function"?a(t[r]):a,"getMetaFields"),S=t[r],T=(e=w())!=null?e:[],C=y(S),_={};T.forEach(te=>{var re;_[te.id]=(re=S.meta[te.id])!=null?re:""});let[R,q]=vr(_),W=Rs(te=>{te.preventDefault(),n(R,r)},[n,R,r]),K=o((te,re)=>{q({...R,[re]:te})},"updateMeta"),$=o(()=>{s(!1)},"handleCancel"),[G]=vr(()=>{let te=document.createElement("form");return te.setAttribute("tabindex","-1"),te.id=Xt(),te});return Ki(()=>(document.body.appendChild(G),G.addEventListener("submit",W),()=>{G.removeEventListener("submit",W),document.body.removeChild(G)}),[G,W]),c("div",{className:(0,Xy.default)("uppy-Dashboard-FileCard",f),"data-uppy-panelType":"FileCard",onDragOver:Yi,onDragLeave:Yi,onDrop:Yi,onPaste:Yi},c("div",{className:"uppy-DashboardContent-bar"},c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:c("span",{className:"uppy-DashboardContent-titleFile"},S.meta?S.meta.name:S.name)})),c("button",{className:"uppy-DashboardContent-back",type:"button",form:G.id,title:h("finishEditingFile"),onClick:$},h("cancel"))),c("div",{className:"uppy-Dashboard-FileCard-inner"},c("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:Ms(S.type).color}},c(ba,{file:S}),C&&c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:te=>{W(te),u(S)}},h("editImage"))),c("div",{className:"uppy-Dashboard-FileCard-info"},c(rd,{computedMetaFields:T,requiredMetaFields:l,updateMeta:K,form:G,formState:R})),c("div",{className:"uppy-Dashboard-FileCard-actions"},c("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:G.id},h("saveChanges")),c("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:$,form:G.id},h("cancel")))))}o(sd,"FileCard");var Qy=be(li(),1);var Wo="uppy-transition-slideDownUp",Yy=250;function mP(i){let{children:e}=i,[t,r]=vr(null),[s,n]=vr(""),a=Ts(),l=Ts(),u=Ts(),h=o(()=>{n(`${Wo}-enter`),cancelAnimationFrame(u.current),clearTimeout(l.current),l.current=void 0,u.current=requestAnimationFrame(()=>{n(`${Wo}-enter ${Wo}-enter-active`),a.current=setTimeout(()=>{n("")},Yy)})},"handleEnterTransition"),d=o(()=>{n(`${Wo}-leave`),cancelAnimationFrame(u.current),clearTimeout(a.current),a.current=void 0,u.current=requestAnimationFrame(()=>{n(`${Wo}-leave ${Wo}-leave-active`),l.current=setTimeout(()=>{r(null),n("")},Yy)})},"handleLeaveTransition");return Ki(()=>{let f=Pi(e)[0];t!==f&&(f&&!t?h():t&&!f&&!l.current&&d(),r(f))},[e,t]),Ki(()=>()=>{clearTimeout(a.current),clearTimeout(l.current),cancelAnimationFrame(u.current)},[]),t?ru(t,{className:(0,Qy.default)(s,t.props.className)}):null}o(mP,"Slide");var Pa=mP;function Bs(){return Bs=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Bs.apply(this,arguments)}o(Bs,"_extends");var Jy=900,Zy=700,od=576,ev=330;function nd(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>od,s=i.containerHeight>ev,n=(0,tv.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>od,"uppy-size--lg":i.containerWidth>Zy,"uppy-size--xl":i.containerWidth>Jy,"uppy-size--height-md":i.containerHeight>ev,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&s}),a=1;i.containerWidth>Jy?a=5:i.containerWidth>Zy?a=4:i.containerWidth>od&&(a=3);let l=i.showSelectedFiles&&!e,u=i.recoveredState?Object.keys(i.recoveredState.files).length:null,h=i.files?Object.keys(i.files).filter(y=>i.files[y].isGhost).length:null,d=o(()=>h>0?i.i18n("recoveredXFiles",{smart_count:h}):i.i18n("recoveredAllFiles"),"renderRestoredText");return c("div",{className:n,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&va(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},c("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),c("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:c("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},c("span",{"aria-hidden":"true"},"\xD7")),c("div",{className:"uppy-Dashboard-innerWrap"},c("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),l&&c(Ky,i),u&&c("div",{className:"uppy-Dashboard-serviceMsg"},c("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},c("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},c("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"}),c("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),c("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),c("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),c("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),l?c(td,{id:i.id,error:i.error,i18n:i.i18n,uppy:i.uppy,files:i.files,acquirers:i.acquirers,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,isWide:i.isWide,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:a}):c(qu,Bs({},i,{isSizeMD:r})),c(Pa,null,i.showAddFilesPanel?c(qy,Bs({key:"AddFiles"},i,{isSizeMD:r})):null),c(Pa,null,i.fileCardFor?c(sd,Bs({key:"FileCard"},i)):null),c(Pa,null,i.activePickerPanel?c(Vy,Bs({key:"Picker"},i)):null),c(Pa,null,i.showFileEditor?c(Gy,Bs({key:"Editor"},i)):null),c("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(y=>i.uppy.getPlugin(y.id).render(i.state))))))}o(nd,"Dashboard");var iv={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",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"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",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:",browseFiles:"browse files",browseFolders:"browse folders",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",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function De(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(De,"_classPrivateFieldLooseBase");var gP=0;function Ni(i){return"__private_"+gP+++"_"+i}o(Ni,"_classPrivateFieldLooseKey");var yP={version:"3.9.1"},ad=$h.default||$h,rv=9,vP=27;function sv(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}o(sv,"createPromise");var bP={target:"body",metaFields:[],inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Bo,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1,doneButtonHandler:void 0,onRequestCloseModal:null},js=Ni("disabledNodes"),Er=Ni("generateLargeThumbnailIfSingleFile"),_a=Ni("openFileEditorWhenFilesAdded"),zs=Ni("attachRenderFunctionToTarget"),ld=Ni("isTargetSupported"),ud=Ni("getAcquirers"),cd=Ni("getProgressIndicators"),Or=Ni("getEditors"),hd=Ni("addSpecifiedPluginsFromOptions"),dd=Ni("autoDiscoverPlugins"),Hs=Ni("addSupportedPluginIfNoTarget"),qs=class extends ne{static{o(this,"Dashboard")}constructor(e,t){var r,s;let n;t?t.autoOpen===void 0?n=t.autoOpenFileEditor?"imageEditor":null:n=t.autoOpen:n=null,super(e,{...bP,...t,autoOpen:n}),Object.defineProperty(this,js,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${Xt()}`,this.superFocus=Wh(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=a=>{let u=this.getPluginState().targets.filter(h=>h.id!==a.id);this.setPluginState({targets:u})},this.addTarget=a=>{let l=a.id||a.constructor.name,u=a.title||l,h=a.type;if(h!=="acquirer"&&h!=="progressindicator"&&h!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let d={id:l,name:u,type:h},y=this.getPluginState().targets.slice();return y.push(d),this.setPluginState({targets:y}),this.el},this.hideAllPanels=()=>{var a;let l=this.getPluginState(),u={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===u.activePickerPanel&&l.showAddFilesPanel===u.showAddFilesPanel&&l.showFileEditor===u.showFileEditor&&l.activeOverlayType===u.activeOverlayType||(this.setPluginState(u),this.uppy.emit("dashboard:close-panel",(a=l.activePickerPanel)==null?void 0:a.id))},this.showPanel=a=>{let{targets:l}=this.getPluginState(),u=l.find(h=>h.type==="acquirer"&&h.id===a);this.setPluginState({activePickerPanel:u,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",a)},this.canEditFile=a=>{let{targets:l}=this.getPluginState();return De(this,Or)[Or](l).some(h=>this.uppy.getPlugin(h.id).canEditFile(a))},this.openFileEditor=a=>{let{targets:l}=this.getPluginState(),u=De(this,Or)[Or](l);this.setPluginState({showFileEditor:!0,fileCardFor:a.id||null,activeOverlayType:"FileEditor"}),u.forEach(h=>{this.uppy.getPlugin(h.id).selectFile(a)})},this.closeFileEditor=()=>{let{metaFields:a}=this.getPluginState();a&&a.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:a}=this.getPluginState();De(this,Or)[Or](a).forEach(u=>{this.uppy.getPlugin(u.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:a,resolve:l}=sv();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let u=o(()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",u,!1),l()},"handler");this.el.addEventListener("animationend",u,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),a},this.closeModal=a=>{var l;let u=(l=a?.manualClose)!=null?l:!0,{isHidden:h,isClosing:d}=this.getPluginState();if(h||d)return;let{promise:f,resolve:y}=sv();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let S=o(()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",S,!1),y()},"handler");this.el.addEventListener("animationend",S,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),y();if(document.removeEventListener("keydown",this.handleKeyDownInModal),u&&this.opts.browserBackButtonClose){var w;(w=history.state)!=null&&w[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),f},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=a=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:{...l,darkMode:a}})},this.handleSystemDarkModeChange=a=>{let l=a.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(a,l)=>{let u=this.uppy.getFile(l);a?this.uppy.emit("dashboard:file-edit-start",u):this.uppy.emit("dashboard:file-edit-complete",u),this.setPluginState({fileCardFor:a?l:null,activeOverlayType:a?"FileCard":null})},this.toggleAddFilesPanel=a=>{this.setPluginState({showAddFilesPanel:a,activeOverlayType:a?"AddFiles":null})},this.addFiles=a=>{let l=a.map(u=>({source:this.id,name:u.name,type:u.type,data:u,meta:{relativePath:u.relativePath||u.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(u){this.uppy.log(u)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(a=>{let l=a[0],{width:u,height:h}=l.contentRect;this.setPluginState({containerWidth:u,containerHeight:h,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let a=this.getPluginState(),l=!this.opts.inline&&a.isHidden;!a.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=a=>{this.el.contains(a.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=a=>{var l;let u=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],h=(l=De(this,js)[js])!=null?l:nt(this.el.querySelectorAll(u)).filter(d=>!d.classList.contains("uppy-Dashboard-close"));for(let d of h)d.tagName==="A"?d.setAttribute("aria-disabled",a):d.disabled=a;a?De(this,js)[js]=h:De(this,js)[js]=null,this.dashboardIsDisabled=a},this.updateBrowserHistory=()=>{var a;(a=history.state)!=null&&a[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=a=>{var l;this.isModalOpen()&&(!a.state||!a.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=a.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=a=>{a.keyCode===vP&&this.requestCloseModal(),a.keyCode===rv&&Vh(a,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=a=>{this.uppy.iteratePlugins(u=>{u.type==="acquirer"&&(u.handleRootPaste==null||u.handleRootPaste(a))});let l=nt(a.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=a=>{a.preventDefault();let l=nt(a.target.files);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=a=>{var l,u;a.preventDefault(),a.stopPropagation();let h=o(()=>{let w=!0;return this.uppy.iteratePlugins(S=>{S.canHandleRootDrop!=null&&S.canHandleRootDrop(a)&&(w=!0)}),w},"canSomePluginHandleRootDrop"),d=o(()=>{let{types:w}=a.dataTransfer;return w.some(S=>S==="Files")},"doesEventHaveFiles"),f=h(),y=d();if(!f&&!y||this.opts.disabled||this.opts.disableLocalFiles&&(y||!f)||!this.uppy.getState().allowNewUpload){a.dataTransfer.dropEffect="none",clearTimeout(this.removeDragOverClassTimeout);return}a.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),(l=(u=this.opts).onDragOver)==null||l.call(u,a)},this.handleDragLeave=a=>{var l,u;a.preventDefault(),a.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout(()=>{this.setPluginState({isDraggingOver:!1})},50),(l=(u=this.opts).onDragLeave)==null||l.call(u,a)},this.handleDrop=async a=>{var l,u;a.preventDefault(),a.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(y=>{y.type==="acquirer"&&(y.handleRootDrop==null||y.handleRootDrop(a))});let h=!1,d=o(y=>{this.uppy.log(y,"error"),h||(this.uppy.info(y.message,"error"),h=!0)},"logDropError");this.uppy.log("[Dashboard] Processing dropped files");let f=await Ns(a.dataTransfer,{logDropError:d});f.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(f)),(l=(u=this.opts).onDrop)==null||l.call(u,a)},this.handleRequestThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",a)},this.handleCancelThumbnail=a=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",a)},this.handleKeyDownInInline=a=>{a.keyCode===rv&&Uy(a,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=a=>{this.el.contains(document.activeElement)&&this.handlePaste(a)},this.handleComplete=a=>{let{failed:l}=a;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Er,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let a=600,l=this.uppy.getFiles();if(l.length===1){let u=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);u?.setOptions({thumbnailWidth:a});let h={...l[0],preview:void 0};u?.requestThumbnail(h).then(()=>{u?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,_a,{writable:!0,value:a=>{let l=a[0],{metaFields:u}=this.getPluginState(),h=u&&u.length>0,d=this.canEditFile(l);h&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):d&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let a=zh(this.opts.trigger);a?a.forEach(l=>l.addEventListener("click",this.openModal)):this.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")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",De(this,Hs)[Hs]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",De(this,Er)[Er]),this.uppy.on("file-removed",De(this,Er)[Er]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",De(this,_a)[_a])},this.removeEvents=()=>{let a=zh(this.opts.trigger);!this.opts.inline&&a&&a.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",De(this,Hs)[Hs]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",De(this,Er)[Er]),this.uppy.off("file-removed",De(this,Er)[Er]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",De(this,_a)[_a])},this.superFocusOnEachUpdate=()=>{let a=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,u=this.uppy.getState().info.length===0,h=!this.opts.inline;u&&(h||a||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(a,l)=>{this.uppy.setFileMeta(l,a),this.toggleFileCard(!1,l)},Object.defineProperty(this,zs,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return{...a,icon:l.icon||this.opts.defaultPickerIcon,render:l.render}}}),Object.defineProperty(this,ld,{writable:!0,value:a=>{let l=this.uppy.getPlugin(a.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,ud,{writable:!0,value:ad(a=>a.filter(l=>l.type==="acquirer"&&De(this,ld)[ld](l)).map(De(this,zs)[zs]))}),Object.defineProperty(this,cd,{writable:!0,value:ad(a=>a.filter(l=>l.type==="progressindicator").map(De(this,zs)[zs]))}),Object.defineProperty(this,Or,{writable:!0,value:ad(a=>a.filter(l=>l.type==="editor").map(De(this,zs)[zs]))}),this.render=a=>{let l=this.getPluginState(),{files:u,capabilities:h,allowNewUpload:d}=a,{newFiles:f,uploadStartedFiles:y,completeFiles:w,erroredFiles:S,inProgressFiles:T,inProgressNotPausedFiles:C,processingFiles:_,isUploadStarted:R,isAllComplete:q,isAllErrored:W,isAllPaused:K}=this.uppy.getObjectOfFilesPerState(),$=De(this,ud)[ud](l.targets),G=De(this,cd)[cd](l.targets),te=De(this,Or)[Or](l.targets),re;return this.opts.theme==="auto"?re=h.darkMode?"dark":"light":re=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),nd({state:a,isHidden:l.isHidden,files:u,newFiles:f,uploadStartedFiles:y,completeFiles:w,erroredFiles:S,inProgressFiles:T,inProgressNotPausedFiles:C,processingFiles:_,isUploadStarted:R,isAllComplete:q,isAllErrored:W,isAllPaused:K,totalFileCount:Object.keys(u).length,totalProgress:a.totalProgress,allowNewUpload:d,acquirers:$,theme:re,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:G,editors:te,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:a.recoveredState,metaFields:l.metaFields,resumableUploads:h.resumableUploads||!1,individualCancellation:h.individualCancellation,isMobileDevice:h.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,isTargetDOMEl:this.isTargetDOMEl,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,hd,{writable:!0,value:()=>{(this.opts.plugins||[]).forEach(l=>{let u=this.uppy.getPlugin(l);u?u.mount(this,u):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,dd,{writable:!0,value:()=>{this.uppy.iteratePlugins(De(this,Hs)[Hs])}}),Object.defineProperty(this,Hs,{writable:!0,value:a=>{var l;let u=["acquirer","editor"];a&&!((l=a.opts)!=null&&l.target)&&u.includes(a.type)&&(this.getPluginState().targets.some(d=>a.id===d.id)||a.mount(this,a))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:a,closeAfterFinish:l}=this.opts;if(a&&l)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.");let{allowMultipleUploads:u,allowMultipleUploadBatches:h}=this.uppy.opts;(u||h)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:d}=this.opts;d&&this.mount(d,this),this.opts.disableStatusBar||this.uppy.use(xr,{id:`${this.id}:StatusBar`,target:this,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,showProgressDetails:this.opts.showProgressDetails,hideAfterFinish:this.opts.hideProgressAfterFinish,locale:this.opts.locale,doneButtonHandler:this.opts.doneButtonHandler}),this.opts.disableInformer||this.uppy.use(Fr,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(os,{id:`${this.id}:ThumbnailGenerator`,thumbnailWidth:this.opts.thumbnailWidth,thumbnailHeight:this.opts.thumbnailHeight,thumbnailType:this.opts.thumbnailType,waitForThumbnailsBeforeUpload:this.opts.waitForThumbnailsBeforeUpload,lazy:!this.opts.waitForThumbnailsBeforeUpload}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let f=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${f?"on":"off"}`),this.setDarkModeCapability(f),this.opts.theme==="auto"){var y;(y=this.darkModeMediaQuery)==null||y.addListener(this.handleSystemDarkModeChange)}De(this,hd)[hd](),De(this,dd)[dd](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let u=this.uppy.getPlugin(`${this.id}:Informer`);u&&this.uppy.removePlugin(u)}if(!this.opts.disableStatusBar){let u=this.uppy.getPlugin(`${this.id}:StatusBar`);u&&this.uppy.removePlugin(u)}if(!this.opts.disableThumbnailGenerator){let u=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);u&&this.uppy.removePlugin(u)}if((this.opts.plugins||[]).forEach(u=>{let h=this.uppy.getPlugin(u);h&&h.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=iv,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clearUploadedFiles(),this.requestCloseModal()}),(s=(r=this.opts).onRequestCloseModal)!=null||(r.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}};qs.VERSION=yP.version;var ov={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var wP={version:"3.1.1"},SP={inputName:"files[]",width:"100%",height:"100%"},$s=class i extends ne{static{o(this,"DragDrop")}constructor(e,t){super(e,{...SP,...t}),this.isDragDropSupported=va(),this.addFiles=r=>{let s=r.map(n=>({source:this.id,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}}));try{this.uppy.addFiles(s)}catch(n){this.uppy.log(n)}},this.onInputChange=r=>{let s=nt(r.target.files);s.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(s)),r.target.value=null},this.handleDragOver=r=>{var s,n;r.preventDefault(),r.stopPropagation();let{types:a}=r.dataTransfer,l=a.some(h=>h==="Files"),{allowNewUpload:u}=this.uppy.getState();if(!l||!u){r.dataTransfer.dropEffect="none",clearTimeout(this.removeDragOverClassTimeout);return}r.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),(s=(n=this.opts).onDragOver)==null||s.call(n,r)},this.handleDragLeave=r=>{var s,n;r.preventDefault(),r.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout(()=>{this.setPluginState({isDraggingOver:!1})},50),(s=(n=this.opts).onDragLeave)==null||s.call(n,r)},this.handleDrop=async r=>{var s,n;r.preventDefault(),r.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1});let a=o(u=>{this.uppy.log(u,"error")},"logDropError"),l=await Ns(r.dataTransfer,{logDropError:a});l.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(l)),(s=(n=this.opts).onDrop)==null||s.call(n,r)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=ov,this.i18nInit()}renderHiddenFileInput(){let{restrictions:e}=this.uppy.opts;return c("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:t=>{this.fileInputRef=t},name:this.opts.inputName,multiple:e.maxNumberOfFiles!==1,accept:e.allowedFileTypes,onChange:this.onInputChange})}static renderArrowSvg(){return c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},c("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return c("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:c("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return c("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){let e=`uppy-u-reset
uppy-DragDrop-container
${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
`,t={width:this.opts.width,height:this.opts.height};return c("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),c("div",{className:"uppy-DragDrop-inner"},i.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}};$s.VERSION=wP.version;var PP={version:"2.1.0"},_P={target:null};function pd(i){var e,t;return(e=(t=i.dataTransfer)==null||(t=t.types)==null?void 0:t.some(r=>r==="Files"))!=null?e:!1}o(pd,"isFileTransfer");var Go=class extends Ee{static{o(this,"DropTarget")}constructor(e,t){super(e,{..._P,...t}),this.addFiles=r=>{let s=r.map(n=>({source:this.id,name:n.name,type:n.type,data:n,meta:{relativePath:n.relativePath||null}}));try{this.uppy.addFiles(s)}catch(n){this.uppy.log(n)}},this.handleDrop=async r=>{var s,n,a;if(!pd(r))return;r.preventDefault(),r.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),(s=r.currentTarget)==null||s.classList.remove("uppy-is-drag-over"),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(d=>{d.type==="acquirer"&&(d.handleRootDrop==null||d.handleRootDrop(r))});let l=!1,u=o(d=>{this.uppy.log(d,"error"),l||(this.uppy.info(d.message,"error"),l=!0)},"logDropError"),h=await Ns(r.dataTransfer,{logDropError:u});h.length>0&&(this.uppy.log("[DropTarget] Files were dropped"),this.addFiles(h)),(n=(a=this.opts).onDrop)==null||n.call(a,r)},this.handleDragOver=r=>{var s,n;pd(r)&&(r.preventDefault(),r.stopPropagation(),r.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),r.currentTarget.classList.add("uppy-is-drag-over"),this.setPluginState({isDraggingOver:!0}),(s=(n=this.opts).onDragOver)==null||s.call(n,r))},this.handleDragLeave=r=>{var s,n;if(!pd(r))return;r.preventDefault(),r.stopPropagation();let{currentTarget:a}=r;clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout(()=>{a.classList.remove("uppy-is-drag-over"),this.setPluginState({isDraggingOver:!1})},50),(s=(n=this.opts).onDragLeave)==null||s.call(n,r)},this.addListeners=()=>{let{target:r}=this.opts;if(r instanceof Element?this.nodes=[r]:typeof r=="string"&&(this.nodes=nt(document.querySelectorAll(r))),!this.nodes||this.nodes.length===0)throw new Error(`"${r}" does not match any HTML elements`);this.nodes.forEach(s=>{s.addEventListener("dragover",this.handleDragOver,!1),s.addEventListener("dragleave",this.handleDragLeave,!1),s.addEventListener("drop",this.handleDrop,!1)})},this.removeListeners=()=>{this.nodes&&this.nodes.forEach(r=>{r.removeEventListener("dragover",this.handleDragOver,!1),r.removeEventListener("dragleave",this.handleDragLeave,!1),r.removeEventListener("drop",this.handleDrop,!1)})},this.type="acquirer",this.id=this.opts.id||"DropTarget",this.title="Drop Target"}install(){this.setPluginState({isDraggingOver:!1}),this.addListeners()}uninstall(){this.removeListeners()}};Go.VERSION=PP.version;var nv={strings:{chooseFiles:"Choose files"}};var xP={version:"3.1.2"},FP={pretty:!0,inputName:"files[]"},Vs=class extends ne{static{o(this,"FileInput")}constructor(e,t){super(e,{...FP,...t}),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=nv,this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){let t=e.map(r=>({source:this.id,name:r.name,type:r.type,data:r}));try{this.uppy.addFiles(t)}catch(r){this.uppy.log(r)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");let t=nt(e.target.files);this.addFiles(t),e.target.value=null}handleClick(){this.input.click()}render(){let e={width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},{restrictions:t}=this.uppy.opts,r=t.allowedFileTypes?t.allowedFileTypes.join(","):void 0;return c("div",{className:"uppy-FileInput-container"},c("input",{className:"uppy-FileInput-input",style:this.opts.pretty?e:void 0,type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:t.maxNumberOfFiles!==1,accept:r,ref:s=>{this.input=s}}),this.opts.pretty&&c("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick},this.i18n("chooseFiles")))}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};Vs.VERSION=xP.version;var dv=be(av(),1);function EP(i,e){let t=i.width/e.width,r=i.height/e.height,s=Math.min(t,r),n=e.width*s,a=e.height*s,l=(i.width-n)/2,u=(i.height-a)/2;return{width:n,height:a,left:l,top:u}}o(EP,"getCanvasDataThatFitsPerfectlyIntoContainer");var lv=EP;function OP(i){return i*(Math.PI/180)}o(OP,"toRadians");function CP(i,e,t){let r=Math.abs(OP(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}o(CP,"getScaleFactorThatRemovesDarkCorners");var uv=CP;function AP(i,e,t){return e.left<i.left?{left:i.left,width:t.width}:e.top<i.top?{top:i.top,height:t.height}:e.left+e.width>i.left+i.width?{left:i.left+i.width-t.width,width:t.width}:e.top+e.height>i.top+i.height?{top:i.top+i.height-t.height,height:t.height}:null}o(AP,"limitCropboxMovementOnMove");var cv=AP;function TP(i,e,t){return e.left<i.left?{left:i.left,width:t.left+t.width-i.left}:e.top<i.top?{top:i.top,height:t.top+t.height-i.top}:e.left+e.width>i.left+i.width?{left:t.left,width:i.left+i.width-t.left}:e.top+e.height>i.top+i.height?{top:t.top,height:i.top+i.height-t.top}:null}o(TP,"limitCropboxMovementOnResize");var hv=TP;var xa=class extends Ae{static{o(this,"Editor")}constructor(e){super(e),this.onRotate90Deg=()=>{let{angle90Deg:t}=this.state,r=t-90;this.setState({angle90Deg:r,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(r);let s=this.cropper.getCanvasData(),n=this.cropper.getContainerData(),a=lv(n,s);this.cropper.setCanvasData(a),this.cropper.setCropBoxData(a)},this.onRotateGranular=t=>{let r=Number(t.target.value);this.setState({angleGranular:r});let{angle90Deg:s}=this.state,n=s+r;this.cropper.rotateTo(n);let a=this.cropper.getImageData(),l=uv(a.naturalWidth,a.naturalHeight,r),u=this.cropper.getImageData().scaleX<0?-l:l;this.cropper.scale(u,l)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){let{opts:e,storeCropperInstance:t}=this.props;this.cropper=new dv.default(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){let t=this.cropper.getCanvasData(),r=this.cropper.getCropBoxData(),{prevCropboxData:s}=this.state;if(e.detail.action==="all"){let n=cv(t,r,s);n&&this.cropper.setCropBoxData(n)}else{let n=hv(t,r,s);n&&this.cropper.setCropBoxData(n)}}renderGranularRotate(){let{i18n:e}=this.props,{angleGranular:t}=this.state;return c("label",{role:"tooltip","aria-label":`${t}\xBA`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},c("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){let{i18n:e,opts:t}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0z",fill:"none"}),c("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"})))}renderRotate(){let{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),c("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"})))}renderFlip(){let{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0z",fill:"none"}),c("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"})))}renderZoomIn(){let{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},c("path",{d:"M0 0h24v24H0V0z",fill:"none"}),c("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"}),c("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){let{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0V0z",fill:"none"}),c("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"})))}renderCropSquare(){let{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0z",fill:"none"}),c("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"})))}renderCropWidescreen(){let{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("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"}),c("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){let{i18n:e}=this.props;return c("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},c("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},c("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"}),c("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){let{currentImage:e,opts:t}=this.props,{actions:r}=t,s=URL.createObjectURL(e.data);return c("div",{className:"uppy-ImageCropper"},c("div",{className:"uppy-ImageCropper-container"},c("img",{className:"uppy-ImageCropper-image",alt:e.name,src:s,ref:n=>{this.imgElement=n}})),c("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()))}};var pv={strings:{revert:"Reset",rotate:"Rotate 90\xB0",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}};var RP={version:"2.4.6"},fv={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},mv={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},kP={quality:.8,actions:mv,cropperOptions:fv},Ws=class extends ne{static{o(this,"ImageEditor")}constructor(e,t){super(e,{...kP,...t,actions:{...mv,...t?.actions},cropperOptions:{...fv,...t?.cropperOptions}}),this.save=()=>{let r=o(a=>{let{currentImage:l}=this.getPluginState();this.uppy.setFileState(l.id,{data:new File([a],l.name,{type:a.type}),size:a.size,preview:void 0});let u=this.uppy.getFile(l.id);this.uppy.emit("thumbnail:request",u),this.setPluginState({currentImage:u}),this.uppy.emit("file-editor:complete",u)},"saveBlobCallback"),{currentImage:s}=this.getPluginState(),n=this.cropper.getCroppedCanvas({});n.width%2!==0&&this.cropper.setData({width:n.width-1}),n.height%2!==0&&this.cropper.setData({height:n.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob(r,s.type,this.opts.quality)},this.storeCropperInstance=r=>{this.cropper=r},this.selectFile=r=>{this.uppy.emit("file-editor:start",r),this.setPluginState({currentImage:r})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=pv,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;let t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){let{currentImage:e}=this.getPluginState();if(e){let t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){let{currentImage:e}=this.getPluginState();return e===null||e.isRemote?null:c(xa,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};Ws.VERSION=RP.version;var UP={version:"3.1.1"},DP={target:"body",fixed:!1,hideAfterFinish:!0},Gs=class extends ne{static{o(this,"ProgressBar")}constructor(e,t){super(e,{...DP,...t}),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){let t=e.totalProgress||0,r=(t===0||t===100)&&this.opts.hideAfterFinish;return c("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":r},c("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),c("div",{className:"uppy-ProgressBar-percentage"},t))}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};Gs.VERSION=UP.version;var IP={__proto__:null,"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"};function Ji(i){return[i]=i.split(";",1),IP[i]||null}o(Ji,"getFileTypeExtension");function gd(){var i;return typeof MediaRecorder=="function"&&typeof((i=MediaRecorder.prototype)==null?void 0:i.start)=="function"}o(gd,"supportsMediaRecorder");function yd(i){let{recording:e,onStartRecording:t,onStopRecording:r,i18n:s}=i;return e?c("button",{className:"uppy-u-reset uppy-c-btn uppy-Audio-button",type:"button",title:s("stopAudioRecording"),"aria-label":s("stopAudioRecording"),onClick:r,"data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},c("rect",{x:"15",y:"15",width:"70",height:"70"}))):c("button",{className:"uppy-u-reset uppy-c-btn uppy-Audio-button",type:"button",title:s("startAudioRecording"),"aria-label":s("startAudioRecording"),onClick:t,"data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14px",height:"20px",viewBox:"0 0 14 20"},c("path",{d:"M7 14c2.21 0 4-1.71 4-3.818V3.818C11 1.71 9.21 0 7 0S3 1.71 3 3.818v6.364C3 12.29 4.79 14 7 14zm6.364-7h-.637a.643.643 0 0 0-.636.65V9.6c0 3.039-2.565 5.477-5.6 5.175-2.645-.264-4.582-2.692-4.582-5.407V7.65c0-.36-.285-.65-.636-.65H.636A.643.643 0 0 0 0 7.65v1.631c0 3.642 2.544 6.888 6.045 7.382v1.387H3.818a.643.643 0 0 0-.636.65v.65c0 .36.285.65.636.65h6.364c.351 0 .636-.29.636-.65v-.65c0-.36-.285-.65-.636-.65H7.955v-1.372C11.363 16.2 14 13.212 14 9.6V7.65c0-.36-.285-.65-.636-.65z",fill:"#FFF","fill-rule":"nonzero"})))}o(yd,"RecordButton");function vd(i){return`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`}o(vd,"formatSeconds");function bd(i){let{recordingLengthSeconds:e,i18n:t}=i,r=vd(e);return c("span",{"aria-label":t("recordingLength",{recording_length:r})},r)}o(bd,"RecordingLength");var gv=o(i=>{let{currentDeviceId:e,audioSources:t,onChangeSource:r}=i;return c("div",{className:"uppy-Audio-videoSource"},c("select",{className:"uppy-u-reset uppy-Audio-audioSource-select",onChange:s=>{r(s.target.value)}},t.map(s=>c("option",{key:s.deviceId,value:s.deviceId,selected:s.deviceId===e},s.label))))},"default");function LP(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(LP,"_classPrivateFieldLooseBase");var NP=0;function MP(i){return"__private_"+NP+++"_"+i}o(MP,"_classPrivateFieldLooseKey");function yv(i){return typeof i=="function"}o(yv,"isFunction");function Fa(i){return yv(i)?i():i}o(Fa,"result");var wd=MP("draw"),Ea=class{static{o(this,"AudioOscilloscope")}constructor(e,t){t===void 0&&(t={}),Object.defineProperty(this,wd,{writable:!0,value:()=>this.draw()});let r=t.canvas||{},s=t.canvasContext||{};this.analyser=null,this.bufferLength=0,this.canvas=e,this.width=Fa(r.width)||this.canvas.width,this.height=Fa(r.height)||this.canvas.height,this.canvas.width=this.width,this.canvas.height=this.height,this.canvasContext=this.canvas.getContext("2d"),this.canvasContext.fillStyle=Fa(s.fillStyle)||"rgb(255, 255, 255)",this.canvasContext.strokeStyle=Fa(s.strokeStyle)||"rgb(0, 0, 0)",this.canvasContext.lineWidth=Fa(s.lineWidth)||1,this.onDrawFrame=yv(t.onDrawFrame)?t.onDrawFrame:()=>{}}addSource(e){this.streamSource=e,this.audioContext=this.streamSource.context,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2048,this.bufferLength=this.analyser.frequencyBinCount,this.source=this.audioContext.createBufferSource(),this.dataArray=new Uint8Array(this.bufferLength),this.analyser.getByteTimeDomainData(this.dataArray),this.streamSource.connect(this.analyser)}draw(){let{analyser:e,dataArray:t,bufferLength:r}=this,s=this.canvasContext,n=this.width,a=this.height;e&&e.getByteTimeDomainData(t),s.fillRect(0,0,n,a),s.beginPath();let l=n*1/r,u=0;r||s.moveTo(0,this.height/2);for(let h=0;h<r;h++){let f=t[h]/128*(a/2);h===0?s.moveTo(u,f):s.lineTo(u,f),u+=l}s.lineTo(n,a/2),s.stroke(),this.onDrawFrame(this),requestAnimationFrame(LP(this,wd)[wd])}};function BP(i){let{onSubmit:e,i18n:t}=i;return c("button",{className:"uppy-u-reset uppy-c-btn uppy-Audio-button uppy-Audio-button--submit",type:"button",title:t("submitRecordedFile"),"aria-label":t("submitRecordedFile"),onClick:e,"data-uppy-super-focusable":!0},c("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"},c("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))}o(BP,"SubmitButton");var vv=BP;function jP(i){let{onDiscard:e,i18n:t}=i;return c("button",{className:"uppy-u-reset uppy-c-btn uppy-Audio-button",type:"button",title:t("discardRecordedFile"),"aria-label":t("discardRecordedFile"),onClick:e,"data-uppy-super-focusable":!0},c("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",className:"uppy-c-icon"},c("g",{fill:"#FFF",fillRule:"evenodd"},c("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),c("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))}o(jP,"DiscardButton");var bv=jP;function Sd(i){let{stream:e,recordedAudio:t,onStop:r,recording:s,supportsRecording:n,audioSources:a,showAudioSourceDropdown:l,onSubmit:u,i18n:h,onStartRecording:d,onStopRecording:f,onDiscardRecordedAudio:y,recordingLengthSeconds:w}=i,S=Ts(null),T=Ts();Ki(()=>()=>{T.current=null,r()},[r]),Ki(()=>{if(!t&&(T.current=new Ea(S.current,{canvas:{width:600,height:600},canvasContext:{lineWidth:2,fillStyle:"rgb(0,0,0)",strokeStyle:"green"}}),T.current.draw(),e)){let W=new AudioContext().createMediaStreamSource(e);T.current.addSource(W)}},[t,e]);let C=t!=null,_=!C&&n,R=l&&!C&&a&&a.length>1;return c("div",{className:"uppy-Audio-container"},c("div",{className:"uppy-Audio-audioContainer"},C?c("audio",{className:"uppy-Audio-player",controls:!0,src:t}):c("canvas",{ref:S,className:"uppy-Audio-canvas"})),c("div",{className:"uppy-Audio-footer"},c("div",{className:"uppy-Audio-audioSourceContainer"},R?gv(i):null),c("div",{className:"uppy-Audio-buttonContainer"},_&&c(yd,{recording:s,onStartRecording:d,onStopRecording:f,i18n:h}),C&&c(vv,{onSubmit:u,i18n:h}),C&&c(bv,{onDiscard:y,i18n:h})),c("div",{className:"uppy-Audio-recordingLength"},!C&&c(bd,{recordingLengthSeconds:w,i18n:h}))))}o(Sd,"RecordingScreen");var wv=o(i=>{let{icon:e,hasAudio:t,i18n:r}=i;return c("div",{className:"uppy-Audio-permissons"},c("div",{className:"uppy-Audio-permissonsIcon"},e()),c("h1",{className:"uppy-Audio-title"},r(t?"allowAudioAccessTitle":"noAudioTitle")),c("p",null,r(t?"allowAudioAccessDescription":"noAudioDescription")))},"default");var Sv={strings:{pluginNameAudio:"Audio",startAudioRecording:"Begin audio recording",stopAudioRecording:"Stop audio recording",allowAudioAccessTitle:"Please allow access to your microphone",allowAudioAccessDescription:"In order to record audio, please allow microphone access for this site.",noAudioTitle:"Microphone Not Available",noAudioDescription:"In order to record audio, please connect a microphone or another audio input 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"}};function Cd(){return Cd=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Cd.apply(this,arguments)}o(Cd,"_extends");function Z(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Z,"_classPrivateFieldLooseBase");var zP=0;function Ft(i){return"__private_"+zP+++"_"+i}o(Ft,"_classPrivateFieldLooseKey");var HP={version:"1.1.9"},_t=Ft("stream"),Cr=Ft("audioActive"),ze=Ft("recordingChunks"),je=Ft("recorder"),Ar=Ft("capturedMediaFile"),xt=Ft("mediaDevices"),Oa=Ft("supportsUserMedia"),Pd=Ft("hasAudioCheck"),Ks=Ft("start"),_d=Ft("startRecording"),Ca=Ft("stopRecording"),xd=Ft("discardRecordedAudio"),Fd=Ft("submit"),Tr=Ft("stop"),Ed=Ft("getAudio"),Od=Ft("changeSource"),Xs=Ft("updateSources"),Ys=class extends ne{static{o(this,"Audio")}constructor(e,t){super(e,t),Object.defineProperty(this,Ed,{value:$P}),Object.defineProperty(this,Pd,{value:qP}),Object.defineProperty(this,_t,{writable:!0,value:null}),Object.defineProperty(this,Cr,{writable:!0,value:!1}),Object.defineProperty(this,ze,{writable:!0,value:null}),Object.defineProperty(this,je,{writable:!0,value:null}),Object.defineProperty(this,Ar,{writable:!0,value:null}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),Object.defineProperty(this,Oa,{writable:!0,value:void 0}),Object.defineProperty(this,Ks,{writable:!0,value:r=>{if(!Z(this,Oa)[Oa])return Promise.reject(new Error("Microphone access not supported"));Z(this,Cr)[Cr]=!0,Z(this,Pd)[Pd]().then(s=>(this.setPluginState({hasAudio:s}),Z(this,xt)[xt].getUserMedia({audio:!0}).then(n=>{Z(this,_t)[_t]=n;let a=null,l=n.getAudioTracks();r!=null&&r.deviceId?a=l.findLast(u=>u.getSettings().deviceId===r.deviceId):a=l[0].getSettings().deviceId,Z(this,Xs)[Xs](),this.setPluginState({currentDeviceId:a,audioReady:!0})}).catch(n=>{this.setPluginState({audioReady:!1,cameraError:n}),this.uppy.info(n.message,"error")})))}}),Object.defineProperty(this,_d,{writable:!0,value:()=>{Z(this,je)[je]=new MediaRecorder(Z(this,_t)[_t]),Z(this,ze)[ze]=[];let r=!1;Z(this,je)[je].addEventListener("dataavailable",s=>{Z(this,ze)[ze].push(s.data);let{restrictions:n}=this.uppy.opts;if(Z(this,ze)[ze].length>1&&n.maxFileSize!=null&&!r){let a=Z(this,ze)[ze].reduce((d,f)=>d+f.size,0),u=(a-Z(this,ze)[ze][0].size)/(Z(this,ze)[ze].length-1)*3,h=Math.max(0,n.maxFileSize-u);a>h&&(r=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),Z(this,Ca)[Ca]())}}),Z(this,je)[je].start(500),this.recordingLengthTimer=setInterval(()=>{let s=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:s+1})},1e3),this.setPluginState({isRecording:!0})}}),Object.defineProperty(this,Ca,{writable:!0,value:()=>new Promise(s=>{Z(this,je)[je].addEventListener("stop",()=>{s()}),Z(this,je)[je].stop(),clearInterval(this.recordingLengthTimer),this.setPluginState({recordingLengthSeconds:0})}).then(()=>(this.setPluginState({isRecording:!1}),Z(this,Ed)[Ed]())).then(s=>{try{Z(this,Ar)[Ar]=s,this.setPluginState({recordedAudio:URL.createObjectURL(s.data)})}catch(n){n.isRestriction||this.uppy.log(n)}}).then(()=>{Z(this,ze)[ze]=null,Z(this,je)[je]=null},s=>{throw Z(this,ze)[ze]=null,Z(this,je)[je]=null,s})}),Object.defineProperty(this,xd,{writable:!0,value:()=>{this.setPluginState({recordedAudio:null}),Z(this,Ar)[Ar]=null}}),Object.defineProperty(this,Fd,{writable:!0,value:()=>{try{Z(this,Ar)[Ar]&&this.uppy.addFile(Z(this,Ar)[Ar])}catch(r){r.isRestriction||this.uppy.log(r,"warning")}}}),Object.defineProperty(this,Tr,{writable:!0,value:async()=>{Z(this,_t)[_t]&&Z(this,_t)[_t].getAudioTracks().forEach(s=>s.stop()),Z(this,je)[je]&&await new Promise(r=>{Z(this,je)[je].addEventListener("stop",r,{once:!0}),Z(this,je)[je].stop(),clearInterval(this.recordingLengthTimer)}),Z(this,ze)[ze]=null,Z(this,je)[je]=null,Z(this,Cr)[Cr]=!1,Z(this,_t)[_t]=null,this.setPluginState({recordedAudio:null,isRecording:!1,recordingLengthSeconds:0})}}),Object.defineProperty(this,Od,{writable:!0,value:r=>{Z(this,Tr)[Tr](),Z(this,Ks)[Ks]({deviceId:r})}}),Object.defineProperty(this,Xs,{writable:!0,value:()=>{Z(this,xt)[xt].enumerateDevices().then(r=>{this.setPluginState({audioSources:r.filter(s=>s.kind==="audioinput")})})}}),Z(this,xt)[xt]=navigator.mediaDevices,Z(this,Oa)[Oa]=Z(this,xt)[xt]!=null,this.id=this.opts.id||"Audio",this.type="acquirer",this.icon=()=>c("svg",{className:"uppy-DashboardTab-iconAudio","aria-hidden":"true",focusable:"false",width:"32px",height:"32px",viewBox:"0 0 32 32"},c("path",{d:"M21.143 12.297c.473 0 .857.383.857.857v2.572c0 3.016-2.24 5.513-5.143 5.931v2.64h2.572a.857.857 0 110 1.714H12.57a.857.857 0 110-1.714h2.572v-2.64C12.24 21.24 10 18.742 10 15.726v-2.572a.857.857 0 111.714 0v2.572A4.29 4.29 0 0016 20.01a4.29 4.29 0 004.286-4.285v-2.572c0-.474.384-.857.857-.857zM16 6.5a3 3 0 013 3v6a3 3 0 01-6 0v-6a3 3 0 013-3z",fill:"currentcolor","fill-rule":"nonzero"})),this.defaultLocale=Sv,this.opts={...t},this.i18nInit(),this.title=this.i18n("pluginNameAudio"),this.setPluginState({hasAudio:!1,audioReady:!1,cameraError:null,recordingLengthSeconds:0,audioSources:[],currentDeviceId:null})}render(){Z(this,Cr)[Cr]||Z(this,Ks)[Ks]();let e=this.getPluginState();return!e.audioReady||!e.hasAudio?c(wv,{icon:this.icon,i18n:this.i18n,hasAudio:e.hasAudio}):c(Sd,Cd({},e,{audioActive:Z(this,Cr)[Cr],onChangeSource:Z(this,Od)[Od],onStartRecording:Z(this,_d)[_d],onStopRecording:Z(this,Ca)[Ca],onDiscardRecordedAudio:Z(this,xd)[xd],onSubmit:Z(this,Fd)[Fd],onStop:Z(this,Tr)[Tr],i18n:this.i18n,showAudioSourceDropdown:this.opts.showAudioSourceDropdown,supportsRecording:gd(),recording:e.isRecording,stream:Z(this,_t)[_t]}))}install(){this.setPluginState({audioReady:!1,recordingLengthSeconds:0});let{target:e}=this.opts;e&&this.mount(e,this),Z(this,xt)[xt]&&(Z(this,Xs)[Xs](),Z(this,xt)[xt].ondevicechange=()=>{if(Z(this,Xs)[Xs](),Z(this,_t)[_t]){let t=!0,{audioSources:r,currentDeviceId:s}=this.getPluginState();r.forEach(n=>{s===n.deviceId&&(t=!1)}),t&&(Z(this,Tr)[Tr](),Z(this,Ks)[Ks]())}})}uninstall(){Z(this,_t)[_t]&&Z(this,Tr)[Tr](),this.unmount()}};function qP(){return Z(this,xt)[xt]?Z(this,xt)[xt].enumerateDevices().then(i=>i.some(e=>e.kind==="audioinput")):Promise.resolve(!1)}o(qP,"_hasAudioCheck2");function $P(){let i=Z(this,ze)[ze].find(n=>{var a;return((a=n.type)==null?void 0:a.length)>0}).type,e=Ji(i);if(!e)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${i}"`));let t=`audio-${Date.now()}.${e}`,r=new Blob(Z(this,ze)[ze],{type:i}),s={source:this.id,name:t,data:new Blob([r],{type:i}),type:i};return Promise.resolve(s)}o($P,"_getAudio2");Ys.VERSION=HP.version;var Pv={strings:{pluginNameBox:"Box"}};var VP={version:"2.4.0"},Rr=class extends ne{static{o(this,"Box")}constructor(e,t){super(e,t),this.id=this.opts.id||"Box",this.type="acquirer",this.storage=this.opts.storage||Je,this.files=[],this.icon=()=>c("svg",{className:"uppy-DashboardTab-iconBox","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("g",{fill:"currentcolor",fillRule:"nonzero"},c("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"}),c("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"}))),this.opts.companionAllowedHosts=Qe(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Ye(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"box",pluginId:this.id,supportsRefreshToken:!1}),this.defaultLocale=Pv,this.i18nInit(),this.title=this.i18n("pluginNameBox"),this.onFirstRender=this.onFirstRender.bind(this),this.render=this.render.bind(this)}install(){this.view=new Me(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}async onFirstRender(){await Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder()])}render(e){return this.view.render(e)}};Rr.VERSION=VP.version;var _v={strings:{pluginNameDropbox:"Dropbox"}};var WP={version:"3.4.0"},kr=class extends ne{static{o(this,"Dropbox")}constructor(e,t){super(e,t),this.id=this.opts.id||"Dropbox",this.type="acquirer",this.storage=this.opts.storage||Je,this.files=[],this.icon=()=>c("svg",{className:"uppy-DashboardTab-iconDropbox","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("path",{d:"M10.5 7.5L5 10.955l5.5 3.454 5.5-3.454 5.5 3.454 5.5-3.454L21.5 7.5 16 10.955zM10.5 21.319L5 17.864l5.5-3.455 5.5 3.455zM16 17.864l5.5-3.455 5.5 3.455-5.5 3.455zM16 25.925l-5.5-3.455 5.5-3.454 5.5 3.454z",fill:"currentcolor",fillRule:"nonzero"})),this.opts.companionAllowedHosts=Qe(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Ye(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"dropbox",pluginId:this.id,supportsRefreshToken:!0}),this.defaultLocale=_v,this.i18nInit(),this.title=this.opts.title||this.i18n("pluginNameDropbox"),this.onFirstRender=this.onFirstRender.bind(this),this.render=this.render.bind(this)}install(){this.view=new Me(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}async onFirstRender(){await Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder()])}render(e){return this.view.render(e)}};kr.VERSION=WP.version;var xv={strings:{pluginNameFacebook:"Facebook"}};var GP={version:"3.3.1"},Ur=class extends ne{static{o(this,"Facebook")}constructor(e,t){super(e,t),this.id=this.opts.id||"Facebook",this.type="acquirer",this.storage=this.opts.storage||Je,this.files=[],this.icon=()=>c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("g",{fill:"none",fillRule:"evenodd"},c("path",{d:"M27 16c0-6.075-4.925-11-11-11S5 9.925 5 16c0 5.49 4.023 10.041 9.281 10.866V19.18h-2.793V16h2.793v-2.423c0-2.757 1.642-4.28 4.155-4.28 1.204 0 2.462.215 2.462.215v2.707h-1.387c-1.366 0-1.792.848-1.792 1.718V16h3.05l-.487 3.18h-2.563v7.686C22.977 26.041 27 21.49 27 16",fill:"#1777F2"}),c("path",{d:"M20.282 19.18L20.77 16h-3.051v-2.063c0-.87.426-1.718 1.792-1.718h1.387V9.512s-1.258-.215-2.462-.215c-2.513 0-4.155 1.523-4.155 4.28V16h-2.793v3.18h2.793v7.686a11.082 11.082 0 003.438 0V19.18h2.563",fill:"#FFFFFE"}))),this.opts.companionAllowedHosts=Qe(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Ye(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"facebook",pluginId:this.id,supportsRefreshToken:!1}),this.defaultLocale=xv,this.i18nInit(),this.title=this.i18n("pluginNameFacebook"),this.onFirstRender=this.onFirstRender.bind(this),this.render=this.render.bind(this)}install(){this.view=new Me(this,{provider:this.provider});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}async onFirstRender(){await Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder()])}render(e){let t={};return this.getPluginState().files.length&&!this.getPluginState().folders.length&&(t.viewType="grid",t.showFilter=!1,t.showTitles=!1),this.view.render(e,t)}};Ur.VERSION=GP.version;var Aa=class extends Me{static{o(this,"DriveProviderViews")}toggleCheckbox(e,t){e.stopPropagation(),e.preventDefault(),t.custom.isSharedDrive||super.toggleCheckbox(e,t)}};var Fv={strings:{pluginNameGoogleDrive:"Google Drive"}};var KP={version:"3.6.0"},Dr=class extends ne{static{o(this,"GoogleDrive")}constructor(e,t){super(e,t),this.type="acquirer",this.storage=this.opts.storage||Je,this.files=[],this.id=this.opts.id||"GoogleDrive",this.icon=()=>c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("g",{fillRule:"nonzero",fill:"none"},c("path",{d:"M6.663 22.284l.97 1.62c.202.34.492.609.832.804l3.465-5.798H5c0 .378.1.755.302 1.096l1.361 2.278z",fill:"#0066DA"}),c("path",{d:"M16 12.09l-3.465-5.798c-.34.195-.63.463-.832.804l-6.4 10.718A2.15 2.15 0 005 18.91h6.93L16 12.09z",fill:"#00AC47"}),c("path",{d:"M23.535 24.708c.34-.195.63-.463.832-.804l.403-.67 1.928-3.228c.201-.34.302-.718.302-1.096h-6.93l1.474 2.802 1.991 2.996z",fill:"#EA4335"}),c("path",{d:"M16 12.09l3.465-5.798A2.274 2.274 0 0018.331 6h-4.662c-.403 0-.794.11-1.134.292L16 12.09z",fill:"#00832D"}),c("path",{d:"M20.07 18.91h-8.14l-3.465 5.798c.34.195.73.292 1.134.292h12.802c.403 0 .794-.11 1.134-.292L20.07 18.91z",fill:"#2684FC"}),c("path",{d:"M23.497 12.455l-3.2-5.359a2.252 2.252 0 00-.832-.804L16 12.09l4.07 6.82h6.917c0-.377-.1-.755-.302-1.096l-3.188-5.359z",fill:"#FFBA00"}))),this.opts.companionAllowedHosts=Qe(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Ye(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"drive",pluginId:this.id,supportsRefreshToken:!0}),this.defaultLocale=Fv,this.i18nInit(),this.title=this.i18n("pluginNameGoogleDrive"),this.onFirstRender=this.onFirstRender.bind(this),this.render=this.render.bind(this)}install(){this.view=new Aa(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}async onFirstRender(){await Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder("root")])}render(e){return this.view.render(e)}};Dr.VERSION=KP.version;var Ev={strings:{pluginNameGooglePhotos:"Google Photos"}};var XP={version:"0.1.0"},Ir=class extends ne{static{o(this,"GooglePhotos")}constructor(e,t){super(e,t),this.type="acquirer",this.storage=this.opts.storage||Je,this.files=[],this.id=this.opts.id||"GooglePhotos",this.icon=()=>c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"-7 -7 73 73"},c("g",{fill:"none","fill-rule":"evenodd"},c("path",{d:"M-3-3h64v64H-3z"}),c("g",{"fill-rule":"nonzero"},c("path",{fill:"#FBBC04",d:"M14.8 13.4c8.1 0 14.7 6.6 14.7 14.8v1.3H1.3c-.7 0-1.3-.6-1.3-1.3C0 20 6.6 13.4 14.8 13.4z"}),c("path",{fill:"#EA4335",d:"M45.6 14.8c0 8.1-6.6 14.7-14.8 14.7h-1.3V1.3c0-.7.6-1.3 1.3-1.3C39 0 45.6 6.6 45.6 14.8z"}),c("path",{fill:"#4285F4",d:"M44.3 45.6c-8.2 0-14.8-6.6-14.8-14.8v-1.3h28.2c.7 0 1.3.6 1.3 1.3 0 8.2-6.6 14.8-14.8 14.8z"}),c("path",{fill:"#34A853",d:"M13.4 44.3c0-8.2 6.6-14.8 14.8-14.8h1.3v28.2c0 .7-.6 1.3-1.3 1.3-8.2 0-14.8-6.6-14.8-14.8z"})))),this.opts.companionAllowedHosts=Qe(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Ye(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"googlephotos",pluginId:this.id,supportsRefreshToken:!0}),this.defaultLocale=Ev,this.i18nInit(),this.title=this.i18n("pluginNameGooglePhotos"),this.onFirstRender=this.onFirstRender.bind(this),this.render=this.render.bind(this)}install(){this.view=new Me(this,{provider:this.provider,loadAllFiles:!0});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}async onFirstRender(){await Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder()])}render(e){return this.getPluginState().files.length&&!this.getPluginState().folders.length?this.view.render(e,{viewType:"grid",showFilter:!1,showTitles:!1}):this.view.render(e)}};Ir.VERSION=XP.version;var Ov={strings:{pluginNameInstagram:"Instagram"}};var YP={version:"3.3.1"},Lr=class extends ne{static{o(this,"Instagram")}constructor(e,t){super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||Je,this.id=this.opts.id||"Instagram",this.icon=()=>c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("defs",null,c("path",{d:"M16.825 5l.483-.001.799.002c1.168.005 1.598.021 2.407.057 1.17.05 1.97.235 2.67.506.725.28 1.34.655 1.951 1.265.613.61.99 1.223 1.273 1.946.273.7.46 1.498.516 2.67l.025.552.008.205c.029.748.037 1.51.042 3.777l.001.846v.703l-.001.398a50.82 50.82 0 01-.058 2.588c-.05 1.17-.235 1.97-.506 2.67a5.394 5.394 0 01-1.265 1.951c-.61.613-1.222.99-1.946 1.273-.699.273-1.498.46-2.668.516-.243.012-.451.022-.656.03l-.204.007c-.719.026-1.512.034-3.676.038l-.847.001h-1.1a50.279 50.279 0 01-2.587-.059c-1.171-.05-1.971-.235-2.671-.506a5.394 5.394 0 01-1.951-1.265 5.385 5.385 0 01-1.272-1.946c-.274-.699-.46-1.498-.517-2.668a88.15 88.15 0 01-.03-.656l-.007-.205c-.026-.718-.034-1.512-.038-3.674v-2.129c.006-1.168.022-1.597.058-2.406.051-1.171.235-1.971.506-2.672a5.39 5.39 0 011.265-1.95 5.381 5.381 0 011.946-1.272c.699-.274 1.498-.462 2.669-.517l.656-.03.204-.007c.718-.026 1.511-.034 3.674-.038zm.678 1.981h-1.226l-.295.001c-2.307.005-3.016.013-3.777.043l-.21.009-.457.02c-1.072.052-1.654.232-2.042.383-.513.2-.879.44-1.263.825a3.413 3.413 0 00-.82 1.267c-.15.388-.33.97-.375 2.043a48.89 48.89 0 00-.056 2.482v.398 1.565c.006 2.937.018 3.285.073 4.444.05 1.073.231 1.654.382 2.043.2.512.44.878.825 1.263.386.383.753.621 1.267.82.388.15.97.328 2.043.374.207.01.388.017.563.024l.208.007a63.28 63.28 0 002.109.026h1.564c2.938-.006 3.286-.019 4.446-.073 1.071-.051 1.654-.232 2.04-.383.514-.2.88-.44 1.264-.825.384-.386.622-.753.82-1.266.15-.389.328-.971.375-2.044.039-.88.054-1.292.057-2.723v-1.15-.572c-.006-2.936-.019-3.284-.074-4.445-.05-1.071-.23-1.654-.382-2.04-.2-.515-.44-.88-.825-1.264a3.405 3.405 0 00-1.267-.82c-.388-.15-.97-.328-2.042-.375a48.987 48.987 0 00-2.535-.056zm-1.515 3.37a5.65 5.65 0 11.021 11.299 5.65 5.65 0 01-.02-11.3zm.004 1.982a3.667 3.667 0 10.015 7.334 3.667 3.667 0 00-.015-7.334zm5.865-3.536a1.32 1.32 0 11.005 2.64 1.32 1.32 0 01-.005-2.64z",id:"a"})),c("g",{fill:"none","fill-rule":"evenodd"},c("mask",{id:"b",fill:"#fff"},c("use",{xlinkHref:"#a"})),c("image",{mask:"url(#b)",x:"4",y:"4",width:"24",height:"24",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALKADAAQAAAABAAAALAAAAAD8buejAAALZklEQVRYCVWZC2LbNhAFCRKykvP0bD1506SxRKIzbwHJoU3jv5h9WICU3P7+6zlG2zZvr8s/rW1tN7U0rMll8aDYufdzbLfc1JHmpv3jpPy8tsO+3O2s/O6YMSjTl/qdCds4mIIG60m8vdq2Z+phm2V4vAb9+o7BbZeuoM0NyYazvTvbvlN1MGjHUAesZ/IWWOsCeF0BOwAK4ITR0WYd/QKHEPv2DEymmorZtiubjOHEMYEzXmC9GMxu+95Kz+kuwxjDBKb8iUoCAdqZoAeyALreW6ZNx9Y4Jz8cLwjTZOEoR+HU05k2RzgP2iafGgfZiEdZbEr94zpX/xkPtDtGAxF+LRcgTsp9CAZg0rnEnXmPqFshY5vLnVWxLXO/bah2sZQgBZppGSe8NbjNPN5kc/WbIYEn8U+jXCOezT4zfgS1eoVEhceVeK74Fe4N6CoYEoLWykzHsd+GMAUqdTTVvvqT1uWqB3lVCLb12/ORAe8/5Zu9mp7lqoEFUCAFDIxqz7i1bq2AY1U9jqq2QK/7DYl+1AeZlAFcEc+U/jkRUqsvCHQ/nyGvjrOl6EuZWRWVGCKUMCkntQ5o+u2AZ3OxakbTcoBZnY0xhgGCUM4Kp1xtBTnBnXM5ASRms/Fs7d9OpX8bXN45pibQY/ML1MmA5G9CINBuCpdftexr6i2c5qd9J441LNJm3zk1GVusJ7v6mPJ7HPxJR0Li/vg9O1XHTEgvsQoSgExU0NnlLF0paK+6d06aOMKE2nCKV0ofNw4WsWmLsWrv6lPLnhGpr9E137QkHOMB/jh/T8MOqOadXarR44zPBW5NvDccnBxVmdK81+7RQ5p6qnQoRDZPh9+xWj0N2XpqxX1HzMty9UlFnKya/h3gulziAsyxwkSmpTIPB8vagKLyktRdDuBEHNGZMm4oCFWgjq31WPHpaC93gGNqpOpP4Ez4spa+nMNvhTWcuPKAJ79fqIxVoUvdjEG9qSy2WhpQlz61yG/gnKEA25IrIOYK6DIsQs2EE9LR/sTKq38Nd1y/X//FXG0QDHkEqSz3EYVV2dhb00rgLPSDcqmrScs55NNOD2zVqKmYnYTFnkACp520dkW5vBxK99BVzr792/iZ+VVo92UkKU2oG5WFTb6mNiA1H2C8KC0E44qaQleR3EQvQNwLrECOVAiSwM5gpF7nvDND0lZvYuQ9JbZfqdTrqCgwMcVrRS0z9QkLu9NWmkgEHb8p2zDRylj9VWA3lXD2vObEdWpT3w5MiFqQ1W/lteG4eipastxv2w+TeTBP0ypK84HiOW9fUzLcjRDwCW2b2VxmnGSKTX6uRSwMnC9YX4l05Mh2uwI+QVWdWUOSTWd5Xjjf7/tPYk2stSh053XTGN5RJMCMSajMcS8Trn3j/E1ajthlxCkmJXVi47PSUsyyq+jyexsayQNuv5GVYJaszprNsQD3RkgYiy49kFl2JlJJxlf8Uu/lpkq7+aWqzEzjr5cTVpFaJvSVr8AKRtiTlVPFk5t1nO30W+o6jrbAk76kxFa/tX+dom4C1wDPk03gqCw8HTBSxx4FHxIA+mh2pM3rKu5SNqBAuOSZnHzsB9JwW7DV/ge8dlVsOh375PvH8YO8EALU1HuecIC6qQgXifNuSx9XAoLaoGIYDjkWFrawX1U1XrknuMFw7QBSPtg79XovmBvwqnDICrhClEO6wgKFj9vPqJWlthUvdgH1DOA8+wFMexzQc5BUS1d1IsdBSjEv4Fe1LgBO1CpFPTpV1JuPSFNt4y/trzbtaUfwBWwM3/6JsrL6MSQYwLKXAm9YJBxsM8992MblZ63Gami0+rnwOMyPykVpQsyl9eYNOfVC6kRBkwaop//LgcAKWivkHF791g0JK5kMmCgKPas2QRkUFQsuTvm6R1946Wg95k764ZRLW59yO5UVGsawwELupCfAbdCuAwvcz5Xk18rIVEdgSRBRgO77R206QdXHuA2goaGiCQ0GmUfN1JlmFayjv0IcKGkfYt4HAj0yuQBRGDjzuS/rTmAf29Gov1S+FF7QBayNcpoBOEsMt3vFcIUC7VxOnE+pxmkgqEzduzwsPykrjBszCusgdarsRIAL6CM/KqsqcAf1vj8P1TXFyN6e5G8ao48fjKfDQJYizIdIfb+Xwp6Z2fE2C7mUfUEzMKqSBp4VUV1A49Sz1M2LzVzahEfyHUAcQNltR0nADYkBvHXDZQo8H9dQvHF7qhjPtSolBJ0A/vaLwdRz5YFFGoWBy8E/4aKcjqimaUBXXnjBpzOZnMlIVXsTVEBBUa+dD0BR0xVopgAD70psY0KjMHpmHB2kApea9o23NS83mpsref5OZet4U/0CMhSEDpwnxB9lVKSfk5djllXRFPizQmKcqMpnyZ3ycPntf96Ym9ChzU8vCQnhgWZ2UuySArw+cVBG4gqNCS6YoSEEziRWVStKUpe4FfCd91V0XA/qgOJuF7FpGjjyQgsFoNDtibp8cm+cyXxbB6zh4pMUO4H06yzsv4E/A6rg/uRJRnMRmrhMDIhyOjABX9CMDFhBFxx19KujjqWeim5PwVFU6IBiewfyk7IPETcg52kjXN7nsbaoEykKf/cjUgVxpTZZVtnqFMgv4FHa8oSOisawinMLHfUBzJcK1j8BeqquedKDtgcgnA4bym4P6gBWYVM3W/pn41ku5L4RElFWtlk5SXHEThhOWDiIyVROlQNM+wyHimlgATI/PPIm4BB8qfqwHnhgL89gzs+Ww1xQb4821SZ/4IwOJiRqH/X9u7Hj08JLSZfawOQcpRzwgk1oBNzzcgLn1FBNHspMENik9OG4awIDaUjw9rKNT1KXPl9neua6sSbkgqfs/CNfBdNfDDhQuL4AKXEXeOgZID91eOiRUnEFOIA5rnTkBU0/IT05gByoq5KBJF4Hym4Pxh3UcxZ7HjdhEhKWURbhavNR9rjLBwk3ryDcrGzfvk9I69b1yhMGWQ4bqMwv/RMSplQkjjVKXzZX8wESVcuB7QG0YUCMjk/aOmWgc/vC4oMCVYfghIGP6MT1zpeUhM1rQzOnGxmFKwTCir1Xaj5vN7T7nDZvnbDGHbCKnwji2zofNsOvbold3zlUtKGosBun3PbJSrrReHEaCQVCIDEMaCCBs+P+AbybkbIhmbNecGwF+E5/L2ECuPKCWsUESQkKnyyJ93TGACk7OrAY9P8XG//fGCoM7DAEUGnj5Mw7aQfelySWOm9iPuFyvrL8rKQR6mM6qdCUDQsfNPVu4yv/HaPOT1e/yDaviMKmTkg/I/F7MUG9OlrmDrBLRVd3c8KBJlPEKoVRcIJuhoQAmZDUkPC00W5OI1dOpQ1F61kFNqr9SmFcaHdBheOaDHF6QZMOP6QyiZ804oj98wLiAMIgcWw4UDYkDAWfR+4d5s0zP2GgUZX04i+NeSgYGokvbDhIZYUWHgd9K8zZzir264NxZUFbsfM1jdqpV2naA48tx6hsvBSabE4IMtlcOGgq8PqCjoly2rw2soqy4RJWQtPZl6PUCU14ZUWENuZV2Honn3f+k6R6wrkqgTStyQ0bFY+XAaafMRFgUlVeXxXFUcpLEYfZz3FrVUzZrOOJK+4B/wnIZ8TGRvb9OB8EUM0w8uNYj/oa9iK9AMoy6gA72o02srMxpAPUD+EDnVEF7P5xw896VyAbFk8MgnpVpR3gfLnt/wECq3rYFvYLcKCpqvcI+/hVl8AumXDeApklDRRKJSS+KOaq1Rgg4igOYtiQK1hJy46TBtDjznDp3iqJff5j0/LfSZbYVdauqXccJ9W+czupp0sU9gMlqkQ52lU1E6tUwoDUukAD6YRpAwqDrAErzA8QCRvXm98KEep0xIdY1CN1ye27IP0IHvvYIW18qGz8S7VWUZuMkUOb3P8DHTl67ur/i1UAAAAASUVORK5CYII="}))),this.defaultLocale=Ov,this.i18nInit(),this.title=this.i18n("pluginNameInstagram"),this.opts.companionAllowedHosts=Qe(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Ye(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"instagram",pluginId:this.id,supportsRefreshToken:!1}),this.onFirstRender=this.onFirstRender.bind(this),this.render=this.render.bind(this)}install(){this.view=new Me(this,{provider:this.provider,viewType:"grid",showTitles:!1,showFilter:!1,showBreadcrumbs:!1});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}async onFirstRender(){await Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder("recent")])}render(e){return this.view.render(e)}};Lr.VERSION=YP.version;var Cv={strings:{pluginNameOneDrive:"OneDrive"}};var QP={version:"3.4.0"},Nr=class extends ne{static{o(this,"OneDrive")}constructor(e,t){super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||Je,this.id=this.opts.id||"OneDrive",this.icon=()=>c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("g",{fill:"none",fillRule:"nonzero"},c("path",{d:"M13.39 12.888l4.618 2.747 2.752-1.15a4.478 4.478 0 012.073-.352 6.858 6.858 0 00-5.527-5.04 6.895 6.895 0 00-6.876 2.982l.07-.002a5.5 5.5 0 012.89.815z",fill:"#0364B8"}),c("path",{d:"M13.39 12.887v.001a5.5 5.5 0 00-2.89-.815l-.07.002a5.502 5.502 0 00-4.822 2.964 5.43 5.43 0 00.38 5.62l4.073-1.702 1.81-.757 4.032-1.685 2.105-.88-4.619-2.748z",fill:"#0078D4"}),c("path",{d:"M22.833 14.133a4.479 4.479 0 00-2.073.352l-2.752 1.15.798.475 2.616 1.556 1.141.68 3.902 2.321a4.413 4.413 0 00-.022-4.25 4.471 4.471 0 00-3.61-2.284z",fill:"#1490DF"}),c("path",{d:"M22.563 18.346l-1.141-.68-2.616-1.556-.798-.475-2.105.88L11.87 18.2l-1.81.757-4.073 1.702A5.503 5.503 0 0010.5 23h12.031a4.472 4.472 0 003.934-2.333l-3.902-2.321z",fill:"#28A8EA"}))),this.opts.companionAllowedHosts=Qe(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Ye(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"onedrive",pluginId:this.id,supportsRefreshToken:!1}),this.defaultLocale=Cv,this.i18nInit(),this.title=this.i18n("pluginNameOneDrive"),this.onFirstRender=this.onFirstRender.bind(this),this.render=this.render.bind(this)}install(){this.view=new Me(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}async onFirstRender(){await Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder()])}render(e){return this.view.render(e)}};Nr.VERSION=QP.version;var JP={version:"3.3.1"},Mr=class extends ne{static{o(this,"Unsplash")}constructor(e,t){if(super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||Je,this.id=this.opts.id||"Unsplash",this.title=this.opts.title||"Unsplash",this.icon=()=>c("svg",{className:"uppy-DashboardTab-iconUnsplash",viewBox:"0 0 32 32",height:"32",width:"32","aria-hidden":"true"},c("g",{fill:"currentcolor"},c("path",{d:"M46.575 10.883v-9h12v9zm12 5h10v18h-32v-18h10v9h12z"}),c("path",{d:"M13 12.5V8h6v4.5zm6 2.5h5v9H8v-9h5v4.5h6z"}))),!this.opts.companionUrl)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");this.hostname=this.opts.companionUrl,this.opts.companionAllowedHosts=Qe(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Os(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule,provider:"unsplash",pluginId:this.id})}install(){this.view=new wr(this,{provider:this.provider,viewType:"unsplash",showFilter:!0});let{target:e}=this.opts;e&&this.mount(e,this)}async onFirstRender(){}render(e){return this.view.render(e)}uninstall(){this.unmount()}};Mr.VERSION=JP.version;function Av(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Av,"_classPrivateFieldLooseBase");var ZP=0;function e_(i){return"__private_"+ZP+++"_"+i}o(e_,"_classPrivateFieldLooseKey");var Ta=e_("handleSubmit"),Ad=class extends Ae{static{o(this,"UrlUI")}constructor(e){super(e),this.form=document.createElement("form"),Object.defineProperty(this,Ta,{writable:!0,value:t=>{t.preventDefault();let{addFile:r}=this.props,s=this.input.value.trim();r(s)}}),this.form.id=Xt()}componentDidMount(){this.input.value="",this.form.addEventListener("submit",Av(this,Ta)[Ta]),document.body.appendChild(this.form)}componentWillUnmount(){this.form.removeEventListener("submit",Av(this,Ta)[Ta]),document.body.removeChild(this.form)}render(){let{i18n:e}=this.props;return c("div",{className:"uppy-Url"},c("input",{className:"uppy-u-reset uppy-c-textInput uppy-Url-input",type:"text","aria-label":e("enterUrlToImport"),placeholder:e("enterUrlToImport"),ref:t=>{this.input=t},"data-uppy-super-focusable":!0,form:this.form.id}),c("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Url-importButton",type:"submit",form:this.form.id},e("import")))}},Tv=Ad;function $u(i,e,t){let r=nt(i.items),s;switch(e){case"paste":{if(r.some(a=>a.kind==="file"))return;s=r.filter(a=>a.kind==="string"&&a.type==="text/plain");break}case"drop":{s=r.filter(n=>n.kind==="string"&&n.type==="text/uri-list");break}default:throw new Error(`isDropOrPaste must be either 'drop' or 'paste', but it's ${e}`)}s.forEach(n=>{n.getAsString(a=>t(a))})}o($u,"forEachDroppedOrPastedUrl");var Rv={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"}};var kv,t_={version:"3.6.1"};function i_(){return c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("path",{d:"M23.637 15.312l-2.474 2.464a3.582 3.582 0 01-.577.491c-.907.657-1.897.986-2.968.986a4.925 4.925 0 01-3.959-1.971c-.248-.329-.164-.902.165-1.149.33-.247.907-.164 1.155.164 1.072 1.478 3.133 1.724 4.618.656a.642.642 0 00.33-.328l2.473-2.463c1.238-1.313 1.238-3.366-.082-4.597a3.348 3.348 0 00-4.618 0l-1.402 1.395a.799.799 0 01-1.154 0 .79.79 0 010-1.15l1.402-1.394a4.843 4.843 0 016.843 0c2.062 1.805 2.144 5.007.248 6.896zm-8.081 5.664l-1.402 1.395a3.348 3.348 0 01-4.618 0c-1.319-1.23-1.319-3.365-.082-4.596l2.475-2.464.328-.328c.743-.492 1.567-.739 2.475-.657.906.165 1.648.574 2.143 1.314.248.329.825.411 1.155.165.33-.248.412-.822.165-1.15-.825-1.068-1.98-1.724-3.216-1.888-1.238-.247-2.556.082-3.628.902l-.495.493-2.474 2.464c-1.897 1.969-1.814 5.09.083 6.977.99.904 2.226 1.396 3.463 1.396s2.473-.492 3.463-1.395l1.402-1.396a.79.79 0 000-1.15c-.33-.328-.908-.41-1.237-.082z",fill:"#FF753E","fill-rule":"nonzero"}))}o(i_,"UrlIcon");function r_(i){let e=/^[a-z0-9]+:\/\//,t="http://";return e.test(i)?i:t+i}o(r_,"addProtocolToURL");function s_(i){return nt(i.dataTransfer.items).filter(r=>r.kind==="string"&&r.type==="text/uri-list").length>0}o(s_,"canHandleRootDrop");function o_(i){return i?.startsWith("http://")||i?.startsWith("https://")}o(o_,"checkIfCorrectURL");function n_(i){let{pathname:e}=new URL(i);return e.substring(e.lastIndexOf("/")+1)}o(n_,"getFileNameFromUrl");var Ei=class i extends ne{static{o(this,"Url")}constructor(e,t){if(super(e,t),this.getMeta=r=>this.client.post("url/meta",{url:r}).then(s=>{if(s.error)throw this.uppy.log("[URL] Error:"),this.uppy.log(s.error),new Error("Failed to fetch the file");return s}),this.addFile=async(r,s)=>{let n=r_(r);if(!o_(n)){this.uppy.log(`[URL] Incorrect URL entered: ${n}`),this.uppy.info(this.i18n("enterCorrectUrl"),"error",4e3);return}try{let a=await this.getMeta(n),l={meta:s,source:this.id,name:a.name||n_(n),type:a.type,data:{size:a.size},isRemote:!0,body:{url:n},remote:{companionUrl:this.opts.companionUrl,url:`${this.hostname}/url/get`,body:{fileId:n,url:n},requestClientId:i.requestClientId}};this.uppy.log("[Url] Adding remote file");try{return this.uppy.addFile(l)}catch(u){return u.isRestriction||this.uppy.log(u),u}}catch(a){return this.uppy.log(a),this.uppy.info({message:this.i18n("failedToFetch"),details:a},"error",4e3),a}},this.handleRootDrop=r=>{$u(r.dataTransfer,"drop",s=>{this.uppy.log(`[URL] Adding file from dropped url: ${s}`),this.addFile(s)})},this.handleRootPaste=r=>{$u(r.clipboardData,"paste",s=>{this.uppy.log(`[URL] Adding file from pasted url: ${s}`),this.addFile(s)})},this.id=this.opts.id||"Url",this.title=this.opts.title||"Link",this.type="acquirer",this.icon=()=>c(i_,null),this.defaultLocale=Rv,this.i18nInit(),this.hostname=this.opts.companionUrl,!this.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");this.client=new It(e,{pluginId:this.id,provider:"url",companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule}),this.uppy.registerRequestClient(i.requestClientId,this.client)}render(){return c(Tv,{i18n:this.i18n,addFile:this.addFile})}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};kv=Ei;Ei.VERSION=t_.version;Ei.requestClientId=kv.name;Ei.prototype.canHandleRootDrop=s_;var Uv={strings:{pluginNameZoom:"Zoom"}};var a_={version:"2.3.1"},Br=class extends ne{static{o(this,"Zoom")}constructor(e,t){super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||Je,this.id=this.opts.id||"Zoom",this.icon=()=>c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("path",{d:"M24.5 11.125l-2.75 2.063c-.473.353-.75.91-.75 1.5v3.124c0 .59.277 1.147.75 1.5l2.75 2.063a.938.938 0 001.5-.75v-8.75a.938.938 0 00-1.5-.75zm-4.75 9.5c0 1.035-.84 1.875-1.875 1.875H9.75A3.75 3.75 0 016 18.75v-6.875C6 10.84 6.84 10 7.875 10H16a3.75 3.75 0 013.75 3.75v6.875z",fill:"#2E8CFF","fill-rule":"evenodd"})),this.opts.companionAllowedHosts=Qe(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new Ye(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"zoom",pluginId:this.id,supportsRefreshToken:!1}),this.defaultLocale=Uv,this.i18nInit(),this.title=this.i18n("pluginNameZoom"),this.onFirstRender=this.onFirstRender.bind(this),this.render=this.render.bind(this)}install(){this.view=new Me(this,{provider:this.provider});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}async onFirstRender(){await Promise.all([this.provider.fetchPreAuthToken(),this.view.getFolder()])}render(e){return this.view.render(e)}};Br.VERSION=a_.version;function Td(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Td,"_classPrivateFieldLooseBase");var l_=0;function u_(i){return"__private_"+l_+++"_"+i}o(u_,"_classPrivateFieldLooseKey");var c_={version:"1.3.0"},Rd={__proto__:null,Box:Rr,Dropbox:kr,Facebook:Ur,GoogleDrive:Dr,GooglePhotos:Ir,Instagram:Lr,OneDrive:Nr,Unsplash:Mr,Url:Ei,Zoom:Br},h_={sources:Object.keys(Rd)},Qs=u_("installedPlugins"),Ko=class extends Ee{static{o(this,"RemoteSources")}constructor(e,t){if(super(e,{...h_,...t}),Object.defineProperty(this,Qs,{writable:!0,value:new Set}),this.id=this.opts.id||"RemoteSources",this.type="preset",this.opts.companionUrl==null)throw new Error("Please specify companionUrl for RemoteSources to work, see https://uppy.io/docs/remote-sources#companionUrl")}setOptions(e){this.uninstall(),super.setOptions(e),this.install()}install(){this.opts.sources.forEach(e=>{let t={...this.opts,sources:void 0},r=Rd[e];if(r==null){let s=Object.keys(Rd),n=new Intl.ListFormat("en",{style:"long",type:"disjunction"});throw new Error(`Invalid plugin: "${e}" is not one of: ${n.format(s)}.`)}this.uppy.use(r,t),Td(this,Qs)[Qs].add(this.uppy.getPlugin(e))})}uninstall(){for(let e of Td(this,Qs)[Qs])this.uppy.removePlugin(e);Td(this,Qs)[Qs].clear()}};Ko.VERSION=c_.version;function kd(){return c("svg",{className:"uppy-DashboardTab-iconScreenRec","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("g",{fill:"currentcolor",fillRule:"evenodd"},c("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"}),c("circle",{cx:"16",cy:"16",r:"2"})))}o(kd,"ScreenRecIcon");function Ud(i){let{recording:e,onStartRecording:t,onStopRecording:r,i18n:s}=i;return e?c("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video uppy-ScreenCapture-button--stop-rec",type:"button",title:s("stopCapturing"),"aria-label":s("stopCapturing"),onClick:r,"data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},c("rect",{x:"15",y:"15",width:"70",height:"70"}))):c("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--video",type:"button",title:s("startCapturing"),"aria-label":s("startCapturing"),onClick:t,"data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},c("circle",{cx:"50",cy:"50",r:"40"})))}o(Ud,"RecordButton");function Dd(i){let{recording:e,recordedVideo:t,onSubmit:r,i18n:s}=i;return t&&!e?c("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--submit",type:"button",title:s("submitRecordedFile"),"aria-label":s("submitRecordedFile"),onClick:r,"data-uppy-super-focusable":!0},c("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"},c("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"}))):null}o(Dd,"SubmitButton");function d_(i){return(i-(i%=60))/60+(i>9?":":":0")+i}o(d_,"fmtMSS");var Id=class extends Ae{static{o(this,"StopWatch")}constructor(e){super(e),this.wrapperStyle={width:"100%",height:"100%",display:"flex"},this.overlayStyle={position:"absolute",width:"100%",height:"100%",background:"black",opacity:.7},this.infoContainerStyle={marginLeft:"auto",marginRight:"auto",marginTop:"auto",marginBottom:"auto",zIndex:1,color:"white"},this.infotextStyle={marginLeft:"auto",marginRight:"auto",marginBottom:"1rem",fontSize:"1.5rem"},this.timeStyle={display:"block",fontWeight:"bold",marginLeft:"auto",marginRight:"auto",fontSize:"3rem",fontFamily:"Courier New"},this.state={elapsedTime:0}}startTimer(){this.timerTick(),this.timerRunning=!0}resetTimer(){clearTimeout(this.timer),this.setState({elapsedTime:0}),this.timerRunning=!1}timerTick(){this.timer=setTimeout(()=>{this.setState(e=>({elapsedTime:e.elapsedTime+1})),this.timerTick()},1e3)}render(){let{recording:e,i18n:t}={...this.props},{elapsedTime:r}=this.state,s=d_(r);return e&&!this.timerRunning&&this.startTimer(),!e&&this.timerRunning&&this.resetTimer(),e?c("div",{style:this.wrapperStyle},c("div",{style:this.overlayStyle}),c("div",{style:this.infoContainerStyle},c("div",{style:this.infotextStyle},t("recording")),c("div",{style:this.timeStyle},s))):null}},Dv=Id;function Ld(i){let{streamActive:e,i18n:t}=i;return e?c("div",{title:t("streamActive"),"aria-label":t("streamActive"),className:"uppy-ScreenCapture-icon--stream uppy-ScreenCapture-icon--streamActive"},c("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),c("path",{d:"M0 0h24v24H0z",fill:"none"}),c("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"}))):c("div",{title:t("streamPassive"),"aria-label":t("streamPassive"),className:"uppy-ScreenCapture-icon--stream"},c("svg",{"aria-hidden":"true",focusable:"false",width:"24",height:"24",viewBox:"0 0 24 24"},c("path",{d:"M0 0h24v24H0z",opacity:".1",fill:"none"}),c("path",{d:"M0 0h24v24H0z",fill:"none"}),c("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"})))}o(Ld,"StreamStatus");function Nd(){return Nd=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Nd.apply(this,arguments)}o(Nd,"_extends");var Md=class extends Ae{static{o(this,"RecorderScreen")}componentWillUnmount(){let{onStop:e}=this.props;e()}render(){let{recording:e,stream:t,recordedVideo:r}=this.props,s={playsinline:!0};return(e||!r&&!e)&&(s.muted=!0,s.autoplay=!0,s.srcObject=t),r&&!e&&(s.muted=!1,s.controls=!0,s.src=r,this.videoElement&&(this.videoElement.srcObject=null)),c("div",{className:"uppy uppy-ScreenCapture-container"},c("div",{className:"uppy-ScreenCapture-videoContainer"},c(Ld,this.props),c("video",Nd({ref:n=>{this.videoElement=n},className:"uppy-ScreenCapture-video"},s)),c(Dv,this.props)),c("div",{className:"uppy-ScreenCapture-buttonContainer"},c(Ud,this.props),c(Dd,this.props)))}},Iv=Md;var Lv={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"}};function Bd(){return Bd=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Bd.apply(this,arguments)}o(Bd,"_extends");var p_={version:"3.2.0"};function f_(){var i;return window.MediaRecorder&&((i=navigator.mediaDevices)==null?void 0:i.getDisplayMedia)}o(f_,"isScreenRecordingSupported");function m_(){return window.MediaRecorder&&navigator.mediaDevices}o(m_,"getMediaDevices");var g_={displayMediaConstraints:{video:{width:1280,height:720,frameRate:{ideal:3,max:5},cursor:"motion",displaySurface:"monitor"}},userMediaConstraints:{audio:!0},preferredVideoMimeType:"video/webm"},Js=class extends ne{static{o(this,"ScreenCapture")}constructor(e,t){super(e,{...g_,...t}),this.mediaDevices=m_(),this.protocol=location.protocol==="https:"?"https":"http",this.id=this.opts.id||"ScreenCapture",this.title=this.opts.title||"Screencast",this.type="acquirer",this.icon=kd,this.defaultLocale=Lv,this.i18nInit(),this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.submit=this.submit.bind(this),this.streamInterrupted=this.streamInactivated.bind(this),this.captureActive=!1,this.capturedMediaFile=null}install(){if(!f_())return this.uppy.log("Screen recorder access is not supported","warning"),null;this.setPluginState({streamActive:!1,audioStreamActive:!1});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.videoStream&&this.stop(),this.unmount()}start(){return this.mediaDevices?(this.captureActive=!0,this.selectAudioStreamSource(),this.selectVideoStreamSource().then(e=>{e===!1&&this.parent&&this.parent.hideAllPanels&&(this.parent.hideAllPanels(),this.captureActive=!1)})):Promise.reject(new Error("Screen recorder access not supported"))}selectVideoStreamSource(){return this.videoStream?new Promise(e=>e(this.videoStream)):this.mediaDevices.getDisplayMedia(this.opts.displayMediaConstraints).then(e=>(this.videoStream=e,this.videoStream.addEventListener("inactive",()=>{this.streamInactivated()}),this.setPluginState({streamActive:!0}),e)).catch(e=>(this.setPluginState({screenRecError:e}),this.userDenied=!0,setTimeout(()=>{this.userDenied=!1},1e3),!1))}selectAudioStreamSource(){return this.audioStream?new Promise(e=>e(this.audioStream)):this.mediaDevices.getUserMedia(this.opts.userMediaConstraints).then(e=>(this.audioStream=e,this.setPluginState({audioStreamActive:!0}),e)).catch(e=>(e.name==="NotAllowedError"&&(this.uppy.info(this.i18n("micDisabled"),"error",5e3),this.uppy.log(this.i18n("micDisabled"),"warning")),!1))}startRecording(){let e={};this.capturedMediaFile=null,this.recordingChunks=[];let{preferredVideoMimeType:t}=this.opts;this.selectVideoStreamSource().then(r=>{if(r===!1)throw new Error("No video stream available");t&&MediaRecorder.isTypeSupported(t)&&Ji(t)&&(e.mimeType=t);let s=[r.getVideoTracks()[0]];this.audioStream&&s.push(this.audioStream.getAudioTracks()[0]),this.outputStream=new MediaStream(s),this.recorder=new MediaRecorder(this.outputStream,e),this.recorder.addEventListener("dataavailable",n=>{this.recordingChunks.push(n.data)}),this.recorder.start(),this.setPluginState({recording:!0})}).catch(r=>{this.uppy.log(r,"error")})}streamInactivated(){let{recordedVideo:e,recording:t}={...this.getPluginState()};!e&&!t?this.parent&&this.parent.hideAllPanels&&this.parent.hideAllPanels():t&&(this.uppy.log("Capture stream inactive \u2014 stop recording"),this.stopRecording()),this.videoStream=null,this.audioStream=null,this.setPluginState({streamActive:!1,audioStreamActive:!1})}stopRecording(){return new Promise(t=>{this.recorder.addEventListener("stop",()=>{t()}),this.recorder.stop()}).then(()=>(this.setPluginState({recording:!1}),this.getVideo())).then(t=>{this.capturedMediaFile=t,this.setPluginState({recordedVideo:URL.createObjectURL(t.data)})}).then(()=>{this.recordingChunks=null,this.recorder=null},t=>{throw this.recordingChunks=null,this.recorder=null,t})}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"warning")}}stop(){this.videoStream&&(this.videoStream.getVideoTracks().forEach(e=>{e.stop()}),this.videoStream.getAudioTracks().forEach(e=>{e.stop()}),this.videoStream=null),this.audioStream&&(this.audioStream.getAudioTracks().forEach(e=>{e.stop()}),this.audioStream.getVideoTracks().forEach(e=>{e.stop()}),this.audioStream=null),this.outputStream&&(this.outputStream.getAudioTracks().forEach(e=>{e.stop()}),this.outputStream.getVideoTracks().forEach(e=>{e.stop()}),this.outputStream=null),this.setPluginState({recordedVideo:null}),this.captureActive=!1}getVideo(){let e=this.recordingChunks[0].type,t=Ji(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));let r=`screencap-${Date.now()}.${t}`,s=new Blob(this.recordingChunks,{type:e}),n={source:this.id,name:r,data:new Blob([s],{type:e}),type:e};return Promise.resolve(n)}render(){let e=this.getPluginState();return!e.streamActive&&!this.captureActive&&!this.userDenied&&this.start(),c(Iv,Bd({},e,{onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onStop:this.stop,onSubmit:this.submit,i18n:this.i18n,stream:this.videoStream}))}};Js.VERSION=p_.version;var qv=be(Nv(),1);function zd(i,e,t){return new Promise(r=>{i.toBlob(r,e,t)})}o(zd,"canvasToBlob");function Hd(){return typeof MediaRecorder=="function"&&!!MediaRecorder.prototype&&typeof MediaRecorder.prototype.start=="function"}o(Hd,"supportsMediaRecorder");function Ra(){return c("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55"},c("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"}))}o(Ra,"CameraIcon");function qd(i){let{onSnapshot:e,i18n:t}=i;return c("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:t("takePicture"),"aria-label":t("takePicture"),onClick:e,"data-uppy-super-focusable":!0},Ra())}o(qd,"SnapshotButton");function $d(i){let{recording:e,onStartRecording:t,onStopRecording:r,i18n:s}=i;return e?c("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:s("stopRecording"),"aria-label":s("stopRecording"),onClick:r,"data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},c("rect",{x:"15",y:"15",width:"70",height:"70"}))):c("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:s("startRecording"),"aria-label":s("startRecording"),onClick:t,"data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100"},c("circle",{cx:"50",cy:"50",r:"40"})))}o($d,"RecordButton");function Vd(i){return`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`}o(Vd,"formatSeconds");function Wd(i){let{recordingLengthSeconds:e,i18n:t}=i,r=Vd(e);return c("span",{"aria-label":t("recordingLength",{recording_length:r})},r)}o(Wd,"RecordingLength");function Gd(i){let{currentDeviceId:e,videoSources:t,onChangeVideoSource:r}=i;return c("div",{className:"uppy-Webcam-videoSource"},c("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:s=>{r(s.target.value)}},t.map(s=>c("option",{key:s.deviceId,value:s.deviceId,selected:s.deviceId===e},s.label))))}o(Gd,"VideoSourceSelect");function w_(i){let{onSubmit:e,i18n:t}=i;return c("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:t("submitRecordedFile"),"aria-label":t("submitRecordedFile"),onClick:e,"data-uppy-super-focusable":!0},c("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"},c("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})))}o(w_,"SubmitButton");var Mv=w_;function S_(i){let{onDiscard:e,i18n:t}=i;return c("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard",type:"button",title:t("discardRecordedFile"),"aria-label":t("discardRecordedFile"),onClick:e,"data-uppy-super-focusable":!0},c("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"},c("g",{fill:"#FFF",fillRule:"evenodd"},c("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),c("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"}))))}o(S_,"DiscardButton");var Bv=S_;function Kd(){return Kd=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Kd.apply(this,arguments)}o(Kd,"_extends");function Wu(i,e){return i.includes(e)}o(Wu,"isModeAvailable");var Xd=class extends Ae{static{o(this,"CameraScreen")}componentDidMount(){let{onFocus:e}=this.props;e()}componentWillUnmount(){let{onStop:e}=this.props;e()}render(){let{src:e,recordedVideo:t,recording:r,modes:s,supportsRecording:n,videoSources:a,showVideoSourceDropdown:l,showRecordingLength:u,onSubmit:h,i18n:d,mirror:f,onSnapshot:y,onStartRecording:w,onStopRecording:S,onDiscardRecordedVideo:T,recordingLengthSeconds:C}=this.props,_=!!t,R=!_&&n&&(Wu(s,"video-only")||Wu(s,"audio-only")||Wu(s,"video-audio")),q=!_&&Wu(s,"picture"),W=n&&u&&!_,K=l&&a&&a.length>1,$={playsInline:!0};return t?($.muted=!1,$.controls=!0,$.src=t,this.videoElement&&(this.videoElement.srcObject=null)):($.muted=!0,$.autoPlay=!0,$.srcObject=e),c("div",{className:"uppy uppy-Webcam-container"},c("div",{className:"uppy-Webcam-videoContainer"},c("video",Kd({ref:G=>this.videoElement=G,className:`uppy-Webcam-video ${f?"uppy-Webcam-video--mirrored":""}`},$))),c("div",{className:"uppy-Webcam-footer"},c("div",{className:"uppy-Webcam-videoSourceContainer"},K?Gd(this.props):null),c("div",{className:"uppy-Webcam-buttonContainer"},q&&c(qd,{onSnapshot:y,i18n:d}),R&&c($d,{recording:r,onStartRecording:w,onStopRecording:S,i18n:d}),_&&c(Mv,{onSubmit:h,i18n:d}),_&&c(Bv,{onDiscard:T,i18n:d})),c("div",{className:"uppy-Webcam-recordingLength"},W&&c(Wd,{recordingLengthSeconds:C,i18n:d}))))}},jv=Xd;function Yd(i){let{icon:e,i18n:t,hasCamera:r}=i;return c("div",{className:"uppy-Webcam-permissons"},c("div",{className:"uppy-Webcam-permissonsIcon"},e()),c("h1",{className:"uppy-Webcam-title"},t(r?"allowAccessTitle":"noCameraTitle")),c("p",null,t(r?"allowAccessDescription":"noCameraDescription")))}o(Yd,"PermissionsScreen");var zv={strings:{pluginNameCamera:"Camera",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",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file",smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",recordingLength:"Recording length %{recording_length}",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."}};function Jd(){return Jd=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},Jd.apply(this,arguments)}o(Jd,"_extends");function ka(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(ka,"_classPrivateFieldLooseBase");var P_=0;function __(i){return"__private_"+P_+++"_"+i}o(__,"_classPrivateFieldLooseKey");var x_={version:"3.4.2"};function Hv(i){return i[0]==="."?wn[i.slice(1)]:i}o(Hv,"toMimeType");function F_(i){return/^video\/[^*]+$/.test(i)}o(F_,"isVideoMimeType");function E_(i){return/^image\/[^*]+$/.test(i)}o(E_,"isImageMimeType");function O_(){return navigator.mediaDevices}o(O_,"getMediaDevices");function Qd(i,e){return i.includes(e)}o(Qd,"isModeAvailable");var C_={onBeforeSnapshot:()=>Promise.resolve(),countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,facingMode:"user",preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1,mobileNativeCamera:(0,qv.default)({tablet:!0})},Mi=__("enableMirror"),Zs=class extends ne{static{o(this,"Webcam")}constructor(e,t){super(e,{...C_,...t}),Object.defineProperty(this,Mi,{writable:!0,value:void 0}),this.mediaDevices=O_(),this.supportsUserMedia=!!this.mediaDevices,this.protocol=location.protocol.match(/https/i)?"https":"http",this.id=this.opts.id||"Webcam",this.type="acquirer",this.capturedMediaFile=null,this.icon=()=>c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},c("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383",fillRule:"nonzero"})),this.defaultLocale=zv,this.i18nInit(),this.title=this.i18n("pluginNameCamera"),ka(this,Mi)[Mi]=this.opts.mirror,this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.takeSnapshot=this.takeSnapshot.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.discardRecordedVideo=this.discardRecordedVideo.bind(this),this.submit=this.submit.bind(this),this.oneTwoThreeSmile=this.oneTwoThreeSmile.bind(this),this.focus=this.focus.bind(this),this.changeVideoSource=this.changeVideoSource.bind(this),this.webcamActive=!1,this.opts.countdown&&(this.opts.onBeforeSnapshot=this.oneTwoThreeSmile),this.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null})}setOptions(e){super.setOptions({...e,videoConstraints:{...this.opts.videoConstraints,...e?.videoConstraints}})}hasCameraCheck(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then(e=>e.some(t=>t.kind==="videoinput")):Promise.resolve(!1)}isAudioOnly(){return this.opts.modes.length===1&&this.opts.modes[0]==="audio-only"}getConstraints(e){e===void 0&&(e=null);let t=this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("audio-only")!==-1,r=!this.isAudioOnly()&&(this.opts.modes.indexOf("video-audio")!==-1||this.opts.modes.indexOf("video-only")!==-1||this.opts.modes.indexOf("picture")!==-1),s={...this.opts.videoConstraints||{facingMode:this.opts.facingMode},...e?{deviceId:e,facingMode:null}:{}};return{audio:t,video:r?s:!1}}start(e){var t;if(e===void 0&&(e=null),!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror&&(ka(this,Mi)[Mi]=!0);let r=this.getConstraints((t=e)==null?void 0:t.deviceId);this.hasCameraCheck().then(s=>(this.setPluginState({hasCamera:s}),this.mediaDevices.getUserMedia(r).then(n=>{this.stream=n;let a=null,l=this.isAudioOnly()?n.getAudioTracks():n.getVideoTracks();!e||!e.deviceId?a=l[0].getSettings().deviceId:l.forEach(u=>{u.getSettings().deviceId===e.deviceId&&(a=u.getSettings().deviceId)}),this.updateVideoSources(),this.setPluginState({currentDeviceId:a,cameraReady:!0})}).catch(n=>{this.setPluginState({cameraReady:!1,cameraError:n}),this.uppy.info(n.message,"error")})))}getMediaRecorderOptions(){let e={};if(MediaRecorder.isTypeSupported){let{restrictions:t}=this.uppy.opts,r=[];this.opts.preferredVideoMimeType?r=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(r=t.allowedFileTypes.map(Hv).filter(F_));let s=o(a=>MediaRecorder.isTypeSupported(a)&&Ji(a),"filterSupportedTypes"),n=r.filter(s);n.length>0&&(e.mimeType=n[0])}return e}startRecording(){this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];let e=!1;this.recorder.addEventListener("dataavailable",t=>{this.recordingChunks.push(t.data);let{restrictions:r}=this.uppy.opts;if(this.recordingChunks.length>1&&r.maxFileSize!=null&&!e){let s=this.recordingChunks.reduce((u,h)=>u+h.size,0),a=(s-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3,l=Math.max(0,r.maxFileSize-a);s>l&&(e=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),this.stopRecording())}}),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval(()=>{let t=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:t+1})},1e3)),this.setPluginState({isRecording:!0})}stopRecording(){return new Promise(t=>{this.recorder.addEventListener("stop",()=>{t()}),this.recorder.stop(),this.opts.showRecordingLength&&(clearInterval(this.recordingLengthTimer),this.setPluginState({recordingLengthSeconds:0}))}).then(()=>(this.setPluginState({isRecording:!1}),this.getVideo())).then(t=>{try{this.capturedMediaFile=t,this.setPluginState({recordedVideo:URL.createObjectURL(t.data)}),ka(this,Mi)[Mi]=!1}catch(r){r.isRestriction||this.uppy.log(r)}}).then(()=>{this.recordingChunks=null,this.recorder=null},t=>{throw this.recordingChunks=null,this.recorder=null,t})}discardRecordedVideo(){this.setPluginState({recordedVideo:null}),this.opts.mirror&&(ka(this,Mi)[Mi]=!0),this.capturedMediaFile=null}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}}async stop(){if(this.stream){let e=this.stream.getAudioTracks(),t=this.stream.getVideoTracks();e.concat(t).forEach(r=>r.stop())}this.recorder&&await new Promise(e=>{this.recorder.addEventListener("stop",e,{once:!0}),this.recorder.stop(),this.opts.showRecordingLength&&clearInterval(this.recordingLengthTimer)}),this.recordingChunks=null,this.recorder=null,this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null,isRecording:!1,recordingLengthSeconds:0})}getVideoElement(){return this.el.querySelector(".uppy-Webcam-video")}oneTwoThreeSmile(){return new Promise((e,t)=>{let r=this.opts.countdown,s=setInterval(()=>{if(!this.webcamActive)return clearInterval(s),this.captureInProgress=!1,t(new Error("Webcam is not active"));r?(this.uppy.info(`${r}...`,"warning",800),r--):(clearInterval(s),this.uppy.info(this.i18n("smile"),"success",1500),setTimeout(()=>e(),1500))},1e3)})}takeSnapshot(){this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch(e=>{let t=typeof e=="object"?e.message:e;return this.uppy.info(t,"error",5e3),Promise.reject(new Error(`onBeforeSnapshot: ${t}`))}).then(()=>this.getImage()).then(e=>{this.captureInProgress=!1;try{this.uppy.addFile(e)}catch(t){t.isRestriction||this.uppy.log(t)}},e=>{throw this.captureInProgress=!1,e}))}getImage(){let e=this.getVideoElement();if(!e)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));let t=e.videoWidth,r=e.videoHeight,s=document.createElement("canvas");s.width=t,s.height=r,s.getContext("2d").drawImage(e,0,0);let{restrictions:a}=this.uppy.opts,l=[];this.opts.preferredImageMimeType?l=[this.opts.preferredImageMimeType]:a.allowedFileTypes&&(l=a.allowedFileTypes.map(Hv).filter(E_));let u=l[0]||"image/jpeg",h=Ji(u)||"jpg",d=`cam-${Date.now()}.${h}`;return zd(s,u).then(f=>({source:this.id,name:d,data:new Blob([f],{type:u}),type:u}))}getVideo(){let e=this.recordingChunks.find(a=>{var l;return((l=a.type)==null?void 0:l.length)>0}).type,t=Ji(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));let r=`webcam-${Date.now()}.${t}`,s=new Blob(this.recordingChunks,{type:e}),n={source:this.id,name:r,data:new Blob([s],{type:e}),type:e};return Promise.resolve(n)}focus(){this.opts.countdown&&setTimeout(()=>{this.uppy.info(this.i18n("smile"),"success",1500)},1e3)}changeVideoSource(e){this.stop(),this.start({deviceId:e})}updateVideoSources(){this.mediaDevices.enumerateDevices().then(e=>{this.setPluginState({videoSources:e.filter(t=>t.kind==="videoinput")})})}render(){this.webcamActive||this.start();let e=this.getPluginState();return!e.cameraReady||!e.hasCamera?c(Yd,{icon:Ra,i18n:this.i18n,hasCamera:e.hasCamera}):c(jv,Jd({},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:Hd(),recording:e.isRecording,mirror:ka(this,Mi)[Mi],src:this.stream}))}install(){let{mobileNativeCamera:e,modes:t,facingMode:r,videoConstraints:s}=this.opts,{target:n}=this.opts;if(e&&n){var a;(a=this.getTargetPlugin(n))==null||a.setOptions({showNativeVideoCameraButton:Qd(t,"video-only")||Qd(t,"video-audio"),showNativePhotoCameraButton:Qd(t,"picture"),nativeCameraFacingMode:s?.facingMode||r});return}this.setPluginState({cameraReady:!1,recordingLengthSeconds:0}),n&&this.mount(n,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=()=>{if(this.updateVideoSources(),this.stream){let l=!0,{videoSources:u,currentDeviceId:h}=this.getPluginState();u.forEach(d=>{h===d.deviceId&&(l=!1)}),l&&(this.stop(),this.start())}})}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}};Zs.VERSION=x_.version;function jr(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(jr,"_classPrivateFieldLooseBase");var A_=0;function $v(i){return"__private_"+A_+++"_"+i}o($v,"_classPrivateFieldLooseKey");var jt=$v("uppy"),Ua=$v("events"),zr=class{static{o(this,"EventManager")}constructor(e){Object.defineProperty(this,jt,{writable:!0,value:void 0}),Object.defineProperty(this,Ua,{writable:!0,value:[]}),jr(this,jt)[jt]=e}on(e,t){return jr(this,Ua)[Ua].push([e,t]),jr(this,jt)[jt].on(e,t)}remove(){for(let[e,t]of jr(this,Ua)[Ua].splice(0))jr(this,jt)[jt].off(e,t)}onFilePause(e,t){this.on("upload-pause",(r,s)=>{e===r&&t(s)})}onFileRemove(e,t){this.on("file-removed",r=>{e===r.id&&t(r.id)})}onPause(e,t){this.on("upload-pause",(r,s)=>{e===r&&t(s)})}onRetry(e,t){this.on("upload-retry",r=>{e===r&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{jr(this,jt)[jt].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{jr(this,jt)[jt].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){jr(r,jt)[jt].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{jr(this,jt)[jt].getFile(e)&&t()})}};function se(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(se,"_classPrivateFieldLooseBase");var T_=0;function Zt(i){return"__private_"+T_+++"_"+i}o(Zt,"_classPrivateFieldLooseKey");function R_(i){return new Error("Cancelled",{cause:i})}o(R_,"createCancelError");function Vv(i){if(i!=null){var e;let t=o(()=>this.abort(i.reason),"abortPromise");i.addEventListener("abort",t,{once:!0});let r=o(()=>{i.removeEventListener("abort",t)},"removeAbortListener");(e=this.then)==null||e.call(this,r,r)}return this}o(Vv,"abortOn");var pi=Zt("activeRequests"),Ht=Zt("queuedHandlers"),di=Zt("paused"),eo=Zt("pauseTimer"),zt=Zt("downLimit"),to=Zt("upperLimit"),Hr=Zt("rateLimitingTimer"),Da=Zt("call"),qr=Zt("queueNext"),tp=Zt("next"),Zd=Zt("queue"),ip=Zt("dequeue"),ep=Zt("resume"),io=Zt("increaseLimit"),Jt=class{static{o(this,"RateLimitedQueue")}constructor(e){Object.defineProperty(this,ip,{value:L_}),Object.defineProperty(this,Zd,{value:I_}),Object.defineProperty(this,tp,{value:D_}),Object.defineProperty(this,qr,{value:U_}),Object.defineProperty(this,Da,{value:k_}),Object.defineProperty(this,pi,{writable:!0,value:0}),Object.defineProperty(this,Ht,{writable:!0,value:[]}),Object.defineProperty(this,di,{writable:!0,value:!1}),Object.defineProperty(this,eo,{writable:!0,value:void 0}),Object.defineProperty(this,zt,{writable:!0,value:1}),Object.defineProperty(this,to,{writable:!0,value:void 0}),Object.defineProperty(this,Hr,{writable:!0,value:void 0}),Object.defineProperty(this,ep,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,io,{writable:!0,value:()=>{if(se(this,di)[di]){se(this,Hr)[Hr]=setTimeout(se(this,io)[io],0);return}se(this,zt)[zt]=this.limit,this.limit=Math.ceil((se(this,to)[to]+se(this,zt)[zt])/2);for(let t=se(this,zt)[zt];t<=this.limit;t++)se(this,qr)[qr]();se(this,to)[to]-se(this,zt)[zt]>3?se(this,Hr)[Hr]=setTimeout(se(this,io)[io],2e3):se(this,zt)[zt]=Math.floor(se(this,zt)[zt]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!se(this,di)[di]&&se(this,pi)[pi]<this.limit?se(this,Da)[Da](e):se(this,Zd)[Zd](e,t)}wrapSyncFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];let l=r.run(()=>(e(...n),queueMicrotask(()=>l.done()),()=>{}),t);return{abortOn:Vv,abort(){l.abort()}}}}wrapPromiseFunction(e,t){var r=this;return function(){for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];let l,u=new Promise((h,d)=>{l=r.run(()=>{let f,y;try{y=Promise.resolve(e(...n))}catch(w){y=Promise.reject(w)}return y.then(w=>{f?d(f):(l.done(),h(w))},w=>{f?d(f):(l.done(),d(w))}),w=>{f=R_(w)}},t)});return u.abort=h=>{l.abort(h)},u.abortOn=Vv,u}}resume(){se(this,di)[di]=!1,clearTimeout(se(this,eo)[eo]);for(let e=0;e<this.limit;e++)se(this,qr)[qr]()}pause(e){e===void 0&&(e=null),se(this,di)[di]=!0,clearTimeout(se(this,eo)[eo]),e!=null&&(se(this,eo)[eo]=setTimeout(se(this,ep)[ep],e))}rateLimit(e){clearTimeout(se(this,Hr)[Hr]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(se(this,to)[to]=this.limit-1,this.limit=se(this,zt)[zt],se(this,Hr)[Hr]=setTimeout(se(this,io)[io],e))}get isPaused(){return se(this,di)[di]}};function k_(i){se(this,pi)[pi]+=1;let e=!1,t;try{t=i()}catch(r){throw se(this,pi)[pi]-=1,r}return{abort:r=>{e||(e=!0,se(this,pi)[pi]-=1,t?.(r),se(this,qr)[qr]())},done:()=>{e||(e=!0,se(this,pi)[pi]-=1,se(this,qr)[qr]())}}}o(k_,"_call2");function U_(){queueMicrotask(()=>se(this,tp)[tp]())}o(U_,"_queueNext2");function D_(){if(se(this,di)[di]||se(this,pi)[pi]>=this.limit||se(this,Ht)[Ht].length===0)return;let i=se(this,Ht)[Ht].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=se(this,Da)[Da](i.fn);i.abort=e.abort,i.done=e.done}o(D_,"_next2");function I_(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{se(this,ip)[ip](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=se(this,Ht)[Ht].findIndex(s=>t.priority>s.priority);return r===-1?se(this,Ht)[Ht].push(t):se(this,Ht)[Ht].splice(r,0,t),t}o(I_,"_queue2");function L_(i){let e=se(this,Ht)[Ht].indexOf(i);e!==-1&&se(this,Ht)[Ht].splice(e,1)}o(L_,"_dequeue2");var ns=Symbol("__queue");function as(i){let e=o(t=>"error"in t&&!!t.error,"hasError");return i.filter(t=>!e(t))}o(as,"filterNonFailedFiles");function ls(i){return i.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}o(ls,"filterFilesToEmitUploadStarted");var{AbortController:Gu}=globalThis,{AbortSignal:r9}=globalThis,Ku=o(function(i,e){i===void 0&&(i="Aborted");let t=new DOMException(i,"AbortError");return e!=null&&oi(e,"cause")&&Object.defineProperty(t,"cause",{__proto__:null,configurable:!0,writable:!0,value:e.cause}),t},"createAbortError");function ee(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(ee,"_classPrivateFieldLooseBase");var N_=0;function pt(i){return"__private_"+N_+++"_"+i}o(pt,"_classPrivateFieldLooseKey");var M_=1024*1024,Wv={getChunkSize(i){return Math.ceil(i.size/1e4)},onProgress(){},onPartComplete(){},onSuccess(){},onError(i){throw i}};function B_(i){if(typeof i=="string")return parseInt(i,10);if(typeof i=="number")return i;throw new TypeError("Expected a number")}o(B_,"ensureInt");var ja=Symbol("pausing upload, not an actual error"),Et=pt("abortController"),dt=pt("chunks"),qt=pt("chunkState"),fi=pt("data"),mi=pt("file"),za=pt("uploadHasStarted"),Ia=pt("onError"),oo=pt("onSuccess"),$r=pt("shouldUseMultipart"),so=pt("isRestoring"),Ha=pt("onReject"),ro=pt("maxMultipartParts"),Na=pt("minPartSize"),rp=pt("initChunks"),sp=pt("createUpload"),La=pt("resumeUpload"),Ma=pt("onPartProgress"),Ba=pt("onPartComplete"),op=pt("abortUpload"),np=class{static{o(this,"MultipartUploader")}constructor(e,t){var r,s;Object.defineProperty(this,op,{value:q_}),Object.defineProperty(this,La,{value:H_}),Object.defineProperty(this,sp,{value:z_}),Object.defineProperty(this,rp,{value:j_}),Object.defineProperty(this,Et,{writable:!0,value:new Gu}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,qt,{writable:!0,value:void 0}),Object.defineProperty(this,fi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,za,{writable:!0,value:!1}),Object.defineProperty(this,Ia,{writable:!0,value:void 0}),Object.defineProperty(this,oo,{writable:!0,value:void 0}),Object.defineProperty(this,$r,{writable:!0,value:void 0}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,Ha,{writable:!0,value:n=>n?.cause===ja?null:ee(this,Ia)[Ia](n)}),Object.defineProperty(this,ro,{writable:!0,value:1e4}),Object.defineProperty(this,Na,{writable:!0,value:5*M_}),Object.defineProperty(this,Ma,{writable:!0,value:n=>a=>{if(!a.lengthComputable)return;ee(this,qt)[qt][n].uploaded=B_(a.loaded);let l=ee(this,qt)[qt].reduce((u,h)=>u+h.uploaded,0);this.options.onProgress(l,ee(this,fi)[fi].size)}}),Object.defineProperty(this,Ba,{writable:!0,value:n=>a=>{ee(this,dt)[dt][n]=null,ee(this,qt)[qt][n].etag=a,ee(this,qt)[qt][n].done=!0;let l={PartNumber:n+1,ETag:a};this.options.onPartComplete(l)}}),this.options={...Wv,...t},(s=(r=this.options).getChunkSize)!=null||(r.getChunkSize=Wv.getChunkSize),ee(this,fi)[fi]=e,ee(this,mi)[mi]=t.file,ee(this,oo)[oo]=this.options.onSuccess,ee(this,Ia)[Ia]=this.options.onError,ee(this,$r)[$r]=this.options.shouldUseMultipart,ee(this,so)[so]=t.uploadId&&t.key,ee(this,rp)[rp]()}start(){ee(this,za)[za]?(ee(this,Et)[Et].signal.aborted||ee(this,Et)[Et].abort(ja),ee(this,Et)[Et]=new Gu,ee(this,La)[La]()):ee(this,so)[so]?(this.options.companionComm.restoreUploadFile(ee(this,mi)[mi],{uploadId:this.options.uploadId,key:this.options.key}),ee(this,La)[La]()):ee(this,sp)[sp]()}pause(){ee(this,Et)[Et].abort(ja),ee(this,Et)[Et]=new Gu}abort(e){e!=null&&e.really?ee(this,op)[op]():this.pause()}get chunkState(){return ee(this,qt)[qt]}};function j_(){let i=ee(this,fi)[fi].size,e=typeof ee(this,$r)[$r]=="function"?ee(this,$r)[$r](ee(this,mi)[mi]):!!ee(this,$r)[$r];if(e&&i>ee(this,Na)[Na]){let t=Math.max(this.options.getChunkSize(ee(this,fi)[fi]),ee(this,Na)[Na]),r=Math.floor(i/t);r>ee(this,ro)[ro]&&(r=ee(this,ro)[ro],t=i/ee(this,ro)[ro]),ee(this,dt)[dt]=Array(r);for(let s=0,n=0;s<i;s+=t,n++){let a=Math.min(i,s+t),l=o(()=>{let u=s;return ee(this,fi)[fi].slice(u,a)},"getData");if(ee(this,dt)[dt][n]={getData:l,onProgress:ee(this,Ma)[Ma](n),onComplete:ee(this,Ba)[Ba](n),shouldUseMultipart:e},ee(this,so)[so]){let u=s+t>i?i-s:t;ee(this,dt)[dt][n].setAsUploaded=()=>{ee(this,dt)[dt][n]=null,ee(this,qt)[qt][n].uploaded=u}}}}else ee(this,dt)[dt]=[{getData:()=>ee(this,fi)[fi],onProgress:ee(this,Ma)[Ma](0),onComplete:ee(this,Ba)[Ba](0),shouldUseMultipart:e}];ee(this,qt)[qt]=ee(this,dt)[dt].map(()=>({uploaded:0}))}o(j_,"_initChunks2");function z_(){this.options.companionComm.uploadFile(ee(this,mi)[mi],ee(this,dt)[dt],ee(this,Et)[Et].signal).then(ee(this,oo)[oo],ee(this,Ha)[Ha]),ee(this,za)[za]=!0}o(z_,"_createUpload2");function H_(){this.options.companionComm.resumeUploadFile(ee(this,mi)[mi],ee(this,dt)[dt],ee(this,Et)[Et].signal).then(ee(this,oo)[oo],ee(this,Ha)[Ha])}o(H_,"_resumeUpload2");function q_(){ee(this,Et)[Et].abort(),this.options.companionComm.abortFileUpload(ee(this,mi)[mi]).catch(i=>this.options.log(i))}o(q_,"_abortUpload2");var Gv=np;function wt(i){if(i!=null&&i.aborted)throw Ku("The operation was aborted",{cause:i.reason})}o(wt,"throwIfAborted");function $_(i){let{method:e="PUT",CanonicalUri:t="/",CanonicalQueryString:r="",SignedHeaders:s,HashedPayload:n}=i,a=Object.keys(s).map(l=>l.toLowerCase()).sort();return[e,t,r,...a.map(l=>`${l}:${s[l]}`),"",a.join(";"),n].join(`
`)}o($_,"createCanonicalRequest");var ap=new TextEncoder,lp={name:"HMAC",hash:"SHA-256"};async function V_(i){let{subtle:e}=globalThis.crypto;return e.digest(lp.hash,ap.encode(i))}o(V_,"digest");async function W_(i){let{subtle:e}=globalThis.crypto;return e.importKey("raw",typeof i=="string"?ap.encode(i):i,lp,!1,["sign"])}o(W_,"generateHmacKey");function Kv(i){let e=new Uint8Array(i),t="";for(let r=0;r<e.length;r++)t+=e[r].toString(16).padStart(2,"0");return t}o(Kv,"arrayBufferToHexString");async function qa(i,e){let{subtle:t}=globalThis.crypto;return t.sign(lp,await W_(i),ap.encode(e))}o(qa,"hash");async function up(i){let{accountKey:e,accountSecret:t,sessionToken:r,bucketName:s,Key:n,Region:a,expires:l,uploadId:u,partNumber:h}=i,d="s3",f=`${s}.${d}.${a}.amazonaws.com`,y=`/${encodeURI(n).replace(/[;?:@&=+$,#!'()*]/g,Te=>`%${Te.charCodeAt(0).toString(16).toUpperCase()}`)}`,w="UNSIGNED-PAYLOAD",S=new Date().toISOString().replace(/[-:]|\.\d+/g,""),T=S.slice(0,8),C=`${T}/${a}/${d}/aws4_request`,_=new URL(`https://${f}${y}`);_.searchParams.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),_.searchParams.set("X-Amz-Content-Sha256",w),_.searchParams.set("X-Amz-Credential",`${e}/${C}`),_.searchParams.set("X-Amz-Date",S),_.searchParams.set("X-Amz-Expires",l),_.searchParams.set("X-Amz-Security-Token",r),_.searchParams.set("X-Amz-SignedHeaders","host"),h&&_.searchParams.set("partNumber",h),u&&_.searchParams.set("uploadId",u),_.searchParams.set("x-id",h&&u?"UploadPart":"PutObject");let R=$_({CanonicalUri:y,CanonicalQueryString:_.search.slice(1),SignedHeaders:{host:f},HashedPayload:w}),q=Kv(await V_(R)),W=["AWS4-HMAC-SHA256",S,C,q].join(`
`),K=await qa(`AWS4${t}`,T),$=await qa(K,a),G=await qa($,d),te=await qa(G,"aws4_request"),re=Kv(await qa(te,W));return _.searchParams.set("X-Amz-Signature",re),_}o(up,"createSignedURL");function ae(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(ae,"_classPrivateFieldLooseBase");var G_=0;function $t(i){return"__private_"+G_+++"_"+i}o($t,"_classPrivateFieldLooseKey");function K_(i){let e=new URL(i);return e.search="",e.hash="",e.href}o(K_,"removeMetadataFromURL");var $a=$t("abortMultipartUpload"),Ot=$t("cache"),Va=$t("createMultipartUpload"),Wa=$t("fetchSignature"),Xa=$t("getUploadParameters"),Ga=$t("listParts"),uo=$t("previousRetryDelay"),co=$t("requests"),no=$t("retryDelays"),ao=$t("sendCompletionRequest"),lo=$t("setS3MultipartState"),ho=$t("uploadPartBytes"),Ct=$t("getFile"),cp=$t("shouldRetry"),Ka=$t("nonMultipartUpload"),Xu=class{static{o(this,"HTTPCommunicationQueue")}constructor(e,t,r,s){Object.defineProperty(this,Ka,{value:Y_}),Object.defineProperty(this,cp,{value:X_}),Object.defineProperty(this,$a,{writable:!0,value:void 0}),Object.defineProperty(this,Ot,{writable:!0,value:new WeakMap}),Object.defineProperty(this,Va,{writable:!0,value:void 0}),Object.defineProperty(this,Wa,{writable:!0,value:void 0}),Object.defineProperty(this,Xa,{writable:!0,value:void 0}),Object.defineProperty(this,Ga,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,ao,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,ho,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),ae(this,co)[co]=e,ae(this,lo)[lo]=r,ae(this,Ct)[Ct]=s,this.setOptions(t)}setOptions(e){let t=ae(this,co)[co];if("abortMultipartUpload"in e&&(ae(this,$a)[$a]=t.wrapPromiseFunction(e.abortMultipartUpload,{priority:1})),"createMultipartUpload"in e&&(ae(this,Va)[Va]=t.wrapPromiseFunction(e.createMultipartUpload,{priority:-1})),"signPart"in e&&(ae(this,Wa)[Wa]=t.wrapPromiseFunction(e.signPart)),"listParts"in e&&(ae(this,Ga)[Ga]=t.wrapPromiseFunction(e.listParts)),"completeMultipartUpload"in e&&(ae(this,ao)[ao]=t.wrapPromiseFunction(e.completeMultipartUpload,{priority:1})),"retryDelays"in e){var r;ae(this,no)[no]=(r=e.retryDelays)!=null?r:[]}"uploadPartBytes"in e&&(ae(this,ho)[ho]=t.wrapPromiseFunction(e.uploadPartBytes,{priority:1/0})),"getUploadParameters"in e&&(ae(this,Xa)[Xa]=t.wrapPromiseFunction(e.getUploadParameters))}async getUploadId(e,t){let r;for(;(r=ae(this,Ot)[Ot].get(e.data))!=null;)try{return await r}catch{}let s=ae(this,Va)[Va](ae(this,Ct)[Ct](e),t),n=o(()=>{s.abort(t.reason),ae(this,Ot)[Ot].delete(e.data)},"abortPromise");return t.addEventListener("abort",n,{once:!0}),ae(this,Ot)[Ot].set(e.data,s),s.then(async a=>{t.removeEventListener("abort",n),ae(this,lo)[lo](e,a),ae(this,Ot)[Ot].set(e.data,a)},()=>{t.removeEventListener("abort",n),ae(this,Ot)[Ot].delete(e.data)}),s}async abortFileUpload(e){let t=ae(this,Ot)[Ot].get(e.data);if(t==null)return;ae(this,Ot)[Ot].delete(e.data),ae(this,lo)[lo](e,Object.create(null));let r;try{r=await t}catch{return}await ae(this,$a)[$a](ae(this,Ct)[Ct](e),r)}async uploadFile(e,t,r){if(wt(r),t.length===1&&!t[0].shouldUseMultipart)return ae(this,Ka)[Ka](e,t[0],r);let{uploadId:s,key:n}=await this.getUploadId(e,r);wt(r);try{let a=await Promise.all(t.map((l,u)=>this.uploadChunk(e,u+1,l,r)));return wt(r),await ae(this,ao)[ao](ae(this,Ct)[Ct](e),{key:n,uploadId:s,parts:a,signal:r},r).abortOn(r)}catch(a){throw a?.cause!==ja&&a?.name!=="AbortError"&&this.abortFileUpload(e),a}}restoreUploadFile(e,t){ae(this,Ot)[Ot].set(e.data,t)}async resumeUploadFile(e,t,r){if(wt(r),t.length===1&&t[0]!=null&&!t[0].shouldUseMultipart)return ae(this,Ka)[Ka](e,t[0],r);let{uploadId:s,key:n}=await this.getUploadId(e,r);wt(r);let a=await ae(this,Ga)[Ga](ae(this,Ct)[Ct](e),{uploadId:s,key:n,signal:r},r).abortOn(r);wt(r);let l=await Promise.all(t.map((u,h)=>{let d=h+1,f=a.find(y=>{let{PartNumber:w}=y;return w===d});return f==null?this.uploadChunk(e,d,u,r):(u==null||u.setAsUploaded==null||u.setAsUploaded(),{PartNumber:d,ETag:f.ETag})}));return wt(r),ae(this,ao)[ao](ae(this,Ct)[Ct](e),{key:n,uploadId:s,parts:l,signal:r},r).abortOn(r)}async uploadChunk(e,t,r,s){wt(s);let{uploadId:n,key:a}=await this.getUploadId(e,s),l=ae(this,no)[no].values(),u=ae(this,no)[no].values(),h=o(()=>{let d=l.next();return d==null||d.done?null:d.value},"shouldRetrySignature");for(;;){wt(s);let d=r.getData(),{onProgress:f,onComplete:y}=r,w;try{w=await ae(this,Wa)[Wa](ae(this,Ct)[Ct](e),{uploadId:n,key:a,partNumber:t,body:d,signal:s}).abortOn(s)}catch(S){let T=h();if(T==null||s.aborted)throw S;await new Promise(C=>setTimeout(C,T));continue}wt(s);try{return{PartNumber:t,...await ae(this,ho)[ho]({signature:w,body:d,size:d.size,onProgress:f,onComplete:y,signal:s}).abortOn(s)}}catch(S){if(!await ae(this,cp)[cp](S,u))throw S}}}};async function X_(i,e){var t;let r=ae(this,co)[co],s=i==null||(t=i.source)==null?void 0:t.status;if(s==null)return!1;if(s===403&&i.message==="Request has expired"){if(!r.isPaused){if(r.limit===1||ae(this,uo)[uo]==null){let n=e.next();if(n==null||n.done)return!1;ae(this,uo)[uo]=n.value}r.rateLimit(0),await new Promise(n=>setTimeout(n,ae(this,uo)[uo]))}}else if(s===429){if(!r.isPaused){let n=e.next();if(n==null||n.done)return!1;r.rateLimit(n.value)}}else{if(s>400&&s<500&&s!==409)return!1;if(typeof navigator<"u"&&navigator.onLine===!1)r.isPaused||(r.pause(),window.addEventListener("online",()=>{r.resume()},{once:!0}));else{let n=e.next();if(n==null||n.done)return!1;await new Promise(a=>setTimeout(a,n.value))}}return!0}o(X_,"_shouldRetry2");async function Y_(i,e,t){let{method:r="POST",url:s,fields:n,headers:a}=await ae(this,Xa)[Xa](ae(this,Ct)[Ct](i),{signal:t}).abortOn(t),l,u=e.getData();if(r.toUpperCase()==="POST"){let y=new FormData;Object.entries(n).forEach(w=>{let[S,T]=w;return y.set(S,T)}),y.set("file",u),l=y}else l=u;let{onProgress:h,onComplete:d}=e,f=await ae(this,ho)[ho]({signature:{url:s,headers:a,method:r},body:l,size:u.size,onProgress:h,onComplete:d,signal:t}).abortOn(t);return"location"in f?f:{location:K_(s),...f}}o(Y_,"_nonMultipartUpload2");var Yv;function de(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(de,"_classPrivateFieldLooseBase");var Q_=0;function Oi(i){return"__private_"+Q_+++"_"+i}o(Oi,"_classPrivateFieldLooseKey");var J_={version:"3.12.0"};function Xo(i){if(i!=null&&i.error){let e=new Error(i.message);throw Object.assign(e,i.error),e}return i}o(Xo,"assertServerError");function Qv(i){let e=i.Expiration;if(e){let t=Math.floor((new Date(e)-Date.now())/1e3);if(t>9)return t}}o(Qv,"getExpiry");function Xv(i){let{meta:e,allowedMetaFields:t,querify:r=!1}=i,s=t??Object.keys(e);return e?Object.fromEntries(s.filter(n=>e[n]!=null).map(n=>{let a=r?`metadata[${n}]`:n,l=String(e[n]);return[a,l]})):{}}o(Xv,"getAllowedMetadata");var Z_={allowedMetaFields:null,limit:6,getTemporarySecurityCredentials:!1,shouldUseMultipart:i=>i.size!==0,retryDelays:[0,1e3,3e3,5e3],companionHeaders:{}},fo=Oi("companionCommunicationQueue"),et=Oi("client"),At=Oi("cachedTemporaryCredentials"),hp=Oi("getTemporarySecurityCredentials"),dp=Oi("setS3MultipartState"),mo=Oi("getFile"),pp=Oi("uploadLocalFile"),fp=Oi("getCompanionClientArgs"),Ya=Oi("upload"),po=Oi("setCompanionHeaders"),Vr=Oi("setResumableUploadsCapability"),Qa=Oi("resetResumableCapability");Yv=Symbol.for("uppy test: getClient");var us=class i extends Ee{static{o(this,"AwsS3Multipart")}constructor(e,t){var r;super(e,{...Z_,uploadPartBytes:i.uploadPartBytes,createMultipartUpload:null,listParts:null,abortMultipartUpload:null,completeMultipartUpload:null,signPart:null,getUploadParameters:null,...t}),Object.defineProperty(this,fp,{value:i5}),Object.defineProperty(this,pp,{value:t5}),Object.defineProperty(this,hp,{value:e5}),Object.defineProperty(this,fo,{writable:!0,value:void 0}),Object.defineProperty(this,et,{writable:!0,value:void 0}),Object.defineProperty(this,At,{writable:!0,value:void 0}),Object.defineProperty(this,dp,{writable:!0,value:(n,a)=>{let{key:l,uploadId:u}=a,h=this.uppy.getFile(n.id);h!=null&&this.uppy.setFileState(n.id,{s3Multipart:{...h.s3Multipart,key:l,uploadId:u}})}}),Object.defineProperty(this,mo,{writable:!0,value:n=>this.uppy.getFile(n.id)||n}),Object.defineProperty(this,Ya,{writable:!0,value:async n=>{if(n.length===0)return;let a=this.uppy.getFilesByIds(n),l=as(a),u=ls(l);this.uppy.emit("upload-start",u);let h=l.map(f=>{if(f.isRemote){let y=o(()=>this.requests,"getQueue");de(this,Vr)[Vr](!1);let w=new AbortController,S=o(C=>{C.id===f.id&&w.abort()},"removedHandler");this.uppy.on("file-removed",S);let T=this.uppy.getRequestClientForFile(f).uploadRemoteFile(f,de(this,fp)[fp](f),{signal:w.signal,getQueue:y});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",S)},{priority:-1})(),T}return de(this,pp)[pp](f)}),d=await Promise.all(h);return de(this,Vr)[Vr](!0),d}}),Object.defineProperty(this,po,{writable:!0,value:()=>{de(this,et)[et].setCompanionHeaders(this.opts.companionHeaders)}}),Object.defineProperty(this,Vr,{writable:!0,value:n=>{let{capabilities:a}=this.uppy.getState();this.uppy.setState({capabilities:{...a,resumableUploads:n}})}}),Object.defineProperty(this,Qa,{writable:!0,value:()=>{de(this,Vr)[Vr](!0)}}),this.type="uploader",this.id=this.opts.id||"AwsS3Multipart",this.title="AWS S3 Multipart",de(this,et)[et]=new It(e,t);let s={createMultipartUpload:this.createMultipartUpload,listParts:this.listParts,abortMultipartUpload:this.abortMultipartUpload,completeMultipartUpload:this.completeMultipartUpload,signPart:t!=null&&t.getTemporarySecurityCredentials?this.createSignedURL:this.signPart,getUploadParameters:t!=null&&t.getTemporarySecurityCredentials?this.createSignedURL:this.getUploadParameters};for(let n of Object.keys(s))this.opts[n]==null&&(this.opts[n]=s[n].bind(this));t?.prepareUploadParts!=null&&t.signPart==null&&(this.opts.signPart=async(n,a)=>{let{uploadId:l,key:u,partNumber:h,body:d,signal:f}=a,{presignedUrls:y,headers:w}=await t.prepareUploadParts(n,{uploadId:l,key:u,parts:[{number:h,chunk:d}],signal:f});return{url:y?.[h],headers:w?.[h]}}),this.requests=(r=this.opts.rateLimitedQueue)!=null?r:new Jt(this.opts.limit),de(this,fo)[fo]=new Xu(this.requests,this.opts,de(this,dp)[dp],de(this,mo)[mo]),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null),this.uploaderSockets=Object.create(null)}[Yv](){return de(this,et)[et]}setOptions(e){de(this,fo)[fo].setOptions(e),super.setOptions(e),de(this,po)[po]()}resetUploaderReferences(e,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)}assertHost(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.`)}createMultipartUpload(e,t){this.assertHost("createMultipartUpload"),wt(t);let r=Xv({meta:e.meta,allowedMetaFields:this.opts.allowedMetaFields});return de(this,et)[et].post("s3/multipart",{filename:e.name,type:e.type,metadata:r},{signal:t}).then(Xo)}listParts(e,t,r){var s;let{key:n,uploadId:a,signal:l}=t;(s=l)!=null||(l=r),this.assertHost("listParts"),wt(l);let u=encodeURIComponent(n);return de(this,et)[et].get(`s3/multipart/${a}?key=${u}`,{signal:l}).then(Xo)}completeMultipartUpload(e,t,r){var s;let{key:n,uploadId:a,parts:l,signal:u}=t;(s=u)!=null||(u=r),this.assertHost("completeMultipartUpload"),wt(u);let h=encodeURIComponent(n),d=encodeURIComponent(a);return de(this,et)[et].post(`s3/multipart/${d}/complete?key=${h}`,{parts:l},{signal:u}).then(Xo)}async createSignedURL(e,t){let r=await de(this,hp)[hp](t),s=Qv(r.credentials)||604800,{uploadId:n,key:a,partNumber:l}=t;return{method:"PUT",expires:s,fields:{},url:`${await up({accountKey:r.credentials.AccessKeyId,accountSecret:r.credentials.SecretAccessKey,sessionToken:r.credentials.SessionToken,expires:s,bucketName:r.bucket,Region:r.region,Key:a??`${crypto.randomUUID()}-${e.name}`,uploadId:n,partNumber:l})}`,headers:{"Content-Type":e.type}}}signPart(e,t){let{uploadId:r,key:s,partNumber:n,signal:a}=t;if(this.assertHost("signPart"),wt(a),r==null||s==null||n==null)throw new Error("Cannot sign without a key, an uploadId, and a partNumber");let l=encodeURIComponent(s);return de(this,et)[et].get(`s3/multipart/${r}/${n}?key=${l}`,{signal:a}).then(Xo)}abortMultipartUpload(e,t,r){var s;let{key:n,uploadId:a,signal:l}=t;(s=l)!=null||(l=r),this.assertHost("abortMultipartUpload");let u=encodeURIComponent(n),h=encodeURIComponent(a);return de(this,et)[et].delete(`s3/multipart/${h}?key=${u}`,void 0,{signal:l}).then(Xo)}getUploadParameters(e,t){let{meta:r}=e,{type:s,name:n}=r,a=Xv({meta:r,allowedMetaFields:this.opts.allowedMetaFields,querify:!0}),l=new URLSearchParams({filename:n,type:s,...a});return de(this,et)[et].get(`s3/params?${l}`,t)}static async uploadPartBytes(e){let{signature:{url:t,expires:r,headers:s,method:n="PUT"},body:a,size:l=a.size,onProgress:u,onComplete:h,signal:d}=e;if(wt(d),t==null)throw new Error("Cannot upload to an undefined URL");return new Promise((f,y)=>{let w=new XMLHttpRequest;w.open(n,t,!0),s&&Object.keys(s).forEach(C=>{w.setRequestHeader(C,s[C])}),w.responseType="text",typeof r=="number"&&(w.timeout=r*1e3);function S(){w.abort()}o(S,"onabort");function T(){d?.removeEventListener("abort",S)}o(T,"cleanup"),d?.addEventListener("abort",S),w.upload.addEventListener("progress",C=>{u(C)}),w.addEventListener("abort",()=>{T(),y(Ku())}),w.addEventListener("timeout",()=>{T();let C=new Error("Request has expired");C.source={status:403},y(C)}),w.addEventListener("load",()=>{if(T(),w.status===403&&w.responseText.includes("<Message>Request has expired</Message>")){let W=new Error("Request has expired");W.source=w,y(W);return}if(w.status<200||w.status>=300){let W=new Error("Non 2xx");W.source=w,y(W);return}u?.({loaded:l,lengthComputable:!0});let C=w.getAllResponseHeaders().trim().split(/[\r\n]+/),_={__proto__:null};for(let W of C){let K=W.split(": "),$=K.shift(),G=K.join(": ");_[$]=G}let{etag:R,location:q}=_;if(n.toUpperCase()==="POST"&&q===null&&console.warn("AwsS3/Multipart: Could not read the Location 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."),R===null){y(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."));return}h?.(R),f({..._,ETag:R})}),w.addEventListener("error",C=>{T();let _=new Error("Unknown error");_.source=C.target,y(_)}),w.send(a)})}install(){de(this,Vr)[Vr](!0),this.uppy.addPreProcessor(de(this,po)[po]),this.uppy.addUploader(de(this,Ya)[Ya]),this.uppy.on("cancel-all",de(this,Qa)[Qa])}uninstall(){this.uppy.removePreProcessor(de(this,po)[po]),this.uppy.removeUploader(de(this,Ya)[Ya]),this.uppy.off("cancel-all",de(this,Qa)[Qa])}};async function e5(i){return wt(i?.signal),de(this,At)[At]==null&&(this.opts.getTemporarySecurityCredentials===!0?(this.assertHost("getTemporarySecurityCredentials"),de(this,At)[At]=de(this,et)[et].get("s3/sts",i).then(Xo)):de(this,At)[At]=this.opts.getTemporarySecurityCredentials(i),de(this,At)[At]=await de(this,At)[At],setTimeout(()=>{de(this,At)[At]=null},(Qv(de(this,At)[At].credentials)||0)*500)),de(this,At)[At]}o(e5,"_getTemporarySecurityCredentials2");function t5(i){var e=this;return new Promise((t,r)=>{let s=o((h,d)=>{this.uppy.emit("upload-progress",this.uppy.getFile(i.id),{uploader:this,bytesUploaded:h,bytesTotal:d})},"onProgress"),n=o(h=>{this.uppy.log(h),this.uppy.emit("upload-error",i,h),this.resetUploaderReferences(i.id),r(h)},"onError"),a=o(h=>{let d={body:{...h},status:200,uploadURL:h.location};this.resetUploaderReferences(i.id),this.uppy.emit("upload-success",de(this,mo)[mo](i),d),h.location&&this.uppy.log(`Download ${i.name} from ${h.location}`),t()},"onSuccess"),l=new Gv(i.data,{companionComm:de(this,fo)[fo],log:function(){return e.uppy.log(...arguments)},getChunkSize:this.opts.getChunkSize?this.opts.getChunkSize.bind(this):null,onProgress:s,onError:n,onSuccess:a,onPartComplete:h=>{this.uppy.emit("s3-multipart:part-uploaded",de(this,mo)[mo](i),h)},file:i,shouldUseMultipart:this.opts.shouldUseMultipart,...i.s3Multipart});this.uploaders[i.id]=l;let u=new zr(this.uppy);this.uploaderEvents[i.id]=u,u.onFileRemove(i.id,h=>{l.abort(),this.resetUploaderReferences(i.id,{abort:!0}),t(`upload ${h} was removed`)}),u.onCancelAll(i.id,h=>{h?.reason==="user"&&(l.abort(),this.resetUploaderReferences(i.id,{abort:!0})),t(`upload ${i.id} was canceled`)}),u.onFilePause(i.id,h=>{h?l.pause():l.start()}),u.onPauseAll(i.id,()=>{l.pause()}),u.onResumeAll(i.id,()=>{l.start()}),l.start()})}o(t5,"_uploadLocalFile2");function i5(i){var e;return{...(e=i.remote)==null?void 0:e.body,protocol:"s3-multipart",size:i.data.size,metadata:i.meta}}o(i5,"_getCompanionClientArgs2");us.VERSION=J_.version;function Wr(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Wr,"_classPrivateFieldLooseBase");var r5=0;function Jv(i){return"__private_"+r5+++"_"+i}o(Jv,"_classPrivateFieldLooseKey");var Vt=Jv("uppy"),Ja=Jv("events"),Za=class{static{o(this,"EventManager")}constructor(e){Object.defineProperty(this,Vt,{writable:!0,value:void 0}),Object.defineProperty(this,Ja,{writable:!0,value:[]}),Wr(this,Vt)[Vt]=e}on(e,t){return Wr(this,Ja)[Ja].push([e,t]),Wr(this,Vt)[Vt].on(e,t)}remove(){for(let[e,t]of Wr(this,Ja)[Ja].splice(0))Wr(this,Vt)[Vt].off(e,t)}onFilePause(e,t){this.on("upload-pause",(r,s)=>{e===r&&t(s)})}onFileRemove(e,t){this.on("file-removed",r=>{e===r.id&&t(r.id)})}onPause(e,t){this.on("upload-pause",(r,s)=>{e===r&&t(s)})}onRetry(e,t){this.on("upload-retry",r=>{e===r&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{Wr(this,Vt)[Vt].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{Wr(this,Vt)[Vt].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){Wr(r,Vt)[Vt].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{Wr(this,Vt)[Vt].getFile(e)&&t()})}};function Ci(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Ci,"_classPrivateFieldLooseBase");var s5=0;function Yu(i){return"__private_"+s5+++"_"+i}o(Yu,"_classPrivateFieldLooseKey");var Gr=Yu("aliveTimer"),go=Yu("isDone"),el=Yu("onTimedOut"),yo=Yu("timeout"),mp=class{static{o(this,"ProgressTimeout")}constructor(e,t){Object.defineProperty(this,Gr,{writable:!0,value:void 0}),Object.defineProperty(this,go,{writable:!0,value:!1}),Object.defineProperty(this,el,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Ci(this,yo)[yo]=e,Ci(this,el)[el]=()=>t(e)}progress(){Ci(this,go)[go]||Ci(this,yo)[yo]>0&&(clearTimeout(Ci(this,Gr)[Gr]),Ci(this,Gr)[Gr]=setTimeout(Ci(this,el)[el],Ci(this,yo)[yo]))}done(){Ci(this,go)[go]||(clearTimeout(Ci(this,Gr)[Gr]),Ci(this,Gr)[Gr]=void 0,Ci(this,go)[go]=!0)}},Qu=mp;function o5(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}o(o5,"isNetworkError");var vo=o5;function Zv(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Zv,"_classPrivateFieldLooseBase");var n5=0;function tb(i){return"__private_"+n5+++"_"+i}o(tb,"_classPrivateFieldLooseKey");function eb(i,e){if(vo(i))return new Dt(e,i);let t=new pr("Upload error",{cause:e});return t.request=i,t}o(eb,"buildResponseError");function a5(i){return i.data.slice(0,i.data.size,i.meta.type)}o(a5,"setTypeInBlob");function l5(i,e,t){(Array.isArray(t.allowedMetaFields)?t.allowedMetaFields:Object.keys(e)).forEach(s=>{i.append(s,e[s])})}o(l5,"addMetadata");function u5(i,e){let t=new FormData;l5(t,i.meta,e);let r=a5(i);return i.name?t.append(e.fieldName,r,i.meta.name):t.append(e.fieldName,r),t}o(u5,"createFormDataUpload");var c5=o(i=>i.data,"createBareUpload"),gp=tb("addEventHandlerForFile"),yp=tb("addEventHandlerIfFileStillExists"),tl=class{static{o(this,"MiniXHRUpload")}constructor(e,t){Object.defineProperty(this,yp,{value:d5}),Object.defineProperty(this,gp,{value:h5}),this.uppy=e,this.opts={validateStatus(r){return r>=200&&r<300},...t},this.requests=t[ns],this.uploaderEvents=Object.create(null),this.i18n=t.i18n}getOptions(e){var t;let{uppy:r}=this,s=r.getState().xhrUpload;return{...this.opts,...s||{},...e.xhrUpload||{},headers:{...this.opts.headers,...s?.headers,...(t=e.xhrUpload)==null?void 0:t.headers}}}uploadLocalFile(e){let t=this.getOptions(e);return new Promise((r,s)=>{let n=t.formData?u5(e,t):c5(e,t),a=new XMLHttpRequest;this.uploaderEvents[e.id]=new Za(this.uppy);let l=new Qu(t.timeout,()=>{a.abort(),h.done();let d=new Error(this.i18n("timedOut",{seconds:Math.ceil(t.timeout/1e3)}));this.uppy.emit("upload-error",e,d),s(d)}),u=Xt();a.upload.addEventListener("loadstart",()=>{this.uppy.log(`[AwsS3/XHRUpload] ${u} started`)}),a.upload.addEventListener("progress",d=>{this.uppy.log(`[AwsS3/XHRUpload] ${u} progress: ${d.loaded} / ${d.total}`),l.progress(),d.lengthComputable&&this.uppy.emit("upload-progress",this.uppy.getFile(e.id),{uploader:this,bytesUploaded:d.loaded,bytesTotal:d.total})}),a.addEventListener("load",d=>{if(this.uppy.log(`[AwsS3/XHRUpload] ${u} finished`),l.done(),h.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),t.validateStatus(d.target.status,a.responseText,a)){let S=t.getResponseData(a.responseText,a),T=S[t.responseUrlFieldName],C={status:d.target.status,body:S,uploadURL:T};return this.uppy.emit("upload-success",this.uppy.getFile(e.id),C),T&&this.uppy.log(`Download ${e.name} from ${T}`),r(e)}let f=t.getResponseData(a.responseText,a),y=eb(a,t.getResponseError(a.responseText,a)),w={status:d.target.status,body:f};return this.uppy.emit("upload-error",e,y,w),s(y)}),a.addEventListener("error",()=>{this.uppy.log(`[AwsS3/XHRUpload] ${u} errored`),l.done(),h.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null);let d=eb(a,t.getResponseError(a.responseText,a));return this.uppy.emit("upload-error",e,d),s(d)}),a.open(t.method.toUpperCase(),t.endpoint,!0),a.withCredentials=!!t.withCredentials,t.responseType!==""&&(a.responseType=t.responseType),Object.keys(t.headers).forEach(d=>{a.setRequestHeader(d,t.headers[d])});let h=this.requests.run(()=>(a.send(n),()=>{l.done(),a.abort()}),{priority:1});Zv(this,gp)[gp]("file-removed",e.id,()=>{h.abort(),s(new Error("File removed"))}),Zv(this,yp)[yp]("cancel-all",e.id,function(d){let{reason:f}=d===void 0?{}:d;f==="user"&&h.abort(),s(new Error("Upload cancelled"))})})}};function h5(i,e,t){this.uploaderEvents[e].on(i,r=>{var s;let n=(s=r?.id)!=null?s:r;e===n&&t()})}o(h5,"_addEventHandlerForFile2");function d5(i,e,t){var r=this;this.uploaderEvents[e].on(i,function(){r.uppy.getFile(e)&&t(...arguments)})}o(d5,"_addEventHandlerIfFileStillExists2");function p5(i){return i.replace(/;.*$/,"")}o(p5,"removeMimeParameters");function f5(i,e){let t=e.headers?e.headers["content-type"]:e.getResponseHeader("Content-Type");if(typeof t=="string"){let r=p5(t).toLowerCase();if(r==="application/xml"||r==="text/xml"||r==="text/html"&&/^<\?xml /.test(i))return!0}return!1}o(f5,"isXml");var vp=f5;var ib={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}};var sb;function ft(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(ft,"_classPrivateFieldLooseBase");var m5=0;function Qo(i){return"__private_"+m5+++"_"+i}o(Qo,"_classPrivateFieldLooseKey");var g5={version:"3.6.2"};function y5(i,e){return!i&&!e.startsWith("https://")&&!e.startsWith("http://")&&(e=`https://${e}`),new URL(e,i||void 0).toString()}o(y5,"resolveUrl");function sl(i,e){let t=i.indexOf(`<${e}>`),r=i.indexOf(`</${e}>`,t);return t!==-1&&r!==-1?i.slice(t+e.length+2,r):""}o(sl,"getXmlValue");function v5(i){if(i&&i.error){let e=new Error(i.message);throw Object.assign(e,i.error),e}return i}o(v5,"assertServerError");function b5(i,e){if(!(e!=null&&typeof e.url=="string"&&(typeof e.fields=="object"||e.fields==null)))throw new TypeError(`AwsS3: got incorrect result from 'getUploadParameters()' for file '${i.name}', expected an object '{ url, method, fields, headers }' but got '${JSON.stringify(e)}' instead.
See https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.`);if(!(e.method==null||/^p(u|os)t$/i.test(e.method)))throw new TypeError(`AwsS3: got incorrect method from 'getUploadParameters()' for file '${i.name}', expected 'PUT' or 'POST' but got '${e.method}' instead.
See https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.`)}o(b5,"validateParameters");function w5(i,e){if(!vp(i,e))return;let t=sl(i,"Message");return new Error(t)}o(w5,"defaultGetResponseError");var rb=!1,gi=Qo("client"),Bi=Qo("requests"),bo=Qo("uploader"),il=Qo("handleUpload"),rl=Qo("setCompanionHeaders"),bp=Qo("getCompanionClientArgs");sb=Symbol.for("uppy test: getClient");var Yo=class extends Ee{static{o(this,"AwsS3")}constructor(e,t){if(t?.shouldUseMultipart!=null)return new us(e,t);super(e,t),Object.defineProperty(this,gi,{writable:!0,value:void 0}),Object.defineProperty(this,Bi,{writable:!0,value:void 0}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,il,{writable:!0,value:async s=>{let n=Object.create(null);function a(y){var w;let{id:S}=y;(w=n[S])==null||w.abort()}o(a,"onremove"),this.uppy.on("file-removed",a);let l=this.uppy.getFilesByIds(s),u=as(l),h=ls(u);this.uppy.emit("upload-start",h);let d=ft(this,Bi)[Bi].wrapPromiseFunction(y=>this.opts.getUploadParameters(y)),f=s.length;return Promise.allSettled(s.map((y,w)=>(n[y]=d(this.uppy.getFile(y)),n[y].then(S=>{delete n[y];let T=this.uppy.getFile(y);b5(T,S);let{method:C="POST",url:_,fields:R,headers:q}=S,W={method:C,formData:C.toUpperCase()==="POST",endpoint:_,allowedMetaFields:R?Object.keys(R):[]};return q&&(W.headers=q),this.uppy.setFileState(T.id,{meta:{...T.meta,...R},xhrUpload:W}),this.uploadFile(T.id,w,f)}).catch(S=>{delete n[y];let T=this.uppy.getFile(y);return this.uppy.emit("upload-error",T,S),Promise.reject(S)})))).finally(()=>{this.uppy.off("file-removed",a)})}}),Object.defineProperty(this,rl,{writable:!0,value:()=>(ft(this,gi)[gi].setCompanionHeaders(this.opts.companionHeaders),Promise.resolve())}),Object.defineProperty(this,bp,{writable:!0,value:s=>{let n=ft(this,bo)[bo].getOptions(s),a=Array.isArray(n.allowedMetaFields)?n.allowedMetaFields:Object.keys(s.meta);return{...s.remote.body,protocol:"multipart",endpoint:n.endpoint,size:s.data.size,fieldname:n.fieldName,metadata:Object.fromEntries(a.map(l=>[l,s.meta[l]])),httpMethod:n.method,useFormData:n.formData,headers:typeof n.headers=="function"?n.headers(s):n.headers}}}),this.type="uploader",this.id=this.opts.id||"AwsS3",this.title="AWS S3",this.defaultLocale=ib;let r={timeout:30*1e3,limit:0,allowedMetaFields:[],getUploadParameters:this.getUploadParameters.bind(this),shouldUseMultipart:!1,companionHeaders:{}};if(this.opts={...r,...t},t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.i18nInit(),ft(this,gi)[gi]=new It(e,t),ft(this,Bi)[Bi]=new Jt(this.opts.limit)}[sb](){return ft(this,gi)[gi]}get client(){return ft(this,gi)[gi]}set client(e){ft(this,gi)[gi]=e}getUploadParameters(e){if(!this.opts.companionUrl)throw new Error("Expected a `companionUrl` option containing a Companion address.");let t=e.meta.name,{type:r}=e.meta,s=Object.fromEntries(this.opts.allowedMetaFields.filter(a=>e.meta[a]!=null).map(a=>[`metadata[${a}]`,e.meta[a].toString()])),n=new URLSearchParams({filename:t,type:r,...s});return ft(this,gi)[gi].get(`s3/params?${n}`).then(v5)}uploadFile(e,t,r){let s=this.uppy.getFile(e);if(this.uppy.log(`uploading ${t} of ${r}`),s.error)throw new Error(s.error);if(s.isRemote){let n=o(()=>ft(this,Bi)[Bi],"getQueue"),a=new AbortController,l=o(h=>{h.id===s.id&&a.abort()},"removedHandler");this.uppy.on("file-removed",l);let u=this.uppy.getRequestClientForFile(s).uploadRemoteFile(s,ft(this,bp)[bp](s),{signal:a.signal,getQueue:n});return ft(this,Bi)[Bi].wrapSyncFunction(()=>{this.uppy.off("file-removed",l)},{priority:-1})(),u}return ft(this,bo)[bo].uploadLocalFile(s,t,r)}install(){let{uppy:e}=this;e.addPreProcessor(ft(this,rl)[rl]),e.addUploader(ft(this,il)[il]);function t(s,n){let a=this;return vp(s,n)?{location:y5(n.responseURL,sl(s,"Location")),bucket:sl(s,"Bucket"),key:sl(s,"Key"),etag:sl(s,"ETag")}:a.method.toUpperCase()==="POST"?(rb||(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"),rb=!0),{location:null}):n.responseURL?{location:n.responseURL.replace(/\?.*$/,"")}:{location:null}}o(t,"defaultGetResponseData");let r={fieldName:"file",responseUrlFieldName:"location",timeout:this.opts.timeout,[ns]:ft(this,Bi)[Bi],responseType:"text",getResponseData:this.opts.getResponseData||t,getResponseError:w5};r.i18n=this.i18n,ft(this,bo)[bo]=new tl(e,r)}uninstall(){this.uppy.removePreProcessor(ft(this,rl)[rl]),this.uppy.removeUploader(ft(this,il)[il])}};Yo.VERSION=g5.version;var cb="3.7.2",S5=cb,P5=typeof atob=="function",_5=typeof btoa=="function",Zo=typeof Buffer=="function",ob=typeof TextDecoder=="function"?new TextDecoder:void 0,nb=typeof TextEncoder=="function"?new TextEncoder:void 0,x5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ol=Array.prototype.slice.call(x5),Ju=(i=>{let e={};return i.forEach((t,r)=>e[t]=r),e})(ol),F5=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Tt=String.fromCharCode.bind(String),ab=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):(i,e=t=>t)=>new Uint8Array(Array.prototype.slice.call(i,0).map(e)),hb=o(i=>i.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),"_mkUriSafe"),db=o(i=>i.replace(/[^A-Za-z0-9\+\/]/g,""),"_tidyB64"),pb=o(i=>{let e,t,r,s,n="",a=i.length%3;for(let l=0;l<i.length;){if((t=i.charCodeAt(l++))>255||(r=i.charCodeAt(l++))>255||(s=i.charCodeAt(l++))>255)throw new TypeError("invalid character found");e=t<<16|r<<8|s,n+=ol[e>>18&63]+ol[e>>12&63]+ol[e>>6&63]+ol[e&63]}return a?n.slice(0,a-3)+"===".substring(a):n},"btoaPolyfill"),Pp=_5?i=>btoa(i):Zo?i=>Buffer.from(i,"binary").toString("base64"):pb,wp=Zo?i=>Buffer.from(i).toString("base64"):i=>{let t=[];for(let r=0,s=i.length;r<s;r+=4096)t.push(Tt.apply(null,i.subarray(r,r+4096)));return Pp(t.join(""))},Zu=o((i,e=!1)=>e?hb(wp(i)):wp(i),"fromUint8Array"),E5=o(i=>{if(i.length<2){var e=i.charCodeAt(0);return e<128?i:e<2048?Tt(192|e>>>6)+Tt(128|e&63):Tt(224|e>>>12&15)+Tt(128|e>>>6&63)+Tt(128|e&63)}else{var e=65536+(i.charCodeAt(0)-55296)*1024+(i.charCodeAt(1)-56320);return Tt(240|e>>>18&7)+Tt(128|e>>>12&63)+Tt(128|e>>>6&63)+Tt(128|e&63)}},"cb_utob"),O5=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,fb=o(i=>i.replace(O5,E5),"utob"),lb=Zo?i=>Buffer.from(i,"utf8").toString("base64"):nb?i=>wp(nb.encode(i)):i=>Pp(fb(i)),Jo=o((i,e=!1)=>e?hb(lb(i)):lb(i),"encode"),ub=o(i=>Jo(i,!0),"encodeURI"),C5=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,A5=o(i=>{switch(i.length){case 4:var e=(7&i.charCodeAt(0))<<18|(63&i.charCodeAt(1))<<12|(63&i.charCodeAt(2))<<6|63&i.charCodeAt(3),t=e-65536;return Tt((t>>>10)+55296)+Tt((t&1023)+56320);case 3:return Tt((15&i.charCodeAt(0))<<12|(63&i.charCodeAt(1))<<6|63&i.charCodeAt(2));default:return Tt((31&i.charCodeAt(0))<<6|63&i.charCodeAt(1))}},"cb_btou"),mb=o(i=>i.replace(C5,A5),"btou"),gb=o(i=>{if(i=i.replace(/\s+/g,""),!F5.test(i))throw new TypeError("malformed base64.");i+="==".slice(2-(i.length&3));let e,t="",r,s;for(let n=0;n<i.length;)e=Ju[i.charAt(n++)]<<18|Ju[i.charAt(n++)]<<12|(r=Ju[i.charAt(n++)])<<6|(s=Ju[i.charAt(n++)]),t+=r===64?Tt(e>>16&255):s===64?Tt(e>>16&255,e>>8&255):Tt(e>>16&255,e>>8&255,e&255);return t},"atobPolyfill"),_p=P5?i=>atob(db(i)):Zo?i=>Buffer.from(i,"base64").toString("binary"):gb,yb=Zo?i=>ab(Buffer.from(i,"base64")):i=>ab(_p(i),e=>e.charCodeAt(0)),vb=o(i=>yb(bb(i)),"toUint8Array"),T5=Zo?i=>Buffer.from(i,"base64").toString("utf8"):ob?i=>ob.decode(yb(i)):i=>mb(_p(i)),bb=o(i=>db(i.replace(/[-_]/g,e=>e=="-"?"+":"/")),"_unURI"),Sp=o(i=>T5(bb(i)),"decode"),R5=o(i=>{if(typeof i!="string")return!1;let e=i.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},"isValid"),wb=o(i=>({value:i,enumerable:!1,writable:!0,configurable:!0}),"_noEnum"),Sb=o(function(){let i=o((e,t)=>Object.defineProperty(String.prototype,e,wb(t)),"_add");i("fromBase64",function(){return Sp(this)}),i("toBase64",function(e){return Jo(this,e)}),i("toBase64URI",function(){return Jo(this,!0)}),i("toBase64URL",function(){return Jo(this,!0)}),i("toUint8Array",function(){return vb(this)})},"extendString"),Pb=o(function(){let i=o((e,t)=>Object.defineProperty(Uint8Array.prototype,e,wb(t)),"_add");i("toBase64",function(e){return Zu(this,e)}),i("toBase64URI",function(){return Zu(this,!0)}),i("toBase64URL",function(){return Zu(this,!0)})},"extendUint8Array"),k5=o(()=>{Sb(),Pb()},"extendBuiltins"),_b={version:cb,VERSION:S5,atob:_p,atobPolyfill:gb,btoa:Pp,btoaPolyfill:pb,fromBase64:Sp,toBase64:Jo,encode:Jo,encodeURI:ub,encodeURL:ub,utob:fb,btou:mb,decode:Sp,isValid:R5,fromUint8Array:Zu,toUint8Array:vb,extendString:Sb,extendUint8Array:Pb,extendBuiltins:k5};var Yb=be(Lb());function en(i){"@babel/helpers - typeof";return en=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},en(i)}o(en,"_typeof");function Nb(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,V5(r.key),r)}}o(Nb,"_defineProperties");function $5(i,e,t){return e&&Nb(i.prototype,e),t&&Nb(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o($5,"_createClass");function V5(i){var e=W5(i,"string");return en(e)==="symbol"?e:String(e)}o(V5,"_toPropertyKey");function W5(i,e){if(en(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(en(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}o(W5,"_toPrimitive");function G5(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(G5,"_classCallCheck");function K5(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&nl(i,e)}o(K5,"_inherits");function X5(i){var e=Mb();return o(function(){var r=al(i),s;if(e){var n=al(this).constructor;s=Reflect.construct(r,arguments,n)}else s=r.apply(this,arguments);return Y5(this,s)},"_createSuperInternal")}o(X5,"_createSuper");function Y5(i,e){if(e&&(en(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Q5(i)}o(Y5,"_possibleConstructorReturn");function Q5(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}o(Q5,"_assertThisInitialized");function Op(i){var e=typeof Map=="function"?new Map:void 0;return Op=o(function(r){if(r===null||!J5(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,s)}function s(){return tc(r,arguments,al(this).constructor)}return o(s,"Wrapper"),s.prototype=Object.create(r.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),nl(s,r)},"_wrapNativeSuper"),Op(i)}o(Op,"_wrapNativeSuper");function tc(i,e,t){return Mb()?tc=Reflect.construct.bind():tc=o(function(s,n,a){var l=[null];l.push.apply(l,n);var u=Function.bind.apply(s,l),h=new u;return a&&nl(h,a.prototype),h},"_construct"),tc.apply(null,arguments)}o(tc,"_construct");function Mb(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}o(Mb,"_isNativeReflectConstruct");function J5(i){try{return Function.toString.call(i).indexOf("[native code]")!==-1}catch{return typeof i=="function"}}o(J5,"_isNativeFunction");function nl(i,e){return nl=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(r,s){return r.__proto__=s,r},"_setPrototypeOf"),nl(i,e)}o(nl,"_setPrototypeOf");function al(i){return al=Object.setPrototypeOf?Object.getPrototypeOf.bind():o(function(t){return t.__proto__||Object.getPrototypeOf(t)},"_getPrototypeOf"),al(i)}o(al,"_getPrototypeOf");var Z5=function(i){K5(t,i);var e=X5(t);function t(r){var s,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(G5(this,t),s=e.call(this,r),s.originalRequest=a,s.originalResponse=l,s.causingError=n,n!=null&&(r+=", caused by ".concat(n.toString())),a!=null){var u=a.getHeader("X-Request-ID")||"n/a",h=a.getMethod(),d=a.getURL(),f=l?l.getStatus():"n/a",y=l?l.getBody()||"":"n/a";r+=", originated from request (method: ".concat(h,", url: ").concat(d,", response code: ").concat(f,", response text: ").concat(y,", request id: ").concat(u,")")}return s.message=r,s}return o(t,"DetailedError"),$5(t)}(Op(Error)),tn=Z5;var ex=!1;function cs(i){ex&&console.log(i)}o(cs,"log");function Cp(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var e=Math.random()*16|0,t=i==="x"?e:e&3|8;return t.toString(16)})}o(Cp,"uuid");function Ap(){"use strict";Ap=o(function(){return e},"_regeneratorRuntime");var i,e={},t=Object.prototype,r=t.hasOwnProperty,s=Object.defineProperty||function(O,P,E){O[P]=E.value},n=typeof Symbol=="function"?Symbol:{},a=n.iterator||"@@iterator",l=n.asyncIterator||"@@asyncIterator",u=n.toStringTag||"@@toStringTag";function h(O,P,E){return Object.defineProperty(O,P,{value:E,enumerable:!0,configurable:!0,writable:!0}),O[P]}o(h,"define");try{h({},"")}catch{h=o(function(E,L,z){return E[L]=z},"define")}function d(O,P,E,L){var z=P&&P.prototype instanceof _?P:_,B=Object.create(z.prototype),D=new Pe(L||[]);return s(B,"_invoke",{value:Te(O,E,D)}),B}o(d,"wrap");function f(O,P,E){try{return{type:"normal",arg:O.call(P,E)}}catch(L){return{type:"throw",arg:L}}}o(f,"tryCatch"),e.wrap=d;var y="suspendedStart",w="suspendedYield",S="executing",T="completed",C={};function _(){}o(_,"Generator");function R(){}o(R,"GeneratorFunction");function q(){}o(q,"GeneratorFunctionPrototype");var W={};h(W,a,function(){return this});var K=Object.getPrototypeOf,$=K&&K(K(Ie([])));$&&$!==t&&r.call($,a)&&(W=$);var G=q.prototype=_.prototype=Object.create(W);function te(O){["next","throw","return"].forEach(function(P){h(O,P,function(E){return this._invoke(P,E)})})}o(te,"defineIteratorMethods");function re(O,P){function E(z,B,D,A){var k=f(O[z],O,B);if(k.type!=="throw"){var N=k.arg,Y=N.value;return Y&&wo(Y)=="object"&&r.call(Y,"__await")?P.resolve(Y.__await).then(function(Q){E("next",Q,D,A)},function(Q){E("throw",Q,D,A)}):P.resolve(Y).then(function(Q){N.value=Q,D(N)},function(Q){return E("throw",Q,D,A)})}A(k.arg)}o(E,"invoke");var L;s(this,"_invoke",{value:o(function(B,D){function A(){return new P(function(k,N){E(B,D,k,N)})}return o(A,"callInvokeWithMethodAndArg"),L=L?L.then(A,A):A()},"value")})}o(re,"AsyncIterator");function Te(O,P,E){var L=y;return function(z,B){if(L===S)throw new Error("Generator is already running");if(L===T){if(z==="throw")throw B;return{value:i,done:!0}}for(E.method=z,E.arg=B;;){var D=E.delegate;if(D){var A=Ke(D,E);if(A){if(A===C)continue;return A}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(L===y)throw L=T,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);L=S;var k=f(O,P,E);if(k.type==="normal"){if(L=E.done?T:w,k.arg===C)continue;return{value:k.arg,done:E.done}}k.type==="throw"&&(L=T,E.method="throw",E.arg=k.arg)}}}o(Te,"makeInvokeMethod");function Ke(O,P){var E=P.method,L=O.iterator[E];if(L===i)return P.delegate=null,E==="throw"&&O.iterator.return&&(P.method="return",P.arg=i,Ke(O,P),P.method==="throw")||E!=="return"&&(P.method="throw",P.arg=new TypeError("The iterator does not provide a '"+E+"' method")),C;var z=f(L,O.iterator,P.arg);if(z.type==="throw")return P.method="throw",P.arg=z.arg,P.delegate=null,C;var B=z.arg;return B?B.done?(P[O.resultName]=B.value,P.next=O.nextLoc,P.method!=="return"&&(P.method="next",P.arg=i),P.delegate=null,C):B:(P.method="throw",P.arg=new TypeError("iterator result is not an object"),P.delegate=null,C)}o(Ke,"maybeInvokeDelegate");function He(O){var P={tryLoc:O[0]};1 in O&&(P.catchLoc=O[1]),2 in O&&(P.finallyLoc=O[2],P.afterLoc=O[3]),this.tryEntries.push(P)}o(He,"pushTryEntry");function we(O){var P=O.completion||{};P.type="normal",delete P.arg,O.completion=P}o(we,"resetTryEntry");function Pe(O){this.tryEntries=[{tryLoc:"root"}],O.forEach(He,this),this.reset(!0)}o(Pe,"Context");function Ie(O){if(O||O===""){var P=O[a];if(P)return P.call(O);if(typeof O.next=="function")return O;if(!isNaN(O.length)){var E=-1,L=o(function z(){for(;++E<O.length;)if(r.call(O,E))return z.value=O[E],z.done=!1,z;return z.value=i,z.done=!0,z},"next");return L.next=L}}throw new TypeError(wo(O)+" is not iterable")}return o(Ie,"values"),R.prototype=q,s(G,"constructor",{value:q,configurable:!0}),s(q,"constructor",{value:R,configurable:!0}),R.displayName=h(q,u,"GeneratorFunction"),e.isGeneratorFunction=function(O){var P=typeof O=="function"&&O.constructor;return!!P&&(P===R||(P.displayName||P.name)==="GeneratorFunction")},e.mark=function(O){return Object.setPrototypeOf?Object.setPrototypeOf(O,q):(O.__proto__=q,h(O,u,"GeneratorFunction")),O.prototype=Object.create(G),O},e.awrap=function(O){return{__await:O}},te(re.prototype),h(re.prototype,l,function(){return this}),e.AsyncIterator=re,e.async=function(O,P,E,L,z){z===void 0&&(z=Promise);var B=new re(d(O,P,E,L),z);return e.isGeneratorFunction(P)?B:B.next().then(function(D){return D.done?D.value:B.next()})},te(G),h(G,u,"Generator"),h(G,a,function(){return this}),h(G,"toString",function(){return"[object Generator]"}),e.keys=function(O){var P=Object(O),E=[];for(var L in P)E.push(L);return E.reverse(),o(function z(){for(;E.length;){var B=E.pop();if(B in P)return z.value=B,z.done=!1,z}return z.done=!0,z},"next")},e.values=Ie,Pe.prototype={constructor:Pe,reset:o(function(P){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(we),!P)for(var E in this)E.charAt(0)==="t"&&r.call(this,E)&&!isNaN(+E.slice(1))&&(this[E]=i)},"reset"),stop:o(function(){this.done=!0;var P=this.tryEntries[0].completion;if(P.type==="throw")throw P.arg;return this.rval},"stop"),dispatchException:o(function(P){if(this.done)throw P;var E=this;function L(N,Y){return D.type="throw",D.arg=P,E.next=N,Y&&(E.method="next",E.arg=i),!!Y}o(L,"handle");for(var z=this.tryEntries.length-1;z>=0;--z){var B=this.tryEntries[z],D=B.completion;if(B.tryLoc==="root")return L("end");if(B.tryLoc<=this.prev){var A=r.call(B,"catchLoc"),k=r.call(B,"finallyLoc");if(A&&k){if(this.prev<B.catchLoc)return L(B.catchLoc,!0);if(this.prev<B.finallyLoc)return L(B.finallyLoc)}else if(A){if(this.prev<B.catchLoc)return L(B.catchLoc,!0)}else{if(!k)throw new Error("try statement without catch or finally");if(this.prev<B.finallyLoc)return L(B.finallyLoc)}}}},"dispatchException"),abrupt:o(function(P,E){for(var L=this.tryEntries.length-1;L>=0;--L){var z=this.tryEntries[L];if(z.tryLoc<=this.prev&&r.call(z,"finallyLoc")&&this.prev<z.finallyLoc){var B=z;break}}B&&(P==="break"||P==="continue")&&B.tryLoc<=E&&E<=B.finallyLoc&&(B=null);var D=B?B.completion:{};return D.type=P,D.arg=E,B?(this.method="next",this.next=B.finallyLoc,C):this.complete(D)},"abrupt"),complete:o(function(P,E){if(P.type==="throw")throw P.arg;return P.type==="break"||P.type==="continue"?this.next=P.arg:P.type==="return"?(this.rval=this.arg=P.arg,this.method="return",this.next="end"):P.type==="normal"&&E&&(this.next=E),C},"complete"),finish:o(function(P){for(var E=this.tryEntries.length-1;E>=0;--E){var L=this.tryEntries[E];if(L.finallyLoc===P)return this.complete(L.completion,L.afterLoc),we(L),C}},"finish"),catch:o(function(P){for(var E=this.tryEntries.length-1;E>=0;--E){var L=this.tryEntries[E];if(L.tryLoc===P){var z=L.completion;if(z.type==="throw"){var B=z.arg;we(L)}return B}}throw new Error("illegal catch attempt")},"_catch"),delegateYield:o(function(P,E,L){return this.delegate={iterator:Ie(P),resultName:E,nextLoc:L},this.method==="next"&&(this.arg=i),C},"delegateYield")},e}o(Ap,"_regeneratorRuntime");function Bb(i,e,t,r,s,n,a){try{var l=i[n](a),u=l.value}catch(h){t(h);return}l.done?e(u):Promise.resolve(u).then(r,s)}o(Bb,"asyncGeneratorStep");function tx(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function a(u){Bb(n,r,s,a,l,"next",u)}o(a,"_next");function l(u){Bb(n,r,s,a,l,"throw",u)}o(l,"_throw"),a(void 0)})}}o(tx,"_asyncToGenerator");function Kb(i,e){return ox(i)||sx(i,e)||rx(i,e)||ix()}o(Kb,"_slicedToArray");function ix(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}o(ix,"_nonIterableRest");function rx(i,e){if(i){if(typeof i=="string")return jb(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return jb(i,e)}}o(rx,"_unsupportedIterableToArray");function jb(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}o(jb,"_arrayLikeToArray");function sx(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var r,s,n,a,l=[],u=!0,h=!1;try{if(n=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(r=n.call(t)).done)&&(l.push(r.value),l.length!==e);u=!0);}catch(d){h=!0,s=d}finally{try{if(!u&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(h)throw s}}return l}}o(sx,"_iterableToArrayLimit");function ox(i){if(Array.isArray(i))return i}o(ox,"_arrayWithHoles");function wo(i){"@babel/helpers - typeof";return wo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wo(i)}o(wo,"_typeof");function zb(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,r)}return t}o(zb,"ownKeys");function rn(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?zb(Object(t),!0).forEach(function(r){nx(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):zb(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}o(rn,"_objectSpread");function nx(i,e,t){return e=Xb(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}o(nx,"_defineProperty");function ax(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(ax,"_classCallCheck");function Hb(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Xb(r.key),r)}}o(Hb,"_defineProperties");function lx(i,e,t){return e&&Hb(i.prototype,e),t&&Hb(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(lx,"_createClass");function Xb(i){var e=ux(i,"string");return wo(e)==="symbol"?e:String(e)}o(Xb,"_toPropertyKey");function ux(i,e){if(wo(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(wo(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}o(ux,"_toPrimitive");var cx={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,onShouldRetry:Jb,chunkSize:1/0,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null},Qb=function(){function i(e,t){ax(this,i),"resume"in t&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=t,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return o(i,"BaseUpload"),lx(i,[{key:"findPreviousUploads",value:o(function(){var t=this;return this.options.fingerprint(this.file,this.options).then(function(r){return t._urlStorage.findUploadsByFingerprint(r)})},"findPreviousUploads")},{key:"resumeFromPreviousUpload",value:o(function(t){this.url=t.uploadUrl||null,this._parallelUploadUrls=t.parallelUploadUrls||null,this._urlStorageKey=t.urlStorageKey},"resumeFromPreviousUpload")},{key:"start",value:o(function(){var t=this,r=this.file;if(!r){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var s=this.options.retryDelays;if(s!=null&&Object.prototype.toString.call(s)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var n=0,a=["uploadUrl","uploadSize","uploadLengthDeferred"];n<a.length;n++){var l=a[n];if(this.options[l]){this._emitError(new Error("tus: cannot use the ".concat(l," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(r,this.options).then(function(u){return u==null?cs("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):cs("Calculated fingerprint: ".concat(u)),t._fingerprint=u,t._source?t._source:t.options.fileReader.openFile(r,t.options.chunkSize)}).then(function(u){if(t._source=u,t.options.uploadLengthDeferred)t._size=null;else if(t.options.uploadSize!=null){if(t._size=Number(t.options.uploadSize),Number.isNaN(t._size)){t._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(t._size=t._source.size,t._size==null){t._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}t.options.parallelUploads>1||t._parallelUploadUrls!=null?t._startParallelUpload():t._startSingleUpload()}).catch(function(u){t._emitError(u)})},"start")},{key:"_startParallelUpload",value:o(function(){var t,r=this,s=this._size,n=0;this._parallelUploads=[];var a=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,l=(t=this.options.parallelUploadBoundaries)!==null&&t!==void 0?t:dx(this._source.size,a);this._parallelUploadUrls&&l.forEach(function(d,f){d.uploadUrl=r._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(l.length);var u=l.map(function(d,f){var y=0;return r._source.slice(d.start,d.end).then(function(w){var S=w.value;return new Promise(function(T,C){var _=rn(rn({},r.options),{},{uploadUrl:d.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:{},headers:rn(rn({},r.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:T,onError:C,onProgress:o(function(W){n=n-y+W,y=W,r._emitProgress(n,s)},"onProgress"),onUploadUrlAvailable:o(function(){r._parallelUploadUrls[f]=R.url,r._parallelUploadUrls.filter(function(W){return!!W}).length===l.length&&r._saveUploadInUrlStorage()},"onUploadUrlAvailable")}),R=new i(S,_);R.start(),r._parallelUploads.push(R)})})}),h;Promise.all(u).then(function(){h=r._openRequest("POST",r.options.endpoint),h.setHeader("Upload-Concat","final;".concat(r._parallelUploadUrls.join(" ")));var d=qb(r.options.metadata);return d!==""&&h.setHeader("Upload-Metadata",d),r._sendRequest(h,null)}).then(function(d){if(!sn(d.getStatus(),200)){r._emitHttpError(h,d,"tus: unexpected response while creating upload");return}var f=d.getHeader("Location");if(f==null){r._emitHttpError(h,d,"tus: invalid or missing Location header");return}r.url=Gb(r.options.endpoint,f),cs("Created upload at ".concat(r.url)),r._emitSuccess()}).catch(function(d){r._emitError(d)})},"_startParallelUpload")},{key:"_startSingleUpload",value:o(function(){if(this._aborted=!1,this.url!=null){cs("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){cs("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}cs("Creating a new upload"),this._createUpload()},"_startSingleUpload")},{key:"abort",value:o(function(t){var r=this;return this._parallelUploads!=null&&this._parallelUploads.forEach(function(s){s.abort(t)}),this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!t||this.url==null?Promise.resolve():i.terminate(this.url,this.options).then(function(){return r._removeFromUrlStorage()})},"abort")},{key:"_emitHttpError",value:o(function(t,r,s,n){this._emitError(new tn(s,n,t,r))},"_emitHttpError")},{key:"_emitError",value:o(function(t){var r=this;if(!this._aborted){if(this.options.retryDelays!=null){var s=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(s&&(this._retryAttempt=0),Wb(t,this._retryAttempt,this.options)){var n=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){r.start()},n);return}}if(typeof this.options.onError=="function")this.options.onError(t);else throw t}},"_emitError")},{key:"_emitSuccess",value:o(function(){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess()},"_emitSuccess")},{key:"_emitProgress",value:o(function(t,r){typeof this.options.onProgress=="function"&&this.options.onProgress(t,r)},"_emitProgress")},{key:"_emitChunkComplete",value:o(function(t,r,s){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(t,r,s)},"_emitChunkComplete")},{key:"_createUpload",value:o(function(){var t=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var r=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?r.setHeader("Upload-Defer-Length",1):r.setHeader("Upload-Length",this._size);var s=qb(this.options.metadata);s!==""&&r.setHeader("Upload-Metadata",s);var n;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,n=this._addChunkToRequest(r)):n=this._sendRequest(r,null),n.then(function(a){if(!sn(a.getStatus(),200)){t._emitHttpError(r,a,"tus: unexpected response while creating upload");return}var l=a.getHeader("Location");if(l==null){t._emitHttpError(r,a,"tus: invalid or missing Location header");return}if(t.url=Gb(t.options.endpoint,l),cs("Created upload at ".concat(t.url)),typeof t.options.onUploadUrlAvailable=="function"&&t.options.onUploadUrlAvailable(),t._size===0){t._emitSuccess(),t._source.close();return}t._saveUploadInUrlStorage().then(function(){t.options.uploadDataDuringCreation?t._handleUploadResponse(r,a):(t._offset=0,t._performUpload())})}).catch(function(a){t._emitHttpError(r,null,"tus: failed to create upload",a)})},"_createUpload")},{key:"_resumeUpload",value:o(function(){var t=this,r=this._openRequest("HEAD",this.url),s=this._sendRequest(r,null);s.then(function(n){var a=n.getStatus();if(!sn(a,200)){if(a===423){t._emitHttpError(r,n,"tus: upload is currently locked; retry later");return}if(sn(a,400)&&t._removeFromUrlStorage(),!t.options.endpoint){t._emitHttpError(r,n,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}t.url=null,t._createUpload();return}var l=parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(l)){t._emitHttpError(r,n,"tus: invalid or missing offset value");return}var u=parseInt(n.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!t.options.uploadLengthDeferred){t._emitHttpError(r,n,"tus: invalid or missing length value");return}typeof t.options.onUploadUrlAvailable=="function"&&t.options.onUploadUrlAvailable(),t._saveUploadInUrlStorage().then(function(){if(l===u){t._emitProgress(u,u),t._emitSuccess();return}t._offset=l,t._performUpload()})}).catch(function(n){t._emitHttpError(r,null,"tus: failed to resume upload",n)})},"_resumeUpload")},{key:"_performUpload",value:o(function(){var t=this;if(!this._aborted){var r;this.options.overridePatchMethod?(r=this._openRequest("POST",this.url),r.setHeader("X-HTTP-Method-Override","PATCH")):r=this._openRequest("PATCH",this.url),r.setHeader("Upload-Offset",this._offset);var s=this._addChunkToRequest(r);s.then(function(n){if(!sn(n.getStatus(),200)){t._emitHttpError(r,n,"tus: unexpected response while uploading chunk");return}t._handleUploadResponse(r,n)}).catch(function(n){t._aborted||t._emitHttpError(r,null,"tus: failed to upload chunk at offset ".concat(t._offset),n)})}},"_performUpload")},{key:"_addChunkToRequest",value:o(function(t){var r=this,s=this._offset,n=this._offset+this.options.chunkSize;return t.setProgressHandler(function(a){r._emitProgress(s+a,r._size)}),t.setHeader("Content-Type","application/offset+octet-stream"),(n===1/0||n>this._size)&&!this.options.uploadLengthDeferred&&(n=this._size),this._source.slice(s,n).then(function(a){var l=a.value,u=a.done,h=l&&l.size?l.size:0;r.options.uploadLengthDeferred&&u&&(r._size=r._offset+h,t.setHeader("Upload-Length",r._size));var d=r._offset+h;return!r.options.uploadLengthDeferred&&u&&d!==r._size?Promise.reject(new Error("upload was configured with a size of ".concat(r._size," bytes, but the source is done after ").concat(d," bytes"))):l===null?r._sendRequest(t):(r._emitProgress(r._offset,r._size),r._sendRequest(t,l))})},"_addChunkToRequest")},{key:"_handleUploadResponse",value:o(function(t,r){var s=parseInt(r.getHeader("Upload-Offset"),10);if(Number.isNaN(s)){this._emitHttpError(t,r,"tus: invalid or missing offset value");return}if(this._emitProgress(s,this._size),this._emitChunkComplete(s-this._offset,s,this._size),this._offset=s,s===this._size){this._emitSuccess(),this._source.close();return}this._performUpload()},"_handleUploadResponse")},{key:"_openRequest",value:o(function(t,r){var s=$b(t,r,this.options);return this._req=s,s},"_openRequest")},{key:"_removeFromUrlStorage",value:o(function(){var t=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(r){t._emitError(r)}),this._urlStorageKey=null)},"_removeFromUrlStorage")},{key:"_saveUploadInUrlStorage",value:o(function(){var t=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var r={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?r.parallelUploadUrls=this._parallelUploadUrls:r.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,r).then(function(s){t._urlStorageKey=s})},"_saveUploadInUrlStorage")},{key:"_sendRequest",value:o(function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Vb(t,r,this.options)},"_sendRequest")}],[{key:"terminate",value:o(function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=$b("DELETE",t,r);return Vb(s,null,r).then(function(n){if(n.getStatus()!==204)throw new tn("tus: unexpected response while terminating upload",null,s,n)}).catch(function(n){if(n instanceof tn||(n=new tn("tus: failed to terminate upload",n,s,null)),!Wb(n,0,r))throw n;var a=r.retryDelays[0],l=r.retryDelays.slice(1),u=rn(rn({},r),{},{retryDelays:l});return new Promise(function(h){return setTimeout(h,a)}).then(function(){return i.terminate(t,u)})})},"terminate")}]),i}();function qb(i){return Object.entries(i).map(function(e){var t=Kb(e,2),r=t[0],s=t[1];return"".concat(r," ").concat(_b.encode(String(s)))}).join(",")}o(qb,"encodeMetadata");function sn(i,e){return i>=e&&i<e+100}o(sn,"inStatusCategory");function $b(i,e,t){var r=t.httpStack.createRequest(i,e);r.setHeader("Tus-Resumable","1.0.0");var s=t.headers||{};if(Object.entries(s).forEach(function(a){var l=Kb(a,2),u=l[0],h=l[1];r.setHeader(u,h)}),t.addRequestId){var n=Cp();r.setHeader("X-Request-ID",n)}return r}o($b,"openRequest");function Vb(i,e,t){return Tp.apply(this,arguments)}o(Vb,"sendRequest");function Tp(){return Tp=tx(Ap().mark(o(function i(e,t,r){var s;return Ap().wrap(o(function(a){for(;;)switch(a.prev=a.next){case 0:if(typeof r.onBeforeRequest!="function"){a.next=3;break}return a.next=3,r.onBeforeRequest(e);case 3:return a.next=5,e.send(t);case 5:if(s=a.sent,typeof r.onAfterResponse!="function"){a.next=9;break}return a.next=9,r.onAfterResponse(e,s);case 9:return a.abrupt("return",s);case 10:case"end":return a.stop()}},"_callee$"),i)},"_callee"))),Tp.apply(this,arguments)}o(Tp,"_sendRequest2");function hx(){var i=!0;return typeof window<"u"&&"navigator"in window&&window.navigator.onLine===!1&&(i=!1),i}o(hx,"isOnline");function Wb(i,e,t){return t.retryDelays==null||e>=t.retryDelays.length||i.originalRequest==null?!1:t&&typeof t.onShouldRetry=="function"?t.onShouldRetry(i,e,t):Jb(i)}o(Wb,"shouldRetry");function Jb(i){var e=i.originalResponse?i.originalResponse.getStatus():0;return(!sn(e,400)||e===409||e===423)&&hx()}o(Jb,"defaultOnShouldRetry");function Gb(i,e){return new Yb.default(e,i).toString()}o(Gb,"resolveUrl");function dx(i,e){for(var t=Math.floor(i/e),r=[],s=0;s<e;s++)r.push({start:t*s,end:t*(s+1)});return r[e-1].end=i,r}o(dx,"splitSizeIntoParts");Qb.defaultOptions=cx;var ic=Qb;function ll(i){"@babel/helpers - typeof";return ll=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ll(i)}o(ll,"_typeof");function px(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(px,"_classCallCheck");function Zb(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,mx(r.key),r)}}o(Zb,"_defineProperties");function fx(i,e,t){return e&&Zb(i.prototype,e),t&&Zb(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(fx,"_createClass");function mx(i){var e=gx(i,"string");return ll(e)==="symbol"?e:String(e)}o(mx,"_toPropertyKey");function gx(i,e){if(ll(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(ll(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}o(gx,"_toPrimitive");var e0=function(){function i(){px(this,i)}return o(i,"NoopUrlStorage"),fx(i,[{key:"listAllUploads",value:o(function(){return Promise.resolve([])},"listAllUploads")},{key:"findUploadsByFingerprint",value:o(function(t){return Promise.resolve([])},"findUploadsByFingerprint")},{key:"removeUpload",value:o(function(t){return Promise.resolve()},"removeUpload")},{key:"addUpload",value:o(function(t,r){return Promise.resolve(null)},"addUpload")}]),i}();function ul(i){"@babel/helpers - typeof";return ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ul(i)}o(ul,"_typeof");function yx(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(yx,"_classCallCheck");function t0(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,bx(r.key),r)}}o(t0,"_defineProperties");function vx(i,e,t){return e&&t0(i.prototype,e),t&&t0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(vx,"_createClass");function bx(i){var e=wx(i,"string");return ul(e)==="symbol"?e:String(e)}o(bx,"_toPropertyKey");function wx(i,e){if(ul(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(ul(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}o(wx,"_toPrimitive");var kp=!1;try{kp="localStorage"in window,rc="tusSupport",Rp=localStorage.getItem(rc),localStorage.setItem(rc,Rp),Rp===null&&localStorage.removeItem(rc)}catch(i){if(i.code===i.SECURITY_ERR||i.code===i.QUOTA_EXCEEDED_ERR)kp=!1;else throw i}var rc,Rp,i0=kp,r0=function(){function i(){yx(this,i)}return o(i,"WebStorageUrlStorage"),vx(i,[{key:"findAllUploads",value:o(function(){var t=this._findEntries("tus::");return Promise.resolve(t)},"findAllUploads")},{key:"findUploadsByFingerprint",value:o(function(t){var r=this._findEntries("tus::".concat(t,"::"));return Promise.resolve(r)},"findUploadsByFingerprint")},{key:"removeUpload",value:o(function(t){return localStorage.removeItem(t),Promise.resolve()},"removeUpload")},{key:"addUpload",value:o(function(t,r){var s=Math.round(Math.random()*1e12),n="tus::".concat(t,"::").concat(s);return localStorage.setItem(n,JSON.stringify(r)),Promise.resolve(n)},"addUpload")},{key:"_findEntries",value:o(function(t){for(var r=[],s=0;s<localStorage.length;s++){var n=localStorage.key(s);if(n.indexOf(t)===0)try{var a=JSON.parse(localStorage.getItem(n));a.urlStorageKey=n,r.push(a)}catch{}}return r},"_findEntries")}]),i}();function cl(i){"@babel/helpers - typeof";return cl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cl(i)}o(cl,"_typeof");function Up(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(Up,"_classCallCheck");function s0(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Sx(r.key),r)}}o(s0,"_defineProperties");function Dp(i,e,t){return e&&s0(i.prototype,e),t&&s0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(Dp,"_createClass");function Sx(i){var e=Px(i,"string");return cl(e)==="symbol"?e:String(e)}o(Sx,"_toPropertyKey");function Px(i,e){if(cl(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(cl(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}o(Px,"_toPrimitive");var o0=function(){function i(){Up(this,i)}return o(i,"XHRHttpStack"),Dp(i,[{key:"createRequest",value:o(function(t,r){return new _x(t,r)},"createRequest")},{key:"getName",value:o(function(){return"XHRHttpStack"},"getName")}]),i}();var _x=function(){function i(e,t){Up(this,i),this._xhr=new XMLHttpRequest,this._xhr.open(e,t,!0),this._method=e,this._url=t,this._headers={}}return o(i,"Request"),Dp(i,[{key:"getMethod",value:o(function(){return this._method},"getMethod")},{key:"getURL",value:o(function(){return this._url},"getURL")},{key:"setHeader",value:o(function(t,r){this._xhr.setRequestHeader(t,r),this._headers[t]=r},"setHeader")},{key:"getHeader",value:o(function(t){return this._headers[t]},"getHeader")},{key:"setProgressHandler",value:o(function(t){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(r){r.lengthComputable&&t(r.loaded)})},"setProgressHandler")},{key:"send",value:o(function(){var t=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(s,n){t._xhr.onload=function(){s(new xx(t._xhr))},t._xhr.onerror=function(a){n(a)},t._xhr.send(r)})},"send")},{key:"abort",value:o(function(){return this._xhr.abort(),Promise.resolve()},"abort")},{key:"getUnderlyingObject",value:o(function(){return this._xhr},"getUnderlyingObject")}]),i}(),xx=function(){function i(e){Up(this,i),this._xhr=e}return o(i,"Response"),Dp(i,[{key:"getStatus",value:o(function(){return this._xhr.status},"getStatus")},{key:"getHeader",value:o(function(t){return this._xhr.getResponseHeader(t)},"getHeader")},{key:"getBody",value:o(function(){return this._xhr.responseText},"getBody")},{key:"getUnderlyingObject",value:o(function(){return this._xhr},"getUnderlyingObject")}]),i}();var Fx=o(function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"},"isReactNative"),sc=Fx;function Ip(i){return new Promise(function(e,t){var r=new XMLHttpRequest;r.responseType="blob",r.onload=function(){var s=r.response;e(s)},r.onerror=function(s){t(s)},r.open("GET",i),r.send()})}o(Ip,"uriToBlob");var Ex=o(function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")},"isCordova"),n0=Ex;function Lp(i){return new Promise(function(e,t){var r=new FileReader;r.onload=function(){var s=new Uint8Array(r.result);e({value:s})},r.onerror=function(s){t(s)},r.readAsArrayBuffer(i)})}o(Lp,"readAsByteArray");function hl(i){"@babel/helpers - typeof";return hl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hl(i)}o(hl,"_typeof");function Ox(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(Ox,"_classCallCheck");function a0(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Ax(r.key),r)}}o(a0,"_defineProperties");function Cx(i,e,t){return e&&a0(i.prototype,e),t&&a0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(Cx,"_createClass");function Ax(i){var e=Tx(i,"string");return hl(e)==="symbol"?e:String(e)}o(Ax,"_toPropertyKey");function Tx(i,e){if(hl(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(hl(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}o(Tx,"_toPrimitive");var Np=function(){function i(e){Ox(this,i),this._file=e,this.size=e.size}return o(i,"FileSource"),Cx(i,[{key:"slice",value:o(function(t,r){if(n0())return Lp(this._file.slice(t,r));var s=this._file.slice(t,r),n=r>=this.size;return Promise.resolve({value:s,done:n})},"slice")},{key:"close",value:o(function(){},"close")}]),i}();function dl(i){"@babel/helpers - typeof";return dl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dl(i)}o(dl,"_typeof");function Rx(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(Rx,"_classCallCheck");function l0(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Ux(r.key),r)}}o(l0,"_defineProperties");function kx(i,e,t){return e&&l0(i.prototype,e),t&&l0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(kx,"_createClass");function Ux(i){var e=Dx(i,"string");return dl(e)==="symbol"?e:String(e)}o(Ux,"_toPropertyKey");function Dx(i,e){if(dl(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(dl(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}o(Dx,"_toPrimitive");function u0(i){return i===void 0?0:i.size!==void 0?i.size:i.length}o(u0,"len");function Ix(i,e){if(i.concat)return i.concat(e);if(i instanceof Blob)return new Blob([i,e],{type:i.type});if(i.set){var t=new i.constructor(i.length+e.length);return t.set(i),t.set(e,i.length),t}throw new Error("Unknown data type")}o(Ix,"concat");var c0=function(){function i(e){Rx(this,i),this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}return o(i,"StreamSource"),kx(i,[{key:"slice",value:o(function(t,r){return t<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(t,r)},"slice")},{key:"_readUntilEnoughDataOrDone",value:o(function(t,r){var s=this,n=r<=this._bufferOffset+u0(this._buffer);if(this._done||n){var a=this._getDataFromBuffer(t,r),l=a==null?this._done:!1;return Promise.resolve({value:a,done:l})}return this._reader.read().then(function(u){var h=u.value,d=u.done;return d?s._done=!0:s._buffer===void 0?s._buffer=h:s._buffer=Ix(s._buffer,h),s._readUntilEnoughDataOrDone(t,r)})},"_readUntilEnoughDataOrDone")},{key:"_getDataFromBuffer",value:o(function(t,r){t>this._bufferOffset&&(this._buffer=this._buffer.slice(t-this._bufferOffset),this._bufferOffset=t);var s=u0(this._buffer)===0;return this._done&&s?null:this._buffer.slice(0,r-t)},"_getDataFromBuffer")},{key:"close",value:o(function(){this._reader.cancel&&this._reader.cancel()},"close")}]),i}();function So(i){"@babel/helpers - typeof";return So=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},So(i)}o(So,"_typeof");function Mp(){"use strict";Mp=o(function(){return e},"_regeneratorRuntime");var i,e={},t=Object.prototype,r=t.hasOwnProperty,s=Object.defineProperty||function(O,P,E){O[P]=E.value},n=typeof Symbol=="function"?Symbol:{},a=n.iterator||"@@iterator",l=n.asyncIterator||"@@asyncIterator",u=n.toStringTag||"@@toStringTag";function h(O,P,E){return Object.defineProperty(O,P,{value:E,enumerable:!0,configurable:!0,writable:!0}),O[P]}o(h,"define");try{h({},"")}catch{h=o(function(E,L,z){return E[L]=z},"define")}function d(O,P,E,L){var z=P&&P.prototype instanceof _?P:_,B=Object.create(z.prototype),D=new Pe(L||[]);return s(B,"_invoke",{value:Te(O,E,D)}),B}o(d,"wrap");function f(O,P,E){try{return{type:"normal",arg:O.call(P,E)}}catch(L){return{type:"throw",arg:L}}}o(f,"tryCatch"),e.wrap=d;var y="suspendedStart",w="suspendedYield",S="executing",T="completed",C={};function _(){}o(_,"Generator");function R(){}o(R,"GeneratorFunction");function q(){}o(q,"GeneratorFunctionPrototype");var W={};h(W,a,function(){return this});var K=Object.getPrototypeOf,$=K&&K(K(Ie([])));$&&$!==t&&r.call($,a)&&(W=$);var G=q.prototype=_.prototype=Object.create(W);function te(O){["next","throw","return"].forEach(function(P){h(O,P,function(E){return this._invoke(P,E)})})}o(te,"defineIteratorMethods");function re(O,P){function E(z,B,D,A){var k=f(O[z],O,B);if(k.type!=="throw"){var N=k.arg,Y=N.value;return Y&&So(Y)=="object"&&r.call(Y,"__await")?P.resolve(Y.__await).then(function(Q){E("next",Q,D,A)},function(Q){E("throw",Q,D,A)}):P.resolve(Y).then(function(Q){N.value=Q,D(N)},function(Q){return E("throw",Q,D,A)})}A(k.arg)}o(E,"invoke");var L;s(this,"_invoke",{value:o(function(B,D){function A(){return new P(function(k,N){E(B,D,k,N)})}return o(A,"callInvokeWithMethodAndArg"),L=L?L.then(A,A):A()},"value")})}o(re,"AsyncIterator");function Te(O,P,E){var L=y;return function(z,B){if(L===S)throw new Error("Generator is already running");if(L===T){if(z==="throw")throw B;return{value:i,done:!0}}for(E.method=z,E.arg=B;;){var D=E.delegate;if(D){var A=Ke(D,E);if(A){if(A===C)continue;return A}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(L===y)throw L=T,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);L=S;var k=f(O,P,E);if(k.type==="normal"){if(L=E.done?T:w,k.arg===C)continue;return{value:k.arg,done:E.done}}k.type==="throw"&&(L=T,E.method="throw",E.arg=k.arg)}}}o(Te,"makeInvokeMethod");function Ke(O,P){var E=P.method,L=O.iterator[E];if(L===i)return P.delegate=null,E==="throw"&&O.iterator.return&&(P.method="return",P.arg=i,Ke(O,P),P.method==="throw")||E!=="return"&&(P.method="throw",P.arg=new TypeError("The iterator does not provide a '"+E+"' method")),C;var z=f(L,O.iterator,P.arg);if(z.type==="throw")return P.method="throw",P.arg=z.arg,P.delegate=null,C;var B=z.arg;return B?B.done?(P[O.resultName]=B.value,P.next=O.nextLoc,P.method!=="return"&&(P.method="next",P.arg=i),P.delegate=null,C):B:(P.method="throw",P.arg=new TypeError("iterator result is not an object"),P.delegate=null,C)}o(Ke,"maybeInvokeDelegate");function He(O){var P={tryLoc:O[0]};1 in O&&(P.catchLoc=O[1]),2 in O&&(P.finallyLoc=O[2],P.afterLoc=O[3]),this.tryEntries.push(P)}o(He,"pushTryEntry");function we(O){var P=O.completion||{};P.type="normal",delete P.arg,O.completion=P}o(we,"resetTryEntry");function Pe(O){this.tryEntries=[{tryLoc:"root"}],O.forEach(He,this),this.reset(!0)}o(Pe,"Context");function Ie(O){if(O||O===""){var P=O[a];if(P)return P.call(O);if(typeof O.next=="function")return O;if(!isNaN(O.length)){var E=-1,L=o(function z(){for(;++E<O.length;)if(r.call(O,E))return z.value=O[E],z.done=!1,z;return z.value=i,z.done=!0,z},"next");return L.next=L}}throw new TypeError(So(O)+" is not iterable")}return o(Ie,"values"),R.prototype=q,s(G,"constructor",{value:q,configurable:!0}),s(q,"constructor",{value:R,configurable:!0}),R.displayName=h(q,u,"GeneratorFunction"),e.isGeneratorFunction=function(O){var P=typeof O=="function"&&O.constructor;return!!P&&(P===R||(P.displayName||P.name)==="GeneratorFunction")},e.mark=function(O){return Object.setPrototypeOf?Object.setPrototypeOf(O,q):(O.__proto__=q,h(O,u,"GeneratorFunction")),O.prototype=Object.create(G),O},e.awrap=function(O){return{__await:O}},te(re.prototype),h(re.prototype,l,function(){return this}),e.AsyncIterator=re,e.async=function(O,P,E,L,z){z===void 0&&(z=Promise);var B=new re(d(O,P,E,L),z);return e.isGeneratorFunction(P)?B:B.next().then(function(D){return D.done?D.value:B.next()})},te(G),h(G,u,"Generator"),h(G,a,function(){return this}),h(G,"toString",function(){return"[object Generator]"}),e.keys=function(O){var P=Object(O),E=[];for(var L in P)E.push(L);return E.reverse(),o(function z(){for(;E.length;){var B=E.pop();if(B in P)return z.value=B,z.done=!1,z}return z.done=!0,z},"next")},e.values=Ie,Pe.prototype={constructor:Pe,reset:o(function(P){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(we),!P)for(var E in this)E.charAt(0)==="t"&&r.call(this,E)&&!isNaN(+E.slice(1))&&(this[E]=i)},"reset"),stop:o(function(){this.done=!0;var P=this.tryEntries[0].completion;if(P.type==="throw")throw P.arg;return this.rval},"stop"),dispatchException:o(function(P){if(this.done)throw P;var E=this;function L(N,Y){return D.type="throw",D.arg=P,E.next=N,Y&&(E.method="next",E.arg=i),!!Y}o(L,"handle");for(var z=this.tryEntries.length-1;z>=0;--z){var B=this.tryEntries[z],D=B.completion;if(B.tryLoc==="root")return L("end");if(B.tryLoc<=this.prev){var A=r.call(B,"catchLoc"),k=r.call(B,"finallyLoc");if(A&&k){if(this.prev<B.catchLoc)return L(B.catchLoc,!0);if(this.prev<B.finallyLoc)return L(B.finallyLoc)}else if(A){if(this.prev<B.catchLoc)return L(B.catchLoc,!0)}else{if(!k)throw new Error("try statement without catch or finally");if(this.prev<B.finallyLoc)return L(B.finallyLoc)}}}},"dispatchException"),abrupt:o(function(P,E){for(var L=this.tryEntries.length-1;L>=0;--L){var z=this.tryEntries[L];if(z.tryLoc<=this.prev&&r.call(z,"finallyLoc")&&this.prev<z.finallyLoc){var B=z;break}}B&&(P==="break"||P==="continue")&&B.tryLoc<=E&&E<=B.finallyLoc&&(B=null);var D=B?B.completion:{};return D.type=P,D.arg=E,B?(this.method="next",this.next=B.finallyLoc,C):this.complete(D)},"abrupt"),complete:o(function(P,E){if(P.type==="throw")throw P.arg;return P.type==="break"||P.type==="continue"?this.next=P.arg:P.type==="return"?(this.rval=this.arg=P.arg,this.method="return",this.next="end"):P.type==="normal"&&E&&(this.next=E),C},"complete"),finish:o(function(P){for(var E=this.tryEntries.length-1;E>=0;--E){var L=this.tryEntries[E];if(L.finallyLoc===P)return this.complete(L.completion,L.afterLoc),we(L),C}},"finish"),catch:o(function(P){for(var E=this.tryEntries.length-1;E>=0;--E){var L=this.tryEntries[E];if(L.tryLoc===P){var z=L.completion;if(z.type==="throw"){var B=z.arg;we(L)}return B}}throw new Error("illegal catch attempt")},"_catch"),delegateYield:o(function(P,E,L){return this.delegate={iterator:Ie(P),resultName:E,nextLoc:L},this.method==="next"&&(this.arg=i),C},"delegateYield")},e}o(Mp,"_regeneratorRuntime");function h0(i,e,t,r,s,n,a){try{var l=i[n](a),u=l.value}catch(h){t(h);return}l.done?e(u):Promise.resolve(u).then(r,s)}o(h0,"asyncGeneratorStep");function Lx(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function a(u){h0(n,r,s,a,l,"next",u)}o(a,"_next");function l(u){h0(n,r,s,a,l,"throw",u)}o(l,"_throw"),a(void 0)})}}o(Lx,"_asyncToGenerator");function Nx(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(Nx,"_classCallCheck");function d0(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Bx(r.key),r)}}o(d0,"_defineProperties");function Mx(i,e,t){return e&&d0(i.prototype,e),t&&d0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(Mx,"_createClass");function Bx(i){var e=jx(i,"string");return So(e)==="symbol"?e:String(e)}o(Bx,"_toPropertyKey");function jx(i,e){if(So(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(So(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}o(jx,"_toPrimitive");var p0=function(){function i(){Nx(this,i)}return o(i,"FileReader"),Mx(i,[{key:"openFile",value:function(){var e=Lx(Mp().mark(o(function r(s,n){var a;return Mp().wrap(o(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(sc()&&s&&typeof s.uri<"u")){u.next=11;break}return u.prev=1,u.next=4,Ip(s.uri);case 4:return a=u.sent,u.abrupt("return",new Np(a));case 8:throw u.prev=8,u.t0=u.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(u.t0));case 11:if(!(typeof s.slice=="function"&&typeof s.size<"u")){u.next=13;break}return u.abrupt("return",Promise.resolve(new Np(s)));case 13:if(typeof s.read!="function"){u.next=18;break}if(n=Number(n),Number.isFinite(n)){u.next=17;break}return u.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return u.abrupt("return",Promise.resolve(new c0(s,n)));case 18:return u.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return u.stop()}},"_callee$"),r,null,[[1,8]])},"_callee")));function t(r,s){return e.apply(this,arguments)}return o(t,"openFile"),t}()}]),i}();function Bp(i,e){return sc()?Promise.resolve(zx(i,e)):Promise.resolve(["tus-br",i.name,i.type,i.size,i.lastModified,e.endpoint].join("-"))}o(Bp,"fingerprint");function zx(i,e){var t=i.exif?Hx(JSON.stringify(i.exif)):"noexif";return["tus-rn",i.name||"noname",i.size||"nosize",t,e.endpoint].join("/")}o(zx,"reactNativeFingerprint");function Hx(i){var e=0;if(i.length===0)return e;for(var t=0;t<i.length;t++){var r=i.charCodeAt(t);e=(e<<5)-e+r,e&=e}return e}o(Hx,"hashCode");function nn(i){"@babel/helpers - typeof";return nn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nn(i)}o(nn,"_typeof");function qx(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(qx,"_classCallCheck");function f0(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,y0(r.key),r)}}o(f0,"_defineProperties");function $x(i,e,t){return e&&f0(i.prototype,e),t&&f0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o($x,"_createClass");function Vx(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&jp(i,e)}o(Vx,"_inherits");function jp(i,e){return jp=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(r,s){return r.__proto__=s,r},"_setPrototypeOf"),jp(i,e)}o(jp,"_setPrototypeOf");function Wx(i){var e=Xx();return o(function(){var r=oc(i),s;if(e){var n=oc(this).constructor;s=Reflect.construct(r,arguments,n)}else s=r.apply(this,arguments);return Gx(this,s)},"_createSuperInternal")}o(Wx,"_createSuper");function Gx(i,e){if(e&&(nn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kx(i)}o(Gx,"_possibleConstructorReturn");function Kx(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}o(Kx,"_assertThisInitialized");function Xx(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}o(Xx,"_isNativeReflectConstruct");function oc(i){return oc=Object.setPrototypeOf?Object.getPrototypeOf.bind():o(function(t){return t.__proto__||Object.getPrototypeOf(t)},"_getPrototypeOf"),oc(i)}o(oc,"_getPrototypeOf");function m0(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,r)}return t}o(m0,"ownKeys");function on(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?m0(Object(t),!0).forEach(function(r){Yx(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):m0(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}o(on,"_objectSpread");function Yx(i,e,t){return e=y0(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}o(Yx,"_defineProperty");function y0(i){var e=Qx(i,"string");return nn(e)==="symbol"?e:String(e)}o(y0,"_toPropertyKey");function Qx(i,e){if(nn(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(nn(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}o(Qx,"_toPrimitive");var nc=on(on({},ic.defaultOptions),{},{httpStack:new o0,fileReader:new p0,urlStorage:i0?new r0:new e0,fingerprint:Bp}),v0=function(i){Vx(t,i);var e=Wx(t);function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return qx(this,t),s=on(on({},nc),s),e.call(this,r,s)}return o(t,"Upload"),$x(t,null,[{key:"terminate",value:o(function(s){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=on(on({},nc),n),ic.terminate(s,n)},"terminate")}]),t}(ic),b0=window,Jx=b0.XMLHttpRequest,g0=b0.Blob,lN=Jx&&g0&&typeof g0.prototype.slice=="function";function Zx(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")}o(Zx,"isCordova");function eF(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"}o(eF,"isReactNative");function zp(i){return(e,t)=>{if(Zx()||eF())return nc.fingerprint(e,t);let r=["tus",i.id,t.endpoint].join("-");return Promise.resolve(r)}}o(zp,"getFingerprint");function Po(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Po,"_classPrivateFieldLooseBase");var tF=0;function ml(i){return"__private_"+tF+++"_"+i}o(ml,"_classPrivateFieldLooseKey");var iF={version:"3.5.5"},S0={endpoint:"",uploadUrl:null,metadata:{},uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,overridePatchMethod:!1,headers:{},addRequestId:!1,chunkSize:1/0,retryDelays:[100,1e3,3e3,5e3],parallelUploads:1,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1},rF={limit:20,retryDelays:S0.retryDelays,withCredentials:!1},fl=ml("retryDelayIterator"),qp=ml("uploadLocalFile"),$p=ml("getCompanionClientArgs"),Hp=ml("uploadFiles"),pl=ml("handleUpload"),Kr=class extends Ee{static{o(this,"Tus")}constructor(e,t){var r,s;if(super(e,{...rF,...t}),Object.defineProperty(this,Hp,{value:nF}),Object.defineProperty(this,$p,{value:oF}),Object.defineProperty(this,qp,{value:sF}),Object.defineProperty(this,fl,{writable:!0,value:void 0}),Object.defineProperty(this,pl,{writable:!0,value:async n=>{if(n.length===0){this.uppy.log("[Tus] No files to upload");return}this.opts.limit===0&&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...");let a=this.uppy.getFilesByIds(n);await Po(this,Hp)[Hp](a)}}),this.type="uploader",this.id=this.opts.id||"Tus",t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");if("autoRetry"in t)throw new Error("The `autoRetry` option was deprecated and has been removed.");this.requests=(r=this.opts.rateLimitedQueue)!=null?r:new Jt(this.opts.limit),Po(this,fl)[fl]=(s=this.opts.retryDelays)==null?void 0:s.values(),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null),this.handleResetProgress=this.handleResetProgress.bind(this)}handleResetProgress(){let e={...this.uppy.getState().files};Object.keys(e).forEach(t=>{var r;if((r=e[t])!=null&&(r=r.tus)!=null&&r.uploadUrl){let s={...e[t].tus};delete s.uploadUrl,e[t]={...e[t],tus:s}}}),this.uppy.setState({files:e})}resetUploaderReferences(e,t){let r=this.uploaders[e];r&&(r.abort(),t!=null&&t.abort&&r.abort(!0),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null)}onReceiveUploadUrl(e,t){let r=this.uppy.getFile(e.id);r&&(!r.tus||r.tus.uploadUrl!==t)&&(this.uppy.log("[Tus] Storing upload url"),this.uppy.setFileState(r.id,{tus:{...r.tus,uploadUrl:t}}))}install(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!0}}),this.uppy.addUploader(Po(this,pl)[pl]),this.uppy.on("reset-progress",this.handleResetProgress)}uninstall(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!1}}),this.uppy.removeUploader(Po(this,pl)[pl])}};function sF(i){var e=this;return this.resetUploaderReferences(i.id),new Promise((t,r)=>{let s,n,a,l={...this.opts,...i.tus||{}};typeof l.headers=="function"&&(l.headers=l.headers(i));let{onShouldRetry:u,onBeforeRequest:h,...d}=l,f={...S0,...d};f.fingerprint=zp(i),f.onBeforeRequest=async _=>{let R=_.getUnderlyingObject();R.withCredentials=!!l.withCredentials;let q;if(typeof h=="function"&&(q=h(_,i)),oi(s,"shouldBeRequeued")){if(!s.shouldBeRequeued)return Promise.reject();let W,K=new Promise($=>{W=$});s=this.requests.run(()=>(i.isPaused&&s.abort(),W(),()=>{})),await Promise.all([K,q]);return}return q},f.onError=_=>{var R;this.uppy.log(_);let q=_.originalRequest!=null?_.originalRequest.getUnderlyingObject():null;vo(q)&&(_=new Dt(_,q)),this.resetUploaderReferences(i.id),(R=s)==null||R.abort(),this.uppy.emit("upload-error",i,_),typeof l.onError=="function"&&l.onError(_),r(_)},f.onProgress=(_,R)=>{this.onReceiveUploadUrl(i,a.url),typeof l.onProgress=="function"&&l.onProgress(_,R),this.uppy.emit("upload-progress",this.uppy.getFile(i.id),{uploader:this,bytesUploaded:_,bytesTotal:R})},f.onSuccess=()=>{var _;let R={uploadURL:(_=a.url)!=null?_:void 0,status:200,body:{}};if(this.resetUploaderReferences(i.id),s.done(),this.uppy.emit("upload-success",this.uppy.getFile(i.id),R),a.url){let{name:q}=a.file;this.uppy.log(`Download ${q} from ${a.url}`)}typeof l.onSuccess=="function"&&l.onSuccess(),t(a)};let y=o(_=>{var R;let q=_==null||(R=_.originalResponse)==null?void 0:R.getStatus();if(q===429){if(!this.requests.isPaused){var W;let K=(W=Po(this,fl)[fl])==null?void 0:W.next();if(K==null||K.done)return!1;this.requests.rateLimit(K.value)}}else{if(q!=null&&q>400&&q<500&&q!==409&&q!==423)return!1;typeof navigator<"u"&&navigator.onLine===!1&&(this.requests.isPaused||(this.requests.pause(),window.addEventListener("online",()=>{this.requests.resume()},{once:!0})))}return s.abort(),s={shouldBeRequeued:!0,abort(){this.shouldBeRequeued=!1},done(){throw new Error("Cannot mark a queued request as done: this indicates a bug")},fn(){throw new Error("Cannot run a queued request: this indicates a bug")}},!0},"defaultOnShouldRetry");u!=null?f.onShouldRetry=(_,R)=>u(_,R,l,y):f.onShouldRetry=y;let w=o((_,R,q)=>{oi(_,R)&&!oi(_,q)&&(_[q]=_[R])},"copyProp"),S={};(Array.isArray(l.allowedMetaFields)?l.allowedMetaFields:Object.keys(i.meta)).forEach(_=>{S[_]=String(i.meta[_])}),w(S,"type","filetype"),w(S,"name","filename"),f.metadata=S,a=new v0(i.data,f),this.uploaders[i.id]=a;let C=new zr(this.uppy);this.uploaderEvents[i.id]=C,n=o(()=>(i.isPaused||a.start(),()=>{}),"qRequest"),a.findPreviousUploads().then(_=>{let R=_[0];R&&(this.uppy.log(`[Tus] Resuming upload of ${i.id} started at ${R.creationTime}`),a.resumeFromPreviousUpload(R))}),s=this.requests.run(n),C.onFileRemove(i.id,_=>{s.abort(),this.resetUploaderReferences(i.id,{abort:!!a.url}),t(`upload ${_} was removed`)}),C.onPause(i.id,_=>{s.abort(),_?a.abort():s=this.requests.run(n)}),C.onPauseAll(i.id,()=>{s.abort(),a.abort()}),C.onCancelAll(i.id,function(_){let{reason:R}=_===void 0?{}:_;R==="user"&&(s.abort(),e.resetUploaderReferences(i.id,{abort:!!a.url})),t(`upload ${i.id} was canceled`)}),C.onResumeAll(i.id,()=>{s.abort(),i.error&&a.abort(),s=this.requests.run(n)})}).catch(t=>{throw this.uppy.emit("upload-error",i,t),t})}o(sF,"_uploadLocalFile2");function oF(i){var e;let t={...this.opts};return i.tus&&Object.assign(t,i.tus),typeof t.headers=="function"&&(t.headers=t.headers(i)),{...(e=i.remote)==null?void 0:e.body,endpoint:t.endpoint,uploadUrl:t.uploadUrl,protocol:"tus",size:i.data.size,headers:t.headers,metadata:i.meta}}o(oF,"_getCompanionClientArgs2");async function nF(i){let e=as(i),t=ls(e);this.uppy.emit("upload-start",t),await Promise.allSettled(e.map(r=>{if(r.isRemote){let s=o(()=>this.requests,"getQueue"),n=new AbortController,a=o(u=>{u.id===r.id&&n.abort()},"removedHandler");this.uppy.on("file-removed",a);let l=this.uppy.getRequestClientForFile(r).uploadRemoteFile(r,Po(this,$p)[$p](r),{signal:n.signal,getQueue:s});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",a)},{priority:-1})(),l}return Po(this,qp)[qp](r)}))}o(nF,"_uploadFiles2");Kr.VERSION=iF.version;var _0=be(Wp(),1);function Se(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Se,"_classPrivateFieldLooseBase");var lF=0;function tr(i){return"__private_"+lF+++"_"+i}o(tr,"_classPrivateFieldLooseKey");var uF="ASSEMBLY_UPLOADING",Yp="ASSEMBLY_EXECUTING",Qp="ASSEMBLY_COMPLETED",P0=[uF,Yp,Qp];function ac(i,e){return P0.indexOf(i)>=P0.indexOf(e)}o(ac,"isStatus");var xo=tr("rateLimitedQueue"),gl=tr("fetchWithNetworkError"),_o=tr("previousFetchStatusStillPending"),tt=tr("sse"),Jp=tr("onFinished"),Gp=tr("connectServerSentEvents"),ji=tr("onError"),Kp=tr("beginPolling"),Xr=tr("fetchStatus"),Xp=tr("diffStatus"),Zp=class extends _0.default{static{o(this,"TransloaditAssembly")}constructor(e,t){super(),Object.defineProperty(this,Xp,{value:mF}),Object.defineProperty(this,Xr,{value:fF}),Object.defineProperty(this,Kp,{value:pF}),Object.defineProperty(this,ji,{value:dF}),Object.defineProperty(this,Gp,{value:hF}),Object.defineProperty(this,Jp,{value:cF}),Object.defineProperty(this,xo,{writable:!0,value:void 0}),Object.defineProperty(this,gl,{writable:!0,value:void 0}),Object.defineProperty(this,_o,{writable:!0,value:!1}),Object.defineProperty(this,tt,{writable:!0,value:void 0}),this.status=e,this.pollInterval=null,this.closed=!1,Se(this,xo)[xo]=t,Se(this,gl)[gl]=t.wrapPromiseFunction(Es)}connect(){Se(this,Gp)[Gp](),Se(this,Kp)[Kp]()}update(){return Se(this,Xr)[Xr]({diff:!0})}updateStatus(e){Se(this,Xp)[Xp](this.status,e),this.status=e}close(){this.closed=!0,Se(this,tt)[tt]&&(Se(this,tt)[tt].close(),Se(this,tt)[tt]=null),clearInterval(this.pollInterval),this.pollInterval=null}};function cF(){this.emit("finished"),this.close()}o(cF,"_onFinished2");function hF(){Se(this,tt)[tt]=new EventSource(`${this.status.websocket_url}?assembly=${this.status.assembly_id}`),Se(this,tt)[tt].addEventListener("open",()=>{clearInterval(this.pollInterval),this.pollInterval=null}),Se(this,tt)[tt].addEventListener("message",i=>{i.data==="assembly_finished"&&Se(this,Jp)[Jp](),i.data==="assembly_uploading_finished"&&this.emit("executing"),i.data==="assembly_upload_meta_data_extracted"&&(this.emit("metadata"),Se(this,Xr)[Xr]({diff:!1}))}),Se(this,tt)[tt].addEventListener("assembly_upload_finished",i=>{let e=JSON.parse(i.data);this.status.uploads.push(e),this.emit("upload",e)}),Se(this,tt)[tt].addEventListener("assembly_result_finished",i=>{var e,t;let[r,s]=JSON.parse(i.data);((t=(e=this.status.results)[r])!=null?t:e[r]=[]).push(s),this.emit("result",r,s)}),Se(this,tt)[tt].addEventListener("assembly_execution_progress",i=>{let e=JSON.parse(i.data);this.emit("execution-progress",e)}),Se(this,tt)[tt].addEventListener("assembly_error",i=>{try{Se(this,ji)[ji](JSON.parse(i.data))}catch{Se(this,ji)[ji](new Error(i.data))}Se(this,Xr)[Xr]({diff:!1})})}o(hF,"_connectServerSentEvents2");function dF(i){this.emit("error",Object.assign(new Error(i.message),i)),this.close()}o(dF,"_onError2");function pF(){this.pollInterval=setInterval(()=>{Se(this,Xr)[Xr]()},2e3)}o(pF,"_beginPolling2");async function fF(i){let{diff:e=!0}=i===void 0?{}:i;if(!(this.closed||Se(this,xo)[xo].isPaused||Se(this,_o)[_o]))try{Se(this,_o)[_o]=!0;let t=await Se(this,gl)[gl](this.status.assembly_ssl_url);if(Se(this,_o)[_o]=!1,this.closed)return;if(t.status===429){Se(this,xo)[xo].rateLimit(2e3);return}if(!t.ok){Se(this,ji)[ji](new Dt(t.statusText));return}let r=await t.json();if(this.closed)return;this.emit("status",r),e?this.updateStatus(r):this.status=r}catch(t){Se(this,ji)[ji](t)}}o(fF,"_fetchStatus2");function mF(i,e){let t=i.ok,r=e.ok;if(e.error&&!i.error)return Se(this,ji)[ji](e);let s=ac(r,Yp)&&!ac(t,Yp);s&&this.emit("executing"),Object.keys(e.uploads).filter(n=>!oi(i.uploads,n)).forEach(n=>{this.emit("upload",e.uploads[n])}),s&&this.emit("metadata"),Object.keys(e.results).forEach(n=>{let a=e.results[n],l=i.results[n];a.filter(u=>!l||!l.some(h=>h.id===u.id)).forEach(u=>{this.emit("result",n,u)})}),ac(r,Qp)&&!ac(t,Qp)&&this.emit("finished")}o(mF,"_diffStatus2");var ef=Zp;function at(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(at,"_classPrivateFieldLooseBase");var gF=0;function lc(i){return"__private_"+gF+++"_"+i}o(lc,"_classPrivateFieldLooseKey");var x0="/assemblies",tf=class extends Error{static{o(this,"AssemblyError")}constructor(e,t,r){super(e),this.details=t,this.assembly=r}},vi=lc("headers"),yl=lc("fetchWithNetworkError"),Wt=lc("fetchJSON"),zi=lc("reportError"),vl=class{static{o(this,"Client")}constructor(e){Object.defineProperty(this,Wt,{value:yF}),Object.defineProperty(this,vi,{writable:!0,value:{}}),Object.defineProperty(this,yl,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:(t,r)=>{if(this.opts.errorReporting===!1)throw t;let s={type:r.type};throw r.assembly&&(s.assembly=r.assembly.assembly_id,s.instance=r.assembly.instance),r.url&&(s.endpoint=r.url),this.submitError(t,s).catch(()=>{}),t}}),this.opts=e,this.opts.client!=null&&(at(this,vi)[vi]["Transloadit-Client"]=this.opts.client),at(this,yl)[yl]=this.opts.rateLimitedQueue.wrapPromiseFunction(Es)}async createAssembly(e){let{params:t,fields:r,signature:s,expectedFiles:n}=e,a=new FormData;a.append("params",typeof t=="string"?t:JSON.stringify(t)),s&&a.append("signature",s),Object.keys(r).forEach(u=>{a.append(u,String(r[u]))}),a.append("num_expected_upload_files",String(n));let l=new URL(x0,`${this.opts.service}`).href;return at(this,Wt)[Wt](l,{method:"POST",headers:at(this,vi)[vi],body:a}).catch(u=>at(this,zi)[zi](u,{url:l,type:"API_ERROR"}))}async reserveFile(e,t){let r=encodeURIComponent(t.size),s=`${e.assembly_ssl_url}/reserve_file?size=${r}`;return at(this,Wt)[Wt](s,{method:"POST",headers:at(this,vi)[vi]}).catch(n=>at(this,zi)[zi](n,{assembly:e,file:t,url:s,type:"API_ERROR"}))}async addFile(e,t){if(!t.uploadURL)return Promise.reject(new Error("File does not have an `uploadURL`."));let r=encodeURIComponent(t.size),s=encodeURIComponent(t.uploadURL),n=encodeURIComponent(t.name),l=`size=${r}&filename=${n}&fieldname=file&s3Url=${s}`,u=`${e.assembly_ssl_url}/add_file?${l}`;return at(this,Wt)[Wt](u,{method:"POST",headers:at(this,vi)[vi]}).catch(h=>at(this,zi)[zi](h,{assembly:e,file:t,url:u,type:"API_ERROR"}))}async cancelAssembly(e){let t=e.assembly_ssl_url;return at(this,Wt)[Wt](t,{method:"DELETE",headers:at(this,vi)[vi]}).catch(r=>at(this,zi)[zi](r,{url:t,type:"API_ERROR"}))}async getAssemblyStatus(e){return at(this,Wt)[Wt](e,{headers:at(this,vi)[vi]}).catch(t=>at(this,zi)[zi](t,{url:e,type:"STATUS_ERROR"}))}async submitError(e,t){let{endpoint:r,instance:s,assembly:n}=t===void 0?{}:t,a=e.details?`${e.message} (${e.details})`:e.message;return at(this,Wt)[Wt]("https://transloaditstatus.com/client_error",{method:"POST",body:JSON.stringify({endpoint:r,instance:s,assembly_id:n,agent:typeof navigator<"u"?navigator.userAgent:"",client:this.opts.client,error:a})})}};async function yF(){let i=await at(this,yl)[yl](...arguments);if(i.status===429)return this.opts.rateLimitedQueue.rateLimit(2e3),at(this,Wt)[Wt](...arguments);if(!i.ok){let e=new Error(i.statusText);return e.statusCode=i.status,`${arguments.length<=0?void 0:arguments[0]}`.endsWith(x0)?i.json().then(t=>{if(!t.error)throw e;let r=new tf(t.error,t.message,t);throw t.assembly_id&&(r.details+=` Assembly ID: ${t.assembly_id}`),r},t=>{throw t.cause=e,t}):Promise.reject(e)}return i.json()}o(yF,"_fetchJSON2");function sf(i){if(i==null)throw new Error("Transloadit: The `params` option is required.");if(typeof i=="string")try{i=JSON.parse(i)}catch(e){throw new pr("Transloadit: The `params` option is a malformed JSON string.",{cause:e})}if(!i.auth||!i.auth.key)throw new Error("Transloadit: The `params.auth.key` option is required. You can find your Transloadit API key at https://transloadit.com/c/template-credentials")}o(sf,"validateParams");function vF(i){let e=Object.create(null);for(let{fileIDs:t,options:r}of i.filter(Boolean)){let s=JSON.stringify(r);s in e?e[s].fileIDArrays.push(t):e[s]={options:r,fileIDArrays:[t]}}return Object.values(e).map(t=>{let{options:r,fileIDArrays:s}=t;return{options:r,fileIDs:s.flat(1)}})}o(vF,"dedupe");async function F0(i,e){let t=typeof e.assemblyOptions=="function"?await e.assemblyOptions(i,e):e.assemblyOptions;sf(t.params);let{fields:r}=t;return Array.isArray(r)?t.fields=i==null?{}:Object.fromEntries(r.map(s=>[s,i.meta[s]])):r==null&&(t.fields={}),t}o(F0,"getAssemblyOptions");var rf=class{static{o(this,"AssemblyOptions")}constructor(e,t){this.files=e,this.opts=t}async build(){let e=this.opts;if(this.files.length>0)return Promise.all(this.files.map(async t=>{if(t==null)return;let r=await F0(t,e);if(t!=null)return{fileIDs:[t.id],options:r}})).then(vF);if(e.alwaysRunAssembly){let t=await F0(null,e);return[{fileIDs:[],options:t}]}return[]}},E0=rf;var O0=be(Wp(),1);function pe(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(pe,"_classPrivateFieldLooseBase");var bF=0;function bi(i){return"__private_"+bF+++"_"+i}o(bi,"_classPrivateFieldLooseKey");var bl=bi("assemblyIDs"),Eo=bi("remaining"),wl=bi("resolve"),of=bi("reject"),Re=bi("uppy"),Yr=bi("watching"),Sl=bi("onAssemblyComplete"),Pl=bi("onAssemblyCancel"),Oo=bi("onAssemblyError"),_l=bi("onImportError"),Fo=bi("checkAllComplete"),af=bi("removeListeners"),nf=bi("addListeners"),lf=class extends O0.default{static{o(this,"TransloaditAssemblyWatcher")}constructor(e,t){super(),Object.defineProperty(this,nf,{value:_F}),Object.defineProperty(this,af,{value:PF}),Object.defineProperty(this,Fo,{value:SF}),Object.defineProperty(this,Yr,{value:wF}),Object.defineProperty(this,bl,{writable:!0,value:void 0}),Object.defineProperty(this,Eo,{writable:!0,value:void 0}),Object.defineProperty(this,wl,{writable:!0,value:void 0}),Object.defineProperty(this,of,{writable:!0,value:void 0}),Object.defineProperty(this,Re,{writable:!0,value:void 0}),Object.defineProperty(this,Sl,{writable:!0,value:r=>{pe(this,Yr)[Yr](r.assembly_id)&&(pe(this,Re)[Re].log(`[Transloadit] AssemblyWatcher: Got Assembly finish ${r.assembly_id}`),this.emit("assembly-complete",r.assembly_id),pe(this,Fo)[Fo]())}}),Object.defineProperty(this,Pl,{writable:!0,value:r=>{pe(this,Yr)[Yr](r.assembly_id)&&pe(this,Fo)[Fo]()}}),Object.defineProperty(this,Oo,{writable:!0,value:(r,s)=>{pe(this,Yr)[Yr](r.assembly_id)&&(pe(this,Re)[Re].log(`[Transloadit] AssemblyWatcher: Got Assembly error ${r.assembly_id}`),pe(this,Re)[Re].log(s),this.emit("assembly-error",r.assembly_id,s),pe(this,Fo)[Fo]())}}),Object.defineProperty(this,_l,{writable:!0,value:(r,s,n)=>{pe(this,Yr)[Yr](r.assembly_id)&&pe(this,Oo)[Oo](r,n)}}),pe(this,Re)[Re]=e,pe(this,bl)[bl]=t,pe(this,Eo)[Eo]=t.length,this.promise=new Promise((r,s)=>{pe(this,wl)[wl]=r,pe(this,of)[of]=s}),pe(this,nf)[nf]()}};function wF(i){return pe(this,bl)[bl].indexOf(i)!==-1}o(wF,"_watching2");function SF(){pe(this,Eo)[Eo]-=1,pe(this,Eo)[Eo]===0&&(pe(this,af)[af](),pe(this,wl)[wl]())}o(SF,"_checkAllComplete2");function PF(){pe(this,Re)[Re].off("transloadit:complete",pe(this,Sl)[Sl]),pe(this,Re)[Re].off("transloadit:assembly-cancel",pe(this,Pl)[Pl]),pe(this,Re)[Re].off("transloadit:assembly-error",pe(this,Oo)[Oo]),pe(this,Re)[Re].off("transloadit:import-error",pe(this,_l)[_l])}o(PF,"_removeListeners2");function _F(){pe(this,Re)[Re].on("transloadit:complete",pe(this,Sl)[Sl]),pe(this,Re)[Re].on("transloadit:assembly-cancel",pe(this,Pl)[Pl]),pe(this,Re)[Re].on("transloadit:assembly-error",pe(this,Oo)[Oo]),pe(this,Re)[Re].on("transloadit:import-error",pe(this,_l)[_l])}o(_F,"_addListeners2");var C0=lf;var A0={strings:{creatingAssembly:"Preparing upload...",creatingAssemblyFailed:"Transloadit: Could not create Assembly",encoding:"Encoding..."}};function me(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(me,"_classPrivateFieldLooseBase");var xF=0;function Ge(i){return"__private_"+xF+++"_"+i}o(Ge,"_classPrivateFieldLooseKey");var FF={version:"3.8.0"},T0=o(i=>e=>{let t=new pr("Failed to send error to the client",{cause:e});console.error(t,i)},"sendErrorToConsole"),Pf="https://api2.transloadit.com/companion",_f=/\.transloadit\.com$/,EF=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/companion/,OF={service:"https://api2.transloadit.com",errorReporting:!0,waitForEncoding:!1,waitForMetadata:!1,alwaysRunAssembly:!1,importFromUploadURLs:!1,signature:null,params:null,fields:null,getAssemblyOptions:null,limit:20,retryDelays:[7e3,1e4,15e3,2e4],clientName:null},Hi=Ge("rateLimitedQueue"),uf=Ge("getClientVersion"),bf=Ge("attachAssemblyMetadata"),cf=Ge("createAssembly"),xl=Ge("createAssemblyWatcher"),hf=Ge("shouldWaitAfterUpload"),df=Ge("reserveFiles"),Fl=Ge("onFileUploadURLAvailable"),Tl=Ge("findFile"),wf=Ge("onFileUploadComplete"),Sf=Ge("onResult"),Al=Ge("onAssemblyFinished"),pf=Ge("cancelAssembly"),ff=Ge("onCancelAll"),mf=Ge("getPersistentData"),gf=Ge("onRestored"),El=Ge("connectAssembly"),Ol=Ge("prepareUpload"),Co=Ge("afterUpload"),yf=Ge("closeAssemblyIfExists"),Cl=Ge("onError"),vf=Ge("onTusError"),qi=class extends Ee{static{o(this,"Transloadit")}constructor(e,t){var r,s,n,a;super(e,{...OF,...t}),r=this,Object.defineProperty(this,El,{value:BF}),Object.defineProperty(this,pf,{value:MF}),Object.defineProperty(this,Al,{value:NF}),Object.defineProperty(this,Sf,{value:LF}),Object.defineProperty(this,wf,{value:IF}),Object.defineProperty(this,Tl,{value:DF}),Object.defineProperty(this,df,{value:UF}),Object.defineProperty(this,hf,{value:kF}),Object.defineProperty(this,xl,{value:RF}),Object.defineProperty(this,cf,{value:TF}),Object.defineProperty(this,bf,{value:AF}),Object.defineProperty(this,uf,{value:CF}),Object.defineProperty(this,Hi,{writable:!0,value:void 0}),Object.defineProperty(this,Fl,{writable:!0,value:l=>{var u;let h=this.uppy.getFile(l.id);if(!(h!=null&&(u=h.transloadit)!=null&&u.assembly))return;let{assemblies:d}=this.getPluginState(),f=d[h.transloadit.assembly];this.client.addFile(f,h).catch(y=>{this.uppy.log(y),this.uppy.emit("transloadit:import-error",f,h.id,y)})}}),Object.defineProperty(this,ff,{writable:!0,value:async function(l){let{reason:u}=l===void 0?{}:l;try{if(u!=="user")return;let{uploadsAssemblies:h}=r.getPluginState(),f=Object.values(h).flat(1).map(y=>r.getAssembly(y));await Promise.all(f.map(y=>me(r,pf)[pf](y)))}catch(h){r.uppy.log(h)}}}),Object.defineProperty(this,mf,{writable:!0,value:l=>{let{assemblies:u,uploadsAssemblies:h}=this.getPluginState();l({[this.id]:{assemblies:u,uploadsAssemblies:h}})}}),Object.defineProperty(this,gf,{writable:!0,value:l=>{let u=l&&l[this.id]?l[this.id]:{},h=u.assemblies||{},d=u.uploadsAssemblies||{};if(Object.keys(d).length===0)return;let f=o(S=>{let T={},C=[];for(let[_,R]of Object.entries(S)){R.uploads.forEach(W=>{let K=me(this,Tl)[Tl](W);T[W.id]={id:K.id,assembly:_,uploadedFile:W}});let q=this.getPluginState();Object.keys(R.results).forEach(W=>{for(let K of R.results[W]){let $=q.files[K.original_id];K.localId=$?$.id:null,C.push({id:K.id,result:K,stepName:W,assembly:_})}})}this.setPluginState({assemblies:S,files:T,results:C,uploadsAssemblies:d})},"restoreState"),y=o(()=>{let{assemblies:S,uploadsAssemblies:T}=this.getPluginState();Object.keys(T).forEach(_=>{let R=T[_];me(this,xl)[xl](R,_)}),Object.keys(S).forEach(_=>{let R=new ef(S[_],me(this,Hi)[Hi]);me(this,El)[El](R)})},"restoreAssemblies"),w=o(()=>{let{assemblies:S}=this.getPluginState();return Promise.all(Object.keys(S).map(T=>this.activeAssemblies[T].update()))},"updateAssemblies");this.restored=Promise.resolve().then(()=>{f(h),y(),w()}),this.restored.then(()=>{this.restored=null})}}),Object.defineProperty(this,Ol,{writable:!0,value:async(l,u)=>{let d=l.map(S=>this.uppy.getFile(S)).filter(S=>S.error?!1:(this.uppy.emit("preprocess-progress",S,{mode:"indeterminate",message:this.i18n("creatingAssembly")}),!0)),f=o(async S=>{let{fileIDs:T,options:C}=S;try{let _=await me(this,cf)[cf](T,u,C);return this.opts.importFromUploadURLs&&await me(this,df)[df](_,T),T.forEach(R=>{let q=this.uppy.getFile(R);this.uppy.emit("preprocess-complete",q)}),_}catch(_){throw T.forEach(R=>{let q=this.uppy.getFile(R);this.uppy.emit("preprocess-complete",q),this.uppy.emit("upload-error",q,_)}),_}},"createAssembly"),{uploadsAssemblies:y}=this.getPluginState();this.setPluginState({uploadsAssemblies:{...y,[u]:[]}}),await new E0(d,this.opts).build().then(S=>Promise.all(S.map(f))).then(S=>{let T=S.filter(Boolean),C=T.map(_=>_.status.assembly_id);return me(this,xl)[xl](C,u),Promise.all(T.map(_=>me(this,El)[El](_)))}).catch(S=>{throw d.forEach(T=>{this.uppy.emit("preprocess-complete",T),this.uppy.emit("upload-error",T,S)}),S})}}),Object.defineProperty(this,Co,{writable:!0,value:(l,u)=>{let h=l.map(C=>this.uppy.getFile(C)),d=h.filter(C=>!C.error).map(C=>C.id),f=this.getPluginState();if(this.restored)return this.restored.then(()=>me(this,Co)[Co](d,u));let y=f.uploadsAssemblies[u],w=o(()=>{y.forEach(C=>{this.activeAssemblies[C].close(),delete this.activeAssemblies[C]})},"closeSocketConnections");if(!me(this,hf)[hf]()){w();let C=y.map(_=>this.getAssembly(_));return this.uppy.addResultData(u,{transloadit:C}),Promise.resolve()}return y.length===0?(this.uppy.addResultData(u,{transloadit:[]}),Promise.resolve()):(h.filter(C=>!oi(this.completedFiles,C.id)).forEach(C=>{this.uppy.emit("postprocess-progress",C,{mode:"indeterminate",message:this.i18n("encoding")})}),this.assemblyWatchers[u].promise.then(()=>{w();let C=y.map(R=>this.getAssembly(R)),_={...this.getPluginState().uploadsAssemblies};delete _[u],this.setPluginState({uploadsAssemblies:_}),this.uppy.addResultData(u,{transloadit:C})}))}}),Object.defineProperty(this,yf,{writable:!0,value:l=>{var u;l&&((u=this.activeAssemblies[l])==null||u.close())}}),Object.defineProperty(this,Cl,{writable:!0,value:l=>{this.client.submitError(l).catch(T0(l))}}),Object.defineProperty(this,vf,{writable:!0,value:(l,u)=>{var h,d;if(me(this,yf)[yf](l==null||(h=l.transloadit)==null?void 0:h.assembly),u!=null&&(d=u.message)!=null&&d.startsWith("tus: ")){var f;let y=(f=u.originalRequest)==null||(f=f.getUnderlyingObject())==null?void 0:f.responseURL;this.client.submitError(u,{endpoint:y}).catch(T0(u))}}}),this.type="uploader",this.id=this.opts.id||"Transloadit",this.defaultLocale=A0,(n=(s=this.opts).assemblyOptions)!=null||(s.assemblyOptions=(a=this.opts.getAssemblyOptions)!=null?a:{params:this.opts.params,signature:this.opts.signature,fields:this.opts.fields}),t?.params!=null&&t.getAssemblyOptions==null&&t.assemblyOptions==null&&sf(this.opts.assemblyOptions.params),me(this,Hi)[Hi]=new Jt(this.opts.limit),this.i18nInit(),this.client=new vl({service:this.opts.service,client:me(this,uf)[uf](),errorReporting:this.opts.errorReporting,rateLimitedQueue:me(this,Hi)[Hi]}),this.activeAssemblies={},this.assemblyWatchers={},this.completedFiles=Object.create(null)}install(){this.uppy.addPreProcessor(me(this,Ol)[Ol]),this.uppy.addPostProcessor(me(this,Co)[Co]),this.uppy.on("error",me(this,Cl)[Cl]),this.uppy.on("cancel-all",me(this,ff)[ff]),this.uppy.on("upload-error",me(this,vf)[vf]),this.opts.importFromUploadURLs?this.uppy.on("upload-success",me(this,Fl)[Fl]):this.uppy.use(Kr,{storeFingerprintForResuming:!1,allowedMetaFields:["assembly_url","filename","fieldname"],limit:this.opts.limit,rateLimitedQueue:me(this,Hi)[Hi],retryDelays:this.opts.retryDelays}),this.uppy.on("restore:get-data",me(this,mf)[mf]),this.uppy.on("restored",me(this,gf)[gf]),this.setPluginState({assemblies:{},uploadsAssemblies:{},files:{},results:[]});let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}uninstall(){this.uppy.removePreProcessor(me(this,Ol)[Ol]),this.uppy.removePostProcessor(me(this,Co)[Co]),this.uppy.off("error",me(this,Cl)[Cl]),this.opts.importFromUploadURLs&&this.uppy.off("upload-success",me(this,Fl)[Fl]);let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}getAssembly(e){let{assemblies:t}=this.getPluginState();return t[e]}getAssemblyFiles(e){return this.uppy.getFiles().filter(t=>{var r;return(t==null||(r=t.transloadit)==null?void 0:r.assembly)===e})}};function CF(){let i=[`uppy-core:${this.uppy.constructor.VERSION}`,`uppy-transloadit:${this.constructor.VERSION}`,`uppy-tus:${Kr.VERSION}`],e=o((t,r)=>{let s=this.uppy.getPlugin(t);s&&i.push(`${r}:${s.constructor.VERSION}`)},"addPluginVersion");return this.opts.importFromUploadURLs&&(e("XHRUpload","uppy-xhr-upload"),e("AwsS3","uppy-aws-s3"),e("AwsS3Multipart","uppy-aws-s3-multipart")),e("Dropbox","uppy-dropbox"),e("Box","uppy-box"),e("Facebook","uppy-facebook"),e("GoogleDrive","uppy-google-drive"),e("GooglePhotos","uppy-google-photos"),e("Instagram","uppy-instagram"),e("OneDrive","uppy-onedrive"),e("Zoom","uppy-zoom"),e("Url","uppy-url"),this.opts.clientName!=null&&i.push(this.opts.clientName),i.join(",")}o(CF,"_getClientVersion2");function AF(i,e){let t={...i.meta,assembly_url:e.assembly_url,filename:i.name,fieldname:"file"},r={...i.tus,endpoint:e.tus_url,addRequestId:!0},{remote:s}=i;if(i.remote&&EF.test(i.remote.companionUrl)){let a=e.companion_url.replace(/\/$/,""),l=i.remote.url.replace(i.remote.companionUrl,"").replace(/^\//,"");s={...i.remote,companionUrl:a,url:`${a}/${l}`}}let n={...i,transloadit:{assembly:e.assembly_id}};return this.opts.importFromUploadURLs||Object.assign(n,{meta:t,tus:r,remote:s}),n}o(AF,"_attachAssemblyMetadata2");function TF(i,e,t){return this.uppy.log("[Transloadit] Create Assembly"),this.client.createAssembly({...t,expectedFiles:i.length}).then(async r=>{let s=this.uppy.getFiles().filter(y=>{let{id:w}=y;return i.includes(w)});if(s.length===0)return await this.client.cancelAssembly(r),null;let n=new ef(r,me(this,Hi)[Hi]),{status:a}=n,l=a.assembly_id,{assemblies:u,uploadsAssemblies:h}=this.getPluginState();this.setPluginState({assemblies:{...u,[l]:a},uploadsAssemblies:{...h,[e]:[...h[e],l]}});let d={};s.forEach(y=>{d[y.id]=me(this,bf)[bf](y,a)}),this.uppy.setState({files:{...this.uppy.getState().files,...d}});let f=o((y,w)=>{var S;if(((S=n.status)==null?void 0:S.ok)==="ASSEMBLY_COMPLETED"){this.uppy.off("file-removed",f);return}w==="cancel-all"&&(n.close(),this.uppy.off("file-removed",f))},"fileRemovedHandler");return this.uppy.on("file-removed",f),this.uppy.emit("transloadit:assembly-created",a,i),this.uppy.log(`[Transloadit] Created Assembly ${l}`),n}).catch(r=>{let s=new pr(`${this.i18n("creatingAssemblyFailed")}: ${r.message}`,{cause:r});throw"details"in r&&(s.details=r.details),"assembly"in r&&(s.assembly=r.assembly),s})}o(TF,"_createAssembly2");function RF(i,e){let t=Array.isArray(i)?i:[i],r=new C0(this.uppy,t);r.on("assembly-complete",s=>{this.getAssemblyFiles(s).forEach(a=>{this.completedFiles[a.id]=!0,this.uppy.emit("postprocess-complete",a)})}),r.on("assembly-error",(s,n)=>{let a=this.getAssemblyFiles(s);a.forEach(u=>{this.uppy.emit("upload-error",u,n),this.uppy.emit("postprocess-complete",u)});let l={...this.uppy.getState().files};a.forEach(u=>delete l[u.id].tus),this.uppy.setState({files:l}),this.uppy.emit("error",n)}),this.assemblyWatchers[e]=r}o(RF,"_createAssemblyWatcher2");function kF(){return this.opts.waitForEncoding||this.opts.waitForMetadata}o(kF,"_shouldWaitAfterUpload2");function UF(i,e){return Promise.all(e.map(t=>{let r=this.uppy.getFile(t);return this.client.reserveFile(i.status,r)}))}o(UF,"_reserveFiles2");function DF(i){let e=this.uppy.getFiles();for(let t=0;t<e.length;t++){let r=e[t];if(r.uploadURL===i.tus_upload_url||r.tus&&r.tus.uploadUrl===i.tus_upload_url||!i.is_tus_file&&r.name===i.name&&r.size===i.size)return r}}o(DF,"_findFile2");function IF(i,e){let t=this.getPluginState(),r=me(this,Tl)[Tl](e);if(!r){this.uppy.log("[Transloadit] Couldn\u2019t find the file, it was likely removed in the process");return}this.setPluginState({files:{...t.files,[e.id]:{assembly:i,id:r.id,uploadedFile:e}}}),this.uppy.emit("transloadit:upload",e,this.getAssembly(i))}o(IF,"_onFileUploadComplete2");function LF(i,e,t){let r=this.getPluginState(),s=r.files[t.original_id];t.localId=s?s.id:null;let n={result:t,stepName:e,id:t.id,assembly:i};this.setPluginState({results:[...r.results,n]});let a=this.activeAssemblies[i].status;this.uppy.emit("transloadit:result",e,t,a)}o(LF,"_onResult2");function NF(i){let e=i.assembly_ssl_url;this.client.getAssemblyStatus(e).then(t=>{let r=t.assembly_id,s=this.getPluginState();this.setPluginState({assemblies:{...s.assemblies,[r]:t}}),this.uppy.emit("transloadit:complete",t)})}o(NF,"_onAssemblyFinished2");async function MF(i){await this.client.cancelAssembly(i),this.uppy.emit("transloadit:assembly-cancelled",i)}o(MF,"_cancelAssembly2");function BF(i){let{status:e}=i,t=e.assembly_id;return this.activeAssemblies[t]=i,i.on("status",r=>{let{assemblies:s}=this.getPluginState();this.setPluginState({assemblies:{...s,[t]:r}})}),i.on("upload",r=>{me(this,wf)[wf](t,r)}),i.on("error",r=>{r.assembly=i.status,this.uppy.emit("transloadit:assembly-error",i.status,r)}),i.on("executing",()=>{this.uppy.emit("transloadit:assembly-executing",i.status)}),i.on("execution-progress",r=>{if(this.uppy.emit("transloadit:execution-progress",r),r.progress_combined!=null)for(let s of this.uppy.getFiles())this.uppy.emit("postprocess-progress",s,{mode:"determinate",value:r.progress_combined/100,message:this.i18n("encoding")})}),this.opts.waitForEncoding&&i.on("result",(r,s)=>{me(this,Sf)[Sf](t,r,s)}),this.opts.waitForEncoding?i.on("finished",()=>{me(this,Al)[Al](i.status)}):this.opts.waitForMetadata&&i.on("metadata",()=>{me(this,Al)[Al](i.status)}),i.ok==="ASSEMBLY_COMPLETE"||i.connect(),i}o(BF,"_connectAssembly2");qi.VERSION=FF.version;qi.COMPANION=Pf;qi.COMPANION_PATTERN=_f;var uc=o(()=>{},"noop");function R0(i,e){e===void 0&&(e={});let{body:t=null,headers:r={},method:s="GET",onBeforeRequest:n=uc,onUploadProgress:a=uc,shouldRetry:l=o(()=>!0,"shouldRetry"),onAfterRequest:u=uc,onTimeout:h=uc,responseType:d,retries:f=3,signal:y=null,timeout:w=3e4,withCredentials:S=!1}=e,T=o(R=>.3*2**(R-1)*1e3,"delay"),C=new Qu(w,h);function _(R){return R===void 0&&(R=0),new Promise(async(q,W)=>{let K=new XMLHttpRequest;K.open(s,i,!0),K.withCredentials=S,d&&(K.responseType=d),y?.addEventListener("abort",()=>{K.abort(),W(new DOMException("Aborted","AbortError"))}),K.onload=async()=>{await u(K,R),K.status>=200&&K.status<300?(C.done(),q(K)):l(K)&&R<f?setTimeout(()=>{_(R+1).then(q,W)},T(R)):(C.done(),W(new Dt(K.statusText,K)))},K.onerror=()=>{l(K)&&R<f?setTimeout(()=>{_(R+1).then(q,W)},T(R)):(C.done(),W(new Dt(K.statusText,K)))},K.upload.onprogress=$=>{C.progress(),a($)},r&&Object.keys(r).forEach($=>{K.setRequestHeader($,r[$])}),await n(K,R),K.send(t)})}return o(_,"requestWithRetry"),_()}o(R0,"fetcher");var k0={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Qr(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Qr,"_classPrivateFieldLooseBase");var jF=0;function ln(i){return"__private_"+jF+++"_"+i}o(ln,"_classPrivateFieldLooseKey");var zF={version:"3.6.8"};function HF(i,e){let t=e;return t||(t=new Error("Upload error")),typeof t=="string"&&(t=new Error(t)),t instanceof Error||(t=Object.assign(new Error("Upload error"),{data:t})),vo(i)?(t=new Dt(t,i),t):(t.request=i,t)}o(HF,"buildResponseError");function U0(i){return i.data.slice(0,i.data.size,i.meta.type)}o(U0,"setTypeInBlob");var qF={formData:!0,fieldName:"file",method:"post",allowedMetaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:"",getResponseData(i){let e={};try{e=JSON.parse(i)}catch{}return e},getResponseError(i,e){let t=new Error("Upload error");return vo(e)&&(t=new Dt(t,e)),t},validateStatus(i){return i>=200&&i<300}},Ao=ln("getFetcher"),Ef=ln("uploadLocalFile"),xf=ln("uploadBundle"),Of=ln("getCompanionClientArgs"),Ff=ln("uploadFiles"),Rl=ln("handleUpload"),an=class extends Ee{static{o(this,"XHRUpload")}constructor(e,t){if(super(e,{...qF,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,Ff,{value:GF}),Object.defineProperty(this,Of,{value:WF}),Object.defineProperty(this,xf,{value:VF}),Object.defineProperty(this,Ef,{value:$F}),Object.defineProperty(this,Ao,{writable:!0,value:void 0}),Object.defineProperty(this,Rl,{writable:!0,value:async r=>{if(r.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[ns]&&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...");let s=this.uppy.getFilesByIds(r),n=as(s),a=ls(n);if(this.uppy.emit("upload-start",a),this.opts.bundle){if(n.some(u=>u.isRemote))throw new Error("Can\u2019t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await Qr(this,xf)[xf](n)}else await Qr(this,Ff)[Ff](n)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=k0,this.i18nInit(),ns in this.opts?this.requests=this.opts[ns]:this.requests=new Jt(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),Qr(this,Ao)[Ao]=r=>async(s,n)=>{try{var a;let l=await R0(s,{...n,method:n==null||(a=n.method)==null?void 0:a.toUpperCase(),onTimeout:d=>{let f=Math.ceil(d/1e3),y=new Error(this.i18n("uploadStalled",{seconds:f}));this.uppy.emit("upload-stalled",y,r)},onUploadProgress:d=>{if(d.lengthComputable)for(let f of r)this.uppy.emit("upload-progress",f,{uploader:this,bytesUploaded:d.loaded/d.total*f.size,bytesTotal:f.size})}});if(!this.opts.validateStatus(l.status,l.responseText,l))throw new Dt(l.statusText,l);let u=this.opts.getResponseData(l.responseText,l),h=u?.[this.opts.responseUrlFieldName];for(let d of r)this.uppy.emit("upload-success",d,{status:l.status,body:u,uploadURL:h});return l}catch(l){if(l.name==="AbortError")return;if(l instanceof Dt){let u=l.request,h=HF(u,this.opts.getResponseError(u.responseText,u));for(let d of r)this.uppy.emit("upload-error",d,h)}throw l}}}getOptions(e){let t=this.uppy.getState().xhrUpload,{headers:r}=this.opts,s={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return typeof r=="function"?s.headers=r(e):Object.assign(s.headers,this.opts.headers),t&&Object.assign(s.headers,t.headers),e.xhrUpload&&Object.assign(s.headers,e.xhrUpload.headers),s}addMetadata(e,t,r){(Array.isArray(r.allowedMetaFields)?r.allowedMetaFields:Object.keys(t)).forEach(n=>{let a=t[n];Array.isArray(a)?a.forEach(l=>e.append(n,l)):e.append(n,a)})}createFormDataUpload(e,t){let r=new FormData;this.addMetadata(r,e.meta,t);let s=U0(e);return e.name?r.append(t.fieldName,s,e.meta.name):r.append(t.fieldName,s),r}createBundledUpload(e,t){let r=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(r,s,t),e.forEach(n=>{let a=this.getOptions(n),l=U0(n);n.name?r.append(a.fieldName,l,n.name):r.append(a.fieldName,l)}),r}install(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(Qr(this,Rl)[Rl])}uninstall(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(Qr(this,Rl)[Rl])}};async function $F(i){let e=new zr(this.uppy),t=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{let s=this.getOptions(i),n=Qr(this,Ao)[Ao]([i]),a=s.formData?this.createFormDataUpload(i,s):i.data;return n(s.endpoint,{...s,body:a,signal:t.signal})});e.onFileRemove(i.id,()=>t.abort()),e.onCancelAll(i.id,s=>{let{reason:n}=s;n==="user"&&t.abort()});try{await r().abortOn(t.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{e.remove()}}o($F,"_uploadLocalFile2");async function VF(i){let e=new AbortController,t=this.requests.wrapPromiseFunction(async()=>{var s;let n=(s=this.uppy.getState().xhrUpload)!=null?s:{},a=Qr(this,Ao)[Ao](i),l=this.createBundledUpload(i,{...this.opts,...n});return a(this.opts.endpoint,{...this.opts,body:l,signal:e.signal})});function r(){e.abort()}o(r,"abort"),this.uppy.once("cancel-all",r);try{await t().abortOn(e.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{this.uppy.off("cancel-all",r)}}o(VF,"_uploadBundle2");function WF(i){var e;let t=this.getOptions(i),r=Array.isArray(t.allowedMetaFields)?t.allowedMetaFields:Object.keys(i.meta);return{...(e=i.remote)==null?void 0:e.body,protocol:"multipart",endpoint:t.endpoint,size:i.data.size,fieldname:t.fieldName,metadata:Object.fromEntries(r.map(s=>[s,i.meta[s]])),httpMethod:t.method,useFormData:t.formData,headers:t.headers}}o(WF,"_getCompanionClientArgs2");async function GF(i){await Promise.allSettled(i.map(e=>{if(e.isRemote){let t=o(()=>this.requests,"getQueue"),r=new AbortController,s=o(a=>{a.id===e.id&&r.abort()},"removedHandler");this.uppy.on("file-removed",s);let n=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,Qr(this,Of)[Of](e),{signal:r.signal,getQueue:t});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),n}return Qr(this,Ef)[Ef](e)}))}o(GF,"_uploadFiles2");an.VERSION=zF.version;var Tf=be(_n(),1),N0=be(D0(),1);var I0={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function L0(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(L0,"_classPrivateFieldLooseBase");var KF=0;function XF(i){return"__private_"+KF+++"_"+i}o(XF,"_classPrivateFieldLooseKey");var kl=XF("RateLimitedQueue"),Ul=class extends Ee{static{o(this,"Compressor")}constructor(e,t){super(e,t),Object.defineProperty(this,kl,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=I0;let r={quality:.6,limit:10};this.opts={...r,...t},L0(this,kl)[kl]=new Jt(this.opts.limit),this.i18nInit(),this.prepareUpload=this.prepareUpload.bind(this),this.compress=this.compress.bind(this)}compress(e){return new Promise((t,r)=>{new N0.default(e,{...this.opts,success:t,error:r})})}async prepareUpload(e){let t=0,r=[],s=L0(this,kl)[kl].wrapPromiseFunction(async a=>{try{let l=await this.compress(a.data),u=a.data.size-l.size;this.uppy.log(`[Image Compressor] Image ${a.id} compressed by ${(0,Tf.default)(u)}`),t+=u;let{name:h,type:d,size:f}=l,y=Gi(h),S=`${Gi(a.meta.name).name}.${y.extension}`;this.uppy.setFileState(a.id,{...h&&{name:h},...y.extension&&{extension:y.extension},...d&&{type:d},...f&&{size:f},data:l,meta:{...a.meta,type:d,name:S}}),r.push(a)}catch(l){this.uppy.log(`[Image Compressor] Failed to compress ${a.id}:`,"warning"),this.uppy.log(l,"warning")}}),n=e.map(a=>{var l;let u=this.uppy.getFile(a);return this.uppy.emit("preprocess-progress",u,{mode:"indeterminate",message:this.i18n("compressingImages")}),u.isRemote||(u.data.type||(u.data=u.data.slice(0,u.data.size,u.type)),!((l=u.type)!=null&&l.startsWith("image/")))?Promise.resolve():s(u)});await Promise.all(n),this.uppy.emit("compressor:complete",r),t>1024&&this.uppy.info(this.i18n("compressedX",{size:(0,Tf.default)(t)}),"info");for(let a of e){let l=this.uppy.getFile(a);this.uppy.emit("preprocess-complete",l)}}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};function cc(){return cc=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},cc.apply(this,arguments)}o(cc,"_extends");var YF={"[object HTMLCollection]":!0,"[object NodeList]":!0,"[object RadioNodeList]":!0},QF={button:!0,fieldset:!0,reset:!0,submit:!0},JF={checkbox:!0,radio:!0},ZF=/^\s+|\s+$/g,eE=Array.prototype.slice,M0=Object.prototype.toString;function hc(i,e){if(!i)throw new Error("A form is required by getFormData, was given form="+i);e=cc({includeDisabled:!1,trim:!1},e);for(var t={},r,s=[],n={},a=0,l=i.elements.length;a<l;a++){var u=i.elements[a];QF[u.type]||u.disabled&&!e.includeDisabled||(r=u.name||u.id,r&&!n[r]&&(s.push(r),n[r]=!0))}for(var h=0,d=s.length;h<d;h++){r=s[h];var f=j0(i,r,e);f!=null&&(t[r]=f)}return t}o(hc,"getFormData");function j0(i,e,t){if(!i)throw new Error("A form is required by getFieldData, was given form="+i);if(!e&&M0.call(e)!=="[object String]")throw new Error("A field name is required by getFieldData, was given fieldName="+e);t=cc({includeDisabled:!1,trim:!1},t);var r=i.elements[e];if(!r||r.disabled&&!t.includeDisabled)return null;if(!YF[M0.call(r)])return B0(r,t.trim);for(var s=[],n=!0,a=0,l=r.length;a<l;a++)if(!(r[a].disabled&&!t.includeDisabled)){n&&r[a].type!=="radio"&&(n=!1);var u=B0(r[a],t.trim);u!=null&&(s=s.concat(u))}return n&&s.length===1?s[0]:s.length>0?s:null}o(j0,"getFieldData");function B0(i,e){var t=null,r=i.type;if(r==="select-one")return i.options.length&&(t=i.options[i.selectedIndex].value),t;if(r==="select-multiple"){t=[];for(var s=0,n=i.options.length;s<n;s++)i.options[s].selected&&t.push(i.options[s].value);return t.length===0&&(t=null),t}return r==="file"&&"files"in i?(i.multiple?(t=eE.call(i.files),t.length===0&&(t=null)):t=i.files[0],t):(JF[r]?i.checked&&(r==="checkbox"&&!i.hasAttribute("value")?t=!0:t=i.value):t=e?i.value.replace(ZF,""):i.value,t)}o(B0,"getFormElementValue");hc.getFieldData=j0;var tE={version:"3.2.2"},iE={resultName:"uppyResult",getMetaFromForm:!0,addResultToForm:!0,submitOnSuccess:!1,triggerUploadOnSubmit:!1};function rE(i){if(i==null||i.nodeName!=="FORM")throw new Error("ASSERTION FAILED: the target is not a <form> element",{cause:i});return i}o(rE,"assertHTMLFormElement");var un=class extends Ee{static{o(this,"Form")}constructor(e,t){super(e,{...iE,...t}),this.type="acquirer",this.id=this.opts.id||"Form",this.handleFormSubmit=this.handleFormSubmit.bind(this),this.handleUploadStart=this.handleUploadStart.bind(this),this.handleSuccess=this.handleSuccess.bind(this),this.addResultToForm=this.addResultToForm.bind(this),this.getMetaFromForm=this.getMetaFromForm.bind(this)}handleUploadStart(){this.opts.getMetaFromForm&&this.getMetaFromForm()}handleSuccess(e){this.opts.addResultToForm&&this.addResultToForm(e),this.opts.submitOnSuccess&&this.form.reportValidity()&&this.form.submit()}handleFormSubmit(e){if(this.opts.triggerUploadOnSubmit){e.preventDefault();let t=nt(e.target.elements),r=[];t.forEach(s=>{(s.tagName==="BUTTON"||s.tagName==="INPUT"&&s.type==="submit")&&!s.disabled&&(s.disabled=!0,r.push(s))}),this.uppy.upload().then(()=>{r.forEach(s=>{s.disabled=!1})},s=>(r.forEach(n=>{n.disabled=!1}),Promise.reject(s))).catch(s=>{this.uppy.log(s.stack||s.message||s)})}}addResultToForm(e){this.uppy.log("[Form] Adding result to the original form:"),this.uppy.log(e);let t=this.form.querySelector(`[name="${this.opts.resultName}"]`);if(t){let r;try{r=JSON.parse(t.value)}catch{}Array.isArray(r)||(r=[]),r.push(e),t.value=JSON.stringify(r);return}t=document.createElement("input"),t.name=this.opts.resultName,t.type="hidden",t.value=JSON.stringify([e]),this.form.appendChild(t)}getMetaFromForm(){let e=hc(this.form);delete e[this.opts.resultName],this.uppy.setMeta(e)}install(){this.form=rE(su(this.opts.target)),this.form.addEventListener("submit",this.handleFormSubmit),this.uppy.on("upload",this.handleUploadStart),this.uppy.on("complete",this.handleSuccess)}uninstall(){this.form.removeEventListener("submit",this.handleFormSubmit),this.uppy.off("upload",this.handleUploadStart),this.uppy.off("complete",this.handleSuccess)}};un.VERSION=tE.version;var J0=be(Wl(),1);function To(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(To,"_classPrivateFieldLooseBase");var sE=0;function oE(i){return"__private_"+sE+++"_"+i}o(oE,"_classPrivateFieldLooseKey");var z0=typeof navigator<"u"&&"serviceWorker"in navigator;function nE(){return new Promise((i,e)=>{z0?navigator.serviceWorker.controller?i():navigator.serviceWorker.addEventListener("controllerchange",()=>{i()}):e(new Error("Unsupported"))})}o(nE,"waitForServiceWorker");var Gt=oE("ready"),dc=class{static{o(this,"ServiceWorkerStore")}constructor(e){Object.defineProperty(this,Gt,{writable:!0,value:void 0}),To(this,Gt)[Gt]=nE().then(t=>{To(this,Gt)[Gt]=t}),this.name=e.storeName}get ready(){return Promise.resolve(To(this,Gt)[Gt])}set ready(e){To(this,Gt)[Gt]=e}async list(){return await To(this,Gt)[Gt],new Promise((e,t)=>{let r=o(s=>{if(s.data.store===this.name)switch(s.data.type){case"uppy/ALL_FILES":e(s.data.files),navigator.serviceWorker.removeEventListener("message",r);break;default:t()}},"onMessage");navigator.serviceWorker.addEventListener("message",r),navigator.serviceWorker.controller.postMessage({type:"uppy/GET_FILES",store:this.name})})}async put(e){await To(this,Gt)[Gt],navigator.serviceWorker.controller.postMessage({type:"uppy/ADD_FILE",store:this.name,file:e})}async delete(e){await To(this,Gt)[Gt],navigator.serviceWorker.controller.postMessage({type:"uppy/REMOVE_FILE",store:this.name,fileID:e})}};dc.isSupported=z0;var H0=dc;function ir(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(ir,"_classPrivateFieldLooseBase");var aE=0;function lE(i){return"__private_"+aE+++"_"+i}o(lE,"_classPrivateFieldLooseKey");var G0=typeof window<"u"&&(window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB),uE=!!G0,q0="uppy-blobs",ei="files",K0=24*60*60*1e3,cE=3,$0=1048576;function hE(i){let e=i.openCursor();e.onsuccess=t=>{let r=t.target.result;if(!r)return;let s=r.value;s.expires=Date.now()+K0,r.update(s)}}o(hE,"migrateExpiration");function V0(i){let e=G0.open(i,cE);return new Promise((t,r)=>{e.onupgradeneeded=s=>{let n=s.target.result,a=s.currentTarget.transaction;if(s.oldVersion<2&&n.createObjectStore(ei,{keyPath:"id"}).createIndex("store","store",{unique:!1}),s.oldVersion<3){let l=a.objectStore(ei);l.createIndex("expires","expires",{unique:!1}),hE(l)}a.oncomplete=()=>{t(n)}},e.onsuccess=s=>{t(s.target.result)},e.onerror=r})}o(V0,"connect");function pc(i){return new Promise((e,t)=>{i.onsuccess=r=>{e(r.target.result)},i.onerror=t})}o(pc,"waitForRequest");var W0=!1,it=lE("ready"),fc=class i{static{o(this,"IndexedDBStore")}constructor(e){Object.defineProperty(this,it,{writable:!0,value:void 0}),this.opts={dbName:q0,storeName:"default",expires:K0,maxFileSize:10*$0,maxTotalSize:300*$0,...e},this.name=this.opts.storeName;let t=o(async()=>{let r=await V0(this.opts.dbName);return ir(this,it)[it]=r,r},"createConnection");W0?ir(this,it)[it]=t():(W0=!0,ir(this,it)[it]=i.cleanup().then(t,t))}get ready(){return Promise.resolve(ir(this,it)[it])}set ready(e){ir(this,it)[it]=e}key(e){return`${this.name}!${e}`}async list(){let s=(await ir(this,it)[it]).transaction([ei],"readonly").objectStore(ei).index("store").getAll(IDBKeyRange.only(this.name)),n=await pc(s);return Object.fromEntries(n.map(a=>[a.fileID,a.data]))}async get(e){let s=(await ir(this,it)[it]).transaction([ei],"readonly").objectStore(ei).get(this.key(e)),{data:n}=await pc(s);return{id:n.fileID,data:n.data}}async getSize(){let s=(await ir(this,it)[it]).transaction([ei],"readonly").objectStore(ei).index("store").openCursor(IDBKeyRange.only(this.name));return new Promise((n,a)=>{let l=0;s.onsuccess=u=>{let h=u.target.result;h?(l+=h.value.data.size,h.continue()):n(l)},s.onerror=()=>{a(new Error("Could not retrieve stored blobs size"))}})}async put(e){if(e.data.size>this.opts.maxFileSize)throw new Error("File is too big to store.");if(await this.getSize()>this.opts.maxTotalSize)throw new Error("No space left");let n=(await ir(this,it)[it]).transaction([ei],"readwrite").objectStore(ei).add({id:this.key(e.id),fileID:e.id,store:this.name,expires:Date.now()+this.opts.expires,data:e.data});return pc(n)}async delete(e){let s=(await ir(this,it)[it]).transaction([ei],"readwrite").objectStore(ei).delete(this.key(e));return pc(s)}static async cleanup(){let e=await V0(q0),s=e.transaction([ei],"readwrite").objectStore(ei).index("expires").openCursor(IDBKeyRange.upperBound(Date.now()));await new Promise((n,a)=>{s.onsuccess=l=>{let u=l.target.result;u?(u.delete(),u.continue()):n()},s.onerror=a}),e.close()}};fc.isSupported=uE;var X0=fc;function dE(){let i=[];for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);t!=null&&t.startsWith("uppyState:")&&i.push(t.slice(10))}return i}o(dE,"findUppyInstances");function Y0(i){try{return JSON.parse(i)}catch{return null}}o(Y0,"maybeParse");var Q0=!1,hs=class i{static{o(this,"MetaDataStore")}constructor(e){this.opts={expires:24*60*60*1e3,...e},this.name=`uppyState:${e.storeName}`,Q0||(Q0=!0,i.cleanup())}load(){let e=localStorage.getItem(this.name);if(!e)return null;let t=Y0(e);return t?t.metadata:null}save(e){let t=Date.now()+this.opts.expires,r=JSON.stringify({metadata:e,expires:t});localStorage.setItem(this.name,r)}static cleanup(e){if(e){localStorage.removeItem(`uppyState:${e}`);return}let t=dE(),r=Date.now();t.forEach(s=>{let n=localStorage.getItem(`uppyState:${s}`);if(!n)return;let a=Y0(n);a&&a.expires&&a.expires<r&&localStorage.removeItem(`uppyState:${s}`)})}};var pE={version:"3.2.0"},fE={expires:24*60*60*1e3,serviceWorker:!1},cn=class extends Ee{static{o(this,"GoldenRetriever")}constructor(e,t){super(e,{...fE,...t}),this.addBlobToStores=r=>{r.isRemote||(this.ServiceWorkerStore&&this.ServiceWorkerStore.put(r).catch(s=>{this.uppy.log("[GoldenRetriever] Could not store file","warning"),this.uppy.log(s)}),this.IndexedDBStore.put(r).catch(s=>{this.uppy.log("[GoldenRetriever] Could not store file","warning"),this.uppy.log(s)}))},this.removeBlobFromStores=r=>{this.ServiceWorkerStore&&this.ServiceWorkerStore.delete(r.id).catch(s=>{this.uppy.log("[GoldenRetriever] Failed to remove file","warning"),this.uppy.log(s)}),this.IndexedDBStore.delete(r.id).catch(s=>{this.uppy.log("[GoldenRetriever] Failed to remove file","warning"),this.uppy.log(s)})},this.replaceBlobInStores=r=>{this.removeBlobFromStores(r),this.addBlobToStores(r)},this.handleRestoreConfirmed=()=>{this.uppy.log("[GoldenRetriever] Restore confirmed, proceeding...");let{currentUploads:r}=this.uppy.getState();r&&(this.uppy.resumeAll(),Object.keys(r).forEach(s=>{this.uppy.restore(s)})),this.uppy.setState({recoveredState:null})},this.abortRestore=()=>{this.uppy.log("[GoldenRetriever] Aborting restore...");let r=Object.keys(this.uppy.getState().files);this.deleteBlobs(r).then(()=>{this.uppy.log(`[GoldenRetriever] Removed ${r.length} files`)}).catch(s=>{this.uppy.log(`[GoldenRetriever] Could not remove ${r.length} files`,"warning"),this.uppy.log(s)}),this.uppy.cancelAll(),this.uppy.setState({recoveredState:null}),hs.cleanup(this.uppy.opts.id)},this.handleComplete=r=>{let{successful:s}=r,n=s.map(a=>a.id);this.deleteBlobs(n).then(()=>{this.uppy.log(`[GoldenRetriever] Removed ${s.length} files that finished uploading`)}).catch(a=>{this.uppy.log(`[GoldenRetriever] Could not remove ${s.length} files that finished uploading`,"warning"),this.uppy.log(a)}),this.uppy.setState({recoveredState:null}),hs.cleanup(this.uppy.opts.id)},this.restoreBlobs=()=>{this.uppy.getFiles().length>0?Promise.all([this.loadFileBlobsFromServiceWorker(),this.loadFileBlobsFromIndexedDB()]).then(r=>{let s={...r[0],...r[1]};this.onBlobsLoaded(s)}):this.uppy.log("[GoldenRetriever] No files need to be loaded, only restoring processing state...")},this.type="debugger",this.id=this.opts.id||"GoldenRetriever",this.MetaDataStore=new hs({expires:this.opts.expires,storeName:e.getID()}),this.ServiceWorkerStore=null,this.opts.serviceWorker&&(this.ServiceWorkerStore=new H0({storeName:e.getID()})),this.IndexedDBStore=new X0({expires:this.opts.expires,...this.opts.indexedDB||{},storeName:e.getID()}),this.saveFilesStateToLocalStorage=(0,J0.default)(this.saveFilesStateToLocalStorage.bind(this),500,{leading:!0,trailing:!0}),this.restoreState=this.restoreState.bind(this),this.loadFileBlobsFromServiceWorker=this.loadFileBlobsFromServiceWorker.bind(this),this.loadFileBlobsFromIndexedDB=this.loadFileBlobsFromIndexedDB.bind(this),this.onBlobsLoaded=this.onBlobsLoaded.bind(this)}restoreState(){let 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)}getWaitingFiles(){let e={};return this.uppy.getFiles().forEach(t=>{(!t.progress||!t.progress.uploadStarted)&&(e[t.id]=t)}),e}getUploadingFiles(){let e={},{currentUploads:t}=this.uppy.getState();return t&&Object.keys(t).forEach(s=>{t[s].fileIDs.forEach(a=>{e[a]=this.uppy.getFile(a)})}),e}saveFilesStateToLocalStorage(){let e={...this.getWaitingFiles(),...this.getUploadingFiles()},t=Object.entries(e);if(t.length===0){this.uppy.getState().recoveredState!==null&&this.uppy.setState({recoveredState:null}),hs.cleanup(this.uppy.opts.id);return}let r=Object.fromEntries(t.map(a=>{let[l,u]=a;return[l,u.isRemote?{...u,isRestored:!0}:{...u,isRestored:!0,data:null,preview:null}]})),s={};this.uppy.emit("restore:get-data",a=>{Object.assign(s,a)});let{currentUploads:n}=this.uppy.getState();this.MetaDataStore.save({currentUploads:n,files:r,pluginData:s})}loadFileBlobsFromServiceWorker(){return this.ServiceWorkerStore?this.ServiceWorkerStore.list().then(e=>{let t=Object.keys(e).length;return t>0?(this.uppy.log(`[GoldenRetriever] Successfully recovered ${t} blobs from Service Worker!`),e):(this.uppy.log("[GoldenRetriever] No blobs found in Service Worker, trying IndexedDB now..."),{})}).catch(e=>(this.uppy.log("[GoldenRetriever] Failed to recover blobs from Service Worker","warning"),this.uppy.log(e),{})):Promise.resolve({})}loadFileBlobsFromIndexedDB(){return this.IndexedDBStore.list().then(e=>{let t=Object.keys(e).length;return t>0?(this.uppy.log(`[GoldenRetriever] Successfully recovered ${t} blobs from IndexedDB!`),e):(this.uppy.log("[GoldenRetriever] No blobs found in IndexedDB"),{})}).catch(e=>(this.uppy.log("[GoldenRetriever] Failed to recover blobs from IndexedDB","warning"),this.uppy.log(e),{}))}onBlobsLoaded(e){let t=[],r={...this.uppy.getState().files};Object.keys(e).forEach(s=>{let n=this.uppy.getFile(s);if(!n){t.push(s);return}let l={data:e[s],isRestored:!0,isGhost:!1};r[s]={...n,...l}}),Object.keys(r).forEach(s=>{r[s].data===null&&(r[s]={...r[s],isGhost:!0})}),this.uppy.setState({files:r}),this.uppy.emit("restored",this.savedPluginData),t.length&&this.deleteBlobs(t).then(()=>{this.uppy.log(`[GoldenRetriever] Cleaned up ${t.length} old files`)}).catch(s=>{this.uppy.log(`[GoldenRetriever] Could not clean up ${t.length} old files`,"warning"),this.uppy.log(s)})}async deleteBlobs(e){await Promise.all(e.map(t=>{var r,s,n;return(r=(s=this.ServiceWorkerStore)==null?void 0:s.delete(t))!=null?r:(n=this.IndexedDBStore)==null?void 0:n.delete(t)}))}install(){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)}uninstall(){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)}};cn.VERSION=pE.version;var mE={version:"3.0.3"},hn=class extends ne{static{o(this,"ReduxDevTools")}constructor(e,t){super(e,t),this.type="debugger",this.id=this.opts.id||"ReduxDevTools",this.title="Redux DevTools";let r={};this.opts={...r,...t},this.handleStateChange=this.handleStateChange.bind(this),this.initDevTools=this.initDevTools.bind(this)}handleStateChange(e,t){this.devTools.send("UPPY_STATE_UPDATE",t)}initDevTools(){this.devTools=window.devToolsExtension.connect(),this.devToolsUnsubscribe=this.devTools.subscribe(e=>{if(e.type==="DISPATCH")switch(e.payload.type){case"RESET":this.uppy.cancelAll();return;case"IMPORT_STATE":{let{computedStates:t}=e.payload.nextLiftedState;this.uppy.store.state={...this.uppy.getState(),...t[t.length-1].state},this.uppy.updateAll(this.uppy.getState());return}case"JUMP_TO_STATE":case"JUMP_TO_ACTION":this.uppy.store.state={...this.uppy.getState(),...JSON.parse(e.state)},this.uppy.updateAll(this.uppy.getState());break;default:}})}install(){this.withDevTools=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__,this.withDevTools&&(this.initDevTools(),this.uppy.on("state-update",this.handleStateChange))}uninstall(){this.withDevTools&&(this.devToolsUnsubscribe(),this.uppy.off("state-update",this.handleStateUpdate))}};hn.VERSION=mE.version;function gE(){throw new Error("Core has been renamed to Uppy")}o(gE,"Core");var yE={ProviderView:vh};qi.COMPANION_URL=Pf;qi.COMPANION_ALLOWED_HOSTS=_f;var vE={};globalThis.Uppy=Rf;})();
/**
* Takes a string with placeholder variables like `%{smart_count} file selected`
* and replaces it with values from options `{smart_count: 5}`
*
* @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
* taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
*
* @param phrase that needs interpolation, with placeholders
* @param options with values that will be used to replace placeholders
*/
/*! Bundled license information:
classnames/index.js:
(*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*)
cropperjs/dist/cropper.js:
(*!
* Cropper.js v1.5.7
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2020-05-23T05:23:00.081Z
*)
compressorjs/dist/compressor.js:
(*!
* Compressor.js v1.2.1
* https://fengyuanchen.github.io/compressorjs
*
* Copyright 2018-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2023-02-28T14:09:41.732Z
*)
tus-js-client/lib.esm/upload.js:
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE *)
tus-js-client/lib.esm/browser/fileReader.js:
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE *)
*/
//# sourceMappingURL=uppy.min.js.map