voltron-upload 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
 - data/.gitignore +13 -0
 - data/.rspec +2 -0
 - data/.travis.yml +8 -0
 - data/CODE_OF_CONDUCT.md +49 -0
 - data/Gemfile +12 -0
 - data/LICENSE.txt +21 -0
 - data/README.md +166 -0
 - data/Rakefile +6 -0
 - data/app/assets/javascripts/dropzone.js +1769 -0
 - data/app/assets/javascripts/voltron-upload.js +264 -0
 - data/app/assets/stylesheets/dropzone.scss +595 -0
 - data/app/assets/stylesheets/voltron-upload.scss +446 -0
 - data/app/views/voltron/upload/preview/_horizontal_tile.html.erb +18 -0
 - data/app/views/voltron/upload/preview/_progress.html.erb +8 -0
 - data/app/views/voltron/upload/preview/_vertical_tile.html.erb +18 -0
 - data/bin/console +14 -0
 - data/bin/setup +8 -0
 - data/lib/generators/voltron/upload/install/assets_generator.rb +25 -0
 - data/lib/generators/voltron/upload/install/views_generator.rb +21 -0
 - data/lib/generators/voltron/upload/install_generator.rb +57 -0
 - data/lib/voltron/config/upload.rb +18 -0
 - data/lib/voltron/upload/action_dispatch/routes.rb +17 -0
 - data/lib/voltron/upload/action_view/field.rb +152 -0
 - data/lib/voltron/upload/active_record/base.rb +87 -0
 - data/lib/voltron/upload/carrierwave/uploader/base.rb +66 -0
 - data/lib/voltron/upload/engine.rb +20 -0
 - data/lib/voltron/upload/error.rb +20 -0
 - data/lib/voltron/upload/version.rb +5 -0
 - data/lib/voltron/upload.rb +51 -0
 - data/lib/voltron/uploader.rb +58 -0
 - data/voltron-upload.gemspec +34 -0
 - metadata +243 -0
 
| 
         @@ -0,0 +1,1769 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
             
     | 
| 
      
 2 
     | 
    
         
            +
            /*
         
     | 
| 
      
 3 
     | 
    
         
            +
             *
         
     | 
| 
      
 4 
     | 
    
         
            +
             * More info at [www.dropzonejs.com](http://www.dropzonejs.com)
         
     | 
| 
      
 5 
     | 
    
         
            +
             *
         
     | 
| 
      
 6 
     | 
    
         
            +
             * Copyright (c) 2012, Matias Meno
         
     | 
| 
      
 7 
     | 
    
         
            +
             *
         
     | 
| 
      
 8 
     | 
    
         
            +
             * Permission is hereby granted, free of charge, to any person obtaining a copy
         
     | 
| 
      
 9 
     | 
    
         
            +
             * of this software and associated documentation files (the "Software"), to deal
         
     | 
| 
      
 10 
     | 
    
         
            +
             * in the Software without restriction, including without limitation the rights
         
     | 
| 
      
 11 
     | 
    
         
            +
             * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         
     | 
| 
      
 12 
     | 
    
         
            +
             * copies of the Software, and to permit persons to whom the Software is
         
     | 
| 
      
 13 
     | 
    
         
            +
             * furnished to do so, subject to the following conditions:
         
     | 
| 
      
 14 
     | 
    
         
            +
             *
         
     | 
| 
      
 15 
     | 
    
         
            +
             * The above copyright notice and this permission notice shall be included in
         
     | 
| 
      
 16 
     | 
    
         
            +
             * all copies or substantial portions of the Software.
         
     | 
| 
      
 17 
     | 
    
         
            +
             *
         
     | 
| 
      
 18 
     | 
    
         
            +
             * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         
     | 
| 
      
 19 
     | 
    
         
            +
             * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         
     | 
| 
      
 20 
     | 
    
         
            +
             * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         
     | 
| 
      
 21 
     | 
    
         
            +
             * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         
     | 
| 
      
 22 
     | 
    
         
            +
             * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         
     | 
| 
      
 23 
     | 
    
         
            +
             * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         
     | 
| 
      
 24 
     | 
    
         
            +
             * THE SOFTWARE.
         
     | 
| 
      
 25 
     | 
    
         
            +
             *
         
     | 
| 
      
 26 
     | 
    
         
            +
             */
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            (function() {
         
     | 
| 
      
 29 
     | 
    
         
            +
              var Dropzone, Emitter, camelize, contentLoaded, detectVerticalSquash, drawImageIOSFix, noop, without,
         
     | 
| 
      
 30 
     | 
    
         
            +
                __slice = [].slice,
         
     | 
| 
      
 31 
     | 
    
         
            +
                __hasProp = {}.hasOwnProperty,
         
     | 
| 
      
 32 
     | 
    
         
            +
                __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
              noop = function() {};
         
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
              Emitter = (function() {
         
     | 
| 
      
 37 
     | 
    
         
            +
                function Emitter() {}
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
                Emitter.prototype.addEventListener = Emitter.prototype.on;
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                Emitter.prototype.on = function(event, fn) {
         
     | 
| 
      
 42 
     | 
    
         
            +
                  this._callbacks = this._callbacks || {};
         
     | 
| 
      
 43 
     | 
    
         
            +
                  if (!this._callbacks[event]) {
         
     | 
| 
      
 44 
     | 
    
         
            +
                    this._callbacks[event] = [];
         
     | 
| 
      
 45 
     | 
    
         
            +
                  }
         
     | 
| 
      
 46 
     | 
    
         
            +
                  this._callbacks[event].push(fn);
         
     | 
| 
      
 47 
     | 
    
         
            +
                  return this;
         
     | 
| 
      
 48 
     | 
    
         
            +
                };
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                Emitter.prototype.emit = function() {
         
     | 
| 
      
 51 
     | 
    
         
            +
                  var args, callback, callbacks, event, _i, _len;
         
     | 
| 
      
 52 
     | 
    
         
            +
                  event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
         
     | 
| 
      
 53 
     | 
    
         
            +
                  this._callbacks = this._callbacks || {};
         
     | 
| 
      
 54 
     | 
    
         
            +
                  callbacks = this._callbacks[event];
         
     | 
| 
      
 55 
     | 
    
         
            +
                  if (callbacks) {
         
     | 
| 
      
 56 
     | 
    
         
            +
                    for (_i = 0, _len = callbacks.length; _i < _len; _i++) {
         
     | 
| 
      
 57 
     | 
    
         
            +
                      callback = callbacks[_i];
         
     | 
| 
      
 58 
     | 
    
         
            +
                      callback.apply(this, args);
         
     | 
| 
      
 59 
     | 
    
         
            +
                    }
         
     | 
| 
      
 60 
     | 
    
         
            +
                  }
         
     | 
| 
      
 61 
     | 
    
         
            +
                  return this;
         
     | 
| 
      
 62 
     | 
    
         
            +
                };
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                Emitter.prototype.removeListener = Emitter.prototype.off;
         
     | 
| 
      
 65 
     | 
    
         
            +
             
     | 
| 
      
 66 
     | 
    
         
            +
                Emitter.prototype.removeAllListeners = Emitter.prototype.off;
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
                Emitter.prototype.removeEventListener = Emitter.prototype.off;
         
     | 
| 
      
 69 
     | 
    
         
            +
             
     | 
| 
      
 70 
     | 
    
         
            +
                Emitter.prototype.off = function(event, fn) {
         
     | 
| 
      
 71 
     | 
    
         
            +
                  var callback, callbacks, i, _i, _len;
         
     | 
| 
      
 72 
     | 
    
         
            +
                  if (!this._callbacks || arguments.length === 0) {
         
     | 
| 
      
 73 
     | 
    
         
            +
                    this._callbacks = {};
         
     | 
| 
      
 74 
     | 
    
         
            +
                    return this;
         
     | 
| 
      
 75 
     | 
    
         
            +
                  }
         
     | 
| 
      
 76 
     | 
    
         
            +
                  callbacks = this._callbacks[event];
         
     | 
| 
      
 77 
     | 
    
         
            +
                  if (!callbacks) {
         
     | 
| 
      
 78 
     | 
    
         
            +
                    return this;
         
     | 
| 
      
 79 
     | 
    
         
            +
                  }
         
     | 
| 
      
 80 
     | 
    
         
            +
                  if (arguments.length === 1) {
         
     | 
| 
      
 81 
     | 
    
         
            +
                    delete this._callbacks[event];
         
     | 
| 
      
 82 
     | 
    
         
            +
                    return this;
         
     | 
| 
      
 83 
     | 
    
         
            +
                  }
         
     | 
| 
      
 84 
     | 
    
         
            +
                  for (i = _i = 0, _len = callbacks.length; _i < _len; i = ++_i) {
         
     | 
| 
      
 85 
     | 
    
         
            +
                    callback = callbacks[i];
         
     | 
| 
      
 86 
     | 
    
         
            +
                    if (callback === fn) {
         
     | 
| 
      
 87 
     | 
    
         
            +
                      callbacks.splice(i, 1);
         
     | 
| 
      
 88 
     | 
    
         
            +
                      break;
         
     | 
| 
      
 89 
     | 
    
         
            +
                    }
         
     | 
| 
      
 90 
     | 
    
         
            +
                  }
         
     | 
| 
      
 91 
     | 
    
         
            +
                  return this;
         
     | 
| 
      
 92 
     | 
    
         
            +
                };
         
     | 
| 
      
 93 
     | 
    
         
            +
             
     | 
| 
      
 94 
     | 
    
         
            +
                return Emitter;
         
     | 
| 
      
 95 
     | 
    
         
            +
             
     | 
| 
      
 96 
     | 
    
         
            +
              })();
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
              Dropzone = (function(_super) {
         
     | 
| 
      
 99 
     | 
    
         
            +
                var extend, resolveOption;
         
     | 
| 
      
 100 
     | 
    
         
            +
             
     | 
| 
      
 101 
     | 
    
         
            +
                __extends(Dropzone, _super);
         
     | 
| 
      
 102 
     | 
    
         
            +
             
     | 
| 
      
 103 
     | 
    
         
            +
                Dropzone.prototype.Emitter = Emitter;
         
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
      
 106 
     | 
    
         
            +
                /*
         
     | 
| 
      
 107 
     | 
    
         
            +
                This is a list of all available events you can register on a dropzone object.
         
     | 
| 
      
 108 
     | 
    
         
            +
                
         
     | 
| 
      
 109 
     | 
    
         
            +
                You can register an event handler like this:
         
     | 
| 
      
 110 
     | 
    
         
            +
                
         
     | 
| 
      
 111 
     | 
    
         
            +
                    dropzone.on("dragEnter", function() { });
         
     | 
| 
      
 112 
     | 
    
         
            +
                 */
         
     | 
| 
      
 113 
     | 
    
         
            +
             
     | 
| 
      
 114 
     | 
    
         
            +
                Dropzone.prototype.events = ["drop", "dragstart", "dragend", "dragenter", "dragover", "dragleave", "addedfile", "addedfiles", "removedfile", "thumbnail", "error", "errormultiple", "processing", "processingmultiple", "uploadprogress", "totaluploadprogress", "sending", "sendingmultiple", "success", "successmultiple", "canceled", "canceledmultiple", "complete", "completemultiple", "reset", "maxfilesexceeded", "maxfilesreached", "queuecomplete"];
         
     | 
| 
      
 115 
     | 
    
         
            +
             
     | 
| 
      
 116 
     | 
    
         
            +
                Dropzone.prototype.defaultOptions = {
         
     | 
| 
      
 117 
     | 
    
         
            +
                  url: null,
         
     | 
| 
      
 118 
     | 
    
         
            +
                  method: "post",
         
     | 
| 
      
 119 
     | 
    
         
            +
                  withCredentials: false,
         
     | 
| 
      
 120 
     | 
    
         
            +
                  parallelUploads: 2,
         
     | 
| 
      
 121 
     | 
    
         
            +
                  uploadMultiple: false,
         
     | 
| 
      
 122 
     | 
    
         
            +
                  maxFilesize: 256,
         
     | 
| 
      
 123 
     | 
    
         
            +
                  paramName: "file",
         
     | 
| 
      
 124 
     | 
    
         
            +
                  createImageThumbnails: true,
         
     | 
| 
      
 125 
     | 
    
         
            +
                  maxThumbnailFilesize: 10,
         
     | 
| 
      
 126 
     | 
    
         
            +
                  thumbnailWidth: 120,
         
     | 
| 
      
 127 
     | 
    
         
            +
                  thumbnailHeight: 120,
         
     | 
| 
      
 128 
     | 
    
         
            +
                  filesizeBase: 1000,
         
     | 
| 
      
 129 
     | 
    
         
            +
                  maxFiles: null,
         
     | 
| 
      
 130 
     | 
    
         
            +
                  params: {},
         
     | 
| 
      
 131 
     | 
    
         
            +
                  clickable: true,
         
     | 
| 
      
 132 
     | 
    
         
            +
                  ignoreHiddenFiles: true,
         
     | 
| 
      
 133 
     | 
    
         
            +
                  acceptedFiles: null,
         
     | 
| 
      
 134 
     | 
    
         
            +
                  acceptedMimeTypes: null,
         
     | 
| 
      
 135 
     | 
    
         
            +
                  autoProcessQueue: true,
         
     | 
| 
      
 136 
     | 
    
         
            +
                  autoQueue: true,
         
     | 
| 
      
 137 
     | 
    
         
            +
                  addRemoveLinks: false,
         
     | 
| 
      
 138 
     | 
    
         
            +
                  previewsContainer: null,
         
     | 
| 
      
 139 
     | 
    
         
            +
                  hiddenInputContainer: "body",
         
     | 
| 
      
 140 
     | 
    
         
            +
                  capture: null,
         
     | 
| 
      
 141 
     | 
    
         
            +
                  renameFilename: null,
         
     | 
| 
      
 142 
     | 
    
         
            +
                  dictDefaultMessage: "Drop files here to upload",
         
     | 
| 
      
 143 
     | 
    
         
            +
                  dictFallbackMessage: "Your browser does not support drag'n'drop file uploads.",
         
     | 
| 
      
 144 
     | 
    
         
            +
                  dictFallbackText: "Please use the fallback form below to upload your files like in the olden days.",
         
     | 
| 
      
 145 
     | 
    
         
            +
                  dictFileTooBig: "File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",
         
     | 
| 
      
 146 
     | 
    
         
            +
                  dictInvalidFileType: "You can't upload files of this type.",
         
     | 
| 
      
 147 
     | 
    
         
            +
                  dictResponseError: "Server responded with {{statusCode}} code.",
         
     | 
| 
      
 148 
     | 
    
         
            +
                  dictCancelUpload: "Cancel upload",
         
     | 
| 
      
 149 
     | 
    
         
            +
                  dictCancelUploadConfirmation: "Are you sure you want to cancel this upload?",
         
     | 
| 
      
 150 
     | 
    
         
            +
                  dictRemoveFile: "Remove file",
         
     | 
| 
      
 151 
     | 
    
         
            +
                  dictRemoveFileConfirmation: null,
         
     | 
| 
      
 152 
     | 
    
         
            +
                  dictMaxFilesExceeded: "You can not upload any more files.",
         
     | 
| 
      
 153 
     | 
    
         
            +
                  accept: function(file, done) {
         
     | 
| 
      
 154 
     | 
    
         
            +
                    return done();
         
     | 
| 
      
 155 
     | 
    
         
            +
                  },
         
     | 
| 
      
 156 
     | 
    
         
            +
                  init: function() {
         
     | 
| 
      
 157 
     | 
    
         
            +
                    return noop;
         
     | 
| 
      
 158 
     | 
    
         
            +
                  },
         
     | 
| 
      
 159 
     | 
    
         
            +
                  forceFallback: false,
         
     | 
| 
      
 160 
     | 
    
         
            +
                  fallback: function() {
         
     | 
| 
      
 161 
     | 
    
         
            +
                    var child, messageElement, span, _i, _len, _ref;
         
     | 
| 
      
 162 
     | 
    
         
            +
                    this.element.className = "" + this.element.className + " dz-browser-not-supported";
         
     | 
| 
      
 163 
     | 
    
         
            +
                    _ref = this.element.getElementsByTagName("div");
         
     | 
| 
      
 164 
     | 
    
         
            +
                    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 165 
     | 
    
         
            +
                      child = _ref[_i];
         
     | 
| 
      
 166 
     | 
    
         
            +
                      if (/(^| )dz-message($| )/.test(child.className)) {
         
     | 
| 
      
 167 
     | 
    
         
            +
                        messageElement = child;
         
     | 
| 
      
 168 
     | 
    
         
            +
                        child.className = "dz-message";
         
     | 
| 
      
 169 
     | 
    
         
            +
                        continue;
         
     | 
| 
      
 170 
     | 
    
         
            +
                      }
         
     | 
| 
      
 171 
     | 
    
         
            +
                    }
         
     | 
| 
      
 172 
     | 
    
         
            +
                    if (!messageElement) {
         
     | 
| 
      
 173 
     | 
    
         
            +
                      messageElement = Dropzone.createElement("<div class=\"dz-message\"><span></span></div>");
         
     | 
| 
      
 174 
     | 
    
         
            +
                      this.element.appendChild(messageElement);
         
     | 
| 
      
 175 
     | 
    
         
            +
                    }
         
     | 
| 
      
 176 
     | 
    
         
            +
                    span = messageElement.getElementsByTagName("span")[0];
         
     | 
| 
      
 177 
     | 
    
         
            +
                    if (span) {
         
     | 
| 
      
 178 
     | 
    
         
            +
                      if (span.textContent != null) {
         
     | 
| 
      
 179 
     | 
    
         
            +
                        span.textContent = this.options.dictFallbackMessage;
         
     | 
| 
      
 180 
     | 
    
         
            +
                      } else if (span.innerText != null) {
         
     | 
| 
      
 181 
     | 
    
         
            +
                        span.innerText = this.options.dictFallbackMessage;
         
     | 
| 
      
 182 
     | 
    
         
            +
                      }
         
     | 
| 
      
 183 
     | 
    
         
            +
                    }
         
     | 
| 
      
 184 
     | 
    
         
            +
                    return this.element.appendChild(this.getFallbackForm());
         
     | 
| 
      
 185 
     | 
    
         
            +
                  },
         
     | 
| 
      
 186 
     | 
    
         
            +
                  resize: function(file) {
         
     | 
| 
      
 187 
     | 
    
         
            +
                    var info, srcRatio, trgRatio;
         
     | 
| 
      
 188 
     | 
    
         
            +
                    info = {
         
     | 
| 
      
 189 
     | 
    
         
            +
                      srcX: 0,
         
     | 
| 
      
 190 
     | 
    
         
            +
                      srcY: 0,
         
     | 
| 
      
 191 
     | 
    
         
            +
                      srcWidth: file.width,
         
     | 
| 
      
 192 
     | 
    
         
            +
                      srcHeight: file.height
         
     | 
| 
      
 193 
     | 
    
         
            +
                    };
         
     | 
| 
      
 194 
     | 
    
         
            +
                    srcRatio = file.width / file.height;
         
     | 
| 
      
 195 
     | 
    
         
            +
                    info.optWidth = this.options.thumbnailWidth;
         
     | 
| 
      
 196 
     | 
    
         
            +
                    info.optHeight = this.options.thumbnailHeight;
         
     | 
| 
      
 197 
     | 
    
         
            +
                    if ((info.optWidth == null) && (info.optHeight == null)) {
         
     | 
| 
      
 198 
     | 
    
         
            +
                      info.optWidth = info.srcWidth;
         
     | 
| 
      
 199 
     | 
    
         
            +
                      info.optHeight = info.srcHeight;
         
     | 
| 
      
 200 
     | 
    
         
            +
                    } else if (info.optWidth == null) {
         
     | 
| 
      
 201 
     | 
    
         
            +
                      info.optWidth = srcRatio * info.optHeight;
         
     | 
| 
      
 202 
     | 
    
         
            +
                    } else if (info.optHeight == null) {
         
     | 
| 
      
 203 
     | 
    
         
            +
                      info.optHeight = (1 / srcRatio) * info.optWidth;
         
     | 
| 
      
 204 
     | 
    
         
            +
                    }
         
     | 
| 
      
 205 
     | 
    
         
            +
                    trgRatio = info.optWidth / info.optHeight;
         
     | 
| 
      
 206 
     | 
    
         
            +
                    if (file.height < info.optHeight || file.width < info.optWidth) {
         
     | 
| 
      
 207 
     | 
    
         
            +
                      info.trgHeight = info.srcHeight;
         
     | 
| 
      
 208 
     | 
    
         
            +
                      info.trgWidth = info.srcWidth;
         
     | 
| 
      
 209 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 210 
     | 
    
         
            +
                      if (srcRatio > trgRatio) {
         
     | 
| 
      
 211 
     | 
    
         
            +
                        info.srcHeight = file.height;
         
     | 
| 
      
 212 
     | 
    
         
            +
                        info.srcWidth = info.srcHeight * trgRatio;
         
     | 
| 
      
 213 
     | 
    
         
            +
                      } else {
         
     | 
| 
      
 214 
     | 
    
         
            +
                        info.srcWidth = file.width;
         
     | 
| 
      
 215 
     | 
    
         
            +
                        info.srcHeight = info.srcWidth / trgRatio;
         
     | 
| 
      
 216 
     | 
    
         
            +
                      }
         
     | 
| 
      
 217 
     | 
    
         
            +
                    }
         
     | 
| 
      
 218 
     | 
    
         
            +
                    info.srcX = (file.width - info.srcWidth) / 2;
         
     | 
| 
      
 219 
     | 
    
         
            +
                    info.srcY = (file.height - info.srcHeight) / 2;
         
     | 
| 
      
 220 
     | 
    
         
            +
                    return info;
         
     | 
| 
      
 221 
     | 
    
         
            +
                  },
         
     | 
| 
      
 222 
     | 
    
         
            +
             
     | 
| 
      
 223 
     | 
    
         
            +
                  /*
         
     | 
| 
      
 224 
     | 
    
         
            +
                  Those functions register themselves to the events on init and handle all
         
     | 
| 
      
 225 
     | 
    
         
            +
                  the user interface specific stuff. Overwriting them won't break the upload
         
     | 
| 
      
 226 
     | 
    
         
            +
                  but can break the way it's displayed.
         
     | 
| 
      
 227 
     | 
    
         
            +
                  You can overwrite them if you don't like the default behavior. If you just
         
     | 
| 
      
 228 
     | 
    
         
            +
                  want to add an additional event handler, register it on the dropzone object
         
     | 
| 
      
 229 
     | 
    
         
            +
                  and don't overwrite those options.
         
     | 
| 
      
 230 
     | 
    
         
            +
                   */
         
     | 
| 
      
 231 
     | 
    
         
            +
                  drop: function(e) {
         
     | 
| 
      
 232 
     | 
    
         
            +
                    return this.element.classList.remove("dz-drag-hover");
         
     | 
| 
      
 233 
     | 
    
         
            +
                  },
         
     | 
| 
      
 234 
     | 
    
         
            +
                  dragstart: noop,
         
     | 
| 
      
 235 
     | 
    
         
            +
                  dragend: function(e) {
         
     | 
| 
      
 236 
     | 
    
         
            +
                    return this.element.classList.remove("dz-drag-hover");
         
     | 
| 
      
 237 
     | 
    
         
            +
                  },
         
     | 
| 
      
 238 
     | 
    
         
            +
                  dragenter: function(e) {
         
     | 
| 
      
 239 
     | 
    
         
            +
                    return this.element.classList.add("dz-drag-hover");
         
     | 
| 
      
 240 
     | 
    
         
            +
                  },
         
     | 
| 
      
 241 
     | 
    
         
            +
                  dragover: function(e) {
         
     | 
| 
      
 242 
     | 
    
         
            +
                    return this.element.classList.add("dz-drag-hover");
         
     | 
| 
      
 243 
     | 
    
         
            +
                  },
         
     | 
| 
      
 244 
     | 
    
         
            +
                  dragleave: function(e) {
         
     | 
| 
      
 245 
     | 
    
         
            +
                    return this.element.classList.remove("dz-drag-hover");
         
     | 
| 
      
 246 
     | 
    
         
            +
                  },
         
     | 
| 
      
 247 
     | 
    
         
            +
                  paste: noop,
         
     | 
| 
      
 248 
     | 
    
         
            +
                  reset: function() {
         
     | 
| 
      
 249 
     | 
    
         
            +
                    return this.element.classList.remove("dz-started");
         
     | 
| 
      
 250 
     | 
    
         
            +
                  },
         
     | 
| 
      
 251 
     | 
    
         
            +
                  addedfile: function(file) {
         
     | 
| 
      
 252 
     | 
    
         
            +
                    var node, removeFileEvent, removeLink, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _results;
         
     | 
| 
      
 253 
     | 
    
         
            +
                    if (this.element === this.previewsContainer) {
         
     | 
| 
      
 254 
     | 
    
         
            +
                      this.element.classList.add("dz-started");
         
     | 
| 
      
 255 
     | 
    
         
            +
                    }
         
     | 
| 
      
 256 
     | 
    
         
            +
                    if (this.previewsContainer) {
         
     | 
| 
      
 257 
     | 
    
         
            +
                      file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim());
         
     | 
| 
      
 258 
     | 
    
         
            +
                      file.previewTemplate = file.previewElement;
         
     | 
| 
      
 259 
     | 
    
         
            +
                      this.previewsContainer.appendChild(file.previewElement);
         
     | 
| 
      
 260 
     | 
    
         
            +
                      _ref = file.previewElement.querySelectorAll("[data-dz-name]");
         
     | 
| 
      
 261 
     | 
    
         
            +
                      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 262 
     | 
    
         
            +
                        node = _ref[_i];
         
     | 
| 
      
 263 
     | 
    
         
            +
                        node.textContent = this._renameFilename(file.name);
         
     | 
| 
      
 264 
     | 
    
         
            +
                      }
         
     | 
| 
      
 265 
     | 
    
         
            +
                      _ref1 = file.previewElement.querySelectorAll("[data-dz-size]");
         
     | 
| 
      
 266 
     | 
    
         
            +
                      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
         
     | 
| 
      
 267 
     | 
    
         
            +
                        node = _ref1[_j];
         
     | 
| 
      
 268 
     | 
    
         
            +
                        node.innerHTML = this.filesize(file.size);
         
     | 
| 
      
 269 
     | 
    
         
            +
                      }
         
     | 
| 
      
 270 
     | 
    
         
            +
                      if (this.options.addRemoveLinks) {
         
     | 
| 
      
 271 
     | 
    
         
            +
                        file._removeLink = Dropzone.createElement("<a class=\"dz-remove\" href=\"javascript:undefined;\" data-dz-remove>" + this.options.dictRemoveFile + "</a>");
         
     | 
| 
      
 272 
     | 
    
         
            +
                        file.previewElement.appendChild(file._removeLink);
         
     | 
| 
      
 273 
     | 
    
         
            +
                      }
         
     | 
| 
      
 274 
     | 
    
         
            +
             
     | 
| 
      
 275 
     | 
    
         
            +
                      file._removeLink = file._removeLink || file.previewElement.querySelector('.dz-remove');
         
     | 
| 
      
 276 
     | 
    
         
            +
                      removeFileEvent = (function(_this) {
         
     | 
| 
      
 277 
     | 
    
         
            +
                        return function(e) {
         
     | 
| 
      
 278 
     | 
    
         
            +
                          e.preventDefault();
         
     | 
| 
      
 279 
     | 
    
         
            +
                          e.stopPropagation();
         
     | 
| 
      
 280 
     | 
    
         
            +
                          if (file.status === Dropzone.UPLOADING) {
         
     | 
| 
      
 281 
     | 
    
         
            +
                            return Dropzone.confirm(_this.options.dictCancelUploadConfirmation, function() {
         
     | 
| 
      
 282 
     | 
    
         
            +
                              return _this.removeFile(file);
         
     | 
| 
      
 283 
     | 
    
         
            +
                            });
         
     | 
| 
      
 284 
     | 
    
         
            +
                          } else {
         
     | 
| 
      
 285 
     | 
    
         
            +
                            if (_this.options.dictRemoveFileConfirmation) {
         
     | 
| 
      
 286 
     | 
    
         
            +
                              return Dropzone.confirm(_this.options.dictRemoveFileConfirmation, function() {
         
     | 
| 
      
 287 
     | 
    
         
            +
                                return _this.removeFile(file);
         
     | 
| 
      
 288 
     | 
    
         
            +
                              });
         
     | 
| 
      
 289 
     | 
    
         
            +
                            } else {
         
     | 
| 
      
 290 
     | 
    
         
            +
                              return _this.removeFile(file);
         
     | 
| 
      
 291 
     | 
    
         
            +
                            }
         
     | 
| 
      
 292 
     | 
    
         
            +
                          }
         
     | 
| 
      
 293 
     | 
    
         
            +
                        };
         
     | 
| 
      
 294 
     | 
    
         
            +
                      })(this);
         
     | 
| 
      
 295 
     | 
    
         
            +
                      _ref2 = file.previewElement.querySelectorAll("[data-dz-remove]");
         
     | 
| 
      
 296 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 297 
     | 
    
         
            +
                      for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
         
     | 
| 
      
 298 
     | 
    
         
            +
                        removeLink = _ref2[_k];
         
     | 
| 
      
 299 
     | 
    
         
            +
                        _results.push(removeLink.addEventListener("click", removeFileEvent));
         
     | 
| 
      
 300 
     | 
    
         
            +
                      }
         
     | 
| 
      
 301 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 302 
     | 
    
         
            +
                    }
         
     | 
| 
      
 303 
     | 
    
         
            +
                  },
         
     | 
