!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","load-image","canvas-to-blob","./jquery.fileupload-process"],e):e(window.jQuery,window.loadImage)}((function(e,i){"use strict";e.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadImage",fileTypes:"@loadImageFileTypes",maxFileSize:"@loadImageMaxFileSize",noRevoke:"@loadImageNoRevoke",disabled:"@disableImageLoad"},{action:"resizeImage",maxWidth:"@imageMaxWidth",maxHeight:"@imageMaxHeight",minWidth:"@imageMinWidth",minHeight:"@imageMinHeight",crop:"@imageCrop",disabled:"@disableImageResize"},{action:"saveImage",disabled:"@disableImageResize"},{action:"resizeImage",maxWidth:"@previewMaxWidth",maxHeight:"@previewMaxHeight",minWidth:"@previewMinWidth",minHeight:"@previewMinHeight",crop:"@previewCrop",canvas:"@previewAsCanvas",disabled:"@disableImagePreview"},{action:"setImage",name:"preview",disabled:"@disableImagePreview"}),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{loadImageFileTypes:/^image\/(gif|jpeg|png)$/,loadImageMaxFileSize:5e6,imageMaxWidth:1920,imageMaxHeight:1080,imageCrop:!1,disableImageResize:!0,previewMaxWidth:80,previewMaxHeight:80,previewCrop:!1,previewAsCanvas:!0},processActions:{loadImage:function(a,t){if(t.disabled)return a;var n=this,s=a.files[a.index],r=e.Deferred();return("number"===e.type(t.maxFileSize)&&s.size>t.maxFileSize||t.fileTypes&&!t.fileTypes.test(s.type)||!i(s,(function(e){if(!e.src)return r.rejectWith(n,[a]);a.img=e,r.resolveWith(n,[a])}),t))&&r.rejectWith(n,[a]),r.promise()},resizeImage:function(a,t){var n,s=(t=e.extend({canvas:!0},t)).canvas&&a.canvas||a.img;return s&&!t.disabled&&(!(n=i.scale(s,t))||n.width===s.width&&n.height===s.height||(a[n.getContext?"canvas":"img"]=n)),a},saveImage:function(i,a){if(!i.canvas||a.disabled)return i;var t=this,n=i.files[i.index],s=n.name,r=e.Deferred(),m=function(e){e.name||(n.type===e.type?e.name=n.name:n.name&&(e.name=n.name.replace(/\..+$/,"."+e.type.substr(6)))),i.files[i.index]=e,r.resolveWith(t,[i])};if(i.canvas.mozGetAsFile)m(i.canvas.mozGetAsFile(/^image\/(jpeg|png)$/.test(n.type)&&s||(s&&s.replace(/\..+$/,"")||"blob")+".png",n.type));else{if(!i.canvas.toBlob)return i;i.canvas.toBlob(m,n.type)}return r.promise()},setImage:function(e,i){var a=e.canvas||e.img;return a&&!i.disabled&&(e.files[e.index][i.name]=a),e}}})}));