mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-18 00:53:10 +01:00
1 line
175 KiB
Plaintext
Executable File
1 line
175 KiB
Plaintext
Executable File
{"version":3,"sources":["../src/dropzone.js"],"names":["Emitter","event","fn","_callbacks","push","callbacks","args","callback","apply","arguments","length","i","splice","Dropzone","prototype","events","defaultOptions","url","method","withCredentials","timeout","parallelUploads","uploadMultiple","chunking","forceChunking","chunkSize","parallelChunkUploads","retryChunks","retryChunksLimit","maxFilesize","paramName","createImageThumbnails","maxThumbnailFilesize","thumbnailWidth","thumbnailHeight","thumbnailMethod","resizeWidth","resizeHeight","resizeMimeType","resizeQuality","resizeMethod","filesizeBase","maxFiles","headers","clickable","ignoreHiddenFiles","acceptedFiles","acceptedMimeTypes","autoProcessQueue","autoQueue","addRemoveLinks","previewsContainer","hiddenInputContainer","capture","renameFilename","renameFile","forceFallback","dictDefaultMessage","dictFallbackMessage","dictFallbackText","dictFileTooBig","dictInvalidFileType","dictResponseError","dictCancelUpload","dictUploadCanceled","dictCancelUploadConfirmation","dictRemoveFile","dictRemoveFileConfirmation","dictMaxFilesExceeded","dictFileSizeUnits","tb","gb","mb","kb","b","init","params","files","xhr","chunk","dzuuid","file","upload","uuid","dzchunkindex","index","dztotalfilesize","size","dzchunksize","options","dztotalchunkcount","totalChunkCount","dzchunkbyteoffset","accept","done","chunksUploaded","fallback","messageElement","element","className","getElementsByTagName","child","test","createElement","appendChild","span","textContent","innerText","getFallbackForm","resize","width","height","info","srcX","srcY","srcWidth","srcHeight","srcRatio","Math","min","trgRatio","Error","trgWidth","trgHeight","transformFile","type","match","resizeImage","previewTemplate","drop","e","classList","remove","dragstart","dragend","dragenter","add","dragover","dragleave","paste","reset","addedfile","previewElement","trim","querySelectorAll","node","name","innerHTML","filesize","_removeLink","removeFileEvent","preventDefault","stopPropagation","status","UPLOADING","confirm","removeFile","removeLink","addEventListener","removedfile","parentNode","removeChild","_updateMaxFilesReachedClass","thumbnail","dataUrl","thumbnailElement","alt","src","setTimeout","error","message","errormultiple","processing","processingmultiple","uploadprogress","progress","bytesSent","nodeName","value","style","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","emit","canceledmultiple","complete","completemultiple","maxfilesexceeded","maxfilesreached","queuecomplete","addedfiles","_thumbnailQueue","_processingThumbnail","target","objects","object","key","val","el","left","version","replace","clickableElements","listeners","document","querySelector","nodeType","dropzone","instances","elementOptions","optionsForElement","extend","isBrowserSupported","call","getAttribute","toUpperCase","getExistingFallback","getElement","getElements","filter","accepted","map","getFilesWithStatus","QUEUED","ADDED","tagName","setAttribute","contains","setupHiddenFileInput","hiddenFileInput","visibility","position","top","addFile","URL","window","webkitURL","eventName","on","updateTotalUploadProgress","getAddedFiles","getUploadingFiles","getQueuedFiles","noPropagation","returnValue","efct","dataTransfer","effectAllowed","dropEffect","forEach","clickableElement","evt","elementInside","click","enable","disable","removeAllFiles","undefined","indexOf","totalUploadProgress","totalBytesSent","totalBytes","activeFiles","getActiveFiles","total","n","existingFallback","form","fieldsString","_getParamName","fields","getFallback","elements","elementListeners","result","listener","removeEventListener","removeEventListeners","disabled","cancelUpload","setupEventListeners","selectedSize","selectedUnit","units","unit","cutoff","pow","round","getAcceptedFiles","items","webkitGetAsEntry","_addFilesFromItems","handleFiles","__guard__","clipboardData","x","item","entry","isFile","getAsFile","isDirectory","_addFilesFromDirectory","kind","directory","path","dirReader","createReader","errorHandler","__guardMethod__","console","o","log","readEntries","entries","substring","fullPath","isValidFile","uuidv4","filename","_renameFile","chunked","ceil","_enqueueThumbnail","_errorProcessing","enqueueFile","processQueue","_processThumbnailQueue","shift","createThumbnail","without","cancelIfNecessary","slice","canvas","resizedDataURL","toDataURL","ExifRestore","restore","dataURL","dataURItoBlob","fixOrientation","fileReader","FileReader","onload","createThumbnailFromUrl","readAsDataURL","crossOrigin","img","loadExif","EXIF","getData","getTag","orientation","resizeInfo","ctx","getContext","translate","scale","rotate","PI","drawImageIOSFix","trgX","trgY","onerror","processingLength","queuedFiles","processFiles","processFile","uploadFiles","groupedFiles","_getFilesWithXhr","groupedFile","CANCELED","abort","option","_transformFiles","transformedFiles","transformedFile","startedChunkCount","chunks","handleNextChunk","chunkIndex","start","end","dataBlock","data","webkitSlice","retries","_uploadData","finishedChunkUpload","allFinished","SUCCESS","_finished","dataBlocks","XMLHttpRequest","resolveOption","open","_finishedUploading","ontimeout","_handleUploadError","progressObj","onprogress","_updateFilesUploadProgress","headerName","headerValue","setRequestHeader","formData","FormData","additionalParams","_getChunk","append","_addFormElementData","submitRequest","doneCounter","input","inputName","inputType","toLowerCase","hasAttribute","selected","checked","loaded","fileProgress","fileTotal","fileBytesSent","allFilesFinished","response","readyState","responseType","responseText","getResponseHeader","JSON","parse","warn","send","ERROR","c","r","random","v","toString","initClass","camelize","forElement","autoDiscover","discover","dropzones","checkElements","blacklistedBrowsers","capableBrowser","File","FileList","Blob","regex","navigator","userAgent","dataURI","byteString","atob","split","mimeString","ab","ArrayBuffer","ia","Uint8Array","asc","charCodeAt","list","rejectedItem","str","charAt","string","div","childNodes","container","els","Array","question","rejected","mimeType","baseMimeType","validType","jQuery","each","module","exports","ACCEPTED","PROCESSING","detectVerticalSquash","iw","naturalWidth","ih","naturalHeight","drawImage","getImageData","sy","ey","py","alpha","ratio","sx","sw","sh","dx","dy","dw","dh","vertSquashRatio","KEY_STR","output","chr1","chr2","chr3","enc1","enc2","enc3","enc4","isNaN","origFileBase64","resizedFileBase64","rawImage","decode64","segments","slice2Segments","image","exifManipulation","encode64","exifArray","getExifArray","newImageArray","insertExif","aBuffer","seg","imageData","buf","separatePoint","mae","ato","array","concat","rawImageArray","head","endPoint","base64test","exec","contentLoaded","win","doc","root","documentElement","rem","pre","poll","doScroll","createEventObject","frameElement","_autoDiscoverFunction","transform","obj","methodName"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;AACA;AACA;AACA;IACMA,O;;;;;;;;;AACJ;uBACGC,K,EAAOC,E,EAAI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,GAAD,CAAH,CAASia,GAAG,GAAG,kBAAf,EAAmC9d,IAAnC,EAAyC,KAAzC;AACA,WAAOyd,GAAG,CAAC5Z,GAAD,CAAH,CAASia,GAAG,GAAG,MAAf,EAAuB9d,IAAvB,EAA6B,KAA7B,CAAP;AACD;AACF,CA1CD,C,CA6CA;;;AACA9D,QAAQ,CAACiiB,qBAAT,GAAiC,YAAY;AAC3C,MAAIjiB,QAAQ,CAACib,YAAb,EAA2B;AACzB,WAAOjb,QAAQ,CAACkb,QAAT,EAAP;AACD;AACF,CAJD;;AAKAoG,aAAa,CAACrT,MAAD,EAASjO,QAAQ,CAACiiB,qBAAlB,CAAb;;AAEA,SAAStQ,SAAT,CAAmBtH,KAAnB,EAA0B6X,SAA1B,EAAqC;AACnC,SAAQ,OAAO7X,KAAP,KAAiB,WAAjB,IAAgCA,KAAK,KAAK,IAA3C,GAAmD6X,SAAS,CAAC7X,KAAD,CAA5D,GAAsEkF,SAA7E;AACD;;AACD,SAASmD,eAAT,CAAyByP,GAAzB,EAA8BC,UAA9B,EAA0CF,SAA1C,EAAqD;AACnD,MAAI,OAAOC,GAAP,KAAe,WAAf,IAA8BA,GAAG,KAAK,IAAtC,IAA8C,OAAOA,GAAG,CAACC,UAAD,CAAV,KAA2B,UAA7E,EAAyF;AACvF,WAAOF,SAAS,CAACC,GAAD,EAAMC,UAAN,CAAhB;AACD,GAFD,MAEO;AACL,WAAO7S,SAAP;AACD;AACF","sourcesContent":["/*\n *\n * More info at [www.dropzonejs.com](http://www.dropzonejs.com)\n *\n * Copyright (c) 2012, Matias Meno\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n */\n\n\n// The Emitter class provides the ability to call `.on()` on Dropzone to listen\n// to events.\n// It is strongly based on component's emitter class, and I removed the\n// functionality because of the dependency hell with different frameworks.\nclass Emitter {\n // Add an event listener for given event\n on(event, fn) {\n this._callbacks = this._callbacks || {};\n // Create namespace for this event\n if (!this._callbacks[event]) {\n this._callbacks[event] = [];\n }\n this._callbacks[event].push(fn);\n return this;\n }\n\n\n emit(event, ...args) {\n this._callbacks = this._callbacks || {};\n let callbacks = this._callbacks[event];\n\n if (callbacks) {\n for (let callback of callbacks) {\n callback.apply(this, args);\n }\n }\n\n return this;\n }\n\n // Remove event listener for given event. If fn is not provided, all event\n // listeners for that event will be removed. If neither is provided, all\n // event listeners will be removed.\n off(event, fn) {\n if (!this._callbacks || (arguments.length === 0)) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n let callbacks = this._callbacks[event];\n if (!callbacks) {\n return this;\n }\n\n // remove all handlers\n if (arguments.length === 1) {\n delete this._callbacks[event];\n return this;\n }\n\n // remove specific handler\n for (let i = 0; i < callbacks.length; i++) {\n let callback = callbacks[i];\n if (callback === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n return this;\n }\n}\n\nclass Dropzone extends Emitter {\n static initClass() {\n\n // Exposing the emitter class, mainly for tests\n this.prototype.Emitter = Emitter;\n\n /*\n This is a list of all available events you can register on a dropzone object.\n\n You can register an event handler like this:\n\n dropzone.on(\"dragEnter\", function() { });\n\n */\n this.prototype.events = [\n \"drop\",\n \"dragstart\",\n \"dragend\",\n \"dragenter\",\n \"dragover\",\n \"dragleave\",\n \"addedfile\",\n \"addedfiles\",\n \"removedfile\",\n \"thumbnail\",\n \"error\",\n \"errormultiple\",\n \"processing\",\n \"processingmultiple\",\n \"uploadprogress\",\n \"totaluploadprogress\",\n \"sending\",\n \"sendingmultiple\",\n \"success\",\n \"successmultiple\",\n \"canceled\",\n \"canceledmultiple\",\n \"complete\",\n \"completemultiple\",\n \"reset\",\n \"maxfilesexceeded\",\n \"maxfilesreached\",\n \"queuecomplete\"\n ];\n\n\n this.prototype.defaultOptions = {\n /**\n * Has to be specified on elements other than form (or when the form\n * doesn't have an `action` attribute). You can also\n * provide a function that will be called with `files` and\n * must return the url (since `v3.12.0`)\n */\n url: null,\n\n /**\n * Can be changed to `\"put\"` if necessary. You can also provide a function\n * that will be called with `files` and must return the method (since `v3.12.0`).\n */\n method: \"post\",\n\n /**\n * Will be set on the XHRequest.\n */\n withCredentials: false,\n\n /**\n * The timeout for the XHR requests in milliseconds (since `v4.4.0`).\n */\n timeout: 30000,\n\n /**\n * How many file uploads to process in parallel (See the\n * Enqueuing file uploads* documentation section for more info)\n */\n parallelUploads: 2,\n\n /**\n * Whether to send multiple files in one request. If\n * this it set to true, then the fallback file input element will\n * have the `multiple` attribute as well. This option will\n * also trigger additional events (like `processingmultiple`). See the events\n * documentation section for more information.\n */\n uploadMultiple: false,\n\n /**\n * Whether you want files to be uploaded in chunks to your server. This can't be\n * used in combination with `uploadMultiple`.\n *\n * See [chunksUploaded](#config-chunksUploaded) for the callback to finalise an upload.\n */\n chunking: false,\n\n /**\n * If `chunking` is enabled, this defines whether **every** file should be chunked,\n * even if the file size is below chunkSize. This means, that the additional chunk\n * form data will be submitted and the `chunksUploaded` callback will be invoked.\n */\n forceChunking: false,\n\n /**\n * If `chunking` is `true`, then this defines the chunk size in bytes.\n */\n chunkSize: 2000000,\n\n /**\n * If `true`, the individual chunks of a file are being uploaded simultaneously.\n */\n parallelChunkUploads: false,\n\n /**\n * Whether a chunk should be retried if it fails.\n */\n retryChunks: false,\n\n /**\n * If `retryChunks` is true, how many times should it be retried.\n */\n retryChunksLimit: 3,\n\n /**\n * If not `null` defines how many files this Dropzone handles. If it exceeds,\n * the event `maxfilesexceeded` will be called. The dropzone element gets the\n * class `dz-max-files-reached` accordingly so you can provide visual feedback.\n */\n maxFilesize: 256,\n\n /**\n * The name of the file param that gets transferred.\n * **NOTE**: If you have the option `uploadMultiple` set to `true`, then\n * Dropzone will append `[]` to the name.\n */\n paramName: \"file\",\n\n /**\n * Whether thumbnails for images should be generated\n */\n createImageThumbnails: true,\n\n /**\n * In MB. When the filename exceeds this limit, the thumbnail will not be generated.\n */\n maxThumbnailFilesize: 10,\n\n /**\n * If `null`, the ratio of the image will be used to calculate it.\n */\n thumbnailWidth: 120,\n\n /**\n * The same as `thumbnailWidth`. If both are null, images will not be resized.\n */\n thumbnailHeight: 120,\n\n /**\n * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided.\n * Can be either `contain` or `crop`.\n */\n thumbnailMethod: 'crop',\n\n /**\n * If set, images will be resized to these dimensions before being **uploaded**.\n * If only one, `resizeWidth` **or** `resizeHeight` is provided, the original aspect\n * ratio of the file will be preserved.\n *\n * The `options.transformFile` function uses these options, so if the `transformFile` function\n * is overridden, these options don't do anything.\n */\n resizeWidth: null,\n\n /**\n * See `resizeWidth`.\n */\n resizeHeight: null,\n\n /**\n * The mime type of the resized image (before it gets uploaded to the server).\n * If `null` the original mime type will be used. To force jpeg, for example, use `image/jpeg`.\n * See `resizeWidth` for more information.\n */\n resizeMimeType: null,\n\n /**\n * The quality of the resized images. See `resizeWidth`.\n */\n resizeQuality: 0.8,\n\n /**\n * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided.\n * Can be either `contain` or `crop`.\n */\n resizeMethod: 'contain',\n\n /**\n * The base that is used to calculate the filesize. You can change this to\n * 1024 if you would rather display kibibytes, mebibytes, etc...\n * 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte` not `1 kilobyte`.\n * You can change this to `1024` if you don't care about validity.\n */\n filesizeBase: 1000,\n\n /**\n * Can be used to limit the maximum number of files that will be handled by this Dropzone\n */\n maxFiles: null,\n\n /**\n * An optional object to send additional headers to the server. Eg:\n * `{ \"My-Awesome-Header\": \"header value\" }`\n */\n headers: null,\n\n /**\n * If `true`, the dropzone element itself will be clickable, if `false`\n * nothing will be clickable.\n *\n * You can also pass an HTML element, a CSS selector (for multiple elements)\n * or an array of those. In that case, all of those elements will trigger an\n * upload when clicked.\n */\n clickable: true,\n\n /**\n * Whether hidden files in directories should be ignored.\n */\n ignoreHiddenFiles: true,\n\n\n /**\n * The default implementation of `accept` checks the file's mime type or\n * extension against this list. This is a comma separated list of mime\n * types or file extensions.\n *\n * Eg.: `image/*,application/pdf,.psd`\n *\n * If the Dropzone is `clickable` this option will also be used as\n * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept)\n * parameter on the hidden file input as well.\n */\n acceptedFiles: null,\n\n /**\n * **Deprecated!**\n * Use acceptedFiles instead.\n */\n acceptedMimeTypes: null,\n\n /**\n * If false, files will be added to the queue but the queue will not be\n * processed automatically.\n * This can be useful if you need some additional user input before sending\n * files (or if you want want all files sent at once).\n * If you're ready to send the file simply call `myDropzone.processQueue()`.\n *\n * See the [enqueuing file uploads](#enqueuing-file-uploads) documentation\n * section for more information.\n */\n autoProcessQueue: true,\n\n /**\n * If false, files added to the dropzone will not be queued by default.\n * You'll have to call `enqueueFile(file)` manually.\n */\n autoQueue: true,\n\n /**\n * If `true`, this will add a link to every file preview to remove or cancel (if\n * already uploading) the file. The `dictCancelUpload`, `dictCancelUploadConfirmation`\n * and `dictRemoveFile` options are used for the wording.\n */\n addRemoveLinks: false,\n\n /**\n * Defines where to display the file previews – if `null` the\n * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS\n * selector. The element should have the `dropzone-previews` class so\n * the previews are displayed properly.\n */\n previewsContainer: null,\n\n /**\n * This is the element the hidden input field (which is used when clicking on the\n * dropzone to trigger file selection) will be appended to. This might\n * be important in case you use frameworks to switch the content of your page.\n *\n * Can be a selector string, or an element directly.\n */\n hiddenInputContainer: \"body\",\n\n /**\n * If null, no capture type will be specified\n * If camera, mobile devices will skip the file selection and choose camera\n * If microphone, mobile devices will skip the file selection and choose the microphone\n * If camcorder, mobile devices will skip the file selection and choose the camera in video mode\n * On apple devices multiple must be set to false. AcceptedFiles may need to\n * be set to an appropriate mime type (e.g. \"image/*\", \"audio/*\", or \"video/*\").\n */\n capture: null,\n\n /**\n * **Deprecated**. Use `renameFile` instead.\n */\n renameFilename: null,\n\n /**\n * A function that is invoked before the file is uploaded to the server and renames the file.\n * This function gets the `File` as argument and can use the `file.name`. The actual name of the\n * file that gets used during the upload can be accessed through `file.upload.filename`.\n */\n renameFile: null,\n\n /**\n * If `true` the fallback will be forced. This is very useful to test your server\n * implementations first and make sure that everything works as\n * expected without dropzone if you experience problems, and to test\n * how your fallbacks will look.\n */\n forceFallback: false,\n\n /**\n * The text used before any files are dropped.\n */\n dictDefaultMessage: \"Drop files here to upload\",\n\n /**\n * The text that replaces the default message text it the browser is not supported.\n */\n dictFallbackMessage: \"Your browser does not support drag'n'drop file uploads.\",\n\n /**\n * The text that will be added before the fallback form.\n * If you provide a fallback element yourself, or if this option is `null` this will\n * be ignored.\n */\n dictFallbackText: \"Please use the fallback form below to upload your files like in the olden days.\",\n\n /**\n * If the filesize is too big.\n * `{{filesize}}` and `{{maxFilesize}}` will be replaced with the respective configuration values.\n */\n dictFileTooBig: \"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.\",\n\n /**\n * If the file doesn't match the file type.\n */\n dictInvalidFileType: \"You can't upload files of this type.\",\n\n /**\n * If the server response was invalid.\n * `{{statusCode}}` will be replaced with the servers status code.\n */\n dictResponseError: \"Server responded with {{statusCode}} code.\",\n\n /**\n * If `addRemoveLinks` is true, the text to be used for the cancel upload link.\n */\n dictCancelUpload: \"Cancel upload\",\n\n /**\n * The text that is displayed if an upload was manually canceled\n */\n dictUploadCanceled: \"Upload canceled.\",\n\n /**\n * If `addRemoveLinks` is true, the text to be used for confirmation when cancelling upload.\n */\n dictCancelUploadConfirmation: \"Are you sure you want to cancel this upload?\",\n\n /**\n * If `addRemoveLinks` is true, the text to be used to remove a file.\n */\n dictRemoveFile: \"Remove file\",\n\n /**\n * If this is not null, then the user will be prompted before removing a file.\n */\n dictRemoveFileConfirmation: null,\n\n /**\n * Displayed if `maxFiles` is st and exceeded.\n * The string `{{maxFiles}}` will be replaced by the configuration value.\n */\n dictMaxFilesExceeded: \"You can not upload any more files.\",\n\n /**\n * Allows you to translate the different units. Starting with `tb` for terabytes and going down to\n * `b` for bytes.\n */\n dictFileSizeUnits: {tb: \"TB\", gb: \"GB\", mb: \"MB\", kb: \"KB\", b: \"b\"},\n /**\n * Called when dropzone initialized\n * You can add event listeners here\n */\n init() {},\n\n /**\n * Can be an **object** of additional parameters to transfer to the server, **or** a `Function`\n * that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case\n * of a function, this needs to return a map.\n *\n * The default implementation does nothing for normal uploads, but adds relevant information for\n * chunked uploads.\n *\n * This is the same as adding hidden input fields in the form element.\n */\n params(files, xhr, chunk) {\n if (chunk) {\n return {\n dzuuid: chunk.file.upload.uuid,\n dzchunkindex: chunk.index,\n dztotalfilesize: chunk.file.size,\n dzchunksize: this.options.chunkSize,\n dztotalchunkcount: chunk.file.upload.totalChunkCount,\n dzchunkbyteoffset: chunk.index * this.options.chunkSize\n };\n }\n },\n\n /**\n * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File)\n * and a `done` function as parameters.\n *\n * If the done function is invoked without arguments, the file is \"accepted\" and will\n * be processed. If you pass an error message, the file is rejected, and the error\n * message will be displayed.\n * This function will not be called if the file is too big or doesn't match the mime types.\n */\n accept(file, done) {\n return done();\n },\n\n /**\n * The callback that will be invoked when all chunks have been uploaded for a file.\n * It gets the file for which the chunks have been uploaded as the first parameter,\n * and the `done` function as second. `done()` needs to be invoked when everything\n * needed to finish the upload process is done.\n */\n chunksUploaded: function(file, done) { done(); },\n\n /**\n * Gets called when the browser is not supported.\n * The default implementation shows the fallback input field and adds\n * a text.\n */\n fallback() {\n // This code should pass in IE7... :(\n let messageElement;\n this.element.className = `${this.element.className} dz-browser-not-supported`;\n\n for (let child of this.element.getElementsByTagName(\"div\")) {\n if (/(^| )dz-message($| )/.test(child.className)) {\n messageElement = child;\n child.className = \"dz-message\"; // Removes the 'dz-default' class\n break;\n }\n }\n if (!messageElement) {\n messageElement = Dropzone.createElement(\"<div class=\\\"dz-message\\\"><span></span></div>\");\n this.element.appendChild(messageElement);\n }\n\n let span = messageElement.getElementsByTagName(\"span\")[0];\n if (span) {\n if (span.textContent != null) {\n span.textContent = this.options.dictFallbackMessage;\n } else if (span.innerText != null) {\n span.innerText = this.options.dictFallbackMessage;\n }\n }\n\n return this.element.appendChild(this.getFallbackForm());\n },\n\n\n /**\n * Gets called to calculate the thumbnail dimensions.\n *\n * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing:\n *\n * - `srcWidth` & `srcHeight` (required)\n * - `trgWidth` & `trgHeight` (required)\n * - `srcX` & `srcY` (optional, default `0`)\n * - `trgX` & `trgY` (optional, default `0`)\n *\n * Those values are going to be used by `ctx.drawImage()`.\n */\n resize(file, width, height, resizeMethod) {\n let info = {\n srcX: 0,\n srcY: 0,\n srcWidth: file.width,\n srcHeight: file.height\n };\n\n let srcRatio = file.width / file.height;\n\n // Automatically calculate dimensions if not specified\n if ((width == null) && (height == null)) {\n width = info.srcWidth;\n height = info.srcHeight;\n } else if ((width == null)) {\n width = height * srcRatio;\n } else if ((height == null)) {\n height = width / srcRatio;\n }\n\n // Make sure images aren't upscaled\n width = Math.min(width, info.srcWidth);\n height = Math.min(height, info.srcHeight);\n\n let trgRatio = width / height;\n\n if ((info.srcWidth > width) || (info.srcHeight > height)) {\n // Image is bigger and needs rescaling\n if (resizeMethod === 'crop') {\n if (srcRatio > trgRatio) {\n info.srcHeight = file.height;\n info.srcWidth = info.srcHeight * trgRatio;\n } else {\n info.srcWidth = file.width;\n info.srcHeight = info.srcWidth / trgRatio;\n }\n } else if (resizeMethod === 'contain') {\n // Method 'contain'\n if (srcRatio > trgRatio) {\n height = width / srcRatio;\n } else {\n width = height * srcRatio;\n }\n } else {\n throw new Error(`Unknown resizeMethod '${resizeMethod}'`);\n }\n }\n\n info.srcX = (file.width - info.srcWidth) / 2;\n info.srcY = (file.height - info.srcHeight) / 2;\n\n info.trgWidth = width;\n info.trgHeight = height;\n\n return info;\n },\n\n /**\n * Can be used to transform the file (for example, resize an image if necessary).\n *\n * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes\n * images according to those dimensions.\n *\n * Gets the `file` as the first parameter, and a `done()` function as the second, that needs\n * to be invoked with the file when the transformation is done.\n */\n transformFile(file, done) {\n if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) {\n return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done);\n } else {\n return done(file);\n }\n },\n\n\n /**\n * A string that contains the template used for each dropped\n * file. Change it to fulfill your needs but make sure to properly\n * provide all elements.\n *\n * If you want to use an actual HTML element instead of providing a String\n * as a config option, you could create a div with the id `tpl`,\n * put the template inside it and provide the element like this:\n *\n * document\n * .querySelector('#tpl')\n * .innerHTML\n *\n */\n previewTemplate: `\\\n<div class=\"dz-preview dz-file-preview\">\n <div class=\"dz-image\"><img data-dz-thumbnail /></div>\n <div class=\"dz-details\">\n <div class=\"dz-size\"><span data-dz-size></span></div>\n <div class=\"dz-filename\"><span data-dz-name></span></div>\n </div>\n <div class=\"dz-progress\"><span class=\"dz-upload\" data-dz-uploadprogress></span></div>\n <div class=\"dz-error-message\"><span data-dz-errormessage></span></div>\n <div class=\"dz-success-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Check</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <path d=\"M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" stroke-opacity=\"0.198794158\" stroke=\"#747474\" fill-opacity=\"0.816519475\" fill=\"#FFFFFF\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </svg>\n </div>\n <div class=\"dz-error-mark\">\n <svg width=\"54px\" height=\"54px\" viewBox=\"0 0 54 54\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:sketch=\"http://www.bohemiancoding.com/sketch/ns\">\n <title>Error</title>\n <defs></defs>\n <g id=\"Page-1\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\" sketch:type=\"MSPage\">\n <g id=\"Check-+-Oval-2\" sketch:type=\"MSLayerGroup\" stroke=\"#747474\" stroke-opacity=\"0.198794158\" fill=\"#FFFFFF\" fill-opacity=\"0.816519475\">\n <path d=\"M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z\" id=\"Oval-2\" sketch:type=\"MSShapeGroup\"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>\\\n`,\n\n // END OPTIONS\n // (Required by the dropzone documentation parser)\n\n\n /*\n Those functions register themselves to the events on init and handle all\n the user interface specific stuff. Overwriting them won't break the upload\n but can break the way it's displayed.\n You can overwrite them if you don't like the default behavior. If you just\n want to add an additional event handler, register it on the dropzone object\n and don't overwrite those options.\n */\n\n\n\n\n // Those are self explanatory and simply concern the DragnDrop.\n drop(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n dragstart(e) {\n },\n dragend(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n dragenter(e) {\n return this.element.classList.add(\"dz-drag-hover\");\n },\n dragover(e) {\n return this.element.classList.add(\"dz-drag-hover\");\n },\n dragleave(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n\n paste(e) {\n },\n\n // Called whenever there are no files left in the dropzone anymore, and the\n // dropzone should be displayed as if in the initial state.\n reset() {\n return this.element.classList.remove(\"dz-started\");\n },\n\n // Called when a file is added to the queue\n // Receives `file`\n addedfile(file) {\n if (this.element === this.previewsContainer) {\n this.element.classList.add(\"dz-started\");\n }\n\n if (this.previewsContainer) {\n file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim());\n file.previewTemplate = file.previewElement; // Backwards compatibility\n\n this.previewsContainer.appendChild(file.previewElement);\n for (var node of file.previewElement.querySelectorAll(\"[data-dz-name]\")) {\n node.textContent = file.name;\n }\n for (node of file.previewElement.querySelectorAll(\"[data-dz-size]\")) {\n node.innerHTML = this.filesize(file.size);\n }\n\n if (this.options.addRemoveLinks) {\n file._removeLink = Dropzone.createElement(`<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>${this.options.dictRemoveFile}</a>`);\n file.previewElement.appendChild(file._removeLink);\n }\n\n let removeFileEvent = e => {\n e.preventDefault();\n e.stopPropagation();\n if (file.status === Dropzone.UPLOADING) {\n return Dropzone.confirm(this.options.dictCancelUploadConfirmation, () => this.removeFile(file));\n } else {\n if (this.options.dictRemoveFileConfirmation) {\n return Dropzone.confirm(this.options.dictRemoveFileConfirmation, () => this.removeFile(file));\n } else {\n return this.removeFile(file);\n }\n }\n };\n\n for (let removeLink of file.previewElement.querySelectorAll(\"[data-dz-remove]\")) {\n removeLink.addEventListener(\"click\", removeFileEvent);\n }\n }\n },\n\n\n // Called whenever a file is removed.\n removedfile(file) {\n if (file.previewElement != null && file.previewElement.parentNode != null) {\n file.previewElement.parentNode.removeChild(file.previewElement);\n }\n return this._updateMaxFilesReachedClass();\n },\n\n // Called when a thumbnail has been generated\n // Receives `file` and `dataUrl`\n thumbnail(file, dataUrl) {\n if (file.previewElement) {\n file.previewElement.classList.remove(\"dz-file-preview\");\n for (let thumbnailElement of file.previewElement.querySelectorAll(\"[data-dz-thumbnail]\")) {\n thumbnailElement.alt = file.name;\n thumbnailElement.src = dataUrl;\n }\n\n return setTimeout((() => file.previewElement.classList.add(\"dz-image-preview\")), 1);\n }\n },\n\n // Called whenever an error occurs\n // Receives `file` and `message`\n error(file, message) {\n if (file.previewElement) {\n file.previewElement.classList.add(\"dz-error\");\n if ((typeof message !== \"String\") && message.error) {\n message = message.error;\n }\n for (let node of file.previewElement.querySelectorAll(\"[data-dz-errormessage]\")) {\n node.textContent = message;\n }\n }\n },\n\n errormultiple() {\n },\n\n // Called when a file gets processed. Since there is a cue, not all added\n // files are processed immediately.\n // Receives `file`\n processing(file) {\n if (file.previewElement) {\n file.previewElement.classList.add(\"dz-processing\");\n if (file._removeLink) {\n return file._removeLink.innerHTML = this.options.dictCancelUpload;\n }\n }\n },\n\n processingmultiple() {\n },\n\n // Called whenever the upload progress gets updated.\n // Receives `file`, `progress` (percentage 0-100) and `bytesSent`.\n // To get the total number of bytes of the file, use `file.size`\n uploadprogress(file, progress, bytesSent) {\n if (file.previewElement) {\n for (let node of file.previewElement.querySelectorAll(\"[data-dz-uploadprogress]\")) {\n node.nodeName === 'PROGRESS' ?\n (node.value = progress)\n :\n (node.style.width = `${progress}%`)\n }\n }\n },\n\n // Called whenever the total upload progress gets updated.\n // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent\n totaluploadprogress() {\n },\n\n // Called just before the file is sent. Gets the `xhr` object as second\n // parameter, so you can modify it (for example to add a CSRF token) and a\n // `formData` object to add additional information.\n sending() {\n },\n\n sendingmultiple() {},\n\n // When the complete upload is finished and successful\n // Receives `file`\n success(file) {\n if (file.previewElement) {\n return file.previewElement.classList.add(\"dz-success\");\n }\n },\n\n successmultiple() {},\n\n // When the upload is canceled.\n canceled(file) {\n return this.emit(\"error\", file, this.options.dictUploadCanceled);\n },\n\n canceledmultiple() {},\n\n // When the upload is finished, either with success or an error.\n // Receives `file`\n complete(file) {\n if (file._removeLink) {\n file._removeLink.innerHTML = this.options.dictRemoveFile;\n }\n if (file.previewElement) {\n return file.previewElement.classList.add(\"dz-complete\");\n }\n },\n\n completemultiple() {},\n\n maxfilesexceeded() {},\n\n maxfilesreached() {},\n\n queuecomplete() {},\n\n addedfiles() {}\n };\n\n\n this.prototype._thumbnailQueue = [];\n this.prototype._processingThumbnail = false;\n }\n\n // global utility\n static extend(target, ...objects) {\n for (let object of objects) {\n for (let key in object) {\n let val = object[key];\n target[key] = val;\n }\n }\n return target;\n }\n\n constructor(el, options) {\n super();\n let fallback, left;\n this.element = el;\n // For backwards compatibility since the version was in the prototype previously\n this.version = Dropzone.version;\n\n this.defaultOptions.previewTemplate = this.defaultOptions.previewTemplate.replace(/\\n*/g, \"\");\n\n this.clickableElements = [];\n this.listeners = [];\n this.files = []; // All files\n\n if (typeof this.element === \"string\") {\n this.element = document.querySelector(this.element);\n }\n\n // Not checking if instance of HTMLElement or Element since IE9 is extremely weird.\n if (!this.element || (this.element.nodeType == null)) {\n throw new Error(\"Invalid dropzone element.\");\n }\n\n if (this.element.dropzone) {\n throw new Error(\"Dropzone already attached.\");\n }\n\n // Now add this dropzone to the instances.\n Dropzone.instances.push(this);\n\n // Put the dropzone inside the element itself.\n this.element.dropzone = this;\n\n let elementOptions = (left = Dropzone.optionsForElement(this.element)) != null ? left : {};\n\n this.options = Dropzone.extend({}, this.defaultOptions, elementOptions, options != null ? options : {});\n\n // If the browser failed, just call the fallback and leave\n if (this.options.forceFallback || !Dropzone.isBrowserSupported()) {\n return this.options.fallback.call(this);\n }\n\n // @options.url = @element.getAttribute \"action\" unless @options.url?\n if (this.options.url == null) {\n this.options.url = this.element.getAttribute(\"action\");\n }\n\n if (!this.options.url) {\n throw new Error(\"No URL provided.\");\n }\n\n if (this.options.acceptedFiles && this.options.acceptedMimeTypes) {\n throw new Error(\"You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.\");\n }\n\n if (this.options.uploadMultiple && this.options.chunking) {\n throw new Error('You cannot set both: uploadMultiple and chunking.');\n }\n\n // Backwards compatibility\n if (this.options.acceptedMimeTypes) {\n this.options.acceptedFiles = this.options.acceptedMimeTypes;\n delete this.options.acceptedMimeTypes;\n }\n\n // Backwards compatibility\n if (this.options.renameFilename != null) {\n this.options.renameFile = file => this.options.renameFilename.call(this, file.name, file);\n }\n\n this.options.method = this.options.method.toUpperCase();\n\n if ((fallback = this.getExistingFallback()) && fallback.parentNode) {\n // Remove the fallback\n fallback.parentNode.removeChild(fallback);\n }\n\n // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false\n if (this.options.previewsContainer !== false) {\n if (this.options.previewsContainer) {\n this.previewsContainer = Dropzone.getElement(this.options.previewsContainer, \"previewsContainer\");\n } else {\n this.previewsContainer = this.element;\n }\n }\n\n if (this.options.clickable) {\n if (this.options.clickable === true) {\n this.clickableElements = [this.element];\n } else {\n this.clickableElements = Dropzone.getElements(this.options.clickable, \"clickable\");\n }\n }\n\n\n this.init();\n }\n\n\n // Returns all files that have been accepted\n getAcceptedFiles() {\n return this.files.filter((file) => file.accepted).map((file) => file);\n }\n\n // Returns all files that have been rejected\n // Not sure when that's going to be useful, but added for completeness.\n getRejectedFiles() {\n return this.files.filter((file) => !file.accepted).map((file) => file);\n }\n\n getFilesWithStatus(status) {\n return this.files.filter((file) => file.status === status).map((file) => file);\n }\n\n // Returns all files that are in the queue\n getQueuedFiles() {\n return this.getFilesWithStatus(Dropzone.QUEUED);\n }\n\n getUploadingFiles() {\n return this.getFilesWithStatus(Dropzone.UPLOADING);\n }\n\n getAddedFiles() {\n return this.getFilesWithStatus(Dropzone.ADDED);\n }\n\n // Files that are either queued or uploading\n getActiveFiles() {\n return this.files.filter((file) => (file.status === Dropzone.UPLOADING) || (file.status === Dropzone.QUEUED)).map((file) => file);\n }\n\n // The function that gets called when Dropzone is initialized. You\n // can (and should) setup event listeners inside this function.\n init() {\n // In case it isn't set already\n if (this.element.tagName === \"form\") {\n this.element.setAttribute(\"enctype\", \"multipart/form-data\");\n }\n\n if (this.element.classList.contains(\"dropzone\") && !this.element.querySelector(\".dz-message\")) {\n this.element.appendChild(Dropzone.createElement(`<div class=\"dz-default dz-message\"><span>${this.options.dictDefaultMessage}</span></div>`));\n }\n\n if (this.clickableElements.length) {\n let setupHiddenFileInput = () => {\n if (this.hiddenFileInput) {\n this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);\n }\n this.hiddenFileInput = document.createElement(\"input\");\n this.hiddenFileInput.setAttribute(\"type\", \"file\");\n if ((this.options.maxFiles === null) || (this.options.maxFiles > 1)) {\n this.hiddenFileInput.setAttribute(\"multiple\", \"multiple\");\n }\n this.hiddenFileInput.className = \"dz-hidden-input\";\n\n if (this.options.acceptedFiles !== null) {\n this.hiddenFileInput.setAttribute(\"accept\", this.options.acceptedFiles);\n }\n if (this.options.capture !== null) {\n this.hiddenFileInput.setAttribute(\"capture\", this.options.capture);\n }\n\n // Not setting `display=\"none\"` because some browsers don't accept clicks\n // on elements that aren't displayed.\n this.hiddenFileInput.style.visibility = \"hidden\";\n this.hiddenFileInput.style.position = \"absolute\";\n this.hiddenFileInput.style.top = \"0\";\n this.hiddenFileInput.style.left = \"0\";\n this.hiddenFileInput.style.height = \"0\";\n this.hiddenFileInput.style.width = \"0\";\n Dropzone.getElement(this.options.hiddenInputContainer, 'hiddenInputContainer').appendChild(this.hiddenFileInput);\n return this.hiddenFileInput.addEventListener(\"change\", () => {\n let {files} = this.hiddenFileInput;\n if (files.length) {\n for (let file of files) {\n this.addFile(file);\n }\n }\n this.emit(\"addedfiles\", files);\n return setupHiddenFileInput();\n });\n };\n setupHiddenFileInput();\n }\n\n this.URL = window.URL !== null ? window.URL : window.webkitURL;\n\n\n // Setup all event listeners on the Dropzone object itself.\n // They're not in @setupEventListeners() because they shouldn't be removed\n // again when the dropzone gets disabled.\n for (let eventName of this.events) {\n this.on(eventName, this.options[eventName]);\n }\n\n this.on(\"uploadprogress\", () => this.updateTotalUploadProgress());\n\n this.on(\"removedfile\", () => this.updateTotalUploadProgress());\n\n this.on(\"canceled\", file => this.emit(\"complete\", file));\n\n // Emit a `queuecomplete` event if all files finished uploading.\n this.on(\"complete\", file => {\n if ((this.getAddedFiles().length === 0) && (this.getUploadingFiles().length === 0) && (this.getQueuedFiles().length === 0)) {\n // This needs to be deferred so that `queuecomplete` really triggers after `complete`\n return setTimeout((() => this.emit(\"queuecomplete\")), 0);\n }\n });\n\n\n let noPropagation = function (e) {\n e.stopPropagation();\n if (e.preventDefault) {\n return e.preventDefault();\n } else {\n return e.returnValue = false;\n }\n };\n\n // Create the listeners\n this.listeners = [\n {\n element: this.element,\n events: {\n \"dragstart\": e => {\n return this.emit(\"dragstart\", e);\n },\n \"dragenter\": e => {\n noPropagation(e);\n return this.emit(\"dragenter\", e);\n },\n \"dragover\": e => {\n // Makes it possible to drag files from chrome's download bar\n // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar\n // Try is required to prevent bug in Internet Explorer 11 (SCRIPT65535 exception)\n let efct;\n try {\n efct = e.dataTransfer.effectAllowed;\n } catch (error) {\n }\n e.dataTransfer.dropEffect = ('move' === efct) || ('linkMove' === efct) ? 'move' : 'copy';\n\n noPropagation(e);\n return this.emit(\"dragover\", e);\n },\n \"dragleave\": e => {\n return this.emit(\"dragleave\", e);\n },\n \"drop\": e => {\n noPropagation(e);\n return this.drop(e);\n },\n \"dragend\": e => {\n return this.emit(\"dragend\", e);\n }\n }\n\n // This is disabled right now, because the browsers don't implement it properly.\n // \"paste\": (e) =>\n // noPropagation e\n // @paste e\n }\n ];\n\n this.clickableElements.forEach(clickableElement => {\n return this.listeners.push({\n element: clickableElement,\n events: {\n \"click\": evt => {\n // Only the actual dropzone or the message element should trigger file selection\n if ((clickableElement !== this.element) || ((evt.target === this.element) || Dropzone.elementInside(evt.target, this.element.querySelector(\".dz-message\")))) {\n this.hiddenFileInput.click(); // Forward the click\n }\n return true;\n }\n }\n });\n });\n\n this.enable();\n\n return this.options.init.call(this);\n }\n\n // Not fully tested yet\n destroy() {\n this.disable();\n this.removeAllFiles(true);\n if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) {\n this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);\n this.hiddenFileInput = null;\n }\n delete this.element.dropzone;\n return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1);\n }\n\n\n updateTotalUploadProgress() {\n let totalUploadProgress;\n let totalBytesSent = 0;\n let totalBytes = 0;\n\n let activeFiles = this.getActiveFiles();\n\n if (activeFiles.length) {\n for (let file of this.getActiveFiles()) {\n totalBytesSent += file.upload.bytesSent;\n totalBytes += file.upload.total;\n }\n totalUploadProgress = (100 * totalBytesSent) / totalBytes;\n } else {\n totalUploadProgress = 100;\n }\n\n return this.emit(\"totaluploadprogress\", totalUploadProgress, totalBytes, totalBytesSent);\n }\n\n // @options.paramName can be a function taking one parameter rather than a string.\n // A parameter name for a file is obtained simply by calling this with an index number.\n _getParamName(n) {\n if (typeof this.options.paramName === \"function\") {\n return this.options.paramName(n);\n } else {\n return `${this.options.paramName}${this.options.uploadMultiple ? `[${n}]` : \"\"}`;\n }\n }\n\n // If @options.renameFile is a function,\n // the function will be used to rename the file.name before appending it to the formData\n _renameFile(file) {\n if (typeof this.options.renameFile !== \"function\") {\n return file.name;\n }\n return this.options.renameFile(file);\n }\n\n // Returns a form that can be used as fallback if the browser does not support DragnDrop\n //\n // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided.\n // This code has to pass in IE7 :(\n getFallbackForm() {\n let existingFallback, form;\n if (existingFallback = this.getExistingFallback()) {\n return existingFallback;\n }\n\n let fieldsString = \"<div class=\\\"dz-fallback\\\">\";\n if (this.options.dictFallbackText) {\n fieldsString += `<p>${this.options.dictFallbackText}</p>`;\n }\n fieldsString += `<input type=\"file\" name=\"${this._getParamName(0)}\" ${this.options.uploadMultiple ? 'multiple=\"multiple\"' : undefined } /><input type=\"submit\" value=\"Upload!\"></div>`;\n\n let fields = Dropzone.createElement(fieldsString);\n if (this.element.tagName !== \"FORM\") {\n form = Dropzone.createElement(`<form action=\"${this.options.url}\" enctype=\"multipart/form-data\" method=\"${this.options.method}\"></form>`);\n form.appendChild(fields);\n } else {\n // Make sure that the enctype and method attributes are set properly\n this.element.setAttribute(\"enctype\", \"multipart/form-data\");\n this.element.setAttribute(\"method\", this.options.method);\n }\n return form != null ? form : fields;\n }\n\n\n // Returns the fallback elements if they exist already\n //\n // This code has to pass in IE7 :(\n getExistingFallback() {\n let getFallback = function (elements) {\n for (let el of elements) {\n if (/(^| )fallback($| )/.test(el.className)) {\n return el;\n }\n }\n };\n\n for (let tagName of [\"div\", \"form\"]) {\n var fallback;\n if (fallback = getFallback(this.element.getElementsByTagName(tagName))) {\n return fallback;\n }\n }\n }\n\n\n // Activates all listeners stored in @listeners\n setupEventListeners() {\n return this.listeners.map((elementListeners) =>\n (() => {\n let result = [];\n for (let event in elementListeners.events) {\n let listener = elementListeners.events[event];\n result.push(elementListeners.element.addEventListener(event, listener, false));\n }\n return result;\n })());\n }\n\n\n // Deactivates all listeners stored in @listeners\n removeEventListeners() {\n return this.listeners.map((elementListeners) =>\n (() => {\n let result = [];\n for (let event in elementListeners.events) {\n let listener = elementListeners.events[event];\n result.push(elementListeners.element.removeEventListener(event, listener, false));\n }\n return result;\n })());\n }\n\n // Removes all event listeners and cancels all files in the queue or being processed.\n disable() {\n this.clickableElements.forEach(element => element.classList.remove(\"dz-clickable\"));\n this.removeEventListeners();\n this.disabled = true;\n\n return this.files.map((file) => this.cancelUpload(file));\n }\n\n enable() {\n delete this.disabled;\n this.clickableElements.forEach(element => element.classList.add(\"dz-clickable\"));\n return this.setupEventListeners();\n }\n\n // Returns a nicely formatted filesize\n filesize(size) {\n let selectedSize = 0;\n let selectedUnit = \"b\";\n\n if (size > 0) {\n let units = ['tb', 'gb', 'mb', 'kb', 'b'];\n\n for (let i = 0; i < units.length; i++) {\n let unit = units[i];\n let cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;\n\n if (size >= cutoff) {\n selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);\n selectedUnit = unit;\n break;\n }\n }\n\n selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits\n }\n\n return `<strong>${selectedSize}</strong> ${this.options.dictFileSizeUnits[selectedUnit]}`;\n }\n\n\n // Adds or removes the `dz-max-files-reached` class from the form.\n _updateMaxFilesReachedClass() {\n if ((this.options.maxFiles != null) && (this.getAcceptedFiles().length >= this.options.maxFiles)) {\n if (this.getAcceptedFiles().length === this.options.maxFiles) {\n this.emit('maxfilesreached', this.files);\n }\n return this.element.classList.add(\"dz-max-files-reached\");\n } else {\n return this.element.classList.remove(\"dz-max-files-reached\");\n }\n }\n\n\n drop(e) {\n if (!e.dataTransfer) {\n return;\n }\n this.emit(\"drop\", e);\n\n // Convert the FileList to an Array\n // This is necessary for IE11\n let files = [];\n for (let i = 0; i < e.dataTransfer.files.length; i++) {\n files[i] = e.dataTransfer.files[i];\n }\n\n this.emit(\"addedfiles\", files);\n\n // Even if it's a folder, files.length will contain the folders.\n if (files.length) {\n let {items} = e.dataTransfer;\n if (items && items.length && (items[0].webkitGetAsEntry != null)) {\n // The browser supports dropping of folders, so handle items instead of files\n this._addFilesFromItems(items);\n } else {\n this.handleFiles(files);\n }\n }\n }\n\n paste(e) {\n if (__guard__(e != null ? e.clipboardData : undefined, x => x.items) == null) {\n return;\n }\n\n this.emit(\"paste\", e);\n let {items} = e.clipboardData;\n\n if (items.length) {\n return this._addFilesFromItems(items);\n }\n }\n\n\n handleFiles(files) {\n for(let file of files) {\n this.addFile(file);\n }\n }\n\n // When a folder is dropped (or files are pasted), items must be handled\n // instead of files.\n _addFilesFromItems(items) {\n return (() => {\n let result = [];\n for (let item of items) {\n var entry;\n if ((item.webkitGetAsEntry != null) && (entry = item.webkitGetAsEntry())) {\n if (entry.isFile) {\n result.push(this.addFile(item.getAsFile()));\n } else if (entry.isDirectory) {\n // Append all files from that directory to files\n result.push(this._addFilesFromDirectory(entry, entry.name));\n } else {\n result.push(undefined);\n }\n } else if (item.getAsFile != null) {\n if ((item.kind == null) || (item.kind === \"file\")) {\n result.push(this.addFile(item.getAsFile()));\n } else {\n result.push(undefined);\n }\n } else {\n result.push(undefined);\n }\n }\n return result;\n })();\n }\n\n\n // Goes through the directory, and adds each file it finds recursively\n _addFilesFromDirectory(directory, path) {\n let dirReader = directory.createReader();\n\n let errorHandler = error => __guardMethod__(console, 'log', o => o.log(error));\n\n var readEntries = () => {\n return dirReader.readEntries(entries => {\n if (entries.length > 0) {\n for (let entry of entries) {\n if (entry.isFile) {\n entry.file(file => {\n if (this.options.ignoreHiddenFiles && (file.name.substring(0, 1) === '.')) {\n return;\n }\n file.fullPath = `${path}/${file.name}`;\n return this.addFile(file);\n });\n } else if (entry.isDirectory) {\n this._addFilesFromDirectory(entry, `${path}/${entry.name}`);\n }\n }\n\n // Recursively call readEntries() again, since browser only handle\n // the first 100 entries.\n // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries\n readEntries();\n }\n return null;\n }\n , errorHandler);\n };\n\n return readEntries();\n }\n\n\n // If `done()` is called without argument the file is accepted\n // If you call it with an error message, the file is rejected\n // (This allows for asynchronous validation)\n //\n // This function checks the filesize, and if the file.type passes the\n // `acceptedFiles` check.\n accept(file, done) {\n if (this.options.maxFilesize && file.size > (this.options.maxFilesize * 1024 * 1024)) {\n return done(this.options.dictFileTooBig.replace(\"{{filesize}}\", Math.round(file.size / 1024 / 10.24) / 100).replace(\"{{maxFilesize}}\", this.options.maxFilesize));\n } else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {\n return done(this.options.dictInvalidFileType);\n } else if ((this.options.maxFiles != null) && (this.getAcceptedFiles().length >= this.options.maxFiles)) {\n done(this.options.dictMaxFilesExceeded.replace(\"{{maxFiles}}\", this.options.maxFiles));\n return this.emit(\"maxfilesexceeded\", file);\n } else {\n return this.options.accept.call(this, file, done);\n }\n }\n\n addFile(file) {\n file.upload = {\n uuid: Dropzone.uuidv4(),\n progress: 0,\n // Setting the total upload size to file.size for the beginning\n // It's actual different than the size to be transmitted.\n total: file.size,\n bytesSent: 0,\n filename: this._renameFile(file),\n chunked: this.options.chunking && (this.options.forceChunking || file.size > this.options.chunkSize),\n totalChunkCount: Math.ceil(file.size / this.options.chunkSize)\n };\n this.files.push(file);\n\n file.status = Dropzone.ADDED;\n\n this.emit(\"addedfile\", file);\n\n this._enqueueThumbnail(file);\n\n return this.accept(file, error => {\n if (error) {\n file.accepted = false;\n this._errorProcessing([file], error); // Will set the file.status\n } else {\n file.accepted = true;\n if (this.options.autoQueue) {\n this.enqueueFile(file);\n } // Will set .accepted = true\n }\n return this._updateMaxFilesReachedClass();\n });\n }\n\n\n // Wrapper for enqueueFile\n enqueueFiles(files) {\n for (let file of files) {\n this.enqueueFile(file);\n }\n return null;\n }\n\n enqueueFile(file) {\n if ((file.status === Dropzone.ADDED) && (file.accepted === true)) {\n file.status = Dropzone.QUEUED;\n if (this.options.autoProcessQueue) {\n return setTimeout((() => this.processQueue()), 0); // Deferring the call\n }\n } else {\n throw new Error(\"This file can't be queued because it has already been processed or was rejected.\");\n }\n }\n\n _enqueueThumbnail(file) {\n if (this.options.createImageThumbnails && file.type.match(/image.*/) && (file.size <= (this.options.maxThumbnailFilesize * 1024 * 1024))) {\n this._thumbnailQueue.push(file);\n return setTimeout((() => this._processThumbnailQueue()), 0); // Deferring the call\n }\n }\n\n _processThumbnailQueue() {\n if (this._processingThumbnail || (this._thumbnailQueue.length === 0)) {\n return;\n }\n\n this._processingThumbnail = true;\n let file = this._thumbnailQueue.shift();\n return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, dataUrl => {\n this.emit(\"thumbnail\", file, dataUrl);\n this._processingThumbnail = false;\n return this._processThumbnailQueue();\n });\n }\n\n\n // Can be called by the user to remove a file\n removeFile(file) {\n if (file.status === Dropzone.UPLOADING) {\n this.cancelUpload(file);\n }\n this.files = without(this.files, file);\n\n this.emit(\"removedfile\", file);\n if (this.files.length === 0) {\n return this.emit(\"reset\");\n }\n }\n\n // Removes all files that aren't currently processed from the list\n removeAllFiles(cancelIfNecessary) {\n // Create a copy of files since removeFile() changes the @files array.\n if (cancelIfNecessary == null) {\n cancelIfNecessary = false;\n }\n for (let file of this.files.slice()) {\n if ((file.status !== Dropzone.UPLOADING) || cancelIfNecessary) {\n this.removeFile(file);\n }\n }\n return null;\n }\n\n // Resizes an image before it gets sent to the server. This function is the default behavior of\n // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with\n // the resized blob.\n resizeImage(file, width, height, resizeMethod, callback) {\n return this.createThumbnail(file, width, height, resizeMethod, true, (dataUrl, canvas) => {\n if (canvas == null) {\n // The image has not been resized\n return callback(file);\n } else {\n let {resizeMimeType} = this.options;\n if (resizeMimeType == null) {\n resizeMimeType = file.type;\n }\n let resizedDataURL = canvas.toDataURL(resizeMimeType, this.options.resizeQuality);\n if ((resizeMimeType === 'image/jpeg') || (resizeMimeType === 'image/jpg')) {\n // Now add the original EXIF information\n resizedDataURL = ExifRestore.restore(file.dataURL, resizedDataURL);\n }\n return callback(Dropzone.dataURItoBlob(resizedDataURL));\n }\n });\n }\n\n createThumbnail(file, width, height, resizeMethod, fixOrientation, callback) {\n let fileReader = new FileReader;\n\n fileReader.onload = () => {\n\n file.dataURL = fileReader.result;\n\n // Don't bother creating a thumbnail for SVG images since they're vector\n if (file.type === \"image/svg+xml\") {\n if (callback != null) {\n callback(fileReader.result);\n }\n return;\n }\n\n return this.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback);\n };\n\n return fileReader.readAsDataURL(file);\n }\n\n createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) {\n // Not using `new Image` here because of a bug in latest Chrome versions.\n // See https://github.com/enyo/dropzone/pull/226\n let img = document.createElement(\"img\");\n\n if (crossOrigin) {\n img.crossOrigin = crossOrigin;\n }\n\n img.onload = () => {\n let loadExif = callback => callback(1);\n if ((typeof EXIF !== 'undefined' && EXIF !== null) && fixOrientation) {\n loadExif = callback =>\n EXIF.getData(img, function () {\n return callback(EXIF.getTag(this, 'Orientation'));\n })\n ;\n }\n\n return loadExif(orientation => {\n file.width = img.width;\n file.height = img.height;\n\n let resizeInfo = this.options.resize.call(this, file, width, height, resizeMethod);\n\n let canvas = document.createElement(\"canvas\");\n let ctx = canvas.getContext(\"2d\");\n\n canvas.width = resizeInfo.trgWidth;\n canvas.height = resizeInfo.trgHeight;\n\n if (orientation > 4) {\n canvas.width = resizeInfo.trgHeight;\n canvas.height = resizeInfo.trgWidth;\n }\n\n switch (orientation) {\n case 2:\n // horizontal flip\n ctx.translate(canvas.width, 0);\n ctx.scale(-1, 1);\n break;\n case 3:\n // 180° rotate left\n ctx.translate(canvas.width, canvas.height);\n ctx.rotate(Math.PI);\n break;\n case 4:\n // vertical flip\n ctx.translate(0, canvas.height);\n ctx.scale(1, -1);\n break;\n case 5:\n // vertical flip + 90 rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.scale(1, -1);\n break;\n case 6:\n // 90° rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.translate(0, -canvas.width);\n break;\n case 7:\n // horizontal flip + 90 rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.translate(canvas.height, -canvas.width);\n ctx.scale(-1, 1);\n break;\n case 8:\n // 90° rotate left\n ctx.rotate(-0.5 * Math.PI);\n ctx.translate(-canvas.height, 0);\n break;\n }\n\n // This is a bugfix for iOS' scaling bug.\n drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight);\n\n let thumbnail = canvas.toDataURL(\"image/png\");\n\n if (callback != null) {\n return callback(thumbnail, canvas);\n }\n });\n };\n\n if (callback != null) {\n img.onerror = callback;\n }\n\n return img.src = file.dataURL;\n }\n\n\n // Goes through the queue and processes files if there aren't too many already.\n processQueue() {\n let {parallelUploads} = this.options;\n let processingLength = this.getUploadingFiles().length;\n let i = processingLength;\n\n // There are already at least as many files uploading than should be\n if (processingLength >= parallelUploads) {\n return;\n }\n\n let queuedFiles = this.getQueuedFiles();\n\n if (!(queuedFiles.length > 0)) {\n return;\n }\n\n if (this.options.uploadMultiple) {\n // The files should be uploaded in one request\n return this.processFiles(queuedFiles.slice(0, (parallelUploads - processingLength)));\n } else {\n while (i < parallelUploads) {\n if (!queuedFiles.length) {\n return;\n } // Nothing left to process\n this.processFile(queuedFiles.shift());\n i++;\n }\n }\n }\n\n\n // Wrapper for `processFiles`\n processFile(file) {\n return this.processFiles([file]);\n }\n\n\n // Loads the file, then calls finishedLoading()\n processFiles(files) {\n for (let file of files) {\n file.processing = true; // Backwards compatibility\n file.status = Dropzone.UPLOADING;\n\n this.emit(\"processing\", file);\n }\n\n if (this.options.uploadMultiple) {\n this.emit(\"processingmultiple\", files);\n }\n\n return this.uploadFiles(files);\n }\n\n\n _getFilesWithXhr(xhr) {\n let files;\n return files = (this.files.filter((file) => file.xhr === xhr).map((file) => file));\n }\n\n\n // Cancels the file upload and sets the status to CANCELED\n // **if** the file is actually being uploaded.\n // If it's still in the queue, the file is being removed from it and the status\n // set to CANCELED.\n cancelUpload(file) {\n if (file.status === Dropzone.UPLOADING) {\n let groupedFiles = this._getFilesWithXhr(file.xhr);\n for (let groupedFile of groupedFiles) {\n groupedFile.status = Dropzone.CANCELED;\n }\n if (typeof file.xhr !== 'undefined') {\n file.xhr.abort();\n }\n for (let groupedFile of groupedFiles) {\n this.emit(\"canceled\", groupedFile);\n }\n if (this.options.uploadMultiple) {\n this.emit(\"canceledmultiple\", groupedFiles);\n }\n\n } else if (file.status === Dropzone.ADDED || file.status === Dropzone.QUEUED) {\n file.status = Dropzone.CANCELED;\n this.emit(\"canceled\", file);\n if (this.options.uploadMultiple) {\n this.emit(\"canceledmultiple\", [file]);\n }\n }\n\n if (this.options.autoProcessQueue) {\n return this.processQueue();\n }\n }\n\n resolveOption(option, ...args) {\n if (typeof option === 'function') {\n return option.apply(this, args);\n }\n return option;\n }\n\n uploadFile(file) { return this.uploadFiles([file]); }\n\n uploadFiles(files) {\n this._transformFiles(files, (transformedFiles) => {\n if (files[0].upload.chunked) {\n // This file should be sent in chunks!\n\n // If the chunking option is set, we **know** that there can only be **one** file, since\n // uploadMultiple is not allowed with this option.\n let file = files[0];\n let transformedFile = transformedFiles[0];\n let startedChunkCount = 0;\n\n file.upload.chunks = [];\n\n let handleNextChunk = () => {\n let chunkIndex = 0;\n\n // Find the next item in file.upload.chunks that is not defined yet.\n while (file.upload.chunks[chunkIndex] !== undefined) {\n chunkIndex++;\n }\n\n // This means, that all chunks have already been started.\n if (chunkIndex >= file.upload.totalChunkCount) return;\n\n startedChunkCount++;\n\n let start = chunkIndex * this.options.chunkSize;\n let end = Math.min(start + this.options.chunkSize, file.size);\n\n let dataBlock = {\n name: this._getParamName(0),\n data: transformedFile.webkitSlice ? transformedFile.webkitSlice(start, end) : transformedFile.slice(start, end),\n filename: file.upload.filename,\n chunkIndex: chunkIndex\n };\n\n file.upload.chunks[chunkIndex] = {\n file: file,\n index: chunkIndex,\n dataBlock: dataBlock, // In case we want to retry.\n status: Dropzone.UPLOADING,\n progress: 0,\n retries: 0 // The number of times this block has been retried.\n };\n\n\n this._uploadData(files, [dataBlock]);\n };\n\n file.upload.finishedChunkUpload = (chunk) => {\n let allFinished = true;\n chunk.status = Dropzone.SUCCESS;\n\n // Clear the data from the chunk\n chunk.dataBlock = null;\n // Leaving this reference to xhr intact here will cause memory leaks in some browsers\n chunk.xhr = null;\n\n for (let i = 0; i < file.upload.totalChunkCount; i ++) {\n if (file.upload.chunks[i] === undefined) {\n return handleNextChunk();\n }\n if (file.upload.chunks[i].status !== Dropzone.SUCCESS) {\n allFinished = false;\n }\n }\n\n if (allFinished) {\n this.options.chunksUploaded(file, () => {\n this._finished(files, '', null);\n });\n }\n };\n\n if (this.options.parallelChunkUploads) {\n for (let i = 0; i < file.upload.totalChunkCount; i++) {\n handleNextChunk();\n }\n }\n else {\n handleNextChunk();\n }\n } else {\n let dataBlocks = [];\n for (let i = 0; i < files.length; i++) {\n dataBlocks[i] = {\n name: this._getParamName(i),\n data: transformedFiles[i],\n filename: files[i].upload.filename\n };\n }\n this._uploadData(files, dataBlocks);\n }\n });\n }\n\n /// Returns the right chunk for given file and xhr\n _getChunk(file, xhr) {\n for (let i = 0; i < file.upload.totalChunkCount; i++) {\n if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) {\n return file.upload.chunks[i];\n }\n }\n }\n\n // This function actually uploads the file(s) to the server.\n // If dataBlocks contains the actual data to upload (meaning, that this could either be transformed\n // files, or individual chunks for chunked upload).\n _uploadData(files, dataBlocks) {\n let xhr = new XMLHttpRequest();\n\n // Put the xhr object in the file objects to be able to reference it later.\n for (let file of files) {\n file.xhr = xhr;\n }\n if (files[0].upload.chunked) {\n // Put the xhr object in the right chunk object, so it can be associated later, and found with _getChunk\n files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr;\n }\n\n let method = this.resolveOption(this.options.method, files);\n let url = this.resolveOption(this.options.url, files);\n xhr.open(method, url, true);\n\n // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8\n xhr.timeout = this.resolveOption(this.options.timeout, files);\n\n // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179\n xhr.withCredentials = !!this.options.withCredentials;\n\n\n xhr.onload = e => {\n this._finishedUploading(files, xhr, e);\n };\n\n xhr.ontimeout = () => {\n this._handleUploadError(files, xhr, `Request timedout after ${this.options.timeout} seconds`);\n };\n\n xhr.onerror = () => {\n this._handleUploadError(files, xhr);\n };\n\n // Some browsers do not have the .upload property\n let progressObj = xhr.upload != null ? xhr.upload : xhr;\n progressObj.onprogress = (e) => this._updateFilesUploadProgress(files, xhr, e);\n\n let headers = {\n \"Accept\": \"application/json\",\n \"Cache-Control\": \"no-cache\",\n \"X-Requested-With\": \"XMLHttpRequest\",\n };\n\n if (this.options.headers) {\n Dropzone.extend(headers, this.options.headers);\n }\n\n for (let headerName in headers) {\n let headerValue = headers[headerName];\n if (headerValue) {\n xhr.setRequestHeader(headerName, headerValue);\n }\n }\n\n let formData = new FormData();\n\n // Adding all @options parameters\n if (this.options.params) {\n let additionalParams = this.options.params;\n if (typeof additionalParams === 'function') {\n additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null);\n }\n\n for (let key in additionalParams) {\n let value = additionalParams[key];\n formData.append(key, value);\n }\n }\n\n // Let the user add additional data if necessary\n for (let file of files) {\n this.emit(\"sending\", file, xhr, formData);\n }\n if (this.options.uploadMultiple) {\n this.emit(\"sendingmultiple\", files, xhr, formData);\n }\n\n\n this._addFormElementData(formData);\n\n\n // Finally add the files\n // Has to be last because some servers (eg: S3) expect the file to be the last parameter\n for (let i = 0; i < dataBlocks.length; i++) {\n let dataBlock = dataBlocks[i];\n formData.append(dataBlock.name, dataBlock.data, dataBlock.filename);\n }\n\n this.submitRequest(xhr, formData, files);\n }\n\n\n // Transforms all files with this.options.transformFile and invokes done with the transformed files when done.\n _transformFiles(files, done) {\n let transformedFiles = [];\n // Clumsy way of handling asynchronous calls, until I get to add a proper Future library.\n let doneCounter = 0;\n for (let i = 0; i < files.length; i++) {\n this.options.transformFile.call(this, files[i], (transformedFile) => {\n transformedFiles[i] = transformedFile;\n if (++doneCounter === files.length) {\n done(transformedFiles);\n }\n });\n }\n }\n\n // Takes care of adding other input elements of the form to the AJAX request\n _addFormElementData(formData) {\n // Take care of other input elements\n if (this.element.tagName === \"FORM\") {\n for (let input of this.element.querySelectorAll(\"input, textarea, select, button\")) {\n let inputName = input.getAttribute(\"name\");\n let inputType = input.getAttribute(\"type\");\n if (inputType) inputType = inputType.toLowerCase();\n\n // If the input doesn't have a name, we can't use it.\n if (typeof inputName === 'undefined' || inputName === null) continue;\n\n if ((input.tagName === \"SELECT\") && input.hasAttribute(\"multiple\")) {\n // Possibly multiple values\n for (let option of input.options) {\n if (option.selected) {\n formData.append(inputName, option.value);\n }\n }\n } else if (!inputType || (inputType !== \"checkbox\" && inputType !== \"radio\") || input.checked) {\n formData.append(inputName, input.value);\n }\n }\n }\n }\n\n // Invoked when there is new progress information about given files.\n // If e is not provided, it is assumed that the upload is finished.\n _updateFilesUploadProgress(files, xhr, e) {\n let progress;\n if (typeof e !== 'undefined') {\n progress = (100 * e.loaded) / e.total;\n\n if (files[0].upload.chunked) {\n let file = files[0];\n // Since this is a chunked upload, we need to update the appropriate chunk progress.\n let chunk = this._getChunk(file, xhr);\n chunk.progress = progress;\n chunk.total = e.total;\n chunk.bytesSent = e.loaded;\n let fileProgress = 0, fileTotal, fileBytesSent;\n file.upload.progress = 0;\n file.upload.total = 0;\n file.upload.bytesSent = 0;\n for (let i = 0; i < file.upload.totalChunkCount; i++) {\n if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].progress !== undefined) {\n file.upload.progress += file.upload.chunks[i].progress;\n file.upload.total += file.upload.chunks[i].total;\n file.upload.bytesSent += file.upload.chunks[i].bytesSent;\n }\n }\n file.upload.progress = file.upload.progress / file.upload.totalChunkCount;\n } else {\n for (let file of files) {\n file.upload.progress = progress;\n file.upload.total = e.total;\n file.upload.bytesSent = e.loaded;\n }\n }\n for (let file of files) {\n this.emit(\"uploadprogress\", file, file.upload.progress, file.upload.bytesSent);\n }\n } else {\n // Called when the file finished uploading\n\n let allFilesFinished = true;\n\n progress = 100;\n\n for (let file of files) {\n if ((file.upload.progress !== 100) || (file.upload.bytesSent !== file.upload.total)) {\n allFilesFinished = false;\n }\n file.upload.progress = progress;\n file.upload.bytesSent = file.upload.total;\n }\n\n // Nothing to do, all files already at 100%\n if (allFilesFinished) {\n return;\n }\n\n for (let file of files) {\n this.emit(\"uploadprogress\", file, progress, file.upload.bytesSent);\n }\n }\n\n }\n\n\n _finishedUploading(files, xhr, e) {\n let response;\n\n if (files[0].status === Dropzone.CANCELED) {\n return;\n }\n\n if (xhr.readyState !== 4) {\n return;\n }\n\n if ((xhr.responseType !== 'arraybuffer') && (xhr.responseType !== 'blob')) {\n response = xhr.responseText;\n\n if (xhr.getResponseHeader(\"content-type\") && ~xhr.getResponseHeader(\"content-type\").indexOf(\"application/json\")) {\n try {\n response = JSON.parse(response);\n } catch (error) {\n e = error;\n response = \"Invalid JSON response from server.\";\n }\n }\n }\n\n this._updateFilesUploadProgress(files);\n\n if (!(200 <= xhr.status && xhr.status < 300)) {\n this._handleUploadError(files, xhr, response);\n } else {\n if (files[0].upload.chunked) {\n files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr));\n } else {\n this._finished(files, response, e);\n }\n }\n }\n\n _handleUploadError(files, xhr, response) {\n if (files[0].status === Dropzone.CANCELED) {\n return;\n }\n\n if (files[0].upload.chunked && this.options.retryChunks) {\n let chunk = this._getChunk(files[0], xhr);\n if (chunk.retries++ < this.options.retryChunksLimit) {\n this._uploadData(files, [chunk.dataBlock]);\n return;\n } else {\n console.warn('Retried this chunk too often. Giving up.')\n }\n }\n\n for (let file of files) {\n this._errorProcessing(files, response || this.options.dictResponseError.replace(\"{{statusCode}}\", xhr.status), xhr);\n }\n }\n\n submitRequest(xhr, formData, files) {\n xhr.send(formData);\n }\n\n // Called internally when processing is finished.\n // Individual callbacks have to be called in the appropriate sections.\n _finished(files, responseText, e) {\n for (let file of files) {\n file.status = Dropzone.SUCCESS;\n this.emit(\"success\", file, responseText, e);\n this.emit(\"complete\", file);\n }\n if (this.options.uploadMultiple) {\n this.emit(\"successmultiple\", files, responseText, e);\n this.emit(\"completemultiple\", files);\n }\n\n if (this.options.autoProcessQueue) {\n return this.processQueue();\n }\n }\n\n // Called internally when processing is finished.\n // Individual callbacks have to be called in the appropriate sections.\n _errorProcessing(files, message, xhr) {\n for (let file of files) {\n file.status = Dropzone.ERROR;\n this.emit(\"error\", file, message, xhr);\n this.emit(\"complete\", file);\n }\n if (this.options.uploadMultiple) {\n this.emit(\"errormultiple\", files, message, xhr);\n this.emit(\"completemultiple\", files);\n }\n\n if (this.options.autoProcessQueue) {\n return this.processQueue();\n }\n }\n\n static uuidv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n let r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n };\n}\nDropzone.initClass();\n\n\nDropzone.version = \"5.5.0\";\n\n\n// This is a map of options for your different dropzones. Add configurations\n// to this object for your different dropzone elemens.\n//\n// Example:\n//\n// Dropzone.options.myDropzoneElementId = { maxFilesize: 1 };\n//\n// To disable autoDiscover for a specific element, you can set `false` as an option:\n//\n// Dropzone.options.myDisabledElementId = false;\n//\n// And in html:\n//\n// <form action=\"/upload\" id=\"my-dropzone-element-id\" class=\"dropzone\"></form>\nDropzone.options = {};\n\n\n// Returns the options for an element or undefined if none available.\nDropzone.optionsForElement = function (element) {\n // Get the `Dropzone.options.elementId` for this element if it exists\n if (element.getAttribute(\"id\")) {\n return Dropzone.options[camelize(element.getAttribute(\"id\"))];\n } else {\n return undefined;\n }\n};\n\n\n// Holds a list of all dropzone instances\nDropzone.instances = [];\n\n// Returns the dropzone for given element if any\nDropzone.forElement = function (element) {\n if (typeof element === \"string\") {\n element = document.querySelector(element);\n }\n if ((element != null ? element.dropzone : undefined) == null) {\n throw new Error(\"No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.\");\n }\n return element.dropzone;\n};\n\n\n// Set to false if you don't want Dropzone to automatically find and attach to .dropzone elements.\nDropzone.autoDiscover = true;\n\n// Looks for all .dropzone elements and creates a dropzone for them\nDropzone.discover = function () {\n let dropzones;\n if (document.querySelectorAll) {\n dropzones = document.querySelectorAll(\".dropzone\");\n } else {\n dropzones = [];\n // IE :(\n let checkElements = elements =>\n (() => {\n let result = [];\n for (let el of elements) {\n if (/(^| )dropzone($| )/.test(el.className)) {\n result.push(dropzones.push(el));\n } else {\n result.push(undefined);\n }\n }\n return result;\n })()\n ;\n checkElements(document.getElementsByTagName(\"div\"));\n checkElements(document.getElementsByTagName(\"form\"));\n }\n\n return (() => {\n let result = [];\n for (let dropzone of dropzones) {\n // Create a dropzone unless auto discover has been disabled for specific element\n if (Dropzone.optionsForElement(dropzone) !== false) {\n result.push(new Dropzone(dropzone));\n } else {\n result.push(undefined);\n }\n }\n return result;\n })();\n};\n\n\n// Since the whole Drag'n'Drop API is pretty new, some browsers implement it,\n// but not correctly.\n// So I created a blacklist of userAgents. Yes, yes. Browser sniffing, I know.\n// But what to do when browsers *theoretically* support an API, but crash\n// when using it.\n//\n// This is a list of regular expressions tested against navigator.userAgent\n//\n// ** It should only be used on browser that *do* support the API, but\n// incorrectly **\n//\nDropzone.blacklistedBrowsers = [\n // The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.\n /opera.*(Macintosh|Windows Phone).*version\\/12/i\n];\n\n\n// Checks if the browser is supported\nDropzone.isBrowserSupported = function () {\n let capableBrowser = true;\n\n if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {\n if (!(\"classList\" in document.createElement(\"a\"))) {\n capableBrowser = false;\n } else {\n // The browser supports the API, but may be blacklisted.\n for (let regex of Dropzone.blacklistedBrowsers) {\n if (regex.test(navigator.userAgent)) {\n capableBrowser = false;\n continue;\n }\n }\n }\n } else {\n capableBrowser = false;\n }\n\n return capableBrowser;\n};\n\nDropzone.dataURItoBlob = function (dataURI) {\n // convert base64 to raw binary data held in a string\n // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this\n let byteString = atob(dataURI.split(',')[1]);\n\n // separate out the mime component\n let mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];\n\n // write the bytes of the string to an ArrayBuffer\n let ab = new ArrayBuffer(byteString.length);\n let ia = new Uint8Array(ab);\n for (let i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--) {\n ia[i] = byteString.charCodeAt(i);\n }\n\n // write the ArrayBuffer to a blob\n return new Blob([ab], {type: mimeString});\n};\n\n// Returns an array without the rejected item\nconst without = (list, rejectedItem) => list.filter((item) => item !== rejectedItem).map((item) => item);\n\n// abc-def_ghi -> abcDefGhi\nconst camelize = str => str.replace(/[\\-_](\\w)/g, match => match.charAt(1).toUpperCase());\n\n// Creates an element from string\nDropzone.createElement = function (string) {\n let div = document.createElement(\"div\");\n div.innerHTML = string;\n return div.childNodes[0];\n};\n\n// Tests if given element is inside (or simply is) the container\nDropzone.elementInside = function (element, container) {\n if (element === container) {\n return true;\n } // Coffeescript doesn't support do/while loops\n while ((element = element.parentNode)) {\n if (element === container) {\n return true;\n }\n }\n return false;\n};\n\n\nDropzone.getElement = function (el, name) {\n let element;\n if (typeof el === \"string\") {\n element = document.querySelector(el);\n } else if (el.nodeType != null) {\n element = el;\n }\n if (element == null) {\n throw new Error(`Invalid \\`${name}\\` option provided. Please provide a CSS selector or a plain HTML element.`);\n }\n return element;\n};\n\n\nDropzone.getElements = function (els, name) {\n let el, elements;\n if (els instanceof Array) {\n elements = [];\n try {\n for (el of els) {\n elements.push(this.getElement(el, name));\n }\n } catch (e) {\n elements = null;\n }\n } else if (typeof els === \"string\") {\n elements = [];\n for (el of document.querySelectorAll(els)) {\n elements.push(el);\n }\n } else if (els.nodeType != null) {\n elements = [els];\n }\n\n if ((elements == null) || !elements.length) {\n throw new Error(`Invalid \\`${name}\\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);\n }\n\n return elements;\n};\n\n// Asks the user the question and calls accepted or rejected accordingly\n//\n// The default implementation just uses `window.confirm` and then calls the\n// appropriate callback.\nDropzone.confirm = function (question, accepted, rejected) {\n if (window.confirm(question)) {\n return accepted();\n } else if (rejected != null) {\n return rejected();\n }\n};\n\n// Validates the mime type like this:\n//\n// https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept\nDropzone.isValidFile = function (file, acceptedFiles) {\n if (!acceptedFiles) {\n return true;\n } // If there are no accepted mime types, it's OK\n acceptedFiles = acceptedFiles.split(\",\");\n\n let mimeType = file.type;\n let baseMimeType = mimeType.replace(/\\/.*$/, \"\");\n\n for (let validType of acceptedFiles) {\n validType = validType.trim();\n if (validType.charAt(0) === \".\") {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {\n return true;\n }\n } else if (/\\/\\*$/.test(validType)) {\n // This is something like a image/* mime type\n if (baseMimeType === validType.replace(/\\/.*$/, \"\")) {\n return true;\n }\n } else {\n if (mimeType === validType) {\n return true;\n }\n }\n }\n\n return false;\n};\n\n// Augment jQuery\nif (typeof jQuery !== 'undefined' && jQuery !== null) {\n jQuery.fn.dropzone = function (options) {\n return this.each(function () {\n return new Dropzone(this, options);\n });\n };\n}\n\n\nif (typeof module !== 'undefined' && module !== null) {\n module.exports = Dropzone;\n} else {\n window.Dropzone = Dropzone;\n}\n\n\n// Dropzone file status codes\nDropzone.ADDED = \"added\";\n\nDropzone.QUEUED = \"queued\";\n// For backwards compatibility. Now, if a file is accepted, it's either queued\n// or uploading.\nDropzone.ACCEPTED = Dropzone.QUEUED;\n\nDropzone.UPLOADING = \"uploading\";\nDropzone.PROCESSING = Dropzone.UPLOADING; // alias\n\nDropzone.CANCELED = \"canceled\";\nDropzone.ERROR = \"error\";\nDropzone.SUCCESS = \"success\";\n\n\n/*\n\n Bugfix for iOS 6 and 7\n Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios\n based on the work of https://github.com/stomita/ios-imagefile-megapixel\n\n */\n\n// Detecting vertical squash in loaded image.\n// Fixes a bug which squash image vertically while drawing into canvas for some images.\n// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel\nlet detectVerticalSquash = function (img) {\n let iw = img.naturalWidth;\n let ih = img.naturalHeight;\n let canvas = document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = ih;\n let ctx = canvas.getContext(\"2d\");\n ctx.drawImage(img, 0, 0);\n let {data} = ctx.getImageData(1, 0, 1, ih);\n\n\n // search image edge pixel position in case it is squashed vertically.\n let sy = 0;\n let ey = ih;\n let py = ih;\n while (py > sy) {\n let alpha = data[((py - 1) * 4) + 3];\n\n if (alpha === 0) {\n ey = py;\n } else {\n sy = py;\n }\n\n py = (ey + sy) >> 1;\n }\n let ratio = (py / ih);\n\n if (ratio === 0) {\n return 1;\n } else {\n return ratio;\n }\n};\n\n// A replacement for context.drawImage\n// (args are for source and destination).\nvar drawImageIOSFix = function (ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {\n let vertSquashRatio = detectVerticalSquash(img);\n return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio);\n};\n\n\n// Based on MinifyJpeg\n// Source: http://www.perry.cz/files/ExifRestorer.js\n// http://elicon.blog57.fc2.com/blog-entry-206.html\nclass ExifRestore {\n static initClass() {\n this.KEY_STR = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n }\n\n static encode64(input) {\n let output = '';\n let chr1 = undefined;\n let chr2 = undefined;\n let chr3 = '';\n let enc1 = undefined;\n let enc2 = undefined;\n let enc3 = undefined;\n let enc4 = '';\n let i = 0;\n while (true) {\n chr1 = input[i++];\n chr2 = input[i++];\n chr3 = input[i++];\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n if (isNaN(chr2)) {\n enc3 = (enc4 = 64);\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n output = output + this.KEY_STR.charAt(enc1) + this.KEY_STR.charAt(enc2) + this.KEY_STR.charAt(enc3) + this.KEY_STR.charAt(enc4);\n chr1 = (chr2 = (chr3 = ''));\n enc1 = (enc2 = (enc3 = (enc4 = '')));\n if (!(i < input.length)) {\n break;\n }\n }\n return output;\n }\n\n static restore(origFileBase64, resizedFileBase64) {\n if (!origFileBase64.match('data:image/jpeg;base64,')) {\n return resizedFileBase64;\n }\n let rawImage = this.decode64(origFileBase64.replace('data:image/jpeg;base64,', ''));\n let segments = this.slice2Segments(rawImage);\n let image = this.exifManipulation(resizedFileBase64, segments);\n return `data:image/jpeg;base64,${this.encode64(image)}`;\n }\n\n static exifManipulation(resizedFileBase64, segments) {\n let exifArray = this.getExifArray(segments);\n let newImageArray = this.insertExif(resizedFileBase64, exifArray);\n let aBuffer = new Uint8Array(newImageArray);\n return aBuffer;\n }\n\n static getExifArray(segments) {\n let seg = undefined;\n let x = 0;\n while (x < segments.length) {\n seg = segments[x];\n if ((seg[0] === 255) & (seg[1] === 225)) {\n return seg;\n }\n x++;\n }\n return [];\n }\n\n static insertExif(resizedFileBase64, exifArray) {\n let imageData = resizedFileBase64.replace('data:image/jpeg;base64,', '');\n let buf = this.decode64(imageData);\n let separatePoint = buf.indexOf(255, 3);\n let mae = buf.slice(0, separatePoint);\n let ato = buf.slice(separatePoint);\n let array = mae;\n array = array.concat(exifArray);\n array = array.concat(ato);\n return array;\n }\n\n static slice2Segments(rawImageArray) {\n let head = 0;\n let segments = [];\n while (true) {\n var length;\n if ((rawImageArray[head] === 255) & (rawImageArray[head + 1] === 218)) {\n break;\n }\n if ((rawImageArray[head] === 255) & (rawImageArray[head + 1] === 216)) {\n head += 2;\n } else {\n length = (rawImageArray[head + 2] * 256) + rawImageArray[head + 3];\n let endPoint = head + length + 2;\n let seg = rawImageArray.slice(head, endPoint);\n segments.push(seg);\n head = endPoint;\n }\n if (head > rawImageArray.length) {\n break;\n }\n }\n return segments;\n }\n\n static decode64(input) {\n let output = '';\n let chr1 = undefined;\n let chr2 = undefined;\n let chr3 = '';\n let enc1 = undefined;\n let enc2 = undefined;\n let enc3 = undefined;\n let enc4 = '';\n let i = 0;\n let buf = [];\n // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n let base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n if (base64test.exec(input)) {\n console.warn('There were invalid base64 characters in the input text.\\nValid base64 characters are A-Z, a-z, 0-9, \\'+\\', \\'/\\',and \\'=\\'\\nExpect errors in decoding.');\n }\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n while (true) {\n enc1 = this.KEY_STR.indexOf(input.charAt(i++));\n enc2 = this.KEY_STR.indexOf(input.charAt(i++));\n enc3 = this.KEY_STR.indexOf(input.charAt(i++));\n enc4 = this.KEY_STR.indexOf(input.charAt(i++));\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n buf.push(chr1);\n if (enc3 !== 64) {\n buf.push(chr2);\n }\n if (enc4 !== 64) {\n buf.push(chr3);\n }\n chr1 = (chr2 = (chr3 = ''));\n enc1 = (enc2 = (enc3 = (enc4 = '')));\n if (!(i < input.length)) {\n break;\n }\n }\n return buf;\n }\n}\nExifRestore.initClass();\n\n\n/*\n * contentloaded.js\n *\n * Author: Diego Perini (diego.perini at gmail.com)\n * Summary: cross-browser wrapper for DOMContentLoaded\n * Updated: 20101020\n * License: MIT\n * Version: 1.2\n *\n * URL:\n * http://javascript.nwbox.com/ContentLoaded/\n * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE\n */\n\n// @win window reference\n// @fn function reference\nlet contentLoaded = function (win, fn) {\n let done = false;\n let top = true;\n let doc = win.document;\n let root = doc.documentElement;\n let add = (doc.addEventListener ? \"addEventListener\" : \"attachEvent\");\n let rem = (doc.addEventListener ? \"removeEventListener\" : \"detachEvent\");\n let pre = (doc.addEventListener ? \"\" : \"on\");\n var init = function (e) {\n if ((e.type === \"readystatechange\") && (doc.readyState !== \"complete\")) {\n return;\n }\n ((e.type === \"load\" ? win : doc))[rem](pre + e.type, init, false);\n if (!done && (done = true)) {\n return fn.call(win, e.type || e);\n }\n };\n\n var poll = function () {\n try {\n root.doScroll(\"left\");\n } catch (e) {\n setTimeout(poll, 50);\n return;\n }\n return init(\"poll\");\n };\n\n if (doc.readyState !== \"complete\") {\n if (doc.createEventObject && root.doScroll) {\n try {\n top = !win.frameElement;\n } catch (error) {\n }\n if (top) {\n poll();\n }\n }\n doc[add](pre + \"DOMContentLoaded\", init, false);\n doc[add](pre + \"readystatechange\", init, false);\n return win[add](pre + \"load\", init, false);\n }\n};\n\n\n// As a single function to be able to write tests.\nDropzone._autoDiscoverFunction = function () {\n if (Dropzone.autoDiscover) {\n return Dropzone.discover();\n }\n};\ncontentLoaded(window, Dropzone._autoDiscoverFunction);\n\nfunction __guard__(value, transform) {\n return (typeof value !== 'undefined' && value !== null) ? transform(value) : undefined;\n}\nfunction __guardMethod__(obj, methodName, transform) {\n if (typeof obj !== 'undefined' && obj !== null && typeof obj[methodName] === 'function') {\n return transform(obj, methodName);\n } else {\n return undefined;\n }\n}"],"file":"dropzone.js"} |