"use strict";function _typeof(n){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function _possibleConstructorReturn(n,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(n):t}function _getPrototypeOf(n){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)})(n)}function _assertThisInitialized(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function _inherits(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}});t&&_setPrototypeOf(n,t)}function _setPrototypeOf(n,t){return(_setPrototypeOf=Object.setPrototypeOf||function(n,t){return n.__proto__=t,n})(n,t)}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function _defineProperties(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function _createClass(n,t,i){return t&&_defineProperties(n.prototype,t),i&&_defineProperties(n,i),n}function __guard__(n,t){if(null!=n)return t(n)}function __guardMethod__(n,t,i){if(null!=n&&"function"==typeof n[t])return i(n,t)}var Emitter=function(){function n(){_classCallCheck(this,n)}return _createClass(n,[{key:"on",value:function(n,t){return this._callbacks=this._callbacks||{},this._callbacks[n]||(this._callbacks[n]=[]),this._callbacks[n].push(t),this}},{key:"emit",value:function(n){var r,h,i;if(this._callbacks=this._callbacks||{},r=this._callbacks[n],r){for(var u=arguments.length,e=new Array(1<u?u-1:0),t=1;t<u;t++)e[t-1]=arguments[t];var f=!0,o=!1,s=void 0;try{for(i=r[Symbol.iterator]();!(f=(h=i.next()).done);f=!0)h.value.apply(this,e)}catch(n){o=!0;s=n}finally{try{f||null==i.return||i.return()}finally{if(o)throw s;}}}return this}},{key:"off",value:function(n,t){var i,r;if(!this._callbacks||0===arguments.length)return this._callbacks={},this;if(i=this._callbacks[n],!i)return this;if(1===arguments.length)return delete this._callbacks[n],this;for(r=0;r<i.length;r++)if(i[r]===t){i.splice(r,1);break}return this}}]),n}(),Dropzone=function(){function n(t,i){var r,u,f,e;if(_classCallCheck(this,n),(r=_possibleConstructorReturn(this,_getPrototypeOf(n).call(this))).element=t,r.version=n.version,r.defaultOptions.previewTemplate=r.defaultOptions.previewTemplate.replace(/\n*/g,""),r.clickableElements=[],r.listeners=[],r.files=[],"string"==typeof r.element&&(r.element=document.querySelector(r.element)),!r.element||null==r.element.nodeType)throw new Error("Invalid dropzone element.");if(r.element.dropzone)throw new Error("Dropzone already attached.");if(n.instances.push(_assertThisInitialized(r)),r.element.dropzone=_assertThisInitialized(r),e=null!=(f=n.optionsForElement(r.element))?f:{},r.options=n.extend({},r.defaultOptions,e,null!=i?i:{}),r.options.forceFallback||!n.isBrowserSupported())return _possibleConstructorReturn(r,r.options.fallback.call(_assertThisInitialized(r)));if(null==r.options.url&&(r.options.url=r.element.getAttribute("action")),!r.options.url)throw new Error("No URL provided.");if(r.options.acceptedFiles&&r.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(r.options.uploadMultiple&&r.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return r.options.acceptedMimeTypes&&(r.options.acceptedFiles=r.options.acceptedMimeTypes,delete r.options.acceptedMimeTypes),null!=r.options.renameFilename&&(r.options.renameFile=function(n){return r.options.renameFilename.call(_assertThisInitialized(r),n.name,n)}),r.options.method=r.options.method.toUpperCase(),(u=r.getExistingFallback())&&u.parentNode&&u.parentNode.removeChild(u),!1!==r.options.previewsContainer&&(r.previewsContainer=r.options.previewsContainer?n.getElement(r.options.previewsContainer,"previewsContainer"):r.element),r.options.clickable&&(r.clickableElements=!0===r.options.clickable?[r.element]:n.getElements(r.options.clickable,"clickable")),r.init(),r}return _inherits(n,Emitter),_createClass(n,null,[{key:"initClass",value:function(){this.prototype.Emitter=Emitter;this.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"];this.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,timeout:3e4,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){},params:function(n,t,i){if(i)return{dzuuid:i.file.upload.uuid,dzchunkindex:i.index,dztotalfilesize:i.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:i.file.upload.totalChunkCount,dzchunkbyteoffset:i.index*this.options.chunkSize}},accept:function(n,t){return t()},chunksUploaded:function(n,t){t()},fallback:function(){var t,s,r,f,i;this.element.className="".concat(this.element.className," dz-browser-not-supported");var u=!0,e=!1,o=void 0;try{for(r=this.element.getElementsByTagName("div")[Symbol.iterator]();!(u=(s=r.next()).done);u=!0)if(f=s.value,/(^| )dz-message($| )/.test(f.className)){(t=f).className="dz-message";break}}catch(t){e=!0;o=t}finally{try{u||null==r.return||r.return()}finally{if(e)throw o;}}return t||(t=n.createElement('<div class="dz-message"><span><\/span><\/div>'),this.element.appendChild(t)),i=t.getElementsByTagName("span")[0],i&&(null!=i.textContent?i.textContent=this.options.dictFallbackMessage:null!=i.innerText&&(i.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(n,t,i,r){var u={srcX:0,srcY:0,srcWidth:n.width,srcHeight:n.height},f=n.width/n.height,e;if(null==t&&null==i?(t=u.srcWidth,i=u.srcHeight):null==t?t=i*f:null==i&&(i=t/f),e=(t=Math.min(t,u.srcWidth))/(i=Math.min(i,u.srcHeight)),u.srcWidth>t||u.srcHeight>i)if("crop"===r)e<f?(u.srcHeight=n.height,u.srcWidth=u.srcHeight*e):(u.srcWidth=n.width,u.srcHeight=u.srcWidth/e);else{if("contain"!==r)throw new Error("Unknown resizeMethod '".concat(r,"'"));e<f?i=t/f:t=i*f}return u.srcX=(n.width-u.srcWidth)/2,u.srcY=(n.height-u.srcHeight)/2,u.trgWidth=t,u.trgHeight=i,u},transformFile:function(n,t){return(this.options.resizeWidth||this.options.resizeHeight)&&n.type.match(/image.*/)?this.resizeImage(n,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(n)},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">\n      <title>Check<\/title>\n      <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\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" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF"><\/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">\n      <title>Error<\/title>\n      <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n        <g 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"><\/path>\n        <\/g>\n      <\/g>\n    <\/svg>\n  <\/div>\n<\/div>',drop:function(){return this.element.classList.remove("dz-drag-hover")},dragstart:function(){},dragend:function(){return this.element.classList.remove("dz-drag-hover")},dragenter:function(){return this.element.classList.add("dz-drag-hover")},dragover:function(){return this.element.classList.add("dz-drag-hover")},dragleave:function(){return this.element.classList.remove("dz-drag-hover")},paste:function(){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(t){var i=this,a,u,o,p,f,k,e;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){t.previewElement=n.createElement(this.options.previewTemplate.trim());t.previewTemplate=t.previewElement;this.previewsContainer.appendChild(t.previewElement);var r=!0,c=!1,l=void 0;try{for(u=t.previewElement.querySelectorAll("[data-dz-name]")[Symbol.iterator]();!(r=(a=u.next()).done);r=!0)o=a.value,o.textContent=t.name}catch(r){c=!0;l=r}finally{try{r||null==u.return||u.return()}finally{if(c)throw l;}}var s=!0,v=!1,y=void 0;try{for(f=t.previewElement.querySelectorAll("[data-dz-size]")[Symbol.iterator]();!(s=(p=f.next()).done);s=!0)(o=p.value).innerHTML=this.filesize(t.size)}catch(r){v=!0;y=r}finally{try{s||null==f.return||f.return()}finally{if(v)throw y;}}this.options.addRemoveLinks&&(t._removeLink=n.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'.concat(this.options.dictRemoveFile,"<\/a>")),t.previewElement.appendChild(t._removeLink));var d=function(r){return r.preventDefault(),r.stopPropagation(),t.status===n.UPLOADING?n.confirm(i.options.dictCancelUploadConfirmation,function(){return i.removeFile(t)}):i.options.dictRemoveFileConfirmation?n.confirm(i.options.dictRemoveFileConfirmation,function(){return i.removeFile(t)}):i.removeFile(t)},h=!0,w=!1,b=void 0;try{for(e=t.previewElement.querySelectorAll("[data-dz-remove]")[Symbol.iterator]();!(h=(k=e.next()).done);h=!0)k.value.addEventListener("click",d)}catch(r){w=!0;b=r}finally{try{h||null==e.return||e.return()}finally{if(w)throw b;}}}},removedfile:function(n){return null!=n.previewElement&&null!=n.previewElement.parentNode&&n.previewElement.parentNode.removeChild(n.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(n,t){var o,i,u;if(n.previewElement){n.previewElement.classList.remove("dz-file-preview");var r=!0,f=!1,e=void 0;try{for(i=n.previewElement.querySelectorAll("[data-dz-thumbnail]")[Symbol.iterator]();!(r=(o=i.next()).done);r=!0)u=o.value,u.alt=n.name,u.src=t}catch(n){f=!0;e=n}finally{try{r||null==i.return||i.return()}finally{if(f)throw e;}}return setTimeout(function(){return n.previewElement.classList.add("dz-image-preview")},1)}},error:function(n,t){var e,i;if(n.previewElement){n.previewElement.classList.add("dz-error");"String"!=typeof t&&t.error&&(t=t.error);var r=!0,u=!1,f=void 0;try{for(i=n.previewElement.querySelectorAll("[data-dz-errormessage]")[Symbol.iterator]();!(r=(e=i.next()).done);r=!0)e.value.textContent=t}catch(n){u=!0;f=n}finally{try{r||null==i.return||i.return()}finally{if(u)throw f;}}}},errormultiple:function(){},processing:function(n){if(n.previewElement&&(n.previewElement.classList.add("dz-processing"),n._removeLink))return n._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(n,t){var o,i,r;if(n.previewElement){var u=!0,f=!1,e=void 0;try{for(i=n.previewElement.querySelectorAll("[data-dz-uploadprogress]")[Symbol.iterator]();!(u=(o=i.next()).done);u=!0)r=o.value,"PROGRESS"===r.nodeName?r.value=t:r.style.width="".concat(t,"%")}catch(n){f=!0;e=n}finally{try{u||null==i.return||i.return()}finally{if(f)throw e;}}}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(n){if(n.previewElement)return n.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(n){return this.emit("error",n,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(n){if(n._removeLink&&(n._removeLink.innerHTML=this.options.dictRemoveFile),n.previewElement)return n.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}};this.prototype._thumbnailQueue=[];this.prototype._processingThumbnail=!1}},{key:"extend",value:function(n){for(var i,u,f,e,s,r=arguments.length,o=new Array(1<r?r-1:0),t=1;t<r;t++)o[t-1]=arguments[t];for(i=0,u=o;i<u.length;i++){f=u[i];for(e in f)s=f[e],n[e]=s}return n}}]),_createClass(n,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(n){return n.accepted}).map(function(n){return n})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(n){return!n.accepted}).map(function(n){return n})}},{key:"getFilesWithStatus",value:function(n){return this.files.filter(function(t){return t.status===n}).map(function(n){return n})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(n.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(n.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(n.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(t){return t.status===n.UPLOADING||t.status===n.QUEUED}).map(function(n){return n})}},{key:"init",value:function(){function f(n){var t;return(t=n).dataTransfer.types&&t.dataTransfer.types.some(function(n){return"Files"==n})&&(n.stopPropagation(),n.preventDefault?n.preventDefault():n.returnValue=!1)}var t=this,s,r,u;("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(n.createElement('<div class="dz-default dz-message"><button class="dz-button" type="button">'.concat(this.options.dictDefaultMessage,"<\/button><\/div>"))),this.clickableElements.length)&&!function h(){return t.hiddenFileInput&&t.hiddenFileInput.parentNode.removeChild(t.hiddenFileInput),t.hiddenFileInput=document.createElement("input"),t.hiddenFileInput.setAttribute("type","file"),(null===t.options.maxFiles||1<t.options.maxFiles)&&t.hiddenFileInput.setAttribute("multiple","multiple"),t.hiddenFileInput.className="dz-hidden-input",null!==t.options.acceptedFiles&&t.hiddenFileInput.setAttribute("accept",t.options.acceptedFiles),null!==t.options.capture&&t.hiddenFileInput.setAttribute("capture",t.options.capture),t.hiddenFileInput.style.visibility="hidden",t.hiddenFileInput.style.position="absolute",t.hiddenFileInput.style.top="0",t.hiddenFileInput.style.left="0",t.hiddenFileInput.style.height="0",t.hiddenFileInput.style.width="0",n.getElement(t.options.hiddenInputContainer,"hiddenInputContainer").appendChild(t.hiddenFileInput),t.hiddenFileInput.addEventListener("change",function(){var n=t.hiddenFileInput.files,e,i,o;if(n.length){var r=!0,u=!1,f=void 0;try{for(i=n[Symbol.iterator]();!(r=(e=i.next()).done);r=!0)o=e.value,t.addFile(o)}catch(n){u=!0;f=n}finally{try{r||null==i.return||i.return()}finally{if(u)throw f;}}}return t.emit("addedfiles",n),h()})}();this.URL=null!==window.URL?window.URL:window.webkitURL;var i=!0,e=!1,o=void 0;try{for(r=this.events[Symbol.iterator]();!(i=(s=r.next()).done);i=!0){u=s.value;this.on(u,this.options[u])}}catch(i){e=!0;o=i}finally{try{i||null==r.return||r.return()}finally{if(e)throw o;}}return this.on("uploadprogress",function(){return t.updateTotalUploadProgress()}),this.on("removedfile",function(){return t.updateTotalUploadProgress()}),this.on("canceled",function(n){return t.emit("complete",n)}),this.on("complete",function(){if(0===t.getAddedFiles().length&&0===t.getUploadingFiles().length&&0===t.getQueuedFiles().length)return setTimeout(function(){return t.emit("queuecomplete")},0)}),this.listeners=[{element:this.element,events:{dragstart:function(n){return t.emit("dragstart",n)},dragenter:function(n){return f(n),t.emit("dragenter",n)},dragover:function(n){var i;try{i=n.dataTransfer.effectAllowed}catch(n){}return n.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",f(n),t.emit("dragover",n)},dragleave:function(n){return t.emit("dragleave",n)},drop:function(n){return f(n),t.drop(n)},dragend:function(n){return t.emit("dragend",n)}}}],this.clickableElements.forEach(function(i){return t.listeners.push({element:i,events:{click:function(r){return i===t.element&&r.target!==t.element&&!n.elementInside(r.target,t.element.querySelector(".dz-message"))||t.hiddenFileInput.click(),!0}}})}),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),null!=this.hiddenFileInput&&this.hiddenFileInput.parentNode&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,n.instances.splice(n.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var n,i=0,r=0,s,t,f;if(this.getActiveFiles().length){var u=!0,e=!1,o=void 0;try{for(t=this.getActiveFiles()[Symbol.iterator]();!(u=(s=t.next()).done);u=!0)f=s.value,i+=f.upload.bytesSent,r+=f.upload.total}catch(n){e=!0;o=n}finally{try{u||null==t.return||t.return()}finally{if(e)throw o;}}n=100*i/r}else n=100;return this.emit("totaluploadprogress",n,r,i)}},{key:"_getParamName",value:function(n){return"function"==typeof this.options.paramName?this.options.paramName(n):"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(n,"]"):"")}},{key:"_renameFile",value:function(n){return"function"!=typeof this.options.renameFile?n.name:this.options.renameFile(n)}},{key:"getFallbackForm",value:function(){var u,i,t,r;return(u=this.getExistingFallback())?u:(t='<div class="dz-fallback">',this.options.dictFallbackText&&(t+="<p>".concat(this.options.dictFallbackText,"<\/p>")),t+='<input type="file" name="'.concat(this._getParamName(0),'" ').concat(this.options.uploadMultiple?'multiple="multiple"':void 0,' /><input type="submit" value="Upload!"><\/div>'),r=n.createElement(t),"FORM"!==this.element.tagName?(i=n.createElement('<form action="'.concat(this.options.url,'" enctype="multipart/form-data" method="').concat(this.options.method,'"><\/form>'))).appendChild(r):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=i?i:r)}},{key:"getExistingFallback",value:function(){for(var i,r,u=function(n){var i=!0,u=!1,f=void 0,e,t,r;try{for(t=n[Symbol.iterator]();!(i=(e=t.next()).done);i=!0)if(r=e.value,/(^| )fallback($| )/.test(r.className))return r}catch(n){u=!0;f=n}finally{try{i||null==t.return||t.return()}finally{if(u)throw f;}}},n=0,t=["div","form"];n<t.length;n++)if(r=t[n],i=u(this.element.getElementsByTagName(r)))return i}},{key:"setupEventListeners",value:function(){return this.listeners.map(function(n){return function(){var i=[],t,r;for(t in n.events)r=n.events[t],i.push(n.element.addEventListener(t,r,!1));return i}()})}},{key:"removeEventListeners",value:function(){return this.listeners.map(function(n){return function(){var i=[],t,r;for(t in n.events)r=n.events[t],i.push(n.element.removeEventListener(t,r,!1));return i}()})}},{key:"disable",value:function(){var n=this;return this.clickableElements.forEach(function(n){return n.classList.remove("dz-clickable")}),this.removeEventListeners(),this.disabled=!0,this.files.map(function(t){return n.cancelUpload(t)})}},{key:"enable",value:function(){return delete this.disabled,this.clickableElements.forEach(function(n){return n.classList.add("dz-clickable")}),this.setupEventListeners()}},{key:"filesize",value:function(n){var i=0,u="b",r,t,f;if(0<n){for(r=["tb","gb","mb","kb","b"],t=0;t<r.length;t++)if(f=r[t],Math.pow(this.options.filesizeBase,4-t)/10<=n){i=n/Math.pow(this.options.filesizeBase,4-t);u=f;break}i=Math.round(10*i)/10}return"<strong>".concat(i,"<\/strong> ").concat(this.options.dictFileSizeUnits[u])}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(n){var t,i,r;if(n.dataTransfer){for(this.emit("drop",n),t=[],i=0;i<n.dataTransfer.files.length;i++)t[i]=n.dataTransfer.files[i];t.length&&(r=n.dataTransfer.items,r&&r.length&&null!=r[0].webkitGetAsEntry?this._addFilesFromItems(r):this.handleFiles(t));this.emit("addedfiles",t)}}},{key:"paste",value:function(n){if(null!=__guard__(null!=n?n.clipboardData:void 0,function(n){return n.items})){this.emit("paste",n);var t=n.clipboardData.items;return t.length?this._addFilesFromItems(t):void 0}}},{key:"handleFiles",value:function(n){var i=!0,r=!1,u=void 0,f,t,e;try{for(t=n[Symbol.iterator]();!(i=(f=t.next()).done);i=!0)e=f.value,this.addFile(e)}catch(n){r=!0;u=n}finally{try{i||null==t.return||t.return()}finally{if(r)throw u;}}}},{key:"_addFilesFromItems",value:function(n){var t=this;return function(){var r=[],e=!0,o=!1,s=void 0,h,f,u,i;try{for(f=n[Symbol.iterator]();!(e=(h=f.next()).done);e=!0)i=h.value,null!=i.webkitGetAsEntry&&(u=i.webkitGetAsEntry())?u.isFile?r.push(t.addFile(i.getAsFile())):u.isDirectory?r.push(t._addFilesFromDirectory(u,u.name)):r.push(void 0):null!=i.getAsFile&&(null==i.kind||"file"===i.kind)?r.push(t.addFile(i.getAsFile())):r.push(void 0)}catch(r){o=!0;s=r}finally{try{e||null==f.return||f.return()}finally{if(o)throw s;}}return r}()}},{key:"_addFilesFromDirectory",value:function(n,t){function r(n){return __guardMethod__(console,"log",function(t){return t.log(n)})}var i=this,u=n.createReader();return function f(){return u.readEntries(function(n){var h,u,r;if(0<n.length){var e=!0,o=!1,s=void 0;try{for(u=n[Symbol.iterator]();!(e=(h=u.next()).done);e=!0)r=h.value,r.isFile?r.file(function(n){if(!i.options.ignoreHiddenFiles||"."!==n.name.substring(0,1))return n.fullPath="".concat(t,"/").concat(n.name),i.addFile(n)}):r.isDirectory&&i._addFilesFromDirectory(r,"".concat(t,"/").concat(r.name))}catch(n){o=!0;s=n}finally{try{e||null==u.return||u.return()}finally{if(o)throw s;}}f()}return null},r)}()}},{key:"accept",value:function(t,i){this.options.maxFilesize&&t.size>1048576*this.options.maxFilesize?i(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(t.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):n.isValidFile(t,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(i(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",t)):this.options.accept.call(this,t,i):i(this.options.dictInvalidFileType)}},{key:"addFile",value:function(t){var i=this;t.upload={uuid:n.uuidv4(),progress:0,total:t.size,bytesSent:0,filename:this._renameFile(t)};this.files.push(t);t.status=n.ADDED;this.emit("addedfile",t);this._enqueueThumbnail(t);this.accept(t,function(n){n?(t.accepted=!1,i._errorProcessing([t],n)):(t.accepted=!0,i.options.autoQueue&&i.enqueueFile(t));i._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(n){var i=!0,r=!1,u=void 0,f,t,e;try{for(t=n[Symbol.iterator]();!(i=(f=t.next()).done);i=!0)e=f.value,this.enqueueFile(e)}catch(n){r=!0;u=n}finally{try{i||null==t.return||t.return()}finally{if(r)throw u;}}return null}},{key:"enqueueFile",value:function(t){var i=this;if(t.status!==n.ADDED||!0!==t.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(t.status=n.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return i.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(n){var t=this;if(this.options.createImageThumbnails&&n.type.match(/image.*/)&&n.size<=1048576*this.options.maxThumbnailFilesize)return this._thumbnailQueue.push(n),setTimeout(function(){return t._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var n=this,t;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length)return this._processingThumbnail=!0,t=this._thumbnailQueue.shift(),this.createThumbnail(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(i){return n.emit("thumbnail",t,i),n._processingThumbnail=!1,n._processThumbnailQueue()})}},{key:"removeFile",value:function(t){if(t.status===n.UPLOADING&&this.cancelUpload(t),this.files=without(this.files,t),this.emit("removedfile",t),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(t){var o,i,u;null==t&&(t=!1);var r=!0,f=!1,e=void 0;try{for(i=this.files.slice()[Symbol.iterator]();!(r=(o=i.next()).done);r=!0)u=o.value,(u.status!==n.UPLOADING||t)&&this.removeFile(u)}catch(t){f=!0;e=t}finally{try{r||null==i.return||i.return()}finally{if(f)throw e;}}return null}},{key:"resizeImage",value:function(t,i,r,u,f){var e=this;return this.createThumbnail(t,i,r,u,!0,function(i,r){var u,o;return null==r?f(t):(u=e.options.resizeMimeType,null==u&&(u=t.type),o=r.toDataURL(u,e.options.resizeQuality),"image/jpeg"!==u&&"image/jpg"!==u||(o=ExifRestore.restore(t.dataURL,o)),f(n.dataURItoBlob(o)))})}},{key:"createThumbnail",value:function(n,t,i,r,u,f){var o=this,e=new FileReader;e.onload=function(){n.dataURL=e.result;"image/svg+xml"!==n.type?o.createThumbnailFromUrl(n,t,i,r,u,f):null!=f&&f(e.result)};e.readAsDataURL(n)}},{key:"displayExistingFile",value:function(n,t,i,r,u){var f=this,e=!(4<arguments.length&&void 0!==u)||u;(this.emit("addedfile",n),this.emit("complete",n),e)?(n.dataURL=t,this.createThumbnailFromUrl(n,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.resizeMethod,this.options.fixOrientation,function(t){f.emit("thumbnail",n,t);i&&i()},r)):(this.emit("thumbnail",n,t),i&&i())}},{key:"createThumbnailFromUrl",value:function(n,t,i,r,u,f,e){var s=this,o=document.createElement("img");return e&&(o.crossOrigin=e),o.onload=function(){var e=function(n){return n(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&u&&(e=function(n){return EXIF.getData(o,function(){return n(EXIF.getTag(this,"Orientation"))})}),e(function(u){var l;n.width=o.width;n.height=o.height;var e=s.options.resize.call(s,n,t,i,r),c=document.createElement("canvas"),h=c.getContext("2d");switch(c.width=e.trgWidth,c.height=e.trgHeight,4<u&&(c.width=e.trgHeight,c.height=e.trgWidth),u){case 2:h.translate(c.width,0);h.scale(-1,1);break;case 3:h.translate(c.width,c.height);h.rotate(Math.PI);break;case 4:h.translate(0,c.height);h.scale(1,-1);break;case 5:h.rotate(.5*Math.PI);h.scale(1,-1);break;case 6:h.rotate(.5*Math.PI);h.translate(0,-c.width);break;case 7:h.rotate(.5*Math.PI);h.translate(c.height,-c.width);h.scale(-1,1);break;case 8:h.rotate(-.5*Math.PI);h.translate(-c.height,0)}return drawImageIOSFix(h,o,null!=e.srcX?e.srcX:0,null!=e.srcY?e.srcY:0,e.srcWidth,e.srcHeight,null!=e.trgX?e.trgX:0,null!=e.trgY?e.trgY:0,e.trgWidth,e.trgHeight),l=c.toDataURL("image/png"),null!=f?f(l,c):void 0})},null!=f&&(o.onerror=f),o.src=n.dataURL}},{key:"processQueue",value:function(){var t=this.options.parallelUploads,i=this.getUploadingFiles().length,r=i,n;if(!(t<=i)&&(n=this.getQueuedFiles(),0<n.length)){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,t-i));for(;r<t;){if(!n.length)return;this.processFile(n.shift());r++}}}},{key:"processFile",value:function(n){return this.processFiles([n])}},{key:"processFiles",value:function(t){var u=!0,f=!1,e=void 0,o,i,r;try{for(i=t[Symbol.iterator]();!(u=(o=i.next()).done);u=!0)r=o.value,r.processing=!0,r.status=n.UPLOADING,this.emit("processing",r)}catch(t){f=!0;e=t}finally{try{u||null==i.return||i.return()}finally{if(f)throw e;}}return this.options.uploadMultiple&&this.emit("processingmultiple",t),this.uploadFiles(t)}},{key:"_getFilesWithXhr",value:function(n){return this.files.filter(function(t){return t.xhr===n}).map(function(n){return n})}},{key:"cancelUpload",value:function(t){var h,i,a,r,v;if(t.status===n.UPLOADING){var u=this._getFilesWithXhr(t.xhr),f=!0,o=!1,s=void 0;try{for(i=u[Symbol.iterator]();!(f=(h=i.next()).done);f=!0)h.value.status=n.CANCELED}catch(t){o=!0;s=t}finally{try{f||null==i.return||i.return()}finally{if(o)throw s;}}void 0!==t.xhr&&t.xhr.abort();var e=!0,c=!1,l=void 0;try{for(r=u[Symbol.iterator]();!(e=(a=r.next()).done);e=!0)v=a.value,this.emit("canceled",v)}catch(t){c=!0;l=t}finally{try{e||null==r.return||r.return()}finally{if(c)throw l;}}this.options.uploadMultiple&&this.emit("canceledmultiple",u)}else t.status!==n.ADDED&&t.status!==n.QUEUED||(t.status=n.CANCELED,this.emit("canceled",t),this.options.uploadMultiple&&this.emit("canceledmultiple",[t]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(n){if("function"!=typeof n)return n;for(var i=arguments.length,r=new Array(1<i?i-1:0),t=1;t<i;t++)r[t-1]=arguments[t];return n.apply(this,r)}},{key:"uploadFile",value:function(n){return this.uploadFiles([n])}},{key:"uploadFiles",value:function(t){var i=this;this._transformFiles(t,function(r){var s,u,e,o,h,c,f;if(i.options.chunking&&(s=r[0],t[0].upload.chunked=i.options.chunking&&(i.options.forceChunking||s.size>i.options.chunkSize),t[0].upload.totalChunkCount=Math.ceil(s.size/i.options.chunkSize)),t[0].upload.chunked)if(u=t[0],e=r[0],u.upload.chunks=[],o=function(){for(var r=0;void 0!==u.upload.chunks[r];)r++;if(!(r>=u.upload.totalChunkCount)){0;var f=r*i.options.chunkSize,o=Math.min(f+i.options.chunkSize,u.size),s={name:i._getParamName(0),data:e.webkitSlice?e.webkitSlice(f,o):e.slice(f,o),filename:u.upload.filename,chunkIndex:r};u.upload.chunks[r]={file:u,index:r,dataBlock:s,status:n.UPLOADING,progress:0,retries:0};i._uploadData(t,[s])}},u.upload.finishedChunkUpload=function(r){var e=!0,f;for(r.status=n.SUCCESS,r.dataBlock=null,r.xhr=null,f=0;f<u.upload.totalChunkCount;f++){if(void 0===u.upload.chunks[f])return o();u.upload.chunks[f].status!==n.SUCCESS&&(e=!1)}e&&i.options.chunksUploaded(u,function(){i._finished(t,"",null)})},i.options.parallelChunkUploads)for(h=0;h<u.upload.totalChunkCount;h++)o();else o();else{for(c=[],f=0;f<t.length;f++)c[f]={name:i._getParamName(f),data:r[f],filename:t[f].upload.filename};i._uploadData(t,c)}})}},{key:"_getChunk",value:function(n,t){for(var i=0;i<n.upload.totalChunkCount;i++)if(void 0!==n.upload.chunks[i]&&n.upload.chunks[i].xhr===t)return n.upload.chunks[i]}},{key:"_uploadData",value:function(t,i){var e=this,r=new XMLHttpRequest,a=!0,b=!1,k=void 0,d,o,g,nt,s,v,y,u,f,p,tt,ut,h,ft,c,l;try{for(o=t[Symbol.iterator]();!(a=(d=o.next()).done);a=!0)d.value.xhr=r}catch(i){b=!0;k=i}finally{try{a||null==o.return||o.return()}finally{if(b)throw k;}}t[0].upload.chunked&&(t[0].upload.chunks[i[0].chunkIndex].xhr=r);g=this.resolveOption(this.options.method,t);nt=this.resolveOption(this.options.url,t);r.open(g,nt,!0);r.timeout=this.resolveOption(this.options.timeout,t);r.withCredentials=!!this.options.withCredentials;r.onload=function(n){e._finishedUploading(t,r,n)};r.ontimeout=function(){e._handleUploadError(t,r,"Request timedout after ".concat(e.options.timeout," seconds"))};r.onerror=function(){e._handleUploadError(t,r)};(null!=r.upload?r.upload:r).onprogress=function(n){return e._updateFilesUploadProgress(t,r,n)};s={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(v in this.options.headers&&n.extend(s,this.options.headers),s)y=s[v],y&&r.setRequestHeader(v,y);if(u=new FormData,this.options.params){f=this.options.params;for(p in"function"==typeof f&&(f=f.call(this,t,r,t[0].upload.chunked?this._getChunk(t[0],r):null)),f)tt=f[p],u.append(p,tt)}var w=!0,it=!1,rt=void 0;try{for(h=t[Symbol.iterator]();!(w=(ut=h.next()).done);w=!0)ft=ut.value,this.emit("sending",ft,r,u)}catch(i){it=!0;rt=i}finally{try{w||null==h.return||h.return()}finally{if(it)throw rt;}}for(this.options.uploadMultiple&&this.emit("sendingmultiple",t,r,u),this._addFormElementData(u),c=0;c<i.length;c++)l=i[c],u.append(l.name,l.data,l.filename);this.submitRequest(r,u,t)}},{key:"_transformFiles",value:function(n,t){for(var r=this,u=[],f=0,e=function(i){r.options.transformFile.call(r,n[i],function(r){u[i]=r;++f===n.length&&t(u)})},i=0;i<n.length;i++)e(i)}},{key:"_addFormElementData",value:function(n){var l,r,y,u,s;if("FORM"===this.element.tagName){var f=!0,h=!1,c=void 0;try{for(r=this.element.querySelectorAll("input, textarea, select, button")[Symbol.iterator]();!(f=(l=r.next()).done);f=!0){var t=l.value,e=t.getAttribute("name"),i=t.getAttribute("type");if(i=i&&i.toLowerCase(),null!=e)if("SELECT"===t.tagName&&t.hasAttribute("multiple")){var o=!0,a=!1,v=void 0;try{for(u=t.options[Symbol.iterator]();!(o=(y=u.next()).done);o=!0)s=y.value,s.selected&&n.append(e,s.value)}catch(n){a=!0;v=n}finally{try{o||null==u.return||u.return()}finally{if(a)throw v;}}}else(!i||"checkbox"!==i&&"radio"!==i||t.checked)&&n.append(e,t.value)}}catch(n){h=!0;c=n}finally{try{f||null==r.return||r.return()}finally{if(h)throw c;}}}}},{key:"_updateFilesUploadProgress",value:function(n,t,i){var e,r,o,u,nt,s,h,rt,c,l,ot,a,f,ct,v,k;if(void 0!==i){if(e=100*i.loaded/i.total,n[0].upload.chunked){for(r=n[0],o=this._getChunk(r,t),o.progress=e,o.total=i.total,o.bytesSent=i.loaded,r.upload.progress=0,r.upload.total=0,u=r.upload.bytesSent=0;u<r.upload.totalChunkCount;u++)void 0!==r.upload.chunks[u]&&void 0!==r.upload.chunks[u].progress&&(r.upload.progress+=r.upload.chunks[u].progress,r.upload.total+=r.upload.chunks[u].total,r.upload.bytesSent+=r.upload.chunks[u].bytesSent);r.upload.progress=r.upload.progress/r.upload.totalChunkCount}else{var y=!0,d=!1,g=void 0;try{for(s=n[Symbol.iterator]();!(y=(nt=s.next()).done);y=!0)h=nt.value,h.upload.progress=e,h.upload.total=i.total,h.upload.bytesSent=i.loaded}catch(n){d=!0;g=n}finally{try{y||null==s.return||s.return()}finally{if(d)throw g;}}}var p=!0,tt=!1,it=void 0;try{for(c=n[Symbol.iterator]();!(p=(rt=c.next()).done);p=!0)l=rt.value,this.emit("uploadprogress",l,l.upload.progress,l.upload.bytesSent)}catch(n){tt=!0;it=n}finally{try{p||null==c.return||c.return()}finally{if(tt)throw it;}}}else{var ut=!0,w=!0,ft=!(e=100),et=void 0;try{for(a=n[Symbol.iterator]();!(w=(ot=a.next()).done);w=!0)f=ot.value,100===f.upload.progress&&f.upload.bytesSent===f.upload.total||(ut=!1),f.upload.progress=e,f.upload.bytesSent=f.upload.total}catch(n){ft=!0;et=n}finally{try{w||null==a.return||a.return()}finally{if(ft)throw et;}}if(ut)return;var b=!0,st=!1,ht=void 0;try{for(v=n[Symbol.iterator]();!(b=(ct=v.next()).done);b=!0)k=ct.value,this.emit("uploadprogress",k,e,k.upload.bytesSent)}catch(n){st=!0;ht=n}finally{try{b||null==v.return||v.return()}finally{if(st)throw ht;}}}}},{key:"_finishedUploading",value:function(t,i,r){var u;if(t[0].status!==n.CANCELED&&4===i.readyState){if("arraybuffer"!==i.responseType&&"blob"!==i.responseType&&(u=i.responseText,i.getResponseHeader("content-type")&&~i.getResponseHeader("content-type").indexOf("application/json")))try{u=JSON.parse(u)}catch(t){r=t;u="Invalid JSON response from server."}this._updateFilesUploadProgress(t);200<=i.status&&i.status<300?t[0].upload.chunked?t[0].upload.finishedChunkUpload(this._getChunk(t[0],i)):this._finished(t,u,r):this._handleUploadError(t,i,u)}}},{key:"_handleUploadError",value:function(t,i,r){if(t[0].status!==n.CANCELED){if(t[0].upload.chunked&&this.options.retryChunks){var u=this._getChunk(t[0],i);if(u.retries++<this.options.retryChunksLimit)return void this._uploadData(t,[u.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(t,r||this.options.dictResponseError.replace("{{statusCode}}",i.status),i)}}},{key:"submitRequest",value:function(n,t){n.send(t)}},{key:"_finished",value:function(t,i,r){var e=!0,o=!1,s=void 0,h,u,f;try{for(u=t[Symbol.iterator]();!(e=(h=u.next()).done);e=!0)f=h.value,f.status=n.SUCCESS,this.emit("success",f,i,r),this.emit("complete",f)}catch(t){o=!0;s=t}finally{try{e||null==u.return||u.return()}finally{if(o)throw s;}}if(this.options.uploadMultiple&&(this.emit("successmultiple",t,i,r),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(t,i,r){var e=!0,o=!1,s=void 0,h,u,f;try{for(u=t[Symbol.iterator]();!(e=(h=u.next()).done);e=!0)f=h.value,f.status=n.ERROR,this.emit("error",f,i,r),this.emit("complete",f)}catch(t){o=!0;s=t}finally{try{e||null==u.return||u.return()}finally{if(o)throw s;}}if(this.options.uploadMultiple&&(this.emit("errormultiple",t,i,r),this.emit("completemultiple",t)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=16*Math.random()|0;return("x"===n?t:3&t|8).toString(16)})}}]),n}(),without,camelize,contentLoaded;Dropzone.initClass();Dropzone.version="5.7.0";Dropzone.options={};Dropzone.optionsForElement=function(n){if(n.getAttribute("id"))return Dropzone.options[camelize(n.getAttribute("id"))]};Dropzone.instances=[];Dropzone.forElement=function(n){if("string"==typeof n&&(n=document.querySelector(n)),null==(null!=n?n.dropzone:void 0))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.");return n.dropzone};Dropzone.autoDiscover=!0;Dropzone.discover=function(){var n,t;return document.querySelectorAll?n=document.querySelectorAll(".dropzone"):(n=[],t=function(t){return function(){var i=[],u=!0,e=!1,o=void 0,s,r,f;try{for(r=t[Symbol.iterator]();!(u=(s=r.next()).done);u=!0)f=s.value,/(^| )dropzone($| )/.test(f.className)?i.push(n.push(f)):i.push(void 0)}catch(i){e=!0;o=i}finally{try{u||null==r.return||r.return()}finally{if(e)throw o;}}return i}()},t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))),function(){var t=[],r=!0,f=!1,e=void 0,o,i,u;try{for(i=n[Symbol.iterator]();!(r=(o=i.next()).done);r=!0)u=o.value,!1!==Dropzone.optionsForElement(u)?t.push(new Dropzone(u)):t.push(void 0)}catch(t){f=!0;e=t}finally{try{r||null==i.return||i.return()}finally{if(f)throw e;}}return t}()};Dropzone.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i];Dropzone.isBrowserSupported=function(){var n=!0,f,t;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a")){var i=!0,r=!1,u=void 0;try{for(t=Dropzone.blacklistedBrowsers[Symbol.iterator]();!(i=(f=t.next()).done);i=!0)f.value.test(navigator.userAgent)&&(n=!1)}catch(n){r=!0;u=n}finally{try{i||null==t.return||t.return()}finally{if(r)throw u;}}}else n=!1;else n=!1;return n};Dropzone.dataURItoBlob=function(n){for(var i=atob(n.split(",")[1]),e=n.split(",")[0].split(":")[1].split(";")[0],u=new ArrayBuffer(i.length),o=new Uint8Array(u),t=0,r=i.length,f=0<=r;f?t<=r:r<=t;f?t++:t--)o[t]=i.charCodeAt(t);return new Blob([u],{type:e})};without=function(n,t){return n.filter(function(n){return n!==t}).map(function(n){return n})};camelize=function(n){return n.replace(/[\-_](\w)/g,function(n){return n.charAt(1).toUpperCase()})};Dropzone.createElement=function(n){var t=document.createElement("div");return t.innerHTML=n,t.childNodes[0]};Dropzone.elementInside=function(n,t){if(n===t)return!0;for(;n=n.parentNode;)if(n===t)return!0;return!1};Dropzone.getElement=function(n,t){var i;if("string"==typeof n?i=document.querySelector(n):null!=n.nodeType&&(i=n),null==i)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector or a plain HTML element."));return i};Dropzone.getElements=function(n,t){var r,i,c,u,v,f;if(n instanceof Array){i=[];try{var e=!0,s=!1,h=void 0;try{for(u=n[Symbol.iterator]();!(e=(c=u.next()).done);e=!0)r=c.value,i.push(this.getElement(r,t))}catch(n){s=!0;h=n}finally{try{e||null==u.return||u.return()}finally{if(s)throw h;}}}catch(n){i=null}}else if("string"==typeof n){var o=!0,l=!(i=[]),a=void 0;try{for(f=document.querySelectorAll(n)[Symbol.iterator]();!(o=(v=f.next()).done);o=!0)r=v.value,i.push(r)}catch(n){l=!0;a=n}finally{try{o||null==f.return||f.return()}finally{if(l)throw a;}}}else null!=n.nodeType&&(i=[n]);if(null==i||!i.length)throw new Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));return i};Dropzone.confirm=function(n,t,i){return window.confirm(n)?t():null!=i?i():void 0};Dropzone.isValidFile=function(n,t){var s,r,i;if(!t)return!0;t=t.split(",");var f=n.type,h=f.replace(/\/.*$/,""),u=!0,e=!1,o=void 0;try{for(r=t[Symbol.iterator]();!(u=(s=r.next()).done);u=!0)if(i=s.value,"."===(i=i.trim()).charAt(0)){if(-1!==n.name.toLowerCase().indexOf(i.toLowerCase(),n.name.length-i.length))return!0}else if(/\/\*$/.test(i)){if(h===i.replace(/\/.*$/,""))return!0}else if(f===i)return!0}catch(n){e=!0;o=n}finally{try{u||null==r.return||r.return()}finally{if(e)throw o;}}return!1};"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(n){return this.each(function(){return new Dropzone(this,n)})});"undefined"!=typeof module&&null!==module?module.exports=Dropzone:window.Dropzone=Dropzone;Dropzone.ADDED="added";Dropzone.QUEUED="queued";Dropzone.ACCEPTED=Dropzone.QUEUED;Dropzone.UPLOADING="uploading";Dropzone.PROCESSING=Dropzone.UPLOADING;Dropzone.CANCELED="canceled";Dropzone.ERROR="error";Dropzone.SUCCESS="success";var detectVerticalSquash=function(n){var t,r,u,e;n.naturalWidth;t=n.naturalHeight;r=document.createElement("canvas");r.width=1;r.height=t;u=r.getContext("2d");u.drawImage(n,0,0);for(var s=u.getImageData(1,0,1,t).data,f=0,o=t,i=t;f<i;)0===s[4*(i-1)+3]?o=i:f=i,i=o+f>>1;return e=i/t,0==e?1:e},drawImageIOSFix=function(n,t,i,r,u,f,e,o,s,h){var c=detectVerticalSquash(t);return n.drawImage(t,i,r,u,f,e,o,s,h/c)},ExifRestore=function(){function n(){_classCallCheck(this,n)}return _createClass(n,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(n){for(var e="",o=void 0,i=void 0,r="",s=void 0,h=void 0,u=void 0,t="",f=0;s=(o=n[f++])>>2,h=(3&o)<<4|(i=n[f++])>>4,u=(15&i)<<2|(r=n[f++])>>6,t=63&r,isNaN(i)?u=t=64:isNaN(r)&&(t=64),e=e+this.KEY_STR.charAt(s)+this.KEY_STR.charAt(h)+this.KEY_STR.charAt(u)+this.KEY_STR.charAt(t),o=i=r="",s=h=u=t="",f<n.length;);return e}},{key:"restore",value:function(n,t){if(!n.match("data:image/jpeg;base64,"))return t;var i=this.decode64(n.replace("data:image/jpeg;base64,","")),r=this.slice2Segments(i),u=this.exifManipulation(t,r);return"data:image/jpeg;base64,".concat(this.encode64(u))}},{key:"exifManipulation",value:function(n,t){var i=this.getExifArray(t),r=this.insertExif(n,i);return new Uint8Array(r)}},{key:"getExifArray",value:function(n){for(var t=void 0,i=0;i<n.length;){if(255===(t=n[i])[0]&225===t[1])return t;i++}return[]}},{key:"insertExif",value:function(n,t){var f=n.replace("data:image/jpeg;base64,",""),i=this.decode64(f),r=i.indexOf(255,3),e=i.slice(0,r),o=i.slice(r),u=e;return(u=u.concat(t)).concat(o)}},{key:"slice2Segments",value:function(n){for(var r,u,t=0,i=[];;){if(255===n[t]&218===n[t+1])break;if(255===n[t]&216===n[t+1]?t+=2:(r=t+(256*n[t+2]+n[t+3])+2,u=n.slice(t,r),i.push(u),t=r),t>n.length)break}return i}},{key:"decode64",value:function(n){var u=void 0,f=void 0,e="",o=void 0,i=void 0,s="",t=0,r=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(n)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");u=this.KEY_STR.indexOf(n.charAt(t++))<<2|(o=this.KEY_STR.indexOf(n.charAt(t++)))>>4,f=(15&o)<<4|(i=this.KEY_STR.indexOf(n.charAt(t++)))>>2,e=(3&i)<<6|(s=this.KEY_STR.indexOf(n.charAt(t++))),r.push(u),64!==i&&r.push(f),64!==s&&r.push(e),u=f=e="",o=i=s="",t<n.length;);return r}}]),n}();ExifRestore.initClass();contentLoaded=function(n,t){function r(f){if("readystatechange"!==f.type||"complete"===i.readyState)return("load"===f.type?n:i)[h](u+f.type,r,!1),!e&&(e=!0)?t.call(n,f.type||f):void 0}var e=!1,o=!0,i=n.document,s=i.documentElement,f=i.addEventListener?"addEventListener":"attachEvent",h=i.addEventListener?"removeEventListener":"detachEvent",u=i.addEventListener?"":"on";if("complete"!==i.readyState){if(i.createEventObject&&s.doScroll){try{o=!n.frameElement}catch(o){}o&&!function n(){try{s.doScroll("left")}catch(t){return void setTimeout(n,50)}return r("poll")}()}return i[f](u+"DOMContentLoaded",r,!1),i[f](u+"readystatechange",r,!1),n[f](u+"load",r,!1)}};Dropzone._autoDiscoverFunction=function(){if(Dropzone.autoDiscover)return Dropzone.discover()};contentLoaded(window,Dropzone._autoDiscoverFunction)