leaf/examples/widget_example/uppy.min.js
2025-08-05 15:02:23 +02:00

70 lines
551 KiB
JavaScript

"use strict";(()=>{var b1=Object.create;var $l=Object.defineProperty;var w1=Object.getOwnPropertyDescriptor;var S1=Object.getOwnPropertyNames;var _1=Object.getPrototypeOf,P1=Object.prototype.hasOwnProperty;var o=(i,e)=>$l(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)$l(i,t,{get:e[t],enumerable:!0})},F1=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of S1(e))!P1.call(i,s)&&s!==t&&$l(i,s,{get:()=>e[s],enumerable:!(r=w1(e,s))||r.enumerable});return i};var be=(i,e,t)=>(t=i!=null?b1(_1(i)):{},F1(e||!i||!i.__esModule?$l(t,"default",{value:i,enumerable:!0}):t,i));var wc=ve((PE,qf)=>{qf.exports=o(function(){var e={},t=e._fns={};e.emit=o(function(a,u,l,h,d,f,y){var b=r(a);b.length&&s(a,b,[u,l,h,d,f,y])},"emit"),e.on=o(function(a,u){t[a]||(t[a]=[]),t[a].push(u)},"on"),e.once=o(function(a,u){function l(){u.apply(this,arguments),e.off(a,l)}o(l,"one"),this.on(a,l)},"once"),e.off=o(function(a,u){var l=[];if(a&&u){var h=this._fns[a],d=0,f=h?h.length:0;for(d;d<f;d++)h[d]!==u&&l.push(h[d])}l.length?this._fns[a]=l:delete this._fns[a]},"off");function r(n){var a=t[n]?t[n]:[],u=n.indexOf(":"),l=u===-1?[n]:[n.substring(0,u),n.substring(u+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])),l.length===2&&l[0]===y){a=a.concat(t[y]);break}}return a}o(r,"getListeners");function s(n,a,u){var l=0,h=a.length;for(l;l<h&&a[l];l++)a[l].event=n,a[l].apply(a[l],u)}return o(s,"emitAll"),e},"createNamespaceEmitter")});var Wl=ve((OE,Vf)=>{function T1(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}o(T1,"isObject");Vf.exports=T1});var Gf=ve((AE,Wf)=>{var R1=typeof global=="object"&&global&&global.Object===Object&&global;Wf.exports=R1});var Sc=ve((TE,Kf)=>{var k1=Gf(),U1=typeof self=="object"&&self&&self.Object===Object&&self,D1=k1||U1||Function("return this")();Kf.exports=D1});var Yf=ve((RE,Xf)=>{var I1=Sc(),L1=o(function(){return I1.Date.now()},"now");Xf.exports=L1});var Jf=ve((UE,Qf)=>{var N1=/\s/;function M1(i){for(var e=i.length;e--&&N1.test(i.charAt(e)););return e}o(M1,"trimmedEndIndex");Qf.exports=M1});var em=ve((IE,Zf)=>{var B1=Jf(),j1=/^\s+/;function z1(i){return i&&i.slice(0,B1(i)+1).replace(j1,"")}o(z1,"baseTrim");Zf.exports=z1});var _c=ve((NE,tm)=>{var H1=Sc(),$1=H1.Symbol;tm.exports=$1});var om=ve((ME,sm)=>{var im=_c(),rm=Object.prototype,q1=rm.hasOwnProperty,V1=rm.toString,Sn=im?im.toStringTag:void 0;function W1(i){var e=q1.call(i,Sn),t=i[Sn];try{i[Sn]=void 0;var r=!0}catch{}var s=V1.call(i);return r&&(e?i[Sn]=t:delete i[Sn]),s}o(W1,"getRawTag");sm.exports=W1});var am=ve((jE,nm)=>{var G1=Object.prototype,K1=G1.toString;function X1(i){return K1.call(i)}o(X1,"objectToString");nm.exports=X1});var hm=ve((HE,cm)=>{var lm=_c(),Y1=om(),Q1=am(),J1="[object Null]",Z1="[object Undefined]",um=lm?lm.toStringTag:void 0;function ew(i){return i==null?i===void 0?Z1:J1:um&&um in Object(i)?Y1(i):Q1(i)}o(ew,"baseGetTag");cm.exports=ew});var pm=ve((qE,dm)=>{function tw(i){return i!=null&&typeof i=="object"}o(tw,"isObjectLike");dm.exports=tw});var mm=ve((WE,fm)=>{var iw=hm(),rw=pm(),sw="[object Symbol]";function ow(i){return typeof i=="symbol"||rw(i)&&iw(i)==sw}o(ow,"isSymbol");fm.exports=ow});var bm=ve((KE,vm)=>{var nw=em(),gm=Wl(),aw=mm(),ym=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 ym;if(gm(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=gm(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)?ym:+i}o(dw,"toNumber");vm.exports=dw});var Fc=ve((YE,Sm)=>{var pw=Wl(),Pc=Yf(),wm=bm(),fw="Expected a function",mw=Math.max,gw=Math.min;function yw(i,e,t){var r,s,n,a,u,l,h=0,d=!1,f=!1,y=!0;if(typeof i!="function")throw new TypeError(fw);e=wm(e)||0,pw(t)&&(d=!!t.leading,f="maxWait"in t,n=f?mw(wm(t.maxWait)||0,e):n,y="trailing"in t?!!t.trailing:y);function b(V){var W=r,te=s;return r=s=void 0,h=V,a=i.apply(te,W),a}o(b,"invokeFunc");function S(V){return h=V,u=setTimeout(P,e),d?b(V):a}o(S,"leadingEdge");function A(V){var W=V-l,te=V-h,re=e-W;return f?gw(re,n-te):re}o(A,"remainingWait");function O(V){var W=V-l,te=V-h;return l===void 0||W>=e||W<0||f&&te>=n}o(O,"shouldInvoke");function P(){var V=Pc();if(O(V))return R(V);u=setTimeout(P,A(V))}o(P,"timerExpired");function R(V){return u=void 0,y&&r?b(V):(r=s=void 0,a)}o(R,"trailingEdge");function H(){u!==void 0&&clearTimeout(u),h=0,r=l=s=u=void 0}o(H,"cancel");function X(){return u===void 0?a:R(Pc())}o(X,"flush");function K(){var V=Pc(),W=O(V);if(r=arguments,s=this,l=V,W){if(u===void 0)return S(l);if(f)return clearTimeout(u),u=setTimeout(P,e),b(l)}return u===void 0&&(u=setTimeout(P,e)),a}return o(K,"debounced"),K.cancel=H,K.flush=X,K}o(yw,"debounce");Sm.exports=yw});var Gl=ve((JE,_m)=>{var vw=Fc(),bw=Wl(),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");_m.exports=Sw});var Fn=ve((w3,Om)=>{"use strict";Om.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 Tm=ve((_3,Am)=>{"use strict";function Cm(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}o(Cm,"WildcardMatcher");Cm.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};Am.exports=function(i,e,t){var r=new Cm(i,t||/[\/\.]/);return typeof e<"u"?r.match(e):r}});var km=ve((F3,Rm)=>{var Ow=Tm(),Cw=/[\/\+\.]/;Rm.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 og=ve((pO,sg)=>{function Fi(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(Fi,"RetryOperation");sg.exports=Fi;Fi.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Fi.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Fi.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};Fi.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)};Fi.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)};Fi.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)};Fi.prototype.start=Fi.prototype.try;Fi.prototype.errors=function(){return this._errors};Fi.prototype.attempts=function(){return this._attempts};Fi.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 ng=ve(xs=>{var eS=og();xs.operation=function(i){var e=xs.timeouts(i);return new eS(e,{forever:i&&(i.forever||i.retries===1/0),unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};xs.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};xs.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};xs.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(l){var h=xs.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(){l.apply(i,d)})},"retryWrapper").bind(i,a),i[n].options=e}}});var lg=ve((yO,ag)=>{ag.exports=ng()});var Sg=ve((cC,Xc)=>{"use strict";var PS=Object.prototype.hasOwnProperty,Mt="~";function zn(){}o(zn,"Events");Object.create&&(zn.prototype=Object.create(null),new zn().__proto__||(Mt=!1));function FS(i,e,t){this.fn=i,this.context=e,this.once=t||!1}o(FS,"EE");function wg(i,e,t,r,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new FS(t,r||i,s),a=Mt?Mt+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(wg,"addListener");function cu(i,e){--i._eventsCount===0?i._events=new zn:delete i._events[e]}o(cu,"clearEvent");function Nt(){this._events=new zn,this._eventsCount=0}o(Nt,"EventEmitter");Nt.prototype.eventNames=o(function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)PS.call(t,r)&&e.push(Mt?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},"eventNames");Nt.prototype.listeners=o(function(e){var t=Mt?Mt+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");Nt.prototype.listenerCount=o(function(e){var t=Mt?Mt+e:e,r=this._events[t];return r?r.fn?1:r.length:0},"listenerCount");Nt.prototype.emit=o(function(e,t,r,s,n,a){var u=Mt?Mt+e:e;if(!this._events[u])return!1;var l=this._events[u],h=arguments.length,d,f;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,s),!0;case 5:return l.fn.call(l.context,t,r,s,n),!0;case 6:return l.fn.call(l.context,t,r,s,n,a),!0}for(f=1,d=new Array(h-1);f<h;f++)d[f-1]=arguments[f];l.fn.apply(l.context,d)}else{var y=l.length,b;for(f=0;f<y;f++)switch(l[f].once&&this.removeListener(e,l[f].fn,void 0,!0),h){case 1:l[f].fn.call(l[f].context);break;case 2:l[f].fn.call(l[f].context,t);break;case 3:l[f].fn.call(l[f].context,t,r);break;case 4:l[f].fn.call(l[f].context,t,r,s);break;default:if(!d)for(b=1,d=new Array(h-1);b<h;b++)d[b-1]=arguments[b];l[f].fn.apply(l[f].context,d)}}return!0},"emit");Nt.prototype.on=o(function(e,t,r){return wg(this,e,t,r,!1)},"on");Nt.prototype.once=o(function(e,t,r){return wg(this,e,t,r,!0)},"once");Nt.prototype.removeListener=o(function(e,t,r,s){var n=Mt?Mt+e:e;if(!this._events[n])return this;if(!t)return cu(this,n),this;var a=this._events[n];if(a.fn)a.fn===t&&(!s||a.once)&&(!r||a.context===r)&&cu(this,n);else{for(var u=0,l=[],h=a.length;u<h;u++)(a[u].fn!==t||s&&!a[u].once||r&&a[u].context!==r)&&l.push(a[u]);l.length?this._events[n]=l.length===1?l[0]:l:cu(this,n)}return this},"removeListener");Nt.prototype.removeAllListeners=o(function(e){var t;return e?(t=Mt?Mt+e:e,this._events[t]&&cu(this,t)):(this._events=new zn,this._eventsCount=0),this},"removeAllListeners");Nt.prototype.off=Nt.prototype.removeListener;Nt.prototype.addListener=Nt.prototype.on;Nt.prefixed=Mt;Nt.EventEmitter=Nt;typeof Xc<"u"&&(Xc.exports=Nt)});var ui=ve(($C,_u)=>{(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 u in s)i.call(s,u)&&s[u]&&t.push(u);else t.push(s.toString())}}return t.join(" ")}o(e,"classNames"),typeof _u<"u"&&_u.exports?(e.default=e,_u.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var Ny=ve((e8,Ly)=>{Ly.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 lv=ve((md,gd)=>{(function(i,e){typeof md=="object"&&typeof gd<"u"?gd.exports=e():typeof define=="function"&&define.amd?define(e):(i=i||self,i.Cropper=e())})(md,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(F){return Object.getOwnPropertyDescriptor(v,F).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 u(v){return l(v)||h(v)||d(v)||y()}o(u,"_toConsumableArray");function l(v){if(Array.isArray(v))return f(v)}o(l,"_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 b=typeof window<"u"&&typeof window.document<"u",S=b?window:{},A=b&&S.document.documentElement?"ontouchstart"in S.document.documentElement:!1,O=b?"PointerEvent"in S:!1,P="cropper",R="all",H="crop",X="move",K="zoom",V="e",W="w",te="s",re="n",Oe="ne",Re="nw",$e="se",we="sw",_e="".concat(P,"-crop"),Le="".concat(P,"-disabled"),C="".concat(P,"-hidden"),_="".concat(P,"-hide"),E="".concat(P,"-invisible"),L="".concat(P,"-modal"),z="".concat(P,"-move"),B="".concat(P,"Action"),D="".concat(P,"Preview"),T="crop",k="move",N="none",Y="crop",Q="cropend",Ce="cropmove",ge="cropstart",ue="dblclick",ce=A?"touchstart":"mousedown",Ue=A?"touchmove":"mousemove",Ne=A?"touchend touchcancel":"mouseup",kt=O?"pointerdown":ce,qe=O?"pointermove":Ue,oe=O?"pointerup pointercancel":Ne,Ut="ready",tt="resize",rr="wheel",hs="zoom",Qr="image/jpeg",ds=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,ps=/^data:/,fs=/^data:image\/jpeg;base64,/,Jr=/^img|canvas$/i,ot={viewMode:0,dragMode:T,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>',Il=Number.isNaN||S.isNaN;function he(v){return typeof v=="number"&&!Il(v)}o(he,"isNumber");var fn=o(function(p){return p>0&&p<1/0},"isPositiveNumber");function ko(v){return typeof v>"u"}o(ko,"isUndefined");function qi(v){return i(v)==="object"&&v!==null}o(qi,"isObject");var Ll=Object.prototype.hasOwnProperty;function sr(v){if(!qi(v))return!1;try{var p=v.constructor,g=p.prototype;return p&&g&&Ll.call(g,"isPrototypeOf")}catch{return!1}}o(sr,"isPlainObject");function St(v){return typeof v=="function"}o(St,"isFunction");var Nl=Array.prototype.slice;function Ml(v){return Array.from?Array.from(v):Nl.call(v)}o(Ml,"toArray");function Ve(v,p){return v&&St(p)&&(Array.isArray(v)||he(v.length)?Ml(v).forEach(function(g,m){p.call(v,g,m,v)}):qi(v)&&Object.keys(v).forEach(function(g){p.call(v,v[g],g,v)})),v}o(Ve,"forEach");var Ae=Object.assign||o(function(p){for(var g=arguments.length,m=new Array(g>1?g-1:0),F=1;F<g;F++)m[F-1]=arguments[F];return qi(p)&&m.length>0&&m.forEach(function(w){qi(w)&&Object.keys(w).forEach(function(x){p[x]=w[x]})}),p},"assign"),gc=/\.\d*(?:0|9){12}\d*$/;function Vi(v){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return gc.test(v)?Math.round(v*p)/p:v}o(Vi,"normalizeDecimalNumber");var Bl=/^width|height|left|top|marginLeft|marginTop$/;function Ti(v,p){var g=v.style;Ve(p,function(m,F){Bl.test(F)&&he(m)&&(m="".concat(m,"px")),g[F]=m})}o(Ti,"setStyle");function mn(v,p){return v.classList?v.classList.contains(p):v.className.indexOf(p)>-1}o(mn,"hasClass");function We(v,p){if(p){if(he(v.length)){Ve(v,function(m){We(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(We,"addClass");function ii(v,p){if(p){if(he(v.length)){Ve(v,function(g){ii(g,p)});return}if(v.classList){v.classList.remove(p);return}v.className.indexOf(p)>=0&&(v.className=v.className.replace(p,""))}}o(ii,"removeClass");function or(v,p,g){if(p){if(he(v.length)){Ve(v,function(m){or(m,p,g)});return}g?We(v,p):ii(v,p)}}o(or,"toggleClass");var jl=/([a-z\d])([A-Z])/g;function Uo(v){return v.replace(jl,"$1-$2").toLowerCase()}o(Uo,"toParamCase");function Do(v,p){return qi(v[p])?v[p]:v.dataset?v.dataset[p]:v.getAttribute("data-".concat(Uo(p)))}o(Do,"getData");function Io(v,p,g){qi(g)?v[p]=g:v.dataset?v.dataset[p]=g:v.setAttribute("data-".concat(Uo(p)),g)}o(Io,"setData");function ms(v,p){if(qi(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(Uo(p)))}o(ms,"removeData");var gn=/\s\s*/,yn=function(){var v=!1;if(b){var p=!1,g=o(function(){},"listener"),m=Object.defineProperty({},"once",{get:o(function(){return v=!0,p},"get"),set:o(function(w){p=w},"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]:{},F=g;p.trim().split(gn).forEach(function(w){if(!yn){var x=v.listeners;x&&x[w]&&x[w][g]&&(F=x[w][g],delete x[w][g],Object.keys(x[w]).length===0&&delete x[w],Object.keys(x).length===0&&delete v.listeners)}v.removeEventListener(w,F,m)})}o(gt,"removeListener");function Dt(v,p,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},F=g;p.trim().split(gn).forEach(function(w){if(m.once&&!yn){var x=v.listeners,U=x===void 0?{}:x;F=o(function(){delete U[w][g],v.removeEventListener(w,F,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[w]||(U[w]={}),U[w][g]&&v.removeEventListener(w,U[w][g],m),U[w][g]=F,v.listeners=U}v.addEventListener(w,F,m)})}o(Dt,"addListener");function Si(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(Si,"dispatchEvent");function Uf(v){var p=v.getBoundingClientRect();return{left:p.left+(window.pageXOffset-document.documentElement.clientLeft),top:p.top+(window.pageYOffset-document.documentElement.clientTop)}}o(Uf,"getOffset");var yc=S.location,Z0=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Df(v){var p=v.match(Z0);return p!==null&&(p[1]!==yc.protocol||p[2]!==yc.hostname||p[3]!==yc.port)}o(Df,"isCrossOriginURL");function If(v){var p="timestamp=".concat(new Date().getTime());return v+(v.indexOf("?")===-1?"?":"&")+p}o(If,"addTimestamp");function vn(v){var p=v.rotate,g=v.scaleX,m=v.scaleY,F=v.translateX,w=v.translateY,x=[];he(F)&&F!==0&&x.push("translateX(".concat(F,"px)")),he(w)&&w!==0&&x.push("translateY(".concat(w,"px)")),he(p)&&p!==0&&x.push("rotate(".concat(p,"deg)")),he(g)&&g!==1&&x.push("scaleX(".concat(g,")")),he(m)&&m!==1&&x.push("scaleY(".concat(m,")"));var U=x.length?x.join(" "):"none";return{WebkitTransform:U,msTransform:U,transform:U}}o(vn,"getTransforms");function e1(v){var p=a({},v),g=[];return Ve(v,function(m,F){delete p[F],Ve(p,function(w){var x=Math.abs(m.startX-w.startX),U=Math.abs(m.startY-w.startY),q=Math.abs(m.endX-w.endX),j=Math.abs(m.endY-w.endY),M=Math.sqrt(x*x+U*U),I=Math.sqrt(q*q+j*j),$=(I-M)/M;g.push($)})}),g.sort(function(m,F){return Math.abs(m)<Math.abs(F)}),g[0]}o(e1,"getMaxZoomRatio");function zl(v,p){var g=v.pageX,m=v.pageY,F={endX:g,endY:m};return p?F:a({startX:g,startY:m},F)}o(zl,"getPointer");function t1(v){var p=0,g=0,m=0;return Ve(v,function(F){var w=F.startX,x=F.startY;p+=w,g+=x,m+=1}),p/=m,g/=m,{pageX:p,pageY:g}}o(t1,"getPointersCenter");function Zr(v){var p=v.aspectRatio,g=v.height,m=v.width,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",w=fn(m),x=fn(g);if(w&&x){var U=g*p;F==="contain"&&U>m||F==="cover"&&U<m?g=m/p:m=g*p}else w?g=m/p:x&&(m=g*p);return{width:m,height:g}}o(Zr,"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 F=m%90*Math.PI/180,w=Math.sin(F),x=Math.cos(F),U=p*x+g*w,q=p*w+g*x;return m>90?{width:q,height:U}:{width:U,height:q}}o(i1,"getRotatedSizes");function r1(v,p,g,m){var F=p.aspectRatio,w=p.naturalWidth,x=p.naturalHeight,U=p.rotate,q=U===void 0?0:U,j=p.scaleX,M=j===void 0?1:j,I=p.scaleY,$=I===void 0?1:I,ye=g.aspectRatio,me=g.naturalWidth,De=g.naturalHeight,Pe=m.fillColor,nt=Pe===void 0?"transparent":Pe,yt=m.imageSmoothingEnabled,it=yt===void 0?!0:yt,nr=m.imageSmoothingQuality,ri=nr===void 0?"low":nr,G=m.maxWidth,Fe=G===void 0?1/0:G,at=m.maxHeight,_i=at===void 0?1/0:at,ar=m.minWidth,gs=ar===void 0?0:ar,ys=m.minHeight,es=ys===void 0?0:ys,Wi=document.createElement("canvas"),Xt=Wi.getContext("2d"),vs=Zr({aspectRatio:ye,width:Fe,height:_i}),Hl=Zr({aspectRatio:ye,width:gs,height:es},"cover"),vc=Math.min(vs.width,Math.max(Hl.width,me)),bc=Math.min(vs.height,Math.max(Hl.height,De)),Mf=Zr({aspectRatio:F,width:Fe,height:_i}),Bf=Zr({aspectRatio:F,width:gs,height:es},"cover"),jf=Math.min(Mf.width,Math.max(Bf.width,w)),zf=Math.min(Mf.height,Math.max(Bf.height,x)),y1=[-jf/2,-zf/2,jf,zf];return Wi.width=Vi(vc),Wi.height=Vi(bc),Xt.fillStyle=nt,Xt.fillRect(0,0,vc,bc),Xt.save(),Xt.translate(vc/2,bc/2),Xt.rotate(q*Math.PI/180),Xt.scale(M,$),Xt.imageSmoothingEnabled=it,Xt.imageSmoothingQuality=ri,Xt.drawImage.apply(Xt,[v].concat(u(y1.map(function(v1){return Math.floor(Vi(v1))})))),Xt.restore(),Wi}o(r1,"getSourceCanvas");var Lf=String.fromCharCode;function s1(v,p,g){var m="";g+=p;for(var F=p;F<g;F+=1)m+=Lf(v.getUint8(F));return m}o(s1,"getStringFromCharCode");var o1=/^data:.*,/;function n1(v){var p=v.replace(o1,""),g=atob(p),m=new ArrayBuffer(g.length),F=new Uint8Array(m);return Ve(F,function(w,x){F[x]=g.charCodeAt(x)}),m}o(n1,"dataURLToArrayBuffer");function a1(v,p){for(var g=[],m=8192,F=new Uint8Array(v);F.length>0;)g.push(Lf.apply(null,Ml(F.subarray(0,m)))),F=F.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,F,w;if(p.getUint8(0)===255&&p.getUint8(1)===216)for(var x=p.byteLength,U=2;U+1<x;){if(p.getUint8(U)===255&&p.getUint8(U+1)===225){F=U;break}U+=1}if(F){var q=F+4,j=F+10;if(s1(p,q,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&&(w=j+I)}}}if(w){var $=p.getUint16(w,m),ye,me;for(me=0;me<$;me+=1)if(ye=w+me*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,F=this.cropper;We(F,C),ii(p,C);var w={width:Math.max(m.offsetWidth,Number(g.minContainerWidth)||200),height:Math.max(m.offsetHeight,Number(g.minContainerHeight)||100)};this.containerData=w,Ti(F,{width:w.width,height:w.height}),We(p,C),ii(F,C)},"initContainer"),initCanvas:o(function(){var p=this.containerData,g=this.imageData,m=this.options.viewMode,F=Math.abs(g.rotate)%180===90,w=F?g.naturalHeight:g.naturalWidth,x=F?g.naturalWidth:g.naturalHeight,U=w/x,q=p.width,j=p.height;p.height*U>p.width?m===3?q=p.height*U:j=p.width/U:m===3?j=p.width/U:q=p.height*U;var M={aspectRatio:U,naturalWidth:w,naturalHeight:x,width:q,height:j};M.left=(p.width-q)/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=Ae({},g),this.initialCanvasData=Ae({},M)},"initCanvas"),limitCanvas:o(function(p,g){var m=this.options,F=this.containerData,w=this.canvasData,x=this.cropBoxData,U=m.viewMode,q=w.aspectRatio,j=this.cropped&&x;if(p){var M=Number(m.minCanvasWidth)||0,I=Number(m.minCanvasHeight)||0;U>1?(M=Math.max(M,F.width),I=Math.max(I,F.height),U===3&&(I*q>M?M=I*q:I=M/q)):U>0&&(M?M=Math.max(M,j?x.width:0):I?I=Math.max(I,j?x.height:0):j&&(M=x.width,I=x.height,I*q>M?M=I*q:I=M/q));var $=Zr({aspectRatio:q,width:M,height:I});M=$.width,I=$.height,w.minWidth=M,w.minHeight=I,w.maxWidth=1/0,w.maxHeight=1/0}if(g)if(U>(j?0:1)){var ye=F.width-w.width,me=F.height-w.height;w.minLeft=Math.min(0,ye),w.minTop=Math.min(0,me),w.maxLeft=Math.max(0,ye),w.maxTop=Math.max(0,me),j&&this.limited&&(w.minLeft=Math.min(x.left,x.left+(x.width-w.width)),w.minTop=Math.min(x.top,x.top+(x.height-w.height)),w.maxLeft=x.left,w.maxTop=x.top,U===2&&(w.width>=F.width&&(w.minLeft=Math.min(0,ye),w.maxLeft=Math.max(0,ye)),w.height>=F.height&&(w.minTop=Math.min(0,me),w.maxTop=Math.max(0,me))))}else w.minLeft=-w.width,w.minTop=-w.height,w.maxLeft=F.width,w.maxTop=F.height},"limitCanvas"),renderCanvas:o(function(p,g){var m=this.canvasData,F=this.imageData;if(g){var w=i1({width:F.naturalWidth*Math.abs(F.scaleX||1),height:F.naturalHeight*Math.abs(F.scaleY||1),degree:F.rotate||0}),x=w.width,U=w.height,q=m.width*(x/m.naturalWidth),j=m.height*(U/m.naturalHeight);m.left-=(q-m.width)/2,m.top-=(j-m.height)/2,m.width=q,m.height=j,m.aspectRatio=x/U,m.naturalWidth=x,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,Ti(this.canvas,Ae({width:m.width,height:m.height},vn({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,F=m.naturalWidth*(g.width/g.naturalWidth),w=m.naturalHeight*(g.height/g.naturalHeight);Ae(m,{width:F,height:w,left:(g.width-F)/2,top:(g.height-w)/2}),Ti(this.image,Ae({width:m.width,height:m.height},vn(Ae({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,F=Number(p.autoCropArea)||.8,w={width:g.width,height:g.height};m&&(g.height*m>g.width?w.height=w.width/m:w.width=w.height*m),this.cropBoxData=w,this.limitCropBox(!0,!0),w.width=Math.min(Math.max(w.width,w.minWidth),w.maxWidth),w.height=Math.min(Math.max(w.height,w.minHeight),w.maxHeight),w.width=Math.max(w.minWidth,w.width*F),w.height=Math.max(w.minHeight,w.height*F),w.left=g.left+(g.width-w.width)/2,w.top=g.top+(g.height-w.height)/2,w.oldLeft=w.left,w.oldTop=w.top,this.initialCropBoxData=Ae({},w)},"initCropBox"),limitCropBox:o(function(p,g){var m=this.options,F=this.containerData,w=this.canvasData,x=this.cropBoxData,U=this.limited,q=m.aspectRatio;if(p){var j=Number(m.minCropBoxWidth)||0,M=Number(m.minCropBoxHeight)||0,I=U?Math.min(F.width,w.width,w.width+w.left,F.width-w.left):F.width,$=U?Math.min(F.height,w.height,w.height+w.top,F.height-w.top):F.height;j=Math.min(j,F.width),M=Math.min(M,F.height),q&&(j&&M?M*q>j?M=j/q:j=M*q:j?M=j/q:M&&(j=M*q),$*q>I?$=I/q:I=$*q),x.minWidth=Math.min(j,I),x.minHeight=Math.min(M,$),x.maxWidth=I,x.maxHeight=$}g&&(U?(x.minLeft=Math.max(0,w.left),x.minTop=Math.max(0,w.top),x.maxLeft=Math.min(F.width,w.left+w.width)-x.width,x.maxTop=Math.min(F.height,w.top+w.height)-x.height):(x.minLeft=0,x.minTop=0,x.maxLeft=F.width-x.width,x.maxTop=F.height-x.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&&Io(this.face,B,m.width>=g.width&&m.height>=g.height?X:R),Ti(this.cropBox,Ae({width:m.width,height:m.height},vn({translateX:m.left,translateY:m.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},"renderCropBox"),output:o(function(){this.preview(),Si(this.element,Y,this.getData())},"output")},h1={initPreview:o(function(){var p=this.element,g=this.crossOrigin,m=this.options.preview,F=g?this.crossOriginUrl:this.url,w=p.alt||"The image to preview",x=document.createElement("img");if(g&&(x.crossOrigin=g),x.src=F,x.alt=w,this.viewBox.appendChild(x),this.viewBoxImage=x,!!m){var U=m;typeof m=="string"?U=p.ownerDocument.querySelectorAll(m):m.querySelector&&(U=[m]),this.previews=U,Ve(U,function(q){var j=document.createElement("img");Io(q,D,{width:q.offsetWidth,height:q.offsetHeight,html:q.innerHTML}),g&&(j.crossOrigin=g),j.src=F,j.alt=w,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;"',q.innerHTML="",q.appendChild(j)})}},"initPreview"),resetPreview:o(function(){Ve(this.previews,function(p){var g=Do(p,D);Ti(p,{width:g.width,height:g.height}),p.innerHTML=g.html,ms(p,D)})},"resetPreview"),preview:o(function(){var p=this.imageData,g=this.canvasData,m=this.cropBoxData,F=m.width,w=m.height,x=p.width,U=p.height,q=m.left-g.left-p.left,j=m.top-g.top-p.top;!this.cropped||this.disabled||(Ti(this.viewBoxImage,Ae({width:x,height:U},vn(Ae({translateX:-q,translateY:-j},p)))),Ve(this.previews,function(M){var I=Do(M,D),$=I.width,ye=I.height,me=$,De=ye,Pe=1;F&&(Pe=$/F,De=w*Pe),w&&De>ye&&(Pe=ye/w,me=F*Pe,De=ye),Ti(M,{width:me,height:De}),Ti(M.getElementsByTagName("img")[0],Ae({width:x*Pe,height:U*Pe},vn(Ae({translateX:-q*Pe,translateY:-j*Pe},p))))}))},"preview")},d1={bind:o(function(){var p=this.element,g=this.options,m=this.cropper;St(g.cropstart)&&Dt(p,ge,g.cropstart),St(g.cropmove)&&Dt(p,Ce,g.cropmove),St(g.cropend)&&Dt(p,Q,g.cropend),St(g.crop)&&Dt(p,Y,g.crop),St(g.zoom)&&Dt(p,hs,g.zoom),Dt(m,kt,this.onCropStart=this.cropStart.bind(this)),g.zoomable&&g.zoomOnWheel&&Dt(m,rr,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&Dt(m,ue,this.onDblclick=this.dblclick.bind(this)),Dt(p.ownerDocument,qe,this.onCropMove=this.cropMove.bind(this)),Dt(p.ownerDocument,oe,this.onCropEnd=this.cropEnd.bind(this)),g.responsive&&Dt(window,tt,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,Ce,g.cropmove),St(g.cropend)&&gt(p,Q,g.cropend),St(g.crop)&&gt(p,Y,g.crop),St(g.zoom)&&gt(p,hs,g.zoom),gt(m,kt,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,tt,this.onResize)},"unbind")},p1={resize:o(function(){if(!this.disabled){var p=this.options,g=this.container,m=this.containerData,F=g.offsetWidth/m.width;if(F!==1||g.offsetHeight!==m.height){var w,x;p.restore&&(w=this.getCanvasData(),x=this.getCropBoxData()),this.render(),p.restore&&(this.setCanvasData(Ve(w,function(U,q){w[q]=U*F})),this.setCropBoxData(Ve(x,function(U,q){x[q]=U*F})))}}},"resize"),dblclick:o(function(){this.disabled||this.options.dragMode===N||this.setDragMode(mn(this.dragBox,_e)?k:T)},"dblclick"),wheel:o(function(p){var g=this,m=Number(this.options.wheelZoomRatio)||.1,F=1;this.disabled||(p.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){g.wheeling=!1},50),p.deltaY?F=p.deltaY>0?1:-1:p.wheelDelta?F=-p.wheelDelta/120:p.detail&&(F=p.detail>0?1:-1),this.zoom(-F*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 F=this.options,w=this.pointers,x;p.changedTouches?Ve(p.changedTouches,function(U){w[U.identifier]=zl(U)}):w[p.pointerId||0]=zl(p),Object.keys(w).length>1&&F.zoomable&&F.zoomOnTouch?x=K:x=Do(p.target,B),ds.test(x)&&Si(this.element,ge,{originalEvent:p,action:x})!==!1&&(p.preventDefault(),this.action=x,this.cropping=!1,x===H&&(this.cropping=!0,We(this.dragBox,L)))}},"cropStart"),cropMove:o(function(p){var g=this.action;if(!(this.disabled||!g)){var m=this.pointers;p.preventDefault(),Si(this.element,Ce,{originalEvent:p,action:g})!==!1&&(p.changedTouches?Ve(p.changedTouches,function(F){Ae(m[F.identifier]||{},zl(F,!0))}):Ae(m[p.pointerId||0]||{},zl(p,!0)),this.change(p))}},"cropMove"),cropEnd:o(function(p){if(!this.disabled){var g=this.action,m=this.pointers;p.changedTouches?Ve(p.changedTouches,function(F){delete m[F.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)),Si(this.element,Q,{originalEvent:p,action:g}))}},"cropEnd")},f1={change:o(function(p){var g=this.options,m=this.canvasData,F=this.containerData,w=this.cropBoxData,x=this.pointers,U=this.action,q=g.aspectRatio,j=w.left,M=w.top,I=w.width,$=w.height,ye=j+I,me=M+$,De=0,Pe=0,nt=F.width,yt=F.height,it=!0,nr;!q&&p.shiftKey&&(q=I&&$?I/$:1),this.limited&&(De=w.minLeft,Pe=w.minTop,nt=De+Math.min(F.width,m.width,m.left+m.width),yt=Pe+Math.min(F.height,m.height,m.top+m.height));var ri=x[Object.keys(x)[0]],G={x:ri.endX-ri.startX,y:ri.endY-ri.startY},Fe=o(function(_i){switch(_i){case V:ye+G.x>nt&&(G.x=nt-ye);break;case W:j+G.x<De&&(G.x=De-j);break;case re:M+G.y<Pe&&(G.y=Pe-M);break;case te:me+G.y>yt&&(G.y=yt-me);break}},"check");switch(U){case R:j+=G.x,M+=G.y;break;case V:if(G.x>=0&&(ye>=nt||q&&(M<=Pe||me>=yt))){it=!1;break}Fe(V),I+=G.x,I<0&&(U=W,I=-I,j-=I),q&&($=I/q,M+=(w.height-$)/2);break;case re:if(G.y<=0&&(M<=Pe||q&&(j<=De||ye>=nt))){it=!1;break}Fe(re),$-=G.y,M+=G.y,$<0&&(U=te,$=-$,M-=$),q&&(I=$*q,j+=(w.width-I)/2);break;case W:if(G.x<=0&&(j<=De||q&&(M<=Pe||me>=yt))){it=!1;break}Fe(W),I-=G.x,j+=G.x,I<0&&(U=V,I=-I,j-=I),q&&($=I/q,M+=(w.height-$)/2);break;case te:if(G.y>=0&&(me>=yt||q&&(j<=De||ye>=nt))){it=!1;break}Fe(te),$+=G.y,$<0&&(U=re,$=-$,M-=$),q&&(I=$*q,j+=(w.width-I)/2);break;case Oe:if(q){if(G.y<=0&&(M<=Pe||ye>=nt)){it=!1;break}Fe(re),$-=G.y,M+=G.y,I=$*q}else Fe(re),Fe(V),G.x>=0?ye<nt?I+=G.x:G.y<=0&&M<=Pe&&(it=!1):I+=G.x,G.y<=0?M>Pe&&($-=G.y,M+=G.y):($-=G.y,M+=G.y);I<0&&$<0?(U=we,$=-$,I=-I,M-=$,j-=I):I<0?(U=Re,I=-I,j-=I):$<0&&(U=$e,$=-$,M-=$);break;case Re:if(q){if(G.y<=0&&(M<=Pe||j<=De)){it=!1;break}Fe(re),$-=G.y,M+=G.y,I=$*q,j+=w.width-I}else Fe(re),Fe(W),G.x<=0?j>De?(I-=G.x,j+=G.x):G.y<=0&&M<=Pe&&(it=!1):(I-=G.x,j+=G.x),G.y<=0?M>Pe&&($-=G.y,M+=G.y):($-=G.y,M+=G.y);I<0&&$<0?(U=$e,$=-$,I=-I,M-=$,j-=I):I<0?(U=Oe,I=-I,j-=I):$<0&&(U=we,$=-$,M-=$);break;case we:if(q){if(G.x<=0&&(j<=De||me>=yt)){it=!1;break}Fe(W),I-=G.x,j+=G.x,$=I/q}else Fe(te),Fe(W),G.x<=0?j>De?(I-=G.x,j+=G.x):G.y>=0&&me>=yt&&(it=!1):(I-=G.x,j+=G.x),G.y>=0?me<yt&&($+=G.y):$+=G.y;I<0&&$<0?(U=Oe,$=-$,I=-I,M-=$,j-=I):I<0?(U=$e,I=-I,j-=I):$<0&&(U=Re,$=-$,M-=$);break;case $e:if(q){if(G.x>=0&&(ye>=nt||me>=yt)){it=!1;break}Fe(V),I+=G.x,$=I/q}else Fe(te),Fe(V),G.x>=0?ye<nt?I+=G.x:G.y>=0&&me>=yt&&(it=!1):I+=G.x,G.y>=0?me<yt&&($+=G.y):$+=G.y;I<0&&$<0?(U=Re,$=-$,I=-I,M-=$,j-=I):I<0?(U=we,I=-I,j-=I):$<0&&(U=Oe,$=-$,M-=$);break;case X:this.move(G.x,G.y),it=!1;break;case K:this.zoom(e1(x),p),it=!1;break;case H:if(!G.x||!G.y){it=!1;break}nr=Uf(this.cropper),j=ri.startX-nr.left,M=ri.startY-nr.top,I=w.minWidth,$=w.minHeight,G.x>0?U=G.y>0?$e:Oe:G.x<0&&(j-=I,U=G.y>0?we:Re),G.y<0&&(M-=$),this.cropped||(ii(this.cropBox,C),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}it&&(w.width=I,w.height=$,w.left=j,w.top=M,this.action=U,this.renderCropBox()),Ve(x,function(at){at.startX=at.endX,at.startY=at.endY})},"change")},m1={crop:o(function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&We(this.dragBox,L),ii(this.cropBox,C),this.setCropBoxData(this.initialCropBoxData)),this},"crop"),reset:o(function(){return this.ready&&!this.disabled&&(this.imageData=Ae({},this.initialImageData),this.canvasData=Ae({},this.initialCanvasData),this.cropBoxData=Ae({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},"reset"),clear:o(function(){return this.cropped&&!this.disabled&&(Ae(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),ii(this.dragBox,L),We(this.cropBox,C)),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,Ve(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,ii(this.cropper,Le)),this},"enable"),disable:o(function(){return this.ready&&!this.disabled&&(this.disabled=!0,We(this.cropper,Le)),this},"disable"),destroy:o(function(){var p=this.element;return p[P]?(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,F=m.left,w=m.top;return this.moveTo(ko(p)?p:F+Number(p),ko(g)?g:w+Number(g))},"move"),moveTo:o(function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p,m=this.canvasData,F=!1;return p=Number(p),g=Number(g),this.ready&&!this.disabled&&this.options.movable&&(he(p)&&(m.left=p,F=!0),he(g)&&(m.top=g,F=!0),F&&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 F=this.options,w=this.canvasData,x=w.width,U=w.height,q=w.naturalWidth,j=w.naturalHeight;if(p=Number(p),p>=0&&this.ready&&!this.disabled&&F.zoomable){var M=q*p,I=j*p;if(Si(this.element,hs,{ratio:p,oldRatio:x/q,originalEvent:m})===!1)return this;if(m){var $=this.pointers,ye=Uf(this.cropper),me=$&&Object.keys($).length?t1($):{pageX:m.pageX,pageY:m.pageY};w.left-=(M-x)*((me.pageX-ye.left-w.left)/x),w.top-=(I-U)*((me.pageY-ye.top-w.top)/U)}else sr(g)&&he(g.x)&&he(g.y)?(w.left-=(M-x)*((g.x-w.left)/x),w.top-=(I-U)*((g.y-w.top)/U)):(w.left-=(M-x)/2,w.top-=(I-U)/2);w.width=M,w.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,F=!1;return p=Number(p),g=Number(g),this.ready&&!this.disabled&&this.options.scalable&&(he(p)&&(m.scaleX=p,F=!0),he(g)&&(m.scaleY=g,F=!0),F&&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,F=this.canvasData,w=this.cropBoxData,x;if(this.ready&&this.cropped){x={x:w.left-F.left,y:w.top-F.top,width:w.width,height:w.height};var U=m.width/m.naturalWidth;if(Ve(x,function(M,I){x[I]=M/U}),p){var q=Math.round(x.y+x.height),j=Math.round(x.x+x.width);x.x=Math.round(x.x),x.y=Math.round(x.y),x.width=j-x.x,x.height=q-x.y}}else x={x:0,y:0,width:0,height:0};return g.rotatable&&(x.rotate=m.rotate||0),g.scalable&&(x.scaleX=m.scaleX||1,x.scaleY=m.scaleY||1),x},"getData"),setData:o(function(p){var g=this.options,m=this.imageData,F=this.canvasData,w={};if(this.ready&&!this.disabled&&sr(p)){var x=!1;g.rotatable&&he(p.rotate)&&p.rotate!==m.rotate&&(m.rotate=p.rotate,x=!0),g.scalable&&(he(p.scaleX)&&p.scaleX!==m.scaleX&&(m.scaleX=p.scaleX,x=!0),he(p.scaleY)&&p.scaleY!==m.scaleY&&(m.scaleY=p.scaleY,x=!0)),x&&this.renderCanvas(!0,!0);var U=m.width/m.naturalWidth;he(p.x)&&(w.left=p.x*U+F.left),he(p.y)&&(w.top=p.y*U+F.top),he(p.width)&&(w.width=p.width*U),he(p.height)&&(w.height=p.height*U),this.setCropBoxData(w)}return this},"setData"),getContainerData:o(function(){return this.ready?Ae({},this.containerData):{}},"getContainerData"),getImageData:o(function(){return this.sized?Ae({},this.imageData):{}},"getImageData"),getCanvasData:o(function(){var p=this.canvasData,g={};return this.ready&&Ve(["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,F,w;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&&(F=!0,g.width=p.width),he(p.height)&&p.height!==g.height&&(w=!0,g.height=p.height),m&&(F?g.height=g.width/m:w&&(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 F=this.getData(),w=F.x,x=F.y,U=F.width,q=F.height,j=m.width/Math.floor(g.naturalWidth);j!==1&&(w*=j,x*=j,U*=j,q*=j);var M=U/q,I=Zr({aspectRatio:M,width:p.maxWidth||1/0,height:p.maxHeight||1/0}),$=Zr({aspectRatio:M,width:p.minWidth||0,height:p.minHeight||0},"cover"),ye=Zr({aspectRatio:M,width:p.width||(j!==1?m.width:U),height:p.height||(j!==1?m.height:q)}),me=ye.width,De=ye.height;me=Math.min(I.width,Math.max($.width,me)),De=Math.min(I.height,Math.max($.height,De));var Pe=document.createElement("canvas"),nt=Pe.getContext("2d");Pe.width=Vi(me),Pe.height=Vi(De),nt.fillStyle=p.fillColor||"transparent",nt.fillRect(0,0,me,De);var yt=p.imageSmoothingEnabled,it=yt===void 0?!0:yt,nr=p.imageSmoothingQuality;nt.imageSmoothingEnabled=it,nr&&(nt.imageSmoothingQuality=nr);var ri=m.width,G=m.height,Fe=w,at=x,_i,ar,gs,ys,es,Wi;Fe<=-U||Fe>ri?(Fe=0,_i=0,gs=0,es=0):Fe<=0?(gs=-Fe,Fe=0,_i=Math.min(ri,U+Fe),es=_i):Fe<=ri&&(gs=0,_i=Math.min(U,ri-Fe),es=_i),_i<=0||at<=-q||at>G?(at=0,ar=0,ys=0,Wi=0):at<=0?(ys=-at,at=0,ar=Math.min(G,q+at),Wi=ar):at<=G&&(ys=0,ar=Math.min(q,G-at),Wi=ar);var Xt=[Fe,at,_i,ar];if(es>0&&Wi>0){var vs=me/U;Xt.push(gs*vs,ys*vs,es*vs,Wi*vs)}return nt.drawImage.apply(nt,[m].concat(u(Xt.map(function(Hl){return Math.floor(Vi(Hl))})))),Pe},"getCroppedCanvas"),setAspectRatio:o(function(p){var g=this.options;return!this.disabled&&!ko(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,F=this.face;if(this.ready&&!this.disabled){var w=p===T,x=g.movable&&p===k;p=w||x?p:N,g.dragMode=p,Io(m,B,p),or(m,_e,w),or(m,z,x),g.cropBoxMovable||(Io(F,B,p),or(F,_e,w),or(F,z,x))}return this},"setDragMode")},g1=S.Cropper,Nf=function(){function v(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e(this,v),!p||!Jr.test(p.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=p,this.options=Ae({},ot,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(),F;if(!g[P]){if(g[P]=this,m==="img"){if(this.isImg=!0,F=g.getAttribute("src")||"",this.originalUrl=F,!F)return;F=g.src}else m==="canvas"&&window.HTMLCanvasElement&&(F=g.toDataURL());this.load(F)}},"init")},{key:"load",value:o(function(g){var m=this;if(g){this.url=g,this.imageData={};var F=this.element,w=this.options;if(!w.rotatable&&!w.scalable&&(w.checkOrientation=!1),!w.checkOrientation||!window.ArrayBuffer){this.clone();return}if(ps.test(g)){fs.test(g)?this.read(n1(g)):this.clone();return}var x=new XMLHttpRequest,U=this.clone.bind(this);this.reloading=!0,this.xhr=x,x.onabort=U,x.onerror=U,x.ontimeout=U,x.onprogress=function(){x.getResponseHeader("content-type")!==Qr&&x.abort()},x.onload=function(){m.read(x.response)},x.onloadend=function(){m.reloading=!1,m.xhr=null},w.checkCrossOrigin&&Df(g)&&F.crossOrigin&&(g=If(g)),x.open("GET",g),x.responseType="arraybuffer",x.withCredentials=F.crossOrigin==="use-credentials",x.send()}},"load")},{key:"read",value:o(function(g){var m=this.options,F=this.imageData,w=l1(g),x=0,U=1,q=1;if(w>1){this.url=a1(g,Qr);var j=u1(w);x=j.rotate,U=j.scaleX,q=j.scaleY}m.rotatable&&(F.rotate=x),m.scalable&&(F.scaleX=U,F.scaleY=q),this.clone()},"read")},{key:"clone",value:o(function(){var g=this.element,m=this.url,F=g.crossOrigin,w=m;this.options.checkCrossOrigin&&Df(m)&&(F||(F="anonymous"),w=If(m)),this.crossOrigin=F,this.crossOriginUrl=w;var x=document.createElement("img");F&&(x.crossOrigin=F),x.src=w||m,x.alt=g.alt||"The image to crop",this.image=x,x.onload=this.start.bind(this),x.onerror=this.stop.bind(this),We(x,_),g.parentNode.insertBefore(x,g.nextSibling)},"clone")},{key:"start",value:o(function(){var g=this,m=this.image;m.onload=null,m.onerror=null,this.sizing=!0;var F=S.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(S.navigator.userAgent),w=o(function(j,M){Ae(g.imageData,{naturalWidth:j,naturalHeight:M,aspectRatio:j/M}),g.sizing=!1,g.sized=!0,g.build()},"done");if(m.naturalWidth&&!F){w(m.naturalWidth,m.naturalHeight);return}var x=document.createElement("img"),U=document.body||document.documentElement;this.sizingImage=x,x.onload=function(){w(x.width,x.height),F||U.removeChild(x)},x.src=m.src,F||(x.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(x))},"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,F=this.image,w=g.parentNode,x=document.createElement("div");x.innerHTML=mt;var U=x.querySelector(".".concat(P,"-container")),q=U.querySelector(".".concat(P,"-canvas")),j=U.querySelector(".".concat(P,"-drag-box")),M=U.querySelector(".".concat(P,"-crop-box")),I=M.querySelector(".".concat(P,"-face"));this.container=w,this.cropper=U,this.canvas=q,this.dragBox=j,this.cropBox=M,this.viewBox=U.querySelector(".".concat(P,"-view-box")),this.face=I,q.appendChild(F),We(g,C),w.insertBefore(U,g.nextSibling),this.isImg||ii(F,_),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,We(M,C),m.guides||We(M.getElementsByClassName("".concat(P,"-dashed")),C),m.center||We(M.getElementsByClassName("".concat(P,"-center")),C),m.background&&We(U,"".concat(P,"-bg")),m.highlight||We(I,E),m.cropBoxMovable&&(We(I,z),Io(I,B,R)),m.cropBoxResizable||(We(M.getElementsByClassName("".concat(P,"-line")),C),We(M.getElementsByClassName("".concat(P,"-point")),C)),this.render(),this.ready=!0,this.setDragMode(m.dragMode),m.autoCrop&&this.crop(),this.setData(m.data),St(m.ready)&&Dt(g,Ut,m.ready,{once:!0}),Si(g,Ut)}},"build")},{key:"unbuild",value:o(function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),ii(this.element,C))},"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){Ae(ot,sr(g)&&g)},"setDefaults")}]),v}();return Ae(Nf.prototype,c1,h1,d1,p1,f1,m1),Nf})});var Nv=ve((M7,Wu)=>{"use strict";Wu.exports=zd;Wu.exports.isMobile=zd;Wu.exports.default=zd;var gP=/(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,yP=/CrOS/,vP=/android|ipad|playbook|silk/i;function zd(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=gP.test(e)&&!yP.test(e)||!!i.tablet&&vP.test(e);return!t&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.indexOf("Macintosh")!==-1&&e.indexOf("Safari")!==-1&&(t=!0),t}o(zd,"isMobile")});var xb=ve((J9,Fb)=>{"use strict";Fb.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 k5=Object.prototype.hasOwnProperty,U5;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 D5(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(D5,"querystring");function I5(i,e){e=e||"";var t=[],r,s;typeof e!="string"&&(e="?");for(s in i)if(k5.call(i,s)){if(r=i[s],!r&&(r===null||r===U5||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(I5,"querystringify");xp.stringify=I5;xp.parse=D5});var Lb=ve((iL,Ib)=>{"use strict";var Tb=xb(),tc=Cb(),L5=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Rb=/[\n\r\t]/g,N5=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,kb=/:\d+$/,M5=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,B5=/^[a-zA-Z]:/;function Op(i){return(i||"").toString().replace(L5,"")}o(Op,"trimLeft");var Ep=[["#","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=N5.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=Op(i),i=i.replace(Rb,""),e=e||{};var t=M5.exec(i),r=t[1]?t[1].toLowerCase():"",s=!!t[2],n=!!t[3],a=0,u;return s?n?(u=t[2]+t[3]+t[4],a=t[2].length+t[3].length):(u=t[2]+t[4],a=t[2].length):n?(u=t[3]+t[4],a=t[3].length):u=t[4],r==="file:"?a>=2&&(u=u.slice(2)):Zi(r)?u=t[4]:r?s&&(u=u.slice(2)):a>=2&&Zi(e.protocol)&&(u=t[4]),{protocol:r,slashes:s||Zi(r),slashesCount:a,rest:u}}o(Db,"extractProtocol");function j5(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(j5,"resolve");function er(i,e,t){if(i=Op(i),i=i.replace(Rb,""),!(this instanceof er))return new er(i,e,t);var r,s,n,a,u,l,h=Ep.slice(),d=typeof e,f=this,y=0;for(d!=="object"&&d!=="string"&&(t=e,e=null),t&&typeof t!="function"&&(t=tc.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||B5.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],l=a[1],n!==n?f[l]=i:typeof n=="string"?(u=n==="@"?i.lastIndexOf(n):i.indexOf(n),~u&&(typeof a[2]=="number"?(f[l]=i.slice(0,u),i=i.slice(u+a[2])):(f[l]=i.slice(u),i=i.slice(0,u)))):(u=n.exec(i))&&(f[l]=u[1],i=i.slice(0,u.index)),f[l]=f[l]||r&&a[3]&&e[l]||"",a[4]&&(f[l]=f[l].toLowerCase())}t&&(f.query=t(f.query)),r&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=j5(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&&(u=f.auth.indexOf(":"),~u?(f.username=f.auth.slice(0,u),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(u+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 z5(i,e,t){var r=this;switch(i){case"query":typeof e=="string"&&e.length&&(e=(t||tc.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<Ep.length;a++){var u=Ep[a];u[4]&&(r[u[1]]=r[u[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(z5,"set");function H5(i){(!i||typeof i!="function")&&(i=tc.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(H5,"toString");er.prototype={set:z5,toString:H5};er.extractProtocol=Db;er.location=Ub;er.trimLeft=Op;er.qs=tc;Ib.exports=er});var Gp=ve((fN,Wp)=>{typeof Wp<"u"&&(Wp.exports=vi);function vi(i){if(i)return nx(i)}o(vi,"Emitter");function nx(i){for(var e in vi.prototype)i[e]=vi.prototype[e];return i}o(nx,"mixin");vi.prototype.on=vi.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this};vi.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};vi.prototype.off=vi.prototype.removeListener=vi.prototype.removeAllListeners=vi.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};vi.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};vi.prototype.listeners=function(i){return this._callbacks=this._callbacks||{},this._callbacks["$"+i]||[]};vi.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,T){var k=Object.keys(D);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(D);T&&(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 T=1;T<arguments.length;T++){var k=arguments[T]!=null?arguments[T]:{};T%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,T){if(!(D instanceof T))throw new TypeError("Cannot call a class as a function")}o(t,"_classCallCheck");function r(D,T){for(var k=0;k<T.length;k++){var N=T[k];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(D,l(N.key),N)}}o(r,"_defineProperties");function s(D,T,k){return T&&r(D.prototype,T),k&&r(D,k),Object.defineProperty(D,"prototype",{writable:!1}),D}o(s,"_createClass");function n(D,T,k){return T=l(T),T in D?Object.defineProperty(D,T,{value:k,enumerable:!0,configurable:!0,writable:!0}):D[T]=k,D}o(n,"_defineProperty");function a(){return a=Object.assign?Object.assign.bind():function(D){for(var T=1;T<arguments.length;T++){var k=arguments[T];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 u(D,T){if(typeof D!="object"||D===null)return D;var k=D[Symbol.toPrimitive];if(k!==void 0){var N=k.call(D,T||"default");if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(D)}o(u,"_toPrimitive");function l(D){var T=u(D,"string");return typeof T=="symbol"?T:String(T)}o(l,"_toPropertyKey");var h={exports:{}};(function(D){typeof window>"u"||function(T){var k=T.HTMLCanvasElement&&T.HTMLCanvasElement.prototype,N=T.Blob&&function(){try{return!!new Blob}catch{return!1}}(),Y=N&&T.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),Q=T.BlobBuilder||T.WebKitBlobBuilder||T.MozBlobBuilder||T.MSBlobBuilder,Ce=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,ge=(N||Q)&&T.atob&&T.ArrayBuffer&&T.Uint8Array&&function(ue){var ce,Ue,Ne,kt,qe,oe,Ut,tt,rr;if(ce=ue.match(Ce),!ce)throw new Error("invalid data URI");for(Ue=ce[2]?ce[1]:"text/plain"+(ce[3]||";charset=US-ASCII"),Ne=!!ce[4],kt=ue.slice(ce[0].length),Ne?qe=atob(kt):qe=decodeURIComponent(kt),oe=new ArrayBuffer(qe.length),Ut=new Uint8Array(oe),tt=0;tt<qe.length;tt+=1)Ut[tt]=qe.charCodeAt(tt);return N?new Blob([Y?Ut:oe],{type:Ue}):(rr=new Q,rr.append(oe),rr.getBlob(Ue))};T.HTMLCanvasElement&&!k.toBlob&&(k.mozGetAsFile?k.toBlob=function(ue,ce,Ue){var Ne=this;setTimeout(function(){Ue&&k.toDataURL&&ge?ue(ge(Ne.toDataURL(ce,Ue))):ue(Ne.mozGetAsFile("blob",ce))})}:k.toDataURL&&ge&&(k.msToBlob?k.toBlob=function(ue,ce,Ue){var Ne=this;setTimeout(function(){(ce&&ce!=="image/png"||Ue)&&k.toDataURL&&ge?ue(ge(Ne.toDataURL(ce,Ue))):ue(Ne.msToBlob(ce))})}:k.toBlob=function(ue,ce,Ue){var Ne=this;setTimeout(function(){ue(ge(Ne.toDataURL(ce,Ue)))})})),D.exports?D.exports=ge:T.dataURLtoBlob=ge}(window)})(h);var d=h.exports,f=o(function(T){return typeof Blob>"u"?!1:T instanceof Blob||Object.prototype.toString.call(T)==="[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},b=typeof window<"u"&&typeof window.document<"u",S=b?window:{},A=o(function(T){return T>0&&T<1/0},"isPositiveNumber"),O=Array.prototype.slice;function P(D){return Array.from?Array.from(D):O.call(D)}o(P,"toArray");var R=/^image\/.+$/;function H(D){return R.test(D)}o(H,"isImageType");function X(D){var T=H(D)?D.substr(6):"";return T==="jpeg"&&(T="jpg"),".".concat(T)}o(X,"imageTypeToExtension");var K=String.fromCharCode;function V(D,T,k){var N="",Y;for(k+=T,Y=T;Y<k;Y+=1)N+=K(D.getUint8(Y));return N}o(V,"getStringFromCharCode");var W=S.btoa;function te(D,T){for(var k=[],N=8192,Y=new Uint8Array(D);Y.length>0;)k.push(K.apply(null,P(Y.subarray(0,N)))),Y=Y.subarray(N);return"data:".concat(T,";base64,").concat(W(k.join("")))}o(te,"arrayBufferToDataURL");function re(D){var T=new DataView(D),k;try{var N,Y,Q;if(T.getUint8(0)===255&&T.getUint8(1)===216)for(var Ce=T.byteLength,ge=2;ge+1<Ce;){if(T.getUint8(ge)===255&&T.getUint8(ge+1)===225){Y=ge;break}ge+=1}if(Y){var ue=Y+4,ce=Y+10;if(V(T,ue,4)==="Exif"){var Ue=T.getUint16(ce);if(N=Ue===18761,(N||Ue===19789)&&T.getUint16(ce+2,N)===42){var Ne=T.getUint32(ce+4,N);Ne>=8&&(Q=ce+Ne)}}}if(Q){var kt=T.getUint16(Q,N),qe,oe;for(oe=0;oe<kt;oe+=1)if(qe=Q+oe*12+2,T.getUint16(qe,N)===274){qe+=8,k=T.getUint16(qe,N),T.setUint16(qe,1,N);break}}}catch{k=1}return k}o(re,"resetAndGetOrientation");function Oe(D){var T=0,k=1,N=1;switch(D){case 2:k=-1;break;case 3:T=-180;break;case 4:N=-1;break;case 5:T=90,N=-1;break;case 6:T=90;break;case 7:T=90,k=-1;break;case 8:T=-90;break}return{rotate:T,scaleX:k,scaleY:N}}o(Oe,"parseOrientation");var Re=/\.\d*(?:0|9){12}\d*$/;function $e(D){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Re.test(D)?Math.round(D*T)/T:D}o($e,"normalizeDecimalNumber");function we(D){var T=D.aspectRatio,k=D.height,N=D.width,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",Q=A(N),Ce=A(k);if(Q&&Ce){var ge=k*T;(Y==="contain"||Y==="none")&&ge>N||Y==="cover"&&ge<N?k=N/T:N=k*T}else Q?k=N/T:Ce&&(N=k*T);return{width:N,height:k}}o(we,"getAdjustedSizes");function _e(D){for(var T=P(new Uint8Array(D)),k=T.length,N=[],Y=0;Y+3<k;){var Q=T[Y],Ce=T[Y+1];if(Q===255&&Ce===218)break;if(Q===255&&Ce===216)Y+=2;else{var ge=T[Y+2]*256+T[Y+3],ue=Y+ge+2,ce=T.slice(Y,ue);N.push(ce),Y=ue}}return N.reduce(function(Ue,Ne){return Ne[0]===255&&Ne[1]===225?Ue.concat(Ne):Ue},[])}o(_e,"getExif");function Le(D,T){var k=P(new Uint8Array(D));if(k[2]!==255||k[3]!==224)return D;var N=k[4]*256+k[5],Y=[255,216].concat(T,k.slice(4+N));return new Uint8Array(Y)}o(Le,"insertExif");var C=S.ArrayBuffer,_=S.FileReader,E=S.URL||S.webkitURL,L=/\.\w+$/,z=S.Compressor,B=function(){function D(T,k){t(this,D),this.file=T,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(!H(Q)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!E||!_){this.fail(new Error("The current browser does not support image compression."));return}C||(Y.checkOrientation=!1,Y.retainExif=!1);var Ce=Q==="image/jpeg",ge=Ce&&Y.checkOrientation,ue=Ce&&Y.retainExif;if(E&&!ge&&!ue)this.load({url:E.createObjectURL(N)});else{var ce=new _;this.reader=ce,ce.onload=function(Ue){var Ne=Ue.target,kt=Ne.result,qe={},oe=1;ge&&(oe=re(kt),oe>1&&a(qe,Oe(oe))),ue&&(k.exif=_e(kt)),ge||ue?!E||oe>1?qe.url=te(kt,Q):qe.url=E.createObjectURL(N):qe.url=kt,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,Ce=k.rotate,ge=Ce===void 0?0:Ce,ue=k.scaleX,ce=ue===void 0?1:ue,Ue=k.scaleY,Ne=Ue===void 0?1:Ue,kt=this.file,qe=this.image,oe=this.options,Ut=document.createElement("canvas"),tt=Ut.getContext("2d"),rr=Math.abs(ge)%180===90,hs=(oe.resize==="contain"||oe.resize==="cover")&&A(oe.width)&&A(oe.height),Qr=Math.max(oe.maxWidth,0)||1/0,ds=Math.max(oe.maxHeight,0)||1/0,ps=Math.max(oe.minWidth,0)||0,fs=Math.max(oe.minHeight,0)||0,Jr=Y/Q,ot=oe.width,mt=oe.height;if(rr){var Il=[ds,Qr];Qr=Il[0],ds=Il[1];var he=[fs,ps];ps=he[0],fs=he[1];var fn=[mt,ot];ot=fn[0],mt=fn[1]}hs&&(Jr=ot/mt);var ko=we({aspectRatio:Jr,width:Qr,height:ds},"contain");Qr=ko.width,ds=ko.height;var qi=we({aspectRatio:Jr,width:ps,height:fs},"cover");if(ps=qi.width,fs=qi.height,hs){var Ll=we({aspectRatio:Jr,width:ot,height:mt},oe.resize);ot=Ll.width,mt=Ll.height}else{var sr=we({aspectRatio:Jr,width:ot,height:mt}),St=sr.width;ot=St===void 0?Y:St;var Nl=sr.height;mt=Nl===void 0?Q:Nl}ot=Math.floor($e(Math.min(Math.max(ot,ps),Qr))),mt=Math.floor($e(Math.min(Math.max(mt,fs),ds)));var Ml=-ot/2,Ve=-mt/2,Ae=ot,gc=mt,Vi=[];if(hs){var Bl=0,Ti=0,mn=Y,We=Q,ii=we({aspectRatio:Jr,width:Y,height:Q},{contain:"cover",cover:"contain"}[oe.resize]);mn=ii.width,We=ii.height,Bl=(Y-mn)/2,Ti=(Q-We)/2,Vi.push(Bl,Ti,mn,We)}if(Vi.push(Ml,Ve,Ae,gc),rr){var or=[mt,ot];ot=or[0],mt=or[1]}Ut.width=ot,Ut.height=mt,H(oe.mimeType)||(oe.mimeType=kt.type);var jl="transparent";kt.size>oe.convertSize&&oe.convertTypes.indexOf(oe.mimeType)>=0&&(oe.mimeType="image/jpeg");var Uo=oe.mimeType==="image/jpeg";if(Uo&&(jl="#fff"),tt.fillStyle=jl,tt.fillRect(0,0,ot,mt),oe.beforeDraw&&oe.beforeDraw.call(this,tt,Ut),!this.aborted&&(tt.save(),tt.translate(ot/2,mt/2),tt.rotate(ge*Math.PI/180),tt.scale(ce,Ne),tt.drawImage.apply(tt,[qe].concat(Vi)),tt.restore(),oe.drew&&oe.drew.call(this,tt,Ut),!this.aborted)){var Do=o(function(ms){if(!N.aborted){var gn=o(function(Si){return N.done({naturalWidth:Y,naturalHeight:Q,result:Si})},"done");if(ms&&Uo&&oe.retainExif&&N.exif&&N.exif.length>0){var yn=o(function(Si){return gn(d(te(Le(Si,N.exif),oe.mimeType)))},"next");if(ms.arrayBuffer)ms.arrayBuffer().then(yn).catch(function(){N.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var gt=new _;N.reader=gt,gt.onload=function(Dt){var Si=Dt.target;yn(Si.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(ms)}}else gn(ms)}},"callback");Ut.toBlob?Ut.toBlob(Do,oe.mimeType,oe.quality):Do(d(Ut.toDataURL(oe.mimeType,oe.quality)))}},"draw")},{key:"done",value:o(function(k){var N=k.naturalWidth,Y=k.naturalHeight,Q=k.result,Ce=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>Ce.size&&ue.mimeType===Ce.type&&!(ue.width>N||ue.height>Y||ue.minWidth>N||ue.minHeight>Y||ue.maxWidth<N||ue.maxHeight<Y))Q=Ce;else{var ce=new Date;Q.lastModified=ce.getTime(),Q.lastModifiedDate=ce,Q.name=Ce.name,Q.name&&Q.type!==Ce.type&&(Q.name=Q.name.replace(L,X(Q.type)))}else Q=Ce;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 kf={};ql(kf,{Audio:()=>Ys,AwsS3:()=>Jo,AwsS3Multipart:()=>ls,BasePlugin:()=>Ee,Box:()=>Rr,Compressor:()=>Dl,Core:()=>yE,Dashboard:()=>$s,DefaultStore:()=>Yl,DragDrop:()=>qs,DropTarget:()=>Xo,Dropbox:()=>kr,Facebook:()=>Ur,FileInput:()=>Vs,Form:()=>hn,GoldenRetriever:()=>dn,GoogleDrive:()=>Dr,ImageEditor:()=>Ws,Informer:()=>xr,Instagram:()=>Ir,OneDrive:()=>Lr,ProgressBar:()=>Gs,ReduxDevTools:()=>pn,ReduxStore:()=>Kg,RemoteSources:()=>Yo,ScreenCapture:()=>Js,StatusBar:()=>Fr,ThumbnailGenerator:()=>ss,Transloadit:()=>$i,Tus:()=>Gr,UIPlugin:()=>ae,Unsplash:()=>Nr,Uppy:()=>Uc,Url:()=>Oi,Webcam:()=>Zs,XHRUpload:()=>un,Zoom:()=>Mr,debugLogger:()=>Pn,locales:()=>bE,server:()=>Kc,views:()=>vE});function Vl(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Vl,"_classPrivateFieldLooseBase");var x1=0;function $f(i){return"__private_"+x1+++"_"+i}o($f,"_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,u)=>{n!==""&&r.push(n),a<u.length-1&&r.push(t)})),r}o(E1,"insertReplacement");function Hf(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(Hf,"interpolate");var O1=o(i=>{throw new Error(`missing string: ${i}`)},"defaultOnMissingKey"),bn=$f("onMissingKey"),wn=$f("apply"),bs=class{static{o(this,"Translator")}constructor(e,t){let{onMissingKey:r=O1}=t===void 0?{}:t;Object.defineProperty(this,wn,{value:C1}),Object.defineProperty(this,bn,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(Vl(this,wn)[wn],this):Vl(this,wn)[wn](e),Vl(this,bn)[bn]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&(Vl(this,bn)[bn](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){let n=this.locale.pluralize(t.smart_count);return Hf(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 Hf(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 Mm=be(wc(),1);var A1="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Yt=o((i=21)=>{let e="",t=i;for(;t--;)e+=A1[Math.random()*64|0];return e},"nanoid");var Bm=be(Gl(),1);function Kl(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Kl,"_classPrivateFieldLooseBase");var _w=0;function Pm(i){return"__private_"+_w+++"_"+i}o(Pm,"_classPrivateFieldLooseKey");var Pw={version:"3.2.2"},ws=Pm("callbacks"),xc=Pm("publish"),Xl=class{static{o(this,"DefaultStore")}constructor(){Object.defineProperty(this,xc,{value:Fw}),this.state={},Object.defineProperty(this,ws,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t={...this.state},r={...this.state,...e};this.state=r,Kl(this,xc)[xc](t,r,e)}subscribe(e){return Kl(this,ws)[ws].add(e),()=>{Kl(this,ws)[ws].delete(e)}}};function Fw(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];Kl(this,ws)[ws].forEach(r=>{r(...e)})}o(Fw,"_publish2");Xl.VERSION=Pw.version;var Yl=Xl;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 _n={__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 Ss(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 _n?_n[t]:"application/octet-stream"}o(Ss,"getFileType");function xw(i){return i.charCodeAt(0).toString(32)}o(xw,"encodeCharacter");function Fm(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${xw(t)}`,"/"))+e}o(Fm,"encodeFilename");function xm(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${Fm(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${Fm(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 Ql(i,e){if(Ew(i))return i.id;let t=Ss(i);return xm({...i,type:t},e)}o(Ql,"getSafeFileId");function Ec(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(Ec,"supportsUploadProgress");function Oc(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}o(Oc,"getFileName");function Cc(i){return i<10?`0${i}`:i.toString()}o(Cc,"pad");function Lo(){let i=new Date,e=Cc(i.getHours()),t=Cc(i.getMinutes()),r=Cc(i.getSeconds());return`${e}:${t}:${r}`}o(Lo,"getTimeStamp");var Em={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] [${Lo()}]`,...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] [${Lo()}]`,...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] [${Lo()}]`,...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] [${Lo()}]`,...e)}};var Jl=be(Fn(),1),Um=be(km(),1);var Dm={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},Qt=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)}},Zl=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 Qt(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){let n=e.reduce((a,u)=>{var l;return a+((l=u.size)!=null?l:0)},0);for(let a of t)if(a.size!=null&&(n+=a.size,n>r))throw new Qt(this.getI18n()("exceedsSize",{size:(0,Jl.default)(r),file:a.name}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(a=>a.includes("/")?e.type?(0,Um.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=s.join(", ");throw new Qt(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new Qt(this.getI18n()("exceedsSize",{size:(0,Jl.default)(t),file:e.name}),{file:e});if(r&&e.size!=null&&e.size<r)throw new Qt(this.getI18n()("inferiorSize",{size:(0,Jl.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 Qt(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){let t=new Qt(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 Im={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"},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"}};var Lm,Nm;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.11.3"},eu={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},_t=Xe("plugins"),si=Xe("restricter"),xn=Xe("storeUnsubscribe"),lr=Xe("emitter"),_s=Xe("preProcessors"),Ps=Xe("uploaders"),hr=Xe("postProcessors"),oi=Xe("informAndEmit"),Tn=Xe("checkRequiredMetaFieldsOnFile"),Ac=Xe("checkRequiredMetaFields"),En=Xe("assertNewUploadAllowed"),kc=Xe("transformFile"),On=Xe("startIfAutoProceed"),Cn=Xe("checkAndUpdateFileState"),Tc=Xe("addListeners"),Ri=Xe("updateOnlineStatus"),An=Xe("requestClientById"),ur=Xe("createUpload"),Rc=Xe("getUpload"),Fs=Xe("removeUpload"),cr=Xe("runUpload");Lm=Symbol.for("uppy test: getPlugins");Nm=Symbol.for("uppy test: createUpload");var tu=class i{static{o(this,"Uppy")}constructor(e){Object.defineProperty(this,cr,{value:Hw}),Object.defineProperty(this,Fs,{value:zw}),Object.defineProperty(this,Rc,{value:jw}),Object.defineProperty(this,ur,{value:Bw}),Object.defineProperty(this,Tc,{value:Mw}),Object.defineProperty(this,Cn,{value:Nw}),Object.defineProperty(this,On,{value:Lw}),Object.defineProperty(this,kc,{value:Iw}),Object.defineProperty(this,En,{value:Dw}),Object.defineProperty(this,Ac,{value:Uw}),Object.defineProperty(this,Tn,{value:kw}),Object.defineProperty(this,oi,{value:Rw}),Object.defineProperty(this,_t,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,si,{writable:!0,value:void 0}),Object.defineProperty(this,xn,{writable:!0,value:void 0}),Object.defineProperty(this,lr,{writable:!0,value:(0,Mm.default)()}),Object.defineProperty(this,_s,{writable:!0,value:new Set}),Object.defineProperty(this,Ps,{writable:!0,value:new Set}),Object.defineProperty(this,hr,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,this.calculateProgress=(0,Bm.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 u=Number.isFinite(n.bytesTotal)&&n.bytesTotal>0;this.setFileState(s.id,{progress:{...a.progress,bytesUploaded:n.bytesUploaded,bytesTotal:n.bytesTotal,percentage:u?Math.round(n.bytesUploaded/n.bytesTotal*100):0}}),this.calculateTotalProgress()},500,{leading:!0,trailing:!0}),Object.defineProperty(this,Ri,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,An,{writable:!0,value:new Map}),this.defaultLocale=Im;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Dm,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new Yl,logger:Em,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({...eu,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Ec(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),J(this,si)[si]=new Zl(()=>this.opts,()=>this.i18n),J(this,xn)[xn]=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,Tc)[Tc]()}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 bs([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,...eu}),this.emit("reset-progress")}clearUploadedFiles(){this.setState({...eu,files:{}})}addPreProcessor(e){J(this,_s)[_s].add(e)}removePreProcessor(e){return J(this,_s)[_s].delete(e)}addPostProcessor(e){J(this,hr)[hr].add(e)}removePostProcessor(e){return J(this,hr)[hr].delete(e)}addUploader(e){J(this,Ps)[Ps].add(e)}removeUploader(e){return J(this,Ps)[Ps].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=[],u=[],l=[],h=[],d=[],f=[],y=[],b=[];for(let S of s){let{progress:A}=S;!A.uploadComplete&&A.uploadStarted&&(n.push(S),S.isPaused||y.push(S)),A.uploadStarted||a.push(S),(A.uploadStarted||A.preprocess||A.postprocess)&&u.push(S),A.uploadStarted&&l.push(S),S.isPaused&&h.push(S),A.uploadComplete&&d.push(S),S.error&&f.push(S),(A.preprocess||A.postprocess)&&b.push(S)}return{newFiles:a,startedFiles:u,uploadStartedFiles:l,pausedFiles:h,completeFiles:d,erroredFiles:f,inProgressFiles:n,inProgressNotPausedFiles:y,processingFiles:b,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===s.length&&b.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,si)[si].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(u=>u.isRestriction);if(J(this,oi)[oi](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(u=>u.isRestriction);J(this,oi)[oi](n);let a=s.filter(u=>!u.isRestriction);if(a.length>0){let u=`Multiple errors occurred while adding files:
`;if(a.forEach(l=>{u+=`
* ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:u},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,u);{let l=new Error(u);throw l.errors=a,l}}this.setState({files:t}),r.forEach(u=>{this.emit("file-added",u)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(u=>{this.log(`Added file: ${u.name}
id: ${u.id}
type: ${u.type}`)}),r.length>0&&J(this,On)[On]()}removeFiles(e,t){let{files:r,currentUploads:s}=this.getState(),n={...r},a={...s},u=Object.create(null);e.forEach(f=>{r[f]&&(u[f]=r[f],delete n[f])});function l(f){return u[f]===void 0}o(l,"fileIsNotRemoved"),Object.keys(a).forEach(f=>{let y=s[f].fileIDs.filter(l);if(y.length===0){delete a[f];return}let{capabilities:b}=this.getState();if(y.length!==s[f].fileIDs.length&&!b.individualCancellation)throw new Error("individualCancellation is disabled");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(u);d.forEach(f=>{this.emit("file-removed",u[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(eu)}}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,b)=>y+b.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 u=0;r.forEach(h=>{u+=h.progress.bytesUploaded}),s.forEach(h=>{u+=a*(h.progress.percentage||0)/100});let l=n===0?0:Math.round(u/n*100);l>100&&(l=100),this.setState({totalProgress:l}),this.emit("progress",l)}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,_t)[_t]?J(this,_t)[_t][r.type].push(r):J(this,_t)[_t][r.type]=[r],r.install(),this.emit("plugin-added",r),this}getPlugin(e){for(let t of Object.values(J(this,_t)[_t])){let r=t.find(s=>s.id===e);if(r!=null)return r}}[Lm](e){return J(this,_t)[_t][e]}iteratePlugins(e){Object.values(J(this,_t)[_t]).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,_t)[_t][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,xn)[xn](),this.iteratePlugins(r=>{this.removePlugin(r)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",J(this,Ri)[Ri]),window.removeEventListener("offline",J(this,Ri)[Ri]))}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,Fs)[Fs](e),Promise.reject(new Error("Nonexistent upload")))}[Nm](){return J(this,ur)[ur](...arguments)}addResultData(e,t){if(!J(this,Rc)[Rc](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,_t)[_t].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,si)[si].validateMinNumberOfFiles(t)).catch(s=>{throw J(this,oi)[oi]([s]),s}).then(()=>{if(!J(this,Ac)[Ac](t))throw new Qt(this.i18n("missingRequiredMetaField"))}).catch(s=>{throw s}).then(()=>{let{currentUploads:s}=this.getState(),n=Object.values(s).flatMap(l=>l.fileIDs),a=[];Object.keys(t).forEach(l=>{let h=this.getFile(l);!h.progress.uploadStarted&&n.indexOf(l)===-1&&a.push(h.id)});let u=J(this,ur)[ur](a);return J(this,cr)[cr](u)}).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:u=""}=n;this.info({message:a,details:u},"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,si)[si].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 Qt(this.i18n("noMoreFilesAllowed"),{file:i});throw J(this,oi)[oi]([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=Ss(e),r=Oc(t,e),s=Gi(r).extension,n=Ql(e,this.getID()),a=e.meta||{};a.name=r,a.type=t;let u=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:u,uploadComplete:!1,uploadStarted:null},size:u,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 u=J(this,kc)[kc](a),l=(n=e[u.id])==null?void 0:n.isGhost;l&&(u={...e[u.id],isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${u.name}, ${u.id}`));let h=this.opts.onBeforeFileAdded(u,t);if(!h&&this.checkIfFileAlreadyExists(u.id))throw new Qt(this.i18n("noDuplicates",{fileName:u.name}),{file:a});if(h===!1&&!l)throw new Qt("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof h=="object"&&h!==null&&(u=h),J(this,si)[si].validateSingleFile(u),t[u.id]=u,r.push(u)}catch(u){s.push(u)}try{J(this,si)[si].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 u=new Error(this.i18n("failedToUpload",{file:(a=r?.name)!=null?a:""}));u.isUserFacing=!0,u.details=s.message,s.details&&(u.details+=` ${s.details}`),J(this,oi)[oi]([u])}else J(this,oi)[oi]([s])});let e=null;this.on("upload-stalled",(r,s)=>{let{message:n}=r,a=s.map(u=>u.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 u=a!=null&&this.getFile(a.id);return u||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),u}),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,Ri)[Ri]),window.addEventListener("offline",J(this,Ri)[Ri]),setTimeout(J(this,Ri)[Ri],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=Yt();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,_s)[_s],...J(this,Ps)[Ps],...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:u}=t;await a(u,i),t=e()}}catch(n){throw J(this,Fs)[Fs](i),n}if(t){t.fileIDs.forEach(l=>{let h=this.getFile(l);h&&h.progress.postprocess&&this.emit("postprocess-complete",h)});let n=t.fileIDs.map(l=>this.getFile(l)),a=n.filter(l=>!l.error),u=n.filter(l=>l.error);this.addResultData(i,{successful:a,failed:u,uploadID:i}),t=e()}let s;return t&&(s=t.result,this.emit("complete",s),J(this,Fs)[Fs](i)),s==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),s}o(Hw,"_runUpload2");tu.VERSION=Tw.version;var Uc=tu;var Un,le,Vm,$w,Rn,jm,qw,iu={},Wm=[],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 Gm(i){var e=i.parentNode;e&&e.removeChild(i)}o(Gm,"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??++Vm};return s==null&&le.vnode!=null&&le.vnode(n),n}o(kn,"v");function Km(){return{current:null}}o(Km,"y");function vt(i){return i.children}o(vt,"p");function Te(i,e){this.props=i,this.context=e}o(Te,"d");function No(i,e){if(e==null)return i.__?No(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"?No(i):null}o(No,"_");function Xm(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 Xm(i)}}o(Xm,"k");function zm(i){(!i.__d&&(i.__d=!0)&&Rn.push(i)&&!ru.__r++||jm!==le.debounceRendering)&&((jm=le.debounceRendering)||setTimeout)(ru)}o(zm,"b");function ru(){for(var i;ru.__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,u;e.__d&&(a=(n=(t=e).__v).__e,(u=t.__P)&&(r=[],(s=dr({},n)).__v=n.__v+1,Dc(u,n,s,t.__n,u.ownerSVGElement!==void 0,n.__h!=null?[a]:null,r,a??No(n),n.__h),Zm(r,n),n.__e!=a&&Xm(n)))})}o(ru,"g");function Ym(i,e,t,r,s,n,a,u,l,h){var d,f,y,b,S,A,O,P=r&&r.__k||Wm,R=P.length;for(t.__k=[],d=0;d<e.length;d++)if((b=t.__k[d]=(b=e[d])==null||typeof b=="boolean"?null:typeof b=="string"||typeof b=="number"||typeof b=="bigint"?kn(null,b,null,null,b):Array.isArray(b)?kn(vt,{children:b},null,null,null):b.__b>0?kn(b.type,b.props,b.key,null,b.__v):b)!=null){if(b.__=t,b.__b=t.__b+1,(y=P[d])===null||y&&b.key==y.key&&b.type===y.type)P[d]=void 0;else for(f=0;f<R;f++){if((y=P[f])&&b.key==y.key&&b.type===y.type){P[f]=void 0;break}y=null}Dc(i,b,y=y||iu,s,n,a,u,l,h),S=b.__e,(f=b.ref)&&y.ref!=f&&(O||(O=[]),y.ref&&O.push(y.ref,null,b),O.push(f,b.__c||S,b)),S!=null?(A==null&&(A=S),typeof b.type=="function"&&b.__k===y.__k?b.__d=l=Qm(b,l,i):l=Jm(i,b,y,P,S,l),typeof t.type=="function"&&(t.__d=l)):l&&y.__e==l&&l.parentNode!=i&&(l=No(y))}for(t.__e=A,d=R;d--;)P[d]!=null&&(typeof t.type=="function"&&P[d].__e!=null&&P[d].__e==t.__d&&(t.__d=No(r,d+1)),tg(P[d],P[d]));if(O)for(d=0;d<O.length;d++)eg(O[d],O[++d],O[++d])}o(Ym,"w");function Qm(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"?Qm(r,e,t):Jm(t,r,r,s,r.__e,e));return e}o(Qm,"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 Jm(i,e,t,r,s,n){var a,u,l;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(u=n,l=0;(u=u.nextSibling)&&l<r.length;l+=2)if(u==s)break e;i.insertBefore(s,n),a=n}return a!==void 0?a:s.nextSibling}o(Jm,"A");function Ww(i,e,t,r,s){var n;for(n in t)n==="children"||n==="key"||n in e||su(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]||su(i,n,e[n],t[n],r)}o(Ww,"C");function Hm(i,e,t){e[0]==="-"?i.setProperty(e,t):i[e]=t==null?"":typeof t!="number"||Vw.test(e)?t:t+"px"}o(Hm,"$");function su(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||Hm(i.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||Hm(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:$m,n):i.removeEventListener(e,n?qm:$m,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(su,"H");function $m(i){this.l[i.type+!1](le.event?le.event(i):i)}o($m,"I");function qm(i){this.l[i.type+!0](le.event?le.event(i):i)}o(qm,"T");function Dc(i,e,t,r,s,n,a,u,l){var h,d,f,y,b,S,A,O,P,R,H,X,K,V=e.type;if(e.constructor!==void 0)return null;t.__h!=null&&(l=t.__h,u=e.__e=t.__e,e.__h=null,n=[u]),(h=le.__b)&&h(e);try{e:if(typeof V=="function"){if(O=e.props,P=(h=V.contextType)&&r[h.__c],R=h?P?P.props.value:h.__:r,t.__c?A=(d=e.__c=t.__c).__=d.__E:("prototype"in V&&V.prototype.render?e.__c=d=new V(O,R):(e.__c=d=new Te(O,R),d.constructor=V,d.render=Kw),P&&P.sub(d),d.props=O,d.state||(d.state={}),d.context=R,d.__n=r,f=d.__d=!0,d.__h=[]),d.__s==null&&(d.__s=d.state),V.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=dr({},d.__s)),dr(d.__s,V.getDerivedStateFromProps(O,d.__s))),y=d.props,b=d.state,f)V.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(V.getDerivedStateFromProps==null&&O!==y&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(O,R),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(O,d.__s,R)===!1||e.__v===t.__v){d.props=O,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(W){W&&(W.__=e)}),d.__h.length&&a.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(O,d.__s,R),d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(y,b,S)})}if(d.context=R,d.props=O,d.__v=e,d.__P=i,H=le.__r,X=0,"prototype"in V&&V.prototype.render)d.state=d.__s,d.__d=!1,H&&H(e),h=d.render(d.props,d.state,d.context);else do d.__d=!1,H&&H(e),h=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++X<25);d.state=d.__s,d.getChildContext!=null&&(r=dr(dr({},r),d.getChildContext())),f||d.getSnapshotBeforeUpdate==null||(S=d.getSnapshotBeforeUpdate(y,b)),K=h!=null&&h.type===vt&&h.key==null?h.props.children:h,Ym(i,Array.isArray(K)?K:[K],e,t,r,s,n,a,u,l),d.base=e.__e,e.__h=null,d.__h.length&&a.push(d),A&&(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,l);(h=le.diffed)&&h(e)}catch(W){e.__v=null,(l||n!=null)&&(e.__e=u,e.__h=!!l,n[n.indexOf(u)]=null),le.__e(W,e,t)}}o(Dc,"j");function Zm(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(Zm,"z");function Gw(i,e,t,r,s,n,a,u){var l,h,d,f=t.props,y=e.props,b=e.type,S=0;if(b==="svg"&&(s=!0),n!=null){for(;S<n.length;S++)if((l=n[S])&&"setAttribute"in l==!!b&&(b?l.localName===b:l.nodeType===3)){i=l,n[S]=null;break}}if(i==null){if(b===null)return document.createTextNode(y);i=s?document.createElementNS("http://www.w3.org/2000/svg",b):document.createElement(b,y.is&&y),n=null,u=!1}if(b===null)f===y||u&&i.data===y||(i.data=y);else{if(n=n&&Un.call(i.childNodes),h=(f=t.props||iu).dangerouslySetInnerHTML,d=y.dangerouslySetInnerHTML,!u){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,u),d)e.__k=[];else if(S=e.props.children,Ym(i,Array.isArray(S)?S:[S],e,t,r,s&&b!=="foreignObject",n,a,n?n[0]:t.__k&&No(t,0),u),n!=null)for(S=n.length;S--;)n[S]!=null&&Gm(n[S]);u||("value"in y&&(S=y.value)!==void 0&&(S!==i.value||b==="progress"&&!S||b==="option"&&S!==f.value)&&su(i,"value",S,f.value,!1),"checked"in y&&(S=y.checked)!==void 0&&S!==i.checked&&su(i,"checked",S,f.checked,!1))}return i}o(Gw,"L");function eg(i,e,t){try{typeof i=="function"?i(e):i.current=e}catch(r){le.__e(r,t)}}o(eg,"M");function tg(i,e,t){var r,s;if(le.unmount&&le.unmount(i),(r=i.ref)&&(r.current&&r.current!==i.__e||eg(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]&&tg(r[s],e,typeof i.type!="function");t||i.__e==null||Gm(i.__e),i.__e=i.__d=void 0}o(tg,"N");function Kw(i,e,t){return this.constructor(i,t)}o(Kw,"O");function Ic(i,e,t){var r,s,n;le.__&&le.__(i,e),s=(r=typeof t=="function")?null:t&&t.__k||e.__k,n=[],Dc(e,i=(!r&&t||e).__k=c(vt,null,[i]),s||iu,iu,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),Zm(n,i)}o(Ic,"P");function ou(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(ou,"q");Un=Wm.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(u){i=u}throw i}},Vm=0,$w=o(function(i){return i!=null&&i.constructor===void 0},"i"),Te.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),zm(this))},Te.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),zm(this))},Te.prototype.render=vt,Rn=[],ru.__r=0,qw=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 nu=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 au=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 bs([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 ig(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(ig,"_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"),Lc=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=nu(e);if(s){this.isTargetDOMEl=!0;let u=document.createElement("div");return u.classList.add("uppy-Root"),ig(this,In)[In]=Zw(l=>{this.uppy.getPlugin(this.id)&&(Ic(this.render(l),u),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),Ic(this.render(this.uppy.getState()),u),this.el=u,s.appendChild(u),u.dir=this.opts.direction||au(u)||"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=ig(this,In))[In])==null||t.call(r,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},ae=Lc;var Kc={};ql(Kc,{Provider:()=>lt,RequestClient:()=>Lt,SearchProvider:()=>Os,Socket:()=>Bn,getAllowedHosts:()=>ut,tokenStorage:()=>ct});var Nc=class extends Error{static{o(this,"UserFacingApiError")}constructor(){super(...arguments),this.name="UserFacingApiError"}},rg=Nc;var cg=be(lg(),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 Mc(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(Mc,"isNetworkError");var Mo=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}},ug=o((i,e,t)=>{let r=t.retries-(e-1);return i.attemptNumber=e,i.retriesLeft=r,i},"decorateErrorWithCounts");async function lu(i,e){return new Promise((t,r)=>{e={onFailedAttempt(){},retries:10,...e};let s=cg.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 u=>{try{let l=await i(u);a(),t(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof Mo)throw l.originalError;if(l instanceof TypeError&&!Mc(l))throw l;if(await e.onFailedAttempt(ug(l,u,e)),!s.retry(l))throw s.mainError()}catch(h){ug(h,u,e),a(),r(h)}}})})}o(lu,"pRetry");var Bc=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}},It=Bc;function Es(){return fetch(...arguments).catch(i=>{throw i.name==="AbortError"?i:new It(i)})}o(Es,"fetchWithNetworkError");function ni(i,e){return Object.prototype.hasOwnProperty.call(i,e)}o(ni,"has");var jc=class extends Error{static{o(this,"ErrorWithCause")}constructor(e,t){super(e),this.cause=t?.cause,this.cause&&ni(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}},pr=jc;var hg=be(Gl(),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 dg=(0,hg.default)(sS,300,{leading:!0,trailing:!0});function zc(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(zc,"getSocketHost");var Hc=class extends Error{static{o(this,"AuthError")}constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}},pg=Hc;var fg;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 uu(i){return"__private_"+oS+++"_"+i}o(uu,"_classPrivateFieldLooseKey");var nS={version:"3.8.1"};function aS(i){return i.replace(/\/$/,"")}o(aS,"stripSlash");var mg=10,lS=5*60*1e3,Vc=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===Vc)throw new pg;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 rg(t.message):new qc({statusCode:i.status,message:e})}o(uS,"handleJSONResponse");var mr=uu("companionHeaders"),Ln=uu("getUrl"),$c=uu("requestSocketToken"),Nn=uu("awaitRemoteFileUpload");fg=Symbol.for("uppy test: getCompanionHeaders");var Lt=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,$c,{writable:!0,value:async r=>{var s;let{file:n,postBody:a,signal:u}=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:u})).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}[fg](){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 u=await this.headers(!s),l=await Es(fr(this,Ln)[Ln](t),{method:r,signal:a,headers:u,credentials:this.opts.companionCookiesRule||"same-origin",body:s?JSON.stringify(s):null});return n||this.onReceiveResponse(l),await uS(l)}catch(u){throw u.isAuthError||u.name==="UserFacingApiError"||u.name==="AbortError"?u:new pr(`Could not ${r} ${fr(this,Ln)[Ln](t)}`,{cause:u})}}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 lu(async()=>{var u;let l=(u=this.uppy.getFile(e.id))==null?void 0:u.serverToken;if(l!=null)return this.uppy.log(`Connecting to exiting websocket ${l}`),fr(this,Nn)[Nn]({file:e,queue:a(),signal:n});let d=await a().wrapPromiseFunction(async function(){try{return await fr(s,$c)[$c](...arguments)}catch(f){if(f.isAuthError)throw new Mo(f);if(f.cause==null)throw f;let y=f.cause,b=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"&&!b()?new Mo(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:mg,signal:n,onFailedAttempt:u=>this.uppy.log(`Retrying upload due to: ${u.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,u)=>{let l=e.serverToken,h=zc(e.remote.companionUrl),d,f,y,{isPaused:b}=e,S=o((W,te)=>{if(d==null||d.readyState!==d.OPEN){var re;this.uppy.log(`Cannot send "${W}" to socket ${e.id} because the socket state was ${String((re=d)==null?void 0:re.readyState)}`,"warning");return}d.send(JSON.stringify({action:W,payload:te??{}}))},"socketSend");function A(){n.resumableUploads&&S(b?"pause":"resume")}o(A,"sendState");let O=o(async()=>{f&&f.abort(),f=new AbortController;let W=o(re=>{var Oe;this.uppy.setFileState(e.id,{serverToken:null}),(Oe=f)==null||Oe.abort==null||Oe.abort(),u(re)},"onFatalError");function te(){clearTimeout(y),!b&&(y=setTimeout(()=>W(new Error("Timeout waiting for message from Companion socket")),lS))}o(te,"resetActivityTimeout");try{await t.wrapPromiseFunction(async()=>{await lu(o(async()=>new Promise((Oe,Re)=>{d=new WebSocket(`${h}/api/${l}`),te(),d.addEventListener("close",()=>{d=void 0,Re(new Error("Socket closed unexpectedly"))}),d.addEventListener("error",we=>{var _e;this.uppy.log(`Companion socket error ${JSON.stringify(we)}, closing socket`,"warning"),(_e=d)==null||_e.close()}),d.addEventListener("open",()=>{A()}),d.addEventListener("message",we=>{te();try{let{action:E,payload:L}=JSON.parse(we.data);switch(E){case"progress":{dg(this,L,this.uppy.getFile(e.id));break}case"success":{var _e,Le,C,_;let z=(_e=L.response)==null?void 0:_e.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:L.url,status:(Le=(C=L.response)==null?void 0:C.status)!=null?Le:200,body:z?JSON.parse(z):void 0}),(_=f)==null||_.abort==null||_.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){W(E)}});let $e=o(()=>{this.uppy.log(`Closing socket ${e.id}`,"info"),clearTimeout(y),d&&d.close(),d=void 0},"closeSocket");f.signal.addEventListener("abort",()=>{$e()})}),"reconnectWebsocket"),{retries:mg,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;W(re)}},"createWebsocket"),P=o(W=>{if(n.resumableUploads)if(b=W,d&&A(),W){var te;(te=f)==null||te.abort==null||te.abort()}else O()},"pause"),R=o(W=>{var te;n.individualCancellation&&W.id===e.id&&(S("cancel"),(te=f)==null||te.abort==null||te.abort(),this.uppy.log(`upload ${e.id} was removed`,"info"),a())},"onFileRemove"),H=o(W=>{var te;let{reason:re}=W;re==="user"&&S("cancel"),(te=f)==null||te.abort==null||te.abort(),this.uppy.log(`upload ${e.id} was canceled`,"info"),a()},"onCancelAll"),X=o((W,te)=>{W===e.id&&P(te)},"onFilePausedChange"),K=o(()=>P(!0),"onPauseAll"),V=o(()=>P(!1),"onResumeAll");this.uppy.on("file-removed",R),this.uppy.on("cancel-all",H),this.uppy.on("upload-pause",X),this.uppy.on("pause-all",K),this.uppy.on("resume-all",V),s=o(()=>{this.uppy.off("file-removed",R),this.uppy.off("cancel-all",H),this.uppy.off("upload-pause",X),this.uppy.off("pause-all",K),this.uppy.off("resume-all",V)},"removeEventHandlers"),r.addEventListener("abort",()=>{var W;(W=f)==null||W.abort()}),O()})}finally{s?.()}}o(hS,"_awaitRemoteFileUpload2");Lt.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 Wc(i){return"__private_"+dS+++"_"+i}o(Wc,"_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 gg(i){if(typeof i=="string")return new RegExp(`^${i}$`);if(i instanceof RegExp)return i}o(gg,"getRegex");function mS(i,e){return(Array.isArray(e)?e.map(gg):[gg(e)]).some(r=>r?.test(i)||r?.test(`${i}/`))}o(mS,"isOriginAllowed");var ki=Wc("refreshingTokenPromise"),Mn=Wc("getAuthToken"),Ui=Wc("getPlugin"),lt=class extends Lt{static{o(this,"Provider")}constructor(e,t){var r;super(e,t),Object.defineProperty(this,Ui,{value:yS}),Object.defineProperty(this,Mn,{value:gS}),Object.defineProperty(this,ki,{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,Ui)[Ui](),s=t.getPluginState().authenticated?e.status!==Vc:e.status<400;return t.setPluginState({authenticated:s}),e}async setAuthToken(e){return xi(this,Ui)[Ui]().storage.setItem(this.tokenKey,e)}async removeAuthToken(){return xi(this,Ui)[Ui]().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 u=this.authUrl({query:{uppyVersions:t},authFormData:r}),l=window.open(u,"_blank"),h,d=o(f=>{if(f.source!==l){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,Ui)[Ui]().opts;if(!mS(f.origin,y)){a(new Error(`rejecting event from ${f.origin} vs allowed pattern ${y}`));return}let b=typeof f.data=="string"?JSON.parse(f.data):f.data;if(b.error){let{uppy:S}=this,A=S.i18n("authAborted");S.info({message:A},"warning",5e3),a(new Error("auth aborted"));return}if(!b.token){a(new Error("did not receive token from auth window"));return}h(),n(this.setAuthToken(b.token))},"handleToken");h=o(()=>{l?.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,ki)[ki];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,ki)[ki]==null&&(xi(this,ki)[ki]=(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,ki)[ki]=void 0}})()),await xi(this,ki)[ki],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,Ui)[Ui]().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 Lt{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 ut(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(ut,"getAllowedHosts");var ct={};ql(ct,{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 bg=be(wc(),1);var yg,vg;function Ge(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Ge,"_classPrivateFieldLooseBase");var _S=0;function jn(i){return"__private_"+_S+++"_"+i}o(jn,"_classPrivateFieldLooseKey");var gr=jn("queued"),Cs=jn("emitter"),Di=jn("isOpen"),ht=jn("socket"),Gc=jn("handleMessage");yg=Symbol.for("uppy test: getSocket");vg=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,bg.default)()}),Object.defineProperty(this,Di,{writable:!0,value:!1}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,Gc,{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 Ge(this,Di)[Di]}[yg](){return Ge(this,ht)[ht]}[vg](){return Ge(this,gr)[gr]}open(){Ge(this,ht)[ht]==null&&(Ge(this,ht)[ht]=new WebSocket(this.opts.target),Ge(this,ht)[ht].onopen=()=>{for(Ge(this,Di)[Di]=!0;Ge(this,gr)[gr].length>0&&Ge(this,Di)[Di];){let e=Ge(this,gr)[gr].shift();this.send(e.action,e.payload)}},Ge(this,ht)[ht].onclose=()=>{Ge(this,Di)[Di]=!1,Ge(this,ht)[ht]=null},Ge(this,ht)[ht].onmessage=Ge(this,Gc)[Gc])}close(){var e;(e=Ge(this,ht)[ht])==null||e.close()}send(e,t){if(!Ge(this,Di)[Di]){Ge(this,gr)[gr].push({action:e,payload:t});return}Ge(this,ht)[ht].send(JSON.stringify({action:e,payload:t}))}on(e,t){Ge(this,Cs)[Cs].on(e,t)}emit(e,t){Ge(this,Cs)[Cs].emit(e,t)}once(e,t){Ge(this,Cs)[Cs].once(e,t)}};var bh={};ql(bh,{ProviderViews:()=>Qe,SearchProviderViews:()=>wr,defaultPickerIcon:()=>zo});var Yc=be(Sg(),1);var Hn=class extends Error{static{o(this,"TimeoutError")}constructor(e){super(e),this.name="TimeoutError"}},Qc=class extends Error{static{o(this,"AbortError")}constructor(e){super(),this.name="AbortError",this.message=e}},_g=o(i=>globalThis.DOMException===void 0?new Qc(i):new DOMException(i),"getDOMException"),Pg=o(i=>{let e=i.reason===void 0?_g("This operation was aborted."):i.reason;return e instanceof Error?e:_g(e)},"getAbortedReason");function Jc(i,e,t,r){let s,n=new Promise((a,u)=>{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:l}=r;l.aborted&&u(Pg(l)),l.addEventListener("abort",()=>{u(Pg(l))})}s=r.customTimers.setTimeout.call(void 0,()=>{if(typeof t=="function"){try{a(t())}catch(d){u(d)}return}let l=typeof t=="string"?t:`Promise timed out after ${e} milliseconds`,h=t instanceof Error?t:new Hn(l);typeof i.cancel=="function"&&i.cancel(),u(h)},e),(async()=>{try{a(await i)}catch(l){u(l)}finally{r.customTimers.clearTimeout.call(void 0,s)}})()});return n.clear=()=>{clearTimeout(s),s=void 0},n}o(Jc,"pTimeout");function Zc(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(Zc,"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,eh=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=Zc(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 Fg=eh;var Me=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)},Ye,qn,Vn,is,gu,Wn,hu,Ii,$n,ai,du,li,Gn,ts,pu,xg,Eg,Ag,Og,Cg,fu,th,ih,yu,Tg,mu,vu=class extends Error{static{o(this,"AbortError")}},rh=class extends Yc.default{static{o(this,"PQueue")}constructor(e){var t,r,s,n;if(super(),Ye.add(this),qn.set(this,void 0),Vn.set(this,void 0),is.set(this,0),gu.set(this,void 0),Wn.set(this,void 0),hu.set(this,0),Ii.set(this,void 0),$n.set(this,void 0),ai.set(this,void 0),du.set(this,void 0),li.set(this,0),Gn.set(this,void 0),ts.set(this,void 0),pu.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:Fg,...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})`);Me(this,qn,e.carryoverConcurrencyCount,"f"),Me(this,Vn,e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,"f"),Me(this,gu,e.intervalCap,"f"),Me(this,Wn,e.interval,"f"),Me(this,ai,new e.queueClass,"f"),Me(this,du,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,Me(this,pu,e.throwOnTimeout===!0,"f"),Me(this,ts,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})`);Me(this,Gn,e,"f"),ie(this,Ye,"m",yu).call(this)}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:ie(this,pu,"f"),...t},new Promise((r,s)=>{ie(this,ai,"f").enqueue(async()=>{var n,a,u;Me(this,li,(a=ie(this,li,"f"),a++,a),"f"),Me(this,is,(u=ie(this,is,"f"),u++,u),"f");try{if(!((n=t.signal)===null||n===void 0)&&n.aborted)throw new vu("The task was aborted.");let l=e({signal:t.signal});t.timeout&&(l=Jc(Promise.resolve(l),t.timeout)),t.signal&&(l=Promise.race([l,ie(this,Ye,"m",Tg).call(this,t.signal)]));let h=await l;r(h),this.emit("completed",h)}catch(l){if(l instanceof Hn&&!t.throwOnTimeout){r();return}s(l),this.emit("error",l)}finally{ie(this,Ye,"m",Ag).call(this)}},t),this.emit("add"),ie(this,Ye,"m",fu).call(this)})}async addAll(e,t){return Promise.all(e.map(async r=>this.add(r,t)))}start(){return ie(this,ts,"f")?(Me(this,ts,!1,"f"),ie(this,Ye,"m",yu).call(this),this):this}pause(){Me(this,ts,!0,"f")}clear(){Me(this,ai,new(ie(this,du,"f")),"f")}async onEmpty(){ie(this,ai,"f").size!==0&&await ie(this,Ye,"m",mu).call(this,"empty")}async onSizeLessThan(e){ie(this,ai,"f").size<e||await ie(this,Ye,"m",mu).call(this,"next",()=>ie(this,ai,"f").size<e)}async onIdle(){ie(this,li,"f")===0&&ie(this,ai,"f").size===0||await ie(this,Ye,"m",mu).call(this,"idle")}get size(){return ie(this,ai,"f").size}sizeBy(e){return ie(this,ai,"f").filter(e).length}get pending(){return ie(this,li,"f")}get isPaused(){return ie(this,ts,"f")}};qn=new WeakMap,Vn=new WeakMap,is=new WeakMap,gu=new WeakMap,Wn=new WeakMap,hu=new WeakMap,Ii=new WeakMap,$n=new WeakMap,ai=new WeakMap,du=new WeakMap,li=new WeakMap,Gn=new WeakMap,ts=new WeakMap,pu=new WeakMap,Ye=new WeakSet,xg=o(function(){return ie(this,Vn,"f")||ie(this,is,"f")<ie(this,gu,"f")},"_PQueue_doesIntervalAllowAnother_get"),Eg=o(function(){return ie(this,li,"f")<ie(this,Gn,"f")},"_PQueue_doesConcurrentAllowAnother_get"),Ag=o(function(){var e;Me(this,li,(e=ie(this,li,"f"),e--,e),"f"),ie(this,Ye,"m",fu).call(this),this.emit("next")},"_PQueue_next"),Og=o(function(){ie(this,Ye,"m",ih).call(this),ie(this,Ye,"m",th).call(this),Me(this,$n,void 0,"f")},"_PQueue_onResumeInterval"),Cg=o(function(){let e=Date.now();if(ie(this,Ii,"f")===void 0){let t=ie(this,hu,"f")-e;if(t<0)Me(this,is,ie(this,qn,"f")?ie(this,li,"f"):0,"f");else return ie(this,$n,"f")===void 0&&Me(this,$n,setTimeout(()=>{ie(this,Ye,"m",Og).call(this)},t),"f"),!0}return!1},"_PQueue_isIntervalPaused_get"),fu=o(function(){if(ie(this,ai,"f").size===0)return ie(this,Ii,"f")&&clearInterval(ie(this,Ii,"f")),Me(this,Ii,void 0,"f"),this.emit("empty"),ie(this,li,"f")===0&&this.emit("idle"),!1;if(!ie(this,ts,"f")){let e=!ie(this,Ye,"a",Cg);if(ie(this,Ye,"a",xg)&&ie(this,Ye,"a",Eg)){let t=ie(this,ai,"f").dequeue();return t?(this.emit("active"),t(),e&&ie(this,Ye,"m",th).call(this),!0):!1}}return!1},"_PQueue_tryToStartAnother"),th=o(function(){ie(this,Vn,"f")||ie(this,Ii,"f")!==void 0||(Me(this,Ii,setInterval(()=>{ie(this,Ye,"m",ih).call(this)},ie(this,Wn,"f")),"f"),Me(this,hu,Date.now()+ie(this,Wn,"f"),"f"))},"_PQueue_initializeIntervalIfNeeded"),ih=o(function(){ie(this,is,"f")===0&&ie(this,li,"f")===0&&ie(this,Ii,"f")&&(clearInterval(ie(this,Ii,"f")),Me(this,Ii,void 0,"f")),Me(this,is,ie(this,qn,"f")?ie(this,li,"f"):0,"f"),ie(this,Ye,"m",yu).call(this)},"_PQueue_onInterval"),yu=o(function(){for(;ie(this,Ye,"m",fu).call(this););},"_PQueue_processQueue"),Tg=o(async function(e){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(new vu("The task was aborted."))},{once:!0})})},"_PQueue_throwOnAbort"),mu=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 Rg=rh;var Su,Bt,sh,kg,Kn=0,Bg=[],bu=[],Ug=le.__b,Dg=le.__r,Ig=le.diffed,Lg=le.__c,Ng=le.unmount;function nh(i,e){le.__h&&le.__h(Bt,i,Kn||e),Kn=0;var t=Bt.__H||(Bt.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({__V:bu}),t.__[i]}o(nh,"p");function vr(i){return Kn=1,xS(zg,i)}o(vr,"y");function xS(i,e,t){var r=nh(Su++,2);return r.t=i,r.__c||(r.__=[t?t(e):zg(void 0,e),function(s){var n=r.t(r.__[0],s);r.__[0]!==n&&(r.__=[n,r.__[1]],r.__c.setState({}))}],r.__c=Bt),r.__}o(xS,"d");function Ki(i,e){var t=nh(Su++,3);!le.__s&&jg(t.__H,e)&&(t.__=i,t.u=e,Bt.__H.__h.push(t))}o(Ki,"_");function Ts(i){return Kn=5,Bo(function(){return{current:i}},[])}o(Ts,"s");function Bo(i,e){var t=nh(Su++,7);return jg(t.__H,e)?(t.__V=i(),t.u=e,t.__h=i,t.__V):t.__}o(Bo,"F");function Rs(i,e){return Kn=8,Bo(function(){return i},e)}o(Rs,"T");function ES(){for(var i;i=Bg.shift();)if(i.__P)try{i.__H.__h.forEach(wu),i.__H.__h.forEach(oh),i.__H.__h=[]}catch(e){i.__H.__h=[],le.__e(e,i.__v)}}o(ES,"b");le.__b=function(i){Bt=null,Ug&&Ug(i)},le.__r=function(i){Dg&&Dg(i),Su=0;var e=(Bt=i.__c).__H;e&&(sh===Bt?(e.__h=[],Bt.__h=[],e.__.forEach(function(t){t.__V=bu,t.u=void 0})):(e.__h.forEach(wu),e.__h.forEach(oh),e.__h=[])),sh=Bt},le.diffed=function(i){Ig&&Ig(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(Bg.push(e)!==1&&kg===le.requestAnimationFrame||((kg=le.requestAnimationFrame)||function(t){var r,s=o(function(){clearTimeout(n),Mg&&cancelAnimationFrame(r),setTimeout(t)},"u"),n=setTimeout(s,100);Mg&&(r=requestAnimationFrame(s))})(ES)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.__V!==bu&&(t.__=t.__V),t.u=void 0,t.__V=bu})),sh=Bt=null},le.__c=function(i,e){e.some(function(t){try{t.__h.forEach(wu),t.__h=t.__h.filter(function(r){return!r.__||oh(r)})}catch(r){e.some(function(s){s.__h&&(s.__h=[])}),e=[],le.__e(r,t.__v)}}),Lg&&Lg(i,e)},le.unmount=function(i){Ng&&Ng(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{wu(r)}catch(s){e=s}}),e&&le.__e(e,t.__v))};var Mg=typeof requestAnimationFrame=="function";function wu(i){var e=Bt,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),Bt=e}o(wu,"j");function oh(i){var e=Bt;i.__c=i.__(),Bt=e}o(oh,"k");function jg(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}o(jg,"w");function zg(i,e){return typeof e=="function"?e(i):e}o(zg,"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 ah(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(ah,"AuthView");function lh(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(lh,"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 uh(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(uh,"Breadcrumbs");function ch(i){return c(vt,null,i.showBreadcrumbs&&c(uh,{getFolder:i.getFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title}),c(lh,{logout:i.logout,username:i.username,i18n:i.i18n}))}o(ch,"Header");var yh=be(ui(),1);function Xn(i){return{...i,type:i.mimeType,extension:i.name?Gi(i.name).extension:null}}o(Xn,"remoteFileObjToLocal");function hh(){return hh=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},hh.apply(this,arguments)}o(hh,"_extends");var RS={position:"relative",width:"100%",minHeight:"100%"},kS={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},dh=class extends Te{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:u,height:l}=this.state,h=Math.floor(u/r),d=Math.floor(l/r);n&&(h=Math.max(0,h-h%n),d+=n);let f=h+d+4,y=t.slice(h,f),b={...RS,height:t.length*r},S={...kS,top:h*r};return c("div",hh({onScroll:this.handleScroll},a),c("div",{role:"presentation",style:b},c("div",{role:"presentation",style:S},y.map(s))))}},Pu=dh;function Yn(i){let{search:e,searchOnInput:t,searchTerm:r,showButton:s,inputLabel:n,clearSearchLabel:a,buttonLabel:u,clearSearch:l,inputClassName:h,buttonCSSClassName:d}=i,[f,y]=vr(r??""),b=Rs(P=>{P.preventDefault(),e(f)},[e,f]),S=Rs(P=>{let R=P.target.value;y(R),t&&e(R)},[y,t,e]),A=o(()=>{y(""),l&&l()},"handleReset"),[O]=vr(()=>{let P=document.createElement("form");return P.setAttribute("tabindex","-1"),P.id=Yt(),P});return Ki(()=>(document.body.appendChild(O),O.addEventListener("submit",b),()=>{O.removeEventListener("submit",b),document.body.removeChild(O)}),[O,b]),c(vt,null,c("input",{className:`uppy-u-reset ${h}`,type:"search","aria-label":n,placeholder:n,value:f,onInput:S,form:O.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:A},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:O.id},u))}o(Yn,"SearchFilterInput");function ph(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(ph,"FooterActions");var $g=be(ui(),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 fh(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(fh,"ItemIcon");var Hg=be(ui(),1);function LS(i){let{className:e,isDisabled:t,restrictionError:r,isChecked:s,title:n,itemIconEl:a,showTitles:u,toggleCheckbox:l,recordShiftKeyPress:h,id:d,children:f}=i,y=(0,Hg.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:l,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,u&&n,f))}o(LS,"GridListItem");var mh=LS;function gh(i){let{className:e,isDisabled:t,restrictionError:r,isCheckboxDisabled:s,isChecked:n,toggleCheckbox:a,recordShiftKeyPress:u,type:l,id:h,itemIconEl:d,title:f,handleFolderClick:y,showTitles:b,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:u,onMouseDown:u,name:"listitem",id:h,checked:n,"aria-label":l==="file"?null:S("allFilesFromFolderNamed",{name:f}),disabled:t,"data-uppy-super-focusable":!0}),l==="file"?c("label",{htmlFor:h,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},c("div",{className:"uppy-ProviderBrowserItem-iconWrap"},d),b&&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),b&&c("span",null,f)))}o(gh,"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 Fu(i){let{author:e,getItemIcon:t,isChecked:r,isDisabled:s,viewType:n}=i,a=t(),u=(0,$g.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--selected":r},{"uppy-ProviderBrowserItem--disabled":s},{"uppy-ProviderBrowserItem--noPreview":a==="video"}),l=c(fh,{itemIconString:a});switch(n){case"grid":return c(mh,Qn({},i,{className:u,itemIconEl:l}));case"list":return c(gh,Qn({},i,{className:u,itemIconEl:l}));case"unsplash":return c(mh,Qn({},i,{className:u,itemIconEl:l}),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(Fu,"Item");var NS="shared-with-me";function qg(i){let{currentSelection:e,uppyFiles:t,viewType:r,isChecked:s,toggleCheckbox:n,recordShiftKeyPress:a,showTitles:u,i18n:l,validateRestrictions:h,getNextFolder:d,f}=i;if(f.isFolder)return Fu({showTitles:u,viewType:r,i18n:l,id:f.id,title:f.name,getItemIcon:()=>f.icon,isChecked:s(f),toggleCheckbox:b=>n(b,f),recordShiftKeyPress:a,type:"folder",isDisabled:!1,isCheckboxDisabled:f.id===NS,handleFolderClick:()=>d(f)});let y=h(Xn(f),[...t,...e]);return Fu({id:f.id,title:f.name,author:f.author,getItemIcon:()=>f.icon,isChecked:s(f),toggleCheckbox:b=>n(b,f),isCheckboxDisabled:!1,recordShiftKeyPress:a,showTitles:u,viewType:r,i18n:l,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:u,isChecked:l,toggleCheckbox:h,recordShiftKeyPress:d,handleScroll:f,showTitles:y,i18n:b,validateRestrictions:S,isLoading:A,showSearchFilter:O,search:P,searchTerm:R,clearSearch:H,searchOnInput:X,searchInputLabel:K,clearSearchLabel:V,getNextFolder:W,cancel:te,done:re,noResultsLabel:Oe,loadAllFiles:Re}=i,$e=e.length,we=Bo(()=>[...t,...r],[t,r]);return c("div",{className:(0,yh.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n}`)},a&&c("div",{className:"uppy-ProviderBrowser-header"},c("div",{className:(0,yh.default)("uppy-ProviderBrowser-headerBar",!u&&"uppy-ProviderBrowser-headerBar--simple")},a)),O&&c("div",{class:"uppy-ProviderBrowser-searchFilter"},c(Yn,{search:P,searchTerm:R,clearSearch:H,inputLabel:K,clearSearchLabel:V,inputClassName:"uppy-ProviderBrowser-searchFilterInput",searchOnInput:X})),A?c("div",{className:"uppy-Provider-loading"},c("span",null,typeof A=="string"?A:b("loading"))):!t.length&&!r.length?c("div",{className:"uppy-Provider-empty"},Oe):Re?c("div",{className:"uppy-ProviderBrowser-body"},c("ul",{className:"uppy-ProviderBrowser-list"},c(Pu,{data:we,renderRow:_e=>c(qg,{currentSelection:e,uppyFiles:s,viewType:n,isChecked:l,toggleCheckbox:h,recordShiftKeyPress:d,showTitles:y,i18n:b,validateRestrictions:S,getNextFolder:W,f:_e}),rowHeight:31}))):c("div",{className:"uppy-ProviderBrowser-body"},c("ul",{className:"uppy-ProviderBrowser-list",onScroll:f,role:"listbox",tabIndex:-1},we.map(_e=>c(qg,{currentSelection:e,uppyFiles:s,viewType:n,isChecked:l,toggleCheckbox:h,recordShiftKeyPress:d,showTitles:y,i18n:b,validateRestrictions:S,getNextFolder:W,f:_e})))),$e>0&&c(ph,{selected:$e,done:re,cancel:te,i18n:b}))}o(MS,"Browser");var xu=MS;var br=class extends Te{static{o(this,"CloseWrapper")}componentWillUnmount(){let{onUnmount:e}=this.props;e()}render(){let{children:e}=this.props;return Pi(e)[0]}};function jo(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}o(jo,"isPreviewSupported");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}},r=Ss(t);return r&&jo(r)&&(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:u}=this.plugin.getPluginState(),l=n.indexOf(this.lastCheckbox),h=n.indexOf(t),d=l<h?n.slice(l,h+1):n.slice(h,l+1),f=[];for(let y of d){let{uppy:b}=this.plugin,S=b.validateRestrictions(Xn(y),[...b.getFiles(),...f]);S?b.info({message:S.message},"error",b.opts.infoTimeout):f.push(y)}this.plugin.setPluginState({currentSelection:[...new Set([...u,...f])]});return}this.lastCheckbox=t;let{currentSelection:a}=this.plugin.getPluginState();this.isChecked(t)?this.plugin.setPluginState({currentSelection:a.filter(u=>u.id!==t.id)}):this.plugin.setPluginState({currentSelection:a.concat([t])})}setLoading(e){this.plugin.setPluginState({loading:e})}};function Jt(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Jt,"_classPrivateFieldLooseBase");var BS=0;function ta(i){return"__private_"+BS+++"_"+i}o(ta,"_classPrivateFieldLooseKey");var jS={version:"3.12.0"};function zS(i){return i.slice(1).map(e=>e.name).join("/")}o(zS,"formatBreadcrumbs");function vh(i,e){return i?`${i}/${e}`:e}o(vh,"prependPath");function zo(){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(zo,"defaultPickerIcon");var HS={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1},Us=ta("abortController"),Li=ta("withAbort"),ea=ta("list"),Jn=ta("listFilesAndFolders"),Zn=ta("recursivelyListAllFiles"),Qe=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:qS}),Object.defineProperty(this,Li,{value:$S}),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 Jt(this,Li)[Li](async r=>{this.lastCheckbox=void 0;let{breadcrumbs:s}=this.plugin.getPluginState(),n=s.findIndex(l=>e===l.requestPath);n!==-1?s=s.slice(0,n+1):s=[...s,{requestPath:e,name:t}],this.nextPagePath=e;let a=[],u=[];do{let{files:l,folders:h}=await Jt(this,Jn)[Jn]({breadcrumbs:s,signal:r});a=a.concat(l),u=u.concat(h),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:a.length+u.length}))}while(this.opts.loadAllFiles&&this.nextPagePath);this.plugin.setPluginState({folders:u,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 Jt(this,Li)[Li](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 Jt(this,Li)[Li](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 Jt(this,Li)[Li](async t=>{let{files:r,folders:s,breadcrumbs:n}=this.plugin.getPluginState(),{files:a,folders:u}=await Jt(this,Jn)[Jn]({breadcrumbs:n,signal:t}),l=r.concat(a),h=s.concat(u);this.plugin.setPluginState({folders:h,files:l})})}catch(t){this.handleError(t)}finally{this.isHandlingScroll=!1}}}async donePicking(){this.setLoading(!0);try{await Jt(this,Li)[Li](async e=>{let{currentSelection:t}=this.plugin.getPluginState(),r=[],s=[];for(let n of t){let{requestPath:a}=n,u=o(l=>({...l,relDirPath:l.absDirPath.replace(n.absDirPath,"").replace(/^\//,"")}),"withRelDirPath");if(n.isFolder){let l=!0,h=0,d=new Rg({concurrency:6}),f=o(b=>{for(let S of b){let A=this.getTagFile(S),O=Ql(A,this.plugin.uppy.getID());this.plugin.uppy.checkIfFileAlreadyExists(O)||(s.push(u(S)),h++,this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:h}))),l=!1}},"onFiles");await Jt(this,Zn)[Zn]({requestPath:a,absDirPath:vh(n.absDirPath,n.name),relDirPath:n.name,queue:d,onFiles:f,signal:e}),await d.onIdle();let y;l?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(u(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 u={...this.opts,...t},{files:l,folders:h,filterInput:d,loading:f,currentSelection:y}=this.plugin.getPluginState(),{isChecked:b,recordShiftKeyPress:S,filterItems:A}=this,O=d!=="",P=this.plugin.icon||zo,R={showBreadcrumbs:u.showBreadcrumbs,getFolder:this.getFolder,breadcrumbs:this.plugin.getPluginState().breadcrumbs,pluginIcon:P,title:this.plugin.title,logout:this.logout,username:this.username,i18n:a},H={isChecked:b,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:S,currentSelection:y,files:O?A(l):l,folders:O?A(h):h,getNextFolder:this.getNextFolder,getFolder:this.getFolder,loadAllFiles:this.opts.loadAllFiles,showSearchFilter:u.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(ch,R),title:this.plugin.title,viewType:u.viewType,showTitles:u.showTitles,showBreadcrumbs:u.showBreadcrumbs,pluginIcon:P,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(ah,{pluginName:this.plugin.title,pluginIcon:P,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18nArray,renderForm:this.opts.renderAuthForm,loading:f})):c(br,{onUnmount:this.clearSelection},c(xu,H))}};async function $S(i){var e;(e=Jt(this,Us)[Us])==null||e.abort();let t=new AbortController;Jt(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),Jt(this,Us)[Us]=void 0}}o($S,"_withAbort2");async function qS(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(u=>({...u,absDirPath:t})),nextPagePath:n}}o(qS,"_list2");async function VS(i){let{breadcrumbs:e,signal:t}=i,r=zS(e),{items:s,nextPagePath:n}=await Jt(this,ea)[ea]({requestPath:this.nextPagePath,absDirPath:r,signal:t});this.nextPagePath=n;let a=[],u=[];return s.forEach(l=>{l.isFolder?u.push(l):a.push(l)}),{files:a,folders:u}}o(VS,"_listFilesAndFolders2");async function WS(i){let{requestPath:e,absDirPath:t,relDirPath:r,queue:s,onFiles:n,signal:a}=i,u=e;for(;u;){let l=await Jt(this,ea)[ea]({requestPath:u,absDirPath:t,signal:a});u=l.nextPagePath;let h=l.items.filter(y=>!y.isFolder),d=l.items.filter(y=>y.isFolder);n(h);let f=d.map(async y=>s.add(async()=>Jt(this,Zn)[Zn]({requestPath:y.requestPath,absDirPath:vh(t,y.name),relDirPath:vh(r,y.name),queue:s,onFiles:n,signal:a})));await Promise.all(f)}}o(WS,"_recursivelyListAllFiles2");Qe.VERSION=jS.version;function Vg(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Vg,"_classPrivateFieldLooseBase");var GS=0;function KS(i){return"__private_"+GS+++"_"+i}o(KS,"_classPrivateFieldLooseKey");var XS={version:"3.12.0"},Wg={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(Wg),this.registerRequestClient()}tearDown(){}resetPluginState(){this.plugin.setPluginState(Wg)}async search(e){let{searchTerm:t}=this.plugin.getPluginState();if(!(e&&e===t)){this.setLoading(!0);try{let r=await this.provider.search(e);Vg(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);Vg(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:u}=this.plugin.uppy;s||this.preFirstRender();let l={...this.opts,...t},{files:h,folders:d,filterInput:f,loading:y,currentSelection:b}=this.plugin.getPluginState(),{isChecked:S,filterItems:A,recordShiftKeyPress:O}=this,P=f!=="",R={isChecked:S,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:O,currentSelection:b,files:P?A(h):h,folders:P?A(d):d,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,showSearchFilter:l.showFilter,search:this.search,clearSearch:this.clearSearch,searchTerm:a,searchOnInput:!1,searchInputLabel:u("search"),clearSearchLabel:u("resetSearch"),noResultsLabel:u("noSearchResults"),title:this.plugin.title,viewType:l.viewType,showTitles:l.showTitles,showFilter:l.showFilter,isLoading:y,showBreadcrumbs:l.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:u,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:u("enterTextToSearch"),buttonLabel:u("searchImages"),inputClassName:"uppy-c-textInput uppy-SearchProvider-input",buttonCSSClassName:"uppy-SearchProvider-searchButton",showButton:!0}))):c(br,{onUnmount:this.resetPluginState},c(xu,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 Gg;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 wh(i){return"__private_"+JS+++"_"+i}o(wh,"_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=wh("id"),ra=wh("selector"),_r=wh("store");Gg=Symbol.for("uppy test: get id");var Eu=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,_r,{writable:!0,value:void 0}),Xi(this,_r)[_r]=e.store,Xi(this,Sr)[Sr]=e.id||Yt(),Xi(this,ra)[ra]=e.selector||t2(Xi(this,Sr)[Sr]),this.setState({})}setState(e){Xi(this,_r)[_r].dispatch({type:e2,id:Xi(this,Sr)[Sr],payload:e})}getState(){return Xi(this,ra)[ra](Xi(this,_r)[_r].getState())}subscribe(e){let t=this.getState();return Xi(this,_r)[_r].subscribe(()=>{let r=this.getState();if(t!==r){let s=i2(t,r);e(t,r,s),t=r}})}[Gg](){return Xi(this,Sr)[Sr]}};Eu.VERSION=ZS.version;var Kg=Eu;function Ou(i,e,t,r){return t===0||i===e?i:r===0?e:i+(e-i)*2**(-r/t)}o(Ou,"emaFilter");var ci={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var Oh=be(ui(),1);function sa(i){let e=[],t="indeterminate",r;for(let{progress:n}of Object.values(i)){let{preprocess:a,postprocess:u}=n;r==null&&(a||u)&&({mode:t,message:r}=a||u),a?.mode==="determinate"&&e.push(a.value),u?.mode==="determinate"&&e.push(u.value)}let s=e.reduce((n,a)=>n+a/e.length,0);return{mode:t,message:r,value:s}}o(sa,"calculateProcessingProgress");var Fh=be(ui(),1),Ph=be(Fn(),1);function Sh(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(Sh,"secondsToTime");function _h(i){let e=Sh(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(_h,"prettyETA");var r2="\xB7",Xg=o(()=>` ${r2} `,"renderDot");function Yg(i){let{newFiles:e,isUploadStarted:t,recoveredState:r,i18n:s,uploadState:n,isSomeGhost:a,startUpload:u}=i,l=(0,Fh.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===ci.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:l,"aria-label":s("uploadXFiles",{smart_count:e}),onClick:u,disabled:a,"data-uppy-super-focusable":!0},h)}o(Yg,"UploadBtn");function Qg(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(Qg,"RetryBtn");function Jg(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(Jg,"CancelBtn");function Zg(i){let{isAllPaused:e,i18n:t,isAllComplete:r,resumableUploads:s,uppy:n}=i,a=t(e?"resume":"pause");function u(){if(!r){if(!s){n.cancelAll();return}if(e){n.resumeAll();return}n.pauseAll()}}return o(u,"togglePauseResume"),c("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:u,"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(Zg,"PauseResumeButton");function ey(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(ey,"DoneBtn");function ty(){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(ty,"LoadingSpinner");function iy(i){let{progress:e}=i,{value:t,mode:r,message:s}=e;return c("div",{className:"uppy-StatusBar-content"},c(ty,null),r==="determinate"?`${Math.round(t*100)}% \xB7 `:"",s)}o(iy,"ProgressBarProcessing");function s2(i){let{numUploads:e,complete:t,totalUploadedSize:r,totalSize:s,totalETA:n,i18n:a}=i,u=e>1;return c("div",{className:"uppy-StatusBar-statusSecondary"},u&&a("filesUploadedOfTotal",{complete:t,smart_count:e}),c("span",{className:"uppy-StatusBar-additionalInfo"},u&&Xg(),a("dataUploadedOfTotal",{complete:(0,Ph.default)(r),total:(0,Ph.default)(s)}),Xg(),a("xTimeLeft",{time:_h(n)})))}o(s2,"ProgressDetails");function ry(i){let{i18n:e,complete:t,numUploads:r}=i;return c("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:r}))}o(ry,"FileUploadCount");function o2(i){let{i18n:e,newFiles:t,startUpload:r}=i,s=(0,Fh.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 sy(i){let{i18n:e,supportsUploadProgress:t,totalProgress:r,showProgressDetails:s,isUploadStarted:n,isAllComplete:a,isAllPaused:u,newFiles:l,numUploads:h,complete:d,totalUploadedSize:f,totalSize:y,totalETA:b,startUpload:S}=i,A=l&&n;if(!n||a)return null;let O=e(u?"paused":"uploading");function P(){return!u&&!A&&s?t?c(s2,{numUploads:h,complete:d,totalUploadedSize:f,totalSize:y,totalETA:b,i18n:e}):c(ry,{i18n:e,complete:d,numUploads:h}):null}return o(P,"renderProgressDetails"),c("div",{className:"uppy-StatusBar-content","aria-label":O,title:O},u?null:c(ty,null),c("div",{className:"uppy-StatusBar-status"},c("div",{className:"uppy-StatusBar-statusPrimary"},t?`${O}: ${r}%`:O),P(),A?c(o2,{i18n:e,newFiles:l,startUpload:S}):null))}o(sy,"ProgressBarUploading");function oy(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(oy,"ProgressBarComplete");function ny(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(ry,{i18n:t,complete:r,numUploads:s})))}o(ny,"ProgressBarError");var{STATE_ERROR:ay,STATE_WAITING:ly,STATE_PREPROCESSING:xh,STATE_UPLOADING:Cu,STATE_POSTPROCESSING:Eh,STATE_COMPLETE:Au}=ci;function Tu(i){let{newFiles:e,allowNewUpload:t,isUploadInProgress:r,isAllPaused:s,resumableUploads:n,error:a,hideUploadButton:u,hidePauseResumeButton:l,hideCancelButton:h,hideRetryButton:d,recoveredState:f,uploadState:y,totalProgress:b,files:S,supportsUploadProgress:A,hideAfterFinish:O,isSomeGhost:P,doneButtonHandler:R,isUploadStarted:H,i18n:X,startUpload:K,uppy:V,isAllComplete:W,showProgressDetails:te,numUploads:re,complete:Oe,totalSize:Re,totalETA:$e,totalUploadedSize:we}=i;function _e(){switch(y){case Eh:case xh:{let Q=sa(S);return Q.mode==="determinate"?Q.value*100:b}case ay:return null;case Cu:return A?b:null;default:return b}}o(_e,"getProgressValue");function Le(){switch(y){case Eh:case xh:{let{mode:Q}=sa(S);return Q==="indeterminate"}case Cu:return!A;default:return!1}}o(Le,"getIsIndeterminate");function C(){if(f)return!1;switch(y){case ly:return u||e===0;case Au:return O;default:return!1}}o(C,"getIsHidden");let _=_e(),E=C(),L=_??100,z=!a&&e&&!r&&!s&&t&&!u,B=!h&&y!==ly&&y!==Au,D=n&&!l&&y===Cu,T=a&&!W&&!d,k=R&&y===Au,N=(0,Oh.default)("uppy-StatusBar-progress",{"is-indeterminate":Le()}),Y=(0,Oh.default)("uppy-StatusBar",`is-${y}`,{"has-ghosts":P});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":_}),(()=>{switch(y){case xh:case Eh:return c(iy,{progress:sa(S)});case Au:return c(oy,{i18n:X});case ay:return c(ny,{error:a,i18n:X,numUploads:re,complete:Oe});case Cu:return c(sy,{i18n:X,supportsUploadProgress:A,totalProgress:b,showProgressDetails:te,isUploadStarted:H,isAllComplete:W,isAllPaused:s,newFiles:e,numUploads:re,complete:Oe,totalUploadedSize:we,totalSize:Re,totalETA:$e,startUpload:K});default:return null}})(),c("div",{className:"uppy-StatusBar-actions"},f||z?c(Yg,{newFiles:e,isUploadStarted:H,recoveredState:f,i18n:X,isSomeGhost:P,startUpload:K,uploadState:y}):null,T?c(Qg,{i18n:X,uppy:V}):null,D?c(Zg,{isAllPaused:s,i18n:X,isAllComplete:W,resumableUploads:n,uppy:V}):null,B?c(Jg,{i18n:X,uppy:V}):null,k?c(ey,{i18n:X,doneButtonHandler:R}):null))}o(Tu,"StatusBar");Tu.defaultProps={doneButtonHandler:void 0,hideAfterFinish:!1,hideCancelButton:!1,hidePauseResumeButton:!1,hideRetryButton:!1,hideUploadButton:void 0,showProgressDetails:void 0};var uy={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 Ho(i){return"__private_"+n2+++"_"+i}o(Ho,"_classPrivateFieldLooseKey");var a2={version:"3.3.3"},l2=2e3,u2=2e3;function c2(i,e,t,r){if(i)return ci.STATE_ERROR;if(e)return ci.STATE_COMPLETE;if(t)return ci.STATE_WAITING;let s=ci.STATE_WAITING,n=Object.keys(r);for(let a=0;a<n.length;a++){let{progress:u}=r[n[a]];if(u.uploadStarted&&!u.uploadComplete)return ci.STATE_UPLOADING;u.preprocess&&(s=ci.STATE_PREPROCESSING),u.postprocess&&s!==ci.STATE_PREPROCESSING&&(s=ci.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},Ei=Ho("lastUpdateTime"),Ni=Ho("previousUploadedBytes"),Pr=Ho("previousSpeed"),hi=Ho("previousETA"),Ch=Ho("computeSmoothETA"),oa=Ho("onUploadStart"),Fr=class extends ae{static{o(this,"StatusBar")}constructor(e,t){super(e,{...h2,...t}),Object.defineProperty(this,Ch,{value:d2}),Object.defineProperty(this,Ei,{writable:!0,value:void 0}),Object.defineProperty(this,Ni,{writable:!0,value:void 0}),Object.defineProperty(this,Pr,{writable:!0,value:void 0}),Object.defineProperty(this,hi,{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,Pr)[Pr]=null,Be(this,hi)[hi]=null,r){Be(this,Ni)[Ni]=Object.values(r.files).reduce((s,n)=>{let{progress:a}=n;return s+a.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Be(this,Ei)[Ei]=performance.now(),Be(this,Ni)[Ni]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=uy,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:u}=e,{newFiles:l,startedFiles:h,completeFiles:d,isUploadStarted:f,isAllComplete:y,isAllErrored:b,isAllPaused:S,isUploadInProgress:A,isSomeGhost:O}=this.uppy.getObjectOfFilesPerState(),P=u?Object.values(r):l,R=!!t.resumableUploads,H=t.uploadProgress!==!1,X=0,K=0;h.forEach(W=>{X+=W.progress.bytesTotal||0,K+=W.progress.bytesUploaded||0});let V=Be(this,Ch)[Ch]({uploaded:K,total:X,remaining:X-K});return Tu({error:a,uploadState:c2(a,y,u,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:X,totalUploadedSize:K,isAllComplete:!1,isAllPaused:S,isAllErrored:b,isUploadStarted:f,isUploadInProgress:A,isSomeGhost:O,recoveredState:u,complete:d.length,newFiles:P.length,numUploads:h.length,totalETA:V,files:r,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:R,supportsUploadProgress:H,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;au(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,Ei)[Ei]=performance.now(),Be(this,Ni)[Ni]=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,Ei))[Ei])!=null||(e[Ei]=performance.now());let r=performance.now()-Be(this,Ei)[Ei];if(r===0){var s;return Math.round(((s=Be(this,hi)[hi])!=null?s:0)/100)/10}let n=i.uploaded-Be(this,Ni)[Ni];if(Be(this,Ni)[Ni]=i.uploaded,n<=0){var a;return Math.round(((a=Be(this,hi)[hi])!=null?a:0)/100)/10}let u=n/r,l=Be(this,Pr)[Pr]==null?u:Ou(u,Be(this,Pr)[Pr],l2,r);Be(this,Pr)[Pr]=l;let h=i.remaining/l,d=Math.max(Be(this,hi)[hi]-r,0),f=Be(this,hi)[hi]==null?h:Ou(h,d,u2,r);return Be(this,hi)[hi]=f,Be(this,Ei)[Ei]=performance.now(),Math.round(f/100)/10}o(d2,"_computeSmoothETA2");Fr.VERSION=a2.version;var cy=300,na=class extends Te{static{o(this,"FadeIn")}constructor(){super(...arguments),this.ref=Km()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,cy)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,cy)}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 u=0;u<r[a].length;u++){let l=r[a][u];n[r[a][u]]=t(l)}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"),Ru=class extends Te{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:u,transitionLeaveTimeout:l,transitionEnterTimeout:h,transitionAppearTimeout:d,component:f,...y}=e,{children:b}=t,S=Object.entries(b).map(A=>{let[O,P]=A;if(!P)return;let R=m2(this,O);return ou(r(P),{ref:R,key:O})}).filter(Boolean);return c(f,y,S)}};Ru.defaultProps={component:"span",childFactory:y2};var hy=Ru;var v2={version:"3.1.0"},xr=class extends ae{static{o(this,"Informer")}constructor(e,t){super(e,t),this.render=r=>c("div",{className:"uppy uppy-Informer"},c(hy,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)}};xr.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",u;if(n?.[2]!=null){let l=atob(decodeURIComponent(n[3])),h=new Uint8Array(l.length);for(let d=0;d<l.length;d++)h[d]=l.charCodeAt(d);u=[h]}else n?.[3]!=null&&(u=[decodeURIComponent(n[3])]);return t?new File(u,e.name||"",{type:a}):new Blob(u,{type:a})}o(w2,"dataURItoBlob");var dy=w2;function ku(i){return i.startsWith("blob:")}o(ku,"isObjectURL");function xe(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}o(xe,"e");var Sy=typeof self<"u"?self:global,ha=typeof navigator<"u",S2=ha&&typeof HTMLImageElement>"u",py=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),_y=Sy.Buffer,Py=!!_y,_2=o(i=>i!==void 0,"h");function Fy(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(_2).length===0)}o(Fy,"f");function bt(i){let e=new Error(i);throw delete e.stack,e}o(bt,"l");function fy(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(fy,"o");var Ah=o(i=>String.fromCharCode.apply(null,i),"u"),my=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),my?my.decode(s):Py?Buffer.from(s).toString("utf8"):decodeURIComponent(escape(Ah(s)));var s}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return Ah(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 Ah(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 Rh(i,e){bt(`${i} '${e}' was not loaded, try using full build of exifr.`)}o(Rh,"p");var da=class extends Map{static{o(this,"g")}constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||Rh(this.kind,e),t&&(e in t||function(r,s){bt(`Unknown ${r} '${s}'.`)}(this.kind,e),t[e].enabled||Rh(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},Nu=new da("file parser"),di=new da("segment parser"),ma=new da("file reader"),P2=Sy.fetch;function gy(i,e){return(t=i).startsWith("data:")||t.length>1e4?Uh(i,e,"base64"):py&&i.includes("://")?kh(i,e,"url",Uu):py?Uh(i,e,"fs"):ha?kh(i,e,"url",Uu):void bt("Invalid input argument");var t}o(gy,"k");async function kh(i,e,t,r){return ma.has(t)?Uh(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(kh,"O");async function Uh(i,e,t){let r=new(ma.get(t))(i,e);return await r.read(),r}o(Uh,"v");var Uu=o(i=>P2(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"),Dh=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 Dh;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 Ey(i,e,t){let r,s=i.get(e);for(r of t)s.set(r[0],r[1])}o(Ey,"C");var ga=new Map,Bh=new Map,jh=new Map,$o=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Mu=["jfif","xmp","icc","iptc","ihdr"],fa=["tiff",...Mu],rt=["ifd0","ifd1","exif","gps","interop"],qo=[...fa,...rt],Vo=["makerNote","userComment"],Bu=["translateKeys","translateValues","reviveValues","multiSegment"],Wo=[...Bu,"sanitize","mergeOutput","silentErrors"],Du=class{static{o(this,"_")}get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},Ds=class extends Du{static{o(this,"D")}get needed(){return this.enabled||this.deps.size>0}constructor(e,t,r,s){if(super(),xe(this,"enabled",!1),xe(this,"skip",new Set),xe(this,"pick",new Set),xe(this,"deps",new Set),xe(this,"translateKeys",!1),xe(this,"translateValues",!1),xe(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=rt.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 Bu)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,Iu(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Iu(this.pick,this.deps)}},jt={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},yy=new Map,Ls=class extends Du{static{o(this,"R")}static useCached(e){let t=yy.get(e);return t!==void 0||(t=new this(e),yy.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 $o)this[e]=jt[e];for(e of Wo)this[e]=jt[e];for(e of Vo)this[e]=jt[e];for(e of qo)this[e]=new Ds(e,jt[e],void 0,this)}setupFromTrue(){let e;for(e of $o)this[e]=jt[e];for(e of Wo)this[e]=jt[e];for(e of Vo)this[e]=!0;for(e of qo)this[e]=new Ds(e,!0,void 0,this)}setupFromArray(e){let t;for(t of $o)this[t]=jt[t];for(t of Wo)this[t]=jt[t];for(t of Vo)this[t]=jt[t];for(t of qo)this[t]=new Ds(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,rt)}setupFromObject(e){let t;for(t of(rt.ifd0=rt.ifd0||rt.image,rt.ifd1=rt.ifd1||rt.thumbnail,Object.assign(this,e),$o))this[t]=Th(e[t],jt[t]);for(t of Wo)this[t]=Th(e[t],jt[t]);for(t of Vo)this[t]=Th(e[t],jt[t]);for(t of fa)this[t]=new Ds(t,jt[t],e[t],this);for(t of rt)this[t]=new Ds(t,jt[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,rt,qo),e.tiff===!0?this.batchEnableWithBool(rt,!0):e.tiff===!1?this.batchEnableWithUserValue(rt,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,rt):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,rt)}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=vy(e,r);for(let[a,u]of n)Iu(this[a].pick,u),this[a].enabled=!0}else if(t&&t.length){let n=vy(t,r);for(let[a,u]of n)Iu(this[a].skip,u)}}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=rt.some(n=>this[n].enabled===!0)||this.makerNote||this.userComment;for(let n of rt)this[n].finalizeFilters()}get onlyTiff(){return!Mu.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of fa)this[e].enabled&&!di.has(e)&&Rh("segment parser",e)}};function vy(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(vy,"K");function Th(i,e){return i!==void 0?i:e!==void 0?e:void 0}o(Th,"W");function Iu(i,e){for(let t of e)i.add(t)}o(Iu,"X");xe(Ls,"default",jt);var Go=class{static{o(this,"H")}constructor(e){xe(this,"parsers",{}),xe(this,"output",{}),xe(this,"errors",[]),xe(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"?gy(t,r):ha&&!S2&&t instanceof HTMLImageElement?gy(t.src,r):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Is(t):ha&&t instanceof Blob?kh(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 Nu)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),Fy(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=di.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),u=await a.extractThumbnail();return t.close&&t.close(),u}};async function Oy(i,e){let t=new Go(e);return await t.read(i),t.parse()}o(Oy,"Y");var F2=Object.freeze({__proto__:null,parse:Oy,Exifr:Go,fileParsers:Nu,segmentParsers:di,fileReaders:ma,tagKeys:ga,tagValues:Bh,tagRevivers:jh,createDictionary:xy,extendDictionary:Ey,fetchUrlAsArrayBuffer:Uu,readBlobAsArrayBuffer:pa,chunkedProps:$o,otherSegments:Mu,segments:fa,tiffBlocks:rt,segmentsAndBlocks:qo,tiffExtractables:Vo,inheritables:Bu,allFormatters:Wo,Options:Ls}),rs=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){xe(this,"errors",[]),xe(this,"raw",new Map),xe(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=jh.get(t),s=Bh.get(t),n=ga.get(t),a=this.options[t],u=a.reviveValues&&!!r,l=a.translateValues&&!!s,h=a.translateKeys&&!!n,d={};for(let[f,y]of e)u&&r.has(f)?y=r.get(f)(y):l&&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}};xe(rs,"headerLength",4),xe(rs,"type",void 0),xe(rs,"multiSegment",!1),xe(rs,"canHandle",()=>!1);function x2(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}o(x2,"q");function E2(i){return i>=224&&i<=239}o(E2,"Q");function O2(i,e,t){for(let[r,s]of di)if(s.canHandle(i,e,t))return r}o(O2,"Z");var Lu=class extends class{constructor(e,t,r){xe(this,"errors",[]),xe(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(u){bt(`Couldn't read segment: ${JSON.stringify(s)}. ${u.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(di.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),xe(this,"appSegments",[]),xe(this,"jpegSegments",[]),xe(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(di.keyList())):(e=e===void 0?di.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&di.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(u=>{let l=di.get(u),h=this.options[u];return l.multiSegment&&h.multiSegment}),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,r.byteLength),!this.options.onlyTiff&&r.chunked){let u=!1;for(;a.size>0&&!u&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=r,h=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(u=e>l&&!h?!await r.readNextChunk(e):!await r.readNextChunk(l),(e=this.findAppSegmentsInRange(e,r.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let r,s,n,a,u,l,{file:h,findAll:d,wanted:f,remaining:y,options:b}=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=di.get(n),u=a.findPosition(h,e),l=b[n],u.type=n,this.appSegments.push(u),!d&&(a.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=u.chunkNumber<u.chunkCount,this.unfinishedMultiSegment||y.delete(n)):y.delete(n),y.size===0)))break;b.recordUnknownSegments&&(u=rs.findPosition(h,e),u.marker=r,this.unknownSegments.push(u)),e+=s+1}else if(x2(r)){if(s=h.getUint16(e+2),r===218&&b.stopAfterSos!==!1)return;b.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,u=new Map;for(let l=0;l<t.length;l++)s=t[l],n=s[r],u.has(n)?a=u.get(n):u.set(n,a=[]),a.push(s);return Array.from(u)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,r])=>{let s=di.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}};xe(Lu,"type","jpeg"),Nu.set("jpeg",Lu);var C2=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Ih=class extends rs{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,u=n.size===0,l=this.chunk.getUint16(e);e+=2;for(let h=0;h<l;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!u&&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),u=C2[n];if(u*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(l=function(h){for(;h.endsWith("\0");)h=h.slice(0,-1);return h}(l=s.getString(e,a)).trim())===""?void 0:l;var l;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=u;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 Ih{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,fy(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,fy(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",by(...e.get(2),e.get(1))),e.set("longitude",by(...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 rt)if(e=this[t],!Fy(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 by(i,e,t,r){var s=i+e/60+t/3600;return r!=="S"&&r!=="W"||(s*=-1),s}o(by,"ne");xe(ca,"type","tiff"),xe(ca,"headerLength",10),di.set("tiff",ca);var a4=Object.freeze({__proto__:null,default:F2,Exifr:Go,fileParsers:Nu,segmentParsers:di,fileReaders:ma,tagKeys:ga,tagValues:Bh,tagRevivers:jh,createDictionary:xy,extendDictionary:Ey,fetchUrlAsArrayBuffer:Uu,readBlobAsArrayBuffer:pa,chunkedProps:$o,otherSegments:Mu,segments:fa,tiffBlocks:rt,segmentsAndBlocks:qo,tiffExtractables:Vo,inheritables:Bu,allFormatters:Wo,Options:Ls,parse:Oy}),zh={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},l4=Object.assign({},zh,{firstChunkSize:4e4,gps:[1,2,3,4]});var u4=Object.assign({},zh,{tiff:!1,ifd1:!0,mergeOutput:!1});var A2=Object.assign({},zh,{firstChunkSize:4e4,ifd0:[274]});async function T2(i){let e=new Go(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 Cy(i){let e=await T2(i);return Object.assign({canvas:la,css:ua},R2[e])}o(Cy,"ye");var Lh=class extends Is{static{o(this,"be")}constructor(...e){super(...e),xe(this,"ranges",new Nh),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?_y.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)}},Nh=class{static{o(this,"we")}constructor(){xe(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let s=e+t,n=this.list.filter(a=>wy(e,a.offset,s)||wy(e,a.end,s));if(n.length>0){e=Math.min(e,...n.map(u=>u.offset)),s=Math.max(s,...n.map(u=>u.end)),t=s-e;let a=n.shift();a.offset=e,a.length=t,a.end=s,this.list=this.list.filter(u=>!n.includes(u))}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 wy(i,e,t){return i<=e&&e<=t}o(wy,"ke");var Mh=class extends Lh{static{o(this,"Oe")}constructor(e,t){super(0),xe(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 Mh{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 Ay={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(()=>dy(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},ss=class extends ae{static{o(this,"ThumbnailGenerator")}constructor(e,t){if(super(e,{...L2,...t}),this.onFileAdded=r=>{!r.preview&&r.data&&jo(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&&ku(r.preview)&&URL.revokeObjectURL(r.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(s=>s.isRestored).forEach(s=>{(!s.preview||ku(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=Ay,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((u,l)=>{let h=new Image;h.src=s,h.addEventListener("load",()=>{URL.revokeObjectURL(s),u(h)}),h.addEventListener("error",d=>{URL.revokeObjectURL(s),l(d.error||new Error("Could not create thumbnail"))})}),a=Cy(e.data).catch(()=>1);return Promise.all([n,a]).then(u=>{let[l,h]=u,d=this.getProportionalDimensions(l,t,r,h.deg),f=D2(l,h),y=this.resizeImage(f,d.width,d.height);return U2(y,this.thumbnailType,80)}).then(u=>URL.createObjectURL(u))}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),u=r*2**(n-1),l=2;for(;n--;){let h=document.createElement("canvas");h.width=a,h.height=u,h.getContext("2d").drawImage(s,0,0,a,u),s=h,a=Math.round(a/l),u=Math.round(u/l)}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 jo(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)}};ss.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 Hh=N2;var st=Array.from;function ju(i,e,t,r){let{onSuccess:s}=r;i.readEntries(n=>{let a=[...e,...n];n.length?queueMicrotask(()=>{ju(i,a,t,{onSuccess:s})}):s(a)},n=>{t(n),s(e)})}o(ju,"getFilesAndDirectoriesFromDirectory");function Ty(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=>{ju(t,[],e,{onSuccess:n=>s(n.map(a=>Ty(a,e)))})})},isSameEntry:void 0}}o(Ty,"getAsFileSystemHandleFromEntry");function Ry(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*Ry(s,e?r():i.name);else t!=null&&(yield t)}()}catch(r){return Promise.reject(r)}}o(Ry,"createPromiseToAddFileOrParseDirectory");async function*$h(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=Ty(a(),e)),{fileSystemHandle:n,lastResortFile:r.getAsFile()}}));for(let{lastResortFile:r,fileSystemHandle:s}of t)if(s!=null)try{yield*Ry(s,"",r)}catch(n){r!=null?yield r:e(n)}else r!=null&&(yield r)}o($h,"getFilesFromDataTransfer");function qh(i){let e=st(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 $h(i,r))s.push(n);return s}catch{return qh(i)}}o(Ns,"getDroppedFiles");var ky=Number.isNaN||o(function(e){return typeof e=="number"&&e!==e},"ponyfill");function M2(i,e){return!!(i===e||ky(i)&&ky(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 Vh(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(Vh,"memoizeOne");var zu=['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 Uy(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}o(Uy,"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 Wh(i,e,t){let r=ya(t,e),s=st(r.querySelectorAll(zu)),n=s.indexOf(document.activeElement);z2(r)?i.shiftKey&&n===0?j2(i,s):!i.shiftKey&&n===s.length-1&&Uy(i,s):Uy(i,s)}o(Wh,"trapFocus");function Dy(i,e,t){e===null||Wh(i,e,t)}o(Dy,"forInline");var Iy=be(Fc(),1);function Gh(){let i=!1;return(0,Iy.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 u=s.querySelector(zu);u?.focus({preventScroll:!0}),i=!1}},"superFocus"),260)}o(Gh,"createSuperFocus");var iv=be(ui(),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 jy=be(ui(),1),zy=be(Ny(),1);function $2(){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($2,"iconImage");function q2(){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(q2,"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:$2()}:t==="audio"?{color:"#068dbb",icon:q2()}: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(u=>Y2(u,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 Kh(i){let{file:e,i18n:t,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=i,u=e.preview?"rgba(255, 255, 255, 0.5)":Ms(e.type).color;return c("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:u}},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(Kh,"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 My(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(My,"progressIndicatorTitle");function Xh(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":My(i),title:My(i),onClick:()=>Q2(i)},i.children))}o(Xh,"ProgressIndicatorButton");function Hu(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(Hu,"ProgressCircleContainer");function Yh(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(Yh,"ProgressCircle");function Qh(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(Hu,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(Xh,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(Xh,i,c(Hu,null,c(Yh,{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(Xh,i,c(Hu,null,c(Yh,{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(Hu,null,c(Yh,{progress:i.file.progress.percentage}))))}o(Qh,"FileProgress");var By=be(Fn(),1);var Jh="...";function $u(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=Jh.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-Jh.length,r=Math.ceil(t/2),s=Math.floor(t/2);return i.slice(0,r)+Jh+i.slice(-s)}o($u,"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},$u(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"},$u(t.name,13)),r?c(vt,null,` ${s} `,r,` ${s} `):null):null},"renderAuthor"),e_=o(i=>i.file.size&&c("div",{className:"uppy-Dashboard-Item-statusSize"},(0,By.default)(i.file.size)),"renderFileSize"),t_=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"),i_=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 Zh(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(i_,{file:i.file,onClick:()=>alert(i.file.error)})),c("div",{className:"uppy-Dashboard-Item-status"},Z2(i),e_(i),t_(i)),c(wa,{file:i.file,i18n:i.i18n,toggleFileCard:i.toggleFileCard,metaFields:i.metaFields}))}o(Zh,"FileInfo");function ed(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(n=>{document.body.removeChild(r),window.prompt(e,i),t()},"magicCopyFailed");try{return document.execCommand("copy")?(document.body.removeChild(r),t()):s("copy command unavailable")}catch(n){return document.body.removeChild(r),s(n)}})}o(ed,"copyToClipboard");function r_(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(r_,"EditButton");function s_(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(s_,"RemoveButton");var o_=o((i,e)=>{ed(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 n_(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=>o_(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(n_,"CopyLinkButton");function td(i){let{uppy:e,file:t,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,showLinkToFileUploadResult:a,showRemoveButton:u,i18n:l,toggleFileCard:h,openFileEditor:d}=i;return c("div",{className:"uppy-Dashboard-Item-actionWrapper"},c(r_,{i18n:l,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(n_,{file:t,uppy:e,i18n:l}):null,u?c(s_,{i18n:l,file:t,uppy:e,onClick:()=>e.removeFile(t.id,"removed-by-user")}):null)}o(td,"Buttons");var Sa=class extends Te{static{o(this,"FileItem")}componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!(0,zy.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:u}=e,l=(this.props.individualCancellation||!n)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(l=!0);let h=(0,jy.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":u});return c("div",{className:h,id:`uppy_${e.id}`,role:this.props.role},c("div",{className:"uppy-Dashboard-Item-preview"},c(Kh,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),c(Qh,{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(Zh,{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(td,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function a_(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(a_,"chunks");function id(i){let{id:e,error:t,i18n:r,uppy:s,files:n,acquirers:a,resumableUploads:u,hideRetryButton:l,hidePauseResumeButton:h,hideCancelButton:d,showLinkToFileUploadResult:f,showRemoveButtonAfterComplete:y,isWide:b,metaFields:S,isSingleFile:A,toggleFileCard:O,handleRequestThumbnail:P,handleCancelThumbnail:R,recoveredState:H,individualCancellation:X,itemsPerRow:K,openFileEditor:V,canEditFile:W,toggleAddFilesPanel:te,containerWidth:re,containerHeight:Oe}=i,Re=K===1?71:200,$e=Bo(()=>{let _e=o((C,_)=>n[_].isGhost-n[C].isGhost,"sortByGhostComesFirst"),Le=Object.keys(n);return H&&Le.sort(_e),a_(Le,K)},[n,K,H]),we=o(_e=>c("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:_e[0]},_e.map(Le=>c(Sa,{key:Le,uppy:s,id:e,error:t,i18n:r,acquirers:a,resumableUploads:u,individualCancellation:X,hideRetryButton:l,hidePauseResumeButton:h,hideCancelButton:d,showLinkToFileUploadResult:f,showRemoveButtonAfterComplete:y,isWide:b,metaFields:S,recoveredState:H,isSingleFile:A,containerWidth:re,containerHeight:Oe,toggleFileCard:O,handleRequestThumbnail:P,handleCancelThumbnail:R,role:"listitem",openFileEditor:V,canEditFile:W,toggleAddFilesPanel:te,file:n[Le]}))),"renderRow");return A?c("div",{class:"uppy-Dashboard-files"},we($e[0])):c(Pu,{class:"uppy-Dashboard-files",role:"list",data:$e,renderRow:we,rowHeight:Re})}o(id,"FileList");var Hy;Hy=Symbol.for("uppy test: disable unused locale key warning");var rd=class extends Te{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 l=[...n],h=l.splice(n.length-2,n.length),d=o(f=>f.map(y=>{let{key:b,elements:S}=y;return c(vt,{key:b},S)}),"renderList");return c(vt,null,this.renderDropPasteBrowseTagline(n.length),c("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},d(l),c("span",{role:"presentation",style:{"white-space":"nowrap"}},d(h))))}}[Hy](){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=rd;var $y=be(ui(),1);var l_=o(i=>c("div",{className:(0,$y.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=l_;var Vy=be(ui(),1);function u_(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}o(u_,"ignoreEvent");var Yi=u_;function c_(i){let{activePickerPanel:e,className:t,hideAllPanels:r,i18n:s,state:n,uppy:a}=i;return c("div",{className:(0,Vy.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(c_,"PickerPanelContent");var Wy=c_;var Gy=be(ui(),1);function h_(i){let e=i.files[i.fileCardFor],t=o(()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()},"handleCancel");return c("div",{className:(0,Gy.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(h_,"EditorPanel");var Ky=h_;var Qi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function d_(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:u}=r[n[a]];if(u.uploadStarted&&!u.uploadComplete)return Qi.STATE_UPLOADING;u.preprocess&&s!==Qi.STATE_UPLOADING&&(s=Qi.STATE_PREPROCESSING),u.postprocess&&s!==Qi.STATE_UPLOADING&&s!==Qi.STATE_PREPROCESSING&&(s=Qi.STATE_POSTPROCESSING)}return s}o(d_,"getUploadingState");function p_(i){let{files:e,i18n:t,isAllComplete:r,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:a,newFiles:u,processingFiles:l}=i;switch(d_(s,r,n,e)){case"uploading":return t("uploadingXFiles",{smart_count:a.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:u.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}o(p_,"UploadStatus");function f_(i){let{i18n:e,isAllComplete:t,hideCancelButton:r,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:a}=i,{allowNewUpload:u}=i;return u&&s&&(u=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(p_,i)),u?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(f_,"PanelTopBar");var Xy=f_;var Yy=be(ui(),1);function sd(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(u=>{let l=`uppy-Dashboard-FileCard-input-${u.id}`,h=t.includes(u.id);return c("fieldset",{key:u.id,className:"uppy-Dashboard-FileCard-fieldset"},c("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},u.name),u.render!==void 0?u.render({value:n[u.id],onChange:d=>r(d,u.id),fieldCSSClasses:a,required:h,form:s.id},c):c("input",{className:a.text,id:l,form:s.id,type:u.type||"text",required:h,value:n[u.id],placeholder:u.placeholder,onInput:d=>r(d.target.value,u.id),"data-uppy-super-focusable":!0}))})}o(sd,"RenderMetaFields");function od(i){var e;let{files:t,fileCardFor:r,toggleFileCard:s,saveFileCard:n,metaFields:a,requiredMetaFields:u,openFileEditor:l,i18n:h,i18nArray:d,className:f,canEditFile:y}=i,b=o(()=>typeof a=="function"?a(t[r]):a,"getMetaFields"),S=t[r],A=(e=b())!=null?e:[],O=y(S),P={};A.forEach(te=>{var re;P[te.id]=(re=S.meta[te.id])!=null?re:""});let[R,H]=vr(P),X=Rs(te=>{te.preventDefault(),n(R,r)},[n,R,r]),K=o((te,re)=>{H({...R,[re]:te})},"updateMeta"),V=o(()=>{s(!1)},"handleCancel"),[W]=vr(()=>{let te=document.createElement("form");return te.setAttribute("tabindex","-1"),te.id=Yt(),te});return Ki(()=>(document.body.appendChild(W),W.addEventListener("submit",X),()=>{W.removeEventListener("submit",X),document.body.removeChild(W)}),[W,X]),c("div",{className:(0,Yy.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:W.id,title:h("finishEditingFile"),onClick:V},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}),O&&c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:te=>{X(te),l(S)}},h("editImage"))),c("div",{className:"uppy-Dashboard-FileCard-info"},c(sd,{computedMetaFields:A,requiredMetaFields:u,updateMeta:K,form:W,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:W.id},h("saveChanges")),c("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:V,form:W.id},h("cancel")))))}o(od,"FileCard");var Jy=be(ui(),1);var Ko="uppy-transition-slideDownUp",Qy=250;function m_(i){let{children:e}=i,[t,r]=vr(null),[s,n]=vr(""),a=Ts(),u=Ts(),l=Ts(),h=o(()=>{n(`${Ko}-enter`),cancelAnimationFrame(l.current),clearTimeout(u.current),u.current=void 0,l.current=requestAnimationFrame(()=>{n(`${Ko}-enter ${Ko}-enter-active`),a.current=setTimeout(()=>{n("")},Qy)})},"handleEnterTransition"),d=o(()=>{n(`${Ko}-leave`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{n(`${Ko}-leave ${Ko}-leave-active`),u.current=setTimeout(()=>{r(null),n("")},Qy)})},"handleLeaveTransition");return Ki(()=>{let f=Pi(e)[0];t!==f&&(f&&!t?h():t&&!f&&!u.current&&d(),r(f))},[e,t]),Ki(()=>()=>{clearTimeout(a.current),clearTimeout(u.current),cancelAnimationFrame(l.current)},[]),t?ou(t,{className:(0,Jy.default)(s,t.props.className)}):null}o(m_,"Slide");var _a=m_;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 Zy=900,ev=700,nd=576,tv=330;function ad(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>nd,s=i.containerHeight>tv,n=(0,iv.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>nd,"uppy-size--lg":i.containerWidth>ev,"uppy-size--xl":i.containerWidth>Zy,"uppy-size--height-md":i.containerHeight>tv,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&s}),a=1;i.containerWidth>Zy?a=5:i.containerWidth>ev?a=4:i.containerWidth>nd&&(a=3);let u=i.showSelectedFiles&&!e,l=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")),u&&c(Xy,i),l&&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())),u?c(id,{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(_a,null,i.showAddFilesPanel?c(qy,Bs({key:"AddFiles"},i,{isSizeMD:r})):null),c(_a,null,i.fileCardFor?c(od,Bs({key:"FileCard"},i)):null),c(_a,null,i.activePickerPanel?c(Wy,Bs({key:"Picker"},i)):null),c(_a,null,i.showFileEditor?c(Ky,Bs({key:"Editor"},i)):null),c("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(y=>i.uppy.getPlugin(y.id).render(i.state))))))}o(ad,"Dashboard");var rv={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 Ie(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Ie,"_classPrivateFieldLooseBase");var g_=0;function Mi(i){return"__private_"+g_+++"_"+i}o(Mi,"_classPrivateFieldLooseKey");var y_={version:"3.8.3"},ld=Vh.default||Vh,sv=9,v_=27;function ov(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}o(ov,"createPromise");var b_={target:"body",metaFields:[],inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:zo,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:null,onRequestCloseModal:null},js=Mi("disabledNodes"),Er=Mi("generateLargeThumbnailIfSingleFile"),Pa=Mi("openFileEditorWhenFilesAdded"),zs=Mi("attachRenderFunctionToTarget"),ud=Mi("isTargetSupported"),cd=Mi("getAcquirers"),hd=Mi("getProgressIndicators"),Or=Mi("getEditors"),dd=Mi("addSpecifiedPluginsFromOptions"),pd=Mi("autoDiscoverPlugins"),Hs=Mi("addSupportedPluginIfNoTarget"),$s=class extends ae{static{o(this,"Dashboard")}constructor(e,t){var r,s,n,a;let u;t?t.autoOpen===void 0?u=t.autoOpenFileEditor?"imageEditor":null:u=t.autoOpen:u=null,super(e,{...b_,...t,autoOpen:u}),Object.defineProperty(this,js,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${Yt()}`,this.superFocus=Gh(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=l=>{let d=this.getPluginState().targets.filter(f=>f.id!==l.id);this.setPluginState({targets:d})},this.addTarget=l=>{let h=l.id||l.constructor.name,d=l.title||h,f=l.type;if(f!=="acquirer"&&f!=="progressindicator"&&f!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let y={id:h,name:d,type:f},S=this.getPluginState().targets.slice();return S.push(y),this.setPluginState({targets:S}),this.el},this.hideAllPanels=()=>{var l;let h=this.getPluginState(),d={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};h.activePickerPanel===d.activePickerPanel&&h.showAddFilesPanel===d.showAddFilesPanel&&h.showFileEditor===d.showFileEditor&&h.activeOverlayType===d.activeOverlayType||(this.setPluginState(d),this.uppy.emit("dashboard:close-panel",(l=h.activePickerPanel)==null?void 0:l.id))},this.showPanel=l=>{let{targets:h}=this.getPluginState(),d=h.find(f=>f.type==="acquirer"&&f.id===l);this.setPluginState({activePickerPanel:d,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",l)},this.canEditFile=l=>{let{targets:h}=this.getPluginState();return Ie(this,Or)[Or](h).some(f=>this.uppy.getPlugin(f.id).canEditFile(l))},this.openFileEditor=l=>{let{targets:h}=this.getPluginState(),d=Ie(this,Or)[Or](h);this.setPluginState({showFileEditor:!0,fileCardFor:l.id||null,activeOverlayType:"FileEditor"}),d.forEach(f=>{this.uppy.getPlugin(f.id).selectFile(l)})},this.closeFileEditor=()=>{let{metaFields:l}=this.getPluginState();l&&l.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:l}=this.getPluginState();Ie(this,Or)[Or](l).forEach(d=>{this.uppy.getPlugin(d.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:l,resolve:h}=ov();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 d=o(()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",d,!1),h()},"handler");this.el.addEventListener("animationend",d,!1)}else this.setPluginState({isHidden:!1}),h();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),l},this.closeModal=l=>{var h;let d=(h=l?.manualClose)!=null?h:!0,{isHidden:f,isClosing:y}=this.getPluginState();if(f||y)return;let{promise:b,resolve:S}=ov();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let O=o(()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",O,!1),S()},"handler");this.el.addEventListener("animationend",O,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),S();if(document.removeEventListener("keydown",this.handleKeyDownInModal),d&&this.opts.browserBackButtonClose){var A;(A=history.state)!=null&&A[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),b},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=l=>{let{capabilities:h}=this.uppy.getState();this.uppy.setState({capabilities:{...h,darkMode:l}})},this.handleSystemDarkModeChange=l=>{let h=l.matches;this.uppy.log(`[Dashboard] Dark mode is ${h?"on":"off"}`),this.setDarkModeCapability(h)},this.toggleFileCard=(l,h)=>{let d=this.uppy.getFile(h);l?this.uppy.emit("dashboard:file-edit-start",d):this.uppy.emit("dashboard:file-edit-complete",d),this.setPluginState({fileCardFor:l?h:null,activeOverlayType:l?"FileCard":null})},this.toggleAddFilesPanel=l=>{this.setPluginState({showAddFilesPanel:l,activeOverlayType:l?"AddFiles":null})},this.addFiles=l=>{let h=l.map(d=>({source:this.id,name:d.name,type:d.type,data:d,meta:{relativePath:d.relativePath||d.webkitRelativePath||null}}));try{this.uppy.addFiles(h)}catch(d){this.uppy.log(d)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(l=>{let h=l[0],{width:d,height:f}=h.contentRect;this.setPluginState({containerWidth:d,containerHeight:f,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let l=this.getPluginState(),h=!this.opts.inline&&l.isHidden;!l.areInsidesReadyToBeVisible&&!h&&(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=l=>{this.el.contains(l.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=l=>{var h;let d=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],f=(h=Ie(this,js)[js])!=null?h:st(this.el.querySelectorAll(d)).filter(y=>!y.classList.contains("uppy-Dashboard-close"));for(let y of f)y.tagName==="A"?y.setAttribute("aria-disabled",l):y.disabled=l;l?Ie(this,js)[js]=f:Ie(this,js)[js]=null,this.dashboardIsDisabled=l},this.updateBrowserHistory=()=>{var l;(l=history.state)!=null&&l[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=l=>{var h;this.isModalOpen()&&(!l.state||!l.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(h=l.state)!=null&&h[this.modalName]&&history.back()},this.handleKeyDownInModal=l=>{l.keyCode===v_&&this.requestCloseModal(),l.keyCode===sv&&Wh(l,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=l=>{this.uppy.iteratePlugins(d=>{d.type==="acquirer"&&(d.handleRootPaste==null||d.handleRootPaste(l))});let h=st(l.clipboardData.files);h.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(h))},this.handleInputChange=l=>{l.preventDefault();let h=st(l.target.files);h.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(h))},this.handleDragOver=l=>{var h,d;l.preventDefault(),l.stopPropagation();let f=o(()=>{let A=!0;return this.uppy.iteratePlugins(O=>{O.canHandleRootDrop!=null&&O.canHandleRootDrop(l)&&(A=!0)}),A},"canSomePluginHandleRootDrop"),y=o(()=>{let{types:A}=l.dataTransfer;return A.some(O=>O==="Files")},"doesEventHaveFiles"),b=f(),S=y();if(!b&&!S||this.opts.disabled||this.opts.disableLocalFiles&&(S||!b)||!this.uppy.getState().allowNewUpload){l.dataTransfer.dropEffect="none",clearTimeout(this.removeDragOverClassTimeout);return}l.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),(h=(d=this.opts).onDragOver)==null||h.call(d,l)},this.handleDragLeave=l=>{var h,d;l.preventDefault(),l.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout(()=>{this.setPluginState({isDraggingOver:!1})},50),(h=(d=this.opts).onDragLeave)==null||h.call(d,l)},this.handleDrop=async l=>{var h,d;l.preventDefault(),l.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(S=>{S.type==="acquirer"&&(S.handleRootDrop==null||S.handleRootDrop(l))});let f=!1,y=o(S=>{this.uppy.log(S,"error"),f||(this.uppy.info(S.message,"error"),f=!0)},"logDropError");this.uppy.log("[Dashboard] Processing dropped files");let b=await Ns(l.dataTransfer,{logDropError:y});b.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(b)),(h=(d=this.opts).onDrop)==null||h.call(d,l)},this.handleRequestThumbnail=l=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",l)},this.handleCancelThumbnail=l=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",l)},this.handleKeyDownInInline=l=>{l.keyCode===sv&&Dy(l,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=l=>{this.el.contains(document.activeElement)&&this.handlePaste(l)},this.handleComplete=l=>{let{failed:h}=l;this.opts.closeAfterFinish&&!(h!=null&&h.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Er,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let l=600,h=this.uppy.getFiles();if(h.length===1){let d=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);d?.setOptions({thumbnailWidth:l});let f={...h[0],preview:void 0};d?.requestThumbnail(f).then(()=>{d?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,Pa,{writable:!0,value:l=>{let h=l[0],{metaFields:d}=this.getPluginState(),f=d&&d.length>0,y=this.canEditFile(h);f&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,h.id):y&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(h)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let l=Hh(this.opts.trigger);l?l.forEach(h=>h.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",Ie(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",Ie(this,Er)[Er]),this.uppy.on("file-removed",Ie(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",Ie(this,Pa)[Pa])},this.removeEvents=()=>{let l=Hh(this.opts.trigger);!this.opts.inline&&l&&l.forEach(h=>h.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",Ie(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",Ie(this,Er)[Er]),this.uppy.off("file-removed",Ie(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",Ie(this,Pa)[Pa])},this.superFocusOnEachUpdate=()=>{let l=this.el.contains(document.activeElement),h=document.activeElement===document.body||document.activeElement===null,d=this.uppy.getState().info.length===0,f=!this.opts.inline;d&&(f||l||h&&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=(l,h)=>{this.uppy.setFileMeta(h,l),this.toggleFileCard(!1,h)},Object.defineProperty(this,zs,{writable:!0,value:l=>{let h=this.uppy.getPlugin(l.id);return{...l,icon:h.icon||this.opts.defaultPickerIcon,render:h.render}}}),Object.defineProperty(this,ud,{writable:!0,value:l=>{let h=this.uppy.getPlugin(l.id);return typeof h.isSupported!="function"?!0:h.isSupported()}}),Object.defineProperty(this,cd,{writable:!0,value:ld(l=>l.filter(h=>h.type==="acquirer"&&Ie(this,ud)[ud](h)).map(Ie(this,zs)[zs]))}),Object.defineProperty(this,hd,{writable:!0,value:ld(l=>l.filter(h=>h.type==="progressindicator").map(Ie(this,zs)[zs]))}),Object.defineProperty(this,Or,{writable:!0,value:ld(l=>l.filter(h=>h.type==="editor").map(Ie(this,zs)[zs]))}),this.render=l=>{let h=this.getPluginState(),{files:d,capabilities:f,allowNewUpload:y}=l,{newFiles:b,uploadStartedFiles:S,completeFiles:A,erroredFiles:O,inProgressFiles:P,inProgressNotPausedFiles:R,processingFiles:H,isUploadStarted:X,isAllComplete:K,isAllErrored:V,isAllPaused:W}=this.uppy.getObjectOfFilesPerState(),te=Ie(this,cd)[cd](h.targets),re=Ie(this,hd)[hd](h.targets),Oe=Ie(this,Or)[Or](h.targets),Re;return this.opts.theme==="auto"?Re=f.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}".`)),ad({state:l,isHidden:h.isHidden,files:d,newFiles:b,uploadStartedFiles:S,completeFiles:A,erroredFiles:O,inProgressFiles:P,inProgressNotPausedFiles:R,processingFiles:H,isUploadStarted:X,isAllComplete:K,isAllErrored:V,isAllPaused:W,totalFileCount:Object.keys(d).length,totalProgress:l.totalProgress,allowNewUpload:y,acquirers:te,theme:Re,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:h.activePickerPanel,showFileEditor:h.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:h.isClosing,progressindicators:re,editors:Oe,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:l.recoveredState,metaFields:h.metaFields,resumableUploads:f.resumableUploads||!1,individualCancellation:f.individualCancellation,isMobileDevice:f.isMobileDevice,fileCardFor:h.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:h.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:h.containerWidth,containerHeight:h.containerHeight,areInsidesReadyToBeVisible:h.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:h.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,dd,{writable:!0,value:()=>{(this.opts.plugins||[]).forEach(h=>{let d=this.uppy.getPlugin(h);d?d.mount(this,d):this.uppy.log(`[Uppy] Dashboard could not find plugin '${h}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,pd,{writable:!0,value:()=>{this.uppy.iteratePlugins(Ie(this,Hs)[Hs])}}),Object.defineProperty(this,Hs,{writable:!0,value:l=>{var h;let d=["acquirer","editor"];l&&!((h=l.opts)!=null&&h.target)&&d.includes(l.type)&&(this.getPluginState().targets.some(y=>l.id===y.id)||l.mount(this,l))}}),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:l,closeAfterFinish:h}=this.opts;if(l&&h)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:d,allowMultipleUploadBatches:f}=this.uppy.opts;(d||f)&&h&&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:y}=this.opts;y&&this.mount(y,this),this.opts.disableStatusBar||this.uppy.use(Fr,{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(xr,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(ss,{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 b=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${b?"on":"off"}`),this.setDarkModeCapability(b),this.opts.theme==="auto"){var S;(S=this.darkModeMediaQuery)==null||S.addListener(this.handleSystemDarkModeChange)}Ie(this,dd)[dd](),Ie(this,pd)[pd](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let d=this.uppy.getPlugin(`${this.id}:Informer`);d&&this.uppy.removePlugin(d)}if(!this.opts.disableStatusBar){let d=this.uppy.getPlugin(`${this.id}:StatusBar`);d&&this.uppy.removePlugin(d)}if(!this.opts.disableThumbnailGenerator){let d=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);d&&this.uppy.removePlugin(d)}if((this.opts.plugins||[]).forEach(d=>{let f=this.uppy.getPlugin(d);f&&f.unmount()}),this.opts.theme==="auto"){var h;(h=this.darkModeMediaQuery)==null||h.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=rv,(s=(r=this.opts).doneButtonHandler)!=null||(r.doneButtonHandler=()=>{this.uppy.clearUploadedFiles(),this.requestCloseModal()}),(a=(n=this.opts).onRequestCloseModal)!=null||(n.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}};$s.VERSION=y_.version;var nv={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var w_={version:"3.1.0"},S_={inputName:"files[]",width:"100%",height:"100%"},qs=class i extends ae{static{o(this,"DragDrop")}constructor(e,t){super(e,{...S_,...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=st(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,u=a.some(h=>h==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!u||!l){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(l=>{this.uppy.log(l,"error")},"logDropError"),u=await Ns(r.dataTransfer,{logDropError:a});u.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(u)),(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=nv,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()}};qs.VERSION=w_.version;var __={version:"2.1.0"},P_={target:null};function fd(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(fd,"isFileTransfer");var Xo=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(!fd(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 u=!1,l=o(d=>{this.uppy.log(d,"error"),u||(this.uppy.info(d.message,"error"),u=!0)},"logDropError"),h=await Ns(r.dataTransfer,{logDropError:l});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;fd(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(!fd(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=st(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()}};Xo.VERSION=__.version;var av={strings:{chooseFiles:"Choose files"}};var F_={version:"3.1.2"},x_={pretty:!0,inputName:"files[]"},Vs=class extends ae{static{o(this,"FileInput")}constructor(e,t){super(e,{...x_,...t}),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=av,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=st(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=F_.version;var pv=be(lv(),1);function E_(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,u=(i.width-n)/2,l=(i.height-a)/2;return{width:n,height:a,left:u,top:l}}o(E_,"getCanvasDataThatFitsPerfectlyIntoContainer");var uv=E_;function O_(i){return i*(Math.PI/180)}o(O_,"toRadians");function C_(i,e,t){let r=Math.abs(O_(t));return Math.max((Math.sin(r)*i+Math.cos(r)*e)/e,(Math.sin(r)*e+Math.cos(r)*i)/i)}o(C_,"getScaleFactorThatRemovesDarkCorners");var cv=C_;function A_(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(A_,"limitCropboxMovementOnMove");var hv=A_;function T_(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(T_,"limitCropboxMovementOnResize");var dv=T_;var Fa=class extends Te{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=uv(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(),u=cv(a.naturalWidth,a.naturalHeight,r),l=this.cropper.getImageData().scaleX<0?-u:u;this.cropper.scale(l,u)},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 pv.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=hv(t,r,s);n&&this.cropper.setCropBoxData(n)}else{let n=dv(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 fv={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 R_={version:"2.4.6"},mv={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},gv={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},k_={quality:.8,actions:gv,cropperOptions:mv},Ws=class extends ae{static{o(this,"ImageEditor")}constructor(e,t){super(e,{...k_,...t,actions:{...gv,...t?.actions},cropperOptions:{...mv,...t?.cropperOptions}}),this.save=()=>{let r=o(a=>{let{currentImage:u}=this.getPluginState();this.uppy.setFileState(u.id,{data:new File([a],u.name,{type:a.type}),size:a.size,preview:void 0});let l=this.uppy.getFile(u.id);this.uppy.emit("thumbnail:request",l),this.setPluginState({currentImage:l}),this.uppy.emit("file-editor:complete",l)},"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=fv,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(Fa,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};Ws.VERSION=R_.version;var U_={version:"3.1.1"},D_={target:"body",fixed:!1,hideAfterFinish:!0},Gs=class extends ae{static{o(this,"ProgressBar")}constructor(e,t){super(e,{...D_,...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=U_.version;var I_={__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),I_[i]||null}o(Ji,"getFileTypeExtension");function yd(){var i;return typeof MediaRecorder=="function"&&typeof((i=MediaRecorder.prototype)==null?void 0:i.start)=="function"}o(yd,"supportsMediaRecorder");function vd(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(vd,"RecordButton");function bd(i){return`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`}o(bd,"formatSeconds");function wd(i){let{recordingLengthSeconds:e,i18n:t}=i,r=bd(e);return c("span",{"aria-label":t("recordingLength",{recording_length:r})},r)}o(wd,"RecordingLength");var yv=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 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 N_=0;function M_(i){return"__private_"+N_+++"_"+i}o(M_,"_classPrivateFieldLooseKey");function vv(i){return typeof i=="function"}o(vv,"isFunction");function xa(i){return vv(i)?i():i}o(xa,"result");var Sd=M_("draw"),Ea=class{static{o(this,"AudioOscilloscope")}constructor(e,t){t===void 0&&(t={}),Object.defineProperty(this,Sd,{writable:!0,value:()=>this.draw()});let r=t.canvas||{},s=t.canvasContext||{};this.analyser=null,this.bufferLength=0,this.canvas=e,this.width=xa(r.width)||this.canvas.width,this.height=xa(r.height)||this.canvas.height,this.canvas.width=this.width,this.canvas.height=this.height,this.canvasContext=this.canvas.getContext("2d"),this.canvasContext.fillStyle=xa(s.fillStyle)||"rgb(255, 255, 255)",this.canvasContext.strokeStyle=xa(s.strokeStyle)||"rgb(0, 0, 0)",this.canvasContext.lineWidth=xa(s.lineWidth)||1,this.onDrawFrame=vv(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 u=n*1/r,l=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(l,f):s.lineTo(l,f),l+=u}s.lineTo(n,a/2),s.stroke(),this.onDrawFrame(this),requestAnimationFrame(L_(this,Sd)[Sd])}};function B_(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(B_,"SubmitButton");var bv=B_;function j_(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(j_,"DiscardButton");var wv=j_;function _d(i){let{stream:e,recordedAudio:t,onStop:r,recording:s,supportsRecording:n,audioSources:a,showAudioSourceDropdown:u,onSubmit:l,i18n:h,onStartRecording:d,onStopRecording:f,onDiscardRecordedAudio:y,recordingLengthSeconds:b}=i,S=Ts(null),A=Ts();Ki(()=>()=>{A.current=null,r()},[r]),Ki(()=>{if(!t&&(A.current=new Ea(S.current,{canvas:{width:600,height:600},canvasContext:{lineWidth:2,fillStyle:"rgb(0,0,0)",strokeStyle:"green"}}),A.current.draw(),e)){let X=new AudioContext().createMediaStreamSource(e);A.current.addSource(X)}},[t,e]);let O=t!=null,P=!O&&n,R=u&&!O&&a&&a.length>1;return c("div",{className:"uppy-Audio-container"},c("div",{className:"uppy-Audio-audioContainer"},O?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?yv(i):null),c("div",{className:"uppy-Audio-buttonContainer"},P&&c(vd,{recording:s,onStartRecording:d,onStopRecording:f,i18n:h}),O&&c(bv,{onSubmit:l,i18n:h}),O&&c(wv,{onDiscard:y,i18n:h})),c("div",{className:"uppy-Audio-recordingLength"},!O&&c(wd,{recordingLengthSeconds:b,i18n:h}))))}o(_d,"RecordingScreen");var Sv=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 _v={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 Ad(){return Ad=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},Ad.apply(this,arguments)}o(Ad,"_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 z_=0;function xt(i){return"__private_"+z_+++"_"+i}o(xt,"_classPrivateFieldLooseKey");var H_={version:"1.1.9"},Pt=xt("stream"),Cr=xt("audioActive"),ze=xt("recordingChunks"),je=xt("recorder"),Ar=xt("capturedMediaFile"),Ft=xt("mediaDevices"),Oa=xt("supportsUserMedia"),Pd=xt("hasAudioCheck"),Ks=xt("start"),Fd=xt("startRecording"),Ca=xt("stopRecording"),xd=xt("discardRecordedAudio"),Ed=xt("submit"),Tr=xt("stop"),Od=xt("getAudio"),Cd=xt("changeSource"),Xs=xt("updateSources"),Ys=class extends ae{static{o(this,"Audio")}constructor(e,t){super(e,t),Object.defineProperty(this,Od,{value:q_}),Object.defineProperty(this,Pd,{value:$_}),Object.defineProperty(this,Pt,{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,Ft,{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,Ft)[Ft].getUserMedia({audio:!0}).then(n=>{Z(this,Pt)[Pt]=n;let a=null,u=n.getAudioTracks();r!=null&&r.deviceId?a=u.findLast(l=>l.getSettings().deviceId===r.deviceId):a=u[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,Fd,{writable:!0,value:()=>{Z(this,je)[je]=new MediaRecorder(Z(this,Pt)[Pt]),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),l=(a-Z(this,ze)[ze][0].size)/(Z(this,ze)[ze].length-1)*3,h=Math.max(0,n.maxFileSize-l);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,Od)[Od]())).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,Ed,{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,Pt)[Pt]&&Z(this,Pt)[Pt].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,Pt)[Pt]=null,this.setPluginState({recordedAudio:null,isRecording:!1,recordingLengthSeconds:0})}}),Object.defineProperty(this,Cd,{writable:!0,value:r=>{Z(this,Tr)[Tr](),Z(this,Ks)[Ks]({deviceId:r})}}),Object.defineProperty(this,Xs,{writable:!0,value:()=>{Z(this,Ft)[Ft].enumerateDevices().then(r=>{this.setPluginState({audioSources:r.filter(s=>s.kind==="audioinput")})})}}),Z(this,Ft)[Ft]=navigator.mediaDevices,Z(this,Oa)[Oa]=Z(this,Ft)[Ft]!=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=_v,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(Sv,{icon:this.icon,i18n:this.i18n,hasAudio:e.hasAudio}):c(_d,Ad({},e,{audioActive:Z(this,Cr)[Cr],onChangeSource:Z(this,Cd)[Cd],onStartRecording:Z(this,Fd)[Fd],onStopRecording:Z(this,Ca)[Ca],onDiscardRecordedAudio:Z(this,xd)[xd],onSubmit:Z(this,Ed)[Ed],onStop:Z(this,Tr)[Tr],i18n:this.i18n,showAudioSourceDropdown:this.opts.showAudioSourceDropdown,supportsRecording:yd(),recording:e.isRecording,stream:Z(this,Pt)[Pt]}))}install(){this.setPluginState({audioReady:!1,recordingLengthSeconds:0});let{target:e}=this.opts;e&&this.mount(e,this),Z(this,Ft)[Ft]&&(Z(this,Xs)[Xs](),Z(this,Ft)[Ft].ondevicechange=()=>{if(Z(this,Xs)[Xs](),Z(this,Pt)[Pt]){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,Pt)[Pt]&&Z(this,Tr)[Tr](),this.unmount()}};function $_(){return Z(this,Ft)[Ft]?Z(this,Ft)[Ft].enumerateDevices().then(i=>i.some(e=>e.kind==="audioinput")):Promise.resolve(!1)}o($_,"_hasAudioCheck2");function q_(){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(q_,"_getAudio2");Ys.VERSION=H_.version;var Pv={strings:{pluginNameBox:"Box"}};var V_={version:"2.3.1"},Rr=class extends ae{static{o(this,"Box")}constructor(e,t){super(e,t),this.id=this.opts.id||"Box",this.type="acquirer",this.storage=this.opts.storage||ct,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=ut(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new lt(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 Qe(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.view.render(e)}};Rr.VERSION=V_.version;var Fv={strings:{pluginNameDropbox:"Dropbox"}};var W_={version:"3.3.1"},kr=class extends ae{static{o(this,"Dropbox")}constructor(e,t){super(e,t),this.id=this.opts.id||"Dropbox",this.type="acquirer",this.storage=this.opts.storage||ct,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=ut(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new lt(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=Fv,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 Qe(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.view.render(e)}};kr.VERSION=W_.version;var xv={strings:{pluginNameFacebook:"Facebook"}};var G_={version:"3.3.1"},Ur=class extends ae{static{o(this,"Facebook")}constructor(e,t){super(e,t),this.id=this.opts.id||"Facebook",this.type="acquirer",this.storage=this.opts.storage||ct,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=ut(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new lt(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 Qe(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=G_.version;var Aa=class extends Qe{static{o(this,"DriveProviderViews")}toggleCheckbox(e,t){e.stopPropagation(),e.preventDefault(),t.custom.isSharedDrive||super.toggleCheckbox(e,t)}};var Ev={strings:{pluginNameGoogleDrive:"Google Drive"}};var K_={version:"3.5.1"},Dr=class extends ae{static{o(this,"GoogleDrive")}constructor(e,t){super(e,t),this.type="acquirer",this.storage=this.opts.storage||ct,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=ut(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new lt(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=Ev,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});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=K_.version;var Ov={strings:{pluginNameInstagram:"Instagram"}};var X_={version:"3.3.1"},Ir=class extends ae{static{o(this,"Instagram")}constructor(e,t){super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||ct,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=ut(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new lt(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 Qe(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)}};Ir.VERSION=X_.version;var Cv={strings:{pluginNameOneDrive:"OneDrive"}};var Y_={version:"3.3.1"},Lr=class extends ae{static{o(this,"OneDrive")}constructor(e,t){super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||ct,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=ut(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new lt(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 Qe(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.view.render(e)}};Lr.VERSION=Y_.version;var Q_={version:"3.3.1"},Nr=class extends ae{static{o(this,"Unsplash")}constructor(e,t){if(super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||ct,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=ut(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()}};Nr.VERSION=Q_.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 J_=0;function Z_(i){return"__private_"+J_+++"_"+i}o(Z_,"_classPrivateFieldLooseKey");var Ta=Z_("handleSubmit"),Td=class extends Te{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=Yt()}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=Td;function Vu(i,e,t){let r=st(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(Vu,"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,eP={version:"3.6.1"};function tP(){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(tP,"UrlIcon");function iP(i){let e=/^[a-z0-9]+:\/\//,t="http://";return e.test(i)?i:t+i}o(iP,"addProtocolToURL");function rP(i){return st(i.dataTransfer.items).filter(r=>r.kind==="string"&&r.type==="text/uri-list").length>0}o(rP,"canHandleRootDrop");function sP(i){return i?.startsWith("http://")||i?.startsWith("https://")}o(sP,"checkIfCorrectURL");function oP(i){let{pathname:e}=new URL(i);return e.substring(e.lastIndexOf("/")+1)}o(oP,"getFileNameFromUrl");var Oi=class i extends ae{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=iP(r);if(!sP(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),u={meta:s,source:this.id,name:a.name||oP(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(u)}catch(l){return l.isRestriction||this.uppy.log(l),l}}catch(a){return this.uppy.log(a),this.uppy.info({message:this.i18n("failedToFetch"),details:a},"error",4e3),a}},this.handleRootDrop=r=>{Vu(r.dataTransfer,"drop",s=>{this.uppy.log(`[URL] Adding file from dropped url: ${s}`),this.addFile(s)})},this.handleRootPaste=r=>{Vu(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(tP,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 Lt(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=Oi;Oi.VERSION=eP.version;Oi.requestClientId=kv.name;Oi.prototype.canHandleRootDrop=rP;var Uv={strings:{pluginNameZoom:"Zoom"}};var nP={version:"2.3.1"},Mr=class extends ae{static{o(this,"Zoom")}constructor(e,t){super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||ct,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=ut(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new lt(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 Qe(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)}};Mr.VERSION=nP.version;function Rd(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Rd,"_classPrivateFieldLooseBase");var aP=0;function lP(i){return"__private_"+aP+++"_"+i}o(lP,"_classPrivateFieldLooseKey");var uP={version:"1.2.0"},kd={__proto__:null,Box:Rr,Dropbox:kr,Facebook:Ur,GoogleDrive:Dr,Instagram:Ir,OneDrive:Lr,Unsplash:Nr,Url:Oi,Zoom:Mr},cP={sources:Object.keys(kd)},Qs=lP("installedPlugins"),Yo=class extends Ee{static{o(this,"RemoteSources")}constructor(e,t){if(super(e,{...cP,...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=kd[e];if(r==null){let s=Object.keys(kd),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),Rd(this,Qs)[Qs].add(this.uppy.getPlugin(e))})}uninstall(){for(let e of Rd(this,Qs)[Qs])this.uppy.removePlugin(e);Rd(this,Qs)[Qs].clear()}};Yo.VERSION=uP.version;function Ud(){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(Ud,"ScreenRecIcon");function Dd(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(Dd,"RecordButton");function Id(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(Id,"SubmitButton");function hP(i){return(i-(i%=60))/60+(i>9?":":":0")+i}o(hP,"fmtMSS");var Ld=class extends Te{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=hP(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=Ld;function Nd(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(Nd,"StreamStatus");function Md(){return Md=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},Md.apply(this,arguments)}o(Md,"_extends");var Bd=class extends Te{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(Nd,this.props),c("video",Md({ref:n=>{this.videoElement=n},className:"uppy-ScreenCapture-video"},s)),c(Dv,this.props)),c("div",{className:"uppy-ScreenCapture-buttonContainer"},c(Dd,this.props),c(Id,this.props)))}},Iv=Bd;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 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");var dP={version:"3.2.0"};function pP(){var i;return window.MediaRecorder&&((i=navigator.mediaDevices)==null?void 0:i.getDisplayMedia)}o(pP,"isScreenRecordingSupported");function fP(){return window.MediaRecorder&&navigator.mediaDevices}o(fP,"getMediaDevices");var mP={displayMediaConstraints:{video:{width:1280,height:720,frameRate:{ideal:3,max:5},cursor:"motion",displaySurface:"monitor"}},userMediaConstraints:{audio:!0},preferredVideoMimeType:"video/webm"},Js=class extends ae{static{o(this,"ScreenCapture")}constructor(e,t){super(e,{...mP,...t}),this.mediaDevices=fP(),this.protocol=location.protocol==="https:"?"https":"http",this.id=this.opts.id||"ScreenCapture",this.title=this.opts.title||"Screencast",this.type="acquirer",this.icon=Ud,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(!pP())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,jd({},e,{onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onStop:this.stop,onSubmit:this.submit,i18n:this.i18n,stream:this.videoStream}))}};Js.VERSION=dP.version;var $v=be(Nv(),1);function Hd(i,e,t){return new Promise(r=>{i.toBlob(r,e,t)})}o(Hd,"canvasToBlob");function $d(){return typeof MediaRecorder=="function"&&!!MediaRecorder.prototype&&typeof MediaRecorder.prototype.start=="function"}o($d,"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 Vd(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(Vd,"RecordButton");function Wd(i){return`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`}o(Wd,"formatSeconds");function Gd(i){let{recordingLengthSeconds:e,i18n:t}=i,r=Wd(e);return c("span",{"aria-label":t("recordingLength",{recording_length:r})},r)}o(Gd,"RecordingLength");function Kd(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(Kd,"VideoSourceSelect");function bP(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(bP,"SubmitButton");var Mv=bP;function wP(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(wP,"DiscardButton");var Bv=wP;function Xd(){return Xd=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},Xd.apply(this,arguments)}o(Xd,"_extends");function Gu(i,e){return i.includes(e)}o(Gu,"isModeAvailable");var Yd=class extends Te{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:u,showRecordingLength:l,onSubmit:h,i18n:d,mirror:f,onSnapshot:y,onStartRecording:b,onStopRecording:S,onDiscardRecordedVideo:A,recordingLengthSeconds:O}=this.props,P=!!t,R=!P&&n&&(Gu(s,"video-only")||Gu(s,"audio-only")||Gu(s,"video-audio")),H=!P&&Gu(s,"picture"),X=n&&l&&!P,K=u&&a&&a.length>1,V={playsInline:!0};return t?(V.muted=!1,V.controls=!0,V.src=t,this.videoElement&&(this.videoElement.srcObject=null)):(V.muted=!0,V.autoPlay=!0,V.srcObject=e),c("div",{className:"uppy uppy-Webcam-container"},c("div",{className:"uppy-Webcam-videoContainer"},c("video",Xd({ref:W=>this.videoElement=W,className:`uppy-Webcam-video ${f?"uppy-Webcam-video--mirrored":""}`},V))),c("div",{className:"uppy-Webcam-footer"},c("div",{className:"uppy-Webcam-videoSourceContainer"},K?Kd(this.props):null),c("div",{className:"uppy-Webcam-buttonContainer"},H&&c(qd,{onSnapshot:y,i18n:d}),R&&c(Vd,{recording:r,onStartRecording:b,onStopRecording:S,i18n:d}),P&&c(Mv,{onSubmit:h,i18n:d}),P&&c(Bv,{onDiscard:A,i18n:d})),c("div",{className:"uppy-Webcam-recordingLength"},X&&c(Gd,{recordingLengthSeconds:O,i18n:d}))))}},jv=Yd;function Qd(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(Qd,"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 Zd(){return Zd=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},Zd.apply(this,arguments)}o(Zd,"_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 SP=0;function _P(i){return"__private_"+SP+++"_"+i}o(_P,"_classPrivateFieldLooseKey");var PP={version:"3.4.1"};function Hv(i){return i[0]==="."?_n[i.slice(1)]:i}o(Hv,"toMimeType");function FP(i){return/^video\/[^*]+$/.test(i)}o(FP,"isVideoMimeType");function xP(i){return/^image\/[^*]+$/.test(i)}o(xP,"isImageMimeType");function EP(){return navigator.mediaDevices}o(EP,"getMediaDevices");function Jd(i,e){return i.includes(e)}o(Jd,"isModeAvailable");var OP={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,$v.default)({tablet:!0})},Bi=_P("enableMirror"),Zs=class extends ae{static{o(this,"Webcam")}constructor(e,t){super(e,{...OP,...t}),Object.defineProperty(this,Bi,{writable:!0,value:void 0}),this.mediaDevices=EP(),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,Bi)[Bi]=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,Bi)[Bi]=!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,u=this.isAudioOnly()?n.getAudioTracks():n.getVideoTracks();!e||!e.deviceId?a=u[0].getSettings().deviceId:u.forEach(l=>{l.getSettings().deviceId===e.deviceId&&(a=l.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(FP));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((l,h)=>l+h.size,0),a=(s-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3,u=Math.max(0,r.maxFileSize-a);s>u&&(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,Bi)[Bi]=!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,Bi)[Bi]=!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,u=[];this.opts.preferredImageMimeType?u=[this.opts.preferredImageMimeType]:a.allowedFileTypes&&(u=a.allowedFileTypes.map(Hv).filter(xP));let l=u[0]||"image/jpeg",h=Ji(l)||"jpg",d=`cam-${Date.now()}.${h}`;return Hd(s,l).then(f=>({source:this.id,name:d,data:new Blob([f],{type:l}),type:l}))}getVideo(){let e=this.recordingChunks.find(a=>{var u;return((u=a.type)==null?void 0:u.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(Qd,{icon:Ra,i18n:this.i18n,hasCamera:e.hasCamera}):c(jv,Zd({},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:$d(),recording:e.isRecording,mirror:ka(this,Bi)[Bi],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:Jd(t,"video-only")||Jd(t,"video-audio"),showNativePhotoCameraButton:Jd(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 u=!0,{videoSources:l,currentDeviceId:h}=this.getPluginState();l.forEach(d=>{h===d.deviceId&&(u=!1)}),u&&(this.stop(),this.start())}})}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}};Zs.VERSION=PP.version;function Br(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Br,"_classPrivateFieldLooseBase");var CP=0;function qv(i){return"__private_"+CP+++"_"+i}o(qv,"_classPrivateFieldLooseKey");var zt=qv("uppy"),Ua=qv("events"),jr=class{static{o(this,"EventManager")}constructor(e){Object.defineProperty(this,zt,{writable:!0,value:void 0}),Object.defineProperty(this,Ua,{writable:!0,value:[]}),Br(this,zt)[zt]=e}on(e,t){return Br(this,Ua)[Ua].push([e,t]),Br(this,zt)[zt].on(e,t)}remove(){for(let[e,t]of Br(this,Ua)[Ua].splice(0))Br(this,zt)[zt].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",()=>{Br(this,zt)[zt].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{Br(this,zt)[zt].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){Br(r,zt)[zt].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{Br(this,zt)[zt].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 AP=0;function ei(i){return"__private_"+AP+++"_"+i}o(ei,"_classPrivateFieldLooseKey");function TP(i){return new Error("Cancelled",{cause:i})}o(TP,"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 fi=ei("activeRequests"),$t=ei("queuedHandlers"),pi=ei("paused"),eo=ei("pauseTimer"),Ht=ei("downLimit"),to=ei("upperLimit"),zr=ei("rateLimitingTimer"),Da=ei("call"),Hr=ei("queueNext"),ip=ei("next"),ep=ei("queue"),rp=ei("dequeue"),tp=ei("resume"),io=ei("increaseLimit"),Zt=class{static{o(this,"RateLimitedQueue")}constructor(e){Object.defineProperty(this,rp,{value:IP}),Object.defineProperty(this,ep,{value:DP}),Object.defineProperty(this,ip,{value:UP}),Object.defineProperty(this,Hr,{value:kP}),Object.defineProperty(this,Da,{value:RP}),Object.defineProperty(this,fi,{writable:!0,value:0}),Object.defineProperty(this,$t,{writable:!0,value:[]}),Object.defineProperty(this,pi,{writable:!0,value:!1}),Object.defineProperty(this,eo,{writable:!0,value:void 0}),Object.defineProperty(this,Ht,{writable:!0,value:1}),Object.defineProperty(this,to,{writable:!0,value:void 0}),Object.defineProperty(this,zr,{writable:!0,value:void 0}),Object.defineProperty(this,tp,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,io,{writable:!0,value:()=>{if(se(this,pi)[pi]){se(this,zr)[zr]=setTimeout(se(this,io)[io],0);return}se(this,Ht)[Ht]=this.limit,this.limit=Math.ceil((se(this,to)[to]+se(this,Ht)[Ht])/2);for(let t=se(this,Ht)[Ht];t<=this.limit;t++)se(this,Hr)[Hr]();se(this,to)[to]-se(this,Ht)[Ht]>3?se(this,zr)[zr]=setTimeout(se(this,io)[io],2e3):se(this,Ht)[Ht]=Math.floor(se(this,Ht)[Ht]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!se(this,pi)[pi]&&se(this,fi)[fi]<this.limit?se(this,Da)[Da](e):se(this,ep)[ep](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 u=r.run(()=>(e(...n),queueMicrotask(()=>u.done()),()=>{}),t);return{abortOn:Vv,abort(){u.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 u,l=new Promise((h,d)=>{u=r.run(()=>{let f,y;try{y=Promise.resolve(e(...n))}catch(b){y=Promise.reject(b)}return y.then(b=>{f?d(f):(u.done(),h(b))},b=>{f?d(f):(u.done(),d(b))}),b=>{f=TP(b)}},t)});return l.abort=h=>{u.abort(h)},l.abortOn=Vv,l}}resume(){se(this,pi)[pi]=!1,clearTimeout(se(this,eo)[eo]);for(let e=0;e<this.limit;e++)se(this,Hr)[Hr]()}pause(e){e===void 0&&(e=null),se(this,pi)[pi]=!0,clearTimeout(se(this,eo)[eo]),e!=null&&(se(this,eo)[eo]=setTimeout(se(this,tp)[tp],e))}rateLimit(e){clearTimeout(se(this,zr)[zr]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(se(this,to)[to]=this.limit-1,this.limit=se(this,Ht)[Ht],se(this,zr)[zr]=setTimeout(se(this,io)[io],e))}get isPaused(){return se(this,pi)[pi]}};function RP(i){se(this,fi)[fi]+=1;let e=!1,t;try{t=i()}catch(r){throw se(this,fi)[fi]-=1,r}return{abort:r=>{e||(e=!0,se(this,fi)[fi]-=1,t?.(r),se(this,Hr)[Hr]())},done:()=>{e||(e=!0,se(this,fi)[fi]-=1,se(this,Hr)[Hr]())}}}o(RP,"_call2");function kP(){queueMicrotask(()=>se(this,ip)[ip]())}o(kP,"_queueNext2");function UP(){if(se(this,pi)[pi]||se(this,fi)[fi]>=this.limit||se(this,$t)[$t].length===0)return;let i=se(this,$t)[$t].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(UP,"_next2");function DP(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{se(this,rp)[rp](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},r=se(this,$t)[$t].findIndex(s=>t.priority>s.priority);return r===-1?se(this,$t)[$t].push(t):se(this,$t)[$t].splice(r,0,t),t}o(DP,"_queue2");function IP(i){let e=se(this,$t)[$t].indexOf(i);e!==-1&&se(this,$t)[$t].splice(e,1)}o(IP,"_dequeue2");var os=Symbol("__queue");function ns(i){let e=o(t=>"error"in t&&!!t.error,"hasError");return i.filter(t=>!e(t))}o(ns,"filterNonFailedFiles");function as(i){return i.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}o(as,"filterFilesToEmitUploadStarted");var{AbortController:Ku}=globalThis,{AbortSignal:XI}=globalThis,Xu=o(function(i,e){i===void 0&&(i="Aborted");let t=new DOMException(i,"AbortError");return e!=null&&ni(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 LP=0;function pt(i){return"__private_"+LP+++"_"+i}o(pt,"_classPrivateFieldLooseKey");var NP=1024*1024,Wv={getChunkSize(i){return Math.ceil(i.size/1e4)},onProgress(){},onPartComplete(){},onSuccess(){},onError(i){throw i}};function MP(i){if(typeof i=="string")return parseInt(i,10);if(typeof i=="number")return i;throw new TypeError("Expected a number")}o(MP,"ensureInt");var ja=Symbol("pausing upload, not an actual error"),Et=pt("abortController"),dt=pt("chunks"),qt=pt("chunkState"),mi=pt("data"),gi=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"),sp=pt("initChunks"),op=pt("createUpload"),La=pt("resumeUpload"),Ma=pt("onPartProgress"),Ba=pt("onPartComplete"),np=pt("abortUpload"),ap=class{static{o(this,"MultipartUploader")}constructor(e,t){var r,s;Object.defineProperty(this,np,{value:HP}),Object.defineProperty(this,La,{value:zP}),Object.defineProperty(this,op,{value:jP}),Object.defineProperty(this,sp,{value:BP}),Object.defineProperty(this,Et,{writable:!0,value:new Ku}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,qt,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,gi,{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*NP}),Object.defineProperty(this,Ma,{writable:!0,value:n=>a=>{if(!a.lengthComputable)return;ee(this,qt)[qt][n].uploaded=MP(a.loaded);let u=ee(this,qt)[qt].reduce((l,h)=>l+h.uploaded,0);this.options.onProgress(u,ee(this,mi)[mi].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 u={PartNumber:n+1,ETag:a};this.options.onPartComplete(u)}}),this.options={...Wv,...t},(s=(r=this.options).getChunkSize)!=null||(r.getChunkSize=Wv.getChunkSize),ee(this,mi)[mi]=e,ee(this,gi)[gi]=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,sp)[sp]()}start(){ee(this,za)[za]?(ee(this,Et)[Et].signal.aborted||ee(this,Et)[Et].abort(ja),ee(this,Et)[Et]=new Ku,ee(this,La)[La]()):ee(this,so)[so]?(this.options.companionComm.restoreUploadFile(ee(this,gi)[gi],{uploadId:this.options.uploadId,key:this.options.key}),ee(this,La)[La]()):ee(this,op)[op]()}pause(){ee(this,Et)[Et].abort(ja),ee(this,Et)[Et]=new Ku}abort(e){e!=null&&e.really?ee(this,np)[np]():this.pause()}get chunkState(){return ee(this,qt)[qt]}};function BP(){let i=ee(this,mi)[mi].size,e=typeof ee(this,$r)[$r]=="function"?ee(this,$r)[$r](ee(this,gi)[gi]):!!ee(this,$r)[$r];if(e&&i>ee(this,Na)[Na]){let t=Math.max(this.options.getChunkSize(ee(this,mi)[mi]),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),u=o(()=>{let l=s;return ee(this,mi)[mi].slice(l,a)},"getData");if(ee(this,dt)[dt][n]={getData:u,onProgress:ee(this,Ma)[Ma](n),onComplete:ee(this,Ba)[Ba](n),shouldUseMultipart:e},ee(this,so)[so]){let l=s+t>i?i-s:t;ee(this,dt)[dt][n].setAsUploaded=()=>{ee(this,dt)[dt][n]=null,ee(this,qt)[qt][n].uploaded=l}}}}else ee(this,dt)[dt]=[{getData:()=>ee(this,mi)[mi],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(BP,"_initChunks2");function jP(){this.options.companionComm.uploadFile(ee(this,gi)[gi],ee(this,dt)[dt],ee(this,Et)[Et].signal).then(ee(this,oo)[oo],ee(this,Ha)[Ha]),ee(this,za)[za]=!0}o(jP,"_createUpload2");function zP(){this.options.companionComm.resumeUploadFile(ee(this,gi)[gi],ee(this,dt)[dt],ee(this,Et)[Et].signal).then(ee(this,oo)[oo],ee(this,Ha)[Ha])}o(zP,"_resumeUpload2");function HP(){ee(this,Et)[Et].abort(),this.options.companionComm.abortFileUpload(ee(this,gi)[gi]).catch(i=>this.options.log(i))}o(HP,"_abortUpload2");var Gv=ap;function wt(i){if(i!=null&&i.aborted)throw Xu("The operation was aborted",{cause:i.reason})}o(wt,"throwIfAborted");function $P(i){let{method:e="PUT",CanonicalUri:t="/",CanonicalQueryString:r="",SignedHeaders:s,HashedPayload:n}=i,a=Object.keys(s).map(u=>u.toLowerCase()).sort();return[e,t,r,...a.map(u=>`${u}:${s[u]}`),"",a.join(";"),n].join(`
`)}o($P,"createCanonicalRequest");var lp=new TextEncoder,up={name:"HMAC",hash:"SHA-256"};async function qP(i){let{subtle:e}=globalThis.crypto;return e.digest(up.hash,lp.encode(i))}o(qP,"digest");async function VP(i){let{subtle:e}=globalThis.crypto;return e.importKey("raw",typeof i=="string"?lp.encode(i):i,up,!1,["sign"])}o(VP,"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 $a(i,e){let{subtle:t}=globalThis.crypto;return t.sign(up,await VP(i),lp.encode(e))}o($a,"hash");async function cp(i){let{accountKey:e,accountSecret:t,sessionToken:r,bucketName:s,Key:n,Region:a,expires:u,uploadId:l,partNumber:h}=i,d="s3",f=`${s}.${d}.${a}.amazonaws.com`,y=`/${encodeURI(n).replace(/[;?:@&=+$,#!'()*]/g,Oe=>`%${Oe.charCodeAt(0).toString(16).toUpperCase()}`)}`,b="UNSIGNED-PAYLOAD",S=new Date().toISOString().replace(/[-:]|\.\d+/g,""),A=S.slice(0,8),O=`${A}/${a}/${d}/aws4_request`,P=new URL(`https://${f}${y}`);P.searchParams.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),P.searchParams.set("X-Amz-Content-Sha256",b),P.searchParams.set("X-Amz-Credential",`${e}/${O}`),P.searchParams.set("X-Amz-Date",S),P.searchParams.set("X-Amz-Expires",u),P.searchParams.set("X-Amz-Security-Token",r),P.searchParams.set("X-Amz-SignedHeaders","host"),h&&P.searchParams.set("partNumber",h),l&&P.searchParams.set("uploadId",l),P.searchParams.set("x-id",h&&l?"UploadPart":"PutObject");let R=$P({CanonicalUri:y,CanonicalQueryString:P.search.slice(1),SignedHeaders:{host:f},HashedPayload:b}),H=Kv(await qP(R)),X=["AWS4-HMAC-SHA256",S,O,H].join(`
`),K=await $a(`AWS4${t}`,A),V=await $a(K,a),W=await $a(V,d),te=await $a(W,"aws4_request"),re=Kv(await $a(te,X));return P.searchParams.set("X-Amz-Signature",re),P}o(cp,"createSignedURL");function ne(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(ne,"_classPrivateFieldLooseBase");var WP=0;function Vt(i){return"__private_"+WP+++"_"+i}o(Vt,"_classPrivateFieldLooseKey");function GP(i){let e=new URL(i);return e.search="",e.hash="",e.href}o(GP,"removeMetadataFromURL");var qa=Vt("abortMultipartUpload"),Ot=Vt("cache"),Va=Vt("createMultipartUpload"),Wa=Vt("fetchSignature"),Xa=Vt("getUploadParameters"),Ga=Vt("listParts"),uo=Vt("previousRetryDelay"),co=Vt("requests"),no=Vt("retryDelays"),ao=Vt("sendCompletionRequest"),lo=Vt("setS3MultipartState"),ho=Vt("uploadPartBytes"),Ct=Vt("getFile"),hp=Vt("shouldRetry"),Ka=Vt("nonMultipartUpload"),Yu=class{static{o(this,"HTTPCommunicationQueue")}constructor(e,t,r,s){Object.defineProperty(this,Ka,{value:XP}),Object.defineProperty(this,hp,{value:KP}),Object.defineProperty(this,qa,{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}),ne(this,co)[co]=e,ne(this,lo)[lo]=r,ne(this,Ct)[Ct]=s,this.setOptions(t)}setOptions(e){let t=ne(this,co)[co];if("abortMultipartUpload"in e&&(ne(this,qa)[qa]=t.wrapPromiseFunction(e.abortMultipartUpload,{priority:1})),"createMultipartUpload"in e&&(ne(this,Va)[Va]=t.wrapPromiseFunction(e.createMultipartUpload,{priority:-1})),"signPart"in e&&(ne(this,Wa)[Wa]=t.wrapPromiseFunction(e.signPart)),"listParts"in e&&(ne(this,Ga)[Ga]=t.wrapPromiseFunction(e.listParts)),"completeMultipartUpload"in e&&(ne(this,ao)[ao]=t.wrapPromiseFunction(e.completeMultipartUpload,{priority:1})),"retryDelays"in e){var r;ne(this,no)[no]=(r=e.retryDelays)!=null?r:[]}"uploadPartBytes"in e&&(ne(this,ho)[ho]=t.wrapPromiseFunction(e.uploadPartBytes,{priority:1/0})),"getUploadParameters"in e&&(ne(this,Xa)[Xa]=t.wrapPromiseFunction(e.getUploadParameters))}async getUploadId(e,t){let r;for(;(r=ne(this,Ot)[Ot].get(e.data))!=null;)try{return await r}catch{}let s=ne(this,Va)[Va](ne(this,Ct)[Ct](e),t),n=o(()=>{s.abort(t.reason),ne(this,Ot)[Ot].delete(e.data)},"abortPromise");return t.addEventListener("abort",n,{once:!0}),ne(this,Ot)[Ot].set(e.data,s),s.then(async a=>{t.removeEventListener("abort",n),ne(this,lo)[lo](e,a),ne(this,Ot)[Ot].set(e.data,a)},()=>{t.removeEventListener("abort",n),ne(this,Ot)[Ot].delete(e.data)}),s}async abortFileUpload(e){let t=ne(this,Ot)[Ot].get(e.data);if(t==null)return;ne(this,Ot)[Ot].delete(e.data),ne(this,lo)[lo](e,Object.create(null));let r;try{r=await t}catch{return}await ne(this,qa)[qa](ne(this,Ct)[Ct](e),r)}async uploadFile(e,t,r){if(wt(r),t.length===1&&!t[0].shouldUseMultipart)return ne(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((u,l)=>this.uploadChunk(e,l+1,u,r)));return wt(r),await ne(this,ao)[ao](ne(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){ne(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 ne(this,Ka)[Ka](e,t[0],r);let{uploadId:s,key:n}=await this.getUploadId(e,r);wt(r);let a=await ne(this,Ga)[Ga](ne(this,Ct)[Ct](e),{uploadId:s,key:n,signal:r},r).abortOn(r);wt(r);let u=await Promise.all(t.map((l,h)=>{let d=h+1,f=a.find(y=>{let{PartNumber:b}=y;return b===d});return f==null?this.uploadChunk(e,d,l,r):(l==null||l.setAsUploaded==null||l.setAsUploaded(),{PartNumber:d,ETag:f.ETag})}));return wt(r),ne(this,ao)[ao](ne(this,Ct)[Ct](e),{key:n,uploadId:s,parts:u,signal:r},r).abortOn(r)}async uploadChunk(e,t,r,s){wt(s);let{uploadId:n,key:a}=await this.getUploadId(e,s),u=ne(this,no)[no].values(),l=ne(this,no)[no].values(),h=o(()=>{let d=u.next();return d==null||d.done?null:d.value},"shouldRetrySignature");for(;;){wt(s);let d=r.getData(),{onProgress:f,onComplete:y}=r,b;try{b=await ne(this,Wa)[Wa](ne(this,Ct)[Ct](e),{uploadId:n,key:a,partNumber:t,body:d,signal:s}).abortOn(s)}catch(S){let A=h();if(A==null||s.aborted)throw S;await new Promise(O=>setTimeout(O,A));continue}wt(s);try{return{PartNumber:t,...await ne(this,ho)[ho]({signature:b,body:d,size:d.size,onProgress:f,onComplete:y,signal:s}).abortOn(s)}}catch(S){if(!await ne(this,hp)[hp](S,l))throw S}}}};async function KP(i,e){var t;let r=ne(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||ne(this,uo)[uo]==null){let n=e.next();if(n==null||n.done)return!1;ne(this,uo)[uo]=n.value}r.rateLimit(0),await new Promise(n=>setTimeout(n,ne(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(KP,"_shouldRetry2");async function XP(i,e,t){let{method:r="POST",url:s,fields:n,headers:a}=await ne(this,Xa)[Xa](ne(this,Ct)[Ct](i),{signal:t}).abortOn(t),u,l=e.getData();if(r.toUpperCase()==="POST"){let y=new FormData;Object.entries(n).forEach(b=>{let[S,A]=b;return y.set(S,A)}),y.set("file",l),u=y}else u=l;let{onProgress:h,onComplete:d}=e,f=await ne(this,ho)[ho]({signature:{url:s,headers:a,method:r},body:u,size:l.size,onProgress:h,onComplete:d,signal:t}).abortOn(t);return"location"in f?f:{location:GP(s),...f}}o(XP,"_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 YP=0;function Ci(i){return"__private_"+YP+++"_"+i}o(Ci,"_classPrivateFieldLooseKey");var QP={version:"3.11.1"};function Qo(i){if(i!=null&&i.error){let e=new Error(i.message);throw Object.assign(e,i.error),e}return i}o(Qo,"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,u=String(e[n]);return[a,u]})):{}}o(Xv,"getAllowedMetadata");var JP={allowedMetaFields:null,limit:6,getTemporarySecurityCredentials:!1,shouldUseMultipart:i=>i.size!==0,retryDelays:[0,1e3,3e3,5e3],companionHeaders:{}},fo=Ci("companionCommunicationQueue"),Je=Ci("client"),At=Ci("cachedTemporaryCredentials"),dp=Ci("getTemporarySecurityCredentials"),pp=Ci("setS3MultipartState"),mo=Ci("getFile"),fp=Ci("uploadLocalFile"),mp=Ci("getCompanionClientArgs"),Ya=Ci("upload"),po=Ci("setCompanionHeaders"),qr=Ci("setResumableUploadsCapability"),Qa=Ci("resetResumableCapability");Yv=Symbol.for("uppy test: getClient");var ls=class i extends Ee{static{o(this,"AwsS3Multipart")}constructor(e,t){var r;super(e,{...JP,uploadPartBytes:i.uploadPartBytes,createMultipartUpload:null,listParts:null,abortMultipartUpload:null,completeMultipartUpload:null,signPart:null,getUploadParameters:null,...t}),Object.defineProperty(this,mp,{value:t5}),Object.defineProperty(this,fp,{value:e5}),Object.defineProperty(this,dp,{value:ZP}),Object.defineProperty(this,fo,{writable:!0,value:void 0}),Object.defineProperty(this,Je,{writable:!0,value:void 0}),Object.defineProperty(this,At,{writable:!0,value:void 0}),Object.defineProperty(this,pp,{writable:!0,value:(n,a)=>{let{key:u,uploadId:l}=a,h=this.uppy.getFile(n.id);h!=null&&this.uppy.setFileState(n.id,{s3Multipart:{...h.s3Multipart,key:u,uploadId:l}})}}),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),u=ns(a),l=as(u);this.uppy.emit("upload-start",l);let h=u.map(f=>{if(f.isRemote){let y=o(()=>this.requests,"getQueue");de(this,qr)[qr](!1);let b=new AbortController,S=o(O=>{O.id===f.id&&b.abort()},"removedHandler");this.uppy.on("file-removed",S);let A=this.uppy.getRequestClientForFile(f).uploadRemoteFile(f,de(this,mp)[mp](f),{signal:b.signal,getQueue:y});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",S)},{priority:-1})(),A}return de(this,fp)[fp](f)}),d=await Promise.all(h);return de(this,qr)[qr](!0),d}}),Object.defineProperty(this,po,{writable:!0,value:()=>{de(this,Je)[Je].setCompanionHeaders(this.opts.companionHeaders)}}),Object.defineProperty(this,qr,{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,qr)[qr](!0)}}),this.type="uploader",this.id=this.opts.id||"AwsS3Multipart",this.title="AWS S3 Multipart",de(this,Je)[Je]=new Lt(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:u,key:l,partNumber:h,body:d,signal:f}=a,{presignedUrls:y,headers:b}=await t.prepareUploadParts(n,{uploadId:u,key:l,parts:[{number:h,chunk:d}],signal:f});return{url:y?.[h],headers:b?.[h]}}),this.requests=(r=this.opts.rateLimitedQueue)!=null?r:new Zt(this.opts.limit),de(this,fo)[fo]=new Yu(this.requests,this.opts,de(this,pp)[pp],de(this,mo)[mo]),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null),this.uploaderSockets=Object.create(null)}[Yv](){return de(this,Je)[Je]}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,Je)[Je].post("s3/multipart",{filename:e.name,type:e.type,metadata:r},{signal:t}).then(Qo)}listParts(e,t,r){var s;let{key:n,uploadId:a,signal:u}=t;(s=u)!=null||(u=r),this.assertHost("listParts"),wt(u);let l=encodeURIComponent(n);return de(this,Je)[Je].get(`s3/multipart/${a}?key=${l}`,{signal:u}).then(Qo)}completeMultipartUpload(e,t,r){var s;let{key:n,uploadId:a,parts:u,signal:l}=t;(s=l)!=null||(l=r),this.assertHost("completeMultipartUpload"),wt(l);let h=encodeURIComponent(n),d=encodeURIComponent(a);return de(this,Je)[Je].post(`s3/multipart/${d}/complete?key=${h}`,{parts:u},{signal:l}).then(Qo)}async createSignedURL(e,t){let r=await de(this,dp)[dp](t),s=Qv(r.credentials)||604800,{uploadId:n,key:a,partNumber:u}=t;return{method:"PUT",expires:s,fields:{},url:`${await cp({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:u})}`,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 u=encodeURIComponent(s);return de(this,Je)[Je].get(`s3/multipart/${r}/${n}?key=${u}`,{signal:a}).then(Qo)}abortMultipartUpload(e,t,r){var s;let{key:n,uploadId:a,signal:u}=t;(s=u)!=null||(u=r),this.assertHost("abortMultipartUpload");let l=encodeURIComponent(n),h=encodeURIComponent(a);return de(this,Je)[Je].delete(`s3/multipart/${h}?key=${l}`,void 0,{signal:u}).then(Qo)}getUploadParameters(e,t){let{meta:r}=e,{type:s,name:n}=r,a=Xv({meta:r,allowedMetaFields:this.opts.allowedMetaFields,querify:!0}),u=new URLSearchParams({filename:n,type:s,...a});return de(this,Je)[Je].get(`s3/params?${u}`,t)}static async uploadPartBytes(e){let{signature:{url:t,expires:r,headers:s,method:n="PUT"},body:a,size:u=a.size,onProgress:l,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 b=new XMLHttpRequest;b.open(n,t,!0),s&&Object.keys(s).forEach(O=>{b.setRequestHeader(O,s[O])}),b.responseType="text",typeof r=="number"&&(b.timeout=r*1e3);function S(){b.abort()}o(S,"onabort");function A(){d?.removeEventListener("abort",S)}o(A,"cleanup"),d?.addEventListener("abort",S),b.upload.addEventListener("progress",O=>{l(O)}),b.addEventListener("abort",()=>{A(),y(Xu())}),b.addEventListener("timeout",()=>{A();let O=new Error("Request has expired");O.source={status:403},y(O)}),b.addEventListener("load",O=>{if(A(),b.status===403&&b.responseText.includes("<Message>Request has expired</Message>")){let H=new Error("Request has expired");H.source=b,y(H);return}if(b.status<200||b.status>=300){let H=new Error("Non 2xx");H.source=b,y(H);return}l?.({loaded:u,lengthComputable:!0});let P=b.getResponseHeader("ETag"),R=b.getResponseHeader("Location");if(n.toUpperCase()==="POST"&&R===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."),P===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?.(P),f({ETag:P,...R?{location:R}:void 0})}),b.addEventListener("error",O=>{A();let P=new Error("Unknown error");P.source=O.target,y(P)}),b.send(a)})}install(){de(this,qr)[qr](!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 ZP(i){return wt(i?.signal),de(this,At)[At]==null&&(this.opts.getTemporarySecurityCredentials===!0?(this.assertHost("getTemporarySecurityCredentials"),de(this,At)[At]=de(this,Je)[Je].get("s3/sts",i).then(Qo)):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(ZP,"_getTemporarySecurityCredentials2");function e5(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"),u=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]=u;let l=new jr(this.uppy);this.uploaderEvents[i.id]=l,l.onFileRemove(i.id,h=>{u.abort(),this.resetUploaderReferences(i.id,{abort:!0}),t(`upload ${h} was removed`)}),l.onCancelAll(i.id,h=>{h?.reason==="user"&&(u.abort(),this.resetUploaderReferences(i.id,{abort:!0})),t(`upload ${i.id} was canceled`)}),l.onFilePause(i.id,h=>{h?u.pause():u.start()}),l.onPauseAll(i.id,()=>{u.pause()}),l.onResumeAll(i.id,()=>{u.start()}),u.start()})}o(e5,"_uploadLocalFile2");function t5(i){var e;return{...(e=i.remote)==null?void 0:e.body,protocol:"s3-multipart",size:i.data.size,metadata:i.meta}}o(t5,"_getCompanionClientArgs2");ls.VERSION=QP.version;function Vr(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Vr,"_classPrivateFieldLooseBase");var i5=0;function Jv(i){return"__private_"+i5+++"_"+i}o(Jv,"_classPrivateFieldLooseKey");var Wt=Jv("uppy"),Ja=Jv("events"),Za=class{static{o(this,"EventManager")}constructor(e){Object.defineProperty(this,Wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ja,{writable:!0,value:[]}),Vr(this,Wt)[Wt]=e}on(e,t){return Vr(this,Ja)[Ja].push([e,t]),Vr(this,Wt)[Wt].on(e,t)}remove(){for(let[e,t]of Vr(this,Ja)[Ja].splice(0))Vr(this,Wt)[Wt].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",()=>{Vr(this,Wt)[Wt].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{Vr(this,Wt)[Wt].getFile(e)&&t()})}onCancelAll(e,t){var r=this;this.on("cancel-all",function(){Vr(r,Wt)[Wt].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{Vr(this,Wt)[Wt].getFile(e)&&t()})}};function Ai(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Ai,"_classPrivateFieldLooseBase");var r5=0;function Qu(i){return"__private_"+r5+++"_"+i}o(Qu,"_classPrivateFieldLooseKey");var Wr=Qu("aliveTimer"),go=Qu("isDone"),el=Qu("onTimedOut"),yo=Qu("timeout"),gp=class{static{o(this,"ProgressTimeout")}constructor(e,t){Object.defineProperty(this,Wr,{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}),Ai(this,yo)[yo]=e,Ai(this,el)[el]=()=>t(e)}progress(){Ai(this,go)[go]||Ai(this,yo)[yo]>0&&(clearTimeout(Ai(this,Wr)[Wr]),Ai(this,Wr)[Wr]=setTimeout(Ai(this,el)[el],Ai(this,yo)[yo]))}done(){Ai(this,go)[go]||(clearTimeout(Ai(this,Wr)[Wr]),Ai(this,Wr)[Wr]=void 0,Ai(this,go)[go]=!0)}},Ju=gp;function s5(i){return i?i.readyState!==0&&i.readyState!==4||i.status===0:!1}o(s5,"isNetworkError");var vo=s5;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 o5=0;function tb(i){return"__private_"+o5+++"_"+i}o(tb,"_classPrivateFieldLooseKey");function eb(i,e){if(vo(i))return new It(e,i);let t=new pr("Upload error",{cause:e});return t.request=i,t}o(eb,"buildResponseError");function n5(i){return i.data.slice(0,i.data.size,i.meta.type)}o(n5,"setTypeInBlob");function a5(i,e,t){(Array.isArray(t.allowedMetaFields)?t.allowedMetaFields:Object.keys(e)).forEach(s=>{i.append(s,e[s])})}o(a5,"addMetadata");function l5(i,e){let t=new FormData;a5(t,i.meta,e);let r=n5(i);return i.name?t.append(e.fieldName,r,i.meta.name):t.append(e.fieldName,r),t}o(l5,"createFormDataUpload");var u5=o(i=>i.data,"createBareUpload"),yp=tb("addEventHandlerForFile"),vp=tb("addEventHandlerIfFileStillExists"),tl=class{static{o(this,"MiniXHRUpload")}constructor(e,t){Object.defineProperty(this,vp,{value:h5}),Object.defineProperty(this,yp,{value:c5}),this.uppy=e,this.opts={validateStatus(r){return r>=200&&r<300},...t},this.requests=t[os],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?l5(e,t):u5(e,t),a=new XMLHttpRequest;this.uploaderEvents[e.id]=new Za(this.uppy);let u=new Ju(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)}),l=Yt();a.upload.addEventListener("loadstart",()=>{this.uppy.log(`[AwsS3/XHRUpload] ${l} started`)}),a.upload.addEventListener("progress",d=>{this.uppy.log(`[AwsS3/XHRUpload] ${l} progress: ${d.loaded} / ${d.total}`),u.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] ${l} finished`),u.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),A=S[t.responseUrlFieldName],O={status:d.target.status,body:S,uploadURL:A};return this.uppy.emit("upload-success",this.uppy.getFile(e.id),O),A&&this.uppy.log(`Download ${e.name} from ${A}`),r(e)}let f=t.getResponseData(a.responseText,a),y=eb(a,t.getResponseError(a.responseText,a)),b={status:d.target.status,body:f};return this.uppy.emit("upload-error",e,y,b),s(y)}),a.addEventListener("error",()=>{this.uppy.log(`[AwsS3/XHRUpload] ${l} errored`),u.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),()=>{u.done(),a.abort()}),{priority:1});Zv(this,yp)[yp]("file-removed",e.id,()=>{h.abort(),s(new Error("File removed"))}),Zv(this,vp)[vp]("cancel-all",e.id,function(d){let{reason:f}=d===void 0?{}:d;f==="user"&&h.abort(),s(new Error("Upload cancelled"))})})}};function c5(i,e,t){this.uploaderEvents[e].on(i,r=>{var s;let n=(s=r?.id)!=null?s:r;e===n&&t()})}o(c5,"_addEventHandlerForFile2");function h5(i,e,t){var r=this;this.uploaderEvents[e].on(i,function(){r.uppy.getFile(e)&&t(...arguments)})}o(h5,"_addEventHandlerIfFileStillExists2");function d5(i){return i.replace(/;.*$/,"")}o(d5,"removeMimeParameters");function p5(i,e){let t=e.headers?e.headers["content-type"]:e.getResponseHeader("Content-Type");if(typeof t=="string"){let r=d5(t).toLowerCase();if(r==="application/xml"||r==="text/xml"||r==="text/html"&&/^<\?xml /.test(i))return!0}return!1}o(p5,"isXml");var bp=p5;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 f5=0;function Zo(i){return"__private_"+f5+++"_"+i}o(Zo,"_classPrivateFieldLooseKey");var m5={version:"3.6.2"};function g5(i,e){return!i&&!e.startsWith("https://")&&!e.startsWith("http://")&&(e=`https://${e}`),new URL(e,i||void 0).toString()}o(g5,"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 y5(i){if(i&&i.error){let e=new Error(i.message);throw Object.assign(e,i.error),e}return i}o(y5,"assertServerError");function v5(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(v5,"validateParameters");function b5(i,e){if(!bp(i,e))return;let t=sl(i,"Message");return new Error(t)}o(b5,"defaultGetResponseError");var rb=!1,yi=Zo("client"),ji=Zo("requests"),bo=Zo("uploader"),il=Zo("handleUpload"),rl=Zo("setCompanionHeaders"),wp=Zo("getCompanionClientArgs");sb=Symbol.for("uppy test: getClient");var Jo=class extends Ee{static{o(this,"AwsS3")}constructor(e,t){if(t?.shouldUseMultipart!=null)return new ls(e,t);super(e,t),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{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 b;let{id:S}=y;(b=n[S])==null||b.abort()}o(a,"onremove"),this.uppy.on("file-removed",a);let u=this.uppy.getFilesByIds(s),l=ns(u),h=as(l);this.uppy.emit("upload-start",h);let d=ft(this,ji)[ji].wrapPromiseFunction(y=>this.opts.getUploadParameters(y)),f=s.length;return Promise.allSettled(s.map((y,b)=>(n[y]=d(this.uppy.getFile(y)),n[y].then(S=>{delete n[y];let A=this.uppy.getFile(y);v5(A,S);let{method:O="POST",url:P,fields:R,headers:H}=S,X={method:O,formData:O.toUpperCase()==="POST",endpoint:P,allowedMetaFields:R?Object.keys(R):[]};return H&&(X.headers=H),this.uppy.setFileState(A.id,{meta:{...A.meta,...R},xhrUpload:X}),this.uploadFile(A.id,b,f)}).catch(S=>{delete n[y];let A=this.uppy.getFile(y);return this.uppy.emit("upload-error",A,S),Promise.reject(S)})))).finally(()=>{this.uppy.off("file-removed",a)})}}),Object.defineProperty(this,rl,{writable:!0,value:()=>(ft(this,yi)[yi].setCompanionHeaders(this.opts.companionHeaders),Promise.resolve())}),Object.defineProperty(this,wp,{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(u=>[u,s.meta[u]])),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,yi)[yi]=new Lt(e,t),ft(this,ji)[ji]=new Zt(this.opts.limit)}[sb](){return ft(this,yi)[yi]}get client(){return ft(this,yi)[yi]}set client(e){ft(this,yi)[yi]=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,yi)[yi].get(`s3/params?${n}`).then(y5)}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,ji)[ji],"getQueue"),a=new AbortController,u=o(h=>{h.id===s.id&&a.abort()},"removedHandler");this.uppy.on("file-removed",u);let l=this.uppy.getRequestClientForFile(s).uploadRemoteFile(s,ft(this,wp)[wp](s),{signal:a.signal,getQueue:n});return ft(this,ji)[ji].wrapSyncFunction(()=>{this.uppy.off("file-removed",u)},{priority:-1})(),l}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 bp(s,n)?{location:g5(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,[os]:ft(this,ji)[ji],responseType:"text",getResponseData:this.opts.getResponseData||t,getResponseError:b5};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])}};Jo.VERSION=m5.version;var cb="3.7.2",w5=cb,S5=typeof atob=="function",_5=typeof btoa=="function",tn=typeof Buffer=="function",ob=typeof TextDecoder=="function"?new TextDecoder:void 0,nb=typeof TextEncoder=="function"?new TextEncoder:void 0,P5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ol=Array.prototype.slice.call(P5),Zu=(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 u=0;u<i.length;){if((t=i.charCodeAt(u++))>255||(r=i.charCodeAt(u++))>255||(s=i.charCodeAt(u++))>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):tn?i=>Buffer.from(i,"binary").toString("base64"):pb,Sp=tn?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(""))},ec=o((i,e=!1)=>e?hb(Sp(i)):Sp(i),"fromUint8Array"),x5=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"),E5=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,fb=o(i=>i.replace(E5,x5),"utob"),lb=tn?i=>Buffer.from(i,"utf8").toString("base64"):nb?i=>Sp(nb.encode(i)):i=>Pp(fb(i)),en=o((i,e=!1)=>e?hb(lb(i)):lb(i),"encode"),ub=o(i=>en(i,!0),"encodeURI"),O5=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,C5=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(O5,C5),"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=Zu[i.charAt(n++)]<<18|Zu[i.charAt(n++)]<<12|(r=Zu[i.charAt(n++)])<<6|(s=Zu[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"),Fp=S5?i=>atob(db(i)):tn?i=>Buffer.from(i,"base64").toString("binary"):gb,yb=tn?i=>ab(Buffer.from(i,"base64")):i=>ab(Fp(i),e=>e.charCodeAt(0)),vb=o(i=>yb(bb(i)),"toUint8Array"),A5=tn?i=>Buffer.from(i,"base64").toString("utf8"):ob?i=>ob.decode(yb(i)):i=>mb(Fp(i)),bb=o(i=>db(i.replace(/[-_]/g,e=>e=="-"?"+":"/")),"_unURI"),_p=o(i=>A5(bb(i)),"decode"),T5=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 _p(this)}),i("toBase64",function(e){return en(this,e)}),i("toBase64URI",function(){return en(this,!0)}),i("toBase64URL",function(){return en(this,!0)}),i("toUint8Array",function(){return vb(this)})},"extendString"),_b=o(function(){let i=o((e,t)=>Object.defineProperty(Uint8Array.prototype,e,wb(t)),"_add");i("toBase64",function(e){return ec(this,e)}),i("toBase64URI",function(){return ec(this,!0)}),i("toBase64URL",function(){return ec(this,!0)})},"extendUint8Array"),R5=o(()=>{Sb(),_b()},"extendBuiltins"),Pb={version:cb,VERSION:w5,atob:Fp,atobPolyfill:gb,btoa:Pp,btoaPolyfill:pb,fromBase64:_p,toBase64:en,encode:en,encodeURI:ub,encodeURL:ub,utob:fb,btou:mb,decode:_p,isValid:T5,fromUint8Array:ec,toUint8Array:vb,extendString:Sb,extendUint8Array:_b,extendBuiltins:R5};var Yb=be(Lb());function rn(i){"@babel/helpers - typeof";return rn=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},rn(i)}o(rn,"_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,q5(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 q5(i){var e=V5(i,"string");return rn(e)==="symbol"?e:String(e)}o(q5,"_toPropertyKey");function V5(i,e){if(rn(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(rn(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}o(V5,"_toPrimitive");function W5(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(W5,"_classCallCheck");function G5(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(G5,"_inherits");function K5(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 X5(this,s)},"_createSuperInternal")}o(K5,"_createSuper");function X5(i,e){if(e&&(rn(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Y5(i)}o(X5,"_possibleConstructorReturn");function Y5(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}o(Y5,"_assertThisInitialized");function Cp(i){var e=typeof Map=="function"?new Map:void 0;return Cp=o(function(r){if(r===null||!Q5(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 ic(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"),Cp(i)}o(Cp,"_wrapNativeSuper");function ic(i,e,t){return Mb()?ic=Reflect.construct.bind():ic=o(function(s,n,a){var u=[null];u.push.apply(u,n);var l=Function.bind.apply(s,u),h=new l;return a&&nl(h,a.prototype),h},"_construct"),ic.apply(null,arguments)}o(ic,"_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 Q5(i){try{return Function.toString.call(i).indexOf("[native code]")!==-1}catch{return typeof i=="function"}}o(Q5,"_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 J5=function(i){G5(t,i);var e=K5(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,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(W5(this,t),s=e.call(this,r),s.originalRequest=a,s.originalResponse=u,s.causingError=n,n!=null&&(r+=", caused by ".concat(n.toString())),a!=null){var l=a.getHeader("X-Request-ID")||"n/a",h=a.getMethod(),d=a.getURL(),f=u?u.getStatus():"n/a",y=u?u.getBody()||"":"n/a";r+=", originated from request (method: ".concat(h,", url: ").concat(d,", response code: ").concat(f,", response text: ").concat(y,", request id: ").concat(l,")")}return s.message=r,s}return o(t,"DetailedError"),$5(t)}(Cp(Error)),sn=J5;var Z5=!1;function us(i){Z5&&console.log(i)}o(us,"log");function Ap(){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(Ap,"uuid");function Tp(){"use strict";Tp=o(function(){return e},"_regeneratorRuntime");var i,e={},t=Object.prototype,r=t.hasOwnProperty,s=Object.defineProperty||function(C,_,E){C[_]=E.value},n=typeof Symbol=="function"?Symbol:{},a=n.iterator||"@@iterator",u=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function h(C,_,E){return Object.defineProperty(C,_,{value:E,enumerable:!0,configurable:!0,writable:!0}),C[_]}o(h,"define");try{h({},"")}catch{h=o(function(E,L,z){return E[L]=z},"define")}function d(C,_,E,L){var z=_&&_.prototype instanceof P?_:P,B=Object.create(z.prototype),D=new _e(L||[]);return s(B,"_invoke",{value:Oe(C,E,D)}),B}o(d,"wrap");function f(C,_,E){try{return{type:"normal",arg:C.call(_,E)}}catch(L){return{type:"throw",arg:L}}}o(f,"tryCatch"),e.wrap=d;var y="suspendedStart",b="suspendedYield",S="executing",A="completed",O={};function P(){}o(P,"Generator");function R(){}o(R,"GeneratorFunction");function H(){}o(H,"GeneratorFunctionPrototype");var X={};h(X,a,function(){return this});var K=Object.getPrototypeOf,V=K&&K(K(Le([])));V&&V!==t&&r.call(V,a)&&(X=V);var W=H.prototype=P.prototype=Object.create(X);function te(C){["next","throw","return"].forEach(function(_){h(C,_,function(E){return this._invoke(_,E)})})}o(te,"defineIteratorMethods");function re(C,_){function E(z,B,D,T){var k=f(C[z],C,B);if(k.type!=="throw"){var N=k.arg,Y=N.value;return Y&&wo(Y)=="object"&&r.call(Y,"__await")?_.resolve(Y.__await).then(function(Q){E("next",Q,D,T)},function(Q){E("throw",Q,D,T)}):_.resolve(Y).then(function(Q){N.value=Q,D(N)},function(Q){return E("throw",Q,D,T)})}T(k.arg)}o(E,"invoke");var L;s(this,"_invoke",{value:o(function(B,D){function T(){return new _(function(k,N){E(B,D,k,N)})}return o(T,"callInvokeWithMethodAndArg"),L=L?L.then(T,T):T()},"value")})}o(re,"AsyncIterator");function Oe(C,_,E){var L=y;return function(z,B){if(L===S)throw new Error("Generator is already running");if(L===A){if(z==="throw")throw B;return{value:i,done:!0}}for(E.method=z,E.arg=B;;){var D=E.delegate;if(D){var T=Re(D,E);if(T){if(T===O)continue;return T}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(L===y)throw L=A,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);L=S;var k=f(C,_,E);if(k.type==="normal"){if(L=E.done?A:b,k.arg===O)continue;return{value:k.arg,done:E.done}}k.type==="throw"&&(L=A,E.method="throw",E.arg=k.arg)}}}o(Oe,"makeInvokeMethod");function Re(C,_){var E=_.method,L=C.iterator[E];if(L===i)return _.delegate=null,E==="throw"&&C.iterator.return&&(_.method="return",_.arg=i,Re(C,_),_.method==="throw")||E!=="return"&&(_.method="throw",_.arg=new TypeError("The iterator does not provide a '"+E+"' method")),O;var z=f(L,C.iterator,_.arg);if(z.type==="throw")return _.method="throw",_.arg=z.arg,_.delegate=null,O;var B=z.arg;return B?B.done?(_[C.resultName]=B.value,_.next=C.nextLoc,_.method!=="return"&&(_.method="next",_.arg=i),_.delegate=null,O):B:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,O)}o(Re,"maybeInvokeDelegate");function $e(C){var _={tryLoc:C[0]};1 in C&&(_.catchLoc=C[1]),2 in C&&(_.finallyLoc=C[2],_.afterLoc=C[3]),this.tryEntries.push(_)}o($e,"pushTryEntry");function we(C){var _=C.completion||{};_.type="normal",delete _.arg,C.completion=_}o(we,"resetTryEntry");function _e(C){this.tryEntries=[{tryLoc:"root"}],C.forEach($e,this),this.reset(!0)}o(_e,"Context");function Le(C){if(C||C===""){var _=C[a];if(_)return _.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var E=-1,L=o(function z(){for(;++E<C.length;)if(r.call(C,E))return z.value=C[E],z.done=!1,z;return z.value=i,z.done=!0,z},"next");return L.next=L}}throw new TypeError(wo(C)+" is not iterable")}return o(Le,"values"),R.prototype=H,s(W,"constructor",{value:H,configurable:!0}),s(H,"constructor",{value:R,configurable:!0}),R.displayName=h(H,l,"GeneratorFunction"),e.isGeneratorFunction=function(C){var _=typeof C=="function"&&C.constructor;return!!_&&(_===R||(_.displayName||_.name)==="GeneratorFunction")},e.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,H):(C.__proto__=H,h(C,l,"GeneratorFunction")),C.prototype=Object.create(W),C},e.awrap=function(C){return{__await:C}},te(re.prototype),h(re.prototype,u,function(){return this}),e.AsyncIterator=re,e.async=function(C,_,E,L,z){z===void 0&&(z=Promise);var B=new re(d(C,_,E,L),z);return e.isGeneratorFunction(_)?B:B.next().then(function(D){return D.done?D.value:B.next()})},te(W),h(W,l,"Generator"),h(W,a,function(){return this}),h(W,"toString",function(){return"[object Generator]"}),e.keys=function(C){var _=Object(C),E=[];for(var L in _)E.push(L);return E.reverse(),o(function z(){for(;E.length;){var B=E.pop();if(B in _)return z.value=B,z.done=!1,z}return z.done=!0,z},"next")},e.values=Le,_e.prototype={constructor:_e,reset:o(function(_){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),!_)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 _=this.tryEntries[0].completion;if(_.type==="throw")throw _.arg;return this.rval},"stop"),dispatchException:o(function(_){if(this.done)throw _;var E=this;function L(N,Y){return D.type="throw",D.arg=_,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 T=r.call(B,"catchLoc"),k=r.call(B,"finallyLoc");if(T&&k){if(this.prev<B.catchLoc)return L(B.catchLoc,!0);if(this.prev<B.finallyLoc)return L(B.finallyLoc)}else if(T){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(_,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&&(_==="break"||_==="continue")&&B.tryLoc<=E&&E<=B.finallyLoc&&(B=null);var D=B?B.completion:{};return D.type=_,D.arg=E,B?(this.method="next",this.next=B.finallyLoc,O):this.complete(D)},"abrupt"),complete:o(function(_,E){if(_.type==="throw")throw _.arg;return _.type==="break"||_.type==="continue"?this.next=_.arg:_.type==="return"?(this.rval=this.arg=_.arg,this.method="return",this.next="end"):_.type==="normal"&&E&&(this.next=E),O},"complete"),finish:o(function(_){for(var E=this.tryEntries.length-1;E>=0;--E){var L=this.tryEntries[E];if(L.finallyLoc===_)return this.complete(L.completion,L.afterLoc),we(L),O}},"finish"),catch:o(function(_){for(var E=this.tryEntries.length-1;E>=0;--E){var L=this.tryEntries[E];if(L.tryLoc===_){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(_,E,L){return this.delegate={iterator:Le(_),resultName:E,nextLoc:L},this.method==="next"&&(this.arg=i),O},"delegateYield")},e}o(Tp,"_regeneratorRuntime");function Bb(i,e,t,r,s,n,a){try{var u=i[n](a),l=u.value}catch(h){t(h);return}u.done?e(l):Promise.resolve(l).then(r,s)}o(Bb,"asyncGeneratorStep");function eF(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function a(l){Bb(n,r,s,a,u,"next",l)}o(a,"_next");function u(l){Bb(n,r,s,a,u,"throw",l)}o(u,"_throw"),a(void 0)})}}o(eF,"_asyncToGenerator");function Kb(i,e){return sF(i)||rF(i,e)||iF(i,e)||tF()}o(Kb,"_slicedToArray");function tF(){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(tF,"_nonIterableRest");function iF(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(iF,"_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 rF(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var r,s,n,a,u=[],l=!0,h=!1;try{if(n=(t=t.call(i)).next,e===0){if(Object(t)!==t)return;l=!1}else for(;!(l=(r=n.call(t)).done)&&(u.push(r.value),u.length!==e);l=!0);}catch(d){h=!0,s=d}finally{try{if(!l&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(h)throw s}}return u}}o(rF,"_iterableToArrayLimit");function sF(i){if(Array.isArray(i))return i}o(sF,"_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 on(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){oF(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(on,"_objectSpread");function oF(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(oF,"_defineProperty");function nF(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(nF,"_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 aF(i,e,t){return e&&Hb(i.prototype,e),t&&Hb(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(aF,"_createClass");function Xb(i){var e=lF(i,"string");return wo(e)==="symbol"?e:String(e)}o(Xb,"_toPropertyKey");function lF(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(lF,"_toPrimitive");var uF={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){nF(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"),aF(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 u=a[n];if(this.options[u]){this._emitError(new Error("tus: cannot use the ".concat(u," 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(l){return l==null?us("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):us("Calculated fingerprint: ".concat(l)),t._fingerprint=l,t._source?t._source:t.options.fileReader.openFile(r,t.options.chunkSize)}).then(function(l){if(t._source=l,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(l){t._emitError(l)})},"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,u=(t=this.options.parallelUploadBoundaries)!==null&&t!==void 0?t:hF(this._source.size,a);this._parallelUploadUrls&&u.forEach(function(d,f){d.uploadUrl=r._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(u.length);var l=u.map(function(d,f){var y=0;return r._source.slice(d.start,d.end).then(function(b){var S=b.value;return new Promise(function(A,O){var P=on(on({},r.options),{},{uploadUrl:d.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:{},headers:on(on({},r.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:A,onError:O,onProgress:o(function(X){n=n-y+X,y=X,r._emitProgress(n,s)},"onProgress"),onUploadUrlAvailable:o(function(){r._parallelUploadUrls[f]=R.url,r._parallelUploadUrls.filter(function(X){return!!X}).length===u.length&&r._saveUploadInUrlStorage()},"onUploadUrlAvailable")}),R=new i(S,P);R.start(),r._parallelUploads.push(R)})})}),h;Promise.all(l).then(function(){h=r._openRequest("POST",r.options.endpoint),h.setHeader("Upload-Concat","final;".concat(r._parallelUploadUrls.join(" ")));var d=$b(r.options.metadata);return d!==""&&h.setHeader("Upload-Metadata",d),r._sendRequest(h,null)}).then(function(d){if(!nn(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),us("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){us("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){us("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}us("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 sn(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=$b(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(!nn(a.getStatus(),200)){t._emitHttpError(r,a,"tus: unexpected response while creating upload");return}var u=a.getHeader("Location");if(u==null){t._emitHttpError(r,a,"tus: invalid or missing Location header");return}if(t.url=Gb(t.options.endpoint,u),us("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(!nn(a,200)){if(a===423){t._emitHttpError(r,n,"tus: upload is currently locked; retry later");return}if(nn(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 u=parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(u)){t._emitHttpError(r,n,"tus: invalid or missing offset value");return}var l=parseInt(n.getHeader("Upload-Length"),10);if(Number.isNaN(l)&&!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(u===l){t._emitProgress(l,l),t._emitSuccess();return}t._offset=u,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(!nn(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 u=a.value,l=a.done,h=u&&u.size?u.size:0;r.options.uploadLengthDeferred&&l&&(r._size=r._offset+h,t.setHeader("Upload-Length",r._size));var d=r._offset+h;return!r.options.uploadLengthDeferred&&l&&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"))):u===null?r._sendRequest(t):(r._emitProgress(r._offset,r._size),r._sendRequest(t,u))})},"_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=qb(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=qb("DELETE",t,r);return Vb(s,null,r).then(function(n){if(n.getStatus()!==204)throw new sn("tus: unexpected response while terminating upload",null,s,n)}).catch(function(n){if(n instanceof sn||(n=new sn("tus: failed to terminate upload",n,s,null)),!Wb(n,0,r))throw n;var a=r.retryDelays[0],u=r.retryDelays.slice(1),l=on(on({},r),{},{retryDelays:u});return new Promise(function(h){return setTimeout(h,a)}).then(function(){return i.terminate(t,l)})})},"terminate")}]),i}();function $b(i){return Object.entries(i).map(function(e){var t=Kb(e,2),r=t[0],s=t[1];return"".concat(r," ").concat(Pb.encode(String(s)))}).join(",")}o($b,"encodeMetadata");function nn(i,e){return i>=e&&i<e+100}o(nn,"inStatusCategory");function qb(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 u=Kb(a,2),l=u[0],h=u[1];r.setHeader(l,h)}),t.addRequestId){var n=Ap();r.setHeader("X-Request-ID",n)}return r}o(qb,"openRequest");function Vb(i,e,t){return Rp.apply(this,arguments)}o(Vb,"sendRequest");function Rp(){return Rp=eF(Tp().mark(o(function i(e,t,r){var s;return Tp().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"))),Rp.apply(this,arguments)}o(Rp,"_sendRequest2");function cF(){var i=!0;return typeof window<"u"&&"navigator"in window&&window.navigator.onLine===!1&&(i=!1),i}o(cF,"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(!nn(e,400)||e===409||e===423)&&cF()}o(Jb,"defaultOnShouldRetry");function Gb(i,e){return new Yb.default(e,i).toString()}o(Gb,"resolveUrl");function hF(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(hF,"splitSizeIntoParts");Qb.defaultOptions=uF;var rc=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 dF(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(dF,"_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,fF(r.key),r)}}o(Zb,"_defineProperties");function pF(i,e,t){return e&&Zb(i.prototype,e),t&&Zb(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(pF,"_createClass");function fF(i){var e=mF(i,"string");return ll(e)==="symbol"?e:String(e)}o(fF,"_toPropertyKey");function mF(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(mF,"_toPrimitive");var e0=function(){function i(){dF(this,i)}return o(i,"NoopUrlStorage"),pF(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 gF(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(gF,"_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,vF(r.key),r)}}o(t0,"_defineProperties");function yF(i,e,t){return e&&t0(i.prototype,e),t&&t0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(yF,"_createClass");function vF(i){var e=bF(i,"string");return ul(e)==="symbol"?e:String(e)}o(vF,"_toPropertyKey");function bF(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(bF,"_toPrimitive");var Up=!1;try{Up="localStorage"in window,sc="tusSupport",kp=localStorage.getItem(sc),localStorage.setItem(sc,kp),kp===null&&localStorage.removeItem(sc)}catch(i){if(i.code===i.SECURITY_ERR||i.code===i.QUOTA_EXCEEDED_ERR)Up=!1;else throw i}var sc,kp,i0=Up,r0=function(){function i(){gF(this,i)}return o(i,"WebStorageUrlStorage"),yF(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 Dp(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(Dp,"_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,wF(r.key),r)}}o(s0,"_defineProperties");function Ip(i,e,t){return e&&s0(i.prototype,e),t&&s0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(Ip,"_createClass");function wF(i){var e=SF(i,"string");return cl(e)==="symbol"?e:String(e)}o(wF,"_toPropertyKey");function SF(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(SF,"_toPrimitive");var o0=function(){function i(){Dp(this,i)}return o(i,"XHRHttpStack"),Ip(i,[{key:"createRequest",value:o(function(t,r){return new _F(t,r)},"createRequest")},{key:"getName",value:o(function(){return"XHRHttpStack"},"getName")}]),i}();var _F=function(){function i(e,t){Dp(this,i),this._xhr=new XMLHttpRequest,this._xhr.open(e,t,!0),this._method=e,this._url=t,this._headers={}}return o(i,"Request"),Ip(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 PF(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}(),PF=function(){function i(e){Dp(this,i),this._xhr=e}return o(i,"Response"),Ip(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 FF=o(function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"},"isReactNative"),oc=FF;function Lp(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(Lp,"uriToBlob");var xF=o(function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")},"isCordova"),n0=xF;function Np(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(Np,"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 EF(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(EF,"_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,CF(r.key),r)}}o(a0,"_defineProperties");function OF(i,e,t){return e&&a0(i.prototype,e),t&&a0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(OF,"_createClass");function CF(i){var e=AF(i,"string");return hl(e)==="symbol"?e:String(e)}o(CF,"_toPropertyKey");function AF(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(AF,"_toPrimitive");var Mp=function(){function i(e){EF(this,i),this._file=e,this.size=e.size}return o(i,"FileSource"),OF(i,[{key:"slice",value:o(function(t,r){if(n0())return Np(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 TF(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(TF,"_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,kF(r.key),r)}}o(l0,"_defineProperties");function RF(i,e,t){return e&&l0(i.prototype,e),t&&l0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(RF,"_createClass");function kF(i){var e=UF(i,"string");return dl(e)==="symbol"?e:String(e)}o(kF,"_toPropertyKey");function UF(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(UF,"_toPrimitive");function u0(i){return i===void 0?0:i.size!==void 0?i.size:i.length}o(u0,"len");function DF(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(DF,"concat");var c0=function(){function i(e){TF(this,i),this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}return o(i,"StreamSource"),RF(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),u=a==null?this._done:!1;return Promise.resolve({value:a,done:u})}return this._reader.read().then(function(l){var h=l.value,d=l.done;return d?s._done=!0:s._buffer===void 0?s._buffer=h:s._buffer=DF(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 Bp(){"use strict";Bp=o(function(){return e},"_regeneratorRuntime");var i,e={},t=Object.prototype,r=t.hasOwnProperty,s=Object.defineProperty||function(C,_,E){C[_]=E.value},n=typeof Symbol=="function"?Symbol:{},a=n.iterator||"@@iterator",u=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function h(C,_,E){return Object.defineProperty(C,_,{value:E,enumerable:!0,configurable:!0,writable:!0}),C[_]}o(h,"define");try{h({},"")}catch{h=o(function(E,L,z){return E[L]=z},"define")}function d(C,_,E,L){var z=_&&_.prototype instanceof P?_:P,B=Object.create(z.prototype),D=new _e(L||[]);return s(B,"_invoke",{value:Oe(C,E,D)}),B}o(d,"wrap");function f(C,_,E){try{return{type:"normal",arg:C.call(_,E)}}catch(L){return{type:"throw",arg:L}}}o(f,"tryCatch"),e.wrap=d;var y="suspendedStart",b="suspendedYield",S="executing",A="completed",O={};function P(){}o(P,"Generator");function R(){}o(R,"GeneratorFunction");function H(){}o(H,"GeneratorFunctionPrototype");var X={};h(X,a,function(){return this});var K=Object.getPrototypeOf,V=K&&K(K(Le([])));V&&V!==t&&r.call(V,a)&&(X=V);var W=H.prototype=P.prototype=Object.create(X);function te(C){["next","throw","return"].forEach(function(_){h(C,_,function(E){return this._invoke(_,E)})})}o(te,"defineIteratorMethods");function re(C,_){function E(z,B,D,T){var k=f(C[z],C,B);if(k.type!=="throw"){var N=k.arg,Y=N.value;return Y&&So(Y)=="object"&&r.call(Y,"__await")?_.resolve(Y.__await).then(function(Q){E("next",Q,D,T)},function(Q){E("throw",Q,D,T)}):_.resolve(Y).then(function(Q){N.value=Q,D(N)},function(Q){return E("throw",Q,D,T)})}T(k.arg)}o(E,"invoke");var L;s(this,"_invoke",{value:o(function(B,D){function T(){return new _(function(k,N){E(B,D,k,N)})}return o(T,"callInvokeWithMethodAndArg"),L=L?L.then(T,T):T()},"value")})}o(re,"AsyncIterator");function Oe(C,_,E){var L=y;return function(z,B){if(L===S)throw new Error("Generator is already running");if(L===A){if(z==="throw")throw B;return{value:i,done:!0}}for(E.method=z,E.arg=B;;){var D=E.delegate;if(D){var T=Re(D,E);if(T){if(T===O)continue;return T}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(L===y)throw L=A,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);L=S;var k=f(C,_,E);if(k.type==="normal"){if(L=E.done?A:b,k.arg===O)continue;return{value:k.arg,done:E.done}}k.type==="throw"&&(L=A,E.method="throw",E.arg=k.arg)}}}o(Oe,"makeInvokeMethod");function Re(C,_){var E=_.method,L=C.iterator[E];if(L===i)return _.delegate=null,E==="throw"&&C.iterator.return&&(_.method="return",_.arg=i,Re(C,_),_.method==="throw")||E!=="return"&&(_.method="throw",_.arg=new TypeError("The iterator does not provide a '"+E+"' method")),O;var z=f(L,C.iterator,_.arg);if(z.type==="throw")return _.method="throw",_.arg=z.arg,_.delegate=null,O;var B=z.arg;return B?B.done?(_[C.resultName]=B.value,_.next=C.nextLoc,_.method!=="return"&&(_.method="next",_.arg=i),_.delegate=null,O):B:(_.method="throw",_.arg=new TypeError("iterator result is not an object"),_.delegate=null,O)}o(Re,"maybeInvokeDelegate");function $e(C){var _={tryLoc:C[0]};1 in C&&(_.catchLoc=C[1]),2 in C&&(_.finallyLoc=C[2],_.afterLoc=C[3]),this.tryEntries.push(_)}o($e,"pushTryEntry");function we(C){var _=C.completion||{};_.type="normal",delete _.arg,C.completion=_}o(we,"resetTryEntry");function _e(C){this.tryEntries=[{tryLoc:"root"}],C.forEach($e,this),this.reset(!0)}o(_e,"Context");function Le(C){if(C||C===""){var _=C[a];if(_)return _.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var E=-1,L=o(function z(){for(;++E<C.length;)if(r.call(C,E))return z.value=C[E],z.done=!1,z;return z.value=i,z.done=!0,z},"next");return L.next=L}}throw new TypeError(So(C)+" is not iterable")}return o(Le,"values"),R.prototype=H,s(W,"constructor",{value:H,configurable:!0}),s(H,"constructor",{value:R,configurable:!0}),R.displayName=h(H,l,"GeneratorFunction"),e.isGeneratorFunction=function(C){var _=typeof C=="function"&&C.constructor;return!!_&&(_===R||(_.displayName||_.name)==="GeneratorFunction")},e.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,H):(C.__proto__=H,h(C,l,"GeneratorFunction")),C.prototype=Object.create(W),C},e.awrap=function(C){return{__await:C}},te(re.prototype),h(re.prototype,u,function(){return this}),e.AsyncIterator=re,e.async=function(C,_,E,L,z){z===void 0&&(z=Promise);var B=new re(d(C,_,E,L),z);return e.isGeneratorFunction(_)?B:B.next().then(function(D){return D.done?D.value:B.next()})},te(W),h(W,l,"Generator"),h(W,a,function(){return this}),h(W,"toString",function(){return"[object Generator]"}),e.keys=function(C){var _=Object(C),E=[];for(var L in _)E.push(L);return E.reverse(),o(function z(){for(;E.length;){var B=E.pop();if(B in _)return z.value=B,z.done=!1,z}return z.done=!0,z},"next")},e.values=Le,_e.prototype={constructor:_e,reset:o(function(_){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),!_)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 _=this.tryEntries[0].completion;if(_.type==="throw")throw _.arg;return this.rval},"stop"),dispatchException:o(function(_){if(this.done)throw _;var E=this;function L(N,Y){return D.type="throw",D.arg=_,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 T=r.call(B,"catchLoc"),k=r.call(B,"finallyLoc");if(T&&k){if(this.prev<B.catchLoc)return L(B.catchLoc,!0);if(this.prev<B.finallyLoc)return L(B.finallyLoc)}else if(T){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(_,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&&(_==="break"||_==="continue")&&B.tryLoc<=E&&E<=B.finallyLoc&&(B=null);var D=B?B.completion:{};return D.type=_,D.arg=E,B?(this.method="next",this.next=B.finallyLoc,O):this.complete(D)},"abrupt"),complete:o(function(_,E){if(_.type==="throw")throw _.arg;return _.type==="break"||_.type==="continue"?this.next=_.arg:_.type==="return"?(this.rval=this.arg=_.arg,this.method="return",this.next="end"):_.type==="normal"&&E&&(this.next=E),O},"complete"),finish:o(function(_){for(var E=this.tryEntries.length-1;E>=0;--E){var L=this.tryEntries[E];if(L.finallyLoc===_)return this.complete(L.completion,L.afterLoc),we(L),O}},"finish"),catch:o(function(_){for(var E=this.tryEntries.length-1;E>=0;--E){var L=this.tryEntries[E];if(L.tryLoc===_){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(_,E,L){return this.delegate={iterator:Le(_),resultName:E,nextLoc:L},this.method==="next"&&(this.arg=i),O},"delegateYield")},e}o(Bp,"_regeneratorRuntime");function h0(i,e,t,r,s,n,a){try{var u=i[n](a),l=u.value}catch(h){t(h);return}u.done?e(l):Promise.resolve(l).then(r,s)}o(h0,"asyncGeneratorStep");function IF(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function a(l){h0(n,r,s,a,u,"next",l)}o(a,"_next");function u(l){h0(n,r,s,a,u,"throw",l)}o(u,"_throw"),a(void 0)})}}o(IF,"_asyncToGenerator");function LF(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(LF,"_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,MF(r.key),r)}}o(d0,"_defineProperties");function NF(i,e,t){return e&&d0(i.prototype,e),t&&d0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o(NF,"_createClass");function MF(i){var e=BF(i,"string");return So(e)==="symbol"?e:String(e)}o(MF,"_toPropertyKey");function BF(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(BF,"_toPrimitive");var p0=function(){function i(){LF(this,i)}return o(i,"FileReader"),NF(i,[{key:"openFile",value:function(){var e=IF(Bp().mark(o(function r(s,n){var a;return Bp().wrap(o(function(l){for(;;)switch(l.prev=l.next){case 0:if(!(oc()&&s&&typeof s.uri<"u")){l.next=11;break}return l.prev=1,l.next=4,Lp(s.uri);case 4:return a=l.sent,l.abrupt("return",new Mp(a));case 8:throw l.prev=8,l.t0=l.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(l.t0));case 11:if(!(typeof s.slice=="function"&&typeof s.size<"u")){l.next=13;break}return l.abrupt("return",Promise.resolve(new Mp(s)));case 13:if(typeof s.read!="function"){l.next=18;break}if(n=Number(n),Number.isFinite(n)){l.next=17;break}return l.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return l.abrupt("return",Promise.resolve(new c0(s,n)));case 18:return l.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 l.stop()}},"_callee$"),r,null,[[1,8]])},"_callee")));function t(r,s){return e.apply(this,arguments)}return o(t,"openFile"),t}()}]),i}();function jp(i,e){return oc()?Promise.resolve(jF(i,e)):Promise.resolve(["tus-br",i.name,i.type,i.size,i.lastModified,e.endpoint].join("-"))}o(jp,"fingerprint");function jF(i,e){var t=i.exif?zF(JSON.stringify(i.exif)):"noexif";return["tus-rn",i.name||"noname",i.size||"nosize",t,e.endpoint].join("/")}o(jF,"reactNativeFingerprint");function zF(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(zF,"hashCode");function ln(i){"@babel/helpers - typeof";return ln=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},ln(i)}o(ln,"_typeof");function HF(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}o(HF,"_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 $F(i,e,t){return e&&f0(i.prototype,e),t&&f0(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}o($F,"_createClass");function qF(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&&zp(i,e)}o(qF,"_inherits");function zp(i,e){return zp=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(r,s){return r.__proto__=s,r},"_setPrototypeOf"),zp(i,e)}o(zp,"_setPrototypeOf");function VF(i){var e=KF();return o(function(){var r=nc(i),s;if(e){var n=nc(this).constructor;s=Reflect.construct(r,arguments,n)}else s=r.apply(this,arguments);return WF(this,s)},"_createSuperInternal")}o(VF,"_createSuper");function WF(i,e){if(e&&(ln(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GF(i)}o(WF,"_possibleConstructorReturn");function GF(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}o(GF,"_assertThisInitialized");function KF(){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(KF,"_isNativeReflectConstruct");function nc(i){return nc=Object.setPrototypeOf?Object.getPrototypeOf.bind():o(function(t){return t.__proto__||Object.getPrototypeOf(t)},"_getPrototypeOf"),nc(i)}o(nc,"_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 an(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){XF(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(an,"_objectSpread");function XF(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(XF,"_defineProperty");function y0(i){var e=YF(i,"string");return ln(e)==="symbol"?e:String(e)}o(y0,"_toPropertyKey");function YF(i,e){if(ln(i)!=="object"||i===null)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e||"default");if(ln(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}o(YF,"_toPrimitive");var ac=an(an({},rc.defaultOptions),{},{httpStack:new o0,fileReader:new p0,urlStorage:i0?new r0:new e0,fingerprint:jp}),v0=function(i){qF(t,i);var e=VF(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 HF(this,t),s=an(an({},ac),s),e.call(this,r,s)}return o(t,"Upload"),$F(t,null,[{key:"terminate",value:o(function(s){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=an(an({},ac),n),rc.terminate(s,n)},"terminate")}]),t}(rc),b0=window,QF=b0.XMLHttpRequest,g0=b0.Blob,eN=QF&&g0&&typeof g0.prototype.slice=="function";function JF(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")}o(JF,"isCordova");function ZF(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"}o(ZF,"isReactNative");function Hp(i){return(e,t)=>{if(JF()||ZF())return ac.fingerprint(e,t);let r=["tus",i.id,t.endpoint].join("-");return Promise.resolve(r)}}o(Hp,"getFingerprint");function _o(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(_o,"_classPrivateFieldLooseBase");var ex=0;function ml(i){return"__private_"+ex+++"_"+i}o(ml,"_classPrivateFieldLooseKey");var tx={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},ix={limit:20,retryDelays:S0.retryDelays,withCredentials:!1},fl=ml("retryDelayIterator"),qp=ml("uploadLocalFile"),Vp=ml("getCompanionClientArgs"),$p=ml("uploadFiles"),pl=ml("handleUpload"),Gr=class extends Ee{static{o(this,"Tus")}constructor(e,t){var r,s;if(super(e,{...ix,...t}),Object.defineProperty(this,$p,{value:ox}),Object.defineProperty(this,Vp,{value:sx}),Object.defineProperty(this,qp,{value:rx}),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 _o(this,$p)[$p](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 Zt(this.opts.limit),_o(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(_o(this,pl)[pl]),this.uppy.on("reset-progress",this.handleResetProgress)}uninstall(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!1}}),this.uppy.removeUploader(_o(this,pl)[pl])}};function rx(i){var e=this;return this.resetUploaderReferences(i.id),new Promise((t,r)=>{let s,n,a,u={...this.opts,...i.tus||{}};typeof u.headers=="function"&&(u.headers=u.headers(i));let{onShouldRetry:l,onBeforeRequest:h,...d}=u,f={...S0,...d};f.fingerprint=Hp(i),f.onBeforeRequest=async P=>{let R=P.getUnderlyingObject();R.withCredentials=!!u.withCredentials;let H;if(typeof h=="function"&&(H=h(P,i)),ni(s,"shouldBeRequeued")){if(!s.shouldBeRequeued)return Promise.reject();let X,K=new Promise(V=>{X=V});s=this.requests.run(()=>(i.isPaused&&s.abort(),X(),()=>{})),await Promise.all([K,H]);return}return H},f.onError=P=>{var R;this.uppy.log(P);let H=P.originalRequest!=null?P.originalRequest.getUnderlyingObject():null;vo(H)&&(P=new It(P,H)),this.resetUploaderReferences(i.id),(R=s)==null||R.abort(),this.uppy.emit("upload-error",i,P),typeof u.onError=="function"&&u.onError(P),r(P)},f.onProgress=(P,R)=>{this.onReceiveUploadUrl(i,a.url),typeof u.onProgress=="function"&&u.onProgress(P,R),this.uppy.emit("upload-progress",this.uppy.getFile(i.id),{uploader:this,bytesUploaded:P,bytesTotal:R})},f.onSuccess=()=>{var P;let R={uploadURL:(P=a.url)!=null?P: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:H}=a.file;this.uppy.log(`Download ${H} from ${a.url}`)}typeof u.onSuccess=="function"&&u.onSuccess(),t(a)};let y=o(P=>{var R;let H=P==null||(R=P.originalResponse)==null?void 0:R.getStatus();if(H===429){if(!this.requests.isPaused){var X;let K=(X=_o(this,fl)[fl])==null?void 0:X.next();if(K==null||K.done)return!1;this.requests.rateLimit(K.value)}}else{if(H!=null&&H>400&&H<500&&H!==409&&H!==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");l!=null?f.onShouldRetry=(P,R)=>l(P,R,u,y):f.onShouldRetry=y;let b=o((P,R,H)=>{ni(P,R)&&!ni(P,H)&&(P[H]=P[R])},"copyProp"),S={};(Array.isArray(u.allowedMetaFields)?u.allowedMetaFields:Object.keys(i.meta)).forEach(P=>{S[P]=String(i.meta[P])}),b(S,"type","filetype"),b(S,"name","filename"),f.metadata=S,a=new v0(i.data,f),this.uploaders[i.id]=a;let O=new jr(this.uppy);this.uploaderEvents[i.id]=O,n=o(()=>(i.isPaused||a.start(),()=>{}),"qRequest"),a.findPreviousUploads().then(P=>{let R=P[0];R&&(this.uppy.log(`[Tus] Resuming upload of ${i.id} started at ${R.creationTime}`),a.resumeFromPreviousUpload(R))}),s=this.requests.run(n),O.onFileRemove(i.id,P=>{s.abort(),this.resetUploaderReferences(i.id,{abort:!!a.url}),t(`upload ${P} was removed`)}),O.onPause(i.id,P=>{s.abort(),P?a.abort():s=this.requests.run(n)}),O.onPauseAll(i.id,()=>{s.abort(),a.abort()}),O.onCancelAll(i.id,function(P){let{reason:R}=P===void 0?{}:P;R==="user"&&(s.abort(),e.resetUploaderReferences(i.id,{abort:!!a.url})),t(`upload ${i.id} was canceled`)}),O.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(rx,"_uploadLocalFile2");function sx(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(sx,"_getCompanionClientArgs2");async function ox(i){let e=ns(i),t=as(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(l=>{l.id===r.id&&n.abort()},"removedHandler");this.uppy.on("file-removed",a);let u=this.uppy.getRequestClientForFile(r).uploadRemoteFile(r,_o(this,Vp)[Vp](r),{signal:n.signal,getQueue:s});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",a)},{priority:-1})(),u}return _o(this,qp)[qp](r)}))}o(ox,"_uploadFiles2");Gr.VERSION=tx.version;var P0=be(Gp(),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 ax=0;function tr(i){return"__private_"+ax+++"_"+i}o(tr,"_classPrivateFieldLooseKey");var lx="ASSEMBLY_UPLOADING",Qp="ASSEMBLY_EXECUTING",Jp="ASSEMBLY_COMPLETED",_0=[lx,Qp,Jp];function lc(i,e){return _0.indexOf(i)>=_0.indexOf(e)}o(lc,"isStatus");var Fo=tr("rateLimitedQueue"),gl=tr("fetchWithNetworkError"),Po=tr("previousFetchStatusStillPending"),Ze=tr("sse"),Zp=tr("onFinished"),Kp=tr("connectServerSentEvents"),zi=tr("onError"),Xp=tr("beginPolling"),Kr=tr("fetchStatus"),Yp=tr("diffStatus"),ef=class extends P0.default{static{o(this,"TransloaditAssembly")}constructor(e,t){super(),Object.defineProperty(this,Yp,{value:fx}),Object.defineProperty(this,Kr,{value:px}),Object.defineProperty(this,Xp,{value:dx}),Object.defineProperty(this,zi,{value:hx}),Object.defineProperty(this,Kp,{value:cx}),Object.defineProperty(this,Zp,{value:ux}),Object.defineProperty(this,Fo,{writable:!0,value:void 0}),Object.defineProperty(this,gl,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:!1}),Object.defineProperty(this,Ze,{writable:!0,value:void 0}),this.status=e,this.pollInterval=null,this.closed=!1,Se(this,Fo)[Fo]=t,Se(this,gl)[gl]=t.wrapPromiseFunction(Es)}connect(){Se(this,Kp)[Kp](),Se(this,Xp)[Xp]()}update(){return Se(this,Kr)[Kr]({diff:!0})}updateStatus(e){Se(this,Yp)[Yp](this.status,e),this.status=e}close(){this.closed=!0,Se(this,Ze)[Ze]&&(Se(this,Ze)[Ze].close(),Se(this,Ze)[Ze]=null),clearInterval(this.pollInterval),this.pollInterval=null}};function ux(){this.emit("finished"),this.close()}o(ux,"_onFinished2");function cx(){Se(this,Ze)[Ze]=new EventSource(`${this.status.websocket_url}?assembly=${this.status.assembly_id}`),Se(this,Ze)[Ze].addEventListener("open",()=>{clearInterval(this.pollInterval),this.pollInterval=null}),Se(this,Ze)[Ze].addEventListener("message",i=>{i.data==="assembly_finished"&&Se(this,Zp)[Zp](),i.data==="assembly_uploading_finished"&&this.emit("executing"),i.data==="assembly_upload_meta_data_extracted"&&(this.emit("metadata"),Se(this,Kr)[Kr]({diff:!1}))}),Se(this,Ze)[Ze].addEventListener("assembly_upload_finished",i=>{let e=JSON.parse(i.data);this.emit("upload",e),this.status.uploads.push(e)}),Se(this,Ze)[Ze].addEventListener("assembly_result_finished",i=>{var e,t;let[r,s]=JSON.parse(i.data);this.emit("result",r,s),((t=(e=this.status.results)[r])!=null?t:e[r]=[]).push(s)}),Se(this,Ze)[Ze].addEventListener("assembly_execution_progress",i=>{let e=JSON.parse(i.data);this.emit("execution-progress",e)}),Se(this,Ze)[Ze].addEventListener("assembly_error",i=>{try{Se(this,zi)[zi](JSON.parse(i.data))}catch{Se(this,zi)[zi](new Error(i.data))}Se(this,Kr)[Kr]({diff:!1})})}o(cx,"_connectServerSentEvents2");function hx(i){this.emit("error",Object.assign(new Error(i.message),i)),this.close()}o(hx,"_onError2");function dx(){this.pollInterval=setInterval(()=>{Se(this,Kr)[Kr]()},2e3)}o(dx,"_beginPolling2");async function px(i){let{diff:e=!0}=i===void 0?{}:i;if(!(this.closed||Se(this,Fo)[Fo].isPaused||Se(this,Po)[Po]))try{Se(this,Po)[Po]=!0;let t=await Se(this,gl)[gl](this.status.assembly_ssl_url);if(Se(this,Po)[Po]=!1,this.closed)return;if(t.status===429){Se(this,Fo)[Fo].rateLimit(2e3);return}if(!t.ok){Se(this,zi)[zi](new It(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,zi)[zi](t)}}o(px,"_fetchStatus2");function fx(i,e){let t=i.ok,r=e.ok;if(e.error&&!i.error)return Se(this,zi)[zi](e);let s=lc(r,Qp)&&!lc(t,Qp);s&&this.emit("executing"),Object.keys(e.uploads).filter(n=>!ni(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],u=i.results[n];a.filter(l=>!u||!u.some(h=>h.id===l.id)).forEach(l=>{this.emit("result",n,l)})}),lc(r,Jp)&&!lc(t,Jp)&&this.emit("finished")}o(fx,"_diffStatus2");var tf=ef;function He(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(He,"_classPrivateFieldLooseBase");var mx=0;function uc(i){return"__private_"+mx+++"_"+i}o(uc,"_classPrivateFieldLooseKey");var F0="/assemblies",rf=class extends Error{static{o(this,"AssemblyError")}constructor(e,t,r){super(e),this.details=t,this.assembly=r}},Gt=uc("headers"),yl=uc("fetchWithNetworkError"),Rt=uc("fetchJSON"),bi=uc("reportError"),vl=class{static{o(this,"Client")}constructor(e){Object.defineProperty(this,Rt,{value:gx}),Object.defineProperty(this,Gt,{writable:!0,value:{}}),Object.defineProperty(this,yl,{writable:!0,value:void 0}),Object.defineProperty(this,bi,{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&&(He(this,Gt)[Gt]["Transloadit-Client"]=this.opts.client),He(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(l=>{a.append(l,String(r[l]))}),a.append("num_expected_upload_files",String(n));let u=new URL(F0,`${this.opts.service}`).href;return He(this,Rt)[Rt](u,{method:"POST",headers:He(this,Gt)[Gt],body:a}).catch(l=>He(this,bi)[bi](l,{url:u,type:"API_ERROR"}))}async reserveFile(e,t){let r=encodeURIComponent(t.size),s=`${e.assembly_ssl_url}/reserve_file?size=${r}`;return He(this,Rt)[Rt](s,{method:"POST",headers:He(this,Gt)[Gt]}).catch(n=>He(this,bi)[bi](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),u=`size=${r}&filename=${n}&fieldname=file&s3Url=${s}`,l=`${e.assembly_ssl_url}/add_file?${u}`;return He(this,Rt)[Rt](l,{method:"POST",headers:He(this,Gt)[Gt]}).catch(h=>He(this,bi)[bi](h,{assembly:e,file:t,url:l,type:"API_ERROR"}))}async updateNumberOfFilesInAssembly(e,t){let r=new URL(e.assembly_ssl_url);r.pathname="/update_assemblies";let s=JSON.stringify({assembly_updates:[{assembly_id:e.assembly_id,num_expected_upload_files:t}]});return He(this,Rt)[Rt](r,{method:"POST",headers:He(this,Gt)[Gt],body:s}).catch(n=>He(this,bi)[bi](n,{url:r,type:"API_ERROR"}))}async cancelAssembly(e){let t=e.assembly_ssl_url;return He(this,Rt)[Rt](t,{method:"DELETE",headers:He(this,Gt)[Gt]}).catch(r=>He(this,bi)[bi](r,{url:t,type:"API_ERROR"}))}async getAssemblyStatus(e){return He(this,Rt)[Rt](e,{headers:He(this,Gt)[Gt]}).catch(t=>He(this,bi)[bi](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 He(this,Rt)[Rt]("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 gx(){let i=await He(this,yl)[yl](...arguments);if(i.status===429)return this.opts.rateLimitedQueue.rateLimit(2e3),He(this,Rt)[Rt](...arguments);if(!i.ok){let e=new Error(i.statusText);return e.statusCode=i.status,`${arguments.length<=0?void 0:arguments[0]}`.endsWith(F0)?i.json().then(t=>{if(!t.error)throw e;let r=new rf(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(gx,"_fetchJSON2");function of(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(of,"validateParams");function yx(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(yx,"dedupe");async function x0(i,e){let t=typeof e.assemblyOptions=="function"?await e.assemblyOptions(i,e):e.assemblyOptions;of(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(x0,"getAssemblyOptions");var sf=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 x0(t,e);if(t!=null)return{fileIDs:[t.id],options:r}})).then(yx);if(e.alwaysRunAssembly){let t=await x0(null,e);return[{fileIDs:[],options:t}]}return[]}},E0=sf;var O0=be(Gp(),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 vx=0;function wi(i){return"__private_"+vx+++"_"+i}o(wi,"_classPrivateFieldLooseKey");var bl=wi("assemblyIDs"),Eo=wi("remaining"),wl=wi("resolve"),nf=wi("reject"),ke=wi("uppy"),Xr=wi("watching"),Sl=wi("onAssemblyComplete"),_l=wi("onAssemblyCancel"),Oo=wi("onAssemblyError"),Pl=wi("onImportError"),xo=wi("checkAllComplete"),lf=wi("removeListeners"),af=wi("addListeners"),uf=class extends O0.default{static{o(this,"TransloaditAssemblyWatcher")}constructor(e,t){super(),Object.defineProperty(this,af,{value:_x}),Object.defineProperty(this,lf,{value:Sx}),Object.defineProperty(this,xo,{value:wx}),Object.defineProperty(this,Xr,{value:bx}),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,nf,{writable:!0,value:void 0}),Object.defineProperty(this,ke,{writable:!0,value:void 0}),Object.defineProperty(this,Sl,{writable:!0,value:r=>{pe(this,Xr)[Xr](r.assembly_id)&&(pe(this,ke)[ke].log(`[Transloadit] AssemblyWatcher: Got Assembly finish ${r.assembly_id}`),this.emit("assembly-complete",r.assembly_id),pe(this,xo)[xo]())}}),Object.defineProperty(this,_l,{writable:!0,value:r=>{pe(this,Xr)[Xr](r.assembly_id)&&pe(this,xo)[xo]()}}),Object.defineProperty(this,Oo,{writable:!0,value:(r,s)=>{pe(this,Xr)[Xr](r.assembly_id)&&(pe(this,ke)[ke].log(`[Transloadit] AssemblyWatcher: Got Assembly error ${r.assembly_id}`),pe(this,ke)[ke].log(s),this.emit("assembly-error",r.assembly_id,s),pe(this,xo)[xo]())}}),Object.defineProperty(this,Pl,{writable:!0,value:(r,s,n)=>{pe(this,Xr)[Xr](r.assembly_id)&&pe(this,Oo)[Oo](r,n)}}),pe(this,ke)[ke]=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,nf)[nf]=s}),pe(this,af)[af]()}};function bx(i){return pe(this,bl)[bl].indexOf(i)!==-1}o(bx,"_watching2");function wx(){pe(this,Eo)[Eo]-=1,pe(this,Eo)[Eo]===0&&(pe(this,lf)[lf](),pe(this,wl)[wl]())}o(wx,"_checkAllComplete2");function Sx(){pe(this,ke)[ke].off("transloadit:complete",pe(this,Sl)[Sl]),pe(this,ke)[ke].off("transloadit:assembly-cancel",pe(this,_l)[_l]),pe(this,ke)[ke].off("transloadit:assembly-error",pe(this,Oo)[Oo]),pe(this,ke)[ke].off("transloadit:import-error",pe(this,Pl)[Pl])}o(Sx,"_removeListeners2");function _x(){pe(this,ke)[ke].on("transloadit:complete",pe(this,Sl)[Sl]),pe(this,ke)[ke].on("transloadit:assembly-cancel",pe(this,_l)[_l]),pe(this,ke)[ke].on("transloadit:assembly-error",pe(this,Oo)[Oo]),pe(this,ke)[ke].on("transloadit:import-error",pe(this,Pl)[Pl])}o(_x,"_addListeners2");var C0=uf;var A0={strings:{creatingAssembly:"Preparing upload...",creatingAssemblyFailed:"Transloadit: Could not create Assembly",encoding:"Encoding..."}};function fe(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(fe,"_classPrivateFieldLooseBase");var Px=0;function Ke(i){return"__private_"+Px+++"_"+i}o(Ke,"_classPrivateFieldLooseKey");var Fx={version:"3.6.1"},T0=o(i=>e=>{let t=new pr("Failed to send error to the client",{cause:e});console.error(t,i)},"sendErrorToConsole"),_f="https://api2.transloadit.com/companion",Pf=/\.transloadit\.com$/,xx=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/companion/,Ex={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=Ke("rateLimitedQueue"),cf=Ke("getClientVersion"),bf=Ke("attachAssemblyMetadata"),hf=Ke("createAssembly"),Fl=Ke("createAssemblyWatcher"),df=Ke("shouldWaitAfterUpload"),pf=Ke("reserveFiles"),xl=Ke("onFileUploadURLAvailable"),Tl=Ke("findFile"),wf=Ke("onFileUploadComplete"),Sf=Ke("onResult"),Al=Ke("onAssemblyFinished"),Rl=Ke("cancelAssembly"),ff=Ke("onCancelAll"),mf=Ke("getPersistentData"),gf=Ke("onRestored"),El=Ke("connectAssembly"),Ol=Ke("prepareUpload"),Co=Ke("afterUpload"),yf=Ke("closeAssemblyIfExists"),Cl=Ke("onError"),vf=Ke("onTusError"),$i=class extends Ee{static{o(this,"Transloadit")}constructor(e,t){var r,s,n,a;super(e,{...Ex,...t}),r=this,Object.defineProperty(this,El,{value:Mx}),Object.defineProperty(this,Rl,{value:Nx}),Object.defineProperty(this,Al,{value:Lx}),Object.defineProperty(this,Sf,{value:Ix}),Object.defineProperty(this,wf,{value:Dx}),Object.defineProperty(this,Tl,{value:Ux}),Object.defineProperty(this,pf,{value:kx}),Object.defineProperty(this,df,{value:Rx}),Object.defineProperty(this,Fl,{value:Tx}),Object.defineProperty(this,hf,{value:Ax}),Object.defineProperty(this,bf,{value:Cx}),Object.defineProperty(this,cf,{value:Ox}),Object.defineProperty(this,Hi,{writable:!0,value:void 0}),Object.defineProperty(this,xl,{writable:!0,value:u=>{var l;let h=this.uppy.getFile(u.id);if(!(h!=null&&(l=h.transloadit)!=null&&l.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(u){let{reason:l}=u===void 0?{}:u;try{if(l!=="user")return;let{uploadsAssemblies:h}=r.getPluginState(),f=Object.values(h).flat(1).map(y=>r.getAssembly(y));await Promise.all(f.map(y=>fe(r,Rl)[Rl](y)))}catch(h){r.uppy.log(h)}}}),Object.defineProperty(this,mf,{writable:!0,value:u=>{let{assemblies:l,uploadsAssemblies:h}=this.getPluginState();u({[this.id]:{assemblies:l,uploadsAssemblies:h}})}}),Object.defineProperty(this,gf,{writable:!0,value:u=>{let l=u&&u[this.id]?u[this.id]:{},h=l.assemblies||{},d=l.uploadsAssemblies||{};if(Object.keys(d).length===0)return;let f=o(S=>{let A={},O=[];for(let[P,R]of Object.entries(S)){R.uploads.forEach(X=>{let K=fe(this,Tl)[Tl](X);A[X.id]={id:K.id,assembly:P,uploadedFile:X}});let H=this.getPluginState();Object.keys(R.results).forEach(X=>{for(let K of R.results[X]){let V=H.files[K.original_id];K.localId=V?V.id:null,O.push({id:K.id,result:K,stepName:X,assembly:P})}})}this.setPluginState({assemblies:S,files:A,results:O,uploadsAssemblies:d})},"restoreState"),y=o(()=>{let{assemblies:S,uploadsAssemblies:A}=this.getPluginState();Object.keys(A).forEach(P=>{let R=A[P];fe(this,Fl)[Fl](R,P)}),Object.keys(S).forEach(P=>{let R=new tf(S[P],fe(this,Hi)[Hi]);fe(this,El)[El](R)})},"restoreAssemblies"),b=o(()=>{let{assemblies:S}=this.getPluginState();return Promise.all(Object.keys(S).map(A=>this.activeAssemblies[A].update()))},"updateAssemblies");this.restored=Promise.resolve().then(()=>{f(h),y(),b()}),this.restored.then(()=>{this.restored=null})}}),Object.defineProperty(this,Ol,{writable:!0,value:async(u,l)=>{let d=u.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:A,options:O}=S;try{let P=await fe(this,hf)[hf](A,l,O);return this.opts.importFromUploadURLs&&await fe(this,pf)[pf](P,A),A.forEach(R=>{let H=this.uppy.getFile(R);this.uppy.emit("preprocess-complete",H)}),P}catch(P){throw A.forEach(R=>{let H=this.uppy.getFile(R);this.uppy.emit("preprocess-complete",H),this.uppy.emit("upload-error",H,P)}),P}},"createAssembly"),{uploadsAssemblies:y}=this.getPluginState();this.setPluginState({uploadsAssemblies:{...y,[l]:[]}}),await new E0(d,this.opts).build().then(S=>Promise.all(S.map(f))).then(S=>{let A=S.filter(Boolean),O=A.map(P=>P.status.assembly_id);return fe(this,Fl)[Fl](O,l),Promise.all(A.map(P=>fe(this,El)[El](P)))}).catch(S=>{throw d.forEach(A=>{this.uppy.emit("preprocess-complete",A),this.uppy.emit("upload-error",A,S)}),S})}}),Object.defineProperty(this,Co,{writable:!0,value:(u,l)=>{let h=u.map(O=>this.uppy.getFile(O)),d=h.filter(O=>!O.error).map(O=>O.id),f=this.getPluginState();if(this.restored)return this.restored.then(()=>fe(this,Co)[Co](d,l));let y=f.uploadsAssemblies[l],b=o(()=>{y.forEach(O=>{this.activeAssemblies[O].close(),delete this.activeAssemblies[O]})},"closeSocketConnections");if(!fe(this,df)[df]()){b();let O=y.map(P=>this.getAssembly(P));return this.uppy.addResultData(l,{transloadit:O}),Promise.resolve()}return y.length===0?(this.uppy.addResultData(l,{transloadit:[]}),Promise.resolve()):(h.filter(O=>!ni(this.completedFiles,O.id)).forEach(O=>{this.uppy.emit("postprocess-progress",O,{mode:"indeterminate",message:this.i18n("encoding")})}),this.assemblyWatchers[l].promise.then(()=>{b();let O=y.map(R=>this.getAssembly(R)),P={...this.getPluginState().uploadsAssemblies};delete P[l],this.setPluginState({uploadsAssemblies:P}),this.uppy.addResultData(l,{transloadit:O})}))}}),Object.defineProperty(this,yf,{writable:!0,value:u=>{var l;u&&((l=this.activeAssemblies[u])==null||l.close())}}),Object.defineProperty(this,Cl,{writable:!0,value:u=>{this.client.submitError(u).catch(T0(u))}}),Object.defineProperty(this,vf,{writable:!0,value:(u,l)=>{var h,d;if(fe(this,yf)[yf](u==null||(h=u.transloadit)==null?void 0:h.assembly),l!=null&&(d=l.message)!=null&&d.startsWith("tus: ")){var f;let y=(f=l.originalRequest)==null||(f=f.getUnderlyingObject())==null?void 0:f.responseURL;this.client.submitError(l,{endpoint:y}).catch(T0(l))}}}),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&&of(this.opts.assemblyOptions.params),fe(this,Hi)[Hi]=new Zt(this.opts.limit),this.i18nInit(),this.client=new vl({service:this.opts.service,client:fe(this,cf)[cf](),errorReporting:this.opts.errorReporting,rateLimitedQueue:fe(this,Hi)[Hi]}),this.activeAssemblies={},this.assemblyWatchers={},this.completedFiles=Object.create(null)}install(){this.uppy.addPreProcessor(fe(this,Ol)[Ol]),this.uppy.addPostProcessor(fe(this,Co)[Co]),this.uppy.on("error",fe(this,Cl)[Cl]),this.uppy.on("cancel-all",fe(this,ff)[ff]),this.uppy.on("upload-error",fe(this,vf)[vf]),this.opts.importFromUploadURLs?this.uppy.on("upload-success",fe(this,xl)[xl]):this.uppy.use(Gr,{storeFingerprintForResuming:!1,allowedMetaFields:["assembly_url","filename","fieldname"],limit:this.opts.limit,rateLimitedQueue:fe(this,Hi)[Hi],retryDelays:this.opts.retryDelays}),this.uppy.on("restore:get-data",fe(this,mf)[mf]),this.uppy.on("restored",fe(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(fe(this,Ol)[Ol]),this.uppy.removePostProcessor(fe(this,Co)[Co]),this.uppy.off("error",fe(this,Cl)[Cl]),this.opts.importFromUploadURLs&&this.uppy.off("upload-success",fe(this,xl)[xl]);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 Ox(){let i=[`uppy-core:${this.uppy.constructor.VERSION}`,`uppy-transloadit:${this.constructor.VERSION}`,`uppy-tus:${Gr.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("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(Ox,"_getClientVersion2");function Cx(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&&xx.test(i.remote.companionUrl)){let a=e.companion_url.replace(/\/$/,""),u=i.remote.url.replace(i.remote.companionUrl,"").replace(/^\//,"");s={...i.remote,companionUrl:a,url:`${a}/${u}`}}let n={...i,transloadit:{assembly:e.assembly_id}};return this.opts.importFromUploadURLs||Object.assign(n,{meta:t,tus:r,remote:s}),n}o(Cx,"_attachAssemblyMetadata2");function Ax(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:b}=y;return i.includes(b)});if(s.length!==i.length){if(s.length===0)return await this.client.cancelAssembly(r),null;await this.client.updateNumberOfFilesInAssembly(r,s.length)}let n=new tf(r,fe(this,Hi)[Hi]),{status:a}=n,u=a.assembly_id,{assemblies:l,uploadsAssemblies:h}=this.getPluginState();this.setPluginState({assemblies:{...l,[u]:a},uploadsAssemblies:{...h,[e]:[...h[e],u]}});let d={};s.forEach(y=>{d[y.id]=fe(this,bf)[bf](y,a)}),this.uppy.setState({files:{...this.uppy.getState().files,...d}});let f=o((y,b)=>{var S;if(((S=n.status)==null?void 0:S.ok)==="ASSEMBLY_COMPLETED"){this.uppy.off("file-removed",f);return}if(b==="cancel-all")n.close(),this.uppy.off("file-removed",f);else if(y.id in d){delete d[y.id];let A=Object.keys(d).length;A===0?(n.close(),fe(this,Rl)[Rl](r).catch(()=>{}),this.uppy.off("file-removed",f)):this.client.updateNumberOfFilesInAssembly(r,A).catch(()=>{})}},"fileRemovedHandler");return this.uppy.on("file-removed",f),this.uppy.emit("transloadit:assembly-created",a,i),this.uppy.log(`[Transloadit] Created Assembly ${u}`),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(Ax,"_createAssembly2");function Tx(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(l=>{this.uppy.emit("upload-error",l,n),this.uppy.emit("postprocess-complete",l)});let u={...this.uppy.getState().files};a.forEach(l=>delete u[l.id].tus),this.uppy.setState({files:u}),this.uppy.emit("error",n)}),this.assemblyWatchers[e]=r}o(Tx,"_createAssemblyWatcher2");function Rx(){return this.opts.waitForEncoding||this.opts.waitForMetadata}o(Rx,"_shouldWaitAfterUpload2");function kx(i,e){return Promise.all(e.map(t=>{let r=this.uppy.getFile(t);return this.client.reserveFile(i.status,r)}))}o(kx,"_reserveFiles2");function Ux(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(Ux,"_findFile2");function Dx(i,e){let t=this.getPluginState(),r=fe(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(Dx,"_onFileUploadComplete2");function Ix(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]}),this.uppy.emit("transloadit:result",e,t,this.getAssembly(i))}o(Ix,"_onResult2");function Lx(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(Lx,"_onAssemblyFinished2");async function Nx(i){await this.client.cancelAssembly(i),this.uppy.emit("transloadit:assembly-cancelled",i)}o(Nx,"_cancelAssembly2");function Mx(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=>{fe(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)=>{fe(this,Sf)[Sf](t,r,s)}),this.opts.waitForEncoding?i.on("finished",()=>{fe(this,Al)[Al](i.status)}):this.opts.waitForMetadata&&i.on("metadata",()=>{fe(this,Al)[Al](i.status)}),i.ok==="ASSEMBLY_COMPLETE"||i.connect(),i}o(Mx,"_connectAssembly2");$i.VERSION=Fx.version;$i.COMPANION=_f;$i.COMPANION_PATTERN=Pf;var cc=o(()=>{},"noop");function R0(i,e){e===void 0&&(e={});let{body:t=null,headers:r={},method:s="GET",onBeforeRequest:n=cc,onUploadProgress:a=cc,shouldRetry:u=o(()=>!0,"shouldRetry"),onAfterRequest:l=cc,onTimeout:h=cc,responseType:d,retries:f=3,signal:y=null,timeout:b=3e4,withCredentials:S=!1}=e,A=o(R=>.3*2**(R-1)*1e3,"delay"),O=new Ju(b,h);function P(R){return R===void 0&&(R=0),new Promise(async(H,X)=>{let K=new XMLHttpRequest;K.open(s,i,!0),K.withCredentials=S,d&&(K.responseType=d),y?.addEventListener("abort",()=>{K.abort(),X(new DOMException("Aborted","AbortError"))}),K.onload=async()=>{await l(K,R),K.status>=200&&K.status<300?(O.done(),H(K)):u(K)&&R<f?setTimeout(()=>{P(R+1).then(H,X)},A(R)):(O.done(),X(new It(K.statusText,K)))},K.onerror=()=>{u(K)&&R<f?setTimeout(()=>{P(R+1).then(H,X)},A(R)):(O.done(),X(new It(K.statusText,K)))},K.upload.onprogress=V=>{O.progress(),a(V)},r&&Object.keys(r).forEach(V=>{K.setRequestHeader(V,r[V])}),await n(K,R),K.send(t)})}return o(P,"requestWithRetry"),P()}o(R0,"fetcher");var k0={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Yr(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Yr,"_classPrivateFieldLooseBase");var Bx=0;function cn(i){return"__private_"+Bx+++"_"+i}o(cn,"_classPrivateFieldLooseKey");var jx={version:"3.6.6"};function zx(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 It(t,i),t):(t.request=i,t)}o(zx,"buildResponseError");function U0(i){return i.data.slice(0,i.data.size,i.meta.type)}o(U0,"setTypeInBlob");var Hx={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 It(t,e)),t},validateStatus(i){return i>=200&&i<300}},Ao=cn("getFetcher"),Ef=cn("uploadLocalFile"),Ff=cn("uploadBundle"),Of=cn("getCompanionClientArgs"),xf=cn("uploadFiles"),kl=cn("handleUpload"),un=class extends Ee{static{o(this,"XHRUpload")}constructor(e,t){if(super(e,{...Hx,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,xf,{value:Wx}),Object.defineProperty(this,Of,{value:Vx}),Object.defineProperty(this,Ff,{value:qx}),Object.defineProperty(this,Ef,{value:$x}),Object.defineProperty(this,Ao,{writable:!0,value:void 0}),Object.defineProperty(this,kl,{writable:!0,value:async r=>{if(r.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[os]&&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=ns(s),a=as(n);if(this.uppy.emit("upload-start",a),this.opts.bundle){if(n.some(l=>l.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 Yr(this,Ff)[Ff](n)}else await Yr(this,xf)[xf](n)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=k0,this.i18nInit(),os in this.opts?this.requests=this.opts[os]:this.requests=new Zt(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),Yr(this,Ao)[Ao]=r=>async(s,n)=>{try{let a=await R0(s,{...n,onTimeout:h=>{let d=Math.ceil(h/1e3),f=new Error(this.i18n("uploadStalled",{seconds:d}));this.uppy.emit("upload-stalled",f,r)},onUploadProgress:h=>{if(h.lengthComputable)for(let d of r)this.uppy.emit("upload-progress",d,{uploader:this,bytesUploaded:h.loaded/h.total*d.size,bytesTotal:d.size})}});if(!this.opts.validateStatus(a.status,a.responseText,a))throw new It(a.statusText,a);let u=this.opts.getResponseData(a.responseText,a),l=u?.[this.opts.responseUrlFieldName];for(let h of r)this.uppy.emit("upload-success",h,{status:a.status,body:u,uploadURL:l});return a}catch(a){if(a.name==="AbortError")return;if(a instanceof It){let u=a.request,l=zx(u,this.opts.getResponseError(u.responseText,u));for(let h of r)this.uppy.emit("upload-error",h,l)}throw a}}}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(u=>e.append(n,u)):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),u=U0(n);n.name?r.append(a.fieldName,u,n.name):r.append(a.fieldName,u)}),r}install(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(Yr(this,kl)[kl])}uninstall(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(Yr(this,kl)[kl])}};async function $x(i){let e=new jr(this.uppy),t=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{let s=this.getOptions(i),n=Yr(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($x,"_uploadLocalFile2");async function qx(i){let e=new AbortController,t=this.requests.wrapPromiseFunction(async()=>{var s;let n=(s=this.uppy.getState().xhrUpload)!=null?s:{},a=Yr(this,Ao)[Ao](i),u=this.createBundledUpload(i,{...this.opts,...n});return a(this.opts.endpoint,{...this.opts,body:u,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(qx,"_uploadBundle2");function Vx(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(Vx,"_getCompanionClientArgs2");async function Wx(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,Yr(this,Of)[Of](e),{signal:r.signal,getQueue:t});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),n}return Yr(this,Ef)[Ef](e)}))}o(Wx,"_uploadFiles2");un.VERSION=jx.version;var Tf=be(Fn(),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 Gx=0;function Kx(i){return"__private_"+Gx+++"_"+i}o(Kx,"_classPrivateFieldLooseKey");var Ul=Kx("RateLimitedQueue"),Dl=class extends Ee{static{o(this,"Compressor")}constructor(e,t){super(e,t),Object.defineProperty(this,Ul,{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,Ul)[Ul]=new Zt(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,Ul)[Ul].wrapPromiseFunction(async a=>{try{let u=await this.compress(a.data),l=a.data.size-u.size;this.uppy.log(`[Image Compressor] Image ${a.id} compressed by ${(0,Tf.default)(l)}`),t+=l;let{name:h,type:d,size:f}=u,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:u,meta:{...a.meta,type:d,name:S}}),r.push(a)}catch(u){this.uppy.log(`[Image Compressor] Failed to compress ${a.id}:`,"warning"),this.uppy.log(u,"warning")}}),n=e.map(a=>{var u;let l=this.uppy.getFile(a);return this.uppy.emit("preprocess-progress",l,{mode:"indeterminate",message:this.i18n("compressingImages")}),l.isRemote||(l.data.type||(l.data=l.data.slice(0,l.data.size,l.type)),!((u=l.type)!=null&&u.startsWith("image/")))?Promise.resolve():s(l)});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 u=this.uppy.getFile(a);this.uppy.emit("preprocess-complete",u)}}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};function hc(){return hc=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},hc.apply(this,arguments)}o(hc,"_extends");var Xx={"[object HTMLCollection]":!0,"[object NodeList]":!0,"[object RadioNodeList]":!0},Yx={button:!0,fieldset:!0,reset:!0,submit:!0},Qx={checkbox:!0,radio:!0},Jx=/^\s+|\s+$/g,Zx=Array.prototype.slice,M0=Object.prototype.toString;function dc(i,e){if(!i)throw new Error("A form is required by getFormData, was given form="+i);e=hc({includeDisabled:!1,trim:!1},e);for(var t={},r,s=[],n={},a=0,u=i.elements.length;a<u;a++){var l=i.elements[a];Yx[l.type]||l.disabled&&!e.includeDisabled||(r=l.name||l.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(dc,"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=hc({includeDisabled:!1,trim:!1},t);var r=i.elements[e];if(!r||r.disabled&&!t.includeDisabled)return null;if(!Xx[M0.call(r)])return B0(r,t.trim);for(var s=[],n=!0,a=0,u=r.length;a<u;a++)if(!(r[a].disabled&&!t.includeDisabled)){n&&r[a].type!=="radio"&&(n=!1);var l=B0(r[a],t.trim);l!=null&&(s=s.concat(l))}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=Zx.call(i.files),t.length===0&&(t=null)):t=i.files[0],t):(Qx[r]?i.checked&&(r==="checkbox"&&!i.hasAttribute("value")?t=!0:t=i.value):t=e?i.value.replace(Jx,""):i.value,t)}o(B0,"getFormElementValue");dc.getFieldData=j0;function Rf(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Rf,"_classPrivateFieldLooseBase");var eE=0;function tE(i){return"__private_"+eE+++"_"+i}o(tE,"_classPrivateFieldLooseKey");var iE={version:"3.2.1"},rE={resultName:"uppyResult",getMetaFromForm:!0,addResultToForm:!0,submitOnSuccess:!1,triggerUploadOnSubmit:!1};function sE(i){if(i==null||i.nodeName!=="FORM")throw new Error("ASSERTION FAILED: the target is not a <form> element",{cause:i});return i}o(sE,"assertHTMLFormElement");var To=tE("completed"),hn=class extends Ee{static{o(this,"Form")}constructor(e,t){super(e,{...rE,...t}),Object.defineProperty(this,To,{writable:!0,value:!1}),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(){Rf(this,To)[To]=!1,this.opts.getMetaFromForm&&this.getMetaFromForm()}handleSuccess(e){Rf(this,To)[To]=!0,this.opts.addResultToForm&&this.addResultToForm(e),this.opts.submitOnSuccess&&this.form.requestSubmit()}handleFormSubmit(e){if(this.opts.triggerUploadOnSubmit&&!Rf(this,To)[To]){e.preventDefault();let t=st(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=dc(this.form);delete e[this.opts.resultName],this.uppy.setMeta(e)}install(){this.form=sE(nu(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)}};hn.VERSION=iE.version;var J0=be(Gl(),1);function Ro(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Ro,"_classPrivateFieldLooseBase");var oE=0;function nE(i){return"__private_"+oE+++"_"+i}o(nE,"_classPrivateFieldLooseKey");var z0=typeof navigator<"u"&&"serviceWorker"in navigator;function aE(){return new Promise((i,e)=>{z0?navigator.serviceWorker.controller?i():navigator.serviceWorker.addEventListener("controllerchange",()=>{i()}):e(new Error("Unsupported"))})}o(aE,"waitForServiceWorker");var Kt=nE("ready"),pc=class{static{o(this,"ServiceWorkerStore")}constructor(e){Object.defineProperty(this,Kt,{writable:!0,value:void 0}),Ro(this,Kt)[Kt]=aE().then(t=>{Ro(this,Kt)[Kt]=t}),this.name=e.storeName}get ready(){return Promise.resolve(Ro(this,Kt)[Kt])}set ready(e){Ro(this,Kt)[Kt]=e}async list(){return await Ro(this,Kt)[Kt],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 Ro(this,Kt)[Kt],navigator.serviceWorker.controller.postMessage({type:"uppy/ADD_FILE",store:this.name,file:e})}async delete(e){await Ro(this,Kt)[Kt],navigator.serviceWorker.controller.postMessage({type:"uppy/REMOVE_FILE",store:this.name,fileID:e})}};pc.isSupported=z0;var H0=pc;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 lE=0;function uE(i){return"__private_"+lE+++"_"+i}o(uE,"_classPrivateFieldLooseKey");var G0=typeof window<"u"&&(window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB),cE=!!G0,$0="uppy-blobs",ti="files",K0=24*60*60*1e3,hE=3,q0=1048576;function dE(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(dE,"migrateExpiration");function V0(i){let e=G0.open(i,hE);return new Promise((t,r)=>{e.onupgradeneeded=s=>{let n=s.target.result,a=s.currentTarget.transaction;if(s.oldVersion<2&&n.createObjectStore(ti,{keyPath:"id"}).createIndex("store","store",{unique:!1}),s.oldVersion<3){let u=a.objectStore(ti);u.createIndex("expires","expires",{unique:!1}),dE(u)}a.oncomplete=()=>{t(n)}},e.onsuccess=s=>{t(s.target.result)},e.onerror=r})}o(V0,"connect");function fc(i){return new Promise((e,t)=>{i.onsuccess=r=>{e(r.target.result)},i.onerror=t})}o(fc,"waitForRequest");var W0=!1,et=uE("ready"),mc=class i{static{o(this,"IndexedDBStore")}constructor(e){Object.defineProperty(this,et,{writable:!0,value:void 0}),this.opts={dbName:$0,storeName:"default",expires:K0,maxFileSize:10*q0,maxTotalSize:300*q0,...e},this.name=this.opts.storeName;let t=o(async()=>{let r=await V0(this.opts.dbName);return ir(this,et)[et]=r,r},"createConnection");W0?ir(this,et)[et]=t():(W0=!0,ir(this,et)[et]=i.cleanup().then(t,t))}get ready(){return Promise.resolve(ir(this,et)[et])}set ready(e){ir(this,et)[et]=e}key(e){return`${this.name}!${e}`}async list(){let s=(await ir(this,et)[et]).transaction([ti],"readonly").objectStore(ti).index("store").getAll(IDBKeyRange.only(this.name)),n=await fc(s);return Object.fromEntries(n.map(a=>[a.fileID,a.data]))}async get(e){let s=(await ir(this,et)[et]).transaction([ti],"readonly").objectStore(ti).get(this.key(e)),{data:n}=await fc(s);return{id:n.fileID,data:n.data}}async getSize(){let s=(await ir(this,et)[et]).transaction([ti],"readonly").objectStore(ti).index("store").openCursor(IDBKeyRange.only(this.name));return new Promise((n,a)=>{let u=0;s.onsuccess=l=>{let h=l.target.result;h?(u+=h.value.data.size,h.continue()):n(u)},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,et)[et]).transaction([ti],"readwrite").objectStore(ti).add({id:this.key(e.id),fileID:e.id,store:this.name,expires:Date.now()+this.opts.expires,data:e.data});return fc(n)}async delete(e){let s=(await ir(this,et)[et]).transaction([ti],"readwrite").objectStore(ti).delete(this.key(e));return fc(s)}static async cleanup(){let e=await V0($0),s=e.transaction([ti],"readwrite").objectStore(ti).index("expires").openCursor(IDBKeyRange.upperBound(Date.now()));await new Promise((n,a)=>{s.onsuccess=u=>{let l=u.target.result;l?(l.delete(),l.continue()):n()},s.onerror=a}),e.close()}};mc.isSupported=cE;var X0=mc;function pE(){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(pE,"findUppyInstances");function Y0(i){try{return JSON.parse(i)}catch{return null}}o(Y0,"maybeParse");var Q0=!1,cs=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=pE(),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 fE={version:"3.2.0"},mE={expires:24*60*60*1e3,serviceWorker:!1},dn=class extends Ee{static{o(this,"GoldenRetriever")}constructor(e,t){super(e,{...mE,...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}),cs.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}),cs.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 cs({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}),cs.cleanup(this.uppy.opts.id);return}let r=Object.fromEntries(t.map(a=>{let[u,l]=a;return[u,l.isRemote?{...l,isRestored:!0}:{...l,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 u={data:e[s],isRestored:!0,isGhost:!1};r[s]={...n,...u}}),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)}};dn.VERSION=fE.version;var gE={version:"3.0.3"},pn=class extends ae{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))}};pn.VERSION=gE.version;function yE(){throw new Error("Core has been renamed to Uppy")}o(yE,"Core");var vE={ProviderView:bh};$i.COMPANION_URL=_f;$i.COMPANION_ALLOWED_HOSTS=Pf;var bE={};globalThis.Uppy=kf;})();
/**
* 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