 v(b,h);var g=Object.prototype.toString.call(b).slice(8,-1);if(g==="Object"&&b.constructor&&(g=b.constructor.name),g==="Map"||g==="Set")return Array.from(b);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return v(b,h)}}o(y,"_unsupportedIterableToArray");function v(b,h){(h==null||h>b.length)&&(h=b.length);for(var g=0,m=new Array(h);g<h;g++)m[g]=b[g];return m}o(v,"_arrayLikeToArray");function _(){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(_,"_nonIterableSpread");var R=typeof window<"u"&&typeof window.document<"u",E=R?window:{},O=R&&E.document.documentElement?"ontouchstart"in E.document.documentElement:!1,L=R?"PointerEvent"in E:!1,B="cropper",G="all",J="crop",$="move",W="zoom",te="e",ae="w",ke="s",Ae="n",qe="ne",Fe="nw",Re="se",Xe="sw",C="".concat(B,"-crop"),S="".concat(B,"-disabled"),P="".concat(B,"-hidden"),M="".concat(B,"-hide"),H="".concat(B,"-invisible"),j="".concat(B,"-modal"),U="".concat(B,"-move"),T="".concat(B,"Action"),k="".concat(B,"Preview"),N="crop",Y="move",Q="none",Ee="crop",de="cropend",ue="cropmove",ce="cropstart",Ue="dblclick",Me=O?"touchstart":"mousedown",Rt=O?"touchmove":"mousemove",Ve=O?"touchend touchcancel":"mouseup",le=L?"pointerdown":Me,Ot=L?"pointermove":Rt,Ye=L?"pointerup pointercancel":Ve,Wr="ready",po="resize",zi="wheel",Gr="zoom",ji="image/jpeg",es=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Hi=/^data:/,ut=/^data:image\/jpeg;base64,/,ct=/^img|canvas$/i,Zo=200,en=100,tn={viewMode:0,dragMode:N,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:Zo,minContainerHeight:en,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},bl='<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>',wl=Number.isNaN||E.isNaN;function pe(b){return typeof b=="number"&&!wl(b)}o(pe,"isNumber");var rn=o(function(h){return h>0&&h<1/0},"isPositiveNumber");function ho(b){return typeof b>"u"}o(ho,"isUndefined");function Nr(b){return s(b)==="object"&&b!==null}o(Nr,"isObject");var Qu=Object.prototype.hasOwnProperty;function $i(b){if(!Nr(b))return!1;try{var h=b.constructor,g=h.prototype;return h&&g&&Qu.call(g,"isPrototypeOf")}catch{return!1}}o($i,"isPlainObject");function kt(b){return typeof b=="function"}o(kt,"isFunction");var Zu=Array.prototype.slice;function fo(b){return Array.from?Array.from(b):Zu.call(b)}o(fo,"toArray");function Le(b,h){return b&&kt(h)&&(Array.isArray(b)||pe(b.length)?fo(b).forEach(function(g,m){h.call(b,g,m,b)}):Nr(b)&&Object.keys(b).forEach(function(g){h.call(b,b[g],g,b)})),b}o(Le,"forEach");var Ce=Object.assign||o(function(h){for(var g=arguments.length,m=new Array(g>1?g-1:0),F=1;F<g;F++)m[F-1]=arguments[F];return Nr(h)&&m.length>0&&m.forEach(function(w){Nr(w)&&Object.keys(w).forEach(function(x){h[x]=w[x]})}),h},"assign"),sn=/\.\d*(?:0|9){12}\d*$/;function Mr(b){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return sn.test(b)?Math.round(b*h)/h:b}o(Mr,"normalizeDecimalNumber");var Sl=/^width|height|left|top|marginLeft|marginTop$/;function Pr(b,h){var g=b.style;Le(h,function(m,F){Sl.test(F)&&pe(m)&&(m="".concat(m,"px")),g[F]=m})}o(Pr,"setStyle");function _l(b,h){return b.classList?b.classList.contains(h):b.className.indexOf(h)>-1}o(_l,"hasClass");function We(b,h){if(h){if(pe(b.length)){Le(b,function(m){We(m,h)});return}if(b.classList){b.classList.add(h);return}var g=b.className.trim();g?g.indexOf(h)<0&&(b.className="".concat(g," ").concat(h)):b.className=h}}o(We,"addClass");function Jt(b,h){if(h){if(pe(b.length)){Le(b,function(g){Jt(g,h)});return}if(b.classList){b.classList.remove(h);return}b.className.indexOf(h)>=0&&(b.className=b.className.replace(h,""))}}o(Jt,"removeClass");function ts(b,h,g){if(h){if(pe(b.length)){Le(b,function(m){ts(m,h,g)});return}g?We(b,h):Jt(b,h)}}o(ts,"toggleClass");var rs=/([a-z\d])([A-Z])/g;function mo(b){return b.replace(rs,"$1-$2").toLowerCase()}o(mo,"toParamCase");function go(b,h){return Nr(b[h])?b[h]:b.dataset?b.dataset[h]:b.getAttribute("data-".concat(mo(h)))}o(go,"getData");function pr(b,h,g){Nr(g)?b[h]=g:b.dataset?b.dataset[h]=g:b.setAttribute("data-".concat(mo(h)),g)}o(pr,"setData");function on(b,h){if(Nr(b[h]))try{delete b[h]}catch{b[h]=void 0}else if(b.dataset)try{delete b.dataset[h]}catch{b.dataset[h]=void 0}else b.removeAttribute("data-".concat(mo(h)))}o(on,"removeData");var qi=/\s\s*/,ff=function(){var b=!1;if(R){var h=!1,g=o(function(){},"listener"),m=Object.defineProperty({},"once",{get:o(function(){return b=!0,h},"get"),set:o(function(w){h=w},"set")});E.addEventListener("test",g,m),E.removeEventListener("test",g,m)}return b}();function xr(b,h,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},F=g;h.trim().split(qi).forEach(function(w){if(!ff){var x=b.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 b.listeners)}b.removeEventListener(w,F,m)})}o(xr,"removeListener");function hr(b,h,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},F=g;h.trim().split(qi).forEach(function(w){if(m.once&&!ff){var x=b.listeners,A=x===void 0?{}:x;F=o(function(){delete A[w][g],b.removeEventListener(w,F,m);for(var z=arguments.length,I=new Array(z),D=0;D<z;D++)I[D]=arguments[D];g.apply(b,I)},"handler"),A[w]||(A[w]={}),A[w][g]&&b.removeEventListener(w,A[w][g],m),A[w][g]=F,b.listeners=A}b.addEventListener(w,F,m)})}o(hr,"addListener");function yo(b,h,g){var m;return kt(Event)&&kt(CustomEvent)?m=new CustomEvent(h,{detail:g,bubbles:!0,cancelable:!0}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(h,!0,!0,g)),b.dispatchEvent(m)}o(yo,"dispatchEvent");function mf(b){var h=b.getBoundingClientRect();return{left:h.left+(window.pageXOffset-document.documentElement.clientLeft),top:h.top+(window.pageYOffset-document.documentElement.clientTop)}}o(mf,"getOffset");var ec=E.location,zb=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function gf(b){var h=b.match(zb);return h!==null&&(h[1]!==ec.protocol||h[2]!==ec.hostname||h[3]!==ec.port)}o(gf,"isCrossOriginURL");function yf(b){var h="timestamp=".concat(new Date().getTime());return b+(b.indexOf("?")===-1?"?":"&")+h}o(yf,"addTimestamp");function nn(b){var h=b.rotate,g=b.scaleX,m=b.scaleY,F=b.translateX,w=b.translateY,x=[];pe(F)&&F!==0&&x.push("translateX(".concat(F,"px)")),pe(w)&&w!==0&&x.push("translateY(".concat(w,"px)")),pe(h)&&h!==0&&x.push("rotate(".concat(h,"deg)")),pe(g)&&g!==1&&x.push("scaleX(".concat(g,")")),pe(m)&&m!==1&&x.push("scaleY(".concat(m,")"));var A=x.length?x.join(" "):"none";return{WebkitTransform:A,msTransform:A,transform:A}}o(nn,"getTransforms");function jb(b){var h=e({},b),g=0;return Le(b,function(m,F){delete h[F],Le(h,function(w){var x=Math.abs(m.startX-w.startX),A=Math.abs(m.startY-w.startY),V=Math.abs(m.endX-w.endX),z=Math.abs(m.endY-w.endY),I=Math.sqrt(x*x+A*A),D=Math.sqrt(V*V+z*z),q=(D-I)/I;Math.abs(q)>Math.abs(g)&&(g=q)})}),g}o(jb,"getMaxZoomRatio");function Pl(b,h){var g=b.pageX,m=b.pageY,F={endX:g,endY:m};return h?F:e({startX:g,startY:m},F)}o(Pl,"getPointer");function Hb(b){var h=0,g=0,m=0;return Le(b,function(F){var w=F.startX,x=F.startY;h+=w,g+=x,m+=1}),h/=m,g/=m,{pageX:h,pageY:g}}o(Hb,"getPointersCenter");function Vi(b){var h=b.aspectRatio,g=b.height,m=b.width,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",w=rn(m),x=rn(g);if(w&&x){var A=g*h;F==="contain"&&A>m||F==="cover"&&A<m?g=m/h:m=g*h}else w?g=m/h:x&&(m=g*h);return{width:m,height:g}}o(Vi,"getAdjustedSizes");function $b(b){var h=b.width,g=b.height,m=b.degree;if(m=Math.abs(m)%180,m===90)return{width:g,height:h};var F=m%90*Math.PI/180,w=Math.sin(F),x=Math.cos(F),A=h*x+g*w,V=h*w+g*x;return m>90?{width:V,height:A}:{width:A,height:V}}o($b,"getRotatedSizes");function qb(b,h,g,m){var F=h.aspectRatio,w=h.naturalWidth,x=h.naturalHeight,A=h.rotate,V=A===void 0?0:A,z=h.scaleX,I=z===void 0?1:z,D=h.scaleY,q=D===void 0?1:D,ge=g.aspectRatio,me=g.naturalWidth,Ne=g.naturalHeight,_e=m.fillColor,rt=_e===void 0?"transparent":_e,dt=m.imageSmoothingEnabled,Je=dt===void 0?!0:dt,Kr=m.imageSmoothingQuality,Qt=Kr===void 0?"low":Kr,K=m.maxWidth,Pe=K===void 0?1/0:K,it=m.maxHeight,fr=it===void 0?1/0:it,Xr=m.minWidth,is=Xr===void 0?0:Xr,ss=m.minHeight,Wi=ss===void 0?0:ss,Lr=document.createElement("canvas"),$t=Lr.getContext("2d"),os=Vi({aspectRatio:ge,width:Pe,height:fr}),xl=Vi({aspectRatio:ge,width:is,height:Wi},"cover"),tc=Math.min(os.width,Math.max(xl.width,me)),rc=Math.min(os.height,Math.max(xl.height,Ne)),wf=Vi({aspectRatio:F,width:Pe,height:fr}),Sf=Vi({aspectRatio:F,width:is,height:Wi},"cover"),_f=Math.min(wf.width,Math.max(Sf.width,w)),Pf=Math.min(wf.height,Math.max(Sf.height,x)),s1=[-_f/2,-Pf/2,_f,Pf];return Lr.width=Mr(tc),Lr.height=Mr(rc),$t.fillStyle=rt,$t.fillRect(0,0,tc,rc),$t.save(),$t.translate(tc/2,rc/2),$t.rotate(V*Math.PI/180),$t.scale(I,q),$t.imageSmoothingEnabled=Je,$t.imageSmoothingQuality=Qt,$t.drawImage.apply($t,[b].concat(d(s1.map(function(o1){return Math.floor(Mr(o1))})))),$t.restore(),Lr}o(qb,"getSourceCanvas");var vf=String.fromCharCode;function Vb(b,h,g){var m="";g+=h;for(var F=h;F<g;F+=1)m+=vf(b.getUint8(F));return m}o(Vb,"getStringFromCharCode");var Wb=/^data:.*,/;function Gb(b){var h=b.replace(Wb,""),g=atob(h),m=new ArrayBuffer(g.length),F=new Uint8Array(m);return Le(F,function(w,x){F[x]=g.charCodeAt(x)}),m}o(Gb,"dataURLToArrayBuffer");function Kb(b,h){for(var g=[],m=8192,F=new Uint8Array(b);F.length>0;)g.push(vf.apply(null,fo(F.subarray(0,m)))),F=F.subarray(m);return"data:".concat(h,";base64,").concat(btoa(g.join("")))}o(Kb,"arrayBufferToDataURL");function Xb(b){var h=new DataView(b),g;try{var m,F,w;if(h.getUint8(0)===255&&h.getUint8(1)===216)for(var x=h.byteLength,A=2;A+1<x;){if(h.getUint8(A)===255&&h.getUint8(A+1)===225){F=A;break}A+=1}if(F){var V=F+4,z=F+10;if(Vb(h,V,4)==="Exif"){var I=h.getUint16(z);if(m=I===18761,(m||I===19789)&&h.getUint16(z+2,m)===42){var D=h.getUint32(z+4,m);D>=8&&(w=z+D)}}}if(w){var q=h.getUint16(w,m),ge,me;for(me=0;me<q;me+=1)if(ge=w+me*12+2,h.getUint16(ge,m)===274){ge+=8,g=h.getUint16(ge,m),h.setUint16(ge,1,m);break}}}catch{g=1}return g}o(Xb,"resetAndGetOrientation");function Yb(b){var h=0,g=1,m=1;switch(b){case 2:g=-1;break;case 3:h=-180;break;case 4:m=-1;break;case 5:h=90,m=-1;break;case 6:h=90;break;case 7:h=90,g=-1;break;case 8:h=-90;break}return{rotate:h,scaleX:g,scaleY:m}}o(Yb,"parseOrientation");var Jb={render:o(function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},"render"),initContainer:o(function(){var h=this.element,g=this.options,m=this.container,F=this.cropper,w=Number(g.minContainerWidth),x=Number(g.minContainerHeight);We(F,P),Jt(h,P);var A={width:Math.max(m.offsetWidth,w>=0?w:Zo),height:Math.max(m.offsetHeight,x>=0?x:en)};this.containerData=A,Pr(F,{width:A.width,height:A.height}),We(h,P),Jt(F,P)},"initContainer"),initCanvas:o(function(){var h=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,A=w/x,V=h.width,z=h.height;h.height*A>h.width?m===3?V=h.height*A:z=h.width/A:m===3?z=h.width/A:V=h.height*A;var I={aspectRatio:A,naturalWidth:w,naturalHeight:x,width:V,height:z};this.canvasData=I,this.limited=m===1||m===2,this.limitCanvas(!0,!0),I.width=Math.min(Math.max(I.width,I.minWidth),I.maxWidth),I.height=Math.min(Math.max(I.height,I.minHeight),I.maxHeight),I.left=(h.width-I.width)/2,I.top=(h.height-I.height)/2,I.oldLeft=I.left,I.oldTop=I.top,this.initialCanvasData=Ce({},I)},"initCanvas"),limitCanvas:o(function(h,g){var m=this.options,F=this.containerData,w=this.canvasData,x=this.cropBoxData,A=m.viewMode,V=w.aspectRatio,z=this.cropped&&x;if(h){var I=Number(m.minCanvasWidth)||0,D=Number(m.minCanvasHeight)||0;A>1?(I=Math.max(I,F.width),D=Math.max(D,F.height),A===3&&(D*V>I?I=D*V:D=I/V)):A>0&&(I?I=Math.max(I,z?x.width:0):D?D=Math.max(D,z?x.height:0):z&&(I=x.width,D=x.height,D*V>I?I=D*V:D=I/V));var q=Vi({aspectRatio:V,width:I,height:D});I=q.width,D=q.height,w.minWidth=I,w.minHeight=D,w.maxWidth=1/0,w.maxHeight=1/0}if(g)if(A>(z?0:1)){var ge=F.width-w.width,me=F.height-w.height;w.minLeft=Math.min(0,ge),w.minTop=Math.min(0,me),w.maxLeft=Math.max(0,ge),w.maxTop=Math.max(0,me),z&&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,A===2&&(w.width>=F.width&&(w.minLeft=Math.min(0,ge),w.maxLeft=Math.max(0,ge)),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(h,g){var m=this.canvasData,F=this.imageData;if(g){var w=$b({width:F.naturalWidth*Math.abs(F.scaleX||1),height:F.naturalHeight*Math.abs(F.scaleY||1),degree:F.rotate||0}),x=w.width,A=w.height,V=m.width*(x/m.naturalWidth),z=m.height*(A/m.naturalHeight);m.left-=(V-m.width)/2,m.top-=(z-m.height)/2,m.width=V,m.height=z,m.aspectRatio=x/A,m.naturalWidth=x,m.naturalHeight=A,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,Pr(this.canvas,Ce({width:m.width,height:m.height},nn({translateX:m.left,translateY:m.top}))),this.renderImage(h),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},"renderCanvas"),renderImage:o(function(h){var g=this.canvasData,m=this.imageData,F=m.naturalWidth*(g.width/g.naturalWidth),w=m.naturalHeight*(g.height/g.naturalHeight);Ce(m,{width:F,height:w,left:(g.width-F)/2,top:(g.height-w)/2}),Pr(this.image,Ce({width:m.width,height:m.height},nn(Ce({translateX:m.left,translateY:m.top},m)))),h&&this.output()},"renderImage"),initCropBox:o(function(){var h=this.options,g=this.canvasData,m=h.aspectRatio||h.initialAspectRatio,F=Number(h.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=Ce({},w)},"initCropBox"),limitCropBox:o(function(h,g){var m=this.options,F=this.containerData,w=this.canvasData,x=this.cropBoxData,A=this.limited,V=m.aspectRatio;if(h){var z=Number(m.minCropBoxWidth)||0,I=Number(m.minCropBoxHeight)||0,D=A?Math.min(F.width,w.width,w.width+w.left,F.width-w.left):F.width,q=A?Math.min(F.height,w.height,w.height+w.top,F.height-w.top):F.height;z=Math.min(z,F.width),I=Math.min(I,F.height),V&&(z&&I?I*V>z?I=z/V:z=I*V:z?I=z/V:I&&(z=I*V),q*V>D?q=D/V:D=q*V),x.minWidth=Math.min(z,D),x.minHeight=Math.min(I,q),x.maxWidth=D,x.maxHeight=q}g&&(A?(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 h=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,h.movable&&h.cropBoxMovable&&pr(this.face,T,m.width>=g.width&&m.height>=g.height?$:G),Pr(this.cropBox,Ce({width:m.width,height:m.height},nn({translateX:m.left,translateY:m.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},"renderCropBox"),output:o(function(){this.preview(),yo(this.element,Ee,this.getData())},"output")},Qb={initPreview:o(function(){var h=this.element,g=this.crossOrigin,m=this.options.preview,F=g?this.crossOriginUrl:this.url,w=h.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 A=m;typeof m=="string"?A=h.ownerDocument.querySelectorAll(m):m.querySelector&&(A=[m]),this.previews=A,Le(A,function(V){var z=document.createElement("img");pr(V,k,{width:V.offsetWidth,height:V.offsetHeight,html:V.innerHTML}),g&&(z.crossOrigin=g),z.src=F,z.alt=w,z.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',V.innerHTML="",V.appendChild(z)})}},"initPreview"),resetPreview:o(function(){Le(this.previews,function(h){var g=go(h,k);Pr(h,{width:g.width,height:g.height}),h.innerHTML=g.html,on(h,k)})},"resetPreview"),preview:o(function(){var h=this.imageData,g=this.canvasData,m=this.cropBoxData,F=m.width,w=m.height,x=h.width,A=h.height,V=m.left-g.left-h.left,z=m.top-g.top-h.top;!this.cropped||this.disabled||(Pr(this.viewBoxImage,Ce({width:x,height:A},nn(Ce({translateX:-V,translateY:-z},h)))),Le(this.previews,function(I){var D=go(I,k),q=D.width,ge=D.height,me=q,Ne=ge,_e=1;F&&(_e=q/F,Ne=w*_e),w&&Ne>ge&&(_e=ge/w,me=F*_e,Ne=ge),Pr(I,{width:me,height:Ne}),Pr(I.getElementsByTagName("img")[0],Ce({width:x*_e,height:A*_e},nn(Ce({translateX:-V*_e,translateY:-z*_e},h))))}))},"preview")},Zb={bind:o(function(){var h=this.element,g=this.options,m=this.cropper;kt(g.cropstart)&&hr(h,ce,g.cropstart),kt(g.cropmove)&&hr(h,ue,g.cropmove),kt(g.cropend)&&hr(h,de,g.cropend),kt(g.crop)&&hr(h,Ee,g.crop),kt(g.zoom)&&hr(h,Gr,g.zoom),hr(m,le,this.onCropStart=this.cropStart.bind(this)),g.zoomable&&g.zoomOnWheel&&hr(m,zi,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&hr(m,Ue,this.onDblclick=this.dblclick.bind(this)),hr(h.ownerDocument,Ot,this.onCropMove=this.cropMove.bind(this)),hr(h.ownerDocument,Ye,this.onCropEnd=this.cropEnd.bind(this)),g.responsive&&hr(window,po,this.onResize=this.resize.bind(this))},"bind"),unbind:o(function(){var h=this.element,g=this.options,m=this.cropper;kt(g.cropstart)&&xr(h,ce,g.cropstart),kt(g.cropmove)&&xr(h,ue,g.cropmove),kt(g.cropend)&&xr(h,de,g.cropend),kt(g.crop)&&xr(h,Ee,g.crop),kt(g.zoom)&&xr(h,Gr,g.zoom),xr(m,le,this.onCropStart),g.zoomable&&g.zoomOnWheel&&xr(m,zi,this.onWheel,{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&xr(m,Ue,this.onDblclick),xr(h.ownerDocument,Ot,this.onCropMove),xr(h.ownerDocument,Ye,this.onCropEnd),g.responsive&&xr(window,po,this.onResize)},"unbind")},e1={resize:o(function(){if(!this.disabled){var h=this.options,g=this.container,m=this.containerData,F=g.offsetWidth/m.width,w=g.offsetHeight/m.height,x=Math.abs(F-1)>Math.abs(w-1)?F:w;if(x!==1){var A,V;h.restore&&(A=this.getCanvasData(),V=this.getCropBoxData()),this.render(),h.restore&&(this.setCanvasData(Le(A,function(z,I){A[I]=z*x})),this.setCropBoxData(Le(V,function(z,I){V[I]=z*x})))}}},"resize"),dblclick:o(function(){this.disabled||this.options.dragMode===Q||this.setDragMode(_l(this.dragBox,C)?Y:N)},"dblclick"),wheel:o(function(h){var g=this,m=Number(this.options.wheelZoomRatio)||.1,F=1;this.disabled||(h.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){g.wheeling=!1},50),h.deltaY?F=h.deltaY>0?1:-1:h.wheelDelta?F=-h.wheelDelta/120:h.detail&&(F=h.detail>0?1:-1),this.zoom(-F*m,h)))},"wheel"),cropStart:o(function(h){var g=h.buttons,m=h.button;if(!(this.disabled||(h.type==="mousedown"||h.type==="pointerdown"&&h.pointerType==="mouse")&&(pe(g)&&g!==1||pe(m)&&m!==0||h.ctrlKey))){var F=this.options,w=this.pointers,x;h.changedTouches?Le(h.changedTouches,function(A){w[A.identifier]=Pl(A)}):w[h.pointerId||0]=Pl(h),Object.keys(w).length>1&&F.zoomable&&F.zoomOnTouch?x=W:x=go(h.target,T),es.test(x)&&yo(this.element,ce,{originalEvent:h,action:x})!==!1&&(h.preventDefault(),this.action=x,this.cropping=!1,x===J&&(this.cropping=!0,We(this.dragBox,j)))}},"cropStart"),cropMove:o(function(h){var g=this.action;if(!(this.disabled||!g)){var m=this.pointers;h.preventDefault(),yo(this.element,ue,{originalEvent:h,action:g})!==!1&&(h.changedTouches?Le(h.changedTouches,function(F){Ce(m[F.identifier]||{},Pl(F,!0))}):Ce(m[h.pointerId||0]||{},Pl(h,!0)),this.change(h))}},"cropMove"),cropEnd:o(function(h){if(!this.disabled){var g=this.action,m=this.pointers;h.changedTouches?Le(h.changedTouches,function(F){delete m[F.identifier]}):delete m[h.pointerId||0],g&&(h.preventDefault(),Object.keys(m).length||(this.action=""),this.cropping&&(this.cropping=!1,ts(this.dragBox,j,this.cropped&&this.options.modal)),yo(this.element,de,{originalEvent:h,action:g}))}},"cropEnd")},t1={change:o(function(h){var g=this.options,m=this.canvasData,F=this.containerData,w=this.cropBoxData,x=this.pointers,A=this.action,V=g.aspectRatio,z=w.left,I=w.top,D=w.width,q=w.height,ge=z+D,me=I+q,Ne=0,_e=0,rt=F.width,dt=F.height,Je=!0,Kr;!V&&h.shiftKey&&(V=D&&q?D/q:1),this.limited&&(Ne=w.minLeft,_e=w.minTop,rt=Ne+Math.min(F.width,m.width,m.left+m.width),dt=_e+Math.min(F.height,m.height,m.top+m.height));var Qt=x[Object.keys(x)[0]],K={x:Qt.endX-Qt.startX,y:Qt.endY-Qt.startY},Pe=o(function(fr){switch(fr){case te:ge+K.x>rt&&(K.x=rt-ge);break;case ae:z+K.x<Ne&&(K.x=Ne-z);break;case Ae:I+K.y<_e&&(K.y=_e-I);break;case ke:me+K.y>dt&&(K.y=dt-me);break}},"check");switch(A){case G:z+=K.x,I+=K.y;break;case te:if(K.x>=0&&(ge>=rt||V&&(I<=_e||me>=dt))){Je=!1;break}Pe(te),D+=K.x,D<0&&(A=ae,D=-D,z-=D),V&&(q=D/V,I+=(w.height-q)/2);break;case Ae:if(K.y<=0&&(I<=_e||V&&(z<=Ne||ge>=rt))){Je=!1;break}Pe(Ae),q-=K.y,I+=K.y,q<0&&(A=ke,q=-q,I-=q),V&&(D=q*V,z+=(w.width-D)/2);break;case ae:if(K.x<=0&&(z<=Ne||V&&(I<=_e||me>=dt))){Je=!1;break}Pe(ae),D-=K.x,z+=K.x,D<0&&(A=te,D=-D,z-=D),V&&(q=D/V,I+=(w.height-q)/2);break;case ke:if(K.y>=0&&(me>=dt||V&&(z<=Ne||ge>=rt))){Je=!1;break}Pe(ke),q+=K.y,q<0&&(A=Ae,q=-q,I-=q),V&&(D=q*V,z+=(w.width-D)/2);break;case qe:if(V){if(K.y<=0&&(I<=_e||ge>=rt)){Je=!1;break}Pe(Ae),q-=K.y,I+=K.y,D=q*V}else Pe(Ae),Pe(te),K.x>=0?ge<rt?D+=K.x:K.y<=0&&I<=_e&&(Je=!1):D+=K.x,K.y<=0?I>_e&&(q-=K.y,I+=K.y):(q-=K.y,I+=K.y);D<0&&q<0?(A=Xe,q=-q,D=-D,I-=q,z-=D):D<0?(A=Fe,D=-D,z-=D):q<0&&(A=Re,q=-q,I-=q);break;case Fe:if(V){if(K.y<=0&&(I<=_e||z<=Ne)){Je=!1;break}Pe(Ae),q-=K.y,I+=K.y,D=q*V,z+=w.width-D}else Pe(Ae),Pe(ae),K.x<=0?z>Ne?(D-=K.x,z+=K.x):K.y<=0&&I<=_e&&(Je=!1):(D-=K.x,z+=K.x),K.y<=0?I>_e&&(q-=K.y,I+=K.y):(q-=K.y,I+=K.y);D<0&&q<0?(A=Re,q=-q,D=-D,I-=q,z-=D):D<0?(A=qe,D=-D,z-=D):q<0&&(A=Xe,q=-q,I-=q);break;case Xe:if(V){if(K.x<=0&&(z<=Ne||me>=dt)){Je=!1;break}Pe(ae),D-=K.x,z+=K.x,q=D/V}else Pe(ke),Pe(ae),K.x<=0?z>Ne?(D-=K.x,z+=K.x):K.y>=0&&me>=dt&&(Je=!1):(D-=K.x,z+=K.x),K.y>=0?me<dt&&(q+=K.y):q+=K.y;D<0&&q<0?(A=qe,q=-q,D=-D,I-=q,z-=D):D<0?(A=Re,D=-D,z-=D):q<0&&(A=Fe,q=-q,I-=q);break;case Re:if(V){if(K.x>=0&&(ge>=rt||me>=dt)){Je=!1;break}Pe(te),D+=K.x,q=D/V}else Pe(ke),Pe(te),K.x>=0?ge<rt?D+=K.x:K.y>=0&&me>=dt&&(Je=!1):D+=K.x,K.y>=0?me<dt&&(q+=K.y):q+=K.y;D<0&&q<0?(A=Fe,q=-q,D=-D,I-=q,z-=D):D<0?(A=Xe,D=-D,z-=D):q<0&&(A=qe,q=-q,I-=q);break;case $:this.move(K.x,K.y),Je=!1;break;case W:this.zoom(jb(x),h),Je=!1;break;case J:if(!K.x||!K.y){Je=!1;break}Kr=mf(this.cropper),z=Qt.startX-Kr.left,I=Qt.startY-Kr.top,D=w.minWidth,q=w.minHeight,K.x>0?A=K.y>0?Re:qe:K.x<0&&(z-=D,A=K.y>0?Xe:Fe),K.y<0&&(I-=q),this.cropped||(Jt(this.cropBox,P),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}Je&&(w.width=D,w.height=q,w.left=z,w.top=I,this.action=A,this.renderCropBox()),Le(x,function(it){it.startX=it.endX,it.startY=it.endY})},"change")},r1={crop:o(function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&We(this.dragBox,j),Jt(this.cropBox,P),this.setCropBoxData(this.initialCropBoxData)),this},"crop"),reset:o(function(){return this.ready&&!this.disabled&&(this.imageData=Ce({},this.initialImageData),this.canvasData=Ce({},this.initialCanvasData),this.cropBoxData=Ce({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},"reset"),clear:o(function(){return this.cropped&&!this.disabled&&(Ce(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Jt(this.dragBox,j),We(this.cropBox,P)),this},"clear"),replace:o(function(h){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&h&&(this.isImg&&(this.element.src=h),g?(this.url=h,this.image.src=h,this.ready&&(this.viewBoxImage.src=h,Le(this.previews,function(m){m.getElementsByTagName("img")[0].src=h}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(h))),this},"replace"),enable:o(function(){return this.ready&&this.disabled&&(this.disabled=!1,Jt(this.cropper,S)),this},"enable"),disable:o(function(){return this.ready&&!this.disabled&&(this.disabled=!0,We(this.cropper,S)),this},"disable"),destroy:o(function(){var h=this.element;return h[B]?(h[B]=void 0,this.isImg&&this.replaced&&(h.src=this.originalUrl),this.uncreate(),this):this},"destroy"),move:o(function(h){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,m=this.canvasData,F=m.left,w=m.top;return this.moveTo(ho(h)?h:F+Number(h),ho(g)?g:w+Number(g))},"move"),moveTo:o(function(h){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,m=this.canvasData,F=!1;return h=Number(h),g=Number(g),this.ready&&!this.disabled&&this.options.movable&&(pe(h)&&(m.left=h,F=!0),pe(g)&&(m.top=g,F=!0),F&&this.renderCanvas(!0)),this},"moveTo"),zoom:o(function(h,g){var m=this.canvasData;return h=Number(h),h<0?h=1/(1-h):h=1+h,this.zoomTo(m.width*h/m.naturalWidth,null,g)},"zoom"),zoomTo:o(function(h,g,m){var F=this.options,w=this.canvasData,x=w.width,A=w.height,V=w.naturalWidth,z=w.naturalHeight;if(h=Number(h),h>=0&&this.ready&&!this.disabled&&F.zoomable){var I=V*h,D=z*h;if(yo(this.element,Gr,{ratio:h,oldRatio:x/V,originalEvent:m})===!1)return this;if(m){var q=this.pointers,ge=mf(this.cropper),me=q&&Object.keys(q).length?Hb(q):{pageX:m.pageX,pageY:m.pageY};w.left-=(I-x)*((me.pageX-ge.left-w.left)/x),w.top-=(D-A)*((me.pageY-ge.top-w.top)/A)}else $i(g)&&pe(g.x)&&pe(g.y)?(w.left-=(I-x)*((g.x-w.left)/x),w.top-=(D-A)*((g.y-w.top)/A)):(w.left-=(I-x)/2,w.top-=(D-A)/2);w.width=I,w.height=D,this.renderCanvas(!0)}return this},"zoomTo"),rotate:o(function(h){return this.rotateTo((this.imageData.rotate||0)+Number(h))},"rotate"),rotateTo:o(function(h){return h=Number(h),pe(h)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=h%360,this.renderCanvas(!0,!0)),this},"rotateTo"),scaleX:o(function(h){var g=this.imageData.scaleY;return this.scale(h,pe(g)?g:1)},"scaleX"),scaleY:o(function(h){var g=this.imageData.scaleX;return this.scale(pe(g)?g:1,h)},"scaleY"),scale:o(function(h){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,m=this.imageData,F=!1;return h=Number(h),g=Number(g),this.ready&&!this.disabled&&this.options.scalable&&(pe(h)&&(m.scaleX=h,F=!0),pe(g)&&(m.scaleY=g,F=!0),F&&this.renderCanvas(!0,!0)),this},"scale"),getData:o(function(){var h=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 A=m.width/m.naturalWidth;if(Le(x,function(I,D){x[D]=I/A}),h){var V=Math.round(x.y+x.height),z=Math.round(x.x+x.width);x.x=Math.round(x.x),x.y=Math.round(x.y),x.width=z-x.x,x.height=V-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(h){var g=this.options,m=this.imageData,F=this.canvasData,w={};if(this.ready&&!this.disabled&&$i(h)){var x=!1;g.rotatable&&pe(h.rotate)&&h.rotate!==m.rotate&&(m.rotate=h.rotate,x=!0),g.scalable&&(pe(h.scaleX)&&h.scaleX!==m.scaleX&&(m.scaleX=h.scaleX,x=!0),pe(h.scaleY)&&h.scaleY!==m.scaleY&&(m.scaleY=h.scaleY,x=!0)),x&&this.renderCanvas(!0,!0);var A=m.width/m.naturalWidth;pe(h.x)&&(w.left=h.x*A+F.left),pe(h.y)&&(w.top=h.y*A+F.top),pe(h.width)&&(w.width=h.width*A),pe(h.height)&&(w.height=h.height*A),this.setCropBoxData(w)}return this},"setData"),getContainerData:o(function(){return this.ready?Ce({},this.containerData):{}},"getContainerData"),getImageData:o(function(){return this.sized?Ce({},this.imageData):{}},"getImageData"),getCanvasData:o(function(){var h=this.canvasData,g={};return this.ready&&Le(["left","top","width","height","naturalWidth","naturalHeight"],function(m){g[m]=h[m]}),g},"getCanvasData"),setCanvasData:o(function(h){var g=this.canvasData,m=g.aspectRatio;return this.ready&&!this.disabled&&$i(h)&&(pe(h.left)&&(g.left=h.left),pe(h.top)&&(g.top=h.top),pe(h.width)?(g.width=h.width,g.height=h.width/m):pe(h.height)&&(g.height=h.height,g.width=h.height*m),this.renderCanvas(!0)),this},"setCanvasData"),getCropBoxData:o(function(){var h=this.cropBoxData,g;return this.ready&&this.cropped&&(g={left:h.left,top:h.top,width:h.width,height:h.height}),g||{}},"getCropBoxData"),setCropBoxData:o(function(h){var g=this.cropBoxData,m=this.options.aspectRatio,F,w;return this.ready&&this.cropped&&!this.disabled&&$i(h)&&(pe(h.left)&&(g.left=h.left),pe(h.top)&&(g.top=h.top),pe(h.width)&&h.width!==g.width&&(F=!0,g.width=h.width),pe(h.height)&&h.height!==g.height&&(w=!0,g.height=h.height),m&&(F?g.height=g.width/m:w&&(g.width=g.height*m)),this.renderCropBox()),this},"setCropBoxData"),getCroppedCanvas:o(function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var g=this.canvasData,m=qb(this.image,this.imageData,g,h);if(!this.cropped)return m;var F=this.getData(h.rounded),w=F.x,x=F.y,A=F.width,V=F.height,z=m.width/Math.floor(g.naturalWidth);z!==1&&(w*=z,x*=z,A*=z,V*=z);var I=A/V,D=Vi({aspectRatio:I,width:h.maxWidth||1/0,height:h.maxHeight||1/0}),q=Vi({aspectRatio:I,width:h.minWidth||0,height:h.minHeight||0},"cover"),ge=Vi({aspectRatio:I,width:h.width||(z!==1?m.width:A),height:h.height||(z!==1?m.height:V)}),me=ge.width,Ne=ge.height;me=Math.min(D.width,Math.max(q.width,me)),Ne=Math.min(D.height,Math.max(q.height,Ne));var _e=document.createElement("canvas"),rt=_e.getContext("2d");_e.width=Mr(me),_e.height=Mr(Ne),rt.fillStyle=h.fillColor||"transparent",rt.fillRect(0,0,me,Ne);var dt=h.imageSmoothingEnabled,Je=dt===void 0?!0:dt,Kr=h.imageSmoothingQuality;rt.imageSmoothingEnabled=Je,Kr&&(rt.imageSmoothingQuality=Kr);var Qt=m.width,K=m.height,Pe=w,it=x,fr,Xr,is,ss,Wi,Lr;Pe<=-A||Pe>Qt?(Pe=0,fr=0,is=0,Wi=0):Pe<=0?(is=-Pe,Pe=0,fr=Math.min(Qt,A+Pe),Wi=fr):Pe<=Qt&&(is=0,fr=Math.min(A,Qt-Pe),Wi=fr),fr<=0||it<=-V||it>K?(it=0,Xr=0,ss=0,Lr=0):it<=0?(ss=-it,it=0,Xr=Math.min(K,V+it),Lr=Xr):it<=K&&(ss=0,Xr=Math.min(V,K-it),Lr=Xr);var $t=[Pe,it,fr,Xr];if(Wi>0&&Lr>0){var os=me/A;$t.push(is*os,ss*os,Wi*os,Lr*os)}return rt.drawImage.apply(rt,[m].concat(d($t.map(function(xl){return Math.floor(Mr(xl))})))),_e},"getCroppedCanvas"),setAspectRatio:o(function(h){var g=this.options;return!this.disabled&&!ho(h)&&(g.aspectRatio=Math.max(0,h)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},"setAspectRatio"),setDragMode:o(function(h){var g=this.options,m=this.dragBox,F=this.face;if(this.ready&&!this.disabled){var w=h===N,x=g.movable&&h===Y;h=w||x?h:Q,g.dragMode=h,pr(m,T,h),ts(m,C,w),ts(m,U,x),g.cropBoxMovable||(pr(F,T,h),ts(F,C,w),ts(F,U,x))}return this},"setDragMode")},i1=E.Cropper,bf=function(){function b(h){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n(this,b),!h||!ct.test(h.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=h,this.options=Ce({},tn,$i(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(b,"Cropper"),l(b,[{key:"init",value:o(function(){var g=this.element,m=g.tagName.toLowerCase(),F;if(!g[B]){if(g[B]=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(Hi.test(g)){ut.test(g)?this.read(Gb(g)):this.clone();return}var x=new XMLHttpRequest,A=this.clone.bind(this);this.reloading=!0,this.xhr=x,x.onabort=A,x.onerror=A,x.ontimeout=A,x.onprogress=function(){x.getResponseHeader("content-type")!==ji&&x.abort()},x.onload=function(){m.read(x.response)},x.onloadend=function(){m.reloading=!1,m.xhr=null},w.checkCrossOrigin&&gf(g)&&F.crossOrigin&&(g=yf(g)),x.open("GET",g,!0),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=Xb(g),x=0,A=1,V=1;if(w>1){this.url=Kb(g,ji);var z=Yb(w);x=z.rotate,A=z.scaleX,V=z.scaleY}m.rotatable&&(F.rotate=x),m.scalable&&(F.scaleX=A,F.scaleY=V),this.clone()},"read")},{key:"clone",value:o(function(){var g=this.element,m=this.url,F=g.crossOrigin,w=m;this.options.checkCrossOrigin&&gf(m)&&(F||(F="anonymous"),w=yf(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,M),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=E.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(E.navigator.userAgent),w=o(function(z,I){Ce(g.imageData,{naturalWidth:z,naturalHeight:I,aspectRatio:z/I}),g.initialImageData=Ce({},g.imageData),g.sizing=!1,g.sized=!0,g.build()},"done");if(m.naturalWidth&&!F){w(m.naturalWidth,m.naturalHeight);return}var x=document.createElement("img"),A=document.body||document.documentElement;this.sizingImage=x,x.onload=function(){w(x.width,x.height),F||A.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;",A.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=bl;var A=x.querySelector(".".concat(B,"-container")),V=A.querySelector(".".concat(B,"-canvas")),z=A.querySelector(".".concat(B,"-drag-box")),I=A.querySelector(".".concat(B,"-crop-box")),D=I.querySelector(".".concat(B,"-face"));this.container=w,this.cropper=A,this.canvas=V,this.dragBox=z,this.cropBox=I,this.viewBox=A.querySelector(".".concat(B,"-view-box")),this.face=D,V.appendChild(F),We(g,P),w.insertBefore(A,g.nextSibling),Jt(F,M),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(I,P),m.guides||We(I.getElementsByClassName("".concat(B,"-dashed")),P),m.center||We(I.getElementsByClassName("".concat(B,"-center")),P),m.background&&We(A,"".concat(B,"-bg")),m.highlight||We(D,H),m.cropBoxMovable&&(We(D,U),pr(D,T,G)),m.cropBoxResizable||(We(I.getElementsByClassName("".concat(B,"-line")),P),We(I.getElementsByClassName("".concat(B,"-point")),P)),this.render(),this.ready=!0,this.setDragMode(m.dragMode),m.autoCrop&&this.crop(),this.setData(m.data),kt(m.ready)&&hr(g,Wr,m.ready,{once:!0}),yo(g,Wr)}},"build")},{key:"unbuild",value:o(function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var g=this.cropper.parentNode;g&&g.removeChild(this.cropper),Jt(this.element,P)}},"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=i1,b},"noConflict")},{key:"setDefaults",value:o(function(g){Ce(tn,$i(g)&&g)},"setDefaults")}])}();return Ce(bf.prototype,Jb,Qb,Zb,e1,t1,r1),bf})});var Av=ve((C9,Cu)=>{"use strict";Cu.exports=Op;Cu.exports.isMobile=Op;Cu.exports.default=Op;var UP=/(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.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,IP=/CrOS/,DP=/android|ipad|playbook|silk/i;function Op(r){r||(r={});let e=r.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=UP.test(e)&&!IP.test(e)||!!r.tablet&&DP.test(e);return!t&&r.tablet&&r.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.indexOf("Macintosh")!==-1&&e.indexOf("Safari")!==-1&&(t=!0),t}o(Op,"isMobile")});var m0=ve((PM,f0)=>{"use strict";f0.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 v0=ve(ch=>{"use strict";var W5=Object.prototype.hasOwnProperty,G5;function g0(r){try{return decodeURIComponent(r.replace(/\+/g," "))}catch{return null}}o(g0,"decode");function y0(r){try{return encodeURIComponent(r)}catch{return null}}o(y0,"encode");function K5(r){for(var e=/([^=?#&]+)=?([^&]*)/g,t={},i;i=e.exec(r);){var s=g0(i[1]),n=g0(i[2]);s===null||n===null||s in t||(t[s]=n)}return t}o(K5,"querystring");function X5(r,e){e=e||"";var t=[],i,s;typeof e!="string"&&(e="?");for(s in r)if(W5.call(r,s)){if(i=r[s],!i&&(i===null||i===G5||isNaN(i))&&(i=""),s=y0(s),i=y0(i),s===null||i===null)continue;t.push(s+"="+i)}return t.length?e+t.join("&"):""}o(X5,"querystringify");ch.stringify=X5;ch.parse=K5});var E0=ve((CM,F0)=>{"use strict";var w0=m0(),Du=v0(),Y5=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,S0=/[\n\r\t]/g,J5=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,_0=/:\d+$/,Q5=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,Z5=/^[a-zA-Z]:/;function ph(r){return(r||"").toString().replace(Y5,"")}o(ph,"trimLeft");var dh=[["#","hash"],["?","query"],o(function(e,t){return $r(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]],b0={hash:1,query:1};function P0(r){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var t=e.location||{};r=r||t;var i={},s=typeof r,n;if(r.protocol==="blob:")i=new qr(unescape(r.pathname),{});else if(s==="string"){i=new qr(r,{});for(n in b0)delete i[n]}else if(s==="object"){for(n in r)n in b0||(i[n]=r[n]);i.slashes===void 0&&(i.slashes=J5.test(r.href))}return i}o(P0,"lolcation");function $r(r){return r==="file:"||r==="ftp:"||r==="http:"||r==="https:"||r==="ws:"||r==="wss:"}o($r,"isSpecial");function x0(r,e){r=ph(r),r=r.replace(S0,""),e=e||{};var t=Q5.exec(r),i=t[1]?t[1].toLowerCase():"",s=!!t[2],n=!!t[3],a=0,l;return s?n?(l=t[2]+t[3]+t[4],a=t[2].length+t[3].length):(l=t[2]+t[4],a=t[2].length):n?(l=t[3]+t[4],a=t[3].length):l=t[4],i==="file:"?a>=2&&(l=l.slice(2)):$r(i)?l=t[4]:i?s&&(l=l.slice(2)):a>=2&&$r(e.protocol)&&(l=t[4]),{protocol:i,slashes:s||$r(i),slashesCount:a,rest:l}}o(x0,"extractProtocol");function ex(r,e){if(r==="")return e;for(var t=(e||"/").split("/").slice(0,-1).concat(r.split("/")),i=t.length,s=t[i-1],n=!1,a=0;i--;)t[i]==="."?t.splice(i,1):t[i]===".."?(t.splice(i,1),a++):a&&(i===0&&(n=!0),t.splice(i,1),a--);return n&&t.unshift(""),(s==="."||s==="..")&&t.push(""),t.join("/")}o(ex,"resolve");function qr(r,e,t){if(r=ph(r),r=r.replace(S0,""),!(this instanceof qr))return new qr(r,e,t);var i,s,n,a,l,u,d=dh.slice(),p=typeof e,f=this,y=0;for(p!=="object"&&p!=="string"&&(t=e,e=null),t&&typeof t!="function"&&(t=Du.parse),e=P0(e),s=x0(r||"",e),i=!s.protocol&&!s.slashes,f.slashes=s.slashes||i&&e.slashes,f.protocol=s.protocol||e.protocol||"",r=s.rest,(s.protocol==="file:"&&(s.slashesCount!==2||Z5.test(r))||!s.slashes&&(s.protocol||s.slashesCount<2||!$r(f.protocol)))&&(d[3]=[/(.*)/,"pathname"]);y<d.length;y++){if(a=d[y],typeof a=="function"){r=a(r,f);continue}n=a[0],u=a[1],n!==n?f[u]=r:typeof n=="string"?(l=n==="@"?r.lastIndexOf(n):r.indexOf(n),~l&&(typeof a[2]=="number"?(f[u]=r.slice(0,l),r=r.slice(l+a[2])):(f[u]=r.slice(l),r=r.slice(0,l)))):(l=n.exec(r))&&(f[u]=l[1],r=r.slice(0,l.index)),f[u]=f[u]||i&&a[3]&&e[u]||"",a[4]&&(f[u]=f[u].toLowerCase())}t&&(f.query=t(f.query)),i&&e.slashes&&f.pathname.charAt(0)!=="/"&&(f.pathname!==""||e.pathname!=="")&&(f.pathname=ex(f.pathname,e.pathname)),f.pathname.charAt(0)!=="/"&&$r(f.protocol)&&(f.pathname="/"+f.pathname),w0(f.port,f.protocol)||(f.host=f.hostname,f.port=""),f.username=f.password="",f.auth&&(l=f.auth.indexOf(":"),~l?(f.username=f.auth.slice(0,l),f.username=encodeURIComponent(decodeURIComponent(f.username)),f.password=f.auth.slice(l+1),f.password=encodeURIComponent(decodeURIComponent(f.password))):f.username=encodeURIComponent(decodeURIComponent(f.auth)),f.auth=f.password?f.username+":"+f.password:f.username),f.origin=f.protocol!=="file:"&&$r(f.protocol)&&f.host?f.protocol+"//"+f.host:"null",f.href=f.toString()}o(qr,"Url");function tx(r,e,t){var i=this;switch(r){case"query":typeof e=="string"&&e.length&&(e=(t||Du.parse)(e)),i[r]=e;break;case"port":i[r]=e,w0(e,i.protocol)?e&&(i.host=i.hostname+":"+e):(i.host=i.hostname,i[r]="");break;case"hostname":i[r]=e,i.port&&(e+=":"+i.port),i.host=e;break;case"host":i[r]=e,_0.test(e)?(e=e.split(":"),i.port=e.pop(),i.hostname=e.join(":")):(i.hostname=e,i.port="");break;case"protocol":i.protocol=e.toLowerCase(),i.slashes=!t;break;case"pathname":case"hash":if(e){var s=r==="pathname"?"/":"#";i[r]=e.charAt(0)!==s?s+e:e}else i[r]=e;break;case"username":case"password":i[r]=encodeURIComponent(e);break;case"auth":var n=e.indexOf(":");~n?(i.username=e.slice(0,n),i.username=encodeURIComponent(decodeURIComponent(i.username)),i.password=e.slice(n+1),i.password=encodeURIComponent(decodeURIComponent(i.password))):i.username=encodeURIComponent(decodeURIComponent(e))}for(var a=0;a<dh.length;a++){var l=dh[a];l[4]&&(i[l[1]]=i[l[1]].toLowerCase())}return i.auth=i.password?i.username+":"+i.password:i.username,i.origin=i.protocol!=="file:"&&$r(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i}o(tx,"set");function rx(r){(!r||typeof r!="function")&&(r=Du.stringify);var e,t=this,i=t.host,s=t.protocol;s&&s.charAt(s.length-1)!==":"&&(s+=":");var n=s+(t.protocol&&t.slashes||$r(t.protocol)?"//":"");return t.username?(n+=t.username,t.password&&(n+=":"+t.password),n+="@"):t.password?(n+=":"+t.password,n+="@"):t.protocol!=="file:"&&$r(t.protocol)&&!i&&t.pathname!=="/"&&(n+="@"),(i[i.length-1]===":"||_0.test(t.hostname)&&!t.port)&&(i+=":"),n+=i+t.pathname,e=typeof t.query=="object"?r(t.query):t.query,e&&(n+=e.charAt(0)!=="?"?"?"+e:e),t.hash&&(n+=t.hash),n}o(rx,"toString");qr.prototype={set:tx,toString:rx};qr.extractProtocol=x0;qr.location=P0;qr.trimLeft=ph;qr.qs=Du;F0.exports=qr});var Rh=ve((NL,Ah)=>{function Ct(r){if(r)return sF(r);this._callbacks=new Map}o(Ct,"Emitter");function sF(r){return Object.assign(r,Ct.prototype),r._callbacks=new Map,r}o(sF,"mixin");Ct.prototype.on=function(r,e){let t=this._callbacks.get(r)??[];return t.push(e),this._callbacks.set(r,t),this};Ct.prototype.once=function(r,e){let t=o((...i)=>{this.off(r,t),e.apply(this,i)},"on");return t.fn=e,this.on(r,t),this};Ct.prototype.off=function(r,e){if(r===void 0&&e===void 0)return this._callbacks.clear(),this;if(e===void 0)return this._callbacks.delete(r),this;let t=this._callbacks.get(r);if(t){for(let[i,s]of t.entries())if(s===e||s.fn===e){t.splice(i,1);break}t.length===0?this._callbacks.delete(r):this._callbacks.set(r,t)}return this};Ct.prototype.emit=function(r,...e){let t=this._callbacks.get(r);if(t){let i=[...t];for(let s of i)s.apply(this,e)}return this};Ct.prototype.listeners=function(r){return this._callbacks.get(r)??[]};Ct.prototype.listenerCount=function(r){if(r)return this.listeners(r).length;let e=0;for(let t of this._callbacks.values())e+=t.length;return e};Ct.prototype.hasListeners=function(r){return this.listenerCount(r)>0};Ct.prototype.addEventListener=Ct.prototype.on;Ct.prototype.removeListener=Ct.prototype.off;Ct.prototype.removeEventListener=Ct.prototype.off;Ct.prototype.removeAllListeners=Ct.prototype.off;typeof Ah<"u"&&(Ah.exports=Ct)});var Sb=ve((cf,df)=>{(function(r,e){typeof cf=="object"&&typeof df<"u"?df.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis<"u"?globalThis:r||self,r.Compressor=e())})(cf,function(){"use strict";function r(U,T){var k=Object.keys(U);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(U);T&&(N=N.filter(function(Y){return Object.getOwnPropertyDescriptor(U,Y).enumerable})),k.push.apply(k,N)}return k}o(r,"ownKeys");function e(U){for(var T=1;T<arguments.length;T++){var k=arguments[T]!=null?arguments[T]:{};T%2?r(Object(k),!0).forEach(function(N){n(U,N,k[N])}):Object.getOwnPropertyDescriptors?Object.defineProperties(U,Object.getOwnPropertyDescriptors(k)):r(Object(k)).forEach(function(N){Object.defineProperty(U,N,Object.getOwnPropertyDescriptor(k,N))})}return U}o(e,"_objectSpread2");function t(U,T){if(!(U instanceof T))throw new TypeError("Cannot call a class as a function")}o(t,"_classCallCheck");function i(U,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(U,u(N.key),N)}}o(i,"_defineProperties");function s(U,T,k){return T&&i(U.prototype,T),k&&i(U,k),Object.defineProperty(U,"prototype",{writable:!1}),U}o(s,"_createClass");function n(U,T,k){return T=u(T),T in U?Object.defineProperty(U,T,{value:k,enumerable:!0,configurable:!0,writable:!0}):U[T]=k,U}o(n,"_defineProperty");function a(){return a=Object.assign?Object.assign.bind():function(U){for(var T=1;T<arguments.length;T++){var k=arguments[T];for(var N in k)Object.prototype.hasOwnProperty.call(k,N)&&(U[N]=k[N])}return U},a.apply(this,arguments)}o(a,"_extends");function l(U,T){if(typeof U!="object"||U===null)return U;var k=U[Symbol.toPrimitive];if(k!==void 0){var N=k.call(U,T||"default");if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(U)}o(l,"_toPrimitive");function u(U){var T=l(U,"string");return typeof T=="symbol"?T:String(T)}o(u,"_toPropertyKey");var d={exports:{}};(function(U){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,Ee=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,de=(N||Q)&&T.atob&&T.ArrayBuffer&&T.Uint8Array&&function(ue){var ce,Ue,Me,Rt,Ve,le,Ot,Ye,Wr;if(ce=ue.match(Ee),!ce)throw new Error("invalid data URI");for(Ue=ce[2]?ce[1]:"text/plain"+(ce[3]||";charset=US-ASCII"),Me=!!ce[4],Rt=ue.slice(ce[0].length),Me?Ve=atob(Rt):Ve=decodeURIComponent(Rt),le=new ArrayBuffer(Ve.length),Ot=new Uint8Array(le),Ye=0;Ye<Ve.length;Ye+=1)Ot[Ye]=Ve.charCodeAt(Ye);return N?new Blob([Y?Ot:le],{type:Ue}):(Wr=new Q,Wr.append(le),Wr.getBlob(Ue))};T.HTMLCanvasElement&&!k.toBlob&&(k.mozGetAsFile?k.toBlob=function(ue,ce,Ue){var Me=this;setTimeout(function(){Ue&&k.toDataURL&&de?ue(de(Me.toDataURL(ce,Ue))):ue(Me.mozGetAsFile("blob",ce))})}:k.toDataURL&&de&&(k.msToBlob?k.toBlob=function(ue,ce,Ue){var Me=this;setTimeout(function(){(ce&&ce!=="image/png"||Ue)&&k.toDataURL&&de?ue(de(Me.toDataURL(ce,Ue))):ue(Me.msToBlob(ce))})}:k.toBlob=function(ue,ce,Ue){var Me=this;setTimeout(function(){ue(de(Me.toDataURL(ce,Ue)))})})),U.exports?U.exports=de:T.dataURLtoBlob=de}(window)})(d);var p=d.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},v=typeof window<"u"&&typeof window.document<"u",_=v?window:{},R=o(function(T){return T>0&&T<1/0},"isPositiveNumber"),E=Array.prototype.slice;function O(U){return Array.from?Array.from(U):E.call(U)}o(O,"toArray");var L=/^image\/.+$/;function B(U){return L.test(U)}o(B,"isImageType");function G(U){var T=B(U)?U.substr(6):"";return T==="jpeg"&&(T="jpg"),".".concat(T)}o(G,"imageTypeToExtension");var J=String.fromCharCode;function $(U,T,k){var N="",Y;for(k+=T,Y=T;Y<k;Y+=1)N+=J(U.getUint8(Y));return N}o($,"getStringFromCharCode");var W=_.btoa;function te(U,T){for(var k=[],N=8192,Y=new Uint8Array(U);Y.length>0;)k.push(J.apply(null,O(Y.subarray(0,N)))),Y=Y.subarray(N);return"data:".concat(T,";base64,").concat(W(k.join("")))}o(te,"arrayBufferToDataURL");function ae(U){var T=new DataView(U),k;try{var N,Y,Q;if(T.getUint8(0)===255&&T.getUint8(1)===216)for(var Ee=T.byteLength,de=2;de+1<Ee;){if(T.getUint8(de)===255&&T.getUint8(de+1)===225){Y=de;break}de+=1}if(Y){var ue=Y+4,ce=Y+10;if($(T,ue,4)==="Exif"){var Ue=T.getUint16(ce);if(N=Ue===18761,(N||Ue===19789)&&T.getUint16(ce+2,N)===42){var Me=T.getUint32(ce+4,N);Me>=8&&(Q=ce+Me)}}}if(Q){var Rt=T.getUint16(Q,N),Ve,le;for(le=0;le<Rt;le+=1)if(Ve=Q+le*12+2,T.getUint16(Ve,N)===274){Ve+=8,k=T.getUint16(Ve,N),T.setUint16(Ve,1,N);break}}}catch{k=1}return k}o(ae,"resetAndGetOrientation");function ke(U){var T=0,k=1,N=1;switch(U){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(ke,"parseOrientation");var Ae=/\.\d*(?:0|9){12}\d*$/;function qe(U){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Ae.test(U)?Math.round(U*T)/T:U}o(qe,"normalizeDecimalNumber");function Fe(U){var T=U.aspectRatio,k=U.height,N=U.width,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",Q=R(N),Ee=R(k);if(Q&&Ee){var de=k*T;(Y==="contain"||Y==="none")&&de>N||Y==="cover"&&de<N?k=N/T:N=k*T}else Q?k=N/T:Ee&&(N=k*T);return{width:N,height:k}}o(Fe,"getAdjustedSizes");function Re(U){for(var T=O(new Uint8Array(U)),k=T.length,N=[],Y=0;Y+3<k;){var Q=T[Y],Ee=T[Y+1];if(Q===255&&Ee===218)break;if(Q===255&&Ee===216)Y+=2;else{var de=T[Y+2]*256+T[Y+3],ue=Y+de+2,ce=T.slice(Y,ue);N.push(ce),Y=ue}}return N.reduce(function(Ue,Me){return Me[0]===255&&Me[1]===225?Ue.concat(Me):Ue},[])}o(Re,"getExif");function Xe(U,T){var k=O(new Uint8Array(U));if(k[2]!==255||k[3]!==224)return U;var N=k[4]*256+k[5],Y=[255,216].concat(T,k.slice(4+N));return new Uint8Array(Y)}o(Xe,"insertExif");var C=_.ArrayBuffer,S=_.FileReader,P=_.URL||_.webkitURL,M=/\.\w+$/,H=_.Compressor,j=function(){function U(T,k){t(this,U),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(U,"Compressor"),s(U,[{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(!B(Q)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!P||!S){this.fail(new Error("The current browser does not support image compression."));return}C||(Y.checkOrientation=!1,Y.retainExif=!1);var Ee=Q==="image/jpeg",de=Ee&&Y.checkOrientation,ue=Ee&&Y.retainExif;if(P&&!de&&!ue)this.load({url:P.createObjectURL(N)});else{var ce=new S;this.reader=ce,ce.onload=function(Ue){var Me=Ue.target,Rt=Me.result,Ve={},le=1;de&&(le=ae(Rt),le>1&&a(Ve,ke(le))),ue&&(k.exif=Re(Rt)),de||ue?!P||le>1?Ve.url=te(Rt,Q):Ve.url=P.createObjectURL(N):Ve.url=Rt,k.load(Ve)},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},de||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."))},_.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(_.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,Ee=k.rotate,de=Ee===void 0?0:Ee,ue=k.scaleX,ce=ue===void 0?1:ue,Ue=k.scaleY,Me=Ue===void 0?1:Ue,Rt=this.file,Ve=this.image,le=this.options,Ot=document.createElement("canvas"),Ye=Ot.getContext("2d"),Wr=Math.abs(de)%180===90,po=(le.resize==="contain"||le.resize==="cover")&&R(le.width)&&R(le.height),zi=Math.max(le.maxWidth,0)||1/0,Gr=Math.max(le.maxHeight,0)||1/0,ji=Math.max(le.minWidth,0)||0,es=Math.max(le.minHeight,0)||0,Hi=Y/Q,ut=le.width,ct=le.height;if(Wr){var Zo=[Gr,zi];zi=Zo[0],Gr=Zo[1];var en=[es,ji];ji=en[0],es=en[1];var tn=[ct,ut];ut=tn[0],ct=tn[1]}po&&(Hi=ut/ct);var bl=Fe({aspectRatio:Hi,width:zi,height:Gr},"contain");zi=bl.width,Gr=bl.height;var wl=Fe({aspectRatio:Hi,width:ji,height:es},"cover");if(ji=wl.width,es=wl.height,po){var pe=Fe({aspectRatio:Hi,width:ut,height:ct},le.resize);ut=pe.width,ct=pe.height}else{var rn=Fe({aspectRatio:Hi,width:ut,height:ct}),ho=rn.width;ut=ho===void 0?Y:ho;var Nr=rn.height;ct=Nr===void 0?Q:Nr}ut=Math.floor(qe(Math.min(Math.max(ut,ji),zi))),ct=Math.floor(qe(Math.min(Math.max(ct,es),Gr)));var Qu=-ut/2,$i=-ct/2,kt=ut,Zu=ct,fo=[];if(po){var Le=0,Ce=0,sn=Y,Mr=Q,Sl=Fe({aspectRatio:Hi,width:Y,height:Q},{contain:"cover",cover:"contain"}[le.resize]);sn=Sl.width,Mr=Sl.height,Le=(Y-sn)/2,Ce=(Q-Mr)/2,fo.push(Le,Ce,sn,Mr)}if(fo.push(Qu,$i,kt,Zu),Wr){var Pr=[ct,ut];ut=Pr[0],ct=Pr[1]}Ot.width=ut,Ot.height=ct,B(le.mimeType)||(le.mimeType=Rt.type);var _l="transparent";Rt.size>le.convertSize&&le.convertTypes.indexOf(le.mimeType)>=0&&(le.mimeType="image/jpeg");var We=le.mimeType==="image/jpeg";if(We&&(_l="#fff"),Ye.fillStyle=_l,Ye.fillRect(0,0,ut,ct),le.beforeDraw&&le.beforeDraw.call(this,Ye,Ot),!this.aborted&&(Ye.save(),Ye.translate(ut/2,ct/2),Ye.rotate(de*Math.PI/180),Ye.scale(ce,Me),Ye.drawImage.apply(Ye,[Ve].concat(fo)),Ye.restore(),le.drew&&le.drew.call(this,Ye,Ot),!this.aborted)){var Jt=o(function(rs){if(!N.aborted){var mo=o(function(qi){return N.done({naturalWidth:Y,naturalHeight:Q,result:qi})},"done");if(rs&&We&&le.retainExif&&N.exif&&N.exif.length>0){var go=o(function(qi){return mo(p(te(Xe(qi,N.exif),le.mimeType)))},"next");if(rs.arrayBuffer)rs.arrayBuffer().then(go).catch(function(){N.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var pr=new S;N.reader=pr,pr.onload=function(on){var qi=on.target;go(qi.result)},pr.onabort=function(){N.fail(new Error("Aborted to read the compressed image with FileReader."))},pr.onerror=function(){N.fail(new Error("Failed to read the compressed image with FileReader."))},pr.onloadend=function(){N.reader=null},pr.readAsArrayBuffer(rs)}}else mo(rs)}},"callback");Ot.toBlob?Ot.toBlob(Jt,le.mimeType,le.quality):Jt(p(Ot.toDataURL(le.mimeType,le.quality)))}},"draw")},{key:"done",value:o(function(k){var N=k.naturalWidth,Y=k.naturalHeight,Q=k.result,Ee=this.file,de=this.image,ue=this.options;if(P&&de.src.indexOf("blob:")===0&&P.revokeObjectURL(de.src),Q)if(ue.strict&&!ue.retainExif&&Q.size>Ee.size&&ue.mimeType===Ee.type&&!(ue.width>N||ue.height>Y||ue.minWidth>N||ue.minHeight>Y||ue.maxWidth<N||ue.maxHeight<Y))Q=Ee;else{var ce=new Date;Q.lastModified=ce.getTime(),Q.lastModifiedDate=ce,Q.name=Ee.name,Q.name&&Q.type!==Ee.type&&(Q.name=Q.name.replace(M,G(Q.type)))}else Q=Ee;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=H,U},"noConflict")},{key:"setDefaults",value:o(function(k){a(y,k)},"setDefaults")}]),U}();return j})});var hf={};El(hf,{Audio:()=>Ds,AwsS3:()=>Lo,BasePlugin:()=>Oe,Box:()=>mi,Compressor:()=>vl,Core:()=>y3,Dashboard:()=>Es,DefaultStore:()=>Al,DragDrop:()=>Cs,DropTarget:()=>Uo,Dropbox:()=>gi,Facebook:()=>yi,FileInput:()=>Ts,Form:()=>Xo,GoldenRetriever:()=>Jo,GoogleDrive:()=>vi,GoogleDrivePicker:()=>bi,GooglePhotosPicker:()=>wi,ImageEditor:()=>Os,Informer:()=>ci,Instagram:()=>Si,OneDrive:()=>_i,ProgressBar:()=>ks,ReduxDevTools:()=>Qo,ReduxStore:()=>$g,RemoteSources:()=>Io,ScreenCapture:()=>Ms,StatusBar:()=>ui,ThumbnailGenerator:()=>Yi,Transloadit:()=>Ni,Tus:()=>Ui,UIPlugin:()=>se,Unsplash:()=>Pi,Uppy:()=>Nl,Url:()=>wr,Webcam:()=>Ls,XHRUpload:()=>Go,Zoom:()=>xi,debugLogger:()=>pn,locales:()=>b3,server:()=>Nc,views:()=>v3});function Cl(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Cl,"_classPrivateFieldLooseBase");var p1=0;function Ff(r){return"__private_"+p1+++"_"+r}o(Ff,"_classPrivateFieldLooseKey");function h1(r,e,t){let i=[];return r.forEach(s=>typeof s!="string"?i.push(s):e[Symbol.split](s).forEach((n,a,l)=>{n!==""&&i.push(n),a<l.length-1&&i.push(t)})),i}o(h1,"insertReplacement");function xf(r,e){let t=/\$/g,i="$$$$",s=[r];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,i)),s=h1(s,new RegExp(`%\\{${n}\\}`,"g"),a)}return s}o(xf,"interpolate");var f1=o(r=>{throw new Error(`missing string: ${r}`)},"defaultOnMissingKey"),an=Ff("onMissingKey"),ln=Ff("apply"),ns=class{static{o(this,"Translator")}constructor(e,t){let{onMissingKey:i=f1}=t===void 0?{}:t;Object.defineProperty(this,ln,{value:m1}),Object.defineProperty(this,an,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(Cl(this,ln)[ln],this):Cl(this,ln)[ln](e),Cl(this,an)[an]=i}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let i=this.locale.strings[e];if(i==null&&(Cl(this,an)[an](e),i=e),typeof i=="object"){if(t&&typeof t.smart_count<"u"){let n=this.locale.pluralize(t.smart_count);return xf(i[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof i!="string")throw new Error("string was not a string");return xf(i,t)}};function m1(r){if(!(r!=null&&r.strings))return;let e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...r.strings},pluralize:r.pluralize||e.pluralize})}o(m1,"_apply2");var bm=be(Cf(),1);var g1="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var mr=o((r=21)=>{let e="",t=r|0;for(;t--;)e+=g1[Math.random()*64|0];return e},"nanoid");var wm=be(ac(),1);function Ol(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Ol,"_classPrivateFieldLooseBase");var uw=0;function nm(r){return"__private_"+uw+++"_"+r}o(nm,"_classPrivateFieldLooseKey");var cw={version:"4.2.0"},as=nm("callbacks"),lc=nm("publish"),kl=class{static{o(this,"DefaultStore")}constructor(){Object.defineProperty(this,lc,{value:dw}),this.state={},Object.defineProperty(this,as,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t={...this.state},i={...this.state,...e};this.state=i,Ol(this,lc)[lc](t,i,e)}subscribe(e){return Ol(this,as)[as].add(e),()=>{Ol(this,as)[as].delete(e)}}};function dw(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];Ol(this,as)[as].forEach(i=>{i(...e)})}o(dw,"_publish2");kl.VERSION=cw.version;var Al=kl;function Br(r){let e=r.lastIndexOf(".");return e===-1||e===r.length-1?{name:r,extension:void 0}:{name:r.slice(0,e),extension:r.slice(e+1)}}o(Br,"getFileNameAndExtension");var cn={__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",msg:"application/vnd.ms-outlook",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 dn(r){var e;if(r.type)return r.type;let t=r.name?(e=Br(r.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in cn?cn[t]:"application/octet-stream"}o(dn,"getFileType");function pw(r){return r.charCodeAt(0).toString(32)}o(pw,"encodeCharacter");function am(r){let e="";return r.replace(/[^A-Z0-9]/gi,t=>(e+=`-${pw(t)}`,"/"))+e}o(am,"encodeFilename");function lm(r,e){let t=e||"uppy";return typeof r.name=="string"&&(t+=`-${am(r.name.toLowerCase())}`),r.type!==void 0&&(t+=`-${r.type}`),r.meta&&typeof r.meta.relativePath=="string"&&(t+=`-${am(r.meta.relativePath.toLowerCase())}`),r.data.size!==void 0&&(t+=`-${r.data.size}`),r.data.lastModified!==void 0&&(t+=`-${r.data.lastModified}`),t}o(lm,"generateFileID");function hw(r){return!r.isRemote||!r.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(r.remote.provider)}o(hw,"hasFileStableId");function Rl(r,e){if(hw(r))return r.id;let t=dn(r);return lm({...r,type:t},e)}o(Rl,"getSafeFileId");function uc(r){if(r==null&&typeof navigator<"u"&&(r=navigator.userAgent),!r)return!0;let e=/Edge\/(\d+\.\d+)/.exec(r);if(!e)return!0;let i=e[1].split(".",2),s=parseInt(i[0],10),n=parseInt(i[1],10);return s<15||s===15&&n<15063||s>18||s===18&&n>=18218}o(uc,"supportsUploadProgress");function cc(r,e){return e.name?e.name:r.split("/")[0]==="image"?`${r.split("/")[0]}.${r.split("/")[1]}`:"noname"}o(cc,"getFileName");function dc(r){return r<10?`0${r}`:r.toString()}o(dc,"pad");function vo(){let r=new Date,e=dc(r.getHours()),t=dc(r.getMinutes()),i=dc(r.getSeconds());return`${e}:${t}:${i}`}o(vo,"getTimeStamp");var um={debug:o(()=>{},"debug"),warn:o(()=>{},"warn"),error:o(function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return console.error(`[Uppy] [${vo()}]`,...e)},"error")},pn={debug:o(function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${vo()}]`,...e)},"debug"),warn:o(function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${vo()}]`,...e)},"warn"),error:o(function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return console.error(`[Uppy] [${vo()}]`,...e)},"error")};var fn=be(hn(),1),gm=be(mm(),1);var ym={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 i;super(e),this.isRestriction=!0,this.isUserFacing=(i=t?.isUserFacing)!=null?i:!0,t!=null&&t.file&&(this.file=t.file)}},Ul=class{static{o(this,"Restricter")}constructor(e,t){this.getI18n=t,this.getOpts=()=>{var i;let s=e();if(((i=s.restrictions)==null?void 0:i.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:i,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(i){let n=[...e,...t].reduce((a,l)=>{var u;return a+((u=l.size)!=null?u:0)},0);if(n>i)throw new qt(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,fn.default)(i),size:(0,fn.default)(n)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:i,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(l=>l.includes("/")?e.type?(0,gm.default)(e.type.replace(/;.*?$/,""),l):!1:l[0]==="."&&e.extension?e.extension.toLowerCase()===l.slice(1).toLowerCase():!1)){let l=s.join(", ");throw new qt(this.getI18n()("youCanOnlyUploadFileTypes",{types:l}),{file:e})}if(t&&e.size!=null&&e.size>t){var n;throw new qt(this.getI18n()("exceedsSize",{size:(0,fn.default)(t),file:(n=e.name)!=null?n:this.getI18n()("unnamed")}),{file:e})}if(i&&e.size!=null&&e.size<i)throw new qt(this.getI18n()("inferiorSize",{size:(0,fn.default)(i)}),{file:e})}validate(e,t){t.forEach(i=>{this.validateSingleFile(i)}),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){var t;let i=new qt(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(t=e.name)!=null?t:this.getI18n()("unnamed")})),{requiredMetaFields:s}=this.getOpts().restrictions,n=[];for(let a of s)(!Object.hasOwn(e.meta,a)||e.meta[a]==="")&&n.push(a);return{missingFields:n,error:i}}};var vm={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function X(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(X,"_classPrivateFieldLooseBase");var gw=0;function Te(r){return"__private_"+gw+++"_"+r}o(Te,"_classPrivateFieldLooseKey");var yw={version:"4.4.7"},Il={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},yt=Te("plugins"),vt=Te("restricter"),mn=Te("storeUnsubscribe"),Yr=Te("emitter"),ls=Te("preProcessors"),us=Te("uploaders"),Zr=Te("postProcessors"),Zt=Te("informAndEmit"),Pn=Te("checkRequiredMetaFieldsOnFile"),pc=Te("checkRequiredMetaFields"),gn=Te("assertNewUploadAllowed"),mc=Te("transformFile"),yn=Te("startIfAutoProceed"),vn=Te("checkAndUpdateFileState"),_n=Te("getFilesToRetry"),bn=Te("doRetryAll"),gc=Te("handleUploadProgress"),wn=Te("updateTotalProgress"),ei=Te("updateTotalProgressThrottled"),yc=Te("calculateTotalProgress"),hc=Te("addListeners"),Fr=Te("updateOnlineStatus"),Sn=Te("requestClientById"),Jr=Te("createUpload"),fc=Te("getUpload"),cs=Te("removeUpload"),Qr=Te("runUpload"),Dl=class r{static{o(this,"Uppy")}constructor(e){Object.defineProperty(this,Qr,{value:Uw}),Object.defineProperty(this,cs,{value:Rw}),Object.defineProperty(this,fc,{value:Aw}),Object.defineProperty(this,Jr,{value:kw}),Object.defineProperty(this,hc,{value:Ow}),Object.defineProperty(this,yc,{value:Tw}),Object.defineProperty(this,wn,{value:Cw}),Object.defineProperty(this,bn,{value:Ew}),Object.defineProperty(this,_n,{value:Fw}),Object.defineProperty(this,vn,{value:xw}),Object.defineProperty(this,yn,{value:Pw}),Object.defineProperty(this,mc,{value:_w}),Object.defineProperty(this,gn,{value:Sw}),Object.defineProperty(this,pc,{value:ww}),Object.defineProperty(this,Pn,{value:bw}),Object.defineProperty(this,Zt,{value:vw}),Object.defineProperty(this,yt,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,mn,{writable:!0,value:void 0}),Object.defineProperty(this,Yr,{writable:!0,value:(0,bm.default)()}),Object.defineProperty(this,ls,{writable:!0,value:new Set}),Object.defineProperty(this,us,{writable:!0,value:new Set}),Object.defineProperty(this,Zr,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,gc,{writable:!0,value:o((s,n)=>{let a=s?this.getFile(s.id):void 0;if(s==null||!a){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}if(a.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}let l={bytesTotal:n.bytesTotal,percentage:n.bytesTotal!=null&&Number.isFinite(n.bytesTotal)&&n.bytesTotal>0?Math.round(n.bytesUploaded/n.bytesTotal*100):void 0};a.progress.uploadStarted!=null?this.setFileState(s.id,{progress:{...a.progress,...l,bytesUploaded:n.bytesUploaded}}):this.setFileState(s.id,{progress:{...a.progress,...l}}),X(this,ei)[ei]()},"value")}),Object.defineProperty(this,ei,{writable:!0,value:(0,wm.default)(()=>X(this,wn)[wn](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,Fr,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,Sn,{writable:!0,value:new Map}),this.defaultLocale=vm;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:ym,meta:{},onBeforeFileAdded:o((s,n)=>!Object.hasOwn(n,s.id),"onBeforeFileAdded"),onBeforeUpload:o(s=>s,"onBeforeUpload"),store:new Al,logger:um,infoTimeout:5e3},i={...t,...e};this.opts={...i,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${r.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Il,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:uc(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),X(this,vt)[vt]=new Ul(()=>this.opts,()=>this.i18n),X(this,mn)[mn]=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),X(this,hc)[hc]()}emit(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];X(this,Yr)[Yr].emit(e,...i)}on(e,t){return X(this,Yr)[Yr].on(e,t),this}once(e,t){return X(this,Yr)[Yr].once(e,t),this}off(e,t){return X(this,Yr)[Yr].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(i=>{let[s,n]=i;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(i=>this.log(`Missing i18n string: ${i}`,"error"),"onMissingKey"),t=new ns([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:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},i=Object.create(null);Object.keys(t).forEach(s=>{i[s]={...t[s],progress:{...t[s].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:i,...Il})}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Il,files:{}})}addPreProcessor(e){X(this,ls)[ls].add(e)}removePreProcessor(e){return X(this,ls)[ls].delete(e)}addPostProcessor(e){X(this,Zr)[Zr].add(e)}removePostProcessor(e){return X(this,Zr)[Zr].delete(e)}addUploader(e){X(this,us)[us].add(e)}removeUploader(e){return X(this,us)[us].delete(e)}setMeta(e){let t={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach(s=>{i[s]={...i[s],meta:{...i[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:i})}setFileMeta(e,t){let i={...this.getState().files};if(!i[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let s={...i[e].meta,...t};i[e]={...i[e],meta:s},this.setState({files:i})}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:i}=this.getState(),s=Object.values(e),n=[],a=[],l=[],u=[],d=[],p=[],f=[],y=[],v=[];for(let _ of s){let{progress:R}=_;!R.uploadComplete&&R.uploadStarted&&(n.push(_),_.isPaused||y.push(_)),R.uploadStarted||a.push(_),(R.uploadStarted||R.preprocess||R.postprocess)&&l.push(_),R.uploadStarted&&u.push(_),_.isPaused&&d.push(_),R.uploadComplete&&p.push(_),_.error&&f.push(_),(R.preprocess||R.postprocess)&&v.push(_)}return{newFiles:a,startedFiles:l,uploadStartedFiles:u,pausedFiles:d,completeFiles:p,erroredFiles:f,inProgressFiles:n,inProgressNotPausedFiles:y,processingFiles:v,isUploadStarted:u.length>0,isAllComplete:t===100&&p.length===s.length&&v.length===0,isAllErrored:!!i&&f.length===s.length,isAllPaused:n.length!==0&&d.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some(_=>_.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{X(this,vt)[vt].validate(t,[e])}catch(i){return i}return null}validateSingleFile(e){try{X(this,vt)[vt].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{X(this,vt)[vt].validateAggregateRestrictions(t,e)}catch(i){return i.message}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){X(this,gn)[gn](e);let{nextFilesState:t,validFilesToAdd:i,errors:s}=X(this,vn)[vn]([e]),n=s.filter(l=>l.isRestriction);if(X(this,Zt)[Zt](n),s.length>0)throw s[0];this.setState({files:t});let[a]=i;return this.emit("file-added",a),this.emit("files-added",i),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),X(this,yn)[yn](),a.id}addFiles(e){X(this,gn)[gn]();let{nextFilesState:t,validFilesToAdd:i,errors:s}=X(this,vn)[vn](e),n=s.filter(l=>l.isRestriction);X(this,Zt)[Zt](n);let a=s.filter(l=>!l.isRestriction);if(a.length>0){let l=`Multiple errors occurred while adding files:
`;if(a.forEach(u=>{l+=`
 * ${u.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:l},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,l);{let u=new Error(l);throw u.errors=a,u}}this.setState({files:t}),i.forEach(l=>{this.emit("file-added",l)}),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach(l=>{this.log(`Added file: ${l.name}
 id: ${l.id}
 type: ${l.type}`)}),i.length>0&&X(this,yn)[yn]()}removeFiles(e){let{files:t,currentUploads:i}=this.getState(),s={...t},n={...i},a=Object.create(null);e.forEach(p=>{t[p]&&(a[p]=t[p],delete s[p])});function l(p){return a[p]===void 0}o(l,"fileIsNotRemoved"),Object.keys(n).forEach(p=>{let f=i[p].fileIDs.filter(l);if(f.length===0){delete n[p];return}let{capabilities:y}=this.getState();if(f.length!==i[p].fileIDs.length&&!y.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");n[p]={...i[p],fileIDs:f}});let u={currentUploads:n,files:s};Object.keys(s).length===0&&(u.allowNewUpload=!0,u.error=null,u.recoveredState=null),this.setState(u),X(this,ei)[ei]();let d=Object.keys(a);d.forEach(p=>{this.emit("file-removed",a[p])}),d.length>5?this.log(`Removed ${d.length} files`):this.log(`Removed files: ${d.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let t=this.getFile(e),s=!(t.isPaused||!1);return this.setFileState(e,{isPaused:s}),this.emit("upload-pause",t,s),s}pauseAll(){let e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{let s={...e[i],isPaused:!0};e[i]=s}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e={...this.getState().files};Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{let s={...e[i],isPaused:!1,error:null};e[i]=s}),this.setState({files:e}),this.emit("resume-all")}async retryAll(){let e=await X(this,bn)[bn]();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(Il)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=X(this,Jr)[Jr]([e],{forceAllowNewUpload:!0});return X(this,Qr)[Qr](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return X(this,wn)[wn]()}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){if(typeof e!="function"){let u=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(u)}for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];let n=new e(this,...i),a=n.id;if(!a)throw new Error("Your plugin must have an id");if(!n.type)throw new Error("Your plugin must have a type");let l=this.getPlugin(a);if(l){let u=`Already found a plugin named '${l.id}'. Tried to use: '${a}'.
Uppy plugins must have unique \`id\` options.`;throw new Error(u)}return e.VERSION&&this.log(`Using ${a} v${e.VERSION}`),n.type in X(this,yt)[yt]?X(this,yt)[yt][n.type].push(n):X(this,yt)[yt][n.type]=[n],n.install(),this.emit("plugin-added",n),this}getPlugin(e){for(let t of Object.values(X(this,yt)[yt])){let i=t.find(s=>s.id===e);if(i!=null)return i}}[Symbol.for("uppy test: getPlugins")](e){return X(this,yt)[yt][e]}iteratePlugins(e){Object.values(X(this,yt)[yt]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=X(this,yt)[yt][e.type],i=t.findIndex(a=>a.id===e.id);i!==-1&&t.splice(i,1);let n={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(n)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),X(this,mn)[mn](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",X(this,Fr)[Fr]),window.removeEventListener("offline",X(this,Fr)[Fr]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,i){t===void 0&&(t="info"),i===void 0&&(i=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(),i),this.emit("info-visible")}log(e,t){let{logger:i}=this.opts;switch(t){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e);break}}registerRequestClient(e,t){X(this,Sn)[Sn].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=X(this,Sn)[Sn].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]?X(this,Qr)[Qr](e):(X(this,cs)[cs](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return X(this,Jr)[Jr](...arguments)}addResultData(e,t){if(!X(this,fc)[fc](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:i}=this.getState(),s={...i[e],result:{...i[e].result,...t}};this.setState({currentUploads:{...i,[e]:s}})}async upload(){var e;(e=X(this,yt)[yt].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();if(X(this,_n)[_n]().length>0){let n=await X(this,bn)[bn]();if(!(this.getFiles().filter(l=>l.progress.uploadStarted==null).length>0))return this.emit("complete",n),n;({files:t}=this.getState())}let s=this.opts.onBeforeUpload(t);return s===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(s&&typeof s=="object"&&(t=s,this.setState({files:t})),Promise.resolve().then(()=>X(this,vt)[vt].validateMinNumberOfFiles(t)).catch(n=>{throw X(this,Zt)[Zt]([n]),n}).then(()=>{if(!X(this,pc)[pc](t))throw new qt(this.i18n("missingRequiredMetaField"))}).catch(n=>{throw n}).then(async()=>{let{currentUploads:n}=this.getState(),a=Object.values(n).flatMap(p=>p.fileIDs),l=[];Object.keys(t).forEach(p=>{let f=this.getFile(p);!f.progress.uploadStarted&&a.indexOf(p)===-1&&l.push(f.id)});let u=X(this,Jr)[Jr](l),d=await X(this,Qr)[Qr](u);return this.emit("complete",d),d}).catch(n=>{throw this.emit("error",n),this.log(n,"error"),n}))}};function vw(r){for(let n of r)n.isRestriction?this.emit("restriction-failed",n.file,n):this.emit("error",n,n.file),this.log(n,"warning");let e=r.filter(n=>n.isUserFacing),t=4,i=e.slice(0,t),s=e.slice(t);i.forEach(n=>{let{message:a,details:l=""}=n;this.info({message:a,details:l},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}o(vw,"_informAndEmit2");function bw(r){let{missingFields:e,error:t}=X(this,vt)[vt].getMissingRequiredMetaFields(r);return e.length>0?(this.setFileState(r.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",r,t),!1):(e.length===0&&r.missingRequiredMetaFields&&this.setFileState(r.id,{missingRequiredMetaFields:[]}),!0)}o(bw,"_checkRequiredMetaFieldsOnFile2");function ww(r){let e=!0;for(let t of Object.values(r))X(this,Pn)[Pn](t)||(e=!1);return e}o(ww,"_checkRequiredMetaFields2");function Sw(r){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new qt(this.i18n("noMoreFilesAllowed"),{file:r});throw X(this,Zt)[Zt]([t]),t}}o(Sw,"_assertNewUploadAllowed2");function _w(r){let e=r instanceof File?{name:r.name,type:r.type,size:r.size,data:r}:r,t=dn(e),i=cc(t,e),s=Br(i).extension,n=Rl(e,this.getID()),a=e.meta||{};a.name=i,a.type=t;let l=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:n,name:i,extension:s||"",meta:{...this.getState().meta,...a},type:t,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}o(_w,"_transformFile2");function Pw(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(r=>{r.isRestriction||this.log(r.stack||r.message||r)})},4))}o(Pw,"_startIfAutoProceed2");function xw(r){let{files:e}=this.getState(),t={...e},i=[],s=[];for(let l of r)try{var n;let u=X(this,mc)[mc](l),d=(n=e[u.id])==null?void 0:n.isGhost;d&&(u={...e[u.id],isGhost:!1,data:l.data},this.log(`Replaced the blob in the restored ghost file: ${u.name}, ${u.id}`));let p=this.opts.onBeforeFileAdded(u,t);if(!p&&this.checkIfFileAlreadyExists(u.id)){var a;throw new qt(this.i18n("noDuplicates",{fileName:(a=u.name)!=null?a:this.i18n("unnamed")}),{file:l})}if(p===!1&&!d)throw new qt("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:l});typeof p=="object"&&p!==null&&(u=p),X(this,vt)[vt].validateSingleFile(u),t[u.id]=u,i.push(u)}catch(u){s.push(u)}try{X(this,vt)[vt].validateAggregateRestrictions(Object.values(e),i)}catch(l){return s.push(l),{nextFilesState:e,validFilesToAdd:[],errors:s}}return{nextFilesState:t,validFilesToAdd:i,errors:s}}o(xw,"_checkAndUpdateFileState2");function Fw(){let{files:r}=this.getState();return Object.keys(r).filter(e=>r[e].error)}o(Fw,"_getFilesToRetry2");async function Ew(){let r=X(this,_n)[_n](),e={...this.getState().files};if(r.forEach(i=>{e[i]={...e[i],isPaused:!1,error:null}}),this.setState({files:e,error:null}),this.emit("retry-all",this.getFilesByIds(r)),r.length===0)return{successful:[],failed:[]};let t=X(this,Jr)[Jr](r,{forceAllowNewUpload:!0});return X(this,Qr)[Qr](t)}o(Ew,"_doRetryAll2");function Cw(){var r,e;let t=X(this,yc)[yc](),i=null;t!=null&&(i=Math.round(t*100),i>100?i=100:i<0&&(i=0)),this.emit("progress",(r=i)!=null?r:0),this.setState({totalProgress:(e=i)!=null?e:0})}o(Cw,"_updateTotalProgress2");function Tw(){let e=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(e.length===0)return 0;if(e.every(l=>l.progress.uploadComplete))return 1;let t=o(l=>l.progress.bytesTotal!=null&&l.progress.bytesTotal!==0,"isSizedFile"),i=e.filter(t),s=e.filter(l=>!t(l));if(i.every(l=>l.progress.uploadComplete)&&s.length>0&&!s.every(l=>l.progress.uploadComplete))return null;let n=i.reduce((l,u)=>{var d;return l+((d=u.progress.bytesTotal)!=null?d:0)},0),a=i.reduce((l,u)=>l+(u.progress.bytesUploaded||0),0);return n===0?0:a/n}o(Tw,"_calculateTotalProgress2");function Ow(){let r=o((i,s,n)=>{let a=i.message||"Unknown error";i.details&&(a+=` ${i.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",r),this.on("upload-error",(i,s,n)=>{if(r(s,i,n),typeof s=="object"&&s.message){var a;this.log(s.message,"error");let l=new Error(this.i18n("failedToUpload",{file:(a=i?.name)!=null?a:""}));l.isUserFacing=!0,l.details=s.message,s.details&&(l.details+=` ${s.details}`),X(this,Zt)[Zt]([l])}else X(this,Zt)[Zt]([s])});let e=null;this.on("upload-stalled",(i,s)=>{let{message:n}=i,a=s.map(l=>l.meta.name).join(", ");e||(this.info({message:n,details:a},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${n} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let t=o(i=>{let s=i.filter(a=>{let l=a!=null&&this.getFile(a.id);return l||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),l}),n=Object.fromEntries(s.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(n)},"onUploadStarted");this.on("upload-start",t),this.on("upload-progress",X(this,gc)[gc]),this.on("upload-success",(i,s)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let n=this.getFile(i.id).progress;this.setFileState(i.id,{progress:{...n,postprocess:X(this,Zr)[Zr].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),i.size==null&&this.setFileState(i.id,{size:s.bytesUploaded||n.bytesTotal}),X(this,ei)[ei]()}),this.on("preprocess-progress",(i,s)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}this.setFileState(i.id,{progress:{...this.getFile(i.id).progress,preprocess:s}})}),this.on("preprocess-complete",i=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let s={...this.getState().files};s[i.id]={...s[i.id],progress:{...s[i.id].progress}},delete s[i.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(i,s)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}this.setFileState(i.id,{progress:{...this.getState().files[i.id].progress,postprocess:s}})}),this.on("postprocess-complete",i=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let s={...this.getState().files};s[i.id]={...s[i.id],progress:{...s[i.id].progress}},delete s[i.id].progress.postprocess,this.setState({files:s})}),this.on("restored",()=>{X(this,ei)[ei]()}),this.on("dashboard:file-edit-complete",i=>{i&&X(this,Pn)[Pn](i)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",X(this,Fr)[Fr]),window.addEventListener("offline",X(this,Fr)[Fr]),setTimeout(X(this,Fr)[Fr],3e3))}o(Ow,"_addListeners2");function kw(r,e){e===void 0&&(e={});let{forceAllowNewUpload:t=!1}=e,{allowNewUpload:i,currentUploads:s}=this.getState();if(!i&&!t)throw new Error("Cannot create a new upload: already uploading.");let n=mr();return this.emit("upload",n,this.getFilesByIds(r)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[n]:{fileIDs:r,step:0,result:{}}}}),n}o(kw,"_createUpload2");function Aw(r){let{currentUploads:e}=this.getState();return e[r]}o(Aw,"_getUpload2");function Rw(r){let e={...this.getState().currentUploads};delete e[r],this.setState({currentUploads:e})}o(Rw,"_removeUpload2");async function Uw(r){let e=o(()=>{let{currentUploads:n}=this.getState();return n[r]},"getCurrentUpload"),t=e(),i=[...X(this,ls)[ls],...X(this,us)[us],...X(this,Zr)[Zr]];try{for(let n=t.step||0;n<i.length&&t;n++){let a=i[n];this.setState({currentUploads:{...this.getState().currentUploads,[r]:{...t,step:n}}});let{fileIDs:l}=t;await a(l,r),t=e()}}catch(n){throw X(this,cs)[cs](r),n}if(t){t.fileIDs.forEach(u=>{let d=this.getFile(u);d&&d.progress.postprocess&&this.emit("postprocess-complete",d)});let n=t.fileIDs.map(u=>this.getFile(u)),a=n.filter(u=>!u.error),l=n.filter(u=>u.error);this.addResultData(r,{successful:a,failed:l,uploadID:r}),t=e()}let s;return t&&(s=t.result,X(this,cs)[cs](r)),s==null&&(this.log(`Not setting result for an upload that has been removed: ${r}`),s={successful:[],failed:[],uploadID:r}),s}o(Uw,"_runUpload2");Dl.VERSION=yw.version;var Nl=Dl;var En,re,Em,Iw,xn,Sm,Dw,Ml={},Cm=[],Nw=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function ti(r,e){for(var t in e)r[t]=e[t];return r}o(ti,"s");function Tm(r){var e=r.parentNode;e&&e.removeChild(r)}o(Tm,"a");function c(r,e,t){var i,s,n,a={};for(n in e)n=="key"?i=e[n]:n=="ref"?s=e[n]:a[n]=e[n];if(arguments.length>2&&(a.children=arguments.length>3?En.call(arguments,2):t),typeof r=="function"&&r.defaultProps!=null)for(n in r.defaultProps)a[n]===void 0&&(a[n]=r.defaultProps[n]);return Fn(r,a,i,s,null)}o(c,"h");function Fn(r,e,t,i,s){var n={type:r,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:s??++Em};return s==null&&re.vnode!=null&&re.vnode(n),n}o(Fn,"v");function zl(){return{current:null}}o(zl,"y");function Qe(r){return r.children}o(Qe,"p");function we(r,e){this.props=r,this.context=e}o(we,"d");function bo(r,e){if(e==null)return r.__?bo(r.__,r.__.__k.indexOf(r)+1):null;for(var t;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null)return t.__e;return typeof r.type=="function"?bo(r):null}o(bo,"_");function Om(r){var e,t;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,e=0;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null){r.__e=r.__c.base=t.__e;break}return Om(r)}}o(Om,"k");function _m(r){(!r.__d&&(r.__d=!0)&&xn.push(r)&&!Ll.__r++||Sm!==re.debounceRendering)&&((Sm=re.debounceRendering)||setTimeout)(Ll)}o(_m,"b");function Ll(){for(var r;Ll.__r=xn.length;)r=xn.sort(function(e,t){return e.__v.__b-t.__v.__b}),xn=[],r.some(function(e){var t,i,s,n,a,l;e.__d&&(a=(n=(t=e).__v).__e,(l=t.__P)&&(i=[],(s=ti({},n)).__v=n.__v+1,vc(l,n,s,t.__n,l.ownerSVGElement!==void 0,n.__h!=null?[a]:null,i,a??bo(n),n.__h),Um(i,n),n.__e!=a&&Om(n)))})}o(Ll,"g");function km(r,e,t,i,s,n,a,l,u,d){var p,f,y,v,_,R,E,O=i&&i.__k||Cm,L=O.length;for(t.__k=[],p=0;p<e.length;p++)if((v=t.__k[p]=(v=e[p])==null||typeof v=="boolean"?null:typeof v=="string"||typeof v=="number"||typeof v=="bigint"?Fn(null,v,null,null,v):Array.isArray(v)?Fn(Qe,{children:v},null,null,null):v.__b>0?Fn(v.type,v.props,v.key,null,v.__v):v)!=null){if(v.__=t,v.__b=t.__b+1,(y=O[p])===null||y&&v.key==y.key&&v.type===y.type)O[p]=void 0;else for(f=0;f<L;f++){if((y=O[f])&&v.key==y.key&&v.type===y.type){O[f]=void 0;break}y=null}vc(r,v,y=y||Ml,s,n,a,l,u,d),_=v.__e,(f=v.ref)&&y.ref!=f&&(E||(E=[]),y.ref&&E.push(y.ref,null,v),E.push(f,v.__c||_,v)),_!=null?(R==null&&(R=_),typeof v.type=="function"&&v.__k===y.__k?v.__d=u=Am(v,u,r):u=Rm(r,v,y,O,_,u),typeof t.type=="function"&&(t.__d=u)):u&&y.__e==u&&u.parentNode!=r&&(u=bo(y))}for(t.__e=R,p=L;p--;)O[p]!=null&&(typeof t.type=="function"&&O[p].__e!=null&&O[p].__e==t.__d&&(t.__d=bo(i,p+1)),Dm(O[p],O[p]));if(E)for(p=0;p<E.length;p++)Im(E[p],E[++p],E[++p])}o(km,"w");function Am(r,e,t){for(var i,s=r.__k,n=0;s&&n<s.length;n++)(i=s[n])&&(i.__=r,e=typeof i.type=="function"?Am(i,e,t):Rm(t,i,i,s,i.__e,e));return e}o(Am,"m");function Vt(r,e){return e=e||[],r==null||typeof r=="boolean"||(Array.isArray(r)?r.some(function(t){Vt(t,e)}):e.push(r)),e}o(Vt,"x");function Rm(r,e,t,i,s,n){var a,l,u;if(e.__d!==void 0)a=e.__d,e.__d=void 0;else if(t==null||s!=n||s.parentNode==null)e:if(n==null||n.parentNode!==r)r.appendChild(s),a=null;else{for(l=n,u=0;(l=l.nextSibling)&&u<i.length;u+=2)if(l==s)break e;r.insertBefore(s,n),a=n}return a!==void 0?a:s.nextSibling}o(Rm,"A");function Mw(r,e,t,i,s){var n;for(n in t)n==="children"||n==="key"||n in e||Bl(r,n,null,t[n],i);for(n in e)s&&typeof e[n]!="function"||n==="children"||n==="key"||n==="value"||n==="checked"||t[n]===e[n]||Bl(r,n,e[n],t[n],i)}o(Mw,"C");function Pm(r,e,t){e[0]==="-"?r.setProperty(e,t):r[e]=t==null?"":typeof t!="number"||Nw.test(e)?t:t+"px"}o(Pm,"$");function Bl(r,e,t,i,s){var n;e:if(e==="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof i=="string"&&(r.style.cssText=i=""),i)for(e in i)t&&e in t||Pm(r.style,e,"");if(t)for(e in t)i&&t[e]===i[e]||Pm(r.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")n=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in r?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+n]=t,t?i||r.addEventListener(e,n?Fm:xm,n):r.removeEventListener(e,n?Fm:xm,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 r)try{r[e]=t??"";break e}catch{}typeof t=="function"||(t!=null&&(t!==!1||e[0]==="a"&&e[1]==="r")?r.setAttribute(e,t):r.removeAttribute(e))}}o(Bl,"H");function xm(r){this.l[r.type+!1](re.event?re.event(r):r)}o(xm,"I");function Fm(r){this.l[r.type+!0](re.event?re.event(r):r)}o(Fm,"T");function vc(r,e,t,i,s,n,a,l,u){var d,p,f,y,v,_,R,E,O,L,B,G,J,$=e.type;if(e.constructor!==void 0)return null;t.__h!=null&&(u=t.__h,l=e.__e=t.__e,e.__h=null,n=[l]),(d=re.__b)&&d(e);try{e:if(typeof $=="function"){if(E=e.props,O=(d=$.contextType)&&i[d.__c],L=d?O?O.props.value:d.__:i,t.__c?R=(p=e.__c=t.__c).__=p.__E:("prototype"in $&&$.prototype.render?e.__c=p=new $(E,L):(e.__c=p=new we(E,L),p.constructor=$,p.render=Bw),O&&O.sub(p),p.props=E,p.state||(p.state={}),p.context=L,p.__n=i,f=p.__d=!0,p.__h=[]),p.__s==null&&(p.__s=p.state),$.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=ti({},p.__s)),ti(p.__s,$.getDerivedStateFromProps(E,p.__s))),y=p.props,v=p.state,f)$.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if($.getDerivedStateFromProps==null&&E!==y&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(E,L),!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(E,p.__s,L)===!1||e.__v===t.__v){p.props=E,p.state=p.__s,e.__v!==t.__v&&(p.__d=!1),p.__v=e,e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(W){W&&(W.__=e)}),p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(E,p.__s,L),p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(y,v,_)})}if(p.context=L,p.props=E,p.__v=e,p.__P=r,B=re.__r,G=0,"prototype"in $&&$.prototype.render)p.state=p.__s,p.__d=!1,B&&B(e),d=p.render(p.props,p.state,p.context);else do p.__d=!1,B&&B(e),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++G<25);p.state=p.__s,p.getChildContext!=null&&(i=ti(ti({},i),p.getChildContext())),f||p.getSnapshotBeforeUpdate==null||(_=p.getSnapshotBeforeUpdate(y,v)),J=d!=null&&d.type===Qe&&d.key==null?d.props.children:d,km(r,Array.isArray(J)?J:[J],e,t,i,s,n,a,l,u),p.base=e.__e,e.__h=null,p.__h.length&&a.push(p),R&&(p.__E=p.__=null),p.__e=!1}else n==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=Lw(t.__e,e,t,i,s,n,a,u);(d=re.diffed)&&d(e)}catch(W){e.__v=null,(u||n!=null)&&(e.__e=l,e.__h=!!u,n[n.indexOf(l)]=null),re.__e(W,e,t)}}o(vc,"j");function Um(r,e){re.__c&&re.__c(e,r),r.some(function(t){try{r=t.__h,t.__h=[],r.some(function(i){i.call(t)})}catch(i){re.__e(i,t.__v)}})}o(Um,"z");function Lw(r,e,t,i,s,n,a,l){var u,d,p,f=t.props,y=e.props,v=e.type,_=0;if(v==="svg"&&(s=!0),n!=null){for(;_<n.length;_++)if((u=n[_])&&"setAttribute"in u==!!v&&(v?u.localName===v:u.nodeType===3)){r=u,n[_]=null;break}}if(r==null){if(v===null)return document.createTextNode(y);r=s?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,y.is&&y),n=null,l=!1}if(v===null)f===y||l&&r.data===y||(r.data=y);else{if(n=n&&En.call(r.childNodes),d=(f=t.props||Ml).dangerouslySetInnerHTML,p=y.dangerouslySetInnerHTML,!l){if(n!=null)for(f={},_=0;_<r.attributes.length;_++)f[r.attributes[_].name]=r.attributes[_].value;(p||d)&&(p&&(d&&p.__html==d.__html||p.__html===r.innerHTML)||(r.innerHTML=p&&p.__html||""))}if(Mw(r,y,f,s,l),p)e.__k=[];else if(_=e.props.children,km(r,Array.isArray(_)?_:[_],e,t,i,s&&v!=="foreignObject",n,a,n?n[0]:t.__k&&bo(t,0),l),n!=null)for(_=n.length;_--;)n[_]!=null&&Tm(n[_]);l||("value"in y&&(_=y.value)!==void 0&&(_!==r.value||v==="progress"&&!_||v==="option"&&_!==f.value)&&Bl(r,"value",_,f.value,!1),"checked"in y&&(_=y.checked)!==void 0&&_!==r.checked&&Bl(r,"checked",_,f.checked,!1))}return r}o(Lw,"L");function Im(r,e,t){try{typeof r=="function"?r(e):r.current=e}catch(i){re.__e(i,t)}}o(Im,"M");function Dm(r,e,t){var i,s;if(re.unmount&&re.unmount(r),(i=r.ref)&&(i.current&&i.current!==r.__e||Im(i,null,e)),(i=r.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){re.__e(n,e)}i.base=i.__P=null}if(i=r.__k)for(s=0;s<i.length;s++)i[s]&&Dm(i[s],e,typeof r.type!="function");t||r.__e==null||Tm(r.__e),r.__e=r.__d=void 0}o(Dm,"N");function Bw(r,e,t){return this.constructor(r,t)}o(Bw,"O");function Nm(r,e,t){var i,s,n;re.__&&re.__(r,e),s=(i=typeof t=="function")?null:t&&t.__k||e.__k,n=[],vc(e,r=(!i&&t||e).__k=c(Qe,null,[r]),s||Ml,Ml,e.ownerSVGElement!==void 0,!i&&t?[t]:s?null:e.firstChild?En.call(e.childNodes):null,n,!i&&t?t:s?s.__e:e.firstChild,i),Um(n,r)}o(Nm,"P");function Cn(r,e,t){var i,s,n,a=ti({},r.props);for(n in e)n=="key"?i=e[n]:n=="ref"?s=e[n]:a[n]=e[n];return arguments.length>2&&(a.children=arguments.length>3?En.call(arguments,2):t),Fn(r.type,a,i||r.key,s||r.ref,null)}o(Cn,"q");En=Cm.slice,re={__e:o(function(r,e,t,i){for(var s,n,a;e=e.__;)if((s=e.__c)&&!s.__)try{if((n=s.constructor)&&n.getDerivedStateFromError!=null&&(s.setState(n.getDerivedStateFromError(r)),a=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(r,i||{}),a=s.__d),a)return s.__E=s}catch(l){r=l}throw r},"__e")},Em=0,Iw=o(function(r){return r!=null&&r.constructor===void 0},"i"),we.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=ti({},this.state),typeof r=="function"&&(r=r(ti({},t),this.props)),r&&ti(t,r),r!=null&&this.__v&&(e&&this.__h.push(e),_m(this))},we.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),_m(this))},we.prototype.render=Qe,xn=[],Ll.__r=0,Dw=0;var $l,Ut,bc,Mm,Tn=0,qm=[],jl=[],Lm=re.__b,Bm=re.__r,zm=re.diffed,jm=re.__c,Hm=re.unmount;function Sc(r,e){re.__h&&re.__h(Ut,r,Tn||e),Tn=0;var t=Ut.__H||(Ut.__H={__:[],__h:[]});return r>=t.__.length&&t.__.push({__V:jl}),t.__[r]}o(Sc,"p");function Wt(r){return Tn=1,Vm(Gm,r)}o(Wt,"y");function Vm(r,e,t){var i=Sc($l++,2);return i.t=r,i.__c||(i.__=[t?t(e):Gm(void 0,e),function(s){var n=i.t(i.__[0],s);i.__[0]!==n&&(i.__=[n,i.__[1]],i.__c.setState({}))}],i.__c=Ut),i.__}o(Vm,"d");function pt(r,e){var t=Sc($l++,3);!re.__s&&Wm(t.__H,e)&&(t.__=r,t.u=e,Ut.__H.__h.push(t))}o(pt,"_");function Gt(r){return Tn=5,Gi(function(){return{current:r}},[])}o(Gt,"s");function Gi(r,e){var t=Sc($l++,7);return Wm(t.__H,e)?(t.__V=r(),t.u=e,t.__h=r,t.__V):t.__}o(Gi,"F");function gr(r,e){return Tn=8,Gi(function(){return r},e)}o(gr,"T");function zw(){for(var r;r=qm.shift();)if(r.__P)try{r.__H.__h.forEach(Hl),r.__H.__h.forEach(wc),r.__H.__h=[]}catch(e){r.__H.__h=[],re.__e(e,r.__v)}}o(zw,"b");re.__b=function(r){Ut=null,Lm&&Lm(r)},re.__r=function(r){Bm&&Bm(r),$l=0;var e=(Ut=r.__c).__H;e&&(bc===Ut?(e.__h=[],Ut.__h=[],e.__.forEach(function(t){t.__V=jl,t.u=void 0})):(e.__h.forEach(Hl),e.__h.forEach(wc),e.__h=[])),bc=Ut},re.diffed=function(r){zm&&zm(r);var e=r.__c;e&&e.__H&&(e.__H.__h.length&&(qm.push(e)!==1&&Mm===re.requestAnimationFrame||((Mm=re.requestAnimationFrame)||function(t){var i,s=o(function(){clearTimeout(n),$m&&cancelAnimationFrame(i),setTimeout(t)},"u"),n=setTimeout(s,100);$m&&(i=requestAnimationFrame(s))})(zw)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.__V!==jl&&(t.__=t.__V),t.u=void 0,t.__V=jl})),bc=Ut=null},re.__c=function(r,e){e.some(function(t){try{t.__h.forEach(Hl),t.__h=t.__h.filter(function(i){return!i.__||wc(i)})}catch(i){e.some(function(s){s.__h&&(s.__h=[])}),e=[],re.__e(i,t.__v)}}),jm&&jm(r,e)},re.unmount=function(r){Hm&&Hm(r);var e,t=r.__c;t&&t.__H&&(t.__H.__.forEach(function(i){try{Hl(i)}catch(s){e=s}}),e&&re.__e(e,t.__v))};var $m=typeof requestAnimationFrame=="function";function Hl(r){var e=Ut,t=r.__c;typeof t=="function"&&(r.__c=void 0,t()),Ut=e}o(Hl,"j");function wc(r){var e=Ut;r.__c=r.__(),Ut=e}o(wc,"k");function Wm(r,e){return!r||r.length!==e.length||e.some(function(t,i){return t!==r[i]})}o(Wm,"w");function Gm(r,e){return typeof e=="function"?e(r):e}o(Gm,"z");function Hw(r,e){for(var t in e)r[t]=e[t];return r}o(Hw,"S");function Km(r,e){for(var t in r)if(t!=="__source"&&!(t in e))return!0;for(var i in e)if(i!=="__source"&&r[i]!==e[i])return!0;return!1}o(Km,"C");function Xm(r){this.props=r}o(Xm,"E");(Xm.prototype=new we).isPureReactComponent=!0,Xm.prototype.shouldComponentUpdate=function(r,e){return Km(this.props,r)||Km(this.state,e)};var Ym=re.__b;re.__b=function(r){r.type&&r.type.__f&&r.ref&&(r.props.ref=r.ref,r.ref=null),Ym&&Ym(r)};var tC=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var $w=re.__e;re.__e=function(r,e,t,i){if(r.then){for(var s,n=e;n=n.__;)if((s=n.__c)&&s.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),s.__c(r,e)}$w(r,e,t,i)};var Jm=re.unmount;function _c(){this.__u=0,this.t=null,this.__b=null}o(_c,"T");function ig(r){var e=r.__.__c;return e&&e.__a&&e.__a(r)}o(ig,"L");function ql(){this.u=null,this.o=null}o(ql,"D");re.unmount=function(r){var e=r.__c;e&&e.__R&&e.__R(),e&&r.__h===!0&&(r.type=null),Jm&&Jm(r)},(_c.prototype=new we).__c=function(r,e){var t=e.__c,i=this;i.t==null&&(i.t=[]),i.t.push(t);var s=ig(i.__v),n=!1,a=o(function(){n||(n=!0,t.__R=null,s?s(l):l())},"i");t.__R=a;var l=o(function(){if(!--i.__u){if(i.state.__a){var d=i.state.__a;i.__v.__k[0]=o(function f(y,v,_){return y&&(y.__v=null,y.__k=y.__k&&y.__k.map(function(R){return f(R,v,_)}),y.__c&&y.__c.__P===v&&(y.__e&&_.insertBefore(y.__e,y.__d),y.__c.__e=!0,y.__c.__P=_)),y},"n")(d,d.__c.__P,d.__c.__O)}var p;for(i.setState({__a:i.__b=null});p=i.t.pop();)p.forceUpdate()}},"l"),u=e.__h===!0;i.__u++||u||i.setState({__a:i.__b=i.__v.__k[0]}),r.then(a,a)},_c.prototype.componentWillUnmount=function(){this.t=[]},_c.prototype.render=function(r,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=o(function n(a,l,u){return a&&(a.__c&&a.__c.__H&&(a.__c.__H.__.forEach(function(d){typeof d.__c=="function"&&d.__c()}),a.__c.__H=null),(a=Hw({},a)).__c!=null&&(a.__c.__P===u&&(a.__c.__P=l),a.__c=null),a.__k=a.__k&&a.__k.map(function(d){return n(d,l,u)})),a},"n")(this.__b,t,i.__O=i.__P)}this.__b=null}var s=e.__a&&c(Qe,null,r.fallback);return s&&(s.__h=null),[c(Qe,null,e.__a?null:r.children),s]};var Qm=o(function(r,e,t){if(++t[1]===t[0]&&r.o.delete(e),r.props.revealOrder&&(r.props.revealOrder[0]!=="t"||!r.o.size))for(t=r.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;r.u=t=t[2]}},"F");(ql.prototype=new we).__a=function(r){var e=this,t=ig(e.__v),i=e.o.get(r);return i[0]++,function(s){var n=o(function(){e.props.revealOrder?(i.push(s),Qm(e,r,i)):s()},"o");t?t(n):n()}},ql.prototype.render=function(r){this.u=null,this.o=new Map;var e=Vt(r.children);r.revealOrder&&r.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.o.set(e[t],this.u=[1,0,this.u]);return r.children},ql.prototype.componentDidUpdate=ql.prototype.componentDidMount=function(){var r=this;this.o.forEach(function(e,t){Qm(r,t,e)})};var qw=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Vw=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|shape|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ww=typeof document<"u",Gw=o(function(r){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(r)},"j");function Pc(r,e,t){return e.__k==null&&(e.textContent=""),Nm(r,e),typeof t=="function"&&t(),r?r.__c:null}o(Pc,"z");we.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(r){Object.defineProperty(we.prototype,r,{configurable:!0,get:o(function(){return this["UNSAFE_"+r]},"get"),set:o(function(e){Object.defineProperty(this,r,{configurable:!0,writable:!0,value:e})},"set")})});var Zm=re.event;function Kw(){}o(Kw,"Z");function Xw(){return this.cancelBubble}o(Xw,"Y");function Yw(){return this.defaultPrevented}o(Yw,"q");re.event=function(r){return Zm&&(r=Zm(r)),r.persist=Kw,r.isPropagationStopped=Xw,r.isDefaultPrevented=Yw,r.nativeEvent=r};var Jw,eg={configurable:!0,get:o(function(){return this.class},"get")},tg=re.vnode;re.vnode=function(r){var e=r.type,t=r.props,i=t;if(typeof e=="string"){var s=e.indexOf("-")===-1;for(var n in i={},t){var a=t[n];Ww&&n==="children"&&e==="noscript"||n==="value"&&"defaultValue"in t&&a==null||(n==="defaultValue"&&"value"in t&&t.value==null?n="value":n==="download"&&a===!0?a="":/ondoubleclick/i.test(n)?n="ondblclick":/^onchange(textarea|input)/i.test(n+e)&&!Gw(t.type)?n="oninput":/^onfocus$/i.test(n)?n="onfocusin":/^onblur$/i.test(n)?n="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(n)?n=n.toLowerCase():s&&Vw.test(n)?n=n.replace(/[A-Z0-9]/,"-$&").toLowerCase():a===null&&(a=void 0),/^oninput$/i.test(n)&&(n=n.toLowerCase(),i[n]&&(n="oninputCapture")),i[n]=a)}e=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Vt(t.children).forEach(function(l){l.props.selected=i.value.indexOf(l.props.value)!=-1})),e=="select"&&i.defaultValue!=null&&(i.value=Vt(t.children).forEach(function(l){l.props.selected=i.multiple?i.defaultValue.indexOf(l.props.value)!=-1:i.defaultValue==l.props.value})),r.props=i,t.class!=t.className&&(eg.enumerable="className"in t,t.className!=null&&(i.class=t.className),Object.defineProperty(i,"className",eg))}r.$$typeof=qw,tg&&tg(r)};var rg=re.__r;re.__r=function(r){rg&&rg(r),Jw=r.__c};function On(r){return typeof r!="object"||r===null||!("nodeType"in r)?!1:r.nodeType===Node.ELEMENT_NODE}o(On,"isDOMElement");function Qw(r,e){return e===void 0&&(e=document),typeof r=="string"?e.querySelector(r):On(r)?r:null}o(Qw,"findDOMElement");var Vl=Qw;function Zw(r){for(var e;r&&!r.dir;)r=r.parentNode;return(e=r)==null?void 0:e.dir}o(Zw,"getTextDirection");var Wl=Zw;var Oe=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 ns([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 sg(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(sg,"_classPrivateFieldLooseBase");var eS=0;function tS(r){return"__private_"+eS+++"_"+r}o(tS,"_classPrivateFieldLooseKey");function rS(r){let e=null,t;return function(){for(var i=arguments.length,s=new Array(i),n=0;n<i;n++)s[n]=arguments[n];return t=s,e||(e=Promise.resolve().then(()=>(e=null,r(...t)))),e}}o(rS,"debounce");var kn=tS("updateUI"),xc=class r extends Oe{static{o(this,"UIPlugin")}constructor(){super(...arguments),Object.defineProperty(this,kn,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof r||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:r}}));else if(typeof e=="function"){let i=e;this.uppy.iteratePlugins(s=>{s instanceof i&&(t=s)})}return t}mount(e,t){let i=t.id,s=Vl(e);if(s){this.isTargetDOMEl=!0;let l=document.createElement("div");return l.classList.add("uppy-Root"),sg(this,kn)[kn]=rS(u=>{this.uppy.getPlugin(this.id)&&(Pc(this.render(u,l),l),this.afterUpdate())}),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),Pc(this.render(this.uppy.getState(),l),l),this.el=l,s.appendChild(l),l.dir=this.opts.direction||Wl(l)||"ltr",this.onMount(),this.el}let n=this.getTargetPlugin(e);if(n)return this.uppy.log(`Installing ${i} to ${n.id}`),this.parent=n,this.el=n.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let a=`Invalid target option given to ${i}.`;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,t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,i;(t=(i=sg(this,kn))[kn])==null||t.call(i,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},se=xc;var Nc={};El(Nc,{Provider:()=>ot,RequestClient:()=>ht,SearchProvider:()=>hs,getAllowedHosts:()=>st,tokenStorage:()=>Be});var Fc=class extends Error{static{o(this,"UserFacingApiError")}constructor(){super(...arguments),this.name="UserFacingApiError"}},og=Fc;var pg=be(cg(),1);var sS=Object.prototype.toString,oS=o(r=>sS.call(r)==="[object Error]","isError"),nS=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function Ec(r){return r&&oS(r)&&r.name==="TypeError"&&typeof r.message=="string"?r.message==="Load failed"?r.stack===void 0:nS.has(r.message):!1}o(Ec,"isNetworkError");var wo=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}},dg=o((r,e,t)=>{let i=t.retries-(e-1);return r.attemptNumber=e,r.retriesLeft=i,r},"decorateErrorWithCounts");async function Gl(r,e){return new Promise((t,i)=>{e={onFailedAttempt(){},retries:10,shouldRetry:o(()=>!0,"shouldRetry"),...e};let s=pg.default.operation(e),n=o(()=>{s.stop(),i(e.signal?.reason)},"abortHandler");e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",n,{once:!0});let a=o(()=>{e.signal?.removeEventListener("abort",n),s.stop()},"cleanUp");s.attempt(async l=>{try{let u=await r(l);a(),t(u)}catch(u){try{if(!(u instanceof Error))throw new TypeError(`Non-error was thrown: "${u}". You should only throw errors.`);if(u instanceof wo)throw u.originalError;if(u instanceof TypeError&&!Ec(u))throw u;if(dg(u,l,e),await e.shouldRetry(u)||(s.stop(),i(u)),await e.onFailedAttempt(u),!s.retry(u))throw s.mainError()}catch(d){dg(d,l,e),a(),i(d)}}})})}o(Gl,"pRetry");var Cc=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}},Er=Cc;function ps(){return fetch(...arguments).catch(r=>{throw r.name==="AbortError"?r:new Er(r)})}o(ps,"fetchWithNetworkError");function er(r,e){return Object.prototype.hasOwnProperty.call(r,e)}o(er,"has");var Tc=class extends Error{static{o(this,"ErrorWithCause")}constructor(e,t){super(e),this.cause=t?.cause,this.cause&&er(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}},So=Tc;function Oc(r){var e;let i=(e=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?([^\n]+)/i.exec(r))==null?void 0:e[1];return`${/^http:\/\//i.test(r)?"ws":"wss"}://${i}`}o(Oc,"getSocketHost");var kc=class extends Error{static{o(this,"AuthError")}constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}},hg=kc;function ri(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(ri,"_classPrivateFieldLooseBase");var aS=0;function Kl(r){return"__private_"+aS+++"_"+r}o(Kl,"_classPrivateFieldLooseKey");var lS={version:"4.4.2"};function uS(r){return r.replace(/\/$/,"")}o(uS,"stripSlash");var fg=10,cS=5*60*1e3,Uc=401,Rc=class extends Error{static{o(this,"HttpError")}constructor(e){let{statusCode:t,message:i}=e;super(i),this.name="HttpError",this.statusCode=t}};async function dS(r){if(r.status===Uc)throw new hg;if(r.ok)return r.json();let e=`Failed request with status: ${r.status}. ${r.statusText}`,t;try{t=await r.json(),t.message&&(e=`${e} message: ${t.message}`),t.requestId&&(e=`${e} request-Id: ${t.requestId}`)}catch(i){throw new Error(e,{cause:i})}throw r.status>=400&&r.status<=499&&t.message?new og(t.message):new Rc({statusCode:r.status,message:e})}o(dS,"handleJSONResponse");function pS(r,e,t){let{progress:i,bytesUploaded:s,bytesTotal:n}=e;if(i){var a;r.uppy.log(`Upload progress: ${i}`),r.uppy.emit("upload-progress",t,{uploadStarted:(a=t.progress.uploadStarted)!=null?a:0,bytesUploaded:s,bytesTotal:n})}}o(pS,"emitSocketProgress");var ii=Kl("companionHeaders"),An=Kl("getUrl"),Ac=Kl("requestSocketToken"),Rn=Kl("awaitRemoteFileUpload"),ht=class{static{o(this,"RequestClient")}constructor(e,t){Object.defineProperty(this,Rn,{value:fS}),Object.defineProperty(this,An,{value:hS}),Object.defineProperty(this,ii,{writable:!0,value:void 0}),Object.defineProperty(this,Ac,{writable:!0,value:o(async i=>{var s;let{file:n,postBody:a,signal:l}=i;if(((s=n.remote)==null?void 0:s.url)==null)throw new Error("Cannot connect to an undefined URL");return(await this.post(n.remote.url,{...n.remote.body,...a},{signal:l})).token},"value")}),this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),ri(this,ii)[ii]=t.companionHeaders}setCompanionHeaders(e){ri(this,ii)[ii]=e}[Symbol.for("uppy test: getCompanionHeaders")](){return ri(this,ii)[ii]}get hostname(){let{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return uS(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"}},...ri(this,ii)[ii]}}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:i="GET",data:s,skipPostResponse:n,signal:a}=e;try{let l=await this.headers(!s),u=await ps(ri(this,An)[An](t),{method:i,signal:a,headers:l,credentials:this.opts.companionCookiesRule||"same-origin",body:s?JSON.stringify(s):null});return n||this.onReceiveResponse(u),await dS(u)}catch(l){throw l.isAuthError||l.name==="UserFacingApiError"||l.name==="AbortError"?l:new So(`Could not ${i} ${ri(this,An)[An](t)}`,{cause:l})}}async get(e,t){return this.request({...t,path:e})}async post(e,t,i){return this.request({...i,path:e,method:"POST",data:t})}async delete(e,t,i){return this.request({...i,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,i){var s=this;try{let{signal:n,getQueue:a}=i||{};return await Gl(async()=>{var l;let u=(l=this.uppy.getFile(e.id))==null?void 0:l.serverToken;if(u!=null)return this.uppy.log(`Connecting to exiting websocket ${u}`),ri(this,Rn)[Rn]({file:e,queue:a(),signal:n});let p=await a().wrapPromiseFunction(async function(){try{return await ri(s,Ac)[Ac](...arguments)}catch(f){if(f.isAuthError)throw new wo(f);if(f.cause==null)throw f;let y=f.cause,v=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"&&!v()?new wo(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:p}),ri(this,Rn)[Rn]({file:this.uppy.getFile(e.id),queue:a(),signal:n})},{retries:fg,signal:n,onFailedAttempt:o(l=>this.uppy.log(`Retrying upload due to: ${l.message}`,"warning"),"onFailedAttempt")})}catch(n){if(n.name==="AbortError")return;throw this.uppy.emit("upload-error",e,n),n}}};function hS(r){return/^(https?:|)\/\//.test(r)?r:`${this.hostname}/${r}`}o(hS,"_getUrl2");async function fS(r){let{file:e,queue:t,signal:i}=r,s,{capabilities:n}=this.uppy.getState();try{return await new Promise((a,l)=>{let u=e.serverToken,d=Oc(e.remote.companionUrl),p,f,y,{isPaused:v}=e,_=o((W,te)=>{if(p==null||p.readyState!==p.OPEN){var ae;this.uppy.log(`Cannot send "${W}" to socket ${e.id} because the socket state was ${String((ae=p)==null?void 0:ae.readyState)}`,"warning");return}p.send(JSON.stringify({action:W,payload:te??{}}))},"socketSend");function R(){n.resumableUploads&&_(v?"pause":"resume")}o(R,"sendState");let E=o(async()=>{f&&f.abort(),f=new AbortController;let W=o(ae=>{var ke;this.uppy.setFileState(e.id,{serverToken:null}),(ke=f)==null||ke.abort==null||ke.abort(),l(ae)},"onFatalError");function te(){clearTimeout(y),!v&&(y=setTimeout(()=>W(new Error("Timeout waiting for message from Companion socket")),cS))}o(te,"resetActivityTimeout");try{await t.wrapPromiseFunction(async()=>{await Gl(o(async()=>new Promise((ke,Ae)=>{p=new WebSocket(`${d}/api/${u}`),te(),p.addEventListener("close",()=>{p=void 0,Ae(new Error("Socket closed unexpectedly"))}),p.addEventListener("error",Fe=>{var Re;this.uppy.log(`Companion socket error ${JSON.stringify(Fe)}, closing socket`,"warning"),(Re=p)==null||Re.close()}),p.addEventListener("open",()=>{R()}),p.addEventListener("message",Fe=>{te();try{let{action:P,payload:M}=JSON.parse(Fe.data);switch(P){case"progress":{pS(this,M,this.uppy.getFile(e.id));break}case"success":{var Re,Xe,C,S;let H=(Re=M.response)==null?void 0:Re.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:M.url,status:(Xe=(C=M.response)==null?void 0:C.status)!=null?Xe:200,body:H?JSON.parse(H):void 0}),(S=f)==null||S.abort==null||S.abort(),a();break}case"error":{let{message:H}=M.error;throw Object.assign(new Error(H),{cause:M.error})}default:this.uppy.log(`Companion socket unknown action ${P}`,"warning")}}catch(P){W(P)}});let qe=o(()=>{this.uppy.log(`Closing socket ${e.id}`),clearTimeout(y),p&&p.close(),p=void 0},"closeSocket");f.signal.addEventListener("abort",()=>{qe()})}),"reconnectWebsocket"),{retries:fg,signal:f.signal,onFailedAttempt:o(()=>{f.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`)},"onFailedAttempt")})})().abortOn(f.signal)}catch(ae){if(f.signal.aborted)return;W(ae)}},"createWebsocket"),O=o(W=>{n.resumableUploads&&(v=W,p&&R())},"pause"),L=o(W=>{var te;n.individualCancellation&&W.id===e.id&&(_("cancel"),(te=f)==null||te.abort==null||te.abort(),this.uppy.log(`upload ${e.id} was removed`),a())},"onFileRemove"),B=o(()=>{var W;_("cancel"),(W=f)==null||W.abort==null||W.abort(),this.uppy.log(`upload ${e.id} was canceled`),a()},"onCancelAll"),G=o((W,te)=>{W?.id===e.id&&O(te)},"onFilePausedChange"),J=o(()=>O(!0),"onPauseAll"),$=o(()=>O(!1),"onResumeAll");this.uppy.on("file-removed",L),this.uppy.on("cancel-all",B),this.uppy.on("upload-pause",G),this.uppy.on("pause-all",J),this.uppy.on("resume-all",$),s=o(()=>{this.uppy.off("file-removed",L),this.uppy.off("cancel-all",B),this.uppy.off("upload-pause",G),this.uppy.off("pause-all",J),this.uppy.off("resume-all",$)},"removeEventHandlers"),i.addEventListener("abort",()=>{var W;(W=f)==null||W.abort()}),E()})}finally{s?.()}}o(fS,"_awaitRemoteFileUpload2");ht.VERSION=lS.version;function mS(r){return r.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&")}o(mS,"escapeRegex");function Ic(r){if(typeof r=="string")return new RegExp(`^${r}$`);if(r instanceof RegExp)return r}o(Ic,"wrapInRegex");function st(r,e){if(r){let i=o(s=>{if(!(typeof s=="string"&&Ic(s))&&!(s instanceof RegExp))throw new TypeError('The option "companionAllowedHosts" must be one of string, Array, RegExp')},"validate");return Array.isArray(r)?r.every(i):i(r),r}let t=e;return/^(?!https?:\/\/).*$/i.test(t)&&(t=`https://${e.replace(/^\/\//,"")}`),t=new URL(t).origin,t=mS(t),t}o(st,"getAllowedHosts");function mg(r,e){return(Array.isArray(e)?e.map(Ic):[Ic(e)]).some(i=>i?.test(r)||i?.test(`${r}/`))}o(mg,"isOriginAllowed");function vr(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(vr,"_classPrivateFieldLooseBase");var gS=0;function Dc(r){return"__private_"+gS+++"_"+r}o(Dc,"_classPrivateFieldLooseKey");var yS=o(r=>r.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),"getName");function vS(){return location.origin}o(vS,"getOrigin");var Cr=Dc("refreshingTokenPromise"),Un=Dc("getAuthToken"),Tr=Dc("getPlugin"),ot=class extends ht{static{o(this,"Provider")}constructor(e,t){super(e,t),Object.defineProperty(this,Tr,{value:wS}),Object.defineProperty(this,Un,{value:bS}),Object.defineProperty(this,Cr,{writable:!0,value:void 0}),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||yS(this.id),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null,this.supportsRefreshToken=!!t.supportsRefreshToken}async headers(){let[e,t]=await Promise.all([super.headers(),vr(this,Un)[Un]()]),i={};return t&&(i["uppy-auth-token"]=t),this.companionKeysParams&&(i["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...e,...i}}onReceiveResponse(e){super.onReceiveResponse(e);let t=vr(this,Tr)[Tr](),s=t.getPluginState().authenticated?e.status!==Uc:e.status<400;return t.setPluginState({authenticated:s}),e}async setAuthToken(e){return vr(this,Tr)[Tr]().storage.setItem(this.tokenKey,e)}async removeAuthToken(){return vr(this,Tr)[Tr]().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:i}=e,s=new URLSearchParams({...i,state:btoa(JSON.stringify({origin:vS()})),...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:i,signal:s}=e,n=await this.post(`${this.id}/simple-auth`,{form:i},{qs:{uppyVersions:t},signal:s});this.setAuthToken(n.uppyAuthToken)}async loginOAuth(e){let{uppyVersions:t,authFormData:i,signal:s}=e;await this.ensurePreAuth(),s.throwIfAborted();let n=this.authUrl({query:{uppyVersions:t},authFormData:i}),a=window.open(n,"_blank"),l,u;try{return await new Promise((d,p)=>{u=o(f=>{if(f.source!==a){let _="";try{_=JSON.stringify(f.data)}catch{}this.uppy.log(`ignoring event from unknown source ${_}`,"warning");return}let{companionAllowedHosts:y}=vr(this,Tr)[Tr]().opts;if(!mg(f.origin,y)){this.uppy.log(`ignoring event from ${f.origin} vs allowed pattern ${y}`,"warning");return}let v=typeof f.data=="string"?JSON.parse(f.data):f.data;if(v.error){let{uppy:_}=this,R=_.i18n("authAborted");_.info({message:R},"warning",5e3),p(new Error("auth aborted"));return}if(!v.token){p(new Error("did not receive token from auth window"));return}d(this.setAuthToken(v.token))},"handleMessage"),a&&(l=window.setInterval(()=>{a.closed&&p(new Error("Auth window was closed by the user"))},500)),s.addEventListener("abort",()=>p(new Error("Aborted"))),window.addEventListener("message",u)})}finally{a?.close(),window.clearInterval(l),u&&window.removeEventListener("message",u)}}async login(e){let{uppyVersions:t,authFormData:i,signal:s}=e;return this.loginOAuth({uppyVersions:t,authFormData:i,signal:s})}refreshTokenUrl(){return`${this.hostname}/${this.id}/refresh-token`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async request(){await vr(this,Cr)[Cr];try{return await super.request(...arguments)}catch(e){if(!this.supportsRefreshToken)throw e;let t=await vr(this,Un)[Un]();if(!e.isAuthError||!t)throw e;return vr(this,Cr)[Cr]==null&&(vr(this,Cr)[Cr]=(async()=>{try{this.uppy.log("[CompanionClient] Refreshing expired auth token");let i=await super.request({path:this.refreshTokenUrl(),method:"POST"});await this.setAuthToken(i.uppyAuthToken)}catch(i){throw i.isAuthError&&await this.removeAuthToken(),e}finally{vr(this,Cr)[Cr]=void 0}})()),await vr(this,Cr)[Cr],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 bS(){return vr(this,Tr)[Tr]().storage.getItem(this.tokenKey)}o(bS,"_getAuthToken2");function wS(){let r=this.uppy.getPlugin(this.pluginId);if(r==null)throw new Error("Plugin was nullish");return r}o(wS,"_getPlugin2");var SS=o(r=>r.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),"getName"),hs=class extends ht{static{o(this,"SearchProvider")}constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||SS(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}`:""}`)}};var Be={};El(Be,{getItem:()=>PS,removeItem:()=>xS,setItem:()=>_S});async function _S(r,e){localStorage.setItem(r,e)}o(_S,"setItem");async function PS(r){return localStorage.getItem(r)}o(PS,"getItem");async function xS(r){localStorage.removeItem(r)}o(xS,"removeItem");var ed={};El(ed,{GooglePickerView:()=>ys,ProviderViews:()=>Ge,SearchInput:()=>ms,SearchProviderViews:()=>oi,defaultPickerIcon:()=>Po});var Ug=be(It(),1);function In(r){return{...r,type:r.mimeType,extension:r.name?Br(r.name).extension:null}}o(In,"remoteFileObjToLocal");function FS(){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(FS,"GoogleIcon");function ES(r){let{pluginName:e,i18n:t,onAuth:i}=r,s=e==="Google Drive",n=gr(a=>{a.preventDefault(),i()},[i]);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(FS,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(ES,"DefaultForm");var CS=o(r=>{let{pluginName:e,i18n:t,onAuth:i}=r;return c(ES,{pluginName:e,i18n:t,onAuth:i})},"defaultRenderForm");function Dn(r){let{loading:e,pluginName:t,pluginIcon:i,i18n:s,handleAuth:n,renderForm:a=CS}=r;return c("div",{className:"uppy-Provider-auth"},c("div",{className:"uppy-Provider-authIcon"},i()),c("div",{className:"uppy-Provider-authTitle"},s("authenticateWithTitle",{pluginName:t})),a({pluginName:t,i18n:s,loading:e,onAuth:n}))}o(Dn,"AuthView");var gg=be(It(),1);function Mc(r){let{i18n:e,logout:t,username:i}=r;return c(Qe,null,i&&c("span",{className:"uppy-ProviderBrowser-user",key:"username"},i),c("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}o(Mc,"User");function Lc(r){let{openFolder:e,title:t,breadcrumbsIcon:i,breadcrumbs:s,i18n:n}=r;return c("div",{className:"uppy-Provider-breadcrumbs"},c("div",{className:"uppy-Provider-breadcrumbsIcon"},i),s.map((a,l)=>{var u;return c(Qe,null,c("button",{key:a.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:o(()=>e(a.id),"onClick")},a.type==="root"?t:(u=a.data.name)!=null?u:n("unnamed")),s.length===l+1?"":" / ")}))}o(Lc,"Breadcrumbs");function Bc(r){return c("div",{className:"uppy-ProviderBrowser-header"},c("div",{className:(0,gg.default)("uppy-ProviderBrowser-headerBar",!r.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},r.showBreadcrumbs&&c(Lc,{openFolder:r.openFolder,breadcrumbs:r.breadcrumbs,breadcrumbsIcon:r.pluginIcon&&r.pluginIcon(),title:r.title,i18n:r.i18n}),c(Mc,{logout:r.logout,username:r.username,i18n:r.i18n})))}o(Bc,"Header");function zc(){return zc=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},zc.apply(null,arguments)}o(zc,"_extends");var TS={position:"relative",width:"100%",minHeight:"100%"},OS={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},jc=class extends we{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:i,renderRow:s,overscanCount:n=10,...a}=e,{offset:l,height:u}=this.state,d=Math.floor(l/i),p=Math.floor(u/i);n&&(d=Math.max(0,d-d%n),p+=n);let f=d+p+4,y=t.slice(d,f),v={...TS,height:t.length*i},_={...OS,top:d*i};return c("div",zc({onScroll:this.handleScroll},a),c("div",{role:"presentation",style:v},c("div",{role:"presentation",style:_},y.map(s))))}},Yl=jc;var yg=be(It(),1);function kS(){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(kS,"FileIcon");function AS(){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(AS,"FolderIcon");function RS(){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(RS,"VideoIcon");function _o(r){let{itemIconString:e,alt:t=void 0}=r;if(e===null)return null;switch(e){case"file":return c(kS,null);case"folder":return c(AS,null);case"video":return c(RS,null);default:return c("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}o(_o,"ItemIcon");function US(r){var e,t;let{file:i,toggleCheckbox:s,className:n,isDisabled:a,restrictionError:l,showTitles:u,children:d=null,i18n:p}=r;return c("li",{className:n,title:a&&l?l:void 0},c("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:s,name:"listitem",id:i.id,checked:i.status==="checked",disabled:a,"data-uppy-super-focusable":!0}),c("label",{htmlFor:i.id,"aria-label":(e=i.data.name)!=null?e:p("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},c(_o,{itemIconString:i.data.thumbnail||i.data.icon}),u&&((t=i.data.name)!=null?t:p("unnamed")),d))}o(US,"GridItem");var Hc=US;function $c(r){var e,t,i;let{file:s,openFolder:n,className:a,isDisabled:l,restrictionError:u,toggleCheckbox:d,showTitles:p,i18n:f}=r;return c("li",{className:a,title:s.status!=="checked"&&u?u:void 0},c("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:d,name:"listitem",id:s.id,checked:s.status==="checked","aria-label":s.data.isFolder?f("allFilesFromFolderNamed",{name:(e=s.data.name)!=null?e:f("unnamed")}):null,disabled:l,"data-uppy-super-focusable":!0}),s.data.isFolder?c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:o(()=>n(s.id),"onClick"),"aria-label":f("openFolderNamed",{name:(t=s.data.name)!=null?t:f("unnamed")})},c("div",{className:"uppy-ProviderBrowserItem-iconWrap"},c(_o,{itemIconString:s.data.icon})),p&&s.data.name?c("span",null,s.data.name):f("unnamed")):c("label",{htmlFor:s.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},c("div",{className:"uppy-ProviderBrowserItem-iconWrap"},c(_o,{itemIconString:s.data.icon})),p&&((i=s.data.name)!=null?i:f("unnamed"))))}o($c,"ListItem");function qc(r){let{viewType:e,toggleCheckbox:t,showTitles:i,i18n:s,openFolder:n,file:a,utmSource:l}=r,u=a.type==="folder"?null:a.restrictionError,d=!!u&&a.status!=="checked",p={file:a,openFolder:n,toggleCheckbox:t,utmSource:l,i18n:s,viewType:e,showTitles:i,className:(0,yg.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":d},{"uppy-ProviderBrowserItem--noPreview":a.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":a.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":a.status==="partial"}),isDisabled:d,restrictionError:u};switch(e){case"grid":return c(Hc,p);case"list":return c($c,p);case"unsplash":return c(Hc,p,c("a",{href:`${a.data.author.url}?utm_source=${l}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},a.data.author.name));default:throw new Error(`There is no such type ${e}`)}}o(qc,"Item");function IS(r){let{displayedPartialTree:e,viewType:t,toggleCheckbox:i,handleScroll:s,showTitles:n,i18n:a,isLoading:l,openFolder:u,noResultsLabel:d,virtualList:p,utmSource:f}=r,[y,v]=Wt(!1);if(pt(()=>{let R=o(O=>{O.key==="Shift"&&v(!1)},"handleKeyUp"),E=o(O=>{O.key==="Shift"&&v(!0)},"handleKeyDown");return document.addEventListener("keyup",R),document.addEventListener("keydown",E),()=>{document.removeEventListener("keyup",R),document.removeEventListener("keydown",E)}},[]),l)return c("div",{className:"uppy-Provider-loading"},typeof l=="string"?l:a("loading"));if(e.length===0)return c("div",{className:"uppy-Provider-empty"},d);let _=o(R=>c(qc,{viewType:t,toggleCheckbox:o(E=>{var O;E.stopPropagation(),E.preventDefault(),(O=document.getSelection())==null||O.removeAllRanges(),i(R,y)},"toggleCheckbox"),showTitles:n,i18n:a,openFolder:u,file:R,utmSource:f}),"renderItem");return p?c("div",{className:"uppy-ProviderBrowser-body"},c("ul",{className:"uppy-ProviderBrowser-list"},c(Yl,{data:e,renderRow:_,rowHeight:31}))):c("div",{className:"uppy-ProviderBrowser-body"},c("ul",{className:"uppy-ProviderBrowser-list",onScroll:s,role:"listbox",tabIndex:-1},e.map(_)))}o(IS,"Browser");var Jl=IS;var DS=o((r,e,t,i,s)=>{let n=e.filter(v=>v.isFolder===!0),a=e.filter(v=>v.isFolder===!1),l=t.type==="folder"&&t.status==="checked",u=n.map(v=>({type:"folder",id:v.requestPath,cached:!1,nextPagePath:null,status:l?"checked":"unchecked",parentId:t.id,data:v})),d=a.map(v=>{let _=s(v);return{type:"file",id:v.requestPath,restrictionError:_,status:l&&!_?"checked":"unchecked",parentId:t.id,data:v}}),p={...t,cached:!0,nextPagePath:i};return[...r.map(v=>v.id===p.id?p:v),...u,...d]},"afterOpenFolder"),vg=DS;var NS=o((r,e,t,i,s)=>{let n=r.find(_=>_.id===e),a=t.filter(_=>_.isFolder===!0),l=t.filter(_=>_.isFolder===!1),u={...n,nextPagePath:i},d=r.map(_=>_.id===u.id?u:_),p=u.type==="folder"&&u.status==="checked",f=a.map(_=>({type:"folder",id:_.requestPath,cached:!1,nextPagePath:null,status:p?"checked":"unchecked",parentId:u.id,data:_})),y=l.map(_=>{let R=s(_);return{type:"file",id:_.requestPath,restrictionError:R,status:p&&!R?"checked":"unchecked",parentId:u.id,data:_}});return[...d,...f,...y]},"afterScrollFolder"),bg=NS;var MS=o(r=>r.map(e=>({...e})),"shallowClone"),Ql=MS;var Vc=o((r,e,t)=>{r.filter(s=>s.type!=="root"&&s.parentId===e).forEach(s=>{s.status=t&&!(s.type==="file"&&s.restrictionError)?"checked":"unchecked",Vc(r,s.id,t)})},"percolateDown"),Wc=o((r,e)=>{let t=r.find(a=>a.id===e);if(t.type==="root")return;let i=r.filter(a=>a.type!=="root"&&a.parentId===t.id&&!(a.type==="file"&&a.restrictionError)),s=i.every(a=>a.status==="checked"),n=i.every(a=>a.status==="unchecked");s?t.status="checked":n?t.status="unchecked":t.status="partial",Wc(r,t.parentId)},"percolateUp"),LS=o((r,e)=>{let t=Ql(r);if(e.length>=2){let i=t.filter(s=>s.type!=="root"&&e.includes(s.id));i.forEach(s=>{s.type==="file"?s.status=s.restrictionError?"unchecked":"checked":s.status="checked"}),i.forEach(s=>{Vc(t,s.id,!0)}),Wc(t,i[0].parentId)}else{let i=t.find(s=>s.id===e[0]);i.status=i.status==="checked"?"unchecked":"checked",Vc(t,i.id,i.status==="checked"),Wc(t,i.parentId)}return t},"afterToggleCheckbox"),wg=LS;var Kc=be(_g(),1);var Mn=class extends Error{static{o(this,"TimeoutError")}constructor(e){super(e),this.name="TimeoutError"}},Xc=class extends Error{static{o(this,"AbortError")}constructor(e){super(),this.name="AbortError",this.message=e}},Pg=o(r=>globalThis.DOMException===void 0?new Xc(r):new DOMException(r),"getDOMException"),xg=o(r=>{let e=r.reason===void 0?Pg("This operation was aborted."):r.reason;return e instanceof Error?e:Pg(e)},"getAbortedReason");function Yc(r,e){let{milliseconds:t,fallback:i,message:s,customTimers:n={setTimeout,clearTimeout}}=e,a,u=new Promise((d,p)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:y}=e;y.aborted&&p(xg(y)),y.addEventListener("abort",()=>{p(xg(y))})}if(t===Number.POSITIVE_INFINITY){r.then(d,p);return}let f=new Mn;a=n.setTimeout.call(void 0,()=>{if(i){try{d(i())}catch(y){p(y)}return}typeof r.cancel=="function"&&r.cancel(),s===!1?d():s instanceof Error?p(s):(f.message=s??`Promise timed out after ${t} milliseconds`,p(f))},t),(async()=>{try{d(await r)}catch(y){p(y)}})()}).finally(()=>{u.clear()});return u.clear=()=>{n.clearTimeout.call(void 0,a),a=void 0},u}o(Yc,"pTimeout");function Jc(r,e,t){let i=0,s=r.length;for(;s>0;){let n=Math.trunc(s/2),a=i+n;t(r[a],e)<=0?(i=++a,s-=n+1):s=n}return i}o(Jc,"lowerBound");var Ln=class{static{o(this,"PriorityQueue")}#e=[];enqueue(e,t){t={priority:0,...t};let i={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(i);return}let s=Jc(this.#e,i,(n,a)=>a.priority-n.priority);this.#e.splice(s,0,i)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var Bn=class extends Kc.default{static{o(this,"PQueue")}#e;#n;#o=0;#h;#a;#f=0;#r;#l;#t;#m;#i=0;#u;#s;#g;timeout;constructor(e){if(super(),e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Ln,...e},!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${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 \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#n=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#h=e.intervalCap,this.#a=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#s=e.autoStart===!1}get#b(){return this.#n||this.#o<this.#h}get#w(){return this.#i<this.#u}#S(){this.#i--,this.#c(),this.emit("next")}#_(){this.#v(),this.#y(),this.#l=void 0}get#P(){let e=Date.now();if(this.#r===void 0){let t=this.#f-e;if(t<0)this.#o=this.#e?this.#i:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#_()},t)),!0}return!1}#c(){if(this.#t.size===0)return this.#r&&clearInterval(this.#r),this.#r=void 0,this.emit("empty"),this.#i===0&&this.emit("idle"),!1;if(!this.#s){let e=!this.#P;if(this.#b&&this.#w){let t=this.#t.dequeue();return t?(this.emit("active"),t(),e&&this.#y(),!0):!1}}return!1}#y(){this.#n||this.#r!==void 0||(this.#r=setInterval(()=>{this.#v()},this.#a),this.#f=Date.now()+this.#a)}#v(){this.#o===0&&this.#i===0&&this.#r&&(clearInterval(this.#r),this.#r=void 0),this.#o=this.#e?this.#i:0,this.#d()}#d(){for(;this.#c(););}get concurrency(){return this.#u}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})`);this.#u=e,this.#d()}async#x(e){return new Promise((t,i)=>{e.addEventListener("abort",()=>{i(e.reason)},{once:!0})})}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:this.#g,...t},new Promise((i,s)=>{this.#t.enqueue(async()=>{this.#i++,this.#o++;try{t.signal?.throwIfAborted();let n=e({signal:t.signal});t.timeout&&(n=Yc(Promise.resolve(n),{milliseconds:t.timeout})),t.signal&&(n=Promise.race([n,this.#x(t.signal)]));let a=await n;i(a),this.emit("completed",a)}catch(n){if(n instanceof Mn&&!t.throwOnTimeout){i();return}s(n),this.emit("error",n)}finally{this.#S()}},t),this.emit("add"),this.#c()})}async addAll(e,t){return Promise.all(e.map(async i=>this.add(i,t)))}start(){return this.#s?(this.#s=!1,this.#d(),this):this}pause(){this.#s=!0}clear(){this.#t=new this.#m}async onEmpty(){this.#t.size!==0&&await this.#p("empty")}async onSizeLessThan(e){this.#t.size<e||await this.#p("next",()=>this.#t.size<e)}async onIdle(){this.#i===0&&this.#t.size===0||await this.#p("idle")}async#p(e,t){return new Promise(i=>{let s=o(()=>{t&&!t()||(this.off(e,s),i())},"listener");this.on(e,s)})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#i}get isPaused(){return this.#s}};var Fg=o(async(r,e,t,i,s)=>{let n=[],a=t.cached?t.nextPagePath:t.id;for(;a;){let f=await i(a);n=n.concat(f.items),a=f.nextPagePath}let l=n.filter(f=>f.isFolder===!0),u=n.filter(f=>f.isFolder===!1),d=l.map(f=>({type:"folder",id:f.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:f})),p=u.map(f=>{let y=s(f);return{type:"file",id:f.requestPath,restrictionError:y,status:y?"unchecked":"checked",parentId:t.id,data:f}});t.cached=!0,t.nextPagePath=null,e.push(...p,...d),d.forEach(async f=>{r.add(()=>Fg(r,e,f,i,s))})},"recursivelyFetch"),jS=o(async(r,e,t,i)=>{let s=new Bn({concurrency:6}),n=Ql(r);return n.filter(l=>l.type==="folder"&&l.status==="checked"&&(l.cached===!1||l.nextPagePath)).forEach(l=>{s.add(()=>Fg(s,n,l,e,t))}),s.on("completed",()=>{let l=n.filter(u=>u.type==="file"&&u.status==="checked").length;i(l)}),await s.onIdle(),n},"afterFill"),Eg=jS;var fs={afterOpenFolder:vg,afterScrollFolder:bg,afterToggleCheckbox:wg,afterFill:Eg};var HS=o(r=>{let{scrollHeight:e,scrollTop:t,offsetHeight:i}=r.target;return e-(t+i)<50},"shouldHandleScroll"),eu=HS;var $S=o(r=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){r.log("Aborting request","warning");return}r.log(e,"error"),e.name==="UserFacingApiError"&&r.info({message:r.i18n("companionError"),details:r.i18n(e.message)},"warning",5e3)}},"handleError"),si=$S;var qS=o((r,e,t,i)=>{let s=e.findIndex(n=>n.id===i);if(s!==-1&&t){let n=e.findIndex(l=>l.id===r);return e.slice(Math.min(s,n),Math.max(s,n)+1).map(l=>l.id)}return[r]},"getClickedRange"),tu=qS;function VS(r){let{searchString:e,setSearchString:t,submitSearchString:i,wrapperClassName:s,inputClassName:n,inputLabel:a,clearSearchLabel:l="",showButton:u=!1,buttonLabel:d="",buttonCSSClassName:p=""}=r,f=o(_=>{t(_.target.value)},"onInput"),y=gr(_=>{_.preventDefault(),i()},[i]),[v]=Wt(()=>{let _=document.createElement("form");return _.setAttribute("tabindex","-1"),_.id=mr(),_});return pt(()=>(document.body.appendChild(v),v.addEventListener("submit",y),()=>{v.removeEventListener("submit",y),document.body.removeChild(v)}),[v,y]),c("section",{className:s},c("input",{className:`uppy-u-reset ${n}`,type:"search","aria-label":a,placeholder:a,value:e,onInput:f,form:v.id,"data-uppy-super-focusable":!0}),!u&&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"})),!u&&e&&c("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":l,title:l,onClick:o(()=>t(""),"onClick")},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"}))),u&&c("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${p}`,type:"submit",form:v.id},d))}o(VS,"SearchInput");var ms=VS;var Cg=be(It(),1);var WS=o(r=>r.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!r.some(s=>s.type!=="root"&&s.parentId===t.id):!1).length,"getNumberOfSelectedFiles"),ru=WS;function zn(r){let{cancelSelection:e,donePicking:t,i18n:i,partialTree:s,validateAggregateRestrictions:n}=r,a=Gi(()=>n(s),[s,n]),l=Gi(()=>ru(s),[s]);return l===0?null:c("div",{className:"uppy-ProviderBrowser-footer"},c("div",{className:"uppy-ProviderBrowser-footer-buttons"},c("button",{className:(0,Cg.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":a}),disabled:!!a,onClick:t,type:"button"},i("selectX",{smart_count:l})),c("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},i("cancel"))),a&&c("div",{className:"uppy-ProviderBrowser-footer-error"},a))}o(zn,"FooterActions");var GS=o((r,e,t)=>{var i,s;return{id:r.id,source:e.id,name:r.name||r.id,type:r.mimeType,isRemote:!0,data:r,preview:r.thumbnail||void 0,meta:{authorName:(i=r.author)==null?void 0:i.name,authorUrl:(s=r.author)==null?void 0:s.url,relativePath:r.relDirPath||null,absolutePath:r.absDirPath},body:{fileId:r.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(r.requestPath)}`,body:{fileId:r.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},"getTagFile"),Tg=GS;var KS=o((r,e,t)=>{let i=r.map(a=>Tg(a,e,t)),s=[],n=[];i.forEach(a=>{e.uppy.checkIfFileAlreadyExists(Rl(a,e.uppy.getID()))?n.push(a):s.push(a)}),s.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:s.length})),n.length>0&&e.uppy.info(`Not adding ${n.length} files because they already exist`),e.uppy.addFiles(s)},"addFiles"),iu=KS;var Og=o((r,e,t)=>{let i=e===null?"null":e;if(t[i])return t[i];let s=r.find(a=>a.id===e);if(s.type==="root")return[];let n=[...Og(r,s.parentId,t),s];return t[i]=n,n},"getPath"),XS=o(r=>{let e=Object.create(null);return r.filter(s=>s.type==="file"&&s.status==="checked").map(s=>{let n=Og(r,s.id,e),a=n.findIndex(p=>p.type==="folder"&&p.status==="checked"),l=n.slice(a),u=`/${n.map(p=>p.data.name).join("/")}`,d=l.length===1?void 0:l.map(p=>p.data.name).join("/");return{...s.data,absDirPath:u,relDirPath:d}})},"getCheckedFilesWithPaths"),su=XS;var YS=o((r,e)=>{let t=r.find(s=>s.id===e),i=[];for(;i=[t,...i],t.type!=="root";){let s=t.parentId;t=r.find(n=>n.id===s)}return i},"getBreadcrumbs"),kg=YS;function Ki(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Ki,"_classPrivateFieldLooseBase");var JS=0;function Rg(r){return"__private_"+JS+++"_"+r}o(Rg,"_classPrivateFieldLooseKey");var QS={version:"4.4.5"};function Po(){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(Po,"defaultPickerIcon");var Ag=o(r=>({authenticated:void 0,partialTree:[{type:"root",id:r,cached:!1,nextPagePath:null}],currentFolderId:r,searchString:"",didFirstRender:!1,username:null,loading:!1}),"getDefaultState"),gs=Rg("abortController"),Or=Rg("withAbort"),Ge=class{static{o(this,"ProviderView")}constructor(e,t){Object.defineProperty(this,Or,{value:ZS}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,gs,{writable:!0,value:void 0}),this.validateSingleFile=s=>{let n=In(s);return this.plugin.uppy.validateSingleFile(n)},this.getDisplayedPartialTree=()=>{let{partialTree:s,currentFolderId:n,searchString:a}=this.plugin.getPluginState(),l=s.filter(d=>d.type!=="root"&&d.parentId===n);return a===""?l:l.filter(d=>{var p;return((p=d.data.name)!=null?p:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(a.toLowerCase())!==-1})},this.getBreadcrumbs=()=>{let{partialTree:s,currentFolderId:n}=this.plugin.getPluginState();return kg(s,n)},this.getSelectedAmount=()=>{let{partialTree:s}=this.plugin.getPluginState();return ru(s)},this.validateAggregateRestrictions=s=>{let a=s.filter(l=>l.type==="file"&&l.status==="checked").map(l=>l.data);return this.plugin.uppy.validateAggregateRestrictions(a)},this.plugin=e,this.provider=t.provider;let i={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts={...i,...t},this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState(Ag(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(i=>i.type==="root"?i:{...i,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async openFolder(e){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),i=t.find(s=>s.id===e);if(i.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),await Ki(this,Or)[Or](async s=>{let n=e,a=[];do{let{username:u,nextPagePath:d,items:p}=await this.provider.list(n,{signal:s});this.plugin.setPluginState({username:u}),n=d,a=a.concat(p),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:a.length}))}while(this.opts.loadAllFiles&&n);let l=fs.afterOpenFolder(t,a,i,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:l,currentFolderId:e,searchString:""})}).catch(si(this.plugin.uppy)),this.setLoading(!1)}async logout(){await Ki(this,Or)[Or](async e=>{let t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let i=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(i,"info",7e3)}this.plugin.setPluginState({...Ag(this.plugin.rootFolderId),authenticated:!1})}}).catch(si(this.plugin.uppy))}async handleAuth(e){await Ki(this,Or)[Or](async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),await Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])}).catch(si(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){let{partialTree:t,currentFolderId:i}=this.plugin.getPluginState(),s=t.find(n=>n.id===i);eu(e)&&!this.isHandlingScroll&&s.nextPagePath&&(this.isHandlingScroll=!0,await Ki(this,Or)[Or](async n=>{let{nextPagePath:a,items:l}=await this.provider.list(s.nextPagePath,{signal:n}),u=fs.afterScrollFolder(t,i,l,a,this.validateSingleFile);this.plugin.setPluginState({partialTree:u})}).catch(si(this.plugin.uppy)),this.isHandlingScroll=!1)}async donePicking(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),await Ki(this,Or)[Or](async t=>{let i=await fs.afterFill(e,a=>this.provider.list(a,{signal:t}),this.validateSingleFile,a=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:a}))});if(this.validateAggregateRestrictions(i)){this.plugin.setPluginState({partialTree:i});return}let n=su(i);iu(n,this.plugin,this.provider),this.resetPluginState()}).catch(si(this.plugin.uppy)),this.setLoading(!1)}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),s=tu(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=fs.afterToggleCheckbox(i,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:i}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy;i||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let n={...this.opts,...t},{authenticated:a,loading:l}=this.plugin.getPluginState(),u=this.plugin.icon||Po;if(a===!1)return c(Dn,{pluginName:this.plugin.title,pluginIcon:u,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:n.renderAuthForm,loading:l});let{partialTree:d,username:p,searchString:f}=this.plugin.getPluginState(),y=this.getBreadcrumbs();return c("div",{className:(0,Ug.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n.viewType}`)},c(Bc,{showBreadcrumbs:n.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:y,pluginIcon:u,title:this.plugin.title,logout:this.logout,username:p,i18n:s}),n.showFilter&&c(ms,{searchString:f,setSearchString:o(v=>{this.plugin.setPluginState({searchString:v})},"setSearchString"),submitSearchString:o(()=>{},"submitSearchString"),inputLabel:s("filter"),clearSearchLabel:s("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),c(Jl,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:n.virtualList,noResultsLabel:s("noFilesFound"),handleScroll:this.handleScroll,viewType:n.viewType,showTitles:n.showTitles,i18n:this.plugin.uppy.i18n,isLoading:l,utmSource:"Companion"}),c(zn,{partialTree:d,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};async function ZS(r){var e;(e=Ki(this,gs)[gs])==null||e.abort();let t=new AbortController;Ki(this,gs)[gs]=t;let i=o(()=>{t.abort()},"cancelRequest");try{this.plugin.uppy.on("dashboard:close-panel",i),this.plugin.uppy.on("cancel-all",i),await r(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",i),this.plugin.uppy.off("cancel-all",i),Ki(this,gs)[gs]=void 0}}o(ZS,"_withAbort2");Ge.VERSION=QS.version;var Ig=be(It(),1);var e2={version:"4.4.5"},t2={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},r2={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},oi=class{static{o(this,"SearchProviderView")}constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=i=>{let s=In(i);return this.plugin.uppy.validateSingleFile(s)},this.getDisplayedPartialTree=()=>{let{partialTree:i}=this.plugin.getPluginState();return i.filter(s=>s.type!=="root")},this.setSearchString=i=>{this.plugin.setPluginState({searchString:i}),i===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=i=>{let n=i.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(n)},this.plugin=e,this.provider=t.provider,this.opts={...r2,...t},this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(t2)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(i=>i.type==="root"?i:{...i,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async search(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=await this.provider.search(e),i=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(s=>({type:"file",id:s.requestPath,status:"unchecked",parentId:null,data:s}))];this.plugin.setPluginState({partialTree:i,isInputMode:!1})}catch(t){si(this.plugin.uppy)(t)}this.setLoading(!1)}}async handleScroll(e){let{partialTree:t,searchString:i}=this.plugin.getPluginState(),s=t.find(n=>n.type==="root");if(eu(e)&&!this.isHandlingScroll&&s.nextPagePath){this.isHandlingScroll=!0;try{let n=await this.provider.search(i,s.nextPagePath),a={...s,nextPagePath:n.nextPageQuery},l=t.filter(d=>d.type!=="root"),u=[a,...l,...n.items.map(d=>({type:"file",id:d.requestPath,status:"unchecked",parentId:null,data:d}))];this.plugin.setPluginState({partialTree:u})}catch(n){si(this.plugin.uppy)(n)}this.isHandlingScroll=!1}}async donePicking(){let{partialTree:e}=this.plugin.getPluginState(),t=su(e);iu(t,this.plugin,this.provider),this.resetPluginState()}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),s=tu(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),n=fs.afterToggleCheckbox(i,s);this.plugin.setPluginState({partialTree:n}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:i,searchString:s,loading:n,partialTree:a}=this.plugin.getPluginState(),{i18n:l}=this.plugin.uppy,u={...this.opts,...t};return i?c(ms,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:l("enterTextToSearch"),buttonLabel:l("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):c("div",{className:(0,Ig.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${u.viewType}`)},u.showFilter&&c(ms,{searchString:s,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:l("search"),clearSearchLabel:l("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),c(Jl,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:o(async()=>{},"openFolder"),noResultsLabel:l("noSearchResults"),viewType:u.viewType,showTitles:u.showTitles,isLoading:n,i18n:l,virtualList:!1,utmSource:this.opts.utmSource}),c(zn,{partialTree:a,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:l,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};oi.VERSION=e2.version;var Qc=o(r=>({authorization:`Bearer ${r}`}),"getAuthHeader"),Dg=new Set,Ng=!1;async function Mg(r){Dg.has(r)||(await new Promise((e,t)=>{let i=document.createElement("script");i.src=r,i.addEventListener("load",()=>e()),i.addEventListener("error",s=>t(s.error)),document.head.appendChild(i)}),Dg.add(r))}o(Mg,"injectScript");async function Lg(r){await Promise.all([Mg("https://accounts.google.com/gsi/client"),(async()=>{await Mg("https://apis.google.com/js/api.js"),r==="drive"&&!Ng&&(await new Promise(e=>gapi.load("client:picker",()=>e())),await gapi.client.load("https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"),Ng=!0)})()])}o(Lg,"ensureScriptsInjected");async function i2(r,e){return!!(await fetch(`https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=${encodeURIComponent(r)}`,{signal:e})).ok}o(i2,"isTokenValid");async function Zc(r){let{pickerType:e,clientId:t,accessToken:i}=r,s=await new Promise((n,a)=>{let l=e==="drive"?["https://www.googleapis.com/auth/drive.file"]:["https://www.googleapis.com/auth/photospicker.mediaitems.readonly"],u=google.accounts.oauth2.initTokenClient({client_id:t,scope:l.join(" "),callback:n,error_callback:a});i===null?u.requestAccessToken({prompt:"consent"}):u.requestAccessToken({prompt:""})});if(s.error)throw new Error(`OAuth2 error: ${s.error}`);return s.access_token}o(Zc,"authorize");async function Bg(r){await new Promise(e=>google.accounts.oauth2.revoke(r,e))}o(Bg,"logout");var xo=class extends Error{static{o(this,"InvalidTokenError")}constructor(){super("Invalid or expired token"),this.name="InvalidTokenError"}};async function zg(r){let{token:e,apiKey:t,appId:i,onFilesPicked:s,signal:n}=r;if(!await i2(e,n))throw new xo;let a=o(u=>{u.action===google.picker.Action.PICKED&&s(u.docs.map(d=>({platform:"drive",id:d.id,name:d.name,mimeType:d.mimeType})),e)},"onPicked"),l=new google.picker.PickerBuilder().enableFeature(google.picker.Feature.NAV_HIDDEN).enableFeature(google.picker.Feature.MULTISELECT_ENABLED).setDeveloperKey(t).setAppId(i).setOAuthToken(e).addView(new google.picker.DocsView(google.picker.ViewId.DOCS).setIncludeFolders(!0).setSelectFolderEnabled(!1).setMode(google.picker.DocsViewMode.LIST)).setCallback(a).build();l.setVisible(!0),n?.addEventListener("abort",()=>l.dispose())}o(zg,"showDrivePicker");async function jg(r){let{token:e,pickingSession:t,onPickingSessionChange:i,signal:s}=r,n=Qc(e),a=t;if(a==null){let d=await fetch("https://photospicker.googleapis.com/v1/sessions",{method:"post",headers:n,signal:s});if(d.status===401){var l;if(((l=(await d.json()).error)==null?void 0:l.status)==="UNAUTHENTICATED")throw new xo}if(!d.ok)throw new Error("Failed to create a session");a=await d.json(),i(a)}let u=window.open(a.pickerUri);s?.addEventListener("abort",()=>u?.close())}o(jg,"showPhotosPicker");async function s2(r){let{accessToken:e,pickingSession:t,signal:i}=r,s=Qc(e),n,a=[];do{let u=await fetch(`https://photospicker.googleapis.com/v1/mediaItems?${new URLSearchParams({sessionId:t.id,pageSize:String(100),...n&&{pageToken:n}}).toString()}`,{headers:s,signal:i});if(!u.ok)throw new Error("Failed to get a media items");let{mediaItems:d,nextPageToken:p}=await u.json();n=p,a.push(...d)}while(n);return a=a.flatMap(l=>l.type==="PHOTO"||l.type==="VIDEO"&&l.mediaFile.mediaFileMetadata.videoMetadata.processingStatus==="READY"?[l]:[]),a.map(l=>{var u,d,p,f,y,v;let{id:_,type:R,mediaFile:{mimeType:E,filename:O,baseUrl:L}}=l;return{platform:"photos",id:_,mimeType:E,url:R==="VIDEO"?`${L}=dv`:`${L}=d`,name:O,metadata:{googlePhotosFileType:l.type,createTime:l.createTime,width:l.mediaFile.mediaFileMetadata.width,height:l.mediaFile.mediaFileMetadata.height,...l.type==="PHOTO"&&{cameraMake:(u=l.mediaFile.mediaFileMetadata.photoMetadata)==null?void 0:u.cameraMake,cameraModel:(d=l.mediaFile.mediaFileMetadata.photoMetadata)==null?void 0:d.cameraModel,focalLength:(p=l.mediaFile.mediaFileMetadata.photoMetadata)==null?void 0:p.focalLength,apertureFNumber:(f=l.mediaFile.mediaFileMetadata.photoMetadata)==null?void 0:f.apertureFNumber,isoEquivalent:(y=l.mediaFile.mediaFileMetadata.photoMetadata)==null?void 0:y.isoEquivalent,exposureTime:(v=l.mediaFile.mediaFileMetadata.photoMetadata)==null?void 0:v.exposureTime},...l.type==="VIDEO"&&{cameraMake:l.mediaFile.mediaFileMetadata.videoMetadata.cameraMake,cameraModel:l.mediaFile.mediaFileMetadata.videoMetadata.cameraModel,fps:l.mediaFile.mediaFileMetadata.videoMetadata.fps,processingStatus:l.mediaFile.mediaFileMetadata.videoMetadata.processingStatus}}}})}o(s2,"resolvePickedPhotos");async function Hg(r){let{pickingSessionRef:e,accessTokenRef:t,signal:i,onFilesPicked:s,onError:n}=r;for(let a=1;;)try{e.current!=null?a=parseFloat(e.current.pollingConfig.pollInterval):a=1,await Promise.race([new Promise(d=>setTimeout(d,a*1e3)),new Promise((d,p)=>{i.addEventListener("abort",p)})]),i.throwIfAborted();let l=t.current,u=e.current;if(u!=null&&l!=null){let d=Qc(l),p=await fetch(`https://photospicker.googleapis.com/v1/sessions/${encodeURIComponent(u.id)}`,{headers:d,signal:i});if(!p.ok)throw new Error("Failed to get session");if((await p.json()).mediaItemsSet){let y=await s2({accessToken:l,pickingSession:u,signal:i});e.current=void 0,s(y,l)}u.pollingConfig.timeoutIn==="0s"&&(e.current=void 0)}}catch(l){if(l instanceof Error&&l.name==="AbortError")return;n(l)}}o(Hg,"pollPickingSession");var ou=o(()=>c("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"-7 -7 73 73"},c("g",{fill:"none","fill-rule":"evenodd"},c("path",{d:"M-3-3h64v64H-3z"}),c("g",{"fill-rule":"nonzero"},c("path",{fill:"#FBBC04",d:"M14.8 13.4c8.1 0 14.7 6.6 14.7 14.8v1.3H1.3c-.7 0-1.3-.6-1.3-1.3C0 20 6.6 13.4 14.8 13.4z"}),c("path",{fill:"#EA4335",d:"M45.6 14.8c0 8.1-6.6 14.7-14.8 14.7h-1.3V1.3c0-.7.6-1.3 1.3-1.3C39 0 45.6 6.6 45.6 14.8z"}),c("path",{fill:"#4285F4",d:"M44.3 45.6c-8.2 0-14.8-6.6-14.8-14.8v-1.3h28.2c.7 0 1.3.6 1.3 1.3 0 8.2-6.6 14.8-14.8 14.8z"}),c("path",{fill:"#34A853",d:"M13.4 44.3c0-8.2 6.6-14.8 14.8-14.8h1.3v28.2c0 .7-.6 1.3-1.3 1.3-8.2 0-14.8-6.6-14.8-14.8z"})))),"GooglePhotosIcon"),nu=o(()=>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"}))),"GoogleDriveIcon");function o2(r,e){let[t,i]=Wt();pt(()=>{(async()=>i(await r.getItem(e)))()},[e,r]);let s=gr(async n=>(i(n),n==null?r.removeItem(e):r.setItem(e,n)),[e,r]);return[t,s]}o(o2,"useStore");function ys(r){let{uppy:e,i18n:t,clientId:i,onFilesPicked:s,pickerType:n,apiKey:a,appId:l,storage:u}=r,[d,p]=Wt(!1),[f,y]=o2(u,`uppy:google-${n}-picker:accessToken`),v=Gt(),_=Gt(f),R=Gt(!1),E=gr(B=>{e.log("Access token updated"),y(B),_.current=B},[y,e]);pt(()=>{_.current=f},[f]);let O=gr(async B=>{let G=f,J=o(async $=>{if(n==="drive")await zg({token:$,apiKey:a,appId:l,onFilesPicked:s,signal:B});else{let W=o(te=>{v.current=te},"onPickingSessionChange");await jg({token:$,pickingSession:v.current,onPickingSessionChange:W,signal:B})}},"doShowPicker");p(!0);try{try{if(await Lg(n),G==null&&(G=await Zc({clientId:i,pickerType:n})),G==null)throw new Error;await J(G),R.current=!0,E(G)}catch($){if($ instanceof xo)e.log("Token is invalid or expired, reauthenticating"),G=await Zc({pickerType:n,accessToken:G,clientId:i}),await J(G),R.current=!0,E(G);else throw $}}catch($){$ instanceof Error&&"type"in $&&$.type==="popup_closed"||(E(null),e.log($))}finally{p(!1)}},[f,a,l,i,s,n,E,e]);pt(()=>{let B=new AbortController;return Hg({pickingSessionRef:v,accessTokenRef:_,signal:B.signal,onFilesPicked:s,onError:o(G=>e.log(G),"onError")}),()=>B.abort()},[s,e]),pt(()=>{if(f===void 0||R.current)return;let B=new AbortController;return O(B.signal),()=>{R.current||B.abort()}},[f,O]);let L=gr(async()=>{f&&(await Bg(f),E(null),v.current=void 0)},[f,E]);return d?c("div",null,t("pleaseWait"),"..."):f==null?c(Dn,{pluginName:t(n==="drive"?"pluginNameGoogleDrivePicker":"pluginNameGooglePhotosPicker"),pluginIcon:n==="drive"?nu:ou,handleAuth:O,i18n:t,loading:d}):c("div",{style:{textAlign:"center"}},c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary",style:{display:"block",marginBottom:"1em"},disabled:d,onClick:o(()=>O(),"onClick")},t(n==="drive"?"pickFiles":"pickPhotos")),c("button",{type:"button",className:"uppy-u-reset uppy-c-btn",disabled:d,onClick:L},t("logOut")))}o(ys,"GooglePickerView");function zr(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(zr,"_classPrivateFieldLooseBase");var n2=0;function td(r){return"__private_"+n2+++"_"+r}o(td,"_classPrivateFieldLooseKey");var a2={version:"4.0.2"},l2="uppy/STATE_UPDATE",u2=o(r=>e=>e.uppy[r],"defaultSelector");function c2(r,e){let t=Object.keys(e),i={};return t.forEach(s=>{r[s]!==e[s]&&(i[s]=e[s])}),i}o(c2,"getPatch");var ni=td("id"),jn=td("selector"),ai=td("store"),au=class{static{o(this,"ReduxStore")}constructor(e){Object.defineProperty(this,ni,{writable:!0,value:void 0}),Object.defineProperty(this,jn,{writable:!0,value:void 0}),Object.defineProperty(this,ai,{writable:!0,value:void 0}),zr(this,ai)[ai]=e.store,zr(this,ni)[ni]=e.id||mr(),zr(this,jn)[jn]=e.selector||u2(zr(this,ni)[ni]),this.setState({})}setState(e){zr(this,ai)[ai].dispatch({type:l2,id:zr(this,ni)[ni],payload:e})}getState(){return zr(this,jn)[jn](zr(this,ai)[ai].getState())}subscribe(e){let t=this.getState();return zr(this,ai)[ai].subscribe(()=>{let i=this.getState();if(t!==i){let s=c2(t,i);e(t,i,s),t=i}})}[Symbol.for("uppy test: get id")](){return zr(this,ni)[ni]}};au.VERSION=a2.version;var $g=au;function lu(r,e,t,i){return t===0||r===e?r:i===0?e:r+(e-r)*2**(-i/t)}o(lu,"emaFilter");var tr={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var ld=be(It(),1);function Hn(r){let e=[],t="indeterminate",i;for(let{progress:n}of Object.values(r)){let{preprocess:a,postprocess:l}=n;i==null&&(a||l)&&({mode:t,message:i}=a||l),a?.mode==="determinate"&&e.push(a.value),l?.mode==="determinate"&&e.push(l.value)}let s=e.reduce((n,a)=>n+a/e.length,0);return{mode:t,message:i,value:s}}o(Hn,"calculateProcessingProgress");var od=be(It(),1),sd=be(hn(),1);function rd(r){let e=Math.floor(r/3600)%24,t=Math.floor(r/60)%60,i=Math.floor(r%60);return{hours:e,minutes:t,seconds:i}}o(rd,"secondsToTime");function id(r){let e=rd(r),t=e.hours===0?"":`${e.hours}h`,i=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}${i}${s}`}o(id,"prettyETA");var d2="\xB7",qg=o(()=>` ${d2} `,"renderDot");function Vg(r){let{newFiles:e,isUploadStarted:t,recoveredState:i,i18n:s,uploadState:n,isSomeGhost:a,startUpload:l}=r,u=(0,od.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===tr.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),d=e&&t&&!i?s("uploadXNewFiles",{smart_count:e}):s("uploadXFiles",{smart_count:e});return c("button",{type:"button",className:u,"aria-label":s("uploadXFiles",{smart_count:e}),onClick:l,disabled:a,"data-uppy-super-focusable":!0},d)}o(Vg,"UploadBtn");function Wg(r){let{i18n:e,uppy:t}=r;return c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:o(()=>t.retryAll().catch(()=>{}),"onClick"),"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(Wg,"RetryBtn");function Gg(r){let{i18n:e,uppy:t}=r;return c("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:o(()=>t.cancelAll(),"onClick"),"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(Gg,"CancelBtn");function Kg(r){let{isAllPaused:e,i18n:t,isAllComplete:i,resumableUploads:s,uppy:n}=r,a=t(e?"resume":"pause");function l(){if(!i){if(!s){n.cancelAll();return}if(e){n.resumeAll();return}n.pauseAll()}}return o(l,"togglePauseResume"),c("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:l,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},c("g",{fill:"none",fillRule:"evenodd"},c("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),c("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}o(Kg,"PauseResumeButton");function Xg(r){let{i18n:e,doneButtonHandler:t}=r;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(Xg,"DoneBtn");function Yg(){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(Yg,"LoadingSpinner");function Jg(r){let{progress:e}=r,{value:t,mode:i,message:s}=e;return c("div",{className:"uppy-StatusBar-content"},c(Yg,null),i==="determinate"?`${Math.round(t*100)}% \xB7 `:"",s)}o(Jg,"ProgressBarProcessing");function p2(r){let{numUploads:e,complete:t,totalUploadedSize:i,totalSize:s,totalETA:n,i18n:a}=r,l=e>1,u=(0,sd.default)(i);return c("div",{className:"uppy-StatusBar-statusSecondary"},l&&a("filesUploadedOfTotal",{complete:t,smart_count:e}),c("span",{className:"uppy-StatusBar-additionalInfo"},l&&qg(),s!=null?a("dataUploadedOfTotal",{complete:u,total:(0,sd.default)(s)}):a("dataUploadedOfUnknown",{complete:u}),qg(),n!=null&&a("xTimeLeft",{time:id(n)})))}o(p2,"ProgressDetails");function Qg(r){let{i18n:e,complete:t,numUploads:i}=r;return c("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:i}))}o(Qg,"FileUploadCount");function h2(r){let{i18n:e,newFiles:t,startUpload:i}=r,s=(0,od.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:i},e("upload")))}o(h2,"UploadNewlyAddedFiles");function Zg(r){let{i18n:e,supportsUploadProgress:t,totalProgress:i,showProgressDetails:s,isUploadStarted:n,isAllComplete:a,isAllPaused:l,newFiles:u,numUploads:d,complete:p,totalUploadedSize:f,totalSize:y,totalETA:v,startUpload:_}=r,R=u&&n;if(!n||a)return null;let E=e(l?"paused":"uploading");function O(){return!l&&!R&&s?t?c(p2,{numUploads:d,complete:p,totalUploadedSize:f,totalSize:y,totalETA:v,i18n:e}):c(Qg,{i18n:e,complete:p,numUploads:d}):null}return o(O,"renderProgressDetails"),c("div",{className:"uppy-StatusBar-content","aria-label":E,title:E},l?null:c(Yg,null),c("div",{className:"uppy-StatusBar-status"},c("div",{className:"uppy-StatusBar-statusPrimary"},t&&i!==0?`${E}: ${i}%`:E),O(),R?c(h2,{i18n:e,newFiles:u,startUpload:_}):null))}o(Zg,"ProgressBarUploading");function ey(r){let{i18n:e}=r;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(ey,"ProgressBarComplete");function ty(r){let{error:e,i18n:t,complete:i,numUploads:s}=r;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(Qg,{i18n:t,complete:i,numUploads:s})))}o(ty,"ProgressBarError");var{STATE_ERROR:ry,STATE_WAITING:f2,STATE_PREPROCESSING:nd,STATE_UPLOADING:uu,STATE_POSTPROCESSING:ad,STATE_COMPLETE:cu}=tr;function ud(r){let{newFiles:e,allowNewUpload:t,isUploadInProgress:i,isAllPaused:s,resumableUploads:n,error:a,hideUploadButton:l=void 0,hidePauseResumeButton:u=!1,hideCancelButton:d=!1,hideRetryButton:p=!1,recoveredState:f,uploadState:y,totalProgress:v,files:_,supportsUploadProgress:R,hideAfterFinish:E=!1,isSomeGhost:O,doneButtonHandler:L=void 0,isUploadStarted:B,i18n:G,startUpload:J,uppy:$,isAllComplete:W,showProgressDetails:te=void 0,numUploads:ae,complete:ke,totalSize:Ae,totalETA:qe,totalUploadedSize:Fe}=r;function Re(){switch(y){case ad:case nd:{let de=Hn(_);return de.mode==="determinate"?de.value*100:v}case ry:return null;case uu:return R?v:null;default:return v}}o(Re,"getProgressValue");function Xe(){switch(y){case ad:case nd:{let{mode:de}=Hn(_);return de==="indeterminate"}case uu:return!R;default:return!1}}o(Xe,"getIsIndeterminate");let C=Re(),S=C??100,P=!a&&e&&(!i&&!s||f)&&t&&!l,M=!d&&y!==f2&&y!==cu,H=n&&!u&&y===uu,j=a&&!W&&!p,U=L&&y===cu,T=(0,ld.default)("uppy-StatusBar-progress",{"is-indeterminate":Xe()}),k=(0,ld.default)("uppy-StatusBar",`is-${y}`,{"has-ghosts":O}),N=(()=>{switch(y){case nd:case ad:return c(Jg,{progress:Hn(_)});case cu:return c(ey,{i18n:G});case ry:return c(ty,{error:a,i18n:G,numUploads:ae,complete:ke});case uu:return c(Zg,{i18n:G,supportsUploadProgress:R,totalProgress:v,showProgressDetails:te,isUploadStarted:B,isAllComplete:W,isAllPaused:s,newFiles:e,numUploads:ae,complete:ke,totalUploadedSize:Fe,totalSize:Ae,totalETA:qe,startUpload:J});default:return null}})();return!(P||j||H||M||U)&&!N||y===cu&&E?null:c("div",{className:k},c("div",{className:T,style:{width:`${S}%`},role:"progressbar","aria-label":`${S}%`,"aria-valuetext":`${S}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":C}),N,c("div",{className:"uppy-StatusBar-actions"},P?c(Vg,{newFiles:e,isUploadStarted:B,recoveredState:f,i18n:G,isSomeGhost:O,startUpload:J,uploadState:y}):null,j?c(Wg,{i18n:G,uppy:$}):null,H?c(Kg,{isAllPaused:s,i18n:G,isAllComplete:W,resumableUploads:n,uppy:$}):null,M?c(Gg,{i18n:G,uppy:$}):null,U?c(Xg,{i18n:G,doneButtonHandler:L}):null))}o(ud,"StatusBarUI");var iy={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}",dataUploadedOfUnknown:"%{complete} of unknown",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 ze(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(ze,"_classPrivateFieldLooseBase");var m2=0;function Fo(r){return"__private_"+m2+++"_"+r}o(Fo,"_classPrivateFieldLooseKey");var g2={version:"4.1.3"},y2=2e3,v2=2e3;function b2(r,e,t,i){if(r)return tr.STATE_ERROR;if(e)return tr.STATE_COMPLETE;if(t)return tr.STATE_WAITING;let s=tr.STATE_WAITING,n=Object.keys(i);for(let a=0;a<n.length;a++){let{progress:l}=i[n[a]];if(l.uploadStarted&&!l.uploadComplete)return tr.STATE_UPLOADING;l.preprocess&&(s=tr.STATE_PREPROCESSING),l.postprocess&&s!==tr.STATE_PREPROCESSING&&(s=tr.STATE_POSTPROCESSING)}return s}o(b2,"getUploadingState");var w2={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},br=Fo("lastUpdateTime"),kr=Fo("previousUploadedBytes"),li=Fo("previousSpeed"),rr=Fo("previousETA"),cd=Fo("computeSmoothETA"),$n=Fo("onUploadStart"),ui=class extends se{static{o(this,"StatusBar")}constructor(e,t){super(e,{...w2,...t}),Object.defineProperty(this,cd,{value:S2}),Object.defineProperty(this,br,{writable:!0,value:void 0}),Object.defineProperty(this,kr,{writable:!0,value:void 0}),Object.defineProperty(this,li,{writable:!0,value:void 0}),Object.defineProperty(this,rr,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,$n,{writable:!0,value:o(()=>{let{recoveredState:i}=this.uppy.getState();if(ze(this,li)[li]=null,ze(this,rr)[rr]=null,i){ze(this,kr)[kr]=Object.values(i.files).reduce((s,n)=>{let{progress:a}=n;return s+a.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}ze(this,br)[br]=performance.now(),ze(this,kr)[kr]=0},"value")}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=iy,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:t,files:i,allowNewUpload:s,totalProgress:n,error:a,recoveredState:l}=e,{newFiles:u,startedFiles:d,completeFiles:p,isUploadStarted:f,isAllComplete:y,isAllPaused:v,isUploadInProgress:_,isSomeGhost:R}=this.uppy.getObjectOfFilesPerState(),E=l?Object.values(i):u,O=!!t.resumableUploads,L=t.uploadProgress!==!1,B=null,G=0;d.every($=>$.progress.bytesTotal!=null&&$.progress.bytesTotal!==0)?(B=0,d.forEach($=>{B+=$.progress.bytesTotal||0,G+=$.progress.bytesUploaded||0})):d.forEach($=>{G+=$.progress.bytesUploaded||0});let J=ze(this,cd)[cd]({uploaded:G,total:B});return ud({error:a,uploadState:b2(a,y,l,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:B,totalUploadedSize:G,isAllComplete:!1,isAllPaused:v,isUploadStarted:f,isUploadInProgress:_,isSomeGhost:R,recoveredState:l,complete:p.length,newFiles:E.length,numUploads:d.length,totalETA:J,files:i,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:O,supportsUploadProgress:L,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){let e=this.el;Wl(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",ze(this,$n)[$n]),ze(this,br)[br]=performance.now(),ze(this,kr)[kr]=this.uppy.getFiles().reduce((t,i)=>t+i.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",ze(this,$n)[$n])}};function S2(r){var e,t;if(r.total==null||r.total===0)return null;let i=r.total-r.uploaded;if(i<=0)return null;(t=(e=ze(this,br))[br])!=null||(e[br]=performance.now());let s=performance.now()-ze(this,br)[br];if(s===0){var n;return Math.round(((n=ze(this,rr)[rr])!=null?n:0)/100)/10}let a=r.uploaded-ze(this,kr)[kr];if(ze(this,kr)[kr]=r.uploaded,a<=0){var l;return Math.round(((l=ze(this,rr)[rr])!=null?l:0)/100)/10}let u=a/s,d=ze(this,li)[li]==null?u:lu(u,ze(this,li)[li],y2,s);ze(this,li)[li]=d;let p=i/d,f=Math.max(ze(this,rr)[rr]-s,0),y=ze(this,rr)[rr]==null?p:lu(p,f,v2,s);return ze(this,rr)[rr]=y,ze(this,br)[br]=performance.now(),Math.round(y/100)/10}o(S2,"_computeSmoothETA2");ui.VERSION=g2.version;var sy=300,qn=class extends we{static{o(this,"FadeIn")}constructor(){super(...arguments),this.ref=zl()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,sy)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,sy)}render(){let{children:e}=this.props;return c("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function _2(r,e){return Object.assign(r,e)}o(_2,"assign");function P2(r,e){var t;return(t=r?.key)!=null?t:e}o(P2,"getKey");function x2(r,e){let t=r._ptgLinkedRefs||(r._ptgLinkedRefs={});return t[e]||(t[e]=i=>{r.refs[e]=i})}o(x2,"linkRef");function Vn(r){let e={};for(let t=0;t<r.length;t++)if(r[t]!=null){let i=P2(r[t],t.toString(36));e[i]=r[t]}return e}o(Vn,"getChildMapping");function F2(r,e){r=r||{},e=e||{};let t=o(a=>e.hasOwnProperty(a)?e[a]:r[a],"getValueForKey"),i={},s=[];for(let a in r)e.hasOwnProperty(a)?s.length&&(i[a]=s,s=[]):s.push(a);let n={};for(let a in e){if(i.hasOwnProperty(a))for(let l=0;l<i[a].length;l++){let u=i[a][l];n[i[a][l]]=t(u)}n[a]=t(a)}for(let a=0;a<s.length;a++)n[s[a]]=t(s[a]);return n}o(F2,"mergeChildMappings");var E2=o(r=>r,"identity"),du=class extends we{static{o(this,"TransitionGroup")}constructor(e,t){super(e,t),this.refs={},this.state={children:Vn(Vt(Vt(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=Vn(Vt(e.children)||[]),i=this.state.children;this.setState(n=>({children:F2(n.children,t)}));let s;for(s in t)if(t.hasOwnProperty(s)){let n=i&&i.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 i)if(i.hasOwnProperty(s)){let n=t&&t.hasOwnProperty(s);i[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 i=Vn(Vt(this.props.children)||[]);(!i||!i.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 i=Vn(Vt(this.props.children)||[]);(!i||!i.hasOwnProperty(e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;let i=this.refs[e];i!=null&&i.componentWillLeave?i.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;let i=this.refs[e];i!=null&&i.componentDidLeave&&i.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let s=Vn(Vt(this.props.children)||[]);if(s&&s.hasOwnProperty(e))this.performEnter(e);else{let n=_2({},this.state.children);delete n[e],this.setState({children:n})}}render(e,t){let{childFactory:i,transitionLeave:s,transitionName:n,transitionAppear:a,transitionEnter:l,transitionLeaveTimeout:u,transitionEnterTimeout:d,transitionAppearTimeout:p,component:f,...y}=e,{children:v}=t,_=Object.entries(v).map(R=>{let[E,O]=R;if(!O)return;let L=x2(this,E);return Cn(i(O),{ref:L,key:E})}).filter(Boolean);return c(f,y,_)}};du.defaultProps={component:"span",childFactory:E2};var oy=du;var C2={version:"4.2.1"},ci=class extends se{static{o(this,"Informer")}constructor(e,t){super(e,t),this.render=i=>c("div",{className:"uppy uppy-Informer"},c(oy,null,i.info.map(s=>c(qn,{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:o(()=>alert(`${s.message} 

 ${s.details}`),"onClick")},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};ci.VERSION=C2.version;var T2=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function O2(r,e,t){var i,s;let n=T2.exec(r),a=(i=(s=e.mimeType)!=null?s:n?.[1])!=null?i:"plain/text",l;if(n?.[2]!=null){let u=atob(decodeURIComponent(n[3])),d=new Uint8Array(u.length);for(let p=0;p<u.length;p++)d[p]=u.charCodeAt(p);l=[d]}else n?.[3]!=null&&(l=[decodeURIComponent(n[3])]);return t?new File(l,e.name||"",{type:a}):new Blob(l,{type:a})}o(O2,"dataURItoBlob");var ny=O2;function pu(r){return r.startsWith("blob:")}o(pu,"isObjectURL");function hu(r){return r?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(r):!1}o(hu,"isPreviewSupported");function xe(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}o(xe,"e");var my=typeof self<"u"?self:global,Xn=typeof navigator<"u",k2=Xn&&typeof HTMLImageElement>"u",ay=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),gy=my.Buffer,yy=!!gy,A2=o(r=>r!==void 0,"h");function vy(r){return r===void 0||(r instanceof Map?r.size===0:Object.values(r).filter(A2).length===0)}o(vy,"f");function ft(r){let e=new Error(r);throw delete e.stack,e}o(ft,"l");function ly(r){let e=function(t){let i=0;return t.ifd0.enabled&&(i+=1024),t.exif.enabled&&(i+=2048),t.makerNote&&(i+=2048),t.userComment&&(i+=1024),t.gps.enabled&&(i+=512),t.interop.enabled&&(i+=100),t.ifd1.enabled&&(i+=1024),i+2048}(r);return r.jfif.enabled&&(e+=50),r.xmp.enabled&&(e+=2e4),r.iptc.enabled&&(e+=14e3),r.icc.enabled&&(e+=6e3),e}o(ly,"o");var dd=o(r=>String.fromCharCode.apply(null,r),"u"),uy=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,bs=class r{static{o(this,"c")}static from(e,t){return e instanceof this&&e.le===t?e:new r(e,void 0,void 0,t)}constructor(e,t=0,i,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){i===void 0&&(i=e.byteLength-t);let n=new DataView(e,t,i);this._swapDataView(n)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof r){i===void 0&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&ft("Creating view outside of available memory in ArrayBuffer");let n=new DataView(e.buffer,t,i);this._swapDataView(n)}else if(typeof e=="number"){let n=new DataView(new ArrayBuffer(e));this._swapDataView(n)}else ft("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,i=r){return e instanceof DataView||e instanceof r?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||ft("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new i(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new r(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),uy?uy.decode(s):yy?Buffer.from(s).toString("utf8"):decodeURIComponent(escape(dd(s)));var s}getLatin1String(e=0,t=this.byteLength){let i=this.getUint8Array(e,t);return dd(i)}getUnicodeString(e=0,t=this.byteLength){let i=[];for(let s=0;s<t&&e+s<this.byteLength;s+=2)i.push(this.getUint16(e+s));return dd(i)}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,i){switch(t){case 1:return this.getUint8(e,i);case 2:return this.getUint16(e,i);case 4:return this.getUint32(e,i);case 8:return this.getUint64&&this.getUint64(e,i)}}getUint(e,t,i){switch(t){case 8:return this.getUint8(e,i);case 16:return this.getUint16(e,i);case 32:return this.getUint32(e,i);case 64:return this.getUint64&&this.getUint64(e,i)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function hd(r,e){ft(`${r} '${e}' was not loaded, try using full build of exifr.`)}o(hd,"p");var Yn=class extends Map{static{o(this,"g")}constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||hd(this.kind,e),t&&(e in t||function(i,s){ft(`Unknown ${i} '${s}'.`)}(this.kind,e),t[e].enabled||hd(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},vu=new Yn("file parser"),ir=new Yn("segment parser"),Zn=new Yn("file reader"),R2=my.fetch;function cy(r,e){return(t=r).startsWith("data:")||t.length>1e4?md(r,e,"base64"):ay&&r.includes("://")?fd(r,e,"url",fu):ay?md(r,e,"fs"):Xn?fd(r,e,"url",fu):void ft("Invalid input argument");var t}o(cy,"k");async function fd(r,e,t,i){return Zn.has(t)?md(r,e,t):i?async function(s,n){let a=await n(s);return new bs(a)}(r,i):void ft(`Parser ${t} is not loaded`)}o(fd,"O");async function md(r,e,t){let i=new(Zn.get(t))(r,e);return await i.read(),i}o(md,"v");var fu=o(r=>R2(r).then(e=>e.arrayBuffer()),"S"),Jn=o(r=>new Promise((e,t)=>{let i=new FileReader;i.onloadend=()=>e(i.result||new ArrayBuffer),i.onerror=t,i.readAsArrayBuffer(r)}),"A"),gd=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 by(r,e,t){let i=new gd;for(let[s,n]of t)i.set(s,n);if(Array.isArray(e))for(let s of e)r.set(s,i);else r.set(e,i);return i}o(by,"x");function wy(r,e,t){let i,s=r.get(e);for(i of t)s.set(i[0],i[1])}o(wy,"C");var ea=new Map,Sd=new Map,_d=new Map,Eo=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],bu=["jfif","xmp","icc","iptc","ihdr"],Qn=["tiff",...bu],Ze=["ifd0","ifd1","exif","gps","interop"],Co=[...Qn,...Ze],To=["makerNote","userComment"],wu=["translateKeys","translateValues","reviveValues","multiSegment"],Oo=[...wu,"sanitize","mergeOutput","silentErrors"],mu=class{static{o(this,"_")}get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},vs=class extends mu{static{o(this,"D")}get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,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=Ze.includes(e),this.canBeFiltered&&(this.dict=ea.get(e)),i!==void 0)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if(typeof i=="object"){if(this.enabled=!0,this.parse=i.parse!==!1,this.canBeFiltered){let{pick:n,skip:a}=i;n&&n.length>0&&this.translateTagSet(n,this.pick),a&&a.length>0&&this.translateTagSet(a,this.skip)}this.applyInheritables(i)}else i===!0||i===!1?this.parse=this.enabled=i:ft(`Invalid options argument: ${i}`)}applyInheritables(e){let t,i;for(t of wu)i=e[t],i!==void 0&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,s,{tagKeys:n,tagValues:a}=this.dict;for(i of e)typeof i=="string"?(s=a.indexOf(i),s===-1&&(s=n.indexOf(Number(i))),s!==-1&&t.add(Number(n[s]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,gu(this.pick,this.deps)):this.enabled&&this.pick.size>0&&gu(this.pick,this.deps)}},Nt={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},dy=new Map,ws=class extends mu{static{o(this,"R")}static useCached(e){let t=dy.get(e);return t!==void 0||(t=new this(e),dy.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):ft(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Xn?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Eo)this[e]=Nt[e];for(e of Oo)this[e]=Nt[e];for(e of To)this[e]=Nt[e];for(e of Co)this[e]=new vs(e,Nt[e],void 0,this)}setupFromTrue(){let e;for(e of Eo)this[e]=Nt[e];for(e of Oo)this[e]=Nt[e];for(e of To)this[e]=!0;for(e of Co)this[e]=new vs(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Eo)this[t]=Nt[t];for(t of Oo)this[t]=Nt[t];for(t of To)this[t]=Nt[t];for(t of Co)this[t]=new vs(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ze)}setupFromObject(e){let t;for(t of(Ze.ifd0=Ze.ifd0||Ze.image,Ze.ifd1=Ze.ifd1||Ze.thumbnail,Object.assign(this,e),Eo))this[t]=pd(e[t],Nt[t]);for(t of Oo)this[t]=pd(e[t],Nt[t]);for(t of To)this[t]=pd(e[t],Nt[t]);for(t of Qn)this[t]=new vs(t,Nt[t],e[t],this);for(t of Ze)this[t]=new vs(t,Nt[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ze,Co),e.tiff===!0?this.batchEnableWithBool(Ze,!0):e.tiff===!1?this.batchEnableWithUserValue(Ze,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ze):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ze)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let s=t[i];this[i].enabled=s!==!1&&s!==void 0}}setupGlobalFilters(e,t,i,s=i){if(e&&e.length){for(let a of s)this[a].enabled=!1;let n=py(e,i);for(let[a,l]of n)gu(this[a].pick,l),this[a].enabled=!0}else if(t&&t.length){let n=py(t,i);for(let[a,l]of n)gu(this[a].skip,l)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,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),i.enabled||e.skip.add(700),s.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:s}=this;s.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=Ze.some(n=>this[n].enabled===!0)||this.makerNote||this.userComment;for(let n of Ze)this[n].finalizeFilters()}get onlyTiff(){return!bu.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of Qn)this[e].enabled&&!ir.has(e)&&hd("segment parser",e)}};function py(r,e){let t,i,s,n,a=[];for(s of e){for(n of(t=ea.get(s),i=[],t))(r.includes(n[0])||r.includes(n[1]))&&i.push(n[0]);i.length&&a.push([s,i])}return a}o(py,"K");function pd(r,e){return r!==void 0?r:e!==void 0?e:void 0}o(pd,"W");function gu(r,e){for(let t of e)r.add(t)}o(gu,"X");xe(ws,"default",Nt);var ko=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=ws.useCached(e)}async read(e){this.file=await function(t,i){return typeof t=="string"?cy(t,i):Xn&&!k2&&t instanceof HTMLImageElement?cy(t.src,i):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new bs(t):Xn&&t instanceof Blob?fd(t,i,"blob",Jn):void ft("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,s]of vu)if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),ft("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),vy(i=e)?void 0:i;var i}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async i=>{let s=await i.parse();i.assignToOutput(e,s)});this.options.silentErrors&&(t=t.map(i=>i.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,i=ir.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 i(n,e,t),l=await a.extractThumbnail();return t.close&&t.close(),l}};async function Sy(r,e){let t=new ko(e);return await t.read(r),t.parse()}o(Sy,"Y");var U2=Object.freeze({__proto__:null,parse:Sy,Exifr:ko,fileParsers:vu,segmentParsers:ir,fileReaders:Zn,tagKeys:ea,tagValues:Sd,tagRevivers:_d,createDictionary:by,extendDictionary:wy,fetchUrlAsArrayBuffer:fu,readBlobAsArrayBuffer:Jn,chunkedProps:Eo,otherSegments:bu,segments:Qn,tiffBlocks:Ze,segmentsAndBlocks:Co,tiffExtractables:To,inheritables:wu,allFormatters:Oo,Options:ws}),Xi=class{static{o(this,"J")}static findPosition(e,t){let i=e.getUint16(t+2)+2,s=typeof this.headerLength=="function"?this.headerLength(e,t,i):this.headerLength,n=t+s,a=i-s;return{offset:t,length:i,headerLength:s,start:n,size:a,end:n+a}}static parse(e,t={}){return new this(e,new ws({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof bs?e:new bs(e)}constructor(e,t={},i){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=i,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 i=_d.get(t),s=Sd.get(t),n=ea.get(t),a=this.options[t],l=a.reviveValues&&!!i,u=a.translateValues&&!!s,d=a.translateKeys&&!!n,p={};for(let[f,y]of e)l&&i.has(f)?y=i.get(f)(y):u&&s.has(f)&&(y=this.translateValue(y,s.get(f))),d&&n.has(f)&&(f=n.get(f)||f),p[f]=y;return p}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,i){if(this.globalOptions.mergeOutput)return Object.assign(e,i);e[t]?Object.assign(e[t],i):e[t]=i}};xe(Xi,"headerLength",4),xe(Xi,"type",void 0),xe(Xi,"multiSegment",!1),xe(Xi,"canHandle",()=>!1);function I2(r){return r===192||r===194||r===196||r===219||r===221||r===218||r===254}o(I2,"q");function D2(r){return r>=224&&r<=239}o(D2,"Q");function N2(r,e,t){for(let[i,s]of ir)if(s.canHandle(r,e,t))return i}o(N2,"Z");var yu=class extends class{constructor(e,t,i){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(l){ft(`Couldn't read segment: ${JSON.stringify(s)}. ${l.message}`)}else this.file.byteLength>n+a?s.chunk=this.file.subarray(n,a):s.size===void 0?s.chunk=this.file.subarray(n):ft("Segment unreachable: "+JSON.stringify(s));return s.chunk}),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=i}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let i=new(ir.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:i,chunk:s}=t,n=this.options[i];if(n&&n.enabled){let a=this.parsers[i];a&&a.append||a||this.createParser(i,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(ir.keyList())):(e=e===void 0?ir.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&ir.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:i,findAll:s,wanted:n,remaining:a}=this;if(!s&&this.file.chunked&&(s=Array.from(n).some(l=>{let u=ir.get(l),d=this.options[l];return u.multiSegment&&d.multiSegment}),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let l=!1;for(;a.size>0&&!l&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:u}=i,d=this.appSegments.some(p=>!this.file.available(p.offset||p.start,p.length||p.size));if(l=e>u&&!d?!await i.readNextChunk(e):!await i.readNextChunk(u),(e=this.findAppSegmentsInRange(e,i.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let i,s,n,a,l,u,{file:d,findAll:p,wanted:f,remaining:y,options:v}=this;for(;e<t;e++)if(d.getUint8(e)===255){if(i=d.getUint8(e+1),D2(i)){if(s=d.getUint16(e+2),n=N2(d,e,s),n&&f.has(n)&&(a=ir.get(n),l=a.findPosition(d,e),u=v[n],l.type=n,this.appSegments.push(l),!p&&(a.multiSegment&&u.multiSegment?(this.unfinishedMultiSegment=l.chunkNumber<l.chunkCount,this.unfinishedMultiSegment||y.delete(n)):y.delete(n),y.size===0)))break;v.recordUnknownSegments&&(l=Xi.findPosition(d,e),l.marker=i,this.unknownSegments.push(l)),e+=s+1}else if(I2(i)){if(s=d.getUint16(e+2),i===218&&v.stopAfterSos!==!1)return;v.recordJpegSegments&&this.jpegSegments.push({offset:e,length:s,marker:i}),e+=s+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,i){let s,n,a,l=new Map;for(let u=0;u<t.length;u++)s=t[u],n=s[i],l.has(n)?a=l.get(n):l.set(n,a=[]),a.push(s);return Array.from(l)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,i])=>{let s=ir.get(t,this.options);return s.handleMultiSegments?{type:t,chunk:s.handleMultiSegments(i)}:i[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(yu,"type","jpeg"),vu.set("jpeg",yu);var M2=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],yd=class extends Xi{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,i=new Map){let{pick:s,skip:n}=this.options[t];s=new Set(s);let a=s.size>0,l=n.size===0,u=this.chunk.getUint16(e);e+=2;for(let d=0;d<u;d++){let p=this.chunk.getUint16(e);if(a){if(s.has(p)&&(i.set(p,this.parseTag(e,p,t)),s.delete(p),s.size===0))break}else!l&&n.has(p)||i.set(p,this.parseTag(e,p,t));e+=12}return i}parseTag(e,t,i){let{chunk:s}=this,n=s.getUint16(e+2),a=s.getUint32(e+4),l=M2[n];if(l*a<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&ft(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&ft(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),n===1)return s.getUint8Array(e,a);if(n===2)return(u=function(d){for(;d.endsWith("\0");)d=d.slice(0,-1);return d}(u=s.getString(e,a)).trim())===""?void 0:u;var u;if(n===7)return s.getUint8Array(e,a);if(a===1)return this.parseTagValue(n,e);{let d=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),p=l;for(let f=0;f<a;f++)d[f]=this.parseTagValue(n,e),e+=p;return d}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:return i.getUint32(t);case 5:return i.getUint32(t)/i.getUint32(t+4);case 6:return i.getInt8(t);case 8:return i.getInt16(t);case 9:return i.getInt32(t);case 10:return i.getInt32(t)/i.getInt32(t+4);case 11:return i.getFloat(t);case 12:return i.getDouble(t);case 13:return i.getUint32(t);default:ft(`Invalid tiff type ${e}`)}}},Kn=class extends yd{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 i=new Map;return this[t]=i,this.parseTags(e,t,i),i}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&ft("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&ft(`IFD0 offset points to outside of file.
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,ly(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,ly(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 i=e.get(t);i&&i.length===1&&e.set(t,i[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",hy(...e.get(2),e.get(1))),e.set("longitude",hy(...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,i,s={};for(t of Ze)if(e=this[t],!vy(e))if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(s,i)}else s[t]=i;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[i,s]of Object.entries(t))this.assignObjectToOutput(e,i,s)}};function hy(r,e,t,i){var s=r+e/60+t/3600;return i!=="S"&&i!=="W"||(s*=-1),s}o(hy,"ne");xe(Kn,"type","tiff"),xe(Kn,"headerLength",10),ir.set("tiff",Kn);var gk=Object.freeze({__proto__:null,default:U2,Exifr:ko,fileParsers:vu,segmentParsers:ir,fileReaders:Zn,tagKeys:ea,tagValues:Sd,tagRevivers:_d,createDictionary:by,extendDictionary:wy,fetchUrlAsArrayBuffer:fu,readBlobAsArrayBuffer:Jn,chunkedProps:Eo,otherSegments:bu,segments:Qn,tiffBlocks:Ze,segmentsAndBlocks:Co,tiffExtractables:To,inheritables:wu,allFormatters:Oo,Options:ws,parse:Sy}),Pd={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},yk=Object.assign({},Pd,{firstChunkSize:4e4,gps:[1,2,3,4]});var vk=Object.assign({},Pd,{tiff:!1,ifd1:!0,mergeOutput:!1});var L2=Object.assign({},Pd,{firstChunkSize:4e4,ifd0:[274]});async function B2(r){let e=new ko(L2);await e.read(r);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}o(B2,"ce");var z2=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}}),Wn=!0,Gn=!0;if(typeof navigator=="object"){let r=navigator.userAgent;if(r.includes("iPad")||r.includes("iPhone")){let e=r.match(/OS (\d+)_(\d+)/);if(e){let[,t,i]=e;Wn=Number(t)+.1*Number(i)<13.4,Gn=!1}}else if(r.includes("OS X 10")){let[,e]=r.match(/OS X 10[_.](\d+)/);Wn=Gn=Number(e)<15}if(r.includes("Chrome/")){let[,e]=r.match(/Chrome\/(\d+)/);Wn=Gn=Number(e)<81}else if(r.includes("Firefox/")){let[,e]=r.match(/Firefox\/(\d+)/);Wn=Gn=Number(e)<77}}async function _y(r){let e=await B2(r);return Object.assign({canvas:Wn,css:Gn},z2[e])}o(_y,"ye");var vd=class extends bs{static{o(this,"be")}constructor(...e){super(...e),xe(this,"ranges",new bd),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(e===0&&this.byteLength===0&&i){let s=new DataView(i.buffer||i,i.byteOffset,i.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=yy?gy.allocUnsafe(e):new Uint8Array(e);let i=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:i}}subarray(e,t,i=!1){return t=t||this._lengthToEnd(e),i&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,i=!1){i&&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)}},bd=class{static{o(this,"we")}constructor(){xe(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let s=e+t,n=this.list.filter(a=>fy(e,a.offset,s)||fy(e,a.end,s));if(n.length>0){e=Math.min(e,...n.map(l=>l.offset)),s=Math.max(s,...n.map(l=>l.end)),t=s-e;let a=n.shift();a.offset=e,a.length=t,a.end=s,this.list=this.list.filter(l=>!n.includes(l))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let i=e+t;return this.list.some(s=>s.offset<=e&&i<=s.end)}};function fy(r,e,t){return r<=e&&e<=t}o(fy,"ke");var wd=class extends vd{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,i=await this.readChunk(e,t);return!!i&&i.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(){}};Zn.set("blob",class extends wd{async readWhole(){this.chunked=!1;let r=await Jn(this.input);this._swapArrayBuffer(r)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(r,e){let t=e?r+e:void 0,i=this.input.slice(r,t),s=await Jn(i);return this.set(s,r,!0)}});var Py={strings:{generatingThumbnails:"Generating thumbnails..."}};var j2={version:"4.1.1"};function H2(r,e,t){try{r.getContext("2d").getImageData(0,0,1,1)}catch(i){if(i.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return r.toBlob?new Promise(i=>{r.toBlob(i,e,t)}).then(i=>{if(i===null)throw new Error("cannot read image, probably an svg with external resources");return i}):Promise.resolve().then(()=>ny(r.toDataURL(e,t),{})).then(i=>{if(i===null)throw new Error("could not extract blob, probably an old browser");return i})}o(H2,"canvasToBlob");function $2(r,e){let t=r.width,i=r.height;(e.deg===90||e.deg===270)&&(t=r.height,i=r.width);let s=document.createElement("canvas");s.width=t,s.height=i;let n=s.getContext("2d");return n.translate(t/2,i/2),e.canvas&&(n.rotate(e.rad),n.scale(e.scaleX,e.scaleY)),n.drawImage(r,-r.width/2,-r.height/2,r.width,r.height),s}o($2,"rotateImage");function q2(r){let e=r.width/r.height,t=5e6,i=4096,s=Math.floor(Math.sqrt(t*e)),n=Math.floor(t/Math.sqrt(t*e));if(s>i&&(s=i,n=Math.round(s/e)),n>i&&(n=i,s=Math.round(e*n)),r.width>s){let a=document.createElement("canvas");return a.width=s,a.height=n,a.getContext("2d").drawImage(r,0,0,s,n),a}return r}o(q2,"protect");var V2={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},Yi=class extends se{static{o(this,"ThumbnailGenerator")}constructor(e,t){if(super(e,{...V2,...t}),this.onFileAdded=i=>{!i.preview&&i.data&&hu(i.type)&&!i.isRemote&&this.addToQueue(i.id)},this.onCancelRequest=i=>{let s=this.queue.indexOf(i.id);s!==-1&&this.queue.splice(s,1)},this.onFileRemoved=i=>{let s=this.queue.indexOf(i.id);s!==-1&&this.queue.splice(s,1),i.preview&&pu(i.preview)&&URL.revokeObjectURL(i.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(s=>s.isRestored).forEach(s=>{(!s.preview||pu(s.preview))&&this.addToQueue(s.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=i=>{i.forEach(n=>{let a=this.uppy.getFile(n);this.uppy.emit("preprocess-progress",a,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let s=o(()=>{i.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=Py,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,i){let s=URL.createObjectURL(e.data),n=new Promise((l,u)=>{let d=new Image;d.src=s,d.addEventListener("load",()=>{URL.revokeObjectURL(s),l(d)}),d.addEventListener("error",p=>{URL.revokeObjectURL(s),u(p.error||new Error("Could not create thumbnail"))})}),a=_y(e.data).catch(()=>1);return Promise.all([n,a]).then(l=>{let[u,d]=l,p=this.getProportionalDimensions(u,t,i,d.deg),f=$2(u,d),y=this.resizeImage(f,p.width,p.height);return H2(y,this.thumbnailType,80)}).then(l=>URL.createObjectURL(l))}getProportionalDimensions(e,t,i,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)}:i!=null?{width:Math.round(i*n),height:i}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,i){let s=q2(e),n=Math.ceil(Math.log2(s.width/t));n<1&&(n=1);let a=t*2**(n-1),l=i*2**(n-1),u=2;for(;n--;){let d=document.createElement("canvas");d.width=a,d.height=l,d.getContext("2d").drawImage(s,0,0,a,l),s=d,a=Math.round(a/u),l=Math.round(l/u)}return s}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return hu(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)}};Yi.VERSION=j2.version;function W2(r){if(typeof r=="string"){let e=document.querySelectorAll(r);return e.length===0?null:Array.from(e)}return typeof r=="object"&&On(r)?[r]:null}o(W2,"findAllDOMElements");var xd=W2;var et=Array.from;function Su(r,e,t,i){let{onSuccess:s}=i;r.readEntries(n=>{let a=[...e,...n];n.length?queueMicrotask(()=>{Su(r,a,t,{onSuccess:s})}):s(a)},n=>{t(n),s(e)})}o(Su,"getFilesAndDirectoriesFromDirectory");function xy(r,e){return r==null?r:{kind:r.isFile?"file":r.isDirectory?"directory":void 0,name:r.name,getFile(){return new Promise((t,i)=>r.file(t,i))},async*values(){let t=r.createReader();yield*await new Promise(s=>{Su(t,[],e,{onSuccess:o(n=>s(n.map(a=>xy(a,e))),"onSuccess")})})},isSameEntry:void 0}}o(xy,"getAsFileSystemHandleFromEntry");function Fy(r,e,t){try{return t===void 0&&(t=void 0),async function*(){let i=o(()=>`${e}/${r.name}`,"getNextRelativePath");if(r.kind==="file"){let s=await r.getFile();s!=null?(s.relativePath=e?i():null,yield s):t!=null&&(yield t)}else if(r.kind==="directory")for await(let s of r.values())yield*Fy(s,e?i():r.name);else t!=null&&(yield t)}()}catch(i){return Promise.reject(i)}}o(Fy,"createPromiseToAddFileOrParseDirectory");async function*Fd(r,e){let t=await Promise.all(Array.from(r.items,async i=>{var s;let n,a=o(()=>typeof i.getAsEntry=="function"?i.getAsEntry():i.webkitGetAsEntry(),"getAsEntry");return(s=n)!=null||(n=xy(a(),e)),{fileSystemHandle:n,lastResortFile:i.getAsFile()}}));for(let{lastResortFile:i,fileSystemHandle:s}of t)if(s!=null)try{yield*Fy(s,"",i)}catch(n){i!=null?yield i:e(n)}else i!=null&&(yield i)}o(Fd,"getFilesFromDataTransfer");function Ed(r){let e=et(r.files);return Promise.resolve(e)}o(Ed,"fallbackApi");async function Ss(r,e){var t;let i=(t=e?.logDropError)!=null?t:Function.prototype;try{let s=[];for await(let n of Fd(r,i))s.push(n);return s}catch{return Ed(r)}}o(Ss,"getDroppedFiles");var Ey=Number.isNaN||o(function(e){return typeof e=="number"&&e!==e},"ponyfill");function G2(r,e){return!!(r===e||Ey(r)&&Ey(e))}o(G2,"isEqual");function K2(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(!G2(r[t],e[t]))return!1;return!0}o(K2,"areInputsEqual");function Cd(r,e){e===void 0&&(e=K2);var t=null;function i(){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=r.apply(this,s);return t={lastResult:a,lastArgs:s,lastThis:this},a}return o(i,"memoized"),i.clear=o(function(){t=null},"clear"),i}o(Cd,"memoizeOne");var _u=['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 ta(r,e){if(e){let t=r.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return r}o(ta,"getActiveOverlayEl");function Cy(r,e){let t=e[0];t&&(t.focus(),r.preventDefault())}o(Cy,"focusOnFirstNode");function X2(r,e){let t=e[e.length-1];t&&(t.focus(),r.preventDefault())}o(X2,"focusOnLastNode");function Y2(r){return r.contains(document.activeElement)}o(Y2,"isFocusInOverlay");function Td(r,e,t){let i=ta(t,e),s=et(i.querySelectorAll(_u)),n=s.indexOf(document.activeElement);Y2(i)?r.shiftKey&&n===0?X2(r,s):!r.shiftKey&&n===s.length-1&&Cy(r,s):Cy(r,s)}o(Td,"trapFocus");function Ty(r,e,t){e===null||Td(r,e,t)}o(Ty,"forInline");var Oy=be(nc(),1);function Od(){let r=!1;return(0,Oy.default)(o((t,i)=>{let s=ta(t,i),n=s.contains(document.activeElement);if(n&&r)return;let a=s.querySelector("[data-uppy-super-focusable]");if(!(n&&!a))if(a)a.focus({preventScroll:!0}),r=!0;else{let l=s.querySelector(_u);l?.focus({preventScroll:!0}),r=!1}},"superFocus"),260)}o(Od,"createSuperFocus");var Gy=be(It(),1);function ra(){let r=document.body;return!(!("draggable"in r)||!("ondragstart"in r&&"ondrop"in r)||!("FormData"in window)||!("FileReader"in window))}o(ra,"isDragDropSupported");var Uy=be(It(),1);function ky(r,e){if(r===e)return!0;if(!r||!e)return!1;let t=Object.keys(r),i=Object.keys(e),s=t.length;if(i.length!==s)return!1;for(let n=0;n<s;n++){let a=t[n];if(r[a]!==e[a]||!Object.prototype.hasOwnProperty.call(e,a))return!1}return!0}o(ky,"shallowEqualObjects");function Q2(){return c("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},c("g",{fill:"#686DE0",fillRule:"evenodd"},c("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),c("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),c("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}o(Q2,"iconImage");function Z2(){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(Z2,"iconAudio");function e_(){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(e_,"iconVideo");function t_(){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(t_,"iconPDF");function r_(){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(r_,"iconArchive");function i_(){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(i_,"iconFile");function s_(){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(s_,"iconText");function _s(r){let e={color:"#838999",icon:i_()};if(!r)return e;let t=r.split("/")[0],i=r.split("/")[1];return t==="text"?{color:"#5a5e69",icon:s_()}:t==="image"?{color:"#686de0",icon:Q2()}:t==="audio"?{color:"#068dbb",icon:Z2()}:t==="video"?{color:"#19af67",icon:e_()}:t==="application"&&i==="pdf"?{color:"#e25149",icon:t_()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(i)!==-1?{color:"#00C469",icon:r_()}:e}o(_s,"getIconByMime");function ia(r){let{file:e}=r;if(e.preview)return c("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:i}=_s(e.type);return c("div",{className:"uppy-Dashboard-Item-previewIconWrap"},c("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},i),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(ia,"FilePreview");var o_=o((r,e)=>(typeof e=="function"?e():e).filter(s=>s.id===r)[0].name,"metaFieldIdToName");function sa(r){let{file:e,toggleFileCard:t,i18n:i,metaFields:s}=r,{missingRequiredMetaFields:n}=e;if(!(n!=null&&n.length))return null;let a=n.map(l=>o_(l,s)).join(", ");return c("div",{className:"uppy-Dashboard-Item-errorMessage"},i("missingRequiredMetaFields",{smart_count:n.length,fields:a})," ",c("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:o(()=>t(!0,e.id),"onClick")},i("editFile")))}o(sa,"MetaErrorMessage");function kd(r){let{file:e,i18n:t,toggleFileCard:i,metaFields:s,showLinkToFileUploadResult:n}=r,l=e.preview?"rgba(255, 255, 255, 0.5)":_s(e.type).color;return c("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:l}},n&&e.uploadURL&&c("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},c("span",{hidden:!0},e.meta.name)),c(ia,{file:e}),c(sa,{file:e,i18n:t,toggleFileCard:i,metaFields:s}))}o(kd,"FilePreviewAndLink");function n_(r){if(!r.isUploaded){if(r.error&&!r.hideRetryButton){r.uppy.retryUpload(r.file.id);return}r.resumableUploads&&!r.hidePauseResumeButton?r.uppy.pauseResume(r.file.id):r.individualCancellation&&!r.hideCancelButton&&r.uppy.removeFile(r.file.id)}}o(n_,"onPauseResumeCancelRetry");function Ay(r){return r.isUploaded?r.i18n("uploadComplete"):r.error?r.i18n("retryUpload"):r.resumableUploads?r.file.isPaused?r.i18n("resumeUpload"):r.i18n("pauseUpload"):r.individualCancellation?r.i18n("cancelUpload"):""}o(Ay,"progressIndicatorTitle");function Ad(r){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":Ay(r),title:Ay(r),onClick:o(()=>n_(r),"onClick")},r.children))}o(Ad,"ProgressIndicatorButton");function Pu(r){let{children:e}=r;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(Pu,"ProgressCircleContainer");function Rd(r){let{progress:e}=r,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(Rd,"ProgressCircle");function Ud(r){return!r.file.progress.uploadStarted||r.file.progress.percentage===void 0?null:r.isUploaded?c("div",{className:"uppy-Dashboard-Item-progress"},c("div",{className:"uppy-Dashboard-Item-progressIndicator"},c(Pu,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"})))):r.recoveredState?null:r.error&&!r.hideRetryButton?c(Ad,r,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"}))):r.resumableUploads&&!r.hidePauseResumeButton?c(Ad,r,c(Pu,null,c(Rd,{progress:r.file.progress.percentage}),r.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"})))):!r.resumableUploads&&r.individualCancellation&&!r.hideCancelButton?c(Ad,r,c(Pu,null,c(Rd,{progress:r.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(Pu,null,c(Rd,{progress:r.file.progress.percentage}))))}o(Ud,"FileProgress");var Ry=be(hn(),1);var Id="...";function xu(r,e){if(e===0)return"";if(r.length<=e)return r;if(e<=Id.length+1)return`${r.slice(0,e-1)}\u2026`;let t=e-Id.length,i=Math.ceil(t/2),s=Math.floor(t/2);return r.slice(0,i)+Id+r.slice(-s)}o(xu,"truncateString");var a_=o(r=>{let{author:e,name:t}=r.file.meta;function i(){return r.isSingleFile&&r.containerHeight>=350?90:r.containerWidth<=352?35:r.containerWidth<=576?60:e?20:30}return o(i,"getMaxNameLength"),c("div",{className:"uppy-Dashboard-Item-name",title:t},xu(t,i()))},"renderFileName"),l_=o(r=>{var e;let{author:t}=r.file.meta,i=(e=r.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"},xu(t.name,13)),i?c(Fragment,null,` ${s} `,i,` ${s} `):null):null},"renderAuthor"),u_=o(r=>r.file.size&&c("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Ry.default)(r.file.size)),"renderFileSize"),c_=o(r=>r.file.isGhost&&c("span",null," \u2022 ",c("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:o(()=>r.toggleAddFilesPanel(!0),"onClick")},r.i18n("reSelect"))),"ReSelectButton"),d_=o(r=>{let{file:e,onClick:t}=r;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 Dd(r){let{file:e,i18n:t,toggleFileCard:i,metaFields:s,toggleAddFilesPanel:n,isSingleFile:a,containerHeight:l,containerWidth:u}=r;return c("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},c("div",{className:"uppy-Dashboard-Item-fileName"},a_({file:e,isSingleFile:a,containerHeight:l,containerWidth:u}),c(d_,{file:e,onClick:o(()=>alert(e.error),"onClick")})),c("div",{className:"uppy-Dashboard-Item-status"},l_({file:e}),u_({file:e}),c_({file:e,toggleAddFilesPanel:n,i18n:t})),c(sa,{file:e,i18n:t,toggleFileCard:i,metaFields:s}))}o(Dd,"FileInfo");function Nd(r,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let i=document.createElement("textarea");i.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),i.value=r,document.body.appendChild(i),i.select();let s=o(()=>{document.body.removeChild(i),window.prompt(e,r),t()},"magicCopyFailed");try{return document.execCommand("copy")?(document.body.removeChild(i),t()):s()}catch{return document.body.removeChild(i),s()}})}o(Nd,"copyToClipboard");function p_(r){let{file:e,uploadInProgressOrComplete:t,metaFields:i,canEditFile:s,i18n:n,onClick:a}=r;return!t&&i&&i.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:o(()=>a(),"onClick")},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(p_,"EditButton");function h_(r){let{i18n:e,onClick:t,file:i}=r;return c("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:i.meta.name}),title:e("removeFile",{file:i.meta.name}),onClick:o(()=>t(),"onClick")},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(h_,"RemoveButton");function f_(r){let{file:e,uppy:t,i18n:i}=r,s=o(n=>{Nd(e.uploadURL,i("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(i("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>n.target.focus({preventScroll:!0}))},"copyLinkToClipboard");return c("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":i("copyLink"),title:i("copyLink"),onClick:o(n=>s(n),"onClick")},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(f_,"CopyLinkButton");function Md(r){let{uppy:e,file:t,uploadInProgressOrComplete:i,canEditFile:s,metaFields:n,showLinkToFileUploadResult:a,showRemoveButton:l,i18n:u,toggleFileCard:d,openFileEditor:p}=r;return c("div",{className:"uppy-Dashboard-Item-actionWrapper"},c(p_,{i18n:u,file:t,uploadInProgressOrComplete:i,canEditFile:s,metaFields:n,onClick:o(()=>{n&&n.length>0?d(!0,t.id):p(t)},"editAction")}),a&&t.uploadURL?c(f_,{file:t,uppy:e,i18n:u}):null,l?c(h_,{i18n:u,file:t,onClick:o(()=>e.removeFile(t.id),"onClick")}):null)}o(Md,"Buttons");var oa=class extends we{static{o(this,"FileItem")}componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!ky(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,i=!!e.progress.uploadComplete&&!t&&!e.error,s=!!e.progress.uploadStarted||!!t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,a=e.error||!1,{isGhost:l}=e,u=(this.props.individualCancellation||!n)&&!i;i&&this.props.showRemoveButtonAfterComplete&&(u=!0);let d=(0,Uy.default)({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!a,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":l});return c("div",{className:d,id:`uppy_${e.id}`,role:this.props.role},c("div",{className:"uppy-Dashboard-Item-preview"},c(kd,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),c(Ud,{uppy:this.props.uppy,file:e,error:a,isUploaded:i,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),c("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},c(Dd,{file:e,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(Md,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:u,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function m_(r,e){let t=[],i=[];return r.forEach(s=>{i.length<e?i.push(s):(t.push(i),i=[s])}),i.length&&t.push(i),t}o(m_,"chunks");function Ld(r){let{id:e,i18n:t,uppy:i,files:s,resumableUploads:n,hideRetryButton:a,hidePauseResumeButton:l,hideCancelButton:u,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:p,metaFields:f,isSingleFile:y,toggleFileCard:v,handleRequestThumbnail:_,handleCancelThumbnail:R,recoveredState:E,individualCancellation:O,itemsPerRow:L,openFileEditor:B,canEditFile:G,toggleAddFilesPanel:J,containerWidth:$,containerHeight:W}=r,te=L===1?71:200,ae=Gi(()=>{let Ae=o((Fe,Re)=>Number(s[Re].isGhost)-Number(s[Fe].isGhost),"sortByGhostComesFirst"),qe=Object.keys(s);return E&&qe.sort(Ae),m_(qe,L)},[s,L,E]),ke=o(Ae=>c("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:Ae[0]},Ae.map(qe=>c(oa,{key:qe,uppy:i,id:e,i18n:t,resumableUploads:n,individualCancellation:O,hideRetryButton:a,hidePauseResumeButton:l,hideCancelButton:u,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:p,metaFields:f,recoveredState:E,isSingleFile:y,containerWidth:$,containerHeight:W,toggleFileCard:v,handleRequestThumbnail:_,handleCancelThumbnail:R,role:"listitem",openFileEditor:B,canEditFile:G,toggleAddFilesPanel:J,file:s[qe]}))),"renderRow");return y?c("div",{class:"uppy-Dashboard-files"},ke(ae[0])):c(Yl,{class:"uppy-Dashboard-files",role:"list",data:ae,renderRow:ke,rowHeight:te})}o(Ld,"FileList");var Bd=class extends we{static{o(this,"AddFiles")}constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var i;return 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:(i=this.props.allowedFileTypes)==null?void 0:i.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,i)=>{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:i})},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 i=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":i===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),i=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:i,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:i,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:o(()=>this.props.showPanel(e.id),"onClick")},c("div",{className:"uppy-DashboardTab-inner"},e.icon()),c("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],i=t.splice(e.length-2,e.length);return c(Qe,null,t.map(s=>this.renderAcquirer(s)),c("span",{role:"presentation",style:{"white-space":"nowrap"}},i.map(s=>this.renderAcquirer(s))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:i,showNativeVideoCameraButton:s}=this.props,n=[],a="myDevice";t||n.push({key:a,elements:this.renderMyDeviceAcquirer()}),i&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),s&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map(p=>({key:p.id,elements:this.renderAcquirer(p)}))),n.length===1&&n[0].key===a&&(n=[]);let u=[...n],d=u.splice(n.length-2,n.length);return c(Qe,null,this.renderDropPasteBrowseTagline(n.length),c("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},u.map(p=>{let{key:f,elements:y}=p;return c(Qe,{key:f},y)}),c("span",{role:"presentation",style:{"white-space":"nowrap"}},d.map(p=>{let{key:f,elements:y}=p;return c(Qe,{key:f},y)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){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")),i=e("poweredBy",{uppy:t});return c("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},i)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:i}=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",i,s=>{this.mobilePhotoFileInput=s}),t&&this.renderHiddenCameraInput("video",i,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()))}},Fu=Bd;var Iy=be(It(),1);var g_=o(r=>c("div",{className:(0,Iy.default)("uppy-Dashboard-AddFilesPanel",r.className),"data-uppy-panelType":"AddFiles","aria-hidden":!r.showAddFilesPanel},c("div",{className:"uppy-DashboardContent-bar"},c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r.i18n("addingMoreFiles")),c("button",{className:"uppy-DashboardContent-back",type:"button",onClick:o(()=>r.toggleAddFilesPanel(!1),"onClick")},r.i18n("back"))),c(Fu,r)),"AddFilesPanel"),Dy=g_;var Ny=be(It(),1);function y_(r){let{tagName:e}=r.target;if(e==="INPUT"||e==="TEXTAREA"){r.stopPropagation();return}r.preventDefault(),r.stopPropagation()}o(y_,"ignoreEvent");var jr=y_;function v_(r){let{activePickerPanel:e,className:t,hideAllPanels:i,i18n:s,state:n,uppy:a}=r,l=Gt(null);return c("div",{className:(0,Ny.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:jr,onDragLeave:jr,onDrop:jr,onPaste:jr},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:i},s("cancel"))),c("div",{ref:l,className:"uppy-DashboardContent-panelBody"},a.getPlugin(e.id).render(n,l.current)))}o(v_,"PickerPanelContent");var My=v_;var Ly=be(It(),1);function b_(r){let e=r.files[r.fileCardFor],t=o(()=>{r.uppy.emit("file-editor:cancel",e),r.closeFileEditor()},"handleCancel");return c("div",{className:(0,Ly.default)("uppy-DashboardContent-panel",r.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"},r.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},r.i18n("cancel")),c("button",{className:"uppy-DashboardContent-save",type:"button",onClick:r.saveFileEditor},r.i18n("save"))),c("div",{className:"uppy-DashboardContent-panelBody"},r.editors.map(i=>r.uppy.getPlugin(i.id).render(r.state))))}o(b_,"EditorPanel");var By=b_;var Hr={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function w_(r,e,t,i){if(i===void 0&&(i={}),r)return Hr.STATE_ERROR;if(e)return Hr.STATE_COMPLETE;if(t)return Hr.STATE_PAUSED;let s=Hr.STATE_WAITING,n=Object.keys(i);for(let a=0;a<n.length;a++){let{progress:l}=i[n[a]];if(l.uploadStarted&&!l.uploadComplete)return Hr.STATE_UPLOADING;l.preprocess&&s!==Hr.STATE_UPLOADING&&(s=Hr.STATE_PREPROCESSING),l.postprocess&&s!==Hr.STATE_UPLOADING&&s!==Hr.STATE_PREPROCESSING&&(s=Hr.STATE_POSTPROCESSING)}return s}o(w_,"getUploadingState");function S_(r){let{files:e,i18n:t,isAllComplete:i,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:a,newFiles:l,processingFiles:u}=r;switch(w_(s,i,n,e)){case"uploading":return t("uploadingXFiles",{smart_count:a.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:u.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:l.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}o(S_,"UploadStatus");function __(r){let{i18n:e,isAllComplete:t,hideCancelButton:i,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:a}=r,{allowNewUpload:l}=r;return l&&s&&(l=r.totalFileCount<r.maxNumberOfFiles),c("div",{className:"uppy-DashboardContent-bar"},!t&&!i?c("button",{className:"uppy-DashboardContent-back",type:"button",onClick:o(()=>a.cancelAll(),"onClick")},e("cancel")):c("div",null),c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},c(S_,r)),l?c("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:o(()=>n(!0),"onClick")},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(__,"PanelTopBar");var zy=__;var jy=be(It(),1);function zd(r){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:i,form:s,formState:n}=r,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(l=>{let u=`uppy-Dashboard-FileCard-input-${l.id}`,d=t.includes(l.id);return c("fieldset",{key:l.id,className:"uppy-Dashboard-FileCard-fieldset"},c("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:u},l.name),l.render!==void 0?l.render({value:n[l.id],onChange:o(p=>i(p,l.id),"onChange"),fieldCSSClasses:a,required:d,form:s.id},c):c("input",{className:a.text,id:u,form:s.id,type:l.type||"text",required:d,value:n[l.id],placeholder:l.placeholder,onInput:o(p=>i(p.target.value,l.id),"onInput"),"data-uppy-super-focusable":!0}))})}o(zd,"RenderMetaFields");function jd(r){var e;let{files:t,fileCardFor:i,toggleFileCard:s,saveFileCard:n,metaFields:a,requiredMetaFields:l,openFileEditor:u,i18n:d,i18nArray:p,className:f,canEditFile:y}=r,v=o(()=>typeof a=="function"?a(t[i]):a,"getMetaFields"),_=t[i],R=(e=v())!=null?e:[],E=y(_),O={};R.forEach(te=>{var ae;O[te.id]=(ae=_.meta[te.id])!=null?ae:""});let[L,B]=Wt(O),G=gr(te=>{te.preventDefault(),n(L,i)},[n,L,i]),J=o((te,ae)=>{B({...L,[ae]:te})},"updateMeta"),$=o(()=>{s(!1)},"handleCancel"),[W]=Wt(()=>{let te=document.createElement("form");return te.setAttribute("tabindex","-1"),te.id=mr(),te});return pt(()=>(document.body.appendChild(W),W.addEventListener("submit",G),()=>{W.removeEventListener("submit",G),document.body.removeChild(W)}),[W,G]),c("div",{className:(0,jy.default)("uppy-Dashboard-FileCard",f),"data-uppy-panelType":"FileCard",onDragOver:jr,onDragLeave:jr,onDrop:jr,onPaste:jr},c("div",{className:"uppy-DashboardContent-bar"},c("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},p("editing",{file:c("span",{className:"uppy-DashboardContent-titleFile"},_.meta?_.meta.name:_.name)})),c("button",{className:"uppy-DashboardContent-back",type:"button",form:W.id,title:d("finishEditingFile"),onClick:$},d("cancel"))),c("div",{className:"uppy-Dashboard-FileCard-inner"},c("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:_s(_.type).color}},c(ia,{file:_}),E&&c("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:o(te=>{G(te),u(_)},"onClick")},d("editImage"))),c("div",{className:"uppy-Dashboard-FileCard-info"},c(zd,{computedMetaFields:R,requiredMetaFields:l,updateMeta:J,form:W,formState:L})),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},d("saveChanges")),c("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:$,form:W.id},d("cancel")))))}o(jd,"FileCard");var $y=be(It(),1);var Ao="uppy-transition-slideDownUp",Hy=250;function P_(r){let{children:e}=r,[t,i]=Wt(null),[s,n]=Wt(""),a=Gt(),l=Gt(),u=Gt(),d=o(()=>{n(`${Ao}-enter`),cancelAnimationFrame(u.current),clearTimeout(l.current),l.current=void 0,u.current=requestAnimationFrame(()=>{n(`${Ao}-enter ${Ao}-enter-active`),a.current=setTimeout(()=>{n("")},Hy)})},"handleEnterTransition"),p=o(()=>{n(`${Ao}-leave`),cancelAnimationFrame(u.current),clearTimeout(a.current),a.current=void 0,u.current=requestAnimationFrame(()=>{n(`${Ao}-leave ${Ao}-leave-active`),l.current=setTimeout(()=>{i(null),n("")},Hy)})},"handleLeaveTransition");return pt(()=>{let f=Vt(e)[0];t!==f&&(f&&!t?d():t&&!f&&!l.current&&p(),i(f))},[e,t]),pt(()=>()=>{clearTimeout(a.current),clearTimeout(l.current),cancelAnimationFrame(u.current)},[]),t?Cn(t,{className:(0,$y.default)(s,t.props.className)}):null}o(P_,"Slide");var na=P_;function Ro(){return Ro=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},Ro.apply(null,arguments)}o(Ro,"_extends");var qy=900,Vy=700,Hd=576,Wy=330;function $d(r){let e=r.totalFileCount===0,t=r.totalFileCount===1,i=r.containerWidth>Hd,s=r.containerHeight>Wy,n=(0,Gy.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":r.disabled,"uppy-Dashboard--animateOpenClose":r.animateOpenClose,"uppy-Dashboard--isClosing":r.isClosing,"uppy-Dashboard--isDraggingOver":r.isDraggingOver,"uppy-Dashboard--modal":!r.inline,"uppy-size--md":r.containerWidth>Hd,"uppy-size--lg":r.containerWidth>Vy,"uppy-size--xl":r.containerWidth>qy,"uppy-size--height-md":r.containerHeight>Wy,"uppy-Dashboard--isAddFilesPanelVisible":r.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":r.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":r.singleFileFullScreen&&t&&s}),a=1;r.containerWidth>qy?a=5:r.containerWidth>Vy?a=4:r.containerWidth>Hd&&(a=3);let l=r.showSelectedFiles&&!e,u=r.recoveredState?Object.keys(r.recoveredState.files).length:null,d=r.files?Object.keys(r.files).filter(y=>r.files[y].isGhost).length:0,p=o(()=>d>0?r.i18n("recoveredXFiles",{smart_count:d}):r.i18n("recoveredAllFiles"),"renderRestoredText");return c("div",{className:n,"data-uppy-theme":r.theme,"data-uppy-num-acquirers":r.acquirers.length,"data-uppy-drag-drop-supported":!r.disableLocalFiles&&ra(),"aria-hidden":r.inline?"false":r.isHidden,"aria-disabled":r.disabled,"aria-label":r.inline?r.i18n("dashboardTitle"):r.i18n("dashboardWindowTitle"),onPaste:r.handlePaste,onDragOver:r.handleDragOver,onDragLeave:r.handleDragLeave,onDrop:r.handleDrop},c("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:r.handleClickOutside}),c("div",{className:"uppy-Dashboard-inner","aria-modal":!r.inline&&"true",role:r.inline?void 0:"dialog",style:{width:r.inline&&r.width?r.width:"",height:r.inline&&r.height?r.height:""}},r.inline?null:c("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":r.i18n("closeModal"),title:r.i18n("closeModal"),onClick:r.closeModal},c("span",{"aria-hidden":"true"},"\xD7")),c("div",{className:"uppy-Dashboard-innerWrap"},c("div",{className:"uppy-Dashboard-dropFilesHereHint"},r.i18n("dropHint")),l&&c(zy,r),u&&c("div",{className:"uppy-Dashboard-serviceMsg"},c("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},c("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},c("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),c("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),c("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),c("strong",{className:"uppy-Dashboard-serviceMsg-title"},r.i18n("sessionRestored")),c("div",{className:"uppy-Dashboard-serviceMsg-text"},p())),l?c(Ld,{id:r.id,i18n:r.i18n,uppy:r.uppy,files:r.files,resumableUploads:r.resumableUploads,hideRetryButton:r.hideRetryButton,hidePauseResumeButton:r.hidePauseResumeButton,hideCancelButton:r.hideCancelButton,showLinkToFileUploadResult:r.showLinkToFileUploadResult,showRemoveButtonAfterComplete:r.showRemoveButtonAfterComplete,metaFields:r.metaFields,toggleFileCard:r.toggleFileCard,handleRequestThumbnail:r.handleRequestThumbnail,handleCancelThumbnail:r.handleCancelThumbnail,recoveredState:r.recoveredState,individualCancellation:r.individualCancellation,openFileEditor:r.openFileEditor,canEditFile:r.canEditFile,toggleAddFilesPanel:r.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:a,containerWidth:r.containerWidth,containerHeight:r.containerHeight}):c(Fu,{i18n:r.i18n,i18nArray:r.i18nArray,acquirers:r.acquirers,handleInputChange:r.handleInputChange,maxNumberOfFiles:r.maxNumberOfFiles,allowedFileTypes:r.allowedFileTypes,showNativePhotoCameraButton:r.showNativePhotoCameraButton,showNativeVideoCameraButton:r.showNativeVideoCameraButton,nativeCameraFacingMode:r.nativeCameraFacingMode,showPanel:r.showPanel,activePickerPanel:r.activePickerPanel,disableLocalFiles:r.disableLocalFiles,fileManagerSelectionType:r.fileManagerSelectionType,note:r.note,proudlyDisplayPoweredByUppy:r.proudlyDisplayPoweredByUppy}),c(na,null,r.showAddFilesPanel?c(Dy,Ro({key:"AddFiles"},r,{isSizeMD:i})):null),c(na,null,r.fileCardFor?c(jd,Ro({key:"FileCard"},r)):null),c(na,null,r.activePickerPanel?c(My,Ro({key:"Picker"},r)):null),c(na,null,r.showFileEditor?c(By,Ro({key:"Editor"},r)):null),c("div",{className:"uppy-Dashboard-progressindicators"},r.progressindicators.map(y=>r.uppy.getPlugin(y.id).render(r.state))))))}o($d,"Dashboard");var Ky={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 ye(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(ye,"_classPrivateFieldLooseBase");var x_=0;function bt(r){return"__private_"+x_+++"_"+r}o(bt,"_classPrivateFieldLooseKey");var F_={version:"4.3.4"},qd=Cd.default||Cd,Xy=9,E_=27;function Yy(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}o(Yy,"createPromise");var C_={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Po,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:o(()=>{},"onDragLeave"),onDragOver:o(()=>{},"onDragOver"),onDrop:o(()=>{},"onDrop"),plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550},Ps=bt("disabledNodes"),di=bt("generateLargeThumbnailIfSingleFile"),aa=bt("openFileEditorWhenFilesAdded"),xs=bt("attachRenderFunctionToTarget"),Vd=bt("isTargetSupported"),Wd=bt("getAcquirers"),Gd=bt("getProgressIndicators"),pi=bt("getEditors"),Kd=bt("addSpecifiedPluginsFromOptions"),Xd=bt("autoDiscoverPlugins"),Fs=bt("addSupportedPluginIfNoTarget"),la=bt("getStatusBarOpts"),ua=bt("getThumbnailGeneratorOpts"),Yd=bt("getInformerOpts"),ca=bt("getStatusBarId"),da=bt("getThumbnailGeneratorId"),Jd=bt("getInformerId"),Es=class extends se{static{o(this,"Dashboard")}constructor(e,t){var i,s,n;let a=(i=t?.autoOpen)!=null?i:null;super(e,{...C_,...t,autoOpen:a}),Object.defineProperty(this,Jd,{value:U_}),Object.defineProperty(this,da,{value:R_}),Object.defineProperty(this,ca,{value:A_}),Object.defineProperty(this,Yd,{value:k_}),Object.defineProperty(this,ua,{value:O_}),Object.defineProperty(this,la,{value:T_}),Object.defineProperty(this,Ps,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${mr()}`,this.superFocus=Od(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=l=>{let d=this.getPluginState().targets.filter(p=>p.id!==l.id);this.setPluginState({targets:d})},this.addTarget=l=>{let u=l.id||l.constructor.name,d=l.title||u,p=l.type;if(p!=="acquirer"&&p!=="progressindicator"&&p!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let f={id:u,name:d,type:p},v=this.getPluginState().targets.slice();return v.push(f),this.setPluginState({targets:v}),this.el},this.hideAllPanels=()=>{var l;let u=this.getPluginState(),d={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};u.activePickerPanel===d.activePickerPanel&&u.showAddFilesPanel===d.showAddFilesPanel&&u.showFileEditor===d.showFileEditor&&u.activeOverlayType===d.activeOverlayType||(this.setPluginState(d),this.uppy.emit("dashboard:close-panel",(l=u.activePickerPanel)==null?void 0:l.id))},this.showPanel=l=>{let{targets:u}=this.getPluginState(),d=u.find(p=>p.type==="acquirer"&&p.id===l);this.setPluginState({activePickerPanel:d,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",l)},this.canEditFile=l=>{let{targets:u}=this.getPluginState();return ye(this,pi)[pi](u).some(p=>this.uppy.getPlugin(p.id).canEditFile(l))},this.openFileEditor=l=>{let{targets:u}=this.getPluginState(),d=ye(this,pi)[pi](u);this.setPluginState({showFileEditor:!0,fileCardFor:l.id||null,activeOverlayType:"FileEditor"}),d.forEach(p=>{this.uppy.getPlugin(p.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();ye(this,pi)[pi](l).forEach(d=>{this.uppy.getPlugin(d.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:l,resolve:u}=Yy();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),u()},"handler");this.el.addEventListener("animationend",d,!1)}else this.setPluginState({isHidden:!1}),u();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),l},this.closeModal=l=>{var u;let d=(u=l?.manualClose)!=null?u:!0,{isHidden:p,isClosing:f}=this.getPluginState();if(p||f)return;let{promise:y,resolve:v}=Yy();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let R=o(()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",R,!1),v()},"handler");this.el.addEventListener("animationend",R,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),v();if(document.removeEventListener("keydown",this.handleKeyDownInModal),d&&this.opts.browserBackButtonClose){var _;(_=history.state)!=null&&_[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),y},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=l=>{let{capabilities:u}=this.uppy.getState();this.uppy.setState({capabilities:{...u,darkMode:l}})},this.handleSystemDarkModeChange=l=>{let u=l.matches;this.uppy.log(`[Dashboard] Dark mode is ${u?"on":"off"}`),this.setDarkModeCapability(u)},this.toggleFileCard=(l,u)=>{let d=this.uppy.getFile(u);l?this.uppy.emit("dashboard:file-edit-start",d):this.uppy.emit("dashboard:file-edit-complete",d),this.setPluginState({fileCardFor:l?u:null,activeOverlayType:l?"FileCard":null})},this.toggleAddFilesPanel=l=>{this.setPluginState({showAddFilesPanel:l,activeOverlayType:l?"AddFiles":null})},this.addFiles=l=>{let u=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(u)}catch(d){this.uppy.log(d)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(l=>{let u=l[0],{width:d,height:p}=u.contentRect;this.setPluginState({containerWidth:d,containerHeight:p,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let l=this.getPluginState(),u=!this.opts.inline&&l.isHidden;!l.areInsidesReadyToBeVisible&&!u&&(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 u;let d=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],p=(u=ye(this,Ps)[Ps])!=null?u:et(this.el.querySelectorAll(d)).filter(f=>!f.classList.contains("uppy-Dashboard-close"));for(let f of p)f.tagName==="A"?f.setAttribute("aria-disabled",l):f.disabled=l;l?ye(this,Ps)[Ps]=p:ye(this,Ps)[Ps]=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 u;this.isModalOpen()&&(!l.state||!l.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(u=l.state)!=null&&u[this.modalName]&&history.back()},this.handleKeyDownInModal=l=>{l.keyCode===E_&&this.requestCloseModal(),l.keyCode===Xy&&Td(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 u=et(l.clipboardData.files);u.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(u))},this.handleInputChange=l=>{l.preventDefault();let u=et(l.currentTarget.files||[]);u.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(u))},this.handleDragOver=l=>{l.preventDefault(),l.stopPropagation();let u=o(()=>{let y=!0;return this.uppy.iteratePlugins(v=>{v.canHandleRootDrop!=null&&v.canHandleRootDrop(l)&&(y=!0)}),y},"canSomePluginHandleRootDrop"),d=o(()=>{let{types:y}=l.dataTransfer;return y.some(v=>v==="Files")},"doesEventHaveFiles"),p=u(),f=d();if(!p&&!f||this.opts.disabled||this.opts.disableLocalFiles&&(f||!p)||!this.uppy.getState().allowNewUpload){l.dataTransfer.dropEffect="none";return}l.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(l)},this.handleDragLeave=l=>{l.preventDefault(),l.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(l)},this.handleDrop=async l=>{l.preventDefault(),l.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(f=>{f.type==="acquirer"&&(f.handleRootDrop==null||f.handleRootDrop(l))});let u=!1,d=o(f=>{this.uppy.log(f,"error"),u||(this.uppy.info(f.message,"error"),u=!0)},"logDropError");this.uppy.log("[Dashboard] Processing dropped files");let p=await Ss(l.dataTransfer,{logDropError:d});p.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(p)),this.opts.onDrop(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===Xy&&Ty(l,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=l=>{this.el.contains(document.activeElement)&&this.handlePaste(l)},this.handleComplete=l=>{let{failed:u}=l;this.opts.closeAfterFinish&&!(u!=null&&u.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,di,{writable:!0,value:o(()=>{if(this.opts.disableThumbnailGenerator)return;let l=600,u=this.uppy.getFiles();if(u.length===1){let d=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);d?.setOptions({thumbnailWidth:l});let p={...u[0],preview:void 0};d?.requestThumbnail(p).then(()=>{d?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}},"value")}),Object.defineProperty(this,aa,{writable:!0,value:o(l=>{let u=l[0],{metaFields:d}=this.getPluginState(),p=d&&d.length>0,f=this.canEditFile(u);p&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,u.id):f&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(u)},"value")}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let l=xd(this.opts.trigger);l?l.forEach(u=>u.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",ye(this,Fs)[Fs]),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",ye(this,di)[di]),this.uppy.on("file-removed",ye(this,di)[di]),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",ye(this,aa)[aa])},this.removeEvents=()=>{let l=xd(this.opts.trigger);!this.opts.inline&&l&&l.forEach(u=>u.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",ye(this,Fs)[Fs]),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",ye(this,di)[di]),this.uppy.off("file-removed",ye(this,di)[di]),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",ye(this,aa)[aa])},this.superFocusOnEachUpdate=()=>{let l=this.el.contains(document.activeElement),u=document.activeElement===document.body||document.activeElement===null,d=this.uppy.getState().info.length===0,p=!this.opts.inline;d&&(p||l||u&&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,u)=>{this.uppy.setFileMeta(u,l),this.toggleFileCard(!1,u)},Object.defineProperty(this,xs,{writable:!0,value:o(l=>{let u=this.uppy.getPlugin(l.id);return{...l,icon:u.icon||this.opts.defaultPickerIcon,render:u.render}},"value")}),Object.defineProperty(this,Vd,{writable:!0,value:o(l=>{let u=this.uppy.getPlugin(l.id);return typeof u.isSupported!="function"?!0:u.isSupported()},"value")}),Object.defineProperty(this,Wd,{writable:!0,value:qd(l=>l.filter(u=>u.type==="acquirer"&&ye(this,Vd)[Vd](u)).map(ye(this,xs)[xs]))}),Object.defineProperty(this,Gd,{writable:!0,value:qd(l=>l.filter(u=>u.type==="progressindicator").map(ye(this,xs)[xs]))}),Object.defineProperty(this,pi,{writable:!0,value:qd(l=>l.filter(u=>u.type==="editor").map(ye(this,xs)[xs]))}),this.render=l=>{let u=this.getPluginState(),{files:d,capabilities:p,allowNewUpload:f}=l,{newFiles:y,uploadStartedFiles:v,completeFiles:_,erroredFiles:R,inProgressFiles:E,inProgressNotPausedFiles:O,processingFiles:L,isUploadStarted:B,isAllComplete:G,isAllPaused:J}=this.uppy.getObjectOfFilesPerState(),$=ye(this,Wd)[Wd](u.targets),W=ye(this,Gd)[Gd](u.targets),te=ye(this,pi)[pi](u.targets),ae;return this.opts.theme==="auto"?ae=p.darkMode?"dark":"light":ae=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}".`)),$d({state:l,isHidden:u.isHidden,files:d,newFiles:y,uploadStartedFiles:v,completeFiles:_,erroredFiles:R,inProgressFiles:E,inProgressNotPausedFiles:O,processingFiles:L,isUploadStarted:B,isAllComplete:G,isAllPaused:J,totalFileCount:Object.keys(d).length,totalProgress:l.totalProgress,allowNewUpload:f,acquirers:$,theme:ae,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:u.activePickerPanel,showFileEditor:u.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:u.isClosing,progressindicators:W,editors:te,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:l.recoveredState,metaFields:u.metaFields,resumableUploads:p.resumableUploads||!1,individualCancellation:p.individualCancellation,isMobileDevice:p.isMobileDevice,fileCardFor:u.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:u.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:u.containerWidth,containerHeight:u.containerHeight,areInsidesReadyToBeVisible:u.areInsidesReadyToBeVisible,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:u.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,Kd,{writable:!0,value:o(()=>{let{plugins:l}=this.opts;l.forEach(u=>{let d=this.uppy.getPlugin(u);d?d.mount(this,d):this.uppy.log(`[Uppy] Dashboard could not find plugin '${u}', make sure to uppy.use() the plugins you are specifying`,"warning")})},"value")}),Object.defineProperty(this,Xd,{writable:!0,value:o(()=>{this.uppy.iteratePlugins(ye(this,Fs)[Fs])},"value")}),Object.defineProperty(this,Fs,{writable:!0,value:o(l=>{var u;let d=["acquirer","editor"];l&&!((u=l.opts)!=null&&u.target)&&d.includes(l.type)&&(this.getPluginState().targets.some(f=>l.id===f.id)||l.mount(this,l))},"value")}),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:u}=this.opts;if(l&&u)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:p}=this.uppy.opts;(d||p)&&u&&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:f}=this.opts;f&&this.mount(f,this),this.opts.disableStatusBar||this.uppy.use(ui,{id:ye(this,ca)[ca](),target:this,...ye(this,la)[la]()}),this.opts.disableInformer||this.uppy.use(ci,{id:ye(this,Jd)[Jd](),target:this,...ye(this,Yd)[Yd]()}),this.opts.disableThumbnailGenerator||this.uppy.use(Yi,{id:ye(this,da)[da](),...ye(this,ua)[ua]()}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let y=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${y?"on":"off"}`),this.setDarkModeCapability(y),this.opts.theme==="auto"){var v;(v=this.darkModeMediaQuery)==null||v.addListener(this.handleSystemDarkModeChange)}ye(this,Kd)[Kd](),ye(this,Xd)[Xd](),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)}let{plugins:l}=this.opts;if(l.forEach(d=>{let p=this.uppy.getPlugin(d);p&&p.unmount()}),this.opts.theme==="auto"){var u;(u=this.darkModeMediaQuery)==null||u.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=Ky,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(n=(s=this.opts).onRequestCloseModal)!=null||(s.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,i;super.setOptions(e),(t=this.uppy.getPlugin(ye(this,ca)[ca]()))==null||t.setOptions(ye(this,la)[la]()),(i=this.uppy.getPlugin(ye(this,da)[da]()))==null||i.setOptions(ye(this,ua)[ua]())}};function T_(){let{hideUploadButton:r,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:i,showProgressDetails:s,hideProgressAfterFinish:n,locale:a,doneButtonHandler:l}=this.opts;return{hideUploadButton:r,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:i,showProgressDetails:s,hideAfterFinish:n,locale:a,doneButtonHandler:l}}o(T_,"_getStatusBarOpts2");function O_(){let{thumbnailWidth:r,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:i}=this.opts;return{thumbnailWidth:r,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:i,lazy:!i}}o(O_,"_getThumbnailGeneratorOpts2");function k_(){return{}}o(k_,"_getInformerOpts2");function A_(){return`${this.id}:StatusBar`}o(A_,"_getStatusBarId2");function R_(){return`${this.id}:ThumbnailGenerator`}o(R_,"_getThumbnailGeneratorId2");function U_(){return`${this.id}:Informer`}o(U_,"_getInformerId2");Es.VERSION=F_.version;var Jy={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var I_={version:"4.1.3"},D_={inputName:"files[]",width:"100%",height:"100%"},Cs=class r extends se{static{o(this,"DragDrop")}constructor(e,t){super(e,{...D_,...t}),this.isDragDropSupported=ra(),this.addFiles=i=>{let s=i.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=i=>{let s=et(i.currentTarget.files||[]);s.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(s)),i.currentTarget.value=""},this.handleDragOver=i=>{var s,n;i.preventDefault(),i.stopPropagation();let{types:a}=i.dataTransfer,l=a.some(d=>d==="Files"),{allowNewUpload:u}=this.uppy.getState();if(!l||!u){i.dataTransfer.dropEffect="none";return}i.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(s=(n=this.opts).onDragOver)==null||s.call(n,i)},this.handleDragLeave=i=>{var s,n;i.preventDefault(),i.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(s=(n=this.opts).onDragLeave)==null||s.call(n,i)},this.handleDrop=async i=>{var s,n;i.preventDefault(),i.stopPropagation(),this.setPluginState({isDraggingOver:!1});let a=o(u=>{this.uppy.log(u,"error")},"logDropError"),l=await Ss(i.dataTransfer,{logDropError:a});l.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(l)),(s=(n=this.opts).onDrop)==null||s.call(n,i)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=Jy,this.i18nInit()}renderHiddenFileInput(){var e;let{restrictions:t}=this.uppy.opts;return c("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:o(i=>{this.fileInputRef=i},"ref"),name:this.opts.inputName,multiple:t.maxNumberOfFiles!==1,accept:(e=t.allowedFileTypes)==null?void 0:e.join(", "),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:o(()=>this.fileInputRef.click(),"onClick"),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),c("div",{className:"uppy-DragDrop-inner"},r.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}};Cs.VERSION=I_.version;var N_={version:"3.1.1"},M_={target:null};function Qd(r){var e,t;return(e=(t=r.dataTransfer)==null||(t=t.types)==null?void 0:t.some(i=>i==="Files"))!=null?e:!1}o(Qd,"isFileTransfer");var Uo=class extends Oe{static{o(this,"DropTarget")}constructor(e,t){super(e,{...M_,...t}),this.addFiles=i=>{let s=i.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 i=>{var s,n,a;if(!Qd(i))return;i.preventDefault(),i.stopPropagation(),(s=i.currentTarget)==null||s.classList.remove("uppy-is-drag-over"),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(p=>{p.type==="acquirer"&&(p.handleRootDrop==null||p.handleRootDrop(i))});let l=!1,u=o(p=>{this.uppy.log(p,"error"),l||(this.uppy.info(p.message,"error"),l=!0)},"logDropError"),d=await Ss(i.dataTransfer,{logDropError:u});d.length>0&&(this.uppy.log("[DropTarget] Files were dropped"),this.addFiles(d)),(n=(a=this.opts).onDrop)==null||n.call(a,i)},this.handleDragOver=i=>{var s,n;Qd(i)&&(i.preventDefault(),i.stopPropagation(),i.dataTransfer.dropEffect="copy",i.currentTarget.classList.add("uppy-is-drag-over"),this.setPluginState({isDraggingOver:!0}),(s=(n=this.opts).onDragOver)==null||s.call(n,i))},this.handleDragLeave=i=>{var s,n,a;Qd(i)&&(i.preventDefault(),i.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(s=i.currentTarget)==null||s.classList.remove("uppy-is-drag-over"),(n=(a=this.opts).onDragLeave)==null||n.call(a,i))},this.addListeners=()=>{let{target:i}=this.opts;if(i instanceof Element?this.nodes=[i]:typeof i=="string"&&(this.nodes=et(document.querySelectorAll(i))),!this.nodes||this.nodes.length===0)throw new Error(`"${i}" 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(i=>{i.removeEventListener("dragover",this.handleDragOver,!1),i.removeEventListener("dragleave",this.handleDragLeave,!1),i.removeEventListener("drop",this.handleDrop,!1)})},this.type="acquirer",this.id=this.opts.id||"DropTarget"}install(){this.setPluginState({isDraggingOver:!1}),this.addListeners()}uninstall(){this.removeListeners()}};Uo.VERSION=N_.version;var Qy={strings:{chooseFiles:"Choose files"}};var L_={version:"4.1.3"},B_={pretty:!0,inputName:"files[]"},Ts=class extends se{static{o(this,"FileInput")}constructor(e,t){super(e,{...B_,...t}),this.input=null,this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=Qy,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(i=>({source:this.id,name:i.name,type:i.type,data:i}));try{this.uppy.addFiles(t)}catch(i){this.uppy.log(i)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");let t=et(e.currentTarget.files||[]);this.addFiles(t),e.currentTarget.value=""}handleClick(){this.input.click()}render(){var e;let t={width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},{restrictions:i}=this.uppy.opts;return c("div",{className:"uppy-FileInput-container"},c("input",{className:"uppy-FileInput-input",style:this.opts.pretty?t:void 0,type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:i.maxNumberOfFiles!==1,accept:(e=i.allowedFileTypes)==null?void 0:e.join(", "),ref:o(s=>{this.input=s},"ref")}),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()}};Ts.VERSION=L_.version;var sv=be(Zy(),1);function z_(r,e){let t=r.width/e.width,i=r.height/e.height,s=Math.min(t,i),n=e.width*s,a=e.height*s,l=(r.width-n)/2,u=(r.height-a)/2;return{width:n,height:a,left:l,top:u}}o(z_,"getCanvasDataThatFitsPerfectlyIntoContainer");var ev=z_;function j_(r){return r*(Math.PI/180)}o(j_,"toRadians");function H_(r,e,t){let i=Math.abs(j_(t));return Math.max((Math.sin(i)*r+Math.cos(i)*e)/e,(Math.sin(i)*e+Math.cos(i)*r)/r)}o(H_,"getScaleFactorThatRemovesDarkCorners");var tv=H_;function $_(r,e,t){return e.left<r.left?{left:r.left,width:t.width}:e.top<r.top?{top:r.top,height:t.height}:e.left+e.width>r.left+r.width?{left:r.left+r.width-t.width,width:t.width}:e.top+e.height>r.top+r.height?{top:r.top+r.height-t.height,height:t.height}:null}o($_,"limitCropboxMovementOnMove");var rv=$_;function q_(r,e,t){return e.left<r.left?{left:r.left,width:t.left+t.width-r.left}:e.top<r.top?{top:r.top,height:t.top+t.height-r.top}:e.left+e.width>r.left+r.width?{left:t.left,width:r.left+r.width-t.left}:e.top+e.height>r.top+r.height?{top:t.top,height:r.top+r.height-t.top}:null}o(q_,"limitCropboxMovementOnResize");var iv=q_;var pa=class extends we{static{o(this,"Editor")}constructor(e){super(e),this.onRotate90Deg=()=>{let{angle90Deg:t}=this.state,i=t-90;this.setState({angle90Deg:i,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(i);let s=this.cropper.getCanvasData(),n=this.cropper.getContainerData(),a=ev(n,s);this.cropper.setCanvasData(a),this.cropper.setCropBoxData(a)},this.onRotateGranular=t=>{let i=Number(t.target.value);this.setState({angleGranular:i});let{angle90Deg:s}=this.state,n=s+i;this.cropper.rotateTo(n);let a=this.cropper.getImageData(),l=tv(a.naturalWidth,a.naturalHeight,i),u=this.cropper.getImageData().scaleX<0?-l:l;this.cropper.scale(u,l)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){let{opts:e,storeCropperInstance:t}=this.props;this.cropper=new sv.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(),i=this.cropper.getCropBoxData(),{prevCropboxData:s}=this.state;if(e.detail.action==="all"){let n=rv(t,i,s);n&&this.cropper.setCropBoxData(n)}else{let n=iv(t,i,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:o(()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})},"onClick")},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:o(()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1),"onClick")},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:o(()=>this.cropper.zoom(.1),"onClick")},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:o(()=>this.cropper.zoom(-.1),"onClick")},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:o(()=>this.cropper.setAspectRatio(1),"onClick")},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:o(()=>this.cropper.setAspectRatio(16/9),"onClick")},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:o(()=>this.cropper.setAspectRatio(9/16),"onClick")},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:i}=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:o(n=>{this.imgElement=n},"ref")})),c("div",{className:"uppy-ImageCropper-controls"},i.revert&&this.renderRevert(),i.rotate&&this.renderRotate(),i.granularRotate&&this.renderGranularRotate(),i.flip&&this.renderFlip(),i.zoomIn&&this.renderZoomIn(),i.zoomOut&&this.renderZoomOut(),i.cropSquare&&this.renderCropSquare(),i.cropWidescreen&&this.renderCropWidescreen(),i.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}};var ov={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 V_={version:"3.3.3"},nv={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},av={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},W_={quality:.8,actions:av,cropperOptions:nv},Os=class extends se{static{o(this,"ImageEditor")}constructor(e,t){super(e,{...W_,...t,actions:{...av,...t?.actions},cropperOptions:{...nv,...t?.cropperOptions}}),this.save=()=>{let i=o(a=>{var l;let{currentImage:u}=this.getPluginState();this.uppy.setFileState(u.id,{data:new File([a],(l=u.name)!=null?l:this.i18n("unnamed"),{type:a.type}),size:a.size,preview:void 0});let d=this.uppy.getFile(u.id);this.uppy.emit("thumbnail:request",d),this.setPluginState({currentImage:d}),this.uppy.emit("file-editor:complete",d)},"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(i,s.type,this.opts.quality)},this.storeCropperInstance=i=>{this.cropper=i},this.selectFile=i=>{this.uppy.emit("file-editor:start",i),this.setPluginState({currentImage:i})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=ov,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(pa,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}};Os.VERSION=V_.version;var G_={version:"4.2.1"},K_={fixed:!1,hideAfterFinish:!0},ks=class extends se{static{o(this,"ProgressBar")}constructor(e,t){super(e,{...K_,...t}),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){let{totalProgress:t}=e,i=(t===0||t===100)&&this.opts.hideAfterFinish;return c("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":i},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()}};ks.VERSION=G_.version;var X_={__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/webp":"webp","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 Ar(r){return[r]=r.split(";",1),X_[r]||null}o(Ar,"getFileTypeExtension");function tp(){var r;return typeof MediaRecorder=="function"&&typeof((r=MediaRecorder.prototype)==null?void 0:r.start)=="function"}o(tp,"supportsMediaRecorder");function rp(r){let{recording:e,onStartRecording:t,onStopRecording:i,i18n:s}=r;return e?c("button",{className:"uppy-u-reset uppy-c-btn uppy-Audio-button",type:"button",title:s("stopAudioRecording"),"aria-label":s("stopAudioRecording"),onClick:i,"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(rp,"RecordButton");function ip(r){return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}o(ip,"formatSeconds");function sp(r){let{recordingLengthSeconds:e,i18n:t}=r,i=ip(e);return c("span",{"aria-label":t("recordingLength",{recording_length:i})},i)}o(sp,"RecordingLength");var lv=o(r=>{let{currentDeviceId:e,audioSources:t,onChangeSource:i}=r;return c("div",{className:"uppy-Audio-videoSource"},c("select",{className:"uppy-u-reset uppy-Audio-audioSource-select",onChange:o(s=>{i(s.target.value)},"onChange")},t.map(s=>c("option",{key:s.deviceId,value:s.deviceId,selected:s.deviceId===e},s.label))))},"default");function Y_(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Y_,"_classPrivateFieldLooseBase");var J_=0;function Q_(r){return"__private_"+J_+++"_"+r}o(Q_,"_classPrivateFieldLooseKey");function uv(r){return typeof r=="function"}o(uv,"isFunction");function ha(r){return uv(r)?r():r}o(ha,"result");var op=Q_("draw"),fa=class{static{o(this,"AudioOscilloscope")}constructor(e,t){t===void 0&&(t={}),Object.defineProperty(this,op,{writable:!0,value:o(()=>this.draw(),"value")});let i=t.canvas||{},s=t.canvasContext||{};this.analyser=null,this.bufferLength=0,this.canvas=e,this.width=ha(i.width)||this.canvas.width,this.height=ha(i.height)||this.canvas.height,this.canvas.width=this.width,this.canvas.height=this.height,this.canvasContext=this.canvas.getContext("2d"),this.canvasContext.fillStyle=ha(s.fillStyle)||"rgb(255, 255, 255)",this.canvasContext.strokeStyle=ha(s.strokeStyle)||"rgb(0, 0, 0)",this.canvasContext.lineWidth=ha(s.lineWidth)||1,this.onDrawFrame=uv(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:i}=this,s=this.canvasContext,n=this.width,a=this.height;e&&e.getByteTimeDomainData(t),s.fillRect(0,0,n,a),s.beginPath();let l=n*1/i,u=0;i||s.moveTo(0,this.height/2);for(let d=0;d<i;d++){let f=t[d]/128*(a/2);d===0?s.moveTo(u,f):s.lineTo(u,f),u+=l}s.lineTo(n,a/2),s.stroke(),this.onDrawFrame(this),requestAnimationFrame(Y_(this,op)[op])}};function Z_(r){let{onSubmit:e,i18n:t}=r;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(Z_,"SubmitButton");var cv=Z_;function eP(r){let{onDiscard:e,i18n:t}=r;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(eP,"DiscardButton");var dv=eP;function np(r){let{stream:e,recordedAudio:t,onStop:i,recording:s,supportsRecording:n,audioSources:a,showAudioSourceDropdown:l,onSubmit:u,i18n:d,onStartRecording:p,onStopRecording:f,onDiscardRecordedAudio:y,recordingLengthSeconds:v}=r,_=Gt(null),R=Gt();pt(()=>()=>{R.current=null,i()},[i]),pt(()=>{if(!t&&(R.current=new fa(_.current,{canvas:{width:600,height:600},canvasContext:{lineWidth:2,fillStyle:"rgb(0,0,0)",strokeStyle:"green"}}),R.current.draw(),e)){let G=new AudioContext().createMediaStreamSource(e);R.current.addSource(G)}},[t,e]);let E=t!=null,O=!E&&n,L=l&&!E&&a&&a.length>1;return c("div",{className:"uppy-Audio-container"},c("div",{className:"uppy-Audio-audioContainer"},E?c("audio",{className:"uppy-Audio-player",controls:!0,src:t}):c("canvas",{ref:_,className:"uppy-Audio-canvas"})),c("div",{className:"uppy-Audio-footer"},c("div",{className:"uppy-Audio-audioSourceContainer"},L?lv(r):null),c("div",{className:"uppy-Audio-buttonContainer"},O&&c(rp,{recording:s,onStartRecording:p,onStopRecording:f,i18n:d}),E&&c(cv,{onSubmit:u,i18n:d}),E&&c(dv,{onDiscard:y,i18n:d})),c("div",{className:"uppy-Audio-recordingLength"},!E&&c(sp,{recordingLengthSeconds:v,i18n:d}))))}o(np,"RecordingScreen");var pv=o(r=>{let{icon:e,hasAudio:t,i18n:i}=r;return c("div",{className:"uppy-Audio-permissons"},c("div",{className:"uppy-Audio-permissonsIcon"},e()),c("div",{className:"uppy-Audio-title"},i(t?"allowAudioAccessTitle":"noAudioTitle")),c("p",null,i(t?"allowAudioAccessDescription":"noAudioDescription")))},"default");var hv={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 hp(){return hp=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},hp.apply(null,arguments)}o(hp,"_extends");function Z(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Z,"_classPrivateFieldLooseBase");var tP=0;function mt(r){return"__private_"+tP+++"_"+r}o(mt,"_classPrivateFieldLooseKey");var rP={version:"2.1.3"},As=mt("recordingLengthTimer"),wt=mt("stream"),Rs=mt("audioActive"),He=mt("recordingChunks"),je=mt("recorder"),hi=mt("capturedMediaFile"),St=mt("mediaDevices"),ma=mt("supportsUserMedia"),ap=mt("hasAudioCheck"),Us=mt("start"),lp=mt("startRecording"),ga=mt("stopRecording"),up=mt("discardRecordedAudio"),cp=mt("submit"),fi=mt("stop"),dp=mt("getAudio"),pp=mt("changeSource"),Is=mt("updateSources"),Ds=class extends se{static{o(this,"Audio")}constructor(e,t){super(e,t),Object.defineProperty(this,dp,{value:sP}),Object.defineProperty(this,ap,{value:iP}),Object.defineProperty(this,As,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:null}),Object.defineProperty(this,Rs,{writable:!0,value:!1}),Object.defineProperty(this,He,{writable:!0,value:null}),Object.defineProperty(this,je,{writable:!0,value:null}),Object.defineProperty(this,hi,{writable:!0,value:null}),Object.defineProperty(this,St,{writable:!0,value:void 0}),Object.defineProperty(this,ma,{writable:!0,value:void 0}),Object.defineProperty(this,Us,{writable:!0,value:o(i=>{if(!Z(this,ma)[ma])return Promise.reject(new Error("Microphone access not supported"));Z(this,Rs)[Rs]=!0,Z(this,ap)[ap]().then(s=>(this.setPluginState({hasAudio:s}),Z(this,St)[St].getUserMedia({audio:!0}).then(n=>{Z(this,wt)[wt]=n;let a=null,l=n.getAudioTracks();i!=null&&i.deviceId?a=l.findLast(u=>u.getSettings().deviceId===i.deviceId):a=l[0].getSettings().deviceId,Z(this,Is)[Is](),this.setPluginState({currentDeviceId:a,audioReady:!0})}).catch(n=>{this.setPluginState({audioReady:!1,cameraError:n}),this.uppy.info(n.message,"error")})))},"value")}),Object.defineProperty(this,lp,{writable:!0,value:o(()=>{Z(this,je)[je]=new MediaRecorder(Z(this,wt)[wt]),Z(this,He)[He]=[];let i=!1;Z(this,je)[je].addEventListener("dataavailable",s=>{Z(this,He)[He].push(s.data);let{restrictions:n}=this.uppy.opts;if(Z(this,He)[He].length>1&&n.maxFileSize!=null&&!i){let a=Z(this,He)[He].reduce((p,f)=>p+f.size,0),u=(a-Z(this,He)[He][0].size)/(Z(this,He)[He].length-1)*3,d=Math.max(0,n.maxFileSize-u);a>d&&(i=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),Z(this,ga)[ga]())}}),Z(this,je)[je].start(500),Z(this,As)[As]=setInterval(()=>{let s=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:s+1})},1e3),this.setPluginState({isRecording:!0})},"value")}),Object.defineProperty(this,ga,{writable:!0,value:o(()=>new Promise(s=>{Z(this,je)[je].addEventListener("stop",()=>{s()}),Z(this,je)[je].stop(),clearInterval(Z(this,As)[As]),this.setPluginState({recordingLengthSeconds:0})}).then(()=>(this.setPluginState({isRecording:!1}),Z(this,dp)[dp]())).then(s=>{try{Z(this,hi)[hi]=s,this.setPluginState({recordedAudio:URL.createObjectURL(s.data)})}catch(n){n.isRestriction||this.uppy.log(n)}}).then(()=>{Z(this,He)[He]=null,Z(this,je)[je]=null},s=>{throw Z(this,He)[He]=null,Z(this,je)[je]=null,s}),"value")}),Object.defineProperty(this,up,{writable:!0,value:o(()=>{this.setPluginState({recordedAudio:null}),Z(this,hi)[hi]=null},"value")}),Object.defineProperty(this,cp,{writable:!0,value:o(()=>{try{Z(this,hi)[hi]&&this.uppy.addFile(Z(this,hi)[hi])}catch(i){i.isRestriction||this.uppy.log(i,"warning")}},"value")}),Object.defineProperty(this,fi,{writable:!0,value:o(async()=>{Z(this,wt)[wt]&&Z(this,wt)[wt].getAudioTracks().forEach(s=>s.stop()),Z(this,je)[je]&&await new Promise(i=>{Z(this,je)[je].addEventListener("stop",i,{once:!0}),Z(this,je)[je].stop(),clearInterval(Z(this,As)[As])}),Z(this,He)[He]=null,Z(this,je)[je]=null,Z(this,Rs)[Rs]=!1,Z(this,wt)[wt]=null,this.setPluginState({recordedAudio:null,isRecording:!1,recordingLengthSeconds:0})},"value")}),Object.defineProperty(this,pp,{writable:!0,value:o(i=>{Z(this,fi)[fi](),Z(this,Us)[Us]({deviceId:i})},"value")}),Object.defineProperty(this,Is,{writable:!0,value:o(()=>{Z(this,St)[St].enumerateDevices().then(i=>{this.setPluginState({audioSources:i.filter(s=>s.kind==="audioinput")})})},"value")}),Z(this,St)[St]=navigator.mediaDevices,Z(this,ma)[ma]=Z(this,St)[St]!=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=hv,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,Rs)[Rs]||Z(this,Us)[Us]();let e=this.getPluginState();return!e.audioReady||!e.hasAudio?c(pv,{icon:this.icon,i18n:this.i18n,hasAudio:e.hasAudio}):c(np,hp({},e,{onChangeSource:Z(this,pp)[pp],onStartRecording:Z(this,lp)[lp],onStopRecording:Z(this,ga)[ga],onDiscardRecordedAudio:Z(this,up)[up],onSubmit:Z(this,cp)[cp],onStop:Z(this,fi)[fi],i18n:this.i18n,showAudioSourceDropdown:this.opts.showAudioSourceDropdown,supportsRecording:tp(),recording:e.isRecording,stream:Z(this,wt)[wt]}))}install(){this.setPluginState({audioReady:!1,recordingLengthSeconds:0});let{target:e}=this.opts;e&&this.mount(e,this),Z(this,St)[St]&&(Z(this,Is)[Is](),Z(this,St)[St].ondevicechange=()=>{if(Z(this,Is)[Is](),Z(this,wt)[wt]){let t=!0,{audioSources:i,currentDeviceId:s}=this.getPluginState();i.forEach(n=>{s===n.deviceId&&(t=!1)}),t&&(Z(this,fi)[fi](),Z(this,Us)[Us]())}})}uninstall(){Z(this,wt)[wt]&&Z(this,fi)[fi](),this.unmount()}};function iP(){return Z(this,St)[St]?Z(this,St)[St].enumerateDevices().then(r=>r.some(e=>e.kind==="audioinput")):Promise.resolve(!1)}o(iP,"_hasAudioCheck2");function sP(){let r=Z(this,He)[He].find(n=>{var a;return((a=n.type)==null?void 0:a.length)>0}).type,e=Ar(r);if(!e)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${r}"`));let t=`audio-${Date.now()}.${e}`,i=new Blob(Z(this,He)[He],{type:r}),s={source:this.id,name:t,data:new Blob([i],{type:r}),type:r};return Promise.resolve(s)}o(sP,"_getAudio2");Ds.VERSION=rP.version;var fv={strings:{pluginNameBox:"Box"}};var oP={version:"3.2.3"},mi=class extends se{static{o(this,"Box")}constructor(e,t){super(e,t),this.rootFolderId=null,this.id=this.opts.id||"Box",this.type="acquirer",this.storage=this.opts.storage||Be,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=st(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new ot(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=fv,this.i18nInit(),this.title=this.i18n("pluginNameBox"),this.render=this.render.bind(this)}install(){this.view=new Ge(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}render(e){return this.view.render(e)}};mi.VERSION=oP.version;var mv={strings:{pluginNameDropbox:"Dropbox"}};var nP={version:"4.2.3"},gi=class extends se{static{o(this,"Dropbox")}constructor(e,t){super(e,t),this.rootFolderId=null,this.id=this.opts.id||"Dropbox",this.type="acquirer",this.storage=this.opts.storage||Be,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=st(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new ot(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=mv,this.i18nInit(),this.title=this.i18n("pluginNameDropbox"),this.render=this.render.bind(this)}install(){this.view=new Ge(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}render(e){return this.view.render(e)}};gi.VERSION=nP.version;var gv={strings:{pluginNameFacebook:"Facebook"}};var aP={version:"4.2.3"},yi=class extends se{static{o(this,"Facebook")}constructor(e,t){super(e,t),this.rootFolderId=null,this.id=this.opts.id||"Facebook",this.type="acquirer",this.storage=this.opts.storage||Be,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=st(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new ot(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=gv,this.i18nInit(),this.title=this.i18n("pluginNameFacebook"),this.render=this.render.bind(this)}install(){this.view=new Ge(this,{provider:this.provider});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}render(e){let{partialTree:t,currentFolderId:i}=this.getPluginState();return t.filter(n=>n.type==="folder"&&n.parentId===i).length===0?this.view.render(e,{viewType:"grid",showFilter:!1,showTitles:!1}):this.view.render(e)}};yi.VERSION=aP.version;var ya=class extends Ge{static{o(this,"DriveProviderViews")}toggleCheckbox(e,t){var i;(i=e.data.custom)!=null&&i.isSharedDrive||super.toggleCheckbox(e,t)}};var yv={strings:{pluginNameGoogleDrive:"Google Drive"}};var lP={version:"4.3.3"},vi=class extends se{static{o(this,"GoogleDrive")}constructor(e,t){super(e,t),this.rootFolderId="root",this.type="acquirer",this.storage=this.opts.storage||Be,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=st(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new ot(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=yv,this.i18nInit(),this.title=this.i18n("pluginNameGoogleDrive"),this.render=this.render.bind(this)}install(){this.view=new ya(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}render(e){return this.view.render(e)}};vi.VERSION=lP.version;var fp={strings:{pluginNameGoogleDrivePicker:"Google Drive"}};var vv,uP={version:"0.3.6"},bi=class r extends se{static{o(this,"GoogleDrivePicker")}constructor(e,t){super(e,t),this.type="acquirer",this.icon=nu,this.defaultLocale=fp,this.handleFilesPicked=async(s,n)=>{this.uppy.addFiles(s.map(a=>{let{id:l,mimeType:u,name:d,platform:p,...f}=a;return{source:this.id,name:d,type:u,data:{size:null},isRemote:!0,remote:{companionUrl:this.opts.companionUrl,url:`${this.opts.companionUrl}/google-picker/get`,body:{fileId:l,accessToken:n,platform:p,..."url"in f&&{url:f.url}},requestClientId:r.requestClientId},..."metadata"in f&&{meta:f.metadata}}}))},this.render=()=>c(ys,{storage:this.storage,pickerType:"drive",uppy:this.uppy,i18n:this.i18n,clientId:this.opts.clientId,apiKey:this.opts.apiKey,appId:this.opts.appId,onFilesPicked:this.handleFilesPicked}),this.id=this.opts.id||"GoogleDrivePicker",this.storage=this.opts.storage||Be,this.defaultLocale=fp,this.i18nInit(),this.title=this.i18n("pluginNameGoogleDrivePicker");let i=new ht(e,{pluginId:this.id,provider:"url",companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule});this.uppy.registerRequestClient(r.requestClientId,i)}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};vv=bi;bi.VERSION=uP.version;bi.requestClientId=vv.name;var mp={strings:{pluginNameGooglePhotosPicker:"Google Photos"}};var bv,cP={version:"0.3.6"},wi=class r extends se{static{o(this,"GooglePhotosPicker")}constructor(e,t){super(e,t),this.type="acquirer",this.icon=ou,this.defaultLocale=mp,this.handleFilesPicked=async(s,n)=>{this.uppy.addFiles(s.map(a=>{let{id:l,mimeType:u,name:d,platform:p,...f}=a;return{source:this.id,name:d,type:u,data:{size:null},isRemote:!0,remote:{companionUrl:this.opts.companionUrl,url:`${this.opts.companionUrl}/google-picker/get`,body:{fileId:l,accessToken:n,platform:p,..."url"in f&&{url:f.url}},requestClientId:r.requestClientId},..."metadata"in f&&{meta:f.metadata}}}))},this.render=()=>c(ys,{storage:this.storage,pickerType:"photos",uppy:this.uppy,i18n:this.i18n,clientId:this.opts.clientId,onFilesPicked:this.handleFilesPicked}),this.id=this.opts.id||"GooglePhotosPicker",this.storage=this.opts.storage||Be,this.defaultLocale=mp,this.i18nInit(),this.title=this.i18n("pluginNameGooglePhotosPicker");let i=new ht(e,{pluginId:this.id,provider:"url",companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule});this.uppy.registerRequestClient(r.requestClientId,i)}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};bv=wi;wi.VERSION=cP.version;wi.requestClientId=bv.name;var wv={strings:{pluginNameInstagram:"Instagram"}};var dP={version:"4.2.3"},Si=class extends se{static{o(this,"Instagram")}constructor(e,t){super(e,t),this.rootFolderId="recent",this.type="acquirer",this.files=[],this.storage=this.opts.storage||Be,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, "}))),this.defaultLocale=wv,this.i18nInit(),this.title=this.i18n("pluginNameInstagram"),this.opts.companionAllowedHosts=st(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new ot(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.render=this.render.bind(this)}install(){this.view=new Ge(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()}render(e){return this.view.render(e)}};Si.VERSION=dP.version;var Sv={strings:{pluginNameOneDrive:"OneDrive"}};var pP={version:"4.2.4"},_i=class extends se{static{o(this,"OneDrive")}constructor(e,t){super(e,t),this.rootFolderId=null,this.type="acquirer",this.files=[],this.storage=this.opts.storage||Be,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=st(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new ot(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=Sv,this.i18nInit(),this.title=this.i18n("pluginNameOneDrive"),this.render=this.render.bind(this)}install(){this.view=new Ge(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}render(e){return this.view.render(e)}};_i.VERSION=pP.version;var _v={strings:{pluginNameUnsplash:"Unsplash"}};var hP={version:"4.3.4"},Pi=class extends se{static{o(this,"Unsplash")}constructor(e,t){if(super(e,t),this.type="acquirer",this.files=[],this.storage=this.opts.storage||Be,this.id=this.opts.id||"Unsplash",this.defaultLocale=_v,this.i18nInit(),this.title=this.i18n("pluginNameUnsplash"),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=st(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new hs(e,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule,provider:"unsplash",pluginId:this.id})}install(){this.view=new oi(this,{provider:this.provider,viewType:"unsplash",showFilter:!0,utmSource:this.opts.utmSource});let{target:e}=this.opts;e&&this.mount(e,this)}render(e){return this.view.render(e)}uninstall(){this.unmount()}};Pi.VERSION=hP.version;function Pv(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Pv,"_classPrivateFieldLooseBase");var fP=0;function mP(r){return"__private_"+fP+++"_"+r}o(mP,"_classPrivateFieldLooseKey");var va=mP("handleSubmit"),gp=class extends we{static{o(this,"UrlUI")}constructor(e){super(e),this.form=document.createElement("form"),Object.defineProperty(this,va,{writable:!0,value:o(t=>{t.preventDefault();let{addFile:i}=this.props,s=this.input.value.trim();i(s)},"value")}),this.form.id=mr()}componentDidMount(){this.input.value="",this.form.addEventListener("submit",Pv(this,va)[va]),document.body.appendChild(this.form)}componentWillUnmount(){this.form.removeEventListener("submit",Pv(this,va)[va]),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:o(t=>{this.input=t},"ref"),"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")))}},xv=gp;function Eu(r,e,t){let i=et(r.items),s;switch(e){case"paste":{if(i.some(a=>a.kind==="file"))return;s=i.filter(a=>a.kind==="string"&&a.type==="text/plain");break}case"drop":{s=i.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(Eu,"forEachDroppedOrPastedUrl");var Fv={strings:{pluginNameUrl:"Link",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 Ev,gP={version:"4.2.4"};function yP(){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(yP,"UrlIcon");function vP(r){let e=/^[a-z0-9]+:\/\//,t="http://";return e.test(r)?r:t+r}o(vP,"addProtocolToURL");function bP(r){return et(r.dataTransfer.items).filter(i=>i.kind==="string"&&i.type==="text/uri-list").length>0}o(bP,"canHandleRootDrop");function wP(r){return r?.startsWith("http://")||r?.startsWith("https://")}o(wP,"checkIfCorrectURL");function SP(r){let{pathname:e}=new URL(r);return e.substring(e.lastIndexOf("/")+1)}o(SP,"getFileNameFromUrl");var wr=class r extends se{static{o(this,"Url")}constructor(e,t){if(super(e,t),this.getMeta=i=>this.client.post("url/meta",{url:i}),this.addFile=async(i,s)=>{if(i.startsWith("blob"))return;let n=vP(i);if(!wP(n)){this.uppy.log(`[URL] Incorrect URL entered: ${n}`),this.uppy.info(this.i18n("enterCorrectUrl"),"error",4e3);return}this.uppy.log(`[URL] Adding file from dropped/pasted url: ${n}`);try{let a=await this.getMeta(n),l={meta:s,source:this.id,name:a.name||SP(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:r.requestClientId}};this.uppy.log("[Url] Adding remote file");try{return this.uppy.addFile(l)}catch(u){return u.isRestriction||this.uppy.log(u),u}}catch(a){return this.uppy.log(a),this.uppy.info({message:this.i18n("failedToFetch"),details:a},"error",4e3),a}},this.handleRootDrop=i=>{Eu(i.dataTransfer,"drop",s=>{this.addFile(s)})},this.handleRootPaste=i=>{Eu(i.clipboardData,"paste",s=>{this.addFile(s)})},this.id=this.opts.id||"Url",this.type="acquirer",this.icon=()=>c(yP,null),this.defaultLocale=Fv,this.i18nInit(),this.title=this.i18n("pluginNameUrl"),this.hostname=this.opts.companionUrl,!this.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");this.client=new ht(e,{pluginId:this.id,provider:"url",companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionCookiesRule:this.opts.companionCookiesRule}),this.uppy.registerRequestClient(r.requestClientId,this.client)}render(){return c(xv,{i18n:this.i18n,addFile:this.addFile})}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};Ev=wr;wr.VERSION=gP.version;wr.requestClientId=Ev.name;wr.prototype.canHandleRootDrop=bP;var Cv={strings:{pluginNameZoom:"Zoom"}};var _P={version:"3.2.3"},xi=class extends se{static{o(this,"Zoom")}constructor(e,t){super(e,t),this.rootFolderId=null,this.type="acquirer",this.files=[],this.storage=this.opts.storage||Be,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=st(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new ot(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=Cv,this.i18nInit(),this.title=this.i18n("pluginNameZoom"),this.render=this.render.bind(this)}install(){this.view=new Ge(this,{provider:this.provider});let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.view.tearDown(),this.unmount()}render(e){return this.view.render(e)}};xi.VERSION=_P.version;function yp(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(yp,"_classPrivateFieldLooseBase");var PP=0;function xP(r){return"__private_"+PP+++"_"+r}o(xP,"_classPrivateFieldLooseKey");var FP={version:"2.3.4"},vp={__proto__:null,Box:mi,Dropbox:gi,Facebook:yi,GoogleDrive:vi,Instagram:Si,OneDrive:_i,Unsplash:Pi,Url:wr,Zoom:xi},EP={sources:Object.keys(vp)},Ns=xP("installedPlugins"),Io=class extends Oe{static{o(this,"RemoteSources")}constructor(e,t){if(super(e,{...EP,...t}),Object.defineProperty(this,Ns,{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=>{var t;let{sources:i,...s}=this.opts,n={...s,companionKeysParams:(t=this.opts.companionKeysParams)==null?void 0:t[e]},a=vp[e];if(a==null){let l=Object.keys(vp),u=new Intl.ListFormat("en",{style:"long",type:"disjunction"});throw new Error(`Invalid plugin: "${e}" is not one of: ${u.format(l)}.`)}this.uppy.use(a,n),yp(this,Ns)[Ns].add(this.uppy.getPlugin(e))})}uninstall(){for(let e of yp(this,Ns)[Ns])this.uppy.removePlugin(e);yp(this,Ns)[Ns].clear()}};Io.VERSION=FP.version;function bp(){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(bp,"ScreenRecIcon");function wp(r){let{recording:e,onStartRecording:t,onStopRecording:i,i18n:s}=r;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:i,"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:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor"},c("path",{d:"M4.5 4.5a3 3 0 0 0-3 3v9a3 3 0 0 0 3 3h8.25a3 3 0 0 0 3-3v-9a3 3 0 0 0-3-3H4.5ZM19.94 18.75l-2.69-2.69V7.94l2.69-2.69c.944-.945 2.56-.276 2.56 1.06v11.38c0 1.336-1.616 2.005-2.56 1.06Z"})))}o(wp,"RecordButton");function Sp(r){let{recording:e,recordedVideo:t,onSubmit:i,capturedScreenshotUrl:s,i18n:n}=r;return(t||s)&&!e?c("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--submit",type:"button",title:n("submitRecordedFile"),"aria-label":n("submitRecordedFile"),onClick:i,"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(Sp,"SubmitButton");function CP(r){return(r-(r%=60))/60+(r>9?":":":0")+r}o(CP,"fmtMSS");var _p=class extends we{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.timerRunning=!1,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:i}=this.state,s=CP(i);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}},Tv=_p;function Pp(r){let{streamActive:e,i18n:t}=r;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(Pp,"StreamStatus");function xp(r){let{onDiscard:e,i18n:t}=r;return c("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--discard",type:"button",title:t("discardMediaFile"),"aria-label":t("discardMediaFile"),onClick:e,"data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},c("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c("line",{x1:"6",y1:"6",x2:"18",y2:"18"})))}o(xp,"DiscardButton");function Fp(r){let{onScreenshot:e,i18n:t}=r;return c("button",{className:"uppy-u-reset uppy-c-btn uppy-ScreenCapture-button uppy-ScreenCapture-button--screenshot",type:"button",title:t("takeScreenshot"),"aria-label":t("takeScreenshot"),onClick:e,"data-uppy-super-focusable":!0},c("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor"},c("path",{d:"M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z"}),c("path",{"fill-rule":"evenodd",d:"M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3h-15a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z","clip-rule":"evenodd"})))}o(Fp,"ScreenshotButton");function Ep(){return Ep=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},Ep.apply(null,arguments)}o(Ep,"_extends");var Cp=class extends we{static{o(this,"RecorderScreen")}constructor(){super(...arguments),this.videoElement=null}componentWillUnmount(){let{onStop:e}=this.props;e()}render(){let{recording:e,stream:t,recordedVideo:i,enableScreenshots:s,capturedScreenshotUrl:n}=this.props,a={playsinline:!0};return(e||!i&&!e)&&(a.muted=!0,a.autoplay=!0,a.srcObject=t),i&&!e&&(a.muted=!1,a.controls=!0,a.src=i,this.videoElement&&(this.videoElement.srcObject=null)),c("div",{className:"uppy uppy-ScreenCapture-container"},c("div",{className:"uppy-ScreenCapture-mediaContainer"},c(Pp,this.props),n&&!e&&!i?c("div",{className:"uppy-ScreenCapture-imageContainer"},c("img",{src:n,className:"uppy-ScreenCapture-media",alt:"screenshotPreview"})):c("video",Ep({ref:o(l=>{this.videoElement=l},"ref"),className:"uppy-ScreenCapture-media"},a)),c("div",null,c(Tv,this.props))),c("div",{className:"uppy-ScreenCapture-buttonContainer"},i||n?c(Qe,null,c(Sp,this.props),c(xp,this.props)):c(Qe,null,s&&!e&&c(Fp,this.props),c(wp,this.props))))}},Ov=Cp;var kv={strings:{pluginNameScreenCapture:"Screencast",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",takeScreenshot:"Take Screenshot",discardMediaFile:"Discard Media"}};function Tp(){return Tp=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},Tp.apply(null,arguments)}o(Tp,"_extends");var TP={version:"4.3.1"};function OP(){var r;return window.MediaRecorder&&((r=navigator.mediaDevices)==null?void 0:r.getDisplayMedia)}o(OP,"isScreenRecordingSupported");function kP(){return window.MediaRecorder&&navigator.mediaDevices}o(kP,"getMediaDevices");var AP=["image/png","image/jpeg","image/webp"],RP={displayMediaConstraints:{video:{width:1280,height:720,frameRate:{ideal:3,max:5},cursor:"motion",displaySurface:"monitor"}},userMediaConstraints:{audio:!0},preferredVideoMimeType:"video/webm",preferredImageMimeType:"image/png",enableScreenshots:!0},Ms=class extends se{static{o(this,"ScreenCapture")}constructor(e,t){super(e,{...RP,...t}),this.videoStream=null,this.audioStream=null,this.userDenied=!1,this.recorder=null,this.outputStream=null,this.recordingChunks=null,this.mediaDevices=kP(),this.protocol=location.protocol==="https:"?"https":"http",this.id=this.opts.id||"ScreenCapture",this.type="acquirer",this.icon=bp,this.defaultLocale=kv,this.i18nInit(),this.title=this.i18n("pluginNameScreenCapture"),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.captureScreenshot=this.captureScreenshot.bind(this),this.discardRecordedMedia=this.discardRecordedMedia.bind(this),this.captureActive=!1,this.capturedMediaFile=null,this.setPluginState({streamActive:!1,audioStreamActive:!1,recording:!1,recordedVideo:null,screenRecError:null,capturedScreenshotUrl:null})}install(){if(!OP())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()}getStatus(){let{recording:e,recordedVideo:t,capturedScreenshotUrl:i,screenRecError:s,streamActive:n}=this.getPluginState();return e?"recording":t||i?"captured":s?"error":n?"ready":"init"}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,screenRecError:null}),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(i=>{if(i===!1)throw new Error("No video stream available");t&&MediaRecorder.isTypeSupported(t)&&Ar(t)&&(e.mimeType=t);let s=[i.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(i=>{this.uppy.log(i,"error"),this.setPluginState({screenRecError:i.message})})}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})}discardRecordedMedia(){let{capturedScreenshotUrl:e,recordedVideo:t}=this.getPluginState();e&&URL.revokeObjectURL(e),t&&URL.revokeObjectURL(t),this.capturedMediaFile=null,this.setPluginState({recordedVideo:null,capturedScreenshotUrl:null})}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(i=>{i.stop()}),this.videoStream.getAudioTracks().forEach(i=>{i.stop()}),this.videoStream=null),this.audioStream&&(this.audioStream.getAudioTracks().forEach(i=>{i.stop()}),this.audioStream.getVideoTracks().forEach(i=>{i.stop()}),this.audioStream=null),this.outputStream&&(this.outputStream.getAudioTracks().forEach(i=>{i.stop()}),this.outputStream.getVideoTracks().forEach(i=>{i.stop()}),this.outputStream=null);let{capturedScreenshotUrl:e,recordedVideo:t}=this.getPluginState();e&&URL.revokeObjectURL(e),t&&URL.revokeObjectURL(t),this.setPluginState({recording:!1,streamActive:!1,audioStreamActive:!1,recordedVideo:null,capturedScreenshotUrl:null}),this.captureActive=!1}getVideo(){let e=this.recordingChunks[0].type,t=Ar(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));let i=`screencap-${Date.now()}.${t}`,s=new Blob(this.recordingChunks,{type:e}),n={source:this.id,name:i,data:new Blob([s],{type:e}),type:e};return Promise.resolve(n)}async captureScreenshot(){var e;if(!((e=this.mediaDevices)!=null&&e.getDisplayMedia))throw new Error("Screen capture is not supported");try{let t=this.videoStream;if(!t){let u=await this.selectVideoStreamSource();if(!u)throw new Error("Failed to get screen capture stream");t=u}let i=document.createElement("video");i.srcObject=t,await new Promise(u=>{i.onloadedmetadata=()=>{i.play(),u(null)}});let s=document.createElement("canvas");s.width=i.videoWidth,s.height=i.videoHeight;let n=s.getContext("2d");if(!n)throw new Error("Failed to get canvas context");n.drawImage(i,0,0,s.width,s.height);let a=this.opts.preferredImageMimeType;(!a||!AP.includes(a))&&(this.uppy.log(`Unsupported image type "${a}", falling back to image/png`,"warning"),a="image/png");let l=1;return new Promise((u,d)=>{s.toBlob(p=>{if(!p){d(new Error("Failed to create screenshot blob"));return}let f=Ar(a)||"png",y={source:this.id,name:`Screenshot ${new Date().toISOString()}.${f}`,type:a,data:p};try{this.capturedMediaFile=y;let v=URL.createObjectURL(p);this.setPluginState({capturedScreenshotUrl:v}),u()}catch(v){this.getPluginState().capturedScreenshotUrl&&this.setPluginState({capturedScreenshotUrl:null}),v.isRestriction||this.uppy.log(v,"error"),d(v)}finally{i.srcObject=null,s.remove(),i.remove()}},a,l)})}catch(t){throw this.uppy.log(t,"error"),t}}render(){let e=this.getPluginState();return!e.streamActive&&!this.captureActive&&!this.userDenied&&this.start(),c(Ov,Tp({},e,{onStartRecording:this.startRecording,onStopRecording:this.stopRecording,enableScreenshots:this.opts.enableScreenshots,onScreenshot:this.captureScreenshot,onStop:this.stop,onSubmit:this.submit,i18n:this.i18n,stream:this.videoStream,onDiscard:this.discardRecordedMedia}))}};Ms.VERSION=TP.version;var Mv=be(Av(),1);function kp(r,e,t){return new Promise(i=>{r.toBlob(i,e,t)})}o(kp,"canvasToBlob");function Ap(){return typeof MediaRecorder=="function"&&!!MediaRecorder.prototype&&typeof MediaRecorder.prototype.start=="function"}o(Ap,"supportsMediaRecorder");function ba(){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(ba,"CameraIcon");function Rp(r){let{onSnapshot:e,i18n:t}=r;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},ba())}o(Rp,"SnapshotButton");function Up(r){let{recording:e,onStartRecording:t,onStopRecording:i,i18n:s}=r;return e?c("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:s("stopRecording"),"aria-label":s("stopRecording"),onClick:i,"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(Up,"RecordButton");function Ip(r){return`${Math.floor(r/60)}:${String(r%60).padStart(2,"0")}`}o(Ip,"formatSeconds");function Dp(r){let{recordingLengthSeconds:e,i18n:t}=r,i=Ip(e);return c("span",{"aria-label":t("recordingLength",{recording_length:i})},i)}o(Dp,"RecordingLength");function Np(r){let{currentDeviceId:e,videoSources:t,onChangeVideoSource:i}=r;return c("div",{className:"uppy-Webcam-videoSource"},c("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:o(s=>{i(s.target.value)},"onChange")},t.map(s=>c("option",{key:s.deviceId,value:s.deviceId,selected:s.deviceId===e},s.label))))}o(Np,"VideoSourceSelect");function NP(r){let{onSubmit:e,i18n:t}=r;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(NP,"SubmitButton");var Rv=NP;function MP(r){let{onDiscard:e,i18n:t}=r;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(MP,"DiscardButton");var Uv=MP;function Mp(){return Mp=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},Mp.apply(null,arguments)}o(Mp,"_extends");function Tu(r,e){return r.includes(e)}o(Tu,"isModeAvailable");var Lp=class extends we{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:i,modes:s,supportsRecording:n,videoSources:a,showVideoSourceDropdown:l,showRecordingLength:u,onSubmit:d,i18n:p,mirror:f,onSnapshot:y,onStartRecording:v,onStopRecording:_,onDiscardRecordedVideo:R,recordingLengthSeconds:E}=this.props,O=!!t,L=!O&&n&&(Tu(s,"video-only")||Tu(s,"audio-only")||Tu(s,"video-audio")),B=!O&&Tu(s,"picture"),G=n&&u&&!O,J=l&&a&&a.length>1,$={playsInline:!0};return t?($.muted=!1,$.controls=!0,$.src=t,this.videoElement&&(this.videoElement.srcObject=null)):($.muted=!0,$.autoPlay=!0,$.srcObject=e),c("div",{className:"uppy uppy-Webcam-container"},c("div",{className:"uppy-Webcam-videoContainer"},c("video",Mp({ref:o(W=>this.videoElement=W,"ref"),className:`uppy-Webcam-video  ${f?"uppy-Webcam-video--mirrored":""}`},$))),c("div",{className:"uppy-Webcam-footer"},c("div",{className:"uppy-Webcam-videoSourceContainer"},J?Np(this.props):null),c("div",{className:"uppy-Webcam-buttonContainer"},B&&c(Rp,{onSnapshot:y,i18n:p}),L&&c(Up,{recording:i,onStartRecording:v,onStopRecording:_,i18n:p}),O&&c(Rv,{onSubmit:d,i18n:p}),O&&c(Uv,{onDiscard:R,i18n:p})),c("div",{className:"uppy-Webcam-recordingLength"},G&&c(Dp,{recordingLengthSeconds:E,i18n:p}))))}},Iv=Lp;function Bp(r){let{icon:e,i18n:t,hasCamera:i}=r;return c("div",{className:"uppy-Webcam-permissons"},c("div",{className:"uppy-Webcam-permissonsIcon"},e()),c("div",{className:"uppy-Webcam-title"},t(i?"allowAccessTitle":"noCameraTitle")),c("p",null,t(i?"allowAccessDescription":"noCameraDescription")))}o(Bp,"PermissionsScreen");var Dv={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 jp(){return jp=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},jp.apply(null,arguments)}o(jp,"_extends");function wa(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(wa,"_classPrivateFieldLooseBase");var LP=0;function BP(r){return"__private_"+LP+++"_"+r}o(BP,"_classPrivateFieldLooseKey");var zP={version:"4.2.1"};function Nv(r){return r[0]==="."?cn[r.slice(1)]:r}o(Nv,"toMimeType");function jP(r){return/^video\/[^*]+$/.test(r)}o(jP,"isVideoMimeType");function HP(r){return/^image\/[^*]+$/.test(r)}o(HP,"isImageMimeType");function $P(){return navigator.mediaDevices}o($P,"getMediaDevices");function zp(r,e){return r.includes(e)}o(zp,"isModeAvailable");var Lv={onBeforeSnapshot:o(()=>Promise.resolve(),"onBeforeSnapshot"),countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1,mobileNativeCamera:(0,Mv.default)({tablet:!0})},Rr=BP("enableMirror"),Ls=class extends se{static{o(this,"Webcam")}constructor(e,t){super(e,{...Lv,...t}),Object.defineProperty(this,Rr,{writable:!0,value:void 0}),this.stream=null,this.recorder=null,this.recordingChunks=null,this.captureInProgress=!1,this.mediaDevices=$P(),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=Dv,this.i18nInit(),this.title=this.i18n("pluginNameCamera"),wa(this,Rr)[Rr]=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})}getStatus(){let{recordedVideo:e,capturedSnapshot:t,isRecording:i,cameraReady:s,cameraError:n}=this.getPluginState();return i?"recording":e!=null||t!=null?"captured":s?"ready":n?"error":"init"}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,i=!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||{},...e!=null&&{deviceId:e}};return{audio:t,video:i?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&&(wa(this,Rr)[Rr]=!0);let i=this.getConstraints((t=e)==null?void 0:t.deviceId);this.hasCameraCheck().then(s=>(this.setPluginState({hasCamera:s}),this.mediaDevices.getUserMedia(i).then(n=>{this.stream=n;let a=null,l=this.isAudioOnly()?n.getAudioTracks():n.getVideoTracks();!e||!e.deviceId?a=l[0].getSettings().deviceId:l.forEach(u=>{u.getSettings().deviceId===e.deviceId&&(a=u.getSettings().deviceId)}),this.updateVideoSources(),this.setPluginState({currentDeviceId:a,cameraReady:!0})}).catch(n=>{this.setPluginState({cameraReady:!1,cameraError:n}),this.uppy.info(n.message,"error")})))}getMediaRecorderOptions(){let e={};if(MediaRecorder.isTypeSupported){let{restrictions:t}=this.uppy.opts,i=[];this.opts.preferredVideoMimeType?i=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(i=t.allowedFileTypes.map(Nv).filter(jP));let s=o(a=>MediaRecorder.isTypeSupported(a)&&Ar(a),"filterSupportedTypes"),n=i.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:i}=this.uppy.opts;if(this.recordingChunks.length>1&&i.maxFileSize!=null&&!e){let s=this.recordingChunks.reduce((u,d)=>u+d.size,0),a=(s-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3,l=Math.max(0,i.maxFileSize-a);s>l&&(e=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),this.stopRecording())}}),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval(()=>{let t=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:t+1})},1e3)),this.setPluginState({isRecording:!0})}stopRecording(){return new Promise(t=>{this.recorder.addEventListener("stop",()=>{t()}),this.recorder.stop(),this.opts.showRecordingLength&&(clearInterval(this.recordingLengthTimer),this.setPluginState({recordingLengthSeconds:0}))}).then(()=>(this.setPluginState({isRecording:!1}),this.getVideo())).then(t=>{try{this.capturedMediaFile=t,this.setPluginState({recordedVideo:URL.createObjectURL(t.data)}),wa(this,Rr)[Rr]=!1}catch(i){i.isRestriction||this.uppy.log(i)}}).then(()=>{this.recordingChunks=null,this.recorder=null},t=>{throw this.recordingChunks=null,this.recorder=null,t})}discardRecordedVideo(){this.setPluginState({recordedVideo:null}),this.opts.mirror&&(wa(this,Rr)[Rr]=!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(i=>i.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 i=this.opts.countdown,s=setInterval(()=>{if(!this.webcamActive)return clearInterval(s),this.captureInProgress=!1,t(new Error("Webcam is not active"));i?(this.uppy.info(`${i}...`,"warning",800),i--):(clearInterval(s),this.uppy.info(this.i18n("smile"),"success",1500),setTimeout(()=>e(),1500))},1e3)})}async takeSnapshot(){if(!this.captureInProgress){this.captureInProgress=!0;try{await this.opts.onBeforeSnapshot()}catch(e){let t=typeof e=="object"?e.message:e;throw this.uppy.info(t,"error",5e3),new Error(`onBeforeSnapshot: ${t}`)}try{let e=await this.getImage();this.captureInProgress=!1,this.uppy.addFile(e)}catch(e){this.captureInProgress=!1,e.isRestriction||this.uppy.log(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,i=e.videoHeight,s=document.createElement("canvas");s.width=t,s.height=i,s.getContext("2d").drawImage(e,0,0);let{restrictions:a}=this.uppy.opts,l=[];this.opts.preferredImageMimeType?l=[this.opts.preferredImageMimeType]:a.allowedFileTypes&&(l=a.allowedFileTypes.map(Nv).filter(HP));let u=l[0]||"image/jpeg",d=Ar(u)||"jpg",p=`cam-${Date.now()}.${d}`;return kp(s,u).then(f=>({source:this.id,name:p,data:new Blob([f],{type:u}),type:u}))}getVideo(){let e=this.recordingChunks.find(a=>{var l;return((l=a.type)==null?void 0:l.length)>0}).type,t=Ar(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));let i=`webcam-${Date.now()}.${t}`,s=new Blob(this.recordingChunks,{type:e}),n={source:this.id,name:i,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(Bp,{icon:ba,i18n:this.i18n,hasCamera:e.hasCamera}):c(Iv,jp({},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:Ap(),recording:e.isRecording,mirror:wa(this,Rr)[Rr],src:this.stream}))}install(){let{mobileNativeCamera:e,modes:t,videoConstraints:i}=this.opts,{target:s}=this.opts;if(e&&s){var n;(n=this.getTargetPlugin(s))==null||n.setOptions({showNativeVideoCameraButton:zp(t,"video-only")||zp(t,"video-audio"),showNativePhotoCameraButton:zp(t,"picture"),nativeCameraFacingMode:i?.facingMode});return}this.setPluginState({cameraReady:!1,recordingLengthSeconds:0}),s&&this.mount(s,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=()=>{if(this.updateVideoSources(),this.stream){let a=!0,{videoSources:l,currentDeviceId:u}=this.getPluginState();l.forEach(d=>{u===d.deviceId&&(a=!1)}),a&&(this.stop(),this.start())}})}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}};Ls.VERSION=zP.version;function Fi(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Fi,"_classPrivateFieldLooseBase");var qP=0;function Bv(r){return"__private_"+qP+++"_"+r}o(Bv,"_classPrivateFieldLooseKey");var Mt=Bv("uppy"),Sa=Bv("events"),Ei=class{static{o(this,"EventManager")}constructor(e){Object.defineProperty(this,Mt,{writable:!0,value:void 0}),Object.defineProperty(this,Sa,{writable:!0,value:[]}),Fi(this,Mt)[Mt]=e}on(e,t){return Fi(this,Sa)[Sa].push([e,t]),Fi(this,Mt)[Mt].on(e,t)}remove(){for(let[e,t]of Fi(this,Sa)[Sa].splice(0))Fi(this,Mt)[Mt].off(e,t)}onFilePause(e,t){this.on("upload-pause",(i,s)=>{e===i?.id&&t(s)})}onFileRemove(e,t){this.on("file-removed",i=>{e===i.id&&t(i.id)})}onPause(e,t){this.on("upload-pause",(i,s)=>{e===i?.id&&t(s)})}onRetry(e,t){this.on("upload-retry",i=>{e===i?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{Fi(this,Mt)[Mt].getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{Fi(this,Mt)[Mt].getFile(e)&&t()})}onCancelAll(e,t){var i=this;this.on("cancel-all",function(){Fi(i,Mt)[Mt].getFile(e)&&t(...arguments)})}onResumeAll(e,t){this.on("resume-all",()=>{Fi(this,Mt)[Mt].getFile(e)&&t()})}};function oe(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(oe,"_classPrivateFieldLooseBase");var VP=0;function Kt(r){return"__private_"+VP+++"_"+r}o(Kt,"_classPrivateFieldLooseKey");function WP(r){return new Error("Cancelled",{cause:r})}o(WP,"createCancelError");function zv(r){if(r!=null){var e;let t=o(()=>this.abort(r.reason),"abortPromise");r.addEventListener("abort",t,{once:!0});let i=o(()=>{r.removeEventListener("abort",t)},"removeAbortListener");(e=this.then)==null||e.call(this,i,i)}return this}o(zv,"abortOn");var or=Kt("activeRequests"),Bt=Kt("queuedHandlers"),sr=Kt("paused"),Bs=Kt("pauseTimer"),Lt=Kt("downLimit"),zs=Kt("upperLimit"),Ci=Kt("rateLimitingTimer"),_a=Kt("call"),Ti=Kt("queueNext"),qp=Kt("next"),Hp=Kt("queue"),Vp=Kt("dequeue"),$p=Kt("resume"),js=Kt("increaseLimit"),Sr=class{static{o(this,"RateLimitedQueue")}constructor(e){Object.defineProperty(this,Vp,{value:JP}),Object.defineProperty(this,Hp,{value:YP}),Object.defineProperty(this,qp,{value:XP}),Object.defineProperty(this,Ti,{value:KP}),Object.defineProperty(this,_a,{value:GP}),Object.defineProperty(this,or,{writable:!0,value:0}),Object.defineProperty(this,Bt,{writable:!0,value:[]}),Object.defineProperty(this,sr,{writable:!0,value:!1}),Object.defineProperty(this,Bs,{writable:!0,value:void 0}),Object.defineProperty(this,Lt,{writable:!0,value:1}),Object.defineProperty(this,zs,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:void 0}),Object.defineProperty(this,$p,{writable:!0,value:o(()=>this.resume(),"value")}),Object.defineProperty(this,js,{writable:!0,value:o(()=>{if(oe(this,sr)[sr]){oe(this,Ci)[Ci]=setTimeout(oe(this,js)[js],0);return}oe(this,Lt)[Lt]=this.limit,this.limit=Math.ceil((oe(this,zs)[zs]+oe(this,Lt)[Lt])/2);for(let t=oe(this,Lt)[Lt];t<=this.limit;t++)oe(this,Ti)[Ti]();oe(this,zs)[zs]-oe(this,Lt)[Lt]>3?oe(this,Ci)[Ci]=setTimeout(oe(this,js)[js],2e3):oe(this,Lt)[Lt]=Math.floor(oe(this,Lt)[Lt]/2)},"value")}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!oe(this,sr)[sr]&&oe(this,or)[or]<this.limit?oe(this,_a)[_a](e):oe(this,Hp)[Hp](e,t)}wrapSyncFunction(e,t){var i=this;return function(){for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];let l=i.run(()=>(e(...n),queueMicrotask(()=>l.done()),()=>{}),t);return{abortOn:zv,abort(){l.abort()}}}}wrapPromiseFunction(e,t){var i=this;return function(){for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];let l,u=new Promise((d,p)=>{l=i.run(()=>{let f,y;try{y=Promise.resolve(e(...n))}catch(v){y=Promise.reject(v)}return y.then(v=>{f?p(f):(l.done(),d(v))},v=>{f?p(f):(l.done(),p(v))}),v=>{f=WP(v)}},t)});return u.abort=d=>{l.abort(d)},u.abortOn=zv,u}}resume(){oe(this,sr)[sr]=!1,clearTimeout(oe(this,Bs)[Bs]);for(let e=0;e<this.limit;e++)oe(this,Ti)[Ti]()}pause(e){e===void 0&&(e=null),oe(this,sr)[sr]=!0,clearTimeout(oe(this,Bs)[Bs]),e!=null&&(oe(this,Bs)[Bs]=setTimeout(oe(this,$p)[$p],e))}rateLimit(e){clearTimeout(oe(this,Ci)[Ci]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(oe(this,zs)[zs]=this.limit-1,this.limit=oe(this,Lt)[Lt],oe(this,Ci)[Ci]=setTimeout(oe(this,js)[js],e))}get isPaused(){return oe(this,sr)[sr]}};function GP(r){oe(this,or)[or]+=1;let e=!1,t;try{t=r()}catch(i){throw oe(this,or)[or]-=1,i}return{abort:o(i=>{e||(e=!0,oe(this,or)[or]-=1,t?.(i),oe(this,Ti)[Ti]())},"abort"),done:o(()=>{e||(e=!0,oe(this,or)[or]-=1,oe(this,Ti)[Ti]())},"done")}}o(GP,"_call2");function KP(){queueMicrotask(()=>oe(this,qp)[qp]())}o(KP,"_queueNext2");function XP(){if(oe(this,sr)[sr]||oe(this,or)[or]>=this.limit||oe(this,Bt)[Bt].length===0)return;let r=oe(this,Bt)[Bt].shift();if(r==null)throw new Error("Invariant violation: next is null");let e=oe(this,_a)[_a](r.fn);r.abort=e.abort,r.done=e.done}o(XP,"_next2");function YP(r,e){let t={fn:r,priority:e?.priority||0,abort:o(()=>{oe(this,Vp)[Vp](t)},"abort"),done:o(()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")},"done")},i=oe(this,Bt)[Bt].findIndex(s=>t.priority>s.priority);return i===-1?oe(this,Bt)[Bt].push(t):oe(this,Bt)[Bt].splice(i,0,t),t}o(YP,"_queue2");function JP(r){let e=oe(this,Bt)[Bt].indexOf(r);e!==-1&&oe(this,Bt)[Bt].splice(e,1)}o(JP,"_dequeue2");var Ou=Symbol("__queue");function Do(r){let e=o(t=>"error"in t&&!!t.error,"hasError");return r.filter(t=>!e(t))}o(Do,"filterNonFailedFiles");function No(r){return r.filter(e=>{var t;return!((t=e.progress)!=null&&t.uploadStarted)||!e.isRestored})}o(No,"filterFilesToEmitUploadStarted");var{AbortController:ku}=globalThis,{AbortSignal:BN}=globalThis,Au=o(function(r,e){r===void 0&&(r="Aborted");let t=new DOMException(r,"AbortError");return e!=null&&er(e,"cause")&&Object.defineProperty(t,"cause",{__proto__:null,configurable:!0,writable:!0,value:e.cause}),t},"createAbortError");function Oi(r,e){return r===!0?Object.keys(e):Array.isArray(r)?r:[]}o(Oi,"getAllowedMetaFields");function ee(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(ee,"_classPrivateFieldLooseBase");var QP=0;function at(r){return"__private_"+QP+++"_"+r}o(at,"_classPrivateFieldLooseKey");var ZP=1024*1024,jv={getChunkSize(r){return Math.ceil(r.size/1e4)},onProgress(){},onPartComplete(){},onSuccess(){},onError(r){throw r}};function e5(r){if(typeof r=="string")return parseInt(r,10);if(typeof r=="number")return r;throw new TypeError("Expected a number")}o(e5,"ensureInt");var Ta=Symbol("pausing upload, not an actual error"),_t=at("abortController"),nt=at("chunks"),zt=at("chunkState"),nr=at("data"),ar=at("file"),Oa=at("uploadHasStarted"),Pa=at("onError"),qs=at("onSuccess"),ki=at("shouldUseMultipart"),$s=at("isRestoring"),ka=at("onReject"),Hs=at("maxMultipartParts"),Fa=at("minPartSize"),Wp=at("initChunks"),Gp=at("createUpload"),xa=at("resumeUpload"),Ea=at("onPartProgress"),Ca=at("onPartComplete"),Kp=at("abortUpload"),Xp=class{static{o(this,"MultipartUploader")}constructor(e,t){var i,s;Object.defineProperty(this,Kp,{value:s5}),Object.defineProperty(this,xa,{value:i5}),Object.defineProperty(this,Gp,{value:r5}),Object.defineProperty(this,Wp,{value:t5}),Object.defineProperty(this,_t,{writable:!0,value:new ku}),Object.defineProperty(this,nt,{writable:!0,value:[]}),Object.defineProperty(this,zt,{writable:!0,value:[]}),Object.defineProperty(this,nr,{writable:!0,value:void 0}),Object.defineProperty(this,ar,{writable:!0,value:void 0}),Object.defineProperty(this,Oa,{writable:!0,value:!1}),Object.defineProperty(this,Pa,{writable:!0,value:void 0}),Object.defineProperty(this,qs,{writable:!0,value:void 0}),Object.defineProperty(this,ki,{writable:!0,value:void 0}),Object.defineProperty(this,$s,{writable:!0,value:void 0}),Object.defineProperty(this,ka,{writable:!0,value:o(n=>n?.cause===Ta?null:ee(this,Pa)[Pa](n),"value")}),Object.defineProperty(this,Hs,{writable:!0,value:1e4}),Object.defineProperty(this,Fa,{writable:!0,value:5*ZP}),Object.defineProperty(this,Ea,{writable:!0,value:o(n=>a=>{if(!a.lengthComputable)return;ee(this,zt)[zt][n].uploaded=e5(a.loaded);let l=ee(this,zt)[zt].reduce((u,d)=>u+d.uploaded,0);this.options.onProgress(l,ee(this,nr)[nr].size)},"value")}),Object.defineProperty(this,Ca,{writable:!0,value:o(n=>a=>{ee(this,nt)[nt][n]=null,ee(this,zt)[zt][n].etag=a,ee(this,zt)[zt][n].done=!0;let l={PartNumber:n+1,ETag:a};this.options.onPartComplete(l)},"value")}),this.options={...jv,...t},(s=(i=this.options).getChunkSize)!=null||(i.getChunkSize=jv.getChunkSize),ee(this,nr)[nr]=e,ee(this,ar)[ar]=t.file,ee(this,qs)[qs]=this.options.onSuccess,ee(this,Pa)[Pa]=this.options.onError,ee(this,ki)[ki]=this.options.shouldUseMultipart,ee(this,$s)[$s]=t.uploadId&&t.key,ee(this,Wp)[Wp]()}start(){ee(this,Oa)[Oa]?(ee(this,_t)[_t].signal.aborted||ee(this,_t)[_t].abort(Ta),ee(this,_t)[_t]=new ku,ee(this,xa)[xa]()):ee(this,$s)[$s]?(this.options.companionComm.restoreUploadFile(ee(this,ar)[ar],{uploadId:this.options.uploadId,key:this.options.key}),ee(this,xa)[xa]()):ee(this,Gp)[Gp]()}pause(){ee(this,_t)[_t].abort(Ta),ee(this,_t)[_t]=new ku}abort(e){e!=null&&e.really?ee(this,Kp)[Kp]():this.pause()}[Symbol.for("uppy test: getChunkState")](){return ee(this,zt)[zt]}};function t5(){let r=ee(this,nr)[nr].size,e=typeof ee(this,ki)[ki]=="function"?ee(this,ki)[ki](ee(this,ar)[ar]):!!ee(this,ki)[ki];if(e&&r>ee(this,Fa)[Fa]){let t=Math.max(this.options.getChunkSize(ee(this,nr)[nr]),ee(this,Fa)[Fa]),i=Math.floor(r/t);i>ee(this,Hs)[Hs]&&(i=ee(this,Hs)[Hs],t=r/ee(this,Hs)[Hs]),ee(this,nt)[nt]=Array(i);for(let s=0,n=0;s<r;s+=t,n++){let a=Math.min(r,s+t),l=o(()=>{let u=s;return ee(this,nr)[nr].slice(u,a)},"getData");if(ee(this,nt)[nt][n]={getData:l,onProgress:ee(this,Ea)[Ea](n),onComplete:ee(this,Ca)[Ca](n),shouldUseMultipart:e},ee(this,$s)[$s]){let u=s+t>r?r-s:t;ee(this,nt)[nt][n].setAsUploaded=()=>{ee(this,nt)[nt][n]=null,ee(this,zt)[zt][n].uploaded=u}}}}else ee(this,nt)[nt]=[{getData:o(()=>ee(this,nr)[nr],"getData"),onProgress:ee(this,Ea)[Ea](0),onComplete:ee(this,Ca)[Ca](0),shouldUseMultipart:e}];ee(this,zt)[zt]=ee(this,nt)[nt].map(()=>({uploaded:0}))}o(t5,"_initChunks2");function r5(){this.options.companionComm.uploadFile(ee(this,ar)[ar],ee(this,nt)[nt],ee(this,_t)[_t].signal).then(ee(this,qs)[qs],ee(this,ka)[ka]),ee(this,Oa)[Oa]=!0}o(r5,"_createUpload2");function i5(){this.options.companionComm.resumeUploadFile(ee(this,ar)[ar],ee(this,nt)[nt],ee(this,_t)[_t].signal).then(ee(this,qs)[qs],ee(this,ka)[ka])}o(i5,"_resumeUpload2");function s5(){ee(this,_t)[_t].abort(),this.options.companionComm.abortFileUpload(ee(this,ar)[ar]).catch(r=>this.options.log(r))}o(s5,"_abortUpload2");var Hv=Xp;function gt(r){if(r!=null&&r.aborted)throw Au("The operation was aborted",{cause:r.reason})}o(gt,"throwIfAborted");function o5(r){let{method:e="PUT",CanonicalUri:t="/",CanonicalQueryString:i="",SignedHeaders:s,HashedPayload:n}=r,a=Object.keys(s).map(l=>l.toLowerCase()).sort();return[e,t,i,...a.map(l=>`${l}:${s[l]}`),"",a.join(";"),n].join(`
`)}o(o5,"createCanonicalRequest");var Yp=new TextEncoder,Jp={name:"HMAC",hash:"SHA-256"};async function n5(r){let{subtle:e}=globalThis.crypto;return e.digest(Jp.hash,Yp.encode(r))}o(n5,"digest");async function a5(r){let{subtle:e}=globalThis.crypto;return e.importKey("raw",typeof r=="string"?Yp.encode(r):r,Jp,!1,["sign"])}o(a5,"generateHmacKey");function $v(r){let e=new Uint8Array(r),t="";for(let i=0;i<e.length;i++)t+=e[i].toString(16).padStart(2,"0");return t}o($v,"arrayBufferToHexString");async function Aa(r,e){let{subtle:t}=globalThis.crypto;return t.sign(Jp,await a5(r),Yp.encode(e))}o(Aa,"hash");async function Qp(r){let{accountKey:e,accountSecret:t,sessionToken:i,bucketName:s,Key:n,Region:a,expires:l,uploadId:u,partNumber:d}=r,p="s3",f=`${p}.${a}.amazonaws.com`,y=`/${s}/${encodeURI(n).replace(/[;?:@&=+$,#!'()*]/g,ke=>`%${ke.charCodeAt(0).toString(16).toUpperCase()}`)}`,v="UNSIGNED-PAYLOAD",_=new Date().toISOString().replace(/[-:]|\.\d+/g,""),R=_.slice(0,8),E=`${R}/${a}/${p}/aws4_request`,O=new URL(`https://${f}${y}`);O.searchParams.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),O.searchParams.set("X-Amz-Content-Sha256",v),O.searchParams.set("X-Amz-Credential",`${e}/${E}`),O.searchParams.set("X-Amz-Date",_),O.searchParams.set("X-Amz-Expires",l),O.searchParams.set("X-Amz-Security-Token",i),O.searchParams.set("X-Amz-SignedHeaders","host"),d&&O.searchParams.set("partNumber",d),u&&O.searchParams.set("uploadId",u),O.searchParams.set("x-id",d&&u?"UploadPart":"PutObject");let L=o5({CanonicalUri:y,CanonicalQueryString:O.search.slice(1),SignedHeaders:{host:f},HashedPayload:v}),B=$v(await n5(L)),G=["AWS4-HMAC-SHA256",_,E,B].join(`
`),J=await Aa(`AWS4${t}`,R),$=await Aa(J,a),W=await Aa($,p),te=await Aa(W,"aws4_request"),ae=$v(await Aa(te,G));return O.searchParams.set("X-Amz-Signature",ae),O}o(Qp,"createSignedURL");function ne(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(ne,"_classPrivateFieldLooseBase");var l5=0;function jt(r){return"__private_"+l5+++"_"+r}o(jt,"_classPrivateFieldLooseKey");function u5(r){let e=new URL(r);return e.search="",e.hash="",e.href}o(u5,"removeMetadataFromURL");var Ra=jt("abortMultipartUpload"),Pt=jt("cache"),Ua=jt("createMultipartUpload"),Ia=jt("fetchSignature"),Ma=jt("getUploadParameters"),Da=jt("listParts"),Gs=jt("previousRetryDelay"),Ks=jt("requests"),Vs=jt("retryDelays"),Ws=jt("sendCompletionRequest"),Ai=jt("setS3MultipartState"),Xs=jt("uploadPartBytes"),xt=jt("getFile"),Zp=jt("shouldRetry"),Na=jt("nonMultipartUpload"),Ru=class{static{o(this,"HTTPCommunicationQueue")}constructor(e,t,i,s){Object.defineProperty(this,Na,{value:d5}),Object.defineProperty(this,Zp,{value:c5}),Object.defineProperty(this,Ra,{writable:!0,value:void 0}),Object.defineProperty(this,Pt,{writable:!0,value:new WeakMap}),Object.defineProperty(this,Ua,{writable:!0,value:void 0}),Object.defineProperty(this,Ia,{writable:!0,value:void 0}),Object.defineProperty(this,Ma,{writable:!0,value:void 0}),Object.defineProperty(this,Da,{writable:!0,value:void 0}),Object.defineProperty(this,Gs,{writable:!0,value:void 0}),Object.defineProperty(this,Ks,{writable:!0,value:void 0}),Object.defineProperty(this,Vs,{writable:!0,value:void 0}),Object.defineProperty(this,Ws,{writable:!0,value:void 0}),Object.defineProperty(this,Ai,{writable:!0,value:void 0}),Object.defineProperty(this,Xs,{writable:!0,value:void 0}),Object.defineProperty(this,xt,{writable:!0,value:void 0}),ne(this,Ks)[Ks]=e,ne(this,Ai)[Ai]=i,ne(this,xt)[xt]=s,this.setOptions(t)}setOptions(e){let t=ne(this,Ks)[Ks];if("abortMultipartUpload"in e&&(ne(this,Ra)[Ra]=t.wrapPromiseFunction(e.abortMultipartUpload,{priority:1})),"createMultipartUpload"in e&&(ne(this,Ua)[Ua]=t.wrapPromiseFunction(e.createMultipartUpload,{priority:-1})),"signPart"in e&&(ne(this,Ia)[Ia]=t.wrapPromiseFunction(e.signPart)),"listParts"in e&&(ne(this,Da)[Da]=t.wrapPromiseFunction(e.listParts)),"completeMultipartUpload"in e&&(ne(this,Ws)[Ws]=t.wrapPromiseFunction(e.completeMultipartUpload,{priority:1})),"retryDelays"in e){var i;ne(this,Vs)[Vs]=(i=e.retryDelays)!=null?i:[]}"uploadPartBytes"in e&&(ne(this,Xs)[Xs]=t.wrapPromiseFunction(e.uploadPartBytes,{priority:1/0})),"getUploadParameters"in e&&(ne(this,Ma)[Ma]=t.wrapPromiseFunction(e.getUploadParameters))}async getUploadId(e,t){let i;for(;(i=ne(this,Pt)[Pt].get(e.data))!=null;)try{return await i}catch{}let s=ne(this,Ua)[Ua](ne(this,xt)[xt](e),t),n=o(()=>{s.abort(t.reason),ne(this,Pt)[Pt].delete(e.data)},"abortPromise");return t.addEventListener("abort",n,{once:!0}),ne(this,Pt)[Pt].set(e.data,s),s.then(async a=>{t.removeEventListener("abort",n),ne(this,Ai)[Ai](e,a),ne(this,Pt)[Pt].set(e.data,a)},()=>{t.removeEventListener("abort",n),ne(this,Pt)[Pt].delete(e.data)}),s}async abortFileUpload(e){let t=ne(this,Pt)[Pt].get(e.data);if(t==null)return;ne(this,Pt)[Pt].delete(e.data),ne(this,Ai)[Ai](e,Object.create(null));let i;try{i=await t}catch{return}await ne(this,Ra)[Ra](ne(this,xt)[xt](e),i)}async uploadFile(e,t,i){if(gt(i),t.length===1&&!t[0].shouldUseMultipart)return ne(this,Na)[Na](e,t[0],i);let{uploadId:s,key:n}=await this.getUploadId(e,i);gt(i);try{let a=await Promise.all(t.map((l,u)=>this.uploadChunk(e,u+1,l,i)));return gt(i),await ne(this,Ws)[Ws](ne(this,xt)[xt](e),{key:n,uploadId:s,parts:a,signal:i},i).abortOn(i)}catch(a){throw a?.cause!==Ta&&a?.name!=="AbortError"&&this.abortFileUpload(e),a}}restoreUploadFile(e,t){ne(this,Pt)[Pt].set(e.data,t)}async resumeUploadFile(e,t,i){if(gt(i),t.length===1&&t[0]!=null&&!t[0].shouldUseMultipart)return ne(this,Na)[Na](e,t[0],i);let{uploadId:s,key:n}=await this.getUploadId(e,i);gt(i);let a=await ne(this,Da)[Da](ne(this,xt)[xt](e),{uploadId:s,key:n,signal:i},i).abortOn(i);gt(i);let l=await Promise.all(t.map((u,d)=>{let p=d+1,f=a.find(y=>{let{PartNumber:v}=y;return v===p});return f==null?this.uploadChunk(e,p,u,i):(u==null||u.setAsUploaded==null||u.setAsUploaded(),{PartNumber:p,ETag:f.ETag})}));return gt(i),ne(this,Ws)[Ws](ne(this,xt)[xt](e),{key:n,uploadId:s,parts:l,signal:i},i).abortOn(i)}async uploadChunk(e,t,i,s){gt(s);let{uploadId:n,key:a}=await this.getUploadId(e,s),l=ne(this,Vs)[Vs].values(),u=ne(this,Vs)[Vs].values(),d=o(()=>{let p=l.next();return p==null||p.done?null:p.value},"shouldRetrySignature");for(;;){gt(s);let p=i.getData(),{onProgress:f,onComplete:y}=i,v;try{v=await ne(this,Ia)[Ia](ne(this,xt)[xt](e),{uploadId:n,key:a,partNumber:t,body:p,signal:s}).abortOn(s)}catch(_){let R=d();if(R==null||s.aborted)throw _;await new Promise(E=>setTimeout(E,R));continue}gt(s);try{return{PartNumber:t,...await ne(this,Xs)[Xs]({signature:v,body:p,size:p.size,onProgress:f,onComplete:y,signal:s}).abortOn(s)}}catch(_){if(!await ne(this,Zp)[Zp](_,u))throw _}}}};async function c5(r,e){var t;let i=ne(this,Ks)[Ks],s=r==null||(t=r.source)==null?void 0:t.status;if(s==null)return!1;if(s===403&&r.message==="Request has expired"){if(!i.isPaused){if(i.limit===1||ne(this,Gs)[Gs]==null){let n=e.next();if(n==null||n.done)return!1;ne(this,Gs)[Gs]=n.value}i.rateLimit(0),await new Promise(n=>setTimeout(n,ne(this,Gs)[Gs]))}}else if(s===429){if(!i.isPaused){let n=e.next();if(n==null||n.done)return!1;i.rateLimit(n.value)}}else{if(s>400&&s<500&&s!==409)return!1;if(typeof navigator<"u"&&navigator.onLine===!1)i.isPaused||(i.pause(),window.addEventListener("online",()=>{i.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(c5,"_shouldRetry2");async function d5(r,e,t){var i;let{method:s="POST",url:n,fields:a,headers:l}=await ne(this,Ma)[Ma](ne(this,xt)[xt](r),{signal:t}).abortOn(t),u,d=e.getData();if(s.toUpperCase()==="POST"){let _=new FormData;Object.entries(a).forEach(R=>{let[E,O]=R;return _.set(E,O)}),_.set("file",d),u=_}else u=d;let{onProgress:p,onComplete:f}=e,y=await ne(this,Xs)[Xs]({signature:{url:n,headers:l,method:s},body:u,size:d.size,onProgress:p,onComplete:f,signal:t}).abortOn(t),v=a?.key;return ne(this,Ai)[Ai](r,{key:v}),{...y,location:(i=y.location)!=null?i:u5(n),bucket:a?.bucket,key:v}}o(d5,"_nonMultipartUpload2");function ie(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(ie,"_classPrivateFieldLooseBase");var p5=0;function Xt(r){return"__private_"+p5+++"_"+r}o(Xt,"_classPrivateFieldLooseKey");var h5={version:"4.2.3"};function Mo(r){if(r!=null&&r.error){let e=new Error(r.message);throw Object.assign(e,r.error),e}return r}o(Mo,"assertServerError");function Vv(r){let e=r.Expiration;if(e){let t=Math.floor((new Date(e)-Date.now())/1e3);if(t>9)return t}}o(Vv,"getExpiry");function qv(r){let{meta:e,allowedMetaFields:t,querify:i=!1}=r,s=t??Object.keys(e);return e?Object.fromEntries(s.filter(n=>e[n]!=null).map(n=>{let a=i?`metadata[${n}]`:n,l=String(e[n]);return[a,l]})):{}}o(qv,"getAllowedMetadata");var f5={allowedMetaFields:!0,limit:6,getTemporarySecurityCredentials:!1,shouldUseMultipart:o(r=>(r.size||0)>100*1024*1024,"shouldUseMultipart"),retryDelays:[0,1e3,3e3,5e3]},Ys=Xt("companionCommunicationQueue"),Ie=Xt("client"),La=Xt("setClient"),Ht=Xt("assertHost"),Ft=Xt("cachedTemporaryCredentials"),eh=Xt("getTemporarySecurityCredentials"),th=Xt("setS3MultipartState"),Qs=Xt("getFile"),rh=Xt("uploadLocalFile"),ih=Xt("getCompanionClientArgs"),Ba=Xt("upload"),Js=Xt("setCompanionHeaders"),Ri=Xt("setResumableUploadsCapability"),za=Xt("resetResumableCapability"),Lo=class r extends Oe{static{o(this,"AwsS3Multipart")}constructor(e,t){var i;super(e,{...f5,uploadPartBytes:r.uploadPartBytes,createMultipartUpload:null,listParts:null,abortMultipartUpload:null,completeMultipartUpload:null,signPart:null,getUploadParameters:null,...t}),Object.defineProperty(this,ih,{value:b5}),Object.defineProperty(this,rh,{value:v5}),Object.defineProperty(this,eh,{value:y5}),Object.defineProperty(this,Ht,{value:g5}),Object.defineProperty(this,La,{value:m5}),Object.defineProperty(this,Ys,{writable:!0,value:void 0}),Object.defineProperty(this,Ie,{writable:!0,value:void 0}),Object.defineProperty(this,Ft,{writable:!0,value:void 0}),Object.defineProperty(this,th,{writable:!0,value:o((n,a)=>{let{key:l,uploadId:u}=a,d=this.uppy.getFile(n.id);d!=null&&this.uppy.setFileState(n.id,{s3Multipart:{...d.s3Multipart,key:l,uploadId:u}})},"value")}),Object.defineProperty(this,Qs,{writable:!0,value:o(n=>this.uppy.getFile(n.id)||n,"value")}),Object.defineProperty(this,Ba,{writable:!0,value:o(async n=>{if(n.length===0)return;let a=this.uppy.getFilesByIds(n),l=Do(a),u=No(l);this.uppy.emit("upload-start",u);let d=l.map(f=>{if(f.isRemote){let y=o(()=>this.requests,"getQueue");ie(this,Ri)[Ri](!1);let v=new AbortController,_=o(E=>{E.id===f.id&&v.abort()},"removedHandler");this.uppy.on("file-removed",_);let R=this.uppy.getRequestClientForFile(f).uploadRemoteFile(f,ie(this,ih)[ih](f),{signal:v.signal,getQueue:y});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",_)},{priority:-1})(),R}return ie(this,rh)[rh](f)}),p=await Promise.allSettled(d);return ie(this,Ri)[Ri](!0),p},"value")}),Object.defineProperty(this,Js,{writable:!0,value:o(()=>{var n;(n=ie(this,Ie)[Ie])==null||n.setCompanionHeaders(this.opts.headers)},"value")}),Object.defineProperty(this,Ri,{writable:!0,value:o(n=>{let{capabilities:a}=this.uppy.getState();this.uppy.setState({capabilities:{...a,resumableUploads:n}})},"value")}),Object.defineProperty(this,za,{writable:!0,value:o(()=>{ie(this,Ri)[Ri](!0)},"value")}),this.type="uploader",this.id=this.opts.id||"AwsS3Multipart",ie(this,La)[La](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));this.requests=(i=this.opts.rateLimitedQueue)!=null?i:new Sr(this.opts.limit),ie(this,Ys)[Ys]=new Ru(this.requests,this.opts,ie(this,th)[th],ie(this,Qs)[Qs]),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null)}[Symbol.for("uppy test: getClient")](){return ie(this,Ie)[Ie]}setOptions(e){ie(this,Ys)[Ys].setOptions(e),super.setOptions(e),ie(this,La)[La](e)}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)}createMultipartUpload(e,t){ie(this,Ht)[Ht]("createMultipartUpload"),gt(t);let i=Oi(this.opts.allowedMetaFields,e.meta),s=qv({meta:e.meta,allowedMetaFields:i});return ie(this,Ie)[Ie].post("s3/multipart",{filename:e.name,type:e.type,metadata:s},{signal:t}).then(Mo)}listParts(e,t,i){var s;let{key:n,uploadId:a,signal:l}=t;(s=l)!=null||(l=i),ie(this,Ht)[Ht]("listParts"),gt(l);let u=encodeURIComponent(n);return ie(this,Ie)[Ie].get(`s3/multipart/${encodeURIComponent(a)}?key=${u}`,{signal:l}).then(Mo)}completeMultipartUpload(e,t,i){var s;let{key:n,uploadId:a,parts:l,signal:u}=t;(s=u)!=null||(u=i),ie(this,Ht)[Ht]("completeMultipartUpload"),gt(u);let d=encodeURIComponent(n),p=encodeURIComponent(a);return ie(this,Ie)[Ie].post(`s3/multipart/${p}/complete?key=${d}`,{parts:l.map(f=>{let{ETag:y,PartNumber:v}=f;return{ETag:y,PartNumber:v}})},{signal:u}).then(Mo)}async createSignedURL(e,t){let i=await ie(this,eh)[eh](t),s=Vv(i.credentials)||604800,{uploadId:n,key:a,partNumber:l}=t;return{method:"PUT",expires:s,fields:{},url:`${await Qp({accountKey:i.credentials.AccessKeyId,accountSecret:i.credentials.SecretAccessKey,sessionToken:i.credentials.SessionToken,expires:s,bucketName:i.bucket,Region:i.region,Key:a??`${crypto.randomUUID()}-${e.name}`,uploadId:n,partNumber:l})}`,headers:{"Content-Type":e.type}}}signPart(e,t){let{uploadId:i,key:s,partNumber:n,signal:a}=t;if(ie(this,Ht)[Ht]("signPart"),gt(a),i==null||s==null||n==null)throw new Error("Cannot sign without a key, an uploadId, and a partNumber");let l=encodeURIComponent(s);return ie(this,Ie)[Ie].get(`s3/multipart/${encodeURIComponent(i)}/${n}?key=${l}`,{signal:a}).then(Mo)}abortMultipartUpload(e,t){let{key:i,uploadId:s,signal:n}=t;ie(this,Ht)[Ht]("abortMultipartUpload");let a=encodeURIComponent(i),l=encodeURIComponent(s);return ie(this,Ie)[Ie].delete(`s3/multipart/${l}?key=${a}`,void 0,{signal:n}).then(Mo)}getUploadParameters(e,t){ie(this,Ht)[Ht]("getUploadParameters");let{meta:i}=e,{type:s,name:n}=i,a=Oi(this.opts.allowedMetaFields,e.meta),l=qv({meta:i,allowedMetaFields:a,querify:!0}),u=new URLSearchParams({filename:n,type:s,...l});return ie(this,Ie)[Ie].get(`s3/params?${u}`,t)}static async uploadPartBytes(e){let{signature:{url:t,expires:i,headers:s,method:n="PUT"},body:a,size:l=a.size,onProgress:u,onComplete:d,signal:p}=e;if(gt(p),t==null)throw new Error("Cannot upload to an undefined URL");return new Promise((f,y)=>{let v=new XMLHttpRequest;v.open(n,t,!0),s&&Object.keys(s).forEach(E=>{v.setRequestHeader(E,s[E])}),v.responseType="text",typeof i=="number"&&(v.timeout=i*1e3);function _(){v.abort()}o(_,"onabort");function R(){p?.removeEventListener("abort",_)}o(R,"cleanup"),p?.addEventListener("abort",_),v.upload.addEventListener("progress",E=>{u(E)}),v.addEventListener("abort",()=>{R(),y(Au())}),v.addEventListener("timeout",()=>{R();let E=new Error("Request has expired");E.source={status:403},y(E)}),v.addEventListener("load",()=>{if(R(),v.status===403&&v.responseText.includes("<Message>Request has expired</Message>")){let G=new Error("Request has expired");G.source=v,y(G);return}if(v.status<200||v.status>=300){let G=new Error("Non 2xx");G.source=v,y(G);return}u?.({loaded:l,lengthComputable:!0});let E=v.getAllResponseHeaders().trim().split(/[\r\n]+/),O={__proto__:null};for(let G of E){let J=G.split(": "),$=J.shift(),W=J.join(": ");O[$]=W}let{etag:L,location:B}=O;if(n.toUpperCase()==="POST"&&B==null&&console.error("@uppy/aws-s3: 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/#setting-up-your-s3-bucket"),L==null){console.error("@uppy/aws-s3: 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/#setting-up-your-s3-bucket");return}d?.(L),f({...O,ETag:L})}),v.addEventListener("error",E=>{R();let O=new Error("Unknown error");O.source=E.target,y(O)}),v.send(a)})}install(){ie(this,Ri)[Ri](!0),this.uppy.addPreProcessor(ie(this,Js)[Js]),this.uppy.addUploader(ie(this,Ba)[Ba]),this.uppy.on("cancel-all",ie(this,za)[za])}uninstall(){this.uppy.removePreProcessor(ie(this,Js)[Js]),this.uppy.removeUploader(ie(this,Ba)[Ba]),this.uppy.off("cancel-all",ie(this,za)[za])}};function m5(r){r==null||!("endpoint"in r||"companionUrl"in r||"headers"in r||"companionHeaders"in r||"cookiesRule"in r||"companionCookiesRule"in r)||("companionUrl"in r&&!("endpoint"in r)&&this.uppy.log("`companionUrl` option has been removed in @uppy/aws-s3, use `endpoint` instead.","warning"),"companionHeaders"in r&&!("headers"in r)&&this.uppy.log("`companionHeaders` option has been removed in @uppy/aws-s3, use `headers` instead.","warning"),"companionCookiesRule"in r&&!("cookiesRule"in r)&&this.uppy.log("`companionCookiesRule` option has been removed in @uppy/aws-s3, use `cookiesRule` instead.","warning"),"endpoint"in r?ie(this,Ie)[Ie]=new ht(this.uppy,{pluginId:this.id,provider:"AWS",companionUrl:this.opts.endpoint,companionHeaders:this.opts.headers,companionCookiesRule:this.opts.cookiesRule}):("headers"in r&&ie(this,Js)[Js](),"cookiesRule"in r&&(ie(this,Ie)[Ie].opts.companionCookiesRule=r.cookiesRule)))}o(m5,"_setClient2");function g5(r){if(!ie(this,Ie)[Ie])throw new Error(`Expected a \`endpoint\` option containing a URL, or if you are not using Companion, a custom \`${r}\` implementation.`)}o(g5,"_assertHost2");async function y5(r){if(gt(r?.signal),ie(this,Ft)[Ft]==null){let{getTemporarySecurityCredentials:e}=this.opts;e===!0?(ie(this,Ht)[Ht]("getTemporarySecurityCredentials"),ie(this,Ft)[Ft]=ie(this,Ie)[Ie].get("s3/sts",r).then(Mo)):ie(this,Ft)[Ft]=e(r),ie(this,Ft)[Ft]=await ie(this,Ft)[Ft],setTimeout(()=>{ie(this,Ft)[Ft]=null},(Vv(ie(this,Ft)[Ft].credentials)||0)*500)}return ie(this,Ft)[Ft]}o(y5,"_getTemporarySecurityCredentials2");function v5(r){var e=this;return new Promise((t,i)=>{let s=o((d,p)=>{var f;let y=this.uppy.getFile(r.id);this.uppy.emit("upload-progress",y,{uploadStarted:(f=y.progress.uploadStarted)!=null?f:0,bytesUploaded:d,bytesTotal:p})},"onProgress"),n=o(d=>{this.uppy.log(d),this.uppy.emit("upload-error",r,d),this.resetUploaderReferences(r.id),i(d)},"onError"),a=o(d=>{let p={body:{...d},status:200,uploadURL:d.location};this.resetUploaderReferences(r.id),this.uppy.emit("upload-success",ie(this,Qs)[Qs](r),p),d.location&&this.uppy.log(`Download ${r.name} from ${d.location}`),t()},"onSuccess"),l=new Hv(r.data,{companionComm:ie(this,Ys)[Ys],log:o(function(){return e.uppy.log(...arguments)},"log"),getChunkSize:this.opts.getChunkSize?this.opts.getChunkSize.bind(this):void 0,onProgress:s,onError:n,onSuccess:a,onPartComplete:o(d=>{this.uppy.emit("s3-multipart:part-uploaded",ie(this,Qs)[Qs](r),d)},"onPartComplete"),file:r,shouldUseMultipart:this.opts.shouldUseMultipart,...r.s3Multipart});this.uploaders[r.id]=l;let u=new Ei(this.uppy);this.uploaderEvents[r.id]=u,u.onFileRemove(r.id,d=>{l.abort(),this.resetUploaderReferences(r.id,{abort:!0}),t(`upload ${d} was removed`)}),u.onCancelAll(r.id,()=>{l.abort(),this.resetUploaderReferences(r.id,{abort:!0}),t(`upload ${r.id} was canceled`)}),u.onFilePause(r.id,d=>{d?l.pause():l.start()}),u.onPauseAll(r.id,()=>{l.pause()}),u.onResumeAll(r.id,()=>{l.start()}),l.start()})}o(v5,"_uploadLocalFile2");function b5(r){var e;return{...(e=r.remote)==null?void 0:e.body,protocol:"s3-multipart",size:r.data.size,metadata:r.meta}}o(b5,"_getCompanionClientArgs2");Lo.VERSION=h5.version;function Bo(r){"@babel/helpers - typeof";return Bo=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},Bo(r)}o(Bo,"_typeof");function Wv(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,S5(i.key),i)}}o(Wv,"_defineProperties");function w5(r,e,t){return e&&Wv(r.prototype,e),t&&Wv(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(w5,"_createClass");function S5(r){var e=_5(r,"string");return Bo(e)=="symbol"?e:e+""}o(S5,"_toPropertyKey");function _5(r,e){if(Bo(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(Bo(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}o(_5,"_toPrimitive");function P5(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}o(P5,"_classCallCheck");function x5(r,e,t){return e=Ha(e),F5(r,oh()?Reflect.construct(e,t||[],Ha(r).constructor):e.apply(r,t))}o(x5,"_callSuper");function F5(r,e){if(e&&(Bo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return E5(r)}o(F5,"_possibleConstructorReturn");function E5(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}o(E5,"_assertThisInitialized");function C5(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&ja(r,e)}o(C5,"_inherits");function sh(r){var e=typeof Map=="function"?new Map:void 0;return sh=o(function(i){if(i===null||!O5(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(i))return e.get(i);e.set(i,s)}function s(){return T5(i,arguments,Ha(this).constructor)}return o(s,"Wrapper"),s.prototype=Object.create(i.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),ja(s,i)},"_wrapNativeSuper"),sh(r)}o(sh,"_wrapNativeSuper");function T5(r,e,t){if(oh())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var s=new(r.bind.apply(r,i));return t&&ja(s,t.prototype),s}o(T5,"_construct");function oh(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oh=o(function(){return!!r},"_isNativeReflectConstruct"))()}o(oh,"_isNativeReflectConstruct");function O5(r){try{return Function.toString.call(r).indexOf("[native code]")!==-1}catch{return typeof r=="function"}}o(O5,"_isNativeFunction");function ja(r,e){return ja=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),ja(r,e)}o(ja,"_setPrototypeOf");function Ha(r){return Ha=Object.setPrototypeOf?Object.getPrototypeOf.bind():o(function(t){return t.__proto__||Object.getPrototypeOf(t)},"_getPrototypeOf"),Ha(r)}o(Ha,"_getPrototypeOf");var k5=function(r){function e(t){var i,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(P5(this,e),i=x5(this,e,[t]),i.originalRequest=n,i.originalResponse=a,i.causingError=s,s!=null&&(t+=", caused by ".concat(s.toString())),n!=null){var l=n.getHeader("X-Request-ID")||"n/a",u=n.getMethod(),d=n.getURL(),p=a?a.getStatus():"n/a",f=a?a.getBody()||"":"n/a";t+=", originated from request (method: ".concat(u,", url: ").concat(d,", response code: ").concat(p,", response text: ").concat(f,", request id: ").concat(l,")")}return i.message=t,i}return o(e,"DetailedError"),C5(e,r),w5(e)}(sh(Error)),zo=k5;var A5=!1;function Ji(r){A5&&console.log(r)}o(Ji,"log");function $a(r){"@babel/helpers - typeof";return $a=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},$a(r)}o($a,"_typeof");function R5(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}o(R5,"_classCallCheck");function Gv(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,I5(i.key),i)}}o(Gv,"_defineProperties");function U5(r,e,t){return e&&Gv(r.prototype,e),t&&Gv(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(U5,"_createClass");function I5(r){var e=D5(r,"string");return $a(e)=="symbol"?e:e+""}o(I5,"_toPropertyKey");function D5(r,e){if($a(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if($a(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}o(D5,"_toPrimitive");var Kv=function(){function r(){R5(this,r)}return o(r,"NoopUrlStorage"),U5(r,[{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,i){return Promise.resolve(null)},"addUpload")}])}();var e0="3.7.7",N5=e0,Ho=typeof Buffer=="function",Xv=typeof TextDecoder=="function"?new TextDecoder:void 0,Yv=typeof TextEncoder=="function"?new TextEncoder:void 0,M5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",qa=Array.prototype.slice.call(M5),Uu=(r=>{let e={};return r.forEach((t,i)=>e[t]=i),e})(qa),L5=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Et=String.fromCharCode.bind(String),Jv=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):r=>new Uint8Array(Array.prototype.slice.call(r,0)),t0=o(r=>r.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),"_mkUriSafe"),r0=o(r=>r.replace(/[^A-Za-z0-9\+\/]/g,""),"_tidyB64"),i0=o(r=>{let e,t,i,s,n="",a=r.length%3;for(let l=0;l<r.length;){if((t=r.charCodeAt(l++))>255||(i=r.charCodeAt(l++))>255||(s=r.charCodeAt(l++))>255)throw new TypeError("invalid character found");e=t<<16|i<<8|s,n+=qa[e>>18&63]+qa[e>>12&63]+qa[e>>6&63]+qa[e&63]}return a?n.slice(0,a-3)+"===".substring(a):n},"btoaPolyfill"),lh=typeof btoa=="function"?r=>btoa(r):Ho?r=>Buffer.from(r,"binary").toString("base64"):i0,nh=Ho?r=>Buffer.from(r).toString("base64"):r=>{let t=[];for(let i=0,s=r.length;i<s;i+=4096)t.push(Et.apply(null,r.subarray(i,i+4096)));return lh(t.join(""))},Iu=o((r,e=!1)=>e?t0(nh(r)):nh(r),"fromUint8Array"),B5=o(r=>{if(r.length<2){var e=r.charCodeAt(0);return e<128?r:e<2048?Et(192|e>>>6)+Et(128|e&63):Et(224|e>>>12&15)+Et(128|e>>>6&63)+Et(128|e&63)}else{var e=65536+(r.charCodeAt(0)-55296)*1024+(r.charCodeAt(1)-56320);return Et(240|e>>>18&7)+Et(128|e>>>12&63)+Et(128|e>>>6&63)+Et(128|e&63)}},"cb_utob"),z5=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,s0=o(r=>r.replace(z5,B5),"utob"),Qv=Ho?r=>Buffer.from(r,"utf8").toString("base64"):Yv?r=>nh(Yv.encode(r)):r=>lh(s0(r)),jo=o((r,e=!1)=>e?t0(Qv(r)):Qv(r),"encode"),Zv=o(r=>jo(r,!0),"encodeURI"),j5=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,H5=o(r=>{switch(r.length){case 4:var e=(7&r.charCodeAt(0))<<18|(63&r.charCodeAt(1))<<12|(63&r.charCodeAt(2))<<6|63&r.charCodeAt(3),t=e-65536;return Et((t>>>10)+55296)+Et((t&1023)+56320);case 3:return Et((15&r.charCodeAt(0))<<12|(63&r.charCodeAt(1))<<6|63&r.charCodeAt(2));default:return Et((31&r.charCodeAt(0))<<6|63&r.charCodeAt(1))}},"cb_btou"),o0=o(r=>r.replace(j5,H5),"btou"),n0=o(r=>{if(r=r.replace(/\s+/g,""),!L5.test(r))throw new TypeError("malformed base64.");r+="==".slice(2-(r.length&3));let e,t="",i,s;for(let n=0;n<r.length;)e=Uu[r.charAt(n++)]<<18|Uu[r.charAt(n++)]<<12|(i=Uu[r.charAt(n++)])<<6|(s=Uu[r.charAt(n++)]),t+=i===64?Et(e>>16&255):s===64?Et(e>>16&255,e>>8&255):Et(e>>16&255,e>>8&255,e&255);return t},"atobPolyfill"),uh=typeof atob=="function"?r=>atob(r0(r)):Ho?r=>Buffer.from(r,"base64").toString("binary"):n0,a0=Ho?r=>Jv(Buffer.from(r,"base64")):r=>Jv(uh(r).split("").map(e=>e.charCodeAt(0))),l0=o(r=>a0(u0(r)),"toUint8Array"),$5=Ho?r=>Buffer.from(r,"base64").toString("utf8"):Xv?r=>Xv.decode(a0(r)):r=>o0(uh(r)),u0=o(r=>r0(r.replace(/[-_]/g,e=>e=="-"?"+":"/")),"_unURI"),ah=o(r=>$5(u0(r)),"decode"),q5=o(r=>{if(typeof r!="string")return!1;let e=r.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},"isValid"),c0=o(r=>({value:r,enumerable:!1,writable:!0,configurable:!0}),"_noEnum"),d0=o(function(){let r=o((e,t)=>Object.defineProperty(String.prototype,e,c0(t)),"_add");r("fromBase64",function(){return ah(this)}),r("toBase64",function(e){return jo(this,e)}),r("toBase64URI",function(){return jo(this,!0)}),r("toBase64URL",function(){return jo(this,!0)}),r("toUint8Array",function(){return l0(this)})},"extendString"),p0=o(function(){let r=o((e,t)=>Object.defineProperty(Uint8Array.prototype,e,c0(t)),"_add");r("toBase64",function(e){return Iu(this,e)}),r("toBase64URI",function(){return Iu(this,!0)}),r("toBase64URL",function(){return Iu(this,!0)})},"extendUint8Array"),V5=o(()=>{d0(),p0()},"extendBuiltins"),h0={version:e0,VERSION:N5,atob:uh,atobPolyfill:n0,btoa:lh,btoaPolyfill:i0,fromBase64:ah,toBase64:jo,encode:jo,encodeURI:Zv,encodeURL:Zv,utob:s0,btou:o0,decode:ah,isValid:q5,fromUint8Array:Iu,toUint8Array:l0,extendString:d0,extendUint8Array:p0,extendBuiltins:V5};var B0=be(E0());function hh(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){var e=Math.random()*16|0,t=r==="x"?e:e&3|8;return t.toString(16)})}o(hh,"uuid");function fh(){"use strict";fh=o(function(){return e},"_regeneratorRuntime");var r,e={},t=Object.prototype,i=t.hasOwnProperty,s=Object.defineProperty||function(C,S,P){C[S]=P.value},n=typeof Symbol=="function"?Symbol:{},a=n.iterator||"@@iterator",l=n.asyncIterator||"@@asyncIterator",u=n.toStringTag||"@@toStringTag";function d(C,S,P){return Object.defineProperty(C,S,{value:P,enumerable:!0,configurable:!0,writable:!0}),C[S]}o(d,"define");try{d({},"")}catch{d=o(function(P,M,H){return P[M]=H},"define")}function p(C,S,P,M){var H=S&&S.prototype instanceof O?S:O,j=Object.create(H.prototype),U=new Re(M||[]);return s(j,"_invoke",{value:ke(C,P,U)}),j}o(p,"wrap");function f(C,S,P){try{return{type:"normal",arg:C.call(S,P)}}catch(M){return{type:"throw",arg:M}}}o(f,"tryCatch"),e.wrap=p;var y="suspendedStart",v="suspendedYield",_="executing",R="completed",E={};function O(){}o(O,"Generator");function L(){}o(L,"GeneratorFunction");function B(){}o(B,"GeneratorFunctionPrototype");var G={};d(G,a,function(){return this});var J=Object.getPrototypeOf,$=J&&J(J(Xe([])));$&&$!==t&&i.call($,a)&&(G=$);var W=B.prototype=O.prototype=Object.create(G);function te(C){["next","throw","return"].forEach(function(S){d(C,S,function(P){return this._invoke(S,P)})})}o(te,"defineIteratorMethods");function ae(C,S){function P(H,j,U,T){var k=f(C[H],C,j);if(k.type!=="throw"){var N=k.arg,Y=N.value;return Y&&Zs(Y)=="object"&&i.call(Y,"__await")?S.resolve(Y.__await).then(function(Q){P("next",Q,U,T)},function(Q){P("throw",Q,U,T)}):S.resolve(Y).then(function(Q){N.value=Q,U(N)},function(Q){return P("throw",Q,U,T)})}T(k.arg)}o(P,"invoke");var M;s(this,"_invoke",{value:o(function(j,U){function T(){return new S(function(k,N){P(j,U,k,N)})}return o(T,"callInvokeWithMethodAndArg"),M=M?M.then(T,T):T()},"value")})}o(ae,"AsyncIterator");function ke(C,S,P){var M=y;return function(H,j){if(M===_)throw Error("Generator is already running");if(M===R){if(H==="throw")throw j;return{value:r,done:!0}}for(P.method=H,P.arg=j;;){var U=P.delegate;if(U){var T=Ae(U,P);if(T){if(T===E)continue;return T}}if(P.method==="next")P.sent=P._sent=P.arg;else if(P.method==="throw"){if(M===y)throw M=R,P.arg;P.dispatchException(P.arg)}else P.method==="return"&&P.abrupt("return",P.arg);M=_;var k=f(C,S,P);if(k.type==="normal"){if(M=P.done?R:v,k.arg===E)continue;return{value:k.arg,done:P.done}}k.type==="throw"&&(M=R,P.method="throw",P.arg=k.arg)}}}o(ke,"makeInvokeMethod");function Ae(C,S){var P=S.method,M=C.iterator[P];if(M===r)return S.delegate=null,P==="throw"&&C.iterator.return&&(S.method="return",S.arg=r,Ae(C,S),S.method==="throw")||P!=="return"&&(S.method="throw",S.arg=new TypeError("The iterator does not provide a '"+P+"' method")),E;var H=f(M,C.iterator,S.arg);if(H.type==="throw")return S.method="throw",S.arg=H.arg,S.delegate=null,E;var j=H.arg;return j?j.done?(S[C.resultName]=j.value,S.next=C.nextLoc,S.method!=="return"&&(S.method="next",S.arg=r),S.delegate=null,E):j:(S.method="throw",S.arg=new TypeError("iterator result is not an object"),S.delegate=null,E)}o(Ae,"maybeInvokeDelegate");function qe(C){var S={tryLoc:C[0]};1 in C&&(S.catchLoc=C[1]),2 in C&&(S.finallyLoc=C[2],S.afterLoc=C[3]),this.tryEntries.push(S)}o(qe,"pushTryEntry");function Fe(C){var S=C.completion||{};S.type="normal",delete S.arg,C.completion=S}o(Fe,"resetTryEntry");function Re(C){this.tryEntries=[{tryLoc:"root"}],C.forEach(qe,this),this.reset(!0)}o(Re,"Context");function Xe(C){if(C||C===""){var S=C[a];if(S)return S.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var P=-1,M=o(function H(){for(;++P<C.length;)if(i.call(C,P))return H.value=C[P],H.done=!1,H;return H.value=r,H.done=!0,H},"next");return M.next=M}}throw new TypeError(Zs(C)+" is not iterable")}return o(Xe,"values"),L.prototype=B,s(W,"constructor",{value:B,configurable:!0}),s(B,"constructor",{value:L,configurable:!0}),L.displayName=d(B,u,"GeneratorFunction"),e.isGeneratorFunction=function(C){var S=typeof C=="function"&&C.constructor;return!!S&&(S===L||(S.displayName||S.name)==="GeneratorFunction")},e.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,B):(C.__proto__=B,d(C,u,"GeneratorFunction")),C.prototype=Object.create(W),C},e.awrap=function(C){return{__await:C}},te(ae.prototype),d(ae.prototype,l,function(){return this}),e.AsyncIterator=ae,e.async=function(C,S,P,M,H){H===void 0&&(H=Promise);var j=new ae(p(C,S,P,M),H);return e.isGeneratorFunction(S)?j:j.next().then(function(U){return U.done?U.value:j.next()})},te(W),d(W,u,"Generator"),d(W,a,function(){return this}),d(W,"toString",function(){return"[object Generator]"}),e.keys=function(C){var S=Object(C),P=[];for(var M in S)P.push(M);return P.reverse(),o(function H(){for(;P.length;){var j=P.pop();if(j in S)return H.value=j,H.done=!1,H}return H.done=!0,H},"next")},e.values=Xe,Re.prototype={constructor:Re,reset:o(function(S){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Fe),!S)for(var P in this)P.charAt(0)==="t"&&i.call(this,P)&&!isNaN(+P.slice(1))&&(this[P]=r)},"reset"),stop:o(function(){this.done=!0;var S=this.tryEntries[0].completion;if(S.type==="throw")throw S.arg;return this.rval},"stop"),dispatchException:o(function(S){if(this.done)throw S;var P=this;function M(N,Y){return U.type="throw",U.arg=S,P.next=N,Y&&(P.method="next",P.arg=r),!!Y}o(M,"handle");for(var H=this.tryEntries.length-1;H>=0;--H){var j=this.tryEntries[H],U=j.completion;if(j.tryLoc==="root")return M("end");if(j.tryLoc<=this.prev){var T=i.call(j,"catchLoc"),k=i.call(j,"finallyLoc");if(T&&k){if(this.prev<j.catchLoc)return M(j.catchLoc,!0);if(this.prev<j.finallyLoc)return M(j.finallyLoc)}else if(T){if(this.prev<j.catchLoc)return M(j.catchLoc,!0)}else{if(!k)throw Error("try statement without catch or finally");if(this.prev<j.finallyLoc)return M(j.finallyLoc)}}}},"dispatchException"),abrupt:o(function(S,P){for(var M=this.tryEntries.length-1;M>=0;--M){var H=this.tryEntries[M];if(H.tryLoc<=this.prev&&i.call(H,"finallyLoc")&&this.prev<H.finallyLoc){var j=H;break}}j&&(S==="break"||S==="continue")&&j.tryLoc<=P&&P<=j.finallyLoc&&(j=null);var U=j?j.completion:{};return U.type=S,U.arg=P,j?(this.method="next",this.next=j.finallyLoc,E):this.complete(U)},"abrupt"),complete:o(function(S,P){if(S.type==="throw")throw S.arg;return S.type==="break"||S.type==="continue"?this.next=S.arg:S.type==="return"?(this.rval=this.arg=S.arg,this.method="return",this.next="end"):S.type==="normal"&&P&&(this.next=P),E},"complete"),finish:o(function(S){for(var P=this.tryEntries.length-1;P>=0;--P){var M=this.tryEntries[P];if(M.finallyLoc===S)return this.complete(M.completion,M.afterLoc),Fe(M),E}},"finish"),catch:o(function(S){for(var P=this.tryEntries.length-1;P>=0;--P){var M=this.tryEntries[P];if(M.tryLoc===S){var H=M.completion;if(H.type==="throw"){var j=H.arg;Fe(M)}return j}}throw Error("illegal catch attempt")},"_catch"),delegateYield:o(function(S,P,M){return this.delegate={iterator:Xe(S),resultName:P,nextLoc:M},this.method==="next"&&(this.arg=r),E},"delegateYield")},e}o(fh,"_regeneratorRuntime");function C0(r,e,t,i,s,n,a){try{var l=r[n](a),u=l.value}catch(d){t(d);return}l.done?e(u):Promise.resolve(u).then(i,s)}o(C0,"asyncGeneratorStep");function ix(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function a(u){C0(n,i,s,a,l,"next",u)}o(a,"_next");function l(u){C0(n,i,s,a,l,"throw",u)}o(l,"_throw"),a(void 0)})}}o(ix,"_asyncToGenerator");function N0(r,e){return nx(r)||ox(r,e)||M0(r,e)||sx()}o(N0,"_slicedToArray");function sx(){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(sx,"_nonIterableRest");function ox(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var i,s,n,a,l=[],u=!0,d=!1;try{if(n=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;u=!1}else for(;!(u=(i=n.call(t)).done)&&(l.push(i.value),l.length!==e);u=!0);}catch(p){d=!0,s=p}finally{try{if(!u&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(d)throw s}}return l}}o(ox,"_iterableToArrayLimit");function nx(r){if(Array.isArray(r))return r}o(nx,"_arrayWithHoles");function Zs(r){"@babel/helpers - typeof";return Zs=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},Zs(r)}o(Zs,"_typeof");function ax(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=M0(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var i=0,s=o(function(){},"F");return{s,n:o(function(){return i>=r.length?{done:!0}:{done:!1,value:r[i++]}},"n"),e:o(function(d){throw d},"e"),f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var n=!0,a=!1,l;return{s:o(function(){t=t.call(r)},"s"),n:o(function(){var d=t.next();return n=d.done,d},"n"),e:o(function(d){a=!0,l=d},"e"),f:o(function(){try{!n&&t.return!=null&&t.return()}finally{if(a)throw l}},"f")}}o(ax,"_createForOfIteratorHelper");function M0(r,e){if(r){if(typeof r=="string")return T0(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return T0(r,e)}}o(M0,"_unsupportedIterableToArray");function T0(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=r[t];return i}o(T0,"_arrayLikeToArray");function O0(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,i)}return t}o(O0,"ownKeys");function $o(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?O0(Object(t),!0).forEach(function(i){lx(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):O0(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}o($o,"_objectSpread");function lx(r,e,t){return e=L0(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}o(lx,"_defineProperty");function ux(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}o(ux,"_classCallCheck");function k0(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,L0(i.key),i)}}o(k0,"_defineProperties");function cx(r,e,t){return e&&k0(r.prototype,e),t&&k0(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(cx,"_createClass");function L0(r){var e=dx(r,"string");return Zs(e)=="symbol"?e:e+""}o(L0,"_toPropertyKey");function dx(r,e){if(Zs(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(Zs(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}o(dx,"_toPrimitive");var mh="tus-v1",Nu="ietf-draft-03",px={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:j0,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:mh},z0=function(){function r(e,t){ux(this,r),"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(r,"BaseUpload"),cx(r,[{key:"findPreviousUploads",value:o(function(){var t=this;return this.options.fingerprint(this.file,this.options).then(function(i){return t._urlStorage.findUploadsByFingerprint(i)})},"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,i=this.file;if(!i){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![mh,Nu].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var s=this.options.retryDelays;if(s!=null&&Object.prototype.toString.call(s)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var n=0,a=["uploadUrl","uploadSize","uploadLengthDeferred"];n<a.length;n++){var l=a[n];if(this.options[l]){this._emitError(new Error("tus: cannot use the ".concat(l," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(i,this.options).then(function(u){return u==null?Ji("No fingerprint was calculated meaning that the upload cannot be stored in the URL storage."):Ji("Calculated fingerprint: ".concat(u)),t._fingerprint=u,t._source?t._source:t.options.fileReader.openFile(i,t.options.chunkSize)}).then(function(u){if(t._source=u,t.options.uploadLengthDeferred)t._size=null;else if(t.options.uploadSize!=null){if(t._size=Number(t.options.uploadSize),Number.isNaN(t._size)){t._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(t._size=t._source.size,t._size==null){t._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}t.options.parallelUploads>1||t._parallelUploadUrls!=null?t._startParallelUpload():t._startSingleUpload()}).catch(function(u){t._emitError(u)})},"start")},{key:"_startParallelUpload",value:o(function(){var t,i=this,s=this._size,n=0;this._parallelUploads=[];var a=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,l=(t=this.options.parallelUploadBoundaries)!==null&&t!==void 0?t:fx(this._source.size,a);this._parallelUploadUrls&&l.forEach(function(p,f){p.uploadUrl=i._parallelUploadUrls[f]||null}),this._parallelUploadUrls=new Array(l.length);var u=l.map(function(p,f){var y=0;return i._source.slice(p.start,p.end).then(function(v){var _=v.value;return new Promise(function(R,E){var O=$o($o({},i.options),{},{uploadUrl:p.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:i.options.metadataForPartialUploads,headers:$o($o({},i.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:R,onError:E,onProgress:o(function(G){n=n-y+G,y=G,i._emitProgress(n,s)},"onProgress"),onUploadUrlAvailable:o(function(){i._parallelUploadUrls[f]=L.url,i._parallelUploadUrls.filter(function(G){return!!G}).length===l.length&&i._saveUploadInUrlStorage()},"onUploadUrlAvailable")}),L=new r(_,O);L.start(),i._parallelUploads.push(L)})})}),d;Promise.all(u).then(function(){d=i._openRequest("POST",i.options.endpoint),d.setHeader("Upload-Concat","final;".concat(i._parallelUploadUrls.join(" ")));var p=A0(i.options.metadata);return p!==""&&d.setHeader("Upload-Metadata",p),i._sendRequest(d,null)}).then(function(p){if(!qo(p.getStatus(),200)){i._emitHttpError(d,p,"tus: unexpected response while creating upload");return}var f=p.getHeader("Location");if(f==null){i._emitHttpError(d,p,"tus: invalid or missing Location header");return}i.url=D0(i.options.endpoint,f),Ji("Created upload at ".concat(i.url)),i._emitSuccess(p)}).catch(function(p){i._emitError(p)})},"_startParallelUpload")},{key:"_startSingleUpload",value:o(function(){if(this._aborted=!1,this.url!=null){Ji("Resuming upload from previous URL: ".concat(this.url)),this._resumeUpload();return}if(this.options.uploadUrl!=null){Ji("Resuming upload from provided URL: ".concat(this.options.uploadUrl)),this.url=this.options.uploadUrl,this._resumeUpload();return}Ji("Creating a new upload"),this._createUpload()},"_startSingleUpload")},{key:"abort",value:o(function(t){var i=this;if(this._parallelUploads!=null){var s=ax(this._parallelUploads),n;try{for(s.s();!(n=s.n()).done;){var a=n.value;a.abort(t)}}catch(l){s.e(l)}finally{s.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!t||this.url==null?Promise.resolve():r.terminate(this.url,this.options).then(function(){return i._removeFromUrlStorage()})},"abort")},{key:"_emitHttpError",value:o(function(t,i,s,n){this._emitError(new zo(s,n,t,i))},"_emitHttpError")},{key:"_emitError",value:o(function(t){var i=this;if(!this._aborted){if(this.options.retryDelays!=null){var s=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(s&&(this._retryAttempt=0),I0(t,this._retryAttempt,this.options)){var n=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){i.start()},n);return}}if(typeof this.options.onError=="function")this.options.onError(t);else throw t}},"_emitError")},{key:"_emitSuccess",value:o(function(t){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:t})},"_emitSuccess")},{key:"_emitProgress",value:o(function(t,i){typeof this.options.onProgress=="function"&&this.options.onProgress(t,i)},"_emitProgress")},{key:"_emitChunkComplete",value:o(function(t,i,s){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(t,i,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 i=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?i.setHeader("Upload-Defer-Length","1"):i.setHeader("Upload-Length","".concat(this._size));var s=A0(this.options.metadata);s!==""&&i.setHeader("Upload-Metadata",s);var n;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,n=this._addChunkToRequest(i)):(this.options.protocol===Nu&&i.setHeader("Upload-Complete","?0"),n=this._sendRequest(i,null)),n.then(function(a){if(!qo(a.getStatus(),200)){t._emitHttpError(i,a,"tus: unexpected response while creating upload");return}var l=a.getHeader("Location");if(l==null){t._emitHttpError(i,a,"tus: invalid or missing Location header");return}if(t.url=D0(t.options.endpoint,l),Ji("Created upload at ".concat(t.url)),typeof t.options.onUploadUrlAvailable=="function"&&t.options.onUploadUrlAvailable(),t._size===0){t._emitSuccess(a),t._source.close();return}t._saveUploadInUrlStorage().then(function(){t.options.uploadDataDuringCreation?t._handleUploadResponse(i,a):(t._offset=0,t._performUpload())})}).catch(function(a){t._emitHttpError(i,null,"tus: failed to create upload",a)})},"_createUpload")},{key:"_resumeUpload",value:o(function(){var t=this,i=this._openRequest("HEAD",this.url),s=this._sendRequest(i,null);s.then(function(n){var a=n.getStatus();if(!qo(a,200)){if(a===423){t._emitHttpError(i,n,"tus: upload is currently locked; retry later");return}if(qo(a,400)&&t._removeFromUrlStorage(),!t.options.endpoint){t._emitHttpError(i,n,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}t.url=null,t._createUpload();return}var l=Number.parseInt(n.getHeader("Upload-Offset"),10);if(Number.isNaN(l)){t._emitHttpError(i,n,"tus: invalid or missing offset value");return}var u=Number.parseInt(n.getHeader("Upload-Length"),10);if(Number.isNaN(u)&&!t.options.uploadLengthDeferred&&t.options.protocol===mh){t._emitHttpError(i,n,"tus: invalid or missing length value");return}typeof t.options.onUploadUrlAvailable=="function"&&t.options.onUploadUrlAvailable(),t._saveUploadInUrlStorage().then(function(){if(l===u){t._emitProgress(u,u),t._emitSuccess(n);return}t._offset=l,t._performUpload()})}).catch(function(n){t._emitHttpError(i,null,"tus: failed to resume upload",n)})},"_resumeUpload")},{key:"_performUpload",value:o(function(){var t=this;if(!this._aborted){var i;this.options.overridePatchMethod?(i=this._openRequest("POST",this.url),i.setHeader("X-HTTP-Method-Override","PATCH")):i=this._openRequest("PATCH",this.url),i.setHeader("Upload-Offset","".concat(this._offset));var s=this._addChunkToRequest(i);s.then(function(n){if(!qo(n.getStatus(),200)){t._emitHttpError(i,n,"tus: unexpected response while uploading chunk");return}t._handleUploadResponse(i,n)}).catch(function(n){t._aborted||t._emitHttpError(i,null,"tus: failed to upload chunk at offset ".concat(t._offset),n)})}},"_performUpload")},{key:"_addChunkToRequest",value:o(function(t){var i=this,s=this._offset,n=this._offset+this.options.chunkSize;return t.setProgressHandler(function(a){i._emitProgress(s+a,i._size)}),t.setHeader("Content-Type","application/offset+octet-stream"),(n===Number.POSITIVE_INFINITY||n>this._size)&&!this.options.uploadLengthDeferred&&(n=this._size),this._source.slice(s,n).then(function(a){var l=a.value,u=a.done,d=l!=null&&l.size?l.size:0;i.options.uploadLengthDeferred&&u&&(i._size=i._offset+d,t.setHeader("Upload-Length","".concat(i._size)));var p=i._offset+d;return!i.options.uploadLengthDeferred&&u&&p!==i._size?Promise.reject(new Error("upload was configured with a size of ".concat(i._size," bytes, but the source is done after ").concat(p," bytes"))):l===null?i._sendRequest(t):(i.options.protocol===Nu&&t.setHeader("Upload-Complete",u?"?1":"?0"),i._emitProgress(i._offset,i._size),i._sendRequest(t,l))})},"_addChunkToRequest")},{key:"_handleUploadResponse",value:o(function(t,i){var s=Number.parseInt(i.getHeader("Upload-Offset"),10);if(Number.isNaN(s)){this._emitHttpError(t,i,"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(i),this._source.close();return}this._performUpload()},"_handleUploadResponse")},{key:"_openRequest",value:o(function(t,i){var s=R0(t,i,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(i){t._emitError(i)}),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 i={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?i.parallelUploadUrls=this._parallelUploadUrls:i.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,i).then(function(s){t._urlStorageKey=s})},"_saveUploadInUrlStorage")},{key:"_sendRequest",value:o(function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return U0(t,i,this.options)},"_sendRequest")}],[{key:"terminate",value:o(function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=R0("DELETE",t,i);return U0(s,null,i).then(function(n){if(n.getStatus()!==204)throw new zo("tus: unexpected response while terminating upload",null,s,n)}).catch(function(n){if(n instanceof zo||(n=new zo("tus: failed to terminate upload",n,s,null)),!I0(n,0,i))throw n;var a=i.retryDelays[0],l=i.retryDelays.slice(1),u=$o($o({},i),{},{retryDelays:l});return new Promise(function(d){return setTimeout(d,a)}).then(function(){return r.terminate(t,u)})})},"terminate")}])}();function A0(r){return Object.entries(r).map(function(e){var t=N0(e,2),i=t[0],s=t[1];return"".concat(i," ").concat(h0.encode(String(s)))}).join(",")}o(A0,"encodeMetadata");function qo(r,e){return r>=e&&r<e+100}o(qo,"inStatusCategory");function R0(r,e,t){var i=t.httpStack.createRequest(r,e);t.protocol===Nu?i.setHeader("Upload-Draft-Interop-Version","5"):i.setHeader("Tus-Resumable","1.0.0");for(var s=t.headers||{},n=0,a=Object.entries(s);n<a.length;n++){var l=N0(a[n],2),u=l[0],d=l[1];i.setHeader(u,d)}if(t.addRequestId){var p=hh();i.setHeader("X-Request-ID",p)}return i}o(R0,"openRequest");function U0(r,e,t){return gh.apply(this,arguments)}o(U0,"sendRequest");function gh(){return gh=ix(fh().mark(o(function r(e,t,i){var s;return fh().wrap(o(function(a){for(;;)switch(a.prev=a.next){case 0:if(typeof i.onBeforeRequest!="function"){a.next=3;break}return a.next=3,i.onBeforeRequest(e);case 3:return a.next=5,e.send(t);case 5:if(s=a.sent,typeof i.onAfterResponse!="function"){a.next=9;break}return a.next=9,i.onAfterResponse(e,s);case 9:return a.abrupt("return",s);case 10:case"end":return a.stop()}},"_callee$"),r)},"_callee"))),gh.apply(this,arguments)}o(gh,"_sendRequest2");function hx(){var r=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(r=!1),r}o(hx,"isOnline");function I0(r,e,t){return t.retryDelays==null||e>=t.retryDelays.length||r.originalRequest==null?!1:t&&typeof t.onShouldRetry=="function"?t.onShouldRetry(r,e,t):j0(r)}o(I0,"shouldRetry");function j0(r){var e=r.originalResponse?r.originalResponse.getStatus():0;return(!qo(e,400)||e===409||e===423)&&hx()}o(j0,"defaultOnShouldRetry");function D0(r,e){return new B0.default(e,r).toString()}o(D0,"resolveUrl");function fx(r,e){for(var t=Math.floor(r/e),i=[],s=0;s<e;s++)i.push({start:t*s,end:t*(s+1)});return i[e-1].end=r,i}o(fx,"splitSizeIntoParts");z0.defaultOptions=px;var Mu=z0;var mx=o(function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"},"isReactNative"),Lu=mx;function yh(r){return new Promise(function(e,t){var i=new XMLHttpRequest;i.responseType="blob",i.onload=function(){var s=i.response;e(s)},i.onerror=function(s){t(s)},i.open("GET",r),i.send()})}o(yh,"uriToBlob");var gx=o(function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")},"isCordova"),H0=gx;function vh(r){return new Promise(function(e,t){var i=new FileReader;i.onload=function(){var s=new Uint8Array(i.result);e({value:s})},i.onerror=function(s){t(s)},i.readAsArrayBuffer(r)})}o(vh,"readAsByteArray");function Va(r){"@babel/helpers - typeof";return Va=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},Va(r)}o(Va,"_typeof");function yx(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}o(yx,"_classCallCheck");function $0(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,bx(i.key),i)}}o($0,"_defineProperties");function vx(r,e,t){return e&&$0(r.prototype,e),t&&$0(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(vx,"_createClass");function bx(r){var e=wx(r,"string");return Va(e)=="symbol"?e:e+""}o(bx,"_toPropertyKey");function wx(r,e){if(Va(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(Va(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}o(wx,"_toPrimitive");var bh=function(){function r(e){yx(this,r),this._file=e,this.size=e.size}return o(r,"FileSource"),vx(r,[{key:"slice",value:o(function(t,i){if(H0())return vh(this._file.slice(t,i));var s=this._file.slice(t,i),n=i>=this.size;return Promise.resolve({value:s,done:n})},"slice")},{key:"close",value:o(function(){},"close")}])}();function Wa(r){"@babel/helpers - typeof";return Wa=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},Wa(r)}o(Wa,"_typeof");function Sx(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}o(Sx,"_classCallCheck");function q0(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,Px(i.key),i)}}o(q0,"_defineProperties");function _x(r,e,t){return e&&q0(r.prototype,e),t&&q0(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(_x,"_createClass");function Px(r){var e=xx(r,"string");return Wa(e)=="symbol"?e:e+""}o(Px,"_toPropertyKey");function xx(r,e){if(Wa(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(Wa(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}o(xx,"_toPrimitive");function V0(r){return r===void 0?0:r.size!==void 0?r.size:r.length}o(V0,"len");function Fx(r,e){if(r.concat)return r.concat(e);if(r instanceof Blob)return new Blob([r,e],{type:r.type});if(r.set){var t=new r.constructor(r.length+e.length);return t.set(r),t.set(e,r.length),t}throw new Error("Unknown data type")}o(Fx,"concat");var W0=function(){function r(e){Sx(this,r),this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}return o(r,"StreamSource"),_x(r,[{key:"slice",value:o(function(t,i){return t<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(t,i)},"slice")},{key:"_readUntilEnoughDataOrDone",value:o(function(t,i){var s=this,n=i<=this._bufferOffset+V0(this._buffer);if(this._done||n){var a=this._getDataFromBuffer(t,i),l=a==null?this._done:!1;return Promise.resolve({value:a,done:l})}return this._reader.read().then(function(u){var d=u.value,p=u.done;return p?s._done=!0:s._buffer===void 0?s._buffer=d:s._buffer=Fx(s._buffer,d),s._readUntilEnoughDataOrDone(t,i)})},"_readUntilEnoughDataOrDone")},{key:"_getDataFromBuffer",value:o(function(t,i){t>this._bufferOffset&&(this._buffer=this._buffer.slice(t-this._bufferOffset),this._bufferOffset=t);var s=V0(this._buffer)===0;return this._done&&s?null:this._buffer.slice(0,i-t)},"_getDataFromBuffer")},{key:"close",value:o(function(){this._reader.cancel&&this._reader.cancel()},"close")}])}();function eo(r){"@babel/helpers - typeof";return eo=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},eo(r)}o(eo,"_typeof");function wh(){"use strict";wh=o(function(){return e},"_regeneratorRuntime");var r,e={},t=Object.prototype,i=t.hasOwnProperty,s=Object.defineProperty||function(C,S,P){C[S]=P.value},n=typeof Symbol=="function"?Symbol:{},a=n.iterator||"@@iterator",l=n.asyncIterator||"@@asyncIterator",u=n.toStringTag||"@@toStringTag";function d(C,S,P){return Object.defineProperty(C,S,{value:P,enumerable:!0,configurable:!0,writable:!0}),C[S]}o(d,"define");try{d({},"")}catch{d=o(function(P,M,H){return P[M]=H},"define")}function p(C,S,P,M){var H=S&&S.prototype instanceof O?S:O,j=Object.create(H.prototype),U=new Re(M||[]);return s(j,"_invoke",{value:ke(C,P,U)}),j}o(p,"wrap");function f(C,S,P){try{return{type:"normal",arg:C.call(S,P)}}catch(M){return{type:"throw",arg:M}}}o(f,"tryCatch"),e.wrap=p;var y="suspendedStart",v="suspendedYield",_="executing",R="completed",E={};function O(){}o(O,"Generator");function L(){}o(L,"GeneratorFunction");function B(){}o(B,"GeneratorFunctionPrototype");var G={};d(G,a,function(){return this});var J=Object.getPrototypeOf,$=J&&J(J(Xe([])));$&&$!==t&&i.call($,a)&&(G=$);var W=B.prototype=O.prototype=Object.create(G);function te(C){["next","throw","return"].forEach(function(S){d(C,S,function(P){return this._invoke(S,P)})})}o(te,"defineIteratorMethods");function ae(C,S){function P(H,j,U,T){var k=f(C[H],C,j);if(k.type!=="throw"){var N=k.arg,Y=N.value;return Y&&eo(Y)=="object"&&i.call(Y,"__await")?S.resolve(Y.__await).then(function(Q){P("next",Q,U,T)},function(Q){P("throw",Q,U,T)}):S.resolve(Y).then(function(Q){N.value=Q,U(N)},function(Q){return P("throw",Q,U,T)})}T(k.arg)}o(P,"invoke");var M;s(this,"_invoke",{value:o(function(j,U){function T(){return new S(function(k,N){P(j,U,k,N)})}return o(T,"callInvokeWithMethodAndArg"),M=M?M.then(T,T):T()},"value")})}o(ae,"AsyncIterator");function ke(C,S,P){var M=y;return function(H,j){if(M===_)throw Error("Generator is already running");if(M===R){if(H==="throw")throw j;return{value:r,done:!0}}for(P.method=H,P.arg=j;;){var U=P.delegate;if(U){var T=Ae(U,P);if(T){if(T===E)continue;return T}}if(P.method==="next")P.sent=P._sent=P.arg;else if(P.method==="throw"){if(M===y)throw M=R,P.arg;P.dispatchException(P.arg)}else P.method==="return"&&P.abrupt("return",P.arg);M=_;var k=f(C,S,P);if(k.type==="normal"){if(M=P.done?R:v,k.arg===E)continue;return{value:k.arg,done:P.done}}k.type==="throw"&&(M=R,P.method="throw",P.arg=k.arg)}}}o(ke,"makeInvokeMethod");function Ae(C,S){var P=S.method,M=C.iterator[P];if(M===r)return S.delegate=null,P==="throw"&&C.iterator.return&&(S.method="return",S.arg=r,Ae(C,S),S.method==="throw")||P!=="return"&&(S.method="throw",S.arg=new TypeError("The iterator does not provide a '"+P+"' method")),E;var H=f(M,C.iterator,S.arg);if(H.type==="throw")return S.method="throw",S.arg=H.arg,S.delegate=null,E;var j=H.arg;return j?j.done?(S[C.resultName]=j.value,S.next=C.nextLoc,S.method!=="return"&&(S.method="next",S.arg=r),S.delegate=null,E):j:(S.method="throw",S.arg=new TypeError("iterator result is not an object"),S.delegate=null,E)}o(Ae,"maybeInvokeDelegate");function qe(C){var S={tryLoc:C[0]};1 in C&&(S.catchLoc=C[1]),2 in C&&(S.finallyLoc=C[2],S.afterLoc=C[3]),this.tryEntries.push(S)}o(qe,"pushTryEntry");function Fe(C){var S=C.completion||{};S.type="normal",delete S.arg,C.completion=S}o(Fe,"resetTryEntry");function Re(C){this.tryEntries=[{tryLoc:"root"}],C.forEach(qe,this),this.reset(!0)}o(Re,"Context");function Xe(C){if(C||C===""){var S=C[a];if(S)return S.call(C);if(typeof C.next=="function")return C;if(!isNaN(C.length)){var P=-1,M=o(function H(){for(;++P<C.length;)if(i.call(C,P))return H.value=C[P],H.done=!1,H;return H.value=r,H.done=!0,H},"next");return M.next=M}}throw new TypeError(eo(C)+" is not iterable")}return o(Xe,"values"),L.prototype=B,s(W,"constructor",{value:B,configurable:!0}),s(B,"constructor",{value:L,configurable:!0}),L.displayName=d(B,u,"GeneratorFunction"),e.isGeneratorFunction=function(C){var S=typeof C=="function"&&C.constructor;return!!S&&(S===L||(S.displayName||S.name)==="GeneratorFunction")},e.mark=function(C){return Object.setPrototypeOf?Object.setPrototypeOf(C,B):(C.__proto__=B,d(C,u,"GeneratorFunction")),C.prototype=Object.create(W),C},e.awrap=function(C){return{__await:C}},te(ae.prototype),d(ae.prototype,l,function(){return this}),e.AsyncIterator=ae,e.async=function(C,S,P,M,H){H===void 0&&(H=Promise);var j=new ae(p(C,S,P,M),H);return e.isGeneratorFunction(S)?j:j.next().then(function(U){return U.done?U.value:j.next()})},te(W),d(W,u,"Generator"),d(W,a,function(){return this}),d(W,"toString",function(){return"[object Generator]"}),e.keys=function(C){var S=Object(C),P=[];for(var M in S)P.push(M);return P.reverse(),o(function H(){for(;P.length;){var j=P.pop();if(j in S)return H.value=j,H.done=!1,H}return H.done=!0,H},"next")},e.values=Xe,Re.prototype={constructor:Re,reset:o(function(S){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Fe),!S)for(var P in this)P.charAt(0)==="t"&&i.call(this,P)&&!isNaN(+P.slice(1))&&(this[P]=r)},"reset"),stop:o(function(){this.done=!0;var S=this.tryEntries[0].completion;if(S.type==="throw")throw S.arg;return this.rval},"stop"),dispatchException:o(function(S){if(this.done)throw S;var P=this;function M(N,Y){return U.type="throw",U.arg=S,P.next=N,Y&&(P.method="next",P.arg=r),!!Y}o(M,"handle");for(var H=this.tryEntries.length-1;H>=0;--H){var j=this.tryEntries[H],U=j.completion;if(j.tryLoc==="root")return M("end");if(j.tryLoc<=this.prev){var T=i.call(j,"catchLoc"),k=i.call(j,"finallyLoc");if(T&&k){if(this.prev<j.catchLoc)return M(j.catchLoc,!0);if(this.prev<j.finallyLoc)return M(j.finallyLoc)}else if(T){if(this.prev<j.catchLoc)return M(j.catchLoc,!0)}else{if(!k)throw Error("try statement without catch or finally");if(this.prev<j.finallyLoc)return M(j.finallyLoc)}}}},"dispatchException"),abrupt:o(function(S,P){for(var M=this.tryEntries.length-1;M>=0;--M){var H=this.tryEntries[M];if(H.tryLoc<=this.prev&&i.call(H,"finallyLoc")&&this.prev<H.finallyLoc){var j=H;break}}j&&(S==="break"||S==="continue")&&j.tryLoc<=P&&P<=j.finallyLoc&&(j=null);var U=j?j.completion:{};return U.type=S,U.arg=P,j?(this.method="next",this.next=j.finallyLoc,E):this.complete(U)},"abrupt"),complete:o(function(S,P){if(S.type==="throw")throw S.arg;return S.type==="break"||S.type==="continue"?this.next=S.arg:S.type==="return"?(this.rval=this.arg=S.arg,this.method="return",this.next="end"):S.type==="normal"&&P&&(this.next=P),E},"complete"),finish:o(function(S){for(var P=this.tryEntries.length-1;P>=0;--P){var M=this.tryEntries[P];if(M.finallyLoc===S)return this.complete(M.completion,M.afterLoc),Fe(M),E}},"finish"),catch:o(function(S){for(var P=this.tryEntries.length-1;P>=0;--P){var M=this.tryEntries[P];if(M.tryLoc===S){var H=M.completion;if(H.type==="throw"){var j=H.arg;Fe(M)}return j}}throw Error("illegal catch attempt")},"_catch"),delegateYield:o(function(S,P,M){return this.delegate={iterator:Xe(S),resultName:P,nextLoc:M},this.method==="next"&&(this.arg=r),E},"delegateYield")},e}o(wh,"_regeneratorRuntime");function G0(r,e,t,i,s,n,a){try{var l=r[n](a),u=l.value}catch(d){t(d);return}l.done?e(u):Promise.resolve(u).then(i,s)}o(G0,"asyncGeneratorStep");function Ex(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function a(u){G0(n,i,s,a,l,"next",u)}o(a,"_next");function l(u){G0(n,i,s,a,l,"throw",u)}o(l,"_throw"),a(void 0)})}}o(Ex,"_asyncToGenerator");function Cx(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}o(Cx,"_classCallCheck");function K0(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,Ox(i.key),i)}}o(K0,"_defineProperties");function Tx(r,e,t){return e&&K0(r.prototype,e),t&&K0(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(Tx,"_createClass");function Ox(r){var e=kx(r,"string");return eo(e)=="symbol"?e:e+""}o(Ox,"_toPropertyKey");function kx(r,e){if(eo(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(eo(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}o(kx,"_toPrimitive");var X0=function(){function r(){Cx(this,r)}return o(r,"FileReader"),Tx(r,[{key:"openFile",value:function(){var e=Ex(wh().mark(o(function i(s,n){var a;return wh().wrap(o(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(Lu()&&s&&typeof s.uri<"u")){u.next=11;break}return u.prev=1,u.next=4,yh(s.uri);case 4:return a=u.sent,u.abrupt("return",new bh(a));case 8:throw u.prev=8,u.t0=u.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(u.t0));case 11:if(!(typeof s.slice=="function"&&typeof s.size<"u")){u.next=13;break}return u.abrupt("return",Promise.resolve(new bh(s)));case 13:if(typeof s.read!="function"){u.next=18;break}if(n=Number(n),Number.isFinite(n)){u.next=17;break}return u.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return u.abrupt("return",Promise.resolve(new W0(s,n)));case 18:return u.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return u.stop()}},"_callee$"),i,null,[[1,8]])},"_callee")));function t(i,s){return e.apply(this,arguments)}return o(t,"openFile"),t}()}])}();function Sh(r,e){return Lu()?Promise.resolve(Ax(r,e)):Promise.resolve(["tus-br",r.name,r.type,r.size,r.lastModified,e.endpoint].join("-"))}o(Sh,"fingerprint");function Ax(r,e){var t=r.exif?Rx(JSON.stringify(r.exif)):"noexif";return["tus-rn",r.name||"noname",r.size||"nosize",t,e.endpoint].join("/")}o(Ax,"reactNativeFingerprint");function Rx(r){var e=0;if(r.length===0)return e;for(var t=0;t<r.length;t++){var i=r.charCodeAt(t);e=(e<<5)-e+i,e&=e}return e}o(Rx,"hashCode");function Ga(r){"@babel/helpers - typeof";return Ga=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},Ga(r)}o(Ga,"_typeof");function _h(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}o(_h,"_classCallCheck");function Y0(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,Ux(i.key),i)}}o(Y0,"_defineProperties");function Ph(r,e,t){return e&&Y0(r.prototype,e),t&&Y0(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(Ph,"_createClass");function Ux(r){var e=Ix(r,"string");return Ga(e)=="symbol"?e:e+""}o(Ux,"_toPropertyKey");function Ix(r,e){if(Ga(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(Ga(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}o(Ix,"_toPrimitive");var J0=function(){function r(){_h(this,r)}return o(r,"XHRHttpStack"),Ph(r,[{key:"createRequest",value:o(function(t,i){return new Dx(t,i)},"createRequest")},{key:"getName",value:o(function(){return"XHRHttpStack"},"getName")}])}();var Dx=function(){function r(e,t){_h(this,r),this._xhr=new XMLHttpRequest,this._xhr.open(e,t,!0),this._method=e,this._url=t,this._headers={}}return o(r,"Request"),Ph(r,[{key:"getMethod",value:o(function(){return this._method},"getMethod")},{key:"getURL",value:o(function(){return this._url},"getURL")},{key:"setHeader",value:o(function(t,i){this._xhr.setRequestHeader(t,i),this._headers[t]=i},"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(i){i.lengthComputable&&t(i.loaded)})},"setProgressHandler")},{key:"send",value:o(function(){var t=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(s,n){t._xhr.onload=function(){s(new Nx(t._xhr))},t._xhr.onerror=function(a){n(a)},t._xhr.send(i)})},"send")},{key:"abort",value:o(function(){return this._xhr.abort(),Promise.resolve()},"abort")},{key:"getUnderlyingObject",value:o(function(){return this._xhr},"getUnderlyingObject")}])}(),Nx=function(){function r(e){_h(this,r),this._xhr=e}return o(r,"Response"),Ph(r,[{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")}])}();function Ka(r){"@babel/helpers - typeof";return Ka=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},Ka(r)}o(Ka,"_typeof");function Mx(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}o(Mx,"_classCallCheck");function Q0(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,Bx(i.key),i)}}o(Q0,"_defineProperties");function Lx(r,e,t){return e&&Q0(r.prototype,e),t&&Q0(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(Lx,"_createClass");function Bx(r){var e=zx(r,"string");return Ka(e)=="symbol"?e:e+""}o(Bx,"_toPropertyKey");function zx(r,e){if(Ka(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(Ka(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}o(zx,"_toPrimitive");var Fh=!1;try{Fh="localStorage"in window,Bu="tusSupport",xh=localStorage.getItem(Bu),localStorage.setItem(Bu,xh),xh===null&&localStorage.removeItem(Bu)}catch(r){if(r.code===r.SECURITY_ERR||r.code===r.QUOTA_EXCEEDED_ERR)Fh=!1;else throw r}var Bu,xh,Z0=Fh,eb=function(){function r(){Mx(this,r)}return o(r,"WebStorageUrlStorage"),Lx(r,[{key:"findAllUploads",value:o(function(){var t=this._findEntries("tus::");return Promise.resolve(t)},"findAllUploads")},{key:"findUploadsByFingerprint",value:o(function(t){var i=this._findEntries("tus::".concat(t,"::"));return Promise.resolve(i)},"findUploadsByFingerprint")},{key:"removeUpload",value:o(function(t){return localStorage.removeItem(t),Promise.resolve()},"removeUpload")},{key:"addUpload",value:o(function(t,i){var s=Math.round(Math.random()*1e12),n="tus::".concat(t,"::").concat(s);return localStorage.setItem(n,JSON.stringify(i)),Promise.resolve(n)},"addUpload")},{key:"_findEntries",value:o(function(t){for(var i=[],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,i.push(a)}catch{}}return i},"_findEntries")}])}();function Wo(r){"@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(r)}o(Wo,"_typeof");function jx(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}o(jx,"_classCallCheck");function tb(r,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,sb(i.key),i)}}o(tb,"_defineProperties");function Hx(r,e,t){return e&&tb(r.prototype,e),t&&tb(r,t),Object.defineProperty(r,"prototype",{writable:!1}),r}o(Hx,"_createClass");function $x(r,e,t){return e=zu(e),qx(r,ib()?Reflect.construct(e,t||[],zu(r).constructor):e.apply(r,t))}o($x,"_callSuper");function qx(r,e){if(e&&(Wo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vx(r)}o(qx,"_possibleConstructorReturn");function Vx(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}o(Vx,"_assertThisInitialized");function ib(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ib=o(function(){return!!r},"_isNativeReflectConstruct"))()}o(ib,"_isNativeReflectConstruct");function zu(r){return zu=Object.setPrototypeOf?Object.getPrototypeOf.bind():o(function(t){return t.__proto__||Object.getPrototypeOf(t)},"_getPrototypeOf"),zu(r)}o(zu,"_getPrototypeOf");function Wx(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&Eh(r,e)}o(Wx,"_inherits");function Eh(r,e){return Eh=Object.setPrototypeOf?Object.setPrototypeOf.bind():o(function(i,s){return i.__proto__=s,i},"_setPrototypeOf"),Eh(r,e)}o(Eh,"_setPrototypeOf");function rb(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,i)}return t}o(rb,"ownKeys");function Vo(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?rb(Object(t),!0).forEach(function(i){Gx(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):rb(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}o(Vo,"_objectSpread");function Gx(r,e,t){return e=sb(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}o(Gx,"_defineProperty");function sb(r){var e=Kx(r,"string");return Wo(e)=="symbol"?e:e+""}o(sb,"_toPropertyKey");function Kx(r,e){if(Wo(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(Wo(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}o(Kx,"_toPrimitive");var ju=Vo(Vo({},Mu.defaultOptions),{},{httpStack:new J0,fileReader:new X0,urlStorage:Z0?new eb:new Kv,fingerprint:Sh}),ob=function(r){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return jx(this,e),i=Vo(Vo({},ju),i),$x(this,e,[t,i])}return o(e,"Upload"),Wx(e,r),Hx(e,null,[{key:"terminate",value:o(function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s=Vo(Vo({},ju),s),Mu.terminate(i,s)},"terminate")}])}(Mu),bL=typeof XMLHttpRequest=="function"&&typeof Blob=="function"&&typeof Blob.prototype.slice=="function";function Xx(r){return r?r.readyState!==0&&r.readyState!==4||r.status===0:!1}o(Xx,"isNetworkError");var Hu=Xx;function Yx(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")}o(Yx,"isCordova");function Jx(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"}o(Jx,"isReactNative");function Ch(r){return(e,t)=>{if(Yx()||Jx())return ju.fingerprint(e,t);let i=["tus",r.id,t.endpoint].join("-");return Promise.resolve(i)}}o(Ch,"getFingerprint");function to(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(to,"_classPrivateFieldLooseBase");var Qx=0;function Ja(r){return"__private_"+Qx+++"_"+r}o(Ja,"_classPrivateFieldLooseKey");var Zx={version:"4.2.2"},ab={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},eF={limit:20,retryDelays:ab.retryDelays,withCredentials:!1,allowedMetaFields:!0},Ya=Ja("retryDelayIterator"),Oh=Ja("uploadLocalFile"),kh=Ja("getCompanionClientArgs"),Th=Ja("uploadFiles"),Xa=Ja("handleUpload"),Ui=class extends Oe{static{o(this,"Tus")}constructor(e,t){var i,s;if(super(e,{...eF,...t}),Object.defineProperty(this,Th,{value:iF}),Object.defineProperty(this,kh,{value:rF}),Object.defineProperty(this,Oh,{value:tF}),Object.defineProperty(this,Ya,{writable:!0,value:void 0}),Object.defineProperty(this,Xa,{writable:!0,value:o(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 to(this,Th)[Th](a)},"value")}),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=(i=this.opts.rateLimitedQueue)!=null?i:new Sr(this.opts.limit),to(this,Ya)[Ya]=(s=this.opts.retryDelays)==null?void 0:s.values(),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null)}resetUploaderReferences(e,t){let i=this.uploaders[e];i&&(i.abort(),t!=null&&t.abort&&i.abort(!0),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null)}onReceiveUploadUrl(e,t){let i=this.uppy.getFile(e.id);i&&(!i.tus||i.tus.uploadUrl!==t)&&(this.uppy.log("[Tus] Storing upload url"),this.uppy.setFileState(i.id,{tus:{...i.tus,uploadUrl:t}}))}install(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!0}}),this.uppy.addUploader(to(this,Xa)[Xa])}uninstall(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!1}}),this.uppy.removeUploader(to(this,Xa)[Xa])}};function tF(r){return this.resetUploaderReferences(r.id),new Promise((e,t)=>{let i,s,n,a={...this.opts,...r.tus||{}};typeof a.headers=="function"&&(a.headers=a.headers(r));let{onShouldRetry:l,onBeforeRequest:u,...d}=a,p={...ab,...d};p.fingerprint=Ch(r),p.onBeforeRequest=async E=>{let O=E.getUnderlyingObject();O.withCredentials=!!a.withCredentials;let L;if(typeof u=="function"&&(L=u(E,r)),er(i,"shouldBeRequeued")){if(!i.shouldBeRequeued)return Promise.reject();let B,G=new Promise(J=>{B=J});i=this.requests.run(()=>(r.isPaused&&i.abort(),B(),()=>{})),await Promise.all([G,L]);return}return L},p.onError=E=>{var O;this.uppy.log(E);let L=E.originalRequest!=null?E.originalRequest.getUnderlyingObject():null;Hu(L)&&(E=new Er(E,L)),this.resetUploaderReferences(r.id),(O=i)==null||O.abort(),typeof a.onError=="function"&&a.onError(E),t(E)},p.onProgress=(E,O)=>{var L;this.onReceiveUploadUrl(r,n.url),typeof a.onProgress=="function"&&a.onProgress(E,O);let B=this.uppy.getFile(r.id);this.uppy.emit("upload-progress",B,{uploadStarted:(L=B.progress.uploadStarted)!=null?L:0,bytesUploaded:E,bytesTotal:O})},p.onSuccess=E=>{var O;let L={uploadURL:(O=n.url)!=null?O:void 0,status:200,body:{xhr:E.lastResponse.getUnderlyingObject()}};if(this.uppy.emit("upload-success",this.uppy.getFile(r.id),L),this.resetUploaderReferences(r.id),i.done(),n.url){let{name:B}=n.file;this.uppy.log(`Download ${B} from ${n.url}`)}typeof a.onSuccess=="function"&&a.onSuccess(E),e(n)};let f=o(E=>{var O;let L=E==null||(O=E.originalResponse)==null?void 0:O.getStatus();if(L===429){if(!this.requests.isPaused){var B;let G=(B=to(this,Ya)[Ya])==null?void 0:B.next();if(G==null||G.done)return!1;this.requests.rateLimit(G.value)}}else{if(L!=null&&L>=400&&L<500&&L!==409&&L!==423)return!1;typeof navigator<"u"&&navigator.onLine===!1&&(this.requests.isPaused||(this.requests.pause(),window.addEventListener("online",()=>{this.requests.resume()},{once:!0})))}return i.abort(),i={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?p.onShouldRetry=(E,O)=>l(E,O,a,f):p.onShouldRetry=f;let y=o((E,O,L)=>{er(E,O)&&!er(E,L)&&(E[L]=E[O])},"copyProp"),v={};Oi(a.allowedMetaFields,r.meta).forEach(E=>{v[E]=String(r.meta[E])}),y(v,"type","filetype"),y(v,"name","filename"),p.metadata=v,n=new ob(r.data,p),this.uploaders[r.id]=n;let R=new Ei(this.uppy);this.uploaderEvents[r.id]=R,s=o(()=>(r.isPaused||n.start(),()=>{}),"qRequest"),n.findPreviousUploads().then(E=>{let O=E[0];O&&(this.uppy.log(`[Tus] Resuming upload of ${r.id} started at ${O.creationTime}`),n.resumeFromPreviousUpload(O)),i=this.requests.run(s)}),R.onFileRemove(r.id,E=>{i.abort(),this.resetUploaderReferences(r.id,{abort:!!n.url}),e(`upload ${E} was removed`)}),R.onPause(r.id,E=>{i.abort(),E?n.abort():i=this.requests.run(s)}),R.onPauseAll(r.id,()=>{i.abort(),n.abort()}),R.onCancelAll(r.id,()=>{i.abort(),this.resetUploaderReferences(r.id,{abort:!!n.url}),e(`upload ${r.id} was canceled`)}),R.onResumeAll(r.id,()=>{i.abort(),r.error&&n.abort(),i=this.requests.run(s)})}).catch(e=>{throw this.uppy.emit("upload-error",r,e),e})}o(tF,"_uploadLocalFile2");function rF(r){var e;let t={...this.opts};return r.tus&&Object.assign(t,r.tus),typeof t.headers=="function"&&(t.headers=t.headers(r)),{...(e=r.remote)==null?void 0:e.body,endpoint:t.endpoint,uploadUrl:t.uploadUrl,protocol:"tus",size:r.data.size,headers:t.headers,metadata:r.meta}}o(rF,"_getCompanionClientArgs2");async function iF(r){let e=Do(r),t=No(e);this.uppy.emit("upload-start",t),await Promise.allSettled(e.map(i=>{if(i.isRemote){let s=o(()=>this.requests,"getQueue"),n=new AbortController,a=o(u=>{u.id===i.id&&n.abort()},"removedHandler");this.uppy.on("file-removed",a);let l=this.uppy.getRequestClientForFile(i).uploadRemoteFile(i,to(this,kh)[kh](i),{signal:n.signal,getQueue:s});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",a)},{priority:-1})(),l}return to(this,Oh)[Oh](i)}))}o(iF,"_uploadFiles2");Ui.VERSION=Zx.version;var ub=be(Rh(),1);function Se(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Se,"_classPrivateFieldLooseBase");var oF=0;function Vr(r){return"__private_"+oF+++"_"+r}o(Vr,"_classPrivateFieldLooseKey");var nF="ASSEMBLY_UPLOADING",Nh="ASSEMBLY_EXECUTING",Mh="ASSEMBLY_COMPLETED",lb=[nF,Nh,Mh];function $u(r,e){return lb.indexOf(r)>=lb.indexOf(e)}o($u,"isStatus");var io=Vr("rateLimitedQueue"),Qa=Vr("fetchWithNetworkError"),ro=Vr("previousFetchStatusStillPending"),Ke=Vr("sse"),Lh=Vr("onFinished"),Uh=Vr("connectServerSentEvents"),Ur=Vr("onError"),Ih=Vr("beginPolling"),Ii=Vr("fetchStatus"),Dh=Vr("diffStatus"),Bh=class extends ub.default{static{o(this,"TransloaditAssembly")}constructor(e,t){super(),Object.defineProperty(this,Dh,{value:pF}),Object.defineProperty(this,Ii,{value:dF}),Object.defineProperty(this,Ih,{value:cF}),Object.defineProperty(this,Ur,{value:uF}),Object.defineProperty(this,Uh,{value:lF}),Object.defineProperty(this,Lh,{value:aF}),Object.defineProperty(this,io,{writable:!0,value:void 0}),Object.defineProperty(this,Qa,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:!1}),Object.defineProperty(this,Ke,{writable:!0,value:null}),this.status=e,this.pollInterval=null,this.closed=!1,Se(this,io)[io]=t,Se(this,Qa)[Qa]=t.wrapPromiseFunction(ps)}connect(){Se(this,Uh)[Uh](),Se(this,Ih)[Ih]()}update(){return Se(this,Ii)[Ii]({diff:!0})}updateStatus(e){Se(this,Dh)[Dh](this.status,e),this.status=e}close(){this.closed=!0,Se(this,Ke)[Ke]&&(Se(this,Ke)[Ke].close(),Se(this,Ke)[Ke]=null),clearInterval(this.pollInterval),this.pollInterval=null}};function aF(){this.emit("finished"),this.close()}o(aF,"_onFinished2");function lF(){Se(this,Ke)[Ke]=new EventSource(`${this.status.websocket_url}?assembly=${this.status.assembly_id}`),Se(this,Ke)[Ke].addEventListener("open",()=>{clearInterval(this.pollInterval),this.pollInterval=null}),Se(this,Ke)[Ke].addEventListener("message",r=>{r.data==="assembly_finished"&&Se(this,Lh)[Lh](),r.data==="assembly_uploading_finished"&&this.emit("executing"),r.data==="assembly_upload_meta_data_extracted"&&(this.emit("metadata"),Se(this,Ii)[Ii]({diff:!1}))}),Se(this,Ke)[Ke].addEventListener("assembly_upload_finished",r=>{let e=JSON.parse(r.data);this.status.uploads.push(e),this.emit("upload",e)}),Se(this,Ke)[Ke].addEventListener("assembly_result_finished",r=>{var e,t;let[i,s]=JSON.parse(r.data);((t=(e=this.status.results)[i])!=null?t:e[i]=[]).push(s),this.emit("result",i,s)}),Se(this,Ke)[Ke].addEventListener("assembly_execution_progress",r=>{let e=JSON.parse(r.data);this.emit("execution-progress",e)}),Se(this,Ke)[Ke].addEventListener("assembly_error",r=>{try{Se(this,Ur)[Ur](JSON.parse(r.data))}catch{Se(this,Ur)[Ur](new Error(r.data))}Se(this,Ii)[Ii]({diff:!1})})}o(lF,"_connectServerSentEvents2");function uF(r){this.emit("error",Object.assign(new Error(r.message),r)),this.close()}o(uF,"_onError2");function cF(){this.pollInterval=setInterval(()=>{Se(this,Ii)[Ii]()},2e3)}o(cF,"_beginPolling2");async function dF(r){let{diff:e=!0}=r===void 0?{}:r;if(!(this.closed||Se(this,io)[io].isPaused||Se(this,ro)[ro]))try{Se(this,ro)[ro]=!0;let t=await Se(this,Qa)[Qa](this.status.assembly_ssl_url);if(Se(this,ro)[ro]=!1,this.closed)return;if(t.status===429){Se(this,io)[io].rateLimit(2e3);return}if(!t.ok){Se(this,Ur)[Ur](new Er(t.statusText));return}let i=await t.json();if(this.closed)return;this.emit("status",i),e?this.updateStatus(i):this.status=i}catch(t){Se(this,Ur)[Ur](t)}}o(dF,"_fetchStatus2");function pF(r,e){let t=r.ok,i=e.ok;if(e.error&&!r.error)return Se(this,Ur)[Ur](e);let s=$u(i,Nh)&&!$u(t,Nh);s&&this.emit("executing"),Object.keys(e.uploads).filter(n=>!er(r.uploads,n)).forEach(n=>{this.emit("upload",e.uploads[n])}),s&&this.emit("metadata"),Object.keys(e.results).forEach(n=>{let a=e.results[n],l=r.results[n];a.filter(u=>!l||!l.some(d=>d.id===u.id)).forEach(u=>{this.emit("result",n,u)})}),$u(i,Mh)&&!$u(t,Mh)&&this.emit("finished")}o(pF,"_diffStatus2");var zh=Bh;function tt(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(tt,"_classPrivateFieldLooseBase");var hF=0;function qu(r){return"__private_"+hF+++"_"+r}o(qu,"_classPrivateFieldLooseKey");var cb="/assemblies",jh=class extends Error{static{o(this,"AssemblyError")}constructor(e,t,i){super(e),this.details=t,this.assembly=i}},lr=qu("headers"),so=qu("fetchWithNetworkError"),ur=qu("fetchJSON"),Ir=qu("reportError"),Za=class{static{o(this,"Client")}constructor(e){Object.defineProperty(this,ur,{value:fF}),Object.defineProperty(this,lr,{writable:!0,value:{}}),Object.defineProperty(this,so,{writable:!0,value:void 0}),Object.defineProperty(this,Ir,{writable:!0,value:o((t,i)=>{if(this.opts.errorReporting===!1)throw t;let s={type:i.type};throw i.assembly&&(s.assembly=i.assembly.assembly_id,s.instance=i.assembly.instance),i.url&&(s.endpoint=i.url),this.submitError(t,s).catch(()=>{}),t},"value")}),this.opts=e,this.opts.client!=null&&(tt(this,lr)[lr]["Transloadit-Client"]=this.opts.client),tt(this,so)[so]=this.opts.rateLimitedQueue.wrapPromiseFunction(ps)}async createAssembly(e){let{params:t,fields:i,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(i).forEach(u=>{a.append(u,String(i[u]))}),a.append("num_expected_upload_files",String(n));let l=new URL(cb,`${this.opts.service}`).href;return tt(this,ur)[ur](l,{method:"POST",headers:tt(this,lr)[lr],body:a}).catch(u=>tt(this,Ir)[Ir](u,{url:l,type:"API_ERROR"}))}async reserveFile(e,t){let i=encodeURIComponent(t.size),s=`${e.assembly_ssl_url}/reserve_file?size=${i}`;return tt(this,ur)[ur](s,{method:"POST",headers:tt(this,lr)[lr]}).catch(n=>tt(this,Ir)[Ir](n,{assembly:e,file:t,url:s,type:"API_ERROR"}))}async addFile(e,t){var i;if(!t.uploadURL)return Promise.reject(new Error("File does not have an `uploadURL`."));let s=encodeURIComponent(t.size),n=encodeURIComponent(t.uploadURL),a=encodeURIComponent((i=t.name)!=null?i:"Unnamed"),u=`size=${s}&filename=${a}&fieldname=file&s3Url=${n}`,d=`${e.assembly_ssl_url}/add_file?${u}`;return tt(this,ur)[ur](d,{method:"POST",headers:tt(this,lr)[lr]}).catch(p=>tt(this,Ir)[Ir](p,{assembly:e,file:t,url:d,type:"API_ERROR"}))}async cancelAssembly(e){let t=e.assembly_ssl_url;await tt(this,so)[so](t,{method:"DELETE",headers:tt(this,lr)[lr]}).catch(i=>tt(this,Ir)[Ir](i,{url:t,type:"API_ERROR"}))}async getAssemblyStatus(e){return tt(this,ur)[ur](e,{headers:tt(this,lr)[lr]}).catch(t=>tt(this,Ir)[Ir](t,{url:e,type:"STATUS_ERROR"}))}async submitError(e,t){let{endpoint:i,instance:s,assembly:n}=t===void 0?{}:t,a=e.details?`${e.message} (${e.details})`:e.message;return tt(this,ur)[ur]("https://transloaditstatus.com/client_error",{method:"POST",body:JSON.stringify({endpoint:i,instance:s,assembly_id:n,agent:typeof navigator<"u"?navigator.userAgent:"",client:this.opts.client,error:a})})}};async function fF(){let r=await tt(this,so)[so](...arguments);if(r.status===429)return this.opts.rateLimitedQueue.rateLimit(2e3),tt(this,ur)[ur](...arguments);if(!r.ok){let e=new Error(r.statusText);return e.statusCode=r.status,`${arguments.length<=0?void 0:arguments[0]}`.endsWith(cb)?r.json().then(t=>{if(!t.error)throw e;let i=new jh(t.error,t.message,t);throw t.assembly_id&&(i.details+=` Assembly ID: ${t.assembly_id}`),i},t=>{throw t.cause=e,t}):Promise.reject(e)}return r.json()}o(fF,"_fetchJSON2");var db=be(Rh(),1);function he(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(he,"_classPrivateFieldLooseBase");var mF=0;function cr(r){return"__private_"+mF+++"_"+r}o(cr,"_classPrivateFieldLooseKey");var el=cr("assemblyIDs"),no=cr("remaining"),tl=cr("resolve"),Hh=cr("reject"),De=cr("uppy"),Di=cr("watching"),rl=cr("onAssemblyComplete"),il=cr("onAssemblyCancel"),ao=cr("onAssemblyError"),sl=cr("onImportError"),oo=cr("checkAllComplete"),qh=cr("removeListeners"),$h=cr("addListeners"),Vh=class extends db.default{static{o(this,"TransloaditAssemblyWatcher")}constructor(e,t){super(),Object.defineProperty(this,$h,{value:bF}),Object.defineProperty(this,qh,{value:vF}),Object.defineProperty(this,oo,{value:yF}),Object.defineProperty(this,Di,{value:gF}),Object.defineProperty(this,el,{writable:!0,value:void 0}),Object.defineProperty(this,no,{writable:!0,value:void 0}),Object.defineProperty(this,tl,{writable:!0,value:void 0}),Object.defineProperty(this,Hh,{writable:!0,value:void 0}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,rl,{writable:!0,value:o(i=>{he(this,Di)[Di](i.assembly_id)&&(he(this,De)[De].log(`[Transloadit] AssemblyWatcher: Got Assembly finish ${i.assembly_id}`),this.emit("assembly-complete",i.assembly_id),he(this,oo)[oo]())},"value")}),Object.defineProperty(this,il,{writable:!0,value:o(i=>{he(this,Di)[Di](i.assembly_id)&&he(this,oo)[oo]()},"value")}),Object.defineProperty(this,ao,{writable:!0,value:o((i,s)=>{he(this,Di)[Di](i.assembly_id)&&(he(this,De)[De].log(`[Transloadit] AssemblyWatcher: Got Assembly error ${i.assembly_id}`),he(this,De)[De].log(s),this.emit("assembly-error",i.assembly_id,s),he(this,oo)[oo]())},"value")}),Object.defineProperty(this,sl,{writable:!0,value:o((i,s,n)=>{he(this,Di)[Di](i.assembly_id)&&he(this,ao)[ao](i,n)},"value")}),he(this,De)[De]=e,he(this,el)[el]=t,he(this,no)[no]=t.length,this.promise=new Promise((i,s)=>{he(this,tl)[tl]=i,he(this,Hh)[Hh]=s}),he(this,$h)[$h]()}};function gF(r){return he(this,el)[el].indexOf(r)!==-1}o(gF,"_watching2");function yF(){he(this,no)[no]-=1,he(this,no)[no]===0&&(he(this,qh)[qh](),he(this,tl)[tl]())}o(yF,"_checkAllComplete2");function vF(){he(this,De)[De].off("transloadit:complete",he(this,rl)[rl]),he(this,De)[De].off("transloadit:assembly-cancel",he(this,il)[il]),he(this,De)[De].off("transloadit:assembly-error",he(this,ao)[ao]),he(this,De)[De].off("transloadit:import-error",he(this,sl)[sl])}o(vF,"_removeListeners2");function bF(){he(this,De)[De].on("transloadit:complete",he(this,rl)[rl]),he(this,De)[De].on("transloadit:assembly-cancel",he(this,il)[il]),he(this,De)[De].on("transloadit:assembly-error",he(this,ao)[ao]),he(this,De)[De].on("transloadit:import-error",he(this,sl)[sl])}o(bF,"_addListeners2");var pb=Vh;var hb={strings:{creatingAssembly:"Preparing upload...",creatingAssemblyFailed:"Transloadit: Could not create Assembly",encoding:"Encoding..."}};function fe(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(fe,"_classPrivateFieldLooseBase");var wF=0;function $e(r){return"__private_"+wF+++"_"+r}o($e,"_classPrivateFieldLooseKey");var SF={version:"4.2.2"},_F={service:"https://api2.transloadit.com",errorReporting:!0,waitForEncoding:!1,waitForMetadata:!1,alwaysRunAssembly:!1,importFromUploadURLs:!1,limit:20,retryDelays:[7e3,1e4,15e3,2e4],clientName:null},fb=o(r=>e=>{let t=new So("Failed to send error to the client",{cause:e});console.error(t,r)},"sendErrorToConsole");function PF(r){if(r==null)throw new Error("Transloadit: The `params` option is required.");if(typeof r=="string")try{r=JSON.parse(r)}catch(e){throw new So("Transloadit: The `params` option is a malformed JSON string.",{cause:e})}if(!r.auth||!r.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(PF,"validateParams");var mb="https://api2.transloadit.com/companion",gb=/\.transloadit\.com$/,xF=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/companion/,Dr=$e("rateLimitedQueue"),hl=$e("watcher"),Wh=$e("getClientVersion"),tf=$e("attachAssemblyMetadata"),Gh=$e("createAssembly"),ol=$e("createAssemblyWatcher"),Kh=$e("shouldWaitAfterUpload"),Xh=$e("reserveFiles"),nl=$e("onFileUploadURLAvailable"),fl=$e("findFile"),rf=$e("onFileUploadComplete"),sf=$e("onResult"),pl=$e("onAssemblyFinished"),Yh=$e("cancelAssembly"),Jh=$e("onCancelAll"),Qh=$e("getPersistentData"),Zh=$e("onRestored"),al=$e("connectAssembly"),ll=$e("prepareUpload"),ul=$e("afterUpload"),cl=$e("closeAssemblyIfExists"),dl=$e("onError"),ef=$e("onTusError"),Ni=class extends Oe{static{o(this,"Transloadit")}constructor(e,t){super(e,{..._F,...t}),Object.defineProperty(this,al,{value:NF}),Object.defineProperty(this,Yh,{value:DF}),Object.defineProperty(this,pl,{value:IF}),Object.defineProperty(this,sf,{value:UF}),Object.defineProperty(this,rf,{value:RF}),Object.defineProperty(this,fl,{value:AF}),Object.defineProperty(this,Xh,{value:kF}),Object.defineProperty(this,Kh,{value:OF}),Object.defineProperty(this,ol,{value:TF}),Object.defineProperty(this,Gh,{value:CF}),Object.defineProperty(this,tf,{value:EF}),Object.defineProperty(this,Wh,{value:FF}),Object.defineProperty(this,Dr,{writable:!0,value:void 0}),Object.defineProperty(this,hl,{writable:!0,value:void 0}),this.restored=null,Object.defineProperty(this,nl,{writable:!0,value:o(i=>{var s;let n=this.uppy.getFile(i.id);if(!(n!=null&&(s=n.transloadit)!=null&&s.assembly))return;let{status:a}=this.assembly;this.client.addFile(a,n).catch(l=>{this.uppy.log(l),this.uppy.emit("transloadit:import-error",a,n.id,l)})},"value")}),Object.defineProperty(this,Jh,{writable:!0,value:o(async()=>{if(this.assembly)try{await fe(this,Yh)[Yh](this.assembly.status)}catch(i){this.uppy.log(i)}},"value")}),Object.defineProperty(this,Qh,{writable:!0,value:o(i=>{this.assembly&&i({[this.id]:{assemblyResponse:this.assembly.status}})},"value")}),Object.defineProperty(this,Zh,{writable:!0,value:o(i=>{let n=(i&&i[this.id]?i[this.id]:{}).assemblyResponse;if(!n)return;let a=o(()=>{let d={},p=[],{assembly_id:f}=n;n.uploads.forEach(v=>{let _=fe(this,fl)[fl](v);d[v.id]={id:_.id,assembly:f,uploadedFile:v}});let y=this.getPluginState();return Object.keys(n.results).forEach(v=>{for(let _ of n.results[v]){let R=y.files[_.original_id];_.localId=R?R.id:null,p.push({id:_.id,result:_,stepName:v,assembly:f})}}),this.assembly=new zh(n,fe(this,Dr)[Dr]),this.assembly.status=n,this.setPluginState({files:d,results:p}),d},"restoreState"),l=o(d=>{fe(this,ol)[ol](n.assembly_id),fe(this,al)[al](this.assembly,d)},"restoreAssemblies"),u=o(()=>{var d;return(d=this.assembly)==null?void 0:d.update()},"updateAssembly");this.restored=(async()=>{let d=a();l(Object.keys(d)),await u(),this.restored=null})(),this.restored.catch(d=>{this.uppy.log("Failed to restore",d)})},"value")}),Object.defineProperty(this,ll,{writable:!0,value:o(async i=>{var s;let n=typeof this.opts.assemblyOptions=="function"?await this.opts.assemblyOptions():this.opts.assemblyOptions;(s=n.fields)!=null||(n.fields={}),PF(n.params);try{var a;let l=(a=this.assembly)!=null?a:await fe(this,Gh)[Gh](i,n);if(l==null)throw new Error("All files were canceled after assembly was created");this.opts.importFromUploadURLs&&await fe(this,Xh)[Xh](l,i),i.forEach(u=>{let d=this.uppy.getFile(u);this.uppy.emit("preprocess-complete",d)}),fe(this,ol)[ol](l.status.assembly_id),fe(this,al)[al](l,i)}catch(l){throw i.forEach(u=>{let d=this.uppy.getFile(u);this.uppy.emit("preprocess-complete",d),this.uppy.emit("upload-error",d,l)}),l}},"value")}),Object.defineProperty(this,ul,{writable:!0,value:o(async(i,s)=>{try{var n,a;await this.restored;let u=i.map(v=>this.uppy.getFile(v)).filter(v=>!v.error),d=(n=this.assembly)==null?void 0:n.status.assembly_id,p=o(()=>{var v;(v=this.assembly)==null||v.close()},"closeSocketConnections");if(!fe(this,Kh)[Kh]()){var l;p();let v=(l=this.assembly)==null?void 0:l.status;v!=null&&this.uppy.addResultData(s,{transloadit:[v]});return}if(!d){this.uppy.addResultData(s,{transloadit:[]});return}u.filter(v=>!er(this.completedFiles,v.id)).forEach(v=>{this.uppy.emit("postprocess-progress",v,{mode:"indeterminate",message:this.i18n("encoding")})}),await fe(this,hl)[hl].promise,p();let y=(a=this.assembly)==null?void 0:a.status;y!=null&&this.uppy.addResultData(s,{transloadit:[y]})}finally{this.assembly=void 0}},"value")}),Object.defineProperty(this,cl,{writable:!0,value:o(()=>{var i;(i=this.assembly)==null||i.close()},"value")}),Object.defineProperty(this,dl,{writable:!0,value:o(i=>{fe(this,cl)[cl](),this.assembly=void 0,this.client.submitError(i).catch(fb(i))},"value")}),Object.defineProperty(this,ef,{writable:!0,value:o((i,s)=>{var n;if(fe(this,cl)[cl](),s!=null&&(n=s.message)!=null&&n.startsWith("tus: ")){var a;let l=(a=s.originalRequest)==null||(a=a.getUnderlyingObject())==null?void 0:a.responseURL;this.client.submitError(s,{endpoint:l}).catch(fb(s))}},"value")}),this.type="uploader",this.id=this.opts.id||"Transloadit",this.defaultLocale=hb,fe(this,Dr)[Dr]=new Sr(this.opts.limit),this.i18nInit(),this.client=new Za({service:this.opts.service,client:fe(this,Wh)[Wh](),errorReporting:this.opts.errorReporting,rateLimitedQueue:fe(this,Dr)[Dr]}),this.completedFiles=Object.create(null)}install(){this.uppy.addPreProcessor(fe(this,ll)[ll]),this.uppy.addPostProcessor(fe(this,ul)[ul]),this.uppy.on("error",fe(this,dl)[dl]),this.uppy.on("cancel-all",fe(this,Jh)[Jh]),this.uppy.on("upload-error",fe(this,ef)[ef]),this.opts.importFromUploadURLs?this.uppy.on("upload-success",fe(this,nl)[nl]):this.uppy.use(Ui,{storeFingerprintForResuming:!1,allowedMetaFields:!0,limit:this.opts.limit,rateLimitedQueue:fe(this,Dr)[Dr],retryDelays:this.opts.retryDelays}),this.uppy.on("restore:get-data",fe(this,Qh)[Qh]),this.uppy.on("restored",fe(this,Zh)[Zh]),this.setPluginState({files:{},results:[]});let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}uninstall(){this.uppy.removePreProcessor(fe(this,ll)[ll]),this.uppy.removePostProcessor(fe(this,ul)[ul]),this.uppy.off("error",fe(this,dl)[dl]),this.opts.importFromUploadURLs&&this.uppy.off("upload-success",fe(this,nl)[nl]);let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}getAssembly(){var e;return(e=this.assembly)==null?void 0:e.status}getAssemblyFiles(e){return this.uppy.getFiles().filter(t=>{var i;return(t==null||(i=t.transloadit)==null?void 0:i.assembly)===e})}};function FF(){let r=[`uppy-core:${this.uppy.constructor.VERSION}`,`uppy-transloadit:${this.constructor.VERSION}`,`uppy-tus:${Ui.VERSION}`],e=o((t,i)=>{let s=this.uppy.getPlugin(t);s&&r.push(`${i}:${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("GoogleDrivePicker","uppy-google-drive-picker"),e("GooglePhotosPicker","uppy-google-photos-picker"),e("Instagram","uppy-instagram"),e("OneDrive","uppy-onedrive"),e("Zoom","uppy-zoom"),e("Url","uppy-url"),this.opts.clientName!=null&&r.push(this.opts.clientName),r.join(",")}o(FF,"_getClientVersion2");function EF(r,e){let t={...r.meta,assembly_url:e.assembly_url,filename:r.name,fieldname:"file"},i={...r.tus,endpoint:e.tus_url,addRequestId:!0},{remote:s}=r;if(r.remote&&xF.test(r.remote.companionUrl)){let a=e.companion_url.replace(/\/$/,""),l=r.remote.url.replace(r.remote.companionUrl,"").replace(/^\//,"");s={...r.remote,companionUrl:a,url:`${a}/${l}`}}let n={...r,transloadit:{assembly:e.assembly_id}};return this.opts.importFromUploadURLs||Object.assign(n,{meta:t,tus:i,remote:s}),n}o(EF,"_attachAssemblyMetadata2");async function CF(r,e){this.uppy.log("[Transloadit] Create Assembly");try{let t=await this.client.createAssembly({...e,expectedFiles:r.length}),i=this.uppy.getFiles().filter(u=>{let{id:d}=u;return r.includes(d)});if(i.length===0&&r.length!==0)return await this.client.cancelAssembly(t),null;let s=new zh(t,fe(this,Dr)[Dr]),{status:n}=s,a=n.assembly_id,l={};return i.forEach(u=>{l[u.id]=fe(this,tf)[tf](u,n)}),this.uppy.setState({files:{...this.uppy.getState().files,...l}}),this.uppy.emit("transloadit:assembly-created",n,r),this.uppy.log(`[Transloadit] Created Assembly ${a}`),s}catch(t){let i=new So(`${this.i18n("creatingAssemblyFailed")}: ${t.message}`,{cause:t});throw"details"in t&&(i.details=t.details),"assembly"in t&&(i.assembly=t.assembly),i}}o(CF,"_createAssembly2");function TF(r){let e=Array.isArray(r)?r:[r],t=new pb(this.uppy,e);t.on("assembly-complete",i=>{this.getAssemblyFiles(i).forEach(n=>{this.completedFiles[n.id]=!0,this.uppy.emit("postprocess-complete",n)})}),t.on("assembly-error",(i,s)=>{let n=this.getAssemblyFiles(i);n.forEach(l=>{this.uppy.emit("upload-error",l,s),this.uppy.emit("postprocess-complete",l)});let a={...this.uppy.getState().files};n.forEach(l=>delete a[l.id].tus),this.uppy.setState({files:a}),this.uppy.emit("error",s)}),fe(this,hl)[hl]=t}o(TF,"_createAssemblyWatcher2");function OF(){return this.opts.waitForEncoding||this.opts.waitForMetadata}o(OF,"_shouldWaitAfterUpload2");function kF(r,e){return Promise.all(e.map(t=>{let i=this.uppy.getFile(t);return this.client.reserveFile(r.status,i)}))}o(kF,"_reserveFiles2");function AF(r){let e=this.uppy.getFiles();for(let t=0;t<e.length;t++){let i=e[t];if(i.uploadURL===r.tus_upload_url||i.tus&&i.tus.uploadUrl===r.tus_upload_url||!r.is_tus_file&&i.name===r.name&&i.size===r.size)return i}}o(AF,"_findFile2");function RF(r,e){let t=this.getPluginState(),i=fe(this,fl)[fl](e);if(!i){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:r,id:i.id,uploadedFile:e}}}),this.uppy.emit("transloadit:upload",e,this.getAssembly())}o(RF,"_onFileUploadComplete2");function UF(r,e,t){let i=this.getPluginState(),s=i.files[t.original_id];t.localId=s?s.id:null;let n={result:t,stepName:e,id:t.id,assembly:r};this.setPluginState({results:[...i.results,n]}),this.uppy.emit("transloadit:result",e,t,this.getAssembly())}o(UF,"_onResult2");function IF(r){let e=r.status.assembly_ssl_url;this.client.getAssemblyStatus(e).then(t=>{r.status=t,this.uppy.emit("transloadit:complete",t)})}o(IF,"_onAssemblyFinished2");async function DF(r){await this.client.cancelAssembly(r),this.uppy.emit("transloadit:assembly-cancelled",r),this.assembly=void 0}o(DF,"_cancelAssembly2");function NF(r,e){let{status:t}=r,i=t.assembly_id;return this.assembly=r,r.on("upload",s=>{fe(this,rf)[rf](i,s)}),r.on("error",s=>{s.assembly=r.status,this.uppy.emit("transloadit:assembly-error",r.status,s)}),r.on("executing",()=>{this.uppy.emit("transloadit:assembly-executing",r.status)}),r.on("execution-progress",s=>{if(this.uppy.emit("transloadit:execution-progress",s),s.progress_combined!=null)for(let n of this.uppy.getFilesByIds(e))this.uppy.emit("postprocess-progress",n,{mode:"determinate",value:s.progress_combined/100,message:this.i18n("encoding")})}),this.opts.waitForEncoding&&r.on("result",(s,n)=>{fe(this,sf)[sf](i,s,n)}),this.opts.waitForEncoding?r.on("finished",()=>{fe(this,pl)[pl](r)}):this.opts.waitForMetadata&&r.on("metadata",()=>{fe(this,pl)[pl](r)}),r.ok==="ASSEMBLY_COMPLETE"||r.connect(),r}o(NF,"_connectAssembly2");Ni.VERSION=SF.version;function _r(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(_r,"_classPrivateFieldLooseBase");var MF=0;function Vu(r){return"__private_"+MF+++"_"+r}o(Vu,"_classPrivateFieldLooseKey");var Mi=Vu("aliveTimer"),lo=Vu("isDone"),ml=Vu("onTimedOut"),uo=Vu("timeout"),of=class{static{o(this,"ProgressTimeout")}constructor(e,t){Object.defineProperty(this,Mi,{writable:!0,value:void 0}),Object.defineProperty(this,lo,{writable:!0,value:!1}),Object.defineProperty(this,ml,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),_r(this,uo)[uo]=e,_r(this,ml)[ml]=()=>t(e)}progress(){_r(this,lo)[lo]||_r(this,uo)[uo]>0&&(clearTimeout(_r(this,Mi)[Mi]),_r(this,Mi)[Mi]=setTimeout(_r(this,ml)[ml],_r(this,uo)[uo]))}done(){_r(this,lo)[lo]||(clearTimeout(_r(this,Mi)[Mi]),_r(this,Mi)[Mi]=void 0,_r(this,lo)[lo]=!0)}},yb=of;var Wu=o(()=>{},"noop");function vb(r,e){e===void 0&&(e={});let{body:t=null,headers:i={},method:s="GET",onBeforeRequest:n=Wu,onUploadProgress:a=Wu,shouldRetry:l=o(()=>!0,"shouldRetry"),onAfterResponse:u=Wu,onTimeout:d=Wu,responseType:p,retries:f=3,signal:y=null,timeout:v=3e4,withCredentials:_=!1}=e,R=o(L=>.3*2**(L-1)*1e3,"delay"),E=new yb(v,d);function O(L){return L===void 0&&(L=0),new Promise(async(B,G)=>{let J=new XMLHttpRequest,$=o(W=>{l(J)&&L<f?setTimeout(()=>{O(L+1).then(B,G)},R(L)):(E.done(),G(W))},"onError");J.open(s,r,!0),J.withCredentials=_,p&&(J.responseType=p),y?.addEventListener("abort",()=>{J.abort(),G(new DOMException("Aborted","AbortError"))}),J.onload=async()=>{try{await u(J,L)}catch(W){W.request=J,$(W);return}J.status>=200&&J.status<300?(E.done(),B(J)):l(J)&&L<f?setTimeout(()=>{O(L+1).then(B,G)},R(L)):(E.done(),G(new Er(J.statusText,J)))},J.onerror=()=>$(new Er(J.statusText,J)),J.upload.onprogress=W=>{E.progress(),a(W)},i&&Object.keys(i).forEach(W=>{J.setRequestHeader(W,i[W])}),await n(J,L),J.send(t)})}return o(O,"requestWithRetry"),O()}o(vb,"fetcher");var bb={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Li(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Li,"_classPrivateFieldLooseBase");var LF=0;function Ko(r){return"__private_"+LF+++"_"+r}o(Ko,"_classPrivateFieldLooseKey");var BF={version:"4.3.3"};function zF(r,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})),Hu(r)?(t=new Er(t,r),t):(t.request=r,t)}o(zF,"buildResponseError");function wb(r){return r.data.slice(0,r.data.size,r.meta.type)}o(wb,"setTypeInBlob");var jF={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""},co=Ko("getFetcher"),lf=Ko("uploadLocalFile"),nf=Ko("uploadBundle"),uf=Ko("getCompanionClientArgs"),af=Ko("uploadFiles"),gl=Ko("handleUpload"),Go=class extends Oe{static{o(this,"XHRUpload")}constructor(e,t){if(super(e,{...jF,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,af,{value:VF}),Object.defineProperty(this,uf,{value:qF}),Object.defineProperty(this,nf,{value:$F}),Object.defineProperty(this,lf,{value:HF}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,gl,{writable:!0,value:o(async i=>{if(i.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[Ou]&&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(i),n=Do(s),a=No(n);if(this.uppy.emit("upload-start",a),this.opts.bundle){if(n.some(u=>u.isRemote))throw new Error("Can\u2019t upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await Li(this,nf)[nf](n)}else await Li(this,af)[af](n)},"value")}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=bb,this.i18nInit(),Ou in this.opts?this.requests=this.opts[Ou]:this.requests=new Sr(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),Li(this,co)[co]=i=>async(s,n)=>{try{var a,l,u;let f=await vb(s,{...n,onBeforeRequest:o((_,R)=>{var E,O;return(E=(O=this.opts).onBeforeRequest)==null?void 0:E.call(O,_,R,i)},"onBeforeRequest"),shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:o(_=>{let R=Math.ceil(_/1e3),E=new Error(this.i18n("uploadStalled",{seconds:R}));this.uppy.emit("upload-stalled",E,i)},"onTimeout"),onUploadProgress:o(_=>{if(_.lengthComputable)for(let{id:E}of i){var R;let O=this.uppy.getFile(E);this.uppy.emit("upload-progress",O,{uploadStarted:(R=O.progress.uploadStarted)!=null?R:0,bytesUploaded:_.loaded/_.total*O.size,bytesTotal:O.size})}},"onUploadProgress")}),y=await((a=(l=this.opts).getResponseData)==null?void 0:a.call(l,f));if(f.responseType==="json"){var d;(d=y)!=null||(y=f.response)}else try{var p;(p=y)!=null||(y=JSON.parse(f.responseText))}catch(_){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:_})}let v=typeof((u=y)==null?void 0:u.url)=="string"?y.url:void 0;for(let{id:_}of i)this.uppy.emit("upload-success",this.uppy.getFile(_),{status:f.status,body:y,uploadURL:v});return f}catch(f){if(f.name==="AbortError")return;let y=f.request;for(let v of i)this.uppy.emit("upload-error",this.uppy.getFile(v.id),zF(y,f),y);throw f}}}getOptions(e){let t=this.uppy.getState().xhrUpload,{headers:i}=this.opts,s={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return typeof i=="function"?s.headers=i(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,i){Oi(i.allowedMetaFields,t).forEach(n=>{let a=t[n];Array.isArray(a)?a.forEach(l=>e.append(n,l)):e.append(n,a)})}createFormDataUpload(e,t){let i=new FormData;this.addMetadata(i,e.meta,t);let s=wb(e);return e.name?i.append(t.fieldName,s,e.meta.name):i.append(t.fieldName,s),i}createBundledUpload(e,t){let i=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(i,s,t),e.forEach(n=>{let a=this.getOptions(n),l=wb(n);n.name?i.append(a.fieldName,l,n.name):i.append(a.fieldName,l)}),i}install(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(Li(this,gl)[gl])}uninstall(){if(this.opts.bundle){let{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(Li(this,gl)[gl])}};async function HF(r){let e=new Ei(this.uppy),t=new AbortController,i=this.requests.wrapPromiseFunction(async()=>{let s=this.getOptions(r),n=Li(this,co)[co]([r]),a=s.formData?this.createFormDataUpload(r,s):r.data;return n(s.endpoint,{...s,body:a,signal:t.signal})});e.onFileRemove(r.id,()=>t.abort()),e.onCancelAll(r.id,()=>{t.abort()});try{await i().abortOn(t.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{e.remove()}}o(HF,"_uploadLocalFile2");async function $F(r){let e=new AbortController,t=this.requests.wrapPromiseFunction(async()=>{var s;let n=(s=this.uppy.getState().xhrUpload)!=null?s:{},a=Li(this,co)[co](r),l=this.createBundledUpload(r,{...this.opts,...n});return a(this.opts.endpoint,{...this.opts,body:l,signal:e.signal})});function i(){e.abort()}o(i,"abort"),this.uppy.once("cancel-all",i);try{await t().abortOn(e.signal)}catch(s){if(s.message!=="Cancelled")throw s}finally{this.uppy.off("cancel-all",i)}}o($F,"_uploadBundle2");function qF(r){var e;let t=this.getOptions(r),i=Oi(t.allowedMetaFields,r.meta);return{...(e=r.remote)==null?void 0:e.body,protocol:"multipart",endpoint:t.endpoint,size:r.data.size,fieldname:t.fieldName,metadata:Object.fromEntries(i.map(s=>[s,r.meta[s]])),httpMethod:t.method,useFormData:t.formData,headers:t.headers}}o(qF,"_getCompanionClientArgs2");async function VF(r){await Promise.allSettled(r.map(e=>{if(e.isRemote){let t=o(()=>this.requests,"getQueue"),i=new AbortController,s=o(a=>{a.id===e.id&&i.abort()},"removedHandler");this.uppy.on("file-removed",s);let n=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,Li(this,uf)[uf](e),{signal:i.signal,getQueue:t});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),n}return Li(this,lf)[lf](e)}))}o(VF,"_uploadFiles2");Go.VERSION=BF.version;var pf=be(hn(),1),xb=be(Sb(),1);var _b={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function Pb(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Pb,"_classPrivateFieldLooseBase");var WF=0;function GF(r){return"__private_"+WF+++"_"+r}o(GF,"_classPrivateFieldLooseKey");var KF={quality:.6,limit:10},yl=GF("RateLimitedQueue"),vl=class extends Oe{static{o(this,"Compressor")}constructor(e,t){super(e,{...KF,...t}),Object.defineProperty(this,yl,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=_b,Pb(this,yl)[yl]=new Sr(this.opts.limit),this.i18nInit(),this.prepareUpload=this.prepareUpload.bind(this),this.compress=this.compress.bind(this)}compress(e){return new Promise((t,i)=>{new xb.default(e,{...this.opts,success:t,error:i})})}async prepareUpload(e){let t=0,i=[],s=Pb(this,yl)[yl].wrapPromiseFunction(async a=>{try{let l=await this.compress(a.data),u=a.data.size-l.size;this.uppy.log(`[Image Compressor] Image ${a.id} compressed by ${(0,pf.default)(u)}`),t+=u;let{name:d,type:p,size:f}=l,y=Br(d),_=`${Br(a.meta.name).name}.${y.extension}`;this.uppy.setFileState(a.id,{...d&&{name:d},...y.extension&&{extension:y.extension},...p&&{type:p},...f&&{size:f},data:l,meta:{...a.meta,type:p,name:_}}),i.push(a)}catch(l){this.uppy.log(`[Image Compressor] Failed to compress ${a.id}:`,"warning"),this.uppy.log(l,"warning")}}),n=e.map(a=>{var l;let u=this.uppy.getFile(a);return this.uppy.emit("preprocess-progress",u,{mode:"indeterminate",message:this.i18n("compressingImages")}),u.isRemote||(u.data.type||(u.data=u.data.slice(0,u.data.size,u.type)),!((l=u.type)!=null&&l.startsWith("image/")))?Promise.resolve():s(u)});await Promise.all(n),this.uppy.emit("compressor:complete",i),t>1024&&this.uppy.info(this.i18n("compressedX",{size:(0,pf.default)(t)}),"info");for(let a of e){let l=this.uppy.getFile(a);this.uppy.emit("preprocess-complete",l)}}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};function Gu(){return Gu=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},Gu.apply(this,arguments)}o(Gu,"_extends");var XF={"[object HTMLCollection]":!0,"[object NodeList]":!0,"[object RadioNodeList]":!0},YF={button:!0,fieldset:!0,reset:!0,submit:!0},JF={checkbox:!0,radio:!0},QF=/^\s+|\s+$/g,ZF=Array.prototype.slice,Fb=Object.prototype.toString;function Ku(r,e){if(!r)throw new Error("A form is required by getFormData, was given form="+r);e=Gu({includeDisabled:!1,trim:!1},e);for(var t={},i,s=[],n={},a=0,l=r.elements.length;a<l;a++){var u=r.elements[a];YF[u.type]||u.disabled&&!e.includeDisabled||(i=u.name||u.id,i&&!n[i]&&(s.push(i),n[i]=!0))}for(var d=0,p=s.length;d<p;d++){i=s[d];var f=Cb(r,i,e);f!=null&&(t[i]=f)}return t}o(Ku,"getFormData");function Cb(r,e,t){if(!r)throw new Error("A form is required by getFieldData, was given form="+r);if(!e&&Fb.call(e)!=="[object String]")throw new Error("A field name is required by getFieldData, was given fieldName="+e);t=Gu({includeDisabled:!1,trim:!1},t);var i=r.elements[e];if(!i||i.disabled&&!t.includeDisabled)return null;if(!XF[Fb.call(i)])return Eb(i,t.trim);for(var s=[],n=!0,a=0,l=i.length;a<l;a++)if(!(i[a].disabled&&!t.includeDisabled)){n&&i[a].type!=="radio"&&(n=!1);var u=Eb(i[a],t.trim);u!=null&&(s=s.concat(u))}return n&&s.length===1?s[0]:s.length>0?s:null}o(Cb,"getFieldData");function Eb(r,e){var t=null,i=r.type;if(i==="select-one")return r.options.length&&(t=r.options[r.selectedIndex].value),t;if(i==="select-multiple"){t=[];for(var s=0,n=r.options.length;s<n;s++)r.options[s].selected&&t.push(r.options[s].value);return t.length===0&&(t=null),t}return i==="file"&&"files"in r?(r.multiple?(t=ZF.call(r.files),t.length===0&&(t=null)):t=r.files[0],t):(JF[i]?r.checked&&(i==="checkbox"&&!r.hasAttribute("value")?t=!0:t=r.value):t=e?r.value.replace(QF,""):r.value,t)}o(Eb,"getFormElementValue");Ku.getFieldData=Cb;function Qi(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Qi,"_classPrivateFieldLooseBase");var e3=0;function t3(r){return"__private_"+e3+++"_"+r}o(t3,"_classPrivateFieldLooseKey");var r3={version:"4.1.1"},i3={resultName:"uppyResult",getMetaFromForm:!0,addResultToForm:!0,submitOnSuccess:!1,triggerUploadOnSubmit:!1};function s3(r){if(r==null||r.nodeName!=="FORM")throw new Error("ASSERTION FAILED: the target is not a <form> element",{cause:r});return r}o(s3,"assertHTMLFormElement");var Tt=t3("form"),Xo=class extends Oe{static{o(this,"Form")}constructor(e,t){super(e,{...i3,...t}),Object.defineProperty(this,Tt,{writable:!0,value:void 0}),this.type="acquirer",this.id=this.opts.id||"Form",this.handleFormSubmit=this.handleFormSubmit.bind(this),this.handleUploadStart=this.handleUploadStart.bind(this),this.handleSuccess=this.handleSuccess.bind(this),this.addResultToForm=this.addResultToForm.bind(this),this.getMetaFromForm=this.getMetaFromForm.bind(this)}handleUploadStart(){this.opts.getMetaFromForm&&this.getMetaFromForm()}handleSuccess(e){this.opts.addResultToForm&&this.addResultToForm(e),this.opts.submitOnSuccess&&Qi(this,Tt)[Tt].reportValidity()&&Qi(this,Tt)[Tt].submit()}handleFormSubmit(e){if(this.opts.triggerUploadOnSubmit){e.preventDefault();let t=et(e.target.elements),i=[];t.forEach(s=>{(s.tagName==="BUTTON"||s.tagName==="INPUT"&&s.type==="submit")&&!s.disabled&&(s.disabled=!0,i.push(s))}),this.uppy.upload().then(()=>{i.forEach(s=>{s.disabled=!1})},s=>(i.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=Qi(this,Tt)[Tt].querySelector(`[name="${this.opts.resultName}"]`);if(t){let i;try{i=JSON.parse(t.value)}catch{}Array.isArray(i)||(i=[]),i.push(e),t.value=JSON.stringify(i);return}t=document.createElement("input"),t.name=this.opts.resultName,t.type="hidden",t.value=JSON.stringify([e]),Qi(this,Tt)[Tt].appendChild(t)}getMetaFromForm(){let e=Ku(Qi(this,Tt)[Tt]);delete e[this.opts.resultName],this.uppy.setMeta(e)}install(){Qi(this,Tt)[Tt]=s3(Vl(this.opts.target)),Qi(this,Tt)[Tt].addEventListener("submit",this.handleFormSubmit),this.uppy.on("upload",this.handleUploadStart),this.uppy.on("complete",this.handleSuccess)}uninstall(){Qi(this,Tt)[Tt].removeEventListener("submit",this.handleFormSubmit),this.uppy.off("upload",this.handleUploadStart),this.uppy.off("complete",this.handleSuccess)}};Xo.VERSION=r3.version;var Bb=be(ac(),1);function Yo(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Yo,"_classPrivateFieldLooseBase");var o3=0;function n3(r){return"__private_"+o3+++"_"+r}o(n3,"_classPrivateFieldLooseKey");var Tb=typeof navigator<"u"&&"serviceWorker"in navigator;function a3(){return new Promise((r,e)=>{Tb?navigator.serviceWorker.controller?r():navigator.serviceWorker.addEventListener("controllerchange",()=>{r()}):e(new Error("Unsupported"))})}o(a3,"waitForServiceWorker");var dr=n3("ready"),Xu=class{static{o(this,"ServiceWorkerStore")}constructor(e){Object.defineProperty(this,dr,{writable:!0,value:void 0}),Yo(this,dr)[dr]=a3().then(t=>{Yo(this,dr)[dr]=t}),this.name=e.storeName}get ready(){return Promise.resolve(Yo(this,dr)[dr])}async list(){return await Yo(this,dr)[dr],new Promise((e,t)=>{let i=o(s=>{if(s.data.store===this.name)switch(s.data.type){case"uppy/ALL_FILES":e(s.data.files),navigator.serviceWorker.removeEventListener("message",i);break;default:t()}},"onMessage");navigator.serviceWorker.addEventListener("message",i),navigator.serviceWorker.controller.postMessage({type:"uppy/GET_FILES",store:this.name})})}async put(e){await Yo(this,dr)[dr],navigator.serviceWorker.controller.postMessage({type:"uppy/ADD_FILE",store:this.name,file:e})}async delete(e){await Yo(this,dr)[dr],navigator.serviceWorker.controller.postMessage({type:"uppy/REMOVE_FILE",store:this.name,fileID:e})}};Xu.isSupported=Tb;var Ob=Xu;function Bi(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}o(Bi,"_classPrivateFieldLooseBase");var l3=0;function u3(r){return"__private_"+l3+++"_"+r}o(u3,"_classPrivateFieldLooseKey");var Ib=typeof window<"u"&&(window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB),c3=!!Ib,kb="uppy-blobs",Yt="files",Db=24*60*60*1e3,d3=3,Ab=1048576;function p3(r){let e=r.openCursor();e.onsuccess=t=>{let i=t.target.result;if(!i)return;let s=i.value;s.expires=Date.now()+Db,i.update(s)}}o(p3,"migrateExpiration");function Rb(r){let e=Ib.open(r,d3);return new Promise((t,i)=>{e.onupgradeneeded=s=>{let n=s.target.result,a=s.currentTarget.transaction;if(s.oldVersion<2&&n.createObjectStore(Yt,{keyPath:"id"}).createIndex("store","store",{unique:!1}),s.oldVersion<3){let l=a.objectStore(Yt);l.createIndex("expires","expires",{unique:!1}),p3(l)}a.oncomplete=()=>{t(n)}},e.onsuccess=s=>{t(s.target.result)},e.onerror=i})}o(Rb,"connect");function Yu(r){return new Promise((e,t)=>{r.onsuccess=i=>{e(i.target.result)},r.onerror=t})}o(Yu,"waitForRequest");var Ub=!1,lt=u3("ready"),Ju=class r{static{o(this,"IndexedDBStore")}constructor(e){Object.defineProperty(this,lt,{writable:!0,value:void 0}),this.opts={dbName:kb,storeName:"default",expires:Db,maxFileSize:10*Ab,maxTotalSize:300*Ab,...e},this.name=this.opts.storeName;let t=o(async()=>{let i=await Rb(this.opts.dbName);return Bi(this,lt)[lt]=i,i},"createConnection");Ub?Bi(this,lt)[lt]=t():(Ub=!0,Bi(this,lt)[lt]=r.cleanup().then(t,t))}get ready(){return Promise.resolve(Bi(this,lt)[lt])}key(e){return`${this.name}!${e}`}async list(){let s=(await Bi(this,lt)[lt]).transaction([Yt],"readonly").objectStore(Yt).index("store").getAll(IDBKeyRange.only(this.name)),n=await Yu(s);return Object.fromEntries(n.map(a=>[a.fileID,a.data]))}async get(e){let s=(await Bi(this,lt)[lt]).transaction([Yt],"readonly").objectStore(Yt).get(this.key(e)),{data:n}=await Yu(s);return{id:n.fileID,data:n.data}}async getSize(){let s=(await Bi(this,lt)[lt]).transaction([Yt],"readonly").objectStore(Yt).index("store").openCursor(IDBKeyRange.only(this.name));return new Promise((n,a)=>{let l=0;s.onsuccess=u=>{let d=u.target.result;d?(l+=d.value.data.size,d.continue()):n(l)},s.onerror=()=>{a(new Error("Could not retrieve stored blobs size"))}})}async put(e){if(e.data.size>this.opts.maxFileSize)throw new Error("File is too big to store.");if(await this.getSize()>this.opts.maxTotalSize)throw new Error("No space left");let n=(await Bi(this,lt)[lt]).transaction([Yt],"readwrite").objectStore(Yt).add({id:this.key(e.id),fileID:e.id,store:this.name,expires:Date.now()+this.opts.expires,data:e.data});return Yu(n)}async delete(e){let s=(await Bi(this,lt)[lt]).transaction([Yt],"readwrite").objectStore(Yt).delete(this.key(e));return Yu(s)}static async cleanup(){let e=await Rb(kb),s=e.transaction([Yt],"readwrite").objectStore(Yt).index("expires").openCursor(IDBKeyRange.upperBound(Date.now()));await new Promise((n,a)=>{s.onsuccess=l=>{let u=l.target.result;u?(u.delete(),u.continue()):n()},s.onerror=a}),e.close()}};Ju.isSupported=c3;var Nb=Ju;function h3(){let r=[];for(let e=0;e<localStorage.length;e++){let t=localStorage.key(e);t!=null&&t.startsWith("uppyState:")&&r.push(t.slice(10))}return r}o(h3,"findUppyInstances");function Mb(r){try{return JSON.parse(r)}catch{return null}}o(Mb,"maybeParse");var Lb=!1,Zi=class r{static{o(this,"MetaDataStore")}constructor(e){this.opts={expires:24*60*60*1e3,...e},this.name=`uppyState:${e.storeName}`,Lb||(Lb=!0,r.cleanup())}load(){let e=localStorage.getItem(this.name);if(!e)return null;let t=Mb(e);return t?t.metadata:null}save(e){let t=Date.now()+this.opts.expires,i=JSON.stringify({metadata:e,expires:t});localStorage.setItem(this.name,i)}static cleanup(e){if(e){localStorage.removeItem(`uppyState:${e}`);return}let t=h3(),i=Date.now();t.forEach(s=>{let n=localStorage.getItem(`uppyState:${s}`);if(!n)return;let a=Mb(n);a&&a.expires&&a.expires<i&&localStorage.removeItem(`uppyState:${s}`)})}};var f3={version:"4.1.1"},m3={expires:24*60*60*1e3,serviceWorker:!1},Jo=class extends Oe{static{o(this,"GoldenRetriever")}constructor(e,t){super(e,{...m3,...t}),this.addBlobToStores=i=>{i.isRemote||(this.ServiceWorkerStore&&this.ServiceWorkerStore.put(i).catch(s=>{this.uppy.log("[GoldenRetriever] Could not store file","warning"),this.uppy.log(s)}),this.IndexedDBStore.put(i).catch(s=>{this.uppy.log("[GoldenRetriever] Could not store file","warning"),this.uppy.log(s)}))},this.removeBlobFromStores=i=>{this.ServiceWorkerStore&&this.ServiceWorkerStore.delete(i.id).catch(s=>{this.uppy.log("[GoldenRetriever] Failed to remove file","warning"),this.uppy.log(s)}),this.IndexedDBStore.delete(i.id).catch(s=>{this.uppy.log("[GoldenRetriever] Failed to remove file","warning"),this.uppy.log(s)})},this.replaceBlobInStores=i=>{this.removeBlobFromStores(i),this.addBlobToStores(i)},this.handleRestoreConfirmed=()=>{this.uppy.log("[GoldenRetriever] Restore confirmed, proceeding...");let{currentUploads:i}=this.uppy.getState();i&&(this.uppy.resumeAll(),Object.keys(i).forEach(s=>{this.uppy.restore(s)})),this.uppy.setState({recoveredState:null})},this.abortRestore=()=>{this.uppy.log("[GoldenRetriever] Aborting restore...");let i=Object.keys(this.uppy.getState().files);this.deleteBlobs(i).then(()=>{this.uppy.log(`[GoldenRetriever] Removed ${i.length} files`)}).catch(s=>{this.uppy.log(`[GoldenRetriever] Could not remove ${i.length} files`,"warning"),this.uppy.log(s)}),this.uppy.cancelAll(),this.uppy.setState({recoveredState:null}),Zi.cleanup(this.uppy.opts.id)},this.handleComplete=i=>{let{successful:s}=i,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}),Zi.cleanup(this.uppy.opts.id)},this.restoreBlobs=()=>{this.uppy.getFiles().length>0?Promise.all([this.loadFileBlobsFromServiceWorker(),this.loadFileBlobsFromIndexedDB()]).then(i=>{let s={...i[0],...i[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 Zi({expires:this.opts.expires,storeName:e.getID()}),this.ServiceWorkerStore=null,this.opts.serviceWorker&&(this.ServiceWorkerStore=new Ob({storeName:e.getID()})),this.IndexedDBStore=new Nb({expires:this.opts.expires,...this.opts.indexedDB||{},storeName:e.getID()}),this.saveFilesStateToLocalStorage=(0,Bb.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}),Zi.cleanup(this.uppy.opts.id);return}let i=Object.fromEntries(t.map(a=>{let[l,u]=a;return[l,u.isRemote?{...u,isRestored:!0}:{...u,isRestored:!0,data:null,preview:null}]})),s={};this.uppy.emit("restore:get-data",a=>{Object.assign(s,a)});let{currentUploads:n}=this.uppy.getState();this.MetaDataStore.save({currentUploads:n,files:i,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=[],i={...this.uppy.getState().files};Object.keys(e).forEach(s=>{let n=this.uppy.getFile(s);if(!n){t.push(s);return}let l={data:e[s],isRestored:!0,isGhost:!1};i[s]={...n,...l}}),Object.keys(i).forEach(s=>{i[s].data===null&&(i[s]={...i[s],isGhost:!0})}),this.uppy.setState({files:i}),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 i,s,n;return(i=(s=this.ServiceWorkerStore)==null?void 0:s.delete(t))!=null?i:(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)}};Jo.VERSION=f3.version;var g3={version:"4.0.1"},Qo=class extends se{static{o(this,"ReduxDevTools")}constructor(e,t){super(e,t),this.type="debugger",this.id=this.opts.id||"ReduxDevTools",this.title="Redux DevTools";let i={};this.opts={...i,...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))}};Qo.VERSION=g3.version;function y3(){throw new Error("Core has been renamed to Uppy")}o(y3,"Core");var v3={ProviderView:ed};Ni.COMPANION_URL=mb;Ni.COMPANION_ALLOWED_HOSTS=gb;var b3={};globalThis.Uppy=hf;})();
/**
 * 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.6.2
   * https://fengyuanchen.github.io/cropperjs
   *
   * Copyright 2015-present Chen Fengyuan
   * Released under the MIT license
   *
   * Date: 2024-04-21T07:43:05.335Z
   *)

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
ØA
—Eoúô