/*! * bootstrap-fileinput v4.4.3 * http://plugins.krajee.com/file-input * * Author: Kartik Visweswaran * Copyright: 2014 - 2017, Kartik Visweswaran, Krajee.com * * Licensed under the BSD 3-Clause * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md */!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(window.jQuery)}(function(e){"use strict";e.fn.fileinputLocales={},e.fn.fileinputThemes={},String.prototype.setTokens=function(e){var i,t,a=this.toString();for(i in e)e.hasOwnProperty(i)&&(t=new RegExp("{"+i+"}","g"),a=a.replace(t,e[i]));return a};var i,t;i={FRAMES:".kv-preview-thumb",SORT_CSS:"file-sortable",STYLE_SETTING:'style="width:{width};height:{height};"',OBJECT_PARAMS:'\n\n\n\n\n\n',DEFAULT_PREVIEW:'
\n{previewFileIcon}\n
',MODAL_ID:"kvFileinputModal",MODAL_EVENTS:["show","shown","hide","hidden","loaded"],objUrl:window.URL||window.webkitURL,compare:function(e,i,t){return void 0!==e&&(t?e===i:e.match(i))},isIE:function(e){if("Microsoft Internet Explorer"!==navigator.appName)return!1;if(10===e)return new RegExp("msie\\s"+e,"i").test(navigator.userAgent);var i,t=document.createElement("div");return t.innerHTML="",i=t.getElementsByTagName("i").length,document.body.appendChild(t),t.parentNode.removeChild(t),i},initModal:function(i){var t=e("body");t.length&&i.appendTo(t)},isEmpty:function(i,t){return void 0===i||null===i||0===i.length||t&&""===e.trim(i)},isArray:function(e){return Array.isArray(e)||"[object Array]"===Object.prototype.toString.call(e)},ifSet:function(e,i,t){return t=t||"",i&&"object"==typeof i&&e in i?i[e]:t},cleanArray:function(e){return e instanceof Array||(e=[]),e.filter(function(e){return void 0!==e&&null!==e})},spliceArray:function(e,i){var t,a=0,n=[];if(!(e instanceof Array))return[];for(t=0;t=0?atob(e.split(",")[1]):decodeURIComponent(e.split(",")[1]),a=new ArrayBuffer(t.length),n=new Uint8Array(a),r=0;r/g,">").replace(/"/g,""").replace(/'/g,"'")},replaceTags:function(i,t){var a=i;return t?(e.each(t,function(e,i){"function"==typeof i&&(i=i()),a=a.split(e).join(i)}),a):a},cleanMemory:function(e){var t=e.is("img")?e.attr("src"):e.find("source").attr("src");i.objUrl.revokeObjectURL(t)},findFileName:function(e){var i=e.lastIndexOf("/");return-1===i&&(i=e.lastIndexOf("\\")),e.split(e.substring(i,i+1)).pop()},checkFullScreen:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},toggleFullScreen:function(e){var t=document,a=t.documentElement;a&&e&&!i.checkFullScreen()?a.requestFullscreen?a.requestFullscreen():a.msRequestFullscreen?a.msRequestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.webkitRequestFullscreen&&a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):t.exitFullscreen?t.exitFullscreen():t.msExitFullscreen?t.msExitFullscreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitExitFullscreen&&t.webkitExitFullscreen()},moveArray:function(e,i,t){if(t>=e.length)for(var a=t-e.length;a--+1;)e.push(void 0);return e.splice(t,0,e.splice(i,1)[0]),e},cleanZoomCache:function(e){var i=e.closest(".kv-zoom-cache-theme");i.length||(i=e.closest(".kv-zoom-cache")),i.remove()},setOrientation:function(e,i){var t,a,n,r=new DataView(e),o=0,l=1;if(!(65496!==r.getUint16(o)||e.length<2)){for(o+=2,t=r.byteLength;t-2>o;)switch(a=r.getUint16(o),o+=2,a){case 65505:n=r.getUint16(o),t=n-o,o+=2;break;case 274:l=r.getUint16(o+6,!1),t=0}i&&i(l)}},validateOrientation:function(e,t){if(window.FileReader&&window.DataView){var a,n=new FileReader;n.onloadend=function(){a=n.result,i.setOrientation(a,t)},n.readAsArrayBuffer(e)}},adjustOrientedImage:function(e,i){var t,a,n;if(e.hasClass("is-portrait-gt4")){if(i)return void e.css({width:e.parent().height()});e.css({height:"auto",width:e.height()}),t=e.parent().offset().top,a=e.offset().top,n=t-a,e.css("margin-top",n)}}},t=function(t,a){var n=this;n.$element=e(t),n._validate()&&(n.isPreviewable=i.hasFileAPISupport(),n.isIE9=i.isIE(9),n.isIE10=i.isIE(10),n.isPreviewable||n.isIE9?(n._init(a),n._listen()):n.$element.removeClass("file-loading"))},t.prototype={constructor:t,_cleanup:function(){var e=this;e.reader=null,e.formdata={},e.uploadCount=0,e.uploadStatus={},e.uploadLog=[],e.uploadAsyncCount=0,e.loadedImages=[],e.totalImagesCount=0,e.ajaxRequests=[],e.clearStack(),e.fileInputCleared=!1,e.fileBatchCompleted=!0,e.isPreviewable||(e.showPreview=!1),e.isError=!1,e.ajaxAborted=!1,e.cancelling=!1},_init:function(t){var a,n,r,o=this,l=o.$element;o.options=t,e.each(t,function(e,t){switch(e){case"minFileCount":case"maxFileCount":case"minFileSize":case"maxFileSize":case"maxFilePreviewSize":case"resizeImageQuality":case"resizeIfSizeMoreThan":case"progressUploadThreshold":case"initialPreviewCount":case"zoomModalHeight":case"minImageHeight":case"maxImageHeight":case"minImageWidth":case"maxImageWidth":o[e]=i.getNum(t);break;default:o[e]=t}}),o.rtl&&(r=o.previewZoomButtonIcons.prev,o.previewZoomButtonIcons.prev=o.previewZoomButtonIcons.next,o.previewZoomButtonIcons.next=r),o._cleanup(),o.$form=l.closest("form"),o._initTemplateDefaults(),o.uploadFileAttr=i.isEmpty(l.attr("name"))?"file_data":l.attr("name"),n=o._getLayoutTemplate("progress"),o.progressTemplate=n.replace("{class}",o.progressClass),o.progressCompleteTemplate=n.replace("{class}",o.progressCompleteClass),o.progressErrorTemplate=n.replace("{class}",o.progressErrorClass),o.dropZoneEnabled=i.hasDragDropSupport()&&o.dropZoneEnabled,o.isDisabled=l.attr("disabled")||l.attr("readonly"),o.isDisabled&&l.attr("disabled",!0),o.isUploadable=i.hasFileUploadSupport()&&!i.isEmpty(o.uploadUrl),o.isClickable=o.browseOnZoneClick&&o.showPreview&&(o.isUploadable&&o.dropZoneEnabled||!i.isEmpty(o.defaultPreviewContent)),o.slug="function"==typeof t.slugCallback?t.slugCallback:o._slugDefault,o.mainTemplate=o.showCaption?o._getLayoutTemplate("main1"):o._getLayoutTemplate("main2"),o.captionTemplate=o._getLayoutTemplate("caption"),o.previewGenericTemplate=o._getPreviewTemplate("generic"),o.resizeImage&&(o.maxImageWidth||o.maxImageHeight)&&(o.imageCanvas=document.createElement("canvas"),o.imageCanvasContext=o.imageCanvas.getContext("2d")),i.isEmpty(l.attr("id"))&&l.attr("id",i.uniqId()),o.namespace=".fileinput_"+l.attr("id").replace(/-/g,"_"),void 0===o.$container?o.$container=o._createContainer():o._refreshContainer(),a=o.$container,o.$dropZone=a.find(".file-drop-zone"),o.$progress=a.find(".kv-upload-progress"),o.$btnUpload=a.find(".fileinput-upload"),o.$captionContainer=i.getElement(t,"elCaptionContainer",a.find(".file-caption")),o.$caption=i.getElement(t,"elCaptionText",a.find(".file-caption-name")),o.$previewContainer=i.getElement(t,"elPreviewContainer",a.find(".file-preview")),o.$preview=i.getElement(t,"elPreviewImage",a.find(".file-preview-thumbnails")),o.$previewStatus=i.getElement(t,"elPreviewStatus",a.find(".file-preview-status")),o.$errorContainer=i.getElement(t,"elErrorContainer",o.$previewContainer.find(".kv-fileinput-error")),i.isEmpty(o.msgErrorClass)||i.addCss(o.$errorContainer,o.msgErrorClass),o.$errorContainer.hide(),o.previewInitId="preview-"+i.uniqId(),o._initPreviewCache(),o._initPreview(!0),o._initPreviewActions(),o._setFileDropZoneTitle(),l.removeClass("file-loading"),l.attr("disabled")&&o.disable(),o._initZoom(),o.hideThumbnailContent&&i.addCss(o.$preview,"hide-content")},_initTemplateDefaults:function(){var t,a,n,r,o,l,s,d,c,u,p,f,m,v,h,g,w,_,b,C,y,T,E,x,F,S,I,k,P,z,A,$,D,U,B,j,L=this;t='{preview}\n
\n
\n {caption}\n
\n {remove}\n {cancel}\n {upload}\n {browse}\n
\n
',a='{preview}\n
\n{remove}\n{cancel}\n{upload}\n{browse}\n',n='
\n {close}
\n
\n
\n
\n
\n
\n
',o='
×
\n',r='',l='
\n
\n
\n',s='',d='{icon} {label}',c='
{icon} {label}
',u='',p='\n',f='
\n
\n {status}\n
\n
',m=" ({sizeText})",v='',h='{drag}\n
\n \n
\n
',g='\n',w='',_='',b='{dragIcon}',C='
{indicator}
',y='
\n',E=y+' title="{caption}">
\n',x="
{footer}\n
\n",F="{content}\n",S='
{data}
\n",I='{caption}\n",k='\n",P='\n",z='
\n",A='\n'+i.OBJECT_PARAMS+" "+i.DEFAULT_PREVIEW+"\n\n",$='\n\n'+i.OBJECT_PARAMS+" "+i.DEFAULT_PREVIEW+"\n\n",D='\n',U='
\n'+i.DEFAULT_PREVIEW+"\n
\n",B='',j={width:"100%",height:"100%","min-height":"480px"},L.defaults={layoutTemplates:{main1:t,main2:a,preview:n,close:o,fileIcon:r,caption:l,modalMain:u,modal:p,progress:f,size:m,footer:v,indicator:C,actions:h,actionDelete:g,actionUpload:w,actionZoom:_,actionDrag:b,btnDefault:s,btnLink:d,btnBrowse:c,zoomCache:B},previewMarkupTags:{tagBefore1:T,tagBefore2:E,tagAfter:x},previewContentTemplates:{generic:F,html:S,image:I,text:k,video:P,audio:z,flash:A,object:$,pdf:D,other:U},allowedPreviewTypes:["image","html","text","video","audio","flash","pdf","object"],previewTemplates:{},previewSettings:{image:{width:"auto",height:"160px"},html:{width:"213px",height:"160px"},text:{width:"213px",height:"160px"},video:{width:"auto",height:"100%","max-width":"100%"},audio:{width:"100%",height:"30px"},flash:{width:"auto",height:"100%","max-width":"100%"},object:{height:"100%"},pdf:{width:"160px",height:"160px"},other:{width:"160px",height:"160px"}},previewZoomSettings:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:j,text:j,video:{width:"auto",height:"100%","max-width":"100%"},audio:{width:"100%",height:"30px"},flash:{width:"auto",height:"480px"},object:{width:"auto",height:"100%","max-width":"100%","min-height":"480px"},pdf:j,other:{width:"auto",height:"100%","min-height":"480px"}},fileTypeSettings:{image:function(e,t){return i.compare(e,"image.*")||i.compare(t,/\.(gif|png|jpe?g)$/i)},html:function(e,t){return i.compare(e,"text/html")||i.compare(t,/\.(htm|html)$/i)},text:function(e,t){return i.compare(e,"text.*")||i.compare(t,/\.(xml|javascript)$/i)||i.compare(t,/\.(txt|md|csv|nfo|ini|json|php|js|css)$/i)},video:function(e,t){return i.compare(e,"video.*")&&(i.compare(e,/(ogg|mp4|mp?g|mov|webm|3gp)$/i)||i.compare(t,/\.(og?|mp4|webm|mp?g|mov|3gp)$/i))},audio:function(e,t){return i.compare(e,"audio.*")&&(i.compare(t,/(ogg|mp3|mp?g|wav)$/i)||i.compare(t,/\.(og?|mp3|mp?g|wav)$/i))},flash:function(e,t){return i.compare(e,"application/x-shockwave-flash",!0)||i.compare(t,/\.(swf)$/i)},pdf:function(e,t){return i.compare(e,"application/pdf",!0)||i.compare(t,/\.(pdf)$/i)},object:function(){return!0},other:function(){return!0}},fileActionSettings:{showRemove:!0,showUpload:!0,showZoom:!0,showDrag:!0,removeIcon:'',removeClass:"btn btn-xs btn-default",removeTitle:"Remove file",uploadIcon:'',uploadClass:"btn btn-xs btn-default",uploadTitle:"Upload file",zoomIcon:'',zoomClass:"btn btn-xs btn-default",zoomTitle:"View Details",dragIcon:'',dragClass:"text-info",dragTitle:"Move / Rearrange",dragSettings:{},indicatorNew:'',indicatorSuccess:'',indicatorError:'',indicatorLoading:'',indicatorNewTitle:"Not uploaded yet",indicatorSuccessTitle:"Uploaded",indicatorErrorTitle:"Upload Error",indicatorLoadingTitle:"Uploading ..."}},e.each(L.defaults,function(i,t){return"allowedPreviewTypes"===i?void(void 0===L.allowedPreviewTypes&&(L.allowedPreviewTypes=t)):void(L[i]=e.extend(!0,{},t,L[i]))}),L._initPreviewTemplates()},_initPreviewTemplates:function(){var t,a=this,n=a.defaults,r=a.previewMarkupTags,o=r.tagAfter;e.each(n.previewContentTemplates,function(e,n){i.isEmpty(a.previewTemplates[e])&&(t=r.tagBefore2,"generic"!==e&&"image"!==e&&"html"!==e&&"text"!==e||(t=r.tagBefore1),a.previewTemplates[e]=t+n+o)})},_initPreviewCache:function(){var t=this;t.previewCache={data:{},init:function(){var e=t.initialPreview;e.length>0&&!i.isArray(e)&&(e=e.split(t.initialPreviewDelimiter)),t.previewCache.data={content:e,config:t.initialPreviewConfig,tags:t.initialPreviewThumbTags}},fetch:function(){return t.previewCache.data.content.filter(function(e){return null!==e})},count:function(e){return t.previewCache.data&&t.previewCache.data.content?e?t.previewCache.data.content.length:t.previewCache.fetch().length:0},get:function(a,n){var r,o,l,s,d,c,u,p="init_"+a,f=t.previewCache.data,m=f.config[a],v=f.content[a],h=t.previewInitId+"-"+p,g=i.ifSet("previewAsData",m,t.initialPreviewAsData),w=function(e,a,n,r,o,l,s,d,c){return d=" file-preview-initial "+i.SORT_CSS+(d?" "+d:""),t._generatePreviewTemplate(e,a,n,r,o,!1,null,d,l,s,c)};return v?(n=void 0===n?!0:n,l=i.ifSet("type",m,t.initialPreviewFileType||"generic"),d=i.ifSet("filename",m,i.ifSet("caption",m)),c=i.ifSet("filetype",m,l),s=t.previewCache.footer(a,n,m&&m.size||null),u=i.ifSet("frameClass",m),r=g?w(l,v,d,c,h,s,p,u):w("generic",v,d,c,h,s,p,u,l).setTokens({content:f.content[a]}),f.tags.length&&f.tags[a]&&(r=i.replaceTags(r,f.tags[a])),i.isEmpty(m)||i.isEmpty(m.frameAttr)||(o=e(document.createElement("div")).html(r),o.find(".file-preview-initial").attr(m.frameAttr),r=o.html(),o.remove()),r):""},add:function(e,a,n,r){var o,l=t.previewCache.data;return i.isArray(e)||(e=e.split(t.initialPreviewDelimiter)),r?(o=l.content.push(e)-1,l.config[o]=a,l.tags[o]=n):(o=e.length-1,l.content=e,l.config=a,l.tags=n),t.previewCache.data=l,o},set:function(e,a,n,r){var o,l,s=t.previewCache.data;if(e&&e.length&&(i.isArray(e)||(e=e.split(t.initialPreviewDelimiter)),l=e.filter(function(e){return null!==e}),l.length)){if(void 0===s.content&&(s.content=[]),void 0===s.config&&(s.config=[]),void 0===s.tags&&(s.tags=[]),r){for(o=0;oi;i++)a+=t.previewCache.get(i);return e=t._getMsgSelected(t.previewCache.count()),{content:a,caption:e}},footer:function(e,a,n){var r=t.previewCache.data;if(!r||!r.config||0===r.config.length||i.isEmpty(r.config[e]))return"";a=void 0===a?!0:a;var o,l=r.config[e],s=i.ifSet("caption",l),d=i.ifSet("width",l,"auto"),c=i.ifSet("url",l,!1),u=i.ifSet("key",l,null),p=t.fileActionSettings,f=t.initialPreviewShowDelete||!1,m=i.ifSet("showDelete",l,i.ifSet("showDelete",p,f)),v=i.ifSet("showZoom",l,i.ifSet("showZoom",p,!0)),h=i.ifSet("showDrag",l,i.ifSet("showDrag",p,!0)),g=c===!1&&a;return o=t._renderFileActions(!1,m,v,h,g,c,u,!0),t._getLayoutTemplate("footer").setTokens({progress:t._renderThumbProgress(),actions:o,caption:s,size:t._getSize(n),width:d,indicator:""})}},t.previewCache.init()},_handler:function(e,i,t){var a=this,n=a.namespace,r=i.split(" ").join(n+" ")+n;e&&e.length&&e.off(r).on(r,t)},_log:function(e){var i=this,t=i.$element.attr("id");t&&(e='"'+t+'": '+e),"undefined"!=typeof window.console.log?window.console.log(e):window.alert(e)},_validate:function(){var e=this,i="file"===e.$element.attr("type");return i||e._log('The input "type" must be set to "file" for initializing the "bootstrap-fileinput" plugin.'),i},_errorsExist:function(){var i,t=this;return t.$errorContainer.find("li").length?!0:(i=e(document.createElement("div")).html(t.$errorContainer.html()),i.find("span.kv-error-close").remove(),i.find("ul").remove(),!!e.trim(i.text()).length)},_errorHandler:function(e,i){var t=this,a=e.target.error,n=function(e){t._showError(e.replace("{name}",i))};n(a.code===a.NOT_FOUND_ERR?t.msgFileNotFound:a.code===a.SECURITY_ERR?t.msgFileSecured:a.code===a.NOT_READABLE_ERR?t.msgFileNotReadable:a.code===a.ABORT_ERR?t.msgFilePreviewAborted:t.msgFilePreviewError)},_addError:function(e){var i=this,t=i.$errorContainer;e&&t.length&&(t.html(i.errorCloseButton+e),i._handler(t.find(".kv-error-close"),"click",function(){t.fadeOut("slow")}))},_resetErrors:function(e){var i=this,t=i.$errorContainer;i.isError=!1,i.$container.removeClass("has-error"),t.html(""),e?t.fadeOut("slow"):t.hide()},_showFolderError:function(e){var t,a=this,n=a.$errorContainer;e&&(t=a.msgFoldersNotAllowed.replace("{n}",e),a._addError(t),i.addCss(a.$container,"has-error"),n.fadeIn(800),a._raise("filefoldererror",[e,t]))},_showUploadError:function(e,t,a){var n=this,r=n.$errorContainer,o=a||"fileuploaderror",l=t&&t.id?'
  • '+e+"
  • ":"
  • "+e+"
  • ";return 0===r.find("ul").length?n._addError("
      "+l+"
    "):r.find("ul").append(l),r.fadeIn(800),n._raise(o,[t,e]),n.$container.removeClass("file-input-new"),i.addCss(n.$container,"has-error"),!0},_showError:function(e,t,a){var n=this,r=n.$errorContainer,o=a||"fileerror";return t=t||{},t.reader=n.reader,n._addError(e),r.fadeIn(800),n._raise(o,[t,e]),n.isUploadable||n._clearFileInput(),n.$container.removeClass("file-input-new"),i.addCss(n.$container,"has-error"),n.$btnUpload.attr("disabled",!0),!0},_noFilesError:function(e){var t=this,a=t.minFileCount>1?t.filePlural:t.fileSingle,n=t.msgFilesTooLess.replace("{n}",t.minFileCount).replace("{files}",a),r=t.$errorContainer;t._addError(n),t.isError=!0,t._updateFileDetails(0),r.fadeIn(800),t._raise("fileerror",[e,n]),t._clearFileInput(),i.addCss(t.$container,"has-error")},_parseError:function(i,t,a,n){var r=this,o=e.trim(a+""),l="."===o.slice(-1)?"":".",s=void 0!==t.responseJSON&&void 0!==t.responseJSON.error?t.responseJSON.error:t.responseText;return r.cancelling&&r.msgUploadAborted&&(o=r.msgUploadAborted),r.showAjaxErrorDetails&&s?(s=e.trim(s.replace(/\n\s*\n/g,"\n")),s=s.length>0?"
    "+s+"
    ":"",o+=l+s):o+=l,o===l&&(o=r.msgAjaxError.replace("{operation}",i)),r.cancelling=!1,n?""+n+": "+o:o},_parseFileType:function(e){var t,a,n,r,o=this,l=o.allowedPreviewTypes||[];for(r=0;r-1&&(t=i.split(".").pop(),a.previewFileIconSettings&&(n=a.previewFileIconSettings[t]||a.previewFileIconSettings[t.toLowerCase()]||null),a.previewFileExtSettings&&e.each(a.previewFileExtSettings,function(e,i){return a.previewFileIconSettings[e]&&i(t)?void(n=a.previewFileIconSettings[e]):void 0})),n},_parseFilePreviewIcon:function(e,i){var t=this,a=t._getPreviewIcon(i)||t.previewFileIcon,n=e;return n.indexOf("{previewFileIcon}")>-1&&(n=n.setTokens({previewFileIconClass:t.previewFileIconClass,previewFileIcon:a})),n},_raise:function(i,t){var a=this,n=e.Event(i);if(void 0!==t?a.$element.trigger(n,t):a.$element.trigger(n),n.isDefaultPrevented()||n.result===!1)return!1;switch(i){case"filebatchuploadcomplete":case"filebatchuploadsuccess":case"fileuploaded":case"fileclear":case"filecleared":case"filereset":case"fileerror":case"filefoldererror":case"fileuploaderror":case"filebatchuploaderror":case"filedeleteerror":case"filecustomerror":case"filesuccessremove":break;default:a.ajaxAborted||(a.ajaxAborted=n.result)}return!0},_listenFullScreen:function(e){var i,t,a=this,n=a.$modal;n&&n.length&&(i=n&&n.find(".btn-fullscreen"),t=n&&n.find(".btn-borderless"),i.length&&t.length&&(i.removeClass("active").attr("aria-pressed","false"),t.removeClass("active").attr("aria-pressed","false"),e?i.addClass("active").attr("aria-pressed","true"):t.addClass("active").attr("aria-pressed","true"),n.hasClass("file-zoom-fullscreen")?a._maximizeZoomDialog():e?a._maximizeZoomDialog():t.removeClass("active").attr("aria-pressed","false")))},_listen:function(){var t,a=this,n=a.$element,r=a.$form,o=a.$container;a._handler(n,"change",e.proxy(a._change,a)),a.showBrowse&&a._handler(a.$btnFile,"click",e.proxy(a._browse,a)),a._handler(o.find(".fileinput-remove:not([disabled])"),"click",e.proxy(a.clear,a)),a._handler(o.find(".fileinput-cancel"),"click",e.proxy(a.cancel,a)),a._initDragDrop(),a._handler(r,"reset",e.proxy(a.reset,a)),a.isUploadable||a._handler(r,"submit",e.proxy(a._submitForm,a)),a._handler(a.$container.find(".fileinput-upload"),"click",e.proxy(a._uploadClick,a)),a._handler(e(window),"resize",function(){a._listenFullScreen(screen.width===window.innerWidth&&screen.height===window.innerHeight)}),t="webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",a._handler(e(document),t,function(){a._listenFullScreen(i.checkFullScreen())}),a._initClickable()},_initClickable:function(){var t,a=this;a.isClickable&&(t=a.isUploadable?a.$dropZone:a.$preview.find(".file-default-preview"),i.addCss(t,"clickable"),t.attr("tabindex",-1),a._handler(t,"click",function(i){var n=e(i.target);n.parents(".file-preview-thumbnails").length&&!n.parents(".file-default-preview").length||(a.$element.trigger("click"),t.blur())}))},_initDragDrop:function(){var i=this,t=i.$dropZone;i.isUploadable&&i.dropZoneEnabled&&i.showPreview&&(i._handler(t,"dragenter dragover",e.proxy(i._zoneDragEnter,i)),i._handler(t,"dragleave",e.proxy(i._zoneDragLeave,i)),i._handler(t,"drop",e.proxy(i._zoneDrop,i)),i._handler(e(document),"dragenter dragover drop",i._zoneDragDropInit))},_zoneDragDropInit:function(e){e.stopPropagation(),e.preventDefault()},_zoneDragEnter:function(t){var a=this,n=e.inArray("Files",t.originalEvent.dataTransfer.types)>-1;return a._zoneDragDropInit(t),a.isDisabled||!n?(t.originalEvent.dataTransfer.effectAllowed="none",void(t.originalEvent.dataTransfer.dropEffect="none")):void i.addCss(a.$dropZone,"file-highlighted")},_zoneDragLeave:function(e){var i=this;i._zoneDragDropInit(e),i.isDisabled||i.$dropZone.removeClass("file-highlighted")},_zoneDrop:function(e){var t=this;e.preventDefault(),t.isDisabled||i.isEmpty(e.originalEvent.dataTransfer.files)||(t._change(e,"dragdrop"),t.$dropZone.removeClass("file-highlighted"))},_uploadClick:function(e){var t,a=this,n=a.$container.find(".fileinput-upload"),r=!n.hasClass("disabled")&&i.isEmpty(n.attr("disabled"));if(!e||!e.isDefaultPrevented()){if(!a.isUploadable)return void(r&&"submit"!==n.attr("type")&&(t=n.closest("form"),t.length&&t.trigger("submit"),e.preventDefault()));e.preventDefault(),r&&a.upload()}},_submitForm:function(){var e=this;return e._isFileSelectionValid()&&!e._abort({})},_clearPreview:function(){var t=this,a=t.$preview,n=t.showUploadedThumbs?t.getFrames(":not(.file-preview-success)"):t.getFrames();n.each(function(){var t=e(this);t.remove(),i.cleanZoomCache(a.find("#zoom-"+t.attr("id")))}),t.getFrames().length&&t.showPreview||t._resetUpload(),t._validateDefaultPreview()},_initSortable:function(){var t,a=this,n=a.$preview,r="."+i.SORT_CSS;window.KvSortable&&0!==n.find(r).length&&(t={handle:".drag-handle-init",dataIdAttr:"data-preview-id",scroll:!1,draggable:r,onSort:function(t){var n,r,o=t.oldIndex,l=t.newIndex;a.initialPreview=i.moveArray(a.initialPreview,o,l),a.initialPreviewConfig=i.moveArray(a.initialPreviewConfig,o,l),a.previewCache.init();for(var s=0;s