1(self.webpackChunknetnr=self.webpackChunknetnr||[]).push([[7351],{34034(e,t,i){var s=i(59209),l=i(67873);e.exports=function(e,t,i){var r=!0,o=!0;if("function"!=typeof e)throw TypeError("Expected a function");return l(i)&&(r="leading"in i?!!i.leading:r,o="trailing"in i?!!i.trailing:o),s(e,t,{leading:r,maxWait:t,trailing:o})}},21397(e,t,i){var s=i(29119),l=/[\/\+\.]/;e.exports=function(e,t){function i(t){var i=s(t,e,l);return i&&i.length>=2}return t?i(t.split(";")[0]):i}},70647(e){e.exports=function(){var e={},t=e._fns={};return e.emit=function(e,i,s,l,r,o,n){var a=function(e){for(var i=t[e]?t[e]:[],s=e.indexOf(":"),l=-1===s?[e]:[e.substring(0,s),e.substring(s+1)],r=Object.keys(t),o=0,n=r.length;o<n;o++){var a=r[o];if("*"===a&&(i=i.concat(t[a])),2===l.length&&l[0]===a){i=i.concat(t[a]);break}}return i}(e);a.length&&function(e,t,i){for(var s=0,l=t.length;s<l&&t[s];s++)t[s].event=e,t[s].apply(t[s],i)}(e,a,[i,s,l,r,o,n])},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],l=0,r=s?s.length:0;l<r;l++)s[l]!==t&&i.push(s[l]);i.length?this._fns[e]=i:delete this._fns[e]},e}},29119(e){"use strict";function t(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}t.prototype.match=function(e){var t,i,s=!0,l=this.parts,r=l.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++)if("*"===l[t])continue;else s=t<i.length&&l[t]===i[t];s=s&&i}else s=!1;else if("function"==typeof e.splice)for(s=[],t=e.length;t--;)this.match(e[t])&&(s[s.length]=e[t]);else if("object"==typeof e)for(var o in s={},e)this.match(o)&&(s[o]=e[o]);return s},e.exports=function(e,i,s){var l=new t(e,s||/[\/\.]/);return void 0!==i?l.match(i):l}},6874(e,t,i){"use strict";function s(e,t,i){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:i;throw TypeError("Private element is not present on this object")}i.d(t,{A:()=>s})},155(e,t,i){"use strict";function s(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}i.d(t,{A:()=>s})},24642(e,t,i){"use strict";i.d(t,{A:()=>l});var s=i(6874);function l(e,t){return e.get((0,s.A)(e,t))}},8837(e,t,i){"use strict";i.d(t,{A:()=>l});var s=i(155);function l(e,t,i){(0,s.A)(e,t),t.set(e,i)}},5046(e,t,i){"use strict";i.d(t,{A:()=>l});var s=i(6874);function l(e,t,i){return e.set((0,s.A)(e,t),i),i}},62470(e,t,i){"use strict";i.d(t,{A:()=>l});var s=i(155);function l(e,t){(0,s.A)(e,t),t.add(e)}},50016(e,t,i){"use strict";function s(e){return(s="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 l(e,t,i){var l;return(l=function(e,t){if("object"!=s(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var l=i.call(e,t||"default");if("object"!=s(l))return l;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==s(l)?l:l+"")in e)?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}i.d(t,{A:()=>l})},67351(e,t,i){"use strict";i.d(t,{Uppy:()=>en});var s=i(62470),l=i(8837),r=i(50016),o=i(24642),n=i(6874),a=i(5046),h=i(34034),d=i(70647),u=i(82704),c=i(20462);let p={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function g(e){return e<10?`0${e}`:e.toString()}function f(){let e=new Date,t=g(e.getHours()),i=g(e.getMinutes()),s=g(e.getSeconds());return`${t}:${i}:${s}`}let m={debug:()=>{},warn:()=>{},error:(...e)=>console.error(`[Uppy] [${f()}]`,...e)},A={debug:(...e)=>console.debug(`[Uppy] [${f()}]`,...e),warn:(...e)=>console.warn(`[Uppy] [${f()}]`,...e),error:(...e)=>console.error(`[Uppy] [${f()}]`,...e)};var v=i(37888),y=i(21397);let w={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};
1class S extends Error{isUserFacing;file;constructor(e,t){var i;super(e),this.isUserFacing=null==(i=null==t?void 0:t.isUserFacing)||i,null!=t&&t.file&&(this.file=t.file)}isRestriction=!0}class b{getI18n;getOpts;constructor(e,t){this.getI18n=t,this.getOpts=()=>{var t;let i=e();if((null==(t=i.restrictions)?void 0:t.allowedFileTypes)!=null&&!Array.isArray(i.restrictions.allowedFileTypes))throw TypeError("`restrictions.allowedFileTypes` must be an array");return i}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:i,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(e=>!e.isGhost).length+t.length>s)throw new S(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(i){let s=[...e,...t].reduce((e,t)=>{var i;return e+(null!=(i=t.size)?i:0)},0);if(s>i)throw new S(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,v.V)(i),size:(0,v.V)(s)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:i,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(t=>t.includes("/")?!!e.type&&y(e.type.replace(/;.*?$/,""),t):"."===t[0]&&!!e.extension&&e.extension.toLowerCase()===t.slice(1).toLowerCase())){let t=s.join(", ");throw new S(this.getI18n()("youCanOnlyUploadFileTypes",{types:t}),{file:e})}if(t&&null!=e.size&&e.size>t){var l;throw new S(this.getI18n()("exceedsSize",{size:(0,v.V)(t),file:null!=(l=e.name)?l:this.getI18n()("unnamed")}),{file:e})}if(i&&null!=e.size&&e.size<i)throw new S(this.getI18n()("inferiorSize",{size:(0,v.V)(i)}),{file:e})}validate(e,t){t.forEach(e=>{this.validateSingleFile(e)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new S(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;let i=new S(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:null!=(t=e.name)?t:this.getI18n()("unnamed")})),{requiredMetaFields:s}=this.getOpts().restrictions,l=[];for(let t of s)Object.hasOwn(e.meta,t)&&""!==e.meta[t]||l.push(t);return{missingFields:l,error:i}}}var F=new WeakMap,E=new WeakSet;class O{constructor(){(0,s.A)(this,E),(0,r.A)(this,"state",{}),(0,l.A)(this,F,new Set)}getState(){return this.state}setState(e){let t={...this.state},i={...this.state,...e};this.state=i,(0,n.A)(E,this,U).call(this,t,i,e)}subscribe(e){return(0,o.A)(F,this).add(e),()=>{(0,o.A)(F,this).delete(e)}}}function U(...e){(0,o.A)(F,this).forEach(t=>{t(...e)})}(0,r.A)(O,"VERSION",c.rE);var $=i(21530),T=i(8447),R=i(29057),I=i(54084);let P={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var k=new WeakMap,j=new WeakMap,M=new WeakMap,C=new WeakMap,N=new WeakMap,z=new WeakMap,x=new WeakMap,W=new WeakSet,q=new WeakMap,_=new WeakMap,L=new WeakMap,D=new WeakMap;class B{constructor(e){(0,s.A)(this,W),(0,l.A)(this,k,Object.create(null)),(0,l.A)(this,j,void 0),(0,l.A)(this,M,void 0),(0,l.A)(this,C,d()),(0,l.A)(this,N,new Set),(0,l.A)(this,z,new Set),(0,l.A)(this,x,new Set),(0,r.A)(this,"defaultLocale",void 0),(0,r.A)(this,"locale",void 0),(0,r.A)(this,"opts",void 0),(0,r.A)(this,"store",void 0),(0,r.A)(this,"i18n",void 0),(0,r.A)(this,"i18nArray",void 0),(0,r.A)(this,"scheduledAutoProceed",null),(0,r.A)(this,"wasOffline",!1),(0,l.A)(this,q,(e,t)=>{let i=e?this.getFile(e.id):void 0;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}`);let s={bytesTotal:t.bytesTotal,percentage:null!=t.bytesTotal&&Number.isFinite(t.bytesTotal)&&t.bytesTotal>0?Math.round(t.bytesUploaded/t.bytesTotal*100):void 0};null!=i.progress.uploadStarted?this.setFileState(e.id,{progress:{...i.progress,...s,bytesUploaded:t.bytesUploaded}}):this.setFileState(e.id,{progress:{...i.progress,...s}}),(0,o.A)(_,this).call(this)}),(0,l.A)(this,_,h(()=>(0,n.A)(W,this,ee).call(this),500,{leading:!0,trailing:!0})),(0,l.A)(this,L,this.updateOnlineStatus.bind(this)),(0,l.A)(this,D,new Map),this.defaultLocale=p;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:w,meta:{},onBeforeFileAdded:(e,t)=>!Object.hasOwn(t,e.id),onBeforeUpload:e=>e,store:new O,logger:m,infoTimeout:5e3},i={...t,...e};this.opts={...i,restrictions:{...t.restrictions,...null==e?void 0:e.restrictions}},null!=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"):null!=e&&e.debug&&(this.opts.logger=A),this.log(`Using Core v${B.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...P,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:function(e){if(null==e&&"u">typeof navigator&&(e=navigator.userAgent),!e)return!0;let t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;let i=t[1].split(".",2),s=parseInt(i[0],10),l=parseInt(i[1],10);return!!(s<15)||15===s&&!!(l<15063)||!!(s>18)||18===s&&!!(l>=18218)}(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),(0,a.A)(j,this,new b(()=>this.opts,()=>this.i18n)),(0,a.A)(M,this,this.store.subscribe((e,t,i)=>
1{this.emit("state-update",e,t,i),this.updateAll(t)})),this.opts.debug&&"u">typeof window&&(window[this.opts.id]=this),(0,n.A)(W,this,ei).call(this)}emit(e,...t){(0,o.A)(C,this).emit(e,...t)}on(e,t){return(0,o.A)(C,this).on(e,t),this}once(e,t){return(0,o.A)(C,this).once(e,t),this}off(e,t){return(0,o.A)(C,this).off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(([e,i])=>[e,{...t[e],...i}]))}})}setFileState(e,t){if(!this.getState().files[e])throw Error(`Canât set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=e=>this.log(`Missing i18n string: ${e}`,"error"),t=new $.A([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...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(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},i=Object.create(null);Object.keys(t).forEach(s=>{i[s]={...t[s],progress:{...t[s].progress,...e},tus:void 0,transloadit:void 0,s3Multipart:void 0}}),this.setState({files:i,...P})}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...P,files:{}})}addPreProcessor(e){(0,o.A)(N,this).add(e)}removePreProcessor(e){return(0,o.A)(N,this).delete(e)}addPostProcessor(e){(0,o.A)(x,this).add(e)}removePostProcessor(e){return(0,o.A)(x,this).delete(e)}addUploader(e){(0,o.A)(z,this).add(e)}removeUploader(e){return(0,o.A)(z,this).delete(e)}setMeta(e){let t={...this.getState().meta,...e},i={...this.getState().files};
1Object.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){let i={...this.getState().files};if(!i[e])return void this.log(`Was trying to set metadata for a file that has been removed: ${e}`);let s={...i[e].meta,...t};i[e]={...i[e],meta:s},this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(e=>this.getFile(e))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:i}=this.getState(),s=Object.values(e),l=[],r=[],o=[],n=[],a=[],h=[],d=[],u=[],c=[];for(let e of s){let{progress:t}=e;!t.uploadComplete&&t.uploadStarted&&(l.push(e),e.isPaused||u.push(e)),t.uploadStarted||r.push(e),(t.uploadStarted||t.preprocess||t.postprocess)&&o.push(e),t.uploadStarted&&n.push(e),e.isPaused&&a.push(e),t.uploadComplete&&h.push(e),e.error&&d.push(e),(t.preprocess||t.postprocess)&&c.push(e)}return{newFiles:r,startedFiles:o,uploadStartedFiles:n,pausedFiles:a,completeFiles:h,erroredFiles:d,inProgressFiles:l,inProgressNotPausedFiles:u,processingFiles:c,isUploadStarted:n.length>0,isAllComplete:100===t&&h.length===s.length&&0===c.length,isAllErrored:!!i&&d.length===s.length,isAllPaused:0!==l.length&&a.length===l.length,isUploadInProgress:l.length>0,isSomeGhost:s.some(e=>e.isGhost)}}validateRestrictions(e,t=this.getFiles()){try{(0,o.A)(j,this).validate(t,[e])}catch(e){return e}return null}validateSingleFile(e){try{(0,o.A)(j,this).validateSingleFile(e)}catch(e){return e.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{(0,o.A)(j,this).validateAggregateRestrictions(t,e)}catch(e){return e.message}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!t[e]&&!t[e].isGhost}addFile(e){let{nextFilesState:t,validFilesToAdd:i,errors:s}=(0,n.A)(W,this,K).call(this,[e]),l=s.filter(e=>e.isRestriction);if((0,n.A)(W,this,Y).call(this,l),s.length>0)throw s[0];this.setState({files:t});let[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}`),(0,n.A)(W,this,J).call(this),r.id}addFiles(e){let{nextFilesState:t,validFilesToAdd:i,errors:s}=(0,n.A)(W,this,K).call(this,e),l=s.filter(e=>e.isRestriction);(0,n.A)(W,this,Y).call(this,l);let r=s.filter(e=>!e.isRestriction);if(r.length>0){let e=`Multiple errors occurred while adding files: 2`;if(r.forEach(t=>{e+=` 3 * ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw AggregateError(r,e);{let t=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} 4 id: ${e.id} 5 type: ${e.type}`)}),i.length>0&&(0,n.A)(W,this,J).call(this)}removeFiles(e){let{files:t,currentUploads:i}=this.getState(),s={...t},l={...i},r=Object.create(null);function n(e){return void 0===r[e]}e.forEach(e=>{t[e]&&(r[e]=t[e],delete s[e])}),Object.keys(l).forEach(e=>{let t=i[e].fileIDs.filter(n);if(0===t.length)return void delete l[e];let{capabilities:s}=this.getState();if(t.length!==i[e].fileIDs.length&&!s.individualCancellation)throw Error("The installed uploader plugin does not allow removing files during an upload.");l[e]={...i[e],fileIDs:t}});let a={currentUploads:l,files:s};0===Object.keys(s).length&&(a.allowNewUpload=!0,a.error=null,a.recoveredState=null),this.setState(a),(0,o.A)(_,this).call(this);let h=Object.keys(r);h.forEach(e=>{this.emit("file-removed",r[e])}),h.length>5?this.log(`Removed ${h.length} files`):this.log(`Removed files: ${h.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let t=this.getFile(e),i=!t.isPaused;return this.setFileState(e,{isPaused:i}),this.emit("upload-pause",t,i),i}
5pauseAll(){let e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{let i={...e[t],isPaused:!0};e[t]=i}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{let i={...e[t],isPaused:!1,error:null};e[t]=i}),this.setState({files:e}),this.emit("resume-all")}async retryAll(){let e=await (0,n.A)(W,this,Z).call(this);return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(P)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=(0,n.A)(W,this,es).call(this,[e],{forceAllowNewUpload:!0});return(0,n.A)(W,this,eo).call(this,t)}logout(){this.iteratePlugins(e=>{var t,i;null==(t=e.provider)||null==(i=t.logout)||i.call(t)})}[Symbol.for("uppy test: updateTotalProgress")](){return(0,n.A)(W,this,ee).call(this)}updateOnlineStatus(){var e;
5null==(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 TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`);let i=new e(this,...t),s=i.id;if(!s)throw Error("Your plugin must have an id");if(!i.type)throw Error("Your plugin must have a type");let l=this.getPlugin(s);if(l)throw Error(`Already found a plugin named '${l.id}'. Tried to use: '${s}'. 6Uppy plugins must have unique \`id\` options.`);return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),i.type in(0,o.A)(k,this)?(0,o.A)(k,this)[i.type].push(i):(0,o.A)(k,this)[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(let t of Object.values((0,o.A)(k,this))){let i=t.find(t=>t.id===e);if(null!=i)return i}}[Symbol.for("uppy test: getPlugins")](e){return(0,o.A)(k,this)[e]}iteratePlugins(e){Object.values((0,o.A)(k,this)).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=(0,o.A)(k,this)[e.type],i=t.findIndex(t=>t.id===e.id);-1!==i&&t.splice(i,1);let s={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(s)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),(0,o.A)(M,this).call(this),this.iteratePlugins(e=>{this.removePlugin(e)}),"u">typeof window&&window.removeEventListener&&(window.removeEventListener("online",(0,o.A)(L,this)),window.removeEventListener("offline",(0,o.A)(L,this)))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t="info",i=3e3){let 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){let{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){(0,o.A)(D,this).set(e,t)}
6getRequestClientForFile(e){if(!("remote"in e&&e.remote))throw Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=(0,o.A)(D,this).get(e.remote.requestClientId);if(null==t)throw Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}async restore(e){this.log(`Core: Running restored upload "${e}"`);let t=await (0,n.A)(W,this,eo).call(this,e);return this.emit("complete",t),t}[Symbol.for("uppy test: createUpload")](...e){return(0,n.A)(W,this,es).call(this,...e)}addResultData(e,t){if(!(0,n.A)(W,this,el).call(this,e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);let{currentUploads:i}=this.getState(),s={...i[e],result:{...i[e].result,...t}};this.setState({currentUploads:{...i,[e]:s}})}async upload(){var e;null!=(e=(0,o.A)(k,this).uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();if((0,n.A)(W,this,Q).call(this).length>0){let e=await (0,n.A)(W,this,Z).call(this);if(!(this.getFiles().filter(e=>null==e.progress.uploadStarted).length>0))return this.emit("complete",e),e;({files:t}=this.getState())}let i=this.opts.onBeforeUpload(t);if(!1===i)throw Error("Not starting the upload because onBeforeUpload returned false");i&&"object"==typeof i&&(t=i,this.setState({files:t}));try{if((0,o.A)(j,this).validateMinNumberOfFiles(t),!(0,n.A)(W,this,V).call(this,t))throw new S(this.i18n("missingRequiredMetaField"));let{currentUploads:e}=this.getState(),i=Object.values(e).flatMap(e=>e.fileIDs),s=Object.keys(t).filter(e=>{let t=this.getFile(e);return t&&!t.progress.uploadStarted&&!i.includes(e)}),l=(0,n.A)(W,this,es).call(this,s),r=await (0,n.A)(W,this,eo).call(this,l);return this.emit("complete",r),r}catch(e){throw(0,n.A)(W,this,Y).call(this,[e]),e}}}function Y(e){for(let t of e)t.isRestriction?this.emit("restriction-failed",t.file,t):this.emit("error",t,t.file),this.log(t,"warning");let t=e.filter(e=>e.isUserFacing),i=t.slice(0,4),s=t.slice(4);i.forEach(({message:e,details:t=""})=>{this.info({message:e,details:t},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}function G(e){let{missingFields:t,error:i}=(0,o.A)(j,this).getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t,error:i.message}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(0===t.length&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}function V(e){let t=!0;for(let i of Object.values(e))(0,n.A)(W,this,G).call(this,i)||(t=!1);return t}function X(e){let{allowNewUpload:t}=this.getState();if(!1===t){let t=new S(this.i18n("noMoreFilesAllowed"),{file:e});throw(0,n.A)(W,this,Y).call(this,[t]),t}}function H(e){let t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,i=(0,T.A)(t),s=t.name?t.name:"image"===i.split("/")[0]?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname",l=(0,R.A)(s).extension,r=(0,I.N)(t,this.getID()),o={...t.meta,name:s,type:i},n=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:r,name:s,extension:l||"",meta:{...this.getState().meta,...o},type:i,progress:{percentage:0,bytesUploaded:!1,bytesTotal:n,uploadComplete:!1,uploadStarted:null},size:n,isGhost:!1,...t.isRemote?{isRemote:!0,remote:t.remote,data:t.data}:{isRemote:!1,data:t.data},preview:t.preview}}function J(){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 K(e){let{files:t}=this.getState(),i={...t},s=[],l=[];for(let a of e)try{let e=(0,n.A)(W,this,H).call(this,a);
6(0,n.A)(W,this,X).call(this,e);let l=t[e.id],h=null==l?void 0:l.isGhost;if(h&&!e.isRemote){if(null==e.data)throw Error("File data is missing");e={...l,isGhost:!1,data:e.data},this.log(`Replaced the blob in the restored ghost file: ${e.name}, ${e.id}`)}let d=this.opts.onBeforeFileAdded(e,i);if(i={...t=this.getState().files,...i},!d&&this.checkIfFileAlreadyExists(e.id)){var r;throw new S(this.i18n("noDuplicates",{fileName:null!=(r=e.name)?r:this.i18n("unnamed")}),{file:e})}if(!1!==d||h)"object"==typeof d&&null!==d&&(e=d);else throw new S("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:e});(0,o.A)(j,this).validateSingleFile(e),i[e.id]=e,s.push(e)}catch(e){l.push(e)}try{(0,o.A)(j,this).validateAggregateRestrictions(Object.values(t),s)}catch(e){return l.push(e),{nextFilesState:t,validFilesToAdd:[],errors:l}}return{nextFilesState:i,validFilesToAdd:s,errors:l}}function Q(){let{files:e}=this.getState();return Object.keys(e).filter(t=>{let i=e[t];return i.error&&(!i.missingRequiredMetaFields||0===i.missingRequiredMetaFields.length)})}async function Z(){let e=(0,n.A)(W,this,Q).call(this),t={...this.getState().files};if(e.forEach(e=>{t[e]={...t[e],isPaused:!1,error:null}}),this.setState({files:t,error:null}),this.emit("retry-all",this.getFilesByIds(e)),0===e.length)return{successful:[],failed:[]};let i=(0,n.A)(W,this,es).call(this,e,{forceAllowNewUpload:!0});return(0,n.A)(W,this,eo).call(this,i)}function ee(){let e=(0,n.A)(W,this,et).call(this),t=null;null!=e&&((t=Math.round(100*e))>100?t=100:t<0&&(t=0)),this.emit("progress",null!=t?t:0),this.setState({totalProgress:null!=t?t:0})}function et(){let e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(0===e.length)return 0;if(e.every(e=>e.progress.uploadComplete))return 1;let t=e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal,i=e.filter(t),s=e.filter(e=>!t(e));if(i.every(e=>e.progress.uploadComplete)&&s.length>0&&!s.every(e=>e.progress.uploadComplete))return null;let l=i.reduce((e,t)=>{var i;return e+(null!=(i=t.progress.bytesTotal)?i:0)},0),r=i.reduce((e,t)=>e+(t.progress.bytesUploaded||0),0);return 0===l?0:r/l}function ei(){let 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 l;this.log(i.message,"error");let e=Error(this.i18n("failedToUpload",{file:null!=(l=null==t?void 0:t.name)?l:""}));e.isUserFacing=!0,e.details=i.message,i.details&&(e.details+=` ${i.details}`),(0,n.A)(W,this,Y).call(this,[e])}else(0,n.A)(W,this,Y).call(this,[i])});let t=null;this.on("upload-stalled",(e,i)=>{let{message:s}=e,l=i.map(e=>e.meta.name).join(", ");t||(this.info({message:s,details:l},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${s} ${l}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let i=e=>{let t=Object.fromEntries(e.filter(e=>{let 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}).map(e=>[e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:e.size}}]));this.patchFilesState(t)};this.on("upload-start",i),this.on("upload-progress",(0,o.A)(q,this)),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}`);let i=this.getFile(e.id).progress,s=(0,o.A)(x,this).size>0;this.setFileState(e.id,{progress:{...i,postprocess:s?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!s&&{complete:!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}),(0,o.A)(_,this).call(this)}),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}`);
6let 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=>{let t=e&&this.getFile(e.id);if(null==t)return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);let{postprocess:i,...s}=t.progress;this.patchFilesState({[t.id]:{progress:{...s,complete:!0}}})}),this.on("restored",()=>{(0,o.A)(_,this).call(this)}),this.on("dashboard:file-edit-complete",e=>{e&&(0,n.A)(W,this,G).call(this,e)}),"u">typeof window&&window.addEventListener&&(window.addEventListener("online",(0,o.A)(L,this)),window.addEventListener("offline",(0,o.A)(L,this)),setTimeout((0,o.A)(L,this),3e3))}function es(e,t={}){let{forceAllowNewUpload:i=!1}=t,{allowNewUpload:s,currentUploads:l}=this.getState();if(!s&&!i)throw Error("Cannot create a new upload: already uploading.");let r=(0,u.A)();return this.emit("upload",r,this.getFilesByIds(e)),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...l,[r]:{fileIDs:e,step:0,result:{}}}}),r}function el(e){let{currentUploads:t}=this.getState();return t[e]}function er(e){let{[e]:t,...i}=this.getState().currentUploads;this.setState({currentUploads:i})}async function eo(e){let t,i=()=>{let{currentUploads:t}=this.getState();return t[e]},s=i();if(!s)throw Error("Nonexistent upload");let l=[...(0,o.A)(N,this),...(0,o.A)(z,this),...(0,o.A)(x,this)];try{for(let t=s.step||0;t<l.length;t++){let r=l[t];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...s,step:t}}});let{fileIDs:o}=s;if(await r(o,e),!(s=i()))break}}catch(t){throw(0,n.A)(W,this,er).call(this,e),t}if(s){s.fileIDs.forEach(e=>{let t=this.getFile(e);null!=t&&t.progress.postprocess&&this.emit("postprocess-complete",t)});let t=s.fileIDs.map(e=>this.getFile(e)),l=t.filter(e=>!e.error),r=t.filter(e=>e.error);this.addResultData(e,{successful:l,failed:r,uploadID:e}),s=i()}return s&&(t=s.result,(0,n.A)(W,this,er).call(this,e)),null==t&&(this.log(`Not setting result for an upload that has been removed: ${e}`),t={successful:[],failed:[],uploadID:e}),t}(0,r.A)(B,"VERSION",c.rE);let en=B},21530(e,t,i){"use strict";i.d(t,{A:()=>p});var s=i(62470),l=i(8837),r=i(50016),o=i(24642),n=i(5046),a=i(6874);/** 7 * Takes a string with placeholder variables like `%{smart_count} file selected` 8 * and replaces it with values from options `{smart_count: 5}` 9 * 10 * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE 11 * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299 12 * 13 * @param phrase that needs interpolation, with placeholders 14 * @param options with values that will be used to replace placeholders 15 */function h(e,t){let i=/\$/g,s=[e];if(null==t)return s;for(let e of Object.keys(t))if("_"!==e){let l=t[e];"string"==typeof l&&(l=i[Symbol.replace](l,"$$$$")),s=function(e,t,i){let s=[];return e.forEach(e=>{"string"!=typeof e?s.push(e):t[Symbol.split](e).forEach((e,t,l)=>{""!==e&&s.push(e),t<l.length-1&&s.push(i)})}),s}(s,RegExp(`%\\{${e}\\}`,"g"),l)}return s}let d=e=>{throw Error(`missing string: ${e}`)};var u=new WeakMap,c=new WeakSet;class p{constructor(e,{onMissingKey:t=d}={}){(0,s.A)(this,c),(0,r.A)(this,"locale",void 0),(0,l.A)(this,u,void 0),this.locale={strings:{},pluralize:e=>+(1!==e)},Array.isArray(e)?e.forEach((0,a.A)(c,this,g),this):(0,a.A)(c,this,g).call(this,e),(0,n.A)(u,this,t)}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let i=this.locale.strings[e];if(null==i&&((0,o.A)(u,this).call(this,e),i=e),"object"==typeof i){if(t&&void 0!==t.smart_count)return h(i[this.locale.pluralize(t.smart_count)],t);throw Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof i)throw Error("string was not a string");return h(i,t)}}function g(e){if(!(null!=e&&e.strings))return;let t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.