jumpserver/apps/static/plugins/elfinder/elfinder.min.js

24 lines
496 KiB
JavaScript
Executable File
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*!
* elFinder - file manager for web
* Version 2.1.42 (2.1-src Nightly: 2514897) (2018-09-15)
* http://elfinder.org
*
* Copyright 2009-2018, Studio 42
* Licensed under a 3-clauses BSD license
*/
!function(e,t){if("function"==typeof define&&define.amd)define(["jquery","jquery-ui"],t);else if("undefined"!=typeof exports){var n,i;try{n=require("jquery"),i=require("jquery-ui")}catch(a){}module.exports=t(n,i)}else t(e.jQuery,e.jQuery.ui,!0)}(this,function(e,t,n){n=n||!1;var i=function(t,n,a){var o,r,s,l,c,d,p,u=this,h=[],f=["button"],m=e(t),g=e.extend(!0,{},e._data(m.get(0),"events")),v=e("<div/>").append(m.contents()).attr("class",m.attr("class")||"").attr("style",m.attr("style")||""),b=m.attr("id")||"",y="elfinder-"+(b?b:Math.random().toString().substr(2,7)),w="mousedown."+y,x="keydown."+y,k="keypress."+y,C="keyup."+y,z=!1,T=!1,A=["enable","disable","load","open","reload","select","add","remove","change","dblclick","getfile","lockfiles","unlockfiles","selectfiles","unselectfiles","dragstart","dragstop","search","searchend","viewchange"],I="",S={path:"",url:"",tmbUrl:"",disabled:[],separator:"/",archives:[],extract:[],copyOverwrite:!0,uploadOverwrite:!0,uploadMaxSize:0,jpgQuality:100,tmbCrop:!1,tmb:!1},O={},j={},M={},F={},D=[],U={},E={},P=[],R={},q=[],H=[],_=new u.command(u),N="auto",L=400,W=null,B="sounds/",$="",K=e(document.createElement("audio")).hide().appendTo("body")[0],V=0,X="",G=null,J=function(t){var n,i,a,o,r,s,l,c={},d={};u.api>=2.1?(u.commandMap=t.options.uiCmdMap&&Object.keys(t.options.uiCmdMap).length?t.options.uiCmdMap:{},X!==JSON.stringify(u.commandMap)&&(X=JSON.stringify(u.commandMap))):u.options.sync=0,t.init?(j={},F={}):(s=I,n="elfinder-subtree-loaded "+u.res("class","navexpand"),r=u.res("class","navcollapse"),i=Object.keys(j),a=function(t){if(!j[t])return!0;var i="directory"===j[t].mime,a=j[t].phash;!(!i||c[a]||!d[a]&&e("#"+u.navHash2Id(j[t].hash)).is(":hidden")&&e("#"+u.navHash2Id(a)).next(".elfinder-navbar-subtree").children().length>100)||!i&&a===I||R[t]?i&&(d[a]=!0):(i&&!c[a]&&(c[a]=!0,e("#"+u.navHash2Id(a)).removeClass(n).next(".elfinder-navbar-subtree").empty()),ee(j[t]))},o=function(){i.length&&(G&&G._abort(),G=u.asyncJob(a,i,{interval:20,numPerOnce:100}).done(function(){var t=u.storage("hide")||{items:{}};Object.keys(M).length&&e.each(M,function(e){t.items[e]||delete M[e]})}))},u.trigger("filesgc").one("filesgc",function(){i=[]}),u.one("opendone",function(){s!==I&&(m.data("lazycnt")?u.one("lazydone",o):o())})),u.sorters={},I=t.cwd.hash,Y(t.files),j[I]||Y([t.cwd]),l=JSON.stringify(u.sorters),$!==l&&(u.trigger("sorterupdate"),$=l),u.lastDir(I),u.autoSync()},Y=function(t,n){var i,a,o,r,s={name:!0,perm:!0,date:!0,size:!0,kind:!0},l=!u.sorters._checked,c=t.length,d=function(t){var n=t||{},i=[];e.each(u.sortRules,function(e){(s[e]||"undefined"!=typeof n[e]||"mode"===e&&"undefined"!=typeof n.perm)&&i.push(e)}),u.sorters=u.arrayFlip(i,!0),u.sorters._checked=!0},p=["sizeInfo"],h={},f=u.storage("hide")||{},m=f.items||{};for(a=0;a<c;a++)i=Object.assign({},t[a]),r=!(f.show||!m[i.hash]),i.name&&i.hash&&i.mime&&(r||(l&&i.phash===I&&(d(i),l=!1),!i.phash||"add"!==n&&"change"!==n||(o=u.parents(i.phash))&&e.each(o,function(){h[this]=!0})),j[i.hash]&&(e.each(p,function(){j[i.hash][this]&&!i[this]&&(i[this]=j[i.hash][this])}),i.sizeInfo&&!i.size&&(i.size=i.sizeInfo.size),ee(j[i.hash],!0)),m[i.hash]&&(M[i.hash]=i),r?(c--,t.splice(a--,1)):(j[i.hash]=i,"directory"!==i.mime||F[i.hash]||(F[i.hash]={}),i.phash&&(F[i.phash]||(F[i.phash]={}),F[i.phash][i.hash]=!0)));e.each(Object.keys(h),function(){var e=j[this];e&&e.sizeInfo&&delete e.sizeInfo}),l&&d()},Q=function(t){var n,i=t.length,a={},o=function(t){var i=j[t];i&&("directory"===i.mime&&(a[t]&&delete u.roots[a[t]],e.each(u.leafRoots,function(n,i){var a,o;(a=e.inArray(t,i))!==-1&&(1===i.length?((o=Object.assign({},j[n]))&&o._realStats&&(e.each(o._realStats,function(e,t){o[e]=t}),Q(j[n]._realStats),u.change({changed:[o]})),delete u.leafRoots[n]):u.leafRoots[n].splice(a,1))}),u.searchStatus.state<2&&e.each(j,function(e,n){n.phash==t&&o(e)})),i.phash&&(n=u.parents(i.phash))&&e.each(n,function(){r[this]=!0}),ee(j[t]))},r={};for(e.each(u.roots,function(e,t){a[t]=e});i--;)o(t[i]);e.each(Object.keys(r),function(){var e=j[this];e&&e.sizeInfo&&delete e.sizeInfo})},Z=function(t){e.each(t,function(t,n){var i=n.hash;j[i]&&e.each(Object.keys(j[i]),function(e,t){"undefined"==typeof n[t]&&delete j[i][t]}),j[i]=j[i]?Object.assign(j[i],n):n})},ee=function(e,t){var n=e.hash,i=e.phash;i&&F[i]&&delete F[i][n],t||(F[n]&&delete F[n],u.optionsByHashes[n]&&delete u.optionsByHashes[n]),delete j[n]},te=0,ne=[],ie=!1,ae=function(t){var n,i=t.keyCode,a=!(!t.ctrlKey&&!t.metaKey),o="mousedown"===t.type;if(!o&&(u.keyState.keyCode=i),u.keyState.ctrlKey=a,u.keyState.shiftKey=t.shiftKey,u.keyState.metaKey=t.metaKey,u.keyState.altKey=t.altKey,!o)return"keyup"===t.type?void(u.keyState.keyCode=null):void(z&&(e.each(E,function(e,n){n.type==t.type&&n.keyCode==i&&n.shiftKey==t.shiftKey&&n.ctrlKey==a&&n.altKey==t.altKey&&(t.preventDefault(),t.stopPropagation(),n.callback(t,u),u.debug("shortcut-exec",e+" : "+n.description))}),i!=e.ui.keyCode.TAB||e(t.target).is(":input")||t.preventDefault(),"keydown"===t.type&&i==e.ui.keyCode.ESCAPE&&(m.find(".ui-widget:visible").length||u.clipboard().length&&u.clipboard([]),e.ui.ddmanager&&(n=e.ui.ddmanager.current,n&&n.helper&&n.cancel()),u.toHide(m.find(".ui-widget.elfinder-button-menu.elfinder-frontmost:visible")),u.trigger("keydownEsc",t))))},oe=new Date,re=window.parent!==window,se=function(){var t,n;if(re)try{n=e("iframe",window.parent.document),n.length&&e.each(n,function(n,i){if(i.contentWindow===window)return t=e(i),!1})}catch(i){}return t}();n||(n={}),u.UA.Mobile&&e(window).on("orientationchange."+y,function(){var e=(screen&&screen.orientation&&screen.orientation.angle||window.orientation||0)+0;e===-90&&(e=270),u.UA.Angle=e,u.UA.Rotated=e%180!==0}).trigger("orientationchange."+y),n.bootCallback&&"function"==typeof n.bootCallback&&!function(){var e=a,t=n.bootCallback;a=function(n,i){e&&"function"==typeof e&&e.call(this,n,i),t.call(this,n,i)}}(),delete n.bootCallback,this.api=null,this.newAPI=!1,this.oldAPI=!1,this.netDrivers=[],this.baseUrl="",this.cssloaded=!1,this.mimesCanMakeEmpty={},this.bootCallback,this.options=Object.assign({},this._options),n.uiOptions&&n.uiOptions.toolbar&&Array.isArray(n.uiOptions.toolbar)&&e.isPlainObject(n.uiOptions.toolbar[n.uiOptions.toolbar.length-1])&&(u.options.uiOptions.toolbarExtra=Object.assign(u.options.uiOptions.toolbarExtra||{},n.uiOptions.toolbar.pop())),function(){var t=function(n,i){e.isPlainObject(n)&&e.each(n,function(n,a){e.isPlainObject(a)?(i[n]||(i[n]={}),t(a,i[n])):i[n]=a})};t(n,u.options)}(),this.options.uiOptions.toolbar.push(this.options.uiOptions.toolbarExtra),delete this.options.uiOptions.toolbarExtra,this.baseUrl=function(){var t,n,i,a;return u.options.baseUrl?u.options.baseUrl:(a="",t=null,e("head > script").each(function(){if(this.src&&this.src.match(/js\/elfinder(?:-[a-z0-9_-]+)?\.(?:min|full)\.js$/i))return t=e(this),!1}),t&&(n=e('head > link[href$="css/elfinder.min.css"],link[href$="css/elfinder.full.css"]:first').length,n||(u.cssloaded=null),a=t.attr("src").replace(/js\/[^\/]+$/,""),a.match(/^(https?\/\/|\/)/)||(i=e("head > base[href]").attr("href"))&&(a=i.replace(/\/$/,"")+"/"+a)),""!==a?u.options.baseUrl=a:(u.options.baseUrl||(u.options.baseUrl="./"),a=u.options.baseUrl),a)}(),S.dispInlineRegex=this.options.dispInlineRegex,this.options.cssAutoLoad&&!function(){var t=u.baseUrl;null===u.cssloaded&&(m.data("cssautoloadHide",e("<style>.elfinder{visibility:hidden;overflow:hidden}</style>")),e("head").append(m.data("cssautoloadHide")),u.loadCss([t+"css/elfinder.min.css",t+"css/theme.css"]),Array.isArray(u.options.cssAutoLoad)&&u.loadCss(u.options.cssAutoLoad)),u.options.cssAutoLoad=!1}(),this.optionProperties={icon:void 0,csscls:void 0,tmbUrl:void 0,uiCmdMap:{},netkey:void 0,disabled:[]},re||this.options.enableAlways||2!==e("body").children().length||(this.options.enableAlways=!0),this.options.debug===!0?this.options.debug="all":Array.isArray(this.options.debug)?!function(){var t={};e.each(u.options.debug,function(){t[this]=!0}),u.options.debug=t}():this.options.debug=!1,this.noConflicts={},this.noConflict=function(){e.each(f,function(t,n){e.fn[n]&&"function"==typeof e.fn[n].noConflict&&(u.noConflicts[n]=e.fn[n].noConflict())})},this.noConflict(),this.isCORS=!1,function(){if("undefined"!=typeof u.options.cors&&null!==u.options.cors)u.isCORS=!!u.options.cors;else{var t,i=document.createElement("a"),a=window.location.protocol,o=function(e){return e=e&&":"!==e?e:a,"https:"===e?/\:443$/:/\:80$/},r=window.location.host.replace(o(a),"");i.href=n.url,n.urlUpload&&n.urlUpload!==n.url&&(t=document.createElement("a"),t.href=n.urlUpload),(r!==i.host.replace(o(i.protocol),"")||":"!==i.protocol&&""!==i.protocol&&a!==i.protocol||t&&(r!==t.host.replace(o(t.protocol),"")||":"!==t.protocol&&""!==t.protocol&&a!==t.protocol))&&(u.isCORS=!0)}u.isCORS&&(e.isPlainObject(u.options.customHeaders)||(u.options.customHeaders={}),e.isPlainObject(u.options.xhrFields)||(u.options.xhrFields={}),u.options.requestType="post",u.options.customHeaders["X-Requested-With"]="XMLHttpRequest",u.options.xhrFields.withCredentials=!0)}(),this.requestType=/^(get|post)$/i.test(this.options.requestType)?this.options.requestType.toLowerCase():"get",s=Math.max(parseInt(this.options.requestMaxConn),1),this.optsCustomData=e.isPlainObject(this.options.customData)?this.options.customData:{},this.customData=Object.assign({},this.optsCustomData),this.prevCustomData=null,this.customHeaders=e.isPlainObject(this.options.customHeaders)?this.options.customHeaders:{},this.xhrFields=e.isPlainObject(this.options.xhrFields)?this.options.xhrFields:{},this.replaceXhrSend=function(){p||(p=XMLHttpRequest.prototype.send),XMLHttpRequest.prototype.send=function(){var t=this;return u.customHeaders&&e.each(u.customHeaders,function(e){t.setRequestHeader(e,this)}),u.xhrFields&&e.each(u.xhrFields,function(e){e in t&&(t[e]=this)}),p.apply(this,arguments)}},this.restoreXhrSend=function(){p&&(XMLHttpRequest.prototype.send=p)},this.abortCmdsOnOpen=this.options.abortCmdsOnOpen||["tmb","parents"],this.id=b,this.navPrefix="nav"+(i.prototype.uniqueid?i.prototype.uniqueid:"")+"-",this.cwdPrefix=i.prototype.uniqueid?"cwd"+i.prototype.uniqueid+"-":"",++i.prototype.uniqueid,this.uploadURL=n.urlUpload||n.url,this.namespace=y,this.today=new Date(oe.getFullYear(),oe.getMonth(),oe.getDate()).getTime()/1e3,this.yesterday=this.today-86400,l=this.options.UTCDate?"UTC":"",this.getHours="get"+l+"Hours",this.getMinutes="get"+l+"Minutes",this.getSeconds="get"+l+"Seconds",this.getDate="get"+l+"Date",this.getDay="get"+l+"Day",this.getMonth="get"+l+"Month",this.getFullYear="get"+l+"FullYear",this.zIndex,this.searchStatus={state:0,query:"",target:"",mime:"",mixed:!1,ininc:!1},this.storage=function(){try{return"localStorage"in window&&null!==window.localStorage?(u.UA.Safari&&(window.localStorage.setItem("elfstoragecheck",1),window.localStorage.removeItem("elfstoragecheck")),u.localStorage):u.cookie}catch(e){return u.cookie}}(),this.lang=this.storage("lang")||this.options.lang,"jp"===this.lang&&(this.lang=this.options.lang="ja"),this.viewType=this.storage("view")||this.options.defaultView||"icons",this.sortType=this.storage("sortType")||this.options.sortType||"name",this.sortOrder=this.storage("sortOrder")||this.options.sortOrder||"asc",this.sortStickFolders=this.storage("sortStickFolders"),null===this.sortStickFolders?this.sortStickFolders=!!this.options.sortStickFolders:this.sortStickFolders=!!this.sortStickFolders,this.sortAlsoTreeview=this.storage("sortAlsoTreeview"),null===this.sortAlsoTreeview?this.sortAlsoTreeview=!!this.options.sortAlsoTreeview:this.sortAlsoTreeview=!!this.sortAlsoTreeview,this.sortRules=e.extend(!0,{},this._sortRules,this.options.sortRules),e.each(this.sortRules,function(e,t){"function"!=typeof t&&delete u.sortRules[e]}),this.compare=e.proxy(this.compare,this),this.notifyDelay=this.options.notifyDelay>0?parseInt(this.options.notifyDelay):500,this.draggingUiHelper=null,this.droppable={greedy:!0,tolerance:"pointer",accept:".elfinder-cwd-file-wrapper,.elfinder-navbar-dir,.elfinder-cwd-file,.elfinder-cwd-filename",hoverClass:this.res("class","adroppable"),classes:{"ui-droppable-hover":this.res("class","adroppable")},autoDisable:!0,drop:function(t,n){var i,a,o,r=e(this),s=e.grep(n.helper.data("files")||[],function(e){return!!e}),l=[],c=[],d=[],p=n.helper.hasClass("elfinder-drag-helper-plus"),h="class";if("undefined"==typeof t.button||n.helper.data("namespace")!==y||!u.insideWorkzone(t.pageX,t.pageY))return!1;for(a=r.hasClass(u.res(h,"cwdfile"))?u.cwdId2Hash(r.attr("id")):r.hasClass(u.res(h,"navdir"))?u.navId2Hash(r.attr("id")):I,i=s.length;i--;)o=s[i],o!=a&&j[o].phash!=a?l.push(o):(p&&o!==a&&j[a].write?c:d).push(o);return!d.length&&(n.helper.data("droped",!0),c.length&&(n.helper.hide(),u.exec("duplicate",c,{_userAction:!0})),void(l.length&&(n.helper.hide(),u.clipboard(l,!p),u.exec("paste",a,{_userAction:!0},a).always(function(){u.clipboard([]),u.trigger("unlockfiles",{files:s})}),u.trigger("drop",{files:s}))))}},this.enabled=function(){return z&&this.visible()},this.visible=function(){return m[0].elfinder&&m.is(":visible")},this.isRoot=function(e){return!(!e.isroot&&e.phash)},this.root=function(t,n){t=t||I;var i,a;if(!n&&(e.each(u.roots,function(e,n){if(0===t.indexOf(e))return i=n,!1}),i))return i;for(i=j[t];i&&i.phash&&(n||!i.isroot);)i=j[i.phash];if(i)return i.hash;for(;a in j&&j.hasOwnProperty(a);)if(i=j[a],"directory"===i.mime&&!i.phash&&i.read)return i.hash;return""},this.cwd=function(){return j[I]||{}},this.option=function(t,n){var i,a;return n=n||I,u.optionsByHashes[n]&&"undefined"!=typeof u.optionsByHashes[n][t]?u.optionsByHashes[n][t]:!u.hasVolOptions||I===n||(a=u.file(n))&&a.phash===I?O[t]||"":(i="",e.each(u.volOptions,function(e,a){if(0===n.indexOf(e))return i=a[t]||"",!1}),i)},this.getDisabledCmds=function(t,n){var i={hidden:!0};return Array.isArray(t)||(t=[t]),e.each(t,function(e,t){var n=u.option("disabledFlip",t);n&&Object.assign(i,n)}),n?i:Object.keys(i)},this.file=function(e,t){return e?j[e]||(t?M[e]:void 0):void 0},this.files=function(t){var n={};return t?F[t]?(e.each(F[t],function(e){j[e]?n[e]=j[e]:delete F[t][e]}),Object.assign({},n)):{}:Object.assign({},j)},this.parents=function(e){for(var t,n=[];e&&(t=this.file(e));)n.unshift(t.hash),e=t.phash;return n},this.path2array=function(e,t){for(var n,i=[];e;){if(!(n=j[e])||!n.hash){i=[];break}i.unshift(t&&n.i18?n.i18:n.name),e=n.isroot?null:n.phash}return i},this.path=function(t,n,i){var a=j[t]&&j[t].path?j[t].path:this.path2array(t,n).join(O.separator);if(i&&j[t]){i=Object.assign({notify:{type:"parents",cnt:1,hideCnt:!0}},i);var o,r=e.Deferred(),s=i.notify,l=!1,c=function(){u.request({data:{cmd:"parents",target:j[t].phash},notify:s,preventFail:!0}).done(d).fail(function(){r.reject()})},d=function(){u.one("parentsdone",function(){a=u.path(t,n),""===a&&l?(l=!1,c()):(s&&(clearTimeout(o),s.cnt=-parseInt(s.cnt||0),u.notify(s)),r.resolve(a))})};return a?r.resolve(a):(u.ui.tree?(s&&(o=setTimeout(function(){u.notify(s)},u.notifyDelay)),l=!0,d(!0)):c(),r)}return a},this.url=function(t,n){var i,a=j[t],o=n||{},r=o.async||!1,s=o.temporary||!1,l=r?e.Deferred():null,c=function(n){if(n)return n;if(a.url)return a.url;if("undefined"==typeof i&&(i=u.option("url",!u.isRoot(a)&&a.phash||a.hash)),i)return i+e.map(u.path2array(t),function(e){return encodeURIComponent(e)}).slice(1).join("/");var o=Object.assign({},u.customData,{cmd:"file",target:a.hash});return u.oldAPI&&(o.cmd="open",o.current=a.phash),u.options.url+(u.options.url.indexOf("?")===-1?"?":"&")+e.param(o,!0)};if(!a||!a.read)return r?l.resolve(""):"";if("1"==a.url||s&&!a.url&&!(i=u.option("url",!u.isRoot(a)&&a.phash||a.hash)))this.request({data:{cmd:"url",target:t,options:{temporary:s?1:0}},preventDefault:!0,options:{async:r},notify:r?{type:s?"file":"url",cnt:1,hideCnt:!0}:{}}).done(function(e){a.url=e.url||""}).fail(function(){a.url=""}).always(function(){var e;return a.url&&s&&(e=a.url,a.url="1"),r?void l.resolve(c(e)):c(e)});else{if(!r)return c();l.resolve(c())}return r?l:void 0},this.openUrl=function(t,n){var i=j[t],a="";return i&&i.read?!n&&(i.url?1!=i.url&&(a=i.url):O.url&&0===i.hash.indexOf(u.cwd().volumeid)&&(a=O.url+e.map(this.path2array(t),function(e){return encodeURIComponent(e)}).slice(1).join("/")),a)?a+=(a.match(/\?/)?"&":"?")+"_".repeat((a.match(/[\?&](_+)t=/g)||["&t="]).sort().shift().match(/[\?&](_*)t=/)[1].length+1)+"t="+(i.ts||parseInt(+new Date/1e3)):(a=this.options.url,a=a+(a.indexOf("?")===-1?"?":"&")+(this.oldAPI?"cmd=open&current="+i.phash:"cmd=file")+"&target="+i.hash+"&_t="+(i.ts||parseInt(+new Date/1e3)),n&&(a+="&download=1"),e.each(this.customData,function(e,t){a+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t)}),a):""},this.tmb=function(t){var n,i,a="elfinder-cwd-bgurl",o="";return!(!e.isPlainObject(t)||(u.searchStatus.state&&0!==t.hash.indexOf(u.cwd().volumeid)?(n=u.option("tmbUrl",t.hash),i=u.option("tmbCrop",t.hash)):(n=O.tmbUrl,i=O.tmbCrop),i&&(a+=" elfinder-cwd-bgurl-crop"),"self"===n&&0===t.mime.indexOf("image/")?(o=u.openUrl(t.hash),a+=" elfinder-cwd-bgself"):(u.oldAPI||n)&&t&&t.tmb&&1!=t.tmb?o=n+t.tmb:u.newAPI&&t&&t.tmb&&1!=t.tmb&&(o=t.tmb),!o))&&(t.ts&&"self"!==n&&(o+=(o.match(/\?/)?"&":"?")+"_t="+t.ts),{url:o,className:a})},this.selected=function(){return D.slice(0)},this.selectedFiles=function(){return e.map(D,function(e){return j[e]?Object.assign({},j[e]):null})},this.fileByName=function(e,t){var n;for(n in j)if(j.hasOwnProperty(n)&&j[n].phash==t&&j[n].name==e)return j[n]},this.validResponse=function(e,t){return t.error||this.rules[this.rules[e]?e:"defaults"](t)},this.returnBytes=function(e){var t;return isNaN(e)?(e||(e=""),e=e.replace(/b$/i,""),t=e.charAt(e.length-1).toLowerCase(),e=e.replace(/[tgmk]$/i,""),"t"==t?e=1024*e*1024*1024*1024:"g"==t?e=1024*e*1024*1024:"m"==t?e=1024*e*1024:"k"==t&&(e=1024*e),e=isNaN(e)?0:parseInt(e)):(e=parseInt(e),e<1&&(e=0)),e},this.request=function(t){var n,i,a,o,r=this,l=this.options,c=e.Deferred(),d=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),p=Object.assign({},r.customData,{mimes:l.onlyMimes},t.data||t),u=p.cmd,h="binary"===(t.options||{}).dataType,f=!t.asNotOpen&&"open"===u,m=!(h||t.preventDefault||t.preventFail),g=!(h||t.preventDefault||t.preventDone),v=Object.assign({},t.notify),b=!!t.cancel,y=h||!!t.raw,w=t.syncOnFail,x=!!t.lazy,k=t.prepare,C=t.navigate,z=(t.options||{}).cache,T=Object.assign({url:l.url,async:!0,type:this.requestType,dataType:"json",cache:r.api>=2.1029,data:p,headers:this.customHeaders,xhrFields:this.xhrFields},t.options||{}),A=function(t){t.warning&&r.error(t.warning),f?J(t):r.updateCache(t),t.changed&&t.changed.length&&Z(t.changed),r.lazy(function(){t.removed&&t.removed.length&&r.remove(t),t.added&&t.added.length&&r.add(t),t.changed&&t.changed.length&&r.change(t)}).then(function(){return r.lazy(function(){r.trigger(u,t,!1)})}).then(function(){return r.lazy(function(){r.trigger(u+"done")})}).then(function(){t.toasts&&Array.isArray(t.toasts)&&e.each(t.toasts,function(){this.msg&&r.toast(this)}),t.sync&&r.sync()})},j=function(e,t){var n,i,a=r.options.debug;switch(t){case"abort":n=e.quiet?"":["errConnect","errAbort"];break;case"timeout":n=["errConnect","errTimeout"];break;case"parsererror":n=["errResponse","errDataNotJSON"],e.responseText&&(!I||a&&("all"===a||a["backend-error"]))&&n.push(e.responseText);break;default:if(e.responseText)try{i=JSON.parse(e.responseText),i&&i.error&&(n=i.error)}catch(o){}if(!n)if(403==e.status)n=["errConnect","errAccess","HTTP error "+e.status];else if(404==e.status)n=["errConnect","errNotFound","HTTP error "+e.status];else if(e.status>=500)n=["errResponse","errServerError","HTTP error "+e.status];else{if(414==e.status&&"get"===T.type)return T.type="post",r.abortXHR(e),void(c.xhr=e=r.transport.send(T).fail(n).done(M));n=e.quiet?"":["errConnect","HTTP error "+e.status]}}r.trigger(u+"done"),c.reject(n,e,t)},M=function(t){var n=r.options.debug;if(r.currentReqCmd=u,!t.debug||n&&"all"===n||(n||(n=r.options.debug={}),n["backend-error"]=!0,n.warning=!0),y)return r.abortXHR(i),t&&t.debug&&r.debug("backend-debug",t),c.resolve(t);if(!t)return c.reject(["errResponse","errDataEmpty"],i,t);if(!e.isPlainObject(t))return c.reject(["errResponse","errDataNotJSON"],i,t);if(t.error)return f&&e.each(r.leafRoots,function(t,n){r.leafRoots[t]=e.grep(n,function(e){return e!==p.target})}),c.reject(t.error,i,t);var a=function(){var n,a=function(n){r.leafRoots[p.target]&&t[n]&&e.each(r.leafRoots[p.target],function(e,i){var a;(a=r.file(i))&&t[n].push(a)})},o=function(){r.textMimes={},e.each(r.res("mimes","text"),function(){r.textMimes[this.toLowerCase()]=!0})};return f?a("files"):"tree"===u&&a("tree"),t=r.normalize(t),r.validResponse(u,t)?(f&&(r.api||(r.api=t.api||1,"2.0"==r.api&&"undefined"!=typeof t.options.uploadMaxSize&&(r.api="2.1"),r.newAPI=r.api>=2,r.oldAPI=!r.newAPI),t.textMimes&&Array.isArray(t.textMimes)&&(r.resources.mimes.text=t.textMimes,o()),!r.textMimes&&o(),t.options&&(O=Object.assign({},S,t.options)),t.netDrivers&&(r.netDrivers=t.netDrivers),t.maxTargets&&(r.maxTargets=t.maxTargets),p.init&&(r.uplMaxSize=r.returnBytes(t.uplMaxSize),r.uplMaxFile=t.uplMaxFile?Math.max(parseInt(t.uplMaxFile),50):20)),"function"==typeof k&&k(t),C&&(n=C.target||"added",t[n]&&t[n].length&&r.one(u+"done",function(){var i=t[n],a=r.findCwdNodes(i),o=function(){var t=r.cwd().hash;return e.map(i,function(e){return e.phash&&t===e.phash?e.hash:null})},s=o(),l=function(t){var n,i,a,l=void 0,c=t.action?t.action.data:void 0;return(c||s.length)&&t.action&&(i=t.action.msg)&&(n=t.action.cmd)&&(!t.action.cwdNot||t.action.cwdNot!==r.cwd().hash)&&(a=t.action.done,c=t.action.data,l=e("<div/>").append(e('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all elfinder-tabstop"><span class="ui-button-text">'+r.i18n(i)+"</span></button>").on("mouseenter mouseleave",function(t){e(this).toggleClass("ui-state-hover","mouseenter"==t.type)}).on("click",function(){r.exec(n,c||s,{_userAction:!0,_currentType:"toast",_currentNode:e(this)}),a&&r.one(n+"done",function(){"function"==typeof a?a():"select"===a&&r.trigger("selectfiles",{files:o()})})}))),delete t.action,t.extNode=l,t};C.toast||(C.toast={}),!C.noselect&&r.trigger("selectfiles",{files:r.searchStatus.state>1?e.map(i,function(e){return e.hash}):s}),a.length?(C.noscroll||(a.first().trigger("scrolltoview",{blink:!1}),r.resources.blink(a,"lookme")),e.isPlainObject(C.toast.incwd)&&r.toast(l(C.toast.incwd))):e.isPlainObject(C.toast.inbuffer)&&r.toast(l(C.toast.inbuffer))})),c.resolve(t),void(t.debug&&r.debug("backend-debug",t))):c.reject(t.norError||"errResponse",i,t)};r.abortXHR(i),x?r.lazy(a):a()},F=function(e){i&&"pending"===i.state()&&(r.abortXHR(i,{quiet:!0,abort:!0}),(!e||"unload"!==e.type&&"destroy"!==e.type)&&r.autoSync())},D=function(e){if(r.trigger(u+"done"),"autosync"==e.type){if("stop"!=e.data.action)return}else if(!("unload"==e.type||"destroy"==e.type||"openxhrabort"==e.type||e.data.added&&e.data.added.length))return;F(e)},U=function(t){var n=function(){w=!1,c.reject()};if(t&&"cmd"===t)return u;if(f){if(ie)return c.reject();ie=!0}if(te++,c.always(function(){delete T.headers["X-elFinderReqid"]}).fail(function(t,n,i){0===t&&ne.length&&(ne=e.grep(ne,function(e){return e("cmd")!==u})),F(),f&&(o=r.file(p.target),o&&o.volumeid&&r.isRoot(o)&&delete r.volumeExpires[o.volumeid]),r.trigger(u+"fail",i),t&&(m?r.error(t):r.debug("error",r.i18n(t))),w&&r.sync()}),!u)return w=!1,c.reject("errCmdReq");if(r.maxTargets&&p.targets&&p.targets.length>r.maxTargets)return w=!1,c.reject(["errMaxTargets",r.maxTargets]);if(g&&c.done(A),f){for(;a=q.pop();)a.queueAbort();if(I!==p.target)for(;a=H.pop();)a.queueAbort()}return e.inArray(u,(r.cmdsToAdd+" autosync").split(" "))!==-1&&("autosync"!==u&&(r.autoSync("stop"),c.always(function(){r.autoSync()})),r.trigger("openxhrabort")),delete T.preventFail,r.api>=2.1029&&(z?T.headers["X-elFinderReqid"]=d:Object.assign(T.data,{reqid:d})),c.syncOnFail=function(e){w=!!e},c.xhr=i=r.transport.send(T).always(function(){--te,ne.length?ne.shift()():ie=!1}).fail(j).done(M),r.api>=2.1029&&(i._requestId=d),f||p.compare&&"info"===u?(i.queueAbort=n,q.unshift(i),p.compare&&r.bind(r.cmdsToAdd+" autosync openxhrabort",D),c.always(function(){var t=e.inArray(i,q);p.compare&&r.unbind(r.cmdsToAdd+" autosync openxhrabort",D),t!==-1&&q.splice(t,1)})):e.inArray(u,r.abortCmdsOnOpen)!==-1&&(i.queueAbort=n,H.unshift(i),c.always(function(){var t=e.inArray(i,H);t!==-1&&H.splice(t,1)})),r.bind("unload destroy",D),c.always(function(){r.unbind("unload destroy",D)}),c},E=function(){return v.type&&v.cnt&&(b&&(v.cancel=c,t.eachCancel&&(v.id=+new Date)),n=setTimeout(function(){r.notify(v),c.always(function(){v.cnt=-(parseInt(v.cnt)||0),r.notify(v)})},r.notifyDelay),c.always(function(){clearTimeout(n)})),f&&(ie=!1),te<s?U():(f?ne.unshift(U):ne.push(U),c)},P={opts:t,result:!0};return r.api||p.init?(r.trigger("request."+u,P,!0),P.result?"object"==typeof P.result&&P.result.promise?(P.result.done(E).fail(function(){r.trigger(u+"done"),c.reject()}),c):E():(r.trigger(u+"done"),c.reject())):(w=!1,c.reject())},this.cache=function(e){Array.isArray(e)||(e=[e]),Y(e)},this.updateCache=function(t){e.isPlainObject(t)&&(t.files&&t.files.length&&Y(t.files,"files"),t.tree&&t.tree.length&&Y(t.tree,"tree"),t.removed&&t.removed.length&&Q(t.removed),t.added&&t.added.length&&Y(t.added,"add"),t.changed&&t.changed.length&&Z(t.changed,"change"))},this.diff=function(t,n,i){var a={},o=[],r=[],s=[],l=null,c=function(e){for(var t=s.length;t--;)if(s[t].hash==e)return!0};return e.each(t,function(e,t){a[t.hash]=t}),i&&i.length&&(l={},e.each(i,function(){l[this]=!0})),e.each(j,function(e,t){a[e]||n&&t.phash!==n||r.push(e)}),e.each(a,function(t,n){var i,a=j[t],r={};a?(e.each(Object.keys(a),function(){r[this]=!0}),e.each(n,function(e){if(delete r[e],!(l&&l[e]||n[e]===a[e]))return s.push(n),r={},!1}),i=Object.keys(r).length,0!==i&&(l&&e.each(r,function(e){l[e]&&--i}),0!==i&&s.push(n))):o.push(n)}),e.each(r,function(t,n){var i=j[n],o=i.phash;o&&"directory"==i.mime&&e.inArray(o,r)===-1&&a[o]&&!c(o)&&s.push(a[o])}),{added:o,removed:r,changed:s}},this.sync=function(t,n){this.autoSync("stop");var i=this,a=function(){var i="",a=0,o=0;return t&&n&&e.each(j,function(e,n){n.phash&&n.phash===t&&(++a,o=Math.max(o,n.ts)),i=a+":"+o}),i},o=a(),r=e.Deferred().done(function(){i.trigger("sync")}),s=[this.request({data:{cmd:"open",reload:1,target:I,tree:!t&&this.ui.tree?1:0,compare:o},preventDefault:!0})],l=function(){for(var e,t=[],n=i.file(i.root(I)),a=n?n.volumeid:null,o=i.cwd().phash;o;)(e=i.file(o))?(0!==o.indexOf(a)&&(t.push({target:o,cmd:"tree"}),i.isRoot(e)||t.push({target:o,cmd:"parents"}),n=i.file(i.root(o)),a=n?n.volumeid:null),o=e.phash):o=null;return t};return!t&&i.api>=2&&(I!==this.root()&&s.push(this.request({data:{cmd:"parents",target:I},preventDefault:!0})),e.each(l(),function(e,t){s.push(i.request({data:{cmd:t.cmd,target:t.target},preventDefault:!0}))})),e.when.apply(e,s).fail(function(t,a){n&&e.inArray("errOpen",t)===-1?r.reject(t&&0!=a.status?t:void 0):(r.reject(t),t&&i.request({data:{cmd:"open",target:i.lastDir("")||i.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}}))}).done(function(e){var n,a,s;if(e.cwd.compare&&o===e.cwd.compare)return r.reject();if(n={tree:[]},a=arguments.length,a>1)for(s=1;s<a;s++)arguments[s].tree&&arguments[s].tree.length&&n.tree.push.apply(n.tree,arguments[s].tree);if(i.api<2.1&&(n.tree||(n.tree=[]),n.tree.push(e.cwd)),e=i.normalize(e),!i.validResponse("open",e))return r.reject(e.norError||"errResponse");if(n=i.normalize(n),!i.validResponse("tree",n))return r.reject(n.norError||"errResponse");var l=i.diff(e.files.concat(n&&n.tree?n.tree:[]),t);return l.added.push(e.cwd),i.updateCache(l),l.removed.length&&i.remove(l),l.added.length&&i.add(l),l.changed.length&&i.change(l),r.resolve(l)}).always(function(){i.autoSync()}),r},this.upload=function(e){return this.transport.upload(e,this)},this.toUnbindEvents={},this.bind=function(e,t,n){var i,a;if(t&&("function"==typeof t||"function"==typeof t.done))for(e=(""+e).toLowerCase().replace(/^\s+|\s+$/g,"").split(/\s+/),a=e.length,i=0;i<a;i++)void 0===U[e[i]]&&(U[e[i]]=[]),U[e[i]][n?"unshift":"push"](t);return this},this.unbind=function(t,n){var i,a,o,r;for(t=(""+t).toLowerCase().split(/\s+/),a=t.length,i=0;i<a;i++)(o=U[t[i]])&&(r=e.inArray(n,o),r>-1&&o.splice(r,1));return n=null,this},this.trigger=function(t,n,i){var a,o,r,s,l=t.toLowerCase(),c="object"==typeof n,d=U[l]||[],p=[];if(this.debug("event-"+l,n),c&&"undefined"!=typeof i||(i=!0),o=d.length){for(s=e.Event(l),i&&(s.data=n),a=0;a<o;a++)if(d[a])if(d[a].done)p.push(d[a].done);else{if(d[a].length&&!i){if("undefined"==typeof r)try{r=JSON.stringify(n)}catch(h){r=!1}s.data=r?JSON.parse(r):n}try{if(d[a].call(s,s,this)===!1||s.isDefaultPrevented()){this.debug("event-stoped",s.type);break}}catch(f){window.console&&window.console.log&&window.console.log(f)}}if(o=p.length)for(a=0;a<o;a++)try{if(p[a].call(s,s,this)===!1||s.isDefaultPrevented()){this.debug("event-stoped",s.type+"(done)");break}}catch(f){window.console&&window.console.log&&window.console.log(f)}this.toUnbindEvents[l]&&this.toUnbindEvents[l].length&&(e.each(this.toUnbindEvents[l],function(e,t){u.unbind(t.type,t.callback)}),delete this.toUnbindEvents[l])}return this},this.getListeners=function(e){return e?U[e.toLowerCase()]:U},this.shortcut=function(t){var n,i,a,o,r;if(this.options.allowShortcuts&&t.pattern&&e.isFunction(t.callback))for(n=t.pattern.toUpperCase().split(/\s+/),o=0;o<n.length;o++)i=n[o],r=i.split("+"),a=1==(a=r.pop()).length?a>0?a:a.charCodeAt(0):a>0?a:e.ui.keyCode[a],a&&!E[i]&&(E[i]={keyCode:a,altKey:e.inArray("ALT",r)!=-1,ctrlKey:e.inArray("CTRL",r)!=-1,shiftKey:e.inArray("SHIFT",r)!=-1,type:t.type||"keydown",callback:t.callback,description:t.description,pattern:i});return this},this.shortcuts=function(){var t=[];return e.each(E,function(e,n){t.push([n.pattern,u.i18n(n.description)])}),t},this.clipboard=function(t,n){var i=function(){return e.map(P,function(e){return e.hash})};return void 0!==t&&(P.length&&this.trigger("unlockfiles",{files:i()}),R={},P=e.map(t||[],function(e){var t=j[e];return t?(R[e]=!0,{hash:e,phash:t.phash,name:t.name,mime:t.mime,read:t.read,locked:t.locked,cut:!!n}):null}),this.trigger("changeclipboard",{clipboard:P.slice(0,P.length)}),n&&this.trigger("lockfiles",{files:i()})),P.slice(0,P.length)},this.isCommandEnabled=function(e,t){var n,i,a=u.cwd().volumeid||"";return!t&&u.searchStatus.state>1&&u.selected().length&&(t=u.selected()[0]),n=!t||a&&0===t.indexOf(a)?O.disabledFlip:u.option("disabledFlip",t),i=this._commands[e],!!i&&(i.alwaysEnabled||!n[e])},this.exec=function(t,n,i,a){var o,r;return!a&&this.commandMap[t]&&"hidden"!==this.commandMap[t]&&(t=this.commandMap[t]),"open"===t&&((this.searchStatus.state||this.searchStatus.ininc)&&this.trigger("searchend",{noupdate:!0}),this.autoSync("stop")),!a&&n&&(e.isArray(n)?n.length&&(a=n[0]):a=n),o=this._commands[t]&&this.isCommandEnabled(t,a)?this._commands[t].exec(n,i):e.Deferred().reject("No such command"),r=typeof o,"object"===r&&o.promise||(u.debug("warning",'"cmd.exec()" should be returned "$.Deferred" but cmd "'+t+'" returned "'+r+'"'),o=e.Deferred().resolve()),this.trigger("exec",{dfrd:o,cmd:t,files:n,opts:i,dstHash:a}),o},this.dialog=function(t,n){var i=e("<div/>").append(t).appendTo(m).elfinderdialog(n,this),a=i.closest(".ui-dialog"),o=function(){!i.data("draged")&&i.is(":visible")&&i.elfinderdialog("posInit")};return a.length&&(u.bind("resize",o),a.on("remove",function(){u.unbind("resize",o)})),i},this.toast=function(t){return e('<div class="ui-front"/>').appendTo(this.ui.toast).elfindertoast(t||{},this)},this.getUI=function(t){return this.ui[t]||(t?e():m)},this.getCommand=function(e){return void 0===e?this._commands:this._commands[e]},this.resize=function(t,n){var i,a=function(){for(var e=m.outerHeight(!0)-m.innerHeight(),t=m;t.get(0)!==W.get(0)&&(t=t.parent(),e+=t.outerHeight(!0)-t.innerHeight(),t.parent().length););return e},o=!m.hasClass("ui-resizable"),r=m.data("resizeSize")||{
w:0,h:0},s={};W&&W.data("resizeTm")&&clearTimeout(W.data("resizeTm")),"string"==typeof n&&(i=n.match(/^([0-9.]+)%$/))&&(W&&W.length||(W=e(window)),W.data("marginToMyNode")||W.data("marginToMyNode",a()),W.data("fitToBaseFunc")||W.data("fitToBaseFunc",function(e){var t=W.data("resizeTm");e.preventDefault(),e.stopPropagation(),t&&cancelAnimationFrame(t),m.hasClass("elfinder-fullscreen")||u.UA.Mobile&&W.data("rotated")===u.UA.Rotated||(W.data("rotated",u.UA.Rotated),W.data("resizeTm",requestAnimationFrame(function(){u.restoreSize()})))}),"undefined"==typeof W.data("rotated")&&W.data("rotated",u.UA.Rotated),n=W.height()*(i[1]/100)-W.data("marginToMyNode"),W.off("resize."+u.namespace,W.data("fitToBaseFunc")),o&&W.on("resize."+u.namespace,W.data("fitToBaseFunc"))),m.css({width:t,height:parseInt(n)}),s.w=Math.round(m.width()),s.h=Math.round(m.height()),m.data("resizeSize",s),s.w===r.w&&s.h===r.h||(m.trigger("resize"),this.trigger("resize",{width:s.w,height:s.h}))},this.restoreSize=function(){this.resize(N,L)},this.show=function(){m.show(),this.enable().trigger("show")},this.hide=function(){this.options.enableAlways&&(T=z,z=!1),this.disable(),this.trigger("hide"),m.hide()},this.lazy=function(t,n,i){var a=function(e){var t,n=m.data("lazycnt");e?(t=!m.data("lazyrepaint")&&i.repaint,n?m.data("lazycnt",++n):m.data("lazycnt",1).addClass("elfinder-processing"),t&&m.data("lazyrepaint",!0).css("display")):n&&n>1?m.data("lazycnt",--n):(t=m.data("lazyrepaint"),m.data("lazycnt",0).removeData("lazyrepaint").removeClass("elfinder-processing"),t&&m.css("display"),u.trigger("lazydone"))},o=e.Deferred(),r=function(){o.resolve(t.call(o)),a(!1)};return n=n||0,i=i||{},a(!0),n?setTimeout(r,n):requestAnimationFrame(r),o},this.destroy=function(){m&&m[0].elfinder&&(m.hasClass("elfinder-fullscreen")&&u.toggleFullscreen(m),this.options.syncStart=!1,this.autoSync("forcestop"),this.trigger("destroy").disable(),P=[],D=[],U={},E={},e(window).off("."+y),e(document).off("."+y),u.trigger=function(){},e(K).remove(),m.off().removeData().empty().append(v.contents()).attr("class",v.attr("class")).attr("style",v.attr("style")),delete m[0].elfinder,e.each(g,function(t,n){e.each(n,function(e,t){m.on(t.type+(t.namespace?"."+t.namespace:""),t.selector,t.handler)})}))},this.autoSync=function(t){var n;if(u.options.sync>=1e3){if(r&&(clearTimeout(r),r=null,u.trigger("autosync",{action:"stop"})),"stop"===t?++V:V=Math.max(0,--V),V||"forcestop"===t||!u.options.syncStart)return;n=function(t){var i;O.syncMinMs&&(t||r)&&(t&&u.trigger("autosync",{action:"start"}),i=Math.max(u.options.sync,O.syncMinMs),r&&clearTimeout(r),r=setTimeout(function(){var t,a=!0,o=I;O.syncChkAsTs&&j[o]&&(t=j[o].ts)?u.request({data:{cmd:"info",targets:[o],compare:t,reload:1},preventDefault:!0}).done(function(e){var i;a=!0,e.compare&&(i=e.compare,i==t&&(a=!1)),a?u.sync(o).always(function(){i&&(j[o].ts=i),n()}):n()}).fail(function(t,a){t&&0!=a.status?(u.error(t),e.inArray("errOpen",t)!==-1&&u.request({data:{cmd:"open",target:u.lastDir("")||u.root(),tree:1,init:1},notify:{type:"open",cnt:1,hideCnt:!0}})):r=setTimeout(function(){n()},i)}):u.sync(I,!0).always(function(){n()})},i))},n(!0)}},this.insideWorkzone=function(e,t,n){var i=this.getUI("workzone").data("rectangle");return n=n||1,!(e<i.left+n||e>i.left+i.width+n||t<i.top+n||t>i.top+i.height+n)},this.toFront=function(t){var n=m.children(".ui-front").removeClass("elfinder-frontmost"),i=n.last();n.css("z-index",""),e(t).addClass("ui-front elfinder-frontmost").css("z-index",i.css("z-index")+1)},this.toHide=function(t,n){var i,a=e(t);!n&&a.hide(),a.hasClass("elfinder-frontmost")&&(a.removeClass("elfinder-frontmost"),i=m.children(".ui-front:visible:not(.elfinder-frontmost)").last(),i.length&&requestAnimationFrame(function(){m.children(".elfinder-frontmost:visible").length||(u.toFront(i),i.trigger("frontmost"))}))},this.getMaximizeCss=function(){return{width:"100%",height:"100%",margin:0,padding:0,top:0,left:0,display:"block",position:"fixed",zIndex:Math.max(u.zIndex?u.zIndex+1:0,1e3),maxWidth:"",maxHeight:""}},function(){re&&u.UA.Fullscreen&&(u.UA.Fullscreen=!1,se&&"undefined"!=typeof se.attr("allowfullscreen")&&(u.UA.Fullscreen=!0));var t,n,i,a="elfinder-fullscreen",o="elfinder-fullscreen-native",r=function(){var t=0,n=0;e.each(m.children(".ui-dialog,.ui-draggable"),function(i,a){var o=e(a),r=o.position();r.top<0&&(o.css("top",t),t+=20),r.left<0&&(o.css("left",n),n+=20)})},s=u.UA.Fullscreen?{fullElm:function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||null},exitFull:function(){return document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():void 0},toFull:function(e){return e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():!!e.msRequestFullscreen&&e.msRequestFullscreen()}}:{fullElm:function(){var e;return m.hasClass(a)?m.get(0):(e=m.find("."+a),e.length?e.get(0):null)},exitFull:function(){var i;e(window).off("resize."+y,c),void 0!==n&&e("body").css("overflow",n),n=void 0,t&&(i=t.elm,l(i),e(i).trigger("resize",{fullscreen:"off"})),e(window).trigger("resize")},toFull:function(t){return n=e("body").css("overflow")||"",e("body").css("overflow","hidden"),e(t).css(u.getMaximizeCss()).addClass(a).trigger("resize",{fullscreen:"on"}),r(),e(window).on("resize."+y,c).trigger("resize"),!0}},l=function(n){t&&t.elm==n&&(e(n).removeClass(a+" "+o).attr("style",t.style),t=null)},c=function(t){var n;t.target===window&&(i&&cancelAnimationFrame(i),i=requestAnimationFrame(function(){(n=s.fullElm())&&e(n).trigger("resize",{fullscreen:"on"})}))};e(document).on("fullscreenchange."+y+" webkitfullscreenchange."+y+" mozfullscreenchange."+y+" MSFullscreenChange."+y,function(n){if(u.UA.Fullscreen){var d=s.fullElm(),p=e(window);i&&cancelAnimationFrame(i),null===d?(p.off("resize."+y,c),t&&(d=t.elm,l(d),e(d).trigger("resize",{fullscreen:"off"}))):(e(d).addClass(a+" "+o).attr("style","width:100%; height:100%; margin:0; padding:0;").trigger("resize",{fullscreen:"on"}),p.on("resize."+y,c),r()),p.trigger("resize")}}),u.toggleFullscreen=function(n,i){var a=e(n).get(0),o=null;if(o=s.fullElm()){if(o==a){if(i===!0)return o}else if(i===!1)return o;return s.exitFull(),null}return i===!1?null:(t={elm:a,style:e(a).attr("style")},s.toFull(a)!==!1?a:(t=null,null))}}(),function(){var t,n="elfinder-maximized",i=function(e){if(e.target===window&&e.data&&e.data.elm){var n=e.data.elm;t&&cancelAnimationFrame(t),t=requestAnimationFrame(function(){n.trigger("resize",{maximize:"on"})})}},a=function(t){e(window).off("resize."+y,i),e("body").css("overflow",t.data("bodyOvf")),t.removeClass(n).attr("style",t.data("orgStyle")).removeData("bodyOvf").removeData("orgStyle"),t.trigger("resize",{maximize:"off"})},o=function(t){t.data("bodyOvf",e("body").css("overflow")||"").data("orgStyle",t.attr("style")).addClass(n).css(u.getMaximizeCss()),e("body").css("overflow","hidden"),e(window).on("resize."+y,{elm:t},i),t.trigger("resize",{maximize:"on"})};u.toggleMaximize=function(t,i){var r=e(t),s=r.hasClass(n);if(s){if(i===!0)return;a(r)}else{if(i===!1)return;o(r)}}}(),Object.assign(e.ui.keyCode,{F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,DIG0:48,DIG1:49,DIG2:50,DIG3:51,DIG4:52,DIG5:53,DIG6:54,DIG7:55,DIG8:56,DIG9:57,NUM0:96,NUM1:97,NUM2:98,NUM3:99,NUM4:100,NUM5:101,NUM6:102,NUM7:103,NUM8:104,NUM9:105,CONTEXTMENU:93,DOT:190}),this.dragUpload=!1,this.xhrUpload=("undefined"!=typeof XMLHttpRequestUpload||"undefined"!=typeof XMLHttpRequestEventTarget)&&"undefined"!=typeof File&&"undefined"!=typeof FormData,this.transport={},"object"==typeof this.options.transport&&(this.transport=this.options.transport,"function"==typeof this.transport.init&&this.transport.init(this)),"function"!=typeof this.transport.send&&(this.transport.send=function(t){return e.ajax(t)}),"iframe"==this.transport.upload?this.transport.upload=e.proxy(this.uploads.iframe,this):"function"==typeof this.transport.upload?this.dragUpload=!!this.options.dragUploadAllow:this.xhrUpload&&this.options.dragUploadAllow?(this.transport.upload=e.proxy(this.uploads.xhr,this),this.dragUpload=!0):this.transport.upload=e.proxy(this.uploads.iframe,this),this.decodeRawString=function(e){var t=function(e){var t,n,i;for(t=0,n=e.length,i=[];t<n;t++)i.push(e.charCodeAt(t));return i},n=function(e){var n,i,a,o=[];for("string"==typeof e&&(e=t(e)),n=0,i=e.length;a=e[n],n<i;n++)a>=55296&&a<=56319?o.push((1023&a)+64<<10|1023&e[++n]):o.push(a);return o},i=function(e){var t,n,i,a,o=String.fromCharCode;for(t=0,n=e.length,a="";i=e[t],t<n;t++)a+=i<=127?o(i):i<=223&&i>=194?o((31&i)<<6|63&e[++t]):i<=239&&i>=224?o((15&i)<<12|(63&e[++t])<<6|63&e[++t]):i<=247&&i>=240?o(55296|((7&i)<<8|(63&e[++t])<<2|e[++t]>>>4&3)-64,56320|(15&e[t++])<<6|63&e[t]):o(65533);return a};return i(n(e))},this.getContents=function(t,n){var i,a,o=this,r=e.Deferred(),s=n||"arraybuffer";return r.fail(function(){a&&"pending"===a.state()&&a.reject()}),i=o.openUrl(t),o.isSameOrigin(i)||(i=o.openUrl(t,!0)),a=o.request({data:{cmd:"get"},options:{url:i,type:"get",cache:!0,dataType:"binary",responseType:s,processData:!1}}).fail(function(){r.reject()}).done(function(e){r.resolve(e)}),r},this.getMimetype=function(e,t){var n,i,a=t;return i=(e+"").match(/\.([^.]+)$/),i&&(n=i[1])&&(o||(o=u.arrayFlip(u.mimeTypes)),(a=o[n.toLowerCase()])||(a=t)),a},u.hashCheckers=[],function(t){var n={check:!0},i=function(e){var i,a=new n.SparkMD5.ArrayBuffer;return i=t.asyncJob(function(e){a.append(e)},e).done(function(){i._md5=a.end()})},a=function(i,a){var o,r;try{o=new n.jsSHA("SHA"+("3"===a.substr(0,1)?a:"-"+a),"ARRAYBUFFER"),r=t.asyncJob(function(e){o.update(e)},i).done(function(){r._sha=o.getHash("HEX")})}catch(s){r=e.Deferred.reject()}return r};t.options.cdns.sparkmd5&&t.hashCheckers.push("md5"),t.options.cdns.jssha&&(t.hashCheckers=t.hashCheckers.concat(["sha1","sha224","sha256","sha384","sha512","sha3-224","sha3-256","sha3-384","sha3-512","shake128","shake256"])),t.getContentsHashes=function(o,r){var s,l=e.Deferred(),c=t.arrayFlip(r||["md5"],!0),d=[],p=[],u={};if(l.fail(function(){s&&s.reject()}),n.check){delete n.check;var h=e.Deferred();window.ArrayBuffer&&t.options.cdns.sparkmd5&&(d.push(h),t.loadScript([t.options.cdns.sparkmd5],function(e){var t=e||window.SparkMD5;window.SparkMD5&&delete window.SparkMD5,h.resolve(),t&&(n.SparkMD5=t)},{tryRequire:!0,error:function(){h.reject()}}));var f=e.Deferred();window.ArrayBuffer&&t.options.cdns.jssha&&(d.push(f),t.loadScript([t.options.cdns.jssha],function(e){var t=e||window.jsSHA;window.jsSHA&&delete window.jsSHA,f.resolve(),t&&(n.jsSHA=t)},{tryRequire:!0,error:function(){f.reject()}}))}return e.when.apply(null,d).always(function(){Object.keys(n).length?s=t.getContents(o).done(function(r){var s=r instanceof ArrayBuffer&&r.byteLength>0&&t.sliceArrayBuffer(r,1048576);c.md5&&n.SparkMD5&&p.push(function(){var e=i(s).done(function(){var n;u.md5=e._md5,(n=t.file(o))&&(n.md5=e._md5),l.notify(u)});return l.fail(function(){e.reject()}),e}),n.jsSHA&&e.each(["1","224","256","384","512","3-224","3-256","3-384","3-512","ke128","ke256"],function(e,n){c["sha"+n]&&p.push(function(){var e=a(s,n).done(function(){var i;u["sha"+n]=e._sha,(i=t.file(o))&&(i["sha"+n]=e._sha),l.notify(u)});return e})}),p.length?t.sequence(p).always(function(){l.resolve(u)}):l.reject()}).fail(function(){l.reject()}):l.reject()}),l}}(this),this.error=function(){var e=arguments[0],t=arguments[1]||null;return 1==arguments.length&&"function"==typeof e?u.bind("error",e):e===!0?this:u.trigger("error",{error:e,opts:t})},e.each(A,function(t,n){u[n]=function(){var t=arguments[0];return 1==arguments.length&&"function"==typeof t?u.bind(n,t):u.trigger(n,e.isPlainObject(t)?t:{})}}),this.enable(function(){!z&&u.api&&u.visible()&&u.ui.overlay.is(":hidden")&&!m.children(".elfinder-dialog."+u.res("class","editing")+":visible").length&&(z=!0,document.activeElement&&document.activeElement.blur(),m.removeClass("elfinder-disabled"))}).disable(function(){T=z,z=!1,m.addClass("elfinder-disabled")}).open(function(){D=[]}).select(function(t){var n=0,i=[];D=e.grep(t.data.selected||t.data.value||[],function(e){return i.length||u.maxTargets&&++n>u.maxTargets?(i.push(e),!1):!!j[e]}),i.length&&(u.trigger("unselectfiles",{files:i,inselect:!0}),u.toast({mode:"warning",msg:u.i18n(["errMaxTargets",u.maxTargets])}))}).error(function(t){var n={cssClass:"elfinder-dialog-error",title:u.i18n(u.i18n("error")),resizable:!1,destroyOnClose:!0,buttons:{}};n.buttons[u.i18n(u.i18n("btnClose"))]=function(){e(this).elfinderdialog("close")},t.data.opts&&e.isPlainObject(t.data.opts)&&Object.assign(n,t.data.opts),u.dialog('<span class="elfinder-dialog-icon elfinder-dialog-icon-error"/>'+u.i18n(t.data.error),n)}).bind("tmb",function(t){e.each(t.data.images||[],function(e,t){j[e]&&(j[e].tmb=t)})}).bind("searchstart",function(e){Object.assign(u.searchStatus,e.data),u.searchStatus.state=1}).bind("search",function(e){u.searchStatus.state=2}).bind("searchend",function(){u.searchStatus.state=0,u.searchStatus.ininc=!1,u.searchStatus.mixed=!1}).bind("canMakeEmptyFile",function(t){var n=t.data,i={};n&&Array.isArray(n.mimes)&&(n.unshift||(i=u.mimesCanMakeEmpty),e.each(n.mimes,function(){i[this]||(i[this]=u.mimeTypes[this])}),n.unshift&&(u.mimesCanMakeEmpty=Object.assign(i,u.mimesCanMakeEmpty)))}),!0===this.options.sound&&this.bind("playsound",function(t){var n=K.canPlayType&&K.canPlayType('audio/wav; codecs="1"'),i=t.data&&t.data.soundFile;n&&i&&""!=n&&"no"!=n&&e(K).html('<source src="'+B+i+'" type="audio/wav">')[0].play()}),e.each(this.options.handlers,function(e,t){u.bind(e,t)}),this.history=new this.history(this),this.roots={},this.leafRoots={},this.volumeExpires={},this._commands={},Array.isArray(this.options.commands)||(this.options.commands=[]),e.inArray("*",this.options.commands)!==-1&&(this.options.commands=Object.keys(this.commands)),this.commandMap={},this.volOptions={},this.hasVolOptions=!1,this.trashes={},this.optionsByHashes={},this.uiAutoHide=[],this.one("open",function(){u.uiAutoHide.length&&setTimeout(function(){u.trigger("uiautohide")},500)}),this.bind("uiautohide",function(){u.uiAutoHide.length&&u.uiAutoHide.shift()()}),this.options.width&&(N=this.options.width),this.options.height&&(L=this.options.height),this.options.heightBase&&(W=e(this.options.heightBase)),B=this.options.soundPath?this.options.soundPath.replace(/\/+$/,"")+"/":this.baseUrl+B,u.one("opendone",function(){var t;e(document).on("click."+y,function(t){z&&!u.options.enableAlways&&!e(t.target).closest(m).length&&u.disable()}).on(x+" "+k+" "+C+" "+w,ae),u.options.useBrowserHistory&&e(window).on("popstate."+y,function(t){var n,i,a=t.originalEvent.state||{},o=!!a.thash,r=m.find(".elfinder-frontmost:visible"),s=m.find(".elfinder-navbar-dir,.elfinder-cwd-filename").find("input,textarea");o||(a={thash:u.cwd().hash},e("html,body").animate({scrollTop:m.offset().top})),r.length||s.length?(history.pushState(a,null,location.pathname+location.search+"#elf_"+a.thash),r.length?r.hasClass(u.res("class","preventback"))||(r.hasClass("elfinder-contextmenu")?e(document).trigger(e.Event("keydown",{keyCode:e.ui.keyCode.ESCAPE,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1})):r.hasClass("elfinder-dialog")?r.elfinderdialog("close"):r.trigger("close")):s.trigger(e.Event("keydown",{keyCode:e.ui.keyCode.ESCAPE,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}))):o?!e.isEmptyObject(u.files())&&u.request({data:{cmd:"open",target:a.thash,onhistory:1},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!0}):(n=function(){i.trigger("click")},u.one("open",n,!0),i=u.toast({msg:u.i18n("pressAgainToExit"),onHidden:function(){u.unbind("open",n),history.pushState(a,null,location.pathname+location.search+"#elf_"+a.thash)}}))}),e(window).on("resize."+y,function(e){e.target===this&&(t&&cancelAnimationFrame(t),t=requestAnimationFrame(function(){var e=m.data("resizeSize")||{w:0,h:0},t={w:Math.round(m.width()),h:Math.round(m.height())};m.data("resizeSize",t),t.w===e.w&&t.h===e.h||(m.trigger("resize"),u.trigger("resize",{width:t.w,height:t.h}))}))}).on("beforeunload."+y,function(t){var n,i;return m.is(":visible")&&(u.ui.notify.children().length&&e.inArray("hasNotifyDialog",u.options.windowCloseConfirm)!==-1?n=u.i18n("ntfsmth"):m.find("."+u.res("class","editing")).length&&e.inArray("editingFile",u.options.windowCloseConfirm)!==-1?n=u.i18n("editingFile"):(i=Object.keys(u.selected()).length)&&e.inArray("hasSelectedItem",u.options.windowCloseConfirm)!==-1?n=u.i18n("hasSelected",""+i):(i=Object.keys(u.clipboard()).length)&&e.inArray("hasClipboardData",u.options.windowCloseConfirm)!==-1&&(n=u.i18n("hasClipboard",""+i)),n)?(t.returnValue=n,n):void u.trigger("unload")}),e(window).on("message."+y,function(e){var t,n,i=e.originalEvent||null;if(i&&0===u.uploadURL.indexOf(i.origin))try{t=JSON.parse(i.data),n=t.data||null,n&&(n.error?(t.bind&&u.trigger(t.bind+"fail",n),u.error(n.error)):(n.warning&&u.error(n.warning),u.updateCache(n),n.removed&&n.removed.length&&u.remove(n),n.added&&n.added.length&&u.add(n),n.changed&&n.changed.length&&u.change(n),t.bind&&(u.trigger(t.bind,n),u.trigger(t.bind+"done")),n.sync&&u.sync()))}catch(e){u.sync()}}),u.options.enableAlways?(e(window).on("focus."+y,function(e){e.target===this&&u.enable()}),re&&e(window.top).on("focus."+y,function(){!u.enable()||se&&!se.is(":visible")||requestAnimationFrame(function(){e(window).trigger("focus")})})):re&&e(window).on("blur."+y,function(e){z&&e.target===this&&u.disable()}),re&&m.on("click",function(t){e(window).trigger("focus")}),u.options.enableByMouseOver&&m.on("mouseenter touchstart",function(t){re&&e(window).trigger("focus"),!u.enabled()&&u.enable()})}),m[0].elfinder=this,h.push(function(){var t=u.lang,n=u.baseUrl+"js/i18n/elfinder."+t+".js",i=e.Deferred().done(function(){u.i18[t]&&(u.lang=t),u.trigger("i18load"),c="en"===u.lang?u.i18.en:e.extend(!0,{},u.i18.en,u.i18[u.lang])});return u.i18[t]?i.resolve():(u.lang="en",u.hasRequire?require([n],function(){i.resolve()},function(){i.resolve()}):u.loadScript([n],function(){i.resolve()},{loadType:"tag",error:function(){i.resolve()}})),i}()),d=function(){var t;return u.messages=c.messages,e.fn.selectable&&e.fn.draggable&&e.fn.droppable&&e.fn.resizable&&e.fn.slider?m.length?u.options.url?(t=Object.assign({name:u.i18n("name"),perm:u.i18n("perms"),date:u.i18n("modify"),size:u.i18n("size"),kind:u.i18n("kind"),modestr:u.i18n("mode"),modeoct:u.i18n("mode"),modeboth:u.i18n("mode")},u.options.uiOptions.cwd.listView.columnsCustomName),u.getColumnName=function(e){return t[e]||u.i18n(e)},u.direction=c.direction,u.dateFormat=u.options.dateFormat||c.dateFormat,u.fancyFormat=u.options.fancyDateFormat||c.fancyDateFormat,u.nonameDateFormat=(u.options.nonameDateFormat||c.nonameDateFormat).replace(/[\/\\]/g,"_"),u.cssClass="ui-helper-reset ui-helper-clearfix ui-widget ui-widget-content ui-corner-all elfinder elfinder-"+("rtl"==u.direction?"rtl":"ltr")+(u.UA.Touch?" elfinder-touch"+(u.options.resizable?" touch-punch":""):"")+(u.UA.Mobile?" elfinder-mobile":"")+(u.UA.iOS?" elfinder-ios":"")+" "+u.options.cssClass,m.addClass(u.cssClass).on(w,function(){!z&&u.enable()}),function(){var t,n,i,a,o,r=x+"draggable keyup."+y+"draggable";u.draggable={appendTo:m,addClasses:!1,distance:4,revert:!0,refreshPositions:!1,cursor:"crosshair",cursorAt:{left:50,top:47},scroll:!1,start:function(r,s){var l,c,d=s.helper,p=e.grep(d.data("files")||[],function(e){return!!e&&(R[e]=!0,!0)}),h=!1;for(o=m.attr("style"),m.width(m.width()).height(m.height()),t="ltr"===u.direction,n=u.getUI("workzone").data("rectangle"),i=n.top+n.height,a=i-u.getUI("navdock").outerHeight(!0),u.draggingUiHelper=d,l=p.length;l--;)if(c=p[l],j[c].locked){h=!0,d.data("locked",!0);break}!h&&u.trigger("lockfiles",{files:p}),d.data("autoScrTm",setInterval(function(){d.data("autoScr")&&u.autoScroll[d.data("autoScr")](d.data("autoScrVal"))},50))},drag:function(o,r){var s,l,c,d=r.helper;((l=n.top>o.pageY)||a<o.pageY)&&(s=n.cwdEdge>o.pageX?(t?"navbar":"cwd")+(l?"Up":"Down"):(t?"cwd":"navbar")+(l?"Up":"Down"),l||("cwd"===s.substr(0,3)?i<o.pageY?c=i:s=null:c=a),s&&(d.data("autoScr",s),d.data("autoScrVal",Math.pow(l?n.top-o.pageY:o.pageY-c,1.3)))),s||d.data("autoScr")&&d.data("refreshPositions",1).data("autoScr",null),d.data("refreshPositions")&&e(this).elfUiWidgetInstance("draggable")&&(d.data("refreshPositions")>0?(e(this).draggable("option",{refreshPositions:!0,elfRefresh:!0}),d.data("refreshPositions",-1)):(e(this).draggable("option",{refreshPositions:!1,elfRefresh:!1}),d.data("refreshPositions",null)))},stop:function(t,n){var i,a=n.helper;e(document).off(r),e(this).elfUiWidgetInstance("draggable")&&e(this).draggable("option",{refreshPositions:!1}),u.draggingUiHelper=null,u.trigger("focus").trigger("dragstop"),a.data("droped")||(i=e.grep(a.data("files")||[],function(e){return!!e}),u.trigger("unlockfiles",{files:i}),u.trigger("selectfiles",{files:u.selected()})),u.enable(),m.attr("style",o),a.data("autoScrTm")&&clearInterval(a.data("autoScrTm"))},helper:function(t,n){var i,a,o,s=this.id?e(this):e(this).parents("[id]:first"),l=e('<div class="elfinder-drag-helper"><span class="elfinder-drag-helper-icon-status"/></div>'),c=function(t){var n,i=t.mime,a=u.tmb(t);return n='<div class="elfinder-cwd-icon elfinder-cwd-icon-drag '+u.mime2class(i)+' ui-corner-all"/>',a&&(n=e(n).addClass(a.className).css("background-image","url('"+a.url+"')").get(0).outerHTML),n};return u.draggingUiHelper&&u.draggingUiHelper.stop(!0,!0),u.trigger("dragstart",{target:s[0],originalEvent:t},!0),i=s.hasClass(u.res("class","cwdfile"))?u.selected():[u.navId2Hash(s.attr("id"))],l.append(c(j[i[0]])).data("files",i).data("locked",!1).data("droped",!1).data("namespace",y).data("dropover",0),(a=i.length)>1&&l.append(c(j[i[a-1]])+'<span class="elfinder-drag-num">'+a+"</span>"),e(document).on(r,function(e){var t=e.shiftKey||e.ctrlKey||e.metaKey;o!==t&&(o=t,l.is(":visible")&&l.data("dropover")&&!l.data("droped")&&(l.toggleClass("elfinder-drag-helper-plus",!!l.data("locked")||o),u.trigger(o?"unlockfiles":"lockfiles",{files:i,helper:l})))}),l}}}(),u.commands.getfile&&("function"==typeof u.options.getFileCallback?(u.bind("dblclick",function(e){e.preventDefault(),u.exec("getfile").fail(function(){u.exec("open",e.data&&e.data.file?[e.data.file]:void 0)})}),u.shortcut({pattern:"enter",description:u.i18n("cmdgetfile"),callback:function(){u.exec("getfile").fail(function(){u.exec("mac"==u.OS?"rename":"open")})}}).shortcut({pattern:"ctrl+enter",description:u.i18n("mac"==u.OS?"cmdrename":"cmdopen"),callback:function(){u.exec("mac"==u.OS?"rename":"open")}})):u.options.getFileCallback=null),e.each(u.commands,function(t,n){var i,a,o=Object.assign({},n.prototype);if(e.isFunction(n)&&!u._commands[t]&&(n.prototype.forceLoad||e.inArray(t,u.options.commands)!==-1)){if(i=n.prototype.extendsCmd||""){if(!e.isFunction(u.commands[i]))return!0;n.prototype=Object.assign({},_,new u.commands[i],n.prototype)}else n.prototype=Object.assign({},_,n.prototype);u._commands[t]=new n,n.prototype=o,a=u.options.commandsOptions[t]||{},i&&u.options.commandsOptions[i]&&(a=e.extend(!0,{},u.options.commandsOptions[i],a)),u._commands[t].setup(t,a),u._commands[t].linkedCmds.length&&e.each(u._commands[t].linkedCmds,function(t,n){var i=u.commands[n];e.isFunction(i)&&!u._commands[n]&&(i.prototype=_,u._commands[n]=new i,u._commands[n].setup(n,u.options.commandsOptions[n]||{}))})}}),u.ui={workzone:e("<div/>").appendTo(m).elfinderworkzone(u),navbar:e("<div/>").appendTo(m).elfindernavbar(u,u.options.uiOptions.navbar||{}),navdock:e("<div/>").appendTo(m).elfindernavdock(u,u.options.uiOptions.navdock||{}),contextmenu:e("<div/>").appendTo(m).elfindercontextmenu(u),overlay:e("<div/>").appendTo(m).elfinderoverlay({show:function(){u.disable()},hide:function(){T&&u.enable()}}),cwd:e("<div/>").appendTo(m).elfindercwd(u,u.options.uiOptions.cwd||{}),notify:u.dialog("",{cssClass:"elfinder-dialog-notify",position:u.options.notifyDialog.position,absolute:!0,resizable:!1,autoOpen:!1,closeOnEscape:!1,title:"&nbsp;",width:parseInt(u.options.notifyDialog.width)}),statusbar:e('<div class="ui-widget-header ui-helper-clearfix ui-corner-bottom elfinder-statusbar"/>').hide().appendTo(m),toast:e('<div class="elfinder-toast"/>').appendTo(m),bottomtray:e('<div class="elfinder-bottomtray">').appendTo(m)},e.each(u.options.ui||[],function(t,n){var i="elfinder"+n,a=u.options.uiOptions[n]||{};!u.ui[n]&&e.fn[i]&&(u.ui[n]=e("<"+(a.tag||"div")+"/>").appendTo(m),u.ui[n][i](u,a))}),u.resize(N,L),u.options.resizable&&(m.resizable({resize:function(e,t){u.resize(t.size.width,t.size.height)},handles:"se",minWidth:300,minHeight:200}),u.UA.Touch&&m.addClass("touch-punch")),function(){var e=u.getUI("navbar"),t=u.getUI("cwd").parent();u.autoScroll={navbarUp:function(t){e.scrollTop(Math.max(0,e.scrollTop()-t))},navbarDown:function(t){e.scrollTop(e.scrollTop()+t)},cwdUp:function(e){t.scrollTop(Math.max(0,t.scrollTop()-e))},cwdDown:function(e){t.scrollTop(t.scrollTop()+e)}}}(),u.UA.Touch&&!function(){var e,t,n,i,a,o,r,s,l,c=u.getUI("navbar"),d=u.getUI("toolbar"),p="touchmove.stopscroll",h=function(e){var n=e.originalEvent.touches||[{}],i=n[0].pageY||null;(!t||i<t)&&(e.preventDefault(),s&&clearTimeout(s))},f=function(e){e.preventDefault(),s&&clearTimeout(s)},g=function(){s=setTimeout(function(){m.off(p)},100)},v=50;c=c.children().length?c:null,d=d.length?d:null,m.on("touchstart touchmove touchend",function(s){if("touchend"===s.type)return e=!1,t=!1,void g();var b,y,w,x,k,C=s.originalEvent.touches||[{}],z=C[0].pageX||null,T=C[0].pageY||null,A="ltr"===u.direction;null===z||null===T||"touchstart"===s.type&&C.length>1||("touchstart"===s.type?(n=m.offset(),i=m.width(),c&&(e=!1,c.is(":hidden")?(l||(l=Math.max(50,i/10)),(A?z-n.left:i+n.left-z)<l&&(e=z)):s.originalEvent._preventSwipeX||(o=c.width(),y=A?z<n.left+o:z>n.left+i-o,y?(l=Math.max(50,i/10),e=z):e=!1)),d&&(t=!1,s.originalEvent._preventSwipeY||(r=d.height(),a=n.top,T-a<(d.is(":hidden")?v:r+30)&&(t=T,m.on(p,d.is(":hidden")?f:h))))):(c&&e!==!1&&(b=(A?e>z:e<z)?"navhide":"navshow",w=Math.abs(e-z),("navhide"===b&&w>.6*o||w>("navhide"===b?o/3:45)&&("navshow"===b||(A?z<n.left+20:z>n.left+i-20)))&&(u.getUI("navbar").trigger(b,{handleW:l}),e=!1)),d&&t!==!1&&(x=d.offset().top,Math.abs(t-T)>Math.min(45,r/3)&&(k=t>T?"slideUp":"slideDown",("slideDown"===k||x+20>T)&&(d.is("slideDown"===k?":hidden":":visible")&&d.stop(!0,!0).trigger("toggle",{duration:100,handleH:v}),t=!1)))))})}(),u.dragUpload&&!function(){var t,n,i=function(t){return"TEXTAREA"!==t.target.nodeName&&"INPUT"!==t.target.nodeName&&0===e(t.target).closest("div.ui-dialog-content").length},a="native-drag-enter",o="native-drag-disable",r="class",s=u.res(r,"navdir"),l=(u.res(r,"droppable"),u.res(r,"adroppable"),u.res(r,"navarrow"),u.res(r,"adroppable")),c=u.getUI("workzone"),d="ltr"===u.direction,p=function(){n&&cancelAnimationFrame(n),n=null};m.on("dragenter",function(e){p(),i(e)&&(e.preventDefault(),e.stopPropagation(),t=c.data("rectangle"))}).on("dragleave",function(e){p(),i(e)&&(e.preventDefault(),e.stopPropagation())}).on("dragover",function(e){var a;i(e)?(e.preventDefault(),e.stopPropagation(),e.originalEvent.dataTransfer.dropEffect="none",n||(n=requestAnimationFrame(function(){var i,o=t.top+t.height,r=o-u.getUI("navdock").outerHeight(!0);((a=e.pageY<t.top)||e.pageY>r)&&(i=t.cwdEdge>e.pageX?(d?"navbar":"cwd")+(a?"Up":"Down"):(d?"cwd":"navbar")+(a?"Up":"Down"),a||"cwd"===i.substr(0,3)&&(o<e.pageY?r=o:i=""),i&&u.autoScroll[i](Math.pow(a?t.top-e.pageY:e.pageY-r,1.3))),n=null}))):p()}).on("drop",function(e){p(),i(e)&&(e.stopPropagation(),e.preventDefault())}),m.on("dragenter",".native-droppable",function(t){if(t.originalEvent.dataTransfer){var n,i=e(t.currentTarget),r=t.currentTarget.id||null,s=null;if(!r){s=u.cwd(),i.data(o,!1);try{e.each(t.originalEvent.dataTransfer.types,function(e,t){"elfinderfrom:"===t.substr(0,13)&&(n=t.substr(13).toLowerCase())})}catch(t){}}s&&(!s.write||n&&n===(window.location.href+s.hash).toLowerCase())?i.data(o,!0):(t.preventDefault(),t.stopPropagation(),i.data(a,!0),i.addClass(l))}}).on("dragleave",".native-droppable",function(t){if(t.originalEvent.dataTransfer){var n=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),n.data(a)?n.data(a,!1):n.removeClass(l)}}).on("dragover",".native-droppable",function(t){if(t.originalEvent.dataTransfer){var n=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),t.originalEvent.dataTransfer.dropEffect=n.data(o)?"none":"copy",n.data(a,!1)}}).on("drop",".native-droppable",function(t){if(t.originalEvent&&t.originalEvent.dataTransfer){var n,i=e(t.currentTarget);t.preventDefault(),t.stopPropagation(),i.removeClass(l),n=t.currentTarget.id?i.hasClass(s)?u.navId2Hash(t.currentTarget.id):u.cwdId2Hash(t.currentTarget.id):u.cwd().hash,t.originalEvent._target=n,u.exec("upload",{dropEvt:t.originalEvent,target:n},void 0,n)}})}(),null===u.cssloaded?!function(){var e,t,n=function(){m.data("cssautoloadHide")&&(m.data("cssautoloadHide").remove(),m.removeData("cssautoloadHide")),u.cssloaded=!0,requestAnimationFrame(function(){u.trigger("cssloaded")})};"hidden"===m.css("visibility")?(e=1e3,t=setInterval(function(){(--e<0||"hidden"!==m.css("visibility"))&&(clearInterval(t),n())},10)):n()}():(u.cssloaded=!0,u.trigger("cssloaded")),u.zIndexCalc(),void u.trigger("init").request({data:{cmd:"open",target:u.startDir(),init:1,tree:1},preventDone:!0,notify:{type:"open",cnt:1,hideCnt:!0},freeze:!0}).fail(function(){u.trigger("fail").disable().lastDir(""),U={},E={},e(document).add(m).off("."+y),u.trigger=function(){}}).done(function(t){var n=function(e){var t=u.file(u.trashes[e]);u.options.debug;t&&t.volumeid&&delete u.volOptions[t.volumeid].trashHash,u.trashes[e]=!1,u.debug("backend-error",'Trash hash "'+e+'" was not found or not writable.')},i={};u.options.rawStringDecoder&&u.registRawStringDecoder(u.options.rawStringDecoder),u.zIndexCalc(),u.load().debug("api",u.api),m.trigger("resize"),J(t),u.trigger("open",t,!1),u.trigger("opendone"),re&&u.options.enableAlways&&e(window).trigger("focus"),e.each(u.trashes,function(e){var t=u.file(e);t?"directory"===t.mime&&t.write||n(e):i[e]=!0}),Object.keys(i).length&&u.request({data:{cmd:"info",targets:Object.keys(i)},preventDefault:!0}).done(function(t){t&&t.files&&e.each(t.files,function(e,t){"directory"===t.mime&&t.write&&delete i[t.hash]})}).always(function(){e.each(i,n)}),u[u.options.enableAlways?"enable":"disable"]()})):alert(u.i18n("errURL")):alert(u.i18n("errNode")):alert(u.i18n("errJqui"))},a&&"function"==typeof a&&(u.bootCallback=a,a.call(m.get(0),u,{dfrdsBeforeBootup:h})),e.when.apply(null,h).done(function(){d()}).fail(function(e){u.error(e)})};return("undefined"==typeof n||n)&&(window.elFinder=i),i.prototype={uniqueid:0,res:function(e,t){return this.resources[e]&&this.resources[e][t]},OS:navigator.userAgent.indexOf("Mac")!==-1?"mac":navigator.userAgent.indexOf("Win")!==-1?"win":"other",UA:function(){var e=!document.unqueID&&!window.opera&&!window.sidebar&&window.localStorage&&"WebkitAppearance"in document.documentElement.style,t=e&&window.chrome,n={ltIE6:"undefined"==typeof window.addEventListener&&"undefined"==typeof document.documentElement.style.maxHeight,ltIE7:"undefined"==typeof window.addEventListener&&"undefined"==typeof document.querySelectorAll,ltIE8:"undefined"==typeof window.addEventListener&&"undefined"==typeof document.getElementsByClassName,ltIE9:document.uniqueID&&document.documentMode<=9,ltIE10:document.uniqueID&&document.documentMode<=10,gtIE11:document.uniqueID&&document.documentMode>=11,IE:document.uniqueID,Firefox:window.sidebar,Opera:window.opera,Webkit:e,Chrome:t,Edge:!(!t||!window.msCredentials),Safari:e&&!window.chrome,Mobile:"undefined"!=typeof window.orientation,Touch:"undefined"!=typeof window.ontouchstart,iOS:navigator.platform.match(/^iP(?:[ao]d|hone)/),Fullscreen:"undefined"!=typeof(document.exitFullscreen||document.webkitExitFullscreen||document.mozCancelFullScreen||document.msExitFullscreen),
Angle:0,Rotated:!1,CSS:function(){var e,t=document.createElement("a").style,n=document.createElement("p").style;return e="position:sticky;position:-webkit-sticky;",e+="width:-webkit-max-content;width:-moz-max-content;width:-ms-max-content;width:max-content;",t.cssText=e,{positionSticky:t.position.indexOf("sticky")!==-1,widthMaxContent:t.width.indexOf("max-content")!==-1,flex:"undefined"!=typeof n.flex}}()};return n}(),hasRequire:"function"==typeof define&&define.amd,currentReqCmd:"",keyState:{},i18:{en:{translator:"",language:"English",direction:"ltr",dateFormat:"d.m.Y H:i",fancyDateFormat:"$1 H:i",nonameDateFormat:"ymd-His",messages:{}},months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["msJan","msFeb","msMar","msApr","msMay","msJun","msJul","msAug","msSep","msOct","msNov","msDec"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},kinds:{unknown:"Unknown",directory:"Folder",group:"Selects",symlink:"Alias","symlink-broken":"AliasBroken","application/x-empty":"TextPlain","application/postscript":"Postscript","application/vnd.ms-office":"MsOffice","application/msword":"MsWord","application/vnd.ms-word":"MsWord","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"MsWord","application/vnd.ms-word.document.macroEnabled.12":"MsWord","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"MsWord","application/vnd.ms-word.template.macroEnabled.12":"MsWord","application/vnd.ms-excel":"MsExcel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"MsExcel","application/vnd.ms-excel.sheet.macroEnabled.12":"MsExcel","application/vnd.openxmlformats-officedocument.spreadsheetml.template":"MsExcel","application/vnd.ms-excel.template.macroEnabled.12":"MsExcel","application/vnd.ms-excel.sheet.binary.macroEnabled.12":"MsExcel","application/vnd.ms-excel.addin.macroEnabled.12":"MsExcel","application/vnd.ms-powerpoint":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.presentation":"MsPP","application/vnd.ms-powerpoint.presentation.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.slideshow":"MsPP","application/vnd.ms-powerpoint.slideshow.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.template":"MsPP","application/vnd.ms-powerpoint.template.macroEnabled.12":"MsPP","application/vnd.ms-powerpoint.addin.macroEnabled.12":"MsPP","application/vnd.openxmlformats-officedocument.presentationml.slide":"MsPP","application/vnd.ms-powerpoint.slide.macroEnabled.12":"MsPP","application/pdf":"PDF","application/xml":"XML","application/vnd.oasis.opendocument.text":"OO","application/vnd.oasis.opendocument.text-template":"OO","application/vnd.oasis.opendocument.text-web":"OO","application/vnd.oasis.opendocument.text-master":"OO","application/vnd.oasis.opendocument.graphics":"OO","application/vnd.oasis.opendocument.graphics-template":"OO","application/vnd.oasis.opendocument.presentation":"OO","application/vnd.oasis.opendocument.presentation-template":"OO","application/vnd.oasis.opendocument.spreadsheet":"OO","application/vnd.oasis.opendocument.spreadsheet-template":"OO","application/vnd.oasis.opendocument.chart":"OO","application/vnd.oasis.opendocument.formula":"OO","application/vnd.oasis.opendocument.database":"OO","application/vnd.oasis.opendocument.image":"OO","application/vnd.openofficeorg.extension":"OO","application/x-shockwave-flash":"AppFlash","application/flash-video":"Flash video","application/x-bittorrent":"Torrent","application/javascript":"JS","application/rtf":"RTF","application/rtfd":"RTF","application/x-font-ttf":"TTF","application/x-font-otf":"OTF","application/x-rpm":"RPM","application/x-web-config":"TextPlain","application/xhtml+xml":"HTML","application/docbook+xml":"DOCBOOK","application/x-awk":"AWK","application/x-gzip":"GZIP","application/x-bzip2":"BZIP","application/x-xz":"XZ","application/zip":"ZIP","application/x-zip":"ZIP","application/x-rar":"RAR","application/x-tar":"TAR","application/x-7z-compressed":"7z","application/x-jar":"JAR","text/plain":"TextPlain","text/x-php":"PHP","text/html":"HTML","text/javascript":"JS","text/css":"CSS","text/rtf":"RTF","text/rtfd":"RTF","text/x-c":"C","text/x-csrc":"C","text/x-chdr":"CHeader","text/x-c++":"CPP","text/x-c++src":"CPP","text/x-c++hdr":"CPPHeader","text/x-shellscript":"Shell","application/x-csh":"Shell","text/x-python":"Python","text/x-java":"Java","text/x-java-source":"Java","text/x-ruby":"Ruby","text/x-perl":"Perl","text/x-sql":"SQL","text/xml":"XML","text/x-comma-separated-values":"CSV","text/x-markdown":"Markdown","image/x-ms-bmp":"BMP","image/jpeg":"JPEG","image/gif":"GIF","image/png":"PNG","image/tiff":"TIFF","image/x-targa":"TGA","image/vnd.adobe.photoshop":"PSD","image/xbm":"XBITMAP","image/pxm":"PXM","audio/mpeg":"AudioMPEG","audio/midi":"AudioMIDI","audio/ogg":"AudioOGG","audio/mp4":"AudioMPEG4","audio/x-m4a":"AudioMPEG4","audio/wav":"AudioWAV","audio/x-mp3-playlist":"AudioPlaylist","video/x-dv":"VideoDV","video/mp4":"VideoMPEG4","video/mpeg":"VideoMPEG","video/x-msvideo":"VideoAVI","video/quicktime":"VideoMOV","video/x-ms-wmv":"VideoWM","video/x-flv":"VideoFlash","video/x-matroska":"VideoMKV","video/ogg":"VideoOGG"},mimeTypes:{},rules:{defaults:function(e){return!(!e||e.added&&!Array.isArray(e.added)||e.removed&&!Array.isArray(e.removed)||e.changed&&!Array.isArray(e.changed))},open:function(t){return t&&t.cwd&&t.files&&e.isPlainObject(t.cwd)&&Array.isArray(t.files)},tree:function(e){return e&&e.tree&&Array.isArray(e.tree)},parents:function(e){return e&&e.tree&&Array.isArray(e.tree)},tmb:function(t){return t&&t.images&&(e.isPlainObject(t.images)||Array.isArray(t.images))},upload:function(t){return t&&(e.isPlainObject(t.added)||Array.isArray(t.added))},search:function(e){return e&&e.files&&Array.isArray(e.files)}},commands:{},cmdsToAdd:"archive duplicate extract mkdir mkfile paste rm upload",parseUploadData:function(t){var n,i=this;if(!e.trim(t))return{error:["errResponse","errDataEmpty"]};try{n=JSON.parse(t)}catch(a){return{error:["errResponse","errDataNotJSON"]}}return n=i.normalize(n),i.validResponse("upload",n)?(n.removed=e.merge(n.removed||[],e.map(n.added||[],function(e){return i.file(e.hash)?e.hash:null})),n):{error:response.norError||["errResponse"]}},iframeCnt:0,uploads:{xhrUploading:!1,failSyncTm:null,chunkfailReq:{},checkExists:function(t,n,i,a){var o,r=e.Deferred(),s=[],l={},c=function(){for(var e=t.length;--e>-1;)t[e]._remove=!0},d=function(){r.resolve(s,l)},p=function(){var r=[],p=[],u=n!==i.cwd().hash?i.path(n,!0)+i.option("separator",n):"",h=function(e){var n=e==p.length-1,o={cssClass:"elfinder-confirm-upload",title:i.i18n("cmdupload"),text:["errExists",u+p[e].name,"confirmRepl"],all:!n,accept:{label:"btnYes",callback:function(t){n||t?d():h(++e)}},reject:{label:"btnNo",callback:function(i){var a;if(i)for(a=p.length;e<a--;)t[p[a].i]._remove=!0;else t[p[e].i]._remove=!0;n||i?d():h(++e)}},cancel:{label:"btnCancel",callback:function(){c(),d()}},buttons:[{label:"btnBackup",cssClass:"elfinder-confirm-btn-backup",callback:function(t){var i;if(t)for(i=p.length;e<i--;)s.push(p[i].name);else s.push(p[e].name);n||t?d():h(++e)}}]};a||o.buttons.push({label:"btnRename"+(n?"":"All"),cssClass:"elfinder-confirm-btn-rename",callback:function(){s=null,d()}}),i.iframeCnt>0&&delete o.reject,i.confirm(o)};return i.file(n).read?(o=e.map(t,function(e,t){return!e.name||i.UA.iOS&&"image.jpg"===e.name?null:{i:t,name:e.name}}),void i.request({data:{cmd:"ls",target:n,intersect:e.map(o,function(e){return e.name})},notify:{type:"preupload",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(t){var a,s;t&&(t.error?c():i.options.overwriteUploadConfirm&&i.option("uploadOverwrite",n)&&t.list&&(Array.isArray(t.list)?r=t.list||[]:(a=[],r=e.map(t.list,function(e){return"string"==typeof e?e:(a=a.concat(e),!1)}),a.length&&(r=r.concat(a)),l=t.list),p=e.grep(o,function(t){return e.inArray(t.name,r)!==-1}),p.length&&r.length&&n==i.cwd().hash&&(s=e.map(i.files(n),function(e){return e.name}),e.grep(r,function(t){return e.inArray(t,s)===-1}).length&&i.sync()))),p.length>0?h(0):d()}).fail(function(e){c(),d(),e&&i.error(e)})):void d()};return i.api>=2.1&&"object"==typeof t[0]?p():d(),r},checkFile:function(t,n,i){if(t.checked||"files"==t.type)return t.files;if("data"==t.type){var a,o,r=e.Deferred(),s=e.Deferred(),l=[],c=[],d=0,p=[],u=!1,h=function(e){return Array.prototype.slice.call(e||[],0)},f=function(e){var t,i,a=n.options.folderUploadExclude[n.OS]||null,o=e.length,r=function(){--d<1&&"pending"===s.state()&&s.resolve()},m=function(e){a&&e.name.match(a)||(c.push(t.fullPath||""),l.push(e)),r()},i=function(e){var t=[],n=function(){e.readEntries(function(e){if(u||!e.length){for(var i=0;i<t.length;i++){if(u){s.reject();break}f([t[i]])}r()}else t=t.concat(h(e)),n()},r)};n()};d++;for(var g=0;g<o;g++){if(u){s.reject();break}t=e[g],t&&(t.isFile?(d++,t.file(m,r)):t.isDirectory&&n.api>=2.1&&(d++,p.push(t.fullPath),i(t.createReader())))}return r(),s};return a=e.map(t.files.items,function(e){return e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry()}),e.each(a,function(e,t){if(t.isDirectory)return o=!0,!1}),a.length>0?(n.uploads.checkExists(a,i,n,o).done(function(o,s){var d=[];n.options.overwriteUploadConfirm&&n.option("uploadOverwrite",i)&&(null===o&&(t.overwrite=0,o=[]),a=e.grep(a,function(t){var a,r,l,c;return t.isDirectory&&o.length&&(a=e.inArray(t.name,o),a!==-1&&(o.splice(a,1),r=n.uniqueName(t.name+n.options.backupSuffix,null,""),e.each(s,function(e,n){if(t.name==n)return l=e,!1}),l||(l=n.fileByName(t.name,i).hash),n.lockfiles({files:[l]}),c=n.request({data:{cmd:"rename",target:l,name:r},notify:{type:"rename",cnt:1}}).fail(function(e){t._remove=!0,n.sync()}).always(function(){n.unlockfiles({files:[l]})}),d.push(c))),!t._remove})),e.when.apply(e,d).done(function(){var e,t,i=+new Date;a.length>0?(t=n.escape(a[0].name),a.length>1&&(t+=" ... "+a.length+n.i18n("items")),e=setTimeout(function(){n.notify({type:"readdir",id:i,cnt:1,hideCnt:!0,msg:n.i18n("ntfreaddir")+" ("+t+")",cancel:function(){u=!0}})},n.options.notifyDelay),f(a).done(function(){e&&clearTimeout(e),n.notify({type:"readdir",id:i,cnt:-1}),u?r.reject():r.resolve([l,c,o,s,p])}).fail(function(){r.reject()})):r.reject()})}),r.promise()):r.reject()}var m=[],g=[],v=t.files[0];if("html"==t.type){var b,y=e("<html/>").append(e.parseHTML(v.replace(/ src=/gi," _elfsrc=")));e("img[_elfsrc]",y).each(function(){var n,i,a=e(this),o=a.closest("a");o&&o.attr("href")&&o.attr("href").match(/\.(?:jpe?g|gif|bmp|png)/i)&&(i=o.attr("href")),n=a.attr("_elfsrc"),n&&(i?(e.inArray(i,m)==-1&&m.push(i),e.inArray(n,g)==-1&&g.push(n)):e.inArray(n,m)==-1&&m.push(n)),1===m.length&&m[0].match(/^data:image\/png/)&&(t.clipdata=!0)}),b=e("a[href]",y),b.each(function(){var t,n,i=function(e){var t=document.createElement("a");return t.href=e,t};(t=e(this).text())&&(n=i(e(this).attr("href")),n.href&&n.href.match(/^(?:ht|f)tp/i)&&(1===b.length||!n.pathname.match(/(?:\.html?|\/[^\/.]*)$/i)||e.trim(t).match(/\.[a-z0-9-]{1,10}$/i))&&e.inArray(n.href,m)==-1&&e.inArray(n.href,g)==-1&&m.push(n.href))})}else{var w,x,k;for(w=/(http[^<>"{}|\\^\[\]`\s]+)/gi;x=w.exec(v);)k=x[1].replace(/&amp;/g,"&"),e.inArray(k,m)==-1&&m.push(k)}return m},xhr:function(t,n){var i=n?n:this,a=i.getUI(),o=new XMLHttpRequest,r=null,s=null,l=t.checked,c=t.isDataType||"data"==t.type,d=t.target||i.cwd().hash,p=t.dropEvt||null,u=t.extraData||null,h=i.option("uploadMaxConn",d)!=-1,f=Math.min(5,Math.max(1,i.option("uploadMaxConn",d))),m=1e4,g=30,v=0,b=function(t){var n=e.Deferred();return t.promise?t.always(function(e){n.resolve(Array.isArray(e)&&e.length?c?e[0][0]:e[0]:{})}):n.resolve(t.length?c?t[0][0]:t[0]:{}),n},y=e.Deferred().fail(function(e){var t;"userabort"===e&&(t=!0,e=void 0),x&&(i.uploads.xhrUploading||t)&&b(x).done(function(e){e._cid?i.uploads.chunkfailReq[e._cid]||(i.uploads.chunkfailReq[e._cid]=!0,setTimeout(function(){n.request({data:{cmd:"upload",target:d,chunk:e._chunk,cid:e._cid,upload:["chunkfail"],mimes:"chunkfail"},options:{type:"post",url:i.uploadURL},preventDefault:!0}).always(function(){delete i.uploads.chunkfailReq[e._chunk]})},1e3)):(i.uploads.failSyncTm&&clearTimeout(i.uploads.failSyncTm),i.uploads.failSyncTm=setTimeout(function(){i.sync(d)},1e3))}),!t&&i.sync(),i.uploads.xhrUploading=!1,x=null,e&&i.error(e)}).done(function(t){i.uploads.xhrUploading=!1,x=null,t&&(i.currentReqCmd="upload",t.warning&&i.error(t.warning),i.updateCache(t),t.removed&&t.removed.length&&i.remove(t),t.added&&t.added.length&&i.add(t),t.changed&&t.changed.length&&i.change(t),i.trigger("upload",t,!1),i.trigger("uploaddone"),t.toasts&&Array.isArray(t.toasts)&&e.each(t.toasts,function(){this.msg&&i.toast(this)}),t.sync&&i.sync(),t.debug&&n.debug("backend-debug",t))}).always(function(){i.abortXHR(o),a.off("uploadabort",M),e(window).off("unload",M),r&&clearTimeout(r),s&&clearTimeout(s),l&&!t.multiupload&&j()&&i.notify({type:"upload",cnt:-k,progress:0,size:0}),q&&I.children(".elfinder-notify-chunkmerge").length&&i.notify({type:"chunkmerge",cnt:-1})}),w=new FormData,x=t.input?t.input.files:i.uploads.checkFile(t,i,d),k=t.checked&&c?x[0].length:x.length,C=0,z=0,T=0,A=!1,I=i.ui.notify,S=!0,O=!1,j=function(){return!A&&(H=I.children(".elfinder-notify-upload")).length&&(A=!0),A},M=function(e,t){O=!0,i.abortXHR(o,{quiet:!0,abort:!0}),y.reject(t),j()&&i.notify({type:"upload",cnt:H.data("cnt")*-1,progress:0,size:0})},F=function(e){H.children(".elfinder-notify-cancel")[e?"show":"hide"]()},D=function(e){return e||(e=T),setTimeout(function(){A=!0,i.notify({type:"upload",cnt:k,progress:C-z,size:e,cancel:function(){a.trigger("uploadabort","userabort")}}),H=I.children(".elfinder-notify-upload"),z=C,t.multiupload?S&&F(!0):F(S&&C<e)},i.options.notifyDelay)},U=function(){v++<=g?(j()&&z&&i.notify({type:"upload",cnt:0,progress:0,size:z}),i.abortXHR(o,{quiet:!0}),z=C=0,setTimeout(function(){var e;O||(o.open("POST",i.uploadURL,!0),i.api>=2.1029&&(e=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),"function"==typeof w["delete"]&&w["delete"]("reqid"),w.append("reqid",e),o._requestId=e),o.send(w))},m)):a.trigger("uploadabort",["errAbort","errTimeout"])},E=function(){A&&y.notifyWith(H,[{cnt:H.data("cnt"),progress:H.data("progress"),total:H.data("total")}])},P=t.renames||null,R=t.hashes||null,q=!1,H=e();if(a.one("uploadabort",M),e(window).one("unload."+n.namespace,M),!q&&(z=C),!c&&!k)return y.reject(["errUploadNoFiles"]);o.addEventListener("error",function(){0==o.status?O?y.reject():!c&&t.files&&e.grep(t.files,function(e){return!e.type&&e.size===(i.UA.Safari?1802:0)}).length?(errors.push("errFolderUpload"),y.reject(["errAbort","errFolderUpload"])):t.input&&e.grep(t.input.files,function(e){return!e.type&&e.size===(i.UA.Safari?1802:0)}).length?y.reject(["errUploadNoFiles"]):U():a.trigger("uploadabort","errConnect")},!1),o.addEventListener("load",function(e){var n,l=o.status,d=0,p="";if(l>=400?p=l>500?"errResponse":["errResponse","errServerError"]:o.responseText||(p=["errResponse","errDataEmpty"]),p&&(a.trigger("uploadabort"),b(x).done(function(e){return y.reject(e._cid?null:p)})),C=T,j()&&(d=C-z)&&(i.notify({type:"upload",cnt:0,progress:d,size:0}),E()),n=i.parseUploadData(o.responseText),n._chunkmerged){w=new FormData;var u=[{_chunkmerged:n._chunkmerged,_name:n._name,_mtime:n._mtime}];return q=!0,a.off("uploadabort",M),s=setTimeout(function(){i.notify({type:"chunkmerge",cnt:1})},i.options.notifyDelay),void(c?_(u,x[1]):_(u))}n._multiupload=!!t.multiupload,n.error?(i.trigger("uploadfail",n),n._chunkfailure||n._multiupload?(O=!0,i.uploads.xhrUploading=!1,r&&clearTimeout(r),H.length?(i.notify({type:"upload",cnt:-k,progress:0,size:0}),y.reject(n.error)):y.reject()):y.reject(n.error)):y.resolve(n)},!1),o.upload.addEventListener("loadstart",function(e){!q&&e.lengthComputable&&(C=e.loaded,v&&(C=0),T=e.total,C||(C=parseInt(.05*T)),j()&&(i.notify({type:"upload",cnt:0,progress:C-z,size:t.multiupload?0:T}),z=C,E()))},!1),o.upload.addEventListener("progress",function(e){var n;e.lengthComputable&&!q&&o.readyState<2&&(C=e.loaded,!t.checked&&C>0&&!r&&(r=D(o._totalSize-C)),T||(T=e.total,C||(C=parseInt(.05*T))),n=C-z,j()&&n/e.total>=.05&&(i.notify({type:"upload",cnt:0,progress:n,size:0}),z=C,E()),!t.multiupload&&C>=T&&(S=!1,F(!1)))},!1);var _=function(a,s){var m,g,v,b,x,C,z,T,A,I,M,U,E,q,H=0,_=1,N=[],L=0,W=k,B=0,$=[],K=(new Date).getTime().toString().substr(-9),V=Math.min((n.uplMaxSize?n.uplMaxSize:2097152)-8190,n.options.uploadMaxChunkSize),X=!h&&"",G=function(a,o){var s,l,u=[],h=0;if(!O){for(;a.length&&u.length<o;)u.push(a.shift());if(h=u.length){l=h;for(var f=0;f<h&&!O;f++)s=c?u[f][0][0]._cid||null:u[f][0]._cid||null,E[s]?U--:n.exec("upload",{type:t.type,isDataType:c,files:u[f],checked:!0,target:d,dropEvt:p,renames:P,hashes:R,multiupload:!0,overwrite:0===t.overwrite?0:void 0},void 0,d).fail(function(e){e&&"No such command"===e&&(O=!0,n.error(["errUpload","errPerm"])),s&&(E[s]=!0)}).always(function(t){t&&t.added&&(I=e.merge(I,t.added)),U<=++M&&(n.trigger("multiupload",{added:I}),r&&clearTimeout(r),j()&&i.notify({type:"upload",cnt:-k,progress:0,size:0})),a.length?G(a,1):--l<=1&&(S=!1,F(!1))})}}(u.length<1||O)&&(O?(r&&clearTimeout(r),s&&(E[s]=!0),y.reject()):(y.resolve(),i.uploads.xhrUploading=!1))},J=function(){i.uploads.xhrUploading?setTimeout(J,100):(i.uploads.xhrUploading=!0,G(N,f))};if(!l&&(c||"files"==t.type)){for((m=n.option("uploadMaxSize",d))||(m=0),b=0;b<a.length;b++){try{T=a[b],g=T.size,X===!1&&(X="",i.api>=2.1&&("slice"in T?X="slice":"mozSlice"in T?X="mozSlice":"webkitSlice"in T&&(X="webkitSlice")))}catch(Y){k--,W--;continue}if(m&&g>m||!X&&n.uplMaxSize&&g>n.uplMaxSize)i.error(i.i18n("errUploadFile",T.name)+" "+i.i18n("errUploadFileSize")),k--,W--;else if(!T.type||i.uploadMimeCheck(T.type,d))if(X&&g>V){for(x=0,C=V,z=-1,W=Math.floor(g/V),v=T.lastModified?Math.round(T.lastModified/1e3):0,B+=g,$[K]=0;x<=g;)A=T[X](x,C),A._chunk=T.name+"."+ ++z+"_"+W+".part",A._cid=K,A._range=x+","+A.size+","+g,A._mtime=v,$[K]++,H&&L++,"undefined"==typeof N[L]&&(N[L]=[],c&&(N[L][0]=[],N[L][1]=[])),H=V,_=1,c?(N[L][0].push(A),N[L][1].push(s[b])):N[L].push(A),x=C,C=x+V;null==A?(i.error(i.i18n("errUploadFile",T.name)+" "+i.i18n("errUploadFileSize")),k--,W--):(W+=z,H=0,_=1,L++)}else(n.uplMaxSize&&H+g>=n.uplMaxSize||_>n.uplMaxFile)&&(H=0,_=1,L++),"undefined"==typeof N[L]&&(N[L]=[],c&&(N[L][0]=[],N[L][1]=[])),c?(N[L][0].push(T),N[L][1].push(s[b])):N[L].push(T),H+=g,B+=g,_++;else i.error(i.i18n("errUploadFile",T.name)+" "+i.i18n("errUploadMime")+" ("+i.escape(T.type)+")"),k--,W--}if(0==N.length)return t.checked=!0,!1;if(N.length>1)return r=D(B),I=[],M=0,U=N.length,E=[],J(),!0;c?(a=N[0][0],s=N[0][1]):a=N[0]}return l||(n.UA.Safari&&t.files?o._totalSize=B:r=D(B)),l=!0,a.length||y.reject(["errUploadNoFiles"]),o.open("POST",i.uploadURL,!0),n.customHeaders&&e.each(n.customHeaders,function(e){o.setRequestHeader(e,this)}),n.xhrFields&&e.each(n.xhrFields,function(e){e in o&&(o[e]=this)}),i.api>=2.1029&&(q=(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16),w.append("reqid",q),o._requestId=q),w.append("cmd","upload"),w.append(i.newAPI?"target":"current",d),P&&P.length&&(e.each(P,function(e,t){w.append("renames[]",t)}),w.append("suffix",n.options.backupSuffix)),R&&e.each(R,function(e,t){w.append("hashes["+e+"]",t)}),e.each(i.customData,function(e,t){w.append(e,t)}),e.each(i.options.onlyMimes,function(e,t){w.append("mimes[]",t)}),e.each(a,function(e,i){i._chunkmerged?(w.append("chunk",i._chunkmerged),w.append("upload[]",i._name),w.append("mtime[]",i._mtime)):(i._chunkfail?(w.append("upload[]","chunkfail"),w.append("mimes","chunkfail")):(w.append("upload[]",i),t.clipdata&&(t.overwrite=0,w.append("name[]",n.date(n.nonameDateFormat)+".png")),i.name&&n.UA.iOS&&(i.name.match(/^image\.jpe?g$/i)?(t.overwrite=0,w.append("name[]",n.date(n.nonameDateFormat)+".jpg")):i.name.match(/^capturedvideo\.mov$/i)&&(t.overwrite=0,w.append("name[]",n.date(n.nonameDateFormat)+".mov")))),i._chunk?(w.append("chunk",i._chunk),w.append("cid",i._cid),w.append("range",i._range),w.append("mtime[]",i._mtime)):w.append("mtime[]",i.lastModified?Math.round(i.lastModified/1e3):0))}),c&&e.each(s,function(e,t){w.append("upload_path[]",t)}),0===t.overwrite&&w.append("overwrite",0),p&&w.append("dropWith",parseInt((p.altKey?"1":"0")+(p.ctrlKey?"1":"0")+(p.metaKey?"1":"0")+(p.shiftKey?"1":"0"),2)),u&&e.each(u,function(e,t){w.append(e,t)}),o.send(w),!0};if(c)l?_(x[0],x[1]):x.done(function(t){if(P=[],k=t[0].length){if(t[4]&&t[4].length)return void n.request({data:{cmd:"mkdir",target:d,dirs:t[4]},notify:{type:"mkdir",cnt:t[4].length},preventFail:!0}).fail(function(e){e=e||["errUnknown"],"errCmdParams"===e[0]?f=1:(f=0,y.reject(e))}).done(function(n){n.hashes&&(t[1]=e.map(t[1],function(e){return e=e.replace(/\/[^\/]*$/,""),""===e?d:n.hashes[e]}))}).always(function(e){f&&(P=t[2],R=t[3],_(t[0],t[1]))});t[1]=e.map(t[1],function(){return d}),P=t[2],R=t[3],_(t[0],t[1])}else y.reject(["errUploadNoFiles"])}).fail(function(){y.reject()});else if(x.length>0)if(t.clipdata||null!=P)_(x)||y.reject();else{var N=[],L=[],W=n.options.folderUploadExclude[n.OS]||null;e.each(x,function(t,n){var i,a,o=n.webkitRelativePath||n.relativePath||"";return!!o&&(W&&n.name.match(W)?(n._remove=!0,o=void 0):(o="/"+o.replace(/\/[^\/]*$/,"").replace(/^\//,""),o&&e.inArray(o,N)===-1&&(N.push(o),i=o.substr(1).indexOf("/"),i!==-1&&(a=o.substr(0,i+1))&&e.inArray(a,N)===-1&&N.unshift(a))),void L.push(o))}),P=[],R={},N.length?!function(){var t=e.map(N,function(e){return e.substr(1).indexOf("/")===-1?{name:e.substr(1)}:null}),i=[];n.uploads.checkExists(t,d,n,!0).done(function(a,o){var r,s,l,p=[];n.options.overwriteUploadConfirm&&n.option("uploadOverwrite",d)&&(i=e.map(t,function(e){return e._remove?e.name:null}),t=e.grep(t,function(e){return!e._remove})),i.length&&e.each(L.concat(),function(t,n){0===e.inArray(n,i)&&(x[t]._remove=!0,L[t]=void 0)}),x=e.grep(x,function(e){return!e._remove}),L=e.grep(L,function(e){return void 0!==e}),t.length?(r=e.Deferred(),a.length?e.each(a,function(t,i){s=n.uniqueName(i+n.options.backupSuffix,null,""),e.each(o,function(e,t){if(a[0]==t)return l=e,!1}),l||(l=n.fileByName(a[0],d).hash),n.lockfiles({files:[l]}),p.push(n.request({data:{cmd:"rename",target:l,name:s},notify:{type:"rename",cnt:1}}).fail(function(e){y.reject(e),n.sync()}).always(function(){n.unlockfiles({files:[l]})}))}):p.push(null),e.when.apply(e,p).done(function(){n.request({data:{cmd:"mkdir",target:d,dirs:N},notify:{type:"mkdir",cnt:N.length},preventFail:!0}).fail(function(e){e=e||["errUnknown"],"errCmdParams"===e[0]?f=1:(f=0,y.reject(e))}).done(function(t){t.hashes&&(L=e.map(L.concat(),function(e){return"/"===e?d:t.hashes[e]}))}).always(function(e){f&&(c=!0,_(x,L)||y.reject())})})):y.reject()})}():n.uploads.checkExists(x,d,n).done(function(i,a){n.options.overwriteUploadConfirm&&n.option("uploadOverwrite",d)&&(R=a,null===i?t.overwrite=0:P=i,x=e.grep(x,function(e){return!e._remove})),k=x.length,k>0?_(x)||y.reject():y.reject()})}else y.reject();return y},iframe:function(t,n){var i,a,o,r,s=n?n:this,l=!!t.input&&t.input,c=!l&&s.uploads.checkFile(t,s),d=e.Deferred().fail(function(e){e&&s.error(e)}),p="iframe-"+n.namespace+ ++s.iframeCnt,u=e('<form action="'+s.uploadURL+'" method="post" enctype="multipart/form-data" encoding="multipart/form-data" target="'+p+'" style="display:none"><input type="hidden" name="cmd" value="upload" /></form>'),h=this.UA.IE,f=function(){r&&clearTimeout(r),o&&clearTimeout(o),a&&s.notify({type:"upload",cnt:-i}),setTimeout(function(){h&&e('<iframe src="javascript:false;"/>').appendTo(u),u.remove(),m.remove()},100)},m=e('<iframe src="'+(h?"javascript:false;":"about:blank")+'" name="'+p+'" style="position:absolute;left:-1000px;top:-1000px" />').on("load",function(){m.off("load").on("load",function(){f(),d.resolve()}),o=setTimeout(function(){a=!0,s.notify({type:"upload",cnt:i})},s.options.notifyDelay),s.options.iframeTimeout>0&&(r=setTimeout(function(){f(),d.reject([errors.connect,errors.timeout])},s.options.iframeTimeout)),u.submit()}),g=t.target||s.cwd().hash,v=[],b=[],y=[],w={};if(c&&c.length)e.each(c,function(e,t){u.append('<input type="hidden" name="upload[]" value="'+t+'"/>')}),i=1;else{if(!(l&&e(l).is(":file")&&e(l).val()))return d.reject();n.options.overwriteUploadConfirm&&n.option("uploadOverwrite",g)&&(v=l.files?l.files:[{name:e(l).val().replace(/^(?:.+[\\\/])?([^\\\/]+)$/,"$1")}],b.push(s.uploads.checkExists(v,g,s).done(function(n,a){w=a,null===n?t.overwrite=0:(y=n,i=e.grep(v,function(e){return!e._remove}).length,i!=v.length&&(i=0))}))),i=l.files?l.files.length:1,u.append(l)}return e.when.apply(e,b).done(function(){return i<1?d.reject():(u.append('<input type="hidden" name="'+(s.newAPI?"target":"current")+'" value="'+g+'"/>').append('<input type="hidden" name="html" value="1"/>').append('<input type="hidden" name="node" value="'+s.id+'"/>').append(e(l).attr("name","upload[]")),y.length>0&&(e.each(y,function(e,t){u.append('<input type="hidden" name="renames[]" value="'+s.escape(t)+'"/>')}),u.append('<input type="hidden" name="suffix" value="'+n.options.backupSuffix+'"/>')),w&&e.each(y,function(e,t){u.append('<input type="hidden" name="['+e+']" value="'+s.escape(t)+'"/>')}),0===t.overwrite&&u.append('<input type="hidden" name="overwrite" value="0"/>'),e.each(s.options.onlyMimes||[],function(e,t){u.append('<input type="hidden" name="mimes[]" value="'+s.escape(t)+'"/>')}),e.each(s.customData,function(e,t){u.append('<input type="hidden" name="'+e+'" value="'+s.escape(t)+'"/>')}),u.appendTo("body"),void m.appendTo("body"))}),d}},one:function(e,t,n){var i=this,a=e.toLowerCase(),o=function(e,n){return i.toUnbindEvents[a]||(i.toUnbindEvents[a]=[]),i.toUnbindEvents[a].push({type:a,callback:o}),(t.done?t.done:t).apply(this,arguments)};return t.done&&(o={done:o}),this.bind(a,o,n)},localStorage:function(t,n){var i,a,o,r,s,l=this,c=window.localStorage,d="elfinder-"+(t||"")+this.id,p=window.location.pathname+"-elfinder-",u=this.id,h=[];if("undefined"==typeof t)return r=p.length,s=u.length*-1,e.each(c,function(e){e.substr(0,r)===p&&e.substr(s)===u&&h.push(e)}),e.each(h,function(e,t){c.removeItem(t)}),!0;if(t=p+t+u,null===n)return c.removeItem(t);if(void 0===n&&!(i=c.getItem(t))&&(a=c.getItem(d))&&(n=a,c.removeItem(d)),void 0!==n){o=typeof n,"string"!==o&&"number"!==o&&(n=JSON.stringify(n));try{c.setItem(t,n)}catch(f){try{c.clear(),c.setItem(t,n)}catch(f){l.debug("error",f.toString())}}i=c.getItem(t)}if(i&&("{"===i.substr(0,1)||"["===i.substr(0,1)))try{return JSON.parse(i)}catch(f){}return i},cookie:function(t,n){var i,a,o,r,s,l;if(t="elfinder-"+t+this.id,void 0===n){if(document.cookie&&""!=document.cookie)for(o=document.cookie.split(";"),t+="=",r=0;r<o.length;r++)if(o[r]=e.trim(o[r]),o[r].substring(0,t.length)==t){if(s=decodeURIComponent(o[r].substring(t.length)),"{"===s.substr(0,1)||"["===s.substr(0,1))try{return JSON.parse(s)}catch(c){}return s}return null}if(a=Object.assign({},this.options.cookie),null===n?(n="",a.expires=-1):(l=typeof n,"string"!==l&&"number"!==l&&(n=JSON.stringify(n))),"number"==typeof a.expires&&(i=new Date,i.setTime(i.getTime()+864e5*a.expires),a.expires=i),document.cookie=t+"="+encodeURIComponent(n)+"; expires="+a.expires.toUTCString()+(a.path?"; path="+a.path:"")+(a.domain?"; domain="+a.domain:"")+(a.secure?"; secure":""),n&&("{"===n.substr(0,1)||"["===n.substr(0,1)))try{return JSON.parse(n)}catch(c){}return n},startDir:function(){var e=window.location.hash;return e&&e.match(/^#elf_/)?e.replace(/^#elf_/,""):this.options.startPathHash?this.options.startPathHash:this.lastDir()},lastDir:function(e){return this.options.rememberLastDir?this.storage("lastdir",e):""},_node:e("<span/>"),escape:function(e){return this._node.text(e).html().replace(/"/g,"&quot;").replace(/'/g,"&#039;")},normalize:function(t){var n,i,a,o,r,s=this,l=function(){var e,t;return(t=s.options.fileFilter)&&("function"==typeof t?e=function(e){return t.call(s,e)}:t instanceof RegExp&&(e=function(e){return t.test(e.name)})),e?e:null}(),c=function(t){var n;t.uiCmdMap&&(e.isPlainObject(t.uiCmdMap)&&Object.keys(t.uiCmdMap).length?(t.disabledFlip||(t.disabledFlip={}),n=t.disabledFlip,e.each(t.uiCmdMap,function(e,i){"hidden"!==i||n[e]||(t.disabled.push(e),t.disabledFlip[e]=!0)})):delete t.uiCmdMap)},d=function(t){var n=function(e){var t=typeof e;return"object"===t&&Array.isArray(e)&&(t="array"),t};return e.each(s.optionProperties,function(e,i){void 0!==i&&t[e]&&n(t[e])!==n(i)&&(t[e]=i)}),t.disabled?t.disabledFlip=s.arrayFlip(t.disabled,!0):t.disabledFlip={},t},p=function(t,r,p){var u,h,m,g,v=!r||t,b=!!r&&null;if(t&&t.hash&&t.name&&t.mime){if("application/x-empty"===t.mime&&(t.mime="text/plain"),m=s.isRoot(t),m&&!t.volumeid&&s.debug("warning","The volume root statuses requires `volumeid` property."),m||"directory"===t.mime){if(t.phash){if(t.phash===t.hash)return f=f.concat(['Parent folder of "$1" is itself.',t.name]),b;if(m&&t.volumeid&&0===t.phash.indexOf(t.volumeid))return f=f.concat(['Parent folder of "$1" is inner itself.',t.name]),b}t.volumeid&&(u=t.volumeid,m&&(t.phash&&(s.leafRoots[t.phash]?e.inArray(t.hash,s.leafRoots[t.phash])===-1&&s.leafRoots[t.phash].push(t.hash):s.leafRoots[t.phash]=[t.hash]),s.hasVolOptions=!0,s.volOptions[u]||(s.volOptions[u]={dispInlineRegex:s.options.dispInlineRegex}),h=s.volOptions[u],t.options&&Object.assign(h,t.options),t.disabled&&(h.disabled=t.disabled,h.disabledFlip=s.arrayFlip(t.disabled,!0)),t.tmbUrl&&(h.tmbUrl=t.tmbUrl),h.url&&"/"!==h.url.substr(-1)&&(h.url+="/"),c(h),h.trashHash&&(s.trashes[h.trashHash]===!1?delete h.trashHash:s.trashes[h.trashHash]=t.hash),e.each(s.optionProperties,function(e){h[e]&&(t[e]=h[e])}),"cwd"!==p&&(s.roots[u]=t.hash),t.expires&&(s.volumeExpires[u]=t.expires)),o!==u&&(o=u,a=s.option("i18nFolderName",u))),m&&!t.i18&&(n="volume_"+t.name,i=s.i18n(!1,n),n!==i&&(t.i18=i)),a&&!t.i18&&(n="folder_"+t.name,i=s.i18n(!1,n),n!==i&&(t.i18=i)),m&&(g=s.storage("rootNames"))&&(g[t.hash]&&(t._name=t.name,t._i18=t.i18,t.name=g[t.hash]=g[t.hash],delete t.i18),s.storage("rootNames",g)),s.trashes[t.hash]&&(t.locked=!0)}else{if(l)try{if(!l(t))return b}catch(y){s.debug(y)}0==t.size&&(t.mime=s.getMimetype(t.name,t.mime))}return t.options&&(s.optionsByHashes[t.hash]=d(t.options)),delete t.options,v}return b},u=function(t){var n=[];return e.each(s.files(),function(i,a){e.each(s.parents(i),function(a,o){if(e.inArray(o,t)!==-1&&e.inArray(i,t)===-1)return n.push(i),!1})}),n},h=function(n,i){e.each(n,function(n,a){var o,r;s.leafRoots[a.hash]&&s.applyLeafRootStats(a),"change"!==i&&a.phash&&s.isRoot(a)&&(o=s.file(a.phash))&&(s.applyLeafRootStats(o),t.changed?(e.each(t.changed,function(e,n){if(n.hash===o.hash)return t.changed[e]=o,r=!0,!1}),r||t.changed.push(o)):t.changed=[o])})},f=[];if(t.customData&&t.customData!==s.prevCustomData){s.prevCustomData=t.customData;try{r=JSON.parse(t.customData),e.isPlainObject(r)&&(s.prevCustomData=r,e.each(Object.keys(r),function(e,t){null===r[t]&&(delete r[t],delete s.optsCustomData[t])}),s.customData=Object.assign({},s.optsCustomData,r))}catch(m){}}return t.options&&d(t.options),t.cwd&&(t.cwd.volumeid&&t.options&&Object.keys(t.options).length&&s.isRoot(t.cwd)&&(s.hasVolOptions=!0,s.volOptions[t.cwd.volumeid]=t.options),t.cwd=p(t.cwd,!0,"cwd")),t.files&&(t.files=e.grep(t.files,p)),t.tree&&(t.tree=e.grep(t.tree,p)),t.added&&(t.added=e.grep(t.added,p)),t.changed&&(t.changed=e.grep(t.changed,p)),t.removed&&t.removed.length&&2===s.searchStatus.state&&(t.removed=t.removed.concat(u(t.removed))),t.api&&(t.init=!0),Object.keys(s.leafRoots).length&&(t.files&&h(t.files),t.tree&&h(t.tree),t.added&&h(t.added),t.changed&&h(t.changed,"change")),t.cwd&&t.cwd.options&&t.options&&Object.assign(t.options,d(t.cwd.options)),t.options&&t.options.url&&"/"!==t.options.url.substr(-1)&&(t.options.url+="/"),f.length&&(t.norError=["errResponse"].concat(f)),t},setSort:function(e,t,n,i){this.storage("sortType",this.sortType=this.sortRules[e]?e:"name"),
this.storage("sortOrder",this.sortOrder=/asc|desc/.test(t)?t:"asc"),this.storage("sortStickFolders",(this.sortStickFolders=!!n)?1:""),this.storage("sortAlsoTreeview",(this.sortAlsoTreeview=!!i)?1:""),this.trigger("sortchange")},_sortRules:{name:function(e,t){return i.prototype.naturalCompare(e.i18||e.name,t.i18||t.name)},size:function(e,t){var n=parseInt(e.size)||0,i=parseInt(t.size)||0;return n===i?0:n>i?1:-1},kind:function(e,t){return i.prototype.naturalCompare(e.mime,t.mime)},date:function(e,t){var n=e.ts||e.date||0,i=t.ts||t.date||0;return n===i?0:n>i?1:-1},perm:function(e,t){var n=function(e){return(e.write?2:0)+(e.read?1:0)},i=n(e),a=n(t);return i===a?0:i>a?1:-1},mode:function(e,t){var n=e.mode||e.perm||"",a=t.mode||t.perm||"";return i.prototype.naturalCompare(n,a)},owner:function(e,t){var n=e.owner||"",a=t.owner||"";return i.prototype.naturalCompare(n,a)},group:function(e,t){var n=e.group||"",a=t.group||"";return i.prototype.naturalCompare(n,a)}},sorters:{},naturalCompare:function(e,t){var n=i.prototype.naturalCompare;return"undefined"==typeof n.loc&&(n.loc=navigator.userLanguage||navigator.browserLanguage||navigator.language||"en-US"),"undefined"==typeof n.sort&&("11".localeCompare("2",n.loc,{numeric:!0})>0?window.Intl&&window.Intl.Collator?n.sort=new Intl.Collator(n.loc,{numeric:!0}).compare:n.sort=function(e,t){return e.localeCompare(t,n.loc,{numeric:!0})}:(n.sort=function(e,t){var i,a,o=/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,r=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,d=/^[\x01\x21-\x2f\x3a-\x40\x5b-\x60\x7b-\x7e]/,p=function(e){return n.sort.insensitive&&(""+e).toLowerCase()||""+e},u=p(e).replace(r,"").replace(/^_/,"")||"",h=p(t).replace(r,"").replace(/^_/,"")||"",f=u.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=h.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),g=parseInt(u.match(l))||1!=f.length&&u.match(s)&&Date.parse(u),v=parseInt(h.match(l))||g&&h.match(s)&&Date.parse(h)||null,b=0;if(v){if(g<v)return-1;if(g>v)return 1}for(var y=0,w=Math.max(f.length,m.length);y<w;y++){if(i=!(f[y]||"").match(c)&&parseFloat(f[y])||f[y]||0,a=!(m[y]||"").match(c)&&parseFloat(m[y])||m[y]||0,isNaN(i)!==isNaN(a)){if(isNaN(i)&&("string"!=typeof i||!i.match(d)))return 1;if("string"!=typeof a||!a.match(d))return-1}if(0===parseInt(i,10)&&(i=0),0===parseInt(a,10)&&(a=0),typeof i!=typeof a&&(i+="",a+=""),n.sort.insensitive&&"string"==typeof i&&"string"==typeof a&&(b=i.localeCompare(a,n.loc),0!==b))return b;if(i<a)return-1;if(i>a)return 1}return 0},n.sort.insensitive=!0)),n.sort(e,t)},compare:function(e,t){var n,i=this,a=i.sortType,o="asc"==i.sortOrder,r=i.sortStickFolders,s=i.sortRules,l=s[a],c="directory"==e.mime,d="directory"==t.mime;if(r){if(c&&!d)return-1;if(!c&&d)return 1}return n=o?l(e,t):l(t,e),"name"!==a&&0===n?n=o?s.name(e,t):s.name(t,e):n},sortFiles:function(e){return e.sort(this.compare)},notify:function(t){var n,i,a,o=t.type,r=t.id?"elfinder-notify-"+t.id:"",s=this.i18n("undefined"!=typeof t.msg?t.msg:this.messages["ntf"+o]?"ntf"+o:"ntfsmth"),l=this.ui.notify,c=l.children(".elfinder-notify-"+o+(r?"."+r:"")),d=c.children("div.elfinder-notify-cancel").children("button"),p='<div class="elfinder-notify elfinder-notify-{type}'+(r?" "+r:"")+'"><span class="elfinder-dialog-icon elfinder-dialog-icon-{type}"/><span class="elfinder-notify-msg">{msg}</span> <span class="elfinder-notify-cnt"/><div class="elfinder-notify-progressbar"><div class="elfinder-notify-progress"/></div><div class="elfinder-notify-cancel"/></div>',u=t.cnt,h="undefined"!=typeof t.size?parseInt(t.size):null,f="undefined"!=typeof t.progress&&t.progress>=0?t.progress:null,m=t.cancel,g="ui-state-hover",v=function(){c._esc&&e(document).off("keydown",c._esc),c.remove(),!l.children().length&&l.elfinderdialog("close")};return o?(c.length?"undefined"!=typeof t.msg&&c.children("span.elfinder-notify-msg").html(s):(c=e(p.replace(/\{type\}/g,o).replace(/\{msg\}/g,s)).appendTo(l).data("cnt",0),null!=f&&c.data({progress:0,total:0}),m&&(d=e('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"><span class="ui-button-text">'+this.i18n("btnCancel")+"</span></button>").on("mouseenter mouseleave",function(t){e(this).toggleClass(g,"mouseenter"===t.type)}),c.children("div.elfinder-notify-cancel").append(d))),n=u+parseInt(c.data("cnt")),n>0?(m&&d.length&&(e.isFunction(m)||"object"==typeof m&&m.promise)&&(c._esc=function(t){"keydown"==t.type&&t.keyCode!=e.ui.keyCode.ESCAPE||(t.preventDefault(),t.stopPropagation(),v(),m.promise?m.reject(0):m(t))},d.on("click",function(e){c._esc(e)}),e(document).on("keydown."+this.namespace,c._esc)),!t.hideCnt&&c.children(".elfinder-notify-cnt").text("("+n+")"),l.is(":hidden")&&l.elfinderdialog("open",this).height("auto"),c.data("cnt",n),null!=f&&(i=c.data("total"))>=0&&(a=c.data("progress"))>=0&&(i+=null!=h?h:u,a+=f,null==h&&u<0&&(a+=100*u),c.data({progress:a,total:i}),null!=h&&(a*=100,i=Math.max(1,i)),f=parseInt(a/i),c.find(".elfinder-notify-progress").animate({width:(f<100?f:100)+"%"},20))):v(),this):this},confirm:function(t){var n,i,a=this,o=!1,r={cssClass:"elfinder-dialog-confirm",modal:!0,resizable:!1,title:this.i18n(t.title||"confirmReq"),buttons:{},close:function(){!o&&t.cancel.callback(),e(this).elfinderdialog("destroy")}},s=this.i18n("apllyAll");return t.cssClass&&(r.cssClass+=" "+t.cssClass),r.buttons[this.i18n(t.accept.label)]=function(){t.accept.callback(!(!n||!n.prop("checked"))),o=!0,e(this).elfinderdialog("close")},r.buttons[this.i18n(t.accept.label)]._cssClass="elfinder-confirm-accept",t.reject&&(r.buttons[this.i18n(t.reject.label)]=function(){t.reject.callback(!(!n||!n.prop("checked"))),o=!0,e(this).elfinderdialog("close")},r.buttons[this.i18n(t.reject.label)]._cssClass="elfinder-confirm-reject"),t.buttons&&t.buttons.length>0&&(i=1,e.each(t.buttons,function(t,s){r.buttons[a.i18n(s.label)]=function(){s.callback(!(!n||!n.prop("checked"))),o=!0,e(this).elfinderdialog("close")},r.buttons[a.i18n(s.label)]._cssClass="elfinder-confirm-extbtn"+i++,s.cssClass&&(r.buttons[a.i18n(s.label)]._cssClass+=" "+s.cssClass)})),r.buttons[this.i18n(t.cancel.label)]=function(){e(this).elfinderdialog("close")},r.buttons[this.i18n(t.cancel.label)]._cssClass="elfinder-confirm-cancel",t.all&&(r.create=function(){var t=e('<div class="elfinder-dialog-confirm-applyall"/>');n=e('<input type="checkbox" />'),e(this).next().find(".ui-dialog-buttonset").prepend(t.append(e("<label>"+s+"</label>").prepend(n)))}),t.optionsCallback&&e.isFunction(t.optionsCallback)&&t.optionsCallback(r),this.dialog('<span class="elfinder-dialog-icon elfinder-dialog-icon-confirm"/>'+this.i18n(t.text),r)},uniqueName:function(e,t,n){var i,a,o=0,r="";if(e=this.i18n(!1,e),t=t||this.cwd().hash,n="undefined"==typeof n?" ":n,(i=e.match(/^(.+)(\.[^.]+)$/))&&(r=i[2],e=i[1]),a=e+r,!this.fileByName(a,t))return a;for(;o<1e4;)if(a=e+n+ ++o+r,!this.fileByName(a,t))return a;return e+Math.random()+r},i18n:function(){var t,n,i,a,o=this,r=this.messages,s=[],l=[],c=function(e){var t;return 0===e.indexOf("#")&&(t=o.file(e.substr(1)))?t.name:e},d=0;for(arguments.length&&arguments[0]===!1&&(a=function(e){return e},d=1),t=d;t<arguments.length;t++)if(i=arguments[t],Array.isArray(i))for(n=0;n<i.length;n++)i[n]instanceof jQuery?s.push(i[n]):"undefined"!=typeof i[n]&&s.push(c(""+i[n]));else i instanceof jQuery?s.push(i[n]):"undefined"!=typeof i&&s.push(c(""+i));for(t=0;t<s.length;t++)e.inArray(t,l)===-1&&(i=s[t],"string"==typeof i?(i=r[i]||(a?a(i):o.escape(i)),i=i.replace(/\$(\d+)/g,function(e,n){return n=t+parseInt(n),n>0&&s[n]&&l.push(n),a?a(s[n]):o.escape(s[n])})):i=i.get(0).outerHTML,s[t]=i);return e.grep(s,function(t,n){return e.inArray(n,l)===-1}).join("<br>")},getIconStyle:function(t,n){var i=this,a={background:"url('{url}') 0 0 no-repeat","background-size":"contain"},o="",r={},s=0;return t.icon&&(o='style="',e.each(a,function(e,a){0===s++&&(a=a.replace("{url}",i.escape(t.icon))),n?r[e]=a:o+=e+":"+a+";"}),o+='"'),n?r:o},mime2class:function(e){var t="elfinder-cwd-icon-",n=e.toLowerCase(),i=this.textMimes[n];return n=n.split("/"),i?n[0]+=" "+t+"text":n[1]&&n[1].match(/\+xml$/)&&(n[0]+=" "+t+"xml"),t+n[0]+(n[1]?" "+t+n[1].replace(/(\.|\+)/g,"-"):"")},mime2kind:function(e){var t,n="object"==typeof e,i=n?e.mime:e;return n&&e.alias&&"symlink-broken"!=i?t="Alias":this.kinds[i]&&(t=!n||"directory"!==i||e.phash&&!e.isroot?this.kinds[i]:"Root"),t||(t=0===i.indexOf("text")?"Text":0===i.indexOf("image")?"Image":0===i.indexOf("audio")?"Audio":0===i.indexOf("video")?"Video":0===i.indexOf("application")?"App":i),this.messages["kind"+t]?this.i18n("kind"+t):i},mimeIsText:function(e){return!!(this.textMimes[e.toLowerCase()]||0===e.indexOf("text/")&&"rtf"!==e.substr(5,3)||e.match(/^application\/.+\+xml$/))},date:function(e,t){var n,i,a,o,r,s,l,c,d,p=this;return t||(t=new Date),s=t[p.getHours](),l=s>12?s-12:s,c=t[p.getMinutes](),d=t[p.getSeconds](),i=t[p.getDate](),a=t[p.getDay](),o=t[p.getMonth]()+1,r=t[p.getFullYear](),n=e.replace(/[a-z]/gi,function(e){switch(e){case"d":return i>9?i:"0"+i;case"j":return i;case"D":return p.i18n(p.i18.daysShort[a]);case"l":return p.i18n(p.i18.days[a]);case"m":return o>9?o:"0"+o;case"n":return o;case"M":return p.i18n(p.i18.monthsShort[o-1]);case"F":return p.i18n(p.i18.months[o-1]);case"Y":return r;case"y":return(""+r).substr(2);case"H":return s>9?s:"0"+s;case"G":return s;case"g":return l;case"h":return l>9?l:"0"+l;case"a":return s>=12?"pm":"am";case"A":return s>=12?"PM":"AM";case"i":return c>9?c:"0"+c;case"s":return d>9?d:"0"+d}return e})},formatDate:function(e,t){var n,i,a,o=this,r=t||e.ts;o.i18;return o.options.clientFormatDate&&r>0?(n=new Date(1e3*r),i=r>=this.yesterday?this.fancyFormat:this.dateFormat,a=o.date(i,n),r>=this.yesterday?a.replace("$1",this.i18n(r>=this.today?"Today":"Yesterday")):a):e.date?e.date.replace(/([a-z]+)\s/i,function(e,t){return o.i18n(t)+" "}):o.i18n("dateUnknown")},toLocaleString:function(e){var t=new Number(e);return t?t.toLocaleString?t.toLocaleString():String(e).replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"):e},perms2class:function(e){var t="";return e.read||e.write?e.read?e.write||(t="elfinder-ro"):t="elfinder-wo":t="elfinder-na",e.type&&(t+=" elfinder-"+this.escape(e.type)),t},formatPermissions:function(e){var t=[];return e.read&&t.push(this.i18n("read")),e.write&&t.push(this.i18n("write")),t.length?t.join(" "+this.i18n("and")+" "):this.i18n("noaccess")},formatSize:function(e){var t=1,n="b";return"unknown"==e?this.i18n("unknown"):(e>1073741824?(t=1073741824,n="GB"):e>1048576?(t=1048576,n="MB"):e>1024&&(t=1024,n="KB"),e/=t,(e>0?t>=1048576?e.toFixed(2):Math.round(e):0)+" "+n)},formatFileMode:function(t,n){var i,a,o,r,s,l,c,d,p;if(n||(n=this.options.fileModeStyle.toLowerCase()),t=e.trim(t),t.match(/[rwxs-]{9}$/i)){if(d=t=t.substr(-9),"string"==n)return d;for(p="",o=0,i=0;i<7;i+=3)a=t.substr(i,3),r=0,a.match(/[r]/i)&&(r+=4),a.match(/[w]/i)&&(r+=2),a.match(/[xs]/i)&&(a.match(/[xs]/)&&(r+=1),a.match(/[s]/i)&&(0==i?o+=4:3==i&&(o+=2))),p+=r.toString(8);o&&(p=o.toString(8)+p)}else{if(t=parseInt(t,8),p=t?t.toString(8):"",!t||"octal"==n)return p;for(a=t.toString(8),o=0,a.length>3&&(a=a.substr(-4),o=parseInt(a.substr(0,1),8),a=a.substr(1)),s=1==(1&o),c=2==(2&o),l=4==(4&o),d="",i=0;i<3;i++)d+=4==(4&parseInt(a.substr(i,1),8))?"r":"-",d+=2==(2&parseInt(a.substr(i,1),8))?"w":"-",d+=1==(1&parseInt(a.substr(i,1),8))?0==i&&l||1==i&&c?"s":"x":"-"}return"both"==n?d+" ("+p+")":"string"==n?d:p},registRawStringDecoder:function(t){e.isFunction(t)&&(this.decodeRawString=this.options.rawStringDecoder=t)},uploadMimeCheck:function(t,n){n=n||this.cwd().hash;var i,a,o=!0,r=this.option("uploadMime",n),s=function(n){var i=!1;return"string"==typeof n&&"all"===n.toLowerCase()?i=!0:Array.isArray(n)&&n.length&&e.each(n,function(e,n){if(n=n.toLowerCase(),"all"===n||0===t.indexOf(n))return i=!0,!1}),i};return t&&e.isPlainObject(r)&&(t=t.toLowerCase(),i=s(r.allow),a=s(r.deny),"allow"===r.firstOrder?(o=!1,a||i!==!0||(o=!0)):(o=!0,a!==!0||i||(o=!1))),o},sequence:function(e){var t=e.length,n=function(t,i){return++i,e[i]?n(t.then(e[i]),i):t};return t>1?n(e[0](),0):e[0]()},reloadContents:function(t){var n,i=e.Deferred();try{n=e('<iframe width="1" height="1" scrolling="no" frameborder="no" style="position:absolute; top:-1px; left:-1px" crossorigin="use-credentials">').attr("src",t).one("load",function(){var n=e(this);try{this.contentDocument.location.reload(!0),n.one("load",function(){n.remove(),i.resolve()})}catch(a){n.attr("src","").attr("src",t).one("load",function(){n.remove(),i.resolve()})}}).appendTo("body")}catch(a){n&&n.remove(),i.reject()}return i},makeNetmountOptionOauth:function(t,n,i,a){var o,r="boolean"==typeof a?a:null,s=Object.assign({noOffline:!1,root:"root",pathI18n:"folderId",folders:!0},null===r?a||{}:{noOffline:r}),l=function(n,a,r){var d,p=this,u=Object.keys(e.isPlainObject(r)?r:{}).length;a.next().remove(),u&&(d=e('<select class="ui-corner-all elfinder-tabstop" style="max-width:200px;">').append(e(e.map(r,function(e,t){return'<option value="'+n.escape((t+"").trim())+'">'+n.escape(e)+"</option>"}).join(""))).on("change click",function(a){var r,d=e(this),u=d.val();p.inputs.path.val(u),!s.folders||"change"!==a.type&&d.data("current")===u||(d.next().remove(),d.data("current",u),u!=s.root&&(r=c(),o&&"pending"===o.state()&&n.abortXHR(o,{quiet:!0,abort:!0}),d.after(r),o=n.request({data:{cmd:"netmount",protocol:t,host:i,user:"init",path:u,pass:"folders"},preventDefault:!0}).done(function(e){l.call(p,n,d,e.folders)}).always(function(){n.abortXHR(o,{quiet:!0}),r.remove()}).xhr))}),a.after(e("<div/>").append(d)).closest(".ui-dialog").trigger("tabstopsInit"),d.trigger("focus"))},c=function(){return e('<div class="elfinder-netmount-spinner"/>').append('<span class="elfinder-info-spinner"/>')};return{vars:{},name:n,inputs:{offline:e('<input type="checkbox"/>').on("change",function(){e(this).parents("table.elfinder-netmount-tb").find("select:first").trigger("change","reset")}),host:e('<span><span class="elfinder-info-spinner"/></span><input type="hidden"/>'),path:e('<input type="text" value="'+s.root+'"/>'),user:e('<input type="hidden"/>'),pass:e('<input type="hidden"/>')},select:function(n,a,o){var r=this.inputs,l=r.offline,c=e(r.host[0]),d=o||null;this.vars.mbtn=r.host.closest(".ui-dialog").children(".ui-dialog-buttonpane:first").find("button.elfinder-btncnt-0"),c.data("inrequest")||!c.find("span.elfinder-info-spinner").length&&"reset"!==d&&("winfocus"!==d||c.siblings("span.elfinder-button-icon-reload").length)?(l.closest("tr")[s.noOffline||r.user.val()?"hide":"show"](),c.data("funcexpup")&&c.data("funcexpup")()):(1===l.parent().children().length&&(r.path.parent().prev().html(n.i18n(s.pathI18n)),l.attr("title",n.i18n("offlineAccess")),l.uniqueId().after(e("<label/>").attr("for",l.attr("id")).html(" "+n.i18n("offlineAccess")))),c.data("inrequest",!0).empty().addClass("elfinder-info-spinner").parent().find("span.elfinder-button-icon").remove(),n.request({data:{cmd:"netmount",protocol:t,host:i,user:"init",options:{id:n.id,offline:l.prop("checked")?1:0,pass:r.host[1].value}},preventDefault:!0}).done(function(e){c.removeClass("elfinder-info-spinner").html(e.body.replace(/\{msg:([^}]+)\}/g,function(e,t){return n.i18n(t,i)}))}),s.noOffline&&l.closest("tr").hide()),this.vars.mbtn[e(r.host[1]).val()?"show":"hide"]()},done:function(n,a){var o=this.inputs,r=this.protocol,c=e(o.host[0]),d=e(o.host[1]),p="&nbsp;";if(s.noOffline&&o.offline.closest("tr").hide(),"makebtn"==a.mode)c.removeClass("elfinder-info-spinner").removeData("expires").removeData("funcexpup"),o.host.find("input").on("mouseenter mouseleave",function(){e(this).toggleClass("ui-state-hover")}),d.val(""),o.path.val(s.root).next().remove(),o.user.val(""),o.pass.val(""),!s.noOffline&&o.offline.closest("tr").show(),this.vars.mbtn.hide();else if("folders"==a.mode)a.folders&&l.call(this,n,o.path.nextAll(":last"),a.folders);else{if(a.expires&&(p="()",c.data("expires",a.expires)),c.html(i+p).removeClass("elfinder-info-spinner"),a.expires&&(c.data("funcexpup",function(){var e=Math.floor((c.data("expires")-+new Date/1e3)/60);e<3?c.parent().children(".elfinder-button-icon-reload").click():(c.text(c.text().replace(/\(.*\)/,"("+n.i18n(["minsLeft",e])+")")),setTimeout(function(){c.is(":visible")&&c.data("funcexpup")()},6e4))}),c.data("funcexpup")()),a.reset)return void r.trigger("change","reset");c.parent().append(e('<span class="elfinder-button-icon elfinder-button-icon-reload" title="'+n.i18n("reAuth")+'">').on("click",function(){d.val("reauth"),r.trigger("change","reset")})),d.val(t),this.vars.mbtn.show(),a.folders&&l.call(this,n,o.path,a.folders),o.user.val("done"),o.pass.val("done"),o.offline.closest("tr").hide()}c.removeData("inrequest")},fail:function(t,n){e(this.inputs.host[0]).removeData("inrequest"),this.protocol.trigger("change","reset")},integrateInfo:s.integrate}},findCwdNodes:function(t,n){var i=this,a=this.getUI("cwd"),o=this.cwd().hash,r=e();return n=n||{},e.each(t,function(e,t){if((t.phash===o||i.searchStatus.state>1)&&(r=r.add(a.find("#"+i.cwdHash2Id(t.hash))),n.firstOnly))return!1}),r},convAbsUrl:function(e){if(e.match(/^http/i))return e;if("//"===e.substr(0,2))return window.location.protocol+e;var t,n=window.location.protocol+"//"+window.location.host,i=/[^\/]+\/\.\.\//;for(t="/"===e.substr(0,1)?n+e:n+window.location.pathname.replace(/\/[^\/]+$/,"/")+e,t=t.replace("/./","/");i.test(t);)t=t.replace(i,"");return t},isSameOrigin:function(e){var t;if(e=this.convAbsUrl(e),location.origin&&window.URL)try{return t=new URL(e),location.origin===t.origin}catch(n){}return t=document.createElement("a"),t.href=e,location.protocol===t.protocol&&location.host===t.host&&location.port&&t.port},navHash2Id:function(e){return this.navPrefix+e},navId2Hash:function(e){return"string"==typeof e&&e.substr(this.navPrefix.length)},cwdHash2Id:function(e){return this.cwdPrefix+e},cwdId2Hash:function(e){return"string"==typeof e&&e.substr(this.cwdPrefix.length)},isInWindow:function(e,t){var n,i;return!!(n=e.get(0))&&(!(!t&&null===n.offsetParent)&&(i=n.getBoundingClientRect(),!!document.elementFromPoint(i.left,i.top)))},zIndexCalc:function(){var t=this,n=this.getUI(),i=n.css("z-index");i&&"auto"!==i&&"inherit"!==i?t.zIndex=i:n.parents().each(function(n,i){var a=e(i).css("z-index");if("auto"!==a&&"inherit"!==a&&(a=parseInt(a)))return t.zIndex=a,!1})},loadScript:function(t,n,i,a){var o,r,s={dataType:"script",cache:!0},l={},c={};return i=i||{},i.tryRequire&&this.hasRequire?require(t,n,i.error):(o=function(){var t,o,r;e.each(c,function(e,t){if("success"!==t&&"notmodified"!==t)return r=!0,!1}),r?i.error&&e.isFunction(i.error)&&i.error({loadResults:c}):e.isFunction(n)&&(a&&"undefined"==typeof a.obj[a.name]?(t=a.timeout?a.timeout/10:1,o=setInterval(function(){(--t<0||"undefined"!=typeof a.obj[a.name])&&(clearInterval(o),n())},10)):n())},"tag"===i.loadType?(e("head > script").each(function(){l[this.src]=this}),r=t.length,e.each(t,function(t,n){var a,s=!1;l[n]?(c[t]=l[n]._error||"success",--r<1&&o()):(a=document.createElement("script"),a.charset=i.charset||"UTF-8",e("head").append(a),a.onload=a.onreadystatechange=function(){s||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(s=!0,c[t]="success",--r<1&&o())},a.onerror=function(e){c[t]=a._error=e&&e.type?e.type:"error",--r<1&&o()},a.src=n)})):(i=e.isPlainObject(i)?Object.assign(s,i):s,r=0,function d(n,a){void 0!==n&&(c[r++]=a),t.length?e.ajax(Object.assign({},i,{url:t.shift(),success:d,error:d})):o()}())),this},loadCss:function(t){var n=this;return"string"==typeof t&&(t=[t]),e.each(t,function(t,i){i=n.convAbsUrl(i).replace(/^https?:/i,""),e("head > link[href='+url+']").length||e("head").append('<link rel="stylesheet" type="text/css" href="'+i+'" />')}),this},asyncJob:function(t,n,i){var a,o,r=e.Deferred(),s=!1,l=Object.assign({interval:0,numPerOnce:1},i||{}),c=[],d=[],p=[];return r._abort=function(e){o&&clearTimeout(o),d=[],s=!0,"pending"===r.state()&&r[e?"resolve":"reject"](c)},r.fail(function(){r._abort()}).always(function(){r._abort=function(){}}),"function"==typeof t&&Array.isArray(n)?(d=n.concat(),a=function(){var e,n,i;if(!s){for(p=d.splice(0,l.numPerOnce),n=p.length,e=0;e<n&&!s;e++)i=t(p[e]),null!==i&&c.push(i);s||(d.length?o=setTimeout(a,l.interval):r.resolve(c))}},d.length?o=setTimeout(a,0):r.resolve(c)):r.reject(),r},getSize:function(t){var n=this,i=[],a=t.length,o=e.Deferred().fail(function(){e.each(i,function(e,t){t&&(t.syncOnFail&&t.syncOnFail(!1),t.reject())})}),r=function(t){var i=[];return"directory"===t.mime&&e.each(n.leafRoots,function(e,a){var o;if(e===t.hash)i.push.apply(i,a);else for(o=(n.file(e)||{}).phash;o;)o===t.hash&&i.push.apply(i,a),o=(n.file(o)||{}).phash}),i},s=function(t){var i=e.Deferred(),a=n.file(t),o=a?a.phash:t;return o&&!n.file(o)?n.request({data:{cmd:"parents",target:o},preventFail:!0}).done(function(){n.one("parentsdone",function(){i.resolve()})}).fail(function(){i.resolve()}):i.resolve(),i},l=function(){var t=e.Deferred(),i=Object.keys(n.leafRoots).length;return i>0?e.each(n.leafRoots,function(e){s(e).done(function(){--i,i<1&&t.resolve()})}):t.resolve(),t};return n.autoSync("stop"),l().done(function(){var s=[],l={},c=[],d=[],p={};e.each(t,function(){s.push.apply(s,r(n.file(this)))}),t.push.apply(t,s),e.each(t,function(){var t=n.root(this),i=n.file(this);i&&(i.sizeInfo||"directory"!==i.mime)?d.push(e.Deferred().resolve(i.sizeInfo?i.sizeInfo:{size:i.size,dirCnt:0,fileCnt:1})):l[t]?l[t].push(this):l[t]=[this]}),e.each(l,function(){var e=c.length;1===this.length&&(p[e]=this[0]),c.push(n.request({data:{cmd:"size",targets:this},preventDefault:!0}))}),i.push.apply(i,c),c.push.apply(c,d),e.when.apply(e,c).fail(function(){o.reject()}).done(function(){var t,i,r,s=function(t,i){var a;(a=n.file(t))&&(a.sizeInfo={isCache:!0},e.each(["size","dirCnt","fileCnt"],function(){a.sizeInfo[this]=i[this]||0}),a.size=parseInt(a.sizeInfo.size),m.push(a))},l=0,c=0,d=0,u=arguments.length,h=[],f="",m=[];for(t=0;t<u;t++)r=arguments[t],i=null,r.isCache||(p[t]&&(i=n.file(p[t]))?s(p[t],r):r.sizes&&e.isPlainObject(r.sizes)&&e.each(r.sizes,function(e,t){s(e,t)})),l+=parseInt(r.size),c!==!1&&("undefined"==typeof r.fileCnt&&(c=!1),c+=parseInt(r.fileCnt||0)),d!==!1&&("undefined"==typeof r.dirCnt&&(d=!1),d+=parseInt(r.dirCnt||0));m.length&&n.change({changed:m}),d!==!1&&h.push(n.i18n("folders")+": "+(d-(a>1?0:1))),c!==!1&&h.push(n.i18n("files")+": "+c),h.length&&(f="<br>"+h.join(", ")),o.resolve({size:l,fileCnt:c,dirCnt:d,formated:(l>=0?n.formatSize(l):n.i18n("unknown"))+f})}),n.autoSync()}),o},applyLeafRootStats:function(t,n){var i=this,a=n?t:i.file(t.hash)||t,o=a.ts,r=!1;return!n&&t._realStats||(t._realStats={locked:t.locked||0,dirs:t.dirs||0,ts:t.ts}),t.locked=1,a.locked||(r=!0),t.dirs=1,a.dirs||(r=!0),e.each(i.leafRoots[t.hash],function(){var e=i.file(this);e&&e.ts&&(t.ts||0)<e.ts&&(t.ts=e.ts)}),o!==t.ts&&(r=!0),r},abortXHR:function(e,t){var n=t||{};e&&(n.quiet&&(e.quiet=!0),n.abort&&e._requestId&&this.request({data:{cmd:"abort",id:e._requestId},preventDefault:!0}),e.abort(),e=void 0)},getRequestId:function(){return(+new Date).toString(16)+Math.floor(1e3*Math.random()).toString(16)},arrayFlip:function(t,n){var i,a={},o=e.isArray(t);for(i in t)(o||t.hasOwnProperty(i))&&(a[t[i]]=n||i);return a},splitFileExtention:function(e){var t;return(t=e.match(/^(.+?)?\.((?:tar\.(?:gz|bz|bz2|z|lzo))|cpio\.gz|ps\.gz|xcf\.(?:gz|bz2)|[a-z0-9]{1,10})$/i))?("undefined"==typeof t[1]&&(t[1]=""),[t[1],t[2]]):[e,""]},sliceArrayBuffer:function(e,t){for(var n=[],i=0;i*t<e.byteLength;)n.push(e.slice(i*t,(i+1)*t)),i++;return n},arrayBufferToBase64:function(e){if(!window.btoa)return"";var t=new Uint8Array(e),n=Array.prototype.slice.call(t),i=n.map(function(e){return String.fromCharCode(e)});return window.btoa(i.join(""))},log:function(e){return window.console&&window.console.log&&window.console.log(e),this},debug:function(e,t){var n=this.options.debug;return n&&("all"===n||n[e])&&window.console&&window.console.log&&window.console.log("elfinder debug: ["+e+"] ["+this.id+"]",t),"backend-error"===e?(!this.cwd().hash||n&&("all"===n||n["backend-error"]))&&(t=Array.isArray(t)?t:[t],this.error(t)):"backend-debug"===e&&this.trigger("backenddebug",t),this},time:function(e){window.console&&window.console.time&&window.console.time(e)},timeEnd:function(e){window.console&&window.console.timeEnd&&window.console.timeEnd(e)}},Object.keys||(Object.keys=function(){var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=n.length;return function(a){if("object"!=typeof a&&"function"!=typeof a||null===a)throw new TypeError("Object.keys called on non-object");var o=[];for(var r in a)e.call(a,r)&&o.push(r);if(t)for(var s=0;s<i;s++)e.call(a,n[s])&&o.push(n[s]);return o}}()),Array.isArray||(Array.isArray=function(e){return jQuery.isArray(e)}),Object.assign||(Object.assign=function(){return jQuery.extend.apply(null,arguments)}),String.prototype.repeat||(String.prototype.repeat=function(e){"use strict";if(null==this)throw new TypeError("can't convert "+this+" to object");var t=""+this;if(e=+e,e!=e&&(e=0),e<0)throw new RangeError("repeat count must be non-negative");if(e==1/0)throw new RangeError("repeat count must be less than infinity");if(e=Math.floor(e),0==t.length||0==e)return"";if(t.length*e>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");for(var n="",i=0;i<e;i++)n+=t;return n}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),function(){try{return void Array.apply(null,{})}catch(e){}var t=Object.prototype.toString,n="[object Array]",i=Function.prototype.apply,a=Array.prototype.slice;Function.prototype.apply=function(e,o){return i.call(this,e,t.call(o)===n?o:a.call(o))}}(),Array.from||(Array.from=function(e){return 1===e.length?[e[0]]:Array.apply(null,e)}),window.cancelAnimationFrame||!function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n<t.length&&!window.requestAnimationFrame;++n)window.requestAnimationFrame=window[t[n]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[t[n]+"CancelAnimationFrame"]||window[t[n]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t,n){var i=(new Date).getTime(),a=Math.max(0,16-(i-e)),o=window.setTimeout(function(){t(i+a)},a);return e=i+a,o}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})}(),i.prototype.version="2.1.42 (2.1-src Nightly: 2514897)",function(){if(e.ui&&e.ui.ddmanager){var t=e.ui.ddmanager.prepareOffsets;e.ui.ddmanager.prepareOffsets=function(n,i){var a=function(e){if(e.is(":hidden"))return!0;var t=e[0].getBoundingClientRect();return!document.elementFromPoint(t.left,t.top)};if("mousedown"===i.type||n.options.elfRefresh){var o,r,s=e.ui.ddmanager.droppables[n.options.scope]||[],l=s.length;for(o=0;o<l;o++)r=s[o],r.options.autoDisable&&(!r.options.disabled||r.options.autoDisable>1)&&(r.options.disabled=a(r.element),r.options.autoDisable=r.options.disabled?2:1)}return t(n,i)}}}(),e.ajaxTransport("+binary",function(e,t,n){if(window.FormData&&(e.dataType&&"binary"==e.dataType||e.data&&(window.ArrayBuffer&&e.data instanceof ArrayBuffer||window.Blob&&e.data instanceof Blob))){var i;return{send:function(t,n){i=new XMLHttpRequest;var a=e.url,o=e.type,r=e.async||!0,s=e.responseType||"blob",l=e.data||null,c=e.username,d=e.password;i.addEventListener("load",function(){var t={};t[e.dataType]=i.response,n(i.status,i.statusText,t,i.getAllResponseHeaders())}),i.open(o,a,r,c,d);for(var p in t)i.setRequestHeader(p,t[p]);if(e.xhrFields)for(var u in e.xhrFields)u in i&&(i[u]=e.xhrFields[u]);i.responseType=s,i.send(l)},abort:function(){i.abort()}}}}),function(e){function t(t,n){if(!(t.originalEvent.touches.length>1)){e(t.currentTarget).hasClass("touch-punch-keep-default")||t.preventDefault();var i=t.originalEvent.changedTouches[0],a=document.createEvent("MouseEvents");a.initMouseEvent(n,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(a)}}if(e.support.touch="ontouchend"in document,e.support.touch){var n,i,a,o=e.ui.mouse.prototype,r=o._mouseInit,s=o._mouseDestroy;o._touchStart=function(e){var o=this;!n&&o._mouseCapture(e.originalEvent.changedTouches[0])&&(i=e.originalEvent.changedTouches[0].screenX.toFixed(0),a=e.originalEvent.changedTouches[0].screenY.toFixed(0),n=!0,o._touchMoved=!1,t(e,"mouseover"),t(e,"mousemove"),t(e,"mousedown"))},o._touchMove=function(e){if(n){var o=e.originalEvent.changedTouches[0].screenX.toFixed(0),r=e.originalEvent.changedTouches[0].screenY.toFixed(0);Math.abs(i-o)<=4&&Math.abs(a-r)<=4||(this._touchMoved=!0,t(e,"mousemove"))}},o._touchEnd=function(e){n&&(t(e,"mouseup"),t(e,"mouseout"),this._touchMoved||t(e,"click"),n=!1,this._touchMoved=!1)},o._mouseInit=function(){var t=this;t.element.hasClass("touch-punch")&&t.element.on({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),r.call(t)},o._mouseDestroy=function(){var t=this;t.element.hasClass("touch-punch")&&t.element.off({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),s.call(t)}}}(jQuery),e.fn.elfinder=function(t,n){return"instance"===t?this.getElFinder():this.each(function(){var a,o="string"==typeof t?t:"",r="function"==typeof n?n:void 0;if(this.elfinder)switch(o){case"close":case"hide":this.elfinder.hide();break;case"open":case"show":this.elfinder.show();break;case"destroy":this.elfinder.destroy();break;case"reload":case"restart":this.elfinder&&(a=this.elfinder.options,r=this.elfinder.bootCallback,this.elfinder.destroy(),new i(this,e.extend(!0,a,e.isPlainObject(n)?n:{}),r))}else e.isPlainObject(t)&&new i(this,t,r)})},e.fn.getElFinder=function(){var e;return this.each(function(){if(this.elfinder)return e=this.elfinder,!1}),e},e.fn.elfUiWidgetInstance=function(e){try{return this[e]("instance")}catch(t){var n=this.data("ui-"+e);return n&&"object"==typeof n&&n.widgetFullName==="ui-"+e?n:null}},e.fn.scrollRight||e.fn.extend({scrollRight:function(e){var t=this.get(0);return void 0===e?Math.max(0,t.scrollWidth-(t.scrollLeft+t.clientWidth)):this.scrollLeft(t.scrollWidth-t.clientWidth-e)}}),e.fn.scrollBottom||e.fn.extend({scrollBottom:function(e){var t=this.get(0);return void 0===e?Math.max(0,t.scrollHeight-(t.scrollTop+t.clientHeight)):this.scrollTop(t.scrollHeight-t.clientHeight-e)}}),i.prototype.mimeTypes={"application/x-executable":"exe","application/x-jar":"jar","application/x-gzip":"gz","application/x-bzip2":"tbz","application/x-rar":"rar","text/x-php":"php","text/javascript":"js","application/rtfd":"rtfd","text/x-python":"py","text/x-ruby":"rb","text/x-shellscript":"sh","text/x-perl":"pl","text/xml":"xml","text/x-csrc":"c","text/x-chdr":"h","text/x-c++src":"cpp","text/x-c++hdr":"hh","text/x-markdown":"md","text/x-yaml":"yml","image/x-ms-bmp":"bmp","image/x-targa":"tga","image/xbm":"xbm","image/pxm":"pxm","audio/wav":"wav","video/x-dv":"dv","video/x-ms-wmv":"wm","video/ogg":"ogm","video/MP2T":"m2ts","application/x-mpegURL":"m3u8","application/dash+xml":"mpd","application/andrew-inset":"ez","application/applixware":"aw","application/atom+xml":"atom","application/atomcat+xml":"atomcat","application/atomsvc+xml":"atomsvc","application/ccxml+xml":"ccxml","application/cdmi-capability":"cdmia","application/cdmi-container":"cdmic","application/cdmi-domain":"cdmid","application/cdmi-object":"cdmio","application/cdmi-queue":"cdmiq","application/cu-seeme":"cu","application/davmount+xml":"davmount","application/docbook+xml":"dbk","application/dssc+der":"dssc","application/dssc+xml":"xdssc","application/ecmascript":"ecma","application/emma+xml":"emma","application/epub+zip":"epub","application/exi":"exi","application/font-tdpfr":"pfr",
"application/gml+xml":"gml","application/gpx+xml":"gpx","application/gxf":"gxf","application/hyperstudio":"stk","application/inkml+xml":"ink","application/ipfix":"ipfix","application/java-serialized-object":"ser","application/java-vm":"class","application/json":"json","application/jsonml+json":"jsonml","application/lost+xml":"lostxml","application/mac-binhex40":"hqx","application/mac-compactpro":"cpt","application/mads+xml":"mads","application/marc":"mrc","application/marcxml+xml":"mrcx","application/mathematica":"ma","application/mathml+xml":"mathml","application/mbox":"mbox","application/mediaservercontrol+xml":"mscml","application/metalink+xml":"metalink","application/metalink4+xml":"meta4","application/mets+xml":"mets","application/mods+xml":"mods","application/mp21":"m21","application/mp4":"mp4s","application/msword":"doc","application/mxf":"mxf","application/octet-stream":"bin","application/oda":"oda","application/oebps-package+xml":"opf","application/ogg":"ogx","application/omdoc+xml":"omdoc","application/onenote":"onetoc","application/oxps":"oxps","application/patch-ops-error+xml":"xer","application/pdf":"pdf","application/pgp-encrypted":"pgp","application/pgp-signature":"asc","application/pics-rules":"prf","application/pkcs10":"p10","application/pkcs7-mime":"p7m","application/pkcs7-signature":"p7s","application/pkcs8":"p8","application/pkix-attr-cert":"ac","application/pkix-cert":"cer","application/pkix-crl":"crl","application/pkix-pkipath":"pkipath","application/pkixcmp":"pki","application/pls+xml":"pls","application/postscript":"ai","application/prs.cww":"cww","application/pskc+xml":"pskcxml","application/rdf+xml":"rdf","application/reginfo+xml":"rif","application/relax-ng-compact-syntax":"rnc","application/resource-lists+xml":"rl","application/resource-lists-diff+xml":"rld","application/rls-services+xml":"rs","application/rpki-ghostbusters":"gbr","application/rpki-manifest":"mft","application/rpki-roa":"roa","application/rsd+xml":"rsd","application/rss+xml":"rss","application/rtf":"rtf","application/sbml+xml":"sbml","application/scvp-cv-request":"scq","application/scvp-cv-response":"scs","application/scvp-vp-request":"spq","application/scvp-vp-response":"spp","application/sdp":"sdp","application/set-payment-initiation":"setpay","application/set-registration-initiation":"setreg","application/shf+xml":"shf","application/smil+xml":"smi","application/sparql-query":"rq","application/sparql-results+xml":"srx","application/srgs":"gram","application/srgs+xml":"grxml","application/sru+xml":"sru","application/ssdl+xml":"ssdl","application/ssml+xml":"ssml","application/tei+xml":"tei","application/thraud+xml":"tfi","application/timestamped-data":"tsd","application/vnd.3gpp.pic-bw-large":"plb","application/vnd.3gpp.pic-bw-small":"psb","application/vnd.3gpp.pic-bw-var":"pvb","application/vnd.3gpp2.tcap":"tcap","application/vnd.3m.post-it-notes":"pwn","application/vnd.accpac.simply.aso":"aso","application/vnd.accpac.simply.imp":"imp","application/vnd.acucobol":"acu","application/vnd.acucorp":"atc","application/vnd.adobe.air-application-installer-package+zip":"air","application/vnd.adobe.formscentral.fcdt":"fcdt","application/vnd.adobe.fxp":"fxp","application/vnd.adobe.xdp+xml":"xdp","application/vnd.adobe.xfdf":"xfdf","application/vnd.ahead.space":"ahead","application/vnd.airzip.filesecure.azf":"azf","application/vnd.airzip.filesecure.azs":"azs","application/vnd.amazon.ebook":"azw","application/vnd.americandynamics.acc":"acc","application/vnd.amiga.ami":"ami","application/vnd.android.package-archive":"apk","application/vnd.anser-web-certificate-issue-initiation":"cii","application/vnd.anser-web-funds-transfer-initiation":"fti","application/vnd.antix.game-component":"atx","application/vnd.apple.installer+xml":"mpkg","application/vnd.aristanetworks.swi":"swi","application/vnd.astraea-software.iota":"iota","application/vnd.audiograph":"aep","application/vnd.blueice.multipass":"mpm","application/vnd.bmi":"bmi","application/vnd.businessobjects":"rep","application/vnd.chemdraw+xml":"cdxml","application/vnd.chipnuts.karaoke-mmd":"mmd","application/vnd.cinderella":"cdy","application/vnd.claymore":"cla","application/vnd.cloanto.rp9":"rp9","application/vnd.clonk.c4group":"c4g","application/vnd.cluetrust.cartomobile-config":"c11amc","application/vnd.cluetrust.cartomobile-config-pkg":"c11amz","application/vnd.commonspace":"csp","application/vnd.contact.cmsg":"cdbcmsg","application/vnd.cosmocaller":"cmc","application/vnd.crick.clicker":"clkx","application/vnd.crick.clicker.keyboard":"clkk","application/vnd.crick.clicker.palette":"clkp","application/vnd.crick.clicker.template":"clkt","application/vnd.crick.clicker.wordbank":"clkw","application/vnd.criticaltools.wbs+xml":"wbs","application/vnd.ctc-posml":"pml","application/vnd.cups-ppd":"ppd","application/vnd.curl.car":"car","application/vnd.curl.pcurl":"pcurl","application/vnd.dart":"dart","application/vnd.data-vision.rdz":"rdz","application/vnd.dece.data":"uvf","application/vnd.dece.ttml+xml":"uvt","application/vnd.dece.unspecified":"uvx","application/vnd.dece.zip":"uvz","application/vnd.denovo.fcselayout-link":"fe_launch","application/vnd.dna":"dna","application/vnd.dolby.mlp":"mlp","application/vnd.dpgraph":"dpg","application/vnd.dreamfactory":"dfac","application/vnd.ds-keypoint":"kpxx","application/vnd.dvb.ait":"ait","application/vnd.dvb.service":"svc","application/vnd.dynageo":"geo","application/vnd.ecowin.chart":"mag","application/vnd.enliven":"nml","application/vnd.epson.esf":"esf","application/vnd.epson.msf":"msf","application/vnd.epson.quickanime":"qam","application/vnd.epson.salt":"slt","application/vnd.epson.ssf":"ssf","application/vnd.eszigno3+xml":"es3","application/vnd.ezpix-album":"ez2","application/vnd.ezpix-package":"ez3","application/vnd.fdf":"fdf","application/vnd.fdsn.mseed":"mseed","application/vnd.fdsn.seed":"seed","application/vnd.flographit":"gph","application/vnd.fluxtime.clip":"ftc","application/vnd.framemaker":"fm","application/vnd.frogans.fnc":"fnc","application/vnd.frogans.ltf":"ltf","application/vnd.fsc.weblaunch":"fsc","application/vnd.fujitsu.oasys":"oas","application/vnd.fujitsu.oasys2":"oa2","application/vnd.fujitsu.oasys3":"oa3","application/vnd.fujitsu.oasysgp":"fg5","application/vnd.fujitsu.oasysprs":"bh2","application/vnd.fujixerox.ddd":"ddd","application/vnd.fujixerox.docuworks":"xdw","application/vnd.fujixerox.docuworks.binder":"xbd","application/vnd.fuzzysheet":"fzs","application/vnd.genomatix.tuxedo":"txd","application/vnd.geogebra.file":"ggb","application/vnd.geogebra.tool":"ggt","application/vnd.geometry-explorer":"gex","application/vnd.geonext":"gxt","application/vnd.geoplan":"g2w","application/vnd.geospace":"g3w","application/vnd.gmx":"gmx","application/vnd.google-earth.kml+xml":"kml","application/vnd.google-earth.kmz":"kmz","application/vnd.grafeq":"gqf","application/vnd.groove-account":"gac","application/vnd.groove-help":"ghf","application/vnd.groove-identity-message":"gim","application/vnd.groove-injector":"grv","application/vnd.groove-tool-message":"gtm","application/vnd.groove-tool-template":"tpl","application/vnd.groove-vcard":"vcg","application/vnd.hal+xml":"hal","application/vnd.handheld-entertainment+xml":"zmm","application/vnd.hbci":"hbci","application/vnd.hhe.lesson-player":"les","application/vnd.hp-hpgl":"hpgl","application/vnd.hp-hpid":"hpid","application/vnd.hp-hps":"hps","application/vnd.hp-jlyt":"jlt","application/vnd.hp-pcl":"pcl","application/vnd.hp-pclxl":"pclxl","application/vnd.hydrostatix.sof-data":"sfd-hdstx","application/vnd.ibm.minipay":"mpy","application/vnd.ibm.modcap":"afp","application/vnd.ibm.rights-management":"irm","application/vnd.ibm.secure-container":"sc","application/vnd.iccprofile":"icc","application/vnd.igloader":"igl","application/vnd.immervision-ivp":"ivp","application/vnd.immervision-ivu":"ivu","application/vnd.insors.igm":"igm","application/vnd.intercon.formnet":"xpw","application/vnd.intergeo":"i2g","application/vnd.intu.qbo":"qbo","application/vnd.intu.qfx":"qfx","application/vnd.ipunplugged.rcprofile":"rcprofile","application/vnd.irepository.package+xml":"irp","application/vnd.is-xpr":"xpr","application/vnd.isac.fcs":"fcs","application/vnd.jam":"jam","application/vnd.jcp.javame.midlet-rms":"rms","application/vnd.jisp":"jisp","application/vnd.joost.joda-archive":"joda","application/vnd.kahootz":"ktz","application/vnd.kde.karbon":"karbon","application/vnd.kde.kchart":"chrt","application/vnd.kde.kformula":"kfo","application/vnd.kde.kivio":"flw","application/vnd.kde.kontour":"kon","application/vnd.kde.kpresenter":"kpr","application/vnd.kde.kspread":"ksp","application/vnd.kde.kword":"kwd","application/vnd.kenameaapp":"htke","application/vnd.kidspiration":"kia","application/vnd.kinar":"kne","application/vnd.koan":"skp","application/vnd.kodak-descriptor":"sse","application/vnd.las.las+xml":"lasxml","application/vnd.llamagraphics.life-balance.desktop":"lbd","application/vnd.llamagraphics.life-balance.exchange+xml":"lbe","application/vnd.lotus-1-2-3":123,"application/vnd.lotus-approach":"apr","application/vnd.lotus-freelance":"pre","application/vnd.lotus-notes":"nsf","application/vnd.lotus-organizer":"org","application/vnd.lotus-screencam":"scm","application/vnd.lotus-wordpro":"lwp","application/vnd.macports.portpkg":"portpkg","application/vnd.mcd":"mcd","application/vnd.medcalcdata":"mc1","application/vnd.mediastation.cdkey":"cdkey","application/vnd.mfer":"mwf","application/vnd.mfmp":"mfm","application/vnd.micrografx.flo":"flo","application/vnd.micrografx.igx":"igx","application/vnd.mif":"mif","application/vnd.mobius.daf":"daf","application/vnd.mobius.dis":"dis","application/vnd.mobius.mbk":"mbk","application/vnd.mobius.mqy":"mqy","application/vnd.mobius.msl":"msl","application/vnd.mobius.plc":"plc","application/vnd.mobius.txf":"txf","application/vnd.mophun.application":"mpn","application/vnd.mophun.certificate":"mpc","application/vnd.mozilla.xul+xml":"xul","application/vnd.ms-artgalry":"cil","application/vnd.ms-cab-compressed":"cab","application/vnd.ms-excel":"xls","application/vnd.ms-excel.addin.macroenabled.12":"xlam","application/vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","application/vnd.ms-excel.sheet.macroenabled.12":"xlsm","application/vnd.ms-excel.template.macroenabled.12":"xltm","application/vnd.ms-fontobject":"eot","application/vnd.ms-htmlhelp":"chm","application/vnd.ms-ims":"ims","application/vnd.ms-lrm":"lrm","application/vnd.ms-officetheme":"thmx","application/vnd.ms-pki.seccat":"cat","application/vnd.ms-pki.stl":"stl","application/vnd.ms-powerpoint":"ppt","application/vnd.ms-powerpoint.addin.macroenabled.12":"ppam","application/vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","application/vnd.ms-powerpoint.slide.macroenabled.12":"sldm","application/vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","application/vnd.ms-powerpoint.template.macroenabled.12":"potm","application/vnd.ms-project":"mpp","application/vnd.ms-word.document.macroenabled.12":"docm","application/vnd.ms-word.template.macroenabled.12":"dotm","application/vnd.ms-works":"wps","application/vnd.ms-wpl":"wpl","application/vnd.ms-xpsdocument":"xps","application/vnd.mseq":"mseq","application/vnd.musician":"mus","application/vnd.muvee.style":"msty","application/vnd.mynfc":"taglet","application/vnd.neurolanguage.nlu":"nlu","application/vnd.nitf":"ntf","application/vnd.noblenet-directory":"nnd","application/vnd.noblenet-sealer":"nns","application/vnd.noblenet-web":"nnw","application/vnd.nokia.n-gage.data":"ngdat","application/vnd.nokia.n-gage.symbian.install":"n-gage","application/vnd.nokia.radio-preset":"rpst","application/vnd.nokia.radio-presets":"rpss","application/vnd.novadigm.edm":"edm","application/vnd.novadigm.edx":"edx","application/vnd.novadigm.ext":"ext","application/vnd.oasis.opendocument.chart":"odc","application/vnd.oasis.opendocument.chart-template":"otc","application/vnd.oasis.opendocument.database":"odb","application/vnd.oasis.opendocument.formula":"odf","application/vnd.oasis.opendocument.formula-template":"odft","application/vnd.oasis.opendocument.graphics":"odg","application/vnd.oasis.opendocument.graphics-template":"otg","application/vnd.oasis.opendocument.image":"odi","application/vnd.oasis.opendocument.image-template":"oti","application/vnd.oasis.opendocument.presentation":"odp","application/vnd.oasis.opendocument.presentation-template":"otp","application/vnd.oasis.opendocument.spreadsheet":"ods","application/vnd.oasis.opendocument.spreadsheet-template":"ots","application/vnd.oasis.opendocument.text":"odt","application/vnd.oasis.opendocument.text-master":"odm","application/vnd.oasis.opendocument.text-template":"ott","application/vnd.oasis.opendocument.text-web":"oth","application/vnd.olpc-sugar":"xo","application/vnd.oma.dd2+xml":"dd2","application/vnd.openofficeorg.extension":"oxt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/vnd.openxmlformats-officedocument.presentationml.slide":"sldx","application/vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","application/vnd.openxmlformats-officedocument.presentationml.template":"potx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","application/vnd.osgeo.mapguide.package":"mgp","application/vnd.osgi.dp":"dp","application/vnd.osgi.subsystem":"esa","application/vnd.palm":"pdb","application/vnd.pawaafile":"paw","application/vnd.pg.format":"str","application/vnd.pg.osasli":"ei6","application/vnd.picsel":"efif","application/vnd.pmi.widget":"wg","application/vnd.pocketlearn":"plf","application/vnd.powerbuilder6":"pbd","application/vnd.previewsystems.box":"box","application/vnd.proteus.magazine":"mgz","application/vnd.publishare-delta-tree":"qps","application/vnd.pvi.ptid1":"ptid","application/vnd.quark.quarkxpress":"qxd","application/vnd.realvnc.bed":"bed","application/vnd.recordare.musicxml":"mxl","application/vnd.recordare.musicxml+xml":"musicxml","application/vnd.rig.cryptonote":"cryptonote","application/vnd.rim.cod":"cod","application/vnd.rn-realmedia":"rm","application/vnd.rn-realmedia-vbr":"rmvb","application/vnd.route66.link66+xml":"link66","application/vnd.sailingtracker.track":"st","application/vnd.seemail":"see","application/vnd.sema":"sema","application/vnd.semd":"semd","application/vnd.semf":"semf","application/vnd.shana.informed.formdata":"ifm","application/vnd.shana.informed.formtemplate":"itp","application/vnd.shana.informed.interchange":"iif","application/vnd.shana.informed.package":"ipk","application/vnd.simtech-mindmapper":"twd","application/vnd.smaf":"mmf","application/vnd.smart.teacher":"teacher","application/vnd.solent.sdkm+xml":"sdkm","application/vnd.spotfire.dxp":"dxp","application/vnd.spotfire.sfs":"sfs","application/vnd.stardivision.calc":"sdc","application/vnd.stardivision.draw":"sda","application/vnd.stardivision.impress":"sdd","application/vnd.stardivision.math":"smf","application/vnd.stardivision.writer":"sdw","application/vnd.stardivision.writer-global":"sgl","application/vnd.stepmania.package":"smzip","application/vnd.stepmania.stepchart":"sm","application/vnd.sun.xml.calc":"sxc","application/vnd.sun.xml.calc.template":"stc","application/vnd.sun.xml.draw":"sxd","application/vnd.sun.xml.draw.template":"std","application/vnd.sun.xml.impress":"sxi","application/vnd.sun.xml.impress.template":"sti","application/vnd.sun.xml.math":"sxm","application/vnd.sun.xml.writer":"sxw","application/vnd.sun.xml.writer.global":"sxg","application/vnd.sun.xml.writer.template":"stw","application/vnd.sus-calendar":"sus","application/vnd.svd":"svd","application/vnd.symbian.install":"sis","application/vnd.syncml+xml":"xsm","application/vnd.syncml.dm+wbxml":"bdm","application/vnd.syncml.dm+xml":"xdm","application/vnd.tao.intent-module-archive":"tao","application/vnd.tcpdump.pcap":"pcap","application/vnd.tmobile-livetv":"tmo","application/vnd.trid.tpt":"tpt","application/vnd.triscape.mxs":"mxs","application/vnd.trueapp":"tra","application/vnd.ufdl":"ufd","application/vnd.uiq.theme":"utz","application/vnd.umajin":"umj","application/vnd.unity":"unityweb","application/vnd.uoml+xml":"uoml","application/vnd.vcx":"vcx","application/vnd.visio":"vsd","application/vnd.visionary":"vis","application/vnd.vsf":"vsf","application/vnd.wap.wbxml":"wbxml","application/vnd.wap.wmlc":"wmlc","application/vnd.wap.wmlscriptc":"wmlsc","application/vnd.webturbo":"wtb","application/vnd.wolfram.player":"nbp","application/vnd.wordperfect":"wpd","application/vnd.wqd":"wqd","application/vnd.wt.stf":"stf","application/vnd.xara":"xar","application/vnd.xfdl":"xfdl","application/vnd.yamaha.hv-dic":"hvd","application/vnd.yamaha.hv-script":"hvs","application/vnd.yamaha.hv-voice":"hvp","application/vnd.yamaha.openscoreformat":"osf","application/vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","application/vnd.yamaha.smaf-audio":"saf","application/vnd.yamaha.smaf-phrase":"spf","application/vnd.yellowriver-custom-menu":"cmp","application/vnd.zul":"zir","application/vnd.zzazz.deck+xml":"zaz","application/voicexml+xml":"vxml","application/widget":"wgt","application/winhlp":"hlp","application/wsdl+xml":"wsdl","application/wspolicy+xml":"wspolicy","application/x-7z-compressed":"7z","application/x-abiword":"abw","application/x-ace-compressed":"ace","application/x-apple-diskimage":"dmg","application/x-authorware-bin":"aab","application/x-authorware-map":"aam","application/x-authorware-seg":"aas","application/x-bcpio":"bcpio","application/x-bittorrent":"torrent","application/x-blorb":"blb","application/x-bzip":"bz","application/x-cbr":"cbr","application/x-cdlink":"vcd","application/x-cfs-compressed":"cfs","application/x-chat":"chat","application/x-chess-pgn":"pgn","application/x-conference":"nsc","application/x-cpio":"cpio","application/x-csh":"csh","application/x-debian-package":"deb","application/x-dgc-compressed":"dgc","application/x-director":"dir","application/x-doom":"wad","application/x-dtbncx+xml":"ncx","application/x-dtbook+xml":"dtb","application/x-dtbresource+xml":"res","application/x-dvi":"dvi","application/x-envoy":"evy","application/x-eva":"eva","application/x-font-bdf":"bdf","application/x-font-ghostscript":"gsf","application/x-font-linux-psf":"psf","application/x-font-pcf":"pcf","application/x-font-snf":"snf","application/x-font-type1":"pfa","application/x-freearc":"arc","application/x-futuresplash":"spl","application/x-gca-compressed":"gca","application/x-glulx":"ulx","application/x-gnumeric":"gnumeric","application/x-gramps-xml":"gramps","application/x-gtar":"gtar","application/x-hdf":"hdf","application/x-install-instructions":"install","application/x-iso9660-image":"iso","application/x-java-jnlp-file":"jnlp","application/x-latex":"latex","application/x-lzh-compressed":"lzh","application/x-mie":"mie","application/x-mobipocket-ebook":"prc","application/x-ms-application":"application","application/x-ms-shortcut":"lnk","application/x-ms-wmd":"wmd","application/x-ms-wmz":"wmz","application/x-ms-xbap":"xbap","application/x-msaccess":"mdb","application/x-msbinder":"obd","application/x-mscardfile":"crd","application/x-msclip":"clp","application/x-msdownload":"dll","application/x-msmediaview":"mvb","application/x-msmetafile":"wmf","application/x-msmoney":"mny","application/x-mspublisher":"pub","application/x-msschedule":"scd","application/x-msterminal":"trm","application/x-mswrite":"wri","application/x-netcdf":"nc","application/x-nzb":"nzb","application/x-pkcs12":"p12","application/x-pkcs7-certificates":"p7b","application/x-pkcs7-certreqresp":"p7r","application/x-research-info-systems":"ris","application/x-shar":"shar","application/x-shockwave-flash":"swf","application/x-silverlight-app":"xap","application/x-sql":"sql","application/x-stuffit":"sit","application/x-stuffitx":"sitx","application/x-subrip":"srt","application/x-sv4cpio":"sv4cpio","application/x-sv4crc":"sv4crc","application/x-t3vm-image":"t3","application/x-tads":"gam","application/x-tar":"tar","application/x-tcl":"tcl","application/x-tex":"tex","application/x-tex-tfm":"tfm","application/x-texinfo":"texinfo","application/x-tgif":"obj","application/x-ustar":"ustar","application/x-wais-source":"src","application/x-x509-ca-cert":"der","application/x-xfig":"fig","application/x-xliff+xml":"xlf","application/x-xpinstall":"xpi","application/x-xz":"xz","application/x-zmachine":"z1","application/xaml+xml":"xaml","application/xcap-diff+xml":"xdf","application/xenc+xml":"xenc","application/xhtml+xml":"xhtml","application/xml":"xsl","application/xml-dtd":"dtd","application/xop+xml":"xop","application/xproc+xml":"xpl","application/xslt+xml":"xslt","application/xspf+xml":"xspf","application/xv+xml":"mxml","application/yang":"yang","application/yin+xml":"yin","application/zip":"zip","audio/adpcm":"adp","audio/basic":"au","audio/midi":"mid","audio/mp4":"m4a","audio/mpeg":"mpga","audio/ogg":"oga","audio/s3m":"s3m","audio/silk":"sil","audio/vnd.dece.audio":"uva","audio/vnd.digital-winds":"eol","audio/vnd.dra":"dra","audio/vnd.dts":"dts","audio/vnd.dts.hd":"dtshd","audio/vnd.lucent.voice":"lvp","audio/vnd.ms-playready.media.pya":"pya","audio/vnd.nuera.ecelp4800":"ecelp4800","audio/vnd.nuera.ecelp7470":"ecelp7470","audio/vnd.nuera.ecelp9600":"ecelp9600","audio/vnd.rip":"rip","audio/webm":"weba","audio/x-aac":"aac","audio/x-aiff":"aif","audio/x-caf":"caf","audio/x-flac":"flac","audio/x-matroska":"mka","audio/x-mpegurl":"m3u","audio/x-ms-wax":"wax","audio/x-ms-wma":"wma","audio/x-pn-realaudio":"ram","audio/x-pn-realaudio-plugin":"rmp","audio/xm":"xm","chemical/x-cdx":"cdx","chemical/x-cif":"cif","chemical/x-cmdf":"cmdf","chemical/x-cml":"cml","chemical/x-csml":"csml","chemical/x-xyz":"xyz","font/collection":"ttc","font/otf":"otf","font/ttf":"ttf","font/woff":"woff","font/woff2":"woff2","image/cgm":"cgm","image/g3fax":"g3","image/gif":"gif","image/ief":"ief","image/jpeg":"jpeg","image/ktx":"ktx","image/png":"png","image/prs.btif":"btif","image/sgi":"sgi","image/svg+xml":"svg","image/tiff":"tiff","image/vnd.adobe.photoshop":"psd","image/vnd.dece.graphic":"uvi","image/vnd.djvu":"djvu","image/vnd.dvb.subtitle":"sub","image/vnd.dwg":"dwg","image/vnd.dxf":"dxf","image/vnd.fastbidsheet":"fbs","image/vnd.fpx":"fpx","image/vnd.fst":"fst","image/vnd.fujixerox.edmics-mmr":"mmr","image/vnd.fujixerox.edmics-rlc":"rlc","image/vnd.ms-modi":"mdi","image/vnd.ms-photo":"wdp","image/vnd.net-fpx":"npx","image/vnd.wap.wbmp":"wbmp","image/vnd.xiff":"xif","image/webp":"webp","image/x-3ds":"3ds","image/x-cmu-raster":"ras","image/x-cmx":"cmx","image/x-freehand":"fh","image/x-icon":"ico","image/x-mrsid-image":"sid","image/x-pcx":"pcx","image/x-pict":"pic","image/x-portable-anymap":"pnm","image/x-portable-bitmap":"pbm","image/x-portable-graymap":"pgm","image/x-portable-pixmap":"ppm","image/x-rgb":"rgb","image/x-xpixmap":"xpm","image/x-xwindowdump":"xwd","message/rfc822":"eml","model/iges":"igs","model/mesh":"msh","model/vnd.collada+xml":"dae","model/vnd.dwf":"dwf","model/vnd.gdl":"gdl","model/vnd.gtw":"gtw","model/vnd.vtu":"vtu","model/vrml":"wrl","model/x3d+binary":"x3db","model/x3d+vrml":"x3dv","model/x3d+xml":"x3d","text/cache-manifest":"appcache","text/calendar":"ics","text/css":"css","text/csv":"csv","text/html":"html","text/n3":"n3","text/plain":"txt","text/prs.lines.tag":"dsc","text/richtext":"rtx","text/sgml":"sgml","text/tab-separated-values":"tsv","text/troff":"t","text/turtle":"ttl","text/uri-list":"uri","text/vcard":"vcard","text/vnd.curl":"curl","text/vnd.curl.dcurl":"dcurl","text/vnd.curl.mcurl":"mcurl","text/vnd.curl.scurl":"scurl","text/vnd.fly":"fly","text/vnd.fmi.flexstor":"flx","text/vnd.graphviz":"gv","text/vnd.in3d.3dml":"3dml","text/vnd.in3d.spot":"spot","text/vnd.sun.j2me.app-descriptor":"jad","text/vnd.wap.wml":"wml","text/vnd.wap.wmlscript":"wmls","text/x-asm":"s","text/x-c":"cc","text/x-fortran":"f","text/x-java-source":"java","text/x-nfo":"nfo","text/x-opml":"opml","text/x-pascal":"p","text/x-setext":"etx","text/x-sfv":"sfv","text/x-uuencode":"uu","text/x-vcalendar":"vcs","text/x-vcard":"vcf","video/3gpp":"3gp","video/3gpp2":"3g2","video/h261":"h261","video/h263":"h263","video/h264":"h264","video/jpeg":"jpgv","video/jpm":"jpm","video/mj2":"mj2","video/mp4":"mp4","video/mpeg":"mpeg","video/quicktime":"qt","video/vnd.dece.hd":"uvh","video/vnd.dece.mobile":"uvm","video/vnd.dece.pd":"uvp","video/vnd.dece.sd":"uvs","video/vnd.dece.video":"uvv","video/vnd.dvb.file":"dvb","video/vnd.fvt":"fvt","video/vnd.mpegurl":"mxu","video/vnd.ms-playready.media.pyv":"pyv","video/vnd.uvvu.mp4":"uvu","video/vnd.vivo":"viv","video/webm":"webm","video/x-f4v":"f4v","video/x-fli":"fli","video/x-flv":"flv","video/x-m4v":"m4v","video/x-matroska":"mkv","video/x-mng":"mng","video/x-ms-asf":"asf","video/x-ms-vob":"vob","video/x-ms-wmx":"wmx","video/x-ms-wvx":"wvx","video/x-msvideo":"avi","video/x-sgi-movie":"movie","video/x-smv":"smv","x-conference/x-cooltalk":"ice","text/x-sql":"sql","image/x-pixlr-data":"pxd","image/x-adobe-dng":"dng","image/x-sketch":"sketch","image/x-xcf":"xcf","audio/amr":"amr","application/plt":"plt","application/sat":"sat","application/step":"step","text/x-httpd-cgi":"cgi","text/x-asap":"asp","text/x-jsp":"jsp"},i.prototype._options={cdns:{ace:"//cdnjs.cloudflare.com/ajax/libs/ace/1.4.1",codemirror:"//cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.2",ckeditor:"//cdnjs.cloudflare.com/ajax/libs/ckeditor/4.10.0",ckeditor5:"//cdn.ckeditor.com/ckeditor5/11.0.1",tinymce:"//cdnjs.cloudflare.com/ajax/libs/tinymce/4.8.2",simplemde:"//cdnjs.cloudflare.com/ajax/libs/simplemde/1.11.2",fabric16:"//cdnjs.cloudflare.com/ajax/libs/fabric.js/1.6.7",tui:"//uicdn.toast.com",hls:"//cdnjs.cloudflare.com/ajax/libs/hls.js/0.10.1/hls.min.js",dash:"//cdnjs.cloudflare.com/ajax/libs/dashjs/2.9.0/dash.all.min.js",flv:"//cdnjs.cloudflare.com/ajax/libs/flv.js/1.4.2/flv.min.js",prettify:"//cdn.rawgit.com/google/code-prettify/453bd5f51e61245339b738b1bbdd42d7848722ba/loader/run_prettify.js",psd:"//cdnjs.cloudflare.com/ajax/libs/psd.js/3.2.0/psd.min.js",rar:"//cdn.rawgit.com/nao-pon/rar.js/6cef13ec66dd67992fc7f3ea22f132d770ebaf8b/rar.min.js",zlibUnzip:"//cdn.rawgit.com/imaya/zlib.js/0.3.1/bin/unzip.min.js",zlibGunzip:"//cdn.rawgit.com/imaya/zlib.js/0.3.1/bin/gunzip.min.js",marked:"//cdnjs.cloudflare.com/ajax/libs/marked/0.4.0/marked.min.js",sparkmd5:"//cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.0/spark-md5.min.js",jssha:"//cdnjs.cloudflare.com/ajax/libs/jsSHA/2.3.1/sha.js",amr:"//cdn.rawgit.com/yxl/opencore-amr-js/dcf3d2b5f384a1d9ded2a54e4c137a81747b222b/js/amrnb.js"},url:"",requestType:"get",cors:null,requestMaxConn:3,transport:{},urlUpload:"",dragUploadAllow:"auto",overwriteUploadConfirm:!0,uploadMaxChunkSize:10485760,folderUploadExclude:{win:/^(?:desktop\.ini|thumbs\.db)$/i,mac:/^\.ds_store$/i},iframeTimeout:0,customData:{},handlers:{},customHeaders:{},xhrFields:{},lang:"en",baseUrl:"",cssAutoLoad:!0,cssClass:"",commands:["*"],commandsOptions:{getfile:{onlyURL:!1,multiple:!1,folders:!1,oncomplete:"",onerror:"",getPath:!0,getImgSize:!1},open:{method:"post",into:"window",selectAction:"open"},opennew:{url:"",useOriginQuery:!0},upload:{ui:"button"},download:{maxRequests:10,minFilesZipdl:2},quicklook:{autoplay:!0,width:450,height:300,mediaControlsList:"",pdfToolbar:!0,textMaxlen:2e3,contain:!1,docked:0,dockHeight:"auto",dockAutoplay:!1,googleMapsApiKey:"",googleMapsOpts:{maps:{},kml:{suppressInfoWindows:!1,preserveViewport:!1}},sharecadMimes:[],googleDocsMimes:[],officeOnlineMimes:[],getDimThreshold:2e5,mimeRegexNotEmptyCheck:/^application\/vnd\.google-apps\./},edit:{dialogWidth:void 0,mimes:[],makeTextMimes:["text/plain","text/css","text/html"],useStoredEditor:!1,editorMaximized:!1,editors:[],encodings:["Big5","Big5-HKSCS","Cp437","Cp737","Cp775","Cp850","Cp852","Cp855","Cp857","Cp858","Cp862","Cp866","Cp874","EUC-CN","EUC-JP","EUC-KR","GB18030","ISO-2022-CN","ISO-2022-JP","ISO-2022-KR","ISO-8859-1","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-13","ISO-8859-15","KOI8-R","KOI8-U","Shift-JIS","Windows-1250","Windows-1251","Windows-1252","Windows-1253","Windows-1254","Windows-1257"],extraOptions:{tuiImgEditOpts:{iconsPath:void 0,theme:{}},creativeCloudApiKey:"",managerUrl:null,ckeditor5Mode:"balloon",onlineConvert:{maxSize:100,showLink:!0}}},search:{incsearch:{enable:!0,minlen:1,wait:500},searchTypes:{SearchMime:{name:"btnMime",title:"searchMime"}}},info:{nullUrlDirLinkSelf:!0,hideItems:[],showHashMaxsize:104857600,showHashAlgorisms:["md5","sha256"],custom:{}},mkdir:{intoNewFolderToolbtn:!1},resize:{grid8px:"disable",presetSize:[[320,240],[400,400],[640,480],[800,600]],getDimThreshold:204800,dimSubImgSize:307200},rm:{quickTrash:!0,infoCheckWait:10,toTrashMaxItems:1e3},help:{view:["about","shortcuts","help","integrations","debug"],helpSource:""},preference:{selectActions:["open","edit/download","resize/edit/download","download","quicklook"]}},bootCallback:null,getFileCallback:null,defaultView:"icons",startPathHash:"",sound:!0,ui:["toolbar","tree","path","stat"],uiOptions:{toolbar:[["home","back","forward","up","reload"],["netmount"],["mkdir","mkfile","upload"],["open","download","getfile"],["undo","redo"],["copy","cut","paste","rm","empty","hide"],["duplicate","rename","edit","resize","chmod"],["selectall","selectnone","selectinvert"],["quicklook","info"],["extract","archive"],["search"],["view","sort"],["preference","help"],["fullscreen"]],toolbarExtra:{displayTextLabel:!1,labelExcludeUA:["Mobile"],autoHideUA:["Mobile"],defaultHides:["home","reload"],showPreferenceButton:"none"},tree:{openRootOnLoad:!0,openCwdOnOpen:!0,syncTree:!0,subTreeMax:100,subdirsMaxConn:2,subdirsAtOnce:5,durations:{slideUpDown:"fast",autoScroll:"fast"}},navbar:{minWidth:150,maxWidth:500,autoHideUA:[]},navdock:{disabled:!1,initMaxHeight:"50%",maxHeight:"90%"},cwd:{oldSchool:!1,showSelectCheckboxUA:["Touch"],listView:{columns:["perm","date","size","kind"],columnsCustomName:{},fixedHeader:!0},iconsView:{size:0,sizeMax:3,sizeNames:{0:"viewSmall",1:"viewMedium",2:"viewLarge",3:"viewExtraLarge"}}},path:{toWorkzoneWithoutNavbar:!0},dialog:{focusOnMouseOver:!0},toast:{animate:{showMethod:"fadeIn",showDuration:300,showEasing:"swing",timeOut:3e3,hideMethod:"fadeOut",hideDuration:1500,hideEasing:"swing"}}},dispInlineRegex:"^(?:(?:image|video|audio)|application/(?:x-mpegURL|dash+xml)|(?:text/plain|application/pdf)$)",onlyMimes:[],sortRules:{},sortType:"name",sortOrder:"asc",sortStickFolders:!0,sortAlsoTreeview:!1,clientFormatDate:!0,UTCDate:!1,dateFormat:"",fancyDateFormat:"",fileModeStyle:"both",width:"auto",height:400,heightBase:null,resizable:!0,notifyDelay:500,notifyDialog:{position:{top:"12px",right:"12px"},width:280},dialogContained:!1,allowShortcuts:!0,rememberLastDir:!0,reloadClearHistory:!1,useBrowserHistory:!0,showFiles:50,showThreshold:50,validName:!1,fileFilter:!1,backupSuffix:"~",sync:0,syncStart:!0,loadTmbs:5,cookie:{expires:30,domain:"",path:"/",secure:!1},contextmenu:{navbar:["open","opennew","download","|","upload","mkdir","|","copy","cut","paste","duplicate","|","rm","empty","hide","|","rename","|","archive","|","places","info","chmod","netunmount"],cwd:["undo","redo","|","back","up","reload","|","upload","mkdir","mkfile","paste","|","empty","hide","|","view","sort","selectall","colwidth","|","places","info","chmod","netunmount","|","fullscreen","|","preference"],files:["getfile","|","open","opennew","download","opendir","quicklook","|","upload","mkdir","|","copy","cut","paste","duplicate","|","rm","empty","hide","|","rename","edit","resize","|","archive","extract","|","selectall","selectinvert","|","places","info","chmod","netunmount"]},enableAlways:!1,enableByMouseOver:!0,windowCloseConfirm:["hasNotifyDialog","editingFile"],rawStringDecoder:"object"==typeof Encoding&&e.isFunction(Encoding.convert)?function(e){
return Encoding.convert(e,{to:"UNICODE",type:"string"})}:null,debug:["error","warning","event-destroy"]},i.prototype._options.commandsOptions.netmount={ftp:{name:"FTP",inputs:{host:e('<input type="text"/>'),port:e('<input type="number" placeholder="21" class="elfinder-input-optional"/>'),path:e('<input type="text" value="/"/>'),user:e('<input type="text"/>'),pass:e('<input type="password" autocomplete="new-password"/>'),FTPS:e('<input type="checkbox" value="1" title="File Transfer Protocol over SSL/TLS"/>'),encoding:e('<input type="text" placeholder="Optional" class="elfinder-input-optional"/>'),locale:e('<input type="text" placeholder="Optional" class="elfinder-input-optional"/>')}},dropbox2:i.prototype.makeNetmountOptionOauth("dropbox2","Dropbox","Dropbox",{noOffline:!0,root:"/",pathI18n:"path",integrate:{title:"Dropbox.com",link:"https://www.dropbox.com"}}),googledrive:i.prototype.makeNetmountOptionOauth("googledrive","Google Drive","Google",{integrate:{title:"Google Drive",link:"https://www.google.com/drive/"}}),onedrive:i.prototype.makeNetmountOptionOauth("onedrive","One Drive","OneDrive",{integrate:{title:"Microsoft OneDrive",link:"https://onedrive.live.com"}}),box:i.prototype.makeNetmountOptionOauth("box","Box","Box",{noOffline:!0,integrate:{title:"Box.com",link:"https://www.box.com"}})},i.prototype.history=function(t){var n,i=this,a=!0,o=[],r=function(){o=[t.cwd().hash],n=0,a=!0},s=t.options.useBrowserHistory&&window.history&&window.history.pushState?window.history:null,l=function(s){return s&&i.canForward()||!s&&i.canBack()?(a=!1,t.exec("open",o[s?++n:--n]).fail(r)):e.Deferred().reject()},c=function(e){!s||s.state&&s.state.thash===e||s.pushState({thash:e},null,location.pathname+location.search+(e?"#elf_"+e:""))};this.canBack=function(){return n>0},this.canForward=function(){return n<o.length-1},this.back=l,this.forward=function(){return l(!0)},t.bind("init",function(){s&&!s.state&&c(t.startDir())}).open(function(){var e=o.length,i=t.cwd().hash;a&&(n>=0&&e>n+1&&o.splice(n+1),o[o.length-1]!=i&&o.push(i),n=o.length-1),a=!0,c(i)}).reload(t.options.reloadClearHistory&&r)},i.prototype.command=function(t){this.fm=t,this.name="",this.className="",this.title="",this.linkedCmds=[],this.state=-1,this.alwaysEnabled=!1,this.noChangeDirOnRemovedCwd=!1,this._disabled=!1,this.disableOnSearch=!1,this.updateOnSelect=!0,this.syncTitleOnChange=!1,this.keepContextmenu=!1,this._handlers={enable:function(){this.update(void 0,this.value)},disable:function(){this.update(-1,this.value)},"open reload load sync":function(){this._disabled=!(this.alwaysEnabled||this.fm.isCommandEnabled(this.name)),this.update(void 0,this.value),this.change()}},this.handlers={},this.shortcuts=[],this.options={ui:"button"},this.listeners=[],this.setup=function(t,n){var i,a,o,r=this,s=this.fm,l=function(t){var n=t.callback||function(e){s.exec(r.name,void 0,{_userAction:!0,_currentType:"shortcut"})};t.callback=function(t){var i,a={};r.enabled()&&(s.searchStatus.state<2?i=s.isCommandEnabled(r.name):(e.each(s.selected(),function(t,n){s.optionsByHashes[n]?a[n]=!0:e.each(s.volOptions,function(e){if(!a[e]&&0===n.indexOf(e))return a[e]=!0,!1})}),e.each(a,function(e){if(i=s.isCommandEnabled(r.name,e),!i)return!1})),i&&(r.event=t,n.call(r),delete r.event))}};for(this.name=t,this.title=s.messages["cmd"+t]?s.i18n("cmd"+t):this.extendsCmd&&s.messages["cmd"+this.extendsCmd]?s.i18n("cmd"+this.extendsCmd):t,this.options=Object.assign({},this.options,n),this.listeners=[],n.shortcuts&&("function"==typeof n.shortcuts?o=n.shortcuts(this.fm,this.shortcuts):Array.isArray(n.shortcuts)&&(o=n.shortcuts),this.shortcuts=o||[]),this.updateOnSelect&&(this._handlers.select=function(){this.update(void 0,this.value)}),e.each(Object.assign({},r._handlers,r.handlers),function(t,n){s.bind(t,e.proxy(n,r))}),i=0;i<this.shortcuts.length;i++)a=this.shortcuts[i],l(a),!a.description&&(a.description=this.title),s.shortcut(a);this.disableOnSearch&&s.bind("search searchend",function(){r._disabled="search"===this.type||!(this.alwaysEnabled||s.isCommandEnabled(t)),r.update(void 0,r.value)}),this.init()},this.init=function(){},this.exec=function(t,n){return e.Deferred().reject()},this.getUndo=function(e,t){return!1},this.disabled=function(){return this.state<0},this.enabled=function(){return this.state>-1},this.active=function(){return this.state>0},this.getstate=function(){return-1},this.update=function(e,t){var n=this.state,i=this.value;this._disabled&&0===this.fm.searchStatus?this.state=-1:this.state=void 0!==e?e:this.getstate(),this.value=t,n==this.state&&i==this.value||this.change()},this.change=function(e){var t,n;if("function"==typeof e)this.listeners.push(e);else for(n=0;n<this.listeners.length;n++){t=this.listeners[n];try{t(this.state,this.value)}catch(i){this.fm.debug("error",i)}}return this},this.hashes=function(n){return n?e.grep(Array.isArray(n)?n:[n],function(e){return!!t.file(e)}):t.selected()},this.files=function(t){var n=this.fm;return t?e.map(Array.isArray(t)?t:[t],function(e){return n.file(e)||null}):n.selectedFiles()}},i.prototype.resources={"class":{hover:"ui-state-hover",active:"ui-state-active",disabled:"ui-state-disabled",draggable:"ui-draggable",droppable:"ui-droppable",adroppable:"elfinder-droppable-active",cwdfile:"elfinder-cwd-file",cwd:"elfinder-cwd",tree:"elfinder-tree",treeroot:"elfinder-navbar-root",navdir:"elfinder-navbar-dir",navdirwrap:"elfinder-navbar-dir-wrapper",navarrow:"elfinder-navbar-arrow",navsubtree:"elfinder-navbar-subtree",navcollapse:"elfinder-navbar-collapsed",navexpand:"elfinder-navbar-expanded",treedir:"elfinder-tree-dir",placedir:"elfinder-place-dir",searchbtn:"elfinder-button-search",editing:"elfinder-to-editing",preventback:"elfinder-prevent-back"},tpl:{perms:'<span class="elfinder-perms"/>',lock:'<span class="elfinder-lock"/>',symlink:'<span class="elfinder-symlink"/>',navicon:'<span class="elfinder-nav-icon"/>',navspinner:'<span class="elfinder-navbar-spinner"/>',navdir:'<div class="elfinder-navbar-wrapper{root}"><span id="{id}" class="ui-corner-all elfinder-navbar-dir {cssclass}"><span class="elfinder-navbar-arrow"/><span class="elfinder-navbar-icon" {style}/>{symlink}{permissions}{name}</span><div class="elfinder-navbar-subtree" style="display:none"/></div>',placedir:'<div class="elfinder-navbar-wrapper"><span id="{id}" class="ui-corner-all elfinder-navbar-dir {cssclass}" title="{title}"><span class="elfinder-navbar-arrow"/><span class="elfinder-navbar-icon" {style}/>{symlink}{permissions}{name}</span><div class="elfinder-navbar-subtree" style="display:none"/></div>'},mimes:{text:["application/dash+xml","application/docbook+xml","application/javascript","application/json","application/plt","application/sat","application/sql","application/step","application/vnd.hp-hpgl","application/x-awk","application/x-config","application/x-csh","application/x-empty","application/x-mpegurl","application/x-perl","application/x-php","application/x-web-config","application/xhtml+xml","application/xml","audio/x-mp3-playlist","image/cgm","image/svg+xml","image/vnd.dxf","model/iges"]},mixin:{make:function(){var t,n,i,a,o,r,s,l,c,d,p=this,u=this.fm,h=this.name,f=this.requestCmd||h,m=u.getUI("workzone"),g=this.origin&&"navbar"===this.origin?"tree":"cwd",v=u.getUI(g),b="tree"===g,y=b?"navHash2Id":"cwdHash2Id",w=!b&&"list"!=u.storage("view"),x=u.selected(),k=this.move||!1,C=m.hasClass("elfinder-cwd-wrapper-empty"),z=function(){requestAnimationFrame(function(){P&&P.trigger("blur")})},T=function(){D.is(":hidden")||D.elfinderoverlay("hide").off("click close",E),i.removeClass("ui-front").css("position","").off("unselect."+u.namespace,z),w?n&&n.css("max-height",""):b||i.css("width","").parent("td").css("overflow","")},A=e.Deferred().fail(function(e){r&&o.attr("class",r),C&&m.addClass("elfinder-cwd-wrapper-empty"),x&&(k&&u.trigger("unlockfiles",{files:x}),u.clipboard([]),u.trigger("selectfiles",{files:x})),e&&u.error(e)}).always(function(){T(),U(),u.enable().unbind("open",H).trigger("resMixinMake")}),I="tmp_"+parseInt(1e5*Math.random()),S=this.data&&this.data.target?this.data.target:b?u.file(x[0]).hash:u.cwd().hash,O=new Date,j={hash:I,phash:S,name:u.uniqueName(this.prefix,S),mime:this.mime,read:!0,write:!0,date:"Today "+O.getHours()+":"+O.getMinutes(),move:k},M=this.data||{},F=v.trigger("create."+u.namespace,j).find("#"+u[y](I)),D=u.getUI("overlay"),U=function(){F&&F.length&&(P.off(),F.hide(),u.unselectfiles({files:[I]}).unbind("resize",q),requestAnimationFrame(function(){b?F.closest(".elfinder-navbar-wrapper").remove():F.remove()}))},E=function(e){D.is(":hidden")||i.css("z-index",""),_||(U(),A.reject(),e&&(e.stopPropagation(),e.preventDefault()))},P=e(w?"<textarea/>":'<input type="text"/>').on("keyup text",function(){w?(this.style.height="1px",this.style.height=this.scrollHeight+"px"):t&&(this.style.width=t+"px",this.scrollWidth>t&&(this.style.width=this.scrollWidth+10+"px"))}).on("keydown",function(t){t.stopImmediatePropagation(),t.keyCode==e.ui.keyCode.ESCAPE?A.reject():t.keyCode==e.ui.keyCode.ENTER&&P.trigger("blur")}).on("mousedown click dblclick",function(e){e.stopPropagation(),"dblclick"===e.type&&e.preventDefault()}).on("blur",function(){var t,n=e.trim(P.val()),o=P.parent(),r=!0;if(D.is(":hidden")||i.css("z-index",""),""===n)return E();if(!_&&o.length){if(u.options.validName&&u.options.validName.test)try{r=u.options.validName.test(n)}catch(s){r=!1}if(!n||"."===n||".."===n||!r)return _=!0,u.error("directory"===j.mime?"errInvDirname":"errInvName",{modal:!0,close:function(){setTimeout(R,120)}}),!1;if(u.fileByName(n,S))return _=!0,u.error(["errExists",n],{modal:!0,close:function(){setTimeout(R,120)}}),!1;t=x&&k?u.exec("cut",x):null,e.when(t).done(function(){var t={},i={};T(),P.hide().before(e("<span>").text(n)),u.lockfiles({files:[I]}),u.request({data:Object.assign({cmd:f,name:n,target:S},M||{}),notify:{type:f,cnt:1},preventFail:!0,syncOnFail:!0,navigate:{toast:t}}).fail(function(t){u.unlockfiles({files:[I]}),_=!0,P.show().prev().remove(),u.error(t,{modal:!0,close:function(){Array.isArray(t)&&e.inArray("errUploadMime",t)!==-1?A.notify("errUploadMime").reject():setTimeout(R,120)}})}).done(function(n){if(n&&n.added&&n.added[0]){var o,r=n.added[0],s=r.hash,l=(v.find("#"+u[y](s)),{directory:{cmd:"open",msg:"cmdopendir"},text:{cmd:"edit",msg:"cmdedit"},"default":{cmd:"open",msg:"cmdopen"}});x&&k&&u.one(f+"done",function(){u.exec("paste",s)}),k||(u.mimeIsText(r.mime)&&!u.mimesCanMakeEmpty[r.mime]&&u.mimeTypes[r.mime]&&(u.trigger("canMakeEmptyFile",{mimes:[r.mime],unshift:!0}),o={},o[r.mime]=u.mimeTypes[r.mime],u.storage("mkfileTextMimes",Object.assign(o,u.storage("mkfileTextMimes")||{}))),Object.assign(i,a||l[r.mime]||l[r.mime.split("/")[0]]||l[u.mimesCanMakeEmpty[r.mime]||e.inArray(r.mime,u.resources.mimes.text)!==-1?"text":"none"]||l["default"]),Object.assign(t,i.cmd?{incwd:{msg:u.i18n(["complete",u.i18n("cmd"+h)]),action:i},inbuffer:{msg:u.i18n(["complete",u.i18n("cmd"+h)]),action:i}}:{inbuffer:{msg:u.i18n(["complete",u.i18n("cmd"+h)])}}))}A.resolve(n)})}).fail(function(){A.reject()})}}).on("dragenter dragleave dragover drop",function(e){e.stopPropagation()}),R=function(){var e=u.splitFileExtention(P.val())[0];_||!u.UA.Mobile||u.UA.iOS||(D.on("click close",E).elfinderoverlay("show"),i.css("z-index",D.css("z-index")+1)),_=!1,!u.enabled()&&u.enable(),P.trigger("focus").trigger("select"),P[0].setSelectionRange&&P[0].setSelectionRange(0,e.length)},q=function(){F.trigger("scrolltoview",{blink:!1})},H=function(){A&&"pending"===A.state()&&A.reject()},_=!1;return u.isCommandEnabled(f,S)&&F.length?(e.isPlainObject(p.nextAction)&&(a=Object.assign({},p.nextAction)),b?(o=e("#"+u[y](S)),s=u.res("class","navcollapse"),l=u.res("class","navexpand"),c=u.res("class","navarrow"),d=u.res("class","navsubtree"),F.closest("."+d).show(),o.hasClass(s)||(r=o.attr("class"),o.addClass(s+" "+l+" elfinder-subtree-loaded")),o.is("."+s+":not(."+l+")")&&o.children("."+c).trigger("click").data("dfrd").done(function(){P.val()===j.name&&P.val(u.uniqueName(p.prefix,S)).trigger("select").trigger("focus")}),n=F.contents().filter(function(){return 3==this.nodeType&&e(this).parent().attr("id")===u.navHash2Id(j.hash)}),i=n.parent(),n.replaceWith(P.val(j.name))):(C&&m.removeClass("elfinder-cwd-wrapper-empty"),n=F.find(".elfinder-cwd-filename"),i=n.parent(),w?n.css("max-height","none"):(t=i.width(),i.width(t-15).parent("td").css("overflow","visible")),n.empty().append(P.val(j.name))),i.addClass("ui-front").css("position","relative").on("unselect."+u.namespace,z),u.bind("resize",q).one("open",H),P.trigger("keyup"),R(),A):A.reject()}},blink:function(e,t){var n,i={slowonce:function(){e.hide().delay(250).fadeIn(750).delay(500).fadeOut(3500)},lookme:function(){e.show().fadeOut(500).fadeIn(750)}};t=t||"slowonce",n=i[t]||i.lookme,e.stop(!0,!0),n()}},e.fn.dialogelfinder=function(t){var n,i="elfinderPosition",a="elfinderDestroyOnClose";if(this.not(".elfinder").each(function(){var n=(e(document),e('<div class="ui-widget-header dialogelfinder-drag ui-corner-top">'+(t.title||"Files")+"</div>")),o=(e('<a href="#" class="dialogelfinder-drag-close ui-corner-all"><span class="ui-icon ui-icon-closethick"> </span></a>').appendTo(n).on("click",function(e){e.preventDefault(),o.dialogelfinder("close")}),e(this).addClass("dialogelfinder").css("position","absolute").hide().appendTo("body").draggable({handle:".dialogelfinder-drag",containment:"window",stop:function(){o.trigger("resize"),r.trigger("resize")}}).elfinder(t).prepend(n)),r=o.elfinder("instance");o.width(parseInt(o.width())||840).data(a,!!t.destroyOnClose).find(".elfinder-toolbar").removeClass("ui-corner-top"),t.position&&o.data(i,t.position),t.autoOpen!==!1&&e(this).dialogelfinder("open")}),"open"==t){var n=e(this),o=n.data(i)||{top:parseInt(e(document).scrollTop()+(e(window).height()<n.height()?2:(e(window).height()-n.height())/2)),left:parseInt(e(document).scrollLeft()+(e(window).width()<n.width()?2:(e(window).width()-n.width())/2))};n.is(":hidden")&&(n.addClass("ui-front").css(o).show().trigger("resize"),setTimeout(function(){n.trigger("resize").trigger("mousedown")},200))}else if("close"==t)n=e(this).removeClass("ui-front"),n.is(":visible")&&(n.data(a)?n.elfinder("destroy").remove():n.elfinder("close"));else if("instance"==t)return e(this).getElFinder();return this},"function"==typeof i&&i.prototype.i18&&(i.prototype.i18.en={translator:"Troex Nevelin &lt;troex@fury.scancode.ru&gt;, Naoki Sawada &lt;hypweb+elfinder@gmail.com&gt;",language:"English",direction:"ltr",dateFormat:"M d, Y h:i A",fancyDateFormat:"$1 h:i A",nonameDateFormat:"ymd-His",messages:{error:"Error",errUnknown:"Unknown error.",errUnknownCmd:"Unknown command.",errJqui:"Invalid jQuery UI configuration. Selectable, draggable and droppable components must be included.",errNode:"elFinder requires DOM Element to be created.",errURL:"Invalid elFinder configuration! URL option is not set.",errAccess:"Access denied.",errConnect:"Unable to connect to backend.",errAbort:"Connection aborted.",errTimeout:"Connection timeout.",errNotFound:"Backend not found.",errResponse:"Invalid backend response.",errConf:"Invalid backend configuration.",errJSON:"PHP JSON module not installed.",errNoVolumes:"Readable volumes not available.",errCmdParams:'Invalid parameters for command "$1".',errDataNotJSON:"Data is not JSON.",errDataEmpty:"Data is empty.",errCmdReq:"Backend request requires command name.",errOpen:'Unable to open "$1".',errNotFolder:"Object is not a folder.",errNotFile:"Object is not a file.",errRead:'Unable to read "$1".',errWrite:'Unable to write into "$1".',errPerm:"Permission denied.",errLocked:'"$1" is locked and can not be renamed, moved or removed.',errExists:'Item named "$1" already exists.',errInvName:"Invalid file name.",errInvDirname:"Invalid folder name.",errFolderNotFound:"Folder not found.",errFileNotFound:"File not found.",errTrgFolderNotFound:'Target folder "$1" not found.',errPopup:"Browser prevented opening popup window. To open file enable it in browser options.",errMkdir:'Unable to create folder "$1".',errMkfile:'Unable to create file "$1".',errRename:'Unable to rename "$1".',errCopyFrom:'Copying files from volume "$1" not allowed.',errCopyTo:'Copying files to volume "$1" not allowed.',errMkOutLink:"Unable to create a link to outside the volume root.",errUpload:"Upload error.",errUploadFile:'Unable to upload "$1".',errUploadNoFiles:"No files found for upload.",errUploadTotalSize:"Data exceeds the maximum allowed size.",errUploadFileSize:"File exceeds maximum allowed size.",errUploadMime:"File type not allowed.",errUploadTransfer:'"$1" transfer error.',errUploadTemp:"Unable to make temporary file for upload.",errNotReplace:'Object "$1" already exists at this location and can not be replaced by object with another type.',errReplace:'Unable to replace "$1".',errSave:'Unable to save "$1".',errCopy:'Unable to copy "$1".',errMove:'Unable to move "$1".',errCopyInItself:'Unable to copy "$1" into itself.',errRm:'Unable to remove "$1".',errTrash:"Unable into trash.",errRmSrc:"Unable remove source file(s).",errExtract:'Unable to extract files from "$1".',errArchive:"Unable to create archive.",errArcType:"Unsupported archive type.",errNoArchive:"File is not archive or has unsupported archive type.",errCmdNoSupport:"Backend does not support this command.",errReplByChild:'The folder "$1" can\'t be replaced by an item it contains.',errArcSymlinks:"For security reason denied to unpack archives contains symlinks or files with not allowed names.",errArcMaxSize:"Archive files exceeds maximum allowed size.",errResize:'Unable to resize "$1".',errResizeDegree:"Invalid rotate degree.",errResizeRotate:"Unable to rotate image.",errResizeSize:"Invalid image size.",errResizeNoChange:"Image size not changed.",errUsupportType:"Unsupported file type.",errNotUTF8Content:'File "$1" is not in UTF-8 and cannot be edited.',errNetMount:'Unable to mount "$1".',errNetMountNoDriver:"Unsupported protocol.",errNetMountFailed:"Mount failed.",errNetMountHostReq:"Host required.",errSessionExpires:"Your session has expired due to inactivity.",errCreatingTempDir:'Unable to create temporary directory: "$1"',errFtpDownloadFile:'Unable to download file from FTP: "$1"',errFtpUploadFile:'Unable to upload file to FTP: "$1"',errFtpMkdir:'Unable to create remote directory on FTP: "$1"',errArchiveExec:'Error while archiving files: "$1"',errExtractExec:'Error while extracting files: "$1"',errNetUnMount:"Unable to unmount.",errConvUTF8:"Not convertible to UTF-8",errFolderUpload:"Try the modern browser, If you'd like to upload the folder.",errSearchTimeout:'Timed out while searching "$1". Search result is partial.',errReauthRequire:"Re-authorization is required.",errMaxTargets:"Max number of selectable items is $1.",errRestore:"Unable to restore from the trash. Can't identify the restore destination.",errEditorNotFound:"Editor not found to this file type.",errServerError:"Error occurred on the server side.",errEmpty:'Unable to empty folder "$1".',cmdarchive:"Create archive",cmdback:"Back",cmdcopy:"Copy",cmdcut:"Cut",cmddownload:"Download",cmdduplicate:"Duplicate",cmdedit:"Edit file",cmdextract:"Extract files from archive",cmdforward:"Forward",cmdgetfile:"Select files",cmdhelp:"About this software",cmdhome:"Root",cmdinfo:"Get info",cmdmkdir:"New folder",cmdmkdirin:"Into New Folder",cmdmkfile:"New file",cmdopen:"Open",cmdpaste:"Paste",cmdquicklook:"Preview",cmdreload:"Reload",cmdrename:"Rename",cmdrm:"Delete",cmdtrash:"Into trash",cmdrestore:"Restore",cmdsearch:"Find files",cmdup:"Go to parent folder",cmdupload:"Upload files",cmdview:"View",cmdresize:"Resize & Rotate",cmdsort:"Sort",cmdnetmount:"Mount network volume",cmdnetunmount:"Unmount",cmdplaces:"To Places",cmdchmod:"Change mode",cmdopendir:"Open a folder",cmdcolwidth:"Reset column width",cmdfullscreen:"Full Screen",cmdmove:"Move",cmdempty:"Empty the folder",cmdundo:"Undo",cmdredo:"Redo",cmdpreference:"Preferences",cmdselectall:"Select all",cmdselectnone:"Select none",cmdselectinvert:"Invert selection",cmdopennew:"Open in new window",cmdhide:"Hide (Preference)",btnClose:"Close",btnSave:"Save",btnRm:"Remove",btnApply:"Apply",btnCancel:"Cancel",btnNo:"No",btnYes:"Yes",btnMount:"Mount",btnApprove:"Goto $1 & approve",btnUnmount:"Unmount",btnConv:"Convert",btnCwd:"Here",btnVolume:"Volume",btnAll:"All",btnMime:"MIME Type",btnFileName:"Filename",btnSaveClose:"Save & Close",btnBackup:"Backup",btnRename:"Rename",btnRenameAll:"Rename(All)",btnPrevious:"Prev ($1/$2)",btnNext:"Next ($1/$2)",btnSaveAs:"Save As",ntfopen:"Open folder",ntffile:"Open file",ntfreload:"Reload folder content",ntfmkdir:"Creating folder",ntfmkfile:"Creating files",ntfrm:"Delete items",ntfcopy:"Copy items",ntfmove:"Move items",ntfprepare:"Checking existing items",ntfrename:"Rename files",ntfupload:"Uploading files",ntfdownload:"Downloading files",ntfsave:"Save files",ntfarchive:"Creating archive",ntfextract:"Extracting files from archive",ntfsearch:"Searching files",ntfresize:"Resizing images",ntfsmth:"Doing something",ntfloadimg:"Loading image",ntfnetmount:"Mounting network volume",ntfnetunmount:"Unmounting network volume",ntfdim:"Acquiring image dimension",ntfreaddir:"Reading folder infomation",ntfurl:"Getting URL of link",ntfchmod:"Changing file mode",ntfpreupload:"Verifying upload file name",ntfzipdl:"Creating a file for download",ntfparents:"Getting path infomation",ntfchunkmerge:"Processing the uploaded file",ntftrash:"Doing throw in the trash",ntfrestore:"Doing restore from the trash",ntfchkdir:"Checking destination folder",ntfundo:"Undoing previous operation",ntfredo:"Redoing previous undone",ntfchkcontent:"Checking contents",volume_Trash:"Trash",dateUnknown:"unknown",Today:"Today",Yesterday:"Yesterday",msJan:"Jan",msFeb:"Feb",msMar:"Mar",msApr:"Apr",msMay:"May",msJun:"Jun",msJul:"Jul",msAug:"Aug",msSep:"Sep",msOct:"Oct",msNov:"Nov",msDec:"Dec",January:"January",February:"February",March:"March",April:"April",May:"May",June:"June",July:"July",August:"August",September:"September",October:"October",November:"November",December:"December",Sunday:"Sunday",Monday:"Monday",Tuesday:"Tuesday",Wednesday:"Wednesday",Thursday:"Thursday",Friday:"Friday",Saturday:"Saturday",Sun:"Sun",Mon:"Mon",Tue:"Tue",Wed:"Wed",Thu:"Thu",Fri:"Fri",Sat:"Sat",sortname:"by name",sortkind:"by kind",sortsize:"by size",sortdate:"by date",sortFoldersFirst:"Folders first",sortperm:"by permission",sortmode:"by mode",sortowner:"by owner",sortgroup:"by group",sortAlsoTreeview:"Also Treeview","untitled file.txt":"NewFile.txt","untitled folder":"NewFolder",Archive:"NewArchive","untitled file":"NewFile.$1",extentionfile:"$1 File",confirmReq:"Confirmation required",confirmRm:"Are you sure you want to permanently remove items?<br/>This cannot be undone!",confirmRepl:"Replace old file with new one? (If it contains folders, it will be merged. To backup and replace, select Backup.)",confirmRest:"Replace existing item with the item in trash?",confirmConvUTF8:"Not in UTF-8<br/>Convert to UTF-8?<br/>Contents become UTF-8 by saving after conversion.",confirmNonUTF8:"Character encoding of this file couldn't be detected. It need to temporarily convert to UTF-8 for editting.<br/>Please select character encoding of this file.",confirmNotSave:"It has been modified.<br/>Losing work if you do not save changes.",confirmTrash:"Are you sure you want to move items to trash bin?",apllyAll:"Apply to all",name:"Name",size:"Size",perms:"Permissions",modify:"Modified",kind:"Kind",read:"read",write:"write",noaccess:"no access",and:"and",unknown:"unknown",selectall:"Select all items",selectfiles:"Select item(s)",selectffile:"Select first item",selectlfile:"Select last item",viewlist:"List view",viewicons:"Icons view",viewSmall:"Small icons",viewMedium:"Medium icons",viewLarge:"Large icons",viewExtraLarge:"Extra large icons",places:"Places",calc:"Calculate",path:"Path",aliasfor:"Alias for",locked:"Locked",dim:"Dimensions",files:"Files",folders:"Folders",items:"Items",yes:"yes",no:"no",link:"Link",searcresult:"Search results",selected:"selected items",about:"About",shortcuts:"Shortcuts",help:"Help",webfm:"Web file manager",ver:"Version",protocolver:"protocol version",homepage:"Project home",docs:"Documentation",github:"Fork us on GitHub",twitter:"Follow us on Twitter",facebook:"Join us on Facebook",team:"Team",chiefdev:"chief developer",developer:"developer",contributor:"contributor",maintainer:"maintainer",translator:"translator",icons:"Icons",dontforget:"and don't forget to take your towel",shortcutsof:"Shortcuts disabled",dropFiles:"Drop files here",or:"or",selectForUpload:"Select files",moveFiles:"Move items",copyFiles:"Copy items",restoreFiles:"Restore items",rmFromPlaces:"Remove from places",aspectRatio:"Aspect ratio",scale:"Scale",width:"Width",height:"Height",resize:"Resize",crop:"Crop",rotate:"Rotate","rotate-cw":"Rotate 90 degrees CW","rotate-ccw":"Rotate 90 degrees CCW",degree:"°",netMountDialogTitle:"Mount network volume",protocol:"Protocol",host:"Host",port:"Port",user:"User",pass:"Password",confirmUnmount:"Are you sure to unmount $1?",dropFilesBrowser:"Drop or Paste files from browser",dropPasteFiles:"Drop files, Paste URLs or images(clipboard) here",encoding:"Encoding",locale:"Locale",searchTarget:"Target: $1",searchMime:"Search by input MIME Type",owner:"Owner",group:"Group",other:"Other",execute:"Execute",perm:"Permission",mode:"Mode",emptyFolder:"Folder is empty",emptyFolderDrop:"Folder is empty\\A Drop to add items",emptyFolderLTap:"Folder is empty\\A Long tap to add items",quality:"Quality",autoSync:"Auto sync",moveUp:"Move up",getLink:"Get URL link",selectedItems:"Selected items ($1)",folderId:"Folder ID",offlineAccess:"Allow offline access",reAuth:"To re-authenticate",nowLoading:"Now loading...",openMulti:"Open multiple files",openMultiConfirm:"You are trying to open the $1 files. Are you sure you want to open in browser?",emptySearch:"Search results is empty in search target.",editingFile:"It is editing a file.",hasSelected:"You have selected $1 items.",hasClipboard:"You have $1 items in the clipboard.",incSearchOnly:"Incremental search is only from the current view.",reinstate:"Reinstate",complete:"$1 complete",contextmenu:"Context menu",pageTurning:"Page turning",volumeRoots:"Volume roots",reset:"Reset",bgcolor:"Background color",colorPicker:"Color picker","8pxgrid":"8px Grid",enabled:"Enabled",disabled:"Disabled",emptyIncSearch:"Search results is empty in current view.\\A Press [Enter] to expand search target.",emptyLetSearch:"First letter search results is empty in current view.",textLabel:"Text label",minsLeft:"$1 mins left",openAsEncoding:"Reopen with selected encoding",saveAsEncoding:"Save with the selected encoding",selectFolder:"Select folder",firstLetterSearch:"First letter search",presets:"Presets",tooManyToTrash:"It's too many items so it can't into trash.",TextArea:"TextArea",folderToEmpty:'Empty the folder "$1".',filderIsEmpty:'There are no items in a folder "$1".',preference:"Preference",language:"Language",clearBrowserData:"Initialize the settings saved in this browser",toolbarPref:"Toolbar settings",charsLeft:"... $1 chars left.",sum:"Sum",roughFileSize:"Rough file size",autoFocusDialog:"Focus on the element of dialog with mouseover",select:"Select",selectAction:"Action when select file",useStoredEditor:"Open with the editor used last time",selectinvert:"Invert selection",renameMultiple:"Are you sure you want to rename $1 selected items like $2?<br/>This cannot be undone!",batchRename:"Batch rename",plusNumber:"+ Number",asPrefix:"Add prefix",asSuffix:"Add suffix",changeExtention:"Change extention",columnPref:"Columns settings (List view)",reflectOnImmediate:"All changes will reflect immediately to the archive.",reflectOnUnmount:"Any changes will not reflect until un-mount this volume.",unmountChildren:"The following volume(s) mounted on this volume also unmounted. Are you sure to unmount it?",selectionInfo:"Selection Info",hashChecker:"Algorithms to show the file hash",infoItems:"Info Items (Selection Info Panel)",pressAgainToExit:"Press again to exit.",toolbar:"Toolbar",workspace:"Work Space",dialog:"Dialog",all:"All",iconSize:"Icon Size (Icons view)",editorMaximized:"Open the maximized editor window",editorConvNoApi:"Because conversion by API is not currently available, please convert on the website.",editorConvNeedUpload:"After conversion, you must be upload with the item URL or a downloaded file to save the converted file.",convertOn:"Convert on the site of $1",integrations:"Integrations",integrationWith:"This elFinder has the following external services integrated. Please check the terms of use, privacy policy, etc. before using it.",showHidden:"Show hidden items",hideHidden:"Hide hidden items",toggleHidden:"Show/Hide hidden items",makefileTypes:'File types to enable with "New file"',typeOfTextfile:"Type of the Text file",add:"Add",kindUnknown:"Unknown",kindRoot:"Volume Root",kindFolder:"Folder",kindSelects:"Selections",kindAlias:"Alias",kindAliasBroken:"Broken alias",kindApp:"Application",kindPostscript:"Postscript document",kindMsOffice:"Microsoft Office document",kindMsWord:"Microsoft Word document",kindMsExcel:"Microsoft Excel document",kindMsPP:"Microsoft Powerpoint presentation",kindOO:"Open Office document",kindAppFlash:"Flash application",kindPDF:"Portable Document Format (PDF)",kindTorrent:"Bittorrent file",kind7z:"7z archive",kindTAR:"TAR archive",kindGZIP:"GZIP archive",kindBZIP:"BZIP archive",kindXZ:"XZ archive",kindZIP:"ZIP archive",kindRAR:"RAR archive",kindJAR:"Java JAR file",kindTTF:"True Type font",kindOTF:"Open Type font",kindRPM:"RPM package",kindText:"Text document",kindTextPlain:"Plain text",kindPHP:"PHP source",kindCSS:"Cascading style sheet",kindHTML:"HTML document",kindJS:"Javascript source",kindRTF:"Rich Text Format",kindC:"C source",kindCHeader:"C header source",kindCPP:"C++ source",kindCPPHeader:"C++ header source",kindShell:"Unix shell script",kindPython:"Python source",kindJava:"Java source",kindRuby:"Ruby source",kindPerl:"Perl script",kindSQL:"SQL source",kindXML:"XML document",kindAWK:"AWK source",kindCSV:"Comma separated values",kindDOCBOOK:"Docbook XML document",kindMarkdown:"Markdown text",kindImage:"Image",kindBMP:"BMP image",kindJPEG:"JPEG image",kindGIF:"GIF Image",kindPNG:"PNG Image",kindTIFF:"TIFF image",kindTGA:"TGA image",kindPSD:"Adobe Photoshop image",kindXBITMAP:"X bitmap image",kindPXM:"Pixelmator image",kindAudio:"Audio media",kindAudioMPEG:"MPEG audio",kindAudioMPEG4:"MPEG-4 audio",kindAudioMIDI:"MIDI audio",kindAudioOGG:"Ogg Vorbis audio",kindAudioWAV:"WAV audio",AudioPlaylist:"MP3 playlist",kindVideo:"Video media",kindVideoDV:"DV movie",kindVideoMPEG:"MPEG movie",kindVideoMPEG4:"MPEG-4 movie",kindVideoAVI:"AVI movie",kindVideoMOV:"Quick Time movie",kindVideoWM:"Windows Media movie",kindVideoFlash:"Flash movie",kindVideoMKV:"Matroska movie",kindVideoOGG:"Ogg movie"}}),e.fn.elfinderbutton=function(t){return this.each(function(){var n,i,a="class",o=t.fm,r=o.res(a,"disabled"),s=o.res(a,"active"),l=o.res(a,"hover"),c="elfinder-button-menu-item",d="elfinder-button-menu-item-selected",p=e('<span class="elfinder-button-text">'+t.title+"</span>"),u="elfinder-button-icon-"+(t.className?t.className:t.name),h=e(this).addClass("ui-state-default elfinder-button").attr("title",t.title).append('<span class="elfinder-button-icon '+u+'"/>',p).on("mouseenter mouseleave",function(e){!h.hasClass(r)&&h["mouseleave"==e.type?"removeClass":"addClass"](l)}).on("click",function(e){h.hasClass(r)||(n&&t.variants.length>=1?(n.is(":hidden")&&o.getUI().click(),e.stopPropagation(),n.css(m()).slideToggle({duration:100,done:function(e){o[n.is(":visible")?"toFront":"toHide"](n)}})):o.exec(t.name,g(),{_userAction:!0,_currentType:"toolbar",_currentNode:h}))}),f=function(){o.toHide(n)},m=function(){var e=o.getUI(),t=o.getUI().offset(),n=e.offset();return{top:n.top-t.top,left:n.left-t.left,maxHeight:e.height()-40}},g=function(){var e,t=o.selected();return t.length||(t=(e=o.cwd())?[o.cwd().hash]:void 0),t};p.hide(),
t.button=h,Array.isArray(t.variants)&&(h.addClass("elfinder-menubutton"),n=e('<div class="ui-front ui-widget ui-widget-content elfinder-button-menu ui-corner-all"/>').hide().appendTo(o.getUI()).on("mouseenter mouseleave","."+c,function(){e(this).toggleClass(l)}).on("click","."+c,function(i){var a=e(this).data("value");i.preventDefault(),i.stopPropagation(),h.removeClass(l),o.toHide(n),"undefined"==typeof a&&(a={}),"object"==typeof a&&(a._userAction=!0),o.exec(t.name,g(),a)}).on("close",f),o.bind("disable select",f).getUI().on("click",f),t.change(function(){n.html(""),e.each(t.variants,function(i,a){n.append(e('<div class="'+c+'">'+a[1]+"</div>").data("value",a[0]).addClass(a[0]==t.value?d:""))})})),t.change(function(){var e;i&&cancelAnimationFrame(i),i=requestAnimationFrame(function(){t.disabled()?h.removeClass(s+" "+l).addClass(r):(h.removeClass(r),h[t.active()?"addClass":"removeClass"](s)),t.syncTitleOnChange&&(e="elfinder-button-icon-"+(t.className?t.className:t.name),u!==e&&(h.children(".elfinder-button-icon").removeClass(u).addClass(e),u=e),p.html(t.title),h.attr("title",t.title))})}).change()})},e.fn.elfindercontextmenu=function(t){return this.each(function(){var n,i,a,o,r,s,l,c=(e(this),"elfinder-contextmenu-item"),d="elfinder-contextsubmenu-item",p="elfinder-contextmenu-extra-icon",u=t.res("class","hover"),h={distance:8,start:function(){f.data("drag",!0).data("touching")&&f.find("."+u).removeClass(u)},stop:function(){f.data("draged",!0).removeData("drag")}},f=e(this).addClass("touch-punch ui-helper-reset ui-front ui-widget ui-state-default ui-corner-all elfinder-contextmenu elfinder-contextmenu-"+t.direction).hide().on("touchstart",function(e){f.data("touching",!0).children().removeClass(u)}).on("touchend",function(e){f.removeData("touching")}).on("mouseenter mouseleave","."+c,function(t){e(this).toggleClass(u,!("mouseenter"!==t.type&&(f.data("draged")||!f.data("submenuKeep")))),f.data("draged")&&f.data("submenuKeep")&&f.find(".elfinder-contextmenu-sub:visible").parent().addClass(u)}).on("mouseenter mouseleave","."+p,function(t){e(this).parent().toggleClass(u,"mouseleave"===t.type)}).on("mouseenter mouseleave","."+c+",."+d,function(t){var n=function(t,n){e.each(n?r:a,function(e,i){if(t[0]===i)return(n?r:a)._cur=e,n?s=t:o=t,!1})};if(t.originalEvent){var i=e(this),l=function(){o&&!o.children("div.elfinder-contextmenu-sub:visible").length&&o.removeClass(u)};"mouseenter"===t.type?i.hasClass(d)?(s&&s.removeClass(u),o&&(r=o.find("div."+d)),n(i,!0)):(l(),n(i)):i.hasClass(d)?(s=null,r=null):(l(),function(e){setTimeout(function(){e===o&&(o=null)},250)}(o))}}).on("contextmenu",function(){return!1}).on("mouseup",function(){setTimeout(function(){f.removeData("draged")},100)}).draggable(h),m="ltr"===t.direction,g=m?"left":"right",v=Object.assign({},t.options.contextmenu),b='<div class="'+c+'{className}"><span class="elfinder-button-icon {icon} elfinder-contextmenu-icon"{style}/><span>{label}</span></div>',y=function(n,i,a,o){var r,s,l="",c="",d="";return o&&(o.className&&(l=" "+o.className),o.iconClass&&(d=o.iconClass,i=""),o.iconImg&&(r=o.iconImg.split(/ +/),s=r[1]&&r[2]?t.escape(r[1]+"px "+r[2]+"px"):"",c=" style=\"background:url('"+t.escape(r[0])+"') "+(s?s:"0 0")+" no-repeat;"+(s?"":"posbackground-size:contain;")+'"')),e(b.replace("{icon}",i?"elfinder-button-icon-"+i:d?d:"").replace("{label}",n).replace("{style}",c).replace("{className}",l)).on("click",function(e){e.stopPropagation(),e.preventDefault(),a()})},w=function(e){var t=e.split(/ +/),n=t[1]&&t[2]?t[1]+"px "+t[2]+"px":"";return{backgroundImage:'url("'+t[0]+'")',backgroundRepeat:"no-repeat",backgroundPosition:n?n:"",backgroundSize:n?"":"contain"}},x=function(){var n="touchstart.contextmenuAutoToggle";f.data("hideTm")&&clearTimeout(f.data("hideTm")),f.is(":visible")&&f.on("touchstart",function(e){e.originalEvent.touches.length>1||(f.stop(),t.toFront(f),f.data("hideTm")&&clearTimeout(f.data("hideTm")))}).data("hideTm",setTimeout(function(){f.is(":visible")&&(i.find(".elfinder-cwd-file").off(n),i.find(".elfinder-cwd-file.ui-selected").one(n,function(t){if(!(t.originalEvent.touches.length>1)){var a=e(t.target);return!f.first().length||a.is("input:checkbox")||a.hasClass("elfinder-cwd-select")?void i.find(".elfinder-cwd-file").off(n):(t.stopPropagation(),C(t.originalEvent.touches[0].pageX,t.originalEvent.touches[0].pageY),i.data("longtap",!0),void a.one("touchend",function(){setTimeout(function(){i.removeData("longtap")},80)}))}}).one("unselect."+t.namespace,function(){i.find(".elfinder-cwd-file").off(n)}),f.fadeOut({duration:300,fail:function(){f.css("opacity","1").show()},done:function(){t.toHide(f)}}))},4500))},k=function(n){var i=n.keyCode,l=e.ui.keyCode.ESCAPE,c=e.ui.keyCode.ENTER,p=e.ui.keyCode.LEFT,h=e.ui.keyCode.RIGHT,f=e.ui.keyCode.UP,m=e.ui.keyCode.DOWN,g="ltr"===t.direction?h:p,v=g===h?p:h;e.inArray(i,[l,c,p,h,f,m])!==-1&&(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),i==l||i===v?o&&r&&s?(s.trigger("mouseleave").trigger("submenuclose"),o.addClass(u),r=null,s=null):i==l&&z():i==f||i==m?r?(s&&s.trigger("mouseleave"),i==m&&(!s||r.length<=++r._cur)?r._cur=0:i==f&&(!s||--r._cur<0)&&(r._cur=r.length-1),s=r.eq(r._cur).trigger("mouseenter")):(r=null,o&&o.trigger("mouseleave"),i==m&&(!o||a.length<=++a._cur)?a._cur=0:i==f&&(!o||--a._cur<0)&&(a._cur=a.length-1),o=a.eq(a._cur).addClass(u)):!o||i!=c&&i!==g||(o.hasClass("elfinder-contextmenu-group")?s?i==c&&s.click():(o.trigger("mouseenter"),r=o.find("div."+d),r._cur=0,s=r.first().addClass(u)):i==c&&o.click()))},C=function(i,a,c){var d,p=f.outerWidth(),u=f.outerHeight(),h=n.attr("style"),m=n.offset(),v=n.width(),b=n.height(),y=t.UA.Mobile?40:2,w=t.UA.Mobile?20:2,i=i-(m?m.left:0),a=a-(m?m.top:0),c=Object.assign(c||{},{top:Math.max(0,a+w+u<b?a+w:a-(a+u-b)),left:Math.max(0,i<p+y||i+y+p<v?i+y:i-y-p),opacity:"1"});l=!0,t.autoSync("stop"),n.width(v),f.stop().removeAttr("style").css(c),t.toFront(f),f.show(),n.attr("style",h),c[g]=parseInt(f.width()),f.find(".elfinder-contextmenu-sub").css(c),t.UA.iOS&&e("div.elfinder div.overflow-scrolling-touch").css("-webkit-overflow-scrolling","auto"),o=null,r=null,s=null,e(document).on("keydown."+t.namespace,k),d=e._data(document).events,d&&d.keydown&&d.keydown.unshift(d.keydown.pop()),t.UA.Mobile&&x(),requestAnimationFrame(function(){t.getUI().one("click."+t.namespace,z)})},z=function(){if(t.getUI().off("click."+t.namespace,z),e(document).off("keydown."+t.namespace,k),I=S=null,f.is(":visible")||f.children().length){t.toHide(f.removeAttr("style").empty().removeData("submenuKeep"));try{f.draggable("instance")||f.draggable(h)}catch(n){f.hasClass("ui-draggable")||f.draggable(h)}f.data("prevNode")&&(f.data("prevNode").after(f),f.removeData("prevNode")),t.trigger("closecontextmenu"),t.UA.iOS&&e("div.elfinder div.overflow-scrolling-touch").css("-webkit-overflow-scrolling","touch")}l&&t.searchStatus.state<1&&!t.searchStatus.ininc&&t.autoSync(),l=!1},T=function(i,o){var r,s=!1,l=!1,h=[],g="cwd"===i,b=0;I=i,S=o,(r=t.option("uiCmdMap",g?void 0:o[0]))||(r={}),g||(h=t.getDisabledCmds(o)),b=t.selected().length,b>1&&f.append('<div class="ui-corner-top ui-widget-header elfinder-contextmenu-header"><span>'+t.i18n("selectedItems",""+b)+"</span></div>"),a=e(),e.each(v[i]||[],function(v,b){var x,k,C,T,A,I;if("|"===b)return void(s&&(l=!0));if(r[b]?(k=r[b],C=!0):k=b,x=t.getCommand(k),!x||g||t.searchStatus.state&&x.disableOnSearch||(x.__disabled=x._disabled,x._disabled=!(x.alwaysEnabled||!!t._commands[k]&&!(e.inArray(b,h)!==-1||C&&h[k])),e.each(x.linkedCmds,function(e,n){var i;(i=t.getCommand(n))&&(i.__disabled=i._disabled,i._disabled=!(i.alwaysEnabled||!!t._commands[n]&&!h[n]))})),x&&!x._disabled&&x.getstate(o)!=-1){if(x.variants){if(!x.variants.length)return;T=y(x.title,x.className?x.className:x.name,function(){},x.contextmenuOpts),A=e('<div class="ui-front ui-corner-all elfinder-contextmenu-sub"/>').hide().css("max-height",t.getUI().height()-30).appendTo(T.append('<span class="elfinder-contextmenu-arrow"/>')),I=function(e){if(e){var i=n.attr("style");n.width(n.width()),A.css({top:"-1000px",left:"auto",right:"auto"});var a,o,r=T.offset(),s=r.left,l=r.top,c=T.outerWidth(),d=A.outerWidth(!0),p=A.outerHeight(!0),u=n.offset(),h=u.left+n.width(),g=u.top+n.height(),v=m,b=c;m?(o=s+c+d-h,o>10&&(s>d-5?(b-=5,v=!1):t.UA.Mobile||(b=c-o))):(o=d-s,o>0&&(s+c+d-15<h?(b-=5,v=!0):t.UA.Mobile||(b=c-o))),o=l+5+p-g,a=o>0&&l<g?5-o:o>0?30-p:5,f.find(".elfinder-contextmenu-sub:visible").hide(),A.css({top:a,left:v?b:"auto",right:v?"auto":b,overflowY:"auto"}).show(),n.attr("style",i)}else A.hide()},T.addClass("elfinder-contextmenu-group").on("mouseleave",".elfinder-contextmenu-sub",function(e){f.data("draged")||f.removeData("submenuKeep")}).on("submenuclose",".elfinder-contextmenu-sub",function(e){I(!1)}).on("click","."+d,function(n){var a,r;n.stopPropagation(),f.data("draged")||(r=e(this),x.keepContextmenu?(r.removeClass(u),T.addClass(u)):f.hide(),a=r.data("exec"),"undefined"==typeof a&&(a={}),"object"==typeof a&&(a._userAction=!0,a._currentType=i,a._currentNode=r),!x.keepContextmenu&&z(),t.exec(x.name,o,a))}).on("touchend",function(e){f.data("drag")||(I(!0),f.data("submenuKeep",!0))}).on("mouseenter mouseleave",function(t){f.data("touching")||(T.data("timer")&&(clearTimeout(T.data("timer")),T.removeData("timer")),e(t.target).closest(".elfinder-contextmenu-sub",f).length||("mouseleave"===t.type?f.data("submenuKeep")||T.data("timer",setTimeout(function(){T.removeData("timer"),I(!1)},250)):T.data("timer",setTimeout(function(){T.removeData("timer"),I(!0)},a.find("div.elfinder-contextmenu-sub:visible").length?250:0))))}),e.each(x.variants,function(t,n){var i,a="|"===n?'<div class="elfinder-contextmenu-separator"/>':e('<div class="'+c+" "+d+'"><span>'+n[1]+"</span></div>").data("exec",n[0]);"undefined"!=typeof n[2]&&(i=e("<span/>").addClass("elfinder-button-icon elfinder-contextmenu-icon"),/\//.test(n[2])?i.css(w(n[2])):i.addClass("elfinder-button-icon-"+n[2]),a.prepend(i).addClass(d+"-icon")),A.append(a)})}else T=y(x.title,x.className?x.className:x.name,function(){f.data("draged")||(!x.keepContextmenu&&z(),t.exec(x.name,o,{_userAction:!0,_currentType:i,_currentNode:T}))},x.contextmenuOpts),x.extra&&x.extra.node?(e('<span class="elfinder-button-icon elfinder-button-icon-'+(x.extra.icon||"")+" "+p+'"/>').append(x.extra.node).appendTo(T),e(x.extra.node).trigger("ready",{targets:o})):T.remove("."+p);x.extendsCmd&&T.children("span.elfinder-button-icon").addClass("elfinder-button-icon-"+x.extendsCmd),l&&f.append('<div class="elfinder-contextmenu-separator"/>'),f.append(T),s=!0,l=!1}x&&"undefined"!=typeof x.__disabled&&(x._disabled=x.__disabled,delete x.__disabled,e.each(x.linkedCmds,function(e,n){var i;(i=t.getCommand(n))&&(i._disabled=i.__disabled,delete i.__disabled)}))}),a=f.children("div."+c)},A=function(t){I="raw",e.each(t,function(e,t){var n;"|"===t?f.append('<div class="elfinder-contextmenu-separator"/>'):t.label&&"function"==typeof t.callback&&(n=y(t.label,t.icon,function(){f.data("draged")||(!t.remain&&z(),t.callback())},t.options||null),f.append(n))}),a=f.children("div."+c)},I=null,S=null;t.one("load",function(){n=t.getUI(),i=t.getUI("cwd"),t.bind("contextmenu",function(n){var a,o=n.data,r={};o.type&&"files"!==o.type&&i.trigger("unselectall"),z(),o.type&&o.targets?(t.trigger("contextmenucreate",o),T(o.type,o.targets),t.trigger("contextmenucreatedone",o)):o.raw&&A(o.raw),f.children().length&&(a=o.prevNode||null,a&&(f.data("prevNode",f.prev()),a.after(f)),o.fitHeight&&(r={maxHeight:Math.min(t.getUI().height(),e(window).height()),overflowY:"auto"},f.draggable("destroy").removeClass("ui-draggable")),C(o.x,o.y,r),o.opened&&"function"==typeof o.opened&&o.opened.call(f))}).one("destroy",function(){f.remove()}).bind("disable",z).bind("select",function(e){"files"===I&&(!e.data||e.data.selected.toString()!==S.toString())&&z()})}).shortcut({pattern:"mac"===t.OS?"ctrl+m":"contextmenu shift+f10",description:"contextmenu",callback:function(n){n.stopPropagation(),n.preventDefault(),e(document).one("contextmenu."+t.namespace,function(e){e.preventDefault(),e.stopPropagation()});var i,a,o,r,s=t.selected();s.length?(i="files",a=s,r=e("#"+t.cwdHash2Id(s[0]))):(i="cwd",a=[t.cwd().hash],o=t.getUI("workzone").offset()),r&&r.length||(r=t.getUI("workzone")),o=r.offset(),o.top+=r.height()/2,o.left+=r.width()/2,t.trigger("contextmenu",{type:i,targets:a,x:o.left,y:o.top})}})})},e.fn.elfindercwd=function(t,n){return this.not(".elfinder-cwd").each(function(){var i,a,o,r,s,l,c=t.UA.Mobile,d="list"==t.viewType,p="select."+t.namespace,u="unselect."+t.namespace,h="disable."+t.namespace,f="enable."+t.namespace,m="class",g=t.res(m,"cwdfile"),v="."+g+(n.oldSchool?":not(.elfinder-cwd-parent)":""),b="ui-selected",y=t.res(m,"disabled"),w=t.res(m,"draggable"),x=t.res(m,"droppable"),k=t.res(m,"hover"),C=t.res(m,"active"),z=t.res(m,"adroppable"),T=g+"-tmp",A="elfinder-cwd-selectchk",I=t.options.loadTmbs>0?t.options.loadTmbs:5,S="",O={},j=[],M=[],F=void 0,D=[],U="",E=function(){for(var e="",t=0;t<D.length;t++)e+='<td class="elfinder-col-'+D[t]+'">{'+D[t]+"}</td>";return e},P=function(){return'<tr id="{id}" class="'+g+' {permsclass} {dirclass}" title="{tooltip}"{css}><td class="elfinder-col-name"><div class="elfinder-cwd-file-wrapper"><span class="elfinder-cwd-icon {mime}"{style}/>{marker}<span class="elfinder-cwd-filename">{name}</span></div>'+R+"</td>"+E()+"</tr>"},R=e.map(n.showSelectCheckboxUA,function(e){return!(!t.UA[e]&&!e.match(/^all$/i))||null}).length?'<div class="elfinder-cwd-select"><input type="checkbox" class="'+A+'"></div>':"",q=!1,H=null,_={icon:'<div id="{id}" class="'+g+' {permsclass} {dirclass} ui-corner-all" title="{tooltip}"><div class="elfinder-cwd-file-wrapper ui-corner-all"><div class="elfinder-cwd-icon {mime} ui-corner-all" unselectable="on"{style}/>{marker}</div><div class="elfinder-cwd-filename" title="{nametitle}">{name}</div>'+R+"</div>",row:""},N=t.res("tpl","perms"),L=t.res("tpl","lock"),W=t.res("tpl","symlink"),B={id:function(e){return t.cwdHash2Id(e.hash)},name:function(e){var n=t.escape(e.i18||e.name);return!d&&(n=n.replace(/([_.])/g,"&#8203;$1")),n},nametitle:function(e){return t.escape(e.i18||e.name)},permsclass:function(e){return t.perms2class(e)},perm:function(e){return t.formatPermissions(e)},dirclass:function(e){var i="directory"==e.mime?"directory":"";return e.isroot&&(i+=" isroot"),e.csscls&&(i+=" "+t.escape(e.csscls)),n.getClass&&(i+=" "+n.getClass(e)),i},style:function(e){return e.icon?t.getIconStyle(e):""},mime:function(e){var n=t.mime2class(e.mime);return e.icon&&(n+=" elfinder-cwd-bgurl"),n},size:function(e){return"directory"!==e.mime||e.size?t.formatSize(e.size):"-"},date:function(e){return t.formatDate(e)},kind:function(e){return t.mime2kind(e)},mode:function(e){return e.perm?t.formatFileMode(e.perm):""},modestr:function(e){return e.perm?t.formatFileMode(e.perm,"string"):""},modeoct:function(e){return e.perm?t.formatFileMode(e.perm,"octal"):""},modeboth:function(e){return e.perm?t.formatFileMode(e.perm,"both"):""},marker:function(e){return(e.alias||"symlink-broken"==e.mime?W:"")+(e.read&&e.write?"":N)+(e.locked?L:"")},tooltip:function(e){var n=t.formatDate(e)+(e.size>0?" ("+t.formatSize(e.size)+")":""),i="";return i=S&&e.path?t.escape(e.path.replace(/\/[^\/]*$/,"")):e.tooltip?t.escape(e.tooltip).replace(/\r/g,"&#13;"):"",d&&(i+=(i?"&#13;":"")+t.escape(e.i18||e.name)),i?i+"&#13;"+n:n}},$={},K=function(n,a){var o,r,s;if(n&&!$[n]&&("undefined"==typeof i&&(e("#elfinderAddBadgeStyle"+t.namespace).length&&e("#elfinderAddBadgeStyle"+t.namespace).remove(),i=e('<style id="addBadgeStyle'+t.namespace+'"/>').insertBefore(e("head").children(":first")).get(0).sheet||null),i)){if(n=n.toLowerCase(),s=n.split("/"),r=t.escape(t.mimeTypes[n]||(a.replace(/.bac?k$/i,"").match(/\.([^.]+)$/)||["",""])[1])){o=".elfinder-cwd-icon-"+s[0].replace(/(\.|\+)/g,"-"),"undefined"!=typeof s[1]&&(o+=".elfinder-cwd-icon-"+s[1].replace(/(\.|\+)/g,"-"));try{i.insertRule(o+':before{content:"'+r.toLowerCase()+'"}',0)}catch(l){}}$[n]=!0}},V=function(e){return e.mime&&"directory"!==e.mime&&!$[e.mime]&&K(e.mime,e.name),_[d?"row":"icon"].replace(/\{([a-z0-9_]+)\}/g,function(n,i){return B[i]?B[i](e,t):e[i]?e[i]:""})},X=e(),G=!1,J=function(t,n){function i(e,t){return e[t+"All"]("[id]:not(."+y+"):not(.elfinder-cwd-parent):first")}var a,o,r,s,l,c=e.ui.keyCode,h=t==c.LEFT||t==c.UP,f=De.find("[id]."+b);if(f.length)if(a=f.filter(h?":first":":last"),r=i(a,h?"prev":"next"),r.length)if(d||t==c.LEFT||t==c.RIGHT)o=r;else if(s=a.position().top,l=a.position().left,o=a,h){do o=o.prev("[id]");while(o.length&&!(o.position().top<s&&o.position().left<=l));o.hasClass(y)&&(o=i(o,"next"))}else{do o=o.next("[id]");while(o.length&&!(o.position().top>s&&o.position().left>=l));o.hasClass(y)&&(o=i(o,"prev")),o.length||(r=De.find("[id]:not(."+y+"):last"),r.position().top>s&&(o=r))}else o=a;else o=X.length?h?X.prev():X:De.find("[id]:not(."+y+"):not(.elfinder-cwd-parent):"+(h?"last":"first"));o&&o.length&&!o.hasClass("elfinder-cwd-parent")&&(a&&n?o=a.add(a[h?"prevUntil":"nextUntil"]("#"+o.attr("id"))).add(o):f.trigger(u),o.trigger(p),oe(o.filter(h?":first":":last")),ae())},Y={},Q=function(n){e("#"+t.cwdHash2Id(n)).trigger(p)},Z=!1,ee=function(){t.cwd().hash;R&&Pe.find("input").prop("checked",!0),t.lazy(function(){var n;De.find("[id]:not(."+b+"):not(.elfinder-cwd-parent)").trigger(p),t.maxTargets&&(F||M).length>t.maxTargets?(n=e.map(F||M,function(e){return t.file(e)||null}),n=n.slice(0,t.maxTargets),Y={},e.each(n,function(e,t){Y[t.hash]=!0}),t.toast({mode:"warning",msg:t.i18n(["errMaxTargets",t.maxTargets])})):Y=t.arrayFlip(F||M,!0),ae(),R&&Pe.data("pending",!1)},0,{repaint:!0})},te=function(e){var t=e||{};R&&Pe.find("input").prop("checked",!1),Object.keys(Y).length&&(G=!1,Y={},De.find("[id]."+b).trigger(u),R&&De.find("input:checkbox."+A).prop("checked",!1)),!t.notrigger&&ae(),R&&Pe.data("pending",!1),De.removeClass("elfinder-cwd-allselected")},ne=function(){var n={};Z?te():Object.keys(Y).length?(e.each(F||M,function(i,a){var o=e("#"+t.cwdHash2Id(a));Y[a]?o.length&&o.trigger(u):(n[a]=!0,o.length&&o.trigger(p))}),Y=n,ae()):ee()},ie=void 0,ae=function(){var e=Object.keys(Y),n={selected:e,origin:"cwd"};Z=e.length&&e.length===(F||M).length&&(!t.maxTargets||e.length<=t.maxTargets),R&&(Pe.find("input").prop("checked",Z),De[Z?"addClass":"removeClass"]("elfinder-cwd-allselected")),Z?n.selectall=!0:e.length||(n.unselectall=!0),t.trigger("select",n)},oe=function(e,n){if(e.length){var i=e.position().top,a=e.outerHeight(!0),o=Ue.scrollTop(),r=Ue.get(0).clientHeight,s=be?be.outerHeight(!0):0;i+s+a>o+r?Ue.scrollTop(parseInt(i+s+a-r)):i<o&&Ue.scrollTop(i),d&&Ue.scrollLeft(0),!!n&&t.resources.blink(e,"lookme")}},re=[],se={},le=function(e){for(var t=re.length;t--;)if(re[t].hash==e)return t;return-1},ce="elfscrstart",de="elfscrstop",pe=!1,ue={disabled:!0,filter:"[id]:first",stop:ae,delay:250,appendTo:"body",autoRefresh:!1,selected:function(t,n){e(n.selected).trigger(p)},unselected:function(t,n){e(n.unselected).trigger(u)}},he={},fe=function(i,a){var o=(d?De.find("tbody:first"):De).children("[id]:first");if(o.length){var r,s,l=De.data("selectable"),c=function(){var i=Ue.offset(),a=e(window),r=o.width()/2*(!d&&n.oldSchool?3:1),s=i.left-a.scrollLeft()+("ltr"===t.direction?r:Ue.width()-r),l=i.top-a.scrollTop()+10+(d?se.itemH*(n.oldSchool?2:1)||(t.UA.Touch?36:24):0);return{left:Math.max(0,Math.round(s)),top:Math.max(0,Math.round(l))}}(),p=i?o:e(document.elementFromPoint(c.left,c.top)),u={},h={},f=5,m=Math.ceil((se.hpi?Math.ceil(_e.data("rectangle").height/se.hpi*1.5):ge)/f),b=function(){var e,n,i;for(i=0;i<f&&(e=p.attr("id"),e&&(se.getTmbs=[],n=t.cwdId2Hash(e),he[n]=e,se.attachTmbs[n]&&(h[n]=se.attachTmbs[n]),l&&(u[e]=!0)),p=p.next(),p.length);i++);},y=function(){var e;De.data("selectable")&&(Object.assign(u,Y),e=Object.keys(u),e.length&&(ue.filter="#"+e.join(", #"),De.selectable("enable").selectable("option",{filter:ue.filter}).selectable("refresh"))),Object.keys(h).length&&(se.getTmbs=[],ze(h))},w=function(){p.hasClass(g)||(p=p.closest(v))};if(he={},l&&De.selectable("option","disabled"),p.length&&(p.hasClass(g)||p.closest(v).length||(s=t.getUI().find(".ui-dialog:visible,.ui-widget:visible"),s.length?(s.hide(),p=e(document.elementFromPoint(c.left,c.top)),s.show()):s=null),w(),p.length||(s&&s.hide(),p=e(document.elementFromPoint(c.left,c.top+5)),s&&s.show(),w())),p.length){if(p.attr("id"))if(i){for(var x=0;x<m&&(b(),p.length);x++);y()}else se.repaintJob&&"pending"===se.repaintJob.state()&&se.repaintJob.reject(),r=new Array(m),se.repaintJob=t.asyncJob(function(){b(),p.length||(y(),se.repaintJob&&"pending"===se.repaintJob.state()&&se.repaintJob.reject())},r).done(y)}else i&&se.renderd&&(a=a||0,a<10&&requestAnimationFrame(function(){fe(i,++a)}))}},me=function(n){var i=t.cwd().phash,a=t.file(i)||null,o=function(n){n&&(He=e(V(e.extend(!0,{},n,{name:"..",i18:"..",mime:"directory"}))).addClass("elfinder-cwd-parent").on("dblclick",function(){var e=t.cwdId2Hash(this.id);t.trigger("select",{selected:[e]}).exec("open",e)}),(d?He.children("td:first"):He).children(".elfinder-cwd-select").remove(),(d?De.find("tbody"):De).prepend(He))};a?o(a):t.getUI("tree").length?t.one("parents",function(){o(t.file(i)||null),Ue.trigger(de)}):t.request({data:{cmd:"parents",target:t.cwd().hash},preventFail:!0}).done(function(e){o(t.file(i)||null),Ue.trigger(de)})},ge=t.options.showFiles,ve=function(){if(!(se.rendering||se.renderd&&!re.length)){var i,a,o=d?De.children("table").children("tbody"):De,r=!!e.htmlPrefilter,s=e(r?document.createDocumentFragment():"<div/>"),l=function(n){var i,a,l,u=n||null,h=[],f=!1,m={},g="self"===t.option("tmbUrl"),v=!se.renderd;i=re.splice(0,ge+(u||0)/(se.hpi||1)),se.renderd+=i.length,re.length||(Ee.hide(),Ue.off(de,ve)),a=[],h=e.map(i,function(e){return e.hash&&e.name?("directory"==e.mime&&(f=!0),(e.tmb&&(1!=e.tmb||e.size>0)||g&&0===e.mime.indexOf("image/"))&&(m[e.hash]=e.tmb||"self"),O[e.hash]&&a.push(e.hash),V(e)):null}),s.empty().append(h.join("")),f&&!c&&Ce(s),l=[],Object.keys(Y).length&&s.find("[id]:not(."+b+"):not(.elfinder-cwd-parent)").each(function(){Y[t.cwdId2Hash(this.id)]&&l.push(e(this))}),o.append(r?s:s.children()),l.length&&(e.each(l,function(e,t){t.trigger(p)}),ae()),a.length&&t.trigger("lockfiles",{files:a}),!se.hpi&&je(o,i.length),d&&(De.find("thead").show(),we({fitWidth:!H})),Object.keys(m).length&&Object.assign(se.attachTmbs,m),v&&(c||De.data("selectable")||De.selectable(ue).data("selectable",!0),fe(!0)),!pe&&Ue.trigger(de)};se.renderd||(se.rendering=!0,Ue.scrollTop(0),i=t.cwd().phash,l(),n.oldSchool&&i&&!S&&me(i),d&&(H&&xe(),we({fitWidth:!0})),se.itemH=(d?o.find("tr:first"):o.find("[id]:first")).outerHeight(!0),t.trigger("cwdrender"),se.rendering=!1),!se.rendering&&re.length?(a=Ue.height()+Ue.scrollTop()+t.options.showThreshold+se.row-se.renderd*se.hpi)>0?(se.rendering=!0,t.lazy(function(){l(a),se.rendering=!1})):!t.enabled()&&qe():qe()}},be=null,ye=t.UA.CSS.positionSticky&&t.UA.CSS.widthMaxContent,we=function(i){if(n.listView.fixedHeader){var a,o,r,s,l,c,d,p,u,h,f,m,g,v=function(){var e,n;n="ltr"===t.direction?"left":"right",e=("ltr"===t.direction?Ue.scrollLeft():r.outerWidth(!0)-Ue.width()-Ue.scrollLeft())*-1,o.css(n)!==e&&o.css(n,e)},b=i||{};if(l=De.find("tbody"),p=l.children("tr:first"),p.length&&p.is(":visible")){if(r=l.parent(),be?(s=e("#"+t.namespace+"-cwd-thead"),d=s.children("tr:first")):(g=!0,l.addClass("elfinder-cwd-fixheader"),s=De.find("thead").attr("id",t.namespace+"-cwd-thead"),d=s.children("tr:first"),c=d.outerHeight(!0),De.css("margin-top",c-parseInt(r.css("padding-top"))),ye?(be=e('<div class="elfinder-table-header-sticky"/>').addClass(De.attr("class")).append(e("<table/>").append(s)),De.after(be),Ue.on("resize.fixheader",function(e){e.stopPropagation(),we({fitWidth:!0})})):(o=e("<div/>").addClass(De.attr("class")).append(e("<table/>").append(s)),be=e("<div/>").addClass(Ue.attr("class")+" elfinder-cwd-fixheader").removeClass("ui-droppable native-droppable").css(Ue.position()).css({height:c,width:De.outerWidth()}).append(o),"rtl"===t.direction&&be.css("left",Ue.data("width")-Ue.width()+"px"),v(),Ue.after(be).on("scroll.fixheader resize.fixheader",function(e){v(),"resize"===e.type&&(e.stopPropagation(),be.css(Ue.position()),Ue.data("width",Ue.css("overflow","hidden").width()),Ue.css("overflow","auto"),we())}))),g||b.fitWidth||Math.abs(p.outerWidth()-d.outerWidth())>2){a=D.length+1;for(var y=0;y<a&&(u=d.children("td:eq("+y+")"),h=p.children("td:eq("+y+")"),f=u.width(),m=h.width(),"undefined"==typeof u.data("delta")&&u.data("delta",u.outerWidth()-f-(h.outerWidth()-m)),m-=u.data("delta"),g||b.fitWidth||f!==m);y++)u.css("width",m+"px")}ye||(be.data("widthTimer")&&cancelAnimationFrame(be.data("widthTimer")),be.data("widthTimer",requestAnimationFrame(function(){be&&(be.css("width",Ne.width()+"px"),"rtl"===t.direction&&be.css("left",Ue.data("width")-Ue.width()+"px"))})))}}},xe=function(){if(d&&H){var t,n="elfinder-cwd-colwidth",i=De.find("tr[id]:first");i.hasClass(n)||(t=De.find("tr."+n),t.removeClass(n).find("td").css("width",""),i.addClass(n),De.find("table:first").css("table-layout","fixed"),e.each(e.merge(["name"],D),function(e,t){var n=H[t]||i.find("td.elfinder-col-"+t).width();i.find("td.elfinder-col-"+t).width(n)}))}},ke=Object.assign({},t.droppable,{over:function(n,i){var a,o,r,s=e(this),l=i.helper,c=n.shiftKey||n.ctrlKey||n.metaKey;return n.stopPropagation(),l.data("dropover",l.data("dropover")+1),s.data("dropover",!0),l.data("namespace")===t.namespace&&t.insideWorkzone(n.pageX,n.pageY)?(s.hasClass(t.res(m,"cwdfile"))?(a=t.cwdId2Hash(s.attr("id")),s.data("dropover",a)):(a=t.cwd().hash,t.cwd().write&&s.data("dropover",a)),r=t.file(l.data("files")[0]).phash===a,s.data("dropover")===a?e.each(l.data("files"),function(e,t){if(t===a||r&&!c&&!l.hasClass("elfinder-drag-helper-plus"))return s.removeClass(z),!1}):s.removeClass(z),l.data("locked")||r?o="elfinder-drag-helper-plus":(o="elfinder-drag-helper-move",c&&(o+=" elfinder-drag-helper-plus")),s.hasClass(z)&&l.addClass(o),void requestAnimationFrame(function(){s.hasClass(z)&&l.addClass(o)})):(s.removeClass(z),void l.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus"))},out:function(t,n){var i=n.helper;t.stopPropagation(),i.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus").data("dropover",Math.max(i.data("dropover")-1,0)),e(this).removeData("dropover").removeClass(z)},deactivate:function(){e(this).removeData("dropover").removeClass(z)},drop:function(e,n){te({notrigger:!0}),t.droppable.drop.call(this,e,n)}}),Ce=function(n){n=n?n:d?De.find("tbody"):De;var i=n.children(".directory:not(."+x+",.elfinder-na,.elfinder-ro)");t.isCommandEnabled("paste")&&i.droppable(ke),t.isCommandEnabled("upload")&&i.addClass("native-droppable"),n.children(".isroot").each(function(n,i){var a=e(i),o=t.cwdId2Hash(i.id);t.isCommandEnabled("paste",o)?a.hasClass(x+",elfinder-na,elfinder-ro")||a.droppable(ke):a.hasClass(x)&&a.droppable("destroy"),t.isCommandEnabled("upload",o)?a.hasClass("native-droppable,elfinder-na,elfinder-ro")||a.addClass("native-droppable"):a.hasClass("native-droppable")&&a.removeClass("native-droppable")})},ze=function(n,i){var a=function(t,n){e("<img/>").on("load",function(){t.find(".elfinder-cwd-icon").addClass(n.className).css("background-image","url('"+n.url+"')")}).attr("src",n.url)},o=function(n,o){var r,s,l=e("#"+t.cwdHash2Id(n));l.length&&("1"!=o?(r=t.file(n),r.tmb!==o&&(r.tmb=o),s=t.tmb(r),i?l.find(".elfinder-cwd-icon").addClass(s.className).css("background-image","url('"+s.url+"')"):a(l,s),delete se.attachTmbs[n]):i?Te([n]):se.tmbLoading[n]||se.getTmbs.push(n))};e.isPlainObject(n)&&Object.keys(n).length&&(Object.assign(se.attachTmbs,n),e.each(n,o),i||!se.getTmbs.length||Object.keys(se.tmbLoading).length||Te())},Te=function(n){var i=[],a=!1;return t.oldAPI?void t.request({data:{cmd:"tmb",current:t.cwd().hash},preventFail:!0}).done(function(e){e.images&&Object.keys(e.images).length&&ze(e.images),e.tmb&&Te()}):(n?(a=!0,i=n.splice(0,I)):i=se.getTmbs.splice(0,I),void(i.length&&(a||he[i[0]]||he[i[i.length-1]])&&(e.each(i,function(e,t){se.tmbLoading[t]=!0}),t.request({data:{cmd:"tmb",targets:i},preventFail:!0}).done(function(t){var o,r=[];t.images&&((o=Object.keys(t.images).length)?(o<i.length&&e.each(i,function(e,n){t.images[n]||r.push(n)}),ze(t.images,a)):r=i,r.length&&e.each(r,function(e,t){delete se.attachTmbs[t]})),a&&n.length&&Te(n)}).always(function(){se.tmbLoading={},!a&&se.getTmbs.length&&Te()}))))},Ae=function(n,i){var a,o,r,s,l,p,u=d?De.find("tbody"):De,h=n.length,f={},m=function(e){for(var n,i=De.find("[id]:first");i.length;){if(n=t.file(t.cwdId2Hash(i.attr("id"))),!i.hasClass("elfinder-cwd-parent")&&n&&t.compare(e,n)<0)return i;i=i.next("[id]")}},g=function(e){var n,i=re.length;for(n=0;n<i;n++)if(t.compare(e,re[n])<0)return n;return i||-1},v=!!e.htmlPrefilter,b=e(v?document.createDocumentFragment():"<div/>");if(h>ge)Fe(),Y=t.arrayFlip(e.map(n,function(e){return e.hash}),!0),ae();else{for(h&&_e.removeClass("elfinder-cwd-wrapper-empty"),p="self"===t.option("tmbUrl");h--;)a=n[h],o=a.hash,e("#"+t.cwdHash2Id(o)).length||((r=m(a))&&!r.length&&(r=null),!r&&(l=g(a))>=0?re.splice(l,0,a):(b.empty().append(V(a)),"directory"===a.mime&&!c&&Ce(b),s=v?b:b.children(),r?r.before(s):u.append(s)),e("#"+t.cwdHash2Id(o)).length&&(a.tmb&&(1!=a.tmb||a.size>0)||p&&0===a.mime.indexOf("image/"))&&(f[o]=a.tmb||"self"));d&&(xe(),we({fitWidth:!H})),je(u),Object.keys(f).length&&Object.assign(se.attachTmbs,f)}},Ie=function(n){var i,a,o,r,s=n.length,l=t.searchStatus.state>1,c=t.getCommand(t.currentReqCmd)||{};if(!t.cwd().hash&&!c.noChangeDirOnRemovedCwd)return e.each(j.reverse(),function(e,n){if(t.file(n))return r=!0,t.one(t.currentReqCmd+"done",function(){!t.cwd().hash&&t.exec("open",n)}),!1}),void(!r&&!t.cwd().hash&&t.exec("open",t.roots[Object.keys(t.roots)[0]]));for(;s--;){if(i=n[s],(a=e("#"+t.cwdHash2Id(i))).length)try{a.remove(),--se.renderd}catch(p){t.debug("error",p)}else(o=le(i))!==-1&&re.splice(o,1);Y[i]&&delete Y[i],l&&(o=e.inArray(i,M))!==-1&&M.splice(o,1)}l&&t.trigger("cwdhasheschange",M),d&&(xe(),we({fitWidth:!H}))},Se=function(){for(var e="",n="",i=0;i<D.length;i++)e=t.getColumnName(D[i]),n+='<td class="elfinder-cwd-view-th-'+D[i]+' sortable-item">'+e+"</td>";return n},Oe=function(e){var t,n;e.height||(t=d?De.find("tbody"):De,n=t.find(d?"tr:first":"[id]:first"),e.height=n.outerHeight(!0),d||(e.width=n.outerWidth(!0)))},je=function(e,n){var i,a=e||(d?De.find("tbody"):De),o=Be[t.viewType],r=1;re.length>0&&(se.hpi?d||(r=Math.floor(a.width()/o.width)):(Oe(o),d?se.row=se.hpi=o.height:(r=Math.floor(a.width()/o.width),se.row=o.height,se.hpi=se.row/r)),i=Math.ceil((re.length+(n||0))/r),d&&be&&++i,Ee.css({top:se.row*i+"px"}).show())},Me={contextmenu:function(e){return e.preventDefault(),void 0!==De.data("longtap")?void e.stopPropagation():void t.trigger("contextmenu",{type:"cwd",targets:[t.cwd().hash],x:e.pageX,y:e.pageY})},touchstart:function(e){e.originalEvent.touches.length>1||(De.data("longtap")!==!1&&(Ue.data("touching",{x:e.originalEvent.touches[0].pageX,y:e.originalEvent.touches[0].pageY}),De.data("tmlongtap",setTimeout(function(){De.data("longtap",!0),t.trigger("contextmenu",{type:"cwd",targets:[t.cwd().hash],x:Ue.data("touching").x,y:Ue.data("touching").y})},500))),De.data("longtap",null))},touchend:function(e){"touchmove"===e.type?(!Ue.data("touching")||Math.abs(Ue.data("touching").x-e.originalEvent.touches[0].pageX)+Math.abs(Ue.data("touching").y-e.originalEvent.touches[0].pageY)>4)&&Ue.data("touching",null):setTimeout(function(){De.removeData("longtap")},80),clearTimeout(De.data("tmlongtap"))},click:function(e){De.data("longtap")&&(e.preventDefault(),e.stopPropagation())}},Fe=function(){t.lazy(function(){var n;_e.append(Pe).removeClass("elfinder-cwd-wrapper-empty elfinder-search-result elfinder-incsearch-result elfinder-letsearch-result"),(t.searchStatus.state>1||t.searchStatus.ininc)&&_e.addClass("elfinder-search-result"+(t.searchStatus.ininc?" elfinder-"+("/"===S.substr(0,1)?"let":"inc")+"search-result":"")),
se.attachThumbJob&&se.attachThumbJob._abort(),De.data("selectable")&&De.selectable("disable").selectable("destroy").removeData("selectable"),t.trigger("cwdinit"),X=e();try{De.empty()}catch(i){De.html("")}be&&(Ue.off("scroll.fixheader resize.fixheader"),be.remove(),be=null),De.removeClass("elfinder-cwd-view-icons elfinder-cwd-view-list").addClass("elfinder-cwd-view-"+(d?"list":"icons")).attr("style","").css("height","auto"),Ee.hide(),Ue[d?"addClass":"removeClass"]("elfinder-cwd-wrapper-list")._padding=parseInt(Ue.css("padding-top"))+parseInt(Ue.css("padding-bottom")),t.UA.iOS&&Ue.removeClass("overflow-scrolling-touch").addClass("overflow-scrolling-touch"),d&&(De.html("<table><thead/><tbody/></table>"),n=e('<tr class="ui-state-default"><td class="elfinder-cwd-view-th-name">'+t.getColumnName("name")+"</td>"+Se()+"</tr>"),De.find("thead").hide().append(n.on("contextmenu."+t.namespace,Me.contextmenu).on("touchstart."+t.namespace,"td",Me.touchstart).on("touchmove."+t.namespace+" touchend."+t.namespace+" mouseup."+t.namespace,"td",Me.touchend).on("click."+t.namespace,"td",Me.click)).find("td:first").append(Pe),e.fn.sortable&&n.addClass("touch-punch touch-punch-keep-default").sortable({axis:"x",distance:8,items:"> .sortable-item",start:function(t,n){e(n.item[0]).data("dragging",!0),n.placeholder.width(n.helper.removeClass("ui-state-hover").width()).removeClass("ui-state-active").addClass("ui-state-hover").css("visibility","visible")},update:function(n,i){var a,o,r=e(i.item[0]).attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","");D=e.map(e(this).children(),function(t){var n=e(t).attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","");return o||(r===n?o=!0:a=n),"name"===n?null:n}),_.row=P(),t.storage("cwdCols",D),a=".elfinder-col-"+a+":first",r=".elfinder-col-"+r+":first",t.lazy(function(){De.find("tbody tr").each(function(){var t=e(this);t.children(a).after(t.children(r))})})},stop:function(t,n){setTimeout(function(){e(n.item[0]).removeData("dragging")},100)}}),n.find("td").addClass("touch-punch").resizable({handles:"ltr"===t.direction?"e":"w",start:function(t,n){var i=De.find("td.elfinder-col-"+n.element.attr("class").split(" ")[0].replace("elfinder-cwd-view-th-","")+":first");n.element.data("dragging",!0).data("resizeTarget",i).data("targetWidth",i.width()),q=!0,"fixed"!==De.find("table").css("table-layout")&&(De.find("tbody tr:first td").each(function(){e(this).width(e(this).width())}),De.find("table").css("table-layout","fixed"))},resize:function(e,t){t.element.data("resizeTarget").width(t.element.data("targetWidth")-(t.originalSize.width-t.size.width))},stop:function(n,i){q=!1,we({fitWidth:!0}),H={},De.find("tbody tr:first td").each(function(){var t=e(this).attr("class").split(" ")[0].replace("elfinder-col-","");H[t]=e(this).width()}),t.storage("cwdColWidth",H),setTimeout(function(){i.element.removeData("dragging")},100)}}).find(".ui-resizable-handle").addClass("ui-icon ui-icon-grip-dotted-vertical")),re=e.map(F||M,function(e){return t.file(e)||null}),re=t.sortFiles(re),F?F=e.map(re,function(e){return e.hash}):M=e.map(re,function(e){return e.hash}),se={renderd:0,attachTmbs:{},getTmbs:[],tmbLoading:{},lazyOpts:{tm:0}},_e[re.length<1?"addClass":"removeClass"]("elfinder-cwd-wrapper-empty"),Ue.off(de,ve).on(de,ve).trigger(de),t.cwd().write?(Ue[t.isCommandEnabled("upload")?"addClass":"removeClass"]("native-droppable"),Ue.droppable(t.isCommandEnabled("paste")?"enable":"disable")):Ue.removeClass("native-droppable").droppable("disable").removeClass("ui-state-disabled")})},De=e(this).addClass("ui-helper-clearfix elfinder-cwd").attr("unselectable","on").on("click."+t.namespace,v,function(n){var i,a,o,r,s,l=this.id?e(this):e(this).parents("[id]:first"),c=e(n.target);if(R&&(c.is("input:checkbox."+A)||c.hasClass("elfinder-cwd-select")))return n.stopPropagation(),n.preventDefault(),l.trigger(l.hasClass(b)?u:p),ae(),void requestAnimationFrame(function(){c.prop("checked",l.hasClass(b))});if(De.data("longtap")||c.hasClass("elfinder-cwd-nonselect"))return void n.stopPropagation();if(U||(U=l.attr("id"),setTimeout(function(){U=""},500)),n.shiftKey&&(i=l.prevAll(ie||"."+b+":first"),a=l.nextAll(ie||"."+b+":first"),o=i.length,r=a.length),n.shiftKey&&(o||r))s=o?l.prevUntil("#"+i.attr("id")):l.nextUntil("#"+a.attr("id")),s.add(l).trigger(p);else if(n.ctrlKey||n.metaKey)l.trigger(l.hasClass(b)?u:p);else{if(Ue.data("touching")&&l.hasClass(b))return Ue.data("touching",null),void t.dblclick({file:t.cwdId2Hash(this.id)});te({notrigger:!0}),l.trigger(p)}ae()}).on("dblclick."+t.namespace,v,function(n){if(U){var i=t.cwdId2Hash(U);n.stopPropagation(),this.id!==U&&(e(this).trigger(u),e("#"+U).trigger(p),ae()),t.dblclick({file:i})}}).on("touchstart."+t.namespace,v,function(n){if(!(n.originalEvent.touches.length>1)){var i,a=this.id?e(this):e(this).parents("[id]:first"),o=e(n.target),r=n.target.nodeName;if("INPUT"===r&&"text"===n.target.type||"TEXTAREA"===r)return void n.stopPropagation();if(a.find("input:text,textarea").length)return n.stopPropagation(),void n.preventDefault();Ue.data("touching",{x:n.originalEvent.touches[0].pageX,y:n.originalEvent.touches[0].pageY}),R&&(o.is("input:checkbox."+A)||o.hasClass("elfinder-cwd-select"))||(i=a.prevAll("."+b+":first").length+a.nextAll("."+b+":first").length,De.data("longtap",null),(Object.keys(Y).length||d&&"TD"!==n.target.nodeName||!d&&this!==n.target)&&(De.data("longtap",!1),a.addClass(k),a.data("tmlongtap",setTimeout(function(){De.data("longtap",!0),a.trigger(p),ae(),t.trigger("contextmenu",{type:"files",targets:t.selected(),x:n.originalEvent.touches[0].pageX,y:n.originalEvent.touches[0].pageY})},500))))}}).on("touchmove."+t.namespace+" touchend."+t.namespace,v,function(n){var i,a=e(n.target);if(!R||!a.is("input:checkbox."+A)&&!a.hasClass("elfinder-cwd-select")){if("INPUT"==n.target.nodeName||"TEXTAREA"==n.target.nodeName)return void n.stopPropagation();i=this.id?e(this):e(this).parents("[id]:first"),clearTimeout(i.data("tmlongtap")),"touchmove"===n.type?(Ue.data("touching",null),i.removeClass(k)):(Ue.data("touching")&&!De.data("longtap")&&i.hasClass(b)&&(n.preventDefault(),Ue.data("touching",null),t.dblclick({file:t.cwdId2Hash(this.id)})),setTimeout(function(){De.removeData("longtap")},80))}}).on("mouseenter."+t.namespace,v,function(n){if(!pe){var i=e(this),a=null;if(!(c||i.data("dragRegisted")||i.hasClass(T)||i.hasClass(w)||i.hasClass(y))){if(i.data("dragRegisted",!0),!t.isCommandEnabled("copy",t.searchStatus.state>1?t.cwdId2Hash(i.attr("id")):void 0))return;i.on("mousedown",function(n){var a=n.shiftKey||n.altKey,o=!1;a&&!t.UA.IE&&De.data("selectable")&&(De.selectable("disable").selectable("destroy").removeData("selectable"),requestAnimationFrame(function(){De.selectable(ue).selectable("option",{disabled:!1}).selectable("refresh").data("selectable",!0)})),i.removeClass("ui-state-disabled"),a?i.draggable("option","disabled",!0).attr("draggable","true"):(i.hasClass(b)||(o=d?e(n.target).closest("span,tr").is("tr"):e(n.target).hasClass("elfinder-cwd-file")),o?i.draggable("option","disabled",!0):i.draggable("option","disabled",!1).removeAttr("draggable").draggable("option","cursorAt",{left:50-parseInt(e(n.currentTarget).css("margin-left")),top:47}))}).on("dragstart",function(n){var i=n.dataTransfer||n.originalEvent.dataTransfer||null;if(a=null,i&&!t.UA.IE){var o,r=this.id?e(this):e(this).parents("[id]:first"),s=e("<span>"),l="",c=null,d=null,u=[],h=function(n){var i,a=n.mime,o=t.tmb(n);return i='<div class="elfinder-cwd-icon elfinder-cwd-icon-drag '+t.mime2class(a)+' ui-corner-all"/>',o&&(i=e(i).addClass(o.className).css("background-image","url('"+o.url+"')").get(0).outerHTML),i},f=[];if(r.trigger(p),ae(),e.each(Y,function(n){var i=t.file(n),a=i.url;if(i&&"directory"!==i.mime){if(a){if("1"==a)return f.push(n),!0}else a=t.url(i.hash);a&&(a=t.convAbsUrl(a),u.push(n),e("<a>").attr("href",a).text(a).appendTo(s),l+=a+"\n",c||(c=i.mime+":"+i.name+":"+a),d||(d=a+"\n"+i.name))}}),f.length)return e.each(f,function(e,n){var i=t.file(n);i.url="",t.request({data:{cmd:"url",target:n},notify:{type:"url",cnt:1},preventDefault:!0}).always(function(e){i.url=e.url?e.url:"1"})}),!1;if(!l)return!1;i.setDragImage&&(a=e('<div class="elfinder-drag-helper html5-native"></div>').append(h(t.file(u[0]))).appendTo(e(document.body)),(o=u.length)>1&&a.append(h(t.file(u[o-1]))+'<span class="elfinder-drag-num">'+o+"</span>"),i.setDragImage(a.get(0),50,47)),i.effectAllowed="copyLink",i.setData("DownloadURL",c),i.setData("text/x-moz-url",d),i.setData("text/uri-list",l),i.setData("text/plain",l),i.setData("text/html",s.html()),i.setData("elfinderfrom",window.location.href+t.cwd().hash),i.setData("elfinderfrom:"+i.getData("elfinderfrom"),"")}}).on("dragend",function(e){te({notrigger:!0}),a&&a.remove()}).draggable(t.draggable)}}}).on(p,v,function(n){var i=e(this),a=t.cwdId2Hash(i.attr("id"));G||i.hasClass(y)||(ie="#"+this.id,i.addClass(b).children().addClass(k).find("input:checkbox."+A).prop("checked",!0),Y[a]||(Y[a]=!0),X=De.find("[id]."+b+":last").next())}).on(u,v,function(n){var i=e(this),a=t.cwdId2Hash(i.attr("id"));G||(i.removeClass(b).children().removeClass(k).find("input:checkbox."+A).prop("checked",!1),De.hasClass("elfinder-cwd-allselected")&&(R&&Pe.children("input").prop("checked",!1),De.removeClass("elfinder-cwd-allselected")),Y[a]&&delete Y[a])}).on(h,v,function(){var t=e(this).removeClass(k+" "+b).addClass(y),n=t.children(),i=d?t:n.find("div.elfinder-cwd-file-wrapper,div.elfinder-cwd-filename");n.removeClass(k+" "+b),t.hasClass(x)&&t.droppable("disable"),i.hasClass(w)&&i.draggable("disable")}).on(f,v,function(){var t=e(this).removeClass(y),n=d?t:t.children("div.elfinder-cwd-file-wrapper,div.elfinder-cwd-filename");t.hasClass(x)&&t.droppable("enable"),n.hasClass(w)&&n.draggable("enable")}).on("scrolltoview",v,function(t,n){oe(e(this),!n||"undefined"==typeof n.blink||n.blink)}).on("mouseenter."+t.namespace+" mouseleave."+t.namespace,v,function(n){var i="mouseenter"===n.type;i&&(pe||t.UA.Mobile)||(t.trigger("hover",{hash:t.cwdId2Hash(e(this).attr("id")),type:n.type}),e(this).toggleClass(k,"mouseenter"==n.type))}).on("mouseenter."+t.namespace+" mouseleave."+t.namespace,".elfinder-cwd-file-wrapper,.elfinder-cwd-filename",function(t){var n="mouseenter"===t.type;n&&pe||e(this).closest(v).children(".elfinder-cwd-file-wrapper,.elfinder-cwd-filename").toggleClass(C,"mouseenter"==t.type)}).on("contextmenu."+t.namespace,function(n){var i=e(n.target).closest(v);if(i.get(0)!==n.target||Y[t.cwdId2Hash(i.get(0).id)])return i.find("input:text,textarea").length?void n.stopPropagation():void(i.length&&("TD"!=n.target.nodeName||Y[t.cwdId2Hash(i.get(0).id)])&&(n.stopPropagation(),n.preventDefault(),i.hasClass(y)||Ue.data("touching")||(i.hasClass(b)||(te({notrigger:!0}),i.trigger(p),ae()),t.trigger("contextmenu",{type:"files",targets:t.selected(),x:n.pageX,y:n.pageY}))))}).on("click."+t.namespace,function(e){e.target!==this||De.data("longtap")||!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&te()}).on("create."+t.namespace,function(n,i){var a=d?De.find("tbody"):De,o=a.find(".elfinder-cwd-parent"),r=i.move||!1,s=e(V(i)).addClass(T),l=t.selected();l.length?r&&t.trigger("lockfiles",{files:l}):te(),o.length?o.after(s):a.prepend(s),xe(),Ue.scrollTop(0).scrollLeft(0)}).on("unselectall",te).on("selectfile",function(n,i){e("#"+t.cwdHash2Id(i)).trigger(p),ae()}).on("colwidth",function(){d&&(De.find("table").css("table-layout","").find("td").css("width",""),we({fitWidth:!0}),t.storage("cwdColWidth",H=null))}).on("iconpref",function(e,t){De.removeClass(function(e,t){return(t.match(/\belfinder-cwd-size\S+/g)||[]).join(" ")}),r=t?parseInt(t.size)||0:0,d||(r>0&&De.addClass("elfinder-cwd-size"+r),se.renderd&&requestAnimationFrame(function(){Be.icons={},se.hpi=null,je(De,se.renderd),fe()}))}).on("onwheel"in document?"wheel":"mousewheel",function(e){var i,a,o;!d&&(e.ctrlKey&&!e.metaKey||!e.ctrlKey&&e.metaKey)&&(e.stopPropagation(),e.preventDefault(),i=De.data("wheelTm"),"undefined"!=typeof i?(clearTimeout(i),De.data("wheelTm",setTimeout(function(){De.removeData("wheelTm")},200))):(De.data("wheelTm",!1),a=r||0,o=e.originalEvent.deltaY?e.originalEvent.deltaY:-e.originalEvent.wheelDelta,o>0?r>0&&(a=r-1):r<n.iconsView.sizeMax&&(a=r+1),a!==r&&(t.storage("iconsize",a),De.trigger("iconpref",{size:a}))))}),Ue=e('<div class="elfinder-cwd-wrapper"/>').droppable(Object.assign({},ke,{autoDisable:!1})).on("contextmenu."+t.namespace,Me.contextmenu).on("touchstart."+t.namespace,Me.touchstart).on("touchmove."+t.namespace+" touchend."+t.namespace,Me.touchend).on("click."+t.namespace,Me.click).on("scroll."+t.namespace,function(){pe||(De.data("selectable")&&De.selectable("disable"),Ue.trigger(ce)),pe=!0,se.scrtm&&cancelAnimationFrame(se.scrtm),se.scrtm&&Math.abs((se.scrolltop||0)-(se.scrolltop=this.scrollTop||e(this).scrollTop()))<5&&(se.scrtm=0,Ue.trigger(de)),se.scrtm=requestAnimationFrame(function(){se.scrtm=0,Ue.trigger(de)})}).on(de,function(){pe=!1,fe()}),Ee=e("<div>&nbsp;</div>").css({position:"absolute",width:"1px",height:"1px"}).hide(),Pe=R?e('<div class="elfinder-cwd-selectall"><input type="checkbox"/></div>').attr("title",t.i18n("selectall")).on("touchstart mousedown click",function(t){return t.stopPropagation(),t.preventDefault(),!e(this).data("pending")&&"click"!==t.type&&(Pe.data("pending",!0),void(De.hasClass("elfinder-cwd-allselected")?(Pe.find("input").prop("checked",!1),requestAnimationFrame(function(){te()})):ee()))}):e(),Re=null,qe=function(t){var n=function(){var t=0;Ue.siblings("div.elfinder-panel:visible").each(function(){t+=e(this).outerHeight(!0)}),Ue.height(_e.height()-t-Ue._padding)};t&&n(),Re&&cancelAnimationFrame(Re),Re=requestAnimationFrame(function(){!t&&n();var e,i;De.css("height","auto"),e=Ue[0].clientHeight-parseInt(Ue.css("padding-top"))-parseInt(Ue.css("padding-bottom"))-parseInt(De.css("margin-top")),i=De.outerHeight(!0),i<e&&De.height(e)}),d&&!q&&(t?Ue.trigger("resize.fixheader"):we()),fe()},He=e(this).parent().on("resize",qe),_e=He.children(".elfinder-workzone").append(Ue.append(this).append(Ee)),Ne=e('<div class="elfinder-cwd-message-board"/>').insertAfter(De),Le=e('<div class="elfinder-cwd-expires" />'),We=function(){var e,n,i;a&&clearTimeout(a),s&&t.volumeExpires[s]&&(n=t.volumeExpires[s]-+new Date/1e3,i=n%60+.1,e=Math.floor(n/60),Le.html(t.i18n(["minsLeft",e])).show(),e&&(a=setTimeout(We,1e3*i)))},Be={icons:{},list:{}};t.UA.ltIE10||Ne.append(e('<div class="elfinder-cwd-trash" />').html(t.i18n("volume_Trash"))).append(Le),B=Object.assign(B,n.replacement||{});try{H=t.storage("cwdColWidth")?t.storage("cwdColWidth"):null}catch($e){H=null}t.bind("columnpref",function(i){var a=i.data||{};(D=t.storage("cwdCols"))?(D=e.grep(D,function(e){return n.listView.columns.indexOf(e)!==-1}),n.listView.columns.length>D.length&&e.each(n.listView.columns,function(e,t){D.indexOf(t)===-1&&D.push(t)})):D=n.listView.columns;var o=t.storage("columnhides")||null;o&&Object.keys(o).length&&(D=e.grep(D,function(e){return!o[e]})),_.row=P(),d&&a.repaint&&Fe()}).trigger("columnpref"),c&&e("body").on("touchstart touchmove touchend",function(e){}),R&&De.addClass("elfinder-has-checkbox"),e(window).on("scroll."+t.namespace,function(){l&&cancelAnimationFrame(l),l=requestAnimationFrame(function(){Ue.trigger(de)})}),e(document).on("keydown."+t.namespace,function(n){n.keyCode==e.ui.keyCode.ESCAPE&&(t.getUI().find(".ui-widget:visible").length||te())}),t.one("init",function(){var n,i,a,r,s=document.createElement("style"),l=0;document.head&&(document.head.appendChild(s),n=s.sheet,n.insertRule('.elfinder-cwd-wrapper-empty .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyFolder")+'" }',l++),n.insertRule('.elfinder-cwd-wrapper-empty .native-droppable .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyFolder"+(c?"LTap":"Drop"))+'" }',l++),n.insertRule('.elfinder-cwd-wrapper-empty .ui-droppable-disabled .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyFolder")+'" }',l++),n.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptySearch")+'" }',l++),n.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result.elfinder-incsearch-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyIncSearch")+'" }',l++),n.insertRule('.elfinder-cwd-wrapper-empty.elfinder-search-result.elfinder-letsearch-result .elfinder-cwd:not(.elfinder-table-header-sticky):after{ content:"'+t.i18n("emptyLetSearch")+'" }',l++)),(r=t.storage("iconsize")||0)&&De.trigger("iconpref",{size:r}),c||(t.one("open",function(){n&&t.zIndex&&n.insertRule(".ui-selectable-helper{z-index:"+t.zIndex+";}",l++)}),a=e('<div style="position:absolute"/>'),i=t.getUI(),i.on("resize",function(e,t){var n;e.preventDefault(),e.stopPropagation(),t&&t.fullscreen&&(n=i.offset(),"on"===t.fullscreen?(a.css({top:n.top*-1,left:n.left*-1}).appendTo(i),ue.appendTo=a):(a.detach(),ue.appendTo="body"),De.data("selectable")&&De.selectable("option",{appendTo:ue.appendTo}))})),o=t.getUI("tree").length}).bind("enable",function(){qe()}).bind("request.open",function(){se.getTmbs=[]}).bind("open add remove searchend",function(){var n=t.cwd().hash,i=this.type;if(("open"===i||"searchend"===i||t.searchStatus.state<2)&&(M=e.map(t.files(n),function(e){return e.hash}),t.trigger("cwdhasheschange",M)),"open"===i){var a=function(){var n=!1;return e.each(j,function(e,i){if(t.trashes[i])return n=!0,!1}),n},r=n&&(!t.file(n)||o)?o?function(){var n=e.Deferred();return t.one("treesync",function(e){e.data.always(function(){n.resolve()})}),n}():t.request({data:{cmd:"parents",target:t.cwd().hash},preventFail:!0}):null,l=t.cwd();l.volumeid!==s&&(Le.empty().hide(),s&&Ue.removeClass("elfinder-cwd-wrapper-"+s),s=l.volumeid,We(),Ue.addClass("elfinder-cwd-wrapper-"+s)),e.when(r).done(function(){j=t.parents(l.hash),Ue[a()?"addClass":"removeClass"]("elfinder-cwd-wrapper-trash")}),F=void 0,te({notrigger:!0}),Fe()}}).bind("search",function(n){M=e.map(n.data.files,function(e){return e.hash}),t.trigger("cwdhasheschange",M),F=void 0,t.searchStatus.ininc=!1,Fe(),t.autoSync("stop")}).bind("searchend",function(e){(S||F)&&(S="",F?t.trigger("incsearchend",e.data):e.data&&e.data.noupdate||Fe()),t.autoSync()}).bind("searchstart",function(e){te(),S=e.data.query}).bind("incsearchstart",function(n){Y={},t.lazy(function(){var i,a,o="";a=S=n.data.query||"",a?("/"===a.substr(0,1)&&(a=a.substr(1),o="^"),i=new RegExp(o+a.replace(/([\\*\;\.\?\[\]\{\}\(\)\^\$\-\|])/g,"\\$1"),"i"),F=e.grep(M,function(e){var n=t.file(e);return!(!n||!(n.name.match(i)||n.i18&&n.i18.match(i)))}),t.trigger("incsearch",{hashes:F,query:a}).searchStatus.ininc=!0,Fe(),t.autoSync("stop")):t.trigger("incsearchend")})}).bind("incsearchend",function(e){S="",t.searchStatus.ininc=!1,F=void 0,e.data&&e.data.noupdate||Fe(),t.autoSync()}).bind("sortchange",function(){var e=Ue.scrollLeft(),n=De.hasClass("elfinder-cwd-allselected");Fe(),t.one("cwdrender",function(){Ue.scrollLeft(e),n&&(Y=t.arrayFlip(F||M,!0)),(n||Object.keys(Y).length)&&ae()})}).bind("viewchange",function(){var e="list"==t.storage("view"),n=De.hasClass("elfinder-cwd-allselected");e!=d&&(d=e,t.viewType=d?"list":"icons",r&&t.one("cwdinit",function(){De.trigger("iconpref",{size:r})}),Fe(),n&&(De.addClass("elfinder-cwd-allselected"),Pe.find("input").prop("checked",!0)),Object.keys(Y).length&&ae())}).bind("wzresize",function(){var e,n=d?De.find("tbody"):De;qe(!0),se.hpi&&je(n,n.find("[id]").length),e=De.offset(),_e.data("rectangle",Object.assign({width:_e.width(),height:_e.height(),cwdEdge:"ltr"===t.direction?e.left:e.left+De.width()},_e.offset())),se.itemH=(d?n.find("tr:first"):n.find("[id]:first")).outerHeight(!0)}).bind("changeclipboard",function(t){O={},t.data&&t.data.clipboard&&t.data.clipboard.length&&e.each(t.data.clipboard,function(e,t){t.cut&&(O[t.hash]=!0)})}).bind("resMixinMake",function(){xe()}).bind("tmbreload",function(t){var n={},i=t.data&&t.data.files?t.data.files:null;e.each(i,function(e,t){t.tmb&&"1"!=t.tmb&&(n[t.hash]=t.tmb)}),Object.keys(n).length&&ze(n,!0)}).add(function(n){var i=S?new RegExp(S.replace(/([\\*\;\.\?\[\]\{\}\(\)\^\$\-\|])/g,"\\$1"),"i"):null,a=t.searchStatus.mime,o=t.searchStatus.state>1,r=o&&t.searchStatus.target?t.searchStatus.target:t.cwd().hash,s=t.path(r),l=function(n){var l,c;return l=n.phash===r,!l&&o&&(c=n.path||t.path(n.hash),l=s&&0===c.indexOf(s),!l&&t.searchStatus.mixed&&(l=!!e.grep(t.searchStatus.mixed,function(e){return 0===n.hash.indexOf(e)}).length)),l&&o&&(l=a?0===n.mime.indexOf(a):!!(n.name.match(i)||n.i18&&n.i18.match(i))),l},c=e.grep(n.data.added||[],function(e){return!!l(e)});Ae(c),2===t.searchStatus.state&&(e.each(c,function(t,n){e.inArray(n.hash,M)===-1&&M.push(n.hash)}),t.trigger("cwdhasheschange",M)),d&&qe(),Ue.trigger(de)}).change(function(n){var i,a=t.cwd().hash,o=t.selected();S?e.each(n.data.changed||[],function(n,a){e("#"+t.cwdHash2Id(a.hash)).length&&(Ie([a.hash]),Ae([a],"change"),e.inArray(a.hash,o)!==-1&&Q(a.hash),i=!0)}):e.each(e.grep(n.data.changed||[],function(e){return e.phash==a}),function(n,a){e("#"+t.cwdHash2Id(a.hash)).length&&(Ie([a.hash]),Ae([a],"change"),e.inArray(a.hash,o)!==-1&&Q(a.hash),i=!0)}),i&&(t.trigger("cwdhasheschange",M),d&&qe(),Ue.trigger(de)),ae()}).remove(function(e){var t=d?De.find("tbody"):De;Ie(e.data.removed||[]),ae(),re.length<1&&t.children(v).length<1?(_e.addClass("elfinder-cwd-wrapper-empty"),R&&Pe.find("input").prop("checked",!1),Ee.hide(),Ue.off(de,ve),qe()):(je(t),Ue.trigger(de))}).dragstart(function(t){var n=e(t.data.target),i=t.data.originalEvent;n.hasClass(g)&&(n.hasClass(b)||(!(i.ctrlKey||i.metaKey||i.shiftKey)&&te({notrigger:!0}),n.trigger(p),ae())),De.removeClass(y).data("selectable")&&De.selectable("disable"),G=!0}).dragstop(function(){De.data("selectable")&&De.selectable("enable"),G=!1}).bind("lockfiles unlockfiles selectfiles unselectfiles",function(n){var i,a,o,r={lockfiles:h,unlockfiles:f,selectfiles:p,unselectfiles:u},s=r[n.type],l=n.data.files||[],c=l.length,d=n.data.helper||e();if(c>0&&(i=t.parents(l[0])),s!==p&&s!==u||(o=s===p,e.each(l,function(e,t){var n=De.hasClass("elfinder-cwd-allselected");Y[t]?(n&&(R&&Pe.children("input").prop("checked",!1),De.removeClass("elfinder-cwd-allselected"),n=!1),!o&&delete Y[t]):o&&(Y[t]=!0)})),!d.data("locked")){for(;c--;)try{e("#"+t.cwdHash2Id(l[c])).trigger(s)}catch(n){}!n.data.inselect&&ae()}Ue.data("dropover")&&i.indexOf(Ue.data("dropover"))!==-1&&(a="lockfiles"!==n.type,d.toggleClass("elfinder-drag-helper-plus",a),Ue.toggleClass(z,a))}).bind("mkdir mkfile duplicate upload rename archive extract paste multiupload",function(n){if("upload"!=n.type||!n.data._multiupload){var i=t.cwd().hash;te({notrigger:!0}),e.each((n.data.added||[]).concat(n.data.changed||[]),function(e,t){t&&t.phash==i&&Q(t.hash)}),ae()}}).shortcut({pattern:"ctrl+a",description:"selectall",callback:ee}).shortcut({pattern:"ctrl+shift+i",description:"selectinvert",callback:ne}).shortcut({pattern:"left right up down shift+left shift+right shift+up shift+down",description:"selectfiles",type:"keydown",callback:function(e){J(e.keyCode,e.shiftKey)}}).shortcut({pattern:"home",description:"selectffile",callback:function(e){te({notrigger:!0}),oe(De.find("[id]:first").trigger(p)),ae()}}).shortcut({pattern:"end",description:"selectlfile",callback:function(e){te({notrigger:!0}),oe(De.find("[id]:last").trigger(p)),ae()}}).shortcut({pattern:"page_up",description:"pageTurning",callback:function(e){se.itemH&&Ue.scrollTop(Math.round(Ue.scrollTop()-Math.floor((Ue.height()+(d?se.itemH*-1:16))/se.itemH)*se.itemH))}}).shortcut({pattern:"page_down",description:"pageTurning",callback:function(e){se.itemH&&Ue.scrollTop(Math.round(Ue.scrollTop()+Math.floor((Ue.height()+(d?se.itemH*-1:16))/se.itemH)*se.itemH))}})}),this},e.fn.elfinderdialog=function(t,n){var i,a,o,r,s=window.navigator.platform.indexOf("Win")!=-1,l={},c={enabled:!1,width:!1,height:!1,defaultSize:null},d=function(t){var i,a;c.enabled&&(a=n.options.dialogContained?o:e(window),i={maxWidth:c.width?a.width()-l.width:null,maxHeight:c.height?a.height()-l.height:null},Object.assign(r,i),t.css(i).trigger("resize"),t.data("hasResizable")&&(t.resizable("option","maxWidth")<i.maxWidth||t.resizable("option","maxHeight")<i.maxHeight)&&t.resizable("option",i))},p=function(e){var t=e.data;i&&cancelAnimationFrame(i),i=requestAnimationFrame(function(){c.enabled&&d(t)})},u=function(){var e="elfinder-dialog",t=o.children("."+e+"."+n.res("class","editing")+":visible");n[t.length?"disable":"enable"]()},h={};return n&&n.ui?o=n.getUI():(o=this.closest(".elfinder"),n||(n=o.elfinder("instance"))),"string"==typeof t?((a=this.closest(".ui-dialog")).length&&("open"===t?"none"===a.css("display")&&(a.trigger("posinit").show().trigger("open").hide(),a.fadeIn(120,function(){n.trigger("dialogopened",{dialog:a})})):"close"===t||"destroy"===t?(a.stop(!0),(a.is(":visible")||o.is(":hidden"))&&(a.trigger("close"),n.trigger("dialogclosed",{dialog:a})),"destroy"===t&&(a.remove(),n.trigger("dialogremoved",{dialog:a}))):"toTop"===t?(a.trigger("totop"),n.trigger("dialogtotoped",{dialog:a})):"posInit"===t?(a.trigger("posinit"),n.trigger("dialogposinited",{dialog:a})):"tabstopsInit"===t?(a.trigger("tabstopsInit"),n.trigger("dialogtabstopsinited",{dialog:a})):"checkEditing"===t&&u()),this):(t=Object.assign({},e.fn.elfinderdialog.defaults,t),t.allowMinimize&&"auto"===t.allowMinimize&&(t.allowMinimize=!!this.find("textarea,input").length),t.openMaximized=t.allowMinimize&&t.openMaximized,t.headerBtnPos&&"auto"===t.headerBtnPos&&(t.headerBtnPos=s?"right":"left"),t.headerBtnOrder&&"auto"===t.headerBtnOrder&&(t.headerBtnOrder=s?"close:maximize:minimize":"close:minimize:maximize"),t.modal&&t.allowMinimize&&(t.allowMinimize=!1),n.options.dialogContained?c.width=c.height=c.enabled=!0:(c.width="window"===t.maxWidth,c.height="window"===t.maxHeight,(c.width||c.height)&&(c.enabled=!0)),h=n.arrayFlip(t.propagationEvents,!0),this.filter(":not(.ui-dialog-content)").each(function(){var i,a,f=e(this).addClass("ui-dialog-content ui-widget-content"),m="elfinder-dialog-active",g="elfinder-dialog",v="elfinder-dialog-notify",b="ui-state-hover",y="elfinder-tabstop",w="elfinder-focus",x="elfinder-dialog-modal",k=parseInt(1e6*Math.random()),C=e('<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><span class="elfinder-dialog-title">'+t.title+"</span></div>"),z=e('<div class="ui-dialog-buttonset"/>'),T=e('<div class=" ui-helper-clearfix ui-dialog-buttonpane ui-widget-content"/>').append(z),A=0,I=0,S=e(),O=e('<div style="width:100%;height:100%;position:absolute;top:0px;left:0px;"/>').hide(),j=function(){t.optimizeNumber&&P.find("input[type=number]").each(function(){e(this).attr("inputmode","numeric"),e(this).attr("pattern","[0-9]*")})},M=function(){S=P.find("."+y),S.length&&(S.attr("tabindex","-1"),S.filter("."+w).length||z.children("."+y+":"+(s?"first":"last")).addClass(w))},F=function(t){var n=S.filter(":visible:enabled"),i=t?null:n.filter("."+w+":first");return i&&i.length||(i=n.first()),t&&e.each(n,function(e,a){if(a===t&&n[e+1])return i=n.eq(e+1),!1}),i},D=function(t){var n=S.filter(":visible:enabled"),i=n.last();return e.each(n,function(e,a){if(a===t&&n[e-1])return i=n.eq(e-1),!1}),i},U=function(){e.each(t.headerBtnOrder.split(":").reverse(),function(e,t){E[t]&&E[t]()}),s&&C.children(".elfinder-titlebar-button").addClass("elfinder-titlebar-button-right")},E={close:function(){C.prepend(e('<span class="ui-widget-header ui-dialog-titlebar-close ui-corner-all elfinder-titlebar-button"><span class="ui-icon ui-icon-closethick"/></span>').on("mousedown",function(e){e.preventDefault(),e.stopPropagation(),f.elfinderdialog("close")}))},maximize:function(){t.allowMaximize&&(P.on("resize",function(e,t){var n,i;if(e.preventDefault(),e.stopPropagation(),t&&t.maximize){if(i=C.find(".elfinder-titlebar-full"),n="on"===t.maximize,i.children("span.ui-icon").toggleClass("ui-icon-plusthick",!n).toggleClass("ui-icon-arrowreturnthick-1-s",n),n){try{P.hasClass("ui-draggable")&&P.draggable("disable"),P.hasClass("ui-resizable")&&P.resizable("disable")}catch(e){}f.css("width","100%").css("height",P.height()-P.children(".ui-dialog-titlebar").outerHeight(!0)-T.outerHeight(!0))}else{f.attr("style",i.data("style")),i.removeData("style"),R();try{P.hasClass("ui-draggable")&&P.draggable("enable"),P.hasClass("ui-resizable")&&P.resizable("enable")}catch(e){}}P.trigger("resize",{init:!0})}}),C.prepend(e('<span class="ui-widget-header ui-corner-all elfinder-titlebar-button elfinder-titlebar-full"><span class="ui-icon ui-icon-plusthick"/></span>').on("mousedown",function(i){var a=e(this);i.preventDefault(),i.stopPropagation(),P.hasClass("elfinder-maximized")||"undefined"!=typeof a.data("style")||(f.height(f.height()),a.data("style",f.attr("style")||"")),n.toggleMaximize(P),"function"==typeof t.maximize&&t.maximize.call(f[0])})))},minimize:function(){var i,a,o;t.allowMinimize&&(i=e('<span class="ui-widget-header ui-corner-all elfinder-titlebar-button elfinder-titlebar-minimize"><span class="ui-icon ui-icon-minusthick"/></span>').on("mousedown",function(i){var r=e(this),s=n.getUI("bottomtray"),l={width:70,height:24},c=e("<div/>").css(l).addClass(P.get(0).className+" elfinder-dialog-minimized"),d={};i.preventDefault(),i.stopPropagation(),P.data("minimized")?(P.removeData("minimized").before(a.css(Object.assign({position:"absolute"},a.offset()))),n.toFront(a),a.animate(Object.assign({width:P.width(),height:P.height()},o),function(){P.show(),n.toFront(P),a.remove(),R(),u(),P.trigger("resize",{init:!0}),"function"==typeof t.minimize&&t.minimize.call(f[0])})):(o=P.data("minimized",!0).position(),a=P.clone().on("mousedown",function(){r.trigger("mousedown")}).removeClass("ui-draggable ui-resizable elfinder-frontmost"),s.append(c),Object.assign(d,c.offset(),l),c.remove(),a.height(P.height()).children(".ui-dialog-content:first").empty(),n.toHide(P.before(a)),a.children(".ui-dialog-content:first,.ui-dialog-buttonpane,.ui-resizable-handle").remove(),a.find(".elfinder-titlebar-minimize,.elfinder-titlebar-full").remove(),a.find(".ui-dialog-titlebar-close").on("mousedown",function(e){e.stopPropagation(),e.preventDefault(),a.remove(),P.show(),f.elfinderdialog("close")}),a.animate(d,function(){a.attr("style","").css({maxWidth:P.width()}).addClass("elfinder-dialog-minimized").appendTo(s),u(),"function"==typeof t.minimize&&t.minimize.call(f[0])}))}),C.on("dblclick",function(t){e(this).children(".elfinder-titlebar-minimize").trigger("mousedown")}).prepend(i),P.on("togleminimize",function(){i.trigger("mousedown")}))}},P=e('<div class="ui-front ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable std42-dialog touch-punch '+g+" "+t.cssClass+'"/>').hide().append(f).appendTo(o).draggable({containment:n.options.dialogContained?o:null,handle:".ui-dialog-titlebar",start:function(){O.show()},drag:function(e,t){var i=t.offset.top,a=t.offset.left;i<0&&(t.position.top=t.position.top-i),a<0&&(t.position.left=t.position.left-a),n.options.dialogContained&&(t.position.top<0&&(t.position.top=0),t.position.left<0&&(t.position.left=0))},stop:function(e,n){O.hide(),P.css({height:t.height}),f.data("draged",!0)}}).css({width:t.width,height:t.height,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight}).on("touchstart touchmove touchend click dblclick mouseup mouseenter mouseleave mouseout mouseover mousemove",function(e){!h[e.type]&&e.stopPropagation()}).on("mousedown",function(t){!h[t.type]&&t.stopPropagation(),requestAnimationFrame(function(){P.is(":visible")&&!P.hasClass("elfinder-frontmost")&&(a=e(":focus"),a.length||(a=void 0),P.trigger("totop"))})}).on("open",function(){c.enabled&&(t.height&&"auto"!==t.height&&P.trigger("resize",{init:!0}),c.defaultSize||(c.defaultSize={width:f.width(),height:f.height()}),d(P),P.trigger("resize").trigger("posinit"),o.on("resize."+n.namespace,P,p)),P.hasClass(v)||o.children("."+g+":visible:not(."+v+")").each(function(){var t=e(this),n=parseInt(t.css("top")),i=parseInt(t.css("left")),a=parseInt(P.css("top")),o=parseInt(P.css("left")),r=Math.abs(n-a)<10,s=Math.abs(i-o)<10;
t[0]!=P[0]&&(r||s)&&P.css({top:r?n+10:a,left:s?i+10:o})}),P.data("modal")&&(P.addClass(x),n.getUI("overlay").elfinderoverlay("show")),P.trigger("totop"),t.openMaximized&&n.toggleMaximize(P),n.trigger("dialogopen",{dialog:P}),"function"==typeof t.open&&e.proxy(t.open,f[0])(),t.closeOnEscape&&e(document).on("keydown."+k,function(t){t.keyCode==e.ui.keyCode.ESCAPE&&P.hasClass("elfinder-frontmost")&&f.elfinderdialog("close")}),P.hasClass(n.res("class","editing"))&&u()}).on("close",function(i){var a,r;t.beforeclose&&"function"==typeof t.beforeclose?(r=t.beforeclose(),r&&r.promise||(r=r?e.Deferred().resolve():e.Deferred().reject())):r=e.Deferred().resolve(),r.done(function(){c.enabled&&o.off("resize."+n.namespace,p),t.closeOnEscape&&e(document).off("keyup."+k),t.allowMaximize&&n.toggleMaximize(P,!1),n.toHide(P),P.data("modal")&&n.getUI("overlay").elfinderoverlay("hide"),"function"==typeof t.close&&e.proxy(t.close,f[0])(),t.destroyOnClose&&P.parent().length&&P.hide().remove(),a=o.children("."+g+":visible"),P.hasClass(n.res("class","editing"))&&u()})}).on("totop frontmost",function(){var e=n.storage("autoFocusDialog");P.data("focusOnMouseOver",e?e>0:n.options.uiOptions.dialog.focusOnMouseOver),P.data("minimized")&&C.children(".elfinder-titlebar-minimize").trigger("mousedown"),!P.data("modal")&&n.getUI("overlay").is(":visible")?n.getUI("overlay").before(P):n.toFront(P),o.children("."+g+":not(."+x+")").removeClass(m),P.addClass(m),!n.UA.Mobile&&(a||F()).trigger("focus"),a=void 0}).on("posinit",function(){var i,a,s,l,c,d,p,u=t.position;if(!P.hasClass("elfinder-maximized")){if(!u&&!P.data("resizing")){if(p=o.hasClass("elfinder-fullscreen"),P.css(p?{maxWidth:"100%",maxHeight:"100%",overflow:"auto"}:r),n.UA.Mobile&&!p&&P.data("rotated")===n.UA.Rotated)return;P.data("rotated",n.UA.Rotated),c=e(window),i=o.offset(),l={width:P.outerWidth(!0),height:P.outerHeight(!0)},l.right=i.left+l.width,l.bottom=i.top+l.height,d={scrLeft:c.scrollLeft(),scrTop:c.scrollTop(),width:c.width(),height:c.height()},d.right=d.scrLeft+d.width,d.bottom=d.scrTop+d.height,n.options.dialogContained||p?(a=0,s=0):(a=i.top*-1+d.scrTop,s=i.left*-1+d.scrLeft),u={top:l.height>=d.height?a:Math.max(a,parseInt((o.height()-l.height)/2-42)),left:l.width>=d.width?s:Math.max(s,parseInt((o.width()-l.width)/2))},l.right+u.left>d.right&&(u.left=Math.max(s,d.right-l.right)),l.bottom+u.top>d.bottom&&(u.top=Math.max(a,d.bottom-l.bottom))}t.absolute&&(u.position="absolute"),u&&P.css(u)}}).on("resize",function(n,i){var a,o,r=0,s=i&&i.init;i&&(i.minimize||i.maxmize)||P.data("minimized")||(n.stopPropagation(),n.preventDefault(),P.children(".ui-widget-header,.ui-dialog-buttonpane").each(function(){r+=e(this).outerHeight(!0)}),a=s||!c.enabled||n.originalEvent||P.hasClass("elfinder-maximized")?P.height()-r-P.data("margin-y"):Math.min(c.defaultSize.height,Math.max(parseInt(P.css("max-height")),parseInt(P.css("min-height")))-r-P.data("margin-y")),f.height(a),s||(R(),o=f.height(),o=a<o?o+r+P.data("margin-y"):t.minHeight,P.css("min-height",o),P.data("hasResizable")&&P.resizable("option",{minHeight:o}),"function"==typeof t.resize&&e.proxy(t.resize,f[0])(n,i)))}).on("tabstopsInit",M).on("focus","."+y,function(){e(this).addClass(b).parent("label").addClass(b),this.id&&e(this).parent().find("label[for="+this.id+"]").addClass(b)}).on("click","select."+y,function(){var t=e(this);t.data("keepFocus")?t.removeData("keepFocus"):t.data("keepFocus",!0)}).on("blur","."+y,function(){e(this).removeClass(b).removeData("keepFocus").parent("label").removeClass(b),this.id&&e(this).parent().find("label[for="+this.id+"]").removeClass(b)}).on("mouseenter mouseleave","."+y+",label",function(n){var i,a=e(this);("LABEL"!==this.nodeName||a.children("."+y).length||(i=a.attr("for"))&&e("#"+i).hasClass(y))&&(t.btnHoverFocus&&P.data("focusOnMouseOver")?"mouseenter"!==n.type||e(":focus").data("keepFocus")||a.trigger("focus"):a.toggleClass(b,"mouseenter"==n.type))}).on("keydown","."+y,function(t){var n,i,a=e(this);if(a.is(":focus")){if(n=t.keyCode===e.ui.keyCode.ESCAPE,t.keyCode===e.ui.keyCode.ENTER?(t.preventDefault(),a.trigger("click")):t.keyCode===e.ui.keyCode.TAB&&t.shiftKey||t.keyCode===e.ui.keyCode.LEFT||t.keyCode==e.ui.keyCode.UP?i="prev":t.keyCode!==e.ui.keyCode.TAB&&t.keyCode!=e.ui.keyCode.RIGHT&&t.keyCode!=e.ui.keyCode.DOWN||(i="next"),i&&(a.is("textarea")&&!t.ctrlKey&&!t.metaKey||a.is("select,span.ui-slider-handle")&&t.keyCode!==e.ui.keyCode.TAB||a.is("input:not(:checkbox,:radio)")&&!t.ctrlKey&&!t.metaKey&&t.keyCode===e.ui.keyCode["prev"===i?"LEFT":"RIGHT"]))return void t.stopPropagation();n?a.is("input:not(:checkbox,:radio),textarea")&&""!==a.val()&&(a.val(""),t.stopPropagation()):t.stopPropagation(),i&&(t.preventDefault(),("prev"===i?D:F)(this).trigger("focus"))}}).data({modal:t.modal}),R=function(){var e,t=n.getUI();t.hasClass("elfinder-fullscreen")&&(e=P.position(),P.css("top",Math.max(Math.min(Math.max(e.top,0),t.height()-100),0)),P.css("left",Math.max(Math.min(Math.max(e.left,0),t.width()-200),0)))};P.prepend(C),U(),e.each(t.buttons,function(t,n){var i=e('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only elfinder-btncnt-'+I++ +" "+y+'"><span class="ui-button-text">'+t+"</span></button>").on("click",e.proxy(n,f[0]));n._cssClass&&i.addClass(n._cssClass),s?z.append(i):z.prepend(i)}),z.children().length&&(P.append(T),P.show(),T.find("button").each(function(t,n){A+=e(n).outerWidth(!0)}),P.hide(),A+=20,P.width()<A&&P.width(A)),P.append(O),c.enabled&&(l.width=P.outerWidth(!0)-P.width()+(P.outerWidth()-P.width())/2,l.height=P.outerHeight(!0)-P.height()+(P.outerHeight()-P.height())/2),n.options.dialogContained&&(i={maxWidth:o.width()-l.width,maxHeight:o.height()-l.height},t.maxWidth=t.maxWidth?Math.min(i.maxWidth,t.maxWidth):i.maxWidth,t.maxHeight=t.maxHeight?Math.min(i.maxHeight,t.maxHeight):i.maxHeight,P.css(i)),r={maxWidth:P.css("max-width"),maxHeight:P.css("max-height"),overflow:P.css("overflow")},P.data("margin-y",f.outerHeight(!0)-f.height()),t.resizable&&P.resizable({minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,start:function(){O.show(),P.data("resizing")!==!0&&P.data("resizing")&&clearTimeout(P.data("resizing")),P.data("resizing",!0)},stop:function(e,t){O.hide(),P.data("resizing",setTimeout(function(){P.data("resizing",!1)},200)),c.enabled&&(c.defaultSize={width:f.width(),height:f.height()})}}).data("hasResizable",!0),j(),M(),"function"==typeof t.create&&e.proxy(t.create,this)(),t.autoOpen&&(t.open?requestAnimationFrame(function(){f.elfinderdialog("open")}):f.elfinderdialog("open"))}),this)},e.fn.elfinderdialog.defaults={cssClass:"",title:"",modal:!1,resizable:!0,autoOpen:!0,closeOnEscape:!0,destroyOnClose:!1,buttons:{},btnHoverFocus:!0,position:null,absolute:!1,width:320,height:"auto",minWidth:200,minHeight:70,maxWidth:null,maxHeight:null,allowMinimize:"auto",allowMaximize:!1,openMaximized:!1,headerBtnPos:"auto",headerBtnOrder:"auto",optimizeNumber:!0,propagationEvents:["mousemove","mouseup"]},e.fn.elfinderfullscreenbutton=function(t){return this.each(function(){var n,i=e(this).elfinderbutton(t),a=i.children(".elfinder-button-icon");t.change(function(){n&&cancelAnimationFrame(n),n=requestAnimationFrame(function(){var e=t.value;a.addClass("elfinder-button-icon-fullscreen").toggleClass("elfinder-button-icon-unfullscreen",e),t.className=e?"unfullscreen":""})})})},e.fn.elfindernavbar=function(t,n){return this.not(".elfinder-navbar").each(function(){var i,a,o,r,s,l=e(this).hide().addClass("ui-state-default elfinder-navbar"),c=l.css("overflow","hidden").parent(),d=c.children(".elfinder-workzone").append(l),p=l.outerHeight()-l.height(),u="ltr"==t.direction,h=function(){var e=t.getUI("cwd"),n=t.getUI("workzone"),i=n.data("rectangle"),a=e.offset();n.data("rectangle",Object.assign(i,{cwdEdge:"ltr"===t.direction?a.left:a.left+e.width()}))};t.one("cssloaded",function(){p=l.outerHeight()-l.height()}).one("opendone",function(){i&&i.trigger("resize"),l.css("overflow","auto")}).bind("wzresize",function(){var e=0;s||(s=t.getUI("navdock")),s.width(l.get(0).offsetWidth-2),s.children().length>1&&(e=s.outerHeight(!0)),l.height(d.height()-e-p)}),t.UA.Touch&&(o=t.storage("autoHide")||{},"undefined"==typeof o.navbar&&(o.navbar=n.autoHideUA&&n.autoHideUA.length>0&&e.grep(n.autoHideUA,function(e){return!!t.UA[e]}).length,t.storage("autoHide",o)),o.navbar&&t.one("init",function(){l.children().length&&t.uiAutoHide.push(function(){l.stop(!0,!0).trigger("navhide",{duration:"slow",init:!0})})}),t.bind("load",function(){l.children().length&&(a=e('<div class="elfinder-navbar-swipe-handle"/>').hide().appendTo(d),"none"!==a.css("pointer-events")&&(a.remove(),a=null))}),l.on("navshow navhide",function(e,n){var i="navshow"===e.type?"show":"hide",r=n&&n.duration?n.duration:"fast",s=n&&n.handleW?n.handleW:Math.max(50,t.getUI().width()/10);l.stop(!0,!0)[i]({duration:r,step:function(){t.trigger("wzresize")},complete:function(){a&&("show"===i?a.stop(!0,!0).hide():(a.width(s?s:""),t.resources.blink(a,"slowonce"))),t.trigger("navbar"+i),n.init&&t.trigger("uiautohide"),h()}}),o.navbar="show"!==i,t.storage("autoHide",Object.assign(t.storage("autoHide"),{navbar:o.navbar}))}).on("touchstart",function(n){e(this)["scroll"+("ltr"===t.direction?"Right":"Left")]()>5&&(n.originalEvent._preventSwipeX=!0)})),t.UA.Mobile||(i=l.resizable({handles:u?"e":"w",minWidth:n.minWidth||150,maxWidth:n.maxWidth||500,resize:function(){t.trigger("wzresize")},stop:function(e,n){t.storage("navbarWidth",n.size.width),h()}}).on("resize scroll",function(n){var a=e(this),o=a.data("posinit");n.preventDefault(),n.stopPropagation(),u||"resize"!==n.type||l.css("left",0),o&&cancelAnimationFrame(o),a.data("posinit",requestAnimationFrame(function(){var e=t.UA.Opera&&l.scrollLeft()?20:2;i.css("top",0).css({top:parseInt(l.scrollTop())+"px",left:u?"auto":parseInt(l.scrollRight()-e)*-1,right:u?parseInt(l.scrollLeft()-e)*-1:"auto"}),"resize"===n.type&&t.getUI("cwd").trigger("resize")}))}).children(".ui-resizable-handle").addClass("ui-front")),(r=t.storage("navbarWidth"))?l.width(r):t.UA.Mobile&&t.one("cssloaded",function(){var n=function(){r=l.parent().width()/2,l.data("defWidth")>r?l.width(r):l.width(l.data("defWidth")),l.data("width",l.width()),t.trigger("wzresize")};l.data("defWidth",l.width()),e(window).on("resize."+t.namespace,n),n()})}),this},e.fn.elfindernavdock=function(t,n){return this.not(".elfinder-navdock").each(function(){var i,a,o=e(this).hide().addClass("ui-state-default elfinder-navdock touch-punch"),r=o.parent(),s=(r.children(".elfinder-workzone").append(o),function(n,i){var a,r=i||o.height(),s=n-r,l=Object.keys(c).length,d=l?s/l:0;s&&(a=o.css("overflow"),o.css("overflow","hidden"),o.height(n),e.each(c,function(e,n){n.height(n.height()+d).trigger("resize."+t.namespace)}),t.trigger("wzresize"),o.css("overflow",a))}),l=e('<div class="ui-front ui-resizable-handle ui-resizable-n"/>').appendTo(o),c={},d=(parseInt(n.initMaxHeight)||50)/100,p=(parseInt(n.maxHeight)||90)/100;o.data("addNode",function(e,n){var r,u,h,f=t.getUI("workzone").height(),m=f*d;return n=Object.assign({first:!1,sizeSync:!0,init:!1},n),e.attr("id")||e.attr("id",t.namespace+"-navdock-"+ +new Date),n.sizeSync&&(c[e.attr("id")]=e),r=o.height(),u=r+e.outerHeight(!0),n.first?l.after(e):o.append(e),a=!0,o.resizable("enable").height(u).show(),t.trigger("wzresize"),n.init&&(h=t.storage("navdockHeight"),u=h?h:u>m?m:u,i=u),s(Math.min(u,f*p)),o}).data("removeNode",function(n,i){var r=e("#"+n);return delete c[n],o.height(o.height()-e("#"+n).outerHeight(!0)),i?"detach"===i?r=r.detach():i.append(r):r.remove(),o.children().length<=1&&(a=!1,o.resizable("disable").height(0).hide()),t.trigger("wzresize"),r}),n.disabled||t.one("init",function(){var e;t.getUI("navbar").children().not(".ui-resizable-handle").length&&(o.data("dockEnabled",!0),o.resizable({maxHeight:t.getUI("workzone").height()*p,handles:{n:l},start:function(n,i){e=o.css("overflow"),o.css("overflow","hidden"),t.trigger("navdockresizestart",{event:n,ui:i},!0)},resize:function(e,n){o.css("top",""),t.trigger("wzresize",{inNavdockResize:!0})},stop:function(n,a){t.trigger("navdockresizestop",{event:n,ui:a},!0),o.css("top",""),i=a.size.height,t.storage("navdockHeight",i),s(i,a.originalSize.height),o.css("overflow",e)}}),t.bind("wzresize",function(e){var n,a;o.is(":visible")&&(n=t.getUI("workzone").height()*p,e.data&&e.data.inNavdockResize||(a=o.height(),n<i?Math.abs(a-n)>1&&s(n):Math.abs(a-i)>1&&s(i)),o.resizable("option","maxHeight",n))})),t.bind("navbarshow navbarhide",function(e){o[a&&"navbarshow"===e.type?"show":"hide"]()})})}),this},e.fn.elfinderoverlay=function(t){var n,i,a,o,r=this.parent().elfinder("instance");return this.filter(":not(.elfinder-overlay)").each(function(){t=Object.assign({},t),e(this).addClass("ui-front ui-widget-overlay elfinder-overlay").hide().on("mousedown",function(e){e.preventDefault(),e.stopPropagation()}).data({cnt:0,show:"function"==typeof t.show?t.show:function(){},hide:"function"==typeof t.hide?t.hide:function(){}})}),"show"==t&&(n=this.eq(0),i=n.data("cnt")+1,a=n.data("show"),r.toFront(n),n.data("cnt",i),n.is(":hidden")&&(n.show(),a())),"hide"==t&&(n=this.eq(0),i=n.data("cnt")-1,o=n.data("hide"),n.data("cnt",i),i<=0&&(n.hide(),o())),this},e.fn.elfinderpanel=function(t){return this.each(function(){var n=e(this).addClass("elfinder-panel ui-state-default ui-corner-all"),i="margin-"+("ltr"==t.direction?"left":"right");t.one("load",function(e){var a=t.getUI("navbar");n.css(i,parseInt(a.outerWidth(!0))),a.on("resize",function(e){e.preventDefault(),e.stopPropagation(),n.is(":visible")&&n.css(i,parseInt(a.outerWidth(!0)))})})})},e.fn.elfinderpath=function(t,n){return this.each(function(){var a,o,r="",s="",l=[],c="statusbar",d=t.res("class","hover"),p="path"+(i.prototype.uniqueid?i.prototype.uniqueid:"")+"-",u=e('<div class="ui-widget-header ui-helper-clearfix elfinder-workzone-path"/>'),h=e(this).addClass("elfinder-path").html("&nbsp;").on("mousedown","span.elfinder-path-dir",function(n){var i=e(this).attr("id").substr(p.length);n.preventDefault(),i!=t.cwd().hash&&(e(this).addClass(d),r?t.exec("search",r,{target:i,mime:l.join(" ")}):t.trigger("select",{selected:[i]}).exec("open",i))}).prependTo(t.getUI("statusbar").show()),f=e('<div class="elfinder-path-roots"/>').on("click",function(n){n.stopPropagation(),n.preventDefault();var i=e.map(t.roots,function(e){return t.file(e)}),a=[];e.each(i,function(e,n){n.phash||t.root(t.cwd().hash,!0)===n.hash||a.push({label:t.escape(n.i18||n.name),icon:"home",callback:function(){t.exec("open",n.hash)},options:{iconClass:n.csscls||"",iconImg:n.icon||""}})}),t.trigger("contextmenu",{raw:a,x:n.pageX,y:n.pageY})}).append('<span class="elfinder-button-icon elfinder-button-icon-menu" />').appendTo(u),m=function(n){var i=[],a=[];return e.each(t.parents(n),function(e,o){var r=n===o?"elfinder-path-dir elfinder-path-cwd":"elfinder-path-dir",s=t.file(o),l=t.escape(s.i18||s.name);a.push(l),i.push('<span id="'+p+o+'" class="'+r+'" title="'+a.join(t.option("separator"))+'">'+l+"</span>")}),i.join('<span class="elfinder-path-other">'+t.option("separator")+"</span>")},g=function(){var n;h.children("span.elfinder-path-dir").attr("style",""),n="ltr"===t.direction?e("#"+p+t.cwd().hash).prevAll("span.elfinder-path-dir:first"):e(),h.scrollLeft(n.length?n.position().left:0)},v=function(){if(!t.UA.CSS.flex){var n,i,a=h.children("span.elfinder-path-dir"),o=a.length;if("workzone"===c||o<2)return void a.attr("style","");h.width(h.css("max-width")),a.css({maxWidth:100/o+"%",display:"inline-block"}),n=h.width()-9,h.children("span.elfinder-path-other").each(function(){n-=e(this).width()}),i=[],a.each(function(t){var a=e(this),o=a.width();n-=o,o<this.scrollWidth&&i.push(t)}),h.width(""),i.length?(n>0&&(n/=i.length,e.each(i,function(t,i){var o=e(a[i]);o.css("max-width",o.width()+n)})),a.last().attr("style","")):a.attr("style","")}};t.one("init",function(){a=t.getUI("tree").length,o=t.getUI("stat").length,!a&&n.toWorkzoneWithoutNavbar&&(u.append(h).insertBefore(t.getUI("workzone")),c="workzone",t.bind("open",g).one("opendone",function(){t.getUI().trigger("resize")}))}).bind("open searchend parents",function(){r="",s="",l=[],h.html(m(t.cwd().hash)),Object.keys(t.roots).length>1?(h.css("margin",""),f.show()):(h.css("margin",0),f.hide()),!o&&v()}).bind("searchstart",function(e){e.data&&(r=e.data.query||"",s=e.data.target||"",l=e.data.mimes||[])}).bind("search",function(e){var n="";n=s?m(s):t.i18n("btnAll"),h.html('<span class="elfinder-path-other">'+t.i18n("searcresult")+": </span>"+n),v()}).bind("navbarshow navbarhide",function(){var e=t.getUI("workzone");"navbarshow"===this.type?(t.unbind("open",g),h.prependTo(t.getUI("statusbar")),u.detach(),c="statusbar"):(u.append(h).insertBefore(e),c="workzone",g(),t.bind("open",g)),t.trigger("uiresize")}).bind("resize uistatchange",v)})},e.fn.elfinderplaces=function(t,n){return this.each(function(){var i={},a="class",o=t.res(a,"navdir"),r=t.res(a,"navcollapse"),s=t.res(a,"navexpand"),l=t.res(a,"hover"),c=t.res(a,"treeroot"),d=t.res(a,"adroppable"),p=t.res("tpl","placedir"),u=t.res("tpl","perms"),h=e(t.res("tpl","navspinner")),f=n.suffix?n.suffix:"",m="places"+f,g=null,v=function(e){return e.substr(6)},b=function(e){return"place-"+e},y=function(){var n=[],a={};n=e.map(M.children().find("[id]"),function(e){return v(e.id)}),n.length?e.each(n.reverse(),function(e,t){a[t]=i[t]}):a=null,t.storage(m,a)},w=function(){var a,o;m="places"+(n.suffix?n.suffix:""),i={},a=t.storage(m),"string"==typeof a?(a=e.grep(a.split(","),function(e){return!!e}),e.each(a,function(e,t){var n=t.split("#");i[n[0]]=n[1]?n[1]:n[0]})):e.isPlainObject(a)&&(i=a),t.trigger("placesload",{dirs:i,storageKey:m},!0),o=Object.keys(i),o.length&&(j.prepend(h),t.request({data:{cmd:"info",targets:o},preventDefault:!0}).done(function(n){var a={};n.files&&n.files.length&&t.cache(n.files),e.each(n.files,function(e,t){var n=t.hash;a[n]=t}),e.each(i,function(e,t){k(a[e]||Object.assign({notfound:!0},t))}),t.storage("placesState")>0&&j.trigger("click")}).always(function(){h.remove()}))},x=function(n,i){return e(p.replace(/\{id\}/,b(n?n.hash:i)).replace(/\{name\}/,t.escape(n?n.i18||n.name:i)).replace(/\{cssclass\}/,n?t.perms2class(n)+(n.notfound?" elfinder-na":"")+(n.csscls?" "+n.csscls:""):"").replace(/\{permissions\}/,!n||n.read&&n.write&&!n.notfound?"":u).replace(/\{title\}/,n&&n.path?t.escape(n.path):"").replace(/\{symlink\}/,"").replace(/\{style\}/,n&&n.icon?t.getIconStyle(n):""))},k=function(e){var n,a;return"directory"===e.mime&&(a=e.hash,t.files().hasOwnProperty(a)||t.trigger("tree",{tree:[e]}),n=x(e,a),i[a]=e,M.prepend(n),j.addClass(r),S.toggle(M.children().length>1),!0)},C=function(t){var n,a,o=null;return i[t]&&(delete i[t],n=e("#"+b(t)),n.length&&(o=n.text(),n.parent().remove(),a=M.children().length,S.toggle(a>1),a||(j.removeClass(r),F.removeClass(s),M.slideToggle(!1)))),o},z=function(n){var i=e("#"+b(n)),a=i.parent(),o=a.prev("div"),r="ui-state-hover",s=t.getUI("contextmenu");g&&clearTimeout(g),o.length&&(s.find(":first").data("placesHash",n),i.addClass(r),a.insertBefore(o),o=a.prev("div"),g=setTimeout(function(){i.removeClass(r),s.find(":first").data("placesHash")===n&&s.hide().empty()},1500)),o.length||(i.removeClass(r),s.hide().empty())},T=function(t,n){var a=t.hash,o=e("#"+b(n||a)),r=x(t,a);return o.length>0&&(o.parent().replaceWith(r),i[a]=t,!0)},A=function(){M.empty(),j.removeClass(r),F.removeClass(s),M.slideToggle(!1)},I=function(){e.each(i,function(n,i){var a=t.file(n)||i,r=x(a,n),s=null;return a||r.hide(),!(!M.children().length||(e.each(M.children(),function(){var t=e(this);if((a.i18||a.name).localeCompare(t.children("."+o).text())<0)return s=!r.insertBefore(t)}),null===s))||void(!e("#"+b(n)).length&&M.append(r))}),y()},S=e('<span class="elfinder-button-icon elfinder-button-icon-sort elfinder-places-root-icon" title="'+t.i18n("cmdsort")+'"/>').hide().on("click",function(e){e.stopPropagation(),M.empty(),I()}),O=x({hash:"root-"+t.namespace,name:t.i18n(n.name,"places"),read:!0,write:!0}),j=O.children("."+o).addClass(c).on("click",function(e){e.stopPropagation(),j.hasClass(r)&&(F.toggleClass(s),M.slideToggle(),t.storage("placesState",F.hasClass(s)?1:0))}).append(S),M=O.children("."+t.res(a,"navsubtree")),F=e(this).addClass(t.res(a,"tree")+" elfinder-places ui-corner-all").hide().append(O).appendTo(t.getUI("navbar")).on("mouseenter mouseleave","."+o,function(t){e(this).toggleClass("ui-state-hover","mouseenter"==t.type)}).on("click","."+o,function(n){var i=e(this);return i.data("longtap")?void n.stopPropagation():void(!i.hasClass("elfinder-na")&&t.exec("open",i.attr("id").substr(6)))}).on("contextmenu","."+o+":not(."+c+")",function(n){var i=e(this),a=i.attr("id").substr(6);n.preventDefault(),t.trigger("contextmenu",{raw:[{label:t.i18n("moveUp"),icon:"up",remain:!0,callback:function(){z(a),y()}},"|",{label:t.i18n("rmFromPlaces"),icon:"rm",callback:function(){C(a),y()}}],x:n.pageX,y:n.pageY}),i.addClass("ui-state-hover"),t.getUI("contextmenu").children().on("mouseenter",function(){i.addClass("ui-state-hover")}),t.bind("closecontextmenu",function(){i.removeClass("ui-state-hover")})}).droppable({tolerance:"pointer",accept:".elfinder-cwd-file-wrapper,.elfinder-tree-dir,.elfinder-cwd-file",hoverClass:t.res("class","adroppable"),classes:{"ui-droppable-hover":t.res("class","adroppable")},over:function(n,a){var o=a.helper,r=e.grep(o.data("files"),function(e){return"directory"===t.file(e).mime&&!i[e]});n.stopPropagation(),o.data("dropover",o.data("dropover")+1),t.insideWorkzone(n.pageX,n.pageY)&&(r.length>0?(o.addClass("elfinder-drag-helper-plus"),t.trigger("unlockfiles",{files:o.data("files"),helper:o})):e(this).removeClass(d))},out:function(t,n){var i=n.helper;t.stopPropagation(),i.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus").data("dropover",Math.max(i.data("dropover")-1,0)),e(this).removeData("dropover").removeClass(d)},drop:function(n,a){var o=a.helper,r=!0;e.each(o.data("files"),function(e,n){var a=t.file(n);a&&"directory"==a.mime&&!i[a.hash]?k(a):r=!1}),y(),r&&o.hide()}}).on("touchstart","."+o+":not(."+c+")",function(n){if(!(n.originalEvent.touches.length>1))var i=e(this).attr("id").substr(6),a=e(this).addClass(l).data("longtap",null).data("tmlongtap",setTimeout(function(){a.data("longtap",!0),t.trigger("contextmenu",{raw:[{label:t.i18n("rmFromPlaces"),icon:"rm",callback:function(){C(i),y()}}],x:n.originalEvent.touches[0].pageX,y:n.originalEvent.touches[0].pageY})},500))}).on("touchmove touchend","."+o+":not(."+c+")",function(t){clearTimeout(e(this).data("tmlongtap")),"touchmove"==t.type&&e(this).removeClass(l)});e.fn.sortable&&M.addClass("touch-punch").sortable({appendTo:t.getUI(),revert:!1,helper:function(n){var i=e(n.target).parent();return i.children().removeClass("ui-state-hover"),e('<div class="ui-widget elfinder-place-drag elfinder-'+t.direction+'"/>').append(e('<div class="elfinder-navbar"/>').show().append(i.clone()))},stop:function(t,n){var i=e(n.item[0]),a=F.offset().top,o=F.offset().left,r=F.width(),s=F.height(),l=t.pageX,c=t.pageY;l>o&&l<o+r&&c>a&&c<c+s||(C(v(i.children(":first").attr("id"))),y())},update:function(e,t){y()}}),e(this).on("regist",function(t,n){var a=!1;e.each(n,function(e,t){t&&"directory"==t.mime&&!i[t.hash]&&k(t)&&(a=!0)}),a&&y()}),t.one("load",function(){t.oldAPI||(F.show().parent().show(),w(),t.change(function(t){var n=!1;e.each(t.data.changed,function(e,t){i[t.hash]&&("directory"!==t.mime?C(t.hash)&&(n=!0):T(t)&&(n=!0))}),n&&y()}).bind("rename",function(t){var n=!1;t.data.removed&&e.each(t.data.removed,function(e,i){t.data.added[e]&&T(t.data.added[e],i)&&(n=!0)}),n&&y()}).bind("rm paste",function(t){var n=[],i=!1;t.data.removed&&e.each(t.data.removed,function(e,t){var i=C(t);i&&n.push(i)}),n.length&&(i=!0),t.data.added&&n.length&&e.each(t.data.added,function(t,i){1!==e.inArray(i.name,n)&&"directory"==i.mime&&k(i)}),i&&y()}).bind("sync netmount",function(){var a,o=this,r=n.suffix?n.suffix:"";return"sync"===o.type&&f!==r?(f=r,A(),void w()):(a=Object.keys(i),void(a.length&&(j.prepend(h),t.request({data:{cmd:"info",targets:a},preventDefault:!0}).done(function(n){var a={},r=!1,s=t.cwd().hash;e.each(n.files||[],function(e,n){var i=n.hash;a[i]=n,t.files().hasOwnProperty(n.hash)||t.trigger("tree",{tree:[n]})}),e.each(i,function(e,t){t.notfound===Boolean(a[e])?t.phash===s&&"netmount"!==o.type||a[e]&&"directory"!==a[e].mime?C(e)&&(r=!0):T(a[e]||Object.assign({notfound:!0},t))&&(r=!0):a[e]&&a[e].phash!=s&&T(a[e])}),r&&y()}).always(function(){h.remove()}))))}))})})},e.fn.elfindersearchbutton=function(t){return this.each(function(){var n,i,a,o,r=!1,s=t.fm,l=t.options.incsearch||{enable:!1},c=t.options.searchTypes,d=function(e){return s.namespace+s.escape(e)},p=s.getUI("toolbar"),u=s.res("class","searchbtn"),h=e(this).hide().addClass("ui-widget-content elfinder-button "+u).on("click",function(e){e.stopPropagation()}),f=function(){v.data("inctm")&&clearTimeout(v.data("inctm"));var n=e.trim(v.val()),a=!e("#"+d("SearchFromAll")).prop("checked"),o=e("#"+d("SearchMime")).prop("checked"),l="";a&&(a=e("#"+d("SearchFromVol")).prop("checked")?s.root(s.cwd().hash):s.cwd().hash),o&&(o=n,n="."),i&&(l=i.children("input:checked").val()),n?(v.trigger("focus"),t.exec(n,a,o,l).done(function(){r=!0}).fail(function(){m()})):s.trigger("searchend")},m=function(){v.data("inctm")&&clearTimeout(v.data("inctm")),v.val("").trigger("blur"),(r||g)&&(r=!1,g="",s.lazy(function(){s.trigger("searchend")}))},g="",v=e('<input type="text" size="42"/>').on("focus",function(){o=!0,g="",h.addClass("ui-state-active"),s.trigger("uiresize"),n&&n.slideDown(function(){h.addClass("ui-state-active"),s.toFront(n)})}).on("blur",function(){o=!1,n?n.data("infocus")?n.data("infocus",!1):n.slideUp(function(){h.removeClass("ui-state-active"),s.trigger("uiresize"),s.toHide(n)}):h.removeClass("ui-state-active")}).appendTo(h).on("keypress",function(e){e.stopPropagation()}).on("keydown",function(t){t.stopPropagation(),t.keyCode===e.ui.keyCode.ENTER?f():t.keyCode===e.ui.keyCode.ESCAPE&&(t.preventDefault(),m())});l.enable&&(l.minlen=l.minlen||2,l.wait=l.wait||500,v.attr("title",s.i18n("incSearchOnly")).on("compositionstart",function(){v.data("composing",!0)}).on("compositionend",function(){v.removeData("composing"),v.trigger("input")}).on("input",function(){v.data("composing")||(v.data("inctm")&&clearTimeout(v.data("inctm")),v.data("inctm",setTimeout(function(){var e=v.val();(0===e.length||e.length>=l.minlen)&&(g!==e&&s.trigger("incsearchstart",{query:e}),g=e,""===e&&s.searchStatus.state>1&&s.searchStatus.query&&v.val(s.searchStatus.query).trigger("select"))},l.wait)))}),s.UA.ltIE8&&v.on("keydown",function(e){229===e.keyCode&&(v.data("imetm")&&clearTimeout(v.data("imetm")),v.data("composing",!0),v.data("imetm",setTimeout(function(){v.removeData("composing")},100)))}).on("keyup",function(t){v.data("imetm")&&clearTimeout(v.data("imetm")),v.data("composing")?t.keyCode===e.ui.keyCode.ENTER&&v.trigger("compositionend"):v.trigger("input")})),e('<span class="ui-icon ui-icon-search" title="'+t.title+'"/>').appendTo(h).on("mousedown",function(e){e.stopPropagation(),e.preventDefault(),h.hasClass("ui-state-active")?f():v.trigger("focus")}),e('<span class="ui-icon ui-icon-close"/>').appendTo(h).on("mousedown",function(e){e.stopPropagation(),e.preventDefault(),""!==v.val()||h.hasClass("ui-state-active")?m():v.trigger("focus")}),s.bind("toolbarload",function(){var e=h.parent();if(e.length&&(p.prepend(h.show()),e.remove(),s.UA.ltIE7)){var t=h.children("ltr"==s.direction?".ui-icon-close":".ui-icon-search");t.css({right:"",left:parseInt(h.width())-t.outerWidth(!0)})}}),s.one("init",function(){s.getUI("cwd").on("touchstart click",function(){o&&v.trigger("blur")})}).one("open",function(){n=s.api<2.1?null:e('<div class="ui-front ui-widget ui-widget-content elfinder-button-search-menu ui-corner-all"/>').append(e('<div class="buttonset"/>').append(e('<input id="'+d("SearchFromCwd")+'" name="serchfrom" type="radio" checked="checked"/><label for="'+d("SearchFromCwd")+'">'+s.i18n("btnCwd")+"</label>"),e('<input id="'+d("SearchFromVol")+'" name="serchfrom" type="radio"/><label for="'+d("SearchFromVol")+'">'+s.i18n("btnVolume")+"</label>"),e('<input id="'+d("SearchFromAll")+'" name="serchfrom" type="radio"/><label for="'+d("SearchFromAll")+'">'+s.i18n("btnAll")+"</label>")),e('<div class="buttonset elfinder-search-type"/>').append(e('<input id="'+d("SearchName")+'" name="serchcol" type="radio" checked="checked" value="SearchName"/><label for="'+d("SearchName")+'">'+s.i18n("btnFileName")+"</label>"))).hide().appendTo(s.getUI()),n&&(c&&(i=n.find(".elfinder-search-type"),e.each(t.options.searchTypes,function(t,n){i.append(e('<input id="'+d(t)+'" name="serchcol" type="radio" value="'+s.escape(t)+'"/><label for="'+d(t)+'">'+s.i18n(n.name)+"</label>"))})),n.find("div.buttonset").buttonset(),e("#"+d("SearchFromAll")).next("label").attr("title",s.i18n("searchTarget",s.i18n("btnAll"))),c&&e.each(c,function(t,n){n.title&&e("#"+d(t)).next("label").attr("title",s.i18n(n.title))}),n.on("mousedown","div.buttonset",function(e){e.stopPropagation(),n.data("infocus",!0)}).on("click","input",function(t){t.stopPropagation(),e.trim(v.val())?f():v.trigger("focus")}).on("close",function(){v.trigger("blur")}))}).bind("searchend",function(){v.val("")}).bind("open parents",function(){var t=[],n=s.file(s.root(s.cwd().hash));n&&(e.each(s.parents(s.cwd().hash),function(e,n){t.push(s.file(n).name)}),e("#"+d("SearchFromCwd")).next("label").attr("title",s.i18n("searchTarget",t.join(s.option("separator")))),e("#"+d("SearchFromVol")).next("label").attr("title",s.i18n("searchTarget",n.name)))}).bind("open",function(){g&&m()}).bind("cwdinit",function(){a=!1}).bind("cwdrender",function(){a=!0}).bind("keydownEsc",function(){g&&"/"===g.substr(0,1)&&(g="",v.val(""),s.trigger("searchend"))}).shortcut({pattern:"ctrl+f f3",description:t.title,callback:function(){v.trigger("select").trigger("focus")}}).shortcut({pattern:"a b c d e f g h i j k l m n o p q r s t u v w x y z dig0 dig1 dig2 dig3 dig4 dig5 dig6 dig7 dig8 dig9 num0 num1 num2 num3 num4 num5 num6 num7 num8 num9",description:s.i18n("firstLetterSearch"),callback:function(t){if(a){var n,i=t.originalEvent.keyCode,o=function(){var t=s.selected(),n=e.ui.keyCode[!t.length||e("#"+s.cwdHash2Id(t[0])).next("[id]").length?"RIGHT":"HOME"];e(document).trigger(e.Event("keydown",{keyCode:n,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}))};i>=96&&i<=105&&(i-=48),n="/"+String.fromCharCode(i),g!==n?(v.val(n),g=n,s.trigger("incsearchstart",{query:n}).one("cwdrender",o)):o()}}})})},e.fn.elfindersortbutton=function(t){return this.each(function(){var n,i=t.fm,a=t.name,o="class",r=i.res(o,"disabled"),s=i.res(o,"hover"),l="elfinder-button-menu-item",c=l+"-selected",d=c+"-asc",p=c+"-desc",u=e('<span class="elfinder-button-text">'+t.title+"</span>"),h=e(this).addClass("ui-state-default elfinder-button elfinder-menubutton elfiner-button-"+a).attr("title",t.title).append('<span class="elfinder-button-icon elfinder-button-icon-'+a+'"/>',u).on("mouseenter mouseleave",function(e){!h.hasClass(r)&&h.toggleClass(s,"mouseenter"===e.type)}).on("click",function(e){h.hasClass(r)||(e.stopPropagation(),m.is(":hidden")&&i.getUI().click(),m.css(v()).slideToggle({duration:100,done:function(e){i[m.is(":visible")?"toFront":"toHide"](m)}}))}),f=function(){i.toHide(m)},m=e('<div class="ui-front ui-widget ui-widget-content elfinder-button-menu ui-corner-all"/>').hide().appendTo(i.getUI()).on("mouseenter mouseleave","."+l,function(t){e(this).toggleClass(s,"mouseenter"===t.type)}).on("click",function(e){e.preventDefault(),e.stopPropagation()}).on("close",f),g=function(){m.children("[rel]").removeClass(c+" "+d+" "+p).filter('[rel="'+i.sortType+'"]').addClass(c+" "+("asc"==i.sortOrder?d:p)),m.children(".elfinder-sort-stick").toggleClass(c,i.sortStickFolders),m.children(".elfinder-sort-tree").toggleClass(c,i.sortAlsoTreeview)},v=function(){var e=i.getUI().offset(),t=h.offset();return{top:t.top-e.top,left:t.left-e.left
}};u.hide(),e.each(i.sortRules,function(t,n){m.append(e('<div class="'+l+'" rel="'+t+'"><span class="ui-icon ui-icon-arrowthick-1-n"/><span class="ui-icon ui-icon-arrowthick-1-s"/>'+i.i18n("sort"+t)+"</div>").data("type",t))}),m.children().on("click",function(n){t.exec([],e(this).removeClass(s).attr("rel"))}),e('<div class="'+l+" "+l+'-separated elfinder-sort-ext elfinder-sort-stick"><span class="ui-icon ui-icon-check"/>'+i.i18n("sortFoldersFirst")+"</div>").appendTo(m).on("click",function(){t.exec([],"stick")}),e.fn.elfindertree&&e.inArray("tree",i.options.ui)!==-1&&e('<div class="'+l+" "+l+'-separated elfinder-sort-ext elfinder-sort-tree"><span class="ui-icon ui-icon-check"/>'+i.i18n("sortAlsoTreeview")+"</div>").appendTo(m).on("click",function(){t.exec([],"tree")}),i.bind("disable select",f).getUI().on("click",f),i.bind("open",function(){m.children("[rel]").each(function(){var t=e(this);t.toggle(i.sorters[t.attr("rel")])})}).bind("sortchange",g),m.children().length>1?t.change(function(){n&&cancelAnimationFrame(n),n=requestAnimationFrame(function(){h.toggleClass(r,t.disabled()),g()})}).change():h.addClass(r)})},e.fn.elfinderstat=function(t){return this.each(function(){var n=e(this).addClass("elfinder-stat-size"),i=e('<div class="elfinder-stat-selected"/>').on("click","a",function(n){var i=e(this).data("hash");n.preventDefault(),t.exec("opendir",[i])}),a=t.i18n("items"),o=t.i18n("selected"),r=t.i18n("size"),s=function(i){var o=0,r=0,s=t.cwd(),l=!0,c=!0;(s.sizeInfo||s.size)&&(r=s.size,l=!1),e.each(i,function(e,t){o++,l&&(r+=parseInt(t.size)||0,c!==!0||"directory"!==t.mime||t.sizeInfo||(c=!1))}),n.html(a+': <span class="elfinder-stat-incsearch"></span>'+o+',&nbsp;<span class="elfinder-stat-size'+(c?" elfinder-stat-size-recursive":"")+'">'+t.i18n(c?"sum":"size")+": "+t.formatSize(r)+"</span>").attr("title",n.text()),t.trigger("uistatchange")},l=function(e){n.find("span.elfinder-stat-incsearch").html(e?e.hashes.length+" / ":""),n.attr("title",n.text()),t.trigger("uistatchange")},c=function(n){var a,s,l=0,c=0,d=[];1===n.length?(s=n[0],l=s.size,2===t.searchStatus.state&&(a=t.escape(s.path?s.path.replace(/\/[^\/]*$/,""):".."),d.push('<a href="#elf_'+s.phash+'" data-hash="'+s.hash+'" title="'+a+'">'+a+"</a>")),d.push(t.escape(s.i18||s.name)),i.html(d.join("/")+(l>0?", "+t.formatSize(l):""))):n.length?(e.each(n,function(e,t){c++,l+=parseInt(t.size)||0}),i.html(c?o+": "+c+", "+r+": "+t.formatSize(l):"&nbsp;")):i.html(""),i.attr("title",i.text()),t.trigger("uistatchange")};t.getUI("statusbar").prepend(n).append(i).show(),t.UA.Mobile&&e.fn.tooltip&&t.getUI("statusbar").tooltip({classes:{"ui-tooltip":"elfinder-ui-tooltip ui-widget-shadow"},tooltipClass:"elfinder-ui-tooltip ui-widget-shadow",track:!0}),t.bind("cwdhasheschange",function(n){s(e.map(n.data,function(e){return t.file(e)}))}).change(function(i){var a=i.data.changed||[],o=t.cwd().hash;e.each(a,function(){if(this.hash===o)return this.size&&(n.children(".elfinder-stat-size").addClass("elfinder-stat-size-recursive").html(t.i18n("sum")+": "+t.formatSize(this.size)),n.attr("title",n.text())),!1})}).select(function(){c(t.selectedFiles())}).bind("open",function(){c([])}).bind("incsearch",function(e){l(e.data)}).bind("incsearchend",function(){l()})})},e.fn.elfindertoast=function(t,n){var i=Object.assign({mode:"success",msg:"",showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1500,hideEasing:"swing",onHidden:void 0,timeOut:3e3,extNode:void 0,button:void 0,width:void 0},e.isPlainObject(n.options.uiOptions.toast.defaults)?n.options.uiOptions.toast.defaults:{});return this.each(function(){t=Object.assign({},i,t||{});var a,o=e(this),r=function(e){o.stop(),n.toFront(o),o[t.showMethod]({duration:t.showDuration,easing:t.showEasing,complete:function(){t.onShown&&t.onShown(),!e&&t.timeOut&&(a=setTimeout(s,t.timeOut))}})},s=function(){o[t.hideMethod]({duration:t.hideDuration,easing:t.hideEasing,complete:function(){t.onHidden&&t.onHidden(),o.remove()}})};o.on("click",function(e){e.stopPropagation(),e.preventDefault(),a&&clearTimeout(a),t.onHidden&&t.onHidden(),o.stop().remove()}).on("mouseenter mouseleave",function(e){t.timeOut&&(a&&clearTimeout(a),a=null,"mouseenter"===e.type?r(!0):a=setTimeout(s,t.timeOut))}).hide().addClass("toast-"+t.mode).append(e('<div class="elfinder-toast-msg"/>').html(t.msg.replace(/%([a-zA-Z0-9]+)%/g,function(e,t){return n.i18n(t)}))),t.extNode&&o.append(t.extNode),t.button&&o.append(e('<button class="ui-button ui-widget ui-state-default ui-corner-all elfinder-tabstop"/>').append(e('<span class="ui-button-text"/>').text(n.i18n(t.button.text))).on("mouseenter mouseleave",function(t){e(this).toggleClass("ui-state-hover","mouseenter"==t.type)}).on("click",t.button.click||function(){})),t.width&&o.css("max-width",t.width),r()})},e.fn.elfindertoolbar=function(t,n){return this.not(".elfinder-toolbar").each(function(){var i,a,o,r,s,l,c,d,p,u=t._commands,h=e(this).addClass("ui-helper-clearfix ui-widget-header ui-corner-top elfinder-toolbar"),f={displayTextLabel:!1,labelExcludeUA:["Mobile"],autoHideUA:["Mobile"],showPreferenceButton:"none"},m=function(t){return e.grep(t,function(t){return!e.isPlainObject(t)||(f=Object.assign(f,t),!1)})},g=function(n){var l,c;for(e.each(v,function(e,t){t.detach()}),h.empty(),i=b.length;i--;)if(b[i]){for(r=e('<div class="ui-widget-content ui-corner-all elfinder-buttonset"/>'),a=b[i].length;a--;)l=b[i][a],n&&n[l]||!(o=u[l])||(s="elfinder"+o.options.ui,!v[l]&&e.fn[s]&&(v[l]=e("<div/>")[s](o)),v[l]&&(v[l].children(".elfinder-button-text")[d?"show":"hide"](),r.prepend(v[l])));r.children().length&&h.prepend(r),r.children(":gt(0)").before('<span class="ui-widget-content elfinder-toolbar-button-separator"/>')}(c=u.preference)&&("always"===f.showPreferenceButton||!h.children().length&&"auto"===f.showPreferenceButton)&&(r=e('<div class="ui-widget-content ui-corner-all elfinder-buttonset"/>'),l="preference",s="elfinder"+o.options.ui,v[l]=e("<div/>")[s](c),v[l].children(".elfinder-button-text")[d?"show":"hide"](),r.prepend(v[l]),h.append(r)),!h.data("swipeClose")&&h.children().length?h.show():h.hide(),x=h[0].clientHeight,t.trigger("toolbarload").trigger("uiresize")},v={},b=m(n||[]),y=null,w="",x=0;f.showPreferenceButton=f.showPreferenceButton.toLowerCase(),d=t.storage("toolbarTextLabel"),d=null===d?f.displayTextLabel&&(!f.labelExcludeUA||!f.labelExcludeUA.length||!e.grep(f.labelExcludeUA,function(e){return!!t.UA[e]}).length):1==d,h.on("contextmenu",function(e){e.stopPropagation(),e.preventDefault(),t.trigger("contextmenu",{raw:[{label:t.i18n("textLabel"),icon:"accept",callback:function(){d=!d,h.css("height","").find(".elfinder-button-text")[d?"show":"hide"](),t.trigger("uiresize").storage("toolbarTextLabel",d?"1":"0")}},{label:t.i18n("toolbarPref"),icon:"preference",callback:function(){t.exec("preference",void 0,{tab:"toolbar"})}}],x:e.pageX,y:e.pageY})}).on("touchstart",function(e){e.originalEvent.touches.length>1||(h.data("tmlongtap")&&clearTimeout(h.data("tmlongtap")),h.removeData("longtap").data("longtap",{x:e.originalEvent.touches[0].pageX,y:e.originalEvent.touches[0].pageY}).data("tmlongtap",setTimeout(function(){h.removeData("longtapTm").trigger({type:"contextmenu",pageX:h.data("longtap").x,pageY:h.data("longtap").y}).data("longtap",{longtap:!0})},500)))}).on("touchmove touchend",function(e){h.data("tmlongtap")&&(("touchend"===e.type||Math.abs(h.data("longtap").x-e.originalEvent.touches[0].pageX)+Math.abs(h.data("longtap").y-e.originalEvent.touches[0].pageY)>4)&&clearTimeout(h.data("tmlongtap")),h.removeData("longtapTm"))}).on("click",function(e){h.data("longtap")&&h.data("longtap").longtap&&(e.stopImmediatePropagation(),e.preventDefault())}).on("touchend click",".elfinder-button",function(e){h.data("longtap")&&h.data("longtap").longtap&&(e.stopImmediatePropagation(),e.preventDefault())}),h.prev().length&&h.parent().prepend(this),g(),t.bind("open sync select toolbarpref",function(){var n,i,a,o=Object.assign({},t.option("disabledFlip")),r=t.storage("toolbarhides");if(!r&&Array.isArray(f.defaultHides)&&(r={},e.each(f.defaultHides,function(){r[this]=!0}),t.storage("toolbarhides",r)),"select"===this.type){if(t.searchStatus.state<2)return;i=t.selected(),i.length&&(o=t.getDisabledCmds(i,!0))}e.each(r,function(e){o[e]||(o[e]=!0)}),Object.keys(t.commandMap).length&&e.each(t.commandMap,function(e,t){"hidden"===t&&(o[e]=!0)}),a=Object.keys(o),y&&y.toString()===a.sort().toString()||(g(a.length?o:null),n=!0),y=a.sort(),(n||w!==JSON.stringify(t.commandMap))&&(w=JSON.stringify(t.commandMap),n||e.each(e("div.elfinder-button"),function(){var t=e(this).data("origin");t&&e(this).after(t).detach()}),Object.keys(t.commandMap).length&&e.each(t.commandMap,function(n,i){var a,o=t._commands[i],r=o?"elfinder"+o.options.ui:null;r&&e.fn[r]&&(a=v[n],a&&(!v[i]&&e.fn[r]&&(v[i]=e("<div/>")[r](o),v[i]&&(v[i].children(".elfinder-button-text")[d?"show":"hide"](),o.extendsCmd&&v[i].children("span.elfinder-button-icon").addClass("elfinder-button-icon-"+o.extendsCmd))),v[i]&&(a.after(v[i]),v[i].data("origin",a.detach()))))}))}).bind("resize",function(e){p&&cancelAnimationFrame(p),p=requestAnimationFrame(function(){var e=h[0].clientHeight;x!==e&&(x=e,t.trigger("uiresize"))})}),t.UA.Touch&&(c=t.storage("autoHide")||{},"undefined"==typeof c.toolbar&&(c.toolbar=f.autoHideUA&&f.autoHideUA.length>0&&e.grep(f.autoHideUA,function(e){return!!t.UA[e]}).length,t.storage("autoHide",c)),c.toolbar&&t.one("init",function(){t.uiAutoHide.push(function(){h.stop(!0,!0).trigger("toggle",{duration:500,init:!0})})}),t.bind("load",function(){l=e('<div class="elfinder-toolbar-swipe-handle"/>').hide().appendTo(t.getUI()),"none"!==l.css("pointer-events")&&(l.remove(),l=null)}),h.on("toggle",function(e,n){var i=t.getUI("workzone"),a=h.is(":hidden"),o=i.height(),r=h.height(),s=h.outerHeight(!0),d=s-r,p=Object.assign({step:function(e){i.height(o+(a?(e+d)*-1:r-e)),t.trigger("resize")},always:function(){requestAnimationFrame(function(){h.css("height",""),t.trigger("uiresize"),l&&(a?l.stop(!0,!0).hide():(l.height(n.handleH?n.handleH:""),t.resources.blink(l,"slowonce"))),a&&h.scrollTop("0px"),n.init&&t.trigger("uiautohide")})}},n);h.data("swipeClose",!a).stop(!0,!0).animate({height:"toggle"},p),c.toolbar=!a,t.storage("autoHide",Object.assign(t.storage("autoHide"),{toolbar:c.toolbar}))}).on("touchstart",function(e){h.scrollBottom()>5&&(e.originalEvent._preventSwipeY=!0)}))}),this},e.fn.elfindertree=function(t,n){var i=t.res("class","tree");return this.not("."+i).each(function(){var a,o,r,s,l="class",c=t.UA.Mobile,d=t.res(l,"treeroot"),p=n.openRootOnLoad,u=n.openCwdOnOpen,h=u||n.syncTree,f=t.res(l,"navsubtree"),m=t.res(l,"treedir"),g="span."+m,v=t.res(l,"navcollapse"),b=t.res(l,"navexpand"),y="elfinder-subtree-loaded",w="elfinder-subtree-chksubdir",x=t.res(l,"navarrow"),k=t.res(l,"active"),C=t.res(l,"adroppable"),z=t.res(l,"hover"),T=t.res(l,"disabled"),A=t.res(l,"draggable"),I=t.res(l,"droppable"),S="elfinder-navbar-wrapper-root",O="elfinder-navbar-wrapper-pastable",j="elfinder-navbar-wrapper-uploadable",M=function(e){var t=se.offset().left;return t<=e&&e<=t+se.width()},F={},D=[],U=function(n){var i=[];if(e.each(n,function(e,n){F[n]&&i.push(t.navId2Hash(n)),delete F[n]}),i.length)return t.request({data:{cmd:"subdirs",targets:i,preventDefault:!0}}).done(function(n){n&&n.subdirs&&e.each(n.subdirs,function(n,i){var a=e("#"+t.navHash2Id(n));a.removeClass(w),a[i?"addClass":"removeClass"](v)})})},E=null,P=function(){var n=Object.keys(F);n.length&&(E&&E._abort(),a&&clearTimeout(a),D=[],E=t.asyncJob(function(n){return t.isInWindow(e("#"+n))?n:null},n,{numPerOnce:200}).done(function(e){e.length&&(D=e,q())}))},R=0,q=function(){var e,t=n.subdirsMaxConn-R;if(a&&cancelAnimationFrame(a),D.length)if(t>0)for(e=0;e<t;e++)D.length&&(R++,U(D.splice(0,n.subdirsAtOnce)).always(function(){R--,q()}));else a=requestAnimationFrame(function(){D.length&&q()})},H=t.droppable.drop,_=e.extend(!0,{},t.droppable,{over:function(n,i){var a,o,r=e(this),s=i.helper,l=z+" "+C;return n.stopPropagation(),s.data("dropover",s.data("dropover")+1),r.data("dropover",!0),i.helper.data("namespace")===t.namespace&&M(n.clientX)&&t.insideWorkzone(n.pageX,n.pageY)?(r.addClass(z),r.is("."+v+":not(."+b+")")&&r.data("expandTimer",setTimeout(function(){r.is("."+v+"."+z)&&r.children("."+x).trigger("click")},500)),r.is(".elfinder-ro,.elfinder-na")?(r.removeClass(C),void s.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus")):(a=t.navId2Hash(r.attr("id")),r.data("dropover",a),e.each(i.helper.data("files"),function(e,n){if(n===a||t.file(n).phash===a&&!i.helper.hasClass("elfinder-drag-helper-plus"))return r.removeClass(l),!1}),s.data("locked")?o="elfinder-drag-helper-plus":(o="elfinder-drag-helper-move",(n.shiftKey||n.ctrlKey||n.metaKey)&&(o+=" elfinder-drag-helper-plus")),r.hasClass(C)&&s.addClass(o),void requestAnimationFrame(function(){r.hasClass(C)&&s.addClass(o)}))):(r.removeClass(l),void s.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus"))},out:function(t,n){var i=e(this),a=n.helper;t.stopPropagation(),a.removeClass("elfinder-drag-helper-move elfinder-drag-helper-plus").data("dropover",Math.max(a.data("dropover")-1,0)),i.data("expandTimer")&&clearTimeout(i.data("expandTimer")),i.removeData("dropover").removeClass(z+" "+C)},deactivate:function(){e(this).removeData("dropover").removeClass(z+" "+C)},drop:function(e,t){M(e.clientX)&&H.call(this,e,t)}}),N=e(t.res("tpl","navspinner")),L=t.res("tpl","navdir"),W=t.res("tpl","perms"),B=(t.res("tpl","lock"),t.res("tpl","symlink")),$={},K={id:function(e){return t.navHash2Id(e.hash)},name:function(e){return t.escape(e.i18||e.name)},cssclass:function(e){var i=(e.phash&&!e.isroot?"":d)+" "+m+" "+t.perms2class(e);return e.dirs&&!e.link&&(i+=" "+v)&&e.dirs==-1&&(i+=" "+w),n.getClass&&(i+=" "+n.getClass(e)),e.csscls&&(i+=" "+t.escape(e.csscls)),i},root:function(t){var n="";return!t.phash||t.isroot?(n+=" "+S,!t.disabled||t.disabled.length<1?n+=" "+O+" "+j:(e.inArray("paste",t.disabled)===-1&&(n+=" "+O),e.inArray("upload",t.disabled)===-1&&(n+=" "+j)),n):""},permissions:function(e){return e.read&&e.write?"":W},symlink:function(e){return e.alias?B:""},style:function(e){return e.icon?t.getIconStyle(e):""}},V=function(e){return L.replace(/(?:\{([a-z]+)\})/gi,function(t,n){var i=K[n]?K[n](e):e[n]||"";return"id"===n&&e.dirs==-1&&(F[i]=i),i})},X=function(n,i){return e.map(n||[],function(n){return"directory"!==n.mime||i&&!e("#"+t.navHash2Id(n.hash)).length?null:n})},G=function(n){return n?e("#"+t.navHash2Id(n)).next("."+f):oe},J=function(e,n){for(var i,a=e.children(":first");a.length;){if(i=t.file(t.navId2Hash(a.children("[id]").attr("id"))),(i=t.file(t.navId2Hash(a.children("[id]").attr("id"))))&&Q(n,i)<0)return a;a=a.next()}return e.children("button.elfinder-navbar-pager-next")},Y=function(i){for(var a,o,r,s,l,d,p=i.length,u=[],h=p,f=e(),m={},g=t.cwd(),v=function(i,a,o,r){var s={},l=0,d=t.newAPI?Math.min(1e4,Math.max(10,n.subTreeMax)):1e4,p=function(){s={},e.each(a,function(e,t){s[t.hash]=e})},u=function(t){"prepare"===t?e.each(a,function(e,t){t.node&&i.append(t.node.hide())}):"done"===t&&e.each(a,function(e,t){t.node&&t.node.detach().show()})},h=function(t,n){var i;return t.stopPropagation(),n.select?void v(f(n.select)):n.change?void u(n.change):(n.removed&&n.removed.length&&(a=e.grep(a,function(e){return n.removed.indexOf(e.hash)===-1||(!i&&(i=!0),!1)})),n.added&&n.added.length&&(a=a.concat(e.grep(n.added,function(e){return void 0===s[e.hash]&&(!i&&(i=!0),!0)}))),void(i&&(a.sort(Q),p(),v(l))))},f=function(e){if(void 0!==s[e])return Math.floor(s[e]/d)*d},m=t.navId2Hash(i.prev("[id]").attr("id")),v=function(n,o){var r,s,u,y,w,x,k,C,z=[],T={};delete $[m],l=n,i.off("update."+t.namespace,h),a.length>d&&(i.on("update."+t.namespace,h),void 0===n&&(u=0,p(),n=f(g.hash),void 0===n&&(n=0)),y=a.slice(n,n+d),$[m]=i,w=n?Math.max(-1,n-d):-1,x=n+d>=a.length?0:n+d,r=Math.ceil(a.length/d),s=Math.ceil(n/d)),e.each(y||a,function(e,t){z.push(V(t)),t.node&&(T[t.hash]=t.node)}),k=w>-1?e('<button class="elfinder-navbar-pager elfinder-navbar-pager-prev"/>').text(t.i18n("btnPrevious",s,r)).button({icons:{primary:"ui-icon-caret-1-n"}}).on("click",function(e){e.preventDefault(),e.stopPropagation(),v(w,"up")}):e(),C=x?e('<button class="elfinder-navbar-pager elfinder-navbar-pager-next"/>').text(t.i18n("btnNext",s+2,r)).button({icons:{primary:"ui-icon-caret-1-s"}}).on("click",function(e){e.preventDefault(),e.stopPropagation(),v(x,"down")}):e(),b(),i.empty()[y?"addClass":"removeClass"]("elfinder-navbar-hasmore").append(k,z.join(""),C),e.each(T,function(n,i){e("#"+t.navHash2Id(n)).parent().replaceWith(i)}),o&&Z(t.navHash2Id(y["up"===o?y.length-1:0].hash)),!c&&t.lazy(function(){ie(null,i)})},b=function(){e.each(i.children(".elfinder-navbar-wrapper"),function(n,i){var o,r,l=e(i),c=l.children("[id]:first");c.hasClass(y)&&(o=t.navId2Hash(c.attr("id")),o&&void 0!==(r=s[o])&&(a[r].node=l.detach()))})};v()},b={},w=[],x=!0;h--;)a=i[h],m[a.hash]||e("#"+t.navHash2Id(a.hash)).length||(m[a.hash]=!0,(o=G(a.phash)).length?a.phash&&((s=!o.children().length)||o.hasClass("elfinder-navbar-hasmore")||(r=J(o,a)).length)?s?(b[a.phash]||(b[a.phash]=[]),b[a.phash].push(a)):r?(d=V(a),r.before(d),!c&&(f=f.add(d))):w.push(a):(d=V(a),o[x||a.phash?"append":"prepend"](d),x=!1,a.phash&&!a.isroot||(l=e("#"+t.navHash2Id(a.hash)).parent()),!c&&ie(null,l)):u.push(a));return Object.keys(b).length&&e.each(b,function(e,t){var n=G(e);t.sort(Q),v(n,t)}),w.length&&o.trigger("update."+t.namespace,{added:w}),u.length&&u.length<p?void Y(u):void(!c&&f.length&&t.lazy(function(){ie(f)}))},Q=function(e,n){if(t.sortAlsoTreeview){var i,a="asc"==t.sortOrder,o=t.sortType,r=t.sortRules;return i=a?r[t.sortType](e,n):r[t.sortType](n,e),"name"!==o&&0===i?i=a?r.name(e,n):r.name(n,e):i}return t.sortRules.name(e,n)},Z=function(i){var a,r,s,l,c,d,p=e.Deferred();return o&&clearTimeout(o),o=setTimeout(function(){a=e("#"+(i||t.navHash2Id(t.cwd().hash))),a.length?((u?a:a.parent()).parents(".elfinder-navbar-wrapper").children("."+y).addClass(b).next("."+f).show(),r=oe.parent().stop(!1,!0),s=r.offset().top,l=r.height(),c=s+l-a.outerHeight(),d=a.offset().top,d<s||d>c?r.animate({scrollTop:r.scrollTop()+d-s-l/3},{duration:n.durations.autoScroll,complete:function(){p.resolve()}}):p.resolve()):p.reject()},100),p},ee=function(n){var i,a,o,r=n||t.cwd(),s=r.hash?[r.hash]:[];for(a=t.root(r.hash),o=t.file(a);o&&(i=o.phash)&&(s.unshift(i),a=t.root(i),o=t.file(a),!e("#"+t.navHash2Id(o.hash)).hasClass(y)););return s},te=function(n){var i=n||t.cwd(),a=i.hash,o=e("#"+t.navHash2Id(a));if(!o.length){for(;i&&i.phash;)$[i.phash]&&!e("#"+t.navHash2Id(i.hash)).length&&$[i.phash].trigger("update."+t.namespace,{select:i.hash}),i=t.file(i.phash);o=e("#"+t.navHash2Id(a))}return o},ne=function(n,i){var a,o,s=t.cwd(),l=s.hash,c=void 0===i?h:i,d=function(n){var i,r,s=e.Deferred(),l=[],d=ee(n),p=function(e,n,i){var a={cmd:e,target:n};return i&&(a.until=i),t.request({data:a,preventFail:!0})};return l=e.map(d,function(n){var a,o,r=t.file(n),s=!!r&&t.isRoot(r),l=e("#"+t.navHash2Id(n)),c=function(e,n){var i,a,o=n||1;return a=!!(i=t.file(e))&&i.phash,a&&o>1?c(a,--o):a},d=function(){var i=c(n);for(a=i;i&&!e("#"+t.navHash2Id(i)).hasClass(y);)a=i,i=c(i);return i||(a=void 0,i=t.root(n)),i}();return l.hasClass(y)||!s&&r&&e("#"+t.navHash2Id(r.phash)).hasClass(y)?null:(s||d===c(n)||d===c(n,2)?(a=void 0,o="tree",s||(n=c(n))):o="parents",i||(i="tree"===o?n:d),p(o,n,a))}),l.length?(te(t.file(i)),r=t.navHash2Id(i),c&&Z(r),a=e("#"+r),o=e(t.res("tpl","navspinner")).insertBefore(a.children("."+x)),a.removeClass(v),e.when.apply(e,l).done(function(){var e,t,n,i={};if(t=arguments.length,t>0)for(n=0;n<t;n++)e=arguments[n].tree||[],i[d[n]]=Object.assign([],X(e));s.resolve(i)}).fail(function(){s.reject()}),s):s.resolve()},u=function(i,o){var r,l=function(){p&&a&&(G(a.hash).show().prev(g).addClass(b),p=!1),c?Z().done(P):P()};i&&e.each(i,function(e,n){n&&Y(n),te(t.file(e)),n&&ae(n,y)}),n&&(t.api<2.1&&n.push(s),Y(n)),r=te(),r.hasClass(k)||(oe.find(g+"."+k).removeClass(k),r.addClass(k)),r.parents(".elfinder-navbar-wrapper").children("."+m).addClass(y),i?t.lazy(l).done(function(){o.resolve()}):(l(),o.resolve())},f=function(e){a&&(o.remove(),a.addClass(v+(e?"":" "+y)))},w=e.Deferred();return e("#"+t.navHash2Id(l)).length?u(void 0,w):(r=!0,d().done(function(e){u(e,w),f()}).fail(function(){f(!0),w.reject()}).always(function(){r=!1})),t.trigger("treesync",w),w},ie=function(n,i){n||(i&&!i.closest("div."+S).hasClass(j)||(i||oe.find("div."+j)).find(g+":not(.elfinder-ro,.elfinder-na)").addClass("native-droppable"),n=!i||i.closest("div."+S).hasClass(O)?(i||oe.find("div."+O)).find(g+":not(."+I+")"):e(),i&&i.children("div."+S).each(function(){ie(null,e(this))})),n.length&&t.asyncJob(function(t){e(t).droppable(_)},e.makeArray(n),{interval:20,numPerOnce:100})},ae=function(n,i){var a=i==y?"."+v+":not(."+y+")":":not(."+v+")";e.each(n,function(n,o){e("#"+t.navHash2Id(o.phash)+a).filter(function(){return e.grep(e(this).next("."+f).children(),function(t){return!e(t).children().hasClass(d)}).length>0}).addClass(i)})},oe=e(this).addClass(i).on("mouseenter mouseleave",g,function(n){var i="mouseenter"===n.type;if(!i||!re){var a=e(this);a.hasClass(C+" "+T)||(c||!i||a.data("dragRegisted")||a.hasClass(d+" "+A+" elfinder-na elfinder-wo")||(a.data("dragRegisted",!0),t.isCommandEnabled("copy",t.navId2Hash(a.attr("id")))&&a.draggable(t.draggable)),a.toggleClass(z,i))}}).on("dragenter",g,function(t){if(t.originalEvent.dataTransfer){var n=e(this);n.addClass(z),n.is("."+v+":not(."+b+")")&&n.data("expandTimer",setTimeout(function(){n.is("."+v+"."+z)&&n.children("."+x).trigger("click")},500))}}).on("dragleave",g,function(t){if(t.originalEvent.dataTransfer){var n=e(this);n.data("expandTimer")&&clearTimeout(n.data("expandTimer")),n.removeClass(z)}}).on("click",g,function(n){var i=e(this),a=t.navId2Hash(i.attr("id"));t.file(a);return i.data("longtap")?(i.removeData("longtap"),void n.stopPropagation()):(i.hasClass(k)||(oe.find(g+"."+k).removeClass(k),i.addClass(k)),void(a==t.cwd().hash||i.hasClass(T)?(i.hasClass(v)&&i.children("."+x).trigger("click"),t.select({selected:[a],origin:"navbar"})):t.exec("open",a).done(function(){t.one("opendone",function(){t.select({selected:[a],origin:"navbar"})})})))}).on("touchstart",g,function(n){if(!(n.originalEvent.touches.length>1)){var i,a=n.originalEvent;return"INPUT"===n.target.nodeName?void n.stopPropagation():void(i=e(this).addClass(z).removeData("longtap").data("tmlongtap",setTimeout(function(e){i.data("longtap",!0),t.trigger("contextmenu",{type:"navbar",targets:[t.navId2Hash(i.attr("id"))],x:a.touches[0].pageX,y:a.touches[0].pageY})},500)))}}).on("touchmove touchend",g,function(t){return"INPUT"===t.target.nodeName?void t.stopPropagation():(clearTimeout(e(this).data("tmlongtap")),void("touchmove"==t.type&&e(this).removeClass(z)))}).on("click",g+"."+v+" ."+x,function(i){var a,o=e(this),r=o.parent(g),s=r.next("."+f),l=e.Deferred(),c=30;i.stopPropagation(),r.hasClass(y)?(r.toggleClass(b),t.lazy(function(){a=r.hasClass(b)?s.children().length+s.find("div.elfinder-navbar-subtree[style*=block]").children().length:s.find("div:visible").length,a>c?(s.toggle(),t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1),P()):s.stop(!0,!0)[r.hasClass(b)?"slideDown":"slideUp"](n.durations.slideUpDown,function(){t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1),P()})}).always(function(){l.resolve()})):(N.insertBefore(o),r.removeClass(v),t.request({cmd:"tree",target:t.navId2Hash(r.attr("id"))}).done(function(e){Y(Object.assign([],X(e.tree))),s.children().length&&(r.addClass(v+" "+b),s.children().length>c?(s.show(),t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1),P()):s.stop(!0,!0).slideDown(n.durations.slideUpDown,function(){t.draggingUiHelper&&t.draggingUiHelper.data("refreshPositions",1),P()}))}).always(function(e){N.remove(),r.addClass(y),t.one("treedone",function(){l.resolve()})})),o.data("dfrd",l)}).on("contextmenu",g,function(n){var i=e(this);return i.find("input:text").length?void n.stopPropagation():(n.preventDefault(),t.trigger("contextmenu",{type:"navbar",targets:[t.navId2Hash(e(this).attr("id"))],x:n.pageX,y:n.pageY}),i.addClass("ui-state-hover"),t.getUI("contextmenu").children().on("mouseenter",function(){i.addClass("ui-state-hover")}),void t.bind("closecontextmenu",function(){i.removeClass("ui-state-hover")}))}).on("scrolltoview",g,function(n,i){var a=e(this);Z(a.attr("id")).done(function(){i&&"undefined"!==i.blink&&!i.blink||t.resources.blink(a,"lookme")})}).on("create."+t.namespace,function(n,i){var a=G(i.phash),o=i.move||!1,r=e(V(i)).addClass("elfinder-navbar-wrapper-tmp"),s=t.selected();o&&s.length&&t.trigger("lockfiles",{files:s}),a.prepend(r)}),re=!1,se=t.getUI("navbar").append(oe).show().on("scroll",function(){re=!0,s&&cancelAnimationFrame(s),s=requestAnimationFrame(function(){re=!1,P()})}),le=t.sortAlsoTreeview;t.open(function(e){var n=e.data,i=X(n.files),a=t.getUI("contextmenu");n.init&&oe.empty(),t.UA.iOS&&se.removeClass("overflow-scrolling-touch").addClass("overflow-scrolling-touch"),i.length?t.lazy(function(){a.data("cmdMaps")||a.data("cmdMaps",{}),Y(i),ae(i,y),ne(i)}):ne()}).add(function(e){var t=X(e.data.added);t.length&&(Y(t),ae(t,v))}).change(function(n){if(!r){var i,a,o,s,l,d,p,u,h,m,v,w,x=X(n.data.changed,!0),k=x.length,C=k;e();for(e.each($,function(e,n){n.trigger("update."+t.namespace,{change:"prepare"})});C--;)if(i=x[C],a=i.phash,(o=e("#"+t.navHash2Id(i.hash))).length){if(v=o.parent(),a){if(l=o.closest("."+f),d=G(a),p=o.parent().next(),u=J(d,i),!d.length)continue;d[0]===l[0]&&p.get(0)===u.get(0)||(u.length?u.before(v):d.append(v))}h=o.hasClass(b),m=o.hasClass(y),s=e(V(i)),o.replaceWith(s.children(g)),!c&&ie(null,v),i.dirs&&(h||m)&&(o=e("#"+t.navHash2Id(i.hash)))&&o.next("."+f).children().length&&(h&&o.addClass(b),m&&o.addClass(y)),w|=i.dirs==-1}w&&P(),e.each($,function(e,n){n.trigger("update."+t.namespace,{change:"done"})}),k&&ne(void 0,!1)}}).remove(function(n){var i,a,o,r=n.data.removed,s=r.length;for(e.each($,function(e,n){n.trigger("update."+t.namespace,{removed:r}),n.trigger("update."+t.namespace,{change:"prepare"})});s--;)(i=e("#"+t.navHash2Id(r[s]))).length&&(o=!0,a=i.closest("."+f),i.parent().detach(),a.children().length||a.hide().prev(g).removeClass(v+" "+b+" "+y));o&&t.getUI("navbar").children(".ui-resizable-handle").trigger("resize"),e.each($,function(e,n){n.trigger("update."+t.namespace,{change:"done"})})}).bind("lockfiles unlockfiles",function(n){var i="lockfiles"==n.type,a=!!n.data.helper&&n.data.helper.data("locked"),o=i&&!a?"disable":"enable",r=e.grep(n.data.files||[],function(e){var n=t.file(e);return!(!n||"directory"!=n.mime)});e.each(r,function(n,r){var s=e("#"+t.navHash2Id(r));s.length&&!a&&(s.hasClass(A)&&s.draggable(o),s.hasClass(I)&&s.droppable(o),s[i?"addClass":"removeClass"](T))})}).bind("sortchange",function(){if(t.sortAlsoTreeview||le!==t.sortAlsoTreeview){var n,i,a=[],o={},r={},s="",l=!1;t.lazy(function(){n=X(t.files()),le=t.sortAlsoTreeview,oe.empty(),Y(e.map(t.roots,function(e){var n=t.file(e);return n&&!n.phash?n:null})),Object.keys($).length?(a=ee(),a.length>1?(e.each(a,function(e,n){var i=t.file(t.root(n)).volumeid;0===e&&(s=i),r[i]=n,o[n]=[]}),e.each(n,function(e,t){return t.volumeid?void o[r[t.volumeid]||r[s]].push(t):(l=!0,!1)})):l=!0,l?e.each(a,function(e,a){Y(n),i=te(t.file(a)),ae(n,y)}):e.each(o,function(e,n){Y(n),i=te(t.file(e)),ae(n,y)})):(Y(n),i=te(),ae(n,y)),ne()},100)}})}),this},e.fn.elfinderuploadbutton=function(t){return this.each(function(){var n,i=t.fm,a=e(this).elfinderbutton(t).off("click"),o=e("<form/>").appendTo(a),r=e('<input type="file" multiple="true" title="'+t.fm.i18n("selectForUpload")+'"/>').on("change",function(){var t=e(this);t.val()&&(i.exec("upload",{input:t.remove()[0]},void 0,i.cwd().hash),r.clone(!0).appendTo(o))}).on("dragover",function(e){e.originalEvent.dataTransfer.dropEffect="copy"});o.append(r.clone(!0)),t.change(function(){n&&cancelAnimationFrame(n),n=requestAnimationFrame(function(){var e=t.disabled();o.is("visible")?!e&&o.hide():e&&o.show()})}).change()})},e.fn.elfinderviewbutton=function(t){return this.each(function(){var n,i=e(this).elfinderbutton(t),a=i.children(".elfinder-button-icon"),o=i.children(".elfinder-button-text");t.change(function(){n&&cancelAnimationFrame(n),n=requestAnimationFrame(function(){var e="icons"==t.value;a.toggleClass("elfinder-button-icon-view-list",e),t.className=e?"view-list":"",t.title=t.fm.i18n(e?"viewlist":"viewicons"),i.attr("title",t.title),o.html(t.title)})})})},e.fn.elfinderworkzone=function(t){var n="elfinder-workzone";return this.not("."+n).each(function(){var i=e(this).addClass(n),a=i.outerHeight(!0)-i.height(),o=Math.round(i.height()),r=i.parent(),s=function(s){var l=r.height()-a,c=r.attr("style"),d=Math.round(i.height());s&&(s.preventDefault(),s.stopPropagation()),r.css("overflow","hidden").children(":visible:not(."+n+")").each(function(){var t=e(this);"absolute"!=t.css("position")&&"fixed"!=t.css("position")&&(l-=t.outerHeight(!0))}),r.attr("style",c||""),l=Math.max(0,Math.round(l)),o===l&&d===l||(o=Math.round(i.height()),i.height(l),t.trigger("wzresize"))},l=function(){a=i.outerHeight(!0)-i.height(),s()};r.on("resize."+t.namespace,s),t.one("cssloaded",l).bind("uiresize",s)}),this},i.prototype.commands.archive=function(){var t,n=this,i=n.fm,a=[];this.variants=[],this.disableOnSearch=!1,this.nextAction={},i.bind("open reload",function(){n.variants=[],e.each(a=i.option("archivers").create||[],function(e,t){n.variants.push([t,i.mime2kind(t)])}),n.change()}),this.getstate=function(n){var o,r=this.files(n),s=r.length,l=s&&!i.isRoot(r[0])&&(i.file(r[0].phash)||{}).write&&!e.grep(r,function(e){return!e.read}).length;return l&&i.searchStatus.state>1&&(o=i.cwd().volumeid,l=s===e.grep(r,function(e){return!(!e.read||0!==e.hash.indexOf(o))}).length),l&&!this._disabled&&a.length&&(s||t&&"pending"==t.state())?0:-1},this.exec=function(o,r){var s,l,c=this.files(o),d=c.length,p=r||a[0],u=i.file(c[0].phash)||null,h=["errArchive","errPerm","errCreatingTempDir","errFtpDownloadFile","errFtpUploadFile","errFtpMkdir","errArchiveExec","errExtractExec","errRm"];if(t=e.Deferred().fail(function(e){e&&i.error(e)}),!d||!a.length||e.inArray(p,a)===-1)return t.reject();if(!u.write)return t.reject(h);for(s=0;s<d;s++)if(!c[s].read)return t.reject(h);return n.mime=p,n.prefix=(d>1?"Archive":c[0].name)+(i.option("archivers").createext?"."+i.option("archivers").createext[p]:""),n.data={targets:n.hashes(o),type:p},i.cwd().hash!==u.hash?l=i.exec("open",u.hash).done(function(){i.one("cwdrender",function(){i.selectfiles({files:o}),t=e.proxy(i.res("mixin","make"),n)()})}):(i.selectfiles({files:o}),t=e.proxy(i.res("mixin","make"),n)()),t}},(i.prototype.commands.back=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+left backspace"}],this.getstate=function(){return this.fm.history.canBack()?0:-1},this.exec=function(){return this.fm.history.back()}}).prototype={forceLoad:!0},i.prototype.commands.chmod=function(){this.updateOnSelect=!1;var t=this.fm,n={0:"owner",1:"group",2:"other"},i={read:t.i18n("read"),write:t.i18n("write"),execute:t.i18n("execute"),perm:t.i18n("perm"),kind:t.i18n("kind"),files:t.i18n("files")},a=function(e){return!isNaN(parseInt(e,8)&&parseInt(e,8)<=511)||e.match(/^([r-][w-][x-]){3}$/i)};this.tpl={main:'<div class="ui-helper-clearfix elfinder-info-title"><span class="elfinder-cwd-icon {class} ui-corner-all"/>{title}</div>{dataTable}',itemTitle:'<strong>{name}</strong><span id="elfinder-info-kind">{kind}</span>',groupTitle:"<strong>{items}: {num}</strong>",dataTable:'<table id="{id}-table-perm"><tr><td>{0}</td><td>{1}</td><td>{2}</td></tr></table><div class="">'+i.perm+': <input class="elfinder-tabstop elfinder-focus" id="{id}-perm" type="text" size="4" maxlength="3" value="{value}"></div>',fieldset:'<fieldset id="{id}-fieldset-{level}"><legend>{f_title}{name}</legend><input type="checkbox" value="4" class="elfinder-tabstop" id="{id}-read-{level}-perm"{checked-r}> <label for="{id}-read-{level}-perm">'+i.read+'</label><br><input type="checkbox" value="6" class="elfinder-tabstop" id="{id}-write-{level}-perm"{checked-w}> <label for="{id}-write-{level}-perm">'+i.write+'</label><br><input type="checkbox" value="5" class="elfinder-tabstop" id="{id}-execute-{level}-perm"{checked-x}> <label for="{id}-execute-{level}-perm">'+i.execute+"</label><br>"
},this.shortcuts=[{}],this.getstate=function(e){var t=this.fm;return e=e||t.selected(),0==e.length&&(e=[t.cwd().hash]),this.checkstate(this.files(e))?0:-1},this.checkstate=function(t){var n=t.length;if(!n)return!1;var i=e.grep(t,function(e){return!(!(e.isowner&&e.perm&&a(e.perm))||1!=n&&"directory"==e.mime)}).length;return n==i},this.exec=function(t){var o=this.hashes(t),r=this.files(o);r.length||(o=[this.fm.cwd().hash],r=this.files(o));var s,l,c=this.fm,d=e.Deferred().always(function(){c.enable()}),p=this.tpl,u=r.length,h=r[0],f=c.namespace+"-perm-"+h.hash,m=p.main,g=' checked="checked"',v=function(){var e={};return e[c.i18n("btnApply")]=b,e[c.i18n("btnCancel")]=function(){A.elfinderdialog("close")},e},b=function(){var t,n=e.trim(e("#"+f+"-perm").val());return!!a(n)&&(A.elfinderdialog("close"),t={cmd:"chmod",targets:o,mode:n},void c.request({data:t,notify:{type:"chmod",cnt:u}}).fail(function(e){d.reject(e)}).done(function(n){n.changed&&n.changed.length&&(n.undo={cmd:"chmod",callback:function(){var t=[];return e.each(I,function(e,n){t.push(c.request({data:{cmd:"chmod",targets:n,mode:e},notify:{type:"undo",cnt:n.length}}))}),e.when.apply(null,t)}},n.redo={cmd:"chmod",callback:function(){return c.request({data:t,notify:{type:"redo",cnt:o.length}})}}),d.resolve(n)}))},y=function(){for(var t,i="",a=0;a<3;a++)t=0,e("#"+f+"-read-"+n[a]+"-perm").is(":checked")&&(t=4|t),e("#"+f+"-write-"+n[a]+"-perm").is(":checked")&&(t=2|t),e("#"+f+"-execute-"+n[a]+"-perm").is(":checked")&&(t=1|t),i+=t.toString(8);e("#"+f+"-perm").val(i)},w=function(t){for(var i,a=0;a<3;a++)i=parseInt(t.slice(a,a+1),8),e("#"+f+"-read-"+n[a]+"-perm").prop("checked",!1),e("#"+f+"-write-"+n[a]+"-perm").prop("checked",!1),e("#"+f+"-execute-"+n[a]+"-perm").prop("checked",!1),4==(4&i)&&e("#"+f+"-read-"+n[a]+"-perm").prop("checked",!0),2==(2&i)&&e("#"+f+"-write-"+n[a]+"-perm").prop("checked",!0),1==(1&i)&&e("#"+f+"-execute-"+n[a]+"-perm").prop("checked",!0);y()},x=function(e){for(var t,n,i,a="777",o="",r=e.length,s=0;s<r;s++){t=z(e[s].perm),I[t]||(I[t]=[]),I[t].push(e[s].hash),o="";for(var l=0;l<3;l++)n=parseInt(t.slice(l,l+1),8),i=parseInt(a.slice(l,l+1),8),4!=(4&n)&&4==(4&i)&&(i-=4),2!=(2&n)&&2==(2&i)&&(i-=2),1!=(1&n)&&1==(1&i)&&(i-=1),o+=i.toString(8);a=o}return a},k=function(e){return e?":"+e:""},C=function(e,t){for(var a,o,r="",s=p.dataTable,l=0;l<3;l++)a=parseInt(e.slice(l,l+1),8),r+=a.toString(8),o=p.fieldset.replace("{f_title}",c.i18n(n[l])).replace("{name}",k(t[n[l]])).replace(/\{level\}/g,n[l]),s=s.replace("{"+l+"}",o).replace("{checked-r}",4==(4&a)?g:"").replace("{checked-w}",2==(2&a)?g:"").replace("{checked-x}",1==(1&a)?g:"");return s=s.replace("{value}",r).replace("{valueCaption}",i.perm)},z=function(e){if(isNaN(parseInt(e,8))){for(var t=e.split(""),n=[],i=0,a=t.length;i<a;i++)0===i||3===i||6===i?t[i].match(/[r]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0):1===i||4===i||7===i?t[i].match(/[w]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0):t[i].match(/[x]/i)?n.push(1):t[i].match(/[-]/)&&n.push(0);n.splice(3,0,","),n.splice(7,0,",");for(var o=n.join(""),r=o.split(","),s=[],l=0,c=r.length;l<c;l++){var d=parseInt(r[l],2).toString(8);s.push(d)}e=s.join("")}else e=parseInt(e,8).toString(8);return e},T={title:this.title,width:"auto",buttons:v(),close:function(){e(this).elfinderdialog("destroy")}},A=c.getUI().find("#"+f),I={},S="";return A.length?(A.elfinderdialog("toTop"),e.Deferred().resolve()):(m=m.replace("{class}",u>1?"elfinder-cwd-icon-group":c.mime2class(h.mime)),u>1?s=p.groupTitle.replace("{items}",c.i18n("items")).replace("{num}",u):(s=p.itemTitle.replace("{name}",h.name).replace("{kind}",c.mime2kind(h)),S=c.tmb(h)),l=C(x(r),1==r.length?r[0]:{}),m=m.replace("{title}",s).replace("{dataTable}",l).replace(/{id}/g,f),A=c.dialog(m,T),A.attr("id",f),S&&e("<img/>").on("load",function(){A.find(".elfinder-cwd-icon").addClass(S.className).css("background-image","url('"+S.url+"')")}).attr("src",S.url),e("#"+f+"-table-perm :checkbox").on("click",function(){y("perm")}),e("#"+f+"-perm").on("keydown",function(t){var n=t.keyCode;if(n==e.ui.keyCode.ENTER)return t.stopPropagation(),void b()}).on("focus",function(t){e(this).trigger("select")}).on("keyup",function(t){3==e(this).val().length&&(e(this).trigger("select"),w(e(this).val()))}),d)}},i.prototype.commands.colwidth=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.getstate=function(){return"fixed"===this.fm.getUI("cwd").find("table").css("table-layout")?0:-1},this.exec=function(){return this.fm.getUI("cwd").trigger("colwidth"),e.Deferred().resolve()}},i.prototype.commands.copy=function(){this.shortcuts=[{pattern:"ctrl+c ctrl+insert"}],this.getstate=function(t){var n=this.files(t),i=n.length;return i&&e.grep(n,function(e){return!!e.read}).length==i?0:-1},this.exec=function(t){var n=this.fm,i=e.Deferred().fail(function(e){n.error(e)});return e.each(this.files(t),function(e,t){if(!t.read)return!i.reject(["errCopy",t.name,"errPerm"])}),"rejected"==i.state()?i:i.resolve(n.clipboard(this.hashes(t)))}},i.prototype.commands.cut=function(){var t=this.fm;this.shortcuts=[{pattern:"ctrl+x shift+insert"}],this.getstate=function(n){var i=this.files(n),a=i.length;return a&&e.grep(i,function(e){return!(!e.read||e.locked||t.isRoot(e))}).length==a?0:-1},this.exec=function(n){var i=e.Deferred().fail(function(e){t.error(e)});return e.each(this.files(n),function(e,n){return!n.read||n.locked||t.isRoot(n)?!i.reject(["errCopy",n.name,"errPerm"]):n.locked?!i.reject(["errLocked",n.name]):void 0}),"rejected"==i.state()?i:i.resolve(t.clipboard(this.hashes(n),!0))}},i.prototype.commands.zipdl=function(){},i.prototype.commands.download=function(){var t=this,n=this.fm,i=null,a=!1,o=!1,r=!1,s=window.location.pathname||"/",l=function(r,s){var l,c;if(null!==i&&(n.searchStatus.state>1?o=n.searchStatus.mixed:n.leafRoots[n.cwd().hash]&&(l=n.cwd().volumeid,e.each(r,function(e,t){if(0!==t.indexOf(l))return o=!0,!1})),a=n.isCommandEnabled("zipdl",r[0])),o){if(c=i?"zipdl":"download",r=e.grep(r,function(t){var a=n.file(t),o=!(!a||!i&&"directory"===a.mime||!n.isCommandEnabled(c,t));return a&&s&&!o&&e("#"+n.cwdHash2Id(a.hash)).trigger("unselect"),o}),!r.length)return[]}else if(!n.isCommandEnabled("download",r[0]))return[];return e.grep(t.files(r),function(t){var i=!(!t.read||!a&&"directory"==t.mime);return s&&!i&&e("#"+n.cwdHash2Id(t.hash)).trigger("unselect"),i})};this.linkedCmds=["zipdl"],this.shortcuts=[{pattern:"shift+enter"}],this.getstate=function(e){var t=this.hashes(e),i=t.length,o=this.options.maxRequests||10;return i<1?-1:(i=l(t).length,i&&(a||i<=o&&(!n.UA.IE&&!n.UA.Mobile||1==i))?0:-1)},n.bind("contextmenu",function(n){var i,a,o=t.fm,r=null,s=function(t){var n=t.url||o.url(t.hash);return{icon:"link",node:e("<a/>").attr({href:n,target:"_blank",title:o.i18n("link")}).text(t.name).on("mousedown click touchstart touchmove touchend contextmenu",function(e){e.stopPropagation()}).on("dragstart",function(n){var i=n.dataTransfer||n.originalEvent.dataTransfer||null;if(r=null,i){var a=function(t){var n,i=t.mime,a=o.tmb(t);return n='<div class="elfinder-cwd-icon '+o.mime2class(i)+' ui-corner-all"/>',a&&(n=e(n).addClass(a.className).css("background-image","url('"+a.url+"')").get(0).outerHTML),n};i.effectAllowed="copyLink",i.setDragImage&&(r=e('<div class="elfinder-drag-helper html5-native">').append(a(t)).appendTo(e(document.body)),i.setDragImage(r.get(0),50,47)),o.UA.IE||(i.setData("elfinderfrom",window.location.href+t.phash),i.setData("elfinderfrom:"+i.getData("elfinderfrom"),""))}}).on("dragend",function(e){r&&r.remove()})}};if(t.extra=null,n.data&&(i=n.data.targets||[],1===i.length&&(a=o.file(i[0]))&&"directory"!==a.mime))if("1"!=a.url)t.extra=s(a);else{var l;t.extra={icon:"link",node:e("<a/>").attr({href:"#",title:o.i18n("getLink"),draggable:"false"}).text(a.name).on("click touchstart",function(e){if(!("touchstart"===e.type&&e.originalEvent.touches.length>1)){var t=l.parent();e.stopPropagation(),e.preventDefault(),t.removeClass("ui-state-disabled").addClass("elfinder-button-icon-spinner"),o.request({data:{cmd:"url",target:a.hash},preventDefault:!0}).always(function(e){if(t.removeClass("elfinder-button-icon-spinner"),e.url){var n=o.file(a.hash);n.url=e.url,l.replaceWith(s(a).node)}else t.addClass("ui-state-disabled")})}})},l=t.extra.node,l.ready(function(){requestAnimationFrame(function(){l.parent().addClass("ui-state-disabled").css("pointer-events","auto")})})}}).one("open",function(){n.api>=2.1012&&(i=n.getCommand("zipdl")),r=n.api>2.1038&&!n.isCORS}),this.exec=function(t){var n,i,c,d,p,u,h,f=this.hashes(t),m=this.fm,g=(m.options.url,l(f,!0)),v=e.Deferred(),b="",y={},w=!1,x=function(t){return function(){var n,a,o,r=e.Deferred(),s=m.file(m.root(t[0])),l=1===t.length,c=s?s.i18||s.name:null;return l?(n=m.file(t[0]))&&(a=n.i18||n.name):(e.each(t,function(){var e=m.file(this);return!e||o&&o!==e.phash?(o=null,!1):void(o=e.phash)}),o&&(n=m.file(o))&&(a=(n.i18||n.name)+"-"+t.length)),a&&(c=a),c&&(c=" ("+c+")"),m.request({data:{cmd:"zipdl",targets:t},notify:{type:"zipdl",cnt:1,hideCnt:!0,msg:m.i18n("ntfzipdl")+c},cancel:!0,eachCancel:!0,preventDefault:!0}).done(function(n){var o,s,l,c,p,u,h={},f="dlw"+ +new Date;n.error?(m.error(n.error),r.resolve()):n.zipdl&&(o=n.zipdl,a?(u=m.splitFileExtention(o.name||""),a+=u[1]?"."+u[1]:".zip"):a=o.name,d&&(!m.UA.Safari||m.isSameOrigin(m.options.url))||w?(i=m.options.url+(m.options.url.indexOf("?")===-1?"?":"&")+"cmd=zipdl&download=1",e.each([t[0],o.file,a,o.mime],function(e,t){i+="&targets%5B%5D="+encodeURIComponent(t)}),e.each(m.customData,function(e,t){i+="&"+encodeURIComponent(e)+"="+encodeURIComponent(t)}),i+="&"+encodeURIComponent(a),l=e("<a/>").attr("href",i).attr("download",m.escape(a)).on("click",function(){r.resolve(),s&&s.elfinderdialog("destroy")}),w?(l.attr("target","_blank").append('<span class="elfinder-button-icon elfinder-button-icon-download"></span>'+m.escape(a)),h[m.i18n("btnCancel")]=function(){s.elfinderdialog("destroy")},s=m.dialog(l,{title:m.i18n("link"),buttons:h,width:"200px",destroyOnClose:!0,close:function(){"resolved"!==r.state()&&r.resolve()}})):(k(l.hide().appendTo("body").get(0)),l.remove())):(c=e('<form action="'+m.options.url+'" method="post" target="'+f+'" style="display:none"/>').append('<input type="hidden" name="cmd" value="zipdl"/>').append('<input type="hidden" name="download" value="1"/>'),e.each([t[0],o.file,a,o.mime],function(e,t){c.append('<input type="hidden" name="targets[]" value="'+m.escape(t)+'"/>')}),e.each(m.customData,function(e,t){c.append('<input type="hidden" name="'+e+'" value="'+m.escape(t)+'"/>')}),c.attr("target",f).appendTo("body"),p=e('<iframe style="display:none" name="'+f+'">').appendTo("body").ready(function(){c.submit().remove(),r.resolve(),setTimeout(function(){p.remove()},2e4)})))}).fail(function(e){e&&m.error(e),r.resolve()}),r.promise()}},k=function(e){var t;"function"==typeof MouseEvent?t=new MouseEvent("click"):(t=document.createEvent("MouseEvents"),t.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)),e.dispatchEvent(t)},C=function(e){var t,n="elfdl"+e;t=document.cookie.split(n+"="),2===t.length?(u&&clearTimeout(u),document.cookie=n+"=; path="+s+"; max-age=0",z()):setTimeout(function(){C(e)},200)},z=function(){m.ui.notify.children(".elfinder-notify-download").length&&m.notify({type:"download",cnt:-1})},T=[];if(!g.length)return v.reject();if(p=e.grep(g,function(e){return"directory"!==e.mime}).length,c=e("<a>").hide().appendTo("body"),d="string"==typeof c.get(0).download,a&&(p!==g.length||p>=(this.options.minFilesZipdl||1)))return c.remove(),w=!d&&m.UA.Mobile,o?(y={},e.each(g,function(e,t){var n=t.hash.split("_",2);y[n[0]]?y[n[0]].push(t.hash):y[n[0]]=[t.hash]}),!w&&m.UA.Mobile&&Object.keys(y).length>1&&(w=!0)):y=[e.map(g,function(e){return e.hash})],v=m.sequence(e.map(y,function(e){return x(e)})).always(function(){m.trigger("download",{files:g})});for(T=[],n=0;n<g.length;n++)i=m.openUrl(g[n].hash,!0),r&&i.substr(0,m.options.url.length)===m.options.url&&(h=m.getRequestId(),T.push(h),i+="&cpath="+s+"&reqid="+h,u=setTimeout(function(){m.notify({type:"download",cnt:1,cancel:m.UA.IE||m.UA.Edge?void 0:function(){T.length&&e.each(T,function(){m.request({data:{cmd:"abort",id:this},preventDefault:!0})}),T=[]}})},m.notifyDelay),C(h)),!d||m.UA.Safari&&!m.isSameOrigin(i)?m.UA.Mobile?setTimeout(function(){window.open(i)||(m.error("errPopup"),u&&cleaerTimeout(u),z())},100):b+='<iframe class="downloader" id="downloader-'+g[n].hash+'" style="display:none" src="'+i+'"/>':k(c.attr("href",i).attr("download",m.escape(g[n].name)).get(0));return c.remove(),e(b).appendTo("body").ready(function(){setTimeout(function(){e(b).each(function(){e("#"+e(this).attr("id")).remove()})},2e4+1e4*n)}),m.trigger("download",{files:g}),v.resolve()}},i.prototype.commands.duplicate=function(){var t=this.fm;this.getstate=function(n){var i=this.files(n),a=i.length;return a&&t.cwd().write&&e.grep(i,function(e){return!(!e.read||e.phash!==t.cwd().hash||t.isRoot(e))}).length==a?0:-1},this.exec=function(t){var n=this.fm,i=this.files(t),a=i.length,o=e.Deferred().fail(function(e){e&&n.error(e)});return a?(e.each(i,function(e,t){if(!t.read||!n.file(t.phash).write)return!o.reject(["errCopy",t.name,"errPerm"])}),"rejected"==o.state()?o:n.request({data:{cmd:"duplicate",targets:this.hashes(t)},notify:{type:"copy",cnt:a},navigate:{toast:{inbuffer:{msg:n.i18n(["complete",n.i18n("cmdduplicate")])}}}})):o.reject()}},i.prototype.commands.edit=function(){var t,n=this,i=this.fm,a="elfinder-dialog-edit",o=i.res("class","editing"),r=[],s=[],l=!1,c=function(e){return e.replace(/\s+$/,"")},d=function(t){var a,o=e('<select class="ui-corner-all"/>');return t&&e.each(t,function(e,t){a=i.escape(t.value),o.append('<option value="'+a+'">'+(t.caption?i.escape(t.caption):a)+"</option>")}),e.each(n.options.encodings,function(e,t){o.append('<option value="'+t+'">'+t+"</option>")}),o},p=function(){var t,a;return a="string"==typeof n.options.dialogWidth&&(t=n.options.dialogWidth.match(/(\d+)%/))?parseInt(i.getUI().width()*(t[1]/100)):parseInt(n.options.dialogWidth||650),Math.min(a,e(window).width())},u=function(t){var a,o,c,d=t.length;return d>1&&(a=t[0].mime,o=t[0].name.replace(/^.*(\.[^.]+)$/,"$1")),e.grep(t,function(t){var p;return!c&&"directory"!==t.mime&&(p=t.read&&(l||i.mimeIsText(t.mime)||e.inArray(t.mime,1===d?r:s)!==-1)&&(!n.onlyMimes.length||e.inArray(t.mime,n.onlyMimes)!==-1)&&(1===d||t.mime===a&&t.name.substr(o.length*-1)===o)&&!!i.uploadMimeCheck(t.mime,t.phash)&&b(t,d)&&Object.keys(g).length,p||(c=!0),p)})},h=function(e){var t,n=i.file(e);i.request({cmd:"info",targets:[e],preventDefault:!0}).done(function(e){var a;e&&e.files&&e.files.length&&(t=e.files[0],n.ts==t.ts&&n.size==t.size||(a={changed:[t]},i.updateCache(a),i.change(a)))})},f=function(t,r,s,l,u){var f,g,v,b,y,w,k=e.Deferred(),C=!1,z=function(){return!!C||(i.toast({mode:"warning",msg:i.i18n("nowLoading")}),!1)},T=function(){var t,n,i=b?b.val():void 0,a=e.Deferred().fail(function(e){v.show().find("button.elfinder-btncnt-0,button.elfinder-btncnt-1").hide()});return z()?(f.editor&&(f.editor.save(f[0],f.editor.instance),t=f.editor.confObj,t.info&&(t.info.schemeContent||t.info.arrayBufferContent)&&(i="scheme")),n=F(),D(n),n.promise?n.done(function(e){k.notifyWith(f,[i,f.data("hash"),g,a])}).fail(function(e){a.reject(e)}):k.notifyWith(f,[i,f.data("hash"),g,a]),a):a.resolve()},A=function(){z()&&T().fail(function(e){e&&i.error(e)})},I=function(){f.elfinderdialog("close")},S=function(){z()&&(T().done(function(){C=!1,v.show(),I()}).fail(function(e){v.show(),e&&i.error(e)}),v.hide())},O=function(){if(z()){var t=g,s=i.file(r.phash)?r.phash:i.cwd().hash,l=function(e){p.addClass(o).fadeIn(function(){e&&i.error(e)}),g=t,i.disable()},c=function(){n.mime=E.mime||r.mime,n.prefix=(E.name||r.name).replace(/ \d+(\.[^.]+)?$/,"$1"),n.requestCmd="mkfile",n.nextAction={},n.data={target:s},e.proxy(i.res("mixin","make"),n)().done(function(e){e.added&&e.added.length?(f.data("hash",e.added[0].hash),T().done(function(){C=!1,v.show(),I(),p.fadeIn()}).fail(l)):l()}).progress(function(e){e&&"errUploadMime"===e&&f.trigger("saveAsFail")}).fail(l).always(function(){delete n.mime,delete n.prefix,delete n.nextAction,delete n.data}),i.trigger("unselectfiles",{files:[r.hash]})},d=null,p=i.getUI().children("."+a+":visible");v.is(":hidden")&&(p=p.add(v)),p.removeClass(o).fadeOut(),i.enable(),i.searchStatus.state<2&&s!==i.cwd().hash&&(d=i.exec("open",[s],{thash:s})),e.when([d]).done(function(){d?i.one("cwdrender",c):c()}).fail(l)}},j=function(){var t,n,a=e.Deferred();if(!C)return a.resolve(!1);f.editor&&f.editor.save(f[0],f.editor.instance);var t=F();return t&&t.promise?(n=setTimeout(function(){i.notify({type:"chkcontent",cnt:1,hideCnt:!0})},100),t.always(function(){n&&clearTimeout(n),i.notify({type:"chkcontent",cnt:-1})}).done(function(e){a.resolve(g!==e)}).fail(function(e){a.resolve(e||!0)})):a.resolve(g!==t),a},M={title:i.escape(r.name),width:p(),buttons:{},cssClass:a+" "+o,maxWidth:"window",maxHeight:"window",allowMinimize:!0,allowMaximize:!0,openMaximized:x()||u&&u.info&&u.info.openMaximized,btnHoverFocus:!1,closeOnEscape:!1,propagationEvents:["mousemove","mouseup","click"],minimize:function(){var e;f.editor&&v.closest(".ui-dialog").is(":hidden")&&(e=f.editor.confObj,e.info&&e.info.syncInterval&&h(r.hash))},close:function(){var e=function(){var e;k.resolve(),f.editor&&(f.editor.close(f[0],f.editor.instance),e=f.editor.confObj,e.info&&e.info.syncInterval&&h(r.hash)),f.elfinderdialog("destroy")},t="undefined"!=typeof E.name,a=t?{label:"btnSaveAs",callback:function(){requestAnimationFrame(O)}}:{label:"btnSaveClose",callback:function(){T().done(function(){e()})}};j().done(function(o){var r=["confirmNotSave"];o?("string"==typeof o&&r.unshift(o),i.confirm({title:n.title,text:r,accept:a,cancel:{label:"btnClose",callback:e},buttons:t?null:[{label:"btnSaveAs",callback:function(){requestAnimationFrame(O)}}]})):e()})},open:function(){var e,n,a;if(f.initEditArea.call(f,t,r,s,i),f.editor){if(e=f.editor.load(f[0])||null,e&&e.done)e.always(function(){C=!0}).done(function(e){f.editor.instance=e,f.editor.focus(f[0],f.editor.instance),D(F()),requestAnimationFrame(function(){v.trigger("resize")})}).fail(function(e){e&&i.error(e),f.elfinderdialog("destroy")});else{if(C=!0,e&&("string"==typeof e||Array.isArray(e)))return i.error(e),void f.elfinderdialog("destroy");f.editor.instance=e,f.editor.focus(f[0],f.editor.instance),D(F()),requestAnimationFrame(function(){v.trigger("resize")})}n=f.editor.confObj,n.info&&n.info.syncInterval&&(a=parseInt(n.info.syncInterval))&&setTimeout(function(){U(a)},a)}else C=!0,D(F())},resize:function(e,t){f.editor&&f.editor.resize(f[0],f.editor.instance,e,t||{})}},F=function(){return f.getContent.call(f,f[0])},D=function(e){e&&e.promise?e.done(function(e){g=e}):g=e},U=function(e){v.is(":visible")&&(h(r.hash),setTimeout(function(){U(e)},e))},E={};if(u&&(u.html&&(f=e(u.html)),y={init:u.init||null,load:u.load,getContent:u.getContent||null,save:u.save,beforeclose:"function"==typeof u.beforeclose?u.beforeclose:void 0,close:"function"==typeof u.close?u.close:function(){},focus:"function"==typeof u.focus?u.focus:function(){},resize:"function"==typeof u.resize?u.resize:function(){},instance:null,doSave:A,doCancel:I,doClose:S,file:r,fm:i,confObj:u,trigger:function(e,t){i.trigger("editEditor"+e,Object.assign({},u.info||{},t))}}),!f){if(!i.mimeIsText(r.mime))return k.reject("errEditorNotFound");!function(){var n=function(){b&&j().done(function(e){e?b.attr("title",i.i18n("saveAsEncoding")).addClass("elfinder-edit-changed"):b.attr("title",i.i18n("openAsEncoding")).removeClass("elfinder-edit-changed")})};f=e('<textarea class="elfinder-file-edit" rows="20" id="'+t+'-ta"></textarea>').on("input propertychange",n),f.editor&&f.editor.info&&!f.editor.info.useTextAreaEvent||f.on("keydown",function(t){var n,i,a=t.keyCode;t.stopPropagation(),a==e.ui.keyCode.TAB&&(t.preventDefault(),this.setSelectionRange&&(n=this.value,i=this.selectionStart,this.value=n.substr(0,i)+"\t"+n.substr(this.selectionEnd),i+=1,this.setSelectionRange(i,i))),(t.ctrlKey||t.metaKey)&&(a!="Q".charCodeAt(0)&&a!="W".charCodeAt(0)||(t.preventDefault(),I()),a=="S".charCodeAt(0)&&(t.preventDefault(),A()))}).on("mouseenter",function(){this.focus()}),f.initEditArea=function(t,a,o){var r=l&&"unknown"!==l?[{value:l}]:[];f.hide().val(o),""!==o&&l&&"UTF-8"===l||r.push({value:"UTF-8"}),b=d(r).on("touchstart",function(e){e.stopPropagation()}).on("change",function(){j().done(function(t){t||""===F()||(I(),m(a,e(this).val(),u).fail(function(e){e&&i.error(e)}))})}).on("mouseover",n),f.parent().prev().find(".elfinder-titlebar-button:last").after(e('<span class="elfinder-titlebar-button-right"/>').append(b))}}()}return f.data("hash",r.hash),y&&(f.editor=y,"function"==typeof y.beforeclose&&(M.beforeclose=function(){return y.beforeclose(f[0],y.instance)}),"function"==typeof y.init&&(f.initEditArea=y.init),"function"==typeof y.getContent&&(f.getContent=y.getContent)),f.initEditArea||(f.initEditArea=function(){}),f.getContent||(f.getContent=function(){return c(f.val())}),u&&u.info&&u.info.preventGet||(M.buttons[i.i18n("btnSave")]=A,M.buttons[i.i18n("btnSaveClose")]=S,M.buttons[i.i18n("btnSaveAs")]=O,M.buttons[i.i18n("btnCancel")]=I),u&&"function"==typeof u.prepare&&u.prepare(f,M,r),v=i.dialog(f,M).attr("id",t).on("keydown keyup keypress",function(e){e.stopPropagation()}).css({overflow:"hidden",minHeight:"7em"}).addClass("elfinder-edit-editor").closest(".ui-dialog").on("changeType",function(t,n){if(n.extention&&n.mime){var a=(n.extention,n.mime,e(this).children(".ui-dialog-buttonpane").children(".ui-dialog-buttonset"));a.children(".elfinder-btncnt-0,.elfinder-btncnt-1").hide(),E.name=i.splitFileExtention(r.name)[0]+"."+n.extention,E.mime=n.mime,n.keepEditor||a.children(".elfinder-btncnt-2").trigger("click")}}),w=(i.options.dialogContained?elfNode:e(window)).width(),v.width()>w&&v.width(w),k.promise()},m=function(t,a,o){var r,s,l,c=t.hash,p=(i.options,e.Deferred()),u="edit-"+i.namespace+"-"+t.hash,h=i.getUI().find("#"+u),g=a?a:0;if(h.length)return h.elfinderdialog("toTop"),p.resolve();if(!(t.read&&(t.write||o.info&&o.info.converter)))return s=["errOpen",t.name,"errPerm"],p.reject(s);if(o&&o.info){if("function"==typeof o.info.edit)return l=o.info.edit.call(i,t,o),l.promise?l.done(function(){p.resolve()}).fail(function(e){p.reject(e)}):l?p.resolve():p.reject(),p;o.info.urlAsContent||o.info.preventGet?(r=e.Deferred(),o.info.preventGet?r.resolve({}):i.url(c,{async:!0,temporary:!0}).done(function(e){r.resolve({content:e})})):r=i.request({data:{cmd:"get",target:c,conv:g,_t:t.ts},options:{type:"get",cache:!0},notify:{type:"file",cnt:1},preventDefault:!0}),r.done(function(a){var r,s,l;a.doconv?i.confirm({title:n.title,text:"unknown"===a.doconv?"confirmNonUTF8":"confirmConvUTF8",accept:{label:"btnConv",callback:function(){p=m(t,r.val(),o)}},cancel:{label:"btnCancel",callback:function(){p.reject()}},optionsCallback:function(t){t.create=function(){var t=e('<div class="elfinder-dialog-confirm-encoding"/>'),n={value:a.doconv};"unknown"===a.doconv&&(n.caption="-"),r=d([n]),e(this).next().find(".ui-dialog-buttonset").prepend(t.append(e("<label>"+i.i18n("encoding")+" </label>").append(r)))}}}):(o&&o.info&&o.info.preventGet||!i.mimeIsText(t.mime)||(s=new RegExp("^(data:"+t.mime.replace(/([.+])/g,"\\$1")+";base64,)","i"),o.info.dataScheme?window.btoa&&!a.content.match(s)&&(a.content="data:"+t.mime+";base64,"+btoa(a.content)):window.atob&&(l=a.content.match(s))&&(a.content=atob(a.content.substr(l[1].length)))),f(u,t,a.content,a.encoding,o).done(function(e){p.resolve(e)}).progress(function(e,t,n,a){var o=this;t&&(c=t),i.request({options:{type:"post"},data:{cmd:"put",target:c,encoding:e||n.encoding,content:n},notify:{type:"save",cnt:1},syncOnFail:!0,preventFail:!0,navigate:{target:"changed",toast:{inbuffer:{msg:i.i18n(["complete",i.i18n("btnSave")])}}}}).fail(function(e){p.reject(e),a.reject()}).done(function(e){requestAnimationFrame(function(){o.trigger("focus"),o.editor&&o.editor.focus(o[0],o.editor.instance)}),a.resolve()})}).fail(function(e){p.reject(e)}))}).fail(function(e){var t=Array.isArray(e)?e[0]:e;"errConvUTF8"!==t&&i.sync(),p.reject(e)})}return p.promise()},g={},v={info:{id:"textarea",name:"TextArea",useTextAreaEvent:!0},load:function(t){this.trigger("Prepare",{node:t,editorObj:void 0,instance:void 0,opts:{}}),t.setSelectionRange&&t.setSelectionRange(0,0),e(t).trigger("focus").show()},save:function(){}},b=function(a,o){var r=function(t,n){if(n){if("*"===n[0]||e.inArray(t,n)!==-1)return!0;var a,o;for(o=n.length,a=0;a<o;a++)if(0===t.indexOf(n[a]))return!0;return!1}return i.mimeIsText(t)},s=function(e,t){if(!t||!t.length)return!0;var n,i,a=e.replace(/^.+\.([^.]+)|(.+)$/,"$1$2").toLowerCase();for(i=t.length,n=0;n<i;n++)if(a===t[n].toLowerCase())return!0;return!1},l=n.options.editors||[],c=i.cwd().write;return t=i.storage("storedEditors")||{},g={},l.length||(l=[v]),e.each(l,function(e,t){var n;(1===o||!t.info.single)&&(t.info&&t.info.converter?c:a.write)&&(a.size>0||!t.info.converter&&(t.info.canMakeEmpty||t.info.canMakeEmpty!==!1&&i.mimeIsText(a.mime)))&&(!t.info.maxSize||a.size<=t.info.maxSize)&&r(a.mime,t.mimes||null)&&s(a.name,t.exts||null)&&"function"==typeof t.load&&"function"==typeof t.save&&(n=t.info.name?t.info.name:"Editor "+e,t.id=t.info.id?t.info.id:"editor"+e,t.name=n,t.i18n=i.i18n(n),g[t.id]=t)}),!!Object.keys(g).length},y=function(n,a){n&&a&&(e.isPlainObject(t)||(t={}),t[n]=a.id,i.storage("storedEditors",t),i.trigger("selectfiles",{files:i.selected()}))},w=function(){var e=i.storage("useStoredEditor");return e?e>0:n.options.useStoredEditor},x=function(){var e=i.storage("editorMaximized");return e?e>0:n.options.editorMaximized},k=function(t,n){var a=[];return e.each(g,function(e,o){a.push({label:i.escape(o.i18n),icon:o.info&&o.info.icon?o.info.icon:"edit",options:{iconImg:o.info&&o.info.iconImg?i.baseUrl+o.info.iconImg:void 0},callback:function(){y(t[0].mime,o),n&&n.call(o)}})}),a},C=function(e){return e.toLowerCase().replace(/ +/g,"")},z=function(e){var n=t[e];return n&&Object.keys(g).length?g[C(n)]:void 0};this.shortcuts=[{pattern:"ctrl+e"}],this.init=function(){var t,n,i=this,a=this.fm,o=this.options,c=[];this.onlyMimes=this.options.mimes||[],a.one("open",function(){o.editors&&Array.isArray(o.editors)&&(a.trigger("canMakeEmptyFile",{mimes:Object.keys(a.storage("mkfileTextMimes")||{}).concat(o.makeTextMimes||["text/plain"])}),e.each(o.editors,function(e,t){t.info&&t.info.cmdCheck&&c.push(t.info.cmdCheck)}),c.length?a.api>=2.103?n=a.request({data:{cmd:"editor",name:c,method:"enabled"},preventDefault:!0}).done(function(e){t=e}).fail(function(){t={}}):(t={},n=e.Deferred().resolve()):n=e.Deferred().resolve(),n.always(function(){t&&(o.editors=e.grep(o.editors,function(e){return!e.info||!e.info.cmdCheck||!!t[e.info.cmdCheck]})),e.each(o.editors,function(e,t){t.setup&&"function"==typeof t.setup&&t.setup.call(t,o,a),t.disabled||(t.mimes&&Array.isArray(t.mimes)&&(r=r.concat(t.mimes),t.info&&t.info.single||(s=s.concat(t.mimes))),!l&&t.mimes&&"*"===t.mimes[0]&&(l=!0),t.info||(t.info={}),t.info.integrate&&a.trigger("helpIntegration",Object.assign({cmd:"edit"},t.info.integrate)),t.info.canMakeEmpty&&a.trigger("canMakeEmptyFile",{mimes:t.mimes}))}),r=(e.uniqueSort||e.unique)(r),s=(e.uniqueSort||e.unique)(s),o.editors=e.grep(o.editors,function(e){return!e.disabled})}))}).bind("select",function(){g=null}).bind("contextmenucreate",function(t){var n,o,r=function(e){var t=i.title;a.one("contextmenucreatedone",function(){i.title=t}),i.title=a.escape(e.i18n),e.info&&e.info.iconImg&&(i.contextmenuOpts={iconImg:a.baseUrl+e.info.iconImg}),delete i.variants};i.contextmenuOpts=void 0,"files"===t.data.type&&i.enabled()&&(n=a.file(t.data.targets[0]),b(n,t.data.targets.length)&&(Object.keys(g).length>1?w()&&(o=z(n.mime))?(r(o),i.extra={icon:"menu",node:e("<span/>").attr({title:a.i18n("select")}).on("click touchstart",function(t){if(!("touchstart"===t.type&&t.originalEvent.touches.length>1)){var n=e(this);t.stopPropagation(),t.preventDefault(),a.trigger("contextmenu",{raw:k(a.selectedFiles(),function(){var e=a.selected();a.exec("edit",e,{editor:this}),a.trigger("selectfiles",{files:e})}),x:n.offset().left,y:n.offset().top})}})}):(delete i.extra,i.variants=[],e.each(g,function(e,t){i.variants.push([{editor:t},t.i18n,t.info&&t.info.iconImg?a.baseUrl+t.info.iconImg:"edit"])})):(r(g[Object.keys(g)[0]]),delete i.extra)))}).bind("canMakeEmptyFile",function(t){if(t.data&&t.data.resetTexts){var n=a.arrayFlip(i.options.makeTextMimes||["text/plain"]),o=a.storage("mkfileHides")||{};e.each(a.storage("mkfileTextMimes")||{},function(e,t){n[e]||(delete a.mimesCanMakeEmpty[e],delete o[e])}),a.storage("mkfileTextMimes",null),Object.keys(o).length?a.storage("mkfileHides",o):a.storage("mkfileHides",null)}})},this.getstate=function(e){var t=this.files(e),n=t.length;return n&&u(t).length==n?0:-1},this.exec=function(t,n){var i,a=this.fm,o=u(this.files(t)),r=e.map(o,function(e){return e.hash}),s=[],l=n&&n.editor?n.editor:null,c=e(n&&n._currentNode?n._currentNode:e("#"+a.cwdHash2Id(r[0]))),d=function(){var t=e.Deferred();return!l&&Object.keys(g).length>1?w()&&(l=z(o[0].mime))?t.resolve(l):(a.trigger("contextmenu",{raw:k(o,function(){t.resolve(this)}),x:c.offset().left,y:c.offset().top+22,opened:function(){a.one("closecontextmenu",function(){requestAnimationFrame(function(){"pending"===t.state()&&t.reject()})})}}),a.trigger("selectfiles",{files:r}),t):(Object.keys(g).length>1&&l&&y(o[0].mime,l),t.resolve(l?l:Object.keys(g).length?g[Object.keys(g)[0]]:null))},p=e.Deferred();return null===g&&b(o[0],r.length),c.length||(c=a.getUI("cwd")),d().done(function(t){for(;i=o.shift();)s.push(m(i,void 0,t).fail(function(e){e&&a.error(e)}));s.length?e.when.apply(null,s).done(function(){p.resolve()}).fail(function(){p.reject()}):p.reject()}).fail(function(){p.reject()}),p}},i.prototype.commands.empty=function(){var t,n,i=function(e){var i=t.files(e);return i.length||(i=[n.cwd()]),i};this.linkedCmds=["rm"],this.init=function(){t=this,n=this.fm},this.getstate=function(t){var n,a=i(t);return n=a.length,e.grep(a,function(e){return!(!e.write||"directory"!==e.mime)}).length==n?0:-1},this.exec=function(t){var a=i(t),o=a.length,r=e.Deferred().done(function(){var t={changed:{}};n.toast({msg:n.i18n(['"'+s.join('", ')+'"',"complete",n.i18n("cmdempty")])}),e.each(a,function(e,n){t.changed[n.hash]=n}),n.change(t)}).always(function(){var t=n.cwd().hash;n.trigger("selectfiles",{files:e.map(a,function(e){return t===e.phash?e.hash:null})})}),s=[],l=function(e){"number"==typeof e?(s.push(a[e].name),delete a[e].dirs):e&&n.error(e),--o<1&&r[s.length?"resolve":"reject"]()};return e.each(a,function(t,i){var a;return i.write&&"directory"===i.mime?n.isCommandEnabled("rm",i.hash)?(a=setTimeout(function(){n.notify({type:"search",cnt:1,hideCnt:!(o>1)})},n.notifyDelay),void n.request({data:{cmd:"open",target:i.hash},preventDefault:!0,asNotOpen:!0}).done(function(r){var s=[];a&&clearTimeout(a),n.ui.notify.children(".elfinder-notify-search").length&&n.notify({type:"search",cnt:-1,hideCnt:!(o>1)}),r&&r.files&&r.files.length?r.files.length>n.maxTargets?l(["errEmpty",i.name,"errMaxTargets",n.maxTargets]):(n.updateCache(r),e.each(r.files,function(e,t){return!t.write||t.locked?(l(["errEmpty",i.name,"errRm",t.name,"errPerm"]),s=[],!1):void s.push(t.hash)}),s.length&&n.exec("rm",s,{_userAction:!0,addTexts:[n.i18n("folderToEmpty",i.name)]}).fail(function(e){n.trigger("unselectfiles",{files:n.selected()}),l(e||"")}).done(function(){l(t)})):(n.toast({mode:"warning",msg:n.i18n("filderIsEmpty",i.name)}),l(""))}).fail(function(e){l(e||"")})):(l(["errCmdNoSupport",'"rm"']),null):(l(["errEmpty",i.name,"errPerm"]),null)}),r}},i.prototype.commands.extract=function(){var t=this,n=t.fm,i=[],a=function(t){return e.grep(t,function(t){return!(!t.read||e.inArray(t.mime,i)===-1)})};this.variants=[],this.disableOnSearch=!0,n.bind("open reload",function(){i=n.option("archivers").extract||[],n.api>2?t.variants=[[{makedir:!0},n.i18n("cmdmkdir")],[{},n.i18n("btnCwd")]]:t.variants=[[{},n.i18n("btnCwd")]],
t.change()}),this.getstate=function(e){var t=this.files(e),n=t.length;return n&&this.fm.cwd().write&&a(t).length==n?0:-1},this.exec=function(t,a){var o,r,s,l=this.files(t),c=e.Deferred(),d=l.length,p=a&&a.makedir?1:0,u=!1,h=!1,f=0,m=e.map(n.files(t),function(e){return e.name}),g={};e.grep(n.files(t),function(e){return g[e.name]=e,!1});var v=function(e){switch(e){case"overwrite_all":u=!0;break;case"omit_all":h=!0}},b=function(t){t.read&&n.file(t.phash).write?e.inArray(t.mime,i)===-1?(r=["errExtract",t.name,"errNoArchive"],n.error(r),c.reject(r)):n.request({data:{cmd:"extract",target:t.hash,makedir:p},notify:{type:"extract",cnt:1},syncOnFail:!0,navigate:{toast:p?{incwd:{msg:n.i18n(["complete",n.i18n("cmdextract")]),action:{cmd:"open",msg:"cmdopen"}},inbuffer:{msg:n.i18n(["complete",n.i18n("cmdextract")]),action:{cmd:"open",msg:"cmdopen"}}}:{inbuffer:{msg:n.i18n(["complete",n.i18n("cmdextract")])}}}}).fail(function(e){"rejected"!=c.state()&&c.reject(e)}).done(function(){}):(r=["errExtract",t.name,"errPerm"],n.error(r),c.reject(r))},y=function(t,i){var a=t[i],r=n.splitFileExtention(a.name)[0],l=e.inArray(r,m)>=0,w=function(){i+1<d?y(t,i+1):c.resolve()};!p&&l&&"directory"!=g[r].mime?n.confirm({title:n.i18n("ntfextract"),text:["errExists",r,"confirmRepl"],accept:{label:"btnYes",callback:function(e){if(s=e?"overwrite_all":"overwrite",v(s),u||h){if(u){for(o=i;o<d;o++)b(t[o]);c.resolve()}}else"overwrite"==s&&b(a),i+1<d?y(t,i+1):c.resolve()}},reject:{label:"btnNo",callback:function(e){s=e?"omit_all":"omit",v(s),!u&&!h&&i+1<d?y(t,i+1):h&&c.resolve()}},cancel:{label:"btnCancel",callback:function(){c.resolve()}},all:i+1<d}):p?(b(a),w()):0==f?n.confirm({title:n.i18n("cmdextract"),text:[n.i18n("cmdextract")+' "'+a.name+'"',"confirmRepl"],accept:{label:"btnYes",callback:function(e){e&&(f=1),b(a),w()}},reject:{label:"btnNo",callback:function(e){e&&(f=-1),w()}},cancel:{label:"btnCancel",callback:function(){c.resolve()}},all:i+1<d}):(f>0&&b(a),w())};return this.enabled()&&d&&i.length?(d>0&&y(l,0),c):c.reject()}},(i.prototype.commands.forward=function(){this.alwaysEnabled=!0,this.updateOnSelect=!0,this.shortcuts=[{pattern:"ctrl+right"}],this.getstate=function(){return this.fm.history.canForward()?0:-1},this.exec=function(){return this.fm.history.forward()}}).prototype={forceLoad:!0},i.prototype.commands.fullscreen=function(){var t=this,n=this.fm,i=function(e,n){e.preventDefault(),e.stopPropagation(),n&&n.fullscreen&&t.update(void 0,"on"===n.fullscreen)};this.alwaysEnabled=!0,this.updateOnSelect=!1,this.syncTitleOnChange=!0,this.value=!1,this.options={ui:"fullscreenbutton"},this.getstate=function(){return 0},this.exec=function(){var i=n.getUI().get(0),a=i===n.toggleFullscreen(i);return t.title=n.i18n(a?"reinstate":"cmdfullscreen"),t.update(void 0,a),e.Deferred().resolve()},n.bind("init",function(){n.getUI().off("resize."+n.namespace,i).on("resize."+n.namespace,i)})},(i.prototype.commands.getfile=function(){var t=this,n=this.fm,i=function(n){var i=t.options;return n=e.grep(n,function(e){return!("directory"==e.mime&&!i.folders||!e.read)}),i.multiple||1==n.length?n:[]};this.alwaysEnabled=!0,this.callback=n.options.getFileCallback,this._disabled="function"==typeof this.callback,this.getstate=function(e){var t=this.files(e),n=t.length;return this.callback&&n&&i(t).length==n?0:-1},this.exec=function(n){var i,a,o,r=this.fm,s=this.options,l=this.files(n),c=l.length,d=r.option("url"),p=r.option("tmbUrl"),u=e.Deferred().done(function(e){var n,i=function(){"close"==s.oncomplete?r.hide():"destroy"==s.oncomplete&&r.destroy()},a=function(e){"close"==s.onerror?r.hide():"destroy"==s.onerror?r.destroy():e&&r.error(e)};r.trigger("getfile",{files:e});try{n=t.callback(e,r)}catch(o){return void a(["Error in `getFileCallback`.",o.message])}"object"==typeof n&&"function"==typeof n.done?n.done(i).fail(a):i()}),h=function(t){return s.onlyURL?s.multiple?e.map(l,function(e){return e.url}):l[0].url:s.multiple?l:l[0]},f=[];for(i=0;i<c;i++){if(a=l[i],"directory"==a.mime&&!s.folders)return u.reject();a.baseUrl=d,"1"==a.url?f.push(r.request({data:{cmd:"url",target:a.hash},notify:{type:"url",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){if(e.url){var t=r.file(this.hash);t.url=this.url=e.url}}.bind(a))):a.url=r.url(a.hash),s.onlyURL||(s.getPath&&(a.path=r.path(a.hash),""===a.path&&a.phash&&!function(){var t=e.Deferred();f.push(t),r.path(a.hash,!1,{}).done(function(e){a.path=e}).fail(function(){a.path=""}).always(function(){t.resolve()})}()),a.tmb&&1!=a.tmb&&(a.tmb=p+a.tmb),a.width||a.height||(a.dim?(o=a.dim.split("x"),a.width=o[0],a.height=o[1]):s.getImgSize&&a.mime.indexOf("image")!==-1&&f.push(r.request({data:{cmd:"dim",target:a.hash},notify:{type:"dim",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){if(e.dim){var t=e.dim.split("x"),n=r.file(this.hash);n.width=this.width=t[0],n.height=this.height=t[1]}}.bind(a)))))}return f.length?(e.when.apply(null,f).always(function(){u.resolve(h(l))}),u):u.resolve(h(l))}}).prototype={forceLoad:!0},(i.prototype.commands.help=function(){var t,n,i,a,o,r,s=this.fm,l=this,c='<div class="elfinder-help-link"> <a href="{url}" target="_blank">{link}</a></div>',d='<div class="elfinder-help-team"><div>{author}</div>{work}</div>',p=/\{url\}/,u=/\{link\}/,h=/\{author\}/,f=/\{work\}/,m="replace",g="ui-priority-primary",v="ui-priority-secondary",b="elfinder-help-license",y='<li class="ui-state-default ui-corner-top elfinder-help-tab-{id}"><a href="#'+s.namespace+'-help-{id}">{title}</a></li>',w=['<div class="ui-tabs ui-widget ui-widget-content ui-corner-all elfinder-help">','<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">'],x='<div class="elfinder-help-shortcut"><div class="elfinder-help-shortcut-pattern">{pattern}</div> {descrip}</div>',k='<div class="elfinder-help-separator"/>',C=e("base").length?document.location.href.replace(/#.*$/,""):"",z=function(){w.push('<div id="'+s.namespace+'-help-about" class="ui-tabs-panel ui-widget-content ui-corner-bottom"><div class="elfinder-help-logo"/>'),w.push("<h3>elFinder</h3>"),w.push('<div class="'+g+'">'+s.i18n("webfm")+"</div>"),w.push('<div class="'+v+'">'+s.i18n("ver")+": "+s.version+"</div>"),w.push('<div class="'+v+'">'+s.i18n("protocolver")+': <span class="apiver"></span></div>'),w.push('<div class="'+v+'">jQuery/jQuery UI: '+e().jquery+"/"+e.ui.version+"</div>"),w.push(k),w.push(c[m](p,"https://studio-42.github.io/elFinder/")[m](u,s.i18n("homepage"))),w.push(c[m](p,"https://github.com/Studio-42/elFinder/wiki")[m](u,s.i18n("docs"))),w.push(c[m](p,"https://github.com/Studio-42/elFinder")[m](u,s.i18n("github"))),w.push(k),w.push('<div class="'+g+'">'+s.i18n("team")+"</div>"),w.push(d[m](h,'Dmitry "dio" Levashov &lt;dio@std42.ru&gt;')[m](f,s.i18n("chiefdev"))),w.push(d[m](h,"Naoki Sawada &lt;hypweb+elfinder@gmail.com&gt;")[m](f,s.i18n("developer"))),w.push(d[m](h,"Troex Nevelin &lt;troex@fury.scancode.ru&gt;")[m](f,s.i18n("maintainer"))),w.push(d[m](h,"Alexey Sukhotin &lt;strogg@yandex.ru&gt;")[m](f,s.i18n("contributor"))),s.i18[s.lang].translator&&e.each(s.i18[s.lang].translator.split(", "),function(){w.push(d[m](h,e.trim(this))[m](f,s.i18n("translator")+" ("+s.i18[s.lang].language+")"))}),w.push(k),w.push('<div class="'+b+'">'+s.i18n("icons")+': Pixelmixer, <a href="http://p.yusukekamiyamane.com" target="_blank">Fugue</a>, <a href="https://icons8.com" target="_blank">Icons8</a></div>'),w.push(k),w.push('<div class="'+b+'">Licence: 3-clauses BSD Licence</div>'),w.push('<div class="'+b+'">Copyright © 2009-2018, Studio 42</div>'),w.push('<div class="'+b+'">„ …'+s.i18n("dontforget")+" ”</div>"),w.push("</div>")},T=function(){var t=s.shortcuts();w.push('<div id="'+s.namespace+'-help-shortcuts" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'),t.length?(w.push('<div class="ui-widget-content elfinder-help-shortcuts">'),e.each(t,function(e,t){w.push(x.replace(/\{pattern\}/,t[0]).replace(/\{descrip\}/,t[1]))}),w.push("</div>")):w.push('<div class="elfinder-help-disabled">'+s.i18n("shortcutsof")+"</div>"),w.push("</div>")},A=function(){w.push('<div id="'+s.namespace+'-help-help" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'),w.push('<a href="https://github.com/Studio-42/elFinder/wiki" target="_blank" class="elfinder-dont-panic"><span>DON\'T PANIC</span></a>'),w.push("</div>")},I=!1,S=function(){I=!0,w.push('<div id="'+s.namespace+'-help-integrations" class="ui-tabs-panel ui-widget-content ui-corner-bottom"/>')},O=!1,j=function(){O=!0,w.push('<div id="'+s.namespace+'-help-debug" class="ui-tabs-panel ui-widget-content ui-corner-bottom">'),w.push('<div class="ui-widget-content elfinder-help-debug"><ul></ul></div>'),w.push("</div>")},M=function(){var n,i,a,c,d,p,u=function(t,n){return e.each(n,function(n,i){t.append(e("<dt/>").text(n)),"undefined"==typeof i?t.append(e("<dd/>").append(e("<span/>").text("undfined"))):"object"!=typeof i||i?"object"==typeof i&&(e.isPlainObject(i)||i.length)?t.append(e("<dd/>").append(u(e("<dl/>"),i))):t.append(e("<dd/>").append(e("<span/>").text(i&&"object"==typeof i?"[]":i?i:'""'))):t.append(e("<dd/>").append(e("<span/>").text("null")))}),t},h=r.children("li").length;(l.debug.options||l.debug.debug)&&(h>=5&&(d=r.children("li:last"),p=o.children("div:last"),p.is(":hidden")?(d.remove(),p.remove()):(d.prev().remove(),p.prev().remove())),a=s.namespace+"-help-debug-"+ +new Date,n=e("<li/>").html('<a href="'+C+"#"+a+'">'+l.debug.debug.cmd+"</a>").prependTo(r),i=e('<div id="'+a+'"/>').data("debug",l.debug),n.on("click.debugrender",function(){var t=i.data("debug");i.removeData("debug"),t&&(i.hide(),t.debug&&(c=e("<fieldset>").append(e("<legend/>").text("debug"),u(e("<dl/>"),t.debug)),i.append(c)),t.options&&(c=e("<fieldset>").append(e("<legend/>").text("options"),u(e("<dl/>"),t.options)),i.append(c)),i.show()),n.off("click.debugrender")}),r.after(i),t&&o.tabs("refresh"))},F="";this.alwaysEnabled=!0,this.updateOnSelect=!1,this.state=-1,this.shortcuts=[{pattern:"f1",description:this.title}],s.bind("load",function(){var c,d,p,u,h,f,g=l.options.view||["about","shortcuts","help","integrations","debug"];(c=e.inArray("preference",g))!==-1&&g.splice(c,1),e.fn.tabs||(c=e.inArray(g,"debug"))!==-1&&g.splice(c,1),e.each(g,function(e,t){w.push(y[m](/\{id\}/g,t)[m](/\{title\}/,s.i18n(t)))}),w.push("</ul>"),e.inArray("about",g)!==-1&&z(),e.inArray("shortcuts",g)!==-1&&T(),e.inArray("help",g)!==-1&&(d=s.baseUrl+"js/i18n/help/%s.html.js",A()),e.inArray("integrations",g)!==-1&&S(),e.inArray("debug",g)!==-1&&j(),w.push("</div>"),F=e(w.join("")),F.find(".ui-tabs-nav li").on("mouseenter mouseleave",function(){e(this).toggleClass("ui-state-hover")}).children().on("click",function(t){var n=e(this);t.preventDefault(),t.stopPropagation(),n.hasClass("ui-tabs-selected")||(n.parent().addClass("ui-tabs-selected ui-state-active").siblings().removeClass("ui-tabs-selected").removeClass("ui-state-active"),F.children(".ui-tabs-panel").hide().filter(n.attr("href")).show())}).filter(":first").trigger("click"),I&&(n=F.find(".elfinder-help-tab-integrations").hide(),i=F.find("#"+s.namespace+"-help-integrations").hide().append(e('<div class="elfinder-help-integrations-desc"/>').html(s.i18n("integrationWith"))),s.bind("helpIntegration",function(t){var a,o,r,l,c=i.children("ul:first");t.data&&(e.isPlainObject(t.data)?(a=Object.assign({link:"",title:"",banner:""},t.data),(a.title||a.link)&&(a.title||(a.title=a.link),o=a.link?e("<a/>").attr("href",a.link).attr("target","_blank").text(a.title):e("<span/>").text(a.title),a.banner&&(o=e("<span/>").append(e("<img/>").attr(a.banner),o)))):(o=e(t.data),o.filter("a").each(function(){var t=e(this);t.attr("target")||t.attr("target","_blank")})),o&&(n.show(),c.length||(c=e('<ul class="elfinder-help-integrations"/>').appendTo(i)),a&&a.cmd?(l="elfinder-help-integration-"+a.cmd,r=c.find("ul."+l),r.length||(r=e('<ul class="'+l+'"/>'),c.append(e("<li/>").append(e("<span/>").html(s.i18n("cmd"+a.cmd))).append(r))),o=r.append(e("<li/>").append(o))):c.append(e("<li/>").append(o))))})),O&&(a=F.find(".elfinder-help-tab-debug").hide(),o=F.find("#"+s.namespace+"-help-debug").children("div:first"),r=o.children("ul:first").on("click",function(e){e.preventDefault(),e.stopPropagation()}),l.debug={},s.bind("backenddebug",function(e){O&&e.data&&e.data.debug&&(l.debug={options:e.data.options,debug:Object.assign({cmd:s.currentReqCmd},e.data.debug)},l.dialog&&M())})),F.find("#"+s.namespace+"-help-about").find(".apiver").text(s.api),l.dialog=s.dialog(F,{title:l.title,width:530,maxWidth:"window",maxHeight:"window",autoOpen:!1,destroyOnClose:!1,close:function(){O&&(a.hide(),o.tabs("destroy")),t=!1}}).on("click",function(e){e.stopPropagation()}).css({overflow:"hidden"}),p=l.dialog.children(".ui-tabs"),u=p.children(".ui-tabs-nav:first"),h=p.children(".ui-tabs-panel"),f=l.dialog.outerHeight(!0)-l.dialog.height(),l.dialog.closest(".ui-dialog").on("resize",function(){h.height(l.dialog.height()-f-u.outerHeight(!0)-20)}),d&&l.dialog.one("initContents",function(){e.ajax({url:l.options.helpSource?l.options.helpSource:d.replace("%s",s.lang),dataType:"html"}).done(function(t){e("#"+s.namespace+"-help-help").html(t)}).fail(function(){e.ajax({url:d.replace("%s","en"),dataType:"html"}).done(function(t){e("#"+s.namespace+"-help-help").html(t)})})}),l.state=0,s.trigger("helpBuilded",l.dialog)}).one("open",function(){var e=!1;s.one("backenddebug",function(){e=!0}).one("opendone",function(){requestAnimationFrame(function(){!e&&O&&(O=!1,a.hide(),o.hide(),r.hide())})})}),this.getstate=function(){return 0},this.exec=function(n,i){var s=i?i.tab:void 0,l=function(){O&&(o.tabs(),r.find("a:first").trigger("click"),a.show(),t=!0)};return l(),this.dialog.trigger("initContents").elfinderdialog("open").find((s?".elfinder-help-tab-"+s:".ui-tabs-nav li")+" a:first").trigger("click"),e.Deferred().resolve()}}).prototype={forceLoad:!0},i.prototype.commands.hidden=function(){this.hidden=!0,this.updateOnSelect=!1,this.getstate=function(){return-1}},i.prototype.commands.hide=function(){var t,n,i,a,o=this,r={};this.syncTitleOnChange=!0,this.shortcuts=[{pattern:"ctrl+shift+dot",description:this.fm.i18n("toggleHidden")}],this.init=function(){var e=this.fm;t=e.storage("hide")||{items:{}},n=Object.keys(t.items).length,this.title=e.i18n(t.show?"hideHidden":"showHidden"),o.update(void 0,o.title)},this.fm.bind("select contextmenucreate closecontextmenu",function(e,r){var s=(e.data?e.data.selected||e.data.targets:null)||r.selected();"select"===e.type&&e.data?a=e.data.origin:"contextmenucreate"===e.type&&(i=e.data.type),!s.length||("contextmenucreate"!==e.type&&"navbar"!==a||"cwd"===i)&&s[0]===r.cwd().hash?o.title=r.i18n(t.show?"hideHidden":"showHidden"):o.title=r.i18n("cmdhide"),"closecontextmenu"!==e.type?o.update("cwd"===i?n?0:-1:void 0,o.title):(i="",requestAnimationFrame(function(){o.update(void 0,o.title)}))}),this.getstate=function(e){return"cwd"!==i&&(e||this.fm.selected()).length||n?0:-1},this.exec=function(i,s){var l,c,d=this.fm,p=e.Deferred().done(function(){d.trigger("hide",{items:h,opts:s})}).fail(function(e){d.error(e)}),u=s||{},h=u.targets?u.targets:i||d.selected(),f=[];if(t=d.storage("hide")||{},e.isPlainObject(t)||(t={}),e.isPlainObject(t.items)||(t.items={}),("shortcut"===s._currentType||!h.length||"navbar"!==s._currentType&&"navbar"!==a&&h[0]===d.cwd().hash)&&(t.show?u.hide=!0:Object.keys(t.items).length&&(u.show=!0)),u.reset&&(u.show=!0,n=0),u.show||u.hide){if(u.show?t.show=!0:delete t.show,u.show)return d.storage("hide",u.reset?null:t),o.title=d.i18n("hideHidden"),o.update(u.reset?-1:void 0,o.title),e.each(t.items,function(e){var t=d.file(e,!0);t&&(d.searchStatus.state||!t.phash||d.file(t.phash))&&f.push(t)}),f.length&&(d.updateCache({added:f}),d.add({added:f})),u.reset&&(t={items:{}}),p.resolve();h=Object.keys(t.items)}return h.length&&(e.each(h,function(e,n){var i;t.items[n]||(i=d.file(n),i&&(r[n]=i.i18||i.name),t.items[n]=r[n]?r[n]:n)}),n=Object.keys(t.items).length,l=this.files(h),d.storage("hide",t),d.remove({removed:h}),t.show&&this.exec(void 0,{hide:!0}),u.hide||(c={},c.undo={cmd:"hide",callback:function(){var t=d.storage("hide");t&&(e.each(h,function(e,n){delete t.items[n]}),n=Object.keys(t.items).length,d.storage("hide",t),d.trigger("hide",{items:h,opts:{}}),o.update(n?0:-1)),d.updateCache({added:l}),d.add({added:l})}},c.redo={cmd:"hide",callback:function(){return d.exec("hide",void 0,{targets:h})}})),"rejected"==p.state()?p:p.resolve(c)}},(i.prototype.commands.home=function(){this.title="Home",this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+home ctrl+shift+up",description:"Home"}],this.getstate=function(){var e=this.fm.root(),t=this.fm.cwd().hash;return e&&t&&e!=t?0:-1},this.exec=function(){return this.fm.exec("open",this.fm.root())}}).prototype={forceLoad:!0},(i.prototype.commands.info=function(){var t=this.fm,n="elfinder-info-spinner",i="elfinder-info-button",a={calc:t.i18n("calc"),size:t.i18n("size"),unknown:t.i18n("unknown"),path:t.i18n("path"),aliasfor:t.i18n("aliasfor"),modify:t.i18n("modify"),perms:t.i18n("perms"),locked:t.i18n("locked"),dim:t.i18n("dim"),kind:t.i18n("kind"),files:t.i18n("files"),folders:t.i18n("folders"),roots:t.i18n("volumeRoots"),items:t.i18n("items"),yes:t.i18n("yes"),no:t.i18n("no"),link:t.i18n("link"),owner:t.i18n("owner"),group:t.i18n("group"),perm:t.i18n("perm"),getlink:t.i18n("getLink")};this.items=["size","aliasfor","path","link","dim","modify","perms","locked","owner","group","perm"],this.options.custom&&Object.keys(this.options.custom).length&&e.each(this.options.custom,function(e,t){t.label&&this.items.push(t.label)}),this.tpl={main:'<div class="ui-helper-clearfix elfinder-info-title {dirclass}"><span class="elfinder-cwd-icon {class} ui-corner-all"{style}/>{title}</div><table class="elfinder-info-tb">{content}</table>',itemTitle:'<strong>{name}</strong><span class="elfinder-info-kind">{kind}</span>',groupTitle:"<strong>{items}: {num}</strong>",row:'<tr><td class="elfinder-info-label">{label} : </td><td class="{class}">{value}</td></tr>',spinner:'<span>{text}</span> <span class="'+n+" "+n+'-{name}"/>'},this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+i"}],this.init=function(){e.each(a,function(e,n){a[e]=t.i18n(n)})},this.getstate=function(){return 0},this.exec=function(t){var o=this.files(t);o.length||(o=this.files([this.fm.cwd().hash]));var r,s,l,c,d,p,u,h,f,m=this.fm,g=this.options,v=this.tpl,b=v.row,y=o.length,w=[],x=v.main,k="{label}",C="{value}",z=[],T=null,A={title:m.i18n("selectionInfo"),width:"auto",close:function(){e(this).elfinderdialog("destroy"),T&&"pending"===T.state()&&T.reject(),e.grep(z,function(e){e&&"pending"===e.state()&&e.reject()})}},I=[],S=function(e,t,i){j.find("."+n+"-"+t).parent().html(e).addClass(i||"")},O=m.namespace+"-info-"+e.map(o,function(e){return e.hash}).join("-"),j=m.getUI().find("#"+O),M=[],F="",D="elfinder-font-mono elfinder-info-hash";if(!y)return e.Deferred().reject();if(j.length)return j.elfinderdialog("toTop"),e.Deferred().resolve();if(f=m.storage("infohides")||m.arrayFlip(g.hideItems,!0),1===y){if(l=o[0],l.icon&&(F=" "+m.getIconStyle(l)),x=x.replace("{dirclass}",l.csscls?m.escape(l.csscls):"").replace("{class}",m.mime2class(l.mime)).replace("{style}",F),c=v.itemTitle.replace("{name}",m.escape(l.i18||l.name)).replace("{kind}",'<span title="'+m.escape(l.mime)+'">'+m.mime2kind(l)+"</span>"),s=m.tmb(l),l.read?"directory"!=l.mime||l.alias?r=m.formatSize(l.size):(r=v.spinner.replace("{text}",a.calc).replace("{name}","size"),I.push(l.hash)):r=a.unknown,!f.size&&w.push(b.replace(k,a.size).replace(C,r)),!f.aleasfor&&l.alias&&w.push(b.replace(k,a.aliasfor).replace(C,l.alias)),f.path||((u=m.path(l.hash,!0))?w.push(b.replace(k,a.path).replace(C,m.escape(u).replace(/(\/|\\)/g,"$1&#8203;")).replace("{class}","elfinder-info-path")):(w.push(b.replace(k,a.path).replace(C,v.spinner.replace("{text}",a.calc).replace("{name}","path")).replace("{class}","elfinder-info-path")),z.push(m.path(l.hash,!0,{notify:null}).fail(function(){S(a.unknown,"path")}).done(function(e){S(e.replace(/(\/|\\)/g,"$1&#8203;"),"path")})))),!f.link&&l.read){var U,E=m.escape(l.name);if("1"==l.url)w.push(b.replace(k,a.link).replace(C,'<button class="'+i+" "+n+'-url">'+a.getlink+"</button>"));else{if(l.url)U=l.url;else if("directory"===l.mime)if(g.nullUrlDirLinkSelf&&null===l.url){var P=window.location;U=P.pathname+P.search+"#elf_"+l.hash}else""!==l.url&&m.option("url",!m.isRoot(l)&&l.phash||l.hash)&&(U=m.url(l.hash));else U=m.url(l.hash);U&&w.push(b.replace(k,a.link).replace(C,'<a href="'+U+'" target="_blank">'+E+"</a>"))}}f.dim||(l.dim?w.push(b.replace(k,a.dim).replace(C,l.dim)):l.mime.indexOf("image")!==-1&&(l.width&&l.height?w.push(b.replace(k,a.dim).replace(C,l.width+"x"+l.height)):(w.push(b.replace(k,a.dim).replace(C,v.spinner.replace("{text}",a.calc).replace("{name}","dim"))),z.push(m.request({data:{cmd:"dim",target:l.hash},preventDefault:!0}).fail(function(){S(a.unknown,"dim")}).done(function(e){if(S(e.dim||a.unknown,"dim"),e.dim){var t=e.dim.split("x"),n=m.file(l.hash);n.width=t[0],n.height=t[1]}}))))),!f.modify&&w.push(b.replace(k,a.modify).replace(C,m.formatDate(l))),!f.perms&&w.push(b.replace(k,a.perms).replace(C,m.formatPermissions(l))),!f.locked&&w.push(b.replace(k,a.locked).replace(C,l.locked?a.yes:a.no)),!f.owner&&l.owner&&w.push(b.replace(k,a.owner).replace(C,l.owner)),!f.group&&l.group&&w.push(b.replace(k,a.group).replace(C,l.group)),!f.perm&&l.perm&&w.push(b.replace(k,a.perm).replace(C,m.formatFileMode(l.perm))),window.ArrayBuffer&&(m.options.cdns.sparkmd5||m.options.cdns.jssha)&&"directory"!==l.mime&&l.size>0&&(!g.showHashMaxsize||l.size<=g.showHashMaxsize)&&(h=[],e.each(m.storage("hashchekcer")||g.showHashAlgorisms,function(e,t){l[t]?w.push(b.replace(k,m.i18n(t)).replace(C,l[t]).replace("{class}",D)):(w.push(b.replace(k,m.i18n(t)).replace(C,v.spinner.replace("{text}",a.calc).replace("{name}",t))),h.push(t))}),z.push(m.getContentsHashes(l.hash,h).progress(function(t){e.each(h,function(e,n){t[n]&&S(t[n],n,D)})}).always(function(){e.each(h,function(e,t){S(a.unknown,t)})}))),g.custom&&e.each(g.custom,function(t,n){f[n.label]||n.mimes&&!e.grep(n.mimes,function(e){return l.mime===e||0===l.mime.indexOf(e+"/")}).length||n.hashRegex&&!l.hash.match(n.hashRegex)||(w.push(b.replace(k,m.i18n(n.label)).replace(C,n.tpl.replace("{id}",O))),n.action&&"function"==typeof n.action&&M.push(n.action))})}else x=x.replace("{class}","elfinder-cwd-icon-group"),c=v.groupTitle.replace("{items}",a.items).replace("{num}",y),d=e.grep(o,function(e){return"directory"==e.mime}).length,d?(p=e.grep(o,function(e){return!("directory"!==e.mime||e.phash&&!e.isroot)}).length,d-=p,w.push(b.replace(k,a.kind).replace(C,p===y||d===y?a[p?"roots":"folders"]:e.map({roots:p,folders:d,files:y-p-d},function(e,t){return e?a[t]+" "+e:null}).join(", "))),!f.size&&w.push(b.replace(k,a.size).replace(C,v.spinner.replace("{text}",a.calc).replace("{name}","size"))),I=e.map(o,function(e){return e.hash})):(r=0,e.each(o,function(e,t){var n=parseInt(t.size);n>=0&&r>=0?r+=n:r="unknown"}),w.push(b.replace(k,a.kind).replace(C,a.files)),!f.size&&w.push(b.replace(k,a.size).replace(C,m.formatSize(r))));return x=x.replace("{title}",c).replace("{content}",w.join("").replace(/{class}/g,"")),j=m.dialog(x,A),j.attr("id",O),l&&"1"==l.url&&j.on("click","."+n+"-url",function(){e(this).parent().html(v.spinner.replace("{text}",m.i18n("ntfurl")).replace("{name}","url")),m.request({data:{cmd:"url",target:l.hash},preventDefault:!0}).fail(function(){S(E,"url")}).done(function(e){if(e.url){S('<a href="'+e.url+'" target="_blank">'+E+"</a>"||E,"url");var t=m.file(l.hash);t.url=e.url}else S(E,"url")})}),s&&e("<img/>").on("load",function(){j.find(".elfinder-cwd-icon").addClass(s.className).css("background-image","url('"+s.url+"')")}).attr("src",s.url),I.length&&(T=m.getSize(I).done(function(e){S(e.formated,"size")}).fail(function(){S(a.unknown,"size")})),M.length&&e.each(M,function(e,t){try{t(l,m,j)}catch(n){m.debug("error",n)}}),e.Deferred().resolve()}}).prototype={forceLoad:!0},i.prototype.commands.mkdir=function(){var t,n=this.fm,i=this;this.value="",this.disableOnSearch=!0,this.updateOnSelect=!1,this.syncTitleOnChange=!0,this.mime="directory",this.prefix="untitled folder",this.exec=function(a,o){var r;return a&&a.length&&o&&o._currentType&&"navbar"===o._currentType?(this.origin=o._currentType,this.data={target:a[0]}):(r=n.cwd().hash===a[0],this.origin=t&&!r?t:"cwd",delete this.data),a||this.options.intoNewFolderToolbtn||n.getUI("cwd").trigger("unselectall"),this.move=this.value===n.i18n("cmdmkdirin"),e.proxy(n.res("mixin","make"),i)()},this.shortcuts=[{pattern:"ctrl+shift+n"}],this.init=function(){this.options.intoNewFolderToolbtn&&(this.syncTitleOnChange=!0)},n.bind("select contextmenucreate closecontextmenu",function(e){var a=(e.data?e.data.selected||e.data.targets:null)||n.selected();i.className="mkdir",t=e.data&&a.length?e.data.origin||e.data.type||"":"",i.options.intoNewFolderToolbtn||""!==t||(t="cwd"),a.length&&"navbar"!==t&&"cwd"!==t&&n.cwd().hash!==a[0]?(i.title=n.i18n("cmdmkdirin"),i.className+=" elfinder-button-icon-mkdirin"):i.title=n.i18n("cmdmkdir"),"closecontextmenu"!==e.type?i.update(void 0,i.title):requestAnimationFrame(function(){i.update(void 0,i.title)})}),this.getstate=function(i){var a=n.cwd(),o="navbar"===t||i&&i[0]!==a.hash?this.files(i||n.selected()):[],r=o.length;return"navbar"===t?r&&o[0].write&&o[0].read?0:-1:!a.write||r&&e.grep(o,function(e){return!(!e.read||e.locked)}).length!=r?-1:0}},i.prototype.commands.mkfile=function(){var t=this;this.disableOnSearch=!0,this.updateOnSelect=!1,this.mime="text/plain",this.prefix="untitled file.txt",this.variants=[],this.getTypeName=function(e,n){var i,a=t.fm;return i=(i=a.messages["kind"+a.kinds[e]])?n.toUpperCase()+" "+i:a.i18n(["extentionfile",n.toUpperCase()])},this.fm.bind("open reload canMakeEmptyFile",function(){var n=t.fm,i=n.storage("mkfileHides")||{};t.variants=[],n.mimesCanMakeEmpty&&e.each(n.mimesCanMakeEmpty,function(e,a){a&&!i[e]&&n.uploadMimeCheck(e)&&t.variants.push([e,t.getTypeName(e,a)])}),t.change()}),this.getstate=function(){return this.fm.cwd().write?0:-1},this.exec=function(n,i){var a,o,r=t.fm;if(a=r.mimesCanMakeEmpty[i]){if(r.uploadMimeCheck(i))return this.mime=i,this.prefix=r.i18n(["untitled file",a]),e.proxy(r.res("mixin","make"),t)();o=["errMkfile",t.getTypeName(i,a)]}return e.Deferred().reject(o)}},i.prototype.commands.netmount=function(){var t,n=this;this.alwaysEnabled=!0,this.updateOnSelect=!1,this.drivers=[],this.handlers={load:function(){var t=n.fm;n.drivers=t.netDrivers,n.drivers.length&&requestAnimationFrame(function(){e.each(n.drivers,function(){var e=n.options[this];e&&e.integrateInfo&&t.trigger("helpIntegration",Object.assign({cmd:"netmount"},e.integrateInfo))})})}},this.getstate=function(){return this.drivers.length?0:-1},this.exec=function(){var i,a=n.fm,o=e.Deferred(),r=n.options,s=function(){var s,l=function(){c.protocol.trigger("change","winfocus")},c={protocol:e("<select/>").on("change",function(e,n){var o=this.value;t.find(".elfinder-netmount-tr").hide(),t.find(".elfinder-netmount-tr-"+o).show(),i&&i.children(".ui-dialog-buttonpane:first").find("button").show(),"function"==typeof r[o].select&&r[o].select(a,e,n),requestAnimationFrame(function(){t.find("input:text.elfinder-tabstop:visible:first").trigger("focus")})}).addClass("ui-corner-all")},d={title:a.i18n("netMountDialogTitle"),resizable:!1,modal:!0,destroyOnClose:!1,open:function(){e(window).on("focus."+a.namespace,l),c.protocol.trigger("change")},close:function(){"pending"==o.state()&&o.reject(),e(window).off("focus."+a.namespace,l)},buttons:{}},p=function(){var i=c.protocol.val(),s={cmd:"netmount",protocol:i},l=r[i];return e.each(t.find("input.elfinder-netmount-inputs-"+i),function(t,n){var i,a;a=e(n),a.is(":radio,:checkbox")?a.is(":checked")&&(i=e.trim(a.val())):i=e.trim(a.val()),i&&(s[n.name]=i)}),s.host?(a.request({data:s,notify:{type:"netmount",cnt:1,hideCnt:!0}}).done(function(e){var t;e.added&&e.added.length&&(e.added[0].phash&&(t=a.file(e.added[0].phash))&&(t.dirs||(t.dirs=1,a.change({changed:[t]}))),a.one("netmountdone",function(){a.exec("open",e.added[0].hash)})),o.resolve()}).fail(function(e){l.fail&&"function"==typeof l.fail&&l.fail(a,e),o.reject(e)}),void n.dialog.elfinderdialog("close")):a.trigger("error",{error:"errNetMountHostReq",opts:{modal:!0}})},u=e('<form autocomplete="off"/>').on("keydown","input",function(t){var n,i=!0;t.keyCode===e.ui.keyCode.ENTER&&(e.each(u.find("input:visible:not(.elfinder-input-optional)"),function(){if(""===e(this).val())return i=!1,n=e(this),!1}),i?p():n.trigger("focus"))}),h=e("<div/>");return t=e('<table class="elfinder-info-tb elfinder-netmount-tb"/>').append(e("<tr/>").append(e("<td>"+a.i18n("protocol")+"</td>")).append(e("<td/>").append(c.protocol))),e.each(n.drivers,function(n,i){r[i]&&(c.protocol.append('<option value="'+i+'">'+a.i18n(r[i].name||i)+"</option>"),e.each(r[i].inputs,function(n,o){o.attr("name",n),"hidden"!=o.attr("type")?(o.addClass("ui-corner-all elfinder-netmount-inputs-"+i),t.append(e("<tr/>").addClass("elfinder-netmount-tr elfinder-netmount-tr-"+i).append(e("<td>"+a.i18n(n)+"</td>")).append(e("<td/>").append(o)))):(o.addClass("elfinder-netmount-inputs-"+i),h.append(o))}),r[i].protocol=c.protocol)}),t.append(h),t.find(".elfinder-netmount-tr").hide(),d.buttons[a.i18n("btnMount")]=p,d.buttons[a.i18n("btnCancel")]=function(){n.dialog.elfinderdialog("close")},t.find("select,input").addClass("elfinder-tabstop"),s=a.dialog(u.append(t),d),i=s.closest(".ui-dialog"),s.ready(function(){c.protocol.trigger("change"),s.elfinderdialog("posInit")}),s};return n.dialog?n.dialog.elfinderdialog("open"):n.dialog=s(),o.promise()},n.fm.bind("netmount",function(e){var i=e.data||null,a=n.options;i&&i.protocol&&a[i.protocol]&&"function"==typeof a[i.protocol].done&&(a[i.protocol].done(n.fm,i),t.find("select,input").addClass("elfinder-tabstop"),n.dialog.elfinderdialog("tabstopsInit"))})},i.prototype.commands.netunmount=function(){this.alwaysEnabled=!0,this.updateOnSelect=!1,this.drivers=[],this.handlers={load:function(){this.drivers=this.fm.netDrivers}},this.getstate=function(e){var t,n=this.fm;return e&&this.drivers.length&&!this._disabled&&(t=n.file(e[0]))&&t.netkey?0:-1},this.exec=function(t){var n=this,i=this.fm,a=e.Deferred().fail(function(e){e&&i.error(e)}),o=i.file(t[0]),r=function(t){var n,a=[];return i.leafRoots&&(n=[],e.each(i.leafRoots,function(a,o){var r,s=i.parents(a);(r=e.inArray(t,s))!==-1&&(r=s.length-r,e.each(o,function(e,t){n.push({i:r,hash:t})}))}),n.length&&(n.sort(function(e,t){return e.i<t.i}),e.each(n,function(e,t){a.push(t.hash)}))),a};return this._disabled?a.reject():("pending"==a.state()&&i.confirm({title:n.title,text:i.i18n("confirmUnmount",o.name),accept:{label:"btnUnmount",callback:function(){var t=o.hash,s=r(t),l=[],c=[],d=function(){e.when(l).done(function(){i.request({data:{cmd:"netmount",protocol:"netunmount",host:o.netkey,user:t,pass:"dum"},notify:{type:"netunmount",cnt:1,hideCnt:!0},preventFail:!0}).fail(function(e){a.reject(e)}).done(function(e){o.volumeid&&delete i.volumeExpires[o.volumeid],a.resolve()})}).fail(function(e){c.length&&i.remove({removed:c}),a.reject(e)})};s.length?i.confirm({title:n.title,text:function(){var t=["unmountChildren"];return e.each(s,function(e,n){t.push([i.file(n).name])}),t}(),accept:{label:"btnUnmount",callback:function(){e.each(s,function(e,t){var n=i.file(t);n.netkey&&l.push(i.request({data:{cmd:"netmount",protocol:"netunmount",host:n.netkey,user:n.hash,pass:"dum"},notify:{type:"netunmount",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){e.removed&&(n.volumeid&&delete i.volumeExpires[n.volumeid],c=c.concat(e.removed))}))}),d()}},cancel:{label:"btnCancel",callback:function(){a.reject()}}}):(l=null,d())}},cancel:{label:"btnCancel",callback:function(){a.reject()}}}),a)}},(i.prototype.commands.open=function(){var t=this.fm;this.alwaysEnabled=!0,this.noChangeDirOnRemovedCwd=!0,this._handlers={dblclick:function(e){e.preventDefault(),
t.exec("open",e.data&&e.data.file?[e.data.file]:void 0)},"select enable disable reload":function(e){this.update("disable"==e.type?-1:void 0)}},this.shortcuts=[{pattern:"ctrl+down numpad_enter"+("mac"!=t.OS&&" enter")}],this.getstate=function(n){var i=this.files(n),a=i.length;return 1==a?i[0].read?0:-1:a&&!t.UA.Mobile&&e.grep(i,function(e){return!("directory"==e.mime||!e.read)}).length==a?0:-1},this.exec=function(n,i){var a,o,r,s,l,c,d,p,u,h,f,m,g,v,b=e.Deferred().fail(function(e){e&&t.error(e)}),y=this.files(n),w=y.length,x="object"==typeof i&&i.thash,k=this.options,C=k.into||"window";if(!w&&!x)return b.reject();if(x||1==w&&(a=y[0])&&"directory"==a.mime)return x||!a||a.read?t.keyState.ctrlKey&&(t.keyState.shiftKey||"function"!=typeof t.options.getFileCallback)&&t.getCommand("opennew")?t.exec("opennew",[x?x:a.hash]):t.request({data:{cmd:"open",target:x||a.hash},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!0,lazy:!1}):b.reject(["errOpen",a.name,"errPerm"]);if(y=e.grep(y,function(e){return"directory"!=e.mime}),w!=y.length)return b.reject();var z=function(){var i,g,v;try{u=new RegExp(t.option("dispInlineRegex"),"i")}catch(x){u=!1}for(h=e("<a>").hide().appendTo(e("body")),f="string"==typeof h.get(0).download,w=y.length;w--;){if(g="elf_open_window",a=y[w],!a.read)return b.reject(["errOpen",a.name,"errPerm"]);if(m=u&&a.mime.match(u),o=t.openUrl(a.hash,!m),t.UA.Mobile||!m){if(f)m?h.attr("target","_blank"):h.attr("download",a.name),h.attr("href",o).get(0).click();else if(i=window.open(o),!i)return b.reject("errPopup")}else{if(v="string"==typeof k.method&&"get"===k.method.toLowerCase(),!v&&0===o.indexOf(t.options.url)&&t.customData&&Object.keys(t.customData).length&&!a.mime.match(/^(?:video|audio)/)&&(o=""),"window"===C?(l=d=Math.round(2*screen.availWidth/3),c=p=Math.round(2*screen.availHeight/3),parseInt(a.width)&&parseInt(a.height)?(l=parseInt(a.width),c=parseInt(a.height)):a.dim&&(r=a.dim.split("x"),l=parseInt(r[0]),c=parseInt(r[1])),d>=l&&p>=c?(d=l,p=c):l-d>c-p?p=Math.round(c*(d/l)):d=Math.round(l*(p/c)),s="width="+d+",height="+p,i=window.open(o,g,s+",top=50,left=50,scrollbars=yes,resizable=yes,titlebar=no")):("tabs"===C&&(g=a.hash),i=window.open("about:blank",g)),!i)return b.reject("errPopup");if(""===o){var z=document.createElement("form");z.action=t.options.url,z.method="POST",z.target=g,z.style.display="none";var T=Object.assign({},t.customData,{cmd:"file",target:a.hash,_t:a.ts||parseInt(+new Date/1e3)});e.each(T,function(e,t){var n=document.createElement("input");n.name=e,n.value=t,z.appendChild(n)}),document.body.appendChild(z),z.submit()}else"window"!==C&&(i.location=o);e(i).trigger("focus")}}return h.remove(),b.resolve(n)};if(w>1)t.confirm({title:"openMulti",text:["openMultiConfirm",w+""],accept:{label:"cmdopen",callback:function(){z()}},cancel:{label:"btnCancel",callback:function(){b.reject()}},buttons:t.getCommand("zipdl")&&t.isCommandEnabled("zipdl",t.cwd().hash)?[{label:"cmddownload",callback:function(){t.exec("download",n),b.reject()}}]:[]});else{if(g=t.storage("selectAction")||k.selectAction,g&&(e.each(g.split("/"),function(){var e=this.valueOf();return("open"===e||!(v=t.getCommand(e))||!v.enabled())&&void(v=null)}),v))return t.exec(v.name);z()}return b}}).prototype={forceLoad:!0},i.prototype.commands.opendir=function(){this.alwaysEnabled=!0,this.getstate=function(){var e,t=this.fm.selected(),n=t.length;return 1!==n?-1:(e=this.fm.getUI("workzone"),e.hasClass("elfinder-search-result")?0:-1)},this.exec=function(t){var n,i=this.fm,a=e.Deferred(),o=this.files(t),r=o.length;return r&&o[0].phash?(n=o[0].phash,i.trigger("searchend",{noupdate:!0}),i.request({data:{cmd:"open",target:n},notify:{type:"open",cnt:1,hideCnt:!0},syncOnFail:!1}),a):a.reject()}},i.prototype.commands.opennew=function(){var t=this.fm;this.shortcuts=[{pattern:("function"==typeof t.options.getFileCallback?"shift+":"")+"ctrl+enter"}],this.getstate=function(e){var t=this.files(e),n=t.length;return 1===n&&"directory"===t[0].mime&&t[0].read?0:-1},this.exec=function(t){var n,i,a,o,r=e.Deferred(),s=this.files(t),l=s.length,c=this.options;return 1===l&&(n=s[0])&&"directory"===n.mime?(i=window.location,a=c.url?c.url:i.pathname,c.useOriginQuery&&(a.match(/\?/)?i.search&&(a+="&"+i.search.substr(1)):a+=i.search),a+="#elf_"+n.hash,o=window.open(a,"_blank"),setTimeout(function(){o.focus()},1e3),r.resolve()):r.reject()}},i.prototype.commands.paste=function(){this.updateOnSelect=!1,this.handlers={changeclipboard:function(){this.update()}},this.shortcuts=[{pattern:"ctrl+v shift+insert"}],this.getstate=function(e){if(this._disabled)return-1;if(e){if(Array.isArray(e)){if(1!=e.length)return-1;e=this.fm.file(e[0])}}else e=this.fm.cwd();return this.fm.clipboard().length&&"directory"==e.mime&&e.write?0:-1},this.exec=function(t,n){var i,a,o=this,r=o.fm,s=n||{},l=t?this.files(t)[0]:r.cwd(),c=r.clipboard(),d=c.length,p=!!d&&c[0].cut,u=s._cmd?s._cmd:p?"move":"copy",h="err"+u.charAt(0).toUpperCase()+u.substr(1),f=[],m=[],g=e.Deferred().fail(function(e){e&&r.error(e)}).always(function(){r.unlockfiles({files:e.map(c,function(e){return e.hash})})}),v=function(t){return t.length&&r._commands.duplicate?r.exec("duplicate",t):e.Deferred().resolve()},b=function(t){var n,i=e.Deferred(),a=[],c={},d=function(t,n){for(var i=[],a=t.length;a--;)e.inArray(t[a].name,n)!==-1&&i.unshift(a);return i},h=function(e){var n=a[e],o=t[n],s=e==a.length-1;o&&r.confirm({title:r.i18n(u+"Files"),text:["errExists",o.name,"restore"===u?"confirmRest":"confirmRepl"],all:!s,accept:{label:"btnYes",callback:function(n){s||n?m(t):h(++e)}},reject:{label:"btnNo",callback:function(n){var i;if(n)for(i=a.length;e<i--;)t[a[i]].remove=!0;else t[a[e]].remove=!0;s||n?m(t):h(++e)}},cancel:{label:"btnCancel",callback:function(){i.resolve()}},buttons:[{label:"btnBackup",callback:function(n){var i;if(n)for(i=a.length;e<i--;)t[a[i]].rename=!0;else t[a[e]].rename=!0;s||n?m(t):h(++e)}}]})},f=function(n){var i,o={};n&&(Array.isArray(n)?n.length&&("string"==typeof n[0]?a=d(t,n):(e.each(n,function(e,t){o[t.name]=t.hash}),a=d(t,e.map(o,function(e,t){return t})),e.each(t,function(e,t){o[t.name]&&(c[o[t.name]]=t.name)}))):(i=[],a=e.map(n,function(e){return"string"==typeof e?e:(i=i.concat(e),!1)}),i.length&&(a=a.concat(i)),a=d(t,a),c=n)),a.length?h(0):m(t)},m=function(t){var n,a,o=[],d=e.grep(t,function(e){return e.rename&&o.push(e.name),!e.remove}),h=d.length;return h?(n=e.map(d,function(e){return e.hash}),a={cmd:"paste",dst:l.hash,targets:n,cut:p?1:0,renames:o,hashes:c,suffix:r.options.backupSuffix},r.api<2.1&&(a.src=d[0].phash),void r.request({data:a,notify:{type:u,cnt:h},navigate:{toast:s.noToast?{}:{inbuffer:{msg:r.i18n(["complete",r.i18n("cmd"+u)]),action:{cmd:"open",msg:"cmdopendir",data:[l.hash],done:"select",cwdNot:l.hash}}}}}).done(function(t){var n={},o=t.added&&t.added.length?t.added:null;p&&o&&(e.each(d,function(t,i){var a=i.phash,r=function(t){var n;return e.each(o,function(e,i){if(i.name===t)return n=i.hash,!1}),n},s=r(i.name);s&&(n[a]?n[a].push(s):n[a]=[s])}),Object.keys(n).length&&(t.undo={cmd:"move",callback:function(){var t=[];return e.each(n,function(e,n){t.push(r.request({data:{cmd:"paste",dst:e,targets:n,cut:1},notify:{type:"undo",cnt:n.length}}))}),e.when.apply(null,t)}},t.redo={cmd:"move",callback:function(){return r.request({data:a,notify:{type:"redo",cnt:h}})}})),i.resolve(t)}).fail(function(){i.reject()}).always(function(){r.unlockfiles({files:d})})):i.resolve()};return r.isCommandEnabled(o.name,l.hash)&&t.length?(r.oldAPI?m(t):r.option("copyOverwrite",l.hash)?(n=e.map(t,function(e){return e.name}),l.hash==r.cwd().hash?f(e.map(r.files(),function(e){return e.phash==l.hash?{hash:e.hash,name:e.name}:null})):r.request({data:{cmd:"ls",target:l.hash,intersect:n},notify:{type:"prepare",cnt:1,hideCnt:!0},preventFail:!0}).always(function(e){f(e.list)})):m(t),i):i.resolve()};return d&&l&&"directory"==l.mime?l.write?(i=r.parents(l.hash),e.each(c,function(t,n){return n.read?p&&n.locked?!g.reject(["errLocked",n.name]):e.inArray(n.hash,i)!==-1?!g.reject(["errCopyInItself",n.name]):n.mime&&"directory"!==n.mime&&!r.uploadMimeCheck(n.mime,l.hash)?!g.reject([h,n.name,"errUploadMime"]):(a=r.parents(n.hash),a.pop(),e.inArray(l.hash,a)!==-1&&e.grep(a,function(e){var t=r.file(e);return t.phash==l.hash&&t.name==n.name}).length?!g.reject(["errReplByChild",n.name]):void(n.phash==l.hash?m.push(n.hash):f.push({hash:n.hash,phash:n.phash,name:n.name}))):!g.reject([h,n.name,"errPerm"])}),"rejected"==g.state()?g:(e.when(v(m),b(f)).done(function(e,t){g.resolve(t&&t.undo?t:void 0)}).fail(function(){g.reject()}).always(function(){p&&r.clipboard([])}),g)):g.reject([h,c[0].name,"errPerm"]):g.reject()}},i.prototype.commands.places=function(){var t=this,n=this.fm,i=function(n){return e.grep(t.files(n),function(e){return"directory"==e.mime})},a=null;this.getstate=function(e){var t=this.hashes(e),n=t.length;return a&&n&&n==i(t).length?0:-1},this.exec=function(t){var n=this.files(t);return a.trigger("regist",[n]),e.Deferred().resolve()},n.one("load",function(){a=n.ui.places})},i.prototype.commands.preference=function(){var t,n,i=this,a=this.fm,o="replace",r='<li class="ui-state-default ui-corner-top elfinder-preference-tab-{id}"><a href="#'+a.namespace+'-preference-{id}" id="'+a.namespace+'-preference-tab-{id}" class="{class}">{title}</a></li>',s=e('<div class="ui-tabs ui-widget ui-widget-content ui-corner-all elfinder-preference">'),l=e('<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">'),c=e('<div class="elfinder-preference-tabs ui-tabs-panel ui-widget-content ui-corner-bottom"/>'),d=(e("base").length?document.location.href.replace(/#.*$/,""):"",function(t){e("#"+a.namespace+"-preference-tab-"+t).trigger("mouseover").trigger("click"),n=t}),p=function(){var p=i.options.categories||{language:["language"],toolbar:["toolbarPref"],workspace:["iconSize","columnPref","selectAction","makefileTypes","useStoredEditor","editorMaximized","showHidden"],dialog:["autoFocusDialog"],selectionInfo:["infoItems","hashChecker"],reset:["clearBrowserData"],all:!0},u=i.options.prefs||["language","toolbarPref","iconSize","columnPref","selectAction","makefileTypes","useStoredEditor","editorMaximized","showHidden","infoItems","hashChecker","autoFocusDialog","clearBrowserData"];u=a.arrayFlip(u,!0),a.options.getFileCallback&&delete u.selectAction,u.language&&(u.language=function(){var t=e("<select/>").on("change",function(){var t=e(this).val();a.storage("lang",t),e("#"+a.id).elfinder("reload")}),n=[],o=i.options.langs||{ar:"اللغة العربية",bg:"Български",ca:"Català",cs:"Čeština",da:"Dansk",de:"Deutsch",el:"Ελληνικά",en:"English",es:"Español",fa:"فارسی",fo:"Føroyskt",fr:"Français",he:"עברית",hr:"Hrvatski",hu:"Magyar",id:"Bahasa Indonesia",it:"Italiano",ja:"日本語",ko:"한국어",nl:"Nederlands",no:"Norsk",pl:"Polski",pt_BR:"Português",ro:"Română",ru:"Pусский",si:"සිංහල",sk:"Slovenčina",sl:"Slovenščina",sr:"Srpski",sv:"Svenska",tr:"Türkçe",ug_CN:"ئۇيغۇرچە",uk:"Український",vi:"Tiếng Việt",zh_CN:"简体中文",zh_TW:"正體中文"};return e.each(o,function(e,t){n.push('<option value="'+e+'">'+t+"</option>")}),t.append(n.join("")).val(a.lang)}()),u.toolbarPref&&(u.toolbarPref=function(){var t=e.map(a.options.uiOptions.toolbar,function(t){return e.isArray(t)?t:null}),n=[],i=a.storage("toolbarhides")||{};return e.each(t,function(){var e=this,t=a.i18n("cmd"+e);t==="cmd"+e&&(t=a.i18n(e)),n.push('<span class="elfinder-preference-toolbar-item"><label><input type="checkbox" value="'+e+'" '+(i[e]?"":"checked")+"/>"+t+"</label></span>")}),e(n.join(" ")).on("change","input",function(){var t=e(this).val(),n=e(this).is(":checked");n||i[t]?n&&i[t]&&delete i[t]:i[t]=!0,a.storage("toolbarhides",i),a.trigger("toolbarpref")})}()),u.iconSize&&(u.iconSize=function(){var t=a.options.uiOptions.cwd.iconsView.sizeMax||3,n=a.storage("iconsize")||0,i=e('<div class="touch-punch"/>').slider({classes:{"ui-slider-handle":"elfinder-tabstop"},value:n,max:t,slide:function(e,t){a.getUI("cwd").trigger("iconpref",{size:t.value})},change:function(e,t){a.storage("iconsize",t.value)}});return a.getUI("cwd").on("iconpref",function(e,t){i.slider("option","value",t.size)}),i}()),u.columnPref&&(u.columnPref=function(){var t=a.options.uiOptions.cwd.listView.columns,n=[],i=a.storage("columnhides")||{};return e.each(t,function(){var e=this,t=a.getColumnName(e);n.push('<span class="elfinder-preference-column-item"><label><input type="checkbox" value="'+e+'" '+(i[e]?"":"checked")+"/>"+t+"</label></span>")}),e(n.join(" ")).on("change","input",function(){var t=e(this).val(),n=e(this).is(":checked");n||i[t]?n&&i[t]&&delete i[t]:i[t]=!0,a.storage("columnhides",i),a.trigger("columnpref",{repaint:!0})})}()),u.selectAction&&(u.selectAction=function(){var t=e("<select/>").on("change",function(){var t=e(this).val();a.storage("selectAction","default"===t?null:t)}),n=[],o=i.options.selectActions,r=a.getCommand("open").options.selectAction||"open";return e.inArray(r,o)===-1&&o.unshift(r),e.each(o,function(t,i){var o=e.map(i.split("/"),function(e){var t=a.i18n("cmd"+e);return t==="cmd"+e&&(t=a.i18n(e)),t});n.push('<option value="'+i+'">'+o.join("/")+"</option>")}),t.append(n.join("")).val(a.storage("selectAction")||r)}()),u.makefileTypes&&(u.makefileTypes=function(){var t=a.storage("mkfileHides")||{},n=function(){var n=[];return t=a.storage("mkfileHides")||{},e.each(a.mimesCanMakeEmpty,function(e,i){var o=a.getCommand("mkfile").getTypeName(e,i);n.push('<span class="elfinder-preference-column-item" title="'+a.escape(o)+'"><label><input type="checkbox" value="'+e+'" '+(t[e]?"":"checked")+"/>"+i+"</label></span>")}),n.join(" ")},i=e("<div/>").on("change","input",function(){var n=e(this).val(),i=e(this).is(":checked");i||t[n]?i&&t[n]&&delete t[n]:t[n]=!0,a.storage("mkfileHides",t),a.trigger("canMakeEmptyFile")}).append(n()),o=e("<div/>").append(e('<input type="text" placeholder="'+a.i18n("typeOfTextfile")+'"/>').on("keydown",function(t){t.keyCode===e.ui.keyCode.ENTER&&e(this).next().trigger("click")}),e('<button class="ui-button"/>').html(a.i18n("add")).on("click",function(){var t,n=e(this).prev(),i=n.val(),o=a.getUI("toast"),r=function(){return o.appendTo(n.closest(".ui-dialog")),a.toast({msg:a.i18n("errUsupportType"),mode:"warning",onHidden:function(){1===o.children().length&&o.appendTo(a.getUI())}}),n.trigger("focus"),!1};if(!i.match(/\//)){if(i=a.arrayFlip(a.mimeTypes)[i],!i)return r();n.val(i)}return a.mimeIsText(i)&&a.mimeTypes[i]?(a.trigger("canMakeEmptyFile",{mimes:[i],unshift:!0}),t={},t[i]=a.mimeTypes[i],a.storage("mkfileTextMimes",Object.assign(t,a.storage("mkfileTextMimes")||{})),n.val(""),o.appendTo(n.closest(".ui-dialog")),void a.toast({msg:a.i18n(["complete",i+" ("+t[i]+")"]),onHidden:function(){1===o.children().length&&o.appendTo(a.getUI())}})):r()}),e('<button class="ui-button"/>').html(a.i18n("reset")).on("click",function(){a.one("canMakeEmptyFile",{done:function(){i.empty().append(n())}}),a.trigger("canMakeEmptyFile",{resetTexts:!0})}));return a.bind("canMakeEmptyFile",{done:function(e){e.data&&e.data.mimes&&e.data.mimes.length&&i.empty().append(n())}}),e("<div/>").append(i,o)}()),u.useStoredEditor&&(u.useStoredEditor=e('<input type="checkbox"/>').prop("checked",function(){var e=a.storage("useStoredEditor");return e?e>0:a.options.commandsOptions.edit.useStoredEditor}()).on("change",function(t){a.storage("useStoredEditor",e(this).is(":checked")?1:-1)})),u.editorMaximized&&(u.editorMaximized=e('<input type="checkbox"/>').prop("checked",function(){var e=a.storage("editorMaximized");return e?e>0:a.options.commandsOptions.edit.editorMaximized}()).on("change",function(t){a.storage("editorMaximized",e(this).is(":checked")?1:-1)})),u.showHidden&&!function(){var t,n=function(){var n,i=a.storage("hide"),o=[];i&&i.items&&e.each(i.items,function(e,t){o.push(a.escape(t))}),r.prop("disabled",!o.length)[o.length?"removeClass":"addClass"]("ui-state-disabled"),n=o.length?o.join("\n"):"",u.showHidden.attr("title",n),t&&u.showHidden.tooltip("option","content",n.replace(/\n/g,"<br>")).tooltip("close")},i=e('<input type="checkbox"/>').prop("checked",function(){var e=a.storage("hide");return e&&e.show}()).on("change",function(t){var n={};n[e(this).is(":checked")?"show":"hide"]=!0,a.exec("hide",void 0,n)}),o=e('<button class="ui-button ui-corner-all ui-widget"/>').append(a.i18n("reset")).on("click",function(){a.exec("hide",void 0,{reset:!0}),e(this).parent().find("input:first").prop("checked",!1),n()}),r=e().add(i).add(o);u.showHidden=e("<div/>").append(i,o),a.bind("hide",function(e){var t=e.data;t.opts&&(t.opts.show||t.opts.hide)||n()}),a.UA.Mobile&&e.fn.tooltip&&(t=!0,u.showHidden.tooltip({classes:{"ui-tooltip":"elfinder-ui-tooltip ui-widget-shadow"},tooltipClass:"elfinder-ui-tooltip ui-widget-shadow",track:!0}).css("user-select","none"),o.css("user-select","none")),n()}(),u.infoItems&&(u.infoItems=function(){var t=a.getCommand("info").items,n=[],i=a.storage("infohides")||a.arrayFlip(a.options.commandsOptions.info.hideItems,!0);return e.each(t,function(){var e=this,t=a.i18n(e);n.push('<span class="elfinder-preference-info-item"><label><input type="checkbox" value="'+e+'" '+(i[e]?"":"checked")+"/>"+t+"</label></span>")}),e(n.join(" ")).on("change","input",function(){var t=e(this).val(),n=e(this).is(":checked");n||i[t]?n&&i[t]&&delete i[t]:i[t]=!0,a.storage("infohides",i),a.trigger("infopref",{repaint:!0})})}()),u.hashChecker&&a.hashCheckers.length&&(u.hashChecker=function(){var t=[],n=a.arrayFlip(a.storage("hashchekcer")||a.options.commandsOptions.info.showHashAlgorisms,!0);return e.each(a.hashCheckers,function(){var e=this,i=a.i18n(e);t.push('<span class="elfinder-preference-hashchecker-item"><label><input type="checkbox" value="'+e+'" '+(n[e]?"checked":"")+"/>"+i+"</label></span>")}),e(t.join(" ")).on("change","input",function(){var t=e(this).val(),i=e(this).is(":checked");i?n[t]=!0:n[t]&&delete n[t],a.storage("hashchekcer",e.grep(a.hashCheckers,function(e){return n[e]}))})}()),u.autoFocusDialog&&(u.autoFocusDialog=e('<input type="checkbox"/>').prop("checked",function(){var e=a.storage("autoFocusDialog");return e?e>0:a.options.uiOptions.dialog.focusOnMouseOver}()).on("change",function(t){a.storage("autoFocusDialog",e(this).is(":checked")?1:-1)})),u.clearBrowserData&&(u.clearBrowserData=e("<button/>").text(a.i18n("reset")).button().on("click",function(t){t.preventDefault(),a.storage(),e("#"+a.id).elfinder("reload")})),e.each(p,function(t,i){var s,d;i===!0?d=1:i&&(s=e(),e.each(i,function(t,n){var i,o,r,l="";(i=u[n])&&(d=2,o=a.i18n(n),r=e(i).filter('input[type="checkbox"]'),r.length||(r=e(i).find('input[type="checkbox"]')),1===r.length?(r.attr("id")||r.attr("id","elfinder-preference-"+n+"-checkbox"),o='<label for="'+r.attr("id")+'">'+o+"</label>"):r.length>1&&(l=" elfinder-preference-checkboxes"),s=s.add(e('<dt class="elfinder-preference-'+n+l+'">'+o+"</dt>")).add(e('<dd class="elfinder-preference-'+n+l+'"/>').append(i)))})),d&&(l.append(r[o](/\{id\}/g,t)[o](/\{title\}/,a.i18n(t))[o](/\{class\}/,n===t?"elfinder-focus":"")),2===d&&c.append(e('<div id="'+a.namespace+"-preference-"+t+'" class="elfinder-preference-content"/>').hide().append(e("<dl/>").append(s))))}),l.on("click","a",function(t){var n=e(t.target),i=n.attr("href");t.preventDefault(),t.stopPropagation(),l.children().removeClass("ui-tabs-selected ui-state-active"),n.removeClass("ui-state-hover").parent().addClass("ui-tabs-selected ui-state-active"),i.match(/all$/)?c.children().show():(c.children().hide(),e(i).show())}),s.append(l,c).find("a,input,select,button").addClass("elfinder-tabstop"),t=a.dialog(s,{title:i.title,width:600,height:400,maxWidth:"window",maxHeight:"window",autoOpen:!1,destroyOnClose:!1,allowMinimize:!1,open:function(){n&&d(n),n=null},resize:function(){c.height(t.height()-l.outerHeight(!0)-(c.outerHeight(!0)-c.height())-5)}}).on("click",function(e){e.stopPropagation()}).css({overflow:"hidden"}),t.closest(".ui-dialog").css({overflow:"hidden"}).addClass("elfinder-bg-translucent"),n="all"};this.shortcuts=[{pattern:"ctrl+comma",description:this.title}],this.alwaysEnabled=!0,this.getstate=function(){return 0},this.exec=function(n,i){return!t&&p(),i&&(i.tab?d(i.tab):"cwd"===i._currentType&&d("workspace")),t.elfinderdialog("open"),e.Deferred().resolve()}},(i.prototype.commands.quicklook=function(){var t,n,i,a,o,r,s,l,c,d,p=this,u=p.fm,h=0,f=1,m=2,g=3,v=4,b=h,y=Element.update?"quicklookupdate":"update",w="elfinder-quicklook-navbar-icon",x="elfinder-quicklook-fullscreen",k="elfinder-quicklook-info-wrapper",C=function(t){e(document).trigger(e.Event("keydown",{keyCode:t,ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}))},z=function(e){var t=u.getUI().offset(),n=function(){var t=e.find(".elfinder-cwd-file-wrapper");return t.length?t:e}(),i=n.offset()||{top:0,left:0};return{opacity:0,width:n.width(),height:n.height()-30,top:i.top-t.top,left:i.left-t.left}},T=function(){var i=p.options.contain,a=i?u.getUI():e(window),o=u.getUI().offset(),r=Math.min(t,a.width()-10),s=Math.min(n,a.height()-80);return{opacity:1,width:r,height:s,top:parseInt((a.height()-s-60)/2+(i?0:a.scrollTop()-o.top)),left:parseInt((a.width()-r)/2+(i?0:a.scrollLeft()-o.left))}},A={},I=function(e,t){var n=t||e.substr(0,e.indexOf("/")),i=A[n]?A[n]:A[n]=document.createElement(n),a=!1;try{a=i.canPlayType&&i.canPlayType(e)}catch(o){}return!(!a||""===a||"no"==a)},S=window.navigator.platform.indexOf("Win")!=-1,O=!1,j=!1,M=!1,F=null,D=e.ui.keyCode.LEFT,U=e.ui.keyCode.RIGHT,E="mousemove touchstart "+("onwheel"in document?"wheel":"onmousewheel"in document?"mousewheel":"DOMMouseScroll"),P=e('<div class="elfinder-quicklook-title"/>'),R=e("<div/>"),q=e('<div class="elfinder-quicklook-info"/>'),H=e('<div class="ui-front elfinder-quicklook-cover"/>'),_=e('<div class="'+w+" "+w+'-fullscreen"/>').on("click touchstart",function(t){if(!M){var n=p.window,i=n.hasClass(x),o=e(window),r=function(){p.preview.trigger("changesize")};t.stopPropagation(),t.preventDefault(),i?(J="",L(),n.toggleClass(x).css(n.data("position")),o.trigger(p.resize).off(p.resize,r),K.off("mouseenter mouseleave"),H.off(E)):(n.toggleClass(x).data("position",{left:n.css("left"),top:n.css("top"),width:n.width(),height:n.height(),display:"block"}).removeAttr("style"),e(window).on(p.resize,r).trigger(p.resize),H.on(E,function(e){j||("mousemove"!==e.type&&"touchstart"!==e.type||(L(),F=setTimeout(function(){(u.UA.Mobile||K.parent().find(".elfinder-quicklook-navbar:hover").length<1)&&K.fadeOut("slow",function(){H.show()})},3e3)),H.is(":visible")&&(W(),H.data("tm",setTimeout(function(){H.show()},3e3))))}).show().trigger("mousemove"),K.on("mouseenter mouseleave",function(e){j||("mouseenter"===e.type?L():H.trigger("mousemove"))})),u.zIndex&&n.css("z-index",u.zIndex+1),u.UA.Mobile?K.attr("style",J):K.attr("style",J).draggable(i?"destroy":{start:function(){j=!0,M=!0,H.show(),L()},stop:function(){j=!1,J=p.navbar.attr("style"),requestAnimationFrame(function(){M=!1})}}),e(this).toggleClass(w+"-fullscreen-off");var s=n;a.is(".ui-resizable")&&(s=s.add(a)),s.resizable(i?"enable":"disable").removeClass("ui-state-disabled"),n.trigger("viewchange")}}),N=function(){p.update(void 0,function(){var t=p.fm,n=t.selectedFiles(),i=n.length,a=(p.docked(),function(){var a=0;return e.each(n,function(e,t){var n=parseInt(t.ts);a>=0?n>a&&(a=n):a="unknown"}),{hash:n[0].hash+"/"+ +new Date,name:t.i18n("items")+": "+i,mime:"group",size:G,ts:a,files:e.map(n,function(e){return e.hash}),getSize:!0}});return i||(i=1,n=[t.cwd()]),1===i?n[0]:a()}())},L=function(){p.window.hasClass(x)&&(F&&clearTimeout(F),F=null,K.stop(!0,!0).css("display","block"),W())},W=function(){H.data("tm")&&clearTimeout(H.data("tm")),H.removeData("tm"),H.hide()},B=e('<div class="'+w+" "+w+'-prev"/>').on("click touchstart",function(e){return!M&&C(D),!1}),$=e('<div class="'+w+" "+w+'-next"/>').on("click touchstart",function(e){return!M&&C(U),!1}),K=e('<div class="elfinder-quicklook-navbar"/>').append(B).append(_).append($).append('<div class="elfinder-quicklook-navbar-separator"/>').append(e('<div class="'+w+" "+w+'-close"/>').on("click touchstart",function(e){return!M&&p.window.trigger("close"),!1})),V=e('<span class="ui-front ui-icon elfinder-icon-close ui-icon-closethick"/>').on("mousedown",function(e){e.stopPropagation(),p.window.trigger("close")}),X=e('<span class="ui-front ui-icon elfinder-icon-minimize ui-icon-minusthick"/>').on("mousedown",function(e){e.stopPropagation(),p.docked()?p.window.trigger("navdockout"):p.window.trigger("navdockin")}),G='<span class="elfinder-info-spinner"/>'+u.i18n("calc"),J="",Y=!0;this.cover=H,this.evUpdate=y,(this.navbar=K)._show=L,this.resize="resize."+u.namespace,this.info=e("<div/>").addClass(k).append(R).append(q),this.autoPlay=function(){return!!p.opened()&&!!p.options[p.docked()?"dockAutoplay":"autoplay"]},this.preview=e('<div class="elfinder-quicklook-preview ui-helper-clearfix"/>').on("change",function(){L(),K.attr("style",J),p.docked()&&K.hide(),p.preview.attr("style","").removeClass("elfinder-overflow-auto"),p.info.attr("style","").hide(),p.cover.removeClass("elfinder-quicklook-coverbg"),R.removeAttr("class").attr("style",""),q.html("")}).on(y,function(t){var n,i,a=(p.preview,t.file),r='<div class="elfinder-quicklook-info-data">{value}</div>',s=function(){var s=p.window.css("overflow","hidden");i=u.escape(a.i18||a.name),!a.read&&t.stopImmediatePropagation(),p.window.data("hash",a.hash),p.preview.off("changesize").trigger("change").children().remove(),P.html(i),B.css("visibility",""),$.css("visibility",""),a.hash===u.cwdId2Hash(o.find("[id]:not(.elfinder-cwd-parent):first").attr("id"))&&B.css("visibility","hidden"),a.hash===u.cwdId2Hash(o.find("[id]:last").attr("id"))&&$.css("visibility","hidden"),"directory"===a.mime?c=[a.hash]:"group"===a.mime&&a.getSize&&(c=a.files),q.html(r.replace(/\{value\}/,i)+r.replace(/\{value\}/,u.mime2kind(a))+r.replace(/\{value\}/,c.length?G:u.formatSize(a.size))+r.replace(/\{value\}/,u.i18n("modify")+": "+u.formatDate(a))),c.length&&(l=u.getSize(c).done(function(e){q.find("span.elfinder-info-spinner").parent().html(e.formated)}).fail(function(){q.find("span.elfinder-info-spinner").parent().html(u.i18n("unknown"))}).always(function(){l=null}),l._hash=a.hash),R.addClass("elfinder-cwd-icon ui-corner-all "+u.mime2class(a.mime)),a.icon&&R.css(u.getIconStyle(a,!0)),p.info.attr("class",k),a.csscls&&p.info.addClass(a.csscls),a.read&&(n=u.tmb(a))&&e("<img/>").hide().appendTo(p.preview).on("load",function(){R.addClass(n.className).css("background-image","url('"+n.url+"')"),e(this).remove()}).attr("src",n.url),p.info.delay(100).fadeIn(10),p.window.hasClass(x)&&H.trigger("mousemove"),s.css("overflow","")},c=[];a&&!Object.keys(a).length&&(a=u.cwd()),a&&l&&"pending"===l.state()&&l._hash!==a.hash&&l.reject(),a&&(t.forceUpdate||p.window.data("hash")!==a.hash)?s():t.stopImmediatePropagation()}),this.window=e('<div class="ui-front ui-helper-reset ui-widget elfinder-quicklook touch-punch" style="position:absolute"/>').hide().addClass(u.UA.Touch?"elfinder-touch":"").on("click",function(e){var t=this;e.stopPropagation(),b===m&&requestAnimationFrame(function(){b===m&&u.toFront(t)})}).append(e('<div class="elfinder-quicklook-titlebar"/>').append(P,e('<span class="elfinder-quicklook-titlebar-icon'+(S?" elfinder-platformWin":"")+'"/>').append(V,X)),this.preview,p.info.hide(),H.hide(),K).draggable({handle:"div.elfinder-quicklook-titlebar"}).on("open",function(t,n){var i=p.window,a=p.value,o=u.getUI("cwd"),s=function(e){b=e,p.update(1,p.value),p.change(),i.trigger("resize."+u.namespace)};Y||b!==h?b===v&&(u.getUI("navdock").data("addNode")(c),s(g),p.preview.trigger("changesize"),u.storage("previewDocked","1"),0===u.getUI("navdock").width()&&i.trigger("navdockout")):(a&&a.hash!==r&&(o=e("#"+u.cwdHash2Id(a.hash.split("/",2)[0]))),J="",K.attr("style",""),b=f,o.trigger("scrolltoview"),W(),i.css(n||z(o)).show().animate(T(),550,function(){s(m),L()}),u.toFront(i))}).on("close",function(e,t){var n,i=p.window,a=p.preview.trigger("change"),r=(p.value,(i.data("hash")||"").split("/",2)[0]),s=function(e,n){b=e,n&&u.toHide(i),a.children().remove(),p.update(0,p.value),i.data("hash",""),t&&t.resolve()};p.opened()&&(l&&"pending"===l.state()&&l.reject(),p.docked()?(c=u.getUI("navdock").data("removeNode")(p.window.attr("id"),"detach"),s(v),u.storage("previewDocked","2")):(b=f,i.hasClass(x)&&_.click(),r&&(n=o.find("#"+r)).length?i.animate(z(n),500,function(){s(h,!0)}):s(h,!0)))}).on("navdockin",function(e,t){var n=p.window,a=u.getUI("navdock"),o=s||a.width(),r=t||{};Y&&(r.init=!0),b=g,i=n.attr("style"),n.toggleClass("ui-front").removeClass("ui-widget").draggable("disable").resizable("disable").removeAttr("style").css({width:"100%",height:o,boxSizing:"border-box",paddingBottom:0,zIndex:"unset"}),K.hide(),X.toggleClass("ui-icon-plusthick ui-icon-minusthick elfinder-icon-full elfinder-icon-minimize"),u.toHide(n,!0),a.data("addNode")(n,r),p.preview.trigger("changesize"),u.storage("previewDocked","1")}).on("navdockout",function(t){var n=p.window,a=u.getUI("navdock"),o=(e.Deferred(),z(p.preview));s=n.outerHeight(),a.data("removeNode")(n.attr("id"),u.getUI()),n.toggleClass("ui-front").addClass("ui-widget").draggable("enable").resizable("enable").attr("style",i),X.toggleClass("ui-icon-plusthick ui-icon-minusthick elfinder-icon-full elfinder-icon-minimize"),b=h,n.trigger("open",o),u.storage("previewDocked","0")}).on("resize."+u.namespace,function(){p.preview.trigger("changesize")}),this.alwaysEnabled=!0,this.value=null,this.handlers={select:function(e,t){d&&cancelAnimationFrame(d),e.data&&e.data.selected&&e.data.selected.length?p.opened()&&N():d=requestAnimationFrame(function(){p.opened()&&N()})},error:function(){p.window.is(":visible")&&p.window.trigger("close")},"searchshow searchhide":function(){this.opened()&&this.window.trigger("close")},navbarshow:function(){requestAnimationFrame(function(){p.docked()&&p.preview.trigger("changesize")})},destroy:function(){p.window.remove()}},this.shortcuts=[{pattern:"space"}],this.support={audio:{ogg:I("audio/ogg;"),webm:I("audio/webm;"),mp3:I("audio/mpeg;"),wav:I("audio/wav;"),m4a:I("audio/mp4;")||I("audio/x-m4a;")||I("audio/aac;"),flac:I("audio/flac;"),amr:I("audio/amr;")},video:{ogg:I("video/ogg;"),webm:I("video/webm;"),mp4:I("video/mp4;"),mkv:I("video/x-matroska;")||I("video/webm;"),"3gp":I("video/3gpp;")||I("video/mp4;"),m3u8:I("application/x-mpegURL","video")||I("application/vnd.apple.mpegURL","video"),mpd:I("application/dash+xml","video")}},A={},this.closed=function(){return b==h||b==v},this.opened=function(){return b==m||b==g},this.docked=function(){return b==g},this.addIntegration=function(e){requestAnimationFrame(function(){u.trigger("helpIntegration",Object.assign({cmd:"quicklook"},e))})},this.init=function(){var i,l=this.options,c=this.window,d=this.preview;t=l.width>0?parseInt(l.width):450,n=l.height>0?parseInt(l.height):300,"auto"!==l.dockHeight&&(s=parseInt(l.dockHeight),s||(s=void 0)),u.one("load",function(){O=u.getUI("navdock").data("dockEnabled"),!O&&X.hide(),a=u.getUI(),o=u.getUI("cwd"),u.zIndex&&c.css("z-index",u.zIndex+1),c.appendTo(a),e(document).on("keydown."+u.namespace,function(t){t.keyCode==e.ui.keyCode.ESCAPE&&p.opened()&&!p.docked()&&c.hasClass("elfinder-frontmost")&&c.trigger("close")}),c.resizable({handles:"se",minWidth:350,minHeight:120,resize:function(){d.trigger("changesize")}}),p.change(function(){p.opened()&&p.value&&(p.value.tmb&&1==p.value.tmb&&(p.value=Object.assign({},u.file(p.value.hash))),d.trigger(e.Event(y,{file:p.value})))}),d.on(y,function(e){var t,n,a;if(t=e.file){if(n=t.hash,a=u.searchStatus.mixed&&u.searchStatus.state>1,"directory"!==t.mime)if(parseInt(t.size)||t.mime.match(l.mimeRegexNotEmptyCheck)){if(p.dispInlineRegex=i,a||u.optionsByHashes[n])try{p.dispInlineRegex=new RegExp(u.option("dispInlineRegex",n),"i")}catch(e){try{p.dispInlineRegex=new RegExp(u.isRoot(t)?u.options.dispInlineRegex:u.option("dispInlineRegex",t.phash),"i")}catch(e){p.dispInlineRegex=/^$/}}}else e.stopImmediatePropagation();else p.dispInlineRegex=/^$/;p.info.show()}else e.stopImmediatePropagation()}),e.each(u.commands.quicklook.plugins||[],function(e,t){
"function"==typeof t&&new t(p)})}).one("open",function(){var e,t=Number(u.storage("previewDocked")||l.docked);O&&t>=1&&(e=p.window,p.exec(),e.trigger("navdockin",{init:!0}),2===t?e.trigger("close"):(p.update(void 0,u.cwd()),p.change())),Y=!1}).bind("open",function(){r=u.cwd().hash,p.value=u.cwd();try{i=new RegExp(u.option("dispInlineRegex"),"i")}catch(e){i=/^$/}}).bind("change",function(t){t.data&&t.data.changed&&p.opened()&&e.each(t.data.changed,function(){if(p.window.data("hash")===this.hash)return p.window.data("hash",null),p.preview.trigger(y),!1})}).bind("navdockresizestart navdockresizestop",function(e){H["navdockresizestart"===e.type?"show":"hide"]()})},this.getstate=function(){return p.opened()?1:0},this.exec=function(){return p.closed()&&N(),p.enabled()&&p.window.trigger(p.opened()?"close":"open"),e.Deferred().resolve()},this.hideinfo=function(){this.info.stop(!0,!0).hide()}}).prototype={forceLoad:!0},i.prototype.commands.quicklook.plugins=[function(t){var n,i,a=["image/jpeg","image/png","image/gif","image/svg+xml","image/x-ms-bmp"],o=t.preview;n=new Image,n.onload=n.onerror=function(){2==n.height&&a.push("image/webp")},n.src="data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA",e.each(navigator.mimeTypes,function(t,n){var i=n.type;0===i.indexOf("image/")&&e.inArray(i,a)&&a.push(i)}),o.on(t.evUpdate,function(n){var r,s,l,c=t.fm,d=n.file,p=!1,u=null,h=function(e){var t=c.file(d.hash);t.width=e[0],t.height=e[1]},f=function(){var e,t,n,i,a;u&&u.state&&"pending"===u.state()&&u.reject(),p||(p=!0,e=s.get(0),t=d.width&&d.height?{w:d.width,h:d.height}:e.naturalWidth?null:{w:s.width(),h:s.height()},t&&s.removeAttr("width").removeAttr("height"),n=d.width||e.naturalWidth||e.width||s.width(),i=d.height||e.naturalHeight||e.height||s.height(),d.width&&d.height||h([n,i]),t&&s.width(t.w).height(t.h),a=(n/i).toFixed(2),o.on("changesize",function(){var e,t,n=parseInt(o.width()),i=parseInt(o.height());a<(n/i).toFixed(2)?(t=i,e=Math.floor(t*a)):(e=n,t=Math.floor(e/a)),s.width(e).height(t).css("margin-top",t<i?Math.floor((i-t)/2):0)}).trigger("changesize"),s.fadeIn(100))},m=function(){l.remove(),t.hideinfo()};i||(i=c.arrayFlip(a)),i[d.mime]&&t.dispInlineRegex.test(d.mime)&&(n.stopImmediatePropagation(),l=e('<div class="elfinder-quicklook-info-data"> '+c.i18n("nowLoading")+'<span class="elfinder-info-spinner"></div>').appendTo(t.info.find(".elfinder-quicklook-info")),r=c.openUrl(d.hash),s=e("<img/>").hide().appendTo(o).on("load",function(){m(),f()}).on("error",function(){l.remove()}).attr("src",r),d.width&&d.height?f():d.size>(t.options.getDimThreshold||0)&&(u=c.request({data:{cmd:"dim",target:d.hash},preventDefault:!0}).done(function(e){if(e.dim){var t=e.dim.split("x");d.width=t[0],d.height=t[1],h(t),f()}})))})},function(t){var n,i=t.fm,a=i.arrayFlip(["image/vnd.adobe.photoshop","image/x-photoshop"]),o=t.preview,r=function(e,a,r){try{i.replaceXhrSend(),n.fromURL(e).then(function(e){var n;a.attr("src",e.image.toBase64()),requestAnimationFrame(function(){n=(a.width()/a.height()).toFixed(2),o.on("changesize",function(){var e,t,i=parseInt(o.width()),r=parseInt(o.height());n<(i/r).toFixed(2)?(t=r,e=Math.floor(t*n)):(e=i,t=Math.floor(e/n)),a.width(e).height(t).css("margin-top",t<r?Math.floor((r-t)/2):0)}).trigger("changesize"),r.remove(),t.hideinfo(),a.fadeIn(100)})},function(){r.remove(),a.remove()}),i.restoreXhrSend()}catch(s){i.restoreXhrSend(),r.remove(),a.remove()}};o.on(t.evUpdate,function(s){var l,c,d,p,u,h=s.file;a[h.mime]&&i.options.cdns.psd&&!i.UA.ltIE10&&t.dispInlineRegex.test(h.mime)&&(s.stopImmediatePropagation(),d=e('<div class="elfinder-quicklook-info-data"> '+i.i18n("nowLoading")+'<span class="elfinder-info-spinner"></div>').appendTo(t.info.find(".elfinder-quicklook-info")),l=i.openUrl(h.hash),i.isSameOrigin(l)||(l=i.openUrl(h.hash,!0)),c=e("<img/>").hide().appendTo(o),n?r(l,c,d):(p=window.define,u=window.require,window.require=null,window.define=null,i.loadScript([i.options.cdns.psd],function(){n=require("psd"),p?window.define=p:delete window.define,u?window.require=u:delete window.require,r(l,c,d)})))})},function(t){var n=t.fm,i=n.arrayFlip(["text/html","application/xhtml+xml"]),a=t.preview;a.on(t.evUpdate,function(o){var r,s,l=o.file;i[l.mime]&&t.dispInlineRegex.test(l.mime)&&(!t.options.getSizeMax||l.size<=t.options.getSizeMax)&&(o.stopImmediatePropagation(),s=e('<div class="elfinder-quicklook-info-data"> '+n.i18n("nowLoading")+'<span class="elfinder-info-spinner"></div>').appendTo(t.info.find(".elfinder-quicklook-info")),a.one("change",function(){"pending"==r.state()&&r.reject()}).addClass("elfinder-overflow-auto"),r=n.request({data:{cmd:"get",target:l.hash,conv:1,_t:l.ts},options:{type:"get",cache:!0},preventDefault:!0}).done(function(n){t.hideinfo();var i=e('<iframe class="elfinder-quicklook-preview-html"/>').appendTo(a)[0].contentWindow.document;i.open(),i.write(n.content),i.close()}).always(function(){s.remove()}))})},function(t){var n=t.fm,i=n.arrayFlip(["text/x-markdown"]),a=t.preview,o=null,r=function(n,i){t.hideinfo();var r=e('<iframe class="elfinder-quicklook-preview-html"/>').appendTo(a)[0].contentWindow.document;r.open(),r.write(o(n.content)),r.close(),i.remove()},s=function(e){o=!1,e.remove()};a.on(t.evUpdate,function(l){var c,d,p=l.file;i[p.mime]&&n.options.cdns.marked&&o!==!1&&t.dispInlineRegex.test(p.mime)&&(!t.options.getSizeMax||p.size<=t.options.getSizeMax)&&(l.stopImmediatePropagation(),d=e('<div class="elfinder-quicklook-info-data"> '+n.i18n("nowLoading")+'<span class="elfinder-info-spinner"></div>').appendTo(t.info.find(".elfinder-quicklook-info")),a.one("change",function(){"pending"==c.state()&&c.reject()}).addClass("elfinder-overflow-auto"),c=n.request({data:{cmd:"get",target:p.hash,conv:1,_t:p.ts},options:{type:"get",cache:!0},preventDefault:!0}).done(function(e){o||window.marked?(o||(o=window.marked),r(e,d)):n.loadScript([n.options.cdns.marked],function(t){o=t||window.marked||!1,delete window.marked,o?r(e,d):s(d)},{tryRequire:!0,error:function(){s(d)}})}).fail(function(){s(d)}))})},function(t){var n=t.fm,i="application/pdf",a=t.preview,o=!1,r="";n.UA.Safari&&"mac"===n.OS&&!n.UA.iOS||n.UA.IE||n.UA.Firefox?o=!0:e.each(navigator.plugins,function(t,n){e.each(n,function(e,t){if(t.type===i)return!(o=!0)})}),o&&("undefined"==typeof t.options.pdfToolbar||t.options.pdfToolbar||(r="#toolbar=0"),a.on(t.evUpdate,function(s){var l=s.file;o&&l.mime===i&&t.dispInlineRegex.test(l.mime)&&(s.stopImmediatePropagation(),t.hideinfo(),t.cover.addClass("elfinder-quicklook-coverbg"),e('<object class="elfinder-quicklook-preview-pdf" data="'+n.openUrl(l.hash)+r+'" type="application/pdf" />').on("error",function(e){o=!1,t.update(void 0,n.cwd()),t.update(void 0,l)}).appendTo(a))}))},function(t){var n=t.fm,i="application/x-shockwave-flash",a=t.preview,o=!1;e.each(navigator.plugins,function(t,n){e.each(n,function(e,t){if(t.type===i)return!(o=!0)})}),o&&a.on(t.evUpdate,function(o){var r,s=o.file;s.mime===i&&t.dispInlineRegex.test(s.mime)&&(o.stopImmediatePropagation(),t.hideinfo(),r=e('<embed class="elfinder-quicklook-preview-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+n.openUrl(s.hash)+'" quality="high" type="application/x-shockwave-flash" wmode="transparent" />').appendTo(a))})},function(t){var n,i,a,o,r=t.fm,s=t.preview,l={"audio/mpeg":"mp3","audio/mpeg3":"mp3","audio/mp3":"mp3","audio/x-mpeg3":"mp3","audio/x-mp3":"mp3","audio/x-wav":"wav","audio/wav":"wav","audio/x-m4a":"m4a","audio/aac":"m4a","audio/mp4":"m4a","audio/x-mp4":"m4a","audio/ogg":"ogg","audio/webm":"webm","audio/flac":"flac","audio/x-flac":"flac","audio/amr":"amr"},c=t.window,d=t.navbar,p="string"==typeof t.options.mediaControlsList&&t.options.mediaControlsList?' controlsList="'+r.escape(t.options.mediaControlsList)+'"':"",u=function(){d.css("bottom",c.hasClass("elfinder-quicklook-fullscreen")?"50px":"")},h=function(t,i){return e('<audio class="elfinder-quicklook-preview-audio ui-front" controls'+p+' preload="auto" autobuffer><source src="'+t+'" /></audio>').on("change",function(e){e.stopPropagation()}).on("error",function(e){n&&n.data("hash")===i&&g()}).data("hash",i).appendTo(s)},f=function(t){var n,i=e.Deferred(),o=e.Deferred().done(function(){r.getContents(t).done(function(e){try{var t=a.toWAV(new Uint8Array(e));t?i.resolve(URL.createObjectURL(new Blob([t],{type:"audio/x-wav"}))):i.reject()}catch(n){i.reject()}}).fail(function(){i.reject()})}).fail(function(){a=!1,i.reject()});return window.TextEncoder&&window.URL&&URL.createObjectURL&&"undefined"==typeof a?(n=window.AMR,delete window.AMR,r.loadScript([r.options.cdns.amr],function(){a=!!window.AMR&&window.AMR,window.AMR=n,o[a?"resolve":"reject"]()},{error:function(){o.reject()}})):o[a?"resolve":"reject"](),i},m=function(e){var t,i=n.data("hash");o&&(t=e.play()),t&&t["catch"]&&t["catch"](function(t){e.paused||n&&n.data("hash")===i&&g()})},g=function(){if(n&&n.parent().length){var e=n[0],t=n.children("source").attr("src");c.off("viewchange.audio");try{e.pause(),n.empty(),t.match(/^blob:/)&&URL.revokeObjectURL(t),e.src="",e.load()}catch(i){}n.remove(),n=null}};s.on(t.evUpdate,function(e){var s,d,p=e.file,g=l[p.mime];l[p.mime]&&t.dispInlineRegex.test(p.mime)&&((s=t.support.audio[g])||"amr"===g)&&(o=t.autoPlay(),i=p.hash,d=s?r.openUrl(i):"",s?(e.stopImmediatePropagation(),n=h(d,i),m(n[0]),c.on("viewchange.audio",u),u()):r.options.cdns.amr&&"amr"===g&&a!==!1&&(e.stopImmediatePropagation(),n=h(d,i),f(p.hash).done(function(e){if(i===p.hash){var t=n[0];try{n.children("source").attr("src",e),t.pause(),t.load(),m(t),c.on("viewchange.audio",u),u()}catch(a){URL.revokeObjectURL(e),n.remove()}}else URL.revokeObjectURL(e)}).fail(function(){n.remove()})))}).on("change",g)},function(t){var n,i,a,o,r,s,l,c=t.fm,d=t.preview,p={"video/mp4":"mp4","video/x-m4v":"mp4","video/quicktime":"mp4","video/ogg":"ogg","application/ogg":"ogg","video/webm":"webm","video/x-matroska":"mkv","video/3gpp":"3gp","application/vnd.apple.mpegurl":"m3u8","application/x-mpegurl":"m3u8","application/dash+xml":"mpd","video/x-flv":"flv"},u=t.window,h=t.navbar,f="string"==typeof t.options.mediaControlsList&&t.options.mediaControlsList?' controlsList="'+c.escape(t.options.mediaControlsList)+'"':"",m=function(){c.UA.iOS?u.hasClass("elfinder-quicklook-fullscreen")?(d.css("height","-webkit-calc(100% - 50px)"),h._show()):d.css("height",""):h.css("bottom",u.hasClass("elfinder-quicklook-fullscreen")?"50px":"")},g=function(i,a){var r,s=function(e){p>1&&(l&&clearTimeout(l),l=setTimeout(function(){!r&&x(!0)},800))},p=0;o=null,a=a||{},t.hideinfo(),n=e('<video class="elfinder-quicklook-preview-video" controls'+f+' preload="auto" autobuffer playsinline></video>').on("change",function(e){e.stopPropagation()}).on("timeupdate progress",s).on("canplay",function(){r=!0}).data("hash",i.hash),n[0].addEventListener("error",function(e){a.src&&c.convAbsUrl(a.src)===c.convAbsUrl(e.target.src)&&(++p,s())},!0),a.src&&n.append('<source src="'+a.src+'" type="'+i.mime+'"/><source src="'+a.src+'"/>'),n.appendTo(d),u.on("viewchange.video",m),m()},v=function(e){var t;g(e),t=new i,t.loadSource(c.openUrl(e.hash)),t.attachMedia(n[0]),s&&t.on(i.Events.MANIFEST_PARSED,function(){w(n[0])})},b=function(e){g(e),o=window.dashjs.MediaPlayer().create(),o.getDebug().setLogToBrowserConsole(!1),o.initialize(n[0],c.openUrl(e.hash),s),o.on("error",function(e){x(!0)})},y=function(e){if(!r.isSupported())return void(r=!1);var t=r.createPlayer({type:"flv",url:c.openUrl(e.hash)});g(e),t.on(r.Events.ERROR,function(){t.destroy(),x(!0)}),t.attachMediaElement(n[0]),t.load(),w(t)},w=function(e){var t,i=n.data("hash");s&&(t=e.play()),t&&t["catch"]&&t["catch"](function(t){e.paused||n&&n.data("hash")===i&&x(!0)})},x=function(e){if(l&&clearTimeout(l),n&&n.parent().length){var i=n[0];u.off("viewchange.video"),o&&o.reset();try{i.pause(),n.empty(),i.src="",i.load()}catch(a){}n.remove(),n=null}e&&t.info.show()};d.on(t.evUpdate,function(e){var o,l=e.file,d=l.mime.toLowerCase(),u=p[d];p[d]&&t.dispInlineRegex.test(l.mime)&&(("m3u8"===u||"mpd"===u&&!c.UA.iOS||"flv"===u)&&!c.UA.ltIE10||t.support.video[u])&&(s=t.autoPlay(),t.support.video[u]&&("m3u8"!==u||c.UA.Safari)?(e.stopImmediatePropagation(),g(l,{src:c.openUrl(l.hash)}),w(n[0])):i!==!1&&c.options.cdns.hls&&"m3u8"===u?(e.stopImmediatePropagation(),i?v(l):(o=window.Hls,delete window.Hls,c.loadScript([c.options.cdns.hls],function(e){i=e||window.Hls||!1,window.Hls=o,i&&v(l)},{tryRequire:!0,error:function(){i=!1}}))):a!==!1&&c.options.cdns.dash&&"mpd"===u?(e.stopImmediatePropagation(),a?b(l):c.loadScript([c.options.cdns.dash],function(){a=!!window.dashjs,a&&b(l)},{tryRequire:!0,error:function(){a=!1}})):r!==!1&&c.options.cdns.flv&&"flv"===u&&(e.stopImmediatePropagation(),r?y(l):(o=window.flvjs,delete window.flvjs,c.loadScript([c.options.cdns.flv],function(e){r=e||window.flvjs||!1,window.flvjs=o,r&&y(l)},{tryRequire:!0,error:function(){r=!1}}))))}).on("change",x)},function(t){var n,i=t.preview,a=[],o=t.window,r=t.navbar;e.each(navigator.plugins,function(t,n){e.each(n,function(e,t){(0===t.type.indexOf("audio/")||0===t.type.indexOf("video/"))&&a.push(t.type)})}),a=t.fm.arrayFlip(a),i.on(t.evUpdate,function(s){var l,c=s.file,d=c.mime,p=function(){r.css("bottom",o.hasClass("elfinder-quicklook-fullscreen")?"50px":"")};a[c.mime]&&t.dispInlineRegex.test(c.mime)&&(s.stopImmediatePropagation(),(l=0===d.indexOf("video/"))&&t.hideinfo(),n=e('<embed src="'+t.fm.openUrl(c.hash)+'" type="'+d+'" class="elfinder-quicklook-preview-'+(l?"video":"audio")+'"/>').appendTo(i),o.on("viewchange.embed",p),p())}).on("change",function(){n&&n.parent().length&&(o.off("viewchange.embed"),n.remove(),n=null)})},function(t){var n,i=t.fm,a=i.arrayFlip(["application/zip","application/x-gzip","application/x-tar"]),o=t.preview,r=function(){var e,t,n,a=[];for(this.Y(),n=this.i,e=0,t=n.length;e<t;++e)a[e]=n[e].filename+(n[e].J?" ("+i.formatSize(n[e].J)+")":"");return a},s=function(e){for(var t,n,a,o,r,s=[],l=e.length,c=0,d=function(e){return String.fromCharCode.apply(null,e).replace(/\0+$/,"")};c<l&&0!==e[c];)t=e.subarray(c,c+512),n=d(t.subarray(0,100)),(a=d(t.subarray(345,500)))&&(n=a+n),o=parseInt(d(t.subarray(124,136)),8),r=512*Math.ceil(o/512),"././@LongLink"===n&&(n=d(e.subarray(c+512,c+512+r))),"pax_global_header"!==n&&s.push(n+(o?" ("+i.formatSize(o)+")":"")),c=c+512+r;return s};window.Uint8Array&&window.DataView&&i.options.cdns.zlibUnzip&&i.options.cdns.zlibGunzip&&o.on(t.evUpdate,function(l){var c=l.file,d="application/x-tar"===c.mime;if(a[c.mime]&&(d||("undefined"==typeof n||n)&&("application/zip"===c.mime||"application/x-gzip"===c.mime))){var p,u,h,f,m=function(){h=i.openUrl(c.hash),i.isSameOrigin(h)||(h=i.openUrl(c.hash,!0)),p=i.request({data:{cmd:"get"},options:{url:h,type:"get",cache:!0,dataType:"binary",responseType:"arraybuffer",processData:!1}}).fail(function(){u.remove()}).done(function(e){var t,a;try{"application/zip"===c.mime?(t=new n.Unzip(new Uint8Array(e)),a=r.call(t)):"application/x-gzip"===c.mime?(t=new n.Gunzip(new Uint8Array(e)),a=s(t.decompress())):"application/x-tar"===c.mime&&(a=s(new Uint8Array(e))),g(a)}catch(o){u.remove(),i.debug("error",o)}})},g=function(n){var a,r;n&&n.length&&(n=e.map(n,function(e){return i.decodeRawString(e)}),n.sort(),u.remove(),a="<strong>"+i.escape(c.mime)+"</strong> ("+i.formatSize(c.size)+")<hr/>",r=e('<div class="elfinder-quicklook-preview-archive-wrapper">'+a+'<pre class="elfinder-quicklook-preview-text">'+i.escape(n.join("\n"))+"</pre></div>").on("touchstart",function(t){e(this)["scroll"+("ltr"===i.direction?"Right":"Left")]()>5&&(t.originalEvent._preventSwipeX=!0)}).appendTo(o),t.hideinfo())};l.stopImmediatePropagation(),u=e('<div class="elfinder-quicklook-info-data"> '+i.i18n("nowLoading")+'<span class="elfinder-info-spinner"></div>').appendTo(t.info.find(".elfinder-quicklook-info")),o.one("change",function(){"pending"===p.state()&&p.reject(),u.remove()}),n?m():(window.Zlib&&(f=window.Zlib,delete window.Zlib),i.loadScript([i.options.cdns.zlibUnzip,i.options.cdns.zlibGunzip],function(){window.Zlib&&(n=window.Zlib)?(f?window.Zlib=f:delete window.Zlib,m()):error()}))}})},function(t){var n,i=t.fm,a=i.arrayFlip(["application/x-rar"]),o=t.preview;window.DataView&&o.on(t.evUpdate,function(r){var s=r.file;if(a[s.mime]&&i.options.cdns.rar&&n!==!1){var l,c,d,p,u,h=function(a){if(p)return void l.remove();try{d=n({file:a,type:2,xhrHeaders:i.customHeaders,xhrFields:i.xhrFields},function(n){l.remove();var a,r,c=[];return p||n?void(n&&i.debug("error",n)):(e.each(d.entries,function(){c.push(this.path+(this.size?" ("+i.formatSize(this.size)+")":""))}),void(c.length&&(c=e.map(c,function(e){return i.decodeRawString(e)}),c.sort(),a="<strong>"+i.escape(s.mime)+"</strong> ("+i.formatSize(s.size)+")<hr/>",r=e('<div class="elfinder-quicklook-preview-archive-wrapper">'+a+'<pre class="elfinder-quicklook-preview-text">'+i.escape(c.join("\n"))+"</pre></div>").on("touchstart",function(t){e(this)["scroll"+("ltr"===i.direction?"Right":"Left")]()>5&&(t.originalEvent._preventSwipeX=!0)}).appendTo(o),t.hideinfo())))})}catch(r){l.remove()}},f=function(){n=!1,l.remove()};r.stopImmediatePropagation(),l=e('<div class="elfinder-quicklook-info-data"> '+i.i18n("nowLoading")+'<span class="elfinder-info-spinner"></div>').appendTo(t.info.find(".elfinder-quicklook-info")),o.one("change",function(){d&&(d.abort=!0),l.remove(),p=!0}),c=i.openUrl(s.hash),i.isSameOrigin(c)||(c=i.openUrl(s.hash,!0)),n?h(c):(window.RarArchive&&(u=window.RarArchive,delete window.RarArchive),i.loadScript([i.options.cdns.rar],function(){i.hasRequire?require(["rar"],function(e){n=e,h(c)},f):(n=window.RarArchive)?(u?window.RarArchive=u:delete window.RarArchive,h(c)):f()},{tryRequire:!0,error:f}))}})},function(t){var n,i=t.fm,a=i.arrayFlip(t.options.sharecadMimes||[]),o=t.preview;t.window;t.options.sharecadMimes.length&&t.addIntegration({title:"ShareCAD.org CAD and 3D-Models viewer",link:"https://sharecad.org/DWGOnlinePlugin"}),o.on(t.evUpdate,function(r){var s=r.file;if(a[s.mime.toLowerCase()]){var l,c;t.window;r.stopImmediatePropagation(),"1"==s.url&&(o.hide(),e('<div class="elfinder-quicklook-info-data"><button class="elfinder-info-button">'+i.i18n("getLink")+"</button></div>").appendTo(t.info.find(".elfinder-quicklook-info")).on("click",function(){var n=e(this);n.html('<span class="elfinder-info-spinner">'),i.request({data:{cmd:"url",target:s.hash},preventDefault:!0}).always(function(){n.html("")}).done(function(e){var n=i.file(s.hash);s.url=n.url=e.url||"",s.url&&o.trigger({type:t.evUpdate,file:s,forceUpdate:!0})})})),""!==s.url&&"1"!=s.url&&(o.one("change",function(){l.remove(),n.off("load").remove(),n=null}).addClass("elfinder-overflow-auto"),l=e('<div class="elfinder-quicklook-info-data"> '+i.i18n("nowLoading")+'<span class="elfinder-info-spinner"></div>').appendTo(t.info.find(".elfinder-quicklook-info")),c=i.convAbsUrl(i.url(s.hash)),n=e('<iframe class="elfinder-quicklook-preview-iframe" scrolling="no"/>').css("background-color","transparent").appendTo(o).on("load",function(){t.hideinfo(),l.remove(),t.preview.after(t.info),e(this).css("background-color","#fff").show()}).on("error",function(){l.remove(),t.preview.after(t.info)}).attr("src","//sharecad.org/cadframe/load?url="+encodeURIComponent(c)),t.info.after(t.preview))}})},function(t){var n,i,a,o,r,s=t.fm,l={"application/vnd.google-earth.kml+xml":!0,"application/vnd.google-earth.kmz":!0},c=t.preview;t.options.googleMapsApiKey&&(t.addIntegration({title:"Google Maps",link:"https://www.google.com/intl/"+s.lang.replace("_","-")+"/help/terms_maps.html"}),n=window.google&&google.maps,i=function(e,i){var a=t.options.googleMapsOpts.maps;t.hideinfo();try{new n.KmlLayer(s.convAbsUrl(s.url(e.hash)),Object.assign({map:new n.Map(i.get(0),a)},t.options.googleMapsOpts.kml))}catch(r){o()}},a=window.gm_authFailure,o=function(){r=null},r="https://maps.googleapis.com/maps/api/js?key="+t.options.googleMapsApiKey,window.gm_authFailure=function(){o(),a&&a()},c.on(t.evUpdate,function(a){var o=a.file;if(r&&l[o.mime.toLowerCase()]){var d;t.window;a.stopImmediatePropagation(),"1"==o.url&&(c.hide(),e('<div class="elfinder-quicklook-info-data"><button class="elfinder-info-button">'+s.i18n("getLink")+"</button></div>").appendTo(t.info.find(".elfinder-quicklook-info")).on("click",function(){var n=e(this);n.html('<span class="elfinder-info-spinner">'),s.request({data:{cmd:"url",target:o.hash},preventDefault:!0}).always(function(){n.html("")}).done(function(e){var n=s.file(o.hash);o.url=n.url=e.url||"",o.url&&c.trigger({type:t.evUpdate,file:o,forceUpdate:!0})})})),""!==o.url&&"1"!=o.url&&(d=e('<div style="width:100%;height:100%;"/>').appendTo(c),c.one("change",function(){d.remove(),d=null}),n?i(o,d):s.loadScript([r],function(){n=window.google&&google.maps,n&&i(o,d)}))}}))},function(t){var n,i,a=t.fm,o=Object.assign(a.arrayFlip(t.options.googleDocsMimes||[],"g"),a.arrayFlip(t.options.officeOnlineMimes||[],"m")),r=t.preview,s=(t.window,t.navbar),l={g:"docs.google.com/gview?embedded=true&url=",m:"view.officeapps.live.com/op/embed.aspx?wdStartOn=0&src="},c={g:"56px",m:"24px"},d={xls:5242880,xlsb:5242880,xlsx:5242880,xlsm:5242880,other:10485760};t.options.googleDocsMimes.length&&(i=!0,t.addIntegration({title:"Google Docs Viewer",link:"https://docs.google.com/"})),t.options.officeOnlineMimes.length&&(i=!0,t.addIntegration({title:"MS Online Doc Viewer",link:"https://products.office.com/office-online/view-office-documents-online"})),i&&r.on(t.evUpdate,function(i){var p,u=i.file;if(u.size<=26214400&&(p=o[u.mime])){var h,f,m=t.window,g=function(){s.css("bottom",m.hasClass("elfinder-quicklook-fullscreen")?c[p]:"")},v=a.mimeTypes[u.mime];"m"===p&&(d[v]&&u.size>d[v]||u.size>d.other)&&(p="g"),"1"==u.url&&(r.hide(),e('<div class="elfinder-quicklook-info-data"><button class="elfinder-info-button">'+a.i18n("getLink")+"</button></div>").appendTo(t.info.find(".elfinder-quicklook-info")).on("click",function(){var n=e(this);n.html('<span class="elfinder-info-spinner">'),a.request({data:{cmd:"url",target:u.hash},preventDefault:!0}).always(function(){n.html("")}).done(function(e){var n=a.file(u.hash);u.url=n.url=e.url||"",u.url&&r.trigger({type:t.evUpdate,file:u,forceUpdate:!0})})})),""!==u.url&&"1"!=u.url&&(i.stopImmediatePropagation(),r.one("change",function(){m.off("viewchange.googledocs"),h.remove(),n.off("load").remove(),n=null}).addClass("elfinder-overflow-auto"),h=e('<div class="elfinder-quicklook-info-data"> '+a.i18n("nowLoading")+'<span class="elfinder-info-spinner"></div>').appendTo(t.info.find(".elfinder-quicklook-info")),f=a.convAbsUrl(a.url(u.hash)),u.ts&&(f+=(f.match(/\?/)?"&":"?")+"_t="+u.ts),n=e('<iframe class="elfinder-quicklook-preview-iframe"/>').css("background-color","transparent").appendTo(r).on("load",function(){t.hideinfo(),h.remove(),t.preview.after(t.info),e(this).css("background-color","#fff").show()}).on("error",function(){h.remove(),t.preview.after(t.info)}).attr("src","https://"+l[p]+encodeURIComponent(f)),m.on("viewchange.googledocs",g),g(),t.info.after(t.preview))}})},function(t){var n=t.fm,i=t.preview,a=parseInt(t.options.textMaxlen)||2e3,o=function(){n.options.cdns.prettify?(n.loadScript([n.options.cdns.prettify+(n.options.cdns.prettify.match(/\?/)?"&":"?")+"autorun=false"]),o=function(){return!0}):o=function(){return!1}},r=function(e,t){o()&&("undefined"==typeof window.PR&&t--?setTimeout(function(){r(e,t)},100):"object"==typeof window.PR?(e.css("cursor","wait"),requestAnimationFrame(function(){PR.prettyPrint&&PR.prettyPrint(null,e.get(0)),e.css("cursor","")})):o=function(){return!1})};i.on(t.evUpdate,function(s){var l,c,d=s.file;d.mime;n.mimeIsText(d.mime)&&(!t.options.getSizeMax||d.size<=t.options.getSizeMax)&&(s.stopImmediatePropagation(),"undefined"==typeof window.PR&&o(),c=e('<div class="elfinder-quicklook-info-data"> '+n.i18n("nowLoading")+'<span class="elfinder-info-spinner"></div>').appendTo(t.info.find(".elfinder-quicklook-info")),i.one("change",function(){"pending"==l.state()&&l.reject()}),l=n.request({data:{cmd:"get",target:d.hash,conv:1,_t:d.ts},options:{type:"get",cache:!0},preventDefault:!0}).done(function(o){var s,l,c,p,u=new RegExp("^(data:"+d.mime.replace(/([.+])/g,"\\$1")+";base64,)","i"),h=o.content;t.hideinfo(),window.atob&&(p=h.match(u))&&(h=atob(h.substr(p[1].length))),l=h.length-a,l>100?s=h.substr(0,a)+"...":l=0,c=e('<div class="elfinder-quicklook-preview-text-wrapper"><pre class="elfinder-quicklook-preview-text prettyprint"></pre></div>'),l&&c.append(e('<div class="elfinder-quicklook-preview-charsleft"><hr/><span>'+n.i18n("charsLeft",n.toLocaleString(l))+"</span></div>").on("click",function(){var t=c.scrollTop();e(this).remove(),c.children("pre").removeClass("prettyprinted").text(h).scrollTop(t),r(c,100)})),c.children("pre").text(s||h),c.on("touchstart",function(t){e(this)["scroll"+("ltr"===n.direction?"Right":"Left")]()>5&&(t.originalEvent._preventSwipeX=!0)}).appendTo(i),r(c,100)}).always(function(){c.remove()}))})}],(i.prototype.commands.reload=function(){"use strict";var t=this,n=!1;this.alwaysEnabled=!0,this.updateOnSelect=!0,this.shortcuts=[{pattern:"ctrl+shift+r f5"}],this.getstate=function(){return 0},this.init=function(){this.fm.bind("search searchend",function(){n="search"==this.type})},this.fm.bind("contextmenu",function(){var n=t.fm;n.options.sync>=1e3&&(t.extra={icon:"accept",node:e("<span/>").attr({title:n.i18n("autoSync")}).on("click touchstart",function(t){"touchstart"===t.type&&t.originalEvent.touches.length>1||(t.stopPropagation(),t.preventDefault(),e(this).parent().toggleClass("ui-state-disabled",n.options.syncStart).parent().removeClass("ui-state-hover"),n.options.syncStart=!n.options.syncStart,n.autoSync(n.options.syncStart?null:"stop"))}).on("ready",function(){e(this).parent().toggleClass("ui-state-disabled",!n.options.syncStart).css("pointer-events","auto")})})}),this.exec=function(){var t=this.fm;if(!n){var i=t.sync(),a=setTimeout(function(){t.notify({type:"reload",cnt:1,hideCnt:!0}),i.always(function(){t.notify({type:"reload",cnt:-1})})},t.notifyDelay);return i.always(function(){clearTimeout(a),t.trigger("reload")})}e("div.elfinder-toolbar > div."+t.res("class","searchbtn")+" > span.ui-icon-search").click()}}).prototype={forceLoad:!0},i.prototype.commands.rename=function(){"use strict";this.alwaysEnabled=!0,this.syncTitleOnChange=!0;var t=this,n=t.fm,i=function(t,i,a,o){var r,s=i?[a.hash].concat(i):[a.hash],l=s.length,c={};if(n.lockfiles({files:s}),n.isRoot(a)){if((r=n.storage("rootNames"))||(r={}),""===o){if(!r[a.hash])return t&&t.reject(),void n.unlockfiles({files:s}).trigger("selectfiles",{files:s});a.name=a._name,a.i18=a._i18,delete r[a.hash],delete a._name,delete a._i18}else"undefined"==typeof a._name&&(a._name=a.name,a._i18=a.i18),a.name=r[a.hash]=o,delete a.i18;return n.storage("rootNames",r),c={changed:[a]},n.updateCache(c),n.change(c),t&&t.resolve(c),void n.unlockfiles({files:s}).trigger("selectfiles",{files:s})}c={cmd:"rename",name:o,target:a.hash},l>1&&(c.targets=i,o.match(/\*/)&&(c.q=o)),n.request({data:c,notify:{type:"rename",cnt:l},navigate:{}}).fail(function(e){t&&t.reject(),e&&Array.isArray(e)&&"errRename"===e[0]||n.sync()}).done(function(i){var r;i.added&&i.added.length&&1===l&&(i.undo={cmd:"rename",callback:function(){return n.request({data:{cmd:"rename",target:i.added[0].hash,name:a.name},notify:{type:"undo",cnt:1}})}},i.redo={cmd:"rename",callback:function(){return n.request({data:{cmd:"rename",target:a.hash,name:o},notify:{type:"rename",cnt:1}})}}),t&&t.resolve(i),(r=n.cwd().hash)&&r!==a.hash||n.exec("open",e.map(i.added,function(e){return"directory"===e.mime?e.hash:null})[0])}).always(function(){n.unlockfiles({files:s}).trigger("selectfiles",{files:s})})},a=function(e,t){var i,a,o,r=t||n.selected(),s=n.splitFileExtention(e),l=n.file(r[0]),c=n.file(r[1]);return i=s[1]?"."+s[1]:"",s[1]&&"*"===s[0]?(a='"'+n.splitFileExtention(l.name)[0]+i+'", ',a+='"'+n.splitFileExtention(c.name)[0]+i+'"'):s[0].length>1&&("*"===s[0].substr(-1)?(o=s[0].substr(0,s[0].length-1),a='"'+o+l.name+'", ',a+='"'+o+c.name+'"'):"*"===s[0].substr(0,1)&&(o=s[0].substr(1),a='"'+n.splitFileExtention(l.name)[0]+o+i+'", ',a+='"'+n.splitFileExtention(c.name)[0]+o+i+'"')),a||(a='"'+s[0]+"1"+i+'", "'+s[0]+"2"+i+'"'),r.length>2&&(a+=" ..."),a},o=function(){var t,o=n.selected(),r='<input name="type" type="radio" class="elfinder-tabstop">',s=function(t,i){return e('<label class="elfinder-rename-batch-checks">'+n.i18n(i)+"</label>").prepend(t)},l=e('<input type="text" class="ui-corner-all elfinder-tabstop">'),c=e(r),d=e(r),p=e(r),u=e(r),h=e("<div/>").append(s(c,"plusNumber"),s(d,"asPrefix"),s(p,"asSuffix"),s(u,"changeExtention")),f=e('<div class="elfinder-rename-batch-preview"/>'),m=e('<div class="elfinder-rename-batch"/>').append(e('<div class="elfinder-rename-batch-name"/>').append(l),e('<div class="elfinder-rename-batch-type"/>').append(h),f),g={title:n.i18n("batchRename"),modal:!0,destroyOnClose:!0,width:Math.min(380,n.getUI().width()-20),buttons:{},open:function(){l.on("input",b).trigger("focus")}},v=function(){var e=l.val(),t=n.splitFileExtention(n.file(o[0]).name)[1];return(""!==e||c.is(":checked"))&&(d.is(":checked")?e+="*":p.is(":checked")?e="*"+e+"."+t:u.is(":checked")?e="*."+e:t&&(e+="."+t)),e},b=function(){var e=v();""!==e?f.html(n.i18n(["renameMultiple",o.length,a(e)])):f.empty()},y=h.find("input:radio").on("change",b);g.buttons[n.i18n("btnApply")]=function(){var e,a,r=v();""!==r&&(t.elfinderdialog("close"),a=o,e=n.file(a.shift()),i(void 0,a,e,r))},g.buttons[n.i18n("btnCancel")]=function(){t.elfinderdialog("close")},e.fn.checkboxradio?y.checkboxradio({create:function(e,t){this===c.get(0)&&c.prop("checked",!0).change()}}):h.buttonset({create:function(e,t){c.prop("checked",!0).change()}}),t=n.dialog(m,g)};this.noChangeDirOnRemovedCwd=!0,this.shortcuts=[{pattern:"f2"+("mac"==n.OS?" enter":"")},{pattern:"shift+f2",description:"batchRename",callback:function(){n.selected().length>1&&o()}}],this.getstate=function(i){var a,r,s,l,c,d,p=this.files(i),u=p.length;return u?(u>1&&p[0].phash&&(a=p[0].phash,r=n.splitFileExtention(p[0].name)[1].toLowerCase(),s=p[0].mime),1===u&&(d=n.isRoot(p[0])),c=1===u&&(d||!p[0].locked)||n.api>2.103&&u===e.grep(p,function(e){return!(l||e.locked||e.phash!==a||n.isRoot(e)||s!==e.mime&&r!==n.splitFileExtention(e.name)[1].toLowerCase())||(l&&(l=!0),!1)}).length?0:-1,!d&&0===c&&n.option("disabledFlip",p[0].hash).rename&&(c=-1),c!==-1&&u>1?t.extra={icon:"preference",node:e("<span/>").attr({title:n.i18n("batchRename")}).on("click touchstart",function(e){"touchstart"===e.type&&e.originalEvent.touches.length>1||(e.stopPropagation(),e.preventDefault(),n.getUI().trigger("click"),o())})}:delete t.extra,c):-1},this.exec=function(t,o){var r,s=(n.getUI("cwd"),t||!!n.selected().length&&n.selected()||[n.cwd().hash]),l=s.length,c=n.file(s.shift()),d=".elfinder-cwd-filename",p=o||{},u=n.cwd().hash==c.hash,h="navbar"===p._currentType||"files"===p._currentType?p._currentType:u?"navbar":"files",f="files"!==h,m=e("#"+n[f?"navHash2Id":"cwdHash2Id"](c.hash)),g=!f&&"list"!=n.storage("view"),v=function(){requestAnimationFrame(function(){x&&x.trigger("blur")})},b=function(){T.is(":hidden")||T.elfinderoverlay("hide").off("click close",A),z.removeClass("ui-front").css("position","").off("unselect."+n.namespace,v),g?C&&C.css("max-height",""):f||z.css("width","").parent("td").css("overflow","")},y=e.Deferred().fail(function(e){var t=x.parent(),i=n.escape(c.i18||c.name);x.off(),g&&(i=i.replace(/([_.])/g,"&#8203;$1")),requestAnimationFrame(function(){f?x.replaceWith(i):t.length?(x.remove(),t.html(i)):m.find(d).html(i)}),e&&n.error(e)}).always(function(){b(),n.unbind("resize",I),n.enable()}),w=function(t){var o=e.trim(x.val()),r=(n.splitFileExtention(o),!0),d=function(){x.off(),b(),f?x.replaceWith(n.escape(o)):C.html(n.escape(o)),i(y,s,c,o)};if(T.is(":hidden")||z.css("z-index",""),""===o){if(!n.isRoot(c))return A();f?x.replaceWith(n.escape(c.name)):C.html(n.escape(c.name))}if(!S&&z.length){if(x.off("blur"),1===l&&o===c.name)return y.reject();
if(n.options.validName&&n.options.validName.test)try{r=n.options.validName.test(o)}catch(t){r=!1}if("."===o||".."===o||!r)return S=!0,n.error("directory"===c.mime?"errInvDirname":"errInvName",{modal:!0,close:function(){setTimeout(k,120)}}),!1;if(1===l&&n.fileByName(o,c.phash))return S=!0,n.error(["errExists",o],{modal:!0,close:function(){setTimeout(k,120)}}),!1;1===l?d():(n.confirm({title:"cmdrename",text:["renameMultiple",l,a(o,[c.hash].concat(s))],accept:{label:"btnYes",callback:d},cancel:{label:"btnCancel",callback:function(){setTimeout(function(){S=!0,k()},120)}}}),setTimeout(function(){n.trigger("unselectfiles",{files:n.selected()}).trigger("selectfiles",{files:[c.hash].concat(s)})},120))}},x=e(g?"<textarea/>":'<input type="text"/>').on("keyup text",function(){g?(this.style.height="1px",this.style.height=this.scrollHeight+"px"):r&&(this.style.width=r+"px",this.scrollWidth>r&&(this.style.width=this.scrollWidth+10+"px"))}).on("keydown",function(t){t.stopImmediatePropagation(),t.keyCode==e.ui.keyCode.ESCAPE?y.reject():t.keyCode==e.ui.keyCode.ENTER&&(t.preventDefault(),x.trigger("blur"))}).on("mousedown click dblclick",function(e){e.stopPropagation(),"dblclick"===e.type&&e.preventDefault()}).on("blur",w).on("dragenter dragleave dragover drop",function(e){e.stopPropagation()}),k=function(){var e=n.splitFileExtention(x.val())[0];S||!n.UA.Mobile||n.UA.iOS||(T.on("click close",A).elfinderoverlay("show"),z.css("z-index",T.css("z-index")+1)),!n.enabled()&&n.enable(),S&&(S=!1,x.on("blur",w)),x.trigger("focus").trigger("select"),x[0].setSelectionRange&&x[0].setSelectionRange(0,e.length)},C=f?m.contents().filter(function(){return 3==this.nodeType&&e(this).parent().attr("id")===n.navHash2Id(c.hash)}):m.find(d),z=C.parent(),T=n.getUI("overlay"),A=function(e){T.is(":hidden")||z.css("z-index",""),S||(y.reject(),e&&(e.stopPropagation(),e.preventDefault()))},I=function(){m.trigger("scrolltoview",{blink:!1})},S=!1;return z.addClass("ui-front").css("position","relative").on("unselect."+n.namespace,v),n.bind("resize",I),f?C.replaceWith(x.val(c.name)):(g?C.css("max-height","none"):f||(r=z.width(),z.width(r-15).parent("td").css("overflow","visible")),C.empty().append(x.val(c.name))),l>1&&n.api<=2.103?y.reject():c&&C.length?c.locked&&!n.isRoot(c)?y.reject(["errLocked",c.name]):(n.one("select",function(){x.parent().length&&c&&e.inArray(c.hash,n.selected())===-1&&x.trigger("blur")}),x.trigger("keyup"),k(),y):y.reject("errCmdParams",this.title)},n.bind("select contextmenucreate closecontextmenu",function(e){var i,a=(e.data?e.data.selected||e.data.targets:null)||n.selected();a&&1===a.length&&(i=n.file(a[0]))&&n.isRoot(i)?t.title=n.i18n("kindAlias")+" ("+n.i18n("preference")+")":t.title=n.i18n("cmdrename"),"closecontextmenu"!==e.type?t.update(void 0,t.title):requestAnimationFrame(function(){t.update(void 0,t.title)})}).remove(function(t){var i;t.data&&t.data.removed&&(i=n.storage("rootNames"))&&(e.each(t.data.removed,function(e,t){i[t]&&delete i[t]}),n.storage("rootNames",i))})},i.prototype.commands.resize=function(){"use strict";var t=0,n=function(t,n,i){var a=[{x:t/2,y:n/2},{x:-t/2,y:n/2},{x:-t/2,y:-n/2},{x:t/2,y:-n/2}],o=[],r={x:Number.MAX_VALUE,y:Number.MAX_VALUE},s={x:Number.MIN_VALUE,y:Number.MIN_VALUE};return e.each(a,function(e,t){o.push({x:t.x*Math.cos(i)-t.y*Math.sin(i),y:t.x*Math.sin(i)+t.y*Math.cos(i)})}),e.each(o,function(e,t){r.x=Math.min(r.x,t.x),r.y=Math.min(r.y,t.y),s.x=Math.max(s.x,t.x),s.y=Math.max(s.y,t.y)}),{width:s.x-r.x,height:s.y-r.y}};this.updateOnSelect=!1,this.getstate=function(){var e=this.fm.selectedFiles();return 1==e.length&&e[0].read&&e[0].write&&e[0].mime.indexOf("image/")!==-1?0:-1},this.resizeRequest=function(t,n,i){var a=this.fm,o=n||a.file(t.target),r=(o?o.tmb:null,a.isCommandEnabled("resize",t.target));if(r&&(!o||o&&o.read&&o.write&&o.mime.indexOf("image/")!==-1))return a.request({data:Object.assign(t,{cmd:"resize"}),notify:{type:"resize",cnt:1}}).fail(function(e){i&&i.reject(e)}).done(function(){t.quality&&a.storage("jpgQuality",t.quality===a.option("jpgQuality")?null:t.quality),i&&i.resolve()});var s;return s=o?o.mime.indexOf("image/")===-1?["errResize",o.name,"errUsupportType"]:["errResize",o.name,"errPerm"]:["errResize",t.target,"errPerm"],i?i.reject(s):a.error(s),e.Deferred().reject(s)},this.exec=function(i){var a,o,r=this,s=this.fm,l=this.files(i),c=e.Deferred(),d=s.api>1,p=this.options,u=650,h=s.getUI(),f=e().controlgroup?"controlgroup":"buttonset",m="undefined"==typeof p.grid8px||"disable"!==p.grid8px,g=Array.isArray(p.presetSize)?p.presetSize:[],v="elfinder-dialog-resize",b="elfinder-dialog-active",y=s.res("class","editing"),w=function(i,a){var o,l,w,x,k,C="image/jpeg"===i.mime,z=e('<div class="elfinder-dialog-resize"/>'),T='<input type="number" class="ui-corner-all"/>',A='<div class="elfinder-resize-row"/>',I='<div class="elfinder-resize-label"/>',S=null,O=!1,j=function(){O=!0},M=function(){O&&(O=!1,F.trigger("change"))},F=e('<div class="elfinder-resize-control"/>').on("focus","input[type=text],input[type=number]",function(){e(this).trigger("select")}).on("change",function(){S&&cancelAnimationFrame(S),S=requestAnimationFrame(function(){var e,t,i,a,o,r,l,c,d,p,u,h;it&&!O&&(i=it.data("canvas"))&&(e=F.children("div.elfinder-resize-control-panel:visible"),t=e.find("input.elfinder-resize-quality"),t.is(":visible")&&(a=it.data("ctx"),o=it.get(0),e.hasClass("elfinder-resize-uiresize")?(c=i.width=K.val(),d=i.height=V.val(),a.drawImage(o,0,0,c,d)):e.hasClass("elfinder-resize-uicrop")?(r=X.val(),l=G.val(),c=J.val(),d=Y.val(),i.width=c,i.height=d,a.drawImage(o,r,l,c,d,0,0,c,d)):(p=Z.val(),u=Z.val()*Math.PI/180,h=n(ue,he,u),c=i.width=h.width,d=i.height=h.height,a.save(),p%90!==0&&(a.fillStyle=le.val()||"#FFF",a.fillRect(0,0,c,d)),a.translate(c/2,d/2),a.rotate(u),a.drawImage(o,-o.width/2,-o.height/2,ue,he),a.restore()),i.toBlob(function(e){e&&t.next("span").text(" ("+s.formatSize(e.size)+")")},"image/jpeg",Math.max(Math.min(t.val(),100),1)/100)))})}).on("mouseup","input",function(t){e(t.target).trigger("change")}),D=e('<div class="elfinder-resize-preview"/>').on("touchmove",function(t){e(t.target).hasClass("touch-punch")&&(t.stopPropagation(),t.preventDefault())}),U=e('<div class="elfinder-resize-spinner">'+s.i18n("ntfloadimg")+"</div>"),E=e('<div class="elfinder-resize-handle touch-punch"/>'),P=e('<div class="elfinder-resize-handle touch-punch"/>'),R=e('<div class="elfinder-resize-uiresize elfinder-resize-control-panel"/>'),q=e('<div class="elfinder-resize-uicrop elfinder-resize-control-panel"/>'),H=e('<div class="elfinder-resize-rotate elfinder-resize-control-panel"/>'),_=e("<button/>").attr("title",s.i18n("rotate-cw")).append(e('<span class="elfinder-button-icon elfinder-button-icon-rotate-l"/>')),N=e("<button/>").attr("title",s.i18n("rotate-ccw")).append(e('<span class="elfinder-button-icon elfinder-button-icon-rotate-r"/>')),L=e("<span />"),W=e('<button class="elfinder-resize-reset">').text(s.i18n("reset")).on("click",function(){Ne()}).button({icons:{primary:"ui-icon-arrowrefresh-1-n"},text:!1}),B=e('<div class="elfinder-resize-type"/>').append('<input type="radio" name="type" id="'+a+'-resize" value="resize" checked="checked" /><label for="'+a+'-resize">'+s.i18n("resize")+"</label>",'<input class="api2" type="radio" name="type" id="'+a+'-crop" value="crop" /><label class="api2" for="'+a+'-crop">'+s.i18n("crop")+"</label>",'<input class="api2" type="radio" name="type" id="'+a+'-rotate" value="rotate" /><label class="api2" for="'+a+'-rotate">'+s.i18n("rotate")+"</label>"),$="resize",K=(B[f]()[f]("disable").find("input").on("change",function(){$=e(this).val(),Ne(),$e(!0),Ke(!0),Ve(!0),"resize"==$?(R.show(),H.hide(),q.hide(),$e(),C&&ze.insertAfter(R.find(".elfinder-resize-grid8"))):"crop"==$?(H.hide(),R.hide(),q.show(),Ke(),C&&ze.insertAfter(q.find(".elfinder-resize-grid8"))):"rotate"==$&&(R.hide(),q.hide(),H.show(),Ve())}),e(T).on("change",function(){var e=_e(parseInt(K.val())),t=_e(fe?e/de:parseInt(V.val()));e>0&&t>0&&(Le.updateView(e,t),K.val(e),V.val(t))}).addClass("elfinder-focus")),V=e(T).on("change",function(){var e=_e(parseInt(V.val())),t=_e(fe?e*de:parseInt(K.val()));t>0&&e>0&&(Le.updateView(t,e),K.val(t),V.val(e))}),X=e(T).on("change",function(){We.updateView()}),G=e(T).on("change",function(){We.updateView()}),J=e(T).on("change",function(){We.updateView("w")}),Y=e(T).on("change",function(){We.updateView("h")}),Q=C&&d?e(T).val(s.storage("jpgQuality")>0?s.storage("jpgQuality"):s.option("jpgQuality")).addClass("elfinder-resize-quality").attr("min","1").attr("max","100").attr("title","1 - 100").on("blur",function(){var e=Math.min(100,Math.max(1,parseInt(this.value)));F.find("input.elfinder-resize-quality").val(e)}):null,Z=e('<input type="number" class="ui-corner-all" maxlength="3" value="0" />').on("change",function(){Be.update()}),ee=e('<div class="elfinder-resize-rotate-slider touch-punch"/>').slider({min:0,max:360,value:Z.val(),animate:!0,start:j,stop:M,change:function(e,t){t.value!=ee.slider("value")&&Be.update(t.value)},slide:function(e,t){Be.update(t.value,!1)}}).find(".ui-slider-handle").addClass("elfinder-tabstop").off("keydown").on("keydown",function(t){t.keyCode!=e.ui.keyCode.LEFT&&t.keyCode!=e.ui.keyCode.RIGHT||(t.stopPropagation(),t.preventDefault(),Be.update(Number(Z.val())+(t.keyCode==e.ui.keyCode.RIGHT?1:-1),!1))}).end(),te={},ne=function(e){var t,n,i,a,o,r,s;try{t=te[Math.round(e.offsetX)][Math.round(e.offsetY)]}catch(e){}t&&(n=t[0],i=t[1],a=t[2],o=t[3],r=t[4],s=t[5],ae(n,i,a,"click"===e.type))},ie=function(t){ae(e(this).css("backgroundColor"),"","","click"===t.type)},ae=function(t,n,i,a){var o,r,s;"string"==typeof t&&(n="",t&&(o=e("<span>").css("backgroundColor",t).css("backgroundColor"))&&(r=o.match(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i))&&(t=Number(r[1]),n=Number(r[2]),i=Number(r[3]))),s=""===n?t:"#"+oe(t,n,i),le.val(s).css({backgroundColor:s,backgroundImage:"none",color:t+n+i<384?"#fff":"#000"}),D.css("backgroundColor",s),a&&(He.off(".picker").removeClass("elfinder-resize-picking"),ce.off(".picker").removeClass("elfinder-resize-picking"))},oe=function(t,n,i){return e.map([t,n,i],function(e){return("0"+parseInt(e).toString(16)).slice(-2)}).join("")},re=e("<button>").text(s.i18n("colorPicker")).on("click",function(){He.on("mousemove.picker click.picker",ne).addClass("elfinder-resize-picking"),ce.on("mousemove.picker click.picker","span",ie).addClass("elfinder-resize-picking")}).button({icons:{primary:"ui-icon-pin-s"},text:!1}),se=e("<button>").text(s.i18n("reset")).on("click",function(){ae("","","",!0)}).button({icons:{primary:"ui-icon-arrowrefresh-1-n"},text:!1}),le=e('<input class="ui-corner-all elfinder-resize-bg" type="text">').on("focus",function(){e(this).attr("style","")}).on("blur",function(){ae(e(this).val())}),ce=e('<div class="elfinder-resize-pallet">').on("click","span",function(){ae(e(this).css("backgroundColor"))}),de=1,pe=1,ue=0,he=0,fe=!0,me=!1,ge=0,ve=0,be=0,ye=0,we=0,xe=!!C&&m,ke=e("<button>").html(s.i18n("aspectRatio")).on("click",function(){fe=!fe,ke.button("option",{icons:{primary:fe?"ui-icon-locked":"ui-icon-unlocked"}}),Le.fixHeight(),E.resizable("option","aspectRatio",fe).data("uiResizable")._aspectRatio=fe}).button({icons:{primary:fe?"ui-icon-locked":"ui-icon-unlocked"},text:!1}),Ce=e("<button>").html(s.i18n("aspectRatio")).on("click",function(){me=!me,Ce.button("option",{icons:{primary:me?"ui-icon-locked":"ui-icon-unlocked"}}),P.resizable("option","aspectRatio",me).data("uiResizable")._aspectRatio=me}).button({icons:{primary:me?"ui-icon-locked":"ui-icon-unlocked"},text:!1}),ze=e("<button>").html(s.i18n(xe?"enabled":"disabled")).toggleClass("ui-state-active",xe).on("click",function(){xe=!xe,ze.html(s.i18n(xe?"enabled":"disabled")).toggleClass("ui-state-active",xe),Te()}).button(),Te=function(){var t=xe?8:1;e.each([K,V,J,Y,X,G],function(){this.attr("step",t)}),xe&&(K.val(_e(K.val())),V.val(_e(V.val())),J.val(_e(J.val())),Y.val(_e(Y.val())),X.val(_e(X.val())),G.val(_e(G.val())),R.is(":visible")?Le.updateView(K.val(),V.val()):q.is(":visible")&&We.updateView())},Ae=function(){var t,n=function(){le.parent().hide(),ce.hide()};t=Math.min(ge,ve)/Math.sqrt(Math.pow(ue,2)+Math.pow(he,2)),be=Math.ceil(ue*t),ye=Math.ceil(he*t),He.width(be).height(ye).css("margin-top",(ve-ye)/2+"px").css("margin-left",(ge-be)/2+"px"),He.is(":visible")&&le.is(":visible")&&("image/png"!==i.mime?(D.css("backgroundColor",le.val()),o=e("<img>"),s.isCORS&&o.attr("crossorigin","use-credentials"),o.on("load",function(){l&&l.width!==be&&Se()}).on("error",n).attr("src",nt)):n())},Ie=function(){Le.updateView(ue,he),Ae(),Pe.width(Ee.width()).height(Ee.height()),Re.width(Ee.width()).height(Ee.height()),We.updateView(),at()},Se=function(){if(w){var t,n,i,a,r,s,c,d,p,u,h,f,m,g,v,b,y,x,k,C={},z=[],T=function(e,t,n){var i,a,o,r=Math.max(Math.max(e,t),n),s=Math.min(Math.min(e,t),n);return r===s?i=0:e===r?i=((t-n)/(r-s)*60+360)%360:t===r?i=(n-e)/(r-s)*60+120:n===r&&(i=(e-t)/(r-s)*60+240),a=(r-s)/r,o=(.3*e+.59*t+.11*n)/255,[i,a,o,"hsl"]},A=function(e){return 8*Math.round(e/8)};e:try{n=l.width=He.width(),i=l.height=He.height(),m=n/ue,w.scale(m,m),w.drawImage(o.get(0),0,0),f=w.getImageData(0,0,n,i).data,g=.1*n,v=.9*n,b=.1*i,y=.9*i;for(var I=0;I<i-1;I++)for(var S=0;S<n-1;S++){if(t=4*S+I*n*4,a=f[t],r=f[t+1],s=f[t+2],c=f[t+3],255!==c){le.parent().hide(),ce.hide();break e}u=T(a,r,s),h=Math.round(u[0]),d=Math.round(100*u[1]),p=Math.round(100*u[2]),te[S]||(te[S]={}),te[S][I]=[a,r,s,h,d,p],(S<g||S>v)&&(I<b||I>y)&&(x=A(a)+","+A(r)+","+A(s),C[x]?++C[x]:C[x]=1)}ce.children(":first").length||(k=1,e.each(C,function(e,t){z.push({c:e,v:t})}),e.each(z.sort(function(e,t){return e.v>t.v?-1:1}),function(){return!(this.v<2||k>10)&&(ce.append(e('<span style="width:20px;height:20px;display:inline-block;background-color:rgb('+this.c+');">')),void++k)}))}catch(O){re.hide(),ce.hide()}}},Oe=function(){try{l=document.createElement("canvas"),w=l.getContext("2d")}catch(e){re.hide(),ce.hide()}},je=function(){rt.on("click","span.elfinder-resize-preset",function(){var t=e(this),n=t.data("s")[0],i=t.data("s")[1],a=ue/he;t.data("s",[i,n]).text(i+"x"+n),ue>n||he>i?ue<=n?n=_e(i*a):he<=i?i=_e(n/a):ue-n>he-i?i=_e(n/a):n=_e(i*a):(n=ue,i=he),K.val(n),V.val(i),Le.updateView(n,i),at()}),st.on("click","span.elfinder-resize-preset",function(){var t=e(this),n=t.data("s")[0],i=t.data("s")[1],a=X.val(),o=G.val();t.data("s",[i,n]).text(i+"x"+n),ue>=n&&he>=i&&(ue-n-a<0&&(a=ue-n),he-i-o<0&&(o=he-i),X.val(a),G.val(o),J.val(n),Y.val(i),We.updateView(),at())}),st.children("span.elfinder-resize-preset").each(function(){var t=e(this),n=t.data("s")[0],i=t.data("s")[1];t[ue>=n&&he>=i?"show":"hide"]()})},Me=null,Fe=!1,De=function(e){var t=s.file(i.hash);t.width=e[0],t.height=e[1]},Ue=function(){var n,a,o;Fe||(Fe=!0,Me&&Me.state&&"pending"===Me.state()&&Me.reject(),s.api>=2.103?0===t&&s.request({data:{cmd:"resize",target:i.hash,degree:0,mode:"rotate"},preventDefault:!0}).done(function(e){t=e.losslessRotate?1:-1,1===t&&Z.val()%90===0&&H.children("div.elfinder-resize-quality").hide()}).fail(function(){t=-1}):t=-1,n=Ee.get(0),a=i.width&&i.height?{w:i.width,h:i.height}:n.naturalWidth?null:{w:Ee.width(),h:Ee.height()},a&&Ee.removeAttr("width").removeAttr("height"),ue=i.width||n.naturalWidth||n.width||Ee.width(),he=i.height||n.naturalHeight||n.height||Ee.height(),i.width&&i.height||De([ue,he]),a&&Ee.width(a.w).height(a.h),x.show(),o=he/ue,o<1&&D.height()>D.width()*o&&D.height(D.width()*o),D.height()>Ee.height()+20&&D.height(Ee.height()+20),ve=D.height()-(E.outerHeight()-E.height()),U.remove(),de=ue/he,E.append(Ee.show()).show(),K.val(ue),V.val(he),Oe(),je(),Ie(),B[f]("enable"),F.find("input,select").prop("disabled",!1).filter(":text").on("keydown",function(t){var n;if(t.keyCode==e.ui.keyCode.ENTER)return t.stopPropagation(),t.preventDefault(),n={title:e("input:checked",B).val(),text:"confirmReq",accept:{label:"btnApply",callback:function(){Ge()}},cancel:{label:"btnCancel",callback:function(){e(this).trigger("focus")}}},lt&&(n.buttons=[{label:"btnSaveAs",callback:function(){requestAnimationFrame(Je)}}]),void s.confirm(n)}).on("keyup",function(){var t=e(this);t.hasClass("elfinder-resize-bg")||requestAnimationFrame(function(){t.val(t.val().replace(/[^0-9]/g,""))})}).filter(":first"),Te(),!s.UA.Mobile&&K.trigger("focus"),$e())},Ee=e("<img/>").on("load",Ue).on("error",function(){U.text("Unable to load image").css("background","transparent")}),Pe=e("<div/>"),Re=e("<img/>"),qe=e("<div/>"),He=e('<img class="elfinder-resize-imgrotate" />'),_e=function(e,t){return e=xe?8*Math.round(e/8):Math.round(e),e=Math.max(0,e),t&&e>t&&(e=xe?8*Math.floor(t/8):t),e},Ne=function(){K.val(ue),V.val(he),Le.updateView(ue,he),X.val(0),G.val(0),J.val(ue),Y.val(he),We.updateView(),at()},Le={update:function(){K.val(_e(Ee.width()/pe)),V.val(_e(Ee.height()/pe)),at()},updateView:function(e,t){e>ge||t>ve?e/ge>t/ve?(pe=ge/e,Ee.width(ge).height(_e(t*pe))):(pe=ve/t,Ee.height(ve).width(_e(e*pe))):Ee.width(_e(e)).height(_e(t)),pe=Ee.width()/e,L.text("1 : "+(1/pe).toFixed(2)),Le.updateHandle()},updateHandle:function(){E.width(Ee.width()).height(Ee.height())},fixHeight:function(){var e,t;fe&&(e=K.val(),t=_e(e/de),Le.updateView(e,t),V.val(t))}},We={update:function(e){X.val(_e((P.data("x")||P.position().left)/pe,ue)),G.val(_e((P.data("y")||P.position().top)/pe,he)),"xy"!==e&&(J.val(_e((P.data("w")||P.width())/pe,ue-X.val())),Y.val(_e((P.data("h")||P.height())/pe,he-G.val()))),at()},updateView:function(e){var t,n,i,a,o;X.val(_e(X.val(),ue-(xe?8:1))),G.val(_e(G.val(),he-(xe?8:1))),J.val(_e(J.val(),ue-X.val())),Y.val(_e(Y.val(),he-G.val())),me&&(t=qe.width()/qe.height(),"w"===e?Y.val(_e(parseInt(J.val())/t)):"h"===e&&J.val(_e(parseInt(Y.val())*t))),n=Math.round(parseInt(X.val())*pe),i=Math.round(parseInt(G.val())*pe),"xy"!==e?(a=Math.round(parseInt(J.val())*pe),o=Math.round(parseInt(Y.val())*pe)):(a=P.data("w"),o=P.data("h")),P.data({x:n,y:i,w:a,h:o}).width(a).height(o).css({left:n,top:i}),qe.width(a).height(o)},resize_update:function(e,t){P.data({x:t.position.left,y:t.position.top,w:t.size.width,h:t.size.height}),We.update(),We.updateView()},drag_update:function(e,t){P.data({x:t.position.left,y:t.position.top}),We.update("xy")}},Be={mouseStartAngle:0,imageStartAngle:0,imageBeingRotated:!1,setQuality:function(){H.children("div.elfinder-resize-quality")[t>0&&Z.val()%90===0?"hide":"show"]()},update:function(e,t){"undefined"==typeof e&&(we=e=parseInt(Z.val())),"undefined"==typeof t&&(t=!0),!t||s.UA.Opera||s.UA.ltIE8?He.rotate(e):He.animate({rotate:e+"deg"}),e%=360,e<0&&(e+=360),Z.val(parseInt(e)),ee.slider("value",Z.val()),Be.setQuality()},execute:function(e){if(Be.imageBeingRotated){var t=Be.getCenter(He),n=e.originalEvent.touches?e.originalEvent.touches[0]:e,i=n.pageX-t[0],a=n.pageY-t[1],o=Math.atan2(a,i),r=o-Be.mouseStartAngle+Be.imageStartAngle;return r=Math.round(180*parseFloat(r)/Math.PI),e.shiftKey&&(r=15*Math.round((r+6)/15)),He.rotate(r),r%=360,r<0&&(r+=360),Z.val(r),ee.slider("value",Z.val()),Be.setQuality(),!1}},start:function(t){if(!He.hasClass("elfinder-resize-picking")){j(),Be.imageBeingRotated=!0;var n=Be.getCenter(He),i=t.originalEvent.touches?t.originalEvent.touches[0]:t,a=i.pageX-n[0],o=i.pageY-n[1];return Be.mouseStartAngle=Math.atan2(o,a),Be.imageStartAngle=parseFloat(He.rotate())*Math.PI/180,e(document).on("mousemove",Be.execute),He.on("touchmove",Be.execute),!1}},stop:function(t){if(Be.imageBeingRotated)return e(document).off("mousemove",Be.execute),He.off("touchmove",Be.execute),requestAnimationFrame(function(){Be.imageBeingRotated=!1}),M(),!1},getCenter:function(e){var t=He.rotate();He.rotate(0);var n=He.offset(),i=n.left+He.width()/2,a=n.top+He.height()/2;return He.rotate(t),Array(i,a)}},$e=function(e){e?(E.filter(":ui-resizable").resizable("destroy"),E.hide()):(E.show(),E.resizable({alsoResize:Ee,aspectRatio:fe,resize:Le.update,start:j,stop:function(e){Le.fixHeight,Le.updateView(K.val(),V.val()),M()}}),ot())},Ke=function(e){e?(P.filter(":ui-resizable").resizable("destroy").filter(":ui-draggable").draggable("destroy"),Pe.hide()):(Pe.show(),P.resizable({containment:Pe,aspectRatio:me,resize:We.resize_update,start:j,stop:M,handles:"all"}).draggable({handle:qe,containment:Re,drag:We.drag_update,start:j,stop:function(){We.updateView("xy"),M()}}),ot(),We.update())},Ve=function(e){e?He.hide():(He.show(),ot())},Xe=function(){var e,t,n,i,a,o,r="";if("resize"==$)e=parseInt(K.val())||0,t=parseInt(V.val())||0;else if("crop"==$)e=parseInt(J.val())||0,t=parseInt(Y.val())||0,n=parseInt(X.val())||0,i=parseInt(G.val())||0;else if("rotate"==$){if(e=ue,t=he,a=parseInt(Z.val())||0,a<0||a>360)return s.error("Invalid rotate degree"),!1;if(0==a||360==a)return s.error("errResizeNoChange"),!1;r=le.val()}if(o=Q?parseInt(Q.val()):0,"rotate"!=$){if(e<=0||t<=0)return s.error("Invalid image size"),!1;if(e==ue&&t==he)return s.error("errResizeNoChange"),!1}return{w:e,h:t,x:n,y:i,d:a,q:o,b:r}},Ge=function(){var e;(e=Xe())&&(z.elfinderdialog("close"),r.resizeRequest({target:i.hash,width:e.w,height:e.h,x:e.x,y:e.y,degree:e.d,quality:e.q,bg:e.b,mode:$},i,c))},Je=function(){var t,n=function(){t.addClass(y).fadeIn(function(){k.addClass(b)}),s.disable()},a=function(){r.mime=i.mime,r.prefix=i.name.replace(/ \d+(\.[^.]+)?$/,"$1"),r.requestCmd="mkfile",r.nextAction={},r.data={target:i.phash},e.proxy(s.res("mixin","make"),r)().done(function(a){var o,r;a.added&&a.added.length?(o=a.added[0].hash,r=s.api<2.1032?s.url(i.hash,{async:!0,temporary:!0}):null,e.when(r).done(function(e){s.request({options:{type:"post"},data:{cmd:"put",target:o,encoding:r?"scheme":"hash",content:r?s.convAbsUrl(e):i.hash},notify:{type:"copy",cnt:1},syncOnFail:!0}).fail(n).done(function(e){e=s.normalize(e),s.updateCache(e),i=s.file(o),e.changed&&e.changed.length&&s.change(e),k.show().find(".elfinder-dialog-title").html(s.escape(i.name)),Ge(),t.fadeIn()})}).fail(n)):n()}).fail(n).always(function(){delete r.mime,delete r.prefix,delete r.nextAction,delete r.data}),s.trigger("unselectfiles",{files:[i.hash]})},o=null;Xe()&&(t=h.children("."+v+":visible").removeClass(y).fadeOut(),k.removeClass(b),s.enable(),s.searchStatus.state<2&&i.phash!==s.cwd().hash&&(o=s.exec("open",[i.phash],{thash:i.phash})),e.when([o]).done(function(){o?s.one("cwdrender",a):a()}).fail(n))},Ye={},Qe="elfinder-resize-handle-hline",Ze="elfinder-resize-handle-vline",et="elfinder-resize-handle-point",tt=s.openUrl(i.hash),nt=s.openUrl(i.hash,!s.isSameOrigin(tt)),it=Q?e("<img>").attr("crossorigin",s.isCORS?"use-credentials":"").attr("src",nt).on("load",function(){try{var e=document.createElement("canvas");it.data("canvas",e).data("ctx",e.getContext("2d")),at()}catch(t){it.removeData("canvas").removeData("ctx")}}):null,at=function(){F.find("input.elfinder-resize-quality:visible").trigger("change")},ot=function(t){if(!k.hasClass("elfinder-dialog-minimized")&&!k.is(":hidden")){rt.hide(),st.hide();var n,i,a,o=s.options.dialogContained?h:e(window),r=o.height(),l=o.width(),c="auto",d=!0;k.width(Math.min(u,l-30)),D.attr("style",""),ue&&he&&(ge=D.width()-(E.outerWidth()-E.width()),ve=D.height()-(E.outerHeight()-E.height()),Le.updateView(ue,he)),i=z.find("div.elfinder-resize-control").width(),a=D.width(),n=z.width()-20,a>n?(D.width(n),d=!1):n-a<i&&(l>r?D.width(n-i-20):(D.css({"float":"none",marginLeft:"auto",marginRight:"auto"}),d=!1)),d&&(c=i),ge=D.width()-(E.outerWidth()-E.width()),h.hasClass("elfinder-fullscreen")?k.height()>r&&(r-=2,D.height(r-k.height()+D.height()),k.css("top",0-h.offset().top)):(r-=30,D.height()>r&&D.height(r)),ve=D.height()-(E.outerHeight()-E.height()),ue&&he&&Ie(),Ee.height()&&D.height()>Ee.height()+20&&(D.height(Ee.height()+20),ve=D.height()-(E.outerHeight()-E.height()),Ae()),rt.css("width",c).show(),st.css("width",c).show(),st.children("span.elfinder-resize-preset:visible").length||st.hide()}},rt=function(){var t,n=e('<fieldset class="elfinder-resize-preset-container">').append(e("<legend>").html(s.i18n("presets"))).hide();return e.each(g,function(i,a){2===a.length&&(t=!0,n.append(e('<span class="elfinder-resize-preset"/>').data("s",a).text(a[0]+"x"+a[1]).button()))}),t?n:e()}(),st=rt.clone(!0),lt=s.uploadMimeCheck(i.mime,i.phash);R.append(e(A).append(e(I).text(s.i18n("width")),K),e(A).append(e(I).text(s.i18n("height")),V,e('<div class="elfinder-resize-whctrls">').append(ke,W)),Q?e(A).append(e(I).text(s.i18n("quality")),Q,e("<span/>")):e(),C?e(A).append(e(I).text(s.i18n("8pxgrid")).addClass("elfinder-resize-grid8"),ze):e(),e(A).append(e(I).text(s.i18n("scale")),L),e(A).append(rt)),d&&(q.append(e(A).append(e(I).text("X"),X),e(A).append(e(I).text("Y")).append(G),e(A).append(e(I).text(s.i18n("width")),J),e(A).append(e(I).text(s.i18n("height")),Y,e('<div class="elfinder-resize-whctrls">').append(Ce,W.clone(!0))),Q?e(A).append(e(I).text(s.i18n("quality")),Q.clone(!0),e("<span/>")):e(),C?e(A).append(e(I).text(s.i18n("8pxgrid")).addClass("elfinder-resize-grid8")):e(),e(A).append(st)),H.append(e(A).addClass("elfinder-resize-degree").append(e(I).text(s.i18n("rotate")),Z,e("<span/>").text(s.i18n("degree")),e("<div/>").append(_,N)[f]()),e(A).css("height","20px").append(ee),Q?e(A)[t<1?"show":"hide"]().addClass("elfinder-resize-quality").append(e(I).text(s.i18n("quality")),Q.clone(!0),e("<span/>")):e(),e(A).append(e(I).text(s.i18n("bgcolor")),le,re,se),e(A).css("height","20px").append(ce)),_.on("click",function(){we-=90,Be.update(we)}),N.on("click",function(){we+=90,Be.update(we)})),z.append(B).on("resize",function(e){e.stopPropagation()}),d?F.append(R,q.hide(),H.hide()):F.append(R),E.append('<div class="'+Qe+" "+Qe+'-top"/>','<div class="'+Qe+" "+Qe+'-bottom"/>','<div class="'+Ze+" "+Ze+'-left"/>','<div class="'+Ze+" "+Ze+'-right"/>','<div class="'+et+" "+et+'-e"/>','<div class="'+et+" "+et+'-se"/>','<div class="'+et+" "+et+'-s"/>'),D.append(U).append(E.hide()).append(Ee.hide()),d&&(P.css("position","absolute").append('<div class="'+Qe+" "+Qe+'-top"/>','<div class="'+Qe+" "+Qe+'-bottom"/>','<div class="'+Ze+" "+Ze+'-left"/>','<div class="'+Ze+" "+Ze+'-right"/>','<div class="'+et+" "+et+'-n"/>','<div class="'+et+" "+et+'-e"/>','<div class="'+et+" "+et+'-s"/>','<div class="'+et+" "+et+'-w"/>','<div class="'+et+" "+et+'-ne"/>','<div class="'+et+" "+et+'-se"/>','<div class="'+et+" "+et+'-sw"/>','<div class="'+et+" "+et+'-nw"/>'),D.append(Pe.css("position","absolute").hide().append(Re,P.append(qe))),D.append(He.hide())),D.css("overflow","hidden"),z.append(D,F),Ye[s.i18n("btnApply")]=Ge,lt&&(Ye[s.i18n("btnSaveAs")]=function(){requestAnimationFrame(Je)}),Ye[s.i18n("btnCancel")]=function(){z.elfinderdialog("close")},z.find("input,button").addClass("elfinder-tabstop"),k=s.dialog(z,{title:s.escape(i.name),width:u,resizable:!1,buttons:Ye,open:function(){var e=!!(s.option("substituteImg",i.hash)&&i.size>p.dimSubImgSize),t=!(!i.width||!i.height);if(z.parent().css("overflow","hidden"),x=k.find(".ui-dialog-titlebar .elfinder-titlebar-minimize").hide(),s.bind("resize",ot),Ee.attr("src",tt),Re.attr("src",tt),He.attr("src",tt),d&&(He.on("mousedown touchstart",Be.start).on("touchend",Be.stop),k.on("mouseup",Be.stop)),t&&!e)return Ue();if(i.size>(p.getDimThreshold||0))Me=s.request({data:{cmd:"dim",target:i.hash,substitute:e?400:""},preventDefault:!0}).done(function(e){if(e.dim){var t=e.dim.split("x");return i.width=t[0],i.height=t[1],De(t),e.url&&(Ee.attr("src",e.url),Re.attr("src",e.url),He.attr("src",e.url)),Ue()}});else if(t)return Ue()},close:function(){d&&(He.off("mousedown touchstart",Be.start).off("touchend",Be.stop),e(document).off("mouseup",Be.stop)),s.unbind("resize",ot),e(this).elfinderdialog("destroy")},resize:function(e,t){t&&"off"===t.minimize&&ot()}}).attr("id",a).closest(".ui-dialog").addClass(v+" "+y),s.UA.ltIE8&&e(".elfinder-dialog").css("filter",""),qe.css({opacity:.2,"background-color":"#fff",position:"absolute"}),P.css("cursor","move"),P.find(".elfinder-resize-handle-point").css({"background-color":"#fff",opacity:.5,"border-color":"#000"}),d||B.find(".api2").remove(),F.find("input,select").prop("disabled",!0),F.find("input.elfinder-resize-quality").next("span").addClass("elfinder-resize-jpgsize").attr("title",s.i18n("roughFileSize"))};return l.length&&l[0].mime.indexOf("image/")!==-1?(a="resize-"+s.namespace+"-"+l[0].hash,o=h.find("#"+a),o.length?(o.elfinderdialog("toTop"),c.resolve()):(w(l[0],a),c)):c.reject()}},function(e){var t=function(e,t){var n=0;for(n in t)if("undefined"!=typeof e[t[n]])return t[n];return e[t[n]]="",t[n]};if(e.cssHooks.rotate={get:function(t,n,i){return e(t).rotate()},set:function(t,n){return e(t).rotate(n),n}},e.cssHooks.transform={get:function(e,n,i){var a=t(e.style,["WebkitTransform","MozTransform","OTransform","msTransform","transform"]);return e.style[a]},set:function(e,n){var i=t(e.style,["WebkitTransform","MozTransform","OTransform","msTransform","transform"]);return e.style[i]=n,n}},e.fn.rotate=function(e){var t;return"undefined"==typeof e?window.opera?(t=this.css("transform").match(/rotate\((.*?)\)/),t&&t[1]?Math.round(180*parseFloat(t[1])/Math.PI):0):(t=this.css("transform").match(/rotate\((.*?)\)/),t&&t[1]?parseInt(t[1]):0):(this.css("transform",this.css("transform").replace(/none|rotate\(.*?\)/,"")+"rotate("+parseInt(e)+"deg)"),this)},e.fx.step.rotate=function(t){0==t.state&&(t.start=e(t.elem).rotate(),t.now=t.start),e(t.elem).rotate(t.now)},"undefined"==typeof window.addEventListener&&"undefined"==typeof document.getElementsByClassName){var n=function(e){for(var t=e,n=t.offsetLeft,i=t.offsetTop;t.offsetParent&&(t=t.offsetParent,t==document.body||"static"==t.currentStyle.position);)t!=document.body&&t!=document.documentElement&&(n-=t.scrollLeft,i-=t.scrollTop),n+=t.offsetLeft,i+=t.offsetTop;return{x:n,y:i}},i=function(e){if("static"==e.currentStyle.position){var t=n(e);e.style.position="absolute",e.style.left=t.x+"px",e.style.top=t.y+"px"}},a=function(e,t){var n,a=1,o=1,r=1,s=1;if("undefined"!=typeof e.style.msTransform)return!0;i(e),n=t.match(/rotate\((.*?)\)/);var l=n&&n[1]?parseInt(n[1]):0;l%=360,l<0&&(l=360+l);var c=l*Math.PI/180,d=Math.cos(c),p=Math.sin(c);a*=d,o*=-p,r*=p,s*=d,e.style.filter=(e.style.filter||"").replace(/progid:DXImageTransform\.Microsoft\.Matrix\([^)]*\)/,"")+("progid:DXImageTransform.Microsoft.Matrix(M11="+a+",M12="+o+",M21="+r+",M22="+s+",FilterType='bilinear',sizingMethod='auto expand')");var u=parseInt(e.style.width||e.width||0),h=parseInt(e.style.height||e.height||0);c=l*Math.PI/180;var f=Math.abs(Math.cos(c)),m=Math.abs(Math.sin(c)),g=(u-(u*f+h*m))/2,v=(h-(u*m+h*f))/2;return e.style.marginLeft=Math.floor(g)+"px",e.style.marginTop=Math.floor(v)+"px",!0},o=e.cssHooks.transform.set;e.cssHooks.transform.set=function(e,t){return o.apply(this,[e,t]),a(e,t),t}}}(jQuery),(i.prototype.commands.restore=function(){"use strict";var t=this,n=this.fm,i=0,a=function(t){var o,r=e.Deferred(),s=[],l=[],c=[],d=[];return r._xhrReject=function(){e.each(c,function(){this&&this.reject&&this.reject()}),o&&o._xhrReject()},e.each(t,function(e,t){"directory"===t.mime?s.push(t):l.push(t)}),s.length?(e.each(s,function(e,t){c.push(n.request({data:{cmd:"open",target:t.hash},preventDefault:!0,asNotOpen:!0})),d[e]=t.hash}),e.when.apply(e,c).fail(function(){r.reject()}).done(function(){var t=[];e.each(arguments,function(e,n){n.files&&(n.files.length?t=t.concat(n.files):t.push({hash:"fakefile_"+i++,phash:d[e],mime:"fakefile",name:"fakefile",ts:0}))}),n.cache(t),o=a(t).done(function(e){l=l.concat(e),r.resolve(l)})})):r.resolve(l),r},o=function(t,o,r,s){var l,c,d={},p=[],u=!1,h=[],f=s||{},m=+new Date;n.lockfiles({files:r}),h=e.map(o,function(e){return"directory"===e.mime?e.hash:null}),t.done(function(){h&&n.exec("rm",h,{forceRm:!0,quiet:!0})}).always(function(){n.unlockfiles({files:r})}),l=setTimeout(function(){n.notify({type:"search",id:m,cnt:1,hideCnt:!0,cancel:function(){c&&c._xhrReject(),t.reject()}})},n.notifyDelay),i=0,c=a(o).always(function(){l&&clearTimeout(l),n.notify({type:"search",id:m,cnt:-1,hideCnt:!0})}).fail(function(){t.reject("errRestore","errFileNotFound")}).done(function(i){var a=["errRestore","errFolderNotFound"],o="";
i.length?(e.each(i,function(t,i){for(var a,r,s,l=i.phash;l;){if(r=n.trashes[l]){if(!d[r]){if(u)return p.push(i.hash),null;d[r]={},u=!0}s=n.path(i.hash).substr(n.path(l).length).replace(/\\/g,"/"),s=s.replace(/\/[^\/]+?$/,""),""===s&&(s="/"),d[r][s]||(d[r][s]=[]),"fakefile"===i.mime?n.updateCache({removed:[i.hash]}):d[r][s].push(i.hash),(!o||o.length>s.length)&&(o=s);break}a=n.file(l),a?l=a.phash:(l=!1,e.each(n.trashes,function(e){var t=n.file(e),a=n.path(e);if((!t.volumeid||0===i.hash.indexOf(t.volumeid))&&0===n.path(i.hash).indexOf(a))return l=e,!1}))}}),u?e.each(d,function(i,s){var l=Object.keys(s),c=l.length;n.request({data:{cmd:"mkdir",target:i,dirs:l},notify:{type:"chkdir",cnt:c},preventFail:!0}).fail(function(e){t.reject(e),n.unlockfiles({files:r})}).done(function(i){var r,l;(l=i.hashes)?(r=n.getCommand("paste"),r?n.one("mkdirdone",function(){var i=!1;e.each(s,function(e,r){l[e]&&(r.length?n.file(l[e])?(n.clipboard(r,!0),n.exec("paste",[l[e]],{_cmd:"restore",noToast:f.noToast||e!==o}).done(function(e){e&&(e.error||e.warning)&&(i=!0)}).fail(function(){i=!0}).always(function(){--c<1&&(t[i?"reject":"resolve"](),p.length&&n.exec("restore",p))})):t.reject(a):--c<1&&(t.resolve(),p.length&&n.exec("restore",p)))})}):t.reject(["errRestore","errCmdNoSupport","(paste)"])):t.reject(a)})}):t.reject(a)):(t.reject("errFileNotFound"),h&&n.exec("rm",h,{forceRm:!0,quiet:!0}))})};this.restore=o,this.linkedCmds=["copy","paste","mkdir","rm"],this.updateOnSelect=!1,this.init=function(){t=this,n=this.fm},this.getstate=function(t,i){return t=t||n.selected(),t.length&&e.grep(t,function(e){var t=n.file(e);return!(!t||t.locked||n.isRoot(t))}).length==t.length?0:-1},this.exec=function(i,a){var o=e.Deferred().fail(function(e){e&&n.error(e)}),r=t.files(i);return r.length?(e.each(r,function(e,t){return n.isRoot(t)?!o.reject(["errRestore",t.name]):t.locked?!o.reject(["errLocked",t.name]):void 0}),"pending"===o.state()&&this.restore(o,r,i,a),o):o.reject()}}).prototype={forceLoad:!0},i.prototype.commands.rm=function(){"use strict";var t=this,n=this.fm,i='<div class="ui-helper-clearfix elfinder-rm-title"><span class="elfinder-cwd-icon {class} ui-corner-all"/>{title}<div class="elfinder-rm-desc">{desc}</div></div>',a=function(a,o,s,c,d){var p,u,h,f,m,g,v=o.length,b=n.cwd().hash,y=[],w='<span class="elfinder-info-spinner"/>'+n.i18n("calc");v>1?(f=0,e.each(s,function(e,t){if(!t.size||"unknown"==t.size||"directory"===t.mime)return f="unknown",!1;var n=parseInt(t.size);n>=0&&f>=0&&(f+=n)}),l="unknown"===f,y.push(n.i18n("size")+": "+(l?w:n.formatSize(f))),u=[e(i.replace("{class}","elfinder-cwd-icon-group").replace("{title}","<strong>"+n.i18n("items")+": "+v+"</strong>").replace("{desc}",y.join("<br>")))]):(m=s[0],h=n.tmb(m),l="directory"===m.mime,y.push(n.i18n("size")+": "+(l?w:n.formatSize(m.size))),y.push(n.i18n("modify")+": "+n.formatDate(m)),g=n.escape(m.i18||m.name).replace(/([_.])/g,"&#8203;$1"),u=[e(i.replace("{class}",n.mime2class(m.mime)).replace("{title}","<strong>"+g+"</strong>").replace("{desc}",y.join("<br>")))]),d&&(u=u.concat(d)),u.push(c?"confirmTrash":"confirmRm"),p=n.confirm({title:t.title,text:u,accept:{label:"btnRm",callback:function(){c?t.toTrash(a,o,c):r(a,o)}},cancel:{label:"btnCancel",callback:function(){n.unlockfiles({files:o}),1===o.length&&n.file(o[0]).phash!==b?n.select({selected:o}):n.selectfiles({files:o}),a.reject()}}}),h&&e("<img/>").on("load",function(){p.find(".elfinder-cwd-icon").addClass(h.className).css("background-image","url('"+h.url+"')")}).attr("src",h.url),l&&(l=n.getSize(e.map(s,function(e){return"directory"===e.mime?e.hash:null})).done(function(e){p.find("span.elfinder-info-spinner").parent().html(n.i18n("size")+": "+e.formated)}).fail(function(){p.find("span.elfinder-info-spinner").parent().html(n.i18n("size")+": "+n.i18n("unknown"))}).always(function(){l=!1}))},o=function(i,a,o){var r,s,l,c={},d=a.length,p=t.options.toTrashMaxItems,u=[],h=e.Deferred();return d>p?void t.confirm(i,a,t.files(a),null,[n.i18n("tooManyToTrash")]):(e.each(a,function(e,t){var i=n.file(t),a=n.path(t).replace(/\\/g,"/"),o=a.match(/^[^\/]+?(\/(?:[^\/]+?\/)*)[^\/]+?$/);i&&(o&&(o[1]=o[1].replace(/(^\/.*?)\/?$/,"$1"),c[o[1]]||(c[o[1]]=[]),c[o[1]].push(t)),"directory"===i.mime&&u.push(t))}),u.length?(r=n.request({data:{cmd:"size",targets:u},notify:{type:"readdir",cnt:1,hideCnt:!0},preventDefault:!0}).done(function(e){var t=0;e.fileCnt&&(t+=parseInt(e.fileCnt)),e.dirCnt&&(t+=parseInt(e.dirCnt)),h[t>p?"reject":"resolve"]()}).fail(function(){h.reject()}),setTimeout(function(){var e=r&&r.xhr?r.xhr:null;e&&"pending"==e.state()&&(r.syncOnFail(!1),r.reject(),h.reject())},1e3*t.options.infoCheckWait)):h.resolve(),void h.done(function(){s=Object.keys(c),l=s.length,l?n.request({data:{cmd:"mkdir",target:o,dirs:s},notify:{type:"chkdir",cnt:l},preventFail:!0}).fail(function(e){i.reject(e),n.unlockfiles({files:a})}).done(function(t){var o,r,s,d,p=function(t,i,o){var r,s,l,c;e.each(t,function(e,t){Array.isArray(t)&&(h[e]?h[e]=h[e].concat(t):h[e]=t)}),t.sync&&(h.sync=1),t.added&&t.added.length&&(r=function(){var i=[],a=e.map(t.added,function(e){return"directory"===e.mime?e.hash:null});return e.each(t.added,function(t,n){e.inArray(n.phash,a)===-1&&i.push(n.hash)}),n.exec("restore",i,{noToast:!0})},l=function(){return n.request({data:o,notify:{type:"redo",cnt:a.length}})},h.undo?(s=h.undo,h.undo=function(){r(),s()}):h.undo=r,h.redo?(c=h.redo,h.redo=function(){l(),c()}):h.redo=l)},u=["errTrash"],h={},f=function(){return n.ui.notify.children(".elfinder-notify-trash").length};(o=t.hashes)?(s=1/l*100,d=1===l?100:5,r=setTimeout(function(){n.notify({type:"trash",cnt:1,hideCnt:!0,progress:d})},n.notifyDelay),e.each(c,function(t,c){var m,g=n.file(c[0]).phash;o[t]&&(m={cmd:"paste",dst:o[t],targets:c,cut:1},n.request({data:m,preventDefault:!0}).fail(function(e){e&&(u=u.concat(e))}).done(function(e){e=n.normalize(e),n.updateCache(e),p(e,g,m),e.warning&&(u=u.concat(e.warning),delete e.warning),e.removed&&e.removed.length&&n.remove(e),e.added&&e.added.length&&n.add(e),e.changed&&e.changed.length&&n.change(e),n.trigger("paste",e),n.trigger("pastedone"),e.sync&&n.sync()}).always(function(){var t=[],o=2;f()?n.notify({type:"trash",cnt:0,hideCnt:!0,progress:s}):d+=s,--l<1&&(r&&clearTimeout(r),f()&&n.notify({type:"trash",cnt:-1}),n.unlockfiles({files:a}),Object.keys(h).length?(u.length>1&&((h.removed||h.removed.length)&&(t=e.grep(a,function(t){return e.inArray(t,h.removed)===-1})),t.length?(u.length>o&&(o=(n.messages[u[o-1]]||"").indexOf("$")===-1?o:o+1),i.reject(),n.exec("rm",t,{addTexts:u.slice(0,o),forceRm:!0})):n.error(u)),h._noSound=!0,h.undo&&h.redo&&(h.undo={cmd:"trash",callback:h.undo},h.redo={cmd:"trash",callback:h.redo}),i.resolve(h)):i.reject(u))}))})):(i.reject("errFolderNotFound"),n.unlockfiles({files:a}))}):(i.reject(["error","The folder hierarchy to be deleting can not be determined."]),n.unlockfiles({files:a}))}).fail(function(){t.confirm(i,a,t.files(a),null,[n.i18n("tooManyToTrash")])}))},r=function(e,t,i){var a=i?{}:{type:"rm",cnt:t.length};n.request({data:{cmd:"rm",targets:t},notify:a,preventFail:!0}).fail(function(t){e.reject(t)}).done(function(t){(t.error||t.warning)&&(t.sync=!0),e.resolve(t)}).always(function(){n.unlockfiles({files:t})})},s=function(t){var i,a=null;return t&&t.length&&(t.length>1&&2===n.searchStatus.state?(i=n.file(n.root(t[0])).volumeid,e.grep(t,function(e){return 0!==e.indexOf(i)}).length||(a=n.option("trashHash",t[0]))):a=n.option("trashHash",t[0])),a},l=!1;this.confirm=a,this.toTrash=o,this.remove=r,this.syncTitleOnChange=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"delete ctrl+backspace shift+delete"}],this.value="rm",this.init=function(){t=this,n=this.fm,t.change(function(){var i;delete t.extra,t.title=n.i18n("cmd"+t.value),t.className=t.value,t.button&&t.button.children("span.elfinder-button-icon")["trash"===t.value?"addClass":"removeClass"]("elfinder-button-icon-trash"),"trash"===t.value&&(t.extra={icon:"rm",node:e("<span/>").attr({title:n.i18n("cmdrm")}).on("ready",function(e,t){i=t.targets}).on("click touchstart",function(e){"touchstart"===e.type&&e.originalEvent.touches.length>1||(e.stopPropagation(),e.preventDefault(),n.getUI().trigger("click"),n.exec("rm",i,{_userAction:!0,forceRm:!0}))})})})},this.getstate=function(t){var i=this.hashes(t);return i.length&&e.grep(i,function(e){var t=n.file(e);return!(!t||t.locked||n.isRoot(t))}).length==i.length?0:-1},this.exec=function(i,a){var o,c=a||{},d=e.Deferred().always(function(){l&&l.state&&"pending"===l.state()&&l.reject()}).fail(function(e){e&&n.error(e)}).done(function(e){!c.quiet&&!e._noSound&&e.removed&&e.removed.length&&n.trigger("playsound",{soundFile:"rm.wav"})}),p=t.files(i),u=p.length,h=null,f=c.addTexts?c.addTexts:null,m=c.forceRm,g=c.quiet;return u?(e.each(p,function(e,t){return n.isRoot(t)?!d.reject(["errRm",t.name,"errPerm"]):t.locked?!d.reject(["errLocked",t.name]):void 0}),"pending"===d.state()&&(o=t.hashes(i),u=p.length,(m||t.event&&t.event.originalEvent&&t.event.originalEvent.shiftKey)&&(h="",t.title=n.i18n("cmdrm")),null===h&&(h=s(o)),n.lockfiles({files:o}),h&&t.options.quickTrash?t.toTrash(d,o,h):g?r(d,o,g):t.confirm(d,o,p,h,f)),d):d.reject()},n.bind("select contextmenucreate closecontextmenu",function(e){var i=(e.data?e.data.selected||e.data.targets:null)||n.selected();i&&i.length&&t.update(void 0,(i?s(i):n.option("trashHash"))?"trash":"rm")})},i.prototype.commands.search=function(){"use strict";this.title="Find files",this.options={ui:"searchbutton"},this.alwaysEnabled=!0,this.updateOnSelect=!1,this.getstate=function(){return 0},this.exec=function(t,n,i,a){var o,r=this.fm,s=[],l=a||"",c=r.options.onlyMimes,d=[],p=function(e){return l&&"SearchName"!==l&&"SearchMime"!==l&&(e.type=l),e};return"string"==typeof t&&t?("object"==typeof n&&(i=n.mime||"",n=n.target||""),n=n?n:"",i?(i=e.trim(i).replace(","," ").split(" "),c.length&&(i=e.map(i,function(t){return t=e.trim(t),t&&(e.inArray(t,c)!==-1||e.grep(c,function(e){return 0===t.indexOf(e)}).length)?t:null}))):i=[].concat(c),r.trigger("searchstart",p({query:t,target:n,mimes:i})),!c.length||i.length?""===n&&r.api>=2.1?e.each(r.roots,function(e,n){s.push(r.request({data:p({cmd:"search",q:t,target:n,mimes:i}),notify:{type:"search",cnt:1,hideCnt:!s.length},cancel:!0,preventDone:!0}))}):(s.push(r.request({data:p({cmd:"search",q:t,target:n,mimes:i}),notify:{type:"search",cnt:1,hideCnt:!0},cancel:!0,preventDone:!0})),""!==n&&r.api>=2.1&&Object.keys(r.leafRoots).length&&e.each(r.leafRoots,function(a,l){for(o=a;o;)n===o&&e.each(l,function(){var e=r.file(this);e&&e.volumeid&&d.push(e.volumeid),s.push(r.request({data:p({cmd:"search",q:t,target:this,mimes:i}),notify:{type:"search",cnt:1,hideCnt:!1},cancel:!0,preventDone:!0}))}),o=(r.file(o)||{}).phash})):s=[e.Deferred().resolve({files:[]})],r.searchStatus.mixed=s.length>1&&d,e.when.apply(e,s).done(function(e){var t,n=arguments.length;if(e.warning&&r.error(e.warning),n>1)for(e.files=e.files||[],t=1;t<n;t++)arguments[t].warning&&r.error(arguments[t].warning),arguments[t].files&&e.files.push.apply(e.files,arguments[t].files);e.files&&e.files.length&&r.cache(e.files),r.lazy(function(){r.trigger("search",e)}).then(function(){return r.lazy(function(){r.trigger("searchdone")})}).then(function(){e.sync&&r.sync()})})):(r.getUI("toolbar").find("."+r.res("class","searchbtn")+" :text").trigger("focus"),e.Deferred().reject())}},i.prototype.commands.selectall=function(){"use strict";var t=0;this.fm.bind("select",function(e){t=e.data&&e.data.selectall?-1:0}),this.state=0,this.updateOnSelect=!1,this.getstate=function(){return t},this.exec=function(){return e(document).trigger(e.Event("keydown",{keyCode:65,ctrlKey:!0,shiftKey:!1,altKey:!1,metaKey:!1})),e.Deferred().resolve()}},i.prototype.commands.selectinvert=function(){"use strict";this.updateOnSelect=!1,this.getstate=function(){return 0},this.exec=function(){return e(document).trigger(e.Event("keydown",{keyCode:73,ctrlKey:!0,shiftKey:!0,altKey:!1,metaKey:!1})),e.Deferred().resolve()}},i.prototype.commands.selectnone=function(){"use strict";var t=this.fm,n=-1;t.bind("select",function(e){n=e.data&&e.data.unselectall?-1:0}),this.state=-1,this.updateOnSelect=!1,this.getstate=function(){return n},this.exec=function(){return t.getUI("cwd").trigger("unselectall"),e.Deferred().resolve()}},i.prototype.commands.sort=function(){"use strict";var t=this,n=t.fm,i=function(){t.variants=[],e.each(n.sortRules,function(e,i){if(n.sorters[e]){var a=e===n.sortType?"asc"===n.sortOrder?"n":"s":"";t.variants.push([e,(a?'<span class="ui-icon ui-icon-arrowthick-1-'+a+'"></span>':"")+"&nbsp;"+n.i18n("sort"+e)])}}),t.variants.push("|"),t.variants.push(["stick",(n.sortStickFolders?'<span class="ui-icon ui-icon-check"/>':"")+"&nbsp;"+n.i18n("sortFoldersFirst")]),n.ui.tree&&(t.variants.push("|"),t.variants.push(["tree",(n.sortAlsoTreeview?'<span class="ui-icon ui-icon-check"/>':"")+"&nbsp;"+n.i18n("sortAlsoTreeview")])),a()},a=function(){var t,i,a=n.getUI("contextmenu");a.is(":visible")&&(t=a.find("span.elfinder-button-icon-sort"),i=t.siblings("div.elfinder-contextmenu-sub"),i.find("span.ui-icon").remove(),i.children("div.elfinder-contextsubmenu-item").each(function(){var t,i=e(this).children("span"),a=i.text().trim();a===(o.stick||(o.stick=n.i18n("sortFoldersFirst")))?n.sortStickFolders&&i.prepend('<span class="ui-icon ui-icon-check"/>'):a===(o.tree||(o.tree=n.i18n("sortAlsoTreeview")))?n.sortAlsoTreeview&&i.prepend('<span class="ui-icon ui-icon-check"/>'):a===(o[n.sortType]||(o[n.sortType]=n.i18n("sort"+n.sortType)))&&(t="asc"===n.sortOrder?"n":"s",i.prepend('<span class="ui-icon ui-icon-arrowthick-1-'+t+'"></span>'))}))},o={};this.options={ui:"sortbutton"},this.keepContextmenu=!0,n.bind("sortchange",i).bind("sorterupdate",function(){i(),n.getUI("toolbar").find(".elfiner-button-sort .elfinder-button-menu .elfinder-button-menu-item").each(function(){var t=e(this),i=t.attr("rel");t.toggle(!i||n.sorters[i])})}).bind("cwdrender",function(){var t=e(n.cwd).find("div.elfinder-cwd-wrapper-list table");t.length&&e.each(n.sortRules,function(i,a){var o=t.find("thead tr td.elfinder-cwd-view-th-"+i);if(o.length){var r,s=i==n.sortType,l={type:i,order:s?"asc"==n.sortOrder?"desc":"asc":n.sortOrder};s&&(o.addClass("ui-state-active"),r="asc"==n.sortOrder?"n":"s",e('<span class="ui-icon ui-icon-triangle-1-'+r+'"/>').appendTo(o)),e(o).on("click",function(t){e(this).data("dragging")||(t.stopPropagation(),n.getUI("cwd").data("longtap")||n.exec("sort",[],l))}).on("mouseenter mouseleave",function(t){e(this).toggleClass("ui-state-hover","mouseenter"===t.type)})}})}),this.getstate=function(){return 0},this.exec=function(t,n){var i=this.fm,a=e.isPlainObject(n)?n:function(){n+="";var e={};return"stick"===n?e.stick=!i.sortStickFolders:"tree"===n?e.tree=!i.sortAlsoTreeview:i.sorters[n]&&(i.sortType===n?e.order="asc"===i.sortOrder?"desc":"asc":e.type=n),e}(),o=Object.assign({type:i.sortType,order:i.sortOrder,stick:i.sortStickFolders,tree:i.sortAlsoTreeview},a);return i.lazy(function(){i.setSort(o.type,o.order,o.stick,o.tree),this.resolve()})}},i.prototype.commands.undo=function(){"use strict";var t=this,n=this.fm,i=function(e){e?(t.title=n.i18n("cmdundo")+" "+n.i18n("cmd"+e.cmd),t.state=0):(t.title=n.i18n("cmdundo"),t.state=-1),t.change()},a=[];this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+z"}],this.syncTitleOnChange=!0,this.getstate=function(){return a.length?0:-1},this.setUndo=function(t,o){var r={};t&&e.isPlainObject(t)&&t.cmd&&t.callback&&(Object.assign(r,t),o?(delete o.undo,r.redo=o):n.getCommand("redo").setRedo(null),a.push(r),i(r))},this.exec=function(){var t,o,r=n.getCommand("redo"),s=e.Deferred(),l={};return a.length?(t=a.pop(),t.redo?(Object.assign(l,t.redo),delete t.redo):l=null,s.done(function(){l&&r.setRedo(l,t)}),i(a.length?a[a.length-1]:void 0),o=t.callback(),o&&o.done?o.done(function(){s.resolve()}).fail(function(){s.reject()}):s.resolve(),a.length?this.update(0,a[a.length-1].name):this.update(-1,"")):s.reject(),s},n.bind("exec",function(e){var n=e.data||{};n.opts&&n.opts._userAction&&n.dfrd&&n.dfrd.done&&n.dfrd.done(function(e){e&&e.undo&&e.redo&&(e.undo.redo=e.redo,t.setUndo(e.undo))})})},i.prototype.commands.redo=function(){"use strict";var t=this,n=this.fm,i=function(e){e&&e.callback?(t.title=n.i18n("cmdredo")+" "+n.i18n("cmd"+e.cmd),t.state=0):(t.title=n.i18n("cmdredo"),t.state=-1),t.change()},a=[];this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"shift+ctrl+z ctrl+y"}],this.syncTitleOnChange=!0,this.getstate=function(){return a.length?0:-1},this.setRedo=function(e,t){null===e?(a=[],i()):e&&e.cmd&&e.callback&&(t&&(e.undo=t),a.push(e),i(e))},this.exec=function(){var t,o,r=n.getCommand("undo"),s=e.Deferred(),l={},c={};return a.length?(t=a.pop(),t.undo&&(Object.assign(l,t.undo),Object.assign(c,t),delete c.undo,s.done(function(){r.setUndo(l,c)})),i(a.length?a[a.length-1]:void 0),o=t.callback(),o&&o.done?o.done(function(){s.resolve()}).fail(function(){s.reject()}):s.resolve(),s):s.reject()}},(i.prototype.commands.up=function(){"use strict";this.alwaysEnabled=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+up"}],this.getstate=function(){return this.fm.cwd().phash?0:-1},this.exec=function(){var t=this.fm,n=t.cwd().hash;return this.fm.cwd().phash?this.fm.exec("open",this.fm.cwd().phash).done(function(){t.one("opendone",function(){t.selectfiles({files:[n]})})}):e.Deferred().reject()}}).prototype={forceLoad:!0},i.prototype.commands.upload=function(){"use strict";var t=this.fm.res("class","hover");this.disableOnSearch=!0,this.updateOnSelect=!1,this.shortcuts=[{pattern:"ctrl+u"}],this.getstate=function(e){var t,n=this.fm,i=e||[n.cwd().hash];return this._disabled||1!=i.length||(t=n.file(i[0])),t&&"directory"==t.mime&&t.write?0:-1},this.exec=function(n){var i,a,o,r,s,l,c,d=this.fm,p=d.cwd().hash,u=function(){var e,t=n&&n instanceof Array?n:null;return(!n||n instanceof Array)&&(t||1!==(e=d.selected()).length||"directory"!==d.file(e[0]).mime?t&&1===t.length&&"directory"===d.file(t[0]).mime||(t=[p]):t=e),t},h=u(),f=h?h[0]:n&&n.target?n.target:null,m=f?d.file(f):d.cwd(),g=function(t){d.upload(t).fail(function(e){w.reject(e)}).done(function(t){var n;d.getUI("cwd");if(w.resolve(t),t&&t.added&&t.added[0]&&!d.ui.notify.children(".elfinder-notify-upload").length){var i=d.findCwdNodes(t.added);i.length?i.trigger("scrolltoview"):(m.hash!==p?n=e("<div/>").append(e('<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all elfinder-tabstop"><span class="ui-button-text">'+d.i18n("cmdopendir")+"</span></button>").on("mouseenter mouseleave",function(t){e(this).toggleClass("ui-state-hover","mouseenter"==t.type)}).on("click",function(){d.exec("open",f).done(function(){d.one("opendone",function(){d.trigger("selectfiles",{files:e.map(t.added,function(e){return e.hash})})})})})):d.trigger("selectfiles",{files:e.map(t.added,function(e){return e.hash})}),d.toast({msg:d.i18n(["complete",d.i18n("cmdupload")]),extNode:n}))}}).progress(function(){w.notifyWith(this,Array.from(arguments))})},v=function(e){i.elfinderdialog("close"),h&&(e.target=h[0]),g(e)},b=function(){var t=m.hash,n=e.map(d.files(t),function(e){return"directory"===e.mime&&e.write?e:null});return n.length?e('<div class="elfinder-upload-dirselect elfinder-tabstop" title="'+d.i18n("folders")+'"/>').on("click",function(t){t.stopPropagation(),t.preventDefault(),n=d.sortFiles(n);var a=e(this),o=(d.cwd(),i.closest("div.ui-dialog")),r=function(e,t){return{label:d.escape(e.i18||e.name),icon:t,remain:!1,callback:function(){var t=o.children(".ui-dialog-titlebar:first").find("span.elfinder-upload-target");h=[e.hash],t.html(" - "+d.escape(e.i18||e.name)),a.trigger("focus")},options:{className:h&&h.length&&e.hash===h[0]?"ui-state-active":"",iconClass:e.csscls||"",iconImg:e.icon||""}}},s=[r(m,"opendir"),"|"];e.each(n,function(e,t){s.push(r(t,"dir"))}),a.trigger("blur"),d.trigger("contextmenu",{raw:s,x:t.pageX||e(this).offset().left,y:t.pageY||e(this).offset().top,prevNode:o,fitHeight:!0})}).append('<span class="elfinder-button-icon elfinder-button-icon-dir" />'):e()},y=function(n,i){var a=e('<input type="file" '+n+"/>").on("click",function(){d.UA.IE&&setTimeout(function(){o.css("display","none").css("position","relative"),requestAnimationFrame(function(){o.css("display","").css("position","")})},100)}).on("change",function(){v({input:a.get(0),type:"files"})}).on("dragover",function(e){e.originalEvent.dataTransfer.dropEffect="copy"}),o=e("<form/>").append(a);return e('<div class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only elfinder-tabstop elfinder-focus"><span class="ui-button-text">'+d.i18n(i)+"</span></div>").append(o).on("click",function(e){e.target===this&&(e.stopPropagation(),e.preventDefault(),a.trigger("click"))}).on("mouseenter mouseleave",function(n){e(this).toggleClass(t,"mouseenter"===n.type)})},w=e.Deferred();return r=function(t){t.stopPropagation(),t.preventDefault();var n,i=!1,a="",o=null,r="",s=null,l=t._target||null,c=t.dataTransfer||null,p=c.items&&c.items.length&&c.items[0].kind?c.items[0].kind:"";if(c){try{if(o=c.getData("elfinderfrom"),o&&(r=window.location.href+d.cwd().hash,!l&&o===r||l===r))return void w.reject()}catch(t){}if("file"===p&&(c.items[0].getAsEntry||c.items[0].webkitGetAsEntry))i=c,a="data";else if("string"!==p&&c.files&&c.files.length&&e.inArray("Text",c.types)===-1)i=c.files,a="files";else{try{(s=c.getData("text/html"))&&s.match(/<(?:img|a)/i)&&(i=[s],a="html")}catch(t){}i||((s=c.getData("text"))?(i=[s],a="text"):c&&c.files&&(p="file"))}}i?g({files:i,type:a,target:l,dropEvt:t}):(n=["errUploadNoFiles"],"file"===p&&n.push("errFolderUpload"),d.error(n),w.reject())},!h&&n?(n.input||n.files?(n.type="files",g(n)):n.dropEvt&&r(n.dropEvt),w):(s=function(t){var n,i=t.originalEvent||t,a=[],o=[];if(i.clipboardData){if(i.clipboardData.items&&i.clipboardData.items.length){o=i.clipboardData.items;for(var r=0;r<o.length;r++)"file"==i.clipboardData.items[r].kind&&(n=i.clipboardData.items[r].getAsFile(),a.push(n))}else i.clipboardData.files&&i.clipboardData.files.length&&(a=i.clipboardData.files);if(a.length)return void v({files:a,type:"files",clipdata:!0})}var s=i.target||i.srcElement;requestAnimationFrame(function(){var t,n="text";s.innerHTML&&(e(s).find("img").each(function(t,n){n.src.match(/^webkit-fake-url:\/\//)&&e(n).remove()}),e(s).find("a,img").length&&(n="html"),t=s.innerHTML,s.innerHTML="",v({files:[t],type:n}))})},i=e('<div class="elfinder-upload-dialog-wrapper"/>').append(y("multiple","selectForUpload")),!d.UA.Mobile&&function(e){return"undefined"!=typeof e.webkitdirectory||"undefined"!=typeof e.directory}(document.createElement("input"))&&i.append(y("multiple webkitdirectory directory","selectFolder")),m.dirs&&(m.hash===p||e("#"+d.navHash2Id(m.hash)).hasClass("elfinder-subtree-loaded")?b().appendTo(i):(l=e('<div class="elfinder-upload-dirselect" title="'+d.i18n("nowLoading")+'"/>').append('<span class="elfinder-button-icon elfinder-button-icon-spinner" />').appendTo(i),d.request({cmd:"tree",target:m.hash}).done(function(){d.one("treedone",function(){l.replaceWith(b()),c.elfinderdialog("tabstopsInit")})}).fail(function(){l.remove()}))),d.dragUpload?a=e('<div class="ui-corner-all elfinder-upload-dropbox elfinder-tabstop" contenteditable="true" data-ph="'+d.i18n("dropPasteFiles")+'"></div>').on("paste",function(e){s(e)}).on("mousedown click",function(){e(this).trigger("focus")}).on("focus",function(){this.innerHTML=""}).on("mouseover",function(){e(this).addClass(t)}).on("mouseout",function(){e(this).removeClass(t)}).on("dragenter",function(n){n.stopPropagation(),n.preventDefault(),e(this).addClass(t)}).on("dragleave",function(n){n.stopPropagation(),n.preventDefault(),e(this).removeClass(t)}).on("dragover",function(n){n.stopPropagation(),n.preventDefault(),n.originalEvent.dataTransfer.dropEffect="copy",e(this).addClass(t)}).on("drop",function(e){i.elfinderdialog("close"),h&&(e.originalEvent._target=h[0]),r(e.originalEvent)}).prependTo(i).after('<div class="elfinder-upload-dialog-or">'+d.i18n("or")+"</div>")[0]:o=e('<div class="ui-corner-all elfinder-upload-dropbox" contenteditable="true">'+d.i18n("dropFilesBrowser")+"</div>").on("paste drop",function(e){s(e)}).on("mousedown click",function(){e(this).trigger("focus")}).on("focus",function(){this.innerHTML=""}).on("dragenter mouseover",function(){e(this).addClass(t)}).on("dragleave mouseout",function(){e(this).removeClass(t)}).prependTo(i).after('<div class="elfinder-upload-dialog-or">'+d.i18n("or")+"</div>")[0],c=d.dialog(i,{title:this.title+'<span class="elfinder-upload-target">'+(m?" - "+d.escape(m.i18||m.name):"")+"</span>",modal:!0,resizable:!1,destroyOnClose:!0,close:function(){var e=d.getUI("contextmenu");e.is(":visible")&&e.click()}}),w)}},i.prototype.commands.view=function(){"use strict";var t,n=this,i=this.fm;this.value=i.viewType,this.alwaysEnabled=!0,this.updateOnSelect=!1,this.options={ui:"viewbutton"},this.getstate=function(){return 0},this.extra={icon:"menu",node:e("<span/>").attr({title:i.i18n("viewtype")}).on("click touchstart",function(t){if(!("touchstart"===t.type&&t.originalEvent.touches.length>1)){var n=e(this);t.stopPropagation(),t.preventDefault(),i.trigger("contextmenu",{raw:getSubMenuRaw(),x:n.offset().left,y:n.offset().top})}})},this.exec=function(){var e=this,t=i.storage("view","list"==this.value?"icons":"list");return i.lazy(function(){i.viewchange(),e.update(void 0,t),this.resolve()})},i.bind("init",function(){t=function(){var e,t=i.getUI("cwd"),a=[],o=i.options.uiOptions.cwd.iconsView.sizeNames,r=i.options.uiOptions.cwd.iconsView.sizeMax;for(e=0;e<=r;e++)a.push({label:i.i18n(o[e]||"Size-"+e+" icons"),icon:"view",callback:function(e){return function(){t.trigger("iconpref",{size:e}),i.storage("iconsize",e),"list"===n.value&&n.exec()}}(e)});return a.push("|"),a.push({label:i.i18n("viewlist"),icon:"view-list",callback:function(){"list"!==n.value&&n.exec()}}),a}()}).bind("contextmenucreate",function(){n.extra={icon:"menu",node:e("<span/>").attr({title:i.i18n("cmdview")}).on("click touchstart",function(a){if(!("touchstart"===a.type&&a.originalEvent.touches.length>1)){var o,r,s=e(this);t.concat();for(o="list"===n.value?t.length-1:parseInt(i.storage("iconsize")||0),r=0;r<t.length;r++)"|"!==t[r]&&(t[r].options=r===o?{className:"ui-state-active"}:void 0);a.stopPropagation(),a.preventDefault(),i.trigger("contextmenu",{raw:t,x:s.offset().left,y:s.offset().top})}})}})},i});