| 
      
 304 
     | 
    
         
            +
                  removedfile: function(file) {
         
     | 
| 
      
 305 
     | 
    
         
            +
                    var _ref;
         
     | 
| 
      
 306 
     | 
    
         
            +
                    if (file.previewElement) {
         
     | 
| 
      
 307 
     | 
    
         
            +
                      if ((_ref = file.previewElement) != null) {
         
     | 
| 
      
 308 
     | 
    
         
            +
                        _ref.parentNode.removeChild(file.previewElement);
         
     | 
| 
      
 309 
     | 
    
         
            +
                      }
         
     | 
| 
      
 310 
     | 
    
         
            +
                    }
         
     | 
| 
      
 311 
     | 
    
         
            +
                    return this._updateMaxFilesReachedClass();
         
     | 
| 
      
 312 
     | 
    
         
            +
                  },
         
     | 
| 
      
 313 
     | 
    
         
            +
                  thumbnail: function(file, dataUrl) {
         
     | 
| 
      
 314 
     | 
    
         
            +
                    var thumbnailElement, _i, _len, _ref;
         
     | 
| 
      
 315 
     | 
    
         
            +
                    if (file.previewElement) {
         
     | 
| 
      
 316 
     | 
    
         
            +
                      file.previewElement.classList.remove("dz-file-preview");
         
     | 
| 
      
 317 
     | 
    
         
            +
                      _ref = file.previewElement.querySelectorAll("[data-dz-thumbnail]");
         
     | 
| 
      
 318 
     | 
    
         
            +
                      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 319 
     | 
    
         
            +
                        thumbnailElement = _ref[_i];
         
     | 
| 
      
 320 
     | 
    
         
            +
                        thumbnailElement.alt = file.name;
         
     | 
| 
      
 321 
     | 
    
         
            +
                        thumbnailElement.src = dataUrl;
         
     | 
| 
      
 322 
     | 
    
         
            +
                      }
         
     | 
| 
      
 323 
     | 
    
         
            +
                      return setTimeout(((function(_this) {
         
     | 
| 
      
 324 
     | 
    
         
            +
                        return function() {
         
     | 
| 
      
 325 
     | 
    
         
            +
                          return file.previewElement.classList.add("dz-image-preview");
         
     | 
| 
      
 326 
     | 
    
         
            +
                        };
         
     | 
| 
      
 327 
     | 
    
         
            +
                      })(this)), 1);
         
     | 
| 
      
 328 
     | 
    
         
            +
                    }
         
     | 
| 
      
 329 
     | 
    
         
            +
                  },
         
     | 
| 
      
 330 
     | 
    
         
            +
                  error: function(file, message) {
         
     | 
| 
      
 331 
     | 
    
         
            +
                    var node, _i, _len, _ref, _results;
         
     | 
| 
      
 332 
     | 
    
         
            +
                    if (file.previewElement) {
         
     | 
| 
      
 333 
     | 
    
         
            +
                      file.previewElement.classList.add("dz-error");
         
     | 
| 
      
 334 
     | 
    
         
            +
                      if (typeof message !== "String" && message.error) {
         
     | 
| 
      
 335 
     | 
    
         
            +
                        message = message.error;
         
     | 
| 
      
 336 
     | 
    
         
            +
                      }
         
     | 
| 
      
 337 
     | 
    
         
            +
                      _ref = file.previewElement.querySelectorAll("[data-dz-errormessage]");
         
     | 
| 
      
 338 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 339 
     | 
    
         
            +
                      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 340 
     | 
    
         
            +
                        node = _ref[_i];
         
     | 
| 
      
 341 
     | 
    
         
            +
                        _results.push(node.textContent = message);
         
     | 
| 
      
 342 
     | 
    
         
            +
                      }
         
     | 
| 
      
 343 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 344 
     | 
    
         
            +
                    }
         
     | 
| 
      
 345 
     | 
    
         
            +
                  },
         
     | 
| 
      
 346 
     | 
    
         
            +
                  errormultiple: noop,
         
     | 
| 
      
 347 
     | 
    
         
            +
                  processing: function(file) {
         
     | 
| 
      
 348 
     | 
    
         
            +
                    if (file.previewElement) {
         
     | 
| 
      
 349 
     | 
    
         
            +
                      file.previewElement.classList.add("dz-processing");
         
     | 
| 
      
 350 
     | 
    
         
            +
                      if (file._removeLink) {
         
     | 
| 
      
 351 
     | 
    
         
            +
                        return file._removeLink.textContent = this.options.dictCancelUpload;
         
     | 
| 
      
 352 
     | 
    
         
            +
                      }
         
     | 
| 
      
 353 
     | 
    
         
            +
                    }
         
     | 
| 
      
 354 
     | 
    
         
            +
                  },
         
     | 
| 
      
 355 
     | 
    
         
            +
                  processingmultiple: noop,
         
     | 
| 
      
 356 
     | 
    
         
            +
                  uploadprogress: function(file, progress, bytesSent) {
         
     | 
| 
      
 357 
     | 
    
         
            +
                    var node, _i, _len, _ref, _results;
         
     | 
| 
      
 358 
     | 
    
         
            +
                    if (file.previewElement) {
         
     | 
| 
      
 359 
     | 
    
         
            +
                      _ref = file.previewElement.querySelectorAll("[data-dz-uploadprogress]");
         
     | 
| 
      
 360 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 361 
     | 
    
         
            +
                      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 362 
     | 
    
         
            +
                        node = _ref[_i];
         
     | 
| 
      
 363 
     | 
    
         
            +
                        if (node.nodeName === 'PROGRESS') {
         
     | 
| 
      
 364 
     | 
    
         
            +
                          _results.push(node.value = progress);
         
     | 
| 
      
 365 
     | 
    
         
            +
                        } else {
         
     | 
| 
      
 366 
     | 
    
         
            +
                          _results.push(node.style.width = "" + progress + "%");
         
     | 
| 
      
 367 
     | 
    
         
            +
                        }
         
     | 
| 
      
 368 
     | 
    
         
            +
                      }
         
     | 
| 
      
 369 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 370 
     | 
    
         
            +
                    }
         
     | 
| 
      
 371 
     | 
    
         
            +
                  },
         
     | 
| 
      
 372 
     | 
    
         
            +
                  totaluploadprogress: noop,
         
     | 
| 
      
 373 
     | 
    
         
            +
                  sending: noop,
         
     | 
| 
      
 374 
     | 
    
         
            +
                  sendingmultiple: noop,
         
     | 
| 
      
 375 
     | 
    
         
            +
                  success: function(file) {
         
     | 
| 
      
 376 
     | 
    
         
            +
                    if (file.previewElement) {
         
     | 
| 
      
 377 
     | 
    
         
            +
                      return file.previewElement.classList.add("dz-success");
         
     | 
| 
      
 378 
     | 
    
         
            +
                    }
         
     | 
| 
      
 379 
     | 
    
         
            +
                  },
         
     | 
| 
      
 380 
     | 
    
         
            +
                  successmultiple: noop,
         
     | 
| 
      
 381 
     | 
    
         
            +
                  canceled: function(file) {
         
     | 
| 
      
 382 
     | 
    
         
            +
                    return this.emit("error", file, "Upload canceled.");
         
     | 
| 
      
 383 
     | 
    
         
            +
                  },
         
     | 
| 
      
 384 
     | 
    
         
            +
                  canceledmultiple: noop,
         
     | 
| 
      
 385 
     | 
    
         
            +
                  complete: function(file) {
         
     | 
| 
      
 386 
     | 
    
         
            +
                    if (file._removeLink) {
         
     | 
| 
      
 387 
     | 
    
         
            +
                      file._removeLink.textContent = this.options.dictRemoveFile;
         
     | 
| 
      
 388 
     | 
    
         
            +
                    }
         
     | 
| 
      
 389 
     | 
    
         
            +
                    if (file.previewElement) {
         
     | 
| 
      
 390 
     | 
    
         
            +
                      return file.previewElement.classList.add("dz-complete");
         
     | 
| 
      
 391 
     | 
    
         
            +
                    }
         
     | 
| 
      
 392 
     | 
    
         
            +
                  },
         
     | 
| 
      
 393 
     | 
    
         
            +
                  completemultiple: noop,
         
     | 
| 
      
 394 
     | 
    
         
            +
                  maxfilesexceeded: noop,
         
     | 
| 
      
 395 
     | 
    
         
            +
                  maxfilesreached: noop,
         
     | 
| 
      
 396 
     | 
    
         
            +
                  queuecomplete: noop,
         
     | 
| 
      
 397 
     | 
    
         
            +
                  addedfiles: noop,
         
     | 
| 
      
 398 
     | 
    
         
            +
                  previewTemplate: "<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>"
         
     | 
| 
      
 399 
     | 
    
         
            +
                };
         
     | 
| 
      
 400 
     | 
    
         
            +
             
     | 
| 
      
 401 
     | 
    
         
            +
                extend = function() {
         
     | 
| 
      
 402 
     | 
    
         
            +
                  var key, object, objects, target, val, _i, _len;
         
     | 
| 
      
 403 
     | 
    
         
            +
                  target = arguments[0], objects = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
         
     | 
| 
      
 404 
     | 
    
         
            +
                  for (_i = 0, _len = objects.length; _i < _len; _i++) {
         
     | 
| 
      
 405 
     | 
    
         
            +
                    object = objects[_i];
         
     | 
| 
      
 406 
     | 
    
         
            +
                    for (key in object) {
         
     | 
| 
      
 407 
     | 
    
         
            +
                      val = object[key];
         
     | 
| 
      
 408 
     | 
    
         
            +
                      target[key] = val;
         
     | 
| 
      
 409 
     | 
    
         
            +
                    }
         
     | 
| 
      
 410 
     | 
    
         
            +
                  }
         
     | 
| 
      
 411 
     | 
    
         
            +
                  return target;
         
     | 
| 
      
 412 
     | 
    
         
            +
                };
         
     | 
| 
      
 413 
     | 
    
         
            +
             
     | 
