2 lines
229 KiB
JavaScript
2 lines
229 KiB
JavaScript
/*! For license information please see bundle.js.LICENSE.txt */
|
||
(()=>{var e={505:e=>{"use strict";e.exports=function(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("Expected a number, got "+typeof e);const t=e<0,i=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";const s=Math.min(Math.floor(Math.log(e)/Math.log(1024)),i.length-1);e=Number(e/1024**s);const r=i[s];return e>=10||e%1==0?`${(t?"-":"")+e.toFixed(0)} ${r}`:`${(t?"-":"")+e.toFixed(1)} ${r}`}},228:e=>{"use strict";var t=Object.prototype.hasOwnProperty,i="~";function s(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function n(e,t,s,n,o){if("function"!=typeof s)throw new TypeError("The listener must be a function");var a=new r(s,n||e,o),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new s:delete e._events[t]}function a(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,s,r=[];if(0===this._eventsCount)return r;for(s in e=this._events)t.call(e,s)&&r.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=i?i+e:e,s=this._events[t];if(!s)return[];if(s.fn)return[s.fn];for(var r=0,n=s.length,o=new Array(n);r<n;r++)o[r]=s[r].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,s=this._events[t];return s?s.fn?1:s.length:0},a.prototype.emit=function(e,t,s,r,n,o){var a=i?i+e:e;if(!this._events[a])return!1;var l,u,d=this._events[a],h=arguments.length;if(d.fn){switch(d.once&&this.removeListener(e,d.fn,void 0,!0),h){case 1:return d.fn.call(d.context),!0;case 2:return d.fn.call(d.context,t),!0;case 3:return d.fn.call(d.context,t,s),!0;case 4:return d.fn.call(d.context,t,s,r),!0;case 5:return d.fn.call(d.context,t,s,r,n),!0;case 6:return d.fn.call(d.context,t,s,r,n,o),!0}for(u=1,l=new Array(h-1);u<h;u++)l[u-1]=arguments[u];d.fn.apply(d.context,l)}else{var p,c=d.length;for(u=0;u<c;u++)switch(d[u].once&&this.removeListener(e,d[u].fn,void 0,!0),h){case 1:d[u].fn.call(d[u].context);break;case 2:d[u].fn.call(d[u].context,t);break;case 3:d[u].fn.call(d[u].context,t,s);break;case 4:d[u].fn.call(d[u].context,t,s,r);break;default:if(!l)for(p=1,l=new Array(h-1);p<h;p++)l[p-1]=arguments[p];d[u].fn.apply(d[u].context,l)}}return!0},a.prototype.on=function(e,t,i){return n(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return n(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,s,r){var n=i?i+e:e;if(!this._events[n])return this;if(!t)return o(this,n),this;var a=this._events[n];if(a.fn)a.fn!==t||r&&!a.once||s&&a.context!==s||o(this,n);else{for(var l=0,u=[],d=a.length;l<d;l++)(a[l].fn!==t||r&&!a[l].once||s&&a[l].context!==s)&&u.push(a[l]);u.length?this._events[n]=1===u.length?u[0]:u:o(this,n)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new s,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a},993:e=>{e.exports=function(e,t){if(e===t)return!0;for(var i in e)if(!(i in t))return!1;for(var i in t)if(e[i]!==t[i])return!1;return!0}},873:(e,t,i)=>{var s=i(325).Symbol;e.exports=s},552:(e,t,i)=>{var s=i(873),r=i(659),n=i(350),o=s?s.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?r(e):n(e)}},128:(e,t,i)=>{var s=i(800),r=/^\s+/;e.exports=function(e){return e?e.slice(0,s(e)+1).replace(r,""):e}},840:(e,t,i)=>{var s="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;e.exports=s},659:(e,t,i)=>{var s=i(873),r=Object.prototype,n=r.hasOwnProperty,o=r.toString,a=s?s.toStringTag:void 0;e.exports=function(e){var t=n.call(e,a),i=e[a];try{e[a]=void 0;var s=!0}catch(e){}var r=o.call(e);return s&&(t?e[a]=i:delete e[a]),r}},350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},325:(e,t,i)=>{var s=i(840),r="object"==typeof self&&self&&self.Object===Object&&self,n=s||r||Function("return this")();e.exports=n},800:e=>{var t=/\s/;e.exports=function(e){for(var i=e.length;i--&&t.test(e.charAt(i)););return i}},221:(e,t,i)=>{var s=i(805),r=i(124),n=i(374),o=Math.max,a=Math.min;e.exports=function(e,t,i){var l,u,d,h,p,c,f=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var i=l,s=u;return l=u=void 0,f=t,h=e.apply(s,i)}function b(e){var i=e-c;return void 0===c||i>=t||i<0||g&&e-f>=d}function w(){var e=r();if(b(e))return _(e);p=setTimeout(w,function(e){var i=t-(e-c);return g?a(i,d-(e-f)):i}(e))}function _(e){return p=void 0,y&&l?v(e):(l=u=void 0,h)}function F(){var e=r(),i=b(e);if(l=arguments,u=this,c=e,i){if(void 0===p)return function(e){return f=e,p=setTimeout(w,t),m?v(e):h}(c);if(g)return clearTimeout(p),p=setTimeout(w,t),v(c)}return void 0===p&&(p=setTimeout(w,t)),h}return t=n(t)||0,s(i)&&(m=!!i.leading,d=(g="maxWait"in i)?o(n(i.maxWait)||0,t):d,y="trailing"in i?!!i.trailing:y),F.cancel=function(){void 0!==p&&clearTimeout(p),f=0,l=c=u=p=void 0},F.flush=function(){return void 0===p?h:_(r())},F}},805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},394:(e,t,i)=>{var s=i(552),r=i(346);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==s(e)}},124:(e,t,i)=>{var s=i(325);e.exports=function(){return s.Date.now()}},969:(e,t,i)=>{var s=i(221),r=i(805);e.exports=function(e,t,i){var n=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return r(i)&&(n="leading"in i?!!i.leading:n,o="trailing"in i?!!i.trailing:o),s(e,t,{leading:n,maxWait:t,trailing:o})}},374:(e,t,i)=>{var s=i(128),r=i(805),n=i(394),o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(n(e))return NaN;if(r(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=r(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=s(e);var i=a.test(e);return i||l.test(e)?u(e.slice(2),i?2:8):o.test(e)?NaN:+e}},57:(e,t,i)=>{var s=i(163),r=/[\/\+\.]/;e.exports=function(e,t){function i(t){var i=s(t,e,r);return i&&i.length>=2}return t?i(t.split(";")[0]):i}},835:e=>{e.exports=function(){var e={},t=e._fns={};return e.emit=function(e,i,s,r,n,o,a){var l=function(e){for(var i=t[e]?t[e]:[],s=e.indexOf(":"),r=-1===s?[e]:[e.substring(0,s),e.substring(s+1)],n=Object.keys(t),o=0,a=n.length;o<a;o++){var l=n[o];if("*"===l&&(i=i.concat(t[l])),2===r.length&&r[0]===l){i=i.concat(t[l]);break}}return i}(e);l.length&&function(e,t,i){for(var s=0,r=t.length;s<r&&t[s];s++)t[s].event=e,t[s].apply(t[s],i)}(e,l,[i,s,r,n,o,a])},e.on=function(e,i){t[e]||(t[e]=[]),t[e].push(i)},e.once=function(t,i){this.on(t,(function s(){i.apply(this,arguments),e.off(t,s)}))},e.off=function(e,t){var i=[];if(e&&t)for(var s=this._fns[e],r=0,n=s?s.length:0;r<n;r++)s[r]!==t&&i.push(s[r]);i.length?this._fns[e]=i:delete this._fns[e]},e}},163:e=>{"use strict";function t(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}t.prototype.match=function(e){var t,i,s=!0,r=this.parts,n=r.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(i=(e||"").split(this.separator),t=0;s&&t<n;t++)"*"!==r[t]&&(s=t<i.length&&r[t]===i[t]);s=s&&i}else s=!1;else if("function"==typeof e.splice)for(s=[],t=e.length;t--;)this.match(e[t])&&(s[s.length]=e[t]);else if("object"==typeof e)for(var o in s={},e)this.match(o)&&(s[o]=e[o]);return s},e.exports=function(e,i,s){var r=new t(e,s||/[\/\.]/);return void 0!==i?r.match(i):r}},942:(e,t)=>{var i;!function(){"use strict";var s={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=o(e,n(i)))}return e}function n(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)s.call(e,i)&&e[i]&&(t=o(t,i));return t}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):void 0===(i=function(){return r}.apply(t,[]))||(e.exports=i)}()}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={exports:{}};return e[s](n,n.exports,i),n.exports}i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";function e(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var t=0;function s(e){return"__private_"+t+++"_"+e}function r(e,t,i){const s=[];return e.forEach((e=>"string"!=typeof e?s.push(e):t[Symbol.split](e).forEach(((e,t,r)=>{""!==e&&s.push(e),t<r.length-1&&s.push(i)})))),s}function n(e,t){const i=/\$/g;let s=[e];if(null==t)return s;for(const e of Object.keys(t))if("_"!==e){let n=t[e];"string"==typeof n&&(n=i[Symbol.replace](n,"$$$$")),s=r(s,new RegExp(`%\\{${e}\\}`,"g"),n)}return s}const o=e=>{throw new Error(`missing string: ${e}`)};var a=s("onMissingKey"),l=s("apply");class u{constructor(t,i){let{onMissingKey:s=o}=void 0===i?{}:i;Object.defineProperty(this,l,{value:d}),Object.defineProperty(this,a,{writable:!0,value:void 0}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(t)?t.forEach(e(this,l)[l],this):e(this,l)[l](t),e(this,a)[a]=s}translate(e,t){return this.translateArray(e,t).join("")}translateArray(t,i){let s=this.locale.strings[t];if(null==s&&(e(this,a)[a](t),s=t),"object"==typeof s){if(i&&void 0!==i.smart_count)return n(s[this.locale.pluralize(i.smart_count)],i);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof s)throw new Error("string was not a string");return n(s,i)}}function d(e){if(null==e||!e.strings)return;const t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}var h=i(835);let p=(e=21)=>{let t="",i=e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};var c=i(969);function f(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var m=0;function g(e){return"__private_"+m+++"_"+e}var y=g("callbacks"),v=g("publish");class b{constructor(){Object.defineProperty(this,v,{value:w}),this.state={},Object.defineProperty(this,y,{writable:!0,value:new Set})}getState(){return this.state}setState(e){const t={...this.state},i={...this.state,...e};this.state=i,f(this,v)[v](t,i,e)}subscribe(e){return f(this,y)[y].add(e),()=>{f(this,y)[y].delete(e)}}}function w(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];f(this,y)[y].forEach((e=>{e(...t)}))}b.VERSION="3.2.2";const _=b;function F(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}const P={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function S(e){var t;if(e.type)return e.type;const i=e.name?null==(t=F(e.name).extension)?void 0:t.toLowerCase():null;return i&&i in P?P[i]:"application/octet-stream"}function C(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/")))+t}function k(e){if(function(e){return!(!e.isRemote||!e.remote)&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider)}(e))return e.id;const t=S(e);return function(e){let t="uppy";return"string"==typeof e.name&&(t+=`-${C(e.name.toLowerCase())}`),void 0!==e.type&&(t+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(t+=`-${C(e.meta.relativePath.toLowerCase())}`),void 0!==e.data.size&&(t+=`-${e.data.size}`),void 0!==e.data.lastModified&&(t+=`-${e.data.lastModified}`),t}({...e,type:t})}function T(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const i=t[1].split(".",2),s=parseInt(i[0],10),r=parseInt(i[1],10);return s<15||15===s&&r<15063||s>18||18===s&&r>=18218}function O(e){return e<10?`0${e}`:e.toString()}function E(){const e=new Date;return`${O(e.getHours())}:${O(e.getMinutes())}:${O(e.getSeconds())}`}const A={debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return console.error(`[Uppy] [${E()}]`,...t)}},x={debug:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return console.debug(`[Uppy] [${E()}]`,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return console.warn(`[Uppy] [${E()}]`,...t)},error:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return console.error(`[Uppy] [${E()}]`,...t)}};var D=i(505),N=i(57);const U={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class I extends Error{constructor(e,t){var i;super(e),this.isRestriction=!0,this.isUserFacing=null==(i=null==t?void 0:t.isUserFacing)||i,null!=t&&t.file&&(this.file=t.file)}}class B{constructor(e,t){this.i18n=t,this.getOpts=()=>{var t;const i=e();if(null!=(null==(t=i.restrictions)?void 0:t.allowedFileTypes)&&!Array.isArray(i.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return i}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:i,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s){const i=e.filter((e=>!e.isGhost));if(i.length+t.length>s)throw new I(`${this.i18n("youCanOnlyUploadX",{smart_count:s})}`)}if(i){let s=e.reduce(((e,t)=>{var i;return e+(null!=(i=t.size)?i:0)}),0);for(const e of t)if(null!=e.size&&(s+=e.size,s>i))throw new I(this.i18n("exceedsSize",{size:D(i),file:e.name}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:i,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some((t=>t.includes("/")?!!e.type&&N(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.slice(1).toLowerCase()))){const t=s.join(", ");throw new I(this.i18n("youCanOnlyUploadFileTypes",{types:t}),{file:e})}if(t&&null!=e.size&&e.size>t)throw new I(this.i18n("exceedsSize",{size:D(t),file:e.name}),{file:e});if(i&&null!=e.size&&e.size<i)throw new I(this.i18n("inferiorSize",{size:D(i)}),{file:e})}validate(e,t){t.forEach((e=>{this.validateSingleFile(e)})),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new I(this.i18n("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new I(this.i18n("missingRequiredMetaFieldOnFile",{fileName:e.name})),{requiredMetaFields:i}=this.getOpts().restrictions,s=[];for(const t of i)Object.hasOwn(e.meta,t)&&""!==e.meta[t]||s.push(t);return{missingFields:s,error:t}}}const R={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled"}};let M,L;function z(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var j=0;function q(e){return"__private_"+j+++"_"+e}const H={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var V=q("plugins"),W=q("restricter"),G=q("storeUnsubscribe"),K=q("emitter"),X=q("preProcessors"),Y=q("uploaders"),Q=q("postProcessors"),J=q("informAndEmit"),Z=q("checkRequiredMetaFieldsOnFile"),ee=q("checkRequiredMetaFields"),te=q("assertNewUploadAllowed"),ie=q("transformFile"),se=q("startIfAutoProceed"),re=q("checkAndUpdateFileState"),ne=q("addListeners"),oe=q("updateOnlineStatus"),ae=q("requestClientById"),le=q("createUpload"),ue=q("getUpload"),de=q("removeUpload"),he=q("runUpload");M=Symbol.for("uppy test: getPlugins"),L=Symbol.for("uppy test: createUpload");class pe{constructor(e){Object.defineProperty(this,he,{value:Se}),Object.defineProperty(this,de,{value:Pe}),Object.defineProperty(this,ue,{value:Fe}),Object.defineProperty(this,le,{value:_e}),Object.defineProperty(this,ne,{value:we}),Object.defineProperty(this,re,{value:be}),Object.defineProperty(this,se,{value:ve}),Object.defineProperty(this,ie,{value:ye}),Object.defineProperty(this,te,{value:ge}),Object.defineProperty(this,ee,{value:me}),Object.defineProperty(this,Z,{value:fe}),Object.defineProperty(this,J,{value:ce}),Object.defineProperty(this,V,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,G,{writable:!0,value:void 0}),Object.defineProperty(this,K,{writable:!0,value:h()}),Object.defineProperty(this,X,{writable:!0,value:new Set}),Object.defineProperty(this,Y,{writable:!0,value:new Set}),Object.defineProperty(this,Q,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,this.calculateProgress=c(((e,t)=>{const i=this.getFile(null==e?void 0:e.id);if(null==e||!i)return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);if(100===i.progress.percentage)return void this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);const s=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...i.progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:s?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}),500,{leading:!0,trailing:!0}),Object.defineProperty(this,oe,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,ae,{writable:!0,value:new Map}),this.defaultLocale=R;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:U,meta:{},onBeforeFileAdded:(e,t)=>!Object.hasOwn(t,e.id),onBeforeUpload:e=>e,store:new _,logger:A,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=x),this.log(`Using Core v${pe.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...H,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:T(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),z(this,W)[W]=new B((()=>this.opts),this.i18n),z(this,G)[G]=this.store.subscribe(((e,t,i)=>{this.emit("state-update",e,t,i),this.updateAll(t)})),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),z(this,ne)[ne]()}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];z(this,K)[K].emit(e,...i)}on(e,t){return z(this,K)[K].on(e,t),this}once(e,t){return z(this,K)[K].once(e,t),this}off(e,t){return z(this,K)[K].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){const t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map((e=>{let[i,s]=e;return[i,{...t[i],...s}]})))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){const e=new u([this.defaultLocale,this.opts.locale],{onMissingKey:e=>this.log(`Missing i18n string: ${e}`,"error")});this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...null==e?void 0:e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((t=>{t.setOptions(e)})),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},i={};Object.keys(t).forEach((s=>{i[s]={...t[s],progress:{...t[s].progress,...e}}})),this.setState({files:i,...H}),this.emit("reset-progress")}clearUploadedFiles(){this.setState({...H,files:{}})}addPreProcessor(e){z(this,X)[X].add(e)}removePreProcessor(e){return z(this,X)[X].delete(e)}addPostProcessor(e){z(this,Q)[Q].add(e)}removePostProcessor(e){return z(this,Q)[Q].delete(e)}addUploader(e){z(this,Y)[Y].add(e)}removeUploader(e){return z(this,Y)[Y].delete(e)}setMeta(e){const t={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach((t=>{i[t]={...i[t],meta:{...i[t].meta,...e}}})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:i})}setFileMeta(e,t){const i={...this.getState().files};if(!i[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const s={...i[e].meta,...t};i[e]={...i[e],meta:s},this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map((e=>this.getFile(e)))}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:i}=this.getState(),s=Object.values(e),r=s.filter((e=>{let{progress:t}=e;return!t.uploadComplete&&t.uploadStarted})),n=s.filter((e=>!e.progress.uploadStarted)),o=s.filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess)),a=s.filter((e=>e.progress.uploadStarted)),l=s.filter((e=>e.isPaused)),u=s.filter((e=>e.progress.uploadComplete)),d=s.filter((e=>e.error)),h=r.filter((e=>!e.isPaused)),p=s.filter((e=>e.progress.preprocess||e.progress.postprocess));return{newFiles:n,startedFiles:o,uploadStartedFiles:a,pausedFiles:l,completeFiles:u,erroredFiles:d,inProgressFiles:r,inProgressNotPausedFiles:h,processingFiles:p,isUploadStarted:a.length>0,isAllComplete:100===t&&u.length===s.length&&0===p.length,isAllErrored:!!i&&d.length===s.length,isAllPaused:0!==r.length&&l.length===r.length,isUploadInProgress:r.length>0,isSomeGhost:s.some((e=>e.isGhost))}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{z(this,W)[W].validate(t,[e])}catch(e){return e}return null}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){z(this,te)[te](e);const{nextFilesState:t,validFilesToAdd:i,errors:s}=z(this,re)[re]([e]),r=s.filter((e=>e.isRestriction));if(z(this,J)[J](r),s.length>0)throw s[0];this.setState({files:t});const[n]=i;return this.emit("file-added",n),this.emit("files-added",i),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),z(this,se)[se](),n.id}addFiles(e){z(this,te)[te]();const{nextFilesState:t,validFilesToAdd:i,errors:s}=z(this,re)[re](e),r=s.filter((e=>e.isRestriction));z(this,J)[J](r);const n=s.filter((e=>!e.isRestriction));if(n.length>0){let e="Multiple errors occurred while adding files:\n";if(n.forEach((t=>{e+=`\n * ${t.message}`})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:n.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(n,e);{const t=new Error(e);throw t.errors=n,t}}this.setState({files:t}),i.forEach((e=>{this.emit("file-added",e)})),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach((e=>{this.log(`Added file: ${e.name}\n id: ${e.id}\n type: ${e.type}`)})),i.length>0&&z(this,se)[se]()}removeFiles(e,t){const{files:i,currentUploads:s}=this.getState(),r={...i},n={...s},o=Object.create(null);function a(e){return void 0===o[e]}e.forEach((e=>{i[e]&&(o[e]=i[e],delete r[e])})),Object.keys(n).forEach((e=>{const t=s[e].fileIDs.filter(a);if(0===t.length)return void delete n[e];const{capabilities:i}=this.getState();if(t.length!==s[e].fileIDs.length&&!i.individualCancellation)throw new Error("individualCancellation is disabled");n[e]={...s[e],fileIDs:t}}));const l={currentUploads:n,files:r};0===Object.keys(r).length&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();const u=Object.keys(o);u.forEach((e=>{this.emit("file-removed",o[e],t)})),u.length>5?this.log(`Removed ${u.length} files`):this.log(`Removed files: ${u.join(", ")}`)}removeFile(e,t){this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const t=!this.getFile(e).isPaused;return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const i={...e[t],isPaused:!0};e[t]=i})),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const i={...e[t],isPaused:!1,error:null};e[t]=i})),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter((t=>e[t].error));if(t.forEach((t=>{const i={...e[t],isPaused:!1,error:null};e[t]=i})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const i=z(this,le)[le](t,{forceAllowNewUpload:!0});return z(this,he)[he](i)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState(H)}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=z(this,le)[le]([e],{forceAllowNewUpload:!0});return z(this,he)[he](t)}logout(){this.iteratePlugins((e=>{var t;null==(t=e.provider)||null==t.logout||t.logout()}))}calculateTotalProgress(){const e=this.getFiles().filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess));if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter((e=>null!=e.progress.bytesTotal)),i=e.filter((e=>null==e.progress.bytesTotal));if(0===t.length){const t=100*e.length,s=i.reduce(((e,t)=>e+t.progress.percentage),0),r=Math.round(s/t*100);return void this.setState({totalProgress:r})}let s=t.reduce(((e,t)=>{var i;return e+(null!=(i=t.progress.bytesTotal)?i:0)}),0);const r=s/t.length;s+=r*i.length;let n=0;t.forEach((e=>{n+=e.progress.bytesUploaded})),i.forEach((e=>{n+=r*(e.progress.percentage||0)/100}));let o=0===s?0:Math.round(n/s*100);o>100&&(o=100),this.setState({totalProgress:o}),this.emit("progress",o)}updateOnlineStatus(){var e;null==(e=window.navigator.onLine)||e?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if("function"!=typeof e)throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`);const i=new e(this,t),s=i.id;if(!s)throw new Error("Your plugin must have an id");if(!i.type)throw new Error("Your plugin must have a type");const r=this.getPlugin(s);if(r){const e=`Already found a plugin named '${r.id}'. Tried to use: '${s}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),i.type in z(this,V)[V]?z(this,V)[V][i.type].push(i):z(this,V)[V][i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(const t of Object.values(z(this,V)[V])){const i=t.find((t=>t.id===e));if(null!=i)return i}}[M](e){return z(this,V)[V][e]}iteratePlugins(e){Object.values(z(this,V)[V]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=z(this,V)[V][e.type],i=t.findIndex((t=>t.id===e.id));-1!==i&&t.splice(i,1);const s={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(s)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),z(this,G)[G](),this.iteratePlugins((e=>{this.removePlugin(e)})),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",z(this,oe)[oe]),window.removeEventListener("offline",z(this,oe)[oe]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,i){void 0===t&&(t="info"),void 0===i&&(i=3e3);const s="object"==typeof e;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){const{logger:i}=this.opts;switch(t){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e)}}registerRequestClient(e,t){z(this,ae)[ae].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=z(this,ae)[ae].get(e.remote.requestClientId);if(null==t)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]?z(this,he)[he](e):(z(this,de)[de](e),Promise.reject(new Error("Nonexistent upload")))}[L](){return z(this,le)[le](...arguments)}addResultData(e,t){if(!z(this,ue)[ue](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:i}=this.getState(),s={...i[e],result:{...i[e].result,...t}};this.setState({currentUploads:{...i,[e]:s}})}upload(){var e;null!=(e=z(this,V)[V].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const i=this.opts.onBeforeUpload(t);return!1===i?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(i&&"object"==typeof i&&(t=i,this.setState({files:t})),Promise.resolve().then((()=>z(this,W)[W].validateMinNumberOfFiles(t))).catch((e=>{throw z(this,J)[J]([e]),e})).then((()=>{if(!z(this,ee)[ee](t))throw new I(this.i18n("missingRequiredMetaField"))})).catch((e=>{throw e})).then((()=>{const{currentUploads:e}=this.getState(),i=Object.values(e).flatMap((e=>e.fileIDs)),s=[];Object.keys(t).forEach((e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==i.indexOf(e)||s.push(t.id)}));const r=z(this,le)[le](s);return z(this,he)[he](r)})).catch((e=>{throw this.emit("error",e),this.log(e,"error"),e})))}}function ce(e){for(const t of e)t.isRestriction?this.emit("restriction-failed",t.file,t):this.emit("error",t,t.file),this.log(t,"warning");const t=e.filter((e=>e.isUserFacing)),i=t.slice(0,4),s=t.slice(4);i.forEach((e=>{let{message:t,details:i=""}=e;this.info({message:t,details:i},"error",this.opts.infoTimeout)})),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}function fe(e){const{missingFields:t,error:i}=z(this,W)[W].getMissingRequiredMetaFields(e);return!(t.length>0&&(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(i.message),this.emit("restriction-failed",e,i),1))}function me(e){let t=!0;for(const i of Object.values(e))z(this,Z)[Z](i)||(t=!1);return t}function ge(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new I(this.i18n("noMoreFilesAllowed"),{file:e});throw z(this,J)[J]([t]),t}}function ye(e){const t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e}:e,i=S(t),s=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}(i,t),r=F(s).extension,n=k(t),o=t.meta||{};o.name=s,o.type=i;const a=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:n,name:s,extension:r||"",meta:{...this.getState().meta,...o},type:i,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:a,uploadComplete:!1,uploadStarted:null},size:a,isGhost:!1,isRemote:t.isRemote||!1,remote:t.remote||"",preview:t.preview}}function ve(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((()=>{this.scheduledAutoProceed=null,this.upload().catch((e=>{e.isRestriction||this.log(e.stack||e.message||e)}))}),4))}function be(e){const{files:t}=this.getState(),i={...t},s=[],r=[];for(const o of e)try{var n;let e=z(this,ie)[ie](o);const r=null==(n=t[e.id])?void 0:n.isGhost;r&&(e={...t[e.id],isGhost:!1,data:o.data},this.log(`Replaced the blob in the restored ghost file: ${e.name}, ${e.id}`));const a=this.opts.onBeforeFileAdded(e,i);if(!a&&this.checkIfFileAlreadyExists(e.id))throw new I(this.i18n("noDuplicates",{fileName:e.name}),{file:o});if(!1===a&&!r)throw new I("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:o});"object"==typeof a&&null!==a&&(e=a),z(this,W)[W].validateSingleFile(e),i[e.id]=e,s.push(e)}catch(e){r.push(e)}try{z(this,W)[W].validateAggregateRestrictions(Object.values(t),s)}catch(e){return r.push(e),{nextFilesState:t,validFilesToAdd:[],errors:r}}return{nextFilesState:i,validFilesToAdd:s,errors:r}}function we(){const e=(e,t,i)=>{let s=e.message||"Unknown error";e.details&&(s+=` ${e.details}`),this.setState({error:s}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:s,response:i})};this.on("error",e),this.on("upload-error",((t,i,s)=>{if(e(i,t,s),"object"==typeof i&&i.message){var r;this.log(i.message,"error");const e=new Error(this.i18n("failedToUpload",{file:null!=(r=null==t?void 0:t.name)?r:""}));e.isUserFacing=!0,e.details=i.message,i.details&&(e.details+=` ${i.details}`),z(this,J)[J]([e])}else z(this,J)[J]([i])}));let t=null;this.on("upload-stalled",((e,i)=>{const{message:s}=e,r=i.map((e=>e.meta.name)).join(", ");t||(this.info({message:s,details:r},"warning",this.opts.infoTimeout),t=setTimeout((()=>{t=null}),this.opts.infoTimeout)),this.log(`${s} ${r}`.trim(),"warning")})),this.on("upload",(()=>{this.setState({error:null})}));const i=e=>{const t=e.filter((e=>{const t=null!=e&&this.getFile(e.id);return t||this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`),t})),i=Object.fromEntries(t.map((e=>[e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}])));this.patchFilesState(i)};this.on("upload-start",(e=>{e.forEach((e=>{this.emit("upload-started",e)})),i(e)})),this.on("upload-progress",this.calculateProgress),this.on("upload-success",((e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const i=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...i,postprocess:z(this,Q)[Q].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:i.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||i.bytesTotal}),this.calculateTotalProgress()})),this.on("preprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("preprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})})),this.on("postprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("postprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})})),this.on("restored",(()=>{this.calculateTotalProgress()})),this.on("dashboard:file-edit-complete",(e=>{e&&z(this,Z)[Z](e)})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",z(this,oe)[oe]),window.addEventListener("offline",z(this,oe)[oe]),setTimeout(z(this,oe)[oe],3e3))}function _e(e,t){void 0===t&&(t={});const{forceAllowNewUpload:i=!1}=t,{allowNewUpload:s,currentUploads:r}=this.getState();if(!s&&!i)throw new Error("Cannot create a new upload: already uploading.");const n=p();return this.emit("upload",{id:n,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...r,[n]:{fileIDs:e,step:0,result:{}}}}),n}function Fe(e){const{currentUploads:t}=this.getState();return t[e]}function Pe(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function Se(e){const t=()=>{const{currentUploads:t}=this.getState();return t[e]};let i=t();const s=[...z(this,X)[X],...z(this,Y)[Y],...z(this,Q)[Q]];try{for(let r=i.step||0;r<s.length&&i;r++){const n=s[r];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...i,step:r}}});const{fileIDs:o}=i;await n(o,e),i=t()}}catch(t){throw z(this,de)[de](e),t}if(i){i.fileIDs.forEach((e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)}));const s=i.fileIDs.map((e=>this.getFile(e))),r=s.filter((e=>!e.error)),n=s.filter((e=>e.error));this.addResultData(e,{successful:r,failed:n,uploadID:e}),i=t()}let r;return i&&(r=i.result,this.emit("complete",r),z(this,de)[de](e)),null==r&&this.log(`Not setting result for an upload that has been removed: ${e}`),r}pe.VERSION="3.9.3";const Ce=pe;var ke,Te,Oe,Ee,Ae,xe,De,Ne={},Ue=[],Ie=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Be=Array.isArray;function Re(e,t){for(var i in t)e[i]=t[i];return e}function Me(e){var t=e.parentNode;t&&t.removeChild(e)}function Le(e,t,i){var s,r,n,o={};for(n in t)"key"==n?s=t[n]:"ref"==n?r=t[n]:o[n]=t[n];if(arguments.length>2&&(o.children=arguments.length>3?ke.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(n in e.defaultProps)void 0===o[n]&&(o[n]=e.defaultProps[n]);return ze(e,o,s,r,null)}function ze(e,t,i,s,r){var n={type:e,props:t,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==r?++Oe:r,__i:-1,__u:0};return null==r&&null!=Te.vnode&&Te.vnode(n),n}function je(e){return e.children}function $e(e,t){this.props=e,this.context=t}function qe(e,t){if(null==t)return e.__?qe(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?qe(e):null}function He(e,t,i){var s,r=e.__v,n=r.__e,o=e.__P;if(o)return(s=Re({},r)).__v=r.__v+1,Te.vnode&&Te.vnode(s),st(o,s,r,e.__n,void 0!==o.ownerSVGElement,32&r.__u?[n]:null,t,null==n?qe(r):n,!!(32&r.__u),i),s.__v=r.__v,s.__.__k[s.__i]=s,s.__d=void 0,s.__e!=n&&Ve(s),s}function Ve(e){var t,i;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e){e.__e=e.__c.base=i.__e;break}return Ve(e)}}function We(e){(!e.__d&&(e.__d=!0)&&Ee.push(e)&&!Ge.__r++||Ae!==Te.debounceRendering)&&((Ae=Te.debounceRendering)||xe)(Ge)}function Ge(){var e,t,i,s=[],r=[];for(Ee.sort(De);e=Ee.shift();)e.__d&&(i=Ee.length,t=He(e,s,r)||t,0===i||Ee.length>i?(rt(s,t,r),r.length=s.length=0,t=void 0,Ee.sort(De)):t&&Te.__c&&Te.__c(t,Ue));t&&rt(s,t,r),Ge.__r=0}function Ke(e,t,i,s,r,n,o,a,l,u,d){var h,p,c,f,m,g=s&&s.__k||Ue,y=t.length;for(i.__d=l,Xe(i,t,g),l=i.__d,h=0;h<y;h++)null!=(c=i.__k[h])&&"boolean"!=typeof c&&"function"!=typeof c&&(p=-1===c.__i?Ne:g[c.__i]||Ne,c.__i=h,st(e,c,p,r,n,o,a,l,u,d),f=c.__e,c.ref&&p.ref!=c.ref&&(p.ref&&ot(p.ref,null,c),d.push(c.ref,c.__c||f,c)),null==m&&null!=f&&(m=f),65536&c.__u||p.__k===c.__k?l=Ye(c,l,e):"function"==typeof c.type&&void 0!==c.__d?l=c.__d:f&&(l=f.nextSibling),c.__d=void 0,c.__u&=-196609);i.__d=l,i.__e=m}function Xe(e,t,i){var s,r,n,o,a,l=t.length,u=i.length,d=u,h=0;for(e.__k=[],s=0;s<l;s++)o=s+h,null!=(r=e.__k[s]=null==(r=t[s])||"boolean"==typeof r||"function"==typeof r?null:"string"==typeof r||"number"==typeof r||"bigint"==typeof r||r.constructor==String?ze(null,r,null,null,null):Be(r)?ze(je,{children:r},null,null,null):void 0===r.constructor&&r.__b>0?ze(r.type,r.props,r.key,r.ref?r.ref:null,r.__v):r)?(r.__=e,r.__b=e.__b+1,a=Je(r,i,o,d),r.__i=a,n=null,-1!==a&&(d--,(n=i[a])&&(n.__u|=131072)),null==n||null===n.__v?(-1==a&&h--,"function"!=typeof r.type&&(r.__u|=65536)):a!==o&&(a===o+1?h++:a>o?d>l-o?h+=a-o:h--:a<o?a==o-1&&(h=a-o):h=0,a!==s+h&&(r.__u|=65536))):(n=i[o])&&null==n.key&&n.__e&&!(131072&n.__u)&&(n.__e==e.__d&&(e.__d=qe(n)),at(n,n,!1),i[o]=null,d--);if(d)for(s=0;s<u;s++)null!=(n=i[s])&&!(131072&n.__u)&&(n.__e==e.__d&&(e.__d=qe(n)),at(n,n))}function Ye(e,t,i){var s,r;if("function"==typeof e.type){for(s=e.__k,r=0;s&&r<s.length;r++)s[r]&&(s[r].__=e,t=Ye(s[r],t,i));return t}e.__e!=t&&(i.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function Qe(e,t){return t=t||[],null==e||"boolean"==typeof e||(Be(e)?e.some((function(e){Qe(e,t)})):t.push(e)),t}function Je(e,t,i,s){var r=e.key,n=e.type,o=i-1,a=i+1,l=t[i];if(null===l||l&&r==l.key&&n===l.type&&!(131072&l.__u))return i;if(s>(null==l||131072&l.__u?0:1))for(;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&!(131072&l.__u)&&r==l.key&&n===l.type)return o;o--}if(a<t.length){if((l=t[a])&&!(131072&l.__u)&&r==l.key&&n===l.type)return a;a++}}return-1}function Ze(e,t,i){"-"===t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||Ie.test(t)?i:i+"px"}function et(e,t,i,s,r){var n;e:if("style"===t)if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof s&&(e.style.cssText=s=""),s)for(t in s)i&&t in i||Ze(e.style,t,"");if(i)for(t in i)s&&i[t]===s[t]||Ze(e.style,t,i[t])}else if("o"===t[0]&&"n"===t[1])n=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+n]=i,i?s?i.u=s.u:(i.u=Date.now(),e.addEventListener(t,n?it:tt,n)):e.removeEventListener(t,n?it:tt,n);else{if(r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,i))}}function tt(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Te.event?Te.event(e):e)}}function it(e){if(this.l)return this.l[e.type+!0](Te.event?Te.event(e):e)}function st(e,t,i,s,r,n,o,a,l,u){var d,h,p,c,f,m,g,y,v,b,w,_,F,P,S,C=t.type;if(void 0!==t.constructor)return null;128&i.__u&&(l=!!(32&i.__u),n=[a=t.__e=i.__e]),(d=Te.__b)&&d(t);e:if("function"==typeof C)try{if(y=t.props,v=(d=C.contextType)&&s[d.__c],b=d?v?v.props.value:d.__:s,i.__c?g=(h=t.__c=i.__c).__=h.__E:("prototype"in C&&C.prototype.render?t.__c=h=new C(y,b):(t.__c=h=new $e(y,b),h.constructor=C,h.render=lt),v&&v.sub(h),h.props=y,h.state||(h.state={}),h.context=b,h.__n=s,p=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=C.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=Re({},h.__s)),Re(h.__s,C.getDerivedStateFromProps(y,h.__s))),c=h.props,f=h.state,h.__v=t,p)null==C.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==C.getDerivedStateFromProps&&y!==c&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(y,b),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(y,h.__s,b)||t.__v===i.__v)){for(t.__v!==i.__v&&(h.props=y,h.state=h.__s,h.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.forEach((function(e){e&&(e.__=t)})),w=0;w<h._sb.length;w++)h.__h.push(h._sb[w]);h._sb=[],h.__h.length&&o.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(y,h.__s,b),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(c,f,m)}))}if(h.context=b,h.props=y,h.__P=e,h.__e=!1,_=Te.__r,F=0,"prototype"in C&&C.prototype.render){for(h.state=h.__s,h.__d=!1,_&&_(t),d=h.render(h.props,h.state,h.context),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[]}else do{h.__d=!1,_&&_(t),d=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++F<25);h.state=h.__s,null!=h.getChildContext&&(s=Re(Re({},s),h.getChildContext())),p||null==h.getSnapshotBeforeUpdate||(m=h.getSnapshotBeforeUpdate(c,f)),Ke(e,Be(S=null!=d&&d.type===je&&null==d.key?d.props.children:d)?S:[S],t,i,s,r,n,o,a,l,u),h.base=t.__e,t.__u&=-161,h.__h.length&&o.push(h),g&&(h.__E=h.__=null)}catch(e){t.__v=null,l||null!=n?(t.__e=a,t.__u|=l?160:32,n[n.indexOf(a)]=null):(t.__e=i.__e,t.__k=i.__k),Te.__e(e,t,i)}else null==n&&t.__v===i.__v?(t.__k=i.__k,t.__e=i.__e):t.__e=nt(i.__e,t,i,s,r,n,o,l,u);(d=Te.diffed)&&d(t)}function rt(e,t,i){for(var s=0;s<i.length;s++)ot(i[s],i[++s],i[++s]);Te.__c&&Te.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Te.__e(e,t.__v)}}))}function nt(e,t,i,s,r,n,o,a,l){var u,d,h,p,c,f,m,g=i.props,y=t.props,v=t.type;if("svg"===v&&(r=!0),null!=n)for(u=0;u<n.length;u++)if((c=n[u])&&"setAttribute"in c==!!v&&(v?c.localName===v:3===c.nodeType)){e=c,n[u]=null;break}if(null==e){if(null===v)return document.createTextNode(y);e=r?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,y.is&&y),n=null,a=!1}if(null===v)g===y||a&&e.data===y||(e.data=y);else{if(n=n&&ke.call(e.childNodes),g=i.props||Ne,!a&&null!=n)for(g={},u=0;u<e.attributes.length;u++)g[(c=e.attributes[u]).name]=c.value;for(u in g)c=g[u],"children"==u||("dangerouslySetInnerHTML"==u?h=c:"key"===u||u in y||et(e,u,null,c,r));for(u in y)c=y[u],"children"==u?p=c:"dangerouslySetInnerHTML"==u?d=c:"value"==u?f=c:"checked"==u?m=c:"key"===u||a&&"function"!=typeof c||g[u]===c||et(e,u,c,g[u],r);if(d)a||h&&(d.__html===h.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(h&&(e.innerHTML=""),Ke(e,Be(p)?p:[p],t,i,s,r&&"foreignObject"!==v,n,o,n?n[0]:i.__k&&qe(i,0),a,l),null!=n)for(u=n.length;u--;)null!=n[u]&&Me(n[u]);a||(u="value",void 0!==f&&(f!==e[u]||"progress"===v&&!f||"option"===v&&f!==g[u])&&et(e,u,f,g[u],!1),u="checked",void 0!==m&&m!==e[u]&&et(e,u,m,g[u],!1))}return e}function ot(e,t,i){try{"function"==typeof e?e(t):e.current=t}catch(e){Te.__e(e,i)}}function at(e,t,i){var s,r;if(Te.unmount&&Te.unmount(e),(s=e.ref)&&(s.current&&s.current!==e.__e||ot(s,null,t)),null!=(s=e.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(e){Te.__e(e,t)}s.base=s.__P=null,e.__c=void 0}if(s=e.__k)for(r=0;r<s.length;r++)s[r]&&at(s[r],t,i||"function"!=typeof e.type);i||null==e.__e||Me(e.__e),e.__=e.__e=e.__d=void 0}function lt(e,t,i){return this.constructor(e,i)}function ut(e,t,i){var s,r,n,o;Te.__&&Te.__(e,t),r=(s="function"==typeof i)?null:i&&i.__k||t.__k,n=[],o=[],st(t,e=(!s&&i||t).__k=Le(je,null,[e]),r||Ne,Ne,void 0!==t.ownerSVGElement,!s&&i?[i]:r?null:t.firstChild?ke.call(t.childNodes):null,n,!s&&i?i:r?r.__e:t.firstChild,s,o),e.__d=void 0,rt(n,e,o)}function dt(e,t,i){var s,r,n,o,a=Re({},e.props);for(n in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==n?s=t[n]:"ref"==n?r=t[n]:a[n]=void 0===t[n]&&void 0!==o?o[n]:t[n];return arguments.length>2&&(a.children=arguments.length>3?ke.call(arguments,2):i),ze(e.type,a,s||e.key,r||e.ref,null)}function ht(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}ke=Ue.slice,Te={__e:function(e,t,i,s){for(var r,n,o;t=t.__;)if((r=t.__c)&&!r.__)try{if((n=r.constructor)&&null!=n.getDerivedStateFromError&&(r.setState(n.getDerivedStateFromError(e)),o=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,s||{}),o=r.__d),o)return r.__E=r}catch(t){e=t}throw e}},Oe=0,$e.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Re({},this.state),"function"==typeof e&&(e=e(Re({},i),this.props)),e&&Re(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),We(this))},$e.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),We(this))},$e.prototype.render=je,Ee=[],xe="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,De=function(e,t){return e.__v.__b-t.__v.__b},Ge.__r=0;const pt=function(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir};class ct{constructor(e,t){this.uppy=e,this.opts=null!=t?t:{}}getPluginState(){const{plugins:e}=this.uppy.getState();return(null==e?void 0:e[this.id])||{}}setPluginState(e){if(!e)return;const{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(){const e=new u([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 ft(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var mt=0;function gt(e){return"__private_"+mt+++"_"+e}var yt=gt("updateUI");class vt extends ct{constructor(){super(...arguments),Object.defineProperty(this,yt,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if("function"==typeof(null==e?void 0:e.addTarget))t=e,t instanceof vt||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:vt}}));else if("function"==typeof e){const i=e;this.uppy.iteratePlugins((e=>{e instanceof i&&(t=e)}))}return t}mount(e,t){const i=t.id,s=(r=e,void 0===n&&(n=document),"string"==typeof r?n.querySelector(r):ht(r)?r:null);var r,n;if(s){this.isTargetDOMEl=!0;const t=document.createElement("div");return t.classList.add("uppy-Root"),ft(this,yt)[yt]=function(e){let t,i=null;return function(){for(var s=arguments.length,r=new Array(s),n=0;n<s;n++)r[n]=arguments[n];return t=r,i||(i=Promise.resolve().then((()=>(i=null,e(...t))))),i}}((e=>{this.uppy.getPlugin(this.id)&&(ut(this.render(e),t),this.afterUpdate())})),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),ut(this.render(this.uppy.getState()),t),this.el=t,s.appendChild(t),t.dir=this.opts.direction||pt(t)||"ltr",this.onMount(),this.el}const o=this.getTargetPlugin(e);if(o)return this.uppy.log(`Installing ${i} to ${o.id}`),this.parent=o,this.el=o.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let a=`Invalid target option given to ${i}.`;throw a+="function"==typeof e?" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(a)}render(e){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){var t,i;null!=this.el&&(null==(t=(i=ft(this,yt))[yt])||t.call(i,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove()),this.onUnmount()}onMount(){}onUnmount(){}}const bt=vt;function wt(e,t,i,s){return 0===i||e===t?e:0===s?t:e+(t-e)*2**(-s/i)}const _t={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var Ft=i(942);function Pt(e){const t=[];let i,s="indeterminate";for(const{progress:r}of Object.values(e)){const{preprocess:e,postprocess:n}=r;null==i&&(e||n)&&({mode:s,message:i}=e||n),"determinate"===(null==e?void 0:e.mode)&&t.push(e.value),"determinate"===(null==n?void 0:n.mode)&&t.push(n.value)}return{mode:s,message:i,value:t.reduce(((e,i)=>e+i/t.length),0)}}function St(e){const t=(i=e,{hours:Math.floor(i/3600)%24,minutes:Math.floor(i/60)%60,seconds:Math.floor(i%60)});var i;return`${0===t.hours?"":`${t.hours}h`}${0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`}${0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`}`}const Ct=()=>" · ";function kt(e){const{newFiles:t,isUploadStarted:i,recoveredState:s,i18n:r,uploadState:n,isSomeGhost:o,startUpload:a}=e,l=Ft("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===_t.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":o}),u=r(t&&i&&!s?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return Le("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:t}),onClick:a,disabled:o,"data-uppy-super-focusable":!0},u)}function Tt(e){const{i18n:t,uppy:i}=e;return Le("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>i.retryAll().catch((()=>{})),"data-uppy-super-focusable":!0,"data-cy":"retry"},Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},Le("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"})),t("retry"))}function Ot(e){const{i18n:t,uppy:i}=e;return Le("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>i.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},Le("g",{fill:"none",fillRule:"evenodd"},Le("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Le("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"}))))}function Et(e){const{isAllPaused:t,i18n:i,isAllComplete:s,resumableUploads:r,uppy:n}=e,o=i(t?"resume":"pause");return Le("button",{title:o,"aria-label":o,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){s||(r?t?n.resumeAll():n.pauseAll():n.cancelAll())},"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},Le("g",{fill:"none",fillRule:"evenodd"},Le("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),Le("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function At(e){const{i18n:t,doneButtonHandler:i}=e;return Le("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:i,"data-uppy-super-focusable":!0},t("done"))}function xt(){return Le("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},Le("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"}))}function Dt(e){const{progress:t}=e,{value:i,mode:s,message:r}=t;return Le("div",{className:"uppy-StatusBar-content"},Le(xt,null),"determinate"===s?`${Math.round(100*i)}% · `:"",r)}function Nt(e){const{numUploads:t,complete:i,totalUploadedSize:s,totalSize:r,totalETA:n,i18n:o}=e,a=t>1;return Le("div",{className:"uppy-StatusBar-statusSecondary"},a&&o("filesUploadedOfTotal",{complete:i,smart_count:t}),Le("span",{className:"uppy-StatusBar-additionalInfo"},a&&Ct(),o("dataUploadedOfTotal",{complete:D(s),total:D(r)}),Ct(),o("xTimeLeft",{time:St(n)})))}function Ut(e){const{i18n:t,complete:i,numUploads:s}=e;return Le("div",{className:"uppy-StatusBar-statusSecondary"},t("filesUploadedOfTotal",{complete:i,smart_count:s}))}function It(e){const{i18n:t,newFiles:i,startUpload:s}=e,r=Ft("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return Le("div",{className:"uppy-StatusBar-statusSecondary"},Le("div",{className:"uppy-StatusBar-statusSecondaryHint"},t("xMoreFilesAdded",{smart_count:i})),Le("button",{type:"button",className:r,"aria-label":t("uploadXFiles",{smart_count:i}),onClick:s},t("upload")))}function Bt(e){const{i18n:t,supportsUploadProgress:i,totalProgress:s,showProgressDetails:r,isUploadStarted:n,isAllComplete:o,isAllPaused:a,newFiles:l,numUploads:u,complete:d,totalUploadedSize:h,totalSize:p,totalETA:c,startUpload:f}=e,m=l&&n;if(!n||o)return null;const g=t(a?"paused":"uploading");return Le("div",{className:"uppy-StatusBar-content","aria-label":g,title:g},a?null:Le(xt,null),Le("div",{className:"uppy-StatusBar-status"},Le("div",{className:"uppy-StatusBar-statusPrimary"},i?`${g}: ${s}%`:g),a||m||!r?null:i?Le(Nt,{numUploads:u,complete:d,totalUploadedSize:h,totalSize:p,totalETA:c,i18n:t}):Le(Ut,{i18n:t,complete:d,numUploads:u}),m?Le(It,{i18n:t,newFiles:l,startUpload:f}):null))}function Rt(e){const{i18n:t}=e;return Le("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},Le("div",{className:"uppy-StatusBar-status"},Le("div",{className:"uppy-StatusBar-statusPrimary"},Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},Le("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))}function Mt(e){const{error:t,i18n:i,complete:s,numUploads:r}=e;return Le("div",{className:"uppy-StatusBar-content",title:i("uploadFailed")},Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},Le("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"})),Le("div",{className:"uppy-StatusBar-status"},Le("div",{className:"uppy-StatusBar-statusPrimary"},i("uploadFailed"),Le("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":i("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){const e=`${i("uploadFailed")} \n\n ${t}`;alert(e)},type:"button"},"?")),Le(Ut,{i18n:i,complete:s,numUploads:r})))}const{STATE_ERROR:Lt,STATE_WAITING:zt,STATE_PREPROCESSING:jt,STATE_UPLOADING:$t,STATE_POSTPROCESSING:qt,STATE_COMPLETE:Ht}=_t;function Vt(e){const{newFiles:t,allowNewUpload:i,isUploadInProgress:s,isAllPaused:r,resumableUploads:n,error:o,hideUploadButton:a,hidePauseResumeButton:l,hideCancelButton:u,hideRetryButton:d,recoveredState:h,uploadState:p,totalProgress:c,files:f,supportsUploadProgress:m,hideAfterFinish:g,isSomeGhost:y,doneButtonHandler:v,isUploadStarted:b,i18n:w,startUpload:_,uppy:F,isAllComplete:P,showProgressDetails:S,numUploads:C,complete:k,totalSize:T,totalETA:O,totalUploadedSize:E}=e,A=function(){switch(p){case qt:case jt:{const e=Pt(f);return"determinate"===e.mode?100*e.value:c}case Lt:return null;case $t:return m?c:null;default:return c}}(),x=function(){if(h)return!1;switch(p){case zt:return a||0===t;case Ht:return g;default:return!1}}(),D=null!=A?A:100,N=!o&&t&&!s&&!r&&i&&!a,U=!u&&p!==zt&&p!==Ht,I=n&&!l&&p===$t,B=o&&!P&&!d,R=v&&p===Ht,M=Ft("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(p){case qt:case jt:{const{mode:e}=Pt(f);return"indeterminate"===e}case $t:return!m;default:return!1}}()});return Le("div",{className:Ft("uppy-StatusBar",`is-${p}`,{"has-ghosts":y}),"aria-hidden":x},Le("div",{className:M,style:{width:`${D}%`},role:"progressbar","aria-label":`${D}%`,"aria-valuetext":`${D}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":A}),(()=>{switch(p){case jt:case qt:return Le(Dt,{progress:Pt(f)});case Ht:return Le(Rt,{i18n:w});case Lt:return Le(Mt,{error:o,i18n:w,numUploads:C,complete:k});case $t:return Le(Bt,{i18n:w,supportsUploadProgress:m,totalProgress:c,showProgressDetails:S,isUploadStarted:b,isAllComplete:P,isAllPaused:r,newFiles:t,numUploads:C,complete:k,totalUploadedSize:E,totalSize:T,totalETA:O,startUpload:_});default:return null}})(),Le("div",{className:"uppy-StatusBar-actions"},h||N?Le(kt,{newFiles:t,isUploadStarted:b,recoveredState:h,i18n:w,isSomeGhost:y,startUpload:_,uploadState:p}):null,B?Le(Tt,{i18n:w,uppy:F}):null,I?Le(Et,{isAllPaused:r,i18n:w,isAllComplete:P,resumableUploads:n,uppy:F}):null,U?Le(Ot,{i18n:w,uppy:F}):null,R?Le(At,{i18n:w,doneButtonHandler:v}):null))}Vt.defaultProps={doneButtonHandler:void 0,hideAfterFinish:!1,hideCancelButton:!1,hidePauseResumeButton:!1,hideRetryButton:!1,hideUploadButton:void 0,showProgressDetails:void 0};const Wt={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Gt(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Kt=0;function Xt(e){return"__private_"+Kt+++"_"+e}function Yt(e,t,i,s){if(e)return _t.STATE_ERROR;if(t)return _t.STATE_COMPLETE;if(i)return _t.STATE_WAITING;let r=_t.STATE_WAITING;const n=Object.keys(s);for(let e=0;e<n.length;e++){const{progress:t}=s[n[e]];if(t.uploadStarted&&!t.uploadComplete)return _t.STATE_UPLOADING;t.preprocess&&(r=_t.STATE_PREPROCESSING),t.postprocess&&r!==_t.STATE_PREPROCESSING&&(r=_t.STATE_POSTPROCESSING)}return r}const Qt={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};var Jt=Xt("lastUpdateTime"),Zt=Xt("previousUploadedBytes"),ei=Xt("previousSpeed"),ti=Xt("previousETA"),ii=Xt("computeSmoothETA"),si=Xt("onUploadStart");class ri extends bt{constructor(e,t){super(e,{...Qt,...t}),Object.defineProperty(this,ii,{value:ni}),Object.defineProperty(this,Jt,{writable:!0,value:void 0}),Object.defineProperty(this,Zt,{writable:!0,value:void 0}),Object.defineProperty(this,ei,{writable:!0,value:void 0}),Object.defineProperty(this,ti,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch((()=>{})),Object.defineProperty(this,si,{writable:!0,value:()=>{const{recoveredState:e}=this.uppy.getState();if(Gt(this,ei)[ei]=null,Gt(this,ti)[ti]=null,e)return Gt(this,Zt)[Zt]=Object.values(e.files).reduce(((e,t)=>{let{progress:i}=t;return e+i.bytesUploaded}),0),void this.uppy.emit("restore-confirmed");Gt(this,Jt)[Jt]=performance.now(),Gt(this,Zt)[Zt]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Wt,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:i,allowNewUpload:s,totalProgress:r,error:n,recoveredState:o}=e,{newFiles:a,startedFiles:l,completeFiles:u,isUploadStarted:d,isAllComplete:h,isAllErrored:p,isAllPaused:c,isUploadInProgress:f,isSomeGhost:m}=this.uppy.getObjectOfFilesPerState(),g=o?Object.values(i):a,y=!!t.resumableUploads,v=!1!==t.uploadProgress;let b=0,w=0;l.forEach((e=>{b+=e.progress.bytesTotal||0,w+=e.progress.bytesUploaded||0}));const _=Gt(this,ii)[ii]({uploaded:w,total:b,remaining:b-w});return Vt({error:n,uploadState:Yt(n,h,o,e.files||{}),allowNewUpload:s,totalProgress:r,totalSize:b,totalUploadedSize:w,isAllComplete:!1,isAllPaused:c,isAllErrored:p,isUploadStarted:d,isUploadInProgress:f,isSomeGhost:m,recoveredState:o,complete:u.length,newFiles:g.length,numUploads:l.length,totalETA:_,files:i,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:y,supportsUploadProgress:v,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})}onMount(){const e=this.el;pt(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Gt(this,si)[si]),Gt(this,Jt)[Jt]=performance.now(),Gt(this,Zt)[Zt]=this.uppy.getFiles().reduce(((e,t)=>e+t.progress.bytesUploaded),0)}uninstall(){this.unmount(),this.uppy.off("upload",Gt(this,si)[si])}}function ni(e){var t;if(0===e.total||0===e.remaining)return 0;null!=(t=Gt(this,Jt))[Jt]||(t[Jt]=performance.now());const i=performance.now()-Gt(this,Jt)[Jt];var s;if(0===i)return Math.round((null!=(s=Gt(this,ti)[ti])?s:0)/100)/10;const r=e.uploaded-Gt(this,Zt)[Zt];var n;if(Gt(this,Zt)[Zt]=e.uploaded,r<=0)return Math.round((null!=(n=Gt(this,ti)[ti])?n:0)/100)/10;const o=r/i,a=null==Gt(this,ei)[ei]?o:wt(o,Gt(this,ei)[ei],2e3,i);Gt(this,ei)[ei]=a;const l=e.remaining/a,u=Math.max(Gt(this,ti)[ti]-i,0),d=null==Gt(this,ti)[ti]?l:wt(l,u,2e3,i);return Gt(this,ti)[ti]=d,Gt(this,Jt)[Jt]=performance.now(),Math.round(d/100)/10}ri.VERSION="3.3.0";class oi extends $e{constructor(){super(...arguments),this.ref={current:null}}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,300)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,300)}render(){const{children:e}=this.props;return Le("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}function ai(e){const t={};for(let n=0;n<e.length;n++)null!=e[n]&&(t[(i=e[n],s=n.toString(36),void 0,null!=(r=null==i?void 0:i.key)?r:s)]=e[n]);var i,s,r;return t}function li(e,t){e=e||{},t=t||{};const i=i=>t.hasOwnProperty(i)?t[i]:e[i],s={};let r=[];for(const i in e)t.hasOwnProperty(i)?r.length&&(s[i]=r,r=[]):r.push(i);const n={};for(const e in t){if(s.hasOwnProperty(e))for(let t=0;t<s[e].length;t++){const r=s[e][t];n[s[e][t]]=i(r)}n[e]=i(e)}for(let e=0;e<r.length;e++)n[r[e]]=i(r[e]);return n}class ui extends $e{constructor(e,t){super(e,t),this.refs={},this.state={children:ai(Qe(Qe(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(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){const t=ai(Qe(e.children)||[]),i=this.state.children;let s;for(s in this.setState((e=>({children:li(e.children,t)}))),t)if(t.hasOwnProperty(s)){const e=i&&i.hasOwnProperty(s);t[s]&&e&&this.currentlyTransitioningKeys[s]?(this.keysToEnter.push(s),this.keysToAbortLeave.push(s)):!t[s]||e||this.currentlyTransitioningKeys[s]||this.keysToEnter.push(s)}for(s in i)if(i.hasOwnProperty(s)){const e=t&&t.hasOwnProperty(s);!i[s]||e||this.currentlyTransitioningKeys[s]||this.keysToLeave.push(s)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){const t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];null!=t&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];null!=t&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const i=ai(Qe(this.props.children)||[]);i&&i.hasOwnProperty(e)||this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];null!=t&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];null!=t&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const i=ai(Qe(this.props.children)||[]);i&&i.hasOwnProperty(e)||this.performLeave(e)}performLeave(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];null!=t&&t.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;const t=this.refs[e];null!=t&&t.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const i=ai(Qe(this.props.children)||[]);if(i&&i.hasOwnProperty(e))this.performEnter(e);else{const t=(s={},r=this.state.children,Object.assign(s,r));delete t[e],this.setState({children:t})}var s,r}render(e,t){let{childFactory:i,transitionLeave:s,transitionName:r,transitionAppear:n,transitionEnter:o,transitionLeaveTimeout:a,transitionEnterTimeout:l,transitionAppearTimeout:u,component:d,...h}=e,{children:p}=t;const c=Object.entries(p).map((e=>{let[t,s]=e;if(!s)return;const r=function(e,t){const i=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return i[t]||(i[t]=i=>{e.refs[t]=i})}(this,t);return dt(i(s),{ref:r,key:t})})).filter(Boolean);return Le(d,h,c)}}ui.defaultProps={component:"span",childFactory:e=>e};const di=ui;class hi extends bt{constructor(e,t){super(e,t),this.render=e=>Le("div",{className:"uppy uppy-Informer"},Le(di,null,e.info.map((e=>Le(oi,{key:e.message},Le("p",{role:"alert"},e.message," ",e.details&&Le("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message} \n\n ${e.details}`)},"?"))))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){const{target:e}=this.opts;e&&this.mount(e,this)}}hi.VERSION="3.1.0";const pi=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function ci(e){return e.startsWith("blob:")}function fi(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)}function mi(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var gi="undefined"!=typeof self?self:global;const yi="undefined"!=typeof navigator,vi=yi&&"undefined"==typeof HTMLImageElement,bi=!("undefined"==typeof global||"undefined"==typeof process||!process.versions||!process.versions.node),wi=gi.Buffer,_i=!!wi,Fi=e=>void 0!==e;function Pi(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(Fi).length)}function Si(e){let t=new Error(e);throw delete t.stack,t}function Ci(e){let t=function(e){let t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}const ki=e=>String.fromCharCode.apply(null,e),Ti="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class Oi{static from(e,t){return e instanceof this&&e.le===t?e:new Oi(e,void 0,void 0,t)}constructor(e,t=0,i,s){if("boolean"==typeof s&&(this.le=s),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===i&&(i=e.byteLength-t);let s=new DataView(e,t,i);this._swapDataView(s)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof Oi){void 0===i&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&Si("Creating view outside of available memory in ArrayBuffer");let s=new DataView(e.buffer,t,i);this._swapDataView(s)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else Si("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=Oi){return e instanceof DataView||e instanceof Oi?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||Si("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 Oi(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 i=this.getUint8Array(e,t),Ti?Ti.decode(i):_i?Buffer.from(i).toString("utf8"):decodeURIComponent(escape(ki(i)));var i}getLatin1String(e=0,t=this.byteLength){let i=this.getUint8Array(e,t);return ki(i)}getUnicodeString(e=0,t=this.byteLength){const i=[];for(let s=0;s<t&&e+s<this.byteLength;s+=2)i.push(this.getUint16(e+s));return ki(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 Ei(e,t){Si(`${e} '${t}' was not loaded, try using full build of exifr.`)}class Ai extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||Ei(this.kind,e),t&&(e in t||function(e,t){Si(`Unknown ${e} '${t}'.`)}(this.kind,e),t[e].enabled||Ei(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var xi=new Ai("file parser"),Di=new Ai("segment parser"),Ni=new Ai("file reader");let Ui=gi.fetch;function Ii(e,t){return(i=e).startsWith("data:")||i.length>1e4?Ri(e,t,"base64"):bi&&e.includes("://")?Bi(e,t,"url",Mi):bi?Ri(e,t,"fs"):yi?Bi(e,t,"url",Mi):void Si("Invalid input argument");var i}async function Bi(e,t,i,s){return Ni.has(i)?Ri(e,t,i):s?async function(e,t){let i=await t(e);return new Oi(i)}(e,s):void Si(`Parser ${i} is not loaded`)}async function Ri(e,t,i){let s=new(Ni.get(i))(e,t);return await s.read(),s}const Mi=e=>Ui(e).then((e=>e.arrayBuffer())),Li=e=>new Promise(((t,i)=>{let s=new FileReader;s.onloadend=()=>t(s.result||new ArrayBuffer),s.onerror=i,s.readAsArrayBuffer(e)}));class zi extends Map{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 ji(e,t,i){let s=new zi;for(let[e,t]of i)s.set(e,t);if(Array.isArray(t))for(let i of t)e.set(i,s);else e.set(t,s);return s}function $i(e,t,i){let s,r=e.get(t);for(s of i)r.set(s[0],s[1])}const qi=new Map,Hi=new Map,Vi=new Map,Wi=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Gi=["jfif","xmp","icc","iptc","ihdr"],Ki=["tiff",...Gi],Xi=["ifd0","ifd1","exif","gps","interop"],Yi=[...Ki,...Xi],Qi=["makerNote","userComment"],Ji=["translateKeys","translateValues","reviveValues","multiSegment"],Zi=[...Ji,"sanitize","mergeOutput","silentErrors"];class es{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class ts extends es{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,s){if(super(),mi(this,"enabled",!1),mi(this,"skip",new Set),mi(this,"pick",new Set),mi(this,"deps",new Set),mi(this,"translateKeys",!1),mi(this,"translateValues",!1),mi(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=Xi.includes(e),this.canBeFiltered&&(this.dict=qi.get(e)),void 0!==i)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if("object"==typeof i){if(this.enabled=!0,this.parse=!1!==i.parse,this.canBeFiltered){let{pick:e,skip:t}=i;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(i)}else!0===i||!1===i?this.parse=this.enabled=i:Si(`Invalid options argument: ${i}`)}applyInheritables(e){let t,i;for(t of Ji)i=e[t],void 0!==i&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,s,{tagKeys:r,tagValues:n}=this.dict;for(i of e)"string"==typeof i?(s=n.indexOf(i),-1===s&&(s=r.indexOf(Number(i))),-1!==s&&t.add(Number(r[s]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,as(this.pick,this.deps)):this.enabled&&this.pick.size>0&&as(this.pick,this.deps)}}var is={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},ss=new Map;class rs extends es{static useCached(e){let t=ss.get(e);return void 0!==t||(t=new this(e),ss.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):Si(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=yi?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Wi)this[e]=is[e];for(e of Zi)this[e]=is[e];for(e of Qi)this[e]=is[e];for(e of Yi)this[e]=new ts(e,is[e],void 0,this)}setupFromTrue(){let e;for(e of Wi)this[e]=is[e];for(e of Zi)this[e]=is[e];for(e of Qi)this[e]=!0;for(e of Yi)this[e]=new ts(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Wi)this[t]=is[t];for(t of Zi)this[t]=is[t];for(t of Qi)this[t]=is[t];for(t of Yi)this[t]=new ts(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Xi)}setupFromObject(e){let t;for(t of(Xi.ifd0=Xi.ifd0||Xi.image,Xi.ifd1=Xi.ifd1||Xi.thumbnail,Object.assign(this,e),Wi))this[t]=os(e[t],is[t]);for(t of Zi)this[t]=os(e[t],is[t]);for(t of Qi)this[t]=os(e[t],is[t]);for(t of Ki)this[t]=new ts(t,is[t],e[t],this);for(t of Xi)this[t]=new ts(t,is[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Xi,Yi),!0===e.tiff?this.batchEnableWithBool(Xi,!0):!1===e.tiff?this.batchEnableWithUserValue(Xi,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Xi):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Xi)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let e=t[i];this[i].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,i,s=i){if(e&&e.length){for(let e of s)this[e].enabled=!1;let t=ns(e,i);for(let[e,i]of t)as(this[e].pick,i),this[e].enabled=!0}else if(t&&t.length){let e=ns(t,i);for(let[t,i]of e)as(this[t].skip,i)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,iptc:s,icc:r}=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),r.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=Xi.some((e=>!0===this[e].enabled))||this.makerNote||this.userComment;for(let e of Xi)this[e].finalizeFilters()}get onlyTiff(){return!Gi.map((e=>this[e].enabled)).some((e=>!0===e))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of Ki)this[e].enabled&&!Di.has(e)&&Ei("segment parser",e)}}function ns(e,t){let i,s,r,n,o=[];for(r of t){for(n of(i=qi.get(r),s=[],i))(e.includes(n[0])||e.includes(n[1]))&&s.push(n[0]);s.length&&o.push([r,s])}return o}function os(e,t){return void 0!==e?e:void 0!==t?t:void 0}function as(e,t){for(let i of t)e.add(i)}mi(rs,"default",is);class ls{constructor(e){mi(this,"parsers",{}),mi(this,"output",{}),mi(this,"errors",[]),mi(this,"pushToErrors",(e=>this.errors.push(e))),this.options=rs.useCached(e)}async read(e){this.file=await function(e,t){return"string"==typeof e?Ii(e,t):yi&&!vi&&e instanceof HTMLImageElement?Ii(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new Oi(e):yi&&e instanceof Blob?Bi(e,t,"blob",Li):void Si("Invalid input argument")}(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,s]of xi)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(),Si("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),Pi(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 t=>{let i=await t.parse();t.assignToOutput(e,i)}));this.options.silentErrors&&(t=t.map((e=>e.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,i=Di.get("tiff",e);var s;if(t.tiff?s={start:0,type:"tiff"}:t.jpeg&&(s=await this.fileParser.getOrFindSegment("tiff")),void 0===s)return;let r=await this.fileParser.ensureSegmentChunk(s),n=this.parsers.tiff=new i(r,e,t),o=await n.extractThumbnail();return t.close&&t.close(),o}}async function us(e,t){let i=new ls(t);return await i.read(e),i.parse()}var ds=Object.freeze({__proto__:null,parse:us,Exifr:ls,fileParsers:xi,segmentParsers:Di,fileReaders:Ni,tagKeys:qi,tagValues:Hi,tagRevivers:Vi,createDictionary:ji,extendDictionary:$i,fetchUrlAsArrayBuffer:Mi,readBlobAsArrayBuffer:Li,chunkedProps:Wi,otherSegments:Gi,segments:Ki,tiffBlocks:Xi,segmentsAndBlocks:Yi,tiffExtractables:Qi,inheritables:Ji,allFormatters:Zi,Options:rs});class hs{static findPosition(e,t){let i=e.getUint16(t+2)+2,s="function"==typeof this.headerLength?this.headerLength(e,t,i):this.headerLength,r=t+s,n=i-s;return{offset:t,length:i,headerLength:s,start:r,size:n,end:r+n}}static parse(e,t={}){return new this(e,new rs({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Oi?e:new Oi(e)}constructor(e,t={},i){mi(this,"errors",[]),mi(this,"raw",new Map),mi(this,"handleError",(e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.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=Vi.get(t),s=Hi.get(t),r=qi.get(t),n=this.options[t],o=n.reviveValues&&!!i,a=n.translateValues&&!!s,l=n.translateKeys&&!!r,u={};for(let[t,n]of e)o&&i.has(t)?n=i.get(t)(n):a&&s.has(t)&&(n=this.translateValue(n,s.get(t))),l&&r.has(t)&&(t=r.get(t)||t),u[t]=n;return u}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}}function ps(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function cs(e){return e>=224&&e<=239}function fs(e,t,i){for(let[s,r]of Di)if(r.canHandle(e,t,i))return s}mi(hs,"headerLength",4),mi(hs,"type",void 0),mi(hs,"multiSegment",!1),mi(hs,"canHandle",(()=>!1));class ms extends class{constructor(e,t,i){mi(this,"errors",[]),mi(this,"ensureSegmentChunk",(async e=>{let t=e.start,i=e.size||65536;if(this.file.chunked)if(this.file.available(t,i))e.chunk=this.file.subarray(t,i);else try{e.chunk=await this.file.readChunk(t,i)}catch(t){Si(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}else this.file.byteLength>t+i?e.chunk=this.file.subarray(t,i):void 0===e.size?e.chunk=this.file.subarray(t):Si("Segment unreachable: "+JSON.stringify(e));return e.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(Di.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:e,chunk:i}=t,s=this.options[e];if(s&&s.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,i)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),mi(this,"appSegments",[]),mi(this,"jpegSegments",[]),mi(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(Di.keyList())):(e=void 0===e?Di.keyList().filter((e=>this.options[e].enabled)):e.filter((e=>this.options[e].enabled&&Di.has(e))),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:r,remaining:n}=this;if(!s&&this.file.chunked&&(s=Array.from(r).some((e=>{let t=Di.get(e),i=this.options[e];return t.multiSegment&&i.multiSegment})),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let t=!1;for(;n.size>0&&!t&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:s}=i,r=this.appSegments.some((e=>!this.file.available(e.offset||e.start,e.length||e.size)));if(t=e>s&&!r?!await i.readNextChunk(e):!await i.readNextChunk(s),void 0===(e=this.findAppSegmentsInRange(e,i.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let i,s,r,n,o,a,{file:l,findAll:u,wanted:d,remaining:h,options:p}=this;for(;e<t;e++)if(255===l.getUint8(e))if(i=l.getUint8(e+1),cs(i)){if(s=l.getUint16(e+2),r=fs(l,e,s),r&&d.has(r)&&(n=Di.get(r),o=n.findPosition(l,e),a=p[r],o.type=r,this.appSegments.push(o),!u&&(n.multiSegment&&a.multiSegment?(this.unfinishedMultiSegment=o.chunkNumber<o.chunkCount,this.unfinishedMultiSegment||h.delete(r)):h.delete(r),0===h.size)))break;p.recordUnknownSegments&&(o=hs.findPosition(l,e),o.marker=i,this.unknownSegments.push(o)),e+=s+1}else if(ps(i)){if(s=l.getUint16(e+2),218===i&&!1!==p.stopAfterSos)return;p.recordJpegSegments&&this.jpegSegments.push({offset:e,length:s,marker:i}),e+=s+1}return e}mergeMultiSegments(){if(!this.appSegments.some((e=>e.multiSegment)))return;let e=function(e,t){let i,s,r,n=new Map;for(let t=0;t<e.length;t++)i=e[t],s=i.type,n.has(s)?r=n.get(s):n.set(s,r=[]),r.push(i);return Array.from(n)}(this.appSegments);this.mergedAppSegments=e.map((([e,t])=>{let i=Di.get(e,this.options);return i.handleMultiSegments?{type:e,chunk:i.handleMultiSegments(t)}:t[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}mi(ms,"type","jpeg"),xi.set("jpeg",ms);const gs=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class ys extends hs{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,i=new Map){let{pick:s,skip:r}=this.options[t];s=new Set(s);let n=s.size>0,o=0===r.size,a=this.chunk.getUint16(e);e+=2;for(let l=0;l<a;l++){let a=this.chunk.getUint16(e);if(n){if(s.has(a)&&(i.set(a,this.parseTag(e,a,t)),s.delete(a),0===s.size))break}else!o&&r.has(a)||i.set(a,this.parseTag(e,a,t));e+=12}return i}parseTag(e,t,i){let{chunk:s}=this,r=s.getUint16(e+2),n=s.getUint32(e+4),o=gs[r];if(o*n<=4?e+=8:e=s.getUint32(e+8),(r<1||r>13)&&Si(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${r}, offset ${e}`),e>s.byteLength&&Si(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${r}, offset ${e} is outside of chunk size ${s.byteLength}`),1===r)return s.getUint8Array(e,n);if(2===r)return""===(a=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(a=s.getString(e,n)).trim())?void 0:a;var a;if(7===r)return s.getUint8Array(e,n);if(1===n)return this.parseTagValue(r,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(r))(n),i=o;for(let s=0;s<n;s++)t[s]=this.parseTagValue(r,e),e+=i;return t}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:case 13: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);default:Si(`Invalid tiff type ${e}`)}}}class vs extends ys{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}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 void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){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&&Si("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&Si(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Ci(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(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)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset)return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,Ci(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&&1===i.length&&e.set(t,i[0])}async parseGpsBlock(){if(this.gps)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset)return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",bs(...e.get(2),e.get(1))),e.set("longitude",bs(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))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),void 0===this.ifd1)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 Xi)if(e=this[t],!Pi(e))if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)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 bs(e,t,i,s){var r=e+t/60+i/3600;return"S"!==s&&"W"!==s||(r*=-1),r}mi(vs,"type","tiff"),mi(vs,"headerLength",10),Di.set("tiff",vs),Object.freeze({__proto__:null,default:ds,Exifr:ls,fileParsers:xi,segmentParsers:Di,fileReaders:Ni,tagKeys:qi,tagValues:Hi,tagRevivers:Vi,createDictionary:ji,extendDictionary:$i,fetchUrlAsArrayBuffer:Mi,readBlobAsArrayBuffer:Li,chunkedProps:Wi,otherSegments:Gi,segments:Ki,tiffBlocks:Xi,segmentsAndBlocks:Yi,tiffExtractables:Qi,inheritables:Ji,allFormatters:Zi,Options:rs,parse:us});const ws={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},ws,{firstChunkSize:4e4,gps:[1,2,3,4]}),Object.assign({},ws,{tiff:!1,ifd1:!0,mergeOutput:!1});const _s=Object.assign({},ws,{firstChunkSize:4e4,ifd0:[274]}),Fs=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}});let Ps=!0,Ss=!0;if("object"==typeof navigator){let e=navigator.userAgent;if(e.includes("iPad")||e.includes("iPhone")){let t=e.match(/OS (\d+)_(\d+)/);if(t){let[,e,i]=t,s=Number(e)+.1*Number(i);Ps=s<13.4,Ss=!1}}else if(e.includes("OS X 10")){let[,t]=e.match(/OS X 10[_.](\d+)/);Ps=Ss=Number(t)<15}if(e.includes("Chrome/")){let[,t]=e.match(/Chrome\/(\d+)/);Ps=Ss=Number(t)<81}else if(e.includes("Firefox/")){let[,t]=e.match(/Firefox\/(\d+)/);Ps=Ss=Number(t)<77}}class Cs extends Oi{constructor(...e){super(...e),mi(this,"ranges",new ks),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(0===e&&0===this.byteLength&&i){let e=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(e)}else{let i=e+t;if(i>this.byteLength){let{dataView:e}=this._extend(i);this._swapDataView(e)}}}_extend(e){let t;t=_i?wi.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)}}class ks{constructor(){mi(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let s=e+t,r=this.list.filter((t=>Ts(e,t.offset,s)||Ts(e,t.end,s)));if(r.length>0){e=Math.min(e,...r.map((e=>e.offset))),s=Math.max(s,...r.map((e=>e.end))),t=s-e;let i=r.shift();i.offset=e,i.length=t,i.end=s,this.list=this.list.filter((e=>!r.includes(e)))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let i=e+t;return this.list.some((t=>t.offset<=e&&i<=t.end))}}function Ts(e,t,i){return e<=t&&t<=i}class Os extends Cs{constructor(e,t){super(0),mi(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++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}Ni.set("blob",class extends Os{async readWhole(){this.chunked=!1;let e=await Li(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let i=t?e+t:void 0,s=this.input.slice(e,i),r=await Li(s);return this.set(r,e,!0)}});const Es={strings:{generatingThumbnails:"Generating thumbnails..."}};class As extends bt{constructor(e,t){if(super(e,t),this.onFileAdded=e=>{!e.preview&&e.data&&fi(e.type)&&!e.isRemote&&this.addToQueue(e.id)},this.onCancelRequest=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1)},this.onFileRemoved=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1),e.preview&&ci(e.preview)&&URL.revokeObjectURL(e.preview)},this.onRestored=()=>{this.uppy.getFiles().filter((e=>e.isRestored)).forEach((e=>{e.preview&&!ci(e.preview)||this.addToQueue(e.id)}))},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=e=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})}));const t=()=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)}))};return new Promise((e=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",(()=>{t(),e()})):(t(),e())}))},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||"image/jpeg",this.defaultLocale=Es,this.opts={thumbnailWidth:null,thumbnailHeight:null,waitForThumbnailsBeforeUpload:!1,lazy:!1,...t},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){const s=URL.createObjectURL(e.data),r=new Promise(((e,t)=>{const i=new Image;i.src=s,i.addEventListener("load",(()=>{URL.revokeObjectURL(s),e(i)})),i.addEventListener("error",(e=>{URL.revokeObjectURL(s),t(e.error||new Error("Could not create thumbnail"))}))})),n=async function(e){let t=await async function(e){let t=new ls(_s);await t.read(e);let i=await t.parse();if(i&&i.ifd0)return i.ifd0[274]}(e);return Object.assign({canvas:Ps,css:Ss},Fs[t])}(e.data).catch((()=>1));return Promise.all([r,n]).then((e=>{let[s,r]=e;const n=this.getProportionalDimensions(s,t,i,r.deg),o=function(e,t){let i=e.width,s=e.height;90!==t.deg&&270!==t.deg||(i=e.height,s=e.width);const r=document.createElement("canvas");r.width=i,r.height=s;const n=r.getContext("2d");return n.translate(i/2,s/2),t.canvas&&(n.rotate(t.rad),n.scale(t.scaleX,t.scaleY)),n.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),r}(s,r);return function(e,t,i){try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise((s=>{e.toBlob(s,t,i)})).then((e=>{if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e})):Promise.resolve().then((()=>function(e,t,i){var s,r;const n=pi.exec(e),o=null!=(s=null!=(r=t.mimeType)?r:null==n?void 0:n[1])?s:"plain/text";let a;if(null!=(null==n?void 0:n[2])){const e=atob(decodeURIComponent(n[3])),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);a=[t]}else null!=(null==n?void 0:n[3])&&(a=[decodeURIComponent(n[3])]);return new Blob(a,{type:o})}(e.toDataURL(t,i),{}))).then((e=>{if(null===e)throw new Error("could not extract blob, probably an old browser");return e}))}(this.resizeImage(o,n.width,n.height),this.thumbnailType,80)})).then((e=>URL.createObjectURL(e)))}getProportionalDimensions(e,t,i,s){let r=e.width/e.height;return 90!==s&&270!==s||(r=e.height/e.width),null!=t?{width:t,height:Math.round(t/r)}:null!=i?{width:Math.round(i*r),height:i}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/r)}}resizeImage(e,t,i){let s=function(e){const t=e.width/e.height,i=5e6,s=4096;let r=Math.floor(Math.sqrt(i*t)),n=Math.floor(i/Math.sqrt(i*t));if(r>s&&(r=s,n=Math.round(r/t)),n>s&&(n=s,r=Math.round(t*n)),e.width>r){const t=document.createElement("canvas");return t.width=r,t.height=n,t.getContext("2d").drawImage(e,0,0,r,n),t}return e}(e),r=Math.ceil(Math.log2(s.width/t));r<1&&(r=1);let n=t*2**(r-1),o=i*2**(r-1);for(;r--;){const e=document.createElement("canvas");e.width=n,e.height=o,e.getContext("2d").drawImage(s,0,0,n,o),s=e,n=Math.round(n/2),o=Math.round(o/2)}return s}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){const 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 fi(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)}}function xs(e){if("string"==typeof e){const t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&ht(e)?[e]:null}As.VERSION="3.0.8";const Ds=Array.from;function Ns(e,t,i,s){let{onSuccess:r}=s;e.readEntries((s=>{const n=[...t,...s];s.length?queueMicrotask((()=>{Ns(e,n,i,{onSuccess:r})})):r(n)}),(e=>{i(e),r(t)}))}function Us(e,t){return null==e?e:{kind:e.isFile?"file":e.isDirectory?"directory":void 0,name:e.name,getFile:()=>new Promise(((t,i)=>e.file(t,i))),async*values(){const i=e.createReader(),s=await new Promise((e=>{Ns(i,[],t,{onSuccess:i=>e(i.map((e=>Us(e,t))))})}));yield*s},isSameEntry:void 0}}function Is(e,t,i){try{return void 0===i&&(i=void 0),async function*(){const s=()=>`${t}/${e.name}`;if("file"===e.kind){const r=await e.getFile();null!=r?(r.relativePath=t?s():null,yield r):null!=i&&(yield i)}else if("directory"===e.kind)for await(const i of e.values())yield*Is(i,t?s():e.name);else null!=i&&(yield i)}()}catch(e){return Promise.reject(e)}}var Bs=i(228);class Rs extends Error{constructor(e){super(e),this.name="TimeoutError"}}class Ms extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const Ls=e=>void 0===globalThis.DOMException?new Ms(e):new DOMException(e),zs=e=>{const t=void 0===e.reason?Ls("This operation was aborted."):e.reason;return t instanceof Error?t:Ls(t)};var js,$s=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};js=new WeakMap;const qs=class{constructor(){js.set(this,[])}enqueue(e,t){const i={priority:(t={priority:0,...t}).priority,run:e};if(this.size&&$s(this,js,"f")[this.size-1].priority>=t.priority)return void $s(this,js,"f").push(i);const s=function(e,t,i){let s=0,r=e.length;for(;r>0;){const n=Math.trunc(r/2);let o=s+n;i(e[o],t)<=0?(s=++o,r-=n+1):r=n}return s}($s(this,js,"f"),i,((e,t)=>t.priority-e.priority));$s(this,js,"f").splice(s,0,i)}dequeue(){const e=$s(this,js,"f").shift();return null==e?void 0:e.run}filter(e){return $s(this,js,"f").filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return $s(this,js,"f").length}};var Hs,Vs,Ws,Gs,Ks,Xs,Ys,Qs,Js,Zs,er,tr,ir,sr,rr,nr,or,ar,lr,ur,dr,hr,pr,cr,fr,mr,gr=function(e,t,i,s,r){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?r.call(e,i):r?r.value=i:t.set(e,i),i},yr=function(e,t,i,s){if("a"===i&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?s:"a"===i?s.call(e):s?s.value:t.get(e)};class vr extends Error{}Vs=new WeakMap,Ws=new WeakMap,Gs=new WeakMap,Ks=new WeakMap,Xs=new WeakMap,Ys=new WeakMap,Qs=new WeakMap,Js=new WeakMap,Zs=new WeakMap,er=new WeakMap,tr=new WeakMap,ir=new WeakMap,sr=new WeakMap,rr=new WeakMap,Hs=new WeakSet,nr=function(){return yr(this,Ws,"f")||yr(this,Gs,"f")<yr(this,Ks,"f")},or=function(){return yr(this,tr,"f")<yr(this,ir,"f")},ar=function(){var e;gr(this,tr,(e=yr(this,tr,"f"),--e),"f"),yr(this,Hs,"m",dr).call(this),this.emit("next")},lr=function(){yr(this,Hs,"m",pr).call(this),yr(this,Hs,"m",hr).call(this),gr(this,Js,void 0,"f")},ur=function(){const e=Date.now();if(void 0===yr(this,Qs,"f")){const t=yr(this,Ys,"f")-e;if(!(t<0))return void 0===yr(this,Js,"f")&&gr(this,Js,setTimeout((()=>{yr(this,Hs,"m",lr).call(this)}),t),"f"),!0;gr(this,Gs,yr(this,Vs,"f")?yr(this,tr,"f"):0,"f")}return!1},dr=function(){if(0===yr(this,Zs,"f").size)return yr(this,Qs,"f")&&clearInterval(yr(this,Qs,"f")),gr(this,Qs,void 0,"f"),this.emit("empty"),0===yr(this,tr,"f")&&this.emit("idle"),!1;if(!yr(this,sr,"f")){const e=!yr(this,Hs,"a",ur);if(yr(this,Hs,"a",nr)&&yr(this,Hs,"a",or)){const t=yr(this,Zs,"f").dequeue();return!!t&&(this.emit("active"),t(),e&&yr(this,Hs,"m",hr).call(this),!0)}}return!1},hr=function(){yr(this,Ws,"f")||void 0!==yr(this,Qs,"f")||(gr(this,Qs,setInterval((()=>{yr(this,Hs,"m",pr).call(this)}),yr(this,Xs,"f")),"f"),gr(this,Ys,Date.now()+yr(this,Xs,"f"),"f"))},pr=function(){0===yr(this,Gs,"f")&&0===yr(this,tr,"f")&&yr(this,Qs,"f")&&(clearInterval(yr(this,Qs,"f")),gr(this,Qs,void 0,"f")),gr(this,Gs,yr(this,Vs,"f")?yr(this,tr,"f"):0,"f"),yr(this,Hs,"m",cr).call(this)},cr=function(){for(;yr(this,Hs,"m",dr).call(this););},fr=async function(e){return new Promise(((t,i)=>{e.addEventListener("abort",(()=>{i(new vr("The task was aborted."))}),{once:!0})}))},mr=async function(e,t){return new Promise((i=>{const s=()=>{t&&!t()||(this.off(e,s),i())};this.on(e,s)}))};const br=class extends Bs{constructor(e){var t,i,s,r;if(super(),Hs.add(this),Vs.set(this,void 0),Ws.set(this,void 0),Gs.set(this,0),Ks.set(this,void 0),Xs.set(this,void 0),Ys.set(this,0),Qs.set(this,void 0),Js.set(this,void 0),Zs.set(this,void 0),er.set(this,void 0),tr.set(this,0),ir.set(this,void 0),sr.set(this,void 0),rr.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!("number"==typeof(e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:qs,...e}).intervalCap&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(i=null===(t=e.intervalCap)||void 0===t?void 0:t.toString())&&void 0!==i?i:""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${null!==(r=null===(s=e.interval)||void 0===s?void 0:s.toString())&&void 0!==r?r:""}\` (${typeof e.interval})`);gr(this,Vs,e.carryoverConcurrencyCount,"f"),gr(this,Ws,e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,"f"),gr(this,Ks,e.intervalCap,"f"),gr(this,Xs,e.interval,"f"),gr(this,Zs,new e.queueClass,"f"),gr(this,er,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,gr(this,rr,!0===e.throwOnTimeout,"f"),gr(this,sr,!1===e.autoStart,"f")}get concurrency(){return yr(this,ir,"f")}set concurrency(e){if(!("number"==typeof e&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);gr(this,ir,e,"f"),yr(this,Hs,"m",cr).call(this)}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:yr(this,rr,"f"),...t},new Promise(((i,s)=>{yr(this,Zs,"f").enqueue((async()=>{var r,n,o;gr(this,tr,(n=yr(this,tr,"f"),++n),"f"),gr(this,Gs,(o=yr(this,Gs,"f"),++o),"f");try{if(null===(r=t.signal)||void 0===r?void 0:r.aborted)throw new vr("The task was aborted.");let s=e({signal:t.signal});t.timeout&&(s=function(e,t,i,s){let r;const n=new Promise(((n,o)=>{if("number"!=typeof t||1!==Math.sign(t))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t!==Number.POSITIVE_INFINITY){if((s={customTimers:{setTimeout,clearTimeout},...s}).signal){const{signal:e}=s;e.aborted&&o(zs(e)),e.addEventListener("abort",(()=>{o(zs(e))}))}r=s.customTimers.setTimeout.call(void 0,(()=>{const s=i instanceof Error?i:new Rs(`Promise timed out after ${t} milliseconds`);"function"==typeof e.cancel&&e.cancel(),o(s)}),t),(async()=>{try{n(await e)}catch(e){o(e)}finally{s.customTimers.clearTimeout.call(void 0,r)}})()}else n(e)}));return n.clear=()=>{clearTimeout(r),r=void 0},n}(Promise.resolve(s),t.timeout)),t.signal&&(s=Promise.race([s,yr(this,Hs,"m",fr).call(this,t.signal)]));const n=await s;i(n),this.emit("completed",n)}catch(e){if(e instanceof Rs&&!t.throwOnTimeout)return void i();s(e),this.emit("error",e)}finally{yr(this,Hs,"m",ar).call(this)}}),t),this.emit("add"),yr(this,Hs,"m",dr).call(this)}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){return yr(this,sr,"f")?(gr(this,sr,!1,"f"),yr(this,Hs,"m",cr).call(this),this):this}pause(){gr(this,sr,!0,"f")}clear(){gr(this,Zs,new(yr(this,er,"f")),"f")}async onEmpty(){0!==yr(this,Zs,"f").size&&await yr(this,Hs,"m",mr).call(this,"empty")}async onSizeLessThan(e){yr(this,Zs,"f").size<e||await yr(this,Hs,"m",mr).call(this,"next",(()=>yr(this,Zs,"f").size<e))}async onIdle(){0===yr(this,tr,"f")&&0===yr(this,Zs,"f").size||await yr(this,Hs,"m",mr).call(this,"idle")}get size(){return yr(this,Zs,"f").size}sizeBy(e){return yr(this,Zs,"f").filter(e).length}get pending(){return yr(this,tr,"f")}get isPaused(){return yr(this,sr,"f")}};var wr,_r,Fr,Pr,Sr=0,Cr=[],kr=[],Tr=Te,Or=Tr.__b,Er=Tr.__r,Ar=Tr.diffed,xr=Tr.__c,Dr=Tr.unmount,Nr=Tr.__;function Ur(e,t){Tr.__h&&Tr.__h(_r,e,Sr||t),Sr=0;var i=_r.__H||(_r.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({__V:kr}),i.__[e]}function Ir(e){return Sr=1,function(e,t,i){var s=Ur(wr++,2);if(s.t=e,!s.__c&&(s.__=[Vr(void 0,t),function(e){var t=s.__N?s.__N[0]:s.__[0],i=s.t(t,e);t!==i&&(s.__N=[i,s.__[1]],s.__c.setState({}))}],s.__c=_r,!_r.u)){var r=function(e,t,i){if(!s.__c.__H)return!0;var r=s.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!n||n.call(this,e,t,i);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&s.__c.props===e)&&(!n||n.call(this,e,t,i))};_r.u=!0;var n=_r.shouldComponentUpdate,o=_r.componentWillUpdate;_r.componentWillUpdate=function(e,t,i){if(this.__e){var s=n;n=void 0,r(e,t,i),n=s}o&&o.call(this,e,t,i)},_r.shouldComponentUpdate=r}return s.__N||s.__}(Vr,e)}function Br(e,t){var i=Ur(wr++,3);!Tr.__s&&Hr(i.__H,t)&&(i.__=e,i.i=t,_r.__H.__h.push(i))}function Rr(e,t){var i=Ur(wr++,7);return Hr(i.__H,t)?(i.__V=e(),i.i=t,i.__h=e,i.__V):i.__}function Mr(e,t){return Sr=8,Rr((function(){return e}),t)}function Lr(){for(var e;e=Cr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach($r),e.__H.__h.forEach(qr),e.__H.__h=[]}catch(t){e.__H.__h=[],Tr.__e(t,e.__v)}}Tr.__b=function(e){_r=null,Or&&Or(e)},Tr.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Nr&&Nr(e,t)},Tr.__r=function(e){Er&&Er(e),wr=0;var t=(_r=e.__c).__H;t&&(Fr===_r?(t.__h=[],_r.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=kr,e.__N=e.i=void 0}))):(t.__h.forEach($r),t.__h.forEach(qr),t.__h=[],wr=0)),Fr=_r},Tr.diffed=function(e){Ar&&Ar(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Cr.push(t)&&Pr===Tr.requestAnimationFrame||((Pr=Tr.requestAnimationFrame)||jr)(Lr)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==kr&&(e.__=e.__V),e.i=void 0,e.__V=kr}))),Fr=_r=null},Tr.__c=function(e,t){t.some((function(e){try{e.__h.forEach($r),e.__h=e.__h.filter((function(e){return!e.__||qr(e)}))}catch(i){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Tr.__e(i,e.__v)}})),xr&&xr(e,t)},Tr.unmount=function(e){Dr&&Dr(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach((function(e){try{$r(e)}catch(e){t=e}})),i.__H=void 0,t&&Tr.__e(t,i.__v))};var zr="function"==typeof requestAnimationFrame;function jr(e){var t,i=function(){clearTimeout(s),zr&&cancelAnimationFrame(t),setTimeout(e)},s=setTimeout(i,100);zr&&(t=requestAnimationFrame(i))}function $r(e){var t=_r,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),_r=t}function qr(e){var t=_r;e.__c=e.__(),_r=t}function Hr(e,t){return!e||e.length!==t.length||t.some((function(t,i){return t!==e[i]}))}function Vr(e,t){return"function"==typeof t?t(e):t}function Wr(){return Le("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},Le("g",{fill:"none","fill-rule":"evenodd"},Le("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),Le("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"}),Le("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"}),Le("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"}),Le("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"}),Le("path",{d:"M4 4h18v18H4z"})))}function Gr(e){let{pluginName:t,i18n:i,onAuth:s}=e;const r="Google Drive"===t;return Le("form",{onSubmit:Mr((e=>{e.preventDefault(),s()}),[s])},r?Le("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},Le(Wr,null),i("signInWithGoogle")):Le("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},i("authenticateWith",{pluginName:t})))}const Kr=e=>{let{pluginName:t,i18n:i,onAuth:s}=e;return Le(Gr,{pluginName:t,i18n:i,onAuth:s})};function Xr(e){const{loading:t,pluginName:i,pluginIcon:s,i18n:r,handleAuth:n,renderForm:o=Kr}=e;return Le("div",{className:"uppy-Provider-auth"},Le("div",{className:"uppy-Provider-authIcon"},s()),Le("div",{className:"uppy-Provider-authTitle"},r("authenticateWithTitle",{pluginName:i})),Le("div",{className:"uppy-Provider-authForm"},o({pluginName:i,i18n:r,loading:t,onAuth:n})))}function Yr(e){let{i18n:t,logout:i,username:s}=e;return Le(je,null,Le("span",{className:"uppy-ProviderBrowser-user",key:"username"},s),Le("button",{type:"button",onClick:i,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},t("logOut")))}const Qr=e=>{const{getFolder:t,title:i,isLast:s}=e;return Le(je,null,Le("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:t},i),s?"":" / ")};function Jr(e){const{getFolder:t,title:i,breadcrumbsIcon:s,breadcrumbs:r}=e;return Le("div",{className:"uppy-Provider-breadcrumbs"},Le("div",{className:"uppy-Provider-breadcrumbsIcon"},s),r.map(((e,s)=>Le(Qr,{key:e.id,getFolder:()=>t(e.requestPath,e.name),title:0===s?i:e.name,isLast:s+1===r.length}))))}function Zr(e){return Le(je,null,e.showBreadcrumbs&&Le(Jr,{getFolder:e.getFolder,breadcrumbs:e.breadcrumbs,breadcrumbsIcon:e.pluginIcon&&e.pluginIcon(),title:e.title}),Le(Yr,{logout:e.logout,username:e.username,i18n:e.i18n}))}function en(e){return{...e,type:e.mimeType,extension:e.name?F(e.name).extension:null}}function tn(){return tn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},tn.apply(this,arguments)}const sn={position:"relative",width:"100%",minHeight:"100%"},rn={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},nn=class extends $e{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(){const{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:i,renderRow:s,overscanCount:r=10,...n}=e;const{offset:o,height:a}=this.state;let l=Math.floor(o/i),u=Math.floor(a/i);r&&(l=Math.max(0,l-l%r),u+=r);const d=l+u+4,h=t.slice(l,d),p={...sn,height:t.length*i},c={...rn,top:l*i};return Le("div",tn({onScroll:this.handleScroll},n),Le("div",{role:"presentation",style:p},Le("div",{role:"presentation",style:c},h.map(s))))}};function on(e){const{search:t,searchOnInput:i,searchTerm:s,showButton:r,inputLabel:n,clearSearchLabel:o,buttonLabel:a,clearSearch:l,inputClassName:u,buttonCSSClassName:d}=e,[h,c]=Ir(null!=s?s:""),f=Mr((e=>{e.preventDefault(),t(h)}),[t,h]),m=Mr((e=>{const s=e.target.value;c(s),i&&t(s)}),[c,i,t]),[g]=Ir((()=>{const e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=p(),e}));return Br((()=>(document.body.appendChild(g),g.addEventListener("submit",f),()=>{g.removeEventListener("submit",f),document.body.removeChild(g)})),[g,f]),Le(je,null,Le("input",{className:`uppy-u-reset ${u}`,type:"search","aria-label":n,placeholder:n,value:h,onInput:m,form:g.id,"data-uppy-super-focusable":!0}),!r&&Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},Le("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"})),!r&&h&&Le("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":o,title:o,onClick:()=>{c(""),l&&l()}},Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},Le("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),r&&Le("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:g.id},a))}function an(e){let{cancel:t,done:i,i18n:s,selected:r}=e;return Le("div",{className:"uppy-ProviderBrowser-footer"},Le("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary",onClick:i,type:"button"},s("selectX",{smart_count:r})),Le("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:t,type:"button"},s("cancel")))}function ln(){return Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},Le("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function un(){return Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},Le("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function dn(){return Le("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},Le("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"}),Le("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"}))}function hn(e){const{itemIconString:t}=e;if(null===t)return null;switch(t){case"file":return Le(ln,null);case"folder":return Le(un,null);case"video":return Le(dn,null);default:{const{alt:i}=e;return Le("img",{src:t,alt:i,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}}const pn=function(e){const{className:t,isDisabled:i,restrictionError:s,isChecked:r,title:n,itemIconEl:o,showTitles:a,toggleCheckbox:l,recordShiftKeyPress:u,id:d,children:h}=e,p=Ft("uppy-u-reset","uppy-ProviderBrowserItem-checkbox","uppy-ProviderBrowserItem-checkbox--grid",{"uppy-ProviderBrowserItem-checkbox--is-checked":r});return Le("li",{className:t,title:i?null==s?void 0:s.message:void 0},Le("input",{type:"checkbox",className:p,onChange:l,onKeyDown:u,onMouseDown:u,name:"listitem",id:d,checked:r,disabled:i,"data-uppy-super-focusable":!0}),Le("label",{htmlFor:d,"aria-label":n,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},o,a&&n,h))};function cn(e){const{className:t,isDisabled:i,restrictionError:s,isCheckboxDisabled:r,isChecked:n,toggleCheckbox:o,recordShiftKeyPress:a,type:l,id:u,itemIconEl:d,title:h,handleFolderClick:p,showTitles:c,i18n:f}=e;return Le("li",{className:t,title:i?null==s?void 0:s.message:void 0},r?null:Le("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox "+(n?"uppy-ProviderBrowserItem-checkbox--is-checked":""),onChange:o,onKeyDown:a,onMouseDown:a,name:"listitem",id:u,checked:n,"aria-label":"file"===l?null:f("allFilesFromFolderNamed",{name:h}),disabled:i,"data-uppy-super-focusable":!0}),"file"===l?Le("label",{htmlFor:u,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},Le("div",{className:"uppy-ProviderBrowserItem-iconWrap"},d),c&&h):Le("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:p,"aria-label":f("openFolderNamed",{name:h})},Le("div",{className:"uppy-ProviderBrowserItem-iconWrap"},d),c&&Le("span",null,h)))}function fn(){return fn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},fn.apply(this,arguments)}function mn(e){const{author:t,getItemIcon:i,isChecked:s,isDisabled:r,viewType:n}=e,o=i(),a=Ft("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--selected":s},{"uppy-ProviderBrowserItem--disabled":r},{"uppy-ProviderBrowserItem--noPreview":"video"===o}),l=Le(hn,{itemIconString:o});switch(n){case"grid":return Le(pn,fn({},e,{className:a,itemIconEl:l}));case"list":return Le(cn,fn({},e,{className:a,itemIconEl:l}));case"unsplash":return Le(pn,fn({},e,{className:a,itemIconEl:l}),Le("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},t.name));default:throw new Error(`There is no such type ${n}`)}}function gn(e){const{currentSelection:t,uppyFiles:i,viewType:s,isChecked:r,toggleCheckbox:n,recordShiftKeyPress:o,showTitles:a,i18n:l,validateRestrictions:u,getNextFolder:d,f:h}=e;if(h.isFolder)return mn({showTitles:a,viewType:s,i18n:l,id:h.id,title:h.name,getItemIcon:()=>h.icon,isChecked:r(h),toggleCheckbox:e=>n(e,h),recordShiftKeyPress:o,type:"folder",isDisabled:!1,isCheckboxDisabled:"shared-with-me"===h.id,handleFolderClick:()=>d(h)});const p=u(en(h),[...i,...t]);return mn({id:h.id,title:h.name,author:h.author,getItemIcon:()=>h.icon,isChecked:r(h),toggleCheckbox:e=>n(e,h),isCheckboxDisabled:!1,recordShiftKeyPress:o,showTitles:a,viewType:s,i18n:l,type:"file",isDisabled:Boolean(p)&&!r(h),restrictionError:p})}const yn=function(e){const{currentSelection:t,folders:i,files:s,uppyFiles:r,viewType:n,headerComponent:o,showBreadcrumbs:a,isChecked:l,toggleCheckbox:u,recordShiftKeyPress:d,handleScroll:h,showTitles:p,i18n:c,validateRestrictions:f,isLoading:m,showSearchFilter:g,search:y,searchTerm:v,clearSearch:b,searchOnInput:w,searchInputLabel:_,clearSearchLabel:F,getNextFolder:P,cancel:S,done:C,noResultsLabel:k,loadAllFiles:T}=e,O=t.length,E=Rr((()=>[...i,...s]),[i,s]);return Le("div",{className:Ft("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n}`)},o&&Le("div",{className:"uppy-ProviderBrowser-header"},Le("div",{className:Ft("uppy-ProviderBrowser-headerBar",!a&&"uppy-ProviderBrowser-headerBar--simple")},o)),g&&Le("div",{class:"uppy-ProviderBrowser-searchFilter"},Le(on,{search:y,searchTerm:v,clearSearch:b,inputLabel:_,clearSearchLabel:F,inputClassName:"uppy-ProviderBrowser-searchFilterInput",searchOnInput:w})),m?Le("div",{className:"uppy-Provider-loading"},Le("span",null,c("loading"))):i.length||s.length?Le("div",{className:"uppy-ProviderBrowser-body"},T?Le("ul",{className:"uppy-ProviderBrowser-list"},Le(nn,{data:E,renderRow:e=>Le(gn,{currentSelection:t,uppyFiles:r,viewType:n,isChecked:l,toggleCheckbox:u,recordShiftKeyPress:d,showTitles:p,i18n:c,validateRestrictions:f,getNextFolder:P,f:e}),rowHeight:31})):Le("ul",{className:"uppy-ProviderBrowser-list",onScroll:h,role:"listbox",tabIndex:-1},E.map((e=>Le(gn,{currentSelection:t,uppyFiles:r,viewType:n,isChecked:l,toggleCheckbox:u,recordShiftKeyPress:d,showTitles:p,i18n:c,validateRestrictions:f,getNextFolder:P,f:e}))))):Le("div",{className:"uppy-Provider-empty"},k),O>0&&Le(an,{selected:O,done:C,cancel:S,i18n:c}))};class vn extends $e{componentWillUnmount(){const{onUnmount:e}=this.props;e()}render(){const{children:e}=this.props;return Qe(e)[0]}}class bn{constructor(e,t){this.filterItems=e=>{const t=this.plugin.getPluginState();return t.filterInput&&""!==t.filterInput?e.filter((e=>-1!==e.name.toLowerCase().indexOf(t.filterInput.toLowerCase()))):e},this.recordShiftKeyPress=e=>{this.isShiftKeyPressed=e.shiftKey},this.toggleCheckbox=(e,t)=>{e.stopPropagation(),e.preventDefault(),e.currentTarget.focus();const{folders:i,files:s}=this.plugin.getPluginState(),r=this.filterItems(i.concat(s));if(this.lastCheckbox&&this.isShiftKeyPressed){const{currentSelection:e}=this.plugin.getPluginState(),i=r.indexOf(this.lastCheckbox),s=r.indexOf(t),n=i<s?r.slice(i,s+1):r.slice(s,i+1),o=[];for(const e of n){const{uppy:t}=this.plugin,i=t.validateRestrictions(en(e),[...t.getFiles(),...o]);i?t.info({message:i.message},"error",t.opts.infoTimeout):o.push(e)}return void this.plugin.setPluginState({currentSelection:[...new Set([...e,...o])]})}this.lastCheckbox=t;const{currentSelection:n}=this.plugin.getPluginState();this.isChecked(t)?this.plugin.setPluginState({currentSelection:n.filter((e=>e.id!==t.id))}):this.plugin.setPluginState({currentSelection:n.concat([t])})},this.isChecked=e=>{const{currentSelection:t}=this.plugin.getPluginState();return t.some((t=>t.id===e.id))},this.plugin=e,this.provider=t.provider,this.opts=t,this.isHandlingScroll=!1,this.preFirstRender=this.preFirstRender.bind(this),this.handleError=this.handleError.bind(this),this.clearSelection=this.clearSelection.bind(this),this.cancelPicking=this.cancelPicking.bind(this)}preFirstRender(){this.plugin.setPluginState({didFirstRender:!0}),this.plugin.onFirstRender()}shouldHandleScroll(e){const{scrollHeight:t,scrollTop:i,offsetHeight:s}=e.target;return t-(i+s)<50&&!this.isHandlingScroll}clearSelection(){this.plugin.setPluginState({currentSelection:[],filterInput:""})}cancelPicking(){this.clearSelection();const e=this.plugin.uppy.getPlugin("Dashboard");e&&e.hideAllPanels()}handleError(e){var t;const{uppy:i}=this.plugin,s=i.i18n("companionError");i.log(e.toString()),e.isAuthError||"AbortError"===(null==(t=e.cause)?void 0:t.name)||i.info({message:s,details:e.toString()},"error",5e3)}registerRequestClient(){this.requestClientId=this.provider.provider,this.plugin.uppy.registerRequestClient(this.requestClientId,this.provider)}getTagFile(e){const t={id:e.id,source:this.plugin.id,name:e.name||e.id,type:e.mimeType,isRemote:!0,data:e,meta:{},body:{fileId:e.id},remote:{companionUrl:this.plugin.opts.companionUrl,url:`${this.provider.fileUrl(e.requestPath)}`,body:{fileId:e.id},providerName:this.provider.name,provider:this.provider.provider,requestClientId:this.requestClientId}},i=S(t);return i&&fi(i)&&(t.preview=e.thumbnail),e.author&&(null!=e.author.name&&(t.meta.authorName=String(e.author.name)),e.author.url&&(t.meta.authorUrl=e.author.url)),null!=e.relDirPath&&(t.meta.relativePath=e.relDirPath?`${e.relDirPath}/${t.name}`:null),null!=e.absDirPath&&(t.meta.absolutePath=e.absDirPath?`/${e.absDirPath}/${t.name}`:`/${t.name}`),t}setLoading(e){this.plugin.setPluginState({loading:e})}}function wn(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var _n=0;function Fn(e){return"__private_"+_n+++"_"+e}function Pn(e,t){return e?`${e}/${t}`:t}function Sn(){return Le("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},Le("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"}))}const Cn={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1};var kn=Fn("abortController"),Tn=Fn("withAbort"),On=Fn("list"),En=Fn("listFilesAndFolders"),An=Fn("recursivelyListAllFiles");async function xn(e){var t;null==(t=wn(this,kn)[kn])||t.abort();const i=new AbortController;wn(this,kn)[kn]=i;const s=()=>{i.abort(),this.clearSelection()};try{this.plugin.uppy.on("dashboard:close-panel",s),this.plugin.uppy.on("cancel-all",s),await e(i.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",s),this.plugin.uppy.off("cancel-all",s),wn(this,kn)[kn]=void 0}}async function Dn(e){let{requestPath:t,absDirPath:i,signal:s}=e;const{username:r,nextPagePath:n,items:o}=await this.provider.list(t,{signal:s});return this.username=r||this.username,{items:o.map((e=>({...e,absDirPath:i}))),nextPagePath:n}}async function Nn(e){let{breadcrumbs:t,signal:i}=e;const s=function(e){return e.slice(1).map((e=>e.name)).join("/")}(t),{items:r,nextPagePath:n}=await wn(this,On)[On]({requestPath:this.nextPagePath,absDirPath:s,signal:i});this.nextPagePath=n;const o=[],a=[];return r.forEach((e=>{e.isFolder?a.push(e):o.push(e)})),{files:o,folders:a}}async function Un(e){let{requestPath:t,absDirPath:i,relDirPath:s,queue:r,onFiles:n,signal:o}=e,a=t;for(;a;){const e=await wn(this,On)[On]({requestPath:a,absDirPath:i,signal:o});a=e.nextPagePath;const t=e.items.filter((e=>!e.isFolder)),l=e.items.filter((e=>e.isFolder));n(t);const u=l.map((async e=>r.add((async()=>wn(this,An)[An]({requestPath:e.requestPath,absDirPath:Pn(i,e.name),relDirPath:Pn(s,e.name),queue:r,onFiles:n,signal:o})))));await Promise.all(u)}}function In(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}(class extends bn{constructor(e,t){super(e,{...Cn,...t}),Object.defineProperty(this,An,{value:Un}),Object.defineProperty(this,En,{value:Nn}),Object.defineProperty(this,On,{value:Dn}),Object.defineProperty(this,Tn,{value:xn}),Object.defineProperty(this,kn,{writable:!0,value:void 0}),this.filterQuery=this.filterQuery.bind(this),this.clearFilter=this.clearFilter.bind(this),this.getFolder=this.getFolder.bind(this),this.getNextFolder=this.getNextFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.plugin.setPluginState({authenticated:void 0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[]}),this.registerRequestClient()}tearDown(){}async getFolder(e,t){this.setLoading(!0);try{await wn(this,Tn)[Tn]((async i=>{this.lastCheckbox=void 0;let{breadcrumbs:s}=this.plugin.getPluginState();const r=s.findIndex((t=>e===t.requestPath));s=-1!==r?s.slice(0,r+1):[...s,{requestPath:e,name:t}],this.nextPagePath=e;let n=[],o=[];do{const{files:e,folders:t}=await wn(this,En)[En]({breadcrumbs:s,signal:i});n=n.concat(e),o=o.concat(t),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:n.length+o.length}))}while(this.opts.loadAllFiles&&this.nextPagePath);this.plugin.setPluginState({folders:o,files:n,breadcrumbs:s,filterInput:""})}))}catch(e){if("UserFacingApiError"===(null==e?void 0:e.name))return void this.plugin.uppy.info({message:this.plugin.uppy.i18n(e.message)},"warning",5e3);this.handleError(e)}finally{this.setLoading(!1)}}getNextFolder(e){this.getFolder(e.requestPath,e.name),this.lastCheckbox=void 0}async logout(){try{await wn(this,Tn)[Tn]((async e=>{const t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){const e=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(e,"info",7e3)}const e={authenticated:!1,files:[],folders:[],breadcrumbs:[],filterInput:""};this.plugin.setPluginState(e)}}))}catch(e){this.handleError(e)}}filterQuery(e){this.plugin.setPluginState({filterInput:e})}clearFilter(){this.plugin.setPluginState({filterInput:""})}async handleAuth(e){try{await wn(this,Tn)[Tn]((async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),this.preFirstRender()}))}catch(e){if("UserFacingApiError"===e.name)return void this.plugin.uppy.info({message:this.plugin.uppy.i18n(e.message)},"warning",5e3);this.plugin.uppy.log(`login failed: ${e.message}`)}finally{this.setLoading(!1)}}async handleScroll(e){if(this.shouldHandleScroll(e)&&this.nextPagePath){this.isHandlingScroll=!0;try{await wn(this,Tn)[Tn]((async e=>{const{files:t,folders:i,breadcrumbs:s}=this.plugin.getPluginState(),{files:r,folders:n}=await wn(this,En)[En]({breadcrumbs:s,signal:e}),o=t.concat(r),a=i.concat(n);this.plugin.setPluginState({folders:a,files:o})}))}catch(e){this.handleError(e)}finally{this.isHandlingScroll=!1}}}async donePicking(){this.setLoading(!0);try{await wn(this,Tn)[Tn]((async e=>{const{currentSelection:t}=this.plugin.getPluginState(),i=[],s=[];for(const r of t){const{requestPath:t}=r,n=e=>({...e,relDirPath:e.absDirPath.replace(r.absDirPath,"").replace(/^\//,"")});if(r.isFolder){let o=!0,a=0;const l=new br({concurrency:6}),u=e=>{for(const t of e){const e=k(this.getTagFile(t));this.plugin.uppy.checkIfFileAlreadyExists(e)||(s.push(n(t)),a++,this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:a}))),o=!1}};let d;await wn(this,An)[An]({requestPath:t,absDirPath:Pn(r.absDirPath,r.name),relDirPath:r.name,queue:l,onFiles:u,signal:e}),await l.onIdle(),d=o?this.plugin.uppy.i18n("emptyFolderAdded"):0===a?this.plugin.uppy.i18n("folderAlreadyAdded",{folder:r.name}):this.plugin.uppy.i18n("folderAdded",{smart_count:a,folder:r.name}),i.push(d)}else s.push(n(r))}this.plugin.uppy.log("Adding files from a remote provider"),this.plugin.uppy.addFiles(s.map((e=>this.getTagFile(e,this.requestClientId)))),this.plugin.setPluginState({filterInput:""}),i.forEach((e=>this.plugin.uppy.info(e))),this.clearSelection()}))}catch(e){this.handleError(e)}finally{this.setLoading(!1)}}render(e,t){var i=this;void 0===t&&(t={});const{authenticated:s,didFirstRender:r}=this.plugin.getPluginState(),{i18n:n}=this.plugin.uppy;r||this.preFirstRender();const o={...this.opts,...t},{files:a,folders:l,filterInput:u,loading:d,currentSelection:h}=this.plugin.getPluginState(),{isChecked:p,toggleCheckbox:c,recordShiftKeyPress:f,filterItems:m}=this,g=""!==u,y=this.plugin.icon||Sn,v={showBreadcrumbs:o.showBreadcrumbs,getFolder:this.getFolder,breadcrumbs:this.plugin.getPluginState().breadcrumbs,pluginIcon:y,title:this.plugin.title,logout:this.logout,username:this.username,i18n:n},b={isChecked:p,toggleCheckbox:c,recordShiftKeyPress:f,currentSelection:h,files:g?m(a):a,folders:g?m(l):l,getNextFolder:this.getNextFolder,getFolder:this.getFolder,loadAllFiles:this.opts.loadAllFiles,showSearchFilter:o.showFilter,search:this.filterQuery,clearSearch:this.clearFilter,searchTerm:u,searchOnInput:!0,searchInputLabel:n("filter"),clearSearchLabel:n("resetFilter"),noResultsLabel:n("noFilesFound"),logout:this.logout,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,headerComponent:Le(Zr,v),title:this.plugin.title,viewType:o.viewType,showTitles:o.showTitles,showBreadcrumbs:o.showBreadcrumbs,pluginIcon:y,i18n:this.plugin.uppy.i18n,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return i.plugin.uppy.validateRestrictions(...arguments)},isLoading:d};return Le(vn,{onUnmount:this.clearSelection},!1===s?Le(Xr,{pluginName:this.plugin.title,pluginIcon:y,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18nArray,renderForm:this.opts.renderAuthForm,loading:d}):Le(yn,b))}}).VERSION="3.10.0";var Bn=0;function Rn(e){return"__private_"+Bn+++"_"+e}const Mn={isInputMode:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",currentSelection:[],searchTerm:null},Ln={viewType:"grid",showTitles:!0,showFilter:!0,showBreadcrumbs:!0};var zn=Rn("updateFilesAndInputMode");function jn(e,t){this.nextPageQuery=e.nextPageQuery,e.items.forEach((e=>{t.push(e)})),this.plugin.setPluginState({currentSelection:[],isInputMode:!1,files:t,searchTerm:e.searchedFor})}(class extends bn{constructor(e,t){super(e,{...Ln,...t}),Object.defineProperty(this,zn,{value:jn}),this.nextPageQuery=null,this.search=this.search.bind(this),this.clearSearch=this.clearSearch.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.plugin.setPluginState(Mn),this.registerRequestClient()}tearDown(){}resetPluginState(){this.plugin.setPluginState(Mn)}async search(e){const{searchTerm:t}=this.plugin.getPluginState();if(!e||e!==t){this.setLoading(!0);try{const t=await this.provider.search(e);In(this,zn)[zn](t,[])}catch(e){this.handleError(e)}finally{this.setLoading(!1)}}}clearSearch(){this.plugin.setPluginState({currentSelection:[],files:[],searchTerm:null})}async handleScroll(e){const t=this.nextPageQuery||null;if(this.shouldHandleScroll(e)&&t){this.isHandlingScroll=!0;try{const{files:e,searchTerm:i}=this.plugin.getPluginState(),s=await this.provider.search(i,t);In(this,zn)[zn](s,e)}catch(e){this.handleError(e)}finally{this.isHandlingScroll=!1}}}donePicking(){const{currentSelection:e}=this.plugin.getPluginState();this.plugin.uppy.log("Adding remote search provider files"),this.plugin.uppy.addFiles(e.map((e=>this.getTagFile(e)))),this.resetPluginState()}render(e,t){var i=this;void 0===t&&(t={});const{didFirstRender:s,isInputMode:r,searchTerm:n}=this.plugin.getPluginState(),{i18n:o}=this.plugin.uppy;s||this.preFirstRender();const a={...this.opts,...t},{files:l,folders:u,filterInput:d,loading:h,currentSelection:p}=this.plugin.getPluginState(),{isChecked:c,toggleCheckbox:f,filterItems:m,recordShiftKeyPress:g}=this,y=""!==d,v={isChecked:c,toggleCheckbox:f,recordShiftKeyPress:g,currentSelection:p,files:y?m(l):l,folders:y?m(u):u,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,showSearchFilter:a.showFilter,search:this.search,clearSearch:this.clearSearch,searchTerm:n,searchOnInput:!1,searchInputLabel:o("search"),clearSearchLabel:o("resetSearch"),noResultsLabel:o("noSearchResults"),title:this.plugin.title,viewType:a.viewType,showTitles:a.showTitles,showFilter:a.showFilter,isLoading:h,showBreadcrumbs:a.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:o,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return i.plugin.uppy.validateRestrictions(...arguments)}};return Le(vn,{onUnmount:this.resetPluginState},r?Le("div",{className:"uppy-SearchProvider"},Le(on,{search:this.search,inputLabel:o("enterTextToSearch"),buttonLabel:o("searchImages"),inputClassName:"uppy-c-textInput uppy-SearchProvider-input",buttonCSSClassName:"uppy-SearchProvider-searchButton",showButton:!0})):Le(yn,v))}}).VERSION="3.10.0";var $n=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function qn(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!((s=e[i])===(r=t[i])||$n(s)&&$n(r)))return!1;var s,r;return!0}function Hn(e,t){void 0===t&&(t=qn);var i=null;function s(){for(var s=[],r=0;r<arguments.length;r++)s[r]=arguments[r];if(i&&i.lastThis===this&&t(s,i.lastArgs))return i.lastResult;var n=e.apply(this,s);return i={lastResult:n,lastArgs:s,lastThis:this},n}return s.clear=function(){i=null},s}const Vn=['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 Wn(e,t){if(t){const i=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(i)return i}return e}function Gn(e,t){const i=t[0];i&&(i.focus(),e.preventDefault())}function Kn(e,t,i){const s=Wn(i,t),r=Ds(s.querySelectorAll(Vn)),n=r.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(s)?Gn(e,r):e.shiftKey&&0===n?function(e,t){const i=t[t.length-1];i&&(i.focus(),e.preventDefault())}(e,r):e.shiftKey||n!==r.length-1||Gn(e,r)}var Xn=i(221);function Yn(){const e=document.body;return"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&"FormData"in window&&"FileReader"in window}var Qn=i(993);function Jn(e){const t={color:"#838999",icon:Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},Le("g",{fill:"#A7AFB7",fillRule:"nonzero"},Le("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"}),Le("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))};if(!e)return t;const i=e.split("/")[0],s=e.split("/")[1];return"text"===i?{color:"#5a5e69",icon:Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},Le("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}:"image"===i?{color:"#686de0",icon:Le("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},Le("g",{fill:"#686DE0",fillRule:"evenodd"},Le("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"}),Le("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"}),Le("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}:"audio"===i?{color:"#068dbb",icon:Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},Le("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}:"video"===i?{color:"#19af67",icon:Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},Le("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}:"application"===i&&"pdf"===s?{color:"#e25149",icon:Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},Le("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}:"application"===i&&-1!==["zip","x-7z-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(s)?{color:"#00C469",icon:Le("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},Le("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}:t}function Zn(e){const{file:t}=e;if(t.preview)return Le("img",{className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});const{color:i,icon:s}=Jn(t.type);return Le("div",{className:"uppy-Dashboard-Item-previewIconWrap"},Le("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:i}},s),Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},Le("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}const eo=(e,t)=>{const i=("function"==typeof t?t():t).filter((t=>t.id===e));return i[0].name};function to(e){const{file:t,toggleFileCard:i,i18n:s,metaFields:r}=e,{missingRequiredMetaFields:n}=t;if(null==n||!n.length)return null;const o=n.map((e=>eo(e,r))).join(", ");return Le("div",{className:"uppy-Dashboard-Item-errorMessage"},s("missingRequiredMetaFields",{smart_count:n.length,fields:o})," ",Le("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>i(!0,t.id)},s("editFile")))}function io(e){const{file:t,i18n:i,toggleFileCard:s,metaFields:r,showLinkToFileUploadResult:n}=e;return Le("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:t.preview?"rgba(255, 255, 255, 0.5)":Jn(e.file.type).color}},n&&t.uploadURL&&Le("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name},Le("span",{hidden:!0},t.meta.name)),Le(Zn,{file:t}),Le(to,{file:t,i18n:i,toggleFileCard:s,metaFields:r}))}function so(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function ro(e){return Le("div",{className:"uppy-Dashboard-Item-progress"},Le("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":so(e),title:so(e),onClick:()=>function(e){e.isUploaded||(!e.error||e.hideRetryButton?e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id):e.uppy.retryUpload(e.file.id))}(e)},e.children))}function no(e){let{children:t}=e;return Le("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},t)}function oo(e){let{progress:t}=e;const i=2*Math.PI*15;return Le("g",null,Le("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),Le("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":i,"stroke-dashoffset":i-i/100*t}))}function ao(e){return e.file.progress.uploadStarted?e.isUploaded?Le("div",{className:"uppy-Dashboard-Item-progress"},Le("div",{className:"uppy-Dashboard-Item-progressIndicator"},Le(no,null,Le("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),Le("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):e.recoveredState?void 0:e.error&&!e.hideRetryButton?Le(ro,e,Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},Le("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),Le("path",{d:"M7.9 3H10v2H7.9z"}),Le("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),Le("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):e.resumableUploads&&!e.hidePauseResumeButton?Le(ro,e,Le(no,null,Le(oo,{progress:e.file.progress.percentage}),e.file.isPaused?Le("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):Le("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},Le("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),Le("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?Le("div",{className:"uppy-Dashboard-Item-progress"},Le("div",{className:"uppy-Dashboard-Item-progressIndicator"},Le(no,null,Le(oo,{progress:e.file.progress.percentage})))):Le(ro,e,Le(no,null,Le(oo,{progress:e.file.progress.percentage}),Le("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):null}const lo="...";function uo(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<=4)return`${e.slice(0,t-1)}…`;const i=t-3,s=Math.ceil(i/2),r=Math.floor(i/2);return e.slice(0,s)+lo+e.slice(-r)}const ho=e=>{let{file:t,onClick:i}=e;return t.error?Le("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:i,type:"button"},"?"):null};function po(e){const{file:t}=e;return Le("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source},Le("div",{className:"uppy-Dashboard-Item-fileName"},(e=>{const{author:t,name:i}=e.file.meta;return Le("div",{className:"uppy-Dashboard-Item-name",title:i},uo(i,e.isSingleFile&&e.containerHeight>=350?90:e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30))})(e),Le(ho,{file:e.file,onClick:()=>alert(e.file.error)})),Le("div",{className:"uppy-Dashboard-Item-status"},(e=>{var t;const{author:i}=e.file.meta,s=null==(t=e.file.remote)?void 0:t.providerName;return i?Le("div",{className:"uppy-Dashboard-Item-author"},Le("a",{href:`${i.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},uo(i.name,13)),s?Le(je,null," · ",s," · "):null):null})(e),(e=>e.file.size&&Le("div",{className:"uppy-Dashboard-Item-statusSize"},D(e.file.size)))(e),(e=>e.file.isGhost&&Le("span",null," • ",Le("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:e.toggleAddFilesPanel},e.i18n("reSelect"))))(e)),Le(to,{file:e.file,i18n:e.i18n,toggleFileCard:e.toggleFileCard,metaFields:e.metaFields}))}function co(e){let{file:t,uploadInProgressOrComplete:i,metaFields:s,canEditFile:r,i18n:n,onClick:o}=e;return!i&&s&&s.length>0||!i&&r(t)?Le("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":n("editFileWithFilename",{file:t.meta.name}),title:n("editFileWithFilename",{file:t.meta.name}),onClick:()=>o()},Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},Le("g",{fillRule:"evenodd"},Le("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"}),Le("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),Le("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function fo(e){let{i18n:t,onClick:i,file:s}=e;return Le("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile",{file:s.meta.name}),title:t("removeFile",{file:s.meta.name}),onClick:()=>i()},Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},Le("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"}),Le("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"})))}const mo=(e,t)=>{var i,s;(i=t.file.uploadURL,s=t.i18n("copyLinkToClipboardFallback"),void 0===s&&(s="Copy the URL below"),new Promise((e=>{const t=document.createElement("textarea");t.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),t.value=i,document.body.appendChild(t),t.select();const r=()=>{document.body.removeChild(t),window.prompt(s,i),e()};try{return document.execCommand("copy")?(document.body.removeChild(t),e()):r()}catch(e){return document.body.removeChild(t),r()}}))).then((()=>{t.uppy.log("Link copied to clipboard."),t.uppy.info(t.i18n("copyLinkToClipboardSuccess"),"info",3e3)})).catch(t.uppy.log).then((()=>e.target.focus({preventScroll:!0})))};function go(e){const{i18n:t}=e;return Le("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":t("copyLink"),title:t("copyLink"),onClick:t=>mo(t,e)},Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},Le("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"})))}function yo(e){const{uppy:t,file:i,uploadInProgressOrComplete:s,canEditFile:r,metaFields:n,showLinkToFileUploadResult:o,showRemoveButton:a,i18n:l,toggleFileCard:u,openFileEditor:d}=e;return Le("div",{className:"uppy-Dashboard-Item-actionWrapper"},Le(co,{i18n:l,file:i,uploadInProgressOrComplete:s,canEditFile:r,metaFields:n,onClick:()=>{n&&n.length>0?u(!0,i.id):d(i)}}),o&&i.uploadURL?Le(go,{file:i,uppy:t,i18n:l}):null,a?Le(fo,{i18n:l,file:i,uppy:t,onClick:()=>e.uppy.removeFile(i.id,"removed-by-user")}):null)}class vo extends $e{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Qn(this.props,e)}componentDidUpdate(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){const{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){const{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,i=e.progress.uploadComplete&&!t&&!e.error,s=e.progress.uploadStarted||t,r=e.progress.uploadStarted&&!e.progress.uploadComplete||t,n=e.error||!1,{isGhost:o}=e;let a=(this.props.individualCancellation||!r)&&!i;return i&&this.props.showRemoveButtonAfterComplete&&(a=!0),Le("div",{className:Ft({"uppy-Dashboard-Item":!0,"is-inprogress":r&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!n,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":o}),id:`uppy_${e.id}`,role:this.props.role},Le("div",{className:"uppy-Dashboard-Item-preview"},Le(io,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),Le(ao,{uppy:this.props.uppy,file:e,error:n,isUploaded:i,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,showRemoveButtonAfterComplete:this.props.showRemoveButtonAfterComplete,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),Le("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},Le(po,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),Le(yo,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:a,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}}const bo=e=>{let{id:t,error:i,i18n:s,uppy:r,files:n,acquirers:o,resumableUploads:a,hideRetryButton:l,hidePauseResumeButton:u,hideCancelButton:d,showLinkToFileUploadResult:h,showRemoveButtonAfterComplete:p,isWide:c,metaFields:f,isSingleFile:m,toggleFileCard:g,handleRequestThumbnail:y,handleCancelThumbnail:v,recoveredState:b,individualCancellation:w,itemsPerRow:_,openFileEditor:F,canEditFile:P,toggleAddFilesPanel:S,containerWidth:C,containerHeight:k}=e;const T=1===_?71:200,O=Rr((()=>{const e=Object.keys(n);return b&&e.sort(((e,t)=>n[t].isGhost-n[e].isGhost)),function(e,t){const i=[];let s=[];return e.forEach((e=>{s.length<t?s.push(e):(i.push(s),s=[e])})),s.length&&i.push(s),i}(e,_)}),[n,_,b]),E=e=>Le("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:e[0]},e.map((e=>Le(vo,{key:e,uppy:r,id:t,error:i,i18n:s,acquirers:o,resumableUploads:a,individualCancellation:w,hideRetryButton:l,hidePauseResumeButton:u,hideCancelButton:d,showLinkToFileUploadResult:h,showRemoveButtonAfterComplete:p,isWide:c,metaFields:f,recoveredState:b,isSingleFile:m,containerWidth:C,containerHeight:k,toggleFileCard:g,handleRequestThumbnail:y,handleCancelThumbnail:v,role:"listitem",openFileEditor:F,canEditFile:P,toggleAddFilesPanel:S,file:n[e]}))));return m?Le("div",{class:"uppy-Dashboard-files"},E(O[0])):Le(nn,{class:"uppy-Dashboard-files",role:"list",data:O,renderRow:E,rowHeight:T})};let wo;wo=Symbol.for("uppy test: disable unused locale key warning");const _o=class extends $e{constructor(){super(...arguments),this.triggerFileInputClick=()=>{this.fileInput.click()},this.triggerFolderInputClick=()=>{this.folderInput.click()},this.triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput.click()},this.triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.target.value=null},this.renderHiddenInput=(e,t)=>Le("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes,ref:t}),this.renderHiddenCameraInput=(e,t,i)=>{const s={photo:"image/*",video:"video/*"}[e];return Le("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:s,ref:i})},this.renderMyDeviceAcquirer=()=>Le("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},Le("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},Le("div",{className:"uppy-DashboardTab-inner"},Le("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Le("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"}))),Le("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>Le("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},Le("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},Le("div",{className:"uppy-DashboardTab-inner"},Le("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},Le("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"}))),Le("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>Le("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},Le("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},Le("div",{className:"uppy-DashboardTab-inner"},Le("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},Le("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 "}))),Le("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>Le("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===this.props.acquirers.length},e),this.renderDropPasteBrowseTagline=e=>{const t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),i=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),s=this.props.fileManagerSelectionType,r=s.charAt(0).toUpperCase()+s.slice(1);return Le("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${r}`,{browseFiles:t,browseFolders:i,browse:t}):this.props.i18nArray(`dropPaste${r}`,{browseFiles:t,browseFolders:i,browse:t}))},this.renderAcquirer=e=>Le("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},Le("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":this.props.activePickerPanel.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},Le("div",{className:"uppy-DashboardTab-inner"},e.icon()),Le("div",{className:"uppy-DashboardTab-name"},e.name))),this.renderAcquirers=e=>{const t=[...e],i=t.splice(e.length-2,e.length);return Le(je,null,t.map((e=>this.renderAcquirer(e))),Le("span",{role:"presentation",style:{"white-space":"nowrap"}},i.map((e=>this.renderAcquirer(e)))))},this.renderSourcesList=(e,t)=>{const{showNativePhotoCameraButton:i,showNativeVideoCameraButton:s}=this.props;let r=[];const n="myDevice";t||r.push({key:n,elements:this.renderMyDeviceAcquirer()}),i&&r.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),s&&r.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),r.push(...e.map((e=>({key:e.id,elements:this.renderAcquirer(e)})))),1===r.length&&r[0].key===n&&(r=[]);const o=[...r],a=o.splice(r.length-2,r.length),l=e=>e.map((e=>{let{key:t,elements:i}=e;return Le(je,{key:t},i)}));return Le(je,null,this.renderDropPasteBrowseTagline(r.length),Le("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l(o),Le("span",{role:"presentation",style:{"white-space":"nowrap"}},l(a))))}}[wo](){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(){const{i18nArray:e}=this.props,t=Le("span",null,Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},Le("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),Le("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy"));return Le("a",{tabIndex:"-1",href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},e("poweredBy",{uppy:t}))}render(){const{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:i}=this.props;return Le("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,(e=>{this.fileInput=e})),this.renderHiddenInput(!0,(e=>{this.folderInput=e})),e&&this.renderHiddenCameraInput("photo",i,(e=>{this.mobilePhotoFileInput=e})),t&&this.renderHiddenCameraInput("video",i,(e=>{this.mobileVideoFileInput=e})),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),Le("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&Le("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))}},Fo=e=>Le("div",{className:Ft("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":!e.showAddFilesPanel},Le("div",{className:"uppy-DashboardContent-bar"},Le("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("addingMoreFiles")),Le("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1)},e.i18n("back"))),Le(_o,e)),Po=function(e){const{tagName:t}=e.target;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()},So=function(e){let{activePickerPanel:t,className:i,hideAllPanels:s,i18n:r,state:n,uppy:o}=e;return Le("div",{className:Ft("uppy-DashboardContent-panel",i),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${t.id}`,onDragOver:Po,onDragLeave:Po,onDrop:Po,onPaste:Po},Le("div",{className:"uppy-DashboardContent-bar"},Le("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:t.name})),Le("button",{className:"uppy-DashboardContent-back",type:"button",onClick:s},r("cancel"))),Le("div",{className:"uppy-DashboardContent-panelBody"},o.getPlugin(t.id).render(n)))},Co=function(e){const t=e.files[e.fileCardFor];return Le("div",{className:Ft("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},Le("div",{className:"uppy-DashboardContent-bar"},Le("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18nArray("editing",{file:Le("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),Le("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>{e.uppy.emit("file-editor:cancel",t),e.closeFileEditor()}},e.i18n("cancel")),Le("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor},e.i18n("save"))),Le("div",{className:"uppy-DashboardContent-panelBody"},e.editors.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))},ko="error",To="waiting",Oo="preprocessing",Eo="uploading",Ao="postprocessing",xo="complete",Do="paused";function No(e){let{files:t,i18n:i,isAllComplete:s,isAllErrored:r,isAllPaused:n,inProgressNotPausedFiles:o,newFiles:a,processingFiles:l}=e;const u=function(e,t,i,s){if(void 0===s&&(s={}),e)return ko;if(t)return xo;if(i)return Do;let r=To;const n=Object.keys(s);for(let e=0;e<n.length;e++){const{progress:t}=s[n[e]];if(t.uploadStarted&&!t.uploadComplete)return Eo;t.preprocess&&r!==Eo&&(r=Oo),t.postprocess&&r!==Eo&&r!==Oo&&(r=Ao)}return r}(r,s,n,t);switch(u){case"uploading":return i("uploadingXFiles",{smart_count:o.length});case"preprocessing":case"postprocessing":return i("processingXFiles",{smart_count:l.length});case"paused":return i("uploadPaused");case"waiting":return i("xFilesSelected",{smart_count:a.length});case"complete":return i("uploadComplete");case"error":return i("error")}}const Uo=function(e){const{i18n:t,isAllComplete:i,hideCancelButton:s,maxNumberOfFiles:r,toggleAddFilesPanel:n,uppy:o}=e;let{allowNewUpload:a}=e;return a&&r&&(a=e.totalFileCount<e.maxNumberOfFiles),Le("div",{className:"uppy-DashboardContent-bar"},i||s?Le("div",null):Le("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>o.cancelAll()},t("cancel")),Le("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},Le(No,e)),a?Le("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>n(!0)},Le("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},Le("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"})),Le("span",{className:"uppy-DashboardContent-addMoreCaption"},t("addMore"))):Le("div",null))};function Io(e){const{computedMetaFields:t,requiredMetaFields:i,updateMeta:s,form:r,formState:n}=e,o={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map((e=>{const t=`uppy-Dashboard-FileCard-input-${e.id}`,a=i.includes(e.id);return Le("fieldset",{key:e.id,className:"uppy-Dashboard-FileCard-fieldset"},Le("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:t},e.name),void 0!==e.render?e.render({value:n[e.id],onChange:t=>s(t,e.id),fieldCSSClasses:o,required:a,form:r.id},Le):Le("input",{className:o.text,id:t,form:r.id,type:e.type||"text",required:a,value:n[e.id],placeholder:e.placeholder,onInput:t=>s(t.target.value,e.id),"data-uppy-super-focusable":!0}))}))}function Bo(e){var t;const{files:i,fileCardFor:s,toggleFileCard:r,saveFileCard:n,metaFields:o,requiredMetaFields:a,openFileEditor:l,i18n:u,i18nArray:d,className:h,canEditFile:c}=e,f=i[s],m=null!=(t="function"==typeof o?o(i[s]):o)?t:[],g=c(f),y={};m.forEach((e=>{var t;y[e.id]=null!=(t=f.meta[e.id])?t:""}));const[v,b]=Ir(y),w=Mr((e=>{e.preventDefault(),n(v,s)}),[n,v,s]),_=()=>{r(!1)},[F]=Ir((()=>{const e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=p(),e}));return Br((()=>(document.body.appendChild(F),F.addEventListener("submit",w),()=>{F.removeEventListener("submit",w),document.body.removeChild(F)})),[F,w]),Le("div",{className:Ft("uppy-Dashboard-FileCard",h),"data-uppy-panelType":"FileCard",onDragOver:Po,onDragLeave:Po,onDrop:Po,onPaste:Po},Le("div",{className:"uppy-DashboardContent-bar"},Le("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:Le("span",{className:"uppy-DashboardContent-titleFile"},f.meta?f.meta.name:f.name)})),Le("button",{className:"uppy-DashboardContent-back",type:"button",form:F.id,title:u("finishEditingFile"),onClick:_},u("cancel"))),Le("div",{className:"uppy-Dashboard-FileCard-inner"},Le("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:Jn(f.type).color}},Le(Zn,{file:f}),g&&Le("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:e=>{w(e),l(f)}},u("editImage"))),Le("div",{className:"uppy-Dashboard-FileCard-info"},Le(Io,{computedMetaFields:m,requiredMetaFields:a,updateMeta:(e,t)=>{b({...v,[t]:e})},form:F,formState:v})),Le("div",{className:"uppy-Dashboard-FileCard-actions"},Le("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:F.id},u("saveChanges")),Le("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:_,form:F.id},u("cancel")))))}const Ro="uppy-transition-slideDownUp",Mo=class extends $e{constructor(e){super(e),this.state={cachedChildren:null,className:""}}componentWillUpdate(e){const{cachedChildren:t}=this.state,i=Qe(e.children)[0];if(t===i)return null;const s={cachedChildren:i};i&&!t&&(s.className=`${Ro}-enter`,cancelAnimationFrame(this.animationFrame),clearTimeout(this.leaveTimeout),this.leaveTimeout=void 0,this.animationFrame=requestAnimationFrame((()=>{this.setState({className:`${Ro}-enter ${Ro}-enter-active`}),this.enterTimeout=setTimeout((()=>{this.setState({className:""})}),250)}))),t&&!i&&void 0===this.leaveTimeout&&(s.cachedChildren=t,s.className=`${Ro}-leave`,cancelAnimationFrame(this.animationFrame),clearTimeout(this.enterTimeout),this.enterTimeout=void 0,this.animationFrame=requestAnimationFrame((()=>{this.setState({className:`${Ro}-leave ${Ro}-leave-active`}),this.leaveTimeout=setTimeout((()=>{this.setState({cachedChildren:null,className:""})}),250)}))),this.setState(s)}render(){const{cachedChildren:e,className:t}=this.state;return e?dt(e,{className:Ft(t,e.props.className)}):null}};function Lo(){return Lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},Lo.apply(this,arguments)}const zo={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 jo(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var $o=0;function qo(e){return"__private_"+$o+++"_"+e}const Ho=Hn.default||Hn;function Vo(){const e={};return e.promise=new Promise(((t,i)=>{e.resolve=t,e.reject=i})),e}var Wo=qo("disabledNodes"),Go=qo("generateLargeThumbnailIfSingleFile"),Ko=qo("openFileEditorWhenFilesAdded"),Xo=qo("attachRenderFunctionToTarget"),Yo=qo("isTargetSupported"),Qo=qo("getAcquirers"),Jo=qo("getProgressIndicators"),Zo=qo("getEditors"),ea=qo("addSpecifiedPluginsFromOptions"),ta=qo("autoDiscoverPlugins"),ia=qo("addSupportedPluginIfNoTarget");class sa extends bt{constructor(e,t){var i;super(e,t),i=this,Object.defineProperty(this,Wo,{writable:!0,value:null}),this.removeTarget=e=>{const t=this.getPluginState().targets.filter((t=>t.id!==e.id));this.setPluginState({targets:t})},this.addTarget=e=>{const t=e.id||e.constructor.name,i=e.title||t,s=e.type;if("acquirer"!==s&&"progressindicator"!==s&&"editor"!==s){const e="Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor";return void this.uppy.log(e,"error")}const r={id:t,name:i,type:s},n=this.getPluginState().targets.slice();return n.push(r),this.setPluginState({targets:n}),this.el},this.hideAllPanels=()=>{const e=this.getPluginState(),t={activePickerPanel:!1,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};e.activePickerPanel===t.activePickerPanel&&e.showAddFilesPanel===t.showAddFilesPanel&&e.showFileEditor===t.showFileEditor&&e.activeOverlayType===t.activeOverlayType||(this.setPluginState(t),this.uppy.emit("dashboard:close-panel",e.activePickerPanel.id))},this.showPanel=e=>{const{targets:t}=this.getPluginState(),i=t.filter((t=>"acquirer"===t.type&&t.id===e))[0];this.setPluginState({activePickerPanel:i,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",e)},this.canEditFile=e=>{const{targets:t}=this.getPluginState();return jo(this,Zo)[Zo](t).some((t=>this.uppy.getPlugin(t.id).canEditFile(e)))},this.openFileEditor=e=>{const{targets:t}=this.getPluginState(),i=jo(this,Zo)[Zo](t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),i.forEach((t=>{this.uppy.getPlugin(t.id).selectFile(e)}))},this.closeFileEditor=()=>{const{metaFields:e}=this.getPluginState();e&&e.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{const{targets:e}=this.getPluginState();jo(this,Zo)[Zo](e).forEach((e=>{this.uppy.getPlugin(e.id).save()})),this.closeFileEditor()},this.openModal=()=>{const{promise:e,resolve:t}=Vo();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){const e=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",e,!1),t()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!1}),t();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),e},this.closeModal=function(e){void 0===e&&(e={});const{manualClose:t=!0}=e,{isHidden:s,isClosing:r}=i.getPluginState();if(s||r)return;const{promise:n,resolve:o}=Vo();if(i.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),i.opts.animateOpenClose){i.setPluginState({isClosing:!0});const e=()=>{i.setPluginState({isHidden:!0,isClosing:!1}),i.superFocus.cancel(),i.savedActiveElement.focus(),i.el.removeEventListener("animationend",e,!1),o()};i.el.addEventListener("animationend",e,!1)}else i.setPluginState({isHidden:!0}),i.superFocus.cancel(),i.savedActiveElement.focus(),o();var a;return document.removeEventListener("keydown",i.handleKeyDownInModal),t&&i.opts.browserBackButtonClose&&null!=(a=history.state)&&a[i.modalName]&&history.back(),i.uppy.emit("dashboard:modal-closed"),n},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=e=>{const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})},this.handleSystemDarkModeChange=e=>{const t=e.matches;this.uppy.log("[Dashboard] Dark mode is "+(t?"on":"off")),this.setDarkModeCapability(t)},this.toggleFileCard=(e,t)=>{const i=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",i):this.uppy.emit("dashboard:file-edit-complete",i),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})},this.toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})},this.addFiles=e=>{const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}})));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver((e=>{const t=e[0],{width:i,height:s}=t.contentRect;this.setPluginState({containerWidth:i,containerHeight:s,areInsidesReadyToBeVisible:!0})})),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout((()=>{const e=this.getPluginState(),t=!this.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(this.uppy.log("[Dashboard] resize event didn’t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))}),1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=e=>{var t;const i=null!=(t=jo(this,Wo)[Wo])?t:Ds(this.el.querySelectorAll(["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'])).filter((e=>!e.classList.contains("uppy-Dashboard-close")));for(const t of i)"A"===t.tagName?t.setAttribute("aria-disabled",e):t.disabled=e;jo(this,Wo)[Wo]=e?i:null,this.dashboardIsDisabled=e},this.updateBrowserHistory=()=>{var e;null!=(e=history.state)&&e[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=e=>{var t;!this.isModalOpen()||e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&null!=(t=e.state)&&t[this.modalName]&&history.back()},this.handleKeyDownInModal=e=>{27===e.keyCode&&this.requestCloseModal(e),9===e.keyCode&&Kn(e,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=e=>{this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootPaste||t.handleRootPaste(e))}));const t=Ds(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))},this.handleInputChange=e=>{e.preventDefault();const t=Ds(e.target.files);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))},this.handleDragOver=e=>{var t,i;e.preventDefault(),e.stopPropagation();const s=(()=>{let t=!0;return this.uppy.iteratePlugins((i=>{null!=i.canHandleRootDrop&&i.canHandleRootDrop(e)&&(t=!0)})),t})(),r=(()=>{const{types:t}=e.dataTransfer;return t.some((e=>"Files"===e))})();if(!s&&!r||this.opts.disabled||this.opts.disableLocalFiles&&(r||!s)||!this.uppy.getState().allowNewUpload)return e.dataTransfer.dropEffect="none",void clearTimeout(this.removeDragOverClassTimeout);e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),null==(t=(i=this.opts).onDragOver)||t.call(i,e)},this.handleDragLeave=e=>{var t,i;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((()=>{this.setPluginState({isDraggingOver:!1})}),50),null==(t=(i=this.opts).onDragLeave)||t.call(i,e)},this.handleDrop=async e=>{var t,i;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootDrop||t.handleRootDrop(e))}));let s=!1;this.uppy.log("[Dashboard] Processing dropped files");const r=await async function(e,t){var i;const s=null!=(i=null==t?void 0:t.logDropError)?i:Function.prototype;try{const t=[];for await(const i of async function*(e,t){const i=await Promise.all(Array.from(e.items,(async e=>{let i;return null!=i||(i=Us("function"==typeof e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry(),t)),{fileSystemHandle:i,lastResortFile:e.getAsFile()}})));for(const{lastResortFile:e,fileSystemHandle:s}of i)if(null!=s)try{yield*Is(s,"",e)}catch(i){null!=e?yield e:t(i)}else null!=e&&(yield e)}(e,s))t.push(i);return t}catch{return function(e){const t=Ds(e.files);return Promise.resolve(t)}(e)}}(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),s||(this.uppy.info(e.message,"error"),s=!0)}});r.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(r)),null==(t=(i=this.opts).onDrop)||t.call(i,e)},this.handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)},this.handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)},this.handleKeyDownInInline=e=>{9===e.keyCode&&function(e,t,i){null===t||Kn(e,t,i)}(e,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)},this.handleComplete=e=>{let{failed:t}=e;this.opts.closeAfterFinish&&0===t.length&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Go,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;const e=this.uppy.getFiles();if(1===e.length){const t=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);null==t||t.setOptions({thumbnailWidth:600});const i={...e[0],preview:void 0};t.requestThumbnail(i).then((()=>{null==t||t.setOptions({thumbnailWidth:this.opts.thumbnailWidth})}))}}}),Object.defineProperty(this,Ko,{writable:!0,value:e=>{const t=e[0],{metaFields:i}=this.getPluginState(),s=i&&i.length>0,r=this.canEditFile(t);s?this.toggleFileCard(!0,t.id):r&&this.openFileEditor(t)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const e=xs(this.opts.trigger);e?e.forEach((e=>e.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",jo(this,ia)[ia]),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",jo(this,Go)[Go]),this.uppy.on("file-removed",jo(this,Go)[Go]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpenFileEditor&&this.uppy.on("files-added",jo(this,Ko)[Ko])},this.removeEvents=()=>{const e=xs(this.opts.trigger);!this.opts.inline&&e&&e.forEach((e=>e.removeEventListener("click",this.openModal))),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",jo(this,ia)[ia]),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",jo(this,Go)[Go]),this.uppy.off("file-removed",jo(this,Go)[Go]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpenFileEditor&&this.uppy.off("files-added",jo(this,Ko)[Ko])},this.superFocusOnEachUpdate=()=>{const e=this.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,i=0===this.uppy.getState().info.length,s=!this.opts.inline;i&&(s||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{!this.opts.disabled||this.dashboardIsDisabled?(!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()):this.disableInteractiveElements(!0)},this.saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)},Object.defineProperty(this,Xo,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}}}),Object.defineProperty(this,Yo,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()}}),Object.defineProperty(this,Qo,{writable:!0,value:Ho((e=>e.filter((e=>"acquirer"===e.type&&jo(this,Yo)[Yo](e))).map(jo(this,Xo)[Xo])))}),Object.defineProperty(this,Jo,{writable:!0,value:Ho((e=>e.filter((e=>"progressindicator"===e.type)).map(jo(this,Xo)[Xo])))}),Object.defineProperty(this,Zo,{writable:!0,value:Ho((e=>e.filter((e=>"editor"===e.type)).map(jo(this,Xo)[Xo])))}),this.render=e=>{const t=this.getPluginState(),{files:i,capabilities:s,allowNewUpload:r}=e,{newFiles:n,uploadStartedFiles:o,completeFiles:a,erroredFiles:l,inProgressFiles:u,inProgressNotPausedFiles:d,processingFiles:h,isUploadStarted:p,isAllComplete:c,isAllErrored:f,isAllPaused:m}=this.uppy.getObjectOfFilesPerState(),g=jo(this,Qo)[Qo](t.targets),y=jo(this,Jo)[Jo](t.targets),v=jo(this,Zo)[Zo](t.targets);let b;return b="auto"===this.opts.theme?s.darkMode?"dark":"light":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}".`)),function(e){const t=0===e.totalFileCount,i=1===e.totalFileCount,s=e.containerWidth>576,r=e.containerHeight>330,n=Ft({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>576,"uppy-size--lg":e.containerWidth>700,"uppy-size--xl":e.containerWidth>900,"uppy-size--height-md":e.containerHeight>330,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":e.singleFileFullScreen&&i&&r});let o=1;e.containerWidth>900?o=5:e.containerWidth>700?o=4:e.containerWidth>576&&(o=3);const a=e.showSelectedFiles&&!t,l=e.recoveredState?Object.keys(e.recoveredState.files).length:null,u=e.files?Object.keys(e.files).filter((t=>e.files[t].isGhost)).length:null;return Le("div",{className:n,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&Yn(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop},Le("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),Le("div",{className:"uppy-Dashboard-inner","aria-modal":!e.inline&&"true",role:!e.inline&&"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""}},e.inline?null:Le("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal},Le("span",{"aria-hidden":"true"},"×")),Le("div",{className:"uppy-Dashboard-innerWrap"},Le("div",{className:"uppy-Dashboard-dropFilesHereHint"},e.i18n("dropHint")),a&&Le(Uo,e),l&&Le("div",{className:"uppy-Dashboard-serviceMsg"},Le("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},Le("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},Le("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"}),Le("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),Le("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),Le("strong",{className:"uppy-Dashboard-serviceMsg-title"},e.i18n("sessionRestored")),Le("div",{className:"uppy-Dashboard-serviceMsg-text"},u>0?e.i18n("recoveredXFiles",{smart_count:u}):e.i18n("recoveredAllFiles"))),a?Le(bo,{id:e.id,error:e.error,i18n:e.i18n,uppy:e.uppy,files:e.files,acquirers:e.acquirers,resumableUploads:e.resumableUploads,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,isWide:e.isWide,metaFields:e.metaFields,toggleFileCard:e.toggleFileCard,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail,recoveredState:e.recoveredState,individualCancellation:e.individualCancellation,openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,isSingleFile:i,itemsPerRow:o}):Le(_o,Lo({},e,{isSizeMD:s})),Le(Mo,null,e.showAddFilesPanel?Le(Fo,Lo({key:"AddFiles"},e,{isSizeMD:s})):null),Le(Mo,null,e.fileCardFor?Le(Bo,Lo({key:"FileCard"},e)):null),Le(Mo,null,e.activePickerPanel?Le(So,Lo({key:"Picker"},e)):null),Le(Mo,null,e.showFileEditor?Le(Co,Lo({key:"Editor"},e)):null),Le("div",{className:"uppy-Dashboard-progressindicators"},e.progressindicators.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))))}({state:e,isHidden:t.isHidden,files:i,newFiles:n,uploadStartedFiles:o,completeFiles:a,erroredFiles:l,inProgressFiles:u,inProgressNotPausedFiles:d,processingFiles:h,isUploadStarted:p,isAllComplete:c,isAllErrored:f,isAllPaused:m,totalFileCount:Object.keys(i).length,totalProgress:e.totalProgress,allowNewUpload:r,acquirers:g,theme:b,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:t.activePickerPanel,showFileEditor:t.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:t.isClosing,progressindicators:y,editors:v,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:e.recoveredState,metaFields:t.metaFields,resumableUploads:s.resumableUploads||!1,individualCancellation:s.individualCancellation,isMobileDevice:s.isMobileDevice,fileCardFor:t.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:t.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:t.containerWidth,containerHeight:t.containerHeight,areInsidesReadyToBeVisible:t.areInsidesReadyToBeVisible,isTargetDOMEl:this.isTargetDOMEl,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:t.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,ea,{writable:!0,value:()=>{(this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t?t.mount(this,t):this.uppy.log(`[Uppy] Dashboard could not find plugin '${e}', make sure to uppy.use() the plugins you are specifying`,"warning")}))}}),Object.defineProperty(this,ta,{writable:!0,value:()=>{this.uppy.iteratePlugins(jo(this,ia)[ia])}}),Object.defineProperty(this,ia,{writable:!0,value:e=>{var t;!e||null!=(t=e.opts)&&t.target||!["acquirer","editor"].includes(e.type)||this.getPluginState().targets.some((t=>e.id===t.id))||e.mount(this,e)}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:!1,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:e,closeAfterFinish:t}=this.opts;if(e&&t)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.");const{allowMultipleUploads:i,allowMultipleUploadBatches:s}=this.uppy.opts;(i||s)&&t&&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");const{target:r}=this.opts;r&&this.mount(r,this),this.opts.disableStatusBar||this.uppy.use(ri,{id:`${this.id}:StatusBar`,target:this,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,showProgressDetails:this.opts.showProgressDetails,hideAfterFinish:this.opts.hideProgressAfterFinish,locale:this.opts.locale,doneButtonHandler:this.opts.doneButtonHandler}),this.opts.disableInformer||this.uppy.use(hi,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(As,{id:`${this.id}:ThumbnailGenerator`,thumbnailWidth:this.opts.thumbnailWidth,thumbnailHeight:this.opts.thumbnailHeight,thumbnailType:this.opts.thumbnailType,waitForThumbnailsBeforeUpload:this.opts.waitForThumbnailsBeforeUpload,lazy:!this.opts.waitForThumbnailsBeforeUpload}),this.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const n=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;this.uppy.log("[Dashboard] Dark mode is "+(n?"on":"off")),this.setDarkModeCapability(n),"auto"===this.opts.theme&&this.darkModeMediaQuery.addListener(this.handleSystemDarkModeChange),jo(this,ea)[ea](),jo(this,ta)[ta](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){const e=this.uppy.getPlugin(`${this.id}:Informer`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableStatusBar){const e=this.uppy.getPlugin(`${this.id}:StatusBar`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableThumbnailGenerator){const e=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);e&&this.uppy.removePlugin(e)}(this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.unmount()})),"auto"===this.opts.theme&&this.darkModeMediaQuery.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.modalName=`uppy-Dashboard-${p()}`,this.defaultLocale=zo;const s={target:"body",metaFields:[],trigger:null,inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Sn,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,doneButtonHandler:()=>{this.uppy.clearUploadedFiles(),this.requestCloseModal()},note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,onRequestCloseModal:()=>this.closeModal(),showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1};this.opts={...s,...t},this.i18nInit(),this.superFocus=function(){let e=!1;return Xn(((t,i)=>{const s=Wn(t,i),r=s.contains(document.activeElement);if(r&&e)return;const n=s.querySelector("[data-uppy-super-focusable]");if(!r||n)if(n)n.focus({preventScroll:!0}),e=!0;else{const t=s.querySelector(Vn);null==t||t.focus({preventScroll:!0}),e=!1}}),260)}(),this.ifFocusedOnUppyRecently=!1,this.makeDashboardInsidesVisibleAnywayTimeout=null,this.removeDragOverClassTimeout=null}}function ra(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}sa.VERSION="3.7.5";var na=0;function oa(e){return"__private_"+na+++"_"+e}var aa=oa("uppy"),la=oa("events");class ua{constructor(e){Object.defineProperty(this,aa,{writable:!0,value:void 0}),Object.defineProperty(this,la,{writable:!0,value:[]}),ra(this,aa)[aa]=e}on(e,t){return ra(this,la)[la].push([e,t]),ra(this,aa)[aa].on(e,t)}remove(){for(const[e,t]of ra(this,la)[la].splice(0))ra(this,aa)[aa].off(e,t)}onFilePause(e,t){this.on("upload-pause",((i,s)=>{e===i&&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&&t(s)}))}onRetry(e,t){this.on("upload-retry",(i=>{e===i&&t()}))}onRetryAll(e,t){this.on("retry-all",(()=>{ra(this,aa)[aa].getFile(e)&&t()}))}onPauseAll(e,t){this.on("pause-all",(()=>{ra(this,aa)[aa].getFile(e)&&t()}))}onCancelAll(e,t){var i=this;this.on("cancel-all",(function(){ra(i,aa)[aa].getFile(e)&&t(...arguments)}))}onResumeAll(e,t){this.on("resume-all",(()=>{ra(this,aa)[aa].getFile(e)&&t()}))}}function da(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var ha=0;function pa(e){return"__private_"+ha+++"_"+e}var ca=pa("aliveTimer"),fa=pa("isDone"),ma=pa("onTimedOut"),ga=pa("timeout");const ya=class{constructor(e,t){Object.defineProperty(this,ca,{writable:!0,value:void 0}),Object.defineProperty(this,fa,{writable:!0,value:!1}),Object.defineProperty(this,ma,{writable:!0,value:void 0}),Object.defineProperty(this,ga,{writable:!0,value:void 0}),da(this,ga)[ga]=e,da(this,ma)[ma]=t}progress(){da(this,fa)[fa]||da(this,ga)[ga]>0&&(clearTimeout(da(this,ca)[ca]),da(this,ca)[ca]=setTimeout(da(this,ma)[ma],da(this,ga)[ga]))}done(){da(this,fa)[fa]||(clearTimeout(da(this,ca)[ca]),da(this,ca)[ca]=void 0,da(this,fa)[fa]=!0)}};function va(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var ba=0;function wa(e){return"__private_"+ba+++"_"+e}function _a(e){if(null!=e){var t;const i=()=>this.abort(e.reason);e.addEventListener("abort",i,{once:!0});const s=()=>{e.removeEventListener("abort",i)};null==(t=this.then)||t.call(this,s,s)}return this}var Fa=wa("activeRequests"),Pa=wa("queuedHandlers"),Sa=wa("paused"),Ca=wa("pauseTimer"),ka=wa("downLimit"),Ta=wa("upperLimit"),Oa=wa("rateLimitingTimer"),Ea=wa("call"),Aa=wa("queueNext"),xa=wa("next"),Da=wa("queue"),Na=wa("dequeue"),Ua=wa("resume"),Ia=wa("increaseLimit");class Ba{constructor(e){Object.defineProperty(this,Na,{value:ja}),Object.defineProperty(this,Da,{value:za}),Object.defineProperty(this,xa,{value:La}),Object.defineProperty(this,Aa,{value:Ma}),Object.defineProperty(this,Ea,{value:Ra}),Object.defineProperty(this,Fa,{writable:!0,value:0}),Object.defineProperty(this,Pa,{writable:!0,value:[]}),Object.defineProperty(this,Sa,{writable:!0,value:!1}),Object.defineProperty(this,Ca,{writable:!0,value:void 0}),Object.defineProperty(this,ka,{writable:!0,value:1}),Object.defineProperty(this,Ta,{writable:!0,value:void 0}),Object.defineProperty(this,Oa,{writable:!0,value:void 0}),Object.defineProperty(this,Ua,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,Ia,{writable:!0,value:()=>{if(va(this,Sa)[Sa])va(this,Oa)[Oa]=setTimeout(va(this,Ia)[Ia],0);else{va(this,ka)[ka]=this.limit,this.limit=Math.ceil((va(this,Ta)[Ta]+va(this,ka)[ka])/2);for(let e=va(this,ka)[ka];e<=this.limit;e++)va(this,Aa)[Aa]();va(this,Ta)[Ta]-va(this,ka)[ka]>3?va(this,Oa)[Oa]=setTimeout(va(this,Ia)[Ia],2e3):va(this,ka)[ka]=Math.floor(va(this,ka)[ka]/2)}}}),this.limit="number"!=typeof e||0===e?1/0:e}run(e,t){return!va(this,Sa)[Sa]&&va(this,Fa)[Fa]<this.limit?va(this,Ea)[Ea](e):va(this,Da)[Da](e,t)}wrapSyncFunction(e,t){var i=this;return function(){for(var s=arguments.length,r=new Array(s),n=0;n<s;n++)r[n]=arguments[n];const o=i.run((()=>(e(...r),queueMicrotask((()=>o.done())),()=>{})),t);return{abortOn:_a,abort(){o.abort()}}}}wrapPromiseFunction(e,t){var i=this;return function(){for(var s=arguments.length,r=new Array(s),n=0;n<s;n++)r[n]=arguments[n];let o;const a=new Promise(((s,n)=>{o=i.run((()=>{let t,i;try{i=Promise.resolve(e(...r))}catch(e){i=Promise.reject(e)}return i.then((e=>{t?n(t):(o.done(),s(e))}),(e=>{t?n(t):(o.done(),n(e))})),e=>{t=function(e){return new Error("Cancelled",{cause:e})}(e)}}),t)}));return a.abort=e=>{o.abort(e)},a.abortOn=_a,a}}resume(){va(this,Sa)[Sa]=!1,clearTimeout(va(this,Ca)[Ca]);for(let e=0;e<this.limit;e++)va(this,Aa)[Aa]()}pause(e){void 0===e&&(e=null),va(this,Sa)[Sa]=!0,clearTimeout(va(this,Ca)[Ca]),null!=e&&(va(this,Ca)[Ca]=setTimeout(va(this,Ua)[Ua],e))}rateLimit(e){clearTimeout(va(this,Oa)[Oa]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(va(this,Ta)[Ta]=this.limit-1,this.limit=va(this,ka)[ka],va(this,Oa)[Oa]=setTimeout(va(this,Ia)[Ia],e))}get isPaused(){return va(this,Sa)[Sa]}}function Ra(e){va(this,Fa)[Fa]+=1;let t,i=!1;try{t=e()}catch(e){throw va(this,Fa)[Fa]-=1,e}return{abort:e=>{i||(i=!0,va(this,Fa)[Fa]-=1,null==t||t(e),va(this,Aa)[Aa]())},done:()=>{i||(i=!0,va(this,Fa)[Fa]-=1,va(this,Aa)[Aa]())}}}function Ma(){queueMicrotask((()=>va(this,xa)[xa]()))}function La(){if(va(this,Sa)[Sa]||va(this,Fa)[Fa]>=this.limit)return;if(0===va(this,Pa)[Pa].length)return;const e=va(this,Pa)[Pa].shift(),t=va(this,Ea)[Ea](e.fn);e.abort=t.abort,e.done=t.done}function za(e,t){void 0===t&&(t={});const i={fn:e,priority:t.priority||0,abort:()=>{va(this,Na)[Na](i)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},s=va(this,Pa)[Pa].findIndex((e=>i.priority>e.priority));return-1===s?va(this,Pa)[Pa].push(i):va(this,Pa)[Pa].splice(s,0,i),i}function ja(e){const t=va(this,Pa)[Pa].indexOf(e);-1!==t&&va(this,Pa)[Pa].splice(t,1)}const $a=Symbol("__queue");class qa extends Error{constructor(e,t){void 0===t&&(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}}const Ha=qa,Va=function(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)},Wa={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Ga(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Ka=0;function Xa(e){return"__private_"+Ka+++"_"+e}function Ya(e,t){let i=t;return i||(i=new Error("Upload error")),"string"==typeof i&&(i=new Error(i)),i instanceof Error||(i=Object.assign(new Error("Upload error"),{data:i})),Va(e)?(i=new Ha(i,e),i):(i.request=e,i)}function Qa(e){return e.data.slice(0,e.data.size,e.meta.type)}const Ja={formData:!0,fieldName:"file",method:"post",allowedMetaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:"",getResponseData(e){let t={};try{t=JSON.parse(e)}catch{}return t},getResponseError(e,t){let i=new Error("Upload error");return Va(t)&&(i=new Ha(i,t)),i},validateStatus:e=>e>=200&&e<300};var Za=Xa("uploadLocalFile"),el=Xa("uploadBundle"),tl=Xa("getCompanionClientArgs"),il=Xa("uploadFiles"),sl=Xa("handleUpload");class rl extends ct{constructor(e,t){if(super(e,{...Ja,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,il,{value:ll}),Object.defineProperty(this,tl,{value:al}),Object.defineProperty(this,el,{value:ol}),Object.defineProperty(this,Za,{value:nl}),Object.defineProperty(this,sl,{writable:!0,value:async e=>{if(0===e.length)return void this.uppy.log("[XHRUpload] No files to upload!");0!==this.opts.limit||this.opts[$a]||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...");const t=this.uppy.getFilesByIds(e).filter((e=>!(e=>"error"in e&&!!e.error)(e))),i=function(e){return e.filter((e=>{var t;return!(null!=(t=e.progress)&&t.uploadStarted&&e.isRestored)}))}(t);if(this.uppy.emit("upload-start",i),this.opts.bundle){if(t.some((e=>e.isRemote)))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await Ga(this,el)[el](t)}else await Ga(this,il)[il](t)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=Wa,this.i18nInit(),$a in this.opts?this.requests=this.opts[$a]:this.requests=new Ba(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&&"function"==typeof this.opts.headers)throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(void 0===(null==t?void 0:t.allowedMetaFields)&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null)}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:i}=this.opts,s={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof i?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){(Array.isArray(i.allowedMetaFields)?i.allowedMetaFields:Object.keys(t)).forEach((i=>{const s=t[i];Array.isArray(s)?s.forEach((t=>e.append(i,t))):e.append(i,s)}))}createFormDataUpload(e,t){const i=new FormData;this.addMetadata(i,e.meta,t);const s=Qa(e);return e.name?i.append(t.fieldName,s,e.meta.name):i.append(t.fieldName,s),i}createBundledUpload(e,t){const i=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(i,s,t),e.forEach((e=>{const t=this.getOptions(e),s=Qa(e);e.name?i.append(t.fieldName,s,e.name):i.append(t.fieldName,s)})),i}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(Ga(this,sl)[sl])}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(Ga(this,sl)[sl])}}async function nl(e,t,i){const s=this.getOptions(e),r=Date.now();return this.uppy.log(`uploading ${t} of ${i}`),new Promise(((t,i)=>{const n=s.formData?this.createFormDataUpload(e,s):e.data,o=new XMLHttpRequest,a=new ua(this.uppy);let l;this.uploaderEvents[e.id]=a;const u=new ya(s.timeout,(()=>{const t=new Error(this.i18n("uploadStalled",{seconds:Math.ceil(s.timeout/1e3)}));this.uppy.emit("upload-stalled",t,[e])})),d=p();o.upload.addEventListener("loadstart",(()=>{this.uppy.log(`[XHRUpload] ${d} started`)})),o.upload.addEventListener("progress",(t=>{this.uppy.log(`[XHRUpload] ${d} progress: ${t.loaded} / ${t.total}`),u.progress(),t.lengthComputable&&this.uppy.emit("upload-progress",this.uppy.getFile(e.id),{uploader:this,uploadStarted:r,bytesUploaded:t.loaded,bytesTotal:t.total})})),o.addEventListener("load",(()=>{if(this.uppy.log(`[XHRUpload] ${d} finished`),u.done(),l.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null),s.validateStatus(o.status,o.responseText,o)){const i=s.getResponseData(o.responseText,o),r=null==i?void 0:i[s.responseUrlFieldName],n={status:o.status,body:i,uploadURL:r};return this.uppy.emit("upload-success",this.uppy.getFile(e.id),n),r&&this.uppy.log(`Download ${e.name} from ${r}`),t(e)}const r=s.getResponseData(o.responseText,o),n=Ya(o,s.getResponseError(o.responseText,o)),a={status:o.status,body:r};return this.uppy.emit("upload-error",e,n,a),i(n)})),o.addEventListener("error",(()=>{this.uppy.log(`[XHRUpload] ${d} errored`),u.done(),l.done(),this.uploaderEvents[e.id]&&(this.uploaderEvents[e.id].remove(),this.uploaderEvents[e.id]=null);const t=Ya(o,s.getResponseError(o.responseText,o));return this.uppy.emit("upload-error",e,t),i(t)})),o.open(s.method.toUpperCase(),s.endpoint,!0),o.withCredentials=s.withCredentials,""!==s.responseType&&(o.responseType=s.responseType),l=this.requests.run((()=>{const t=this.getOptions(e);return Object.keys(t.headers).forEach((e=>{o.setRequestHeader(e,t.headers[e])})),o.send(n),()=>{u.done(),o.abort()}})),a.onFileRemove(e.id,(()=>{l.abort(),i(new Error("File removed"))})),a.onCancelAll(e.id,(e=>{let{reason:t}=e;"user"===t&&l.abort(),i(new Error("Upload cancelled"))}))}))}function ol(e){return new Promise(((t,i)=>{const{endpoint:s}=this.opts,{method:r}=this.opts,n=Date.now(),o=this.uppy.getState().xhrUpload,a=this.createBundledUpload(e,{...this.opts,...o||{}}),l=new XMLHttpRequest,u=t=>{e.forEach((e=>{this.uppy.emit("upload-error",e,t)}))},d=new ya(this.opts.timeout,(()=>{const t=new Error(this.i18n("uploadStalled",{seconds:Math.ceil(this.opts.timeout/1e3)}));this.uppy.emit("upload-stalled",t,e)}));l.upload.addEventListener("loadstart",(()=>{this.uppy.log("[XHRUpload] started uploading bundle"),d.progress()})),l.upload.addEventListener("progress",(t=>{d.progress(),t.lengthComputable&&e.forEach((e=>{this.uppy.emit("upload-progress",this.uppy.getFile(e.id),{uploader:this,uploadStarted:n,bytesUploaded:t.loaded/t.total*e.size,bytesTotal:e.size})}))})),l.addEventListener("load",(()=>{if(d.done(),this.opts.validateStatus(l.status,l.responseText,l)){const i=this.opts.getResponseData(l.responseText,l),s={status:l.status,body:i};return e.forEach((e=>{this.uppy.emit("upload-success",this.uppy.getFile(e.id),s)})),t()}const s=this.opts.getResponseError(l.responseText,l)||new Ha("Upload error",l);return u(s),i(s)})),l.addEventListener("error",(()=>{d.done();const e=this.opts.getResponseError(l.responseText,l)||new Error("Upload error");return u(e),i(e)})),this.uppy.on("cancel-all",(function(e){let{reason:t}=void 0===e?{}:e;"user"===t&&(d.done(),l.abort())})),l.open(r.toUpperCase(),s,!0),l.withCredentials=this.opts.withCredentials,""!==this.opts.responseType&&(l.responseType=this.opts.responseType);const h=this.opts.headers;Object.keys(h).forEach((e=>{l.setRequestHeader(e,h[e])})),l.send(a)}))}function al(e){var t;const i=this.getOptions(e),s=Array.isArray(i.allowedMetaFields)?i.allowedMetaFields:Object.keys(e.meta);return{...null==(t=e.remote)?void 0:t.body,protocol:"multipart",endpoint:i.endpoint,size:e.data.size,fieldname:i.fieldName,metadata:Object.fromEntries(s.map((t=>[t,e.meta[t]]))),httpMethod:i.method,useFormData:i.formData,headers:i.headers}}async function ll(e){await Promise.allSettled(e.map(((t,i)=>{const s=i+1,r=e.length;if(t.isRemote){const e=()=>this.requests,i=new AbortController,s=e=>{e.id===t.id&&i.abort()};this.uppy.on("file-removed",s);const r=this.uppy.getRequestClientForFile(t).uploadRemoteFile(t,Ga(this,tl)[tl](t),{signal:i.signal,getQueue:e});return this.requests.wrapSyncFunction((()=>{this.uppy.off("file-removed",s)}),{priority:-1})(),r}return Ga(this,Za)[Za](t,s,r)})))}function ul(e){return ul="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ul(e)}function dl(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function hl(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?dl(Object(i),!0).forEach((function(t){var s,r,n;s=e,r=t,n=i[t],r=function(e){var t=function(e,t){if("object"!=ul(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var s=i.call(e,"string");if("object"!=ul(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ul(t)?t:String(t)}(r),r in s?Object.defineProperty(s,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[r]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):dl(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}rl.VERSION="3.6.4",new Ce({onBeforeFileAdded:function(e,t){var i=((new Date).getMonth()+1).toString().padStart(2,"0"),s=(new Date).getDate().toString().padStart(2,"0"),r=e.name.replace(/,/g,""),n="".concat((new Date).getFullYear(),"-").concat(i,"-").concat(s,"_").concat(Date.now()," - ").concat(r);return hl(hl({},e),{},{meta:hl(hl({},e.meta),{},{name:n}),name:n})}}).use(sa,{inline:!0,target:"#drag-drop-area",width:"100%",height:300}).use(rl,{endpoint:"/activities/upload",method:"post"}).on("complete",(function(e){for(var t=e.successful,i=[],s=0;s<t.length;s++){var r=e.successful[s].name;i.push(r)}var n=i.join();$("#attachment").val((function(){return""==this.value?this.value+n:""!=this.value?this.value+","+n:void 0})),console.log("Upload complete! We’ve uploaded these files:",e.successful)}))})()})(); |