From 5abbf367ab97ed3a9eb8cf64074a960036abd13c Mon Sep 17 00:00:00 2001 From: kitoy Date: Tue, 13 Jan 2026 01:53:13 +0100 Subject: [PATCH] Integrate htmx and dropzone for file Section --- .gitignore | 3 +- static/vendors/dropzone/dropzone-min.js | 2 + static/vendors/dropzone/dropzone-min.js.map | 1 + static/vendors/dropzone/dropzone.css | 1 + static/vendors/htmx/htmx.min.js | 1 + templates/_js_dropzone.html | 26 ++++ templates/_js_htmx.html | 4 + templates/css/dropzone.html | 3 + templates/files.html | 81 ++-------- templates/list_files.html | 54 +++++++ templates/myfiles.html | 86 ----------- templates/up_squelette.html | 1 + tools/utils.py | 22 +++ views/filesupload.py | 161 +++++++++++++------- views/profil.py | 27 ++-- 15 files changed, 248 insertions(+), 225 deletions(-) create mode 100644 static/vendors/dropzone/dropzone-min.js create mode 100644 static/vendors/dropzone/dropzone-min.js.map create mode 100644 static/vendors/dropzone/dropzone.css create mode 100644 static/vendors/htmx/htmx.min.js create mode 100644 templates/_js_dropzone.html create mode 100644 templates/_js_htmx.html create mode 100644 templates/css/dropzone.html create mode 100644 templates/list_files.html delete mode 100644 templates/myfiles.html diff --git a/.gitignore b/.gitignore index 2d0bb53..4bc0c62 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ *__pycache__/ -base.db +*.db log.txt config.py users/ @@ -8,3 +8,4 @@ sys *#* .* base.db.new +public/* diff --git a/static/vendors/dropzone/dropzone-min.js b/static/vendors/dropzone/dropzone-min.js new file mode 100644 index 0000000..dc25c8a --- /dev/null +++ b/static/vendors/dropzone/dropzone-min.js @@ -0,0 +1,2 @@ +!function(){function e(t){return(e=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(t)}function t(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(t=function(){return!!e})()}function i(e,t){if(t&&("object"==(t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function r(e,t){for(var i=0;i1?t-1:0),n=1;n'),this.element.appendChild(n));var a=n.getElementsByTagName("span")[0];return a&&(null!=a.textContent?a.textContent=this.options.dictFallbackMessage:null!=a.innerText&&(a.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,i,n){var r={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height;null==t&&null==i?(t=r.srcWidth,i=r.srcHeight):null==t?t=i*o:null==i&&(i=t/o);var l=(t=Math.min(t,r.srcWidth))/(i=Math.min(i,r.srcHeight));if(r.srcWidth>t||r.srcHeight>i)if("crop"===n)o>l?(r.srcHeight=e.height,r.srcWidth=r.srcHeight*l):(r.srcWidth=e.width,r.srcHeight=r.srcWidth/l);else if("contain"===n)o>l?i=t/o:t=i*o;else throw Error("Unknown resizeMethod '".concat(n,"'"));return r.srcX=(e.width-r.srcWidth)/2,r.srcY=(e.height-r.srcHeight)/2,r.trgWidth=t,r.trgHeight=i,r},transformFile:function(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:(a='
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n
\n
\n \n
\n
\n').__esModule?a.default:a,drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:function(e){},dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:function(e){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var t=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer&&!this.options.disablePreviews){e.previewElement=c.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement);var i=!0,n=!1,r=void 0;try{for(var o,l=e.previewElement.querySelectorAll("[data-dz-name]")[Symbol.iterator]();!(i=(o=l.next()).done);i=!0){var a=o.value;a.textContent=e.name}}catch(e){n=!0,r=e}finally{try{i||null==l.return||l.return()}finally{if(n)throw r}}var s=!0,u=!1,d=void 0;try{for(var h,p=e.previewElement.querySelectorAll("[data-dz-size]")[Symbol.iterator]();!(s=(h=p.next()).done);s=!0)(a=h.value).innerHTML=this.filesize(e.size)}catch(e){u=!0,d=e}finally{try{s||null==p.return||p.return()}finally{if(u)throw d}}this.options.addRemoveLinks&&(e._removeLink=c.createElement(''.concat(this.options.dictRemoveFile,"")),e.previewElement.appendChild(e._removeLink));var f=function(i){if(i.preventDefault(),i.stopPropagation(),e.status===c.UPLOADING)if(t.options.dictCancelUploadConfirmation)return c.confirm(t.options.dictCancelUploadConfirmation,function(){return t.removeFile(e)});else return t.removeFile(e);return t.options.dictRemoveFileConfirmation?c.confirm(t.options.dictRemoveFileConfirmation,function(){return t.removeFile(e)}):t.removeFile(e)},m=!0,v=!1,y=void 0;try{for(var g,b=e.previewElement.querySelectorAll("[data-dz-remove]")[Symbol.iterator]();!(m=(g=b.next()).done);m=!0)g.value.addEventListener("click",f)}catch(e){v=!0,y=e}finally{try{m||null==b.return||b.return()}finally{if(v)throw y}}}},removedfile:function(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");var i=!0,n=!1,r=void 0;try{for(var o,l=e.previewElement.querySelectorAll("[data-dz-thumbnail]")[Symbol.iterator]();!(i=(o=l.next()).done);i=!0){var a=o.value;a.alt=e.name,a.src=t}}catch(e){n=!0,r=e}finally{try{i||null==l.return||l.return()}finally{if(n)throw r}}return setTimeout(function(){return e.previewElement.classList.add("dz-image-preview")},1)}},error:function(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"string"!=typeof t&&t.error&&(t=t.error);var i=!0,n=!1,r=void 0;try{for(var o,l=e.previewElement.querySelectorAll("[data-dz-errormessage]")[Symbol.iterator]();!(i=(o=l.next()).done);i=!0)o.value.textContent=t}catch(e){n=!0,r=e}finally{try{i||null==l.return||l.return()}finally{if(n)throw r}}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t,i){var n=!0,r=!1,o=void 0;if(e.previewElement)try{for(var l,a=e.previewElement.querySelectorAll("[data-dz-uploadprogress]")[Symbol.iterator]();!(n=(l=a.next()).done);n=!0){var s=l.value;"PROGRESS"===s.nodeName?s.value=t:s.style.width="".concat(t,"%")}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){},emptyfolder:function(){}},c=function(r){"use strict";if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");function a(r,o){if(n(this,a),l=e(l=a),(u=i(this,t()?Reflect.construct(l,[],e(this).constructor):l.apply(this,s))).element=r,u.clickableElements=[],u.listeners=[],u.files=[],"string"==typeof u.element&&(u.element=document.querySelector(u.element)),null===u.element||!u.element instanceof HTMLElement)throw Error("Invalid dropzone element: not an instance of HTMLElement.");if(u.element.dropzone)throw Error("Dropzone already attached.");a.instances.push(u),u.element.dropzone=u;var l,s,u,c,h,p=null!=(h=a.optionsForElement(u.element))?h:{};if(u.options=Object.assign({},d,p,null!=o?o:{}),u.options.previewTemplate=u.options.previewTemplate.replace(/\n*/g,""),u.options.forceFallback||!a.isBrowserSupported())return i(u,u.options.fallback.call(u));if(null==u.options.url&&(u.options.url=u.element.getAttribute("action")),!u.options.url)throw Error("No URL provided.");if(u.options.uploadMultiple&&u.options.chunking)throw Error("You cannot set both: uploadMultiple and chunking.");if(u.options.binaryBody&&u.options.uploadMultiple)throw Error("You cannot set both: binaryBody and uploadMultiple.");return"string"==typeof u.options.method&&(u.options.method=u.options.method.toUpperCase()),(c=u.getExistingFallback())&&c.parentNode&&c.parentNode.removeChild(c),!1!==u.options.previewsContainer&&(u.options.previewsContainer?u.previewsContainer=a.getElement(u.options.previewsContainer,"previewsContainer"):u.previewsContainer=u.element),u.options.clickable&&(!0===u.options.clickable?u.clickableElements=[u.element]:u.clickableElements=a.getElements(u.options.clickable,"clickable")),u.init(),u}return a.prototype=Object.create(r&&r.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),r&&l(a,r),o(a,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(e){return e.accepted}).map(function(e){return e})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(e){return!e.accepted}).map(function(e){return e})}},{key:"getFilesWithStatus",value:function(e){return this.files.filter(function(t){return t.status===e}).map(function(e){return e})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(a.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(a.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(a.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(e){return e.status===a.UPLOADING||e.status===a.QUEUED}).map(function(e){return e})}},{key:"init",value:function(){var e=this;if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(a.createElement('
"))),this.clickableElements.length){var t=function(){var i;e.hiddenFileInput&&(null==(i=e.hiddenFileInput.parentNode)||i.removeChild(e.hiddenFileInput)),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),e.hiddenFileInput.setAttribute("form",e.element.id),(null===e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!==e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!==e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.setAttribute("tabindex","-1"),e.hiddenFileInput.setAttribute("aria-label","dropzone hidden input"),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",a.getElement(e.options.hiddenInputContainer,"hiddenInputContainer").appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var i=e.hiddenFileInput.files,n=!0,r=!1,o=void 0;if(i.length)try{for(var l,a=i[Symbol.iterator]();!(n=(l=a.next()).done);n=!0){var s=l.value;e.addFile(s)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}e.emit("addedfiles",i),t()})};t()}this.URL=null!==window.URL?window.URL:window.webkitURL;var i=!0,n=!1,r=void 0;try{for(var o,l=this.events[Symbol.iterator]();!(i=(o=l.next()).done);i=!0){var s=o.value;this.on(s,this.options[s])}}catch(e){n=!0,r=e}finally{try{i||null==l.return||l.return()}finally{if(n)throw r}}this.on("uploadprogress",function(){return e.updateTotalUploadProgress()}),this.on("removedfile",function(){return e.updateTotalUploadProgress()}),this.on("canceled",function(t){return e.emit("complete",t)}),this.on("complete",function(t){if(0===e.getAddedFiles().length&&0===e.getUploadingFiles().length&&0===e.getQueuedFiles().length)return setTimeout(function(){return e.emit("queuecomplete")},0)});var u=function(e){if(e.dataTransfer.types&&e.dataTransfer.types.includes("Files"))return e.stopPropagation(),e.preventDefault()};return this.listeners=[{element:this.element,events:{dragstart:function(t){return e.emit("dragstart",t)},dragenter:function(t){return u(t),e.emit("dragenter",t)},dragover:function(t){var i=t.dataTransfer.effectAllowed;return t.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",u(t),e.emit("dragover",t)},dragleave:function(t){return e.emit("dragleave",t)},drop:function(t){return u(t),e.drop(t)},dragend:function(t){return e.emit("dragend",t)}}}],this.clickableElements.forEach(function(t){return e.listeners.push({element:t,events:{click:function(i){return(t!==e.element||i.target===e.element||a.elementInside(i.target,e.element.querySelector(".dz-message")))&&e.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:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,a.instances.splice(a.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var e=0,t=0;if(this.getActiveFiles().length){var i=!0,n=!1,r=void 0;try{for(var o,l,a=this.getActiveFiles()[Symbol.iterator]();!(i=(l=a.next()).done);i=!0){var s=l.value;e+=s.upload.bytesSent,t+=s.upload.total}}catch(e){n=!0,r=e}finally{try{i||null==a.return||a.return()}finally{if(n)throw r}}o=100*e/t}else o=100;return this.emit("totaluploadprogress",o,t,e)}},{key:"_getParamName",value:function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):"".concat(this.options.paramName).concat(this.options.uploadMultiple?"[".concat(e,"]"):"")}},{key:"_renameFile",value:function(e){var t,i,n=(t=function(e){for(var t=1;t")),i+='');var n=a.createElement(i);return"FORM"!==this.element.tagName?(t=a.createElement('
'))).appendChild(n):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:n}},{key:"getExistingFallback",value:function(){for(var e=0,t=["div","form"];e0){for(var n=["tb","gb","mb","kb","b"],r=0;r=Math.pow(this.options.filesizeBase,4-r)/10){t=e/Math.pow(this.options.filesizeBase,4-r),i=o;break}}t=Math.round(10*t)/10}return"".concat(t," ").concat(this.options.dictFileSizeUnits[i])}},{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(e){if(e.dataTransfer){this.emit("drop",e);for(var t=[],i=0;i0){var n=!0,r=!1,a=void 0;try{for(var s,u=e[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){var d=s.value;d.isFile?(++o,d.file(function(e){if(!i.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath="".concat(t,"/").concat(e.name),i.addFile(e)})):d.isDirectory&&i._addFilesFromDirectory(d,"".concat(t,"/").concat(d.name))}}catch(e){r=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw a}}l()}else 0===o&&i.emit("emptyfolder",t);return null},r)};return l()}},{key:"accept",value:function(e,t){this.options.maxFilesize&&e.size>1048576*this.options.maxFilesize?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):a.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}},{key:"addFile",value:function(e){var t=this;e.upload={uuid:window.isSecureContext?self.crypto.randomUUID():a.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=a.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(i){i?(e.accepted=!1,t._errorProcessing([e],i)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(e){var t=!0,i=!1,n=void 0;try{for(var r,o=e[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var l=r.value;this.enqueueFile(l)}}catch(e){i=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(i)throw n}}return null}},{key:"enqueueFile",value:function(e){var t=this;if(e.status===a.ADDED&&!0===e.accepted){if(e.status=a.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return t.processQueue()},0)}else throw Error("This file can't be queued because it has already been processed or was rejected.")}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1048576*this.options.maxThumbnailFilesize)return this._thumbnailQueue.push(e),setTimeout(function(){return t._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var e=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var t=this._thumbnailQueue.shift();return this.createThumbnail(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(i){return e.emit("thumbnail",t,i),e._processingThumbnail=!1,e._processThumbnailQueue()})}}},{key:"removeFile",value:function(e){if(e.status===a.UPLOADING&&this.cancelUpload(e),this.files=h(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(e){null==e&&(e=!1);var t=!0,i=!1,n=void 0;try{for(var r,o=this.files.slice()[Symbol.iterator]();!(t=(r=o.next()).done);t=!0){var l=r.value;(l.status!==a.UPLOADING||e)&&this.removeFile(l)}}catch(e){i=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(i)throw n}}return null}},{key:"resizeImage",value:function(e,t,i,n,r){var o=this;return this.createThumbnail(e,t,i,n,!0,function(t,i){if(null==i)return r(e);var n=o.options.resizeMimeType;null==n&&(n=e.type);var l=i.toDataURL(n,o.options.resizeQuality);return("image/jpeg"===n||"image/jpg"===n)&&(l=function(e,t){var i="data:image/jpeg;base64,";if(!(e.startsWith(i)&&t.startsWith(i)))return t;var n=window.atob(e.slice(i.length));if(!n.startsWith("ÿØÿ"))return t;for(var r=0,o="";r6&&void 0!==arguments[6]&&arguments[6],s=new FileReader;s.onload=function(){if(e.dataURL=s.result,"image/svg+xml"===e.type){null!=o&&o(s.result);return}l.createThumbnailFromUrl(e,t,i,n,r,o,void 0,a)},s.readAsDataURL(e)}},{key:"displayExistingFile",value:function(e,t,i,n){var r=this,o=!(arguments.length>4)||void 0===arguments[4]||arguments[4];this.emit("addedfile",e),this.emit("complete",e),o?(e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,this.options.fixOrientation,function(t){r.emit("thumbnail",e,t),i&&i()},n)):(this.emit("thumbnail",e,t),i&&i())}},{key:"createThumbnailFromUrl",value:function(e,t,i,n,r,o,l){var a=this,s=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=document.createElement("img");l&&(u.crossOrigin=l),r="from-image"!=getComputedStyle(document.body).imageOrientation&&r,u.onload=function(){var l=function(e){return e(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&r&&(l=function(e){return EXIF.getData(u,function(){return e(EXIF.getTag(this,"Orientation"))})}),l(function(r){e.width=u.width,e.height=u.height;var l=a.options.resize.call(a,e,t,i,n),s=document.createElement("canvas"),d=s.getContext("2d");switch(s.width=l.trgWidth,s.height=l.trgHeight,r>4&&(s.width=l.trgHeight,s.height=l.trgWidth),r){case 2:d.translate(s.width,0),d.scale(-1,1);break;case 3:d.translate(s.width,s.height),d.rotate(Math.PI);break;case 4:d.translate(0,s.height),d.scale(1,-1);break;case 5:d.rotate(.5*Math.PI),d.scale(1,-1);break;case 6:d.rotate(.5*Math.PI),d.translate(0,-s.width);break;case 7:d.rotate(.5*Math.PI),d.translate(s.height,-s.width),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-s.height,0)}m(d,u,null!=l.srcX?l.srcX:0,null!=l.srcY?l.srcY:0,l.srcWidth,l.srcHeight,null!=l.trgX?l.trgX:0,null!=l.trgY?l.trgY:0,l.trgWidth,l.trgHeight);var c=s.toDataURL("image/png");if(null!=o)return o(c,s)})},null!=o&&(u.onerror=o);var d=e.dataURL;return s&&(d=function(e){var t="data:image/jpeg;base64,";if(!e.startsWith(t))return e;var i=window.atob(e.slice(t.length));if(!i.startsWith("ÿØÿ"))return e;for(var n=0,r="";n=e)){var n=this.getQueuedFiles();if(n.length>0)if(this.options.uploadMultiple)return this.processFiles(n.slice(0,e-t));else for(;i1?t-1:0),n=1;nt.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(n.size/t.options.chunkSize),0===n.size&&(e[0].upload.totalChunkCount=1)}if(e[0].upload.chunked){var r=e[0],o=i[0];r.upload.chunks=[];var l=function(){for(var i=0;void 0!==r.upload.chunks[i];)i++;if(!(i>=r.upload.totalChunkCount)){var n=i*t.options.chunkSize,l=Math.min(n+t.options.chunkSize,o.size),s={name:t._getParamName(0),data:o.webkitSlice?o.webkitSlice(n,l):o.slice(n,l),filename:r.upload.filename,chunkIndex:i};r.upload.chunks[i]={file:r,index:i,dataBlock:s,status:a.UPLOADING,progress:0,retries:0},t._uploadData(e,[s])}};if(r.upload.finishedChunkUpload=function(i,n){var o=!0;i.status=a.SUCCESS,i.dataBlock=null,i.response=i.xhr.responseText,i.responseHeaders=i.xhr.getAllResponseHeaders(),i.xhr=null;for(var s=0;s>e/4).toString(16)})}}]),a}(s);c.initClass(),c.options={},c.optionsForElement=function(e){return e.getAttribute("id")&&void 0!==c.options?c.options[p(e.getAttribute("id"))]:void 0},c.instances=[],c.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),(null!=e?e.dropzone:void 0)==null)throw 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 e.dropzone},c.discover=function(){var e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];var t=function(t){return function(){var i=[],n=!0,r=!1,o=void 0;try{for(var l,a=t[Symbol.iterator]();!(n=(l=a.next()).done);n=!0){var s=l.value;/(^| )dropzone($| )/.test(s.className)?i.push(e.push(s)):i.push(void 0)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return i}()};t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return function(){var t=[],i=!0,n=!1,r=void 0;try{for(var o,l=e[Symbol.iterator]();!(i=(o=l.next()).done);i=!0){var a=o.value;!1!==c.optionsForElement(a)?t.push(new c(a)):t.push(void 0)}}catch(e){n=!0,r=e}finally{try{i||null==l.return||l.return()}finally{if(n)throw r}}return t}()},c.isBrowserSupported=function(){return"undefined"!=typeof Promise},c.dataURItoBlob=function(e){for(var t=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),r=new Uint8Array(n),o=0,l=t.length,a=0<=l;a?o<=l:o>=l;a?o++:o--)r[o]=t.charCodeAt(o);return new Blob([n],{type:i})};var h=function(e,t){return e.filter(function(e){return e!==t}).map(function(e){return e})},p=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})};c.createElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},c.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},c.getElement=function(e,t){var i;if("string"==typeof e?i=document.querySelector(e):null!=e.nodeType&&(i=e),null==i)throw Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector or a plain HTML element."));return i},c.getElements=function(e,t){var i,n;if(e instanceof Array){n=[];try{var r=!0,o=!1,l=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)i=a.value,n.push(this.getElement(i,t))}catch(e){o=!0,l=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw l}}}catch(e){n=null}}else if("string"==typeof e){n=[];var u=!0,d=!1,c=void 0;try{for(var h,p=document.querySelectorAll(e)[Symbol.iterator]();!(u=(h=p.next()).done);u=!0)i=h.value,n.push(i)}catch(e){d=!0,c=e}finally{try{u||null==p.return||p.return()}finally{if(d)throw c}}}else null!=e.nodeType&&(n=[e]);if(null==n||!n.length)throw Error("Invalid `".concat(t,"` option provided. Please provide a CSS selector, a plain HTML element or a list of those."));return n},c.confirm=function(e,t,i){return window.confirm(e)?t():null!=i?i():void 0},c.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");var i=e.type,n=i.replace(/\/.*$/,""),r=!0,o=!1,l=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value;if(u=u.trim(),"."===u.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(u.toLowerCase(),e.name.length-u.length))return!0}else if(/\/\*$/.test(u)){if(n===u.replace(/\/.*$/,""))return!0}else if(i===u)return!0}}catch(e){o=!0,l=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw l}}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new c(this,e)})}),c.ADDED="added",c.QUEUED="queued",c.ACCEPTED=c.QUEUED,c.UPLOADING="uploading",c.PROCESSING=c.UPLOADING,c.CANCELED="canceled",c.ERROR="error",c.SUCCESS="success";var f=function(e){var t=e.naturalHeight,i=document.createElement("canvas");i.width=1,i.height=t;var n=i.getContext("2d");n.drawImage(e,0,0);for(var r=n.getImageData(1,0,1,t).data,o=0,l=t,a=t;a>o;)0===r[(a-1)*4+3]?l=a:o=a,a=l+o>>1;var s=a/t;return 0===s?1:s},m=function(e,t,i,n,r,o,l,a,s,u){var d=f(t);return e.drawImage(t,i,n,r,o,l,a,s,u/d)};window.Dropzone=c}(); +//# sourceMappingURL=dropzone-min.js.map diff --git a/static/vendors/dropzone/dropzone-min.js.map b/static/vendors/dropzone/dropzone-min.js.map new file mode 100644 index 0000000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AK,CAAG,EACf,EAAO,MAAM,CAAG,EAChB,IAAI,EAAM,EAAO,UAAU,CAAC,MAC5B,EAAI,SAAS,CAAC,EAAK,EAAG,GAOtB,IANA,IAAM,EAAS,EAAI,YAAY,CAAC,EAAG,EAAG,EAAG,GAAnC,IAAN,CAGI,EAAK,EACL,EAAK,EACL,EAAK,EACF,EAAK,GAGN,AAAU,IAFF,CAAI,CAAE,AAAA,CAAA,EAAK,CAAA,EAAK,EAAI,EAAE,CAGhC,EAAK,EAEL,EAAK,EAGP,EAAM,EAAK,GAAO,EAEpB,IAAI,EAAQ,EAAK,SAEjB,AAAI,AAAU,IAAV,EACK,EAEA,CAEX,EAII,EAAkB,SAAU,CAAG,CAAE,CAAG,CAAE,CAAE,CAAE,CAAE,CAAE,CAAE,CAAE,CAAE,CAAE,CAAE,CAAE,CAAE,CAAE,CAAE,CAAE,CAAE,EACtE,IAAI,EAAkB,EAAqB,GAC3C,OAAO,EAAI,SAAS,CAAC,EAAK,EAAI,EAAI,EAAI,EAAI,EAAI,EAAI,EAAI,EAAK,EAC7D,CDt+DA,CAAA,OAAO,QAAQ,CAAG,C","sources":["","tool/dropzone-global.js","src/dropzone.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_call_super.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_get_prototype_of.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_is_native_reflect_construct.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_possible_constructor_return.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_assert_this_initialized.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_type_of.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_class_call_check.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_create_class.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_inherits.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_set_prototype_of.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_object_spread.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_define_property.js","../../../.yarn/berry/cache/@swc-helpers-npm-0.5.17-53974f71e8-10c0.zip/node_modules/@swc/helpers/esm/_object_spread_props.js","src/emitter.js","src/options.js","../../../.yarn/berry/cache/@parcel-runtime-js-npm-2.15.2-0c6eca82b3-10c0.zip/node_modules/@parcel/runtime-js/lib/bundles/runtime-bee8ab093840c5f7.js"],"sourcesContent":["(function () {\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\nfunction $98824e80807ab8c4$export$71511d61b312f219(o) {\n $98824e80807ab8c4$export$71511d61b312f219 = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return $98824e80807ab8c4$export$71511d61b312f219(o);\n}\n\n\nfunction $ea4a107a74d16add$export$71511d61b312f219() {\n // Since Reflect.construct can't be properly polyfilled, some\n // implementations (e.g. core-js@2) don't set the correct internal slots.\n // Those polyfills don't allow us to subclass built-ins, so we need to\n // use our fallback implementation.\n try {\n // If the internal slots aren't set, this throws an error similar to\n // TypeError: this is not a Boolean object.\n var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n } catch (_) {}\n return ($ea4a107a74d16add$export$71511d61b312f219 = function() {\n return !!result;\n })();\n}\n\n\nfunction $ce1e1ea6d79f198e$export$71511d61b312f219(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return self;\n}\n\n\nfunction $38a053afedb38620$export$71511d61b312f219(obj) {\n \"@swc/helpers - typeof\";\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\n\n\nfunction $d13763098d3cb1e3$export$71511d61b312f219(self, call) {\n if (call && ((0, $38a053afedb38620$export$71511d61b312f219)(call) === \"object\" || typeof call === \"function\")) return call;\n return (0, $ce1e1ea6d79f198e$export$71511d61b312f219)(self);\n}\n\n\nfunction $4eb3f5b914cad40a$export$71511d61b312f219(_this, derived, args) {\n // Super\n derived = (0, $98824e80807ab8c4$export$71511d61b312f219)(derived);\n return (0, $d13763098d3cb1e3$export$71511d61b312f219)(_this, (0, $ea4a107a74d16add$export$71511d61b312f219)() ? Reflect.construct(derived, args || [], (0, $98824e80807ab8c4$export$71511d61b312f219)(_this).constructor) : derived.apply(_this, args));\n}\n\n\nfunction $a09c5fed926355a1$export$71511d61b312f219(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\n\n\nfunction $273e99875a375f47$var$_defineProperties(target, props) {\n for(var i = 0; i < props.length; i++){\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction $273e99875a375f47$export$71511d61b312f219(Constructor, protoProps, staticProps) {\n if (protoProps) $273e99875a375f47$var$_defineProperties(Constructor.prototype, protoProps);\n if (staticProps) $273e99875a375f47$var$_defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\n\nfunction $e97e5092cb7916e1$export$71511d61b312f219(o, p) {\n $e97e5092cb7916e1$export$71511d61b312f219 = Object.setPrototypeOf || function setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return $e97e5092cb7916e1$export$71511d61b312f219(o, p);\n}\n\n\nfunction $691dd4abc3adf869$export$71511d61b312f219(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) throw new TypeError(\"Super expression must either be null or a function\");\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) (0, $e97e5092cb7916e1$export$71511d61b312f219)(subClass, superClass);\n}\n\n\nfunction $642a695eaf3f3e53$export$71511d61b312f219(obj, key, value) {\n if (key in obj) Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n else obj[key] = value;\n return obj;\n}\n\n\nfunction $37fa8c4a256d3c34$export$71511d61b312f219(target) {\n for(var i = 1; i < arguments.length; i++){\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n if (typeof Object.getOwnPropertySymbols === \"function\") ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n ownKeys.forEach(function(key) {\n (0, $642a695eaf3f3e53$export$71511d61b312f219)(target, key, source[key]);\n });\n }\n return target;\n}\n\n\nfunction $9196d606ce819a5b$var$ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction $9196d606ce819a5b$export$71511d61b312f219(target, source) {\n source = source != null ? source : {};\n if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n else $9196d606ce819a5b$var$ownKeys(Object(source)).forEach(function(key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n return target;\n}\n\n\n\n// The Emitter class provides the ability to call `.on()` on Dropzone to listen\n// to events.\n// It is strongly based on component's emitter class, and I removed the\n// functionality because of the dependency hell with different frameworks.\n\n\nvar $a527f8347b4b94dc$export$2e2bcd8739ae039 = /*#__PURE__*/ function() {\n \"use strict\";\n function Emitter() {\n (0, $a09c5fed926355a1$export$71511d61b312f219)(this, Emitter);\n }\n (0, $273e99875a375f47$export$71511d61b312f219)(Emitter, [\n {\n // Add an event listener for given event\n key: \"on\",\n value: function on(event, fn) {\n this._callbacks = this._callbacks || {};\n // Create namespace for this event\n if (!this._callbacks[event]) this._callbacks[event] = [];\n this._callbacks[event].push(fn);\n return this;\n }\n },\n {\n key: \"emit\",\n value: function emit(event) {\n for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){\n args[_key - 1] = arguments[_key];\n }\n this._callbacks = this._callbacks || {};\n var callbacks = this._callbacks[event];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n if (callbacks) try {\n for(var _iterator = callbacks[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var callback = _step.value;\n callback.apply(this, args);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n // trigger a corresponding DOM event\n if (this.element) this.element.dispatchEvent(this.makeEvent(\"dropzone:\" + event, {\n args: args\n }));\n return this;\n }\n },\n {\n key: \"makeEvent\",\n value: function makeEvent(eventName, detail) {\n var params = {\n bubbles: true,\n cancelable: true,\n detail: detail\n };\n if (typeof window.CustomEvent === \"function\") return new CustomEvent(eventName, params);\n else {\n // IE 11 support\n // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent\n var evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail);\n return evt;\n }\n }\n },\n {\n // Remove event listener for given event. If fn is not provided, all event\n // listeners for that event will be removed. If neither is provided, all\n // event listeners will be removed.\n key: \"off\",\n value: function off(event, fn) {\n if (!this._callbacks || arguments.length === 0) {\n this._callbacks = {};\n return this;\n }\n // specific event\n var callbacks = this._callbacks[event];\n if (!callbacks) return this;\n // remove all handlers\n if (arguments.length === 1) {\n delete this._callbacks[event];\n return this;\n }\n // remove specific handler\n for(var i = 0; i < callbacks.length; i++){\n var callback = callbacks[i];\n if (callback === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n return this;\n }\n }\n ]);\n return Emitter;\n}();\n\n\n\nvar $5804b5cb637998e0$exports = {};\n$5804b5cb637998e0$exports = \"
\\n
\\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n
\\n \\n
\\n
\\n \\n
\\n
\\n\";\n\n\nvar $588a9ad8284f77de$var$defaultOptions = {\n /**\n * Has to be specified on elements other than form (or when the form doesn't\n * have an `action` attribute).\n *\n * You can also provide a function that will be called with `files` and\n * `dataBlocks` and must return the url as string.\n */ url: null,\n /**\n * Can be changed to `\"put\"` if necessary. You can also provide a function\n * that will be called with `files` and must return the method (since `v3.12.0`).\n */ method: \"post\",\n /**\n * Will be set on the XHRequest.\n */ withCredentials: false,\n /**\n * The timeout for the XHR requests in milliseconds (since `v4.4.0`).\n * If set to null or 0, no timeout is going to be set.\n */ timeout: null,\n /**\n * How many file uploads to process in parallel (See the\n * Enqueuing file uploads documentation section for more info)\n */ parallelUploads: 2,\n /**\n * Whether to send multiple files in one request. If\n * this it set to true, then the fallback file input element will\n * have the `multiple` attribute as well. This option will\n * also trigger additional events (like `processingmultiple`). See the events\n * documentation section for more information.\n */ uploadMultiple: false,\n /**\n * Whether you want files to be uploaded in chunks to your server. This can't be\n * used in combination with `uploadMultiple`.\n *\n * See [chunksUploaded](#config-chunksUploaded) for the callback to finalise an upload.\n */ chunking: false,\n /**\n * If `chunking` is enabled, this defines whether **every** file should be chunked,\n * even if the file size is below chunkSize. This means, that the additional chunk\n * form data will be submitted and the `chunksUploaded` callback will be invoked.\n */ forceChunking: false,\n /**\n * If `chunking` is `true`, then this defines the chunk size in bytes.\n */ chunkSize: 2097152,\n /**\n * If `true`, the individual chunks of a file are being uploaded simultaneously.\n * The limit of concurrent connections is governed by `parallelUploads`.\n */ parallelChunkUploads: false,\n /**\n * Whether a chunk should be retried if it fails.\n */ retryChunks: false,\n /**\n * If `retryChunks` is true, how many times should it be retried.\n */ retryChunksLimit: 3,\n /**\n * The maximum filesize (in MiB) that is allowed to be uploaded.\n */ maxFilesize: 256,\n /**\n * The name of the file param that gets transferred.\n * **NOTE**: If you have the option `uploadMultiple` set to `true`, then\n * Dropzone will append `[]` to the name.\n */ paramName: \"file\",\n /**\n * Whether thumbnails for images should be generated\n */ createImageThumbnails: true,\n /**\n * In MB. When the filename exceeds this limit, the thumbnail will not be generated.\n */ maxThumbnailFilesize: 10,\n /**\n * If `null`, the ratio of the image will be used to calculate it.\n */ thumbnailWidth: 120,\n /**\n * The same as `thumbnailWidth`. If both are null, images will not be resized.\n */ thumbnailHeight: 120,\n /**\n * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided.\n * Can be either `contain` or `crop`.\n */ thumbnailMethod: \"crop\",\n /**\n * If set, images will be resized to these dimensions before being **uploaded**.\n * If only one, `resizeWidth` **or** `resizeHeight` is provided, the original aspect\n * ratio of the file will be preserved.\n *\n * The `options.transformFile` function uses these options, so if the `transformFile` function\n * is overridden, these options don't do anything.\n */ resizeWidth: null,\n /**\n * See `resizeWidth`.\n */ resizeHeight: null,\n /**\n * The mime type of the resized image (before it gets uploaded to the server).\n * If `null` the original mime type will be used. To force jpeg, for example, use `image/jpeg`.\n * See `resizeWidth` for more information.\n */ resizeMimeType: null,\n /**\n * The quality of the resized images. See `resizeWidth`.\n */ resizeQuality: 0.8,\n /**\n * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided.\n * Can be either `contain` or `crop`.\n */ resizeMethod: \"contain\",\n /**\n * The base that is used to calculate the **displayed** filesize. You can\n * change this to 1024 if you would rather display kibibytes, mebibytes,\n * etc... 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte`\n * not `1 kilobyte`. You can change this to `1024` if you don't care about\n * validity.\n */ filesizeBase: 1000,\n /**\n * If not `null` defines how many files this Dropzone handles. If it exceeds,\n * the event `maxfilesexceeded` will be called. The dropzone element gets the\n * class `dz-max-files-reached` accordingly so you can provide visual\n * feedback.\n */ maxFiles: null,\n /**\n * An optional object to send additional headers to the server. Eg:\n * `{ \"My-Awesome-Header\": \"header value\" }`\n */ headers: null,\n /**\n * Should the default headers be set or not?\n * Accept: application/json <- for requesting json response\n * Cache-Control: no-cache <- Request shouldn't be cached\n * X-Requested-With: XMLHttpRequest <- We sent the request via XMLHttpRequest\n */ defaultHeaders: true,\n /**\n * If `true`, the dropzone element itself will be clickable, if `false`\n * nothing will be clickable.\n *\n * You can also pass an HTML element, a CSS selector (for multiple elements)\n * or an array of those. In that case, all of those elements will trigger an\n * upload when clicked.\n */ clickable: true,\n /**\n * Whether hidden files in directories should be ignored.\n */ ignoreHiddenFiles: true,\n /**\n * The default implementation of `accept` checks the file's mime type or\n * extension against this list. This is a comma separated list of mime\n * types or file extensions.\n *\n * Eg.: `image/*,application/pdf,.psd`\n *\n * If the Dropzone is `clickable` this option will also be used as\n * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept)\n * parameter on the hidden file input as well.\n */ acceptedFiles: null,\n /**\n * If false, files will be added to the queue but the queue will not be\n * processed automatically.\n * This can be useful if you need some additional user input before sending\n * files (or if you want want all files sent at once).\n * If you're ready to send the file simply call `myDropzone.processQueue()`.\n *\n * See the [enqueuing file uploads](#enqueuing-file-uploads) documentation\n * section for more information.\n */ autoProcessQueue: true,\n /**\n * If false, files added to the dropzone will not be queued by default.\n * You'll have to call `enqueueFile(file)` manually.\n */ autoQueue: true,\n /**\n * If `true`, this will add a link to every file preview to remove or cancel (if\n * already uploading) the file. The `dictCancelUpload`, `dictCancelUploadConfirmation`\n * and `dictRemoveFile` options are used for the wording.\n */ addRemoveLinks: false,\n /**\n * Defines where to display the file previews – if `null` the\n * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS\n * selector. The element should have the `dropzone-previews` class so\n * the previews are displayed properly.\n */ previewsContainer: null,\n /**\n * Set this to `true` if you don't want previews to be shown.\n */ disablePreviews: false,\n /**\n * This is the element the hidden input field (which is used when clicking on the\n * dropzone to trigger file selection) will be appended to. This might\n * be important in case you use frameworks to switch the content of your page.\n *\n * Can be a selector string, or an element directly.\n */ hiddenInputContainer: \"body\",\n /**\n * If null, no capture type will be specified\n * If camera, mobile devices will skip the file selection and choose camera\n * If microphone, mobile devices will skip the file selection and choose the microphone\n * If camcorder, mobile devices will skip the file selection and choose the camera in video mode\n * On apple devices multiple must be set to false. AcceptedFiles may need to\n * be set to an appropriate mime type (e.g. \"image/*\", \"audio/*\", or \"video/*\").\n */ capture: null,\n /**\n * **Deprecated**. Use `renameFile` instead.\n */ renameFilename: null,\n /**\n * A function that is invoked before the file is uploaded to the server and renames the file.\n * This function gets the `File` as argument and can use the `file.name`. The actual name of the\n * file that gets used during the upload can be accessed through `file.upload.filename`.\n */ renameFile: null,\n /**\n * If `true` the fallback will be forced. This is very useful to test your server\n * implementations first and make sure that everything works as\n * expected without dropzone if you experience problems, and to test\n * how your fallbacks will look.\n */ forceFallback: false,\n /**\n * The text used before any files are dropped.\n */ dictDefaultMessage: \"Drop files here to upload\",\n /**\n * The text that replaces the default message text it the browser is not supported.\n */ dictFallbackMessage: \"Your browser does not support drag'n'drop file uploads.\",\n /**\n * The text that will be added before the fallback form.\n * If you provide a fallback element yourself, or if this option is `null` this will\n * be ignored.\n */ dictFallbackText: \"Please use the fallback form below to upload your files like in the olden days.\",\n /**\n * If the filesize is too big.\n * `{{filesize}}` and `{{maxFilesize}}` will be replaced with the respective configuration values.\n */ dictFileTooBig: \"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.\",\n /**\n * If the file doesn't match the file type.\n */ dictInvalidFileType: \"You can't upload files of this type.\",\n /**\n * If the server response was invalid.\n * `{{statusCode}}` will be replaced with the servers status code.\n */ dictResponseError: \"Server responded with {{statusCode}} code.\",\n /**\n * If `addRemoveLinks` is true, the text to be used for the cancel upload link.\n */ dictCancelUpload: \"Cancel upload\",\n /**\n * The text that is displayed if an upload was manually canceled\n */ dictUploadCanceled: \"Upload canceled.\",\n /**\n * If `addRemoveLinks` is true, the text to be used for confirmation when cancelling upload.\n */ dictCancelUploadConfirmation: \"Are you sure you want to cancel this upload?\",\n /**\n * If `addRemoveLinks` is true, the text to be used to remove a file.\n */ dictRemoveFile: \"Remove file\",\n /**\n * If this is not null, then the user will be prompted before removing a file.\n */ dictRemoveFileConfirmation: null,\n /**\n * Displayed if `maxFiles` is st and exceeded.\n * The string `{{maxFiles}}` will be replaced by the configuration value.\n */ dictMaxFilesExceeded: \"You cannot upload any more files.\",\n /**\n * Allows you to translate the different units. Starting with `tb` for terabytes and going down to\n * `b` for bytes.\n */ dictFileSizeUnits: {\n tb: \"TB\",\n gb: \"GB\",\n mb: \"MB\",\n kb: \"KB\",\n b: \"b\"\n },\n /**\n * Called when dropzone initialized\n * You can add event listeners here\n */ init: function() {},\n /**\n * Can be an **object** of additional parameters to transfer to the server, **or** a `Function`\n * that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case\n * of a function, this needs to return a map.\n *\n * The default implementation does nothing for normal uploads, but adds relevant information for\n * chunked uploads.\n *\n * This is the same as adding hidden input fields in the form element.\n */ params: function(files, xhr, chunk) {\n if (chunk) return {\n dzuuid: chunk.file.upload.uuid,\n dzchunkindex: chunk.index,\n dztotalfilesize: chunk.file.size,\n dzchunksize: this.options.chunkSize,\n dztotalchunkcount: chunk.file.upload.totalChunkCount,\n dzchunkbyteoffset: chunk.index * this.options.chunkSize\n };\n },\n /**\n * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File)\n * and a `done` function as parameters.\n *\n * If the done function is invoked without arguments, the file is \"accepted\" and will\n * be processed. If you pass an error message, the file is rejected, and the error\n * message will be displayed.\n * This function will not be called if the file is too big or doesn't match the mime types.\n */ accept: function(file, done) {\n return done();\n },\n /**\n * The callback that will be invoked when all chunks have been uploaded for a file.\n * It gets the file for which the chunks have been uploaded as the first parameter,\n * and the `done` function as second. `done()` needs to be invoked when everything\n * needed to finish the upload process is done.\n */ chunksUploaded: function chunksUploaded(file, done) {\n done();\n },\n /**\n * Sends the file as binary blob in body instead of form data.\n * If this is set, the `params` option will be ignored.\n * It's an error to set this to `true` along with `uploadMultiple` since\n * multiple files cannot be in a single binary body.\n */ binaryBody: false,\n /**\n * Gets called when the browser is not supported.\n * The default implementation shows the fallback input field and adds\n * a text.\n */ fallback: function() {\n // This code should pass in IE7... :(\n var messageElement;\n this.element.className = \"\".concat(this.element.className, \" dz-browser-not-supported\");\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = this.element.getElementsByTagName(\"div\")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var child = _step.value;\n if (/(^| )dz-message($| )/.test(child.className)) {\n messageElement = child;\n child.className = \"dz-message\"; // Removes the 'dz-default' class\n break;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (!messageElement) {\n messageElement = (0, $0b112e5f3be94b9d$export$2e2bcd8739ae039).createElement('
');\n this.element.appendChild(messageElement);\n }\n var span = messageElement.getElementsByTagName(\"span\")[0];\n if (span) {\n if (span.textContent != null) span.textContent = this.options.dictFallbackMessage;\n else if (span.innerText != null) span.innerText = this.options.dictFallbackMessage;\n }\n return this.element.appendChild(this.getFallbackForm());\n },\n /**\n * Gets called to calculate the thumbnail dimensions.\n *\n * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing:\n *\n * - `srcWidth` & `srcHeight` (required)\n * - `trgWidth` & `trgHeight` (required)\n * - `srcX` & `srcY` (optional, default `0`)\n * - `trgX` & `trgY` (optional, default `0`)\n *\n * Those values are going to be used by `ctx.drawImage()`.\n */ resize: function(file, width, height, resizeMethod) {\n var info = {\n srcX: 0,\n srcY: 0,\n srcWidth: file.width,\n srcHeight: file.height\n };\n var srcRatio = file.width / file.height;\n // Automatically calculate dimensions if not specified\n if (width == null && height == null) {\n width = info.srcWidth;\n height = info.srcHeight;\n } else if (width == null) width = height * srcRatio;\n else if (height == null) height = width / srcRatio;\n // Make sure images aren't upscaled\n width = Math.min(width, info.srcWidth);\n height = Math.min(height, info.srcHeight);\n var trgRatio = width / height;\n if (info.srcWidth > width || info.srcHeight > height) {\n // Image is bigger and needs rescaling\n if (resizeMethod === \"crop\") {\n if (srcRatio > trgRatio) {\n info.srcHeight = file.height;\n info.srcWidth = info.srcHeight * trgRatio;\n } else {\n info.srcWidth = file.width;\n info.srcHeight = info.srcWidth / trgRatio;\n }\n } else if (resizeMethod === \"contain\") {\n // Method 'contain'\n if (srcRatio > trgRatio) height = width / srcRatio;\n else width = height * srcRatio;\n } else throw new Error(\"Unknown resizeMethod '\".concat(resizeMethod, \"'\"));\n }\n info.srcX = (file.width - info.srcWidth) / 2;\n info.srcY = (file.height - info.srcHeight) / 2;\n info.trgWidth = width;\n info.trgHeight = height;\n return info;\n },\n /**\n * Can be used to transform the file (for example, resize an image if necessary).\n *\n * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes\n * images according to those dimensions.\n *\n * Gets the `file` as the first parameter, and a `done()` function as the second, that needs\n * to be invoked with the file when the transformation is done.\n */ transformFile: function(file, done) {\n if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done);\n else return done(file);\n },\n /**\n * A string that contains the template used for each dropped\n * file. Change it to fulfill your needs but make sure to properly\n * provide all elements.\n *\n * If you want to use an actual HTML element instead of providing a String\n * as a config option, you could create a div with the id `tpl`,\n * put the template inside it and provide the element like this:\n *\n * document\n * .querySelector('#tpl')\n * .innerHTML\n *\n */ previewTemplate: (0, (/*@__PURE__*/$parcel$interopDefault($5804b5cb637998e0$exports))),\n /*\n Those functions register themselves to the events on init and handle all\n the user interface specific stuff. Overwriting them won't break the upload\n but can break the way it's displayed.\n You can overwrite them if you don't like the default behavior. If you just\n want to add an additional event handler, register it on the dropzone object\n and don't overwrite those options.\n */ // Those are self explanatory and simply concern the DragnDrop.\n drop: function(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n dragstart: function(e) {},\n dragend: function(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n dragenter: function(e) {\n return this.element.classList.add(\"dz-drag-hover\");\n },\n dragover: function(e) {\n return this.element.classList.add(\"dz-drag-hover\");\n },\n dragleave: function(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n paste: function(e) {},\n // Called whenever there are no files left in the dropzone anymore, and the\n // dropzone should be displayed as if in the initial state.\n reset: function() {\n return this.element.classList.remove(\"dz-started\");\n },\n // Called when a file is added to the queue\n // Receives `file`\n addedfile: function(file) {\n var _this = this;\n if (this.element === this.previewsContainer) this.element.classList.add(\"dz-started\");\n if (this.previewsContainer && !this.options.disablePreviews) {\n file.previewElement = (0, $0b112e5f3be94b9d$export$2e2bcd8739ae039).createElement(this.options.previewTemplate.trim());\n file.previewTemplate = file.previewElement; // Backwards compatibility\n this.previewsContainer.appendChild(file.previewElement);\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = file.previewElement.querySelectorAll(\"[data-dz-name]\")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var node = _step.value;\n node.textContent = file.name;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;\n try {\n for(var _iterator1 = file.previewElement.querySelectorAll(\"[data-dz-size]\")[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){\n node = _step1.value;\n node.innerHTML = this.filesize(file.size);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally{\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (this.options.addRemoveLinks) {\n file._removeLink = (0, $0b112e5f3be94b9d$export$2e2bcd8739ae039).createElement(''.concat(this.options.dictRemoveFile, \"\"));\n file.previewElement.appendChild(file._removeLink);\n }\n var removeFileEvent = function(e) {\n e.preventDefault();\n e.stopPropagation();\n if (file.status === (0, $0b112e5f3be94b9d$export$2e2bcd8739ae039).UPLOADING) {\n if (_this.options.dictCancelUploadConfirmation) return (0, $0b112e5f3be94b9d$export$2e2bcd8739ae039).confirm(_this.options.dictCancelUploadConfirmation, function() {\n return _this.removeFile(file);\n });\n else return _this.removeFile(file);\n } else {\n if (_this.options.dictRemoveFileConfirmation) return (0, $0b112e5f3be94b9d$export$2e2bcd8739ae039).confirm(_this.options.dictRemoveFileConfirmation, function() {\n return _this.removeFile(file);\n });\n else return _this.removeFile(file);\n }\n };\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;\n try {\n for(var _iterator2 = file.previewElement.querySelectorAll(\"[data-dz-remove]\")[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){\n var removeLink = _step2.value;\n removeLink.addEventListener(\"click\", removeFileEvent);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally{\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n }\n },\n // Called whenever a file is removed.\n removedfile: function(file) {\n if (file.previewElement != null && file.previewElement.parentNode != null) file.previewElement.parentNode.removeChild(file.previewElement);\n return this._updateMaxFilesReachedClass();\n },\n // Called when a thumbnail has been generated\n // Receives `file` and `dataUrl`\n thumbnail: function(file, dataUrl) {\n if (file.previewElement) {\n file.previewElement.classList.remove(\"dz-file-preview\");\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = file.previewElement.querySelectorAll(\"[data-dz-thumbnail]\")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var thumbnailElement = _step.value;\n thumbnailElement.alt = file.name;\n thumbnailElement.src = dataUrl;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return setTimeout(function() {\n return file.previewElement.classList.add(\"dz-image-preview\");\n }, 1);\n }\n },\n // Called whenever an error occurs\n // Receives `file` and `message`\n error: function(file, message) {\n if (file.previewElement) {\n file.previewElement.classList.add(\"dz-error\");\n if (typeof message !== \"string\" && message.error) message = message.error;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = file.previewElement.querySelectorAll(\"[data-dz-errormessage]\")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var node = _step.value;\n node.textContent = message;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n },\n errormultiple: function() {},\n // Called when a file gets processed. Since there is a queue, not all added\n // files are processed immediately.\n // Receives `file`\n processing: function(file) {\n if (file.previewElement) {\n file.previewElement.classList.add(\"dz-processing\");\n if (file._removeLink) return file._removeLink.innerHTML = this.options.dictCancelUpload;\n }\n },\n processingmultiple: function() {},\n // Called whenever the upload progress gets updated.\n // Receives `file`, `progress` (percentage 0-100) and `bytesSent`.\n // To get the total number of bytes of the file, use `file.size`\n uploadprogress: function(file, progress, bytesSent) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n if (file.previewElement) try {\n for(var _iterator = file.previewElement.querySelectorAll(\"[data-dz-uploadprogress]\")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var node = _step.value;\n node.nodeName === \"PROGRESS\" ? node.value = progress : node.style.width = \"\".concat(progress, \"%\");\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n },\n // Called whenever the total upload progress gets updated.\n // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent\n totaluploadprogress: function() {},\n // Called just before the file is sent. Gets the `xhr` object as second\n // parameter, so you can modify it (for example to add a CSRF token) and a\n // `formData` object to add additional information.\n sending: function() {},\n sendingmultiple: function() {},\n // When the complete upload is finished and successful\n // Receives `file`\n success: function(file) {\n if (file.previewElement) return file.previewElement.classList.add(\"dz-success\");\n },\n successmultiple: function() {},\n // When the upload is canceled.\n canceled: function(file) {\n return this.emit(\"error\", file, this.options.dictUploadCanceled);\n },\n canceledmultiple: function() {},\n // When the upload is finished, either with success or an error.\n // Receives `file`\n complete: function(file) {\n if (file._removeLink) file._removeLink.innerHTML = this.options.dictRemoveFile;\n if (file.previewElement) return file.previewElement.classList.add(\"dz-complete\");\n },\n completemultiple: function() {},\n maxfilesexceeded: function() {},\n maxfilesreached: function() {},\n queuecomplete: function() {},\n addedfiles: function() {},\n emptyfolder: function() {}\n};\nvar $588a9ad8284f77de$export$2e2bcd8739ae039 = $588a9ad8284f77de$var$defaultOptions;\n\n\nvar $0b112e5f3be94b9d$export$2e2bcd8739ae039 = /*#__PURE__*/ function(Emitter1) {\n \"use strict\";\n (0, $691dd4abc3adf869$export$71511d61b312f219)(Dropzone, Emitter1);\n function Dropzone(el, options) {\n (0, $a09c5fed926355a1$export$71511d61b312f219)(this, Dropzone);\n var _this;\n _this = (0, $4eb3f5b914cad40a$export$71511d61b312f219)(this, Dropzone);\n var fallback, left;\n _this.element = el;\n _this.clickableElements = [];\n _this.listeners = [];\n _this.files = []; // All files\n if (typeof _this.element === \"string\") _this.element = document.querySelector(_this.element);\n // make sure we actually have an HTML Element\n if (_this.element === null || !_this.element instanceof HTMLElement) throw new Error(\"Invalid dropzone element: not an instance of HTMLElement.\");\n if (_this.element.dropzone) throw new Error(\"Dropzone already attached.\");\n // Now add this dropzone to the instances.\n Dropzone.instances.push(_this);\n // Put the dropzone inside the element itself.\n _this.element.dropzone = _this;\n var elementOptions = (left = Dropzone.optionsForElement(_this.element)) != null ? left : {};\n _this.options = Object.assign({}, (0, $588a9ad8284f77de$export$2e2bcd8739ae039), elementOptions, options != null ? options : {});\n _this.options.previewTemplate = _this.options.previewTemplate.replace(/\\n*/g, \"\");\n // If the browser failed, just call the fallback and leave\n if (_this.options.forceFallback || !Dropzone.isBrowserSupported()) return (0, $d13763098d3cb1e3$export$71511d61b312f219)(_this, _this.options.fallback.call(_this));\n // @options.url = @element.getAttribute \"action\" unless @options.url?\n if (_this.options.url == null) _this.options.url = _this.element.getAttribute(\"action\");\n if (!_this.options.url) throw new Error(\"No URL provided.\");\n if (_this.options.uploadMultiple && _this.options.chunking) throw new Error(\"You cannot set both: uploadMultiple and chunking.\");\n if (_this.options.binaryBody && _this.options.uploadMultiple) throw new Error(\"You cannot set both: binaryBody and uploadMultiple.\");\n if (typeof _this.options.method === \"string\") _this.options.method = _this.options.method.toUpperCase();\n if ((fallback = _this.getExistingFallback()) && fallback.parentNode) // Remove the fallback\n fallback.parentNode.removeChild(fallback);\n // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false\n if (_this.options.previewsContainer !== false) {\n if (_this.options.previewsContainer) _this.previewsContainer = Dropzone.getElement(_this.options.previewsContainer, \"previewsContainer\");\n else _this.previewsContainer = _this.element;\n }\n if (_this.options.clickable) {\n if (_this.options.clickable === true) _this.clickableElements = [\n _this.element\n ];\n else _this.clickableElements = Dropzone.getElements(_this.options.clickable, \"clickable\");\n }\n _this.init();\n return _this;\n }\n (0, $273e99875a375f47$export$71511d61b312f219)(Dropzone, [\n {\n // Returns all files that have been accepted\n key: \"getAcceptedFiles\",\n value: function getAcceptedFiles() {\n return this.files.filter(function(file) {\n return file.accepted;\n }).map(function(file) {\n return file;\n });\n }\n },\n {\n // Returns all files that have been rejected\n // Not sure when that's going to be useful, but added for completeness.\n key: \"getRejectedFiles\",\n value: function getRejectedFiles() {\n return this.files.filter(function(file) {\n return !file.accepted;\n }).map(function(file) {\n return file;\n });\n }\n },\n {\n key: \"getFilesWithStatus\",\n value: function getFilesWithStatus(status) {\n return this.files.filter(function(file) {\n return file.status === status;\n }).map(function(file) {\n return file;\n });\n }\n },\n {\n // Returns all files that are in the queue\n key: \"getQueuedFiles\",\n value: function getQueuedFiles() {\n return this.getFilesWithStatus(Dropzone.QUEUED);\n }\n },\n {\n key: \"getUploadingFiles\",\n value: function getUploadingFiles() {\n return this.getFilesWithStatus(Dropzone.UPLOADING);\n }\n },\n {\n key: \"getAddedFiles\",\n value: function getAddedFiles() {\n return this.getFilesWithStatus(Dropzone.ADDED);\n }\n },\n {\n // Files that are either queued or uploading\n key: \"getActiveFiles\",\n value: function getActiveFiles() {\n return this.files.filter(function(file) {\n return file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED;\n }).map(function(file) {\n return file;\n });\n }\n },\n {\n // The function that gets called when Dropzone is initialized. You\n // can (and should) setup event listeners inside this function.\n key: \"init\",\n value: function init() {\n var _this = this;\n // In case it isn't set already\n if (this.element.tagName === \"form\") this.element.setAttribute(\"enctype\", \"multipart/form-data\");\n if (this.element.classList.contains(\"dropzone\") && !this.element.querySelector(\".dz-message\")) this.element.appendChild(Dropzone.createElement('
\")));\n if (this.clickableElements.length) {\n var setupHiddenFileInput = function() {\n var _this_hiddenFileInput_parentNode;\n if (_this.hiddenFileInput) (_this_hiddenFileInput_parentNode = _this.hiddenFileInput.parentNode) === null || _this_hiddenFileInput_parentNode === void 0 ? void 0 : _this_hiddenFileInput_parentNode.removeChild(_this.hiddenFileInput);\n _this.hiddenFileInput = document.createElement(\"input\");\n _this.hiddenFileInput.setAttribute(\"type\", \"file\");\n _this.hiddenFileInput.setAttribute(\"form\", _this.element.id);\n if (_this.options.maxFiles === null || _this.options.maxFiles > 1) _this.hiddenFileInput.setAttribute(\"multiple\", \"multiple\");\n _this.hiddenFileInput.className = \"dz-hidden-input\";\n if (_this.options.acceptedFiles !== null) _this.hiddenFileInput.setAttribute(\"accept\", _this.options.acceptedFiles);\n if (_this.options.capture !== null) _this.hiddenFileInput.setAttribute(\"capture\", _this.options.capture);\n // Making sure that no one can \"tab\" into this field.\n _this.hiddenFileInput.setAttribute(\"tabindex\", \"-1\");\n // Add arialabel for a11y\n _this.hiddenFileInput.setAttribute(\"aria-label\", \"dropzone hidden input\");\n // Not setting `display=\"none\"` because some browsers don't accept clicks\n // on elements that aren't displayed.\n _this.hiddenFileInput.style.visibility = \"hidden\";\n _this.hiddenFileInput.style.position = \"absolute\";\n _this.hiddenFileInput.style.top = \"0\";\n _this.hiddenFileInput.style.left = \"0\";\n _this.hiddenFileInput.style.height = \"0\";\n _this.hiddenFileInput.style.width = \"0\";\n Dropzone.getElement(_this.options.hiddenInputContainer, \"hiddenInputContainer\").appendChild(_this.hiddenFileInput);\n _this.hiddenFileInput.addEventListener(\"change\", function() {\n var files = _this.hiddenFileInput.files;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n if (files.length) try {\n for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var file = _step.value;\n _this.addFile(file);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n _this.emit(\"addedfiles\", files);\n setupHiddenFileInput();\n });\n };\n setupHiddenFileInput();\n }\n this.URL = window.URL !== null ? window.URL : window.webkitURL;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n // Setup all event listeners on the Dropzone object itself.\n // They're not in @setupEventListeners() because they shouldn't be removed\n // again when the dropzone gets disabled.\n for(var _iterator = this.events[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var eventName = _step.value;\n this.on(eventName, this.options[eventName]);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n this.on(\"uploadprogress\", function() {\n return _this.updateTotalUploadProgress();\n });\n this.on(\"removedfile\", function() {\n return _this.updateTotalUploadProgress();\n });\n this.on(\"canceled\", function(file) {\n return _this.emit(\"complete\", file);\n });\n // Emit a `queuecomplete` event if all files finished uploading.\n this.on(\"complete\", function(file) {\n if (_this.getAddedFiles().length === 0 && _this.getUploadingFiles().length === 0 && _this.getQueuedFiles().length === 0) // This needs to be deferred so that `queuecomplete` really triggers after `complete`\n return setTimeout(function() {\n return _this.emit(\"queuecomplete\");\n }, 0);\n });\n var containsFiles = function containsFiles(e) {\n return e.dataTransfer.types && e.dataTransfer.types.includes(\"Files\");\n };\n var noPropagation = function noPropagation(e) {\n // If there are no files, we don't want to stop\n // propagation so we don't interfere with other\n // drag and drop behaviour.\n if (!containsFiles(e)) return;\n e.stopPropagation();\n return e.preventDefault();\n };\n // Create the listeners\n this.listeners = [\n {\n element: this.element,\n events: {\n dragstart: function(e) {\n return _this.emit(\"dragstart\", e);\n },\n dragenter: function(e) {\n noPropagation(e);\n return _this.emit(\"dragenter\", e);\n },\n dragover: function(e) {\n // Makes it possible to drag files from chrome's download bar\n // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar\n var efct = e.dataTransfer.effectAllowed;\n e.dataTransfer.dropEffect = \"move\" === efct || \"linkMove\" === efct ? \"move\" : \"copy\";\n noPropagation(e);\n return _this.emit(\"dragover\", e);\n },\n dragleave: function(e) {\n return _this.emit(\"dragleave\", e);\n },\n drop: function(e) {\n noPropagation(e);\n return _this.drop(e);\n },\n dragend: function(e) {\n return _this.emit(\"dragend\", e);\n }\n }\n }\n ];\n this.clickableElements.forEach(function(clickableElement) {\n return _this.listeners.push({\n element: clickableElement,\n events: {\n click: function(evt) {\n // Only the actual dropzone or the message element should trigger file selection\n if (clickableElement !== _this.element || evt.target === _this.element || Dropzone.elementInside(evt.target, _this.element.querySelector(\".dz-message\"))) _this.hiddenFileInput.click(); // Forward the click\n return true;\n }\n }\n });\n });\n this.enable();\n return this.options.init.call(this);\n }\n },\n {\n // Not fully tested yet\n key: \"destroy\",\n value: function destroy() {\n this.disable();\n this.removeAllFiles(true);\n if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) {\n this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);\n this.hiddenFileInput = null;\n }\n delete this.element.dropzone;\n return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1);\n }\n },\n {\n key: \"updateTotalUploadProgress\",\n value: function updateTotalUploadProgress() {\n var totalUploadProgress;\n var totalBytesSent = 0;\n var totalBytes = 0;\n var activeFiles = this.getActiveFiles();\n if (activeFiles.length) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = this.getActiveFiles()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var file = _step.value;\n totalBytesSent += file.upload.bytesSent;\n totalBytes += file.upload.total;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n totalUploadProgress = 100 * totalBytesSent / totalBytes;\n } else totalUploadProgress = 100;\n return this.emit(\"totaluploadprogress\", totalUploadProgress, totalBytes, totalBytesSent);\n }\n },\n {\n // @options.paramName can be a function taking one parameter rather than a string.\n // A parameter name for a file is obtained simply by calling this with an index number.\n key: \"_getParamName\",\n value: function _getParamName(n) {\n if (typeof this.options.paramName === \"function\") return this.options.paramName(n);\n else return \"\".concat(this.options.paramName).concat(this.options.uploadMultiple ? \"[\".concat(n, \"]\") : \"\");\n }\n },\n {\n // If @options.renameFile is a function,\n // the function will be used to rename the file.name before appending it to the formData.\n // MacOS 14+ screenshots contain narrow non-breaking space (U+202F) characters in filenames \n // (e.g., \"Screenshot 2024-01-30 at 10.32.07 AM.png\" where the space after \"07\" and before \"AM\" is U+202F).\n // This function now replaces these with regular spaces to prevent upload issues and maintain compatibility with MacOS\n key: \"_renameFile\",\n value: function _renameFile(file) {\n var cleanFile = (0, $9196d606ce819a5b$export$71511d61b312f219)((0, $37fa8c4a256d3c34$export$71511d61b312f219)({}, file), {\n name: file.name.replace(/\\u202F/g, ' ')\n });\n if (typeof this.options.renameFile !== \"function\") return cleanFile.name;\n return this.options.renameFile(cleanFile);\n }\n },\n {\n // Returns a form that can be used as fallback if the browser does not support DragnDrop\n //\n // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided.\n // This code has to pass in IE7 :(\n key: \"getFallbackForm\",\n value: function getFallbackForm() {\n var existingFallback, form;\n if (existingFallback = this.getExistingFallback()) return existingFallback;\n var fieldsString = '
';\n if (this.options.dictFallbackText) fieldsString += \"

\".concat(this.options.dictFallbackText, \"

\");\n fieldsString += '
');\n var fields = Dropzone.createElement(fieldsString);\n if (this.element.tagName !== \"FORM\") {\n form = Dropzone.createElement('
'));\n form.appendChild(fields);\n } else {\n // Make sure that the enctype and method attributes are set properly\n this.element.setAttribute(\"enctype\", \"multipart/form-data\");\n this.element.setAttribute(\"method\", this.options.method);\n }\n return form != null ? form : fields;\n }\n },\n {\n // Returns the fallback elements if they exist already\n //\n // This code has to pass in IE7 :(\n key: \"getExistingFallback\",\n value: function getExistingFallback() {\n var getFallback = function getFallback(elements) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = elements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var el = _step.value;\n if (/(^| )fallback($| )/.test(el.className)) return el;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n };\n for(var _i = 0, _iter = [\n \"div\",\n \"form\"\n ]; _i < _iter.length; _i++){\n var tagName = _iter[_i];\n var fallback;\n if (fallback = getFallback(this.element.getElementsByTagName(tagName))) return fallback;\n }\n }\n },\n {\n // Activates all listeners stored in @listeners\n key: \"setupEventListeners\",\n value: function setupEventListeners() {\n return this.listeners.map(function(elementListeners) {\n return function() {\n var result = [];\n for(var event in elementListeners.events){\n var listener = elementListeners.events[event];\n result.push(elementListeners.element.addEventListener(event, listener, false));\n }\n return result;\n }();\n });\n }\n },\n {\n // Deactivates all listeners stored in @listeners\n key: \"removeEventListeners\",\n value: function removeEventListeners() {\n return this.listeners.map(function(elementListeners) {\n return function() {\n var result = [];\n for(var event in elementListeners.events){\n var listener = elementListeners.events[event];\n result.push(elementListeners.element.removeEventListener(event, listener, false));\n }\n return result;\n }();\n });\n }\n },\n {\n // Removes all event listeners and cancels all files in the queue or being processed.\n key: \"disable\",\n value: function disable() {\n var _this = this;\n this.clickableElements.forEach(function(element) {\n return element.classList.remove(\"dz-clickable\");\n });\n this.removeEventListeners();\n this.disabled = true;\n return this.files.map(function(file) {\n return _this.cancelUpload(file);\n });\n }\n },\n {\n key: \"enable\",\n value: function enable() {\n delete this.disabled;\n this.clickableElements.forEach(function(element) {\n return element.classList.add(\"dz-clickable\");\n });\n return this.setupEventListeners();\n }\n },\n {\n // Returns a nicely formatted filesize\n key: \"filesize\",\n value: function filesize(size) {\n var selectedSize = 0;\n var selectedUnit = \"b\";\n if (size > 0) {\n var units = [\n \"tb\",\n \"gb\",\n \"mb\",\n \"kb\",\n \"b\"\n ];\n for(var i = 0; i < units.length; i++){\n var unit = units[i];\n var cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;\n if (size >= cutoff) {\n selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);\n selectedUnit = unit;\n break;\n }\n }\n selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits\n }\n return \"\".concat(selectedSize, \" \").concat(this.options.dictFileSizeUnits[selectedUnit]);\n }\n },\n {\n // Adds or removes the `dz-max-files-reached` class from the form.\n key: \"_updateMaxFilesReachedClass\",\n value: function _updateMaxFilesReachedClass() {\n if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) {\n if (this.getAcceptedFiles().length === this.options.maxFiles) this.emit(\"maxfilesreached\", this.files);\n return this.element.classList.add(\"dz-max-files-reached\");\n } else return this.element.classList.remove(\"dz-max-files-reached\");\n }\n },\n {\n key: \"drop\",\n value: function drop(e) {\n if (!e.dataTransfer) return;\n this.emit(\"drop\", e);\n // Convert the FileList to an Array\n // This is necessary for IE11\n var files = [];\n for(var i = 0; i < e.dataTransfer.files.length; i++)files[i] = e.dataTransfer.files[i];\n // Even if it's a folder, files.length will contain the folders.\n if (files.length) {\n var items = e.dataTransfer.items;\n if (items && items.length && items[0].webkitGetAsEntry != null) // The browser supports dropping of folders, so handle items instead of files\n this._addFilesFromItems(items);\n else this.handleFiles(files);\n }\n this.emit(\"addedfiles\", files);\n }\n },\n {\n key: \"paste\",\n value: function paste(e) {\n if ($0b112e5f3be94b9d$var$__guard__(e != null ? e.clipboardData : undefined, function(x) {\n return x.items;\n }) == null) return;\n this.emit(\"paste\", e);\n var items = e.clipboardData.items;\n if (items.length) return this._addFilesFromItems(items);\n }\n },\n {\n key: \"handleFiles\",\n value: function handleFiles(files) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var file = _step.value;\n this.addFile(file);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n },\n {\n // When a folder is dropped (or files are pasted), items must be handled\n // instead of files.\n key: \"_addFilesFromItems\",\n value: function _addFilesFromItems(items) {\n var _this = this;\n return function() {\n var result = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = items[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var item = _step.value;\n var entry;\n if (item.webkitGetAsEntry != null && (entry = item.webkitGetAsEntry())) {\n if (entry.isFile) result.push(_this.addFile(item.getAsFile()));\n else if (entry.isDirectory) // Append all files from that directory to files\n result.push(_this._addFilesFromDirectory(entry, entry.name));\n else result.push(undefined);\n } else if (item.getAsFile != null) {\n if (item.kind == null || item.kind === \"file\") result.push(_this.addFile(item.getAsFile()));\n else result.push(undefined);\n } else result.push(undefined);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return result;\n }();\n }\n },\n {\n // Goes through the directory, and adds each file it finds recursively\n key: \"_addFilesFromDirectory\",\n value: function _addFilesFromDirectory(directory, path) {\n var _this = this;\n var dirReader = directory.createReader();\n var errorHandler = function(error) {\n return $0b112e5f3be94b9d$var$__guardMethod__(console, \"log\", function(o) {\n return o.log(error);\n });\n };\n var entryCount = 0;\n var readEntries = function() {\n return dirReader.readEntries(function(entries) {\n if (entries.length > 0) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = entries[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var entry = _step.value;\n if (entry.isFile) {\n ++entryCount;\n entry.file(function(file) {\n if (_this.options.ignoreHiddenFiles && file.name.substring(0, 1) === \".\") return;\n file.fullPath = \"\".concat(path, \"/\").concat(file.name);\n return _this.addFile(file);\n });\n } else if (entry.isDirectory) _this._addFilesFromDirectory(entry, \"\".concat(path, \"/\").concat(entry.name));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n // Recursively call readEntries() again, since browser only handle\n // the first 100 entries.\n // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries\n readEntries();\n } else if (entryCount === 0) _this.emit(\"emptyfolder\", path);\n return null;\n }, errorHandler);\n };\n return readEntries();\n }\n },\n {\n // If `done()` is called without argument the file is accepted\n // If you call it with an error message, the file is rejected\n // (This allows for asynchronous validation)\n //\n // This function checks the filesize, and if the file.type passes the\n // `acceptedFiles` check.\n key: \"accept\",\n value: function accept(file, done) {\n if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1048576) done(this.options.dictFileTooBig.replace(\"{{filesize}}\", Math.round(file.size / 1024 / 10.24) / 100).replace(\"{{maxFilesize}}\", this.options.maxFilesize));\n else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) done(this.options.dictInvalidFileType);\n else if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) {\n done(this.options.dictMaxFilesExceeded.replace(\"{{maxFiles}}\", this.options.maxFiles));\n this.emit(\"maxfilesexceeded\", file);\n } else this.options.accept.call(this, file, done);\n }\n },\n {\n key: \"addFile\",\n value: function addFile(file) {\n var _this = this;\n file.upload = {\n // note: this only works if window.isSecureContext is true, which includes localhost in http\n uuid: window.isSecureContext ? self.crypto.randomUUID() : Dropzone.uuidv4(),\n progress: 0,\n // Setting the total upload size to file.size for the beginning\n // It's actual different than the size to be transmitted.\n total: file.size,\n bytesSent: 0,\n filename: this._renameFile(file)\n };\n this.files.push(file);\n file.status = Dropzone.ADDED;\n this.emit(\"addedfile\", file);\n this._enqueueThumbnail(file);\n this.accept(file, function(error) {\n if (error) {\n file.accepted = false;\n _this._errorProcessing([\n file\n ], error); // Will set the file.status\n } else {\n file.accepted = true;\n if (_this.options.autoQueue) _this.enqueueFile(file);\n // Will set .accepted = true\n }\n _this._updateMaxFilesReachedClass();\n });\n }\n },\n {\n // Wrapper for enqueueFile\n key: \"enqueueFiles\",\n value: function enqueueFiles(files) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var file = _step.value;\n this.enqueueFile(file);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return null;\n }\n },\n {\n key: \"enqueueFile\",\n value: function enqueueFile(file) {\n var _this = this;\n if (file.status === Dropzone.ADDED && file.accepted === true) {\n file.status = Dropzone.QUEUED;\n if (this.options.autoProcessQueue) return setTimeout(function() {\n return _this.processQueue();\n }, 0); // Deferring the call\n } else throw new Error(\"This file can't be queued because it has already been processed or was rejected.\");\n }\n },\n {\n key: \"_enqueueThumbnail\",\n value: function _enqueueThumbnail(file) {\n var _this = this;\n if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1048576) {\n this._thumbnailQueue.push(file);\n return setTimeout(function() {\n return _this._processThumbnailQueue();\n }, 0); // Deferring the call\n }\n }\n },\n {\n key: \"_processThumbnailQueue\",\n value: function _processThumbnailQueue() {\n var _this = this;\n if (this._processingThumbnail || this._thumbnailQueue.length === 0) return;\n this._processingThumbnail = true;\n var file = this._thumbnailQueue.shift();\n return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, function(dataUrl) {\n _this.emit(\"thumbnail\", file, dataUrl);\n _this._processingThumbnail = false;\n return _this._processThumbnailQueue();\n });\n }\n },\n {\n // Can be called by the user to remove a file\n key: \"removeFile\",\n value: function removeFile(file) {\n if (file.status === Dropzone.UPLOADING) this.cancelUpload(file);\n this.files = $0b112e5f3be94b9d$var$without(this.files, file);\n this.emit(\"removedfile\", file);\n if (this.files.length === 0) return this.emit(\"reset\");\n }\n },\n {\n // Removes all files that aren't currently processed from the list\n key: \"removeAllFiles\",\n value: function removeAllFiles(cancelIfNecessary) {\n // Create a copy of files since removeFile() changes the @files array.\n if (cancelIfNecessary == null) cancelIfNecessary = false;\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = this.files.slice()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var file = _step.value;\n if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) this.removeFile(file);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return null;\n }\n },\n {\n // Resizes an image before it gets sent to the server. This function is the default behavior of\n // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with\n // the resized blob.\n key: \"resizeImage\",\n value: function resizeImage(file, width, height, resizeMethod, callback) {\n var _this = this;\n return this.createThumbnail(file, width, height, resizeMethod, true, function(dataUrl, canvas) {\n if (canvas == null) // The image has not been resized\n return callback(file);\n else {\n var resizeMimeType = _this.options.resizeMimeType;\n if (resizeMimeType == null) resizeMimeType = file.type;\n var resizedDataURL = canvas.toDataURL(resizeMimeType, _this.options.resizeQuality);\n if (resizeMimeType === \"image/jpeg\" || resizeMimeType === \"image/jpg\") // Now add the original EXIF information\n resizedDataURL = $0b112e5f3be94b9d$var$restoreExif(file.dataURL, resizedDataURL);\n return callback(Dropzone.dataURItoBlob(resizedDataURL));\n }\n }, true);\n }\n },\n {\n key: \"createThumbnail\",\n value: function createThumbnail(file, width, height, resizeMethod, fixOrientation, callback) {\n var _this = this;\n var ignoreExif = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : false;\n var fileReader = new FileReader();\n fileReader.onload = function() {\n file.dataURL = fileReader.result;\n // Don't bother creating a thumbnail for SVG images since they're vector\n if (file.type === \"image/svg+xml\") {\n if (callback != null) callback(fileReader.result);\n return;\n }\n _this.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, undefined, ignoreExif);\n };\n fileReader.readAsDataURL(file);\n }\n },\n {\n // `mockFile` needs to have these attributes:\n //\n // { name: 'name', size: 12345, imageUrl: '' }\n //\n // `callback` will be invoked when the image has been downloaded and displayed.\n // `crossOrigin` will be added to the `img` tag when accessing the file.\n key: \"displayExistingFile\",\n value: function displayExistingFile(mockFile, imageUrl, callback, crossOrigin) {\n var _this = this;\n var resizeThumbnail = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;\n this.emit(\"addedfile\", mockFile);\n this.emit(\"complete\", mockFile);\n if (!resizeThumbnail) {\n this.emit(\"thumbnail\", mockFile, imageUrl);\n if (callback) callback();\n } else {\n var onDone = function(thumbnail) {\n _this.emit(\"thumbnail\", mockFile, thumbnail);\n if (callback) callback();\n };\n mockFile.dataURL = imageUrl;\n this.createThumbnailFromUrl(mockFile, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, this.options.fixOrientation, onDone, crossOrigin);\n }\n }\n },\n {\n key: \"createThumbnailFromUrl\",\n value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) {\n var _this = this;\n var ignoreExif = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : false;\n // Not using `new Image` here because of a bug in latest Chrome versions.\n // See https://github.com/enyo/dropzone/pull/226\n var img = document.createElement(\"img\");\n if (crossOrigin) img.crossOrigin = crossOrigin;\n // fixOrientation is not needed anymore with browsers handling imageOrientation\n fixOrientation = getComputedStyle(document.body)[\"imageOrientation\"] == \"from-image\" ? false : fixOrientation;\n img.onload = function() {\n var loadExif = function(callback) {\n return callback(1);\n };\n if (typeof EXIF !== \"undefined\" && EXIF !== null && fixOrientation) loadExif = function(callback) {\n return EXIF.getData(img, function() {\n return callback(EXIF.getTag(this, \"Orientation\"));\n });\n };\n return loadExif(function(orientation) {\n file.width = img.width;\n file.height = img.height;\n var resizeInfo = _this.options.resize.call(_this, file, width, height, resizeMethod);\n var canvas = document.createElement(\"canvas\");\n var ctx = canvas.getContext(\"2d\");\n canvas.width = resizeInfo.trgWidth;\n canvas.height = resizeInfo.trgHeight;\n if (orientation > 4) {\n canvas.width = resizeInfo.trgHeight;\n canvas.height = resizeInfo.trgWidth;\n }\n switch(orientation){\n case 2:\n // horizontal flip\n ctx.translate(canvas.width, 0);\n ctx.scale(-1, 1);\n break;\n case 3:\n // 180° rotate left\n ctx.translate(canvas.width, canvas.height);\n ctx.rotate(Math.PI);\n break;\n case 4:\n // vertical flip\n ctx.translate(0, canvas.height);\n ctx.scale(1, -1);\n break;\n case 5:\n // vertical flip + 90 rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.scale(1, -1);\n break;\n case 6:\n // 90° rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.translate(0, -canvas.width);\n break;\n case 7:\n // horizontal flip + 90 rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.translate(canvas.height, -canvas.width);\n ctx.scale(-1, 1);\n break;\n case 8:\n // 90° rotate left\n ctx.rotate(-0.5 * Math.PI);\n ctx.translate(-canvas.height, 0);\n break;\n }\n // This is a bugfix for iOS' scaling bug.\n $0b112e5f3be94b9d$var$drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight);\n var thumbnail = canvas.toDataURL(\"image/png\");\n if (callback != null) return callback(thumbnail, canvas);\n });\n };\n if (callback != null) img.onerror = callback;\n var dataURL = file.dataURL;\n if (ignoreExif) dataURL = $0b112e5f3be94b9d$var$removeExif(dataURL);\n return img.src = dataURL;\n }\n },\n {\n // Goes through the queue and processes files if there aren't too many already.\n key: \"processQueue\",\n value: function processQueue() {\n var parallelUploads = this.options.parallelUploads;\n var processingLength = this.getUploadingFiles().length;\n var i = processingLength;\n // There are already at least as many files uploading than should be\n if (processingLength >= parallelUploads) return;\n var queuedFiles = this.getQueuedFiles();\n if (!(queuedFiles.length > 0)) return;\n if (this.options.uploadMultiple) // The files should be uploaded in one request\n return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength));\n else while(i < parallelUploads){\n if (!queuedFiles.length) return;\n // Nothing left to process\n this.processFile(queuedFiles.shift());\n i++;\n }\n }\n },\n {\n // Wrapper for `processFiles`\n key: \"processFile\",\n value: function processFile(file) {\n return this.processFiles([\n file\n ]);\n }\n },\n {\n // Loads the file, then calls finishedLoading()\n key: \"processFiles\",\n value: function processFiles(files) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var file = _step.value;\n file.processing = true; // Backwards compatibility\n file.status = Dropzone.UPLOADING;\n this.emit(\"processing\", file);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (this.options.uploadMultiple) this.emit(\"processingmultiple\", files);\n return this.uploadFiles(files);\n }\n },\n {\n key: \"_getFilesWithXhr\",\n value: function _getFilesWithXhr(xhr) {\n var files;\n return files = this.files.filter(function(file) {\n return file.xhr === xhr;\n }).map(function(file) {\n return file;\n });\n }\n },\n {\n // Cancels the file upload and sets the status to CANCELED\n // **if** the file is actually being uploaded.\n // If it's still in the queue, the file is being removed from it and the status\n // set to CANCELED.\n key: \"cancelUpload\",\n value: function cancelUpload(file) {\n if (file.status === Dropzone.UPLOADING) {\n var groupedFiles = this._getFilesWithXhr(file.xhr);\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = groupedFiles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var groupedFile = _step.value;\n groupedFile.status = Dropzone.CANCELED;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (typeof file.xhr !== \"undefined\") file.xhr.abort();\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;\n try {\n for(var _iterator1 = groupedFiles[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){\n var groupedFile1 = _step1.value;\n this.emit(\"canceled\", groupedFile1);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally{\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (this.options.uploadMultiple) this.emit(\"canceledmultiple\", groupedFiles);\n } else if (file.status === Dropzone.ADDED || file.status === Dropzone.QUEUED) {\n file.status = Dropzone.CANCELED;\n this.emit(\"canceled\", file);\n if (this.options.uploadMultiple) this.emit(\"canceledmultiple\", [\n file\n ]);\n }\n if (this.options.autoProcessQueue) return this.processQueue();\n }\n },\n {\n key: \"resolveOption\",\n value: function resolveOption(option) {\n for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){\n args[_key - 1] = arguments[_key];\n }\n if (typeof option === \"function\") return option.apply(this, args);\n return option;\n }\n },\n {\n key: \"uploadFile\",\n value: function uploadFile(file) {\n return this.uploadFiles([\n file\n ]);\n }\n },\n {\n key: \"uploadFiles\",\n value: function uploadFiles(files) {\n var _this = this;\n this._transformFiles(files, function(transformedFiles) {\n if (_this.options.chunking) {\n // Chunking is not allowed to be used with `uploadMultiple` so we know\n // that there is only __one__file.\n var transformedFile = transformedFiles[0];\n files[0].upload.chunked = _this.options.chunking && (_this.options.forceChunking || transformedFile.size > _this.options.chunkSize);\n files[0].upload.totalChunkCount = Math.ceil(transformedFile.size / _this.options.chunkSize);\n if (transformedFile.size === 0) files[0].upload.totalChunkCount = 1;\n }\n if (files[0].upload.chunked) {\n // This file should be sent in chunks!\n // If the chunking option is set, we **know** that there can only be **one** file, since\n // uploadMultiple is not allowed with this option.\n var file = files[0];\n var transformedFile1 = transformedFiles[0];\n file.upload.chunks = [];\n var handleNextChunk = function() {\n var chunkIndex = 0;\n // Find the next item in file.upload.chunks that is not defined yet.\n while(file.upload.chunks[chunkIndex] !== undefined)chunkIndex++;\n // This means, that all chunks have already been started.\n if (chunkIndex >= file.upload.totalChunkCount) return;\n var start = chunkIndex * _this.options.chunkSize;\n var end = Math.min(start + _this.options.chunkSize, transformedFile1.size);\n var dataBlock = {\n name: _this._getParamName(0),\n data: transformedFile1.webkitSlice ? transformedFile1.webkitSlice(start, end) : transformedFile1.slice(start, end),\n filename: file.upload.filename,\n chunkIndex: chunkIndex\n };\n file.upload.chunks[chunkIndex] = {\n file: file,\n index: chunkIndex,\n dataBlock: dataBlock,\n status: Dropzone.UPLOADING,\n progress: 0,\n retries: 0\n };\n _this._uploadData(files, [\n dataBlock\n ]);\n };\n file.upload.finishedChunkUpload = function(chunk, response) {\n var allFinished = true;\n chunk.status = Dropzone.SUCCESS;\n // Clear the data from the chunk\n chunk.dataBlock = null;\n chunk.response = chunk.xhr.responseText;\n chunk.responseHeaders = chunk.xhr.getAllResponseHeaders();\n // Leaving this reference to xhr will cause memory leaks.\n chunk.xhr = null;\n for(var i = 0; i < file.upload.totalChunkCount; i++){\n if (file.upload.chunks[i] === undefined) return handleNextChunk();\n if (file.upload.chunks[i].status !== Dropzone.SUCCESS) allFinished = false;\n }\n if (allFinished) _this.options.chunksUploaded(file, function() {\n _this._finished(files, response, null);\n });\n };\n if (_this.options.parallelChunkUploads) {\n // we want to limit parallelChunkUploads to the same value as parallelUploads option\n var parallelCount = Math.min(_this.options.parallelChunkUploads === true ? _this.options.parallelUploads : _this.options.parallelChunkUploads, file.upload.totalChunkCount);\n for(var i = 0; i < parallelCount; i++)handleNextChunk();\n } else handleNextChunk();\n } else {\n var dataBlocks = [];\n for(var i1 = 0; i1 < files.length; i1++)dataBlocks[i1] = {\n name: _this._getParamName(i1),\n data: transformedFiles[i1],\n filename: files[i1].upload.filename\n };\n _this._uploadData(files, dataBlocks);\n }\n });\n }\n },\n {\n /// Returns the right chunk for given file and xhr\n key: \"_getChunk\",\n value: function _getChunk(file, xhr) {\n for(var i = 0; i < file.upload.totalChunkCount; i++){\n if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) return file.upload.chunks[i];\n }\n }\n },\n {\n // This function actually uploads the file(s) to the server.\n //\n // If dataBlocks contains the actual data to upload (meaning, that this could\n // either be transformed files, or individual chunks for chunked upload) then\n // they will be used for the actual data to upload.\n key: \"_uploadData\",\n value: function _uploadData(files, dataBlocks) {\n var _this = this;\n var xhr = new XMLHttpRequest();\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n // Put the xhr object in the file objects to be able to reference it later.\n for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var file = _step.value;\n file.xhr = xhr;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (files[0].upload.chunked) // Put the xhr object in the right chunk object, so it can be associated\n // later, and found with _getChunk.\n files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr;\n var method = this.resolveOption(this.options.method, files, dataBlocks);\n var url = this.resolveOption(this.options.url, files, dataBlocks);\n xhr.open(method, url, true);\n // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8\n var timeout = this.resolveOption(this.options.timeout, files);\n if (timeout) xhr.timeout = this.resolveOption(this.options.timeout, files);\n // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179\n xhr.withCredentials = !!this.options.withCredentials;\n xhr.onload = function(e) {\n _this._finishedUploading(files, xhr, e);\n };\n xhr.ontimeout = function() {\n _this._handleUploadError(files, xhr, \"Request timedout after \".concat(_this.options.timeout / 1000, \" seconds\"));\n };\n xhr.onerror = function() {\n _this._handleUploadError(files, xhr);\n };\n // Some browsers do not have the .upload property\n var progressObj = xhr.upload != null ? xhr.upload : xhr;\n progressObj.onprogress = function(e) {\n return _this._updateFilesUploadProgress(files, xhr, e);\n };\n var headers = this.options.defaultHeaders ? {\n Accept: \"application/json\",\n \"Cache-Control\": \"no-cache\",\n \"X-Requested-With\": \"XMLHttpRequest\"\n } : {};\n if (this.options.binaryBody) headers[\"Content-Type\"] = files[0].type;\n if (this.options.headers) Object.assign(headers, this.options.headers);\n for(var headerName in headers){\n var headerValue = headers[headerName];\n if (headerValue) xhr.setRequestHeader(headerName, headerValue);\n }\n if (this.options.binaryBody) {\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;\n try {\n // Since the file is going to be sent as binary body, it doesn't make\n // any sense to generate `FormData` for it.\n for(var _iterator1 = files[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){\n var file1 = _step1.value;\n this.emit(\"sending\", file1, xhr);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally{\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n if (this.options.uploadMultiple) this.emit(\"sendingmultiple\", files, xhr);\n this.submitRequest(xhr, null, files);\n } else {\n var formData = new FormData();\n // Adding all @options parameters\n if (this.options.params) {\n var additionalParams = this.options.params;\n if (typeof additionalParams === \"function\") additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null);\n for(var key in additionalParams){\n var value = additionalParams[key];\n if (Array.isArray(value)) // The additional parameter contains an array,\n // so lets iterate over it to attach each value\n // individually.\n for(var i = 0; i < value.length; i++)formData.append(key, value[i]);\n else formData.append(key, value);\n }\n }\n var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;\n try {\n // Let the user add additional data if necessary\n for(var _iterator2 = files[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){\n var file2 = _step2.value;\n this.emit(\"sending\", file2, xhr, formData);\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally{\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n if (this.options.uploadMultiple) this.emit(\"sendingmultiple\", files, xhr, formData);\n this._addFormElementData(formData);\n // Finally add the files\n // Has to be last because some servers (eg: S3) expect the file to be the last parameter\n for(var i1 = 0; i1 < dataBlocks.length; i1++){\n var dataBlock = dataBlocks[i1];\n formData.append(dataBlock.name, dataBlock.data, dataBlock.filename);\n }\n this.submitRequest(xhr, formData, files);\n }\n }\n },\n {\n // Transforms all files with this.options.transformFile and invokes done with the transformed files when done.\n key: \"_transformFiles\",\n value: function _transformFiles(files, done) {\n var _this, _loop = function(i) {\n _this.options.transformFile.call(_this, files[i], function(transformedFile) {\n transformedFiles[i] = transformedFile;\n if (++doneCounter === files.length) done(transformedFiles);\n });\n };\n var transformedFiles = [];\n // Clumsy way of handling asynchronous calls, until I get to add a proper Future library.\n var doneCounter = 0;\n for(var i = 0; i < files.length; i++)_this = this, _loop(i);\n }\n },\n {\n // Takes care of adding other input elements of the form to the AJAX request\n key: \"_addFormElementData\",\n value: function _addFormElementData(formData) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n // Take care of other input elements\n if (this.element.tagName === \"FORM\") try {\n for(var _iterator = this.element.querySelectorAll(\"input, textarea, select, button\")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var input = _step.value;\n var inputName = input.getAttribute(\"name\");\n var inputType = input.getAttribute(\"type\");\n if (inputType) inputType = inputType.toLowerCase();\n // If the input doesn't have a name, we can't use it.\n if (typeof inputName === \"undefined\" || inputName === null) continue;\n if (input.tagName === \"SELECT\" && input.hasAttribute(\"multiple\")) {\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;\n try {\n // Possibly multiple values\n for(var _iterator1 = input.options[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){\n var option = _step1.value;\n if (option.selected) formData.append(inputName, option.value);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally{\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n } else if (!inputType || inputType !== \"checkbox\" && inputType !== \"radio\" || input.checked) formData.append(inputName, input.value);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n }\n },\n {\n // Invoked when there is new progress information about given files.\n // If e is not provided, it is assumed that the upload is finished.\n key: \"_updateFilesUploadProgress\",\n value: function _updateFilesUploadProgress(files, xhr, e) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n if (!files[0].upload.chunked) try {\n // Handle file uploads without chunking\n for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var file = _step.value;\n if (file.upload.total && file.upload.bytesSent && file.upload.bytesSent == file.upload.total) continue;\n if (e) {\n file.upload.progress = 100 * e.loaded / e.total;\n file.upload.total = e.total;\n file.upload.bytesSent = e.loaded;\n } else {\n // No event, so we're at 100%\n file.upload.progress = 100;\n file.upload.bytesSent = file.upload.total;\n }\n this.emit(\"uploadprogress\", file, file.upload.progress, file.upload.bytesSent);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n else {\n // Handle chunked file uploads\n // Chunked upload is not compatible with uploading multiple files in one\n // request, so we know there's only one file.\n var file1 = files[0];\n // Since this is a chunked upload, we need to update the appropriate chunk\n // progress.\n var chunk = this._getChunk(file1, xhr);\n if (e) {\n chunk.progress = 100 * e.loaded / e.total;\n chunk.total = e.total;\n chunk.bytesSent = e.loaded;\n } else {\n // No event, so we're at 100%\n chunk.progress = 100;\n chunk.bytesSent = chunk.total;\n }\n // Now tally the *file* upload progress from its individual chunks\n file1.upload.progress = 0;\n file1.upload.total = 0;\n file1.upload.bytesSent = 0;\n for(var i = 0; i < file1.upload.totalChunkCount; i++)if (file1.upload.chunks[i] && typeof file1.upload.chunks[i].progress !== \"undefined\") {\n file1.upload.progress += file1.upload.chunks[i].progress;\n file1.upload.total += file1.upload.chunks[i].total;\n file1.upload.bytesSent += file1.upload.chunks[i].bytesSent;\n }\n // Since the process is a percentage, we need to divide by the amount of\n // chunks we've used.\n file1.upload.progress = file1.upload.progress / file1.upload.totalChunkCount;\n this.emit(\"uploadprogress\", file1, file1.upload.progress, file1.upload.bytesSent);\n }\n }\n },\n {\n key: \"_finishedUploading\",\n value: function _finishedUploading(files, xhr, e) {\n var response;\n if (files[0].status === Dropzone.CANCELED) return;\n if (xhr.readyState !== 4) return;\n if (xhr.responseType !== \"arraybuffer\" && xhr.responseType !== \"blob\") {\n response = xhr.responseText;\n if (xhr.getResponseHeader(\"content-type\") && ~xhr.getResponseHeader(\"content-type\").indexOf(\"application/json\")) try {\n response = JSON.parse(response);\n } catch (error) {\n e = error;\n response = \"Invalid JSON response from server.\";\n }\n }\n this._updateFilesUploadProgress(files, xhr);\n if (!(200 <= xhr.status && xhr.status < 300)) this._handleUploadError(files, xhr, response);\n else if (files[0].upload.chunked) files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr), response);\n else this._finished(files, response, e);\n }\n },\n {\n key: \"_handleUploadError\",\n value: function _handleUploadError(files, xhr, response) {\n if (files[0].status === Dropzone.CANCELED) return;\n if (files[0].upload.chunked && this.options.retryChunks) {\n var chunk = this._getChunk(files[0], xhr);\n if (chunk.retries++ < this.options.retryChunksLimit) {\n this._uploadData(files, [\n chunk.dataBlock\n ]);\n return;\n } else console.warn(\"Retried this chunk too often. Giving up.\");\n }\n this._errorProcessing(files, response || this.options.dictResponseError.replace(\"{{statusCode}}\", xhr.status), xhr);\n }\n },\n {\n key: \"submitRequest\",\n value: function submitRequest(xhr, formData, files) {\n if (xhr.readyState != 1) {\n console.warn(\"Cannot send this request because the XMLHttpRequest.readyState is not OPENED.\");\n return;\n }\n if (this.options.binaryBody) {\n if (files[0].upload.chunked) {\n var chunk = this._getChunk(files[0], xhr);\n xhr.send(chunk.dataBlock.data);\n } else xhr.send(files[0]);\n } else xhr.send(formData);\n }\n },\n {\n // Called internally when processing is finished.\n // Individual callbacks have to be called in the appropriate sections.\n key: \"_finished\",\n value: function _finished(files, responseText, e) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var file = _step.value;\n file.status = Dropzone.SUCCESS;\n this.emit(\"success\", file, responseText, e);\n this.emit(\"complete\", file);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (this.options.uploadMultiple) {\n this.emit(\"successmultiple\", files, responseText, e);\n this.emit(\"completemultiple\", files);\n }\n if (this.options.autoProcessQueue) return this.processQueue();\n }\n },\n {\n // Called internally when processing is finished.\n // Individual callbacks have to be called in the appropriate sections.\n key: \"_errorProcessing\",\n value: function _errorProcessing(files, message, xhr) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = files[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var file = _step.value;\n file.status = Dropzone.ERROR;\n this.emit(\"error\", file, message, xhr);\n this.emit(\"complete\", file);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (this.options.uploadMultiple) {\n this.emit(\"errormultiple\", files, message, xhr);\n this.emit(\"completemultiple\", files);\n }\n if (this.options.autoProcessQueue) return this.processQueue();\n }\n }\n ], [\n {\n key: \"initClass\",\n value: function initClass() {\n // Exposing the emitter class, mainly for tests\n this.prototype.Emitter = (0, $a527f8347b4b94dc$export$2e2bcd8739ae039);\n /*\n This is a list of all available events you can register on a dropzone object.\n\n You can register an event handler like this:\n\n dropzone.on(\"dragEnter\", function() { });\n\n */ this.prototype.events = [\n \"drop\",\n \"dragstart\",\n \"dragend\",\n \"dragenter\",\n \"dragover\",\n \"dragleave\",\n \"addedfile\",\n \"addedfiles\",\n \"removedfile\",\n \"thumbnail\",\n \"error\",\n \"errormultiple\",\n \"processing\",\n \"processingmultiple\",\n \"uploadprogress\",\n \"totaluploadprogress\",\n \"sending\",\n \"sendingmultiple\",\n \"success\",\n \"successmultiple\",\n \"canceled\",\n \"canceledmultiple\",\n \"complete\",\n \"completemultiple\",\n \"reset\",\n \"maxfilesexceeded\",\n \"maxfilesreached\",\n \"queuecomplete\",\n \"emptyfolder\"\n ];\n this.prototype._thumbnailQueue = [];\n this.prototype._processingThumbnail = false;\n }\n },\n {\n key: \"uuidv4\",\n value: function uuidv4() {\n return \"10000000-1000-4000-8000-100000000000\".replace(/[018]/g, function(c) {\n return (+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16);\n });\n }\n }\n ]);\n return Dropzone;\n}((0, $a527f8347b4b94dc$export$2e2bcd8739ae039));\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.initClass();\n// This is a map of options for your different dropzones. Add configurations\n// to this object for your different dropzone elements.\n//\n// Example:\n//\n// Dropzone.options.myDropzoneElementId = { maxFilesize: 1 };\n//\n// And in html:\n//\n//
\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.options = {};\n// Returns the options for an element or undefined if none available.\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.optionsForElement = function(element) {\n // Get the `Dropzone.options.elementId` for this element if it exists\n if (element.getAttribute(\"id\") && typeof $0b112e5f3be94b9d$export$2e2bcd8739ae039.options !== 'undefined') return $0b112e5f3be94b9d$export$2e2bcd8739ae039.options[$0b112e5f3be94b9d$var$camelize(element.getAttribute(\"id\"))];\n else return undefined;\n};\n// Holds a list of all dropzone instances\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.instances = [];\n// Returns the dropzone for given element if any\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.forElement = function(element) {\n if (typeof element === \"string\") element = document.querySelector(element);\n if ((element != null ? element.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.\");\n return element.dropzone;\n};\n// Looks for all .dropzone elements and creates a dropzone for them\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.discover = function() {\n var dropzones;\n if (document.querySelectorAll) dropzones = document.querySelectorAll(\".dropzone\");\n else {\n dropzones = [];\n // IE :(\n var checkElements = function(elements) {\n return function() {\n var result = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = elements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var el = _step.value;\n if (/(^| )dropzone($| )/.test(el.className)) result.push(dropzones.push(el));\n else result.push(undefined);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return result;\n }();\n };\n checkElements(document.getElementsByTagName(\"div\"));\n checkElements(document.getElementsByTagName(\"form\"));\n }\n return function() {\n var result = [];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = dropzones[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var dropzone = _step.value;\n // Create a dropzone unless auto discover has been disabled for specific element\n if ($0b112e5f3be94b9d$export$2e2bcd8739ae039.optionsForElement(dropzone) !== false) result.push(new $0b112e5f3be94b9d$export$2e2bcd8739ae039(dropzone));\n else result.push(undefined);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return result;\n }();\n};\n// Checks if the browser is supported by simply checking if Promise is here: a good cutoff\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.isBrowserSupported = function() {\n return typeof Promise !== \"undefined\";\n};\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.dataURItoBlob = function(dataURI) {\n // convert base64 to raw binary data held in a string\n // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this\n var byteString = atob(dataURI.split(\",\")[1]);\n // separate out the mime component\n var mimeString = dataURI.split(\",\")[0].split(\":\")[1].split(\";\")[0];\n // write the bytes of the string to an ArrayBuffer\n var ab = new ArrayBuffer(byteString.length);\n var ia = new Uint8Array(ab);\n for(var i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--)ia[i] = byteString.charCodeAt(i);\n // write the ArrayBuffer to a blob\n return new Blob([\n ab\n ], {\n type: mimeString\n });\n};\n// Returns an array without the rejected item\nvar $0b112e5f3be94b9d$var$without = function(list, rejectedItem) {\n return list.filter(function(item) {\n return item !== rejectedItem;\n }).map(function(item) {\n return item;\n });\n};\n// abc-def_ghi -> abcDefGhi\nvar $0b112e5f3be94b9d$var$camelize = function(str) {\n return str.replace(/[\\-_](\\w)/g, function(match) {\n return match.charAt(1).toUpperCase();\n });\n};\n// Creates an element from string\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.createElement = function(string) {\n var div = document.createElement(\"div\");\n div.innerHTML = string;\n return div.childNodes[0];\n};\n// Tests if given element is inside (or simply is) the container\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.elementInside = function(element, container) {\n if (element === container) return true;\n // Coffeescript doesn't support do/while loops\n while(element = element.parentNode){\n if (element === container) return true;\n }\n return false;\n};\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.getElement = function(el, name) {\n var element;\n if (typeof el === \"string\") element = document.querySelector(el);\n else if (el.nodeType != null) element = el;\n if (element == null) throw new Error(\"Invalid `\".concat(name, \"` option provided. Please provide a CSS selector or a plain HTML element.\"));\n return element;\n};\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.getElements = function(els, name) {\n var el, elements;\n if (els instanceof Array) {\n elements = [];\n try {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = els[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n el = _step.value;\n elements.push(this.getElement(el, name));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } catch (e) {\n elements = null;\n }\n } else if (typeof els === \"string\") {\n elements = [];\n var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;\n try {\n for(var _iterator1 = document.querySelectorAll(els)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){\n el = _step1.value;\n elements.push(el);\n }\n } catch (err) {\n _didIteratorError1 = true;\n _iteratorError1 = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion1 && _iterator1.return != null) {\n _iterator1.return();\n }\n } finally{\n if (_didIteratorError1) {\n throw _iteratorError1;\n }\n }\n }\n } else if (els.nodeType != null) elements = [\n els\n ];\n if (elements == null || !elements.length) throw new Error(\"Invalid `\".concat(name, \"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.\"));\n return elements;\n};\n// Asks the user the question and calls accepted or rejected accordingly\n//\n// The default implementation just uses `window.confirm` and then calls the\n// appropriate callback.\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.confirm = function(question, accepted, rejected) {\n if (window.confirm(question)) return accepted();\n else if (rejected != null) return rejected();\n};\n// Validates the mime type like this:\n//\n// https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.isValidFile = function(file, acceptedFiles) {\n if (!acceptedFiles) return true;\n // If there are no accepted mime types, it's OK\n acceptedFiles = acceptedFiles.split(\",\");\n var mimeType = file.type;\n var baseMimeType = mimeType.replace(/\\/.*$/, \"\");\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;\n try {\n for(var _iterator = acceptedFiles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){\n var validType = _step.value;\n validType = validType.trim();\n if (validType.charAt(0) === \".\") {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) return true;\n } else if (/\\/\\*$/.test(validType)) {\n // This is something like a image/* mime type\n if (baseMimeType === validType.replace(/\\/.*$/, \"\")) return true;\n } else {\n if (mimeType === validType) return true;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally{\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally{\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return false;\n};\n// Augment jQuery\nif (typeof jQuery !== \"undefined\" && jQuery !== null) jQuery.fn.dropzone = function(options) {\n return this.each(function() {\n return new $0b112e5f3be94b9d$export$2e2bcd8739ae039(this, options);\n });\n};\n// Dropzone file status codes\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.ADDED = \"added\";\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.QUEUED = \"queued\";\n// For backwards compatibility. Now, if a file is accepted, it's either queued\n// or uploading.\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.ACCEPTED = $0b112e5f3be94b9d$export$2e2bcd8739ae039.QUEUED;\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.UPLOADING = \"uploading\";\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.PROCESSING = $0b112e5f3be94b9d$export$2e2bcd8739ae039.UPLOADING; // alias\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.CANCELED = \"canceled\";\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.ERROR = \"error\";\n$0b112e5f3be94b9d$export$2e2bcd8739ae039.SUCCESS = \"success\";\n/*\n\n Bugfix for iOS 6 and 7\n Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios\n based on the work of https://github.com/stomita/ios-imagefile-megapixel\n\n */ // Detecting vertical squash in loaded image.\n// Fixes a bug which squash image vertically while drawing into canvas for some images.\n// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel\nvar $0b112e5f3be94b9d$var$detectVerticalSquash = function detectVerticalSquash(img) {\n var ih = img.naturalHeight;\n var canvas = document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = ih;\n var ctx = canvas.getContext(\"2d\");\n ctx.drawImage(img, 0, 0);\n var data = ctx.getImageData(1, 0, 1, ih).data;\n // search image edge pixel position in case it is squashed vertically.\n var sy = 0;\n var ey = ih;\n var py = ih;\n while(py > sy){\n var alpha = data[(py - 1) * 4 + 3];\n if (alpha === 0) ey = py;\n else sy = py;\n py = ey + sy >> 1;\n }\n var ratio = py / ih;\n if (ratio === 0) return 1;\n else return ratio;\n};\n// A replacement for context.drawImage\n// (args are for source and destination).\nvar $0b112e5f3be94b9d$var$drawImageIOSFix = function drawImageIOSFix(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {\n var vertSquashRatio = $0b112e5f3be94b9d$var$detectVerticalSquash(img);\n return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio);\n};\n// Inspired by MinifyJpeg\n// Source: http://www.perry.cz/files/ExifRestorer.js\n// http://elicon.blog57.fc2.com/blog-entry-206.html\nfunction $0b112e5f3be94b9d$var$removeExif(origFileBase64) {\n var marker = 'data:image/jpeg;base64,';\n if (!origFileBase64.startsWith(marker)) return origFileBase64;\n var origFile = window.atob(origFileBase64.slice(marker.length));\n if (!origFile.startsWith(\"\\xFF\\xD8\\xFF\")) return origFileBase64;\n // loop through the JPEG file segments and copy all but Exif segments into the filtered file.\n var head = 0;\n var filteredFile = \"\";\n while(head < origFile.length){\n if (origFile.slice(head, head + 2) == \"\\xFF\\xDA\") {\n // this is the start of the image data, we don't expect exif data after that.\n filteredFile += origFile.slice(head);\n break;\n } else if (origFile.slice(head, head + 2) == \"\\xFF\\xD8\") {\n // this is the global start marker.\n filteredFile += origFile.slice(head, head + 2);\n head += 2;\n } else {\n // we have a segment of variable size.\n var length = origFile.charCodeAt(head + 2) * 256 + origFile.charCodeAt(head + 3);\n var endPoint = head + length + 2;\n var segment = origFile.slice(head, endPoint);\n if (!segment.startsWith(\"\\xFF\\xE1\")) filteredFile += segment;\n head = endPoint;\n }\n }\n return marker + window.btoa(filteredFile);\n}\nfunction $0b112e5f3be94b9d$var$restoreExif(origFileBase64, resizedFileBase64) {\n var marker = 'data:image/jpeg;base64,';\n if (!(origFileBase64.startsWith(marker) && resizedFileBase64.startsWith(marker))) return resizedFileBase64;\n var origFile = window.atob(origFileBase64.slice(marker.length));\n if (!origFile.startsWith(\"\\xFF\\xD8\\xFF\")) return resizedFileBase64;\n // Go through the JPEG file segments one by one and collect any Exif segments we find.\n var head = 0;\n var exifData = \"\";\n while(head < origFile.length){\n if (origFile.slice(head, head + 2) == \"\\xFF\\xDA\") break;\n else if (origFile.slice(head, head + 2) == \"\\xFF\\xD8\") // this is the global start marker.\n head += 2;\n else {\n // we have a segment of variable size.\n var length = origFile.charCodeAt(head + 2) * 256 + origFile.charCodeAt(head + 3);\n var endPoint = head + length + 2;\n var segment = origFile.slice(head, endPoint);\n if (segment.startsWith(\"\\xFF\\xE1\")) exifData += segment;\n head = endPoint;\n }\n }\n if (exifData == \"\") return resizedFileBase64;\n var resizedFile = window.atob(resizedFileBase64.slice(marker.length));\n if (!resizedFile.startsWith(\"\\xFF\\xD8\\xFF\")) return resizedFileBase64;\n // The first file segment is always header information so insert the Exif data as second segment.\n var splitPoint = 4 + resizedFile.charCodeAt(4) * 256 + resizedFile.charCodeAt(5);\n resizedFile = resizedFile.slice(0, splitPoint) + exifData + resizedFile.slice(splitPoint);\n return marker + window.btoa(resizedFile);\n}\nfunction $0b112e5f3be94b9d$var$__guard__(value, transform) {\n return typeof value !== \"undefined\" && value !== null ? transform(value) : undefined;\n}\nfunction $0b112e5f3be94b9d$var$__guardMethod__(obj, methodName, transform) {\n if (typeof obj !== \"undefined\" && obj !== null && typeof obj[methodName] === \"function\") return transform(obj, methodName);\n else return undefined;\n}\n\n\nwindow.Dropzone = (0, $0b112e5f3be94b9d$export$2e2bcd8739ae039);\nvar $ce226ca44f70ba03$export$2e2bcd8739ae039 = (0, $0b112e5f3be94b9d$export$2e2bcd8739ae039);\n\n})();\n//# sourceMappingURL=dropzone-min.js.map\n","import Dropzone from \"../src/dropzone\";\n\nwindow.Dropzone = Dropzone;\n\nexport default Dropzone;\n","import Emitter from \"./emitter\";\nimport defaultOptions from \"./options\";\n\nexport default class Dropzone extends Emitter {\n static initClass() {\n // Exposing the emitter class, mainly for tests\n this.prototype.Emitter = Emitter;\n\n /*\n This is a list of all available events you can register on a dropzone object.\n\n You can register an event handler like this:\n\n dropzone.on(\"dragEnter\", function() { });\n\n */\n this.prototype.events = [\n \"drop\",\n \"dragstart\",\n \"dragend\",\n \"dragenter\",\n \"dragover\",\n \"dragleave\",\n \"addedfile\",\n \"addedfiles\",\n \"removedfile\",\n \"thumbnail\",\n \"error\",\n \"errormultiple\",\n \"processing\",\n \"processingmultiple\",\n \"uploadprogress\",\n \"totaluploadprogress\",\n \"sending\",\n \"sendingmultiple\",\n \"success\",\n \"successmultiple\",\n \"canceled\",\n \"canceledmultiple\",\n \"complete\",\n \"completemultiple\",\n \"reset\",\n \"maxfilesexceeded\",\n \"maxfilesreached\",\n \"queuecomplete\",\n \"emptyfolder\",\n ];\n\n this.prototype._thumbnailQueue = [];\n this.prototype._processingThumbnail = false;\n }\n\n constructor(el, options) {\n super();\n let fallback, left;\n this.element = el;\n\n this.clickableElements = [];\n this.listeners = [];\n this.files = []; // All files\n\n if (typeof this.element === \"string\") {\n this.element = document.querySelector(this.element);\n }\n\n // make sure we actually have an HTML Element\n if (this.element === null || !this.element instanceof HTMLElement) {\n throw new Error(\"Invalid dropzone element: not an instance of HTMLElement.\");\n }\n\n if (this.element.dropzone) {\n throw new Error(\"Dropzone already attached.\");\n }\n\n // Now add this dropzone to the instances.\n Dropzone.instances.push(this);\n\n // Put the dropzone inside the element itself.\n this.element.dropzone = this;\n\n let elementOptions =\n (left = Dropzone.optionsForElement(this.element)) != null ? left : {};\n\n this.options = Object.assign(\n {},\n defaultOptions,\n elementOptions,\n options != null ? options : {}\n );\n\n this.options.previewTemplate = this.options.previewTemplate.replace(\n /\\n*/g,\n \"\"\n );\n\n // If the browser failed, just call the fallback and leave\n if (this.options.forceFallback || !Dropzone.isBrowserSupported()) {\n return this.options.fallback.call(this);\n }\n\n // @options.url = @element.getAttribute \"action\" unless @options.url?\n if (this.options.url == null) {\n this.options.url = this.element.getAttribute(\"action\");\n }\n\n if (!this.options.url) {\n throw new Error(\"No URL provided.\");\n }\n\n if (this.options.uploadMultiple && this.options.chunking) {\n throw new Error(\"You cannot set both: uploadMultiple and chunking.\");\n }\n\n if (this.options.binaryBody && this.options.uploadMultiple) {\n throw new Error(\"You cannot set both: binaryBody and uploadMultiple.\");\n }\n\n if (typeof this.options.method === \"string\") {\n this.options.method = this.options.method.toUpperCase();\n }\n\n if ((fallback = this.getExistingFallback()) && fallback.parentNode) {\n // Remove the fallback\n fallback.parentNode.removeChild(fallback);\n }\n\n // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false\n if (this.options.previewsContainer !== false) {\n if (this.options.previewsContainer) {\n this.previewsContainer = Dropzone.getElement(\n this.options.previewsContainer,\n \"previewsContainer\"\n );\n } else {\n this.previewsContainer = this.element;\n }\n }\n\n if (this.options.clickable) {\n if (this.options.clickable === true) {\n this.clickableElements = [this.element];\n } else {\n this.clickableElements = Dropzone.getElements(\n this.options.clickable,\n \"clickable\"\n );\n }\n }\n\n this.init();\n }\n\n // Returns all files that have been accepted\n getAcceptedFiles() {\n return this.files.filter((file) => file.accepted).map((file) => file);\n }\n\n // Returns all files that have been rejected\n // Not sure when that's going to be useful, but added for completeness.\n getRejectedFiles() {\n return this.files.filter((file) => !file.accepted).map((file) => file);\n }\n\n getFilesWithStatus(status) {\n return this.files\n .filter((file) => file.status === status)\n .map((file) => file);\n }\n\n // Returns all files that are in the queue\n getQueuedFiles() {\n return this.getFilesWithStatus(Dropzone.QUEUED);\n }\n\n getUploadingFiles() {\n return this.getFilesWithStatus(Dropzone.UPLOADING);\n }\n\n getAddedFiles() {\n return this.getFilesWithStatus(Dropzone.ADDED);\n }\n\n // Files that are either queued or uploading\n getActiveFiles() {\n return this.files\n .filter(\n (file) =>\n file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED\n )\n .map((file) => file);\n }\n\n // The function that gets called when Dropzone is initialized. You\n // can (and should) setup event listeners inside this function.\n init() {\n // In case it isn't set already\n if (this.element.tagName === \"form\") {\n this.element.setAttribute(\"enctype\", \"multipart/form-data\");\n }\n\n if (\n this.element.classList.contains(\"dropzone\") &&\n !this.element.querySelector(\".dz-message\")\n ) {\n this.element.appendChild(\n Dropzone.createElement(\n `
`\n )\n );\n }\n\n if (this.clickableElements.length) {\n let setupHiddenFileInput = () => {\n if (this.hiddenFileInput) {\n this.hiddenFileInput.parentNode?.removeChild(this.hiddenFileInput);\n }\n this.hiddenFileInput = document.createElement(\"input\");\n this.hiddenFileInput.setAttribute(\"type\", \"file\");\n this.hiddenFileInput.setAttribute(\"form\", this.element.id);\n if (this.options.maxFiles === null || this.options.maxFiles > 1) {\n this.hiddenFileInput.setAttribute(\"multiple\", \"multiple\");\n }\n this.hiddenFileInput.className = \"dz-hidden-input\";\n\n if (this.options.acceptedFiles !== null) {\n this.hiddenFileInput.setAttribute(\n \"accept\",\n this.options.acceptedFiles\n );\n }\n if (this.options.capture !== null) {\n this.hiddenFileInput.setAttribute(\"capture\", this.options.capture);\n }\n\n // Making sure that no one can \"tab\" into this field.\n this.hiddenFileInput.setAttribute(\"tabindex\", \"-1\");\n // Add arialabel for a11y\n this.hiddenFileInput.setAttribute(\"aria-label\", \"dropzone hidden input\");\n\n // Not setting `display=\"none\"` because some browsers don't accept clicks\n // on elements that aren't displayed.\n this.hiddenFileInput.style.visibility = \"hidden\";\n this.hiddenFileInput.style.position = \"absolute\";\n this.hiddenFileInput.style.top = \"0\";\n this.hiddenFileInput.style.left = \"0\";\n this.hiddenFileInput.style.height = \"0\";\n this.hiddenFileInput.style.width = \"0\";\n Dropzone.getElement(\n this.options.hiddenInputContainer,\n \"hiddenInputContainer\"\n ).appendChild(this.hiddenFileInput);\n this.hiddenFileInput.addEventListener(\"change\", () => {\n let { files } = this.hiddenFileInput;\n if (files.length) {\n for (let file of files) {\n this.addFile(file);\n }\n }\n this.emit(\"addedfiles\", files);\n setupHiddenFileInput();\n });\n };\n setupHiddenFileInput();\n }\n\n this.URL = window.URL !== null ? window.URL : window.webkitURL;\n\n // Setup all event listeners on the Dropzone object itself.\n // They're not in @setupEventListeners() because they shouldn't be removed\n // again when the dropzone gets disabled.\n for (let eventName of this.events) {\n this.on(eventName, this.options[eventName]);\n }\n\n this.on(\"uploadprogress\", () => this.updateTotalUploadProgress());\n\n this.on(\"removedfile\", () => this.updateTotalUploadProgress());\n\n this.on(\"canceled\", (file) => this.emit(\"complete\", file));\n\n // Emit a `queuecomplete` event if all files finished uploading.\n this.on(\"complete\", (file) => {\n if (\n this.getAddedFiles().length === 0 &&\n this.getUploadingFiles().length === 0 &&\n this.getQueuedFiles().length === 0\n ) {\n // This needs to be deferred so that `queuecomplete` really triggers after `complete`\n return setTimeout(() => this.emit(\"queuecomplete\"), 0);\n }\n });\n\n const containsFiles = function (e) {\n return e.dataTransfer.types && e.dataTransfer.types.includes(\"Files\");\n };\n\n let noPropagation = function (e) {\n // If there are no files, we don't want to stop\n // propagation so we don't interfere with other\n // drag and drop behaviour.\n if (!containsFiles(e)) return;\n e.stopPropagation();\n return e.preventDefault();\n };\n\n // Create the listeners\n this.listeners = [\n {\n element: this.element,\n events: {\n dragstart: (e) => {\n return this.emit(\"dragstart\", e);\n },\n dragenter: (e) => {\n noPropagation(e);\n return this.emit(\"dragenter\", e);\n },\n dragover: (e) => {\n // Makes it possible to drag files from chrome's download bar\n // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar\n const efct = e.dataTransfer.effectAllowed;\n e.dataTransfer.dropEffect =\n \"move\" === efct || \"linkMove\" === efct ? \"move\" : \"copy\";\n\n noPropagation(e);\n return this.emit(\"dragover\", e);\n },\n dragleave: (e) => {\n return this.emit(\"dragleave\", e);\n },\n drop: (e) => {\n noPropagation(e);\n return this.drop(e);\n },\n dragend: (e) => {\n return this.emit(\"dragend\", e);\n },\n },\n\n // This is disabled right now, because the browsers don't implement it properly.\n // \"paste\": (e) =>\n // noPropagation e\n // @paste e\n },\n ];\n\n this.clickableElements.forEach((clickableElement) => {\n return this.listeners.push({\n element: clickableElement,\n events: {\n click: (evt) => {\n // Only the actual dropzone or the message element should trigger file selection\n if (\n clickableElement !== this.element ||\n evt.target === this.element ||\n Dropzone.elementInside(\n evt.target,\n this.element.querySelector(\".dz-message\")\n )\n ) {\n this.hiddenFileInput.click(); // Forward the click\n }\n return true;\n },\n },\n });\n });\n\n this.enable();\n\n return this.options.init.call(this);\n }\n\n // Not fully tested yet\n destroy() {\n this.disable();\n this.removeAllFiles(true);\n if (\n this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined\n ) {\n this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);\n this.hiddenFileInput = null;\n }\n delete this.element.dropzone;\n return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1);\n }\n\n updateTotalUploadProgress() {\n let totalUploadProgress;\n let totalBytesSent = 0;\n let totalBytes = 0;\n\n let activeFiles = this.getActiveFiles();\n\n if (activeFiles.length) {\n for (let file of this.getActiveFiles()) {\n totalBytesSent += file.upload.bytesSent;\n totalBytes += file.upload.total;\n }\n totalUploadProgress = (100 * totalBytesSent) / totalBytes;\n } else {\n totalUploadProgress = 100;\n }\n\n return this.emit(\n \"totaluploadprogress\",\n totalUploadProgress,\n totalBytes,\n totalBytesSent\n );\n }\n\n // @options.paramName can be a function taking one parameter rather than a string.\n // A parameter name for a file is obtained simply by calling this with an index number.\n _getParamName(n) {\n if (typeof this.options.paramName === \"function\") {\n return this.options.paramName(n);\n } else {\n return `${this.options.paramName}${\n this.options.uploadMultiple ? `[${n}]` : \"\"\n }`;\n }\n }\n\n // If @options.renameFile is a function,\n // the function will be used to rename the file.name before appending it to the formData.\n // MacOS 14+ screenshots contain narrow non-breaking space (U+202F) characters in filenames \n // (e.g., \"Screenshot 2024-01-30 at 10.32.07 AM.png\" where the space after \"07\" and before \"AM\" is U+202F).\n // This function now replaces these with regular spaces to prevent upload issues and maintain compatibility with MacOS\n _renameFile(file) {\n const cleanFile = {\n ...file,\n name: file.name.replace(/\\u202F/g, ' ')\n };\n \n if (typeof this.options.renameFile !== \"function\") {\n return cleanFile.name;\n }\n return this.options.renameFile(cleanFile);\n }\n\n // Returns a form that can be used as fallback if the browser does not support DragnDrop\n //\n // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided.\n // This code has to pass in IE7 :(\n getFallbackForm() {\n let existingFallback, form;\n if ((existingFallback = this.getExistingFallback())) {\n return existingFallback;\n }\n\n let fieldsString = '
';\n if (this.options.dictFallbackText) {\n fieldsString += `

${this.options.dictFallbackText}

`;\n }\n fieldsString += `
`;\n\n let fields = Dropzone.createElement(fieldsString);\n if (this.element.tagName !== \"FORM\") {\n form = Dropzone.createElement(\n `
`\n );\n form.appendChild(fields);\n } else {\n // Make sure that the enctype and method attributes are set properly\n this.element.setAttribute(\"enctype\", \"multipart/form-data\");\n this.element.setAttribute(\"method\", this.options.method);\n }\n return form != null ? form : fields;\n }\n\n // Returns the fallback elements if they exist already\n //\n // This code has to pass in IE7 :(\n getExistingFallback() {\n let getFallback = function (elements) {\n for (let el of elements) {\n if (/(^| )fallback($| )/.test(el.className)) {\n return el;\n }\n }\n };\n\n for (let tagName of [\"div\", \"form\"]) {\n var fallback;\n if (\n (fallback = getFallback(this.element.getElementsByTagName(tagName)))\n ) {\n return fallback;\n }\n }\n }\n\n // Activates all listeners stored in @listeners\n setupEventListeners() {\n return this.listeners.map((elementListeners) =>\n (() => {\n let result = [];\n for (let event in elementListeners.events) {\n let listener = elementListeners.events[event];\n result.push(\n elementListeners.element.addEventListener(event, listener, false)\n );\n }\n return result;\n })()\n );\n }\n\n // Deactivates all listeners stored in @listeners\n removeEventListeners() {\n return this.listeners.map((elementListeners) =>\n (() => {\n let result = [];\n for (let event in elementListeners.events) {\n let listener = elementListeners.events[event];\n result.push(\n elementListeners.element.removeEventListener(event, listener, false)\n );\n }\n return result;\n })()\n );\n }\n\n // Removes all event listeners and cancels all files in the queue or being processed.\n disable() {\n this.clickableElements.forEach((element) =>\n element.classList.remove(\"dz-clickable\")\n );\n this.removeEventListeners();\n this.disabled = true;\n\n return this.files.map((file) => this.cancelUpload(file));\n }\n\n enable() {\n delete this.disabled;\n this.clickableElements.forEach((element) =>\n element.classList.add(\"dz-clickable\")\n );\n return this.setupEventListeners();\n }\n\n // Returns a nicely formatted filesize\n filesize(size) {\n let selectedSize = 0;\n let selectedUnit = \"b\";\n\n if (size > 0) {\n let units = [\"tb\", \"gb\", \"mb\", \"kb\", \"b\"];\n\n for (let i = 0; i < units.length; i++) {\n let unit = units[i];\n let cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;\n\n if (size >= cutoff) {\n selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);\n selectedUnit = unit;\n break;\n }\n }\n\n selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits\n }\n\n return `${selectedSize} ${this.options.dictFileSizeUnits[selectedUnit]}`;\n }\n\n // Adds or removes the `dz-max-files-reached` class from the form.\n _updateMaxFilesReachedClass() {\n if (\n this.options.maxFiles != null &&\n this.getAcceptedFiles().length >= this.options.maxFiles\n ) {\n if (this.getAcceptedFiles().length === this.options.maxFiles) {\n this.emit(\"maxfilesreached\", this.files);\n }\n return this.element.classList.add(\"dz-max-files-reached\");\n } else {\n return this.element.classList.remove(\"dz-max-files-reached\");\n }\n }\n\n drop(e) {\n if (!e.dataTransfer) {\n return;\n }\n this.emit(\"drop\", e);\n\n // Convert the FileList to an Array\n // This is necessary for IE11\n let files = [];\n for (let i = 0; i < e.dataTransfer.files.length; i++) {\n files[i] = e.dataTransfer.files[i];\n }\n\n // Even if it's a folder, files.length will contain the folders.\n if (files.length) {\n let { items } = e.dataTransfer;\n if (items && items.length && items[0].webkitGetAsEntry != null) {\n // The browser supports dropping of folders, so handle items instead of files\n this._addFilesFromItems(items);\n } else {\n this.handleFiles(files);\n }\n }\n\n this.emit(\"addedfiles\", files);\n }\n\n paste(e) {\n if (\n __guard__(e != null ? e.clipboardData : undefined, (x) => x.items) == null\n ) {\n return;\n }\n\n this.emit(\"paste\", e);\n let { items } = e.clipboardData;\n\n if (items.length) {\n return this._addFilesFromItems(items);\n }\n }\n\n handleFiles(files) {\n for (let file of files) {\n this.addFile(file);\n }\n }\n\n // When a folder is dropped (or files are pasted), items must be handled\n // instead of files.\n _addFilesFromItems(items) {\n return (() => {\n let result = [];\n for (let item of items) {\n var entry;\n if (\n item.webkitGetAsEntry != null &&\n (entry = item.webkitGetAsEntry())\n ) {\n if (entry.isFile) {\n result.push(this.addFile(item.getAsFile()));\n } else if (entry.isDirectory) {\n // Append all files from that directory to files\n result.push(this._addFilesFromDirectory(entry, entry.name));\n } else {\n result.push(undefined);\n }\n } else if (item.getAsFile != null) {\n if (item.kind == null || item.kind === \"file\") {\n result.push(this.addFile(item.getAsFile()));\n } else {\n result.push(undefined);\n }\n } else {\n result.push(undefined);\n }\n }\n return result;\n })();\n }\n\n // Goes through the directory, and adds each file it finds recursively\n _addFilesFromDirectory(directory, path) {\n let dirReader = directory.createReader();\n\n let errorHandler = (error) =>\n __guardMethod__(console, \"log\", (o) => o.log(error));\n\n let entryCount = 0;\n var readEntries = () => {\n return dirReader.readEntries((entries) => {\n if (entries.length > 0) {\n for (let entry of entries) {\n if (entry.isFile) {\n ++entryCount;\n entry.file((file) => {\n if (\n this.options.ignoreHiddenFiles &&\n file.name.substring(0, 1) === \".\"\n ) {\n return;\n }\n file.fullPath = `${path}/${file.name}`;\n return this.addFile(file);\n });\n } else if (entry.isDirectory) {\n this._addFilesFromDirectory(entry, `${path}/${entry.name}`);\n }\n }\n\n // Recursively call readEntries() again, since browser only handle\n // the first 100 entries.\n // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries\n readEntries();\n } else if (entryCount === 0) {\n this.emit(\"emptyfolder\", path);\n }\n return null;\n }, errorHandler);\n };\n\n return readEntries();\n }\n\n // If `done()` is called without argument the file is accepted\n // If you call it with an error message, the file is rejected\n // (This allows for asynchronous validation)\n //\n // This function checks the filesize, and if the file.type passes the\n // `acceptedFiles` check.\n accept(file, done) {\n if (\n this.options.maxFilesize &&\n file.size > this.options.maxFilesize * 1024 * 1024\n ) {\n done(\n this.options.dictFileTooBig\n .replace(\"{{filesize}}\", Math.round(file.size / 1024 / 10.24) / 100)\n .replace(\"{{maxFilesize}}\", this.options.maxFilesize)\n );\n } else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {\n done(this.options.dictInvalidFileType);\n } else if (\n this.options.maxFiles != null &&\n this.getAcceptedFiles().length >= this.options.maxFiles\n ) {\n done(\n this.options.dictMaxFilesExceeded.replace(\n \"{{maxFiles}}\",\n this.options.maxFiles\n )\n );\n this.emit(\"maxfilesexceeded\", file);\n } else {\n this.options.accept.call(this, file, done);\n }\n }\n\n addFile(file) {\n file.upload = {\n // note: this only works if window.isSecureContext is true, which includes localhost in http\n uuid: window.isSecureContext ? self.crypto.randomUUID() : Dropzone.uuidv4(),\n progress: 0,\n // Setting the total upload size to file.size for the beginning\n // It's actual different than the size to be transmitted.\n total: file.size,\n bytesSent: 0,\n filename: this._renameFile(file),\n // Not setting chunking information here, because the actual data — and\n // thus the chunks — might change if `options.transformFile` is set\n // and does something to the data.\n };\n this.files.push(file);\n\n file.status = Dropzone.ADDED;\n\n this.emit(\"addedfile\", file);\n\n this._enqueueThumbnail(file);\n\n this.accept(file, (error) => {\n if (error) {\n file.accepted = false;\n this._errorProcessing([file], error); // Will set the file.status\n } else {\n file.accepted = true;\n if (this.options.autoQueue) {\n this.enqueueFile(file);\n } // Will set .accepted = true\n }\n this._updateMaxFilesReachedClass();\n });\n }\n\n // Wrapper for enqueueFile\n enqueueFiles(files) {\n for (let file of files) {\n this.enqueueFile(file);\n }\n return null;\n }\n\n enqueueFile(file) {\n if (file.status === Dropzone.ADDED && file.accepted === true) {\n file.status = Dropzone.QUEUED;\n if (this.options.autoProcessQueue) {\n return setTimeout(() => this.processQueue(), 0); // Deferring the call\n }\n } else {\n throw new Error(\n \"This file can't be queued because it has already been processed or was rejected.\"\n );\n }\n }\n\n _enqueueThumbnail(file) {\n if (\n this.options.createImageThumbnails &&\n file.type.match(/image.*/) &&\n file.size <= this.options.maxThumbnailFilesize * 1024 * 1024\n ) {\n this._thumbnailQueue.push(file);\n return setTimeout(() => this._processThumbnailQueue(), 0); // Deferring the call\n }\n }\n\n _processThumbnailQueue() {\n if (this._processingThumbnail || this._thumbnailQueue.length === 0) {\n return;\n }\n\n this._processingThumbnail = true;\n let file = this._thumbnailQueue.shift();\n return this.createThumbnail(\n file,\n this.options.thumbnailWidth,\n this.options.thumbnailHeight,\n this.options.thumbnailMethod,\n true,\n (dataUrl) => {\n this.emit(\"thumbnail\", file, dataUrl);\n this._processingThumbnail = false;\n return this._processThumbnailQueue();\n }\n );\n }\n\n // Can be called by the user to remove a file\n removeFile(file) {\n if (file.status === Dropzone.UPLOADING) {\n this.cancelUpload(file);\n }\n this.files = without(this.files, file);\n\n this.emit(\"removedfile\", file);\n if (this.files.length === 0) {\n return this.emit(\"reset\");\n }\n }\n\n // Removes all files that aren't currently processed from the list\n removeAllFiles(cancelIfNecessary) {\n // Create a copy of files since removeFile() changes the @files array.\n if (cancelIfNecessary == null) {\n cancelIfNecessary = false;\n }\n for (let file of this.files.slice()) {\n if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) {\n this.removeFile(file);\n }\n }\n return null;\n }\n\n // Resizes an image before it gets sent to the server. This function is the default behavior of\n // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with\n // the resized blob.\n resizeImage(file, width, height, resizeMethod, callback) {\n return this.createThumbnail(\n file,\n width,\n height,\n resizeMethod,\n true,\n (dataUrl, canvas) => {\n if (canvas == null) {\n // The image has not been resized\n return callback(file);\n } else {\n let { resizeMimeType } = this.options;\n if (resizeMimeType == null) {\n resizeMimeType = file.type;\n }\n let resizedDataURL = canvas.toDataURL(\n resizeMimeType,\n this.options.resizeQuality\n );\n if (\n resizeMimeType === \"image/jpeg\" ||\n resizeMimeType === \"image/jpg\"\n ) {\n // Now add the original EXIF information\n resizedDataURL = restoreExif(file.dataURL, resizedDataURL);\n }\n return callback(Dropzone.dataURItoBlob(resizedDataURL));\n }\n },\n true\n );\n }\n\n createThumbnail(file, width, height, resizeMethod, fixOrientation, callback, ignoreExif = false) {\n let fileReader = new FileReader();\n\n fileReader.onload = () => {\n file.dataURL = fileReader.result;\n\n // Don't bother creating a thumbnail for SVG images since they're vector\n if (file.type === \"image/svg+xml\") {\n if (callback != null) {\n callback(fileReader.result);\n }\n return;\n }\n\n this.createThumbnailFromUrl(\n file,\n width,\n height,\n resizeMethod,\n fixOrientation,\n callback,\n undefined,\n ignoreExif,\n );\n };\n\n fileReader.readAsDataURL(file);\n }\n\n // `mockFile` needs to have these attributes:\n //\n // { name: 'name', size: 12345, imageUrl: '' }\n //\n // `callback` will be invoked when the image has been downloaded and displayed.\n // `crossOrigin` will be added to the `img` tag when accessing the file.\n displayExistingFile(\n mockFile,\n imageUrl,\n callback,\n crossOrigin,\n resizeThumbnail = true\n ) {\n this.emit(\"addedfile\", mockFile);\n this.emit(\"complete\", mockFile);\n\n if (!resizeThumbnail) {\n this.emit(\"thumbnail\", mockFile, imageUrl);\n if (callback) callback();\n } else {\n let onDone = (thumbnail) => {\n this.emit(\"thumbnail\", mockFile, thumbnail);\n if (callback) callback();\n };\n mockFile.dataURL = imageUrl;\n\n this.createThumbnailFromUrl(\n mockFile,\n this.options.thumbnailWidth,\n this.options.thumbnailHeight,\n this.options.thumbnailMethod,\n this.options.fixOrientation,\n onDone,\n crossOrigin\n );\n }\n }\n\n createThumbnailFromUrl(\n file,\n width,\n height,\n resizeMethod,\n fixOrientation,\n callback,\n crossOrigin,\n ignoreExif = false,\n ) {\n // Not using `new Image` here because of a bug in latest Chrome versions.\n // See https://github.com/enyo/dropzone/pull/226\n let img = document.createElement(\"img\");\n\n if (crossOrigin) {\n img.crossOrigin = crossOrigin;\n }\n\n // fixOrientation is not needed anymore with browsers handling imageOrientation\n fixOrientation =\n getComputedStyle(document.body)[\"imageOrientation\"] == \"from-image\"\n ? false\n : fixOrientation;\n\n img.onload = () => {\n let loadExif = (callback) => callback(1);\n if (typeof EXIF !== \"undefined\" && EXIF !== null && fixOrientation) {\n loadExif = (callback) =>\n EXIF.getData(img, function () {\n return callback(EXIF.getTag(this, \"Orientation\"));\n });\n }\n\n return loadExif((orientation) => {\n file.width = img.width;\n file.height = img.height;\n\n let resizeInfo = this.options.resize.call(\n this,\n file,\n width,\n height,\n resizeMethod\n );\n\n let canvas = document.createElement(\"canvas\");\n let ctx = canvas.getContext(\"2d\");\n\n canvas.width = resizeInfo.trgWidth;\n canvas.height = resizeInfo.trgHeight;\n\n if (orientation > 4) {\n canvas.width = resizeInfo.trgHeight;\n canvas.height = resizeInfo.trgWidth;\n }\n\n switch (orientation) {\n case 2:\n // horizontal flip\n ctx.translate(canvas.width, 0);\n ctx.scale(-1, 1);\n break;\n case 3:\n // 180° rotate left\n ctx.translate(canvas.width, canvas.height);\n ctx.rotate(Math.PI);\n break;\n case 4:\n // vertical flip\n ctx.translate(0, canvas.height);\n ctx.scale(1, -1);\n break;\n case 5:\n // vertical flip + 90 rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.scale(1, -1);\n break;\n case 6:\n // 90° rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.translate(0, -canvas.width);\n break;\n case 7:\n // horizontal flip + 90 rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.translate(canvas.height, -canvas.width);\n ctx.scale(-1, 1);\n break;\n case 8:\n // 90° rotate left\n ctx.rotate(-0.5 * Math.PI);\n ctx.translate(-canvas.height, 0);\n break;\n }\n\n // This is a bugfix for iOS' scaling bug.\n drawImageIOSFix(\n ctx,\n img,\n resizeInfo.srcX != null ? resizeInfo.srcX : 0,\n resizeInfo.srcY != null ? resizeInfo.srcY : 0,\n resizeInfo.srcWidth,\n resizeInfo.srcHeight,\n resizeInfo.trgX != null ? resizeInfo.trgX : 0,\n resizeInfo.trgY != null ? resizeInfo.trgY : 0,\n resizeInfo.trgWidth,\n resizeInfo.trgHeight\n );\n\n let thumbnail = canvas.toDataURL(\"image/png\");\n\n if (callback != null) {\n return callback(thumbnail, canvas);\n }\n });\n };\n\n if (callback != null) {\n img.onerror = callback;\n }\n\n var dataURL = file.dataURL;\n if (ignoreExif) {\n dataURL = removeExif(dataURL);\n }\n\n return (img.src = dataURL);\n }\n\n // Goes through the queue and processes files if there aren't too many already.\n processQueue() {\n let { parallelUploads } = this.options;\n let processingLength = this.getUploadingFiles().length;\n let i = processingLength;\n\n // There are already at least as many files uploading than should be\n if (processingLength >= parallelUploads) {\n return;\n }\n\n let queuedFiles = this.getQueuedFiles();\n\n if (!(queuedFiles.length > 0)) {\n return;\n }\n\n if (this.options.uploadMultiple) {\n // The files should be uploaded in one request\n return this.processFiles(\n queuedFiles.slice(0, parallelUploads - processingLength)\n );\n } else {\n while (i < parallelUploads) {\n if (!queuedFiles.length) {\n return;\n } // Nothing left to process\n this.processFile(queuedFiles.shift());\n i++;\n }\n }\n }\n\n // Wrapper for `processFiles`\n processFile(file) {\n return this.processFiles([file]);\n }\n\n // Loads the file, then calls finishedLoading()\n processFiles(files) {\n for (let file of files) {\n file.processing = true; // Backwards compatibility\n file.status = Dropzone.UPLOADING;\n\n this.emit(\"processing\", file);\n }\n\n if (this.options.uploadMultiple) {\n this.emit(\"processingmultiple\", files);\n }\n\n return this.uploadFiles(files);\n }\n\n _getFilesWithXhr(xhr) {\n let files;\n return (files = this.files\n .filter((file) => file.xhr === xhr)\n .map((file) => file));\n }\n\n // Cancels the file upload and sets the status to CANCELED\n // **if** the file is actually being uploaded.\n // If it's still in the queue, the file is being removed from it and the status\n // set to CANCELED.\n cancelUpload(file) {\n if (file.status === Dropzone.UPLOADING) {\n let groupedFiles = this._getFilesWithXhr(file.xhr);\n for (let groupedFile of groupedFiles) {\n groupedFile.status = Dropzone.CANCELED;\n }\n if (typeof file.xhr !== \"undefined\") {\n file.xhr.abort();\n }\n for (let groupedFile of groupedFiles) {\n this.emit(\"canceled\", groupedFile);\n }\n if (this.options.uploadMultiple) {\n this.emit(\"canceledmultiple\", groupedFiles);\n }\n } else if (\n file.status === Dropzone.ADDED ||\n file.status === Dropzone.QUEUED\n ) {\n file.status = Dropzone.CANCELED;\n this.emit(\"canceled\", file);\n if (this.options.uploadMultiple) {\n this.emit(\"canceledmultiple\", [file]);\n }\n }\n\n if (this.options.autoProcessQueue) {\n return this.processQueue();\n }\n }\n\n resolveOption(option, ...args) {\n if (typeof option === \"function\") {\n return option.apply(this, args);\n }\n return option;\n }\n\n uploadFile(file) {\n return this.uploadFiles([file]);\n }\n\n uploadFiles(files) {\n this._transformFiles(files, (transformedFiles) => {\n if (this.options.chunking) {\n // Chunking is not allowed to be used with `uploadMultiple` so we know\n // that there is only __one__file.\n let transformedFile = transformedFiles[0];\n files[0].upload.chunked =\n this.options.chunking &&\n (this.options.forceChunking ||\n transformedFile.size > this.options.chunkSize);\n files[0].upload.totalChunkCount = Math.ceil(\n transformedFile.size / this.options.chunkSize\n );\n if (transformedFile.size === 0) {\n files[0].upload.totalChunkCount = 1;\n }\n }\n\n if (files[0].upload.chunked) {\n // This file should be sent in chunks!\n\n // If the chunking option is set, we **know** that there can only be **one** file, since\n // uploadMultiple is not allowed with this option.\n let file = files[0];\n let transformedFile = transformedFiles[0];\n\n file.upload.chunks = [];\n\n let handleNextChunk = () => {\n let chunkIndex = 0;\n\n // Find the next item in file.upload.chunks that is not defined yet.\n while (file.upload.chunks[chunkIndex] !== undefined) {\n chunkIndex++;\n }\n\n // This means, that all chunks have already been started.\n if (chunkIndex >= file.upload.totalChunkCount) return;\n\n let start = chunkIndex * this.options.chunkSize;\n let end = Math.min(\n start + this.options.chunkSize,\n transformedFile.size\n );\n\n let dataBlock = {\n name: this._getParamName(0),\n data: transformedFile.webkitSlice\n ? transformedFile.webkitSlice(start, end)\n : transformedFile.slice(start, end),\n filename: file.upload.filename,\n chunkIndex: chunkIndex,\n };\n\n file.upload.chunks[chunkIndex] = {\n file: file,\n index: chunkIndex,\n dataBlock: dataBlock, // In case we want to retry.\n status: Dropzone.UPLOADING,\n progress: 0,\n retries: 0, // The number of times this block has been retried.\n };\n\n this._uploadData(files, [dataBlock]);\n };\n\n file.upload.finishedChunkUpload = (chunk, response) => {\n let allFinished = true;\n chunk.status = Dropzone.SUCCESS;\n\n // Clear the data from the chunk\n chunk.dataBlock = null;\n chunk.response = chunk.xhr.responseText;\n chunk.responseHeaders = chunk.xhr.getAllResponseHeaders();\n // Leaving this reference to xhr will cause memory leaks.\n chunk.xhr = null;\n\n for (let i = 0; i < file.upload.totalChunkCount; i++) {\n if (file.upload.chunks[i] === undefined) {\n return handleNextChunk();\n }\n if (file.upload.chunks[i].status !== Dropzone.SUCCESS) {\n allFinished = false;\n }\n }\n\n if (allFinished) {\n this.options.chunksUploaded(file, () => {\n this._finished(files, response, null);\n });\n }\n };\n\n if (this.options.parallelChunkUploads) {\n // we want to limit parallelChunkUploads to the same value as parallelUploads option\n const parallelCount = Math.min(\n this.options.parallelChunkUploads === true ? this.options.parallelUploads : this.options.parallelChunkUploads,\n file.upload.totalChunkCount\n );\n for (let i = 0; i < parallelCount; i++) {\n handleNextChunk();\n }\n } else {\n handleNextChunk();\n }\n } else {\n let dataBlocks = [];\n for (let i = 0; i < files.length; i++) {\n dataBlocks[i] = {\n name: this._getParamName(i),\n data: transformedFiles[i],\n filename: files[i].upload.filename,\n };\n }\n this._uploadData(files, dataBlocks);\n }\n });\n }\n\n /// Returns the right chunk for given file and xhr\n _getChunk(file, xhr) {\n for (let i = 0; i < file.upload.totalChunkCount; i++) {\n if (\n file.upload.chunks[i] !== undefined &&\n file.upload.chunks[i].xhr === xhr\n ) {\n return file.upload.chunks[i];\n }\n }\n }\n\n // This function actually uploads the file(s) to the server.\n //\n // If dataBlocks contains the actual data to upload (meaning, that this could\n // either be transformed files, or individual chunks for chunked upload) then\n // they will be used for the actual data to upload.\n _uploadData(files, dataBlocks) {\n let xhr = new XMLHttpRequest();\n\n // Put the xhr object in the file objects to be able to reference it later.\n for (let file of files) {\n file.xhr = xhr;\n }\n if (files[0].upload.chunked) {\n // Put the xhr object in the right chunk object, so it can be associated\n // later, and found with _getChunk.\n files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr;\n }\n\n let method = this.resolveOption(this.options.method, files, dataBlocks);\n let url = this.resolveOption(this.options.url, files, dataBlocks);\n xhr.open(method, url, true);\n\n // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8\n let timeout = this.resolveOption(this.options.timeout, files);\n if (timeout) xhr.timeout = this.resolveOption(this.options.timeout, files);\n\n // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179\n xhr.withCredentials = !!this.options.withCredentials;\n\n xhr.onload = (e) => {\n this._finishedUploading(files, xhr, e);\n };\n\n xhr.ontimeout = () => {\n this._handleUploadError(\n files,\n xhr,\n `Request timedout after ${this.options.timeout / 1000} seconds`\n );\n };\n\n xhr.onerror = () => {\n this._handleUploadError(files, xhr);\n };\n\n // Some browsers do not have the .upload property\n let progressObj = xhr.upload != null ? xhr.upload : xhr;\n progressObj.onprogress = (e) =>\n this._updateFilesUploadProgress(files, xhr, e);\n\n let headers = this.options.defaultHeaders\n ? {\n Accept: \"application/json\",\n \"Cache-Control\": \"no-cache\",\n \"X-Requested-With\": \"XMLHttpRequest\",\n }\n : {};\n\n if (this.options.binaryBody) {\n headers[\"Content-Type\"] = files[0].type;\n }\n\n if (this.options.headers) {\n Object.assign(headers, this.options.headers);\n }\n\n for (let headerName in headers) {\n let headerValue = headers[headerName];\n if (headerValue) {\n xhr.setRequestHeader(headerName, headerValue);\n }\n }\n\n if (this.options.binaryBody) {\n // Since the file is going to be sent as binary body, it doesn't make\n // any sense to generate `FormData` for it.\n for (let file of files) {\n this.emit(\"sending\", file, xhr);\n }\n if (this.options.uploadMultiple) {\n this.emit(\"sendingmultiple\", files, xhr);\n }\n this.submitRequest(xhr, null, files);\n } else {\n let formData = new FormData();\n\n // Adding all @options parameters\n if (this.options.params) {\n let additionalParams = this.options.params;\n if (typeof additionalParams === \"function\") {\n additionalParams = additionalParams.call(\n this,\n files,\n xhr,\n files[0].upload.chunked ? this._getChunk(files[0], xhr) : null\n );\n }\n\n for (let key in additionalParams) {\n let value = additionalParams[key];\n if (Array.isArray(value)) {\n // The additional parameter contains an array,\n // so lets iterate over it to attach each value\n // individually.\n for (let i = 0; i < value.length; i++) {\n formData.append(key, value[i]);\n }\n } else {\n formData.append(key, value);\n }\n }\n }\n\n // Let the user add additional data if necessary\n for (let file of files) {\n this.emit(\"sending\", file, xhr, formData);\n }\n if (this.options.uploadMultiple) {\n this.emit(\"sendingmultiple\", files, xhr, formData);\n }\n\n this._addFormElementData(formData);\n\n // Finally add the files\n // Has to be last because some servers (eg: S3) expect the file to be the last parameter\n for (let i = 0; i < dataBlocks.length; i++) {\n let dataBlock = dataBlocks[i];\n formData.append(dataBlock.name, dataBlock.data, dataBlock.filename);\n }\n\n this.submitRequest(xhr, formData, files);\n }\n }\n\n // Transforms all files with this.options.transformFile and invokes done with the transformed files when done.\n _transformFiles(files, done) {\n let transformedFiles = [];\n // Clumsy way of handling asynchronous calls, until I get to add a proper Future library.\n let doneCounter = 0;\n for (let i = 0; i < files.length; i++) {\n this.options.transformFile.call(this, files[i], (transformedFile) => {\n transformedFiles[i] = transformedFile;\n if (++doneCounter === files.length) {\n done(transformedFiles);\n }\n });\n }\n }\n\n // Takes care of adding other input elements of the form to the AJAX request\n _addFormElementData(formData) {\n // Take care of other input elements\n if (this.element.tagName === \"FORM\") {\n for (let input of this.element.querySelectorAll(\n \"input, textarea, select, button\"\n )) {\n let inputName = input.getAttribute(\"name\");\n let inputType = input.getAttribute(\"type\");\n if (inputType) inputType = inputType.toLowerCase();\n\n // If the input doesn't have a name, we can't use it.\n if (typeof inputName === \"undefined\" || inputName === null) continue;\n\n if (input.tagName === \"SELECT\" && input.hasAttribute(\"multiple\")) {\n // Possibly multiple values\n for (let option of input.options) {\n if (option.selected) {\n formData.append(inputName, option.value);\n }\n }\n } else if (\n !inputType ||\n (inputType !== \"checkbox\" && inputType !== \"radio\") ||\n input.checked\n ) {\n formData.append(inputName, input.value);\n }\n }\n }\n }\n\n // Invoked when there is new progress information about given files.\n // If e is not provided, it is assumed that the upload is finished.\n _updateFilesUploadProgress(files, xhr, e) {\n if (!files[0].upload.chunked) {\n // Handle file uploads without chunking\n for (let file of files) {\n if (\n file.upload.total &&\n file.upload.bytesSent &&\n file.upload.bytesSent == file.upload.total\n ) {\n // If both, the `total` and `bytesSent` have already been set, and\n // they are equal (meaning progress is at 100%), we can skip this\n // file, since an upload progress shouldn't go down.\n continue;\n }\n\n if (e) {\n file.upload.progress = (100 * e.loaded) / e.total;\n file.upload.total = e.total;\n file.upload.bytesSent = e.loaded;\n } else {\n // No event, so we're at 100%\n file.upload.progress = 100;\n file.upload.bytesSent = file.upload.total;\n }\n\n this.emit(\n \"uploadprogress\",\n file,\n file.upload.progress,\n file.upload.bytesSent\n );\n }\n } else {\n // Handle chunked file uploads\n\n // Chunked upload is not compatible with uploading multiple files in one\n // request, so we know there's only one file.\n let file = files[0];\n\n // Since this is a chunked upload, we need to update the appropriate chunk\n // progress.\n let chunk = this._getChunk(file, xhr);\n\n if (e) {\n chunk.progress = (100 * e.loaded) / e.total;\n chunk.total = e.total;\n chunk.bytesSent = e.loaded;\n } else {\n // No event, so we're at 100%\n chunk.progress = 100;\n chunk.bytesSent = chunk.total;\n }\n\n // Now tally the *file* upload progress from its individual chunks\n file.upload.progress = 0;\n file.upload.total = 0;\n file.upload.bytesSent = 0;\n for (let i = 0; i < file.upload.totalChunkCount; i++) {\n if (\n file.upload.chunks[i] &&\n typeof file.upload.chunks[i].progress !== \"undefined\"\n ) {\n file.upload.progress += file.upload.chunks[i].progress;\n file.upload.total += file.upload.chunks[i].total;\n file.upload.bytesSent += file.upload.chunks[i].bytesSent;\n }\n }\n // Since the process is a percentage, we need to divide by the amount of\n // chunks we've used.\n file.upload.progress = file.upload.progress / file.upload.totalChunkCount;\n\n this.emit(\n \"uploadprogress\",\n file,\n file.upload.progress,\n file.upload.bytesSent\n );\n }\n }\n\n _finishedUploading(files, xhr, e) {\n let response;\n\n if (files[0].status === Dropzone.CANCELED) {\n return;\n }\n\n if (xhr.readyState !== 4) {\n return;\n }\n\n if (xhr.responseType !== \"arraybuffer\" && xhr.responseType !== \"blob\") {\n response = xhr.responseText;\n\n if (\n xhr.getResponseHeader(\"content-type\") &&\n ~xhr.getResponseHeader(\"content-type\").indexOf(\"application/json\")\n ) {\n try {\n response = JSON.parse(response);\n } catch (error) {\n e = error;\n response = \"Invalid JSON response from server.\";\n }\n }\n }\n\n this._updateFilesUploadProgress(files, xhr);\n\n if (!(200 <= xhr.status && xhr.status < 300)) {\n this._handleUploadError(files, xhr, response);\n } else {\n if (files[0].upload.chunked) {\n files[0].upload.finishedChunkUpload(\n this._getChunk(files[0], xhr),\n response\n );\n } else {\n this._finished(files, response, e);\n }\n }\n }\n\n _handleUploadError(files, xhr, response) {\n if (files[0].status === Dropzone.CANCELED) {\n return;\n }\n\n if (files[0].upload.chunked && this.options.retryChunks) {\n let chunk = this._getChunk(files[0], xhr);\n if (chunk.retries++ < this.options.retryChunksLimit) {\n this._uploadData(files, [chunk.dataBlock]);\n return;\n } else {\n console.warn(\"Retried this chunk too often. Giving up.\");\n }\n }\n\n this._errorProcessing(\n files,\n response ||\n this.options.dictResponseError.replace(\"{{statusCode}}\", xhr.status),\n xhr\n );\n }\n\n submitRequest(xhr, formData, files) {\n if (xhr.readyState != 1) {\n console.warn(\n \"Cannot send this request because the XMLHttpRequest.readyState is not OPENED.\"\n );\n return;\n }\n if (this.options.binaryBody) {\n if (files[0].upload.chunked) {\n const chunk = this._getChunk(files[0], xhr);\n xhr.send(chunk.dataBlock.data);\n } else {\n xhr.send(files[0]);\n }\n } else {\n xhr.send(formData);\n }\n }\n\n // Called internally when processing is finished.\n // Individual callbacks have to be called in the appropriate sections.\n _finished(files, responseText, e) {\n for (let file of files) {\n file.status = Dropzone.SUCCESS;\n this.emit(\"success\", file, responseText, e);\n this.emit(\"complete\", file);\n }\n if (this.options.uploadMultiple) {\n this.emit(\"successmultiple\", files, responseText, e);\n this.emit(\"completemultiple\", files);\n }\n\n if (this.options.autoProcessQueue) {\n return this.processQueue();\n }\n }\n\n // Called internally when processing is finished.\n // Individual callbacks have to be called in the appropriate sections.\n _errorProcessing(files, message, xhr) {\n for (let file of files) {\n file.status = Dropzone.ERROR;\n this.emit(\"error\", file, message, xhr);\n this.emit(\"complete\", file);\n }\n if (this.options.uploadMultiple) {\n this.emit(\"errormultiple\", files, message, xhr);\n this.emit(\"completemultiple\", files);\n }\n\n if (this.options.autoProcessQueue) {\n return this.processQueue();\n }\n }\n\n static uuidv4() {\n return \"10000000-1000-4000-8000-100000000000\".replace(/[018]/g, c =>\n (+c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +c / 4).toString(16)\n );\n }\n}\nDropzone.initClass();\n\n// This is a map of options for your different dropzones. Add configurations\n// to this object for your different dropzone elements.\n//\n// Example:\n//\n// Dropzone.options.myDropzoneElementId = { maxFilesize: 1 };\n//\n// And in html:\n//\n//
\nDropzone.options = {};\n\n// Returns the options for an element or undefined if none available.\nDropzone.optionsForElement = function (element) {\n // Get the `Dropzone.options.elementId` for this element if it exists\n if (element.getAttribute(\"id\") && typeof Dropzone.options !== 'undefined') {\n return Dropzone.options[camelize(element.getAttribute(\"id\"))];\n } else {\n return undefined;\n }\n};\n\n// Holds a list of all dropzone instances\nDropzone.instances = [];\n\n// Returns the dropzone for given element if any\nDropzone.forElement = function (element) {\n if (typeof element === \"string\") {\n element = document.querySelector(element);\n }\n if ((element != null ? element.dropzone : undefined) == null) {\n throw new Error(\n \"No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.\"\n );\n }\n return element.dropzone;\n};\n\n// Looks for all .dropzone elements and creates a dropzone for them\nDropzone.discover = function () {\n let dropzones;\n if (document.querySelectorAll) {\n dropzones = document.querySelectorAll(\".dropzone\");\n } else {\n dropzones = [];\n // IE :(\n let checkElements = (elements) =>\n (() => {\n let result = [];\n for (let el of elements) {\n if (/(^| )dropzone($| )/.test(el.className)) {\n result.push(dropzones.push(el));\n } else {\n result.push(undefined);\n }\n }\n return result;\n })();\n checkElements(document.getElementsByTagName(\"div\"));\n checkElements(document.getElementsByTagName(\"form\"));\n }\n\n return (() => {\n let result = [];\n for (let dropzone of dropzones) {\n // Create a dropzone unless auto discover has been disabled for specific element\n if (Dropzone.optionsForElement(dropzone) !== false) {\n result.push(new Dropzone(dropzone));\n } else {\n result.push(undefined);\n }\n }\n return result;\n })();\n};\n\n// Checks if the browser is supported by simply checking if Promise is here: a good cutoff\nDropzone.isBrowserSupported = function () {\n return typeof Promise !== \"undefined\";\n};\n\nDropzone.dataURItoBlob = function (dataURI) {\n // convert base64 to raw binary data held in a string\n // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this\n let byteString = atob(dataURI.split(\",\")[1]);\n\n // separate out the mime component\n let mimeString = dataURI.split(\",\")[0].split(\":\")[1].split(\";\")[0];\n\n // write the bytes of the string to an ArrayBuffer\n let ab = new ArrayBuffer(byteString.length);\n let ia = new Uint8Array(ab);\n for (\n let i = 0, end = byteString.length, asc = 0 <= end;\n asc ? i <= end : i >= end;\n asc ? i++ : i--\n ) {\n ia[i] = byteString.charCodeAt(i);\n }\n\n // write the ArrayBuffer to a blob\n return new Blob([ab], { type: mimeString });\n};\n\n// Returns an array without the rejected item\nconst without = (list, rejectedItem) =>\n list.filter((item) => item !== rejectedItem).map((item) => item);\n\n// abc-def_ghi -> abcDefGhi\nconst camelize = (str) =>\n str.replace(/[\\-_](\\w)/g, (match) => match.charAt(1).toUpperCase());\n\n// Creates an element from string\nDropzone.createElement = function (string) {\n let div = document.createElement(\"div\");\n div.innerHTML = string;\n return div.childNodes[0];\n};\n\n// Tests if given element is inside (or simply is) the container\nDropzone.elementInside = function (element, container) {\n if (element === container) {\n return true;\n } // Coffeescript doesn't support do/while loops\n while ((element = element.parentNode)) {\n if (element === container) {\n return true;\n }\n }\n return false;\n};\n\nDropzone.getElement = function (el, name) {\n let element;\n if (typeof el === \"string\") {\n element = document.querySelector(el);\n } else if (el.nodeType != null) {\n element = el;\n }\n if (element == null) {\n throw new Error(\n `Invalid \\`${name}\\` option provided. Please provide a CSS selector or a plain HTML element.`\n );\n }\n return element;\n};\n\nDropzone.getElements = function (els, name) {\n let el, elements;\n if (els instanceof Array) {\n elements = [];\n try {\n for (el of els) {\n elements.push(this.getElement(el, name));\n }\n } catch (e) {\n elements = null;\n }\n } else if (typeof els === \"string\") {\n elements = [];\n for (el of document.querySelectorAll(els)) {\n elements.push(el);\n }\n } else if (els.nodeType != null) {\n elements = [els];\n }\n\n if (elements == null || !elements.length) {\n throw new Error(\n `Invalid \\`${name}\\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`\n );\n }\n\n return elements;\n};\n\n// Asks the user the question and calls accepted or rejected accordingly\n//\n// The default implementation just uses `window.confirm` and then calls the\n// appropriate callback.\nDropzone.confirm = function (question, accepted, rejected) {\n if (window.confirm(question)) {\n return accepted();\n } else if (rejected != null) {\n return rejected();\n }\n};\n\n// Validates the mime type like this:\n//\n// https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept\nDropzone.isValidFile = function (file, acceptedFiles) {\n if (!acceptedFiles) {\n return true;\n } // If there are no accepted mime types, it's OK\n acceptedFiles = acceptedFiles.split(\",\");\n\n let mimeType = file.type;\n let baseMimeType = mimeType.replace(/\\/.*$/, \"\");\n\n for (let validType of acceptedFiles) {\n validType = validType.trim();\n if (validType.charAt(0) === \".\") {\n if (\n file.name\n .toLowerCase()\n .indexOf(\n validType.toLowerCase(),\n file.name.length - validType.length\n ) !== -1\n ) {\n return true;\n }\n } else if (/\\/\\*$/.test(validType)) {\n // This is something like a image/* mime type\n if (baseMimeType === validType.replace(/\\/.*$/, \"\")) {\n return true;\n }\n } else {\n if (mimeType === validType) {\n return true;\n }\n }\n }\n\n return false;\n};\n\n// Augment jQuery\nif (typeof jQuery !== \"undefined\" && jQuery !== null) {\n jQuery.fn.dropzone = function (options) {\n return this.each(function () {\n return new Dropzone(this, options);\n });\n };\n}\n\n// Dropzone file status codes\nDropzone.ADDED = \"added\";\n\nDropzone.QUEUED = \"queued\";\n// For backwards compatibility. Now, if a file is accepted, it's either queued\n// or uploading.\nDropzone.ACCEPTED = Dropzone.QUEUED;\n\nDropzone.UPLOADING = \"uploading\";\nDropzone.PROCESSING = Dropzone.UPLOADING; // alias\n\nDropzone.CANCELED = \"canceled\";\nDropzone.ERROR = \"error\";\nDropzone.SUCCESS = \"success\";\n\n/*\n\n Bugfix for iOS 6 and 7\n Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios\n based on the work of https://github.com/stomita/ios-imagefile-megapixel\n\n */\n\n// Detecting vertical squash in loaded image.\n// Fixes a bug which squash image vertically while drawing into canvas for some images.\n// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel\nlet detectVerticalSquash = function (img) {\n let ih = img.naturalHeight;\n let canvas = document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = ih;\n let ctx = canvas.getContext(\"2d\");\n ctx.drawImage(img, 0, 0);\n let { data } = ctx.getImageData(1, 0, 1, ih);\n\n // search image edge pixel position in case it is squashed vertically.\n let sy = 0;\n let ey = ih;\n let py = ih;\n while (py > sy) {\n let alpha = data[(py - 1) * 4 + 3];\n\n if (alpha === 0) {\n ey = py;\n } else {\n sy = py;\n }\n\n py = (ey + sy) >> 1;\n }\n let ratio = py / ih;\n\n if (ratio === 0) {\n return 1;\n } else {\n return ratio;\n }\n};\n\n// A replacement for context.drawImage\n// (args are for source and destination).\nvar drawImageIOSFix = function (ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {\n let vertSquashRatio = detectVerticalSquash(img);\n return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio);\n};\n\n// Inspired by MinifyJpeg\n// Source: http://www.perry.cz/files/ExifRestorer.js\n// http://elicon.blog57.fc2.com/blog-entry-206.html\nfunction removeExif(origFileBase64) {\n\n var marker = 'data:image/jpeg;base64,';\n\n if (!origFileBase64.startsWith(marker)) {\n return origFileBase64;\n }\n\n var origFile = window.atob(origFileBase64.slice(marker.length));\n\n if (!origFile.startsWith(\"\\xFF\\xD8\\xFF\")) {\n return origFileBase64;\n }\n\n // loop through the JPEG file segments and copy all but Exif segments into the filtered file.\n var head = 0;\n var filteredFile = \"\";\n while (head < origFile.length) {\n\n if (origFile.slice(head, head+2) == \"\\xFF\\xDA\") {\n // this is the start of the image data, we don't expect exif data after that.\n filteredFile += origFile.slice(head);\n break;\n } else if (origFile.slice(head, head+2) == \"\\xFF\\xD8\") {\n // this is the global start marker.\n filteredFile += origFile.slice(head, head+2);\n head += 2;\n } else {\n // we have a segment of variable size.\n var length = origFile.charCodeAt(head + 2) * 256 + origFile.charCodeAt(head + 3);\n var endPoint = head + length + 2;\n var segment = origFile.slice(head, endPoint);\n if (!segment.startsWith(\"\\xFF\\xE1\")) {\n filteredFile += segment;\n }\n head = endPoint;\n }\n }\n\n return marker + window.btoa(filteredFile);\n}\n\nfunction restoreExif(origFileBase64, resizedFileBase64) {\n\n var marker = 'data:image/jpeg;base64,';\n\n if (!(origFileBase64.startsWith(marker) && resizedFileBase64.startsWith(marker))) {\n return resizedFileBase64;\n }\n\n var origFile = window.atob(origFileBase64.slice(marker.length));\n\n if (!origFile.startsWith(\"\\xFF\\xD8\\xFF\")) {\n return resizedFileBase64;\n }\n\n // Go through the JPEG file segments one by one and collect any Exif segments we find.\n var head = 0;\n var exifData = \"\";\n while (head < origFile.length) {\n\n if (origFile.slice(head, head+2) == \"\\xFF\\xDA\") {\n // this is the start of the image data, we don't expect exif data after that.\n break;\n } else if (origFile.slice(head, head+2) == \"\\xFF\\xD8\") {\n // this is the global start marker.\n head += 2;\n } else {\n // we have a segment of variable size.\n var length = origFile.charCodeAt(head + 2) * 256 + origFile.charCodeAt(head + 3);\n var endPoint = head + length + 2;\n var segment = origFile.slice(head, endPoint);\n if (segment.startsWith(\"\\xFF\\xE1\")) {\n exifData += segment;\n }\n head = endPoint;\n }\n\n }\n\n if (exifData == \"\") {\n return resizedFileBase64;\n }\n\n var resizedFile = window.atob(resizedFileBase64.slice(marker.length));\n\n if (!resizedFile.startsWith(\"\\xFF\\xD8\\xFF\")) {\n return resizedFileBase64;\n }\n\n // The first file segment is always header information so insert the Exif data as second segment.\n var splitPoint = 4 + resizedFile.charCodeAt(4) * 256 + resizedFile.charCodeAt(5)\n resizedFile = resizedFile.slice(0, splitPoint) + exifData + resizedFile.slice(splitPoint);\n\n return marker + window.btoa(resizedFile);\n}\n\nfunction __guard__(value, transform) {\n return typeof value !== \"undefined\" && value !== null\n ? transform(value)\n : undefined;\n}\nfunction __guardMethod__(obj, methodName, transform) {\n if (\n typeof obj !== \"undefined\" &&\n obj !== null &&\n typeof obj[methodName] === \"function\"\n ) {\n return transform(obj, methodName);\n } else {\n return undefined;\n }\n}\n\nexport { Dropzone };\n","import { _ as _get_prototype_of } from \"./_get_prototype_of.js\";\nimport { _ as _is_native_reflect_construct } from \"./_is_native_reflect_construct.js\";\nimport { _ as _possible_constructor_return } from \"./_possible_constructor_return.js\";\n\nfunction _call_super(_this, derived, args) {\n // Super\n derived = _get_prototype_of(derived);\n return _possible_constructor_return(\n _this,\n _is_native_reflect_construct()\n // NOTE: This doesn't work if this.__proto__.constructor has been modified.\n ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor)\n : derived.apply(_this, args)\n );\n}\n\nexport { _call_super as _ };\n","function _get_prototype_of(o) {\n _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n\n return _get_prototype_of(o);\n}\nexport { _get_prototype_of as _ };\n","function _is_native_reflect_construct() {\n // Since Reflect.construct can't be properly polyfilled, some\n // implementations (e.g. core-js@2) don't set the correct internal slots.\n // Those polyfills don't allow us to subclass built-ins, so we need to\n // use our fallback implementation.\n try {\n // If the internal slots aren't set, this throws an error similar to\n // TypeError: this is not a Boolean object.\n var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));\n } catch (_) {}\n return (_is_native_reflect_construct = function() {\n return !!result;\n })();\n}\n\nexport { _is_native_reflect_construct as _ };\n","import { _ as _assert_this_initialized } from \"./_assert_this_initialized.js\";\nimport { _ as _type_of } from \"./_type_of.js\";\n\nfunction _possible_constructor_return(self, call) {\n if (call && (_type_of(call) === \"object\" || typeof call === \"function\")) return call;\n\n return _assert_this_initialized(self);\n}\nexport { _possible_constructor_return as _ };\n","function _assert_this_initialized(self) {\n if (self === void 0) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n\n return self;\n}\nexport { _assert_this_initialized as _ };\n","function _type_of(obj) {\n \"@swc/helpers - typeof\";\n\n return obj && typeof Symbol !== \"undefined\" && obj.constructor === Symbol ? \"symbol\" : typeof obj;\n}\nexport { _type_of as _ };\n","function _class_call_check(instance, Constructor) {\n if (!(instance instanceof Constructor)) throw new TypeError(\"Cannot call a class as a function\");\n}\nexport { _class_call_check as _ };\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n\n if (\"value\" in descriptor) descriptor.writable = true;\n\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\nfunction _create_class(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n\n return Constructor;\n}\nexport { _create_class as _ };\n","import { _ as _set_prototype_of } from \"./_set_prototype_of.js\";\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });\n\n if (superClass) _set_prototype_of(subClass, superClass);\n}\nexport { _inherits as _ };\n","function _set_prototype_of(o, p) {\n _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {\n o.__proto__ = p;\n\n return o;\n };\n\n return _set_prototype_of(o, p);\n}\nexport { _set_prototype_of as _ };\n","import { _ as _define_property } from \"./_define_property.js\";\n\nfunction _object_spread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === \"function\") {\n ownKeys = ownKeys.concat(\n Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n })\n );\n }\n\n ownKeys.forEach(function(key) {\n _define_property(target, key, source[key]);\n });\n }\n\n return target;\n}\nexport { _object_spread as _ };\n","function _define_property(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });\n } else obj[key] = value;\n\n return obj;\n}\nexport { _define_property as _ };\n","function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) {\n symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\nfunction _object_spread_props(target, source) {\n source = source != null ? source : {};\n\n if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n else {\n ownKeys(Object(source)).forEach(function(key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}\nexport { _object_spread_props as _ };\n","// The Emitter class provides the ability to call `.on()` on Dropzone to listen\n// to events.\n// It is strongly based on component's emitter class, and I removed the\n// functionality because of the dependency hell with different frameworks.\nexport default class Emitter {\n // Add an event listener for given event\n on(event, fn) {\n this._callbacks = this._callbacks || {};\n // Create namespace for this event\n if (!this._callbacks[event]) {\n this._callbacks[event] = [];\n }\n this._callbacks[event].push(fn);\n return this;\n }\n\n emit(event, ...args) {\n this._callbacks = this._callbacks || {};\n let callbacks = this._callbacks[event];\n\n if (callbacks) {\n for (let callback of callbacks) {\n callback.apply(this, args);\n }\n }\n // trigger a corresponding DOM event\n if (this.element) {\n this.element.dispatchEvent(\n this.makeEvent(\"dropzone:\" + event, { args: args })\n );\n }\n return this;\n }\n\n makeEvent(eventName, detail) {\n let params = { bubbles: true, cancelable: true, detail: detail };\n\n if (typeof window.CustomEvent === \"function\") {\n return new CustomEvent(eventName, params);\n } else {\n // IE 11 support\n // https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent\n var evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(\n eventName,\n params.bubbles,\n params.cancelable,\n params.detail\n );\n return evt;\n }\n }\n\n // Remove event listener for given event. If fn is not provided, all event\n // listeners for that event will be removed. If neither is provided, all\n // event listeners will be removed.\n off(event, fn) {\n if (!this._callbacks || arguments.length === 0) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n let callbacks = this._callbacks[event];\n if (!callbacks) {\n return this;\n }\n\n // remove all handlers\n if (arguments.length === 1) {\n delete this._callbacks[event];\n return this;\n }\n\n // remove specific handler\n for (let i = 0; i < callbacks.length; i++) {\n let callback = callbacks[i];\n if (callback === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n return this;\n }\n}\n","import Dropzone from \"./dropzone\";\nimport defaultPreviewTemplate from \"bundle-text:./preview-template.html\";\n\nlet defaultOptions = {\n /**\n * Has to be specified on elements other than form (or when the form doesn't\n * have an `action` attribute).\n *\n * You can also provide a function that will be called with `files` and\n * `dataBlocks` and must return the url as string.\n */\n url: null,\n\n /**\n * Can be changed to `\"put\"` if necessary. You can also provide a function\n * that will be called with `files` and must return the method (since `v3.12.0`).\n */\n method: \"post\",\n\n /**\n * Will be set on the XHRequest.\n */\n withCredentials: false,\n\n /**\n * The timeout for the XHR requests in milliseconds (since `v4.4.0`).\n * If set to null or 0, no timeout is going to be set.\n */\n timeout: null,\n\n /**\n * How many file uploads to process in parallel (See the\n * Enqueuing file uploads documentation section for more info)\n */\n parallelUploads: 2,\n\n /**\n * Whether to send multiple files in one request. If\n * this it set to true, then the fallback file input element will\n * have the `multiple` attribute as well. This option will\n * also trigger additional events (like `processingmultiple`). See the events\n * documentation section for more information.\n */\n uploadMultiple: false,\n\n /**\n * Whether you want files to be uploaded in chunks to your server. This can't be\n * used in combination with `uploadMultiple`.\n *\n * See [chunksUploaded](#config-chunksUploaded) for the callback to finalise an upload.\n */\n chunking: false,\n\n /**\n * If `chunking` is enabled, this defines whether **every** file should be chunked,\n * even if the file size is below chunkSize. This means, that the additional chunk\n * form data will be submitted and the `chunksUploaded` callback will be invoked.\n */\n forceChunking: false,\n\n /**\n * If `chunking` is `true`, then this defines the chunk size in bytes.\n */\n chunkSize: 2 * 1024 * 1024,\n\n /**\n * If `true`, the individual chunks of a file are being uploaded simultaneously.\n * The limit of concurrent connections is governed by `parallelUploads`.\n */\n parallelChunkUploads: false,\n\n /**\n * Whether a chunk should be retried if it fails.\n */\n retryChunks: false,\n\n /**\n * If `retryChunks` is true, how many times should it be retried.\n */\n retryChunksLimit: 3,\n\n /**\n * The maximum filesize (in MiB) that is allowed to be uploaded.\n */\n maxFilesize: 256,\n\n /**\n * The name of the file param that gets transferred.\n * **NOTE**: If you have the option `uploadMultiple` set to `true`, then\n * Dropzone will append `[]` to the name.\n */\n paramName: \"file\",\n\n /**\n * Whether thumbnails for images should be generated\n */\n createImageThumbnails: true,\n\n /**\n * In MB. When the filename exceeds this limit, the thumbnail will not be generated.\n */\n maxThumbnailFilesize: 10,\n\n /**\n * If `null`, the ratio of the image will be used to calculate it.\n */\n thumbnailWidth: 120,\n\n /**\n * The same as `thumbnailWidth`. If both are null, images will not be resized.\n */\n thumbnailHeight: 120,\n\n /**\n * How the images should be scaled down in case both, `thumbnailWidth` and `thumbnailHeight` are provided.\n * Can be either `contain` or `crop`.\n */\n thumbnailMethod: \"crop\",\n\n /**\n * If set, images will be resized to these dimensions before being **uploaded**.\n * If only one, `resizeWidth` **or** `resizeHeight` is provided, the original aspect\n * ratio of the file will be preserved.\n *\n * The `options.transformFile` function uses these options, so if the `transformFile` function\n * is overridden, these options don't do anything.\n */\n resizeWidth: null,\n\n /**\n * See `resizeWidth`.\n */\n resizeHeight: null,\n\n /**\n * The mime type of the resized image (before it gets uploaded to the server).\n * If `null` the original mime type will be used. To force jpeg, for example, use `image/jpeg`.\n * See `resizeWidth` for more information.\n */\n resizeMimeType: null,\n\n /**\n * The quality of the resized images. See `resizeWidth`.\n */\n resizeQuality: 0.8,\n\n /**\n * How the images should be scaled down in case both, `resizeWidth` and `resizeHeight` are provided.\n * Can be either `contain` or `crop`.\n */\n resizeMethod: \"contain\",\n\n /**\n * The base that is used to calculate the **displayed** filesize. You can\n * change this to 1024 if you would rather display kibibytes, mebibytes,\n * etc... 1024 is technically incorrect, because `1024 bytes` are `1 kibibyte`\n * not `1 kilobyte`. You can change this to `1024` if you don't care about\n * validity.\n */\n filesizeBase: 1000,\n\n /**\n * If not `null` defines how many files this Dropzone handles. If it exceeds,\n * the event `maxfilesexceeded` will be called. The dropzone element gets the\n * class `dz-max-files-reached` accordingly so you can provide visual\n * feedback.\n */\n maxFiles: null,\n\n /**\n * An optional object to send additional headers to the server. Eg:\n * `{ \"My-Awesome-Header\": \"header value\" }`\n */\n headers: null,\n\n /**\n * Should the default headers be set or not?\n * Accept: application/json <- for requesting json response\n * Cache-Control: no-cache <- Request shouldn't be cached\n * X-Requested-With: XMLHttpRequest <- We sent the request via XMLHttpRequest\n */\n defaultHeaders: true,\n\n /**\n * If `true`, the dropzone element itself will be clickable, if `false`\n * nothing will be clickable.\n *\n * You can also pass an HTML element, a CSS selector (for multiple elements)\n * or an array of those. In that case, all of those elements will trigger an\n * upload when clicked.\n */\n clickable: true,\n\n /**\n * Whether hidden files in directories should be ignored.\n */\n ignoreHiddenFiles: true,\n\n /**\n * The default implementation of `accept` checks the file's mime type or\n * extension against this list. This is a comma separated list of mime\n * types or file extensions.\n *\n * Eg.: `image/*,application/pdf,.psd`\n *\n * If the Dropzone is `clickable` this option will also be used as\n * [`accept`](https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept)\n * parameter on the hidden file input as well.\n */\n acceptedFiles: null,\n\n /**\n * If false, files will be added to the queue but the queue will not be\n * processed automatically.\n * This can be useful if you need some additional user input before sending\n * files (or if you want want all files sent at once).\n * If you're ready to send the file simply call `myDropzone.processQueue()`.\n *\n * See the [enqueuing file uploads](#enqueuing-file-uploads) documentation\n * section for more information.\n */\n autoProcessQueue: true,\n\n /**\n * If false, files added to the dropzone will not be queued by default.\n * You'll have to call `enqueueFile(file)` manually.\n */\n autoQueue: true,\n\n /**\n * If `true`, this will add a link to every file preview to remove or cancel (if\n * already uploading) the file. The `dictCancelUpload`, `dictCancelUploadConfirmation`\n * and `dictRemoveFile` options are used for the wording.\n */\n addRemoveLinks: false,\n\n /**\n * Defines where to display the file previews – if `null` the\n * Dropzone element itself is used. Can be a plain `HTMLElement` or a CSS\n * selector. The element should have the `dropzone-previews` class so\n * the previews are displayed properly.\n */\n previewsContainer: null,\n\n /**\n * Set this to `true` if you don't want previews to be shown.\n */\n disablePreviews: false,\n\n /**\n * This is the element the hidden input field (which is used when clicking on the\n * dropzone to trigger file selection) will be appended to. This might\n * be important in case you use frameworks to switch the content of your page.\n *\n * Can be a selector string, or an element directly.\n */\n hiddenInputContainer: \"body\",\n\n /**\n * If null, no capture type will be specified\n * If camera, mobile devices will skip the file selection and choose camera\n * If microphone, mobile devices will skip the file selection and choose the microphone\n * If camcorder, mobile devices will skip the file selection and choose the camera in video mode\n * On apple devices multiple must be set to false. AcceptedFiles may need to\n * be set to an appropriate mime type (e.g. \"image/*\", \"audio/*\", or \"video/*\").\n */\n capture: null,\n\n /**\n * **Deprecated**. Use `renameFile` instead.\n */\n renameFilename: null,\n\n /**\n * A function that is invoked before the file is uploaded to the server and renames the file.\n * This function gets the `File` as argument and can use the `file.name`. The actual name of the\n * file that gets used during the upload can be accessed through `file.upload.filename`.\n */\n renameFile: null,\n\n /**\n * If `true` the fallback will be forced. This is very useful to test your server\n * implementations first and make sure that everything works as\n * expected without dropzone if you experience problems, and to test\n * how your fallbacks will look.\n */\n forceFallback: false,\n\n /**\n * The text used before any files are dropped.\n */\n dictDefaultMessage: \"Drop files here to upload\",\n\n /**\n * The text that replaces the default message text it the browser is not supported.\n */\n dictFallbackMessage:\n \"Your browser does not support drag'n'drop file uploads.\",\n\n /**\n * The text that will be added before the fallback form.\n * If you provide a fallback element yourself, or if this option is `null` this will\n * be ignored.\n */\n dictFallbackText:\n \"Please use the fallback form below to upload your files like in the olden days.\",\n\n /**\n * If the filesize is too big.\n * `{{filesize}}` and `{{maxFilesize}}` will be replaced with the respective configuration values.\n */\n dictFileTooBig:\n \"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.\",\n\n /**\n * If the file doesn't match the file type.\n */\n dictInvalidFileType: \"You can't upload files of this type.\",\n\n /**\n * If the server response was invalid.\n * `{{statusCode}}` will be replaced with the servers status code.\n */\n dictResponseError: \"Server responded with {{statusCode}} code.\",\n\n /**\n * If `addRemoveLinks` is true, the text to be used for the cancel upload link.\n */\n dictCancelUpload: \"Cancel upload\",\n\n /**\n * The text that is displayed if an upload was manually canceled\n */\n dictUploadCanceled: \"Upload canceled.\",\n\n /**\n * If `addRemoveLinks` is true, the text to be used for confirmation when cancelling upload.\n */\n dictCancelUploadConfirmation: \"Are you sure you want to cancel this upload?\",\n\n /**\n * If `addRemoveLinks` is true, the text to be used to remove a file.\n */\n dictRemoveFile: \"Remove file\",\n\n /**\n * If this is not null, then the user will be prompted before removing a file.\n */\n dictRemoveFileConfirmation: null,\n\n /**\n * Displayed if `maxFiles` is st and exceeded.\n * The string `{{maxFiles}}` will be replaced by the configuration value.\n */\n dictMaxFilesExceeded: \"You cannot upload any more files.\",\n\n /**\n * Allows you to translate the different units. Starting with `tb` for terabytes and going down to\n * `b` for bytes.\n */\n dictFileSizeUnits: { tb: \"TB\", gb: \"GB\", mb: \"MB\", kb: \"KB\", b: \"b\" },\n /**\n * Called when dropzone initialized\n * You can add event listeners here\n */\n init() {},\n\n /**\n * Can be an **object** of additional parameters to transfer to the server, **or** a `Function`\n * that gets invoked with the `files`, `xhr` and, if it's a chunked upload, `chunk` arguments. In case\n * of a function, this needs to return a map.\n *\n * The default implementation does nothing for normal uploads, but adds relevant information for\n * chunked uploads.\n *\n * This is the same as adding hidden input fields in the form element.\n */\n params(files, xhr, chunk) {\n if (chunk) {\n return {\n dzuuid: chunk.file.upload.uuid,\n dzchunkindex: chunk.index,\n dztotalfilesize: chunk.file.size,\n dzchunksize: this.options.chunkSize,\n dztotalchunkcount: chunk.file.upload.totalChunkCount,\n dzchunkbyteoffset: chunk.index * this.options.chunkSize,\n };\n }\n },\n\n /**\n * A function that gets a [file](https://developer.mozilla.org/en-US/docs/DOM/File)\n * and a `done` function as parameters.\n *\n * If the done function is invoked without arguments, the file is \"accepted\" and will\n * be processed. If you pass an error message, the file is rejected, and the error\n * message will be displayed.\n * This function will not be called if the file is too big or doesn't match the mime types.\n */\n accept(file, done) {\n return done();\n },\n\n /**\n * The callback that will be invoked when all chunks have been uploaded for a file.\n * It gets the file for which the chunks have been uploaded as the first parameter,\n * and the `done` function as second. `done()` needs to be invoked when everything\n * needed to finish the upload process is done.\n */\n chunksUploaded: function (file, done) {\n done();\n },\n\n /**\n * Sends the file as binary blob in body instead of form data.\n * If this is set, the `params` option will be ignored.\n * It's an error to set this to `true` along with `uploadMultiple` since\n * multiple files cannot be in a single binary body.\n */\n binaryBody: false,\n\n /**\n * Gets called when the browser is not supported.\n * The default implementation shows the fallback input field and adds\n * a text.\n */\n fallback() {\n // This code should pass in IE7... :(\n let messageElement;\n this.element.className = `${this.element.className} dz-browser-not-supported`;\n\n for (let child of this.element.getElementsByTagName(\"div\")) {\n if (/(^| )dz-message($| )/.test(child.className)) {\n messageElement = child;\n child.className = \"dz-message\"; // Removes the 'dz-default' class\n break;\n }\n }\n if (!messageElement) {\n messageElement = Dropzone.createElement(\n '
'\n );\n this.element.appendChild(messageElement);\n }\n\n let span = messageElement.getElementsByTagName(\"span\")[0];\n if (span) {\n if (span.textContent != null) {\n span.textContent = this.options.dictFallbackMessage;\n } else if (span.innerText != null) {\n span.innerText = this.options.dictFallbackMessage;\n }\n }\n\n return this.element.appendChild(this.getFallbackForm());\n },\n\n /**\n * Gets called to calculate the thumbnail dimensions.\n *\n * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing:\n *\n * - `srcWidth` & `srcHeight` (required)\n * - `trgWidth` & `trgHeight` (required)\n * - `srcX` & `srcY` (optional, default `0`)\n * - `trgX` & `trgY` (optional, default `0`)\n *\n * Those values are going to be used by `ctx.drawImage()`.\n */\n resize(file, width, height, resizeMethod) {\n let info = {\n srcX: 0,\n srcY: 0,\n srcWidth: file.width,\n srcHeight: file.height,\n };\n\n let srcRatio = file.width / file.height;\n\n // Automatically calculate dimensions if not specified\n if (width == null && height == null) {\n width = info.srcWidth;\n height = info.srcHeight;\n } else if (width == null) {\n width = height * srcRatio;\n } else if (height == null) {\n height = width / srcRatio;\n }\n\n // Make sure images aren't upscaled\n width = Math.min(width, info.srcWidth);\n height = Math.min(height, info.srcHeight);\n\n let trgRatio = width / height;\n\n if (info.srcWidth > width || info.srcHeight > height) {\n // Image is bigger and needs rescaling\n if (resizeMethod === \"crop\") {\n if (srcRatio > trgRatio) {\n info.srcHeight = file.height;\n info.srcWidth = info.srcHeight * trgRatio;\n } else {\n info.srcWidth = file.width;\n info.srcHeight = info.srcWidth / trgRatio;\n }\n } else if (resizeMethod === \"contain\") {\n // Method 'contain'\n if (srcRatio > trgRatio) {\n height = width / srcRatio;\n } else {\n width = height * srcRatio;\n }\n } else {\n throw new Error(`Unknown resizeMethod '${resizeMethod}'`);\n }\n }\n\n info.srcX = (file.width - info.srcWidth) / 2;\n info.srcY = (file.height - info.srcHeight) / 2;\n\n info.trgWidth = width;\n info.trgHeight = height;\n\n return info;\n },\n\n /**\n * Can be used to transform the file (for example, resize an image if necessary).\n *\n * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes\n * images according to those dimensions.\n *\n * Gets the `file` as the first parameter, and a `done()` function as the second, that needs\n * to be invoked with the file when the transformation is done.\n */\n transformFile(file, done) {\n if (\n (this.options.resizeWidth || this.options.resizeHeight) &&\n file.type.match(/image.*/)\n ) {\n return this.resizeImage(\n file,\n this.options.resizeWidth,\n this.options.resizeHeight,\n this.options.resizeMethod,\n done\n );\n } else {\n return done(file);\n }\n },\n\n /**\n * A string that contains the template used for each dropped\n * file. Change it to fulfill your needs but make sure to properly\n * provide all elements.\n *\n * If you want to use an actual HTML element instead of providing a String\n * as a config option, you could create a div with the id `tpl`,\n * put the template inside it and provide the element like this:\n *\n * document\n * .querySelector('#tpl')\n * .innerHTML\n *\n */\n previewTemplate: defaultPreviewTemplate,\n\n /*\n Those functions register themselves to the events on init and handle all\n the user interface specific stuff. Overwriting them won't break the upload\n but can break the way it's displayed.\n You can overwrite them if you don't like the default behavior. If you just\n want to add an additional event handler, register it on the dropzone object\n and don't overwrite those options.\n */\n\n // Those are self explanatory and simply concern the DragnDrop.\n drop(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n dragstart(e) {},\n dragend(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n dragenter(e) {\n return this.element.classList.add(\"dz-drag-hover\");\n },\n dragover(e) {\n return this.element.classList.add(\"dz-drag-hover\");\n },\n dragleave(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n\n paste(e) {},\n\n // Called whenever there are no files left in the dropzone anymore, and the\n // dropzone should be displayed as if in the initial state.\n reset() {\n return this.element.classList.remove(\"dz-started\");\n },\n\n // Called when a file is added to the queue\n // Receives `file`\n addedfile(file) {\n if (this.element === this.previewsContainer) {\n this.element.classList.add(\"dz-started\");\n }\n\n if (this.previewsContainer && !this.options.disablePreviews) {\n file.previewElement = Dropzone.createElement(\n this.options.previewTemplate.trim()\n );\n file.previewTemplate = file.previewElement; // Backwards compatibility\n\n this.previewsContainer.appendChild(file.previewElement);\n for (var node of file.previewElement.querySelectorAll(\"[data-dz-name]\")) {\n node.textContent = file.name;\n }\n for (node of file.previewElement.querySelectorAll(\"[data-dz-size]\")) {\n node.innerHTML = this.filesize(file.size);\n }\n\n if (this.options.addRemoveLinks) {\n file._removeLink = Dropzone.createElement(\n `${this.options.dictRemoveFile}`\n );\n file.previewElement.appendChild(file._removeLink);\n }\n\n let removeFileEvent = (e) => {\n e.preventDefault();\n e.stopPropagation();\n if (file.status === Dropzone.UPLOADING) {\n if (this.options.dictCancelUploadConfirmation) {\n return Dropzone.confirm(\n this.options.dictCancelUploadConfirmation,\n () => this.removeFile(file)\n );\n } else {\n return this.removeFile(file);\n }\n } else {\n if (this.options.dictRemoveFileConfirmation) {\n return Dropzone.confirm(\n this.options.dictRemoveFileConfirmation,\n () => this.removeFile(file)\n );\n } else {\n return this.removeFile(file);\n }\n }\n };\n\n for (let removeLink of file.previewElement.querySelectorAll(\n \"[data-dz-remove]\"\n )) {\n removeLink.addEventListener(\"click\", removeFileEvent);\n }\n }\n },\n\n // Called whenever a file is removed.\n removedfile(file) {\n if (file.previewElement != null && file.previewElement.parentNode != null) {\n file.previewElement.parentNode.removeChild(file.previewElement);\n }\n return this._updateMaxFilesReachedClass();\n },\n\n // Called when a thumbnail has been generated\n // Receives `file` and `dataUrl`\n thumbnail(file, dataUrl) {\n if (file.previewElement) {\n file.previewElement.classList.remove(\"dz-file-preview\");\n for (let thumbnailElement of file.previewElement.querySelectorAll(\n \"[data-dz-thumbnail]\"\n )) {\n thumbnailElement.alt = file.name;\n thumbnailElement.src = dataUrl;\n }\n\n return setTimeout(\n () => file.previewElement.classList.add(\"dz-image-preview\"),\n 1\n );\n }\n },\n\n // Called whenever an error occurs\n // Receives `file` and `message`\n error(file, message) {\n if (file.previewElement) {\n file.previewElement.classList.add(\"dz-error\");\n if (typeof message !== \"string\" && message.error) {\n message = message.error;\n }\n for (let node of file.previewElement.querySelectorAll(\n \"[data-dz-errormessage]\"\n )) {\n node.textContent = message;\n }\n }\n },\n\n errormultiple() {},\n\n // Called when a file gets processed. Since there is a queue, not all added\n // files are processed immediately.\n // Receives `file`\n processing(file) {\n if (file.previewElement) {\n file.previewElement.classList.add(\"dz-processing\");\n if (file._removeLink) {\n return (file._removeLink.innerHTML = this.options.dictCancelUpload);\n }\n }\n },\n\n processingmultiple() {},\n\n // Called whenever the upload progress gets updated.\n // Receives `file`, `progress` (percentage 0-100) and `bytesSent`.\n // To get the total number of bytes of the file, use `file.size`\n uploadprogress(file, progress, bytesSent) {\n if (file.previewElement) {\n for (let node of file.previewElement.querySelectorAll(\n \"[data-dz-uploadprogress]\"\n )) {\n node.nodeName === \"PROGRESS\"\n ? (node.value = progress)\n : (node.style.width = `${progress}%`);\n }\n }\n },\n\n // Called whenever the total upload progress gets updated.\n // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent\n totaluploadprogress() {},\n\n // Called just before the file is sent. Gets the `xhr` object as second\n // parameter, so you can modify it (for example to add a CSRF token) and a\n // `formData` object to add additional information.\n sending() {},\n\n sendingmultiple() {},\n\n // When the complete upload is finished and successful\n // Receives `file`\n success(file) {\n if (file.previewElement) {\n return file.previewElement.classList.add(\"dz-success\");\n }\n },\n\n successmultiple() {},\n\n // When the upload is canceled.\n canceled(file) {\n return this.emit(\"error\", file, this.options.dictUploadCanceled);\n },\n\n canceledmultiple() {},\n\n // When the upload is finished, either with success or an error.\n // Receives `file`\n complete(file) {\n if (file._removeLink) {\n file._removeLink.innerHTML = this.options.dictRemoveFile;\n }\n if (file.previewElement) {\n return file.previewElement.classList.add(\"dz-complete\");\n }\n },\n\n completemultiple() {},\n\n maxfilesexceeded() {},\n\n maxfilesreached() {},\n\n queuecomplete() {},\n\n addedfiles() {},\n\n emptyfolder() {},\n};\n\nexport default defaultOptions;\n","module.exports = \"3938ea34fc7a1ebb\";"],"names":["$98824e80807ab8c4$export$71511d61b312f219","o","Object","setPrototypeOf","getPrototypeOf","__proto__","$ea4a107a74d16add$export$71511d61b312f219","result","Boolean","prototype","valueOf","call","Reflect","construct","_","$d13763098d3cb1e3$export$71511d61b312f219","self","obj","Symbol","constructor","ReferenceError","$a09c5fed926355a1$export$71511d61b312f219","instance","Constructor","TypeError","$273e99875a375f47$var$_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","defineProperty","key","$273e99875a375f47$export$71511d61b312f219","protoProps","staticProps","$e97e5092cb7916e1$export$71511d61b312f219","p","a","$a527f8347b4b94dc$export$2e2bcd8739ae039","Emitter","value","event","fn","_callbacks","push","_len","arguments","args","Array","_key","callbacks","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_step","_iterator","iterator","next","done","callback","apply","err","return","element","dispatchEvent","makeEvent","eventName","detail","params","bubbles","cancelable","window","CustomEvent","evt","document","createEvent","initCustomEvent","splice","$5804b5cb637998e0$exports","$588a9ad8284f77de$var$defaultOptions","url","method","withCredentials","timeout","parallelUploads","uploadMultiple","chunking","forceChunking","chunkSize","parallelChunkUploads","retryChunks","retryChunksLimit","maxFilesize","paramName","createImageThumbnails","maxThumbnailFilesize","thumbnailWidth","thumbnailHeight","thumbnailMethod","resizeWidth","resizeHeight","resizeMimeType","resizeQuality","resizeMethod","filesizeBase","maxFiles","headers","defaultHeaders","clickable","ignoreHiddenFiles","acceptedFiles","autoProcessQueue","autoQueue","addRemoveLinks","previewsContainer","disablePreviews","hiddenInputContainer","capture","renameFilename","renameFile","forceFallback","dictDefaultMessage","dictFallbackMessage","dictFallbackText","dictFileTooBig","dictInvalidFileType","dictResponseError","dictCancelUpload","dictUploadCanceled","dictCancelUploadConfirmation","dictRemoveFile","dictRemoveFileConfirmation","dictMaxFilesExceeded","dictFileSizeUnits","tb","gb","mb","kb","b","init","files","xhr","chunk","dzuuid","file","upload","uuid","dzchunkindex","index","dztotalfilesize","size","dzchunksize","options","dztotalchunkcount","totalChunkCount","dzchunkbyteoffset","accept","chunksUploaded","binaryBody","fallback","className","concat","messageElement","getElementsByTagName","child","test","$0b112e5f3be94b9d$export$2e2bcd8739ae039","createElement","appendChild","span","textContent","innerText","getFallbackForm","resize","width","height","info","srcX","srcY","srcWidth","srcHeight","srcRatio","trgRatio","Math","min","Error","trgWidth","trgHeight","transformFile","type","match","resizeImage","previewTemplate","__esModule","default","drop","e","classList","remove","dragstart","dragend","dragenter","add","dragover","dragleave","paste","reset","addedfile","_this","previewElement","trim","querySelectorAll","node","name","_iteratorNormalCompletion1","_didIteratorError1","_iteratorError1","_step1","_iterator1","innerHTML","filesize","_removeLink","removeFileEvent","preventDefault","stopPropagation","status","UPLOADING","confirm","removeFile","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","removeLink","addEventListener","removedfile","parentNode","removeChild","_updateMaxFilesReachedClass","thumbnail","dataUrl","thumbnailElement","alt","src","setTimeout","error","message","errormultiple","processing","processingmultiple","uploadprogress","progress","bytesSent","nodeName","style","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","emit","canceledmultiple","complete","completemultiple","maxfilesexceeded","maxfilesreached","queuecomplete","addedfiles","emptyfolder","Emitter1","superClass","Dropzone","el","derived","clickableElements","listeners","querySelector","HTMLElement","dropzone","instances","left","elementOptions","optionsForElement","assign","replace","isBrowserSupported","getAttribute","toUpperCase","getExistingFallback","getElement","getElements","subClass","create","filter","accepted","map","getFilesWithStatus","QUEUED","ADDED","tagName","setAttribute","contains","setupHiddenFileInput","_this_hiddenFileInput_parentNode","hiddenFileInput","id","visibility","position","top","addFile","URL","webkitURL","events","on","updateTotalUploadProgress","getAddedFiles","getUploadingFiles","getQueuedFiles","noPropagation","dataTransfer","types","includes","efct","effectAllowed","dropEffect","forEach","clickableElement","click","elementInside","enable","disable","removeAllFiles","indexOf","totalBytesSent","totalBytes","activeFiles","getActiveFiles","totalUploadProgress","total","n","source","cleanFile","ownKeys","keys","getOwnPropertySymbols","sym","getOwnPropertyDescriptor","getOwnPropertyDescriptors","defineProperties","$9196d606ce819a5b$var$ownKeys","object","enumerableOnly","symbols","existingFallback","form","fieldsString","_getParamName","fields","_i","_iter","getFallback","elements","elementListeners","listener","removeEventListener","removeEventListeners","disabled","cancelUpload","setupEventListeners","selectedSize","selectedUnit","units","unit","pow","round","getAcceptedFiles","items","webkitGetAsEntry","_addFilesFromItems","handleFiles","transform","$0b112e5f3be94b9d$var$__guard__","clipboardData","x","entry","item","isFile","getAsFile","isDirectory","_addFilesFromDirectory","kind","directory","path","dirReader","createReader","errorHandler","methodName","console","log","entryCount","readEntries","entries","substring","fullPath","isValidFile","isSecureContext","crypto","randomUUID","uuidv4","filename","_renameFile","_enqueueThumbnail","_errorProcessing","enqueueFile","processQueue","_thumbnailQueue","_processThumbnailQueue","_processingThumbnail","shift","createThumbnail","$0b112e5f3be94b9d$var$without","cancelIfNecessary","slice","canvas","resizedDataURL","toDataURL","$0b112e5f3be94b9d$var$restoreExif","origFileBase64","resizedFileBase64","marker","startsWith","origFile","atob","head","exifData","charCodeAt","endPoint","segment","resizedFile","splitPoint","btoa","dataURL","dataURItoBlob","fixOrientation","ignoreExif","fileReader","FileReader","onload","createThumbnailFromUrl","readAsDataURL","mockFile","imageUrl","crossOrigin","resizeThumbnail","img","getComputedStyle","body","loadExif","EXIF","getData","getTag","orientation","resizeInfo","ctx","getContext","translate","scale","rotate","PI","$0b112e5f3be94b9d$var$drawImageIOSFix","trgX","trgY","onerror","$0b112e5f3be94b9d$var$removeExif","filteredFile","processingLength","queuedFiles","processFiles","processFile","uploadFiles","groupedFiles","_getFilesWithXhr","groupedFile","CANCELED","abort","groupedFile1","option","_transformFiles","transformedFiles","transformedFile","chunked","ceil","transformedFile1","chunks","handleNextChunk","chunkIndex","start","end","dataBlock","data","webkitSlice","retries","_uploadData","finishedChunkUpload","response","allFinished","SUCCESS","responseText","responseHeaders","getAllResponseHeaders","_finished","parallelCount","dataBlocks","i1","XMLHttpRequest","resolveOption","open","_finishedUploading","ontimeout","_handleUploadError","progressObj","onprogress","_updateFilesUploadProgress","Accept","headerName","headerValue","setRequestHeader","file1","submitRequest","formData","FormData","additionalParams","_getChunk","isArray","append","file2","_addFormElementData","_loop","doneCounter","input","inputName","inputType","toLowerCase","hasAttribute","selected","checked","loaded","readyState","responseType","getResponseHeader","JSON","parse","warn","send","ERROR","c","getRandomValues","Uint8Array","toString","initClass","$0b112e5f3be94b9d$var$camelize","forElement","discover","dropzones","checkElements","Promise","dataURI","byteString","split","mimeString","ab","ArrayBuffer","ia","asc","Blob","list","rejectedItem","str","charAt","string","div","childNodes","container","nodeType","els","question","rejected","mimeType","baseMimeType","validType","jQuery","each","ACCEPTED","PROCESSING","$0b112e5f3be94b9d$var$detectVerticalSquash","ih","naturalHeight","drawImage","getImageData","sy","ey","py","alpha","ratio","sx","sw","sh","dx","dy","dw","dh","vertSquashRatio"],"version":3,"file":"dropzone-min.js.map"} \ No newline at end of file diff --git a/static/vendors/dropzone/dropzone.css b/static/vendors/dropzone/dropzone.css new file mode 100644 index 0000000..a9385ac --- /dev/null +++ b/static/vendors/dropzone/dropzone.css @@ -0,0 +1 @@ +@keyframes passing-through{0%{opacity:0;transform:translateY(40px)}30%,70%{opacity:1;transform:translateY(0px)}100%{opacity:0;transform:translateY(-40px)}}@keyframes slide-in{0%{opacity:0;transform:translateY(40px)}30%{opacity:1;transform:translateY(0px)}}@keyframes pulse{0%{transform:scale(1)}10%{transform:scale(1.1)}20%{transform:scale(1)}}.dropzone,.dropzone *{box-sizing:border-box}.dropzone{min-height:150px;border:1px solid rgba(0,0,0,.8);border-radius:5px;padding:20px 20px}.dropzone.dz-clickable{cursor:pointer}.dropzone.dz-clickable *{cursor:default}.dropzone.dz-clickable .dz-message,.dropzone.dz-clickable .dz-message *{cursor:pointer}.dropzone.dz-started .dz-message{display:none}.dropzone.dz-drag-hover{border-style:solid}.dropzone.dz-drag-hover .dz-message{opacity:.5}.dropzone .dz-message{text-align:center;margin:3em 0}.dropzone .dz-message .dz-button{background:none;color:inherit;border:none;padding:0;font:inherit;cursor:pointer;outline:inherit}.dropzone .dz-preview{position:relative;display:inline-block;vertical-align:top;margin:16px;min-height:100px}.dropzone .dz-preview:hover{z-index:1000}.dropzone .dz-preview:hover .dz-details{opacity:1}.dropzone .dz-preview.dz-file-preview .dz-image{border-radius:20px;background:#999;background:linear-gradient(to bottom, #eee, #ddd)}.dropzone .dz-preview.dz-file-preview .dz-details{opacity:1}.dropzone .dz-preview.dz-image-preview{background:#fff}.dropzone .dz-preview.dz-image-preview .dz-details{transition:opacity .2s linear}.dropzone .dz-preview .dz-remove{font-size:14px;text-align:center;display:block;cursor:pointer;border:none}.dropzone .dz-preview .dz-remove:hover{text-decoration:underline}.dropzone .dz-preview:hover .dz-details{opacity:1}.dropzone .dz-preview .dz-details{z-index:20;position:absolute;top:0;left:0;opacity:0;font-size:13px;min-width:100%;max-width:100%;padding:2em 1em;text-align:center;color:rgba(0,0,0,.9);line-height:150%}.dropzone .dz-preview .dz-details .dz-size{margin-bottom:1em;font-size:16px}.dropzone .dz-preview .dz-details .dz-filename{white-space:nowrap}.dropzone .dz-preview .dz-details .dz-filename:hover span{border:1px solid rgba(200,200,200,.8);background-color:hsla(0,0%,100%,.8)}.dropzone .dz-preview .dz-details .dz-filename:not(:hover){overflow:hidden;text-overflow:ellipsis}.dropzone .dz-preview .dz-details .dz-filename:not(:hover) span{border:1px solid rgba(0,0,0,0)}.dropzone .dz-preview .dz-details .dz-filename span,.dropzone .dz-preview .dz-details .dz-size span{background-color:hsla(0,0%,100%,.4);padding:0 .4em;border-radius:3px}.dropzone .dz-preview:hover .dz-image img{transform:scale(1.05, 1.05);filter:blur(8px)}.dropzone .dz-preview .dz-image{border-radius:20px;overflow:hidden;width:120px;height:120px;position:relative;display:block;z-index:10}.dropzone .dz-preview .dz-image img{display:block}.dropzone .dz-preview.dz-success .dz-success-mark{animation:passing-through 3s cubic-bezier(0.77, 0, 0.175, 1)}.dropzone .dz-preview.dz-error .dz-error-mark{opacity:1;animation:slide-in 3s cubic-bezier(0.77, 0, 0.175, 1)}.dropzone .dz-preview .dz-success-mark,.dropzone .dz-preview .dz-error-mark{pointer-events:none;opacity:0;z-index:500;position:absolute;display:block;top:50%;left:50%;margin-left:-27px;margin-top:-27px;background:rgba(0,0,0,.8);border-radius:50%}.dropzone .dz-preview .dz-success-mark svg,.dropzone .dz-preview .dz-error-mark svg{display:block;width:54px;height:54px;fill:#fff}.dropzone .dz-preview.dz-processing .dz-progress{opacity:1;transition:all .2s linear}.dropzone .dz-preview.dz-complete .dz-progress{opacity:0;transition:opacity .4s ease-in}.dropzone .dz-preview:not(.dz-processing) .dz-progress{animation:pulse 6s ease infinite}.dropzone .dz-preview .dz-progress{opacity:1;z-index:1000;pointer-events:none;position:absolute;height:20px;top:50%;margin-top:-10px;left:15%;right:15%;border:3px solid rgba(0,0,0,.8);background:rgba(0,0,0,.8);border-radius:10px;overflow:hidden}.dropzone .dz-preview .dz-progress .dz-upload{background:#fff;display:block;position:relative;height:100%;width:0;transition:width 300ms ease-in-out;border-radius:17px}.dropzone .dz-preview.dz-error .dz-error-message{display:block}.dropzone .dz-preview.dz-error:hover .dz-error-message{opacity:1;pointer-events:auto}.dropzone .dz-preview .dz-error-message{pointer-events:none;z-index:1000;position:absolute;display:block;display:none;opacity:0;transition:opacity .3s ease;border-radius:8px;font-size:13px;top:130px;left:-10px;width:140px;background:#b10606;padding:.5em 1em;color:#fff}.dropzone .dz-preview .dz-error-message:after{content:"";position:absolute;top:-6px;left:64px;width:0;height:0;border-left:6px solid rgba(0,0,0,0);border-right:6px solid rgba(0,0,0,0);border-bottom:6px solid #b10606}/*# sourceMappingURL=dropzone.css.map */ diff --git a/static/vendors/htmx/htmx.min.js b/static/vendors/htmx/htmx.min.js new file mode 100644 index 0000000..faafa3e --- /dev/null +++ b/static/vendors/htmx/htmx.min.js @@ -0,0 +1 @@ +var htmx=function(){"use strict";const Q={onLoad:null,process:null,on:null,off:null,trigger:null,ajax:null,find:null,findAll:null,closest:null,values:function(e,t){const n=dn(e,t||"post");return n.values},remove:null,addClass:null,removeClass:null,toggleClass:null,takeClass:null,swap:null,defineExtension:null,removeExtension:null,logAll:null,logNone:null,logger:null,config:{historyEnabled:true,historyCacheSize:10,refreshOnHistoryMiss:false,defaultSwapStyle:"innerHTML",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:true,indicatorClass:"htmx-indicator",requestClass:"htmx-request",addedClass:"htmx-added",settlingClass:"htmx-settling",swappingClass:"htmx-swapping",allowEval:true,allowScriptTags:true,inlineScriptNonce:"",inlineStyleNonce:"",attributesToSettle:["class","style","width","height"],withCredentials:false,timeout:0,wsReconnectDelay:"full-jitter",wsBinaryType:"blob",disableSelector:"[hx-disable], [data-hx-disable]",scrollBehavior:"instant",defaultFocusScroll:false,getCacheBusterParam:false,globalViewTransitions:false,methodsThatUseUrlParams:["get","delete"],selfRequestsOnly:true,ignoreTitle:false,scrollIntoViewOnBoost:true,triggerSpecsCache:null,disableInheritance:false,responseHandling:[{code:"204",swap:false},{code:"[23]..",swap:true},{code:"[45]..",swap:false,error:true}],allowNestedOobSwaps:true,historyRestoreAsHxRequest:true,reportValidityOfForms:false},parseInterval:null,location:location,_:null,version:"2.0.8"};Q.onLoad=V;Q.process=Ft;Q.on=xe;Q.off=be;Q.trigger=ae;Q.ajax=Ln;Q.find=f;Q.findAll=x;Q.closest=g;Q.remove=_;Q.addClass=K;Q.removeClass=G;Q.toggleClass=W;Q.takeClass=Z;Q.swap=ze;Q.defineExtension=_n;Q.removeExtension=zn;Q.logAll=j;Q.logNone=$;Q.parseInterval=d;Q._=e;const n={addTriggerHandler:St,bodyContains:se,canAccessLocalStorage:X,findThisElement:Se,filterValues:yn,swap:ze,hasAttribute:s,getAttributeValue:a,getClosestAttributeValue:ne,getClosestMatch:q,getExpressionVars:Rn,getHeaders:mn,getInputValues:dn,getInternalData:oe,getSwapSpecification:bn,getTriggerSpecs:st,getTarget:Ee,makeFragment:D,mergeObjects:le,makeSettleInfo:Sn,oobSwap:Te,querySelectorExt:ue,settleImmediately:Yt,shouldCancel:ht,triggerEvent:ae,triggerErrorEvent:fe,withExtensions:Vt};const de=["get","post","put","delete","patch"];const R=de.map(function(e){return"[hx-"+e+"], [data-hx-"+e+"]"}).join(", ");function d(e){if(e==undefined){return undefined}let t=NaN;if(e.slice(-2)=="ms"){t=parseFloat(e.slice(0,-2))}else if(e.slice(-1)=="s"){t=parseFloat(e.slice(0,-1))*1e3}else if(e.slice(-1)=="m"){t=parseFloat(e.slice(0,-1))*1e3*60}else{t=parseFloat(e)}return isNaN(t)?undefined:t}function ee(e,t){return e instanceof Element&&e.getAttribute(t)}function s(e,t){return!!e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute("data-"+t))}function a(e,t){return ee(e,t)||ee(e,"data-"+t)}function u(e){const t=e.parentElement;if(!t&&e.parentNode instanceof ShadowRoot)return e.parentNode;return t}function te(){return document}function y(e,t){return e.getRootNode?e.getRootNode({composed:t}):te()}function q(e,t){while(e&&!t(e)){e=u(e)}return e||null}function o(e,t,n){const r=a(t,n);const o=a(t,"hx-disinherit");var i=a(t,"hx-inherit");if(e!==t){if(Q.config.disableInheritance){if(i&&(i==="*"||i.split(" ").indexOf(n)>=0)){return r}else{return null}}if(o&&(o==="*"||o.split(" ").indexOf(n)>=0)){return"unset"}}return r}function ne(t,n){let r=null;q(t,function(e){return!!(r=o(t,ce(e),n))});if(r!=="unset"){return r}}function h(e,t){return e instanceof Element&&e.matches(t)}function A(e){const t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;const n=t.exec(e);if(n){return n[1].toLowerCase()}else{return""}}function L(e){if("parseHTMLUnsafe"in Document){return Document.parseHTMLUnsafe(e)}const t=new DOMParser;return t.parseFromString(e,"text/html")}function N(e,t){while(t.childNodes.length>0){e.append(t.childNodes[0])}}function r(e){const t=te().createElement("script");ie(e.attributes,function(e){t.setAttribute(e.name,e.value)});t.textContent=e.textContent;t.async=false;if(Q.config.inlineScriptNonce){t.nonce=Q.config.inlineScriptNonce}return t}function i(e){return e.matches("script")&&(e.type==="text/javascript"||e.type==="module"||e.type==="")}function I(e){Array.from(e.querySelectorAll("script")).forEach(e=>{if(i(e)){const t=r(e);const n=e.parentNode;try{n.insertBefore(t,e)}catch(e){H(e)}finally{e.remove()}}})}function D(e){const t=e.replace(/]*)?>[\s\S]*?<\/head>/i,"");const n=A(t);let r;if(n==="html"){r=new DocumentFragment;const i=L(e);N(r,i.body);r.title=i.title}else if(n==="body"){r=new DocumentFragment;const i=L(t);N(r,i.body);r.title=i.title}else{const i=L('");r=i.querySelector("template").content;r.title=i.title;var o=r.querySelector("title");if(o&&o.parentNode===r){o.remove();r.title=o.innerText}}if(r){if(Q.config.allowScriptTags){I(r)}else{r.querySelectorAll("script").forEach(e=>e.remove())}}return r}function re(e){if(e){e()}}function t(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function P(e){return typeof e==="function"}function k(e){return t(e,"Object")}function oe(e){const t="htmx-internal-data";let n=e[t];if(!n){n=e[t]={}}return n}function M(t){const n=[];if(t){for(let e=0;e=0}function se(e){return e.getRootNode({composed:true})===document}function B(e){return e.trim().split(/\s+/)}function le(e,t){for(const n in t){if(t.hasOwnProperty(n)){e[n]=t[n]}}return e}function v(e){try{return JSON.parse(e)}catch(e){H(e);return null}}function X(){const e="htmx:sessionStorageTest";try{sessionStorage.setItem(e,e);sessionStorage.removeItem(e);return true}catch(e){return false}}function U(e){const t=new URL(e,"http://x");if(t){e=t.pathname+t.search}if(e!="/"){e=e.replace(/\/+$/,"")}return e}function e(e){return On(te().body,function(){return eval(e)})}function V(t){const e=Q.on("htmx:load",function(e){t(e.detail.elt)});return e}function j(){Q.logger=function(e,t,n){if(console){console.log(t,e,n)}}}function $(){Q.logger=null}function f(e,t){if(typeof e!=="string"){return e.querySelector(t)}else{return f(te(),e)}}function x(e,t){if(typeof e!=="string"){return e.querySelectorAll(t)}else{return x(te(),e)}}function b(){return window}function _(e,t){e=w(e);if(t){b().setTimeout(function(){_(e);e=null},t)}else{u(e).removeChild(e)}}function ce(e){return e instanceof Element?e:null}function z(e){return e instanceof HTMLElement?e:null}function J(e){return typeof e==="string"?e:null}function p(e){return e instanceof Element||e instanceof Document||e instanceof DocumentFragment?e:null}function K(e,t,n){e=ce(w(e));if(!e){return}if(n){b().setTimeout(function(){K(e,t);e=null},n)}else{e.classList&&e.classList.add(t)}}function G(e,t,n){let r=ce(w(e));if(!r){return}if(n){b().setTimeout(function(){G(r,t);r=null},n)}else{if(r.classList){r.classList.remove(t);if(r.classList.length===0){r.removeAttribute("class")}}}}function W(e,t){e=w(e);e.classList.toggle(t)}function Z(e,t){e=w(e);ie(e.parentElement.children,function(e){G(e,t)});K(ce(e),t)}function g(e,t){e=ce(w(e));if(e){return e.closest(t)}return null}function l(e,t){return e.substring(0,t.length)===t}function Y(e,t){return e.substring(e.length-t.length)===t}function pe(e){const t=e.trim();if(l(t,"<")&&Y(t,"/>")){return t.substring(1,t.length-2)}else{return t}}function m(t,r,n){if(r.indexOf("global ")===0){return m(t,r.slice(7),true)}t=w(t);const o=[];{let t=0;let n=0;for(let e=0;e"){t--}}if(n0){const r=pe(o.shift());let e;if(r.indexOf("closest ")===0){e=g(ce(t),pe(r.slice(8)))}else if(r.indexOf("find ")===0){e=f(p(t),pe(r.slice(5)))}else if(r==="next"||r==="nextElementSibling"){e=ce(t).nextElementSibling}else if(r.indexOf("next ")===0){e=ge(t,pe(r.slice(5)),!!n)}else if(r==="previous"||r==="previousElementSibling"){e=ce(t).previousElementSibling}else if(r.indexOf("previous ")===0){e=me(t,pe(r.slice(9)),!!n)}else if(r==="document"){e=document}else if(r==="window"){e=window}else if(r==="body"){e=document.body}else if(r==="root"){e=y(t,!!n)}else if(r==="host"){e=t.getRootNode().host}else{s.push(r)}if(e){i.push(e)}}if(s.length>0){const e=s.join(",");const c=p(y(t,!!n));i.push(...M(c.querySelectorAll(e)))}return i}var ge=function(t,e,n){const r=p(y(t,n)).querySelectorAll(e);for(let e=0;e=0;e--){const o=r[e];if(o.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_FOLLOWING){return o}}};function ue(e,t){if(typeof e!=="string"){return m(e,t)[0]}else{return m(te().body,e)[0]}}function w(e,t){if(typeof e==="string"){return f(p(t)||document,e)}else{return e}}function ye(e,t,n,r){if(P(t)){return{target:te().body,event:J(e),listener:t,options:n}}else{return{target:w(e),event:J(t),listener:n,options:r}}}function xe(t,n,r,o){Gn(function(){const e=ye(t,n,r,o);e.target.addEventListener(e.event,e.listener,e.options)});const e=P(n);return e?n:r}function be(t,n,r){Gn(function(){const e=ye(t,n,r);e.target.removeEventListener(e.event,e.listener)});return P(n)?n:r}const ve=te().createElement("output");function we(t,n){const e=ne(t,n);if(e){if(e==="this"){return[Se(t,n)]}else{const r=m(t,e);const o=/(^|,)(\s*)inherit(\s*)($|,)/.test(e);if(o){const i=ce(q(t,function(e){return e!==t&&s(ce(e),n)}));if(i){r.push(...we(i,n))}}if(r.length===0){H('The selector "'+e+'" on '+n+" returned no matches!");return[ve]}else{return r}}}}function Se(e,t){return ce(q(e,function(e){return a(ce(e),t)!=null}))}function Ee(e){const t=ne(e,"hx-target");if(t){if(t==="this"){return Se(e,"hx-target")}else{return ue(e,t)}}else{const n=oe(e);if(n.boosted){return te().body}else{return e}}}function Ce(e){return Q.config.attributesToSettle.includes(e)}function Oe(t,n){ie(Array.from(t.attributes),function(e){if(!n.hasAttribute(e.name)&&Ce(e.name)){t.removeAttribute(e.name)}});ie(n.attributes,function(e){if(Ce(e.name)){t.setAttribute(e.name,e.value)}})}function He(t,e){const n=Jn(e);for(let e=0;e0){s=e.substring(0,e.indexOf(":"));n=e.substring(e.indexOf(":")+1)}else{s=e}o.removeAttribute("hx-swap-oob");o.removeAttribute("data-hx-swap-oob");const r=m(t,n,false);if(r.length){ie(r,function(e){let t;const n=o.cloneNode(true);t=te().createDocumentFragment();t.appendChild(n);if(!He(s,e)){t=p(n)}const r={shouldSwap:true,target:e,fragment:t};if(!ae(e,"htmx:oobBeforeSwap",r))return;e=r.target;if(r.shouldSwap){qe(t);$e(s,e,e,t,i);Re()}ie(i.elts,function(e){ae(e,"htmx:oobAfterSwap",r)})});o.parentNode.removeChild(o)}else{o.parentNode.removeChild(o);fe(te().body,"htmx:oobErrorNoTarget",{content:o})}return e}function Re(){const e=f("#--htmx-preserve-pantry--");if(e){for(const t of[...e.children]){const n=f("#"+t.id);n.parentNode.moveBefore(t,n);n.remove()}e.remove()}}function qe(e){ie(x(e,"[hx-preserve], [data-hx-preserve]"),function(e){const t=a(e,"id");const n=te().getElementById(t);if(n!=null){if(e.moveBefore){let e=f("#--htmx-preserve-pantry--");if(e==null){te().body.insertAdjacentHTML("afterend","
");e=f("#--htmx-preserve-pantry--")}e.moveBefore(n,null)}else{e.parentNode.replaceChild(n,e)}}})}function Ae(l,e,c){ie(e.querySelectorAll("[id]"),function(t){const n=ee(t,"id");if(n&&n.length>0){const r=n.replace("'","\\'");const o=t.tagName.replace(":","\\:");const e=p(l);const i=e&&e.querySelector(o+"[id='"+r+"']");if(i&&i!==e){const s=t.cloneNode();Oe(t,i);c.tasks.push(function(){Oe(t,s)})}}})}function Le(e){return function(){G(e,Q.config.addedClass);Ft(ce(e));Ne(p(e));ae(e,"htmx:load")}}function Ne(e){const t="[autofocus]";const n=z(h(e,t)?e:e.querySelector(t));if(n!=null){n.focus()}}function c(e,t,n,r){Ae(e,n,r);while(n.childNodes.length>0){const o=n.firstChild;K(ce(o),Q.config.addedClass);e.insertBefore(o,t);if(o.nodeType!==Node.TEXT_NODE&&o.nodeType!==Node.COMMENT_NODE){r.tasks.push(Le(o))}}}function Ie(e,t){let n=0;while(n0}function ze(h,d,p,g){if(!g){g={}}let m=null;let n=null;let e=function(){re(g.beforeSwapCallback);h=w(h);const r=g.contextElement?y(g.contextElement,false):te();const e=document.activeElement;let t={};t={elt:e,start:e?e.selectionStart:null,end:e?e.selectionEnd:null};const o=Sn(h);if(p.swapStyle==="textContent"){h.textContent=d}else{let n=D(d);o.title=g.title||n.title;if(g.historyRequest){n=n.querySelector("[hx-history-elt],[data-hx-history-elt]")||n}if(g.selectOOB){const i=g.selectOOB.split(",");for(let t=0;t0){b().setTimeout(n,p.settleDelay)}else{n()}};let t=Q.config.globalViewTransitions;if(p.hasOwnProperty("transition")){t=p.transition}const r=g.contextElement||te();if(t&&ae(r,"htmx:beforeTransition",g.eventInfo)&&typeof Promise!=="undefined"&&document.startViewTransition){const o=new Promise(function(e,t){m=e;n=t});const i=e;e=function(){document.startViewTransition(function(){i();return o})}}try{if(p?.swapDelay&&p.swapDelay>0){b().setTimeout(e,p.swapDelay)}else{e()}}catch(e){fe(r,"htmx:swapError",g.eventInfo);re(n);throw e}}function Je(e,t,n){const r=e.getResponseHeader(t);if(r.indexOf("{")===0){const o=v(r);for(const i in o){if(o.hasOwnProperty(i)){let e=o[i];if(k(e)){n=e.target!==undefined?e.target:n}else{e={value:e}}ae(n,i,e)}}}else{const s=r.split(",");for(let e=0;e0){const s=o[0];if(s==="]"){e--;if(e===0){if(n===null){t=t+"true"}o.shift();t+=")})";try{const l=On(r,function(){return Function(t)()},function(){return true});l.source=t;return l}catch(e){fe(te().body,"htmx:syntax:error",{error:e,source:t});return null}}}else if(s==="["){e++}if(tt(s,n,i)){t+="(("+i+"."+s+") ? ("+i+"."+s+") : (window."+s+"))"}else{t=t+s}n=o.shift()}}}function O(e,t){let n="";while(e.length>0&&!t.test(e[0])){n+=e.shift()}return n}function rt(e){let t;if(e.length>0&&Ye.test(e[0])){e.shift();t=O(e,Qe).trim();e.shift()}else{t=O(e,E)}return t}const ot="input, textarea, select";function it(e,t,n){const r=[];const o=et(t);do{O(o,C);const l=o.length;const c=O(o,/[,\[\s]/);if(c!==""){if(c==="every"){const u={trigger:"every"};O(o,C);u.pollInterval=d(O(o,/[,\[\s]/));O(o,C);var i=nt(e,o,"event");if(i){u.eventFilter=i}r.push(u)}else{const f={trigger:c};var i=nt(e,o,"event");if(i){f.eventFilter=i}O(o,C);while(o.length>0&&o[0]!==","){const a=o.shift();if(a==="changed"){f.changed=true}else if(a==="once"){f.once=true}else if(a==="consume"){f.consume=true}else if(a==="delay"&&o[0]===":"){o.shift();f.delay=d(O(o,E))}else if(a==="from"&&o[0]===":"){o.shift();if(Ye.test(o[0])){var s=rt(o)}else{var s=O(o,E);if(s==="closest"||s==="find"||s==="next"||s==="previous"){o.shift();const h=rt(o);if(h.length>0){s+=" "+h}}}f.from=s}else if(a==="target"&&o[0]===":"){o.shift();f.target=rt(o)}else if(a==="throttle"&&o[0]===":"){o.shift();f.throttle=d(O(o,E))}else if(a==="queue"&&o[0]===":"){o.shift();f.queue=O(o,E)}else if(a==="root"&&o[0]===":"){o.shift();f[a]=rt(o)}else if(a==="threshold"&&o[0]===":"){o.shift();f[a]=O(o,E)}else{fe(e,"htmx:syntax:error",{token:o.shift()})}O(o,C)}r.push(f)}}if(o.length===l){fe(e,"htmx:syntax:error",{token:o.shift()})}O(o,C)}while(o[0]===","&&o.shift());if(n){n[t]=r}return r}function st(e){const t=a(e,"hx-trigger");let n=[];if(t){const r=Q.config.triggerSpecsCache;n=r&&r[t]||it(e,t,r)}if(n.length>0){return n}else if(h(e,"form")){return[{trigger:"submit"}]}else if(h(e,'input[type="button"], input[type="submit"]')){return[{trigger:"click"}]}else if(h(e,ot)){return[{trigger:"change"}]}else{return[{trigger:"click"}]}}function lt(e){oe(e).cancelled=true}function ct(e,t,n){const r=oe(e);r.timeout=b().setTimeout(function(){if(se(e)&&r.cancelled!==true){if(!pt(n,e,Xt("hx:poll:trigger",{triggerSpec:n,target:e}))){t(e)}ct(e,t,n)}},n.pollInterval)}function ut(e){return location.hostname===e.hostname&&ee(e,"href")&&ee(e,"href").indexOf("#")!==0}function ft(e){return g(e,Q.config.disableSelector)}function at(t,n,e){if(t instanceof HTMLAnchorElement&&ut(t)&&(t.target===""||t.target==="_self")||t.tagName==="FORM"&&String(ee(t,"method")).toLowerCase()!=="dialog"){n.boosted=true;let r,o;if(t.tagName==="A"){r="get";o=ee(t,"href")}else{const i=ee(t,"method");r=i?i.toLowerCase():"get";o=ee(t,"action");if(o==null||o===""){o=location.href}if(r==="get"&&o.includes("?")){o=o.replace(/\?[^#]+/,"")}}e.forEach(function(e){gt(t,function(e,t){const n=ce(e);if(ft(n)){S(n);return}he(r,o,n,t)},n,e,true)})}}function ht(e,t){if(e.type==="submit"&&t.tagName==="FORM"){return true}else if(e.type==="click"){const n=t.closest('input[type="submit"], button');if(n&&n.form&&n.type==="submit"){return true}const r=t.closest("a");const o=/^#.+/;if(r&&r.href&&!o.test(r.getAttribute("href"))){return true}}return false}function dt(e,t){return oe(e).boosted&&e instanceof HTMLAnchorElement&&t.type==="click"&&(t.ctrlKey||t.metaKey)}function pt(e,t,n){const r=e.eventFilter;if(r){try{return r.call(t,n)!==true}catch(e){const o=r.source;fe(te().body,"htmx:eventFilter:error",{error:e,source:o});return true}}return false}function gt(l,c,e,u,f){const a=oe(l);let t;if(u.from){t=m(l,u.from)}else{t=[l]}if(u.changed){if(!("lastValue"in a)){a.lastValue=new WeakMap}t.forEach(function(e){if(!a.lastValue.has(u)){a.lastValue.set(u,new WeakMap)}a.lastValue.get(u).set(e,e.value)})}ie(t,function(i){const s=function(e){if(!se(l)){i.removeEventListener(u.trigger,s);return}if(dt(l,e)){return}if(f||ht(e,i)){e.preventDefault()}if(pt(u,l,e)){return}const t=oe(e);t.triggerSpec=u;if(t.handledFor==null){t.handledFor=[]}if(t.handledFor.indexOf(l)<0){t.handledFor.push(l);if(u.consume){e.stopPropagation()}if(u.target&&e.target){if(!h(ce(e.target),u.target)){return}}if(u.once){if(a.triggeredOnce){return}else{a.triggeredOnce=true}}if(u.changed){const n=e.target;const r=n.value;const o=a.lastValue.get(u);if(o.has(n)&&o.get(n)===r){return}o.set(n,r)}if(a.delayed){clearTimeout(a.delayed)}if(a.throttle){return}if(u.throttle>0){if(!a.throttle){ae(l,"htmx:trigger");c(l,e);a.throttle=b().setTimeout(function(){a.throttle=null},u.throttle)}}else if(u.delay>0){a.delayed=b().setTimeout(function(){ae(l,"htmx:trigger");c(l,e)},u.delay)}else{ae(l,"htmx:trigger");c(l,e)}}};if(e.listenerInfos==null){e.listenerInfos=[]}e.listenerInfos.push({trigger:u.trigger,listener:s,on:i});i.addEventListener(u.trigger,s)})}let mt=false;let yt=null;function xt(){if(!yt){yt=function(){mt=true};window.addEventListener("scroll",yt);window.addEventListener("resize",yt);setInterval(function(){if(mt){mt=false;ie(te().querySelectorAll("[hx-trigger*='revealed'],[data-hx-trigger*='revealed']"),function(e){bt(e)})}},200)}}function bt(e){if(!s(e,"data-hx-revealed")&&F(e)){e.setAttribute("data-hx-revealed","true");const t=oe(e);if(t.initHash){ae(e,"revealed")}else{e.addEventListener("htmx:afterProcessNode",function(){ae(e,"revealed")},{once:true})}}}function vt(e,t,n,r){const o=function(){if(!n.loaded){n.loaded=true;ae(e,"htmx:trigger");t(e)}};if(r>0){b().setTimeout(o,r)}else{o()}}function wt(t,n,e){let i=false;ie(de,function(r){if(s(t,"hx-"+r)){const o=a(t,"hx-"+r);i=true;n.path=o;n.verb=r;e.forEach(function(e){St(t,e,n,function(e,t){const n=ce(e);if(ft(n)){S(n);return}he(r,o,n,t)})})}});return i}function St(r,e,t,n){if(e.trigger==="revealed"){xt();gt(r,n,t,e);bt(ce(r))}else if(e.trigger==="intersect"){const o={};if(e.root){o.root=ue(r,e.root)}if(e.threshold){o.threshold=parseFloat(e.threshold)}const i=new IntersectionObserver(function(t){for(let e=0;e0){t.polling=true;ct(ce(r),n,e)}else{gt(r,n,t,e)}}function Et(e){const t=ce(e);if(!t){return false}const n=t.attributes;for(let e=0;e", "+e).join(""));return o}else{return[]}}function Rt(e){const t=At(e.target);const n=Nt(e);if(n){n.lastButtonClicked=t}}function qt(e){const t=Nt(e);if(t){t.lastButtonClicked=null}}function At(e){return g(ce(e),"button, input[type='submit']")}function Lt(e){return e.form||g(e,"form")}function Nt(e){const t=At(e.target);if(!t){return}const n=Lt(t);if(!n){return}return oe(n)}function It(e){e.addEventListener("click",Rt);e.addEventListener("focusin",Rt);e.addEventListener("focusout",qt)}function Dt(t,e,n){const r=oe(t);if(!Array.isArray(r.onHandlers)){r.onHandlers=[]}let o;const i=function(e){On(t,function(){if(ft(t)){return}if(!o){o=new Function("event",n)}o.call(t,e)})};t.addEventListener(e,i);r.onHandlers.push({event:e,listener:i})}function Pt(t){Pe(t);for(let e=0;eQ.config.historyCacheSize){i.shift()}while(i.length>0){try{sessionStorage.setItem("htmx-history-cache",JSON.stringify(i));break}catch(e){fe(te().body,"htmx:historyCacheError",{cause:e,cache:i});i.shift()}}}function Jt(t){if(!X()){return null}t=U(t);const n=v(sessionStorage.getItem("htmx-history-cache"))||[];for(let e=0;e=200&&this.status<400){r.response=this.response;ae(te().body,"htmx:historyCacheMissLoad",r);ze(r.historyElt,r.response,n,{contextElement:r.historyElt,historyRequest:true});$t(r.path);ae(te().body,"htmx:historyRestore",{path:e,cacheMiss:true,serverResponse:r.response})}else{fe(te().body,"htmx:historyCacheMissLoadError",r)}};if(ae(te().body,"htmx:historyCacheMiss",r)){t.send()}}function en(e){Gt();e=e||location.pathname+location.search;const t=Jt(e);if(t){const n={swapStyle:"innerHTML",swapDelay:0,settleDelay:0,scroll:t.scroll};const r={path:e,item:t,historyElt:_t(),swapSpec:n};if(ae(te().body,"htmx:historyCacheHit",r)){ze(r.historyElt,t.content,n,{contextElement:r.historyElt,title:t.title});$t(r.path);ae(te().body,"htmx:historyRestore",r)}}else{if(Q.config.refreshOnHistoryMiss){Q.location.reload(true)}else{Qt(e)}}}function tn(e){let t=we(e,"hx-indicator");if(t==null){t=[e]}ie(t,function(e){const t=oe(e);t.requestCount=(t.requestCount||0)+1;e.classList.add.call(e.classList,Q.config.requestClass)});return t}function nn(e){let t=we(e,"hx-disabled-elt");if(t==null){t=[]}ie(t,function(e){const t=oe(e);t.requestCount=(t.requestCount||0)+1;e.setAttribute("disabled","");e.setAttribute("data-disabled-by-htmx","")});return t}function rn(e,t){ie(e.concat(t),function(e){const t=oe(e);t.requestCount=(t.requestCount||1)-1});ie(e,function(e){const t=oe(e);if(t.requestCount===0){e.classList.remove.call(e.classList,Q.config.requestClass)}});ie(t,function(e){const t=oe(e);if(t.requestCount===0){e.removeAttribute("disabled");e.removeAttribute("data-disabled-by-htmx")}})}function on(t,n){for(let e=0;en.indexOf(e)<0)}else{e=e.filter(e=>e!==n)}r.delete(t);ie(e,e=>r.append(t,e))}}function un(e){if(e instanceof HTMLSelectElement&&e.multiple){return M(e.querySelectorAll("option:checked")).map(function(e){return e.value})}if(e instanceof HTMLInputElement&&e.files){return M(e.files)}return e.value}function fn(t,n,r,e,o){if(e==null||on(t,e)){return}else{t.push(e)}if(sn(e)){const i=ee(e,"name");ln(i,un(e),n);if(o){an(e,r)}}if(e instanceof HTMLFormElement){ie(e.elements,function(e){if(t.indexOf(e)>=0){cn(e.name,un(e),n)}else{t.push(e)}if(o){an(e,r)}});new FormData(e).forEach(function(e,t){if(e instanceof File&&e.name===""){return}ln(t,e,n)})}}function an(e,t){const n=e;if(n.willValidate){ae(n,"htmx:validation:validate");if(!n.checkValidity()){if(ae(n,"htmx:validation:failed",{message:n.validationMessage,validity:n.validity})&&!t.length&&Q.config.reportValidityOfForms){n.reportValidity()}t.push({elt:n,message:n.validationMessage,validity:n.validity})}}}function hn(n,e){for(const t of e.keys()){n.delete(t)}e.forEach(function(e,t){n.append(t,e)});return n}function dn(e,t){const n=[];const r=new FormData;const o=new FormData;const i=[];const s=oe(e);if(s.lastButtonClicked&&!se(s.lastButtonClicked)){s.lastButtonClicked=null}let l=e instanceof HTMLFormElement&&e.noValidate!==true||a(e,"hx-validate")==="true";if(s.lastButtonClicked){l=l&&s.lastButtonClicked.formNoValidate!==true}if(t!=="get"){fn(n,o,i,Lt(e),l)}fn(n,r,i,e,l);if(s.lastButtonClicked||e.tagName==="BUTTON"||e.tagName==="INPUT"&&ee(e,"type")==="submit"){const u=s.lastButtonClicked||e;const f=ee(u,"name");ln(f,u.value,o)}const c=we(e,"hx-include");ie(c,function(e){fn(n,r,i,ce(e),l);if(!h(e,"form")){ie(p(e).querySelectorAll(ot),function(e){fn(n,r,i,e,l)})}});hn(r,o);return{errors:i,formData:r,values:kn(r)}}function pn(e,t,n){if(e!==""){e+="&"}if(String(n)==="[object Object]"){n=JSON.stringify(n)}const r=encodeURIComponent(n);e+=encodeURIComponent(t)+"="+r;return e}function gn(e){e=Dn(e);let n="";e.forEach(function(e,t){n=pn(n,t,e)});return n}function mn(e,t,n){const r={"HX-Request":"true","HX-Trigger":ee(e,"id"),"HX-Trigger-Name":ee(e,"name"),"HX-Target":a(t,"id"),"HX-Current-URL":location.href};Cn(e,"hx-headers",false,r);if(n!==undefined){r["HX-Prompt"]=n}if(oe(e).boosted){r["HX-Boosted"]="true"}return r}function yn(n,e){const t=ne(e,"hx-params");if(t){if(t==="none"){return new FormData}else if(t==="*"){return n}else if(t.indexOf("not ")===0){ie(t.slice(4).split(","),function(e){e=e.trim();n.delete(e)});return n}else{const r=new FormData;ie(t.split(","),function(t){t=t.trim();if(n.has(t)){n.getAll(t).forEach(function(e){r.append(t,e)})}});return r}}else{return n}}function xn(e){return!!ee(e,"href")&&ee(e,"href").indexOf("#")>=0}function bn(e,t){const n=t||ne(e,"hx-swap");const r={swapStyle:oe(e).boosted?"innerHTML":Q.config.defaultSwapStyle,swapDelay:Q.config.defaultSwapDelay,settleDelay:Q.config.defaultSettleDelay};if(Q.config.scrollIntoViewOnBoost&&oe(e).boosted&&!xn(e)){r.show="top"}if(n){const s=B(n);if(s.length>0){for(let e=0;e0?o.join(":"):null;r.scroll=u;r.scrollTarget=i}else if(l.indexOf("show:")===0){const f=l.slice(5);var o=f.split(":");const a=o.pop();var i=o.length>0?o.join(":"):null;r.show=a;r.showTarget=i}else if(l.indexOf("focus-scroll:")===0){const h=l.slice("focus-scroll:".length);r.focusScroll=h=="true"}else if(e==0){r.swapStyle=l}else{H("Unknown modifier in hx-swap: "+l)}}}}return r}function vn(e){return ne(e,"hx-encoding")==="multipart/form-data"||h(e,"form")&&ee(e,"enctype")==="multipart/form-data"}function wn(t,n,r){let o=null;Vt(n,function(e){if(o==null){o=e.encodeParameters(t,r,n)}});if(o!=null){return o}else{if(vn(n)){return hn(new FormData,Dn(r))}else{return gn(r)}}}function Sn(e){return{tasks:[],elts:[e]}}function En(e,t){const n=e[0];const r=e[e.length-1];if(t.scroll){var o=null;if(t.scrollTarget){o=ce(ue(n,t.scrollTarget))}if(t.scroll==="top"&&(n||o)){o=o||n;o.scrollTop=0}if(t.scroll==="bottom"&&(r||o)){o=o||r;o.scrollTop=o.scrollHeight}if(typeof t.scroll==="number"){b().setTimeout(function(){window.scrollTo(0,t.scroll)},0)}}if(t.show){var o=null;if(t.showTarget){let e=t.showTarget;if(t.showTarget==="window"){e="body"}o=ce(ue(n,e))}if(t.show==="top"&&(n||o)){o=o||n;o.scrollIntoView({block:"start",behavior:Q.config.scrollBehavior})}if(t.show==="bottom"&&(r||o)){o=o||r;o.scrollIntoView({block:"end",behavior:Q.config.scrollBehavior})}}}function Cn(r,e,o,i,s){if(i==null){i={}}if(r==null){return i}const l=a(r,e);if(l){let e=l.trim();let t=o;if(e==="unset"){return null}if(e.indexOf("javascript:")===0){e=e.slice(11);t=true}else if(e.indexOf("js:")===0){e=e.slice(3);t=true}if(e.indexOf("{")!==0){e="{"+e+"}"}let n;if(t){n=On(r,function(){if(s){return Function("event","return ("+e+")").call(r,s)}else{return Function("return ("+e+")").call(r)}},{})}else{n=v(e)}for(const c in n){if(n.hasOwnProperty(c)){if(i[c]==null){i[c]=n[c]}}}}return Cn(ce(u(r)),e,o,i,s)}function On(e,t,n){if(Q.config.allowEval){return t()}else{fe(e,"htmx:evalDisallowedError");return n}}function Hn(e,t,n){return Cn(e,"hx-vars",true,n,t)}function Tn(e,t,n){return Cn(e,"hx-vals",false,n,t)}function Rn(e,t){return le(Hn(e,t),Tn(e,t))}function qn(t,n,r){if(r!==null){try{t.setRequestHeader(n,r)}catch(e){t.setRequestHeader(n,encodeURIComponent(r));t.setRequestHeader(n+"-URI-AutoEncoded","true")}}}function An(t){if(t.responseURL){try{const e=new URL(t.responseURL);return e.pathname+e.search}catch(e){fe(te().body,"htmx:badResponseUrl",{url:t.responseURL})}}}function T(e,t){return t.test(e.getAllResponseHeaders())}function Ln(t,n,r){t=t.toLowerCase();if(r){if(r instanceof Element||typeof r==="string"){return he(t,n,null,null,{targetOverride:w(r)||ve,returnPromise:true})}else{let e=w(r.target);if(r.target&&!e||r.source&&!e&&!w(r.source)){e=ve}return he(t,n,w(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:e,swapOverride:r.swap,select:r.select,returnPromise:true,push:r.push,replace:r.replace,selectOOB:r.selectOOB})}}else{return he(t,n,null,null,{returnPromise:true})}}function Nn(e){const t=[];while(e){t.push(e);e=e.parentElement}return t}function In(e,t,n){const r=new URL(t,location.protocol!=="about:"?location.href:window.origin);const o=location.protocol!=="about:"?location.origin:window.origin;const i=o===r.origin;if(Q.config.selfRequestsOnly){if(!i){return false}}return ae(e,"htmx:validateUrl",le({url:r,sameHost:i},n))}function Dn(e){if(e instanceof FormData)return e;const t=new FormData;for(const n in e){if(e.hasOwnProperty(n)){if(e[n]&&typeof e[n].forEach==="function"){e[n].forEach(function(e){t.append(n,e)})}else if(typeof e[n]==="object"&&!(e[n]instanceof Blob)){t.append(n,JSON.stringify(e[n]))}else{t.append(n,e[n])}}}return t}function Pn(r,o,e){return new Proxy(e,{get:function(t,e){if(typeof e==="number")return t[e];if(e==="length")return t.length;if(e==="push"){return function(e){t.push(e);r.append(o,e)}}if(typeof t[e]==="function"){return function(){t[e].apply(t,arguments);r.delete(o);t.forEach(function(e){r.append(o,e)})}}if(t[e]&&t[e].length===1){return t[e][0]}else{return t[e]}},set:function(e,t,n){e[t]=n;r.delete(o);e.forEach(function(e){r.append(o,e)});return true}})}function kn(o){return new Proxy(o,{get:function(e,t){if(typeof t==="symbol"){const r=Reflect.get(e,t);if(typeof r==="function"){return function(){return r.apply(o,arguments)}}else{return r}}if(t==="toJSON"){return()=>Object.fromEntries(o)}if(t in e){if(typeof e[t]==="function"){return function(){return o[t].apply(o,arguments)}}}const n=o.getAll(t);if(n.length===0){return undefined}else if(n.length===1){return n[0]}else{return Pn(e,t,n)}},set:function(t,n,e){if(typeof n!=="string"){return false}t.delete(n);if(e&&typeof e.forEach==="function"){e.forEach(function(e){t.append(n,e)})}else if(typeof e==="object"&&!(e instanceof Blob)){t.append(n,JSON.stringify(e))}else{t.append(n,e)}return true},deleteProperty:function(e,t){if(typeof t==="string"){e.delete(t)}return true},ownKeys:function(e){return Reflect.ownKeys(Object.fromEntries(e))},getOwnPropertyDescriptor:function(e,t){return Reflect.getOwnPropertyDescriptor(Object.fromEntries(e),t)}})}function he(t,n,r,o,i,k){let s=null;let l=null;i=i!=null?i:{};if(i.returnPromise&&typeof Promise!=="undefined"){var e=new Promise(function(e,t){s=e;l=t})}if(r==null){r=te().body}const M=i.handler||Vn;const F=i.select||null;if(!se(r)){re(s);return e}const c=i.targetOverride||ce(Ee(r));if(c==null||c==ve){fe(r,"htmx:targetError",{target:ne(r,"hx-target")});re(l);return e}let u=oe(r);const f=u.lastButtonClicked;if(f){const A=ee(f,"formaction");if(A!=null){n=A}const L=ee(f,"formmethod");if(L!=null){if(de.includes(L.toLowerCase())){t=L}else{re(s);return e}}}const a=ne(r,"hx-confirm");if(k===undefined){const K=function(e){return he(t,n,r,o,i,!!e)};const G={target:c,elt:r,path:n,verb:t,triggeringEvent:o,etc:i,issueRequest:K,question:a};if(ae(r,"htmx:confirm",G)===false){re(s);return e}}let h=r;let d=ne(r,"hx-sync");let p=null;let B=false;if(d){const N=d.split(":");const I=N[0].trim();if(I==="this"){h=Se(r,"hx-sync")}else{h=ce(ue(r,I))}d=(N[1]||"drop").trim();u=oe(h);if(d==="drop"&&u.xhr&&u.abortable!==true){re(s);return e}else if(d==="abort"){if(u.xhr){re(s);return e}else{B=true}}else if(d==="replace"){ae(h,"htmx:abort")}else if(d.indexOf("queue")===0){const W=d.split(" ");p=(W[1]||"last").trim()}}if(u.xhr){if(u.abortable){ae(h,"htmx:abort")}else{if(p==null){if(o){const D=oe(o);if(D&&D.triggerSpec&&D.triggerSpec.queue){p=D.triggerSpec.queue}}if(p==null){p="last"}}if(u.queuedRequests==null){u.queuedRequests=[]}if(p==="first"&&u.queuedRequests.length===0){u.queuedRequests.push(function(){he(t,n,r,o,i)})}else if(p==="all"){u.queuedRequests.push(function(){he(t,n,r,o,i)})}else if(p==="last"){u.queuedRequests=[];u.queuedRequests.push(function(){he(t,n,r,o,i)})}re(s);return e}}const g=new XMLHttpRequest;u.xhr=g;u.abortable=B;const m=function(){u.xhr=null;u.abortable=false;if(u.queuedRequests!=null&&u.queuedRequests.length>0){const e=u.queuedRequests.shift();e()}};const X=ne(r,"hx-prompt");if(X){var y=prompt(X);if(y===null||!ae(r,"htmx:prompt",{prompt:y,target:c})){re(s);m();return e}}if(a&&!k){if(!confirm(a)){re(s);m();return e}}let x=mn(r,c,y);if(t!=="get"&&!vn(r)){x["Content-Type"]="application/x-www-form-urlencoded"}if(i.headers){x=le(x,i.headers)}const U=dn(r,t);let b=U.errors;const V=U.formData;if(i.values){hn(V,Dn(i.values))}const j=Dn(Rn(r,o));const v=hn(V,j);let w=yn(v,r);if(Q.config.getCacheBusterParam&&t==="get"){w.set("org.htmx.cache-buster",ee(c,"id")||"true")}if(n==null||n===""){n=location.href}const S=Cn(r,"hx-request");const $=oe(r).boosted;let E=Q.config.methodsThatUseUrlParams.indexOf(t)>=0;const C={boosted:$,useUrlParams:E,formData:w,parameters:kn(w),unfilteredFormData:v,unfilteredParameters:kn(v),headers:x,elt:r,target:c,verb:t,errors:b,withCredentials:i.credentials||S.credentials||Q.config.withCredentials,timeout:i.timeout||S.timeout||Q.config.timeout,path:n,triggeringEvent:o};if(!ae(r,"htmx:configRequest",C)){re(s);m();return e}n=C.path;t=C.verb;x=C.headers;w=Dn(C.parameters);b=C.errors;E=C.useUrlParams;if(b&&b.length>0){ae(r,"htmx:validation:halted",C);re(s);m();return e}const _=n.split("#");const z=_[0];const O=_[1];let H=n;if(E){H=z;const Z=!w.keys().next().done;if(Z){if(H.indexOf("?")<0){H+="?"}else{H+="&"}H+=gn(w);if(O){H+="#"+O}}}if(!In(r,H,C)){fe(r,"htmx:invalidPath",C);re(l);m();return e}g.open(t.toUpperCase(),H,true);g.overrideMimeType("text/html");g.withCredentials=C.withCredentials;g.timeout=C.timeout;if(S.noHeaders){}else{for(const P in x){if(x.hasOwnProperty(P)){const Y=x[P];qn(g,P,Y)}}}const T={xhr:g,target:c,requestConfig:C,etc:i,boosted:$,select:F,pathInfo:{requestPath:n,finalRequestPath:H,responsePath:null,anchor:O}};g.onload=function(){try{const t=Nn(r);T.pathInfo.responsePath=An(g);M(r,T);if(T.keepIndicators!==true){rn(R,q)}ae(r,"htmx:afterRequest",T);ae(r,"htmx:afterOnLoad",T);if(!se(r)){let e=null;while(t.length>0&&e==null){const n=t.shift();if(se(n)){e=n}}if(e){ae(e,"htmx:afterRequest",T);ae(e,"htmx:afterOnLoad",T)}}re(s)}catch(e){fe(r,"htmx:onLoadError",le({error:e},T));throw e}finally{m()}};g.onerror=function(){rn(R,q);fe(r,"htmx:afterRequest",T);fe(r,"htmx:sendError",T);re(l);m()};g.onabort=function(){rn(R,q);fe(r,"htmx:afterRequest",T);fe(r,"htmx:sendAbort",T);re(l);m()};g.ontimeout=function(){rn(R,q);fe(r,"htmx:afterRequest",T);fe(r,"htmx:timeout",T);re(l);m()};if(!ae(r,"htmx:beforeRequest",T)){re(s);m();return e}var R=tn(r);var q=nn(r);ie(["loadstart","loadend","progress","abort"],function(t){ie([g,g.upload],function(e){e.addEventListener(t,function(e){ae(r,"htmx:xhr:"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})})})});ae(r,"htmx:beforeSend",T);const J=E?null:wn(g,r,w);g.send(J);return e}function Mn(e,t){const n=t.xhr;let r=null;let o=null;if(T(n,/HX-Push:/i)){r=n.getResponseHeader("HX-Push");o="push"}else if(T(n,/HX-Push-Url:/i)){r=n.getResponseHeader("HX-Push-Url");o="push"}else if(T(n,/HX-Replace-Url:/i)){r=n.getResponseHeader("HX-Replace-Url");o="replace"}if(r){if(r==="false"){return{}}else{return{type:o,path:r}}}const i=t.pathInfo.finalRequestPath;const s=t.pathInfo.responsePath;const l=t.etc.push||ne(e,"hx-push-url");const c=t.etc.replace||ne(e,"hx-replace-url");const u=oe(e).boosted;let f=null;let a=null;if(l){f="push";a=l}else if(c){f="replace";a=c}else if(u){f="push";a=s||i}if(a){if(a==="false"){return{}}if(a==="true"){a=s||i}if(t.pathInfo.anchor&&a.indexOf("#")===-1){a=a+"#"+t.pathInfo.anchor}return{type:f,path:a}}else{return{}}}function Fn(e,t){var n=new RegExp(e.code);return n.test(t.toString(10))}function Bn(e){for(var t=0;t`+`.${t}{opacity:0;visibility: hidden} `+`.${n} .${t}, .${n}.${t}{opacity:1;visibility: visible;transition: opacity 200ms ease-in}`+"")}}function Zn(){const e=te().querySelector('meta[name="htmx-config"]');if(e){return v(e.content)}else{return null}}function Yn(){const e=Zn();if(e){Q.config=le(Q.config,e)}}Gn(function(){Yn();Wn();let e=te().body;Ft(e);const t=te().querySelectorAll("[hx-trigger='restored'],[data-hx-trigger='restored']");e.addEventListener("htmx:abort",function(e){const t=e.detail.elt||e.target;const n=oe(t);if(n&&n.xhr){n.xhr.abort()}});const n=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(e){if(e.state&&e.state.htmx){en();ie(t,function(e){ae(e,"htmx:restored",{document:te(),triggerEvent:ae})})}else{if(n){n(e)}}};b().setTimeout(function(){ae(e,"htmx:load",{});e=null},0)});return Q}(); \ No newline at end of file diff --git a/templates/_js_dropzone.html b/templates/_js_dropzone.html new file mode 100644 index 0000000..1d39822 --- /dev/null +++ b/templates/_js_dropzone.html @@ -0,0 +1,26 @@ + + + diff --git a/templates/_js_htmx.html b/templates/_js_htmx.html new file mode 100644 index 0000000..007c811 --- /dev/null +++ b/templates/_js_htmx.html @@ -0,0 +1,4 @@ + + + + diff --git a/templates/css/dropzone.html b/templates/css/dropzone.html new file mode 100644 index 0000000..0a3486a --- /dev/null +++ b/templates/css/dropzone.html @@ -0,0 +1,3 @@ + + + diff --git a/templates/files.html b/templates/files.html index 3dc0a43..1c43f8f 100644 --- a/templates/files.html +++ b/templates/files.html @@ -26,83 +26,19 @@
Vous pouvez partager des liens de vos fichiers avec les autres membres de ce serveur uniquement. Si vous partagez un lien avec une personne non inscrite elle ne pourra pas y avoir accès
+
+ Chargement ... +
- {% if listFilesPrivate %} - - - - - - - - - - - - {% for file in listFilesPrivate %} - - - - - - - - {% endfor %} - -
Fichier(s) {{ nb_pv }}Taille (en Megaoctect)
{{ file[0] }}{{ file[1] }}{{ file[2] }} - - - - - - - - -
- {% else %} -

Vous n'avez aucun fichier privé

-{% endif %}
-

+

Fichiers publics

Vous pouvez partager les liens de ces fichiers avec n'importe qui sur Internet ils y auront accès
-{% if listFilesPublic %} - - - - - - - - - - - {% for file in listFilesPublic %} - - - - - - - {% endfor %} - -
Fichier(s) {{ nb_pu }}Taille (en Megaoctets)
{{ file[0] }}{{ file[1] }}{{ file[2] }} - - - - - - - -
-{% else %} -

Vous n'avez aucun fichier public

-{% endif %} + +
+ Chargement ... +
@@ -110,4 +46,5 @@ {% block js %} {% include '_js_dropzone.html' %} +{% include '_js_htmx.html' %} {% endblock %} diff --git a/templates/list_files.html b/templates/list_files.html new file mode 100644 index 0000000..78adf72 --- /dev/null +++ b/templates/list_files.html @@ -0,0 +1,54 @@ + +{% if listFiles %} + + + + + + + + + + + + {% for file in listFiles %} + + + + + + {% else %} + + + + {% endif %} + + {% endfor %} + +
Fichier(s) {{ nb_files }}Taille (en Megaoctect)
{{ file[0] }}{{ file[1] }}{{ file[2] }} + {% if status == "public" %} + + + + + + + + + + + + + + + + + +
+ {% else %} +
Aucun fichier ici
+{% endif %} diff --git a/templates/myfiles.html b/templates/myfiles.html deleted file mode 100644 index 44fd0c3..0000000 --- a/templates/myfiles.html +++ /dev/null @@ -1,86 +0,0 @@ -{% extends 'up_squelette.html' %} - - -{% block main %} - - -

Quand tu envoies des images, elles se retrouveront directement dans la Gallerie.

-

Ayez bien conscience que ce site est une expérience est qu'il est indispensable d'avoir - une sauvegarde de tous les fichiers qui vous mettrez ici. Nous ne pourrons, en aucun cas, être tenu responsable de la perte de vos - données. Merci de votre compréhension. -

- -
-

Choisissez un ou plusieurs fichiers à téléverser

- - -
- -
- -
- - - - -

Fichiers privés (Seul les personnes connectées et l'administrateur de l'ordinateur peuvent les voirs)

-{% if listFilesPrivate %} - - - - - - - - - - - - {% for file in listFilesPrivate %} - - - - - - - - {% endfor %} - -
Fichier(s) {{ nb_pv }}Taille (en Megaoctect)
{{ file[0] }}{{ file[1] }}{{ file[2] }}
-{% else %} -

Vous n'avez aucun fichiers privés

-{% endif %} -
-
-
-

Fichiers publics (Tout le monde peut les voirs)

-{% if listFilesPublic %} - - - - - - - - - - - - {% for file in listFilesPublic %} - - - - - - - - {% endfor %} - -
Fichier(s) {{ nb_pu }}Taille (en Megaoctets)
{{ file[0] }}{{ file[1] }}{{ file[2] }}
-{% else %} -

Vous n'avez aucun fichiers publics

-{% endif %} - - - -{% endblock %} diff --git a/templates/up_squelette.html b/templates/up_squelette.html index f36889e..6f79130 100644 --- a/templates/up_squelette.html +++ b/templates/up_squelette.html @@ -2,6 +2,7 @@ {% include '_head.html' %} + {% block css %} {% endblock %} {% include 'css/simple_editor.html' %} diff --git a/tools/utils.py b/tools/utils.py index 9c6cab3..ee68ea0 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -39,6 +39,28 @@ def append_to_log(log_line, user): log.close() + +def valid_email(mail): + valid=True + # Caractères non autorisés dans la RFC #822 + invalid_char = { '(', ')', '<', '>', ',', ';', ':', '"', '[', ']', '|', 'ç', '%', '&', ' ' } + mail_cut = mail.split('@') + tld = mail_cut[-1].split('.') + + for character in invalid_char: + if character in mail: + valid=False + + print(tld) + if len(mail_cut) > 1 and len(tld) > 1 and valid: + if len(tld[0]) < 1 or len(tld[-1]) < 2 : + valid=False + else: + valid=False + + return valid + + def valid_username(username): valid=True # Caractères non autorisés dans la RFC #822 diff --git a/views/filesupload.py b/views/filesupload.py index 02c52d4..d32e9b3 100644 --- a/views/filesupload.py +++ b/views/filesupload.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from flask import Blueprint, Flask, request, flash, render_template, url_for, session, redirect, abort, make_response, flash, abort, send_file, send_from_directory + from werkzeug.utils import secure_filename from markupsafe import escape from PIL import Image @@ -16,15 +17,14 @@ filesupload = Blueprint('filesupload', __name__, template_folder='templates') app = Flask( 'pywallter' ) app.config.from_pyfile('config.py') +#### Variables ################################################################################## -#### Variables #################################################################################### +DOSSIER_PERSO= app.config.get('DOSSIER_APP') +DOSSIER_PUBLIC= app.config.get('DOSSIER_PUBLIC') -DOSSIER_PERSO= app.config['DOSSIER_APP']+'/' -DOSSIER_PUBLIC= app.config['DOSSIER_PUBLIC']+'/' - -extensionimg = app.config['EXT_IMG'] -DATABASE = app.config['DATABASE'] -BASE_URL= app.config['BASE_URL'] +extensionimg = app.config.get('EXT_IMG') +DATABASE = app.config.get('DATABASE') +BASE_URL= app.config.get('BASE_URL') ################################################################################################## @@ -46,19 +46,20 @@ def upload(): files = request.files.getlist('fic') for f in files : nom = secure_filename(f.filename) - check_and_create(DOSSIER_PERSO+ user + '/files') - check_and_create(DOSSIER_PERSO+ user + '/images') - if os.path.isfile(DOSSIER_PERSO + user + '/files/' + nom) or os.path.isfile(DOSSIER_PERSO + user + '/images/' + nom): + check_and_create(os.path.join(DOSSIER_PERSO, user, 'files')) + check_and_create(os.path.join(DOSSIER_PERSO, user, 'images')) + if os.path.isfile(os.path.join(DOSSIER_PERSO,user, 'files', nom) or + os.path.isfile(DOSSIER_PERSO, user, 'images', nom)): alert = "Le fichier "+str(f.filename)+" avec le même nom existe déjà, merci de spécifier un autre nom de fichier \n" flash(alert, 'error') else: file, ext = os.path.splitext(nom) if ext in extensionimg : - f.save(DOSSIER_PERSO + user + '/images/' + nom) - image = DOSSIER_PERSO + user + '/images/' + nom + f.save(os.path.join(DOSSIER_PERSO, user, 'images', nom)) + image = os.path.join(DOSSIER_PERSO, user, 'images', nom) with Image.open(image) as img : img.thumbnail((300,300)) - img.save( DOSSIER_PERSO + user + '/images/thumbnails/' + nom ) + img.save(os.path.join(DOSSIER_PERSO, user, 'images','thumbnails', nom )) time_img_create=time.strftime("%A %d %B %Y %H:%M:%S") IP=request.environ['REMOTE_ADDR'] client_platform=request.headers.get('User-Agent') @@ -68,9 +69,9 @@ def upload(): log.close() else: - f.save(DOSSIER_PERSO + user + '/files/' + nom) + f.save(os.path.join(DOSSIER_PERSO, user, 'files', nom)) time_file_upload=time.strftime("%A %d %B %Y %H:%M:%S") - IP=request.environ['REMOTE_ADDR'] + IP=request.environ.get('REMOTE_ADDR') client_platform=request.headers.get('User-Agent') log=open("log.txt", "a") # Ouvre fichier log.txt log.write (time_file_upload + ' - ' + IP + ' - ' + user + ' - ' + client_platform + '\n' + '---> ' + nom + '\n') # Écrit dans log @@ -80,43 +81,101 @@ def upload(): return redirect(url_for('filesupload.list')) +@filesupload.route( '/upload-dropzone', methods=['POST']) +@login_required +def drop_upload(): + user = '%s'% escape(session['username']) + file = request.files['file'] + check_and_create(os.path.join(DOSSIER_PERSO, user, 'files')) + check_and_create(os.path.join(DOSSIER_PERSO, user, 'images' )) + filename = secure_filename(file.filename) + ext = os.path.splitext(filename) + is_image = False + print("nom du fichier :" +filename) + if ext in extensionimg : + save_path = os.path.join(DOSSIER_PERSO, user, 'images', filename ) + is_image = True + else: + save_path = os.path.join(DOSSIER_PERSO, user, 'files', filename ) -@filesupload.route('/view/') + current_chunk = int(request.form['dzchunkindex']) + print (current_chunk) + + if (os.path.isfile(save_path) or os.path.isfile( os.path.join(DOSSIER_PERSO, user, 'images', filename ))) and current_chunk == 0: + return make_response(('Un fichier avec le même nom existe déjà', 400)) + + try: + with open(save_path, 'ab') as f: + f.seek(int(request.form['dzchunkbyteoffset'])) + f.write(file.stream.read()) + except OSError: + return make_response(("Une erreur est survenue," + " Impossible d'écrire le fichier sur le disque", 500)) + total_chunks = int(request.form['dztotalchunkcount']) + if current_chunk + 1 == total_chunks: + # This was the last chunk, the file should be complete and the size we expect + if os.path.getsize(save_path) != int(request.form['dztotalfilesize']): + return make_response(('La taille du fichier source est différentes', 500)) + else: + time_file_upload=time.strftime("%A %d %B %Y %H:%M:%S") + IP=request.environ['REMOTE_ADDR'] + client_platform=request.headers.get('User-Agent') + log=open("log.txt", "a") # Ouvre fichier log.txt + log.write (time_file_upload + ' - ' + IP + ' - ' + user + ' - ' + client_platform + '\n' + '---> ' + filename + '\n') # Écrit dans log + log.close() # Ferme log.txt + + if is_image : + with Image.open(save_path) as img : + img.thumbnail((300,300)) + img.save(os.path.join(DOSSIER_PERSO, user, 'images', 'thumbnails', filename ) ) + + return make_response(('Chunk upload succesfull', 200)) + +@filesupload.route('/view/', methods=['GET']) @login_required def list(): user = '%s'% escape(session['username']) - check_and_create(DOSSIER_PUBLIC + user + '/files/') - check_and_create(DOSSIER_PERSO + user + '/files/') - files_public = os.listdir(DOSSIER_PUBLIC + user + '/files/') - files_private = os.listdir(DOSSIER_PERSO + user + '/files/') - listFilesPublic = [] - listFilesPrivate = [] - nb_pv = 0 - size=0 - if files_private: - for fich in files_private: - nb_pv += 1 - size = getFileSizeMo(DOSSIER_PERSO + user + '/files/' + fich) # size = taille des fichiers - listFilesPrivate.append([nb_pv, fich, size]) # On implémente la listeFichiers avec le num le ficier et sa taille - - nb_pu = 0 - if files_public: - for fich in files_public: - nb_pu += 1 - size = getFileSizeMo(DOSSIER_PUBLIC + user + '/files/' + fich) # size = taille des fichiers - listFilesPublic.append([nb_pu, fich, size]) - + check_and_create(os.path.join(DOSSIER_PUBLIC, user, 'files')) + check_and_create(os.path.join(DOSSIER_PERSO, user, 'files')) + return render_template('files.html', section="Files", BASE_URL=BASE_URL, + username=user) + + +@filesupload.route('/files//', methods=['GET']) +@login_required +def list_files(status: str ): + user = '%s' % escape(session['username']) + listFiles = [] + nb_files = 0 + size=0 + folder="" + + if status == "public": + folder=DOSSIER_PUBLIC + else: + folder=DOSSIER_PERSO + + files = os.listdir(os.path.join(folder, user, 'files')) + + if files: + for fich in files: + nb_files += 1 + size = getFileSizeMo(os.path.join(folder, user, 'files', fich)) # size = taille des fichiers + listFiles.append([nb_files, fich, size]) # On implémente la listeFichiers avec le num le ficier et sa taille + resp = "

Bonjour " + user +" ça va bien putain ca marche ?

" + + return render_template('list_files.html', + BASE_URL=BASE_URL, + status=status, size=size, username=user, - nb_pv=nb_pv, - nb_pu=nb_pu, - listFilesPrivate=listFilesPrivate, - listFilesPublic=listFilesPublic) + nb_files=nb_files, + listFiles=listFiles) @filesupload.route('/myfiles//') @@ -130,11 +189,9 @@ def myfiles(username, filename): @login_required def move_public(filename): user = '%s' % escape(session['username']) - check_and_create(DOSSIER_PUBLIC + user + '/files/') - check_and_create(DOSSIER_PERSO + user + '/files/') src = os.path.join(DOSSIER_PERSO, user, 'files', filename) - dst = os.path.join(DOSSIER_PUBLIC, user, 'files/') + dst = os.path.join(DOSSIER_PUBLIC, user, 'files') move (src, dst) return redirect(url_for('filesupload.list', _external=True)) @@ -142,10 +199,8 @@ def move_public(filename): @login_required def move_private(filename): user = '%s' % escape(session['username']) - check_and_create(DOSSIER_PUBLIC + user + '/files/') - check_and_create(DOSSIER_PERSO + user + '/files/') src = os.path.join(DOSSIER_PUBLIC, user, 'files', filename) - dst = os.path.join(DOSSIER_PERSO, user, 'files/') + dst = os.path.join(DOSSIER_PERSO, user, 'files') move (src, dst) return redirect(url_for('filesupload.list', _external=True)) @@ -158,7 +213,7 @@ def remove_privateFile(filename): user = '%s' % escape(session['username']) filename = secure_filename(filename) try: - os.remove(DOSSIER_PERSO + user + '/files/' + filename) # on le supprime + os.remove( os.path.join(DOSSIER_PERSO, user, 'files', filename)) # on le supprime except FileNotFoundError: flash(u'Fichier {filename} inexistant.'.format(filename=filename), 'error') return redirect(url_for('filesupload.list', _external=True)) @@ -170,7 +225,7 @@ def remove_publicFile(filename): user = '%s' % escape(session['username']) filename = secure_filename(filename) try: - os.remove(DOSSIER_PUBLIC + user + '/files/' + filename) # on le supprime + os.remove( os.path.join(DOSSIER_PUBLIC, user, 'files', filename)) # on le supprime except FileNotFoundError: flash(u'Fichier {filename} inexistant.'.format(filename=filename), 'error') return redirect(url_for('filesupload.list', _external=True)) @@ -179,8 +234,8 @@ def remove_publicFile(filename): @filesupload.route('//blog.css') def blog_theme(author): user = author - if os.path.isfile(DOSSIER_PERSO+ user +'/blog.css'): - return send_file(DOSSIER_PERSO+ user +'/blog.css', mimetype='text/css') + if os.path.isfile(os.path.join(DOSSIER_PERSO, user,'blog.css')): + return send_file(os.path.join(DOSSIER_PERSO, user, 'blog.css'), mimetype='text/css') else: return send_file("/static/blog.css", mimetype='text/css') @@ -188,8 +243,8 @@ def blog_theme(author): def theme(): if 'username' in session: user = '%s' % escape(session['username']) - if os.path.isfile(DOSSIER_PERSO+ user +'/theme.min.css'): - return send_file(DOSSIER_PERSO+ user +'/theme.min.css', mimetype='text/css') + if os.path.isfile(os.path.join(DOSSIER_PERSO, user,'theme.min.css')): + return send_file(os.path.join(DOSSIER_PERSO, user,'theme.min.css'), mimetype='text/css') return send_file("static/default.min.css", mimetype='text/css') diff --git a/views/profil.py b/views/profil.py index e925141..341dcdd 100644 --- a/views/profil.py +++ b/views/profil.py @@ -9,7 +9,7 @@ import subprocess from shutil import copy from socket import gethostname from flask_bcrypt import Bcrypt -from tools.utils import email_disp, append_to_log, gen_token, valid_passwd, valid_token_register, get_user_by_token, totp_is_valid, login_required +from tools.utils import email_disp, append_to_log, gen_token, valid_passwd, valid_token_register, get_user_by_token, totp_is_valid, login_required, valid_email from pyotp import random_base32 from tools.filesutils import check_and_create import qrcode @@ -73,18 +73,20 @@ def profile() : os.path.join(DOSSIER_PERSO, user ,'theme.min.css') ) if request.form['nom']: - profil_user['nom'] = request.form['nom'] + profil_user['nom'] = str(request.form['nom']) if request.form['prenom']: - profil_user['prenom'] = request.form['prenom'] + profil_user['prenom'] = str(request.form['prenom']) if request.form['age']: - profil_user['age'] = request.form['age'] - if '@' in request.form['mail_rescue']: - if len(request.form['mail_rescue']) > 4: - profil_user['mail_rescue'] = request.form['mail_rescue'] + profil_user['age'] = str(request.form['age']) + + if request.form['mail_rescue'] : + new_mail_rescue = str(request.form['mail_rescue']) + if valid_email(new_mail_rescue): + profil_user['mail_rescue']=new_mail_rescue else: flash(u'Adresse de courriel invalide', 'error') - else: - flash(u'Adresse de courriel de secour invalide', 'error') + + if f: # On vérifie qu'un fichier a bien été envoyé nom = secure_filename(f.filename) f.save(os.path.join(DOSSIER_PERSO, user, 'profile', nom)) @@ -98,7 +100,6 @@ def profile() : cursor.execute("UPDATE users SET avatar=? WHERE name=?", (filename, user)) conn.commit() - cursor = conn.cursor() # Création de l'objet "curseur" conn.close() flash(u'Image de profil mise à jour', 'success') @@ -109,7 +110,7 @@ def profile() : (profil_user['nom'], profil_user['prenom'], profil_user['age'], profil_user['mail_rescue'], user)) conn.commit() - flash(u'Le profil a été mis à jour', 'succes') + flash(u'Le profil a été mis à jour', 'success') @@ -195,7 +196,7 @@ def change_passwd() : if not(account['totp']): account['totp'] = random_base32() img = qrcode.make('otpauth://totp/'+BASE_URL+'?secret='+account['totp']) - img.save(DOSSIER_PERSO + user + "/totp.png") + img.save(os.path.join(DOSSIER_PERSO, user, "totp.png")) shared_key_validate = False return render_template('mypassword.html', @@ -302,7 +303,7 @@ def set_totp(): cursor.execute("""UPDATE users SET totp=? WHERE name=?""", (shared_key, user,)) conn.commit() img = qrcode.make('otpauth://totp/'+BASE_URL+'?secret='+shared_key) - img.save(DOSSIER_PERSO + user + "/totp.png") + img.save(os.path.join(DOSSIER_PERSO, user, "totp.png")) flash(u'Votre mot de passe à usage unique est configuré et actif.', 'success') else: flash(u'Le code de validation totp n\'est pas valide.', 'error')