@wangeditor-next/editor
Version:
Web rich text editor, Web 富文本编辑器
1 lines • 315 kB
Source Map (JSON)
{"version":3,"file":"upload.mjs","sources":["../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/loggers.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/getTimeStamp.js","../../../node_modules/.pnpm/nanoid@3.3.11/node_modules/nanoid/non-secure/index.cjs","../../../node_modules/.pnpm/@transloadit+prettier-bytes@0.0.7/node_modules/@transloadit/prettier-bytes/prettierBytes.js","../../../node_modules/.pnpm/wildcard@1.1.2/node_modules/wildcard/index.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/Restricter.js","../../../node_modules/.pnpm/mime-match@1.0.2/node_modules/mime-match/index.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/hasProperty.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/Translator.js","../../../node_modules/.pnpm/namespace-emitter@2.0.1/node_modules/namespace-emitter/index.js","../../../node_modules/.pnpm/lodash.throttle@4.1.1/node_modules/lodash.throttle/index.js","../../../node_modules/.pnpm/@uppy+store-default@2.1.1/node_modules/@uppy/store-default/lib/index.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/getFileNameAndExtension.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/mimeTypes.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/Uppy.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/getFileType.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/generateFileID.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/supportsUploadProgress.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/getFileName.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/locale.js","../../../node_modules/.pnpm/preact@10.27.2/node_modules/preact/dist/preact.module.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/findDOMElement.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/isDOMElement.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/BasePlugin.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/UIPlugin.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/getTextDirection.js","../../../node_modules/.pnpm/@uppy+core@2.3.4/node_modules/@uppy/core/lib/index.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/NetworkError.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/RequestClient.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/fetchWithNetworkError.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/ErrorWithCause.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/AuthError.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/tokenStorage.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/index.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/Provider.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/SearchProvider.js","../../../node_modules/.pnpm/@uppy+companion-client@2.2.2/node_modules/@uppy/companion-client/lib/Socket.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/RateLimitedQueue.js","../../../node_modules/.pnpm/@uppy+xhr-upload@2.1.3_@uppy+core@2.3.4/node_modules/@uppy/xhr-upload/lib/locale.js","../../../node_modules/.pnpm/@uppy+xhr-upload@2.1.3_@uppy+core@2.3.4/node_modules/@uppy/xhr-upload/lib/index.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/emitSocketProgress.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/getSocketHost.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/settle.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/EventTracker.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/ProgressTimeout.js","../../../node_modules/.pnpm/@uppy+utils@4.1.3/node_modules/@uppy/utils/lib/isNetworkError.js","../../../node_modules/.pnpm/lodash.foreach@4.5.0/node_modules/lodash.foreach/index.js","../../core/src/utils/util.ts","../../core/src/upload/createUppyUploader.ts","../../core/src/upload/createUploader.ts"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.justErrorsLogger = exports.debugLogger = void 0;\n\n/* eslint-disable no-console */\nconst getTimeStamp = require(\"@uppy/utils/lib/getTimeStamp\"); // Swallow all logs, except errors.\n// default if logger is not set or debug: false\n\n\nconst justErrorsLogger = {\n debug: () => {},\n warn: () => {},\n error: function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return console.error(`[Uppy] [${getTimeStamp()}]`, ...args);\n }\n}; // Print logs to console with namespace + timestamp,\n// set by logger: Uppy.debugLogger or debug: true\n\nexports.justErrorsLogger = justErrorsLogger;\nconst debugLogger = {\n debug: function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return console.debug(`[Uppy] [${getTimeStamp()}]`, ...args);\n },\n warn: function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return console.warn(`[Uppy] [${getTimeStamp()}]`, ...args);\n },\n error: function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return console.error(`[Uppy] [${getTimeStamp()}]`, ...args);\n }\n};\nexports.debugLogger = debugLogger;","\"use strict\";\n\n/**\n * Adds zero to strings shorter than two characters.\n *\n * @param {number} number\n * @returns {string}\n */\nfunction pad(number) {\n return number < 10 ? `0${number}` : number.toString();\n}\n/**\n * Returns a timestamp in the format of `hours:minutes:seconds`\n */\n\n\nfunction getTimeStamp() {\n const date = new Date();\n const hours = pad(date.getHours());\n const minutes = pad(date.getMinutes());\n const seconds = pad(date.getSeconds());\n return `${hours}:${minutes}:${seconds}`;\n}\n\nmodule.exports = getTimeStamp;","// This alphabet uses `A-Za-z0-9_-` symbols.\n// The order of characters is optimized for better gzip and brotli compression.\n// References to the same file (works both for gzip and brotli):\n// `'use`, `andom`, and `rict'`\n// References to the brotli default dictionary:\n// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`\nlet urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'\n\nlet customAlphabet = (alphabet, defaultSize = 21) => {\n return (size = defaultSize) => {\n let id = ''\n // A compact alternative for `for (var i = 0; i < step; i++)`.\n let i = size | 0\n while (i--) {\n // `| 0` is more compact and faster than `Math.floor()`.\n id += alphabet[(Math.random() * alphabet.length) | 0]\n }\n return id\n }\n}\n\nlet nanoid = (size = 21) => {\n let id = ''\n // A compact alternative for `for (var i = 0; i < step; i++)`.\n let i = size | 0\n while (i--) {\n // `| 0` is more compact and faster than `Math.floor()`.\n id += urlAlphabet[(Math.random() * 64) | 0]\n }\n return id\n}\n\nmodule.exports = { nanoid, customAlphabet }\n","// Adapted from https://github.com/Flet/prettier-bytes/\n// Changing 1000 bytes to 1024, so we can keep uppercase KB vs kB\n// ISC License (c) Dan Flettre https://github.com/Flet/prettier-bytes/blob/master/LICENSE\nmodule.exports = function prettierBytes (num) {\n if (typeof num !== 'number' || isNaN(num)) {\n throw new TypeError('Expected a number, got ' + typeof num)\n }\n\n var neg = num < 0\n var units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\n\n if (neg) {\n num = -num\n }\n\n if (num < 1) {\n return (neg ? '-' : '') + num + ' B'\n }\n\n var exponent = Math.min(Math.floor(Math.log(num) / Math.log(1024)), units.length - 1)\n num = Number(num / Math.pow(1024, exponent))\n var unit = units[exponent]\n\n if (num >= 10 || num % 1 === 0) {\n // Do not show decimals when the number is two-digit, or if the number has no\n // decimal component.\n return (neg ? '-' : '') + num.toFixed(0) + ' ' + unit\n } else {\n return (neg ? '-' : '') + num.toFixed(1) + ' ' + unit\n }\n}\n","/* jshint node: true */\n'use strict';\n\n/**\n # wildcard\n\n Very simple wildcard matching, which is designed to provide the same\n functionality that is found in the\n [eve](https://github.com/adobe-webplatform/eve) eventing library.\n\n ## Usage\n\n It works with strings:\n\n <<< examples/strings.js\n\n Arrays:\n\n <<< examples/arrays.js\n\n Objects (matching against keys):\n\n <<< examples/objects.js\n\n While the library works in Node, if you are are looking for file-based\n wildcard matching then you should have a look at:\n\n <https://github.com/isaacs/node-glob>\n**/\n\nfunction WildcardMatcher(text, separator) {\n this.text = text = text || '';\n this.hasWild = ~text.indexOf('*');\n this.separator = separator;\n this.parts = text.split(separator);\n}\n\nWildcardMatcher.prototype.match = function(input) {\n var matches = true;\n var parts = this.parts;\n var ii;\n var partsCount = parts.length;\n var testParts;\n\n if (typeof input == 'string' || input instanceof String) {\n if (!this.hasWild && this.text != input) {\n matches = false;\n } else {\n testParts = (input || '').split(this.separator);\n for (ii = 0; matches && ii < partsCount; ii++) {\n if (parts[ii] === '*') {\n continue;\n } else if (ii < testParts.length) {\n matches = parts[ii] === testParts[ii];\n } else {\n matches = false;\n }\n }\n\n // If matches, then return the component parts\n matches = matches && testParts;\n }\n }\n else if (typeof input.splice == 'function') {\n matches = [];\n\n for (ii = input.length; ii--; ) {\n if (this.match(input[ii])) {\n matches[matches.length] = input[ii];\n }\n }\n }\n else if (typeof input == 'object') {\n matches = {};\n\n for (var key in input) {\n if (this.match(key)) {\n matches[key] = input[key];\n }\n }\n }\n\n return matches;\n};\n\nmodule.exports = function(text, test, separator) {\n var matcher = new WildcardMatcher(text, separator || /[\\/\\.]/);\n if (typeof test != 'undefined') {\n return matcher.match(test);\n }\n\n return matcher;\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.defaultOptions = exports.RestrictionError = exports.Restricter = void 0;\n\n/* eslint-disable max-classes-per-file, class-methods-use-this */\n\n/* global AggregateError */\nconst prettierBytes = require(\"@transloadit/prettier-bytes\");\n\nconst match = require(\"mime-match\");\n\nconst defaultOptions = {\n maxFileSize: null,\n minFileSize: null,\n maxTotalFileSize: null,\n maxNumberOfFiles: null,\n minNumberOfFiles: null,\n allowedFileTypes: null,\n requiredMetaFields: []\n};\nexports.defaultOptions = defaultOptions;\n\nclass RestrictionError extends Error {\n constructor() {\n super(...arguments);\n this.isRestriction = true;\n }\n\n}\n\nexports.RestrictionError = RestrictionError;\n\nif (typeof AggregateError === 'undefined') {\n // eslint-disable-next-line no-global-assign\n // TODO: remove this \"polyfill\" in the next major.\n globalThis.AggregateError = class AggregateError extends Error {\n constructor(errors, message) {\n super(message);\n this.errors = errors;\n }\n\n };\n}\n\nclass Restricter {\n constructor(getOpts, i18n) {\n this.i18n = i18n;\n\n this.getOpts = () => {\n const opts = getOpts();\n\n if (opts.restrictions.allowedFileTypes != null && !Array.isArray(opts.restrictions.allowedFileTypes)) {\n throw new TypeError('`restrictions.allowedFileTypes` must be an array');\n }\n\n return opts;\n };\n }\n\n validate(file, files) {\n const {\n maxFileSize,\n minFileSize,\n maxTotalFileSize,\n maxNumberOfFiles,\n allowedFileTypes\n } = this.getOpts().restrictions;\n\n if (maxNumberOfFiles) {\n const nonGhostFiles = files.filter(f => !f.isGhost);\n\n if (nonGhostFiles.length + 1 > maxNumberOfFiles) {\n throw new RestrictionError(`${this.i18n('youCanOnlyUploadX', {\n smart_count: maxNumberOfFiles\n })}`);\n }\n }\n\n if (allowedFileTypes) {\n const isCorrectFileType = allowedFileTypes.some(type => {\n // check if this is a mime-type\n if (type.includes('/')) {\n if (!file.type) return false;\n return match(file.type.replace(/;.*?$/, ''), type);\n } // otherwise this is likely an extension\n\n\n if (type[0] === '.' && file.extension) {\n return file.extension.toLowerCase() === type.slice(1).toLowerCase();\n }\n\n return false;\n });\n\n if (!isCorrectFileType) {\n const allowedFileTypesString = allowedFileTypes.join(', ');\n throw new RestrictionError(this.i18n('youCanOnlyUploadFileTypes', {\n types: allowedFileTypesString\n }));\n }\n } // We can't check maxTotalFileSize if the size is unknown.\n\n\n if (maxTotalFileSize && file.size != null) {\n const totalFilesSize = files.reduce((total, f) => total + f.size, file.size);\n\n if (totalFilesSize > maxTotalFileSize) {\n throw new RestrictionError(this.i18n('exceedsSize', {\n size: prettierBytes(maxTotalFileSize),\n file: file.name\n }));\n }\n } // We can't check maxFileSize if the size is unknown.\n\n\n if (maxFileSize && file.size != null && file.size > maxFileSize) {\n throw new RestrictionError(this.i18n('exceedsSize', {\n size: prettierBytes(maxFileSize),\n file: file.name\n }));\n } // We can't check minFileSize if the size is unknown.\n\n\n if (minFileSize && file.size != null && file.size < minFileSize) {\n throw new RestrictionError(this.i18n('inferiorSize', {\n size: prettierBytes(minFileSize)\n }));\n }\n }\n\n validateMinNumberOfFiles(files) {\n const {\n minNumberOfFiles\n } = this.getOpts().restrictions;\n\n if (Object.keys(files).length < minNumberOfFiles) {\n throw new RestrictionError(this.i18n('youHaveToAtLeastSelectX', {\n smart_count: minNumberOfFiles\n }));\n }\n }\n\n getMissingRequiredMetaFields(file) {\n const error = new RestrictionError(this.i18n('missingRequiredMetaFieldOnFile', {\n fileName: file.name\n }));\n const {\n requiredMetaFields\n } = this.getOpts().restrictions; // TODO: migrate to Object.hasOwn in the next major.\n\n const own = Object.prototype.hasOwnProperty;\n const missingFields = [];\n\n for (const field of requiredMetaFields) {\n if (!own.call(file.meta, field) || file.meta[field] === '') {\n missingFields.push(field);\n }\n }\n\n return {\n missingFields,\n error\n };\n }\n\n}\n\nexports.Restricter = Restricter;","var wildcard = require('wildcard');\nvar reMimePartSplit = /[\\/\\+\\.]/;\n\n/**\n # mime-match\n\n A simple function to checker whether a target mime type matches a mime-type\n pattern (e.g. image/jpeg matches image/jpeg OR image/*).\n\n ## Example Usage\n\n <<< example.js\n\n**/\nmodule.exports = function(target, pattern) {\n function test(pattern) {\n var result = wildcard(pattern, target, reMimePartSplit);\n\n // ensure that we have a valid mime type (should have two parts)\n return result && result.length >= 2;\n }\n\n return pattern ? test(pattern.split(';')[0]) : test;\n};\n","\"use strict\";\n\nfunction has(object, key) {\n return Object.prototype.hasOwnProperty.call(object, key);\n}\n\nmodule.exports = has;","\"use strict\";\n\nfunction _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError(\"attempted to use private field on non-instance\"); } return receiver; }\n\nvar id = 0;\n\nfunction _classPrivateFieldLooseKey(name) { return \"__private_\" + id++ + \"_\" + name; }\n\nconst has = require(\"./hasProperty.js\");\n\nfunction insertReplacement(source, rx, replacement) {\n const newParts = [];\n source.forEach(chunk => {\n // When the source contains multiple placeholders for interpolation,\n // we should ignore chunks that are not strings, because those\n // can be JSX objects and will be otherwise incorrectly turned into strings.\n // Without this condition we’d get this: [object Object] hello [object Object] my <button>\n if (typeof chunk !== 'string') {\n return newParts.push(chunk);\n }\n\n return rx[Symbol.split](chunk).forEach((raw, i, list) => {\n if (raw !== '') {\n newParts.push(raw);\n } // Interlace with the `replacement` value\n\n\n if (i < list.length - 1) {\n newParts.push(replacement);\n }\n });\n });\n return newParts;\n}\n/**\n * Takes a string with placeholder variables like `%{smart_count} file selected`\n * and replaces it with values from options `{smart_count: 5}`\n *\n * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE\n * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299\n *\n * @param {string} phrase that needs interpolation, with placeholders\n * @param {object} options with values that will be used to replace placeholders\n * @returns {any[]} interpolated\n */\n\n\nfunction interpolate(phrase, options) {\n const dollarRegex = /\\$/g;\n const dollarBillsYall = '$$$$';\n let interpolated = [phrase];\n if (options == null) return interpolated;\n\n for (const arg of Object.keys(options)) {\n if (arg !== '_') {\n // Ensure replacement value is escaped to prevent special $-prefixed\n // regex replace tokens. the \"$$$$\" is needed because each \"$\" needs to\n // be escaped with \"$\" itself, and we need two in the resulting output.\n let replacement = options[arg];\n\n if (typeof replacement === 'string') {\n replacement = dollarRegex[Symbol.replace](replacement, dollarBillsYall);\n } // We create a new `RegExp` each time instead of using a more-efficient\n // string replace so that the same argument can be replaced multiple times\n // in the same phrase.\n\n\n interpolated = insertReplacement(interpolated, new RegExp(`%\\\\{${arg}\\\\}`, 'g'), replacement);\n }\n }\n\n return interpolated;\n}\n/**\n * Translates strings with interpolation & pluralization support.\n * Extensible with custom dictionaries and pluralization functions.\n *\n * Borrows heavily from and inspired by Polyglot https://github.com/airbnb/polyglot.js,\n * basically a stripped-down version of it. Differences: pluralization functions are not hardcoded\n * and can be easily added among with dictionaries, nested objects are used for pluralization\n * as opposed to `||||` delimeter\n *\n * Usage example: `translator.translate('files_chosen', {smart_count: 3})`\n */\n\n\nvar _apply = /*#__PURE__*/_classPrivateFieldLooseKey(\"apply\");\n\nclass Translator {\n /**\n * @param {object|Array<object>} locales - locale or list of locales.\n */\n constructor(locales) {\n Object.defineProperty(this, _apply, {\n value: _apply2\n });\n this.locale = {\n strings: {},\n\n pluralize(n) {\n if (n === 1) {\n return 0;\n }\n\n return 1;\n }\n\n };\n\n if (Array.isArray(locales)) {\n locales.forEach(_classPrivateFieldLooseBase(this, _apply)[_apply], this);\n } else {\n _classPrivateFieldLooseBase(this, _apply)[_apply](locales);\n }\n }\n\n /**\n * Public translate method\n *\n * @param {string} key\n * @param {object} options with values that will be used later to replace placeholders in string\n * @returns {string} translated (and interpolated)\n */\n translate(key, options) {\n return this.translateArray(key, options).join('');\n }\n /**\n * Get a translation and return the translated and interpolated parts as an array.\n *\n * @param {string} key\n * @param {object} options with values that will be used to replace placeholders\n * @returns {Array} The translated and interpolated parts, in order.\n */\n\n\n translateArray(key, options) {\n if (!has(this.locale.strings, key)) {\n throw new Error(`missing string: ${key}`);\n }\n\n const string = this.locale.strings[key];\n const hasPluralForms = typeof string === 'object';\n\n if (hasPluralForms) {\n if (options && typeof options.smart_count !== 'undefined') {\n const plural = this.locale.pluralize(options.smart_count);\n return interpolate(string[plural], options);\n }\n\n throw new Error('Attempted to use a string with plural forms, but no value was given for %{smart_count}');\n }\n\n return interpolate(string, options);\n }\n\n}\n\nfunction _apply2(locale) {\n if (!(locale != null && locale.strings)) {\n return;\n }\n\n const prevLocale = this.locale;\n this.locale = { ...prevLocale,\n strings: { ...prevLocale.strings,\n ...locale.strings\n }\n };\n this.locale.pluralize = locale.pluralize || prevLocale.pluralize;\n}\n\nmodule.exports = Translator;","/**\n* Create an event emitter with namespaces\n* @name createNamespaceEmitter\n* @example\n* var emitter = require('./index')()\n*\n* emitter.on('*', function () {\n* console.log('all events emitted', this.event)\n* })\n*\n* emitter.on('example', function () {\n* console.log('example event emitted')\n* })\n*/\nmodule.exports = function createNamespaceEmitter () {\n var emitter = {}\n var _fns = emitter._fns = {}\n\n /**\n * Emit an event. Optionally namespace the event. Handlers are fired in the order in which they were added with exact matches taking precedence. Separate the namespace and event with a `:`\n * @name emit\n * @param {String} event – the name of the event, with optional namespace\n * @param {...*} data – up to 6 arguments that are passed to the event listener\n * @example\n * emitter.emit('example')\n * emitter.emit('demo:test')\n * emitter.emit('data', { example: true}, 'a string', 1)\n */\n emitter.emit = function emit (event, arg1, arg2, arg3, arg4, arg5, arg6) {\n var toEmit = getListeners(event)\n\n if (toEmit.length) {\n emitAll(event, toEmit, [arg1, arg2, arg3, arg4, arg5, arg6])\n }\n }\n\n /**\n * Create en event listener.\n * @name on\n * @param {String} event\n * @param {Function} fn\n * @example\n * emitter.on('example', function () {})\n * emitter.on('demo', function () {})\n */\n emitter.on = function on (event, fn) {\n if (!_fns[event]) {\n _fns[event] = []\n }\n\n _fns[event].push(fn)\n }\n\n /**\n * Create en event listener that fires once.\n * @name once\n * @param {String} event\n * @param {Function} fn\n * @example\n * emitter.once('example', function () {})\n * emitter.once('demo', function () {})\n */\n emitter.once = function once (event, fn) {\n function one () {\n fn.apply(this, arguments)\n emitter.off(event, one)\n }\n this.on(event, one)\n }\n\n /**\n * Stop listening to an event. Stop all listeners on an event by only passing the event name. Stop a single listener by passing that event handler as a callback.\n * You must be explicit about what will be unsubscribed: `emitter.off('demo')` will unsubscribe an `emitter.on('demo')` listener,\n * `emitter.off('demo:example')` will unsubscribe an `emitter.on('demo:example')` listener\n * @name off\n * @param {String} event\n * @param {Function} [fn] – the specific handler\n * @example\n * emitter.off('example')\n * emitter.off('demo', function () {})\n */\n emitter.off = function off (event, fn) {\n var keep = []\n\n if (event && fn) {\n var fns = this._fns[event]\n var i = 0\n var l = fns ? fns.length : 0\n\n for (i; i < l; i++) {\n if (fns[i] !== fn) {\n keep.push(fns[i])\n }\n }\n }\n\n keep.length ? this._fns[event] = keep : delete this._fns[event]\n }\n\n function getListeners (e) {\n var out = _fns[e] ? _fns[e] : []\n var idx = e.indexOf(':')\n var args = (idx === -1) ? [e] : [e.substring(0, idx), e.substring(idx + 1)]\n\n var keys = Object.keys(_fns)\n var i = 0\n var l = keys.length\n\n for (i; i < l; i++) {\n var key = keys[i]\n if (key === '*') {\n out = out.concat(_fns[key])\n }\n\n if (args.length === 2 && args[0] === key) {\n out = out.concat(_fns[key])\n break\n }\n }\n\n return out\n }\n\n function emitAll (e, fns, args) {\n var i = 0\n var l = fns.length\n\n for (i; i < l; i++) {\n if (!fns[i]) break\n fns[i].event = e\n fns[i].apply(fns[i], args)\n }\n }\n\n return emitter\n}\n","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = throttle;\n","\"use strict\";\n\nfunction _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError(\"attempted to use private field on non-instance\"); } return receiver; }\n\nvar id = 0;\n\nfunction _classPrivateFieldLooseKey(name) { return \"__private_\" + id++ + \"_\" + name; }\n\nconst packageJson = {\n \"version\": \"2.1.1\"\n};\n/**\n * Default store that keeps state in a simple object.\n */\n\nvar _publish = /*#__PURE__*/_classPrivateFieldLooseKey(\"publish\");\n\nclass DefaultStore {\n constructor() {\n Object.defineProperty(this, _publish, {\n value: _publish2\n });\n this.state = {};\n this.callbacks = []; // TODO: use a Set instead, make it a private prop\n }\n\n getState() {\n return this.state;\n }\n\n setState(patch) {\n const prevState = { ...this.state\n };\n const nextState = { ...this.state,\n ...patch\n };\n this.state = nextState;\n\n _classPrivateFieldLooseBase(this, _publish)[_publish](prevState, nextState, patch);\n }\n\n subscribe(listener) {\n this.callbacks.push(listener);\n return () => {\n // Remove the listener.\n this.callbacks.splice(this.callbacks.indexOf(listener), 1);\n };\n }\n\n} // TODO: export the class instead in the next major.\n\n\nfunction _publish2() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n this.callbacks.forEach(listener => {\n listener(...args);\n });\n}\n\nDefaultStore.VERSION = packageJson.version;\n\nfunction defaultStore() {\n return new DefaultStore();\n}\n\nmodule.exports = defaultStore;","\"use strict\";\n\nfunction getFileNameAndExtension(fullFileName) {\n const lastDot = fullFileName.lastIndexOf('.'); // these count as no extension: \"no-dot\", \"trailing-dot.\"\n\n if (lastDot === -1 || lastDot === fullFileName.length - 1) {\n return {\n name: fullFileName,\n extension: undefined\n };\n }\n\n return {\n name: fullFileName.slice(0, lastDot),\n extension: fullFileName.slice(lastDot + 1)\n };\n}\n\n/**\n * Takes a full filename string and returns an object {name, extension}\n *\n * @param {string} fullFileName\n * @returns {object} {name, extension}\n */\nmodule.exports = getFileNameAndExtension;","\"use strict\";\n\n// ___Why not add the mime-types package?\n// It's 19.7kB gzipped, and we only need mime types for well-known extensions (for file previews).\n// ___Where to take new extensions from?\n// https://github.com/jshttp/mime-db/blob/master/db.json\nmodule.exports = {\n md: 'text/markdown',\n markdown: 'text/markdown',\n mp4: 'video/mp4',\n mp3: 'audio/mp3',\n svg: 'image/svg+xml',\n jpg: 'image/jpeg',\n png: 'image/png',\n gif: 'image/gif',\n heic: 'image/heic',\n heif: 'image/heif',\n yaml: 'text/yaml',\n yml: 'text/yaml',\n csv: 'text/csv',\n tsv: 'text/tab-separated-values',\n tab: 'text/tab-separated-values',\n avi: 'video/x-msvideo',\n mks: 'video/x-matroska',\n mkv: 'video/x-matroska',\n mov: 'video/quicktime',\n dicom: 'application/dicom',\n doc: 'application/msword',\n docm: 'application/vnd.ms-word.document.macroenabled.12',\n docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n dot: 'application/msword',\n dotm: 'application/vnd.ms-word.template.macroenabled.12',\n dotx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n xla: 'application/vnd.ms-excel',\n xlam: 'application/vnd.ms-excel.addin.macroenabled.12',\n xlc: 'application/vnd.ms-excel',\n xlf: 'application/x-xliff+xml',\n xlm: 'application/vnd.ms-excel',\n xls: 'application/vnd.ms-excel',\n xlsb: 'application/vnd.ms-excel.sheet.binary.macroenabled.12',\n xlsm: 'application/vnd.ms-excel.sheet.macroenabled.12',\n xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n xlt: 'application/vnd.ms-excel',\n xltm: 'application/vnd.ms-excel.template.macroenabled.12',\n xltx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n xlw: 'application/vnd.ms-excel',\n txt: 'text/plain',\n text: 'text/plain',\n conf: 'text/plain',\n log: 'text/plain',\n pdf: 'application/pdf',\n zip: 'application/zip',\n '7z': 'application/x-7z-compressed',\n rar: 'application/x-rar-compressed',\n tar: 'application/x-tar',\n gz: 'application/gzip',\n dmg: 'application/x-apple-diskimage'\n};","\"use strict\";\n\nvar _nonSecure = require(\"nanoid/non-secure\");\n\nvar _loggers = require(\"./loggers.js\");\n\nvar _Restricter = require(\"./Restricter.js\");\n\nlet _Symbol$for, _Symbol$for2;\n\nfunction _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError(\"attempted to use private field on non-instance\"); } return receiver; }\n\nvar id = 0;\n\nfunction _classPrivateFieldLooseKey(name) { return \"__private_\" + id++ + \"_\" + name; }\n\n/* eslint-disable max-classes-per-file */\n\n/* global AggregateError */\nconst Translator = require(\"@uppy/utils/lib/Translator\");\n\nconst ee = require(\"namespace-emitter\");\n\nconst throttle = require(\"lodash.throttle\");\n\nconst DefaultStore = require(\"@uppy/store-default\");\n\nconst getFileType = require(\"@uppy/utils/lib/getFileType\");\n\nconst getFileNameAndExtension = require(\"@uppy/utils/lib/getFileNameAndExtension\");\n\nconst generateFileID = require(\"@uppy/utils/lib/generateFileID\");\n\nconst supportsUploadProgress = require(\"./supportsUploadProgress.js\");\n\nconst getFileName = require(\"./getFileName.js\");\n\nconst packageJson = {\n \"version\": \"2.3.4\"\n};\n\nconst locale = require(\"./locale.js\");\n/**\n * Uppy Core module.\n * Manages plugins, state updates, acts as an event bus,\n * adds/removes files and metadata.\n */\n\n\nvar _plugins = /*#__PURE__*/_classPrivateFieldLooseKey(\"plugins\");\n\nvar _restricter = /*#__PURE__*/_classPrivateFieldLooseKey(\"restricter\");\n\nvar _storeUnsubscribe = /*#__PURE__*/_classPrivateFieldLooseKey(\"storeUnsubscribe\");\n\nvar _emitter = /*#__PURE__*/_classPrivateFieldLooseKey(\"emitter\");\n\nvar _preProcessors = /*#__PURE__*/_classPrivateFieldLooseKey(\"preProcessors\");\n\nvar _uploaders = /*#__PURE__*/_classPrivateFieldLooseKey(\"uploaders\");\n\nvar _postProcessors = /*#__PURE__*/_classPrivateFieldLooseKey(\"postProcessors\");\n\nvar _informAndEmit = /*#__PURE__*/_classPrivateFieldLooseKey(\"informAndEmit\");\n\nvar _checkRequiredMetaFieldsOnFile = /*#__PURE__*/_classPrivateFieldLooseKey(\"checkRequiredMetaFieldsOnFile\");\n\nvar _checkRequiredMetaFields = /*#__PURE__*/_classPrivateFieldLooseKey(\"checkRequiredMetaFields\");\n\nvar _assertNewUploadAllowed = /*#__PURE__*/_classPrivateFieldLooseKey(\"assertNewUploadAllowed\");\n\nvar _checkAndCreateFileStateObject = /*#__PURE__*/_classPrivateFieldLooseKey(\"checkAndCreateFileStateObject\");\n\nvar _startIfAutoProceed = /*#__PURE__*/_classPrivateFieldLooseKey(\"startIfAutoProceed\");\n\nvar _addListeners = /*#__PURE__*/_classPrivateFieldLooseKey(\"addListeners\");\n\nvar _updateOnlineStatus = /*#__PURE__*/_classPrivateFieldLooseKey(\"updateOnlineStatus\");\n\nvar _createUpload = /*#__PURE__*/_classPrivateFieldLooseKey(\"createUpload\");\n\nvar _getUpload = /*#__PURE__*/_classPrivateFieldLooseKey(\"getUpload\");\n\nvar _removeUpload = /*#__PURE__*/_classPrivateFieldLooseKey(\"removeUpload\");\n\nvar _runUpload = /*#__PURE__*/_classPrivateFieldLooseKey(\"runUpload\");\n\n_Symbol$for = Symbol.for('uppy test: getPlugins');\n_Symbol$for2 = Symbol.for('uppy test: createUpload');\n\nclass Uppy {\n /** @type {Record<string, BasePlugin[]>} */\n\n /**\n * Instantiate Uppy\n *\n * @param {object} opts — Uppy options\n */\n constructor(_opts) {\n Object.defineProperty(this, _runUpload, {\n value: _runUpload2\n });\n Object.defineProperty(this, _removeUpload, {\n value: _removeUpload2\n });\n Object.defineProperty(this, _getUpload, {\n value: _getUpload2\n });\n Object.defineProperty(this, _createUpload, {\n value: _createUpload2\n });\n Object.defineProperty(this, _addListeners, {\n value: _addListeners2\n });\n Object.defineProperty(this, _startIfAutoProceed, {\n value: _startIfAutoProceed2\n });\n Object.defineProperty(this, _checkAndCreateFileStateObject, {\n value: _checkAndCreateFileStateObject2\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 Object.defineProperty(this, _informAndEmit, {\n value: _informAndEmit2\n });\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 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\n /**\n * @deprecated The method should not be used\n */\n allowMultipleUploads: true,\n allowMultipleUploadBatches: true,\n debug: false,\n restrictions: _Restricter.defaultOptions,\n meta: {},\n onBeforeFileAdded: currentFile => currentFile,\n onBeforeUpload: files => files,\n store: DefaultStore(),\n logger: _loggers.justErrorsLogger,\n infoTimeout: 5000\n }; // Merge default options with the ones set by user,\n // making sure to merge restrictions too\n\n