"use strict";var _createClass=function(){function a(e,c){for(var b=0;b1?m-1:0),f=1;f=i.length){break}h=i[g++]}else{g=i.next();if(g.done){break}h=g.value}var n=h;n.apply(this,k)}}return this}},{key:"off",value:function d(h,f){if(!this._callbacks||arguments.length===0){this._callbacks={};return this}var g=this._callbacks[h];if(!g){return this}if(arguments.length===1){delete this._callbacks[h];return this}for(var e=0;e=aT.length){break}aX=aT[aY++]}else{aY=aT.next();if(aY.done){break}aX=aY.value}var aW=aX;if(/(^| )dz-message($| )/.test(aW.className)){aU=aW;aW.className="dz-message";break}}if(!aU){aU=C.createElement('
');this.element.appendChild(aU)}var aV=aU.getElementsByTagName("span")[0];if(aV){if(aV.textContent!=null){aV.textContent=this.options.dictFallbackMessage}else{if(aV.innerText!=null){aV.innerText=this.options.dictFallbackMessage}}}return this.element.appendChild(this.getFallbackForm())},resize:function ax(aU,aW,aS,aY){var aX={srcX:0,srcY:0,srcWidth:aU.width,srcHeight:aU.height};var aV=aU.width/aU.height;if(aW==null&&aS==null){aW=aX.srcWidth;aS=aX.srcHeight}else{if(aW==null){aW=aS*aV}else{if(aS==null){aS=aW/aV}}}aW=Math.min(aW,aX.srcWidth);aS=Math.min(aS,aX.srcHeight);var aT=aW/aS;if(aX.srcWidth>aW||aX.srcHeight>aS){if(aY==="crop"){if(aV>aT){aX.srcHeight=aU.height;aX.srcWidth=aX.srcHeight*aT}else{aX.srcWidth=aU.width;aX.srcHeight=aX.srcWidth/aT}}else{if(aY==="contain"){if(aV>aT){aS=aW/aV}else{aW=aS*aV}}else{throw new Error("Unknown resizeMethod '"+aY+"'")}}}aX.srcX=(aU.width-aX.srcWidth)/2;aX.srcY=(aU.height-aX.srcHeight)/2;aX.trgWidth=aW;aX.trgHeight=aS;return aX},transformFile:function aA(aT,aS){if((this.options.resizeWidth||this.options.resizeHeight)&&aT.type.match(/image.*/)){return this.resizeImage(aT,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,aS)}else{return aS(aT)}},previewTemplate:'
\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n
',drop:function az(aS){return this.element.classList.remove("dz-drag-hover")},dragstart:function ay(aS){},dragend:function ao(aS){return this.element.classList.remove("dz-drag-hover")},dragenter:function aL(aS){return this.element.classList.add("dz-drag-hover")},dragover:function aG(aS){return this.element.classList.add("dz-drag-hover")},dragleave:function ai(aS){return this.element.classList.remove("dz-drag-hover")},paste:function aP(aS){},reset:function aH(){return this.element.classList.remove("dz-started")},addedfile:function aD(aV){var aZ=this;if(this.element===this.previewsContainer){this.element.classList.add("dz-started")}if(this.previewsContainer){aV.previewElement=C.createElement(this.options.previewTemplate.trim());aV.previewTemplate=aV.previewElement;this.previewsContainer.appendChild(aV.previewElement);for(var a7=aV.previewElement.querySelectorAll("[data-dz-name]"),a0=true,a5=0,a7=a0?a7:a7[Symbol.iterator]();;){var aT;if(a0){if(a5>=a7.length){break}aT=a7[a5++]}else{a5=a7.next();if(a5.done){break}aT=a5.value}var aU=aT;aU.textContent=aV.name}for(var a6=aV.previewElement.querySelectorAll("[data-dz-size]"),aY=true,a3=0,a6=aY?a6:a6[Symbol.iterator]();;){if(aY){if(a3>=a6.length){break}aU=a6[a3++]}else{a3=a6.next();if(a3.done){break}aU=a3.value}aU.innerHTML=this.filesize(aV.size)}if(this.options.addRemoveLinks){aV._removeLink=C.createElement(''+this.options.dictRemoveFile+"");aV.previewElement.appendChild(aV._removeLink)}var aX=function aX(a8){a8.preventDefault();a8.stopPropagation();if(aV.status===C.UPLOADING){return C.confirm(aZ.options.dictCancelUploadConfirmation,function(){return aZ.removeFile(aV)})}else{if(aZ.options.dictRemoveFileConfirmation){return C.confirm(aZ.options.dictRemoveFileConfirmation,function(){return aZ.removeFile(aV)})}else{return aZ.removeFile(aV)}}};for(var a4=aV.previewElement.querySelectorAll("[data-dz-remove]"),aW=true,a2=0,a4=aW?a4:a4[Symbol.iterator]();;){var aS;if(aW){if(a2>=a4.length){break}aS=a4[a2++]}else{a2=a4.next();if(a2.done){break}aS=a2.value}var a1=aS;a1.addEventListener("click",aX)}}},removedfile:function av(aS){if(aS.previewElement!=null&&aS.previewElement.parentNode!=null){aS.previewElement.parentNode.removeChild(aS.previewElement)}return this._updateMaxFilesReachedClass()},thumbnail:function aK(aV,aY){if(aV.previewElement){aV.previewElement.classList.remove("dz-file-preview");for(var aT=aV.previewElement.querySelectorAll("[data-dz-thumbnail]"),aS=true,aW=0,aT=aS?aT:aT[Symbol.iterator]();;){var aX;if(aS){if(aW>=aT.length){break}aX=aT[aW++]}else{aW=aT.next();if(aW.done){break}aX=aW.value}var aU=aX;aU.alt=aV.name;aU.src=aY}return setTimeout(function(){return aV.previewElement.classList.add("dz-image-preview")},1)}},error:function aC(aS,aW){if(aS.previewElement){aS.previewElement.classList.add("dz-error");if(typeof aW!=="String"&&aW.error){aW=aW.error}for(var aY=aS.previewElement.querySelectorAll("[data-dz-errormessage]"),aX=true,aT=0,aY=aX?aY:aY[Symbol.iterator]();;){var aV;if(aX){if(aT>=aY.length){break}aV=aY[aT++]}else{aT=aY.next();if(aT.done){break}aV=aT.value}var aU=aV;aU.textContent=aW}}},errormultiple:function at(){},processing:function aB(aS){if(aS.previewElement){aS.previewElement.classList.add("dz-processing");if(aS._removeLink){return aS._removeLink.textContent=this.options.dictCancelUpload}}},processingmultiple:function aF(){},uploadprogress:function aI(aV,aS,aU){if(aV.previewElement){for(var aZ=aV.previewElement.querySelectorAll("[data-dz-uploadprogress]"),aY=true,aT=0,aZ=aY?aZ:aZ[Symbol.iterator]();;){var aW;if(aY){if(aT>=aZ.length){break}aW=aZ[aT++]}else{aT=aZ.next();if(aT.done){break}aW=aT.value}var aX=aW;aX.nodeName==="PROGRESS"?aX.value=aS:aX.style.width=aS+"%"}}},totaluploadprogress:function ah(){},sending:function ap(){},sendingmultiple:function aq(){},success:function aJ(aS){if(aS.previewElement){return aS.previewElement.classList.add("dz-success")}},successmultiple:function al(){},canceled:function aE(aS){return this.emit("error",aS,this.options.dictUploadCanceled)},canceledmultiple:function aN(){},complete:function aw(aS){if(aS._removeLink){aS._removeLink.textContent=this.options.dictRemoveFile}if(aS.previewElement){return aS.previewElement.classList.add("dz-complete")}},completemultiple:function am(){},maxfilesexceeded:function au(){},maxfilesreached:function ar(){},queuecomplete:function ak(){},addedfiles:function aQ(){}};this.prototype._thumbnailQueue=[];this.prototype._processingThumbnail=false}},{key:"extend",value:function o(an){for(var ai=arguments.length,ar=Array(ai>1?ai-1:0),am=1;am=ap.length){break}ah=ap[ao++]}else{ao=ap.next();if(ao.done){break}ah=ao.value}var ak=ah;for(var aq in ak){var aj=ak[aq];an[aq]=aj}}return an}}]);function C(ak,ai){_classCallCheck(this,C);var an=_possibleConstructorReturn(this,(C.__proto__||Object.getPrototypeOf(C)).call(this));var am=void 0,al=void 0;an.element=ak;an.version=C.version;an.defaultOptions.previewTemplate=an.defaultOptions.previewTemplate.replace(/\n*/g,"");an.clickableElements=[];an.listeners=[];an.files=[];if(typeof an.element==="string"){an.element=document.querySelector(an.element)}if(!an.element||an.element.nodeType==null){throw new Error("Invalid dropzone element.")}if(an.element.dropzone){throw new Error("Dropzone already attached.")}C.instances.push(an);an.element.dropzone=an;var ah=(al=C.optionsForElement(an.element))!=null?al:{};an.options=C.extend({},an.defaultOptions,ah,ai!=null?ai:{});if(an.options.forceFallback||!C.isBrowserSupported()){var aj;return aj=an.options.fallback.call(an),_possibleConstructorReturn(an,aj)}if(an.options.url==null){an.options.url=an.element.getAttribute("action")}if(!an.options.url){throw new Error("No URL provided.")}if(an.options.acceptedFiles&&an.options.acceptedMimeTypes){throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.")}if(an.options.uploadMultiple&&an.options.chunking){throw new Error("You cannot set both: uploadMultiple and chunking.")}if(an.options.acceptedMimeTypes){an.options.acceptedFiles=an.options.acceptedMimeTypes;delete an.options.acceptedMimeTypes}if(an.options.renameFilename!=null){an.options.renameFile=function(ao){return an.options.renameFilename.call(an,ao.name,ao)}}an.options.method=an.options.method.toUpperCase();if((am=an.getExistingFallback())&&am.parentNode){am.parentNode.removeChild(am)}if(an.options.previewsContainer!==false){if(an.options.previewsContainer){an.previewsContainer=C.getElement(an.options.previewsContainer,"previewsContainer")}else{an.previewsContainer=an.element}}if(an.options.clickable){if(an.options.clickable===true){an.clickableElements=[an.element]}else{an.clickableElements=C.getElements(an.options.clickable,"clickable")}}an.init();return an}_createClass(C,[{key:"getAcceptedFiles",value:function x(){return this.files.filter(function(ah){return ah.accepted}).map(function(ah){return ah})}},{key:"getRejectedFiles",value:function ab(){return this.files.filter(function(ah){return !ah.accepted}).map(function(ah){return ah})}},{key:"getFilesWithStatus",value:function i(ah){return this.files.filter(function(ai){return ai.status===ah}).map(function(ai){return ai})}},{key:"getQueuedFiles",value:function y(){return this.getFilesWithStatus(C.QUEUED)}},{key:"getUploadingFiles",value:function a(){return this.getFilesWithStatus(C.UPLOADING)}},{key:"getAddedFiles",value:function u(){return this.getFilesWithStatus(C.ADDED)}},{key:"getActiveFiles",value:function M(){return this.files.filter(function(ah){return ah.status===C.UPLOADING||ah.status===C.QUEUED}).map(function(ah){return ah})}},{key:"init",value:function Z(){var ao=this;if(this.element.tagName==="form"){this.element.setAttribute("enctype","multipart/form-data")}if(this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")){this.element.appendChild(C.createElement('
'+this.options.dictDefaultMessage+"
"))}if(this.clickableElements.length){var ar=function ar(){if(ao.hiddenFileInput){ao.hiddenFileInput.parentNode.removeChild(ao.hiddenFileInput)}ao.hiddenFileInput=document.createElement("input");ao.hiddenFileInput.setAttribute("type","file");if(ao.options.maxFiles===null||ao.options.maxFiles>1){ao.hiddenFileInput.setAttribute("multiple","multiple")}ao.hiddenFileInput.className="dz-hidden-input";if(ao.options.acceptedFiles!==null){ao.hiddenFileInput.setAttribute("accept",ao.options.acceptedFiles)}if(ao.options.capture!==null){ao.hiddenFileInput.setAttribute("capture",ao.options.capture)}ao.hiddenFileInput.style.visibility="hidden";ao.hiddenFileInput.style.position="absolute";ao.hiddenFileInput.style.top="0";ao.hiddenFileInput.style.left="0";ao.hiddenFileInput.style.height="0";ao.hiddenFileInput.style.width="0";document.querySelector(ao.options.hiddenInputContainer).appendChild(ao.hiddenFileInput);return ao.hiddenFileInput.addEventListener("change",function(){var aB=ao.hiddenFileInput.files;if(aB.length){for(var aA=aB,ax=true,az=0,aA=ax?aA:aA[Symbol.iterator]();;){var aw;if(ax){if(az>=aA.length){break}aw=aA[az++]}else{az=aA.next();if(az.done){break}aw=az.value}var ay=aw;ao.addFile(ay)}}ao.emit("addedfiles",aB);return ar()})};ar()}this.URL=window.URL!==null?window.URL:window.webkitURL;for(var al=this.events,au=true,at=0,al=au?al:al[Symbol.iterator]();;){var av;if(au){if(at>=al.length){break}av=al[at++]}else{at=al.next();if(at.done){break}av=at.value}var am=av;this.on(am,this.options[am])}this.on("uploadprogress",function(){return ao.updateTotalUploadProgress()});this.on("removedfile",function(){return ao.updateTotalUploadProgress()});this.on("canceled",function(aw){return ao.emit("complete",aw)});this.on("complete",function(aw){if(ao.getAddedFiles().length===0&&ao.getUploadingFiles().length===0&&ao.getQueuedFiles().length===0){return setTimeout(function(){return ao.emit("queuecomplete")},0)}});var ap=function ap(aw){aw.stopPropagation();if(aw.preventDefault){return aw.preventDefault()}else{return aw.returnValue=false}};this.listeners=[{element:this.element,events:{dragstart:function ah(aw){return ao.emit("dragstart",aw)},dragenter:function an(aw){ap(aw);return ao.emit("dragenter",aw)},dragover:function ak(ay){var ax=void 0;try{ax=ay.dataTransfer.effectAllowed}catch(aw){}ay.dataTransfer.dropEffect="move"===ax||"linkMove"===ax?"move":"copy";ap(ay);return ao.emit("dragover",ay)},dragleave:function aq(aw){return ao.emit("dragleave",aw)},drop:function aj(aw){ap(aw);return ao.drop(aw)},dragend:function ai(aw){return ao.emit("dragend",aw)}}}];this.clickableElements.forEach(function(aw){return ao.listeners.push({element:aw,events:{click:function ax(ay){if(aw!==ao.element||ay.target===ao.element||C.elementInside(ay.target,ao.element.querySelector(".dz-message"))){ao.hiddenFileInput.click()}return true}}})});this.enable();return this.options.init.call(this)}},{key:"destroy",value:function V(){this.disable();this.removeAllFiles(true);if(this.hiddenFileInput!=null?this.hiddenFileInput.parentNode:undefined){this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);this.hiddenFileInput=null}delete this.element.dropzone;return C.instances.splice(C.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function ag(){var ah=void 0;var ai=0;var ak=0;var am=this.getActiveFiles();if(am.length){for(var al=this.getActiveFiles(),ao=true,an=0,al=ao?al:al[Symbol.iterator]();;){var ap;if(ao){if(an>=al.length){break}ap=al[an++]}else{an=al.next();if(an.done){break}ap=an.value}var aj=ap;ai+=aj.upload.bytesSent;ak+=aj.upload.total}ah=100*ai/ak}else{ah=100}return this.emit("totaluploadprogress",ah,ak,ai)}},{key:"_getParamName",value:function J(ah){if(typeof this.options.paramName==="function"){return this.options.paramName(ah)}else{return""+this.options.paramName+(this.options.uploadMultiple?"["+ah+"]":"")}}},{key:"_renameFile",value:function ae(ah){if(typeof this.options.renameFile!=="function"){return ah.name}return this.options.renameFile(ah)}},{key:"getFallbackForm",value:function P(){var ai=void 0,aj=void 0;if(ai=this.getExistingFallback()){return ai}var ak='
';if(this.options.dictFallbackText){ak+="

"+this.options.dictFallbackText+"

"}ak+='
';var ah=C.createElement(ak);if(this.element.tagName!=="FORM"){aj=C.createElement('
');aj.appendChild(ah)}else{this.element.setAttribute("enctype","multipart/form-data");this.element.setAttribute("method",this.options.method)}return aj!=null?aj:ah}},{key:"getExistingFallback",value:function G(){var ak=function ak(ar){for(var ao=ar,am=true,an=0,ao=am?ao:ao[Symbol.iterator]();;){var ap;if(am){if(an>=ao.length){break}ap=ao[an++]}else{an=ao.next();if(an.done){break}ap=an.value}var aq=ap;if(/(^| )fallback($| )/.test(aq.className)){return aq}}};var ai=["div","form"];for(var ah=0;ah0){var ai=["tb","gb","mb","kb","b"];for(var aj=0;aj=ah){al=ak/Math.pow(this.options.filesizeBase,4-aj);an=am;break}}al=Math.round(10*al)/10}return""+al+" "+this.options.dictFileSizeUnits[an]}},{key:"_updateMaxFilesReachedClass",value:function r(){if(this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles){if(this.getAcceptedFiles().length===this.options.maxFiles){this.emit("maxfilesreached",this.files)}return this.element.classList.add("dz-max-files-reached")}else{return this.element.classList.remove("dz-max-files-reached")}}},{key:"drop",value:function A(ak){if(!ak.dataTransfer){return}this.emit("drop",ak);var aj=[];for(var ai=0;ai=ah.length){break}ai=ah[al++]}else{al=ah.next();if(al.done){break}ai=al.value}var aj=ai;this.addFile(aj)}}},{key:"_addFilesFromItems",value:function K(ah){var ai=this;return function(){var ak=[];for(var aj=ah,ap=true,ao=0,aj=ap?aj:aj[Symbol.iterator]();;){var al;if(ap){if(ao>=aj.length){break}al=aj[ao++]}else{ao=aj.next();if(ao.done){break}al=ao.value}var an=al;var am;if(an.webkitGetAsEntry!=null&&(am=an.webkitGetAsEntry())){if(am.isFile){ak.push(ai.addFile(an.getAsFile()))}else{if(am.isDirectory){ak.push(ai._addFilesFromDirectory(am,am.name))}else{ak.push(undefined)}}}else{if(an.getAsFile!=null){if(an.kind==null||an.kind==="file"){ak.push(ai.addFile(an.getAsFile()))}else{ak.push(undefined)}}else{ak.push(undefined)}}}return ak}()}},{key:"_addFilesFromDirectory",value:function w(ah,am){var ak=this;var al=ah.createReader();var aj=function aj(an){return __guardMethod__(console,"log",function(ao){return ao.log(an)})};var ai=function ai(){return al.readEntries(function(an){if(an.length>0){for(var at=an,ar=true,aq=0,at=ar?at:at[Symbol.iterator]();;){var ao;if(ar){if(aq>=at.length){break}ao=at[aq++]}else{aq=at.next();if(aq.done){break}ao=aq.value}var ap=ao;if(ap.isFile){ap.file(function(au){if(ak.options.ignoreHiddenFiles&&au.name.substring(0,1)==="."){return}au.fullPath=am+"/"+au.name;return ak.addFile(au)})}else{if(ap.isDirectory){ak._addFilesFromDirectory(ap,am+"/"+ap.name)}}}ai()}return null},aj)};return ai()}},{key:"accept",value:function g(ai,ah){if(this.options.maxFilesize&&ai.size>this.options.maxFilesize*1024*1024){return ah(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(ai.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize))}else{if(!C.isValidFile(ai,this.options.acceptedFiles)){return ah(this.options.dictInvalidFileType)}else{if(this.options.maxFiles!=null&&this.getAcceptedFiles().length>=this.options.maxFiles){ah(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles));return this.emit("maxfilesexceeded",ai)}else{return this.options.accept.call(this,ai,ah)}}}}},{key:"addFile",value:function R(ai){var ah=this;ai.upload={uuid:C.uuidv4(),progress:0,total:ai.size,bytesSent:0,filename:this._renameFile(ai),chunked:this.options.chunking&&(this.options.forceChunking||ai.size>this.options.chunkSize),totalChunkCount:Math.ceil(ai.size/this.options.chunkSize)};this.files.push(ai);ai.status=C.ADDED;this.emit("addedfile",ai);this._enqueueThumbnail(ai);return this.accept(ai,function(aj){if(aj){ai.accepted=false;ah._errorProcessing([ai],aj)}else{ai.accepted=true;if(ah.options.autoQueue){ah.enqueueFile(ai)}}return ah._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function t(aj){for(var am=aj,al=true,ak=0,am=al?am:am[Symbol.iterator]();;){var ah;if(al){if(ak>=am.length){break}ah=am[ak++]}else{ak=am.next();if(ak.done){break}ah=ak.value}var ai=ah;this.enqueueFile(ai)}return null}},{key:"enqueueFile",value:function D(ai){var ah=this;if(ai.status===C.ADDED&&ai.accepted===true){ai.status=C.QUEUED;if(this.options.autoProcessQueue){return setTimeout(function(){return ah.processQueue()},0)}}else{throw new Error("This file can't be queued because it has already been processed or was rejected.")}}},{key:"_enqueueThumbnail",value:function q(ah){var ai=this;if(this.options.createImageThumbnails&&ah.type.match(/image.*/)&&ah.size<=this.options.maxThumbnailFilesize*1024*1024){this._thumbnailQueue.push(ah);return setTimeout(function(){return ai._processThumbnailQueue()},0)}}},{key:"_processThumbnailQueue",value:function F(){var ai=this;if(this._processingThumbnail||this._thumbnailQueue.length===0){return}this._processingThumbnail=true;var ah=this._thumbnailQueue.shift();return this.createThumbnail(ah,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,true,function(aj){ai.emit("thumbnail",ah,aj);ai._processingThumbnail=false;return ai._processThumbnailQueue()})}},{key:"removeFile",value:function c(ah){if(ah.status===C.UPLOADING){this.cancelUpload(ah)}this.files=without(this.files,ah);this.emit("removedfile",ah);if(this.files.length===0){return this.emit("reset")}}},{key:"removeAllFiles",value:function d(am){if(am==null){am=false}for(var ak=this.files.slice(),aj=true,ai=0,ak=aj?ak:ak[Symbol.iterator]();;){var al;if(aj){if(ai>=ak.length){break}al=ak[ai++]}else{ai=ak.next();if(ai.done){break}al=ai.value}var ah=al;if(ah.status!==C.UPLOADING||am){this.removeFile(ah)}}return null}},{key:"resizeImage",value:function n(ai,aj,ah,al,am){var ak=this;return this.createThumbnail(ai,aj,ah,al,false,function(aq,an){if(an==null){return am(ai)}else{var ao=ak.options.resizeMimeType;if(ao==null){ao=ai.type}var ap=an.toDataURL(ao,ak.options.resizeQuality);if(ao==="image/jpeg"||ao==="image/jpg"){ap=ExifRestore.restore(ai.dataURL,ap)}return am(C.dataURItoBlob(ap))}})}},{key:"createThumbnail",value:function I(ak,al,ah,an,aj,ao){var am=this;var ai=new FileReader();ai.onload=function(){ak.dataURL=ai.result;if(ak.type==="image/svg+xml"){if(ao!=null){ao(ai.result)}return}return am.createThumbnailFromUrl(ak,al,ah,an,aj,ao)};return ai.readAsDataURL(ak)}},{key:"createThumbnailFromUrl",value:function T(ai,ah,ap,aj,am,ao,an){var ak=this;var al=document.createElement("img");if(an){al.crossOrigin=an}al.onload=function(){var aq=function aq(ar){return ar(1)};if(typeof EXIF!=="undefined"&&EXIF!==null&&am){aq=function aq(ar){return EXIF.getData(al,function(){return ar(EXIF.getTag(this,"Orientation"))})}}return aq(function(at){ai.width=al.width;ai.height=al.height;var av=ak.options.resize.call(ak,ai,ah,ap,aj);var au=document.createElement("canvas");var ar=au.getContext("2d");au.width=av.trgWidth;au.height=av.trgHeight;if(at>4){au.width=av.trgHeight;au.height=av.trgWidth}switch(at){case 2:ar.translate(au.width,0);ar.scale(-1,1);break;case 3:ar.translate(au.width,au.height);ar.rotate(Math.PI);break;case 4:ar.translate(0,au.height);ar.scale(1,-1);break;case 5:ar.rotate(0.5*Math.PI);ar.scale(1,-1);break;case 6:ar.rotate(0.5*Math.PI);ar.translate(0,-au.height);break;case 7:ar.rotate(0.5*Math.PI);ar.translate(au.width,-au.height);ar.scale(-1,1);break;case 8:ar.rotate(-0.5*Math.PI);ar.translate(-au.width,0);break}drawImageIOSFix(ar,al,av.srcX!=null?av.srcX:0,av.srcY!=null?av.srcY:0,av.srcWidth,av.srcHeight,av.trgX!=null?av.trgX:0,av.trgY!=null?av.trgY:0,av.trgWidth,av.trgHeight);var aw=au.toDataURL("image/png");if(ao!=null){return ao(aw,au)}})};if(ao!=null){al.onerror=ao}return al.src=ai.dataURL}},{key:"processQueue",value:function U(){var ak=this.options.parallelUploads;var ah=this.getUploadingFiles().length;var ai=ah;if(ah>=ak){return}var aj=this.getQueuedFiles();if(!(aj.length>0)){return}if(this.options.uploadMultiple){return this.processFiles(aj.slice(0,ak-ah))}else{while(ai=al.length){break}am=al[aj++]}else{aj=al.next();if(aj.done){break}am=aj.value}var ah=am;ah.processing=true;ah.status=C.UPLOADING;this.emit("processing",ah)}if(this.options.uploadMultiple){this.emit("processingmultiple",ak)}return this.uploadFiles(ak)}},{key:"_getFilesWithXhr",value:function s(ai){var ah=void 0;return ah=this.files.filter(function(aj){return aj.xhr===ai}).map(function(aj){return aj})}},{key:"cancelUpload",value:function aa(aj){if(aj.status===C.UPLOADING){var at=this._getFilesWithXhr(aj.xhr);for(var ai=at,aq=true,al=0,ai=aq?ai:ai[Symbol.iterator]();;){var ao;if(aq){if(al>=ai.length){break}ao=ai[al++]}else{al=ai.next();if(al.done){break}ao=al.value}var am=ao;am.status=C.CANCELED}if(typeof aj.xhr!=="undefined"){aj.xhr.abort()}for(var ah=at,an=true,ak=0,ah=an?ah:ah[Symbol.iterator]();;){var ap;if(an){if(ak>=ah.length){break}ap=ah[ak++]}else{ak=ah.next();if(ak.done){break}ap=ak.value}var ar=ap;this.emit("canceled",ar)}if(this.options.uploadMultiple){this.emit("canceledmultiple",at)}}else{if(aj.status===C.ADDED||aj.status===C.QUEUED){aj.status=C.CANCELED;this.emit("canceled",aj);if(this.options.uploadMultiple){this.emit("canceledmultiple",[aj])}}}if(this.options.autoProcessQueue){return this.processQueue()}}},{key:"resolveOption",value:function p(aj){if(typeof aj==="function"){for(var ak=arguments.length,ai=Array(ak>1?ak-1:0),ah=1;ah=am.upload.totalChunkCount){return}aq++;var av=at*ah.options.chunkSize;var ar=Math.min(av+ah.options.chunkSize,am.size);var au={name:ah._getParamName(0),data:ap.webkitSlice?ap.webkitSlice(av,ar):ap.slice(av,ar),filename:am.upload.filename,chunkIndex:at};am.upload.chunks[at]={file:am,index:at,dataBlock:au,status:C.UPLOADING,progress:0,retries:0};ah._uploadData(ai,[au])};am.upload.finishedChunkUpload=function(ar){var au=true;ar.status=C.SUCCESS;ar.dataBlock=null;for(var at=0;at=ao.length){break}aw=ao[am++]}else{am=ao.next();if(am.done){break}aw=am.value}var aG=aw;aG.xhr=av}if(aq[0].upload.chunked){aq[0].upload.chunks[ai[0].chunkIndex].xhr=av}var an=this.resolveOption(this.options.method,aq);var ap=this.resolveOption(this.options.url,aq);av.open(an,ap,true);av.timeout=this.resolveOption(this.options.timeout,aq);av.withCredentials=!!this.options.withCredentials;av.onload=function(aI){aA._finishedUploading(aq,av,aI)};av.onerror=function(){aA._handleUploadError(aq,av)};var ar=av.upload!=null?av.upload:av;ar.onprogress=function(aI){return aA._updateFilesUploadProgress(aq,av,aI)};var aj={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};if(this.options.headers){C.extend(aj,this.options.headers)}for(var az in aj){var au=aj[az];if(au){av.setRequestHeader(az,au)}}var aC=new FormData();if(this.options.params){var ax=this.options.params;if(typeof ax==="function"){ax=ax.call(this,aq,av,aq[0].upload.chunked?this._getChunk(aq[0],av):null)}for(var aH in ax){var aB=ax[aH];aC.append(aH,aB)}}for(var al=aq,aE=true,ak=0,al=aE?al:al[Symbol.iterator]();;){var at;if(aE){if(ak>=al.length){break}at=al[ak++]}else{ak=al.next();if(ak.done){break}at=ak.value}var ay=at;this.emit("sending",ay,av,aC)}if(this.options.uploadMultiple){this.emit("sendingmultiple",aq,av,aC)}this._addFormElementData(aC);for(var aD=0;aD=au.length){break}ap=au[ak++]}else{ak=au.next();if(ak.done){break}ap=ak.value}var ar=ap;var aq=ar.getAttribute("name");var ah=ar.getAttribute("type");if(ah){ah=ah.toLowerCase()}if(typeof aq==="undefined"||aq===null){continue}if(ar.tagName==="SELECT"&&ar.hasAttribute("multiple")){for(var at=ar.options,al=true,ai=0,at=al?at:at[Symbol.iterator]();;){var am;if(al){if(ai>=at.length){break}am=at[ai++]}else{ai=at.next();if(ai.done){break}am=ai.value}var ao=am;if(ao.selected){aj.append(aq,ao.value)}}}else{if(!ah||ah!=="checkbox"&&ah!=="radio"||ar.checked){aj.append(aq,ar.value)}}}}}},{key:"_updateFilesUploadProgress",value:function e(av,ay,aK){var ax=void 0;if(typeof aK!=="undefined"){ax=100*aK.loaded/aK.total;if(av[0].upload.chunked){var aL=av[0];var az=this._getChunk(aL,ay);az.progress=ax;az.total=aK.total;az.bytesSent=aK.loaded;var aJ=0,aC=void 0,aM=void 0;aL.upload.progress=0;aL.upload.total=0;aL.upload.bytesSent=0;for(var aH=0;aH=am.length){break}aw=am[al++]}else{al=am.next();if(al.done){break}aw=al.value}var ar=aw;ar.upload.progress=ax;ar.upload.total=aK.total;ar.upload.bytesSent=aK.loaded}}for(var ak=av,aF=true,aj=0,ak=aF?ak:ak[Symbol.iterator]();;){var au;if(aF){if(aj>=ak.length){break}au=ak[aj++]}else{aj=ak.next();if(aj.done){break}au=aj.value}var ap=au;this.emit("uploadprogress",ap,ap.upload.progress,ap.upload.bytesSent)}}else{var aI=true;ax=100;for(var ai=av,aE=true,aB=0,ai=aE?ai:ai[Symbol.iterator]();;){var at;if(aE){if(aB>=ai.length){break}at=ai[aB++]}else{aB=ai.next();if(aB.done){break}at=aB.value}var ao=at;if(ao.upload.progress!==100||ao.upload.bytesSent!==ao.upload.total){aI=false}ao.upload.progress=ax;ao.upload.bytesSent=ao.upload.total}if(aI){return}for(var ah=av,aD=true,aA=0,ah=aD?ah:ah[Symbol.iterator]();;){var aq;if(aD){if(aA>=ah.length){break}aq=ah[aA++]}else{aA=ah.next();if(aA.done){break}aq=aA.value}var an=aq;this.emit("uploadprogress",an,ax,an.upload.bytesSent)}}}},{key:"_finishedUploading",value:function m(aj,al,ak){var ah=void 0;if(aj[0].status===C.CANCELED){return}if(al.readyState!==4){return}if(al.responseType!=="arraybuffer"&&al.responseType!=="blob"){ah=al.responseText;if(al.getResponseHeader("content-type")&&~al.getResponseHeader("content-type").indexOf("application/json")){try{ah=JSON.parse(ah)}catch(ai){ak=ai;ah="Invalid JSON response from server."}}}this._updateFilesUploadProgress(aj);if(!(200<=al.status&&al.status<300)){this._handleUploadError(aj,al,ah)}else{if(aj[0].upload.chunked){aj[0].upload.finishedChunkUpload(this._getChunk(aj[0],al))}else{this._finished(aj,ah,ak)}}}},{key:"_handleUploadError",value:function v(ah,ap,am){if(ah[0].status===C.CANCELED){return}if(ah[0].upload.chunked&&this.options.retryChunks){var ao=this._getChunk(ah[0],ap);if(ao.retries++=an.length){break}aj=an[ai++]}else{ai=an.next();if(ai.done){break}aj=ai.value}var ak=aj;this._errorProcessing(ah,am||this.options.dictResponseError.replace("{{statusCode}}",ap.status),ap)}}},{key:"submitRequest",value:function Y(aj,ai,ah){aj.send(ai)}},{key:"_finished",value:function ac(ak,al,an){for(var am=ak,aj=true,ai=0,am=aj?am:am[Symbol.iterator]();;){var ao;if(aj){if(ai>=am.length){break}ao=am[ai++]}else{ai=am.next();if(ai.done){break}ao=ai.value}var ah=ao;ah.status=C.SUCCESS;this.emit("success",ah,al,an);this.emit("complete",ah)}if(this.options.uploadMultiple){this.emit("successmultiple",ak,al,an);this.emit("completemultiple",ak)}if(this.options.autoProcessQueue){return this.processQueue()}}},{key:"_errorProcessing",value:function H(al,ak,ao){for(var am=al,aj=true,ai=0,am=aj?am:am[Symbol.iterator]();;){var an;if(aj){if(ai>=am.length){break}an=am[ai++]}else{ai=am.next();if(ai.done){break}an=ai.value}var ah=an;ah.status=C.ERROR;this.emit("error",ah,ak,ao);this.emit("complete",ah)}if(this.options.uploadMultiple){this.emit("errormultiple",al,ak,ao);this.emit("completemultiple",al)}if(this.options.autoProcessQueue){return this.processQueue()}}}],[{key:"uuidv4",value:function W(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(aj){var ai=Math.random()*16|0,ah=aj==="x"?ai:ai&3|8;return ah.toString(16)})}}]);return C}(Emitter);Dropzone.initClass();Dropzone.version="5.4.0";Dropzone.options={};Dropzone.optionsForElement=function(a){if(a.getAttribute("id")){return Dropzone.options[camelize(a.getAttribute("id"))]}else{return undefined}};Dropzone.instances=[];Dropzone.forElement=function(a){if(typeof a==="string"){a=document.querySelector(a)}if((a!=null?a.dropzone:undefined)==null){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 a.dropzone};Dropzone.autoDiscover=true;Dropzone.discover=function(){var a=void 0;if(document.querySelectorAll){a=document.querySelectorAll(".dropzone")}else{a=[];var b=function b(c){return function(){var d=[];for(var h=c,f=true,e=0,h=f?h:h[Symbol.iterator]();;){var i;if(f){if(e>=h.length){break}i=h[e++]}else{e=h.next();if(e.done){break}i=e.value}var g=i;if(/(^| )dropzone($| )/.test(g.className)){d.push(a.push(g))}else{d.push(undefined)}}return d}()};b(document.getElementsByTagName("div"));b(document.getElementsByTagName("form"))}return function(){var c=[];for(var g=a,f=true,e=0,g=f?g:g[Symbol.iterator]();;){var h;if(f){if(e>=g.length){break}h=g[e++]}else{e=g.next();if(e.done){break}h=e.value}var d=h;if(Dropzone.optionsForElement(d)!==false){c.push(new Dropzone(d))}else{c.push(undefined)}}return c}()};Dropzone.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i];Dropzone.isBrowserSupported=function(){var d=true;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector){if(!("classList" in document.createElement("a"))){d=false}else{for(var c=Dropzone.blacklistedBrowsers,b=true,a=0,c=b?c:c[Symbol.iterator]();;){var f;if(b){if(a>=c.length){break}f=c[a++]}else{a=c.next();if(a.done){break}f=a.value}var e=f;if(e.test(navigator.userAgent)){d=false;continue}}}}else{d=false}return d};Dropzone.dataURItoBlob=function(c){var h=atob(c.split(",")[1]);var a=c.split(",")[0].split(":")[1].split(";")[0];var g=new ArrayBuffer(h.length);var d=new Uint8Array(g);for(var e=0,b=h.length,f=0<=b;f?e<=b:e>=b;f?e++:e--){d[e]=h.charCodeAt(e)}return new Blob([g],{type:a})};var without=function without(b,a){return b.filter(function(c){return c!==a}).map(function(c){return c})};var camelize=function camelize(a){return a.replace(/[\-_](\w)/g,function(b){return b.charAt(1).toUpperCase()})};Dropzone.createElement=function(a){var b=document.createElement("div");b.innerHTML=a;return b.childNodes[0]};Dropzone.elementInside=function(b,a){if(b===a){return true}while(b=b.parentNode){if(b===a){return true}}return false};Dropzone.getElement=function(c,a){var b=void 0;if(typeof c==="string"){b=document.querySelector(c)}else{if(c.nodeType!=null){b=c}}if(b==null){throw new Error("Invalid `"+a+"` option provided. Please provide a CSS selector or a plain HTML element.")}return b};Dropzone.getElements=function(d,b){var c=void 0,a=void 0;if(d instanceof Array){a=[];try{for(var g=d,l=true,j=0,g=l?g:g[Symbol.iterator]();;){if(l){if(j>=g.length){break}c=g[j++]}else{j=g.next();if(j.done){break}c=j.value}a.push(this.getElement(c,b))}}catch(h){a=null}}else{if(typeof d==="string"){a=[];for(var f=document.querySelectorAll(d),k=true,i=0,f=k?f:f[Symbol.iterator]();;){if(k){if(i>=f.length){break}c=f[i++]}else{i=f.next();if(i.done){break}c=i.value}a.push(c)}}else{if(d.nodeType!=null){a=[d]}}}if(a==null||!a.length){throw new Error("Invalid `"+b+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.")}return a};Dropzone.confirm=function(a,c,b){if(window.confirm(a)){return c()}else{if(b!=null){return b()}}};Dropzone.isValidFile=function(e,b){if(!b){return true}b=b.split(",");var c=e.type;var d=c.replace(/\/.*$/,"");for(var f=b,i=true,h=0,f=i?f:f[Symbol.iterator]();;){var a;if(i){if(h>=f.length){break}a=f[h++]}else{h=f.next();if(h.done){break}a=h.value}var g=a;g=g.trim();if(g.charAt(0)==="."){if(e.name.toLowerCase().indexOf(g.toLowerCase(),e.name.length-g.length)!==-1){return true}}else{if(/\/\*$/.test(g)){if(d===g.replace(/\/.*$/,"")){return true}}else{if(c===g){return true}}}}return false};if(typeof jQuery!=="undefined"&&jQuery!==null){jQuery.fn.dropzone=function(a){return this.each(function(){return new Dropzone(this,a)})}}if(typeof module!=="undefined"&&module!==null){module.exports=Dropzone}else{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 detectVerticalSquash(e){var b=e.naturalWidth;var k=e.naturalHeight;var a=document.createElement("canvas");a.width=1;a.height=k;var l=a.getContext("2d");l.drawImage(e,0,0);var j=l.getImageData(1,0,1,k),d=j.data;var h=0;var f=k;var i=k;while(i>h){var c=d[(i-1)*4+3];if(c===0){f=i}else{h=i}i=f+h>>1}var g=i/k;if(g===0){return 1}else{return g}};var drawImageIOSFix=function drawImageIOSFix(i,b,g,f,h,c,k,j,a,e){var d=detectVerticalSquash(b);return i.drawImage(b,g,f,h,c,k,j,a,e/d)};var ExifRestore=function(){function f(){_classCallCheck(this,f)}_createClass(f,null,[{key:"initClass",value:function b(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function i(l){var j="";var s=undefined;var q=undefined;var o="";var r=undefined;var p=undefined;var n=undefined;var m="";var k=0;while(true){s=l[k++];q=l[k++];o=l[k++];r=s>>2;p=(s&3)<<4|q>>4;n=(q&15)<<2|o>>6;m=o&63;if(isNaN(q)){n=m=64}else{if(isNaN(o)){m=64}}j=j+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(p)+this.KEY_STR.charAt(n)+this.KEY_STR.charAt(m);s=q=o="";r=p=n=m="";if(!(kk.length){break}}return l}},{key:"decode64",value:function d(n){var l="";var u=undefined;var s=undefined;var q="";var t=undefined;var r=undefined;var p=undefined;var o="";var m=0;var k=[];var j=/[^A-Za-z0-9\+\/\=]/g;if(j.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,"");while(true){t=this.KEY_STR.indexOf(n.charAt(m++));r=this.KEY_STR.indexOf(n.charAt(m++));p=this.KEY_STR.indexOf(n.charAt(m++));o=this.KEY_STR.indexOf(n.charAt(m++));u=t<<2|r>>4;s=(r&15)<<4|p>>2;q=(p&3)<<6|o;k.push(u);if(p!==64){k.push(s)}if(o!==64){k.push(q)}u=s=q="";t=r=p=o="";if(!(m