| 
      
 414 
     | 
    
         
            +
                function Dropzone(element, options) {
         
     | 
| 
      
 415 
     | 
    
         
            +
                  var elementOptions, fallback, _ref;
         
     | 
| 
      
 416 
     | 
    
         
            +
                  this.element = element;
         
     | 
| 
      
 417 
     | 
    
         
            +
                  this.version = Dropzone.version;
         
     | 
| 
      
 418 
     | 
    
         
            +
                  this.defaultOptions.previewTemplate = this.defaultOptions.previewTemplate.replace(/\n*/g, "");
         
     | 
| 
      
 419 
     | 
    
         
            +
                  this.clickableElements = [];
         
     | 
| 
      
 420 
     | 
    
         
            +
                  this.listeners = [];
         
     | 
| 
      
 421 
     | 
    
         
            +
                  this.files = [];
         
     | 
| 
      
 422 
     | 
    
         
            +
                  if (typeof this.element === "string") {
         
     | 
| 
      
 423 
     | 
    
         
            +
                    this.element = document.querySelector(this.element);
         
     | 
| 
      
 424 
     | 
    
         
            +
                  }
         
     | 
| 
      
 425 
     | 
    
         
            +
                  if (!(this.element && (this.element.nodeType != null))) {
         
     | 
| 
      
 426 
     | 
    
         
            +
                    throw new Error("Invalid dropzone element.");
         
     | 
| 
      
 427 
     | 
    
         
            +
                  }
         
     | 
| 
      
 428 
     | 
    
         
            +
                  if (this.element.dropzone) {
         
     | 
| 
      
 429 
     | 
    
         
            +
                    throw new Error("Dropzone already attached.");
         
     | 
| 
      
 430 
     | 
    
         
            +
                  }
         
     | 
| 
      
 431 
     | 
    
         
            +
                  Dropzone.instances.push(this);
         
     | 
| 
      
 432 
     | 
    
         
            +
                  this.element.dropzone = this;
         
     | 
| 
      
 433 
     | 
    
         
            +
                  elementOptions = (_ref = Dropzone.optionsForElement(this.element)) != null ? _ref : {};
         
     | 
| 
      
 434 
     | 
    
         
            +
                  this.options = extend({}, this.defaultOptions, elementOptions, options != null ? options : {});
         
     | 
| 
      
 435 
     | 
    
         
            +
                  if (this.options.forceFallback || !Dropzone.isBrowserSupported()) {
         
     | 
| 
      
 436 
     | 
    
         
            +
                    return this.options.fallback.call(this);
         
     | 
| 
      
 437 
     | 
    
         
            +
                  }
         
     | 
| 
      
 438 
     | 
    
         
            +
                  if (this.options.url == null) {
         
     | 
| 
      
 439 
     | 
    
         
            +
                    this.options.url = this.element.getAttribute("action");
         
     | 
| 
      
 440 
     | 
    
         
            +
                  }
         
     | 
| 
      
 441 
     | 
    
         
            +
                  if (!this.options.url) {
         
     | 
| 
      
 442 
     | 
    
         
            +
                    throw new Error("No URL provided.");
         
     | 
| 
      
 443 
     | 
    
         
            +
                  }
         
     | 
| 
      
 444 
     | 
    
         
            +
                  if (this.options.acceptedFiles && this.options.acceptedMimeTypes) {
         
     | 
| 
      
 445 
     | 
    
         
            +
                    throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");
         
     | 
| 
      
 446 
     | 
    
         
            +
                  }
         
     | 
| 
      
 447 
     | 
    
         
            +
                  if (this.options.acceptedMimeTypes) {
         
     | 
| 
      
 448 
     | 
    
         
            +
                    this.options.acceptedFiles = this.options.acceptedMimeTypes;
         
     | 
| 
      
 449 
     | 
    
         
            +
                    delete this.options.acceptedMimeTypes;
         
     | 
| 
      
 450 
     | 
    
         
            +
                  }
         
     | 
| 
      
 451 
     | 
    
         
            +
                  this.options.method = this.options.method.toUpperCase();
         
     | 
| 
      
 452 
     | 
    
         
            +
                  if ((fallback = this.getExistingFallback()) && fallback.parentNode) {
         
     | 
| 
      
 453 
     | 
    
         
            +
                    fallback.parentNode.removeChild(fallback);
         
     | 
| 
      
 454 
     | 
    
         
            +
                  }
         
     | 
| 
      
 455 
     | 
    
         
            +
                  if (this.options.previewsContainer !== false) {
         
     | 
| 
      
 456 
     | 
    
         
            +
                    if (this.options.previewsContainer) {
         
     | 
| 
      
 457 
     | 
    
         
            +
                      this.previewsContainer = Dropzone.getElement(this.options.previewsContainer, "previewsContainer");
         
     | 
| 
      
 458 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 459 
     | 
    
         
            +
                      this.previewsContainer = this.element;
         
     | 
| 
      
 460 
     | 
    
         
            +
                    }
         
     | 
| 
      
 461 
     | 
    
         
            +
                  }
         
     | 
| 
      
 462 
     | 
    
         
            +
                  if (this.options.clickable) {
         
     | 
| 
      
 463 
     | 
    
         
            +
                    if (this.options.clickable === true) {
         
     | 
| 
      
 464 
     | 
    
         
            +
                      this.clickableElements = [this.element];
         
     | 
| 
      
 465 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 466 
     | 
    
         
            +
                      this.clickableElements = Dropzone.getElements(this.options.clickable, "clickable");
         
     | 
| 
      
 467 
     | 
    
         
            +
                    }
         
     | 
| 
      
 468 
     | 
    
         
            +
                  }
         
     | 
| 
      
 469 
     | 
    
         
            +
                  this.init();
         
     | 
| 
      
 470 
     | 
    
         
            +
                }
         
     | 
| 
      
 471 
     | 
    
         
            +
             
     | 
| 
      
 472 
     | 
    
         
            +
                Dropzone.prototype.getAcceptedFiles = function() {
         
     | 
| 
      
 473 
     | 
    
         
            +
                  var file, _i, _len, _ref, _results;
         
     | 
| 
      
 474 
     | 
    
         
            +
                  _ref = this.files;
         
     | 
| 
      
 475 
     | 
    
         
            +
                  _results = [];
         
     | 
| 
      
 476 
     | 
    
         
            +
                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 477 
     | 
    
         
            +
                    file = _ref[_i];
         
     | 
| 
      
 478 
     | 
    
         
            +
                    if (file.accepted) {
         
     | 
| 
      
 479 
     | 
    
         
            +
                      _results.push(file);
         
     | 
| 
      
 480 
     | 
    
         
            +
                    }
         
     | 
| 
      
 481 
     | 
    
         
            +
                  }
         
     | 
| 
      
 482 
     | 
    
         
            +
                  return _results;
         
     | 
| 
      
 483 
     | 
    
         
            +
                };
         
     | 
| 
      
 484 
     | 
    
         
            +
             
     | 
| 
      
 485 
     | 
    
         
            +
                Dropzone.prototype.getRejectedFiles = function() {
         
     | 
| 
      
 486 
     | 
    
         
            +
                  var file, _i, _len, _ref, _results;
         
     | 
| 
      
 487 
     | 
    
         
            +
                  _ref = this.files;
         
     | 
| 
      
 488 
     | 
    
         
            +
                  _results = [];
         
     | 
| 
      
 489 
     | 
    
         
            +
                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 490 
     | 
    
         
            +
                    file = _ref[_i];
         
     | 
| 
      
 491 
     | 
    
         
            +
                    if (!file.accepted) {
         
     | 
| 
      
 492 
     | 
    
         
            +
                      _results.push(file);
         
     | 
| 
      
 493 
     | 
    
         
            +
                    }
         
     | 
| 
      
 494 
     | 
    
         
            +
                  }
         
     | 
| 
      
 495 
     | 
    
         
            +
                  return _results;
         
     | 
| 
      
 496 
     | 
    
         
            +
                };
         
     | 
| 
      
 497 
     | 
    
         
            +
             
     | 
| 
      
 498 
     | 
    
         
            +
                Dropzone.prototype.getFilesWithStatus = function(status) {
         
     | 
| 
      
 499 
     | 
    
         
            +
                  var file, _i, _len, _ref, _results;
         
     | 
| 
      
 500 
     | 
    
         
            +
                  _ref = this.files;
         
     | 
| 
      
 501 
     | 
    
         
            +
                  _results = [];
         
     | 
| 
      
 502 
     | 
    
         
            +
                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 503 
     | 
    
         
            +
                    file = _ref[_i];
         
     | 
| 
      
 504 
     | 
    
         
            +
                    if (file.status === status) {
         
     | 
| 
      
 505 
     | 
    
         
            +
                      _results.push(file);
         
     | 
| 
      
 506 
     | 
    
         
            +
                    }
         
     | 
| 
      
 507 
     | 
    
         
            +
                  }
         
     | 
| 
      
 508 
     | 
    
         
            +
                  return _results;
         
     | 
| 
      
 509 
     | 
    
         
            +
                };
         
     | 
| 
      
 510 
     | 
    
         
            +
             
     | 
| 
      
 511 
     | 
    
         
            +
                Dropzone.prototype.getQueuedFiles = function() {
         
     | 
| 
      
 512 
     | 
    
         
            +
                  return this.getFilesWithStatus(Dropzone.QUEUED);
         
     | 
| 
      
 513 
     | 
    
         
            +
                };
         
     | 
| 
      
 514 
     | 
    
         
            +
             
     | 
| 
      
 515 
     | 
    
         
            +
                Dropzone.prototype.getUploadingFiles = function() {
         
     | 
| 
      
 516 
     | 
    
         
            +
                  return this.getFilesWithStatus(Dropzone.UPLOADING);
         
     | 
| 
      
 517 
     | 
    
         
            +
                };
         
     | 
| 
      
 518 
     | 
    
         
            +
             
     | 
| 
      
 519 
     | 
    
         
            +
                Dropzone.prototype.getAddedFiles = function() {
         
     | 
| 
      
 520 
     | 
    
         
            +
                  return this.getFilesWithStatus(Dropzone.ADDED);
         
     | 
| 
      
 521 
     | 
    
         
            +
                };
         
     | 
| 
      
 522 
     | 
    
         
            +
             
     | 
| 
      
 523 
     | 
    
         
            +
                Dropzone.prototype.getActiveFiles = function() {
         
     | 
| 
      
 524 
     | 
    
         
            +
                  var file, _i, _len, _ref, _results;
         
     | 
| 
      
 525 
     | 
    
         
            +
                  _ref = this.files;
         
     | 
| 
      
 526 
     | 
    
         
            +
                  _results = [];
         
     | 
| 
      
 527 
     | 
    
         
            +
                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 528 
     | 
    
         
            +
                    file = _ref[_i];
         
     | 
| 
      
 529 
     | 
    
         
            +
                    if (file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED) {
         
     | 
| 
      
 530 
     | 
    
         
            +
                      _results.push(file);
         
     | 
| 
      
 531 
     | 
    
         
            +
                    }
         
     | 
| 
      
 532 
     | 
    
         
            +
                  }
         
     | 
| 
      
 533 
     | 
    
         
            +
                  return _results;
         
     | 
| 
      
 534 
     | 
    
         
            +
                };
         
     | 
| 
      
 535 
     | 
    
         
            +
             
     | 
| 
      
 536 
     | 
    
         
            +
                Dropzone.prototype.init = function() {
         
     | 
| 
      
 537 
     | 
    
         
            +
                  var eventName, noPropagation, setupHiddenFileInput, _i, _len, _ref, _ref1;
         
     | 
| 
      
 538 
     | 
    
         
            +
                  if (this.element.tagName === "form") {
         
     | 
| 
      
 539 
     | 
    
         
            +
                    this.element.setAttribute("enctype", "multipart/form-data");
         
     | 
| 
      
 540 
     | 
    
         
            +
                  }
         
     | 
| 
      
 541 
     | 
    
         
            +
                  if (this.element.classList.contains("dropzone") && !this.element.querySelector(".dz-message")) {
         
     | 
| 
      
 542 
     | 
    
         
            +
                    this.element.appendChild(Dropzone.createElement("<div class=\"dz-default dz-message\"><span>" + this.options.dictDefaultMessage + "</span></div>"));
         
     | 
| 
      
 543 
     | 
    
         
            +
                  }
         
     | 
| 
      
 544 
     | 
    
         
            +
                  if (this.clickableElements.length) {
         
     | 
| 
      
 545 
     | 
    
         
            +
                    setupHiddenFileInput = (function(_this) {
         
     | 
| 
      
 546 
     | 
    
         
            +
                      return function() {
         
     | 
| 
      
 547 
     | 
    
         
            +
                        if (_this.hiddenFileInput) {
         
     | 
| 
      
 548 
     | 
    
         
            +
                          _this.hiddenFileInput.parentNode.removeChild(_this.hiddenFileInput);
         
     | 
| 
      
 549 
     | 
    
         
            +
                        }
         
     | 
| 
      
 550 
     | 
    
         
            +
                        _this.hiddenFileInput = document.createElement("input");
         
     | 
| 
      
 551 
     | 
    
         
            +
                        _this.hiddenFileInput.setAttribute("type", "file");
         
     | 
| 
      
 552 
     | 
    
         
            +
                        if ((_this.options.maxFiles == null) || _this.options.maxFiles > 1) {
         
     | 
| 
      
 553 
     | 
    
         
            +
                          _this.hiddenFileInput.setAttribute("multiple", "multiple");
         
     | 
| 
      
 554 
     | 
    
         
            +
                        }
         
     | 
| 
      
 555 
     | 
    
         
            +
                        _this.hiddenFileInput.className = "dz-hidden-input";
         
     | 
| 
      
 556 
     | 
    
         
            +
                        if (_this.options.acceptedFiles != null) {
         
     | 
| 
      
 557 
     | 
    
         
            +
                          _this.hiddenFileInput.setAttribute("accept", _this.options.acceptedFiles);
         
     | 
| 
      
 558 
     | 
    
         
            +
                        }
         
     | 
| 
      
 559 
     | 
    
         
            +
                        if (_this.options.capture != null) {
         
     | 
| 
      
 560 
     | 
    
         
            +
                          _this.hiddenFileInput.setAttribute("capture", _this.options.capture);
         
     | 
| 
      
 561 
     | 
    
         
            +
                        }
         
     | 
| 
      
 562 
     | 
    
         
            +
                        _this.hiddenFileInput.style.visibility = "hidden";
         
     | 
| 
      
 563 
     | 
    
         
            +
                        _this.hiddenFileInput.style.position = "absolute";
         
     | 
| 
      
 564 
     | 
    
         
            +
                        _this.hiddenFileInput.style.top = "0";
         
     | 
| 
      
 565 
     | 
    
         
            +
                        _this.hiddenFileInput.style.left = "0";
         
     | 
| 
      
 566 
     | 
    
         
            +
                        _this.hiddenFileInput.style.height = "0";
         
     | 
| 
      
 567 
     | 
    
         
            +
                        _this.hiddenFileInput.style.width = "0";
         
     | 
| 
      
 568 
     | 
    
         
            +
                        document.querySelector(_this.options.hiddenInputContainer).appendChild(_this.hiddenFileInput);
         
     | 
| 
      
 569 
     | 
    
         
            +
                        return _this.hiddenFileInput.addEventListener("change", function() {
         
     | 
| 
      
 570 
     | 
    
         
            +
                          var file, files, _i, _len;
         
     | 
| 
      
 571 
     | 
    
         
            +
                          files = _this.hiddenFileInput.files;
         
     | 
| 
      
 572 
     | 
    
         
            +
                          if (files.length) {
         
     | 
| 
      
 573 
     | 
    
         
            +
                            for (_i = 0, _len = files.length; _i < _len; _i++) {
         
     | 
| 
      
 574 
     | 
    
         
            +
                              file = files[_i];
         
     | 
| 
      
 575 
     | 
    
         
            +
                              _this.addFile(file);
         
     | 
| 
      
 576 
     | 
    
         
            +
                            }
         
     | 
| 
      
 577 
     | 
    
         
            +
                          }
         
     | 
| 
      
 578 
     | 
    
         
            +
                          _this.emit("addedfiles", files);
         
     | 
| 
      
 579 
     | 
    
         
            +
                          return setupHiddenFileInput();
         
     | 
| 
      
 580 
     | 
    
         
            +
                        });
         
     | 
| 
      
 581 
     | 
    
         
            +
                      };
         
     | 
| 
      
 582 
     | 
    
         
            +
                    })(this);
         
     | 
| 
      
 583 
     | 
    
         
            +
                    setupHiddenFileInput();
         
     | 
| 
      
 584 
     | 
    
         
            +
                  }
         
     | 
| 
      
 585 
     | 
    
         
            +
                  this.URL = (_ref = window.URL) != null ? _ref : window.webkitURL;
         
     | 
| 
      
 586 
     | 
    
         
            +
                  _ref1 = this.events;
         
     | 
| 
      
 587 
     | 
    
         
            +
                  for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
         
     | 
| 
      
 588 
     | 
    
         
            +
                    eventName = _ref1[_i];
         
     | 
| 
      
 589 
     | 
    
         
            +
                    this.on(eventName, this.options[eventName]);
         
     | 
| 
      
 590 
     | 
    
         
            +
                  }
         
     | 
| 
      
 591 
     | 
    
         
            +
                  this.on("uploadprogress", (function(_this) {
         
     | 
| 
      
 592 
     | 
    
         
            +
                    return function() {
         
     | 
| 
      
 593 
     | 
    
         
            +
                      return _this.updateTotalUploadProgress();
         
     | 
| 
      
 594 
     | 
    
         
            +
                    };
         
     | 
| 
      
 595 
     | 
    
         
            +
                  })(this));
         
     | 
| 
      
 596 
     | 
    
         
            +
                  this.on("removedfile", (function(_this) {
         
     | 
| 
      
 597 
     | 
    
         
            +
                    return function() {
         
     | 
| 
      
 598 
     | 
    
         
            +
                      return _this.updateTotalUploadProgress();
         
     | 
| 
      
 599 
     | 
    
         
            +
                    };
         
     | 
| 
      
 600 
     | 
    
         
            +
                  })(this));
         
     | 
| 
      
 601 
     | 
    
         
            +
                  this.on("canceled", (function(_this) {
         
     | 
| 
      
 602 
     | 
    
         
            +
                    return function(file) {
         
     | 
| 
      
 603 
     | 
    
         
            +
                      return _this.emit("complete", file);
         
     | 
| 
      
 604 
     | 
    
         
            +
                    };
         
     | 
| 
      
 605 
     | 
    
         
            +
                  })(this));
         
     | 
| 
      
 606 
     | 
    
         
            +
                  this.on("complete", (function(_this) {
         
     | 
| 
      
 607 
     | 
    
         
            +
                    return function(file) {
         
     | 
| 
      
 608 
     | 
    
         
            +
                      if (_this.getAddedFiles().length === 0 && _this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) {
         
     | 
| 
      
 609 
     | 
    
         
            +
                        return setTimeout((function() {
         
     | 
| 
      
 610 
     | 
    
         
            +
                          return _this.emit("queuecomplete");
         
     | 
| 
      
 611 
     | 
    
         
            +
                        }), 0);
         
     | 
| 
      
 612 
     | 
    
         
            +
                      }
         
     | 
| 
      
 613 
     | 
    
         
            +
                    };
         
     | 
| 
      
 614 
     | 
    
         
            +
                  })(this));
         
     | 
| 
      
 615 
     | 
    
         
            +
                  noPropagation = function(e) {
         
     | 
| 
      
 616 
     | 
    
         
            +
                    e.stopPropagation();
         
     | 
| 
      
 617 
     | 
    
         
            +
                    if (e.preventDefault) {
         
     | 
| 
      
 618 
     | 
    
         
            +
                      return e.preventDefault();
         
     | 
| 
      
 619 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 620 
     | 
    
         
            +
                      return e.returnValue = false;
         
     | 
| 
      
 621 
     | 
    
         
            +
                    }
         
     | 
| 
      
 622 
     | 
    
         
            +
                  };
         
     | 
