"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{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{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=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{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{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var t=[],r=0;r{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;gv.length)&&(p=v.length);for(var g=0,m=new Array(p);g
',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;F0&&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;I1&&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"&&U90?{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;F0;)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=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.widthm.maxHeight||m.heightg.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.widthm.maxHeight||m.height=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)&>(p,ge,g.cropstart),St(g.cropmove)&>(p,Ce,g.cropmove),St(g.cropend)&>(p,Q,g.cropend),St(g.crop)&>(p,Y,g.crop),St(g.zoom)&>(p,hs,g.zoom),gt(m,kt,this.onCropStart),g.zoomable&&g.zoomOnWheel&>(m,rr,this.onWheel,{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&>(m,ue,this.onDblclick),gt(p.ownerDocument,qe,this.onCropMove),gt(p.ownerDocument,oe,this.onCropEnd),g.responsive&>(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.xyt&&(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?yePe&&($-=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=0&&(ye>=nt||me>=yt)){it=!1;break}Fe(V),I+=G.x,$=I/q}else Fe(te),Fe(V),G.x>=0?ye=0&&me>=yt&&(it=!1):I+=G.x,G.y>=0?me0?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 or 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{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{(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"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"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;Y0;)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=8&&(Q=ce+Ne)}}}if(Q){var kt=T.getUint16(Q,N),qe,oe;for(oe=0;oe1&&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"&&ge1&&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.maxWidthYs,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{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{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{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{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length{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.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{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;e0?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;f2&&(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(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