!function($){"use strict";$.fn.fileuploader=function(q){return this.each(function(t,r){var s=$(r),p=null,o=null,l=null,sl=[],n=$.extend(!0,{},$.fn.fileuploader.defaults,q),f={init:function(){return s.closest(".fileuploader").length||s.wrap('
'),p=s.closest(".fileuploader"),f.set("attrOpts"),f.isSupported()?(!n.beforeRender||!$.isFunction(n.beforeRender)||!1!==n.beforeRender(p,s))&&(f.redesign(),n.files&&f.files.append(n.files),f.rendered=!0,n.afterRender&&$.isFunction(n.afterRender)&&n.afterRender(l,p,o,s),void(f.disabled||f.bindUnbindEvents(!0))):(n.onSupportError&&$.isFunction(n.onSupportError)&&n.onSupportError(p,s),!1)},bindUnbindEvents:function(e){e&&f.bindUnbindEvents(!1),s[e?"on":"off"](f._assets.getAllEvents(),f.onEvent),n.changeInput&&o!==s&&o[e?"on":"off"]("click",f.clickHandler),n.dragDrop&&n.dragDrop.container.length&&(n.dragDrop.container[e?"on":"off"]("drag dragstart dragend dragover dragenter dragleave drop",function(e){e.preventDefault()}),n.dragDrop.container[e?"on":"off"]("drop",f.dragDrop.onDrop),n.dragDrop.container[e?"on":"off"]("dragover",f.dragDrop.onDragEnter),n.dragDrop.container[e?"on":"off"]("dragleave",f.dragDrop.onDragLeave)),f.isUploadMode()&&n.clipboardPaste&&$(window)[e?"on":"off"]("paste",f.clipboard.paste),n.sorter&&n.thumbnails&&n.thumbnails._selectors.sorter&&f.sorter[e?"init":"destroy"](),s.closest("form")[e?"on":"off"]("reset",f.reset)},redesign:function(){if(o=s,n.theme&&p.addClass("fileuploader-theme-"+n.theme),n.changeInput){switch((typeof n.changeInput).toLowerCase()){case"boolean":o=$('
'+f._assets.textParse(n.captions.feedback)+'
'+f._assets.textParse(n.captions.button)+"
");break;case"string":" "!=n.changeInput&&(o=$(f._assets.textParse(n.changeInput,n)));break;case"object":o=$(n.changeInput);break;case"function":o=$(n.changeInput(s,p,n,f._assets.textParse))}s.after(o),s.css({position:"absolute","z-index":"-9999",height:"0",width:"0",padding:"0",margin:"0","line-height":"0",outline:"0",border:"0",opacity:"0"})}n.thumbnails&&f.thumbnails.create(),n.dragDrop&&(n.dragDrop="object"!=typeof n.dragDrop?{container:null}:n.dragDrop,n.dragDrop.container=n.dragDrop.container?$(n.dragDrop.container):o)},clickHandler:function(e){e.preventDefault(),f.clipboard._timer?f.clipboard.clean():s.click()},onEvent:function(e){switch(e.type){case"focus":p&&p.addClass("fileuploader-focused");break;case"blur":p&&p.removeClass("fileuploader-focused");break;case"change":f.onChange.call(this)}n.listeners&&$.isFunction(n.listeners[e.type])&&n.listeners[e.type].call(s,p)},set:function(e,t){switch(e){case"attrOpts":for(var i=["limit","maxSize","fileMaxSize","extensions","changeInput","theme","addMore","listInput","files"],r=0;r').insertBefore(s)),"string"==typeof n.listInput&&0==$(n.listInput).length&&(n.listInput=$('').insertBefore(s)),f.set("disabled",f.disabled),!n.fileMaxSize&&n.maxSize&&(n.fileMaxSize=n.maxSize);break;case"disabled":f.disabled=t,p[f.disabled?"addClass":"removeClass"]("fileuploader-disabled"),s[f.disabled?"attr":"removeAttr"]("disabled","disabled"),f.rendered&&f.bindUnbindEvents(!t);break;case"feedback":t||(t=f._assets.textParse(0'),s,!0);f.bindUnbindEvents(!1),s.after(s=l).remove(),f.bindUnbindEvents(!0);break;case"prevInput":0'),s);f.bindUnbindEvents(!1),0',t.progressBar=f.isUploadMode()?'
':"",t.html=$(f._assets.textParse(t.appended&&n.thumbnails.item2?n.thumbnails.item2:n.thumbnails.item,t)),t.progressBar=t.html.find(".fileuploader-progressbar"),t.html.addClass("file-type-"+(t.format?t.format:"no")+" file-ext-"+(t.extension?t.extension:"no")),e?e.replaceWith(t.html):t.html[n.thumbnails.itemPrepend?"prependTo":"appendTo"](l),f.thumbnails.renderThumbnail(t),t.renderThumbnail=function(e){e&&t.popup&&t.popup.close&&(t.popup.close(),t.popup={open:t.popup.open}),f.thumbnails.renderThumbnail(t,!0,e)},n.thumbnails.popup&&(t.popup={open:function(){f.thumbnails.popup(t)}}),null!=n.thumbnails.onItemShow&&$.isFunction(n.thumbnails.onItemShow)&&n.thumbnails.onItemShow(t,l,p,o,s)},generateFileIcon:function(e,t){var o='
'+(t||"")+"
",i=f._assets.textToColor(t);i&&(f._assets.isBrightColor(i)&&(o=o.replace("${class}"," is-bright-color")),o=o.replace("${style}","background-color: "+i));return o.replace("${style}","").replace("${class}","")},renderThumbnail:function(d,e,t){var u=d.html.find(".fileuploader-item-image"),i=d.data&&d.data.readerSkip,c=function(e){var t=$(e);u.removeClass("fileuploader-no-thumbnail fileuploader-loading").html(t),t.is("img")&&t.attr("draggable","false").on("load error",function(e){"error"==e.type&&h(!0),m(),null!=n.thumbnails.onImageLoaded&&$.isFunction(n.thumbnails.onImageLoaded)&&n.thumbnails.onImageLoaded(d,l,p,o,s)}),t.is("canvas")&&null!=n.thumbnails.onImageLoaded&&$.isFunction(n.thumbnails.onImageLoaded)&&n.thumbnails.onImageLoaded(d,l,p,o,s)},h=function(e){u.addClass("fileuploader-no-thumbnail"),u.removeClass("fileuploader-loading").html(d.icon),e&&null!=n.thumbnails.onImageLoaded&&$.isFunction(n.thumbnails.onImageLoaded)&&n.thumbnails.onImageLoaded(d,l,p,o,s)},m=function(){var e=0;if(d&&-1')};return"string"==typeof t||"object"==typeof t?r(t):f.files.read(d,function(){d.reader.node&&n.thumbnails.popup&&d.html.addClass("file-has-popup"),d.reader.node&&(d.reader.frame||"img"==d.reader.node.nodeName.toLowerCase())?r(d.reader.frame||d.reader.src,!0):(h("image"==d.format),m())},null,t,!0)}h()}else m()},popup:function(d,r){if(!f.locked&&n.thumbnails.popup&&n.thumbnails._selectors.popup){var a=$(n.thumbnails.popup.container),u=a.find(".fileuploader-popup"),e=function(){var e=d.popup.html||$(f._assets.textParse(n.thumbnails.popup.template,d)),t=d.popup.html!==e,i=function(e){var t=e.which||e.keyCode;27==t&&d.popup&&d.popup.close&&d.popup.close(),37!=t&&39!=t||!n.thumbnails.popup.arrows||d.popup.move(37==t?"prev":"next")};u.removeClass("loading"),u.children(n.thumbnails._selectors.popup).length&&($.each(f._itFl,function(e,t){t!=d&&t.popup&&t.popup.close&&t.popup.close(r)}),u.find(n.thumbnails._selectors.popup).remove()),e.show().appendTo(u),d.popup.html=e,d.popup.move=function(e){var t=f._itFl.indexOf(d),o=null,i=!1;if("prev"==e)for(var r=t;0<=r;r--){if((a=f._itFl[r])!=d&&a.popup&&a.html.hasClass("file-has-popup")){o=a;break}0!=r||o||i||!n.thumbnails.popup.loop||(r=f._itFl.length,i=!0)}else for(r=t;r')).find(".reader-node").html(d.reader.node),d.reader.node.controls=!0,d.reader.node.currentTime=0,d.reader.node.play&&d.reader.node.play()):t&&e.find(".fileuploader-popup-node").html('
'+d.icon+"
"),$(window).on("keyup",i),a.css({overflow:"hidden",width:a.innerWidth()}),d.popup.html.find('[data-action="prev"], [data-action="next"]').removeAttr("style"),d.popup.html[1!=f._itFl.length&&n.thumbnails.popup.arrows?"addClass":"removeClass"]("fileuploader-popup-has-arrows"),n.thumbnails.popup.loop||(0==f._itFl.indexOf(d)&&d.popup.html.find('[data-action="prev"]').hide(),f._itFl.indexOf(d)==f._itFl.length-1&&d.popup.html.find('[data-action="next"]').hide()),f.editor.zoom(d),d.editor&&(d.popup.editor||(d.popup.editor={}),f.editor.rotate(d,d.popup.editor.rotation||d.editor.rotation||0,!0),d.popup.editor&&d.popup.editor.cropper&&(d.popup.editor.cropper.hide(!0),setTimeout(function(){f.editor.crop(d,d.editor.crop?$.extend({},d.editor.crop):d.popup.editor.cropper.setDefaultData())},100))),d.popup.html.on("click",'[data-action="prev"]',function(e){d.popup.move("prev")}).on("click",'[data-action="next"]',function(e){d.popup.move("next")}).on("click",'[data-action="crop"]',function(e){d.editor&&d.editor.cropper()}).on("click",'[data-action="rotate-cw"]',function(e){d.editor&&d.editor.rotate()}).on("click",'[data-action="zoom-in"]',function(e){d.popup.zoomer&&d.popup.zoomer.zoomIn()}).on("click",'[data-action="zoom-out"]',function(e){d.popup.zoomer&&d.popup.zoomer.zoomOut()}),n.thumbnails.popup.onShow&&$.isFunction(n.thumbnails.popup.onShow)&&n.thumbnails.popup.onShow(d,l,p,o,s)};0==u.length&&(u=$('
').appendTo(a)),u.fadeIn(400).addClass("loading"),-1<["image","video","audio","astext"].indexOf(d.format)&&!d.popup.html?f.files.read(d,e):e()}}},editor:{rotate:function(e,t,o){if(!(e.popup&&e.popup.html&&$("html").find(e.popup.html).length)){var i=e.editor.rotation||0,n=t||i+90;return 360<=n&&(n=0),e.popup.editor&&(e.popup.editor.rotation=n),e.editor.rotation=n}if(e.reader.node){if(e.popup.editor.isAnimating)return;e.popup.editor.isAnimating=!0;var r=e.popup.html.find(".fileuploader-popup-node").find(".reader-node"),p=r.find("> img"),a={rotation:i=e.popup.editor.rotation||0,scale:e.popup.editor.scale||1};e.popup.editor.cropper&&e.popup.editor.cropper.$template.hide(),e.popup.editor.rotation=o?t:i+90,e.popup.editor.scale=(r.height()/p[-1<[90,270].indexOf(e.popup.editor.rotation)?"width":"height"]()).toFixed(3),p.height()*e.popup.editor.scale>r.width()&&-1<[90,270].indexOf(e.popup.editor.rotation)&&(e.popup.editor.scale=r.height()/p.width()),1 img"),l=$('
'),o=l.find(".fileuploader-cropper-area");b.popup.editor.cropper={$imageEl:t,$template:l,$editor:o,isCropping:!1,crop:e||null,init:function(o){var i=b.popup.editor.cropper,e=i.$imageEl.position(),t=i.$imageEl[0].getBoundingClientRect().width,r=i.$imageEl[0].getBoundingClientRect().height,a=b.popup.editor.rotation&&-1<[90,270].indexOf(b.popup.editor.rotation)?b.popup.editor.scale:1;if(i.hide(),i.crop||i.setDefaultData(),0==t||0==r)return i.hide(!0);i.isCropping||(i.$imageEl.clone().appendTo(i.$template.find(".area-image")),i.$imageEl.parent().append(l)),i.$template.hide().css({left:e.left,top:e.top,width:t,height:r}).fadeIn(150),i.$editor.hide(),clearTimeout(i._editorAnimationTimeout),i._editorAnimationTimeout=setTimeout(function(){if(delete i._editorAnimationTimeout,i.$editor.fadeIn(250),b.editor.crop&&$.isPlainObject(o)&&(i.resize(),i.crop.left=i.crop.left*i.crop.cfWidth*a,i.crop.width=i.crop.width*i.crop.cfWidth*a,i.crop.top=i.crop.top*i.crop.cfHeight*a,i.crop.height=i.crop.height*i.crop.cfHeight*a),n.editor.cropper&&(n.editor.cropper.maxWidth||n.editor.cropper.maxHeight)&&(n.editor.cropper.maxWidth&&(i.crop.width=Math.min(n.editor.cropper.maxWidth*i.crop.cfWidth,i.crop.width)),n.editor.cropper.maxHeight&&(i.crop.height=Math.min(n.editor.cropper.maxHeight*i.crop.cfHeight,i.crop.height)),b.editor.crop&&"rotation"!=o||"resize"==o||(i.crop.left=(i.$template.width()-i.crop.width)/2,i.crop.top=(i.$template.height()-i.crop.height)/2)),(!b.editor.crop||"rotation"==o)&&n.editor.cropper&&n.editor.cropper.ratio&&"resize"!=o){var e=n.editor.cropper.ratio,t=f._assets.ratioToPx(i.crop.width,i.crop.height,e);t&&(i.crop.width=Math.min(i.crop.width,t[0]),i.crop.left=(i.$template.width()-i.crop.width)/2,i.crop.height=Math.min(i.crop.height,t[1]),i.crop.top=(i.$template.height()-i.crop.height)/2)}i.drawPlaceHolder(i.crop)},400),n.editor.cropper&&n.editor.cropper.showGrid&&i.$editor.addClass("has-grid"),i.$imageEl.attr("draggable","false"),i.$template.on("mousedown touchstart",i.mousedown),$(window).on("resize",i.resize),i.isCropping=!0,b.popup.editor.hasChanges=!0},setDefaultData:function(){var e=b.popup.editor.cropper,t=e.$imageEl,o=t.width(),i=t.height(),n=b.popup.editor.rotation&&-1<[90,270].indexOf(b.popup.editor.rotation),r=b.popup.editor.scale||1;return e.crop={left:0,top:0,width:n?i*r:o,height:n?o*r:i,cfWidth:o/b.reader.width,cfHeight:i/b.reader.height},null},hide:function(e){var t=b.popup.editor.cropper;e&&(t.$template.hide(),t.$editor.hide()),t.$imageEl.attr("draggable",""),t.$template.off("mousedown touchstart",t.mousedown),$(window).off("resize",t.resize)},resize:function(e){var o=b.popup.editor.cropper,i=o.$imageEl;0o.$template.width()&&(r=o.$template.width()-o.crop.width),r<0&&(r=0),a+o.crop.height>o.$template.height()&&(a=o.$template.height()-o.crop.height),a<0&&(a=0),o.crop.left=r,o.crop.top=a}if(o.isResizing){var l,s=o.pointData.el.attr("class").substr("point point-".length),p=o.crop.left+o.crop.width,d=o.crop.top+o.crop.height,u=(n.editor.cropper&&n.editor.cropper.minWidth||0)*o.crop.cfWidth,c=(n.editor.cropper&&n.editor.cropper.minHeight||0)*o.crop.cfHeight,h=(n.editor.cropper&&n.editor.cropper.maxWidth)*o.crop.cfWidth,m=(n.editor.cropper&&n.editor.cropper.maxHeight)*o.crop.cfHeight,g=n.editor.cropper?n.editor.cropper.ratio:null;if(u>o.$template.width()&&(u=o.$template.width()),c>o.$template.height()&&(c=o.$template.height()),h>o.$template.width()&&(h=o.$template.width()),m>o.$template.height()&&(m=o.$template.height()),("a"==s||"b"==s||"c"==s)&&!l&&(o.crop.top=i.y,o.crop.top<0&&(o.crop.top=0),o.crop.height=d-o.crop.top,o.crop.top>o.crop.top+o.crop.height&&(o.crop.top=d,o.crop.height=0),o.crop.heightm&&(o.crop.top=d-m,o.crop.height=m),(l=g?f._assets.ratioToPx(o.crop.width,o.crop.height,g):null)&&(o.crop.width=l[0],"a"!=s&&"b"!=s||(o.crop.left=Math.max(0,o.pointData.left+(o.pointData.width-o.crop.width)/("b"==s?2:1))),o.crop.left+o.crop.width>o.$template.width()))){var v=o.$template.width()-o.crop.left;o.crop.width=v,o.crop.height=v/l[2]*l[3],o.crop.top=d-o.crop.height}if(("e"==s||"f"==s||"g"==s)&&!l&&(o.crop.height=i.y-o.crop.top,o.crop.height+o.crop.top>o.$template.height()&&(o.crop.height=o.$template.height()-o.crop.top),o.crop.heightm&&(o.crop.height=m),(l=g?f._assets.ratioToPx(o.crop.width,o.crop.height,g):null)&&(o.crop.width=l[0],"f"!=s&&"g"!=s||(o.crop.left=Math.max(0,o.pointData.left+(o.pointData.width-o.crop.width)/("f"==s?2:1))),o.crop.left+o.crop.width>o.$template.width()))){v=o.$template.width()-o.crop.left;o.crop.width=v,o.crop.height=v/l[2]*l[3]}if(("c"==s||"d"==s||"e"==s)&&!l&&(o.crop.width=i.x-o.crop.left,o.crop.width+o.crop.left>o.$template.width()&&(o.crop.width=o.$template.width()-o.crop.left),o.crop.widthh&&(o.crop.width=h),(l=g?f._assets.ratioToPx(o.crop.width,o.crop.height,g):null)&&(o.crop.height=l[1],"c"!=s&&"d"!=s||(o.crop.top=Math.max(0,o.pointData.top+(o.pointData.height-o.crop.height)/("d"==s?2:1))),o.crop.top+o.crop.height>o.$template.height()))){var w=o.$template.height()-o.crop.top;o.crop.height=w,o.crop.width=w/l[3]*l[2]}if(("a"==s||"g"==s||"h"==s)&&!l&&(o.crop.left=i.x,o.crop.left>o.$template.width()&&(o.crop.left=o.$template.width()),o.crop.left<0&&(o.crop.left=0),o.crop.width=p-o.crop.left,o.crop.left>o.crop.left+o.crop.width&&(o.crop.left=p,o.crop.width=0),o.crop.widthh&&(o.crop.left=p-h,o.crop.width=h),(l=g?f._assets.ratioToPx(o.crop.width,o.crop.height,g):null)&&(o.crop.height=l[1],"a"!=s&&"h"!=s||(o.crop.top=Math.max(0,o.pointData.top+(o.pointData.height-o.crop.height)/("h"==s?2:1))),o.crop.top+o.crop.height>o.$template.height()))){w=o.$template.height()-o.crop.top;o.crop.height=w,o.crop.width=w/l[3]*l[2],o.crop.left=p-o.crop.width}}o.drawPlaceHolder(o.crop)},mouseup:function(e){var t=b.popup.editor.cropper;0!=t.$editor.width()&&0!=t.$editor.height()||t.init(t.setDefaultData()),delete t.isTouchLongPress,delete t.isMoving,delete t.isResizing,t.$editor.removeClass("moving show-info"),$("body").css({"-webkit-user-select":"","-moz-user-select":"","-ms-user-select":"","user-select":""}),$(window).off("mousemove touchmove",t.mousemove),$(window).off("mouseup touchend",t.mouseup)}},b.popup.editor.cropper.init()}},resize:function(e,t,o,i,n,r){var a=t.getContext("2d"),l=(o=!o&&i?i*e.width/e.height:o,i=!i&&o?o*e.height/e.width:i,e.width/e.height),s=1<=l?o:i*l,p=l<1?i:o/l;r&&sf.width&&(v=f.width),w>f.height&&(w=f.height),h.drawImage(f,0,0,v,w,0,0,e.width/g,e.height/g),m=g,d--}v=e.width/m,w=e.height/m;v>f.width&&(v=f.width),w>f.height&&(w=f.height),a.drawImage(f,0,0,v,w,0,0,s,p),f=h=null}a=null},zoom:function(s){if(s.popup&&s.popup.html&&$("html").find(s.popup.html).length){if(!s.popup.zoomer){var e=s.popup.html,l=e.find(".fileuploader-popup-node"),p=l.find(".reader-node"),d=p.find("> img").attr("draggable","false").attr("ondragstart","return false;");s.popup.zoomer={html:e.find(".fileuploader-popup-zoomer"),isActive:"image"==s.format&&s.reader.node&&n.thumbnails.popup.zoomer,scale:100,zoom:100,init:function(){var e=this;if(!e.isActive||f._assets.isIE()||f._assets.isMobile())return e.html.hide()&&p.addClass("has-node-centered");e.hide(),e.resize(),$(window).on("resize",e.resize),$(window).on("keyup keydown",e.keyPress),e.html.find("input").on("input change",e.range),p.on("mousedown touchstart",e.mousedown),l.on("mousewheel DOMMouseScroll",e.scroll)},hide:function(){var e=this;$(window).off("resize",e.resize),$(window).off("keyup keydown",e.keyPress),e.html.find("input").off("input change",e.range),p.off("mousedown",e.mousedown),l.off("mousewheel DOMMouseScroll",e.scroll)},center:function(e){var t=this,o=0,i=0;i=e?(o=t.left,i=t.top,o-=(l.width()/2-t.left)*(p.width()/e[0]-1),i-=(l.height()/2-t.top)*(p.height()/e[1]-1),p.width()<=l.width()&&(o=Math.round((l.width()-p.width())/2)),p.height()<=l.height()&&(i=Math.round((l.height()-p.height())/2)),p.width()>l.width()&&(0l.height()&&(0l.width()?(0this.scale},getImageSize:function(){return{width:d.prop("naturalWidth"),height:d.prop("naturalHeight")}},getImageScale:function(){return Math.round(100/(d.prop("naturalWidth")/d.width()))}}}s.popup.zoomer.init()}},save:function(w,b,x,_,y){var e=w.popup&&w.popup.html&&$("html").find(w.popup.html).length,t=new Image,i=function(){if(w.reader.node){var t=document.createElement("canvas"),i=t.getContext("2d"),e=[0,180];if(t.width=w.reader.width,t.height=w.reader.height,i.drawImage(this,0,0,w.reader.width,w.reader.height),void 0!==w.editor.rotation){w.editor.rotation=w.editor.rotation||0,t.width=-1o.offset().left&&i.xo.offset().top&&i.ya.width()&&(d=a.width()-o.xItem),d<0-o.xItem&&(d=0-o.xItem),u+o.yItem>a.height()&&(u=a.height()-o.yItem),u<0-o.yItem&&(u=0-o.yItem),i.html.addClass("sorting").css({position:"fixed",left:d,top:u,width:f.sorter.sort.width,height:f.sorter.sort.height}),l.find(o.placeholder).length||i.html.after(o.placeholder),o.placeholder.css({width:f.sorter.sort.width,height:f.sorter.sort.height});var c=f.sorter.findItemAtPos({x:d+o.xItem+s.left,y:u+o.yItem+s.top});if(c){var h=o.placeholder.offset().left!=c.offset().left,m=o.placeholder.offset().top!=c.offset().top;if(f.sorter.sort.lastHover&&f.sorter.sort.lastHover.el==c[0]){if(m&&"before"==f.sorter.sort.lastHover.direction&&p.yf.sorter.sort.lastHover.y)return;if(h&&"before"==f.sorter.sort.lastHover.direction&&p.xf.sorter.sort.lastHover.x)return}var g=r.index(i.html),v=r.index(c)/g,">"),m()},a.onerror=function(){m(),d.reader={read:d.reader.read}},h?a.readAsText(d.file):$.ajax({url:d.file,success:function(e){a.onload({target:{result:e}})},error:function(){a.onerror()}});else if("image"==d.format||c){a.onload=function(e){var s=new Image,t=function(){d.data&&d.data.readerCrossOrigin&&s.setAttribute("crossOrigin",d.data.readerCrossOrigin),s.src=e.target.result+(!d.data.readerForce&&!i||h||c||-1!=e.target.result.indexOf("data:image")?"":(-1==e.target.result.indexOf("?")?"?":"&")+"d="+Date.now()),s.onload=function(){if(d.reader.exifOrientation){var e=document.createElement("canvas"),t=e.getContext("2d"),o=s,i=d.reader.exifOrientation,n=[0,180];e.width=o.naturalWidth,e.height=o.naturalHeight,t.drawImage(o,0,0),e.width=-1n.limit)return a[1]=f._assets.textParse(n.captions.errors.filesLimit),a[3]=!0,a;if(null!=n.maxSize&&e){var d=0;if($.each(f._itFl,function(e,t){d+=t.size}),d-=i.size,$.each(r,function(e,t){d+=t.size}),d>Math.round(1e6*n.maxSize))return a[1]=f._assets.textParse(n.captions.errors.filesSizeAll),a[3]=!0,a}if(null!=n.onFilesCheck&&$.isFunction(n.onFilesCheck)&&e&&!1===n.onFilesCheck(r,n,l,p,o,s))return a[3]=!0,a;if(null!=n.extensions&&-1==$.inArray(i.extension,n.extensions)&&!n.extensions.filter(function(e){return i.type.length&&(-11e6*n.fileMaxSize)return a[1]=f._assets.textParse(n.captions.errors.fileSize,i),a;if(4096==i.size&&""==i.type)return a[1]=f._assets.textParse(n.captions.errors.folderUpload,i),a;if(!n.skipFileNameCheck){d=!1;if($.each(f._itFl,function(e,t){if(t!=i&&1==t.choosed&&t.file&&t.name==i.name)return d=!0,t.file.size!=i.size||t.file.type!=i.type||i.file.lastModified&&t.file.lastModified&&t.file.lastModified!=i.file.lastModified||!(1>2*t++&255).toString(16)).slice(-2));return i},isBrightColor:function(e){var t,o,i;return 194<((i=(t=e)&&t.constructor==Array&&3==t.length?t:(o=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(t))?[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])]:(o=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(t))?[2.55*parseFloat(o[1]),2.55*parseFloat(o[2]),2.55*parseFloat(o[3])]:(o=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(t))?[parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16)]:(o=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(t))?[parseInt(o[1]+o[1],16),parseInt(o[2]+o[2],16),parseInt(o[3]+o[3],16)]:"undefined"!=typeof colors?colors[$.trim(t).toLowerCase()]:null)?.2126*i[0]+.7152*i[1]+.0722*i[2]:null)},isIE:function(){return-1
    ',boxAppendTo:null,item:'
  • ${image}
    ${name}
    ${size2}
    ${progressBar}
  • ',item2:'
  • ',popup:{container:"body",loop:!0,arrows:!0,zoomer:!0,template:function(e){return'
    ${reader.node}
    • ${captions.name}:
      ${name}
    • ${captions.type}:
      ${extension.toUpperCase()}
    • ${captions.size}:
      ${size2}
    • '+(e.reader&&e.reader.width?"
    • ${captions.dimensions}:
      ${reader.width}x${reader.height}px
    • ":"")+(e.reader&&e.reader.duration?"
    • ${captions.duration}:
      ${reader.duration2}
    • ":"")+'
    '},onShow:function(t){t.popup.html.on("click",'[data-action="remove"]',function(e){t.popup.close(),t.remove()}).on("click",'[data-action="cancel"]',function(e){t.popup.close()}).on("click",'[data-action="save"]',function(e){t.editor&&t.editor.save(),t.popup.close&&t.popup.close()})},onHide:null},itemPrepend:!1,removeConfirmation:!0,startImageRenderer:!0,synchronImages:!0,useObjectUrl:!1,canvasImage:!0,videoThumbnail:!0,exif:!0,touchDelay:0,_selectors:{list:".fileuploader-items-list",item:".fileuploader-item",start:".fileuploader-action-start",retry:".fileuploader-action-retry",remove:".fileuploader-action-remove",sorter:".fileuploader-action-sort",rotate:".fileuploader-action-rotate",popup:".fileuploader-popup-preview",popup_open:".fileuploader-action-popup"},beforeShow:null,onItemShow:null,onItemRemove:function(e){e.children().animate({opacity:0},200,function(){setTimeout(function(){e.slideUp(200,function(){e.remove()})},100)})},onImageLoaded:null},editor:!1,sorter:!1,reader:{thumbnailTimeout:5e3,timeout:12e3},files:null,upload:null,dragDrop:!0,addMore:!1,skipFileNameCheck:!1,clipboardPaste:!0,listInput:!0,enableApi:!1,listeners:null,onSupportError:null,beforeRender:null,afterRender:null,beforeSelect:null,onFilesCheck:null,onFileRead:null,onSelect:null,afterSelect:null,onListInput:null,onRemove:null,onEmpty:null,dialogs:{alert:function(e){return alert(e)},confirm:function(e,t){confirm(e)&&t()}},captions:{button:function(e){return"Browse "+(1==e.limit?"file":"files")},feedback:function(e){return"Choose "+(1==e.limit?"file":"files")+" to upload"},feedback2:function(e){return e.length+" "+(1 Pasting a file, click here to cancel.',removeConfirmation:"Are you sure you want to remove this file?",errors:{filesLimit:"Only ${limit} files are allowed to be uploaded.",filesType:"Only ${extensions} files are allowed to be uploaded.",fileSize:"${name} is too large! Please choose a file up to ${fileMaxSize}MB.",filesSizeAll:"Files that you chose are too large! Please upload files up to ${maxSize} MB.",fileName:"File with the name ${name} is already selected.",folderUpload:"You are not allowed to upload folders."}}}}(jQuery);