diff --git a/django_file_form/static/file_form/file_form.js b/django_file_form/static/file_form/file_form.js index 4d2d7dde5..8463dd5fd 100644 --- a/django_file_form/static/file_form/file_form.js +++ b/django_file_form/static/file_form/file_form.js @@ -20,35 +20,94 @@ forms.forEach(initUploadFields); }; - const formatBytes = (bytes, decimals) => { - if (bytes === 0) { - return "0 Bytes"; - } - const k = 1024; - const dm = decimals; - const sizes = ["Bytes", "KB", "MB", "GB"]; - const i = Math.floor(Math.log(bytes) / Math.log(k)); - const n = parseFloat((bytes / k ** i).toFixed(dm)); - const size = sizes[i]; - if (size == null) { - return ""; - } else { - return `${n.toString()} ${size}`; - } - }; - const getInputNameWithPrefix = (fieldName, prefix) => prefix ? `${prefix}-${fieldName}` : fieldName; - const getInputNameWithoutPrefix = (fieldName, prefix) => prefix ? fieldName.slice(prefix.length + 1) : fieldName; - const findInput = (form, fieldName, prefix) => { - const inputNameWithPrefix = getInputNameWithPrefix(fieldName, prefix); - const input = form.querySelector(`[name="${inputNameWithPrefix}"]`); - if (!input) { - return null; - } - return input; + const types = { "application/andrew-inset": ["ez"], "application/appinstaller": ["appinstaller"], "application/applixware": ["aw"], "application/appx": ["appx"], "application/appxbundle": ["appxbundle"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/automationml-aml+xml": ["aml"], "application/automationml-amlx+zip": ["amlx"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cpl+xml": ["cpl"], "application/cu-seeme": ["cu"], "application/cwl": ["cwl"], "application/dash+xml": ["mpd"], "application/dash-patch+xml": ["mpp"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdf": ["fdf"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["*js"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/media-policy-dataset+xml": ["mpf"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"], "application/msix": ["msix"], "application/msixbundle": ["msixbundle"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-keys": ["asc"], "application/pgp-signature": ["sig", "*asc"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/sql": ["sql"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/watcherinfo+xml": ["wif"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xfdf": ["xfdf"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/aac": ["adts", "aac"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avci": ["avci"], "image/avcs": ["avcs"], "image/avif": ["avif"], "image/bmp": ["bmp", "dib"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/dpx": ["dpx"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm", "jpgm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/jt": ["jt"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/prc": ["prc"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/u3d": ["u3d"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/javascript": ["js", "mjs"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["md", "markdown"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/wgsl": ["wgsl"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "*jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] }; + Object.freeze(types); + + var __classPrivateFieldGet = (window && window.__classPrivateFieldGet) || function (receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); }; - const getUploadsFieldName = (fieldName, prefix) => `${getInputNameWithoutPrefix(fieldName, prefix)}-uploads`; - const getInputValueForFormAndPrefix = (form, fieldName, prefix) => findInput(form, fieldName, prefix)?.value; - const getMetadataFieldName = (fieldName, prefix) => `${getInputNameWithoutPrefix(fieldName, prefix)}-metadata`; + var _Mime_extensionToType, _Mime_typeToExtension, _Mime_typeToExtensions; + class Mime { + constructor(...args) { + _Mime_extensionToType.set(this, new Map()); + _Mime_typeToExtension.set(this, new Map()); + _Mime_typeToExtensions.set(this, new Map()); + for (const arg of args) { + this.define(arg); + } + } + define(typeMap, force = false) { + for (let [type, extensions] of Object.entries(typeMap)) { + type = type.toLowerCase(); + extensions = extensions.map((ext) => ext.toLowerCase()); + if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, "f").has(type)) { + __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").set(type, new Set()); + } + const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type); + let first = true; + for (let extension of extensions) { + const starred = extension.startsWith('*'); + extension = starred ? extension.slice(1) : extension; + allExtensions?.add(extension); + if (first) { + __classPrivateFieldGet(this, _Mime_typeToExtension, "f").set(type, extension); + } + first = false; + if (starred) + continue; + const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(extension); + if (currentType && currentType != type && !force) { + throw new Error(`"${type} -> ${extension}" conflicts with "${currentType} -> ${extension}". Pass \`force=true\` to override this definition.`); + } + __classPrivateFieldGet(this, _Mime_extensionToType, "f").set(extension, type); + } + } + return this; + } + getType(path) { + if (typeof path !== 'string') + return null; + const last = path.replace(/^.*[/\\]/, '').toLowerCase(); + const ext = last.replace(/^.*\./, '').toLowerCase(); + const hasPath = last.length < path.length; + const hasDot = ext.length < last.length - 1; + if (!hasDot && hasPath) + return null; + return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null; + } + getExtension(type) { + if (typeof type !== 'string') + return null; + type = type?.split?.(';')[0]; + return ((type && __classPrivateFieldGet(this, _Mime_typeToExtension, "f").get(type.trim().toLowerCase())) ?? null); + } + getAllExtensions(type) { + if (typeof type !== 'string') + return null; + return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type.toLowerCase()) ?? null; + } + _freeze() { + this.define = () => { + throw new Error('define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances'); + }; + Object.freeze(this); + for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").values()) { + Object.freeze(extensions); + } + return this; + } + _getTestState() { + return { + types: __classPrivateFieldGet(this, _Mime_extensionToType, "f"), + extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, "f"), + }; + } + } + _Mime_extensionToType = new WeakMap(), _Mime_typeToExtension = new WeakMap(), _Mime_typeToExtensions = new WeakMap(); + + var mime = new Mime(types)._freeze(); var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; @@ -56,490 +115,111 @@ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } - /*! - * escape-html - * Copyright(c) 2012-2013 TJ Holowaychuk - * Copyright(c) 2015 Andreas Lubbe - * Copyright(c) 2015 Tiancheng "Timothy" Gu - * MIT Licensed - */ + var utils$3 = {}; + + const WIN_SLASH = '\\\\/'; + const WIN_NO_SLASH = `[^${WIN_SLASH}]`; /** - * Module variables. - * @private + * Posix glob regex */ - var matchHtmlRegExp = /["'&<>]/; + const DOT_LITERAL = '\\.'; + const PLUS_LITERAL = '\\+'; + const QMARK_LITERAL = '\\?'; + const SLASH_LITERAL = '\\/'; + const ONE_CHAR = '(?=.)'; + const QMARK = '[^/]'; + const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; + const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; + const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; + const NO_DOT = `(?!${DOT_LITERAL})`; + const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; + const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; + const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; + const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; + const STAR = `${QMARK}*?`; + const SEP = '/'; + + const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR, + SEP + }; /** - * Module exports. - * @public + * Windows glob regex */ - var escapeHtml_1 = escapeHtml; + const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)`, + SEP: '\\' + }; /** - * Escape special characters in the given string of html. - * - * @param {string} string The string to escape for inserting into HTML - * @return {string} - * @public + * POSIX Bracket Regex */ - function escapeHtml(string) { - var str = '' + string; - var match = matchHtmlRegExp.exec(str); + const POSIX_REGEX_SOURCE$1 = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' + }; - if (!match) { - return str; - } + var constants$2 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1, - var escape; - var html = ''; - var index = 0; - var lastIndex = 0; + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, - for (index = match.index; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: // " - escape = '"'; - break; - case 38: // & - escape = '&'; - break; - case 39: // ' - escape = '''; - break; - case 60: // < - escape = '<'; - break; - case 62: // > - escape = '>'; - break; - default: - continue; - } - - if (lastIndex !== index) { - html += str.substring(lastIndex, index); - } - - lastIndex = index + 1; - html += escape; - } - - return lastIndex !== index - ? html + str.substring(lastIndex, index) - : html; - } - - var escape = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1); - - class RenderUploadFile { - constructor(_ref) { - let { - parent, - input, - skipRequired, - translations - } = _ref; - this.container = this.createFilesContainer(parent); - this.errors = this.createErrorContainer(parent); - this.input = input; - this.translations = translations; - if (skipRequired) { - this.input.required = false; - } - } - addNewUpload(filename, uploadIndex) { - const div = this.addFile(filename, uploadIndex); - const progressSpan = document.createElement("span"); - progressSpan.className = "dff-progress"; - const innerSpan = document.createElement("span"); - innerSpan.className = "dff-progress-inner"; - progressSpan.appendChild(innerSpan); - div.appendChild(progressSpan); - const cancelLink = document.createElement("a"); - cancelLink.className = "dff-cancel"; - cancelLink.innerHTML = this.translations.Cancel ?? ""; - cancelLink.setAttribute("data-index", uploadIndex.toString()); - cancelLink.href = "#"; - div.appendChild(cancelLink); - return div; - } - addUploadedFile(filename, uploadIndex, filesize) { - const element = this.addFile(filename, uploadIndex); - this.setSuccess(uploadIndex, filesize); - return element; - } - clearInput() { - const { - input - } = this; - input.value = ""; - } - deleteFile(index) { - const div = this.findFileDiv(index); - if (div) { - div.remove(); - } - } - disableCancel(index) { - const cancelSpan = this.findCancelSpan(index); - if (cancelSpan) { - cancelSpan.classList.add("dff-disabled"); - } - } - disableDelete(index) { - const deleteLink = this.findDeleteLink(index); - if (deleteLink) { - deleteLink.classList.add("dff-disabled"); - } - } - findFileDiv(index) { - return this.container.querySelector(`.dff-file-id-${index.toString()}`); - } - removeDropHint() { - const dropHint = this.container.querySelector(".dff-drop-hint"); - if (dropHint) { - dropHint.remove(); - } - } - renderDropHint() { - if (this.container.querySelector(".dff-drop-hint")) { - return; - } - const dropHint = document.createElement("div"); - dropHint.className = "dff-drop-hint"; - dropHint.innerHTML = this.translations["Drop your files here"] ?? ""; - this.container.appendChild(dropHint); - } - setDeleteFailed(index) { - this.setErrorMessage(index, this.translations["Delete failed"] ?? ""); - this.enableDelete(index); - } - setError(index) { - this.setErrorMessage(index, this.translations["Upload failed"] ?? ""); - const el = this.findFileDiv(index); - if (el) { - el.classList.add("dff-upload-fail"); - } - this.removeProgress(index); - this.removeCancel(index); - } - setErrorInvalidFiles(files) { - const errorsMessages = document.createElement("ul"); - for (const file of files) { - const msg = document.createElement("li"); - const invalidFileTypeMessage = this.translations["Invalid file type"] ?? ""; - msg.innerText = `${file.name}: ${invalidFileTypeMessage}`; - msg.className = "dff-error"; - errorsMessages.appendChild(msg); - } - this.errors.replaceChildren(errorsMessages); - this.clearInput(); - } - setSuccess(index, size) { - const { - translations - } = this; - const el = this.findFileDiv(index); - if (el) { - el.classList.add("dff-upload-success"); - if (size != null) { - const fileSizeInfo = document.createElement("span"); - fileSizeInfo.innerHTML = formatBytes(size, 2); - fileSizeInfo.className = "dff-filesize"; - el.appendChild(fileSizeInfo); - } - const deleteLink = document.createElement("a"); - deleteLink.innerHTML = translations.Delete ?? ""; - deleteLink.className = "dff-delete"; - deleteLink.setAttribute("data-index", index.toString()); - deleteLink.href = "#"; - el.appendChild(deleteLink); - } - this.removeProgress(index); - this.removeCancel(index); - } - updateProgress(index, percentage) { - const el = this.container.querySelector(`.dff-file-id-${index.toString()}`); - if (el) { - const innerProgressSpan = el.querySelector(".dff-progress-inner"); - if (innerProgressSpan) { - innerProgressSpan.style.width = `${percentage}%`; - } - } - } - createErrorContainer = parent => { - const div = document.createElement("div"); - div.className = "dff-invalid-files"; - parent.appendChild(div); - return div; - }; - createFilesContainer = parent => { - const div = document.createElement("div"); - div.className = "dff-files"; - parent.appendChild(div); - return div; - }; - addFile(filename, uploadIndex) { - const div = document.createElement("div"); - div.className = `dff-file dff-file-id-${uploadIndex.toString()}`; - const nameSpan = document.createElement("span"); - nameSpan.innerHTML = escape(filename); - nameSpan.className = "dff-filename"; - nameSpan.setAttribute("data-index", uploadIndex.toString()); - div.appendChild(nameSpan); - this.container.appendChild(div); - this.input.required = false; - return div; - } - removeProgress(index) { - const el = this.findFileDiv(index); - if (el) { - const progressSpan = el.querySelector(".dff-progress"); - if (progressSpan) { - progressSpan.remove(); - } - } - } - removeCancel(index) { - const cancelSpan = this.findCancelSpan(index); - if (cancelSpan) { - cancelSpan.remove(); - } - } - findCancelSpan(index) { - const el = this.findFileDiv(index); - if (!el) { - return null; - } - return el.querySelector(".dff-cancel"); - } - enableDelete(index) { - const deleteLink = this.findDeleteLink(index); - if (deleteLink) { - deleteLink.classList.remove("dff-disabled"); - } - } - findDeleteLink(index) { - const div = this.findFileDiv(index); - if (!div) { - return div; - } - return div.querySelector(".dff-delete"); - } - setErrorMessage(index, message) { - const el = this.findFileDiv(index); - if (!el) { - return; - } - const originalMessageSpan = el.querySelector(".dff-error"); - if (originalMessageSpan) { - originalMessageSpan.remove(); - } - const span = document.createElement("span"); - span.classList.add("dff-error"); - span.innerHTML = message; - el.appendChild(span); - } - } - - const types = { "application/andrew-inset": ["ez"], "application/appinstaller": ["appinstaller"], "application/applixware": ["aw"], "application/appx": ["appx"], "application/appxbundle": ["appxbundle"], "application/atom+xml": ["atom"], "application/atomcat+xml": ["atomcat"], "application/atomdeleted+xml": ["atomdeleted"], "application/atomsvc+xml": ["atomsvc"], "application/atsc-dwd+xml": ["dwd"], "application/atsc-held+xml": ["held"], "application/atsc-rsat+xml": ["rsat"], "application/automationml-aml+xml": ["aml"], "application/automationml-amlx+zip": ["amlx"], "application/bdoc": ["bdoc"], "application/calendar+xml": ["xcs"], "application/ccxml+xml": ["ccxml"], "application/cdfx+xml": ["cdfx"], "application/cdmi-capability": ["cdmia"], "application/cdmi-container": ["cdmic"], "application/cdmi-domain": ["cdmid"], "application/cdmi-object": ["cdmio"], "application/cdmi-queue": ["cdmiq"], "application/cpl+xml": ["cpl"], "application/cu-seeme": ["cu"], "application/cwl": ["cwl"], "application/dash+xml": ["mpd"], "application/dash-patch+xml": ["mpp"], "application/davmount+xml": ["davmount"], "application/docbook+xml": ["dbk"], "application/dssc+der": ["dssc"], "application/dssc+xml": ["xdssc"], "application/ecmascript": ["ecma"], "application/emma+xml": ["emma"], "application/emotionml+xml": ["emotionml"], "application/epub+zip": ["epub"], "application/exi": ["exi"], "application/express": ["exp"], "application/fdf": ["fdf"], "application/fdt+xml": ["fdt"], "application/font-tdpfr": ["pfr"], "application/geo+json": ["geojson"], "application/gml+xml": ["gml"], "application/gpx+xml": ["gpx"], "application/gxf": ["gxf"], "application/gzip": ["gz"], "application/hjson": ["hjson"], "application/hyperstudio": ["stk"], "application/inkml+xml": ["ink", "inkml"], "application/ipfix": ["ipfix"], "application/its+xml": ["its"], "application/java-archive": ["jar", "war", "ear"], "application/java-serialized-object": ["ser"], "application/java-vm": ["class"], "application/javascript": ["*js"], "application/json": ["json", "map"], "application/json5": ["json5"], "application/jsonml+json": ["jsonml"], "application/ld+json": ["jsonld"], "application/lgr+xml": ["lgr"], "application/lost+xml": ["lostxml"], "application/mac-binhex40": ["hqx"], "application/mac-compactpro": ["cpt"], "application/mads+xml": ["mads"], "application/manifest+json": ["webmanifest"], "application/marc": ["mrc"], "application/marcxml+xml": ["mrcx"], "application/mathematica": ["ma", "nb", "mb"], "application/mathml+xml": ["mathml"], "application/mbox": ["mbox"], "application/media-policy-dataset+xml": ["mpf"], "application/mediaservercontrol+xml": ["mscml"], "application/metalink+xml": ["metalink"], "application/metalink4+xml": ["meta4"], "application/mets+xml": ["mets"], "application/mmt-aei+xml": ["maei"], "application/mmt-usd+xml": ["musd"], "application/mods+xml": ["mods"], "application/mp21": ["m21", "mp21"], "application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"], "application/msix": ["msix"], "application/msixbundle": ["msixbundle"], "application/msword": ["doc", "dot"], "application/mxf": ["mxf"], "application/n-quads": ["nq"], "application/n-triples": ["nt"], "application/node": ["cjs"], "application/octet-stream": ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"], "application/oda": ["oda"], "application/oebps-package+xml": ["opf"], "application/ogg": ["ogx"], "application/omdoc+xml": ["omdoc"], "application/onenote": ["onetoc", "onetoc2", "onetmp", "onepkg"], "application/oxps": ["oxps"], "application/p2p-overlay+xml": ["relo"], "application/patch-ops-error+xml": ["xer"], "application/pdf": ["pdf"], "application/pgp-encrypted": ["pgp"], "application/pgp-keys": ["asc"], "application/pgp-signature": ["sig", "*asc"], "application/pics-rules": ["prf"], "application/pkcs10": ["p10"], "application/pkcs7-mime": ["p7m", "p7c"], "application/pkcs7-signature": ["p7s"], "application/pkcs8": ["p8"], "application/pkix-attr-cert": ["ac"], "application/pkix-cert": ["cer"], "application/pkix-crl": ["crl"], "application/pkix-pkipath": ["pkipath"], "application/pkixcmp": ["pki"], "application/pls+xml": ["pls"], "application/postscript": ["ai", "eps", "ps"], "application/provenance+xml": ["provx"], "application/pskc+xml": ["pskcxml"], "application/raml+yaml": ["raml"], "application/rdf+xml": ["rdf", "owl"], "application/reginfo+xml": ["rif"], "application/relax-ng-compact-syntax": ["rnc"], "application/resource-lists+xml": ["rl"], "application/resource-lists-diff+xml": ["rld"], "application/rls-services+xml": ["rs"], "application/route-apd+xml": ["rapd"], "application/route-s-tsid+xml": ["sls"], "application/route-usd+xml": ["rusd"], "application/rpki-ghostbusters": ["gbr"], "application/rpki-manifest": ["mft"], "application/rpki-roa": ["roa"], "application/rsd+xml": ["rsd"], "application/rss+xml": ["rss"], "application/rtf": ["rtf"], "application/sbml+xml": ["sbml"], "application/scvp-cv-request": ["scq"], "application/scvp-cv-response": ["scs"], "application/scvp-vp-request": ["spq"], "application/scvp-vp-response": ["spp"], "application/sdp": ["sdp"], "application/senml+xml": ["senmlx"], "application/sensml+xml": ["sensmlx"], "application/set-payment-initiation": ["setpay"], "application/set-registration-initiation": ["setreg"], "application/shf+xml": ["shf"], "application/sieve": ["siv", "sieve"], "application/smil+xml": ["smi", "smil"], "application/sparql-query": ["rq"], "application/sparql-results+xml": ["srx"], "application/sql": ["sql"], "application/srgs": ["gram"], "application/srgs+xml": ["grxml"], "application/sru+xml": ["sru"], "application/ssdl+xml": ["ssdl"], "application/ssml+xml": ["ssml"], "application/swid+xml": ["swidtag"], "application/tei+xml": ["tei", "teicorpus"], "application/thraud+xml": ["tfi"], "application/timestamped-data": ["tsd"], "application/toml": ["toml"], "application/trig": ["trig"], "application/ttml+xml": ["ttml"], "application/ubjson": ["ubj"], "application/urc-ressheet+xml": ["rsheet"], "application/urc-targetdesc+xml": ["td"], "application/voicexml+xml": ["vxml"], "application/wasm": ["wasm"], "application/watcherinfo+xml": ["wif"], "application/widget": ["wgt"], "application/winhlp": ["hlp"], "application/wsdl+xml": ["wsdl"], "application/wspolicy+xml": ["wspolicy"], "application/xaml+xml": ["xaml"], "application/xcap-att+xml": ["xav"], "application/xcap-caps+xml": ["xca"], "application/xcap-diff+xml": ["xdf"], "application/xcap-el+xml": ["xel"], "application/xcap-ns+xml": ["xns"], "application/xenc+xml": ["xenc"], "application/xfdf": ["xfdf"], "application/xhtml+xml": ["xhtml", "xht"], "application/xliff+xml": ["xlf"], "application/xml": ["xml", "xsl", "xsd", "rng"], "application/xml-dtd": ["dtd"], "application/xop+xml": ["xop"], "application/xproc+xml": ["xpl"], "application/xslt+xml": ["*xsl", "xslt"], "application/xspf+xml": ["xspf"], "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"], "application/yang": ["yang"], "application/yin+xml": ["yin"], "application/zip": ["zip"], "audio/3gpp": ["*3gpp"], "audio/aac": ["adts", "aac"], "audio/adpcm": ["adp"], "audio/amr": ["amr"], "audio/basic": ["au", "snd"], "audio/midi": ["mid", "midi", "kar", "rmi"], "audio/mobile-xmf": ["mxmf"], "audio/mp3": ["*mp3"], "audio/mp4": ["m4a", "mp4a"], "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"], "audio/ogg": ["oga", "ogg", "spx", "opus"], "audio/s3m": ["s3m"], "audio/silk": ["sil"], "audio/wav": ["wav"], "audio/wave": ["*wav"], "audio/webm": ["weba"], "audio/xm": ["xm"], "font/collection": ["ttc"], "font/otf": ["otf"], "font/ttf": ["ttf"], "font/woff": ["woff"], "font/woff2": ["woff2"], "image/aces": ["exr"], "image/apng": ["apng"], "image/avci": ["avci"], "image/avcs": ["avcs"], "image/avif": ["avif"], "image/bmp": ["bmp", "dib"], "image/cgm": ["cgm"], "image/dicom-rle": ["drle"], "image/dpx": ["dpx"], "image/emf": ["emf"], "image/fits": ["fits"], "image/g3fax": ["g3"], "image/gif": ["gif"], "image/heic": ["heic"], "image/heic-sequence": ["heics"], "image/heif": ["heif"], "image/heif-sequence": ["heifs"], "image/hej2k": ["hej2"], "image/hsj2": ["hsj2"], "image/ief": ["ief"], "image/jls": ["jls"], "image/jp2": ["jp2", "jpg2"], "image/jpeg": ["jpeg", "jpg", "jpe"], "image/jph": ["jph"], "image/jphc": ["jhc"], "image/jpm": ["jpm", "jpgm"], "image/jpx": ["jpx", "jpf"], "image/jxr": ["jxr"], "image/jxra": ["jxra"], "image/jxrs": ["jxrs"], "image/jxs": ["jxs"], "image/jxsc": ["jxsc"], "image/jxsi": ["jxsi"], "image/jxss": ["jxss"], "image/ktx": ["ktx"], "image/ktx2": ["ktx2"], "image/png": ["png"], "image/sgi": ["sgi"], "image/svg+xml": ["svg", "svgz"], "image/t38": ["t38"], "image/tiff": ["tif", "tiff"], "image/tiff-fx": ["tfx"], "image/webp": ["webp"], "image/wmf": ["wmf"], "message/disposition-notification": ["disposition-notification"], "message/global": ["u8msg"], "message/global-delivery-status": ["u8dsn"], "message/global-disposition-notification": ["u8mdn"], "message/global-headers": ["u8hdr"], "message/rfc822": ["eml", "mime"], "model/3mf": ["3mf"], "model/gltf+json": ["gltf"], "model/gltf-binary": ["glb"], "model/iges": ["igs", "iges"], "model/jt": ["jt"], "model/mesh": ["msh", "mesh", "silo"], "model/mtl": ["mtl"], "model/obj": ["obj"], "model/prc": ["prc"], "model/step+xml": ["stpx"], "model/step+zip": ["stpz"], "model/step-xml+zip": ["stpxz"], "model/stl": ["stl"], "model/u3d": ["u3d"], "model/vrml": ["wrl", "vrml"], "model/x3d+binary": ["*x3db", "x3dbz"], "model/x3d+fastinfoset": ["x3db"], "model/x3d+vrml": ["*x3dv", "x3dvz"], "model/x3d+xml": ["x3d", "x3dz"], "model/x3d-vrml": ["x3dv"], "text/cache-manifest": ["appcache", "manifest"], "text/calendar": ["ics", "ifb"], "text/coffeescript": ["coffee", "litcoffee"], "text/css": ["css"], "text/csv": ["csv"], "text/html": ["html", "htm", "shtml"], "text/jade": ["jade"], "text/javascript": ["js", "mjs"], "text/jsx": ["jsx"], "text/less": ["less"], "text/markdown": ["md", "markdown"], "text/mathml": ["mml"], "text/mdx": ["mdx"], "text/n3": ["n3"], "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"], "text/richtext": ["rtx"], "text/rtf": ["*rtf"], "text/sgml": ["sgml", "sgm"], "text/shex": ["shex"], "text/slim": ["slim", "slm"], "text/spdx": ["spdx"], "text/stylus": ["stylus", "styl"], "text/tab-separated-values": ["tsv"], "text/troff": ["t", "tr", "roff", "man", "me", "ms"], "text/turtle": ["ttl"], "text/uri-list": ["uri", "uris", "urls"], "text/vcard": ["vcard"], "text/vtt": ["vtt"], "text/wgsl": ["wgsl"], "text/xml": ["*xml"], "text/yaml": ["yaml", "yml"], "video/3gpp": ["3gp", "3gpp"], "video/3gpp2": ["3g2"], "video/h261": ["h261"], "video/h263": ["h263"], "video/h264": ["h264"], "video/iso.segment": ["m4s"], "video/jpeg": ["jpgv"], "video/jpm": ["*jpm", "*jpgm"], "video/mj2": ["mj2", "mjp2"], "video/mp2t": ["ts"], "video/mp4": ["mp4", "mp4v", "mpg4"], "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"], "video/ogg": ["ogv"], "video/quicktime": ["qt", "mov"], "video/webm": ["webm"] }; - Object.freeze(types); - - var __classPrivateFieldGet = (window && window.__classPrivateFieldGet) || function (receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - var _Mime_extensionToType, _Mime_typeToExtension, _Mime_typeToExtensions; - class Mime { - constructor(...args) { - _Mime_extensionToType.set(this, new Map()); - _Mime_typeToExtension.set(this, new Map()); - _Mime_typeToExtensions.set(this, new Map()); - for (const arg of args) { - this.define(arg); - } - } - define(typeMap, force = false) { - for (let [type, extensions] of Object.entries(typeMap)) { - type = type.toLowerCase(); - extensions = extensions.map((ext) => ext.toLowerCase()); - if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, "f").has(type)) { - __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").set(type, new Set()); - } - const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type); - let first = true; - for (let extension of extensions) { - const starred = extension.startsWith('*'); - extension = starred ? extension.slice(1) : extension; - allExtensions?.add(extension); - if (first) { - __classPrivateFieldGet(this, _Mime_typeToExtension, "f").set(type, extension); - } - first = false; - if (starred) - continue; - const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(extension); - if (currentType && currentType != type && !force) { - throw new Error(`"${type} -> ${extension}" conflicts with "${currentType} -> ${extension}". Pass \`force=true\` to override this definition.`); - } - __classPrivateFieldGet(this, _Mime_extensionToType, "f").set(extension, type); - } - } - return this; - } - getType(path) { - if (typeof path !== 'string') - return null; - const last = path.replace(/^.*[/\\]/, '').toLowerCase(); - const ext = last.replace(/^.*\./, '').toLowerCase(); - const hasPath = last.length < path.length; - const hasDot = ext.length < last.length - 1; - if (!hasDot && hasPath) - return null; - return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null; - } - getExtension(type) { - if (typeof type !== 'string') - return null; - type = type?.split?.(';')[0]; - return ((type && __classPrivateFieldGet(this, _Mime_typeToExtension, "f").get(type.trim().toLowerCase())) ?? null); - } - getAllExtensions(type) { - if (typeof type !== 'string') - return null; - return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type.toLowerCase()) ?? null; - } - _freeze() { - this.define = () => { - throw new Error('define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances'); - }; - Object.freeze(this); - for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").values()) { - Object.freeze(extensions); - } - return this; - } - _getTestState() { - return { - types: __classPrivateFieldGet(this, _Mime_extensionToType, "f"), - extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, "f"), - }; - } - } - _Mime_extensionToType = new WeakMap(), _Mime_typeToExtension = new WeakMap(), _Mime_typeToExtensions = new WeakMap(); - - var mime = new Mime(types)._freeze(); - - var utils$3 = {}; - - const WIN_SLASH = '\\\\/'; - const WIN_NO_SLASH = `[^${WIN_SLASH}]`; - - /** - * Posix glob regex - */ - - const DOT_LITERAL = '\\.'; - const PLUS_LITERAL = '\\+'; - const QMARK_LITERAL = '\\?'; - const SLASH_LITERAL = '\\/'; - const ONE_CHAR = '(?=.)'; - const QMARK = '[^/]'; - const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; - const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; - const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; - const NO_DOT = `(?!${DOT_LITERAL})`; - const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; - const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; - const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; - const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; - const STAR = `${QMARK}*?`; - const SEP = '/'; - - const POSIX_CHARS = { - DOT_LITERAL, - PLUS_LITERAL, - QMARK_LITERAL, - SLASH_LITERAL, - ONE_CHAR, - QMARK, - END_ANCHOR, - DOTS_SLASH, - NO_DOT, - NO_DOTS, - NO_DOT_SLASH, - NO_DOTS_SLASH, - QMARK_NO_DOT, - STAR, - START_ANCHOR, - SEP - }; - - /** - * Windows glob regex - */ - - const WINDOWS_CHARS = { - ...POSIX_CHARS, - - SLASH_LITERAL: `[${WIN_SLASH}]`, - QMARK: WIN_NO_SLASH, - STAR: `${WIN_NO_SLASH}*?`, - DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, - NO_DOT: `(?!${DOT_LITERAL})`, - NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, - NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, - QMARK_NO_DOT: `[^.${WIN_SLASH}]`, - START_ANCHOR: `(?:^|[${WIN_SLASH}])`, - END_ANCHOR: `(?:[${WIN_SLASH}]|$)`, - SEP: '\\' - }; - - /** - * POSIX Bracket Regex - */ - - const POSIX_REGEX_SOURCE$1 = { - alnum: 'a-zA-Z0-9', - alpha: 'a-zA-Z', - ascii: '\\x00-\\x7F', - blank: ' \\t', - cntrl: '\\x00-\\x1F\\x7F', - digit: '0-9', - graph: '\\x21-\\x7E', - lower: 'a-z', - print: '\\x20-\\x7E ', - punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', - space: ' \\t\\r\\n\\v\\f', - upper: 'A-Z', - word: 'A-Za-z0-9_', - xdigit: 'A-Fa-f0-9' - }; - - var constants$2 = { - MAX_LENGTH: 1024 * 64, - POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1, - - // regular expressions - REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, - REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, - REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, - REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, - REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, - REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, - - // Replace globs with equivalent patterns to reduce parsing time. - REPLACEMENTS: { - '***': '*', - '**/**': '**', - '**/**/**': '**' - }, + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, // Digits CHAR_0: 48, /* 0 */ @@ -2419,215 +2099,552 @@ source = `^(?!${source}).*$`; } - const regex = picomatch$1.toRegex(source, options); - if (returnState === true) { - regex.state = state; - } + const regex = picomatch$1.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; + }; + + /** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + + picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch$1.compileRe(parsed, options, returnOutput, returnState); + }; + + /** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + + picomatch$1.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } + }; + + /** + * Picomatch constants. + * @return {Object} + */ + + picomatch$1.constants = constants; + + /** + * Expose "picomatch" + */ + + var picomatch_1 = picomatch$1; + + var posix = picomatch_1; + + var picomatch = /*@__PURE__*/getDefaultExportFromCjs(posix); + + const parseInputAccept = inputAccept => { + const extensions = []; + const mimeTypes = []; + inputAccept.split(",").map(mimeType => mimeType.trim()).filter(Boolean).forEach(fileType => { + if (fileType.startsWith(".")) { + extensions.push(`*${fileType}`); + } else { + mimeTypes.push(fileType); + } + }); + return [extensions, mimeTypes]; + }; + class AcceptedFileTypes { + constructor(inputAccept) { + const [extensions, mimeTypes] = parseInputAccept(inputAccept); + this.extensions = extensions; + this.mimeTypes = mimeTypes; + } + isExtensionAccepted(fileName) { + if (this.extensions.length === 0) { + return false; + } + return picomatch.isMatch(fileName, this.extensions); + } + isMimeTypeAccepted(mimeType) { + if (!mimeType || this.mimeTypes.length === 0) { + return false; + } + return picomatch.isMatch(mimeType, this.mimeTypes); + } + isAccepted(fileName) { + if (this.extensions.length === 0 && this.mimeTypes.length === 0) { + return true; + } + return this.isMimeTypeAccepted(mime.getType(fileName)) || this.isExtensionAccepted(fileName); + } + } + + const getEntriesFromDirectory = async directoryEntry => new Promise((resolve, reject) => { + directoryEntry.createReader().readEntries(resolve, reject); + }); + const getFileFromFileSystemFileEntry = async fileEntry => new Promise((resolve, reject) => { + fileEntry.file(resolve, reject); + }); + const getFilesFromFileSystemEntries = async entries => { + const result = []; + for (const entry of entries) { + const filesFromEntry = await getFilesFromFileSystemEntry(entry); + filesFromEntry.forEach(file => result.push(file)); + } + return result; + }; + const getFilesFromFileSystemEntry = async entry => { + const result = []; + if (entry.isFile) { + const file = await getFileFromFileSystemFileEntry(entry); + result.push(file); + } else if (entry.isDirectory) { + const entriesFromDirectory = await getEntriesFromDirectory(entry); + const files = await getFilesFromFileSystemEntries(entriesFromDirectory); + files.forEach(file => result.push(file)); + } + return result; + }; + const getFilesFromDataTransfer = async dataTransfer => { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (dataTransfer.items) { + const files = []; + for (const item of dataTransfer.items) { + const fileSystemEntry = item.webkitGetAsEntry(); + if (fileSystemEntry) { + const filesFromEntry = await getFilesFromFileSystemEntry(fileSystemEntry); + filesFromEntry.forEach(file => files.push(file)); + } else { + const file = item.getAsFile(); + if (file) { + files.push(file); + } + } + } + return files; + } else { + // backwards compatibility + return [...dataTransfer.files]; + } + }; + class DropArea { + onDrop = e => { + const dragEvent = e; + this.container.classList.remove("dff-dropping"); + dragEvent.preventDefault(); + dragEvent.stopPropagation(); + const uploadFiles = async () => { + try { + if (dragEvent.dataTransfer) { + const files = await getFilesFromDataTransfer(dragEvent.dataTransfer); + const acceptedFiles = []; + const invalidFiles = []; + for (const file of files) { + if (this.acceptedFileTypes.isAccepted(file.name)) { + acceptedFiles.push(file); + } else { + invalidFiles.push(file); + } + } + this.renderer.setErrorInvalidFiles(invalidFiles); + void this.onUploadFiles(acceptedFiles); + } + } catch (error) { + console.error(error); + } + }; + void uploadFiles(); + }; + constructor(_ref) { + let { + container, + inputAccept, + onUploadFiles, + renderer + } = _ref; + this.container = container; + this.onUploadFiles = onUploadFiles; + this.acceptedFileTypes = new AcceptedFileTypes(inputAccept); + this.renderer = renderer; + container.addEventListener("dragenter", () => { + container.classList.add("dff-dropping"); + }); + container.addEventListener("dragleave", () => { + container.classList.remove("dff-dropping"); + }); + container.addEventListener("dragover", e => { + container.classList.add("dff-dropping"); + e.preventDefault(); + }); + container.addEventListener("drop", this.onDrop); + } + } + + /*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */ + + /** + * Module variables. + * @private + */ + + var matchHtmlRegExp = /["'&<>]/; + + /** + * Module exports. + * @public + */ - return regex; - }; + var escapeHtml_1 = escapeHtml; /** - * Create a regular expression from a parsed glob pattern. - * - * ```js - * const picomatch = require('picomatch'); - * const state = picomatch.parse('*.js'); - * // picomatch.compileRe(state[, options]); + * Escape special characters in the given string of html. * - * console.log(picomatch.compileRe(state)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `state` The object returned from the `.parse` method. - * @param {Object} `options` - * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. - * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. - * @return {RegExp} Returns a regex created from the given pattern. - * @api public + * @param {string} string The string to escape for inserting into HTML + * @return {string} + * @public */ - picomatch$1.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { - if (!input || typeof input !== 'string') { - throw new TypeError('Expected a non-empty string'); + function escapeHtml(string) { + var str = '' + string; + var match = matchHtmlRegExp.exec(str); + + if (!match) { + return str; } - let parsed = { negated: false, fastpaths: true }; + var escape; + var html = ''; + var index = 0; + var lastIndex = 0; - if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { - parsed.output = parse.fastpaths(input, options); - } + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: // " + escape = '"'; + break; + case 38: // & + escape = '&'; + break; + case 39: // ' + escape = '''; + break; + case 60: // < + escape = '<'; + break; + case 62: // > + escape = '>'; + break; + default: + continue; + } - if (!parsed.output) { - parsed = parse(input, options); + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + + lastIndex = index + 1; + html += escape; } - return picomatch$1.compileRe(parsed, options, returnOutput, returnState); - }; + return lastIndex !== index + ? html + str.substring(lastIndex, index) + : html; + } - /** - * Create a regular expression from the given regex source string. - * - * ```js - * const picomatch = require('picomatch'); - * // picomatch.toRegex(source[, options]); - * - * const { output } = picomatch.parse('*.js'); - * console.log(picomatch.toRegex(output)); - * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ - * ``` - * @param {String} `source` Regular expression source string. - * @param {Object} `options` - * @return {RegExp} - * @api public - */ + var escape = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1); - picomatch$1.toRegex = (source, options) => { - try { - const opts = options || {}; - return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); - } catch (err) { - if (options && options.debug === true) throw err; - return /$^/; + const formatBytes = (bytes, decimals) => { + if (bytes === 0) { + return "0 Bytes"; + } + const k = 1024; + const dm = decimals; + const sizes = ["Bytes", "KB", "MB", "GB"]; + const i = Math.floor(Math.log(bytes) / Math.log(k)); + const n = parseFloat((bytes / k ** i).toFixed(dm)); + const size = sizes[i]; + if (size == null) { + return ""; + } else { + return `${n.toString()} ${size}`; + } + }; + const getInputNameWithPrefix = (fieldName, prefix) => prefix ? `${prefix}-${fieldName}` : fieldName; + const getInputNameWithoutPrefix = (fieldName, prefix) => prefix ? fieldName.slice(prefix.length + 1) : fieldName; + const findInput = (form, fieldName, prefix) => { + const inputNameWithPrefix = getInputNameWithPrefix(fieldName, prefix); + const input = form.querySelector(`[name="${inputNameWithPrefix}"]`); + if (!input) { + return null; + } + return input; + }; + const getUploadsFieldName = (fieldName, prefix) => `${getInputNameWithoutPrefix(fieldName, prefix)}-uploads`; + const getInputValueForFormAndPrefix = (form, fieldName, prefix) => findInput(form, fieldName, prefix)?.value; + const getMetadataFieldName = (fieldName, prefix) => `${getInputNameWithoutPrefix(fieldName, prefix)}-metadata`; + + class RenderUploadFile { + createErrorContainer = parent => { + const div = document.createElement("div"); + div.className = "dff-invalid-files"; + parent.appendChild(div); + return div; + }; + createFilesContainer = parent => { + const div = document.createElement("div"); + div.className = "dff-files"; + parent.appendChild(div); + return div; + }; + constructor(_ref) { + let { + input, + parent, + skipRequired, + translations + } = _ref; + this.container = this.createFilesContainer(parent); + this.errors = this.createErrorContainer(parent); + this.input = input; + this.translations = translations; + if (skipRequired) { + this.input.required = false; + } + } + addFile(filename, uploadIndex) { + const div = document.createElement("div"); + div.className = `dff-file dff-file-id-${uploadIndex.toString()}`; + const nameSpan = document.createElement("span"); + nameSpan.innerHTML = escape(filename); + nameSpan.className = "dff-filename"; + nameSpan.setAttribute("data-index", uploadIndex.toString()); + div.appendChild(nameSpan); + this.container.appendChild(div); + this.input.required = false; + return div; + } + enableDelete(index) { + const deleteLink = this.findDeleteLink(index); + if (deleteLink) { + deleteLink.classList.remove("dff-disabled"); + } + } + findCancelSpan(index) { + const el = this.findFileDiv(index); + if (!el) { + return null; + } + return el.querySelector(".dff-cancel"); + } + findDeleteLink(index) { + const div = this.findFileDiv(index); + if (!div) { + return div; + } + return div.querySelector(".dff-delete"); + } + removeCancel(index) { + const cancelSpan = this.findCancelSpan(index); + if (cancelSpan) { + cancelSpan.remove(); + } + } + removeProgress(index) { + const el = this.findFileDiv(index); + if (el) { + const progressSpan = el.querySelector(".dff-progress"); + if (progressSpan) { + progressSpan.remove(); + } + } + } + setErrorMessage(index, message) { + const el = this.findFileDiv(index); + if (!el) { + return; + } + const originalMessageSpan = el.querySelector(".dff-error"); + if (originalMessageSpan) { + originalMessageSpan.remove(); + } + const span = document.createElement("span"); + span.classList.add("dff-error"); + span.innerHTML = message; + el.appendChild(span); + } + addNewUpload(filename, uploadIndex) { + const div = this.addFile(filename, uploadIndex); + const progressSpan = document.createElement("span"); + progressSpan.className = "dff-progress"; + const innerSpan = document.createElement("span"); + innerSpan.className = "dff-progress-inner"; + progressSpan.appendChild(innerSpan); + div.appendChild(progressSpan); + const cancelLink = document.createElement("a"); + cancelLink.className = "dff-cancel"; + cancelLink.innerHTML = this.translations.Cancel ?? ""; + cancelLink.setAttribute("data-index", uploadIndex.toString()); + cancelLink.href = "#"; + div.appendChild(cancelLink); + return div; + } + addUploadedFile(filename, uploadIndex, filesize) { + const element = this.addFile(filename, uploadIndex); + this.setSuccess(uploadIndex, filesize); + return element; + } + clearInput() { + const { + input + } = this; + input.value = ""; + } + deleteFile(index) { + const div = this.findFileDiv(index); + if (div) { + div.remove(); + } } - }; - - /** - * Picomatch constants. - * @return {Object} - */ - - picomatch$1.constants = constants; - - /** - * Expose "picomatch" - */ - - var picomatch_1 = picomatch$1; - - var posix = picomatch_1; - - var picomatch = /*@__PURE__*/getDefaultExportFromCjs(posix); - - const parseInputAccept = inputAccept => { - const extensions = []; - const mimeTypes = []; - inputAccept.split(",").map(mimeType => mimeType.trim()).filter(Boolean).forEach(fileType => { - if (fileType.startsWith(".")) { - extensions.push(`*${fileType}`); - } else { - mimeTypes.push(fileType); + disableCancel(index) { + const cancelSpan = this.findCancelSpan(index); + if (cancelSpan) { + cancelSpan.classList.add("dff-disabled"); } - }); - return [extensions, mimeTypes]; - }; - class AcceptedFileTypes { - constructor(inputAccept) { - const [extensions, mimeTypes] = parseInputAccept(inputAccept); - this.extensions = extensions; - this.mimeTypes = mimeTypes; } - isAccepted(fileName) { - if (this.extensions.length === 0 && this.mimeTypes.length === 0) { - return true; + disableDelete(index) { + const deleteLink = this.findDeleteLink(index); + if (deleteLink) { + deleteLink.classList.add("dff-disabled"); } - return this.isMimeTypeAccepted(mime.getType(fileName)) || this.isExtensionAccepted(fileName); } - isMimeTypeAccepted(mimeType) { - if (!mimeType || this.mimeTypes.length === 0) { - return false; + findFileDiv(index) { + return this.container.querySelector(`.dff-file-id-${index.toString()}`); + } + removeDropHint() { + const dropHint = this.container.querySelector(".dff-drop-hint"); + if (dropHint) { + dropHint.remove(); } - return picomatch.isMatch(mimeType, this.mimeTypes); } - isExtensionAccepted(fileName) { - if (this.extensions.length === 0) { - return false; + renderDropHint() { + if (this.container.querySelector(".dff-drop-hint")) { + return; } - return picomatch.isMatch(fileName, this.extensions); + const dropHint = document.createElement("div"); + dropHint.className = "dff-drop-hint"; + dropHint.innerHTML = this.translations["Drop your files here"] ?? ""; + this.container.appendChild(dropHint); } - } - - const getEntriesFromDirectory = async directoryEntry => new Promise((resolve, reject) => { - directoryEntry.createReader().readEntries(resolve, reject); - }); - const getFileFromFileEntry = async fileEntry => new Promise((resolve, reject) => { - fileEntry.file(resolve, reject); - }); - const getFilesFromFileSystemEntries = async entries => { - const result = []; - for (const entry of entries) { - if (entry.isFile) { - const file = await getFileFromFileEntry(entry); - result.push(file); - } else if (entry.isDirectory) { - const entriesFromDirectory = await getEntriesFromDirectory(entry); - const files = await getFilesFromFileSystemEntries(entriesFromDirectory); - files.forEach(file => result.push(file)); + setDeleteFailed(index) { + this.setErrorMessage(index, this.translations["Delete failed"] ?? ""); + this.enableDelete(index); + } + setError(index) { + this.setErrorMessage(index, this.translations["Upload failed"] ?? ""); + const el = this.findFileDiv(index); + if (el) { + el.classList.add("dff-upload-fail"); } + this.removeProgress(index); + this.removeCancel(index); } - return result; - }; - const getFilesFromDataTransfer = async dataTransfer => { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (dataTransfer.items) { - const entries = [...dataTransfer.items].map(item => item.webkitGetAsEntry()).filter(entry => entry != null); - const files = await getFilesFromFileSystemEntries(entries); - return files; - } else { - // backwards compatibility - return [...dataTransfer.files]; + setErrorInvalidFiles(files) { + const errorsMessages = document.createElement("ul"); + for (const file of files) { + const msg = document.createElement("li"); + const invalidFileTypeMessage = this.translations["Invalid file type"] ?? ""; + msg.innerText = `${file.name}: ${invalidFileTypeMessage}`; + msg.className = "dff-error"; + errorsMessages.appendChild(msg); + } + this.errors.replaceChildren(errorsMessages); + this.clearInput(); } - }; - class DropArea { - constructor(_ref) { - let { - container, - inputAccept, - onUploadFiles, - renderer - } = _ref; - this.container = container; - this.onUploadFiles = onUploadFiles; - this.acceptedFileTypes = new AcceptedFileTypes(inputAccept); - this.renderer = renderer; - container.addEventListener("dragenter", () => { - container.classList.add("dff-dropping"); - }); - container.addEventListener("dragleave", () => { - container.classList.remove("dff-dropping"); - }); - container.addEventListener("dragover", e => { - container.classList.add("dff-dropping"); - e.preventDefault(); - }); - container.addEventListener("drop", this.onDrop); + setSuccess(index, size) { + const { + translations + } = this; + const el = this.findFileDiv(index); + if (el) { + el.classList.add("dff-upload-success"); + if (size != null) { + const fileSizeInfo = document.createElement("span"); + fileSizeInfo.innerHTML = formatBytes(size, 2); + fileSizeInfo.className = "dff-filesize"; + el.appendChild(fileSizeInfo); + } + const deleteLink = document.createElement("a"); + deleteLink.innerHTML = translations.Delete ?? ""; + deleteLink.className = "dff-delete"; + deleteLink.setAttribute("data-index", index.toString()); + deleteLink.href = "#"; + el.appendChild(deleteLink); + } + this.removeProgress(index); + this.removeCancel(index); } - onDrop = e => { - const dragEvent = e; - this.container.classList.remove("dff-dropping"); - dragEvent.preventDefault(); - dragEvent.stopPropagation(); - const uploadFiles = async () => { - try { - if (dragEvent.dataTransfer) { - const files = await getFilesFromDataTransfer(dragEvent.dataTransfer); - const acceptedFiles = []; - const invalidFiles = []; - for (const file of files) { - if (this.acceptedFileTypes.isAccepted(file.name)) { - acceptedFiles.push(file); - } else { - invalidFiles.push(file); - } - } - this.renderer.setErrorInvalidFiles(invalidFiles); - void this.onUploadFiles(acceptedFiles); - } - } catch (error) { - console.error(error); + updateProgress(index, percentage) { + const el = this.container.querySelector(`.dff-file-id-${index.toString()}`); + if (el) { + const innerProgressSpan = el.querySelector(".dff-progress-inner"); + if (innerProgressSpan) { + innerProgressSpan.style.width = `${percentage}%`; } - }; - void uploadFiles(); - }; + } + } } let BaseUpload$1 = class BaseUpload { @@ -2726,9 +2743,9 @@ const abortMultipartUpload = _ref => { let { csrfToken, + endpoint, key, - uploadId, - endpoint + uploadId } = _ref; const filename = encodeURIComponent(key); const uploadIdEnc = encodeURIComponent(uploadId); @@ -2737,8 +2754,8 @@ }); const url = urlJoin(endpoint, uploadIdEnc, `?key=${filename}`); return fetch(url, { - method: "delete", - headers: headers + headers: headers, + method: "delete" }).then(response => { return response.json(); }); @@ -2746,10 +2763,10 @@ const completeMultipartUpload = _ref2 => { let { csrfToken, + endpoint, key, - uploadId, parts, - endpoint + uploadId } = _ref2; const filename = encodeURIComponent(key); const uploadIdEnc = encodeURIComponent(uploadId); @@ -2758,11 +2775,11 @@ }); const url = urlJoin(endpoint, uploadIdEnc, "complete", `?key=${filename}`); return fetch(url, { - method: "post", - headers: headers, body: JSON.stringify({ parts: parts - }) + }), + headers: headers, + method: "post" }).then(response => { return response.json(); }).then(data => { @@ -2782,13 +2799,13 @@ "X-CSRFToken": csrfToken }); return fetch(endpoint, { - method: "post", - headers: headers, body: JSON.stringify({ - filename: file.name, contentType: file.type, + filename: file.name, s3UploadDir: s3UploadDir - }) + }), + headers: headers, + method: "post" }).then(response => { return response.json(); }).then(data => { @@ -2810,8 +2827,8 @@ }); const url = urlJoin(endpoint, uploadId, number.toString(), `?key=${filename}`); return fetch(url, { - method: "get", - headers: headers + headers: headers, + method: "get" }).then(response => { return response.json(); }).then(data => { @@ -2860,66 +2877,33 @@ // aborting it immediately after it finishes. this.createdPromise = Promise.reject(new Error()); this.chunks = []; - this.chunkState = []; - this.uploading = []; - this.onError = undefined; - this.onProgress = undefined; - this.onSuccess = undefined; - this.initChunks(); - this.createdPromise.catch(() => ({})); // silence uncaught rejection warning - } - async abort() { - this.uploading.slice().forEach(xhr => { - xhr.abort(); - }); - this.uploading = []; - await this.createdPromise; - if (this.key && this.uploadId) { - await abortMultipartUpload({ - csrfToken: this.csrfToken, - endpoint: this.endpoint, - key: this.key, - uploadId: this.uploadId - }); - } - } - async delete() { - return Promise.resolve(); - } - getId() { - return this.uploadId ?? undefined; - } - getInitialFile() { - return { - id: this.uploadId ?? "", - name: this.key ?? "", - size: this.file.size, - original_name: this.file.name, - type: "s3" - }; - } - getSize() { - return this.file.size; - } - start() { - void this.createUpload(); - } - initChunks() { - const chunks = []; - const desiredChunkSize = getChunkSize(this.file); - // at least 5MB per request, at most 10k requests - const minChunkSize = Math.max(5 * MB, Math.ceil(this.file.size / 10000)); - const chunkSize = Math.max(desiredChunkSize, minChunkSize); - for (let i = 0; i < this.file.size; i += chunkSize) { - const end = Math.min(this.file.size, i + chunkSize); - chunks.push(this.file.slice(i, end)); + this.chunkState = []; + this.uploading = []; + this.onError = undefined; + this.onProgress = undefined; + this.onSuccess = undefined; + this.initChunks(); + this.createdPromise.catch(() => ({})); // silence uncaught rejection warning + } + completeUpload() { + // Parts may not have completed uploading in sorted order, if limit > 1. + this.parts.sort((a, b) => a.PartNumber - b.PartNumber); + if (!this.uploadId || !this.key) { + return Promise.resolve(); } - this.chunks = chunks; - this.chunkState = chunks.map(() => ({ - uploaded: 0, - busy: false, - done: false - })); + return completeMultipartUpload({ + csrfToken: this.csrfToken, + endpoint: this.endpoint, + key: this.key, + parts: this.parts, + uploadId: this.uploadId + }).then(() => { + if (this.onSuccess) { + this.onSuccess(); + } + }, err => { + this.handleError(err); + }); } createUpload() { this.createdPromise = createMultipartUpload({ @@ -2940,31 +2924,52 @@ this.handleError(err); }); } - uploadParts() { - const need = 1 - this.uploading.length; - if (need === 0) { - return; + handleError(error) { + if (this.onError) { + this.onError(error); + } else { + throw error; } - - // All parts are uploaded. - if (this.chunkState.every(state => state.done)) { - void this.completeUpload(); - return; + } + initChunks() { + const chunks = []; + const desiredChunkSize = getChunkSize(this.file); + // at least 5MB per request, at most 10k requests + const minChunkSize = Math.max(5 * MB, Math.ceil(this.file.size / 10000)); + const chunkSize = Math.max(desiredChunkSize, minChunkSize); + for (let i = 0; i < this.file.size; i += chunkSize) { + const end = Math.min(this.file.size, i + chunkSize); + chunks.push(this.file.slice(i, end)); } - const candidates = []; - for (let i = 0; i < this.chunkState.length; i++) { - const state = this.chunkState[i]; - if (!state || state.done || state.busy) { - continue; - } - candidates.push(i); - if (candidates.length >= need) { - break; - } + this.chunks = chunks; + this.chunkState = chunks.map(() => ({ + busy: false, + done: false, + uploaded: 0 + })); + } + onPartComplete(index, etag) { + const state = this.chunkState[index]; + if (state) { + state.etag = etag; + state.done = true; + } + const part = { + ETag: etag, + PartNumber: index + 1 + }; + this.parts.push(part); + this.uploadParts(); + } + onPartProgress(index, sent) { + const state = this.chunkState[index]; + if (state) { + state.uploaded = sent; + } + if (this.onProgress) { + const totalUploaded = this.chunkState.reduce((n, c) => n + c.uploaded, 0); + this.onProgress(totalUploaded, this.file.size); } - candidates.forEach(index => { - void this.uploadPart(index); - }); } uploadPart(index) { const state = this.chunkState[index]; @@ -2995,29 +3000,6 @@ this.handleError(err); }); } - onPartProgress(index, sent) { - const state = this.chunkState[index]; - if (state) { - state.uploaded = sent; - } - if (this.onProgress) { - const totalUploaded = this.chunkState.reduce((n, c) => n + c.uploaded, 0); - this.onProgress(totalUploaded, this.file.size); - } - } - onPartComplete(index, etag) { - const state = this.chunkState[index]; - if (state) { - state.etag = etag; - state.done = true; - } - const part = { - PartNumber: index + 1, - ETag: etag - }; - this.parts.push(part); - this.uploadParts(); - } uploadPartBytes(index, url) { const body = this.chunks[index]; const xhr = new XMLHttpRequest(); @@ -3070,199 +3052,69 @@ }); xhr.send(body); } - completeUpload() { - // Parts may not have completed uploading in sorted order, if limit > 1. - this.parts.sort((a, b) => a.PartNumber - b.PartNumber); - if (!this.uploadId || !this.key) { - return Promise.resolve(); - } - return completeMultipartUpload({ - csrfToken: this.csrfToken, - endpoint: this.endpoint, - key: this.key, - uploadId: this.uploadId, - parts: this.parts - }).then(() => { - if (this.onSuccess) { - this.onSuccess(); - } - }, err => { - this.handleError(err); - }); - } - handleError(error) { - if (this.onError) { - this.onError(error); - } else { - throw error; + uploadParts() { + const need = 1 - this.uploading.length; + if (need === 0) { + return; } - } - } - const deleteUpload = async (url, csrfToken) => new Promise((resolve, reject) => { - const xhr = new XMLHttpRequest(); - xhr.open("DELETE", url); - xhr.onload = () => { - if (xhr.status === 204) { - resolve(); - } else { - reject(new Error()); + // All parts are uploaded. + if (this.chunkState.every(state => state.done)) { + void this.completeUpload(); + return; } - }; - xhr.setRequestHeader("Tus-Resumable", "1.0.0"); - xhr.setRequestHeader("X-CSRFToken", csrfToken); - xhr.send(null); - }); - - class BaseUploadedFile extends BaseUpload$1 { - constructor(_ref) { - let { - name, - size, - type, - uploadIndex - } = _ref; - super({ - name, - status: "done", - type, - uploadIndex - }); - this.size = size; - } - async abort() { - return Promise.resolve(); - } - async delete() { - return Promise.resolve(); - } - getSize() { - return this.size; - } - } - class PlaceholderFile extends BaseUploadedFile { - constructor(initialFile, uploadIndex) { - super({ - name: initialFile.name, - size: initialFile.size, - type: "placeholder", - uploadIndex - }); - this.id = initialFile.id; - } - getId() { - return undefined; - } - getInitialFile() { - return { - id: this.id, - name: this.name, - size: this.size, - type: "placeholder" - }; - } - } - class UploadedS3File extends BaseUploadedFile { - constructor(initialFile, uploadIndex) { - super({ - name: initialFile.original_name || initialFile.name, - size: initialFile.size, - type: "uploadedS3", - uploadIndex - }); - this.id = initialFile.id; - this.key = initialFile.name; - } - getId() { - return this.id; - } - getInitialFile() { - return { - id: this.id, - name: this.key, - original_name: this.name, - size: this.size, - type: "s3" - }; - } - } - class ExistingFile extends BaseUploadedFile { - constructor(initialFile, uploadIndex) { - super({ - name: initialFile.name, - size: initialFile.size, - type: "existing", - uploadIndex - }); - } - getId() { - return undefined; - } - getInitialFile() { - return { - name: this.name, - size: this.size, - type: "existing" - }; + const candidates = []; + for (let i = 0; i < this.chunkState.length; i++) { + const state = this.chunkState[i]; + if (!state || state.done || state.busy) { + continue; + } + candidates.push(i); + if (candidates.length >= need) { + break; + } + } + candidates.forEach(index => { + void this.uploadPart(index); + }); } - } - class UploadedTusFile extends BaseUploadedFile { - constructor(_ref2) { - let { - csrfToken, - initialFile, - uploadIndex, - uploadUrl - } = _ref2; - super({ - name: initialFile.name, - size: initialFile.size, - type: "uploadedTus", - uploadIndex + async abort() { + this.uploading.slice().forEach(xhr => { + xhr.abort(); }); - this.csrfToken = csrfToken; - this.id = initialFile.id; - this.url = `${uploadUrl}${initialFile.id}`; + this.uploading = []; + await this.createdPromise; + if (this.key && this.uploadId) { + await abortMultipartUpload({ + csrfToken: this.csrfToken, + endpoint: this.endpoint, + key: this.key, + uploadId: this.uploadId + }); + } } async delete() { - await deleteUpload(this.url, this.csrfToken); + return Promise.resolve(); } getId() { - return this.id; + return this.uploadId ?? undefined; } getInitialFile() { return { - id: this.id, - name: this.name, - size: this.size, - type: "tus", - url: "" + id: this.uploadId ?? "", + name: this.key ?? "", + original_name: this.file.name, + size: this.file.size, + type: "s3" }; } - } - const createUploadedFile = _ref3 => { - let { - csrfToken, - initialFile, - uploadIndex, - uploadUrl - } = _ref3; - switch (initialFile.type) { - case "existing": - return new ExistingFile(initialFile, uploadIndex); - case "placeholder": - return new PlaceholderFile(initialFile, uploadIndex); - case "s3": - return new UploadedS3File(initialFile, uploadIndex); - case "tus": - return new UploadedTusFile({ - csrfToken, - initialFile, - uploadUrl, - uploadIndex - }); + getSize() { + return this.file.size; } - }; + start() { + void this.createUpload(); + } + } class DetailedError extends Error { constructor(message) { @@ -5687,7 +5539,48 @@ } } + const deleteUpload = async (url, csrfToken) => new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + xhr.open("DELETE", url); + xhr.onload = () => { + if (xhr.status === 204) { + resolve(); + } else { + reject(new Error()); + } + }; + xhr.setRequestHeader("Tus-Resumable", "1.0.0"); + xhr.setRequestHeader("X-CSRFToken", csrfToken); + xhr.send(null); + }); + class TusUpload extends BaseUpload$1 { + addCsrTokenToRequest = request => { + request.setHeader("X-CSRFToken", this.csrfToken); + }; + handleAfterReponse = (_request, response) => { + const resourceId = response.getHeader("ResourceId"); + if (resourceId) { + this.id = resourceId; + } + }; + handleError = error => { + if (this.onError) { + this.onError(error); + } else { + throw error; + } + }; + handleProgress = (bytesUploaded, bytesTotal) => { + if (this.onProgress) { + this.onProgress(bytesUploaded, bytesTotal); + } + }; + handleSucces = () => { + if (this.onSuccess) { + this.onSuccess(); + } + }; constructor(_ref) { let { chunkSize, @@ -5737,50 +5630,290 @@ getId() { return this.id; } + getInitialFile() { + return { + id: this.id, + name: this.name, + size: this.getSize(), + type: "tus", + url: "" + }; + } getSize() { return this.upload.file.size; } start() { this.upload.start(); } - handleError = error => { - if (this.onError) { - this.onError(error); - } else { - throw error; - } - }; - handleProgress = (bytesUploaded, bytesTotal) => { - if (this.onProgress) { - this.onProgress(bytesUploaded, bytesTotal); - } - }; - handleSucces = () => { - if (this.onSuccess) { - this.onSuccess(); - } - }; - addCsrTokenToRequest = request => { - request.setHeader("X-CSRFToken", this.csrfToken); - }; - handleAfterReponse = (_request, response) => { - const resourceId = response.getHeader("ResourceId"); - if (resourceId) { - this.id = resourceId; - } - }; + } + + class BaseUploadedFile extends BaseUpload$1 { + constructor(_ref) { + let { + name, + size, + type, + uploadIndex + } = _ref; + super({ + name, + status: "done", + type, + uploadIndex + }); + this.size = size; + } + async abort() { + return Promise.resolve(); + } + async delete() { + return Promise.resolve(); + } + getSize() { + return this.size; + } + } + class PlaceholderFile extends BaseUploadedFile { + constructor(initialFile, uploadIndex) { + super({ + name: initialFile.name, + size: initialFile.size, + type: "placeholder", + uploadIndex + }); + this.id = initialFile.id; + } + getId() { + return undefined; + } + getInitialFile() { + return { + id: this.id, + name: this.name, + size: this.size, + type: "placeholder" + }; + } + } + class UploadedS3File extends BaseUploadedFile { + constructor(initialFile, uploadIndex) { + super({ + name: initialFile.original_name || initialFile.name, + size: initialFile.size, + type: "uploadedS3", + uploadIndex + }); + this.id = initialFile.id; + this.key = initialFile.name; + } + getId() { + return this.id; + } + getInitialFile() { + return { + id: this.id, + name: this.key, + original_name: this.name, + size: this.size, + type: "s3" + }; + } + } + class ExistingFile extends BaseUploadedFile { + constructor(initialFile, uploadIndex) { + super({ + name: initialFile.name, + size: initialFile.size, + type: "existing", + uploadIndex + }); + } + getId() { + return undefined; + } + getInitialFile() { + return { + name: this.name, + size: this.size, + type: "existing" + }; + } + } + class UploadedTusFile extends BaseUploadedFile { + constructor(_ref2) { + let { + csrfToken, + initialFile, + uploadIndex, + uploadUrl + } = _ref2; + super({ + name: initialFile.name, + size: initialFile.size, + type: "uploadedTus", + uploadIndex + }); + this.csrfToken = csrfToken; + this.id = initialFile.id; + this.url = `${uploadUrl}${initialFile.id}`; + } + async delete() { + await deleteUpload(this.url, this.csrfToken); + } + getId() { + return this.id; + } getInitialFile() { return { id: this.id, name: this.name, - size: this.getSize(), + size: this.size, type: "tus", url: "" }; } } + const createUploadedFile = _ref3 => { + let { + csrfToken, + initialFile, + uploadIndex, + uploadUrl + } = _ref3; + switch (initialFile.type) { + case "existing": + return new ExistingFile(initialFile, uploadIndex); + case "placeholder": + return new PlaceholderFile(initialFile, uploadIndex); + case "s3": + return new UploadedS3File(initialFile, uploadIndex); + case "tus": + return new UploadedTusFile({ + csrfToken, + initialFile, + uploadIndex, + uploadUrl + }); + } + }; class FileField { + handleClick = e => { + const target = e.target; + const getUpload = () => { + const dataIndex = target.getAttribute("data-index"); + if (!dataIndex) { + return undefined; + } + const uploadIndex = parseInt(dataIndex, 10); + return this.getUploadByIndex(uploadIndex); + }; + if (target.classList.contains("dff-delete") && !target.classList.contains("dff-disabled")) { + e.preventDefault(); + const upload = getUpload(); + if (upload) { + void this.removeExistingUpload(upload); + } + } else if (target.classList.contains("dff-cancel")) { + e.preventDefault(); + const upload = getUpload(); + if (upload) { + void this.handleCancel(upload); + } + } else if (target.classList.contains("dff-filename")) { + e.preventDefault(); + const upload = getUpload(); + if (upload?.status === "done" && this.callbacks.onClick) { + this.callbacks.onClick({ + fieldName: this.fieldName, + fileName: upload.name, + id: upload.getId(), + type: upload.type + }); + } + } + }; + handleError = (upload, error) => { + this.renderer.setError(upload.uploadIndex); + upload.status = "error"; + const { + onError + } = this.callbacks; + if (onError) { + if (upload instanceof TusUpload) { + onError(error, upload); + } + } + }; + handleInvalidFiles = files => { + this.renderer.setErrorInvalidFiles(files); + }; + handleProgress = (upload, bytesUploaded, bytesTotal) => { + const percentage = (bytesUploaded / bytesTotal * 100).toFixed(2); + this.renderer.updateProgress(upload.uploadIndex, percentage); + const { + onProgress + } = this.callbacks; + if (onProgress) { + if (upload instanceof TusUpload) { + onProgress(bytesUploaded, bytesTotal, upload); + } + } + }; + handleSuccess = upload => { + const { + renderer + } = this; + this.updatePlaceholderInput(); + renderer.clearInput(); + renderer.setSuccess(upload.uploadIndex, upload.getSize()); + upload.status = "done"; + const { + onSuccess + } = this.callbacks; + const element = this.renderer.findFileDiv(upload.uploadIndex); + if (element) { + this.emitEvent("uploadComplete", element, upload); + } + if (onSuccess && upload.type === "tus") { + onSuccess(upload); + } + }; + onChange = e => { + const files = e.target.files ?? []; + const acceptedFiles = []; + const invalidFiles = []; + for (const file of files) { + if (this.acceptedFileTypes.isAccepted(file.name)) { + acceptedFiles.push(file); + } else { + invalidFiles.push(file); + } + } + this.handleInvalidFiles([...invalidFiles]); + void this.uploadFiles([...acceptedFiles]); + this.renderer.clearInput(); + }; + uploadFiles = async files => { + if (files.length === 0) { + return; + } + if (!this.multiple) { + for (const upload of this.uploads) { + this.renderer.deleteFile(upload.uploadIndex); + } + this.uploads = []; + const file = files[0]; + if (file) { + await this.uploadFile(file); + } + } else { + for (const file of files) { + await this.uploadFile(file); + } + } + this.checkDropHint(); + }; constructor(_ref) { let { callbacks, @@ -5819,8 +5952,8 @@ this.uploads = []; this.nextUploadIndex = 0; this.renderer = new RenderUploadFile({ - parent, input, + parent, skipRequired, translations }); @@ -5828,66 +5961,132 @@ if (supportDropArea) { this.initDropArea(filesContainer, input.accept); } - this.addInitialFiles(initial); - this.checkDropHint(); - input.addEventListener("change", this.onChange); - filesContainer.addEventListener("click", this.handleClick); + this.addInitialFiles(initial); + this.checkDropHint(); + input.addEventListener("change", this.onChange); + filesContainer.addEventListener("click", this.handleClick); + } + addInitialFiles(initialFiles) { + if (initialFiles.length === 0) { + return; + } + const { + multiple, + renderer + } = this; + const addInitialFile = initialFile => { + const { + size + } = initialFile; + const name = initialFile.type === "s3" && initialFile.original_name ? initialFile.original_name : initialFile.name; + const element = renderer.addUploadedFile(name, this.nextUploadIndex, size); + const upload = createUploadedFile({ + csrfToken: this.csrfToken, + initialFile, + uploadIndex: this.nextUploadIndex, + uploadUrl: this.uploadUrl + }); + this.uploads.push(upload); + this.emitEvent("addUpload", element, upload); + }; + if (multiple) { + initialFiles.forEach(file => { + addInitialFile(file); + this.nextUploadIndex += 1; + }); + } else { + const initialFile = initialFiles[0]; + if (initialFile) { + addInitialFile(initialFile); + } + } + } + checkDropHint() { + if (!this.supportDropArea) { + return; + } + const nonEmptyUploads = this.uploads.filter(e => Boolean(e)); + if (nonEmptyUploads.length === 0) { + this.renderer.renderDropHint(); + } else { + this.renderer.removeDropHint(); + } + } + emitEvent(eventName, element, upload) { + if (this.eventEmitter) { + this.eventEmitter.emit(eventName, { + element, + fieldName: this.fieldName, + fileName: upload.name, + metaDataField: this.getMetaDataField(), + upload + }); + } + } + findUploadByName(fileName) { + return this.uploads.find(upload => upload.name === fileName); + } + getMetaDataField() { + return findInput(this.form, getMetadataFieldName(this.fieldName, this.prefix), this.prefix); + } + getUploadByIndex(uploadIndex) { + return this.uploads.find(upload => upload.uploadIndex === uploadIndex); + } + async handleCancel(upload) { + this.renderer.disableCancel(upload.uploadIndex); + await upload.abort(); + this.removeUploadFromList(upload); + } + initDropArea(container, inputAccept) { + new DropArea({ + container, + inputAccept, + onUploadFiles: this.uploadFiles, + renderer: this.renderer + }); + } + async removeExistingUpload(upload) { + const element = this.renderer.findFileDiv(upload.uploadIndex); + if (element) { + this.emitEvent("removeUpload", element, upload); + } + if (upload.status === "uploading") { + this.renderer.disableCancel(upload.uploadIndex); + await upload.abort(); + } else if (upload.status === "done") { + this.renderer.disableDelete(upload.uploadIndex); + try { + await upload.delete(); + } catch { + this.renderer.setDeleteFailed(upload.uploadIndex); + return; + } + } + this.removeUploadFromList(upload); + this.updatePlaceholderInput(); } - addInitialFiles(initialFiles) { - if (initialFiles.length === 0) { - return; + removeUploadFromList(upload) { + this.renderer.deleteFile(upload.uploadIndex); + const index = this.uploads.indexOf(upload); + if (index >= 0) { + this.uploads.splice(index, 1); } + this.checkDropHint(); const { - multiple, - renderer - } = this; - const addInitialFile = initialFile => { - const { - size - } = initialFile; - const name = initialFile.type === "s3" && initialFile.original_name ? initialFile.original_name : initialFile.name; - const element = renderer.addUploadedFile(name, this.nextUploadIndex, size); - const upload = createUploadedFile({ - csrfToken: this.csrfToken, - initialFile, - uploadIndex: this.nextUploadIndex, - uploadUrl: this.uploadUrl - }); - this.uploads.push(upload); - this.emitEvent("addUpload", element, upload); - }; - if (multiple) { - initialFiles.forEach(file => { - addInitialFile(file); - this.nextUploadIndex += 1; - }); - } else { - const initialFile = initialFiles[0]; - if (initialFile) { - addInitialFile(initialFile); - } + onDelete + } = this.callbacks; + if (onDelete) { + onDelete(upload); } } - uploadFiles = async files => { - if (files.length === 0) { + updatePlaceholderInput() { + const input = findInput(this.form, getUploadsFieldName(this.fieldName, this.prefix), this.prefix); + if (!input) { return; } - if (!this.multiple) { - for (const upload of this.uploads) { - this.renderer.deleteFile(upload.uploadIndex); - } - this.uploads = []; - const file = files[0]; - if (file) { - await this.uploadFile(file); - } - } else { - for (const file of files) { - await this.uploadFile(file); - } - } - this.checkDropHint(); - }; + const placeholdersInfo = this.uploads.map(upload => upload.getInitialFile()); + input.value = JSON.stringify(placeholdersInfo); + } async uploadFile(file) { const createUpload = () => { const { @@ -5945,188 +6144,6 @@ const element = renderer.addNewUpload(fileName, newUploadIndex); this.emitEvent("addUpload", element, upload); } - getUploadByIndex(uploadIndex) { - return this.uploads.find(upload => upload.uploadIndex === uploadIndex); - } - findUploadByName(fileName) { - return this.uploads.find(upload => upload.name === fileName); - } - async removeExistingUpload(upload) { - const element = this.renderer.findFileDiv(upload.uploadIndex); - if (element) { - this.emitEvent("removeUpload", element, upload); - } - if (upload.status === "uploading") { - this.renderer.disableCancel(upload.uploadIndex); - await upload.abort(); - } else if (upload.status === "done") { - this.renderer.disableDelete(upload.uploadIndex); - try { - await upload.delete(); - } catch { - this.renderer.setDeleteFailed(upload.uploadIndex); - return; - } - } - this.removeUploadFromList(upload); - this.updatePlaceholderInput(); - } - onChange = e => { - const files = e.target.files ?? []; - const acceptedFiles = []; - const invalidFiles = []; - for (const file of files) { - if (this.acceptedFileTypes.isAccepted(file.name)) { - acceptedFiles.push(file); - } else { - invalidFiles.push(file); - } - } - this.handleInvalidFiles([...invalidFiles]); - void this.uploadFiles([...acceptedFiles]); - this.renderer.clearInput(); - }; - handleInvalidFiles = files => { - this.renderer.setErrorInvalidFiles(files); - }; - handleClick = e => { - const target = e.target; - const getUpload = () => { - const dataIndex = target.getAttribute("data-index"); - if (!dataIndex) { - return undefined; - } - const uploadIndex = parseInt(dataIndex, 10); - return this.getUploadByIndex(uploadIndex); - }; - if (target.classList.contains("dff-delete") && !target.classList.contains("dff-disabled")) { - e.preventDefault(); - const upload = getUpload(); - if (upload) { - void this.removeExistingUpload(upload); - } - } else if (target.classList.contains("dff-cancel")) { - e.preventDefault(); - const upload = getUpload(); - if (upload) { - void this.handleCancel(upload); - } - } else if (target.classList.contains("dff-filename")) { - e.preventDefault(); - const upload = getUpload(); - if (upload?.status === "done" && this.callbacks.onClick) { - this.callbacks.onClick({ - fileName: upload.name, - fieldName: this.fieldName, - id: upload.getId(), - type: upload.type - }); - } - } - }; - handleProgress = (upload, bytesUploaded, bytesTotal) => { - const percentage = (bytesUploaded / bytesTotal * 100).toFixed(2); - this.renderer.updateProgress(upload.uploadIndex, percentage); - const { - onProgress - } = this.callbacks; - if (onProgress) { - if (upload instanceof TusUpload) { - onProgress(bytesUploaded, bytesTotal, upload); - } - } - }; - handleError = (upload, error) => { - this.renderer.setError(upload.uploadIndex); - upload.status = "error"; - const { - onError - } = this.callbacks; - if (onError) { - if (upload instanceof TusUpload) { - onError(error, upload); - } - } - }; - handleSuccess = upload => { - const { - renderer - } = this; - this.updatePlaceholderInput(); - renderer.clearInput(); - renderer.setSuccess(upload.uploadIndex, upload.getSize()); - upload.status = "done"; - const { - onSuccess - } = this.callbacks; - const element = this.renderer.findFileDiv(upload.uploadIndex); - if (element) { - this.emitEvent("uploadComplete", element, upload); - } - if (onSuccess && upload.type === "tus") { - onSuccess(upload); - } - }; - removeUploadFromList(upload) { - this.renderer.deleteFile(upload.uploadIndex); - const index = this.uploads.indexOf(upload); - if (index >= 0) { - this.uploads.splice(index, 1); - } - this.checkDropHint(); - const { - onDelete - } = this.callbacks; - if (onDelete) { - onDelete(upload); - } - } - async handleCancel(upload) { - this.renderer.disableCancel(upload.uploadIndex); - await upload.abort(); - this.removeUploadFromList(upload); - } - initDropArea(container, inputAccept) { - new DropArea({ - container, - inputAccept, - onUploadFiles: this.uploadFiles, - renderer: this.renderer - }); - } - checkDropHint() { - if (!this.supportDropArea) { - return; - } - const nonEmptyUploads = this.uploads.filter(e => Boolean(e)); - if (nonEmptyUploads.length === 0) { - this.renderer.renderDropHint(); - } else { - this.renderer.removeDropHint(); - } - } - updatePlaceholderInput() { - const input = findInput(this.form, getUploadsFieldName(this.fieldName, this.prefix), this.prefix); - if (!input) { - return; - } - const placeholdersInfo = this.uploads.map(upload => upload.getInitialFile()); - input.value = JSON.stringify(placeholdersInfo); - } - getMetaDataField() { - return findInput(this.form, getMetadataFieldName(this.fieldName, this.prefix), this.prefix); - } - emitEvent(eventName, element, upload) { - if (this.eventEmitter) { - this.eventEmitter.emit(eventName, { - element, - fieldName: this.fieldName, - fileName: upload.name, - metaDataField: this.getMetaDataField(), - upload - }); - } - } } const initUploadFields = function (form) { @@ -6183,13 +6200,13 @@ fieldName, form, formId, - s3UploadDir: s3UploadDir ?? null, initial, input, multiple, parent: container, prefix, retryDelays: options.retryDelays ?? null, + s3UploadDir: s3UploadDir ?? null, skipRequired, supportDropArea, translations, diff --git a/django_file_form/static/file_form/file_form.js.map b/django_file_form/static/file_form/file_form.js.map index 02e339dfd..fa193509b 100644 --- a/django_file_form/static/file_form/file_form.js.map +++ b/django_file_form/static/file_form/file_form.js.map @@ -1 +1 @@ -{"version":3,"file":"file_form.js","sources":["../../../frontend/src/auto_init_file_forms.ts","../../../frontend/src/util.ts","../../../frontend/node_modules/escape-html/index.js","../../../frontend/src/render_upload_file.ts","../../../frontend/node_modules/mime/dist/types/standard.js","../../../frontend/node_modules/mime/dist/src/Mime.js","../../../frontend/node_modules/mime/dist/src/index_lite.js","../../../frontend/node_modules/picomatch/lib/constants.js","../../../frontend/node_modules/picomatch/lib/utils.js","../../../frontend/node_modules/picomatch/lib/scan.js","../../../frontend/node_modules/picomatch/lib/parse.js","../../../frontend/node_modules/picomatch/lib/picomatch.js","../../../frontend/node_modules/picomatch/posix.js","../../../frontend/src/accepted_file_types.ts","../../../frontend/src/drop_area.ts","../../../frontend/src/uploads/base_upload.ts","../../../frontend/node_modules/url-join/lib/url-join.js","../../../frontend/src/uploads/s3_utils.ts","../../../frontend/src/uploads/s3_upload.ts","../../../frontend/src/uploads/tus_utils.ts","../../../frontend/src/uploads/uploaded_file.ts","../../../frontend/node_modules/tus-js-client/lib/error.js","../../../frontend/node_modules/tus-js-client/lib/logger.js","../../../frontend/node_modules/tus-js-client/lib/noopUrlStorage.js","../../../frontend/node_modules/js-base64/base64.mjs","../../../frontend/node_modules/requires-port/index.js","../../../frontend/node_modules/querystringify/index.js","../../../frontend/node_modules/url-parse/index.js","../../../frontend/node_modules/tus-js-client/lib/uuid.js","../../../frontend/node_modules/tus-js-client/lib/upload.js","../../../frontend/node_modules/tus-js-client/lib/browser/isReactNative.js","../../../frontend/node_modules/tus-js-client/lib/browser/uriToBlob.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/isCordova.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/readAsByteArray.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/FileSource.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/StreamSource.js","../../../frontend/node_modules/tus-js-client/lib/browser/fileReader.js","../../../frontend/node_modules/tus-js-client/lib/browser/fileSignature.js","../../../frontend/node_modules/tus-js-client/lib/browser/httpStack.js","../../../frontend/node_modules/tus-js-client/lib/browser/urlStorage.js","../../../frontend/node_modules/tus-js-client/lib/browser/index.js","../../../frontend/src/uploads/tus_upload.ts","../../../frontend/src/file_field.ts","../../../frontend/src/init_upload_fields.ts","../../../frontend/src/init_form_set.ts","../../../frontend/src/file_form.ts"],"sourcesContent":["const findForm = (element: Element): HTMLElement | null => {\n const parent = element.parentElement;\n\n if (!parent) {\n return null;\n }\n\n if (parent.tagName === \"FORM\") {\n return parent;\n }\n\n return findForm(parent);\n};\n\nconst unique = (values: unknown[]): unknown[] =>\n Array.from(new Set(values).values());\n\ndeclare const window: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n\nconst autoInitFileForms = (): void => {\n const initUploadFields = window.initUploadFields as () => void; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n\n const forms = unique(\n Array.from(document.querySelectorAll(\".dff-uploader\")).map(findForm)\n );\n forms.forEach(initUploadFields);\n};\n\nexport default autoInitFileForms;\n","export const formatBytes = (bytes: number, decimals: number): string => {\n if (bytes === 0) {\n return \"0 Bytes\";\n }\n\n const k = 1024;\n const dm = decimals <= 0 ? 0 : decimals || 2;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n const n = parseFloat((bytes / k ** i).toFixed(dm));\n const size = sizes[i];\n\n if (size == null) {\n return \"\";\n } else {\n return `${n.toString()} ${size}`;\n }\n};\n\nexport const getInputNameWithPrefix = (\n fieldName: string,\n prefix: string | null\n): string => (prefix ? `${prefix}-${fieldName}` : fieldName);\n\nconst getInputNameWithoutPrefix = (\n fieldName: string,\n prefix: string | null\n): string => (prefix ? fieldName.slice(prefix.length + 1) : fieldName);\n\nexport const findInput = (\n form: Element,\n fieldName: string,\n prefix: string | null\n): HTMLInputElement | null => {\n const inputNameWithPrefix = getInputNameWithPrefix(fieldName, prefix);\n const input = form.querySelector(`[name=\"${inputNameWithPrefix}\"]`);\n\n if (!input) {\n return null;\n }\n\n return input as HTMLInputElement;\n};\n\nexport const getUploadsFieldName = (\n fieldName: string,\n prefix: string | null\n): string => `${getInputNameWithoutPrefix(fieldName, prefix)}-uploads`;\n\nexport const getInputValueForFormAndPrefix = (\n form: Element,\n fieldName: string,\n prefix: string | null\n): string | undefined => findInput(form, fieldName, prefix)?.value;\n\nexport const getMetadataFieldName = (\n fieldName: string,\n prefix: string | null\n): string => `${getInputNameWithoutPrefix(fieldName, prefix)}-metadata`;\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","import escape from \"escape-html\";\nimport { formatBytes } from \"./util.ts\";\n\nclass RenderUploadFile {\n container: Element;\n input: HTMLInputElement;\n translations: Record;\n errors: Element;\n\n constructor({\n parent,\n input,\n skipRequired,\n translations\n }: {\n parent: Element;\n input: HTMLInputElement;\n skipRequired: boolean;\n translations: Record;\n }) {\n this.container = this.createFilesContainer(parent);\n this.errors = this.createErrorContainer(parent);\n this.input = input;\n this.translations = translations;\n\n if (skipRequired) {\n this.input.required = false;\n }\n }\n\n public addNewUpload(filename: string, uploadIndex: number): HTMLElement {\n const div = this.addFile(filename, uploadIndex);\n\n const progressSpan = document.createElement(\"span\");\n progressSpan.className = \"dff-progress\";\n\n const innerSpan = document.createElement(\"span\");\n innerSpan.className = \"dff-progress-inner\";\n\n progressSpan.appendChild(innerSpan);\n div.appendChild(progressSpan);\n\n const cancelLink = document.createElement(\"a\");\n cancelLink.className = \"dff-cancel\";\n cancelLink.innerHTML = this.translations.Cancel ?? \"\";\n cancelLink.setAttribute(\"data-index\", uploadIndex.toString());\n cancelLink.href = \"#\";\n div.appendChild(cancelLink);\n\n return div;\n }\n\n public addUploadedFile(\n filename: string,\n uploadIndex: number,\n filesize?: number\n ): HTMLElement {\n const element = this.addFile(filename, uploadIndex);\n this.setSuccess(uploadIndex, filesize);\n return element;\n }\n\n public clearInput(): void {\n const { input } = this;\n\n input.value = \"\";\n }\n\n public deleteFile(index: number): void {\n const div = this.findFileDiv(index);\n\n if (div) {\n div.remove();\n }\n }\n\n public disableCancel(index: number): void {\n const cancelSpan = this.findCancelSpan(index);\n\n if (cancelSpan) {\n cancelSpan.classList.add(\"dff-disabled\");\n }\n }\n\n public disableDelete(index: number): void {\n const deleteLink = this.findDeleteLink(index);\n\n if (deleteLink) {\n deleteLink.classList.add(\"dff-disabled\");\n }\n }\n\n public findFileDiv(index: number): HTMLElement | null {\n return this.container.querySelector(`.dff-file-id-${index.toString()}`);\n }\n\n public removeDropHint(): void {\n const dropHint = this.container.querySelector(\".dff-drop-hint\");\n\n if (dropHint) {\n dropHint.remove();\n }\n }\n\n public renderDropHint(): void {\n if (this.container.querySelector(\".dff-drop-hint\")) {\n return;\n }\n\n const dropHint = document.createElement(\"div\");\n dropHint.className = \"dff-drop-hint\";\n dropHint.innerHTML = this.translations[\"Drop your files here\"] ?? \"\";\n\n this.container.appendChild(dropHint);\n }\n\n public setDeleteFailed(index: number): void {\n this.setErrorMessage(index, this.translations[\"Delete failed\"] ?? \"\");\n\n this.enableDelete(index);\n }\n\n public setError(index: number): void {\n this.setErrorMessage(index, this.translations[\"Upload failed\"] ?? \"\");\n\n const el = this.findFileDiv(index);\n if (el) {\n el.classList.add(\"dff-upload-fail\");\n }\n\n this.removeProgress(index);\n this.removeCancel(index);\n }\n\n public setErrorInvalidFiles(files: File[]): void {\n const errorsMessages = document.createElement(\"ul\");\n\n for (const file of files) {\n const msg = document.createElement(\"li\");\n const invalidFileTypeMessage =\n this.translations[\"Invalid file type\"] ?? \"\";\n msg.innerText = `${file.name}: ${invalidFileTypeMessage}`;\n msg.className = \"dff-error\";\n errorsMessages.appendChild(msg);\n }\n\n this.errors.replaceChildren(errorsMessages);\n this.clearInput();\n }\n\n public setSuccess(index: number, size?: number): void {\n const { translations } = this;\n\n const el = this.findFileDiv(index);\n if (el) {\n el.classList.add(\"dff-upload-success\");\n\n if (size != null) {\n const fileSizeInfo = document.createElement(\"span\");\n fileSizeInfo.innerHTML = formatBytes(size, 2);\n fileSizeInfo.className = \"dff-filesize\";\n\n el.appendChild(fileSizeInfo);\n }\n\n const deleteLink = document.createElement(\"a\");\n deleteLink.innerHTML = translations.Delete ?? \"\";\n deleteLink.className = \"dff-delete\";\n deleteLink.setAttribute(\"data-index\", index.toString());\n deleteLink.href = \"#\";\n\n el.appendChild(deleteLink);\n }\n\n this.removeProgress(index);\n this.removeCancel(index);\n }\n\n public updateProgress(index: number, percentage: string): void {\n const el = this.container.querySelector(`.dff-file-id-${index.toString()}`);\n if (el) {\n const innerProgressSpan = el.querySelector(\".dff-progress-inner\");\n\n if (innerProgressSpan) {\n (innerProgressSpan as HTMLElement).style.width = `${percentage}%`;\n }\n }\n }\n\n private createErrorContainer = (parent: Element): Element => {\n const div = document.createElement(\"div\");\n div.className = \"dff-invalid-files\";\n parent.appendChild(div);\n return div;\n };\n\n private createFilesContainer = (parent: Element): Element => {\n const div = document.createElement(\"div\");\n div.className = \"dff-files\";\n parent.appendChild(div);\n\n return div;\n };\n\n private addFile(filename: string, uploadIndex: number): HTMLElement {\n const div = document.createElement(\"div\");\n div.className = `dff-file dff-file-id-${uploadIndex.toString()}`;\n\n const nameSpan = document.createElement(\"span\");\n nameSpan.innerHTML = escape(filename);\n nameSpan.className = \"dff-filename\";\n nameSpan.setAttribute(\"data-index\", uploadIndex.toString());\n\n div.appendChild(nameSpan);\n this.container.appendChild(div);\n\n this.input.required = false;\n return div;\n }\n\n private removeProgress(index: number): void {\n const el = this.findFileDiv(index);\n\n if (el) {\n const progressSpan = el.querySelector(\".dff-progress\");\n\n if (progressSpan) {\n progressSpan.remove();\n }\n }\n }\n\n private removeCancel(index: number): void {\n const cancelSpan = this.findCancelSpan(index);\n\n if (cancelSpan) {\n cancelSpan.remove();\n }\n }\n\n private findCancelSpan(index: number): HTMLElement | null {\n const el = this.findFileDiv(index);\n\n if (!el) {\n return null;\n }\n\n return el.querySelector(\".dff-cancel\");\n }\n\n private enableDelete(index: number): void {\n const deleteLink = this.findDeleteLink(index);\n\n if (deleteLink) {\n deleteLink.classList.remove(\"dff-disabled\");\n }\n }\n\n private findDeleteLink(index: number): HTMLElement | null {\n const div = this.findFileDiv(index);\n if (!div) {\n return div;\n }\n\n return div.querySelector(\".dff-delete\");\n }\n\n private setErrorMessage(index: number, message: string): void {\n const el = this.findFileDiv(index);\n if (!el) {\n return;\n }\n\n const originalMessageSpan = el.querySelector(\".dff-error\");\n if (originalMessageSpan) {\n originalMessageSpan.remove();\n }\n\n const span = document.createElement(\"span\");\n span.classList.add(\"dff-error\");\n span.innerHTML = message;\n\n el.appendChild(span);\n }\n}\n\nexport default RenderUploadFile;\n","const types = { \"application/andrew-inset\": [\"ez\"], \"application/appinstaller\": [\"appinstaller\"], \"application/applixware\": [\"aw\"], \"application/appx\": [\"appx\"], \"application/appxbundle\": [\"appxbundle\"], \"application/atom+xml\": [\"atom\"], \"application/atomcat+xml\": [\"atomcat\"], \"application/atomdeleted+xml\": [\"atomdeleted\"], \"application/atomsvc+xml\": [\"atomsvc\"], \"application/atsc-dwd+xml\": [\"dwd\"], \"application/atsc-held+xml\": [\"held\"], \"application/atsc-rsat+xml\": [\"rsat\"], \"application/automationml-aml+xml\": [\"aml\"], \"application/automationml-amlx+zip\": [\"amlx\"], \"application/bdoc\": [\"bdoc\"], \"application/calendar+xml\": [\"xcs\"], \"application/ccxml+xml\": [\"ccxml\"], \"application/cdfx+xml\": [\"cdfx\"], \"application/cdmi-capability\": [\"cdmia\"], \"application/cdmi-container\": [\"cdmic\"], \"application/cdmi-domain\": [\"cdmid\"], \"application/cdmi-object\": [\"cdmio\"], \"application/cdmi-queue\": [\"cdmiq\"], \"application/cpl+xml\": [\"cpl\"], \"application/cu-seeme\": [\"cu\"], \"application/cwl\": [\"cwl\"], \"application/dash+xml\": [\"mpd\"], \"application/dash-patch+xml\": [\"mpp\"], \"application/davmount+xml\": [\"davmount\"], \"application/docbook+xml\": [\"dbk\"], \"application/dssc+der\": [\"dssc\"], \"application/dssc+xml\": [\"xdssc\"], \"application/ecmascript\": [\"ecma\"], \"application/emma+xml\": [\"emma\"], \"application/emotionml+xml\": [\"emotionml\"], \"application/epub+zip\": [\"epub\"], \"application/exi\": [\"exi\"], \"application/express\": [\"exp\"], \"application/fdf\": [\"fdf\"], \"application/fdt+xml\": [\"fdt\"], \"application/font-tdpfr\": [\"pfr\"], \"application/geo+json\": [\"geojson\"], \"application/gml+xml\": [\"gml\"], \"application/gpx+xml\": [\"gpx\"], \"application/gxf\": [\"gxf\"], \"application/gzip\": [\"gz\"], \"application/hjson\": [\"hjson\"], \"application/hyperstudio\": [\"stk\"], \"application/inkml+xml\": [\"ink\", \"inkml\"], \"application/ipfix\": [\"ipfix\"], \"application/its+xml\": [\"its\"], \"application/java-archive\": [\"jar\", \"war\", \"ear\"], \"application/java-serialized-object\": [\"ser\"], \"application/java-vm\": [\"class\"], \"application/javascript\": [\"*js\"], \"application/json\": [\"json\", \"map\"], \"application/json5\": [\"json5\"], \"application/jsonml+json\": [\"jsonml\"], \"application/ld+json\": [\"jsonld\"], \"application/lgr+xml\": [\"lgr\"], \"application/lost+xml\": [\"lostxml\"], \"application/mac-binhex40\": [\"hqx\"], \"application/mac-compactpro\": [\"cpt\"], \"application/mads+xml\": [\"mads\"], \"application/manifest+json\": [\"webmanifest\"], \"application/marc\": [\"mrc\"], \"application/marcxml+xml\": [\"mrcx\"], \"application/mathematica\": [\"ma\", \"nb\", \"mb\"], \"application/mathml+xml\": [\"mathml\"], \"application/mbox\": [\"mbox\"], \"application/media-policy-dataset+xml\": [\"mpf\"], \"application/mediaservercontrol+xml\": [\"mscml\"], \"application/metalink+xml\": [\"metalink\"], \"application/metalink4+xml\": [\"meta4\"], \"application/mets+xml\": [\"mets\"], \"application/mmt-aei+xml\": [\"maei\"], \"application/mmt-usd+xml\": [\"musd\"], \"application/mods+xml\": [\"mods\"], \"application/mp21\": [\"m21\", \"mp21\"], \"application/mp4\": [\"*mp4\", \"*mpg4\", \"mp4s\", \"m4p\"], \"application/msix\": [\"msix\"], \"application/msixbundle\": [\"msixbundle\"], \"application/msword\": [\"doc\", \"dot\"], \"application/mxf\": [\"mxf\"], \"application/n-quads\": [\"nq\"], \"application/n-triples\": [\"nt\"], \"application/node\": [\"cjs\"], \"application/octet-stream\": [\"bin\", \"dms\", \"lrf\", \"mar\", \"so\", \"dist\", \"distz\", \"pkg\", \"bpk\", \"dump\", \"elc\", \"deploy\", \"exe\", \"dll\", \"deb\", \"dmg\", \"iso\", \"img\", \"msi\", \"msp\", \"msm\", \"buffer\"], \"application/oda\": [\"oda\"], \"application/oebps-package+xml\": [\"opf\"], \"application/ogg\": [\"ogx\"], \"application/omdoc+xml\": [\"omdoc\"], \"application/onenote\": [\"onetoc\", \"onetoc2\", \"onetmp\", \"onepkg\"], \"application/oxps\": [\"oxps\"], \"application/p2p-overlay+xml\": [\"relo\"], \"application/patch-ops-error+xml\": [\"xer\"], \"application/pdf\": [\"pdf\"], \"application/pgp-encrypted\": [\"pgp\"], \"application/pgp-keys\": [\"asc\"], \"application/pgp-signature\": [\"sig\", \"*asc\"], \"application/pics-rules\": [\"prf\"], \"application/pkcs10\": [\"p10\"], \"application/pkcs7-mime\": [\"p7m\", \"p7c\"], \"application/pkcs7-signature\": [\"p7s\"], \"application/pkcs8\": [\"p8\"], \"application/pkix-attr-cert\": [\"ac\"], \"application/pkix-cert\": [\"cer\"], \"application/pkix-crl\": [\"crl\"], \"application/pkix-pkipath\": [\"pkipath\"], \"application/pkixcmp\": [\"pki\"], \"application/pls+xml\": [\"pls\"], \"application/postscript\": [\"ai\", \"eps\", \"ps\"], \"application/provenance+xml\": [\"provx\"], \"application/pskc+xml\": [\"pskcxml\"], \"application/raml+yaml\": [\"raml\"], \"application/rdf+xml\": [\"rdf\", \"owl\"], \"application/reginfo+xml\": [\"rif\"], \"application/relax-ng-compact-syntax\": [\"rnc\"], \"application/resource-lists+xml\": [\"rl\"], \"application/resource-lists-diff+xml\": [\"rld\"], \"application/rls-services+xml\": [\"rs\"], \"application/route-apd+xml\": [\"rapd\"], \"application/route-s-tsid+xml\": [\"sls\"], \"application/route-usd+xml\": [\"rusd\"], \"application/rpki-ghostbusters\": [\"gbr\"], \"application/rpki-manifest\": [\"mft\"], \"application/rpki-roa\": [\"roa\"], \"application/rsd+xml\": [\"rsd\"], \"application/rss+xml\": [\"rss\"], \"application/rtf\": [\"rtf\"], \"application/sbml+xml\": [\"sbml\"], \"application/scvp-cv-request\": [\"scq\"], \"application/scvp-cv-response\": [\"scs\"], \"application/scvp-vp-request\": [\"spq\"], \"application/scvp-vp-response\": [\"spp\"], \"application/sdp\": [\"sdp\"], \"application/senml+xml\": [\"senmlx\"], \"application/sensml+xml\": [\"sensmlx\"], \"application/set-payment-initiation\": [\"setpay\"], \"application/set-registration-initiation\": [\"setreg\"], \"application/shf+xml\": [\"shf\"], \"application/sieve\": [\"siv\", \"sieve\"], \"application/smil+xml\": [\"smi\", \"smil\"], \"application/sparql-query\": [\"rq\"], \"application/sparql-results+xml\": [\"srx\"], \"application/sql\": [\"sql\"], \"application/srgs\": [\"gram\"], \"application/srgs+xml\": [\"grxml\"], \"application/sru+xml\": [\"sru\"], \"application/ssdl+xml\": [\"ssdl\"], \"application/ssml+xml\": [\"ssml\"], \"application/swid+xml\": [\"swidtag\"], \"application/tei+xml\": [\"tei\", \"teicorpus\"], \"application/thraud+xml\": [\"tfi\"], \"application/timestamped-data\": [\"tsd\"], \"application/toml\": [\"toml\"], \"application/trig\": [\"trig\"], \"application/ttml+xml\": [\"ttml\"], \"application/ubjson\": [\"ubj\"], \"application/urc-ressheet+xml\": [\"rsheet\"], \"application/urc-targetdesc+xml\": [\"td\"], \"application/voicexml+xml\": [\"vxml\"], \"application/wasm\": [\"wasm\"], \"application/watcherinfo+xml\": [\"wif\"], \"application/widget\": [\"wgt\"], \"application/winhlp\": [\"hlp\"], \"application/wsdl+xml\": [\"wsdl\"], \"application/wspolicy+xml\": [\"wspolicy\"], \"application/xaml+xml\": [\"xaml\"], \"application/xcap-att+xml\": [\"xav\"], \"application/xcap-caps+xml\": [\"xca\"], \"application/xcap-diff+xml\": [\"xdf\"], \"application/xcap-el+xml\": [\"xel\"], \"application/xcap-ns+xml\": [\"xns\"], \"application/xenc+xml\": [\"xenc\"], \"application/xfdf\": [\"xfdf\"], \"application/xhtml+xml\": [\"xhtml\", \"xht\"], \"application/xliff+xml\": [\"xlf\"], \"application/xml\": [\"xml\", \"xsl\", \"xsd\", \"rng\"], \"application/xml-dtd\": [\"dtd\"], \"application/xop+xml\": [\"xop\"], \"application/xproc+xml\": [\"xpl\"], \"application/xslt+xml\": [\"*xsl\", \"xslt\"], \"application/xspf+xml\": [\"xspf\"], \"application/xv+xml\": [\"mxml\", \"xhvml\", \"xvml\", \"xvm\"], \"application/yang\": [\"yang\"], \"application/yin+xml\": [\"yin\"], \"application/zip\": [\"zip\"], \"audio/3gpp\": [\"*3gpp\"], \"audio/aac\": [\"adts\", \"aac\"], \"audio/adpcm\": [\"adp\"], \"audio/amr\": [\"amr\"], \"audio/basic\": [\"au\", \"snd\"], \"audio/midi\": [\"mid\", \"midi\", \"kar\", \"rmi\"], \"audio/mobile-xmf\": [\"mxmf\"], \"audio/mp3\": [\"*mp3\"], \"audio/mp4\": [\"m4a\", \"mp4a\"], \"audio/mpeg\": [\"mpga\", \"mp2\", \"mp2a\", \"mp3\", \"m2a\", \"m3a\"], \"audio/ogg\": [\"oga\", \"ogg\", \"spx\", \"opus\"], \"audio/s3m\": [\"s3m\"], \"audio/silk\": [\"sil\"], \"audio/wav\": [\"wav\"], \"audio/wave\": [\"*wav\"], \"audio/webm\": [\"weba\"], \"audio/xm\": [\"xm\"], \"font/collection\": [\"ttc\"], \"font/otf\": [\"otf\"], \"font/ttf\": [\"ttf\"], \"font/woff\": [\"woff\"], \"font/woff2\": [\"woff2\"], \"image/aces\": [\"exr\"], \"image/apng\": [\"apng\"], \"image/avci\": [\"avci\"], \"image/avcs\": [\"avcs\"], \"image/avif\": [\"avif\"], \"image/bmp\": [\"bmp\", \"dib\"], \"image/cgm\": [\"cgm\"], \"image/dicom-rle\": [\"drle\"], \"image/dpx\": [\"dpx\"], \"image/emf\": [\"emf\"], \"image/fits\": [\"fits\"], \"image/g3fax\": [\"g3\"], \"image/gif\": [\"gif\"], \"image/heic\": [\"heic\"], \"image/heic-sequence\": [\"heics\"], \"image/heif\": [\"heif\"], \"image/heif-sequence\": [\"heifs\"], \"image/hej2k\": [\"hej2\"], \"image/hsj2\": [\"hsj2\"], \"image/ief\": [\"ief\"], \"image/jls\": [\"jls\"], \"image/jp2\": [\"jp2\", \"jpg2\"], \"image/jpeg\": [\"jpeg\", \"jpg\", \"jpe\"], \"image/jph\": [\"jph\"], \"image/jphc\": [\"jhc\"], \"image/jpm\": [\"jpm\", \"jpgm\"], \"image/jpx\": [\"jpx\", \"jpf\"], \"image/jxr\": [\"jxr\"], \"image/jxra\": [\"jxra\"], \"image/jxrs\": [\"jxrs\"], \"image/jxs\": [\"jxs\"], \"image/jxsc\": [\"jxsc\"], \"image/jxsi\": [\"jxsi\"], \"image/jxss\": [\"jxss\"], \"image/ktx\": [\"ktx\"], \"image/ktx2\": [\"ktx2\"], \"image/png\": [\"png\"], \"image/sgi\": [\"sgi\"], \"image/svg+xml\": [\"svg\", \"svgz\"], \"image/t38\": [\"t38\"], \"image/tiff\": [\"tif\", \"tiff\"], \"image/tiff-fx\": [\"tfx\"], \"image/webp\": [\"webp\"], \"image/wmf\": [\"wmf\"], \"message/disposition-notification\": [\"disposition-notification\"], \"message/global\": [\"u8msg\"], \"message/global-delivery-status\": [\"u8dsn\"], \"message/global-disposition-notification\": [\"u8mdn\"], \"message/global-headers\": [\"u8hdr\"], \"message/rfc822\": [\"eml\", \"mime\"], \"model/3mf\": [\"3mf\"], \"model/gltf+json\": [\"gltf\"], \"model/gltf-binary\": [\"glb\"], \"model/iges\": [\"igs\", \"iges\"], \"model/jt\": [\"jt\"], \"model/mesh\": [\"msh\", \"mesh\", \"silo\"], \"model/mtl\": [\"mtl\"], \"model/obj\": [\"obj\"], \"model/prc\": [\"prc\"], \"model/step+xml\": [\"stpx\"], \"model/step+zip\": [\"stpz\"], \"model/step-xml+zip\": [\"stpxz\"], \"model/stl\": [\"stl\"], \"model/u3d\": [\"u3d\"], \"model/vrml\": [\"wrl\", \"vrml\"], \"model/x3d+binary\": [\"*x3db\", \"x3dbz\"], \"model/x3d+fastinfoset\": [\"x3db\"], \"model/x3d+vrml\": [\"*x3dv\", \"x3dvz\"], \"model/x3d+xml\": [\"x3d\", \"x3dz\"], \"model/x3d-vrml\": [\"x3dv\"], \"text/cache-manifest\": [\"appcache\", \"manifest\"], \"text/calendar\": [\"ics\", \"ifb\"], \"text/coffeescript\": [\"coffee\", \"litcoffee\"], \"text/css\": [\"css\"], \"text/csv\": [\"csv\"], \"text/html\": [\"html\", \"htm\", \"shtml\"], \"text/jade\": [\"jade\"], \"text/javascript\": [\"js\", \"mjs\"], \"text/jsx\": [\"jsx\"], \"text/less\": [\"less\"], \"text/markdown\": [\"md\", \"markdown\"], \"text/mathml\": [\"mml\"], \"text/mdx\": [\"mdx\"], \"text/n3\": [\"n3\"], \"text/plain\": [\"txt\", \"text\", \"conf\", \"def\", \"list\", \"log\", \"in\", \"ini\"], \"text/richtext\": [\"rtx\"], \"text/rtf\": [\"*rtf\"], \"text/sgml\": [\"sgml\", \"sgm\"], \"text/shex\": [\"shex\"], \"text/slim\": [\"slim\", \"slm\"], \"text/spdx\": [\"spdx\"], \"text/stylus\": [\"stylus\", \"styl\"], \"text/tab-separated-values\": [\"tsv\"], \"text/troff\": [\"t\", \"tr\", \"roff\", \"man\", \"me\", \"ms\"], \"text/turtle\": [\"ttl\"], \"text/uri-list\": [\"uri\", \"uris\", \"urls\"], \"text/vcard\": [\"vcard\"], \"text/vtt\": [\"vtt\"], \"text/wgsl\": [\"wgsl\"], \"text/xml\": [\"*xml\"], \"text/yaml\": [\"yaml\", \"yml\"], \"video/3gpp\": [\"3gp\", \"3gpp\"], \"video/3gpp2\": [\"3g2\"], \"video/h261\": [\"h261\"], \"video/h263\": [\"h263\"], \"video/h264\": [\"h264\"], \"video/iso.segment\": [\"m4s\"], \"video/jpeg\": [\"jpgv\"], \"video/jpm\": [\"*jpm\", \"*jpgm\"], \"video/mj2\": [\"mj2\", \"mjp2\"], \"video/mp2t\": [\"ts\"], \"video/mp4\": [\"mp4\", \"mp4v\", \"mpg4\"], \"video/mpeg\": [\"mpeg\", \"mpg\", \"mpe\", \"m1v\", \"m2v\"], \"video/ogg\": [\"ogv\"], \"video/quicktime\": [\"qt\", \"mov\"], \"video/webm\": [\"webm\"] };\nObject.freeze(types);\nexport default types;\n//# sourceMappingURL=standard.js.map","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _Mime_extensionToType, _Mime_typeToExtension, _Mime_typeToExtensions;\nclass Mime {\n constructor(...args) {\n _Mime_extensionToType.set(this, new Map());\n _Mime_typeToExtension.set(this, new Map());\n _Mime_typeToExtensions.set(this, new Map());\n for (const arg of args) {\n this.define(arg);\n }\n }\n define(typeMap, force = false) {\n for (let [type, extensions] of Object.entries(typeMap)) {\n type = type.toLowerCase();\n extensions = extensions.map((ext) => ext.toLowerCase());\n if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").has(type)) {\n __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").set(type, new Set());\n }\n const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type);\n let first = true;\n for (let extension of extensions) {\n const starred = extension.startsWith('*');\n extension = starred ? extension.slice(1) : extension;\n allExtensions?.add(extension);\n if (first) {\n __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").set(type, extension);\n }\n first = false;\n if (starred)\n continue;\n const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(extension);\n if (currentType && currentType != type && !force) {\n throw new Error(`\"${type} -> ${extension}\" conflicts with \"${currentType} -> ${extension}\". Pass \\`force=true\\` to override this definition.`);\n }\n __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").set(extension, type);\n }\n }\n return this;\n }\n getType(path) {\n if (typeof path !== 'string')\n return null;\n const last = path.replace(/^.*[/\\\\]/, '').toLowerCase();\n const ext = last.replace(/^.*\\./, '').toLowerCase();\n const hasPath = last.length < path.length;\n const hasDot = ext.length < last.length - 1;\n if (!hasDot && hasPath)\n return null;\n return __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(ext) ?? null;\n }\n getExtension(type) {\n if (typeof type !== 'string')\n return null;\n type = type?.split?.(';')[0];\n return ((type && __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").get(type.trim().toLowerCase())) ?? null);\n }\n getAllExtensions(type) {\n if (typeof type !== 'string')\n return null;\n return __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type.toLowerCase()) ?? null;\n }\n _freeze() {\n this.define = () => {\n throw new Error('define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances');\n };\n Object.freeze(this);\n for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").values()) {\n Object.freeze(extensions);\n }\n return this;\n }\n _getTestState() {\n return {\n types: __classPrivateFieldGet(this, _Mime_extensionToType, \"f\"),\n extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\"),\n };\n }\n}\n_Mime_extensionToType = new WeakMap(), _Mime_typeToExtension = new WeakMap(), _Mime_typeToExtensions = new WeakMap();\nexport default Mime;\n//# sourceMappingURL=Mime.js.map","import standardTypes from '../types/standard.js';\nimport Mime from './Mime.js';\nexport { default as Mime } from './Mime.js';\nexport default new Mime(standardTypes)._freeze();\n//# sourceMappingURL=index_lite.js.map","'use strict';\n\nconst WIN_SLASH = '\\\\\\\\/';\nconst WIN_NO_SLASH = `[^${WIN_SLASH}]`;\n\n/**\n * Posix glob regex\n */\n\nconst DOT_LITERAL = '\\\\.';\nconst PLUS_LITERAL = '\\\\+';\nconst QMARK_LITERAL = '\\\\?';\nconst SLASH_LITERAL = '\\\\/';\nconst ONE_CHAR = '(?=.)';\nconst QMARK = '[^/]';\nconst END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;\nconst START_ANCHOR = `(?:^|${SLASH_LITERAL})`;\nconst DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;\nconst NO_DOT = `(?!${DOT_LITERAL})`;\nconst NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;\nconst NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;\nconst NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;\nconst QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;\nconst STAR = `${QMARK}*?`;\nconst SEP = '/';\n\nconst POSIX_CHARS = {\n DOT_LITERAL,\n PLUS_LITERAL,\n QMARK_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n QMARK,\n END_ANCHOR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOTS,\n NO_DOT_SLASH,\n NO_DOTS_SLASH,\n QMARK_NO_DOT,\n STAR,\n START_ANCHOR,\n SEP\n};\n\n/**\n * Windows glob regex\n */\n\nconst WINDOWS_CHARS = {\n ...POSIX_CHARS,\n\n SLASH_LITERAL: `[${WIN_SLASH}]`,\n QMARK: WIN_NO_SLASH,\n STAR: `${WIN_NO_SLASH}*?`,\n DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,\n NO_DOT: `(?!${DOT_LITERAL})`,\n NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,\n NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n QMARK_NO_DOT: `[^.${WIN_SLASH}]`,\n START_ANCHOR: `(?:^|[${WIN_SLASH}])`,\n END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,\n SEP: '\\\\'\n};\n\n/**\n * POSIX Bracket Regex\n */\n\nconst POSIX_REGEX_SOURCE = {\n alnum: 'a-zA-Z0-9',\n alpha: 'a-zA-Z',\n ascii: '\\\\x00-\\\\x7F',\n blank: ' \\\\t',\n cntrl: '\\\\x00-\\\\x1F\\\\x7F',\n digit: '0-9',\n graph: '\\\\x21-\\\\x7E',\n lower: 'a-z',\n print: '\\\\x20-\\\\x7E ',\n punct: '\\\\-!\"#$%&\\'()\\\\*+,./:;<=>?@[\\\\]^_`{|}~',\n space: ' \\\\t\\\\r\\\\n\\\\v\\\\f',\n upper: 'A-Z',\n word: 'A-Za-z0-9_',\n xdigit: 'A-Fa-f0-9'\n};\n\nmodule.exports = {\n MAX_LENGTH: 1024 * 64,\n POSIX_REGEX_SOURCE,\n\n // regular expressions\n REGEX_BACKSLASH: /\\\\(?![*+?^${}(|)[\\]])/g,\n REGEX_NON_SPECIAL_CHARS: /^[^@![\\].,$*+?^{}()|\\\\/]+/,\n REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\\]]/,\n REGEX_SPECIAL_CHARS_BACKREF: /(\\\\?)((\\W)(\\3*))/g,\n REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\\]])/g,\n REGEX_REMOVE_BACKSLASH: /(?:\\[.*?[^\\\\]\\]|\\\\(?=.))/g,\n\n // Replace globs with equivalent patterns to reduce parsing time.\n REPLACEMENTS: {\n '***': '*',\n '**/**': '**',\n '**/**/**': '**'\n },\n\n // Digits\n CHAR_0: 48, /* 0 */\n CHAR_9: 57, /* 9 */\n\n // Alphabet chars.\n CHAR_UPPERCASE_A: 65, /* A */\n CHAR_LOWERCASE_A: 97, /* a */\n CHAR_UPPERCASE_Z: 90, /* Z */\n CHAR_LOWERCASE_Z: 122, /* z */\n\n CHAR_LEFT_PARENTHESES: 40, /* ( */\n CHAR_RIGHT_PARENTHESES: 41, /* ) */\n\n CHAR_ASTERISK: 42, /* * */\n\n // Non-alphabetic chars.\n CHAR_AMPERSAND: 38, /* & */\n CHAR_AT: 64, /* @ */\n CHAR_BACKWARD_SLASH: 92, /* \\ */\n CHAR_CARRIAGE_RETURN: 13, /* \\r */\n CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */\n CHAR_COLON: 58, /* : */\n CHAR_COMMA: 44, /* , */\n CHAR_DOT: 46, /* . */\n CHAR_DOUBLE_QUOTE: 34, /* \" */\n CHAR_EQUAL: 61, /* = */\n CHAR_EXCLAMATION_MARK: 33, /* ! */\n CHAR_FORM_FEED: 12, /* \\f */\n CHAR_FORWARD_SLASH: 47, /* / */\n CHAR_GRAVE_ACCENT: 96, /* ` */\n CHAR_HASH: 35, /* # */\n CHAR_HYPHEN_MINUS: 45, /* - */\n CHAR_LEFT_ANGLE_BRACKET: 60, /* < */\n CHAR_LEFT_CURLY_BRACE: 123, /* { */\n CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */\n CHAR_LINE_FEED: 10, /* \\n */\n CHAR_NO_BREAK_SPACE: 160, /* \\u00A0 */\n CHAR_PERCENT: 37, /* % */\n CHAR_PLUS: 43, /* + */\n CHAR_QUESTION_MARK: 63, /* ? */\n CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */\n CHAR_RIGHT_CURLY_BRACE: 125, /* } */\n CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */\n CHAR_SEMICOLON: 59, /* ; */\n CHAR_SINGLE_QUOTE: 39, /* ' */\n CHAR_SPACE: 32, /* */\n CHAR_TAB: 9, /* \\t */\n CHAR_UNDERSCORE: 95, /* _ */\n CHAR_VERTICAL_LINE: 124, /* | */\n CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \\uFEFF */\n\n /**\n * Create EXTGLOB_CHARS\n */\n\n extglobChars(chars) {\n return {\n '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },\n '?': { type: 'qmark', open: '(?:', close: ')?' },\n '+': { type: 'plus', open: '(?:', close: ')+' },\n '*': { type: 'star', open: '(?:', close: ')*' },\n '@': { type: 'at', open: '(?:', close: ')' }\n };\n },\n\n /**\n * Create GLOB_CHARS\n */\n\n globChars(win32) {\n return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;\n }\n};\n","/*global navigator*/\n'use strict';\n\nconst {\n REGEX_BACKSLASH,\n REGEX_REMOVE_BACKSLASH,\n REGEX_SPECIAL_CHARS,\n REGEX_SPECIAL_CHARS_GLOBAL\n} = require('./constants');\n\nexports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);\nexports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);\nexports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);\nexports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\\\$1');\nexports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');\n\nexports.isWindows = () => {\n if (typeof navigator !== 'undefined' && navigator.platform) {\n const platform = navigator.platform.toLowerCase();\n return platform === 'win32' || platform === 'windows';\n }\n\n if (typeof process !== 'undefined' && process.platform) {\n return process.platform === 'win32';\n }\n\n return false;\n};\n\nexports.removeBackslashes = str => {\n return str.replace(REGEX_REMOVE_BACKSLASH, match => {\n return match === '\\\\' ? '' : match;\n });\n};\n\nexports.escapeLast = (input, char, lastIdx) => {\n const idx = input.lastIndexOf(char, lastIdx);\n if (idx === -1) return input;\n if (input[idx - 1] === '\\\\') return exports.escapeLast(input, char, idx - 1);\n return `${input.slice(0, idx)}\\\\${input.slice(idx)}`;\n};\n\nexports.removePrefix = (input, state = {}) => {\n let output = input;\n if (output.startsWith('./')) {\n output = output.slice(2);\n state.prefix = './';\n }\n return output;\n};\n\nexports.wrapOutput = (input, state = {}, options = {}) => {\n const prepend = options.contains ? '' : '^';\n const append = options.contains ? '' : '$';\n\n let output = `${prepend}(?:${input})${append}`;\n if (state.negated === true) {\n output = `(?:^(?!${output}).*$)`;\n }\n return output;\n};\n\nexports.basename = (path, { windows } = {}) => {\n const segs = path.split(windows ? /[\\\\/]/ : '/');\n const last = segs[segs.length - 1];\n\n if (last === '') {\n return segs[segs.length - 2];\n }\n\n return last;\n};\n","'use strict';\n\nconst utils = require('./utils');\nconst {\n CHAR_ASTERISK, /* * */\n CHAR_AT, /* @ */\n CHAR_BACKWARD_SLASH, /* \\ */\n CHAR_COMMA, /* , */\n CHAR_DOT, /* . */\n CHAR_EXCLAMATION_MARK, /* ! */\n CHAR_FORWARD_SLASH, /* / */\n CHAR_LEFT_CURLY_BRACE, /* { */\n CHAR_LEFT_PARENTHESES, /* ( */\n CHAR_LEFT_SQUARE_BRACKET, /* [ */\n CHAR_PLUS, /* + */\n CHAR_QUESTION_MARK, /* ? */\n CHAR_RIGHT_CURLY_BRACE, /* } */\n CHAR_RIGHT_PARENTHESES, /* ) */\n CHAR_RIGHT_SQUARE_BRACKET /* ] */\n} = require('./constants');\n\nconst isPathSeparator = code => {\n return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n};\n\nconst depth = token => {\n if (token.isPrefix !== true) {\n token.depth = token.isGlobstar ? Infinity : 1;\n }\n};\n\n/**\n * Quickly scans a glob pattern and returns an object with a handful of\n * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),\n * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not\n * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).\n *\n * ```js\n * const pm = require('picomatch');\n * console.log(pm.scan('foo/bar/*.js'));\n * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }\n * ```\n * @param {String} `str`\n * @param {Object} `options`\n * @return {Object} Returns an object with tokens and regex source string.\n * @api public\n */\n\nconst scan = (input, options) => {\n const opts = options || {};\n\n const length = input.length - 1;\n const scanToEnd = opts.parts === true || opts.scanToEnd === true;\n const slashes = [];\n const tokens = [];\n const parts = [];\n\n let str = input;\n let index = -1;\n let start = 0;\n let lastIndex = 0;\n let isBrace = false;\n let isBracket = false;\n let isGlob = false;\n let isExtglob = false;\n let isGlobstar = false;\n let braceEscaped = false;\n let backslashes = false;\n let negated = false;\n let negatedExtglob = false;\n let finished = false;\n let braces = 0;\n let prev;\n let code;\n let token = { value: '', depth: 0, isGlob: false };\n\n const eos = () => index >= length;\n const peek = () => str.charCodeAt(index + 1);\n const advance = () => {\n prev = code;\n return str.charCodeAt(++index);\n };\n\n while (index < length) {\n code = advance();\n let next;\n\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braceEscaped = true;\n }\n continue;\n }\n\n if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n continue;\n }\n\n if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (braceEscaped !== true && code === CHAR_COMMA) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_RIGHT_CURLY_BRACE) {\n braces--;\n\n if (braces === 0) {\n braceEscaped = false;\n isBrace = token.isBrace = true;\n finished = true;\n break;\n }\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_FORWARD_SLASH) {\n slashes.push(index);\n tokens.push(token);\n token = { value: '', depth: 0, isGlob: false };\n\n if (finished === true) continue;\n if (prev === CHAR_DOT && index === (start + 1)) {\n start += 2;\n continue;\n }\n\n lastIndex = index + 1;\n continue;\n }\n\n if (opts.noext !== true) {\n const isExtglobChar = code === CHAR_PLUS\n || code === CHAR_AT\n || code === CHAR_ASTERISK\n || code === CHAR_QUESTION_MARK\n || code === CHAR_EXCLAMATION_MARK;\n\n if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n isExtglob = token.isExtglob = true;\n finished = true;\n if (code === CHAR_EXCLAMATION_MARK && index === start) {\n negatedExtglob = true;\n }\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n }\n\n if (code === CHAR_ASTERISK) {\n if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_QUESTION_MARK) {\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_LEFT_SQUARE_BRACKET) {\n while (eos() !== true && (next = advance())) {\n if (next === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (next === CHAR_RIGHT_SQUARE_BRACKET) {\n isBracket = token.isBracket = true;\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {\n negated = token.negated = true;\n start++;\n continue;\n }\n\n if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_LEFT_PARENTHESES) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n\n if (isGlob === true) {\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n }\n\n if (opts.noext === true) {\n isExtglob = false;\n isGlob = false;\n }\n\n let base = str;\n let prefix = '';\n let glob = '';\n\n if (start > 0) {\n prefix = str.slice(0, start);\n str = str.slice(start);\n lastIndex -= start;\n }\n\n if (base && isGlob === true && lastIndex > 0) {\n base = str.slice(0, lastIndex);\n glob = str.slice(lastIndex);\n } else if (isGlob === true) {\n base = '';\n glob = str;\n } else {\n base = str;\n }\n\n if (base && base !== '' && base !== '/' && base !== str) {\n if (isPathSeparator(base.charCodeAt(base.length - 1))) {\n base = base.slice(0, -1);\n }\n }\n\n if (opts.unescape === true) {\n if (glob) glob = utils.removeBackslashes(glob);\n\n if (base && backslashes === true) {\n base = utils.removeBackslashes(base);\n }\n }\n\n const state = {\n prefix,\n input,\n start,\n base,\n glob,\n isBrace,\n isBracket,\n isGlob,\n isExtglob,\n isGlobstar,\n negated,\n negatedExtglob\n };\n\n if (opts.tokens === true) {\n state.maxDepth = 0;\n if (!isPathSeparator(code)) {\n tokens.push(token);\n }\n state.tokens = tokens;\n }\n\n if (opts.parts === true || opts.tokens === true) {\n let prevIndex;\n\n for (let idx = 0; idx < slashes.length; idx++) {\n const n = prevIndex ? prevIndex + 1 : start;\n const i = slashes[idx];\n const value = input.slice(n, i);\n if (opts.tokens) {\n if (idx === 0 && start !== 0) {\n tokens[idx].isPrefix = true;\n tokens[idx].value = prefix;\n } else {\n tokens[idx].value = value;\n }\n depth(tokens[idx]);\n state.maxDepth += tokens[idx].depth;\n }\n if (idx !== 0 || value !== '') {\n parts.push(value);\n }\n prevIndex = i;\n }\n\n if (prevIndex && prevIndex + 1 < input.length) {\n const value = input.slice(prevIndex + 1);\n parts.push(value);\n\n if (opts.tokens) {\n tokens[tokens.length - 1].value = value;\n depth(tokens[tokens.length - 1]);\n state.maxDepth += tokens[tokens.length - 1].depth;\n }\n }\n\n state.slashes = slashes;\n state.parts = parts;\n }\n\n return state;\n};\n\nmodule.exports = scan;\n","'use strict';\n\nconst constants = require('./constants');\nconst utils = require('./utils');\n\n/**\n * Constants\n */\n\nconst {\n MAX_LENGTH,\n POSIX_REGEX_SOURCE,\n REGEX_NON_SPECIAL_CHARS,\n REGEX_SPECIAL_CHARS_BACKREF,\n REPLACEMENTS\n} = constants;\n\n/**\n * Helpers\n */\n\nconst expandRange = (args, options) => {\n if (typeof options.expandRange === 'function') {\n return options.expandRange(...args, options);\n }\n\n args.sort();\n const value = `[${args.join('-')}]`;\n\n try {\n /* eslint-disable-next-line no-new */\n new RegExp(value);\n } catch (ex) {\n return args.map(v => utils.escapeRegex(v)).join('..');\n }\n\n return value;\n};\n\n/**\n * Create the message for a syntax error\n */\n\nconst syntaxError = (type, char) => {\n return `Missing ${type}: \"${char}\" - use \"\\\\\\\\${char}\" to match literal characters`;\n};\n\n/**\n * Parse the given input string.\n * @param {String} input\n * @param {Object} options\n * @return {Object}\n */\n\nconst parse = (input, options) => {\n if (typeof input !== 'string') {\n throw new TypeError('Expected a string');\n }\n\n input = REPLACEMENTS[input] || input;\n\n const opts = { ...options };\n const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n\n let len = input.length;\n if (len > max) {\n throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n }\n\n const bos = { type: 'bos', value: '', output: opts.prepend || '' };\n const tokens = [bos];\n\n const capture = opts.capture ? '' : '?:';\n\n // create constants based on platform, for windows or posix\n const PLATFORM_CHARS = constants.globChars(opts.windows);\n const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);\n\n const {\n DOT_LITERAL,\n PLUS_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOT_SLASH,\n NO_DOTS_SLASH,\n QMARK,\n QMARK_NO_DOT,\n STAR,\n START_ANCHOR\n } = PLATFORM_CHARS;\n\n const globstar = opts => {\n return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n };\n\n const nodot = opts.dot ? '' : NO_DOT;\n const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;\n let star = opts.bash === true ? globstar(opts) : STAR;\n\n if (opts.capture) {\n star = `(${star})`;\n }\n\n // minimatch options support\n if (typeof opts.noext === 'boolean') {\n opts.noextglob = opts.noext;\n }\n\n const state = {\n input,\n index: -1,\n start: 0,\n dot: opts.dot === true,\n consumed: '',\n output: '',\n prefix: '',\n backtrack: false,\n negated: false,\n brackets: 0,\n braces: 0,\n parens: 0,\n quotes: 0,\n globstar: false,\n tokens\n };\n\n input = utils.removePrefix(input, state);\n len = input.length;\n\n const extglobs = [];\n const braces = [];\n const stack = [];\n let prev = bos;\n let value;\n\n /**\n * Tokenizing helpers\n */\n\n const eos = () => state.index === len - 1;\n const peek = state.peek = (n = 1) => input[state.index + n];\n const advance = state.advance = () => input[++state.index] || '';\n const remaining = () => input.slice(state.index + 1);\n const consume = (value = '', num = 0) => {\n state.consumed += value;\n state.index += num;\n };\n\n const append = token => {\n state.output += token.output != null ? token.output : token.value;\n consume(token.value);\n };\n\n const negate = () => {\n let count = 1;\n\n while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {\n advance();\n state.start++;\n count++;\n }\n\n if (count % 2 === 0) {\n return false;\n }\n\n state.negated = true;\n state.start++;\n return true;\n };\n\n const increment = type => {\n state[type]++;\n stack.push(type);\n };\n\n const decrement = type => {\n state[type]--;\n stack.pop();\n };\n\n /**\n * Push tokens onto the tokens array. This helper speeds up\n * tokenizing by 1) helping us avoid backtracking as much as possible,\n * and 2) helping us avoid creating extra tokens when consecutive\n * characters are plain text. This improves performance and simplifies\n * lookbehinds.\n */\n\n const push = tok => {\n if (prev.type === 'globstar') {\n const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');\n const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));\n\n if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {\n state.output = state.output.slice(0, -prev.output.length);\n prev.type = 'star';\n prev.value = '*';\n prev.output = star;\n state.output += prev.output;\n }\n }\n\n if (extglobs.length && tok.type !== 'paren') {\n extglobs[extglobs.length - 1].inner += tok.value;\n }\n\n if (tok.value || tok.output) append(tok);\n if (prev && prev.type === 'text' && tok.type === 'text') {\n prev.output = (prev.output || prev.value) + tok.value;\n prev.value += tok.value;\n return;\n }\n\n tok.prev = prev;\n tokens.push(tok);\n prev = tok;\n };\n\n const extglobOpen = (type, value) => {\n const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };\n\n token.prev = prev;\n token.parens = state.parens;\n token.output = state.output;\n const output = (opts.capture ? '(' : '') + token.open;\n\n increment('parens');\n push({ type, value, output: state.output ? '' : ONE_CHAR });\n push({ type: 'paren', extglob: true, value: advance(), output });\n extglobs.push(token);\n };\n\n const extglobClose = token => {\n let output = token.close + (opts.capture ? ')' : '');\n let rest;\n\n if (token.type === 'negate') {\n let extglobStar = star;\n\n if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {\n extglobStar = globstar(opts);\n }\n\n if (extglobStar !== star || eos() || /^\\)+$/.test(remaining())) {\n output = token.close = `)$))${extglobStar}`;\n }\n\n if (token.inner.includes('*') && (rest = remaining()) && /^\\.[^\\\\/.]+$/.test(rest)) {\n // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.\n // In this case, we need to parse the string and use it in the output of the original pattern.\n // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.\n //\n // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.\n const expression = parse(rest, { ...options, fastpaths: false }).output;\n\n output = token.close = `)${expression})${extglobStar})`;\n }\n\n if (token.prev.type === 'bos') {\n state.negatedExtglob = true;\n }\n }\n\n push({ type: 'paren', extglob: true, value, output });\n decrement('parens');\n };\n\n /**\n * Fast paths\n */\n\n if (opts.fastpaths !== false && !/(^[*!]|[/()[\\]{}\"])/.test(input)) {\n let backslashes = false;\n\n let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {\n if (first === '\\\\') {\n backslashes = true;\n return m;\n }\n\n if (first === '?') {\n if (esc) {\n return esc + first + (rest ? QMARK.repeat(rest.length) : '');\n }\n if (index === 0) {\n return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');\n }\n return QMARK.repeat(chars.length);\n }\n\n if (first === '.') {\n return DOT_LITERAL.repeat(chars.length);\n }\n\n if (first === '*') {\n if (esc) {\n return esc + first + (rest ? star : '');\n }\n return star;\n }\n return esc ? m : `\\\\${m}`;\n });\n\n if (backslashes === true) {\n if (opts.unescape === true) {\n output = output.replace(/\\\\/g, '');\n } else {\n output = output.replace(/\\\\+/g, m => {\n return m.length % 2 === 0 ? '\\\\\\\\' : (m ? '\\\\' : '');\n });\n }\n }\n\n if (output === input && opts.contains === true) {\n state.output = input;\n return state;\n }\n\n state.output = utils.wrapOutput(output, state, options);\n return state;\n }\n\n /**\n * Tokenize input until we reach end-of-string\n */\n\n while (!eos()) {\n value = advance();\n\n if (value === '\\u0000') {\n continue;\n }\n\n /**\n * Escaped characters\n */\n\n if (value === '\\\\') {\n const next = peek();\n\n if (next === '/' && opts.bash !== true) {\n continue;\n }\n\n if (next === '.' || next === ';') {\n continue;\n }\n\n if (!next) {\n value += '\\\\';\n push({ type: 'text', value });\n continue;\n }\n\n // collapse slashes to reduce potential for exploits\n const match = /^\\\\+/.exec(remaining());\n let slashes = 0;\n\n if (match && match[0].length > 2) {\n slashes = match[0].length;\n state.index += slashes;\n if (slashes % 2 !== 0) {\n value += '\\\\';\n }\n }\n\n if (opts.unescape === true) {\n value = advance();\n } else {\n value += advance();\n }\n\n if (state.brackets === 0) {\n push({ type: 'text', value });\n continue;\n }\n }\n\n /**\n * If we're inside a regex character class, continue\n * until we reach the closing bracket.\n */\n\n if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {\n if (opts.posix !== false && value === ':') {\n const inner = prev.value.slice(1);\n if (inner.includes('[')) {\n prev.posix = true;\n\n if (inner.includes(':')) {\n const idx = prev.value.lastIndexOf('[');\n const pre = prev.value.slice(0, idx);\n const rest = prev.value.slice(idx + 2);\n const posix = POSIX_REGEX_SOURCE[rest];\n if (posix) {\n prev.value = pre + posix;\n state.backtrack = true;\n advance();\n\n if (!bos.output && tokens.indexOf(prev) === 1) {\n bos.output = ONE_CHAR;\n }\n continue;\n }\n }\n }\n }\n\n if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {\n value = `\\\\${value}`;\n }\n\n if (value === ']' && (prev.value === '[' || prev.value === '[^')) {\n value = `\\\\${value}`;\n }\n\n if (opts.posix === true && value === '!' && prev.value === '[') {\n value = '^';\n }\n\n prev.value += value;\n append({ value });\n continue;\n }\n\n /**\n * If we're inside a quoted string, continue\n * until we reach the closing double quote.\n */\n\n if (state.quotes === 1 && value !== '\"') {\n value = utils.escapeRegex(value);\n prev.value += value;\n append({ value });\n continue;\n }\n\n /**\n * Double quotes\n */\n\n if (value === '\"') {\n state.quotes = state.quotes === 1 ? 0 : 1;\n if (opts.keepQuotes === true) {\n push({ type: 'text', value });\n }\n continue;\n }\n\n /**\n * Parentheses\n */\n\n if (value === '(') {\n increment('parens');\n push({ type: 'paren', value });\n continue;\n }\n\n if (value === ')') {\n if (state.parens === 0 && opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('opening', '('));\n }\n\n const extglob = extglobs[extglobs.length - 1];\n if (extglob && state.parens === extglob.parens + 1) {\n extglobClose(extglobs.pop());\n continue;\n }\n\n push({ type: 'paren', value, output: state.parens ? ')' : '\\\\)' });\n decrement('parens');\n continue;\n }\n\n /**\n * Square brackets\n */\n\n if (value === '[') {\n if (opts.nobracket === true || !remaining().includes(']')) {\n if (opts.nobracket !== true && opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('closing', ']'));\n }\n\n value = `\\\\${value}`;\n } else {\n increment('brackets');\n }\n\n push({ type: 'bracket', value });\n continue;\n }\n\n if (value === ']') {\n if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {\n push({ type: 'text', value, output: `\\\\${value}` });\n continue;\n }\n\n if (state.brackets === 0) {\n if (opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('opening', '['));\n }\n\n push({ type: 'text', value, output: `\\\\${value}` });\n continue;\n }\n\n decrement('brackets');\n\n const prevValue = prev.value.slice(1);\n if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {\n value = `/${value}`;\n }\n\n prev.value += value;\n append({ value });\n\n // when literal brackets are explicitly disabled\n // assume we should match with a regex character class\n if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {\n continue;\n }\n\n const escaped = utils.escapeRegex(prev.value);\n state.output = state.output.slice(0, -prev.value.length);\n\n // when literal brackets are explicitly enabled\n // assume we should escape the brackets to match literal characters\n if (opts.literalBrackets === true) {\n state.output += escaped;\n prev.value = escaped;\n continue;\n }\n\n // when the user specifies nothing, try to match both\n prev.value = `(${capture}${escaped}|${prev.value})`;\n state.output += prev.value;\n continue;\n }\n\n /**\n * Braces\n */\n\n if (value === '{' && opts.nobrace !== true) {\n increment('braces');\n\n const open = {\n type: 'brace',\n value,\n output: '(',\n outputIndex: state.output.length,\n tokensIndex: state.tokens.length\n };\n\n braces.push(open);\n push(open);\n continue;\n }\n\n if (value === '}') {\n const brace = braces[braces.length - 1];\n\n if (opts.nobrace === true || !brace) {\n push({ type: 'text', value, output: value });\n continue;\n }\n\n let output = ')';\n\n if (brace.dots === true) {\n const arr = tokens.slice();\n const range = [];\n\n for (let i = arr.length - 1; i >= 0; i--) {\n tokens.pop();\n if (arr[i].type === 'brace') {\n break;\n }\n if (arr[i].type !== 'dots') {\n range.unshift(arr[i].value);\n }\n }\n\n output = expandRange(range, opts);\n state.backtrack = true;\n }\n\n if (brace.comma !== true && brace.dots !== true) {\n const out = state.output.slice(0, brace.outputIndex);\n const toks = state.tokens.slice(brace.tokensIndex);\n brace.value = brace.output = '\\\\{';\n value = output = '\\\\}';\n state.output = out;\n for (const t of toks) {\n state.output += (t.output || t.value);\n }\n }\n\n push({ type: 'brace', value, output });\n decrement('braces');\n braces.pop();\n continue;\n }\n\n /**\n * Pipes\n */\n\n if (value === '|') {\n if (extglobs.length > 0) {\n extglobs[extglobs.length - 1].conditions++;\n }\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Commas\n */\n\n if (value === ',') {\n let output = value;\n\n const brace = braces[braces.length - 1];\n if (brace && stack[stack.length - 1] === 'braces') {\n brace.comma = true;\n output = '|';\n }\n\n push({ type: 'comma', value, output });\n continue;\n }\n\n /**\n * Slashes\n */\n\n if (value === '/') {\n // if the beginning of the glob is \"./\", advance the start\n // to the current index, and don't add the \"./\" characters\n // to the state. This greatly simplifies lookbehinds when\n // checking for BOS characters like \"!\" and \".\" (not \"./\")\n if (prev.type === 'dot' && state.index === state.start + 1) {\n state.start = state.index + 1;\n state.consumed = '';\n state.output = '';\n tokens.pop();\n prev = bos; // reset \"prev\" to the first token\n continue;\n }\n\n push({ type: 'slash', value, output: SLASH_LITERAL });\n continue;\n }\n\n /**\n * Dots\n */\n\n if (value === '.') {\n if (state.braces > 0 && prev.type === 'dot') {\n if (prev.value === '.') prev.output = DOT_LITERAL;\n const brace = braces[braces.length - 1];\n prev.type = 'dots';\n prev.output += value;\n prev.value += value;\n brace.dots = true;\n continue;\n }\n\n if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {\n push({ type: 'text', value, output: DOT_LITERAL });\n continue;\n }\n\n push({ type: 'dot', value, output: DOT_LITERAL });\n continue;\n }\n\n /**\n * Question marks\n */\n\n if (value === '?') {\n const isGroup = prev && prev.value === '(';\n if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n extglobOpen('qmark', value);\n continue;\n }\n\n if (prev && prev.type === 'paren') {\n const next = peek();\n let output = value;\n\n if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\\w+>)/.test(remaining()))) {\n output = `\\\\${value}`;\n }\n\n push({ type: 'text', value, output });\n continue;\n }\n\n if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {\n push({ type: 'qmark', value, output: QMARK_NO_DOT });\n continue;\n }\n\n push({ type: 'qmark', value, output: QMARK });\n continue;\n }\n\n /**\n * Exclamation\n */\n\n if (value === '!') {\n if (opts.noextglob !== true && peek() === '(') {\n if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {\n extglobOpen('negate', value);\n continue;\n }\n }\n\n if (opts.nonegate !== true && state.index === 0) {\n negate();\n continue;\n }\n }\n\n /**\n * Plus\n */\n\n if (value === '+') {\n if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n extglobOpen('plus', value);\n continue;\n }\n\n if ((prev && prev.value === '(') || opts.regex === false) {\n push({ type: 'plus', value, output: PLUS_LITERAL });\n continue;\n }\n\n if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {\n push({ type: 'plus', value });\n continue;\n }\n\n push({ type: 'plus', value: PLUS_LITERAL });\n continue;\n }\n\n /**\n * Plain text\n */\n\n if (value === '@') {\n if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n push({ type: 'at', extglob: true, value, output: '' });\n continue;\n }\n\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Plain text\n */\n\n if (value !== '*') {\n if (value === '$' || value === '^') {\n value = `\\\\${value}`;\n }\n\n const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());\n if (match) {\n value += match[0];\n state.index += match[0].length;\n }\n\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Stars\n */\n\n if (prev && (prev.type === 'globstar' || prev.star === true)) {\n prev.type = 'star';\n prev.star = true;\n prev.value += value;\n prev.output = star;\n state.backtrack = true;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n let rest = remaining();\n if (opts.noextglob !== true && /^\\([^?]/.test(rest)) {\n extglobOpen('star', value);\n continue;\n }\n\n if (prev.type === 'star') {\n if (opts.noglobstar === true) {\n consume(value);\n continue;\n }\n\n const prior = prev.prev;\n const before = prior.prev;\n const isStart = prior.type === 'slash' || prior.type === 'bos';\n const afterStar = before && (before.type === 'star' || before.type === 'globstar');\n\n if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {\n push({ type: 'star', value, output: '' });\n continue;\n }\n\n const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');\n const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');\n if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {\n push({ type: 'star', value, output: '' });\n continue;\n }\n\n // strip consecutive `/**/`\n while (rest.slice(0, 3) === '/**') {\n const after = input[state.index + 4];\n if (after && after !== '/') {\n break;\n }\n rest = rest.slice(3);\n consume('/**', 3);\n }\n\n if (prior.type === 'bos' && eos()) {\n prev.type = 'globstar';\n prev.value += value;\n prev.output = globstar(opts);\n state.output = prev.output;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {\n state.output = state.output.slice(0, -(prior.output + prev.output).length);\n prior.output = `(?:${prior.output}`;\n\n prev.type = 'globstar';\n prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');\n prev.value += value;\n state.globstar = true;\n state.output += prior.output + prev.output;\n consume(value);\n continue;\n }\n\n if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {\n const end = rest[1] !== void 0 ? '|$' : '';\n\n state.output = state.output.slice(0, -(prior.output + prev.output).length);\n prior.output = `(?:${prior.output}`;\n\n prev.type = 'globstar';\n prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;\n prev.value += value;\n\n state.output += prior.output + prev.output;\n state.globstar = true;\n\n consume(value + advance());\n\n push({ type: 'slash', value: '/', output: '' });\n continue;\n }\n\n if (prior.type === 'bos' && rest[0] === '/') {\n prev.type = 'globstar';\n prev.value += value;\n prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;\n state.output = prev.output;\n state.globstar = true;\n consume(value + advance());\n push({ type: 'slash', value: '/', output: '' });\n continue;\n }\n\n // remove single star from output\n state.output = state.output.slice(0, -prev.output.length);\n\n // reset previous token to globstar\n prev.type = 'globstar';\n prev.output = globstar(opts);\n prev.value += value;\n\n // reset output with globstar\n state.output += prev.output;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n const token = { type: 'star', value, output: star };\n\n if (opts.bash === true) {\n token.output = '.*?';\n if (prev.type === 'bos' || prev.type === 'slash') {\n token.output = nodot + token.output;\n }\n push(token);\n continue;\n }\n\n if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {\n token.output = value;\n push(token);\n continue;\n }\n\n if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {\n if (prev.type === 'dot') {\n state.output += NO_DOT_SLASH;\n prev.output += NO_DOT_SLASH;\n\n } else if (opts.dot === true) {\n state.output += NO_DOTS_SLASH;\n prev.output += NO_DOTS_SLASH;\n\n } else {\n state.output += nodot;\n prev.output += nodot;\n }\n\n if (peek() !== '*') {\n state.output += ONE_CHAR;\n prev.output += ONE_CHAR;\n }\n }\n\n push(token);\n }\n\n while (state.brackets > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));\n state.output = utils.escapeLast(state.output, '[');\n decrement('brackets');\n }\n\n while (state.parens > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));\n state.output = utils.escapeLast(state.output, '(');\n decrement('parens');\n }\n\n while (state.braces > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));\n state.output = utils.escapeLast(state.output, '{');\n decrement('braces');\n }\n\n if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {\n push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });\n }\n\n // rebuild the output if we had to backtrack at any point\n if (state.backtrack === true) {\n state.output = '';\n\n for (const token of state.tokens) {\n state.output += token.output != null ? token.output : token.value;\n\n if (token.suffix) {\n state.output += token.suffix;\n }\n }\n }\n\n return state;\n};\n\n/**\n * Fast paths for creating regular expressions for common glob patterns.\n * This can significantly speed up processing and has very little downside\n * impact when none of the fast paths match.\n */\n\nparse.fastpaths = (input, options) => {\n const opts = { ...options };\n const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n const len = input.length;\n if (len > max) {\n throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n }\n\n input = REPLACEMENTS[input] || input;\n\n // create constants based on platform, for windows or posix\n const {\n DOT_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOTS,\n NO_DOTS_SLASH,\n STAR,\n START_ANCHOR\n } = constants.globChars(opts.windows);\n\n const nodot = opts.dot ? NO_DOTS : NO_DOT;\n const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;\n const capture = opts.capture ? '' : '?:';\n const state = { negated: false, prefix: '' };\n let star = opts.bash === true ? '.*?' : STAR;\n\n if (opts.capture) {\n star = `(${star})`;\n }\n\n const globstar = opts => {\n if (opts.noglobstar === true) return star;\n return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n };\n\n const create = str => {\n switch (str) {\n case '*':\n return `${nodot}${ONE_CHAR}${star}`;\n\n case '.*':\n return `${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '*.*':\n return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '*/*':\n return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;\n\n case '**':\n return nodot + globstar(opts);\n\n case '**/*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;\n\n case '**/*.*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '**/.*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n default: {\n const match = /^(.*?)\\.(\\w+)$/.exec(str);\n if (!match) return;\n\n const source = create(match[1]);\n if (!source) return;\n\n return source + DOT_LITERAL + match[2];\n }\n }\n };\n\n const output = utils.removePrefix(input, state);\n let source = create(output);\n\n if (source && opts.strictSlashes !== true) {\n source += `${SLASH_LITERAL}?`;\n }\n\n return source;\n};\n\nmodule.exports = parse;\n","'use strict';\n\nconst scan = require('./scan');\nconst parse = require('./parse');\nconst utils = require('./utils');\nconst constants = require('./constants');\nconst isObject = val => val && typeof val === 'object' && !Array.isArray(val);\n\n/**\n * Creates a matcher function from one or more glob patterns. The\n * returned function takes a string to match as its first argument,\n * and returns true if the string is a match. The returned matcher\n * function also takes a boolean as the second argument that, when true,\n * returns an object with additional information.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch(glob[, options]);\n *\n * const isMatch = picomatch('*.!(*a)');\n * console.log(isMatch('a.a')); //=> false\n * console.log(isMatch('a.b')); //=> true\n * ```\n * @name picomatch\n * @param {String|Array} `globs` One or more glob patterns.\n * @param {Object=} `options`\n * @return {Function=} Returns a matcher function.\n * @api public\n */\n\nconst picomatch = (glob, options, returnState = false) => {\n if (Array.isArray(glob)) {\n const fns = glob.map(input => picomatch(input, options, returnState));\n const arrayMatcher = str => {\n for (const isMatch of fns) {\n const state = isMatch(str);\n if (state) return state;\n }\n return false;\n };\n return arrayMatcher;\n }\n\n const isState = isObject(glob) && glob.tokens && glob.input;\n\n if (glob === '' || (typeof glob !== 'string' && !isState)) {\n throw new TypeError('Expected pattern to be a non-empty string');\n }\n\n const opts = options || {};\n const posix = opts.windows;\n const regex = isState\n ? picomatch.compileRe(glob, options)\n : picomatch.makeRe(glob, options, false, true);\n\n const state = regex.state;\n delete regex.state;\n\n let isIgnored = () => false;\n if (opts.ignore) {\n const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };\n isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);\n }\n\n const matcher = (input, returnObject = false) => {\n const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });\n const result = { glob, state, regex, posix, input, output, match, isMatch };\n\n if (typeof opts.onResult === 'function') {\n opts.onResult(result);\n }\n\n if (isMatch === false) {\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (isIgnored(input)) {\n if (typeof opts.onIgnore === 'function') {\n opts.onIgnore(result);\n }\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (typeof opts.onMatch === 'function') {\n opts.onMatch(result);\n }\n return returnObject ? result : true;\n };\n\n if (returnState) {\n matcher.state = state;\n }\n\n return matcher;\n};\n\n/**\n * Test `input` with the given `regex`. This is used by the main\n * `picomatch()` function to test the input string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.test(input, regex[, options]);\n *\n * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\\/([^/]*?))$/));\n * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp} `regex`\n * @return {Object} Returns an object with matching info.\n * @api public\n */\n\npicomatch.test = (input, regex, options, { glob, posix } = {}) => {\n if (typeof input !== 'string') {\n throw new TypeError('Expected input to be a string');\n }\n\n if (input === '') {\n return { isMatch: false, output: '' };\n }\n\n const opts = options || {};\n const format = opts.format || (posix ? utils.toPosixSlashes : null);\n let match = input === glob;\n let output = (match && format) ? format(input) : input;\n\n if (match === false) {\n output = format ? format(input) : input;\n match = output === glob;\n }\n\n if (match === false || opts.capture === true) {\n if (opts.matchBase === true || opts.basename === true) {\n match = picomatch.matchBase(input, regex, options, posix);\n } else {\n match = regex.exec(output);\n }\n }\n\n return { isMatch: Boolean(match), match, output };\n};\n\n/**\n * Match the basename of a filepath.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.matchBase(input, glob[, options]);\n * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).\n * @return {Boolean}\n * @api public\n */\n\npicomatch.matchBase = (input, glob, options) => {\n const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);\n return regex.test(utils.basename(input));\n};\n\n/**\n * Returns true if **any** of the given glob `patterns` match the specified `string`.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.isMatch(string, patterns[, options]);\n *\n * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true\n * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false\n * ```\n * @param {String|Array} str The string to test.\n * @param {String|Array} patterns One or more glob patterns to use for matching.\n * @param {Object} [options] See available [options](#options).\n * @return {Boolean} Returns true if any patterns match `str`\n * @api public\n */\n\npicomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);\n\n/**\n * Parse a glob pattern to create the source string for a regular\n * expression.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const result = picomatch.parse(pattern[, options]);\n * ```\n * @param {String} `pattern`\n * @param {Object} `options`\n * @return {Object} Returns an object with useful properties and output to be used as a regex source string.\n * @api public\n */\n\npicomatch.parse = (pattern, options) => {\n if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));\n return parse(pattern, { ...options, fastpaths: false });\n};\n\n/**\n * Scan a glob pattern to separate the pattern into segments.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.scan(input[, options]);\n *\n * const result = picomatch.scan('!./foo/*.js');\n * console.log(result);\n * { prefix: '!./',\n * input: '!./foo/*.js',\n * start: 3,\n * base: 'foo',\n * glob: '*.js',\n * isBrace: false,\n * isBracket: false,\n * isGlob: true,\n * isExtglob: false,\n * isGlobstar: false,\n * negated: true }\n * ```\n * @param {String} `input` Glob pattern to scan.\n * @param {Object} `options`\n * @return {Object} Returns an object with\n * @api public\n */\n\npicomatch.scan = (input, options) => scan(input, options);\n\n/**\n * Compile a regular expression from the `state` object returned by the\n * [parse()](#parse) method.\n *\n * @param {Object} `state`\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.\n * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.\n * @return {RegExp}\n * @api public\n */\n\npicomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {\n if (returnOutput === true) {\n return state.output;\n }\n\n const opts = options || {};\n const prepend = opts.contains ? '' : '^';\n const append = opts.contains ? '' : '$';\n\n let source = `${prepend}(?:${state.output})${append}`;\n if (state && state.negated === true) {\n source = `^(?!${source}).*$`;\n }\n\n const regex = picomatch.toRegex(source, options);\n if (returnState === true) {\n regex.state = state;\n }\n\n return regex;\n};\n\n/**\n * Create a regular expression from a parsed glob pattern.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const state = picomatch.parse('*.js');\n * // picomatch.compileRe(state[, options]);\n *\n * console.log(picomatch.compileRe(state));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `state` The object returned from the `.parse` method.\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.\n * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.\n * @return {RegExp} Returns a regex created from the given pattern.\n * @api public\n */\n\npicomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {\n if (!input || typeof input !== 'string') {\n throw new TypeError('Expected a non-empty string');\n }\n\n let parsed = { negated: false, fastpaths: true };\n\n if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {\n parsed.output = parse.fastpaths(input, options);\n }\n\n if (!parsed.output) {\n parsed = parse(input, options);\n }\n\n return picomatch.compileRe(parsed, options, returnOutput, returnState);\n};\n\n/**\n * Create a regular expression from the given regex source string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.toRegex(source[, options]);\n *\n * const { output } = picomatch.parse('*.js');\n * console.log(picomatch.toRegex(output));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `source` Regular expression source string.\n * @param {Object} `options`\n * @return {RegExp}\n * @api public\n */\n\npicomatch.toRegex = (source, options) => {\n try {\n const opts = options || {};\n return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));\n } catch (err) {\n if (options && options.debug === true) throw err;\n return /$^/;\n }\n};\n\n/**\n * Picomatch constants.\n * @return {Object}\n */\n\npicomatch.constants = constants;\n\n/**\n * Expose \"picomatch\"\n */\n\nmodule.exports = picomatch;\n","'use strict';\n\nmodule.exports = require('./lib/picomatch');\n","import mime from \"mime/lite\";\nimport picomatch from \"picomatch/posix\";\n\nconst parseInputAccept = (inputAccept: string): [string[], string[]] => {\n const extensions: string[] = [];\n const mimeTypes: string[] = [];\n\n inputAccept\n .split(\",\")\n .map(mimeType => mimeType.trim())\n .filter(Boolean)\n .forEach(fileType => {\n if (fileType.startsWith(\".\")) {\n extensions.push(`*${fileType}`);\n } else {\n mimeTypes.push(fileType);\n }\n });\n\n return [extensions, mimeTypes];\n};\n\nclass AcceptedFileTypes {\n private extensions: string[];\n private mimeTypes: string[];\n\n constructor(inputAccept: string) {\n const [extensions, mimeTypes] = parseInputAccept(inputAccept);\n\n this.extensions = extensions;\n this.mimeTypes = mimeTypes;\n }\n\n public isAccepted(fileName: string): boolean {\n if (this.extensions.length === 0 && this.mimeTypes.length === 0) {\n return true;\n }\n return (\n this.isMimeTypeAccepted(mime.getType(fileName)) ||\n this.isExtensionAccepted(fileName)\n );\n }\n\n private isMimeTypeAccepted(mimeType: string | null): boolean {\n if (!mimeType || this.mimeTypes.length === 0) {\n return false;\n }\n\n return picomatch.isMatch(mimeType, this.mimeTypes);\n }\n\n private isExtensionAccepted(fileName: string): boolean {\n if (this.extensions.length === 0) {\n return false;\n }\n\n return picomatch.isMatch(fileName, this.extensions);\n }\n}\n\nexport default AcceptedFileTypes;\n","import AcceptedFileTypes from \"./accepted_file_types.ts\";\nimport RenderUploadFile from \"./render_upload_file.ts\";\n\nconst getEntriesFromDirectory = async (\n directoryEntry: FileSystemDirectoryEntry\n): Promise =>\n new Promise((resolve, reject) => {\n directoryEntry.createReader().readEntries(resolve, reject);\n });\n\nconst getFileFromFileEntry = async (\n fileEntry: FileSystemFileEntry\n): Promise =>\n new Promise((resolve, reject) => {\n fileEntry.file(resolve, reject);\n });\n\nconst getFilesFromFileSystemEntries = async (\n entries: FileSystemEntry[]\n): Promise => {\n const result = [];\n\n for (const entry of entries) {\n if (entry.isFile) {\n const file = await getFileFromFileEntry(entry as FileSystemFileEntry);\n result.push(file);\n } else if (entry.isDirectory) {\n const entriesFromDirectory = await getEntriesFromDirectory(\n entry as FileSystemDirectoryEntry\n );\n const files = await getFilesFromFileSystemEntries(entriesFromDirectory);\n files.forEach(file => result.push(file));\n }\n }\n\n return result;\n};\n\nconst getFilesFromDataTransfer = async (\n dataTransfer: DataTransfer\n): Promise => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (dataTransfer.items) {\n const entries = [...dataTransfer.items]\n .map(item => item.webkitGetAsEntry())\n .filter(entry => entry != null);\n\n const files = await getFilesFromFileSystemEntries(entries);\n return files;\n } else {\n // backwards compatibility\n return [...dataTransfer.files];\n }\n};\n\nclass DropArea {\n acceptedFileTypes: AcceptedFileTypes;\n container: Element;\n onUploadFiles: (files: File[]) => Promise;\n renderer: RenderUploadFile;\n\n constructor({\n container,\n inputAccept,\n onUploadFiles,\n renderer\n }: {\n container: Element;\n inputAccept: string;\n onUploadFiles: (files: File[]) => Promise;\n renderer: RenderUploadFile;\n }) {\n this.container = container;\n this.onUploadFiles = onUploadFiles;\n this.acceptedFileTypes = new AcceptedFileTypes(inputAccept);\n this.renderer = renderer;\n\n container.addEventListener(\"dragenter\", () => {\n container.classList.add(\"dff-dropping\");\n });\n container.addEventListener(\"dragleave\", () => {\n container.classList.remove(\"dff-dropping\");\n });\n container.addEventListener(\"dragover\", e => {\n container.classList.add(\"dff-dropping\");\n e.preventDefault();\n });\n container.addEventListener(\"drop\", this.onDrop);\n }\n\n onDrop = (e: Event): void => {\n const dragEvent = e as DragEvent;\n this.container.classList.remove(\"dff-dropping\");\n dragEvent.preventDefault();\n dragEvent.stopPropagation();\n\n const uploadFiles = async (): Promise => {\n try {\n if (dragEvent.dataTransfer) {\n const files = await getFilesFromDataTransfer(dragEvent.dataTransfer);\n const acceptedFiles: File[] = [];\n const invalidFiles: File[] = [];\n\n for (const file of files) {\n if (this.acceptedFileTypes.isAccepted(file.name)) {\n acceptedFiles.push(file);\n } else {\n invalidFiles.push(file);\n }\n }\n\n this.renderer.setErrorInvalidFiles(invalidFiles);\n void this.onUploadFiles(acceptedFiles);\n }\n } catch (error) {\n console.error(error);\n }\n };\n\n void uploadFiles();\n };\n}\n\nexport default DropArea;\n","type UploadStatus = \"done\" | \"error\" | \"uploading\";\nexport type UploadType =\n | \"existing\"\n | \"placeholder\"\n | \"s3\"\n | \"tus\"\n | \"uploadedS3\"\n | \"uploadedTus\";\n\nexport interface InitialExistingFile {\n name: string;\n size: number;\n type: \"existing\";\n}\n\nexport interface InitialPlaceholderFile {\n id: string;\n name: string;\n size: number;\n type: \"placeholder\";\n}\n\nexport interface InitialS3File {\n id: string;\n name: string;\n original_name: string;\n size: number;\n type: \"s3\";\n}\n\nexport interface InitialTusFile {\n id: string;\n name: string;\n size: number;\n type: \"tus\";\n url: string;\n}\n\nexport type InitialFile =\n | InitialExistingFile\n | InitialPlaceholderFile\n | InitialS3File\n | InitialTusFile;\n\ninterface UploadParameters {\n name: string;\n status: UploadStatus;\n type: UploadType;\n uploadIndex: number;\n}\n\nabstract class BaseUpload {\n name: string;\n status: UploadStatus;\n type: UploadType;\n uploadIndex: number;\n\n constructor({ name, status, type, uploadIndex }: UploadParameters) {\n this.name = name;\n this.status = status;\n this.type = type;\n this.uploadIndex = uploadIndex;\n }\n\n public async abort(): Promise {\n //\n }\n public async delete(): Promise {\n //\n }\n\n public abstract getId(): string | undefined;\n public abstract getInitialFile(): InitialFile;\n public abstract getSize(): number | undefined;\n}\n\nexport default BaseUpload;\n","function normalize (strArray) {\n var resultArray = [];\n if (strArray.length === 0) { return ''; }\n\n if (typeof strArray[0] !== 'string') {\n throw new TypeError('Url must be a string. Received ' + strArray[0]);\n }\n\n // If the first part is a plain protocol, we combine it with the next part.\n if (strArray[0].match(/^[^/:]+:\\/*$/) && strArray.length > 1) {\n var first = strArray.shift();\n strArray[0] = first + strArray[0];\n }\n\n // There must be two or three slashes in the file protocol, two slashes in anything else.\n if (strArray[0].match(/^file:\\/\\/\\//)) {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1:///');\n } else {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1://');\n }\n\n for (var i = 0; i < strArray.length; i++) {\n var component = strArray[i];\n\n if (typeof component !== 'string') {\n throw new TypeError('Url must be a string. Received ' + component);\n }\n\n if (component === '') { continue; }\n\n if (i > 0) {\n // Removing the starting slashes for each component but the first.\n component = component.replace(/^[\\/]+/, '');\n }\n if (i < strArray.length - 1) {\n // Removing the ending slashes for each component but the last.\n component = component.replace(/[\\/]+$/, '');\n } else {\n // For the last component we will combine multiple slashes to a single one.\n component = component.replace(/[\\/]+$/, '/');\n }\n\n resultArray.push(component);\n\n }\n\n var str = resultArray.join('/');\n // Each input component is now separated by a single slash except the possible first plain protocol part.\n\n // remove trailing slash before parameters or hash\n str = str.replace(/\\/(\\?|&|#[^!])/g, '$1');\n\n // replace ? in parameters with &\n var parts = str.split('?');\n str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&');\n\n return str;\n}\n\nexport default function urlJoin() {\n var input;\n\n if (typeof arguments[0] === 'object') {\n input = arguments[0];\n } else {\n input = [].slice.call(arguments);\n }\n\n return normalize(input);\n}\n","import urljoin from \"url-join\";\n\nexport interface LocationInfo {\n location: string;\n}\n\nexport interface MultipartUpload {\n key: string;\n uploadId: string;\n endpoint: string;\n}\n\nexport interface Part {\n ETag: string;\n PartNumber: number;\n}\n\nexport interface UrlInfo {\n url: string;\n}\n\nexport const MB = 1024 * 1024;\n\ninterface AbortMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n uploadId: string;\n}\n\nexport const abortMultipartUpload = ({\n csrfToken,\n key,\n uploadId,\n endpoint\n}: AbortMultipartUploadParameters): Promise => {\n const filename = encodeURIComponent(key);\n const uploadIdEnc = encodeURIComponent(uploadId);\n const headers = new Headers({\n \"X-CSRFToken\": csrfToken\n });\n const url = urljoin(endpoint, uploadIdEnc, `?key=${filename}`);\n return fetch(url, {\n method: \"delete\",\n headers: headers\n }).then(response => {\n return response.json();\n });\n};\n\ninterface CompleteMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n parts: Part[];\n uploadId: string;\n}\n\nexport const completeMultipartUpload = ({\n csrfToken,\n key,\n uploadId,\n parts,\n endpoint\n}: CompleteMultipartUploadParameters): Promise => {\n const filename = encodeURIComponent(key);\n const uploadIdEnc = encodeURIComponent(uploadId);\n const headers = new Headers({\n \"X-CSRFToken\": csrfToken\n });\n const url = urljoin(endpoint, uploadIdEnc, \"complete\", `?key=${filename}`);\n return fetch(url, {\n method: \"post\",\n headers: headers,\n body: JSON.stringify({\n parts: parts\n })\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as LocationInfo;\n });\n};\n\ninterface CreateMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n file: File;\n s3UploadDir: string;\n}\n\nexport const createMultipartUpload = ({\n csrfToken,\n endpoint,\n file,\n s3UploadDir\n}: CreateMultipartUploadParameters): Promise => {\n const headers = new Headers({\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n \"X-CSRFToken\": csrfToken\n });\n return fetch(endpoint, {\n method: \"post\",\n headers: headers,\n body: JSON.stringify({\n filename: file.name,\n contentType: file.type,\n s3UploadDir: s3UploadDir\n })\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as MultipartUpload;\n });\n};\n\nexport const getChunkSize = (file: File): number =>\n Math.ceil(file.size / 10000);\n\ninterface PrepareUploadPartParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n number: number;\n uploadId: string;\n}\n\nexport const prepareUploadPart = ({\n csrfToken,\n endpoint,\n key,\n number,\n uploadId\n}: PrepareUploadPartParameters): Promise => {\n const filename = encodeURIComponent(key);\n const headers = new Headers({ \"X-CSRFToken\": csrfToken });\n const url = urljoin(\n endpoint,\n uploadId,\n number.toString(),\n `?key=${filename}`\n );\n return fetch(url, {\n method: \"get\",\n headers: headers\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as UrlInfo;\n });\n};\n\nexport const remove = (arr: unknown[], el: unknown): void => {\n const i = arr.indexOf(el);\n if (i !== -1) {\n arr.splice(i, 1);\n }\n};\n","// The following code is adapted from https://github.com/transloadit/uppy/blob/master/packages/%40uppy/aws-s3-multipart/src/MultipartUploader.js\n// which is released under a MIT License (https://github.com/transloadit/uppy/blob/master/LICENSE)\n\nimport BaseUpload, { InitialFile } from \"./base_upload.ts\";\nimport {\n abortMultipartUpload,\n completeMultipartUpload,\n createMultipartUpload,\n getChunkSize,\n MB,\n MultipartUpload,\n Part,\n prepareUploadPart,\n remove,\n UrlInfo\n} from \"./s3_utils.ts\";\n\ninterface ChunkState {\n busy: boolean;\n done: boolean;\n etag?: string;\n uploaded: number;\n}\n\ninterface S3UploadParameters {\n csrfToken: string;\n endpoint: string;\n file: File;\n s3UploadDir: string;\n uploadIndex: number;\n}\n\nclass S3Upload extends BaseUpload {\n public onError?: (error: unknown) => void;\n public onProgress?: (bytesUploaded: number, bytesTotal: number) => void;\n public onSuccess?: () => void;\n\n private chunkState: ChunkState[];\n private chunks: Blob[];\n private createdPromise: Promise;\n private csrfToken: string;\n private endpoint: string;\n private file: File;\n private key: string | null;\n private parts: Part[];\n private s3UploadDir: string;\n private uploadId: string | null;\n private uploading: XMLHttpRequest[];\n\n constructor({\n csrfToken,\n endpoint,\n file,\n s3UploadDir,\n uploadIndex\n }: S3UploadParameters) {\n super({ name: file.name, status: \"uploading\", type: \"s3\", uploadIndex });\n\n this.csrfToken = csrfToken;\n this.endpoint = endpoint;\n this.file = file;\n this.s3UploadDir = s3UploadDir;\n\n this.key = null;\n this.uploadId = null;\n this.parts = [];\n\n // Do `this.createdPromise.then(OP)` to execute an operation `OP` _only_ if the\n // upload was created already. That also ensures that the sequencing is right\n // (so the `OP` definitely happens if the upload is created).\n //\n // This mostly exists to make `abortUpload` work well: only sending the abort request if\n // the upload was already created, and if the createMultipartUpload request is still in flight,\n // aborting it immediately after it finishes.\n this.createdPromise = Promise.reject(new Error());\n this.chunks = [];\n this.chunkState = [];\n this.uploading = [];\n this.onError = undefined;\n this.onProgress = undefined;\n this.onSuccess = undefined;\n\n this.initChunks();\n\n this.createdPromise.catch(() => ({})); // silence uncaught rejection warning\n }\n\n public async abort(): Promise {\n this.uploading.slice().forEach(xhr => {\n xhr.abort();\n });\n this.uploading = [];\n\n await this.createdPromise;\n\n if (this.key && this.uploadId) {\n await abortMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n uploadId: this.uploadId\n });\n }\n }\n\n public async delete(): Promise {\n return Promise.resolve();\n }\n\n public getId(): string | undefined {\n return this.uploadId ?? undefined;\n }\n\n public getInitialFile(): InitialFile {\n return {\n id: this.uploadId ?? \"\",\n name: this.key ?? \"\",\n size: this.file.size,\n original_name: this.file.name,\n type: \"s3\"\n };\n }\n\n public getSize(): number {\n return this.file.size;\n }\n\n public start(): void {\n void this.createUpload();\n }\n\n private initChunks(): void {\n const chunks: Blob[] = [];\n const desiredChunkSize = getChunkSize(this.file);\n // at least 5MB per request, at most 10k requests\n const minChunkSize = Math.max(5 * MB, Math.ceil(this.file.size / 10000));\n const chunkSize = Math.max(desiredChunkSize, minChunkSize);\n\n for (let i = 0; i < this.file.size; i += chunkSize) {\n const end = Math.min(this.file.size, i + chunkSize);\n chunks.push(this.file.slice(i, end));\n }\n\n this.chunks = chunks;\n this.chunkState = chunks.map(() => ({\n uploaded: 0,\n busy: false,\n done: false\n }));\n }\n\n private createUpload(): Promise {\n this.createdPromise = createMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n file: this.file,\n s3UploadDir: this.s3UploadDir\n });\n return this.createdPromise\n .then((result: MultipartUpload | null) => {\n const valid =\n typeof result === \"object\" &&\n result &&\n typeof result.uploadId === \"string\" &&\n typeof result.key === \"string\";\n if (!valid) {\n throw new TypeError(\n \"AwsS3/Multipart: Got incorrect result from `createMultipartUpload()`, expected an object `{ uploadId, key }`.\"\n );\n }\n\n this.key = result.key;\n this.uploadId = result.uploadId;\n\n this.uploadParts();\n })\n .catch((err: unknown) => {\n this.handleError(err);\n });\n }\n\n private uploadParts(): void {\n const need = 1 - this.uploading.length;\n if (need === 0) {\n return;\n }\n\n // All parts are uploaded.\n if (this.chunkState.every(state => state.done)) {\n void this.completeUpload();\n return;\n }\n\n const candidates = [];\n for (let i = 0; i < this.chunkState.length; i++) {\n const state = this.chunkState[i];\n\n if (!state || state.done || state.busy) {\n continue;\n }\n\n candidates.push(i);\n if (candidates.length >= need) {\n break;\n }\n }\n\n candidates.forEach(index => {\n void this.uploadPart(index);\n });\n }\n\n private uploadPart(index: number): Promise {\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = true;\n }\n\n if (!this.key || !this.uploadId) {\n return Promise.resolve();\n }\n\n return prepareUploadPart({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n number: index + 1,\n uploadId: this.uploadId\n })\n .then(result => {\n const valid =\n typeof result === \"object\" && typeof result.url === \"string\";\n if (!valid) {\n throw new TypeError(\n \"AwsS3/Multipart: Got incorrect result from `prepareUploadPart()`, expected an object `{ url }`.\"\n );\n }\n return result;\n })\n .then(\n ({ url }: UrlInfo) => {\n this.uploadPartBytes(index, url);\n },\n (err: unknown) => {\n this.handleError(err);\n }\n );\n }\n\n private onPartProgress(index: number, sent: number): void {\n const state = this.chunkState[index];\n\n if (state) {\n state.uploaded = sent;\n }\n\n if (this.onProgress) {\n const totalUploaded = this.chunkState.reduce((n, c) => n + c.uploaded, 0);\n this.onProgress(totalUploaded, this.file.size);\n }\n }\n\n private onPartComplete(index: number, etag: string): void {\n const state = this.chunkState[index];\n\n if (state) {\n state.etag = etag;\n state.done = true;\n }\n\n const part = {\n PartNumber: index + 1,\n ETag: etag\n };\n this.parts.push(part);\n\n this.uploadParts();\n }\n\n private uploadPartBytes(index: number, url: string): void {\n const body = this.chunks[index];\n const xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", url, true);\n xhr.responseType = \"text\";\n\n this.uploading.push(xhr);\n\n xhr.upload.addEventListener(\"progress\", ev => {\n if (!ev.lengthComputable) {\n return;\n }\n\n this.onPartProgress(index, ev.loaded);\n });\n\n xhr.addEventListener(\"abort\", ev => {\n remove(this.uploading, ev.target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n });\n\n xhr.addEventListener(\"load\", ev => {\n const target = ev.target as XMLHttpRequest;\n remove(this.uploading, target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n\n if (target.status < 200 || target.status >= 300) {\n this.handleError(new Error(\"Non 2xx\"));\n return;\n }\n\n this.onPartProgress(index, body?.size ?? 0);\n\n // NOTE This must be allowed by CORS.\n const etag = target.getResponseHeader(\"ETag\");\n if (etag === null) {\n this.handleError(\n new Error(\n \"AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions.\"\n )\n );\n return;\n }\n\n this.onPartComplete(index, etag);\n });\n\n xhr.addEventListener(\"error\", ev => {\n remove(this.uploading, ev.target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n\n const error = new Error(\"Unknown error\");\n // error.source = ev.target\n this.handleError(error);\n });\n xhr.send(body);\n }\n\n private completeUpload(): Promise {\n // Parts may not have completed uploading in sorted order, if limit > 1.\n this.parts.sort((a, b) => a.PartNumber - b.PartNumber);\n\n if (!this.uploadId || !this.key) {\n return Promise.resolve();\n }\n\n return completeMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n uploadId: this.uploadId,\n parts: this.parts\n }).then(\n () => {\n if (this.onSuccess) {\n this.onSuccess();\n }\n },\n (err: unknown) => {\n this.handleError(err as Error);\n }\n );\n }\n\n private handleError(error: unknown): void {\n if (this.onError) {\n this.onError(error);\n } else {\n throw error;\n }\n }\n}\n\nexport default S3Upload;\n","export const deleteUpload = async (\n url: string,\n csrfToken: string\n): Promise =>\n new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(\"DELETE\", url);\n\n xhr.onload = (): void => {\n if (xhr.status === 204) {\n resolve();\n } else {\n reject(new Error());\n }\n };\n xhr.setRequestHeader(\"Tus-Resumable\", \"1.0.0\");\n xhr.setRequestHeader(\"X-CSRFToken\", csrfToken);\n xhr.send(null);\n });\n","import BaseUpload, {\n InitialExistingFile,\n InitialFile,\n InitialPlaceholderFile,\n InitialS3File,\n InitialTusFile,\n UploadType\n} from \"./base_upload.ts\";\nimport { deleteUpload } from \"./tus_utils.ts\";\n\ninterface BaseUploadedFileParameters {\n name: string;\n size: number;\n type: UploadType;\n uploadIndex: number;\n}\n\nexport abstract class BaseUploadedFile extends BaseUpload {\n size: number;\n\n constructor({ name, size, type, uploadIndex }: BaseUploadedFileParameters) {\n super({ name, status: \"done\", type, uploadIndex });\n\n this.size = size;\n }\n\n public async abort(): Promise {\n return Promise.resolve();\n }\n\n public async delete(): Promise {\n return Promise.resolve();\n }\n\n public getSize(): number | undefined {\n return this.size;\n }\n}\n\nclass PlaceholderFile extends BaseUploadedFile {\n id: string;\n\n constructor(initialFile: InitialPlaceholderFile, uploadIndex: number) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"placeholder\",\n uploadIndex\n });\n\n this.id = initialFile.id;\n }\n\n public getId(): string | undefined {\n return undefined;\n }\n\n public getInitialFile(): InitialPlaceholderFile {\n return {\n id: this.id,\n name: this.name,\n size: this.size,\n type: \"placeholder\"\n };\n }\n}\n\nexport class UploadedS3File extends BaseUploadedFile {\n id: string;\n key: string;\n\n constructor(initialFile: InitialS3File, uploadIndex: number) {\n super({\n name: initialFile.original_name || initialFile.name,\n size: initialFile.size,\n type: \"uploadedS3\",\n uploadIndex\n });\n\n this.id = initialFile.id;\n this.key = initialFile.name;\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n getInitialFile(): InitialS3File {\n return {\n id: this.id,\n name: this.key,\n original_name: this.name,\n size: this.size,\n type: \"s3\"\n };\n }\n}\n\nexport class ExistingFile extends BaseUploadedFile {\n constructor(initialFile: InitialExistingFile, uploadIndex: number) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"existing\",\n uploadIndex\n });\n }\n\n public getId(): string | undefined {\n return undefined;\n }\n\n public getInitialFile(): InitialExistingFile {\n return {\n name: this.name,\n size: this.size,\n type: \"existing\"\n };\n }\n}\n\ninterface UploadedTusFileParameters {\n csrfToken: string;\n initialFile: InitialTusFile;\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport class UploadedTusFile extends BaseUploadedFile {\n csrfToken: string;\n id: string;\n url: string;\n\n constructor({\n csrfToken,\n initialFile,\n uploadIndex,\n uploadUrl\n }: UploadedTusFileParameters) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"uploadedTus\",\n uploadIndex\n });\n\n this.csrfToken = csrfToken;\n this.id = initialFile.id;\n this.url = `${uploadUrl}${initialFile.id}`;\n }\n\n public async delete(): Promise {\n await deleteUpload(this.url, this.csrfToken);\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n getInitialFile(): InitialTusFile {\n return {\n id: this.id,\n name: this.name,\n size: this.size,\n type: \"tus\",\n url: \"\"\n };\n }\n}\n\ninterface UploadedFileParameters {\n csrfToken: string;\n initialFile: InitialFile;\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport const createUploadedFile = ({\n csrfToken,\n initialFile,\n uploadIndex,\n uploadUrl\n}: UploadedFileParameters): BaseUploadedFile => {\n switch (initialFile.type) {\n case \"existing\":\n return new ExistingFile(initialFile, uploadIndex);\n\n case \"placeholder\":\n return new PlaceholderFile(initialFile, uploadIndex);\n\n case \"s3\":\n return new UploadedS3File(initialFile, uploadIndex);\n\n case \"tus\":\n return new UploadedTusFile({\n csrfToken,\n initialFile,\n uploadUrl,\n uploadIndex\n });\n }\n};\n","class DetailedError extends Error {\n constructor(message, causingErr = null, req = null, res = null) {\n super(message)\n\n this.originalRequest = req\n this.originalResponse = res\n this.causingError = causingErr\n\n if (causingErr != null) {\n message += `, caused by ${causingErr.toString()}`\n }\n\n if (req != null) {\n const requestId = req.getHeader('X-Request-ID') || 'n/a'\n const method = req.getMethod()\n const url = req.getURL()\n const status = res ? res.getStatus() : 'n/a'\n const body = res ? res.getBody() || '' : 'n/a'\n message += `, originated from request (method: ${method}, url: ${url}, response code: ${status}, response text: ${body}, request id: ${requestId})`\n }\n this.message = message\n }\n}\n\nexport default DetailedError\n","let isEnabled = false\n\nexport function enableDebugLog() {\n isEnabled = true\n}\n\nexport function log(msg) {\n if (!isEnabled) return\n console.log(msg)\n}\n","export default class NoopUrlStorage {\n listAllUploads() {\n return Promise.resolve([])\n }\n\n findUploadsByFingerprint(_fingerprint) {\n return Promise.resolve([])\n }\n\n removeUpload(_urlStorageKey) {\n return Promise.resolve()\n }\n\n addUpload(_fingerprint, _upload) {\n return Promise.resolve(null)\n }\n}\n","/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.7.7';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _hasBuffer = typeof Buffer === 'function';\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)\n : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')\n : btoaPolyfill;\nconst _fromUint8Array = _hasBuffer\n ? (u8a) => Buffer.from(u8a).toString('base64')\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _hasBuffer\n ? (s) => Buffer.from(s, 'utf8').toString('base64')\n : _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, bin = '', r1, r2;\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))\n : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')\n : atobPolyfill;\n//\nconst _toUint8Array = _hasBuffer\n ? (a) => _U8Afrom(Buffer.from(a, 'base64'))\n : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _hasBuffer\n ? (a) => Buffer.from(a, 'base64').toString('utf8')\n : _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n};\n// makecjs:CUT //\nexport { version };\nexport { VERSION };\nexport { _atob as atob };\nexport { atobPolyfill };\nexport { _btoa as btoa };\nexport { btoaPolyfill };\nexport { decode as fromBase64 };\nexport { encode as toBase64 };\nexport { utob };\nexport { encode };\nexport { encodeURI };\nexport { encodeURI as encodeURL };\nexport { btou };\nexport { decode };\nexport { isValid };\nexport { fromUint8Array };\nexport { toUint8Array };\nexport { extendString };\nexport { extendUint8Array };\nexport { extendBuiltins };\n// and finally,\nexport { gBase64 as Base64 };\n","'use strict';\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nmodule.exports = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n\n if (!port) return false;\n\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n\n case 'https':\n case 'wss':\n return port !== 443;\n\n case 'ftp':\n return port !== 21;\n\n case 'gopher':\n return port !== 70;\n\n case 'file':\n return false;\n }\n\n return port !== 0;\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , undef;\n\n/**\n * Decode a URI encoded string.\n *\n * @param {String} input The URI encoded string.\n * @returns {String|Null} The decoded string.\n * @api private\n */\nfunction decode(input) {\n try {\n return decodeURIComponent(input.replace(/\\+/g, ' '));\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Attempts to encode a given input.\n *\n * @param {String} input The string that needs to be encoded.\n * @returns {String|Null} The encoded string.\n * @api private\n */\nfunction encode(input) {\n try {\n return encodeURIComponent(input);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Simple query string parser.\n *\n * @param {String} query The query string that needs to be parsed.\n * @returns {Object}\n * @api public\n */\nfunction querystring(query) {\n var parser = /([^=?#&]+)=?([^&]*)/g\n , result = {}\n , part;\n\n while (part = parser.exec(query)) {\n var key = decode(part[1])\n , value = decode(part[2]);\n\n //\n // Prevent overriding of existing properties. This ensures that build-in\n // methods like `toString` or __proto__ are not overriden by malicious\n // querystrings.\n //\n // In the case if failed decoding, we want to omit the key/value pairs\n // from the result.\n //\n if (key === null || value === null || key in result) continue;\n result[key] = value;\n }\n\n return result;\n}\n\n/**\n * Transform a query string to an object.\n *\n * @param {Object} obj Object that should be transformed.\n * @param {String} prefix Optional prefix.\n * @returns {String}\n * @api public\n */\nfunction querystringify(obj, prefix) {\n prefix = prefix || '';\n\n var pairs = []\n , value\n , key;\n\n //\n // Optionally prefix with a '?' if needed\n //\n if ('string' !== typeof prefix) prefix = '?';\n\n for (key in obj) {\n if (has.call(obj, key)) {\n value = obj[key];\n\n //\n // Edge cases where we actually want to encode the value to an empty\n // string instead of the stringified value.\n //\n if (!value && (value === null || value === undef || isNaN(value))) {\n value = '';\n }\n\n key = encode(key);\n value = encode(value);\n\n //\n // If we failed to encode the strings, we should bail out as we don't\n // want to add invalid strings to the query.\n //\n if (key === null || value === null) continue;\n pairs.push(key +'='+ value);\n }\n }\n\n return pairs.length ? prefix + pairs.join('&') : '';\n}\n\n//\n// Expose the module.\n//\nexports.stringify = querystringify;\nexports.parse = querystring;\n","'use strict';\n\nvar required = require('requires-port')\n , qs = require('querystringify')\n , controlOrWhitespace = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n , CRHTLF = /[\\n\\r\\t]/g\n , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//\n , port = /:\\d+$/\n , protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i\n , windowsDriveLetter = /^[a-zA-Z]:/;\n\n/**\n * Remove control characters and whitespace from the beginning of a string.\n *\n * @param {Object|String} str String to trim.\n * @returns {String} A new string representing `str` stripped of control\n * characters and whitespace from its beginning.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(controlOrWhitespace, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d*)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') globalVar = window;\n else if (typeof global !== 'undefined') globalVar = global;\n else if (typeof self !== 'undefined') globalVar = self;\n else globalVar = {};\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4]\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n index = parse === '@'\n ? address.lastIndexOf(parse)\n : address.indexOf(parse);\n\n if (~index) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n\n if (url.auth) {\n index = url.auth.indexOf(':');\n\n if (~index) {\n url.username = url.auth.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = url.auth.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password))\n } else {\n url.username = encodeURIComponent(decodeURIComponent(url.auth));\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) value += ':'+ url.port;\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (port.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n case 'username':\n case 'password':\n url[part] = encodeURIComponent(value);\n break;\n\n case 'auth':\n var index = value.indexOf(':');\n\n if (~index) {\n url.username = value.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = value.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(value));\n }\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n\n var query\n , url = this\n , host = url.host\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n\n var result =\n protocol +\n ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) result += ':'+ url.password;\n result += '@';\n } else if (url.password) {\n result += ':'+ url.password;\n result += '@';\n } else if (\n url.protocol !== 'file:' &&\n isSpecial(url.protocol) &&\n !host &&\n url.pathname !== '/'\n ) {\n //\n // Add back the empty userinfo, otherwise the original invalid URL\n // might be transformed into a valid one with `url.pathname` as host.\n //\n result += '@';\n }\n\n //\n // Trailing colon is removed from `url.host` when it is parsed. If it still\n // ends with a colon, then add back the trailing colon that was removed. This\n // prevents an invalid URL from being transformed into a valid one.\n //\n if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {\n host += ':';\n }\n\n result += host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;\n\n if (url.hash) result += url.hash;\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\n\nmodule.exports = Url;\n","/**\n * Generate a UUID v4 based on random numbers. We intentioanlly use the less\n * secure Math.random function here since the more secure crypto.getRandomNumbers\n * is not available on all platforms.\n * This is not a problem for us since we use the UUID only for generating a\n * request ID, so we can correlate server logs to client errors.\n *\n * This function is taken from following site:\n * https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\n *\n * @return {string} The generate UUID\n */\nexport default function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0\n const v = c === 'x' ? r : (r & 0x3) | 0x8\n return v.toString(16)\n })\n}\n","import { Base64 } from 'js-base64'\nimport URL from 'url-parse'\nimport DetailedError from './error.js'\nimport { log } from './logger.js'\nimport uuid from './uuid.js'\n\nconst PROTOCOL_TUS_V1 = 'tus-v1'\nconst PROTOCOL_IETF_DRAFT_03 = 'ietf-draft-03'\n\nconst defaultOptions = {\n endpoint: null,\n\n uploadUrl: null,\n metadata: {},\n metadataForPartialUploads: {},\n fingerprint: null,\n uploadSize: null,\n\n onProgress: null,\n onChunkComplete: null,\n onSuccess: null,\n onError: null,\n onUploadUrlAvailable: null,\n\n overridePatchMethod: false,\n headers: {},\n addRequestId: false,\n onBeforeRequest: null,\n onAfterResponse: null,\n onShouldRetry: defaultOnShouldRetry,\n\n chunkSize: Number.POSITIVE_INFINITY,\n retryDelays: [0, 1000, 3000, 5000],\n parallelUploads: 1,\n parallelUploadBoundaries: null,\n storeFingerprintForResuming: true,\n removeFingerprintOnSuccess: false,\n uploadLengthDeferred: false,\n uploadDataDuringCreation: false,\n\n urlStorage: null,\n fileReader: null,\n httpStack: null,\n\n protocol: PROTOCOL_TUS_V1,\n}\n\nclass BaseUpload {\n constructor(file, options) {\n // Warn about removed options from previous versions\n if ('resume' in options) {\n console.log(\n 'tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead.',\n )\n }\n\n // The default options will already be added from the wrapper classes.\n this.options = options\n\n // Cast chunkSize to integer\n this.options.chunkSize = Number(this.options.chunkSize)\n\n // The storage module used to store URLs\n this._urlStorage = this.options.urlStorage\n\n // The underlying File/Blob object\n this.file = file\n\n // The URL against which the file will be uploaded\n this.url = null\n\n // The underlying request object for the current PATCH request\n this._req = null\n\n // The fingerpinrt for the current file (set after start())\n this._fingerprint = null\n\n // The key that the URL storage returned when saving an URL with a fingerprint,\n this._urlStorageKey = null\n\n // The offset used in the current PATCH request\n this._offset = null\n\n // True if the current PATCH request has been aborted\n this._aborted = false\n\n // The file's size in bytes\n this._size = null\n\n // The Source object which will wrap around the given file and provides us\n // with a unified interface for getting its size and slice chunks from its\n // content allowing us to easily handle Files, Blobs, Buffers and Streams.\n this._source = null\n\n // The current count of attempts which have been made. Zero indicates none.\n this._retryAttempt = 0\n\n // The timeout's ID which is used to delay the next retry\n this._retryTimeout = null\n\n // The offset of the remote upload before the latest attempt was started.\n this._offsetBeforeRetry = 0\n\n // An array of BaseUpload instances which are used for uploading the different\n // parts, if the parallelUploads option is used.\n this._parallelUploads = null\n\n // An array of upload URLs which are used for uploading the different\n // parts, if the parallelUploads option is used.\n this._parallelUploadUrls = null\n }\n\n /**\n * Use the Termination extension to delete an upload from the server by sending a DELETE\n * request to the specified upload URL. This is only possible if the server supports the\n * Termination extension. If the `options.retryDelays` property is set, the method will\n * also retry if an error ocurrs.\n *\n * @param {String} url The upload's URL which will be terminated.\n * @param {object} options Optional options for influencing HTTP requests.\n * @return {Promise} The Promise will be resolved/rejected when the requests finish.\n */\n static terminate(url, options = {}) {\n const req = openRequest('DELETE', url, options)\n\n return sendRequest(req, null, options)\n .then((res) => {\n // A 204 response indicates a successfull request\n if (res.getStatus() === 204) {\n return\n }\n\n throw new DetailedError('tus: unexpected response while terminating upload', null, req, res)\n })\n .catch((err) => {\n if (!(err instanceof DetailedError)) {\n err = new DetailedError('tus: failed to terminate upload', err, req, null)\n }\n\n if (!shouldRetry(err, 0, options)) {\n throw err\n }\n\n // Instead of keeping track of the retry attempts, we remove the first element from the delays\n // array. If the array is empty, all retry attempts are used up and we will bubble up the error.\n // We recursively call the terminate function will removing elements from the retryDelays array.\n const delay = options.retryDelays[0]\n const remainingDelays = options.retryDelays.slice(1)\n const newOptions = {\n ...options,\n retryDelays: remainingDelays,\n }\n return new Promise((resolve) => setTimeout(resolve, delay)).then(() =>\n BaseUpload.terminate(url, newOptions),\n )\n })\n }\n\n findPreviousUploads() {\n return this.options\n .fingerprint(this.file, this.options)\n .then((fingerprint) => this._urlStorage.findUploadsByFingerprint(fingerprint))\n }\n\n resumeFromPreviousUpload(previousUpload) {\n this.url = previousUpload.uploadUrl || null\n this._parallelUploadUrls = previousUpload.parallelUploadUrls || null\n this._urlStorageKey = previousUpload.urlStorageKey\n }\n\n start() {\n const { file } = this\n\n if (!file) {\n this._emitError(new Error('tus: no file or stream to upload provided'))\n return\n }\n\n if (![PROTOCOL_TUS_V1, PROTOCOL_IETF_DRAFT_03].includes(this.options.protocol)) {\n this._emitError(new Error(`tus: unsupported protocol ${this.options.protocol}`))\n return\n }\n\n if (!this.options.endpoint && !this.options.uploadUrl && !this.url) {\n this._emitError(new Error('tus: neither an endpoint or an upload URL is provided'))\n return\n }\n\n const { retryDelays } = this.options\n if (retryDelays != null && Object.prototype.toString.call(retryDelays) !== '[object Array]') {\n this._emitError(new Error('tus: the `retryDelays` option must either be an array or null'))\n return\n }\n\n if (this.options.parallelUploads > 1) {\n // Test which options are incompatible with parallel uploads.\n for (const optionName of ['uploadUrl', 'uploadSize', 'uploadLengthDeferred']) {\n if (this.options[optionName]) {\n this._emitError(\n new Error(`tus: cannot use the ${optionName} option when parallelUploads is enabled`),\n )\n return\n }\n }\n }\n\n if (this.options.parallelUploadBoundaries) {\n if (this.options.parallelUploads <= 1) {\n this._emitError(\n new Error(\n 'tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled',\n ),\n )\n return\n }\n if (this.options.parallelUploads !== this.options.parallelUploadBoundaries.length) {\n this._emitError(\n new Error(\n 'tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`',\n ),\n )\n return\n }\n }\n\n this.options\n .fingerprint(file, this.options)\n .then((fingerprint) => {\n if (fingerprint == null) {\n log(\n 'No fingerprint was calculated meaning that the upload cannot be stored in the URL storage.',\n )\n } else {\n log(`Calculated fingerprint: ${fingerprint}`)\n }\n\n this._fingerprint = fingerprint\n\n if (this._source) {\n return this._source\n }\n return this.options.fileReader.openFile(file, this.options.chunkSize)\n })\n .then((source) => {\n this._source = source\n\n // First, we look at the uploadLengthDeferred option.\n // Next, we check if the caller has supplied a manual upload size.\n // Finally, we try to use the calculated size from the source object.\n if (this.options.uploadLengthDeferred) {\n this._size = null\n } else if (this.options.uploadSize != null) {\n this._size = Number(this.options.uploadSize)\n if (Number.isNaN(this._size)) {\n this._emitError(new Error('tus: cannot convert `uploadSize` option into a number'))\n return\n }\n } else {\n this._size = this._source.size\n if (this._size == null) {\n this._emitError(\n new Error(\n \"tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option\",\n ),\n )\n return\n }\n }\n\n // If the upload was configured to use multiple requests or if we resume from\n // an upload which used multiple requests, we start a parallel upload.\n if (this.options.parallelUploads > 1 || this._parallelUploadUrls != null) {\n this._startParallelUpload()\n } else {\n this._startSingleUpload()\n }\n })\n .catch((err) => {\n this._emitError(err)\n })\n }\n\n /**\n * Initiate the uploading procedure for a parallelized upload, where one file is split into\n * multiple request which are run in parallel.\n *\n * @api private\n */\n _startParallelUpload() {\n const totalSize = this._size\n let totalProgress = 0\n this._parallelUploads = []\n\n const partCount =\n this._parallelUploadUrls != null\n ? this._parallelUploadUrls.length\n : this.options.parallelUploads\n\n // The input file will be split into multiple slices which are uploaded in separate\n // requests. Here we get the start and end position for the slices.\n const parts =\n this.options.parallelUploadBoundaries ?? splitSizeIntoParts(this._source.size, partCount)\n\n // Attach URLs from previous uploads, if available.\n if (this._parallelUploadUrls) {\n parts.forEach((part, index) => {\n part.uploadUrl = this._parallelUploadUrls[index] || null\n })\n }\n\n // Create an empty list for storing the upload URLs\n this._parallelUploadUrls = new Array(parts.length)\n\n // Generate a promise for each slice that will be resolve if the respective\n // upload is completed.\n const uploads = parts.map((part, index) => {\n let lastPartProgress = 0\n\n return this._source.slice(part.start, part.end).then(\n ({ value }) =>\n new Promise((resolve, reject) => {\n // Merge with the user supplied options but overwrite some values.\n const options = {\n ...this.options,\n // If available, the partial upload should be resumed from a previous URL.\n uploadUrl: part.uploadUrl || null,\n // We take manually care of resuming for partial uploads, so they should\n // not be stored in the URL storage.\n storeFingerprintForResuming: false,\n removeFingerprintOnSuccess: false,\n // Reset the parallelUploads option to not cause recursion.\n parallelUploads: 1,\n // Reset this option as we are not doing a parallel upload.\n parallelUploadBoundaries: null,\n metadata: this.options.metadataForPartialUploads,\n // Add the header to indicate the this is a partial upload.\n headers: {\n ...this.options.headers,\n 'Upload-Concat': 'partial',\n },\n // Reject or resolve the promise if the upload errors or completes.\n onSuccess: resolve,\n onError: reject,\n // Based in the progress for this partial upload, calculate the progress\n // for the entire final upload.\n onProgress: (newPartProgress) => {\n totalProgress = totalProgress - lastPartProgress + newPartProgress\n lastPartProgress = newPartProgress\n this._emitProgress(totalProgress, totalSize)\n },\n // Wait until every partial upload has an upload URL, so we can add\n // them to the URL storage.\n onUploadUrlAvailable: () => {\n this._parallelUploadUrls[index] = upload.url\n // Test if all uploads have received an URL\n if (this._parallelUploadUrls.filter((u) => Boolean(u)).length === parts.length) {\n this._saveUploadInUrlStorage()\n }\n },\n }\n\n const upload = new BaseUpload(value, options)\n upload.start()\n\n // Store the upload in an array, so we can later abort them if necessary.\n this._parallelUploads.push(upload)\n }),\n )\n })\n\n let req\n // Wait until all partial uploads are finished and we can send the POST request for\n // creating the final upload.\n Promise.all(uploads)\n .then(() => {\n req = this._openRequest('POST', this.options.endpoint)\n req.setHeader('Upload-Concat', `final;${this._parallelUploadUrls.join(' ')}`)\n\n // Add metadata if values have been added\n const metadata = encodeMetadata(this.options.metadata)\n if (metadata !== '') {\n req.setHeader('Upload-Metadata', metadata)\n }\n\n return this._sendRequest(req, null)\n })\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while creating upload')\n return\n }\n\n const location = res.getHeader('Location')\n if (location == null) {\n this._emitHttpError(req, res, 'tus: invalid or missing Location header')\n return\n }\n\n this.url = resolveUrl(this.options.endpoint, location)\n log(`Created upload at ${this.url}`)\n\n this._emitSuccess(res)\n })\n .catch((err) => {\n this._emitError(err)\n })\n }\n\n /**\n * Initiate the uploading procedure for a non-parallel upload. Here the entire file is\n * uploaded in a sequential matter.\n *\n * @api private\n */\n _startSingleUpload() {\n // Reset the aborted flag when the upload is started or else the\n // _performUpload will stop before sending a request if the upload has been\n // aborted previously.\n this._aborted = false\n\n // The upload had been started previously and we should reuse this URL.\n if (this.url != null) {\n log(`Resuming upload from previous URL: ${this.url}`)\n this._resumeUpload()\n return\n }\n\n // A URL has manually been specified, so we try to resume\n if (this.options.uploadUrl != null) {\n log(`Resuming upload from provided URL: ${this.options.uploadUrl}`)\n this.url = this.options.uploadUrl\n this._resumeUpload()\n return\n }\n\n // An upload has not started for the file yet, so we start a new one\n log('Creating a new upload')\n this._createUpload()\n }\n\n /**\n * Abort any running request and stop the current upload. After abort is called, no event\n * handler will be invoked anymore. You can use the `start` method to resume the upload\n * again.\n * If `shouldTerminate` is true, the `terminate` function will be called to remove the\n * current upload from the server.\n *\n * @param {boolean} shouldTerminate True if the upload should be deleted from the server.\n * @return {Promise} The Promise will be resolved/rejected when the requests finish.\n */\n abort(shouldTerminate) {\n // Stop any parallel partial uploads, that have been started in _startParallelUploads.\n if (this._parallelUploads != null) {\n for (const upload of this._parallelUploads) {\n upload.abort(shouldTerminate)\n }\n }\n\n // Stop any current running request.\n if (this._req !== null) {\n this._req.abort()\n // Note: We do not close the file source here, so the user can resume in the future.\n }\n this._aborted = true\n\n // Stop any timeout used for initiating a retry.\n if (this._retryTimeout != null) {\n clearTimeout(this._retryTimeout)\n this._retryTimeout = null\n }\n\n if (!shouldTerminate || this.url == null) {\n return Promise.resolve()\n }\n\n return (\n BaseUpload.terminate(this.url, this.options)\n // Remove entry from the URL storage since the upload URL is no longer valid.\n .then(() => this._removeFromUrlStorage())\n )\n }\n\n _emitHttpError(req, res, message, causingErr) {\n this._emitError(new DetailedError(message, causingErr, req, res))\n }\n\n _emitError(err) {\n // Do not emit errors, e.g. from aborted HTTP requests, if the upload has been stopped.\n if (this._aborted) return\n\n // Check if we should retry, when enabled, before sending the error to the user.\n if (this.options.retryDelays != null) {\n // We will reset the attempt counter if\n // - we were already able to connect to the server (offset != null) and\n // - we were able to upload a small chunk of data to the server\n const shouldResetDelays = this._offset != null && this._offset > this._offsetBeforeRetry\n if (shouldResetDelays) {\n this._retryAttempt = 0\n }\n\n if (shouldRetry(err, this._retryAttempt, this.options)) {\n const delay = this.options.retryDelays[this._retryAttempt++]\n\n this._offsetBeforeRetry = this._offset\n\n this._retryTimeout = setTimeout(() => {\n this.start()\n }, delay)\n return\n }\n }\n\n if (typeof this.options.onError === 'function') {\n this.options.onError(err)\n } else {\n throw err\n }\n }\n\n /**\n * Publishes notification if the upload has been successfully completed.\n *\n * @param {object} lastResponse Last HTTP response.\n * @api private\n */\n _emitSuccess(lastResponse) {\n if (this.options.removeFingerprintOnSuccess) {\n // Remove stored fingerprint and corresponding endpoint. This causes\n // new uploads of the same file to be treated as a different file.\n this._removeFromUrlStorage()\n }\n\n if (typeof this.options.onSuccess === 'function') {\n this.options.onSuccess({ lastResponse })\n }\n }\n\n /**\n * Publishes notification when data has been sent to the server. This\n * data may not have been accepted by the server yet.\n *\n * @param {number} bytesSent Number of bytes sent to the server.\n * @param {number} bytesTotal Total number of bytes to be sent to the server.\n * @api private\n */\n _emitProgress(bytesSent, bytesTotal) {\n if (typeof this.options.onProgress === 'function') {\n this.options.onProgress(bytesSent, bytesTotal)\n }\n }\n\n /**\n * Publishes notification when a chunk of data has been sent to the server\n * and accepted by the server.\n * @param {number} chunkSize Size of the chunk that was accepted by the server.\n * @param {number} bytesAccepted Total number of bytes that have been\n * accepted by the server.\n * @param {number} bytesTotal Total number of bytes to be sent to the server.\n * @api private\n */\n _emitChunkComplete(chunkSize, bytesAccepted, bytesTotal) {\n if (typeof this.options.onChunkComplete === 'function') {\n this.options.onChunkComplete(chunkSize, bytesAccepted, bytesTotal)\n }\n }\n\n /**\n * Create a new upload using the creation extension by sending a POST\n * request to the endpoint. After successful creation the file will be\n * uploaded\n *\n * @api private\n */\n _createUpload() {\n if (!this.options.endpoint) {\n this._emitError(new Error('tus: unable to create upload because no endpoint is provided'))\n return\n }\n\n const req = this._openRequest('POST', this.options.endpoint)\n\n if (this.options.uploadLengthDeferred) {\n req.setHeader('Upload-Defer-Length', '1')\n } else {\n req.setHeader('Upload-Length', `${this._size}`)\n }\n\n // Add metadata if values have been added\n const metadata = encodeMetadata(this.options.metadata)\n if (metadata !== '') {\n req.setHeader('Upload-Metadata', metadata)\n }\n\n let promise\n if (this.options.uploadDataDuringCreation && !this.options.uploadLengthDeferred) {\n this._offset = 0\n promise = this._addChunkToRequest(req)\n } else {\n if (this.options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Complete', '?0')\n }\n promise = this._sendRequest(req, null)\n }\n\n promise\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while creating upload')\n return\n }\n\n const location = res.getHeader('Location')\n if (location == null) {\n this._emitHttpError(req, res, 'tus: invalid or missing Location header')\n return\n }\n\n this.url = resolveUrl(this.options.endpoint, location)\n log(`Created upload at ${this.url}`)\n\n if (typeof this.options.onUploadUrlAvailable === 'function') {\n this.options.onUploadUrlAvailable()\n }\n\n if (this._size === 0) {\n // Nothing to upload and file was successfully created\n this._emitSuccess(res)\n this._source.close()\n return\n }\n\n this._saveUploadInUrlStorage().then(() => {\n if (this.options.uploadDataDuringCreation) {\n this._handleUploadResponse(req, res)\n } else {\n this._offset = 0\n this._performUpload()\n }\n })\n })\n .catch((err) => {\n this._emitHttpError(req, null, 'tus: failed to create upload', err)\n })\n }\n\n /*\n * Try to resume an existing upload. First a HEAD request will be sent\n * to retrieve the offset. If the request fails a new upload will be\n * created. In the case of a successful response the file will be uploaded.\n *\n * @api private\n */\n _resumeUpload() {\n const req = this._openRequest('HEAD', this.url)\n const promise = this._sendRequest(req, null)\n\n promise\n .then((res) => {\n const status = res.getStatus()\n if (!inStatusCategory(status, 200)) {\n // If the upload is locked (indicated by the 423 Locked status code), we\n // emit an error instead of directly starting a new upload. This way the\n // retry logic can catch the error and will retry the upload. An upload\n // is usually locked for a short period of time and will be available\n // afterwards.\n if (status === 423) {\n this._emitHttpError(req, res, 'tus: upload is currently locked; retry later')\n return\n }\n\n if (inStatusCategory(status, 400)) {\n // Remove stored fingerprint and corresponding endpoint,\n // on client errors since the file can not be found\n this._removeFromUrlStorage()\n }\n\n if (!this.options.endpoint) {\n // Don't attempt to create a new upload if no endpoint is provided.\n this._emitHttpError(\n req,\n res,\n 'tus: unable to resume upload (new upload cannot be created without an endpoint)',\n )\n return\n }\n\n // Try to create a new upload\n this.url = null\n this._createUpload()\n return\n }\n\n const offset = Number.parseInt(res.getHeader('Upload-Offset'), 10)\n if (Number.isNaN(offset)) {\n this._emitHttpError(req, res, 'tus: invalid or missing offset value')\n return\n }\n\n const length = Number.parseInt(res.getHeader('Upload-Length'), 10)\n if (\n Number.isNaN(length) &&\n !this.options.uploadLengthDeferred &&\n this.options.protocol === PROTOCOL_TUS_V1\n ) {\n this._emitHttpError(req, res, 'tus: invalid or missing length value')\n return\n }\n\n if (typeof this.options.onUploadUrlAvailable === 'function') {\n this.options.onUploadUrlAvailable()\n }\n\n this._saveUploadInUrlStorage().then(() => {\n // Upload has already been completed and we do not need to send additional\n // data to the server\n if (offset === length) {\n this._emitProgress(length, length)\n this._emitSuccess(res)\n return\n }\n\n this._offset = offset\n this._performUpload()\n })\n })\n .catch((err) => {\n this._emitHttpError(req, null, 'tus: failed to resume upload', err)\n })\n }\n\n /**\n * Start uploading the file using PATCH requests. The file will be divided\n * into chunks as specified in the chunkSize option. During the upload\n * the onProgress event handler may be invoked multiple times.\n *\n * @api private\n */\n _performUpload() {\n // If the upload has been aborted, we will not send the next PATCH request.\n // This is important if the abort method was called during a callback, such\n // as onChunkComplete or onProgress.\n if (this._aborted) {\n return\n }\n\n let req\n\n // Some browser and servers may not support the PATCH method. For those\n // cases, you can tell tus-js-client to use a POST request with the\n // X-HTTP-Method-Override header for simulating a PATCH request.\n if (this.options.overridePatchMethod) {\n req = this._openRequest('POST', this.url)\n req.setHeader('X-HTTP-Method-Override', 'PATCH')\n } else {\n req = this._openRequest('PATCH', this.url)\n }\n\n req.setHeader('Upload-Offset', `${this._offset}`)\n const promise = this._addChunkToRequest(req)\n\n promise\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while uploading chunk')\n return\n }\n\n this._handleUploadResponse(req, res)\n })\n .catch((err) => {\n // Don't emit an error if the upload was aborted manually\n if (this._aborted) {\n return\n }\n\n this._emitHttpError(req, null, `tus: failed to upload chunk at offset ${this._offset}`, err)\n })\n }\n\n /**\n * _addChunktoRequest reads a chunk from the source and sends it using the\n * supplied request object. It will not handle the response.\n *\n * @api private\n */\n _addChunkToRequest(req) {\n const start = this._offset\n let end = this._offset + this.options.chunkSize\n\n req.setProgressHandler((bytesSent) => {\n this._emitProgress(start + bytesSent, this._size)\n })\n\n req.setHeader('Content-Type', 'application/offset+octet-stream')\n\n // The specified chunkSize may be Infinity or the calcluated end position\n // may exceed the file's size. In both cases, we limit the end position to\n // the input's total size for simpler calculations and correctness.\n if (\n (end === Number.POSITIVE_INFINITY || end > this._size) &&\n !this.options.uploadLengthDeferred\n ) {\n end = this._size\n }\n\n return this._source.slice(start, end).then(({ value, done }) => {\n const valueSize = value?.size ? value.size : 0\n\n // If the upload length is deferred, the upload size was not specified during\n // upload creation. So, if the file reader is done reading, we know the total\n // upload size and can tell the tus server.\n if (this.options.uploadLengthDeferred && done) {\n this._size = this._offset + valueSize\n req.setHeader('Upload-Length', `${this._size}`)\n }\n\n // The specified uploadSize might not match the actual amount of data that a source\n // provides. In these cases, we cannot successfully complete the upload, so we\n // rather error out and let the user know. If not, tus-js-client will be stuck\n // in a loop of repeating empty PATCH requests.\n // See https://community.transloadit.com/t/how-to-abort-hanging-companion-uploads/16488/13\n const newSize = this._offset + valueSize\n if (!this.options.uploadLengthDeferred && done && newSize !== this._size) {\n return Promise.reject(\n new Error(\n `upload was configured with a size of ${this._size} bytes, but the source is done after ${newSize} bytes`,\n ),\n )\n }\n\n if (value === null) {\n return this._sendRequest(req)\n }\n\n if (this.options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Complete', done ? '?1' : '?0')\n }\n this._emitProgress(this._offset, this._size)\n return this._sendRequest(req, value)\n })\n }\n\n /**\n * _handleUploadResponse is used by requests that haven been sent using _addChunkToRequest\n * and already have received a response.\n *\n * @api private\n */\n _handleUploadResponse(req, res) {\n const offset = Number.parseInt(res.getHeader('Upload-Offset'), 10)\n if (Number.isNaN(offset)) {\n this._emitHttpError(req, res, 'tus: invalid or missing offset value')\n return\n }\n\n this._emitProgress(offset, this._size)\n this._emitChunkComplete(offset - this._offset, offset, this._size)\n\n this._offset = offset\n\n if (offset === this._size) {\n // Yay, finally done :)\n this._emitSuccess(res)\n this._source.close()\n return\n }\n\n this._performUpload()\n }\n\n /**\n * Create a new HTTP request object with the given method and URL.\n *\n * @api private\n */\n _openRequest(method, url) {\n const req = openRequest(method, url, this.options)\n this._req = req\n return req\n }\n\n /**\n * Remove the entry in the URL storage, if it has been saved before.\n *\n * @api private\n */\n _removeFromUrlStorage() {\n if (!this._urlStorageKey) return\n\n this._urlStorage.removeUpload(this._urlStorageKey).catch((err) => {\n this._emitError(err)\n })\n this._urlStorageKey = null\n }\n\n /**\n * Add the upload URL to the URL storage, if possible.\n *\n * @api private\n */\n _saveUploadInUrlStorage() {\n // We do not store the upload URL\n // - if it was disabled in the option, or\n // - if no fingerprint was calculated for the input (i.e. a stream), or\n // - if the URL is already stored (i.e. key is set alread).\n if (\n !this.options.storeFingerprintForResuming ||\n !this._fingerprint ||\n this._urlStorageKey !== null\n ) {\n return Promise.resolve()\n }\n\n const storedUpload = {\n size: this._size,\n metadata: this.options.metadata,\n creationTime: new Date().toString(),\n }\n\n if (this._parallelUploads) {\n // Save multiple URLs if the parallelUploads option is used ...\n storedUpload.parallelUploadUrls = this._parallelUploadUrls\n } else {\n // ... otherwise we just save the one available URL.\n storedUpload.uploadUrl = this.url\n }\n\n return this._urlStorage.addUpload(this._fingerprint, storedUpload).then((urlStorageKey) => {\n this._urlStorageKey = urlStorageKey\n })\n }\n\n /**\n * Send a request with the provided body.\n *\n * @api private\n */\n _sendRequest(req, body = null) {\n return sendRequest(req, body, this.options)\n }\n}\n\nfunction encodeMetadata(metadata) {\n return Object.entries(metadata)\n .map(([key, value]) => `${key} ${Base64.encode(String(value))}`)\n .join(',')\n}\n\n/**\n * Checks whether a given status is in the range of the expected category.\n * For example, only a status between 200 and 299 will satisfy the category 200.\n *\n * @api private\n */\nfunction inStatusCategory(status, category) {\n return status >= category && status < category + 100\n}\n\n/**\n * Create a new HTTP request with the specified method and URL.\n * The necessary headers that are included in every request\n * will be added, including the request ID.\n *\n * @api private\n */\nfunction openRequest(method, url, options) {\n const req = options.httpStack.createRequest(method, url)\n\n if (options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Draft-Interop-Version', '5')\n } else {\n req.setHeader('Tus-Resumable', '1.0.0')\n }\n const headers = options.headers || {}\n\n for (const [name, value] of Object.entries(headers)) {\n req.setHeader(name, value)\n }\n\n if (options.addRequestId) {\n const requestId = uuid()\n req.setHeader('X-Request-ID', requestId)\n }\n\n return req\n}\n\n/**\n * Send a request with the provided body while invoking the onBeforeRequest\n * and onAfterResponse callbacks.\n *\n * @api private\n */\nasync function sendRequest(req, body, options) {\n if (typeof options.onBeforeRequest === 'function') {\n await options.onBeforeRequest(req)\n }\n\n const res = await req.send(body)\n\n if (typeof options.onAfterResponse === 'function') {\n await options.onAfterResponse(req, res)\n }\n\n return res\n}\n\n/**\n * Checks whether the browser running this code has internet access.\n * This function will always return true in the node.js environment\n *\n * @api private\n */\nfunction isOnline() {\n let online = true\n // Note: We don't reference `window` here because the navigator object also exists\n // in a Web Worker's context.\n if (typeof navigator !== 'undefined' && navigator.onLine === false) {\n online = false\n }\n\n return online\n}\n\n/**\n * Checks whether or not it is ok to retry a request.\n * @param {Error|DetailedError} err the error returned from the last request\n * @param {number} retryAttempt the number of times the request has already been retried\n * @param {object} options tus Upload options\n *\n * @api private\n */\nfunction shouldRetry(err, retryAttempt, options) {\n // We only attempt a retry if\n // - retryDelays option is set\n // - we didn't exceed the maxium number of retries, yet, and\n // - this error was caused by a request or it's response and\n // - the error is server error (i.e. not a status 4xx except a 409 or 423) or\n // a onShouldRetry is specified and returns true\n // - the browser does not indicate that we are offline\n if (\n options.retryDelays == null ||\n retryAttempt >= options.retryDelays.length ||\n err.originalRequest == null\n ) {\n return false\n }\n\n if (options && typeof options.onShouldRetry === 'function') {\n return options.onShouldRetry(err, retryAttempt, options)\n }\n\n return defaultOnShouldRetry(err)\n}\n\n/**\n * determines if the request should be retried. Will only retry if not a status 4xx except a 409 or 423\n * @param {DetailedError} err\n * @returns {boolean}\n */\nfunction defaultOnShouldRetry(err) {\n const status = err.originalResponse ? err.originalResponse.getStatus() : 0\n return (!inStatusCategory(status, 400) || status === 409 || status === 423) && isOnline()\n}\n\n/**\n * Resolve a relative link given the origin as source. For example,\n * if a HTTP request to http://example.com/files/ returns a Location\n * header with the value /upload/abc, the resolved URL will be:\n * http://example.com/upload/abc\n */\nfunction resolveUrl(origin, link) {\n return new URL(link, origin).toString()\n}\n\n/**\n * Calculate the start and end positions for the parts if an upload\n * is split into multiple parallel requests.\n *\n * @param {number} totalSize The byte size of the upload, which will be split.\n * @param {number} partCount The number in how many parts the upload will be split.\n * @return {object[]}\n * @api private\n */\nfunction splitSizeIntoParts(totalSize, partCount) {\n const partSize = Math.floor(totalSize / partCount)\n const parts = []\n\n for (let i = 0; i < partCount; i++) {\n parts.push({\n start: partSize * i,\n end: partSize * (i + 1),\n })\n }\n\n parts[partCount - 1].end = totalSize\n\n return parts\n}\n\nBaseUpload.defaultOptions = defaultOptions\n\nexport default BaseUpload\n","const isReactNative = () =>\n typeof navigator !== 'undefined' &&\n typeof navigator.product === 'string' &&\n navigator.product.toLowerCase() === 'reactnative'\n\nexport default isReactNative\n","/**\n * uriToBlob resolves a URI to a Blob object. This is used for\n * React Native to retrieve a file (identified by a file://\n * URI) as a blob.\n */\nexport default function uriToBlob(uri) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n xhr.responseType = 'blob'\n xhr.onload = () => {\n const blob = xhr.response\n resolve(blob)\n }\n xhr.onerror = (err) => {\n reject(err)\n }\n xhr.open('GET', uri)\n xhr.send()\n })\n}\n","const isCordova = () =>\n typeof window !== 'undefined' &&\n (typeof window.PhoneGap !== 'undefined' ||\n typeof window.Cordova !== 'undefined' ||\n typeof window.cordova !== 'undefined')\n\nexport default isCordova\n","/**\n * readAsByteArray converts a File object to a Uint8Array.\n * This function is only used on the Apache Cordova platform.\n * See https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html#read-a-file\n */\nexport default function readAsByteArray(chunk) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n const value = new Uint8Array(reader.result)\n resolve({ value })\n }\n reader.onerror = (err) => {\n reject(err)\n }\n reader.readAsArrayBuffer(chunk)\n })\n}\n","import isCordova from './isCordova.js'\nimport readAsByteArray from './readAsByteArray.js'\n\nexport default class FileSource {\n // Make this.size a method\n constructor(file) {\n this._file = file\n this.size = file.size\n }\n\n slice(start, end) {\n // In Apache Cordova applications, a File must be resolved using\n // FileReader instances, see\n // https://cordova.apache.org/docs/en/8.x/reference/cordova-plugin-file/index.html#read-a-file\n if (isCordova()) {\n return readAsByteArray(this._file.slice(start, end))\n }\n\n const value = this._file.slice(start, end)\n const done = end >= this.size\n return Promise.resolve({ value, done })\n }\n\n close() {\n // Nothing to do here since we don't need to release any resources.\n }\n}\n","function len(blobOrArray) {\n if (blobOrArray === undefined) return 0\n if (blobOrArray.size !== undefined) return blobOrArray.size\n return blobOrArray.length\n}\n\n/*\n Typed arrays and blobs don't have a concat method.\n This function helps StreamSource accumulate data to reach chunkSize.\n*/\nfunction concat(a, b) {\n if (a.concat) {\n // Is `a` an Array?\n return a.concat(b)\n }\n if (a instanceof Blob) {\n return new Blob([a, b], { type: a.type })\n }\n if (a.set) {\n // Is `a` a typed array?\n const c = new a.constructor(a.length + b.length)\n c.set(a)\n c.set(b, a.length)\n return c\n }\n throw new Error('Unknown data type')\n}\n\nexport default class StreamSource {\n constructor(reader) {\n this._buffer = undefined\n this._bufferOffset = 0\n this._reader = reader\n this._done = false\n }\n\n slice(start, end) {\n if (start < this._bufferOffset) {\n return Promise.reject(new Error(\"Requested data is before the reader's current offset\"))\n }\n\n return this._readUntilEnoughDataOrDone(start, end)\n }\n\n _readUntilEnoughDataOrDone(start, end) {\n const hasEnoughData = end <= this._bufferOffset + len(this._buffer)\n if (this._done || hasEnoughData) {\n const value = this._getDataFromBuffer(start, end)\n const done = value == null ? this._done : false\n return Promise.resolve({ value, done })\n }\n\n return this._reader.read().then(({ value, done }) => {\n if (done) {\n this._done = true\n } else if (this._buffer === undefined) {\n this._buffer = value\n } else {\n this._buffer = concat(this._buffer, value)\n }\n\n return this._readUntilEnoughDataOrDone(start, end)\n })\n }\n\n _getDataFromBuffer(start, end) {\n // Remove data from buffer before `start`.\n // Data might be reread from the buffer if an upload fails, so we can only\n // safely delete data when it comes *before* what is currently being read.\n if (start > this._bufferOffset) {\n this._buffer = this._buffer.slice(start - this._bufferOffset)\n this._bufferOffset = start\n }\n // If the buffer is empty after removing old data, all data has been read.\n const hasAllDataBeenRead = len(this._buffer) === 0\n if (this._done && hasAllDataBeenRead) {\n return null\n }\n // We already removed data before `start`, so we just return the first\n // chunk from the buffer.\n return this._buffer.slice(0, end - start)\n }\n\n close() {\n if (this._reader.cancel) {\n this._reader.cancel()\n }\n }\n}\n","import isReactNative from './isReactNative.js'\nimport uriToBlob from './uriToBlob.js'\n\nimport FileSource from './sources/FileSource.js'\nimport StreamSource from './sources/StreamSource.js'\n\nexport default class FileReader {\n async openFile(input, chunkSize) {\n // In React Native, when user selects a file, instead of a File or Blob,\n // you usually get a file object {} with a uri property that contains\n // a local path to the file. We use XMLHttpRequest to fetch\n // the file blob, before uploading with tus.\n if (isReactNative() && input && typeof input.uri !== 'undefined') {\n try {\n const blob = await uriToBlob(input.uri)\n return new FileSource(blob)\n } catch (err) {\n throw new Error(\n `tus: cannot fetch \\`file.uri\\` as Blob, make sure the uri is correct and accessible. ${err}`,\n )\n }\n }\n\n // Since we emulate the Blob type in our tests (not all target browsers\n // support it), we cannot use `instanceof` for testing whether the input value\n // can be handled. Instead, we simply check is the slice() function and the\n // size property are available.\n if (typeof input.slice === 'function' && typeof input.size !== 'undefined') {\n return Promise.resolve(new FileSource(input))\n }\n\n if (typeof input.read === 'function') {\n chunkSize = Number(chunkSize)\n if (!Number.isFinite(chunkSize)) {\n return Promise.reject(\n new Error(\n 'cannot create source for stream without a finite value for the `chunkSize` option',\n ),\n )\n }\n\n return Promise.resolve(new StreamSource(input, chunkSize))\n }\n\n return Promise.reject(\n new Error(\n 'source object may only be an instance of File, Blob, or Reader in this environment',\n ),\n )\n }\n}\n","import isReactNative from './isReactNative.js'\n\n// TODO: Differenciate between input types\n\n/**\n * Generate a fingerprint for a file which will be used the store the endpoint\n *\n * @param {File} file\n * @param {Object} options\n * @param {Function} callback\n */\nexport default function fingerprint(file, options) {\n if (isReactNative()) {\n return Promise.resolve(reactNativeFingerprint(file, options))\n }\n\n return Promise.resolve(\n ['tus-br', file.name, file.type, file.size, file.lastModified, options.endpoint].join('-'),\n )\n}\n\nfunction reactNativeFingerprint(file, options) {\n const exifHash = file.exif ? hashCode(JSON.stringify(file.exif)) : 'noexif'\n return ['tus-rn', file.name || 'noname', file.size || 'nosize', exifHash, options.endpoint].join(\n '/',\n )\n}\n\nfunction hashCode(str) {\n // from https://stackoverflow.com/a/8831937/151666\n let hash = 0\n if (str.length === 0) {\n return hash\n }\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = (hash << 5) - hash + char\n hash &= hash // Convert to 32bit integer\n }\n return hash\n}\n","export default class XHRHttpStack {\n createRequest(method, url) {\n return new Request(method, url)\n }\n\n getName() {\n return 'XHRHttpStack'\n }\n}\n\nclass Request {\n constructor(method, url) {\n this._xhr = new XMLHttpRequest()\n this._xhr.open(method, url, true)\n\n this._method = method\n this._url = url\n this._headers = {}\n }\n\n getMethod() {\n return this._method\n }\n\n getURL() {\n return this._url\n }\n\n setHeader(header, value) {\n this._xhr.setRequestHeader(header, value)\n this._headers[header] = value\n }\n\n getHeader(header) {\n return this._headers[header]\n }\n\n setProgressHandler(progressHandler) {\n // Test support for progress events before attaching an event listener\n if (!('upload' in this._xhr)) {\n return\n }\n\n this._xhr.upload.onprogress = (e) => {\n if (!e.lengthComputable) {\n return\n }\n\n progressHandler(e.loaded)\n }\n }\n\n send(body = null) {\n return new Promise((resolve, reject) => {\n this._xhr.onload = () => {\n resolve(new Response(this._xhr))\n }\n\n this._xhr.onerror = (err) => {\n reject(err)\n }\n\n this._xhr.send(body)\n })\n }\n\n abort() {\n this._xhr.abort()\n return Promise.resolve()\n }\n\n getUnderlyingObject() {\n return this._xhr\n }\n}\n\nclass Response {\n constructor(xhr) {\n this._xhr = xhr\n }\n\n getStatus() {\n return this._xhr.status\n }\n\n getHeader(header) {\n return this._xhr.getResponseHeader(header)\n }\n\n getBody() {\n return this._xhr.responseText\n }\n\n getUnderlyingObject() {\n return this._xhr\n }\n}\n","let hasStorage = false\ntry {\n // Note: localStorage does not exist in the Web Worker's context, so we must use window here.\n hasStorage = 'localStorage' in window\n\n // Attempt to store and read entries from the local storage to detect Private\n // Mode on Safari on iOS (see #49)\n // If the key was not used before, we remove it from local storage again to\n // not cause confusion where the entry came from.\n const key = 'tusSupport'\n const originalValue = localStorage.getItem(key)\n localStorage.setItem(key, originalValue)\n if (originalValue === null) localStorage.removeItem(key)\n} catch (e) {\n // If we try to access localStorage inside a sandboxed iframe, a SecurityError\n // is thrown. When in private mode on iOS Safari, a QuotaExceededError is\n // thrown (see #49)\n if (e.code === e.SECURITY_ERR || e.code === e.QUOTA_EXCEEDED_ERR) {\n hasStorage = false\n } else {\n throw e\n }\n}\n\nexport const canStoreURLs = hasStorage\n\nexport class WebStorageUrlStorage {\n findAllUploads() {\n const results = this._findEntries('tus::')\n return Promise.resolve(results)\n }\n\n findUploadsByFingerprint(fingerprint) {\n const results = this._findEntries(`tus::${fingerprint}::`)\n return Promise.resolve(results)\n }\n\n removeUpload(urlStorageKey) {\n localStorage.removeItem(urlStorageKey)\n return Promise.resolve()\n }\n\n addUpload(fingerprint, upload) {\n const id = Math.round(Math.random() * 1e12)\n const key = `tus::${fingerprint}::${id}`\n\n localStorage.setItem(key, JSON.stringify(upload))\n return Promise.resolve(key)\n }\n\n _findEntries(prefix) {\n const results = []\n\n for (let i = 0; i < localStorage.length; i++) {\n const key = localStorage.key(i)\n if (key.indexOf(prefix) !== 0) continue\n\n try {\n const upload = JSON.parse(localStorage.getItem(key))\n upload.urlStorageKey = key\n\n results.push(upload)\n } catch (_e) {\n // The JSON parse error is intentionally ignored here, so a malformed\n // entry in the storage cannot prevent an upload.\n }\n }\n\n return results\n }\n}\n","import DetailedError from '../error.js'\nimport { enableDebugLog } from '../logger.js'\nimport NoopUrlStorage from '../noopUrlStorage.js'\nimport BaseUpload from '../upload.js'\n\nimport FileReader from './fileReader.js'\nimport fingerprint from './fileSignature.js'\nimport DefaultHttpStack from './httpStack.js'\nimport { WebStorageUrlStorage, canStoreURLs } from './urlStorage.js'\n\nconst defaultOptions = {\n ...BaseUpload.defaultOptions,\n httpStack: new DefaultHttpStack(),\n fileReader: new FileReader(),\n urlStorage: canStoreURLs ? new WebStorageUrlStorage() : new NoopUrlStorage(),\n fingerprint,\n}\n\nclass Upload extends BaseUpload {\n constructor(file = null, options = {}) {\n options = { ...defaultOptions, ...options }\n super(file, options)\n }\n\n static terminate(url, options = {}) {\n options = { ...defaultOptions, ...options }\n return BaseUpload.terminate(url, options)\n }\n}\n\n// Note: We don't reference `window` here because these classes also exist in a Web Worker's context.\nconst isSupported =\n typeof XMLHttpRequest === 'function' &&\n typeof Blob === 'function' &&\n typeof Blob.prototype.slice === 'function'\n\nexport {\n Upload,\n canStoreURLs,\n defaultOptions,\n isSupported,\n enableDebugLog,\n DefaultHttpStack,\n DetailedError,\n}\n","import { HttpRequest, HttpResponse, Upload } from \"tus-js-client\";\nimport BaseUpload, { InitialFile } from \"./base_upload.ts\";\nimport { deleteUpload } from \"./tus_utils.ts\";\n\ninterface Parameters {\n chunkSize: number;\n csrfToken: string;\n fieldName: string;\n file: File;\n formId: string;\n retryDelays: number[] | null;\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport default class TusUpload extends BaseUpload {\n public onError?: (error: Error) => void;\n public onProgress?: (bytesUploaded: number, bytesTotal: number) => void;\n public onSuccess?: () => void;\n private id: string;\n private upload: Upload;\n private csrfToken: string;\n\n constructor({\n chunkSize,\n csrfToken,\n fieldName,\n file,\n formId,\n retryDelays,\n uploadIndex,\n uploadUrl\n }: Parameters) {\n super({ name: file.name, status: \"uploading\", type: \"tus\", uploadIndex });\n\n this.csrfToken = csrfToken;\n\n this.upload = new Upload(file, {\n chunkSize,\n endpoint: uploadUrl,\n metadata: {\n fieldName: fieldName,\n filename: file.name,\n formId: formId\n },\n onAfterResponse: this.handleAfterReponse,\n onBeforeRequest: this.addCsrTokenToRequest,\n onError: this.handleError,\n onProgress: this.handleProgress,\n onSuccess: this.handleSucces,\n retryDelays: retryDelays ?? [0, 1000, 3000, 5000]\n });\n\n this.onError = undefined;\n this.onProgress = undefined;\n this.onSuccess = undefined;\n }\n\n public async abort(): Promise {\n await this.upload.abort(true);\n }\n\n public async delete(): Promise {\n if (!this.upload.url) {\n return Promise.resolve();\n }\n\n await deleteUpload(this.upload.url, this.csrfToken);\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n public getSize(): number {\n return (this.upload.file as File).size;\n }\n\n public start(): void {\n this.upload.start();\n }\n\n private handleError = (error: Error) => {\n if (this.onError) {\n this.onError(error);\n } else {\n throw error;\n }\n };\n\n private handleProgress = (bytesUploaded: number, bytesTotal: number) => {\n if (this.onProgress) {\n this.onProgress(bytesUploaded, bytesTotal);\n }\n };\n\n private handleSucces = () => {\n if (this.onSuccess) {\n this.onSuccess();\n }\n };\n\n private addCsrTokenToRequest = (request: HttpRequest) => {\n request.setHeader(\"X-CSRFToken\", this.csrfToken);\n };\n\n private handleAfterReponse = (\n _request: HttpRequest,\n response: HttpResponse\n ) => {\n const resourceId = response.getHeader(\"ResourceId\");\n\n if (resourceId) {\n this.id = resourceId;\n }\n };\n\n getInitialFile(): InitialFile {\n return {\n id: this.id,\n name: this.name,\n size: this.getSize(),\n type: \"tus\",\n url: \"\"\n };\n }\n}\n","import {\n findInput,\n getMetadataFieldName,\n getUploadsFieldName\n} from \"./util.ts\";\nimport RenderUploadFile from \"./render_upload_file.ts\";\nimport DropArea from \"./drop_area.ts\";\n\nimport S3Upload from \"./uploads/s3_upload.ts\";\nimport { EventEmitter } from \"eventemitter3\";\nimport { createUploadedFile } from \"./uploads/uploaded_file.ts\";\nimport TusUpload from \"./uploads/tus_upload.ts\";\nimport BaseUpload, { InitialFile, UploadType } from \"./uploads/base_upload.ts\";\nimport AcceptedFileTypes from \"./accepted_file_types.ts\";\n\nexport type Translations = Record;\n\ninterface ClickEvent {\n fileName: string;\n fieldName: string;\n id?: string;\n type: UploadType;\n}\n\nexport interface Callbacks {\n onClick?: ({ fileName, fieldName, type }: ClickEvent) => void;\n onDelete?: (upload: BaseUpload) => void;\n onError?: (error: unknown, upload: BaseUpload) => void;\n onProgress?: (\n bytesUploaded: number,\n bytesTotal: number,\n upload: BaseUpload\n ) => void;\n onSuccess?: (upload: BaseUpload) => void;\n}\n\ninterface ConstructorParams {\n callbacks: Callbacks;\n chunkSize: number;\n csrfToken: string;\n eventEmitter?: EventEmitter;\n fieldName: string;\n form: Element;\n formId: string;\n initial: InitialFile[];\n input: HTMLInputElement;\n multiple: boolean;\n parent: Element;\n prefix: string | null;\n retryDelays: number[] | null;\n s3UploadDir: string | null;\n skipRequired: boolean;\n supportDropArea: boolean;\n translations: Translations;\n uploadUrl: string;\n}\n\nclass FileField {\n acceptedFileTypes: AcceptedFileTypes;\n callbacks: Callbacks;\n chunkSize: number;\n csrfToken: string;\n eventEmitter?: EventEmitter;\n fieldName: string;\n form: Element;\n formId: string;\n multiple: boolean;\n nextUploadIndex: number;\n prefix: string | null;\n renderer: RenderUploadFile;\n retryDelays: number[] | null;\n s3UploadDir: string | null;\n supportDropArea: boolean;\n uploads: BaseUpload[];\n uploadUrl: string;\n\n constructor({\n callbacks,\n chunkSize,\n csrfToken,\n eventEmitter,\n fieldName,\n form,\n formId,\n initial,\n input,\n multiple,\n parent,\n prefix,\n retryDelays,\n s3UploadDir,\n skipRequired,\n supportDropArea,\n translations,\n uploadUrl\n }: ConstructorParams) {\n this.callbacks = callbacks;\n this.chunkSize = chunkSize;\n this.csrfToken = csrfToken;\n this.eventEmitter = eventEmitter;\n this.fieldName = fieldName;\n this.form = form;\n this.formId = formId;\n this.multiple = multiple;\n this.prefix = prefix;\n this.retryDelays = retryDelays;\n this.s3UploadDir = s3UploadDir;\n this.supportDropArea = supportDropArea && !input.disabled;\n this.uploadUrl = uploadUrl;\n this.acceptedFileTypes = new AcceptedFileTypes(input.accept);\n\n this.uploads = [];\n this.nextUploadIndex = 0;\n\n this.renderer = new RenderUploadFile({\n parent,\n input,\n skipRequired,\n translations\n });\n const filesContainer = this.renderer.container;\n\n if (supportDropArea) {\n this.initDropArea(filesContainer, input.accept);\n }\n\n this.addInitialFiles(initial);\n\n this.checkDropHint();\n\n input.addEventListener(\"change\", this.onChange);\n filesContainer.addEventListener(\"click\", this.handleClick);\n }\n\n addInitialFiles(initialFiles: InitialFile[]): void {\n if (initialFiles.length === 0) {\n return;\n }\n\n const { multiple, renderer } = this;\n\n const addInitialFile = (initialFile: InitialFile): void => {\n const { size } = initialFile;\n const name =\n initialFile.type === \"s3\" && initialFile.original_name\n ? initialFile.original_name\n : initialFile.name;\n\n const element = renderer.addUploadedFile(\n name,\n this.nextUploadIndex,\n size\n );\n\n const upload = createUploadedFile({\n csrfToken: this.csrfToken,\n initialFile,\n uploadIndex: this.nextUploadIndex,\n uploadUrl: this.uploadUrl\n });\n this.uploads.push(upload);\n\n this.emitEvent(\"addUpload\", element, upload);\n };\n\n if (multiple) {\n initialFiles.forEach((file: InitialFile): void => {\n addInitialFile(file);\n this.nextUploadIndex += 1;\n });\n } else {\n const initialFile = initialFiles[0];\n\n if (initialFile) {\n addInitialFile(initialFile);\n }\n }\n }\n\n uploadFiles = async (files: File[]): Promise => {\n if (files.length === 0) {\n return;\n }\n\n if (!this.multiple) {\n for (const upload of this.uploads) {\n this.renderer.deleteFile(upload.uploadIndex);\n }\n\n this.uploads = [];\n const file = files[0];\n\n if (file) {\n await this.uploadFile(file);\n }\n } else {\n for (const file of files) {\n await this.uploadFile(file);\n }\n }\n\n this.checkDropHint();\n };\n\n async uploadFile(file: File): Promise {\n const createUpload = (): S3Upload | TusUpload => {\n const { csrfToken, s3UploadDir } = this;\n\n if (s3UploadDir != null) {\n return new S3Upload({\n csrfToken,\n endpoint: uploadUrl,\n file,\n s3UploadDir,\n uploadIndex: newUploadIndex\n });\n } else {\n return new TusUpload({\n chunkSize: this.chunkSize,\n csrfToken: this.csrfToken,\n fieldName,\n file,\n formId,\n retryDelays: this.retryDelays,\n uploadIndex: newUploadIndex,\n uploadUrl\n });\n }\n };\n\n const { fieldName, formId, renderer, uploadUrl } = this;\n const fileName = file.name;\n const existingUpload = this.findUploadByName(fileName);\n const newUploadIndex = existingUpload\n ? existingUpload.uploadIndex\n : this.nextUploadIndex;\n\n if (!existingUpload) {\n this.nextUploadIndex += 1;\n }\n\n if (existingUpload) {\n await this.removeExistingUpload(existingUpload);\n }\n\n const upload = createUpload();\n\n upload.onError = (error: unknown) => {\n this.handleError(upload, error);\n };\n upload.onProgress = (bytesUploaded, bytesTotal) => {\n this.handleProgress(upload, bytesUploaded, bytesTotal);\n };\n upload.onSuccess = () => {\n this.handleSuccess(upload);\n };\n upload.start();\n\n this.uploads.push(upload);\n\n const element = renderer.addNewUpload(fileName, newUploadIndex);\n this.emitEvent(\"addUpload\", element, upload);\n }\n\n getUploadByIndex(uploadIndex: number): BaseUpload | undefined {\n return this.uploads.find(upload => upload.uploadIndex === uploadIndex);\n }\n\n findUploadByName(fileName: string): BaseUpload | undefined {\n return this.uploads.find(upload => upload.name === fileName);\n }\n\n async removeExistingUpload(upload: BaseUpload): Promise {\n const element = this.renderer.findFileDiv(upload.uploadIndex);\n\n if (element) {\n this.emitEvent(\"removeUpload\", element, upload);\n }\n\n if (upload.status === \"uploading\") {\n this.renderer.disableCancel(upload.uploadIndex);\n await upload.abort();\n } else if (upload.status === \"done\") {\n this.renderer.disableDelete(upload.uploadIndex);\n\n try {\n await upload.delete();\n } catch {\n this.renderer.setDeleteFailed(upload.uploadIndex);\n return;\n }\n }\n\n this.removeUploadFromList(upload);\n this.updatePlaceholderInput();\n }\n\n onChange = (e: Event): void => {\n const files = (e.target as HTMLInputElement).files ?? ([] as File[]);\n const acceptedFiles: File[] = [];\n const invalidFiles: File[] = [];\n\n for (const file of files) {\n if (this.acceptedFileTypes.isAccepted(file.name)) {\n acceptedFiles.push(file);\n } else {\n invalidFiles.push(file);\n }\n }\n\n this.handleInvalidFiles([...invalidFiles]);\n void this.uploadFiles([...acceptedFiles]);\n\n this.renderer.clearInput();\n };\n\n handleInvalidFiles = (files: File[]): void => {\n this.renderer.setErrorInvalidFiles(files);\n };\n\n handleClick = (e: Event): void => {\n const target = e.target as HTMLElement;\n\n const getUpload = (): BaseUpload | undefined => {\n const dataIndex = target.getAttribute(\"data-index\");\n\n if (!dataIndex) {\n return undefined;\n }\n\n const uploadIndex = parseInt(dataIndex, 10);\n return this.getUploadByIndex(uploadIndex);\n };\n\n if (\n target.classList.contains(\"dff-delete\") &&\n !target.classList.contains(\"dff-disabled\")\n ) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload) {\n void this.removeExistingUpload(upload);\n }\n } else if (target.classList.contains(\"dff-cancel\")) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload) {\n void this.handleCancel(upload);\n }\n } else if (target.classList.contains(\"dff-filename\")) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload?.status === \"done\" && this.callbacks.onClick) {\n this.callbacks.onClick({\n fileName: upload.name,\n fieldName: this.fieldName,\n id: upload.getId(),\n type: upload.type\n });\n }\n }\n };\n\n handleProgress = (\n upload: BaseUpload,\n bytesUploaded: number,\n bytesTotal: number\n ): void => {\n const percentage = ((bytesUploaded / bytesTotal) * 100).toFixed(2);\n\n this.renderer.updateProgress(upload.uploadIndex, percentage);\n\n const { onProgress } = this.callbacks;\n\n if (onProgress) {\n if (upload instanceof TusUpload) {\n onProgress(bytesUploaded, bytesTotal, upload);\n }\n }\n };\n\n handleError = (upload: BaseUpload, error: unknown): void => {\n this.renderer.setError(upload.uploadIndex);\n upload.status = \"error\";\n\n const { onError } = this.callbacks;\n\n if (onError) {\n if (upload instanceof TusUpload) {\n onError(error, upload);\n }\n }\n };\n\n handleSuccess = (upload: BaseUpload): void => {\n const { renderer } = this;\n\n this.updatePlaceholderInput();\n\n renderer.clearInput();\n renderer.setSuccess(upload.uploadIndex, upload.getSize());\n upload.status = \"done\";\n\n const { onSuccess } = this.callbacks;\n\n const element = this.renderer.findFileDiv(upload.uploadIndex);\n\n if (element) {\n this.emitEvent(\"uploadComplete\", element, upload);\n }\n\n if (onSuccess && upload.type === \"tus\") {\n onSuccess(upload);\n }\n };\n\n removeUploadFromList(upload: BaseUpload): void {\n this.renderer.deleteFile(upload.uploadIndex);\n\n const index = this.uploads.indexOf(upload);\n\n if (index >= 0) {\n this.uploads.splice(index, 1);\n }\n\n this.checkDropHint();\n\n const { onDelete } = this.callbacks;\n\n if (onDelete) {\n onDelete(upload);\n }\n }\n\n async handleCancel(upload: BaseUpload): Promise {\n this.renderer.disableCancel(upload.uploadIndex);\n await upload.abort();\n this.removeUploadFromList(upload);\n }\n\n initDropArea(container: Element, inputAccept: string): void {\n new DropArea({\n container,\n inputAccept,\n onUploadFiles: this.uploadFiles,\n renderer: this.renderer\n });\n }\n\n checkDropHint(): void {\n if (!this.supportDropArea) {\n return;\n }\n\n const nonEmptyUploads = this.uploads.filter(e => Boolean(e));\n\n if (nonEmptyUploads.length === 0) {\n this.renderer.renderDropHint();\n } else {\n this.renderer.removeDropHint();\n }\n }\n\n updatePlaceholderInput(): void {\n const input = findInput(\n this.form,\n getUploadsFieldName(this.fieldName, this.prefix),\n this.prefix\n );\n if (!input) {\n return;\n }\n\n const placeholdersInfo: InitialFile[] = this.uploads.map(upload =>\n upload.getInitialFile()\n );\n\n input.value = JSON.stringify(placeholdersInfo);\n }\n\n getMetaDataField(): HTMLElement | null {\n return findInput(\n this.form,\n getMetadataFieldName(this.fieldName, this.prefix),\n this.prefix\n );\n }\n\n emitEvent(eventName: string, element: HTMLElement, upload: BaseUpload): void {\n if (this.eventEmitter) {\n this.eventEmitter.emit(eventName, {\n element,\n fieldName: this.fieldName,\n fileName: upload.name,\n metaDataField: this.getMetaDataField(),\n upload\n });\n }\n }\n}\n\nexport default FileField;\n","import { EventEmitter } from \"eventemitter3\";\nimport FileField, { Callbacks, Translations } from \"./file_field.ts\";\nimport { InitialFile } from \"./uploads/base_upload.ts\";\nimport {\n findInput,\n getInputValueForFormAndPrefix,\n getUploadsFieldName\n} from \"./util.ts\";\n\nexport interface Options {\n callbacks?: Callbacks;\n chunkSize?: number;\n eventEmitter?: EventEmitter;\n prefix?: string;\n retryDelays?: number[];\n skipRequired?: boolean;\n supportDropArea?: boolean;\n}\n\nconst initUploadFields = (form: Element, options: Options = {}): void => {\n const matchesPrefix = (fieldName: string): boolean => {\n if (!options.prefix) {\n return true;\n }\n\n return fieldName.startsWith(`${options.prefix}-`);\n };\n\n const getPrefix = (): string | null =>\n options.prefix ? options.prefix : null;\n\n const getInputValue = (fieldName: string): string | undefined =>\n getInputValueForFormAndPrefix(form, fieldName, getPrefix());\n\n const getInitialFiles = (fieldName: string): InitialFile[] => {\n const data = getInputValue(getUploadsFieldName(fieldName, getPrefix()));\n\n if (!data) {\n return [];\n }\n\n return (JSON.parse(data) as Record[]).filter(\n file => file.type\n ) as unknown as InitialFile[];\n };\n\n const uploadUrl = getInputValue(\"upload_url\");\n const formId = getInputValue(\"form_id\");\n const s3UploadDir = getInputValue(\"s3_upload_dir\");\n const skipRequired = options.skipRequired ?? false;\n const prefix = getPrefix();\n const csrfToken = findInput(form, \"csrfmiddlewaretoken\", null)?.value;\n\n if (!csrfToken) {\n throw Error(\"Csrf token not found\");\n }\n\n if (!formId || !uploadUrl) {\n return;\n }\n\n form.querySelectorAll(\".dff-uploader\").forEach(uploaderDiv => {\n const container = uploaderDiv.querySelector(\".dff-container\");\n\n if (!container) {\n return;\n }\n\n const input = container.querySelector(\"input[type=file]\");\n\n if (!(input && matchesPrefix(input.name))) {\n return;\n }\n\n const fieldName = input.name;\n const { multiple } = input;\n const initial = getInitialFiles(fieldName);\n const dataTranslations = container.getAttribute(\"data-translations\");\n const translations: Translations = dataTranslations\n ? (JSON.parse(dataTranslations) as Translations)\n : {};\n const supportDropArea = !(options.supportDropArea === false);\n\n new FileField({\n callbacks: options.callbacks ?? {},\n chunkSize: options.chunkSize ?? 2621440,\n csrfToken,\n eventEmitter: options.eventEmitter,\n fieldName,\n form,\n formId,\n s3UploadDir: s3UploadDir ?? null,\n initial,\n input,\n multiple,\n parent: container,\n prefix,\n retryDelays: options.retryDelays ?? null,\n skipRequired,\n supportDropArea,\n translations,\n uploadUrl\n });\n });\n};\n\nexport default initUploadFields;\n","import initUploadFields, { Options } from \"./init_upload_fields.ts\";\nimport {\n getInputNameWithPrefix,\n getInputValueForFormAndPrefix\n} from \"./util.ts\";\n\nconst initFormSet = (form: Element, optionsParam: Options | string): void => {\n let options: Options;\n\n if (typeof optionsParam === \"string\") {\n options = { prefix: optionsParam };\n } else {\n options = optionsParam;\n }\n\n const prefix = options.prefix ?? \"form\";\n\n const totalFormsValue = getInputValueForFormAndPrefix(\n form,\n \"TOTAL_FORMS\",\n prefix\n );\n\n if (!totalFormsValue) {\n return;\n }\n\n const formCount = parseInt(totalFormsValue, 10);\n\n for (let i = 0; i < formCount; i += 1) {\n const subFormPrefix = getInputNameWithPrefix(i.toString(), null);\n initUploadFields(form, {\n ...options,\n prefix: `${prefix}-${subFormPrefix}`\n });\n }\n};\n\nexport default initFormSet;\n","import autoInitFileForms from \"./auto_init_file_forms.ts\";\nimport initFormSet from \"./init_form_set.ts\";\nimport initUploadFields from \"./init_upload_fields.ts\";\n\ndeclare const window: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n\nwindow.autoInitFileForms = autoInitFileForms; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\nwindow.initFormSet = initFormSet; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\nwindow.initUploadFields = initUploadFields; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n"],"names":["findForm","element","parent","parentElement","tagName","unique","values","Array","from","Set","autoInitFileForms","initUploadFields","window","forms","document","querySelectorAll","map","forEach","formatBytes","bytes","decimals","k","dm","sizes","i","Math","floor","log","n","parseFloat","toFixed","size","toString","getInputNameWithPrefix","fieldName","prefix","getInputNameWithoutPrefix","slice","length","findInput","form","inputNameWithPrefix","input","querySelector","getUploadsFieldName","getInputValueForFormAndPrefix","value","getMetadataFieldName","RenderUploadFile","constructor","_ref","skipRequired","translations","container","createFilesContainer","errors","createErrorContainer","required","addNewUpload","filename","uploadIndex","div","addFile","progressSpan","createElement","className","innerSpan","appendChild","cancelLink","innerHTML","Cancel","setAttribute","href","addUploadedFile","filesize","setSuccess","clearInput","deleteFile","index","findFileDiv","remove","disableCancel","cancelSpan","findCancelSpan","classList","add","disableDelete","deleteLink","findDeleteLink","removeDropHint","dropHint","renderDropHint","setDeleteFailed","setErrorMessage","enableDelete","setError","el","removeProgress","removeCancel","setErrorInvalidFiles","files","errorsMessages","file","msg","invalidFileTypeMessage","innerText","name","replaceChildren","fileSizeInfo","Delete","updateProgress","percentage","innerProgressSpan","style","width","nameSpan","escape","message","originalMessageSpan","span","this","standardTypes","POSIX_REGEX_SOURCE","constants","require$$0","utils","require$$1","scan","parse","require$$2","require$$3","picomatch","parseInputAccept","inputAccept","extensions","mimeTypes","split","mimeType","trim","filter","Boolean","fileType","startsWith","push","AcceptedFileTypes","isAccepted","fileName","isMimeTypeAccepted","mime","getType","isExtensionAccepted","isMatch","getEntriesFromDirectory","directoryEntry","Promise","resolve","reject","createReader","readEntries","getFileFromFileEntry","fileEntry","getFilesFromFileSystemEntries","entries","result","entry","isFile","isDirectory","entriesFromDirectory","getFilesFromDataTransfer","dataTransfer","items","item","webkitGetAsEntry","DropArea","onUploadFiles","renderer","acceptedFileTypes","addEventListener","e","preventDefault","onDrop","dragEvent","stopPropagation","uploadFiles","acceptedFiles","invalidFiles","error","console","BaseUpload","status","type","abort","delete","MB","abortMultipartUpload","csrfToken","key","uploadId","endpoint","encodeURIComponent","uploadIdEnc","headers","Headers","url","urljoin","fetch","method","then","response","json","completeMultipartUpload","_ref2","parts","body","JSON","stringify","data","createMultipartUpload","_ref3","s3UploadDir","accept","contentType","getChunkSize","ceil","prepareUploadPart","_ref4","number","arr","indexOf","splice","S3Upload","createdPromise","Error","chunks","chunkState","uploading","onError","undefined","onProgress","onSuccess","initChunks","catch","xhr","getId","getInitialFile","id","original_name","getSize","start","createUpload","desiredChunkSize","minChunkSize","max","chunkSize","end","min","uploaded","busy","done","valid","TypeError","uploadParts","err","handleError","need","every","state","completeUpload","candidates","uploadPart","uploadPartBytes","onPartProgress","sent","totalUploaded","reduce","c","onPartComplete","etag","part","PartNumber","ETag","XMLHttpRequest","open","responseType","upload","ev","lengthComputable","loaded","target","getResponseHeader","send","sort","a","b","deleteUpload","onload","setRequestHeader","BaseUploadedFile","PlaceholderFile","initialFile","UploadedS3File","ExistingFile","UploadedTusFile","uploadUrl","createUploadedFile","DetailedError","causingErr","arguments","req","res","originalRequest","originalResponse","causingError","requestId","getHeader","getMethod","getURL","getStatus","getBody","NoopUrlStorage","listAllUploads","findUploadsByFingerprint","_fingerprint","removeUpload","_urlStorageKey","addUpload","_upload","encode","decode","querystringify_1","global","uuid","replace","r","random","v","PROTOCOL_TUS_V1","PROTOCOL_IETF_DRAFT_03","defaultOptions","metadata","metadataForPartialUploads","fingerprint","uploadSize","onChunkComplete","onUploadUrlAvailable","overridePatchMethod","addRequestId","onBeforeRequest","onAfterResponse","onShouldRetry","defaultOnShouldRetry","Number","POSITIVE_INFINITY","retryDelays","parallelUploads","parallelUploadBoundaries","storeFingerprintForResuming","removeFingerprintOnSuccess","uploadLengthDeferred","uploadDataDuringCreation","urlStorage","fileReader","httpStack","protocol","options","_urlStorage","_req","_offset","_aborted","_size","_source","_retryAttempt","_retryTimeout","_offsetBeforeRetry","_parallelUploads","_parallelUploadUrls","terminate","openRequest","sendRequest","shouldRetry","delay","remainingDelays","newOptions","setTimeout","findPreviousUploads","resumeFromPreviousUpload","previousUpload","parallelUploadUrls","urlStorageKey","_emitError","includes","Object","prototype","call","optionName","openFile","source","isNaN","_startParallelUpload","_startSingleUpload","totalSize","totalProgress","partCount","splitSizeIntoParts","uploads","lastPartProgress","newPartProgress","_emitProgress","u","_saveUploadInUrlStorage","all","_openRequest","setHeader","join","encodeMetadata","_sendRequest","inStatusCategory","_emitHttpError","location","resolveUrl","_emitSuccess","_resumeUpload","_createUpload","shouldTerminate","clearTimeout","_removeFromUrlStorage","shouldResetDelays","lastResponse","bytesSent","bytesTotal","_emitChunkComplete","bytesAccepted","promise","_addChunkToRequest","close","_handleUploadResponse","_performUpload","offset","parseInt","setProgressHandler","valueSize","newSize","storedUpload","creationTime","Date","Base64","String","category","createRequest","isOnline","online","navigator","onLine","retryAttempt","origin","link","URL","partSize","isReactNative","product","toLowerCase","uriToBlob","uri","blob","onerror","isCordova","PhoneGap","Cordova","cordova","readAsByteArray","chunk","reader","FileReader","Uint8Array","readAsArrayBuffer","FileSource","_file","len","blobOrArray","concat","Blob","set","StreamSource","_buffer","_bufferOffset","_reader","_done","_readUntilEnoughDataOrDone","hasEnoughData","_getDataFromBuffer","read","hasAllDataBeenRead","cancel","isFinite","reactNativeFingerprint","lastModified","exifHash","exif","hashCode","str","hash","char","charCodeAt","XHRHttpStack","Request","getName","_xhr","_method","_url","_headers","header","progressHandler","onprogress","Response","getUnderlyingObject","responseText","hasStorage","originalValue","localStorage","getItem","setItem","removeItem","code","SECURITY_ERR","QUOTA_EXCEEDED_ERR","canStoreURLs","WebStorageUrlStorage","findAllUploads","results","_findEntries","round","_e","DefaultHttpStack","Upload","TusUpload","formId","handleAfterReponse","addCsrTokenToRequest","handleProgress","handleSucces","bytesUploaded","request","_request","resourceId","FileField","callbacks","eventEmitter","initial","multiple","supportDropArea","disabled","nextUploadIndex","filesContainer","initDropArea","addInitialFiles","checkDropHint","onChange","handleClick","initialFiles","addInitialFile","emitEvent","uploadFile","newUploadIndex","existingUpload","findUploadByName","removeExistingUpload","handleSuccess","getUploadByIndex","find","removeUploadFromList","updatePlaceholderInput","handleInvalidFiles","getUpload","dataIndex","getAttribute","contains","handleCancel","onClick","onDelete","nonEmptyUploads","placeholdersInfo","getMetaDataField","eventName","emit","metaDataField","matchesPrefix","getPrefix","getInputValue","getInitialFiles","uploaderDiv","dataTranslations","initFormSet","optionsParam","totalFormsValue","formCount","subFormPrefix"],"mappings":";;EAAA,MAAMA,QAAQ,GAAIC,OAAgB,IAAyB;EACzD,EAAA,MAAMC,MAAM,GAAGD,OAAO,CAACE,aAAa,CAAA;IAEpC,IAAI,CAACD,MAAM,EAAE;EACX,IAAA,OAAO,IAAI,CAAA;EACb,GAAA;EAEA,EAAA,IAAIA,MAAM,CAACE,OAAO,KAAK,MAAM,EAAE;EAC7B,IAAA,OAAOF,MAAM,CAAA;EACf,GAAA;IAEA,OAAOF,QAAQ,CAACE,MAAM,CAAC,CAAA;EACzB,CAAC,CAAA;EAED,MAAMG,MAAM,GAAIC,MAAiB,IAC/BC,KAAK,CAACC,IAAI,CAAC,IAAIC,GAAG,CAACH,MAAM,CAAC,CAACA,MAAM,EAAE,CAAC,CAAA;EAEX;;EAE3B,MAAMI,iBAAiB,GAAGA,MAAY;EACpC,EAAA,MAAMC,gBAAgB,GAAGC,MAAM,CAACD,gBAA8B,CAAC;;IAE/D,MAAME,KAAK,GAAGR,MAAM,CAClBE,KAAK,CAACC,IAAI,CAACM,QAAQ,CAACC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAACC,GAAG,CAAChB,QAAQ,CACrE,CAAC,CAAA;EACDa,EAAAA,KAAK,CAACI,OAA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,CAAC;;;;;;","x_google_ignoreList":[2,4,5,6,7,8,9,10,11,12,16,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40]} \ No newline at end of file +{"version":3,"file":"file_form.js","sources":["../../../frontend/src/auto_init_file_forms.ts","../../../frontend/node_modules/mime/dist/types/standard.js","../../../frontend/node_modules/mime/dist/src/Mime.js","../../../frontend/node_modules/mime/dist/src/index_lite.js","../../../frontend/node_modules/picomatch/lib/constants.js","../../../frontend/node_modules/picomatch/lib/utils.js","../../../frontend/node_modules/picomatch/lib/scan.js","../../../frontend/node_modules/picomatch/lib/parse.js","../../../frontend/node_modules/picomatch/lib/picomatch.js","../../../frontend/node_modules/picomatch/posix.js","../../../frontend/src/accepted_file_types.ts","../../../frontend/src/drop_area.ts","../../../frontend/node_modules/escape-html/index.js","../../../frontend/src/util.ts","../../../frontend/src/render_upload_file.ts","../../../frontend/src/uploads/base_upload.ts","../../../frontend/node_modules/url-join/lib/url-join.js","../../../frontend/src/uploads/s3_utils.ts","../../../frontend/src/uploads/s3_upload.ts","../../../frontend/node_modules/tus-js-client/lib/error.js","../../../frontend/node_modules/tus-js-client/lib/logger.js","../../../frontend/node_modules/tus-js-client/lib/noopUrlStorage.js","../../../frontend/node_modules/js-base64/base64.mjs","../../../frontend/node_modules/requires-port/index.js","../../../frontend/node_modules/querystringify/index.js","../../../frontend/node_modules/url-parse/index.js","../../../frontend/node_modules/tus-js-client/lib/uuid.js","../../../frontend/node_modules/tus-js-client/lib/upload.js","../../../frontend/node_modules/tus-js-client/lib/browser/isReactNative.js","../../../frontend/node_modules/tus-js-client/lib/browser/uriToBlob.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/isCordova.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/readAsByteArray.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/FileSource.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/StreamSource.js","../../../frontend/node_modules/tus-js-client/lib/browser/fileReader.js","../../../frontend/node_modules/tus-js-client/lib/browser/fileSignature.js","../../../frontend/node_modules/tus-js-client/lib/browser/httpStack.js","../../../frontend/node_modules/tus-js-client/lib/browser/urlStorage.js","../../../frontend/node_modules/tus-js-client/lib/browser/index.js","../../../frontend/src/uploads/tus_utils.ts","../../../frontend/src/uploads/tus_upload.ts","../../../frontend/src/uploads/uploaded_file.ts","../../../frontend/src/file_field.ts","../../../frontend/src/init_upload_fields.ts","../../../frontend/src/init_form_set.ts","../../../frontend/src/file_form.ts"],"sourcesContent":["const findForm = (element: Element): HTMLElement | null => {\n const parent = element.parentElement;\n\n if (!parent) {\n return null;\n }\n\n if (parent.tagName === \"FORM\") {\n return parent;\n }\n\n return findForm(parent);\n};\n\nconst unique = (values: unknown[]): unknown[] =>\n Array.from(new Set(values).values());\n\ndeclare const window: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n\nconst autoInitFileForms = (): void => {\n const initUploadFields = window.initUploadFields as () => void; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n\n const forms = unique(\n Array.from(document.querySelectorAll(\".dff-uploader\")).map(findForm)\n );\n forms.forEach(initUploadFields);\n};\n\nexport default autoInitFileForms;\n","const types = { \"application/andrew-inset\": [\"ez\"], \"application/appinstaller\": [\"appinstaller\"], \"application/applixware\": [\"aw\"], \"application/appx\": [\"appx\"], \"application/appxbundle\": [\"appxbundle\"], \"application/atom+xml\": [\"atom\"], \"application/atomcat+xml\": [\"atomcat\"], \"application/atomdeleted+xml\": [\"atomdeleted\"], \"application/atomsvc+xml\": [\"atomsvc\"], \"application/atsc-dwd+xml\": [\"dwd\"], \"application/atsc-held+xml\": [\"held\"], \"application/atsc-rsat+xml\": [\"rsat\"], \"application/automationml-aml+xml\": [\"aml\"], \"application/automationml-amlx+zip\": [\"amlx\"], \"application/bdoc\": [\"bdoc\"], \"application/calendar+xml\": [\"xcs\"], \"application/ccxml+xml\": [\"ccxml\"], \"application/cdfx+xml\": [\"cdfx\"], \"application/cdmi-capability\": [\"cdmia\"], \"application/cdmi-container\": [\"cdmic\"], \"application/cdmi-domain\": [\"cdmid\"], \"application/cdmi-object\": [\"cdmio\"], \"application/cdmi-queue\": [\"cdmiq\"], \"application/cpl+xml\": [\"cpl\"], \"application/cu-seeme\": [\"cu\"], \"application/cwl\": [\"cwl\"], \"application/dash+xml\": [\"mpd\"], \"application/dash-patch+xml\": [\"mpp\"], \"application/davmount+xml\": [\"davmount\"], \"application/docbook+xml\": [\"dbk\"], \"application/dssc+der\": [\"dssc\"], \"application/dssc+xml\": [\"xdssc\"], \"application/ecmascript\": [\"ecma\"], \"application/emma+xml\": [\"emma\"], \"application/emotionml+xml\": [\"emotionml\"], \"application/epub+zip\": [\"epub\"], \"application/exi\": [\"exi\"], \"application/express\": [\"exp\"], \"application/fdf\": [\"fdf\"], \"application/fdt+xml\": [\"fdt\"], \"application/font-tdpfr\": [\"pfr\"], \"application/geo+json\": [\"geojson\"], \"application/gml+xml\": [\"gml\"], \"application/gpx+xml\": [\"gpx\"], \"application/gxf\": [\"gxf\"], \"application/gzip\": [\"gz\"], \"application/hjson\": [\"hjson\"], \"application/hyperstudio\": [\"stk\"], \"application/inkml+xml\": [\"ink\", \"inkml\"], \"application/ipfix\": [\"ipfix\"], \"application/its+xml\": [\"its\"], \"application/java-archive\": [\"jar\", \"war\", \"ear\"], \"application/java-serialized-object\": [\"ser\"], \"application/java-vm\": [\"class\"], \"application/javascript\": [\"*js\"], \"application/json\": [\"json\", \"map\"], \"application/json5\": [\"json5\"], \"application/jsonml+json\": [\"jsonml\"], \"application/ld+json\": [\"jsonld\"], \"application/lgr+xml\": [\"lgr\"], \"application/lost+xml\": [\"lostxml\"], \"application/mac-binhex40\": [\"hqx\"], \"application/mac-compactpro\": [\"cpt\"], \"application/mads+xml\": [\"mads\"], \"application/manifest+json\": [\"webmanifest\"], \"application/marc\": [\"mrc\"], \"application/marcxml+xml\": [\"mrcx\"], \"application/mathematica\": [\"ma\", \"nb\", \"mb\"], \"application/mathml+xml\": [\"mathml\"], \"application/mbox\": [\"mbox\"], \"application/media-policy-dataset+xml\": [\"mpf\"], \"application/mediaservercontrol+xml\": [\"mscml\"], \"application/metalink+xml\": [\"metalink\"], \"application/metalink4+xml\": [\"meta4\"], \"application/mets+xml\": [\"mets\"], \"application/mmt-aei+xml\": [\"maei\"], \"application/mmt-usd+xml\": [\"musd\"], \"application/mods+xml\": [\"mods\"], \"application/mp21\": [\"m21\", \"mp21\"], \"application/mp4\": [\"*mp4\", \"*mpg4\", \"mp4s\", \"m4p\"], \"application/msix\": [\"msix\"], \"application/msixbundle\": [\"msixbundle\"], \"application/msword\": [\"doc\", \"dot\"], \"application/mxf\": [\"mxf\"], \"application/n-quads\": [\"nq\"], \"application/n-triples\": [\"nt\"], \"application/node\": [\"cjs\"], \"application/octet-stream\": [\"bin\", \"dms\", \"lrf\", \"mar\", \"so\", \"dist\", \"distz\", \"pkg\", \"bpk\", \"dump\", \"elc\", \"deploy\", \"exe\", \"dll\", \"deb\", \"dmg\", \"iso\", \"img\", \"msi\", \"msp\", \"msm\", \"buffer\"], \"application/oda\": [\"oda\"], \"application/oebps-package+xml\": [\"opf\"], \"application/ogg\": [\"ogx\"], \"application/omdoc+xml\": [\"omdoc\"], \"application/onenote\": [\"onetoc\", \"onetoc2\", \"onetmp\", \"onepkg\"], \"application/oxps\": [\"oxps\"], \"application/p2p-overlay+xml\": [\"relo\"], \"application/patch-ops-error+xml\": [\"xer\"], \"application/pdf\": [\"pdf\"], \"application/pgp-encrypted\": [\"pgp\"], \"application/pgp-keys\": [\"asc\"], \"application/pgp-signature\": [\"sig\", \"*asc\"], \"application/pics-rules\": [\"prf\"], \"application/pkcs10\": [\"p10\"], \"application/pkcs7-mime\": [\"p7m\", \"p7c\"], \"application/pkcs7-signature\": [\"p7s\"], \"application/pkcs8\": [\"p8\"], \"application/pkix-attr-cert\": [\"ac\"], \"application/pkix-cert\": [\"cer\"], \"application/pkix-crl\": [\"crl\"], \"application/pkix-pkipath\": [\"pkipath\"], \"application/pkixcmp\": [\"pki\"], \"application/pls+xml\": [\"pls\"], \"application/postscript\": [\"ai\", \"eps\", \"ps\"], \"application/provenance+xml\": [\"provx\"], \"application/pskc+xml\": [\"pskcxml\"], \"application/raml+yaml\": [\"raml\"], \"application/rdf+xml\": [\"rdf\", \"owl\"], \"application/reginfo+xml\": [\"rif\"], \"application/relax-ng-compact-syntax\": [\"rnc\"], \"application/resource-lists+xml\": [\"rl\"], \"application/resource-lists-diff+xml\": [\"rld\"], \"application/rls-services+xml\": [\"rs\"], \"application/route-apd+xml\": [\"rapd\"], \"application/route-s-tsid+xml\": [\"sls\"], \"application/route-usd+xml\": [\"rusd\"], \"application/rpki-ghostbusters\": [\"gbr\"], \"application/rpki-manifest\": [\"mft\"], \"application/rpki-roa\": [\"roa\"], \"application/rsd+xml\": [\"rsd\"], \"application/rss+xml\": [\"rss\"], \"application/rtf\": [\"rtf\"], \"application/sbml+xml\": [\"sbml\"], \"application/scvp-cv-request\": [\"scq\"], \"application/scvp-cv-response\": [\"scs\"], \"application/scvp-vp-request\": [\"spq\"], \"application/scvp-vp-response\": [\"spp\"], \"application/sdp\": [\"sdp\"], \"application/senml+xml\": [\"senmlx\"], \"application/sensml+xml\": [\"sensmlx\"], \"application/set-payment-initiation\": [\"setpay\"], \"application/set-registration-initiation\": [\"setreg\"], \"application/shf+xml\": [\"shf\"], \"application/sieve\": [\"siv\", \"sieve\"], \"application/smil+xml\": [\"smi\", \"smil\"], \"application/sparql-query\": [\"rq\"], \"application/sparql-results+xml\": [\"srx\"], \"application/sql\": [\"sql\"], \"application/srgs\": [\"gram\"], \"application/srgs+xml\": [\"grxml\"], \"application/sru+xml\": [\"sru\"], \"application/ssdl+xml\": [\"ssdl\"], \"application/ssml+xml\": [\"ssml\"], \"application/swid+xml\": [\"swidtag\"], \"application/tei+xml\": [\"tei\", \"teicorpus\"], \"application/thraud+xml\": [\"tfi\"], \"application/timestamped-data\": [\"tsd\"], \"application/toml\": [\"toml\"], \"application/trig\": [\"trig\"], \"application/ttml+xml\": [\"ttml\"], \"application/ubjson\": [\"ubj\"], \"application/urc-ressheet+xml\": [\"rsheet\"], \"application/urc-targetdesc+xml\": [\"td\"], \"application/voicexml+xml\": [\"vxml\"], \"application/wasm\": [\"wasm\"], \"application/watcherinfo+xml\": [\"wif\"], \"application/widget\": [\"wgt\"], \"application/winhlp\": [\"hlp\"], \"application/wsdl+xml\": [\"wsdl\"], \"application/wspolicy+xml\": [\"wspolicy\"], \"application/xaml+xml\": [\"xaml\"], \"application/xcap-att+xml\": [\"xav\"], \"application/xcap-caps+xml\": [\"xca\"], \"application/xcap-diff+xml\": [\"xdf\"], \"application/xcap-el+xml\": [\"xel\"], \"application/xcap-ns+xml\": [\"xns\"], \"application/xenc+xml\": [\"xenc\"], \"application/xfdf\": [\"xfdf\"], \"application/xhtml+xml\": [\"xhtml\", \"xht\"], \"application/xliff+xml\": [\"xlf\"], \"application/xml\": [\"xml\", \"xsl\", \"xsd\", \"rng\"], \"application/xml-dtd\": [\"dtd\"], \"application/xop+xml\": [\"xop\"], \"application/xproc+xml\": [\"xpl\"], \"application/xslt+xml\": [\"*xsl\", \"xslt\"], \"application/xspf+xml\": [\"xspf\"], \"application/xv+xml\": [\"mxml\", \"xhvml\", \"xvml\", \"xvm\"], \"application/yang\": [\"yang\"], \"application/yin+xml\": [\"yin\"], \"application/zip\": [\"zip\"], \"audio/3gpp\": [\"*3gpp\"], \"audio/aac\": [\"adts\", \"aac\"], \"audio/adpcm\": [\"adp\"], \"audio/amr\": [\"amr\"], \"audio/basic\": [\"au\", \"snd\"], \"audio/midi\": [\"mid\", \"midi\", \"kar\", \"rmi\"], \"audio/mobile-xmf\": [\"mxmf\"], \"audio/mp3\": [\"*mp3\"], \"audio/mp4\": [\"m4a\", \"mp4a\"], \"audio/mpeg\": [\"mpga\", \"mp2\", \"mp2a\", \"mp3\", \"m2a\", \"m3a\"], \"audio/ogg\": [\"oga\", \"ogg\", \"spx\", \"opus\"], \"audio/s3m\": [\"s3m\"], \"audio/silk\": [\"sil\"], \"audio/wav\": [\"wav\"], \"audio/wave\": [\"*wav\"], \"audio/webm\": [\"weba\"], \"audio/xm\": [\"xm\"], \"font/collection\": [\"ttc\"], \"font/otf\": [\"otf\"], \"font/ttf\": [\"ttf\"], \"font/woff\": [\"woff\"], \"font/woff2\": [\"woff2\"], \"image/aces\": [\"exr\"], \"image/apng\": [\"apng\"], \"image/avci\": [\"avci\"], \"image/avcs\": [\"avcs\"], \"image/avif\": [\"avif\"], \"image/bmp\": [\"bmp\", \"dib\"], \"image/cgm\": [\"cgm\"], \"image/dicom-rle\": [\"drle\"], \"image/dpx\": [\"dpx\"], \"image/emf\": [\"emf\"], \"image/fits\": [\"fits\"], \"image/g3fax\": [\"g3\"], \"image/gif\": [\"gif\"], \"image/heic\": [\"heic\"], \"image/heic-sequence\": [\"heics\"], \"image/heif\": [\"heif\"], \"image/heif-sequence\": [\"heifs\"], \"image/hej2k\": [\"hej2\"], \"image/hsj2\": [\"hsj2\"], \"image/ief\": [\"ief\"], \"image/jls\": [\"jls\"], \"image/jp2\": [\"jp2\", \"jpg2\"], \"image/jpeg\": [\"jpeg\", \"jpg\", \"jpe\"], \"image/jph\": [\"jph\"], \"image/jphc\": [\"jhc\"], \"image/jpm\": [\"jpm\", \"jpgm\"], \"image/jpx\": [\"jpx\", \"jpf\"], \"image/jxr\": [\"jxr\"], \"image/jxra\": [\"jxra\"], \"image/jxrs\": [\"jxrs\"], \"image/jxs\": [\"jxs\"], \"image/jxsc\": [\"jxsc\"], \"image/jxsi\": [\"jxsi\"], \"image/jxss\": [\"jxss\"], \"image/ktx\": [\"ktx\"], \"image/ktx2\": [\"ktx2\"], \"image/png\": [\"png\"], \"image/sgi\": [\"sgi\"], \"image/svg+xml\": [\"svg\", \"svgz\"], \"image/t38\": [\"t38\"], \"image/tiff\": [\"tif\", \"tiff\"], \"image/tiff-fx\": [\"tfx\"], \"image/webp\": [\"webp\"], \"image/wmf\": [\"wmf\"], \"message/disposition-notification\": [\"disposition-notification\"], \"message/global\": [\"u8msg\"], \"message/global-delivery-status\": [\"u8dsn\"], \"message/global-disposition-notification\": [\"u8mdn\"], \"message/global-headers\": [\"u8hdr\"], \"message/rfc822\": [\"eml\", \"mime\"], \"model/3mf\": [\"3mf\"], \"model/gltf+json\": [\"gltf\"], \"model/gltf-binary\": [\"glb\"], \"model/iges\": [\"igs\", \"iges\"], \"model/jt\": [\"jt\"], \"model/mesh\": [\"msh\", \"mesh\", \"silo\"], \"model/mtl\": [\"mtl\"], \"model/obj\": [\"obj\"], \"model/prc\": [\"prc\"], \"model/step+xml\": [\"stpx\"], \"model/step+zip\": [\"stpz\"], \"model/step-xml+zip\": [\"stpxz\"], \"model/stl\": [\"stl\"], \"model/u3d\": [\"u3d\"], \"model/vrml\": [\"wrl\", \"vrml\"], \"model/x3d+binary\": [\"*x3db\", \"x3dbz\"], \"model/x3d+fastinfoset\": [\"x3db\"], \"model/x3d+vrml\": [\"*x3dv\", \"x3dvz\"], \"model/x3d+xml\": [\"x3d\", \"x3dz\"], \"model/x3d-vrml\": [\"x3dv\"], \"text/cache-manifest\": [\"appcache\", \"manifest\"], \"text/calendar\": [\"ics\", \"ifb\"], \"text/coffeescript\": [\"coffee\", \"litcoffee\"], \"text/css\": [\"css\"], \"text/csv\": [\"csv\"], \"text/html\": [\"html\", \"htm\", \"shtml\"], \"text/jade\": [\"jade\"], \"text/javascript\": [\"js\", \"mjs\"], \"text/jsx\": [\"jsx\"], \"text/less\": [\"less\"], \"text/markdown\": [\"md\", \"markdown\"], \"text/mathml\": [\"mml\"], \"text/mdx\": [\"mdx\"], \"text/n3\": [\"n3\"], \"text/plain\": [\"txt\", \"text\", \"conf\", \"def\", \"list\", \"log\", \"in\", \"ini\"], \"text/richtext\": [\"rtx\"], \"text/rtf\": [\"*rtf\"], \"text/sgml\": [\"sgml\", \"sgm\"], \"text/shex\": [\"shex\"], \"text/slim\": [\"slim\", \"slm\"], \"text/spdx\": [\"spdx\"], \"text/stylus\": [\"stylus\", \"styl\"], \"text/tab-separated-values\": [\"tsv\"], \"text/troff\": [\"t\", \"tr\", \"roff\", \"man\", \"me\", \"ms\"], \"text/turtle\": [\"ttl\"], \"text/uri-list\": [\"uri\", \"uris\", \"urls\"], \"text/vcard\": [\"vcard\"], \"text/vtt\": [\"vtt\"], \"text/wgsl\": [\"wgsl\"], \"text/xml\": [\"*xml\"], \"text/yaml\": [\"yaml\", \"yml\"], \"video/3gpp\": [\"3gp\", \"3gpp\"], \"video/3gpp2\": [\"3g2\"], \"video/h261\": [\"h261\"], \"video/h263\": [\"h263\"], \"video/h264\": [\"h264\"], \"video/iso.segment\": [\"m4s\"], \"video/jpeg\": [\"jpgv\"], \"video/jpm\": [\"*jpm\", \"*jpgm\"], \"video/mj2\": [\"mj2\", \"mjp2\"], \"video/mp2t\": [\"ts\"], \"video/mp4\": [\"mp4\", \"mp4v\", \"mpg4\"], \"video/mpeg\": [\"mpeg\", \"mpg\", \"mpe\", \"m1v\", \"m2v\"], \"video/ogg\": [\"ogv\"], \"video/quicktime\": [\"qt\", \"mov\"], \"video/webm\": [\"webm\"] };\nObject.freeze(types);\nexport default types;\n//# sourceMappingURL=standard.js.map","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _Mime_extensionToType, _Mime_typeToExtension, _Mime_typeToExtensions;\nclass Mime {\n constructor(...args) {\n _Mime_extensionToType.set(this, new Map());\n _Mime_typeToExtension.set(this, new Map());\n _Mime_typeToExtensions.set(this, new Map());\n for (const arg of args) {\n this.define(arg);\n }\n }\n define(typeMap, force = false) {\n for (let [type, extensions] of Object.entries(typeMap)) {\n type = type.toLowerCase();\n extensions = extensions.map((ext) => ext.toLowerCase());\n if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").has(type)) {\n __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").set(type, new Set());\n }\n const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type);\n let first = true;\n for (let extension of extensions) {\n const starred = extension.startsWith('*');\n extension = starred ? extension.slice(1) : extension;\n allExtensions?.add(extension);\n if (first) {\n __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").set(type, extension);\n }\n first = false;\n if (starred)\n continue;\n const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(extension);\n if (currentType && currentType != type && !force) {\n throw new Error(`\"${type} -> ${extension}\" conflicts with \"${currentType} -> ${extension}\". Pass \\`force=true\\` to override this definition.`);\n }\n __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").set(extension, type);\n }\n }\n return this;\n }\n getType(path) {\n if (typeof path !== 'string')\n return null;\n const last = path.replace(/^.*[/\\\\]/, '').toLowerCase();\n const ext = last.replace(/^.*\\./, '').toLowerCase();\n const hasPath = last.length < path.length;\n const hasDot = ext.length < last.length - 1;\n if (!hasDot && hasPath)\n return null;\n return __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(ext) ?? null;\n }\n getExtension(type) {\n if (typeof type !== 'string')\n return null;\n type = type?.split?.(';')[0];\n return ((type && __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").get(type.trim().toLowerCase())) ?? null);\n }\n getAllExtensions(type) {\n if (typeof type !== 'string')\n return null;\n return __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type.toLowerCase()) ?? null;\n }\n _freeze() {\n this.define = () => {\n throw new Error('define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances');\n };\n Object.freeze(this);\n for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").values()) {\n Object.freeze(extensions);\n }\n return this;\n }\n _getTestState() {\n return {\n types: __classPrivateFieldGet(this, _Mime_extensionToType, \"f\"),\n extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\"),\n };\n }\n}\n_Mime_extensionToType = new WeakMap(), _Mime_typeToExtension = new WeakMap(), _Mime_typeToExtensions = new WeakMap();\nexport default Mime;\n//# sourceMappingURL=Mime.js.map","import standardTypes from '../types/standard.js';\nimport Mime from './Mime.js';\nexport { default as Mime } from './Mime.js';\nexport default new Mime(standardTypes)._freeze();\n//# sourceMappingURL=index_lite.js.map","'use strict';\n\nconst WIN_SLASH = '\\\\\\\\/';\nconst WIN_NO_SLASH = `[^${WIN_SLASH}]`;\n\n/**\n * Posix glob regex\n */\n\nconst DOT_LITERAL = '\\\\.';\nconst PLUS_LITERAL = '\\\\+';\nconst QMARK_LITERAL = '\\\\?';\nconst SLASH_LITERAL = '\\\\/';\nconst ONE_CHAR = '(?=.)';\nconst QMARK = '[^/]';\nconst END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;\nconst START_ANCHOR = `(?:^|${SLASH_LITERAL})`;\nconst DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;\nconst NO_DOT = `(?!${DOT_LITERAL})`;\nconst NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;\nconst NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;\nconst NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;\nconst QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;\nconst STAR = `${QMARK}*?`;\nconst SEP = '/';\n\nconst POSIX_CHARS = {\n DOT_LITERAL,\n PLUS_LITERAL,\n QMARK_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n QMARK,\n END_ANCHOR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOTS,\n NO_DOT_SLASH,\n NO_DOTS_SLASH,\n QMARK_NO_DOT,\n STAR,\n START_ANCHOR,\n SEP\n};\n\n/**\n * Windows glob regex\n */\n\nconst WINDOWS_CHARS = {\n ...POSIX_CHARS,\n\n SLASH_LITERAL: `[${WIN_SLASH}]`,\n QMARK: WIN_NO_SLASH,\n STAR: `${WIN_NO_SLASH}*?`,\n DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,\n NO_DOT: `(?!${DOT_LITERAL})`,\n NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,\n NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n QMARK_NO_DOT: `[^.${WIN_SLASH}]`,\n START_ANCHOR: `(?:^|[${WIN_SLASH}])`,\n END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,\n SEP: '\\\\'\n};\n\n/**\n * POSIX Bracket Regex\n */\n\nconst POSIX_REGEX_SOURCE = {\n alnum: 'a-zA-Z0-9',\n alpha: 'a-zA-Z',\n ascii: '\\\\x00-\\\\x7F',\n blank: ' \\\\t',\n cntrl: '\\\\x00-\\\\x1F\\\\x7F',\n digit: '0-9',\n graph: '\\\\x21-\\\\x7E',\n lower: 'a-z',\n print: '\\\\x20-\\\\x7E ',\n punct: '\\\\-!\"#$%&\\'()\\\\*+,./:;<=>?@[\\\\]^_`{|}~',\n space: ' \\\\t\\\\r\\\\n\\\\v\\\\f',\n upper: 'A-Z',\n word: 'A-Za-z0-9_',\n xdigit: 'A-Fa-f0-9'\n};\n\nmodule.exports = {\n MAX_LENGTH: 1024 * 64,\n POSIX_REGEX_SOURCE,\n\n // regular expressions\n REGEX_BACKSLASH: /\\\\(?![*+?^${}(|)[\\]])/g,\n REGEX_NON_SPECIAL_CHARS: /^[^@![\\].,$*+?^{}()|\\\\/]+/,\n REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\\]]/,\n REGEX_SPECIAL_CHARS_BACKREF: /(\\\\?)((\\W)(\\3*))/g,\n REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\\]])/g,\n REGEX_REMOVE_BACKSLASH: /(?:\\[.*?[^\\\\]\\]|\\\\(?=.))/g,\n\n // Replace globs with equivalent patterns to reduce parsing time.\n REPLACEMENTS: {\n '***': '*',\n '**/**': '**',\n '**/**/**': '**'\n },\n\n // Digits\n CHAR_0: 48, /* 0 */\n CHAR_9: 57, /* 9 */\n\n // Alphabet chars.\n CHAR_UPPERCASE_A: 65, /* A */\n CHAR_LOWERCASE_A: 97, /* a */\n CHAR_UPPERCASE_Z: 90, /* Z */\n CHAR_LOWERCASE_Z: 122, /* z */\n\n CHAR_LEFT_PARENTHESES: 40, /* ( */\n CHAR_RIGHT_PARENTHESES: 41, /* ) */\n\n CHAR_ASTERISK: 42, /* * */\n\n // Non-alphabetic chars.\n CHAR_AMPERSAND: 38, /* & */\n CHAR_AT: 64, /* @ */\n CHAR_BACKWARD_SLASH: 92, /* \\ */\n CHAR_CARRIAGE_RETURN: 13, /* \\r */\n CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */\n CHAR_COLON: 58, /* : */\n CHAR_COMMA: 44, /* , */\n CHAR_DOT: 46, /* . */\n CHAR_DOUBLE_QUOTE: 34, /* \" */\n CHAR_EQUAL: 61, /* = */\n CHAR_EXCLAMATION_MARK: 33, /* ! */\n CHAR_FORM_FEED: 12, /* \\f */\n CHAR_FORWARD_SLASH: 47, /* / */\n CHAR_GRAVE_ACCENT: 96, /* ` */\n CHAR_HASH: 35, /* # */\n CHAR_HYPHEN_MINUS: 45, /* - */\n CHAR_LEFT_ANGLE_BRACKET: 60, /* < */\n CHAR_LEFT_CURLY_BRACE: 123, /* { */\n CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */\n CHAR_LINE_FEED: 10, /* \\n */\n CHAR_NO_BREAK_SPACE: 160, /* \\u00A0 */\n CHAR_PERCENT: 37, /* % */\n CHAR_PLUS: 43, /* + */\n CHAR_QUESTION_MARK: 63, /* ? */\n CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */\n CHAR_RIGHT_CURLY_BRACE: 125, /* } */\n CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */\n CHAR_SEMICOLON: 59, /* ; */\n CHAR_SINGLE_QUOTE: 39, /* ' */\n CHAR_SPACE: 32, /* */\n CHAR_TAB: 9, /* \\t */\n CHAR_UNDERSCORE: 95, /* _ */\n CHAR_VERTICAL_LINE: 124, /* | */\n CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \\uFEFF */\n\n /**\n * Create EXTGLOB_CHARS\n */\n\n extglobChars(chars) {\n return {\n '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },\n '?': { type: 'qmark', open: '(?:', close: ')?' },\n '+': { type: 'plus', open: '(?:', close: ')+' },\n '*': { type: 'star', open: '(?:', close: ')*' },\n '@': { type: 'at', open: '(?:', close: ')' }\n };\n },\n\n /**\n * Create GLOB_CHARS\n */\n\n globChars(win32) {\n return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;\n }\n};\n","/*global navigator*/\n'use strict';\n\nconst {\n REGEX_BACKSLASH,\n REGEX_REMOVE_BACKSLASH,\n REGEX_SPECIAL_CHARS,\n REGEX_SPECIAL_CHARS_GLOBAL\n} = require('./constants');\n\nexports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);\nexports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);\nexports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);\nexports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\\\$1');\nexports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');\n\nexports.isWindows = () => {\n if (typeof navigator !== 'undefined' && navigator.platform) {\n const platform = navigator.platform.toLowerCase();\n return platform === 'win32' || platform === 'windows';\n }\n\n if (typeof process !== 'undefined' && process.platform) {\n return process.platform === 'win32';\n }\n\n return false;\n};\n\nexports.removeBackslashes = str => {\n return str.replace(REGEX_REMOVE_BACKSLASH, match => {\n return match === '\\\\' ? '' : match;\n });\n};\n\nexports.escapeLast = (input, char, lastIdx) => {\n const idx = input.lastIndexOf(char, lastIdx);\n if (idx === -1) return input;\n if (input[idx - 1] === '\\\\') return exports.escapeLast(input, char, idx - 1);\n return `${input.slice(0, idx)}\\\\${input.slice(idx)}`;\n};\n\nexports.removePrefix = (input, state = {}) => {\n let output = input;\n if (output.startsWith('./')) {\n output = output.slice(2);\n state.prefix = './';\n }\n return output;\n};\n\nexports.wrapOutput = (input, state = {}, options = {}) => {\n const prepend = options.contains ? '' : '^';\n const append = options.contains ? '' : '$';\n\n let output = `${prepend}(?:${input})${append}`;\n if (state.negated === true) {\n output = `(?:^(?!${output}).*$)`;\n }\n return output;\n};\n\nexports.basename = (path, { windows } = {}) => {\n const segs = path.split(windows ? /[\\\\/]/ : '/');\n const last = segs[segs.length - 1];\n\n if (last === '') {\n return segs[segs.length - 2];\n }\n\n return last;\n};\n","'use strict';\n\nconst utils = require('./utils');\nconst {\n CHAR_ASTERISK, /* * */\n CHAR_AT, /* @ */\n CHAR_BACKWARD_SLASH, /* \\ */\n CHAR_COMMA, /* , */\n CHAR_DOT, /* . */\n CHAR_EXCLAMATION_MARK, /* ! */\n CHAR_FORWARD_SLASH, /* / */\n CHAR_LEFT_CURLY_BRACE, /* { */\n CHAR_LEFT_PARENTHESES, /* ( */\n CHAR_LEFT_SQUARE_BRACKET, /* [ */\n CHAR_PLUS, /* + */\n CHAR_QUESTION_MARK, /* ? */\n CHAR_RIGHT_CURLY_BRACE, /* } */\n CHAR_RIGHT_PARENTHESES, /* ) */\n CHAR_RIGHT_SQUARE_BRACKET /* ] */\n} = require('./constants');\n\nconst isPathSeparator = code => {\n return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n};\n\nconst depth = token => {\n if (token.isPrefix !== true) {\n token.depth = token.isGlobstar ? Infinity : 1;\n }\n};\n\n/**\n * Quickly scans a glob pattern and returns an object with a handful of\n * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),\n * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not\n * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).\n *\n * ```js\n * const pm = require('picomatch');\n * console.log(pm.scan('foo/bar/*.js'));\n * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }\n * ```\n * @param {String} `str`\n * @param {Object} `options`\n * @return {Object} Returns an object with tokens and regex source string.\n * @api public\n */\n\nconst scan = (input, options) => {\n const opts = options || {};\n\n const length = input.length - 1;\n const scanToEnd = opts.parts === true || opts.scanToEnd === true;\n const slashes = [];\n const tokens = [];\n const parts = [];\n\n let str = input;\n let index = -1;\n let start = 0;\n let lastIndex = 0;\n let isBrace = false;\n let isBracket = false;\n let isGlob = false;\n let isExtglob = false;\n let isGlobstar = false;\n let braceEscaped = false;\n let backslashes = false;\n let negated = false;\n let negatedExtglob = false;\n let finished = false;\n let braces = 0;\n let prev;\n let code;\n let token = { value: '', depth: 0, isGlob: false };\n\n const eos = () => index >= length;\n const peek = () => str.charCodeAt(index + 1);\n const advance = () => {\n prev = code;\n return str.charCodeAt(++index);\n };\n\n while (index < length) {\n code = advance();\n let next;\n\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braceEscaped = true;\n }\n continue;\n }\n\n if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n continue;\n }\n\n if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (braceEscaped !== true && code === CHAR_COMMA) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_RIGHT_CURLY_BRACE) {\n braces--;\n\n if (braces === 0) {\n braceEscaped = false;\n isBrace = token.isBrace = true;\n finished = true;\n break;\n }\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_FORWARD_SLASH) {\n slashes.push(index);\n tokens.push(token);\n token = { value: '', depth: 0, isGlob: false };\n\n if (finished === true) continue;\n if (prev === CHAR_DOT && index === (start + 1)) {\n start += 2;\n continue;\n }\n\n lastIndex = index + 1;\n continue;\n }\n\n if (opts.noext !== true) {\n const isExtglobChar = code === CHAR_PLUS\n || code === CHAR_AT\n || code === CHAR_ASTERISK\n || code === CHAR_QUESTION_MARK\n || code === CHAR_EXCLAMATION_MARK;\n\n if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n isExtglob = token.isExtglob = true;\n finished = true;\n if (code === CHAR_EXCLAMATION_MARK && index === start) {\n negatedExtglob = true;\n }\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n }\n\n if (code === CHAR_ASTERISK) {\n if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_QUESTION_MARK) {\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_LEFT_SQUARE_BRACKET) {\n while (eos() !== true && (next = advance())) {\n if (next === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (next === CHAR_RIGHT_SQUARE_BRACKET) {\n isBracket = token.isBracket = true;\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {\n negated = token.negated = true;\n start++;\n continue;\n }\n\n if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_LEFT_PARENTHESES) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n\n if (isGlob === true) {\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n }\n\n if (opts.noext === true) {\n isExtglob = false;\n isGlob = false;\n }\n\n let base = str;\n let prefix = '';\n let glob = '';\n\n if (start > 0) {\n prefix = str.slice(0, start);\n str = str.slice(start);\n lastIndex -= start;\n }\n\n if (base && isGlob === true && lastIndex > 0) {\n base = str.slice(0, lastIndex);\n glob = str.slice(lastIndex);\n } else if (isGlob === true) {\n base = '';\n glob = str;\n } else {\n base = str;\n }\n\n if (base && base !== '' && base !== '/' && base !== str) {\n if (isPathSeparator(base.charCodeAt(base.length - 1))) {\n base = base.slice(0, -1);\n }\n }\n\n if (opts.unescape === true) {\n if (glob) glob = utils.removeBackslashes(glob);\n\n if (base && backslashes === true) {\n base = utils.removeBackslashes(base);\n }\n }\n\n const state = {\n prefix,\n input,\n start,\n base,\n glob,\n isBrace,\n isBracket,\n isGlob,\n isExtglob,\n isGlobstar,\n negated,\n negatedExtglob\n };\n\n if (opts.tokens === true) {\n state.maxDepth = 0;\n if (!isPathSeparator(code)) {\n tokens.push(token);\n }\n state.tokens = tokens;\n }\n\n if (opts.parts === true || opts.tokens === true) {\n let prevIndex;\n\n for (let idx = 0; idx < slashes.length; idx++) {\n const n = prevIndex ? prevIndex + 1 : start;\n const i = slashes[idx];\n const value = input.slice(n, i);\n if (opts.tokens) {\n if (idx === 0 && start !== 0) {\n tokens[idx].isPrefix = true;\n tokens[idx].value = prefix;\n } else {\n tokens[idx].value = value;\n }\n depth(tokens[idx]);\n state.maxDepth += tokens[idx].depth;\n }\n if (idx !== 0 || value !== '') {\n parts.push(value);\n }\n prevIndex = i;\n }\n\n if (prevIndex && prevIndex + 1 < input.length) {\n const value = input.slice(prevIndex + 1);\n parts.push(value);\n\n if (opts.tokens) {\n tokens[tokens.length - 1].value = value;\n depth(tokens[tokens.length - 1]);\n state.maxDepth += tokens[tokens.length - 1].depth;\n }\n }\n\n state.slashes = slashes;\n state.parts = parts;\n }\n\n return state;\n};\n\nmodule.exports = scan;\n","'use strict';\n\nconst constants = require('./constants');\nconst utils = require('./utils');\n\n/**\n * Constants\n */\n\nconst {\n MAX_LENGTH,\n POSIX_REGEX_SOURCE,\n REGEX_NON_SPECIAL_CHARS,\n REGEX_SPECIAL_CHARS_BACKREF,\n REPLACEMENTS\n} = constants;\n\n/**\n * Helpers\n */\n\nconst expandRange = (args, options) => {\n if (typeof options.expandRange === 'function') {\n return options.expandRange(...args, options);\n }\n\n args.sort();\n const value = `[${args.join('-')}]`;\n\n try {\n /* eslint-disable-next-line no-new */\n new RegExp(value);\n } catch (ex) {\n return args.map(v => utils.escapeRegex(v)).join('..');\n }\n\n return value;\n};\n\n/**\n * Create the message for a syntax error\n */\n\nconst syntaxError = (type, char) => {\n return `Missing ${type}: \"${char}\" - use \"\\\\\\\\${char}\" to match literal characters`;\n};\n\n/**\n * Parse the given input string.\n * @param {String} input\n * @param {Object} options\n * @return {Object}\n */\n\nconst parse = (input, options) => {\n if (typeof input !== 'string') {\n throw new TypeError('Expected a string');\n }\n\n input = REPLACEMENTS[input] || input;\n\n const opts = { ...options };\n const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n\n let len = input.length;\n if (len > max) {\n throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n }\n\n const bos = { type: 'bos', value: '', output: opts.prepend || '' };\n const tokens = [bos];\n\n const capture = opts.capture ? '' : '?:';\n\n // create constants based on platform, for windows or posix\n const PLATFORM_CHARS = constants.globChars(opts.windows);\n const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);\n\n const {\n DOT_LITERAL,\n PLUS_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOT_SLASH,\n NO_DOTS_SLASH,\n QMARK,\n QMARK_NO_DOT,\n STAR,\n START_ANCHOR\n } = PLATFORM_CHARS;\n\n const globstar = opts => {\n return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n };\n\n const nodot = opts.dot ? '' : NO_DOT;\n const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;\n let star = opts.bash === true ? globstar(opts) : STAR;\n\n if (opts.capture) {\n star = `(${star})`;\n }\n\n // minimatch options support\n if (typeof opts.noext === 'boolean') {\n opts.noextglob = opts.noext;\n }\n\n const state = {\n input,\n index: -1,\n start: 0,\n dot: opts.dot === true,\n consumed: '',\n output: '',\n prefix: '',\n backtrack: false,\n negated: false,\n brackets: 0,\n braces: 0,\n parens: 0,\n quotes: 0,\n globstar: false,\n tokens\n };\n\n input = utils.removePrefix(input, state);\n len = input.length;\n\n const extglobs = [];\n const braces = [];\n const stack = [];\n let prev = bos;\n let value;\n\n /**\n * Tokenizing helpers\n */\n\n const eos = () => state.index === len - 1;\n const peek = state.peek = (n = 1) => input[state.index + n];\n const advance = state.advance = () => input[++state.index] || '';\n const remaining = () => input.slice(state.index + 1);\n const consume = (value = '', num = 0) => {\n state.consumed += value;\n state.index += num;\n };\n\n const append = token => {\n state.output += token.output != null ? token.output : token.value;\n consume(token.value);\n };\n\n const negate = () => {\n let count = 1;\n\n while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {\n advance();\n state.start++;\n count++;\n }\n\n if (count % 2 === 0) {\n return false;\n }\n\n state.negated = true;\n state.start++;\n return true;\n };\n\n const increment = type => {\n state[type]++;\n stack.push(type);\n };\n\n const decrement = type => {\n state[type]--;\n stack.pop();\n };\n\n /**\n * Push tokens onto the tokens array. This helper speeds up\n * tokenizing by 1) helping us avoid backtracking as much as possible,\n * and 2) helping us avoid creating extra tokens when consecutive\n * characters are plain text. This improves performance and simplifies\n * lookbehinds.\n */\n\n const push = tok => {\n if (prev.type === 'globstar') {\n const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');\n const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));\n\n if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {\n state.output = state.output.slice(0, -prev.output.length);\n prev.type = 'star';\n prev.value = '*';\n prev.output = star;\n state.output += prev.output;\n }\n }\n\n if (extglobs.length && tok.type !== 'paren') {\n extglobs[extglobs.length - 1].inner += tok.value;\n }\n\n if (tok.value || tok.output) append(tok);\n if (prev && prev.type === 'text' && tok.type === 'text') {\n prev.output = (prev.output || prev.value) + tok.value;\n prev.value += tok.value;\n return;\n }\n\n tok.prev = prev;\n tokens.push(tok);\n prev = tok;\n };\n\n const extglobOpen = (type, value) => {\n const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };\n\n token.prev = prev;\n token.parens = state.parens;\n token.output = state.output;\n const output = (opts.capture ? '(' : '') + token.open;\n\n increment('parens');\n push({ type, value, output: state.output ? '' : ONE_CHAR });\n push({ type: 'paren', extglob: true, value: advance(), output });\n extglobs.push(token);\n };\n\n const extglobClose = token => {\n let output = token.close + (opts.capture ? ')' : '');\n let rest;\n\n if (token.type === 'negate') {\n let extglobStar = star;\n\n if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {\n extglobStar = globstar(opts);\n }\n\n if (extglobStar !== star || eos() || /^\\)+$/.test(remaining())) {\n output = token.close = `)$))${extglobStar}`;\n }\n\n if (token.inner.includes('*') && (rest = remaining()) && /^\\.[^\\\\/.]+$/.test(rest)) {\n // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.\n // In this case, we need to parse the string and use it in the output of the original pattern.\n // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.\n //\n // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.\n const expression = parse(rest, { ...options, fastpaths: false }).output;\n\n output = token.close = `)${expression})${extglobStar})`;\n }\n\n if (token.prev.type === 'bos') {\n state.negatedExtglob = true;\n }\n }\n\n push({ type: 'paren', extglob: true, value, output });\n decrement('parens');\n };\n\n /**\n * Fast paths\n */\n\n if (opts.fastpaths !== false && !/(^[*!]|[/()[\\]{}\"])/.test(input)) {\n let backslashes = false;\n\n let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {\n if (first === '\\\\') {\n backslashes = true;\n return m;\n }\n\n if (first === '?') {\n if (esc) {\n return esc + first + (rest ? QMARK.repeat(rest.length) : '');\n }\n if (index === 0) {\n return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');\n }\n return QMARK.repeat(chars.length);\n }\n\n if (first === '.') {\n return DOT_LITERAL.repeat(chars.length);\n }\n\n if (first === '*') {\n if (esc) {\n return esc + first + (rest ? star : '');\n }\n return star;\n }\n return esc ? m : `\\\\${m}`;\n });\n\n if (backslashes === true) {\n if (opts.unescape === true) {\n output = output.replace(/\\\\/g, '');\n } else {\n output = output.replace(/\\\\+/g, m => {\n return m.length % 2 === 0 ? '\\\\\\\\' : (m ? '\\\\' : '');\n });\n }\n }\n\n if (output === input && opts.contains === true) {\n state.output = input;\n return state;\n }\n\n state.output = utils.wrapOutput(output, state, options);\n return state;\n }\n\n /**\n * Tokenize input until we reach end-of-string\n */\n\n while (!eos()) {\n value = advance();\n\n if (value === '\\u0000') {\n continue;\n }\n\n /**\n * Escaped characters\n */\n\n if (value === '\\\\') {\n const next = peek();\n\n if (next === '/' && opts.bash !== true) {\n continue;\n }\n\n if (next === '.' || next === ';') {\n continue;\n }\n\n if (!next) {\n value += '\\\\';\n push({ type: 'text', value });\n continue;\n }\n\n // collapse slashes to reduce potential for exploits\n const match = /^\\\\+/.exec(remaining());\n let slashes = 0;\n\n if (match && match[0].length > 2) {\n slashes = match[0].length;\n state.index += slashes;\n if (slashes % 2 !== 0) {\n value += '\\\\';\n }\n }\n\n if (opts.unescape === true) {\n value = advance();\n } else {\n value += advance();\n }\n\n if (state.brackets === 0) {\n push({ type: 'text', value });\n continue;\n }\n }\n\n /**\n * If we're inside a regex character class, continue\n * until we reach the closing bracket.\n */\n\n if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {\n if (opts.posix !== false && value === ':') {\n const inner = prev.value.slice(1);\n if (inner.includes('[')) {\n prev.posix = true;\n\n if (inner.includes(':')) {\n const idx = prev.value.lastIndexOf('[');\n const pre = prev.value.slice(0, idx);\n const rest = prev.value.slice(idx + 2);\n const posix = POSIX_REGEX_SOURCE[rest];\n if (posix) {\n prev.value = pre + posix;\n state.backtrack = true;\n advance();\n\n if (!bos.output && tokens.indexOf(prev) === 1) {\n bos.output = ONE_CHAR;\n }\n continue;\n }\n }\n }\n }\n\n if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {\n value = `\\\\${value}`;\n }\n\n if (value === ']' && (prev.value === '[' || prev.value === '[^')) {\n value = `\\\\${value}`;\n }\n\n if (opts.posix === true && value === '!' && prev.value === '[') {\n value = '^';\n }\n\n prev.value += value;\n append({ value });\n continue;\n }\n\n /**\n * If we're inside a quoted string, continue\n * until we reach the closing double quote.\n */\n\n if (state.quotes === 1 && value !== '\"') {\n value = utils.escapeRegex(value);\n prev.value += value;\n append({ value });\n continue;\n }\n\n /**\n * Double quotes\n */\n\n if (value === '\"') {\n state.quotes = state.quotes === 1 ? 0 : 1;\n if (opts.keepQuotes === true) {\n push({ type: 'text', value });\n }\n continue;\n }\n\n /**\n * Parentheses\n */\n\n if (value === '(') {\n increment('parens');\n push({ type: 'paren', value });\n continue;\n }\n\n if (value === ')') {\n if (state.parens === 0 && opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('opening', '('));\n }\n\n const extglob = extglobs[extglobs.length - 1];\n if (extglob && state.parens === extglob.parens + 1) {\n extglobClose(extglobs.pop());\n continue;\n }\n\n push({ type: 'paren', value, output: state.parens ? ')' : '\\\\)' });\n decrement('parens');\n continue;\n }\n\n /**\n * Square brackets\n */\n\n if (value === '[') {\n if (opts.nobracket === true || !remaining().includes(']')) {\n if (opts.nobracket !== true && opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('closing', ']'));\n }\n\n value = `\\\\${value}`;\n } else {\n increment('brackets');\n }\n\n push({ type: 'bracket', value });\n continue;\n }\n\n if (value === ']') {\n if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {\n push({ type: 'text', value, output: `\\\\${value}` });\n continue;\n }\n\n if (state.brackets === 0) {\n if (opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('opening', '['));\n }\n\n push({ type: 'text', value, output: `\\\\${value}` });\n continue;\n }\n\n decrement('brackets');\n\n const prevValue = prev.value.slice(1);\n if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {\n value = `/${value}`;\n }\n\n prev.value += value;\n append({ value });\n\n // when literal brackets are explicitly disabled\n // assume we should match with a regex character class\n if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {\n continue;\n }\n\n const escaped = utils.escapeRegex(prev.value);\n state.output = state.output.slice(0, -prev.value.length);\n\n // when literal brackets are explicitly enabled\n // assume we should escape the brackets to match literal characters\n if (opts.literalBrackets === true) {\n state.output += escaped;\n prev.value = escaped;\n continue;\n }\n\n // when the user specifies nothing, try to match both\n prev.value = `(${capture}${escaped}|${prev.value})`;\n state.output += prev.value;\n continue;\n }\n\n /**\n * Braces\n */\n\n if (value === '{' && opts.nobrace !== true) {\n increment('braces');\n\n const open = {\n type: 'brace',\n value,\n output: '(',\n outputIndex: state.output.length,\n tokensIndex: state.tokens.length\n };\n\n braces.push(open);\n push(open);\n continue;\n }\n\n if (value === '}') {\n const brace = braces[braces.length - 1];\n\n if (opts.nobrace === true || !brace) {\n push({ type: 'text', value, output: value });\n continue;\n }\n\n let output = ')';\n\n if (brace.dots === true) {\n const arr = tokens.slice();\n const range = [];\n\n for (let i = arr.length - 1; i >= 0; i--) {\n tokens.pop();\n if (arr[i].type === 'brace') {\n break;\n }\n if (arr[i].type !== 'dots') {\n range.unshift(arr[i].value);\n }\n }\n\n output = expandRange(range, opts);\n state.backtrack = true;\n }\n\n if (brace.comma !== true && brace.dots !== true) {\n const out = state.output.slice(0, brace.outputIndex);\n const toks = state.tokens.slice(brace.tokensIndex);\n brace.value = brace.output = '\\\\{';\n value = output = '\\\\}';\n state.output = out;\n for (const t of toks) {\n state.output += (t.output || t.value);\n }\n }\n\n push({ type: 'brace', value, output });\n decrement('braces');\n braces.pop();\n continue;\n }\n\n /**\n * Pipes\n */\n\n if (value === '|') {\n if (extglobs.length > 0) {\n extglobs[extglobs.length - 1].conditions++;\n }\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Commas\n */\n\n if (value === ',') {\n let output = value;\n\n const brace = braces[braces.length - 1];\n if (brace && stack[stack.length - 1] === 'braces') {\n brace.comma = true;\n output = '|';\n }\n\n push({ type: 'comma', value, output });\n continue;\n }\n\n /**\n * Slashes\n */\n\n if (value === '/') {\n // if the beginning of the glob is \"./\", advance the start\n // to the current index, and don't add the \"./\" characters\n // to the state. This greatly simplifies lookbehinds when\n // checking for BOS characters like \"!\" and \".\" (not \"./\")\n if (prev.type === 'dot' && state.index === state.start + 1) {\n state.start = state.index + 1;\n state.consumed = '';\n state.output = '';\n tokens.pop();\n prev = bos; // reset \"prev\" to the first token\n continue;\n }\n\n push({ type: 'slash', value, output: SLASH_LITERAL });\n continue;\n }\n\n /**\n * Dots\n */\n\n if (value === '.') {\n if (state.braces > 0 && prev.type === 'dot') {\n if (prev.value === '.') prev.output = DOT_LITERAL;\n const brace = braces[braces.length - 1];\n prev.type = 'dots';\n prev.output += value;\n prev.value += value;\n brace.dots = true;\n continue;\n }\n\n if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {\n push({ type: 'text', value, output: DOT_LITERAL });\n continue;\n }\n\n push({ type: 'dot', value, output: DOT_LITERAL });\n continue;\n }\n\n /**\n * Question marks\n */\n\n if (value === '?') {\n const isGroup = prev && prev.value === '(';\n if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n extglobOpen('qmark', value);\n continue;\n }\n\n if (prev && prev.type === 'paren') {\n const next = peek();\n let output = value;\n\n if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\\w+>)/.test(remaining()))) {\n output = `\\\\${value}`;\n }\n\n push({ type: 'text', value, output });\n continue;\n }\n\n if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {\n push({ type: 'qmark', value, output: QMARK_NO_DOT });\n continue;\n }\n\n push({ type: 'qmark', value, output: QMARK });\n continue;\n }\n\n /**\n * Exclamation\n */\n\n if (value === '!') {\n if (opts.noextglob !== true && peek() === '(') {\n if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {\n extglobOpen('negate', value);\n continue;\n }\n }\n\n if (opts.nonegate !== true && state.index === 0) {\n negate();\n continue;\n }\n }\n\n /**\n * Plus\n */\n\n if (value === '+') {\n if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n extglobOpen('plus', value);\n continue;\n }\n\n if ((prev && prev.value === '(') || opts.regex === false) {\n push({ type: 'plus', value, output: PLUS_LITERAL });\n continue;\n }\n\n if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {\n push({ type: 'plus', value });\n continue;\n }\n\n push({ type: 'plus', value: PLUS_LITERAL });\n continue;\n }\n\n /**\n * Plain text\n */\n\n if (value === '@') {\n if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n push({ type: 'at', extglob: true, value, output: '' });\n continue;\n }\n\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Plain text\n */\n\n if (value !== '*') {\n if (value === '$' || value === '^') {\n value = `\\\\${value}`;\n }\n\n const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());\n if (match) {\n value += match[0];\n state.index += match[0].length;\n }\n\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Stars\n */\n\n if (prev && (prev.type === 'globstar' || prev.star === true)) {\n prev.type = 'star';\n prev.star = true;\n prev.value += value;\n prev.output = star;\n state.backtrack = true;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n let rest = remaining();\n if (opts.noextglob !== true && /^\\([^?]/.test(rest)) {\n extglobOpen('star', value);\n continue;\n }\n\n if (prev.type === 'star') {\n if (opts.noglobstar === true) {\n consume(value);\n continue;\n }\n\n const prior = prev.prev;\n const before = prior.prev;\n const isStart = prior.type === 'slash' || prior.type === 'bos';\n const afterStar = before && (before.type === 'star' || before.type === 'globstar');\n\n if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {\n push({ type: 'star', value, output: '' });\n continue;\n }\n\n const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');\n const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');\n if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {\n push({ type: 'star', value, output: '' });\n continue;\n }\n\n // strip consecutive `/**/`\n while (rest.slice(0, 3) === '/**') {\n const after = input[state.index + 4];\n if (after && after !== '/') {\n break;\n }\n rest = rest.slice(3);\n consume('/**', 3);\n }\n\n if (prior.type === 'bos' && eos()) {\n prev.type = 'globstar';\n prev.value += value;\n prev.output = globstar(opts);\n state.output = prev.output;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {\n state.output = state.output.slice(0, -(prior.output + prev.output).length);\n prior.output = `(?:${prior.output}`;\n\n prev.type = 'globstar';\n prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');\n prev.value += value;\n state.globstar = true;\n state.output += prior.output + prev.output;\n consume(value);\n continue;\n }\n\n if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {\n const end = rest[1] !== void 0 ? '|$' : '';\n\n state.output = state.output.slice(0, -(prior.output + prev.output).length);\n prior.output = `(?:${prior.output}`;\n\n prev.type = 'globstar';\n prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;\n prev.value += value;\n\n state.output += prior.output + prev.output;\n state.globstar = true;\n\n consume(value + advance());\n\n push({ type: 'slash', value: '/', output: '' });\n continue;\n }\n\n if (prior.type === 'bos' && rest[0] === '/') {\n prev.type = 'globstar';\n prev.value += value;\n prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;\n state.output = prev.output;\n state.globstar = true;\n consume(value + advance());\n push({ type: 'slash', value: '/', output: '' });\n continue;\n }\n\n // remove single star from output\n state.output = state.output.slice(0, -prev.output.length);\n\n // reset previous token to globstar\n prev.type = 'globstar';\n prev.output = globstar(opts);\n prev.value += value;\n\n // reset output with globstar\n state.output += prev.output;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n const token = { type: 'star', value, output: star };\n\n if (opts.bash === true) {\n token.output = '.*?';\n if (prev.type === 'bos' || prev.type === 'slash') {\n token.output = nodot + token.output;\n }\n push(token);\n continue;\n }\n\n if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {\n token.output = value;\n push(token);\n continue;\n }\n\n if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {\n if (prev.type === 'dot') {\n state.output += NO_DOT_SLASH;\n prev.output += NO_DOT_SLASH;\n\n } else if (opts.dot === true) {\n state.output += NO_DOTS_SLASH;\n prev.output += NO_DOTS_SLASH;\n\n } else {\n state.output += nodot;\n prev.output += nodot;\n }\n\n if (peek() !== '*') {\n state.output += ONE_CHAR;\n prev.output += ONE_CHAR;\n }\n }\n\n push(token);\n }\n\n while (state.brackets > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));\n state.output = utils.escapeLast(state.output, '[');\n decrement('brackets');\n }\n\n while (state.parens > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));\n state.output = utils.escapeLast(state.output, '(');\n decrement('parens');\n }\n\n while (state.braces > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));\n state.output = utils.escapeLast(state.output, '{');\n decrement('braces');\n }\n\n if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {\n push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });\n }\n\n // rebuild the output if we had to backtrack at any point\n if (state.backtrack === true) {\n state.output = '';\n\n for (const token of state.tokens) {\n state.output += token.output != null ? token.output : token.value;\n\n if (token.suffix) {\n state.output += token.suffix;\n }\n }\n }\n\n return state;\n};\n\n/**\n * Fast paths for creating regular expressions for common glob patterns.\n * This can significantly speed up processing and has very little downside\n * impact when none of the fast paths match.\n */\n\nparse.fastpaths = (input, options) => {\n const opts = { ...options };\n const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n const len = input.length;\n if (len > max) {\n throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n }\n\n input = REPLACEMENTS[input] || input;\n\n // create constants based on platform, for windows or posix\n const {\n DOT_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOTS,\n NO_DOTS_SLASH,\n STAR,\n START_ANCHOR\n } = constants.globChars(opts.windows);\n\n const nodot = opts.dot ? NO_DOTS : NO_DOT;\n const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;\n const capture = opts.capture ? '' : '?:';\n const state = { negated: false, prefix: '' };\n let star = opts.bash === true ? '.*?' : STAR;\n\n if (opts.capture) {\n star = `(${star})`;\n }\n\n const globstar = opts => {\n if (opts.noglobstar === true) return star;\n return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n };\n\n const create = str => {\n switch (str) {\n case '*':\n return `${nodot}${ONE_CHAR}${star}`;\n\n case '.*':\n return `${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '*.*':\n return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '*/*':\n return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;\n\n case '**':\n return nodot + globstar(opts);\n\n case '**/*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;\n\n case '**/*.*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '**/.*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n default: {\n const match = /^(.*?)\\.(\\w+)$/.exec(str);\n if (!match) return;\n\n const source = create(match[1]);\n if (!source) return;\n\n return source + DOT_LITERAL + match[2];\n }\n }\n };\n\n const output = utils.removePrefix(input, state);\n let source = create(output);\n\n if (source && opts.strictSlashes !== true) {\n source += `${SLASH_LITERAL}?`;\n }\n\n return source;\n};\n\nmodule.exports = parse;\n","'use strict';\n\nconst scan = require('./scan');\nconst parse = require('./parse');\nconst utils = require('./utils');\nconst constants = require('./constants');\nconst isObject = val => val && typeof val === 'object' && !Array.isArray(val);\n\n/**\n * Creates a matcher function from one or more glob patterns. The\n * returned function takes a string to match as its first argument,\n * and returns true if the string is a match. The returned matcher\n * function also takes a boolean as the second argument that, when true,\n * returns an object with additional information.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch(glob[, options]);\n *\n * const isMatch = picomatch('*.!(*a)');\n * console.log(isMatch('a.a')); //=> false\n * console.log(isMatch('a.b')); //=> true\n * ```\n * @name picomatch\n * @param {String|Array} `globs` One or more glob patterns.\n * @param {Object=} `options`\n * @return {Function=} Returns a matcher function.\n * @api public\n */\n\nconst picomatch = (glob, options, returnState = false) => {\n if (Array.isArray(glob)) {\n const fns = glob.map(input => picomatch(input, options, returnState));\n const arrayMatcher = str => {\n for (const isMatch of fns) {\n const state = isMatch(str);\n if (state) return state;\n }\n return false;\n };\n return arrayMatcher;\n }\n\n const isState = isObject(glob) && glob.tokens && glob.input;\n\n if (glob === '' || (typeof glob !== 'string' && !isState)) {\n throw new TypeError('Expected pattern to be a non-empty string');\n }\n\n const opts = options || {};\n const posix = opts.windows;\n const regex = isState\n ? picomatch.compileRe(glob, options)\n : picomatch.makeRe(glob, options, false, true);\n\n const state = regex.state;\n delete regex.state;\n\n let isIgnored = () => false;\n if (opts.ignore) {\n const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };\n isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);\n }\n\n const matcher = (input, returnObject = false) => {\n const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });\n const result = { glob, state, regex, posix, input, output, match, isMatch };\n\n if (typeof opts.onResult === 'function') {\n opts.onResult(result);\n }\n\n if (isMatch === false) {\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (isIgnored(input)) {\n if (typeof opts.onIgnore === 'function') {\n opts.onIgnore(result);\n }\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (typeof opts.onMatch === 'function') {\n opts.onMatch(result);\n }\n return returnObject ? result : true;\n };\n\n if (returnState) {\n matcher.state = state;\n }\n\n return matcher;\n};\n\n/**\n * Test `input` with the given `regex`. This is used by the main\n * `picomatch()` function to test the input string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.test(input, regex[, options]);\n *\n * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\\/([^/]*?))$/));\n * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp} `regex`\n * @return {Object} Returns an object with matching info.\n * @api public\n */\n\npicomatch.test = (input, regex, options, { glob, posix } = {}) => {\n if (typeof input !== 'string') {\n throw new TypeError('Expected input to be a string');\n }\n\n if (input === '') {\n return { isMatch: false, output: '' };\n }\n\n const opts = options || {};\n const format = opts.format || (posix ? utils.toPosixSlashes : null);\n let match = input === glob;\n let output = (match && format) ? format(input) : input;\n\n if (match === false) {\n output = format ? format(input) : input;\n match = output === glob;\n }\n\n if (match === false || opts.capture === true) {\n if (opts.matchBase === true || opts.basename === true) {\n match = picomatch.matchBase(input, regex, options, posix);\n } else {\n match = regex.exec(output);\n }\n }\n\n return { isMatch: Boolean(match), match, output };\n};\n\n/**\n * Match the basename of a filepath.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.matchBase(input, glob[, options]);\n * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).\n * @return {Boolean}\n * @api public\n */\n\npicomatch.matchBase = (input, glob, options) => {\n const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);\n return regex.test(utils.basename(input));\n};\n\n/**\n * Returns true if **any** of the given glob `patterns` match the specified `string`.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.isMatch(string, patterns[, options]);\n *\n * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true\n * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false\n * ```\n * @param {String|Array} str The string to test.\n * @param {String|Array} patterns One or more glob patterns to use for matching.\n * @param {Object} [options] See available [options](#options).\n * @return {Boolean} Returns true if any patterns match `str`\n * @api public\n */\n\npicomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);\n\n/**\n * Parse a glob pattern to create the source string for a regular\n * expression.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const result = picomatch.parse(pattern[, options]);\n * ```\n * @param {String} `pattern`\n * @param {Object} `options`\n * @return {Object} Returns an object with useful properties and output to be used as a regex source string.\n * @api public\n */\n\npicomatch.parse = (pattern, options) => {\n if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));\n return parse(pattern, { ...options, fastpaths: false });\n};\n\n/**\n * Scan a glob pattern to separate the pattern into segments.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.scan(input[, options]);\n *\n * const result = picomatch.scan('!./foo/*.js');\n * console.log(result);\n * { prefix: '!./',\n * input: '!./foo/*.js',\n * start: 3,\n * base: 'foo',\n * glob: '*.js',\n * isBrace: false,\n * isBracket: false,\n * isGlob: true,\n * isExtglob: false,\n * isGlobstar: false,\n * negated: true }\n * ```\n * @param {String} `input` Glob pattern to scan.\n * @param {Object} `options`\n * @return {Object} Returns an object with\n * @api public\n */\n\npicomatch.scan = (input, options) => scan(input, options);\n\n/**\n * Compile a regular expression from the `state` object returned by the\n * [parse()](#parse) method.\n *\n * @param {Object} `state`\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.\n * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.\n * @return {RegExp}\n * @api public\n */\n\npicomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {\n if (returnOutput === true) {\n return state.output;\n }\n\n const opts = options || {};\n const prepend = opts.contains ? '' : '^';\n const append = opts.contains ? '' : '$';\n\n let source = `${prepend}(?:${state.output})${append}`;\n if (state && state.negated === true) {\n source = `^(?!${source}).*$`;\n }\n\n const regex = picomatch.toRegex(source, options);\n if (returnState === true) {\n regex.state = state;\n }\n\n return regex;\n};\n\n/**\n * Create a regular expression from a parsed glob pattern.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const state = picomatch.parse('*.js');\n * // picomatch.compileRe(state[, options]);\n *\n * console.log(picomatch.compileRe(state));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `state` The object returned from the `.parse` method.\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.\n * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.\n * @return {RegExp} Returns a regex created from the given pattern.\n * @api public\n */\n\npicomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {\n if (!input || typeof input !== 'string') {\n throw new TypeError('Expected a non-empty string');\n }\n\n let parsed = { negated: false, fastpaths: true };\n\n if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {\n parsed.output = parse.fastpaths(input, options);\n }\n\n if (!parsed.output) {\n parsed = parse(input, options);\n }\n\n return picomatch.compileRe(parsed, options, returnOutput, returnState);\n};\n\n/**\n * Create a regular expression from the given regex source string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.toRegex(source[, options]);\n *\n * const { output } = picomatch.parse('*.js');\n * console.log(picomatch.toRegex(output));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `source` Regular expression source string.\n * @param {Object} `options`\n * @return {RegExp}\n * @api public\n */\n\npicomatch.toRegex = (source, options) => {\n try {\n const opts = options || {};\n return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));\n } catch (err) {\n if (options && options.debug === true) throw err;\n return /$^/;\n }\n};\n\n/**\n * Picomatch constants.\n * @return {Object}\n */\n\npicomatch.constants = constants;\n\n/**\n * Expose \"picomatch\"\n */\n\nmodule.exports = picomatch;\n","'use strict';\n\nmodule.exports = require('./lib/picomatch');\n","import mime from \"mime/lite\";\nimport picomatch from \"picomatch/posix\";\n\nconst parseInputAccept = (inputAccept: string): [string[], string[]] => {\n const extensions: string[] = [];\n const mimeTypes: string[] = [];\n\n inputAccept\n .split(\",\")\n .map(mimeType => mimeType.trim())\n .filter(Boolean)\n .forEach(fileType => {\n if (fileType.startsWith(\".\")) {\n extensions.push(`*${fileType}`);\n } else {\n mimeTypes.push(fileType);\n }\n });\n\n return [extensions, mimeTypes];\n};\n\nclass AcceptedFileTypes {\n private extensions: string[];\n private mimeTypes: string[];\n\n constructor(inputAccept: string) {\n const [extensions, mimeTypes] = parseInputAccept(inputAccept);\n\n this.extensions = extensions;\n this.mimeTypes = mimeTypes;\n }\n\n private isExtensionAccepted(fileName: string): boolean {\n if (this.extensions.length === 0) {\n return false;\n }\n\n return picomatch.isMatch(fileName, this.extensions);\n }\n\n private isMimeTypeAccepted(mimeType: null | string): boolean {\n if (!mimeType || this.mimeTypes.length === 0) {\n return false;\n }\n\n return picomatch.isMatch(mimeType, this.mimeTypes);\n }\n\n public isAccepted(fileName: string): boolean {\n if (this.extensions.length === 0 && this.mimeTypes.length === 0) {\n return true;\n }\n return (\n this.isMimeTypeAccepted(mime.getType(fileName)) ||\n this.isExtensionAccepted(fileName)\n );\n }\n}\n\nexport default AcceptedFileTypes;\n","import AcceptedFileTypes from \"./accepted_file_types.ts\";\nimport RenderUploadFile from \"./render_upload_file.ts\";\n\nconst getEntriesFromDirectory = async (\n directoryEntry: FileSystemDirectoryEntry\n): Promise =>\n new Promise((resolve, reject) => {\n directoryEntry.createReader().readEntries(resolve, reject);\n });\n\nconst getFileFromFileSystemFileEntry = async (\n fileEntry: FileSystemFileEntry\n): Promise =>\n new Promise((resolve, reject) => {\n fileEntry.file(resolve, reject);\n });\n\nconst getFilesFromFileSystemEntries = async (\n entries: FileSystemEntry[]\n): Promise => {\n const result: File[] = [];\n\n for (const entry of entries) {\n const filesFromEntry = await getFilesFromFileSystemEntry(entry);\n filesFromEntry.forEach(file => result.push(file));\n }\n\n return result;\n};\n\nconst getFilesFromFileSystemEntry = async (\n entry: FileSystemEntry\n): Promise => {\n const result: File[] = [];\n\n if (entry.isFile) {\n const file = await getFileFromFileSystemFileEntry(\n entry as FileSystemFileEntry\n );\n result.push(file);\n } else if (entry.isDirectory) {\n const entriesFromDirectory = await getEntriesFromDirectory(\n entry as FileSystemDirectoryEntry\n );\n const files = await getFilesFromFileSystemEntries(entriesFromDirectory);\n files.forEach(file => result.push(file));\n }\n\n return result;\n};\n\nconst getFilesFromDataTransfer = async (\n dataTransfer: DataTransfer\n): Promise => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (dataTransfer.items) {\n const files: File[] = [];\n\n for (const item of dataTransfer.items) {\n const fileSystemEntry = item.webkitGetAsEntry();\n if (fileSystemEntry) {\n const filesFromEntry = await getFilesFromFileSystemEntry(\n fileSystemEntry\n );\n filesFromEntry.forEach(file => files.push(file));\n } else {\n const file = item.getAsFile();\n\n if (file) {\n files.push(file);\n }\n }\n }\n\n return files;\n } else {\n // backwards compatibility\n return [...dataTransfer.files];\n }\n};\n\nclass DropArea {\n acceptedFileTypes: AcceptedFileTypes;\n container: Element;\n onDrop = (e: Event): void => {\n const dragEvent = e as DragEvent;\n this.container.classList.remove(\"dff-dropping\");\n dragEvent.preventDefault();\n dragEvent.stopPropagation();\n\n const uploadFiles = async (): Promise => {\n try {\n if (dragEvent.dataTransfer) {\n const files = await getFilesFromDataTransfer(dragEvent.dataTransfer);\n const acceptedFiles: File[] = [];\n const invalidFiles: File[] = [];\n\n for (const file of files) {\n if (this.acceptedFileTypes.isAccepted(file.name)) {\n acceptedFiles.push(file);\n } else {\n invalidFiles.push(file);\n }\n }\n\n this.renderer.setErrorInvalidFiles(invalidFiles);\n void this.onUploadFiles(acceptedFiles);\n }\n } catch (error) {\n console.error(error);\n }\n };\n\n void uploadFiles();\n };\n onUploadFiles: (files: File[]) => Promise;\n\n renderer: RenderUploadFile;\n\n constructor({\n container,\n inputAccept,\n onUploadFiles,\n renderer\n }: {\n container: Element;\n inputAccept: string;\n onUploadFiles: (files: File[]) => Promise;\n renderer: RenderUploadFile;\n }) {\n this.container = container;\n this.onUploadFiles = onUploadFiles;\n this.acceptedFileTypes = new AcceptedFileTypes(inputAccept);\n this.renderer = renderer;\n\n container.addEventListener(\"dragenter\", () => {\n container.classList.add(\"dff-dropping\");\n });\n container.addEventListener(\"dragleave\", () => {\n container.classList.remove(\"dff-dropping\");\n });\n container.addEventListener(\"dragover\", e => {\n container.classList.add(\"dff-dropping\");\n e.preventDefault();\n });\n container.addEventListener(\"drop\", this.onDrop);\n }\n}\n\nexport default DropArea;\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","export const formatBytes = (bytes: number, decimals: number): string => {\n if (bytes === 0) {\n return \"0 Bytes\";\n }\n\n const k = 1024;\n const dm = decimals <= 0 ? 0 : decimals || 2;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n const n = parseFloat((bytes / k ** i).toFixed(dm));\n const size = sizes[i];\n\n if (size == null) {\n return \"\";\n } else {\n return `${n.toString()} ${size}`;\n }\n};\n\nexport const getInputNameWithPrefix = (\n fieldName: string,\n prefix: null | string\n): string => (prefix ? `${prefix}-${fieldName}` : fieldName);\n\nconst getInputNameWithoutPrefix = (\n fieldName: string,\n prefix: null | string\n): string => (prefix ? fieldName.slice(prefix.length + 1) : fieldName);\n\nexport const findInput = (\n form: Element,\n fieldName: string,\n prefix: null | string\n): HTMLInputElement | null => {\n const inputNameWithPrefix = getInputNameWithPrefix(fieldName, prefix);\n const input = form.querySelector(`[name=\"${inputNameWithPrefix}\"]`);\n\n if (!input) {\n return null;\n }\n\n return input as HTMLInputElement;\n};\n\nexport const getUploadsFieldName = (\n fieldName: string,\n prefix: null | string\n): string => `${getInputNameWithoutPrefix(fieldName, prefix)}-uploads`;\n\nexport const getInputValueForFormAndPrefix = (\n form: Element,\n fieldName: string,\n prefix: null | string\n): string | undefined => findInput(form, fieldName, prefix)?.value;\n\nexport const getMetadataFieldName = (\n fieldName: string,\n prefix: null | string\n): string => `${getInputNameWithoutPrefix(fieldName, prefix)}-metadata`;\n","import escape from \"escape-html\";\n\nimport { formatBytes } from \"./util.ts\";\n\nclass RenderUploadFile {\n private createErrorContainer = (parent: Element): Element => {\n const div = document.createElement(\"div\");\n div.className = \"dff-invalid-files\";\n parent.appendChild(div);\n return div;\n };\n private createFilesContainer = (parent: Element): Element => {\n const div = document.createElement(\"div\");\n div.className = \"dff-files\";\n parent.appendChild(div);\n\n return div;\n };\n container: Element;\n errors: Element;\n\n input: HTMLInputElement;\n\n translations: Record;\n\n constructor({\n input,\n parent,\n skipRequired,\n translations\n }: {\n input: HTMLInputElement;\n parent: Element;\n skipRequired: boolean;\n translations: Record;\n }) {\n this.container = this.createFilesContainer(parent);\n this.errors = this.createErrorContainer(parent);\n this.input = input;\n this.translations = translations;\n\n if (skipRequired) {\n this.input.required = false;\n }\n }\n\n private addFile(filename: string, uploadIndex: number): HTMLElement {\n const div = document.createElement(\"div\");\n div.className = `dff-file dff-file-id-${uploadIndex.toString()}`;\n\n const nameSpan = document.createElement(\"span\");\n nameSpan.innerHTML = escape(filename);\n nameSpan.className = \"dff-filename\";\n nameSpan.setAttribute(\"data-index\", uploadIndex.toString());\n\n div.appendChild(nameSpan);\n this.container.appendChild(div);\n\n this.input.required = false;\n return div;\n }\n\n private enableDelete(index: number): void {\n const deleteLink = this.findDeleteLink(index);\n\n if (deleteLink) {\n deleteLink.classList.remove(\"dff-disabled\");\n }\n }\n\n private findCancelSpan(index: number): HTMLElement | null {\n const el = this.findFileDiv(index);\n\n if (!el) {\n return null;\n }\n\n return el.querySelector(\".dff-cancel\");\n }\n\n private findDeleteLink(index: number): HTMLElement | null {\n const div = this.findFileDiv(index);\n if (!div) {\n return div;\n }\n\n return div.querySelector(\".dff-delete\");\n }\n\n private removeCancel(index: number): void {\n const cancelSpan = this.findCancelSpan(index);\n\n if (cancelSpan) {\n cancelSpan.remove();\n }\n }\n\n private removeProgress(index: number): void {\n const el = this.findFileDiv(index);\n\n if (el) {\n const progressSpan = el.querySelector(\".dff-progress\");\n\n if (progressSpan) {\n progressSpan.remove();\n }\n }\n }\n\n private setErrorMessage(index: number, message: string): void {\n const el = this.findFileDiv(index);\n if (!el) {\n return;\n }\n\n const originalMessageSpan = el.querySelector(\".dff-error\");\n if (originalMessageSpan) {\n originalMessageSpan.remove();\n }\n\n const span = document.createElement(\"span\");\n span.classList.add(\"dff-error\");\n span.innerHTML = message;\n\n el.appendChild(span);\n }\n\n public addNewUpload(filename: string, uploadIndex: number): HTMLElement {\n const div = this.addFile(filename, uploadIndex);\n\n const progressSpan = document.createElement(\"span\");\n progressSpan.className = \"dff-progress\";\n\n const innerSpan = document.createElement(\"span\");\n innerSpan.className = \"dff-progress-inner\";\n\n progressSpan.appendChild(innerSpan);\n div.appendChild(progressSpan);\n\n const cancelLink = document.createElement(\"a\");\n cancelLink.className = \"dff-cancel\";\n cancelLink.innerHTML = this.translations.Cancel ?? \"\";\n cancelLink.setAttribute(\"data-index\", uploadIndex.toString());\n cancelLink.href = \"#\";\n div.appendChild(cancelLink);\n\n return div;\n }\n\n public addUploadedFile(\n filename: string,\n uploadIndex: number,\n filesize?: number\n ): HTMLElement {\n const element = this.addFile(filename, uploadIndex);\n this.setSuccess(uploadIndex, filesize);\n return element;\n }\n\n public clearInput(): void {\n const { input } = this;\n\n input.value = \"\";\n }\n\n public deleteFile(index: number): void {\n const div = this.findFileDiv(index);\n\n if (div) {\n div.remove();\n }\n }\n\n public disableCancel(index: number): void {\n const cancelSpan = this.findCancelSpan(index);\n\n if (cancelSpan) {\n cancelSpan.classList.add(\"dff-disabled\");\n }\n }\n\n public disableDelete(index: number): void {\n const deleteLink = this.findDeleteLink(index);\n\n if (deleteLink) {\n deleteLink.classList.add(\"dff-disabled\");\n }\n }\n\n public findFileDiv(index: number): HTMLElement | null {\n return this.container.querySelector(`.dff-file-id-${index.toString()}`);\n }\n\n public removeDropHint(): void {\n const dropHint = this.container.querySelector(\".dff-drop-hint\");\n\n if (dropHint) {\n dropHint.remove();\n }\n }\n\n public renderDropHint(): void {\n if (this.container.querySelector(\".dff-drop-hint\")) {\n return;\n }\n\n const dropHint = document.createElement(\"div\");\n dropHint.className = \"dff-drop-hint\";\n dropHint.innerHTML = this.translations[\"Drop your files here\"] ?? \"\";\n\n this.container.appendChild(dropHint);\n }\n\n public setDeleteFailed(index: number): void {\n this.setErrorMessage(index, this.translations[\"Delete failed\"] ?? \"\");\n\n this.enableDelete(index);\n }\n\n public setError(index: number): void {\n this.setErrorMessage(index, this.translations[\"Upload failed\"] ?? \"\");\n\n const el = this.findFileDiv(index);\n if (el) {\n el.classList.add(\"dff-upload-fail\");\n }\n\n this.removeProgress(index);\n this.removeCancel(index);\n }\n\n public setErrorInvalidFiles(files: File[]): void {\n const errorsMessages = document.createElement(\"ul\");\n\n for (const file of files) {\n const msg = document.createElement(\"li\");\n const invalidFileTypeMessage =\n this.translations[\"Invalid file type\"] ?? \"\";\n msg.innerText = `${file.name}: ${invalidFileTypeMessage}`;\n msg.className = \"dff-error\";\n errorsMessages.appendChild(msg);\n }\n\n this.errors.replaceChildren(errorsMessages);\n this.clearInput();\n }\n\n public setSuccess(index: number, size?: number): void {\n const { translations } = this;\n\n const el = this.findFileDiv(index);\n if (el) {\n el.classList.add(\"dff-upload-success\");\n\n if (size != null) {\n const fileSizeInfo = document.createElement(\"span\");\n fileSizeInfo.innerHTML = formatBytes(size, 2);\n fileSizeInfo.className = \"dff-filesize\";\n\n el.appendChild(fileSizeInfo);\n }\n\n const deleteLink = document.createElement(\"a\");\n deleteLink.innerHTML = translations.Delete ?? \"\";\n deleteLink.className = \"dff-delete\";\n deleteLink.setAttribute(\"data-index\", index.toString());\n deleteLink.href = \"#\";\n\n el.appendChild(deleteLink);\n }\n\n this.removeProgress(index);\n this.removeCancel(index);\n }\n\n public updateProgress(index: number, percentage: string): void {\n const el = this.container.querySelector(`.dff-file-id-${index.toString()}`);\n if (el) {\n const innerProgressSpan = el.querySelector(\".dff-progress-inner\");\n\n if (innerProgressSpan) {\n (innerProgressSpan as HTMLElement).style.width = `${percentage}%`;\n }\n }\n }\n}\n\nexport default RenderUploadFile;\n","type UploadStatus = \"done\" | \"error\" | \"uploading\";\nexport type UploadType =\n | \"existing\"\n | \"placeholder\"\n | \"s3\"\n | \"tus\"\n | \"uploadedS3\"\n | \"uploadedTus\";\n\nexport interface InitialExistingFile {\n name: string;\n size: number;\n type: \"existing\";\n}\n\nexport interface InitialPlaceholderFile {\n id: string;\n name: string;\n size: number;\n type: \"placeholder\";\n}\n\nexport interface InitialS3File {\n id: string;\n name: string;\n original_name: string;\n size: number;\n type: \"s3\";\n}\n\nexport interface InitialTusFile {\n id: string;\n name: string;\n size: number;\n type: \"tus\";\n url: string;\n}\n\nexport type InitialFile =\n | InitialExistingFile\n | InitialPlaceholderFile\n | InitialS3File\n | InitialTusFile;\n\ninterface UploadParameters {\n name: string;\n status: UploadStatus;\n type: UploadType;\n uploadIndex: number;\n}\n\nabstract class BaseUpload {\n name: string;\n status: UploadStatus;\n type: UploadType;\n uploadIndex: number;\n\n constructor({ name, status, type, uploadIndex }: UploadParameters) {\n this.name = name;\n this.status = status;\n this.type = type;\n this.uploadIndex = uploadIndex;\n }\n\n public async abort(): Promise {\n //\n }\n public async delete(): Promise {\n //\n }\n\n public abstract getId(): string | undefined;\n public abstract getInitialFile(): InitialFile;\n public abstract getSize(): number | undefined;\n}\n\nexport default BaseUpload;\n","function normalize (strArray) {\n var resultArray = [];\n if (strArray.length === 0) { return ''; }\n\n if (typeof strArray[0] !== 'string') {\n throw new TypeError('Url must be a string. Received ' + strArray[0]);\n }\n\n // If the first part is a plain protocol, we combine it with the next part.\n if (strArray[0].match(/^[^/:]+:\\/*$/) && strArray.length > 1) {\n var first = strArray.shift();\n strArray[0] = first + strArray[0];\n }\n\n // There must be two or three slashes in the file protocol, two slashes in anything else.\n if (strArray[0].match(/^file:\\/\\/\\//)) {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1:///');\n } else {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1://');\n }\n\n for (var i = 0; i < strArray.length; i++) {\n var component = strArray[i];\n\n if (typeof component !== 'string') {\n throw new TypeError('Url must be a string. Received ' + component);\n }\n\n if (component === '') { continue; }\n\n if (i > 0) {\n // Removing the starting slashes for each component but the first.\n component = component.replace(/^[\\/]+/, '');\n }\n if (i < strArray.length - 1) {\n // Removing the ending slashes for each component but the last.\n component = component.replace(/[\\/]+$/, '');\n } else {\n // For the last component we will combine multiple slashes to a single one.\n component = component.replace(/[\\/]+$/, '/');\n }\n\n resultArray.push(component);\n\n }\n\n var str = resultArray.join('/');\n // Each input component is now separated by a single slash except the possible first plain protocol part.\n\n // remove trailing slash before parameters or hash\n str = str.replace(/\\/(\\?|&|#[^!])/g, '$1');\n\n // replace ? in parameters with &\n var parts = str.split('?');\n str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&');\n\n return str;\n}\n\nexport default function urlJoin() {\n var input;\n\n if (typeof arguments[0] === 'object') {\n input = arguments[0];\n } else {\n input = [].slice.call(arguments);\n }\n\n return normalize(input);\n}\n","import urljoin from \"url-join\";\n\nexport interface LocationInfo {\n location: string;\n}\n\nexport interface MultipartUpload {\n endpoint: string;\n key: string;\n uploadId: string;\n}\n\nexport interface Part {\n ETag: string;\n PartNumber: number;\n}\n\nexport interface UrlInfo {\n url: string;\n}\n\nexport const MB = 1024 * 1024;\n\ninterface AbortMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n uploadId: string;\n}\n\nexport const abortMultipartUpload = ({\n csrfToken,\n endpoint,\n key,\n uploadId\n}: AbortMultipartUploadParameters): Promise => {\n const filename = encodeURIComponent(key);\n const uploadIdEnc = encodeURIComponent(uploadId);\n const headers = new Headers({\n \"X-CSRFToken\": csrfToken\n });\n const url = urljoin(endpoint, uploadIdEnc, `?key=${filename}`);\n return fetch(url, {\n headers: headers,\n method: \"delete\"\n }).then(response => {\n return response.json();\n });\n};\n\ninterface CompleteMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n parts: Part[];\n uploadId: string;\n}\n\nexport const completeMultipartUpload = ({\n csrfToken,\n endpoint,\n key,\n parts,\n uploadId\n}: CompleteMultipartUploadParameters): Promise => {\n const filename = encodeURIComponent(key);\n const uploadIdEnc = encodeURIComponent(uploadId);\n const headers = new Headers({\n \"X-CSRFToken\": csrfToken\n });\n const url = urljoin(endpoint, uploadIdEnc, \"complete\", `?key=${filename}`);\n return fetch(url, {\n body: JSON.stringify({\n parts: parts\n }),\n headers: headers,\n method: \"post\"\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as LocationInfo;\n });\n};\n\ninterface CreateMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n file: File;\n s3UploadDir: string;\n}\n\nexport const createMultipartUpload = ({\n csrfToken,\n endpoint,\n file,\n s3UploadDir\n}: CreateMultipartUploadParameters): Promise => {\n const headers = new Headers({\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n \"X-CSRFToken\": csrfToken\n });\n return fetch(endpoint, {\n body: JSON.stringify({\n contentType: file.type,\n filename: file.name,\n s3UploadDir: s3UploadDir\n }),\n headers: headers,\n method: \"post\"\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as MultipartUpload;\n });\n};\n\nexport const getChunkSize = (file: File): number =>\n Math.ceil(file.size / 10000);\n\ninterface PrepareUploadPartParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n number: number;\n uploadId: string;\n}\n\nexport const prepareUploadPart = ({\n csrfToken,\n endpoint,\n key,\n number,\n uploadId\n}: PrepareUploadPartParameters): Promise => {\n const filename = encodeURIComponent(key);\n const headers = new Headers({ \"X-CSRFToken\": csrfToken });\n const url = urljoin(\n endpoint,\n uploadId,\n number.toString(),\n `?key=${filename}`\n );\n return fetch(url, {\n headers: headers,\n method: \"get\"\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as UrlInfo;\n });\n};\n\nexport const remove = (arr: unknown[], el: unknown): void => {\n const i = arr.indexOf(el);\n if (i !== -1) {\n arr.splice(i, 1);\n }\n};\n","// The following code is adapted from https://github.com/transloadit/uppy/blob/master/packages/%40uppy/aws-s3-multipart/src/MultipartUploader.js\n// which is released under a MIT License (https://github.com/transloadit/uppy/blob/master/LICENSE)\n\nimport BaseUpload, { InitialFile } from \"./base_upload.ts\";\nimport {\n abortMultipartUpload,\n completeMultipartUpload,\n createMultipartUpload,\n getChunkSize,\n MB,\n MultipartUpload,\n Part,\n prepareUploadPart,\n remove,\n UrlInfo\n} from \"./s3_utils.ts\";\n\ninterface ChunkState {\n busy: boolean;\n done: boolean;\n etag?: string;\n uploaded: number;\n}\n\ninterface S3UploadParameters {\n csrfToken: string;\n endpoint: string;\n file: File;\n s3UploadDir: string;\n uploadIndex: number;\n}\n\nclass S3Upload extends BaseUpload {\n private chunks: Blob[];\n private chunkState: ChunkState[];\n private createdPromise: Promise;\n\n private csrfToken: string;\n private endpoint: string;\n private file: File;\n private key: null | string;\n private parts: Part[];\n private s3UploadDir: string;\n private uploadId: null | string;\n private uploading: XMLHttpRequest[];\n public onError?: (error: unknown) => void;\n public onProgress?: (bytesUploaded: number, bytesTotal: number) => void;\n public onSuccess?: () => void;\n\n constructor({\n csrfToken,\n endpoint,\n file,\n s3UploadDir,\n uploadIndex\n }: S3UploadParameters) {\n super({ name: file.name, status: \"uploading\", type: \"s3\", uploadIndex });\n\n this.csrfToken = csrfToken;\n this.endpoint = endpoint;\n this.file = file;\n this.s3UploadDir = s3UploadDir;\n\n this.key = null;\n this.uploadId = null;\n this.parts = [];\n\n // Do `this.createdPromise.then(OP)` to execute an operation `OP` _only_ if the\n // upload was created already. That also ensures that the sequencing is right\n // (so the `OP` definitely happens if the upload is created).\n //\n // This mostly exists to make `abortUpload` work well: only sending the abort request if\n // the upload was already created, and if the createMultipartUpload request is still in flight,\n // aborting it immediately after it finishes.\n this.createdPromise = Promise.reject(new Error());\n this.chunks = [];\n this.chunkState = [];\n this.uploading = [];\n this.onError = undefined;\n this.onProgress = undefined;\n this.onSuccess = undefined;\n\n this.initChunks();\n\n this.createdPromise.catch(() => ({})); // silence uncaught rejection warning\n }\n\n private completeUpload(): Promise {\n // Parts may not have completed uploading in sorted order, if limit > 1.\n this.parts.sort((a, b) => a.PartNumber - b.PartNumber);\n\n if (!this.uploadId || !this.key) {\n return Promise.resolve();\n }\n\n return completeMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n parts: this.parts,\n uploadId: this.uploadId\n }).then(\n () => {\n if (this.onSuccess) {\n this.onSuccess();\n }\n },\n (err: unknown) => {\n this.handleError(err as Error);\n }\n );\n }\n\n private createUpload(): Promise {\n this.createdPromise = createMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n file: this.file,\n s3UploadDir: this.s3UploadDir\n });\n return this.createdPromise\n .then((result: MultipartUpload | null) => {\n const valid =\n typeof result === \"object\" &&\n result &&\n typeof result.uploadId === \"string\" &&\n typeof result.key === \"string\";\n if (!valid) {\n throw new TypeError(\n \"AwsS3/Multipart: Got incorrect result from `createMultipartUpload()`, expected an object `{ uploadId, key }`.\"\n );\n }\n\n this.key = result.key;\n this.uploadId = result.uploadId;\n\n this.uploadParts();\n })\n .catch((err: unknown) => {\n this.handleError(err);\n });\n }\n\n private handleError(error: unknown): void {\n if (this.onError) {\n this.onError(error);\n } else {\n throw error;\n }\n }\n\n private initChunks(): void {\n const chunks: Blob[] = [];\n const desiredChunkSize = getChunkSize(this.file);\n // at least 5MB per request, at most 10k requests\n const minChunkSize = Math.max(5 * MB, Math.ceil(this.file.size / 10000));\n const chunkSize = Math.max(desiredChunkSize, minChunkSize);\n\n for (let i = 0; i < this.file.size; i += chunkSize) {\n const end = Math.min(this.file.size, i + chunkSize);\n chunks.push(this.file.slice(i, end));\n }\n\n this.chunks = chunks;\n this.chunkState = chunks.map(() => ({\n busy: false,\n done: false,\n uploaded: 0\n }));\n }\n\n private onPartComplete(index: number, etag: string): void {\n const state = this.chunkState[index];\n\n if (state) {\n state.etag = etag;\n state.done = true;\n }\n\n const part = {\n ETag: etag,\n PartNumber: index + 1\n };\n this.parts.push(part);\n\n this.uploadParts();\n }\n\n private onPartProgress(index: number, sent: number): void {\n const state = this.chunkState[index];\n\n if (state) {\n state.uploaded = sent;\n }\n\n if (this.onProgress) {\n const totalUploaded = this.chunkState.reduce((n, c) => n + c.uploaded, 0);\n this.onProgress(totalUploaded, this.file.size);\n }\n }\n\n private uploadPart(index: number): Promise {\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = true;\n }\n\n if (!this.key || !this.uploadId) {\n return Promise.resolve();\n }\n\n return prepareUploadPart({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n number: index + 1,\n uploadId: this.uploadId\n })\n .then(result => {\n const valid =\n typeof result === \"object\" && typeof result.url === \"string\";\n if (!valid) {\n throw new TypeError(\n \"AwsS3/Multipart: Got incorrect result from `prepareUploadPart()`, expected an object `{ url }`.\"\n );\n }\n return result;\n })\n .then(\n ({ url }: UrlInfo) => {\n this.uploadPartBytes(index, url);\n },\n (err: unknown) => {\n this.handleError(err);\n }\n );\n }\n\n private uploadPartBytes(index: number, url: string): void {\n const body = this.chunks[index];\n const xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", url, true);\n xhr.responseType = \"text\";\n\n this.uploading.push(xhr);\n\n xhr.upload.addEventListener(\"progress\", ev => {\n if (!ev.lengthComputable) {\n return;\n }\n\n this.onPartProgress(index, ev.loaded);\n });\n\n xhr.addEventListener(\"abort\", ev => {\n remove(this.uploading, ev.target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n });\n\n xhr.addEventListener(\"load\", ev => {\n const target = ev.target as XMLHttpRequest;\n remove(this.uploading, target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n\n if (target.status < 200 || target.status >= 300) {\n this.handleError(new Error(\"Non 2xx\"));\n return;\n }\n\n this.onPartProgress(index, body?.size ?? 0);\n\n // NOTE This must be allowed by CORS.\n const etag = target.getResponseHeader(\"ETag\");\n if (etag === null) {\n this.handleError(\n new Error(\n \"AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions.\"\n )\n );\n return;\n }\n\n this.onPartComplete(index, etag);\n });\n\n xhr.addEventListener(\"error\", ev => {\n remove(this.uploading, ev.target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n\n const error = new Error(\"Unknown error\");\n // error.source = ev.target\n this.handleError(error);\n });\n xhr.send(body);\n }\n\n private uploadParts(): void {\n const need = 1 - this.uploading.length;\n if (need === 0) {\n return;\n }\n\n // All parts are uploaded.\n if (this.chunkState.every(state => state.done)) {\n void this.completeUpload();\n return;\n }\n\n const candidates = [];\n for (let i = 0; i < this.chunkState.length; i++) {\n const state = this.chunkState[i];\n\n if (!state || state.done || state.busy) {\n continue;\n }\n\n candidates.push(i);\n if (candidates.length >= need) {\n break;\n }\n }\n\n candidates.forEach(index => {\n void this.uploadPart(index);\n });\n }\n\n public async abort(): Promise {\n this.uploading.slice().forEach(xhr => {\n xhr.abort();\n });\n this.uploading = [];\n\n await this.createdPromise;\n\n if (this.key && this.uploadId) {\n await abortMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n uploadId: this.uploadId\n });\n }\n }\n\n public async delete(): Promise {\n return Promise.resolve();\n }\n\n public getId(): string | undefined {\n return this.uploadId ?? undefined;\n }\n\n public getInitialFile(): InitialFile {\n return {\n id: this.uploadId ?? \"\",\n name: this.key ?? \"\",\n original_name: this.file.name,\n size: this.file.size,\n type: \"s3\"\n };\n }\n\n public getSize(): number {\n return this.file.size;\n }\n\n public start(): void {\n void this.createUpload();\n }\n}\n\nexport default S3Upload;\n","class DetailedError extends Error {\n constructor(message, causingErr = null, req = null, res = null) {\n super(message)\n\n this.originalRequest = req\n this.originalResponse = res\n this.causingError = causingErr\n\n if (causingErr != null) {\n message += `, caused by ${causingErr.toString()}`\n }\n\n if (req != null) {\n const requestId = req.getHeader('X-Request-ID') || 'n/a'\n const method = req.getMethod()\n const url = req.getURL()\n const status = res ? res.getStatus() : 'n/a'\n const body = res ? res.getBody() || '' : 'n/a'\n message += `, originated from request (method: ${method}, url: ${url}, response code: ${status}, response text: ${body}, request id: ${requestId})`\n }\n this.message = message\n }\n}\n\nexport default DetailedError\n","let isEnabled = false\n\nexport function enableDebugLog() {\n isEnabled = true\n}\n\nexport function log(msg) {\n if (!isEnabled) return\n console.log(msg)\n}\n","export default class NoopUrlStorage {\n listAllUploads() {\n return Promise.resolve([])\n }\n\n findUploadsByFingerprint(_fingerprint) {\n return Promise.resolve([])\n }\n\n removeUpload(_urlStorageKey) {\n return Promise.resolve()\n }\n\n addUpload(_fingerprint, _upload) {\n return Promise.resolve(null)\n }\n}\n","/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.7.7';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _hasBuffer = typeof Buffer === 'function';\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)\n : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')\n : btoaPolyfill;\nconst _fromUint8Array = _hasBuffer\n ? (u8a) => Buffer.from(u8a).toString('base64')\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _hasBuffer\n ? (s) => Buffer.from(s, 'utf8').toString('base64')\n : _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, bin = '', r1, r2;\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))\n : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')\n : atobPolyfill;\n//\nconst _toUint8Array = _hasBuffer\n ? (a) => _U8Afrom(Buffer.from(a, 'base64'))\n : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _hasBuffer\n ? (a) => Buffer.from(a, 'base64').toString('utf8')\n : _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n};\n// makecjs:CUT //\nexport { version };\nexport { VERSION };\nexport { _atob as atob };\nexport { atobPolyfill };\nexport { _btoa as btoa };\nexport { btoaPolyfill };\nexport { decode as fromBase64 };\nexport { encode as toBase64 };\nexport { utob };\nexport { encode };\nexport { encodeURI };\nexport { encodeURI as encodeURL };\nexport { btou };\nexport { decode };\nexport { isValid };\nexport { fromUint8Array };\nexport { toUint8Array };\nexport { extendString };\nexport { extendUint8Array };\nexport { extendBuiltins };\n// and finally,\nexport { gBase64 as Base64 };\n","'use strict';\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nmodule.exports = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n\n if (!port) return false;\n\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n\n case 'https':\n case 'wss':\n return port !== 443;\n\n case 'ftp':\n return port !== 21;\n\n case 'gopher':\n return port !== 70;\n\n case 'file':\n return false;\n }\n\n return port !== 0;\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , undef;\n\n/**\n * Decode a URI encoded string.\n *\n * @param {String} input The URI encoded string.\n * @returns {String|Null} The decoded string.\n * @api private\n */\nfunction decode(input) {\n try {\n return decodeURIComponent(input.replace(/\\+/g, ' '));\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Attempts to encode a given input.\n *\n * @param {String} input The string that needs to be encoded.\n * @returns {String|Null} The encoded string.\n * @api private\n */\nfunction encode(input) {\n try {\n return encodeURIComponent(input);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Simple query string parser.\n *\n * @param {String} query The query string that needs to be parsed.\n * @returns {Object}\n * @api public\n */\nfunction querystring(query) {\n var parser = /([^=?#&]+)=?([^&]*)/g\n , result = {}\n , part;\n\n while (part = parser.exec(query)) {\n var key = decode(part[1])\n , value = decode(part[2]);\n\n //\n // Prevent overriding of existing properties. This ensures that build-in\n // methods like `toString` or __proto__ are not overriden by malicious\n // querystrings.\n //\n // In the case if failed decoding, we want to omit the key/value pairs\n // from the result.\n //\n if (key === null || value === null || key in result) continue;\n result[key] = value;\n }\n\n return result;\n}\n\n/**\n * Transform a query string to an object.\n *\n * @param {Object} obj Object that should be transformed.\n * @param {String} prefix Optional prefix.\n * @returns {String}\n * @api public\n */\nfunction querystringify(obj, prefix) {\n prefix = prefix || '';\n\n var pairs = []\n , value\n , key;\n\n //\n // Optionally prefix with a '?' if needed\n //\n if ('string' !== typeof prefix) prefix = '?';\n\n for (key in obj) {\n if (has.call(obj, key)) {\n value = obj[key];\n\n //\n // Edge cases where we actually want to encode the value to an empty\n // string instead of the stringified value.\n //\n if (!value && (value === null || value === undef || isNaN(value))) {\n value = '';\n }\n\n key = encode(key);\n value = encode(value);\n\n //\n // If we failed to encode the strings, we should bail out as we don't\n // want to add invalid strings to the query.\n //\n if (key === null || value === null) continue;\n pairs.push(key +'='+ value);\n }\n }\n\n return pairs.length ? prefix + pairs.join('&') : '';\n}\n\n//\n// Expose the module.\n//\nexports.stringify = querystringify;\nexports.parse = querystring;\n","'use strict';\n\nvar required = require('requires-port')\n , qs = require('querystringify')\n , controlOrWhitespace = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n , CRHTLF = /[\\n\\r\\t]/g\n , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//\n , port = /:\\d+$/\n , protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i\n , windowsDriveLetter = /^[a-zA-Z]:/;\n\n/**\n * Remove control characters and whitespace from the beginning of a string.\n *\n * @param {Object|String} str String to trim.\n * @returns {String} A new string representing `str` stripped of control\n * characters and whitespace from its beginning.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(controlOrWhitespace, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d*)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') globalVar = window;\n else if (typeof global !== 'undefined') globalVar = global;\n else if (typeof self !== 'undefined') globalVar = self;\n else globalVar = {};\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4]\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n index = parse === '@'\n ? address.lastIndexOf(parse)\n : address.indexOf(parse);\n\n if (~index) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n\n if (url.auth) {\n index = url.auth.indexOf(':');\n\n if (~index) {\n url.username = url.auth.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = url.auth.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password))\n } else {\n url.username = encodeURIComponent(decodeURIComponent(url.auth));\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) value += ':'+ url.port;\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (port.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n case 'username':\n case 'password':\n url[part] = encodeURIComponent(value);\n break;\n\n case 'auth':\n var index = value.indexOf(':');\n\n if (~index) {\n url.username = value.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = value.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(value));\n }\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n\n var query\n , url = this\n , host = url.host\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n\n var result =\n protocol +\n ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) result += ':'+ url.password;\n result += '@';\n } else if (url.password) {\n result += ':'+ url.password;\n result += '@';\n } else if (\n url.protocol !== 'file:' &&\n isSpecial(url.protocol) &&\n !host &&\n url.pathname !== '/'\n ) {\n //\n // Add back the empty userinfo, otherwise the original invalid URL\n // might be transformed into a valid one with `url.pathname` as host.\n //\n result += '@';\n }\n\n //\n // Trailing colon is removed from `url.host` when it is parsed. If it still\n // ends with a colon, then add back the trailing colon that was removed. This\n // prevents an invalid URL from being transformed into a valid one.\n //\n if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {\n host += ':';\n }\n\n result += host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;\n\n if (url.hash) result += url.hash;\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\n\nmodule.exports = Url;\n","/**\n * Generate a UUID v4 based on random numbers. We intentioanlly use the less\n * secure Math.random function here since the more secure crypto.getRandomNumbers\n * is not available on all platforms.\n * This is not a problem for us since we use the UUID only for generating a\n * request ID, so we can correlate server logs to client errors.\n *\n * This function is taken from following site:\n * https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\n *\n * @return {string} The generate UUID\n */\nexport default function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0\n const v = c === 'x' ? r : (r & 0x3) | 0x8\n return v.toString(16)\n })\n}\n","import { Base64 } from 'js-base64'\nimport URL from 'url-parse'\nimport DetailedError from './error.js'\nimport { log } from './logger.js'\nimport uuid from './uuid.js'\n\nconst PROTOCOL_TUS_V1 = 'tus-v1'\nconst PROTOCOL_IETF_DRAFT_03 = 'ietf-draft-03'\n\nconst defaultOptions = {\n endpoint: null,\n\n uploadUrl: null,\n metadata: {},\n metadataForPartialUploads: {},\n fingerprint: null,\n uploadSize: null,\n\n onProgress: null,\n onChunkComplete: null,\n onSuccess: null,\n onError: null,\n onUploadUrlAvailable: null,\n\n overridePatchMethod: false,\n headers: {},\n addRequestId: false,\n onBeforeRequest: null,\n onAfterResponse: null,\n onShouldRetry: defaultOnShouldRetry,\n\n chunkSize: Number.POSITIVE_INFINITY,\n retryDelays: [0, 1000, 3000, 5000],\n parallelUploads: 1,\n parallelUploadBoundaries: null,\n storeFingerprintForResuming: true,\n removeFingerprintOnSuccess: false,\n uploadLengthDeferred: false,\n uploadDataDuringCreation: false,\n\n urlStorage: null,\n fileReader: null,\n httpStack: null,\n\n protocol: PROTOCOL_TUS_V1,\n}\n\nclass BaseUpload {\n constructor(file, options) {\n // Warn about removed options from previous versions\n if ('resume' in options) {\n console.log(\n 'tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead.',\n )\n }\n\n // The default options will already be added from the wrapper classes.\n this.options = options\n\n // Cast chunkSize to integer\n this.options.chunkSize = Number(this.options.chunkSize)\n\n // The storage module used to store URLs\n this._urlStorage = this.options.urlStorage\n\n // The underlying File/Blob object\n this.file = file\n\n // The URL against which the file will be uploaded\n this.url = null\n\n // The underlying request object for the current PATCH request\n this._req = null\n\n // The fingerpinrt for the current file (set after start())\n this._fingerprint = null\n\n // The key that the URL storage returned when saving an URL with a fingerprint,\n this._urlStorageKey = null\n\n // The offset used in the current PATCH request\n this._offset = null\n\n // True if the current PATCH request has been aborted\n this._aborted = false\n\n // The file's size in bytes\n this._size = null\n\n // The Source object which will wrap around the given file and provides us\n // with a unified interface for getting its size and slice chunks from its\n // content allowing us to easily handle Files, Blobs, Buffers and Streams.\n this._source = null\n\n // The current count of attempts which have been made. Zero indicates none.\n this._retryAttempt = 0\n\n // The timeout's ID which is used to delay the next retry\n this._retryTimeout = null\n\n // The offset of the remote upload before the latest attempt was started.\n this._offsetBeforeRetry = 0\n\n // An array of BaseUpload instances which are used for uploading the different\n // parts, if the parallelUploads option is used.\n this._parallelUploads = null\n\n // An array of upload URLs which are used for uploading the different\n // parts, if the parallelUploads option is used.\n this._parallelUploadUrls = null\n }\n\n /**\n * Use the Termination extension to delete an upload from the server by sending a DELETE\n * request to the specified upload URL. This is only possible if the server supports the\n * Termination extension. If the `options.retryDelays` property is set, the method will\n * also retry if an error ocurrs.\n *\n * @param {String} url The upload's URL which will be terminated.\n * @param {object} options Optional options for influencing HTTP requests.\n * @return {Promise} The Promise will be resolved/rejected when the requests finish.\n */\n static terminate(url, options = {}) {\n const req = openRequest('DELETE', url, options)\n\n return sendRequest(req, null, options)\n .then((res) => {\n // A 204 response indicates a successfull request\n if (res.getStatus() === 204) {\n return\n }\n\n throw new DetailedError('tus: unexpected response while terminating upload', null, req, res)\n })\n .catch((err) => {\n if (!(err instanceof DetailedError)) {\n err = new DetailedError('tus: failed to terminate upload', err, req, null)\n }\n\n if (!shouldRetry(err, 0, options)) {\n throw err\n }\n\n // Instead of keeping track of the retry attempts, we remove the first element from the delays\n // array. If the array is empty, all retry attempts are used up and we will bubble up the error.\n // We recursively call the terminate function will removing elements from the retryDelays array.\n const delay = options.retryDelays[0]\n const remainingDelays = options.retryDelays.slice(1)\n const newOptions = {\n ...options,\n retryDelays: remainingDelays,\n }\n return new Promise((resolve) => setTimeout(resolve, delay)).then(() =>\n BaseUpload.terminate(url, newOptions),\n )\n })\n }\n\n findPreviousUploads() {\n return this.options\n .fingerprint(this.file, this.options)\n .then((fingerprint) => this._urlStorage.findUploadsByFingerprint(fingerprint))\n }\n\n resumeFromPreviousUpload(previousUpload) {\n this.url = previousUpload.uploadUrl || null\n this._parallelUploadUrls = previousUpload.parallelUploadUrls || null\n this._urlStorageKey = previousUpload.urlStorageKey\n }\n\n start() {\n const { file } = this\n\n if (!file) {\n this._emitError(new Error('tus: no file or stream to upload provided'))\n return\n }\n\n if (![PROTOCOL_TUS_V1, PROTOCOL_IETF_DRAFT_03].includes(this.options.protocol)) {\n this._emitError(new Error(`tus: unsupported protocol ${this.options.protocol}`))\n return\n }\n\n if (!this.options.endpoint && !this.options.uploadUrl && !this.url) {\n this._emitError(new Error('tus: neither an endpoint or an upload URL is provided'))\n return\n }\n\n const { retryDelays } = this.options\n if (retryDelays != null && Object.prototype.toString.call(retryDelays) !== '[object Array]') {\n this._emitError(new Error('tus: the `retryDelays` option must either be an array or null'))\n return\n }\n\n if (this.options.parallelUploads > 1) {\n // Test which options are incompatible with parallel uploads.\n for (const optionName of ['uploadUrl', 'uploadSize', 'uploadLengthDeferred']) {\n if (this.options[optionName]) {\n this._emitError(\n new Error(`tus: cannot use the ${optionName} option when parallelUploads is enabled`),\n )\n return\n }\n }\n }\n\n if (this.options.parallelUploadBoundaries) {\n if (this.options.parallelUploads <= 1) {\n this._emitError(\n new Error(\n 'tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled',\n ),\n )\n return\n }\n if (this.options.parallelUploads !== this.options.parallelUploadBoundaries.length) {\n this._emitError(\n new Error(\n 'tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`',\n ),\n )\n return\n }\n }\n\n this.options\n .fingerprint(file, this.options)\n .then((fingerprint) => {\n if (fingerprint == null) {\n log(\n 'No fingerprint was calculated meaning that the upload cannot be stored in the URL storage.',\n )\n } else {\n log(`Calculated fingerprint: ${fingerprint}`)\n }\n\n this._fingerprint = fingerprint\n\n if (this._source) {\n return this._source\n }\n return this.options.fileReader.openFile(file, this.options.chunkSize)\n })\n .then((source) => {\n this._source = source\n\n // First, we look at the uploadLengthDeferred option.\n // Next, we check if the caller has supplied a manual upload size.\n // Finally, we try to use the calculated size from the source object.\n if (this.options.uploadLengthDeferred) {\n this._size = null\n } else if (this.options.uploadSize != null) {\n this._size = Number(this.options.uploadSize)\n if (Number.isNaN(this._size)) {\n this._emitError(new Error('tus: cannot convert `uploadSize` option into a number'))\n return\n }\n } else {\n this._size = this._source.size\n if (this._size == null) {\n this._emitError(\n new Error(\n \"tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option\",\n ),\n )\n return\n }\n }\n\n // If the upload was configured to use multiple requests or if we resume from\n // an upload which used multiple requests, we start a parallel upload.\n if (this.options.parallelUploads > 1 || this._parallelUploadUrls != null) {\n this._startParallelUpload()\n } else {\n this._startSingleUpload()\n }\n })\n .catch((err) => {\n this._emitError(err)\n })\n }\n\n /**\n * Initiate the uploading procedure for a parallelized upload, where one file is split into\n * multiple request which are run in parallel.\n *\n * @api private\n */\n _startParallelUpload() {\n const totalSize = this._size\n let totalProgress = 0\n this._parallelUploads = []\n\n const partCount =\n this._parallelUploadUrls != null\n ? this._parallelUploadUrls.length\n : this.options.parallelUploads\n\n // The input file will be split into multiple slices which are uploaded in separate\n // requests. Here we get the start and end position for the slices.\n const parts =\n this.options.parallelUploadBoundaries ?? splitSizeIntoParts(this._source.size, partCount)\n\n // Attach URLs from previous uploads, if available.\n if (this._parallelUploadUrls) {\n parts.forEach((part, index) => {\n part.uploadUrl = this._parallelUploadUrls[index] || null\n })\n }\n\n // Create an empty list for storing the upload URLs\n this._parallelUploadUrls = new Array(parts.length)\n\n // Generate a promise for each slice that will be resolve if the respective\n // upload is completed.\n const uploads = parts.map((part, index) => {\n let lastPartProgress = 0\n\n return this._source.slice(part.start, part.end).then(\n ({ value }) =>\n new Promise((resolve, reject) => {\n // Merge with the user supplied options but overwrite some values.\n const options = {\n ...this.options,\n // If available, the partial upload should be resumed from a previous URL.\n uploadUrl: part.uploadUrl || null,\n // We take manually care of resuming for partial uploads, so they should\n // not be stored in the URL storage.\n storeFingerprintForResuming: false,\n removeFingerprintOnSuccess: false,\n // Reset the parallelUploads option to not cause recursion.\n parallelUploads: 1,\n // Reset this option as we are not doing a parallel upload.\n parallelUploadBoundaries: null,\n metadata: this.options.metadataForPartialUploads,\n // Add the header to indicate the this is a partial upload.\n headers: {\n ...this.options.headers,\n 'Upload-Concat': 'partial',\n },\n // Reject or resolve the promise if the upload errors or completes.\n onSuccess: resolve,\n onError: reject,\n // Based in the progress for this partial upload, calculate the progress\n // for the entire final upload.\n onProgress: (newPartProgress) => {\n totalProgress = totalProgress - lastPartProgress + newPartProgress\n lastPartProgress = newPartProgress\n this._emitProgress(totalProgress, totalSize)\n },\n // Wait until every partial upload has an upload URL, so we can add\n // them to the URL storage.\n onUploadUrlAvailable: () => {\n this._parallelUploadUrls[index] = upload.url\n // Test if all uploads have received an URL\n if (this._parallelUploadUrls.filter((u) => Boolean(u)).length === parts.length) {\n this._saveUploadInUrlStorage()\n }\n },\n }\n\n const upload = new BaseUpload(value, options)\n upload.start()\n\n // Store the upload in an array, so we can later abort them if necessary.\n this._parallelUploads.push(upload)\n }),\n )\n })\n\n let req\n // Wait until all partial uploads are finished and we can send the POST request for\n // creating the final upload.\n Promise.all(uploads)\n .then(() => {\n req = this._openRequest('POST', this.options.endpoint)\n req.setHeader('Upload-Concat', `final;${this._parallelUploadUrls.join(' ')}`)\n\n // Add metadata if values have been added\n const metadata = encodeMetadata(this.options.metadata)\n if (metadata !== '') {\n req.setHeader('Upload-Metadata', metadata)\n }\n\n return this._sendRequest(req, null)\n })\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while creating upload')\n return\n }\n\n const location = res.getHeader('Location')\n if (location == null) {\n this._emitHttpError(req, res, 'tus: invalid or missing Location header')\n return\n }\n\n this.url = resolveUrl(this.options.endpoint, location)\n log(`Created upload at ${this.url}`)\n\n this._emitSuccess(res)\n })\n .catch((err) => {\n this._emitError(err)\n })\n }\n\n /**\n * Initiate the uploading procedure for a non-parallel upload. Here the entire file is\n * uploaded in a sequential matter.\n *\n * @api private\n */\n _startSingleUpload() {\n // Reset the aborted flag when the upload is started or else the\n // _performUpload will stop before sending a request if the upload has been\n // aborted previously.\n this._aborted = false\n\n // The upload had been started previously and we should reuse this URL.\n if (this.url != null) {\n log(`Resuming upload from previous URL: ${this.url}`)\n this._resumeUpload()\n return\n }\n\n // A URL has manually been specified, so we try to resume\n if (this.options.uploadUrl != null) {\n log(`Resuming upload from provided URL: ${this.options.uploadUrl}`)\n this.url = this.options.uploadUrl\n this._resumeUpload()\n return\n }\n\n // An upload has not started for the file yet, so we start a new one\n log('Creating a new upload')\n this._createUpload()\n }\n\n /**\n * Abort any running request and stop the current upload. After abort is called, no event\n * handler will be invoked anymore. You can use the `start` method to resume the upload\n * again.\n * If `shouldTerminate` is true, the `terminate` function will be called to remove the\n * current upload from the server.\n *\n * @param {boolean} shouldTerminate True if the upload should be deleted from the server.\n * @return {Promise} The Promise will be resolved/rejected when the requests finish.\n */\n abort(shouldTerminate) {\n // Stop any parallel partial uploads, that have been started in _startParallelUploads.\n if (this._parallelUploads != null) {\n for (const upload of this._parallelUploads) {\n upload.abort(shouldTerminate)\n }\n }\n\n // Stop any current running request.\n if (this._req !== null) {\n this._req.abort()\n // Note: We do not close the file source here, so the user can resume in the future.\n }\n this._aborted = true\n\n // Stop any timeout used for initiating a retry.\n if (this._retryTimeout != null) {\n clearTimeout(this._retryTimeout)\n this._retryTimeout = null\n }\n\n if (!shouldTerminate || this.url == null) {\n return Promise.resolve()\n }\n\n return (\n BaseUpload.terminate(this.url, this.options)\n // Remove entry from the URL storage since the upload URL is no longer valid.\n .then(() => this._removeFromUrlStorage())\n )\n }\n\n _emitHttpError(req, res, message, causingErr) {\n this._emitError(new DetailedError(message, causingErr, req, res))\n }\n\n _emitError(err) {\n // Do not emit errors, e.g. from aborted HTTP requests, if the upload has been stopped.\n if (this._aborted) return\n\n // Check if we should retry, when enabled, before sending the error to the user.\n if (this.options.retryDelays != null) {\n // We will reset the attempt counter if\n // - we were already able to connect to the server (offset != null) and\n // - we were able to upload a small chunk of data to the server\n const shouldResetDelays = this._offset != null && this._offset > this._offsetBeforeRetry\n if (shouldResetDelays) {\n this._retryAttempt = 0\n }\n\n if (shouldRetry(err, this._retryAttempt, this.options)) {\n const delay = this.options.retryDelays[this._retryAttempt++]\n\n this._offsetBeforeRetry = this._offset\n\n this._retryTimeout = setTimeout(() => {\n this.start()\n }, delay)\n return\n }\n }\n\n if (typeof this.options.onError === 'function') {\n this.options.onError(err)\n } else {\n throw err\n }\n }\n\n /**\n * Publishes notification if the upload has been successfully completed.\n *\n * @param {object} lastResponse Last HTTP response.\n * @api private\n */\n _emitSuccess(lastResponse) {\n if (this.options.removeFingerprintOnSuccess) {\n // Remove stored fingerprint and corresponding endpoint. This causes\n // new uploads of the same file to be treated as a different file.\n this._removeFromUrlStorage()\n }\n\n if (typeof this.options.onSuccess === 'function') {\n this.options.onSuccess({ lastResponse })\n }\n }\n\n /**\n * Publishes notification when data has been sent to the server. This\n * data may not have been accepted by the server yet.\n *\n * @param {number} bytesSent Number of bytes sent to the server.\n * @param {number} bytesTotal Total number of bytes to be sent to the server.\n * @api private\n */\n _emitProgress(bytesSent, bytesTotal) {\n if (typeof this.options.onProgress === 'function') {\n this.options.onProgress(bytesSent, bytesTotal)\n }\n }\n\n /**\n * Publishes notification when a chunk of data has been sent to the server\n * and accepted by the server.\n * @param {number} chunkSize Size of the chunk that was accepted by the server.\n * @param {number} bytesAccepted Total number of bytes that have been\n * accepted by the server.\n * @param {number} bytesTotal Total number of bytes to be sent to the server.\n * @api private\n */\n _emitChunkComplete(chunkSize, bytesAccepted, bytesTotal) {\n if (typeof this.options.onChunkComplete === 'function') {\n this.options.onChunkComplete(chunkSize, bytesAccepted, bytesTotal)\n }\n }\n\n /**\n * Create a new upload using the creation extension by sending a POST\n * request to the endpoint. After successful creation the file will be\n * uploaded\n *\n * @api private\n */\n _createUpload() {\n if (!this.options.endpoint) {\n this._emitError(new Error('tus: unable to create upload because no endpoint is provided'))\n return\n }\n\n const req = this._openRequest('POST', this.options.endpoint)\n\n if (this.options.uploadLengthDeferred) {\n req.setHeader('Upload-Defer-Length', '1')\n } else {\n req.setHeader('Upload-Length', `${this._size}`)\n }\n\n // Add metadata if values have been added\n const metadata = encodeMetadata(this.options.metadata)\n if (metadata !== '') {\n req.setHeader('Upload-Metadata', metadata)\n }\n\n let promise\n if (this.options.uploadDataDuringCreation && !this.options.uploadLengthDeferred) {\n this._offset = 0\n promise = this._addChunkToRequest(req)\n } else {\n if (this.options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Complete', '?0')\n }\n promise = this._sendRequest(req, null)\n }\n\n promise\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while creating upload')\n return\n }\n\n const location = res.getHeader('Location')\n if (location == null) {\n this._emitHttpError(req, res, 'tus: invalid or missing Location header')\n return\n }\n\n this.url = resolveUrl(this.options.endpoint, location)\n log(`Created upload at ${this.url}`)\n\n if (typeof this.options.onUploadUrlAvailable === 'function') {\n this.options.onUploadUrlAvailable()\n }\n\n if (this._size === 0) {\n // Nothing to upload and file was successfully created\n this._emitSuccess(res)\n this._source.close()\n return\n }\n\n this._saveUploadInUrlStorage().then(() => {\n if (this.options.uploadDataDuringCreation) {\n this._handleUploadResponse(req, res)\n } else {\n this._offset = 0\n this._performUpload()\n }\n })\n })\n .catch((err) => {\n this._emitHttpError(req, null, 'tus: failed to create upload', err)\n })\n }\n\n /*\n * Try to resume an existing upload. First a HEAD request will be sent\n * to retrieve the offset. If the request fails a new upload will be\n * created. In the case of a successful response the file will be uploaded.\n *\n * @api private\n */\n _resumeUpload() {\n const req = this._openRequest('HEAD', this.url)\n const promise = this._sendRequest(req, null)\n\n promise\n .then((res) => {\n const status = res.getStatus()\n if (!inStatusCategory(status, 200)) {\n // If the upload is locked (indicated by the 423 Locked status code), we\n // emit an error instead of directly starting a new upload. This way the\n // retry logic can catch the error and will retry the upload. An upload\n // is usually locked for a short period of time and will be available\n // afterwards.\n if (status === 423) {\n this._emitHttpError(req, res, 'tus: upload is currently locked; retry later')\n return\n }\n\n if (inStatusCategory(status, 400)) {\n // Remove stored fingerprint and corresponding endpoint,\n // on client errors since the file can not be found\n this._removeFromUrlStorage()\n }\n\n if (!this.options.endpoint) {\n // Don't attempt to create a new upload if no endpoint is provided.\n this._emitHttpError(\n req,\n res,\n 'tus: unable to resume upload (new upload cannot be created without an endpoint)',\n )\n return\n }\n\n // Try to create a new upload\n this.url = null\n this._createUpload()\n return\n }\n\n const offset = Number.parseInt(res.getHeader('Upload-Offset'), 10)\n if (Number.isNaN(offset)) {\n this._emitHttpError(req, res, 'tus: invalid or missing offset value')\n return\n }\n\n const length = Number.parseInt(res.getHeader('Upload-Length'), 10)\n if (\n Number.isNaN(length) &&\n !this.options.uploadLengthDeferred &&\n this.options.protocol === PROTOCOL_TUS_V1\n ) {\n this._emitHttpError(req, res, 'tus: invalid or missing length value')\n return\n }\n\n if (typeof this.options.onUploadUrlAvailable === 'function') {\n this.options.onUploadUrlAvailable()\n }\n\n this._saveUploadInUrlStorage().then(() => {\n // Upload has already been completed and we do not need to send additional\n // data to the server\n if (offset === length) {\n this._emitProgress(length, length)\n this._emitSuccess(res)\n return\n }\n\n this._offset = offset\n this._performUpload()\n })\n })\n .catch((err) => {\n this._emitHttpError(req, null, 'tus: failed to resume upload', err)\n })\n }\n\n /**\n * Start uploading the file using PATCH requests. The file will be divided\n * into chunks as specified in the chunkSize option. During the upload\n * the onProgress event handler may be invoked multiple times.\n *\n * @api private\n */\n _performUpload() {\n // If the upload has been aborted, we will not send the next PATCH request.\n // This is important if the abort method was called during a callback, such\n // as onChunkComplete or onProgress.\n if (this._aborted) {\n return\n }\n\n let req\n\n // Some browser and servers may not support the PATCH method. For those\n // cases, you can tell tus-js-client to use a POST request with the\n // X-HTTP-Method-Override header for simulating a PATCH request.\n if (this.options.overridePatchMethod) {\n req = this._openRequest('POST', this.url)\n req.setHeader('X-HTTP-Method-Override', 'PATCH')\n } else {\n req = this._openRequest('PATCH', this.url)\n }\n\n req.setHeader('Upload-Offset', `${this._offset}`)\n const promise = this._addChunkToRequest(req)\n\n promise\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while uploading chunk')\n return\n }\n\n this._handleUploadResponse(req, res)\n })\n .catch((err) => {\n // Don't emit an error if the upload was aborted manually\n if (this._aborted) {\n return\n }\n\n this._emitHttpError(req, null, `tus: failed to upload chunk at offset ${this._offset}`, err)\n })\n }\n\n /**\n * _addChunktoRequest reads a chunk from the source and sends it using the\n * supplied request object. It will not handle the response.\n *\n * @api private\n */\n _addChunkToRequest(req) {\n const start = this._offset\n let end = this._offset + this.options.chunkSize\n\n req.setProgressHandler((bytesSent) => {\n this._emitProgress(start + bytesSent, this._size)\n })\n\n req.setHeader('Content-Type', 'application/offset+octet-stream')\n\n // The specified chunkSize may be Infinity or the calcluated end position\n // may exceed the file's size. In both cases, we limit the end position to\n // the input's total size for simpler calculations and correctness.\n if (\n (end === Number.POSITIVE_INFINITY || end > this._size) &&\n !this.options.uploadLengthDeferred\n ) {\n end = this._size\n }\n\n return this._source.slice(start, end).then(({ value, done }) => {\n const valueSize = value?.size ? value.size : 0\n\n // If the upload length is deferred, the upload size was not specified during\n // upload creation. So, if the file reader is done reading, we know the total\n // upload size and can tell the tus server.\n if (this.options.uploadLengthDeferred && done) {\n this._size = this._offset + valueSize\n req.setHeader('Upload-Length', `${this._size}`)\n }\n\n // The specified uploadSize might not match the actual amount of data that a source\n // provides. In these cases, we cannot successfully complete the upload, so we\n // rather error out and let the user know. If not, tus-js-client will be stuck\n // in a loop of repeating empty PATCH requests.\n // See https://community.transloadit.com/t/how-to-abort-hanging-companion-uploads/16488/13\n const newSize = this._offset + valueSize\n if (!this.options.uploadLengthDeferred && done && newSize !== this._size) {\n return Promise.reject(\n new Error(\n `upload was configured with a size of ${this._size} bytes, but the source is done after ${newSize} bytes`,\n ),\n )\n }\n\n if (value === null) {\n return this._sendRequest(req)\n }\n\n if (this.options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Complete', done ? '?1' : '?0')\n }\n this._emitProgress(this._offset, this._size)\n return this._sendRequest(req, value)\n })\n }\n\n /**\n * _handleUploadResponse is used by requests that haven been sent using _addChunkToRequest\n * and already have received a response.\n *\n * @api private\n */\n _handleUploadResponse(req, res) {\n const offset = Number.parseInt(res.getHeader('Upload-Offset'), 10)\n if (Number.isNaN(offset)) {\n this._emitHttpError(req, res, 'tus: invalid or missing offset value')\n return\n }\n\n this._emitProgress(offset, this._size)\n this._emitChunkComplete(offset - this._offset, offset, this._size)\n\n this._offset = offset\n\n if (offset === this._size) {\n // Yay, finally done :)\n this._emitSuccess(res)\n this._source.close()\n return\n }\n\n this._performUpload()\n }\n\n /**\n * Create a new HTTP request object with the given method and URL.\n *\n * @api private\n */\n _openRequest(method, url) {\n const req = openRequest(method, url, this.options)\n this._req = req\n return req\n }\n\n /**\n * Remove the entry in the URL storage, if it has been saved before.\n *\n * @api private\n */\n _removeFromUrlStorage() {\n if (!this._urlStorageKey) return\n\n this._urlStorage.removeUpload(this._urlStorageKey).catch((err) => {\n this._emitError(err)\n })\n this._urlStorageKey = null\n }\n\n /**\n * Add the upload URL to the URL storage, if possible.\n *\n * @api private\n */\n _saveUploadInUrlStorage() {\n // We do not store the upload URL\n // - if it was disabled in the option, or\n // - if no fingerprint was calculated for the input (i.e. a stream), or\n // - if the URL is already stored (i.e. key is set alread).\n if (\n !this.options.storeFingerprintForResuming ||\n !this._fingerprint ||\n this._urlStorageKey !== null\n ) {\n return Promise.resolve()\n }\n\n const storedUpload = {\n size: this._size,\n metadata: this.options.metadata,\n creationTime: new Date().toString(),\n }\n\n if (this._parallelUploads) {\n // Save multiple URLs if the parallelUploads option is used ...\n storedUpload.parallelUploadUrls = this._parallelUploadUrls\n } else {\n // ... otherwise we just save the one available URL.\n storedUpload.uploadUrl = this.url\n }\n\n return this._urlStorage.addUpload(this._fingerprint, storedUpload).then((urlStorageKey) => {\n this._urlStorageKey = urlStorageKey\n })\n }\n\n /**\n * Send a request with the provided body.\n *\n * @api private\n */\n _sendRequest(req, body = null) {\n return sendRequest(req, body, this.options)\n }\n}\n\nfunction encodeMetadata(metadata) {\n return Object.entries(metadata)\n .map(([key, value]) => `${key} ${Base64.encode(String(value))}`)\n .join(',')\n}\n\n/**\n * Checks whether a given status is in the range of the expected category.\n * For example, only a status between 200 and 299 will satisfy the category 200.\n *\n * @api private\n */\nfunction inStatusCategory(status, category) {\n return status >= category && status < category + 100\n}\n\n/**\n * Create a new HTTP request with the specified method and URL.\n * The necessary headers that are included in every request\n * will be added, including the request ID.\n *\n * @api private\n */\nfunction openRequest(method, url, options) {\n const req = options.httpStack.createRequest(method, url)\n\n if (options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Draft-Interop-Version', '5')\n } else {\n req.setHeader('Tus-Resumable', '1.0.0')\n }\n const headers = options.headers || {}\n\n for (const [name, value] of Object.entries(headers)) {\n req.setHeader(name, value)\n }\n\n if (options.addRequestId) {\n const requestId = uuid()\n req.setHeader('X-Request-ID', requestId)\n }\n\n return req\n}\n\n/**\n * Send a request with the provided body while invoking the onBeforeRequest\n * and onAfterResponse callbacks.\n *\n * @api private\n */\nasync function sendRequest(req, body, options) {\n if (typeof options.onBeforeRequest === 'function') {\n await options.onBeforeRequest(req)\n }\n\n const res = await req.send(body)\n\n if (typeof options.onAfterResponse === 'function') {\n await options.onAfterResponse(req, res)\n }\n\n return res\n}\n\n/**\n * Checks whether the browser running this code has internet access.\n * This function will always return true in the node.js environment\n *\n * @api private\n */\nfunction isOnline() {\n let online = true\n // Note: We don't reference `window` here because the navigator object also exists\n // in a Web Worker's context.\n if (typeof navigator !== 'undefined' && navigator.onLine === false) {\n online = false\n }\n\n return online\n}\n\n/**\n * Checks whether or not it is ok to retry a request.\n * @param {Error|DetailedError} err the error returned from the last request\n * @param {number} retryAttempt the number of times the request has already been retried\n * @param {object} options tus Upload options\n *\n * @api private\n */\nfunction shouldRetry(err, retryAttempt, options) {\n // We only attempt a retry if\n // - retryDelays option is set\n // - we didn't exceed the maxium number of retries, yet, and\n // - this error was caused by a request or it's response and\n // - the error is server error (i.e. not a status 4xx except a 409 or 423) or\n // a onShouldRetry is specified and returns true\n // - the browser does not indicate that we are offline\n if (\n options.retryDelays == null ||\n retryAttempt >= options.retryDelays.length ||\n err.originalRequest == null\n ) {\n return false\n }\n\n if (options && typeof options.onShouldRetry === 'function') {\n return options.onShouldRetry(err, retryAttempt, options)\n }\n\n return defaultOnShouldRetry(err)\n}\n\n/**\n * determines if the request should be retried. Will only retry if not a status 4xx except a 409 or 423\n * @param {DetailedError} err\n * @returns {boolean}\n */\nfunction defaultOnShouldRetry(err) {\n const status = err.originalResponse ? err.originalResponse.getStatus() : 0\n return (!inStatusCategory(status, 400) || status === 409 || status === 423) && isOnline()\n}\n\n/**\n * Resolve a relative link given the origin as source. For example,\n * if a HTTP request to http://example.com/files/ returns a Location\n * header with the value /upload/abc, the resolved URL will be:\n * http://example.com/upload/abc\n */\nfunction resolveUrl(origin, link) {\n return new URL(link, origin).toString()\n}\n\n/**\n * Calculate the start and end positions for the parts if an upload\n * is split into multiple parallel requests.\n *\n * @param {number} totalSize The byte size of the upload, which will be split.\n * @param {number} partCount The number in how many parts the upload will be split.\n * @return {object[]}\n * @api private\n */\nfunction splitSizeIntoParts(totalSize, partCount) {\n const partSize = Math.floor(totalSize / partCount)\n const parts = []\n\n for (let i = 0; i < partCount; i++) {\n parts.push({\n start: partSize * i,\n end: partSize * (i + 1),\n })\n }\n\n parts[partCount - 1].end = totalSize\n\n return parts\n}\n\nBaseUpload.defaultOptions = defaultOptions\n\nexport default BaseUpload\n","const isReactNative = () =>\n typeof navigator !== 'undefined' &&\n typeof navigator.product === 'string' &&\n navigator.product.toLowerCase() === 'reactnative'\n\nexport default isReactNative\n","/**\n * uriToBlob resolves a URI to a Blob object. This is used for\n * React Native to retrieve a file (identified by a file://\n * URI) as a blob.\n */\nexport default function uriToBlob(uri) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n xhr.responseType = 'blob'\n xhr.onload = () => {\n const blob = xhr.response\n resolve(blob)\n }\n xhr.onerror = (err) => {\n reject(err)\n }\n xhr.open('GET', uri)\n xhr.send()\n })\n}\n","const isCordova = () =>\n typeof window !== 'undefined' &&\n (typeof window.PhoneGap !== 'undefined' ||\n typeof window.Cordova !== 'undefined' ||\n typeof window.cordova !== 'undefined')\n\nexport default isCordova\n","/**\n * readAsByteArray converts a File object to a Uint8Array.\n * This function is only used on the Apache Cordova platform.\n * See https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html#read-a-file\n */\nexport default function readAsByteArray(chunk) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n const value = new Uint8Array(reader.result)\n resolve({ value })\n }\n reader.onerror = (err) => {\n reject(err)\n }\n reader.readAsArrayBuffer(chunk)\n })\n}\n","import isCordova from './isCordova.js'\nimport readAsByteArray from './readAsByteArray.js'\n\nexport default class FileSource {\n // Make this.size a method\n constructor(file) {\n this._file = file\n this.size = file.size\n }\n\n slice(start, end) {\n // In Apache Cordova applications, a File must be resolved using\n // FileReader instances, see\n // https://cordova.apache.org/docs/en/8.x/reference/cordova-plugin-file/index.html#read-a-file\n if (isCordova()) {\n return readAsByteArray(this._file.slice(start, end))\n }\n\n const value = this._file.slice(start, end)\n const done = end >= this.size\n return Promise.resolve({ value, done })\n }\n\n close() {\n // Nothing to do here since we don't need to release any resources.\n }\n}\n","function len(blobOrArray) {\n if (blobOrArray === undefined) return 0\n if (blobOrArray.size !== undefined) return blobOrArray.size\n return blobOrArray.length\n}\n\n/*\n Typed arrays and blobs don't have a concat method.\n This function helps StreamSource accumulate data to reach chunkSize.\n*/\nfunction concat(a, b) {\n if (a.concat) {\n // Is `a` an Array?\n return a.concat(b)\n }\n if (a instanceof Blob) {\n return new Blob([a, b], { type: a.type })\n }\n if (a.set) {\n // Is `a` a typed array?\n const c = new a.constructor(a.length + b.length)\n c.set(a)\n c.set(b, a.length)\n return c\n }\n throw new Error('Unknown data type')\n}\n\nexport default class StreamSource {\n constructor(reader) {\n this._buffer = undefined\n this._bufferOffset = 0\n this._reader = reader\n this._done = false\n }\n\n slice(start, end) {\n if (start < this._bufferOffset) {\n return Promise.reject(new Error(\"Requested data is before the reader's current offset\"))\n }\n\n return this._readUntilEnoughDataOrDone(start, end)\n }\n\n _readUntilEnoughDataOrDone(start, end) {\n const hasEnoughData = end <= this._bufferOffset + len(this._buffer)\n if (this._done || hasEnoughData) {\n const value = this._getDataFromBuffer(start, end)\n const done = value == null ? this._done : false\n return Promise.resolve({ value, done })\n }\n\n return this._reader.read().then(({ value, done }) => {\n if (done) {\n this._done = true\n } else if (this._buffer === undefined) {\n this._buffer = value\n } else {\n this._buffer = concat(this._buffer, value)\n }\n\n return this._readUntilEnoughDataOrDone(start, end)\n })\n }\n\n _getDataFromBuffer(start, end) {\n // Remove data from buffer before `start`.\n // Data might be reread from the buffer if an upload fails, so we can only\n // safely delete data when it comes *before* what is currently being read.\n if (start > this._bufferOffset) {\n this._buffer = this._buffer.slice(start - this._bufferOffset)\n this._bufferOffset = start\n }\n // If the buffer is empty after removing old data, all data has been read.\n const hasAllDataBeenRead = len(this._buffer) === 0\n if (this._done && hasAllDataBeenRead) {\n return null\n }\n // We already removed data before `start`, so we just return the first\n // chunk from the buffer.\n return this._buffer.slice(0, end - start)\n }\n\n close() {\n if (this._reader.cancel) {\n this._reader.cancel()\n }\n }\n}\n","import isReactNative from './isReactNative.js'\nimport uriToBlob from './uriToBlob.js'\n\nimport FileSource from './sources/FileSource.js'\nimport StreamSource from './sources/StreamSource.js'\n\nexport default class FileReader {\n async openFile(input, chunkSize) {\n // In React Native, when user selects a file, instead of a File or Blob,\n // you usually get a file object {} with a uri property that contains\n // a local path to the file. We use XMLHttpRequest to fetch\n // the file blob, before uploading with tus.\n if (isReactNative() && input && typeof input.uri !== 'undefined') {\n try {\n const blob = await uriToBlob(input.uri)\n return new FileSource(blob)\n } catch (err) {\n throw new Error(\n `tus: cannot fetch \\`file.uri\\` as Blob, make sure the uri is correct and accessible. ${err}`,\n )\n }\n }\n\n // Since we emulate the Blob type in our tests (not all target browsers\n // support it), we cannot use `instanceof` for testing whether the input value\n // can be handled. Instead, we simply check is the slice() function and the\n // size property are available.\n if (typeof input.slice === 'function' && typeof input.size !== 'undefined') {\n return Promise.resolve(new FileSource(input))\n }\n\n if (typeof input.read === 'function') {\n chunkSize = Number(chunkSize)\n if (!Number.isFinite(chunkSize)) {\n return Promise.reject(\n new Error(\n 'cannot create source for stream without a finite value for the `chunkSize` option',\n ),\n )\n }\n\n return Promise.resolve(new StreamSource(input, chunkSize))\n }\n\n return Promise.reject(\n new Error(\n 'source object may only be an instance of File, Blob, or Reader in this environment',\n ),\n )\n }\n}\n","import isReactNative from './isReactNative.js'\n\n// TODO: Differenciate between input types\n\n/**\n * Generate a fingerprint for a file which will be used the store the endpoint\n *\n * @param {File} file\n * @param {Object} options\n * @param {Function} callback\n */\nexport default function fingerprint(file, options) {\n if (isReactNative()) {\n return Promise.resolve(reactNativeFingerprint(file, options))\n }\n\n return Promise.resolve(\n ['tus-br', file.name, file.type, file.size, file.lastModified, options.endpoint].join('-'),\n )\n}\n\nfunction reactNativeFingerprint(file, options) {\n const exifHash = file.exif ? hashCode(JSON.stringify(file.exif)) : 'noexif'\n return ['tus-rn', file.name || 'noname', file.size || 'nosize', exifHash, options.endpoint].join(\n '/',\n )\n}\n\nfunction hashCode(str) {\n // from https://stackoverflow.com/a/8831937/151666\n let hash = 0\n if (str.length === 0) {\n return hash\n }\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = (hash << 5) - hash + char\n hash &= hash // Convert to 32bit integer\n }\n return hash\n}\n","export default class XHRHttpStack {\n createRequest(method, url) {\n return new Request(method, url)\n }\n\n getName() {\n return 'XHRHttpStack'\n }\n}\n\nclass Request {\n constructor(method, url) {\n this._xhr = new XMLHttpRequest()\n this._xhr.open(method, url, true)\n\n this._method = method\n this._url = url\n this._headers = {}\n }\n\n getMethod() {\n return this._method\n }\n\n getURL() {\n return this._url\n }\n\n setHeader(header, value) {\n this._xhr.setRequestHeader(header, value)\n this._headers[header] = value\n }\n\n getHeader(header) {\n return this._headers[header]\n }\n\n setProgressHandler(progressHandler) {\n // Test support for progress events before attaching an event listener\n if (!('upload' in this._xhr)) {\n return\n }\n\n this._xhr.upload.onprogress = (e) => {\n if (!e.lengthComputable) {\n return\n }\n\n progressHandler(e.loaded)\n }\n }\n\n send(body = null) {\n return new Promise((resolve, reject) => {\n this._xhr.onload = () => {\n resolve(new Response(this._xhr))\n }\n\n this._xhr.onerror = (err) => {\n reject(err)\n }\n\n this._xhr.send(body)\n })\n }\n\n abort() {\n this._xhr.abort()\n return Promise.resolve()\n }\n\n getUnderlyingObject() {\n return this._xhr\n }\n}\n\nclass Response {\n constructor(xhr) {\n this._xhr = xhr\n }\n\n getStatus() {\n return this._xhr.status\n }\n\n getHeader(header) {\n return this._xhr.getResponseHeader(header)\n }\n\n getBody() {\n return this._xhr.responseText\n }\n\n getUnderlyingObject() {\n return this._xhr\n }\n}\n","let hasStorage = false\ntry {\n // Note: localStorage does not exist in the Web Worker's context, so we must use window here.\n hasStorage = 'localStorage' in window\n\n // Attempt to store and read entries from the local storage to detect Private\n // Mode on Safari on iOS (see #49)\n // If the key was not used before, we remove it from local storage again to\n // not cause confusion where the entry came from.\n const key = 'tusSupport'\n const originalValue = localStorage.getItem(key)\n localStorage.setItem(key, originalValue)\n if (originalValue === null) localStorage.removeItem(key)\n} catch (e) {\n // If we try to access localStorage inside a sandboxed iframe, a SecurityError\n // is thrown. When in private mode on iOS Safari, a QuotaExceededError is\n // thrown (see #49)\n if (e.code === e.SECURITY_ERR || e.code === e.QUOTA_EXCEEDED_ERR) {\n hasStorage = false\n } else {\n throw e\n }\n}\n\nexport const canStoreURLs = hasStorage\n\nexport class WebStorageUrlStorage {\n findAllUploads() {\n const results = this._findEntries('tus::')\n return Promise.resolve(results)\n }\n\n findUploadsByFingerprint(fingerprint) {\n const results = this._findEntries(`tus::${fingerprint}::`)\n return Promise.resolve(results)\n }\n\n removeUpload(urlStorageKey) {\n localStorage.removeItem(urlStorageKey)\n return Promise.resolve()\n }\n\n addUpload(fingerprint, upload) {\n const id = Math.round(Math.random() * 1e12)\n const key = `tus::${fingerprint}::${id}`\n\n localStorage.setItem(key, JSON.stringify(upload))\n return Promise.resolve(key)\n }\n\n _findEntries(prefix) {\n const results = []\n\n for (let i = 0; i < localStorage.length; i++) {\n const key = localStorage.key(i)\n if (key.indexOf(prefix) !== 0) continue\n\n try {\n const upload = JSON.parse(localStorage.getItem(key))\n upload.urlStorageKey = key\n\n results.push(upload)\n } catch (_e) {\n // The JSON parse error is intentionally ignored here, so a malformed\n // entry in the storage cannot prevent an upload.\n }\n }\n\n return results\n }\n}\n","import DetailedError from '../error.js'\nimport { enableDebugLog } from '../logger.js'\nimport NoopUrlStorage from '../noopUrlStorage.js'\nimport BaseUpload from '../upload.js'\n\nimport FileReader from './fileReader.js'\nimport fingerprint from './fileSignature.js'\nimport DefaultHttpStack from './httpStack.js'\nimport { WebStorageUrlStorage, canStoreURLs } from './urlStorage.js'\n\nconst defaultOptions = {\n ...BaseUpload.defaultOptions,\n httpStack: new DefaultHttpStack(),\n fileReader: new FileReader(),\n urlStorage: canStoreURLs ? new WebStorageUrlStorage() : new NoopUrlStorage(),\n fingerprint,\n}\n\nclass Upload extends BaseUpload {\n constructor(file = null, options = {}) {\n options = { ...defaultOptions, ...options }\n super(file, options)\n }\n\n static terminate(url, options = {}) {\n options = { ...defaultOptions, ...options }\n return BaseUpload.terminate(url, options)\n }\n}\n\n// Note: We don't reference `window` here because these classes also exist in a Web Worker's context.\nconst isSupported =\n typeof XMLHttpRequest === 'function' &&\n typeof Blob === 'function' &&\n typeof Blob.prototype.slice === 'function'\n\nexport {\n Upload,\n canStoreURLs,\n defaultOptions,\n isSupported,\n enableDebugLog,\n DefaultHttpStack,\n DetailedError,\n}\n","export const deleteUpload = async (\n url: string,\n csrfToken: string\n): Promise =>\n new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(\"DELETE\", url);\n\n xhr.onload = (): void => {\n if (xhr.status === 204) {\n resolve();\n } else {\n reject(new Error());\n }\n };\n xhr.setRequestHeader(\"Tus-Resumable\", \"1.0.0\");\n xhr.setRequestHeader(\"X-CSRFToken\", csrfToken);\n xhr.send(null);\n });\n","import { HttpRequest, HttpResponse, Upload } from \"tus-js-client\";\n\nimport BaseUpload, { InitialFile } from \"./base_upload.ts\";\nimport { deleteUpload } from \"./tus_utils.ts\";\n\ninterface Parameters {\n chunkSize: number;\n csrfToken: string;\n fieldName: string;\n file: File;\n formId: string;\n retryDelays: null | number[];\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport default class TusUpload extends BaseUpload {\n private addCsrTokenToRequest = (request: HttpRequest) => {\n request.setHeader(\"X-CSRFToken\", this.csrfToken);\n };\n private csrfToken: string;\n private handleAfterReponse = (\n _request: HttpRequest,\n response: HttpResponse\n ) => {\n const resourceId = response.getHeader(\"ResourceId\");\n\n if (resourceId) {\n this.id = resourceId;\n }\n };\n private handleError = (error: Error) => {\n if (this.onError) {\n this.onError(error);\n } else {\n throw error;\n }\n };\n private handleProgress = (bytesUploaded: number, bytesTotal: number) => {\n if (this.onProgress) {\n this.onProgress(bytesUploaded, bytesTotal);\n }\n };\n private handleSucces = () => {\n if (this.onSuccess) {\n this.onSuccess();\n }\n };\n\n private id: string;\n\n private upload: Upload;\n\n public onError?: (error: Error) => void;\n\n public onProgress?: (bytesUploaded: number, bytesTotal: number) => void;\n\n public onSuccess?: () => void;\n\n constructor({\n chunkSize,\n csrfToken,\n fieldName,\n file,\n formId,\n retryDelays,\n uploadIndex,\n uploadUrl\n }: Parameters) {\n super({ name: file.name, status: \"uploading\", type: \"tus\", uploadIndex });\n\n this.csrfToken = csrfToken;\n\n this.upload = new Upload(file, {\n chunkSize,\n endpoint: uploadUrl,\n metadata: {\n fieldName: fieldName,\n filename: file.name,\n formId: formId\n },\n onAfterResponse: this.handleAfterReponse,\n onBeforeRequest: this.addCsrTokenToRequest,\n onError: this.handleError,\n onProgress: this.handleProgress,\n onSuccess: this.handleSucces,\n retryDelays: retryDelays ?? [0, 1000, 3000, 5000]\n });\n\n this.onError = undefined;\n this.onProgress = undefined;\n this.onSuccess = undefined;\n }\n\n public async abort(): Promise {\n await this.upload.abort(true);\n }\n\n public async delete(): Promise {\n if (!this.upload.url) {\n return Promise.resolve();\n }\n\n await deleteUpload(this.upload.url, this.csrfToken);\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n getInitialFile(): InitialFile {\n return {\n id: this.id,\n name: this.name,\n size: this.getSize(),\n type: \"tus\",\n url: \"\"\n };\n }\n\n public getSize(): number {\n return (this.upload.file as File).size;\n }\n\n public start(): void {\n this.upload.start();\n }\n}\n","import BaseUpload, {\n InitialExistingFile,\n InitialFile,\n InitialPlaceholderFile,\n InitialS3File,\n InitialTusFile,\n UploadType\n} from \"./base_upload.ts\";\nimport { deleteUpload } from \"./tus_utils.ts\";\n\ninterface BaseUploadedFileParameters {\n name: string;\n size: number;\n type: UploadType;\n uploadIndex: number;\n}\n\nexport abstract class BaseUploadedFile extends BaseUpload {\n size: number;\n\n constructor({ name, size, type, uploadIndex }: BaseUploadedFileParameters) {\n super({ name, status: \"done\", type, uploadIndex });\n\n this.size = size;\n }\n\n public async abort(): Promise {\n return Promise.resolve();\n }\n\n public async delete(): Promise {\n return Promise.resolve();\n }\n\n public getSize(): number | undefined {\n return this.size;\n }\n}\n\nclass PlaceholderFile extends BaseUploadedFile {\n id: string;\n\n constructor(initialFile: InitialPlaceholderFile, uploadIndex: number) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"placeholder\",\n uploadIndex\n });\n\n this.id = initialFile.id;\n }\n\n public getId(): string | undefined {\n return undefined;\n }\n\n public getInitialFile(): InitialPlaceholderFile {\n return {\n id: this.id,\n name: this.name,\n size: this.size,\n type: \"placeholder\"\n };\n }\n}\n\nexport class UploadedS3File extends BaseUploadedFile {\n id: string;\n key: string;\n\n constructor(initialFile: InitialS3File, uploadIndex: number) {\n super({\n name: initialFile.original_name || initialFile.name,\n size: initialFile.size,\n type: \"uploadedS3\",\n uploadIndex\n });\n\n this.id = initialFile.id;\n this.key = initialFile.name;\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n getInitialFile(): InitialS3File {\n return {\n id: this.id,\n name: this.key,\n original_name: this.name,\n size: this.size,\n type: \"s3\"\n };\n }\n}\n\nexport class ExistingFile extends BaseUploadedFile {\n constructor(initialFile: InitialExistingFile, uploadIndex: number) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"existing\",\n uploadIndex\n });\n }\n\n public getId(): string | undefined {\n return undefined;\n }\n\n public getInitialFile(): InitialExistingFile {\n return {\n name: this.name,\n size: this.size,\n type: \"existing\"\n };\n }\n}\n\ninterface UploadedTusFileParameters {\n csrfToken: string;\n initialFile: InitialTusFile;\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport class UploadedTusFile extends BaseUploadedFile {\n csrfToken: string;\n id: string;\n url: string;\n\n constructor({\n csrfToken,\n initialFile,\n uploadIndex,\n uploadUrl\n }: UploadedTusFileParameters) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"uploadedTus\",\n uploadIndex\n });\n\n this.csrfToken = csrfToken;\n this.id = initialFile.id;\n this.url = `${uploadUrl}${initialFile.id}`;\n }\n\n public async delete(): Promise {\n await deleteUpload(this.url, this.csrfToken);\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n getInitialFile(): InitialTusFile {\n return {\n id: this.id,\n name: this.name,\n size: this.size,\n type: \"tus\",\n url: \"\"\n };\n }\n}\n\ninterface UploadedFileParameters {\n csrfToken: string;\n initialFile: InitialFile;\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport const createUploadedFile = ({\n csrfToken,\n initialFile,\n uploadIndex,\n uploadUrl\n}: UploadedFileParameters): BaseUploadedFile => {\n switch (initialFile.type) {\n case \"existing\":\n return new ExistingFile(initialFile, uploadIndex);\n\n case \"placeholder\":\n return new PlaceholderFile(initialFile, uploadIndex);\n\n case \"s3\":\n return new UploadedS3File(initialFile, uploadIndex);\n\n case \"tus\":\n return new UploadedTusFile({\n csrfToken,\n initialFile,\n uploadIndex,\n uploadUrl\n });\n }\n};\n","import { EventEmitter } from \"eventemitter3\";\n\nimport AcceptedFileTypes from \"./accepted_file_types.ts\";\nimport DropArea from \"./drop_area.ts\";\nimport RenderUploadFile from \"./render_upload_file.ts\";\nimport BaseUpload, { InitialFile, UploadType } from \"./uploads/base_upload.ts\";\nimport S3Upload from \"./uploads/s3_upload.ts\";\nimport TusUpload from \"./uploads/tus_upload.ts\";\nimport { createUploadedFile } from \"./uploads/uploaded_file.ts\";\nimport {\n findInput,\n getMetadataFieldName,\n getUploadsFieldName\n} from \"./util.ts\";\n\nexport type Translations = Record;\n\ninterface ClickEvent {\n fieldName: string;\n fileName: string;\n id?: string;\n type: UploadType;\n}\n\nexport interface Callbacks {\n onClick?: ({ fieldName, fileName, type }: ClickEvent) => void;\n onDelete?: (upload: BaseUpload) => void;\n onError?: (error: unknown, upload: BaseUpload) => void;\n onProgress?: (\n bytesUploaded: number,\n bytesTotal: number,\n upload: BaseUpload\n ) => void;\n onSuccess?: (upload: BaseUpload) => void;\n}\n\ninterface ConstructorParams {\n callbacks: Callbacks;\n chunkSize: number;\n csrfToken: string;\n eventEmitter?: EventEmitter;\n fieldName: string;\n form: Element;\n formId: string;\n initial: InitialFile[];\n input: HTMLInputElement;\n multiple: boolean;\n parent: Element;\n prefix: null | string;\n retryDelays: null | number[];\n s3UploadDir: null | string;\n skipRequired: boolean;\n supportDropArea: boolean;\n translations: Translations;\n uploadUrl: string;\n}\n\nclass FileField {\n acceptedFileTypes: AcceptedFileTypes;\n callbacks: Callbacks;\n chunkSize: number;\n csrfToken: string;\n eventEmitter?: EventEmitter;\n fieldName: string;\n form: Element;\n formId: string;\n handleClick = (e: Event): void => {\n const target = e.target as HTMLElement;\n\n const getUpload = (): BaseUpload | undefined => {\n const dataIndex = target.getAttribute(\"data-index\");\n\n if (!dataIndex) {\n return undefined;\n }\n\n const uploadIndex = parseInt(dataIndex, 10);\n return this.getUploadByIndex(uploadIndex);\n };\n\n if (\n target.classList.contains(\"dff-delete\") &&\n !target.classList.contains(\"dff-disabled\")\n ) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload) {\n void this.removeExistingUpload(upload);\n }\n } else if (target.classList.contains(\"dff-cancel\")) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload) {\n void this.handleCancel(upload);\n }\n } else if (target.classList.contains(\"dff-filename\")) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload?.status === \"done\" && this.callbacks.onClick) {\n this.callbacks.onClick({\n fieldName: this.fieldName,\n fileName: upload.name,\n id: upload.getId(),\n type: upload.type\n });\n }\n }\n };\n handleError = (upload: BaseUpload, error: unknown): void => {\n this.renderer.setError(upload.uploadIndex);\n upload.status = \"error\";\n\n const { onError } = this.callbacks;\n\n if (onError) {\n if (upload instanceof TusUpload) {\n onError(error, upload);\n }\n }\n };\n handleInvalidFiles = (files: File[]): void => {\n this.renderer.setErrorInvalidFiles(files);\n };\n handleProgress = (\n upload: BaseUpload,\n bytesUploaded: number,\n bytesTotal: number\n ): void => {\n const percentage = ((bytesUploaded / bytesTotal) * 100).toFixed(2);\n\n this.renderer.updateProgress(upload.uploadIndex, percentage);\n\n const { onProgress } = this.callbacks;\n\n if (onProgress) {\n if (upload instanceof TusUpload) {\n onProgress(bytesUploaded, bytesTotal, upload);\n }\n }\n };\n handleSuccess = (upload: BaseUpload): void => {\n const { renderer } = this;\n\n this.updatePlaceholderInput();\n\n renderer.clearInput();\n renderer.setSuccess(upload.uploadIndex, upload.getSize());\n upload.status = \"done\";\n\n const { onSuccess } = this.callbacks;\n\n const element = this.renderer.findFileDiv(upload.uploadIndex);\n\n if (element) {\n this.emitEvent(\"uploadComplete\", element, upload);\n }\n\n if (onSuccess && upload.type === \"tus\") {\n onSuccess(upload);\n }\n };\n multiple: boolean;\n nextUploadIndex: number;\n onChange = (e: Event): void => {\n const files = (e.target as HTMLInputElement).files ?? ([] as File[]);\n const acceptedFiles: File[] = [];\n const invalidFiles: File[] = [];\n\n for (const file of files) {\n if (this.acceptedFileTypes.isAccepted(file.name)) {\n acceptedFiles.push(file);\n } else {\n invalidFiles.push(file);\n }\n }\n\n this.handleInvalidFiles([...invalidFiles]);\n void this.uploadFiles([...acceptedFiles]);\n\n this.renderer.clearInput();\n };\n prefix: null | string;\n\n renderer: RenderUploadFile;\n\n retryDelays: null | number[];\n\n s3UploadDir: null | string;\n\n supportDropArea: boolean;\n\n uploadFiles = async (files: File[]): Promise => {\n if (files.length === 0) {\n return;\n }\n\n if (!this.multiple) {\n for (const upload of this.uploads) {\n this.renderer.deleteFile(upload.uploadIndex);\n }\n\n this.uploads = [];\n const file = files[0];\n\n if (file) {\n await this.uploadFile(file);\n }\n } else {\n for (const file of files) {\n await this.uploadFile(file);\n }\n }\n\n this.checkDropHint();\n };\n\n uploads: BaseUpload[];\n\n uploadUrl: string;\n\n constructor({\n callbacks,\n chunkSize,\n csrfToken,\n eventEmitter,\n fieldName,\n form,\n formId,\n initial,\n input,\n multiple,\n parent,\n prefix,\n retryDelays,\n s3UploadDir,\n skipRequired,\n supportDropArea,\n translations,\n uploadUrl\n }: ConstructorParams) {\n this.callbacks = callbacks;\n this.chunkSize = chunkSize;\n this.csrfToken = csrfToken;\n this.eventEmitter = eventEmitter;\n this.fieldName = fieldName;\n this.form = form;\n this.formId = formId;\n this.multiple = multiple;\n this.prefix = prefix;\n this.retryDelays = retryDelays;\n this.s3UploadDir = s3UploadDir;\n this.supportDropArea = supportDropArea && !input.disabled;\n this.uploadUrl = uploadUrl;\n this.acceptedFileTypes = new AcceptedFileTypes(input.accept);\n\n this.uploads = [];\n this.nextUploadIndex = 0;\n\n this.renderer = new RenderUploadFile({\n input,\n parent,\n skipRequired,\n translations\n });\n const filesContainer = this.renderer.container;\n\n if (supportDropArea) {\n this.initDropArea(filesContainer, input.accept);\n }\n\n this.addInitialFiles(initial);\n\n this.checkDropHint();\n\n input.addEventListener(\"change\", this.onChange);\n filesContainer.addEventListener(\"click\", this.handleClick);\n }\n\n addInitialFiles(initialFiles: InitialFile[]): void {\n if (initialFiles.length === 0) {\n return;\n }\n\n const { multiple, renderer } = this;\n\n const addInitialFile = (initialFile: InitialFile): void => {\n const { size } = initialFile;\n const name =\n initialFile.type === \"s3\" && initialFile.original_name\n ? initialFile.original_name\n : initialFile.name;\n\n const element = renderer.addUploadedFile(\n name,\n this.nextUploadIndex,\n size\n );\n\n const upload = createUploadedFile({\n csrfToken: this.csrfToken,\n initialFile,\n uploadIndex: this.nextUploadIndex,\n uploadUrl: this.uploadUrl\n });\n this.uploads.push(upload);\n\n this.emitEvent(\"addUpload\", element, upload);\n };\n\n if (multiple) {\n initialFiles.forEach((file: InitialFile): void => {\n addInitialFile(file);\n this.nextUploadIndex += 1;\n });\n } else {\n const initialFile = initialFiles[0];\n\n if (initialFile) {\n addInitialFile(initialFile);\n }\n }\n }\n\n checkDropHint(): void {\n if (!this.supportDropArea) {\n return;\n }\n\n const nonEmptyUploads = this.uploads.filter(e => Boolean(e));\n\n if (nonEmptyUploads.length === 0) {\n this.renderer.renderDropHint();\n } else {\n this.renderer.removeDropHint();\n }\n }\n\n emitEvent(eventName: string, element: HTMLElement, upload: BaseUpload): void {\n if (this.eventEmitter) {\n this.eventEmitter.emit(eventName, {\n element,\n fieldName: this.fieldName,\n fileName: upload.name,\n metaDataField: this.getMetaDataField(),\n upload\n });\n }\n }\n\n findUploadByName(fileName: string): BaseUpload | undefined {\n return this.uploads.find(upload => upload.name === fileName);\n }\n\n getMetaDataField(): HTMLElement | null {\n return findInput(\n this.form,\n getMetadataFieldName(this.fieldName, this.prefix),\n this.prefix\n );\n }\n\n getUploadByIndex(uploadIndex: number): BaseUpload | undefined {\n return this.uploads.find(upload => upload.uploadIndex === uploadIndex);\n }\n\n async handleCancel(upload: BaseUpload): Promise {\n this.renderer.disableCancel(upload.uploadIndex);\n await upload.abort();\n this.removeUploadFromList(upload);\n }\n\n initDropArea(container: Element, inputAccept: string): void {\n new DropArea({\n container,\n inputAccept,\n onUploadFiles: this.uploadFiles,\n renderer: this.renderer\n });\n }\n\n async removeExistingUpload(upload: BaseUpload): Promise {\n const element = this.renderer.findFileDiv(upload.uploadIndex);\n\n if (element) {\n this.emitEvent(\"removeUpload\", element, upload);\n }\n\n if (upload.status === \"uploading\") {\n this.renderer.disableCancel(upload.uploadIndex);\n await upload.abort();\n } else if (upload.status === \"done\") {\n this.renderer.disableDelete(upload.uploadIndex);\n\n try {\n await upload.delete();\n } catch {\n this.renderer.setDeleteFailed(upload.uploadIndex);\n return;\n }\n }\n\n this.removeUploadFromList(upload);\n this.updatePlaceholderInput();\n }\n\n removeUploadFromList(upload: BaseUpload): void {\n this.renderer.deleteFile(upload.uploadIndex);\n\n const index = this.uploads.indexOf(upload);\n\n if (index >= 0) {\n this.uploads.splice(index, 1);\n }\n\n this.checkDropHint();\n\n const { onDelete } = this.callbacks;\n\n if (onDelete) {\n onDelete(upload);\n }\n }\n\n updatePlaceholderInput(): void {\n const input = findInput(\n this.form,\n getUploadsFieldName(this.fieldName, this.prefix),\n this.prefix\n );\n if (!input) {\n return;\n }\n\n const placeholdersInfo: InitialFile[] = this.uploads.map(upload =>\n upload.getInitialFile()\n );\n\n input.value = JSON.stringify(placeholdersInfo);\n }\n\n async uploadFile(file: File): Promise {\n const createUpload = (): S3Upload | TusUpload => {\n const { csrfToken, s3UploadDir } = this;\n\n if (s3UploadDir != null) {\n return new S3Upload({\n csrfToken,\n endpoint: uploadUrl,\n file,\n s3UploadDir,\n uploadIndex: newUploadIndex\n });\n } else {\n return new TusUpload({\n chunkSize: this.chunkSize,\n csrfToken: this.csrfToken,\n fieldName,\n file,\n formId,\n retryDelays: this.retryDelays,\n uploadIndex: newUploadIndex,\n uploadUrl\n });\n }\n };\n\n const { fieldName, formId, renderer, uploadUrl } = this;\n const fileName = file.name;\n const existingUpload = this.findUploadByName(fileName);\n const newUploadIndex = existingUpload\n ? existingUpload.uploadIndex\n : this.nextUploadIndex;\n\n if (!existingUpload) {\n this.nextUploadIndex += 1;\n }\n\n if (existingUpload) {\n await this.removeExistingUpload(existingUpload);\n }\n\n const upload = createUpload();\n\n upload.onError = (error: unknown) => {\n this.handleError(upload, error);\n };\n upload.onProgress = (bytesUploaded, bytesTotal) => {\n this.handleProgress(upload, bytesUploaded, bytesTotal);\n };\n upload.onSuccess = () => {\n this.handleSuccess(upload);\n };\n upload.start();\n\n this.uploads.push(upload);\n\n const element = renderer.addNewUpload(fileName, newUploadIndex);\n this.emitEvent(\"addUpload\", element, upload);\n }\n}\n\nexport default FileField;\n","import { EventEmitter } from \"eventemitter3\";\n\nimport FileField, { Callbacks, Translations } from \"./file_field.ts\";\nimport { InitialFile } from \"./uploads/base_upload.ts\";\nimport {\n findInput,\n getInputValueForFormAndPrefix,\n getUploadsFieldName\n} from \"./util.ts\";\n\nexport interface Options {\n callbacks?: Callbacks;\n chunkSize?: number;\n eventEmitter?: EventEmitter;\n prefix?: string;\n retryDelays?: number[];\n skipRequired?: boolean;\n supportDropArea?: boolean;\n}\n\nconst initUploadFields = (form: Element, options: Options = {}): void => {\n const matchesPrefix = (fieldName: string): boolean => {\n if (!options.prefix) {\n return true;\n }\n\n return fieldName.startsWith(`${options.prefix}-`);\n };\n\n const getPrefix = (): null | string =>\n options.prefix ? options.prefix : null;\n\n const getInputValue = (fieldName: string): string | undefined =>\n getInputValueForFormAndPrefix(form, fieldName, getPrefix());\n\n const getInitialFiles = (fieldName: string): InitialFile[] => {\n const data = getInputValue(getUploadsFieldName(fieldName, getPrefix()));\n\n if (!data) {\n return [];\n }\n\n return (JSON.parse(data) as Record[]).filter(\n file => file.type\n ) as unknown as InitialFile[];\n };\n\n const uploadUrl = getInputValue(\"upload_url\");\n const formId = getInputValue(\"form_id\");\n const s3UploadDir = getInputValue(\"s3_upload_dir\");\n const skipRequired = options.skipRequired ?? false;\n const prefix = getPrefix();\n const csrfToken = findInput(form, \"csrfmiddlewaretoken\", null)?.value;\n\n if (!csrfToken) {\n throw Error(\"Csrf token not found\");\n }\n\n if (!formId || !uploadUrl) {\n return;\n }\n\n form.querySelectorAll(\".dff-uploader\").forEach(uploaderDiv => {\n const container = uploaderDiv.querySelector(\".dff-container\");\n\n if (!container) {\n return;\n }\n\n const input = container.querySelector(\"input[type=file]\");\n\n if (!(input && matchesPrefix(input.name))) {\n return;\n }\n\n const fieldName = input.name;\n const { multiple } = input;\n const initial = getInitialFiles(fieldName);\n const dataTranslations = container.getAttribute(\"data-translations\");\n const translations: Translations = dataTranslations\n ? (JSON.parse(dataTranslations) as Translations)\n : {};\n const supportDropArea = !(options.supportDropArea === false);\n\n new FileField({\n callbacks: options.callbacks ?? {},\n chunkSize: options.chunkSize ?? 2621440,\n csrfToken,\n eventEmitter: options.eventEmitter,\n fieldName,\n form,\n formId,\n initial,\n input,\n multiple,\n parent: container,\n prefix,\n retryDelays: options.retryDelays ?? null,\n s3UploadDir: s3UploadDir ?? null,\n skipRequired,\n supportDropArea,\n translations,\n uploadUrl\n });\n });\n};\n\nexport default initUploadFields;\n","import initUploadFields, { Options } from \"./init_upload_fields.ts\";\nimport {\n getInputNameWithPrefix,\n getInputValueForFormAndPrefix\n} from \"./util.ts\";\n\nconst initFormSet = (form: Element, optionsParam: Options | string): void => {\n let options: Options;\n\n if (typeof optionsParam === \"string\") {\n options = { prefix: optionsParam };\n } else {\n options = optionsParam;\n }\n\n const prefix = options.prefix ?? \"form\";\n\n const totalFormsValue = getInputValueForFormAndPrefix(\n form,\n \"TOTAL_FORMS\",\n prefix\n );\n\n if (!totalFormsValue) {\n return;\n }\n\n const formCount = parseInt(totalFormsValue, 10);\n\n for (let i = 0; i < formCount; i += 1) {\n const subFormPrefix = getInputNameWithPrefix(i.toString(), null);\n initUploadFields(form, {\n ...options,\n prefix: `${prefix}-${subFormPrefix}`\n });\n }\n};\n\nexport default initFormSet;\n","import autoInitFileForms from \"./auto_init_file_forms.ts\";\nimport initFormSet from \"./init_form_set.ts\";\nimport initUploadFields from \"./init_upload_fields.ts\";\n\ndeclare const window: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n\nwindow.autoInitFileForms = autoInitFileForms; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\nwindow.initFormSet = initFormSet; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\nwindow.initUploadFields = initUploadFields; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n"],"names":["findForm","element","parent","parentElement","tagName","unique","values","Array","from","Set","autoInitFileForms","initUploadFields","window","forms","document","querySelectorAll","map","forEach","this","standardTypes","POSIX_REGEX_SOURCE","constants","require$$0","utils","require$$1","scan","parse","require$$2","require$$3","picomatch","parseInputAccept","inputAccept","extensions","mimeTypes","split","mimeType","trim","filter","Boolean","fileType","startsWith","push","AcceptedFileTypes","constructor","isExtensionAccepted","fileName","length","isMatch","isMimeTypeAccepted","isAccepted","mime","getType","getEntriesFromDirectory","directoryEntry","Promise","resolve","reject","createReader","readEntries","getFileFromFileSystemFileEntry","fileEntry","file","getFilesFromFileSystemEntries","entries","result","entry","filesFromEntry","getFilesFromFileSystemEntry","isFile","isDirectory","entriesFromDirectory","files","getFilesFromDataTransfer","dataTransfer","items","item","fileSystemEntry","webkitGetAsEntry","getAsFile","DropArea","onDrop","e","dragEvent","container","classList","remove","preventDefault","stopPropagation","uploadFiles","acceptedFiles","invalidFiles","acceptedFileTypes","name","renderer","setErrorInvalidFiles","onUploadFiles","error","console","_ref","addEventListener","add","formatBytes","bytes","decimals","k","dm","sizes","i","Math","floor","log","n","parseFloat","toFixed","size","toString","getInputNameWithPrefix","fieldName","prefix","getInputNameWithoutPrefix","slice","findInput","form","inputNameWithPrefix","input","querySelector","getUploadsFieldName","getInputValueForFormAndPrefix","value","getMetadataFieldName","RenderUploadFile","createErrorContainer","div","createElement","className","appendChild","createFilesContainer","skipRequired","translations","errors","required","addFile","filename","uploadIndex","nameSpan","innerHTML","escape","setAttribute","enableDelete","index","deleteLink","findDeleteLink","findCancelSpan","el","findFileDiv","removeCancel","cancelSpan","removeProgress","progressSpan","setErrorMessage","message","originalMessageSpan","span","addNewUpload","innerSpan","cancelLink","Cancel","href","addUploadedFile","filesize","setSuccess","clearInput","deleteFile","disableCancel","disableDelete","removeDropHint","dropHint","renderDropHint","setDeleteFailed","setError","errorsMessages","msg","invalidFileTypeMessage","innerText","replaceChildren","fileSizeInfo","Delete","updateProgress","percentage","innerProgressSpan","style","width","BaseUpload","status","type","abort","delete","MB","abortMultipartUpload","csrfToken","endpoint","key","uploadId","encodeURIComponent","uploadIdEnc","headers","Headers","url","urljoin","fetch","method","then","response","json","completeMultipartUpload","_ref2","parts","body","JSON","stringify","data","createMultipartUpload","_ref3","s3UploadDir","accept","contentType","getChunkSize","ceil","prepareUploadPart","_ref4","number","arr","indexOf","splice","S3Upload","createdPromise","Error","chunks","chunkState","uploading","onError","undefined","onProgress","onSuccess","initChunks","catch","completeUpload","sort","a","b","PartNumber","err","handleError","createUpload","valid","TypeError","uploadParts","desiredChunkSize","minChunkSize","max","chunkSize","end","min","busy","done","uploaded","onPartComplete","etag","state","part","ETag","onPartProgress","sent","totalUploaded","reduce","c","uploadPart","uploadPartBytes","xhr","XMLHttpRequest","open","responseType","upload","ev","lengthComputable","loaded","target","getResponseHeader","send","need","every","candidates","getId","getInitialFile","id","original_name","getSize","start","DetailedError","causingErr","arguments","req","res","originalRequest","originalResponse","causingError","requestId","getHeader","getMethod","getURL","getStatus","getBody","NoopUrlStorage","listAllUploads","findUploadsByFingerprint","_fingerprint","removeUpload","_urlStorageKey","addUpload","_upload","encode","decode","querystringify_1","global","uuid","replace","r","random","v","PROTOCOL_TUS_V1","PROTOCOL_IETF_DRAFT_03","defaultOptions","uploadUrl","metadata","metadataForPartialUploads","fingerprint","uploadSize","onChunkComplete","onUploadUrlAvailable","overridePatchMethod","addRequestId","onBeforeRequest","onAfterResponse","onShouldRetry","defaultOnShouldRetry","Number","POSITIVE_INFINITY","retryDelays","parallelUploads","parallelUploadBoundaries","storeFingerprintForResuming","removeFingerprintOnSuccess","uploadLengthDeferred","uploadDataDuringCreation","urlStorage","fileReader","httpStack","protocol","options","_urlStorage","_req","_offset","_aborted","_size","_source","_retryAttempt","_retryTimeout","_offsetBeforeRetry","_parallelUploads","_parallelUploadUrls","terminate","openRequest","sendRequest","shouldRetry","delay","remainingDelays","newOptions","setTimeout","findPreviousUploads","resumeFromPreviousUpload","previousUpload","parallelUploadUrls","urlStorageKey","_emitError","includes","Object","prototype","call","optionName","openFile","source","isNaN","_startParallelUpload","_startSingleUpload","totalSize","totalProgress","partCount","splitSizeIntoParts","uploads","lastPartProgress","newPartProgress","_emitProgress","u","_saveUploadInUrlStorage","all","_openRequest","setHeader","join","encodeMetadata","_sendRequest","inStatusCategory","_emitHttpError","location","resolveUrl","_emitSuccess","_resumeUpload","_createUpload","shouldTerminate","clearTimeout","_removeFromUrlStorage","shouldResetDelays","lastResponse","bytesSent","bytesTotal","_emitChunkComplete","bytesAccepted","promise","_addChunkToRequest","close","_handleUploadResponse","_performUpload","offset","parseInt","setProgressHandler","valueSize","newSize","storedUpload","creationTime","Date","Base64","String","category","createRequest","isOnline","online","navigator","onLine","retryAttempt","origin","link","URL","partSize","isReactNative","product","toLowerCase","uriToBlob","uri","onload","blob","onerror","isCordova","PhoneGap","Cordova","cordova","readAsByteArray","chunk","reader","FileReader","Uint8Array","readAsArrayBuffer","FileSource","_file","len","blobOrArray","concat","Blob","set","StreamSource","_buffer","_bufferOffset","_reader","_done","_readUntilEnoughDataOrDone","hasEnoughData","_getDataFromBuffer","read","hasAllDataBeenRead","cancel","isFinite","reactNativeFingerprint","lastModified","exifHash","exif","hashCode","str","hash","char","charCodeAt","XHRHttpStack","Request","getName","_xhr","_method","_url","_headers","header","setRequestHeader","progressHandler","onprogress","Response","getUnderlyingObject","responseText","hasStorage","originalValue","localStorage","getItem","setItem","removeItem","code","SECURITY_ERR","QUOTA_EXCEEDED_ERR","canStoreURLs","WebStorageUrlStorage","findAllUploads","results","_findEntries","round","_e","DefaultHttpStack","Upload","deleteUpload","TusUpload","addCsrTokenToRequest","request","handleAfterReponse","_request","resourceId","handleProgress","bytesUploaded","handleSucces","formId","BaseUploadedFile","PlaceholderFile","initialFile","UploadedS3File","ExistingFile","UploadedTusFile","createUploadedFile","FileField","handleClick","getUpload","dataIndex","getAttribute","getUploadByIndex","contains","removeExistingUpload","handleCancel","callbacks","onClick","handleInvalidFiles","handleSuccess","updatePlaceholderInput","emitEvent","onChange","multiple","uploadFile","checkDropHint","eventEmitter","initial","supportDropArea","disabled","nextUploadIndex","filesContainer","initDropArea","addInitialFiles","initialFiles","addInitialFile","nonEmptyUploads","eventName","emit","metaDataField","getMetaDataField","findUploadByName","find","removeUploadFromList","onDelete","placeholdersInfo","newUploadIndex","existingUpload","matchesPrefix","getPrefix","getInputValue","getInitialFiles","uploaderDiv","dataTranslations","initFormSet","optionsParam","totalFormsValue","formCount","subFormPrefix"],"mappings":";;EAAA,MAAMA,QAAQ,GAAIC,OAAgB,IAAyB;EACzD,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AC;;;;;;","x_google_ignoreList":[1,2,3,4,5,6,7,8,9,12,16,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38]} \ No newline at end of file diff --git a/django_file_form/static/file_form/file_form.min.js b/django_file_form/static/file_form/file_form.min.js index 5210512fb..d2738e1b9 100644 --- a/django_file_form/static/file_form/file_form.min.js +++ b/django_file_form/static/file_form/file_form.min.js @@ -1,9 +1,9 @@ -!function(){const e=t=>{const s=t.parentElement;return s?"FORM"===s.tagName?s:e(s):null},t=(e,t)=>t?`${t}-${e}`:e,s=(e,t)=>t?e.slice(t.length+1):e,i=(e,s,i)=>{const o=t(s,i),n=e.querySelector(`[name="${o}"]`);return n||null},o=(e,t)=>`${s(e,t)}-uploads`,n=(e,t,s)=>i(e,t,s)?.value;var r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e} +!function(){const e=t=>{const s=t.parentElement;return s?"FORM"===s.tagName?s:e(s):null},t={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(t);var s,i,o,n=window&&window.__classPrivateFieldGet||function(e,t,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(e):i?i.value:t.get(e)};s=new WeakMap,i=new WeakMap,o=new WeakMap;var r=new class{constructor(...e){s.set(this,new Map),i.set(this,new Map),o.set(this,new Map);for(const t of e)this.define(t)}define(e,t=!1){for(let[r,a]of Object.entries(e)){r=r.toLowerCase(),a=a.map((e=>e.toLowerCase())),n(this,o,"f").has(r)||n(this,o,"f").set(r,new Set);const e=n(this,o,"f").get(r);let l=!0;for(let o of a){const a=o.startsWith("*");if(o=a?o.slice(1):o,e?.add(o),l&&n(this,i,"f").set(r,o),l=!1,a)continue;const p=n(this,s,"f").get(o);if(p&&p!=r&&!t)throw new Error(`"${r} -> ${o}" conflicts with "${p} -> ${o}". Pass \`force=true\` to override this definition.`);n(this,s,"f").set(o,r)}}return this}getType(e){if("string"!=typeof e)return null;const t=e.replace(/^.*[/\\]/,"").toLowerCase(),i=t.replace(/^.*\./,"").toLowerCase(),o=t.length{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const e of n(this,o,"f").values())Object.freeze(e);return this}_getTestState(){return{types:n(this,s,"f"),extensions:n(this,i,"f")}}}(t)._freeze(),a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p={};const c="\\\\/",u=`[^${c}]`,d="\\.",h="\\/",f="[^/]",m=`(?:${h}|$)`,g=`(?:^|${h})`,x=`${d}{1,2}${m}`,y={DOT_LITERAL:d,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:h,ONE_CHAR:"(?=.)",QMARK:f,END_ANCHOR:m,DOTS_SLASH:x,NO_DOT:`(?!${d})`,NO_DOTS:`(?!${g}${x})`,NO_DOT_SLASH:`(?!${d}{0,1}${m})`,NO_DOTS_SLASH:`(?!${x})`,QMARK_NO_DOT:`[^.${h}]`,STAR:`${f}*?`,START_ANCHOR:g,SEP:"/"},v={...y,SLASH_LITERAL:`[${c}]`,QMARK:u,STAR:`${u}*?`,DOTS_SLASH:`${d}{1,2}(?:[${c}]|$)`,NO_DOT:`(?!${d})`,NO_DOTS:`(?!(?:^|[${c}])${d}{1,2}(?:[${c}]|$))`,NO_DOT_SLASH:`(?!${d}{0,1}(?:[${c}]|$))`,NO_DOTS_SLASH:`(?!${d}{1,2}(?:[${c}]|$))`,QMARK_NO_DOT:`[^.${c}]`,START_ANCHOR:`(?:^|[${c}])`,END_ANCHOR:`(?:[${c}]|$)`,SEP:"\\"};var _={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?v:y};!function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=_;e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>i.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(o,"\\$1"),e.toPosixSlashes=e=>e.replace(t,"/"),e.isWindows=()=>{if("undefined"!=typeof navigator&&navigator.platform){const e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return!("undefined"==typeof process||!process.platform)&&"win32"===process.platform},e.removeBackslashes=e=>e.replace(s,(e=>"\\"===e?"":e)),e.escapeLast=(t,s,i)=>{const o=t.lastIndexOf(s,i);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,s,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let s=e;return s.startsWith("./")&&(s=s.slice(2),t.prefix="./"),s},e.wrapOutput=(e,t={},s={})=>{let i=`${s.contains?"":"^"}(?:${e})${s.contains?"":"$"}`;return!0===t.negated&&(i=`(?:^(?!${i}).*$)`),i},e.basename=(e,{windows:t}={})=>{const s=e.split(t?/[\\/]/:"/"),i=s[s.length-1];return""===i?s[s.length-2]:i}}(p);const b=p,{CHAR_ASTERISK:E,CHAR_AT:S,CHAR_BACKWARD_SLASH:R,CHAR_COMMA:w,CHAR_DOT:A,CHAR_EXCLAMATION_MARK:k,CHAR_FORWARD_SLASH:C,CHAR_LEFT_CURLY_BRACE:U,CHAR_LEFT_PARENTHESES:T,CHAR_LEFT_SQUARE_BRACKET:I,CHAR_PLUS:$,CHAR_QUESTION_MARK:H,CHAR_RIGHT_CURLY_BRACE:L,CHAR_RIGHT_PARENTHESES:D,CHAR_RIGHT_SQUARE_BRACKET:P}=_,O=e=>e===C||e===R,N=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};var F=(e,t)=>{const s=t||{},i=e.length-1,o=!0===s.parts||!0===s.scanToEnd,n=[],r=[],a=[];let l,p,c=e,u=-1,d=0,h=0,f=!1,m=!1,g=!1,x=!1,y=!1,v=!1,_=!1,F=!1,j=!1,z=!1,q=0,M={value:"",depth:0,isGlob:!1};const B=()=>u>=i,G=()=>(l=p,c.charCodeAt(++u));for(;u0&&(X=c.slice(0,d),c=c.slice(d),h-=d),K&&!0===g&&h>0?(K=c.slice(0,h),Q=c.slice(h)):!0===g?(K="",Q=c):K=c,K&&""!==K&&"/"!==K&&K!==c&&O(K.charCodeAt(K.length-1))&&(K=K.slice(0,-1)),!0===s.unescape&&(Q&&(Q=b.removeBackslashes(Q)),K&&!0===_&&(K=b.removeBackslashes(K)));const W={prefix:X,input:e,start:d,base:K,glob:Q,isBrace:f,isBracket:m,isGlob:g,isExtglob:x,isGlobstar:y,negated:F,negatedExtglob:j};if(!0===s.tokens&&(W.maxDepth=0,O(p)||r.push(M),W.tokens=r),!0===s.parts||!0===s.tokens){let t;for(let i=0;i{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const s=`[${e.join("-")}]`;try{new RegExp(s)}catch(t){return e.map((e=>z.escapeRegex(e))).join("..")}return s},Q=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,W=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=K[e]||e;const s={...t},i="number"==typeof s.maxLength?Math.min(q,s.maxLength):q;let o=e.length;if(o>i)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${i}`);const n={type:"bos",value:"",output:s.prepend||""},r=[n],a=s.capture?"":"?:",l=j.globChars(s.windows),p=j.extglobChars(l),{DOT_LITERAL:c,PLUS_LITERAL:u,SLASH_LITERAL:d,ONE_CHAR:h,DOTS_SLASH:f,NO_DOT:m,NO_DOT_SLASH:g,NO_DOTS_SLASH:x,QMARK:y,QMARK_NO_DOT:v,STAR:_,START_ANCHOR:b}=l,E=e=>`(${a}(?:(?!${b}${e.dot?f:c}).)*?)`,S=s.dot?"":m,R=s.dot?y:v;let w=!0===s.bash?E(s):_;s.capture&&(w=`(${w})`),"boolean"==typeof s.noext&&(s.noextglob=s.noext);const A={input:e,index:-1,start:0,dot:!0===s.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:r};e=z.removePrefix(e,A),o=e.length;const k=[],C=[],U=[];let T,I=n;const $=()=>A.index===o-1,H=A.peek=(t=1)=>e[A.index+t],L=A.advance=()=>e[++A.index]||"",D=()=>e.slice(A.index+1),P=(e="",t=0)=>{A.consumed+=e,A.index+=t},O=e=>{A.output+=null!=e.output?e.output:e.value,P(e.value)},N=()=>{let e=1;for(;"!"===H()&&("("!==H(2)||"?"===H(3));)L(),A.start++,e++;return e%2!=0&&(A.negated=!0,A.start++,!0)},F=e=>{A[e]++,U.push(e)},Z=e=>{A[e]--,U.pop()},J=e=>{if("globstar"===I.type){const t=A.braces>0&&("comma"===e.type||"brace"===e.type),s=!0===e.extglob||k.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||s||(A.output=A.output.slice(0,-I.output.length),I.type="star",I.value="*",I.output=w,A.output+=I.output)}if(k.length&&"paren"!==e.type&&(k[k.length-1].inner+=e.value),(e.value||e.output)&&O(e),I&&"text"===I.type&&"text"===e.type)return I.output=(I.output||I.value)+e.value,void(I.value+=e.value);e.prev=I,r.push(e),I=e},Y=(e,t)=>{const i={...p[t],conditions:1,inner:""};i.prev=I,i.parens=A.parens,i.output=A.output;const o=(s.capture?"(":"")+i.open;F("parens"),J({type:e,value:t,output:A.output?"":h}),J({type:"paren",extglob:!0,value:L(),output:o}),k.push(i)},V=e=>{let i,o=e.close+(s.capture?")":"");if("negate"===e.type){let n=w;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(n=E(s)),(n!==w||$()||/^\)+$/.test(D()))&&(o=e.close=`)$))${n}`),e.inner.includes("*")&&(i=D())&&/^\.[^\\/.]+$/.test(i)){const s=W(i,{...t,fastpaths:!1}).output;o=e.close=`)${s})${n})`}"bos"===e.prev.type&&(A.negatedExtglob=!0)}J({type:"paren",extglob:!0,value:T,output:o}),Z("parens")};if(!1!==s.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let i=!1,o=e.replace(G,((e,t,s,o,n,r)=>"\\"===o?(i=!0,e):"?"===o?t?t+o+(n?y.repeat(n.length):""):0===r?R+(n?y.repeat(n.length):""):y.repeat(s.length):"."===o?c.repeat(s.length):"*"===o?t?t+o+(n?w:""):w:t?e:`\\${e}`));return!0===i&&(o=!0===s.unescape?o.replace(/\\/g,""):o.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),o===e&&!0===s.contains?(A.output=e,A):(A.output=z.wrapOutput(o,A,t),A)}for(;!$();){if(T=L(),"\0"===T)continue;if("\\"===T){const e=H();if("/"===e&&!0!==s.bash)continue;if("."===e||";"===e)continue;if(!e){T+="\\",J({type:"text",value:T});continue}const t=/^\\+/.exec(D());let i=0;if(t&&t[0].length>2&&(i=t[0].length,A.index+=i,i%2!=0&&(T+="\\")),!0===s.unescape?T=L():T+=L(),0===A.brackets){J({type:"text",value:T});continue}}if(A.brackets>0&&("]"!==T||"["===I.value||"[^"===I.value)){if(!1!==s.posix&&":"===T){const e=I.value.slice(1);if(e.includes("[")&&(I.posix=!0,e.includes(":"))){const e=I.value.lastIndexOf("["),t=I.value.slice(0,e),s=I.value.slice(e+2),i=M[s];if(i){I.value=t+i,A.backtrack=!0,L(),n.output||1!==r.indexOf(I)||(n.output=h);continue}}}("["===T&&":"!==H()||"-"===T&&"]"===H())&&(T=`\\${T}`),"]"!==T||"["!==I.value&&"[^"!==I.value||(T=`\\${T}`),!0===s.posix&&"!"===T&&"["===I.value&&(T="^"),I.value+=T,O({value:T});continue}if(1===A.quotes&&'"'!==T){T=z.escapeRegex(T),I.value+=T,O({value:T});continue}if('"'===T){A.quotes=1===A.quotes?0:1,!0===s.keepQuotes&&J({type:"text",value:T});continue}if("("===T){F("parens"),J({type:"paren",value:T});continue}if(")"===T){if(0===A.parens&&!0===s.strictBrackets)throw new SyntaxError(Q("opening","("));const e=k[k.length-1];if(e&&A.parens===e.parens+1){V(k.pop());continue}J({type:"paren",value:T,output:A.parens?")":"\\)"}),Z("parens");continue}if("["===T){if(!0!==s.nobracket&&D().includes("]"))F("brackets");else{if(!0!==s.nobracket&&!0===s.strictBrackets)throw new SyntaxError(Q("closing","]"));T=`\\${T}`}J({type:"bracket",value:T});continue}if("]"===T){if(!0===s.nobracket||I&&"bracket"===I.type&&1===I.value.length){J({type:"text",value:T,output:`\\${T}`});continue}if(0===A.brackets){if(!0===s.strictBrackets)throw new SyntaxError(Q("opening","["));J({type:"text",value:T,output:`\\${T}`});continue}Z("brackets");const e=I.value.slice(1);if(!0===I.posix||"^"!==e[0]||e.includes("/")||(T=`/${T}`),I.value+=T,O({value:T}),!1===s.literalBrackets||z.hasRegexChars(e))continue;const t=z.escapeRegex(I.value);if(A.output=A.output.slice(0,-I.value.length),!0===s.literalBrackets){A.output+=t,I.value=t;continue}I.value=`(${a}${t}|${I.value})`,A.output+=I.value;continue}if("{"===T&&!0!==s.nobrace){F("braces");const e={type:"brace",value:T,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};C.push(e),J(e);continue}if("}"===T){const e=C[C.length-1];if(!0===s.nobrace||!e){J({type:"text",value:T,output:T});continue}let t=")";if(!0===e.dots){const e=r.slice(),i=[];for(let t=e.length-1;t>=0&&(r.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&i.unshift(e[t].value);t=X(i,s),A.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const s=A.output.slice(0,e.outputIndex),i=A.tokens.slice(e.tokensIndex);e.value=e.output="\\{",T=t="\\}",A.output=s;for(const e of i)A.output+=e.output||e.value}J({type:"brace",value:T,output:t}),Z("braces"),C.pop();continue}if("|"===T){k.length>0&&k[k.length-1].conditions++,J({type:"text",value:T});continue}if(","===T){let e=T;const t=C[C.length-1];t&&"braces"===U[U.length-1]&&(t.comma=!0,e="|"),J({type:"comma",value:T,output:e});continue}if("/"===T){if("dot"===I.type&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",r.pop(),I=n;continue}J({type:"slash",value:T,output:d});continue}if("."===T){if(A.braces>0&&"dot"===I.type){"."===I.value&&(I.output=c);const e=C[C.length-1];I.type="dots",I.output+=T,I.value+=T,e.dots=!0;continue}if(A.braces+A.parens===0&&"bos"!==I.type&&"slash"!==I.type){J({type:"text",value:T,output:c});continue}J({type:"dot",value:T,output:c});continue}if("?"===T){if(!(I&&"("===I.value)&&!0!==s.noextglob&&"("===H()&&"?"!==H(2)){Y("qmark",T);continue}if(I&&"paren"===I.type){const e=H();let t=T;("("===I.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(D()))&&(t=`\\${T}`),J({type:"text",value:T,output:t});continue}if(!0!==s.dot&&("slash"===I.type||"bos"===I.type)){J({type:"qmark",value:T,output:v});continue}J({type:"qmark",value:T,output:y});continue}if("!"===T){if(!0!==s.noextglob&&"("===H()&&("?"!==H(2)||!/[!=<:]/.test(H(3)))){Y("negate",T);continue}if(!0!==s.nonegate&&0===A.index){N();continue}}if("+"===T){if(!0!==s.noextglob&&"("===H()&&"?"!==H(2)){Y("plus",T);continue}if(I&&"("===I.value||!1===s.regex){J({type:"plus",value:T,output:u});continue}if(I&&("bracket"===I.type||"paren"===I.type||"brace"===I.type)||A.parens>0){J({type:"plus",value:T});continue}J({type:"plus",value:u});continue}if("@"===T){if(!0!==s.noextglob&&"("===H()&&"?"!==H(2)){J({type:"at",extglob:!0,value:T,output:""});continue}J({type:"text",value:T});continue}if("*"!==T){"$"!==T&&"^"!==T||(T=`\\${T}`);const e=B.exec(D());e&&(T+=e[0],A.index+=e[0].length),J({type:"text",value:T});continue}if(I&&("globstar"===I.type||!0===I.star)){I.type="star",I.star=!0,I.value+=T,I.output=w,A.backtrack=!0,A.globstar=!0,P(T);continue}let t=D();if(!0!==s.noextglob&&/^\([^?]/.test(t)){Y("star",T);continue}if("star"===I.type){if(!0===s.noglobstar){P(T);continue}const i=I.prev,o=i.prev,n="slash"===i.type||"bos"===i.type,r=o&&("star"===o.type||"globstar"===o.type);if(!0===s.bash&&(!n||t[0]&&"/"!==t[0])){J({type:"star",value:T,output:""});continue}const a=A.braces>0&&("comma"===i.type||"brace"===i.type),l=k.length&&("pipe"===i.type||"paren"===i.type);if(!n&&"paren"!==i.type&&!a&&!l){J({type:"star",value:T,output:""});continue}for(;"/**"===t.slice(0,3);){const s=e[A.index+4];if(s&&"/"!==s)break;t=t.slice(3),P("/**",3)}if("bos"===i.type&&$()){I.type="globstar",I.value+=T,I.output=E(s),A.output=I.output,A.globstar=!0,P(T);continue}if("slash"===i.type&&"bos"!==i.prev.type&&!r&&$()){A.output=A.output.slice(0,-(i.output+I.output).length),i.output=`(?:${i.output}`,I.type="globstar",I.output=E(s)+(s.strictSlashes?")":"|$)"),I.value+=T,A.globstar=!0,A.output+=i.output+I.output,P(T);continue}if("slash"===i.type&&"bos"!==i.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";A.output=A.output.slice(0,-(i.output+I.output).length),i.output=`(?:${i.output}`,I.type="globstar",I.output=`${E(s)}${d}|${d}${e})`,I.value+=T,A.output+=i.output+I.output,A.globstar=!0,P(T+L()),J({type:"slash",value:"/",output:""});continue}if("bos"===i.type&&"/"===t[0]){I.type="globstar",I.value+=T,I.output=`(?:^|${d}|${E(s)}${d})`,A.output=I.output,A.globstar=!0,P(T+L()),J({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-I.output.length),I.type="globstar",I.output=E(s),I.value+=T,A.output+=I.output,A.globstar=!0,P(T);continue}const i={type:"star",value:T,output:w};!0!==s.bash?!I||"bracket"!==I.type&&"paren"!==I.type||!0!==s.regex?(A.index!==A.start&&"slash"!==I.type&&"dot"!==I.type||("dot"===I.type?(A.output+=g,I.output+=g):!0===s.dot?(A.output+=x,I.output+=x):(A.output+=S,I.output+=S),"*"!==H()&&(A.output+=h,I.output+=h)),J(i)):(i.output=T,J(i)):(i.output=".*?","bos"!==I.type&&"slash"!==I.type||(i.output=S+i.output),J(i))}for(;A.brackets>0;){if(!0===s.strictBrackets)throw new SyntaxError(Q("closing","]"));A.output=z.escapeLast(A.output,"["),Z("brackets")}for(;A.parens>0;){if(!0===s.strictBrackets)throw new SyntaxError(Q("closing",")"));A.output=z.escapeLast(A.output,"("),Z("parens")}for(;A.braces>0;){if(!0===s.strictBrackets)throw new SyntaxError(Q("closing","}"));A.output=z.escapeLast(A.output,"{"),Z("braces")}if(!0===s.strictSlashes||"star"!==I.type&&"bracket"!==I.type||J({type:"maybe_slash",value:"",output:`${d}?`}),!0===A.backtrack){A.output="";for(const e of A.tokens)A.output+=null!=e.output?e.output:e.value,e.suffix&&(A.output+=e.suffix)}return A};W.fastpaths=(e,t)=>{const s={...t},i="number"==typeof s.maxLength?Math.min(q,s.maxLength):q,o=e.length;if(o>i)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${i}`);e=K[e]||e;const{DOT_LITERAL:n,SLASH_LITERAL:r,ONE_CHAR:a,DOTS_SLASH:l,NO_DOT:p,NO_DOTS:c,NO_DOTS_SLASH:u,STAR:d,START_ANCHOR:h}=j.globChars(s.windows),f=s.dot?c:p,m=s.dot?u:p,g=s.capture?"":"?:";let x=!0===s.bash?".*?":d;s.capture&&(x=`(${x})`);const y=e=>!0===e.noglobstar?x:`(${g}(?:(?!${h}${e.dot?l:n}).)*?)`,v=e=>{switch(e){case"*":return`${f}${a}${x}`;case".*":return`${n}${a}${x}`;case"*.*":return`${f}${x}${n}${a}${x}`;case"*/*":return`${f}${x}${r}${a}${m}${x}`;case"**":return f+y(s);case"**/*":return`(?:${f}${y(s)}${r})?${m}${a}${x}`;case"**/*.*":return`(?:${f}${y(s)}${r})?${m}${x}${n}${a}${x}`;case"**/.*":return`(?:${f}${y(s)}${r})?${n}${a}${x}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const s=v(t[1]);if(!s)return;return s+n+t[2]}}},_=z.removePrefix(e,{negated:!1,prefix:""});let b=v(_);return b&&!0!==s.strictSlashes&&(b+=`${r}?`),b};const Z=F,J=W,Y=p,V=_,ee=(e,t,s=!1)=>{if(Array.isArray(e)){const i=e.map((e=>ee(e,t,s))),o=e=>{for(const t of i){const s=t(e);if(s)return s}return!1};return o}const i=(o=e)&&"object"==typeof o&&!Array.isArray(o)&&e.tokens&&e.input;var o;if(""===e||"string"!=typeof e&&!i)throw new TypeError("Expected pattern to be a non-empty string");const n=t||{},r=n.windows,a=i?ee.compileRe(e,t):ee.makeRe(e,t,!1,!0),l=a.state;delete a.state;let p=()=>!1;if(n.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};p=ee(n.ignore,e,s)}const c=(s,i=!1)=>{const{isMatch:o,match:c,output:u}=ee.test(s,a,t,{glob:e,posix:r}),d={glob:e,state:l,regex:a,posix:r,input:s,output:u,match:c,isMatch:o};return"function"==typeof n.onResult&&n.onResult(d),!1===o?(d.isMatch=!1,!!i&&d):p(s)?("function"==typeof n.onIgnore&&n.onIgnore(d),d.isMatch=!1,!!i&&d):("function"==typeof n.onMatch&&n.onMatch(d),!i||d)};return s&&(c.state=l),c};ee.test=(e,t,s,{glob:i,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const n=s||{},r=n.format||(o?Y.toPosixSlashes:null);let a=e===i,l=a&&r?r(e):e;return!1===a&&(l=r?r(e):e,a=l===i),!1!==a&&!0!==n.capture||(a=!0===n.matchBase||!0===n.basename?ee.matchBase(e,t,s,o):t.exec(l)),{isMatch:Boolean(a),match:a,output:l}},ee.matchBase=(e,t,s)=>(t instanceof RegExp?t:ee.makeRe(t,s)).test(Y.basename(e)),ee.isMatch=(e,t,s)=>ee(t,s)(e),ee.parse=(e,t)=>Array.isArray(e)?e.map((e=>ee.parse(e,t))):J(e,{...t,fastpaths:!1}),ee.scan=(e,t)=>Z(e,t),ee.compileRe=(e,t,s=!1,i=!1)=>{if(!0===s)return e.output;const o=t||{},n=o.contains?"":"^",r=o.contains?"":"$";let a=`${n}(?:${e.output})${r}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const l=ee.toRegex(a,t);return!0===i&&(l.state=e),l},ee.makeRe=(e,t={},s=!1,i=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(o.output=J.fastpaths(e,t)),o.output||(o=J(e,t)),ee.compileRe(o,t,s,i)},ee.toRegex=(e,t)=>{try{const s=t||{};return new RegExp(e,s.flags||(s.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},ee.constants=V;var te=l(ee);class se{constructor(e){const[t,s]=(e=>{const t=[],s=[];return e.split(",").map((e=>e.trim())).filter(Boolean).forEach((e=>{e.startsWith(".")?t.push(`*${e}`):s.push(e)})),[t,s]})(e);this.extensions=t,this.mimeTypes=s}isExtensionAccepted(e){return 0!==this.extensions.length&&te.isMatch(e,this.extensions)}isMimeTypeAccepted(e){return!(!e||0===this.mimeTypes.length)&&te.isMatch(e,this.mimeTypes)}isAccepted(e){return 0===this.extensions.length&&0===this.mimeTypes.length||(this.isMimeTypeAccepted(r.getType(e))||this.isExtensionAccepted(e))}}const ie=async e=>{const t=[];if(e.isFile){const s=await(async e=>new Promise(((t,s)=>{e.file(t,s)})))(e);t.push(s)}else if(e.isDirectory){const s=await(async e=>new Promise(((t,s)=>{e.createReader().readEntries(t,s)})))(e),i=await(async e=>{const t=[];for(const s of e)(await ie(s)).forEach((e=>t.push(e)));return t})(s);i.forEach((e=>t.push(e)))}return t};class oe{onDrop=e=>{const t=e;this.container.classList.remove("dff-dropping"),t.preventDefault(),t.stopPropagation();(async()=>{try{if(t.dataTransfer){const e=await(async e=>{if(e.items){const t=[];for(const s of e.items){const e=s.webkitGetAsEntry();if(e)(await ie(e)).forEach((e=>t.push(e)));else{const e=s.getAsFile();e&&t.push(e)}}return t}return[...e.files]})(t.dataTransfer),s=[],i=[];for(const t of e)this.acceptedFileTypes.isAccepted(t.name)?s.push(t):i.push(t);this.renderer.setErrorInvalidFiles(i),this.onUploadFiles(s)}}catch(e){console.error(e)}})()};constructor(e){let{container:t,inputAccept:s,onUploadFiles:i,renderer:o}=e;this.container=t,this.onUploadFiles=i,this.acceptedFileTypes=new se(s),this.renderer=o,t.addEventListener("dragenter",(()=>{t.classList.add("dff-dropping")})),t.addEventListener("dragleave",(()=>{t.classList.remove("dff-dropping")})),t.addEventListener("dragover",(e=>{t.classList.add("dff-dropping"),e.preventDefault()})),t.addEventListener("drop",this.onDrop)}} /*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk * Copyright(c) 2015 Andreas Lubbe * Copyright(c) 2015 Tiancheng "Timothy" Gu * MIT Licensed - */var l=/["'&<>]/,p=function(e){var t,s=""+e,i=l.exec(s);if(!i)return s;var o="",n=0,r=0;for(n=i.index;n{if(0===e)return"0 Bytes";const s=t,i=Math.floor(Math.log(e)/Math.log(1024)),o=parseFloat((e/1024**i).toFixed(s)),n=["Bytes","KB","MB","GB"][i];return null==n?"":`${o.toString()} ${n}`})(t,2),e.className="dff-filesize",i.appendChild(e)}const o=document.createElement("a");o.innerHTML=s.Delete??"",o.className="dff-delete",o.setAttribute("data-index",e.toString()),o.href="#",i.appendChild(o)}this.removeProgress(e),this.removeCancel(e)}updateProgress(e,t){const s=this.container.querySelector(`.dff-file-id-${e.toString()}`);if(s){const e=s.querySelector(".dff-progress-inner");e&&(e.style.width=`${t}%`)}}createErrorContainer=e=>{const t=document.createElement("div");return t.className="dff-invalid-files",e.appendChild(t),t};createFilesContainer=e=>{const t=document.createElement("div");return t.className="dff-files",e.appendChild(t),t};addFile(e,t){const s=document.createElement("div");s.className=`dff-file dff-file-id-${t.toString()}`;const i=document.createElement("span");return i.innerHTML=c(e),i.className="dff-filename",i.setAttribute("data-index",t.toString()),s.appendChild(i),this.container.appendChild(s),this.input.required=!1,s}removeProgress(e){const t=this.findFileDiv(e);if(t){const e=t.querySelector(".dff-progress");e&&e.remove()}}removeCancel(e){const t=this.findCancelSpan(e);t&&t.remove()}findCancelSpan(e){const t=this.findFileDiv(e);return t?t.querySelector(".dff-cancel"):null}enableDelete(e){const t=this.findDeleteLink(e);t&&t.classList.remove("dff-disabled")}findDeleteLink(e){const t=this.findFileDiv(e);return t?t.querySelector(".dff-delete"):t}setErrorMessage(e,t){const s=this.findFileDiv(e);if(!s)return;const i=s.querySelector(".dff-error");i&&i.remove();const o=document.createElement("span");o.classList.add("dff-error"),o.innerHTML=t,s.appendChild(o)}}const d={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(d);var h,f,m,g=window&&window.__classPrivateFieldGet||function(e,t,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(e):i?i.value:t.get(e)};h=new WeakMap,f=new WeakMap,m=new WeakMap;var x=new class{constructor(...e){h.set(this,new Map),f.set(this,new Map),m.set(this,new Map);for(const t of e)this.define(t)}define(e,t=!1){for(let[s,i]of Object.entries(e)){s=s.toLowerCase(),i=i.map((e=>e.toLowerCase())),g(this,m,"f").has(s)||g(this,m,"f").set(s,new Set);const e=g(this,m,"f").get(s);let o=!0;for(let n of i){const i=n.startsWith("*");if(n=i?n.slice(1):n,e?.add(n),o&&g(this,f,"f").set(s,n),o=!1,i)continue;const r=g(this,h,"f").get(n);if(r&&r!=s&&!t)throw new Error(`"${s} -> ${n}" conflicts with "${r} -> ${n}". Pass \`force=true\` to override this definition.`);g(this,h,"f").set(n,s)}}return this}getType(e){if("string"!=typeof e)return null;const t=e.replace(/^.*[/\\]/,"").toLowerCase(),s=t.replace(/^.*\./,"").toLowerCase(),i=t.length{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const e of g(this,m,"f").values())Object.freeze(e);return this}_getTestState(){return{types:g(this,h,"f"),extensions:g(this,f,"f")}}}(d)._freeze(),y={};const v="\\\\/",_=`[^${v}]`,b="\\.",E="\\/",S="[^/]",R=`(?:${E}|$)`,w=`(?:^|${E})`,A=`${b}{1,2}${R}`,k={DOT_LITERAL:b,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:E,ONE_CHAR:"(?=.)",QMARK:S,END_ANCHOR:R,DOTS_SLASH:A,NO_DOT:`(?!${b})`,NO_DOTS:`(?!${w}${A})`,NO_DOT_SLASH:`(?!${b}{0,1}${R})`,NO_DOTS_SLASH:`(?!${A})`,QMARK_NO_DOT:`[^.${E}]`,STAR:`${S}*?`,START_ANCHOR:w,SEP:"/"},C={...k,SLASH_LITERAL:`[${v}]`,QMARK:_,STAR:`${_}*?`,DOTS_SLASH:`${b}{1,2}(?:[${v}]|$)`,NO_DOT:`(?!${b})`,NO_DOTS:`(?!(?:^|[${v}])${b}{1,2}(?:[${v}]|$))`,NO_DOT_SLASH:`(?!${b}{0,1}(?:[${v}]|$))`,NO_DOTS_SLASH:`(?!${b}{1,2}(?:[${v}]|$))`,QMARK_NO_DOT:`[^.${v}]`,START_ANCHOR:`(?:^|[${v}])`,END_ANCHOR:`(?:[${v}]|$)`,SEP:"\\"};var U={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?C:k};!function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_GLOBAL:o}=U;e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>i.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(o,"\\$1"),e.toPosixSlashes=e=>e.replace(t,"/"),e.isWindows=()=>{if("undefined"!=typeof navigator&&navigator.platform){const e=navigator.platform.toLowerCase();return"win32"===e||"windows"===e}return!("undefined"==typeof process||!process.platform)&&"win32"===process.platform},e.removeBackslashes=e=>e.replace(s,(e=>"\\"===e?"":e)),e.escapeLast=(t,s,i)=>{const o=t.lastIndexOf(s,i);return-1===o?t:"\\"===t[o-1]?e.escapeLast(t,s,o-1):`${t.slice(0,o)}\\${t.slice(o)}`},e.removePrefix=(e,t={})=>{let s=e;return s.startsWith("./")&&(s=s.slice(2),t.prefix="./"),s},e.wrapOutput=(e,t={},s={})=>{let i=`${s.contains?"":"^"}(?:${e})${s.contains?"":"$"}`;return!0===t.negated&&(i=`(?:^(?!${i}).*$)`),i},e.basename=(e,{windows:t}={})=>{const s=e.split(t?/[\\/]/:"/"),i=s[s.length-1];return""===i?s[s.length-2]:i}}(y);const T=y,{CHAR_ASTERISK:I,CHAR_AT:$,CHAR_BACKWARD_SLASH:H,CHAR_COMMA:L,CHAR_DOT:D,CHAR_EXCLAMATION_MARK:P,CHAR_FORWARD_SLASH:O,CHAR_LEFT_CURLY_BRACE:N,CHAR_LEFT_PARENTHESES:j,CHAR_LEFT_SQUARE_BRACKET:F,CHAR_PLUS:z,CHAR_QUESTION_MARK:q,CHAR_RIGHT_CURLY_BRACE:M,CHAR_RIGHT_PARENTHESES:B,CHAR_RIGHT_SQUARE_BRACKET:G}=U,K=e=>e===O||e===H,X=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};var Q=(e,t)=>{const s=t||{},i=e.length-1,o=!0===s.parts||!0===s.scanToEnd,n=[],r=[],a=[];let l,p,c=e,u=-1,d=0,h=0,f=!1,m=!1,g=!1,x=!1,y=!1,v=!1,_=!1,b=!1,E=!1,S=!1,R=0,w={value:"",depth:0,isGlob:!1};const A=()=>u>=i,k=()=>(l=p,c.charCodeAt(++u));for(;u0&&(U=c.slice(0,d),c=c.slice(d),h-=d),C&&!0===g&&h>0?(C=c.slice(0,h),Q=c.slice(h)):!0===g?(C="",Q=c):C=c,C&&""!==C&&"/"!==C&&C!==c&&K(C.charCodeAt(C.length-1))&&(C=C.slice(0,-1)),!0===s.unescape&&(Q&&(Q=T.removeBackslashes(Q)),C&&!0===_&&(C=T.removeBackslashes(C)));const W={prefix:U,input:e,start:d,base:C,glob:Q,isBrace:f,isBracket:m,isGlob:g,isExtglob:x,isGlobstar:y,negated:b,negatedExtglob:E};if(!0===s.tokens&&(W.maxDepth=0,K(p)||r.push(w),W.tokens=r),!0===s.parts||!0===s.tokens){let t;for(let i=0;i{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const s=`[${e.join("-")}]`;try{new RegExp(s)}catch(t){return e.map((e=>Z.escapeRegex(e))).join("..")}return s},ie=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,oe=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=te[e]||e;const s={...t},i="number"==typeof s.maxLength?Math.min(J,s.maxLength):J;let o=e.length;if(o>i)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${i}`);const n={type:"bos",value:"",output:s.prepend||""},r=[n],a=s.capture?"":"?:",l=W.globChars(s.windows),p=W.extglobChars(l),{DOT_LITERAL:c,PLUS_LITERAL:u,SLASH_LITERAL:d,ONE_CHAR:h,DOTS_SLASH:f,NO_DOT:m,NO_DOT_SLASH:g,NO_DOTS_SLASH:x,QMARK:y,QMARK_NO_DOT:v,STAR:_,START_ANCHOR:b}=l,E=e=>`(${a}(?:(?!${b}${e.dot?f:c}).)*?)`,S=s.dot?"":m,R=s.dot?y:v;let w=!0===s.bash?E(s):_;s.capture&&(w=`(${w})`),"boolean"==typeof s.noext&&(s.noextglob=s.noext);const A={input:e,index:-1,start:0,dot:!0===s.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:r};e=Z.removePrefix(e,A),o=e.length;const k=[],C=[],U=[];let T,I=n;const $=()=>A.index===o-1,H=A.peek=(t=1)=>e[A.index+t],L=A.advance=()=>e[++A.index]||"",D=()=>e.slice(A.index+1),P=(e="",t=0)=>{A.consumed+=e,A.index+=t},O=e=>{A.output+=null!=e.output?e.output:e.value,P(e.value)},N=()=>{let e=1;for(;"!"===H()&&("("!==H(2)||"?"===H(3));)L(),A.start++,e++;return e%2!=0&&(A.negated=!0,A.start++,!0)},j=e=>{A[e]++,U.push(e)},F=e=>{A[e]--,U.pop()},z=e=>{if("globstar"===I.type){const t=A.braces>0&&("comma"===e.type||"brace"===e.type),s=!0===e.extglob||k.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||s||(A.output=A.output.slice(0,-I.output.length),I.type="star",I.value="*",I.output=w,A.output+=I.output)}if(k.length&&"paren"!==e.type&&(k[k.length-1].inner+=e.value),(e.value||e.output)&&O(e),I&&"text"===I.type&&"text"===e.type)return I.output=(I.output||I.value)+e.value,void(I.value+=e.value);e.prev=I,r.push(e),I=e},q=(e,t)=>{const i={...p[t],conditions:1,inner:""};i.prev=I,i.parens=A.parens,i.output=A.output;const o=(s.capture?"(":"")+i.open;j("parens"),z({type:e,value:t,output:A.output?"":h}),z({type:"paren",extglob:!0,value:L(),output:o}),k.push(i)},M=e=>{let i,o=e.close+(s.capture?")":"");if("negate"===e.type){let n=w;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(n=E(s)),(n!==w||$()||/^\)+$/.test(D()))&&(o=e.close=`)$))${n}`),e.inner.includes("*")&&(i=D())&&/^\.[^\\/.]+$/.test(i)){const s=oe(i,{...t,fastpaths:!1}).output;o=e.close=`)${s})${n})`}"bos"===e.prev.type&&(A.negatedExtglob=!0)}z({type:"paren",extglob:!0,value:T,output:o}),F("parens")};if(!1!==s.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let i=!1,o=e.replace(ee,((e,t,s,o,n,r)=>"\\"===o?(i=!0,e):"?"===o?t?t+o+(n?y.repeat(n.length):""):0===r?R+(n?y.repeat(n.length):""):y.repeat(s.length):"."===o?c.repeat(s.length):"*"===o?t?t+o+(n?w:""):w:t?e:`\\${e}`));return!0===i&&(o=!0===s.unescape?o.replace(/\\/g,""):o.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),o===e&&!0===s.contains?(A.output=e,A):(A.output=Z.wrapOutput(o,A,t),A)}for(;!$();){if(T=L(),"\0"===T)continue;if("\\"===T){const e=H();if("/"===e&&!0!==s.bash)continue;if("."===e||";"===e)continue;if(!e){T+="\\",z({type:"text",value:T});continue}const t=/^\\+/.exec(D());let i=0;if(t&&t[0].length>2&&(i=t[0].length,A.index+=i,i%2!=0&&(T+="\\")),!0===s.unescape?T=L():T+=L(),0===A.brackets){z({type:"text",value:T});continue}}if(A.brackets>0&&("]"!==T||"["===I.value||"[^"===I.value)){if(!1!==s.posix&&":"===T){const e=I.value.slice(1);if(e.includes("[")&&(I.posix=!0,e.includes(":"))){const e=I.value.lastIndexOf("["),t=I.value.slice(0,e),s=I.value.slice(e+2),i=Y[s];if(i){I.value=t+i,A.backtrack=!0,L(),n.output||1!==r.indexOf(I)||(n.output=h);continue}}}("["===T&&":"!==H()||"-"===T&&"]"===H())&&(T=`\\${T}`),"]"!==T||"["!==I.value&&"[^"!==I.value||(T=`\\${T}`),!0===s.posix&&"!"===T&&"["===I.value&&(T="^"),I.value+=T,O({value:T});continue}if(1===A.quotes&&'"'!==T){T=Z.escapeRegex(T),I.value+=T,O({value:T});continue}if('"'===T){A.quotes=1===A.quotes?0:1,!0===s.keepQuotes&&z({type:"text",value:T});continue}if("("===T){j("parens"),z({type:"paren",value:T});continue}if(")"===T){if(0===A.parens&&!0===s.strictBrackets)throw new SyntaxError(ie("opening","("));const e=k[k.length-1];if(e&&A.parens===e.parens+1){M(k.pop());continue}z({type:"paren",value:T,output:A.parens?")":"\\)"}),F("parens");continue}if("["===T){if(!0!==s.nobracket&&D().includes("]"))j("brackets");else{if(!0!==s.nobracket&&!0===s.strictBrackets)throw new SyntaxError(ie("closing","]"));T=`\\${T}`}z({type:"bracket",value:T});continue}if("]"===T){if(!0===s.nobracket||I&&"bracket"===I.type&&1===I.value.length){z({type:"text",value:T,output:`\\${T}`});continue}if(0===A.brackets){if(!0===s.strictBrackets)throw new SyntaxError(ie("opening","["));z({type:"text",value:T,output:`\\${T}`});continue}F("brackets");const e=I.value.slice(1);if(!0===I.posix||"^"!==e[0]||e.includes("/")||(T=`/${T}`),I.value+=T,O({value:T}),!1===s.literalBrackets||Z.hasRegexChars(e))continue;const t=Z.escapeRegex(I.value);if(A.output=A.output.slice(0,-I.value.length),!0===s.literalBrackets){A.output+=t,I.value=t;continue}I.value=`(${a}${t}|${I.value})`,A.output+=I.value;continue}if("{"===T&&!0!==s.nobrace){j("braces");const e={type:"brace",value:T,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};C.push(e),z(e);continue}if("}"===T){const e=C[C.length-1];if(!0===s.nobrace||!e){z({type:"text",value:T,output:T});continue}let t=")";if(!0===e.dots){const e=r.slice(),i=[];for(let t=e.length-1;t>=0&&(r.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&i.unshift(e[t].value);t=se(i,s),A.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const s=A.output.slice(0,e.outputIndex),i=A.tokens.slice(e.tokensIndex);e.value=e.output="\\{",T=t="\\}",A.output=s;for(const e of i)A.output+=e.output||e.value}z({type:"brace",value:T,output:t}),F("braces"),C.pop();continue}if("|"===T){k.length>0&&k[k.length-1].conditions++,z({type:"text",value:T});continue}if(","===T){let e=T;const t=C[C.length-1];t&&"braces"===U[U.length-1]&&(t.comma=!0,e="|"),z({type:"comma",value:T,output:e});continue}if("/"===T){if("dot"===I.type&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",r.pop(),I=n;continue}z({type:"slash",value:T,output:d});continue}if("."===T){if(A.braces>0&&"dot"===I.type){"."===I.value&&(I.output=c);const e=C[C.length-1];I.type="dots",I.output+=T,I.value+=T,e.dots=!0;continue}if(A.braces+A.parens===0&&"bos"!==I.type&&"slash"!==I.type){z({type:"text",value:T,output:c});continue}z({type:"dot",value:T,output:c});continue}if("?"===T){if(!(I&&"("===I.value)&&!0!==s.noextglob&&"("===H()&&"?"!==H(2)){q("qmark",T);continue}if(I&&"paren"===I.type){const e=H();let t=T;("("===I.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(D()))&&(t=`\\${T}`),z({type:"text",value:T,output:t});continue}if(!0!==s.dot&&("slash"===I.type||"bos"===I.type)){z({type:"qmark",value:T,output:v});continue}z({type:"qmark",value:T,output:y});continue}if("!"===T){if(!0!==s.noextglob&&"("===H()&&("?"!==H(2)||!/[!=<:]/.test(H(3)))){q("negate",T);continue}if(!0!==s.nonegate&&0===A.index){N();continue}}if("+"===T){if(!0!==s.noextglob&&"("===H()&&"?"!==H(2)){q("plus",T);continue}if(I&&"("===I.value||!1===s.regex){z({type:"plus",value:T,output:u});continue}if(I&&("bracket"===I.type||"paren"===I.type||"brace"===I.type)||A.parens>0){z({type:"plus",value:T});continue}z({type:"plus",value:u});continue}if("@"===T){if(!0!==s.noextglob&&"("===H()&&"?"!==H(2)){z({type:"at",extglob:!0,value:T,output:""});continue}z({type:"text",value:T});continue}if("*"!==T){"$"!==T&&"^"!==T||(T=`\\${T}`);const e=V.exec(D());e&&(T+=e[0],A.index+=e[0].length),z({type:"text",value:T});continue}if(I&&("globstar"===I.type||!0===I.star)){I.type="star",I.star=!0,I.value+=T,I.output=w,A.backtrack=!0,A.globstar=!0,P(T);continue}let t=D();if(!0!==s.noextglob&&/^\([^?]/.test(t)){q("star",T);continue}if("star"===I.type){if(!0===s.noglobstar){P(T);continue}const i=I.prev,o=i.prev,n="slash"===i.type||"bos"===i.type,r=o&&("star"===o.type||"globstar"===o.type);if(!0===s.bash&&(!n||t[0]&&"/"!==t[0])){z({type:"star",value:T,output:""});continue}const a=A.braces>0&&("comma"===i.type||"brace"===i.type),l=k.length&&("pipe"===i.type||"paren"===i.type);if(!n&&"paren"!==i.type&&!a&&!l){z({type:"star",value:T,output:""});continue}for(;"/**"===t.slice(0,3);){const s=e[A.index+4];if(s&&"/"!==s)break;t=t.slice(3),P("/**",3)}if("bos"===i.type&&$()){I.type="globstar",I.value+=T,I.output=E(s),A.output=I.output,A.globstar=!0,P(T);continue}if("slash"===i.type&&"bos"!==i.prev.type&&!r&&$()){A.output=A.output.slice(0,-(i.output+I.output).length),i.output=`(?:${i.output}`,I.type="globstar",I.output=E(s)+(s.strictSlashes?")":"|$)"),I.value+=T,A.globstar=!0,A.output+=i.output+I.output,P(T);continue}if("slash"===i.type&&"bos"!==i.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";A.output=A.output.slice(0,-(i.output+I.output).length),i.output=`(?:${i.output}`,I.type="globstar",I.output=`${E(s)}${d}|${d}${e})`,I.value+=T,A.output+=i.output+I.output,A.globstar=!0,P(T+L()),z({type:"slash",value:"/",output:""});continue}if("bos"===i.type&&"/"===t[0]){I.type="globstar",I.value+=T,I.output=`(?:^|${d}|${E(s)}${d})`,A.output=I.output,A.globstar=!0,P(T+L()),z({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-I.output.length),I.type="globstar",I.output=E(s),I.value+=T,A.output+=I.output,A.globstar=!0,P(T);continue}const i={type:"star",value:T,output:w};!0!==s.bash?!I||"bracket"!==I.type&&"paren"!==I.type||!0!==s.regex?(A.index!==A.start&&"slash"!==I.type&&"dot"!==I.type||("dot"===I.type?(A.output+=g,I.output+=g):!0===s.dot?(A.output+=x,I.output+=x):(A.output+=S,I.output+=S),"*"!==H()&&(A.output+=h,I.output+=h)),z(i)):(i.output=T,z(i)):(i.output=".*?","bos"!==I.type&&"slash"!==I.type||(i.output=S+i.output),z(i))}for(;A.brackets>0;){if(!0===s.strictBrackets)throw new SyntaxError(ie("closing","]"));A.output=Z.escapeLast(A.output,"["),F("brackets")}for(;A.parens>0;){if(!0===s.strictBrackets)throw new SyntaxError(ie("closing",")"));A.output=Z.escapeLast(A.output,"("),F("parens")}for(;A.braces>0;){if(!0===s.strictBrackets)throw new SyntaxError(ie("closing","}"));A.output=Z.escapeLast(A.output,"{"),F("braces")}if(!0===s.strictSlashes||"star"!==I.type&&"bracket"!==I.type||z({type:"maybe_slash",value:"",output:`${d}?`}),!0===A.backtrack){A.output="";for(const e of A.tokens)A.output+=null!=e.output?e.output:e.value,e.suffix&&(A.output+=e.suffix)}return A};oe.fastpaths=(e,t)=>{const s={...t},i="number"==typeof s.maxLength?Math.min(J,s.maxLength):J,o=e.length;if(o>i)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${i}`);e=te[e]||e;const{DOT_LITERAL:n,SLASH_LITERAL:r,ONE_CHAR:a,DOTS_SLASH:l,NO_DOT:p,NO_DOTS:c,NO_DOTS_SLASH:u,STAR:d,START_ANCHOR:h}=W.globChars(s.windows),f=s.dot?c:p,m=s.dot?u:p,g=s.capture?"":"?:";let x=!0===s.bash?".*?":d;s.capture&&(x=`(${x})`);const y=e=>!0===e.noglobstar?x:`(${g}(?:(?!${h}${e.dot?l:n}).)*?)`,v=e=>{switch(e){case"*":return`${f}${a}${x}`;case".*":return`${n}${a}${x}`;case"*.*":return`${f}${x}${n}${a}${x}`;case"*/*":return`${f}${x}${r}${a}${m}${x}`;case"**":return f+y(s);case"**/*":return`(?:${f}${y(s)}${r})?${m}${a}${x}`;case"**/*.*":return`(?:${f}${y(s)}${r})?${m}${x}${n}${a}${x}`;case"**/.*":return`(?:${f}${y(s)}${r})?${n}${a}${x}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const s=v(t[1]);if(!s)return;return s+n+t[2]}}},_=Z.removePrefix(e,{negated:!1,prefix:""});let b=v(_);return b&&!0!==s.strictSlashes&&(b+=`${r}?`),b};const ne=Q,re=oe,ae=y,le=U,pe=(e,t,s=!1)=>{if(Array.isArray(e)){const i=e.map((e=>pe(e,t,s))),o=e=>{for(const t of i){const s=t(e);if(s)return s}return!1};return o}const i=(o=e)&&"object"==typeof o&&!Array.isArray(o)&&e.tokens&&e.input;var o;if(""===e||"string"!=typeof e&&!i)throw new TypeError("Expected pattern to be a non-empty string");const n=t||{},r=n.windows,a=i?pe.compileRe(e,t):pe.makeRe(e,t,!1,!0),l=a.state;delete a.state;let p=()=>!1;if(n.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};p=pe(n.ignore,e,s)}const c=(s,i=!1)=>{const{isMatch:o,match:c,output:u}=pe.test(s,a,t,{glob:e,posix:r}),d={glob:e,state:l,regex:a,posix:r,input:s,output:u,match:c,isMatch:o};return"function"==typeof n.onResult&&n.onResult(d),!1===o?(d.isMatch=!1,!!i&&d):p(s)?("function"==typeof n.onIgnore&&n.onIgnore(d),d.isMatch=!1,!!i&&d):("function"==typeof n.onMatch&&n.onMatch(d),!i||d)};return s&&(c.state=l),c};pe.test=(e,t,s,{glob:i,posix:o}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const n=s||{},r=n.format||(o?ae.toPosixSlashes:null);let a=e===i,l=a&&r?r(e):e;return!1===a&&(l=r?r(e):e,a=l===i),!1!==a&&!0!==n.capture||(a=!0===n.matchBase||!0===n.basename?pe.matchBase(e,t,s,o):t.exec(l)),{isMatch:Boolean(a),match:a,output:l}},pe.matchBase=(e,t,s)=>(t instanceof RegExp?t:pe.makeRe(t,s)).test(ae.basename(e)),pe.isMatch=(e,t,s)=>pe(t,s)(e),pe.parse=(e,t)=>Array.isArray(e)?e.map((e=>pe.parse(e,t))):re(e,{...t,fastpaths:!1}),pe.scan=(e,t)=>ne(e,t),pe.compileRe=(e,t,s=!1,i=!1)=>{if(!0===s)return e.output;const o=t||{},n=o.contains?"":"^",r=o.contains?"":"$";let a=`${n}(?:${e.output})${r}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const l=pe.toRegex(a,t);return!0===i&&(l.state=e),l},pe.makeRe=(e,t={},s=!1,i=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(o.output=re.fastpaths(e,t)),o.output||(o=re(e,t)),pe.compileRe(o,t,s,i)},pe.toRegex=(e,t)=>{try{const s=t||{};return new RegExp(e,s.flags||(s.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},pe.constants=le;var ce=a(pe);class ue{constructor(e){const[t,s]=(e=>{const t=[],s=[];return e.split(",").map((e=>e.trim())).filter(Boolean).forEach((e=>{e.startsWith(".")?t.push(`*${e}`):s.push(e)})),[t,s]})(e);this.extensions=t,this.mimeTypes=s}isAccepted(e){return 0===this.extensions.length&&0===this.mimeTypes.length||(this.isMimeTypeAccepted(x.getType(e))||this.isExtensionAccepted(e))}isMimeTypeAccepted(e){return!(!e||0===this.mimeTypes.length)&&ce.isMatch(e,this.mimeTypes)}isExtensionAccepted(e){return 0!==this.extensions.length&&ce.isMatch(e,this.extensions)}}const de=async e=>new Promise(((t,s)=>{e.createReader().readEntries(t,s)})),he=async e=>new Promise(((t,s)=>{e.file(t,s)})),fe=async e=>{const t=[];for(const s of e)if(s.isFile){const e=await he(s);t.push(e)}else if(s.isDirectory){const e=await de(s);(await fe(e)).forEach((e=>t.push(e)))}return t};class me{constructor(e){let{container:t,inputAccept:s,onUploadFiles:i,renderer:o}=e;this.container=t,this.onUploadFiles=i,this.acceptedFileTypes=new ue(s),this.renderer=o,t.addEventListener("dragenter",(()=>{t.classList.add("dff-dropping")})),t.addEventListener("dragleave",(()=>{t.classList.remove("dff-dropping")})),t.addEventListener("dragover",(e=>{t.classList.add("dff-dropping"),e.preventDefault()})),t.addEventListener("drop",this.onDrop)}onDrop=e=>{const t=e;this.container.classList.remove("dff-dropping"),t.preventDefault(),t.stopPropagation();(async()=>{try{if(t.dataTransfer){const e=await(async e=>{if(e.items){const t=[...e.items].map((e=>e.webkitGetAsEntry())).filter((e=>null!=e));return await fe(t)}return[...e.files]})(t.dataTransfer),s=[],i=[];for(const t of e)this.acceptedFileTypes.isAccepted(t.name)?s.push(t):i.push(t);this.renderer.setErrorInvalidFiles(i),this.onUploadFiles(s)}}catch(e){console.error(e)}})()}}let ge=class{constructor(e){let{name:t,status:s,type:i,uploadIndex:o}=e;this.name=t,this.status=s,this.type=i,this.uploadIndex=o}async abort(){}async delete(){}};function xe(){return function(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var s=e.shift();e[0]=s+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var i=0;i0&&(o=o.replace(/^[\/]+/,"")),o=i0?"?":"")+r.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}const ye=(e,t)=>{const s=e.indexOf(t);-1!==s&&e.splice(s,1)};class ve extends ge{constructor(e){let{csrfToken:t,endpoint:s,file:i,s3UploadDir:o,uploadIndex:n}=e;super({name:i.name,status:"uploading",type:"s3",uploadIndex:n}),this.csrfToken=t,this.endpoint=s,this.file=i,this.s3UploadDir=o,this.key=null,this.uploadId=null,this.parts=[],this.createdPromise=Promise.reject(new Error),this.chunks=[],this.chunkState=[],this.uploading=[],this.onError=void 0,this.onProgress=void 0,this.onSuccess=void 0,this.initChunks(),this.createdPromise.catch((()=>({})))}async abort(){this.uploading.slice().forEach((e=>{e.abort()})),this.uploading=[],await this.createdPromise,this.key&&this.uploadId&&await(e=>{let{csrfToken:t,key:s,uploadId:i,endpoint:o}=e;const n=encodeURIComponent(s),r=encodeURIComponent(i),a=new Headers({"X-CSRFToken":t}),l=xe(o,r,`?key=${n}`);return fetch(l,{method:"delete",headers:a}).then((e=>e.json()))})({csrfToken:this.csrfToken,endpoint:this.endpoint,key:this.key,uploadId:this.uploadId})}async delete(){return Promise.resolve()}getId(){return this.uploadId??void 0}getInitialFile(){return{id:this.uploadId??"",name:this.key??"",size:this.file.size,original_name:this.file.name,type:"s3"}}getSize(){return this.file.size}start(){this.createUpload()}initChunks(){const e=[],t=(s=this.file,Math.ceil(s.size/1e4));var s;const i=Math.max(5242880,Math.ceil(this.file.size/1e4)),o=Math.max(t,i);for(let t=0;t({uploaded:0,busy:!1,done:!1})))}createUpload(){return this.createdPromise=(e=>{let{csrfToken:t,endpoint:s,file:i,s3UploadDir:o}=e;const n=new Headers({accept:"application/json","content-type":"application/json","X-CSRFToken":t});return fetch(s,{method:"post",headers:n,body:JSON.stringify({filename:i.name,contentType:i.type,s3UploadDir:o})}).then((e=>e.json())).then((e=>e))})({csrfToken:this.csrfToken,endpoint:this.endpoint,file:this.file,s3UploadDir:this.s3UploadDir}),this.createdPromise.then((e=>{if(!("object"==typeof e&&e&&"string"==typeof e.uploadId&&"string"==typeof e.key))throw new TypeError("AwsS3/Multipart: Got incorrect result from `createMultipartUpload()`, expected an object `{ uploadId, key }`.");this.key=e.key,this.uploadId=e.uploadId,this.uploadParts()})).catch((e=>{this.handleError(e)}))}uploadParts(){const e=1-this.uploading.length;if(0===e)return;if(this.chunkState.every((e=>e.done)))return void this.completeUpload();const t=[];for(let s=0;s=e))break}t.forEach((e=>{this.uploadPart(e)}))}uploadPart(e){const t=this.chunkState[e];return t&&(t.busy=!0),this.key&&this.uploadId?(e=>{let{csrfToken:t,endpoint:s,key:i,number:o,uploadId:n}=e;const r=encodeURIComponent(i),a=new Headers({"X-CSRFToken":t}),l=xe(s,n,o.toString(),`?key=${r}`);return fetch(l,{method:"get",headers:a}).then((e=>e.json())).then((e=>e))})({csrfToken:this.csrfToken,endpoint:this.endpoint,key:this.key,number:e+1,uploadId:this.uploadId}).then((e=>{if(!("object"==typeof e&&"string"==typeof e.url))throw new TypeError("AwsS3/Multipart: Got incorrect result from `prepareUploadPart()`, expected an object `{ url }`.");return e})).then((t=>{let{url:s}=t;this.uploadPartBytes(e,s)}),(e=>{this.handleError(e)})):Promise.resolve()}onPartProgress(e,t){const s=this.chunkState[e];if(s&&(s.uploaded=t),this.onProgress){const e=this.chunkState.reduce(((e,t)=>e+t.uploaded),0);this.onProgress(e,this.file.size)}}onPartComplete(e,t){const s=this.chunkState[e];s&&(s.etag=t,s.done=!0);const i={PartNumber:e+1,ETag:t};this.parts.push(i),this.uploadParts()}uploadPartBytes(e,t){const s=this.chunks[e],i=new XMLHttpRequest;i.open("PUT",t,!0),i.responseType="text",this.uploading.push(i),i.upload.addEventListener("progress",(t=>{t.lengthComputable&&this.onPartProgress(e,t.loaded)})),i.addEventListener("abort",(t=>{ye(this.uploading,t.target);const s=this.chunkState[e];s&&(s.busy=!1)})),i.addEventListener("load",(t=>{const i=t.target;ye(this.uploading,i);const o=this.chunkState[e];if(o&&(o.busy=!1),i.status<200||i.status>=300)return void this.handleError(new Error("Non 2xx"));this.onPartProgress(e,s?.size??0);const n=i.getResponseHeader("ETag");null!==n?this.onPartComplete(e,n):this.handleError(new Error("AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions."))})),i.addEventListener("error",(t=>{ye(this.uploading,t.target);const s=this.chunkState[e];s&&(s.busy=!1);const i=new Error("Unknown error");this.handleError(i)})),i.send(s)}completeUpload(){return this.parts.sort(((e,t)=>e.PartNumber-t.PartNumber)),this.uploadId&&this.key?(e=>{let{csrfToken:t,key:s,uploadId:i,parts:o,endpoint:n}=e;const r=encodeURIComponent(s),a=encodeURIComponent(i),l=new Headers({"X-CSRFToken":t}),p=xe(n,a,"complete",`?key=${r}`);return fetch(p,{method:"post",headers:l,body:JSON.stringify({parts:o})}).then((e=>e.json())).then((e=>e))})({csrfToken:this.csrfToken,endpoint:this.endpoint,key:this.key,uploadId:this.uploadId,parts:this.parts}).then((()=>{this.onSuccess&&this.onSuccess()}),(e=>{this.handleError(e)})):Promise.resolve()}handleError(e){if(!this.onError)throw e;this.onError(e)}}const _e=async(e,t)=>new Promise(((s,i)=>{const o=new XMLHttpRequest;o.open("DELETE",e),o.onload=()=>{204===o.status?s():i(new Error)},o.setRequestHeader("Tus-Resumable","1.0.0"),o.setRequestHeader("X-CSRFToken",t),o.send(null)}));class be extends ge{constructor(e){let{name:t,size:s,type:i,uploadIndex:o}=e;super({name:t,status:"done",type:i,uploadIndex:o}),this.size=s}async abort(){return Promise.resolve()}async delete(){return Promise.resolve()}getSize(){return this.size}}class Ee extends be{constructor(e,t){super({name:e.name,size:e.size,type:"placeholder",uploadIndex:t}),this.id=e.id}getId(){}getInitialFile(){return{id:this.id,name:this.name,size:this.size,type:"placeholder"}}}class Se extends be{constructor(e,t){super({name:e.original_name||e.name,size:e.size,type:"uploadedS3",uploadIndex:t}),this.id=e.id,this.key=e.name}getId(){return this.id}getInitialFile(){return{id:this.id,name:this.key,original_name:this.name,size:this.size,type:"s3"}}}class Re extends be{constructor(e,t){super({name:e.name,size:e.size,type:"existing",uploadIndex:t})}getId(){}getInitialFile(){return{name:this.name,size:this.size,type:"existing"}}}class we extends be{constructor(e){let{csrfToken:t,initialFile:s,uploadIndex:i,uploadUrl:o}=e;super({name:s.name,size:s.size,type:"uploadedTus",uploadIndex:i}),this.csrfToken=t,this.id=s.id,this.url=`${o}${s.id}`}async delete(){await _e(this.url,this.csrfToken)}getId(){return this.id}getInitialFile(){return{id:this.id,name:this.name,size:this.size,type:"tus",url:""}}}class Ae extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(super(e),this.originalRequest=s,this.originalResponse=i,this.causingError=t,null!=t&&(e+=`, caused by ${t.toString()}`),null!=s){const t=s.getHeader("X-Request-ID")||"n/a";e+=`, originated from request (method: ${s.getMethod()}, url: ${s.getURL()}, response code: ${i?i.getStatus():"n/a"}, response text: ${i?i.getBody()||"":"n/a"}, request id: ${t})`}this.message=e}}const ke="function"==typeof Buffer,Ce=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),Ue=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Te=(e=>{let t={};return e.forEach(((e,s)=>t[e]=s)),t})(Ue),Ie=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,$e=String.fromCharCode.bind(String),He=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),Le=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),De=e=>{let t,s,i,o,n="";const r=e.length%3;for(let r=0;r255||(i=e.charCodeAt(r++))>255||(o=e.charCodeAt(r++))>255)throw new TypeError("invalid character found");t=s<<16|i<<8|o,n+=Ue[t>>18&63]+Ue[t>>12&63]+Ue[t>>6&63]+Ue[63&t]}return r?n.slice(0,r-3)+"===".substring(r):n},Pe="function"==typeof btoa?e=>btoa(e):ke?e=>Buffer.from(e,"binary").toString("base64"):De,Oe=ke?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let s=0,i=e.length;s{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?$e(192|t>>>6)+$e(128|63&t):$e(224|t>>>12&15)+$e(128|t>>>6&63)+$e(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return $e(240|t>>>18&7)+$e(128|t>>>12&63)+$e(128|t>>>6&63)+$e(128|63&t)},je=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Fe=e=>e.replace(je,Ne),ze=ke?e=>Buffer.from(e,"utf8").toString("base64"):Ce?e=>Oe(Ce.encode(e)):e=>Pe(Fe(e)),qe=(e,t=!1)=>t?He(ze(e)):ze(e),Me=e=>{if(e=e.replace(/\s+/g,""),!Ie.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,s,i,o="";for(let n=0;n>16&255):64===i?$e(t>>16&255,t>>8&255):$e(t>>16&255,t>>8&255,255&t);return o},Be=qe;var Ge={},Ke=Object.prototype.hasOwnProperty;function Xe(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function Qe(e){try{return encodeURIComponent(e)}catch(e){return null}}Ge.stringify=function(e,t){t=t||"";var s,i,o=[];for(i in"string"!=typeof t&&(t="?"),e)if(Ke.call(e,i)){if((s=e[i])||null!=s&&!isNaN(s)||(s=""),i=Qe(i),s=Qe(s),null===i||null===s)continue;o.push(i+"="+s)}return o.length?t+o.join("&"):""},Ge.parse=function(e){for(var t,s=/([^=?#&]+)=?([^&]*)/g,i={};t=s.exec(e);){var o=Xe(t[1]),n=Xe(t[2]);null===o||null===n||o in i||(i[o]=n)}return i};var We=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e},Ze=Ge,Je=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Ye=/[\n\r\t]/g,Ve=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,et=/:\d+$/,tt=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,st=/^[a-zA-Z]:/;function it(e){return(e||"").toString().replace(Je,"")}var ot=[["#","hash"],["?","query"],function(e,t){return at(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],nt={hash:1,query:1};function rt(e){var t,s=("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:{}).location||{},i={},o=typeof(e=e||s);if("blob:"===e.protocol)i=new pt(unescape(e.pathname),{});else if("string"===o)for(t in i=new pt(e,{}),nt)delete i[t];else if("object"===o){for(t in e)t in nt||(i[t]=e[t]);void 0===i.slashes&&(i.slashes=Ve.test(e.href))}return i}function at(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function lt(e,t){e=(e=it(e)).replace(Ye,""),t=t||{};var s,i=tt.exec(e),o=i[1]?i[1].toLowerCase():"",n=!!i[2],r=!!i[3],a=0;return n?r?(s=i[2]+i[3]+i[4],a=i[2].length+i[3].length):(s=i[2]+i[4],a=i[2].length):r?(s=i[3]+i[4],a=i[3].length):s=i[4],"file:"===o?a>=2&&(s=s.slice(2)):at(o)?s=i[4]:o?n&&(s=s.slice(2)):a>=2&&at(t.protocol)&&(s=i[4]),{protocol:o,slashes:n||at(o),slashesCount:a,rest:s}}function pt(e,t,s){if(e=(e=it(e)).replace(Ye,""),!(this instanceof pt))return new pt(e,t,s);var i,o,n,r,a,l,p=ot.slice(),c=typeof t,u=this,d=0;for("object"!==c&&"string"!==c&&(s=t,t=null),s&&"function"!=typeof s&&(s=Ze.parse),i=!(o=lt(e||"",t=rt(t))).protocol&&!o.slashes,u.slashes=o.slashes||i&&t.slashes,u.protocol=o.protocol||t.protocol||"",e=o.rest,("file:"===o.protocol&&(2!==o.slashesCount||st.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!at(u.protocol)))&&(p[3]=[/(.*)/,"pathname"]);d1&&void 0!==arguments[1]?arguments[1]:{};const s=xt("DELETE",e,t);return yt(s,null,t).then((e=>{if(204!==e.getStatus())throw new Ae("tus: unexpected response while terminating upload",null,s,e)})).catch((i=>{if(i instanceof Ae||(i=new Ae("tus: failed to terminate upload",i,s,null)),!vt(i,0,t))throw i;const o=t.retryDelays[0],n=t.retryDelays.slice(1),r={...t,retryDelays:n};return new Promise((e=>setTimeout(e,o))).then((()=>ft.terminate(e,r)))}))}findPreviousUploads(){return this.options.fingerprint(this.file,this.options).then((e=>this._urlStorage.findUploadsByFingerprint(e)))}resumeFromPreviousUpload(e){this.url=e.uploadUrl||null,this._parallelUploadUrls=e.parallelUploadUrls||null,this._urlStorageKey=e.urlStorageKey}start(){const{file:e}=this;if(!e)return void this._emitError(new Error("tus: no file or stream to upload provided"));if(![ut,dt].includes(this.options.protocol))return void this._emitError(new Error(`tus: unsupported protocol ${this.options.protocol}`));if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url)return void this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));const{retryDelays:t}=this.options;if(null==t||"[object Array]"===Object.prototype.toString.call(t)){if(this.options.parallelUploads>1)for(const e of["uploadUrl","uploadSize","uploadLengthDeferred"])if(this.options[e])return void this._emitError(new Error(`tus: cannot use the ${e} option when parallelUploads is enabled`));if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1)return void this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length)return void this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"))}this.options.fingerprint(e,this.options).then((t=>(this._fingerprint=t,this._source?this._source:this.options.fileReader.openFile(e,this.options.chunkSize)))).then((e=>{if(this._source=e,this.options.uploadLengthDeferred)this._size=null;else if(null!=this.options.uploadSize){if(this._size=Number(this.options.uploadSize),Number.isNaN(this._size))return void this._emitError(new Error("tus: cannot convert `uploadSize` option into a number"))}else if(this._size=this._source.size,null==this._size)return void this._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));this.options.parallelUploads>1||null!=this._parallelUploadUrls?this._startParallelUpload():this._startSingleUpload()})).catch((e=>{this._emitError(e)}))}else this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"))}_startParallelUpload(){const e=this._size;let t=0;this._parallelUploads=[];const s=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,i=this.options.parallelUploadBoundaries??function(e,t){const s=Math.floor(e/t),i=[];for(let e=0;e{e.uploadUrl=this._parallelUploadUrls[t]||null})),this._parallelUploadUrls=new Array(i.length);const o=i.map(((s,o)=>{let n=0;return this._source.slice(s.start,s.end).then((r=>{let{value:a}=r;return new Promise(((r,l)=>{const p={...this.options,uploadUrl:s.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:this.options.metadataForPartialUploads,headers:{...this.options.headers,"Upload-Concat":"partial"},onSuccess:r,onError:l,onProgress:s=>{t=t-n+s,n=s,this._emitProgress(t,e)},onUploadUrlAvailable:()=>{this._parallelUploadUrls[o]=c.url,this._parallelUploadUrls.filter((e=>Boolean(e))).length===i.length&&this._saveUploadInUrlStorage()}},c=new ft(a,p);c.start(),this._parallelUploads.push(c)}))}))}));let n;Promise.all(o).then((()=>{n=this._openRequest("POST",this.options.endpoint),n.setHeader("Upload-Concat",`final;${this._parallelUploadUrls.join(" ")}`);const e=mt(this.options.metadata);return""!==e&&n.setHeader("Upload-Metadata",e),this._sendRequest(n,null)})).then((e=>{if(!gt(e.getStatus(),200))return void this._emitHttpError(n,e,"tus: unexpected response while creating upload");const t=e.getHeader("Location");null!=t?(this.url=bt(this.options.endpoint,t),this.url,this._emitSuccess(e)):this._emitHttpError(n,e,"tus: invalid or missing Location header")})).catch((e=>{this._emitError(e)}))}_startSingleUpload(){return this._aborted=!1,null!=this.url?(this.url,void this._resumeUpload()):null!=this.options.uploadUrl?(this.options.uploadUrl,this.url=this.options.uploadUrl,void this._resumeUpload()):void this._createUpload()}abort(e){if(null!=this._parallelUploads)for(const t of this._parallelUploads)t.abort(e);return null!==this._req&&this._req.abort(),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),e&&null!=this.url?ft.terminate(this.url,this.options).then((()=>this._removeFromUrlStorage())):Promise.resolve()}_emitHttpError(e,t,s,i){this._emitError(new Ae(s,i,e,t))}_emitError(e){if(!this._aborted){if(null!=this.options.retryDelays){if(null!=this._offset&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),vt(e,this._retryAttempt,this.options)){const e=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout((()=>{this.start()}),e))}}if("function"!=typeof this.options.onError)throw e;this.options.onError(e)}}_emitSuccess(e){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"function"==typeof this.options.onSuccess&&this.options.onSuccess({lastResponse:e})}_emitProgress(e,t){"function"==typeof this.options.onProgress&&this.options.onProgress(e,t)}_emitChunkComplete(e,t,s){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(e,t,s)}_createUpload(){if(!this.options.endpoint)return void this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));const e=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?e.setHeader("Upload-Defer-Length","1"):e.setHeader("Upload-Length",`${this._size}`);const t=mt(this.options.metadata);let s;""!==t&&e.setHeader("Upload-Metadata",t),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,s=this._addChunkToRequest(e)):(this.options.protocol===dt&&e.setHeader("Upload-Complete","?0"),s=this._sendRequest(e,null)),s.then((t=>{if(!gt(t.getStatus(),200))return void this._emitHttpError(e,t,"tus: unexpected response while creating upload");const s=t.getHeader("Location");if(null!=s){if(this.url=bt(this.options.endpoint,s),this.url,"function"==typeof this.options.onUploadUrlAvailable&&this.options.onUploadUrlAvailable(),0===this._size)return this._emitSuccess(t),void this._source.close();this._saveUploadInUrlStorage().then((()=>{this.options.uploadDataDuringCreation?this._handleUploadResponse(e,t):(this._offset=0,this._performUpload())}))}else this._emitHttpError(e,t,"tus: invalid or missing Location header")})).catch((t=>{this._emitHttpError(e,null,"tus: failed to create upload",t)}))}_resumeUpload(){const e=this._openRequest("HEAD",this.url);this._sendRequest(e,null).then((t=>{const s=t.getStatus();if(!gt(s,200))return 423===s?void this._emitHttpError(e,t,"tus: upload is currently locked; retry later"):(gt(s,400)&&this._removeFromUrlStorage(),this.options.endpoint?(this.url=null,void this._createUpload()):void this._emitHttpError(e,t,"tus: unable to resume upload (new upload cannot be created without an endpoint)"));const i=Number.parseInt(t.getHeader("Upload-Offset"),10);if(Number.isNaN(i))return void this._emitHttpError(e,t,"tus: invalid or missing offset value");const o=Number.parseInt(t.getHeader("Upload-Length"),10);!Number.isNaN(o)||this.options.uploadLengthDeferred||this.options.protocol!==ut?("function"==typeof this.options.onUploadUrlAvailable&&this.options.onUploadUrlAvailable(),this._saveUploadInUrlStorage().then((()=>{if(i===o)return this._emitProgress(o,o),void this._emitSuccess(t);this._offset=i,this._performUpload()}))):this._emitHttpError(e,t,"tus: invalid or missing length value")})).catch((t=>{this._emitHttpError(e,null,"tus: failed to resume upload",t)}))}_performUpload(){if(this._aborted)return;let e;this.options.overridePatchMethod?(e=this._openRequest("POST",this.url),e.setHeader("X-HTTP-Method-Override","PATCH")):e=this._openRequest("PATCH",this.url),e.setHeader("Upload-Offset",`${this._offset}`);this._addChunkToRequest(e).then((t=>{gt(t.getStatus(),200)?this._handleUploadResponse(e,t):this._emitHttpError(e,t,"tus: unexpected response while uploading chunk")})).catch((t=>{this._aborted||this._emitHttpError(e,null,`tus: failed to upload chunk at offset ${this._offset}`,t)}))}_addChunkToRequest(e){const t=this._offset;let s=this._offset+this.options.chunkSize;return e.setProgressHandler((e=>{this._emitProgress(t+e,this._size)})),e.setHeader("Content-Type","application/offset+octet-stream"),(s===Number.POSITIVE_INFINITY||s>this._size)&&!this.options.uploadLengthDeferred&&(s=this._size),this._source.slice(t,s).then((t=>{let{value:s,done:i}=t;const o=s?.size?s.size:0;this.options.uploadLengthDeferred&&i&&(this._size=this._offset+o,e.setHeader("Upload-Length",`${this._size}`));const n=this._offset+o;return!this.options.uploadLengthDeferred&&i&&n!==this._size?Promise.reject(new Error(`upload was configured with a size of ${this._size} bytes, but the source is done after ${n} bytes`)):null===s?this._sendRequest(e):(this.options.protocol===dt&&e.setHeader("Upload-Complete",i?"?1":"?0"),this._emitProgress(this._offset,this._size),this._sendRequest(e,s))}))}_handleUploadResponse(e,t){const s=Number.parseInt(t.getHeader("Upload-Offset"),10);if(Number.isNaN(s))this._emitHttpError(e,t,"tus: invalid or missing offset value");else{if(this._emitProgress(s,this._size),this._emitChunkComplete(s-this._offset,s,this._size),this._offset=s,s===this._size)return this._emitSuccess(t),void this._source.close();this._performUpload()}}_openRequest(e,t){const s=xt(e,t,this.options);return this._req=s,s}_removeFromUrlStorage(){this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch((e=>{this._emitError(e)})),this._urlStorageKey=null)}_saveUploadInUrlStorage(){if(!this.options.storeFingerprintForResuming||!this._fingerprint||null!==this._urlStorageKey)return Promise.resolve();const e={size:this._size,metadata:this.options.metadata,creationTime:(new Date).toString()};return this._parallelUploads?e.parallelUploadUrls=this._parallelUploadUrls:e.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,e).then((e=>{this._urlStorageKey=e}))}_sendRequest(e){return yt(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,this.options)}}function mt(e){return Object.entries(e).map((e=>{let[t,s]=e;return`${t} ${Be(String(s))}`})).join(",")}function gt(e,t){return e>=t&&e{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}));i.setHeader("X-Request-ID",e)}return i}async function yt(e,t,s){"function"==typeof s.onBeforeRequest&&await s.onBeforeRequest(e);const i=await e.send(t);return"function"==typeof s.onAfterResponse&&await s.onAfterResponse(e,i),i}function vt(e,t,s){return!(null==s.retryDelays||t>=s.retryDelays.length||null==e.originalRequest)&&(s&&"function"==typeof s.onShouldRetry?s.onShouldRetry(e,t,s):_t(e))}function _t(e){const t=e.originalResponse?e.originalResponse.getStatus():0;return(!gt(t,400)||409===t||423===t)&&function(){let e=!0;return"undefined"!=typeof navigator&&!1===navigator.onLine&&(e=!1),e}()}function bt(e,t){return new ct(t,e).toString()}ft.defaultOptions=ht;const Et=()=>"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class St{constructor(e){this._file=e,this.size=e.size}slice(e,t){if("undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova))return s=this._file.slice(e,t),new Promise(((e,t)=>{const i=new FileReader;i.onload=()=>{const t=new Uint8Array(i.result);e({value:t})},i.onerror=e=>{t(e)},i.readAsArrayBuffer(s)}));var s;const i=this._file.slice(e,t),o=t>=this.size;return Promise.resolve({value:i,done:o})}close(){}}function Rt(e){return void 0===e?0:void 0!==e.size?e.size:e.length}class wt{constructor(e){this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}slice(e,t){return e{let{value:i,done:o}=s;return o?this._done=!0:void 0===this._buffer?this._buffer=i:this._buffer=function(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){const s=new e.constructor(e.length+t.length);return s.set(e),s.set(t,e.length),s}throw new Error("Unknown data type")}(this._buffer,i),this._readUntilEnoughDataOrDone(e,t)}))}_getDataFromBuffer(e,t){e>this._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);const s=0===Rt(this._buffer);return this._done&&s?null:this._buffer.slice(0,t-e)}close(){this._reader.cancel&&this._reader.cancel()}}class At{constructor(e,t){this._xhr=new XMLHttpRequest,this._xhr.open(e,t,!0),this._method=e,this._url=t,this._headers={}}getMethod(){return this._method}getURL(){return this._url}setHeader(e,t){this._xhr.setRequestHeader(e,t),this._headers[e]=t}getHeader(e){return this._headers[e]}setProgressHandler(e){"upload"in this._xhr&&(this._xhr.upload.onprogress=t=>{t.lengthComputable&&e(t.loaded)})}send(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise(((t,s)=>{this._xhr.onload=()=>{t(new kt(this._xhr))},this._xhr.onerror=e=>{s(e)},this._xhr.send(e)}))}abort(){return this._xhr.abort(),Promise.resolve()}getUnderlyingObject(){return this._xhr}}class kt{constructor(e){this._xhr=e}getStatus(){return this._xhr.status}getHeader(e){return this._xhr.getResponseHeader(e)}getBody(){return this._xhr.responseText}getUnderlyingObject(){return this._xhr}}let Ct=!1;try{Ct="localStorage"in window;const e="tusSupport",t=localStorage.getItem(e);localStorage.setItem(e,t),null===t&&localStorage.removeItem(e)}catch(e){if(e.code!==e.SECURITY_ERR&&e.code!==e.QUOTA_EXCEEDED_ERR)throw e;Ct=!1}const Ut=Ct;const Tt={...ft.defaultOptions,httpStack:new class{createRequest(e,t){return new At(e,t)}getName(){return"XHRHttpStack"}},fileReader:new class{async openFile(e,t){if(Et()&&e&&void 0!==e.uri)try{const t=await(s=e.uri,new Promise(((e,t)=>{const i=new XMLHttpRequest;i.responseType="blob",i.onload=()=>{const t=i.response;e(t)},i.onerror=e=>{t(e)},i.open("GET",s),i.send()})));return new St(t)}catch(e){throw new Error(`tus: cannot fetch \`file.uri\` as Blob, make sure the uri is correct and accessible. ${e}`)}var s;return"function"==typeof e.slice&&void 0!==e.size?Promise.resolve(new St(e)):"function"==typeof e.read?(t=Number(t),Number.isFinite(t)?Promise.resolve(new wt(e,t)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option"))):Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment"))}},urlStorage:Ut?new class{findAllUploads(){const e=this._findEntries("tus::");return Promise.resolve(e)}findUploadsByFingerprint(e){const t=this._findEntries(`tus::${e}::`);return Promise.resolve(t)}removeUpload(e){return localStorage.removeItem(e),Promise.resolve()}addUpload(e,t){const s=`tus::${e}::${Math.round(1e12*Math.random())}`;return localStorage.setItem(s,JSON.stringify(t)),Promise.resolve(s)}_findEntries(e){const t=[];for(let s=0;s0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t={...Tt,...t},super(e,t)}static terminate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t={...Tt,...t},ft.terminate(e,t)}}class $t extends ge{constructor(e){let{chunkSize:t,csrfToken:s,fieldName:i,file:o,formId:n,retryDelays:r,uploadIndex:a,uploadUrl:l}=e;super({name:o.name,status:"uploading",type:"tus",uploadIndex:a}),this.csrfToken=s,this.upload=new It(o,{chunkSize:t,endpoint:l,metadata:{fieldName:i,filename:o.name,formId:n},onAfterResponse:this.handleAfterReponse,onBeforeRequest:this.addCsrTokenToRequest,onError:this.handleError,onProgress:this.handleProgress,onSuccess:this.handleSucces,retryDelays:r??[0,1e3,3e3,5e3]}),this.onError=void 0,this.onProgress=void 0,this.onSuccess=void 0}async abort(){await this.upload.abort(!0)}async delete(){if(!this.upload.url)return Promise.resolve();await _e(this.upload.url,this.csrfToken)}getId(){return this.id}getSize(){return this.upload.file.size}start(){this.upload.start()}handleError=e=>{if(!this.onError)throw e;this.onError(e)};handleProgress=(e,t)=>{this.onProgress&&this.onProgress(e,t)};handleSucces=()=>{this.onSuccess&&this.onSuccess()};addCsrTokenToRequest=e=>{e.setHeader("X-CSRFToken",this.csrfToken)};handleAfterReponse=(e,t)=>{const s=t.getHeader("ResourceId");s&&(this.id=s)};getInitialFile(){return{id:this.id,name:this.name,size:this.getSize(),type:"tus",url:""}}}class Ht{constructor(e){let{callbacks:t,chunkSize:s,csrfToken:i,eventEmitter:o,fieldName:n,form:r,formId:a,initial:l,input:p,multiple:c,parent:d,prefix:h,retryDelays:f,s3UploadDir:m,skipRequired:g,supportDropArea:x,translations:y,uploadUrl:v}=e;this.callbacks=t,this.chunkSize=s,this.csrfToken=i,this.eventEmitter=o,this.fieldName=n,this.form=r,this.formId=a,this.multiple=c,this.prefix=h,this.retryDelays=f,this.s3UploadDir=m,this.supportDropArea=x&&!p.disabled,this.uploadUrl=v,this.acceptedFileTypes=new ue(p.accept),this.uploads=[],this.nextUploadIndex=0,this.renderer=new u({parent:d,input:p,skipRequired:g,translations:y});const _=this.renderer.container;x&&this.initDropArea(_,p.accept),this.addInitialFiles(l),this.checkDropHint(),p.addEventListener("change",this.onChange),_.addEventListener("click",this.handleClick)}addInitialFiles(e){if(0===e.length)return;const{multiple:t,renderer:s}=this,i=e=>{const{size:t}=e,i="s3"===e.type&&e.original_name?e.original_name:e.name,o=s.addUploadedFile(i,this.nextUploadIndex,t),n=(e=>{let{csrfToken:t,initialFile:s,uploadIndex:i,uploadUrl:o}=e;switch(s.type){case"existing":return new Re(s,i);case"placeholder":return new Ee(s,i);case"s3":return new Se(s,i);case"tus":return new we({csrfToken:t,initialFile:s,uploadUrl:o,uploadIndex:i})}})({csrfToken:this.csrfToken,initialFile:e,uploadIndex:this.nextUploadIndex,uploadUrl:this.uploadUrl});this.uploads.push(n),this.emitEvent("addUpload",o,n)};if(t)e.forEach((e=>{i(e),this.nextUploadIndex+=1}));else{const t=e[0];t&&i(t)}}uploadFiles=async e=>{if(0!==e.length){if(this.multiple)for(const t of e)await this.uploadFile(t);else{for(const e of this.uploads)this.renderer.deleteFile(e.uploadIndex);this.uploads=[];const t=e[0];t&&await this.uploadFile(t)}this.checkDropHint()}};async uploadFile(e){const{fieldName:t,formId:s,renderer:i,uploadUrl:o}=this,n=e.name,r=this.findUploadByName(n),a=r?r.uploadIndex:this.nextUploadIndex;r||(this.nextUploadIndex+=1),r&&await this.removeExistingUpload(r);const l=(()=>{const{csrfToken:i,s3UploadDir:n}=this;return null!=n?new ve({csrfToken:i,endpoint:o,file:e,s3UploadDir:n,uploadIndex:a}):new $t({chunkSize:this.chunkSize,csrfToken:this.csrfToken,fieldName:t,file:e,formId:s,retryDelays:this.retryDelays,uploadIndex:a,uploadUrl:o})})();l.onError=e=>{this.handleError(l,e)},l.onProgress=(e,t)=>{this.handleProgress(l,e,t)},l.onSuccess=()=>{this.handleSuccess(l)},l.start(),this.uploads.push(l);const p=i.addNewUpload(n,a);this.emitEvent("addUpload",p,l)}getUploadByIndex(e){return this.uploads.find((t=>t.uploadIndex===e))}findUploadByName(e){return this.uploads.find((t=>t.name===e))}async removeExistingUpload(e){const t=this.renderer.findFileDiv(e.uploadIndex);if(t&&this.emitEvent("removeUpload",t,e),"uploading"===e.status)this.renderer.disableCancel(e.uploadIndex),await e.abort();else if("done"===e.status){this.renderer.disableDelete(e.uploadIndex);try{await e.delete()}catch{return void this.renderer.setDeleteFailed(e.uploadIndex)}}this.removeUploadFromList(e),this.updatePlaceholderInput()}onChange=e=>{const t=e.target.files??[],s=[],i=[];for(const e of t)this.acceptedFileTypes.isAccepted(e.name)?s.push(e):i.push(e);this.handleInvalidFiles([...i]),this.uploadFiles([...s]),this.renderer.clearInput()};handleInvalidFiles=e=>{this.renderer.setErrorInvalidFiles(e)};handleClick=e=>{const t=e.target,s=()=>{const e=t.getAttribute("data-index");if(!e)return;const s=parseInt(e,10);return this.getUploadByIndex(s)};if(t.classList.contains("dff-delete")&&!t.classList.contains("dff-disabled")){e.preventDefault();const t=s();t&&this.removeExistingUpload(t)}else if(t.classList.contains("dff-cancel")){e.preventDefault();const t=s();t&&this.handleCancel(t)}else if(t.classList.contains("dff-filename")){e.preventDefault();const t=s();"done"===t?.status&&this.callbacks.onClick&&this.callbacks.onClick({fileName:t.name,fieldName:this.fieldName,id:t.getId(),type:t.type})}};handleProgress=(e,t,s)=>{const i=(t/s*100).toFixed(2);this.renderer.updateProgress(e.uploadIndex,i);const{onProgress:o}=this.callbacks;o&&e instanceof $t&&o(t,s,e)};handleError=(e,t)=>{this.renderer.setError(e.uploadIndex),e.status="error";const{onError:s}=this.callbacks;s&&e instanceof $t&&s(t,e)};handleSuccess=e=>{const{renderer:t}=this;this.updatePlaceholderInput(),t.clearInput(),t.setSuccess(e.uploadIndex,e.getSize()),e.status="done";const{onSuccess:s}=this.callbacks,i=this.renderer.findFileDiv(e.uploadIndex);i&&this.emitEvent("uploadComplete",i,e),s&&"tus"===e.type&&s(e)};removeUploadFromList(e){this.renderer.deleteFile(e.uploadIndex);const t=this.uploads.indexOf(e);t>=0&&this.uploads.splice(t,1),this.checkDropHint();const{onDelete:s}=this.callbacks;s&&s(e)}async handleCancel(e){this.renderer.disableCancel(e.uploadIndex),await e.abort(),this.removeUploadFromList(e)}initDropArea(e,t){new me({container:e,inputAccept:t,onUploadFiles:this.uploadFiles,renderer:this.renderer})}checkDropHint(){if(!this.supportDropArea)return;0===this.uploads.filter((e=>Boolean(e))).length?this.renderer.renderDropHint():this.renderer.removeDropHint()}updatePlaceholderInput(){const e=i(this.form,o(this.fieldName,this.prefix),this.prefix);if(!e)return;const t=this.uploads.map((e=>e.getInitialFile()));e.value=JSON.stringify(t)}getMetaDataField(){return i(this.form,(e=this.fieldName,t=this.prefix,`${s(e,t)}-metadata`),this.prefix);var e,t}emitEvent(e,t,s){this.eventEmitter&&this.eventEmitter.emit(e,{element:t,fieldName:this.fieldName,fileName:s.name,metaDataField:this.getMetaDataField(),upload:s})}}const Lt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=()=>t.prefix?t.prefix:null,r=t=>n(e,t,s()),a=r("upload_url"),l=r("form_id"),p=r("s3_upload_dir"),c=t.skipRequired??!1,u=s(),d=i(e,"csrfmiddlewaretoken",null)?.value;if(!d)throw Error("Csrf token not found");l&&a&&e.querySelectorAll(".dff-uploader").forEach((i=>{const n=i.querySelector(".dff-container");if(!n)return;const h=n.querySelector("input[type=file]");if(!h||!(e=>!t.prefix||e.startsWith(`${t.prefix}-`))(h.name))return;const f=h.name,{multiple:m}=h,g=(e=>{const t=r(o(e,s()));return t?JSON.parse(t).filter((e=>e.type)):[]})(f),x=n.getAttribute("data-translations"),y=x?JSON.parse(x):{},v=!(!1===t.supportDropArea);new Ht({callbacks:t.callbacks??{},chunkSize:t.chunkSize??2621440,csrfToken:d,eventEmitter:t.eventEmitter,fieldName:f,form:e,formId:l,s3UploadDir:p??null,initial:g,input:h,multiple:m,parent:n,prefix:u,retryDelays:t.retryDelays??null,skipRequired:c,supportDropArea:v,translations:y,uploadUrl:a})}))};window.autoInitFileForms=()=>{const t=window.initUploadFields;var s;(s=Array.from(document.querySelectorAll(".dff-uploader")).map(e),Array.from(new Set(s).values())).forEach(t)},window.initFormSet=(e,s)=>{let i;i="string"==typeof s?{prefix:s}:s;const o=i.prefix??"form",r=n(e,"TOTAL_FORMS",o);if(!r)return;const a=parseInt(r,10);for(let s=0;s]/,re=function(e){var t,s=""+e,i=ne.exec(s);if(!i)return s;var o="",n=0,r=0;for(n=i.index;nt?`${t}-${e}`:e,pe=(e,t)=>t?e.slice(t.length+1):e,ce=(e,t,s)=>{const i=le(t,s),o=e.querySelector(`[name="${i}"]`);return o||null},ue=(e,t)=>`${pe(e,t)}-uploads`,de=(e,t,s)=>ce(e,t,s)?.value;class he{createErrorContainer=e=>{const t=document.createElement("div");return t.className="dff-invalid-files",e.appendChild(t),t};createFilesContainer=e=>{const t=document.createElement("div");return t.className="dff-files",e.appendChild(t),t};constructor(e){let{input:t,parent:s,skipRequired:i,translations:o}=e;this.container=this.createFilesContainer(s),this.errors=this.createErrorContainer(s),this.input=t,this.translations=o,i&&(this.input.required=!1)}addFile(e,t){const s=document.createElement("div");s.className=`dff-file dff-file-id-${t.toString()}`;const i=document.createElement("span");return i.innerHTML=ae(e),i.className="dff-filename",i.setAttribute("data-index",t.toString()),s.appendChild(i),this.container.appendChild(s),this.input.required=!1,s}enableDelete(e){const t=this.findDeleteLink(e);t&&t.classList.remove("dff-disabled")}findCancelSpan(e){const t=this.findFileDiv(e);return t?t.querySelector(".dff-cancel"):null}findDeleteLink(e){const t=this.findFileDiv(e);return t?t.querySelector(".dff-delete"):t}removeCancel(e){const t=this.findCancelSpan(e);t&&t.remove()}removeProgress(e){const t=this.findFileDiv(e);if(t){const e=t.querySelector(".dff-progress");e&&e.remove()}}setErrorMessage(e,t){const s=this.findFileDiv(e);if(!s)return;const i=s.querySelector(".dff-error");i&&i.remove();const o=document.createElement("span");o.classList.add("dff-error"),o.innerHTML=t,s.appendChild(o)}addNewUpload(e,t){const s=this.addFile(e,t),i=document.createElement("span");i.className="dff-progress";const o=document.createElement("span");o.className="dff-progress-inner",i.appendChild(o),s.appendChild(i);const n=document.createElement("a");return n.className="dff-cancel",n.innerHTML=this.translations.Cancel??"",n.setAttribute("data-index",t.toString()),n.href="#",s.appendChild(n),s}addUploadedFile(e,t,s){const i=this.addFile(e,t);return this.setSuccess(t,s),i}clearInput(){const{input:e}=this;e.value=""}deleteFile(e){const t=this.findFileDiv(e);t&&t.remove()}disableCancel(e){const t=this.findCancelSpan(e);t&&t.classList.add("dff-disabled")}disableDelete(e){const t=this.findDeleteLink(e);t&&t.classList.add("dff-disabled")}findFileDiv(e){return this.container.querySelector(`.dff-file-id-${e.toString()}`)}removeDropHint(){const e=this.container.querySelector(".dff-drop-hint");e&&e.remove()}renderDropHint(){if(this.container.querySelector(".dff-drop-hint"))return;const e=document.createElement("div");e.className="dff-drop-hint",e.innerHTML=this.translations["Drop your files here"]??"",this.container.appendChild(e)}setDeleteFailed(e){this.setErrorMessage(e,this.translations["Delete failed"]??""),this.enableDelete(e)}setError(e){this.setErrorMessage(e,this.translations["Upload failed"]??"");const t=this.findFileDiv(e);t&&t.classList.add("dff-upload-fail"),this.removeProgress(e),this.removeCancel(e)}setErrorInvalidFiles(e){const t=document.createElement("ul");for(const s of e){const e=document.createElement("li"),i=this.translations["Invalid file type"]??"";e.innerText=`${s.name}: ${i}`,e.className="dff-error",t.appendChild(e)}this.errors.replaceChildren(t),this.clearInput()}setSuccess(e,t){const{translations:s}=this,i=this.findFileDiv(e);if(i){if(i.classList.add("dff-upload-success"),null!=t){const e=document.createElement("span");e.innerHTML=((e,t)=>{if(0===e)return"0 Bytes";const s=t,i=Math.floor(Math.log(e)/Math.log(1024)),o=parseFloat((e/1024**i).toFixed(s)),n=["Bytes","KB","MB","GB"][i];return null==n?"":`${o.toString()} ${n}`})(t,2),e.className="dff-filesize",i.appendChild(e)}const o=document.createElement("a");o.innerHTML=s.Delete??"",o.className="dff-delete",o.setAttribute("data-index",e.toString()),o.href="#",i.appendChild(o)}this.removeProgress(e),this.removeCancel(e)}updateProgress(e,t){const s=this.container.querySelector(`.dff-file-id-${e.toString()}`);if(s){const e=s.querySelector(".dff-progress-inner");e&&(e.style.width=`${t}%`)}}}let fe=class{constructor(e){let{name:t,status:s,type:i,uploadIndex:o}=e;this.name=t,this.status=s,this.type=i,this.uploadIndex=o}async abort(){}async delete(){}};function me(){return function(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var s=e.shift();e[0]=s+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var i=0;i0&&(o=o.replace(/^[\/]+/,"")),o=i0?"?":"")+r.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}const ge=(e,t)=>{const s=e.indexOf(t);-1!==s&&e.splice(s,1)};class xe extends fe{constructor(e){let{csrfToken:t,endpoint:s,file:i,s3UploadDir:o,uploadIndex:n}=e;super({name:i.name,status:"uploading",type:"s3",uploadIndex:n}),this.csrfToken=t,this.endpoint=s,this.file=i,this.s3UploadDir=o,this.key=null,this.uploadId=null,this.parts=[],this.createdPromise=Promise.reject(new Error),this.chunks=[],this.chunkState=[],this.uploading=[],this.onError=void 0,this.onProgress=void 0,this.onSuccess=void 0,this.initChunks(),this.createdPromise.catch((()=>({})))}completeUpload(){return this.parts.sort(((e,t)=>e.PartNumber-t.PartNumber)),this.uploadId&&this.key?(e=>{let{csrfToken:t,endpoint:s,key:i,parts:o,uploadId:n}=e;const r=encodeURIComponent(i),a=encodeURIComponent(n),l=new Headers({"X-CSRFToken":t}),p=me(s,a,"complete",`?key=${r}`);return fetch(p,{body:JSON.stringify({parts:o}),headers:l,method:"post"}).then((e=>e.json())).then((e=>e))})({csrfToken:this.csrfToken,endpoint:this.endpoint,key:this.key,parts:this.parts,uploadId:this.uploadId}).then((()=>{this.onSuccess&&this.onSuccess()}),(e=>{this.handleError(e)})):Promise.resolve()}createUpload(){return this.createdPromise=(e=>{let{csrfToken:t,endpoint:s,file:i,s3UploadDir:o}=e;const n=new Headers({accept:"application/json","content-type":"application/json","X-CSRFToken":t});return fetch(s,{body:JSON.stringify({contentType:i.type,filename:i.name,s3UploadDir:o}),headers:n,method:"post"}).then((e=>e.json())).then((e=>e))})({csrfToken:this.csrfToken,endpoint:this.endpoint,file:this.file,s3UploadDir:this.s3UploadDir}),this.createdPromise.then((e=>{if(!("object"==typeof e&&e&&"string"==typeof e.uploadId&&"string"==typeof e.key))throw new TypeError("AwsS3/Multipart: Got incorrect result from `createMultipartUpload()`, expected an object `{ uploadId, key }`.");this.key=e.key,this.uploadId=e.uploadId,this.uploadParts()})).catch((e=>{this.handleError(e)}))}handleError(e){if(!this.onError)throw e;this.onError(e)}initChunks(){const e=[],t=(s=this.file,Math.ceil(s.size/1e4));var s;const i=Math.max(5242880,Math.ceil(this.file.size/1e4)),o=Math.max(t,i);for(let t=0;t({busy:!1,done:!1,uploaded:0})))}onPartComplete(e,t){const s=this.chunkState[e];s&&(s.etag=t,s.done=!0);const i={ETag:t,PartNumber:e+1};this.parts.push(i),this.uploadParts()}onPartProgress(e,t){const s=this.chunkState[e];if(s&&(s.uploaded=t),this.onProgress){const e=this.chunkState.reduce(((e,t)=>e+t.uploaded),0);this.onProgress(e,this.file.size)}}uploadPart(e){const t=this.chunkState[e];return t&&(t.busy=!0),this.key&&this.uploadId?(e=>{let{csrfToken:t,endpoint:s,key:i,number:o,uploadId:n}=e;const r=encodeURIComponent(i),a=new Headers({"X-CSRFToken":t}),l=me(s,n,o.toString(),`?key=${r}`);return fetch(l,{headers:a,method:"get"}).then((e=>e.json())).then((e=>e))})({csrfToken:this.csrfToken,endpoint:this.endpoint,key:this.key,number:e+1,uploadId:this.uploadId}).then((e=>{if(!("object"==typeof e&&"string"==typeof e.url))throw new TypeError("AwsS3/Multipart: Got incorrect result from `prepareUploadPart()`, expected an object `{ url }`.");return e})).then((t=>{let{url:s}=t;this.uploadPartBytes(e,s)}),(e=>{this.handleError(e)})):Promise.resolve()}uploadPartBytes(e,t){const s=this.chunks[e],i=new XMLHttpRequest;i.open("PUT",t,!0),i.responseType="text",this.uploading.push(i),i.upload.addEventListener("progress",(t=>{t.lengthComputable&&this.onPartProgress(e,t.loaded)})),i.addEventListener("abort",(t=>{ge(this.uploading,t.target);const s=this.chunkState[e];s&&(s.busy=!1)})),i.addEventListener("load",(t=>{const i=t.target;ge(this.uploading,i);const o=this.chunkState[e];if(o&&(o.busy=!1),i.status<200||i.status>=300)return void this.handleError(new Error("Non 2xx"));this.onPartProgress(e,s?.size??0);const n=i.getResponseHeader("ETag");null!==n?this.onPartComplete(e,n):this.handleError(new Error("AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions."))})),i.addEventListener("error",(t=>{ge(this.uploading,t.target);const s=this.chunkState[e];s&&(s.busy=!1);const i=new Error("Unknown error");this.handleError(i)})),i.send(s)}uploadParts(){const e=1-this.uploading.length;if(0===e)return;if(this.chunkState.every((e=>e.done)))return void this.completeUpload();const t=[];for(let s=0;s=e))break}t.forEach((e=>{this.uploadPart(e)}))}async abort(){this.uploading.slice().forEach((e=>{e.abort()})),this.uploading=[],await this.createdPromise,this.key&&this.uploadId&&await(e=>{let{csrfToken:t,endpoint:s,key:i,uploadId:o}=e;const n=encodeURIComponent(i),r=encodeURIComponent(o),a=new Headers({"X-CSRFToken":t}),l=me(s,r,`?key=${n}`);return fetch(l,{headers:a,method:"delete"}).then((e=>e.json()))})({csrfToken:this.csrfToken,endpoint:this.endpoint,key:this.key,uploadId:this.uploadId})}async delete(){return Promise.resolve()}getId(){return this.uploadId??void 0}getInitialFile(){return{id:this.uploadId??"",name:this.key??"",original_name:this.file.name,size:this.file.size,type:"s3"}}getSize(){return this.file.size}start(){this.createUpload()}}class ye extends Error{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(super(e),this.originalRequest=s,this.originalResponse=i,this.causingError=t,null!=t&&(e+=`, caused by ${t.toString()}`),null!=s){const t=s.getHeader("X-Request-ID")||"n/a";e+=`, originated from request (method: ${s.getMethod()}, url: ${s.getURL()}, response code: ${i?i.getStatus():"n/a"}, response text: ${i?i.getBody()||"":"n/a"}, request id: ${t})`}this.message=e}}const ve="function"==typeof Buffer,_e=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),be=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Ee=(e=>{let t={};return e.forEach(((e,s)=>t[e]=s)),t})(be),Se=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Re=String.fromCharCode.bind(String),we=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),Ae=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),ke=e=>{let t,s,i,o,n="";const r=e.length%3;for(let r=0;r255||(i=e.charCodeAt(r++))>255||(o=e.charCodeAt(r++))>255)throw new TypeError("invalid character found");t=s<<16|i<<8|o,n+=be[t>>18&63]+be[t>>12&63]+be[t>>6&63]+be[63&t]}return r?n.slice(0,r-3)+"===".substring(r):n},Ce="function"==typeof btoa?e=>btoa(e):ve?e=>Buffer.from(e,"binary").toString("base64"):ke,Ue=ve?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let s=0,i=e.length;s{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Re(192|t>>>6)+Re(128|63&t):Re(224|t>>>12&15)+Re(128|t>>>6&63)+Re(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Re(240|t>>>18&7)+Re(128|t>>>12&63)+Re(128|t>>>6&63)+Re(128|63&t)},Ie=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,$e=e=>e.replace(Ie,Te),He=ve?e=>Buffer.from(e,"utf8").toString("base64"):_e?e=>Ue(_e.encode(e)):e=>Ce($e(e)),Le=(e,t=!1)=>t?we(He(e)):He(e),De=e=>{if(e=e.replace(/\s+/g,""),!Se.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,s,i,o="";for(let n=0;n>16&255):64===i?Re(t>>16&255,t>>8&255):Re(t>>16&255,t>>8&255,255&t);return o},Pe=Le;var Oe={},Ne=Object.prototype.hasOwnProperty;function Fe(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function je(e){try{return encodeURIComponent(e)}catch(e){return null}}Oe.stringify=function(e,t){t=t||"";var s,i,o=[];for(i in"string"!=typeof t&&(t="?"),e)if(Ne.call(e,i)){if((s=e[i])||null!=s&&!isNaN(s)||(s=""),i=je(i),s=je(s),null===i||null===s)continue;o.push(i+"="+s)}return o.length?t+o.join("&"):""},Oe.parse=function(e){for(var t,s=/([^=?#&]+)=?([^&]*)/g,i={};t=s.exec(e);){var o=Fe(t[1]),n=Fe(t[2]);null===o||null===n||o in i||(i[o]=n)}return i};var ze=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e},qe=Oe,Me=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Be=/[\n\r\t]/g,Ge=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,Ke=/:\d+$/,Xe=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,Qe=/^[a-zA-Z]:/;function We(e){return(e||"").toString().replace(Me,"")}var Ze=[["#","hash"],["?","query"],function(e,t){return Ve(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Je={hash:1,query:1};function Ye(e){var t,s=("undefined"!=typeof window?window:void 0!==a?a:"undefined"!=typeof self?self:{}).location||{},i={},o=typeof(e=e||s);if("blob:"===e.protocol)i=new tt(unescape(e.pathname),{});else if("string"===o)for(t in i=new tt(e,{}),Je)delete i[t];else if("object"===o){for(t in e)t in Je||(i[t]=e[t]);void 0===i.slashes&&(i.slashes=Ge.test(e.href))}return i}function Ve(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function et(e,t){e=(e=We(e)).replace(Be,""),t=t||{};var s,i=Xe.exec(e),o=i[1]?i[1].toLowerCase():"",n=!!i[2],r=!!i[3],a=0;return n?r?(s=i[2]+i[3]+i[4],a=i[2].length+i[3].length):(s=i[2]+i[4],a=i[2].length):r?(s=i[3]+i[4],a=i[3].length):s=i[4],"file:"===o?a>=2&&(s=s.slice(2)):Ve(o)?s=i[4]:o?n&&(s=s.slice(2)):a>=2&&Ve(t.protocol)&&(s=i[4]),{protocol:o,slashes:n||Ve(o),slashesCount:a,rest:s}}function tt(e,t,s){if(e=(e=We(e)).replace(Be,""),!(this instanceof tt))return new tt(e,t,s);var i,o,n,r,a,l,p=Ze.slice(),c=typeof t,u=this,d=0;for("object"!==c&&"string"!==c&&(s=t,t=null),s&&"function"!=typeof s&&(s=qe.parse),i=!(o=et(e||"",t=Ye(t))).protocol&&!o.slashes,u.slashes=o.slashes||i&&t.slashes,u.protocol=o.protocol||t.protocol||"",e=o.rest,("file:"===o.protocol&&(2!==o.slashesCount||Qe.test(e))||!o.slashes&&(o.protocol||o.slashesCount<2||!Ve(u.protocol)))&&(p[3]=[/(.*)/,"pathname"]);d1&&void 0!==arguments[1]?arguments[1]:{};const s=pt("DELETE",e,t);return ct(s,null,t).then((e=>{if(204!==e.getStatus())throw new ye("tus: unexpected response while terminating upload",null,s,e)})).catch((i=>{if(i instanceof ye||(i=new ye("tus: failed to terminate upload",i,s,null)),!ut(i,0,t))throw i;const o=t.retryDelays[0],n=t.retryDelays.slice(1),r={...t,retryDelays:n};return new Promise((e=>setTimeout(e,o))).then((()=>rt.terminate(e,r)))}))}findPreviousUploads(){return this.options.fingerprint(this.file,this.options).then((e=>this._urlStorage.findUploadsByFingerprint(e)))}resumeFromPreviousUpload(e){this.url=e.uploadUrl||null,this._parallelUploadUrls=e.parallelUploadUrls||null,this._urlStorageKey=e.urlStorageKey}start(){const{file:e}=this;if(!e)return void this._emitError(new Error("tus: no file or stream to upload provided"));if(![it,ot].includes(this.options.protocol))return void this._emitError(new Error(`tus: unsupported protocol ${this.options.protocol}`));if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url)return void this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));const{retryDelays:t}=this.options;if(null==t||"[object Array]"===Object.prototype.toString.call(t)){if(this.options.parallelUploads>1)for(const e of["uploadUrl","uploadSize","uploadLengthDeferred"])if(this.options[e])return void this._emitError(new Error(`tus: cannot use the ${e} option when parallelUploads is enabled`));if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1)return void this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length)return void this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"))}this.options.fingerprint(e,this.options).then((t=>(this._fingerprint=t,this._source?this._source:this.options.fileReader.openFile(e,this.options.chunkSize)))).then((e=>{if(this._source=e,this.options.uploadLengthDeferred)this._size=null;else if(null!=this.options.uploadSize){if(this._size=Number(this.options.uploadSize),Number.isNaN(this._size))return void this._emitError(new Error("tus: cannot convert `uploadSize` option into a number"))}else if(this._size=this._source.size,null==this._size)return void this._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));this.options.parallelUploads>1||null!=this._parallelUploadUrls?this._startParallelUpload():this._startSingleUpload()})).catch((e=>{this._emitError(e)}))}else this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"))}_startParallelUpload(){const e=this._size;let t=0;this._parallelUploads=[];const s=null!=this._parallelUploadUrls?this._parallelUploadUrls.length:this.options.parallelUploads,i=this.options.parallelUploadBoundaries??function(e,t){const s=Math.floor(e/t),i=[];for(let e=0;e{e.uploadUrl=this._parallelUploadUrls[t]||null})),this._parallelUploadUrls=new Array(i.length);const o=i.map(((s,o)=>{let n=0;return this._source.slice(s.start,s.end).then((r=>{let{value:a}=r;return new Promise(((r,l)=>{const p={...this.options,uploadUrl:s.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:this.options.metadataForPartialUploads,headers:{...this.options.headers,"Upload-Concat":"partial"},onSuccess:r,onError:l,onProgress:s=>{t=t-n+s,n=s,this._emitProgress(t,e)},onUploadUrlAvailable:()=>{this._parallelUploadUrls[o]=c.url,this._parallelUploadUrls.filter((e=>Boolean(e))).length===i.length&&this._saveUploadInUrlStorage()}},c=new rt(a,p);c.start(),this._parallelUploads.push(c)}))}))}));let n;Promise.all(o).then((()=>{n=this._openRequest("POST",this.options.endpoint),n.setHeader("Upload-Concat",`final;${this._parallelUploadUrls.join(" ")}`);const e=at(this.options.metadata);return""!==e&&n.setHeader("Upload-Metadata",e),this._sendRequest(n,null)})).then((e=>{if(!lt(e.getStatus(),200))return void this._emitHttpError(n,e,"tus: unexpected response while creating upload");const t=e.getHeader("Location");null!=t?(this.url=ht(this.options.endpoint,t),this.url,this._emitSuccess(e)):this._emitHttpError(n,e,"tus: invalid or missing Location header")})).catch((e=>{this._emitError(e)}))}_startSingleUpload(){return this._aborted=!1,null!=this.url?(this.url,void this._resumeUpload()):null!=this.options.uploadUrl?(this.options.uploadUrl,this.url=this.options.uploadUrl,void this._resumeUpload()):void this._createUpload()}abort(e){if(null!=this._parallelUploads)for(const t of this._parallelUploads)t.abort(e);return null!==this._req&&this._req.abort(),this._aborted=!0,null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),e&&null!=this.url?rt.terminate(this.url,this.options).then((()=>this._removeFromUrlStorage())):Promise.resolve()}_emitHttpError(e,t,s,i){this._emitError(new ye(s,i,e,t))}_emitError(e){if(!this._aborted){if(null!=this.options.retryDelays){if(null!=this._offset&&this._offset>this._offsetBeforeRetry&&(this._retryAttempt=0),ut(e,this._retryAttempt,this.options)){const e=this.options.retryDelays[this._retryAttempt++];return this._offsetBeforeRetry=this._offset,void(this._retryTimeout=setTimeout((()=>{this.start()}),e))}}if("function"!=typeof this.options.onError)throw e;this.options.onError(e)}}_emitSuccess(e){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),"function"==typeof this.options.onSuccess&&this.options.onSuccess({lastResponse:e})}_emitProgress(e,t){"function"==typeof this.options.onProgress&&this.options.onProgress(e,t)}_emitChunkComplete(e,t,s){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(e,t,s)}_createUpload(){if(!this.options.endpoint)return void this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));const e=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?e.setHeader("Upload-Defer-Length","1"):e.setHeader("Upload-Length",`${this._size}`);const t=at(this.options.metadata);let s;""!==t&&e.setHeader("Upload-Metadata",t),this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,s=this._addChunkToRequest(e)):(this.options.protocol===ot&&e.setHeader("Upload-Complete","?0"),s=this._sendRequest(e,null)),s.then((t=>{if(!lt(t.getStatus(),200))return void this._emitHttpError(e,t,"tus: unexpected response while creating upload");const s=t.getHeader("Location");if(null!=s){if(this.url=ht(this.options.endpoint,s),this.url,"function"==typeof this.options.onUploadUrlAvailable&&this.options.onUploadUrlAvailable(),0===this._size)return this._emitSuccess(t),void this._source.close();this._saveUploadInUrlStorage().then((()=>{this.options.uploadDataDuringCreation?this._handleUploadResponse(e,t):(this._offset=0,this._performUpload())}))}else this._emitHttpError(e,t,"tus: invalid or missing Location header")})).catch((t=>{this._emitHttpError(e,null,"tus: failed to create upload",t)}))}_resumeUpload(){const e=this._openRequest("HEAD",this.url);this._sendRequest(e,null).then((t=>{const s=t.getStatus();if(!lt(s,200))return 423===s?void this._emitHttpError(e,t,"tus: upload is currently locked; retry later"):(lt(s,400)&&this._removeFromUrlStorage(),this.options.endpoint?(this.url=null,void this._createUpload()):void this._emitHttpError(e,t,"tus: unable to resume upload (new upload cannot be created without an endpoint)"));const i=Number.parseInt(t.getHeader("Upload-Offset"),10);if(Number.isNaN(i))return void this._emitHttpError(e,t,"tus: invalid or missing offset value");const o=Number.parseInt(t.getHeader("Upload-Length"),10);!Number.isNaN(o)||this.options.uploadLengthDeferred||this.options.protocol!==it?("function"==typeof this.options.onUploadUrlAvailable&&this.options.onUploadUrlAvailable(),this._saveUploadInUrlStorage().then((()=>{if(i===o)return this._emitProgress(o,o),void this._emitSuccess(t);this._offset=i,this._performUpload()}))):this._emitHttpError(e,t,"tus: invalid or missing length value")})).catch((t=>{this._emitHttpError(e,null,"tus: failed to resume upload",t)}))}_performUpload(){if(this._aborted)return;let e;this.options.overridePatchMethod?(e=this._openRequest("POST",this.url),e.setHeader("X-HTTP-Method-Override","PATCH")):e=this._openRequest("PATCH",this.url),e.setHeader("Upload-Offset",`${this._offset}`);this._addChunkToRequest(e).then((t=>{lt(t.getStatus(),200)?this._handleUploadResponse(e,t):this._emitHttpError(e,t,"tus: unexpected response while uploading chunk")})).catch((t=>{this._aborted||this._emitHttpError(e,null,`tus: failed to upload chunk at offset ${this._offset}`,t)}))}_addChunkToRequest(e){const t=this._offset;let s=this._offset+this.options.chunkSize;return e.setProgressHandler((e=>{this._emitProgress(t+e,this._size)})),e.setHeader("Content-Type","application/offset+octet-stream"),(s===Number.POSITIVE_INFINITY||s>this._size)&&!this.options.uploadLengthDeferred&&(s=this._size),this._source.slice(t,s).then((t=>{let{value:s,done:i}=t;const o=s?.size?s.size:0;this.options.uploadLengthDeferred&&i&&(this._size=this._offset+o,e.setHeader("Upload-Length",`${this._size}`));const n=this._offset+o;return!this.options.uploadLengthDeferred&&i&&n!==this._size?Promise.reject(new Error(`upload was configured with a size of ${this._size} bytes, but the source is done after ${n} bytes`)):null===s?this._sendRequest(e):(this.options.protocol===ot&&e.setHeader("Upload-Complete",i?"?1":"?0"),this._emitProgress(this._offset,this._size),this._sendRequest(e,s))}))}_handleUploadResponse(e,t){const s=Number.parseInt(t.getHeader("Upload-Offset"),10);if(Number.isNaN(s))this._emitHttpError(e,t,"tus: invalid or missing offset value");else{if(this._emitProgress(s,this._size),this._emitChunkComplete(s-this._offset,s,this._size),this._offset=s,s===this._size)return this._emitSuccess(t),void this._source.close();this._performUpload()}}_openRequest(e,t){const s=pt(e,t,this.options);return this._req=s,s}_removeFromUrlStorage(){this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch((e=>{this._emitError(e)})),this._urlStorageKey=null)}_saveUploadInUrlStorage(){if(!this.options.storeFingerprintForResuming||!this._fingerprint||null!==this._urlStorageKey)return Promise.resolve();const e={size:this._size,metadata:this.options.metadata,creationTime:(new Date).toString()};return this._parallelUploads?e.parallelUploadUrls=this._parallelUploadUrls:e.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,e).then((e=>{this._urlStorageKey=e}))}_sendRequest(e){return ct(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,this.options)}}function at(e){return Object.entries(e).map((e=>{let[t,s]=e;return`${t} ${Pe(String(s))}`})).join(",")}function lt(e,t){return e>=t&&e{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}));i.setHeader("X-Request-ID",e)}return i}async function ct(e,t,s){"function"==typeof s.onBeforeRequest&&await s.onBeforeRequest(e);const i=await e.send(t);return"function"==typeof s.onAfterResponse&&await s.onAfterResponse(e,i),i}function ut(e,t,s){return!(null==s.retryDelays||t>=s.retryDelays.length||null==e.originalRequest)&&(s&&"function"==typeof s.onShouldRetry?s.onShouldRetry(e,t,s):dt(e))}function dt(e){const t=e.originalResponse?e.originalResponse.getStatus():0;return(!lt(t,400)||409===t||423===t)&&function(){let e=!0;return"undefined"!=typeof navigator&&!1===navigator.onLine&&(e=!1),e}()}function ht(e,t){return new st(t,e).toString()}rt.defaultOptions=nt;const ft=()=>"undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();class mt{constructor(e){this._file=e,this.size=e.size}slice(e,t){if("undefined"!=typeof window&&(void 0!==window.PhoneGap||void 0!==window.Cordova||void 0!==window.cordova))return s=this._file.slice(e,t),new Promise(((e,t)=>{const i=new FileReader;i.onload=()=>{const t=new Uint8Array(i.result);e({value:t})},i.onerror=e=>{t(e)},i.readAsArrayBuffer(s)}));var s;const i=this._file.slice(e,t),o=t>=this.size;return Promise.resolve({value:i,done:o})}close(){}}function gt(e){return void 0===e?0:void 0!==e.size?e.size:e.length}class xt{constructor(e){this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}slice(e,t){return e{let{value:i,done:o}=s;return o?this._done=!0:void 0===this._buffer?this._buffer=i:this._buffer=function(e,t){if(e.concat)return e.concat(t);if(e instanceof Blob)return new Blob([e,t],{type:e.type});if(e.set){const s=new e.constructor(e.length+t.length);return s.set(e),s.set(t,e.length),s}throw new Error("Unknown data type")}(this._buffer,i),this._readUntilEnoughDataOrDone(e,t)}))}_getDataFromBuffer(e,t){e>this._bufferOffset&&(this._buffer=this._buffer.slice(e-this._bufferOffset),this._bufferOffset=e);const s=0===gt(this._buffer);return this._done&&s?null:this._buffer.slice(0,t-e)}close(){this._reader.cancel&&this._reader.cancel()}}class yt{constructor(e,t){this._xhr=new XMLHttpRequest,this._xhr.open(e,t,!0),this._method=e,this._url=t,this._headers={}}getMethod(){return this._method}getURL(){return this._url}setHeader(e,t){this._xhr.setRequestHeader(e,t),this._headers[e]=t}getHeader(e){return this._headers[e]}setProgressHandler(e){"upload"in this._xhr&&(this._xhr.upload.onprogress=t=>{t.lengthComputable&&e(t.loaded)})}send(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise(((t,s)=>{this._xhr.onload=()=>{t(new vt(this._xhr))},this._xhr.onerror=e=>{s(e)},this._xhr.send(e)}))}abort(){return this._xhr.abort(),Promise.resolve()}getUnderlyingObject(){return this._xhr}}class vt{constructor(e){this._xhr=e}getStatus(){return this._xhr.status}getHeader(e){return this._xhr.getResponseHeader(e)}getBody(){return this._xhr.responseText}getUnderlyingObject(){return this._xhr}}let _t=!1;try{_t="localStorage"in window;const e="tusSupport",t=localStorage.getItem(e);localStorage.setItem(e,t),null===t&&localStorage.removeItem(e)}catch(e){if(e.code!==e.SECURITY_ERR&&e.code!==e.QUOTA_EXCEEDED_ERR)throw e;_t=!1}const bt=_t;const Et={...rt.defaultOptions,httpStack:new class{createRequest(e,t){return new yt(e,t)}getName(){return"XHRHttpStack"}},fileReader:new class{async openFile(e,t){if(ft()&&e&&void 0!==e.uri)try{const t=await(s=e.uri,new Promise(((e,t)=>{const i=new XMLHttpRequest;i.responseType="blob",i.onload=()=>{const t=i.response;e(t)},i.onerror=e=>{t(e)},i.open("GET",s),i.send()})));return new mt(t)}catch(e){throw new Error(`tus: cannot fetch \`file.uri\` as Blob, make sure the uri is correct and accessible. ${e}`)}var s;return"function"==typeof e.slice&&void 0!==e.size?Promise.resolve(new mt(e)):"function"==typeof e.read?(t=Number(t),Number.isFinite(t)?Promise.resolve(new xt(e,t)):Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option"))):Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment"))}},urlStorage:bt?new class{findAllUploads(){const e=this._findEntries("tus::");return Promise.resolve(e)}findUploadsByFingerprint(e){const t=this._findEntries(`tus::${e}::`);return Promise.resolve(t)}removeUpload(e){return localStorage.removeItem(e),Promise.resolve()}addUpload(e,t){const s=`tus::${e}::${Math.round(1e12*Math.random())}`;return localStorage.setItem(s,JSON.stringify(t)),Promise.resolve(s)}_findEntries(e){const t=[];for(let s=0;s0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t={...Et,...t},super(e,t)}static terminate(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t={...Et,...t},rt.terminate(e,t)}}const Rt=async(e,t)=>new Promise(((s,i)=>{const o=new XMLHttpRequest;o.open("DELETE",e),o.onload=()=>{204===o.status?s():i(new Error)},o.setRequestHeader("Tus-Resumable","1.0.0"),o.setRequestHeader("X-CSRFToken",t),o.send(null)}));class wt extends fe{addCsrTokenToRequest=e=>{e.setHeader("X-CSRFToken",this.csrfToken)};handleAfterReponse=(e,t)=>{const s=t.getHeader("ResourceId");s&&(this.id=s)};handleError=e=>{if(!this.onError)throw e;this.onError(e)};handleProgress=(e,t)=>{this.onProgress&&this.onProgress(e,t)};handleSucces=()=>{this.onSuccess&&this.onSuccess()};constructor(e){let{chunkSize:t,csrfToken:s,fieldName:i,file:o,formId:n,retryDelays:r,uploadIndex:a,uploadUrl:l}=e;super({name:o.name,status:"uploading",type:"tus",uploadIndex:a}),this.csrfToken=s,this.upload=new St(o,{chunkSize:t,endpoint:l,metadata:{fieldName:i,filename:o.name,formId:n},onAfterResponse:this.handleAfterReponse,onBeforeRequest:this.addCsrTokenToRequest,onError:this.handleError,onProgress:this.handleProgress,onSuccess:this.handleSucces,retryDelays:r??[0,1e3,3e3,5e3]}),this.onError=void 0,this.onProgress=void 0,this.onSuccess=void 0}async abort(){await this.upload.abort(!0)}async delete(){if(!this.upload.url)return Promise.resolve();await Rt(this.upload.url,this.csrfToken)}getId(){return this.id}getInitialFile(){return{id:this.id,name:this.name,size:this.getSize(),type:"tus",url:""}}getSize(){return this.upload.file.size}start(){this.upload.start()}}class At extends fe{constructor(e){let{name:t,size:s,type:i,uploadIndex:o}=e;super({name:t,status:"done",type:i,uploadIndex:o}),this.size=s}async abort(){return Promise.resolve()}async delete(){return Promise.resolve()}getSize(){return this.size}}class kt extends At{constructor(e,t){super({name:e.name,size:e.size,type:"placeholder",uploadIndex:t}),this.id=e.id}getId(){}getInitialFile(){return{id:this.id,name:this.name,size:this.size,type:"placeholder"}}}class Ct extends At{constructor(e,t){super({name:e.original_name||e.name,size:e.size,type:"uploadedS3",uploadIndex:t}),this.id=e.id,this.key=e.name}getId(){return this.id}getInitialFile(){return{id:this.id,name:this.key,original_name:this.name,size:this.size,type:"s3"}}}class Ut extends At{constructor(e,t){super({name:e.name,size:e.size,type:"existing",uploadIndex:t})}getId(){}getInitialFile(){return{name:this.name,size:this.size,type:"existing"}}}class Tt extends At{constructor(e){let{csrfToken:t,initialFile:s,uploadIndex:i,uploadUrl:o}=e;super({name:s.name,size:s.size,type:"uploadedTus",uploadIndex:i}),this.csrfToken=t,this.id=s.id,this.url=`${o}${s.id}`}async delete(){await Rt(this.url,this.csrfToken)}getId(){return this.id}getInitialFile(){return{id:this.id,name:this.name,size:this.size,type:"tus",url:""}}}class It{handleClick=e=>{const t=e.target,s=()=>{const e=t.getAttribute("data-index");if(!e)return;const s=parseInt(e,10);return this.getUploadByIndex(s)};if(t.classList.contains("dff-delete")&&!t.classList.contains("dff-disabled")){e.preventDefault();const t=s();t&&this.removeExistingUpload(t)}else if(t.classList.contains("dff-cancel")){e.preventDefault();const t=s();t&&this.handleCancel(t)}else if(t.classList.contains("dff-filename")){e.preventDefault();const t=s();"done"===t?.status&&this.callbacks.onClick&&this.callbacks.onClick({fieldName:this.fieldName,fileName:t.name,id:t.getId(),type:t.type})}};handleError=(e,t)=>{this.renderer.setError(e.uploadIndex),e.status="error";const{onError:s}=this.callbacks;s&&e instanceof wt&&s(t,e)};handleInvalidFiles=e=>{this.renderer.setErrorInvalidFiles(e)};handleProgress=(e,t,s)=>{const i=(t/s*100).toFixed(2);this.renderer.updateProgress(e.uploadIndex,i);const{onProgress:o}=this.callbacks;o&&e instanceof wt&&o(t,s,e)};handleSuccess=e=>{const{renderer:t}=this;this.updatePlaceholderInput(),t.clearInput(),t.setSuccess(e.uploadIndex,e.getSize()),e.status="done";const{onSuccess:s}=this.callbacks,i=this.renderer.findFileDiv(e.uploadIndex);i&&this.emitEvent("uploadComplete",i,e),s&&"tus"===e.type&&s(e)};onChange=e=>{const t=e.target.files??[],s=[],i=[];for(const e of t)this.acceptedFileTypes.isAccepted(e.name)?s.push(e):i.push(e);this.handleInvalidFiles([...i]),this.uploadFiles([...s]),this.renderer.clearInput()};uploadFiles=async e=>{if(0!==e.length){if(this.multiple)for(const t of e)await this.uploadFile(t);else{for(const e of this.uploads)this.renderer.deleteFile(e.uploadIndex);this.uploads=[];const t=e[0];t&&await this.uploadFile(t)}this.checkDropHint()}};constructor(e){let{callbacks:t,chunkSize:s,csrfToken:i,eventEmitter:o,fieldName:n,form:r,formId:a,initial:l,input:p,multiple:c,parent:u,prefix:d,retryDelays:h,s3UploadDir:f,skipRequired:m,supportDropArea:g,translations:x,uploadUrl:y}=e;this.callbacks=t,this.chunkSize=s,this.csrfToken=i,this.eventEmitter=o,this.fieldName=n,this.form=r,this.formId=a,this.multiple=c,this.prefix=d,this.retryDelays=h,this.s3UploadDir=f,this.supportDropArea=g&&!p.disabled,this.uploadUrl=y,this.acceptedFileTypes=new se(p.accept),this.uploads=[],this.nextUploadIndex=0,this.renderer=new he({input:p,parent:u,skipRequired:m,translations:x});const v=this.renderer.container;g&&this.initDropArea(v,p.accept),this.addInitialFiles(l),this.checkDropHint(),p.addEventListener("change",this.onChange),v.addEventListener("click",this.handleClick)}addInitialFiles(e){if(0===e.length)return;const{multiple:t,renderer:s}=this,i=e=>{const{size:t}=e,i="s3"===e.type&&e.original_name?e.original_name:e.name,o=s.addUploadedFile(i,this.nextUploadIndex,t),n=(e=>{let{csrfToken:t,initialFile:s,uploadIndex:i,uploadUrl:o}=e;switch(s.type){case"existing":return new Ut(s,i);case"placeholder":return new kt(s,i);case"s3":return new Ct(s,i);case"tus":return new Tt({csrfToken:t,initialFile:s,uploadIndex:i,uploadUrl:o})}})({csrfToken:this.csrfToken,initialFile:e,uploadIndex:this.nextUploadIndex,uploadUrl:this.uploadUrl});this.uploads.push(n),this.emitEvent("addUpload",o,n)};if(t)e.forEach((e=>{i(e),this.nextUploadIndex+=1}));else{const t=e[0];t&&i(t)}}checkDropHint(){if(!this.supportDropArea)return;0===this.uploads.filter((e=>Boolean(e))).length?this.renderer.renderDropHint():this.renderer.removeDropHint()}emitEvent(e,t,s){this.eventEmitter&&this.eventEmitter.emit(e,{element:t,fieldName:this.fieldName,fileName:s.name,metaDataField:this.getMetaDataField(),upload:s})}findUploadByName(e){return this.uploads.find((t=>t.name===e))}getMetaDataField(){return ce(this.form,(e=this.fieldName,t=this.prefix,`${pe(e,t)}-metadata`),this.prefix);var e,t}getUploadByIndex(e){return this.uploads.find((t=>t.uploadIndex===e))}async handleCancel(e){this.renderer.disableCancel(e.uploadIndex),await e.abort(),this.removeUploadFromList(e)}initDropArea(e,t){new oe({container:e,inputAccept:t,onUploadFiles:this.uploadFiles,renderer:this.renderer})}async removeExistingUpload(e){const t=this.renderer.findFileDiv(e.uploadIndex);if(t&&this.emitEvent("removeUpload",t,e),"uploading"===e.status)this.renderer.disableCancel(e.uploadIndex),await e.abort();else if("done"===e.status){this.renderer.disableDelete(e.uploadIndex);try{await e.delete()}catch{return void this.renderer.setDeleteFailed(e.uploadIndex)}}this.removeUploadFromList(e),this.updatePlaceholderInput()}removeUploadFromList(e){this.renderer.deleteFile(e.uploadIndex);const t=this.uploads.indexOf(e);t>=0&&this.uploads.splice(t,1),this.checkDropHint();const{onDelete:s}=this.callbacks;s&&s(e)}updatePlaceholderInput(){const e=ce(this.form,ue(this.fieldName,this.prefix),this.prefix);if(!e)return;const t=this.uploads.map((e=>e.getInitialFile()));e.value=JSON.stringify(t)}async uploadFile(e){const{fieldName:t,formId:s,renderer:i,uploadUrl:o}=this,n=e.name,r=this.findUploadByName(n),a=r?r.uploadIndex:this.nextUploadIndex;r||(this.nextUploadIndex+=1),r&&await this.removeExistingUpload(r);const l=(()=>{const{csrfToken:i,s3UploadDir:n}=this;return null!=n?new xe({csrfToken:i,endpoint:o,file:e,s3UploadDir:n,uploadIndex:a}):new wt({chunkSize:this.chunkSize,csrfToken:this.csrfToken,fieldName:t,file:e,formId:s,retryDelays:this.retryDelays,uploadIndex:a,uploadUrl:o})})();l.onError=e=>{this.handleError(l,e)},l.onProgress=(e,t)=>{this.handleProgress(l,e,t)},l.onSuccess=()=>{this.handleSuccess(l)},l.start(),this.uploads.push(l);const p=i.addNewUpload(n,a);this.emitEvent("addUpload",p,l)}}const $t=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=()=>t.prefix?t.prefix:null,i=t=>de(e,t,s()),o=i("upload_url"),n=i("form_id"),r=i("s3_upload_dir"),a=t.skipRequired??!1,l=s(),p=ce(e,"csrfmiddlewaretoken",null)?.value;if(!p)throw Error("Csrf token not found");n&&o&&e.querySelectorAll(".dff-uploader").forEach((c=>{const u=c.querySelector(".dff-container");if(!u)return;const d=u.querySelector("input[type=file]");if(!d||!(e=>!t.prefix||e.startsWith(`${t.prefix}-`))(d.name))return;const h=d.name,{multiple:f}=d,m=(e=>{const t=i(ue(e,s()));return t?JSON.parse(t).filter((e=>e.type)):[]})(h),g=u.getAttribute("data-translations"),x=g?JSON.parse(g):{},y=!(!1===t.supportDropArea);new It({callbacks:t.callbacks??{},chunkSize:t.chunkSize??2621440,csrfToken:p,eventEmitter:t.eventEmitter,fieldName:h,form:e,formId:n,initial:m,input:d,multiple:f,parent:u,prefix:l,retryDelays:t.retryDelays??null,s3UploadDir:r??null,skipRequired:a,supportDropArea:y,translations:x,uploadUrl:o})}))};window.autoInitFileForms=()=>{const t=window.initUploadFields;var s;(s=Array.from(document.querySelectorAll(".dff-uploader")).map(e),Array.from(new Set(s).values())).forEach(t)},window.initFormSet=(e,t)=>{let s;s="string"==typeof t?{prefix:t}:t;const i=s.prefix??"form",o=de(e,"TOTAL_FORMS",i);if(!o)return;const n=parseInt(o,10);for(let t=0;t {\n const parent = element.parentElement;\n\n if (!parent) {\n return null;\n }\n\n if (parent.tagName === \"FORM\") {\n return parent;\n }\n\n return findForm(parent);\n};\n\nconst unique = (values: unknown[]): unknown[] =>\n Array.from(new Set(values).values());\n\ndeclare const window: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n\nconst autoInitFileForms = (): void => {\n const initUploadFields = window.initUploadFields as () => void; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n\n const forms = unique(\n Array.from(document.querySelectorAll(\".dff-uploader\")).map(findForm)\n );\n forms.forEach(initUploadFields);\n};\n\nexport default autoInitFileForms;\n","export const formatBytes = (bytes: number, decimals: number): string => {\n if (bytes === 0) {\n return \"0 Bytes\";\n }\n\n const k = 1024;\n const dm = decimals <= 0 ? 0 : decimals || 2;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n const n = parseFloat((bytes / k ** i).toFixed(dm));\n const size = sizes[i];\n\n if (size == null) {\n return \"\";\n } else {\n return `${n.toString()} ${size}`;\n }\n};\n\nexport const getInputNameWithPrefix = (\n fieldName: string,\n prefix: string | null\n): string => (prefix ? `${prefix}-${fieldName}` : fieldName);\n\nconst getInputNameWithoutPrefix = (\n fieldName: string,\n prefix: string | null\n): string => (prefix ? fieldName.slice(prefix.length + 1) : fieldName);\n\nexport const findInput = (\n form: Element,\n fieldName: string,\n prefix: string | null\n): HTMLInputElement | null => {\n const inputNameWithPrefix = getInputNameWithPrefix(fieldName, prefix);\n const input = form.querySelector(`[name=\"${inputNameWithPrefix}\"]`);\n\n if (!input) {\n return null;\n }\n\n return input as HTMLInputElement;\n};\n\nexport const getUploadsFieldName = (\n fieldName: string,\n prefix: string | null\n): string => `${getInputNameWithoutPrefix(fieldName, prefix)}-uploads`;\n\nexport const getInputValueForFormAndPrefix = (\n form: Element,\n fieldName: string,\n prefix: string | null\n): string | undefined => findInput(form, fieldName, prefix)?.value;\n\nexport const getMetadataFieldName = (\n fieldName: string,\n prefix: string | null\n): string => `${getInputNameWithoutPrefix(fieldName, prefix)}-metadata`;\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","import escape from \"escape-html\";\nimport { formatBytes } from \"./util.ts\";\n\nclass RenderUploadFile {\n container: Element;\n input: HTMLInputElement;\n translations: Record;\n errors: Element;\n\n constructor({\n parent,\n input,\n skipRequired,\n translations\n }: {\n parent: Element;\n input: HTMLInputElement;\n skipRequired: boolean;\n translations: Record;\n }) {\n this.container = this.createFilesContainer(parent);\n this.errors = this.createErrorContainer(parent);\n this.input = input;\n this.translations = translations;\n\n if (skipRequired) {\n this.input.required = false;\n }\n }\n\n public addNewUpload(filename: string, uploadIndex: number): HTMLElement {\n const div = this.addFile(filename, uploadIndex);\n\n const progressSpan = document.createElement(\"span\");\n progressSpan.className = \"dff-progress\";\n\n const innerSpan = document.createElement(\"span\");\n innerSpan.className = \"dff-progress-inner\";\n\n progressSpan.appendChild(innerSpan);\n div.appendChild(progressSpan);\n\n const cancelLink = document.createElement(\"a\");\n cancelLink.className = \"dff-cancel\";\n cancelLink.innerHTML = this.translations.Cancel ?? \"\";\n cancelLink.setAttribute(\"data-index\", uploadIndex.toString());\n cancelLink.href = \"#\";\n div.appendChild(cancelLink);\n\n return div;\n }\n\n public addUploadedFile(\n filename: string,\n uploadIndex: number,\n filesize?: number\n ): HTMLElement {\n const element = this.addFile(filename, uploadIndex);\n this.setSuccess(uploadIndex, filesize);\n return element;\n }\n\n public clearInput(): void {\n const { input } = this;\n\n input.value = \"\";\n }\n\n public deleteFile(index: number): void {\n const div = this.findFileDiv(index);\n\n if (div) {\n div.remove();\n }\n }\n\n public disableCancel(index: number): void {\n const cancelSpan = this.findCancelSpan(index);\n\n if (cancelSpan) {\n cancelSpan.classList.add(\"dff-disabled\");\n }\n }\n\n public disableDelete(index: number): void {\n const deleteLink = this.findDeleteLink(index);\n\n if (deleteLink) {\n deleteLink.classList.add(\"dff-disabled\");\n }\n }\n\n public findFileDiv(index: number): HTMLElement | null {\n return this.container.querySelector(`.dff-file-id-${index.toString()}`);\n }\n\n public removeDropHint(): void {\n const dropHint = this.container.querySelector(\".dff-drop-hint\");\n\n if (dropHint) {\n dropHint.remove();\n }\n }\n\n public renderDropHint(): void {\n if (this.container.querySelector(\".dff-drop-hint\")) {\n return;\n }\n\n const dropHint = document.createElement(\"div\");\n dropHint.className = \"dff-drop-hint\";\n dropHint.innerHTML = this.translations[\"Drop your files here\"] ?? \"\";\n\n this.container.appendChild(dropHint);\n }\n\n public setDeleteFailed(index: number): void {\n this.setErrorMessage(index, this.translations[\"Delete failed\"] ?? \"\");\n\n this.enableDelete(index);\n }\n\n public setError(index: number): void {\n this.setErrorMessage(index, this.translations[\"Upload failed\"] ?? \"\");\n\n const el = this.findFileDiv(index);\n if (el) {\n el.classList.add(\"dff-upload-fail\");\n }\n\n this.removeProgress(index);\n this.removeCancel(index);\n }\n\n public setErrorInvalidFiles(files: File[]): void {\n const errorsMessages = document.createElement(\"ul\");\n\n for (const file of files) {\n const msg = document.createElement(\"li\");\n const invalidFileTypeMessage =\n this.translations[\"Invalid file type\"] ?? \"\";\n msg.innerText = `${file.name}: ${invalidFileTypeMessage}`;\n msg.className = \"dff-error\";\n errorsMessages.appendChild(msg);\n }\n\n this.errors.replaceChildren(errorsMessages);\n this.clearInput();\n }\n\n public setSuccess(index: number, size?: number): void {\n const { translations } = this;\n\n const el = this.findFileDiv(index);\n if (el) {\n el.classList.add(\"dff-upload-success\");\n\n if (size != null) {\n const fileSizeInfo = document.createElement(\"span\");\n fileSizeInfo.innerHTML = formatBytes(size, 2);\n fileSizeInfo.className = \"dff-filesize\";\n\n el.appendChild(fileSizeInfo);\n }\n\n const deleteLink = document.createElement(\"a\");\n deleteLink.innerHTML = translations.Delete ?? \"\";\n deleteLink.className = \"dff-delete\";\n deleteLink.setAttribute(\"data-index\", index.toString());\n deleteLink.href = \"#\";\n\n el.appendChild(deleteLink);\n }\n\n this.removeProgress(index);\n this.removeCancel(index);\n }\n\n public updateProgress(index: number, percentage: string): void {\n const el = this.container.querySelector(`.dff-file-id-${index.toString()}`);\n if (el) {\n const innerProgressSpan = el.querySelector(\".dff-progress-inner\");\n\n if (innerProgressSpan) {\n (innerProgressSpan as HTMLElement).style.width = `${percentage}%`;\n }\n }\n }\n\n private createErrorContainer = (parent: Element): Element => {\n const div = document.createElement(\"div\");\n div.className = \"dff-invalid-files\";\n parent.appendChild(div);\n return div;\n };\n\n private createFilesContainer = (parent: Element): Element => {\n const div = document.createElement(\"div\");\n div.className = \"dff-files\";\n parent.appendChild(div);\n\n return div;\n };\n\n private addFile(filename: string, uploadIndex: number): HTMLElement {\n const div = document.createElement(\"div\");\n div.className = `dff-file dff-file-id-${uploadIndex.toString()}`;\n\n const nameSpan = document.createElement(\"span\");\n nameSpan.innerHTML = escape(filename);\n nameSpan.className = \"dff-filename\";\n nameSpan.setAttribute(\"data-index\", uploadIndex.toString());\n\n div.appendChild(nameSpan);\n this.container.appendChild(div);\n\n this.input.required = false;\n return div;\n }\n\n private removeProgress(index: number): void {\n const el = this.findFileDiv(index);\n\n if (el) {\n const progressSpan = el.querySelector(\".dff-progress\");\n\n if (progressSpan) {\n progressSpan.remove();\n }\n }\n }\n\n private removeCancel(index: number): void {\n const cancelSpan = this.findCancelSpan(index);\n\n if (cancelSpan) {\n cancelSpan.remove();\n }\n }\n\n private findCancelSpan(index: number): HTMLElement | null {\n const el = this.findFileDiv(index);\n\n if (!el) {\n return null;\n }\n\n return el.querySelector(\".dff-cancel\");\n }\n\n private enableDelete(index: number): void {\n const deleteLink = this.findDeleteLink(index);\n\n if (deleteLink) {\n deleteLink.classList.remove(\"dff-disabled\");\n }\n }\n\n private findDeleteLink(index: number): HTMLElement | null {\n const div = this.findFileDiv(index);\n if (!div) {\n return div;\n }\n\n return div.querySelector(\".dff-delete\");\n }\n\n private setErrorMessage(index: number, message: string): void {\n const el = this.findFileDiv(index);\n if (!el) {\n return;\n }\n\n const originalMessageSpan = el.querySelector(\".dff-error\");\n if (originalMessageSpan) {\n originalMessageSpan.remove();\n }\n\n const span = document.createElement(\"span\");\n span.classList.add(\"dff-error\");\n span.innerHTML = message;\n\n el.appendChild(span);\n }\n}\n\nexport default RenderUploadFile;\n","const types = { \"application/andrew-inset\": [\"ez\"], \"application/appinstaller\": [\"appinstaller\"], \"application/applixware\": [\"aw\"], \"application/appx\": [\"appx\"], \"application/appxbundle\": [\"appxbundle\"], \"application/atom+xml\": [\"atom\"], \"application/atomcat+xml\": [\"atomcat\"], \"application/atomdeleted+xml\": [\"atomdeleted\"], \"application/atomsvc+xml\": [\"atomsvc\"], \"application/atsc-dwd+xml\": [\"dwd\"], \"application/atsc-held+xml\": [\"held\"], \"application/atsc-rsat+xml\": [\"rsat\"], \"application/automationml-aml+xml\": [\"aml\"], \"application/automationml-amlx+zip\": [\"amlx\"], \"application/bdoc\": [\"bdoc\"], \"application/calendar+xml\": [\"xcs\"], \"application/ccxml+xml\": [\"ccxml\"], \"application/cdfx+xml\": [\"cdfx\"], \"application/cdmi-capability\": [\"cdmia\"], \"application/cdmi-container\": [\"cdmic\"], \"application/cdmi-domain\": [\"cdmid\"], \"application/cdmi-object\": [\"cdmio\"], \"application/cdmi-queue\": [\"cdmiq\"], \"application/cpl+xml\": [\"cpl\"], \"application/cu-seeme\": [\"cu\"], \"application/cwl\": [\"cwl\"], \"application/dash+xml\": [\"mpd\"], \"application/dash-patch+xml\": [\"mpp\"], \"application/davmount+xml\": [\"davmount\"], \"application/docbook+xml\": [\"dbk\"], \"application/dssc+der\": [\"dssc\"], \"application/dssc+xml\": [\"xdssc\"], \"application/ecmascript\": [\"ecma\"], \"application/emma+xml\": [\"emma\"], \"application/emotionml+xml\": [\"emotionml\"], \"application/epub+zip\": [\"epub\"], \"application/exi\": [\"exi\"], \"application/express\": [\"exp\"], \"application/fdf\": [\"fdf\"], \"application/fdt+xml\": [\"fdt\"], \"application/font-tdpfr\": [\"pfr\"], \"application/geo+json\": [\"geojson\"], \"application/gml+xml\": [\"gml\"], \"application/gpx+xml\": [\"gpx\"], \"application/gxf\": [\"gxf\"], \"application/gzip\": [\"gz\"], \"application/hjson\": [\"hjson\"], \"application/hyperstudio\": [\"stk\"], \"application/inkml+xml\": [\"ink\", \"inkml\"], \"application/ipfix\": [\"ipfix\"], \"application/its+xml\": [\"its\"], \"application/java-archive\": [\"jar\", \"war\", \"ear\"], \"application/java-serialized-object\": [\"ser\"], \"application/java-vm\": [\"class\"], \"application/javascript\": [\"*js\"], \"application/json\": [\"json\", \"map\"], \"application/json5\": [\"json5\"], \"application/jsonml+json\": [\"jsonml\"], \"application/ld+json\": [\"jsonld\"], \"application/lgr+xml\": [\"lgr\"], \"application/lost+xml\": [\"lostxml\"], \"application/mac-binhex40\": [\"hqx\"], \"application/mac-compactpro\": [\"cpt\"], \"application/mads+xml\": [\"mads\"], \"application/manifest+json\": [\"webmanifest\"], \"application/marc\": [\"mrc\"], \"application/marcxml+xml\": [\"mrcx\"], \"application/mathematica\": [\"ma\", \"nb\", \"mb\"], \"application/mathml+xml\": [\"mathml\"], \"application/mbox\": [\"mbox\"], \"application/media-policy-dataset+xml\": [\"mpf\"], \"application/mediaservercontrol+xml\": [\"mscml\"], \"application/metalink+xml\": [\"metalink\"], \"application/metalink4+xml\": [\"meta4\"], \"application/mets+xml\": [\"mets\"], \"application/mmt-aei+xml\": [\"maei\"], \"application/mmt-usd+xml\": [\"musd\"], \"application/mods+xml\": [\"mods\"], \"application/mp21\": [\"m21\", \"mp21\"], \"application/mp4\": [\"*mp4\", \"*mpg4\", \"mp4s\", \"m4p\"], \"application/msix\": [\"msix\"], \"application/msixbundle\": [\"msixbundle\"], \"application/msword\": [\"doc\", \"dot\"], \"application/mxf\": [\"mxf\"], \"application/n-quads\": [\"nq\"], \"application/n-triples\": [\"nt\"], \"application/node\": [\"cjs\"], \"application/octet-stream\": [\"bin\", \"dms\", \"lrf\", \"mar\", \"so\", \"dist\", \"distz\", \"pkg\", \"bpk\", \"dump\", \"elc\", \"deploy\", \"exe\", \"dll\", \"deb\", \"dmg\", \"iso\", \"img\", \"msi\", \"msp\", \"msm\", \"buffer\"], \"application/oda\": [\"oda\"], \"application/oebps-package+xml\": [\"opf\"], \"application/ogg\": [\"ogx\"], \"application/omdoc+xml\": [\"omdoc\"], \"application/onenote\": [\"onetoc\", \"onetoc2\", \"onetmp\", \"onepkg\"], \"application/oxps\": [\"oxps\"], \"application/p2p-overlay+xml\": [\"relo\"], \"application/patch-ops-error+xml\": [\"xer\"], \"application/pdf\": [\"pdf\"], \"application/pgp-encrypted\": [\"pgp\"], \"application/pgp-keys\": [\"asc\"], \"application/pgp-signature\": [\"sig\", \"*asc\"], \"application/pics-rules\": [\"prf\"], \"application/pkcs10\": [\"p10\"], \"application/pkcs7-mime\": [\"p7m\", \"p7c\"], \"application/pkcs7-signature\": [\"p7s\"], \"application/pkcs8\": [\"p8\"], \"application/pkix-attr-cert\": [\"ac\"], \"application/pkix-cert\": [\"cer\"], \"application/pkix-crl\": [\"crl\"], \"application/pkix-pkipath\": [\"pkipath\"], \"application/pkixcmp\": [\"pki\"], \"application/pls+xml\": [\"pls\"], \"application/postscript\": [\"ai\", \"eps\", \"ps\"], \"application/provenance+xml\": [\"provx\"], \"application/pskc+xml\": [\"pskcxml\"], \"application/raml+yaml\": [\"raml\"], \"application/rdf+xml\": [\"rdf\", \"owl\"], \"application/reginfo+xml\": [\"rif\"], \"application/relax-ng-compact-syntax\": [\"rnc\"], \"application/resource-lists+xml\": [\"rl\"], \"application/resource-lists-diff+xml\": [\"rld\"], \"application/rls-services+xml\": [\"rs\"], \"application/route-apd+xml\": [\"rapd\"], \"application/route-s-tsid+xml\": [\"sls\"], \"application/route-usd+xml\": [\"rusd\"], \"application/rpki-ghostbusters\": [\"gbr\"], \"application/rpki-manifest\": [\"mft\"], \"application/rpki-roa\": [\"roa\"], \"application/rsd+xml\": [\"rsd\"], \"application/rss+xml\": [\"rss\"], \"application/rtf\": [\"rtf\"], \"application/sbml+xml\": [\"sbml\"], \"application/scvp-cv-request\": [\"scq\"], \"application/scvp-cv-response\": [\"scs\"], \"application/scvp-vp-request\": [\"spq\"], \"application/scvp-vp-response\": [\"spp\"], \"application/sdp\": [\"sdp\"], \"application/senml+xml\": [\"senmlx\"], \"application/sensml+xml\": [\"sensmlx\"], \"application/set-payment-initiation\": [\"setpay\"], \"application/set-registration-initiation\": [\"setreg\"], \"application/shf+xml\": [\"shf\"], \"application/sieve\": [\"siv\", \"sieve\"], \"application/smil+xml\": [\"smi\", \"smil\"], \"application/sparql-query\": [\"rq\"], \"application/sparql-results+xml\": [\"srx\"], \"application/sql\": [\"sql\"], \"application/srgs\": [\"gram\"], \"application/srgs+xml\": [\"grxml\"], \"application/sru+xml\": [\"sru\"], \"application/ssdl+xml\": [\"ssdl\"], \"application/ssml+xml\": [\"ssml\"], \"application/swid+xml\": [\"swidtag\"], \"application/tei+xml\": [\"tei\", \"teicorpus\"], \"application/thraud+xml\": [\"tfi\"], \"application/timestamped-data\": [\"tsd\"], \"application/toml\": [\"toml\"], \"application/trig\": [\"trig\"], \"application/ttml+xml\": [\"ttml\"], \"application/ubjson\": [\"ubj\"], \"application/urc-ressheet+xml\": [\"rsheet\"], \"application/urc-targetdesc+xml\": [\"td\"], \"application/voicexml+xml\": [\"vxml\"], \"application/wasm\": [\"wasm\"], \"application/watcherinfo+xml\": [\"wif\"], \"application/widget\": [\"wgt\"], \"application/winhlp\": [\"hlp\"], \"application/wsdl+xml\": [\"wsdl\"], \"application/wspolicy+xml\": [\"wspolicy\"], \"application/xaml+xml\": [\"xaml\"], \"application/xcap-att+xml\": [\"xav\"], \"application/xcap-caps+xml\": [\"xca\"], \"application/xcap-diff+xml\": [\"xdf\"], \"application/xcap-el+xml\": [\"xel\"], \"application/xcap-ns+xml\": [\"xns\"], \"application/xenc+xml\": [\"xenc\"], \"application/xfdf\": [\"xfdf\"], \"application/xhtml+xml\": [\"xhtml\", \"xht\"], \"application/xliff+xml\": [\"xlf\"], \"application/xml\": [\"xml\", \"xsl\", \"xsd\", \"rng\"], \"application/xml-dtd\": [\"dtd\"], \"application/xop+xml\": [\"xop\"], \"application/xproc+xml\": [\"xpl\"], \"application/xslt+xml\": [\"*xsl\", \"xslt\"], \"application/xspf+xml\": [\"xspf\"], \"application/xv+xml\": [\"mxml\", \"xhvml\", \"xvml\", \"xvm\"], \"application/yang\": [\"yang\"], \"application/yin+xml\": [\"yin\"], \"application/zip\": [\"zip\"], \"audio/3gpp\": [\"*3gpp\"], \"audio/aac\": [\"adts\", \"aac\"], \"audio/adpcm\": [\"adp\"], \"audio/amr\": [\"amr\"], \"audio/basic\": [\"au\", \"snd\"], \"audio/midi\": [\"mid\", \"midi\", \"kar\", \"rmi\"], \"audio/mobile-xmf\": [\"mxmf\"], \"audio/mp3\": [\"*mp3\"], \"audio/mp4\": [\"m4a\", \"mp4a\"], \"audio/mpeg\": [\"mpga\", \"mp2\", \"mp2a\", \"mp3\", \"m2a\", \"m3a\"], \"audio/ogg\": [\"oga\", \"ogg\", \"spx\", \"opus\"], \"audio/s3m\": [\"s3m\"], \"audio/silk\": [\"sil\"], \"audio/wav\": [\"wav\"], \"audio/wave\": [\"*wav\"], \"audio/webm\": [\"weba\"], \"audio/xm\": [\"xm\"], \"font/collection\": [\"ttc\"], \"font/otf\": [\"otf\"], \"font/ttf\": [\"ttf\"], \"font/woff\": [\"woff\"], \"font/woff2\": [\"woff2\"], \"image/aces\": [\"exr\"], \"image/apng\": [\"apng\"], \"image/avci\": [\"avci\"], \"image/avcs\": [\"avcs\"], \"image/avif\": [\"avif\"], \"image/bmp\": [\"bmp\", \"dib\"], \"image/cgm\": [\"cgm\"], \"image/dicom-rle\": [\"drle\"], \"image/dpx\": [\"dpx\"], \"image/emf\": [\"emf\"], \"image/fits\": [\"fits\"], \"image/g3fax\": [\"g3\"], \"image/gif\": [\"gif\"], \"image/heic\": [\"heic\"], \"image/heic-sequence\": [\"heics\"], \"image/heif\": [\"heif\"], \"image/heif-sequence\": [\"heifs\"], \"image/hej2k\": [\"hej2\"], \"image/hsj2\": [\"hsj2\"], \"image/ief\": [\"ief\"], \"image/jls\": [\"jls\"], \"image/jp2\": [\"jp2\", \"jpg2\"], \"image/jpeg\": [\"jpeg\", \"jpg\", \"jpe\"], \"image/jph\": [\"jph\"], \"image/jphc\": [\"jhc\"], \"image/jpm\": [\"jpm\", \"jpgm\"], \"image/jpx\": [\"jpx\", \"jpf\"], \"image/jxr\": [\"jxr\"], \"image/jxra\": [\"jxra\"], \"image/jxrs\": [\"jxrs\"], \"image/jxs\": [\"jxs\"], \"image/jxsc\": [\"jxsc\"], \"image/jxsi\": [\"jxsi\"], \"image/jxss\": [\"jxss\"], \"image/ktx\": [\"ktx\"], \"image/ktx2\": [\"ktx2\"], \"image/png\": [\"png\"], \"image/sgi\": [\"sgi\"], \"image/svg+xml\": [\"svg\", \"svgz\"], \"image/t38\": [\"t38\"], \"image/tiff\": [\"tif\", \"tiff\"], \"image/tiff-fx\": [\"tfx\"], \"image/webp\": [\"webp\"], \"image/wmf\": [\"wmf\"], \"message/disposition-notification\": [\"disposition-notification\"], \"message/global\": [\"u8msg\"], \"message/global-delivery-status\": [\"u8dsn\"], \"message/global-disposition-notification\": [\"u8mdn\"], \"message/global-headers\": [\"u8hdr\"], \"message/rfc822\": [\"eml\", \"mime\"], \"model/3mf\": [\"3mf\"], \"model/gltf+json\": [\"gltf\"], \"model/gltf-binary\": [\"glb\"], \"model/iges\": [\"igs\", \"iges\"], \"model/jt\": [\"jt\"], \"model/mesh\": [\"msh\", \"mesh\", \"silo\"], \"model/mtl\": [\"mtl\"], \"model/obj\": [\"obj\"], \"model/prc\": [\"prc\"], \"model/step+xml\": [\"stpx\"], \"model/step+zip\": [\"stpz\"], \"model/step-xml+zip\": [\"stpxz\"], \"model/stl\": [\"stl\"], \"model/u3d\": [\"u3d\"], \"model/vrml\": [\"wrl\", \"vrml\"], \"model/x3d+binary\": [\"*x3db\", \"x3dbz\"], \"model/x3d+fastinfoset\": [\"x3db\"], \"model/x3d+vrml\": [\"*x3dv\", \"x3dvz\"], \"model/x3d+xml\": [\"x3d\", \"x3dz\"], \"model/x3d-vrml\": [\"x3dv\"], \"text/cache-manifest\": [\"appcache\", \"manifest\"], \"text/calendar\": [\"ics\", \"ifb\"], \"text/coffeescript\": [\"coffee\", \"litcoffee\"], \"text/css\": [\"css\"], \"text/csv\": [\"csv\"], \"text/html\": [\"html\", \"htm\", \"shtml\"], \"text/jade\": [\"jade\"], \"text/javascript\": [\"js\", \"mjs\"], \"text/jsx\": [\"jsx\"], \"text/less\": [\"less\"], \"text/markdown\": [\"md\", \"markdown\"], \"text/mathml\": [\"mml\"], \"text/mdx\": [\"mdx\"], \"text/n3\": [\"n3\"], \"text/plain\": [\"txt\", \"text\", \"conf\", \"def\", \"list\", \"log\", \"in\", \"ini\"], \"text/richtext\": [\"rtx\"], \"text/rtf\": [\"*rtf\"], \"text/sgml\": [\"sgml\", \"sgm\"], \"text/shex\": [\"shex\"], \"text/slim\": [\"slim\", \"slm\"], \"text/spdx\": [\"spdx\"], \"text/stylus\": [\"stylus\", \"styl\"], \"text/tab-separated-values\": [\"tsv\"], \"text/troff\": [\"t\", \"tr\", \"roff\", \"man\", \"me\", \"ms\"], \"text/turtle\": [\"ttl\"], \"text/uri-list\": [\"uri\", \"uris\", \"urls\"], \"text/vcard\": [\"vcard\"], \"text/vtt\": [\"vtt\"], \"text/wgsl\": [\"wgsl\"], \"text/xml\": [\"*xml\"], \"text/yaml\": [\"yaml\", \"yml\"], \"video/3gpp\": [\"3gp\", \"3gpp\"], \"video/3gpp2\": [\"3g2\"], \"video/h261\": [\"h261\"], \"video/h263\": [\"h263\"], \"video/h264\": [\"h264\"], \"video/iso.segment\": [\"m4s\"], \"video/jpeg\": [\"jpgv\"], \"video/jpm\": [\"*jpm\", \"*jpgm\"], \"video/mj2\": [\"mj2\", \"mjp2\"], \"video/mp2t\": [\"ts\"], \"video/mp4\": [\"mp4\", \"mp4v\", \"mpg4\"], \"video/mpeg\": [\"mpeg\", \"mpg\", \"mpe\", \"m1v\", \"m2v\"], \"video/ogg\": [\"ogv\"], \"video/quicktime\": [\"qt\", \"mov\"], \"video/webm\": [\"webm\"] };\nObject.freeze(types);\nexport default types;\n//# sourceMappingURL=standard.js.map","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _Mime_extensionToType, _Mime_typeToExtension, _Mime_typeToExtensions;\nclass Mime {\n constructor(...args) {\n _Mime_extensionToType.set(this, new Map());\n _Mime_typeToExtension.set(this, new Map());\n _Mime_typeToExtensions.set(this, new Map());\n for (const arg of args) {\n this.define(arg);\n }\n }\n define(typeMap, force = false) {\n for (let [type, extensions] of Object.entries(typeMap)) {\n type = type.toLowerCase();\n extensions = extensions.map((ext) => ext.toLowerCase());\n if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").has(type)) {\n __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").set(type, new Set());\n }\n const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type);\n let first = true;\n for (let extension of extensions) {\n const starred = extension.startsWith('*');\n extension = starred ? extension.slice(1) : extension;\n allExtensions?.add(extension);\n if (first) {\n __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").set(type, extension);\n }\n first = false;\n if (starred)\n continue;\n const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(extension);\n if (currentType && currentType != type && !force) {\n throw new Error(`\"${type} -> ${extension}\" conflicts with \"${currentType} -> ${extension}\". Pass \\`force=true\\` to override this definition.`);\n }\n __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").set(extension, type);\n }\n }\n return this;\n }\n getType(path) {\n if (typeof path !== 'string')\n return null;\n const last = path.replace(/^.*[/\\\\]/, '').toLowerCase();\n const ext = last.replace(/^.*\\./, '').toLowerCase();\n const hasPath = last.length < path.length;\n const hasDot = ext.length < last.length - 1;\n if (!hasDot && hasPath)\n return null;\n return __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(ext) ?? null;\n }\n getExtension(type) {\n if (typeof type !== 'string')\n return null;\n type = type?.split?.(';')[0];\n return ((type && __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").get(type.trim().toLowerCase())) ?? null);\n }\n getAllExtensions(type) {\n if (typeof type !== 'string')\n return null;\n return __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type.toLowerCase()) ?? null;\n }\n _freeze() {\n this.define = () => {\n throw new Error('define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances');\n };\n Object.freeze(this);\n for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").values()) {\n Object.freeze(extensions);\n }\n return this;\n }\n _getTestState() {\n return {\n types: __classPrivateFieldGet(this, _Mime_extensionToType, \"f\"),\n extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\"),\n };\n }\n}\n_Mime_extensionToType = new WeakMap(), _Mime_typeToExtension = new WeakMap(), _Mime_typeToExtensions = new WeakMap();\nexport default Mime;\n//# sourceMappingURL=Mime.js.map","import standardTypes from '../types/standard.js';\nimport Mime from './Mime.js';\nexport { default as Mime } from './Mime.js';\nexport default new Mime(standardTypes)._freeze();\n//# sourceMappingURL=index_lite.js.map","'use strict';\n\nconst WIN_SLASH = '\\\\\\\\/';\nconst WIN_NO_SLASH = `[^${WIN_SLASH}]`;\n\n/**\n * Posix glob regex\n */\n\nconst DOT_LITERAL = '\\\\.';\nconst PLUS_LITERAL = '\\\\+';\nconst QMARK_LITERAL = '\\\\?';\nconst SLASH_LITERAL = '\\\\/';\nconst ONE_CHAR = '(?=.)';\nconst QMARK = '[^/]';\nconst END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;\nconst START_ANCHOR = `(?:^|${SLASH_LITERAL})`;\nconst DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;\nconst NO_DOT = `(?!${DOT_LITERAL})`;\nconst NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;\nconst NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;\nconst NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;\nconst QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;\nconst STAR = `${QMARK}*?`;\nconst SEP = '/';\n\nconst POSIX_CHARS = {\n DOT_LITERAL,\n PLUS_LITERAL,\n QMARK_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n QMARK,\n END_ANCHOR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOTS,\n NO_DOT_SLASH,\n NO_DOTS_SLASH,\n QMARK_NO_DOT,\n STAR,\n START_ANCHOR,\n SEP\n};\n\n/**\n * Windows glob regex\n */\n\nconst WINDOWS_CHARS = {\n ...POSIX_CHARS,\n\n SLASH_LITERAL: `[${WIN_SLASH}]`,\n QMARK: WIN_NO_SLASH,\n STAR: `${WIN_NO_SLASH}*?`,\n DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,\n NO_DOT: `(?!${DOT_LITERAL})`,\n NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,\n NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n QMARK_NO_DOT: `[^.${WIN_SLASH}]`,\n START_ANCHOR: `(?:^|[${WIN_SLASH}])`,\n END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,\n SEP: '\\\\'\n};\n\n/**\n * POSIX Bracket Regex\n */\n\nconst POSIX_REGEX_SOURCE = {\n alnum: 'a-zA-Z0-9',\n alpha: 'a-zA-Z',\n ascii: '\\\\x00-\\\\x7F',\n blank: ' \\\\t',\n cntrl: '\\\\x00-\\\\x1F\\\\x7F',\n digit: '0-9',\n graph: '\\\\x21-\\\\x7E',\n lower: 'a-z',\n print: '\\\\x20-\\\\x7E ',\n punct: '\\\\-!\"#$%&\\'()\\\\*+,./:;<=>?@[\\\\]^_`{|}~',\n space: ' \\\\t\\\\r\\\\n\\\\v\\\\f',\n upper: 'A-Z',\n word: 'A-Za-z0-9_',\n xdigit: 'A-Fa-f0-9'\n};\n\nmodule.exports = {\n MAX_LENGTH: 1024 * 64,\n POSIX_REGEX_SOURCE,\n\n // regular expressions\n REGEX_BACKSLASH: /\\\\(?![*+?^${}(|)[\\]])/g,\n REGEX_NON_SPECIAL_CHARS: /^[^@![\\].,$*+?^{}()|\\\\/]+/,\n REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\\]]/,\n REGEX_SPECIAL_CHARS_BACKREF: /(\\\\?)((\\W)(\\3*))/g,\n REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\\]])/g,\n REGEX_REMOVE_BACKSLASH: /(?:\\[.*?[^\\\\]\\]|\\\\(?=.))/g,\n\n // Replace globs with equivalent patterns to reduce parsing time.\n REPLACEMENTS: {\n '***': '*',\n '**/**': '**',\n '**/**/**': '**'\n },\n\n // Digits\n CHAR_0: 48, /* 0 */\n CHAR_9: 57, /* 9 */\n\n // Alphabet chars.\n CHAR_UPPERCASE_A: 65, /* A */\n CHAR_LOWERCASE_A: 97, /* a */\n CHAR_UPPERCASE_Z: 90, /* Z */\n CHAR_LOWERCASE_Z: 122, /* z */\n\n CHAR_LEFT_PARENTHESES: 40, /* ( */\n CHAR_RIGHT_PARENTHESES: 41, /* ) */\n\n CHAR_ASTERISK: 42, /* * */\n\n // Non-alphabetic chars.\n CHAR_AMPERSAND: 38, /* & */\n CHAR_AT: 64, /* @ */\n CHAR_BACKWARD_SLASH: 92, /* \\ */\n CHAR_CARRIAGE_RETURN: 13, /* \\r */\n CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */\n CHAR_COLON: 58, /* : */\n CHAR_COMMA: 44, /* , */\n CHAR_DOT: 46, /* . */\n CHAR_DOUBLE_QUOTE: 34, /* \" */\n CHAR_EQUAL: 61, /* = */\n CHAR_EXCLAMATION_MARK: 33, /* ! */\n CHAR_FORM_FEED: 12, /* \\f */\n CHAR_FORWARD_SLASH: 47, /* / */\n CHAR_GRAVE_ACCENT: 96, /* ` */\n CHAR_HASH: 35, /* # */\n CHAR_HYPHEN_MINUS: 45, /* - */\n CHAR_LEFT_ANGLE_BRACKET: 60, /* < */\n CHAR_LEFT_CURLY_BRACE: 123, /* { */\n CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */\n CHAR_LINE_FEED: 10, /* \\n */\n CHAR_NO_BREAK_SPACE: 160, /* \\u00A0 */\n CHAR_PERCENT: 37, /* % */\n CHAR_PLUS: 43, /* + */\n CHAR_QUESTION_MARK: 63, /* ? */\n CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */\n CHAR_RIGHT_CURLY_BRACE: 125, /* } */\n CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */\n CHAR_SEMICOLON: 59, /* ; */\n CHAR_SINGLE_QUOTE: 39, /* ' */\n CHAR_SPACE: 32, /* */\n CHAR_TAB: 9, /* \\t */\n CHAR_UNDERSCORE: 95, /* _ */\n CHAR_VERTICAL_LINE: 124, /* | */\n CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \\uFEFF */\n\n /**\n * Create EXTGLOB_CHARS\n */\n\n extglobChars(chars) {\n return {\n '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },\n '?': { type: 'qmark', open: '(?:', close: ')?' },\n '+': { type: 'plus', open: '(?:', close: ')+' },\n '*': { type: 'star', open: '(?:', close: ')*' },\n '@': { type: 'at', open: '(?:', close: ')' }\n };\n },\n\n /**\n * Create GLOB_CHARS\n */\n\n globChars(win32) {\n return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;\n }\n};\n","/*global navigator*/\n'use strict';\n\nconst {\n REGEX_BACKSLASH,\n REGEX_REMOVE_BACKSLASH,\n REGEX_SPECIAL_CHARS,\n REGEX_SPECIAL_CHARS_GLOBAL\n} = require('./constants');\n\nexports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);\nexports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);\nexports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);\nexports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\\\$1');\nexports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');\n\nexports.isWindows = () => {\n if (typeof navigator !== 'undefined' && navigator.platform) {\n const platform = navigator.platform.toLowerCase();\n return platform === 'win32' || platform === 'windows';\n }\n\n if (typeof process !== 'undefined' && process.platform) {\n return process.platform === 'win32';\n }\n\n return false;\n};\n\nexports.removeBackslashes = str => {\n return str.replace(REGEX_REMOVE_BACKSLASH, match => {\n return match === '\\\\' ? '' : match;\n });\n};\n\nexports.escapeLast = (input, char, lastIdx) => {\n const idx = input.lastIndexOf(char, lastIdx);\n if (idx === -1) return input;\n if (input[idx - 1] === '\\\\') return exports.escapeLast(input, char, idx - 1);\n return `${input.slice(0, idx)}\\\\${input.slice(idx)}`;\n};\n\nexports.removePrefix = (input, state = {}) => {\n let output = input;\n if (output.startsWith('./')) {\n output = output.slice(2);\n state.prefix = './';\n }\n return output;\n};\n\nexports.wrapOutput = (input, state = {}, options = {}) => {\n const prepend = options.contains ? '' : '^';\n const append = options.contains ? '' : '$';\n\n let output = `${prepend}(?:${input})${append}`;\n if (state.negated === true) {\n output = `(?:^(?!${output}).*$)`;\n }\n return output;\n};\n\nexports.basename = (path, { windows } = {}) => {\n const segs = path.split(windows ? /[\\\\/]/ : '/');\n const last = segs[segs.length - 1];\n\n if (last === '') {\n return segs[segs.length - 2];\n }\n\n return last;\n};\n","'use strict';\n\nconst utils = require('./utils');\nconst {\n CHAR_ASTERISK, /* * */\n CHAR_AT, /* @ */\n CHAR_BACKWARD_SLASH, /* \\ */\n CHAR_COMMA, /* , */\n CHAR_DOT, /* . */\n CHAR_EXCLAMATION_MARK, /* ! */\n CHAR_FORWARD_SLASH, /* / */\n CHAR_LEFT_CURLY_BRACE, /* { */\n CHAR_LEFT_PARENTHESES, /* ( */\n CHAR_LEFT_SQUARE_BRACKET, /* [ */\n CHAR_PLUS, /* + */\n CHAR_QUESTION_MARK, /* ? */\n CHAR_RIGHT_CURLY_BRACE, /* } */\n CHAR_RIGHT_PARENTHESES, /* ) */\n CHAR_RIGHT_SQUARE_BRACKET /* ] */\n} = require('./constants');\n\nconst isPathSeparator = code => {\n return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n};\n\nconst depth = token => {\n if (token.isPrefix !== true) {\n token.depth = token.isGlobstar ? Infinity : 1;\n }\n};\n\n/**\n * Quickly scans a glob pattern and returns an object with a handful of\n * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),\n * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not\n * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).\n *\n * ```js\n * const pm = require('picomatch');\n * console.log(pm.scan('foo/bar/*.js'));\n * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }\n * ```\n * @param {String} `str`\n * @param {Object} `options`\n * @return {Object} Returns an object with tokens and regex source string.\n * @api public\n */\n\nconst scan = (input, options) => {\n const opts = options || {};\n\n const length = input.length - 1;\n const scanToEnd = opts.parts === true || opts.scanToEnd === true;\n const slashes = [];\n const tokens = [];\n const parts = [];\n\n let str = input;\n let index = -1;\n let start = 0;\n let lastIndex = 0;\n let isBrace = false;\n let isBracket = false;\n let isGlob = false;\n let isExtglob = false;\n let isGlobstar = false;\n let braceEscaped = false;\n let backslashes = false;\n let negated = false;\n let negatedExtglob = false;\n let finished = false;\n let braces = 0;\n let prev;\n let code;\n let token = { value: '', depth: 0, isGlob: false };\n\n const eos = () => index >= length;\n const peek = () => str.charCodeAt(index + 1);\n const advance = () => {\n prev = code;\n return str.charCodeAt(++index);\n };\n\n while (index < length) {\n code = advance();\n let next;\n\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braceEscaped = true;\n }\n continue;\n }\n\n if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n continue;\n }\n\n if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (braceEscaped !== true && code === CHAR_COMMA) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_RIGHT_CURLY_BRACE) {\n braces--;\n\n if (braces === 0) {\n braceEscaped = false;\n isBrace = token.isBrace = true;\n finished = true;\n break;\n }\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_FORWARD_SLASH) {\n slashes.push(index);\n tokens.push(token);\n token = { value: '', depth: 0, isGlob: false };\n\n if (finished === true) continue;\n if (prev === CHAR_DOT && index === (start + 1)) {\n start += 2;\n continue;\n }\n\n lastIndex = index + 1;\n continue;\n }\n\n if (opts.noext !== true) {\n const isExtglobChar = code === CHAR_PLUS\n || code === CHAR_AT\n || code === CHAR_ASTERISK\n || code === CHAR_QUESTION_MARK\n || code === CHAR_EXCLAMATION_MARK;\n\n if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n isExtglob = token.isExtglob = true;\n finished = true;\n if (code === CHAR_EXCLAMATION_MARK && index === start) {\n negatedExtglob = true;\n }\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n }\n\n if (code === CHAR_ASTERISK) {\n if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_QUESTION_MARK) {\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_LEFT_SQUARE_BRACKET) {\n while (eos() !== true && (next = advance())) {\n if (next === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (next === CHAR_RIGHT_SQUARE_BRACKET) {\n isBracket = token.isBracket = true;\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {\n negated = token.negated = true;\n start++;\n continue;\n }\n\n if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_LEFT_PARENTHESES) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n\n if (isGlob === true) {\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n }\n\n if (opts.noext === true) {\n isExtglob = false;\n isGlob = false;\n }\n\n let base = str;\n let prefix = '';\n let glob = '';\n\n if (start > 0) {\n prefix = str.slice(0, start);\n str = str.slice(start);\n lastIndex -= start;\n }\n\n if (base && isGlob === true && lastIndex > 0) {\n base = str.slice(0, lastIndex);\n glob = str.slice(lastIndex);\n } else if (isGlob === true) {\n base = '';\n glob = str;\n } else {\n base = str;\n }\n\n if (base && base !== '' && base !== '/' && base !== str) {\n if (isPathSeparator(base.charCodeAt(base.length - 1))) {\n base = base.slice(0, -1);\n }\n }\n\n if (opts.unescape === true) {\n if (glob) glob = utils.removeBackslashes(glob);\n\n if (base && backslashes === true) {\n base = utils.removeBackslashes(base);\n }\n }\n\n const state = {\n prefix,\n input,\n start,\n base,\n glob,\n isBrace,\n isBracket,\n isGlob,\n isExtglob,\n isGlobstar,\n negated,\n negatedExtglob\n };\n\n if (opts.tokens === true) {\n state.maxDepth = 0;\n if (!isPathSeparator(code)) {\n tokens.push(token);\n }\n state.tokens = tokens;\n }\n\n if (opts.parts === true || opts.tokens === true) {\n let prevIndex;\n\n for (let idx = 0; idx < slashes.length; idx++) {\n const n = prevIndex ? prevIndex + 1 : start;\n const i = slashes[idx];\n const value = input.slice(n, i);\n if (opts.tokens) {\n if (idx === 0 && start !== 0) {\n tokens[idx].isPrefix = true;\n tokens[idx].value = prefix;\n } else {\n tokens[idx].value = value;\n }\n depth(tokens[idx]);\n state.maxDepth += tokens[idx].depth;\n }\n if (idx !== 0 || value !== '') {\n parts.push(value);\n }\n prevIndex = i;\n }\n\n if (prevIndex && prevIndex + 1 < input.length) {\n const value = input.slice(prevIndex + 1);\n parts.push(value);\n\n if (opts.tokens) {\n tokens[tokens.length - 1].value = value;\n depth(tokens[tokens.length - 1]);\n state.maxDepth += tokens[tokens.length - 1].depth;\n }\n }\n\n state.slashes = slashes;\n state.parts = parts;\n }\n\n return state;\n};\n\nmodule.exports = scan;\n","'use strict';\n\nconst constants = require('./constants');\nconst utils = require('./utils');\n\n/**\n * Constants\n */\n\nconst {\n MAX_LENGTH,\n POSIX_REGEX_SOURCE,\n REGEX_NON_SPECIAL_CHARS,\n REGEX_SPECIAL_CHARS_BACKREF,\n REPLACEMENTS\n} = constants;\n\n/**\n * Helpers\n */\n\nconst expandRange = (args, options) => {\n if (typeof options.expandRange === 'function') {\n return options.expandRange(...args, options);\n }\n\n args.sort();\n const value = `[${args.join('-')}]`;\n\n try {\n /* eslint-disable-next-line no-new */\n new RegExp(value);\n } catch (ex) {\n return args.map(v => utils.escapeRegex(v)).join('..');\n }\n\n return value;\n};\n\n/**\n * Create the message for a syntax error\n */\n\nconst syntaxError = (type, char) => {\n return `Missing ${type}: \"${char}\" - use \"\\\\\\\\${char}\" to match literal characters`;\n};\n\n/**\n * Parse the given input string.\n * @param {String} input\n * @param {Object} options\n * @return {Object}\n */\n\nconst parse = (input, options) => {\n if (typeof input !== 'string') {\n throw new TypeError('Expected a string');\n }\n\n input = REPLACEMENTS[input] || input;\n\n const opts = { ...options };\n const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n\n let len = input.length;\n if (len > max) {\n throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n }\n\n const bos = { type: 'bos', value: '', output: opts.prepend || '' };\n const tokens = [bos];\n\n const capture = opts.capture ? '' : '?:';\n\n // create constants based on platform, for windows or posix\n const PLATFORM_CHARS = constants.globChars(opts.windows);\n const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);\n\n const {\n DOT_LITERAL,\n PLUS_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOT_SLASH,\n NO_DOTS_SLASH,\n QMARK,\n QMARK_NO_DOT,\n STAR,\n START_ANCHOR\n } = PLATFORM_CHARS;\n\n const globstar = opts => {\n return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n };\n\n const nodot = opts.dot ? '' : NO_DOT;\n const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;\n let star = opts.bash === true ? globstar(opts) : STAR;\n\n if (opts.capture) {\n star = `(${star})`;\n }\n\n // minimatch options support\n if (typeof opts.noext === 'boolean') {\n opts.noextglob = opts.noext;\n }\n\n const state = {\n input,\n index: -1,\n start: 0,\n dot: opts.dot === true,\n consumed: '',\n output: '',\n prefix: '',\n backtrack: false,\n negated: false,\n brackets: 0,\n braces: 0,\n parens: 0,\n quotes: 0,\n globstar: false,\n tokens\n };\n\n input = utils.removePrefix(input, state);\n len = input.length;\n\n const extglobs = [];\n const braces = [];\n const stack = [];\n let prev = bos;\n let value;\n\n /**\n * Tokenizing helpers\n */\n\n const eos = () => state.index === len - 1;\n const peek = state.peek = (n = 1) => input[state.index + n];\n const advance = state.advance = () => input[++state.index] || '';\n const remaining = () => input.slice(state.index + 1);\n const consume = (value = '', num = 0) => {\n state.consumed += value;\n state.index += num;\n };\n\n const append = token => {\n state.output += token.output != null ? token.output : token.value;\n consume(token.value);\n };\n\n const negate = () => {\n let count = 1;\n\n while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {\n advance();\n state.start++;\n count++;\n }\n\n if (count % 2 === 0) {\n return false;\n }\n\n state.negated = true;\n state.start++;\n return true;\n };\n\n const increment = type => {\n state[type]++;\n stack.push(type);\n };\n\n const decrement = type => {\n state[type]--;\n stack.pop();\n };\n\n /**\n * Push tokens onto the tokens array. This helper speeds up\n * tokenizing by 1) helping us avoid backtracking as much as possible,\n * and 2) helping us avoid creating extra tokens when consecutive\n * characters are plain text. This improves performance and simplifies\n * lookbehinds.\n */\n\n const push = tok => {\n if (prev.type === 'globstar') {\n const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');\n const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));\n\n if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {\n state.output = state.output.slice(0, -prev.output.length);\n prev.type = 'star';\n prev.value = '*';\n prev.output = star;\n state.output += prev.output;\n }\n }\n\n if (extglobs.length && tok.type !== 'paren') {\n extglobs[extglobs.length - 1].inner += tok.value;\n }\n\n if (tok.value || tok.output) append(tok);\n if (prev && prev.type === 'text' && tok.type === 'text') {\n prev.output = (prev.output || prev.value) + tok.value;\n prev.value += tok.value;\n return;\n }\n\n tok.prev = prev;\n tokens.push(tok);\n prev = tok;\n };\n\n const extglobOpen = (type, value) => {\n const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };\n\n token.prev = prev;\n token.parens = state.parens;\n token.output = state.output;\n const output = (opts.capture ? '(' : '') + token.open;\n\n increment('parens');\n push({ type, value, output: state.output ? '' : ONE_CHAR });\n push({ type: 'paren', extglob: true, value: advance(), output });\n extglobs.push(token);\n };\n\n const extglobClose = token => {\n let output = token.close + (opts.capture ? ')' : '');\n let rest;\n\n if (token.type === 'negate') {\n let extglobStar = star;\n\n if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {\n extglobStar = globstar(opts);\n }\n\n if (extglobStar !== star || eos() || /^\\)+$/.test(remaining())) {\n output = token.close = `)$))${extglobStar}`;\n }\n\n if (token.inner.includes('*') && (rest = remaining()) && /^\\.[^\\\\/.]+$/.test(rest)) {\n // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.\n // In this case, we need to parse the string and use it in the output of the original pattern.\n // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.\n //\n // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.\n const expression = parse(rest, { ...options, fastpaths: false }).output;\n\n output = token.close = `)${expression})${extglobStar})`;\n }\n\n if (token.prev.type === 'bos') {\n state.negatedExtglob = true;\n }\n }\n\n push({ type: 'paren', extglob: true, value, output });\n decrement('parens');\n };\n\n /**\n * Fast paths\n */\n\n if (opts.fastpaths !== false && !/(^[*!]|[/()[\\]{}\"])/.test(input)) {\n let backslashes = false;\n\n let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {\n if (first === '\\\\') {\n backslashes = true;\n return m;\n }\n\n if (first === '?') {\n if (esc) {\n return esc + first + (rest ? QMARK.repeat(rest.length) : '');\n }\n if (index === 0) {\n return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');\n }\n return QMARK.repeat(chars.length);\n }\n\n if (first === '.') {\n return DOT_LITERAL.repeat(chars.length);\n }\n\n if (first === '*') {\n if (esc) {\n return esc + first + (rest ? star : '');\n }\n return star;\n }\n return esc ? m : `\\\\${m}`;\n });\n\n if (backslashes === true) {\n if (opts.unescape === true) {\n output = output.replace(/\\\\/g, '');\n } else {\n output = output.replace(/\\\\+/g, m => {\n return m.length % 2 === 0 ? '\\\\\\\\' : (m ? '\\\\' : '');\n });\n }\n }\n\n if (output === input && opts.contains === true) {\n state.output = input;\n return state;\n }\n\n state.output = utils.wrapOutput(output, state, options);\n return state;\n }\n\n /**\n * Tokenize input until we reach end-of-string\n */\n\n while (!eos()) {\n value = advance();\n\n if (value === '\\u0000') {\n continue;\n }\n\n /**\n * Escaped characters\n */\n\n if (value === '\\\\') {\n const next = peek();\n\n if (next === '/' && opts.bash !== true) {\n continue;\n }\n\n if (next === '.' || next === ';') {\n continue;\n }\n\n if (!next) {\n value += '\\\\';\n push({ type: 'text', value });\n continue;\n }\n\n // collapse slashes to reduce potential for exploits\n const match = /^\\\\+/.exec(remaining());\n let slashes = 0;\n\n if (match && match[0].length > 2) {\n slashes = match[0].length;\n state.index += slashes;\n if (slashes % 2 !== 0) {\n value += '\\\\';\n }\n }\n\n if (opts.unescape === true) {\n value = advance();\n } else {\n value += advance();\n }\n\n if (state.brackets === 0) {\n push({ type: 'text', value });\n continue;\n }\n }\n\n /**\n * If we're inside a regex character class, continue\n * until we reach the closing bracket.\n */\n\n if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {\n if (opts.posix !== false && value === ':') {\n const inner = prev.value.slice(1);\n if (inner.includes('[')) {\n prev.posix = true;\n\n if (inner.includes(':')) {\n const idx = prev.value.lastIndexOf('[');\n const pre = prev.value.slice(0, idx);\n const rest = prev.value.slice(idx + 2);\n const posix = POSIX_REGEX_SOURCE[rest];\n if (posix) {\n prev.value = pre + posix;\n state.backtrack = true;\n advance();\n\n if (!bos.output && tokens.indexOf(prev) === 1) {\n bos.output = ONE_CHAR;\n }\n continue;\n }\n }\n }\n }\n\n if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {\n value = `\\\\${value}`;\n }\n\n if (value === ']' && (prev.value === '[' || prev.value === '[^')) {\n value = `\\\\${value}`;\n }\n\n if (opts.posix === true && value === '!' && prev.value === '[') {\n value = '^';\n }\n\n prev.value += value;\n append({ value });\n continue;\n }\n\n /**\n * If we're inside a quoted string, continue\n * until we reach the closing double quote.\n */\n\n if (state.quotes === 1 && value !== '\"') {\n value = utils.escapeRegex(value);\n prev.value += value;\n append({ value });\n continue;\n }\n\n /**\n * Double quotes\n */\n\n if (value === '\"') {\n state.quotes = state.quotes === 1 ? 0 : 1;\n if (opts.keepQuotes === true) {\n push({ type: 'text', value });\n }\n continue;\n }\n\n /**\n * Parentheses\n */\n\n if (value === '(') {\n increment('parens');\n push({ type: 'paren', value });\n continue;\n }\n\n if (value === ')') {\n if (state.parens === 0 && opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('opening', '('));\n }\n\n const extglob = extglobs[extglobs.length - 1];\n if (extglob && state.parens === extglob.parens + 1) {\n extglobClose(extglobs.pop());\n continue;\n }\n\n push({ type: 'paren', value, output: state.parens ? ')' : '\\\\)' });\n decrement('parens');\n continue;\n }\n\n /**\n * Square brackets\n */\n\n if (value === '[') {\n if (opts.nobracket === true || !remaining().includes(']')) {\n if (opts.nobracket !== true && opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('closing', ']'));\n }\n\n value = `\\\\${value}`;\n } else {\n increment('brackets');\n }\n\n push({ type: 'bracket', value });\n continue;\n }\n\n if (value === ']') {\n if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {\n push({ type: 'text', value, output: `\\\\${value}` });\n continue;\n }\n\n if (state.brackets === 0) {\n if (opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('opening', '['));\n }\n\n push({ type: 'text', value, output: `\\\\${value}` });\n continue;\n }\n\n decrement('brackets');\n\n const prevValue = prev.value.slice(1);\n if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {\n value = `/${value}`;\n }\n\n prev.value += value;\n append({ value });\n\n // when literal brackets are explicitly disabled\n // assume we should match with a regex character class\n if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {\n continue;\n }\n\n const escaped = utils.escapeRegex(prev.value);\n state.output = state.output.slice(0, -prev.value.length);\n\n // when literal brackets are explicitly enabled\n // assume we should escape the brackets to match literal characters\n if (opts.literalBrackets === true) {\n state.output += escaped;\n prev.value = escaped;\n continue;\n }\n\n // when the user specifies nothing, try to match both\n prev.value = `(${capture}${escaped}|${prev.value})`;\n state.output += prev.value;\n continue;\n }\n\n /**\n * Braces\n */\n\n if (value === '{' && opts.nobrace !== true) {\n increment('braces');\n\n const open = {\n type: 'brace',\n value,\n output: '(',\n outputIndex: state.output.length,\n tokensIndex: state.tokens.length\n };\n\n braces.push(open);\n push(open);\n continue;\n }\n\n if (value === '}') {\n const brace = braces[braces.length - 1];\n\n if (opts.nobrace === true || !brace) {\n push({ type: 'text', value, output: value });\n continue;\n }\n\n let output = ')';\n\n if (brace.dots === true) {\n const arr = tokens.slice();\n const range = [];\n\n for (let i = arr.length - 1; i >= 0; i--) {\n tokens.pop();\n if (arr[i].type === 'brace') {\n break;\n }\n if (arr[i].type !== 'dots') {\n range.unshift(arr[i].value);\n }\n }\n\n output = expandRange(range, opts);\n state.backtrack = true;\n }\n\n if (brace.comma !== true && brace.dots !== true) {\n const out = state.output.slice(0, brace.outputIndex);\n const toks = state.tokens.slice(brace.tokensIndex);\n brace.value = brace.output = '\\\\{';\n value = output = '\\\\}';\n state.output = out;\n for (const t of toks) {\n state.output += (t.output || t.value);\n }\n }\n\n push({ type: 'brace', value, output });\n decrement('braces');\n braces.pop();\n continue;\n }\n\n /**\n * Pipes\n */\n\n if (value === '|') {\n if (extglobs.length > 0) {\n extglobs[extglobs.length - 1].conditions++;\n }\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Commas\n */\n\n if (value === ',') {\n let output = value;\n\n const brace = braces[braces.length - 1];\n if (brace && stack[stack.length - 1] === 'braces') {\n brace.comma = true;\n output = '|';\n }\n\n push({ type: 'comma', value, output });\n continue;\n }\n\n /**\n * Slashes\n */\n\n if (value === '/') {\n // if the beginning of the glob is \"./\", advance the start\n // to the current index, and don't add the \"./\" characters\n // to the state. This greatly simplifies lookbehinds when\n // checking for BOS characters like \"!\" and \".\" (not \"./\")\n if (prev.type === 'dot' && state.index === state.start + 1) {\n state.start = state.index + 1;\n state.consumed = '';\n state.output = '';\n tokens.pop();\n prev = bos; // reset \"prev\" to the first token\n continue;\n }\n\n push({ type: 'slash', value, output: SLASH_LITERAL });\n continue;\n }\n\n /**\n * Dots\n */\n\n if (value === '.') {\n if (state.braces > 0 && prev.type === 'dot') {\n if (prev.value === '.') prev.output = DOT_LITERAL;\n const brace = braces[braces.length - 1];\n prev.type = 'dots';\n prev.output += value;\n prev.value += value;\n brace.dots = true;\n continue;\n }\n\n if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {\n push({ type: 'text', value, output: DOT_LITERAL });\n continue;\n }\n\n push({ type: 'dot', value, output: DOT_LITERAL });\n continue;\n }\n\n /**\n * Question marks\n */\n\n if (value === '?') {\n const isGroup = prev && prev.value === '(';\n if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n extglobOpen('qmark', value);\n continue;\n }\n\n if (prev && prev.type === 'paren') {\n const next = peek();\n let output = value;\n\n if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\\w+>)/.test(remaining()))) {\n output = `\\\\${value}`;\n }\n\n push({ type: 'text', value, output });\n continue;\n }\n\n if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {\n push({ type: 'qmark', value, output: QMARK_NO_DOT });\n continue;\n }\n\n push({ type: 'qmark', value, output: QMARK });\n continue;\n }\n\n /**\n * Exclamation\n */\n\n if (value === '!') {\n if (opts.noextglob !== true && peek() === '(') {\n if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {\n extglobOpen('negate', value);\n continue;\n }\n }\n\n if (opts.nonegate !== true && state.index === 0) {\n negate();\n continue;\n }\n }\n\n /**\n * Plus\n */\n\n if (value === '+') {\n if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n extglobOpen('plus', value);\n continue;\n }\n\n if ((prev && prev.value === '(') || opts.regex === false) {\n push({ type: 'plus', value, output: PLUS_LITERAL });\n continue;\n }\n\n if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {\n push({ type: 'plus', value });\n continue;\n }\n\n push({ type: 'plus', value: PLUS_LITERAL });\n continue;\n }\n\n /**\n * Plain text\n */\n\n if (value === '@') {\n if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n push({ type: 'at', extglob: true, value, output: '' });\n continue;\n }\n\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Plain text\n */\n\n if (value !== '*') {\n if (value === '$' || value === '^') {\n value = `\\\\${value}`;\n }\n\n const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());\n if (match) {\n value += match[0];\n state.index += match[0].length;\n }\n\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Stars\n */\n\n if (prev && (prev.type === 'globstar' || prev.star === true)) {\n prev.type = 'star';\n prev.star = true;\n prev.value += value;\n prev.output = star;\n state.backtrack = true;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n let rest = remaining();\n if (opts.noextglob !== true && /^\\([^?]/.test(rest)) {\n extglobOpen('star', value);\n continue;\n }\n\n if (prev.type === 'star') {\n if (opts.noglobstar === true) {\n consume(value);\n continue;\n }\n\n const prior = prev.prev;\n const before = prior.prev;\n const isStart = prior.type === 'slash' || prior.type === 'bos';\n const afterStar = before && (before.type === 'star' || before.type === 'globstar');\n\n if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {\n push({ type: 'star', value, output: '' });\n continue;\n }\n\n const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');\n const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');\n if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {\n push({ type: 'star', value, output: '' });\n continue;\n }\n\n // strip consecutive `/**/`\n while (rest.slice(0, 3) === '/**') {\n const after = input[state.index + 4];\n if (after && after !== '/') {\n break;\n }\n rest = rest.slice(3);\n consume('/**', 3);\n }\n\n if (prior.type === 'bos' && eos()) {\n prev.type = 'globstar';\n prev.value += value;\n prev.output = globstar(opts);\n state.output = prev.output;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {\n state.output = state.output.slice(0, -(prior.output + prev.output).length);\n prior.output = `(?:${prior.output}`;\n\n prev.type = 'globstar';\n prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');\n prev.value += value;\n state.globstar = true;\n state.output += prior.output + prev.output;\n consume(value);\n continue;\n }\n\n if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {\n const end = rest[1] !== void 0 ? '|$' : '';\n\n state.output = state.output.slice(0, -(prior.output + prev.output).length);\n prior.output = `(?:${prior.output}`;\n\n prev.type = 'globstar';\n prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;\n prev.value += value;\n\n state.output += prior.output + prev.output;\n state.globstar = true;\n\n consume(value + advance());\n\n push({ type: 'slash', value: '/', output: '' });\n continue;\n }\n\n if (prior.type === 'bos' && rest[0] === '/') {\n prev.type = 'globstar';\n prev.value += value;\n prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;\n state.output = prev.output;\n state.globstar = true;\n consume(value + advance());\n push({ type: 'slash', value: '/', output: '' });\n continue;\n }\n\n // remove single star from output\n state.output = state.output.slice(0, -prev.output.length);\n\n // reset previous token to globstar\n prev.type = 'globstar';\n prev.output = globstar(opts);\n prev.value += value;\n\n // reset output with globstar\n state.output += prev.output;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n const token = { type: 'star', value, output: star };\n\n if (opts.bash === true) {\n token.output = '.*?';\n if (prev.type === 'bos' || prev.type === 'slash') {\n token.output = nodot + token.output;\n }\n push(token);\n continue;\n }\n\n if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {\n token.output = value;\n push(token);\n continue;\n }\n\n if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {\n if (prev.type === 'dot') {\n state.output += NO_DOT_SLASH;\n prev.output += NO_DOT_SLASH;\n\n } else if (opts.dot === true) {\n state.output += NO_DOTS_SLASH;\n prev.output += NO_DOTS_SLASH;\n\n } else {\n state.output += nodot;\n prev.output += nodot;\n }\n\n if (peek() !== '*') {\n state.output += ONE_CHAR;\n prev.output += ONE_CHAR;\n }\n }\n\n push(token);\n }\n\n while (state.brackets > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));\n state.output = utils.escapeLast(state.output, '[');\n decrement('brackets');\n }\n\n while (state.parens > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));\n state.output = utils.escapeLast(state.output, '(');\n decrement('parens');\n }\n\n while (state.braces > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));\n state.output = utils.escapeLast(state.output, '{');\n decrement('braces');\n }\n\n if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {\n push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });\n }\n\n // rebuild the output if we had to backtrack at any point\n if (state.backtrack === true) {\n state.output = '';\n\n for (const token of state.tokens) {\n state.output += token.output != null ? token.output : token.value;\n\n if (token.suffix) {\n state.output += token.suffix;\n }\n }\n }\n\n return state;\n};\n\n/**\n * Fast paths for creating regular expressions for common glob patterns.\n * This can significantly speed up processing and has very little downside\n * impact when none of the fast paths match.\n */\n\nparse.fastpaths = (input, options) => {\n const opts = { ...options };\n const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n const len = input.length;\n if (len > max) {\n throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n }\n\n input = REPLACEMENTS[input] || input;\n\n // create constants based on platform, for windows or posix\n const {\n DOT_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOTS,\n NO_DOTS_SLASH,\n STAR,\n START_ANCHOR\n } = constants.globChars(opts.windows);\n\n const nodot = opts.dot ? NO_DOTS : NO_DOT;\n const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;\n const capture = opts.capture ? '' : '?:';\n const state = { negated: false, prefix: '' };\n let star = opts.bash === true ? '.*?' : STAR;\n\n if (opts.capture) {\n star = `(${star})`;\n }\n\n const globstar = opts => {\n if (opts.noglobstar === true) return star;\n return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n };\n\n const create = str => {\n switch (str) {\n case '*':\n return `${nodot}${ONE_CHAR}${star}`;\n\n case '.*':\n return `${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '*.*':\n return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '*/*':\n return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;\n\n case '**':\n return nodot + globstar(opts);\n\n case '**/*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;\n\n case '**/*.*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '**/.*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n default: {\n const match = /^(.*?)\\.(\\w+)$/.exec(str);\n if (!match) return;\n\n const source = create(match[1]);\n if (!source) return;\n\n return source + DOT_LITERAL + match[2];\n }\n }\n };\n\n const output = utils.removePrefix(input, state);\n let source = create(output);\n\n if (source && opts.strictSlashes !== true) {\n source += `${SLASH_LITERAL}?`;\n }\n\n return source;\n};\n\nmodule.exports = parse;\n","'use strict';\n\nconst scan = require('./scan');\nconst parse = require('./parse');\nconst utils = require('./utils');\nconst constants = require('./constants');\nconst isObject = val => val && typeof val === 'object' && !Array.isArray(val);\n\n/**\n * Creates a matcher function from one or more glob patterns. The\n * returned function takes a string to match as its first argument,\n * and returns true if the string is a match. The returned matcher\n * function also takes a boolean as the second argument that, when true,\n * returns an object with additional information.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch(glob[, options]);\n *\n * const isMatch = picomatch('*.!(*a)');\n * console.log(isMatch('a.a')); //=> false\n * console.log(isMatch('a.b')); //=> true\n * ```\n * @name picomatch\n * @param {String|Array} `globs` One or more glob patterns.\n * @param {Object=} `options`\n * @return {Function=} Returns a matcher function.\n * @api public\n */\n\nconst picomatch = (glob, options, returnState = false) => {\n if (Array.isArray(glob)) {\n const fns = glob.map(input => picomatch(input, options, returnState));\n const arrayMatcher = str => {\n for (const isMatch of fns) {\n const state = isMatch(str);\n if (state) return state;\n }\n return false;\n };\n return arrayMatcher;\n }\n\n const isState = isObject(glob) && glob.tokens && glob.input;\n\n if (glob === '' || (typeof glob !== 'string' && !isState)) {\n throw new TypeError('Expected pattern to be a non-empty string');\n }\n\n const opts = options || {};\n const posix = opts.windows;\n const regex = isState\n ? picomatch.compileRe(glob, options)\n : picomatch.makeRe(glob, options, false, true);\n\n const state = regex.state;\n delete regex.state;\n\n let isIgnored = () => false;\n if (opts.ignore) {\n const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };\n isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);\n }\n\n const matcher = (input, returnObject = false) => {\n const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });\n const result = { glob, state, regex, posix, input, output, match, isMatch };\n\n if (typeof opts.onResult === 'function') {\n opts.onResult(result);\n }\n\n if (isMatch === false) {\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (isIgnored(input)) {\n if (typeof opts.onIgnore === 'function') {\n opts.onIgnore(result);\n }\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (typeof opts.onMatch === 'function') {\n opts.onMatch(result);\n }\n return returnObject ? result : true;\n };\n\n if (returnState) {\n matcher.state = state;\n }\n\n return matcher;\n};\n\n/**\n * Test `input` with the given `regex`. This is used by the main\n * `picomatch()` function to test the input string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.test(input, regex[, options]);\n *\n * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\\/([^/]*?))$/));\n * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp} `regex`\n * @return {Object} Returns an object with matching info.\n * @api public\n */\n\npicomatch.test = (input, regex, options, { glob, posix } = {}) => {\n if (typeof input !== 'string') {\n throw new TypeError('Expected input to be a string');\n }\n\n if (input === '') {\n return { isMatch: false, output: '' };\n }\n\n const opts = options || {};\n const format = opts.format || (posix ? utils.toPosixSlashes : null);\n let match = input === glob;\n let output = (match && format) ? format(input) : input;\n\n if (match === false) {\n output = format ? format(input) : input;\n match = output === glob;\n }\n\n if (match === false || opts.capture === true) {\n if (opts.matchBase === true || opts.basename === true) {\n match = picomatch.matchBase(input, regex, options, posix);\n } else {\n match = regex.exec(output);\n }\n }\n\n return { isMatch: Boolean(match), match, output };\n};\n\n/**\n * Match the basename of a filepath.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.matchBase(input, glob[, options]);\n * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).\n * @return {Boolean}\n * @api public\n */\n\npicomatch.matchBase = (input, glob, options) => {\n const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);\n return regex.test(utils.basename(input));\n};\n\n/**\n * Returns true if **any** of the given glob `patterns` match the specified `string`.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.isMatch(string, patterns[, options]);\n *\n * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true\n * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false\n * ```\n * @param {String|Array} str The string to test.\n * @param {String|Array} patterns One or more glob patterns to use for matching.\n * @param {Object} [options] See available [options](#options).\n * @return {Boolean} Returns true if any patterns match `str`\n * @api public\n */\n\npicomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);\n\n/**\n * Parse a glob pattern to create the source string for a regular\n * expression.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const result = picomatch.parse(pattern[, options]);\n * ```\n * @param {String} `pattern`\n * @param {Object} `options`\n * @return {Object} Returns an object with useful properties and output to be used as a regex source string.\n * @api public\n */\n\npicomatch.parse = (pattern, options) => {\n if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));\n return parse(pattern, { ...options, fastpaths: false });\n};\n\n/**\n * Scan a glob pattern to separate the pattern into segments.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.scan(input[, options]);\n *\n * const result = picomatch.scan('!./foo/*.js');\n * console.log(result);\n * { prefix: '!./',\n * input: '!./foo/*.js',\n * start: 3,\n * base: 'foo',\n * glob: '*.js',\n * isBrace: false,\n * isBracket: false,\n * isGlob: true,\n * isExtglob: false,\n * isGlobstar: false,\n * negated: true }\n * ```\n * @param {String} `input` Glob pattern to scan.\n * @param {Object} `options`\n * @return {Object} Returns an object with\n * @api public\n */\n\npicomatch.scan = (input, options) => scan(input, options);\n\n/**\n * Compile a regular expression from the `state` object returned by the\n * [parse()](#parse) method.\n *\n * @param {Object} `state`\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.\n * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.\n * @return {RegExp}\n * @api public\n */\n\npicomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {\n if (returnOutput === true) {\n return state.output;\n }\n\n const opts = options || {};\n const prepend = opts.contains ? '' : '^';\n const append = opts.contains ? '' : '$';\n\n let source = `${prepend}(?:${state.output})${append}`;\n if (state && state.negated === true) {\n source = `^(?!${source}).*$`;\n }\n\n const regex = picomatch.toRegex(source, options);\n if (returnState === true) {\n regex.state = state;\n }\n\n return regex;\n};\n\n/**\n * Create a regular expression from a parsed glob pattern.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const state = picomatch.parse('*.js');\n * // picomatch.compileRe(state[, options]);\n *\n * console.log(picomatch.compileRe(state));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `state` The object returned from the `.parse` method.\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.\n * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.\n * @return {RegExp} Returns a regex created from the given pattern.\n * @api public\n */\n\npicomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {\n if (!input || typeof input !== 'string') {\n throw new TypeError('Expected a non-empty string');\n }\n\n let parsed = { negated: false, fastpaths: true };\n\n if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {\n parsed.output = parse.fastpaths(input, options);\n }\n\n if (!parsed.output) {\n parsed = parse(input, options);\n }\n\n return picomatch.compileRe(parsed, options, returnOutput, returnState);\n};\n\n/**\n * Create a regular expression from the given regex source string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.toRegex(source[, options]);\n *\n * const { output } = picomatch.parse('*.js');\n * console.log(picomatch.toRegex(output));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `source` Regular expression source string.\n * @param {Object} `options`\n * @return {RegExp}\n * @api public\n */\n\npicomatch.toRegex = (source, options) => {\n try {\n const opts = options || {};\n return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));\n } catch (err) {\n if (options && options.debug === true) throw err;\n return /$^/;\n }\n};\n\n/**\n * Picomatch constants.\n * @return {Object}\n */\n\npicomatch.constants = constants;\n\n/**\n * Expose \"picomatch\"\n */\n\nmodule.exports = picomatch;\n","import mime from \"mime/lite\";\nimport picomatch from \"picomatch/posix\";\n\nconst parseInputAccept = (inputAccept: string): [string[], string[]] => {\n const extensions: string[] = [];\n const mimeTypes: string[] = [];\n\n inputAccept\n .split(\",\")\n .map(mimeType => mimeType.trim())\n .filter(Boolean)\n .forEach(fileType => {\n if (fileType.startsWith(\".\")) {\n extensions.push(`*${fileType}`);\n } else {\n mimeTypes.push(fileType);\n }\n });\n\n return [extensions, mimeTypes];\n};\n\nclass AcceptedFileTypes {\n private extensions: string[];\n private mimeTypes: string[];\n\n constructor(inputAccept: string) {\n const [extensions, mimeTypes] = parseInputAccept(inputAccept);\n\n this.extensions = extensions;\n this.mimeTypes = mimeTypes;\n }\n\n public isAccepted(fileName: string): boolean {\n if (this.extensions.length === 0 && this.mimeTypes.length === 0) {\n return true;\n }\n return (\n this.isMimeTypeAccepted(mime.getType(fileName)) ||\n this.isExtensionAccepted(fileName)\n );\n }\n\n private isMimeTypeAccepted(mimeType: string | null): boolean {\n if (!mimeType || this.mimeTypes.length === 0) {\n return false;\n }\n\n return picomatch.isMatch(mimeType, this.mimeTypes);\n }\n\n private isExtensionAccepted(fileName: string): boolean {\n if (this.extensions.length === 0) {\n return false;\n }\n\n return picomatch.isMatch(fileName, this.extensions);\n }\n}\n\nexport default AcceptedFileTypes;\n","import AcceptedFileTypes from \"./accepted_file_types.ts\";\nimport RenderUploadFile from \"./render_upload_file.ts\";\n\nconst getEntriesFromDirectory = async (\n directoryEntry: FileSystemDirectoryEntry\n): Promise =>\n new Promise((resolve, reject) => {\n directoryEntry.createReader().readEntries(resolve, reject);\n });\n\nconst getFileFromFileEntry = async (\n fileEntry: FileSystemFileEntry\n): Promise =>\n new Promise((resolve, reject) => {\n fileEntry.file(resolve, reject);\n });\n\nconst getFilesFromFileSystemEntries = async (\n entries: FileSystemEntry[]\n): Promise => {\n const result = [];\n\n for (const entry of entries) {\n if (entry.isFile) {\n const file = await getFileFromFileEntry(entry as FileSystemFileEntry);\n result.push(file);\n } else if (entry.isDirectory) {\n const entriesFromDirectory = await getEntriesFromDirectory(\n entry as FileSystemDirectoryEntry\n );\n const files = await getFilesFromFileSystemEntries(entriesFromDirectory);\n files.forEach(file => result.push(file));\n }\n }\n\n return result;\n};\n\nconst getFilesFromDataTransfer = async (\n dataTransfer: DataTransfer\n): Promise => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (dataTransfer.items) {\n const entries = [...dataTransfer.items]\n .map(item => item.webkitGetAsEntry())\n .filter(entry => entry != null);\n\n const files = await getFilesFromFileSystemEntries(entries);\n return files;\n } else {\n // backwards compatibility\n return [...dataTransfer.files];\n }\n};\n\nclass DropArea {\n acceptedFileTypes: AcceptedFileTypes;\n container: Element;\n onUploadFiles: (files: File[]) => Promise;\n renderer: RenderUploadFile;\n\n constructor({\n container,\n inputAccept,\n onUploadFiles,\n renderer\n }: {\n container: Element;\n inputAccept: string;\n onUploadFiles: (files: File[]) => Promise;\n renderer: RenderUploadFile;\n }) {\n this.container = container;\n this.onUploadFiles = onUploadFiles;\n this.acceptedFileTypes = new AcceptedFileTypes(inputAccept);\n this.renderer = renderer;\n\n container.addEventListener(\"dragenter\", () => {\n container.classList.add(\"dff-dropping\");\n });\n container.addEventListener(\"dragleave\", () => {\n container.classList.remove(\"dff-dropping\");\n });\n container.addEventListener(\"dragover\", e => {\n container.classList.add(\"dff-dropping\");\n e.preventDefault();\n });\n container.addEventListener(\"drop\", this.onDrop);\n }\n\n onDrop = (e: Event): void => {\n const dragEvent = e as DragEvent;\n this.container.classList.remove(\"dff-dropping\");\n dragEvent.preventDefault();\n dragEvent.stopPropagation();\n\n const uploadFiles = async (): Promise => {\n try {\n if (dragEvent.dataTransfer) {\n const files = await getFilesFromDataTransfer(dragEvent.dataTransfer);\n const acceptedFiles: File[] = [];\n const invalidFiles: File[] = [];\n\n for (const file of files) {\n if (this.acceptedFileTypes.isAccepted(file.name)) {\n acceptedFiles.push(file);\n } else {\n invalidFiles.push(file);\n }\n }\n\n this.renderer.setErrorInvalidFiles(invalidFiles);\n void this.onUploadFiles(acceptedFiles);\n }\n } catch (error) {\n console.error(error);\n }\n };\n\n void uploadFiles();\n };\n}\n\nexport default DropArea;\n","type UploadStatus = \"done\" | \"error\" | \"uploading\";\nexport type UploadType =\n | \"existing\"\n | \"placeholder\"\n | \"s3\"\n | \"tus\"\n | \"uploadedS3\"\n | \"uploadedTus\";\n\nexport interface InitialExistingFile {\n name: string;\n size: number;\n type: \"existing\";\n}\n\nexport interface InitialPlaceholderFile {\n id: string;\n name: string;\n size: number;\n type: \"placeholder\";\n}\n\nexport interface InitialS3File {\n id: string;\n name: string;\n original_name: string;\n size: number;\n type: \"s3\";\n}\n\nexport interface InitialTusFile {\n id: string;\n name: string;\n size: number;\n type: \"tus\";\n url: string;\n}\n\nexport type InitialFile =\n | InitialExistingFile\n | InitialPlaceholderFile\n | InitialS3File\n | InitialTusFile;\n\ninterface UploadParameters {\n name: string;\n status: UploadStatus;\n type: UploadType;\n uploadIndex: number;\n}\n\nabstract class BaseUpload {\n name: string;\n status: UploadStatus;\n type: UploadType;\n uploadIndex: number;\n\n constructor({ name, status, type, uploadIndex }: UploadParameters) {\n this.name = name;\n this.status = status;\n this.type = type;\n this.uploadIndex = uploadIndex;\n }\n\n public async abort(): Promise {\n //\n }\n public async delete(): Promise {\n //\n }\n\n public abstract getId(): string | undefined;\n public abstract getInitialFile(): InitialFile;\n public abstract getSize(): number | undefined;\n}\n\nexport default BaseUpload;\n","function normalize (strArray) {\n var resultArray = [];\n if (strArray.length === 0) { return ''; }\n\n if (typeof strArray[0] !== 'string') {\n throw new TypeError('Url must be a string. Received ' + strArray[0]);\n }\n\n // If the first part is a plain protocol, we combine it with the next part.\n if (strArray[0].match(/^[^/:]+:\\/*$/) && strArray.length > 1) {\n var first = strArray.shift();\n strArray[0] = first + strArray[0];\n }\n\n // There must be two or three slashes in the file protocol, two slashes in anything else.\n if (strArray[0].match(/^file:\\/\\/\\//)) {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1:///');\n } else {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1://');\n }\n\n for (var i = 0; i < strArray.length; i++) {\n var component = strArray[i];\n\n if (typeof component !== 'string') {\n throw new TypeError('Url must be a string. Received ' + component);\n }\n\n if (component === '') { continue; }\n\n if (i > 0) {\n // Removing the starting slashes for each component but the first.\n component = component.replace(/^[\\/]+/, '');\n }\n if (i < strArray.length - 1) {\n // Removing the ending slashes for each component but the last.\n component = component.replace(/[\\/]+$/, '');\n } else {\n // For the last component we will combine multiple slashes to a single one.\n component = component.replace(/[\\/]+$/, '/');\n }\n\n resultArray.push(component);\n\n }\n\n var str = resultArray.join('/');\n // Each input component is now separated by a single slash except the possible first plain protocol part.\n\n // remove trailing slash before parameters or hash\n str = str.replace(/\\/(\\?|&|#[^!])/g, '$1');\n\n // replace ? in parameters with &\n var parts = str.split('?');\n str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&');\n\n return str;\n}\n\nexport default function urlJoin() {\n var input;\n\n if (typeof arguments[0] === 'object') {\n input = arguments[0];\n } else {\n input = [].slice.call(arguments);\n }\n\n return normalize(input);\n}\n","import urljoin from \"url-join\";\n\nexport interface LocationInfo {\n location: string;\n}\n\nexport interface MultipartUpload {\n key: string;\n uploadId: string;\n endpoint: string;\n}\n\nexport interface Part {\n ETag: string;\n PartNumber: number;\n}\n\nexport interface UrlInfo {\n url: string;\n}\n\nexport const MB = 1024 * 1024;\n\ninterface AbortMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n uploadId: string;\n}\n\nexport const abortMultipartUpload = ({\n csrfToken,\n key,\n uploadId,\n endpoint\n}: AbortMultipartUploadParameters): Promise => {\n const filename = encodeURIComponent(key);\n const uploadIdEnc = encodeURIComponent(uploadId);\n const headers = new Headers({\n \"X-CSRFToken\": csrfToken\n });\n const url = urljoin(endpoint, uploadIdEnc, `?key=${filename}`);\n return fetch(url, {\n method: \"delete\",\n headers: headers\n }).then(response => {\n return response.json();\n });\n};\n\ninterface CompleteMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n parts: Part[];\n uploadId: string;\n}\n\nexport const completeMultipartUpload = ({\n csrfToken,\n key,\n uploadId,\n parts,\n endpoint\n}: CompleteMultipartUploadParameters): Promise => {\n const filename = encodeURIComponent(key);\n const uploadIdEnc = encodeURIComponent(uploadId);\n const headers = new Headers({\n \"X-CSRFToken\": csrfToken\n });\n const url = urljoin(endpoint, uploadIdEnc, \"complete\", `?key=${filename}`);\n return fetch(url, {\n method: \"post\",\n headers: headers,\n body: JSON.stringify({\n parts: parts\n })\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as LocationInfo;\n });\n};\n\ninterface CreateMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n file: File;\n s3UploadDir: string;\n}\n\nexport const createMultipartUpload = ({\n csrfToken,\n endpoint,\n file,\n s3UploadDir\n}: CreateMultipartUploadParameters): Promise => {\n const headers = new Headers({\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n \"X-CSRFToken\": csrfToken\n });\n return fetch(endpoint, {\n method: \"post\",\n headers: headers,\n body: JSON.stringify({\n filename: file.name,\n contentType: file.type,\n s3UploadDir: s3UploadDir\n })\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as MultipartUpload;\n });\n};\n\nexport const getChunkSize = (file: File): number =>\n Math.ceil(file.size / 10000);\n\ninterface PrepareUploadPartParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n number: number;\n uploadId: string;\n}\n\nexport const prepareUploadPart = ({\n csrfToken,\n endpoint,\n key,\n number,\n uploadId\n}: PrepareUploadPartParameters): Promise => {\n const filename = encodeURIComponent(key);\n const headers = new Headers({ \"X-CSRFToken\": csrfToken });\n const url = urljoin(\n endpoint,\n uploadId,\n number.toString(),\n `?key=${filename}`\n );\n return fetch(url, {\n method: \"get\",\n headers: headers\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as UrlInfo;\n });\n};\n\nexport const remove = (arr: unknown[], el: unknown): void => {\n const i = arr.indexOf(el);\n if (i !== -1) {\n arr.splice(i, 1);\n }\n};\n","// The following code is adapted from https://github.com/transloadit/uppy/blob/master/packages/%40uppy/aws-s3-multipart/src/MultipartUploader.js\n// which is released under a MIT License (https://github.com/transloadit/uppy/blob/master/LICENSE)\n\nimport BaseUpload, { InitialFile } from \"./base_upload.ts\";\nimport {\n abortMultipartUpload,\n completeMultipartUpload,\n createMultipartUpload,\n getChunkSize,\n MB,\n MultipartUpload,\n Part,\n prepareUploadPart,\n remove,\n UrlInfo\n} from \"./s3_utils.ts\";\n\ninterface ChunkState {\n busy: boolean;\n done: boolean;\n etag?: string;\n uploaded: number;\n}\n\ninterface S3UploadParameters {\n csrfToken: string;\n endpoint: string;\n file: File;\n s3UploadDir: string;\n uploadIndex: number;\n}\n\nclass S3Upload extends BaseUpload {\n public onError?: (error: unknown) => void;\n public onProgress?: (bytesUploaded: number, bytesTotal: number) => void;\n public onSuccess?: () => void;\n\n private chunkState: ChunkState[];\n private chunks: Blob[];\n private createdPromise: Promise;\n private csrfToken: string;\n private endpoint: string;\n private file: File;\n private key: string | null;\n private parts: Part[];\n private s3UploadDir: string;\n private uploadId: string | null;\n private uploading: XMLHttpRequest[];\n\n constructor({\n csrfToken,\n endpoint,\n file,\n s3UploadDir,\n uploadIndex\n }: S3UploadParameters) {\n super({ name: file.name, status: \"uploading\", type: \"s3\", uploadIndex });\n\n this.csrfToken = csrfToken;\n this.endpoint = endpoint;\n this.file = file;\n this.s3UploadDir = s3UploadDir;\n\n this.key = null;\n this.uploadId = null;\n this.parts = [];\n\n // Do `this.createdPromise.then(OP)` to execute an operation `OP` _only_ if the\n // upload was created already. That also ensures that the sequencing is right\n // (so the `OP` definitely happens if the upload is created).\n //\n // This mostly exists to make `abortUpload` work well: only sending the abort request if\n // the upload was already created, and if the createMultipartUpload request is still in flight,\n // aborting it immediately after it finishes.\n this.createdPromise = Promise.reject(new Error());\n this.chunks = [];\n this.chunkState = [];\n this.uploading = [];\n this.onError = undefined;\n this.onProgress = undefined;\n this.onSuccess = undefined;\n\n this.initChunks();\n\n this.createdPromise.catch(() => ({})); // silence uncaught rejection warning\n }\n\n public async abort(): Promise {\n this.uploading.slice().forEach(xhr => {\n xhr.abort();\n });\n this.uploading = [];\n\n await this.createdPromise;\n\n if (this.key && this.uploadId) {\n await abortMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n uploadId: this.uploadId\n });\n }\n }\n\n public async delete(): Promise {\n return Promise.resolve();\n }\n\n public getId(): string | undefined {\n return this.uploadId ?? undefined;\n }\n\n public getInitialFile(): InitialFile {\n return {\n id: this.uploadId ?? \"\",\n name: this.key ?? \"\",\n size: this.file.size,\n original_name: this.file.name,\n type: \"s3\"\n };\n }\n\n public getSize(): number {\n return this.file.size;\n }\n\n public start(): void {\n void this.createUpload();\n }\n\n private initChunks(): void {\n const chunks: Blob[] = [];\n const desiredChunkSize = getChunkSize(this.file);\n // at least 5MB per request, at most 10k requests\n const minChunkSize = Math.max(5 * MB, Math.ceil(this.file.size / 10000));\n const chunkSize = Math.max(desiredChunkSize, minChunkSize);\n\n for (let i = 0; i < this.file.size; i += chunkSize) {\n const end = Math.min(this.file.size, i + chunkSize);\n chunks.push(this.file.slice(i, end));\n }\n\n this.chunks = chunks;\n this.chunkState = chunks.map(() => ({\n uploaded: 0,\n busy: false,\n done: false\n }));\n }\n\n private createUpload(): Promise {\n this.createdPromise = createMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n file: this.file,\n s3UploadDir: this.s3UploadDir\n });\n return this.createdPromise\n .then((result: MultipartUpload | null) => {\n const valid =\n typeof result === \"object\" &&\n result &&\n typeof result.uploadId === \"string\" &&\n typeof result.key === \"string\";\n if (!valid) {\n throw new TypeError(\n \"AwsS3/Multipart: Got incorrect result from `createMultipartUpload()`, expected an object `{ uploadId, key }`.\"\n );\n }\n\n this.key = result.key;\n this.uploadId = result.uploadId;\n\n this.uploadParts();\n })\n .catch((err: unknown) => {\n this.handleError(err);\n });\n }\n\n private uploadParts(): void {\n const need = 1 - this.uploading.length;\n if (need === 0) {\n return;\n }\n\n // All parts are uploaded.\n if (this.chunkState.every(state => state.done)) {\n void this.completeUpload();\n return;\n }\n\n const candidates = [];\n for (let i = 0; i < this.chunkState.length; i++) {\n const state = this.chunkState[i];\n\n if (!state || state.done || state.busy) {\n continue;\n }\n\n candidates.push(i);\n if (candidates.length >= need) {\n break;\n }\n }\n\n candidates.forEach(index => {\n void this.uploadPart(index);\n });\n }\n\n private uploadPart(index: number): Promise {\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = true;\n }\n\n if (!this.key || !this.uploadId) {\n return Promise.resolve();\n }\n\n return prepareUploadPart({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n number: index + 1,\n uploadId: this.uploadId\n })\n .then(result => {\n const valid =\n typeof result === \"object\" && typeof result.url === \"string\";\n if (!valid) {\n throw new TypeError(\n \"AwsS3/Multipart: Got incorrect result from `prepareUploadPart()`, expected an object `{ url }`.\"\n );\n }\n return result;\n })\n .then(\n ({ url }: UrlInfo) => {\n this.uploadPartBytes(index, url);\n },\n (err: unknown) => {\n this.handleError(err);\n }\n );\n }\n\n private onPartProgress(index: number, sent: number): void {\n const state = this.chunkState[index];\n\n if (state) {\n state.uploaded = sent;\n }\n\n if (this.onProgress) {\n const totalUploaded = this.chunkState.reduce((n, c) => n + c.uploaded, 0);\n this.onProgress(totalUploaded, this.file.size);\n }\n }\n\n private onPartComplete(index: number, etag: string): void {\n const state = this.chunkState[index];\n\n if (state) {\n state.etag = etag;\n state.done = true;\n }\n\n const part = {\n PartNumber: index + 1,\n ETag: etag\n };\n this.parts.push(part);\n\n this.uploadParts();\n }\n\n private uploadPartBytes(index: number, url: string): void {\n const body = this.chunks[index];\n const xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", url, true);\n xhr.responseType = \"text\";\n\n this.uploading.push(xhr);\n\n xhr.upload.addEventListener(\"progress\", ev => {\n if (!ev.lengthComputable) {\n return;\n }\n\n this.onPartProgress(index, ev.loaded);\n });\n\n xhr.addEventListener(\"abort\", ev => {\n remove(this.uploading, ev.target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n });\n\n xhr.addEventListener(\"load\", ev => {\n const target = ev.target as XMLHttpRequest;\n remove(this.uploading, target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n\n if (target.status < 200 || target.status >= 300) {\n this.handleError(new Error(\"Non 2xx\"));\n return;\n }\n\n this.onPartProgress(index, body?.size ?? 0);\n\n // NOTE This must be allowed by CORS.\n const etag = target.getResponseHeader(\"ETag\");\n if (etag === null) {\n this.handleError(\n new Error(\n \"AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions.\"\n )\n );\n return;\n }\n\n this.onPartComplete(index, etag);\n });\n\n xhr.addEventListener(\"error\", ev => {\n remove(this.uploading, ev.target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n\n const error = new Error(\"Unknown error\");\n // error.source = ev.target\n this.handleError(error);\n });\n xhr.send(body);\n }\n\n private completeUpload(): Promise {\n // Parts may not have completed uploading in sorted order, if limit > 1.\n this.parts.sort((a, b) => a.PartNumber - b.PartNumber);\n\n if (!this.uploadId || !this.key) {\n return Promise.resolve();\n }\n\n return completeMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n uploadId: this.uploadId,\n parts: this.parts\n }).then(\n () => {\n if (this.onSuccess) {\n this.onSuccess();\n }\n },\n (err: unknown) => {\n this.handleError(err as Error);\n }\n );\n }\n\n private handleError(error: unknown): void {\n if (this.onError) {\n this.onError(error);\n } else {\n throw error;\n }\n }\n}\n\nexport default S3Upload;\n","export const deleteUpload = async (\n url: string,\n csrfToken: string\n): Promise =>\n new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(\"DELETE\", url);\n\n xhr.onload = (): void => {\n if (xhr.status === 204) {\n resolve();\n } else {\n reject(new Error());\n }\n };\n xhr.setRequestHeader(\"Tus-Resumable\", \"1.0.0\");\n xhr.setRequestHeader(\"X-CSRFToken\", csrfToken);\n xhr.send(null);\n });\n","import BaseUpload, {\n InitialExistingFile,\n InitialFile,\n InitialPlaceholderFile,\n InitialS3File,\n InitialTusFile,\n UploadType\n} from \"./base_upload.ts\";\nimport { deleteUpload } from \"./tus_utils.ts\";\n\ninterface BaseUploadedFileParameters {\n name: string;\n size: number;\n type: UploadType;\n uploadIndex: number;\n}\n\nexport abstract class BaseUploadedFile extends BaseUpload {\n size: number;\n\n constructor({ name, size, type, uploadIndex }: BaseUploadedFileParameters) {\n super({ name, status: \"done\", type, uploadIndex });\n\n this.size = size;\n }\n\n public async abort(): Promise {\n return Promise.resolve();\n }\n\n public async delete(): Promise {\n return Promise.resolve();\n }\n\n public getSize(): number | undefined {\n return this.size;\n }\n}\n\nclass PlaceholderFile extends BaseUploadedFile {\n id: string;\n\n constructor(initialFile: InitialPlaceholderFile, uploadIndex: number) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"placeholder\",\n uploadIndex\n });\n\n this.id = initialFile.id;\n }\n\n public getId(): string | undefined {\n return undefined;\n }\n\n public getInitialFile(): InitialPlaceholderFile {\n return {\n id: this.id,\n name: this.name,\n size: this.size,\n type: \"placeholder\"\n };\n }\n}\n\nexport class UploadedS3File extends BaseUploadedFile {\n id: string;\n key: string;\n\n constructor(initialFile: InitialS3File, uploadIndex: number) {\n super({\n name: initialFile.original_name || initialFile.name,\n size: initialFile.size,\n type: \"uploadedS3\",\n uploadIndex\n });\n\n this.id = initialFile.id;\n this.key = initialFile.name;\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n getInitialFile(): InitialS3File {\n return {\n id: this.id,\n name: this.key,\n original_name: this.name,\n size: this.size,\n type: \"s3\"\n };\n }\n}\n\nexport class ExistingFile extends BaseUploadedFile {\n constructor(initialFile: InitialExistingFile, uploadIndex: number) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"existing\",\n uploadIndex\n });\n }\n\n public getId(): string | undefined {\n return undefined;\n }\n\n public getInitialFile(): InitialExistingFile {\n return {\n name: this.name,\n size: this.size,\n type: \"existing\"\n };\n }\n}\n\ninterface UploadedTusFileParameters {\n csrfToken: string;\n initialFile: InitialTusFile;\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport class UploadedTusFile extends BaseUploadedFile {\n csrfToken: string;\n id: string;\n url: string;\n\n constructor({\n csrfToken,\n initialFile,\n uploadIndex,\n uploadUrl\n }: UploadedTusFileParameters) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"uploadedTus\",\n uploadIndex\n });\n\n this.csrfToken = csrfToken;\n this.id = initialFile.id;\n this.url = `${uploadUrl}${initialFile.id}`;\n }\n\n public async delete(): Promise {\n await deleteUpload(this.url, this.csrfToken);\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n getInitialFile(): InitialTusFile {\n return {\n id: this.id,\n name: this.name,\n size: this.size,\n type: \"tus\",\n url: \"\"\n };\n }\n}\n\ninterface UploadedFileParameters {\n csrfToken: string;\n initialFile: InitialFile;\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport const createUploadedFile = ({\n csrfToken,\n initialFile,\n uploadIndex,\n uploadUrl\n}: UploadedFileParameters): BaseUploadedFile => {\n switch (initialFile.type) {\n case \"existing\":\n return new ExistingFile(initialFile, uploadIndex);\n\n case \"placeholder\":\n return new PlaceholderFile(initialFile, uploadIndex);\n\n case \"s3\":\n return new UploadedS3File(initialFile, uploadIndex);\n\n case \"tus\":\n return new UploadedTusFile({\n csrfToken,\n initialFile,\n uploadUrl,\n uploadIndex\n });\n }\n};\n","class DetailedError extends Error {\n constructor(message, causingErr = null, req = null, res = null) {\n super(message)\n\n this.originalRequest = req\n this.originalResponse = res\n this.causingError = causingErr\n\n if (causingErr != null) {\n message += `, caused by ${causingErr.toString()}`\n }\n\n if (req != null) {\n const requestId = req.getHeader('X-Request-ID') || 'n/a'\n const method = req.getMethod()\n const url = req.getURL()\n const status = res ? res.getStatus() : 'n/a'\n const body = res ? res.getBody() || '' : 'n/a'\n message += `, originated from request (method: ${method}, url: ${url}, response code: ${status}, response text: ${body}, request id: ${requestId})`\n }\n this.message = message\n }\n}\n\nexport default DetailedError\n","/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.7.7';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _hasBuffer = typeof Buffer === 'function';\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)\n : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')\n : btoaPolyfill;\nconst _fromUint8Array = _hasBuffer\n ? (u8a) => Buffer.from(u8a).toString('base64')\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _hasBuffer\n ? (s) => Buffer.from(s, 'utf8').toString('base64')\n : _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, bin = '', r1, r2;\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))\n : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')\n : atobPolyfill;\n//\nconst _toUint8Array = _hasBuffer\n ? (a) => _U8Afrom(Buffer.from(a, 'base64'))\n : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _hasBuffer\n ? (a) => Buffer.from(a, 'base64').toString('utf8')\n : _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n};\n// makecjs:CUT //\nexport { version };\nexport { VERSION };\nexport { _atob as atob };\nexport { atobPolyfill };\nexport { _btoa as btoa };\nexport { btoaPolyfill };\nexport { decode as fromBase64 };\nexport { encode as toBase64 };\nexport { utob };\nexport { encode };\nexport { encodeURI };\nexport { encodeURI as encodeURL };\nexport { btou };\nexport { decode };\nexport { isValid };\nexport { fromUint8Array };\nexport { toUint8Array };\nexport { extendString };\nexport { extendUint8Array };\nexport { extendBuiltins };\n// and finally,\nexport { gBase64 as Base64 };\n","'use strict';\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nmodule.exports = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n\n if (!port) return false;\n\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n\n case 'https':\n case 'wss':\n return port !== 443;\n\n case 'ftp':\n return port !== 21;\n\n case 'gopher':\n return port !== 70;\n\n case 'file':\n return false;\n }\n\n return port !== 0;\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , undef;\n\n/**\n * Decode a URI encoded string.\n *\n * @param {String} input The URI encoded string.\n * @returns {String|Null} The decoded string.\n * @api private\n */\nfunction decode(input) {\n try {\n return decodeURIComponent(input.replace(/\\+/g, ' '));\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Attempts to encode a given input.\n *\n * @param {String} input The string that needs to be encoded.\n * @returns {String|Null} The encoded string.\n * @api private\n */\nfunction encode(input) {\n try {\n return encodeURIComponent(input);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Simple query string parser.\n *\n * @param {String} query The query string that needs to be parsed.\n * @returns {Object}\n * @api public\n */\nfunction querystring(query) {\n var parser = /([^=?#&]+)=?([^&]*)/g\n , result = {}\n , part;\n\n while (part = parser.exec(query)) {\n var key = decode(part[1])\n , value = decode(part[2]);\n\n //\n // Prevent overriding of existing properties. This ensures that build-in\n // methods like `toString` or __proto__ are not overriden by malicious\n // querystrings.\n //\n // In the case if failed decoding, we want to omit the key/value pairs\n // from the result.\n //\n if (key === null || value === null || key in result) continue;\n result[key] = value;\n }\n\n return result;\n}\n\n/**\n * Transform a query string to an object.\n *\n * @param {Object} obj Object that should be transformed.\n * @param {String} prefix Optional prefix.\n * @returns {String}\n * @api public\n */\nfunction querystringify(obj, prefix) {\n prefix = prefix || '';\n\n var pairs = []\n , value\n , key;\n\n //\n // Optionally prefix with a '?' if needed\n //\n if ('string' !== typeof prefix) prefix = '?';\n\n for (key in obj) {\n if (has.call(obj, key)) {\n value = obj[key];\n\n //\n // Edge cases where we actually want to encode the value to an empty\n // string instead of the stringified value.\n //\n if (!value && (value === null || value === undef || isNaN(value))) {\n value = '';\n }\n\n key = encode(key);\n value = encode(value);\n\n //\n // If we failed to encode the strings, we should bail out as we don't\n // want to add invalid strings to the query.\n //\n if (key === null || value === null) continue;\n pairs.push(key +'='+ value);\n }\n }\n\n return pairs.length ? prefix + pairs.join('&') : '';\n}\n\n//\n// Expose the module.\n//\nexports.stringify = querystringify;\nexports.parse = querystring;\n","'use strict';\n\nvar required = require('requires-port')\n , qs = require('querystringify')\n , controlOrWhitespace = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n , CRHTLF = /[\\n\\r\\t]/g\n , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//\n , port = /:\\d+$/\n , protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i\n , windowsDriveLetter = /^[a-zA-Z]:/;\n\n/**\n * Remove control characters and whitespace from the beginning of a string.\n *\n * @param {Object|String} str String to trim.\n * @returns {String} A new string representing `str` stripped of control\n * characters and whitespace from its beginning.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(controlOrWhitespace, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d*)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') globalVar = window;\n else if (typeof global !== 'undefined') globalVar = global;\n else if (typeof self !== 'undefined') globalVar = self;\n else globalVar = {};\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4]\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n index = parse === '@'\n ? address.lastIndexOf(parse)\n : address.indexOf(parse);\n\n if (~index) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n\n if (url.auth) {\n index = url.auth.indexOf(':');\n\n if (~index) {\n url.username = url.auth.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = url.auth.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password))\n } else {\n url.username = encodeURIComponent(decodeURIComponent(url.auth));\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) value += ':'+ url.port;\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (port.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n case 'username':\n case 'password':\n url[part] = encodeURIComponent(value);\n break;\n\n case 'auth':\n var index = value.indexOf(':');\n\n if (~index) {\n url.username = value.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = value.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(value));\n }\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n\n var query\n , url = this\n , host = url.host\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n\n var result =\n protocol +\n ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) result += ':'+ url.password;\n result += '@';\n } else if (url.password) {\n result += ':'+ url.password;\n result += '@';\n } else if (\n url.protocol !== 'file:' &&\n isSpecial(url.protocol) &&\n !host &&\n url.pathname !== '/'\n ) {\n //\n // Add back the empty userinfo, otherwise the original invalid URL\n // might be transformed into a valid one with `url.pathname` as host.\n //\n result += '@';\n }\n\n //\n // Trailing colon is removed from `url.host` when it is parsed. If it still\n // ends with a colon, then add back the trailing colon that was removed. This\n // prevents an invalid URL from being transformed into a valid one.\n //\n if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {\n host += ':';\n }\n\n result += host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;\n\n if (url.hash) result += url.hash;\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\n\nmodule.exports = Url;\n","import { Base64 } from 'js-base64'\nimport URL from 'url-parse'\nimport DetailedError from './error.js'\nimport { log } from './logger.js'\nimport uuid from './uuid.js'\n\nconst PROTOCOL_TUS_V1 = 'tus-v1'\nconst PROTOCOL_IETF_DRAFT_03 = 'ietf-draft-03'\n\nconst defaultOptions = {\n endpoint: null,\n\n uploadUrl: null,\n metadata: {},\n metadataForPartialUploads: {},\n fingerprint: null,\n uploadSize: null,\n\n onProgress: null,\n onChunkComplete: null,\n onSuccess: null,\n onError: null,\n onUploadUrlAvailable: null,\n\n overridePatchMethod: false,\n headers: {},\n addRequestId: false,\n onBeforeRequest: null,\n onAfterResponse: null,\n onShouldRetry: defaultOnShouldRetry,\n\n chunkSize: Number.POSITIVE_INFINITY,\n retryDelays: [0, 1000, 3000, 5000],\n parallelUploads: 1,\n parallelUploadBoundaries: null,\n storeFingerprintForResuming: true,\n removeFingerprintOnSuccess: false,\n uploadLengthDeferred: false,\n uploadDataDuringCreation: false,\n\n urlStorage: null,\n fileReader: null,\n httpStack: null,\n\n protocol: PROTOCOL_TUS_V1,\n}\n\nclass BaseUpload {\n constructor(file, options) {\n // Warn about removed options from previous versions\n if ('resume' in options) {\n console.log(\n 'tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead.',\n )\n }\n\n // The default options will already be added from the wrapper classes.\n this.options = options\n\n // Cast chunkSize to integer\n this.options.chunkSize = Number(this.options.chunkSize)\n\n // The storage module used to store URLs\n this._urlStorage = this.options.urlStorage\n\n // The underlying File/Blob object\n this.file = file\n\n // The URL against which the file will be uploaded\n this.url = null\n\n // The underlying request object for the current PATCH request\n this._req = null\n\n // The fingerpinrt for the current file (set after start())\n this._fingerprint = null\n\n // The key that the URL storage returned when saving an URL with a fingerprint,\n this._urlStorageKey = null\n\n // The offset used in the current PATCH request\n this._offset = null\n\n // True if the current PATCH request has been aborted\n this._aborted = false\n\n // The file's size in bytes\n this._size = null\n\n // The Source object which will wrap around the given file and provides us\n // with a unified interface for getting its size and slice chunks from its\n // content allowing us to easily handle Files, Blobs, Buffers and Streams.\n this._source = null\n\n // The current count of attempts which have been made. Zero indicates none.\n this._retryAttempt = 0\n\n // The timeout's ID which is used to delay the next retry\n this._retryTimeout = null\n\n // The offset of the remote upload before the latest attempt was started.\n this._offsetBeforeRetry = 0\n\n // An array of BaseUpload instances which are used for uploading the different\n // parts, if the parallelUploads option is used.\n this._parallelUploads = null\n\n // An array of upload URLs which are used for uploading the different\n // parts, if the parallelUploads option is used.\n this._parallelUploadUrls = null\n }\n\n /**\n * Use the Termination extension to delete an upload from the server by sending a DELETE\n * request to the specified upload URL. This is only possible if the server supports the\n * Termination extension. If the `options.retryDelays` property is set, the method will\n * also retry if an error ocurrs.\n *\n * @param {String} url The upload's URL which will be terminated.\n * @param {object} options Optional options for influencing HTTP requests.\n * @return {Promise} The Promise will be resolved/rejected when the requests finish.\n */\n static terminate(url, options = {}) {\n const req = openRequest('DELETE', url, options)\n\n return sendRequest(req, null, options)\n .then((res) => {\n // A 204 response indicates a successfull request\n if (res.getStatus() === 204) {\n return\n }\n\n throw new DetailedError('tus: unexpected response while terminating upload', null, req, res)\n })\n .catch((err) => {\n if (!(err instanceof DetailedError)) {\n err = new DetailedError('tus: failed to terminate upload', err, req, null)\n }\n\n if (!shouldRetry(err, 0, options)) {\n throw err\n }\n\n // Instead of keeping track of the retry attempts, we remove the first element from the delays\n // array. If the array is empty, all retry attempts are used up and we will bubble up the error.\n // We recursively call the terminate function will removing elements from the retryDelays array.\n const delay = options.retryDelays[0]\n const remainingDelays = options.retryDelays.slice(1)\n const newOptions = {\n ...options,\n retryDelays: remainingDelays,\n }\n return new Promise((resolve) => setTimeout(resolve, delay)).then(() =>\n BaseUpload.terminate(url, newOptions),\n )\n })\n }\n\n findPreviousUploads() {\n return this.options\n .fingerprint(this.file, this.options)\n .then((fingerprint) => this._urlStorage.findUploadsByFingerprint(fingerprint))\n }\n\n resumeFromPreviousUpload(previousUpload) {\n this.url = previousUpload.uploadUrl || null\n this._parallelUploadUrls = previousUpload.parallelUploadUrls || null\n this._urlStorageKey = previousUpload.urlStorageKey\n }\n\n start() {\n const { file } = this\n\n if (!file) {\n this._emitError(new Error('tus: no file or stream to upload provided'))\n return\n }\n\n if (![PROTOCOL_TUS_V1, PROTOCOL_IETF_DRAFT_03].includes(this.options.protocol)) {\n this._emitError(new Error(`tus: unsupported protocol ${this.options.protocol}`))\n return\n }\n\n if (!this.options.endpoint && !this.options.uploadUrl && !this.url) {\n this._emitError(new Error('tus: neither an endpoint or an upload URL is provided'))\n return\n }\n\n const { retryDelays } = this.options\n if (retryDelays != null && Object.prototype.toString.call(retryDelays) !== '[object Array]') {\n this._emitError(new Error('tus: the `retryDelays` option must either be an array or null'))\n return\n }\n\n if (this.options.parallelUploads > 1) {\n // Test which options are incompatible with parallel uploads.\n for (const optionName of ['uploadUrl', 'uploadSize', 'uploadLengthDeferred']) {\n if (this.options[optionName]) {\n this._emitError(\n new Error(`tus: cannot use the ${optionName} option when parallelUploads is enabled`),\n )\n return\n }\n }\n }\n\n if (this.options.parallelUploadBoundaries) {\n if (this.options.parallelUploads <= 1) {\n this._emitError(\n new Error(\n 'tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled',\n ),\n )\n return\n }\n if (this.options.parallelUploads !== this.options.parallelUploadBoundaries.length) {\n this._emitError(\n new Error(\n 'tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`',\n ),\n )\n return\n }\n }\n\n this.options\n .fingerprint(file, this.options)\n .then((fingerprint) => {\n if (fingerprint == null) {\n log(\n 'No fingerprint was calculated meaning that the upload cannot be stored in the URL storage.',\n )\n } else {\n log(`Calculated fingerprint: ${fingerprint}`)\n }\n\n this._fingerprint = fingerprint\n\n if (this._source) {\n return this._source\n }\n return this.options.fileReader.openFile(file, this.options.chunkSize)\n })\n .then((source) => {\n this._source = source\n\n // First, we look at the uploadLengthDeferred option.\n // Next, we check if the caller has supplied a manual upload size.\n // Finally, we try to use the calculated size from the source object.\n if (this.options.uploadLengthDeferred) {\n this._size = null\n } else if (this.options.uploadSize != null) {\n this._size = Number(this.options.uploadSize)\n if (Number.isNaN(this._size)) {\n this._emitError(new Error('tus: cannot convert `uploadSize` option into a number'))\n return\n }\n } else {\n this._size = this._source.size\n if (this._size == null) {\n this._emitError(\n new Error(\n \"tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option\",\n ),\n )\n return\n }\n }\n\n // If the upload was configured to use multiple requests or if we resume from\n // an upload which used multiple requests, we start a parallel upload.\n if (this.options.parallelUploads > 1 || this._parallelUploadUrls != null) {\n this._startParallelUpload()\n } else {\n this._startSingleUpload()\n }\n })\n .catch((err) => {\n this._emitError(err)\n })\n }\n\n /**\n * Initiate the uploading procedure for a parallelized upload, where one file is split into\n * multiple request which are run in parallel.\n *\n * @api private\n */\n _startParallelUpload() {\n const totalSize = this._size\n let totalProgress = 0\n this._parallelUploads = []\n\n const partCount =\n this._parallelUploadUrls != null\n ? this._parallelUploadUrls.length\n : this.options.parallelUploads\n\n // The input file will be split into multiple slices which are uploaded in separate\n // requests. Here we get the start and end position for the slices.\n const parts =\n this.options.parallelUploadBoundaries ?? splitSizeIntoParts(this._source.size, partCount)\n\n // Attach URLs from previous uploads, if available.\n if (this._parallelUploadUrls) {\n parts.forEach((part, index) => {\n part.uploadUrl = this._parallelUploadUrls[index] || null\n })\n }\n\n // Create an empty list for storing the upload URLs\n this._parallelUploadUrls = new Array(parts.length)\n\n // Generate a promise for each slice that will be resolve if the respective\n // upload is completed.\n const uploads = parts.map((part, index) => {\n let lastPartProgress = 0\n\n return this._source.slice(part.start, part.end).then(\n ({ value }) =>\n new Promise((resolve, reject) => {\n // Merge with the user supplied options but overwrite some values.\n const options = {\n ...this.options,\n // If available, the partial upload should be resumed from a previous URL.\n uploadUrl: part.uploadUrl || null,\n // We take manually care of resuming for partial uploads, so they should\n // not be stored in the URL storage.\n storeFingerprintForResuming: false,\n removeFingerprintOnSuccess: false,\n // Reset the parallelUploads option to not cause recursion.\n parallelUploads: 1,\n // Reset this option as we are not doing a parallel upload.\n parallelUploadBoundaries: null,\n metadata: this.options.metadataForPartialUploads,\n // Add the header to indicate the this is a partial upload.\n headers: {\n ...this.options.headers,\n 'Upload-Concat': 'partial',\n },\n // Reject or resolve the promise if the upload errors or completes.\n onSuccess: resolve,\n onError: reject,\n // Based in the progress for this partial upload, calculate the progress\n // for the entire final upload.\n onProgress: (newPartProgress) => {\n totalProgress = totalProgress - lastPartProgress + newPartProgress\n lastPartProgress = newPartProgress\n this._emitProgress(totalProgress, totalSize)\n },\n // Wait until every partial upload has an upload URL, so we can add\n // them to the URL storage.\n onUploadUrlAvailable: () => {\n this._parallelUploadUrls[index] = upload.url\n // Test if all uploads have received an URL\n if (this._parallelUploadUrls.filter((u) => Boolean(u)).length === parts.length) {\n this._saveUploadInUrlStorage()\n }\n },\n }\n\n const upload = new BaseUpload(value, options)\n upload.start()\n\n // Store the upload in an array, so we can later abort them if necessary.\n this._parallelUploads.push(upload)\n }),\n )\n })\n\n let req\n // Wait until all partial uploads are finished and we can send the POST request for\n // creating the final upload.\n Promise.all(uploads)\n .then(() => {\n req = this._openRequest('POST', this.options.endpoint)\n req.setHeader('Upload-Concat', `final;${this._parallelUploadUrls.join(' ')}`)\n\n // Add metadata if values have been added\n const metadata = encodeMetadata(this.options.metadata)\n if (metadata !== '') {\n req.setHeader('Upload-Metadata', metadata)\n }\n\n return this._sendRequest(req, null)\n })\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while creating upload')\n return\n }\n\n const location = res.getHeader('Location')\n if (location == null) {\n this._emitHttpError(req, res, 'tus: invalid or missing Location header')\n return\n }\n\n this.url = resolveUrl(this.options.endpoint, location)\n log(`Created upload at ${this.url}`)\n\n this._emitSuccess(res)\n })\n .catch((err) => {\n this._emitError(err)\n })\n }\n\n /**\n * Initiate the uploading procedure for a non-parallel upload. Here the entire file is\n * uploaded in a sequential matter.\n *\n * @api private\n */\n _startSingleUpload() {\n // Reset the aborted flag when the upload is started or else the\n // _performUpload will stop before sending a request if the upload has been\n // aborted previously.\n this._aborted = false\n\n // The upload had been started previously and we should reuse this URL.\n if (this.url != null) {\n log(`Resuming upload from previous URL: ${this.url}`)\n this._resumeUpload()\n return\n }\n\n // A URL has manually been specified, so we try to resume\n if (this.options.uploadUrl != null) {\n log(`Resuming upload from provided URL: ${this.options.uploadUrl}`)\n this.url = this.options.uploadUrl\n this._resumeUpload()\n return\n }\n\n // An upload has not started for the file yet, so we start a new one\n log('Creating a new upload')\n this._createUpload()\n }\n\n /**\n * Abort any running request and stop the current upload. After abort is called, no event\n * handler will be invoked anymore. You can use the `start` method to resume the upload\n * again.\n * If `shouldTerminate` is true, the `terminate` function will be called to remove the\n * current upload from the server.\n *\n * @param {boolean} shouldTerminate True if the upload should be deleted from the server.\n * @return {Promise} The Promise will be resolved/rejected when the requests finish.\n */\n abort(shouldTerminate) {\n // Stop any parallel partial uploads, that have been started in _startParallelUploads.\n if (this._parallelUploads != null) {\n for (const upload of this._parallelUploads) {\n upload.abort(shouldTerminate)\n }\n }\n\n // Stop any current running request.\n if (this._req !== null) {\n this._req.abort()\n // Note: We do not close the file source here, so the user can resume in the future.\n }\n this._aborted = true\n\n // Stop any timeout used for initiating a retry.\n if (this._retryTimeout != null) {\n clearTimeout(this._retryTimeout)\n this._retryTimeout = null\n }\n\n if (!shouldTerminate || this.url == null) {\n return Promise.resolve()\n }\n\n return (\n BaseUpload.terminate(this.url, this.options)\n // Remove entry from the URL storage since the upload URL is no longer valid.\n .then(() => this._removeFromUrlStorage())\n )\n }\n\n _emitHttpError(req, res, message, causingErr) {\n this._emitError(new DetailedError(message, causingErr, req, res))\n }\n\n _emitError(err) {\n // Do not emit errors, e.g. from aborted HTTP requests, if the upload has been stopped.\n if (this._aborted) return\n\n // Check if we should retry, when enabled, before sending the error to the user.\n if (this.options.retryDelays != null) {\n // We will reset the attempt counter if\n // - we were already able to connect to the server (offset != null) and\n // - we were able to upload a small chunk of data to the server\n const shouldResetDelays = this._offset != null && this._offset > this._offsetBeforeRetry\n if (shouldResetDelays) {\n this._retryAttempt = 0\n }\n\n if (shouldRetry(err, this._retryAttempt, this.options)) {\n const delay = this.options.retryDelays[this._retryAttempt++]\n\n this._offsetBeforeRetry = this._offset\n\n this._retryTimeout = setTimeout(() => {\n this.start()\n }, delay)\n return\n }\n }\n\n if (typeof this.options.onError === 'function') {\n this.options.onError(err)\n } else {\n throw err\n }\n }\n\n /**\n * Publishes notification if the upload has been successfully completed.\n *\n * @param {object} lastResponse Last HTTP response.\n * @api private\n */\n _emitSuccess(lastResponse) {\n if (this.options.removeFingerprintOnSuccess) {\n // Remove stored fingerprint and corresponding endpoint. This causes\n // new uploads of the same file to be treated as a different file.\n this._removeFromUrlStorage()\n }\n\n if (typeof this.options.onSuccess === 'function') {\n this.options.onSuccess({ lastResponse })\n }\n }\n\n /**\n * Publishes notification when data has been sent to the server. This\n * data may not have been accepted by the server yet.\n *\n * @param {number} bytesSent Number of bytes sent to the server.\n * @param {number} bytesTotal Total number of bytes to be sent to the server.\n * @api private\n */\n _emitProgress(bytesSent, bytesTotal) {\n if (typeof this.options.onProgress === 'function') {\n this.options.onProgress(bytesSent, bytesTotal)\n }\n }\n\n /**\n * Publishes notification when a chunk of data has been sent to the server\n * and accepted by the server.\n * @param {number} chunkSize Size of the chunk that was accepted by the server.\n * @param {number} bytesAccepted Total number of bytes that have been\n * accepted by the server.\n * @param {number} bytesTotal Total number of bytes to be sent to the server.\n * @api private\n */\n _emitChunkComplete(chunkSize, bytesAccepted, bytesTotal) {\n if (typeof this.options.onChunkComplete === 'function') {\n this.options.onChunkComplete(chunkSize, bytesAccepted, bytesTotal)\n }\n }\n\n /**\n * Create a new upload using the creation extension by sending a POST\n * request to the endpoint. After successful creation the file will be\n * uploaded\n *\n * @api private\n */\n _createUpload() {\n if (!this.options.endpoint) {\n this._emitError(new Error('tus: unable to create upload because no endpoint is provided'))\n return\n }\n\n const req = this._openRequest('POST', this.options.endpoint)\n\n if (this.options.uploadLengthDeferred) {\n req.setHeader('Upload-Defer-Length', '1')\n } else {\n req.setHeader('Upload-Length', `${this._size}`)\n }\n\n // Add metadata if values have been added\n const metadata = encodeMetadata(this.options.metadata)\n if (metadata !== '') {\n req.setHeader('Upload-Metadata', metadata)\n }\n\n let promise\n if (this.options.uploadDataDuringCreation && !this.options.uploadLengthDeferred) {\n this._offset = 0\n promise = this._addChunkToRequest(req)\n } else {\n if (this.options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Complete', '?0')\n }\n promise = this._sendRequest(req, null)\n }\n\n promise\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while creating upload')\n return\n }\n\n const location = res.getHeader('Location')\n if (location == null) {\n this._emitHttpError(req, res, 'tus: invalid or missing Location header')\n return\n }\n\n this.url = resolveUrl(this.options.endpoint, location)\n log(`Created upload at ${this.url}`)\n\n if (typeof this.options.onUploadUrlAvailable === 'function') {\n this.options.onUploadUrlAvailable()\n }\n\n if (this._size === 0) {\n // Nothing to upload and file was successfully created\n this._emitSuccess(res)\n this._source.close()\n return\n }\n\n this._saveUploadInUrlStorage().then(() => {\n if (this.options.uploadDataDuringCreation) {\n this._handleUploadResponse(req, res)\n } else {\n this._offset = 0\n this._performUpload()\n }\n })\n })\n .catch((err) => {\n this._emitHttpError(req, null, 'tus: failed to create upload', err)\n })\n }\n\n /*\n * Try to resume an existing upload. First a HEAD request will be sent\n * to retrieve the offset. If the request fails a new upload will be\n * created. In the case of a successful response the file will be uploaded.\n *\n * @api private\n */\n _resumeUpload() {\n const req = this._openRequest('HEAD', this.url)\n const promise = this._sendRequest(req, null)\n\n promise\n .then((res) => {\n const status = res.getStatus()\n if (!inStatusCategory(status, 200)) {\n // If the upload is locked (indicated by the 423 Locked status code), we\n // emit an error instead of directly starting a new upload. This way the\n // retry logic can catch the error and will retry the upload. An upload\n // is usually locked for a short period of time and will be available\n // afterwards.\n if (status === 423) {\n this._emitHttpError(req, res, 'tus: upload is currently locked; retry later')\n return\n }\n\n if (inStatusCategory(status, 400)) {\n // Remove stored fingerprint and corresponding endpoint,\n // on client errors since the file can not be found\n this._removeFromUrlStorage()\n }\n\n if (!this.options.endpoint) {\n // Don't attempt to create a new upload if no endpoint is provided.\n this._emitHttpError(\n req,\n res,\n 'tus: unable to resume upload (new upload cannot be created without an endpoint)',\n )\n return\n }\n\n // Try to create a new upload\n this.url = null\n this._createUpload()\n return\n }\n\n const offset = Number.parseInt(res.getHeader('Upload-Offset'), 10)\n if (Number.isNaN(offset)) {\n this._emitHttpError(req, res, 'tus: invalid or missing offset value')\n return\n }\n\n const length = Number.parseInt(res.getHeader('Upload-Length'), 10)\n if (\n Number.isNaN(length) &&\n !this.options.uploadLengthDeferred &&\n this.options.protocol === PROTOCOL_TUS_V1\n ) {\n this._emitHttpError(req, res, 'tus: invalid or missing length value')\n return\n }\n\n if (typeof this.options.onUploadUrlAvailable === 'function') {\n this.options.onUploadUrlAvailable()\n }\n\n this._saveUploadInUrlStorage().then(() => {\n // Upload has already been completed and we do not need to send additional\n // data to the server\n if (offset === length) {\n this._emitProgress(length, length)\n this._emitSuccess(res)\n return\n }\n\n this._offset = offset\n this._performUpload()\n })\n })\n .catch((err) => {\n this._emitHttpError(req, null, 'tus: failed to resume upload', err)\n })\n }\n\n /**\n * Start uploading the file using PATCH requests. The file will be divided\n * into chunks as specified in the chunkSize option. During the upload\n * the onProgress event handler may be invoked multiple times.\n *\n * @api private\n */\n _performUpload() {\n // If the upload has been aborted, we will not send the next PATCH request.\n // This is important if the abort method was called during a callback, such\n // as onChunkComplete or onProgress.\n if (this._aborted) {\n return\n }\n\n let req\n\n // Some browser and servers may not support the PATCH method. For those\n // cases, you can tell tus-js-client to use a POST request with the\n // X-HTTP-Method-Override header for simulating a PATCH request.\n if (this.options.overridePatchMethod) {\n req = this._openRequest('POST', this.url)\n req.setHeader('X-HTTP-Method-Override', 'PATCH')\n } else {\n req = this._openRequest('PATCH', this.url)\n }\n\n req.setHeader('Upload-Offset', `${this._offset}`)\n const promise = this._addChunkToRequest(req)\n\n promise\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while uploading chunk')\n return\n }\n\n this._handleUploadResponse(req, res)\n })\n .catch((err) => {\n // Don't emit an error if the upload was aborted manually\n if (this._aborted) {\n return\n }\n\n this._emitHttpError(req, null, `tus: failed to upload chunk at offset ${this._offset}`, err)\n })\n }\n\n /**\n * _addChunktoRequest reads a chunk from the source and sends it using the\n * supplied request object. It will not handle the response.\n *\n * @api private\n */\n _addChunkToRequest(req) {\n const start = this._offset\n let end = this._offset + this.options.chunkSize\n\n req.setProgressHandler((bytesSent) => {\n this._emitProgress(start + bytesSent, this._size)\n })\n\n req.setHeader('Content-Type', 'application/offset+octet-stream')\n\n // The specified chunkSize may be Infinity or the calcluated end position\n // may exceed the file's size. In both cases, we limit the end position to\n // the input's total size for simpler calculations and correctness.\n if (\n (end === Number.POSITIVE_INFINITY || end > this._size) &&\n !this.options.uploadLengthDeferred\n ) {\n end = this._size\n }\n\n return this._source.slice(start, end).then(({ value, done }) => {\n const valueSize = value?.size ? value.size : 0\n\n // If the upload length is deferred, the upload size was not specified during\n // upload creation. So, if the file reader is done reading, we know the total\n // upload size and can tell the tus server.\n if (this.options.uploadLengthDeferred && done) {\n this._size = this._offset + valueSize\n req.setHeader('Upload-Length', `${this._size}`)\n }\n\n // The specified uploadSize might not match the actual amount of data that a source\n // provides. In these cases, we cannot successfully complete the upload, so we\n // rather error out and let the user know. If not, tus-js-client will be stuck\n // in a loop of repeating empty PATCH requests.\n // See https://community.transloadit.com/t/how-to-abort-hanging-companion-uploads/16488/13\n const newSize = this._offset + valueSize\n if (!this.options.uploadLengthDeferred && done && newSize !== this._size) {\n return Promise.reject(\n new Error(\n `upload was configured with a size of ${this._size} bytes, but the source is done after ${newSize} bytes`,\n ),\n )\n }\n\n if (value === null) {\n return this._sendRequest(req)\n }\n\n if (this.options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Complete', done ? '?1' : '?0')\n }\n this._emitProgress(this._offset, this._size)\n return this._sendRequest(req, value)\n })\n }\n\n /**\n * _handleUploadResponse is used by requests that haven been sent using _addChunkToRequest\n * and already have received a response.\n *\n * @api private\n */\n _handleUploadResponse(req, res) {\n const offset = Number.parseInt(res.getHeader('Upload-Offset'), 10)\n if (Number.isNaN(offset)) {\n this._emitHttpError(req, res, 'tus: invalid or missing offset value')\n return\n }\n\n this._emitProgress(offset, this._size)\n this._emitChunkComplete(offset - this._offset, offset, this._size)\n\n this._offset = offset\n\n if (offset === this._size) {\n // Yay, finally done :)\n this._emitSuccess(res)\n this._source.close()\n return\n }\n\n this._performUpload()\n }\n\n /**\n * Create a new HTTP request object with the given method and URL.\n *\n * @api private\n */\n _openRequest(method, url) {\n const req = openRequest(method, url, this.options)\n this._req = req\n return req\n }\n\n /**\n * Remove the entry in the URL storage, if it has been saved before.\n *\n * @api private\n */\n _removeFromUrlStorage() {\n if (!this._urlStorageKey) return\n\n this._urlStorage.removeUpload(this._urlStorageKey).catch((err) => {\n this._emitError(err)\n })\n this._urlStorageKey = null\n }\n\n /**\n * Add the upload URL to the URL storage, if possible.\n *\n * @api private\n */\n _saveUploadInUrlStorage() {\n // We do not store the upload URL\n // - if it was disabled in the option, or\n // - if no fingerprint was calculated for the input (i.e. a stream), or\n // - if the URL is already stored (i.e. key is set alread).\n if (\n !this.options.storeFingerprintForResuming ||\n !this._fingerprint ||\n this._urlStorageKey !== null\n ) {\n return Promise.resolve()\n }\n\n const storedUpload = {\n size: this._size,\n metadata: this.options.metadata,\n creationTime: new Date().toString(),\n }\n\n if (this._parallelUploads) {\n // Save multiple URLs if the parallelUploads option is used ...\n storedUpload.parallelUploadUrls = this._parallelUploadUrls\n } else {\n // ... otherwise we just save the one available URL.\n storedUpload.uploadUrl = this.url\n }\n\n return this._urlStorage.addUpload(this._fingerprint, storedUpload).then((urlStorageKey) => {\n this._urlStorageKey = urlStorageKey\n })\n }\n\n /**\n * Send a request with the provided body.\n *\n * @api private\n */\n _sendRequest(req, body = null) {\n return sendRequest(req, body, this.options)\n }\n}\n\nfunction encodeMetadata(metadata) {\n return Object.entries(metadata)\n .map(([key, value]) => `${key} ${Base64.encode(String(value))}`)\n .join(',')\n}\n\n/**\n * Checks whether a given status is in the range of the expected category.\n * For example, only a status between 200 and 299 will satisfy the category 200.\n *\n * @api private\n */\nfunction inStatusCategory(status, category) {\n return status >= category && status < category + 100\n}\n\n/**\n * Create a new HTTP request with the specified method and URL.\n * The necessary headers that are included in every request\n * will be added, including the request ID.\n *\n * @api private\n */\nfunction openRequest(method, url, options) {\n const req = options.httpStack.createRequest(method, url)\n\n if (options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Draft-Interop-Version', '5')\n } else {\n req.setHeader('Tus-Resumable', '1.0.0')\n }\n const headers = options.headers || {}\n\n for (const [name, value] of Object.entries(headers)) {\n req.setHeader(name, value)\n }\n\n if (options.addRequestId) {\n const requestId = uuid()\n req.setHeader('X-Request-ID', requestId)\n }\n\n return req\n}\n\n/**\n * Send a request with the provided body while invoking the onBeforeRequest\n * and onAfterResponse callbacks.\n *\n * @api private\n */\nasync function sendRequest(req, body, options) {\n if (typeof options.onBeforeRequest === 'function') {\n await options.onBeforeRequest(req)\n }\n\n const res = await req.send(body)\n\n if (typeof options.onAfterResponse === 'function') {\n await options.onAfterResponse(req, res)\n }\n\n return res\n}\n\n/**\n * Checks whether the browser running this code has internet access.\n * This function will always return true in the node.js environment\n *\n * @api private\n */\nfunction isOnline() {\n let online = true\n // Note: We don't reference `window` here because the navigator object also exists\n // in a Web Worker's context.\n if (typeof navigator !== 'undefined' && navigator.onLine === false) {\n online = false\n }\n\n return online\n}\n\n/**\n * Checks whether or not it is ok to retry a request.\n * @param {Error|DetailedError} err the error returned from the last request\n * @param {number} retryAttempt the number of times the request has already been retried\n * @param {object} options tus Upload options\n *\n * @api private\n */\nfunction shouldRetry(err, retryAttempt, options) {\n // We only attempt a retry if\n // - retryDelays option is set\n // - we didn't exceed the maxium number of retries, yet, and\n // - this error was caused by a request or it's response and\n // - the error is server error (i.e. not a status 4xx except a 409 or 423) or\n // a onShouldRetry is specified and returns true\n // - the browser does not indicate that we are offline\n if (\n options.retryDelays == null ||\n retryAttempt >= options.retryDelays.length ||\n err.originalRequest == null\n ) {\n return false\n }\n\n if (options && typeof options.onShouldRetry === 'function') {\n return options.onShouldRetry(err, retryAttempt, options)\n }\n\n return defaultOnShouldRetry(err)\n}\n\n/**\n * determines if the request should be retried. Will only retry if not a status 4xx except a 409 or 423\n * @param {DetailedError} err\n * @returns {boolean}\n */\nfunction defaultOnShouldRetry(err) {\n const status = err.originalResponse ? err.originalResponse.getStatus() : 0\n return (!inStatusCategory(status, 400) || status === 409 || status === 423) && isOnline()\n}\n\n/**\n * Resolve a relative link given the origin as source. For example,\n * if a HTTP request to http://example.com/files/ returns a Location\n * header with the value /upload/abc, the resolved URL will be:\n * http://example.com/upload/abc\n */\nfunction resolveUrl(origin, link) {\n return new URL(link, origin).toString()\n}\n\n/**\n * Calculate the start and end positions for the parts if an upload\n * is split into multiple parallel requests.\n *\n * @param {number} totalSize The byte size of the upload, which will be split.\n * @param {number} partCount The number in how many parts the upload will be split.\n * @return {object[]}\n * @api private\n */\nfunction splitSizeIntoParts(totalSize, partCount) {\n const partSize = Math.floor(totalSize / partCount)\n const parts = []\n\n for (let i = 0; i < partCount; i++) {\n parts.push({\n start: partSize * i,\n end: partSize * (i + 1),\n })\n }\n\n parts[partCount - 1].end = totalSize\n\n return parts\n}\n\nBaseUpload.defaultOptions = defaultOptions\n\nexport default BaseUpload\n","/**\n * Generate a UUID v4 based on random numbers. We intentioanlly use the less\n * secure Math.random function here since the more secure crypto.getRandomNumbers\n * is not available on all platforms.\n * This is not a problem for us since we use the UUID only for generating a\n * request ID, so we can correlate server logs to client errors.\n *\n * This function is taken from following site:\n * https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\n *\n * @return {string} The generate UUID\n */\nexport default function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0\n const v = c === 'x' ? r : (r & 0x3) | 0x8\n return v.toString(16)\n })\n}\n","const isReactNative = () =>\n typeof navigator !== 'undefined' &&\n typeof navigator.product === 'string' &&\n navigator.product.toLowerCase() === 'reactnative'\n\nexport default isReactNative\n","import isCordova from './isCordova.js'\nimport readAsByteArray from './readAsByteArray.js'\n\nexport default class FileSource {\n // Make this.size a method\n constructor(file) {\n this._file = file\n this.size = file.size\n }\n\n slice(start, end) {\n // In Apache Cordova applications, a File must be resolved using\n // FileReader instances, see\n // https://cordova.apache.org/docs/en/8.x/reference/cordova-plugin-file/index.html#read-a-file\n if (isCordova()) {\n return readAsByteArray(this._file.slice(start, end))\n }\n\n const value = this._file.slice(start, end)\n const done = end >= this.size\n return Promise.resolve({ value, done })\n }\n\n close() {\n // Nothing to do here since we don't need to release any resources.\n }\n}\n","const isCordova = () =>\n typeof window !== 'undefined' &&\n (typeof window.PhoneGap !== 'undefined' ||\n typeof window.Cordova !== 'undefined' ||\n typeof window.cordova !== 'undefined')\n\nexport default isCordova\n","/**\n * readAsByteArray converts a File object to a Uint8Array.\n * This function is only used on the Apache Cordova platform.\n * See https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html#read-a-file\n */\nexport default function readAsByteArray(chunk) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n const value = new Uint8Array(reader.result)\n resolve({ value })\n }\n reader.onerror = (err) => {\n reject(err)\n }\n reader.readAsArrayBuffer(chunk)\n })\n}\n","function len(blobOrArray) {\n if (blobOrArray === undefined) return 0\n if (blobOrArray.size !== undefined) return blobOrArray.size\n return blobOrArray.length\n}\n\n/*\n Typed arrays and blobs don't have a concat method.\n This function helps StreamSource accumulate data to reach chunkSize.\n*/\nfunction concat(a, b) {\n if (a.concat) {\n // Is `a` an Array?\n return a.concat(b)\n }\n if (a instanceof Blob) {\n return new Blob([a, b], { type: a.type })\n }\n if (a.set) {\n // Is `a` a typed array?\n const c = new a.constructor(a.length + b.length)\n c.set(a)\n c.set(b, a.length)\n return c\n }\n throw new Error('Unknown data type')\n}\n\nexport default class StreamSource {\n constructor(reader) {\n this._buffer = undefined\n this._bufferOffset = 0\n this._reader = reader\n this._done = false\n }\n\n slice(start, end) {\n if (start < this._bufferOffset) {\n return Promise.reject(new Error(\"Requested data is before the reader's current offset\"))\n }\n\n return this._readUntilEnoughDataOrDone(start, end)\n }\n\n _readUntilEnoughDataOrDone(start, end) {\n const hasEnoughData = end <= this._bufferOffset + len(this._buffer)\n if (this._done || hasEnoughData) {\n const value = this._getDataFromBuffer(start, end)\n const done = value == null ? this._done : false\n return Promise.resolve({ value, done })\n }\n\n return this._reader.read().then(({ value, done }) => {\n if (done) {\n this._done = true\n } else if (this._buffer === undefined) {\n this._buffer = value\n } else {\n this._buffer = concat(this._buffer, value)\n }\n\n return this._readUntilEnoughDataOrDone(start, end)\n })\n }\n\n _getDataFromBuffer(start, end) {\n // Remove data from buffer before `start`.\n // Data might be reread from the buffer if an upload fails, so we can only\n // safely delete data when it comes *before* what is currently being read.\n if (start > this._bufferOffset) {\n this._buffer = this._buffer.slice(start - this._bufferOffset)\n this._bufferOffset = start\n }\n // If the buffer is empty after removing old data, all data has been read.\n const hasAllDataBeenRead = len(this._buffer) === 0\n if (this._done && hasAllDataBeenRead) {\n return null\n }\n // We already removed data before `start`, so we just return the first\n // chunk from the buffer.\n return this._buffer.slice(0, end - start)\n }\n\n close() {\n if (this._reader.cancel) {\n this._reader.cancel()\n }\n }\n}\n","export default class XHRHttpStack {\n createRequest(method, url) {\n return new Request(method, url)\n }\n\n getName() {\n return 'XHRHttpStack'\n }\n}\n\nclass Request {\n constructor(method, url) {\n this._xhr = new XMLHttpRequest()\n this._xhr.open(method, url, true)\n\n this._method = method\n this._url = url\n this._headers = {}\n }\n\n getMethod() {\n return this._method\n }\n\n getURL() {\n return this._url\n }\n\n setHeader(header, value) {\n this._xhr.setRequestHeader(header, value)\n this._headers[header] = value\n }\n\n getHeader(header) {\n return this._headers[header]\n }\n\n setProgressHandler(progressHandler) {\n // Test support for progress events before attaching an event listener\n if (!('upload' in this._xhr)) {\n return\n }\n\n this._xhr.upload.onprogress = (e) => {\n if (!e.lengthComputable) {\n return\n }\n\n progressHandler(e.loaded)\n }\n }\n\n send(body = null) {\n return new Promise((resolve, reject) => {\n this._xhr.onload = () => {\n resolve(new Response(this._xhr))\n }\n\n this._xhr.onerror = (err) => {\n reject(err)\n }\n\n this._xhr.send(body)\n })\n }\n\n abort() {\n this._xhr.abort()\n return Promise.resolve()\n }\n\n getUnderlyingObject() {\n return this._xhr\n }\n}\n\nclass Response {\n constructor(xhr) {\n this._xhr = xhr\n }\n\n getStatus() {\n return this._xhr.status\n }\n\n getHeader(header) {\n return this._xhr.getResponseHeader(header)\n }\n\n getBody() {\n return this._xhr.responseText\n }\n\n getUnderlyingObject() {\n return this._xhr\n }\n}\n","let hasStorage = false\ntry {\n // Note: localStorage does not exist in the Web Worker's context, so we must use window here.\n hasStorage = 'localStorage' in window\n\n // Attempt to store and read entries from the local storage to detect Private\n // Mode on Safari on iOS (see #49)\n // If the key was not used before, we remove it from local storage again to\n // not cause confusion where the entry came from.\n const key = 'tusSupport'\n const originalValue = localStorage.getItem(key)\n localStorage.setItem(key, originalValue)\n if (originalValue === null) localStorage.removeItem(key)\n} catch (e) {\n // If we try to access localStorage inside a sandboxed iframe, a SecurityError\n // is thrown. When in private mode on iOS Safari, a QuotaExceededError is\n // thrown (see #49)\n if (e.code === e.SECURITY_ERR || e.code === e.QUOTA_EXCEEDED_ERR) {\n hasStorage = false\n } else {\n throw e\n }\n}\n\nexport const canStoreURLs = hasStorage\n\nexport class WebStorageUrlStorage {\n findAllUploads() {\n const results = this._findEntries('tus::')\n return Promise.resolve(results)\n }\n\n findUploadsByFingerprint(fingerprint) {\n const results = this._findEntries(`tus::${fingerprint}::`)\n return Promise.resolve(results)\n }\n\n removeUpload(urlStorageKey) {\n localStorage.removeItem(urlStorageKey)\n return Promise.resolve()\n }\n\n addUpload(fingerprint, upload) {\n const id = Math.round(Math.random() * 1e12)\n const key = `tus::${fingerprint}::${id}`\n\n localStorage.setItem(key, JSON.stringify(upload))\n return Promise.resolve(key)\n }\n\n _findEntries(prefix) {\n const results = []\n\n for (let i = 0; i < localStorage.length; i++) {\n const key = localStorage.key(i)\n if (key.indexOf(prefix) !== 0) continue\n\n try {\n const upload = JSON.parse(localStorage.getItem(key))\n upload.urlStorageKey = key\n\n results.push(upload)\n } catch (_e) {\n // The JSON parse error is intentionally ignored here, so a malformed\n // entry in the storage cannot prevent an upload.\n }\n }\n\n return results\n }\n}\n","import DetailedError from '../error.js'\nimport { enableDebugLog } from '../logger.js'\nimport NoopUrlStorage from '../noopUrlStorage.js'\nimport BaseUpload from '../upload.js'\n\nimport FileReader from './fileReader.js'\nimport fingerprint from './fileSignature.js'\nimport DefaultHttpStack from './httpStack.js'\nimport { WebStorageUrlStorage, canStoreURLs } from './urlStorage.js'\n\nconst defaultOptions = {\n ...BaseUpload.defaultOptions,\n httpStack: new DefaultHttpStack(),\n fileReader: new FileReader(),\n urlStorage: canStoreURLs ? new WebStorageUrlStorage() : new NoopUrlStorage(),\n fingerprint,\n}\n\nclass Upload extends BaseUpload {\n constructor(file = null, options = {}) {\n options = { ...defaultOptions, ...options }\n super(file, options)\n }\n\n static terminate(url, options = {}) {\n options = { ...defaultOptions, ...options }\n return BaseUpload.terminate(url, options)\n }\n}\n\n// Note: We don't reference `window` here because these classes also exist in a Web Worker's context.\nconst isSupported =\n typeof XMLHttpRequest === 'function' &&\n typeof Blob === 'function' &&\n typeof Blob.prototype.slice === 'function'\n\nexport {\n Upload,\n canStoreURLs,\n defaultOptions,\n isSupported,\n enableDebugLog,\n DefaultHttpStack,\n DetailedError,\n}\n","import isReactNative from './isReactNative.js'\nimport uriToBlob from './uriToBlob.js'\n\nimport FileSource from './sources/FileSource.js'\nimport StreamSource from './sources/StreamSource.js'\n\nexport default class FileReader {\n async openFile(input, chunkSize) {\n // In React Native, when user selects a file, instead of a File or Blob,\n // you usually get a file object {} with a uri property that contains\n // a local path to the file. We use XMLHttpRequest to fetch\n // the file blob, before uploading with tus.\n if (isReactNative() && input && typeof input.uri !== 'undefined') {\n try {\n const blob = await uriToBlob(input.uri)\n return new FileSource(blob)\n } catch (err) {\n throw new Error(\n `tus: cannot fetch \\`file.uri\\` as Blob, make sure the uri is correct and accessible. ${err}`,\n )\n }\n }\n\n // Since we emulate the Blob type in our tests (not all target browsers\n // support it), we cannot use `instanceof` for testing whether the input value\n // can be handled. Instead, we simply check is the slice() function and the\n // size property are available.\n if (typeof input.slice === 'function' && typeof input.size !== 'undefined') {\n return Promise.resolve(new FileSource(input))\n }\n\n if (typeof input.read === 'function') {\n chunkSize = Number(chunkSize)\n if (!Number.isFinite(chunkSize)) {\n return Promise.reject(\n new Error(\n 'cannot create source for stream without a finite value for the `chunkSize` option',\n ),\n )\n }\n\n return Promise.resolve(new StreamSource(input, chunkSize))\n }\n\n return Promise.reject(\n new Error(\n 'source object may only be an instance of File, Blob, or Reader in this environment',\n ),\n )\n }\n}\n","/**\n * uriToBlob resolves a URI to a Blob object. This is used for\n * React Native to retrieve a file (identified by a file://\n * URI) as a blob.\n */\nexport default function uriToBlob(uri) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n xhr.responseType = 'blob'\n xhr.onload = () => {\n const blob = xhr.response\n resolve(blob)\n }\n xhr.onerror = (err) => {\n reject(err)\n }\n xhr.open('GET', uri)\n xhr.send()\n })\n}\n","export default class NoopUrlStorage {\n listAllUploads() {\n return Promise.resolve([])\n }\n\n findUploadsByFingerprint(_fingerprint) {\n return Promise.resolve([])\n }\n\n removeUpload(_urlStorageKey) {\n return Promise.resolve()\n }\n\n addUpload(_fingerprint, _upload) {\n return Promise.resolve(null)\n }\n}\n","import isReactNative from './isReactNative.js'\n\n// TODO: Differenciate between input types\n\n/**\n * Generate a fingerprint for a file which will be used the store the endpoint\n *\n * @param {File} file\n * @param {Object} options\n * @param {Function} callback\n */\nexport default function fingerprint(file, options) {\n if (isReactNative()) {\n return Promise.resolve(reactNativeFingerprint(file, options))\n }\n\n return Promise.resolve(\n ['tus-br', file.name, file.type, file.size, file.lastModified, options.endpoint].join('-'),\n )\n}\n\nfunction reactNativeFingerprint(file, options) {\n const exifHash = file.exif ? hashCode(JSON.stringify(file.exif)) : 'noexif'\n return ['tus-rn', file.name || 'noname', file.size || 'nosize', exifHash, options.endpoint].join(\n '/',\n )\n}\n\nfunction hashCode(str) {\n // from https://stackoverflow.com/a/8831937/151666\n let hash = 0\n if (str.length === 0) {\n return hash\n }\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = (hash << 5) - hash + char\n hash &= hash // Convert to 32bit integer\n }\n return hash\n}\n","import { HttpRequest, HttpResponse, Upload } from \"tus-js-client\";\nimport BaseUpload, { InitialFile } from \"./base_upload.ts\";\nimport { deleteUpload } from \"./tus_utils.ts\";\n\ninterface Parameters {\n chunkSize: number;\n csrfToken: string;\n fieldName: string;\n file: File;\n formId: string;\n retryDelays: number[] | null;\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport default class TusUpload extends BaseUpload {\n public onError?: (error: Error) => void;\n public onProgress?: (bytesUploaded: number, bytesTotal: number) => void;\n public onSuccess?: () => void;\n private id: string;\n private upload: Upload;\n private csrfToken: string;\n\n constructor({\n chunkSize,\n csrfToken,\n fieldName,\n file,\n formId,\n retryDelays,\n uploadIndex,\n uploadUrl\n }: Parameters) {\n super({ name: file.name, status: \"uploading\", type: \"tus\", uploadIndex });\n\n this.csrfToken = csrfToken;\n\n this.upload = new Upload(file, {\n chunkSize,\n endpoint: uploadUrl,\n metadata: {\n fieldName: fieldName,\n filename: file.name,\n formId: formId\n },\n onAfterResponse: this.handleAfterReponse,\n onBeforeRequest: this.addCsrTokenToRequest,\n onError: this.handleError,\n onProgress: this.handleProgress,\n onSuccess: this.handleSucces,\n retryDelays: retryDelays ?? [0, 1000, 3000, 5000]\n });\n\n this.onError = undefined;\n this.onProgress = undefined;\n this.onSuccess = undefined;\n }\n\n public async abort(): Promise {\n await this.upload.abort(true);\n }\n\n public async delete(): Promise {\n if (!this.upload.url) {\n return Promise.resolve();\n }\n\n await deleteUpload(this.upload.url, this.csrfToken);\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n public getSize(): number {\n return (this.upload.file as File).size;\n }\n\n public start(): void {\n this.upload.start();\n }\n\n private handleError = (error: Error) => {\n if (this.onError) {\n this.onError(error);\n } else {\n throw error;\n }\n };\n\n private handleProgress = (bytesUploaded: number, bytesTotal: number) => {\n if (this.onProgress) {\n this.onProgress(bytesUploaded, bytesTotal);\n }\n };\n\n private handleSucces = () => {\n if (this.onSuccess) {\n this.onSuccess();\n }\n };\n\n private addCsrTokenToRequest = (request: HttpRequest) => {\n request.setHeader(\"X-CSRFToken\", this.csrfToken);\n };\n\n private handleAfterReponse = (\n _request: HttpRequest,\n response: HttpResponse\n ) => {\n const resourceId = response.getHeader(\"ResourceId\");\n\n if (resourceId) {\n this.id = resourceId;\n }\n };\n\n getInitialFile(): InitialFile {\n return {\n id: this.id,\n name: this.name,\n size: this.getSize(),\n type: \"tus\",\n url: \"\"\n };\n }\n}\n","import {\n findInput,\n getMetadataFieldName,\n getUploadsFieldName\n} from \"./util.ts\";\nimport RenderUploadFile from \"./render_upload_file.ts\";\nimport DropArea from \"./drop_area.ts\";\n\nimport S3Upload from \"./uploads/s3_upload.ts\";\nimport { EventEmitter } from \"eventemitter3\";\nimport { createUploadedFile } from \"./uploads/uploaded_file.ts\";\nimport TusUpload from \"./uploads/tus_upload.ts\";\nimport BaseUpload, { InitialFile, UploadType } from \"./uploads/base_upload.ts\";\nimport AcceptedFileTypes from \"./accepted_file_types.ts\";\n\nexport type Translations = Record;\n\ninterface ClickEvent {\n fileName: string;\n fieldName: string;\n id?: string;\n type: UploadType;\n}\n\nexport interface Callbacks {\n onClick?: ({ fileName, fieldName, type }: ClickEvent) => void;\n onDelete?: (upload: BaseUpload) => void;\n onError?: (error: unknown, upload: BaseUpload) => void;\n onProgress?: (\n bytesUploaded: number,\n bytesTotal: number,\n upload: BaseUpload\n ) => void;\n onSuccess?: (upload: BaseUpload) => void;\n}\n\ninterface ConstructorParams {\n callbacks: Callbacks;\n chunkSize: number;\n csrfToken: string;\n eventEmitter?: EventEmitter;\n fieldName: string;\n form: Element;\n formId: string;\n initial: InitialFile[];\n input: HTMLInputElement;\n multiple: boolean;\n parent: Element;\n prefix: string | null;\n retryDelays: number[] | null;\n s3UploadDir: string | null;\n skipRequired: boolean;\n supportDropArea: boolean;\n translations: Translations;\n uploadUrl: string;\n}\n\nclass FileField {\n acceptedFileTypes: AcceptedFileTypes;\n callbacks: Callbacks;\n chunkSize: number;\n csrfToken: string;\n eventEmitter?: EventEmitter;\n fieldName: string;\n form: Element;\n formId: string;\n multiple: boolean;\n nextUploadIndex: number;\n prefix: string | null;\n renderer: RenderUploadFile;\n retryDelays: number[] | null;\n s3UploadDir: string | null;\n supportDropArea: boolean;\n uploads: BaseUpload[];\n uploadUrl: string;\n\n constructor({\n callbacks,\n chunkSize,\n csrfToken,\n eventEmitter,\n fieldName,\n form,\n formId,\n initial,\n input,\n multiple,\n parent,\n prefix,\n retryDelays,\n s3UploadDir,\n skipRequired,\n supportDropArea,\n translations,\n uploadUrl\n }: ConstructorParams) {\n this.callbacks = callbacks;\n this.chunkSize = chunkSize;\n this.csrfToken = csrfToken;\n this.eventEmitter = eventEmitter;\n this.fieldName = fieldName;\n this.form = form;\n this.formId = formId;\n this.multiple = multiple;\n this.prefix = prefix;\n this.retryDelays = retryDelays;\n this.s3UploadDir = s3UploadDir;\n this.supportDropArea = supportDropArea && !input.disabled;\n this.uploadUrl = uploadUrl;\n this.acceptedFileTypes = new AcceptedFileTypes(input.accept);\n\n this.uploads = [];\n this.nextUploadIndex = 0;\n\n this.renderer = new RenderUploadFile({\n parent,\n input,\n skipRequired,\n translations\n });\n const filesContainer = this.renderer.container;\n\n if (supportDropArea) {\n this.initDropArea(filesContainer, input.accept);\n }\n\n this.addInitialFiles(initial);\n\n this.checkDropHint();\n\n input.addEventListener(\"change\", this.onChange);\n filesContainer.addEventListener(\"click\", this.handleClick);\n }\n\n addInitialFiles(initialFiles: InitialFile[]): void {\n if (initialFiles.length === 0) {\n return;\n }\n\n const { multiple, renderer } = this;\n\n const addInitialFile = (initialFile: InitialFile): void => {\n const { size } = initialFile;\n const name =\n initialFile.type === \"s3\" && initialFile.original_name\n ? initialFile.original_name\n : initialFile.name;\n\n const element = renderer.addUploadedFile(\n name,\n this.nextUploadIndex,\n size\n );\n\n const upload = createUploadedFile({\n csrfToken: this.csrfToken,\n initialFile,\n uploadIndex: this.nextUploadIndex,\n uploadUrl: this.uploadUrl\n });\n this.uploads.push(upload);\n\n this.emitEvent(\"addUpload\", element, upload);\n };\n\n if (multiple) {\n initialFiles.forEach((file: InitialFile): void => {\n addInitialFile(file);\n this.nextUploadIndex += 1;\n });\n } else {\n const initialFile = initialFiles[0];\n\n if (initialFile) {\n addInitialFile(initialFile);\n }\n }\n }\n\n uploadFiles = async (files: File[]): Promise => {\n if (files.length === 0) {\n return;\n }\n\n if (!this.multiple) {\n for (const upload of this.uploads) {\n this.renderer.deleteFile(upload.uploadIndex);\n }\n\n this.uploads = [];\n const file = files[0];\n\n if (file) {\n await this.uploadFile(file);\n }\n } else {\n for (const file of files) {\n await this.uploadFile(file);\n }\n }\n\n this.checkDropHint();\n };\n\n async uploadFile(file: File): Promise {\n const createUpload = (): S3Upload | TusUpload => {\n const { csrfToken, s3UploadDir } = this;\n\n if (s3UploadDir != null) {\n return new S3Upload({\n csrfToken,\n endpoint: uploadUrl,\n file,\n s3UploadDir,\n uploadIndex: newUploadIndex\n });\n } else {\n return new TusUpload({\n chunkSize: this.chunkSize,\n csrfToken: this.csrfToken,\n fieldName,\n file,\n formId,\n retryDelays: this.retryDelays,\n uploadIndex: newUploadIndex,\n uploadUrl\n });\n }\n };\n\n const { fieldName, formId, renderer, uploadUrl } = this;\n const fileName = file.name;\n const existingUpload = this.findUploadByName(fileName);\n const newUploadIndex = existingUpload\n ? existingUpload.uploadIndex\n : this.nextUploadIndex;\n\n if (!existingUpload) {\n this.nextUploadIndex += 1;\n }\n\n if (existingUpload) {\n await this.removeExistingUpload(existingUpload);\n }\n\n const upload = createUpload();\n\n upload.onError = (error: unknown) => {\n this.handleError(upload, error);\n };\n upload.onProgress = (bytesUploaded, bytesTotal) => {\n this.handleProgress(upload, bytesUploaded, bytesTotal);\n };\n upload.onSuccess = () => {\n this.handleSuccess(upload);\n };\n upload.start();\n\n this.uploads.push(upload);\n\n const element = renderer.addNewUpload(fileName, newUploadIndex);\n this.emitEvent(\"addUpload\", element, upload);\n }\n\n getUploadByIndex(uploadIndex: number): BaseUpload | undefined {\n return this.uploads.find(upload => upload.uploadIndex === uploadIndex);\n }\n\n findUploadByName(fileName: string): BaseUpload | undefined {\n return this.uploads.find(upload => upload.name === fileName);\n }\n\n async removeExistingUpload(upload: BaseUpload): Promise {\n const element = this.renderer.findFileDiv(upload.uploadIndex);\n\n if (element) {\n this.emitEvent(\"removeUpload\", element, upload);\n }\n\n if (upload.status === \"uploading\") {\n this.renderer.disableCancel(upload.uploadIndex);\n await upload.abort();\n } else if (upload.status === \"done\") {\n this.renderer.disableDelete(upload.uploadIndex);\n\n try {\n await upload.delete();\n } catch {\n this.renderer.setDeleteFailed(upload.uploadIndex);\n return;\n }\n }\n\n this.removeUploadFromList(upload);\n this.updatePlaceholderInput();\n }\n\n onChange = (e: Event): void => {\n const files = (e.target as HTMLInputElement).files ?? ([] as File[]);\n const acceptedFiles: File[] = [];\n const invalidFiles: File[] = [];\n\n for (const file of files) {\n if (this.acceptedFileTypes.isAccepted(file.name)) {\n acceptedFiles.push(file);\n } else {\n invalidFiles.push(file);\n }\n }\n\n this.handleInvalidFiles([...invalidFiles]);\n void this.uploadFiles([...acceptedFiles]);\n\n this.renderer.clearInput();\n };\n\n handleInvalidFiles = (files: File[]): void => {\n this.renderer.setErrorInvalidFiles(files);\n };\n\n handleClick = (e: Event): void => {\n const target = e.target as HTMLElement;\n\n const getUpload = (): BaseUpload | undefined => {\n const dataIndex = target.getAttribute(\"data-index\");\n\n if (!dataIndex) {\n return undefined;\n }\n\n const uploadIndex = parseInt(dataIndex, 10);\n return this.getUploadByIndex(uploadIndex);\n };\n\n if (\n target.classList.contains(\"dff-delete\") &&\n !target.classList.contains(\"dff-disabled\")\n ) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload) {\n void this.removeExistingUpload(upload);\n }\n } else if (target.classList.contains(\"dff-cancel\")) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload) {\n void this.handleCancel(upload);\n }\n } else if (target.classList.contains(\"dff-filename\")) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload?.status === \"done\" && this.callbacks.onClick) {\n this.callbacks.onClick({\n fileName: upload.name,\n fieldName: this.fieldName,\n id: upload.getId(),\n type: upload.type\n });\n }\n }\n };\n\n handleProgress = (\n upload: BaseUpload,\n bytesUploaded: number,\n bytesTotal: number\n ): void => {\n const percentage = ((bytesUploaded / bytesTotal) * 100).toFixed(2);\n\n this.renderer.updateProgress(upload.uploadIndex, percentage);\n\n const { onProgress } = this.callbacks;\n\n if (onProgress) {\n if (upload instanceof TusUpload) {\n onProgress(bytesUploaded, bytesTotal, upload);\n }\n }\n };\n\n handleError = (upload: BaseUpload, error: unknown): void => {\n this.renderer.setError(upload.uploadIndex);\n upload.status = \"error\";\n\n const { onError } = this.callbacks;\n\n if (onError) {\n if (upload instanceof TusUpload) {\n onError(error, upload);\n }\n }\n };\n\n handleSuccess = (upload: BaseUpload): void => {\n const { renderer } = this;\n\n this.updatePlaceholderInput();\n\n renderer.clearInput();\n renderer.setSuccess(upload.uploadIndex, upload.getSize());\n upload.status = \"done\";\n\n const { onSuccess } = this.callbacks;\n\n const element = this.renderer.findFileDiv(upload.uploadIndex);\n\n if (element) {\n this.emitEvent(\"uploadComplete\", element, upload);\n }\n\n if (onSuccess && upload.type === \"tus\") {\n onSuccess(upload);\n }\n };\n\n removeUploadFromList(upload: BaseUpload): void {\n this.renderer.deleteFile(upload.uploadIndex);\n\n const index = this.uploads.indexOf(upload);\n\n if (index >= 0) {\n this.uploads.splice(index, 1);\n }\n\n this.checkDropHint();\n\n const { onDelete } = this.callbacks;\n\n if (onDelete) {\n onDelete(upload);\n }\n }\n\n async handleCancel(upload: BaseUpload): Promise {\n this.renderer.disableCancel(upload.uploadIndex);\n await upload.abort();\n this.removeUploadFromList(upload);\n }\n\n initDropArea(container: Element, inputAccept: string): void {\n new DropArea({\n container,\n inputAccept,\n onUploadFiles: this.uploadFiles,\n renderer: this.renderer\n });\n }\n\n checkDropHint(): void {\n if (!this.supportDropArea) {\n return;\n }\n\n const nonEmptyUploads = this.uploads.filter(e => Boolean(e));\n\n if (nonEmptyUploads.length === 0) {\n this.renderer.renderDropHint();\n } else {\n this.renderer.removeDropHint();\n }\n }\n\n updatePlaceholderInput(): void {\n const input = findInput(\n this.form,\n getUploadsFieldName(this.fieldName, this.prefix),\n this.prefix\n );\n if (!input) {\n return;\n }\n\n const placeholdersInfo: InitialFile[] = this.uploads.map(upload =>\n upload.getInitialFile()\n );\n\n input.value = JSON.stringify(placeholdersInfo);\n }\n\n getMetaDataField(): HTMLElement | null {\n return findInput(\n this.form,\n getMetadataFieldName(this.fieldName, this.prefix),\n this.prefix\n );\n }\n\n emitEvent(eventName: string, element: HTMLElement, upload: BaseUpload): void {\n if (this.eventEmitter) {\n this.eventEmitter.emit(eventName, {\n element,\n fieldName: this.fieldName,\n fileName: upload.name,\n metaDataField: this.getMetaDataField(),\n upload\n });\n }\n }\n}\n\nexport default FileField;\n","import { EventEmitter } from \"eventemitter3\";\nimport FileField, { Callbacks, Translations } from \"./file_field.ts\";\nimport { InitialFile } from \"./uploads/base_upload.ts\";\nimport {\n findInput,\n getInputValueForFormAndPrefix,\n getUploadsFieldName\n} from \"./util.ts\";\n\nexport interface Options {\n callbacks?: Callbacks;\n chunkSize?: number;\n eventEmitter?: EventEmitter;\n prefix?: string;\n retryDelays?: number[];\n skipRequired?: boolean;\n supportDropArea?: boolean;\n}\n\nconst initUploadFields = (form: Element, options: Options = {}): void => {\n const matchesPrefix = (fieldName: string): boolean => {\n if (!options.prefix) {\n return true;\n }\n\n return fieldName.startsWith(`${options.prefix}-`);\n };\n\n const getPrefix = (): string | null =>\n options.prefix ? options.prefix : null;\n\n const getInputValue = (fieldName: string): string | undefined =>\n getInputValueForFormAndPrefix(form, fieldName, getPrefix());\n\n const getInitialFiles = (fieldName: string): InitialFile[] => {\n const data = getInputValue(getUploadsFieldName(fieldName, getPrefix()));\n\n if (!data) {\n return [];\n }\n\n return (JSON.parse(data) as Record[]).filter(\n file => file.type\n ) as unknown as InitialFile[];\n };\n\n const uploadUrl = getInputValue(\"upload_url\");\n const formId = getInputValue(\"form_id\");\n const s3UploadDir = getInputValue(\"s3_upload_dir\");\n const skipRequired = options.skipRequired ?? false;\n const prefix = getPrefix();\n const csrfToken = findInput(form, \"csrfmiddlewaretoken\", null)?.value;\n\n if (!csrfToken) {\n throw Error(\"Csrf token not found\");\n }\n\n if (!formId || !uploadUrl) {\n return;\n }\n\n form.querySelectorAll(\".dff-uploader\").forEach(uploaderDiv => {\n const container = uploaderDiv.querySelector(\".dff-container\");\n\n if (!container) {\n return;\n }\n\n const input = container.querySelector(\"input[type=file]\");\n\n if (!(input && matchesPrefix(input.name))) {\n return;\n }\n\n const fieldName = input.name;\n const { multiple } = input;\n const initial = getInitialFiles(fieldName);\n const dataTranslations = container.getAttribute(\"data-translations\");\n const translations: Translations = dataTranslations\n ? (JSON.parse(dataTranslations) as Translations)\n : {};\n const supportDropArea = !(options.supportDropArea === false);\n\n new FileField({\n callbacks: options.callbacks ?? {},\n chunkSize: options.chunkSize ?? 2621440,\n csrfToken,\n eventEmitter: options.eventEmitter,\n fieldName,\n form,\n formId,\n s3UploadDir: s3UploadDir ?? null,\n initial,\n input,\n multiple,\n parent: container,\n prefix,\n retryDelays: options.retryDelays ?? null,\n skipRequired,\n supportDropArea,\n translations,\n uploadUrl\n });\n });\n};\n\nexport default initUploadFields;\n","import autoInitFileForms from \"./auto_init_file_forms.ts\";\nimport initFormSet from \"./init_form_set.ts\";\nimport initUploadFields from \"./init_upload_fields.ts\";\n\ndeclare const window: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n\nwindow.autoInitFileForms = autoInitFileForms; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\nwindow.initFormSet = initFormSet; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\nwindow.initUploadFields = initUploadFields; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n","import initUploadFields, { Options } from \"./init_upload_fields.ts\";\nimport {\n getInputNameWithPrefix,\n getInputValueForFormAndPrefix\n} from \"./util.ts\";\n\nconst initFormSet = (form: Element, optionsParam: Options | string): void => {\n let options: Options;\n\n if (typeof optionsParam === \"string\") {\n options = { prefix: optionsParam };\n } else {\n options = optionsParam;\n }\n\n const prefix = options.prefix ?? \"form\";\n\n const totalFormsValue = getInputValueForFormAndPrefix(\n form,\n \"TOTAL_FORMS\",\n prefix\n );\n\n if (!totalFormsValue) {\n return;\n }\n\n const formCount = parseInt(totalFormsValue, 10);\n\n for (let i = 0; i < formCount; i += 1) {\n const subFormPrefix = getInputNameWithPrefix(i.toString(), null);\n initUploadFields(form, {\n ...options,\n prefix: `${prefix}-${subFormPrefix}`\n });\n }\n};\n\nexport default initFormSet;\n"],"names":["findForm","element","parent","parentElement","tagName","getInputNameWithPrefix","fieldName","prefix","getInputNameWithoutPrefix","slice","length","findInput","form","inputNameWithPrefix","input","querySelector","getUploadsFieldName","getInputValueForFormAndPrefix","value","matchHtmlRegExp","escapeHtml_1","string","escape","str","match","exec","html","index","lastIndex","charCodeAt","substring","RenderUploadFile","constructor","_ref","skipRequired","translations","this","container","createFilesContainer","errors","createErrorContainer","required","addNewUpload","filename","uploadIndex","div","addFile","progressSpan","document","createElement","className","innerSpan","appendChild","cancelLink","innerHTML","Cancel","setAttribute","toString","href","addUploadedFile","filesize","setSuccess","clearInput","deleteFile","findFileDiv","remove","disableCancel","cancelSpan","findCancelSpan","classList","add","disableDelete","deleteLink","findDeleteLink","removeDropHint","dropHint","renderDropHint","setDeleteFailed","setErrorMessage","enableDelete","setError","el","removeProgress","removeCancel","setErrorInvalidFiles","files","errorsMessages","file","msg","invalidFileTypeMessage","innerText","name","replaceChildren","size","fileSizeInfo","formatBytes","bytes","decimals","dm","i","Math","floor","log","n","parseFloat","toFixed","Delete","updateProgress","percentage","innerProgressSpan","style","width","nameSpan","message","originalMessageSpan","span","types","Object","freeze","_Mime_extensionToType","_Mime_typeToExtension","_Mime_typeToExtensions","__classPrivateFieldGet","receiver","state","kind","f","TypeError","has","call","get","WeakMap","mime","args","set","Map","arg","define","typeMap","force","type","extensions","entries","toLowerCase","map","ext","Set","allExtensions","first","extension","starred","startsWith","currentType","Error","getType","path","last","replace","hasPath","getExtension","split","trim","getAllExtensions","_freeze","values","_getTestState","standardTypes","WIN_SLASH","WIN_NO_SLASH","DOT_LITERAL","SLASH_LITERAL","QMARK","END_ANCHOR","START_ANCHOR","DOTS_SLASH","POSIX_CHARS","PLUS_LITERAL","QMARK_LITERAL","ONE_CHAR","NO_DOT","NO_DOTS","NO_DOT_SLASH","NO_DOTS_SLASH","QMARK_NO_DOT","STAR","SEP","WINDOWS_CHARS","constants","MAX_LENGTH","POSIX_REGEX_SOURCE","alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit","REGEX_BACKSLASH","REGEX_NON_SPECIAL_CHARS","REGEX_SPECIAL_CHARS","REGEX_SPECIAL_CHARS_BACKREF","REGEX_SPECIAL_CHARS_GLOBAL","REGEX_REMOVE_BACKSLASH","REPLACEMENTS","CHAR_0","CHAR_9","CHAR_UPPERCASE_A","CHAR_LOWERCASE_A","CHAR_UPPERCASE_Z","CHAR_LOWERCASE_Z","CHAR_LEFT_PARENTHESES","CHAR_RIGHT_PARENTHESES","CHAR_ASTERISK","CHAR_AMPERSAND","CHAR_AT","CHAR_BACKWARD_SLASH","CHAR_CARRIAGE_RETURN","CHAR_CIRCUMFLEX_ACCENT","CHAR_COLON","CHAR_COMMA","CHAR_DOT","CHAR_DOUBLE_QUOTE","CHAR_EQUAL","CHAR_EXCLAMATION_MARK","CHAR_FORM_FEED","CHAR_FORWARD_SLASH","CHAR_GRAVE_ACCENT","CHAR_HASH","CHAR_HYPHEN_MINUS","CHAR_LEFT_ANGLE_BRACKET","CHAR_LEFT_CURLY_BRACE","CHAR_LEFT_SQUARE_BRACKET","CHAR_LINE_FEED","CHAR_NO_BREAK_SPACE","CHAR_PERCENT","CHAR_PLUS","CHAR_QUESTION_MARK","CHAR_RIGHT_ANGLE_BRACKET","CHAR_RIGHT_CURLY_BRACE","CHAR_RIGHT_SQUARE_BRACKET","CHAR_SEMICOLON","CHAR_SINGLE_QUOTE","CHAR_SPACE","CHAR_TAB","CHAR_UNDERSCORE","CHAR_VERTICAL_LINE","CHAR_ZERO_WIDTH_NOBREAK_SPACE","extglobChars","chars","open","close","globChars","win32","require$$0","exports","isObject","val","Array","isArray","hasRegexChars","test","isRegexChar","escapeRegex","toPosixSlashes","isWindows","navigator","platform","process","removeBackslashes","escapeLast","char","lastIdx","idx","lastIndexOf","removePrefix","output","wrapOutput","options","contains","negated","basename","windows","segs","utils","require$$1","isPathSeparator","code","depth","token","isPrefix","isGlobstar","Infinity","scan_1","opts","scanToEnd","parts","slashes","tokens","prev","start","isBrace","isBracket","isGlob","isExtglob","braceEscaped","backslashes","negatedExtglob","finished","braces","eos","advance","next","noext","nonegate","noparen","push","base","glob","unescape","maxDepth","prevIndex","expandRange","sort","join","RegExp","ex","v","syntaxError","parse","max","maxLength","min","len","SyntaxError","bos","prepend","capture","PLATFORM_CHARS","EXTGLOB_CHARS","globstar","dot","nodot","qmarkNoDot","star","bash","noextglob","consumed","backtrack","brackets","parens","quotes","extglobs","stack","peek","remaining","consume","num","append","negate","count","increment","decrement","pop","tok","extglob","inner","extglobOpen","conditions","extglobClose","rest","extglobStar","includes","expression","fastpaths","m","esc","repeat","posix","pre","indexOf","keepQuotes","strictBrackets","nobracket","prevValue","literalBrackets","escaped","nobrace","outputIndex","tokensIndex","brace","dots","arr","range","unshift","comma","out","toks","t","regex","noglobstar","prior","before","isStart","afterStar","after","strictSlashes","end","suffix","slashDot","create","source","scan","require$$2","require$$3","picomatch","returnState","fns","arrayMatcher","isMatch","isState","compileRe","makeRe","isIgnored","ignore","ignoreOpts","onMatch","onResult","matcher","returnObject","result","onIgnore","format","matchBase","Boolean","picomatch$1","patterns","pattern","p","returnOutput","toRegex","parsed","flags","nocase","err","debug","AcceptedFileTypes","inputAccept","mimeTypes","mimeType","filter","forEach","fileType","parseInputAccept","isAccepted","fileName","isMimeTypeAccepted","isExtensionAccepted","getEntriesFromDirectory","async","Promise","resolve","reject","directoryEntry","createReader","readEntries","getFileFromFileEntry","fileEntry","getFilesFromFileSystemEntries","entry","isFile","isDirectory","entriesFromDirectory","DropArea","onUploadFiles","renderer","acceptedFileTypes","addEventListener","e","preventDefault","onDrop","dragEvent","stopPropagation","dataTransfer","items","item","webkitGetAsEntry","getFilesFromDataTransfer","acceptedFiles","invalidFiles","error","console","uploadFiles","BaseUpload$1","status","abort","delete","urlJoin","strArray","resultArray","shift","component","normalize","arguments","splice","S3Upload","BaseUpload","csrfToken","endpoint","s3UploadDir","super","key","uploadId","createdPromise","chunks","chunkState","uploading","onError","undefined","onProgress","onSuccess","initChunks","catch","xhr","encodeURIComponent","uploadIdEnc","headers","Headers","url","urljoin","fetch","method","then","response","json","abortMultipartUpload","getId","getInitialFile","id","original_name","getSize","createUpload","desiredChunkSize","ceil","minChunkSize","chunkSize","uploaded","busy","done","_ref3","accept","body","JSON","stringify","contentType","data","createMultipartUpload","uploadParts","handleError","need","every","completeUpload","candidates","uploadPart","_ref4","number","prepareUploadPart","_ref2","uploadPartBytes","onPartProgress","sent","totalUploaded","reduce","c","onPartComplete","etag","part","PartNumber","ETag","XMLHttpRequest","responseType","upload","ev","lengthComputable","loaded","target","getResponseHeader","send","a","b","completeMultipartUpload","deleteUpload","onload","setRequestHeader","BaseUploadedFile","PlaceholderFile","initialFile","UploadedS3File","ExistingFile","UploadedTusFile","uploadUrl","DetailedError","causingErr","req","res","originalRequest","originalResponse","causingError","requestId","getHeader","getMethod","getURL","getStatus","getBody","_hasBuffer","Buffer","_TE","TextDecoder","TextEncoder","b64chs","prototype","b64tab","tab","b64re","_fromCC","String","fromCharCode","bind","_mkUriSafe","Uint8Array","from","src","m0","_tidyB64","s","btoaPolyfill","bin","u32","c0","c1","c2","asc","pad","_btoa","btoa","_fromUint8Array","u8a","strs","l","apply","subarray","cb_utob","cc","re_utob","utob","u","_encode","encode","urlsafe","atobPolyfill","u24","r1","r2","charAt","gBase64","hasOwnProperty","decode","decodeURIComponent","querystringify$1","obj","pairs","isNaN","query","parser","port","protocol","qs","controlOrWhitespace","CRHTLF","protocolre","windowsDriveLetter","trimLeft","rules","address","isSpecial","NaN","hash","lolcation","loc","location","window","global","self","finaldestination","Url","pathname","scheme","extractProtocol","forwardSlashes","otherSlashes","slashesCount","relative","extracted","instruction","instructions","concat","up","host","hostname","username","password","auth","origin","fn","ins","PROTOCOL_TUS_V1","PROTOCOL_IETF_DRAFT_03","defaultOptions","metadata","metadataForPartialUploads","fingerprint","uploadSize","onChunkComplete","onUploadUrlAvailable","overridePatchMethod","addRequestId","onBeforeRequest","onAfterResponse","onShouldRetry","defaultOnShouldRetry","Number","POSITIVE_INFINITY","retryDelays","parallelUploads","parallelUploadBoundaries","storeFingerprintForResuming","removeFingerprintOnSuccess","uploadLengthDeferred","uploadDataDuringCreation","urlStorage","fileReader","httpStack","_urlStorage","_req","_fingerprint","_urlStorageKey","_offset","_aborted","_size","_source","_retryAttempt","_retryTimeout","_offsetBeforeRetry","_parallelUploads","_parallelUploadUrls","terminate","openRequest","sendRequest","shouldRetry","delay","remainingDelays","newOptions","setTimeout","findPreviousUploads","findUploadsByFingerprint","resumeFromPreviousUpload","previousUpload","parallelUploadUrls","urlStorageKey","_emitError","optionName","openFile","_startParallelUpload","_startSingleUpload","totalSize","totalProgress","partCount","partSize","splitSizeIntoParts","uploads","lastPartProgress","newPartProgress","_emitProgress","_saveUploadInUrlStorage","all","_openRequest","setHeader","encodeMetadata","_sendRequest","inStatusCategory","_emitHttpError","resolveUrl","_emitSuccess","_resumeUpload","_createUpload","shouldTerminate","clearTimeout","_removeFromUrlStorage","lastResponse","bytesSent","bytesTotal","_emitChunkComplete","bytesAccepted","promise","_addChunkToRequest","_handleUploadResponse","_performUpload","offset","parseInt","setProgressHandler","valueSize","newSize","removeUpload","storedUpload","creationTime","Date","addUpload","Base64","category","createRequest","r","random","retryAttempt","online","onLine","isOnline","link","URL","isReactNative","product","FileSource","_file","PhoneGap","Cordova","cordova","chunk","reader","FileReader","onerror","readAsArrayBuffer","blobOrArray","StreamSource","_buffer","_bufferOffset","_reader","_done","_readUntilEnoughDataOrDone","hasEnoughData","_getDataFromBuffer","read","Blob","hasAllDataBeenRead","cancel","Request","_xhr","_method","_url","_headers","header","progressHandler","onprogress","Response","getUnderlyingObject","responseText","hasStorage","originalValue","localStorage","getItem","setItem","removeItem","SECURITY_ERR","QUOTA_EXCEEDED_ERR","canStoreURLs","getName","uri","blob","isFinite","findAllUploads","results","_findEntries","round","_e","listAllUploads","_upload","exifHash","exif","hashCode","reactNativeFingerprint","lastModified","Upload","TusUpload","formId","handleAfterReponse","addCsrTokenToRequest","handleProgress","handleSucces","bytesUploaded","request","_request","resourceId","FileField","callbacks","eventEmitter","initial","multiple","supportDropArea","disabled","nextUploadIndex","filesContainer","initDropArea","addInitialFiles","checkDropHint","onChange","handleClick","initialFiles","addInitialFile","createUploadedFile","emitEvent","uploadFile","existingUpload","findUploadByName","newUploadIndex","removeExistingUpload","handleSuccess","getUploadByIndex","find","removeUploadFromList","updatePlaceholderInput","handleInvalidFiles","getUpload","dataIndex","getAttribute","handleCancel","onClick","onDelete","placeholdersInfo","getMetaDataField","getMetadataFieldName","eventName","emit","metaDataField","initUploadFields","getPrefix","getInputValue","querySelectorAll","uploaderDiv","matchesPrefix","getInitialFiles","dataTranslations","autoInitFileForms","initFormSet","optionsParam","totalFormsValue","formCount","subFormPrefix"],"mappings":"YAAA,MAAMA,EAAYC,IAChB,MAAMC,EAASD,EAAQE,cAEvB,OAAKD,EAIkB,SAAnBA,EAAOE,QACFF,EAGFF,EAASE,GAPP,IAOc,ECQZG,EAAyBA,CACpCC,EACAC,IACYA,EAAS,GAAGA,KAAUD,IAAcA,EAE5CE,EAA4BA,CAChCF,EACAC,IACYA,EAASD,EAAUG,MAAMF,EAAOG,OAAS,GAAKJ,EAE/CK,EAAYA,CACvBC,EACAN,EACAC,KAEA,MAAMM,EAAsBR,EAAuBC,EAAWC,GACxDO,EAAQF,EAAKG,cAAc,UAAUF,OAE3C,OAAKC,GACI,IAGG,EAGDE,EAAsBA,CACjCV,EACAC,IACW,GAAGC,EAA0BF,EAAWC,aAExCU,EAAgCA,CAC3CL,EACAN,EACAC,IACuBI,EAAUC,EAAMN,EAAWC,IAASW;;;;;;;KCtC7D,IAAIC,EAAkB,UAOtBC,EAUA,SAAoBC,GAClB,IAOIC,EAPAC,EAAM,GAAKF,EACXG,EAAQL,EAAgBM,KAAKF,GAEjC,IAAKC,EACH,OAAOD,EAIT,IAAIG,EAAO,GACPC,EAAQ,EACRC,EAAY,EAEhB,IAAKD,EAAQH,EAAMG,MAAOA,EAAQJ,EAAIb,OAAQiB,IAAS,CACrD,OAAQJ,EAAIM,WAAWF,IACrB,KAAK,GACHL,EAAS,SACT,MACF,KAAK,GACHA,EAAS,QACT,MACF,KA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AQA,WAUrBqS,QAAQ0e,EAAiB,E0ClBjC3P,OAAOoQ,YCDaA,CAACh7B,EAAei7B,KAClC,IAAIjqB,EAGFA,EAD0B,iBAAjBiqB,EACC,CAAEt7B,OAAQs7B,GAEVA,EAGZ,MAAMt7B,EAASqR,EAAQrR,QAAU,OAE3Bu7B,EAAkB76B,EACtBL,EACA,cACAL,GAGF,IAAKu7B,EACH,OAGF,MAAMC,EAAYjJ,SAASgJ,EAAiB,IAE5C,IAAK,IAAI31B,EAAI,EAAGA,EAAI41B,EAAW51B,GAAK,EAAG,CACrC,MAAM61B,EAAgB37B,EAAuB8F,EAAE1C,WAAY,MAC3D03B,GAAiBv6B,EAAM,IAClBgR,EACHrR,OAAQ,GAAGA,KAAUy7B,KAEzB,GD3BFxQ,OAAO2P,iBAAmBA","x_google_ignoreList":[2,4,5,6,7,8,9,10,11,15,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38]} \ No newline at end of file +{"version":3,"file":"file_form.min.js","sources":["../../../frontend/src/auto_init_file_forms.ts","../../../frontend/node_modules/mime/dist/types/standard.js","../../../frontend/node_modules/mime/dist/src/Mime.js","../../../frontend/node_modules/mime/dist/src/index_lite.js","../../../frontend/node_modules/picomatch/lib/constants.js","../../../frontend/node_modules/picomatch/lib/utils.js","../../../frontend/node_modules/picomatch/lib/scan.js","../../../frontend/node_modules/picomatch/lib/parse.js","../../../frontend/node_modules/picomatch/lib/picomatch.js","../../../frontend/src/accepted_file_types.ts","../../../frontend/src/drop_area.ts","../../../frontend/node_modules/escape-html/index.js","../../../frontend/src/util.ts","../../../frontend/src/render_upload_file.ts","../../../frontend/src/uploads/base_upload.ts","../../../frontend/node_modules/url-join/lib/url-join.js","../../../frontend/src/uploads/s3_utils.ts","../../../frontend/src/uploads/s3_upload.ts","../../../frontend/node_modules/tus-js-client/lib/error.js","../../../frontend/node_modules/js-base64/base64.mjs","../../../frontend/node_modules/requires-port/index.js","../../../frontend/node_modules/querystringify/index.js","../../../frontend/node_modules/url-parse/index.js","../../../frontend/node_modules/tus-js-client/lib/upload.js","../../../frontend/node_modules/tus-js-client/lib/uuid.js","../../../frontend/node_modules/tus-js-client/lib/browser/isReactNative.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/FileSource.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/isCordova.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/readAsByteArray.js","../../../frontend/node_modules/tus-js-client/lib/browser/sources/StreamSource.js","../../../frontend/node_modules/tus-js-client/lib/browser/httpStack.js","../../../frontend/node_modules/tus-js-client/lib/browser/urlStorage.js","../../../frontend/node_modules/tus-js-client/lib/browser/index.js","../../../frontend/node_modules/tus-js-client/lib/browser/fileReader.js","../../../frontend/node_modules/tus-js-client/lib/browser/uriToBlob.js","../../../frontend/node_modules/tus-js-client/lib/noopUrlStorage.js","../../../frontend/node_modules/tus-js-client/lib/browser/fileSignature.js","../../../frontend/src/uploads/tus_utils.ts","../../../frontend/src/uploads/tus_upload.ts","../../../frontend/src/uploads/uploaded_file.ts","../../../frontend/src/file_field.ts","../../../frontend/src/init_upload_fields.ts","../../../frontend/src/file_form.ts","../../../frontend/src/init_form_set.ts"],"sourcesContent":["const findForm = (element: Element): HTMLElement | null => {\n const parent = element.parentElement;\n\n if (!parent) {\n return null;\n }\n\n if (parent.tagName === \"FORM\") {\n return parent;\n }\n\n return findForm(parent);\n};\n\nconst unique = (values: unknown[]): unknown[] =>\n Array.from(new Set(values).values());\n\ndeclare const window: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n\nconst autoInitFileForms = (): void => {\n const initUploadFields = window.initUploadFields as () => void; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n\n const forms = unique(\n Array.from(document.querySelectorAll(\".dff-uploader\")).map(findForm)\n );\n forms.forEach(initUploadFields);\n};\n\nexport default autoInitFileForms;\n","const types = { \"application/andrew-inset\": [\"ez\"], \"application/appinstaller\": [\"appinstaller\"], \"application/applixware\": [\"aw\"], \"application/appx\": [\"appx\"], \"application/appxbundle\": [\"appxbundle\"], \"application/atom+xml\": [\"atom\"], \"application/atomcat+xml\": [\"atomcat\"], \"application/atomdeleted+xml\": [\"atomdeleted\"], \"application/atomsvc+xml\": [\"atomsvc\"], \"application/atsc-dwd+xml\": [\"dwd\"], \"application/atsc-held+xml\": [\"held\"], \"application/atsc-rsat+xml\": [\"rsat\"], \"application/automationml-aml+xml\": [\"aml\"], \"application/automationml-amlx+zip\": [\"amlx\"], \"application/bdoc\": [\"bdoc\"], \"application/calendar+xml\": [\"xcs\"], \"application/ccxml+xml\": [\"ccxml\"], \"application/cdfx+xml\": [\"cdfx\"], \"application/cdmi-capability\": [\"cdmia\"], \"application/cdmi-container\": [\"cdmic\"], \"application/cdmi-domain\": [\"cdmid\"], \"application/cdmi-object\": [\"cdmio\"], \"application/cdmi-queue\": [\"cdmiq\"], \"application/cpl+xml\": [\"cpl\"], \"application/cu-seeme\": [\"cu\"], \"application/cwl\": [\"cwl\"], \"application/dash+xml\": [\"mpd\"], \"application/dash-patch+xml\": [\"mpp\"], \"application/davmount+xml\": [\"davmount\"], \"application/docbook+xml\": [\"dbk\"], \"application/dssc+der\": [\"dssc\"], \"application/dssc+xml\": [\"xdssc\"], \"application/ecmascript\": [\"ecma\"], \"application/emma+xml\": [\"emma\"], \"application/emotionml+xml\": [\"emotionml\"], \"application/epub+zip\": [\"epub\"], \"application/exi\": [\"exi\"], \"application/express\": [\"exp\"], \"application/fdf\": [\"fdf\"], \"application/fdt+xml\": [\"fdt\"], \"application/font-tdpfr\": [\"pfr\"], \"application/geo+json\": [\"geojson\"], \"application/gml+xml\": [\"gml\"], \"application/gpx+xml\": [\"gpx\"], \"application/gxf\": [\"gxf\"], \"application/gzip\": [\"gz\"], \"application/hjson\": [\"hjson\"], \"application/hyperstudio\": [\"stk\"], \"application/inkml+xml\": [\"ink\", \"inkml\"], \"application/ipfix\": [\"ipfix\"], \"application/its+xml\": [\"its\"], \"application/java-archive\": [\"jar\", \"war\", \"ear\"], \"application/java-serialized-object\": [\"ser\"], \"application/java-vm\": [\"class\"], \"application/javascript\": [\"*js\"], \"application/json\": [\"json\", \"map\"], \"application/json5\": [\"json5\"], \"application/jsonml+json\": [\"jsonml\"], \"application/ld+json\": [\"jsonld\"], \"application/lgr+xml\": [\"lgr\"], \"application/lost+xml\": [\"lostxml\"], \"application/mac-binhex40\": [\"hqx\"], \"application/mac-compactpro\": [\"cpt\"], \"application/mads+xml\": [\"mads\"], \"application/manifest+json\": [\"webmanifest\"], \"application/marc\": [\"mrc\"], \"application/marcxml+xml\": [\"mrcx\"], \"application/mathematica\": [\"ma\", \"nb\", \"mb\"], \"application/mathml+xml\": [\"mathml\"], \"application/mbox\": [\"mbox\"], \"application/media-policy-dataset+xml\": [\"mpf\"], \"application/mediaservercontrol+xml\": [\"mscml\"], \"application/metalink+xml\": [\"metalink\"], \"application/metalink4+xml\": [\"meta4\"], \"application/mets+xml\": [\"mets\"], \"application/mmt-aei+xml\": [\"maei\"], \"application/mmt-usd+xml\": [\"musd\"], \"application/mods+xml\": [\"mods\"], \"application/mp21\": [\"m21\", \"mp21\"], \"application/mp4\": [\"*mp4\", \"*mpg4\", \"mp4s\", \"m4p\"], \"application/msix\": [\"msix\"], \"application/msixbundle\": [\"msixbundle\"], \"application/msword\": [\"doc\", \"dot\"], \"application/mxf\": [\"mxf\"], \"application/n-quads\": [\"nq\"], \"application/n-triples\": [\"nt\"], \"application/node\": [\"cjs\"], \"application/octet-stream\": [\"bin\", \"dms\", \"lrf\", \"mar\", \"so\", \"dist\", \"distz\", \"pkg\", \"bpk\", \"dump\", \"elc\", \"deploy\", \"exe\", \"dll\", \"deb\", \"dmg\", \"iso\", \"img\", \"msi\", \"msp\", \"msm\", \"buffer\"], \"application/oda\": [\"oda\"], \"application/oebps-package+xml\": [\"opf\"], \"application/ogg\": [\"ogx\"], \"application/omdoc+xml\": [\"omdoc\"], \"application/onenote\": [\"onetoc\", \"onetoc2\", \"onetmp\", \"onepkg\"], \"application/oxps\": [\"oxps\"], \"application/p2p-overlay+xml\": [\"relo\"], \"application/patch-ops-error+xml\": [\"xer\"], \"application/pdf\": [\"pdf\"], \"application/pgp-encrypted\": [\"pgp\"], \"application/pgp-keys\": [\"asc\"], \"application/pgp-signature\": [\"sig\", \"*asc\"], \"application/pics-rules\": [\"prf\"], \"application/pkcs10\": [\"p10\"], \"application/pkcs7-mime\": [\"p7m\", \"p7c\"], \"application/pkcs7-signature\": [\"p7s\"], \"application/pkcs8\": [\"p8\"], \"application/pkix-attr-cert\": [\"ac\"], \"application/pkix-cert\": [\"cer\"], \"application/pkix-crl\": [\"crl\"], \"application/pkix-pkipath\": [\"pkipath\"], \"application/pkixcmp\": [\"pki\"], \"application/pls+xml\": [\"pls\"], \"application/postscript\": [\"ai\", \"eps\", \"ps\"], \"application/provenance+xml\": [\"provx\"], \"application/pskc+xml\": [\"pskcxml\"], \"application/raml+yaml\": [\"raml\"], \"application/rdf+xml\": [\"rdf\", \"owl\"], \"application/reginfo+xml\": [\"rif\"], \"application/relax-ng-compact-syntax\": [\"rnc\"], \"application/resource-lists+xml\": [\"rl\"], \"application/resource-lists-diff+xml\": [\"rld\"], \"application/rls-services+xml\": [\"rs\"], \"application/route-apd+xml\": [\"rapd\"], \"application/route-s-tsid+xml\": [\"sls\"], \"application/route-usd+xml\": [\"rusd\"], \"application/rpki-ghostbusters\": [\"gbr\"], \"application/rpki-manifest\": [\"mft\"], \"application/rpki-roa\": [\"roa\"], \"application/rsd+xml\": [\"rsd\"], \"application/rss+xml\": [\"rss\"], \"application/rtf\": [\"rtf\"], \"application/sbml+xml\": [\"sbml\"], \"application/scvp-cv-request\": [\"scq\"], \"application/scvp-cv-response\": [\"scs\"], \"application/scvp-vp-request\": [\"spq\"], \"application/scvp-vp-response\": [\"spp\"], \"application/sdp\": [\"sdp\"], \"application/senml+xml\": [\"senmlx\"], \"application/sensml+xml\": [\"sensmlx\"], \"application/set-payment-initiation\": [\"setpay\"], \"application/set-registration-initiation\": [\"setreg\"], \"application/shf+xml\": [\"shf\"], \"application/sieve\": [\"siv\", \"sieve\"], \"application/smil+xml\": [\"smi\", \"smil\"], \"application/sparql-query\": [\"rq\"], \"application/sparql-results+xml\": [\"srx\"], \"application/sql\": [\"sql\"], \"application/srgs\": [\"gram\"], \"application/srgs+xml\": [\"grxml\"], \"application/sru+xml\": [\"sru\"], \"application/ssdl+xml\": [\"ssdl\"], \"application/ssml+xml\": [\"ssml\"], \"application/swid+xml\": [\"swidtag\"], \"application/tei+xml\": [\"tei\", \"teicorpus\"], \"application/thraud+xml\": [\"tfi\"], \"application/timestamped-data\": [\"tsd\"], \"application/toml\": [\"toml\"], \"application/trig\": [\"trig\"], \"application/ttml+xml\": [\"ttml\"], \"application/ubjson\": [\"ubj\"], \"application/urc-ressheet+xml\": [\"rsheet\"], \"application/urc-targetdesc+xml\": [\"td\"], \"application/voicexml+xml\": [\"vxml\"], \"application/wasm\": [\"wasm\"], \"application/watcherinfo+xml\": [\"wif\"], \"application/widget\": [\"wgt\"], \"application/winhlp\": [\"hlp\"], \"application/wsdl+xml\": [\"wsdl\"], \"application/wspolicy+xml\": [\"wspolicy\"], \"application/xaml+xml\": [\"xaml\"], \"application/xcap-att+xml\": [\"xav\"], \"application/xcap-caps+xml\": [\"xca\"], \"application/xcap-diff+xml\": [\"xdf\"], \"application/xcap-el+xml\": [\"xel\"], \"application/xcap-ns+xml\": [\"xns\"], \"application/xenc+xml\": [\"xenc\"], \"application/xfdf\": [\"xfdf\"], \"application/xhtml+xml\": [\"xhtml\", \"xht\"], \"application/xliff+xml\": [\"xlf\"], \"application/xml\": [\"xml\", \"xsl\", \"xsd\", \"rng\"], \"application/xml-dtd\": [\"dtd\"], \"application/xop+xml\": [\"xop\"], \"application/xproc+xml\": [\"xpl\"], \"application/xslt+xml\": [\"*xsl\", \"xslt\"], \"application/xspf+xml\": [\"xspf\"], \"application/xv+xml\": [\"mxml\", \"xhvml\", \"xvml\", \"xvm\"], \"application/yang\": [\"yang\"], \"application/yin+xml\": [\"yin\"], \"application/zip\": [\"zip\"], \"audio/3gpp\": [\"*3gpp\"], \"audio/aac\": [\"adts\", \"aac\"], \"audio/adpcm\": [\"adp\"], \"audio/amr\": [\"amr\"], \"audio/basic\": [\"au\", \"snd\"], \"audio/midi\": [\"mid\", \"midi\", \"kar\", \"rmi\"], \"audio/mobile-xmf\": [\"mxmf\"], \"audio/mp3\": [\"*mp3\"], \"audio/mp4\": [\"m4a\", \"mp4a\"], \"audio/mpeg\": [\"mpga\", \"mp2\", \"mp2a\", \"mp3\", \"m2a\", \"m3a\"], \"audio/ogg\": [\"oga\", \"ogg\", \"spx\", \"opus\"], \"audio/s3m\": [\"s3m\"], \"audio/silk\": [\"sil\"], \"audio/wav\": [\"wav\"], \"audio/wave\": [\"*wav\"], \"audio/webm\": [\"weba\"], \"audio/xm\": [\"xm\"], \"font/collection\": [\"ttc\"], \"font/otf\": [\"otf\"], \"font/ttf\": [\"ttf\"], \"font/woff\": [\"woff\"], \"font/woff2\": [\"woff2\"], \"image/aces\": [\"exr\"], \"image/apng\": [\"apng\"], \"image/avci\": [\"avci\"], \"image/avcs\": [\"avcs\"], \"image/avif\": [\"avif\"], \"image/bmp\": [\"bmp\", \"dib\"], \"image/cgm\": [\"cgm\"], \"image/dicom-rle\": [\"drle\"], \"image/dpx\": [\"dpx\"], \"image/emf\": [\"emf\"], \"image/fits\": [\"fits\"], \"image/g3fax\": [\"g3\"], \"image/gif\": [\"gif\"], \"image/heic\": [\"heic\"], \"image/heic-sequence\": [\"heics\"], \"image/heif\": [\"heif\"], \"image/heif-sequence\": [\"heifs\"], \"image/hej2k\": [\"hej2\"], \"image/hsj2\": [\"hsj2\"], \"image/ief\": [\"ief\"], \"image/jls\": [\"jls\"], \"image/jp2\": [\"jp2\", \"jpg2\"], \"image/jpeg\": [\"jpeg\", \"jpg\", \"jpe\"], \"image/jph\": [\"jph\"], \"image/jphc\": [\"jhc\"], \"image/jpm\": [\"jpm\", \"jpgm\"], \"image/jpx\": [\"jpx\", \"jpf\"], \"image/jxr\": [\"jxr\"], \"image/jxra\": [\"jxra\"], \"image/jxrs\": [\"jxrs\"], \"image/jxs\": [\"jxs\"], \"image/jxsc\": [\"jxsc\"], \"image/jxsi\": [\"jxsi\"], \"image/jxss\": [\"jxss\"], \"image/ktx\": [\"ktx\"], \"image/ktx2\": [\"ktx2\"], \"image/png\": [\"png\"], \"image/sgi\": [\"sgi\"], \"image/svg+xml\": [\"svg\", \"svgz\"], \"image/t38\": [\"t38\"], \"image/tiff\": [\"tif\", \"tiff\"], \"image/tiff-fx\": [\"tfx\"], \"image/webp\": [\"webp\"], \"image/wmf\": [\"wmf\"], \"message/disposition-notification\": [\"disposition-notification\"], \"message/global\": [\"u8msg\"], \"message/global-delivery-status\": [\"u8dsn\"], \"message/global-disposition-notification\": [\"u8mdn\"], \"message/global-headers\": [\"u8hdr\"], \"message/rfc822\": [\"eml\", \"mime\"], \"model/3mf\": [\"3mf\"], \"model/gltf+json\": [\"gltf\"], \"model/gltf-binary\": [\"glb\"], \"model/iges\": [\"igs\", \"iges\"], \"model/jt\": [\"jt\"], \"model/mesh\": [\"msh\", \"mesh\", \"silo\"], \"model/mtl\": [\"mtl\"], \"model/obj\": [\"obj\"], \"model/prc\": [\"prc\"], \"model/step+xml\": [\"stpx\"], \"model/step+zip\": [\"stpz\"], \"model/step-xml+zip\": [\"stpxz\"], \"model/stl\": [\"stl\"], \"model/u3d\": [\"u3d\"], \"model/vrml\": [\"wrl\", \"vrml\"], \"model/x3d+binary\": [\"*x3db\", \"x3dbz\"], \"model/x3d+fastinfoset\": [\"x3db\"], \"model/x3d+vrml\": [\"*x3dv\", \"x3dvz\"], \"model/x3d+xml\": [\"x3d\", \"x3dz\"], \"model/x3d-vrml\": [\"x3dv\"], \"text/cache-manifest\": [\"appcache\", \"manifest\"], \"text/calendar\": [\"ics\", \"ifb\"], \"text/coffeescript\": [\"coffee\", \"litcoffee\"], \"text/css\": [\"css\"], \"text/csv\": [\"csv\"], \"text/html\": [\"html\", \"htm\", \"shtml\"], \"text/jade\": [\"jade\"], \"text/javascript\": [\"js\", \"mjs\"], \"text/jsx\": [\"jsx\"], \"text/less\": [\"less\"], \"text/markdown\": [\"md\", \"markdown\"], \"text/mathml\": [\"mml\"], \"text/mdx\": [\"mdx\"], \"text/n3\": [\"n3\"], \"text/plain\": [\"txt\", \"text\", \"conf\", \"def\", \"list\", \"log\", \"in\", \"ini\"], \"text/richtext\": [\"rtx\"], \"text/rtf\": [\"*rtf\"], \"text/sgml\": [\"sgml\", \"sgm\"], \"text/shex\": [\"shex\"], \"text/slim\": [\"slim\", \"slm\"], \"text/spdx\": [\"spdx\"], \"text/stylus\": [\"stylus\", \"styl\"], \"text/tab-separated-values\": [\"tsv\"], \"text/troff\": [\"t\", \"tr\", \"roff\", \"man\", \"me\", \"ms\"], \"text/turtle\": [\"ttl\"], \"text/uri-list\": [\"uri\", \"uris\", \"urls\"], \"text/vcard\": [\"vcard\"], \"text/vtt\": [\"vtt\"], \"text/wgsl\": [\"wgsl\"], \"text/xml\": [\"*xml\"], \"text/yaml\": [\"yaml\", \"yml\"], \"video/3gpp\": [\"3gp\", \"3gpp\"], \"video/3gpp2\": [\"3g2\"], \"video/h261\": [\"h261\"], \"video/h263\": [\"h263\"], \"video/h264\": [\"h264\"], \"video/iso.segment\": [\"m4s\"], \"video/jpeg\": [\"jpgv\"], \"video/jpm\": [\"*jpm\", \"*jpgm\"], \"video/mj2\": [\"mj2\", \"mjp2\"], \"video/mp2t\": [\"ts\"], \"video/mp4\": [\"mp4\", \"mp4v\", \"mpg4\"], \"video/mpeg\": [\"mpeg\", \"mpg\", \"mpe\", \"m1v\", \"m2v\"], \"video/ogg\": [\"ogv\"], \"video/quicktime\": [\"qt\", \"mov\"], \"video/webm\": [\"webm\"] };\nObject.freeze(types);\nexport default types;\n//# sourceMappingURL=standard.js.map","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _Mime_extensionToType, _Mime_typeToExtension, _Mime_typeToExtensions;\nclass Mime {\n constructor(...args) {\n _Mime_extensionToType.set(this, new Map());\n _Mime_typeToExtension.set(this, new Map());\n _Mime_typeToExtensions.set(this, new Map());\n for (const arg of args) {\n this.define(arg);\n }\n }\n define(typeMap, force = false) {\n for (let [type, extensions] of Object.entries(typeMap)) {\n type = type.toLowerCase();\n extensions = extensions.map((ext) => ext.toLowerCase());\n if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").has(type)) {\n __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").set(type, new Set());\n }\n const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type);\n let first = true;\n for (let extension of extensions) {\n const starred = extension.startsWith('*');\n extension = starred ? extension.slice(1) : extension;\n allExtensions?.add(extension);\n if (first) {\n __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").set(type, extension);\n }\n first = false;\n if (starred)\n continue;\n const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(extension);\n if (currentType && currentType != type && !force) {\n throw new Error(`\"${type} -> ${extension}\" conflicts with \"${currentType} -> ${extension}\". Pass \\`force=true\\` to override this definition.`);\n }\n __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").set(extension, type);\n }\n }\n return this;\n }\n getType(path) {\n if (typeof path !== 'string')\n return null;\n const last = path.replace(/^.*[/\\\\]/, '').toLowerCase();\n const ext = last.replace(/^.*\\./, '').toLowerCase();\n const hasPath = last.length < path.length;\n const hasDot = ext.length < last.length - 1;\n if (!hasDot && hasPath)\n return null;\n return __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(ext) ?? null;\n }\n getExtension(type) {\n if (typeof type !== 'string')\n return null;\n type = type?.split?.(';')[0];\n return ((type && __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").get(type.trim().toLowerCase())) ?? null);\n }\n getAllExtensions(type) {\n if (typeof type !== 'string')\n return null;\n return __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type.toLowerCase()) ?? null;\n }\n _freeze() {\n this.define = () => {\n throw new Error('define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances');\n };\n Object.freeze(this);\n for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").values()) {\n Object.freeze(extensions);\n }\n return this;\n }\n _getTestState() {\n return {\n types: __classPrivateFieldGet(this, _Mime_extensionToType, \"f\"),\n extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\"),\n };\n }\n}\n_Mime_extensionToType = new WeakMap(), _Mime_typeToExtension = new WeakMap(), _Mime_typeToExtensions = new WeakMap();\nexport default Mime;\n//# sourceMappingURL=Mime.js.map","import standardTypes from '../types/standard.js';\nimport Mime from './Mime.js';\nexport { default as Mime } from './Mime.js';\nexport default new Mime(standardTypes)._freeze();\n//# sourceMappingURL=index_lite.js.map","'use strict';\n\nconst WIN_SLASH = '\\\\\\\\/';\nconst WIN_NO_SLASH = `[^${WIN_SLASH}]`;\n\n/**\n * Posix glob regex\n */\n\nconst DOT_LITERAL = '\\\\.';\nconst PLUS_LITERAL = '\\\\+';\nconst QMARK_LITERAL = '\\\\?';\nconst SLASH_LITERAL = '\\\\/';\nconst ONE_CHAR = '(?=.)';\nconst QMARK = '[^/]';\nconst END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;\nconst START_ANCHOR = `(?:^|${SLASH_LITERAL})`;\nconst DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;\nconst NO_DOT = `(?!${DOT_LITERAL})`;\nconst NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;\nconst NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;\nconst NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;\nconst QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;\nconst STAR = `${QMARK}*?`;\nconst SEP = '/';\n\nconst POSIX_CHARS = {\n DOT_LITERAL,\n PLUS_LITERAL,\n QMARK_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n QMARK,\n END_ANCHOR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOTS,\n NO_DOT_SLASH,\n NO_DOTS_SLASH,\n QMARK_NO_DOT,\n STAR,\n START_ANCHOR,\n SEP\n};\n\n/**\n * Windows glob regex\n */\n\nconst WINDOWS_CHARS = {\n ...POSIX_CHARS,\n\n SLASH_LITERAL: `[${WIN_SLASH}]`,\n QMARK: WIN_NO_SLASH,\n STAR: `${WIN_NO_SLASH}*?`,\n DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,\n NO_DOT: `(?!${DOT_LITERAL})`,\n NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,\n NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,\n QMARK_NO_DOT: `[^.${WIN_SLASH}]`,\n START_ANCHOR: `(?:^|[${WIN_SLASH}])`,\n END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,\n SEP: '\\\\'\n};\n\n/**\n * POSIX Bracket Regex\n */\n\nconst POSIX_REGEX_SOURCE = {\n alnum: 'a-zA-Z0-9',\n alpha: 'a-zA-Z',\n ascii: '\\\\x00-\\\\x7F',\n blank: ' \\\\t',\n cntrl: '\\\\x00-\\\\x1F\\\\x7F',\n digit: '0-9',\n graph: '\\\\x21-\\\\x7E',\n lower: 'a-z',\n print: '\\\\x20-\\\\x7E ',\n punct: '\\\\-!\"#$%&\\'()\\\\*+,./:;<=>?@[\\\\]^_`{|}~',\n space: ' \\\\t\\\\r\\\\n\\\\v\\\\f',\n upper: 'A-Z',\n word: 'A-Za-z0-9_',\n xdigit: 'A-Fa-f0-9'\n};\n\nmodule.exports = {\n MAX_LENGTH: 1024 * 64,\n POSIX_REGEX_SOURCE,\n\n // regular expressions\n REGEX_BACKSLASH: /\\\\(?![*+?^${}(|)[\\]])/g,\n REGEX_NON_SPECIAL_CHARS: /^[^@![\\].,$*+?^{}()|\\\\/]+/,\n REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\\]]/,\n REGEX_SPECIAL_CHARS_BACKREF: /(\\\\?)((\\W)(\\3*))/g,\n REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\\]])/g,\n REGEX_REMOVE_BACKSLASH: /(?:\\[.*?[^\\\\]\\]|\\\\(?=.))/g,\n\n // Replace globs with equivalent patterns to reduce parsing time.\n REPLACEMENTS: {\n '***': '*',\n '**/**': '**',\n '**/**/**': '**'\n },\n\n // Digits\n CHAR_0: 48, /* 0 */\n CHAR_9: 57, /* 9 */\n\n // Alphabet chars.\n CHAR_UPPERCASE_A: 65, /* A */\n CHAR_LOWERCASE_A: 97, /* a */\n CHAR_UPPERCASE_Z: 90, /* Z */\n CHAR_LOWERCASE_Z: 122, /* z */\n\n CHAR_LEFT_PARENTHESES: 40, /* ( */\n CHAR_RIGHT_PARENTHESES: 41, /* ) */\n\n CHAR_ASTERISK: 42, /* * */\n\n // Non-alphabetic chars.\n CHAR_AMPERSAND: 38, /* & */\n CHAR_AT: 64, /* @ */\n CHAR_BACKWARD_SLASH: 92, /* \\ */\n CHAR_CARRIAGE_RETURN: 13, /* \\r */\n CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */\n CHAR_COLON: 58, /* : */\n CHAR_COMMA: 44, /* , */\n CHAR_DOT: 46, /* . */\n CHAR_DOUBLE_QUOTE: 34, /* \" */\n CHAR_EQUAL: 61, /* = */\n CHAR_EXCLAMATION_MARK: 33, /* ! */\n CHAR_FORM_FEED: 12, /* \\f */\n CHAR_FORWARD_SLASH: 47, /* / */\n CHAR_GRAVE_ACCENT: 96, /* ` */\n CHAR_HASH: 35, /* # */\n CHAR_HYPHEN_MINUS: 45, /* - */\n CHAR_LEFT_ANGLE_BRACKET: 60, /* < */\n CHAR_LEFT_CURLY_BRACE: 123, /* { */\n CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */\n CHAR_LINE_FEED: 10, /* \\n */\n CHAR_NO_BREAK_SPACE: 160, /* \\u00A0 */\n CHAR_PERCENT: 37, /* % */\n CHAR_PLUS: 43, /* + */\n CHAR_QUESTION_MARK: 63, /* ? */\n CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */\n CHAR_RIGHT_CURLY_BRACE: 125, /* } */\n CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */\n CHAR_SEMICOLON: 59, /* ; */\n CHAR_SINGLE_QUOTE: 39, /* ' */\n CHAR_SPACE: 32, /* */\n CHAR_TAB: 9, /* \\t */\n CHAR_UNDERSCORE: 95, /* _ */\n CHAR_VERTICAL_LINE: 124, /* | */\n CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \\uFEFF */\n\n /**\n * Create EXTGLOB_CHARS\n */\n\n extglobChars(chars) {\n return {\n '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },\n '?': { type: 'qmark', open: '(?:', close: ')?' },\n '+': { type: 'plus', open: '(?:', close: ')+' },\n '*': { type: 'star', open: '(?:', close: ')*' },\n '@': { type: 'at', open: '(?:', close: ')' }\n };\n },\n\n /**\n * Create GLOB_CHARS\n */\n\n globChars(win32) {\n return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;\n }\n};\n","/*global navigator*/\n'use strict';\n\nconst {\n REGEX_BACKSLASH,\n REGEX_REMOVE_BACKSLASH,\n REGEX_SPECIAL_CHARS,\n REGEX_SPECIAL_CHARS_GLOBAL\n} = require('./constants');\n\nexports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);\nexports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);\nexports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);\nexports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\\\$1');\nexports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');\n\nexports.isWindows = () => {\n if (typeof navigator !== 'undefined' && navigator.platform) {\n const platform = navigator.platform.toLowerCase();\n return platform === 'win32' || platform === 'windows';\n }\n\n if (typeof process !== 'undefined' && process.platform) {\n return process.platform === 'win32';\n }\n\n return false;\n};\n\nexports.removeBackslashes = str => {\n return str.replace(REGEX_REMOVE_BACKSLASH, match => {\n return match === '\\\\' ? '' : match;\n });\n};\n\nexports.escapeLast = (input, char, lastIdx) => {\n const idx = input.lastIndexOf(char, lastIdx);\n if (idx === -1) return input;\n if (input[idx - 1] === '\\\\') return exports.escapeLast(input, char, idx - 1);\n return `${input.slice(0, idx)}\\\\${input.slice(idx)}`;\n};\n\nexports.removePrefix = (input, state = {}) => {\n let output = input;\n if (output.startsWith('./')) {\n output = output.slice(2);\n state.prefix = './';\n }\n return output;\n};\n\nexports.wrapOutput = (input, state = {}, options = {}) => {\n const prepend = options.contains ? '' : '^';\n const append = options.contains ? '' : '$';\n\n let output = `${prepend}(?:${input})${append}`;\n if (state.negated === true) {\n output = `(?:^(?!${output}).*$)`;\n }\n return output;\n};\n\nexports.basename = (path, { windows } = {}) => {\n const segs = path.split(windows ? /[\\\\/]/ : '/');\n const last = segs[segs.length - 1];\n\n if (last === '') {\n return segs[segs.length - 2];\n }\n\n return last;\n};\n","'use strict';\n\nconst utils = require('./utils');\nconst {\n CHAR_ASTERISK, /* * */\n CHAR_AT, /* @ */\n CHAR_BACKWARD_SLASH, /* \\ */\n CHAR_COMMA, /* , */\n CHAR_DOT, /* . */\n CHAR_EXCLAMATION_MARK, /* ! */\n CHAR_FORWARD_SLASH, /* / */\n CHAR_LEFT_CURLY_BRACE, /* { */\n CHAR_LEFT_PARENTHESES, /* ( */\n CHAR_LEFT_SQUARE_BRACKET, /* [ */\n CHAR_PLUS, /* + */\n CHAR_QUESTION_MARK, /* ? */\n CHAR_RIGHT_CURLY_BRACE, /* } */\n CHAR_RIGHT_PARENTHESES, /* ) */\n CHAR_RIGHT_SQUARE_BRACKET /* ] */\n} = require('./constants');\n\nconst isPathSeparator = code => {\n return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n};\n\nconst depth = token => {\n if (token.isPrefix !== true) {\n token.depth = token.isGlobstar ? Infinity : 1;\n }\n};\n\n/**\n * Quickly scans a glob pattern and returns an object with a handful of\n * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),\n * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not\n * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).\n *\n * ```js\n * const pm = require('picomatch');\n * console.log(pm.scan('foo/bar/*.js'));\n * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }\n * ```\n * @param {String} `str`\n * @param {Object} `options`\n * @return {Object} Returns an object with tokens and regex source string.\n * @api public\n */\n\nconst scan = (input, options) => {\n const opts = options || {};\n\n const length = input.length - 1;\n const scanToEnd = opts.parts === true || opts.scanToEnd === true;\n const slashes = [];\n const tokens = [];\n const parts = [];\n\n let str = input;\n let index = -1;\n let start = 0;\n let lastIndex = 0;\n let isBrace = false;\n let isBracket = false;\n let isGlob = false;\n let isExtglob = false;\n let isGlobstar = false;\n let braceEscaped = false;\n let backslashes = false;\n let negated = false;\n let negatedExtglob = false;\n let finished = false;\n let braces = 0;\n let prev;\n let code;\n let token = { value: '', depth: 0, isGlob: false };\n\n const eos = () => index >= length;\n const peek = () => str.charCodeAt(index + 1);\n const advance = () => {\n prev = code;\n return str.charCodeAt(++index);\n };\n\n while (index < length) {\n code = advance();\n let next;\n\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braceEscaped = true;\n }\n continue;\n }\n\n if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n continue;\n }\n\n if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (braceEscaped !== true && code === CHAR_COMMA) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_RIGHT_CURLY_BRACE) {\n braces--;\n\n if (braces === 0) {\n braceEscaped = false;\n isBrace = token.isBrace = true;\n finished = true;\n break;\n }\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_FORWARD_SLASH) {\n slashes.push(index);\n tokens.push(token);\n token = { value: '', depth: 0, isGlob: false };\n\n if (finished === true) continue;\n if (prev === CHAR_DOT && index === (start + 1)) {\n start += 2;\n continue;\n }\n\n lastIndex = index + 1;\n continue;\n }\n\n if (opts.noext !== true) {\n const isExtglobChar = code === CHAR_PLUS\n || code === CHAR_AT\n || code === CHAR_ASTERISK\n || code === CHAR_QUESTION_MARK\n || code === CHAR_EXCLAMATION_MARK;\n\n if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n isExtglob = token.isExtglob = true;\n finished = true;\n if (code === CHAR_EXCLAMATION_MARK && index === start) {\n negatedExtglob = true;\n }\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n }\n\n if (code === CHAR_ASTERISK) {\n if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_QUESTION_MARK) {\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_LEFT_SQUARE_BRACKET) {\n while (eos() !== true && (next = advance())) {\n if (next === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (next === CHAR_RIGHT_SQUARE_BRACKET) {\n isBracket = token.isBracket = true;\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {\n negated = token.negated = true;\n start++;\n continue;\n }\n\n if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_LEFT_PARENTHESES) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n\n if (isGlob === true) {\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n }\n\n if (opts.noext === true) {\n isExtglob = false;\n isGlob = false;\n }\n\n let base = str;\n let prefix = '';\n let glob = '';\n\n if (start > 0) {\n prefix = str.slice(0, start);\n str = str.slice(start);\n lastIndex -= start;\n }\n\n if (base && isGlob === true && lastIndex > 0) {\n base = str.slice(0, lastIndex);\n glob = str.slice(lastIndex);\n } else if (isGlob === true) {\n base = '';\n glob = str;\n } else {\n base = str;\n }\n\n if (base && base !== '' && base !== '/' && base !== str) {\n if (isPathSeparator(base.charCodeAt(base.length - 1))) {\n base = base.slice(0, -1);\n }\n }\n\n if (opts.unescape === true) {\n if (glob) glob = utils.removeBackslashes(glob);\n\n if (base && backslashes === true) {\n base = utils.removeBackslashes(base);\n }\n }\n\n const state = {\n prefix,\n input,\n start,\n base,\n glob,\n isBrace,\n isBracket,\n isGlob,\n isExtglob,\n isGlobstar,\n negated,\n negatedExtglob\n };\n\n if (opts.tokens === true) {\n state.maxDepth = 0;\n if (!isPathSeparator(code)) {\n tokens.push(token);\n }\n state.tokens = tokens;\n }\n\n if (opts.parts === true || opts.tokens === true) {\n let prevIndex;\n\n for (let idx = 0; idx < slashes.length; idx++) {\n const n = prevIndex ? prevIndex + 1 : start;\n const i = slashes[idx];\n const value = input.slice(n, i);\n if (opts.tokens) {\n if (idx === 0 && start !== 0) {\n tokens[idx].isPrefix = true;\n tokens[idx].value = prefix;\n } else {\n tokens[idx].value = value;\n }\n depth(tokens[idx]);\n state.maxDepth += tokens[idx].depth;\n }\n if (idx !== 0 || value !== '') {\n parts.push(value);\n }\n prevIndex = i;\n }\n\n if (prevIndex && prevIndex + 1 < input.length) {\n const value = input.slice(prevIndex + 1);\n parts.push(value);\n\n if (opts.tokens) {\n tokens[tokens.length - 1].value = value;\n depth(tokens[tokens.length - 1]);\n state.maxDepth += tokens[tokens.length - 1].depth;\n }\n }\n\n state.slashes = slashes;\n state.parts = parts;\n }\n\n return state;\n};\n\nmodule.exports = scan;\n","'use strict';\n\nconst constants = require('./constants');\nconst utils = require('./utils');\n\n/**\n * Constants\n */\n\nconst {\n MAX_LENGTH,\n POSIX_REGEX_SOURCE,\n REGEX_NON_SPECIAL_CHARS,\n REGEX_SPECIAL_CHARS_BACKREF,\n REPLACEMENTS\n} = constants;\n\n/**\n * Helpers\n */\n\nconst expandRange = (args, options) => {\n if (typeof options.expandRange === 'function') {\n return options.expandRange(...args, options);\n }\n\n args.sort();\n const value = `[${args.join('-')}]`;\n\n try {\n /* eslint-disable-next-line no-new */\n new RegExp(value);\n } catch (ex) {\n return args.map(v => utils.escapeRegex(v)).join('..');\n }\n\n return value;\n};\n\n/**\n * Create the message for a syntax error\n */\n\nconst syntaxError = (type, char) => {\n return `Missing ${type}: \"${char}\" - use \"\\\\\\\\${char}\" to match literal characters`;\n};\n\n/**\n * Parse the given input string.\n * @param {String} input\n * @param {Object} options\n * @return {Object}\n */\n\nconst parse = (input, options) => {\n if (typeof input !== 'string') {\n throw new TypeError('Expected a string');\n }\n\n input = REPLACEMENTS[input] || input;\n\n const opts = { ...options };\n const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n\n let len = input.length;\n if (len > max) {\n throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n }\n\n const bos = { type: 'bos', value: '', output: opts.prepend || '' };\n const tokens = [bos];\n\n const capture = opts.capture ? '' : '?:';\n\n // create constants based on platform, for windows or posix\n const PLATFORM_CHARS = constants.globChars(opts.windows);\n const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);\n\n const {\n DOT_LITERAL,\n PLUS_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOT_SLASH,\n NO_DOTS_SLASH,\n QMARK,\n QMARK_NO_DOT,\n STAR,\n START_ANCHOR\n } = PLATFORM_CHARS;\n\n const globstar = opts => {\n return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n };\n\n const nodot = opts.dot ? '' : NO_DOT;\n const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;\n let star = opts.bash === true ? globstar(opts) : STAR;\n\n if (opts.capture) {\n star = `(${star})`;\n }\n\n // minimatch options support\n if (typeof opts.noext === 'boolean') {\n opts.noextglob = opts.noext;\n }\n\n const state = {\n input,\n index: -1,\n start: 0,\n dot: opts.dot === true,\n consumed: '',\n output: '',\n prefix: '',\n backtrack: false,\n negated: false,\n brackets: 0,\n braces: 0,\n parens: 0,\n quotes: 0,\n globstar: false,\n tokens\n };\n\n input = utils.removePrefix(input, state);\n len = input.length;\n\n const extglobs = [];\n const braces = [];\n const stack = [];\n let prev = bos;\n let value;\n\n /**\n * Tokenizing helpers\n */\n\n const eos = () => state.index === len - 1;\n const peek = state.peek = (n = 1) => input[state.index + n];\n const advance = state.advance = () => input[++state.index] || '';\n const remaining = () => input.slice(state.index + 1);\n const consume = (value = '', num = 0) => {\n state.consumed += value;\n state.index += num;\n };\n\n const append = token => {\n state.output += token.output != null ? token.output : token.value;\n consume(token.value);\n };\n\n const negate = () => {\n let count = 1;\n\n while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {\n advance();\n state.start++;\n count++;\n }\n\n if (count % 2 === 0) {\n return false;\n }\n\n state.negated = true;\n state.start++;\n return true;\n };\n\n const increment = type => {\n state[type]++;\n stack.push(type);\n };\n\n const decrement = type => {\n state[type]--;\n stack.pop();\n };\n\n /**\n * Push tokens onto the tokens array. This helper speeds up\n * tokenizing by 1) helping us avoid backtracking as much as possible,\n * and 2) helping us avoid creating extra tokens when consecutive\n * characters are plain text. This improves performance and simplifies\n * lookbehinds.\n */\n\n const push = tok => {\n if (prev.type === 'globstar') {\n const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');\n const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));\n\n if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {\n state.output = state.output.slice(0, -prev.output.length);\n prev.type = 'star';\n prev.value = '*';\n prev.output = star;\n state.output += prev.output;\n }\n }\n\n if (extglobs.length && tok.type !== 'paren') {\n extglobs[extglobs.length - 1].inner += tok.value;\n }\n\n if (tok.value || tok.output) append(tok);\n if (prev && prev.type === 'text' && tok.type === 'text') {\n prev.output = (prev.output || prev.value) + tok.value;\n prev.value += tok.value;\n return;\n }\n\n tok.prev = prev;\n tokens.push(tok);\n prev = tok;\n };\n\n const extglobOpen = (type, value) => {\n const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };\n\n token.prev = prev;\n token.parens = state.parens;\n token.output = state.output;\n const output = (opts.capture ? '(' : '') + token.open;\n\n increment('parens');\n push({ type, value, output: state.output ? '' : ONE_CHAR });\n push({ type: 'paren', extglob: true, value: advance(), output });\n extglobs.push(token);\n };\n\n const extglobClose = token => {\n let output = token.close + (opts.capture ? ')' : '');\n let rest;\n\n if (token.type === 'negate') {\n let extglobStar = star;\n\n if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {\n extglobStar = globstar(opts);\n }\n\n if (extglobStar !== star || eos() || /^\\)+$/.test(remaining())) {\n output = token.close = `)$))${extglobStar}`;\n }\n\n if (token.inner.includes('*') && (rest = remaining()) && /^\\.[^\\\\/.]+$/.test(rest)) {\n // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis.\n // In this case, we need to parse the string and use it in the output of the original pattern.\n // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`.\n //\n // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`.\n const expression = parse(rest, { ...options, fastpaths: false }).output;\n\n output = token.close = `)${expression})${extglobStar})`;\n }\n\n if (token.prev.type === 'bos') {\n state.negatedExtglob = true;\n }\n }\n\n push({ type: 'paren', extglob: true, value, output });\n decrement('parens');\n };\n\n /**\n * Fast paths\n */\n\n if (opts.fastpaths !== false && !/(^[*!]|[/()[\\]{}\"])/.test(input)) {\n let backslashes = false;\n\n let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {\n if (first === '\\\\') {\n backslashes = true;\n return m;\n }\n\n if (first === '?') {\n if (esc) {\n return esc + first + (rest ? QMARK.repeat(rest.length) : '');\n }\n if (index === 0) {\n return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');\n }\n return QMARK.repeat(chars.length);\n }\n\n if (first === '.') {\n return DOT_LITERAL.repeat(chars.length);\n }\n\n if (first === '*') {\n if (esc) {\n return esc + first + (rest ? star : '');\n }\n return star;\n }\n return esc ? m : `\\\\${m}`;\n });\n\n if (backslashes === true) {\n if (opts.unescape === true) {\n output = output.replace(/\\\\/g, '');\n } else {\n output = output.replace(/\\\\+/g, m => {\n return m.length % 2 === 0 ? '\\\\\\\\' : (m ? '\\\\' : '');\n });\n }\n }\n\n if (output === input && opts.contains === true) {\n state.output = input;\n return state;\n }\n\n state.output = utils.wrapOutput(output, state, options);\n return state;\n }\n\n /**\n * Tokenize input until we reach end-of-string\n */\n\n while (!eos()) {\n value = advance();\n\n if (value === '\\u0000') {\n continue;\n }\n\n /**\n * Escaped characters\n */\n\n if (value === '\\\\') {\n const next = peek();\n\n if (next === '/' && opts.bash !== true) {\n continue;\n }\n\n if (next === '.' || next === ';') {\n continue;\n }\n\n if (!next) {\n value += '\\\\';\n push({ type: 'text', value });\n continue;\n }\n\n // collapse slashes to reduce potential for exploits\n const match = /^\\\\+/.exec(remaining());\n let slashes = 0;\n\n if (match && match[0].length > 2) {\n slashes = match[0].length;\n state.index += slashes;\n if (slashes % 2 !== 0) {\n value += '\\\\';\n }\n }\n\n if (opts.unescape === true) {\n value = advance();\n } else {\n value += advance();\n }\n\n if (state.brackets === 0) {\n push({ type: 'text', value });\n continue;\n }\n }\n\n /**\n * If we're inside a regex character class, continue\n * until we reach the closing bracket.\n */\n\n if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {\n if (opts.posix !== false && value === ':') {\n const inner = prev.value.slice(1);\n if (inner.includes('[')) {\n prev.posix = true;\n\n if (inner.includes(':')) {\n const idx = prev.value.lastIndexOf('[');\n const pre = prev.value.slice(0, idx);\n const rest = prev.value.slice(idx + 2);\n const posix = POSIX_REGEX_SOURCE[rest];\n if (posix) {\n prev.value = pre + posix;\n state.backtrack = true;\n advance();\n\n if (!bos.output && tokens.indexOf(prev) === 1) {\n bos.output = ONE_CHAR;\n }\n continue;\n }\n }\n }\n }\n\n if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {\n value = `\\\\${value}`;\n }\n\n if (value === ']' && (prev.value === '[' || prev.value === '[^')) {\n value = `\\\\${value}`;\n }\n\n if (opts.posix === true && value === '!' && prev.value === '[') {\n value = '^';\n }\n\n prev.value += value;\n append({ value });\n continue;\n }\n\n /**\n * If we're inside a quoted string, continue\n * until we reach the closing double quote.\n */\n\n if (state.quotes === 1 && value !== '\"') {\n value = utils.escapeRegex(value);\n prev.value += value;\n append({ value });\n continue;\n }\n\n /**\n * Double quotes\n */\n\n if (value === '\"') {\n state.quotes = state.quotes === 1 ? 0 : 1;\n if (opts.keepQuotes === true) {\n push({ type: 'text', value });\n }\n continue;\n }\n\n /**\n * Parentheses\n */\n\n if (value === '(') {\n increment('parens');\n push({ type: 'paren', value });\n continue;\n }\n\n if (value === ')') {\n if (state.parens === 0 && opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('opening', '('));\n }\n\n const extglob = extglobs[extglobs.length - 1];\n if (extglob && state.parens === extglob.parens + 1) {\n extglobClose(extglobs.pop());\n continue;\n }\n\n push({ type: 'paren', value, output: state.parens ? ')' : '\\\\)' });\n decrement('parens');\n continue;\n }\n\n /**\n * Square brackets\n */\n\n if (value === '[') {\n if (opts.nobracket === true || !remaining().includes(']')) {\n if (opts.nobracket !== true && opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('closing', ']'));\n }\n\n value = `\\\\${value}`;\n } else {\n increment('brackets');\n }\n\n push({ type: 'bracket', value });\n continue;\n }\n\n if (value === ']') {\n if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {\n push({ type: 'text', value, output: `\\\\${value}` });\n continue;\n }\n\n if (state.brackets === 0) {\n if (opts.strictBrackets === true) {\n throw new SyntaxError(syntaxError('opening', '['));\n }\n\n push({ type: 'text', value, output: `\\\\${value}` });\n continue;\n }\n\n decrement('brackets');\n\n const prevValue = prev.value.slice(1);\n if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {\n value = `/${value}`;\n }\n\n prev.value += value;\n append({ value });\n\n // when literal brackets are explicitly disabled\n // assume we should match with a regex character class\n if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {\n continue;\n }\n\n const escaped = utils.escapeRegex(prev.value);\n state.output = state.output.slice(0, -prev.value.length);\n\n // when literal brackets are explicitly enabled\n // assume we should escape the brackets to match literal characters\n if (opts.literalBrackets === true) {\n state.output += escaped;\n prev.value = escaped;\n continue;\n }\n\n // when the user specifies nothing, try to match both\n prev.value = `(${capture}${escaped}|${prev.value})`;\n state.output += prev.value;\n continue;\n }\n\n /**\n * Braces\n */\n\n if (value === '{' && opts.nobrace !== true) {\n increment('braces');\n\n const open = {\n type: 'brace',\n value,\n output: '(',\n outputIndex: state.output.length,\n tokensIndex: state.tokens.length\n };\n\n braces.push(open);\n push(open);\n continue;\n }\n\n if (value === '}') {\n const brace = braces[braces.length - 1];\n\n if (opts.nobrace === true || !brace) {\n push({ type: 'text', value, output: value });\n continue;\n }\n\n let output = ')';\n\n if (brace.dots === true) {\n const arr = tokens.slice();\n const range = [];\n\n for (let i = arr.length - 1; i >= 0; i--) {\n tokens.pop();\n if (arr[i].type === 'brace') {\n break;\n }\n if (arr[i].type !== 'dots') {\n range.unshift(arr[i].value);\n }\n }\n\n output = expandRange(range, opts);\n state.backtrack = true;\n }\n\n if (brace.comma !== true && brace.dots !== true) {\n const out = state.output.slice(0, brace.outputIndex);\n const toks = state.tokens.slice(brace.tokensIndex);\n brace.value = brace.output = '\\\\{';\n value = output = '\\\\}';\n state.output = out;\n for (const t of toks) {\n state.output += (t.output || t.value);\n }\n }\n\n push({ type: 'brace', value, output });\n decrement('braces');\n braces.pop();\n continue;\n }\n\n /**\n * Pipes\n */\n\n if (value === '|') {\n if (extglobs.length > 0) {\n extglobs[extglobs.length - 1].conditions++;\n }\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Commas\n */\n\n if (value === ',') {\n let output = value;\n\n const brace = braces[braces.length - 1];\n if (brace && stack[stack.length - 1] === 'braces') {\n brace.comma = true;\n output = '|';\n }\n\n push({ type: 'comma', value, output });\n continue;\n }\n\n /**\n * Slashes\n */\n\n if (value === '/') {\n // if the beginning of the glob is \"./\", advance the start\n // to the current index, and don't add the \"./\" characters\n // to the state. This greatly simplifies lookbehinds when\n // checking for BOS characters like \"!\" and \".\" (not \"./\")\n if (prev.type === 'dot' && state.index === state.start + 1) {\n state.start = state.index + 1;\n state.consumed = '';\n state.output = '';\n tokens.pop();\n prev = bos; // reset \"prev\" to the first token\n continue;\n }\n\n push({ type: 'slash', value, output: SLASH_LITERAL });\n continue;\n }\n\n /**\n * Dots\n */\n\n if (value === '.') {\n if (state.braces > 0 && prev.type === 'dot') {\n if (prev.value === '.') prev.output = DOT_LITERAL;\n const brace = braces[braces.length - 1];\n prev.type = 'dots';\n prev.output += value;\n prev.value += value;\n brace.dots = true;\n continue;\n }\n\n if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {\n push({ type: 'text', value, output: DOT_LITERAL });\n continue;\n }\n\n push({ type: 'dot', value, output: DOT_LITERAL });\n continue;\n }\n\n /**\n * Question marks\n */\n\n if (value === '?') {\n const isGroup = prev && prev.value === '(';\n if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n extglobOpen('qmark', value);\n continue;\n }\n\n if (prev && prev.type === 'paren') {\n const next = peek();\n let output = value;\n\n if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\\w+>)/.test(remaining()))) {\n output = `\\\\${value}`;\n }\n\n push({ type: 'text', value, output });\n continue;\n }\n\n if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {\n push({ type: 'qmark', value, output: QMARK_NO_DOT });\n continue;\n }\n\n push({ type: 'qmark', value, output: QMARK });\n continue;\n }\n\n /**\n * Exclamation\n */\n\n if (value === '!') {\n if (opts.noextglob !== true && peek() === '(') {\n if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {\n extglobOpen('negate', value);\n continue;\n }\n }\n\n if (opts.nonegate !== true && state.index === 0) {\n negate();\n continue;\n }\n }\n\n /**\n * Plus\n */\n\n if (value === '+') {\n if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n extglobOpen('plus', value);\n continue;\n }\n\n if ((prev && prev.value === '(') || opts.regex === false) {\n push({ type: 'plus', value, output: PLUS_LITERAL });\n continue;\n }\n\n if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {\n push({ type: 'plus', value });\n continue;\n }\n\n push({ type: 'plus', value: PLUS_LITERAL });\n continue;\n }\n\n /**\n * Plain text\n */\n\n if (value === '@') {\n if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {\n push({ type: 'at', extglob: true, value, output: '' });\n continue;\n }\n\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Plain text\n */\n\n if (value !== '*') {\n if (value === '$' || value === '^') {\n value = `\\\\${value}`;\n }\n\n const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());\n if (match) {\n value += match[0];\n state.index += match[0].length;\n }\n\n push({ type: 'text', value });\n continue;\n }\n\n /**\n * Stars\n */\n\n if (prev && (prev.type === 'globstar' || prev.star === true)) {\n prev.type = 'star';\n prev.star = true;\n prev.value += value;\n prev.output = star;\n state.backtrack = true;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n let rest = remaining();\n if (opts.noextglob !== true && /^\\([^?]/.test(rest)) {\n extglobOpen('star', value);\n continue;\n }\n\n if (prev.type === 'star') {\n if (opts.noglobstar === true) {\n consume(value);\n continue;\n }\n\n const prior = prev.prev;\n const before = prior.prev;\n const isStart = prior.type === 'slash' || prior.type === 'bos';\n const afterStar = before && (before.type === 'star' || before.type === 'globstar');\n\n if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {\n push({ type: 'star', value, output: '' });\n continue;\n }\n\n const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');\n const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');\n if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {\n push({ type: 'star', value, output: '' });\n continue;\n }\n\n // strip consecutive `/**/`\n while (rest.slice(0, 3) === '/**') {\n const after = input[state.index + 4];\n if (after && after !== '/') {\n break;\n }\n rest = rest.slice(3);\n consume('/**', 3);\n }\n\n if (prior.type === 'bos' && eos()) {\n prev.type = 'globstar';\n prev.value += value;\n prev.output = globstar(opts);\n state.output = prev.output;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {\n state.output = state.output.slice(0, -(prior.output + prev.output).length);\n prior.output = `(?:${prior.output}`;\n\n prev.type = 'globstar';\n prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');\n prev.value += value;\n state.globstar = true;\n state.output += prior.output + prev.output;\n consume(value);\n continue;\n }\n\n if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {\n const end = rest[1] !== void 0 ? '|$' : '';\n\n state.output = state.output.slice(0, -(prior.output + prev.output).length);\n prior.output = `(?:${prior.output}`;\n\n prev.type = 'globstar';\n prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;\n prev.value += value;\n\n state.output += prior.output + prev.output;\n state.globstar = true;\n\n consume(value + advance());\n\n push({ type: 'slash', value: '/', output: '' });\n continue;\n }\n\n if (prior.type === 'bos' && rest[0] === '/') {\n prev.type = 'globstar';\n prev.value += value;\n prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;\n state.output = prev.output;\n state.globstar = true;\n consume(value + advance());\n push({ type: 'slash', value: '/', output: '' });\n continue;\n }\n\n // remove single star from output\n state.output = state.output.slice(0, -prev.output.length);\n\n // reset previous token to globstar\n prev.type = 'globstar';\n prev.output = globstar(opts);\n prev.value += value;\n\n // reset output with globstar\n state.output += prev.output;\n state.globstar = true;\n consume(value);\n continue;\n }\n\n const token = { type: 'star', value, output: star };\n\n if (opts.bash === true) {\n token.output = '.*?';\n if (prev.type === 'bos' || prev.type === 'slash') {\n token.output = nodot + token.output;\n }\n push(token);\n continue;\n }\n\n if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {\n token.output = value;\n push(token);\n continue;\n }\n\n if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {\n if (prev.type === 'dot') {\n state.output += NO_DOT_SLASH;\n prev.output += NO_DOT_SLASH;\n\n } else if (opts.dot === true) {\n state.output += NO_DOTS_SLASH;\n prev.output += NO_DOTS_SLASH;\n\n } else {\n state.output += nodot;\n prev.output += nodot;\n }\n\n if (peek() !== '*') {\n state.output += ONE_CHAR;\n prev.output += ONE_CHAR;\n }\n }\n\n push(token);\n }\n\n while (state.brackets > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));\n state.output = utils.escapeLast(state.output, '[');\n decrement('brackets');\n }\n\n while (state.parens > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));\n state.output = utils.escapeLast(state.output, '(');\n decrement('parens');\n }\n\n while (state.braces > 0) {\n if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));\n state.output = utils.escapeLast(state.output, '{');\n decrement('braces');\n }\n\n if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {\n push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });\n }\n\n // rebuild the output if we had to backtrack at any point\n if (state.backtrack === true) {\n state.output = '';\n\n for (const token of state.tokens) {\n state.output += token.output != null ? token.output : token.value;\n\n if (token.suffix) {\n state.output += token.suffix;\n }\n }\n }\n\n return state;\n};\n\n/**\n * Fast paths for creating regular expressions for common glob patterns.\n * This can significantly speed up processing and has very little downside\n * impact when none of the fast paths match.\n */\n\nparse.fastpaths = (input, options) => {\n const opts = { ...options };\n const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;\n const len = input.length;\n if (len > max) {\n throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);\n }\n\n input = REPLACEMENTS[input] || input;\n\n // create constants based on platform, for windows or posix\n const {\n DOT_LITERAL,\n SLASH_LITERAL,\n ONE_CHAR,\n DOTS_SLASH,\n NO_DOT,\n NO_DOTS,\n NO_DOTS_SLASH,\n STAR,\n START_ANCHOR\n } = constants.globChars(opts.windows);\n\n const nodot = opts.dot ? NO_DOTS : NO_DOT;\n const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;\n const capture = opts.capture ? '' : '?:';\n const state = { negated: false, prefix: '' };\n let star = opts.bash === true ? '.*?' : STAR;\n\n if (opts.capture) {\n star = `(${star})`;\n }\n\n const globstar = opts => {\n if (opts.noglobstar === true) return star;\n return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;\n };\n\n const create = str => {\n switch (str) {\n case '*':\n return `${nodot}${ONE_CHAR}${star}`;\n\n case '.*':\n return `${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '*.*':\n return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '*/*':\n return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;\n\n case '**':\n return nodot + globstar(opts);\n\n case '**/*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;\n\n case '**/*.*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n case '**/.*':\n return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;\n\n default: {\n const match = /^(.*?)\\.(\\w+)$/.exec(str);\n if (!match) return;\n\n const source = create(match[1]);\n if (!source) return;\n\n return source + DOT_LITERAL + match[2];\n }\n }\n };\n\n const output = utils.removePrefix(input, state);\n let source = create(output);\n\n if (source && opts.strictSlashes !== true) {\n source += `${SLASH_LITERAL}?`;\n }\n\n return source;\n};\n\nmodule.exports = parse;\n","'use strict';\n\nconst scan = require('./scan');\nconst parse = require('./parse');\nconst utils = require('./utils');\nconst constants = require('./constants');\nconst isObject = val => val && typeof val === 'object' && !Array.isArray(val);\n\n/**\n * Creates a matcher function from one or more glob patterns. The\n * returned function takes a string to match as its first argument,\n * and returns true if the string is a match. The returned matcher\n * function also takes a boolean as the second argument that, when true,\n * returns an object with additional information.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch(glob[, options]);\n *\n * const isMatch = picomatch('*.!(*a)');\n * console.log(isMatch('a.a')); //=> false\n * console.log(isMatch('a.b')); //=> true\n * ```\n * @name picomatch\n * @param {String|Array} `globs` One or more glob patterns.\n * @param {Object=} `options`\n * @return {Function=} Returns a matcher function.\n * @api public\n */\n\nconst picomatch = (glob, options, returnState = false) => {\n if (Array.isArray(glob)) {\n const fns = glob.map(input => picomatch(input, options, returnState));\n const arrayMatcher = str => {\n for (const isMatch of fns) {\n const state = isMatch(str);\n if (state) return state;\n }\n return false;\n };\n return arrayMatcher;\n }\n\n const isState = isObject(glob) && glob.tokens && glob.input;\n\n if (glob === '' || (typeof glob !== 'string' && !isState)) {\n throw new TypeError('Expected pattern to be a non-empty string');\n }\n\n const opts = options || {};\n const posix = opts.windows;\n const regex = isState\n ? picomatch.compileRe(glob, options)\n : picomatch.makeRe(glob, options, false, true);\n\n const state = regex.state;\n delete regex.state;\n\n let isIgnored = () => false;\n if (opts.ignore) {\n const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };\n isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);\n }\n\n const matcher = (input, returnObject = false) => {\n const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });\n const result = { glob, state, regex, posix, input, output, match, isMatch };\n\n if (typeof opts.onResult === 'function') {\n opts.onResult(result);\n }\n\n if (isMatch === false) {\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (isIgnored(input)) {\n if (typeof opts.onIgnore === 'function') {\n opts.onIgnore(result);\n }\n result.isMatch = false;\n return returnObject ? result : false;\n }\n\n if (typeof opts.onMatch === 'function') {\n opts.onMatch(result);\n }\n return returnObject ? result : true;\n };\n\n if (returnState) {\n matcher.state = state;\n }\n\n return matcher;\n};\n\n/**\n * Test `input` with the given `regex`. This is used by the main\n * `picomatch()` function to test the input string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.test(input, regex[, options]);\n *\n * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\\/([^/]*?))$/));\n * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp} `regex`\n * @return {Object} Returns an object with matching info.\n * @api public\n */\n\npicomatch.test = (input, regex, options, { glob, posix } = {}) => {\n if (typeof input !== 'string') {\n throw new TypeError('Expected input to be a string');\n }\n\n if (input === '') {\n return { isMatch: false, output: '' };\n }\n\n const opts = options || {};\n const format = opts.format || (posix ? utils.toPosixSlashes : null);\n let match = input === glob;\n let output = (match && format) ? format(input) : input;\n\n if (match === false) {\n output = format ? format(input) : input;\n match = output === glob;\n }\n\n if (match === false || opts.capture === true) {\n if (opts.matchBase === true || opts.basename === true) {\n match = picomatch.matchBase(input, regex, options, posix);\n } else {\n match = regex.exec(output);\n }\n }\n\n return { isMatch: Boolean(match), match, output };\n};\n\n/**\n * Match the basename of a filepath.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.matchBase(input, glob[, options]);\n * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true\n * ```\n * @param {String} `input` String to test.\n * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).\n * @return {Boolean}\n * @api public\n */\n\npicomatch.matchBase = (input, glob, options) => {\n const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);\n return regex.test(utils.basename(input));\n};\n\n/**\n * Returns true if **any** of the given glob `patterns` match the specified `string`.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.isMatch(string, patterns[, options]);\n *\n * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true\n * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false\n * ```\n * @param {String|Array} str The string to test.\n * @param {String|Array} patterns One or more glob patterns to use for matching.\n * @param {Object} [options] See available [options](#options).\n * @return {Boolean} Returns true if any patterns match `str`\n * @api public\n */\n\npicomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);\n\n/**\n * Parse a glob pattern to create the source string for a regular\n * expression.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const result = picomatch.parse(pattern[, options]);\n * ```\n * @param {String} `pattern`\n * @param {Object} `options`\n * @return {Object} Returns an object with useful properties and output to be used as a regex source string.\n * @api public\n */\n\npicomatch.parse = (pattern, options) => {\n if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));\n return parse(pattern, { ...options, fastpaths: false });\n};\n\n/**\n * Scan a glob pattern to separate the pattern into segments.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.scan(input[, options]);\n *\n * const result = picomatch.scan('!./foo/*.js');\n * console.log(result);\n * { prefix: '!./',\n * input: '!./foo/*.js',\n * start: 3,\n * base: 'foo',\n * glob: '*.js',\n * isBrace: false,\n * isBracket: false,\n * isGlob: true,\n * isExtglob: false,\n * isGlobstar: false,\n * negated: true }\n * ```\n * @param {String} `input` Glob pattern to scan.\n * @param {Object} `options`\n * @return {Object} Returns an object with\n * @api public\n */\n\npicomatch.scan = (input, options) => scan(input, options);\n\n/**\n * Compile a regular expression from the `state` object returned by the\n * [parse()](#parse) method.\n *\n * @param {Object} `state`\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser.\n * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging.\n * @return {RegExp}\n * @api public\n */\n\npicomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {\n if (returnOutput === true) {\n return state.output;\n }\n\n const opts = options || {};\n const prepend = opts.contains ? '' : '^';\n const append = opts.contains ? '' : '$';\n\n let source = `${prepend}(?:${state.output})${append}`;\n if (state && state.negated === true) {\n source = `^(?!${source}).*$`;\n }\n\n const regex = picomatch.toRegex(source, options);\n if (returnState === true) {\n regex.state = state;\n }\n\n return regex;\n};\n\n/**\n * Create a regular expression from a parsed glob pattern.\n *\n * ```js\n * const picomatch = require('picomatch');\n * const state = picomatch.parse('*.js');\n * // picomatch.compileRe(state[, options]);\n *\n * console.log(picomatch.compileRe(state));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `state` The object returned from the `.parse` method.\n * @param {Object} `options`\n * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result.\n * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression.\n * @return {RegExp} Returns a regex created from the given pattern.\n * @api public\n */\n\npicomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {\n if (!input || typeof input !== 'string') {\n throw new TypeError('Expected a non-empty string');\n }\n\n let parsed = { negated: false, fastpaths: true };\n\n if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {\n parsed.output = parse.fastpaths(input, options);\n }\n\n if (!parsed.output) {\n parsed = parse(input, options);\n }\n\n return picomatch.compileRe(parsed, options, returnOutput, returnState);\n};\n\n/**\n * Create a regular expression from the given regex source string.\n *\n * ```js\n * const picomatch = require('picomatch');\n * // picomatch.toRegex(source[, options]);\n *\n * const { output } = picomatch.parse('*.js');\n * console.log(picomatch.toRegex(output));\n * //=> /^(?:(?!\\.)(?=.)[^/]*?\\.js)$/\n * ```\n * @param {String} `source` Regular expression source string.\n * @param {Object} `options`\n * @return {RegExp}\n * @api public\n */\n\npicomatch.toRegex = (source, options) => {\n try {\n const opts = options || {};\n return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));\n } catch (err) {\n if (options && options.debug === true) throw err;\n return /$^/;\n }\n};\n\n/**\n * Picomatch constants.\n * @return {Object}\n */\n\npicomatch.constants = constants;\n\n/**\n * Expose \"picomatch\"\n */\n\nmodule.exports = picomatch;\n","import mime from \"mime/lite\";\nimport picomatch from \"picomatch/posix\";\n\nconst parseInputAccept = (inputAccept: string): [string[], string[]] => {\n const extensions: string[] = [];\n const mimeTypes: string[] = [];\n\n inputAccept\n .split(\",\")\n .map(mimeType => mimeType.trim())\n .filter(Boolean)\n .forEach(fileType => {\n if (fileType.startsWith(\".\")) {\n extensions.push(`*${fileType}`);\n } else {\n mimeTypes.push(fileType);\n }\n });\n\n return [extensions, mimeTypes];\n};\n\nclass AcceptedFileTypes {\n private extensions: string[];\n private mimeTypes: string[];\n\n constructor(inputAccept: string) {\n const [extensions, mimeTypes] = parseInputAccept(inputAccept);\n\n this.extensions = extensions;\n this.mimeTypes = mimeTypes;\n }\n\n private isExtensionAccepted(fileName: string): boolean {\n if (this.extensions.length === 0) {\n return false;\n }\n\n return picomatch.isMatch(fileName, this.extensions);\n }\n\n private isMimeTypeAccepted(mimeType: null | string): boolean {\n if (!mimeType || this.mimeTypes.length === 0) {\n return false;\n }\n\n return picomatch.isMatch(mimeType, this.mimeTypes);\n }\n\n public isAccepted(fileName: string): boolean {\n if (this.extensions.length === 0 && this.mimeTypes.length === 0) {\n return true;\n }\n return (\n this.isMimeTypeAccepted(mime.getType(fileName)) ||\n this.isExtensionAccepted(fileName)\n );\n }\n}\n\nexport default AcceptedFileTypes;\n","import AcceptedFileTypes from \"./accepted_file_types.ts\";\nimport RenderUploadFile from \"./render_upload_file.ts\";\n\nconst getEntriesFromDirectory = async (\n directoryEntry: FileSystemDirectoryEntry\n): Promise =>\n new Promise((resolve, reject) => {\n directoryEntry.createReader().readEntries(resolve, reject);\n });\n\nconst getFileFromFileSystemFileEntry = async (\n fileEntry: FileSystemFileEntry\n): Promise =>\n new Promise((resolve, reject) => {\n fileEntry.file(resolve, reject);\n });\n\nconst getFilesFromFileSystemEntries = async (\n entries: FileSystemEntry[]\n): Promise => {\n const result: File[] = [];\n\n for (const entry of entries) {\n const filesFromEntry = await getFilesFromFileSystemEntry(entry);\n filesFromEntry.forEach(file => result.push(file));\n }\n\n return result;\n};\n\nconst getFilesFromFileSystemEntry = async (\n entry: FileSystemEntry\n): Promise => {\n const result: File[] = [];\n\n if (entry.isFile) {\n const file = await getFileFromFileSystemFileEntry(\n entry as FileSystemFileEntry\n );\n result.push(file);\n } else if (entry.isDirectory) {\n const entriesFromDirectory = await getEntriesFromDirectory(\n entry as FileSystemDirectoryEntry\n );\n const files = await getFilesFromFileSystemEntries(entriesFromDirectory);\n files.forEach(file => result.push(file));\n }\n\n return result;\n};\n\nconst getFilesFromDataTransfer = async (\n dataTransfer: DataTransfer\n): Promise => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (dataTransfer.items) {\n const files: File[] = [];\n\n for (const item of dataTransfer.items) {\n const fileSystemEntry = item.webkitGetAsEntry();\n if (fileSystemEntry) {\n const filesFromEntry = await getFilesFromFileSystemEntry(\n fileSystemEntry\n );\n filesFromEntry.forEach(file => files.push(file));\n } else {\n const file = item.getAsFile();\n\n if (file) {\n files.push(file);\n }\n }\n }\n\n return files;\n } else {\n // backwards compatibility\n return [...dataTransfer.files];\n }\n};\n\nclass DropArea {\n acceptedFileTypes: AcceptedFileTypes;\n container: Element;\n onDrop = (e: Event): void => {\n const dragEvent = e as DragEvent;\n this.container.classList.remove(\"dff-dropping\");\n dragEvent.preventDefault();\n dragEvent.stopPropagation();\n\n const uploadFiles = async (): Promise => {\n try {\n if (dragEvent.dataTransfer) {\n const files = await getFilesFromDataTransfer(dragEvent.dataTransfer);\n const acceptedFiles: File[] = [];\n const invalidFiles: File[] = [];\n\n for (const file of files) {\n if (this.acceptedFileTypes.isAccepted(file.name)) {\n acceptedFiles.push(file);\n } else {\n invalidFiles.push(file);\n }\n }\n\n this.renderer.setErrorInvalidFiles(invalidFiles);\n void this.onUploadFiles(acceptedFiles);\n }\n } catch (error) {\n console.error(error);\n }\n };\n\n void uploadFiles();\n };\n onUploadFiles: (files: File[]) => Promise;\n\n renderer: RenderUploadFile;\n\n constructor({\n container,\n inputAccept,\n onUploadFiles,\n renderer\n }: {\n container: Element;\n inputAccept: string;\n onUploadFiles: (files: File[]) => Promise;\n renderer: RenderUploadFile;\n }) {\n this.container = container;\n this.onUploadFiles = onUploadFiles;\n this.acceptedFileTypes = new AcceptedFileTypes(inputAccept);\n this.renderer = renderer;\n\n container.addEventListener(\"dragenter\", () => {\n container.classList.add(\"dff-dropping\");\n });\n container.addEventListener(\"dragleave\", () => {\n container.classList.remove(\"dff-dropping\");\n });\n container.addEventListener(\"dragover\", e => {\n container.classList.add(\"dff-dropping\");\n e.preventDefault();\n });\n container.addEventListener(\"drop\", this.onDrop);\n }\n}\n\nexport default DropArea;\n","/*!\n * escape-html\n * Copyright(c) 2012-2013 TJ Holowaychuk\n * Copyright(c) 2015 Andreas Lubbe\n * Copyright(c) 2015 Tiancheng \"Timothy\" Gu\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module variables.\n * @private\n */\n\nvar matchHtmlRegExp = /[\"'&<>]/;\n\n/**\n * Module exports.\n * @public\n */\n\nmodule.exports = escapeHtml;\n\n/**\n * Escape special characters in the given string of html.\n *\n * @param {string} string The string to escape for inserting into HTML\n * @return {string}\n * @public\n */\n\nfunction escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n\n if (!match) {\n return str;\n }\n\n var escape;\n var html = '';\n var index = 0;\n var lastIndex = 0;\n\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34: // \"\n escape = '"';\n break;\n case 38: // &\n escape = '&';\n break;\n case 39: // '\n escape = ''';\n break;\n case 60: // <\n escape = '<';\n break;\n case 62: // >\n escape = '>';\n break;\n default:\n continue;\n }\n\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n\n lastIndex = index + 1;\n html += escape;\n }\n\n return lastIndex !== index\n ? html + str.substring(lastIndex, index)\n : html;\n}\n","export const formatBytes = (bytes: number, decimals: number): string => {\n if (bytes === 0) {\n return \"0 Bytes\";\n }\n\n const k = 1024;\n const dm = decimals <= 0 ? 0 : decimals || 2;\n const sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n const n = parseFloat((bytes / k ** i).toFixed(dm));\n const size = sizes[i];\n\n if (size == null) {\n return \"\";\n } else {\n return `${n.toString()} ${size}`;\n }\n};\n\nexport const getInputNameWithPrefix = (\n fieldName: string,\n prefix: null | string\n): string => (prefix ? `${prefix}-${fieldName}` : fieldName);\n\nconst getInputNameWithoutPrefix = (\n fieldName: string,\n prefix: null | string\n): string => (prefix ? fieldName.slice(prefix.length + 1) : fieldName);\n\nexport const findInput = (\n form: Element,\n fieldName: string,\n prefix: null | string\n): HTMLInputElement | null => {\n const inputNameWithPrefix = getInputNameWithPrefix(fieldName, prefix);\n const input = form.querySelector(`[name=\"${inputNameWithPrefix}\"]`);\n\n if (!input) {\n return null;\n }\n\n return input as HTMLInputElement;\n};\n\nexport const getUploadsFieldName = (\n fieldName: string,\n prefix: null | string\n): string => `${getInputNameWithoutPrefix(fieldName, prefix)}-uploads`;\n\nexport const getInputValueForFormAndPrefix = (\n form: Element,\n fieldName: string,\n prefix: null | string\n): string | undefined => findInput(form, fieldName, prefix)?.value;\n\nexport const getMetadataFieldName = (\n fieldName: string,\n prefix: null | string\n): string => `${getInputNameWithoutPrefix(fieldName, prefix)}-metadata`;\n","import escape from \"escape-html\";\n\nimport { formatBytes } from \"./util.ts\";\n\nclass RenderUploadFile {\n private createErrorContainer = (parent: Element): Element => {\n const div = document.createElement(\"div\");\n div.className = \"dff-invalid-files\";\n parent.appendChild(div);\n return div;\n };\n private createFilesContainer = (parent: Element): Element => {\n const div = document.createElement(\"div\");\n div.className = \"dff-files\";\n parent.appendChild(div);\n\n return div;\n };\n container: Element;\n errors: Element;\n\n input: HTMLInputElement;\n\n translations: Record;\n\n constructor({\n input,\n parent,\n skipRequired,\n translations\n }: {\n input: HTMLInputElement;\n parent: Element;\n skipRequired: boolean;\n translations: Record;\n }) {\n this.container = this.createFilesContainer(parent);\n this.errors = this.createErrorContainer(parent);\n this.input = input;\n this.translations = translations;\n\n if (skipRequired) {\n this.input.required = false;\n }\n }\n\n private addFile(filename: string, uploadIndex: number): HTMLElement {\n const div = document.createElement(\"div\");\n div.className = `dff-file dff-file-id-${uploadIndex.toString()}`;\n\n const nameSpan = document.createElement(\"span\");\n nameSpan.innerHTML = escape(filename);\n nameSpan.className = \"dff-filename\";\n nameSpan.setAttribute(\"data-index\", uploadIndex.toString());\n\n div.appendChild(nameSpan);\n this.container.appendChild(div);\n\n this.input.required = false;\n return div;\n }\n\n private enableDelete(index: number): void {\n const deleteLink = this.findDeleteLink(index);\n\n if (deleteLink) {\n deleteLink.classList.remove(\"dff-disabled\");\n }\n }\n\n private findCancelSpan(index: number): HTMLElement | null {\n const el = this.findFileDiv(index);\n\n if (!el) {\n return null;\n }\n\n return el.querySelector(\".dff-cancel\");\n }\n\n private findDeleteLink(index: number): HTMLElement | null {\n const div = this.findFileDiv(index);\n if (!div) {\n return div;\n }\n\n return div.querySelector(\".dff-delete\");\n }\n\n private removeCancel(index: number): void {\n const cancelSpan = this.findCancelSpan(index);\n\n if (cancelSpan) {\n cancelSpan.remove();\n }\n }\n\n private removeProgress(index: number): void {\n const el = this.findFileDiv(index);\n\n if (el) {\n const progressSpan = el.querySelector(\".dff-progress\");\n\n if (progressSpan) {\n progressSpan.remove();\n }\n }\n }\n\n private setErrorMessage(index: number, message: string): void {\n const el = this.findFileDiv(index);\n if (!el) {\n return;\n }\n\n const originalMessageSpan = el.querySelector(\".dff-error\");\n if (originalMessageSpan) {\n originalMessageSpan.remove();\n }\n\n const span = document.createElement(\"span\");\n span.classList.add(\"dff-error\");\n span.innerHTML = message;\n\n el.appendChild(span);\n }\n\n public addNewUpload(filename: string, uploadIndex: number): HTMLElement {\n const div = this.addFile(filename, uploadIndex);\n\n const progressSpan = document.createElement(\"span\");\n progressSpan.className = \"dff-progress\";\n\n const innerSpan = document.createElement(\"span\");\n innerSpan.className = \"dff-progress-inner\";\n\n progressSpan.appendChild(innerSpan);\n div.appendChild(progressSpan);\n\n const cancelLink = document.createElement(\"a\");\n cancelLink.className = \"dff-cancel\";\n cancelLink.innerHTML = this.translations.Cancel ?? \"\";\n cancelLink.setAttribute(\"data-index\", uploadIndex.toString());\n cancelLink.href = \"#\";\n div.appendChild(cancelLink);\n\n return div;\n }\n\n public addUploadedFile(\n filename: string,\n uploadIndex: number,\n filesize?: number\n ): HTMLElement {\n const element = this.addFile(filename, uploadIndex);\n this.setSuccess(uploadIndex, filesize);\n return element;\n }\n\n public clearInput(): void {\n const { input } = this;\n\n input.value = \"\";\n }\n\n public deleteFile(index: number): void {\n const div = this.findFileDiv(index);\n\n if (div) {\n div.remove();\n }\n }\n\n public disableCancel(index: number): void {\n const cancelSpan = this.findCancelSpan(index);\n\n if (cancelSpan) {\n cancelSpan.classList.add(\"dff-disabled\");\n }\n }\n\n public disableDelete(index: number): void {\n const deleteLink = this.findDeleteLink(index);\n\n if (deleteLink) {\n deleteLink.classList.add(\"dff-disabled\");\n }\n }\n\n public findFileDiv(index: number): HTMLElement | null {\n return this.container.querySelector(`.dff-file-id-${index.toString()}`);\n }\n\n public removeDropHint(): void {\n const dropHint = this.container.querySelector(\".dff-drop-hint\");\n\n if (dropHint) {\n dropHint.remove();\n }\n }\n\n public renderDropHint(): void {\n if (this.container.querySelector(\".dff-drop-hint\")) {\n return;\n }\n\n const dropHint = document.createElement(\"div\");\n dropHint.className = \"dff-drop-hint\";\n dropHint.innerHTML = this.translations[\"Drop your files here\"] ?? \"\";\n\n this.container.appendChild(dropHint);\n }\n\n public setDeleteFailed(index: number): void {\n this.setErrorMessage(index, this.translations[\"Delete failed\"] ?? \"\");\n\n this.enableDelete(index);\n }\n\n public setError(index: number): void {\n this.setErrorMessage(index, this.translations[\"Upload failed\"] ?? \"\");\n\n const el = this.findFileDiv(index);\n if (el) {\n el.classList.add(\"dff-upload-fail\");\n }\n\n this.removeProgress(index);\n this.removeCancel(index);\n }\n\n public setErrorInvalidFiles(files: File[]): void {\n const errorsMessages = document.createElement(\"ul\");\n\n for (const file of files) {\n const msg = document.createElement(\"li\");\n const invalidFileTypeMessage =\n this.translations[\"Invalid file type\"] ?? \"\";\n msg.innerText = `${file.name}: ${invalidFileTypeMessage}`;\n msg.className = \"dff-error\";\n errorsMessages.appendChild(msg);\n }\n\n this.errors.replaceChildren(errorsMessages);\n this.clearInput();\n }\n\n public setSuccess(index: number, size?: number): void {\n const { translations } = this;\n\n const el = this.findFileDiv(index);\n if (el) {\n el.classList.add(\"dff-upload-success\");\n\n if (size != null) {\n const fileSizeInfo = document.createElement(\"span\");\n fileSizeInfo.innerHTML = formatBytes(size, 2);\n fileSizeInfo.className = \"dff-filesize\";\n\n el.appendChild(fileSizeInfo);\n }\n\n const deleteLink = document.createElement(\"a\");\n deleteLink.innerHTML = translations.Delete ?? \"\";\n deleteLink.className = \"dff-delete\";\n deleteLink.setAttribute(\"data-index\", index.toString());\n deleteLink.href = \"#\";\n\n el.appendChild(deleteLink);\n }\n\n this.removeProgress(index);\n this.removeCancel(index);\n }\n\n public updateProgress(index: number, percentage: string): void {\n const el = this.container.querySelector(`.dff-file-id-${index.toString()}`);\n if (el) {\n const innerProgressSpan = el.querySelector(\".dff-progress-inner\");\n\n if (innerProgressSpan) {\n (innerProgressSpan as HTMLElement).style.width = `${percentage}%`;\n }\n }\n }\n}\n\nexport default RenderUploadFile;\n","type UploadStatus = \"done\" | \"error\" | \"uploading\";\nexport type UploadType =\n | \"existing\"\n | \"placeholder\"\n | \"s3\"\n | \"tus\"\n | \"uploadedS3\"\n | \"uploadedTus\";\n\nexport interface InitialExistingFile {\n name: string;\n size: number;\n type: \"existing\";\n}\n\nexport interface InitialPlaceholderFile {\n id: string;\n name: string;\n size: number;\n type: \"placeholder\";\n}\n\nexport interface InitialS3File {\n id: string;\n name: string;\n original_name: string;\n size: number;\n type: \"s3\";\n}\n\nexport interface InitialTusFile {\n id: string;\n name: string;\n size: number;\n type: \"tus\";\n url: string;\n}\n\nexport type InitialFile =\n | InitialExistingFile\n | InitialPlaceholderFile\n | InitialS3File\n | InitialTusFile;\n\ninterface UploadParameters {\n name: string;\n status: UploadStatus;\n type: UploadType;\n uploadIndex: number;\n}\n\nabstract class BaseUpload {\n name: string;\n status: UploadStatus;\n type: UploadType;\n uploadIndex: number;\n\n constructor({ name, status, type, uploadIndex }: UploadParameters) {\n this.name = name;\n this.status = status;\n this.type = type;\n this.uploadIndex = uploadIndex;\n }\n\n public async abort(): Promise {\n //\n }\n public async delete(): Promise {\n //\n }\n\n public abstract getId(): string | undefined;\n public abstract getInitialFile(): InitialFile;\n public abstract getSize(): number | undefined;\n}\n\nexport default BaseUpload;\n","function normalize (strArray) {\n var resultArray = [];\n if (strArray.length === 0) { return ''; }\n\n if (typeof strArray[0] !== 'string') {\n throw new TypeError('Url must be a string. Received ' + strArray[0]);\n }\n\n // If the first part is a plain protocol, we combine it with the next part.\n if (strArray[0].match(/^[^/:]+:\\/*$/) && strArray.length > 1) {\n var first = strArray.shift();\n strArray[0] = first + strArray[0];\n }\n\n // There must be two or three slashes in the file protocol, two slashes in anything else.\n if (strArray[0].match(/^file:\\/\\/\\//)) {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1:///');\n } else {\n strArray[0] = strArray[0].replace(/^([^/:]+):\\/*/, '$1://');\n }\n\n for (var i = 0; i < strArray.length; i++) {\n var component = strArray[i];\n\n if (typeof component !== 'string') {\n throw new TypeError('Url must be a string. Received ' + component);\n }\n\n if (component === '') { continue; }\n\n if (i > 0) {\n // Removing the starting slashes for each component but the first.\n component = component.replace(/^[\\/]+/, '');\n }\n if (i < strArray.length - 1) {\n // Removing the ending slashes for each component but the last.\n component = component.replace(/[\\/]+$/, '');\n } else {\n // For the last component we will combine multiple slashes to a single one.\n component = component.replace(/[\\/]+$/, '/');\n }\n\n resultArray.push(component);\n\n }\n\n var str = resultArray.join('/');\n // Each input component is now separated by a single slash except the possible first plain protocol part.\n\n // remove trailing slash before parameters or hash\n str = str.replace(/\\/(\\?|&|#[^!])/g, '$1');\n\n // replace ? in parameters with &\n var parts = str.split('?');\n str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&');\n\n return str;\n}\n\nexport default function urlJoin() {\n var input;\n\n if (typeof arguments[0] === 'object') {\n input = arguments[0];\n } else {\n input = [].slice.call(arguments);\n }\n\n return normalize(input);\n}\n","import urljoin from \"url-join\";\n\nexport interface LocationInfo {\n location: string;\n}\n\nexport interface MultipartUpload {\n endpoint: string;\n key: string;\n uploadId: string;\n}\n\nexport interface Part {\n ETag: string;\n PartNumber: number;\n}\n\nexport interface UrlInfo {\n url: string;\n}\n\nexport const MB = 1024 * 1024;\n\ninterface AbortMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n uploadId: string;\n}\n\nexport const abortMultipartUpload = ({\n csrfToken,\n endpoint,\n key,\n uploadId\n}: AbortMultipartUploadParameters): Promise => {\n const filename = encodeURIComponent(key);\n const uploadIdEnc = encodeURIComponent(uploadId);\n const headers = new Headers({\n \"X-CSRFToken\": csrfToken\n });\n const url = urljoin(endpoint, uploadIdEnc, `?key=${filename}`);\n return fetch(url, {\n headers: headers,\n method: \"delete\"\n }).then(response => {\n return response.json();\n });\n};\n\ninterface CompleteMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n parts: Part[];\n uploadId: string;\n}\n\nexport const completeMultipartUpload = ({\n csrfToken,\n endpoint,\n key,\n parts,\n uploadId\n}: CompleteMultipartUploadParameters): Promise => {\n const filename = encodeURIComponent(key);\n const uploadIdEnc = encodeURIComponent(uploadId);\n const headers = new Headers({\n \"X-CSRFToken\": csrfToken\n });\n const url = urljoin(endpoint, uploadIdEnc, \"complete\", `?key=${filename}`);\n return fetch(url, {\n body: JSON.stringify({\n parts: parts\n }),\n headers: headers,\n method: \"post\"\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as LocationInfo;\n });\n};\n\ninterface CreateMultipartUploadParameters {\n csrfToken: string;\n endpoint: string;\n file: File;\n s3UploadDir: string;\n}\n\nexport const createMultipartUpload = ({\n csrfToken,\n endpoint,\n file,\n s3UploadDir\n}: CreateMultipartUploadParameters): Promise => {\n const headers = new Headers({\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n \"X-CSRFToken\": csrfToken\n });\n return fetch(endpoint, {\n body: JSON.stringify({\n contentType: file.type,\n filename: file.name,\n s3UploadDir: s3UploadDir\n }),\n headers: headers,\n method: \"post\"\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as MultipartUpload;\n });\n};\n\nexport const getChunkSize = (file: File): number =>\n Math.ceil(file.size / 10000);\n\ninterface PrepareUploadPartParameters {\n csrfToken: string;\n endpoint: string;\n key: string;\n number: number;\n uploadId: string;\n}\n\nexport const prepareUploadPart = ({\n csrfToken,\n endpoint,\n key,\n number,\n uploadId\n}: PrepareUploadPartParameters): Promise => {\n const filename = encodeURIComponent(key);\n const headers = new Headers({ \"X-CSRFToken\": csrfToken });\n const url = urljoin(\n endpoint,\n uploadId,\n number.toString(),\n `?key=${filename}`\n );\n return fetch(url, {\n headers: headers,\n method: \"get\"\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n return data as UrlInfo;\n });\n};\n\nexport const remove = (arr: unknown[], el: unknown): void => {\n const i = arr.indexOf(el);\n if (i !== -1) {\n arr.splice(i, 1);\n }\n};\n","// The following code is adapted from https://github.com/transloadit/uppy/blob/master/packages/%40uppy/aws-s3-multipart/src/MultipartUploader.js\n// which is released under a MIT License (https://github.com/transloadit/uppy/blob/master/LICENSE)\n\nimport BaseUpload, { InitialFile } from \"./base_upload.ts\";\nimport {\n abortMultipartUpload,\n completeMultipartUpload,\n createMultipartUpload,\n getChunkSize,\n MB,\n MultipartUpload,\n Part,\n prepareUploadPart,\n remove,\n UrlInfo\n} from \"./s3_utils.ts\";\n\ninterface ChunkState {\n busy: boolean;\n done: boolean;\n etag?: string;\n uploaded: number;\n}\n\ninterface S3UploadParameters {\n csrfToken: string;\n endpoint: string;\n file: File;\n s3UploadDir: string;\n uploadIndex: number;\n}\n\nclass S3Upload extends BaseUpload {\n private chunks: Blob[];\n private chunkState: ChunkState[];\n private createdPromise: Promise;\n\n private csrfToken: string;\n private endpoint: string;\n private file: File;\n private key: null | string;\n private parts: Part[];\n private s3UploadDir: string;\n private uploadId: null | string;\n private uploading: XMLHttpRequest[];\n public onError?: (error: unknown) => void;\n public onProgress?: (bytesUploaded: number, bytesTotal: number) => void;\n public onSuccess?: () => void;\n\n constructor({\n csrfToken,\n endpoint,\n file,\n s3UploadDir,\n uploadIndex\n }: S3UploadParameters) {\n super({ name: file.name, status: \"uploading\", type: \"s3\", uploadIndex });\n\n this.csrfToken = csrfToken;\n this.endpoint = endpoint;\n this.file = file;\n this.s3UploadDir = s3UploadDir;\n\n this.key = null;\n this.uploadId = null;\n this.parts = [];\n\n // Do `this.createdPromise.then(OP)` to execute an operation `OP` _only_ if the\n // upload was created already. That also ensures that the sequencing is right\n // (so the `OP` definitely happens if the upload is created).\n //\n // This mostly exists to make `abortUpload` work well: only sending the abort request if\n // the upload was already created, and if the createMultipartUpload request is still in flight,\n // aborting it immediately after it finishes.\n this.createdPromise = Promise.reject(new Error());\n this.chunks = [];\n this.chunkState = [];\n this.uploading = [];\n this.onError = undefined;\n this.onProgress = undefined;\n this.onSuccess = undefined;\n\n this.initChunks();\n\n this.createdPromise.catch(() => ({})); // silence uncaught rejection warning\n }\n\n private completeUpload(): Promise {\n // Parts may not have completed uploading in sorted order, if limit > 1.\n this.parts.sort((a, b) => a.PartNumber - b.PartNumber);\n\n if (!this.uploadId || !this.key) {\n return Promise.resolve();\n }\n\n return completeMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n parts: this.parts,\n uploadId: this.uploadId\n }).then(\n () => {\n if (this.onSuccess) {\n this.onSuccess();\n }\n },\n (err: unknown) => {\n this.handleError(err as Error);\n }\n );\n }\n\n private createUpload(): Promise {\n this.createdPromise = createMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n file: this.file,\n s3UploadDir: this.s3UploadDir\n });\n return this.createdPromise\n .then((result: MultipartUpload | null) => {\n const valid =\n typeof result === \"object\" &&\n result &&\n typeof result.uploadId === \"string\" &&\n typeof result.key === \"string\";\n if (!valid) {\n throw new TypeError(\n \"AwsS3/Multipart: Got incorrect result from `createMultipartUpload()`, expected an object `{ uploadId, key }`.\"\n );\n }\n\n this.key = result.key;\n this.uploadId = result.uploadId;\n\n this.uploadParts();\n })\n .catch((err: unknown) => {\n this.handleError(err);\n });\n }\n\n private handleError(error: unknown): void {\n if (this.onError) {\n this.onError(error);\n } else {\n throw error;\n }\n }\n\n private initChunks(): void {\n const chunks: Blob[] = [];\n const desiredChunkSize = getChunkSize(this.file);\n // at least 5MB per request, at most 10k requests\n const minChunkSize = Math.max(5 * MB, Math.ceil(this.file.size / 10000));\n const chunkSize = Math.max(desiredChunkSize, minChunkSize);\n\n for (let i = 0; i < this.file.size; i += chunkSize) {\n const end = Math.min(this.file.size, i + chunkSize);\n chunks.push(this.file.slice(i, end));\n }\n\n this.chunks = chunks;\n this.chunkState = chunks.map(() => ({\n busy: false,\n done: false,\n uploaded: 0\n }));\n }\n\n private onPartComplete(index: number, etag: string): void {\n const state = this.chunkState[index];\n\n if (state) {\n state.etag = etag;\n state.done = true;\n }\n\n const part = {\n ETag: etag,\n PartNumber: index + 1\n };\n this.parts.push(part);\n\n this.uploadParts();\n }\n\n private onPartProgress(index: number, sent: number): void {\n const state = this.chunkState[index];\n\n if (state) {\n state.uploaded = sent;\n }\n\n if (this.onProgress) {\n const totalUploaded = this.chunkState.reduce((n, c) => n + c.uploaded, 0);\n this.onProgress(totalUploaded, this.file.size);\n }\n }\n\n private uploadPart(index: number): Promise {\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = true;\n }\n\n if (!this.key || !this.uploadId) {\n return Promise.resolve();\n }\n\n return prepareUploadPart({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n number: index + 1,\n uploadId: this.uploadId\n })\n .then(result => {\n const valid =\n typeof result === \"object\" && typeof result.url === \"string\";\n if (!valid) {\n throw new TypeError(\n \"AwsS3/Multipart: Got incorrect result from `prepareUploadPart()`, expected an object `{ url }`.\"\n );\n }\n return result;\n })\n .then(\n ({ url }: UrlInfo) => {\n this.uploadPartBytes(index, url);\n },\n (err: unknown) => {\n this.handleError(err);\n }\n );\n }\n\n private uploadPartBytes(index: number, url: string): void {\n const body = this.chunks[index];\n const xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", url, true);\n xhr.responseType = \"text\";\n\n this.uploading.push(xhr);\n\n xhr.upload.addEventListener(\"progress\", ev => {\n if (!ev.lengthComputable) {\n return;\n }\n\n this.onPartProgress(index, ev.loaded);\n });\n\n xhr.addEventListener(\"abort\", ev => {\n remove(this.uploading, ev.target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n });\n\n xhr.addEventListener(\"load\", ev => {\n const target = ev.target as XMLHttpRequest;\n remove(this.uploading, target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n\n if (target.status < 200 || target.status >= 300) {\n this.handleError(new Error(\"Non 2xx\"));\n return;\n }\n\n this.onPartProgress(index, body?.size ?? 0);\n\n // NOTE This must be allowed by CORS.\n const etag = target.getResponseHeader(\"ETag\");\n if (etag === null) {\n this.handleError(\n new Error(\n \"AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions.\"\n )\n );\n return;\n }\n\n this.onPartComplete(index, etag);\n });\n\n xhr.addEventListener(\"error\", ev => {\n remove(this.uploading, ev.target);\n\n const state = this.chunkState[index];\n\n if (state) {\n state.busy = false;\n }\n\n const error = new Error(\"Unknown error\");\n // error.source = ev.target\n this.handleError(error);\n });\n xhr.send(body);\n }\n\n private uploadParts(): void {\n const need = 1 - this.uploading.length;\n if (need === 0) {\n return;\n }\n\n // All parts are uploaded.\n if (this.chunkState.every(state => state.done)) {\n void this.completeUpload();\n return;\n }\n\n const candidates = [];\n for (let i = 0; i < this.chunkState.length; i++) {\n const state = this.chunkState[i];\n\n if (!state || state.done || state.busy) {\n continue;\n }\n\n candidates.push(i);\n if (candidates.length >= need) {\n break;\n }\n }\n\n candidates.forEach(index => {\n void this.uploadPart(index);\n });\n }\n\n public async abort(): Promise {\n this.uploading.slice().forEach(xhr => {\n xhr.abort();\n });\n this.uploading = [];\n\n await this.createdPromise;\n\n if (this.key && this.uploadId) {\n await abortMultipartUpload({\n csrfToken: this.csrfToken,\n endpoint: this.endpoint,\n key: this.key,\n uploadId: this.uploadId\n });\n }\n }\n\n public async delete(): Promise {\n return Promise.resolve();\n }\n\n public getId(): string | undefined {\n return this.uploadId ?? undefined;\n }\n\n public getInitialFile(): InitialFile {\n return {\n id: this.uploadId ?? \"\",\n name: this.key ?? \"\",\n original_name: this.file.name,\n size: this.file.size,\n type: \"s3\"\n };\n }\n\n public getSize(): number {\n return this.file.size;\n }\n\n public start(): void {\n void this.createUpload();\n }\n}\n\nexport default S3Upload;\n","class DetailedError extends Error {\n constructor(message, causingErr = null, req = null, res = null) {\n super(message)\n\n this.originalRequest = req\n this.originalResponse = res\n this.causingError = causingErr\n\n if (causingErr != null) {\n message += `, caused by ${causingErr.toString()}`\n }\n\n if (req != null) {\n const requestId = req.getHeader('X-Request-ID') || 'n/a'\n const method = req.getMethod()\n const url = req.getURL()\n const status = res ? res.getStatus() : 'n/a'\n const body = res ? res.getBody() || '' : 'n/a'\n message += `, originated from request (method: ${method}, url: ${url}, response code: ${status}, response text: ${body}, request id: ${requestId})`\n }\n this.message = message\n }\n}\n\nexport default DetailedError\n","/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.7.7';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _hasBuffer = typeof Buffer === 'function';\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)\n : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')\n : btoaPolyfill;\nconst _fromUint8Array = _hasBuffer\n ? (u8a) => Buffer.from(u8a).toString('base64')\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _hasBuffer\n ? (s) => Buffer.from(s, 'utf8').toString('base64')\n : _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, bin = '', r1, r2;\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))\n : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')\n : atobPolyfill;\n//\nconst _toUint8Array = _hasBuffer\n ? (a) => _U8Afrom(Buffer.from(a, 'base64'))\n : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _hasBuffer\n ? (a) => Buffer.from(a, 'base64').toString('utf8')\n : _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins\n};\n// makecjs:CUT //\nexport { version };\nexport { VERSION };\nexport { _atob as atob };\nexport { atobPolyfill };\nexport { _btoa as btoa };\nexport { btoaPolyfill };\nexport { decode as fromBase64 };\nexport { encode as toBase64 };\nexport { utob };\nexport { encode };\nexport { encodeURI };\nexport { encodeURI as encodeURL };\nexport { btou };\nexport { decode };\nexport { isValid };\nexport { fromUint8Array };\nexport { toUint8Array };\nexport { extendString };\nexport { extendUint8Array };\nexport { extendBuiltins };\n// and finally,\nexport { gBase64 as Base64 };\n","'use strict';\n\n/**\n * Check if we're required to add a port number.\n *\n * @see https://url.spec.whatwg.org/#default-port\n * @param {Number|String} port Port number we need to check\n * @param {String} protocol Protocol we need to check against.\n * @returns {Boolean} Is it a default port for the given protocol\n * @api private\n */\nmodule.exports = function required(port, protocol) {\n protocol = protocol.split(':')[0];\n port = +port;\n\n if (!port) return false;\n\n switch (protocol) {\n case 'http':\n case 'ws':\n return port !== 80;\n\n case 'https':\n case 'wss':\n return port !== 443;\n\n case 'ftp':\n return port !== 21;\n\n case 'gopher':\n return port !== 70;\n\n case 'file':\n return false;\n }\n\n return port !== 0;\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , undef;\n\n/**\n * Decode a URI encoded string.\n *\n * @param {String} input The URI encoded string.\n * @returns {String|Null} The decoded string.\n * @api private\n */\nfunction decode(input) {\n try {\n return decodeURIComponent(input.replace(/\\+/g, ' '));\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Attempts to encode a given input.\n *\n * @param {String} input The string that needs to be encoded.\n * @returns {String|Null} The encoded string.\n * @api private\n */\nfunction encode(input) {\n try {\n return encodeURIComponent(input);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Simple query string parser.\n *\n * @param {String} query The query string that needs to be parsed.\n * @returns {Object}\n * @api public\n */\nfunction querystring(query) {\n var parser = /([^=?#&]+)=?([^&]*)/g\n , result = {}\n , part;\n\n while (part = parser.exec(query)) {\n var key = decode(part[1])\n , value = decode(part[2]);\n\n //\n // Prevent overriding of existing properties. This ensures that build-in\n // methods like `toString` or __proto__ are not overriden by malicious\n // querystrings.\n //\n // In the case if failed decoding, we want to omit the key/value pairs\n // from the result.\n //\n if (key === null || value === null || key in result) continue;\n result[key] = value;\n }\n\n return result;\n}\n\n/**\n * Transform a query string to an object.\n *\n * @param {Object} obj Object that should be transformed.\n * @param {String} prefix Optional prefix.\n * @returns {String}\n * @api public\n */\nfunction querystringify(obj, prefix) {\n prefix = prefix || '';\n\n var pairs = []\n , value\n , key;\n\n //\n // Optionally prefix with a '?' if needed\n //\n if ('string' !== typeof prefix) prefix = '?';\n\n for (key in obj) {\n if (has.call(obj, key)) {\n value = obj[key];\n\n //\n // Edge cases where we actually want to encode the value to an empty\n // string instead of the stringified value.\n //\n if (!value && (value === null || value === undef || isNaN(value))) {\n value = '';\n }\n\n key = encode(key);\n value = encode(value);\n\n //\n // If we failed to encode the strings, we should bail out as we don't\n // want to add invalid strings to the query.\n //\n if (key === null || value === null) continue;\n pairs.push(key +'='+ value);\n }\n }\n\n return pairs.length ? prefix + pairs.join('&') : '';\n}\n\n//\n// Expose the module.\n//\nexports.stringify = querystringify;\nexports.parse = querystring;\n","'use strict';\n\nvar required = require('requires-port')\n , qs = require('querystringify')\n , controlOrWhitespace = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n , CRHTLF = /[\\n\\r\\t]/g\n , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\\/\\//\n , port = /:\\d+$/\n , protocolre = /^([a-z][a-z0-9.+-]*:)?(\\/\\/)?([\\\\/]+)?([\\S\\s]*)/i\n , windowsDriveLetter = /^[a-zA-Z]:/;\n\n/**\n * Remove control characters and whitespace from the beginning of a string.\n *\n * @param {Object|String} str String to trim.\n * @returns {String} A new string representing `str` stripped of control\n * characters and whitespace from its beginning.\n * @public\n */\nfunction trimLeft(str) {\n return (str ? str : '').toString().replace(controlOrWhitespace, '');\n}\n\n/**\n * These are the parse rules for the URL parser, it informs the parser\n * about:\n *\n * 0. The char it Needs to parse, if it's a string it should be done using\n * indexOf, RegExp using exec and NaN means set as current value.\n * 1. The property we should set when parsing this value.\n * 2. Indication if it's backwards or forward parsing, when set as number it's\n * the value of extra chars that should be split off.\n * 3. Inherit from location if non existing in the parser.\n * 4. `toLowerCase` the resulting value.\n */\nvar rules = [\n ['#', 'hash'], // Extract from the back.\n ['?', 'query'], // Extract from the back.\n function sanitize(address, url) { // Sanitize what is left of the address\n return isSpecial(url.protocol) ? address.replace(/\\\\/g, '/') : address;\n },\n ['/', 'pathname'], // Extract from the back.\n ['@', 'auth', 1], // Extract from the front.\n [NaN, 'host', undefined, 1, 1], // Set left over value.\n [/:(\\d*)$/, 'port', undefined, 1], // RegExp the back.\n [NaN, 'hostname', undefined, 1, 1] // Set left over.\n];\n\n/**\n * These properties should not be copied or inherited from. This is only needed\n * for all non blob URL's as a blob URL does not include a hash, only the\n * origin.\n *\n * @type {Object}\n * @private\n */\nvar ignore = { hash: 1, query: 1 };\n\n/**\n * The location object differs when your code is loaded through a normal page,\n * Worker or through a worker using a blob. And with the blobble begins the\n * trouble as the location object will contain the URL of the blob, not the\n * location of the page where our code is loaded in. The actual origin is\n * encoded in the `pathname` so we can thankfully generate a good \"default\"\n * location from it so we can generate proper relative URL's again.\n *\n * @param {Object|String} loc Optional default location object.\n * @returns {Object} lolcation object.\n * @public\n */\nfunction lolcation(loc) {\n var globalVar;\n\n if (typeof window !== 'undefined') globalVar = window;\n else if (typeof global !== 'undefined') globalVar = global;\n else if (typeof self !== 'undefined') globalVar = self;\n else globalVar = {};\n\n var location = globalVar.location || {};\n loc = loc || location;\n\n var finaldestination = {}\n , type = typeof loc\n , key;\n\n if ('blob:' === loc.protocol) {\n finaldestination = new Url(unescape(loc.pathname), {});\n } else if ('string' === type) {\n finaldestination = new Url(loc, {});\n for (key in ignore) delete finaldestination[key];\n } else if ('object' === type) {\n for (key in loc) {\n if (key in ignore) continue;\n finaldestination[key] = loc[key];\n }\n\n if (finaldestination.slashes === undefined) {\n finaldestination.slashes = slashes.test(loc.href);\n }\n }\n\n return finaldestination;\n}\n\n/**\n * Check whether a protocol scheme is special.\n *\n * @param {String} The protocol scheme of the URL\n * @return {Boolean} `true` if the protocol scheme is special, else `false`\n * @private\n */\nfunction isSpecial(scheme) {\n return (\n scheme === 'file:' ||\n scheme === 'ftp:' ||\n scheme === 'http:' ||\n scheme === 'https:' ||\n scheme === 'ws:' ||\n scheme === 'wss:'\n );\n}\n\n/**\n * @typedef ProtocolExtract\n * @type Object\n * @property {String} protocol Protocol matched in the URL, in lowercase.\n * @property {Boolean} slashes `true` if protocol is followed by \"//\", else `false`.\n * @property {String} rest Rest of the URL that is not part of the protocol.\n */\n\n/**\n * Extract protocol information from a URL with/without double slash (\"//\").\n *\n * @param {String} address URL we want to extract from.\n * @param {Object} location\n * @return {ProtocolExtract} Extracted information.\n * @private\n */\nfunction extractProtocol(address, location) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n location = location || {};\n\n var match = protocolre.exec(address);\n var protocol = match[1] ? match[1].toLowerCase() : '';\n var forwardSlashes = !!match[2];\n var otherSlashes = !!match[3];\n var slashesCount = 0;\n var rest;\n\n if (forwardSlashes) {\n if (otherSlashes) {\n rest = match[2] + match[3] + match[4];\n slashesCount = match[2].length + match[3].length;\n } else {\n rest = match[2] + match[4];\n slashesCount = match[2].length;\n }\n } else {\n if (otherSlashes) {\n rest = match[3] + match[4];\n slashesCount = match[3].length;\n } else {\n rest = match[4]\n }\n }\n\n if (protocol === 'file:') {\n if (slashesCount >= 2) {\n rest = rest.slice(2);\n }\n } else if (isSpecial(protocol)) {\n rest = match[4];\n } else if (protocol) {\n if (forwardSlashes) {\n rest = rest.slice(2);\n }\n } else if (slashesCount >= 2 && isSpecial(location.protocol)) {\n rest = match[4];\n }\n\n return {\n protocol: protocol,\n slashes: forwardSlashes || isSpecial(protocol),\n slashesCount: slashesCount,\n rest: rest\n };\n}\n\n/**\n * Resolve a relative URL pathname against a base URL pathname.\n *\n * @param {String} relative Pathname of the relative URL.\n * @param {String} base Pathname of the base URL.\n * @return {String} Resolved pathname.\n * @private\n */\nfunction resolve(relative, base) {\n if (relative === '') return base;\n\n var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/'))\n , i = path.length\n , last = path[i - 1]\n , unshift = false\n , up = 0;\n\n while (i--) {\n if (path[i] === '.') {\n path.splice(i, 1);\n } else if (path[i] === '..') {\n path.splice(i, 1);\n up++;\n } else if (up) {\n if (i === 0) unshift = true;\n path.splice(i, 1);\n up--;\n }\n }\n\n if (unshift) path.unshift('');\n if (last === '.' || last === '..') path.push('');\n\n return path.join('/');\n}\n\n/**\n * The actual URL instance. Instead of returning an object we've opted-in to\n * create an actual constructor as it's much more memory efficient and\n * faster and it pleases my OCD.\n *\n * It is worth noting that we should not use `URL` as class name to prevent\n * clashes with the global URL instance that got introduced in browsers.\n *\n * @constructor\n * @param {String} address URL we want to parse.\n * @param {Object|String} [location] Location defaults for relative paths.\n * @param {Boolean|Function} [parser] Parser for the query string.\n * @private\n */\nfunction Url(address, location, parser) {\n address = trimLeft(address);\n address = address.replace(CRHTLF, '');\n\n if (!(this instanceof Url)) {\n return new Url(address, location, parser);\n }\n\n var relative, extracted, parse, instruction, index, key\n , instructions = rules.slice()\n , type = typeof location\n , url = this\n , i = 0;\n\n //\n // The following if statements allows this module two have compatibility with\n // 2 different API:\n //\n // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments\n // where the boolean indicates that the query string should also be parsed.\n //\n // 2. The `URL` interface of the browser which accepts a URL, object as\n // arguments. The supplied object will be used as default values / fall-back\n // for relative paths.\n //\n if ('object' !== type && 'string' !== type) {\n parser = location;\n location = null;\n }\n\n if (parser && 'function' !== typeof parser) parser = qs.parse;\n\n location = lolcation(location);\n\n //\n // Extract protocol information before running the instructions.\n //\n extracted = extractProtocol(address || '', location);\n relative = !extracted.protocol && !extracted.slashes;\n url.slashes = extracted.slashes || relative && location.slashes;\n url.protocol = extracted.protocol || location.protocol || '';\n address = extracted.rest;\n\n //\n // When the authority component is absent the URL starts with a path\n // component.\n //\n if (\n extracted.protocol === 'file:' && (\n extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) ||\n (!extracted.slashes &&\n (extracted.protocol ||\n extracted.slashesCount < 2 ||\n !isSpecial(url.protocol)))\n ) {\n instructions[3] = [/(.*)/, 'pathname'];\n }\n\n for (; i < instructions.length; i++) {\n instruction = instructions[i];\n\n if (typeof instruction === 'function') {\n address = instruction(address, url);\n continue;\n }\n\n parse = instruction[0];\n key = instruction[1];\n\n if (parse !== parse) {\n url[key] = address;\n } else if ('string' === typeof parse) {\n index = parse === '@'\n ? address.lastIndexOf(parse)\n : address.indexOf(parse);\n\n if (~index) {\n if ('number' === typeof instruction[2]) {\n url[key] = address.slice(0, index);\n address = address.slice(index + instruction[2]);\n } else {\n url[key] = address.slice(index);\n address = address.slice(0, index);\n }\n }\n } else if ((index = parse.exec(address))) {\n url[key] = index[1];\n address = address.slice(0, index.index);\n }\n\n url[key] = url[key] || (\n relative && instruction[3] ? location[key] || '' : ''\n );\n\n //\n // Hostname, host and protocol should be lowercased so they can be used to\n // create a proper `origin`.\n //\n if (instruction[4]) url[key] = url[key].toLowerCase();\n }\n\n //\n // Also parse the supplied query string in to an object. If we're supplied\n // with a custom parser as function use that instead of the default build-in\n // parser.\n //\n if (parser) url.query = parser(url.query);\n\n //\n // If the URL is relative, resolve the pathname against the base URL.\n //\n if (\n relative\n && location.slashes\n && url.pathname.charAt(0) !== '/'\n && (url.pathname !== '' || location.pathname !== '')\n ) {\n url.pathname = resolve(url.pathname, location.pathname);\n }\n\n //\n // Default to a / for pathname if none exists. This normalizes the URL\n // to always have a /\n //\n if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {\n url.pathname = '/' + url.pathname;\n }\n\n //\n // We should not add port numbers if they are already the default port number\n // for a given protocol. As the host also contains the port number we're going\n // override it with the hostname which contains no port number.\n //\n if (!required(url.port, url.protocol)) {\n url.host = url.hostname;\n url.port = '';\n }\n\n //\n // Parse down the `auth` for the username and password.\n //\n url.username = url.password = '';\n\n if (url.auth) {\n index = url.auth.indexOf(':');\n\n if (~index) {\n url.username = url.auth.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = url.auth.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password))\n } else {\n url.username = encodeURIComponent(decodeURIComponent(url.auth));\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n }\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n //\n // The href is just the compiled result.\n //\n url.href = url.toString();\n}\n\n/**\n * This is convenience method for changing properties in the URL instance to\n * insure that they all propagate correctly.\n *\n * @param {String} part Property we need to adjust.\n * @param {Mixed} value The newly assigned value.\n * @param {Boolean|Function} fn When setting the query, it will be the function\n * used to parse the query.\n * When setting the protocol, double slash will be\n * removed from the final url if it is true.\n * @returns {URL} URL instance for chaining.\n * @public\n */\nfunction set(part, value, fn) {\n var url = this;\n\n switch (part) {\n case 'query':\n if ('string' === typeof value && value.length) {\n value = (fn || qs.parse)(value);\n }\n\n url[part] = value;\n break;\n\n case 'port':\n url[part] = value;\n\n if (!required(value, url.protocol)) {\n url.host = url.hostname;\n url[part] = '';\n } else if (value) {\n url.host = url.hostname +':'+ value;\n }\n\n break;\n\n case 'hostname':\n url[part] = value;\n\n if (url.port) value += ':'+ url.port;\n url.host = value;\n break;\n\n case 'host':\n url[part] = value;\n\n if (port.test(value)) {\n value = value.split(':');\n url.port = value.pop();\n url.hostname = value.join(':');\n } else {\n url.hostname = value;\n url.port = '';\n }\n\n break;\n\n case 'protocol':\n url.protocol = value.toLowerCase();\n url.slashes = !fn;\n break;\n\n case 'pathname':\n case 'hash':\n if (value) {\n var char = part === 'pathname' ? '/' : '#';\n url[part] = value.charAt(0) !== char ? char + value : value;\n } else {\n url[part] = value;\n }\n break;\n\n case 'username':\n case 'password':\n url[part] = encodeURIComponent(value);\n break;\n\n case 'auth':\n var index = value.indexOf(':');\n\n if (~index) {\n url.username = value.slice(0, index);\n url.username = encodeURIComponent(decodeURIComponent(url.username));\n\n url.password = value.slice(index + 1);\n url.password = encodeURIComponent(decodeURIComponent(url.password));\n } else {\n url.username = encodeURIComponent(decodeURIComponent(value));\n }\n }\n\n for (var i = 0; i < rules.length; i++) {\n var ins = rules[i];\n\n if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();\n }\n\n url.auth = url.password ? url.username +':'+ url.password : url.username;\n\n url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host\n ? url.protocol +'//'+ url.host\n : 'null';\n\n url.href = url.toString();\n\n return url;\n}\n\n/**\n * Transform the properties back in to a valid and full URL string.\n *\n * @param {Function} stringify Optional query stringify function.\n * @returns {String} Compiled version of the URL.\n * @public\n */\nfunction toString(stringify) {\n if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;\n\n var query\n , url = this\n , host = url.host\n , protocol = url.protocol;\n\n if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';\n\n var result =\n protocol +\n ((url.protocol && url.slashes) || isSpecial(url.protocol) ? '//' : '');\n\n if (url.username) {\n result += url.username;\n if (url.password) result += ':'+ url.password;\n result += '@';\n } else if (url.password) {\n result += ':'+ url.password;\n result += '@';\n } else if (\n url.protocol !== 'file:' &&\n isSpecial(url.protocol) &&\n !host &&\n url.pathname !== '/'\n ) {\n //\n // Add back the empty userinfo, otherwise the original invalid URL\n // might be transformed into a valid one with `url.pathname` as host.\n //\n result += '@';\n }\n\n //\n // Trailing colon is removed from `url.host` when it is parsed. If it still\n // ends with a colon, then add back the trailing colon that was removed. This\n // prevents an invalid URL from being transformed into a valid one.\n //\n if (host[host.length - 1] === ':' || (port.test(url.hostname) && !url.port)) {\n host += ':';\n }\n\n result += host + url.pathname;\n\n query = 'object' === typeof url.query ? stringify(url.query) : url.query;\n if (query) result += '?' !== query.charAt(0) ? '?'+ query : query;\n\n if (url.hash) result += url.hash;\n\n return result;\n}\n\nUrl.prototype = { set: set, toString: toString };\n\n//\n// Expose the URL parser and some additional properties that might be useful for\n// others or testing.\n//\nUrl.extractProtocol = extractProtocol;\nUrl.location = lolcation;\nUrl.trimLeft = trimLeft;\nUrl.qs = qs;\n\nmodule.exports = Url;\n","import { Base64 } from 'js-base64'\nimport URL from 'url-parse'\nimport DetailedError from './error.js'\nimport { log } from './logger.js'\nimport uuid from './uuid.js'\n\nconst PROTOCOL_TUS_V1 = 'tus-v1'\nconst PROTOCOL_IETF_DRAFT_03 = 'ietf-draft-03'\n\nconst defaultOptions = {\n endpoint: null,\n\n uploadUrl: null,\n metadata: {},\n metadataForPartialUploads: {},\n fingerprint: null,\n uploadSize: null,\n\n onProgress: null,\n onChunkComplete: null,\n onSuccess: null,\n onError: null,\n onUploadUrlAvailable: null,\n\n overridePatchMethod: false,\n headers: {},\n addRequestId: false,\n onBeforeRequest: null,\n onAfterResponse: null,\n onShouldRetry: defaultOnShouldRetry,\n\n chunkSize: Number.POSITIVE_INFINITY,\n retryDelays: [0, 1000, 3000, 5000],\n parallelUploads: 1,\n parallelUploadBoundaries: null,\n storeFingerprintForResuming: true,\n removeFingerprintOnSuccess: false,\n uploadLengthDeferred: false,\n uploadDataDuringCreation: false,\n\n urlStorage: null,\n fileReader: null,\n httpStack: null,\n\n protocol: PROTOCOL_TUS_V1,\n}\n\nclass BaseUpload {\n constructor(file, options) {\n // Warn about removed options from previous versions\n if ('resume' in options) {\n console.log(\n 'tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead.',\n )\n }\n\n // The default options will already be added from the wrapper classes.\n this.options = options\n\n // Cast chunkSize to integer\n this.options.chunkSize = Number(this.options.chunkSize)\n\n // The storage module used to store URLs\n this._urlStorage = this.options.urlStorage\n\n // The underlying File/Blob object\n this.file = file\n\n // The URL against which the file will be uploaded\n this.url = null\n\n // The underlying request object for the current PATCH request\n this._req = null\n\n // The fingerpinrt for the current file (set after start())\n this._fingerprint = null\n\n // The key that the URL storage returned when saving an URL with a fingerprint,\n this._urlStorageKey = null\n\n // The offset used in the current PATCH request\n this._offset = null\n\n // True if the current PATCH request has been aborted\n this._aborted = false\n\n // The file's size in bytes\n this._size = null\n\n // The Source object which will wrap around the given file and provides us\n // with a unified interface for getting its size and slice chunks from its\n // content allowing us to easily handle Files, Blobs, Buffers and Streams.\n this._source = null\n\n // The current count of attempts which have been made. Zero indicates none.\n this._retryAttempt = 0\n\n // The timeout's ID which is used to delay the next retry\n this._retryTimeout = null\n\n // The offset of the remote upload before the latest attempt was started.\n this._offsetBeforeRetry = 0\n\n // An array of BaseUpload instances which are used for uploading the different\n // parts, if the parallelUploads option is used.\n this._parallelUploads = null\n\n // An array of upload URLs which are used for uploading the different\n // parts, if the parallelUploads option is used.\n this._parallelUploadUrls = null\n }\n\n /**\n * Use the Termination extension to delete an upload from the server by sending a DELETE\n * request to the specified upload URL. This is only possible if the server supports the\n * Termination extension. If the `options.retryDelays` property is set, the method will\n * also retry if an error ocurrs.\n *\n * @param {String} url The upload's URL which will be terminated.\n * @param {object} options Optional options for influencing HTTP requests.\n * @return {Promise} The Promise will be resolved/rejected when the requests finish.\n */\n static terminate(url, options = {}) {\n const req = openRequest('DELETE', url, options)\n\n return sendRequest(req, null, options)\n .then((res) => {\n // A 204 response indicates a successfull request\n if (res.getStatus() === 204) {\n return\n }\n\n throw new DetailedError('tus: unexpected response while terminating upload', null, req, res)\n })\n .catch((err) => {\n if (!(err instanceof DetailedError)) {\n err = new DetailedError('tus: failed to terminate upload', err, req, null)\n }\n\n if (!shouldRetry(err, 0, options)) {\n throw err\n }\n\n // Instead of keeping track of the retry attempts, we remove the first element from the delays\n // array. If the array is empty, all retry attempts are used up and we will bubble up the error.\n // We recursively call the terminate function will removing elements from the retryDelays array.\n const delay = options.retryDelays[0]\n const remainingDelays = options.retryDelays.slice(1)\n const newOptions = {\n ...options,\n retryDelays: remainingDelays,\n }\n return new Promise((resolve) => setTimeout(resolve, delay)).then(() =>\n BaseUpload.terminate(url, newOptions),\n )\n })\n }\n\n findPreviousUploads() {\n return this.options\n .fingerprint(this.file, this.options)\n .then((fingerprint) => this._urlStorage.findUploadsByFingerprint(fingerprint))\n }\n\n resumeFromPreviousUpload(previousUpload) {\n this.url = previousUpload.uploadUrl || null\n this._parallelUploadUrls = previousUpload.parallelUploadUrls || null\n this._urlStorageKey = previousUpload.urlStorageKey\n }\n\n start() {\n const { file } = this\n\n if (!file) {\n this._emitError(new Error('tus: no file or stream to upload provided'))\n return\n }\n\n if (![PROTOCOL_TUS_V1, PROTOCOL_IETF_DRAFT_03].includes(this.options.protocol)) {\n this._emitError(new Error(`tus: unsupported protocol ${this.options.protocol}`))\n return\n }\n\n if (!this.options.endpoint && !this.options.uploadUrl && !this.url) {\n this._emitError(new Error('tus: neither an endpoint or an upload URL is provided'))\n return\n }\n\n const { retryDelays } = this.options\n if (retryDelays != null && Object.prototype.toString.call(retryDelays) !== '[object Array]') {\n this._emitError(new Error('tus: the `retryDelays` option must either be an array or null'))\n return\n }\n\n if (this.options.parallelUploads > 1) {\n // Test which options are incompatible with parallel uploads.\n for (const optionName of ['uploadUrl', 'uploadSize', 'uploadLengthDeferred']) {\n if (this.options[optionName]) {\n this._emitError(\n new Error(`tus: cannot use the ${optionName} option when parallelUploads is enabled`),\n )\n return\n }\n }\n }\n\n if (this.options.parallelUploadBoundaries) {\n if (this.options.parallelUploads <= 1) {\n this._emitError(\n new Error(\n 'tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled',\n ),\n )\n return\n }\n if (this.options.parallelUploads !== this.options.parallelUploadBoundaries.length) {\n this._emitError(\n new Error(\n 'tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`',\n ),\n )\n return\n }\n }\n\n this.options\n .fingerprint(file, this.options)\n .then((fingerprint) => {\n if (fingerprint == null) {\n log(\n 'No fingerprint was calculated meaning that the upload cannot be stored in the URL storage.',\n )\n } else {\n log(`Calculated fingerprint: ${fingerprint}`)\n }\n\n this._fingerprint = fingerprint\n\n if (this._source) {\n return this._source\n }\n return this.options.fileReader.openFile(file, this.options.chunkSize)\n })\n .then((source) => {\n this._source = source\n\n // First, we look at the uploadLengthDeferred option.\n // Next, we check if the caller has supplied a manual upload size.\n // Finally, we try to use the calculated size from the source object.\n if (this.options.uploadLengthDeferred) {\n this._size = null\n } else if (this.options.uploadSize != null) {\n this._size = Number(this.options.uploadSize)\n if (Number.isNaN(this._size)) {\n this._emitError(new Error('tus: cannot convert `uploadSize` option into a number'))\n return\n }\n } else {\n this._size = this._source.size\n if (this._size == null) {\n this._emitError(\n new Error(\n \"tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option\",\n ),\n )\n return\n }\n }\n\n // If the upload was configured to use multiple requests or if we resume from\n // an upload which used multiple requests, we start a parallel upload.\n if (this.options.parallelUploads > 1 || this._parallelUploadUrls != null) {\n this._startParallelUpload()\n } else {\n this._startSingleUpload()\n }\n })\n .catch((err) => {\n this._emitError(err)\n })\n }\n\n /**\n * Initiate the uploading procedure for a parallelized upload, where one file is split into\n * multiple request which are run in parallel.\n *\n * @api private\n */\n _startParallelUpload() {\n const totalSize = this._size\n let totalProgress = 0\n this._parallelUploads = []\n\n const partCount =\n this._parallelUploadUrls != null\n ? this._parallelUploadUrls.length\n : this.options.parallelUploads\n\n // The input file will be split into multiple slices which are uploaded in separate\n // requests. Here we get the start and end position for the slices.\n const parts =\n this.options.parallelUploadBoundaries ?? splitSizeIntoParts(this._source.size, partCount)\n\n // Attach URLs from previous uploads, if available.\n if (this._parallelUploadUrls) {\n parts.forEach((part, index) => {\n part.uploadUrl = this._parallelUploadUrls[index] || null\n })\n }\n\n // Create an empty list for storing the upload URLs\n this._parallelUploadUrls = new Array(parts.length)\n\n // Generate a promise for each slice that will be resolve if the respective\n // upload is completed.\n const uploads = parts.map((part, index) => {\n let lastPartProgress = 0\n\n return this._source.slice(part.start, part.end).then(\n ({ value }) =>\n new Promise((resolve, reject) => {\n // Merge with the user supplied options but overwrite some values.\n const options = {\n ...this.options,\n // If available, the partial upload should be resumed from a previous URL.\n uploadUrl: part.uploadUrl || null,\n // We take manually care of resuming for partial uploads, so they should\n // not be stored in the URL storage.\n storeFingerprintForResuming: false,\n removeFingerprintOnSuccess: false,\n // Reset the parallelUploads option to not cause recursion.\n parallelUploads: 1,\n // Reset this option as we are not doing a parallel upload.\n parallelUploadBoundaries: null,\n metadata: this.options.metadataForPartialUploads,\n // Add the header to indicate the this is a partial upload.\n headers: {\n ...this.options.headers,\n 'Upload-Concat': 'partial',\n },\n // Reject or resolve the promise if the upload errors or completes.\n onSuccess: resolve,\n onError: reject,\n // Based in the progress for this partial upload, calculate the progress\n // for the entire final upload.\n onProgress: (newPartProgress) => {\n totalProgress = totalProgress - lastPartProgress + newPartProgress\n lastPartProgress = newPartProgress\n this._emitProgress(totalProgress, totalSize)\n },\n // Wait until every partial upload has an upload URL, so we can add\n // them to the URL storage.\n onUploadUrlAvailable: () => {\n this._parallelUploadUrls[index] = upload.url\n // Test if all uploads have received an URL\n if (this._parallelUploadUrls.filter((u) => Boolean(u)).length === parts.length) {\n this._saveUploadInUrlStorage()\n }\n },\n }\n\n const upload = new BaseUpload(value, options)\n upload.start()\n\n // Store the upload in an array, so we can later abort them if necessary.\n this._parallelUploads.push(upload)\n }),\n )\n })\n\n let req\n // Wait until all partial uploads are finished and we can send the POST request for\n // creating the final upload.\n Promise.all(uploads)\n .then(() => {\n req = this._openRequest('POST', this.options.endpoint)\n req.setHeader('Upload-Concat', `final;${this._parallelUploadUrls.join(' ')}`)\n\n // Add metadata if values have been added\n const metadata = encodeMetadata(this.options.metadata)\n if (metadata !== '') {\n req.setHeader('Upload-Metadata', metadata)\n }\n\n return this._sendRequest(req, null)\n })\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while creating upload')\n return\n }\n\n const location = res.getHeader('Location')\n if (location == null) {\n this._emitHttpError(req, res, 'tus: invalid or missing Location header')\n return\n }\n\n this.url = resolveUrl(this.options.endpoint, location)\n log(`Created upload at ${this.url}`)\n\n this._emitSuccess(res)\n })\n .catch((err) => {\n this._emitError(err)\n })\n }\n\n /**\n * Initiate the uploading procedure for a non-parallel upload. Here the entire file is\n * uploaded in a sequential matter.\n *\n * @api private\n */\n _startSingleUpload() {\n // Reset the aborted flag when the upload is started or else the\n // _performUpload will stop before sending a request if the upload has been\n // aborted previously.\n this._aborted = false\n\n // The upload had been started previously and we should reuse this URL.\n if (this.url != null) {\n log(`Resuming upload from previous URL: ${this.url}`)\n this._resumeUpload()\n return\n }\n\n // A URL has manually been specified, so we try to resume\n if (this.options.uploadUrl != null) {\n log(`Resuming upload from provided URL: ${this.options.uploadUrl}`)\n this.url = this.options.uploadUrl\n this._resumeUpload()\n return\n }\n\n // An upload has not started for the file yet, so we start a new one\n log('Creating a new upload')\n this._createUpload()\n }\n\n /**\n * Abort any running request and stop the current upload. After abort is called, no event\n * handler will be invoked anymore. You can use the `start` method to resume the upload\n * again.\n * If `shouldTerminate` is true, the `terminate` function will be called to remove the\n * current upload from the server.\n *\n * @param {boolean} shouldTerminate True if the upload should be deleted from the server.\n * @return {Promise} The Promise will be resolved/rejected when the requests finish.\n */\n abort(shouldTerminate) {\n // Stop any parallel partial uploads, that have been started in _startParallelUploads.\n if (this._parallelUploads != null) {\n for (const upload of this._parallelUploads) {\n upload.abort(shouldTerminate)\n }\n }\n\n // Stop any current running request.\n if (this._req !== null) {\n this._req.abort()\n // Note: We do not close the file source here, so the user can resume in the future.\n }\n this._aborted = true\n\n // Stop any timeout used for initiating a retry.\n if (this._retryTimeout != null) {\n clearTimeout(this._retryTimeout)\n this._retryTimeout = null\n }\n\n if (!shouldTerminate || this.url == null) {\n return Promise.resolve()\n }\n\n return (\n BaseUpload.terminate(this.url, this.options)\n // Remove entry from the URL storage since the upload URL is no longer valid.\n .then(() => this._removeFromUrlStorage())\n )\n }\n\n _emitHttpError(req, res, message, causingErr) {\n this._emitError(new DetailedError(message, causingErr, req, res))\n }\n\n _emitError(err) {\n // Do not emit errors, e.g. from aborted HTTP requests, if the upload has been stopped.\n if (this._aborted) return\n\n // Check if we should retry, when enabled, before sending the error to the user.\n if (this.options.retryDelays != null) {\n // We will reset the attempt counter if\n // - we were already able to connect to the server (offset != null) and\n // - we were able to upload a small chunk of data to the server\n const shouldResetDelays = this._offset != null && this._offset > this._offsetBeforeRetry\n if (shouldResetDelays) {\n this._retryAttempt = 0\n }\n\n if (shouldRetry(err, this._retryAttempt, this.options)) {\n const delay = this.options.retryDelays[this._retryAttempt++]\n\n this._offsetBeforeRetry = this._offset\n\n this._retryTimeout = setTimeout(() => {\n this.start()\n }, delay)\n return\n }\n }\n\n if (typeof this.options.onError === 'function') {\n this.options.onError(err)\n } else {\n throw err\n }\n }\n\n /**\n * Publishes notification if the upload has been successfully completed.\n *\n * @param {object} lastResponse Last HTTP response.\n * @api private\n */\n _emitSuccess(lastResponse) {\n if (this.options.removeFingerprintOnSuccess) {\n // Remove stored fingerprint and corresponding endpoint. This causes\n // new uploads of the same file to be treated as a different file.\n this._removeFromUrlStorage()\n }\n\n if (typeof this.options.onSuccess === 'function') {\n this.options.onSuccess({ lastResponse })\n }\n }\n\n /**\n * Publishes notification when data has been sent to the server. This\n * data may not have been accepted by the server yet.\n *\n * @param {number} bytesSent Number of bytes sent to the server.\n * @param {number} bytesTotal Total number of bytes to be sent to the server.\n * @api private\n */\n _emitProgress(bytesSent, bytesTotal) {\n if (typeof this.options.onProgress === 'function') {\n this.options.onProgress(bytesSent, bytesTotal)\n }\n }\n\n /**\n * Publishes notification when a chunk of data has been sent to the server\n * and accepted by the server.\n * @param {number} chunkSize Size of the chunk that was accepted by the server.\n * @param {number} bytesAccepted Total number of bytes that have been\n * accepted by the server.\n * @param {number} bytesTotal Total number of bytes to be sent to the server.\n * @api private\n */\n _emitChunkComplete(chunkSize, bytesAccepted, bytesTotal) {\n if (typeof this.options.onChunkComplete === 'function') {\n this.options.onChunkComplete(chunkSize, bytesAccepted, bytesTotal)\n }\n }\n\n /**\n * Create a new upload using the creation extension by sending a POST\n * request to the endpoint. After successful creation the file will be\n * uploaded\n *\n * @api private\n */\n _createUpload() {\n if (!this.options.endpoint) {\n this._emitError(new Error('tus: unable to create upload because no endpoint is provided'))\n return\n }\n\n const req = this._openRequest('POST', this.options.endpoint)\n\n if (this.options.uploadLengthDeferred) {\n req.setHeader('Upload-Defer-Length', '1')\n } else {\n req.setHeader('Upload-Length', `${this._size}`)\n }\n\n // Add metadata if values have been added\n const metadata = encodeMetadata(this.options.metadata)\n if (metadata !== '') {\n req.setHeader('Upload-Metadata', metadata)\n }\n\n let promise\n if (this.options.uploadDataDuringCreation && !this.options.uploadLengthDeferred) {\n this._offset = 0\n promise = this._addChunkToRequest(req)\n } else {\n if (this.options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Complete', '?0')\n }\n promise = this._sendRequest(req, null)\n }\n\n promise\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while creating upload')\n return\n }\n\n const location = res.getHeader('Location')\n if (location == null) {\n this._emitHttpError(req, res, 'tus: invalid or missing Location header')\n return\n }\n\n this.url = resolveUrl(this.options.endpoint, location)\n log(`Created upload at ${this.url}`)\n\n if (typeof this.options.onUploadUrlAvailable === 'function') {\n this.options.onUploadUrlAvailable()\n }\n\n if (this._size === 0) {\n // Nothing to upload and file was successfully created\n this._emitSuccess(res)\n this._source.close()\n return\n }\n\n this._saveUploadInUrlStorage().then(() => {\n if (this.options.uploadDataDuringCreation) {\n this._handleUploadResponse(req, res)\n } else {\n this._offset = 0\n this._performUpload()\n }\n })\n })\n .catch((err) => {\n this._emitHttpError(req, null, 'tus: failed to create upload', err)\n })\n }\n\n /*\n * Try to resume an existing upload. First a HEAD request will be sent\n * to retrieve the offset. If the request fails a new upload will be\n * created. In the case of a successful response the file will be uploaded.\n *\n * @api private\n */\n _resumeUpload() {\n const req = this._openRequest('HEAD', this.url)\n const promise = this._sendRequest(req, null)\n\n promise\n .then((res) => {\n const status = res.getStatus()\n if (!inStatusCategory(status, 200)) {\n // If the upload is locked (indicated by the 423 Locked status code), we\n // emit an error instead of directly starting a new upload. This way the\n // retry logic can catch the error and will retry the upload. An upload\n // is usually locked for a short period of time and will be available\n // afterwards.\n if (status === 423) {\n this._emitHttpError(req, res, 'tus: upload is currently locked; retry later')\n return\n }\n\n if (inStatusCategory(status, 400)) {\n // Remove stored fingerprint and corresponding endpoint,\n // on client errors since the file can not be found\n this._removeFromUrlStorage()\n }\n\n if (!this.options.endpoint) {\n // Don't attempt to create a new upload if no endpoint is provided.\n this._emitHttpError(\n req,\n res,\n 'tus: unable to resume upload (new upload cannot be created without an endpoint)',\n )\n return\n }\n\n // Try to create a new upload\n this.url = null\n this._createUpload()\n return\n }\n\n const offset = Number.parseInt(res.getHeader('Upload-Offset'), 10)\n if (Number.isNaN(offset)) {\n this._emitHttpError(req, res, 'tus: invalid or missing offset value')\n return\n }\n\n const length = Number.parseInt(res.getHeader('Upload-Length'), 10)\n if (\n Number.isNaN(length) &&\n !this.options.uploadLengthDeferred &&\n this.options.protocol === PROTOCOL_TUS_V1\n ) {\n this._emitHttpError(req, res, 'tus: invalid or missing length value')\n return\n }\n\n if (typeof this.options.onUploadUrlAvailable === 'function') {\n this.options.onUploadUrlAvailable()\n }\n\n this._saveUploadInUrlStorage().then(() => {\n // Upload has already been completed and we do not need to send additional\n // data to the server\n if (offset === length) {\n this._emitProgress(length, length)\n this._emitSuccess(res)\n return\n }\n\n this._offset = offset\n this._performUpload()\n })\n })\n .catch((err) => {\n this._emitHttpError(req, null, 'tus: failed to resume upload', err)\n })\n }\n\n /**\n * Start uploading the file using PATCH requests. The file will be divided\n * into chunks as specified in the chunkSize option. During the upload\n * the onProgress event handler may be invoked multiple times.\n *\n * @api private\n */\n _performUpload() {\n // If the upload has been aborted, we will not send the next PATCH request.\n // This is important if the abort method was called during a callback, such\n // as onChunkComplete or onProgress.\n if (this._aborted) {\n return\n }\n\n let req\n\n // Some browser and servers may not support the PATCH method. For those\n // cases, you can tell tus-js-client to use a POST request with the\n // X-HTTP-Method-Override header for simulating a PATCH request.\n if (this.options.overridePatchMethod) {\n req = this._openRequest('POST', this.url)\n req.setHeader('X-HTTP-Method-Override', 'PATCH')\n } else {\n req = this._openRequest('PATCH', this.url)\n }\n\n req.setHeader('Upload-Offset', `${this._offset}`)\n const promise = this._addChunkToRequest(req)\n\n promise\n .then((res) => {\n if (!inStatusCategory(res.getStatus(), 200)) {\n this._emitHttpError(req, res, 'tus: unexpected response while uploading chunk')\n return\n }\n\n this._handleUploadResponse(req, res)\n })\n .catch((err) => {\n // Don't emit an error if the upload was aborted manually\n if (this._aborted) {\n return\n }\n\n this._emitHttpError(req, null, `tus: failed to upload chunk at offset ${this._offset}`, err)\n })\n }\n\n /**\n * _addChunktoRequest reads a chunk from the source and sends it using the\n * supplied request object. It will not handle the response.\n *\n * @api private\n */\n _addChunkToRequest(req) {\n const start = this._offset\n let end = this._offset + this.options.chunkSize\n\n req.setProgressHandler((bytesSent) => {\n this._emitProgress(start + bytesSent, this._size)\n })\n\n req.setHeader('Content-Type', 'application/offset+octet-stream')\n\n // The specified chunkSize may be Infinity or the calcluated end position\n // may exceed the file's size. In both cases, we limit the end position to\n // the input's total size for simpler calculations and correctness.\n if (\n (end === Number.POSITIVE_INFINITY || end > this._size) &&\n !this.options.uploadLengthDeferred\n ) {\n end = this._size\n }\n\n return this._source.slice(start, end).then(({ value, done }) => {\n const valueSize = value?.size ? value.size : 0\n\n // If the upload length is deferred, the upload size was not specified during\n // upload creation. So, if the file reader is done reading, we know the total\n // upload size and can tell the tus server.\n if (this.options.uploadLengthDeferred && done) {\n this._size = this._offset + valueSize\n req.setHeader('Upload-Length', `${this._size}`)\n }\n\n // The specified uploadSize might not match the actual amount of data that a source\n // provides. In these cases, we cannot successfully complete the upload, so we\n // rather error out and let the user know. If not, tus-js-client will be stuck\n // in a loop of repeating empty PATCH requests.\n // See https://community.transloadit.com/t/how-to-abort-hanging-companion-uploads/16488/13\n const newSize = this._offset + valueSize\n if (!this.options.uploadLengthDeferred && done && newSize !== this._size) {\n return Promise.reject(\n new Error(\n `upload was configured with a size of ${this._size} bytes, but the source is done after ${newSize} bytes`,\n ),\n )\n }\n\n if (value === null) {\n return this._sendRequest(req)\n }\n\n if (this.options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Complete', done ? '?1' : '?0')\n }\n this._emitProgress(this._offset, this._size)\n return this._sendRequest(req, value)\n })\n }\n\n /**\n * _handleUploadResponse is used by requests that haven been sent using _addChunkToRequest\n * and already have received a response.\n *\n * @api private\n */\n _handleUploadResponse(req, res) {\n const offset = Number.parseInt(res.getHeader('Upload-Offset'), 10)\n if (Number.isNaN(offset)) {\n this._emitHttpError(req, res, 'tus: invalid or missing offset value')\n return\n }\n\n this._emitProgress(offset, this._size)\n this._emitChunkComplete(offset - this._offset, offset, this._size)\n\n this._offset = offset\n\n if (offset === this._size) {\n // Yay, finally done :)\n this._emitSuccess(res)\n this._source.close()\n return\n }\n\n this._performUpload()\n }\n\n /**\n * Create a new HTTP request object with the given method and URL.\n *\n * @api private\n */\n _openRequest(method, url) {\n const req = openRequest(method, url, this.options)\n this._req = req\n return req\n }\n\n /**\n * Remove the entry in the URL storage, if it has been saved before.\n *\n * @api private\n */\n _removeFromUrlStorage() {\n if (!this._urlStorageKey) return\n\n this._urlStorage.removeUpload(this._urlStorageKey).catch((err) => {\n this._emitError(err)\n })\n this._urlStorageKey = null\n }\n\n /**\n * Add the upload URL to the URL storage, if possible.\n *\n * @api private\n */\n _saveUploadInUrlStorage() {\n // We do not store the upload URL\n // - if it was disabled in the option, or\n // - if no fingerprint was calculated for the input (i.e. a stream), or\n // - if the URL is already stored (i.e. key is set alread).\n if (\n !this.options.storeFingerprintForResuming ||\n !this._fingerprint ||\n this._urlStorageKey !== null\n ) {\n return Promise.resolve()\n }\n\n const storedUpload = {\n size: this._size,\n metadata: this.options.metadata,\n creationTime: new Date().toString(),\n }\n\n if (this._parallelUploads) {\n // Save multiple URLs if the parallelUploads option is used ...\n storedUpload.parallelUploadUrls = this._parallelUploadUrls\n } else {\n // ... otherwise we just save the one available URL.\n storedUpload.uploadUrl = this.url\n }\n\n return this._urlStorage.addUpload(this._fingerprint, storedUpload).then((urlStorageKey) => {\n this._urlStorageKey = urlStorageKey\n })\n }\n\n /**\n * Send a request with the provided body.\n *\n * @api private\n */\n _sendRequest(req, body = null) {\n return sendRequest(req, body, this.options)\n }\n}\n\nfunction encodeMetadata(metadata) {\n return Object.entries(metadata)\n .map(([key, value]) => `${key} ${Base64.encode(String(value))}`)\n .join(',')\n}\n\n/**\n * Checks whether a given status is in the range of the expected category.\n * For example, only a status between 200 and 299 will satisfy the category 200.\n *\n * @api private\n */\nfunction inStatusCategory(status, category) {\n return status >= category && status < category + 100\n}\n\n/**\n * Create a new HTTP request with the specified method and URL.\n * The necessary headers that are included in every request\n * will be added, including the request ID.\n *\n * @api private\n */\nfunction openRequest(method, url, options) {\n const req = options.httpStack.createRequest(method, url)\n\n if (options.protocol === PROTOCOL_IETF_DRAFT_03) {\n req.setHeader('Upload-Draft-Interop-Version', '5')\n } else {\n req.setHeader('Tus-Resumable', '1.0.0')\n }\n const headers = options.headers || {}\n\n for (const [name, value] of Object.entries(headers)) {\n req.setHeader(name, value)\n }\n\n if (options.addRequestId) {\n const requestId = uuid()\n req.setHeader('X-Request-ID', requestId)\n }\n\n return req\n}\n\n/**\n * Send a request with the provided body while invoking the onBeforeRequest\n * and onAfterResponse callbacks.\n *\n * @api private\n */\nasync function sendRequest(req, body, options) {\n if (typeof options.onBeforeRequest === 'function') {\n await options.onBeforeRequest(req)\n }\n\n const res = await req.send(body)\n\n if (typeof options.onAfterResponse === 'function') {\n await options.onAfterResponse(req, res)\n }\n\n return res\n}\n\n/**\n * Checks whether the browser running this code has internet access.\n * This function will always return true in the node.js environment\n *\n * @api private\n */\nfunction isOnline() {\n let online = true\n // Note: We don't reference `window` here because the navigator object also exists\n // in a Web Worker's context.\n if (typeof navigator !== 'undefined' && navigator.onLine === false) {\n online = false\n }\n\n return online\n}\n\n/**\n * Checks whether or not it is ok to retry a request.\n * @param {Error|DetailedError} err the error returned from the last request\n * @param {number} retryAttempt the number of times the request has already been retried\n * @param {object} options tus Upload options\n *\n * @api private\n */\nfunction shouldRetry(err, retryAttempt, options) {\n // We only attempt a retry if\n // - retryDelays option is set\n // - we didn't exceed the maxium number of retries, yet, and\n // - this error was caused by a request or it's response and\n // - the error is server error (i.e. not a status 4xx except a 409 or 423) or\n // a onShouldRetry is specified and returns true\n // - the browser does not indicate that we are offline\n if (\n options.retryDelays == null ||\n retryAttempt >= options.retryDelays.length ||\n err.originalRequest == null\n ) {\n return false\n }\n\n if (options && typeof options.onShouldRetry === 'function') {\n return options.onShouldRetry(err, retryAttempt, options)\n }\n\n return defaultOnShouldRetry(err)\n}\n\n/**\n * determines if the request should be retried. Will only retry if not a status 4xx except a 409 or 423\n * @param {DetailedError} err\n * @returns {boolean}\n */\nfunction defaultOnShouldRetry(err) {\n const status = err.originalResponse ? err.originalResponse.getStatus() : 0\n return (!inStatusCategory(status, 400) || status === 409 || status === 423) && isOnline()\n}\n\n/**\n * Resolve a relative link given the origin as source. For example,\n * if a HTTP request to http://example.com/files/ returns a Location\n * header with the value /upload/abc, the resolved URL will be:\n * http://example.com/upload/abc\n */\nfunction resolveUrl(origin, link) {\n return new URL(link, origin).toString()\n}\n\n/**\n * Calculate the start and end positions for the parts if an upload\n * is split into multiple parallel requests.\n *\n * @param {number} totalSize The byte size of the upload, which will be split.\n * @param {number} partCount The number in how many parts the upload will be split.\n * @return {object[]}\n * @api private\n */\nfunction splitSizeIntoParts(totalSize, partCount) {\n const partSize = Math.floor(totalSize / partCount)\n const parts = []\n\n for (let i = 0; i < partCount; i++) {\n parts.push({\n start: partSize * i,\n end: partSize * (i + 1),\n })\n }\n\n parts[partCount - 1].end = totalSize\n\n return parts\n}\n\nBaseUpload.defaultOptions = defaultOptions\n\nexport default BaseUpload\n","/**\n * Generate a UUID v4 based on random numbers. We intentioanlly use the less\n * secure Math.random function here since the more secure crypto.getRandomNumbers\n * is not available on all platforms.\n * This is not a problem for us since we use the UUID only for generating a\n * request ID, so we can correlate server logs to client errors.\n *\n * This function is taken from following site:\n * https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\n *\n * @return {string} The generate UUID\n */\nexport default function uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0\n const v = c === 'x' ? r : (r & 0x3) | 0x8\n return v.toString(16)\n })\n}\n","const isReactNative = () =>\n typeof navigator !== 'undefined' &&\n typeof navigator.product === 'string' &&\n navigator.product.toLowerCase() === 'reactnative'\n\nexport default isReactNative\n","import isCordova from './isCordova.js'\nimport readAsByteArray from './readAsByteArray.js'\n\nexport default class FileSource {\n // Make this.size a method\n constructor(file) {\n this._file = file\n this.size = file.size\n }\n\n slice(start, end) {\n // In Apache Cordova applications, a File must be resolved using\n // FileReader instances, see\n // https://cordova.apache.org/docs/en/8.x/reference/cordova-plugin-file/index.html#read-a-file\n if (isCordova()) {\n return readAsByteArray(this._file.slice(start, end))\n }\n\n const value = this._file.slice(start, end)\n const done = end >= this.size\n return Promise.resolve({ value, done })\n }\n\n close() {\n // Nothing to do here since we don't need to release any resources.\n }\n}\n","const isCordova = () =>\n typeof window !== 'undefined' &&\n (typeof window.PhoneGap !== 'undefined' ||\n typeof window.Cordova !== 'undefined' ||\n typeof window.cordova !== 'undefined')\n\nexport default isCordova\n","/**\n * readAsByteArray converts a File object to a Uint8Array.\n * This function is only used on the Apache Cordova platform.\n * See https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html#read-a-file\n */\nexport default function readAsByteArray(chunk) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader()\n reader.onload = () => {\n const value = new Uint8Array(reader.result)\n resolve({ value })\n }\n reader.onerror = (err) => {\n reject(err)\n }\n reader.readAsArrayBuffer(chunk)\n })\n}\n","function len(blobOrArray) {\n if (blobOrArray === undefined) return 0\n if (blobOrArray.size !== undefined) return blobOrArray.size\n return blobOrArray.length\n}\n\n/*\n Typed arrays and blobs don't have a concat method.\n This function helps StreamSource accumulate data to reach chunkSize.\n*/\nfunction concat(a, b) {\n if (a.concat) {\n // Is `a` an Array?\n return a.concat(b)\n }\n if (a instanceof Blob) {\n return new Blob([a, b], { type: a.type })\n }\n if (a.set) {\n // Is `a` a typed array?\n const c = new a.constructor(a.length + b.length)\n c.set(a)\n c.set(b, a.length)\n return c\n }\n throw new Error('Unknown data type')\n}\n\nexport default class StreamSource {\n constructor(reader) {\n this._buffer = undefined\n this._bufferOffset = 0\n this._reader = reader\n this._done = false\n }\n\n slice(start, end) {\n if (start < this._bufferOffset) {\n return Promise.reject(new Error(\"Requested data is before the reader's current offset\"))\n }\n\n return this._readUntilEnoughDataOrDone(start, end)\n }\n\n _readUntilEnoughDataOrDone(start, end) {\n const hasEnoughData = end <= this._bufferOffset + len(this._buffer)\n if (this._done || hasEnoughData) {\n const value = this._getDataFromBuffer(start, end)\n const done = value == null ? this._done : false\n return Promise.resolve({ value, done })\n }\n\n return this._reader.read().then(({ value, done }) => {\n if (done) {\n this._done = true\n } else if (this._buffer === undefined) {\n this._buffer = value\n } else {\n this._buffer = concat(this._buffer, value)\n }\n\n return this._readUntilEnoughDataOrDone(start, end)\n })\n }\n\n _getDataFromBuffer(start, end) {\n // Remove data from buffer before `start`.\n // Data might be reread from the buffer if an upload fails, so we can only\n // safely delete data when it comes *before* what is currently being read.\n if (start > this._bufferOffset) {\n this._buffer = this._buffer.slice(start - this._bufferOffset)\n this._bufferOffset = start\n }\n // If the buffer is empty after removing old data, all data has been read.\n const hasAllDataBeenRead = len(this._buffer) === 0\n if (this._done && hasAllDataBeenRead) {\n return null\n }\n // We already removed data before `start`, so we just return the first\n // chunk from the buffer.\n return this._buffer.slice(0, end - start)\n }\n\n close() {\n if (this._reader.cancel) {\n this._reader.cancel()\n }\n }\n}\n","export default class XHRHttpStack {\n createRequest(method, url) {\n return new Request(method, url)\n }\n\n getName() {\n return 'XHRHttpStack'\n }\n}\n\nclass Request {\n constructor(method, url) {\n this._xhr = new XMLHttpRequest()\n this._xhr.open(method, url, true)\n\n this._method = method\n this._url = url\n this._headers = {}\n }\n\n getMethod() {\n return this._method\n }\n\n getURL() {\n return this._url\n }\n\n setHeader(header, value) {\n this._xhr.setRequestHeader(header, value)\n this._headers[header] = value\n }\n\n getHeader(header) {\n return this._headers[header]\n }\n\n setProgressHandler(progressHandler) {\n // Test support for progress events before attaching an event listener\n if (!('upload' in this._xhr)) {\n return\n }\n\n this._xhr.upload.onprogress = (e) => {\n if (!e.lengthComputable) {\n return\n }\n\n progressHandler(e.loaded)\n }\n }\n\n send(body = null) {\n return new Promise((resolve, reject) => {\n this._xhr.onload = () => {\n resolve(new Response(this._xhr))\n }\n\n this._xhr.onerror = (err) => {\n reject(err)\n }\n\n this._xhr.send(body)\n })\n }\n\n abort() {\n this._xhr.abort()\n return Promise.resolve()\n }\n\n getUnderlyingObject() {\n return this._xhr\n }\n}\n\nclass Response {\n constructor(xhr) {\n this._xhr = xhr\n }\n\n getStatus() {\n return this._xhr.status\n }\n\n getHeader(header) {\n return this._xhr.getResponseHeader(header)\n }\n\n getBody() {\n return this._xhr.responseText\n }\n\n getUnderlyingObject() {\n return this._xhr\n }\n}\n","let hasStorage = false\ntry {\n // Note: localStorage does not exist in the Web Worker's context, so we must use window here.\n hasStorage = 'localStorage' in window\n\n // Attempt to store and read entries from the local storage to detect Private\n // Mode on Safari on iOS (see #49)\n // If the key was not used before, we remove it from local storage again to\n // not cause confusion where the entry came from.\n const key = 'tusSupport'\n const originalValue = localStorage.getItem(key)\n localStorage.setItem(key, originalValue)\n if (originalValue === null) localStorage.removeItem(key)\n} catch (e) {\n // If we try to access localStorage inside a sandboxed iframe, a SecurityError\n // is thrown. When in private mode on iOS Safari, a QuotaExceededError is\n // thrown (see #49)\n if (e.code === e.SECURITY_ERR || e.code === e.QUOTA_EXCEEDED_ERR) {\n hasStorage = false\n } else {\n throw e\n }\n}\n\nexport const canStoreURLs = hasStorage\n\nexport class WebStorageUrlStorage {\n findAllUploads() {\n const results = this._findEntries('tus::')\n return Promise.resolve(results)\n }\n\n findUploadsByFingerprint(fingerprint) {\n const results = this._findEntries(`tus::${fingerprint}::`)\n return Promise.resolve(results)\n }\n\n removeUpload(urlStorageKey) {\n localStorage.removeItem(urlStorageKey)\n return Promise.resolve()\n }\n\n addUpload(fingerprint, upload) {\n const id = Math.round(Math.random() * 1e12)\n const key = `tus::${fingerprint}::${id}`\n\n localStorage.setItem(key, JSON.stringify(upload))\n return Promise.resolve(key)\n }\n\n _findEntries(prefix) {\n const results = []\n\n for (let i = 0; i < localStorage.length; i++) {\n const key = localStorage.key(i)\n if (key.indexOf(prefix) !== 0) continue\n\n try {\n const upload = JSON.parse(localStorage.getItem(key))\n upload.urlStorageKey = key\n\n results.push(upload)\n } catch (_e) {\n // The JSON parse error is intentionally ignored here, so a malformed\n // entry in the storage cannot prevent an upload.\n }\n }\n\n return results\n }\n}\n","import DetailedError from '../error.js'\nimport { enableDebugLog } from '../logger.js'\nimport NoopUrlStorage from '../noopUrlStorage.js'\nimport BaseUpload from '../upload.js'\n\nimport FileReader from './fileReader.js'\nimport fingerprint from './fileSignature.js'\nimport DefaultHttpStack from './httpStack.js'\nimport { WebStorageUrlStorage, canStoreURLs } from './urlStorage.js'\n\nconst defaultOptions = {\n ...BaseUpload.defaultOptions,\n httpStack: new DefaultHttpStack(),\n fileReader: new FileReader(),\n urlStorage: canStoreURLs ? new WebStorageUrlStorage() : new NoopUrlStorage(),\n fingerprint,\n}\n\nclass Upload extends BaseUpload {\n constructor(file = null, options = {}) {\n options = { ...defaultOptions, ...options }\n super(file, options)\n }\n\n static terminate(url, options = {}) {\n options = { ...defaultOptions, ...options }\n return BaseUpload.terminate(url, options)\n }\n}\n\n// Note: We don't reference `window` here because these classes also exist in a Web Worker's context.\nconst isSupported =\n typeof XMLHttpRequest === 'function' &&\n typeof Blob === 'function' &&\n typeof Blob.prototype.slice === 'function'\n\nexport {\n Upload,\n canStoreURLs,\n defaultOptions,\n isSupported,\n enableDebugLog,\n DefaultHttpStack,\n DetailedError,\n}\n","import isReactNative from './isReactNative.js'\nimport uriToBlob from './uriToBlob.js'\n\nimport FileSource from './sources/FileSource.js'\nimport StreamSource from './sources/StreamSource.js'\n\nexport default class FileReader {\n async openFile(input, chunkSize) {\n // In React Native, when user selects a file, instead of a File or Blob,\n // you usually get a file object {} with a uri property that contains\n // a local path to the file. We use XMLHttpRequest to fetch\n // the file blob, before uploading with tus.\n if (isReactNative() && input && typeof input.uri !== 'undefined') {\n try {\n const blob = await uriToBlob(input.uri)\n return new FileSource(blob)\n } catch (err) {\n throw new Error(\n `tus: cannot fetch \\`file.uri\\` as Blob, make sure the uri is correct and accessible. ${err}`,\n )\n }\n }\n\n // Since we emulate the Blob type in our tests (not all target browsers\n // support it), we cannot use `instanceof` for testing whether the input value\n // can be handled. Instead, we simply check is the slice() function and the\n // size property are available.\n if (typeof input.slice === 'function' && typeof input.size !== 'undefined') {\n return Promise.resolve(new FileSource(input))\n }\n\n if (typeof input.read === 'function') {\n chunkSize = Number(chunkSize)\n if (!Number.isFinite(chunkSize)) {\n return Promise.reject(\n new Error(\n 'cannot create source for stream without a finite value for the `chunkSize` option',\n ),\n )\n }\n\n return Promise.resolve(new StreamSource(input, chunkSize))\n }\n\n return Promise.reject(\n new Error(\n 'source object may only be an instance of File, Blob, or Reader in this environment',\n ),\n )\n }\n}\n","/**\n * uriToBlob resolves a URI to a Blob object. This is used for\n * React Native to retrieve a file (identified by a file://\n * URI) as a blob.\n */\nexport default function uriToBlob(uri) {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest()\n xhr.responseType = 'blob'\n xhr.onload = () => {\n const blob = xhr.response\n resolve(blob)\n }\n xhr.onerror = (err) => {\n reject(err)\n }\n xhr.open('GET', uri)\n xhr.send()\n })\n}\n","export default class NoopUrlStorage {\n listAllUploads() {\n return Promise.resolve([])\n }\n\n findUploadsByFingerprint(_fingerprint) {\n return Promise.resolve([])\n }\n\n removeUpload(_urlStorageKey) {\n return Promise.resolve()\n }\n\n addUpload(_fingerprint, _upload) {\n return Promise.resolve(null)\n }\n}\n","import isReactNative from './isReactNative.js'\n\n// TODO: Differenciate between input types\n\n/**\n * Generate a fingerprint for a file which will be used the store the endpoint\n *\n * @param {File} file\n * @param {Object} options\n * @param {Function} callback\n */\nexport default function fingerprint(file, options) {\n if (isReactNative()) {\n return Promise.resolve(reactNativeFingerprint(file, options))\n }\n\n return Promise.resolve(\n ['tus-br', file.name, file.type, file.size, file.lastModified, options.endpoint].join('-'),\n )\n}\n\nfunction reactNativeFingerprint(file, options) {\n const exifHash = file.exif ? hashCode(JSON.stringify(file.exif)) : 'noexif'\n return ['tus-rn', file.name || 'noname', file.size || 'nosize', exifHash, options.endpoint].join(\n '/',\n )\n}\n\nfunction hashCode(str) {\n // from https://stackoverflow.com/a/8831937/151666\n let hash = 0\n if (str.length === 0) {\n return hash\n }\n for (let i = 0; i < str.length; i++) {\n const char = str.charCodeAt(i)\n hash = (hash << 5) - hash + char\n hash &= hash // Convert to 32bit integer\n }\n return hash\n}\n","export const deleteUpload = async (\n url: string,\n csrfToken: string\n): Promise =>\n new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(\"DELETE\", url);\n\n xhr.onload = (): void => {\n if (xhr.status === 204) {\n resolve();\n } else {\n reject(new Error());\n }\n };\n xhr.setRequestHeader(\"Tus-Resumable\", \"1.0.0\");\n xhr.setRequestHeader(\"X-CSRFToken\", csrfToken);\n xhr.send(null);\n });\n","import { HttpRequest, HttpResponse, Upload } from \"tus-js-client\";\n\nimport BaseUpload, { InitialFile } from \"./base_upload.ts\";\nimport { deleteUpload } from \"./tus_utils.ts\";\n\ninterface Parameters {\n chunkSize: number;\n csrfToken: string;\n fieldName: string;\n file: File;\n formId: string;\n retryDelays: null | number[];\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport default class TusUpload extends BaseUpload {\n private addCsrTokenToRequest = (request: HttpRequest) => {\n request.setHeader(\"X-CSRFToken\", this.csrfToken);\n };\n private csrfToken: string;\n private handleAfterReponse = (\n _request: HttpRequest,\n response: HttpResponse\n ) => {\n const resourceId = response.getHeader(\"ResourceId\");\n\n if (resourceId) {\n this.id = resourceId;\n }\n };\n private handleError = (error: Error) => {\n if (this.onError) {\n this.onError(error);\n } else {\n throw error;\n }\n };\n private handleProgress = (bytesUploaded: number, bytesTotal: number) => {\n if (this.onProgress) {\n this.onProgress(bytesUploaded, bytesTotal);\n }\n };\n private handleSucces = () => {\n if (this.onSuccess) {\n this.onSuccess();\n }\n };\n\n private id: string;\n\n private upload: Upload;\n\n public onError?: (error: Error) => void;\n\n public onProgress?: (bytesUploaded: number, bytesTotal: number) => void;\n\n public onSuccess?: () => void;\n\n constructor({\n chunkSize,\n csrfToken,\n fieldName,\n file,\n formId,\n retryDelays,\n uploadIndex,\n uploadUrl\n }: Parameters) {\n super({ name: file.name, status: \"uploading\", type: \"tus\", uploadIndex });\n\n this.csrfToken = csrfToken;\n\n this.upload = new Upload(file, {\n chunkSize,\n endpoint: uploadUrl,\n metadata: {\n fieldName: fieldName,\n filename: file.name,\n formId: formId\n },\n onAfterResponse: this.handleAfterReponse,\n onBeforeRequest: this.addCsrTokenToRequest,\n onError: this.handleError,\n onProgress: this.handleProgress,\n onSuccess: this.handleSucces,\n retryDelays: retryDelays ?? [0, 1000, 3000, 5000]\n });\n\n this.onError = undefined;\n this.onProgress = undefined;\n this.onSuccess = undefined;\n }\n\n public async abort(): Promise {\n await this.upload.abort(true);\n }\n\n public async delete(): Promise {\n if (!this.upload.url) {\n return Promise.resolve();\n }\n\n await deleteUpload(this.upload.url, this.csrfToken);\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n getInitialFile(): InitialFile {\n return {\n id: this.id,\n name: this.name,\n size: this.getSize(),\n type: \"tus\",\n url: \"\"\n };\n }\n\n public getSize(): number {\n return (this.upload.file as File).size;\n }\n\n public start(): void {\n this.upload.start();\n }\n}\n","import BaseUpload, {\n InitialExistingFile,\n InitialFile,\n InitialPlaceholderFile,\n InitialS3File,\n InitialTusFile,\n UploadType\n} from \"./base_upload.ts\";\nimport { deleteUpload } from \"./tus_utils.ts\";\n\ninterface BaseUploadedFileParameters {\n name: string;\n size: number;\n type: UploadType;\n uploadIndex: number;\n}\n\nexport abstract class BaseUploadedFile extends BaseUpload {\n size: number;\n\n constructor({ name, size, type, uploadIndex }: BaseUploadedFileParameters) {\n super({ name, status: \"done\", type, uploadIndex });\n\n this.size = size;\n }\n\n public async abort(): Promise {\n return Promise.resolve();\n }\n\n public async delete(): Promise {\n return Promise.resolve();\n }\n\n public getSize(): number | undefined {\n return this.size;\n }\n}\n\nclass PlaceholderFile extends BaseUploadedFile {\n id: string;\n\n constructor(initialFile: InitialPlaceholderFile, uploadIndex: number) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"placeholder\",\n uploadIndex\n });\n\n this.id = initialFile.id;\n }\n\n public getId(): string | undefined {\n return undefined;\n }\n\n public getInitialFile(): InitialPlaceholderFile {\n return {\n id: this.id,\n name: this.name,\n size: this.size,\n type: \"placeholder\"\n };\n }\n}\n\nexport class UploadedS3File extends BaseUploadedFile {\n id: string;\n key: string;\n\n constructor(initialFile: InitialS3File, uploadIndex: number) {\n super({\n name: initialFile.original_name || initialFile.name,\n size: initialFile.size,\n type: \"uploadedS3\",\n uploadIndex\n });\n\n this.id = initialFile.id;\n this.key = initialFile.name;\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n getInitialFile(): InitialS3File {\n return {\n id: this.id,\n name: this.key,\n original_name: this.name,\n size: this.size,\n type: \"s3\"\n };\n }\n}\n\nexport class ExistingFile extends BaseUploadedFile {\n constructor(initialFile: InitialExistingFile, uploadIndex: number) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"existing\",\n uploadIndex\n });\n }\n\n public getId(): string | undefined {\n return undefined;\n }\n\n public getInitialFile(): InitialExistingFile {\n return {\n name: this.name,\n size: this.size,\n type: \"existing\"\n };\n }\n}\n\ninterface UploadedTusFileParameters {\n csrfToken: string;\n initialFile: InitialTusFile;\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport class UploadedTusFile extends BaseUploadedFile {\n csrfToken: string;\n id: string;\n url: string;\n\n constructor({\n csrfToken,\n initialFile,\n uploadIndex,\n uploadUrl\n }: UploadedTusFileParameters) {\n super({\n name: initialFile.name,\n size: initialFile.size,\n type: \"uploadedTus\",\n uploadIndex\n });\n\n this.csrfToken = csrfToken;\n this.id = initialFile.id;\n this.url = `${uploadUrl}${initialFile.id}`;\n }\n\n public async delete(): Promise {\n await deleteUpload(this.url, this.csrfToken);\n }\n\n public getId(): string | undefined {\n return this.id;\n }\n\n getInitialFile(): InitialTusFile {\n return {\n id: this.id,\n name: this.name,\n size: this.size,\n type: \"tus\",\n url: \"\"\n };\n }\n}\n\ninterface UploadedFileParameters {\n csrfToken: string;\n initialFile: InitialFile;\n uploadIndex: number;\n uploadUrl: string;\n}\n\nexport const createUploadedFile = ({\n csrfToken,\n initialFile,\n uploadIndex,\n uploadUrl\n}: UploadedFileParameters): BaseUploadedFile => {\n switch (initialFile.type) {\n case \"existing\":\n return new ExistingFile(initialFile, uploadIndex);\n\n case \"placeholder\":\n return new PlaceholderFile(initialFile, uploadIndex);\n\n case \"s3\":\n return new UploadedS3File(initialFile, uploadIndex);\n\n case \"tus\":\n return new UploadedTusFile({\n csrfToken,\n initialFile,\n uploadIndex,\n uploadUrl\n });\n }\n};\n","import { EventEmitter } from \"eventemitter3\";\n\nimport AcceptedFileTypes from \"./accepted_file_types.ts\";\nimport DropArea from \"./drop_area.ts\";\nimport RenderUploadFile from \"./render_upload_file.ts\";\nimport BaseUpload, { InitialFile, UploadType } from \"./uploads/base_upload.ts\";\nimport S3Upload from \"./uploads/s3_upload.ts\";\nimport TusUpload from \"./uploads/tus_upload.ts\";\nimport { createUploadedFile } from \"./uploads/uploaded_file.ts\";\nimport {\n findInput,\n getMetadataFieldName,\n getUploadsFieldName\n} from \"./util.ts\";\n\nexport type Translations = Record;\n\ninterface ClickEvent {\n fieldName: string;\n fileName: string;\n id?: string;\n type: UploadType;\n}\n\nexport interface Callbacks {\n onClick?: ({ fieldName, fileName, type }: ClickEvent) => void;\n onDelete?: (upload: BaseUpload) => void;\n onError?: (error: unknown, upload: BaseUpload) => void;\n onProgress?: (\n bytesUploaded: number,\n bytesTotal: number,\n upload: BaseUpload\n ) => void;\n onSuccess?: (upload: BaseUpload) => void;\n}\n\ninterface ConstructorParams {\n callbacks: Callbacks;\n chunkSize: number;\n csrfToken: string;\n eventEmitter?: EventEmitter;\n fieldName: string;\n form: Element;\n formId: string;\n initial: InitialFile[];\n input: HTMLInputElement;\n multiple: boolean;\n parent: Element;\n prefix: null | string;\n retryDelays: null | number[];\n s3UploadDir: null | string;\n skipRequired: boolean;\n supportDropArea: boolean;\n translations: Translations;\n uploadUrl: string;\n}\n\nclass FileField {\n acceptedFileTypes: AcceptedFileTypes;\n callbacks: Callbacks;\n chunkSize: number;\n csrfToken: string;\n eventEmitter?: EventEmitter;\n fieldName: string;\n form: Element;\n formId: string;\n handleClick = (e: Event): void => {\n const target = e.target as HTMLElement;\n\n const getUpload = (): BaseUpload | undefined => {\n const dataIndex = target.getAttribute(\"data-index\");\n\n if (!dataIndex) {\n return undefined;\n }\n\n const uploadIndex = parseInt(dataIndex, 10);\n return this.getUploadByIndex(uploadIndex);\n };\n\n if (\n target.classList.contains(\"dff-delete\") &&\n !target.classList.contains(\"dff-disabled\")\n ) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload) {\n void this.removeExistingUpload(upload);\n }\n } else if (target.classList.contains(\"dff-cancel\")) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload) {\n void this.handleCancel(upload);\n }\n } else if (target.classList.contains(\"dff-filename\")) {\n e.preventDefault();\n\n const upload = getUpload();\n\n if (upload?.status === \"done\" && this.callbacks.onClick) {\n this.callbacks.onClick({\n fieldName: this.fieldName,\n fileName: upload.name,\n id: upload.getId(),\n type: upload.type\n });\n }\n }\n };\n handleError = (upload: BaseUpload, error: unknown): void => {\n this.renderer.setError(upload.uploadIndex);\n upload.status = \"error\";\n\n const { onError } = this.callbacks;\n\n if (onError) {\n if (upload instanceof TusUpload) {\n onError(error, upload);\n }\n }\n };\n handleInvalidFiles = (files: File[]): void => {\n this.renderer.setErrorInvalidFiles(files);\n };\n handleProgress = (\n upload: BaseUpload,\n bytesUploaded: number,\n bytesTotal: number\n ): void => {\n const percentage = ((bytesUploaded / bytesTotal) * 100).toFixed(2);\n\n this.renderer.updateProgress(upload.uploadIndex, percentage);\n\n const { onProgress } = this.callbacks;\n\n if (onProgress) {\n if (upload instanceof TusUpload) {\n onProgress(bytesUploaded, bytesTotal, upload);\n }\n }\n };\n handleSuccess = (upload: BaseUpload): void => {\n const { renderer } = this;\n\n this.updatePlaceholderInput();\n\n renderer.clearInput();\n renderer.setSuccess(upload.uploadIndex, upload.getSize());\n upload.status = \"done\";\n\n const { onSuccess } = this.callbacks;\n\n const element = this.renderer.findFileDiv(upload.uploadIndex);\n\n if (element) {\n this.emitEvent(\"uploadComplete\", element, upload);\n }\n\n if (onSuccess && upload.type === \"tus\") {\n onSuccess(upload);\n }\n };\n multiple: boolean;\n nextUploadIndex: number;\n onChange = (e: Event): void => {\n const files = (e.target as HTMLInputElement).files ?? ([] as File[]);\n const acceptedFiles: File[] = [];\n const invalidFiles: File[] = [];\n\n for (const file of files) {\n if (this.acceptedFileTypes.isAccepted(file.name)) {\n acceptedFiles.push(file);\n } else {\n invalidFiles.push(file);\n }\n }\n\n this.handleInvalidFiles([...invalidFiles]);\n void this.uploadFiles([...acceptedFiles]);\n\n this.renderer.clearInput();\n };\n prefix: null | string;\n\n renderer: RenderUploadFile;\n\n retryDelays: null | number[];\n\n s3UploadDir: null | string;\n\n supportDropArea: boolean;\n\n uploadFiles = async (files: File[]): Promise => {\n if (files.length === 0) {\n return;\n }\n\n if (!this.multiple) {\n for (const upload of this.uploads) {\n this.renderer.deleteFile(upload.uploadIndex);\n }\n\n this.uploads = [];\n const file = files[0];\n\n if (file) {\n await this.uploadFile(file);\n }\n } else {\n for (const file of files) {\n await this.uploadFile(file);\n }\n }\n\n this.checkDropHint();\n };\n\n uploads: BaseUpload[];\n\n uploadUrl: string;\n\n constructor({\n callbacks,\n chunkSize,\n csrfToken,\n eventEmitter,\n fieldName,\n form,\n formId,\n initial,\n input,\n multiple,\n parent,\n prefix,\n retryDelays,\n s3UploadDir,\n skipRequired,\n supportDropArea,\n translations,\n uploadUrl\n }: ConstructorParams) {\n this.callbacks = callbacks;\n this.chunkSize = chunkSize;\n this.csrfToken = csrfToken;\n this.eventEmitter = eventEmitter;\n this.fieldName = fieldName;\n this.form = form;\n this.formId = formId;\n this.multiple = multiple;\n this.prefix = prefix;\n this.retryDelays = retryDelays;\n this.s3UploadDir = s3UploadDir;\n this.supportDropArea = supportDropArea && !input.disabled;\n this.uploadUrl = uploadUrl;\n this.acceptedFileTypes = new AcceptedFileTypes(input.accept);\n\n this.uploads = [];\n this.nextUploadIndex = 0;\n\n this.renderer = new RenderUploadFile({\n input,\n parent,\n skipRequired,\n translations\n });\n const filesContainer = this.renderer.container;\n\n if (supportDropArea) {\n this.initDropArea(filesContainer, input.accept);\n }\n\n this.addInitialFiles(initial);\n\n this.checkDropHint();\n\n input.addEventListener(\"change\", this.onChange);\n filesContainer.addEventListener(\"click\", this.handleClick);\n }\n\n addInitialFiles(initialFiles: InitialFile[]): void {\n if (initialFiles.length === 0) {\n return;\n }\n\n const { multiple, renderer } = this;\n\n const addInitialFile = (initialFile: InitialFile): void => {\n const { size } = initialFile;\n const name =\n initialFile.type === \"s3\" && initialFile.original_name\n ? initialFile.original_name\n : initialFile.name;\n\n const element = renderer.addUploadedFile(\n name,\n this.nextUploadIndex,\n size\n );\n\n const upload = createUploadedFile({\n csrfToken: this.csrfToken,\n initialFile,\n uploadIndex: this.nextUploadIndex,\n uploadUrl: this.uploadUrl\n });\n this.uploads.push(upload);\n\n this.emitEvent(\"addUpload\", element, upload);\n };\n\n if (multiple) {\n initialFiles.forEach((file: InitialFile): void => {\n addInitialFile(file);\n this.nextUploadIndex += 1;\n });\n } else {\n const initialFile = initialFiles[0];\n\n if (initialFile) {\n addInitialFile(initialFile);\n }\n }\n }\n\n checkDropHint(): void {\n if (!this.supportDropArea) {\n return;\n }\n\n const nonEmptyUploads = this.uploads.filter(e => Boolean(e));\n\n if (nonEmptyUploads.length === 0) {\n this.renderer.renderDropHint();\n } else {\n this.renderer.removeDropHint();\n }\n }\n\n emitEvent(eventName: string, element: HTMLElement, upload: BaseUpload): void {\n if (this.eventEmitter) {\n this.eventEmitter.emit(eventName, {\n element,\n fieldName: this.fieldName,\n fileName: upload.name,\n metaDataField: this.getMetaDataField(),\n upload\n });\n }\n }\n\n findUploadByName(fileName: string): BaseUpload | undefined {\n return this.uploads.find(upload => upload.name === fileName);\n }\n\n getMetaDataField(): HTMLElement | null {\n return findInput(\n this.form,\n getMetadataFieldName(this.fieldName, this.prefix),\n this.prefix\n );\n }\n\n getUploadByIndex(uploadIndex: number): BaseUpload | undefined {\n return this.uploads.find(upload => upload.uploadIndex === uploadIndex);\n }\n\n async handleCancel(upload: BaseUpload): Promise {\n this.renderer.disableCancel(upload.uploadIndex);\n await upload.abort();\n this.removeUploadFromList(upload);\n }\n\n initDropArea(container: Element, inputAccept: string): void {\n new DropArea({\n container,\n inputAccept,\n onUploadFiles: this.uploadFiles,\n renderer: this.renderer\n });\n }\n\n async removeExistingUpload(upload: BaseUpload): Promise {\n const element = this.renderer.findFileDiv(upload.uploadIndex);\n\n if (element) {\n this.emitEvent(\"removeUpload\", element, upload);\n }\n\n if (upload.status === \"uploading\") {\n this.renderer.disableCancel(upload.uploadIndex);\n await upload.abort();\n } else if (upload.status === \"done\") {\n this.renderer.disableDelete(upload.uploadIndex);\n\n try {\n await upload.delete();\n } catch {\n this.renderer.setDeleteFailed(upload.uploadIndex);\n return;\n }\n }\n\n this.removeUploadFromList(upload);\n this.updatePlaceholderInput();\n }\n\n removeUploadFromList(upload: BaseUpload): void {\n this.renderer.deleteFile(upload.uploadIndex);\n\n const index = this.uploads.indexOf(upload);\n\n if (index >= 0) {\n this.uploads.splice(index, 1);\n }\n\n this.checkDropHint();\n\n const { onDelete } = this.callbacks;\n\n if (onDelete) {\n onDelete(upload);\n }\n }\n\n updatePlaceholderInput(): void {\n const input = findInput(\n this.form,\n getUploadsFieldName(this.fieldName, this.prefix),\n this.prefix\n );\n if (!input) {\n return;\n }\n\n const placeholdersInfo: InitialFile[] = this.uploads.map(upload =>\n upload.getInitialFile()\n );\n\n input.value = JSON.stringify(placeholdersInfo);\n }\n\n async uploadFile(file: File): Promise {\n const createUpload = (): S3Upload | TusUpload => {\n const { csrfToken, s3UploadDir } = this;\n\n if (s3UploadDir != null) {\n return new S3Upload({\n csrfToken,\n endpoint: uploadUrl,\n file,\n s3UploadDir,\n uploadIndex: newUploadIndex\n });\n } else {\n return new TusUpload({\n chunkSize: this.chunkSize,\n csrfToken: this.csrfToken,\n fieldName,\n file,\n formId,\n retryDelays: this.retryDelays,\n uploadIndex: newUploadIndex,\n uploadUrl\n });\n }\n };\n\n const { fieldName, formId, renderer, uploadUrl } = this;\n const fileName = file.name;\n const existingUpload = this.findUploadByName(fileName);\n const newUploadIndex = existingUpload\n ? existingUpload.uploadIndex\n : this.nextUploadIndex;\n\n if (!existingUpload) {\n this.nextUploadIndex += 1;\n }\n\n if (existingUpload) {\n await this.removeExistingUpload(existingUpload);\n }\n\n const upload = createUpload();\n\n upload.onError = (error: unknown) => {\n this.handleError(upload, error);\n };\n upload.onProgress = (bytesUploaded, bytesTotal) => {\n this.handleProgress(upload, bytesUploaded, bytesTotal);\n };\n upload.onSuccess = () => {\n this.handleSuccess(upload);\n };\n upload.start();\n\n this.uploads.push(upload);\n\n const element = renderer.addNewUpload(fileName, newUploadIndex);\n this.emitEvent(\"addUpload\", element, upload);\n }\n}\n\nexport default FileField;\n","import { EventEmitter } from \"eventemitter3\";\n\nimport FileField, { Callbacks, Translations } from \"./file_field.ts\";\nimport { InitialFile } from \"./uploads/base_upload.ts\";\nimport {\n findInput,\n getInputValueForFormAndPrefix,\n getUploadsFieldName\n} from \"./util.ts\";\n\nexport interface Options {\n callbacks?: Callbacks;\n chunkSize?: number;\n eventEmitter?: EventEmitter;\n prefix?: string;\n retryDelays?: number[];\n skipRequired?: boolean;\n supportDropArea?: boolean;\n}\n\nconst initUploadFields = (form: Element, options: Options = {}): void => {\n const matchesPrefix = (fieldName: string): boolean => {\n if (!options.prefix) {\n return true;\n }\n\n return fieldName.startsWith(`${options.prefix}-`);\n };\n\n const getPrefix = (): null | string =>\n options.prefix ? options.prefix : null;\n\n const getInputValue = (fieldName: string): string | undefined =>\n getInputValueForFormAndPrefix(form, fieldName, getPrefix());\n\n const getInitialFiles = (fieldName: string): InitialFile[] => {\n const data = getInputValue(getUploadsFieldName(fieldName, getPrefix()));\n\n if (!data) {\n return [];\n }\n\n return (JSON.parse(data) as Record[]).filter(\n file => file.type\n ) as unknown as InitialFile[];\n };\n\n const uploadUrl = getInputValue(\"upload_url\");\n const formId = getInputValue(\"form_id\");\n const s3UploadDir = getInputValue(\"s3_upload_dir\");\n const skipRequired = options.skipRequired ?? false;\n const prefix = getPrefix();\n const csrfToken = findInput(form, \"csrfmiddlewaretoken\", null)?.value;\n\n if (!csrfToken) {\n throw Error(\"Csrf token not found\");\n }\n\n if (!formId || !uploadUrl) {\n return;\n }\n\n form.querySelectorAll(\".dff-uploader\").forEach(uploaderDiv => {\n const container = uploaderDiv.querySelector(\".dff-container\");\n\n if (!container) {\n return;\n }\n\n const input = container.querySelector(\"input[type=file]\");\n\n if (!(input && matchesPrefix(input.name))) {\n return;\n }\n\n const fieldName = input.name;\n const { multiple } = input;\n const initial = getInitialFiles(fieldName);\n const dataTranslations = container.getAttribute(\"data-translations\");\n const translations: Translations = dataTranslations\n ? (JSON.parse(dataTranslations) as Translations)\n : {};\n const supportDropArea = !(options.supportDropArea === false);\n\n new FileField({\n callbacks: options.callbacks ?? {},\n chunkSize: options.chunkSize ?? 2621440,\n csrfToken,\n eventEmitter: options.eventEmitter,\n fieldName,\n form,\n formId,\n initial,\n input,\n multiple,\n parent: container,\n prefix,\n retryDelays: options.retryDelays ?? null,\n s3UploadDir: s3UploadDir ?? null,\n skipRequired,\n supportDropArea,\n translations,\n uploadUrl\n });\n });\n};\n\nexport default initUploadFields;\n","import autoInitFileForms from \"./auto_init_file_forms.ts\";\nimport initFormSet from \"./init_form_set.ts\";\nimport initUploadFields from \"./init_upload_fields.ts\";\n\ndeclare const window: any; // eslint-disable-line @typescript-eslint/no-explicit-any\n\nwindow.autoInitFileForms = autoInitFileForms; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\nwindow.initFormSet = initFormSet; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\nwindow.initUploadFields = initUploadFields; // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n","import initUploadFields, { Options } from \"./init_upload_fields.ts\";\nimport {\n getInputNameWithPrefix,\n getInputValueForFormAndPrefix\n} from \"./util.ts\";\n\nconst initFormSet = (form: Element, optionsParam: Options | string): void => {\n let options: Options;\n\n if (typeof optionsParam === \"string\") {\n options = { prefix: optionsParam };\n } else {\n options = optionsParam;\n }\n\n const prefix = options.prefix ?? \"form\";\n\n const totalFormsValue = getInputValueForFormAndPrefix(\n form,\n \"TOTAL_FORMS\",\n prefix\n );\n\n if (!totalFormsValue) {\n return;\n }\n\n const formCount = parseInt(totalFormsValue, 10);\n\n for (let i = 0; i < formCount; i += 1) {\n const subFormPrefix = getInputNameWithPrefix(i.toString(), null);\n initUploadFields(form, {\n ...options,\n prefix: `${prefix}-${subFormPrefix}`\n });\n }\n};\n\nexport default initFormSet;\n"],"names":["findForm","element","parent","parentElement","tagName","types","Object","freeze","_Mime_extensionToType","_Mime_typeToExtension","_Mime_typeToExtensions","__classPrivateFieldGet","this","receiver","state","kind","f","TypeError","has","call","value","get","WeakMap","mime","constructor","args","set","Map","arg","define","typeMap","force","type","extensions","entries","toLowerCase","map","ext","Set","allExtensions","first","extension","starred","startsWith","slice","add","currentType","Error","getType","path","last","replace","hasPath","length","getExtension","split","trim","getAllExtensions","_freeze","values","_getTestState","standardTypes","WIN_SLASH","WIN_NO_SLASH","DOT_LITERAL","SLASH_LITERAL","QMARK","END_ANCHOR","START_ANCHOR","DOTS_SLASH","POSIX_CHARS","PLUS_LITERAL","QMARK_LITERAL","ONE_CHAR","NO_DOT","NO_DOTS","NO_DOT_SLASH","NO_DOTS_SLASH","QMARK_NO_DOT","STAR","SEP","WINDOWS_CHARS","constants","MAX_LENGTH","POSIX_REGEX_SOURCE","alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit","REGEX_BACKSLASH","REGEX_NON_SPECIAL_CHARS","REGEX_SPECIAL_CHARS","REGEX_SPECIAL_CHARS_BACKREF","REGEX_SPECIAL_CHARS_GLOBAL","REGEX_REMOVE_BACKSLASH","REPLACEMENTS","CHAR_0","CHAR_9","CHAR_UPPERCASE_A","CHAR_LOWERCASE_A","CHAR_UPPERCASE_Z","CHAR_LOWERCASE_Z","CHAR_LEFT_PARENTHESES","CHAR_RIGHT_PARENTHESES","CHAR_ASTERISK","CHAR_AMPERSAND","CHAR_AT","CHAR_BACKWARD_SLASH","CHAR_CARRIAGE_RETURN","CHAR_CIRCUMFLEX_ACCENT","CHAR_COLON","CHAR_COMMA","CHAR_DOT","CHAR_DOUBLE_QUOTE","CHAR_EQUAL","CHAR_EXCLAMATION_MARK","CHAR_FORM_FEED","CHAR_FORWARD_SLASH","CHAR_GRAVE_ACCENT","CHAR_HASH","CHAR_HYPHEN_MINUS","CHAR_LEFT_ANGLE_BRACKET","CHAR_LEFT_CURLY_BRACE","CHAR_LEFT_SQUARE_BRACKET","CHAR_LINE_FEED","CHAR_NO_BREAK_SPACE","CHAR_PERCENT","CHAR_PLUS","CHAR_QUESTION_MARK","CHAR_RIGHT_ANGLE_BRACKET","CHAR_RIGHT_CURLY_BRACE","CHAR_RIGHT_SQUARE_BRACKET","CHAR_SEMICOLON","CHAR_SINGLE_QUOTE","CHAR_SPACE","CHAR_TAB","CHAR_UNDERSCORE","CHAR_VERTICAL_LINE","CHAR_ZERO_WIDTH_NOBREAK_SPACE","extglobChars","chars","open","close","globChars","win32","require$$0","exports","isObject","val","Array","isArray","hasRegexChars","str","test","isRegexChar","escapeRegex","toPosixSlashes","isWindows","navigator","platform","process","removeBackslashes","match","escapeLast","input","char","lastIdx","idx","lastIndexOf","removePrefix","output","prefix","wrapOutput","options","contains","negated","basename","windows","segs","utils","require$$1","isPathSeparator","code","depth","token","isPrefix","isGlobstar","Infinity","scan_1","opts","scanToEnd","parts","slashes","tokens","prev","index","start","lastIndex","isBrace","isBracket","isGlob","isExtglob","braceEscaped","backslashes","negatedExtglob","finished","braces","eos","advance","charCodeAt","next","noext","nonegate","noparen","push","base","glob","unescape","maxDepth","prevIndex","n","i","expandRange","sort","join","RegExp","ex","v","syntaxError","parse","max","maxLength","Math","min","len","SyntaxError","bos","prepend","capture","PLATFORM_CHARS","EXTGLOB_CHARS","globstar","dot","nodot","qmarkNoDot","star","bash","noextglob","consumed","backtrack","brackets","parens","quotes","extglobs","stack","peek","remaining","consume","num","append","negate","count","increment","decrement","pop","tok","extglob","inner","extglobOpen","conditions","extglobClose","rest","extglobStar","includes","expression","fastpaths","m","esc","repeat","exec","posix","pre","indexOf","keepQuotes","strictBrackets","nobracket","prevValue","literalBrackets","escaped","nobrace","outputIndex","tokensIndex","brace","dots","arr","range","unshift","comma","out","toks","t","regex","noglobstar","prior","before","isStart","afterStar","after","strictSlashes","end","suffix","slashDot","create","source","scan","require$$2","require$$3","picomatch","returnState","fns","arrayMatcher","isMatch","isState","compileRe","makeRe","isIgnored","ignore","ignoreOpts","onMatch","onResult","matcher","returnObject","result","onIgnore","format","matchBase","Boolean","picomatch$1","patterns","pattern","p","returnOutput","toRegex","parsed","flags","nocase","err","debug","AcceptedFileTypes","inputAccept","mimeTypes","mimeType","filter","forEach","fileType","parseInputAccept","isExtensionAccepted","fileName","isMimeTypeAccepted","isAccepted","getFilesFromFileSystemEntry","async","entry","isFile","file","Promise","resolve","reject","fileEntry","getFileFromFileSystemFileEntry","isDirectory","entriesFromDirectory","directoryEntry","createReader","readEntries","getEntriesFromDirectory","files","getFilesFromFileSystemEntries","DropArea","onDrop","e","dragEvent","container","classList","remove","preventDefault","stopPropagation","dataTransfer","items","item","fileSystemEntry","webkitGetAsEntry","getAsFile","getFilesFromDataTransfer","acceptedFiles","invalidFiles","acceptedFileTypes","name","renderer","setErrorInvalidFiles","onUploadFiles","error","console","uploadFiles","_ref","addEventListener","matchHtmlRegExp","escapeHtml_1","string","escape","html","substring","getInputNameWithPrefix","fieldName","getInputNameWithoutPrefix","findInput","form","inputNameWithPrefix","querySelector","getUploadsFieldName","getInputValueForFormAndPrefix","RenderUploadFile","createErrorContainer","div","document","createElement","className","appendChild","createFilesContainer","skipRequired","translations","errors","required","addFile","filename","uploadIndex","toString","nameSpan","innerHTML","setAttribute","enableDelete","deleteLink","findDeleteLink","findCancelSpan","el","findFileDiv","removeCancel","cancelSpan","removeProgress","progressSpan","setErrorMessage","message","originalMessageSpan","span","addNewUpload","innerSpan","cancelLink","Cancel","href","addUploadedFile","filesize","setSuccess","clearInput","deleteFile","disableCancel","disableDelete","removeDropHint","dropHint","renderDropHint","setDeleteFailed","setError","errorsMessages","msg","invalidFileTypeMessage","innerText","replaceChildren","size","fileSizeInfo","formatBytes","bytes","decimals","dm","floor","log","parseFloat","toFixed","Delete","updateProgress","percentage","innerProgressSpan","style","width","BaseUpload$1","status","abort","delete","urlJoin","strArray","resultArray","shift","component","normalize","arguments","splice","S3Upload","BaseUpload","csrfToken","endpoint","s3UploadDir","super","key","uploadId","createdPromise","chunks","chunkState","uploading","onError","undefined","onProgress","onSuccess","initChunks","catch","completeUpload","a","b","PartNumber","_ref2","encodeURIComponent","uploadIdEnc","headers","Headers","url","urljoin","fetch","body","JSON","stringify","method","then","response","json","data","completeMultipartUpload","handleError","createUpload","_ref3","accept","contentType","createMultipartUpload","uploadParts","desiredChunkSize","ceil","minChunkSize","chunkSize","busy","done","uploaded","onPartComplete","etag","part","ETag","onPartProgress","sent","totalUploaded","reduce","c","uploadPart","_ref4","number","prepareUploadPart","uploadPartBytes","xhr","XMLHttpRequest","responseType","upload","ev","lengthComputable","loaded","target","getResponseHeader","send","need","every","candidates","abortMultipartUpload","getId","getInitialFile","id","original_name","getSize","DetailedError","causingErr","req","res","originalRequest","originalResponse","causingError","requestId","getHeader","getMethod","getURL","getStatus","getBody","_hasBuffer","Buffer","_TE","TextDecoder","TextEncoder","b64chs","prototype","b64tab","tab","b64re","_fromCC","String","fromCharCode","bind","_mkUriSafe","Uint8Array","from","src","m0","_tidyB64","s","btoaPolyfill","bin","u32","c0","c1","c2","asc","pad","_btoa","btoa","_fromUint8Array","u8a","strs","l","apply","subarray","cb_utob","cc","re_utob","utob","u","_encode","encode","urlsafe","atobPolyfill","u24","r1","r2","charAt","gBase64","hasOwnProperty","decode","decodeURIComponent","querystringify$1","obj","pairs","isNaN","query","parser","port","protocol","qs","controlOrWhitespace","CRHTLF","protocolre","windowsDriveLetter","trimLeft","rules","address","isSpecial","NaN","hash","lolcation","loc","location","window","global","self","finaldestination","Url","pathname","scheme","extractProtocol","forwardSlashes","otherSlashes","slashesCount","relative","extracted","instruction","instructions","concat","up","host","hostname","username","password","auth","origin","fn","ins","PROTOCOL_TUS_V1","PROTOCOL_IETF_DRAFT_03","defaultOptions","uploadUrl","metadata","metadataForPartialUploads","fingerprint","uploadSize","onChunkComplete","onUploadUrlAvailable","overridePatchMethod","addRequestId","onBeforeRequest","onAfterResponse","onShouldRetry","defaultOnShouldRetry","Number","POSITIVE_INFINITY","retryDelays","parallelUploads","parallelUploadBoundaries","storeFingerprintForResuming","removeFingerprintOnSuccess","uploadLengthDeferred","uploadDataDuringCreation","urlStorage","fileReader","httpStack","_urlStorage","_req","_fingerprint","_urlStorageKey","_offset","_aborted","_size","_source","_retryAttempt","_retryTimeout","_offsetBeforeRetry","_parallelUploads","_parallelUploadUrls","terminate","openRequest","sendRequest","shouldRetry","delay","remainingDelays","newOptions","setTimeout","findPreviousUploads","findUploadsByFingerprint","resumeFromPreviousUpload","previousUpload","parallelUploadUrls","urlStorageKey","_emitError","optionName","openFile","_startParallelUpload","_startSingleUpload","totalSize","totalProgress","partCount","partSize","splitSizeIntoParts","uploads","lastPartProgress","newPartProgress","_emitProgress","_saveUploadInUrlStorage","all","_openRequest","setHeader","encodeMetadata","_sendRequest","inStatusCategory","_emitHttpError","resolveUrl","_emitSuccess","_resumeUpload","_createUpload","shouldTerminate","clearTimeout","_removeFromUrlStorage","lastResponse","bytesSent","bytesTotal","_emitChunkComplete","bytesAccepted","promise","_addChunkToRequest","_handleUploadResponse","_performUpload","offset","parseInt","setProgressHandler","valueSize","newSize","removeUpload","storedUpload","creationTime","Date","addUpload","Base64","category","createRequest","r","random","retryAttempt","online","onLine","isOnline","link","URL","isReactNative","product","FileSource","_file","PhoneGap","Cordova","cordova","chunk","reader","FileReader","onload","onerror","readAsArrayBuffer","blobOrArray","StreamSource","_buffer","_bufferOffset","_reader","_done","_readUntilEnoughDataOrDone","hasEnoughData","_getDataFromBuffer","read","Blob","hasAllDataBeenRead","cancel","Request","_xhr","_method","_url","_headers","header","setRequestHeader","progressHandler","onprogress","Response","getUnderlyingObject","responseText","hasStorage","originalValue","localStorage","getItem","setItem","removeItem","SECURITY_ERR","QUOTA_EXCEEDED_ERR","canStoreURLs","getName","uri","blob","isFinite","findAllUploads","results","_findEntries","round","_e","listAllUploads","_upload","exifHash","exif","hashCode","reactNativeFingerprint","lastModified","Upload","deleteUpload","TusUpload","addCsrTokenToRequest","request","handleAfterReponse","_request","resourceId","handleProgress","bytesUploaded","handleSucces","formId","BaseUploadedFile","PlaceholderFile","initialFile","UploadedS3File","ExistingFile","UploadedTusFile","FileField","handleClick","getUpload","dataIndex","getAttribute","getUploadByIndex","removeExistingUpload","handleCancel","callbacks","onClick","handleInvalidFiles","handleSuccess","updatePlaceholderInput","emitEvent","onChange","multiple","uploadFile","checkDropHint","eventEmitter","initial","supportDropArea","disabled","nextUploadIndex","filesContainer","initDropArea","addInitialFiles","initialFiles","addInitialFile","createUploadedFile","eventName","emit","metaDataField","getMetaDataField","findUploadByName","find","getMetadataFieldName","removeUploadFromList","onDelete","placeholdersInfo","existingUpload","newUploadIndex","initUploadFields","getPrefix","getInputValue","querySelectorAll","uploaderDiv","matchesPrefix","getInitialFiles","dataTranslations","autoInitFileForms","initFormSet","optionsParam","totalFormsValue","formCount","subFormPrefix"],"mappings":"YAAA,MAAMA,EAAYC,IAChB,MAAMC,EAASD,EAAQE,cAEvB,OAAKD,EAIkB,SAAnBA,EAAOE,QACFF,EAGFF,EAASE,GAPP,IAOc,ECXnBG,EAAQ,CAAE,2BAA4B,CAAC,MAAO,2BAA4B,CAAC,gBAAiB,yBAA0B,CAAC,MAAO,mBAAoB,CAAC,QAAS,yBAA0B,CAAC,cAAe,uBAAwB,CAAC,QAAS,0BAA2B,CAAC,WAAY,8BAA+B,CAAC,eAAgB,0BAA2B,CAAC,WAAY,2BAA4B,CAAC,OAAQ,4BAA6B,CAAC,QAAS,4BAA6B,CAAC,QAAS,mCAAoC,CAAC,OAAQ,oCAAqC,CAAC,QAAS,mBAAoB,CAAC,QAAS,2BAA4B,CAAC,OAAQ,wBAAyB,CAAC,SAAU,uBAAwB,CAAC,QAAS,8BAA+B,CAAC,SAAU,6BAA8B,CAAC,SAAU,0BAA2B,CAAC,SAAU,0BAA2B,CAAC,SAAU,yBAA0B,CAAC,SAAU,sBAAuB,CAAC,OAAQ,uBAAwB,CAAC,MAAO,kBAAmB,CAAC,OAAQ,uBAAwB,CAAC,OAAQ,6BAA8B,CAAC,OAAQ,2BAA4B,CAAC,YAAa,0BAA2B,CAAC,O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AU,CACZQ,UAAW9tB,EAAQ8tB,WAAa,CAAE,EAClClW,UAAW5X,EAAQ4X,WAAa,QAChC/C,YACA2Z,aAAcxuB,EAAQwuB,aACtBxf,YACAG,OACA4d,SACA0B,UACAlvB,QACA8uB,WACA15B,OAAQsY,EACRnN,SACAuiB,YAAariB,EAAQqiB,aAAe,KACpCtN,YAAaA,GAAe,KAC5B/E,eACA0e,kBACAze,eACAqR,aACA,GAEN,ECnGA5B,OAAO6Q,kB1CamBA,KACxB,MAAMR,EAAmBrQ,OAAOqQ,iBANlB33B,SASZoG,MAAMsd,KAAKnM,SAASugB,iBAAiB,kBAAkBr5B,IAAIpC,GAR7D+J,MAAMsd,KAAK,IAAI/kB,IAAIqB,GAAQA,WAUrBgT,QAAQ2kB,EAAiB,E0ClBjCrQ,OAAO8Q,YCDaA,CAACrhB,EAAeshB,KAClC,IAAIzwB,EAGFA,EAD0B,iBAAjBywB,EACC,CAAE3wB,OAAQ2wB,GAEVA,EAGZ,MAAM3wB,EAASE,EAAQF,QAAU,OAE3B4wB,EAAkBnhB,GACtBJ,EACA,cACArP,GAGF,IAAK4wB,EACH,OAGF,MAAMC,EAAY1J,SAASyJ,EAAiB,IAE5C,IAAK,IAAI1tB,EAAI,EAAGA,EAAI2tB,EAAW3tB,GAAK,EAAG,CACrC,MAAM4tB,EAAgB7hB,GAAuB/L,EAAEuN,WAAY,MAC3Dwf,GAAiB5gB,EAAM,IAClBnP,EACHF,OAAQ,GAAGA,KAAU8wB,KAEzB,GD3BFlR,OAAOqQ,iBAAmBA","x_google_ignoreList":[1,2,3,4,5,6,7,8,11,15,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]} \ No newline at end of file diff --git a/frontend/src/drop_area.ts b/frontend/src/drop_area.ts index 01e333fde..a3046da0c 100644 --- a/frontend/src/drop_area.ts +++ b/frontend/src/drop_area.ts @@ -8,7 +8,7 @@ const getEntriesFromDirectory = async ( directoryEntry.createReader().readEntries(resolve, reject); }); -const getFileFromFileEntry = async ( +const getFileFromFileSystemFileEntry = async ( fileEntry: FileSystemFileEntry ): Promise => new Promise((resolve, reject) => { @@ -18,19 +18,32 @@ const getFileFromFileEntry = async ( const getFilesFromFileSystemEntries = async ( entries: FileSystemEntry[] ): Promise => { - const result = []; + const result: File[] = []; for (const entry of entries) { - if (entry.isFile) { - const file = await getFileFromFileEntry(entry as FileSystemFileEntry); - result.push(file); - } else if (entry.isDirectory) { - const entriesFromDirectory = await getEntriesFromDirectory( - entry as FileSystemDirectoryEntry - ); - const files = await getFilesFromFileSystemEntries(entriesFromDirectory); - files.forEach(file => result.push(file)); - } + const filesFromEntry = await getFilesFromFileSystemEntry(entry); + filesFromEntry.forEach(file => result.push(file)); + } + + return result; +}; + +const getFilesFromFileSystemEntry = async ( + entry: FileSystemEntry +): Promise => { + const result: File[] = []; + + if (entry.isFile) { + const file = await getFileFromFileSystemFileEntry( + entry as FileSystemFileEntry + ); + result.push(file); + } else if (entry.isDirectory) { + const entriesFromDirectory = await getEntriesFromDirectory( + entry as FileSystemDirectoryEntry + ); + const files = await getFilesFromFileSystemEntries(entriesFromDirectory); + files.forEach(file => result.push(file)); } return result; @@ -41,11 +54,24 @@ const getFilesFromDataTransfer = async ( ): Promise => { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (dataTransfer.items) { - const entries = [...dataTransfer.items] - .map(item => item.webkitGetAsEntry()) - .filter(entry => entry != null); + const files: File[] = []; + + for (const item of dataTransfer.items) { + const fileSystemEntry = item.webkitGetAsEntry(); + if (fileSystemEntry) { + const filesFromEntry = await getFilesFromFileSystemEntry( + fileSystemEntry + ); + filesFromEntry.forEach(file => files.push(file)); + } else { + const file = item.getAsFile(); + + if (file) { + files.push(file); + } + } + } - const files = await getFilesFromFileSystemEntries(entries); return files; } else { // backwards compatibility diff --git a/testproject/django_file_form_example/tests/live/test_with_ajax.py b/testproject/django_file_form_example/tests/live/test_with_ajax.py index 219c7fafd..221d73883 100644 --- a/testproject/django_file_form_example/tests/live/test_with_ajax.py +++ b/testproject/django_file_form_example/tests/live/test_with_ajax.py @@ -947,3 +947,15 @@ def test_disabled_field(self): self.assertTrue(file_input.get_attribute("disabled")) self.assertEqual(len(page.find_elements_by_text("Drop your files here")), 0) + + def test_drop_file(self): + page = self.page + temp_file = page.create_temp_file("content1") + + page.open("/") + drop_area = page.selenium.find_element(By.CSS_SELECTOR, ".dff-files") + page.drop_file(drop_area, temp_file) + + page.find_upload_success(temp_file) + page.assert_page_contains_text("8 Bytes") + self.assertEqual(TemporaryUploadedFile.objects.count(), 1) diff --git a/testproject/django_file_form_example/tests/utils/page.py b/testproject/django_file_form_example/tests/utils/page.py index 309f44a78..e35e76fb8 100644 --- a/testproject/django_file_form_example/tests/utils/page.py +++ b/testproject/django_file_form_example/tests/utils/page.py @@ -144,3 +144,38 @@ def get_percentage(selenium): WebDriverWait(self.selenium, timeout=10, poll_frequency=0.1).until( lambda selenium: get_percentage(selenium) > 5 ) + + def drop_file(self, drop_area, temp_file): + ATTACH_FILE = """ + var input = document.createElement('INPUT'); + input.type = "file"; + input.id = "_capybara_drop_file"; + input.multiple = true; + document.body.appendChild(input); + return input; + """ + + DROP_FILE = """ + var el = arguments[0], + input = arguments[1], + files = input.files, + dt = new DataTransfer(), + opts = { cancelable: true, bubbles: true, dataTransfer: dt }; + input.parentElement.removeChild(input); + if (dt.items){ + for (var i=0; i