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B,CACF,CAAE,MAAOlK,GAEP,MADAnM,EAA4BqC,KAAMR,GAAeA,GAAegM,GAC1D1B,CACR,CAGA,GAAI+F,EAAe,CAWjBA,EAAc5E,QAAQ/D,SAAQjB,IAC5B,MAAM/E,EAAOlB,KAAKqB,QAAQ4E,GACtB/E,GAAQA,EAAKK,SAASqH,aACxB5I,KAAKuE,KAAK,uBAAwBrD,EACpC,IAEF,MAAM8B,EAAQ6M,EAAc5E,QAAQlF,KAAIE,GAAUjG,KAAKqB,QAAQ4E,KACzDqG,EAAatJ,EAAMuF,QAAOrH,IAASA,EAAKiG,QACxCoF,EAASvJ,EAAMuF,QAAOrH,GAAQA,EAAKiG,cACnCnH,KAAK4P,cAAcpE,EAAU,CACjCc,aACAC,SACAf,aAIFqE,EAAgBmE,GAClB,CAKA,IAAIlE,EASJ,OARID,IACFC,EAASD,EAAcC,OACvB9P,KAAKuE,KAAK,WAAYuL,GACtBnS,EAA4BqC,KAAMR,GAAeA,GAAegM,IAEpD,MAAVsE,GACF9P,KAAKsB,IAAI,2DAA2DkK,KAE/DsE,CACT,CACAlQ,EAAKyD,QAhpDQ,QAipDb","sources":["webpack://mono-repo/./node_modules/@uppy/core/lib/Uppy.js"],"sourcesContent":["let _Symbol$for, _Symbol$for2;\nfunction _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError(\"attempted to use private field on non-instance\"); } return receiver; }\nvar id = 0;\nfunction _classPrivateFieldLooseKey(name) { return \"__private_\" + id++ + \"_\" + name; }\n/* eslint-disable max-classes-per-file */\n/* global AggregateError */\n\nimport Translator from '@uppy/utils/lib/Translator';\nimport ee from 'namespace-emitter';\nimport { nanoid } from 'nanoid/non-secure';\nimport throttle from 'lodash/throttle.js';\nimport DefaultStore from '@uppy/store-default';\nimport getFileType from '@uppy/utils/lib/getFileType';\nimport getFileNameAndExtension from '@uppy/utils/lib/getFileNameAndExtension';\nimport { getSafeFileId } from '@uppy/utils/lib/generateFileID';\nimport supportsUploadProgress from './supportsUploadProgress.js';\nimport getFileName from './getFileName.js';\nimport { justErrorsLogger, debugLogger } from './loggers.js';\nimport { Restricter, defaultOptions as defaultRestrictionOptions, RestrictionError } from './Restricter.js';\nconst packageJson = {\n \"version\": \"3.3.1\"\n};\nimport locale from './locale.js';\n\n/**\n * Uppy Core module.\n * Manages plugins, state updates, acts as an event bus,\n * adds/removes files and metadata.\n */\nvar _plugins = /*#__PURE__*/_classPrivateFieldLooseKey(\"plugins\");\nvar _restricter = /*#__PURE__*/_classPrivateFieldLooseKey(\"restricter\");\nvar _storeUnsubscribe = /*#__PURE__*/_classPrivateFieldLooseKey(\"storeUnsubscribe\");\nvar _emitter = /*#__PURE__*/_classPrivateFieldLooseKey(\"emitter\");\nvar _preProcessors = /*#__PURE__*/_classPrivateFieldLooseKey(\"preProcessors\");\nvar _uploaders = /*#__PURE__*/_classPrivateFieldLooseKey(\"uploaders\");\nvar _postProcessors = /*#__PURE__*/_classPrivateFieldLooseKey(\"postProcessors\");\nvar _informAndEmit = /*#__PURE__*/_classPrivateFieldLooseKey(\"informAndEmit\");\nvar _checkRequiredMetaFieldsOnFile = /*#__PURE__*/_classPrivateFieldLooseKey(\"checkRequiredMetaFieldsOnFile\");\nvar _checkRequiredMetaFields = /*#__PURE__*/_classPrivateFieldLooseKey(\"checkRequiredMetaFields\");\nvar _assertNewUploadAllowed = /*#__PURE__*/_classPrivateFieldLooseKey(\"assertNewUploadAllowed\");\nvar _transformFile = /*#__PURE__*/_classPrivateFieldLooseKey(\"transformFile\");\nvar _startIfAutoProceed = /*#__PURE__*/_classPrivateFieldLooseKey(\"startIfAutoProceed\");\nvar _checkAndUpdateFileState = /*#__PURE__*/_classPrivateFieldLooseKey(\"checkAndUpdateFileState\");\nvar _addListeners = /*#__PURE__*/_classPrivateFieldLooseKey(\"addListeners\");\nvar _updateOnlineStatus = /*#__PURE__*/_classPrivateFieldLooseKey(\"updateOnlineStatus\");\nvar _createUpload = /*#__PURE__*/_classPrivateFieldLooseKey(\"createUpload\");\nvar _getUpload = /*#__PURE__*/_classPrivateFieldLooseKey(\"getUpload\");\nvar _removeUpload = /*#__PURE__*/_classPrivateFieldLooseKey(\"removeUpload\");\nvar _runUpload = /*#__PURE__*/_classPrivateFieldLooseKey(\"runUpload\");\n_Symbol$for = Symbol.for('uppy test: getPlugins');\n_Symbol$for2 = Symbol.for('uppy test: createUpload');\nclass Uppy {\n /**\n * Instantiate Uppy\n *\n * @param {object} opts — Uppy options\n */\n constructor(_opts) {\n /**\n * Run an upload. This picks up where it left off in case the upload is being restored.\n *\n * @private\n */\n Object.defineProperty(this, _runUpload, {\n value: _runUpload2\n });\n /**\n * Remove an upload, eg. if it has been canceled or completed.\n *\n * @param {string} uploadID The ID of the upload.\n */\n Object.defineProperty(this, _removeUpload, {\n value: _removeUpload2\n });\n Object.defineProperty(this, _getUpload, {\n value: _getUpload2\n });\n /**\n * Create an upload for a bunch of files.\n *\n * @param {Array} fileIDs File IDs to include in this upload.\n * @returns {string} ID of this upload.\n */\n Object.defineProperty(this, _createUpload, {\n value: _createUpload2\n });\n /**\n * Registers listeners for all global actions, like:\n * `error`, `file-removed`, `upload-progress`\n */\n Object.defineProperty(this, _addListeners, {\n value: _addListeners2\n });\n Object.defineProperty(this, _checkAndUpdateFileState, {\n value: _checkAndUpdateFileState2\n });\n // Schedule an upload if `autoProceed` is enabled.\n Object.defineProperty(this, _startIfAutoProceed, {\n value: _startIfAutoProceed2\n });\n /**\n * Create a file state object based on user-provided `addFile()` options.\n */\n Object.defineProperty(this, _transformFile, {\n value: _transformFile2\n });\n Object.defineProperty(this, _assertNewUploadAllowed, {\n value: _assertNewUploadAllowed2\n });\n Object.defineProperty(this, _checkRequiredMetaFields, {\n value: _checkRequiredMetaFields2\n });\n Object.defineProperty(this, _checkRequiredMetaFieldsOnFile, {\n value: _checkRequiredMetaFieldsOnFile2\n });\n /*\n * @constructs\n * @param { Error[] } errors\n * @param { undefined } file\n */\n /*\n * @constructs\n * @param { RestrictionError } error\n */\n Object.defineProperty(this, _informAndEmit, {\n value: _informAndEmit2\n });\n /** @type {Record} */\n Object.defineProperty(this, _plugins, {\n writable: true,\n value: Object.create(null)\n });\n Object.defineProperty(this, _restricter, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _storeUnsubscribe, {\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, _emitter, {\n writable: true,\n value: ee()\n });\n Object.defineProperty(this, _preProcessors, {\n writable: true,\n value: new Set()\n });\n Object.defineProperty(this, _uploaders, {\n writable: true,\n value: new Set()\n });\n Object.defineProperty(this, _postProcessors, {\n writable: true,\n value: new Set()\n });\n // ___Why throttle at 500ms?\n // - We must throttle at >250ms for superfocus in Dashboard to work well\n // (because animation takes 0.25s, and we want to wait for all animations to be over before refocusing).\n // [Practical Check]: if thottle is at 100ms, then if you are uploading a file,\n // and click 'ADD MORE FILES', - focus won't activate in Firefox.\n // - We must throttle at around >500ms to avoid performance lags.\n // [Practical Check] Firefox, try to upload a big file for a prolonged period of time. Laptop will start to heat up.\n this.calculateProgress = throttle((file, data) => {\n const fileInState = this.getFile(file == null ? void 0 : file.id);\n if (file == null || !fileInState) {\n this.log(`Not setting progress for a file that has been removed: ${file == null ? void 0 : file.id}`);\n return;\n }\n if (fileInState.progress.percentage === 100) {\n this.log(`Not setting progress for a file that has been already uploaded: ${file.id}`);\n return;\n }\n\n // bytesTotal may be null or zero; in that case we can't divide by it\n const canHavePercentage = Number.isFinite(data.bytesTotal) && data.bytesTotal > 0;\n this.setFileState(file.id, {\n progress: {\n ...fileInState.progress,\n bytesUploaded: data.bytesUploaded,\n bytesTotal: data.bytesTotal,\n percentage: canHavePercentage ? Math.round(data.bytesUploaded / data.bytesTotal * 100) : 0\n }\n });\n this.calculateTotalProgress();\n }, 500, {\n leading: true,\n trailing: true\n });\n Object.defineProperty(this, _updateOnlineStatus, {\n writable: true,\n value: this.updateOnlineStatus.bind(this)\n });\n this.defaultLocale = locale;\n const defaultOptions = {\n id: 'uppy',\n autoProceed: false,\n allowMultipleUploadBatches: true,\n debug: false,\n restrictions: defaultRestrictionOptions,\n meta: {},\n onBeforeFileAdded: currentFile => currentFile,\n onBeforeUpload: files => files,\n store: new DefaultStore(),\n logger: justErrorsLogger,\n infoTimeout: 5000\n };\n\n // Merge default options with the ones set by user,\n // making sure to merge restrictions too\n this.opts = {\n ...defaultOptions,\n ..._opts,\n restrictions: {\n ...defaultOptions.restrictions,\n ...(_opts && _opts.restrictions)\n }\n };\n\n // Support debug: true for backwards-compatability, unless logger is set in opts\n // opts instead of this.opts to avoid comparing objects — we set logger: justErrorsLogger in defaultOptions\n if (_opts && _opts.logger && _opts.debug) {\n 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');\n } else if (_opts && _opts.debug) {\n this.opts.logger = debugLogger;\n }\n this.log(`Using Core v${this.constructor.VERSION}`);\n this.i18nInit();\n this.store = this.opts.store;\n this.setState({\n plugins: {},\n files: {},\n currentUploads: {},\n allowNewUpload: true,\n capabilities: {\n uploadProgress: supportsUploadProgress(),\n individualCancellation: true,\n resumableUploads: false\n },\n totalProgress: 0,\n meta: {\n ...this.opts.meta\n },\n info: [],\n recoveredState: null\n });\n _classPrivateFieldLooseBase(this, _restricter)[_restricter] = new Restricter(() => this.opts, this.i18n);\n _classPrivateFieldLooseBase(this, _storeUnsubscribe)[_storeUnsubscribe] = this.store.subscribe((prevState, nextState, patch) => {\n this.emit('state-update', prevState, nextState, patch);\n this.updateAll(nextState);\n });\n\n // Exposing uppy object on window for debugging and testing\n if (this.opts.debug && typeof window !== 'undefined') {\n window[this.opts.id] = this;\n }\n _classPrivateFieldLooseBase(this, _addListeners)[_addListeners]();\n }\n emit(event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n _classPrivateFieldLooseBase(this, _emitter)[_emitter].emit(event, ...args);\n }\n on(event, callback) {\n _classPrivateFieldLooseBase(this, _emitter)[_emitter].on(event, callback);\n return this;\n }\n once(event, callback) {\n _classPrivateFieldLooseBase(this, _emitter)[_emitter].once(event, callback);\n return this;\n }\n off(event, callback) {\n _classPrivateFieldLooseBase(this, _emitter)[_emitter].off(event, callback);\n return this;\n }\n\n /**\n * Iterate on all plugins and run `update` on them.\n * Called each time state changes.\n *\n */\n updateAll(state) {\n this.iteratePlugins(plugin => {\n plugin.update(state);\n });\n }\n\n /**\n * Updates state with a patch\n *\n * @param {object} patch {foo: 'bar'}\n */\n setState(patch) {\n this.store.setState(patch);\n }\n\n /**\n * Returns current state.\n *\n * @returns {object}\n */\n getState() {\n return this.store.getState();\n }\n patchFilesState(filesWithNewState) {\n const existingFilesState = this.getState().files;\n this.setState({\n files: {\n ...existingFilesState,\n ...Object.fromEntries(Object.entries(filesWithNewState).map(_ref => {\n let [fileID, newFileState] = _ref;\n return [fileID, {\n ...existingFilesState[fileID],\n ...newFileState\n }];\n }))\n }\n });\n }\n\n /**\n * Shorthand to set state for a specific file.\n */\n setFileState(fileID, state) {\n if (!this.getState().files[fileID]) {\n throw new Error(`Can’t set state for ${fileID} (the file could have been removed)`);\n }\n this.patchFilesState({\n [fileID]: state\n });\n }\n i18nInit() {\n const translator = new Translator([this.defaultLocale, this.opts.locale]);\n this.i18n = translator.translate.bind(translator);\n this.i18nArray = translator.translateArray.bind(translator);\n this.locale = translator.locale;\n }\n setOptions(newOpts) {\n this.opts = {\n ...this.opts,\n ...newOpts,\n restrictions: {\n ...this.opts.restrictions,\n ...(newOpts && newOpts.restrictions)\n }\n };\n if (newOpts.meta) {\n this.setMeta(newOpts.meta);\n }\n this.i18nInit();\n if (newOpts.locale) {\n this.iteratePlugins(plugin => {\n plugin.setOptions(newOpts);\n });\n }\n\n // Note: this is not the preact `setState`, it's an internal function that has the same name.\n this.setState(); // so that UI re-renders with new options\n }\n\n resetProgress() {\n const defaultProgress = {\n percentage: 0,\n bytesUploaded: 0,\n uploadComplete: false,\n uploadStarted: null\n };\n const files = {\n ...this.getState().files\n };\n const updatedFiles = {};\n Object.keys(files).forEach(fileID => {\n updatedFiles[fileID] = {\n ...files[fileID],\n progress: {\n ...files[fileID].progress,\n ...defaultProgress\n }\n };\n });\n this.setState({\n files: updatedFiles,\n totalProgress: 0,\n allowNewUpload: true,\n error: null,\n recoveredState: null\n });\n this.emit('reset-progress');\n }\n addPreProcessor(fn) {\n _classPrivateFieldLooseBase(this, _preProcessors)[_preProcessors].add(fn);\n }\n removePreProcessor(fn) {\n return _classPrivateFieldLooseBase(this, _preProcessors)[_preProcessors].delete(fn);\n }\n addPostProcessor(fn) {\n _classPrivateFieldLooseBase(this, _postProcessors)[_postProcessors].add(fn);\n }\n removePostProcessor(fn) {\n return _classPrivateFieldLooseBase(this, _postProcessors)[_postProcessors].delete(fn);\n }\n addUploader(fn) {\n _classPrivateFieldLooseBase(this, _uploaders)[_uploaders].add(fn);\n }\n removeUploader(fn) {\n return _classPrivateFieldLooseBase(this, _uploaders)[_uploaders].delete(fn);\n }\n setMeta(data) {\n const updatedMeta = {\n ...this.getState().meta,\n ...data\n };\n const updatedFiles = {\n ...this.getState().files\n };\n Object.keys(updatedFiles).forEach(fileID => {\n updatedFiles[fileID] = {\n ...updatedFiles[fileID],\n meta: {\n ...updatedFiles[fileID].meta,\n ...data\n }\n };\n });\n this.log('Adding metadata:');\n this.log(data);\n this.setState({\n meta: updatedMeta,\n files: updatedFiles\n });\n }\n setFileMeta(fileID, data) {\n const updatedFiles = {\n ...this.getState().files\n };\n if (!updatedFiles[fileID]) {\n this.log('Was trying to set metadata for a file that has been removed: ', fileID);\n return;\n }\n const newMeta = {\n ...updatedFiles[fileID].meta,\n ...data\n };\n updatedFiles[fileID] = {\n ...updatedFiles[fileID],\n meta: newMeta\n };\n this.setState({\n files: updatedFiles\n });\n }\n\n /**\n * Get a file object.\n *\n * @param {string} fileID The ID of the file object to return.\n */\n getFile(fileID) {\n return this.getState().files[fileID];\n }\n\n /**\n * Get all files in an array.\n */\n getFiles() {\n const {\n files\n } = this.getState();\n return Object.values(files);\n }\n getFilesByIds(ids) {\n return ids.map(id => this.getFile(id));\n }\n getObjectOfFilesPerState() {\n const {\n files: filesObject,\n totalProgress,\n error\n } = this.getState();\n const files = Object.values(filesObject);\n const inProgressFiles = files.filter(_ref2 => {\n let {\n progress\n } = _ref2;\n return !progress.uploadComplete && progress.uploadStarted;\n });\n const newFiles = files.filter(file => !file.progress.uploadStarted);\n const startedFiles = files.filter(file => file.progress.uploadStarted || file.progress.preprocess || file.progress.postprocess);\n const uploadStartedFiles = files.filter(file => file.progress.uploadStarted);\n const pausedFiles = files.filter(file => file.isPaused);\n const completeFiles = files.filter(file => file.progress.uploadComplete);\n const erroredFiles = files.filter(file => file.error);\n const inProgressNotPausedFiles = inProgressFiles.filter(file => !file.isPaused);\n const processingFiles = files.filter(file => file.progress.preprocess || file.progress.postprocess);\n return {\n newFiles,\n startedFiles,\n uploadStartedFiles,\n pausedFiles,\n completeFiles,\n erroredFiles,\n inProgressFiles,\n inProgressNotPausedFiles,\n processingFiles,\n isUploadStarted: uploadStartedFiles.length > 0,\n isAllComplete: totalProgress === 100 && completeFiles.length === files.length && processingFiles.length === 0,\n isAllErrored: !!error && erroredFiles.length === files.length,\n isAllPaused: inProgressFiles.length !== 0 && pausedFiles.length === inProgressFiles.length,\n isUploadInProgress: inProgressFiles.length > 0,\n isSomeGhost: files.some(file => file.isGhost)\n };\n }\n validateRestrictions(file, files) {\n if (files === void 0) {\n files = this.getFiles();\n }\n try {\n _classPrivateFieldLooseBase(this, _restricter)[_restricter].validate(files, [file]);\n } catch (err) {\n return err;\n }\n return null;\n }\n checkIfFileAlreadyExists(fileID) {\n const {\n files\n } = this.getState();\n if (files[fileID] && !files[fileID].isGhost) {\n return true;\n }\n return false;\n }\n /**\n * Add a new file to `state.files`. This will run `onBeforeFileAdded`,\n * try to guess file type in a clever way, check file against restrictions,\n * and start an upload if `autoProceed === true`.\n *\n * @param {object} file object to add\n * @returns {string} id for the added file\n */\n addFile(file) {\n _classPrivateFieldLooseBase(this, _assertNewUploadAllowed)[_assertNewUploadAllowed](file);\n const {\n nextFilesState,\n validFilesToAdd,\n errors\n } = _classPrivateFieldLooseBase(this, _checkAndUpdateFileState)[_checkAndUpdateFileState]([file]);\n const restrictionErrors = errors.filter(error => error.isRestriction);\n _classPrivateFieldLooseBase(this, _informAndEmit)[_informAndEmit](restrictionErrors);\n if (errors.length > 0) throw errors[0];\n this.setState({\n files: nextFilesState\n });\n const [firstValidFileToAdd] = validFilesToAdd;\n this.emit('file-added', firstValidFileToAdd);\n this.emit('files-added', validFilesToAdd);\n this.log(`Added file: ${firstValidFileToAdd.name}, ${firstValidFileToAdd.id}, mime type: ${firstValidFileToAdd.type}`);\n _classPrivateFieldLooseBase(this, _startIfAutoProceed)[_startIfAutoProceed]();\n return firstValidFileToAdd.id;\n }\n\n /**\n * Add multiple files to `state.files`. See the `addFile()` documentation.\n *\n * If an error occurs while adding a file, it is logged and the user is notified.\n * This is good for UI plugins, but not for programmatic use.\n * Programmatic users should usually still use `addFile()` on individual files.\n */\n addFiles(fileDescriptors) {\n _classPrivateFieldLooseBase(this, _assertNewUploadAllowed)[_assertNewUploadAllowed]();\n const {\n nextFilesState,\n validFilesToAdd,\n errors\n } = _classPrivateFieldLooseBase(this, _checkAndUpdateFileState)[_checkAndUpdateFileState](fileDescriptors);\n const restrictionErrors = errors.filter(error => error.isRestriction);\n _classPrivateFieldLooseBase(this, _informAndEmit)[_informAndEmit](restrictionErrors);\n const nonRestrictionErrors = errors.filter(error => !error.isRestriction);\n if (nonRestrictionErrors.length > 0) {\n let message = 'Multiple errors occurred while adding files:\\n';\n nonRestrictionErrors.forEach(subError => {\n message += `\\n * ${subError.message}`;\n });\n this.info({\n message: this.i18n('addBulkFilesFailed', {\n smart_count: nonRestrictionErrors.length\n }),\n details: message\n }, 'error', this.opts.infoTimeout);\n if (typeof AggregateError === 'function') {\n throw new AggregateError(nonRestrictionErrors, message);\n } else {\n const err = new Error(message);\n err.errors = nonRestrictionErrors;\n throw err;\n }\n }\n\n // OK, we haven't thrown an error, we can start updating state and emitting events now:\n\n this.setState({\n files: nextFilesState\n });\n validFilesToAdd.forEach(file => {\n this.emit('file-added', file);\n });\n this.emit('files-added', validFilesToAdd);\n if (validFilesToAdd.length > 5) {\n this.log(`Added batch of ${validFilesToAdd.length} files`);\n } else {\n Object.values(validFilesToAdd).forEach(file => {\n this.log(`Added file: ${file.name}\\n id: ${file.id}\\n type: ${file.type}`);\n });\n }\n if (validFilesToAdd.length > 0) {\n _classPrivateFieldLooseBase(this, _startIfAutoProceed)[_startIfAutoProceed]();\n }\n }\n removeFiles(fileIDs, reason) {\n const {\n files,\n currentUploads\n } = this.getState();\n const updatedFiles = {\n ...files\n };\n const updatedUploads = {\n ...currentUploads\n };\n const removedFiles = Object.create(null);\n fileIDs.forEach(fileID => {\n if (files[fileID]) {\n removedFiles[fileID] = files[fileID];\n delete updatedFiles[fileID];\n }\n });\n\n // Remove files from the `fileIDs` list in each upload.\n function fileIsNotRemoved(uploadFileID) {\n return removedFiles[uploadFileID] === undefined;\n }\n Object.keys(updatedUploads).forEach(uploadID => {\n const newFileIDs = currentUploads[uploadID].fileIDs.filter(fileIsNotRemoved);\n\n // Remove the upload if no files are associated with it anymore.\n if (newFileIDs.length === 0) {\n delete updatedUploads[uploadID];\n return;\n }\n const {\n capabilities\n } = this.getState();\n if (newFileIDs.length !== currentUploads[uploadID].fileIDs.length && !capabilities.individualCancellation) {\n throw new Error('individualCancellation is disabled');\n }\n updatedUploads[uploadID] = {\n ...currentUploads[uploadID],\n fileIDs: newFileIDs\n };\n });\n const stateUpdate = {\n currentUploads: updatedUploads,\n files: updatedFiles\n };\n\n // If all files were removed - allow new uploads,\n // and clear recoveredState\n if (Object.keys(updatedFiles).length === 0) {\n stateUpdate.allowNewUpload = true;\n stateUpdate.error = null;\n stateUpdate.recoveredState = null;\n }\n this.setState(stateUpdate);\n this.calculateTotalProgress();\n const removedFileIDs = Object.keys(removedFiles);\n removedFileIDs.forEach(fileID => {\n this.emit('file-removed', removedFiles[fileID], reason);\n });\n if (removedFileIDs.length > 5) {\n this.log(`Removed ${removedFileIDs.length} files`);\n } else {\n this.log(`Removed files: ${removedFileIDs.join(', ')}`);\n }\n }\n removeFile(fileID, reason) {\n if (reason === void 0) {\n reason = null;\n }\n this.removeFiles([fileID], reason);\n }\n pauseResume(fileID) {\n if (!this.getState().capabilities.resumableUploads || this.getFile(fileID).uploadComplete) {\n return undefined;\n }\n const wasPaused = this.getFile(fileID).isPaused || false;\n const isPaused = !wasPaused;\n this.setFileState(fileID, {\n isPaused\n });\n this.emit('upload-pause', fileID, isPaused);\n return isPaused;\n }\n pauseAll() {\n const updatedFiles = {\n ...this.getState().files\n };\n const inProgressUpdatedFiles = Object.keys(updatedFiles).filter(file => {\n return !updatedFiles[file].progress.uploadComplete && updatedFiles[file].progress.uploadStarted;\n });\n inProgressUpdatedFiles.forEach(file => {\n const updatedFile = {\n ...updatedFiles[file],\n isPaused: true\n };\n updatedFiles[file] = updatedFile;\n });\n this.setState({\n files: updatedFiles\n });\n this.emit('pause-all');\n }\n resumeAll() {\n const updatedFiles = {\n ...this.getState().files\n };\n const inProgressUpdatedFiles = Object.keys(updatedFiles).filter(file => {\n return !updatedFiles[file].progress.uploadComplete && updatedFiles[file].progress.uploadStarted;\n });\n inProgressUpdatedFiles.forEach(file => {\n const updatedFile = {\n ...updatedFiles[file],\n isPaused: false,\n error: null\n };\n updatedFiles[file] = updatedFile;\n });\n this.setState({\n files: updatedFiles\n });\n this.emit('resume-all');\n }\n retryAll() {\n const updatedFiles = {\n ...this.getState().files\n };\n const filesToRetry = Object.keys(updatedFiles).filter(file => {\n return updatedFiles[file].error;\n });\n filesToRetry.forEach(file => {\n const updatedFile = {\n ...updatedFiles[file],\n isPaused: false,\n error: null\n };\n updatedFiles[file] = updatedFile;\n });\n this.setState({\n files: updatedFiles,\n error: null\n });\n this.emit('retry-all', filesToRetry);\n if (filesToRetry.length === 0) {\n return Promise.resolve({\n successful: [],\n failed: []\n });\n }\n const uploadID = _classPrivateFieldLooseBase(this, _createUpload)[_createUpload](filesToRetry, {\n forceAllowNewUpload: true // create new upload even if allowNewUpload: false\n });\n\n return _classPrivateFieldLooseBase(this, _runUpload)[_runUpload](uploadID);\n }\n cancelAll(_temp) {\n let {\n reason = 'user'\n } = _temp === void 0 ? {} : _temp;\n this.emit('cancel-all', {\n reason\n });\n\n // Only remove existing uploads if user is canceling\n if (reason === 'user') {\n const {\n files\n } = this.getState();\n const fileIDs = Object.keys(files);\n if (fileIDs.length) {\n this.removeFiles(fileIDs, 'cancel-all');\n }\n this.setState({\n totalProgress: 0,\n error: null,\n recoveredState: null\n });\n }\n }\n retryUpload(fileID) {\n this.setFileState(fileID, {\n error: null,\n isPaused: false\n });\n this.emit('upload-retry', fileID);\n const uploadID = _classPrivateFieldLooseBase(this, _createUpload)[_createUpload]([fileID], {\n forceAllowNewUpload: true // create new upload even if allowNewUpload: false\n });\n\n return _classPrivateFieldLooseBase(this, _runUpload)[_runUpload](uploadID);\n }\n logout() {\n this.iteratePlugins(plugin => {\n if (plugin.provider && plugin.provider.logout) {\n plugin.provider.logout();\n }\n });\n }\n calculateTotalProgress() {\n // calculate total progress, using the number of files currently uploading,\n // multiplied by 100 and the summ of individual progress of each file\n const files = this.getFiles();\n const inProgress = files.filter(file => {\n return file.progress.uploadStarted || file.progress.preprocess || file.progress.postprocess;\n });\n if (inProgress.length === 0) {\n this.emit('progress', 0);\n this.setState({\n totalProgress: 0\n });\n return;\n }\n const sizedFiles = inProgress.filter(file => file.progress.bytesTotal != null);\n const unsizedFiles = inProgress.filter(file => file.progress.bytesTotal == null);\n if (sizedFiles.length === 0) {\n const progressMax = inProgress.length * 100;\n const currentProgress = unsizedFiles.reduce((acc, file) => {\n return acc + file.progress.percentage;\n }, 0);\n const totalProgress = Math.round(currentProgress / progressMax * 100);\n this.setState({\n totalProgress\n });\n return;\n }\n let totalSize = sizedFiles.reduce((acc, file) => {\n return acc + file.progress.bytesTotal;\n }, 0);\n const averageSize = totalSize / sizedFiles.length;\n totalSize += averageSize * unsizedFiles.length;\n let uploadedSize = 0;\n sizedFiles.forEach(file => {\n uploadedSize += file.progress.bytesUploaded;\n });\n unsizedFiles.forEach(file => {\n uploadedSize += averageSize * (file.progress.percentage || 0) / 100;\n });\n let totalProgress = totalSize === 0 ? 0 : Math.round(uploadedSize / totalSize * 100);\n\n // hot fix, because:\n // uploadedSize ended up larger than totalSize, resulting in 1325% total\n if (totalProgress > 100) {\n totalProgress = 100;\n }\n this.setState({\n totalProgress\n });\n this.emit('progress', totalProgress);\n }\n updateOnlineStatus() {\n const online = typeof window.navigator.onLine !== 'undefined' ? window.navigator.onLine : true;\n if (!online) {\n this.emit('is-offline');\n this.info(this.i18n('noInternetConnection'), 'error', 0);\n this.wasOffline = true;\n } else {\n this.emit('is-online');\n if (this.wasOffline) {\n this.emit('back-online');\n this.info(this.i18n('connectedToInternet'), 'success', 3000);\n this.wasOffline = false;\n }\n }\n }\n getID() {\n return this.opts.id;\n }\n\n /**\n * Registers a plugin with Core.\n *\n * @param {object} Plugin object\n * @param {object} [opts] object with options to be passed to Plugin\n * @returns {object} self for chaining\n */\n // eslint-disable-next-line no-shadow\n use(Plugin, opts) {\n if (typeof Plugin !== 'function') {\n const msg = `Expected a plugin class, but got ${Plugin === null ? 'null' : typeof Plugin}.` + ' Please verify that the plugin was imported and spelled correctly.';\n throw new TypeError(msg);\n }\n\n // Instantiate\n const plugin = new Plugin(this, opts);\n const pluginId = plugin.id;\n if (!pluginId) {\n throw new Error('Your plugin must have an id');\n }\n if (!plugin.type) {\n throw new Error('Your plugin must have a type');\n }\n const existsPluginAlready = this.getPlugin(pluginId);\n if (existsPluginAlready) {\n const msg = `Already found a plugin named '${existsPluginAlready.id}'. ` + `Tried to use: '${pluginId}'.\\n` + 'Uppy plugins must have unique `id` options. See https://uppy.io/docs/plugins/#id.';\n throw new Error(msg);\n }\n if (Plugin.VERSION) {\n this.log(`Using ${pluginId} v${Plugin.VERSION}`);\n }\n if (plugin.type in _classPrivateFieldLooseBase(this, _plugins)[_plugins]) {\n _classPrivateFieldLooseBase(this, _plugins)[_plugins][plugin.type].push(plugin);\n } else {\n _classPrivateFieldLooseBase(this, _plugins)[_plugins][plugin.type] = [plugin];\n }\n plugin.install();\n return this;\n }\n\n /**\n * Find one Plugin by name.\n *\n * @param {string} id plugin id\n * @returns {BasePlugin|undefined}\n */\n getPlugin(id) {\n for (const plugins of Object.values(_classPrivateFieldLooseBase(this, _plugins)[_plugins])) {\n const foundPlugin = plugins.find(plugin => plugin.id === id);\n if (foundPlugin != null) return foundPlugin;\n }\n return undefined;\n }\n [_Symbol$for](type) {\n return _classPrivateFieldLooseBase(this, _plugins)[_plugins][type];\n }\n\n /**\n * Iterate through all `use`d plugins.\n *\n * @param {Function} method that will be run on each plugin\n */\n iteratePlugins(method) {\n Object.values(_classPrivateFieldLooseBase(this, _plugins)[_plugins]).flat(1).forEach(method);\n }\n\n /**\n * Uninstall and remove a plugin.\n *\n * @param {object} instance The plugin instance to remove.\n */\n removePlugin(instance) {\n this.log(`Removing plugin ${instance.id}`);\n this.emit('plugin-remove', instance);\n if (instance.uninstall) {\n instance.uninstall();\n }\n const list = _classPrivateFieldLooseBase(this, _plugins)[_plugins][instance.type];\n // list.indexOf failed here, because Vue3 converted the plugin instance\n // to a Proxy object, which failed the strict comparison test:\n // obj !== objProxy\n const index = list.findIndex(item => item.id === instance.id);\n if (index !== -1) {\n list.splice(index, 1);\n }\n const state = this.getState();\n const updatedState = {\n plugins: {\n ...state.plugins,\n [instance.id]: undefined\n }\n };\n this.setState(updatedState);\n }\n\n /**\n * Uninstall all plugins and close down this Uppy instance.\n */\n close(_temp2) {\n let {\n reason\n } = _temp2 === void 0 ? {} : _temp2;\n this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`);\n this.cancelAll({\n reason\n });\n _classPrivateFieldLooseBase(this, _storeUnsubscribe)[_storeUnsubscribe]();\n this.iteratePlugins(plugin => {\n this.removePlugin(plugin);\n });\n if (typeof window !== 'undefined' && window.removeEventListener) {\n window.removeEventListener('online', _classPrivateFieldLooseBase(this, _updateOnlineStatus)[_updateOnlineStatus]);\n window.removeEventListener('offline', _classPrivateFieldLooseBase(this, _updateOnlineStatus)[_updateOnlineStatus]);\n }\n }\n hideInfo() {\n const {\n info\n } = this.getState();\n this.setState({\n info: info.slice(1)\n });\n this.emit('info-hidden');\n }\n\n /**\n * Set info message in `state.info`, so that UI plugins like `Informer`\n * can display the message.\n *\n * @param {string | object} message Message to be displayed by the informer\n * @param {string} [type]\n * @param {number} [duration]\n */\n info(message, type, duration) {\n if (type === void 0) {\n type = 'info';\n }\n if (duration === void 0) {\n duration = 3000;\n }\n const isComplexMessage = typeof message === 'object';\n this.setState({\n info: [...this.getState().info, {\n type,\n message: isComplexMessage ? message.message : message,\n details: isComplexMessage ? message.details : null\n }]\n });\n setTimeout(() => this.hideInfo(), duration);\n this.emit('info-visible');\n }\n\n /**\n * Passes messages to a function, provided in `opts.logger`.\n * If `opts.logger: Uppy.debugLogger` or `opts.debug: true`, logs to the browser console.\n *\n * @param {string|object} message to log\n * @param {string} [type] optional `error` or `warning`\n */\n log(message, type) {\n const {\n logger\n } = this.opts;\n switch (type) {\n case 'error':\n logger.error(message);\n break;\n case 'warning':\n logger.warn(message);\n break;\n default:\n logger.debug(message);\n break;\n }\n }\n\n /**\n * Restore an upload by its ID.\n */\n restore(uploadID) {\n this.log(`Core: attempting to restore upload \"${uploadID}\"`);\n if (!this.getState().currentUploads[uploadID]) {\n _classPrivateFieldLooseBase(this, _removeUpload)[_removeUpload](uploadID);\n return Promise.reject(new Error('Nonexistent upload'));\n }\n return _classPrivateFieldLooseBase(this, _runUpload)[_runUpload](uploadID);\n }\n [_Symbol$for2]() {\n return _classPrivateFieldLooseBase(this, _createUpload)[_createUpload](...arguments);\n }\n /**\n * Add data to an upload's result object.\n *\n * @param {string} uploadID The ID of the upload.\n * @param {object} data Data properties to add to the result object.\n */\n addResultData(uploadID, data) {\n if (!_classPrivateFieldLooseBase(this, _getUpload)[_getUpload](uploadID)) {\n this.log(`Not setting result for an upload that has been removed: ${uploadID}`);\n return;\n }\n const {\n currentUploads\n } = this.getState();\n const currentUpload = {\n ...currentUploads[uploadID],\n result: {\n ...currentUploads[uploadID].result,\n ...data\n }\n };\n this.setState({\n currentUploads: {\n ...currentUploads,\n [uploadID]: currentUpload\n }\n });\n }\n /**\n * Start an upload for all the files that are not currently being uploaded.\n *\n * @returns {Promise}\n */\n upload() {\n var _classPrivateFieldLoo;\n if (!((_classPrivateFieldLoo = _classPrivateFieldLooseBase(this, _plugins)[_plugins].uploader) != null && _classPrivateFieldLoo.length)) {\n this.log('No uploader type plugins are used', 'warning');\n }\n let {\n files\n } = this.getState();\n const onBeforeUploadResult = this.opts.onBeforeUpload(files);\n if (onBeforeUploadResult === false) {\n return Promise.reject(new Error('Not starting the upload because onBeforeUpload returned false'));\n }\n if (onBeforeUploadResult && typeof onBeforeUploadResult === 'object') {\n files = onBeforeUploadResult;\n // Updating files in state, because uploader plugins receive file IDs,\n // and then fetch the actual file object from state\n this.setState({\n files\n });\n }\n return Promise.resolve().then(() => _classPrivateFieldLooseBase(this, _restricter)[_restricter].validateMinNumberOfFiles(files)).catch(err => {\n _classPrivateFieldLooseBase(this, _informAndEmit)[_informAndEmit]([err]);\n throw err;\n }).then(() => {\n if (!_classPrivateFieldLooseBase(this, _checkRequiredMetaFields)[_checkRequiredMetaFields](files)) {\n throw new RestrictionError(this.i18n('missingRequiredMetaField'));\n }\n }).catch(err => {\n // Doing this in a separate catch because we already emited and logged\n // all the errors in `checkRequiredMetaFields` so we only throw a generic\n // missing fields error here.\n throw err;\n }).then(() => {\n const {\n currentUploads\n } = this.getState();\n // get a list of files that are currently assigned to uploads\n const currentlyUploadingFiles = Object.values(currentUploads).flatMap(curr => curr.fileIDs);\n const waitingFileIDs = [];\n Object.keys(files).forEach(fileID => {\n const file = this.getFile(fileID);\n // if the file hasn't started uploading and hasn't already been assigned to an upload..\n if (!file.progress.uploadStarted && currentlyUploadingFiles.indexOf(fileID) === -1) {\n waitingFileIDs.push(file.id);\n }\n });\n const uploadID = _classPrivateFieldLooseBase(this, _createUpload)[_createUpload](waitingFileIDs);\n return _classPrivateFieldLooseBase(this, _runUpload)[_runUpload](uploadID);\n }).catch(err => {\n this.emit('error', err);\n this.log(err, 'error');\n throw err;\n });\n }\n}\nfunction _informAndEmit2(errors) {\n for (const error of errors) {\n const {\n file,\n isRestriction\n } = error;\n if (isRestriction) {\n this.emit('restriction-failed', file, error);\n } else {\n this.emit('error', error);\n }\n this.log(error, 'warning');\n }\n const userFacingErrors = errors.filter(error => error.isUserFacing);\n\n // don't flood the user: only show the first 4 toasts\n const maxNumToShow = 4;\n const firstErrors = userFacingErrors.slice(0, maxNumToShow);\n const additionalErrors = userFacingErrors.slice(maxNumToShow);\n firstErrors.forEach(_ref3 => {\n let {\n message,\n details = ''\n } = _ref3;\n this.info({\n message,\n details\n }, 'error', this.opts.infoTimeout);\n });\n if (additionalErrors.length > 0) {\n this.info({\n message: this.i18n('additionalRestrictionsFailed', {\n count: additionalErrors.length\n })\n });\n }\n}\nfunction _checkRequiredMetaFieldsOnFile2(file) {\n const {\n missingFields,\n error\n } = _classPrivateFieldLooseBase(this, _restricter)[_restricter].getMissingRequiredMetaFields(file);\n if (missingFields.length > 0) {\n this.setFileState(file.id, {\n missingRequiredMetaFields: missingFields\n });\n this.log(error.message);\n this.emit('restriction-failed', file, error);\n return false;\n }\n return true;\n}\nfunction _checkRequiredMetaFields2(files) {\n let success = true;\n for (const file of Object.values(files)) {\n if (!_classPrivateFieldLooseBase(this, _checkRequiredMetaFieldsOnFile)[_checkRequiredMetaFieldsOnFile](file)) {\n success = false;\n }\n }\n return success;\n}\nfunction _assertNewUploadAllowed2(file) {\n const {\n allowNewUpload\n } = this.getState();\n if (allowNewUpload === false) {\n const error = new RestrictionError(this.i18n('noMoreFilesAllowed'), {\n file\n });\n _classPrivateFieldLooseBase(this, _informAndEmit)[_informAndEmit]([error]);\n throw error;\n }\n}\nfunction _transformFile2(fileDescriptorOrFile) {\n // Uppy expects files in { name, type, size, data } format.\n // If the actual File object is passed from input[type=file] or drag-drop,\n // we normalize it to match Uppy file object\n const fileDescriptor = fileDescriptorOrFile instanceof File ? {\n name: fileDescriptorOrFile.name,\n type: fileDescriptorOrFile.type,\n size: fileDescriptorOrFile.size,\n data: fileDescriptorOrFile\n } : fileDescriptorOrFile;\n const fileType = getFileType(fileDescriptor);\n const fileName = getFileName(fileType, fileDescriptor);\n const fileExtension = getFileNameAndExtension(fileName).extension;\n const isRemote = Boolean(fileDescriptor.isRemote);\n const id = getSafeFileId(fileDescriptor);\n const meta = fileDescriptor.meta || {};\n meta.name = fileName;\n meta.type = fileType;\n\n // `null` means the size is unknown.\n const size = Number.isFinite(fileDescriptor.data.size) ? fileDescriptor.data.size : null;\n return {\n source: fileDescriptor.source || '',\n id,\n name: fileName,\n extension: fileExtension || '',\n meta: {\n ...this.getState().meta,\n ...meta\n },\n type: fileType,\n data: fileDescriptor.data,\n progress: {\n percentage: 0,\n bytesUploaded: 0,\n bytesTotal: size,\n uploadComplete: false,\n uploadStarted: null\n },\n size,\n isRemote,\n remote: fileDescriptor.remote || '',\n preview: fileDescriptor.preview\n };\n}\nfunction _startIfAutoProceed2() {\n if (this.opts.autoProceed && !this.scheduledAutoProceed) {\n this.scheduledAutoProceed = setTimeout(() => {\n this.scheduledAutoProceed = null;\n this.upload().catch(err => {\n if (!err.isRestriction) {\n this.log(err.stack || err.message || err);\n }\n });\n }, 4);\n }\n}\nfunction _checkAndUpdateFileState2(filesToAdd) {\n const {\n files: existingFiles\n } = this.getState();\n\n // create a copy of the files object only once\n const nextFilesState = {\n ...existingFiles\n };\n const validFilesToAdd = [];\n const errors = [];\n for (const fileToAdd of filesToAdd) {\n try {\n var _existingFiles$newFil;\n let newFile = _classPrivateFieldLooseBase(this, _transformFile)[_transformFile](fileToAdd);\n\n // If a file has been recovered (Golden Retriever), but we were unable to recover its data (probably too large),\n // users are asked to re-select these half-recovered files and then this method will be called again.\n // In order to keep the progress, meta and everthing else, we keep the existing file,\n // but we replace `data`, and we remove `isGhost`, because the file is no longer a ghost now\n if ((_existingFiles$newFil = existingFiles[newFile.id]) != null && _existingFiles$newFil.isGhost) {\n const {\n isGhost,\n ...existingFileState\n } = existingFiles[newFile.id];\n newFile = {\n ...existingFileState,\n data: fileToAdd.data\n };\n this.log(`Replaced the blob in the restored ghost file: ${newFile.name}, ${newFile.id}`);\n }\n if (this.checkIfFileAlreadyExists(newFile.id)) {\n throw new RestrictionError(this.i18n('noDuplicates', {\n fileName: newFile.name\n }), {\n file: fileToAdd\n });\n }\n const onBeforeFileAddedResult = this.opts.onBeforeFileAdded(newFile, nextFilesState);\n if (onBeforeFileAddedResult === false) {\n // Don’t show UI info for this error, as it should be done by the developer\n throw new RestrictionError('Cannot add the file because onBeforeFileAdded returned false.', {\n isUserFacing: false,\n file: fileToAdd\n });\n } else if (typeof onBeforeFileAddedResult === 'object' && onBeforeFileAddedResult !== null) {\n newFile = onBeforeFileAddedResult;\n }\n _classPrivateFieldLooseBase(this, _restricter)[_restricter].validateSingleFile(newFile);\n\n // need to add it to the new local state immediately, so we can use the state to validate the next files too\n nextFilesState[newFile.id] = newFile;\n validFilesToAdd.push(newFile);\n } catch (err) {\n errors.push(err);\n }\n }\n try {\n // need to run this separately because it's much more slow, so if we run it inside the for-loop it will be very slow\n // when many files are added\n _classPrivateFieldLooseBase(this, _restricter)[_restricter].validateAggregateRestrictions(Object.values(existingFiles), validFilesToAdd);\n } catch (err) {\n errors.push(err);\n\n // If we have any aggregate error, don't allow adding this batch\n return {\n nextFilesState: existingFiles,\n validFilesToAdd: [],\n errors\n };\n }\n return {\n nextFilesState,\n validFilesToAdd,\n errors\n };\n}\nfunction _addListeners2() {\n /**\n * @param {Error} error\n * @param {object} [file]\n * @param {object} [response]\n */\n const errorHandler = (error, file, response) => {\n let errorMsg = error.message || 'Unknown error';\n if (error.details) {\n errorMsg += ` ${error.details}`;\n }\n this.setState({\n error: errorMsg\n });\n if (file != null && file.id in this.getState().files) {\n this.setFileState(file.id, {\n error: errorMsg,\n response\n });\n }\n };\n this.on('error', errorHandler);\n this.on('upload-error', (file, error, response) => {\n errorHandler(error, file, response);\n if (typeof error === 'object' && error.message) {\n this.log(error.message, 'error');\n const newError = new Error(this.i18n('failedToUpload', {\n file: file == null ? void 0 : file.name\n }));\n newError.isUserFacing = true; // todo maybe don't do this with all errors?\n newError.details = error.message;\n if (error.details) {\n newError.details += ` ${error.details}`;\n }\n _classPrivateFieldLooseBase(this, _informAndEmit)[_informAndEmit]([newError]);\n } else {\n _classPrivateFieldLooseBase(this, _informAndEmit)[_informAndEmit]([error]);\n }\n });\n let uploadStalledWarningRecentlyEmitted;\n this.on('upload-stalled', (error, files) => {\n const {\n message\n } = error;\n const details = files.map(file => file.meta.name).join(', ');\n if (!uploadStalledWarningRecentlyEmitted) {\n this.info({\n message,\n details\n }, 'warning', this.opts.infoTimeout);\n uploadStalledWarningRecentlyEmitted = setTimeout(() => {\n uploadStalledWarningRecentlyEmitted = null;\n }, this.opts.infoTimeout);\n }\n this.log(`${message} ${details}`.trim(), 'warning');\n });\n this.on('upload', () => {\n this.setState({\n error: null\n });\n });\n const onUploadStarted = files => {\n const filesFiltered = files.filter(file => {\n const exists = file != null && this.getFile(file.id);\n if (!exists) this.log(`Not setting progress for a file that has been removed: ${file == null ? void 0 : file.id}`);\n return exists;\n });\n const filesState = Object.fromEntries(filesFiltered.map(file => [file.id, {\n progress: {\n uploadStarted: Date.now(),\n uploadComplete: false,\n percentage: 0,\n bytesUploaded: 0,\n bytesTotal: file.size\n }\n }]));\n this.patchFilesState(filesState);\n };\n this.on('upload-start', files => {\n files.forEach(file => {\n // todo backward compat, remove this event in a next major\n this.emit('upload-started', file);\n });\n onUploadStarted(files);\n });\n this.on('upload-progress', this.calculateProgress);\n this.on('upload-success', (file, uploadResp) => {\n if (file == null || !this.getFile(file.id)) {\n this.log(`Not setting progress for a file that has been removed: ${file == null ? void 0 : file.id}`);\n return;\n }\n const currentProgress = this.getFile(file.id).progress;\n this.setFileState(file.id, {\n progress: {\n ...currentProgress,\n postprocess: _classPrivateFieldLooseBase(this, _postProcessors)[_postProcessors].size > 0 ? {\n mode: 'indeterminate'\n } : null,\n uploadComplete: true,\n percentage: 100,\n bytesUploaded: currentProgress.bytesTotal\n },\n response: uploadResp,\n uploadURL: uploadResp.uploadURL,\n isPaused: false\n });\n\n // Remote providers sometimes don't tell us the file size,\n // but we can know how many bytes we uploaded once the upload is complete.\n if (file.size == null) {\n this.setFileState(file.id, {\n size: uploadResp.bytesUploaded || currentProgress.bytesTotal\n });\n }\n this.calculateTotalProgress();\n });\n this.on('preprocess-progress', (file, progress) => {\n if (file == null || !this.getFile(file.id)) {\n this.log(`Not setting progress for a file that has been removed: ${file == null ? void 0 : file.id}`);\n return;\n }\n this.setFileState(file.id, {\n progress: {\n ...this.getFile(file.id).progress,\n preprocess: progress\n }\n });\n });\n this.on('preprocess-complete', file => {\n if (file == null || !this.getFile(file.id)) {\n this.log(`Not setting progress for a file that has been removed: ${file == null ? void 0 : file.id}`);\n return;\n }\n const files = {\n ...this.getState().files\n };\n files[file.id] = {\n ...files[file.id],\n progress: {\n ...files[file.id].progress\n }\n };\n delete files[file.id].progress.preprocess;\n this.setState({\n files\n });\n });\n this.on('postprocess-progress', (file, progress) => {\n if (file == null || !this.getFile(file.id)) {\n this.log(`Not setting progress for a file that has been removed: ${file == null ? void 0 : file.id}`);\n return;\n }\n this.setFileState(file.id, {\n progress: {\n ...this.getState().files[file.id].progress,\n postprocess: progress\n }\n });\n });\n this.on('postprocess-complete', file => {\n if (file == null || !this.getFile(file.id)) {\n this.log(`Not setting progress for a file that has been removed: ${file == null ? void 0 : file.id}`);\n return;\n }\n const files = {\n ...this.getState().files\n };\n files[file.id] = {\n ...files[file.id],\n progress: {\n ...files[file.id].progress\n }\n };\n delete files[file.id].progress.postprocess;\n this.setState({\n files\n });\n });\n this.on('restored', () => {\n // Files may have changed--ensure progress is still accurate.\n this.calculateTotalProgress();\n });\n this.on('dashboard:file-edit-complete', file => {\n if (file) {\n _classPrivateFieldLooseBase(this, _checkRequiredMetaFieldsOnFile)[_checkRequiredMetaFieldsOnFile](file);\n }\n });\n\n // show informer if offline\n if (typeof window !== 'undefined' && window.addEventListener) {\n window.addEventListener('online', _classPrivateFieldLooseBase(this, _updateOnlineStatus)[_updateOnlineStatus]);\n window.addEventListener('offline', _classPrivateFieldLooseBase(this, _updateOnlineStatus)[_updateOnlineStatus]);\n setTimeout(_classPrivateFieldLooseBase(this, _updateOnlineStatus)[_updateOnlineStatus], 3000);\n }\n}\nfunction _createUpload2(fileIDs, opts) {\n if (opts === void 0) {\n opts = {};\n }\n // uppy.retryAll sets this to true — when retrying we want to ignore `allowNewUpload: false`\n const {\n forceAllowNewUpload = false\n } = opts;\n const {\n allowNewUpload,\n currentUploads\n } = this.getState();\n if (!allowNewUpload && !forceAllowNewUpload) {\n throw new Error('Cannot create a new upload: already uploading.');\n }\n const uploadID = nanoid();\n this.emit('upload', {\n id: uploadID,\n fileIDs\n });\n this.setState({\n allowNewUpload: this.opts.allowMultipleUploadBatches !== false && this.opts.allowMultipleUploads !== false,\n currentUploads: {\n ...currentUploads,\n [uploadID]: {\n fileIDs,\n step: 0,\n result: {}\n }\n }\n });\n return uploadID;\n}\nfunction _getUpload2(uploadID) {\n const {\n currentUploads\n } = this.getState();\n return currentUploads[uploadID];\n}\nfunction _removeUpload2(uploadID) {\n const currentUploads = {\n ...this.getState().currentUploads\n };\n delete currentUploads[uploadID];\n this.setState({\n currentUploads\n });\n}\nasync function _runUpload2(uploadID) {\n const getCurrentUpload = () => {\n const {\n currentUploads\n } = this.getState();\n return currentUploads[uploadID];\n };\n let currentUpload = getCurrentUpload();\n const steps = [..._classPrivateFieldLooseBase(this, _preProcessors)[_preProcessors], ..._classPrivateFieldLooseBase(this, _uploaders)[_uploaders], ..._classPrivateFieldLooseBase(this, _postProcessors)[_postProcessors]];\n try {\n for (let step = currentUpload.step || 0; step < steps.length; step++) {\n if (!currentUpload) {\n break;\n }\n const fn = steps[step];\n this.setState({\n currentUploads: {\n ...this.getState().currentUploads,\n [uploadID]: {\n ...currentUpload,\n step\n }\n }\n });\n const {\n fileIDs\n } = currentUpload;\n\n // TODO give this the `updatedUpload` object as its only parameter maybe?\n // Otherwise when more metadata may be added to the upload this would keep getting more parameters\n await fn(fileIDs, uploadID);\n\n // Update currentUpload value in case it was modified asynchronously.\n currentUpload = getCurrentUpload();\n }\n } catch (err) {\n _classPrivateFieldLooseBase(this, _removeUpload)[_removeUpload](uploadID);\n throw err;\n }\n\n // Set result data.\n if (currentUpload) {\n // Mark postprocessing step as complete if necessary; this addresses a case where we might get\n // stuck in the postprocessing UI while the upload is fully complete.\n // If the postprocessing steps do not do any work, they may not emit postprocessing events at\n // all, and never mark the postprocessing as complete. This is fine on its own but we\n // introduced code in the @uppy/core upload-success handler to prepare postprocessing progress\n // state if any postprocessors are registered. That is to avoid a \"flash of completed state\"\n // before the postprocessing plugins can emit events.\n //\n // So, just in case an upload with postprocessing plugins *has* completed *without* emitting\n // postprocessing completion, we do it instead.\n currentUpload.fileIDs.forEach(fileID => {\n const file = this.getFile(fileID);\n if (file && file.progress.postprocess) {\n this.emit('postprocess-complete', file);\n }\n });\n const files = currentUpload.fileIDs.map(fileID => this.getFile(fileID));\n const successful = files.filter(file => !file.error);\n const failed = files.filter(file => file.error);\n await this.addResultData(uploadID, {\n successful,\n failed,\n uploadID\n });\n\n // Update currentUpload value in case it was modified asynchronously.\n currentUpload = getCurrentUpload();\n }\n // Emit completion events.\n // This is in a separate function so that the `currentUploads` variable\n // always refers to the latest state. In the handler right above it refers\n // to an outdated object without the `.result` property.\n let result;\n if (currentUpload) {\n result = currentUpload.result;\n this.emit('complete', result);\n _classPrivateFieldLooseBase(this, _removeUpload)[_removeUpload](uploadID);\n }\n if (result == null) {\n this.log(`Not setting result for an upload that has been removed: ${uploadID}`);\n }\n return result;\n}\nUppy.VERSION = packageJson.version;\nexport default Uppy;"],"names":["_Symbol$for","_Symbol$for2","_classPrivateFieldLooseBase","receiver","privateKey","Object","prototype","hasOwnProperty","call","TypeError","id","_classPrivateFieldLooseKey","name","_plugins","_restricter","_storeUnsubscribe","_emitter","_preProcessors","_uploaders","_postProcessors","_informAndEmit","_checkRequiredMetaFieldsOnFile","_checkRequiredMetaFields","_assertNewUploadAllowed","_transformFile","_startIfAutoProceed","_checkAndUpdateFileState","_addListeners","_updateOnlineStatus","_createUpload","_getUpload","_removeUpload","_runUpload","Symbol","for","Uppy","constructor","_opts","defineProperty","this","value","_runUpload2","_removeUpload2","_getUpload2","_createUpload2","_addListeners2","_checkAndUpdateFileState2","_startIfAutoProceed2","_transformFile2","_assertNewUploadAllowed2","_checkRequiredMetaFields2","_checkRequiredMetaFieldsOnFile2","_informAndEmit2","writable","create","Set","calculateProgress","file","data","fileInState","getFile","log","progress","percentage","canHavePercentage","Number","isFinite","bytesTotal","setFileState","bytesUploaded","Math","round","calculateTotalProgress","leading","trailing","updateOnlineStatus","bind","defaultLocale","defaultOptions","autoProceed","allowMultipleUploadBatches","debug","restrictions","meta","onBeforeFileAdded","currentFile","onBeforeUpload","files","store","logger","infoTimeout","opts","VERSION","i18nInit","setState","plugins","currentUploads","allowNewUpload","capabilities","uploadProgress","individualCancellation","resumableUploads","totalProgress","info","recoveredState","i18n","subscribe","prevState","nextState","patch","emit","updateAll","window","event","_len","arguments","length","args","Array","_key","on","callback","once","off","state","iteratePlugins","plugin","update","getState","patchFilesState","filesWithNewState","existingFilesState","fromEntries","entries","map","_ref","fileID","newFileState","Error","translator","locale","translate","i18nArray","translateArray","setOptions","newOpts","setMeta","resetProgress","defaultProgress","uploadComplete","uploadStarted","updatedFiles","keys","forEach","error","addPreProcessor","fn","add","removePreProcessor","delete","addPostProcessor","removePostProcessor","addUploader","removeUploader","updatedMeta","setFileMeta","newMeta","getFiles","values","getFilesByIds","ids","getObjectOfFilesPerState","filesObject","inProgressFiles","filter","_ref2","newFiles","startedFiles","preprocess","postprocess","uploadStartedFiles","pausedFiles","isPaused","completeFiles","erroredFiles","inProgressNotPausedFiles","processingFiles","isUploadStarted","isAllComplete","isAllErrored","isAllPaused","isUploadInProgress","isSomeGhost","some","isGhost","validateRestrictions","validate","err","checkIfFileAlreadyExists","addFile","nextFilesState","validFilesToAdd","errors","restrictionErrors","isRestriction","firstValidFileToAdd","type","addFiles","fileDescriptors","nonRestrictionErrors","message","subError","smart_count","details","AggregateError","removeFiles","fileIDs","reason","updatedUploads","removedFiles","fileIsNotRemoved","uploadFileID","undefined","uploadID","newFileIDs","stateUpdate","removedFileIDs","join","removeFile","pauseResume","pauseAll","updatedFile","resumeAll","retryAll","filesToRetry","Promise","resolve","successful","failed","forceAllowNewUpload","cancelAll","_temp","retryUpload","logout","provider","inProgress","sizedFiles","unsizedFiles","progressMax","currentProgress","reduce","acc","totalSize","averageSize","uploadedSize","navigator","onLine","wasOffline","getID","use","Plugin","pluginId","existsPluginAlready","getPlugin","msg","push","install","foundPlugin","find","method","flat","removePlugin","instance","uninstall","list","index","findIndex","item","splice","updatedState","close","_temp2","removeEventListener","hideInfo","slice","duration","isComplexMessage","setTimeout","warn","restore","reject","addResultData","currentUpload","result","upload","_classPrivateFieldLoo","uploader","onBeforeUploadResult","then","validateMinNumberOfFiles","catch","currentlyUploadingFiles","flatMap","curr","waitingFileIDs","indexOf","userFacingErrors","isUserFacing","firstErrors","additionalErrors","_ref3","count","missingFields","getMissingRequiredMetaFields","missingRequiredMetaFields","success","fileDescriptorOrFile","fileDescriptor","File","size","fileType","fileName","fileExtension","extension","isRemote","Boolean","source","remote","preview","scheduledAutoProceed","stack","filesToAdd","existingFiles","fileToAdd","_existingFiles$newFil","newFile","existingFileState","onBeforeFileAddedResult","validateSingleFile","validateAggregateRestrictions","errorHandler","response","errorMsg","uploadStalledWarningRecentlyEmitted","newError","trim","onUploadStarted","filesFiltered","exists","filesState","Date","now","uploadResp","mode","uploadURL","addEventListener","allowMultipleUploads","step","async","getCurrentUpload","steps"],"sourceRoot":""}