UNPKG

@syncfusion/ej2-filemanager

Version:
10 lines 248 kB
/*! * filename: ej2-filemanager.umd.min.js * version : 29.1.33 * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-layouts"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-grids"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-navigations")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-layouts","@syncfusion/ej2-popups","@syncfusion/ej2-data","@syncfusion/ej2-grids","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-lists","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-navigations"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Layouts,e.ej2Popups,e.ej2Data,e.ej2Grids,e.ej2Inputs,e.ej2Buttons,e.ej2Lists,e.ej2Splitbuttons,e.ej2Navigations)}(this,function(e,b,A,r,h,F,U,V,_,H,B){"use strict";z=function(e,t){return(z=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var z,q,W=function(e,t){function i(){this.constructor=e}z(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},K=function(e,t,i,n){var s,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(s=e[o])&&(r=(a<3?s(r):3<a?s(t,i,r):s(t,i))||r);return 3<a&&r&&Object.defineProperty(t,i,r),r},W=(q=b.ChildProperty,W(Y,q),K([b.Property(null)],Y.prototype,"downloadUrl",void 0),K([b.Property(null)],Y.prototype,"getImageUrl",void 0),K([b.Property(null)],Y.prototype,"uploadUrl",void 0),K([b.Property(null)],Y.prototype,"url",void 0),Y);function Y(){return null!==q&&q.apply(this,arguments)||this}G=function(e,t){return(G=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var G,J,K=function(e,t){function i(){this.constructor=e}G(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},t=function(e,t,i,n){var s,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(s=e[o])&&(r=(a<3?s(r):3<a?s(t,i,r):s(t,i))||r);return 3<a&&r&&Object.defineProperty(t,i,r),r},Q=["NewFolder","Upload","Cut","Copy","Paste","Delete","Download","Rename","SortBy","Refresh","Selection","View","Details"],X=(J=b.ChildProperty,K($,J),t([b.Property(Q)],$.prototype,"items",void 0),t([b.Property(!0)],$.prototype,"visible",void 0),$);function $(){return null!==J&&J.apply(this,arguments)||this}Z=b.ChildProperty,K(i,Z),t([b.Property("")],i.prototype,"id",void 0),t([b.Property("")],i.prototype,"text",void 0),t([b.Property("auto")],i.prototype,"width",void 0),t([b.Property("")],i.prototype,"cssClass",void 0),t([b.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),t([b.Property(!1)],i.prototype,"disabled",void 0),t([b.Property("")],i.prototype,"prefixIcon",void 0),t([b.Property("")],i.prototype,"suffixIcon",void 0),t([b.Property(!0)],i.prototype,"visible",void 0),t([b.Property("None")],i.prototype,"overflow",void 0),t([b.Property("")],i.prototype,"template",void 0),t([b.Property("Button")],i.prototype,"type",void 0),t([b.Property("Both")],i.prototype,"showTextOn",void 0),t([b.Property(null)],i.prototype,"htmlAttributes",void 0),t([b.Property("")],i.prototype,"tooltipText",void 0),t([b.Property("Left")],i.prototype,"align",void 0),t([b.Property(-1)],i.prototype,"tabIndex",void 0),t([b.Property()],i.prototype,"name",void 0);var Z,K=i;function i(){return null!==Z&&Z.apply(this,arguments)||this}ee=function(e,t){return(ee=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ee,te,t=function(e,t){function i(){this.constructor=e}ee(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ie=function(e,t,i,n){var s,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(s=e[o])&&(r=(a<3?s(r):3<a?s(t,i,r):s(t,i))||r);return 3<a&&r&&Object.defineProperty(t,i,r),r},t=(te=b.ChildProperty,t(ne,te),ie([b.Property(!0)],ne.prototype,"allowSearchOnTyping",void 0),ie([b.Property("contains")],ne.prototype,"filterType",void 0),ie([b.Property(!0)],ne.prototype,"ignoreCase",void 0),ie([b.Property(null)],ne.prototype,"placeholder",void 0),ne);function ne(){return null!==te&&te.apply(this,arguments)||this}se=function(e,t){return(se=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var se,ae,ie=function(e,t){function i(){this.constructor=e}se(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},re=function(e,t,i,n){var s,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(s=e[o])&&(r=(a<3?s(r):3<a?s(t,i,r):s(t,i))||r);return 3<a&&r&&Object.defineProperty(t,i,r),r},oe=[{field:"name",headerText:"Name",minWidth:120,template:'<span class="e-fe-text">${name}</span>',customAttributes:{class:"e-fe-grid-name"}},{field:"_fm_modified",headerText:"DateModified",type:"dateTime",format:"MMMM dd, yyyy HH:mm",minWidth:120,width:"190"},{field:"size",headerText:"Size",minWidth:90,width:"110",template:b.initializeCSPTemplate(function(e){return'<span class="e-fe-size">'+e.size+"</span>"}),format:"n2"}],ie=(ae=b.ChildProperty,ie(le,ae),re([b.Property(!0)],le.prototype,"columnResizing",void 0),re([b.Property(oe)],le.prototype,"columns",void 0),le);function le(){return null!==ae&&ae.apply(this,arguments)||this}he=function(e,t){return(he=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var he,de,re=function(e,t){function i(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},pe=function(e,t,i,n){var s,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(s=e[o])&&(r=(a<3?s(r):3<a?s(t,i,r):s(t,i))||r);return 3<a&&r&&Object.defineProperty(t,i,r),r},ce=["Open","|","Cut","Copy","|","Delete","Download","Rename","|","Details"],ue=["Open","|","Cut","Copy","Paste","|","Delete","Rename","Download","|","Details"],ge=["SortBy","View","Refresh","|","Paste","|","NewFolder","Upload","|","Details","|","SelectAll"],re=(de=b.ChildProperty,re(fe,de),pe([b.Property(ce)],fe.prototype,"file",void 0),pe([b.Property(ue)],fe.prototype,"folder",void 0),pe([b.Property(ge)],fe.prototype,"layout",void 0),pe([b.Property(!0)],fe.prototype,"visible",void 0),fe);function fe(){return null!==de&&de.apply(this,arguments)||this}me=function(e,t){return(me=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var me,be,pe=function(e,t){function i(){this.constructor=e}me(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ye=function(e,t,i,n){var s,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(s=e[o])&&(r=(a<3?s(r):3<a?s(t,i,r):s(t,i))||r);return 3<a&&r&&Object.defineProperty(t,i,r),r},pe=(be=b.ChildProperty,pe(ve,be),ye([b.Property("650px")],ve.prototype,"maxWidth",void 0),ye([b.Property("240px")],ve.prototype,"minWidth",void 0),ye([b.Property(!0)],ve.prototype,"visible",void 0),ye([b.Property("None")],ve.prototype,"sortOrder",void 0),ve);function ve(){return null!==be&&be.apply(this,arguments)||this}Ie=function(e,t){return(Ie=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ie,Oe,ye=function(e,t){function i(){this.constructor=e}Ie(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},we=function(e,t,i,n){var s,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(s=e[o])&&(r=(a<3?s(r):3<a?s(t,i,r):s(t,i))||r);return 3<a&&r&&Object.defineProperty(t,i,r),r},ye=(Oe=b.ChildProperty,ye(De,Oe),we([b.Property("")],De.prototype,"allowedExtensions",void 0),we([b.Property(!0)],De.prototype,"autoUpload",void 0),we([b.Property(!1)],De.prototype,"autoClose",void 0),we([b.Property(!1)],De.prototype,"directoryUpload",void 0),we([b.Property(0)],De.prototype,"minFileSize",void 0),we([b.Property(3e7)],De.prototype,"maxFileSize",void 0),we([b.Property(0)],De.prototype,"chunkSize",void 0),De);function De(){return null!==Oe&&Oe.apply(this,arguments)||this}Se=function(e,t){return(Se=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Se,Ce,we=function(e,t){function i(){this.constructor=e}Se(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=function(e,t,i,n){var s,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;0<=o;o--)(s=e[o])&&(r=(a<3?s(r):3<a?s(t,i,r):s(t,i))||r);return 3<a&&r&&Object.defineProperty(t,i,r),r},we=(Ce=b.ChildProperty,we(s,Ce),n([b.Property("")],s.prototype,"field",void 0),n([b.Property("")],s.prototype,"headerText",void 0),n([b.Property("")],s.prototype,"width",void 0),n([b.Property("")],s.prototype,"minWidth",void 0),n([b.Property("")],s.prototype,"maxWidth",void 0),n([b.Property("Left")],s.prototype,"textAlign",void 0),n([b.Property(null)],s.prototype,"headerTextAlign",void 0),n([b.Property(null)],s.prototype,"type",void 0),n([b.Property(null)],s.prototype,"format",void 0),n([b.Property(null)],s.prototype,"template",void 0),n([b.Property(null)],s.prototype,"sortComparer",void 0),n([b.Property(null)],s.prototype,"headerTemplate",void 0),n([b.Property(!0)],s.prototype,"allowSorting",void 0),n([b.Property(!0)],s.prototype,"allowResizing",void 0),n([b.Property(null)],s.prototype,"customAttributes",void 0),n([b.Property("")],s.prototype,"hideAtMedia",void 0),n([b.Property(null)],s.prototype,"customFormat",void 0),n([b.Property(!1)],s.prototype,"isPrimaryKey",void 0),s);function s(){return null!==Ce&&Ce.apply(this,arguments)||this}var je="_toolbar",xe="_layout",Ne="_navigation",Pe="_tree",Ee="_grid",Re="_largeicons",Me="_dialog",ke="_img_dialog",Le="_extn_dialog",Te="_upload_dialog",Ae="_contextmenu",Fe="_content",Ue="_breadcrumbbar",Ve="_upload",_e="_search",He="e-filemanager",Be="e-control",ze="e-fe-cb-select",qe="e-fe-popup",We="e-fe-mobile",Ke="e-fe-popup e-fe-mobile",Ye="e-fe-m-select",Ge="e-fe-m-filter",Je="e-layout",Qe="e-navigation",Xe="e-layout-content",$e="e-large-icons",Ze="e-toolbar-item",d="e-list-item",et="e-list-text",tt="e-list-parent",o="e-icons e-fe-tick",it="e-icons e-fe-dot",nt="e-blur",p="e-active",st="e-hover",at="e-focus",rt="e-focused",ot="e-check",lt="e-frame",ht="e-checkbox-wrapper",dt="e-row",c="e-empty",pt="e-empty-content",ct="e-empty-inner-content",ut="e-fe-clone",gt="e-fe-drop-folder",ft="e-fe-drop-file",mt="e-fe-folder",bt="e-fe-image",yt="e-fe-music",vt="e-fe-video",It="e-large-icon",Ot="e-empty-icon e-fe-folder",wt="e-gridheader",Dt="e-treeview",St="e-menu-item",Ct="e-menu-icon",jt="e-caret",xt="e-content",Nt="e-gridcontent",Pt="e-list-parent",Et="e-icons e-fe-open",Rt="e-icons e-fe-upload",Mt="e-icons e-fe-cut",kt="e-icons e-fe-copy",Lt="e-icons e-fe-paste",Tt="e-icons e-fe-delete",At="e-icons e-fe-rename",Ft="e-icons e-fe-newfolder",Ut="e-icons e-fe-details",Vt="e-icons e-fe-sort",_t="e-icons e-fe-refresh",Ht="e-icons e-fe-select",Bt="e-icons e-fe-download",zt="e-icons e-fe-grid",qt="e-icons e-fe-large",Wt="e-icons e-fe-breadcrumb",Kt="e-icons e-fe-clear",Yt="e-icons",Gt="e-fe-errorcontent",Jt="e-address",Qt="e-rtl",Xt="e-display-none",$t="e-fullrow",Zt="e-split-bar",ei="e-headercheck",ti="e-fe-overlay",ii="e-fe-value",l="model-changed",ni="initial-end",u="finalize-end",si="create-end",ai="filter-end",ri="path-drag",oi="delete-init",li="delete-end",hi="refresh-end",di="resize-end",pi="splitter-resize",g="path-changed",ci="destroy",ui="before-request",gi="skip-upload",fi="after-request",mi="layout-refresh",bi="actionFailure",yi="search",vi="open-init",Ii="open-end",f="selection-changed",Oi="select-all-init",wi="clear-all-init",Di="clear-path-init",a="layout-change",Si="sort-by-change",Ci="node-expand",m="details-init",ji="menu-item-data",xi="rename-init",Ni="rename-end-parent",y="rename-end",Pi="show-paste",Ei="hide-paste",Ri="selected-data",Mi="cut-copy-init",ki="paste-init",Li="paste-end",Ti="cut-end",Ai="hide-layout",Fi="update-tree-selection",Ui="sort-column",Vi="path-column",_i="search-change",Hi="download-init",Bi="drop-init",zi="drag-end",qi="drop-path",Wi="dragging",Ki="update-selection-data",Yi="method-call",Gi="read",v="write",Ji="writeContents",Qi="upload",Xi="download";function $i(e,t,i){var t=b.getValue("name",t),n=e.getAttribute("data-id"),n=b.isNullOrUndefined(n)?t:n;i.setProperties({path:Zi(e,n,i.hasId)},!0),i.pathId=en(e),i.pathNames=tn(e,t)}function Zi(e,t,i){for(var n=nn(e,t,!1,i),s="/",a=n.length-2;0<=a;a--)s+=n[a]+"/";return s}function en(e){for(var t=nn(e,e.getAttribute("data-uid"),!0),i=[],n=t.length-1;0<=n;n--)i.push(t[n]);return i}function tn(e,t){for(var i=nn(e,t,!1),n=[],s=i.length-1;0<=s;s--)n.push(i[s]);return n}function nn(e,t,i,n){for(var s,a=[t],r=e.parentNode;!b.isNullOrUndefined(r)&&(b.matches(r,"."+d)&&(s=i?r.getAttribute("data-uid"):n?r.getAttribute("data-id"):b.select("."+et,r).textContent,a.push(s)),!(r=r.parentNode).classList.contains(Dt)););return a}function sn(e){for(var t=e.hasId?"id":"name",i="/",n=1;n<e.pathId.length;n++){var s=b.getValue(e.pathId[parseInt(n.toString(),10)],e.feParent);i+=b.getValue(t,s)+"/"}e.setProperties({path:i},!0)}function an(e){e.isCut&&(I(e),e.selectedNodes=[],e.actionRecords=[],e.enablePaste=!1,e.notify(Ei,{}))}function rn(e,t){if(t.isSearchCut=!1,t.actionRecords=[],t.activeElements=[],t.notify(Mi,{}),0===t.activeElements.length)return!1;I(t);var i=t.activeElements,n=("navigationpane"!==t.activeModule?t.targetPath=t.path:t.targetPath=Tn(t.path),0);if(i&&(ln(t,i[0]),"cut"===e))for(;n<i.length;)on(i[n]),n++;for(n=0,t.selectedNodes=[],t.enablePaste=!0,t.notify(Pi,{});n<t.activeRecords.length;)t.actionRecords.push(t.activeRecords[n]),t.selectedNodes.push(b.getValue("name",t.activeRecords[n])),n++;if((""!==t.breadcrumbbarModule.searchObj.element.value||t.isFiltered)&&"navigationpane"!==t.activeModule){t.selectedNodes=[],t.isSearchCut=!0;for(var s=0;s<t.selectedItems.length;)t.selectedNodes.push(t.selectedItems[s]),s++}return!0}function on(e){e.classList.add(nt)}function I(e,t){for(var i=t?e.element.querySelectorAll("."+st):e.element.querySelectorAll("."+nt),n=0;n<i.length;)i[n].classList.remove(t?st:nt),n++}function ln(e,t){t&&(t.classList.contains(dt)?e.activeModule="detailsview":b.closest(t,"."+It)?e.activeModule="largeiconsview":e.activeModule="navigationpane")}function hn(t,i){var e=t.fileSystemData.filter(function(e){return String(e.parentId)===String(i)}),n=e.slice();return e.forEach(function(e){e=e.id;n=n.concat(hn(t,e))}),n}function dn(e,t,i){var n,s;0!==t.length||e.isFiltered||e.notify(Vi,{args:e}),j(e)?""===t?(e.itemData=e.fileSystemData,C(e,i?a:yi,e.path)):(e.searchSettings.filterType=b.isNullOrUndefined(e.searchSettings.filterType)?"contains":e.searchSettings.filterType,s=b.getValue(e.pathId[e.pathId.length-1],e.feParent),s=hn(e,b.getValue("id",s)),s=new h.DataManager(s).executeLocal((new h.Query).where("name",e.searchSettings.filterType,t,e.searchSettings.ignoreCase)),n=e.searchSettings.ignoreCase?t.toLowerCase():t,e.itemData=s,Us(e,i?a:yi,e.path,n,e.showHiddenItems,!e.searchSettings.ignoreCase)):(s="startsWith"===e.searchSettings.filterType?t+"*":"endsWith"===e.searchSettings.filterType?"*"+t:"*"+t+"*",e.searchWord=s,e.itemData=[O(e)],0<t.length?(n=e.searchSettings.ignoreCase,t=e.showHiddenItems,Us(e,i?a:yi,e.path,s,t,!n)):e.isFiltered?cs(e,a):e.isSortByClicked?(e.notify(a,{files:"Details"===e.oldView?e.detailsviewModule.gridObj.dataSource:e.largeiconsviewModule.allItems}),e.isSortByClicked=!1):C(e,i?a:yi,e.path))}function pn(e,t){e.oldView=e.view,e.setProperties({view:t},!0),""===e.breadcrumbbarModule.searchObj.element.value&&!e.isFiltered||(e.layoutSelectedItems=e.selectedItems);t="";e.breadcrumbbarModule.searchObj.element.value&&(t=e.breadcrumbbarModule.searchObj.element.value),e.isLayoutChange=!0,dn(e,t,!0)}function cn(e,t){var i="";t&&(i=b.closest(t,"."+He+"."+Be+" ."+Nt)?"detailsview":b.closest(t,"."+$e)?"largeiconsview":t.classList.contains("e-fullrow")||t.classList.contains("e-icon-expandable")?"navigationpane":b.closest(t,".e-address-list-item")?"breadcrumbbar":""),e.targetModule=i}function un(e){e.itemData=[O(e)],is(e.itemData[0])?C(e,hi,e.path):D(e,e.itemData[0],Gi)}function gn(e){C(e,Ii,e.path)}function O(e){return b.getValue(e.pathId[e.pathId.length-1],e.feParent)}function fn(e){rn("copy",e)&&(e.fileAction="copy")}function mn(e){rn("cut",e)&&(e.isCut=!0,e.fileAction="move")}function bn(e){return b.getValue("isFile",e)?(-1!==(e=(e=b.getValue("type",e)).toLowerCase()).indexOf(".")&&(e=e.split(".").join("")),-1!==["bmp","dib","jpg","jpeg","jpe","jfif","gif","tif","tiff","png","ico"].indexOf(e)?bt:-1!==["mp3","wav","aac","ogg","wma","aif","fla","m4a"].indexOf(e)?yt:-1!==["webm","mkv","flv","vob","ogv","ogg","avi","wmv","mp4","3gp"].indexOf(e)?vt:-1!==["css","exe","html","js","msi","pdf","pptx","ppt","rar","zip","txt","docx","doc","xlsx","xls","xml","rtf","php"].indexOf(e)?"e-fe-"+e:"e-fe-unknown e-fe-"+e):mt}function yn(e,t){var i,n,s,a,r=j(e)?b.getValue("imageUrl",t):"";return(j(e)?(e.trigger("beforeImageLoad",i={fileDetails:[t],imageUrl:r}),i):(n=-1!==(i=e.ajaxSettings.getImageUrl||e.ajaxSettings.url).indexOf("?")?"&path=":"?path=",s=encodeURIComponent(b.getValue("name",t)),a=b.getValue("filterPath",t),t={fileDetails:[t],imageUrl:r=(r=e.hasId?(t=b.getValue("id",t),i+n+e.path+"&id="+t):b.isNullOrUndefined(a)?i+n+e.path+s:i+n+encodeURIComponent(a.replace(/\\/g,"/"))+s)+"&time="+(new Date).getTime().toString()},e.trigger("beforeImageLoad",t),t)).imageUrl}function vn(e,t,i){var n=b.getValue(e.hasId?"id":"name",t)+"/",e=b.getValue(e.hasId?"filterId":"filterPath",t);return b.isNullOrUndefined(e)?i+n:e.replace(/\\/g,"/").replace(/^.*?(?=\/)/,"")+n}function In(e,t){var i=b.getValue("name",t),t=b.getValue("filterPath",t);return i=""===e.breadcrumbbarModule.searchObj.element.value&&!e.isFiltered||b.isNullOrUndefined(t)?i:(t=t.replace(/\\/g,"/")).replace(e.path,"")+i}function On(e,t){return 0===t.length?t:(e=("None"===e.sortOrder||b.isNullOrUndefined(e.sortOrder)?new h.Query:(new h.Query).sortBy(e.sortBy,e.sortOrder.toLowerCase(),!0)).group("isFile"),t=new h.DataManager(t).executeLocal(e),b.getValue("records",t))}function wn(e,t,i){e=b.getValue(e.pathId[e.pathId.length-1],e.feFiles).filter(function(e){return e[t].toString()===i});return 0<e.length?e[0]:null}function Dn(e,t,i){var n,s,a=b.select("#"+e.element.id+xe,e.element),r=b.select("#"+e.element.id+Ue,a).offsetHeight,r=a.offsetHeight-r,o=("Details"===e.view&&(r-=b.select("."+wt,a).offsetHeight),b.isNullOrUndefined(t.querySelector("."+c))&&(a=b.createElement("div",{className:c}),o=b.createElement("div",{className:Ot}),n=b.createElement("div",{className:pt}),s=b.createElement("div",{className:ct}),("Details"===e.view?t.querySelector("."+xt):t).appendChild(a),a.appendChild(o),a.appendChild(n),a.appendChild(s)),t.querySelector("."+c)&&(b.isNullOrUndefined(i.error)?e.isFiltered?(t.querySelector("."+pt).innerHTML=w(e,"Filter-Empty"),t.querySelector("."+ct).innerHTML=w(e,"Filter-Key")):""!==e.breadcrumbbarModule.searchObj.element.value?(t.querySelector("."+pt).innerHTML=w(e,"Search-Empty"),t.querySelector("."+ct).innerHTML=w(e,"Search-Key")):(t.querySelector("."+pt).innerHTML=w(e,"Folder-Empty"),t.querySelector("."+ct).innerHTML=w(e,"File-Upload")):(t.querySelector("."+pt).innerHTML=w(e,"Access-Denied"),t.querySelector("."+ct).innerHTML=w(e,"Access-Details"))),b.select("."+c,t));r=(r-o.offsetHeight)/2,o.style.marginTop=r+"px"}function Sn(e){return new h.DataManager(e).executeLocal((new h.Query).where("isFile","equal",!1,!1))}function Cn(e,t){for(var i=Sn(e.files),n=0,s=i.length;n<s;n++)b.setValue("_fm_id",t+"_"+n,i[n])}function jn(e){for(var t=0;t<e.length;t++){var i=new Date(b.getValue("dateCreated",e[t])),n=new Date(b.getValue("dateModified",e[t]));b.setValue("_fm_created",i,e[t]),b.setValue("_fm_modified",n,e[t])}}function w(e,t){e=e.localeObj.getConstant(t);return""===e?t:e}function xn(e,t){e=e.cssClass;return b.isNullOrUndefined(e)||""===e?t:e+" "+t}function Nn(e,t){e.isSortByClicked=!0,-1!==t.item.id.indexOf("ascending")||-1!==t.item.id.indexOf("descending")||-1!==t.item.id.indexOf("none")?e.sortOrder=Pn(t.item.id):e.sortBy=Pn(t.item.id,e),e.itemData=[O(e)],"Details"===e.view&&(e.isMobile?pn(e,"Details"):(e.notify(Ui,{module:"detailsview"}),e.isSortByClicked=!1)),"LargeIcons"===e.view&&pn(e,"LargeIcons"),e.notify(Si,{})}function Pn(e,t){var i,e=e.substring(e.lastIndexOf("_")+1),n=e;switch(t&&(i=t.detailsViewSettings.columns),e){case"date":for(var s=0,a=i.length;s<a;s++){if("dateModified"===i[s].field||"dateCreated"===i[s].field){n=i[s].field;break}n="_fm_modified"}break;case"ascending":n="Ascending";break;case"descending":n="Descending";break;case"none":n="None"}return n}function En(e,t){for(var t=t.split("/"),i=e.originalPath.split("/"),n=b.getValue(e.pathId[0],e.feParent),s=b.isNullOrUndefined(b.getValue("id",n))?"name":"id",a=t.length-1,r=i.length-1;a<r;a++){var o,l=""===i[a+1]?u:ni,h=""===i[a]?"/":e.path+i[a]+"/",d=wn(e,s,i[parseInt(a.toString(),10)]);b.isNullOrUndefined(d)?e.originalPath=h:(o=b.getValue("_fm_id",d),e.setProperties({path:h},!0),e.pathId.push(o),e.itemData=[d],e.pathNames.push(b.getValue("name",d))),C(e,l,e.path);break}}function Rn(e,t){e.originalPath=vn(e,t,e.path);var i=b.getValue(e.pathId[0],e.feParent),n=e.feParent[b.getValue("_fm_id",e.itemData[0])],n=b.isNullOrUndefined(n)||"fe_tree"===b.getValue("_fm_id",n),i=wn(e,b.isNullOrUndefined(b.getValue("id",i))?"name":"id",j(e)?b.getValue("id",t):b.getValue("name",t));if(b.isNullOrUndefined(i)){if(n)return void En(e,e.path);e.notify(Di,{selectedNode:e.pathId[e.pathId.length-1]})}else{t=b.getValue("_fm_id",i);e.setProperties({path:e.originalPath},!0),e.pathId.push(t),e.itemData=[i],e.pathNames.push(b.getValue("name",i))}C(e,e.path!==e.originalPath?ni:u,e.path)}function Mn(e){var t;e.isDragDrop=!1,0!==e.selectedNodes.length&&e.enablePaste&&(t=""===e.folderPath?e.path:e.folderPath,"navigationpane"!==e.activeModule||e.selectedNodes[0].includes("/")||(e.targetPath=hs(e,e.actionRecords[0])),kn(e,e.actionRecords,t,e.path)||("move"===e.fileAction&&e.targetPath!==t||"copy"===e.fileAction?(e.notify(ki,{}),gs(e,e.targetPath,e.selectedNodes,t,e.fileAction,[],e.actionRecords)):(e.enablePaste=!1,e.notify(Ei,{}),I(e),x(e,"Error",{files:null,error:{code:"402",message:w(e,"Same-Folder-Error"),fileExists:null}}))))}function kn(e,t,i,n){for(var s=!1,a=0;a<t.length;a++)if(b.getValue("isFile",t[a])){var r=e.dragData[a]?e.dragData[a].name:null,r=j(e)?r:e.dragNodes[a],o=0,l="";if((l=0<(o=r?r.lastIndexOf("/"):o)?n+r.substring(0,o+1):l)===i){x(e,"Error",{files:null,error:{code:"402",message:w(e,"Same-Folder-Error"),fileExists:null}}),s=!0;break}}else{r=vn(e,t[a],n);if(0===i.indexOf(r)){x(e,"Error",{files:null,error:{code:"402",message:w(e,"Sub-Folder-Error"),fileExists:null}}),s=!0;break}}return s}function Ln(e){e.isDragDrop=!0,0!==e.dragData.length&&(e.dragPath=e.dragPath.replace(/\\/g,"/"),e.dropPath=e.dropPath.replace(/\\/g,"/"),kn(e,e.dragData,e.dropPath,e.dragPath)||e.dragPath===e.dropPath||(e.itemData=[e.dropData],gs(e,e.dragPath,e.dragNodes,e.dropPath,"move",[],e.dragData),e.notify(ki,{})))}function Tn(e){for(var t=e.split("/"),i=t[0]+"/",n=1;n<t.length-2;n++)i+=t[n]+"/";return i}function An(e,t){var i=b.getValue(e.hasId?"id":"name",t.cwd)+"/",t=b.getValue(e.hasId&&!b.isNullOrUndefined(e.ajaxSettings.url)?"filterId":"filterPath",t.cwd);return b.isNullOrUndefined(t)?j(e)?i:e.path+i:""===t?"/":t.replace(/\\/g,"/").replace(/^.*?(?=\/)/,"")+i}function Fn(e,t,i){"move"===t&&(e.isDragDrop?e.notify(zi,i):(e.enablePaste=!1,e.notify(Ei,{}),e.notify(Ti,i))),0===e.duplicateItems.length&&(e.pasteNodes=[]);for(var n=0;n<i.files.length;n++)e.pasteNodes.push(i.files[n][e.hasId?"id":"name"]),e.isDragDrop&&e.droppedObjects.push(i.files[n]);e.duplicateItems=[],e.duplicateRecords=[],e.isDragDrop&&!e.isPasteError?e.isDropEnd=!0:e.isDropEnd=!1,e.trigger("success",{action:t,result:i}),!e.isDragDrop||e.path===e.dragPath||e.path===e.dropPath||e.isSearchDrag?(e.isPathDrag=!1,C(e,Li,e.path)):Un(e)}function Un(e){var t,i=b.getValue("_fm_id",e.dropData);e.expandedId=i,e.itemData=[e.dropData],e.isPathDrag?e.notify(ri,e.itemData):(e.navigationpaneModule&&((t=b.select('[data-uid="'+i+'"]',e.navigationpaneModule.treeObj.element))||(i=document.querySelector('[data-id = "'+b.getValue("id",e.dropData)+'"]').getAttribute("data-uid"),t=b.select('[data-uid="'+i+'"]',e.navigationpaneModule.treeObj.element)),$i(t,e.dropData,e)),C(e,qi,e.dropPath))}function Vn(e,t){for(var i=null,n=e.isDragDrop?e.dragData:e.actionRecords,s=0;s<n.length;s++)if(b.getValue("name",n[s])===t){i=n[s];break}return i}function _n(e){if(e.isSearchDrag=!1,""!==e.breadcrumbbarModule.searchObj.element.value&&(e.isSearchDrag=!0),"navigationpane"!==e.activeModule){e.dragNodes=[];for(var t=0;t<e.selectedItems.length;)e.dragNodes.push(e.selectedItems[t]),t++;0===e.selectedItems.length&&e.dragData&&1===e.dragData.length&&e.dragNodes.push(Jn(e,e.dragData[0]))}var i=e.createElement("div",{className:"e-fe-icon "+bn(e.dragData[0])}),n=e.createElement("div",{className:"e-fe-name",innerHTML:e.dragData[0].name}),s=e.createElement("div",{className:"e-fe-content"}),i=(s.appendChild(i),s.appendChild(n),e.createElement("div",{className:ut}));i.appendChild(s),1<e.dragNodes.length&&(n=e.createElement("span",{className:"e-fe-count",innerHTML:e.dragNodes.length.toString(10)}),i.appendChild(n)),e.virtualDragElement=i,e.element.appendChild(e.virtualDragElement)}function Hn(t,e){var i=e,n=(i.cancel=!1,null!=t.treeExpandTimer&&(window.clearTimeout(t.treeExpandTimer),t.treeExpandTimer=null),qn(t),t.element.classList.remove("e-fe-drop","e-no-drop"),I(t),t.uploadObj.dropArea=b.select("#"+t.element.id+Fe,t.element),b.select("."+ut,t.element));n&&b.detach(n),cn(t,e.target),t.notify(Bi,e),I(t,"hover"),i.fileDetails=t.dragData,t.trigger("fileDragStop",i,function(e){!e.cancel&&!b.isNullOrUndefined(t.targetModule)&&""!==t.targetModule&&2<t.dragCount&&Ln(t),t.dragCount=0})}function Bn(t,i,n){var e=i;if(e.cancel=!1,e.fileDetails=t.dragData,t.dragCount=0,t.droppedObjects=[],t.allowDragAndDrop&&("navigationpane"!==t.activeModule||b.closest(i.element,"li").getAttribute("data-uid")!==t.pathId[0])||(e.cancel=!0),"navigationpane"===t.activeModule&&-1!==t.pathId.indexOf(b.closest(i.element,"li").getAttribute("data-uid"))?t.isPathDrag=!0:t.isPathDrag=!1,I(t),e.cancel)n.intDestroy(i.event),zn(t);else if(!e.cancel){for(var s=0;s<t.activeElements.length;)on(t.activeElements[s]),s++;t.trigger("fileDragStart",e,function(e){e.cancel?(n.intDestroy(i.event),zn(t)):t.uploadObj.dropArea=null})}}function zn(e){I(e);e=b.select("."+ut,e.element);e&&b.detach(e)}function qn(e){Wn(e,gt),Wn(e,ft)}function Wn(e,t){for(var i=e.element.querySelectorAll("."+t),n=0;n<i.length;n++)i[n].classList.remove(t)}function Kn(e,t,i,n){var s,a=e.getBoundingClientRect(),i=b.select("."+i,e);n>=a.top+e.clientHeight-30&&!b.isNullOrUndefined(i)&&(s="navigationpane"===t.targetModule||"detailsview"===t.targetModule?i.offsetHeight/2.5:i.offsetHeight/4.5,e.scrollBy(0,s)),!b.isNullOrUndefined(i)&&n<=a.top+30&&(s="navigationpane"===t.targetModule||"detailsview"===t.targetModule?i.offsetHeight/2.5:i.offsetHeight/4.5,e.scrollBy(0,-s))}function Yn(e,t){var i=t,n=(i.fileDetails=e.dragData,!1),s=(cn(e,t.target),qn(e),null!=e.treeExpandTimer&&(window.clearTimeout(e.treeExpandTimer),e.treeExpandTimer=null),I(e,"hover"),null);"navigationpane"===e.targetModule?((s=b.closest(t.target,"li")).classList.add(st,gt),n=!0,e.treeExpandTimer=window.setTimeout(function(){e.notify(Wi,t)},800),Kn(e.navigationpaneModule.treeObj.element.parentElement,e,"e-level-2",t.event.y)):"detailsview"===e.targetModule?((s=b.closest(t.target,"tr"))&&s.querySelector("."+mt)&&!s.classList.contains(nt)?s.classList.add(gt):!s||s.querySelector("."+mt)||s.classList.contains(nt)||s.classList.add(ft),n=!0,Kn(e.detailsviewModule.gridObj.element.querySelector(".e-content"),e,"e-row",t.event.y)):"largeiconsview"===e.targetModule?((s=b.closest(t.target,"li"))&&s.querySelector("."+mt)&&!s.classList.contains(nt)&&s.classList.add(st,gt),n=!0,Kn(e.largeiconsviewModule.element.firstElementChild,e,"e-large-icon",t.event.y)):"breadcrumbbar"===e.targetModule&&(n=!0),e.element.classList.remove("e-fe-drop","e-no-drop"),e.element.classList.add(n?"e-fe-drop":"e-no-drop"),e.dragCount=e.dragCount+1,e.trigger("fileDragging",i)}function Gn(e){for(var t="",i=Object.keys(e),n=0;n<i.length;n++)"message"!==i[n]&&(t+=(0===n?"":", ")+i[n]+": "+b.getValue(i[n],e));return t}function Jn(e,t){return e.hasId?b.getValue("id",t):In(e,t)}function Qn(e,t){e.itemData=[t],e.currentItemText=b.getValue("name",t),e.isFile=b.getValue("isFile",t),e.filterPath=b.getValue("filterPath",t)}function Xn(e){S(e.itemData[0])?x(e,"Rename"):D(e,e.itemData[0],v)}function $n(e){for(var t=e.itemData,i=0;i<t.length;i++)if(!as(t[i]))return void D(e,t[i],Xi);0<e.selectedItems.length&&_s(e,e.path,e.selectedItems)}function Zn(e,t,i){for(var n=0;n<t.length;n++)if(!S(t[n]))return void D(e,t[n],v);e.itemData=t,fs(e,i,e.path,"delete")}function es(e,t,i){for(var n=0;n<t.length;n++)if(!as(t[n]))return void D(e,t[n],Xi);e.itemData=t,0<i.length&&_s(e,e.path,i)}function D(e,t,i){var n=b.getValue("message",b.getValue("permission",t));x(e,"Error",{error:{code:"401",fileExists:null,message:n=""===n?w(e,"Access-Message").replace("{0}",b.getValue("name",t)).replace("{1}",i):n}})}function ts(e){return is(e)?"e-fe-locked":"e-fe-locked e-fe-hidden"}function is(e){e=b.getValue("permission",e);return!(e&&!b.getValue("read",e))}function S(e){e=b.getValue("permission",e);return!e||b.getValue("read",e)&&b.getValue("write",e)}function ns(e){e=b.getValue("permission",e);return!e||b.getValue("read",e)&&b.getValue("writeContents",e)}function ss(e){e=b.getValue("permission",e);return!e||b.getValue("read",e)&&b.getValue("upload",e)}function as(e){e=b.getValue("permission",e);return!e||b.getValue("read",e)&&b.getValue("download",e)}function rs(e){var t=e.itemData[0];ns(t)?x(e,"NewFolder"):D(e,t,Ji)}function os(e){var t,i=e.itemData[0];ss(i)?(t="#"+e.element.id+Ve,document.querySelector(t).click()):D(e,i,Qi)}function ls(e){b.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide()}function hs(e,t){return e.hasId&&!b.isNullOrUndefined(b.getValue("filterId",t))?b.getValue("filterId",t).replace(/\\/g,"/").replace(/^[^/]+\//,"/"):b.getValue("filterPath",t).replace(/\\/g,"/")}function ds(e,t,i,n){for(var s="",a=0;a<t.length;a++){var r,o=b.getValue("permission",t[a]);if(null==o&&(o=void 0),n?!o||b.getValue("read",o)&&b.getValue("writeContents",o)||""===(s=b.getValue("message",b.getValue("permission",t[a])))&&(s=w(e,"Access-Message").replace("{0}",b.getValue("name",t[a])).replace("{1}","writeContents")):(r="copy"===i?b.getValue("copy",o):b.getValue("write",o),!o||b.getValue("read",o)&&r||""===(s=b.getValue("message",b.getValue("permission",t[a])))&&(s=w(e,"Access-Message").replace("{0}",b.getValue("name",t[a])).replace("{1}",i))),""!==s){e.responseData={cwd:null,details:null,error:{code:"401",message:s,fileExists:null},files:null};break}}return s}function C(e,t,i){for(var n=e.itemData,s=0;s<n.length;s++)b.isNullOrUndefined(b.getValue("hasChild",n[s]))&&b.setValue("hasChild",!1,n[s]);Cs(e,{action:"read",path:i,showHiddenItems:e.showHiddenItems,data:n},Es,t)}function ps(e,t){Cs(e,{action:"create",path:e.path,name:t,data:e.itemData},Ms,t)}function cs(e,t){var i={action:"filter",path:e.path,showHiddenItems:e.showHiddenItems,data:[O(e)]},i=e.filterData?b.extend(void 0,i,e.filterData):i;Cs(e,i,Rs,t,b.getValue("action",i))}function us(e,t,i){var n,s;s=""===e.breadcrumbbarModule.searchObj.element.value&&!e.isFiltered||(s=e.filterPath,e.hasId)?(n=e.currentItemText,i):(n=(s=s.replace(/\\/g,"/")).replace(t,"")+e.currentItemText,s.replace(t,"")+i),Cs(e,{action:"rename",path:t,name:n,newName:s,data:e.itemData,showFileExtension:e.showFileExtension},ks,t)}function gs(e,t,i,n,s,a,r){i={action:s,path:t,targetData:e.itemData[0],targetPath:n,names:i,renameFiles:a,data:r};e.destinationPath=n,Cs(e,i,Ls,t,s,n)}function fs(e,t,i,n){Cs(e,{action:n,path:i,names:t,data:e.itemData},Ts,i)}function ms(e,t,i,n){Cs(e,{action:n,path:i,names:t,data:e.itemData},As,i,n)}function j(e){return 0<=e.fileSystemData.length&&b.isNullOrUndefined(e.ajaxSettings.url)}function bs(e,t){return e.some(function(e){return e.name===t})}function ys(e,t){return e.fileSystemData.findIndex(function(e){return!b.isNullOrUndefined(e)&&String(e.id)===String(t)})}function vs(e,t){return e.fileSystemData.filter(function(e){return String(e.id)===String(t)})[0]}function Is(e,t){return e.fileSystemData.filter(function(e){return String(e.parentId)===String(t)})}function Os(e,t,i,n){var s,a={};for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&(a[s]=null);var r=new Date,o=String(t.id)===String(0)||b.isNullOrUndefined(t.parentId)?"\\":t.filterPath+t.name+"\\";return Object.assign(a,{dateCreated:r,dateModified:r,filterPath:o,hasChild:!!n&&e.hasChild,id:F.getUid(null===i?e.name:i),isFile:!!n&&e.isFile,name:null===i?e.name:i,parentId:t.id,size:n?e.size:0,type:n?e.type:""}),a}function ws(e,t,i,n){e.responseData={cwd:null,details:null,error:{code:i,message:t,fileExists:null!=n?n:null},files:null}}function Ds(n,e,s){e={cancel:!1,newName:b.getValue("newName",e),itemData:b.getValue("data",e),path:b.getValue("path",e)};n.trigger("beforeRename",e,function(e){var t,i;e.cancel?s.cancel=!0:j(n)&&(bs(n.fileSystemData,e.newName)?(t="Cannot rename"+e.itemData[0].name+"to"+e.newName+": destination already exists.",ws(n,t,"400",null)):(i=(t=vs(n,e.itemData[0].id)).name,t.name=e.newName,function i(n,s,a,r){n.fileSystemData.forEach(function(e){var t;String(e.parentId)===String(s)&&(t=e.filterPath,t=t.replace(a+"\\",r+"\\"),e.filterPath=t,i(n,e.id,a,r))})}(n,t.id,i,e.newName)))})}function Ss(e,t,i){switch(b.getValue("action",t)){case"create":h=e,d=t,p=i,d={folderName:b.getValue("name",d),cancel:!1,path:b.getValue("path",d),parentFolder:b.getValue("data",d)},h.trigger("beforeFolderCreate",d,function(e){var t;e.cancel?p.cancel=!0:j(h)&&(bs(h.fileSystemData,e.folderName)?(t="A file or folder with the name "+e.folderName+" already exists.",ws(h,t,"400",null)):(t=Os(t=e.parentFolder[0],t,e.folderName,!1),h.fileSystemData.push(t)))});break;case"delete":o=e,d=t,l=i,d={cancel:!1,itemData:b.getValue("data",d),path:b.getValue("path",d)},o.trigger("beforeDelete",d,function(e){e.cancel?l.cancel=!0:j(o)&&e.itemData.forEach(function(t){var e=ys(o,t.id);-1!==e&&o.fileSystemData.splice(e,1),t.isFile||o.fileSystemData.filter(function(e){return e.filterPath.includes(t.name)}).forEach(function(e){e=ys(o,e.id);-1!==e&&o.fileSystemData.splice(e,1)})})});break;case"rename":Ds(e,t,i);break;case"move":case"copy":u=e,g=t,f=i,r={cancel:!1,itemData:b.getValue("data",g),isCopy:"copy"===b.getValue("action",g),path:b.getValue("path",g),targetData:b.getValue("targetData",g),targetPath:b.getValue("targetPath",g)},u.trigger("beforeMove",r,function(i){if(i.cancel)f.cancel=!0;else if(j(u)){var n,e="File Already Exists",t=b.getValue("action",g),s=ds(u,i.itemData,t,!1),t=ds(u,[i.targetData],t,!0),a=[];if(u.pasteNodes=[],""===s&&""===t){if(i.isCopy)n=Is(u,i.targetData.id),i.itemData.forEach(function(e){var t;!bs(n,e.name)||0<b.getValue("renameFiles",g).length?0<b.getValue("renameFiles",g).length?(t=e.name.split("."),t=e.name.includes(".")?t[0]+"("+u.existingFileCount+")."+t[1]:t[0]+"("+u.existingFileCount+")",Ns(u,e,i.targetData,t),u.responseData.error=null,u.existingFileCount++):Ns(u,e,i.targetData,null):a.push(e.name)});else for(var r=i.targetData,o=Is(u,r.id),l=0;l<i.itemData.length;l++){var h,d,p,c=i.itemData[l];!bs(o,c.name)||0<b.getValue("renameFiles",g).length?(r.hasChild||(r.hasChild=!c.isFile,0<(h=u.fileSystemData.filter(function(e){return String(e.id)===String(r.id)})).length&&(h[0].hasChild=r.hasChild)),c.isFile||(h=0!==c.parentId?Is(u,c.parentId):[],vs(u,c.parentId).hasChild=1<h.length),d=vs(u,c.id),0<b.getValue("renameFiles",g).length&&(p=c.name.split("."),c.name=c.name.includes(".")?p[0]+"("+u.existingFileCount+")."+p[1]:p[0]+"("+u.existingFileCount+")",d.name=c.name,u.responseData.error=null,u.existingFileCount++,u.dropData=r,u.dropPath=i.path,p=i.targetPath.replace(/^\/|\/$/g,"").split("/"),r=vs(u,p[p.length-1])),d.parentId=r.id,d.filterPath=0===r.id?"\\":r.filterPath+r.name+"\\"):a.push(c.name)}0<a.length&&ws(u,e,"400",a)}}});break;case"search":r=e,n=t,s=i,a={searchResults:b.getValue("data",n),cancel:!1,path:b.getValue("path",n),searchText:b.getValue("searchString",n),caseSensitive:b.getValue("caseSensitive",n),showHiddenItems:b.getValue("showHiddenItems",n)},r.trigger("search",a,function(e){b.setValue("data",e.searchResults,n),e.cancel&&(s.cancel=!0)})}var n,s,a,u,g,f,r,o,l,h,d,p}function Cs(r,o,l,h,d,p){var e={url:r.ajaxSettings.url,type:"POST",mode:!0,dataType:"json",contentType:"application/json",data:JSON.stringify(o),onSuccess:null,onFailure:null,beforeSend:null},e={action:b.getValue("action",o),ajaxSettings:e,cancel:!1};Ss(r,o,e),r.trigger("beforeSend",e,function(i){var e,t,n,s,a;i.cancel||(r.notify(ui,{}),j(r)?(t=("node-expand"===h||"finalize-end"===h||"rename-end-parent"===h?b.getValue("path",o):r.path).replace(/^\/|\/$/g,"").split("/"),t="rename-end-parent"===h||"path-changed"===h&&0!==b.getValue("data",o).length&&b.isNullOrUndefined(r.renamedItem)?b.getValue("data",o)[0].id:t[t.length-1],n=("move"===(s=b.getValue("action",o))||"rename"===s||"copy"===s||"delete"===s||"search"===s)&&"rename-end"!==h,"read"===s||"create"===s||"rename-end"===h?(e=0<r.fileSystemData.filter(function(e){return b.isNullOrUndefined(e.parentId)}).length?r.fileSystemData.filter(function(e){return b.isNullOrUndefined(e.parentId)})[0].id:0,r.responseData={cwd:vs(r,"/"===r.path&&"node-expand"!==h&&"rename-end-parent"!==h?e:t),details:null,error:null,files:Is(r,"/"===r.path&&"node-expand"!==h&&"rename-end-parent"!==h?e:t)},b.isNullOrUndefined(r.responseData.cwd)&&ws(r,"Cannot load empty data within the File Manager.","400",null)):n&&null===r.responseData.error?(0===(a="search"===s||"delete"===s?b.getValue("data",o):[]).length&&(a="copy"===s?r.pasteNodes.map(function(e){return vs(r,e)}):b.getValue("data",o).map(function(e){return vs(r,e.id)})),r.responseData={cwd:null,details:null,error:null,files:a}):"details"===b.getValue("action",o)&&(e=(a=b.getValue("data",o))[0],t=1<a.length,n=a.map(function(e){return e.name}),s=js(t?a.reduce(function(e,t){return e+(t.size||0)},0):e.size),a=r.pathNames.includes(e.name)||t?r.pathNames.join("/"):r.pathNames.join("/")+"/"+e.name,r.responseData.details=Object.assign({location:a,multipleFiles:t,name:n.join(", "),size:s},t?{}:{created:e.dateCreated,isFile:e.isFile,modified:e.dateModified,permission:e.permission})),xs(r,r.responseData,l,o,h,d,p,i)):new b.Ajax({url:b.getValue("url",i.ajaxSettings),type:b.getValue("type",i.ajaxSettings),mode:b.getValue("mode",i.ajaxSettings),dataType:b.getValue("dataType",i.ajaxSettings),contentType:b.getValue("contentType",i.ajaxSettings),data:b.getValue("data",i.ajaxSettings),beforeSend:b.getValue("beforeSend",i.ajaxSettings),onSuccess:function(e){var t;b.isNullOrUndefined(e)?(t={error:{fileExists:null,message:w(r,"Server-Error")+" "+r.ajaxSettings.url,code:"406"},files:null},Ps(r,i,l,t,h,d,p)):("string"==typeof e&&(e=JSON.parse(e)),xs(r,e,l,o,h,d,p,i))},onFailure:function(){var e={files:null,error:{code:"404",message:w(r,"Network-Error")+" "+r.ajaxSettings.url,fileExists:null}};Ps(r,i,l,e,h,d,p)}}).send())})}function js(e){e=e<1024?e+" B":e<1048576?(e/1024).toFixed(2)+" KB":e<1073741824?(e/1024/1024).toFixed(2)+" MB":(e/1024/1024/1024).toFixed(2)+" GB";return e}function xs(e,t,i,n,s,a,r,o){e.notify(fi,{action:"success"});var l,h=e.expandedId||e.pathId[e.pathId.length-1];if(b.isNullOrUndefined(t.cwd)||"read"!==b.getValue("action",n)||(t.cwd.name=1===e.pathId.length&&e.rootAliasName||t.cwd.name,b.setValue("_fm_id",h,t.cwd),b.setValue(h,t.cwd,e.feParent),b.isNullOrUndefined(t.files)&&"401"!==t.error.code)||("finalize-end"!==s&&"initial-end"!==s||0!==e.pathNames.length||(l=b.getValue(e.pathId[0],e.feParent),e.pathNames[0]=b.getValue("name",l),e.hasId=!b.isNullOrUndefined(b.getValue("id",l))),"finalize-end"===s&&sn(e)),!b.isNullOrUndefined(t.files)){jn(t.files);for(var d=0,p=t.files.length;d<p;d++){var c=t.files[d];b.setValue("_fm_iconClass",bn(c),c)}"read"===b.getValue("action",n)&&(Cn(t,h),b.setValue(h,t.files,e.feFiles))}b.isNullOrUndefined(t.details)||b.isNullOrUndefined(e.rootAliasName)||(l=e.rootAliasName||b.getValue("name",t.details),h=b.getValue("location",t.details).replace(new RegExp("/","g"),"\\"),h=("/"===b.getValue("path",n)||e.hasId&&1===b.getValue("path",n).match(/[/]/g).length)&&(0===b.getValue("names",n).length&&b.setValue("name",l,t.details),-1===h.indexOf("\\"))?l:h.replace(h.substring(0,h.indexOf("\\")),l),b.setValue("location",h,t.details)),i(e,t,s,a,r),b.isNullOrUndefined(t.files)||"path-changed"!==s&&"finalize-end"!==s&&"open-end"!==s&&"drop-path"!==s||e.notify(_i,t),"function"==typeof b.getValue("onSuccess",o.ajaxSettings)&&b.getValue("onSuccess",o.ajaxSettings)()}function Ns(e,t,i,n){for(var s=Os(t,i,n,!0),a=(e.fileSystemData.push(s),e.pasteNodes.push(s.id),Is(e,t.id)),r=0;r<a.length;r++)Ns(e,a[r],s,null)}function Ps(e,t,i,n,s,a,r){e.notify(fi,{action:"failure"}),i(e,n,s,a,r),"function"==typeof b.getValue("onFailure",t.ajaxSettings)&&b.getValue("onFailure",t.ajaxSettings)()}function Es(t,e,i){try{b.isNullOrUndefined(e.files)?(b.isNullOrUndefined(e.error)||"401"!==e.error.code||(e.files=[],t.notify(i,e),t.notify(f,{})),Fs(t,e,"read"),t.setProperties({path:t.oldPath},!0),t.pathNames.pop()):(t.notify(i,e),t.notify(f,{}),n={action:"read",result:e},t.trigger("success",n))}catch(e){Hs(t,e,"read"),t.setProperties({path:t.oldPath},!0),t.pathNames.pop()}var n;t.isDragDrop&&t.isDropEnd&&(0!==t.droppedObjects.length&&(n={fileDetails:t.droppedObjects},t.trigger("fileDropped",n)),t.isDropEnd=t.isDragDrop=!1)}function Rs(t,e,i,n){try{var s;b.isNullOrUndefined(e.files)?Fs(t,e,n):(t.notify(i,e),s={action:n,result:e},t.trigger("success",s))}catch(e){Hs(t,e,n)}}function Ms(e,t,i){try{var n,s,a,r;b.isNullOrUndefined(t.files)?"400"===t.error.code?(e.dialogObj&&e.dialogObj.visible?(n=b.select("#newname",e.dialogObj.element),s=w(e,"Validation-NewFolder-Exists").replace("{0}",'"'+n.value+'"'),n.parentElement.nextElementSibling.innerHTML=s):x(e,"Error",{files:null,error:{code:"400",message:w(e,"Validation-NewFolder-Exists").replace("{0}",'"'+i+'"'),fileExists:null}}),r={action:"create",error:t.error},e.trigger("failure",r)):(e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),Fs(e,t,"create")):(e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),e.createdItem=j(e)?t.files[t.files.length-1]:t.files[0],e.breadcrumbbarModule.searchObj.value="",a={folderName:i,path:e.path,parentFolder:e.itemData},e.trigger("folderCreate",a),r={action:"create",result:t},e.trigger("success",r),e.itemData=[O(e)],C(e,si,e.path))}catch(s){e.dialogObj&&e.dialogObj.visible&&e.dialogObj.hide(),Hs(e,s,"create")}}function ks(e,t){try{var i,n,s,a,r,o,l;b.isNullOrUndefined(t.files)?"400"===t.error.code&&e.dialogObj&&e.dialogObj.visible?(i=b.select("#rename",e.dialogObj.element),n=(n=w(e,"Validation-Rename-Exists").replace("{0}",'"'+e.currentItemText+'"')).replace("{1}",'"'+i.value+'"'),i.parentElement.nextElementSibling.innerHTML=n,s={action:"rename",error:t.error},e.trigger("failure",s)):(b.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide(),Fs(e,t,"rename")):(b.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide(),s={action:"rename",result:t},e.trigger("success",s),e.renamedItem=Array.isArray(t.files)?t.files[0]:t.files,a={newName:e.renamedItem.name,itemData:[e.renamedItem],path:e.path},e.trigger("rename",a),"navigationpane"===e.activeModule?(r=O(e),o=e.pathId[e.pathId.length-1].split("_").length-2,e.pathId.pop(),e.itemData=[b.getValue(e.pathId[e.pathId.length-1],e.feParent)],l=hs(e,e.renamedItem),C(e,Ni,l),!b.isNullOrUndefined(r)&&1<e.pathNames.length&&o<=e.pathNames.length-1&&(e.pathNames[o]=e.renameText,e.hasId||e.setProperties({path:"/"+e.pathNames.slice(1).join("/")+"/"},!0)),e.itemData=0<e.navigationpaneModule.previousSelected.length?e.navigationpaneModule.treeObj.getTreeData(e.navigationpaneModule.previousSelected[0]):e.itemData,C(e,g,e.path),e.itemData[0]=e.renamedItem,e.renamedItem=null):(e.itemData=[O(e)],""!==e.breadcrumbbarModule.searchObj.value?Us(e,y,e.path,e.searchWord,e.showHiddenItems,!e.searchSettings.ignoreCase):e.isFiltered?cs(e,y):C(e,y,e.path)))}catch(n){b.isNullOrUndefined(e.dialogObj)||e.dialogObj.hide(),Hs(e,n,"rename")}}function Ls(t,e,i,n){try{var s={itemData:e.files,isCopy:"copy"===n,path:i,targetData:t.itemData[0],targetPath:t.path};t.trigger("move",s),e.error&&e.error.fileExists?(t.fileLength=0,b.isNullOrUndefined(e.files)||(t.isPasteError=!0,Fn(t,n,e)),Bs(t,"DuplicateItems",e.error.fileExists),"404"===e.error.code&&x(t,"Error",e)):e.error||b.isNullOrUndefined(e.files)?e.error&&!b.isNullOrUndefined(e.files)?(t.isPasteError=!0,Fn(t,n,e),x(t,"Error",e)):Fs(t,e,n):(t.isPasteError=!1,Fn(t,n,e))}catch(e){Hs(t,e,n)}}function Ts(t,e,i){try{var n,s={itemData:e.files,path:i};t.trigger("delete",s),b.isNullOrUndefined(e.files)||(t.setProperties({path:i},!0),t.itemData=[O(t)],C(t,li,t.path),e.error)?Fs(t,e,"delete"):(n={action:"delete",result:e},t.trigger("success",n))}catch(e){Hs(t,e,"delete")}}function As(t,e,i,n){try{var s;b.isNullOrUndefined(e.details)?Fs(t,e,"details"):(x(t,n,null,e.details),s={action:"details",result:e},t.trigger("success",s))}catch(e){Hs(t,e,"details")}}function Fs(e,t,i){x(e,"Error",t);i={action:i,error:t.error};e.trigger("failure",i)}function Us(e,t,i,n,s,a){Cs(e,{action:"search",path:i,searchString:n,showHiddenItems:s,caseSensitive:a,data:e.itemData},Vs,t)}function Vs(t,e,i){try{var n;b.isNullOrUndefined(e.files)?Fs(t,e,"search"):(t.notify(i,e),n={action:"search",result:e},t.trigger("success",n))}catch(e){Hs(t,e,"search")}}function _s(a,e,t){var r=a.ajaxSettings.downloadUrl||a.ajaxSettings.url,e={action:"download",path:e,names:t,data:a.itemData},t={url:r,type:"POST",contentType:"application/json",responseType:"blob",data:JSON.stringify(e),onSuccess:null,onFailure:null,beforeSend:null};a.trigger("beforeDownload",{data:e,cancel:!1,useFormPost:!0,ajaxSettings:t},function(i){if(!i.cancel)if(i.useFormPost){var e=b.createElement("form",{id:a.element.id+"_downloadForm",attrs:{action:r,method:"post",name:"downloadForm",download:""}}),t=b.createElement("input",{id:a.element.id+"_hiddenForm",attrs:{name:"downloadInput",value:JSON.stringify(i.data),type:"hidden"}});e.appendChild(t),a.element.appendChild(e),document.forms.namedItem("downloadForm").submit(),a.element.removeChild(e)}else try{var n,s;new b.Fetch({url:b.getValue("url",i.ajaxSettings),type:b.getValue("type",i.ajaxSettings),contentType:b.getValue("contentType",i.ajaxSettings),responseType:b.getValue("responseType",i.ajaxSettings),beforeSend:b.getValue("beforeSend",i.ajaxSettings),onLoad:function(e){n=e.headers.get("Content-Disposition"),s=n?(e=(e=n.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/))&&e[1])?e.replace(/['"]/g,""):s:1<a.itemData.length?"files.zip":b.getValue("isFile",a.itemData[0])?b.getValue("name",a.itemData[0]):b.getValue("name",a.itemData[0])+".zip"},onSuccess:function(e){a.trigger("success",i);var e=URL.createObjectURL(e),t=document.createElement("a");t.href=e,t.download=s,document.body.appendChild(t),t.click(),document.body.removeChild(t)},onFailure:function(e){e={error:{code:e.status.toString(),message:w(a,"Network-Error")+" "+a.ajaxSettings.downloadUrl}};x(a,"Error",e),a.trigger("failure",i)}}).send(JSON.stringify(i.data))}catch(e){Hs(a,e,"download")}})}function Hs(e,t,i){Fs(e,{files:null,error:{message:t.message,fileExists:null}},i)}function x(t,e,i,n){var s=function(t,e,i,n){var s,a,r,o={header:"",content:"",buttons:[],dialogName:"",open:function(){Ws(t,t.dialogObj,o.dialogName)},close:function(){Ks(t,t.dialogObj,o.dialogName)}};switch(e=n&&!0===n.multipleFiles?"MultipleFileDetails":e){case"NewFolder":o.dialogName="Create Folder",o.header=w(t,"Header-NewFolder"),o.content='<input type="text" value="New folder" id="newname"><div class="e-fe-error"></div>',o.buttons=[