form.min.js 66 KB

1234
  1. !function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){(function(e){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e){return e=e.replace(/@3x|@2x|@1x/,""),e=e.replace(/\(/g,"%28"),e=e.replace(/\)/g,"%29"),e.match(/\.(jpe?g|png|gif|svg)$/i)?"![]("+e+")":"["+decodeURI(e)+"]("+e+")"}Object.defineProperty(t,"__esModule",{value:!0}),t.Instances=void 0;var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();t.UriToMarkdown=a;var s=n(1),l=i(s),u=n(2),d=i(u),c=n(4),p=i(c),f=n(5),h={dictCancelUpload:f.translations.PLUGIN_FORM.DROPZONE_CANCEL_UPLOAD,dictCancelUploadConfirmation:f.translations.PLUGIN_FORM.DROPZONE_CANCEL_UPLOAD_CONFIRMATION,dictDefaultMessage:f.translations.PLUGIN_FORM.DROPZONE_DEFAULT_MESSAGE,dictFallbackMessage:f.translations.PLUGIN_FORM.DROPZONE_FALLBACK_MESSAGE,dictFallbackText:f.translations.PLUGIN_FORM.DROPZONE_FALLBACK_TEXT,dictFileTooBig:f.translations.PLUGIN_FORM.DROPZONE_FILE_TOO_BIG,dictInvalidFileType:f.translations.PLUGIN_FORM.DROPZONE_INVALID_FILE_TYPE,dictMaxFilesExceeded:f.translations.PLUGIN_FORM.DROPZONE_MAX_FILES_EXCEEDED,dictRemoveFile:f.translations.PLUGIN_FORM.DROPZONE_REMOVE_FILE,dictRemoveFileConfirmation:f.translations.PLUGIN_FORM.DROPZONE_REMOVE_FILE_CONFIRMATION,dictResponseError:f.translations.PLUGIN_FORM.DROPZONE_RESPONSE_ERROR};d.default.autoDiscover=!1;var m={createImageThumbnails:{thumbnailWidth:150},addRemoveLinks:!1,dictDefaultMessage:h.dictDefaultMessage,dictRemoveFileConfirmation:h.dictRemoveFileConfirmation,previewTemplate:""};window.EXIF=p.default;var v=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.container,i=void 0===n?".dropzone.files-upload":n,a=e.options,o=void 0===a?{}:a;r(this,t),this.container=(0,l.default)(i),this.container.length&&(this.urls={},m.previewTemplate=(0,l.default)("#dropzone-template").html(),this.options=Object.assign({},h,m,{klass:this,url:this.container.data("file-url-add")||f.config.current_url,acceptedFiles:this.container.data("media-types"),init:this.initDropzone},this.container.data("dropzone-options"),o),this.dropzone=new d.default(i,this.options),this.dropzone.on("complete",this.onDropzoneComplete.bind(this)),this.dropzone.on("success",this.onDropzoneSuccess.bind(this)),this.dropzone.on("removedfile",this.onDropzoneRemovedFile.bind(this)),this.dropzone.on("sending",this.onDropzoneSending.bind(this)),this.dropzone.on("error",this.onDropzoneError.bind(this)))}return o(t,[{key:"initDropzone",value:function(){var e=this,t=this.options.klass.container.find("[data-file]"),n=this;t.length&&t.each(function(t,i){i=(0,l.default)(i);var r=i.data("file"),a={name:r.name,size:r.size,type:r.type,status:d.default.ADDED,accepted:!0,url:e.options.url,removeUrl:r.remove};n.files.push(a),n.options.addedfile.call(n,a),a.type.match(/^image\//)&&n.options.thumbnail.call(n,a,r.path),i.remove()})}},{key:"getURI",value:function(){return this.container.data("mediaUri")||""}},{key:"onDropzoneSending",value:function(e,t,n){n.append("__form-name__",this.container.closest("form").find('[name="__form-name__"]').val()),n.append("__form-file-uploader__",1),n.append("name",this.options.dotNotation),n.append("form-nonce",f.config.form_nonce),n.append("task","filesupload"),n.append("uri",this.getURI())}},{key:"onDropzoneSuccess",value:function(t,n,i){if(this.options.reloadPage&&e.location.reload(),n.session){t.sessionParams=n.session,t.removeUrl=this.options.url;var r=this.container.find('[name][type="hidden"]'),a=r.val();r.val(a+" ")}return this.handleError({file:t,data:n,mode:"removeFile",msg:"<p>"+f.translations.PLUGIN_FORM.FILE_ERROR_UPLOAD+" <strong>"+t.name+"</strong></p>\n <pre>"+n.message+"</pre>"})}},{key:"onDropzoneComplete",value:function(t){if(!t.accepted&&!t.rejected){var n={status:"error",message:f.translations.PLUGIN_FORM.FILE_UNSUPPORTED+": "+t.name.match(/\..+/).join("")};return this.handleError({file:t,data:n,mode:"removeFile",msg:"<p>"+f.translations.PLUGIN_FORM.FILE_ERROR_ADD+" <strong>"+t.name+"</strong></p>\n <pre>"+n.message+"</pre>"})}this.options.reloadPage&&e.location.reload()}},{key:"onDropzoneRemovedFile",value:function(t){var n=this;if(t.accepted&&!t.rejected){var i=t.removeUrl||this.urls.delete||location.href+".json",r=(i||"").match(/path:(.*)\//),a=new FormData;a.append("filename",t.name),a.append("__form-name__",this.container.closest("form").find('[name="__form-name__"]').val()),a.append("name",this.options.dotNotation),a.append("form-nonce",f.config.form_nonce),a.append("uri",this.getURI()),t.sessionParams&&(a.append("__form-file-remover__","1"),a.append("session",t.sessionParams)),l.default.ajax({url:i,data:a,method:"POST",contentType:!1,processData:!1,success:function(){if(r){r=e.atob(r[1]);var t=n.container.find('[name][type="hidden"]'),i=JSON.parse(t.val()||"{}");delete i[r],t.val(JSON.stringify(i))}}})}}},{key:"onDropzoneError",value:function(e,t,n){var i=n&&t.error?t.error.message:t;return(0,l.default)(e.previewElement).find("[data-dz-errormessage]").html(i),this.handleError({file:e,data:{status:"error"},msg:"<pre>"+i+"</pre>"})}},{key:"handleError",value:function(e){return!0}}]),t}();t.default=v;var g=[],b=(0,l.default)(),y=function(e,t){var n=(0,l.default)(t).find(".dropzone.files-upload");n.length&&n.each(function(e,t){t=(0,l.default)(t),~b.index(t)||k(t)})},k=function(e){e=(0,l.default)(e);var t=e.find('input[type="file"]'),n=e.data("grav-file-settings")||{};n.accept&&~n.accept.indexOf("*")&&(n.accept=[""]);var i={url:e.data("file-url-add")||(e.closest("form").attr("action")||f.config.current_url)+".json",paramName:n.paramName||"file",dotNotation:n.name||"file",acceptedFiles:n.accept?n.accept.join(","):t.attr("accept")||e.data("media-types"),maxFilesize:n.filesize||256,maxFiles:n.limit||null,resizeWidth:n.resizeWidth||null,resizeHeight:n.resizeHeight||null,resizeQuality:n.resizeQuality||null,accept:function(e,t){var i=n.resolution;return i?void setTimeout(function(){var r="";return i.min&&Object.keys(i.min).forEach(function(t){e[t]<i.min[t]&&(r+=f.translations.PLUGIN_FORM.RESOLUTION_MIN.replace(/{{attr}}/g,t).replace(/{{min}}/g,i.min[t]))}),n.resizeWidth||n.resizeHeight||i.max&&Object.keys(i.max).forEach(function(t){e[t]>i.max[t]&&(r+=f.translations.PLUGIN_FORM.RESOLUTION_MAX.replace(/{{attr}}/g,t).replace(/{{max}}/g,i.max[t]))}),t(r)},50):t()}};b=b.add(e),e=e[0],g.push(new v({container:e,options:i}))};t.Instances=function(){return(0,l.default)(".dropzone.files-upload").each(function(e,t){return k(t)}),(0,l.default)("body").on("mutation._grav",y),g}()}).call(t,function(){return this}())},function(e,t){e.exports=jQuery},function(e,t,n){(function(e){"use strict";function t(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){return"undefined"!=typeof e&&null!==e?t(e):void 0}function a(e,t,n){return"undefined"!=typeof e&&null!==e&&"function"==typeof e[t]?n(e,t):void 0}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),s=function(){function e(){i(this,e)}return o(e,[{key:"on",value:function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}},{key:"emit",value:function(e){this._callbacks=this._callbacks||{};var t=this._callbacks[e];if(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];for(var a=t,o=!0,s=0,a=o?a:a[Symbol.iterator]();;){var l;if(o){if(s>=a.length)break;l=a[s++]}else{if(s=a.next(),s.done)break;l=s.value}var u=l;u.apply(this,i)}}return this}},{key:"off",value:function(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var n=this._callbacks[e];if(!n)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(var i=0;i<n.length;i++){var r=n[i];if(r===t){n.splice(i,1);break}}return this}}]),e}(),l=function(e){function l(e,n){i(this,l);var r=t(this,(l.__proto__||Object.getPrototypeOf(l)).call(this)),a=void 0,o=void 0;if(r.element=e,r.version=l.version,r.defaultOptions.previewTemplate=r.defaultOptions.previewTemplate.replace(/\n*/g,""),r.clickableElements=[],r.listeners=[],r.files=[],"string"==typeof r.element&&(r.element=document.querySelector(r.element)),!r.element||null==r.element.nodeType)throw new Error("Invalid dropzone element.");if(r.element.dropzone)throw new Error("Dropzone already attached.");l.instances.push(r),r.element.dropzone=r;var s=null!=(o=l.optionsForElement(r.element))?o:{};if(r.options=l.extend({},r.defaultOptions,s,null!=n?n:{}),r.options.forceFallback||!l.isBrowserSupported()){var u;return u=r.options.fallback.call(r),t(r,u)}if(null==r.options.url&&(r.options.url=r.element.getAttribute("action")),!r.options.url)throw new Error("No URL provided.");if(r.options.acceptedFiles&&r.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(r.options.uploadMultiple&&r.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return r.options.acceptedMimeTypes&&(r.options.acceptedFiles=r.options.acceptedMimeTypes,delete r.options.acceptedMimeTypes),null!=r.options.renameFilename&&(r.options.renameFile=function(e){return r.options.renameFilename.call(r,e.name,e)}),r.options.method=r.options.method.toUpperCase(),(a=r.getExistingFallback())&&a.parentNode&&a.parentNode.removeChild(a),r.options.previewsContainer!==!1&&(r.options.previewsContainer?r.previewsContainer=l.getElement(r.options.previewsContainer,"previewsContainer"):r.previewsContainer=r.element),r.options.clickable&&(r.options.clickable===!0?r.clickableElements=[r.element]:r.clickableElements=l.getElements(r.options.clickable,"clickable")),r.init(),r}return n(l,e),o(l,null,[{key:"initClass",value:function(){this.prototype.Emitter=s,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,timeout:3e4,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){},params:function(e,t,n){if(n)return{dzuuid:n.file.upload.uuid,dzchunkindex:n.index,dztotalfilesize:n.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:n.file.upload.totalChunkCount,dzchunkbyteoffset:n.index*this.options.chunkSize}},accept:function(e,t){return t()},chunksUploaded:function(e,t){t()},fallback:function(){var e=void 0;this.element.className=this.element.className+" dz-browser-not-supported";for(var t=this.element.getElementsByTagName("div"),n=!0,i=0,t=n?t:t[Symbol.iterator]();;){var r;if(n){if(i>=t.length)break;r=t[i++]}else{if(i=t.next(),i.done)break;r=i.value}var a=r;if(/(^| )dz-message($| )/.test(a.className)){e=a,a.className="dz-message";break}}e||(e=l.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(e));var o=e.getElementsByTagName("span")[0];return o&&(null!=o.textContent?o.textContent=this.options.dictFallbackMessage:null!=o.innerText&&(o.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,n,i){var r={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},a=e.width/e.height;null==t&&null==n?(t=r.srcWidth,n=r.srcHeight):null==t?t=n*a:null==n&&(n=t/a),t=Math.min(t,r.srcWidth),n=Math.min(n,r.srcHeight);var o=t/n;if(r.srcWidth>t||r.srcHeight>n)if("crop"===i)a>o?(r.srcHeight=e.height,r.srcWidth=r.srcHeight*o):(r.srcWidth=e.width,r.srcHeight=r.srcWidth/o);else{if("contain"!==i)throw new Error("Unknown resizeMethod '"+i+"'");a>o?n=t/a:t=n*a}return r.srcX=(e.width-r.srcWidth)/2,r.srcY=(e.height-r.srcHeight)/2,r.trgWidth=t,r.trgHeight=n,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:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Check</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Error</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>',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){e.previewElement=l.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement);for(var n=e.previewElement.querySelectorAll("[data-dz-name]"),i=!0,r=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(r>=n.length)break;a=n[r++]}else{if(r=n.next(),r.done)break;a=r.value}var o=a;o.textContent=e.name}for(var s=e.previewElement.querySelectorAll("[data-dz-size]"),u=!0,d=0,s=u?s:s[Symbol.iterator]();;){if(u){if(d>=s.length)break;o=s[d++]}else{if(d=s.next(),d.done)break;o=d.value}o.innerHTML=this.filesize(e.size)}this.options.addRemoveLinks&&(e._removeLink=l.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"</a>"),e.previewElement.appendChild(e._removeLink));for(var c=function(n){return n.preventDefault(),n.stopPropagation(),e.status===l.UPLOADING?l.confirm(t.options.dictCancelUploadConfirmation,function(){return t.removeFile(e)}):t.options.dictRemoveFileConfirmation?l.confirm(t.options.dictRemoveFileConfirmation,function(){return t.removeFile(e)}):t.removeFile(e)},p=e.previewElement.querySelectorAll("[data-dz-remove]"),f=!0,h=0,p=f?p:p[Symbol.iterator]();;){var m;if(f){if(h>=p.length)break;m=p[h++]}else{if(h=p.next(),h.done)break;m=h.value}var v=m;v.addEventListener("click",c)}}},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");for(var n=e.previewElement.querySelectorAll("[data-dz-thumbnail]"),i=!0,r=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(r>=n.length)break;a=n[r++]}else{if(r=n.next(),r.done)break;a=r.value}var o=a;o.alt=e.name,o.src=t}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);for(var n=e.previewElement.querySelectorAll("[data-dz-errormessage]"),i=!0,r=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(r>=n.length)break;a=n[r++]}else{if(r=n.next(),r.done)break;a=r.value}var o=a;o.textContent=t}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.textContent=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t,n){if(e.previewElement)for(var i=e.previewElement.querySelectorAll("[data-dz-uploadprogress]"),r=!0,a=0,i=r?i:i[Symbol.iterator]();;){var o;if(r){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var s=o;"PROGRESS"===s.nodeName?s.value=t:s.style.width=t+"%"}},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,"Upload canceled.")},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.textContent=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];for(var r=n,a=!0,o=0,r=a?r:r[Symbol.iterator]();;){var s;if(a){if(o>=r.length)break;s=r[o++]}else{if(o=r.next(),o.done)break;s=o.value}var l=s;for(var u in l){var d=l[u];e[u]=d}}return e}}]),o(l,[{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(l.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(l.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(l.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(e){return e.status===l.UPLOADING||e.status===l.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(l.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length){var t=function t(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(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.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",document.querySelector(e.options.hiddenInputContainer).appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var n=e.hiddenFileInput.files;if(n.length)for(var i=n,r=!0,a=0,i=r?i:i[Symbol.iterator]();;){var o;if(r){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var s=o;e.addFile(s)}return e.emit("addedfiles",n),t()})};t()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(var n=this.events,i=!0,r=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(r>=n.length)break;a=n[r++]}else{if(r=n.next(),r.done)break;a=r.value}var o=a;this.on(o,this.options[o])}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 s=function(e){return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:function(t){return e.emit("dragstart",t)},dragenter:function(t){return s(t),e.emit("dragenter",t)},dragover:function(t){var n=void 0;try{n=t.dataTransfer.effectAllowed}catch(e){}return t.dataTransfer.dropEffect="move"===n||"linkMove"===n?"move":"copy",s(t),e.emit("dragover",t)},dragleave:function(t){return e.emit("dragleave",t)},drop:function(t){return s(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(n){return(t!==e.element||n.target===e.element||l.elementInside(n.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,l.instances.splice(l.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var e=void 0,t=0,n=0,i=this.getActiveFiles();if(i.length){for(var r=this.getActiveFiles(),a=!0,o=0,r=a?r:r[Symbol.iterator]();;){var s;if(a){if(o>=r.length)break;s=r[o++]}else{if(o=r.next(),o.done)break;s=o.value}var l=s;t+=l.upload.bytesSent,n+=l.upload.total}e=100*t/n}else e=100;return this.emit("totaluploadprogress",e,n,t)}},{key:"_getParamName",value:function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):""+this.options.paramName+(this.options.uploadMultiple?"["+e+"]":"")}},{key:"_renameFile",value:function(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}},{key:"getFallbackForm",value:function(){var e=void 0,t=void 0;if(e=this.getExistingFallback())return e;var n='<div class="dz-fallback">';this.options.dictFallbackText&&(n+="<p>"+this.options.dictFallbackText+"</p>"),n+='<input type="file" name="'+this._getParamName(0)+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"></div>';var i=l.createElement(n);return"FORM"!==this.element.tagName?(t=l.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>'),t.appendChild(i)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:i}},{key:"getExistingFallback",value:function(){for(var e=function(e){for(var t=e,n=!0,i=0,t=n?t:t[Symbol.iterator]();;){var r;if(n){if(i>=t.length)break;r=t[i++]}else{if(i=t.next(),i.done)break;r=i.value}var a=r;if(/(^| )fallback($| )/.test(a.className))return a}},t=["div","form"],n=0;n<t.length;n++){var i,r=t[n];if(i=e(this.element.getElementsByTagName(r)))return i}}},{key:"setupEventListeners",value:function(){return this.listeners.map(function(e){return function(){var t=[];for(var n in e.events){var i=e.events[n];t.push(e.element.addEventListener(n,i,!1))}return t}()})}},{key:"removeEventListeners",value:function(){return this.listeners.map(function(e){return function(){var t=[];for(var n in e.events){var i=e.events[n];t.push(e.element.removeEventListener(n,i,!1))}return t}()})}},{key:"disable",value:function(){var e=this;return this.clickableElements.forEach(function(e){return e.classList.remove("dz-clickable")}),this.removeEventListeners(),this.files.map(function(t){return e.cancelUpload(t)})}},{key:"enable",value:function(){return this.clickableElements.forEach(function(e){return e.classList.add("dz-clickable")}),this.setupEventListeners()}},{key:"filesize",value:function(e){var t=0,n="b";if(e>0){for(var i=["tb","gb","mb","kb","b"],r=0;r<i.length;r++){var a=i[r],o=Math.pow(this.options.filesizeBase,4-r)/10;if(e>=o){t=e/Math.pow(this.options.filesizeBase,4-r),n=a;break}}t=Math.round(10*t)/10}return"<strong>"+t+"</strong> "+this.options.dictFileSizeUnits[n]}},{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);var t=e.dataTransfer.files;if(this.emit("addedfiles",t),t.length){var n=e.dataTransfer.items;n&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(t)}}}},{key:"paste",value:function(e){if(null!=r(null!=e?e.clipboardData:void 0,function(e){return e.items})){this.emit("paste",e);var t=e.clipboardData.items;return t.length?this._addFilesFromItems(t):void 0}}},{key:"handleFiles",value:function(e){var t=this;return e.map(function(e){return t.addFile(e)})}},{key:"_addFilesFromItems",value:function(e){var t=this;return function(){for(var n=[],i=e,r=!0,a=0,i=r?i:i[Symbol.iterator]();;){var o;if(r){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var s,l=o;null!=l.webkitGetAsEntry&&(s=l.webkitGetAsEntry())?s.isFile?n.push(t.addFile(l.getAsFile())):s.isDirectory?n.push(t._addFilesFromDirectory(s,s.name)):n.push(void 0):null!=l.getAsFile&&(null==l.kind||"file"===l.kind)?n.push(t.addFile(l.getAsFile())):n.push(void 0)}return n}()}},{key:"_addFilesFromDirectory",value:function(e,t){var n=this,i=e.createReader(),r=function(e){return a(console,"log",function(t){return t.log(e)})},o=function e(){return i.readEntries(function(i){if(i.length>0){for(var r=i,a=!0,o=0,r=a?r:r[Symbol.iterator]();;){var s;if(a){if(o>=r.length)break;s=r[o++]}else{if(o=r.next(),o.done)break;s=o.value}var l=s;l.isFile?l.file(function(e){if(!n.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=t+"/"+e.name,n.addFile(e)}):l.isDirectory&&n._addFilesFromDirectory(l,t+"/"+l.name)}e()}return null},r)};return o()}},{key:"accept",value:function(e,t){return e.size>1024*this.options.maxFilesize*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):l.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;return e.upload={uuid:l.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e),chunked:this.options.chunking&&(this.options.forceChunking||e.size>this.options.chunkSize),
  2. totalChunkCount:Math.ceil(e.size/this.options.chunkSize)},this.files.push(e),e.status=l.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(n){return n?(e.accepted=!1,t._errorProcessing([e],n)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(e){for(var t=e,n=!0,i=0,t=n?t:t[Symbol.iterator]();;){var r;if(n){if(i>=t.length)break;r=t[i++]}else{if(i=t.next(),i.done)break;r=i.value}var a=r;this.enqueueFile(a)}return null}},{key:"enqueueFile",value:function(e){var t=this;if(e.status!==l.ADDED||e.accepted!==!0)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=l.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return t.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)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(n){return e.emit("thumbnail",t,n),e._processingThumbnail=!1,e._processThumbnailQueue()})}}},{key:"removeFile",value:function(e){if(e.status===l.UPLOADING&&this.cancelUpload(e),this.files=u(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(e){null==e&&(e=!1);for(var t=this.files.slice(),n=!0,i=0,t=n?t:t[Symbol.iterator]();;){var r;if(n){if(i>=t.length)break;r=t[i++]}else{if(i=t.next(),i.done)break;r=i.value}var a=r;(a.status!==l.UPLOADING||e)&&this.removeFile(a)}return null}},{key:"resizeImage",value:function(e,t,n,i,r){var a=this;return this.createThumbnail(e,t,n,i,!1,function(t,n){if(null===n)return r(e);var i=a.options.resizeMimeType;null==i&&(i=e.type);var o=n.toDataURL(i,a.options.resizeQuality);return"image/jpeg"!==i&&"image/jpg"!==i||(o=f.restore(e.dataURL,o)),r(l.dataURItoBlob(o))})}},{key:"createThumbnail",value:function(e,t,n,i,r,a){var o=this,s=new FileReader;return s.onload=function(){return e.dataURL=s.result,"image/svg+xml"===e.type?void(null!=a&&a(s.result)):o.createThumbnailFromUrl(e,t,n,i,r,a)},s.readAsDataURL(e)}},{key:"createThumbnailFromUrl",value:function(e,t,n,i,r,a,o){var s=this,l=document.createElement("img");return o&&(l.crossOrigin=o),l.onload=function(){var o=function(e){return e(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&r&&(o=function(e){return EXIF.getData(l,function(){return e(EXIF.getTag(this,"Orientation"))})}),o(function(r){e.width=l.width,e.height=l.height;var o=s.options.resize.call(s,e,t,n,i),u=document.createElement("canvas"),d=u.getContext("2d");switch(u.width=o.trgWidth,u.height=o.trgHeight,r>4&&(u.width=o.trgHeight,u.height=o.trgWidth),r){case 2:d.translate(u.width,0),d.scale(-1,1);break;case 3:d.translate(u.width,u.height),d.rotate(Math.PI);break;case 4:d.translate(0,u.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,-u.height);break;case 7:d.rotate(.5*Math.PI),d.translate(u.width,-u.height),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-u.width,0)}p(d,l,null!=o.srcX?o.srcX:0,null!=o.srcY?o.srcY:0,o.srcWidth,o.srcHeight,null!=o.trgX?o.trgX:0,null!=o.trgY?o.trgY:0,o.trgWidth,o.trgHeight);var c=u.toDataURL("image/png");if(null!=a)return a(c,u)})},null!=a&&(l.onerror=a),l.src=e.dataURL}},{key:"processQueue",value:function(){var e=this.options.parallelUploads,t=this.getUploadingFiles().length,n=t;if(!(t>=e)){var i=this.getQueuedFiles();if(i.length>0){if(this.options.uploadMultiple)return this.processFiles(i.slice(0,e-t));for(;n<e;){if(!i.length)return;this.processFile(i.shift()),n++}}}}},{key:"processFile",value:function(e){return this.processFiles([e])}},{key:"processFiles",value:function(e){for(var t=e,n=!0,i=0,t=n?t:t[Symbol.iterator]();;){var r;if(n){if(i>=t.length)break;r=t[i++]}else{if(i=t.next(),i.done)break;r=i.value}var a=r;a.processing=!0,a.status=l.UPLOADING,this.emit("processing",a)}return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}},{key:"_getFilesWithXhr",value:function(e){var t=void 0;return t=this.files.filter(function(t){return t.xhr===e}).map(function(e){return e})}},{key:"cancelUpload",value:function(e){if(e.status===l.UPLOADING){for(var t=this._getFilesWithXhr(e.xhr),n=t,i=!0,r=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(r>=n.length)break;a=n[r++]}else{if(r=n.next(),r.done)break;a=r.value}var o=a;o.status=l.CANCELED}"undefined"!=typeof e.xhr&&e.xhr.abort();for(var s=t,u=!0,d=0,s=u?s:s[Symbol.iterator]();;){var c;if(u){if(d>=s.length)break;c=s[d++]}else{if(d=s.next(),d.done)break;c=d.value}var p=c;this.emit("canceled",p)}this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==l.ADDED&&e.status!==l.QUEUED||(e.status=l.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(e){if("function"==typeof e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return e.apply(this,n)}return e}},{key:"uploadFile",value:function(e){return this.uploadFiles([e])}},{key:"uploadFiles",value:function(e){var t=this;this._transformFiles(e,function(n){if(e[0].upload.chunked){var i=e[0],r=n[0],a=0;i.upload.chunks=[];var o=function(){for(var n=0;void 0!==i.upload.chunks[n];)n++;if(!(n>=i.upload.totalChunkCount)){a++;var o=n*t.options.chunkSize,s=Math.min(o+t.options.chunkSize,i.size),u={name:t._getParamName(0),data:r.webkitSlice?r.webkitSlice(o,s):r.slice(o,s),filename:i.upload.filename,chunkIndex:n};i.upload.chunks[n]={file:i,index:n,dataBlock:u,status:l.UPLOADING,progress:0,retries:0},t._uploadData(e,[u])}};if(i.upload.finishedChunkUpload=function(n){var r=!0;n.status=l.SUCCESS,n.dataBlock=null;for(var a=0;a<i.upload.totalChunkCount;a++){if(void 0===i.upload.chunks[a])return o();i.upload.chunks[a].status!==l.SUCCESS&&(r=!1)}r&&t.options.chunksUploaded(i,function(){t._finished(e,"",null)})},t.options.parallelChunkUploads)for(var s=0;s<i.upload.totalChunkCount;s++)o();else o()}else{for(var u=[],d=0;d<e.length;d++)u[d]={name:t._getParamName(d),data:n[d],filename:e[d].upload.filename};t._uploadData(e,u)}})}},{key:"_getChunk",value:function(e,t){for(var n=0;n<e.upload.totalChunkCount;n++)if(void 0!==e.upload.chunks[n]&&e.upload.chunks[n].xhr===t)return e.upload.chunks[n]}},{key:"_uploadData",value:function(e,t){for(var n=this,i=new XMLHttpRequest,r=e,a=!0,o=0,r=a?r:r[Symbol.iterator]();;){var s;if(a){if(o>=r.length)break;s=r[o++]}else{if(o=r.next(),o.done)break;s=o.value}var u=s;u.xhr=i}e[0].upload.chunked&&(e[0].upload.chunks[t[0].chunkIndex].xhr=i);var d=this.resolveOption(this.options.method,e),c=this.resolveOption(this.options.url,e);i.open(d,c,!0),i.timeout=this.resolveOption(this.options.timeout,e),i.withCredentials=!!this.options.withCredentials,i.onload=function(t){n._finishedUploading(e,i,t)},i.onerror=function(){n._handleUploadError(e,i)};var p=null!=i.upload?i.upload:i;p.onprogress=function(t){return n._updateFilesUploadProgress(e,i,t)};var f={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};this.options.headers&&l.extend(f,this.options.headers);for(var h in f){var m=f[h];m&&i.setRequestHeader(h,m)}var v=new FormData;if(this.options.params){var g=this.options.params;"function"==typeof g&&(g=g.call(this,e,i,e[0].upload.chunked?this._getChunk(e[0],i):null));for(var b in g){var y=g[b];v.append(b,y)}}for(var k=e,F=!0,x=0,k=F?k:k[Symbol.iterator]();;){var S;if(F){if(x>=k.length)break;S=k[x++]}else{if(x=k.next(),x.done)break;S=x.value}var E=S;this.emit("sending",E,i,v)}this.options.uploadMultiple&&this.emit("sendingmultiple",e,i,v),this._addFormElementData(v);for(var w=0;w<t.length;w++){var C=t[w];v.append(C.name,C.data,C.filename)}this.submitRequest(i,v,e)}},{key:"_transformFiles",value:function(e,t){for(var n=this,i=[],r=0,a=function(a){n.options.transformFile.call(n,e[a],function(n){i[a]=n,++r===e.length&&t(i)})},o=0;o<e.length;o++)a(o)}},{key:"_addFormElementData",value:function(e){if("FORM"===this.element.tagName)for(var t=this.element.querySelectorAll("input, textarea, select, button"),n=!0,i=0,t=n?t:t[Symbol.iterator]();;){var r;if(n){if(i>=t.length)break;r=t[i++]}else{if(i=t.next(),i.done)break;r=i.value}var a=r,o=a.getAttribute("name"),s=a.getAttribute("type");if(s&&(s=s.toLowerCase()),"undefined"!=typeof o&&null!==o)if("SELECT"===a.tagName&&a.hasAttribute("multiple"))for(var l=a.options,u=!0,d=0,l=u?l:l[Symbol.iterator]();;){var c;if(u){if(d>=l.length)break;c=l[d++]}else{if(d=l.next(),d.done)break;c=d.value}var p=c;p.selected&&e.append(o,p.value)}else(!s||"checkbox"!==s&&"radio"!==s||a.checked)&&e.append(o,a.value)}}},{key:"_updateFilesUploadProgress",value:function(e,t,n){var i=void 0;if("undefined"!=typeof n){if(i=100*n.loaded/n.total,e[0].upload.chunked){var r=e[0],a=this._getChunk(r,t);a.progress=i,a.total=n.total,a.bytesSent=n.loaded;r.upload.progress=0,r.upload.total=0,r.upload.bytesSent=0;for(var o=0;o<r.upload.totalChunkCount;o++)void 0!==r.upload.chunks[o]&&void 0!==r.upload.chunks[o].progress&&(r.upload.progress+=r.upload.chunks[o].progress,r.upload.total+=r.upload.chunks[o].total,r.upload.bytesSent+=r.upload.chunks[o].bytesSent);r.upload.progress=r.upload.progress/r.upload.totalChunkCount}else for(var s=e,l=!0,u=0,s=l?s:s[Symbol.iterator]();;){var d;if(l){if(u>=s.length)break;d=s[u++]}else{if(u=s.next(),u.done)break;d=u.value}var c=d;c.upload.progress=i,c.upload.total=n.total,c.upload.bytesSent=n.loaded}for(var p=e,f=!0,h=0,p=f?p:p[Symbol.iterator]();;){var m;if(f){if(h>=p.length)break;m=p[h++]}else{if(h=p.next(),h.done)break;m=h.value}var v=m;this.emit("uploadprogress",v,v.upload.progress,v.upload.bytesSent)}}else{var g=!0;i=100;for(var b=e,y=!0,k=0,b=y?b:b[Symbol.iterator]();;){var F;if(y){if(k>=b.length)break;F=b[k++]}else{if(k=b.next(),k.done)break;F=k.value}var x=F;100===x.upload.progress&&x.upload.bytesSent===x.upload.total||(g=!1),x.upload.progress=i,x.upload.bytesSent=x.upload.total}if(g)return;for(var S=e,E=!0,w=0,S=E?S:S[Symbol.iterator]();;){var C;if(E){if(w>=S.length)break;C=S[w++]}else{if(w=S.next(),w.done)break;C=w.value}var P=C;this.emit("uploadprogress",P,i,P.upload.bytesSent)}}}},{key:"_finishedUploading",value:function(e,t,n){var i=void 0;if(e[0].status!==l.CANCELED&&4===t.readyState){if("arraybuffer"!==t.responseType&&"blob"!==t.responseType&&(i=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json")))try{i=JSON.parse(i)}catch(e){n=e,i="Invalid JSON response from server."}this._updateFilesUploadProgress(e),200<=t.status&&t.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],t)):this._finished(e,i,n):this._handleUploadError(e,t,i)}}},{key:"_handleUploadError",value:function(e,t,n){if(e[0].status!==l.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){var i=this._getChunk(e[0],t);if(i.retries++<this.options.retryChunksLimit)return void this._uploadData(e,[i.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}for(var r=e,a=!0,o=0,r=a?r:r[Symbol.iterator]();;){var s;if(a){if(o>=r.length)break;s=r[o++]}else{if(o=r.next(),o.done)break;s=o.value}this._errorProcessing(e,n||this.options.dictResponseError.replace("{{statusCode}}",t.status),t)}}}},{key:"submitRequest",value:function(e,t,n){e.send(t)}},{key:"_finished",value:function(e,t,n){for(var i=e,r=!0,a=0,i=r?i:i[Symbol.iterator]();;){var o;if(r){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var s=o;s.status=l.SUCCESS,this.emit("success",s,t,n),this.emit("complete",s)}if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(e,t,n){for(var i=e,r=!0,a=0,i=r?i:i[Symbol.iterator]();;){var o;if(r){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var s=o;s.status=l.ERROR,this.emit("error",s,t,n),this.emit("complete",s)}if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}}]),l}(s);l.initClass(),l.version="5.3.0",l.options={},l.optionsForElement=function(e){return e.getAttribute("id")?l.options[d(e.getAttribute("id"))]:void 0},l.instances=[],l.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},l.autoDiscover=!0,l.discover=function(){var e=void 0;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];var t=function(t){return function(){for(var n=[],i=t,r=!0,a=0,i=r?i:i[Symbol.iterator]();;){var o;if(r){if(a>=i.length)break;o=i[a++]}else{if(a=i.next(),a.done)break;o=a.value}var s=o;/(^| )dropzone($| )/.test(s.className)?n.push(e.push(s)):n.push(void 0)}return n}()};t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return function(){for(var t=[],n=e,i=!0,r=0,n=i?n:n[Symbol.iterator]();;){var a;if(i){if(r>=n.length)break;a=n[r++]}else{if(r=n.next(),r.done)break;a=r.value}var o=a;l.optionsForElement(o)!==!1?t.push(new l(o)):t.push(void 0)}return t}()},l.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],l.isBrowserSupported=function(){var e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(var t=l.blacklistedBrowsers,n=!0,i=0,t=n?t:t[Symbol.iterator]();;){var r;if(n){if(i>=t.length)break;r=t[i++]}else{if(i=t.next(),i.done)break;r=i.value}var a=r;a.test(navigator.userAgent)&&(e=!1)}else e=!1;else e=!1;return e},l.dataURItoBlob=function(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],i=new ArrayBuffer(t.length),r=new Uint8Array(i),a=0,o=t.length,s=0<=o;s?a<=o:a>=o;s?a++:a--)r[a]=t.charCodeAt(a);return new Blob([i],{type:n})};var u=function(e,t){return e.filter(function(e){return e!==t}).map(function(e){return e})},d=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})};l.createElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},l.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},l.getElement=function(e,t){var n=void 0;if("string"==typeof e?n=document.querySelector(e):null!=e.nodeType&&(n=e),null==n)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector or a plain HTML element.");return n},l.getElements=function(e,t){var n=void 0,i=void 0;if(e instanceof Array){i=[];try{for(var r=e,a=!0,o=0,r=a?r:r[Symbol.iterator]();;){if(a){if(o>=r.length)break;n=r[o++]}else{if(o=r.next(),o.done)break;n=o.value}i.push(this.getElement(n,t))}}catch(e){i=null}}else if("string"==typeof e){i=[];for(var s=document.querySelectorAll(e),l=!0,u=0,s=l?s:s[Symbol.iterator]();;){if(l){if(u>=s.length)break;n=s[u++]}else{if(u=s.next(),u.done)break;n=u.value}i.push(n)}}else null!=e.nodeType&&(i=[e]);if(null==i||!i.length)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return i},l.confirm=function(e,t,n){return window.confirm(e)?t():null!=n?n():void 0},l.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");for(var n=e.type,i=n.replace(/\/.*$/,""),r=t,a=!0,o=0,r=a?r:r[Symbol.iterator]();;){var s;if(a){if(o>=r.length)break;s=r[o++]}else{if(o=r.next(),o.done)break;s=o.value}var l=s;if(l=l.trim(),"."===l.charAt(0)){if(e.name.toLowerCase().indexOf(l.toLowerCase(),e.name.length-l.length)!==-1)return!0}else if(/\/\*$/.test(l)){if(i===l.replace(/\/.*$/,""))return!0}else if(n===l)return!0}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new l(this,e)})}),"undefined"!=typeof e&&null!==e?e.exports=l:window.Dropzone=l,l.ADDED="added",l.QUEUED="queued",l.ACCEPTED=l.QUEUED,l.UPLOADING="uploading",l.PROCESSING=l.UPLOADING,l.CANCELED="canceled",l.ERROR="error",l.SUCCESS="success";var c=function(e){var t=(e.naturalWidth,e.naturalHeight),n=document.createElement("canvas");n.width=1,n.height=t;var i=n.getContext("2d");i.drawImage(e,0,0);for(var r=i.getImageData(1,0,1,t),a=r.data,o=0,s=t,l=t;l>o;){var u=a[4*(l-1)+3];0===u?s=l:o=l,l=s+o>>1}var d=l/t;return 0===d?1:d},p=function(e,t,n,i,r,a,o,s,l,u){var d=c(t);return e.drawImage(t,n,i,r,a,o,s,l,u/d)},f=function(){function e(){i(this,e)}return o(e,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(e){for(var t="",n=void 0,i=void 0,r="",a=void 0,o=void 0,s=void 0,l="",u=0;;)if(n=e[u++],i=e[u++],r=e[u++],a=n>>2,o=(3&n)<<4|i>>4,s=(15&i)<<2|r>>6,l=63&r,isNaN(i)?s=l=64:isNaN(r)&&(l=64),t=t+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(s)+this.KEY_STR.charAt(l),n=i=r="",a=o=s=l="",!(u<e.length))break;return t}},{key:"restore",value:function(e,t){if(!e.match("data:image/jpeg;base64,"))return t;var n=this.decode64(e.replace("data:image/jpeg;base64,","")),i=this.slice2Segments(n),r=this.exifManipulation(t,i);return"data:image/jpeg;base64,"+this.encode64(r)}},{key:"exifManipulation",value:function(e,t){var n=this.getExifArray(t),i=this.insertExif(e,n),r=new Uint8Array(i);return r}},{key:"getExifArray",value:function(e){for(var t=void 0,n=0;n<e.length;){if(t=e[n],255===t[0]&225===t[1])return t;n++}return[]}},{key:"insertExif",value:function(e,t){var n=e.replace("data:image/jpeg;base64,",""),i=this.decode64(n),r=i.indexOf(255,3),a=i.slice(0,r),o=i.slice(r),s=a;return s=s.concat(t),s=s.concat(o)}},{key:"slice2Segments",value:function(e){for(var t=0,n=[];;){var i;if(255===e[t]&218===e[t+1])break;if(255===e[t]&216===e[t+1])t+=2;else{i=256*e[t+2]+e[t+3];var r=t+i+2,a=e.slice(t,r);n.push(a),t=r}if(t>e.length)break}return n}},{key:"decode64",value:function(e){var t=void 0,n=void 0,i="",r=void 0,a=void 0,o=void 0,s="",l=0,u=[],d=/[^A-Za-z0-9\+\/\=]/g;for(d.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");;)if(r=this.KEY_STR.indexOf(e.charAt(l++)),a=this.KEY_STR.indexOf(e.charAt(l++)),o=this.KEY_STR.indexOf(e.charAt(l++)),s=this.KEY_STR.indexOf(e.charAt(l++)),t=r<<2|a>>4,n=(15&a)<<4|o>>2,i=(3&o)<<6|s,u.push(t),64!==o&&u.push(n),64!==s&&u.push(i),t=n=i="",r=a=o=s="",!(l<e.length))break;return u}}]),e}();f.initClass();var h=function(e,t){var n=!1,i=!0,r=e.document,a=r.documentElement,o=r.addEventListener?"addEventListener":"attachEvent",s=r.addEventListener?"removeEventListener":"detachEvent",l=r.addEventListener?"":"on",u=function i(a){if("readystatechange"!==a.type||"complete"===r.readyState)return("load"===a.type?e:r)[s](l+a.type,i,!1),!n&&(n=!0)?t.call(e,a.type||a):void 0},d=function e(){try{a.doScroll("left")}catch(t){return void setTimeout(e,50)}return u("poll")};if("complete"!==r.readyState){if(r.createEventObject&&a.doScroll){try{i=!e.frameElement}catch(e){}i&&d()}return r[o](l+"DOMContentLoaded",u,!1),r[o](l+"readystatechange",u,!1),e[o](l+"load",u,!1)}};l._autoDiscoverFunction=function(){if(l.autoDiscover)return l.discover()},h(window,l._autoDiscoverFunction)}).call(t,n(3)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,i){var r,a;(function(){function i(e){return!!e.exifdata}function o(e,t){t=t||e.match(/^data\:([^\;]+)\;base64,/im)[1]||"",e=e.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var n=atob(e),i=n.length,r=new ArrayBuffer(i),a=new Uint8Array(r),o=0;o<i;o++)a[o]=n.charCodeAt(o);return r}function s(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="blob",n.onload=function(e){200!=this.status&&0!==this.status||t(this.response)},n.send()}function l(e,t){function n(n){var i=u(n);e.exifdata=i||{};var r=d(n);if(e.iptcdata=r||{},x.isXmpEnabled){var a=b(n);e.xmpdata=a||{}}t&&t.call(e)}if(e.src)if(/^data\:/i.test(e.src)){var i=o(e.src);n(i)}else if(/^blob\:/i.test(e.src)){var r=new FileReader;r.onload=function(e){n(e.target.result)},s(e.src,function(e){r.readAsArrayBuffer(e)})}else{var a=new XMLHttpRequest;a.onload=function(){if(200!=this.status&&0!==this.status)throw"Could not load image";n(a.response),a=null},a.open("GET",e.src,!0),a.responseType="arraybuffer",a.send(null)}else if(self.FileReader&&(e instanceof self.Blob||e instanceof self.File)){var r=new FileReader;r.onload=function(e){F&&console.log("Got file of length "+e.target.result.byteLength),n(e.target.result)},r.readAsArrayBuffer(e)}}function u(e){var t=new DataView(e);if(F&&console.log("Got file of length "+e.byteLength),255!=t.getUint8(0)||216!=t.getUint8(1))return F&&console.log("Not a valid JPEG"),!1;for(var n,i=2,r=e.byteLength;i<r;){if(255!=t.getUint8(i))return F&&console.log("Not a valid marker at offset "+i+", found: "+t.getUint8(i)),!1;if(n=t.getUint8(i+1),F&&console.log(n),225==n)return F&&console.log("Found 0xFFE1 marker"),g(t,i+4,t.getUint16(i+2)-2);i+=2+t.getUint16(i+2)}}function d(e){var t=new DataView(e);if(F&&console.log("Got file of length "+e.byteLength),255!=t.getUint8(0)||216!=t.getUint8(1))return F&&console.log("Not a valid JPEG"),!1;for(var n=2,i=e.byteLength,r=function(e,t){return 56===e.getUint8(t)&&66===e.getUint8(t+1)&&73===e.getUint8(t+2)&&77===e.getUint8(t+3)&&4===e.getUint8(t+4)&&4===e.getUint8(t+5)};n<i;){if(r(t,n)){var a=t.getUint8(n+7);a%2!==0&&(a+=1),0===a&&(a=4);var o=n+8+a,s=t.getUint16(n+6+a);return c(e,o,s)}n++}}function c(e,t,n){for(var i,r,a,o,s,l=new DataView(e),u={},d=t;d<t+n;)28===l.getUint8(d)&&2===l.getUint8(d+1)&&(o=l.getUint8(d+2),o in D&&(a=l.getInt16(d+3),s=a+5,r=D[o],i=v(l,d+5,a),u.hasOwnProperty(r)?u[r]instanceof Array?u[r].push(i):u[r]=[u[r],i]:u[r]=i)),d++;return u}function p(e,t,n,i,r){var a,o,s,l=e.getUint16(n,!r),u={};for(s=0;s<l;s++)a=n+12*s+2,o=i[e.getUint16(a,!r)],!o&&F&&console.log("Unknown tag: "+e.getUint16(a,!r)),u[o]=f(e,a,t,n,r);return u}function f(e,t,n,i,r){var a,o,s,l,u,d,c=e.getUint16(t+2,!r),p=e.getUint32(t+4,!r),f=e.getUint32(t+8,!r)+n;switch(c){case 1:case 7:if(1==p)return e.getUint8(t+8,!r);for(a=p>4?f:t+8,o=[],l=0;l<p;l++)o[l]=e.getUint8(a+l);return o;case 2:return a=p>4?f:t+8,v(e,a,p-1);case 3:if(1==p)return e.getUint16(t+8,!r);for(a=p>2?f:t+8,o=[],l=0;l<p;l++)o[l]=e.getUint16(a+2*l,!r);return o;case 4:if(1==p)return e.getUint32(t+8,!r);for(o=[],l=0;l<p;l++)o[l]=e.getUint32(f+4*l,!r);return o;case 5:if(1==p)return u=e.getUint32(f,!r),d=e.getUint32(f+4,!r),s=new Number(u/d),s.numerator=u,s.denominator=d,s;for(o=[],l=0;l<p;l++)u=e.getUint32(f+8*l,!r),d=e.getUint32(f+4+8*l,!r),o[l]=new Number(u/d),o[l].numerator=u,o[l].denominator=d;return o;case 9:if(1==p)return e.getInt32(t+8,!r);for(o=[],l=0;l<p;l++)o[l]=e.getInt32(f+4*l,!r);return o;case 10:if(1==p)return e.getInt32(f,!r)/e.getInt32(f+4,!r);for(o=[],l=0;l<p;l++)o[l]=e.getInt32(f+8*l,!r)/e.getInt32(f+4+8*l,!r);return o}}function h(e,t,n){var i=e.getUint16(t,!n);return e.getUint32(t+2+12*i,!n)}function m(e,t,n,i){var r=h(e,t+n,i);if(!r)return{};if(r>e.byteLength)return{};var a=p(e,t,t+r,C,i);if(a.Compression)switch(a.Compression){case 6:if(a.JpegIFOffset&&a.JpegIFByteCount){var o=t+a.JpegIFOffset,s=a.JpegIFByteCount;a.blob=new Blob([new Uint8Array(e.buffer,o,s)],{type:"image/jpeg"})}break;case 1:console.log("Thumbnail image format is TIFF, which is not implemented.");break;default:console.log("Unknown thumbnail image format '%s'",a.Compression)}else 2==a.PhotometricInterpretation&&console.log("Thumbnail image format is RGB, which is not implemented.");return a}function v(e,t,i){var r="";for(n=t;n<t+i;n++)r+=String.fromCharCode(e.getUint8(n));return r}function g(e,t){if("Exif"!=v(e,t,4))return F&&console.log("Not valid EXIF data! "+v(e,t,4)),!1;var n,i,r,a,o,s=t+6;if(18761==e.getUint16(s))n=!1;else{if(19789!=e.getUint16(s))return F&&console.log("Not valid TIFF data! (no 0x4949 or 0x4D4D)"),!1;n=!0}if(42!=e.getUint16(s+2,!n))return F&&console.log("Not valid TIFF data! (no 0x002A)"),!1;var l=e.getUint32(s+4,!n);if(l<8)return F&&console.log("Not valid TIFF data! (First offset less than 8)",e.getUint32(s+4,!n)),!1;if(i=p(e,s,s+l,E,n),i.ExifIFDPointer){a=p(e,s,s+i.ExifIFDPointer,S,n);for(r in a){switch(r){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":a[r]=P[r][a[r]];break;case"ExifVersion":case"FlashpixVersion":a[r]=String.fromCharCode(a[r][0],a[r][1],a[r][2],a[r][3]);break;case"ComponentsConfiguration":a[r]=P.Components[a[r][0]]+P.Components[a[r][1]]+P.Components[a[r][2]]+P.Components[a[r][3]]}i[r]=a[r]}}if(i.GPSInfoIFDPointer){o=p(e,s,s+i.GPSInfoIFDPointer,w,n);for(r in o){switch(r){case"GPSVersionID":o[r]=o[r][0]+"."+o[r][1]+"."+o[r][2]+"."+o[r][3]}i[r]=o[r]}}return i.thumbnail=m(e,s,l,n),i}function b(e){if("DOMParser"in self){var t=new DataView(e);if(F&&console.log("Got file of length "+e.byteLength),255!=t.getUint8(0)||216!=t.getUint8(1))return F&&console.log("Not a valid JPEG"),!1;for(var n=2,i=e.byteLength,r=new DOMParser;n<i-4;){if("http"==v(t,n,4)){var a=n-1,o=t.getUint16(n-2)-1,s=v(t,a,o),l=s.indexOf("xmpmeta>")+8;s=s.substring(s.indexOf("<x:xmpmeta"),l);var u=s.indexOf("x:xmpmeta")+10;s=s.slice(0,u)+'xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus" xmlns:ext="http://www.gettyimages.com/xsltExtension/1.0" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" '+s.slice(u);var d=r.parseFromString(s,"text/xml");return k(d)}n++}}}function y(e){var t={};if(1==e.nodeType){if(e.attributes.length>0){t["@attributes"]={};for(var n=0;n<e.attributes.length;n++){var i=e.attributes.item(n);t["@attributes"][i.nodeName]=i.nodeValue}}}else if(3==e.nodeType)return e.nodeValue;if(e.hasChildNodes())for(var r=0;r<e.childNodes.length;r++){var a=e.childNodes.item(r),o=a.nodeName;if(null==t[o])t[o]=y(a);else{if(null==t[o].push){var s=t[o];t[o]=[],t[o].push(s)}t[o].push(y(a))}}return t}function k(e){try{var t={};if(e.children.length>0)for(var n=0;n<e.children.length;n++){var i=e.children.item(n),r=i.attributes;for(var a in r){var o=r[a],s=o.nodeName,l=o.nodeValue;void 0!==s&&(t[s]=l)}var u=i.nodeName;if("undefined"==typeof t[u])t[u]=y(i);else{if("undefined"==typeof t[u].push){var d=t[u];t[u]=[],t[u].push(d)}t[u].push(y(i))}}else t=e.textContent;return t}catch(e){console.log(e.message)}}var F=!1,x=function(e){return e instanceof x?e:this instanceof x?void(this.EXIFwrapped=e):new x(e)};"undefined"!=typeof e&&e.exports&&(t=e.exports=x),t.EXIF=x;var S=x.Tags={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"},E=x.TiffTags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},w=x.GPSTags={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"},C=x.IFD1Tags={256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",273:"StripOffsets",274:"Orientation",277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",282:"XResolution",283:"YResolution",284:"PlanarConfiguration",296:"ResolutionUnit",513:"JpegIFOffset",514:"JpegIFByteCount",529:"YCbCrCoefficients",530:"YCbCrSubSampling",531:"YCbCrPositioning",532:"ReferenceBlackWhite"},P=x.StringValues={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",
  3. 255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}},D={120:"caption",110:"credit",25:"keywords",55:"dateCreated",80:"byline",85:"bylineTitle",122:"captionWriter",105:"headline",116:"copyright",15:"category"};x.enableXmp=function(){x.isXmpEnabled=!0},x.disableXmp=function(){x.isXmpEnabled=!1},x.getData=function(e,t){return!((self.Image&&e instanceof self.Image||self.HTMLImageElement&&e instanceof self.HTMLImageElement)&&!e.complete)&&(i(e)?t&&t.call(e):l(e,t),!0)},x.getTag=function(e,t){if(i(e))return e.exifdata[t]},x.getIptcTag=function(e,t){if(i(e))return e.iptcdata[t]},x.getAllTags=function(e){if(!i(e))return{};var t,n=e.exifdata,r={};for(t in n)n.hasOwnProperty(t)&&(r[t]=n[t]);return r},x.getAllIptcTags=function(e){if(!i(e))return{};var t,n=e.iptcdata,r={};for(t in n)n.hasOwnProperty(t)&&(r[t]=n[t]);return r},x.pretty=function(e){if(!i(e))return"";var t,n=e.exifdata,r="";for(t in n)n.hasOwnProperty(t)&&(r+="object"==typeof n[t]?n[t]instanceof Number?t+" : "+n[t]+" ["+n[t].numerator+"/"+n[t].denominator+"]\r\n":t+" : ["+n[t].length+" values]\r\n":t+" : "+n[t]+"\r\n");return r},x.readFromBinaryFile=function(e){return u(e)},r=[],a=function(){return x}.apply(t,r),!(void 0!==a&&(e.exports=a))}).call(this)},function(e,t){e.exports=GravForm}]);
  4. //# sourceMappingURL=form.min.js.map