import{c as e}from"./_commonjsHelpers.a5007c1f.js";import{Q as t,bD as i,e as s,a6 as n,Y as r,a4 as a}from"./index.3938ccd1.js";import{_ as o}from"./plugin-vue_export-helper.21dcd24c.js";function l(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var h=0;function p(e){return"__private_"+h+++"_"+e}function d(e,t,i){const s=[];return e.forEach((e=>"string"!=typeof e?s.push(e):t[Symbol.split](e).forEach(((e,t,n)=>{""!==e&&s.push(e),t<n.length-1&&s.push(i)})))),s}
/**
 * Takes a string with placeholder variables like `%{smart_count} file selected`
 * and replaces it with values from options `{smart_count: 5}`
 *
 * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
 * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
 *
 * @param phrase that needs interpolation, with placeholders
 * @param options with values that will be used to replace placeholders
 */function u(e,t){const i=/\$/g;let s=[e];if(null==t)return s;for(const n of Object.keys(t))if("_"!==n){let e=t[n];"string"==typeof e&&(e=i[Symbol.replace](e,"$$$$")),s=d(s,new RegExp(`%\\{${n}\\}`,"g"),e)}return s}const c=e=>{throw new Error(`missing string: ${e}`)};var f=p("onMissingKey"),m=p("apply");class g{constructor(e,t){let{onMissingKey:i=c}=void 0===t?{}:t;Object.defineProperty(this,m,{value:y}),Object.defineProperty(this,f,{writable:!0,value:void 0}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(l(this,m)[m],this):l(this,m)[m](e),l(this,f)[f]=i}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let i=this.locale.strings[e];null==i&&(l(this,f)[f](e),i=e);if("object"==typeof i){if(t&&void 0!==t.smart_count){return u(i[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof i)throw new Error("string was not a string");return u(i,t)}}function y(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 v=function(){var e={},t=e._fns={};return e.emit=function(e,i,s,n,r,a,o){var l=function(e){var i=t[e]?t[e]:[],s=e.indexOf(":"),n=-1===s?[e]:[e.substring(0,s),e.substring(s+1)],r=Object.keys(t),a=0,o=r.length;for(;a<o;a++){var l=r[a];if("*"===l&&(i=i.concat(t[l])),2===n.length&&n[0]===l){i=i.concat(t[l]);break}}return i}(e);l.length&&function(e,t,i){var s=0,n=t.length;for(;s<n&&t[s];s++)t[s].event=e,t[s].apply(t[s],i)}(e,l,[i,s,n,r,a,o])},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],n=0,r=s?s.length:0;n<r;n++)s[n]!==t&&i.push(s[n]);i.length?this._fns[e]=i:delete this._fns[e]},e};let b=(e=21)=>{let t="",i=e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};var w=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},_="object"==typeof e&&e&&e.Object===Object&&e,F="object"==typeof self&&self&&self.Object===Object&&self,C=_||F||Function("return this")(),S=C,P=function(){return S.Date.now()},x=/\s/;var O=function(e){for(var t=e.length;t--&&x.test(e.charAt(t)););return t},D=/^\s+/;var k=function(e){return e?e.slice(0,O(e)+1).replace(D,""):e},T=C.Symbol,E=T,A=Object.prototype,M=A.hasOwnProperty,N=A.toString,U=E?E.toStringTag:void 0;var B=function(e){var t=M.call(e,U),i=e[U];try{e[U]=void 0;var s=!0}catch(r){}var n=N.call(e);return s&&(t?e[U]=i:delete e[U]),n},I=Object.prototype.toString;var R=B,z=function(e){return I.call(e)},L=T?T.toStringTag:void 0;var j=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":L&&L in Object(e)?R(e):z(e)},H=function(e){return null!=e&&"object"==typeof e};var q=k,W=w,$=function(e){return"symbol"==typeof e||H(e)&&"[object Symbol]"==j(e)},V=/^[-+]0x[0-9a-f]+$/i,X=/^0b[01]+$/i,G=/^0o[0-7]+$/i,Y=parseInt;var K=w,Q=P,Z=function(e){if("number"==typeof e)return e;if($(e))return NaN;if(W(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=W(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=q(e);var i=X.test(e);return i||G.test(e)?Y(e.slice(2),i?2:8):V.test(e)?NaN:+e},J=Math.max,ee=Math.min;var te=function(e,t,i){var s,n,r,a,o,l,h=0,p=!1,d=!1,u=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function c(t){var i=s,r=n;return s=n=void 0,h=t,a=e.apply(r,i)}function f(e){return h=e,o=setTimeout(g,t),p?c(e):a}function m(e){var i=e-l;return void 0===l||i>=t||i<0||d&&e-h>=r}function g(){var e=Q();if(m(e))return y(e);o=setTimeout(g,function(e){var i=t-(e-l);return d?ee(i,r-(e-h)):i}(e))}function y(e){return o=void 0,u&&s?c(e):(s=n=void 0,a)}function v(){var e=Q(),i=m(e);if(s=arguments,n=this,l=e,i){if(void 0===o)return f(l);if(d)return clearTimeout(o),o=setTimeout(g,t),c(l)}return void 0===o&&(o=setTimeout(g,t)),a}return t=Z(t)||0,K(i)&&(p=!!i.leading,r=(d="maxWait"in i)?J(Z(i.maxWait)||0,t):r,u="trailing"in i?!!i.trailing:u),v.cancel=function(){void 0!==o&&clearTimeout(o),h=0,s=l=n=o=void 0},v.flush=function(){return void 0===o?a:y(Q())},v},ie=te,se=w;var ne=function(e,t,i){var s=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return se(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),ie(e,t,{leading:s,maxWait:t,trailing:n})};function re(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var ae=0;function oe(e){return"__private_"+ae+++"_"+e}var le=oe("callbacks"),he=oe("publish");class pe{constructor(){Object.defineProperty(this,he,{value:de}),this.state={},Object.defineProperty(this,le,{writable:!0,value:new Set})}getState(){return this.state}setState(e){const t={...this.state},i={...this.state,...e};this.state=i,re(this,he)[he](t,i,e)}subscribe(e){return re(this,le)[le].add(e),()=>{re(this,le)[le].delete(e)}}}function de(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];re(this,le)[le].forEach((e=>{e(...t)}))}function ue(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)}}pe.VERSION="3.2.2";var ce={__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 fe(e){var t;if(e.type)return e.type;const i=e.name?null==(t=ue(e.name).extension)?void 0:t.toLowerCase():null;return i&&i in ce?ce[i]:"application/octet-stream"}function me(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/")))+t}function ge(e,t){if(function(e){return!(!e.isRemote||!e.remote)&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider)}(e))return e.id;const i=fe(e);return function(e,t){let i=t||"uppy";return"string"==typeof e.name&&(i+=`-${me(e.name.toLowerCase())}`),void 0!==e.type&&(i+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(i+=`-${me(e.meta.relativePath.toLowerCase())}`),void 0!==e.data.size&&(i+=`-${e.data.size}`),void 0!==e.data.lastModified&&(i+=`-${e.data.lastModified}`),i}({...e,type:i},t)}function ye(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),n=parseInt(i[1],10);return s<15||15===s&&n<15063||(s>18||18===s&&n>=18218)}const ve={debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i]}},be={debug:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i]},warn:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i]},error:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i]}};var we=function(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("Expected a number, got "+typeof e);const t=e<0;let i=Math.abs(e);if(t&&(i=-i),0===i)return"0 B";const s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(i)/Math.log(1024)),s.length-1),r=Number(i/1024**n),a=s[n];return`${r>=10||r%1==0?Math.round(r):r.toFixed(1)} ${a}`};function _e(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}_e.prototype.match=function(e){var t,i,s=!0,n=this.parts,r=n.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(i=(e||"").split(this.separator),t=0;s&&t<r;t++)"*"!==n[t]&&(s=t<i.length&&n[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 a in s={},e)this.match(a)&&(s[a]=e[a]);return s};var Fe=function(e,t,i){var s=new _e(e,i||/[\/\.]/);return void 0!==t?s.match(t):s},Ce=/[\/\+\.]/;const Se={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class Pe 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 xe{constructor(e,t){this.getI18n=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){if(e.filter((e=>!e.isGhost)).length+t.length>s)throw new Pe(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`)}if(i){const s=[...e,...t].reduce(((e,t)=>{var i;return e+(null!=(i=t.size)?i:0)}),0);if(s>i)throw new Pe(this.getI18n()("aggregateExceedsSize",{sizeAllowed:we(i),size:we(s)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:i,allowedFileTypes:s}=this.getOpts().restrictions;if(s){if(!s.some((t=>t.includes("/")?!!e.type&&function(e,t){function i(t){var i=Fe(t,e,Ce);return i&&i.length>=2}return t?i(t.split(";")[0]):i}(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.slice(1).toLowerCase()))){const t=s.join(", ");throw new Pe(this.getI18n()("youCanOnlyUploadFileTypes",{types:t}),{file:e})}}if(t&&null!=e.size&&e.size>t)throw new Pe(this.getI18n()("exceedsSize",{size:we(t),file:e.name}),{file:e});if(i&&null!=e.size&&e.size<i)throw new Pe(this.getI18n()("inferiorSize",{size:we(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 Pe(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new Pe(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name})),{requiredMetaFields:i}=this.getOpts().restrictions,s=[];for(const n of i)Object.hasOwn(e.meta,n)&&""!==e.meta[n]||s.push(n);return{missingFields:s,error:t}}}var Oe={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed"}};let De,ke;function Te(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Ee=0;function Ae(e){return"__private_"+Ee+++"_"+e}const Me={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var Ne=Ae("plugins"),Ue=Ae("restricter"),Be=Ae("storeUnsubscribe"),Ie=Ae("emitter"),Re=Ae("preProcessors"),ze=Ae("uploaders"),Le=Ae("postProcessors"),je=Ae("informAndEmit"),He=Ae("checkRequiredMetaFieldsOnFile"),qe=Ae("checkRequiredMetaFields"),We=Ae("assertNewUploadAllowed"),$e=Ae("transformFile"),Ve=Ae("startIfAutoProceed"),Xe=Ae("checkAndUpdateFileState"),Ge=Ae("addListeners"),Ye=Ae("updateOnlineStatus"),Ke=Ae("requestClientById"),Qe=Ae("createUpload"),Ze=Ae("getUpload"),Je=Ae("removeUpload"),et=Ae("runUpload");De=Symbol.for("uppy test: getPlugins"),ke=Symbol.for("uppy test: createUpload");class tt{constructor(e){Object.defineProperty(this,et,{value:ct}),Object.defineProperty(this,Je,{value:ut}),Object.defineProperty(this,Ze,{value:dt}),Object.defineProperty(this,Qe,{value:pt}),Object.defineProperty(this,Ge,{value:ht}),Object.defineProperty(this,Xe,{value:lt}),Object.defineProperty(this,Ve,{value:ot}),Object.defineProperty(this,$e,{value:at}),Object.defineProperty(this,We,{value:rt}),Object.defineProperty(this,qe,{value:nt}),Object.defineProperty(this,He,{value:st}),Object.defineProperty(this,je,{value:it}),Object.defineProperty(this,Ne,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,Ue,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),Object.defineProperty(this,Ie,{writable:!0,value:v()}),Object.defineProperty(this,Re,{writable:!0,value:new Set}),Object.defineProperty(this,ze,{writable:!0,value:new Set}),Object.defineProperty(this,Le,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,this.calculateProgress=ne(((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,Ye,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,Ke,{writable:!0,value:new Map}),this.defaultLocale=Oe;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Se,meta:{},onBeforeFileAdded:(e,t)=>!Object.hasOwn(t,e.id),onBeforeUpload:e=>e,store:new pe,logger:ve,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=be),this.log(`Using Core v${tt.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Me,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:ye(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),Te(this,Ue)[Ue]=new xe((()=>this.opts),(()=>this.i18n)),Te(this,Be)[Be]=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),Te(this,Ge)[Ge]()}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];Te(this,Ie)[Ie].emit(e,...i)}on(e,t){return Te(this,Ie)[Ie].on(e,t),this}once(e,t){return Te(this,Ie)[Ie].once(e,t),this}off(e,t){return Te(this,Ie)[Ie].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 g([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,...Me}),this.emit("reset-progress")}clearUploadedFiles(){const{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Me,files:{}})}addPreProcessor(e){Te(this,Re)[Re].add(e)}removePreProcessor(e){return Te(this,Re)[Re].delete(e)}addPostProcessor(e){Te(this,Le)[Le].add(e)}removePostProcessor(e){return Te(this,Le)[Le].delete(e)}addUploader(e){Te(this,ze)[ze].add(e)}removeUploader(e){return Te(this,ze)[ze].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),n=[],r=[],a=[],o=[],l=[],h=[],p=[],d=[],u=[];for(const c of s){const{progress:e}=c;!e.uploadComplete&&e.uploadStarted&&(n.push(c),c.isPaused||d.push(c)),e.uploadStarted||r.push(c),(e.uploadStarted||e.preprocess||e.postprocess)&&a.push(c),e.uploadStarted&&o.push(c),c.isPaused&&l.push(c),e.uploadComplete&&h.push(c),c.error&&p.push(c),(e.preprocess||e.postprocess)&&u.push(c)}return{newFiles:r,startedFiles:a,uploadStartedFiles:o,pausedFiles:l,completeFiles:h,erroredFiles:p,inProgressFiles:n,inProgressNotPausedFiles:d,processingFiles:u,isUploadStarted:o.length>0,isAllComplete:100===t&&h.length===s.length&&0===u.length,isAllErrored:!!i&&p.length===s.length,isAllPaused:0!==n.length&&l.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some((e=>e.isGhost))}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{Te(this,Ue)[Ue].validate(t,[e])}catch(i){return i}return null}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){Te(this,We)[We](e);const{nextFilesState:t,validFilesToAdd:i,errors:s}=Te(this,Xe)[Xe]([e]),n=s.filter((e=>e.isRestriction));if(Te(this,je)[je](n),s.length>0)throw s[0];this.setState({files:t});const[r]=i;return this.emit("file-added",r),this.emit("files-added",i),this.log(`Added file: ${r.name}, ${r.id}, mime type: ${r.type}`),Te(this,Ve)[Ve](),r.id}addFiles(e){Te(this,We)[We]();const{nextFilesState:t,validFilesToAdd:i,errors:s}=Te(this,Xe)[Xe](e),n=s.filter((e=>e.isRestriction));Te(this,je)[je](n);const r=s.filter((e=>!e.isRestriction));if(r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach((t=>{e+=`\n * ${t.message}`})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,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&&Te(this,Ve)[Ve]()}removeFiles(e,t){const{files:i,currentUploads:s}=this.getState(),n={...i},r={...s},a=Object.create(null);function o(e){return void 0===a[e]}e.forEach((e=>{i[e]&&(a[e]=i[e],delete n[e])})),Object.keys(r).forEach((e=>{const t=s[e].fileIDs.filter(o);if(0===t.length)return void delete r[e];const{capabilities:i}=this.getState();if(t.length!==s[e].fileIDs.length&&!i.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");r[e]={...s[e],fileIDs:t}}));const l={currentUploads:r,files:n};0===Object.keys(n).length&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();const h=Object.keys(a);h.forEach((e=>{this.emit("file-removed",a[e],t)})),h.length>5?this.log(`Removed ${h.length} files`):this.log(`Removed files: ${h.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||!1);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=Te(this,Qe)[Qe](t,{forceAllowNewUpload:!0});return Te(this,et)[et](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(Me)}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=Te(this,Qe)[Qe]([e],{forceAllowNewUpload:!0});return Te(this,et)[et](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),n=Math.round(s/t*100);return void this.setState({totalProgress:n})}let s=t.reduce(((e,t)=>{var i;return e+(null!=(i=t.progress.bytesTotal)?i:0)}),0);const n=s/t.length;s+=n*i.length;let r=0;t.forEach((e=>{r+=e.progress.bytesUploaded})),i.forEach((e=>{r+=n*(e.progress.percentage||0)/100}));let a=0===s?0:Math.round(r/s*100);a>100&&(a=100),this.setState({totalProgress:a}),this.emit("progress",a)}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 n=this.getPlugin(s);if(n){const e=`Already found a plugin named '${n.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 Te(this,Ne)[Ne]?Te(this,Ne)[Ne][i.type].push(i):Te(this,Ne)[Ne][i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(const t of Object.values(Te(this,Ne)[Ne])){const i=t.find((t=>t.id===e));if(null!=i)return i}}[De](e){return Te(this,Ne)[Ne][e]}iteratePlugins(e){Object.values(Te(this,Ne)[Ne]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=Te(this,Ne)[Ne][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}),Te(this,Be)[Be](),this.iteratePlugins((e=>{this.removePlugin(e)})),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",Te(this,Ye)[Ye]),window.removeEventListener("offline",Te(this,Ye)[Ye]))}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){Te(this,Ke)[Ke].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=Te(this,Ke)[Ke].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]?Te(this,et)[et](e):(Te(this,Je)[Je](e),Promise.reject(new Error("Nonexistent upload")))}[ke](){return Te(this,Qe)[Qe](...arguments)}addResultData(e,t){if(!Te(this,Ze)[Ze](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=Te(this,Ne)[Ne].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((()=>Te(this,Ue)[Ue].validateMinNumberOfFiles(t))).catch((e=>{throw Te(this,je)[je]([e]),e})).then((()=>{if(!Te(this,qe)[qe](t))throw new Pe(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 n=Te(this,Qe)[Qe](s);return Te(this,et)[et](n)})).catch((e=>{throw this.emit("error",e),this.log(e,"error"),e})))}}function it(e){for(const n of e)n.isRestriction?this.emit("restriction-failed",n.file,n):this.emit("error",n,n.file),this.log(n,"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 st(e){const{missingFields:t,error:i}=Te(this,Ue)[Ue].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(i.message),this.emit("restriction-failed",e,i),!1)}function nt(e){let t=!0;for(const i of Object.values(e))Te(this,He)[He](i)||(t=!1);return t}function rt(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new Pe(this.i18n("noMoreFilesAllowed"),{file:e});throw Te(this,je)[je]([t]),t}}function at(e){const t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e}:e,i=fe(t),s=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}(i,t),n=ue(s).extension,r=ge(t,this.getID()),a=t.meta||{};a.name=s,a.type=i;const o=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:r,name:s,extension:n||"",meta:{...this.getState().meta,...a},type:i,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:o,uploadComplete:!1,uploadStarted:null},size:o,isGhost:!1,isRemote:t.isRemote||!1,remote:t.remote||"",preview:t.preview}}function ot(){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 lt(e){const{files:t}=this.getState(),i={...t},s=[],n=[];for(const o of e)try{var r;let e=Te(this,$e)[$e](o);const n=null==(r=t[e.id])?void 0:r.isGhost;if(n){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 Pe(this.i18n("noDuplicates",{fileName:e.name}),{file:o});if(!1===a&&!n)throw new Pe("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:o});"object"==typeof a&&null!==a&&(e=a),Te(this,Ue)[Ue].validateSingleFile(e),i[e.id]=e,s.push(e)}catch(a){n.push(a)}try{Te(this,Ue)[Ue].validateAggregateRestrictions(Object.values(t),s)}catch(a){return n.push(a),{nextFilesState:t,validFilesToAdd:[],errors:n}}return{nextFilesState:i,validFilesToAdd:s,errors:n}}function ht(){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 n;this.log(i.message,"error");const e=new Error(this.i18n("failedToUpload",{file:null!=(n=null==t?void 0:t.name)?n:""}));e.isUserFacing=!0,e.details=i.message,i.details&&(e.details+=` ${i.details}`),Te(this,je)[je]([e])}else Te(this,je)[je]([i])}));let t=null;this.on("upload-stalled",((e,i)=>{const{message:s}=e,n=i.map((e=>e.meta.name)).join(", ");t||(this.info({message:s,details:n},"warning",this.opts.infoTimeout),t=setTimeout((()=>{t=null}),this.opts.infoTimeout)),this.log(`${s} ${n}`.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:Te(this,Le)[Le].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&&Te(this,He)[He](e)})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",Te(this,Ye)[Ye]),window.addEventListener("offline",Te(this,Ye)[Ye]),setTimeout(Te(this,Ye)[Ye],3e3))}function pt(e,t){void 0===t&&(t={});const{forceAllowNewUpload:i=!1}=t,{allowNewUpload:s,currentUploads:n}=this.getState();if(!s&&!i)throw new Error("Cannot create a new upload: already uploading.");const r=b();return this.emit("upload",{id:r,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...n,[r]:{fileIDs:e,step:0,result:{}}}}),r}function dt(e){const{currentUploads:t}=this.getState();return t[e]}function ut(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function ct(e){const t=()=>{const{currentUploads:t}=this.getState();return t[e]};let i=t();const s=[...Te(this,Re)[Re],...Te(this,ze)[ze],...Te(this,Le)[Le]];try{for(let n=i.step||0;n<s.length&&i;n++){const r=s[n];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...i,step:n}}});const{fileIDs:a}=i;await r(a,e),i=t()}}catch(r){throw Te(this,Je)[Je](e),r}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))),n=s.filter((e=>!e.error)),r=s.filter((e=>e.error));this.addResultData(e,{successful:n,failed:r,uploadID:e}),i=t()}let n;return i&&(n=i.result,this.emit("complete",n),Te(this,Je)[Je](e)),null==n&&this.log(`Not setting result for an upload that has been removed: ${e}`),n}tt.VERSION="3.13.1";var ft,mt,gt,yt,vt,bt,wt,_t,Ft,Ct,St,Pt=tt,xt={},Ot=[],Dt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,kt=Array.isArray;function Tt(e,t){for(var i in t)e[i]=t[i];return e}function Et(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function At(e,t,i){var s,n,r,a={};for(r in t)"key"==r?s=t[r]:"ref"==r?n=t[r]:a[r]=t[r];if(arguments.length>2&&(a.children=arguments.length>3?ft.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===a[r]&&(a[r]=e.defaultProps[r]);return Mt(e,a,s,n,null)}function Mt(e,t,i,s,n){var r={type:e,props:t,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++gt:n,__i:-1,__u:0};return null==n&&null!=mt.vnode&&mt.vnode(r),r}function Nt(e){return e.children}function Ut(e,t){this.props=e,this.context=t}function Bt(e,t){if(null==t)return e.__?Bt(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?Bt(e):null}function It(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 It(e)}}function Rt(e){(!e.__d&&(e.__d=!0)&&yt.push(e)&&!zt.__r++||vt!=mt.debounceRendering)&&((vt=mt.debounceRendering)||bt)(zt)}function zt(){for(var e,t,i,s,n,r,a,o=1;yt.length;)yt.length>o&&yt.sort(wt),e=yt.shift(),o=yt.length,e.__d&&(i=void 0,n=(s=(t=e).__v).__e,r=[],a=[],t.__P&&((i=Tt({},s)).__v=s.__v+1,mt.vnode&&mt.vnode(i),Xt(t.__P,i,s,t.__n,t.__P.namespaceURI,32&s.__u?[n]:null,r,null==n?Bt(s):n,!!(32&s.__u),a),i.__v=s.__v,i.__.__k[i.__i]=i,Yt(r,i,a),i.__e!=n&&It(i)));zt.__r=0}function Lt(e,t,i,s,n,r,a,o,l,h,p){var d,u,c,f,m,g,y,v=s&&s.__k||Ot,b=t.length;for(l=function(e,t,i,s,n){var r,a,o,l,h,p=i.length,d=p,u=0;for(e.__k=new Array(n),r=0;r<n;r++)null!=(a=t[r])&&"boolean"!=typeof a&&"function"!=typeof a?(l=r+u,(a=e.__k[r]="string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?Mt(null,a,null,null,null):kt(a)?Mt(Nt,{children:a},null,null,null):null==a.constructor&&a.__b>0?Mt(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,o=null,-1!=(h=a.__i=qt(a,i,l,d))&&(d--,(o=i[h])&&(o.__u|=2)),null==o||null==o.__v?(-1==h&&(n>p?u--:n<p&&u++),"function"!=typeof a.type&&(a.__u|=4)):h!=l&&(h==l-1?u--:h==l+1?u++:(h>l?u--:u++,a.__u|=4))):e.__k[r]=null;if(d)for(r=0;r<p;r++)null!=(o=i[r])&&0==(2&o.__u)&&(o.__e==s&&(s=Bt(o)),Zt(o,o));return s}(i,t,v,l,b),d=0;d<b;d++)null!=(c=i.__k[d])&&(u=-1==c.__i?xt:v[c.__i]||xt,c.__i=d,g=Xt(e,c,u,n,r,a,o,l,h,p),f=c.__e,c.ref&&u.ref!=c.ref&&(u.ref&&Qt(u.ref,null,c),p.push(c.ref,c.__c||f,c)),null==m&&null!=f&&(m=f),(y=!!(4&c.__u))||u.__k===c.__k?l=jt(c,l,e,y):"function"==typeof c.type&&void 0!==g?l=g:f&&(l=f.nextSibling),c.__u&=-7);return i.__e=m,l}function jt(e,t,i,s){var n,r;if("function"==typeof e.type){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=jt(n[r],t,i,s));return t}e.__e!=t&&(s&&(t&&e.type&&!t.parentNode&&(t=Bt(e)),i.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Ht(e,t){return t=t||[],null==e||"boolean"==typeof e||(kt(e)?e.some((function(e){Ht(e,t)})):t.push(e)),t}function qt(e,t,i,s){var n,r,a,o=e.key,l=e.type,h=t[i],p=null!=h&&0==(2&h.__u);if(null===h&&null==e.key||p&&o==h.key&&l==h.type)return i;if(s>(p?1:0))for(n=i-1,r=i+1;n>=0||r<t.length;)if(null!=(h=t[a=n>=0?n--:r++])&&0==(2&h.__u)&&o==h.key&&l==h.type)return a;return-1}function Wt(e,t,i){"-"==t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||Dt.test(t)?i:i+"px"}function $t(e,t,i,s,n){var r,a;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||Wt(e.style,t,"");if(i)for(t in i)s&&i[t]==s[t]||Wt(e.style,t,i[t])}else if("o"==t[0]&&"n"==t[1])r=t!=(t=t.replace(_t,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=i,i?s?i.u=s.u:(i.u=Ft,e.addEventListener(t,r?St:Ct,r)):e.removeEventListener(t,r?St:Ct,r);else{if("http://www.w3.org/2000/svg"==n)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&&"popover"!=t&&t in e)try{e[t]=null==i?"":i;break e}catch(o){}"function"==typeof i||(null==i||!1===i&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==i?"":i))}}function Vt(e){return function(t){if(this.l){var i=this.l[t.type+e];if(null==t.t)t.t=Ft++;else if(t.t<i.u)return;return i(mt.event?mt.event(t):t)}}}function Xt(e,t,i,s,n,r,a,o,l,h){var p,d,u,c,f,m,g,y,v,b,w,_,F,C,S,P,x,O=t.type;if(null!=t.constructor)return null;128&i.__u&&(l=!!(32&i.__u),r=[o=t.__e=i.__e]),(p=mt.__b)&&p(t);e:if("function"==typeof O)try{if(y=t.props,v="prototype"in O&&O.prototype.render,b=(p=O.contextType)&&s[p.__c],w=p?b?b.props.value:p.__:s,i.__c?g=(d=t.__c=i.__c).__=d.__E:(v?t.__c=d=new O(y,w):(t.__c=d=new Ut(y,w),d.constructor=O,d.render=Jt),b&&b.sub(d),d.props=y,d.state||(d.state={}),d.context=w,d.__n=s,u=d.__d=!0,d.__h=[],d._sb=[]),v&&null==d.__s&&(d.__s=d.state),v&&null!=O.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Tt({},d.__s)),Tt(d.__s,O.getDerivedStateFromProps(y,d.__s))),c=d.props,f=d.state,d.__v=t,u)v&&null==O.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),v&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(v&&null==O.getDerivedStateFromProps&&y!==c&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)||t.__v==i.__v){for(t.__v!=i.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some((function(e){e&&(e.__=t)})),_=0;_<d._sb.length;_++)d.__h.push(d._sb[_]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),v&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(c,f,m)}))}if(d.context=w,d.props=y,d.__P=e,d.__e=!1,F=mt.__r,C=0,v){for(d.state=d.__s,d.__d=!1,F&&F(t),p=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,F&&F(t),p=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++C<25);d.state=d.__s,null!=d.getChildContext&&(s=Tt(Tt({},s),d.getChildContext())),v&&!u&&null!=d.getSnapshotBeforeUpdate&&(m=d.getSnapshotBeforeUpdate(c,f)),P=p,null!=p&&p.type===Nt&&null==p.key&&(P=Kt(p.props.children)),o=Lt(e,kt(P)?P:[P],t,i,s,n,r,a,o,l,h),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),g&&(d.__E=d.__=null)}catch(D){if(t.__v=null,l||null!=r)if(D.then){for(t.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;r[r.indexOf(o)]=null,t.__e=o}else{for(x=r.length;x--;)Et(r[x]);Gt(t)}else t.__e=i.__e,t.__k=i.__k,D.then||Gt(t);mt.__e(D,t,i)}else null==r&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):o=t.__e=function(e,t,i,s,n,r,a,o,l){var h,p,d,u,c,f,m,g=i.props,y=t.props,v=t.type;if("svg"==v?n="http://www.w3.org/2000/svg":"math"==v?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=r)for(h=0;h<r.length;h++)if((c=r[h])&&"setAttribute"in c==!!v&&(v?c.localName==v:3==c.nodeType)){e=c,r[h]=null;break}if(null==e){if(null==v)return document.createTextNode(y);e=document.createElementNS(n,v,y.is&&y),o&&(mt.__m&&mt.__m(t,r),o=!1),r=null}if(null==v)g===y||o&&e.data==y||(e.data=y);else{if(r=r&&ft.call(e.childNodes),g=i.props||xt,!o&&null!=r)for(g={},h=0;h<e.attributes.length;h++)g[(c=e.attributes[h]).name]=c.value;for(h in g)if(c=g[h],"children"==h);else if("dangerouslySetInnerHTML"==h)d=c;else if(!(h in y)){if("value"==h&&"defaultValue"in y||"checked"==h&&"defaultChecked"in y)continue;$t(e,h,null,c,n)}for(h in y)c=y[h],"children"==h?u=c:"dangerouslySetInnerHTML"==h?p=c:"value"==h?f=c:"checked"==h?m=c:o&&"function"!=typeof c||g[h]===c||$t(e,h,c,g[h],n);if(p)o||d&&(p.__html==d.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(d&&(e.innerHTML=""),Lt("template"==t.type?e.content:e,kt(u)?u:[u],t,i,s,"foreignObject"==v?"http://www.w3.org/1999/xhtml":n,r,a,r?r[0]:i.__k&&Bt(i,0),o,l),null!=r)for(h=r.length;h--;)Et(r[h]);o||(h="value","progress"==v&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[h]||"progress"==v&&!f||"option"==v&&f!=g[h])&&$t(e,h,f,g[h],n),h="checked",null!=m&&m!=e[h]&&$t(e,h,m,g[h],n))}return e}(i.__e,t,i,s,n,r,a,l,h);return(p=mt.diffed)&&p(t),128&t.__u?void 0:o}function Gt(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Gt)}function Yt(e,t,i){for(var s=0;s<i.length;s++)Qt(i[s],i[++s],i[++s]);mt.__c&&mt.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(i){mt.__e(i,t.__v)}}))}function Kt(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:kt(e)?e.map(Kt):Tt({},e)}function Qt(e,t,i){try{if("function"==typeof e){var s="function"==typeof e.__u;s&&e.__u(),s&&null==t||(e.__u=e(t))}else e.current=t}catch(n){mt.__e(n,i)}}function Zt(e,t,i){var s,n;if(mt.unmount&&mt.unmount(e),(s=e.ref)&&(s.current&&s.current!=e.__e||Qt(s,null,t)),null!=(s=e.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(r){mt.__e(r,t)}s.base=s.__P=null}if(s=e.__k)for(n=0;n<s.length;n++)s[n]&&Zt(s[n],t,i||"function"!=typeof e.type);i||Et(e.__e),e.__c=e.__=e.__e=void 0}function Jt(e,t,i){return this.constructor(e,i)}function ei(e,t,i){var s,n,r,a;t==document&&(t=document.documentElement),mt.__&&mt.__(e,t),n=(s="function"==typeof i)?null:i&&i.__k||t.__k,r=[],a=[],Xt(t,e=(!s&&i||t).__k=At(Nt,null,[e]),n||xt,xt,t.namespaceURI,!s&&i?[i]:n?null:t.firstChild?ft.call(t.childNodes):null,r,!s&&i?i:n?n.__e:t.firstChild,s,a),Yt(r,e,a)}function ti(e,t,i){var s,n,r,a,o=Tt({},e.props);for(r in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==r?s=t[r]:"ref"==r?n=t[r]:o[r]=void 0===t[r]&&null!=a?a[r]:t[r];return arguments.length>2&&(o.children=arguments.length>3?ft.call(arguments,2):i),Mt(e.type,o,s||e.key,n||e.ref,null)}function ii(e){return"object"==typeof e&&null!==e&&("nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)}function si(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir}ft=Ot.slice,mt={__e:function(e,t,i,s){for(var n,r,a;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,s||{}),a=n.__d),a)return n.__E=n}catch(o){e=o}throw e}},gt=0,Ut.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Tt({},this.state),"function"==typeof e&&(e=e(Tt({},i),this.props)),e&&Tt(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),Rt(this))},Ut.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Rt(this))},Ut.prototype.render=Nt,yt=[],bt="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wt=function(e,t){return e.__v.__b-t.__v.__b},zt.__r=0,_t=/(PointerCapture)$|Capture$/i,Ft=0,Ct=Vt(!1),St=Vt(!0);class ni{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){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 g([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 ri(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var ai=0;function oi(e){return"__private_"+ai+++"_"+e}var li=oi("updateUI");class hi extends ni{constructor(){super(...arguments),Object.defineProperty(this,li,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if("function"==typeof(null==e?void 0:e.addTarget))t=e;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=(n=e,void 0===r&&(r=document),"string"==typeof n?r.querySelector(n):ii(n)?n:null);var n,r;if(s){this.isTargetDOMEl=!0;const t=document.createElement("div");return t.classList.add("uppy-Root"),ri(this,li)[li]=function(e){let t,i=null;return function(){for(var s=arguments.length,n=new Array(s),r=0;r<s;r++)n[r]=arguments[r];return t=n,i||(i=Promise.resolve().then((()=>(i=null,e(...t))))),i}}((e=>{this.uppy.getPlugin(this.id)&&(ei(this.render(e),t),this.afterUpdate())})),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),ei(this.render(this.uppy.getState()),t),this.el=t,s.appendChild(t),t.dir=this.opts.direction||si(t)||"ltr",this.onMount(),this.el}const a=this.getTargetPlugin(e);if(a)return this.uppy.log(`Installing ${i} to ${a.id}`),this.parent=a,this.el=a.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let o=`Invalid target option given to ${i}.`;throw o+="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(o)}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=ri(this,li))[li])||t.call(i,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}var pi=hi;function di(e,t,i,s){return 0===i||e===t?e:0===s?t:e+(t-e)*2**(-s/i)}var ui,ci={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},fi={exports:{}};
/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/
ui=fi,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=s(e,i(n)))}return e}function i(i){if("string"==typeof i||"number"==typeof i)return i;if("object"!=typeof i)return"";if(Array.isArray(i))return t.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var n="";for(var r in i)e.call(i,r)&&i[r]&&(n=s(n,r));return n}function s(e,t){return t?e?e+" "+t:e+t:e}ui.exports?(t.default=t,ui.exports=t):window.classNames=t}();var mi=fi.exports;function gi(e){const t=[];let i,s="indeterminate";for(const{progress:n}of Object.values(e)){const{preprocess:e,postprocess:r}=n;null==i&&(e||r)&&({mode:s,message:i}=e||r),"determinate"===(null==e?void 0:e.mode)&&t.push(e.value),"determinate"===(null==r?void 0:r.mode)&&t.push(r.value)}return{mode:s,message:i,value:t.reduce(((e,i)=>e+i/t.length),0)}}function yi(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`}`}function vi(e){const{newFiles:t,isUploadStarted:i,recoveredState:s,i18n:n,uploadState:r,isSomeGhost:a,startUpload:o}=e,l=mi("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":r===ci.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),h=n(t&&i&&!s?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return At("button",{type:"button",className:l,"aria-label":n("uploadXFiles",{smart_count:t}),onClick:o,disabled:a,"data-uppy-super-focusable":!0},h)}function bi(e){const{i18n:t,uppy:i}=e;return At("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"},At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},At("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 wi(e){const{i18n:t,uppy:i}=e;return At("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},At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},At("g",{fill:"none",fillRule:"evenodd"},At("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),At("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 _i(e){const{isAllPaused:t,i18n:i,isAllComplete:s,resumableUploads:n,uppy:r}=e,a=i(t?"resume":"pause");return At("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){s||(n?t?r.resumeAll():r.pauseAll():r.cancelAll())},"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},At("g",{fill:"none",fillRule:"evenodd"},At("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),At("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function Fi(e){const{i18n:t,doneButtonHandler:i}=e;return At("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 Ci(){return At("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},At("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 Si(e){const{progress:t}=e,{value:i,mode:s,message:n}=t;return At("div",{className:"uppy-StatusBar-content"},At(Ci,null),"determinate"===s?`${Math.round(100*i)}% · `:"",n)}function Pi(e){const{numUploads:t,complete:i,totalUploadedSize:s,totalSize:n,totalETA:r,i18n:a}=e,o=t>1;return At("div",{className:"uppy-StatusBar-statusSecondary"},o&&a("filesUploadedOfTotal",{complete:i,smart_count:t}),At("span",{className:"uppy-StatusBar-additionalInfo"},o&&" · ",a("dataUploadedOfTotal",{complete:we(s),total:we(n)})," · ",a("xTimeLeft",{time:yi(r)})))}function xi(e){const{i18n:t,complete:i,numUploads:s}=e;return At("div",{className:"uppy-StatusBar-statusSecondary"},t("filesUploadedOfTotal",{complete:i,smart_count:s}))}function Oi(e){const{i18n:t,newFiles:i,startUpload:s}=e,n=mi("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return At("div",{className:"uppy-StatusBar-statusSecondary"},At("div",{className:"uppy-StatusBar-statusSecondaryHint"},t("xMoreFilesAdded",{smart_count:i})),At("button",{type:"button",className:n,"aria-label":t("uploadXFiles",{smart_count:i}),onClick:s},t("upload")))}function Di(e){const{i18n:t,supportsUploadProgress:i,totalProgress:s,showProgressDetails:n,isUploadStarted:r,isAllComplete:a,isAllPaused:o,newFiles:l,numUploads:h,complete:p,totalUploadedSize:d,totalSize:u,totalETA:c,startUpload:f}=e,m=l&&r;if(!r||a)return null;const g=t(o?"paused":"uploading");return At("div",{className:"uppy-StatusBar-content","aria-label":g,title:g},o?null:At(Ci,null),At("div",{className:"uppy-StatusBar-status"},At("div",{className:"uppy-StatusBar-statusPrimary"},i?`${g}: ${s}%`:g),o||m||!n?null:i?At(Pi,{numUploads:h,complete:p,totalUploadedSize:d,totalSize:u,totalETA:c,i18n:t}):At(xi,{i18n:t,complete:p,numUploads:h}),m?At(Oi,{i18n:t,newFiles:l,startUpload:f}):null))}function ki(e){const{i18n:t}=e;return At("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},At("div",{className:"uppy-StatusBar-status"},At("div",{className:"uppy-StatusBar-statusPrimary"},At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},At("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))}function Ti(e){const{error:t,i18n:i,complete:s,numUploads:n}=e;return At("div",{className:"uppy-StatusBar-content",title:i("uploadFailed")},At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},At("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"})),At("div",{className:"uppy-StatusBar-status"},At("div",{className:"uppy-StatusBar-statusPrimary"},i("uploadFailed"),At("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"},"?")),At(xi,{i18n:i,complete:s,numUploads:n})))}const{STATE_ERROR:Ei,STATE_WAITING:Ai,STATE_PREPROCESSING:Mi,STATE_UPLOADING:Ni,STATE_POSTPROCESSING:Ui,STATE_COMPLETE:Bi}=ci;function Ii(e){const{newFiles:t,allowNewUpload:i,isUploadInProgress:s,isAllPaused:n,resumableUploads:r,error:a,hideUploadButton:o,hidePauseResumeButton:l,hideCancelButton:h,hideRetryButton:p,recoveredState:d,uploadState:u,totalProgress:c,files:f,supportsUploadProgress:m,hideAfterFinish:g,isSomeGhost:y,doneButtonHandler:v,isUploadStarted:b,i18n:w,startUpload:_,uppy:F,isAllComplete:C,showProgressDetails:S,numUploads:P,complete:x,totalSize:O,totalETA:D,totalUploadedSize:k}=e;const T=function(){switch(u){case Ui:case Mi:{const e=gi(f);return"determinate"===e.mode?100*e.value:c}case Ei:return null;case Ni:return m?c:null;default:return c}}(),E=function(){if(d)return!1;switch(u){case Ai:return o||0===t;case Bi:return g;default:return!1}}(),A=null!=T?T:100,M=!a&&t&&!s&&!n&&i&&!o,N=!h&&u!==Ai&&u!==Bi,U=r&&!l&&u===Ni,B=a&&!C&&!p,I=v&&u===Bi,R=mi("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(u){case Ui:case Mi:{const{mode:e}=gi(f);return"indeterminate"===e}case Ni:return!m;default:return!1}}()});return At("div",{className:mi("uppy-StatusBar",`is-${u}`,{"has-ghosts":y}),"aria-hidden":E},At("div",{className:R,style:{width:`${A}%`},role:"progressbar","aria-label":`${A}%`,"aria-valuetext":`${A}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":T}),(()=>{switch(u){case Mi:case Ui:return At(Si,{progress:gi(f)});case Bi:return At(ki,{i18n:w});case Ei:return At(Ti,{error:a,i18n:w,numUploads:P,complete:x});case Ni:return At(Di,{i18n:w,supportsUploadProgress:m,totalProgress:c,showProgressDetails:S,isUploadStarted:b,isAllComplete:C,isAllPaused:n,newFiles:t,numUploads:P,complete:x,totalUploadedSize:k,totalSize:O,totalETA:D,startUpload:_});default:return null}})(),At("div",{className:"uppy-StatusBar-actions"},d||M?At(vi,{newFiles:t,isUploadStarted:b,recoveredState:d,i18n:w,isSomeGhost:y,startUpload:_,uploadState:u}):null,B?At(bi,{i18n:w,uppy:F}):null,U?At(_i,{isAllPaused:n,i18n:w,isAllComplete:C,resumableUploads:r,uppy:F}):null,N?At(wi,{i18n:w,uppy:F}):null,I?At(Fi,{i18n:w,doneButtonHandler:v}):null))}Ii.defaultProps={doneButtonHandler:void 0,hideAfterFinish:!1,hideCancelButton:!1,hidePauseResumeButton:!1,hideRetryButton:!1,hideUploadButton:void 0,showProgressDetails:void 0};var Ri={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 zi(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Li=0;function ji(e){return"__private_"+Li+++"_"+e}function Hi(e,t,i,s){if(e)return ci.STATE_ERROR;if(t)return ci.STATE_COMPLETE;if(i)return ci.STATE_WAITING;let n=ci.STATE_WAITING;const r=Object.keys(s);for(let a=0;a<r.length;a++){const{progress:e}=s[r[a]];if(e.uploadStarted&&!e.uploadComplete)return ci.STATE_UPLOADING;e.preprocess&&(n=ci.STATE_PREPROCESSING),e.postprocess&&n!==ci.STATE_PREPROCESSING&&(n=ci.STATE_POSTPROCESSING)}return n}const qi={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};var Wi=ji("lastUpdateTime"),$i=ji("previousUploadedBytes"),Vi=ji("previousSpeed"),Xi=ji("previousETA"),Gi=ji("computeSmoothETA"),Yi=ji("onUploadStart");class Ki extends pi{constructor(e,t){super(e,{...qi,...t}),Object.defineProperty(this,Gi,{value:Qi}),Object.defineProperty(this,Wi,{writable:!0,value:void 0}),Object.defineProperty(this,$i,{writable:!0,value:void 0}),Object.defineProperty(this,Vi,{writable:!0,value:void 0}),Object.defineProperty(this,Xi,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch((()=>{})),Object.defineProperty(this,Yi,{writable:!0,value:()=>{const{recoveredState:e}=this.uppy.getState();if(zi(this,Vi)[Vi]=null,zi(this,Xi)[Xi]=null,e)return zi(this,$i)[$i]=Object.values(e.files).reduce(((e,t)=>{let{progress:i}=t;return e+i.bytesUploaded}),0),void this.uppy.emit("restore-confirmed");zi(this,Wi)[Wi]=performance.now(),zi(this,$i)[$i]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Ri,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:i,allowNewUpload:s,totalProgress:n,error:r,recoveredState:a}=e,{newFiles:o,startedFiles:l,completeFiles:h,isUploadStarted:p,isAllComplete:d,isAllErrored:u,isAllPaused:c,isUploadInProgress:f,isSomeGhost:m}=this.uppy.getObjectOfFilesPerState(),g=a?Object.values(i):o,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 _=zi(this,Gi)[Gi]({uploaded:w,total:b,remaining:b-w});return Ii({error:r,uploadState:Hi(r,d,a,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:b,totalUploadedSize:w,isAllComplete:!1,isAllPaused:c,isAllErrored:u,isUploadStarted:p,isUploadInProgress:f,isSomeGhost:m,recoveredState:a,complete:h.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;si(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",zi(this,Yi)[Yi]),zi(this,Wi)[Wi]=performance.now(),zi(this,$i)[$i]=this.uppy.getFiles().reduce(((e,t)=>e+t.progress.bytesUploaded),0)}uninstall(){this.unmount(),this.uppy.off("upload",zi(this,Yi)[Yi])}}function Qi(e){var t;if(0===e.total||0===e.remaining)return 0;null!=(t=zi(this,Wi))[Wi]||(t[Wi]=performance.now());const i=performance.now()-zi(this,Wi)[Wi];var s;if(0===i)return Math.round((null!=(s=zi(this,Xi)[Xi])?s:0)/100)/10;const n=e.uploaded-zi(this,$i)[$i];var r;if(zi(this,$i)[$i]=e.uploaded,n<=0)return Math.round((null!=(r=zi(this,Xi)[Xi])?r:0)/100)/10;const a=n/i,o=null==zi(this,Vi)[Vi]?a:di(a,zi(this,Vi)[Vi],2e3,i);zi(this,Vi)[Vi]=o;const l=e.remaining/o,h=Math.max(zi(this,Xi)[Xi]-i,0),p=null==zi(this,Xi)[Xi]?l:di(l,h,2e3,i);return zi(this,Xi)[Xi]=p,zi(this,Wi)[Wi]=performance.now(),Math.round(p/100)/10}Ki.VERSION="3.3.3";class Zi extends Ut{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 At("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}function Ji(e){const t={};for(let r=0;r<e.length;r++)if(null!=e[r]){t[(i=e[r],s=r.toString(36),n=void 0,null!=(n=null==i?void 0:i.key)?n:s)]=e[r]}var i,s,n;return t}function es(e,t){e=e||{},t=t||{};const i=i=>t.hasOwnProperty(i)?t[i]:e[i],s={};let n=[];for(const a in e)t.hasOwnProperty(a)?n.length&&(s[a]=n,n=[]):n.push(a);const r={};for(const a in t){if(s.hasOwnProperty(a))for(let e=0;e<s[a].length;e++){const t=s[a][e];r[s[a][e]]=i(t)}r[a]=i(a)}for(let a=0;a<n.length;a++)r[n[a]]=i(n[a]);return r}class ts extends Ut{constructor(e,t){super(e,t),this.refs={},this.state={children:Ji(Ht(Ht(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=Ji(Ht(e.children)||[]),i=this.state.children;let s;for(s in this.setState((e=>({children:es(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=Ji(Ht(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=Ji(Ht(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=Ji(Ht(this.props.children)||[]);if(i&&i.hasOwnProperty(e))this.performEnter(e);else{const t=(s={},n=this.state.children,Object.assign(s,n));delete t[e],this.setState({children:t})}var s,n}render(e,t){let{childFactory:i,transitionLeave:s,transitionName:n,transitionAppear:r,transitionEnter:a,transitionLeaveTimeout:o,transitionEnterTimeout:l,transitionAppearTimeout:h,component:p,...d}=e,{children:u}=t;const c=Object.entries(u).map((e=>{let[t,s]=e;if(!s)return;const n=function(e,t){const i=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return i[t]||(i[t]=i=>{e.refs[t]=i})}(this,t);return ti(i(s),{ref:n,key:t})})).filter(Boolean);return At(p,d,c)}}ts.defaultProps={component:"span",childFactory:e=>e};class is extends pi{constructor(e,t){super(e,t),this.render=e=>At("div",{className:"uppy uppy-Informer"},At(ts,null,e.info.map((e=>At(Zi,{key:e.message},At("p",{role:"alert"},e.message," ",e.details&&At("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)}}is.VERSION="3.1.0";const ss=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function ns(e){return e.startsWith("blob:")}function rs(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)}function as(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var os="undefined"!=typeof self?self:global;const ls="undefined"!=typeof navigator,hs=ls&&"undefined"==typeof HTMLImageElement,ps=!("undefined"==typeof global||"undefined"==typeof process||!process.versions||!process.versions.node),ds=os.Buffer,us=!!ds,cs=e=>void 0!==e;function fs(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(cs).length)}function ms(e){let t=new Error(e);throw delete t.stack,t}function gs(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 ys=e=>String.fromCharCode.apply(null,e),vs="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class bs{static from(e,t){return e instanceof this&&e.le===t?e:new bs(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 bs){void 0===i&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&ms("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 ms("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=bs){return e instanceof DataView||e instanceof bs?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||ms("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 bs(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),vs?vs.decode(i):us?Buffer.from(i).toString("utf8"):decodeURIComponent(escape(ys(i)));var i}getLatin1String(e=0,t=this.byteLength){let i=this.getUint8Array(e,t);return ys(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 ys(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 ws(e,t){ms(`${e} '${t}' was not loaded, try using full build of exifr.`)}class _s extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||ws(this.kind,e),t&&(e in t||ms(`Unknown ${this.kind} '${e}'.`),t[e].enabled||ws(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var Fs=new _s("file parser"),Cs=new _s("segment parser"),Ss=new _s("file reader");let Ps=os.fetch;function xs(e,t){return(i=e).startsWith("data:")||i.length>1e4?Ds(e,t,"base64"):ps&&e.includes("://")?Os(e,t,"url",ks):ps?Ds(e,t,"fs"):ls?Os(e,t,"url",ks):void ms("Invalid input argument");var i}async function Os(e,t,i,s){return Ss.has(i)?Ds(e,t,i):s?async function(e,t){let i=await t(e);return new bs(i)}(e,s):void ms(`Parser ${i} is not loaded`)}async function Ds(e,t,i){let s=new(Ss.get(i))(e,t);return await s.read(),s}const ks=e=>Ps(e).then((e=>e.arrayBuffer())),Ts=e=>new Promise(((t,i)=>{let s=new FileReader;s.onloadend=()=>t(s.result||new ArrayBuffer),s.onerror=i,s.readAsArrayBuffer(e)}));class Es 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 As(e,t,i){let s=new Es;for(let[n,r]of i)s.set(n,r);if(Array.isArray(t))for(let n of t)e.set(n,s);else e.set(t,s);return s}function Ms(e,t,i){let s,n=e.get(t);for(s of i)n.set(s[0],s[1])}const Ns=new Map,Us=new Map,Bs=new Map,Is=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Rs=["jfif","xmp","icc","iptc","ihdr"],zs=["tiff",...Rs],Ls=["ifd0","ifd1","exif","gps","interop"],js=[...zs,...Ls],Hs=["makerNote","userComment"],qs=["translateKeys","translateValues","reviveValues","multiSegment"],Ws=[...qs,"sanitize","mergeOutput","silentErrors"];class $s{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class Vs extends $s{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,s){if(super(),as(this,"enabled",!1),as(this,"skip",new Set),as(this,"pick",new Set),as(this,"deps",new Set),as(this,"translateKeys",!1),as(this,"translateValues",!1),as(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=Ls.includes(e),this.canBeFiltered&&(this.dict=Ns.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:ms(`Invalid options argument: ${i}`)}applyInheritables(e){let t,i;for(t of qs)i=e[t],void 0!==i&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,s,{tagKeys:n,tagValues:r}=this.dict;for(i of e)"string"==typeof i?(s=r.indexOf(i),-1===s&&(s=n.indexOf(Number(i))),-1!==s&&t.add(Number(n[s]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Zs(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Zs(this.pick,this.deps)}}var Xs={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},Gs=new Map;class Ys extends $s{static useCached(e){let t=Gs.get(e);return void 0!==t||(t=new this(e),Gs.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):ms(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=ls?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Is)this[e]=Xs[e];for(e of Ws)this[e]=Xs[e];for(e of Hs)this[e]=Xs[e];for(e of js)this[e]=new Vs(e,Xs[e],void 0,this)}setupFromTrue(){let e;for(e of Is)this[e]=Xs[e];for(e of Ws)this[e]=Xs[e];for(e of Hs)this[e]=!0;for(e of js)this[e]=new Vs(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Is)this[t]=Xs[t];for(t of Ws)this[t]=Xs[t];for(t of Hs)this[t]=Xs[t];for(t of js)this[t]=new Vs(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ls)}setupFromObject(e){let t;for(t of(Ls.ifd0=Ls.ifd0||Ls.image,Ls.ifd1=Ls.ifd1||Ls.thumbnail,Object.assign(this,e),Is))this[t]=Qs(e[t],Xs[t]);for(t of Ws)this[t]=Qs(e[t],Xs[t]);for(t of Hs)this[t]=Qs(e[t],Xs[t]);for(t of zs)this[t]=new Vs(t,Xs[t],e[t],this);for(t of Ls)this[t]=new Vs(t,Xs[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ls,js),!0===e.tiff?this.batchEnableWithBool(Ls,!0):!1===e.tiff?this.batchEnableWithUserValue(Ls,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ls):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ls)}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=Ks(e,i);for(let[e,i]of t)Zs(this[e].pick,i),this[e].enabled=!0}else if(t&&t.length){let e=Ks(t,i);for(let[t,i]of e)Zs(this[t].skip,i)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,iptc:s,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),i.enabled||e.skip.add(700),s.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:s}=this;s.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=Ls.some((e=>!0===this[e].enabled))||this.makerNote||this.userComment;for(let n of Ls)this[n].finalizeFilters()}get onlyTiff(){return!Rs.map((e=>this[e].enabled)).some((e=>!0===e))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of zs)this[e].enabled&&!Cs.has(e)&&ws("segment parser",e)}}function Ks(e,t){let i,s,n,r,a=[];for(n of t){for(r of(i=Ns.get(n),s=[],i))(e.includes(r[0])||e.includes(r[1]))&&s.push(r[0]);s.length&&a.push([n,s])}return a}function Qs(e,t){return void 0!==e?e:void 0!==t?t:void 0}function Zs(e,t){for(let i of t)e.add(i)}as(Ys,"default",Xs);class Js{constructor(e){as(this,"parsers",{}),as(this,"output",{}),as(this,"errors",[]),as(this,"pushToErrors",(e=>this.errors.push(e))),this.options=Ys.useCached(e)}async read(e){var t,i;this.file=await(t=e,i=this.options,"string"==typeof t?xs(t,i):ls&&!hs&&t instanceof HTMLImageElement?xs(t.src,i):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new bs(t):ls&&t instanceof Blob?Os(t,i,"blob",Ts):void ms("Invalid input argument"))}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,s]of Fs)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(),ms("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),fs(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=Cs.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 n=await this.fileParser.ensureSegmentChunk(s),r=this.parsers.tiff=new i(n,e,t),a=await r.extractThumbnail();return t.close&&t.close(),a}}async function en(e,t){let i=new Js(t);return await i.read(e),i.parse()}var tn=Object.freeze({__proto__:null,parse:en,Exifr:Js,fileParsers:Fs,segmentParsers:Cs,fileReaders:Ss,tagKeys:Ns,tagValues:Us,tagRevivers:Bs,createDictionary:As,extendDictionary:Ms,fetchUrlAsArrayBuffer:ks,readBlobAsArrayBuffer:Ts,chunkedProps:Is,otherSegments:Rs,segments:zs,tiffBlocks:Ls,segmentsAndBlocks:js,tiffExtractables:Hs,inheritables:qs,allFormatters:Ws,Options:Ys});class sn{static findPosition(e,t){let i=e.getUint16(t+2)+2,s="function"==typeof this.headerLength?this.headerLength(e,t,i):this.headerLength,n=t+s,r=i-s;return{offset:t,length:i,headerLength:s,start:n,size:r,end:n+r}}static parse(e,t={}){return new this(e,new Ys({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof bs?e:new bs(e)}constructor(e,t={},i){as(this,"errors",[]),as(this,"raw",new Map),as(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=Bs.get(t),s=Us.get(t),n=Ns.get(t),r=this.options[t],a=r.reviveValues&&!!i,o=r.translateValues&&!!s,l=r.translateKeys&&!!n,h={};for(let[p,d]of e)a&&i.has(p)?d=i.get(p)(d):o&&s.has(p)&&(d=this.translateValue(d,s.get(p))),l&&n.has(p)&&(p=n.get(p)||p),h[p]=d;return h}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 nn(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function rn(e){return e>=224&&e<=239}function an(e,t,i){for(let[s,n]of Cs)if(n.canHandle(e,t,i))return s}as(sn,"headerLength",4),as(sn,"type",void 0),as(sn,"multiSegment",!1),as(sn,"canHandle",(()=>!1));class on extends class{constructor(e,t,i){as(this,"errors",[]),as(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(s){ms(`Couldn't read segment: ${JSON.stringify(e)}. ${s.message}`)}else this.file.byteLength>t+i?e.chunk=this.file.subarray(t,i):void 0===e.size?e.chunk=this.file.subarray(t):ms("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(Cs.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),as(this,"appSegments",[]),as(this,"jpegSegments",[]),as(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(Cs.keyList())):(e=void 0===e?Cs.keyList().filter((e=>this.options[e].enabled)):e.filter((e=>this.options[e].enabled&&Cs.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:n,remaining:r}=this;if(!s&&this.file.chunked&&(s=Array.from(n).some((e=>{let t=Cs.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(;r.size>0&&!t&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:s}=i,n=this.appSegments.some((e=>!this.file.available(e.offset||e.start,e.length||e.size)));if(t=e>s&&!n?!(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,n,r,a,o,{file:l,findAll:h,wanted:p,remaining:d,options:u}=this;for(;e<t;e++)if(255===l.getUint8(e))if(i=l.getUint8(e+1),rn(i)){if(s=l.getUint16(e+2),n=an(l,e,s),n&&p.has(n)&&(r=Cs.get(n),a=r.findPosition(l,e),o=u[n],a.type=n,this.appSegments.push(a),!h&&(r.multiSegment&&o.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||d.delete(n)):d.delete(n),0===d.size)))break;u.recordUnknownSegments&&(a=sn.findPosition(l,e),a.marker=i,this.unknownSegments.push(a)),e+=s+1}else if(nn(i)){if(s=l.getUint16(e+2),218===i&&!1!==u.stopAfterSos)return;u.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,n,r=new Map;for(let a=0;a<e.length;a++)i=e[a],s=i.type,r.has(s)?n=r.get(s):r.set(s,n=[]),n.push(i);return Array.from(r)}(this.appSegments);this.mergedAppSegments=e.map((([e,t])=>{let i=Cs.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}}as(on,"type","jpeg"),Fs.set("jpeg",on);const ln=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class hn extends sn{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:n}=this.options[t];s=new Set(s);let r=s.size>0,a=0===n.size,o=this.chunk.getUint16(e);e+=2;for(let l=0;l<o;l++){let o=this.chunk.getUint16(e);if(r){if(s.has(o)&&(i.set(o,this.parseTag(e,o,t)),s.delete(o),0===s.size))break}else!a&&n.has(o)||i.set(o,this.parseTag(e,o,t));e+=12}return i}parseTag(e,t,i){let{chunk:s}=this,n=s.getUint16(e+2),r=s.getUint32(e+4),a=ln[n];if(a*r<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&ms(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&ms(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),1===n)return s.getUint8Array(e,r);if(2===n)return""===(o=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(o=s.getString(e,r)).trim())?void 0:o;var o;if(7===n)return s.getUint8Array(e,r);if(1===r)return this.parseTagValue(n,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}}(n))(r),i=a;for(let s=0;s<r;s++)t[s]=this.parseTagValue(n,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:ms(`Invalid tiff type ${e}`)}}}class pn extends hn{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&&ms("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&ms(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,gs(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,gs(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",dn(...e.get(2),e.get(1))),e.set("longitude",dn(...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 Ls)if(e=this[t],!fs(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 dn(e,t,i,s){var n=e+t/60+i/3600;return"S"!==s&&"W"!==s||(n*=-1),n}as(pn,"type","tiff"),as(pn,"headerLength",10),Cs.set("tiff",pn),Object.freeze({__proto__:null,default:tn,Exifr:Js,fileParsers:Fs,segmentParsers:Cs,fileReaders:Ss,tagKeys:Ns,tagValues:Us,tagRevivers:Bs,createDictionary:As,extendDictionary:Ms,fetchUrlAsArrayBuffer:ks,readBlobAsArrayBuffer:Ts,chunkedProps:Is,otherSegments:Rs,segments:zs,tiffBlocks:Ls,segmentsAndBlocks:js,tiffExtractables:Hs,inheritables:qs,allFormatters:Ws,Options:Ys,parse:en});const un={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},un,{firstChunkSize:4e4,gps:[1,2,3,4]}),Object.assign({},un,{tiff:!1,ifd1:!0,mergeOutput:!1});const cn=Object.assign({},un,{firstChunkSize:4e4,ifd0:[274]});const fn=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 mn=!0,gn=!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);mn=s<13.4,gn=!1}}else if(e.includes("OS X 10")){let[,t]=e.match(/OS X 10[_.](\d+)/);mn=gn=Number(t)<15}if(e.includes("Chrome/")){let[,t]=e.match(/Chrome\/(\d+)/);mn=gn=Number(t)<81}else if(e.includes("Firefox/")){let[,t]=e.match(/Firefox\/(\d+)/);mn=gn=Number(t)<77}}async function yn(e){let t=await async function(e){let t=new Js(cn);await t.read(e);let i=await t.parse();if(i&&i.ifd0)return i.ifd0[274]}(e);return Object.assign({canvas:mn,css:gn},fn[t])}class vn extends bs{constructor(...e){super(...e),as(this,"ranges",new bn),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=us?ds.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 bn{constructor(){as(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let s=e+t,n=this.list.filter((t=>wn(e,t.offset,s)||wn(e,t.end,s)));if(n.length>0){e=Math.min(e,...n.map((e=>e.offset))),s=Math.max(s,...n.map((e=>e.end))),t=s-e;let i=n.shift();i.offset=e,i.length=t,i.end=s,this.list=this.list.filter((e=>!n.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 wn(e,t,i){return e<=t&&t<=i}class _n extends vn{constructor(e,t){super(0),as(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(){}}Ss.set("blob",class extends _n{async readWhole(){this.chunked=!1;let e=await Ts(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),n=await Ts(s);return this.set(n,e,!0)}});var Fn={strings:{generatingThumbnails:"Generating thumbnails..."}};function Cn(e,t,i){try{e.getContext("2d").getImageData(0,0,1,1)}catch(s){if(18===s.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,n;const r=ss.exec(e),a=null!=(s=null!=(n=t.mimeType)?n:null==r?void 0:r[1])?s:"plain/text";let o;if(null!=(null==r?void 0:r[2])){const e=atob(decodeURIComponent(r[3])),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);o=[t]}else null!=(null==r?void 0:r[3])&&(o=[decodeURIComponent(r[3])]);return i?new File(o,t.name||"",{type:a}):new Blob(o,{type:a})}(e.toDataURL(t,i),{}))).then((e=>{if(null===e)throw new Error("could not extract blob, probably an old browser");return e}))}const Sn={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class Pn extends pi{constructor(e,t){if(super(e,{...Sn,...t}),this.onFileAdded=e=>{!e.preview&&e.data&&rs(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&&ns(e.preview)&&URL.revokeObjectURL(e.preview)},this.onRestored=()=>{this.uppy.getFiles().filter((e=>e.isRestored)).forEach((e=>{e.preview&&!ns(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,this.defaultLocale=Fn,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),n=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"))}))})),r=yn(e.data).catch((()=>1));return Promise.all([n,r]).then((e=>{let[s,n]=e;const r=this.getProportionalDimensions(s,t,i,n.deg),a=function(e,t){let i=e.width,s=e.height;90!==t.deg&&270!==t.deg||(i=e.height,s=e.width);const n=document.createElement("canvas");n.width=i,n.height=s;const r=n.getContext("2d");return r.translate(i/2,s/2),t.canvas&&(r.rotate(t.rad),r.scale(t.scaleX,t.scaleY)),r.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),n}(s,n);return Cn(this.resizeImage(a,r.width,r.height),this.thumbnailType,80)})).then((e=>URL.createObjectURL(e)))}getProportionalDimensions(e,t,i,s){let n=e.width/e.height;return 90!==s&&270!==s||(n=e.height/e.width),null!=t?{width:t,height:Math.round(t/n)}:null!=i?{width:Math.round(i*n),height:i}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,i){let s=function(e){const t=e.width/e.height,i=5e6,s=4096;let n=Math.floor(Math.sqrt(i*t)),r=Math.floor(i/Math.sqrt(i*t));if(n>s&&(n=s,r=Math.round(n/t)),r>s&&(r=s,n=Math.round(t*r)),e.width>n){const t=document.createElement("canvas");return t.width=n,t.height=r,t.getContext("2d").drawImage(e,0,0,n,r),t}return e}(e),n=Math.ceil(Math.log2(s.width/t));n<1&&(n=1);let r=t*2**(n-1),a=i*2**(n-1);for(;n--;){const e=document.createElement("canvas");e.width=r,e.height=a,e.getContext("2d").drawImage(s,0,0,r,a),s=e,r=Math.round(r/2),a=Math.round(a/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 rs(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 xn(e){if("string"==typeof e){const t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&ii(e)?[e]:null}Pn.VERSION="3.1.0";var On=Array.from;function Dn(e,t,i,s){let{onSuccess:n}=s;e.readEntries((s=>{const r=[...t,...s];s.length?queueMicrotask((()=>{Dn(e,r,i,{onSuccess:n})})):n(r)}),(e=>{i(e),n(t)}))}function kn(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=>{Dn(i,[],t,{onSuccess:i=>e(i.map((e=>kn(e,t))))})}));yield*s},isSameEntry:void 0}}function Tn(e,t,i){try{return void 0===i&&(i=void 0),async function*(){const s=()=>`${t}/${e.name}`;if("file"===e.kind){const n=await e.getFile();null!=n?(n.relativePath=t?s():null,yield n):null!=i&&(yield i)}else if("directory"===e.kind)for await(const i of e.values())yield*Tn(i,t?s():e.name);else null!=i&&(yield i)}()}catch(s){return Promise.reject(s)}}async function En(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=kn("function"==typeof e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry(),t)),{fileSystemHandle:i,lastResortFile:e.getAsFile()}})));for(const{lastResortFile:n,fileSystemHandle:r}of i)if(null!=r)try{yield*Tn(r,"",n)}catch(s){null!=n?yield n:t(s)}else null!=n&&(yield n)}(e,s))t.push(i);return t}catch{return function(e){const t=On(e.files);return Promise.resolve(t)}(e)}}!function(e){var t=Object.prototype.hasOwnProperty,i="~";function s(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,s,r,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new n(s,r||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new s:delete e._events[t]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var e,s,n=[];if(0===this._eventsCount)return n;for(s in e=this._events)t.call(e,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},o.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 n=0,r=s.length,a=new Array(r);n<r;n++)a[n]=s[n].fn;return a},o.prototype.listenerCount=function(e){var t=i?i+e:e,s=this._events[t];return s?s.fn?1:s.length:0},o.prototype.emit=function(e,t,s,n,r,a){var o=i?i+e:e;if(!this._events[o])return!1;var l,h,p=this._events[o],d=arguments.length;if(p.fn){switch(p.once&&this.removeListener(e,p.fn,void 0,!0),d){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,t),!0;case 3:return p.fn.call(p.context,t,s),!0;case 4:return p.fn.call(p.context,t,s,n),!0;case 5:return p.fn.call(p.context,t,s,n,r),!0;case 6:return p.fn.call(p.context,t,s,n,r,a),!0}for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];p.fn.apply(p.context,l)}else{var u,c=p.length;for(h=0;h<c;h++)switch(p[h].once&&this.removeListener(e,p[h].fn,void 0,!0),d){case 1:p[h].fn.call(p[h].context);break;case 2:p[h].fn.call(p[h].context,t);break;case 3:p[h].fn.call(p[h].context,t,s);break;case 4:p[h].fn.call(p[h].context,t,s,n);break;default:if(!l)for(u=1,l=new Array(d-1);u<d;u++)l[u-1]=arguments[u];p[h].fn.apply(p[h].context,l)}}return!0},o.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},o.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},o.prototype.removeListener=function(e,t,s,n){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==t||n&&!o.once||s&&o.context!==s||a(this,r);else{for(var l=0,h=[],p=o.length;l<p;l++)(o[l].fn!==t||n&&!o[l].once||s&&o[l].context!==s)&&h.push(o[l]);h.length?this._events[r]=1===h.length?h[0]:h:a(this,r)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,e.exports=o}({exports:{}}),globalThis&&globalThis.__classPrivateFieldGet,globalThis&&globalThis.__classPrivateFieldSet,globalThis&&globalThis.__classPrivateFieldGet;var An,Mn,Nn,Un,Bn=0,In=[],Rn=mt,zn=Rn.__b,Ln=Rn.__r,jn=Rn.diffed,Hn=Rn.__c,qn=Rn.unmount,Wn=Rn.__;function $n(e,t){Rn.__h&&Rn.__h(Mn,e,Bn||t),Bn=0;var i=Mn.__H||(Mn.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function Vn(e){return Bn=1,function(e,t,i){var s=$n(An++,2);if(s.t=e,!s.__c&&(s.__=[i?i(t):ir(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=Mn,!Mn.__f)){var n=function(e,t,i){if(!s.__c.__H)return!0;var n=s.__c.__H.__.filter((function(e){return!!e.__c}));if(n.every((function(e){return!e.__N})))return!r||r.call(this,e,t,i);var a=s.__c.props!==e;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),r&&r.call(this,e,t,i)||a};Mn.__f=!0;var r=Mn.shouldComponentUpdate,a=Mn.componentWillUpdate;Mn.componentWillUpdate=function(e,t,i){if(this.__e){var s=r;r=void 0,n(e,t,i),r=s}a&&a.call(this,e,t,i)},Mn.shouldComponentUpdate=n}return s.__N||s.__}(ir,e)}function Xn(e,t){var i=$n(An++,3);!Rn.__s&&tr(i.__H,t)&&(i.__=e,i.u=t,Mn.__H.__h.push(i))}function Gn(e){return Bn=5,Yn((function(){return{current:e}}),[])}function Yn(e,t){var i=$n(An++,7);return tr(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function Kn(){for(var e;e=In.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Jn),e.__H.__h.forEach(er),e.__H.__h=[]}catch(t){e.__H.__h=[],Rn.__e(t,e.__v)}}Rn.__b=function(e){Mn=null,zn&&zn(e)},Rn.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Wn&&Wn(e,t)},Rn.__r=function(e){Ln&&Ln(e),An=0;var t=(Mn=e.__c).__H;t&&(Nn===Mn?(t.__h=[],Mn.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(Jn),t.__h.forEach(er),t.__h=[],An=0)),Nn=Mn},Rn.diffed=function(e){jn&&jn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==In.push(t)&&Un===Rn.requestAnimationFrame||((Un=Rn.requestAnimationFrame)||Zn)(Kn)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),Nn=Mn=null},Rn.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Jn),e.__h=e.__h.filter((function(e){return!e.__||er(e)}))}catch(i){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Rn.__e(i,e.__v)}})),Hn&&Hn(e,t)},Rn.unmount=function(e){qn&&qn(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach((function(e){try{Jn(e)}catch(i){t=i}})),i.__H=void 0,t&&Rn.__e(t,i.__v))};var Qn="function"==typeof requestAnimationFrame;function Zn(e){var t,i=function(){clearTimeout(s),Qn&&cancelAnimationFrame(t),setTimeout(e)},s=setTimeout(i,35);Qn&&(t=requestAnimationFrame(i))}function Jn(e){var t=Mn,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),Mn=t}function er(e){var t=Mn;e.__c=e.__(),Mn=t}function tr(e,t){return!e||e.length!==t.length||t.some((function(t,i){return t!==e[i]}))}function ir(e,t){return"function"==typeof t?t(e):t}function sr(){return sr=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},sr.apply(this,arguments)}const nr={position:"relative",width:"100%",minHeight:"100%"},rr={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class ar extends Ut{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:n=10,...r}=e;const{offset:a,height:o}=this.state;let l=Math.floor(a/i),h=Math.floor(o/i);n&&(l=Math.max(0,l-l%n),h+=n);const p=l+h+4,d=t.slice(l,p),u={...nr,height:t.length*i},c={...rr,top:l*i};return At("div",sr({onScroll:this.handleScroll},r),At("div",{role:"presentation",style:u},At("div",{role:"presentation",style:c},d.map(s))))}}var or=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function lr(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(s=e[i],n=t[i],!(s===n||or(s)&&or(n)))return!1;var s,n;return!0}function hr(e,t){void 0===t&&(t=lr);var i=null;function s(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];if(i&&i.lastThis===this&&t(s,i.lastArgs))return i.lastResult;var r=e.apply(this,s);return i={lastResult:r,lastArgs:s,lastThis:this},r}return s.clear=function(){i=null},s}var pr=['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 dr(e,t){if(t){const i=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(i)return i}return e}function ur(e,t){const i=t[0];i&&(i.focus(),e.preventDefault())}function cr(e,t,i){const s=dr(i,t),n=On(s.querySelectorAll(pr)),r=n.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(s)?ur(e,n):e.shiftKey&&0===r?function(e,t){const i=t[t.length-1];i&&(i.focus(),e.preventDefault())}(e,n):e.shiftKey||r!==n.length-1||ur(e,n)}function fr(){const e=document.body;return"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&("FormData"in window&&"FileReader"in window)}function mr(e){const t={color:"#838999",icon:At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},At("g",{fill:"#A7AFB7",fillRule:"nonzero"},At("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"}),At("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];if("text"===i)return{color:"#5a5e69",icon:At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},At("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"}))};if("image"===i)return{color:"#686de0",icon:At("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},At("g",{fill:"#686DE0",fillRule:"evenodd"},At("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"}),At("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"}),At("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))};if("audio"===i)return{color:"#068dbb",icon:At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},At("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"}))};if("video"===i)return{color:"#19af67",icon:At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},At("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"}))};if("application"===i&&"pdf"===s)return{color:"#e25149",icon:At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},At("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"}))};return"application"===i&&-1!==["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(s)?{color:"#00C469",icon:At("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},At("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 gr(e){const{file:t}=e;if(t.preview)return At("img",{className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});const{color:i,icon:s}=mr(t.type);return At("div",{className:"uppy-Dashboard-Item-previewIconWrap"},At("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:i}},s),At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},At("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}function yr(e){const{file:t,toggleFileCard:i,i18n:s,metaFields:n}=e,{missingRequiredMetaFields:r}=t;if(null==r||!r.length)return null;const a=r.map((e=>((e,t)=>("function"==typeof t?t():t).filter((t=>t.id===e))[0].name)(e,n))).join(", ");return At("div",{className:"uppy-Dashboard-Item-errorMessage"},s("missingRequiredMetaFields",{smart_count:r.length,fields:a})," ",At("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>i(!0,t.id)},s("editFile")))}function vr(e){const{file:t,i18n:i,toggleFileCard:s,metaFields:n,showLinkToFileUploadResult:r}=e;return At("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:t.preview?"rgba(255, 255, 255, 0.5)":mr(t.type).color}},r&&t.uploadURL&&At("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name},At("span",{hidden:!0},t.meta.name)),At(gr,{file:t}),At(yr,{file:t,i18n:i,toggleFileCard:s,metaFields:n}))}function br(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 wr(e){return At("div",{className:"uppy-Dashboard-Item-progress"},At("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":br(e),title:br(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 _r(e){let{children:t}=e;return At("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 Fr(e){let{progress:t}=e;const i=2*Math.PI*15;return At("g",null,At("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),At("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 Cr(e){return e.file.progress.uploadStarted?e.isUploaded?At("div",{className:"uppy-Dashboard-Item-progress"},At("div",{className:"uppy-Dashboard-Item-progressIndicator"},At(_r,null,At("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),At("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?At(wr,e,At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},At("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),At("path",{d:"M7.9 3H10v2H7.9z"}),At("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),At("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):e.resumableUploads&&!e.hidePauseResumeButton?At(wr,e,At(_r,null,At(Fr,{progress:e.file.progress.percentage}),e.file.isPaused?At("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):At("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},At("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),At("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?At("div",{className:"uppy-Dashboard-Item-progress"},At("div",{className:"uppy-Dashboard-Item-progressIndicator"},At(_r,null,At(Fr,{progress:e.file.progress.percentage})))):At(wr,e,At(_r,null,At(Fr,{progress:e.file.progress.percentage}),At("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}function Sr(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<="...".length+1)return`${e.slice(0,t-1)}…`;const i=t-"...".length,s=Math.ceil(i/2),n=Math.floor(i/2);return e.slice(0,s)+"..."+e.slice(-n)}const Pr=e=>{let{file:t,onClick:i}=e;return t.error?At("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 xr(e){const{file:t}=e;return At("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source},At("div",{className:"uppy-Dashboard-Item-fileName"},(e=>{const{author:t,name:i}=e.file.meta;return At("div",{className:"uppy-Dashboard-Item-name",title:i},Sr(i,e.isSingleFile&&e.containerHeight>=350?90:e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30))})(e),At(Pr,{file:e.file,onClick:()=>alert(e.file.error)})),At("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?At("div",{className:"uppy-Dashboard-Item-author"},At("a",{href:`${i.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Sr(i.name,13)),s?At(Nt,null," · ",s," · "):null):null})(e),(e=>e.file.size&&At("div",{className:"uppy-Dashboard-Item-statusSize"},we(e.file.size)))(e),(e=>e.file.isGhost&&At("span",null," • ",At("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:e.toggleAddFilesPanel},e.i18n("reSelect"))))(e)),At(yr,{file:e.file,i18n:e.i18n,toggleFileCard:e.toggleFileCard,metaFields:e.metaFields}))}function Or(e){let{file:t,uploadInProgressOrComplete:i,metaFields:s,canEditFile:n,i18n:r,onClick:a}=e;return!i&&s&&s.length>0||!i&&n(t)?At("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":r("editFileWithFilename",{file:t.meta.name}),title:r("editFileWithFilename",{file:t.meta.name}),onClick:()=>a()},At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},At("g",{fillRule:"evenodd"},At("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"}),At("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),At("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function Dr(e){let{i18n:t,onClick:i,file:s}=e;return At("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()},At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},At("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"}),At("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 kr=(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 n=()=>{document.body.removeChild(t),window.prompt(s,i),e()};try{return document.execCommand("copy")?(document.body.removeChild(t),e()):n()}catch(r){return document.body.removeChild(t),n()}}))).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 Tr(e){const{i18n:t}=e;return At("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=>kr(t,e)},At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},At("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 Er(e){const{uppy:t,file:i,uploadInProgressOrComplete:s,canEditFile:n,metaFields:r,showLinkToFileUploadResult:a,showRemoveButton:o,i18n:l,toggleFileCard:h,openFileEditor:p}=e;return At("div",{className:"uppy-Dashboard-Item-actionWrapper"},At(Or,{i18n:l,file:i,uploadInProgressOrComplete:s,canEditFile:n,metaFields:r,onClick:()=>{r&&r.length>0?h(!0,i.id):p(i)}}),a&&i.uploadURL?At(Tr,{file:i,uppy:t,i18n:l}):null,o?At(Dr,{i18n:l,file:i,uppy:t,onClick:()=>t.removeFile(i.id,"removed-by-user")}):null)}class Ar extends Ut{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!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}(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,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,r=e.error||!1,{isGhost:a}=e;let o=(this.props.individualCancellation||!n)&&!i;i&&this.props.showRemoveButtonAfterComplete&&(o=!0);return At("div",{className:mi({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!r,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a}),id:`uppy_${e.id}`,role:this.props.role},At("div",{className:"uppy-Dashboard-Item-preview"},At(vr,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),At(Cr,{uppy:this.props.uppy,file:e,error:r,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})),At("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},At(xr,{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}),At(Er,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:o,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}}function Mr(e){let{id:t,error:i,i18n:s,uppy:n,files:r,acquirers:a,resumableUploads:o,hideRetryButton:l,hidePauseResumeButton:h,hideCancelButton:p,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:u,isWide:c,metaFields:f,isSingleFile:m,toggleFileCard:g,handleRequestThumbnail:y,handleCancelThumbnail:v,recoveredState:b,individualCancellation:w,itemsPerRow:_,openFileEditor:F,canEditFile:C,toggleAddFilesPanel:S,containerWidth:P,containerHeight:x}=e;const O=1===_?71:200,D=Yn((()=>{const e=Object.keys(r);return b&&e.sort(((e,t)=>r[t].isGhost-r[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,_)}),[r,_,b]),k=e=>At("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:e[0]},e.map((e=>At(Ar,{key:e,uppy:n,id:t,error:i,i18n:s,acquirers:a,resumableUploads:o,individualCancellation:w,hideRetryButton:l,hidePauseResumeButton:h,hideCancelButton:p,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:u,isWide:c,metaFields:f,recoveredState:b,isSingleFile:m,containerWidth:P,containerHeight:x,toggleFileCard:g,handleRequestThumbnail:y,handleCancelThumbnail:v,role:"listitem",openFileEditor:F,canEditFile:C,toggleAddFilesPanel:S,file:r[e]}))));return m?At("div",{class:"uppy-Dashboard-files"},k(D[0])):At(ar,{class:"uppy-Dashboard-files",role:"list",data:D,renderRow:k,rowHeight:O})}let Nr;Nr=Symbol.for("uppy test: disable unused locale key warning");class Ur extends Ut{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)=>At("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 At("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=()=>At("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},At("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},At("div",{className:"uppy-DashboardTab-inner"},At("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},At("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"}))),At("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>At("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},At("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},At("div",{className:"uppy-DashboardTab-inner"},At("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},At("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"}))),At("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>At("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},At("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},At("div",{className:"uppy-DashboardTab-inner"},At("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},At("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 "}))),At("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>At("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,n=s.charAt(0).toUpperCase()+s.slice(1);return At("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:t,browseFolders:i,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:i,browse:t}))},this.renderAcquirer=e=>{var t;return At("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},At("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":(null==(t=this.props.activePickerPanel)?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},At("div",{className:"uppy-DashboardTab-inner"},e.icon()),At("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{const t=[...e],i=t.splice(e.length-2,e.length);return At(Nt,null,t.map((e=>this.renderAcquirer(e))),At("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 n=[];const r="myDevice";t||n.push({key:r,elements:this.renderMyDeviceAcquirer()}),i&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),s&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map((e=>({key:e.id,elements:this.renderAcquirer(e)}))));1===n.length&&n[0].key===r&&(n=[]);const a=[...n],o=a.splice(n.length-2,n.length),l=e=>e.map((e=>{let{key:t,elements:i}=e;return At(Nt,{key:t},i)}));return At(Nt,null,this.renderDropPasteBrowseTagline(n.length),At("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l(a),At("span",{role:"presentation",style:{"white-space":"nowrap"}},l(o))))}}[Nr](){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=At("span",null,At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},At("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),At("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy"));return At("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 At("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),At("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&At("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))}}const Br=e=>At("div",{className:mi("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":!e.showAddFilesPanel},At("div",{className:"uppy-DashboardContent-bar"},At("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("addingMoreFiles")),At("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1)},e.i18n("back"))),At(Ur,e));function Ir(e){const{tagName:t}=e.target;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()}function Rr(e){let{activePickerPanel:t,className:i,hideAllPanels:s,i18n:n,state:r,uppy:a}=e;return At("div",{className:mi("uppy-DashboardContent-panel",i),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${t.id}`,onDragOver:Ir,onDragLeave:Ir,onDrop:Ir,onPaste:Ir},At("div",{className:"uppy-DashboardContent-bar"},At("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},n("importFrom",{name:t.name})),At("button",{className:"uppy-DashboardContent-back",type:"button",onClick:s},n("cancel"))),At("div",{className:"uppy-DashboardContent-panelBody"},a.getPlugin(t.id).render(r)))}function zr(e){const t=e.files[e.fileCardFor];return At("div",{className:mi("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},At("div",{className:"uppy-DashboardContent-bar"},At("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18nArray("editing",{file:At("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),At("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>{e.uppy.emit("file-editor:cancel",t),e.closeFileEditor()}},e.i18n("cancel")),At("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor},e.i18n("save"))),At("div",{className:"uppy-DashboardContent-panelBody"},e.editors.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))}const Lr="error",jr="waiting",Hr="preprocessing",qr="uploading",Wr="postprocessing",$r="complete",Vr="paused";function Xr(e){let{files:t,i18n:i,isAllComplete:s,isAllErrored:n,isAllPaused:r,inProgressNotPausedFiles:a,newFiles:o,processingFiles:l}=e;const h=function(e,t,i,s){if(void 0===s&&(s={}),e)return Lr;if(t)return $r;if(i)return Vr;let n=jr;const r=Object.keys(s);for(let a=0;a<r.length;a++){const{progress:e}=s[r[a]];if(e.uploadStarted&&!e.uploadComplete)return qr;e.preprocess&&n!==qr&&(n=Hr),e.postprocess&&n!==qr&&n!==Hr&&(n=Wr)}return n}(n,s,r,t);switch(h){case"uploading":return i("uploadingXFiles",{smart_count:a.length});case"preprocessing":case"postprocessing":return i("processingXFiles",{smart_count:l.length});case"paused":return i("uploadPaused");case"waiting":return i("xFilesSelected",{smart_count:o.length});case"complete":return i("uploadComplete");case"error":return i("error")}}function Gr(e){const{i18n:t,isAllComplete:i,hideCancelButton:s,maxNumberOfFiles:n,toggleAddFilesPanel:r,uppy:a}=e;let{allowNewUpload:o}=e;return o&&n&&(o=e.totalFileCount<e.maxNumberOfFiles),At("div",{className:"uppy-DashboardContent-bar"},i||s?At("div",null):At("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll()},t("cancel")),At("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},At(Xr,e)),o?At("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>r(!0)},At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},At("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"})),At("span",{className:"uppy-DashboardContent-addMoreCaption"},t("addMore"))):At("div",null))}function Yr(e){const{computedMetaFields:t,requiredMetaFields:i,updateMeta:s,form:n,formState:r}=e,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map((e=>{const t=`uppy-Dashboard-FileCard-input-${e.id}`,o=i.includes(e.id);return At("fieldset",{key:e.id,className:"uppy-Dashboard-FileCard-fieldset"},At("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:t},e.name),void 0!==e.render?e.render({value:r[e.id],onChange:t=>s(t,e.id),fieldCSSClasses:a,required:o,form:n.id},At):At("input",{className:a.text,id:t,form:n.id,type:e.type||"text",required:o,value:r[e.id],placeholder:e.placeholder,onInput:t=>s(t.target.value,e.id),"data-uppy-super-focusable":!0}))}))}function Kr(e){var t;const{files:i,fileCardFor:s,toggleFileCard:n,saveFileCard:r,metaFields:a,requiredMetaFields:o,openFileEditor:l,i18n:h,i18nArray:p,className:d,canEditFile:u}=e,c=i[s],f=null!=(t="function"==typeof a?a(i[s]):a)?t:[],m=u(c),g={};f.forEach((e=>{var t;g[e.id]=null!=(t=c.meta[e.id])?t:""}));const[y,v]=Vn(g),w=(_=e=>{e.preventDefault(),r(y,s)},Bn=8,Yn((function(){return _}),[r,y,s]));var _;const F=()=>{n(!1)},[C]=Vn((()=>{const e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=b(),e}));return Xn((()=>(document.body.appendChild(C),C.addEventListener("submit",w),()=>{C.removeEventListener("submit",w),document.body.removeChild(C)})),[C,w]),At("div",{className:mi("uppy-Dashboard-FileCard",d),"data-uppy-panelType":"FileCard",onDragOver:Ir,onDragLeave:Ir,onDrop:Ir,onPaste:Ir},At("div",{className:"uppy-DashboardContent-bar"},At("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},p("editing",{file:At("span",{className:"uppy-DashboardContent-titleFile"},c.meta?c.meta.name:c.name)})),At("button",{className:"uppy-DashboardContent-back",type:"button",form:C.id,title:h("finishEditingFile"),onClick:F},h("cancel"))),At("div",{className:"uppy-Dashboard-FileCard-inner"},At("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:mr(c.type).color}},At(gr,{file:c}),m&&At("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:e=>{w(e),l(c)}},h("editImage"))),At("div",{className:"uppy-Dashboard-FileCard-info"},At(Yr,{computedMetaFields:f,requiredMetaFields:o,updateMeta:(e,t)=>{v({...y,[t]:e})},form:C,formState:y})),At("div",{className:"uppy-Dashboard-FileCard-actions"},At("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:C.id},h("saveChanges")),At("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:F,form:C.id},h("cancel")))))}const Qr="uppy-transition-slideDownUp";function Zr(e){let{children:t}=e;const[i,s]=Vn(null),[n,r]=Vn(""),a=Gn(),o=Gn(),l=Gn();return Xn((()=>{const e=Ht(t)[0];i!==e&&(e&&!i?(r(`${Qr}-enter`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame((()=>{r(`${Qr}-enter ${Qr}-enter-active`),a.current=setTimeout((()=>{r("")}),250)}))):!i||e||o.current||(r(`${Qr}-leave`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame((()=>{r(`${Qr}-leave ${Qr}-leave-active`),o.current=setTimeout((()=>{s(null),r("")}),250)}))),s(e))}),[t,i]),Xn((()=>()=>{clearTimeout(a.current),clearTimeout(o.current),cancelAnimationFrame(l.current)}),[]),i?ti(i,{className:mi(n,i.props.className)}):null}function Jr(){return Jr=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},Jr.apply(this,arguments)}var ea={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 ta(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var ia=0;function sa(e){return"__private_"+ia+++"_"+e}const na=hr.default||hr;function ra(){const e={};return e.promise=new Promise(((t,i)=>{e.resolve=t,e.reject=i})),e}const aa={target:"body",metaFields:[],inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:function(){return At("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},At("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"}))},showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1,doneButtonHandler:void 0,onRequestCloseModal:null};var oa=sa("disabledNodes"),la=sa("generateLargeThumbnailIfSingleFile"),ha=sa("openFileEditorWhenFilesAdded"),pa=sa("attachRenderFunctionToTarget"),da=sa("isTargetSupported"),ua=sa("getAcquirers"),ca=sa("getProgressIndicators"),fa=sa("getEditors"),ma=sa("addSpecifiedPluginsFromOptions"),ga=sa("autoDiscoverPlugins"),ya=sa("addSupportedPluginIfNoTarget");class va extends pi{constructor(e,t){var i;let s;s=t?void 0===t.autoOpen?t.autoOpenFileEditor?"imageEditor":null:t.autoOpen:null,super(e,{...aa,...t,autoOpen:s}),Object.defineProperty(this,oa,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${b()}`,this.superFocus=function(){let e=!1;return te(((t,i)=>{const s=dr(t,i),n=s.contains(document.activeElement);if(n&&e)return;const r=s.querySelector("[data-uppy-super-focusable]");if(!n||r)if(r)r.focus({preventScroll:!0}),e=!0;else{const t=s.querySelector(pr);null==t||t.focus({preventScroll:!0}),e=!1}}),260)}(),this.ifFocusedOnUppyRecently=!1,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 this.uppy.log(e,"error"),null}const n={id:t,name:i,type:s},r=this.getPluginState().targets.slice();return r.push(n),this.setPluginState({targets:r}),this.el},this.hideAllPanels=()=>{var e;const t=this.getPluginState(),i={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};t.activePickerPanel===i.activePickerPanel&&t.showAddFilesPanel===i.showAddFilesPanel&&t.showFileEditor===i.showFileEditor&&t.activeOverlayType===i.activeOverlayType||(this.setPluginState(i),this.uppy.emit("dashboard:close-panel",null==(e=t.activePickerPanel)?void 0:e.id))},this.showPanel=e=>{const{targets:t}=this.getPluginState(),i=t.find((t=>"acquirer"===t.type&&t.id===e));this.setPluginState({activePickerPanel:i,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",e)},this.canEditFile=e=>{const{targets:t}=this.getPluginState();return ta(this,fa)[fa](t).some((t=>this.uppy.getPlugin(t.id).canEditFile(e)))},this.openFileEditor=e=>{const{targets:t}=this.getPluginState(),i=ta(this,fa)[fa](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();ta(this,fa)[fa](e).forEach((e=>{this.uppy.getPlugin(e.id).save()})),this.closeFileEditor()},this.openModal=()=>{const{promise:e,resolve:t}=ra();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=e=>{var t;const i=null==(t=null==e?void 0:e.manualClose)||t,{isHidden:s,isClosing:n}=this.getPluginState();if(s||n)return;const{promise:r,resolve:a}=ra();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});const e=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",e,!1),a()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),a();var o;(document.removeEventListener("keydown",this.handleKeyDownInModal),i)&&(this.opts.browserBackButtonClose&&null!=(o=history.state)&&o[this.modalName]&&history.back());return this.uppy.emit("dashboard:modal-closed"),r},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(i){this.uppy.log(i)}},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=ta(this,oa)[oa])?t:On(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 s of i)"A"===s.tagName?s.setAttribute("aria-disabled",e):s.disabled=e;ta(this,oa)[oa]=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(),9===e.keyCode&&cr(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=On(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))},this.handleInputChange=e=>{e.preventDefault();const t=On(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})(),n=(()=>{const{types:t}=e.dataTransfer;return t.some((e=>"Files"===e))})();if(!s&&!n||this.opts.disabled||this.opts.disableLocalFiles&&(n||!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 n=await En(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),s||(this.uppy.info(e.message,"error"),s=!0)}});n.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(n)),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||cr(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||null!=t&&t.length||this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,la,{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};null==t||t.requestThumbnail(i).then((()=>{null==t||t.setOptions({thumbnailWidth:this.opts.thumbnailWidth})}))}}}),Object.defineProperty(this,ha,{writable:!0,value:e=>{const t=e[0],{metaFields:i}=this.getPluginState(),s=i&&i.length>0,n=this.canEditFile(t);s&&"metaEditor"===this.opts.autoOpen?this.toggleFileCard(!0,t.id):n&&"imageEditor"===this.opts.autoOpen&&this.openFileEditor(t)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const e=xn(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",ta(this,ya)[ya]),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",ta(this,la)[la]),this.uppy.on("file-removed",ta(this,la)[la]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",ta(this,ha)[ha])},this.removeEvents=()=>{const e=xn(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",ta(this,ya)[ya]),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",ta(this,la)[la]),this.uppy.off("file-removed",ta(this,la)[la]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",ta(this,ha)[ha])},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,pa,{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,da,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()}}),Object.defineProperty(this,ua,{writable:!0,value:na((e=>e.filter((e=>"acquirer"===e.type&&ta(this,da)[da](e))).map(ta(this,pa)[pa])))}),Object.defineProperty(this,ca,{writable:!0,value:na((e=>e.filter((e=>"progressindicator"===e.type)).map(ta(this,pa)[pa])))}),Object.defineProperty(this,fa,{writable:!0,value:na((e=>e.filter((e=>"editor"===e.type)).map(ta(this,pa)[pa])))}),this.render=e=>{const t=this.getPluginState(),{files:i,capabilities:s,allowNewUpload:n}=e,{newFiles:r,uploadStartedFiles:a,completeFiles:o,erroredFiles:l,inProgressFiles:h,inProgressNotPausedFiles:p,processingFiles:d,isUploadStarted:u,isAllComplete:c,isAllErrored:f,isAllPaused:m}=this.uppy.getObjectOfFilesPerState(),g=ta(this,ua)[ua](t.targets),y=ta(this,ca)[ca](t.targets),v=ta(this,fa)[fa](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"),function(e){const t=0===e.totalFileCount,i=1===e.totalFileCount,s=e.containerWidth>576,n=e.containerHeight>330,r=mi({"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&&n});let a=1;e.containerWidth>900?a=5:e.containerWidth>700?a=4:e.containerWidth>576&&(a=3);const o=e.showSelectedFiles&&!t,l=e.recoveredState?Object.keys(e.recoveredState.files).length:null,h=e.files?Object.keys(e.files).filter((t=>e.files[t].isGhost)).length:null;return At("div",{className:r,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&fr(),"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},At("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),At("div",{className:"uppy-Dashboard-inner","aria-modal":!e.inline&&"true",role:e.inline?void 0:"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""}},e.inline?null:At("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal},At("span",{"aria-hidden":"true"},"×")),At("div",{className:"uppy-Dashboard-innerWrap"},At("div",{className:"uppy-Dashboard-dropFilesHereHint"},e.i18n("dropHint")),o&&At(Gr,e),l&&At("div",{className:"uppy-Dashboard-serviceMsg"},At("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},At("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},At("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"}),At("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),At("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),At("strong",{className:"uppy-Dashboard-serviceMsg-title"},e.i18n("sessionRestored")),At("div",{className:"uppy-Dashboard-serviceMsg-text"},h>0?e.i18n("recoveredXFiles",{smart_count:h}):e.i18n("recoveredAllFiles"))),o?At(Mr,{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:a}):At(Ur,Jr({},e,{isSizeMD:s})),At(Zr,null,e.showAddFilesPanel?At(Br,Jr({key:"AddFiles"},e,{isSizeMD:s})):null),At(Zr,null,e.fileCardFor?At(Kr,Jr({key:"FileCard"},e)):null),At(Zr,null,e.activePickerPanel?At(Rr,Jr({key:"Picker"},e)):null),At(Zr,null,e.showFileEditor?At(zr,Jr({key:"Editor"},e)):null),At("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:r,uploadStartedFiles:a,completeFiles:o,erroredFiles:l,inProgressFiles:h,inProgressNotPausedFiles:p,processingFiles:d,isUploadStarted:u,isAllComplete:c,isAllErrored:f,isAllPaused:m,totalFileCount:Object.keys(i).length,totalProgress:e.totalProgress,allowNewUpload:n,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,ma,{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,ga,{writable:!0,value:()=>{this.uppy.iteratePlugins(ta(this,ya)[ya])}}),Object.defineProperty(this,ya,{writable:!0,value:e=>{var t;if(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:void 0,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:n}=this.opts;n&&this.mount(n,this),this.opts.disableStatusBar||this.uppy.use(Ki,{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(is,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(Pn,{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 r=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;var a;(this.uppy.log("[Dashboard] Dark mode is "+(r?"on":"off")),this.setDarkModeCapability(r),"auto"===this.opts.theme)&&(null==(a=this.darkModeMediaQuery)||a.addListener(this.handleSystemDarkModeChange));ta(this,ma)[ma](),ta(this,ga)[ga](),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)}var e;((this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.unmount()})),"auto"===this.opts.theme)&&(null==(e=this.darkModeMediaQuery)||e.removeListener(this.handleSystemDarkModeChange));this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=ea,void 0===this.opts.doneButtonHandler&&(this.opts.doneButtonHandler=()=>{this.uppy.clearUploadedFiles(),this.requestCloseModal()}),null!=(i=this.opts).onRequestCloseModal||(i.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}}va.VERSION="3.9.1";var ba={data:()=>({plugin:{}}),props:{uppy:{required:!0},props:{type:Object},plugins:{type:Array}},mounted(){this.installPlugin()},methods:{installPlugin(){const{uppy:e}=this,t={id:"vue:Dashboard",inline:!0,plugins:this.plugins,...this.props,target:this.$refs.container};e.use(va,t),this.plugin=e.getPlugin(t.id)},uninstallPlugin(e){e.removePlugin(this.plugin)}},beforeDestroy(){this.uninstallPlugin(this.uppy)},beforeUnmount(){this.uninstallPlugin(this.uppy)},watch:{uppy(e,t){t!==e&&(this.uninstallPlugin(t),this.installPlugin())},props(e,t){(function(e,t){if(e===t)return!0;if(!e||!t)return!1;var i=Object.keys(e),s=Object.keys(t),n=i.length;if(s.length!==n)return!1;for(var r=0;r<n;r++){var a=i[r];if(e[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0})(e,t)||this.plugin.setOptions({...e})}},render(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];if(function(){return arguments.length>0&&"function"==typeof(arguments.length<=0?void 0:arguments[0])}(...i)){const[e]=i;return e("div",{ref:"container"})}return t("div",{ref:"container"})}},wa={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};const _a={inputName:"files[]",width:"100%",height:"100%"};class Fa extends pi{constructor(e,t){super(e,{..._a,...t}),this.isDragDropSupported=fr(),this.addFiles=e=>{const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}})));try{this.uppy.addFiles(t)}catch(i){this.uppy.log(i)}},this.onInputChange=e=>{const t=On(e.target.files);t.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(t)),e.target.value=null},this.handleDragOver=e=>{var t,i;e.preventDefault(),e.stopPropagation();const{types:s}=e.dataTransfer,n=s.some((e=>"Files"===e)),{allowNewUpload:r}=this.uppy.getState();if(!n||!r)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});const s=await En(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error")}});s.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(s)),null==(t=(i=this.opts).onDrop)||t.call(i,e)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=wa,this.i18nInit()}renderHiddenFileInput(){const{restrictions:e}=this.uppy.opts;return At("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:e=>{this.fileInputRef=e},name:this.opts.inputName,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes,onChange:this.onInputChange})}static renderArrowSvg(){return At("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},At("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return At("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:At("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return At("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){return At("button",{type:"button",className:`uppy-u-reset\n      uppy-DragDrop-container\n      ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}\n      ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}\n    `,style:{width:this.opts.width,height:this.opts.height},onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),At("div",{className:"uppy-DragDrop-inner"},Fa.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){const{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}}Fa.VERSION="3.1.1";const Ca={target:"body",fixed:!1,hideAfterFinish:!0};(class extends pi{constructor(e,t){super(e,{...Ca,...t}),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){const t=e.totalProgress||0,i=(0===t||100===t)&&this.opts.hideAfterFinish;return At("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":i},At("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),At("div",{className:"uppy-ProgressBar-percentage"},t))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}).VERSION="3.1.1";var Sa={strings:{chooseFiles:"Choose files"}};const Pa={pretty:!0,inputName:"files[]"};(class extends pi{constructor(e,t){super(e,{...Pa,...t}),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=Sa,this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e})));try{this.uppy.addFiles(t)}catch(i){this.uppy.log(i)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");const t=On(e.target.files);this.addFiles(t),e.target.value=null}handleClick(){this.input.click()}render(){const{restrictions:e}=this.uppy.opts,t=e.allowedFileTypes?e.allowedFileTypes.join(","):void 0;return At("div",{className:"uppy-FileInput-container"},At("input",{className:"uppy-FileInput-input",style:this.opts.pretty?{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1}:void 0,type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:1!==e.maxNumberOfFiles,accept:t,ref:e=>{this.input=e}}),this.opts.pretty&&At("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick},this.i18n("chooseFiles")))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}).VERSION="3.1.2";
/*!
 * Cropper.js v1.5.7
 * https://fengyuanchen.github.io/cropperjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2020-05-23T05:23:00.081Z
 */
function xa(e){return(xa="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})(e)}function Oa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Da(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function ka(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Ta(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 Ea(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Ta(Object(i),!0).forEach((function(t){ka(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Ta(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function Aa(e){return function(e){if(Array.isArray(e))return Ma(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ma(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Ma(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ma(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,s=new Array(t);i<t;i++)s[i]=e[i];return s}var Na="undefined"!=typeof window&&void 0!==window.document,Ua=Na?window:{},Ba=!(!Na||!Ua.document.documentElement)&&"ontouchstart"in Ua.document.documentElement,Ia=!!Na&&"PointerEvent"in Ua,Ra="".concat("cropper","-crop"),za="".concat("cropper","-disabled"),La="".concat("cropper","-hidden"),ja="".concat("cropper","-hide"),Ha="".concat("cropper","-invisible"),qa="".concat("cropper","-modal"),Wa="".concat("cropper","-move"),$a="".concat("cropper","Action"),Va="".concat("cropper","Preview"),Xa=Ia?"pointerdown":Ba?"touchstart":"mousedown",Ga=Ia?"pointermove":Ba?"touchmove":"mousemove",Ya=Ia?"pointerup pointercancel":Ba?"touchend touchcancel":"mouseup",Ka=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Qa=/^data:/,Za=/^data:image\/jpeg;base64,/,Ja=/^img|canvas$/i,eo={viewMode:0,dragMode:"crop",initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},to=Number.isNaN||Ua.isNaN;function io(e){return"number"==typeof e&&!to(e)}var so=function(e){return e>0&&e<1/0};function no(e){return void 0===e}function ro(e){return"object"===xa(e)&&null!==e}var ao=Object.prototype.hasOwnProperty;function oo(e){if(!ro(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&ao.call(i,"isPrototypeOf")}catch(s){return!1}}function lo(e){return"function"==typeof e}var ho=Array.prototype.slice;function po(e){return Array.from?Array.from(e):ho.call(e)}function uo(e,t){return e&&lo(t)&&(Array.isArray(e)||io(e.length)?po(e).forEach((function(i,s){t.call(e,i,s,e)})):ro(e)&&Object.keys(e).forEach((function(i){t.call(e,e[i],i,e)}))),e}var co=Object.assign||function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return ro(e)&&i.length>0&&i.forEach((function(t){ro(t)&&Object.keys(t).forEach((function(i){e[i]=t[i]}))})),e},fo=/\.\d*(?:0|9){12}\d*$/;function mo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return fo.test(e)?Math.round(e*t)/t:e}var go=/^width|height|left|top|marginLeft|marginTop$/;function yo(e,t){var i=e.style;uo(t,(function(e,t){go.test(t)&&io(e)&&(e="".concat(e,"px")),i[t]=e}))}function vo(e,t){if(t)if(io(e.length))uo(e,(function(e){vo(e,t)}));else if(e.classList)e.classList.add(t);else{var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function bo(e,t){t&&(io(e.length)?uo(e,(function(e){bo(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function wo(e,t,i){t&&(io(e.length)?uo(e,(function(e){wo(e,t,i)})):i?vo(e,t):bo(e,t))}var _o=/([a-z\d])([A-Z])/g;function Fo(e){return e.replace(_o,"$1-$2").toLowerCase()}function Co(e,t){return ro(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(Fo(t)))}function So(e,t,i){ro(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(Fo(t)),i)}var Po=/\s\s*/,xo=function(){var e=!1;if(Na){var t=!1,i=function(){},s=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});Ua.addEventListener("test",i,s),Ua.removeEventListener("test",i,s)}return e}();function Oo(e,t,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;t.trim().split(Po).forEach((function(t){if(!xo){var r=e.listeners;r&&r[t]&&r[t][i]&&(n=r[t][i],delete r[t][i],0===Object.keys(r[t]).length&&delete r[t],0===Object.keys(r).length&&delete e.listeners)}e.removeEventListener(t,n,s)}))}function Do(e,t,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;t.trim().split(Po).forEach((function(t){if(s.once&&!xo){var r=e.listeners,a=void 0===r?{}:r;n=function(){delete a[t][i],e.removeEventListener(t,n,s);for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];i.apply(e,o)},a[t]||(a[t]={}),a[t][i]&&e.removeEventListener(t,a[t][i],s),a[t][i]=n,e.listeners=a}e.addEventListener(t,n,s)}))}function ko(e,t,i){var s;return lo(Event)&&lo(CustomEvent)?s=new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0}):(s=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,i),e.dispatchEvent(s)}function To(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Eo=Ua.location,Ao=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Mo(e){var t=e.match(Ao);return null!==t&&(t[1]!==Eo.protocol||t[2]!==Eo.hostname||t[3]!==Eo.port)}function No(e){var t="timestamp=".concat((new Date).getTime());return e+(-1===e.indexOf("?")?"?":"&")+t}function Uo(e){var t=e.rotate,i=e.scaleX,s=e.scaleY,n=e.translateX,r=e.translateY,a=[];io(n)&&0!==n&&a.push("translateX(".concat(n,"px)")),io(r)&&0!==r&&a.push("translateY(".concat(r,"px)")),io(t)&&0!==t&&a.push("rotate(".concat(t,"deg)")),io(i)&&1!==i&&a.push("scaleX(".concat(i,")")),io(s)&&1!==s&&a.push("scaleY(".concat(s,")"));var o=a.length?a.join(" "):"none";return{WebkitTransform:o,msTransform:o,transform:o}}function Bo(e,t){var i=e.pageX,s=e.pageY,n={endX:i,endY:s};return t?n:Ea({startX:i,startY:s},n)}function Io(e){var t=e.aspectRatio,i=e.height,s=e.width,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",r=so(s),a=so(i);if(r&&a){var o=i*t;"contain"===n&&o>s||"cover"===n&&o<s?i=s/t:s=i*t}else r?i=s/t:a&&(s=i*t);return{width:s,height:i}}function Ro(e,t,i,s){var n=t.aspectRatio,r=t.naturalWidth,a=t.naturalHeight,o=t.rotate,l=void 0===o?0:o,h=t.scaleX,p=void 0===h?1:h,d=t.scaleY,u=void 0===d?1:d,c=i.aspectRatio,f=i.naturalWidth,m=i.naturalHeight,g=s.fillColor,y=void 0===g?"transparent":g,v=s.imageSmoothingEnabled,b=void 0===v||v,w=s.imageSmoothingQuality,_=void 0===w?"low":w,F=s.maxWidth,C=void 0===F?1/0:F,S=s.maxHeight,P=void 0===S?1/0:S,x=s.minWidth,O=void 0===x?0:x,D=s.minHeight,k=void 0===D?0:D,T=document.createElement("canvas"),E=T.getContext("2d"),A=Io({aspectRatio:c,width:C,height:P}),M=Io({aspectRatio:c,width:O,height:k},"cover"),N=Math.min(A.width,Math.max(M.width,f)),U=Math.min(A.height,Math.max(M.height,m)),B=Io({aspectRatio:n,width:C,height:P}),I=Io({aspectRatio:n,width:O,height:k},"cover"),R=Math.min(B.width,Math.max(I.width,r)),z=Math.min(B.height,Math.max(I.height,a)),L=[-R/2,-z/2,R,z];return T.width=mo(N),T.height=mo(U),E.fillStyle=y,E.fillRect(0,0,N,U),E.save(),E.translate(N/2,U/2),E.rotate(l*Math.PI/180),E.scale(p,u),E.imageSmoothingEnabled=b,E.imageSmoothingQuality=_,E.drawImage.apply(E,[e].concat(Aa(L.map((function(e){return Math.floor(mo(e))}))))),E.restore(),T}var zo=String.fromCharCode;var Lo=/^data:.*,/;function jo(e){var t,i=new DataView(e);try{var s,n,r;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var a=i.byteLength,o=2;o+1<a;){if(255===i.getUint8(o)&&225===i.getUint8(o+1)){n=o;break}o+=1}if(n){var l=n+10;if("Exif"===function(e,t,i){var s="";i+=t;for(var n=t;n<i;n+=1)s+=zo(e.getUint8(n));return s}(i,n+4,4)){var h=i.getUint16(l);if(((s=18761===h)||19789===h)&&42===i.getUint16(l+2,s)){var p=i.getUint32(l+4,s);p>=8&&(r=l+p)}}}if(r){var d,u,c=i.getUint16(r,s);for(u=0;u<c;u+=1)if(d=r+12*u+2,274===i.getUint16(d,s)){d+=8,t=i.getUint16(d,s),i.setUint16(d,1,s);break}}}catch(f){t=1}return t}var Ho={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,i=this.container,s=this.cropper;vo(s,La),bo(e,La);var n={width:Math.max(i.offsetWidth,Number(t.minContainerWidth)||200),height:Math.max(i.offsetHeight,Number(t.minContainerHeight)||100)};this.containerData=n,yo(s,{width:n.width,height:n.height}),vo(e,La),bo(s,La)},initCanvas:function(){var e=this.containerData,t=this.imageData,i=this.options.viewMode,s=Math.abs(t.rotate)%180==90,n=s?t.naturalHeight:t.naturalWidth,r=s?t.naturalWidth:t.naturalHeight,a=n/r,o=e.width,l=e.height;e.height*a>e.width?3===i?o=e.height*a:l=e.width/a:3===i?l=e.width/a:o=e.height*a;var h={aspectRatio:a,naturalWidth:n,naturalHeight:r,width:o,height:l};h.left=(e.width-o)/2,h.top=(e.height-l)/2,h.oldLeft=h.left,h.oldTop=h.top,this.canvasData=h,this.limited=1===i||2===i,this.limitCanvas(!0,!0),this.initialImageData=co({},t),this.initialCanvasData=co({},h)},limitCanvas:function(e,t){var i=this.options,s=this.containerData,n=this.canvasData,r=this.cropBoxData,a=i.viewMode,o=n.aspectRatio,l=this.cropped&&r;if(e){var h=Number(i.minCanvasWidth)||0,p=Number(i.minCanvasHeight)||0;a>1?(h=Math.max(h,s.width),p=Math.max(p,s.height),3===a&&(p*o>h?h=p*o:p=h/o)):a>0&&(h?h=Math.max(h,l?r.width:0):p?p=Math.max(p,l?r.height:0):l&&(h=r.width,(p=r.height)*o>h?h=p*o:p=h/o));var d=Io({aspectRatio:o,width:h,height:p});h=d.width,p=d.height,n.minWidth=h,n.minHeight=p,n.maxWidth=1/0,n.maxHeight=1/0}if(t)if(a>(l?0:1)){var u=s.width-n.width,c=s.height-n.height;n.minLeft=Math.min(0,u),n.minTop=Math.min(0,c),n.maxLeft=Math.max(0,u),n.maxTop=Math.max(0,c),l&&this.limited&&(n.minLeft=Math.min(r.left,r.left+(r.width-n.width)),n.minTop=Math.min(r.top,r.top+(r.height-n.height)),n.maxLeft=r.left,n.maxTop=r.top,2===a&&(n.width>=s.width&&(n.minLeft=Math.min(0,u),n.maxLeft=Math.max(0,u)),n.height>=s.height&&(n.minTop=Math.min(0,c),n.maxTop=Math.max(0,c))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=s.width,n.maxTop=s.height},renderCanvas:function(e,t){var i=this.canvasData,s=this.imageData;if(t){var n=function(e){var t=e.width,i=e.height,s=e.degree;if(90==(s=Math.abs(s)%180))return{width:i,height:t};var n=s%90*Math.PI/180,r=Math.sin(n),a=Math.cos(n),o=t*a+i*r,l=t*r+i*a;return s>90?{width:l,height:o}:{width:o,height:l}}({width:s.naturalWidth*Math.abs(s.scaleX||1),height:s.naturalHeight*Math.abs(s.scaleY||1),degree:s.rotate||0}),r=n.width,a=n.height,o=i.width*(r/i.naturalWidth),l=i.height*(a/i.naturalHeight);i.left-=(o-i.width)/2,i.top-=(l-i.height)/2,i.width=o,i.height=l,i.aspectRatio=r/a,i.naturalWidth=r,i.naturalHeight=a,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,yo(this.canvas,co({width:i.width,height:i.height},Uo({translateX:i.left,translateY:i.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,i=this.imageData,s=i.naturalWidth*(t.width/t.naturalWidth),n=i.naturalHeight*(t.height/t.naturalHeight);co(i,{width:s,height:n,left:(t.width-s)/2,top:(t.height-n)/2}),yo(this.image,co({width:i.width,height:i.height},Uo(co({translateX:i.left,translateY:i.top},i)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,i=e.aspectRatio||e.initialAspectRatio,s=Number(e.autoCropArea)||.8,n={width:t.width,height:t.height};i&&(t.height*i>t.width?n.height=n.width/i:n.width=n.height*i),this.cropBoxData=n,this.limitCropBox(!0,!0),n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth),n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight),n.width=Math.max(n.minWidth,n.width*s),n.height=Math.max(n.minHeight,n.height*s),n.left=t.left+(t.width-n.width)/2,n.top=t.top+(t.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=co({},n)},limitCropBox:function(e,t){var i=this.options,s=this.containerData,n=this.canvasData,r=this.cropBoxData,a=this.limited,o=i.aspectRatio;if(e){var l=Number(i.minCropBoxWidth)||0,h=Number(i.minCropBoxHeight)||0,p=a?Math.min(s.width,n.width,n.width+n.left,s.width-n.left):s.width,d=a?Math.min(s.height,n.height,n.height+n.top,s.height-n.top):s.height;l=Math.min(l,s.width),h=Math.min(h,s.height),o&&(l&&h?h*o>l?h=l/o:l=h*o:l?h=l/o:h&&(l=h*o),d*o>p?d=p/o:p=d*o),r.minWidth=Math.min(l,p),r.minHeight=Math.min(h,d),r.maxWidth=p,r.maxHeight=d}t&&(a?(r.minLeft=Math.max(0,n.left),r.minTop=Math.max(0,n.top),r.maxLeft=Math.min(s.width,n.left+n.width)-r.width,r.maxTop=Math.min(s.height,n.top+n.height)-r.height):(r.minLeft=0,r.minTop=0,r.maxLeft=s.width-r.width,r.maxTop=s.height-r.height))},renderCropBox:function(){var e=this.options,t=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,e.movable&&e.cropBoxMovable&&So(this.face,$a,i.width>=t.width&&i.height>=t.height?"move":"all"),yo(this.cropBox,co({width:i.width,height:i.height},Uo({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ko(this.element,"crop",this.getData())}},qo={initPreview:function(){var e=this.element,t=this.crossOrigin,i=this.options.preview,s=t?this.crossOriginUrl:this.url,n=e.alt||"The image to preview",r=document.createElement("img");if(t&&(r.crossOrigin=t),r.src=s,r.alt=n,this.viewBox.appendChild(r),this.viewBoxImage=r,i){var a=i;"string"==typeof i?a=e.ownerDocument.querySelectorAll(i):i.querySelector&&(a=[i]),this.previews=a,uo(a,(function(e){var i=document.createElement("img");So(e,Va,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(i.crossOrigin=t),i.src=s,i.alt=n,i.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(i)}))}},resetPreview:function(){uo(this.previews,(function(e){var t=Co(e,Va);yo(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(ro(e[t]))try{delete e[t]}catch(i){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(i){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(Fo(t)))}(e,Va)}))},preview:function(){var e=this.imageData,t=this.canvasData,i=this.cropBoxData,s=i.width,n=i.height,r=e.width,a=e.height,o=i.left-t.left-e.left,l=i.top-t.top-e.top;this.cropped&&!this.disabled&&(yo(this.viewBoxImage,co({width:r,height:a},Uo(co({translateX:-o,translateY:-l},e)))),uo(this.previews,(function(t){var i=Co(t,Va),h=i.width,p=i.height,d=h,u=p,c=1;s&&(u=n*(c=h/s)),n&&u>p&&(d=s*(c=p/n),u=p),yo(t,{width:d,height:u}),yo(t.getElementsByTagName("img")[0],co({width:r*c,height:a*c},Uo(co({translateX:-o*c,translateY:-l*c},e))))})))}},Wo={bind:function(){var e=this.element,t=this.options,i=this.cropper;lo(t.cropstart)&&Do(e,"cropstart",t.cropstart),lo(t.cropmove)&&Do(e,"cropmove",t.cropmove),lo(t.cropend)&&Do(e,"cropend",t.cropend),lo(t.crop)&&Do(e,"crop",t.crop),lo(t.zoom)&&Do(e,"zoom",t.zoom),Do(i,Xa,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Do(i,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Do(i,"dblclick",this.onDblclick=this.dblclick.bind(this)),Do(e.ownerDocument,Ga,this.onCropMove=this.cropMove.bind(this)),Do(e.ownerDocument,Ya,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Do(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,i=this.cropper;lo(t.cropstart)&&Oo(e,"cropstart",t.cropstart),lo(t.cropmove)&&Oo(e,"cropmove",t.cropmove),lo(t.cropend)&&Oo(e,"cropend",t.cropend),lo(t.crop)&&Oo(e,"crop",t.crop),lo(t.zoom)&&Oo(e,"zoom",t.zoom),Oo(i,Xa,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Oo(i,"wheel",this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Oo(i,"dblclick",this.onDblclick),Oo(e.ownerDocument,Ga,this.onCropMove),Oo(e.ownerDocument,Ya,this.onCropEnd),t.responsive&&Oo(window,"resize",this.onResize)}},$o={resize:function(){if(!this.disabled){var e,t,i=this.options,s=this.container,n=this.containerData,r=s.offsetWidth/n.width;if(1!==r||s.offsetHeight!==n.height)i.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),i.restore&&(this.setCanvasData(uo(e,(function(t,i){e[i]=t*r}))),this.setCropBoxData(uo(t,(function(e,i){t[i]=e*r}))))}},dblclick:function(){var e,t;this.disabled||"none"===this.options.dragMode||this.setDragMode((e=this.dragBox,t=Ra,(e.classList?e.classList.contains(t):e.className.indexOf(t)>-1)?"move":"crop"))},wheel:function(e){var t=this,i=Number(this.options.wheelZoomRatio)||.1,s=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1}),50),e.deltaY?s=e.deltaY>0?1:-1:e.wheelDelta?s=-e.wheelDelta/120:e.detail&&(s=e.detail>0?1:-1),this.zoom(-s*i,e)))},cropStart:function(e){var t=e.buttons,i=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(io(t)&&1!==t||io(i)&&0!==i||e.ctrlKey))){var s,n=this.options,r=this.pointers;e.changedTouches?uo(e.changedTouches,(function(e){r[e.identifier]=Bo(e)})):r[e.pointerId||0]=Bo(e),s=Object.keys(r).length>1&&n.zoomable&&n.zoomOnTouch?"zoom":Co(e.target,$a),Ka.test(s)&&!1!==ko(this.element,"cropstart",{originalEvent:e,action:s})&&(e.preventDefault(),this.action=s,this.cropping=!1,"crop"===s&&(this.cropping=!0,vo(this.dragBox,qa)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var i=this.pointers;e.preventDefault(),!1!==ko(this.element,"cropmove",{originalEvent:e,action:t})&&(e.changedTouches?uo(e.changedTouches,(function(e){co(i[e.identifier]||{},Bo(e,!0))})):co(i[e.pointerId||0]||{},Bo(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,i=this.pointers;e.changedTouches?uo(e.changedTouches,(function(e){delete i[e.identifier]})):delete i[e.pointerId||0],t&&(e.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,wo(this.dragBox,qa,this.cropped&&this.options.modal)),ko(this.element,"cropend",{originalEvent:e,action:t}))}}},Vo={change:function(e){var t,i=this.options,s=this.canvasData,n=this.containerData,r=this.cropBoxData,a=this.pointers,o=this.action,l=i.aspectRatio,h=r.left,p=r.top,d=r.width,u=r.height,c=h+d,f=p+u,m=0,g=0,y=n.width,v=n.height,b=!0;!l&&e.shiftKey&&(l=d&&u?d/u:1),this.limited&&(m=r.minLeft,g=r.minTop,y=m+Math.min(n.width,s.width,s.left+s.width),v=g+Math.min(n.height,s.height,s.top+s.height));var w=a[Object.keys(a)[0]],_={x:w.endX-w.startX,y:w.endY-w.startY},F=function(e){switch(e){case"e":c+_.x>y&&(_.x=y-c);break;case"w":h+_.x<m&&(_.x=m-h);break;case"n":p+_.y<g&&(_.y=g-p);break;case"s":f+_.y>v&&(_.y=v-f)}};switch(o){case"all":h+=_.x,p+=_.y;break;case"e":if(_.x>=0&&(c>=y||l&&(p<=g||f>=v))){b=!1;break}F("e"),(d+=_.x)<0&&(o="w",h-=d=-d),l&&(u=d/l,p+=(r.height-u)/2);break;case"n":if(_.y<=0&&(p<=g||l&&(h<=m||c>=y))){b=!1;break}F("n"),u-=_.y,p+=_.y,u<0&&(o="s",p-=u=-u),l&&(d=u*l,h+=(r.width-d)/2);break;case"w":if(_.x<=0&&(h<=m||l&&(p<=g||f>=v))){b=!1;break}F("w"),d-=_.x,h+=_.x,d<0&&(o="e",h-=d=-d),l&&(u=d/l,p+=(r.height-u)/2);break;case"s":if(_.y>=0&&(f>=v||l&&(h<=m||c>=y))){b=!1;break}F("s"),(u+=_.y)<0&&(o="n",p-=u=-u),l&&(d=u*l,h+=(r.width-d)/2);break;case"ne":if(l){if(_.y<=0&&(p<=g||c>=y)){b=!1;break}F("n"),u-=_.y,p+=_.y,d=u*l}else F("n"),F("e"),_.x>=0?c<y?d+=_.x:_.y<=0&&p<=g&&(b=!1):d+=_.x,_.y<=0?p>g&&(u-=_.y,p+=_.y):(u-=_.y,p+=_.y);d<0&&u<0?(o="sw",p-=u=-u,h-=d=-d):d<0?(o="nw",h-=d=-d):u<0&&(o="se",p-=u=-u);break;case"nw":if(l){if(_.y<=0&&(p<=g||h<=m)){b=!1;break}F("n"),u-=_.y,p+=_.y,d=u*l,h+=r.width-d}else F("n"),F("w"),_.x<=0?h>m?(d-=_.x,h+=_.x):_.y<=0&&p<=g&&(b=!1):(d-=_.x,h+=_.x),_.y<=0?p>g&&(u-=_.y,p+=_.y):(u-=_.y,p+=_.y);d<0&&u<0?(o="se",p-=u=-u,h-=d=-d):d<0?(o="ne",h-=d=-d):u<0&&(o="sw",p-=u=-u);break;case"sw":if(l){if(_.x<=0&&(h<=m||f>=v)){b=!1;break}F("w"),d-=_.x,h+=_.x,u=d/l}else F("s"),F("w"),_.x<=0?h>m?(d-=_.x,h+=_.x):_.y>=0&&f>=v&&(b=!1):(d-=_.x,h+=_.x),_.y>=0?f<v&&(u+=_.y):u+=_.y;d<0&&u<0?(o="ne",p-=u=-u,h-=d=-d):d<0?(o="se",h-=d=-d):u<0&&(o="nw",p-=u=-u);break;case"se":if(l){if(_.x>=0&&(c>=y||f>=v)){b=!1;break}F("e"),u=(d+=_.x)/l}else F("s"),F("e"),_.x>=0?c<y?d+=_.x:_.y>=0&&f>=v&&(b=!1):d+=_.x,_.y>=0?f<v&&(u+=_.y):u+=_.y;d<0&&u<0?(o="nw",p-=u=-u,h-=d=-d):d<0?(o="sw",h-=d=-d):u<0&&(o="ne",p-=u=-u);break;case"move":this.move(_.x,_.y),b=!1;break;case"zoom":this.zoom(function(e){var t=Ea({},e),i=[];return uo(e,(function(e,s){delete t[s],uo(t,(function(t){var s=Math.abs(e.startX-t.startX),n=Math.abs(e.startY-t.startY),r=Math.abs(e.endX-t.endX),a=Math.abs(e.endY-t.endY),o=Math.sqrt(s*s+n*n),l=(Math.sqrt(r*r+a*a)-o)/o;i.push(l)}))})),i.sort((function(e,t){return Math.abs(e)<Math.abs(t)})),i[0]}(a),e),b=!1;break;case"crop":if(!_.x||!_.y){b=!1;break}t=To(this.cropper),h=w.startX-t.left,p=w.startY-t.top,d=r.minWidth,u=r.minHeight,_.x>0?o=_.y>0?"se":"ne":_.x<0&&(h-=d,o=_.y>0?"sw":"nw"),_.y<0&&(p-=u),this.cropped||(bo(this.cropBox,La),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}b&&(r.width=d,r.height=u,r.left=h,r.top=p,this.action=o,this.renderCropBox()),uo(a,(function(e){e.startX=e.endX,e.startY=e.endY}))}},Xo={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&vo(this.dragBox,qa),bo(this.cropBox,La),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=co({},this.initialImageData),this.canvasData=co({},this.initialCanvasData),this.cropBoxData=co({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(co(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),bo(this.dragBox,qa),vo(this.cropBox,La)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,uo(this.previews,(function(t){t.getElementsByTagName("img")[0].src=e})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,bo(this.cropper,za)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,vo(this.cropper,za)),this},destroy:function(){var e=this.element;return e.cropper?(e.cropper=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=this.canvasData,s=i.left,n=i.top;return this.moveTo(no(e)?e:s+Number(e),no(t)?t:n+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=this.canvasData,s=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(io(e)&&(i.left=e,s=!0),io(t)&&(i.top=t,s=!0),s&&this.renderCanvas(!0)),this},zoom:function(e,t){var i=this.canvasData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(i.width*e/i.naturalWidth,null,t)},zoomTo:function(e,t,i){var s=this.options,n=this.canvasData,r=n.width,a=n.height,o=n.naturalWidth,l=n.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&s.zoomable){var h=o*e,p=l*e;if(!1===ko(this.element,"zoom",{ratio:e,oldRatio:r/o,originalEvent:i}))return this;if(i){var d=this.pointers,u=To(this.cropper),c=d&&Object.keys(d).length?function(e){var t=0,i=0,s=0;return uo(e,(function(e){var n=e.startX,r=e.startY;t+=n,i+=r,s+=1})),{pageX:t/=s,pageY:i/=s}}(d):{pageX:i.pageX,pageY:i.pageY};n.left-=(h-r)*((c.pageX-u.left-n.left)/r),n.top-=(p-a)*((c.pageY-u.top-n.top)/a)}else oo(t)&&io(t.x)&&io(t.y)?(n.left-=(h-r)*((t.x-n.left)/r),n.top-=(p-a)*((t.y-n.top)/a)):(n.left-=(h-r)/2,n.top-=(p-a)/2);n.width=h,n.height=p,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return io(e=Number(e))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,io(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(io(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=this.imageData,s=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(io(e)&&(i.scaleX=e,s=!0),io(t)&&(i.scaleY=t,s=!0),s&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.options,s=this.imageData,n=this.canvasData,r=this.cropBoxData;if(this.ready&&this.cropped){e={x:r.left-n.left,y:r.top-n.top,width:r.width,height:r.height};var a=s.width/s.naturalWidth;if(uo(e,(function(t,i){e[i]=t/a})),t){var o=Math.round(e.y+e.height),l=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=l-e.x,e.height=o-e.y}}else e={x:0,y:0,width:0,height:0};return i.rotatable&&(e.rotate=s.rotate||0),i.scalable&&(e.scaleX=s.scaleX||1,e.scaleY=s.scaleY||1),e},setData:function(e){var t=this.options,i=this.imageData,s=this.canvasData,n={};if(this.ready&&!this.disabled&&oo(e)){var r=!1;t.rotatable&&io(e.rotate)&&e.rotate!==i.rotate&&(i.rotate=e.rotate,r=!0),t.scalable&&(io(e.scaleX)&&e.scaleX!==i.scaleX&&(i.scaleX=e.scaleX,r=!0),io(e.scaleY)&&e.scaleY!==i.scaleY&&(i.scaleY=e.scaleY,r=!0)),r&&this.renderCanvas(!0,!0);var a=i.width/i.naturalWidth;io(e.x)&&(n.left=e.x*a+s.left),io(e.y)&&(n.top=e.y*a+s.top),io(e.width)&&(n.width=e.width*a),io(e.height)&&(n.height=e.height*a),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?co({},this.containerData):{}},getImageData:function(){return this.sized?co({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&uo(["left","top","width","height","naturalWidth","naturalHeight"],(function(i){t[i]=e[i]})),t},setCanvasData:function(e){var t=this.canvasData,i=t.aspectRatio;return this.ready&&!this.disabled&&oo(e)&&(io(e.left)&&(t.left=e.left),io(e.top)&&(t.top=e.top),io(e.width)?(t.width=e.width,t.height=e.width/i):io(e.height)&&(t.height=e.height,t.width=e.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,i,s=this.cropBoxData,n=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&oo(e)&&(io(e.left)&&(s.left=e.left),io(e.top)&&(s.top=e.top),io(e.width)&&e.width!==s.width&&(t=!0,s.width=e.width),io(e.height)&&e.height!==s.height&&(i=!0,s.height=e.height),n&&(t?s.height=s.width/n:i&&(s.width=s.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,i=Ro(this.image,this.imageData,t,e);if(!this.cropped)return i;var s=this.getData(),n=s.x,r=s.y,a=s.width,o=s.height,l=i.width/Math.floor(t.naturalWidth);1!==l&&(n*=l,r*=l,a*=l,o*=l);var h=a/o,p=Io({aspectRatio:h,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),d=Io({aspectRatio:h,width:e.minWidth||0,height:e.minHeight||0},"cover"),u=Io({aspectRatio:h,width:e.width||(1!==l?i.width:a),height:e.height||(1!==l?i.height:o)}),c=u.width,f=u.height;c=Math.min(p.width,Math.max(d.width,c)),f=Math.min(p.height,Math.max(d.height,f));var m=document.createElement("canvas"),g=m.getContext("2d");m.width=mo(c),m.height=mo(f),g.fillStyle=e.fillColor||"transparent",g.fillRect(0,0,c,f);var y=e.imageSmoothingEnabled,v=void 0===y||y,b=e.imageSmoothingQuality;g.imageSmoothingEnabled=v,b&&(g.imageSmoothingQuality=b);var w,_,F,C,S,P,x=i.width,O=i.height,D=n,k=r;D<=-a||D>x?(D=0,w=0,F=0,S=0):D<=0?(F=-D,D=0,S=w=Math.min(x,a+D)):D<=x&&(F=0,S=w=Math.min(a,x-D)),w<=0||k<=-o||k>O?(k=0,_=0,C=0,P=0):k<=0?(C=-k,k=0,P=_=Math.min(O,o+k)):k<=O&&(C=0,P=_=Math.min(o,O-k));var T=[D,k,w,_];if(S>0&&P>0){var E=c/a;T.push(F*E,C*E,S*E,P*E)}return g.drawImage.apply(g,[i].concat(Aa(T.map((function(e){return Math.floor(mo(e))}))))),m},setAspectRatio:function(e){var t=this.options;return this.disabled||no(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,i=this.dragBox,s=this.face;if(this.ready&&!this.disabled){var n="crop"===e,r=t.movable&&"move"===e;e=n||r?e:"none",t.dragMode=e,So(i,$a,e),wo(i,Ra,n),wo(i,Wa,r),t.cropBoxMovable||(So(s,$a,e),wo(s,Ra,n),wo(s,Wa,r))}return this}},Go=Ua.Cropper,Yo=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Oa(this,e),!t||!Ja.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=co({},eo,oo(i)&&i),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var t,i,s;return t=e,s=[{key:"noConflict",value:function(){return window.Cropper=Go,e}},{key:"setDefaults",value:function(e){co(eo,oo(e)&&e)}}],(i=[{key:"init",value:function(){var e,t=this.element,i=t.tagName.toLowerCase();if(!t.cropper){if(t.cropper=this,"img"===i){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===i&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var i=this.element,s=this.options;if(s.rotatable||s.scalable||(s.checkOrientation=!1),s.checkOrientation&&window.ArrayBuffer)if(Qa.test(e))Za.test(e)?this.read((n=e.replace(Lo,""),r=atob(n),a=new ArrayBuffer(r.length),uo(o=new Uint8Array(a),(function(e,t){o[t]=r.charCodeAt(t)})),a)):this.clone();else{var n,r,a,o,l=new XMLHttpRequest,h=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=h,l.onerror=h,l.ontimeout=h,l.onprogress=function(){"image/jpeg"!==l.getResponseHeader("content-type")&&l.abort()},l.onload=function(){t.read(l.response)},l.onloadend=function(){t.reloading=!1,t.xhr=null},s.checkCrossOrigin&&Mo(e)&&i.crossOrigin&&(e=No(e)),l.open("GET",e),l.responseType="arraybuffer",l.withCredentials="use-credentials"===i.crossOrigin,l.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,i=this.imageData,s=jo(e),n=0,r=1,a=1;if(s>1){this.url=function(e,t){for(var i=[],s=new Uint8Array(e);s.length>0;)i.push(zo.apply(null,po(s.subarray(0,8192)))),s=s.subarray(8192);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}(e,"image/jpeg");var o=function(e){var t=0,i=1,s=1;switch(e){case 2:i=-1;break;case 3:t=-180;break;case 4:s=-1;break;case 5:t=90,s=-1;break;case 6:t=90;break;case 7:t=90,i=-1;break;case 8:t=-90}return{rotate:t,scaleX:i,scaleY:s}}(s);n=o.rotate,r=o.scaleX,a=o.scaleY}t.rotatable&&(i.rotate=n),t.scalable&&(i.scaleX=r,i.scaleY=a),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,i=e.crossOrigin,s=t;this.options.checkCrossOrigin&&Mo(t)&&(i||(i="anonymous"),s=No(t)),this.crossOrigin=i,this.crossOriginUrl=s;var n=document.createElement("img");i&&(n.crossOrigin=i),n.src=s||t,n.alt=e.alt||"The image to crop",this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),vo(n,ja),e.parentNode.insertBefore(n,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var i=Ua.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Ua.navigator.userAgent),s=function(t,i){co(e.imageData,{naturalWidth:t,naturalHeight:i,aspectRatio:t/i}),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||i){var n=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){s(n.width,n.height),i||r.removeChild(n)},n.src=t.src,i||(n.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",r.appendChild(n))}else s(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,i=this.image,s=e.parentNode,n=document.createElement("div");n.innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';var r=n.querySelector(".".concat("cropper","-container")),a=r.querySelector(".".concat("cropper","-canvas")),o=r.querySelector(".".concat("cropper","-drag-box")),l=r.querySelector(".".concat("cropper","-crop-box")),h=l.querySelector(".".concat("cropper","-face"));this.container=s,this.cropper=r,this.canvas=a,this.dragBox=o,this.cropBox=l,this.viewBox=r.querySelector(".".concat("cropper","-view-box")),this.face=h,a.appendChild(i),vo(e,La),s.insertBefore(r,e.nextSibling),this.isImg||bo(i,ja),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,vo(l,La),t.guides||vo(l.getElementsByClassName("".concat("cropper","-dashed")),La),t.center||vo(l.getElementsByClassName("".concat("cropper","-center")),La),t.background&&vo(r,"".concat("cropper","-bg")),t.highlight||vo(h,Ha),t.cropBoxMovable&&(vo(h,Wa),So(h,$a,"all")),t.cropBoxResizable||(vo(l.getElementsByClassName("".concat("cropper","-line")),La),vo(l.getElementsByClassName("".concat("cropper","-point")),La)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),lo(t.ready)&&Do(e,"ready",t.ready,{once:!0}),ko(e,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),bo(this.element,La))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&Da(t.prototype,i),s&&Da(t,s),e}();function Ko(e,t,i){const s=Math.abs(i*(Math.PI/180));return Math.max((Math.sin(s)*e+Math.cos(s)*t)/t,(Math.sin(s)*t+Math.cos(s)*e)/e)}co(Yo.prototype,Ho,qo,Wo,$o,Vo,Xo);class Qo extends Ut{constructor(e){super(e),this.onRotate90Deg=()=>{const{angle90Deg:e}=this.state,t=e-90;this.setState({angle90Deg:t,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(t);const i=this.cropper.getCanvasData(),s=function(e,t){const i=e.width/t.width,s=e.height/t.height,n=Math.min(i,s),r=t.width*n,a=t.height*n;return{width:r,height:a,left:(e.width-r)/2,top:(e.height-a)/2}}(this.cropper.getContainerData(),i);this.cropper.setCanvasData(s),this.cropper.setCropBoxData(s)},this.onRotateGranular=e=>{const t=Number(e.target.value);this.setState({angleGranular:t});const{angle90Deg:i}=this.state,s=i+t;this.cropper.rotateTo(s);const n=this.cropper.getImageData(),r=Ko(n.naturalWidth,n.naturalHeight,t),a=this.cropper.getImageData().scaleX<0?-r:r;this.cropper.scale(a,r)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){const{opts:e,storeCropperInstance:t}=this.props;this.cropper=new Yo(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){const t=this.cropper.getCanvasData(),i=this.cropper.getCropBoxData(),{prevCropboxData:s}=this.state;if("all"===e.detail.action){const e=(n=t,a=s,(r=i).left<n.left?{left:n.left,width:a.width}:r.top<n.top?{top:n.top,height:a.height}:r.left+r.width>n.left+n.width?{left:n.left+n.width-a.width,width:a.width}:r.top+r.height>n.top+n.height?{top:n.top+n.height-a.height,height:a.height}:null);e&&this.cropper.setCropBoxData(e)}else{const e=function(e,t,i){return t.left<e.left?{left:e.left,width:i.left+i.width-e.left}:t.top<e.top?{top:e.top,height:i.top+i.height-e.top}:t.left+t.width>e.left+e.width?{left:i.left,width:e.left+e.width-i.left}:t.top+t.height>e.top+e.height?{top:i.top,height:e.top+e.height-i.top}:null}(t,i,s);e&&this.cropper.setCropBoxData(e)}var n,r,a}renderGranularRotate(){const{i18n:e}=this.props,{angleGranular:t}=this.state;return At("label",{role:"tooltip","aria-label":`${t}º`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},At("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){const{i18n:e,opts:t}=this.props;return At("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},At("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},At("path",{d:"M0 0h24v24H0z",fill:"none"}),At("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){const{i18n:e}=this.props;return At("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},At("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},At("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),At("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){const{i18n:e}=this.props;return At("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},At("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},At("path",{d:"M0 0h24v24H0z",fill:"none"}),At("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){const{i18n:e}=this.props;return At("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},At("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},At("path",{d:"M0 0h24v24H0V0z",fill:"none"}),At("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),At("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){const{i18n:e}=this.props;return At("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},At("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},At("path",{d:"M0 0h24v24H0V0z",fill:"none"}),At("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){const{i18n:e}=this.props;return At("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},At("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},At("path",{d:"M0 0h24v24H0z",fill:"none"}),At("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))}renderCropWidescreen(){const{i18n:e}=this.props;return At("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},At("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},At("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),At("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){const{i18n:e}=this.props;return At("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},At("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},At("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),At("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){const{currentImage:e,opts:t}=this.props,{actions:i}=t,s=URL.createObjectURL(e.data);return At("div",{className:"uppy-ImageCropper"},At("div",{className:"uppy-ImageCropper-container"},At("img",{className:"uppy-ImageCropper-image",alt:e.name,src:s,ref:e=>{this.imgElement=e}})),At("div",{className:"uppy-ImageCropper-controls"},i.revert&&this.renderRevert(),i.rotate&&this.renderRotate(),i.granularRotate&&this.renderGranularRotate(),i.flip&&this.renderFlip(),i.zoomIn&&this.renderZoomIn(),i.zoomOut&&this.renderZoomOut(),i.cropSquare&&this.renderCropSquare(),i.cropWidescreen&&this.renderCropWidescreen(),i.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}}var Zo={strings:{revert:"Reset",rotate:"Rotate 90°",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}};const Jo={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},el={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},tl={quality:.8,actions:el,cropperOptions:Jo};class il extends pi{constructor(e,t){super(e,{...tl,...t,actions:{...el,...null==t?void 0:t.actions},cropperOptions:{...Jo,...null==t?void 0:t.cropperOptions}}),this.save=()=>{const{currentImage:e}=this.getPluginState(),t=this.cropper.getCroppedCanvas({});t.width%2!=0&&this.cropper.setData({width:t.width-1}),t.height%2!=0&&this.cropper.setData({height:t.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob((e=>{const{currentImage:t}=this.getPluginState();this.uppy.setFileState(t.id,{data:new File([e],t.name,{type:e.type}),size:e.size,preview:void 0});const i=this.uppy.getFile(t.id);this.uppy.emit("thumbnail:request",i),this.setPluginState({currentImage:i}),this.uppy.emit("file-editor:complete",i)}),e.type,this.opts.quality)},this.storeCropperInstance=e=>{this.cropper=e},this.selectFile=e=>{this.uppy.emit("file-editor:start",e),this.setPluginState({currentImage:e})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=Zo,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;const t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){const{currentImage:e}=this.getPluginState();if(e){const t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){const{currentImage:e}=this.getPluginState();return null===e||e.isRemote?null:At(Qo,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}}function sl(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}il.VERSION="2.4.6";var nl=0;function rl(e){return"__private_"+nl+++"_"+e}var al=rl("uppy"),ol=rl("events");class ll{constructor(e){Object.defineProperty(this,al,{writable:!0,value:void 0}),Object.defineProperty(this,ol,{writable:!0,value:[]}),sl(this,al)[al]=e}on(e,t){return sl(this,ol)[ol].push([e,t]),sl(this,al)[al].on(e,t)}remove(){for(const[e,t]of sl(this,ol)[ol].splice(0))sl(this,al)[al].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",(()=>{sl(this,al)[al].getFile(e)&&t()}))}onPauseAll(e,t){this.on("pause-all",(()=>{sl(this,al)[al].getFile(e)&&t()}))}onCancelAll(e,t){var i=this;this.on("cancel-all",(function(){sl(i,al)[al].getFile(e)&&t(...arguments)}))}onResumeAll(e,t){this.on("resume-all",(()=>{sl(this,al)[al].getFile(e)&&t()}))}}function hl(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var pl=0;function dl(e){return"__private_"+pl+++"_"+e}function ul(e){return new Error("Cancelled",{cause:e})}function cl(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 fl=dl("activeRequests"),ml=dl("queuedHandlers"),gl=dl("paused"),yl=dl("pauseTimer"),vl=dl("downLimit"),bl=dl("upperLimit"),wl=dl("rateLimitingTimer"),_l=dl("call"),Fl=dl("queueNext"),Cl=dl("next"),Sl=dl("queue"),Pl=dl("dequeue"),xl=dl("resume"),Ol=dl("increaseLimit");class Dl{constructor(e){Object.defineProperty(this,Pl,{value:Ml}),Object.defineProperty(this,Sl,{value:Al}),Object.defineProperty(this,Cl,{value:El}),Object.defineProperty(this,Fl,{value:Tl}),Object.defineProperty(this,_l,{value:kl}),Object.defineProperty(this,fl,{writable:!0,value:0}),Object.defineProperty(this,ml,{writable:!0,value:[]}),Object.defineProperty(this,gl,{writable:!0,value:!1}),Object.defineProperty(this,yl,{writable:!0,value:void 0}),Object.defineProperty(this,vl,{writable:!0,value:1}),Object.defineProperty(this,bl,{writable:!0,value:void 0}),Object.defineProperty(this,wl,{writable:!0,value:void 0}),Object.defineProperty(this,xl,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,Ol,{writable:!0,value:()=>{if(hl(this,gl)[gl])hl(this,wl)[wl]=setTimeout(hl(this,Ol)[Ol],0);else{hl(this,vl)[vl]=this.limit,this.limit=Math.ceil((hl(this,bl)[bl]+hl(this,vl)[vl])/2);for(let e=hl(this,vl)[vl];e<=this.limit;e++)hl(this,Fl)[Fl]();hl(this,bl)[bl]-hl(this,vl)[vl]>3?hl(this,wl)[wl]=setTimeout(hl(this,Ol)[Ol],2e3):hl(this,vl)[vl]=Math.floor(hl(this,vl)[vl]/2)}}}),this.limit="number"!=typeof e||0===e?1/0:e}run(e,t){return!hl(this,gl)[gl]&&hl(this,fl)[fl]<this.limit?hl(this,_l)[_l](e):hl(this,Sl)[Sl](e,t)}wrapSyncFunction(e,t){var i=this;return function(){for(var s=arguments.length,n=new Array(s),r=0;r<s;r++)n[r]=arguments[r];const a=i.run((()=>(e(...n),queueMicrotask((()=>a.done())),()=>{})),t);return{abortOn:cl,abort(){a.abort()}}}}wrapPromiseFunction(e,t){var i=this;return function(){for(var s=arguments.length,n=new Array(s),r=0;r<s;r++)n[r]=arguments[r];let a;const o=new Promise(((s,r)=>{a=i.run((()=>{let t,i;try{i=Promise.resolve(e(...n))}catch(o){i=Promise.reject(o)}return i.then((e=>{t?r(t):(a.done(),s(e))}),(e=>{t?r(t):(a.done(),r(e))})),e=>{t=ul(e)}}),t)}));return o.abort=e=>{a.abort(e)},o.abortOn=cl,o}}resume(){hl(this,gl)[gl]=!1,clearTimeout(hl(this,yl)[yl]);for(let e=0;e<this.limit;e++)hl(this,Fl)[Fl]()}pause(e){void 0===e&&(e=null),hl(this,gl)[gl]=!0,clearTimeout(hl(this,yl)[yl]),null!=e&&(hl(this,yl)[yl]=setTimeout(hl(this,xl)[xl],e))}rateLimit(e){clearTimeout(hl(this,wl)[wl]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(hl(this,bl)[bl]=this.limit-1,this.limit=hl(this,vl)[vl],hl(this,wl)[wl]=setTimeout(hl(this,Ol)[Ol],e))}get isPaused(){return hl(this,gl)[gl]}}function kl(e){hl(this,fl)[fl]+=1;let t,i=!1;try{t=e()}catch(s){throw hl(this,fl)[fl]-=1,s}return{abort:e=>{i||(i=!0,hl(this,fl)[fl]-=1,null==t||t(e),hl(this,Fl)[Fl]())},done:()=>{i||(i=!0,hl(this,fl)[fl]-=1,hl(this,Fl)[Fl]())}}}function Tl(){queueMicrotask((()=>hl(this,Cl)[Cl]()))}function El(){if(hl(this,gl)[gl]||hl(this,fl)[fl]>=this.limit)return;if(0===hl(this,ml)[ml].length)return;const e=hl(this,ml)[ml].shift();if(null==e)throw new Error("Invariant violation: next is null");const t=hl(this,_l)[_l](e.fn);e.abort=t.abort,e.done=t.done}function Al(e,t){const i={fn:e,priority:(null==t?void 0:t.priority)||0,abort:()=>{hl(this,Pl)[Pl](i)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},s=hl(this,ml)[ml].findIndex((e=>i.priority>e.priority));return-1===s?hl(this,ml)[ml].push(i):hl(this,ml)[ml].splice(s,0,i),i}function Ml(e){const t=hl(this,ml)[ml].indexOf(e);-1!==t&&hl(this,ml)[ml].splice(t,1)}const Nl=Symbol("__queue");class Ul 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}}function Bl(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)}function Il(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Rl=0;function zl(e){return"__private_"+Rl+++"_"+e}var Ll=zl("aliveTimer"),jl=zl("isDone"),Hl=zl("onTimedOut"),ql=zl("timeout");class Wl{constructor(e,t){Object.defineProperty(this,Ll,{writable:!0,value:void 0}),Object.defineProperty(this,jl,{writable:!0,value:!1}),Object.defineProperty(this,Hl,{writable:!0,value:void 0}),Object.defineProperty(this,ql,{writable:!0,value:void 0}),Il(this,ql)[ql]=e,Il(this,Hl)[Hl]=()=>t(e)}progress(){Il(this,jl)[jl]||Il(this,ql)[ql]>0&&(clearTimeout(Il(this,Ll)[Ll]),Il(this,Ll)[Ll]=setTimeout(Il(this,Hl)[Hl],Il(this,ql)[ql]))}done(){Il(this,jl)[jl]||(clearTimeout(Il(this,Ll)[Ll]),Il(this,Ll)[Ll]=void 0,Il(this,jl)[jl]=!0)}}const $l=()=>{};var Vl={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Xl(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Gl=0;function Yl(e){return"__private_"+Gl+++"_"+e}function Kl(e){return e.data.slice(0,e.data.size,e.meta.type)}const Ql={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 Bl(t)&&(i=new Ul(i,t)),i},validateStatus:e=>e>=200&&e<300};var Zl=Yl("getFetcher"),Jl=Yl("uploadLocalFile"),eh=Yl("uploadBundle"),th=Yl("getCompanionClientArgs"),ih=Yl("uploadFiles"),sh=Yl("handleUpload");class nh extends ni{constructor(e,t){if(super(e,{...Ql,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,ih,{value:lh}),Object.defineProperty(this,th,{value:oh}),Object.defineProperty(this,eh,{value:ah}),Object.defineProperty(this,Jl,{value:rh}),Object.defineProperty(this,Zl,{writable:!0,value:void 0}),Object.defineProperty(this,sh,{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[Nl]||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=function(e){return e.filter((e=>!(e=>"error"in e&&!!e.error)(e)))}(this.uppy.getFilesByIds(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 Xl(this,eh)[eh](t)}else await Xl(this,ih)[ih](t)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=Vl,this.i18nInit(),Nl in this.opts?this.requests=this.opts[Nl]:this.requests=new Dl(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),Xl(this,Zl)[Zl]=e=>async(t,i)=>{try{var s;const n=await function(e,t){void 0===t&&(t={});const{body:i=null,headers:s={},method:n="GET",onBeforeRequest:r=$l,onUploadProgress:a=$l,shouldRetry:o=(()=>!0),onAfterRequest:l=$l,onTimeout:h=$l,responseType:p,retries:d=3,signal:u=null,timeout:c=3e4,withCredentials:f=!1}=t,m=e=>.3*2**(e-1)*1e3,g=new Wl(c,h);return function t(h){return void 0===h&&(h=0),new Promise((async(c,y)=>{const v=new XMLHttpRequest;v.open(n,e,!0),v.withCredentials=f,p&&(v.responseType=p),null==u||u.addEventListener("abort",(()=>{v.abort(),y(new DOMException("Aborted","AbortError"))})),v.onload=async()=>{await l(v,h),v.status>=200&&v.status<300?(g.done(),c(v)):o(v)&&h<d?setTimeout((()=>{t(h+1).then(c,y)}),m(h)):(g.done(),y(new Ul(v.statusText,v)))},v.onerror=()=>{o(v)&&h<d?setTimeout((()=>{t(h+1).then(c,y)}),m(h)):(g.done(),y(new Ul(v.statusText,v)))},v.upload.onprogress=e=>{g.progress(),a(e)},s&&Object.keys(s).forEach((e=>{v.setRequestHeader(e,s[e])})),await r(v,h),v.send(i)}))}()}(t,{...i,method:null==i||null==(s=i.method)?void 0:s.toUpperCase(),onTimeout:t=>{const i=Math.ceil(t/1e3),s=new Error(this.i18n("uploadStalled",{seconds:i}));this.uppy.emit("upload-stalled",s,e)},onUploadProgress:t=>{if(t.lengthComputable)for(const i of e)this.uppy.emit("upload-progress",i,{uploader:this,bytesUploaded:t.loaded/t.total*i.size,bytesTotal:i.size})}});if(!this.opts.validateStatus(n.status,n.responseText,n))throw new Ul(n.statusText,n);const r=this.opts.getResponseData(n.responseText,n),a=null==r?void 0:r[this.opts.responseUrlFieldName];for(const t of e)this.uppy.emit("upload-success",t,{status:n.status,body:r,uploadURL:a});return n}catch(n){if("AbortError"===n.name)return;if(n instanceof Ul){const t=n.request,i=function(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})),Bl(e)?(i=new Ul(i,e),i):(i.request=e,i)}(t,this.opts.getResponseError(t.responseText,t));for(const s of e)this.uppy.emit("upload-error",s,i)}throw n}}}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=Kl(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=Kl(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(Xl(this,sh)[sh])}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(Xl(this,sh)[sh])}}async function rh(e){const t=new ll(this.uppy),i=new AbortController,s=this.requests.wrapPromiseFunction((async()=>{const t=this.getOptions(e),s=Xl(this,Zl)[Zl]([e]),n=t.formData?this.createFormDataUpload(e,t):e.data;return s(t.endpoint,{...t,body:n,signal:i.signal})}));t.onFileRemove(e.id,(()=>i.abort())),t.onCancelAll(e.id,(e=>{let{reason:t}=e;"user"===t&&i.abort()}));try{await s().abortOn(i.signal)}catch(n){if("Cancelled"!==n.message)throw n}finally{t.remove()}}async function ah(e){const t=new AbortController,i=this.requests.wrapPromiseFunction((async()=>{var i;const s=null!=(i=this.uppy.getState().xhrUpload)?i:{},n=Xl(this,Zl)[Zl](e),r=this.createBundledUpload(e,{...this.opts,...s});return n(this.opts.endpoint,{...this.opts,body:r,signal:t.signal})}));function s(){t.abort()}this.uppy.once("cancel-all",s);try{await i().abortOn(t.signal)}catch(n){if("Cancelled"!==n.message)throw n}finally{this.uppy.off("cancel-all",s)}}function oh(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 lh(e){await Promise.allSettled(e.map((e=>{if(e.isRemote){const t=()=>this.requests,i=new AbortController,s=t=>{t.id===e.id&&i.abort()};this.uppy.on("file-removed",s);const n=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,Xl(this,th)[th](e),{signal:i.signal,getQueue:t});return this.requests.wrapSyncFunction((()=>{this.uppy.off("file-removed",s)}),{priority:-1})(),n}return Xl(this,Jl)[Jl](e)})))}nh.VERSION="3.6.8";var hh=o({components:{Dashboard:ba},props:{endpoint:{type:String,default:()=>({}.API_URL+"/file")},headers:{type:Object,default:()=>({auth:i.get("token")})},types:{type:Array,default:null},path:{type:String,default:"files"},maxNumberOfFiles:{type:Number,default:1},height:{type:Number,default:300}},emits:["uploaded","fileAdded","fileRemoved"],setup(e,t){const i=new Pt({autoProceed:!1,restrictions:{allowedFileTypes:e.types,maxNumberOfFiles:e.maxNumberOfFiles}});return i.use(nh,{endpoint:e.endpoint+`?path=${e.path}`,fieldName:"file",method:"post",headers:e.headers}),i.use(il,{quality:1}),i.on("complete",(e=>{var i,s;(null==(i=e.successful)?void 0:i.length)>0&&t.emit("uploaded",null==(s=e.successful[0])?void 0:s.response)})),i.on("file-added",(e=>{t.emit("fileAdded",e)})),i.on("file-removed",((e,i)=>{t.emit("fileRemoved",e)})),s((()=>{i.close()})),{uppy:i,upload:function(){i.upload()},cancel:function(){i.cancelAll()}}}},[["render",function(e,t,i,s,o,l){const h=n("dashboard");return r(),a(h,{ref:"dash",uppy:s.uppy,props:{proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,height:i.height,metaFields:[{id:"name",name:"Name",placeholder:"file name"},{id:"caption",name:"Caption",placeholder:"describe what the image is about"}]},plugins:["ImageEditor"]},null,8,["uppy","props"])}],["__scopeId","data-v-8e4c3b74"]]);export{ba as D,hh as F,il as I,Pt as U};