| 
      
 623 
     | 
    
         
            +
                  this.listeners = [
         
     | 
| 
      
 624 
     | 
    
         
            +
                    {
         
     | 
| 
      
 625 
     | 
    
         
            +
                      element: this.element,
         
     | 
| 
      
 626 
     | 
    
         
            +
                      events: {
         
     | 
| 
      
 627 
     | 
    
         
            +
                        "dragstart": (function(_this) {
         
     | 
| 
      
 628 
     | 
    
         
            +
                          return function(e) {
         
     | 
| 
      
 629 
     | 
    
         
            +
                            return _this.emit("dragstart", e);
         
     | 
| 
      
 630 
     | 
    
         
            +
                          };
         
     | 
| 
      
 631 
     | 
    
         
            +
                        })(this),
         
     | 
| 
      
 632 
     | 
    
         
            +
                        "dragenter": (function(_this) {
         
     | 
| 
      
 633 
     | 
    
         
            +
                          return function(e) {
         
     | 
| 
      
 634 
     | 
    
         
            +
                            noPropagation(e);
         
     | 
| 
      
 635 
     | 
    
         
            +
                            return _this.emit("dragenter", e);
         
     | 
| 
      
 636 
     | 
    
         
            +
                          };
         
     | 
| 
      
 637 
     | 
    
         
            +
                        })(this),
         
     | 
| 
      
 638 
     | 
    
         
            +
                        "dragover": (function(_this) {
         
     | 
| 
      
 639 
     | 
    
         
            +
                          return function(e) {
         
     | 
| 
      
 640 
     | 
    
         
            +
                            var efct;
         
     | 
| 
      
 641 
     | 
    
         
            +
                            try {
         
     | 
| 
      
 642 
     | 
    
         
            +
                              efct = e.dataTransfer.effectAllowed;
         
     | 
| 
      
 643 
     | 
    
         
            +
                            } catch (_error) {}
         
     | 
| 
      
 644 
     | 
    
         
            +
                            e.dataTransfer.dropEffect = 'move' === efct || 'linkMove' === efct ? 'move' : 'copy';
         
     | 
| 
      
 645 
     | 
    
         
            +
                            noPropagation(e);
         
     | 
| 
      
 646 
     | 
    
         
            +
                            return _this.emit("dragover", e);
         
     | 
| 
      
 647 
     | 
    
         
            +
                          };
         
     | 
| 
      
 648 
     | 
    
         
            +
                        })(this),
         
     | 
| 
      
 649 
     | 
    
         
            +
                        "dragleave": (function(_this) {
         
     | 
| 
      
 650 
     | 
    
         
            +
                          return function(e) {
         
     | 
| 
      
 651 
     | 
    
         
            +
                            return _this.emit("dragleave", e);
         
     | 
| 
      
 652 
     | 
    
         
            +
                          };
         
     | 
| 
      
 653 
     | 
    
         
            +
                        })(this),
         
     | 
| 
      
 654 
     | 
    
         
            +
                        "drop": (function(_this) {
         
     | 
| 
      
 655 
     | 
    
         
            +
                          return function(e) {
         
     | 
| 
      
 656 
     | 
    
         
            +
                            noPropagation(e);
         
     | 
| 
      
 657 
     | 
    
         
            +
                            return _this.drop(e);
         
     | 
| 
      
 658 
     | 
    
         
            +
                          };
         
     | 
| 
      
 659 
     | 
    
         
            +
                        })(this),
         
     | 
| 
      
 660 
     | 
    
         
            +
                        "dragend": (function(_this) {
         
     | 
| 
      
 661 
     | 
    
         
            +
                          return function(e) {
         
     | 
| 
      
 662 
     | 
    
         
            +
                            return _this.emit("dragend", e);
         
     | 
| 
      
 663 
     | 
    
         
            +
                          };
         
     | 
| 
      
 664 
     | 
    
         
            +
                        })(this)
         
     | 
| 
      
 665 
     | 
    
         
            +
                      }
         
     | 
| 
      
 666 
     | 
    
         
            +
                    }
         
     | 
| 
      
 667 
     | 
    
         
            +
                  ];
         
     | 
| 
      
 668 
     | 
    
         
            +
                  this.clickableElements.forEach((function(_this) {
         
     | 
| 
      
 669 
     | 
    
         
            +
                    return function(clickableElement) {
         
     | 
| 
      
 670 
     | 
    
         
            +
                      return _this.listeners.push({
         
     | 
| 
      
 671 
     | 
    
         
            +
                        element: clickableElement,
         
     | 
| 
      
 672 
     | 
    
         
            +
                        events: {
         
     | 
| 
      
 673 
     | 
    
         
            +
                          "click": function(evt) {
         
     | 
| 
      
 674 
     | 
    
         
            +
                            if ((clickableElement !== _this.element) || (evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(".dz-message")))) {
         
     | 
| 
      
 675 
     | 
    
         
            +
                              _this.hiddenFileInput.click();
         
     | 
| 
      
 676 
     | 
    
         
            +
                            }
         
     | 
| 
      
 677 
     | 
    
         
            +
                            return true;
         
     | 
| 
      
 678 
     | 
    
         
            +
                          }
         
     | 
| 
      
 679 
     | 
    
         
            +
                        }
         
     | 
| 
      
 680 
     | 
    
         
            +
                      });
         
     | 
| 
      
 681 
     | 
    
         
            +
                    };
         
     | 
| 
      
 682 
     | 
    
         
            +
                  })(this));
         
     | 
| 
      
 683 
     | 
    
         
            +
                  this.enable();
         
     | 
| 
      
 684 
     | 
    
         
            +
                  return this.options.init.call(this);
         
     | 
| 
      
 685 
     | 
    
         
            +
                };
         
     | 
| 
      
 686 
     | 
    
         
            +
             
     | 
| 
      
 687 
     | 
    
         
            +
                Dropzone.prototype.destroy = function() {
         
     | 
| 
      
 688 
     | 
    
         
            +
                  var _ref;
         
     | 
| 
      
 689 
     | 
    
         
            +
                  this.disable();
         
     | 
| 
      
 690 
     | 
    
         
            +
                  this.removeAllFiles(true);
         
     | 
| 
      
 691 
     | 
    
         
            +
                  if ((_ref = this.hiddenFileInput) != null ? _ref.parentNode : void 0) {
         
     | 
| 
      
 692 
     | 
    
         
            +
                    this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);
         
     | 
| 
      
 693 
     | 
    
         
            +
                    this.hiddenFileInput = null;
         
     | 
| 
      
 694 
     | 
    
         
            +
                  }
         
     | 
| 
      
 695 
     | 
    
         
            +
                  delete this.element.dropzone;
         
     | 
| 
      
 696 
     | 
    
         
            +
                  return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1);
         
     | 
| 
      
 697 
     | 
    
         
            +
                };
         
     | 
| 
      
 698 
     | 
    
         
            +
             
     | 
| 
      
 699 
     | 
    
         
            +
                Dropzone.prototype.updateTotalUploadProgress = function() {
         
     | 
| 
      
 700 
     | 
    
         
            +
                  var activeFiles, file, totalBytes, totalBytesSent, totalUploadProgress, _i, _len, _ref;
         
     | 
| 
      
 701 
     | 
    
         
            +
                  totalBytesSent = 0;
         
     | 
| 
      
 702 
     | 
    
         
            +
                  totalBytes = 0;
         
     | 
| 
      
 703 
     | 
    
         
            +
                  activeFiles = this.getActiveFiles();
         
     | 
| 
      
 704 
     | 
    
         
            +
                  if (activeFiles.length) {
         
     | 
| 
      
 705 
     | 
    
         
            +
                    _ref = this.getActiveFiles();
         
     | 
| 
      
 706 
     | 
    
         
            +
                    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 707 
     | 
    
         
            +
                      file = _ref[_i];
         
     | 
| 
      
 708 
     | 
    
         
            +
                      totalBytesSent += file.upload.bytesSent;
         
     | 
| 
      
 709 
     | 
    
         
            +
                      totalBytes += file.upload.total;
         
     | 
| 
      
 710 
     | 
    
         
            +
                    }
         
     | 
| 
      
 711 
     | 
    
         
            +
                    totalUploadProgress = 100 * totalBytesSent / totalBytes;
         
     | 
| 
      
 712 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 713 
     | 
    
         
            +
                    totalUploadProgress = 100;
         
     | 
| 
      
 714 
     | 
    
         
            +
                  }
         
     | 
| 
      
 715 
     | 
    
         
            +
                  return this.emit("totaluploadprogress", totalUploadProgress, totalBytes, totalBytesSent);
         
     | 
| 
      
 716 
     | 
    
         
            +
                };
         
     | 
| 
      
 717 
     | 
    
         
            +
             
     | 
| 
      
 718 
     | 
    
         
            +
                Dropzone.prototype._getParamName = function(n) {
         
     | 
| 
      
 719 
     | 
    
         
            +
                  if (typeof this.options.paramName === "function") {
         
     | 
| 
      
 720 
     | 
    
         
            +
                    return this.options.paramName(n);
         
     | 
| 
      
 721 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 722 
     | 
    
         
            +
                    return "" + this.options.paramName + (this.options.uploadMultiple ? "[" + n + "]" : "");
         
     | 
| 
      
 723 
     | 
    
         
            +
                  }
         
     | 
| 
      
 724 
     | 
    
         
            +
                };
         
     | 
| 
      
 725 
     | 
    
         
            +
             
     | 
| 
      
 726 
     | 
    
         
            +
                Dropzone.prototype._renameFilename = function(name) {
         
     | 
| 
      
 727 
     | 
    
         
            +
                  if (typeof this.options.renameFilename !== "function") {
         
     | 
| 
      
 728 
     | 
    
         
            +
                    return name;
         
     | 
| 
      
 729 
     | 
    
         
            +
                  }
         
     | 
| 
      
 730 
     | 
    
         
            +
                  return this.options.renameFilename(name);
         
     | 
| 
      
 731 
     | 
    
         
            +
                };
         
     | 
| 
      
 732 
     | 
    
         
            +
             
     | 
| 
      
 733 
     | 
    
         
            +
                Dropzone.prototype.getFallbackForm = function() {
         
     | 
| 
      
 734 
     | 
    
         
            +
                  var existingFallback, fields, fieldsString, form;
         
     | 
| 
      
 735 
     | 
    
         
            +
                  if (existingFallback = this.getExistingFallback()) {
         
     | 
| 
      
 736 
     | 
    
         
            +
                    return existingFallback;
         
     | 
| 
      
 737 
     | 
    
         
            +
                  }
         
     | 
| 
      
 738 
     | 
    
         
            +
                  fieldsString = "<div class=\"dz-fallback\">";
         
     | 
| 
      
 739 
     | 
    
         
            +
                  if (this.options.dictFallbackText) {
         
     | 
| 
      
 740 
     | 
    
         
            +
                    fieldsString += "<p>" + this.options.dictFallbackText + "</p>";
         
     | 
| 
      
 741 
     | 
    
         
            +
                  }
         
     | 
| 
      
 742 
     | 
    
         
            +
                  fieldsString += "<input type=\"file\" name=\"" + (this._getParamName(0)) + "\" " + (this.options.uploadMultiple ? 'multiple="multiple"' : void 0) + " /><input type=\"submit\" value=\"Upload!\"></div>";
         
     | 
| 
      
 743 
     | 
    
         
            +
                  fields = Dropzone.createElement(fieldsString);
         
     | 
| 
      
 744 
     | 
    
         
            +
                  if (this.element.tagName !== "FORM") {
         
     | 
| 
      
 745 
     | 
    
         
            +
                    form = Dropzone.createElement("<form action=\"" + this.options.url + "\" enctype=\"multipart/form-data\" method=\"" + this.options.method + "\"></form>");
         
     | 
| 
      
 746 
     | 
    
         
            +
                    form.appendChild(fields);
         
     | 
| 
      
 747 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 748 
     | 
    
         
            +
                    this.element.setAttribute("enctype", "multipart/form-data");
         
     | 
| 
      
 749 
     | 
    
         
            +
                    this.element.setAttribute("method", this.options.method);
         
     | 
| 
      
 750 
     | 
    
         
            +
                  }
         
     | 
| 
      
 751 
     | 
    
         
            +
                  return form != null ? form : fields;
         
     | 
| 
      
 752 
     | 
    
         
            +
                };
         
     | 
| 
      
 753 
     | 
    
         
            +
             
     | 
| 
      
 754 
     | 
    
         
            +
                Dropzone.prototype.getExistingFallback = function() {
         
     | 
| 
      
 755 
     | 
    
         
            +
                  var fallback, getFallback, tagName, _i, _len, _ref;
         
     | 
| 
      
 756 
     | 
    
         
            +
                  getFallback = function(elements) {
         
     | 
| 
      
 757 
     | 
    
         
            +
                    var el, _i, _len;
         
     | 
| 
      
 758 
     | 
    
         
            +
                    for (_i = 0, _len = elements.length; _i < _len; _i++) {
         
     | 
| 
      
 759 
     | 
    
         
            +
                      el = elements[_i];
         
     | 
| 
      
 760 
     | 
    
         
            +
                      if (/(^| )fallback($| )/.test(el.className)) {
         
     | 
| 
      
 761 
     | 
    
         
            +
                        return el;
         
     | 
| 
      
 762 
     | 
    
         
            +
                      }
         
     | 
| 
      
 763 
     | 
    
         
            +
                    }
         
     | 
| 
      
 764 
     | 
    
         
            +
                  };
         
     | 
| 
      
 765 
     | 
    
         
            +
                  _ref = ["div", "form"];
         
     | 
| 
      
 766 
     | 
    
         
            +
                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 767 
     | 
    
         
            +
                    tagName = _ref[_i];
         
     | 
| 
      
 768 
     | 
    
         
            +
                    if (fallback = getFallback(this.element.getElementsByTagName(tagName))) {
         
     | 
| 
      
 769 
     | 
    
         
            +
                      return fallback;
         
     | 
| 
      
 770 
     | 
    
         
            +
                    }
         
     | 
| 
      
 771 
     | 
    
         
            +
                  }
         
     | 
| 
      
 772 
     | 
    
         
            +
                };
         
     | 
| 
      
 773 
     | 
    
         
            +
             
     | 
| 
      
 774 
     | 
    
         
            +
                Dropzone.prototype.setupEventListeners = function() {
         
     | 
| 
      
 775 
     | 
    
         
            +
                  var elementListeners, event, listener, _i, _len, _ref, _results;
         
     | 
| 
      
 776 
     | 
    
         
            +
                  _ref = this.listeners;
         
     | 
| 
      
 777 
     | 
    
         
            +
                  _results = [];
         
     | 
| 
      
 778 
     | 
    
         
            +
                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 779 
     | 
    
         
            +
                    elementListeners = _ref[_i];
         
     | 
| 
      
 780 
     | 
    
         
            +
                    _results.push((function() {
         
     | 
| 
      
 781 
     | 
    
         
            +
                      var _ref1, _results1;
         
     | 
| 
      
 782 
     | 
    
         
            +
                      _ref1 = elementListeners.events;
         
     | 
| 
      
 783 
     | 
    
         
            +
                      _results1 = [];
         
     | 
| 
      
 784 
     | 
    
         
            +
                      for (event in _ref1) {
         
     | 
| 
      
 785 
     | 
    
         
            +
                        listener = _ref1[event];
         
     | 
| 
      
 786 
     | 
    
         
            +
                        _results1.push(elementListeners.element.addEventListener(event, listener, false));
         
     | 
| 
      
 787 
     | 
    
         
            +
                      }
         
     | 
| 
      
 788 
     | 
    
         
            +
                      return _results1;
         
     | 
| 
      
 789 
     | 
    
         
            +
                    })());
         
     | 
| 
      
 790 
     | 
    
         
            +
                  }
         
     | 
| 
      
 791 
     | 
    
         
            +
                  return _results;
         
     | 
| 
      
 792 
     | 
    
         
            +
                };
         
     | 
| 
      
 793 
     | 
    
         
            +
             
     | 
| 
      
 794 
     | 
    
         
            +
                Dropzone.prototype.removeEventListeners = function() {
         
     | 
| 
      
 795 
     | 
    
         
            +
                  var elementListeners, event, listener, _i, _len, _ref, _results;
         
     | 
| 
      
 796 
     | 
    
         
            +
                  _ref = this.listeners;
         
     | 
| 
      
 797 
     | 
    
         
            +
                  _results = [];
         
     | 
| 
      
 798 
     | 
    
         
            +
                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 799 
     | 
    
         
            +
                    elementListeners = _ref[_i];
         
     | 
| 
      
 800 
     | 
    
         
            +
                    _results.push((function() {
         
     | 
| 
      
 801 
     | 
    
         
            +
                      var _ref1, _results1;
         
     | 
| 
      
 802 
     | 
    
         
            +
                      _ref1 = elementListeners.events;
         
     | 
| 
      
 803 
     | 
    
         
            +
                      _results1 = [];
         
     | 
| 
      
 804 
     | 
    
         
            +
                      for (event in _ref1) {
         
     | 
| 
      
 805 
     | 
    
         
            +
                        listener = _ref1[event];
         
     | 
| 
      
 806 
     | 
    
         
            +
                        _results1.push(elementListeners.element.removeEventListener(event, listener, false));
         
     | 
| 
      
 807 
     | 
    
         
            +
                      }
         
     | 
| 
      
 808 
     | 
    
         
            +
                      return _results1;
         
     | 
| 
      
 809 
     | 
    
         
            +
                    })());
         
     | 
| 
      
 810 
     | 
    
         
            +
                  }
         
     | 
| 
      
 811 
     | 
    
         
            +
                  return _results;
         
     | 
| 
      
 812 
     | 
    
         
            +
                };
         
     | 
| 
      
 813 
     | 
    
         
            +
             
     | 
| 
      
 814 
     | 
    
         
            +
                Dropzone.prototype.disable = function() {
         
     | 
| 
      
 815 
     | 
    
         
            +
                  var file, _i, _len, _ref, _results;
         
     | 
| 
      
 816 
     | 
    
         
            +
                  this.clickableElements.forEach(function(element) {
         
     | 
| 
      
 817 
     | 
    
         
            +
                    return element.classList.remove("dz-clickable");
         
     | 
| 
      
 818 
     | 
    
         
            +
                  });
         
     | 
| 
      
 819 
     | 
    
         
            +
                  this.removeEventListeners();
         
     | 
| 
      
 820 
     | 
    
         
            +
                  _ref = this.files;
         
     | 
| 
      
 821 
     | 
    
         
            +
                  _results = [];
         
     | 
| 
      
 822 
     | 
    
         
            +
                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 823 
     | 
    
         
            +
                    file = _ref[_i];
         
     | 
| 
      
 824 
     | 
    
         
            +
                    _results.push(this.cancelUpload(file));
         
     | 
| 
      
 825 
     | 
    
         
            +
                  }
         
     | 
| 
      
 826 
     | 
    
         
            +
                  return _results;
         
     | 
| 
      
 827 
     | 
    
         
            +
                };
         
     | 
| 
      
 828 
     | 
    
         
            +
             
     | 
| 
      
 829 
     | 
    
         
            +
                Dropzone.prototype.enable = function() {
         
     | 
| 
      
 830 
     | 
    
         
            +
                  this.clickableElements.forEach(function(element) {
         
     | 
| 
      
 831 
     | 
    
         
            +
                    return element.classList.add("dz-clickable");
         
     | 
| 
      
 832 
     | 
    
         
            +
                  });
         
     | 
| 
      
 833 
     | 
    
         
            +
                  return this.setupEventListeners();
         
     | 
| 
      
 834 
     | 
    
         
            +
                };
         
     | 
| 
      
 835 
     | 
    
         
            +
             
     | 
| 
      
 836 
     | 
    
         
            +
                Dropzone.prototype.filesize = function(size) {
         
     | 
| 
      
 837 
     | 
    
         
            +
                  var cutoff, i, selectedSize, selectedUnit, unit, units, _i, _len;
         
     | 
| 
      
 838 
     | 
    
         
            +
                  selectedSize = 0;
         
     | 
| 
      
 839 
     | 
    
         
            +
                  selectedUnit = "b";
         
     | 
| 
      
 840 
     | 
    
         
            +
                  if (size > 0) {
         
     | 
| 
      
 841 
     | 
    
         
            +
                    units = ['TB', 'GB', 'MB', 'KB', 'b'];
         
     | 
| 
      
 842 
     | 
    
         
            +
                    for (i = _i = 0, _len = units.length; _i < _len; i = ++_i) {
         
     | 
| 
      
 843 
     | 
    
         
            +
                      unit = units[i];
         
     | 
| 
      
 844 
     | 
    
         
            +
                      cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;
         
     | 
| 
      
 845 
     | 
    
         
            +
                      if (size >= cutoff) {
         
     | 
| 
      
 846 
     | 
    
         
            +
                        selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);
         
     | 
| 
      
 847 
     | 
    
         
            +
                        selectedUnit = unit;
         
     | 
| 
      
 848 
     | 
    
         
            +
                        break;
         
     | 
| 
      
 849 
     | 
    
         
            +
                      }
         
     | 
| 
      
 850 
     | 
    
         
            +
                    }
         
     | 
| 
      
 851 
     | 
    
         
            +
                    selectedSize = Math.round(10 * selectedSize) / 10;
         
     | 
| 
      
 852 
     | 
    
         
            +
                  }
         
     | 
| 
      
 853 
     | 
    
         
            +
                  return "<strong>" + selectedSize + "</strong> " + selectedUnit;
         
     | 
| 
      
 854 
     | 
    
         
            +
                };
         
     | 
| 
      
 855 
     | 
    
         
            +
             
     | 
| 
      
 856 
     | 
    
         
            +
                Dropzone.prototype._updateMaxFilesReachedClass = function() {
         
     | 
| 
      
 857 
     | 
    
         
            +
                  if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) {
         
     | 
| 
      
 858 
     | 
    
         
            +
                    if (this.getAcceptedFiles().length === this.options.maxFiles) {
         
     | 
| 
      
 859 
     | 
    
         
            +
                      this.emit('maxfilesreached', this.files);
         
     | 
| 
      
 860 
     | 
    
         
            +
                    }
         
     | 
| 
      
 861 
     | 
    
         
            +
                    return this.element.classList.add("dz-max-files-reached");
         
     | 
| 
      
 862 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 863 
     | 
    
         
            +
                    return this.element.classList.remove("dz-max-files-reached");
         
     | 
| 
      
 864 
     | 
    
         
            +
                  }
         
     | 
| 
      
 865 
     | 
    
         
            +
                };
         
     | 
| 
      
 866 
     | 
    
         
            +
             
     | 
| 
      
 867 
     | 
    
         
            +
                Dropzone.prototype.drop = function(e) {
         
     | 
| 
      
 868 
     | 
    
         
            +
                  var files, items;
         
     | 
| 
      
 869 
     | 
    
         
            +
                  if (!e.dataTransfer) {
         
     | 
| 
      
 870 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 871 
     | 
    
         
            +
                  }
         
     | 
| 
      
 872 
     | 
    
         
            +
                  this.emit("drop", e);
         
     | 
| 
      
 873 
     | 
    
         
            +
                  files = e.dataTransfer.files;
         
     | 
| 
      
 874 
     | 
    
         
            +
                  this.emit("addedfiles", files);
         
     | 
| 
      
 875 
     | 
    
         
            +
                  if (files.length) {
         
     | 
| 
      
 876 
     | 
    
         
            +
                    items = e.dataTransfer.items;
         
     | 
| 
      
 877 
     | 
    
         
            +
                    if (items && items.length && (items[0].webkitGetAsEntry != null)) {
         
     | 
| 
      
 878 
     | 
    
         
            +
                      this._addFilesFromItems(items);
         
     | 
| 
      
 879 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 880 
     | 
    
         
            +
                      this.handleFiles(files);
         
     | 
| 
      
 881 
     | 
    
         
            +
                    }
         
     | 
| 
      
 882 
     | 
    
         
            +
                  }
         
     | 
| 
      
 883 
     | 
    
         
            +
                };
         
     | 
| 
      
 884 
     | 
    
         
            +
             
     | 
| 
      
 885 
     | 
    
         
            +
                Dropzone.prototype.paste = function(e) {
         
     | 
| 
      
 886 
     | 
    
         
            +
                  var items, _ref;
         
     | 
| 
      
 887 
     | 
    
         
            +
                  if ((e != null ? (_ref = e.clipboardData) != null ? _ref.items : void 0 : void 0) == null) {
         
     | 
| 
      
 888 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 889 
     | 
    
         
            +
                  }
         
     | 
| 
      
 890 
     | 
    
         
            +
                  this.emit("paste", e);
         
     | 
| 
      
 891 
     | 
    
         
            +
                  items = e.clipboardData.items;
         
     | 
| 
      
 892 
     | 
    
         
            +
                  if (items.length) {
         
     | 
| 
      
 893 
     | 
    
         
            +
                    return this._addFilesFromItems(items);
         
     | 
| 
      
 894 
     | 
    
         
            +
                  }
         
     | 
| 
      
 895 
     | 
    
         
            +
                };
         
     | 
| 
      
 896 
     | 
    
         
            +
             
     | 
| 
      
 897 
     | 
    
         
            +
                Dropzone.prototype.handleFiles = function(files) {
         
     | 
| 
      
 898 
     | 
    
         
            +
                  var file, _i, _len, _results;
         
     | 
| 
      
 899 
     | 
    
         
            +
                  _results = [];
         
     | 
| 
      
 900 
     | 
    
         
            +
                  for (_i = 0, _len = files.length; _i < _len; _i++) {
         
     | 
| 
      
 901 
     | 
    
         
            +
                    file = files[_i];
         
     | 
| 
      
 902 
     | 
    
         
            +
                    _results.push(this.addFile(file));
         
     | 
| 
      
 903 
     | 
    
         
            +
                  }
         
     | 
| 
      
 904 
     | 
    
         
            +
                  return _results;
         
     | 
| 
      
 905 
     | 
    
         
            +
                };
         
     | 
| 
      
 906 
     | 
    
         
            +
             
     | 
| 
      
 907 
     | 
    
         
            +
                Dropzone.prototype._addFilesFromItems = function(items) {
         
     | 
| 
      
 908 
     | 
    
         
            +
                  var entry, item, _i, _len, _results;
         
     | 
| 
      
 909 
     | 
    
         
            +
                  _results = [];
         
     | 
| 
      
 910 
     | 
    
         
            +
                  for (_i = 0, _len = items.length; _i < _len; _i++) {
         
     | 
| 
      
 911 
     | 
    
         
            +
                    item = items[_i];
         
     | 
| 
      
 912 
     | 
    
         
            +
                    if ((item.webkitGetAsEntry != null) && (entry = item.webkitGetAsEntry())) {
         
     | 
| 
      
 913 
     | 
    
         
            +
                      if (entry.isFile) {
         
     | 
| 
      
 914 
     | 
    
         
            +
                        _results.push(this.addFile(item.getAsFile()));
         
     | 
| 
      
 915 
     | 
    
         
            +
                      } else if (entry.isDirectory) {
         
     | 
| 
      
 916 
     | 
    
         
            +
                        _results.push(this._addFilesFromDirectory(entry, entry.name));
         
     | 
| 
      
 917 
     | 
    
         
            +
                      } else {
         
     | 
| 
      
 918 
     | 
    
         
            +
                        _results.push(void 0);
         
     | 
| 
      
 919 
     | 
    
         
            +
                      }
         
     | 
| 
      
 920 
     | 
    
         
            +
                    } else if (item.getAsFile != null) {
         
     | 
| 
      
 921 
     | 
    
         
            +
                      if ((item.kind == null) || item.kind === "file") {
         
     | 
| 
      
 922 
     | 
    
         
            +
                        _results.push(this.addFile(item.getAsFile()));
         
     | 
| 
      
 923 
     | 
    
         
            +
                      } else {
         
     | 
| 
      
 924 
     | 
    
         
            +
                        _results.push(void 0);
         
     | 
| 
      
 925 
     | 
    
         
            +
                      }
         
     | 
| 
      
 926 
     | 
    
         
            +
                    } else {
         
     | 
| 
      
 927 
     | 
    
         
            +
                      _results.push(void 0);
         
     | 
| 
      
 928 
     | 
    
         
            +
                    }
         
     | 
| 
      
 929 
     | 
    
         
            +
                  }
         
     | 
| 
      
 930 
     | 
    
         
            +
                  return _results;
         
     | 
| 
      
 931 
     | 
    
         
            +
                };
         
     | 
| 
      
 932 
     | 
    
         
            +
             
     | 
| 
      
 933 
     | 
    
         
            +
                Dropzone.prototype._addFilesFromDirectory = function(directory, path) {
         
     | 
| 
      
 934 
     | 
    
         
            +
                  var dirReader, errorHandler, readEntries;
         
     | 
| 
      
 935 
     | 
    
         
            +
                  dirReader = directory.createReader();
         
     | 
| 
      
 936 
     | 
    
         
            +
                  errorHandler = function(error) {
         
     | 
| 
      
 937 
     | 
    
         
            +
                    return typeof console !== "undefined" && console !== null ? typeof console.log === "function" ? console.log(error) : void 0 : void 0;
         
     | 
| 
      
 938 
     | 
    
         
            +
                  };
         
     | 
| 
      
 939 
     | 
    
         
            +
                  readEntries = (function(_this) {
         
     | 
| 
      
 940 
     | 
    
         
            +
                    return function() {
         
     | 
| 
      
 941 
     | 
    
         
            +
                      return dirReader.readEntries(function(entries) {
         
     | 
| 
      
 942 
     | 
    
         
            +
                        var entry, _i, _len;
         
     | 
| 
      
 943 
     | 
    
         
            +
                        if (entries.length > 0) {
         
     | 
| 
      
 944 
     | 
    
         
            +
                          for (_i = 0, _len = entries.length; _i < _len; _i++) {
         
     | 
| 
      
 945 
     | 
    
         
            +
                            entry = entries[_i];
         
     | 
| 
      
 946 
     | 
    
         
            +
                            if (entry.isFile) {
         
     | 
| 
      
 947 
     | 
    
         
            +
                              entry.file(function(file) {
         
     | 
| 
      
 948 
     | 
    
         
            +
                                if (_this.options.ignoreHiddenFiles && file.name.substring(0, 1) === '.') {
         
     | 
| 
      
 949 
     | 
    
         
            +
                                  return;
         
     | 
| 
      
 950 
     | 
    
         
            +
                                }
         
     | 
| 
      
 951 
     | 
    
         
            +
                                file.fullPath = "" + path + "/" + file.name;
         
     | 
| 
      
 952 
     | 
    
         
            +
                                return _this.addFile(file);
         
     | 
| 
      
 953 
     | 
    
         
            +
                              });
         
     | 
| 
      
 954 
     | 
    
         
            +
                            } else if (entry.isDirectory) {
         
     | 
| 
      
 955 
     | 
    
         
            +
                              _this._addFilesFromDirectory(entry, "" + path + "/" + entry.name);
         
     | 
| 
      
 956 
     | 
    
         
            +
                            }
         
     | 
| 
      
 957 
     | 
    
         
            +
                          }
         
     | 
| 
      
 958 
     | 
    
         
            +
                          readEntries();
         
     | 
| 
      
 959 
     | 
    
         
            +
                        }
         
     | 
| 
      
 960 
     | 
    
         
            +
                        return null;
         
     | 
| 
      
 961 
     | 
    
         
            +
                      }, errorHandler);
         
     | 
| 
      
 962 
     | 
    
         
            +
                    };
         
     | 
| 
      
 963 
     | 
    
         
            +
                  })(this);
         
     | 
| 
      
 964 
     | 
    
         
            +
                  return readEntries();
         
     | 
| 
      
 965 
     | 
    
         
            +
                };
         
     | 
| 
      
 966 
     | 
    
         
            +
             
     | 
| 
      
 967 
     | 
    
         
            +
                Dropzone.prototype.accept = function(file, done) {
         
     | 
| 
      
 968 
     | 
    
         
            +
                  if (file.size > this.options.maxFilesize * 1024 * 1024) {
         
     | 
| 
      
 969 
     | 
    
         
            +
                    return done(this.options.dictFileTooBig.replace("{{filesize}}", Math.round(file.size / 1024 / 10.24) / 100).replace("{{maxFilesize}}", this.options.maxFilesize));
         
     | 
| 
      
 970 
     | 
    
         
            +
                  } else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {
         
     | 
| 
      
 971 
     | 
    
         
            +
                    return done(this.options.dictInvalidFileType);
         
     | 
| 
      
 972 
     | 
    
         
            +
                  } else if ((this.options.maxFiles != null) && this.getAcceptedFiles().length >= this.options.maxFiles) {
         
     | 
| 
      
 973 
     | 
    
         
            +
                    done(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}", this.options.maxFiles));
         
     | 
| 
      
 974 
     | 
    
         
            +
                    return this.emit("maxfilesexceeded", file);
         
     | 
| 
      
 975 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 976 
     | 
    
         
            +
                    return this.options.accept.call(this, file, done);
         
     | 
| 
      
 977 
     | 
    
         
            +
                  }
         
     | 
| 
      
 978 
     | 
    
         
            +
                };
         
     | 
| 
      
 979 
     | 
    
         
            +
             
     | 
| 
      
 980 
     | 
    
         
            +
                Dropzone.prototype.addFile = function(file) {
         
     | 
| 
      
 981 
     | 
    
         
            +
                  file.upload = {
         
     | 
| 
      
 982 
     | 
    
         
            +
                    progress: 0,
         
     | 
| 
      
 983 
     | 
    
         
            +
                    total: file.size,
         
     | 
| 
      
 984 
     | 
    
         
            +
                    bytesSent: 0
         
     | 
| 
      
 985 
     | 
    
         
            +
                  };
         
     | 
| 
      
 986 
     | 
    
         
            +
                  this.files.push(file);
         
     | 
| 
      
 987 
     | 
    
         
            +
                  file.status = Dropzone.ADDED;
         
     | 
| 
      
 988 
     | 
    
         
            +
                  this.emit("addedfile", file);
         
     | 
| 
      
 989 
     | 
    
         
            +
                  this._enqueueThumbnail(file);
         
     | 
| 
      
 990 
     | 
    
         
            +
                  return this.accept(file, (function(_this) {
         
     | 
| 
      
 991 
     | 
    
         
            +
                    return function(error) {
         
     | 
| 
      
 992 
     | 
    
         
            +
                      if (error) {
         
     | 
| 
      
 993 
     | 
    
         
            +
                        file.accepted = false;
         
     | 
| 
      
 994 
     | 
    
         
            +
                        _this._errorProcessing([file], error);
         
     | 
| 
      
 995 
     | 
    
         
            +
                      } else {
         
     | 
| 
      
 996 
     | 
    
         
            +
                        file.accepted = true;
         
     | 
| 
      
 997 
     | 
    
         
            +
                        if (_this.options.autoQueue) {
         
     | 
| 
      
 998 
     | 
    
         
            +
                          _this.enqueueFile(file);
         
     | 
| 
      
 999 
     | 
    
         
            +
                        }
         
     | 
| 
      
 1000 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1001 
     | 
    
         
            +
                      return _this._updateMaxFilesReachedClass();
         
     | 
| 
      
 1002 
     | 
    
         
            +
                    };
         
     | 
| 
      
 1003 
     | 
    
         
            +
                  })(this));
         
     | 
| 
      
 1004 
     | 
    
         
            +
                };
         
     | 
| 
      
 1005 
     | 
    
         
            +
             
     | 
| 
      
 1006 
     | 
    
         
            +
                Dropzone.prototype.enqueueFiles = function(files) {
         
     | 
| 
      
 1007 
     | 
    
         
            +
                  var file, _i, _len;
         
     | 
| 
      
 1008 
     | 
    
         
            +
                  for (_i = 0, _len = files.length; _i < _len; _i++) {
         
     | 
| 
      
 1009 
     | 
    
         
            +
                    file = files[_i];
         
     | 
| 
      
 1010 
     | 
    
         
            +
                    this.enqueueFile(file);
         
     | 
| 
      
 1011 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1012 
     | 
    
         
            +
                  return null;
         
     | 
| 
      
 1013 
     | 
    
         
            +
                };
         
     | 
| 
      
 1014 
     | 
    
         
            +
             
     | 
| 
      
 1015 
     | 
    
         
            +
                Dropzone.prototype.enqueueFile = function(file) {
         
     | 
| 
      
 1016 
     | 
    
         
            +
                  if (file.status === Dropzone.ADDED && file.accepted === true) {
         
     | 
| 
      
 1017 
     | 
    
         
            +
                    file.status = Dropzone.QUEUED;
         
     | 
| 
      
 1018 
     | 
    
         
            +
                    if (this.options.autoProcessQueue) {
         
     | 
| 
      
 1019 
     | 
    
         
            +
                      return setTimeout(((function(_this) {
         
     | 
| 
      
 1020 
     | 
    
         
            +
                        return function() {
         
     | 
| 
      
 1021 
     | 
    
         
            +
                          return _this.processQueue();
         
     | 
| 
      
 1022 
     | 
    
         
            +
                        };
         
     | 
| 
      
 1023 
     | 
    
         
            +
                      })(this)), 0);
         
     | 
| 
      
 1024 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1025 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 1026 
     | 
    
         
            +
                    throw new Error("This file can't be queued because it has already been processed or was rejected.");
         
     | 
| 
      
 1027 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1028 
     | 
    
         
            +
                };
         
     | 
| 
      
 1029 
     | 
    
         
            +
             
     | 
| 
      
 1030 
     | 
    
         
            +
                Dropzone.prototype._thumbnailQueue = [];
         
     | 
| 
      
 1031 
     | 
    
         
            +
             
     | 
| 
      
 1032 
     | 
    
         
            +
                Dropzone.prototype._processingThumbnail = false;
         
     | 
| 
      
 1033 
     | 
    
         
            +
             
     | 
| 
      
 1034 
     | 
    
         
            +
                Dropzone.prototype._enqueueThumbnail = function(file) {
         
     | 
| 
      
 1035 
     | 
    
         
            +
                  if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1024 * 1024) {
         
     | 
| 
      
 1036 
     | 
    
         
            +
                    this._thumbnailQueue.push(file);
         
     | 
| 
      
 1037 
     | 
    
         
            +
                    return setTimeout(((function(_this) {
         
     | 
| 
      
 1038 
     | 
    
         
            +
                      return function() {
         
     | 
| 
      
 1039 
     | 
    
         
            +
                        return _this._processThumbnailQueue();
         
     | 
| 
      
 1040 
     | 
    
         
            +
                      };
         
     | 
| 
      
 1041 
     | 
    
         
            +
                    })(this)), 0);
         
     | 
| 
      
 1042 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1043 
     | 
    
         
            +
                };
         
     | 
| 
      
 1044 
     | 
    
         
            +
             
     | 
| 
      
 1045 
     | 
    
         
            +
                Dropzone.prototype._processThumbnailQueue = function() {
         
     | 
| 
      
 1046 
     | 
    
         
            +
                  if (this._processingThumbnail || this._thumbnailQueue.length === 0) {
         
     | 
| 
      
 1047 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 1048 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1049 
     | 
    
         
            +
                  this._processingThumbnail = true;
         
     | 
| 
      
 1050 
     | 
    
         
            +
                  return this.createThumbnail(this._thumbnailQueue.shift(), (function(_this) {
         
     | 
| 
      
 1051 
     | 
    
         
            +
                    return function() {
         
     | 
| 
      
 1052 
     | 
    
         
            +
                      _this._processingThumbnail = false;
         
     | 
| 
      
 1053 
     | 
    
         
            +
                      return _this._processThumbnailQueue();
         
     | 
| 
      
 1054 
     | 
    
         
            +
                    };
         
     | 
| 
      
 1055 
     | 
    
         
            +
                  })(this));
         
     | 
| 
      
 1056 
     | 
    
         
            +
                };
         
     | 
| 
      
 1057 
     | 
    
         
            +
             
     | 
| 
      
 1058 
     | 
    
         
            +
                Dropzone.prototype.removeFile = function(file) {
         
     | 
| 
      
 1059 
     | 
    
         
            +
                  if (file.status === Dropzone.UPLOADING) {
         
     | 
| 
      
 1060 
     | 
    
         
            +
                    this.cancelUpload(file);
         
     | 
| 
      
 1061 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1062 
     | 
    
         
            +
                  this.files = without(this.files, file);
         
     | 
| 
      
 1063 
     | 
    
         
            +
                  this.emit("removedfile", file);
         
     | 
| 
      
 1064 
     | 
    
         
            +
                  if (this.files.length === 0) {
         
     | 
| 
      
 1065 
     | 
    
         
            +
                    return this.emit("reset");
         
     | 
| 
      
 1066 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1067 
     | 
    
         
            +
                };
         
     | 
| 
      
 1068 
     | 
    
         
            +
             
     | 
| 
      
 1069 
     | 
    
         
            +
                Dropzone.prototype.removeAllFiles = function(cancelIfNecessary) {
         
     | 
| 
      
 1070 
     | 
    
         
            +
                  var file, _i, _len, _ref;
         
     | 
| 
      
 1071 
     | 
    
         
            +
                  if (cancelIfNecessary == null) {
         
     | 
| 
      
 1072 
     | 
    
         
            +
                    cancelIfNecessary = false;
         
     | 
| 
      
 1073 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1074 
     | 
    
         
            +
                  _ref = this.files.slice();
         
     | 
| 
      
 1075 
     | 
    
         
            +
                  for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 1076 
     | 
    
         
            +
                    file = _ref[_i];
         
     | 
| 
      
 1077 
     | 
    
         
            +
                    if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) {
         
     | 
| 
      
 1078 
     | 
    
         
            +
                      this.removeFile(file);
         
     | 
| 
      
 1079 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1080 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1081 
     | 
    
         
            +
                  return null;
         
     | 
| 
      
 1082 
     | 
    
         
            +
                };
         
     | 
| 
      
 1083 
     | 
    
         
            +
             
     | 
| 
      
 1084 
     | 
    
         
            +
                Dropzone.prototype.createThumbnail = function(file, callback) {
         
     | 
| 
      
 1085 
     | 
    
         
            +
                  var fileReader;
         
     | 
| 
      
 1086 
     | 
    
         
            +
                  fileReader = new FileReader;
         
     | 
| 
      
 1087 
     | 
    
         
            +
                  fileReader.onload = (function(_this) {
         
     | 
| 
      
 1088 
     | 
    
         
            +
                    return function() {
         
     | 
| 
      
 1089 
     | 
    
         
            +
                      if (file.type === "image/svg+xml") {
         
     | 
| 
      
 1090 
     | 
    
         
            +
                        _this.emit("thumbnail", file, fileReader.result);
         
     | 
| 
      
 1091 
     | 
    
         
            +
                        if (callback != null) {
         
     | 
| 
      
 1092 
     | 
    
         
            +
                          callback();
         
     | 
| 
      
 1093 
     | 
    
         
            +
                        }
         
     | 
| 
      
 1094 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 1095 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1096 
     | 
    
         
            +
                      return _this.createThumbnailFromUrl(file, fileReader.result, callback);
         
     | 
| 
      
 1097 
     | 
    
         
            +
                    };
         
     | 
| 
      
 1098 
     | 
    
         
            +
                  })(this);
         
     | 
| 
      
 1099 
     | 
    
         
            +
                  return fileReader.readAsDataURL(file);
         
     | 
| 
      
 1100 
     | 
    
         
            +
                };
         
     | 
| 
      
 1101 
     | 
    
         
            +
             
     | 
| 
      
 1102 
     | 
    
         
            +
                Dropzone.prototype.createThumbnailFromUrl = function(file, imageUrl, callback, crossOrigin) {
         
     | 
| 
      
 1103 
     | 
    
         
            +
                  var img;
         
     | 
| 
      
 1104 
     | 
    
         
            +
                  img = document.createElement("img");
         
     | 
| 
      
 1105 
     | 
    
         
            +
                  if (crossOrigin) {
         
     | 
| 
      
 1106 
     | 
    
         
            +
                    img.crossOrigin = crossOrigin;
         
     | 
| 
      
 1107 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1108 
     | 
    
         
            +
                  img.onload = (function(_this) {
         
     | 
| 
      
 1109 
     | 
    
         
            +
                    return function() {
         
     | 
| 
      
 1110 
     | 
    
         
            +
                      var canvas, ctx, resizeInfo, thumbnail, _ref, _ref1, _ref2, _ref3;
         
     | 
| 
      
 1111 
     | 
    
         
            +
                      file.width = img.width;
         
     | 
| 
      
 1112 
     | 
    
         
            +
                      file.height = img.height;
         
     | 
| 
      
 1113 
     | 
    
         
            +
                      resizeInfo = _this.options.resize.call(_this, file);
         
     | 
| 
      
 1114 
     | 
    
         
            +
                      if (resizeInfo.trgWidth == null) {
         
     | 
| 
      
 1115 
     | 
    
         
            +
                        resizeInfo.trgWidth = resizeInfo.optWidth;
         
     | 
| 
      
 1116 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1117 
     | 
    
         
            +
                      if (resizeInfo.trgHeight == null) {
         
     | 
| 
      
 1118 
     | 
    
         
            +
                        resizeInfo.trgHeight = resizeInfo.optHeight;
         
     | 
| 
      
 1119 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1120 
     | 
    
         
            +
                      canvas = document.createElement("canvas");
         
     | 
| 
      
 1121 
     | 
    
         
            +
                      ctx = canvas.getContext("2d");
         
     | 
| 
      
 1122 
     | 
    
         
            +
                      canvas.width = resizeInfo.trgWidth;
         
     | 
| 
      
 1123 
     | 
    
         
            +
                      canvas.height = resizeInfo.trgHeight;
         
     | 
| 
      
 1124 
     | 
    
         
            +
                      drawImageIOSFix(ctx, img, (_ref = resizeInfo.srcX) != null ? _ref : 0, (_ref1 = resizeInfo.srcY) != null ? _ref1 : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, (_ref2 = resizeInfo.trgX) != null ? _ref2 : 0, (_ref3 = resizeInfo.trgY) != null ? _ref3 : 0, resizeInfo.trgWidth, resizeInfo.trgHeight);
         
     | 
| 
      
 1125 
     | 
    
         
            +
                      thumbnail = canvas.toDataURL("image/png");
         
     | 
| 
      
 1126 
     | 
    
         
            +
                      _this.emit("thumbnail", file, thumbnail);
         
     | 
| 
      
 1127 
     | 
    
         
            +
                      if (callback != null) {
         
     | 
| 
      
 1128 
     | 
    
         
            +
                        return callback();
         
     | 
| 
      
 1129 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1130 
     | 
    
         
            +
                    };
         
     | 
| 
      
 1131 
     | 
    
         
            +
                  })(this);
         
     | 
| 
      
 1132 
     | 
    
         
            +
                  if (callback != null) {
         
     | 
| 
      
 1133 
     | 
    
         
            +
                    img.onerror = callback;
         
     | 
| 
      
 1134 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1135 
     | 
    
         
            +
                  return img.src = imageUrl;
         
     | 
| 
      
 1136 
     | 
    
         
            +
                };
         
     | 
| 
      
 1137 
     | 
    
         
            +
             
     | 
| 
      
 1138 
     | 
    
         
            +
                Dropzone.prototype.processQueue = function() {
         
     | 
| 
      
 1139 
     | 
    
         
            +
                  var i, parallelUploads, processingLength, queuedFiles;
         
     | 
| 
      
 1140 
     | 
    
         
            +
                  parallelUploads = this.options.parallelUploads;
         
     | 
| 
      
 1141 
     | 
    
         
            +
                  processingLength = this.getUploadingFiles().length;
         
     | 
| 
      
 1142 
     | 
    
         
            +
                  i = processingLength;
         
     | 
| 
      
 1143 
     | 
    
         
            +
                  if (processingLength >= parallelUploads) {
         
     | 
| 
      
 1144 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 1145 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1146 
     | 
    
         
            +
                  queuedFiles = this.getQueuedFiles();
         
     | 
| 
      
 1147 
     | 
    
         
            +
                  if (!(queuedFiles.length > 0)) {
         
     | 
| 
      
 1148 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 1149 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1150 
     | 
    
         
            +
                  if (this.options.uploadMultiple) {
         
     | 
| 
      
 1151 
     | 
    
         
            +
                    return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength));
         
     | 
| 
      
 1152 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 1153 
     | 
    
         
            +
                    while (i < parallelUploads) {
         
     | 
| 
      
 1154 
     | 
    
         
            +
                      if (!queuedFiles.length) {
         
     | 
| 
      
 1155 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 1156 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1157 
     | 
    
         
            +
                      this.processFile(queuedFiles.shift());
         
     | 
| 
      
 1158 
     | 
    
         
            +
                      i++;
         
     | 
| 
      
 1159 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1160 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1161 
     | 
    
         
            +
                };
         
     | 
| 
      
 1162 
     | 
    
         
            +
             
     | 
| 
      
 1163 
     | 
    
         
            +
                Dropzone.prototype.processFile = function(file) {
         
     | 
| 
      
 1164 
     | 
    
         
            +
                  return this.processFiles([file]);
         
     | 
| 
      
 1165 
     | 
    
         
            +
                };
         
     | 
| 
      
 1166 
     | 
    
         
            +
             
     | 
| 
      
 1167 
     | 
    
         
            +
                Dropzone.prototype.processFiles = function(files) {
         
     | 
| 
      
 1168 
     | 
    
         
            +
                  var file, _i, _len;
         
     | 
| 
      
 1169 
     | 
    
         
            +
                  for (_i = 0, _len = files.length; _i < _len; _i++) {
         
     | 
| 
      
 1170 
     | 
    
         
            +
                    file = files[_i];
         
     | 
| 
      
 1171 
     | 
    
         
            +
                    file.processing = true;
         
     | 
| 
      
 1172 
     | 
    
         
            +
                    file.status = Dropzone.UPLOADING;
         
     | 
| 
      
 1173 
     | 
    
         
            +
                    this.emit("processing", file);
         
     | 
| 
      
 1174 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1175 
     | 
    
         
            +
                  if (this.options.uploadMultiple) {
         
     | 
| 
      
 1176 
     | 
    
         
            +
                    this.emit("processingmultiple", files);
         
     | 
| 
      
 1177 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1178 
     | 
    
         
            +
                  return this.uploadFiles(files);
         
     | 
| 
      
 1179 
     | 
    
         
            +
                };
         
     | 
| 
      
 1180 
     | 
    
         
            +
             
     | 
| 
      
 1181 
     | 
    
         
            +
                Dropzone.prototype._getFilesWithXhr = function(xhr) {
         
     | 
| 
      
 1182 
     | 
    
         
            +
                  var file, files;
         
     | 
| 
      
 1183 
     | 
    
         
            +
                  return files = (function() {
         
     | 
| 
      
 1184 
     | 
    
         
            +
                    var _i, _len, _ref, _results;
         
     | 
| 
      
 1185 
     | 
    
         
            +
                    _ref = this.files;
         
     | 
| 
      
 1186 
     | 
    
         
            +
                    _results = [];
         
     | 
| 
      
 1187 
     | 
    
         
            +
                    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 1188 
     | 
    
         
            +
                      file = _ref[_i];
         
     | 
| 
      
 1189 
     | 
    
         
            +
                      if (file.xhr === xhr) {
         
     | 
| 
      
 1190 
     | 
    
         
            +
                        _results.push(file);
         
     | 
| 
      
 1191 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1192 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1193 
     | 
    
         
            +
                    return _results;
         
     | 
| 
      
 1194 
     | 
    
         
            +
                  }).call(this);
         
     | 
| 
      
 1195 
     | 
    
         
            +
                };
         
     | 
| 
      
 1196 
     | 
    
         
            +
             
     | 
| 
      
 1197 
     | 
    
         
            +
                Dropzone.prototype.cancelUpload = function(file) {
         
     | 
| 
      
 1198 
     | 
    
         
            +
                  var groupedFile, groupedFiles, _i, _j, _len, _len1, _ref;
         
     | 
| 
      
 1199 
     | 
    
         
            +
                  if (file.status === Dropzone.UPLOADING) {
         
     | 
| 
      
 1200 
     | 
    
         
            +
                    groupedFiles = this._getFilesWithXhr(file.xhr);
         
     | 
| 
      
 1201 
     | 
    
         
            +
                    for (_i = 0, _len = groupedFiles.length; _i < _len; _i++) {
         
     | 
| 
      
 1202 
     | 
    
         
            +
                      groupedFile = groupedFiles[_i];
         
     | 
| 
      
 1203 
     | 
    
         
            +
                      groupedFile.status = Dropzone.CANCELED;
         
     | 
| 
      
 1204 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1205 
     | 
    
         
            +
                    file.xhr.abort();
         
     | 
| 
      
 1206 
     | 
    
         
            +
                    for (_j = 0, _len1 = groupedFiles.length; _j < _len1; _j++) {
         
     | 
| 
      
 1207 
     | 
    
         
            +
                      groupedFile = groupedFiles[_j];
         
     | 
| 
      
 1208 
     | 
    
         
            +
                      this.emit("canceled", groupedFile);
         
     | 
| 
      
 1209 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1210 
     | 
    
         
            +
                    if (this.options.uploadMultiple) {
         
     | 
| 
      
 1211 
     | 
    
         
            +
                      this.emit("canceledmultiple", groupedFiles);
         
     | 
| 
      
 1212 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1213 
     | 
    
         
            +
                  } else if ((_ref = file.status) === Dropzone.ADDED || _ref === Dropzone.QUEUED) {
         
     | 
| 
      
 1214 
     | 
    
         
            +
                    file.status = Dropzone.CANCELED;
         
     | 
| 
      
 1215 
     | 
    
         
            +
                    this.emit("canceled", file);
         
     | 
| 
      
 1216 
     | 
    
         
            +
                    if (this.options.uploadMultiple) {
         
     | 
| 
      
 1217 
     | 
    
         
            +
                      this.emit("canceledmultiple", [file]);
         
     | 
| 
      
 1218 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1219 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1220 
     | 
    
         
            +
                  if (this.options.autoProcessQueue) {
         
     | 
| 
      
 1221 
     | 
    
         
            +
                    return this.processQueue();
         
     | 
| 
      
 1222 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1223 
     | 
    
         
            +
                };
         
     | 
| 
      
 1224 
     | 
    
         
            +
             
     | 
| 
      
 1225 
     | 
    
         
            +
                resolveOption = function() {
         
     | 
| 
      
 1226 
     | 
    
         
            +
                  var args, option;
         
     | 
| 
      
 1227 
     | 
    
         
            +
                  option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
         
     | 
| 
      
 1228 
     | 
    
         
            +
                  if (typeof option === 'function') {
         
     | 
| 
      
 1229 
     | 
    
         
            +
                    return option.apply(this, args);
         
     | 
| 
      
 1230 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1231 
     | 
    
         
            +
                  return option;
         
     | 
| 
      
 1232 
     | 
    
         
            +
                };
         
     | 
| 
      
 1233 
     | 
    
         
            +
             
     | 
| 
      
 1234 
     | 
    
         
            +
                Dropzone.prototype.uploadFile = function(file) {
         
     | 
| 
      
 1235 
     | 
    
         
            +
                  return this.uploadFiles([file]);
         
     | 
| 
      
 1236 
     | 
    
         
            +
                };
         
     | 
| 
      
 1237 
     | 
    
         
            +
             
     | 
| 
      
 1238 
     | 
    
         
            +
                Dropzone.prototype.uploadFiles = function(files) {
         
     | 
| 
      
 1239 
     | 
    
         
            +
                  var file, formData, handleError, headerName, headerValue, headers, i, input, inputName, inputType, key, method, option, progressObj, response, updateProgress, url, value, xhr, _i, _j, _k, _l, _len, _len1, _len2, _len3, _m, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
         
     | 
| 
      
 1240 
     | 
    
         
            +
                  xhr = new XMLHttpRequest();
         
     | 
| 
      
 1241 
     | 
    
         
            +
                  for (_i = 0, _len = files.length; _i < _len; _i++) {
         
     | 
| 
      
 1242 
     | 
    
         
            +
                    file = files[_i];
         
     | 
| 
      
 1243 
     | 
    
         
            +
                    file.xhr = xhr;
         
     | 
| 
      
 1244 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1245 
     | 
    
         
            +
                  method = resolveOption(this.options.method, files);
         
     | 
| 
      
 1246 
     | 
    
         
            +
                  url = resolveOption(this.options.url, files);
         
     | 
| 
      
 1247 
     | 
    
         
            +
                  xhr.open(method, url, true);
         
     | 
| 
      
 1248 
     | 
    
         
            +
                  xhr.withCredentials = !!this.options.withCredentials;
         
     | 
| 
      
 1249 
     | 
    
         
            +
                  response = null;
         
     | 
| 
      
 1250 
     | 
    
         
            +
                  handleError = (function(_this) {
         
     | 
| 
      
 1251 
     | 
    
         
            +
                    return function() {
         
     | 
| 
      
 1252 
     | 
    
         
            +
                      var _j, _len1, _results;
         
     | 
| 
      
 1253 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 1254 
     | 
    
         
            +
                      for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
         
     | 
| 
      
 1255 
     | 
    
         
            +
                        file = files[_j];
         
     | 
| 
      
 1256 
     | 
    
         
            +
                        _results.push(_this._errorProcessing(files, response || _this.options.dictResponseError.replace("{{statusCode}}", xhr.status), xhr));
         
     | 
| 
      
 1257 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1258 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 1259 
     | 
    
         
            +
                    };
         
     | 
| 
      
 1260 
     | 
    
         
            +
                  })(this);
         
     | 
| 
      
 1261 
     | 
    
         
            +
                  updateProgress = (function(_this) {
         
     | 
| 
      
 1262 
     | 
    
         
            +
                    return function(e) {
         
     | 
| 
      
 1263 
     | 
    
         
            +
                      var allFilesFinished, progress, _j, _k, _l, _len1, _len2, _len3, _results;
         
     | 
| 
      
 1264 
     | 
    
         
            +
                      if (e != null) {
         
     | 
| 
      
 1265 
     | 
    
         
            +
                        progress = 100 * e.loaded / e.total;
         
     | 
| 
      
 1266 
     | 
    
         
            +
                        for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
         
     | 
| 
      
 1267 
     | 
    
         
            +
                          file = files[_j];
         
     | 
| 
      
 1268 
     | 
    
         
            +
                          file.upload = {
         
     | 
| 
      
 1269 
     | 
    
         
            +
                            progress: progress,
         
     | 
| 
      
 1270 
     | 
    
         
            +
                            total: e.total,
         
     | 
| 
      
 1271 
     | 
    
         
            +
                            bytesSent: e.loaded
         
     | 
| 
      
 1272 
     | 
    
         
            +
                          };
         
     | 
| 
      
 1273 
     | 
    
         
            +
                        }
         
     | 
| 
      
 1274 
     | 
    
         
            +
                      } else {
         
     | 
| 
      
 1275 
     | 
    
         
            +
                        allFilesFinished = true;
         
     | 
| 
      
 1276 
     | 
    
         
            +
                        progress = 100;
         
     | 
| 
      
 1277 
     | 
    
         
            +
                        for (_k = 0, _len2 = files.length; _k < _len2; _k++) {
         
     | 
| 
      
 1278 
     | 
    
         
            +
                          file = files[_k];
         
     | 
| 
      
 1279 
     | 
    
         
            +
                          if (!(file.upload.progress === 100 && file.upload.bytesSent === file.upload.total)) {
         
     | 
| 
      
 1280 
     | 
    
         
            +
                            allFilesFinished = false;
         
     | 
| 
      
 1281 
     | 
    
         
            +
                          }
         
     | 
| 
      
 1282 
     | 
    
         
            +
                          file.upload.progress = progress;
         
     | 
| 
      
 1283 
     | 
    
         
            +
                          file.upload.bytesSent = file.upload.total;
         
     | 
| 
      
 1284 
     | 
    
         
            +
                        }
         
     | 
| 
      
 1285 
     | 
    
         
            +
                        if (allFilesFinished) {
         
     | 
| 
      
 1286 
     | 
    
         
            +
                          return;
         
     | 
| 
      
 1287 
     | 
    
         
            +
                        }
         
     | 
| 
      
 1288 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1289 
     | 
    
         
            +
                      _results = [];
         
     | 
| 
      
 1290 
     | 
    
         
            +
                      for (_l = 0, _len3 = files.length; _l < _len3; _l++) {
         
     | 
| 
      
 1291 
     | 
    
         
            +
                        file = files[_l];
         
     | 
| 
      
 1292 
     | 
    
         
            +
                        _results.push(_this.emit("uploadprogress", file, progress, file.upload.bytesSent));
         
     | 
| 
      
 1293 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1294 
     | 
    
         
            +
                      return _results;
         
     | 
| 
      
 1295 
     | 
    
         
            +
                    };
         
     | 
| 
      
 1296 
     | 
    
         
            +
                  })(this);
         
     | 
| 
      
 1297 
     | 
    
         
            +
                  xhr.onload = (function(_this) {
         
     | 
| 
      
 1298 
     | 
    
         
            +
                    return function(e) {
         
     | 
| 
      
 1299 
     | 
    
         
            +
                      var _ref;
         
     | 
| 
      
 1300 
     | 
    
         
            +
                      if (files[0].status === Dropzone.CANCELED) {
         
     | 
| 
      
 1301 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 1302 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1303 
     | 
    
         
            +
                      if (xhr.readyState !== 4) {
         
     | 
| 
      
 1304 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 1305 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1306 
     | 
    
         
            +
                      response = xhr.responseText;
         
     | 
| 
      
 1307 
     | 
    
         
            +
                      if (xhr.getResponseHeader("content-type") && ~xhr.getResponseHeader("content-type").indexOf("application/json")) {
         
     | 
| 
      
 1308 
     | 
    
         
            +
                        try {
         
     | 
| 
      
 1309 
     | 
    
         
            +
                          response = JSON.parse(response);
         
     | 
| 
      
 1310 
     | 
    
         
            +
                        } catch (_error) {
         
     | 
| 
      
 1311 
     | 
    
         
            +
                          e = _error;
         
     | 
| 
      
 1312 
     | 
    
         
            +
                          response = "Invalid JSON response from server.";
         
     | 
| 
      
 1313 
     | 
    
         
            +
                        }
         
     | 
| 
      
 1314 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1315 
     | 
    
         
            +
                      updateProgress();
         
     | 
| 
      
 1316 
     | 
    
         
            +
                      if (!((200 <= (_ref = xhr.status) && _ref < 300))) {
         
     | 
| 
      
 1317 
     | 
    
         
            +
                        return handleError();
         
     | 
| 
      
 1318 
     | 
    
         
            +
                      } else {
         
     | 
| 
      
 1319 
     | 
    
         
            +
                        return _this._finished(files, response, e);
         
     | 
| 
      
 1320 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1321 
     | 
    
         
            +
                    };
         
     | 
| 
      
 1322 
     | 
    
         
            +
                  })(this);
         
     | 
| 
      
 1323 
     | 
    
         
            +
                  xhr.onerror = (function(_this) {
         
     | 
| 
      
 1324 
     | 
    
         
            +
                    return function() {
         
     | 
| 
      
 1325 
     | 
    
         
            +
                      if (files[0].status === Dropzone.CANCELED) {
         
     | 
| 
      
 1326 
     | 
    
         
            +
                        return;
         
     | 
| 
      
 1327 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1328 
     | 
    
         
            +
                      return handleError();
         
     | 
| 
      
 1329 
     | 
    
         
            +
                    };
         
     | 
| 
      
 1330 
     | 
    
         
            +
                  })(this);
         
     | 
| 
      
 1331 
     | 
    
         
            +
                  progressObj = (_ref = xhr.upload) != null ? _ref : xhr;
         
     | 
| 
      
 1332 
     | 
    
         
            +
                  progressObj.onprogress = updateProgress;
         
     | 
| 
      
 1333 
     | 
    
         
            +
                  headers = {
         
     | 
| 
      
 1334 
     | 
    
         
            +
                    "Accept": "application/json",
         
     | 
| 
      
 1335 
     | 
    
         
            +
                    "Cache-Control": "no-cache",
         
     | 
| 
      
 1336 
     | 
    
         
            +
                    "X-Requested-With": "XMLHttpRequest"
         
     | 
| 
      
 1337 
     | 
    
         
            +
                  };
         
     | 
| 
      
 1338 
     | 
    
         
            +
                  if (this.options.headers) {
         
     | 
| 
      
 1339 
     | 
    
         
            +
                    extend(headers, this.options.headers);
         
     | 
| 
      
 1340 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1341 
     | 
    
         
            +
                  for (headerName in headers) {
         
     | 
| 
      
 1342 
     | 
    
         
            +
                    headerValue = headers[headerName];
         
     | 
| 
      
 1343 
     | 
    
         
            +
                    if (headerValue) {
         
     | 
| 
      
 1344 
     | 
    
         
            +
                      xhr.setRequestHeader(headerName, headerValue);
         
     | 
| 
      
 1345 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1346 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1347 
     | 
    
         
            +
                  formData = new FormData();
         
     | 
| 
      
 1348 
     | 
    
         
            +
                  if (this.options.params) {
         
     | 
| 
      
 1349 
     | 
    
         
            +
                    _ref1 = this.options.params;
         
     | 
| 
      
 1350 
     | 
    
         
            +
                    for (key in _ref1) {
         
     | 
| 
      
 1351 
     | 
    
         
            +
                      value = _ref1[key];
         
     | 
| 
      
 1352 
     | 
    
         
            +
                      formData.append(key, value);
         
     | 
| 
      
 1353 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1354 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1355 
     | 
    
         
            +
                  for (_j = 0, _len1 = files.length; _j < _len1; _j++) {
         
     | 
| 
      
 1356 
     | 
    
         
            +
                    file = files[_j];
         
     | 
| 
      
 1357 
     | 
    
         
            +
                    this.emit("sending", file, xhr, formData);
         
     | 
| 
      
 1358 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1359 
     | 
    
         
            +
                  if (this.options.uploadMultiple) {
         
     | 
| 
      
 1360 
     | 
    
         
            +
                    this.emit("sendingmultiple", files, xhr, formData);
         
     | 
| 
      
 1361 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1362 
     | 
    
         
            +
                  if (this.element.tagName === "FORM") {
         
     | 
| 
      
 1363 
     | 
    
         
            +
                    _ref2 = this.element.querySelectorAll("input, textarea, select, button");
         
     | 
| 
      
 1364 
     | 
    
         
            +
                    for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
         
     | 
| 
      
 1365 
     | 
    
         
            +
                      input = _ref2[_k];
         
     | 
| 
      
 1366 
     | 
    
         
            +
                      inputName = input.getAttribute("name");
         
     | 
| 
      
 1367 
     | 
    
         
            +
                      inputType = input.getAttribute("type");
         
     | 
| 
      
 1368 
     | 
    
         
            +
                      if (input.tagName === "SELECT" && input.hasAttribute("multiple")) {
         
     | 
| 
      
 1369 
     | 
    
         
            +
                        _ref3 = input.options;
         
     | 
| 
      
 1370 
     | 
    
         
            +
                        for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) {
         
     | 
| 
      
 1371 
     | 
    
         
            +
                          option = _ref3[_l];
         
     | 
| 
      
 1372 
     | 
    
         
            +
                          if (option.selected) {
         
     | 
| 
      
 1373 
     | 
    
         
            +
                            formData.append(inputName, option.value);
         
     | 
| 
      
 1374 
     | 
    
         
            +
                          }
         
     | 
| 
      
 1375 
     | 
    
         
            +
                        }
         
     | 
| 
      
 1376 
     | 
    
         
            +
                      } else if (!inputType || ((_ref4 = inputType.toLowerCase()) !== "checkbox" && _ref4 !== "radio") || input.checked) {
         
     | 
| 
      
 1377 
     | 
    
         
            +
                        formData.append(inputName, input.value);
         
     | 
| 
      
 1378 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1379 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1380 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1381 
     | 
    
         
            +
                  for (i = _m = 0, _ref5 = files.length - 1; 0 <= _ref5 ? _m <= _ref5 : _m >= _ref5; i = 0 <= _ref5 ? ++_m : --_m) {
         
     | 
| 
      
 1382 
     | 
    
         
            +
                    formData.append(this._getParamName(i), files[i], this._renameFilename(files[i].name));
         
     | 
| 
      
 1383 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1384 
     | 
    
         
            +
                  return this.submitRequest(xhr, formData, files);
         
     | 
| 
      
 1385 
     | 
    
         
            +
                };
         
     | 
| 
      
 1386 
     | 
    
         
            +
             
     | 
| 
      
 1387 
     | 
    
         
            +
                Dropzone.prototype.submitRequest = function(xhr, formData, files) {
         
     | 
| 
      
 1388 
     | 
    
         
            +
                  return xhr.send(formData);
         
     | 
| 
      
 1389 
     | 
    
         
            +
                };
         
     | 
| 
      
 1390 
     | 
    
         
            +
             
     | 
| 
      
 1391 
     | 
    
         
            +
                Dropzone.prototype._finished = function(files, responseText, e) {
         
     | 
| 
      
 1392 
     | 
    
         
            +
                  var file, _i, _len;
         
     | 
| 
      
 1393 
     | 
    
         
            +
                  for (_i = 0, _len = files.length; _i < _len; _i++) {
         
     | 
| 
      
 1394 
     | 
    
         
            +
                    file = files[_i];
         
     | 
| 
      
 1395 
     | 
    
         
            +
                    file.status = Dropzone.SUCCESS;
         
     | 
| 
      
 1396 
     | 
    
         
            +
                    this.emit("success", file, responseText, e);
         
     | 
| 
      
 1397 
     | 
    
         
            +
                    this.emit("complete", file);
         
     | 
| 
      
 1398 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1399 
     | 
    
         
            +
                  if (this.options.uploadMultiple) {
         
     | 
| 
      
 1400 
     | 
    
         
            +
                    this.emit("successmultiple", files, responseText, e);
         
     | 
| 
      
 1401 
     | 
    
         
            +
                    this.emit("completemultiple", files);
         
     | 
| 
      
 1402 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1403 
     | 
    
         
            +
                  if (this.options.autoProcessQueue) {
         
     | 
| 
      
 1404 
     | 
    
         
            +
                    return this.processQueue();
         
     | 
| 
      
 1405 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1406 
     | 
    
         
            +
                };
         
     | 
| 
      
 1407 
     | 
    
         
            +
             
     | 
| 
      
 1408 
     | 
    
         
            +
                Dropzone.prototype._errorProcessing = function(files, message, xhr) {
         
     | 
| 
      
 1409 
     | 
    
         
            +
                  var file, _i, _len;
         
     | 
| 
      
 1410 
     | 
    
         
            +
                  for (_i = 0, _len = files.length; _i < _len; _i++) {
         
     | 
| 
      
 1411 
     | 
    
         
            +
                    file = files[_i];
         
     | 
| 
      
 1412 
     | 
    
         
            +
                    file.status = Dropzone.ERROR;
         
     | 
| 
      
 1413 
     | 
    
         
            +
                    this.emit("error", file, message, xhr);
         
     | 
| 
      
 1414 
     | 
    
         
            +
                    this.emit("complete", file);
         
     | 
| 
      
 1415 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1416 
     | 
    
         
            +
                  if (this.options.uploadMultiple) {
         
     | 
| 
      
 1417 
     | 
    
         
            +
                    this.emit("errormultiple", files, message, xhr);
         
     | 
| 
      
 1418 
     | 
    
         
            +
                    this.emit("completemultiple", files);
         
     | 
| 
      
 1419 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1420 
     | 
    
         
            +
                  if (this.options.autoProcessQueue) {
         
     | 
| 
      
 1421 
     | 
    
         
            +
                    return this.processQueue();
         
     | 
| 
      
 1422 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1423 
     | 
    
         
            +
                };
         
     | 
| 
      
 1424 
     | 
    
         
            +
             
     | 
| 
      
 1425 
     | 
    
         
            +
                return Dropzone;
         
     | 
| 
      
 1426 
     | 
    
         
            +
             
     | 
| 
      
 1427 
     | 
    
         
            +
              })(Emitter);
         
     | 
| 
      
 1428 
     | 
    
         
            +
             
     | 
| 
      
 1429 
     | 
    
         
            +
              Dropzone.version = "4.3.0";
         
     | 
| 
      
 1430 
     | 
    
         
            +
             
     | 
| 
      
 1431 
     | 
    
         
            +
              Dropzone.options = {};
         
     | 
| 
      
 1432 
     | 
    
         
            +
             
     | 
| 
      
 1433 
     | 
    
         
            +
              Dropzone.optionsForElement = function(element) {
         
     | 
| 
      
 1434 
     | 
    
         
            +
                if (element.getAttribute("id")) {
         
     | 
| 
      
 1435 
     | 
    
         
            +
                  return Dropzone.options[camelize(element.getAttribute("id"))];
         
     | 
| 
      
 1436 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 1437 
     | 
    
         
            +
                  return void 0;
         
     | 
| 
      
 1438 
     | 
    
         
            +
                }
         
     | 
| 
      
 1439 
     | 
    
         
            +
              };
         
     | 
| 
      
 1440 
     | 
    
         
            +
             
     | 
| 
      
 1441 
     | 
    
         
            +
              Dropzone.instances = [];
         
     | 
| 
      
 1442 
     | 
    
         
            +
             
     | 
| 
      
 1443 
     | 
    
         
            +
              Dropzone.forElement = function(element) {
         
     | 
| 
      
 1444 
     | 
    
         
            +
                if (typeof element === "string") {
         
     | 
| 
      
 1445 
     | 
    
         
            +
                  element = document.querySelector(element);
         
     | 
| 
      
 1446 
     | 
    
         
            +
                }
         
     | 
| 
      
 1447 
     | 
    
         
            +
                if ((element != null ? element.dropzone : void 0) == null) {
         
     | 
| 
      
 1448 
     | 
    
         
            +
                  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.");
         
     | 
| 
      
 1449 
     | 
    
         
            +
                }
         
     | 
| 
      
 1450 
     | 
    
         
            +
                return element.dropzone;
         
     | 
| 
      
 1451 
     | 
    
         
            +
              };
         
     | 
| 
      
 1452 
     | 
    
         
            +
             
     | 
| 
      
 1453 
     | 
    
         
            +
              Dropzone.autoDiscover = true;
         
     | 
| 
      
 1454 
     | 
    
         
            +
             
     | 
| 
      
 1455 
     | 
    
         
            +
              Dropzone.discover = function() {
         
     | 
| 
      
 1456 
     | 
    
         
            +
                var checkElements, dropzone, dropzones, _i, _len, _results;
         
     | 
| 
      
 1457 
     | 
    
         
            +
                if (document.querySelectorAll) {
         
     | 
| 
      
 1458 
     | 
    
         
            +
                  dropzones = document.querySelectorAll(".dropzone");
         
     | 
| 
      
 1459 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 1460 
     | 
    
         
            +
                  dropzones = [];
         
     | 
| 
      
 1461 
     | 
    
         
            +
                  checkElements = function(elements) {
         
     | 
| 
      
 1462 
     | 
    
         
            +
                    var el, _i, _len, _results;
         
     | 
| 
      
 1463 
     | 
    
         
            +
                    _results = [];
         
     | 
| 
      
 1464 
     | 
    
         
            +
                    for (_i = 0, _len = elements.length; _i < _len; _i++) {
         
     | 
| 
      
 1465 
     | 
    
         
            +
                      el = elements[_i];
         
     | 
| 
      
 1466 
     | 
    
         
            +
                      if (/(^| )dropzone($| )/.test(el.className)) {
         
     | 
| 
      
 1467 
     | 
    
         
            +
                        _results.push(dropzones.push(el));
         
     | 
| 
      
 1468 
     | 
    
         
            +
                      } else {
         
     | 
| 
      
 1469 
     | 
    
         
            +
                        _results.push(void 0);
         
     | 
| 
      
 1470 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1471 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1472 
     | 
    
         
            +
                    return _results;
         
     | 
| 
      
 1473 
     | 
    
         
            +
                  };
         
     | 
| 
      
 1474 
     | 
    
         
            +
                  checkElements(document.getElementsByTagName("div"));
         
     | 
| 
      
 1475 
     | 
    
         
            +
                  checkElements(document.getElementsByTagName("form"));
         
     | 
| 
      
 1476 
     | 
    
         
            +
                }
         
     | 
| 
      
 1477 
     | 
    
         
            +
                _results = [];
         
     | 
| 
      
 1478 
     | 
    
         
            +
                for (_i = 0, _len = dropzones.length; _i < _len; _i++) {
         
     | 
| 
      
 1479 
     | 
    
         
            +
                  dropzone = dropzones[_i];
         
     | 
| 
      
 1480 
     | 
    
         
            +
                  if (Dropzone.optionsForElement(dropzone) !== false) {
         
     | 
| 
      
 1481 
     | 
    
         
            +
                    _results.push(new Dropzone(dropzone));
         
     | 
| 
      
 1482 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 1483 
     | 
    
         
            +
                    _results.push(void 0);
         
     | 
| 
      
 1484 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1485 
     | 
    
         
            +
                }
         
     | 
| 
      
 1486 
     | 
    
         
            +
                return _results;
         
     | 
| 
      
 1487 
     | 
    
         
            +
              };
         
     | 
| 
      
 1488 
     | 
    
         
            +
             
     | 
| 
      
 1489 
     | 
    
         
            +
              Dropzone.blacklistedBrowsers = [/opera.*Macintosh.*version\/12/i];
         
     | 
| 
      
 1490 
     | 
    
         
            +
             
     | 
| 
      
 1491 
     | 
    
         
            +
              Dropzone.isBrowserSupported = function() {
         
     | 
| 
      
 1492 
     | 
    
         
            +
                var capableBrowser, regex, _i, _len, _ref;
         
     | 
| 
      
 1493 
     | 
    
         
            +
                capableBrowser = true;
         
     | 
| 
      
 1494 
     | 
    
         
            +
                if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {
         
     | 
| 
      
 1495 
     | 
    
         
            +
                  if (!("classList" in document.createElement("a"))) {
         
     | 
| 
      
 1496 
     | 
    
         
            +
                    capableBrowser = false;
         
     | 
| 
      
 1497 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 1498 
     | 
    
         
            +
                    _ref = Dropzone.blacklistedBrowsers;
         
     | 
| 
      
 1499 
     | 
    
         
            +
                    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
         
     | 
| 
      
 1500 
     | 
    
         
            +
                      regex = _ref[_i];
         
     | 
| 
      
 1501 
     | 
    
         
            +
                      if (regex.test(navigator.userAgent)) {
         
     | 
| 
      
 1502 
     | 
    
         
            +
                        capableBrowser = false;
         
     | 
| 
      
 1503 
     | 
    
         
            +
                        continue;
         
     | 
| 
      
 1504 
     | 
    
         
            +
                      }
         
     | 
| 
      
 1505 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1506 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1507 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 1508 
     | 
    
         
            +
                  capableBrowser = false;
         
     | 
| 
      
 1509 
     | 
    
         
            +
                }
         
     | 
| 
      
 1510 
     | 
    
         
            +
                return capableBrowser;
         
     | 
| 
      
 1511 
     | 
    
         
            +
              };
         
     | 
| 
      
 1512 
     | 
    
         
            +
             
     | 
| 
      
 1513 
     | 
    
         
            +
              without = function(list, rejectedItem) {
         
     | 
| 
      
 1514 
     | 
    
         
            +
                var item, _i, _len, _results;
         
     | 
| 
      
 1515 
     | 
    
         
            +
                _results = [];
         
     | 
| 
      
 1516 
     | 
    
         
            +
                for (_i = 0, _len = list.length; _i < _len; _i++) {
         
     | 
| 
      
 1517 
     | 
    
         
            +
                  item = list[_i];
         
     | 
| 
      
 1518 
     | 
    
         
            +
                  if (item !== rejectedItem) {
         
     | 
| 
      
 1519 
     | 
    
         
            +
                    _results.push(item);
         
     | 
| 
      
 1520 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1521 
     | 
    
         
            +
                }
         
     | 
| 
      
 1522 
     | 
    
         
            +
                return _results;
         
     | 
| 
      
 1523 
     | 
    
         
            +
              };
         
     | 
| 
      
 1524 
     | 
    
         
            +
             
     | 
| 
      
 1525 
     | 
    
         
            +
              camelize = function(str) {
         
     | 
| 
      
 1526 
     | 
    
         
            +
                return str.replace(/[\-_](\w)/g, function(match) {
         
     | 
| 
      
 1527 
     | 
    
         
            +
                  return match.charAt(1).toUpperCase();
         
     | 
| 
      
 1528 
     | 
    
         
            +
                });
         
     | 
| 
      
 1529 
     | 
    
         
            +
              };
         
     | 
| 
      
 1530 
     | 
    
         
            +
             
     | 
| 
      
 1531 
     | 
    
         
            +
              Dropzone.createElement = function(string) {
         
     | 
| 
      
 1532 
     | 
    
         
            +
                var div;
         
     | 
| 
      
 1533 
     | 
    
         
            +
                div = document.createElement("div");
         
     | 
| 
      
 1534 
     | 
    
         
            +
                div.innerHTML = string;
         
     | 
| 
      
 1535 
     | 
    
         
            +
                return div.childNodes[0];
         
     | 
| 
      
 1536 
     | 
    
         
            +
              };
         
     | 
| 
      
 1537 
     | 
    
         
            +
             
     | 
| 
      
 1538 
     | 
    
         
            +
              Dropzone.elementInside = function(element, container) {
         
     | 
| 
      
 1539 
     | 
    
         
            +
                if (element === container) {
         
     | 
| 
      
 1540 
     | 
    
         
            +
                  return true;
         
     | 
| 
      
 1541 
     | 
    
         
            +
                }
         
     | 
| 
      
 1542 
     | 
    
         
            +
                while (element = element.parentNode) {
         
     | 
| 
      
 1543 
     | 
    
         
            +
                  if (element === container) {
         
     | 
| 
      
 1544 
     | 
    
         
            +
                    return true;
         
     | 
| 
      
 1545 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1546 
     | 
    
         
            +
                }
         
     | 
| 
      
 1547 
     | 
    
         
            +
                return false;
         
     | 
| 
      
 1548 
     | 
    
         
            +
              };
         
     | 
| 
      
 1549 
     | 
    
         
            +
             
     | 
| 
      
 1550 
     | 
    
         
            +
              Dropzone.getElement = function(el, name) {
         
     | 
| 
      
 1551 
     | 
    
         
            +
                var element;
         
     | 
| 
      
 1552 
     | 
    
         
            +
                if (typeof el === "string") {
         
     | 
| 
      
 1553 
     | 
    
         
            +
                  element = document.querySelector(el);
         
     | 
| 
      
 1554 
     | 
    
         
            +
                } else if (el.nodeType != null) {
         
     | 
| 
      
 1555 
     | 
    
         
            +
                  element = el;
         
     | 
| 
      
 1556 
     | 
    
         
            +
                }
         
     | 
| 
      
 1557 
     | 
    
         
            +
                if (element == null) {
         
     | 
| 
      
 1558 
     | 
    
         
            +
                  throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector or a plain HTML element.");
         
     | 
| 
      
 1559 
     | 
    
         
            +
                }
         
     | 
| 
      
 1560 
     | 
    
         
            +
                return element;
         
     | 
| 
      
 1561 
     | 
    
         
            +
              };
         
     | 
| 
      
 1562 
     | 
    
         
            +
             
     | 
| 
      
 1563 
     | 
    
         
            +
              Dropzone.getElements = function(els, name) {
         
     | 
| 
      
 1564 
     | 
    
         
            +
                var e, el, elements, _i, _j, _len, _len1, _ref;
         
     | 
| 
      
 1565 
     | 
    
         
            +
                if (els instanceof Array) {
         
     | 
| 
      
 1566 
     | 
    
         
            +
                  elements = [];
         
     | 
| 
      
 1567 
     | 
    
         
            +
                  try {
         
     | 
| 
      
 1568 
     | 
    
         
            +
                    for (_i = 0, _len = els.length; _i < _len; _i++) {
         
     | 
| 
      
 1569 
     | 
    
         
            +
                      el = els[_i];
         
     | 
| 
      
 1570 
     | 
    
         
            +
                      elements.push(this.getElement(el, name));
         
     | 
| 
      
 1571 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1572 
     | 
    
         
            +
                  } catch (_error) {
         
     | 
| 
      
 1573 
     | 
    
         
            +
                    e = _error;
         
     | 
| 
      
 1574 
     | 
    
         
            +
                    elements = null;
         
     | 
| 
      
 1575 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1576 
     | 
    
         
            +
                } else if (typeof els === "string") {
         
     | 
| 
      
 1577 
     | 
    
         
            +
                  elements = [];
         
     | 
| 
      
 1578 
     | 
    
         
            +
                  _ref = document.querySelectorAll(els);
         
     | 
| 
      
 1579 
     | 
    
         
            +
                  for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
         
     | 
| 
      
 1580 
     | 
    
         
            +
                    el = _ref[_j];
         
     | 
| 
      
 1581 
     | 
    
         
            +
                    elements.push(el);
         
     | 
| 
      
 1582 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1583 
     | 
    
         
            +
                } else if (els.nodeType != null) {
         
     | 
| 
      
 1584 
     | 
    
         
            +
                  elements = [els];
         
     | 
| 
      
 1585 
     | 
    
         
            +
                }
         
     | 
| 
      
 1586 
     | 
    
         
            +
                if (!((elements != null) && elements.length)) {
         
     | 
| 
      
 1587 
     | 
    
         
            +
                  throw new Error("Invalid `" + name + "` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");
         
     | 
| 
      
 1588 
     | 
    
         
            +
                }
         
     | 
| 
      
 1589 
     | 
    
         
            +
                return elements;
         
     | 
| 
      
 1590 
     | 
    
         
            +
              };
         
     | 
| 
      
 1591 
     | 
    
         
            +
             
     | 
| 
      
 1592 
     | 
    
         
            +
              Dropzone.confirm = function(question, accepted, rejected) {
         
     | 
| 
      
 1593 
     | 
    
         
            +
                if (window.confirm(question)) {
         
     | 
| 
      
 1594 
     | 
    
         
            +
                  return accepted();
         
     | 
| 
      
 1595 
     | 
    
         
            +
                } else if (rejected != null) {
         
     | 
| 
      
 1596 
     | 
    
         
            +
                  return rejected();
         
     | 
| 
      
 1597 
     | 
    
         
            +
                }
         
     | 
| 
      
 1598 
     | 
    
         
            +
              };
         
     | 
| 
      
 1599 
     | 
    
         
            +
             
     | 
| 
      
 1600 
     | 
    
         
            +
              Dropzone.isValidFile = function(file, acceptedFiles) {
         
     | 
| 
      
 1601 
     | 
    
         
            +
                var baseMimeType, mimeType, validType, _i, _len;
         
     | 
| 
      
 1602 
     | 
    
         
            +
                if (!acceptedFiles) {
         
     | 
| 
      
 1603 
     | 
    
         
            +
                  return true;
         
     | 
| 
      
 1604 
     | 
    
         
            +
                }
         
     | 
| 
      
 1605 
     | 
    
         
            +
                acceptedFiles = acceptedFiles.split(",");
         
     | 
| 
      
 1606 
     | 
    
         
            +
                mimeType = file.type;
         
     | 
| 
      
 1607 
     | 
    
         
            +
                baseMimeType = mimeType.replace(/\/.*$/, "");
         
     | 
| 
      
 1608 
     | 
    
         
            +
                for (_i = 0, _len = acceptedFiles.length; _i < _len; _i++) {
         
     | 
| 
      
 1609 
     | 
    
         
            +
                  validType = acceptedFiles[_i];
         
     | 
| 
      
 1610 
     | 
    
         
            +
                  validType = validType.trim();
         
     | 
| 
      
 1611 
     | 
    
         
            +
                  if (validType.charAt(0) === ".") {
         
     | 
| 
      
 1612 
     | 
    
         
            +
                    if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {
         
     | 
| 
      
 1613 
     | 
    
         
            +
                      return true;
         
     | 
| 
      
 1614 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1615 
     | 
    
         
            +
                  } else if (/\/\*$/.test(validType)) {
         
     | 
| 
      
 1616 
     | 
    
         
            +
                    if (baseMimeType === validType.replace(/\/.*$/, "")) {
         
     | 
| 
      
 1617 
     | 
    
         
            +
                      return true;
         
     | 
| 
      
 1618 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1619 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 1620 
     | 
    
         
            +
                    if (mimeType === validType) {
         
     | 
| 
      
 1621 
     | 
    
         
            +
                      return true;
         
     | 
| 
      
 1622 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1623 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1624 
     | 
    
         
            +
                }
         
     | 
| 
      
 1625 
     | 
    
         
            +
                return false;
         
     | 
| 
      
 1626 
     | 
    
         
            +
              };
         
     | 
| 
      
 1627 
     | 
    
         
            +
             
     | 
| 
      
 1628 
     | 
    
         
            +
              if (typeof jQuery !== "undefined" && jQuery !== null) {
         
     | 
| 
      
 1629 
     | 
    
         
            +
                jQuery.fn.dropzone = function(options) {
         
     | 
| 
      
 1630 
     | 
    
         
            +
                  return this.each(function() {
         
     | 
| 
      
 1631 
     | 
    
         
            +
                    return new Dropzone(this, options);
         
     | 
| 
      
 1632 
     | 
    
         
            +
                  });
         
     | 
| 
      
 1633 
     | 
    
         
            +
                };
         
     | 
| 
      
 1634 
     | 
    
         
            +
              }
         
     | 
| 
      
 1635 
     | 
    
         
            +
             
     | 
| 
      
 1636 
     | 
    
         
            +
              if (typeof module !== "undefined" && module !== null) {
         
     | 
| 
      
 1637 
     | 
    
         
            +
                module.exports = Dropzone;
         
     | 
| 
      
 1638 
     | 
    
         
            +
              } else {
         
     | 
| 
      
 1639 
     | 
    
         
            +
                window.Dropzone = Dropzone;
         
     | 
| 
      
 1640 
     | 
    
         
            +
              }
         
     | 
| 
      
 1641 
     | 
    
         
            +
             
     | 
| 
      
 1642 
     | 
    
         
            +
              Dropzone.ADDED = "added";
         
     | 
| 
      
 1643 
     | 
    
         
            +
             
     | 
| 
      
 1644 
     | 
    
         
            +
              Dropzone.QUEUED = "queued";
         
     | 
| 
      
 1645 
     | 
    
         
            +
             
     | 
| 
      
 1646 
     | 
    
         
            +
              Dropzone.ACCEPTED = Dropzone.QUEUED;
         
     | 
| 
      
 1647 
     | 
    
         
            +
             
     | 
| 
      
 1648 
     | 
    
         
            +
              Dropzone.UPLOADING = "uploading";
         
     | 
| 
      
 1649 
     | 
    
         
            +
             
     | 
| 
      
 1650 
     | 
    
         
            +
              Dropzone.PROCESSING = Dropzone.UPLOADING;
         
     | 
| 
      
 1651 
     | 
    
         
            +
             
     | 
| 
      
 1652 
     | 
    
         
            +
              Dropzone.CANCELED = "canceled";
         
     | 
| 
      
 1653 
     | 
    
         
            +
             
     | 
| 
      
 1654 
     | 
    
         
            +
              Dropzone.ERROR = "error";
         
     | 
| 
      
 1655 
     | 
    
         
            +
             
     | 
| 
      
 1656 
     | 
    
         
            +
              Dropzone.SUCCESS = "success";
         
     | 
| 
      
 1657 
     | 
    
         
            +
             
     | 
| 
      
 1658 
     | 
    
         
            +
             
     | 
| 
      
 1659 
     | 
    
         
            +
              /*
         
     | 
| 
      
 1660 
     | 
    
         
            +
              
         
     | 
| 
      
 1661 
     | 
    
         
            +
              Bugfix for iOS 6 and 7
         
     | 
| 
      
 1662 
     | 
    
         
            +
              Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios
         
     | 
| 
      
 1663 
     | 
    
         
            +
              based on the work of https://github.com/stomita/ios-imagefile-megapixel
         
     | 
| 
      
 1664 
     | 
    
         
            +
               */
         
     | 
| 
      
 1665 
     | 
    
         
            +
             
     | 
| 
      
 1666 
     | 
    
         
            +
              detectVerticalSquash = function(img) {
         
     | 
| 
      
 1667 
     | 
    
         
            +
                var alpha, canvas, ctx, data, ey, ih, iw, py, ratio, sy;
         
     | 
| 
      
 1668 
     | 
    
         
            +
                iw = img.naturalWidth;
         
     | 
| 
      
 1669 
     | 
    
         
            +
                ih = img.naturalHeight;
         
     | 
| 
      
 1670 
     | 
    
         
            +
                canvas = document.createElement("canvas");
         
     | 
| 
      
 1671 
     | 
    
         
            +
                canvas.width = 1;
         
     | 
| 
      
 1672 
     | 
    
         
            +
                canvas.height = ih;
         
     | 
| 
      
 1673 
     | 
    
         
            +
                ctx = canvas.getContext("2d");
         
     | 
| 
      
 1674 
     | 
    
         
            +
                ctx.drawImage(img, 0, 0);
         
     | 
| 
      
 1675 
     | 
    
         
            +
                data = ctx.getImageData(0, 0, 1, ih).data;
         
     | 
| 
      
 1676 
     | 
    
         
            +
                sy = 0;
         
     | 
| 
      
 1677 
     | 
    
         
            +
                ey = ih;
         
     | 
| 
      
 1678 
     | 
    
         
            +
                py = ih;
         
     | 
| 
      
 1679 
     | 
    
         
            +
                while (py > sy) {
         
     | 
| 
      
 1680 
     | 
    
         
            +
                  alpha = data[(py - 1) * 4 + 3];
         
     | 
| 
      
 1681 
     | 
    
         
            +
                  if (alpha === 0) {
         
     | 
| 
      
 1682 
     | 
    
         
            +
                    ey = py;
         
     | 
| 
      
 1683 
     | 
    
         
            +
                  } else {
         
     | 
| 
      
 1684 
     | 
    
         
            +
                    sy = py;
         
     | 
| 
      
 1685 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1686 
     | 
    
         
            +
                  py = (ey + sy) >> 1;
         
     | 
| 
      
 1687 
     | 
    
         
            +
                }
         
     | 
| 
      
 1688 
     | 
    
         
            +
                ratio = py / ih;
         
     | 
| 
      
 1689 
     | 
    
         
            +
                if (ratio === 0) {
         
     | 
| 
      
 1690 
     | 
    
         
            +
                  return 1;
         
     | 
| 
      
 1691 
     | 
    
         
            +
                } else {
         
     | 
| 
      
 1692 
     | 
    
         
            +
                  return ratio;
         
     | 
| 
      
 1693 
     | 
    
         
            +
                }
         
     | 
| 
      
 1694 
     | 
    
         
            +
              };
         
     | 
| 
      
 1695 
     | 
    
         
            +
             
     | 
| 
      
 1696 
     | 
    
         
            +
              drawImageIOSFix = function(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {
         
     | 
| 
      
 1697 
     | 
    
         
            +
                var vertSquashRatio;
         
     | 
| 
      
 1698 
     | 
    
         
            +
                vertSquashRatio = detectVerticalSquash(img);
         
     | 
| 
      
 1699 
     | 
    
         
            +
                return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio);
         
     | 
| 
      
 1700 
     | 
    
         
            +
              };
         
     | 
| 
      
 1701 
     | 
    
         
            +
             
     | 
| 
      
 1702 
     | 
    
         
            +
             
     | 
| 
      
 1703 
     | 
    
         
            +
              /*
         
     | 
| 
      
 1704 
     | 
    
         
            +
               * contentloaded.js
         
     | 
| 
      
 1705 
     | 
    
         
            +
               *
         
     | 
| 
      
 1706 
     | 
    
         
            +
               * Author: Diego Perini (diego.perini at gmail.com)
         
     | 
| 
      
 1707 
     | 
    
         
            +
               * Summary: cross-browser wrapper for DOMContentLoaded
         
     | 
| 
      
 1708 
     | 
    
         
            +
               * Updated: 20101020
         
     | 
| 
      
 1709 
     | 
    
         
            +
               * License: MIT
         
     | 
| 
      
 1710 
     | 
    
         
            +
               * Version: 1.2
         
     | 
| 
      
 1711 
     | 
    
         
            +
               *
         
     | 
| 
      
 1712 
     | 
    
         
            +
               * URL:
         
     | 
| 
      
 1713 
     | 
    
         
            +
               * http://javascript.nwbox.com/ContentLoaded/
         
     | 
| 
      
 1714 
     | 
    
         
            +
               * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE
         
     | 
| 
      
 1715 
     | 
    
         
            +
               */
         
     | 
| 
      
 1716 
     | 
    
         
            +
             
     | 
| 
      
 1717 
     | 
    
         
            +
              contentLoaded = function(win, fn) {
         
     | 
| 
      
 1718 
     | 
    
         
            +
                var add, doc, done, init, poll, pre, rem, root, top;
         
     | 
| 
      
 1719 
     | 
    
         
            +
                done = false;
         
     | 
| 
      
 1720 
     | 
    
         
            +
                top = true;
         
     | 
| 
      
 1721 
     | 
    
         
            +
                doc = win.document;
         
     | 
| 
      
 1722 
     | 
    
         
            +
                root = doc.documentElement;
         
     | 
| 
      
 1723 
     | 
    
         
            +
                add = (doc.addEventListener ? "addEventListener" : "attachEvent");
         
     | 
| 
      
 1724 
     | 
    
         
            +
                rem = (doc.addEventListener ? "removeEventListener" : "detachEvent");
         
     | 
| 
      
 1725 
     | 
    
         
            +
                pre = (doc.addEventListener ? "" : "on");
         
     | 
| 
      
 1726 
     | 
    
         
            +
                init = function(e) {
         
     | 
| 
      
 1727 
     | 
    
         
            +
                  if (e.type === "readystatechange" && doc.readyState !== "complete") {
         
     | 
| 
      
 1728 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 1729 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1730 
     | 
    
         
            +
                  (e.type === "load" ? win : doc)[rem](pre + e.type, init, false);
         
     | 
| 
      
 1731 
     | 
    
         
            +
                  if (!done && (done = true)) {
         
     | 
| 
      
 1732 
     | 
    
         
            +
                    return fn.call(win, e.type || e);
         
     | 
| 
      
 1733 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1734 
     | 
    
         
            +
                };
         
     | 
| 
      
 1735 
     | 
    
         
            +
                poll = function() {
         
     | 
| 
      
 1736 
     | 
    
         
            +
                  var e;
         
     | 
| 
      
 1737 
     | 
    
         
            +
                  try {
         
     | 
| 
      
 1738 
     | 
    
         
            +
                    root.doScroll("left");
         
     | 
| 
      
 1739 
     | 
    
         
            +
                  } catch (_error) {
         
     | 
| 
      
 1740 
     | 
    
         
            +
                    e = _error;
         
     | 
| 
      
 1741 
     | 
    
         
            +
                    setTimeout(poll, 50);
         
     | 
| 
      
 1742 
     | 
    
         
            +
                    return;
         
     | 
| 
      
 1743 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1744 
     | 
    
         
            +
                  return init("poll");
         
     | 
| 
      
 1745 
     | 
    
         
            +
                };
         
     | 
| 
      
 1746 
     | 
    
         
            +
                if (doc.readyState !== "complete") {
         
     | 
| 
      
 1747 
     | 
    
         
            +
                  if (doc.createEventObject && root.doScroll) {
         
     | 
| 
      
 1748 
     | 
    
         
            +
                    try {
         
     | 
| 
      
 1749 
     | 
    
         
            +
                      top = !win.frameElement;
         
     | 
| 
      
 1750 
     | 
    
         
            +
                    } catch (_error) {}
         
     | 
| 
      
 1751 
     | 
    
         
            +
                    if (top) {
         
     | 
| 
      
 1752 
     | 
    
         
            +
                      poll();
         
     | 
| 
      
 1753 
     | 
    
         
            +
                    }
         
     | 
| 
      
 1754 
     | 
    
         
            +
                  }
         
     | 
| 
      
 1755 
     | 
    
         
            +
                  doc[add](pre + "DOMContentLoaded", init, false);
         
     | 
| 
      
 1756 
     | 
    
         
            +
                  doc[add](pre + "readystatechange", init, false);
         
     | 
| 
      
 1757 
     | 
    
         
            +
                  return win[add](pre + "load", init, false);
         
     | 
| 
      
 1758 
     | 
    
         
            +
                }
         
     | 
| 
      
 1759 
     | 
    
         
            +
              };
         
     | 
| 
      
 1760 
     | 
    
         
            +
             
     | 
| 
      
 1761 
     | 
    
         
            +
              Dropzone._autoDiscoverFunction = function() {
         
     | 
| 
      
 1762 
     | 
    
         
            +
                if (Dropzone.autoDiscover) {
         
     | 
| 
      
 1763 
     | 
    
         
            +
                  return Dropzone.discover();
         
     | 
| 
      
 1764 
     | 
    
         
            +
                }
         
     | 
| 
      
 1765 
     | 
    
         
            +
              };
         
     | 
| 
      
 1766 
     | 
    
         
            +
             
     | 
| 
      
 1767 
     | 
    
         
            +
              contentLoaded(window, Dropzone._autoDiscoverFunction);
         
     | 
| 
      
 1768 
     | 
    
         
            +
             
     | 
| 
      
 1769 
     | 
    
         
            +
            }).call(this);
         
     |