vesta/web/static/js/main.a9be926e.chunk.js
2022-10-10 20:21:54 +03:00

2 lines
485 KiB
JavaScript

(this["webpackJsonpreact-control-panel"]=this["webpackJsonpreact-control-panel"]||[]).push([[0],Array(48).concat([function(e,t,a){},,,,,,,,,,,,,,,,,function(e,t,a){},,,,,,function(e,t,a){},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,a){e.exports=a(302)},,,,,,,,,function(e,t,a){},,function(e,t,a){},function(e,t,a){},function(e,t,a){},,,,function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},,function(e,t,a){},,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,a){},,,,,,function(e,t,a){},function(e,t,a){},,,,,function(e,t,a){},function(e,t,a){},function(e,t,a){},,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){},,,,,,,,,,,,,,,,,,function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},,,function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){},function(e,t,a){"use strict";a.r(t);var n=a(0),c=a.n(n),r=a(31),l=a.n(r),o=a(2),s=a(87),i=a(32),u=a(1),m={focusedElement:"",activeElement:"",adminMenuTabs:["/list/user/","/list/web/","/list/dns/","/list/mail/","/list/db/","/list/cron/","/list/backup/","/list/package/","/list/ip/","/list/rrd/","/list/stats/","/list/log/","/list/updates/","/list/firewall/","/list/directory/","/softaculous/","/list/server/"],userMenuTabs:["/list/user/","/list/web/","/list/dns/","/list/mail/","/list/db/","/list/cron/","/list/backup/","/list/stats/","/list/log/","/list/directory/","/softaculous/"]},d=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_FOCUSED_ELEMENT":case"REMOVE_FOCUSED_ELEMENT":return Object(u.a)(Object(u.a)({},e),{},{focusedElement:t.value});case"ADD_ACTIVE_ELEMENT":case"REMOVE_ACTIVE_ELEMENT":return Object(u.a)(Object(u.a)({},e),{},{activeElement:t.value});default:return e}},E={controlPanelFocusedElement:""},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_CPANEL_FOCUSED_ELEMENT":return Object(u.a)(Object(u.a)({},e),{},{controlPanelFocusedElement:t.value});case"REMOVE_CPANEL_FOCUSED_ELEMENT":return Object(u.a)(Object(u.a)({},e),{},{controlPanelFocusedElement:""});default:return e}},v={notifications:[]},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_NOTIFICATIONS":case"REMOVE_NOTIFICATIONS":return Object(u.a)(Object(u.a)({},e),{},{notifications:t.value});default:return e}},b={user:{}},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REFRESH_COUNTERS":return Object(u.a)(Object(u.a)({},e),{},{user:t.value.user});default:return e}},g={session:{}},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_USER_SESSION":return Object(u.a)(Object(u.a)({},e),{},{session:t.value});default:return e}},N={token:"",error:"",i18n:{},userName:""},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOGIN":case"LOGOUT":case"LOGGED_OUT_AS":case"CHECK_AUTH":return Object(u.a)(Object(u.a)({},e),{},{token:t.value.token,userName:t.value.userName,i18n:t.value.i18n||{},error:t.value.error});default:return e}},y={panel:{}},k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REFRESH_PANEL":return Object(u.a)(Object(u.a)({},e),{},{panel:t.value.panel});default:return e}},_=Object(i.combineReducers)({mainNavigation:d,controlPanelContent:p,notifications:f,menuCounters:h,userSession:O,session:j,panel:k}),S=a(88);a(105);var w=a(17),A=a(3),C=a(19),D=a.n(C),M=a(15),F=a(30),x=a(25),T=a(26),L=a(28),U=a(27),I=a(9),P=(a(107),function(){return c.a.createElement("div",{className:"spinner-wrapper"},c.a.createElement("div",{className:"progress"},c.a.createElement("div",{className:"progress-bar progress-bar-striped progress-bar-animated",role:"progressbar","aria-valuenow":"100","aria-valuemin":"0","aria-valuemax":"100",style:{width:"100%"}})))}),R=a(16),V=(a(108),function(e){var t,a=Object(o.d)((function(e){return e.session})).i18n,n=function(e,t,a){a.isActive&&a.changeSorting(e,t)},r=function(e){return"Type"===e?a.type:"Size"===e?a.size:"Date"===e?a.date:"Name"===e?a.name:void 0};return c.a.createElement("div",{class:"btn-group"},(t=e.sorting,"descending"===e.order?c.a.createElement("button",{type:"button",className:"btn btn-secondary","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},r(t),c.a.createElement("span",{className:"arrow-down"},"\u2193")):c.a.createElement("button",{type:"button",className:"btn btn-secondary","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},r(t),c.a.createElement("span",null,"\u2191"))),c.a.createElement("div",{class:"dropdown-menu"},c.a.createElement("ul",{className:"dropdown-list"},c.a.createElement("li",null,c.a.createElement("span",{className:"Type"===e.sorting&&"descending"===e.order?"dropdown-item active":"dropdown-item",onClick:function(){return n("Type","descending",e)}},a.type,c.a.createElement("span",{className:"arrow-down"},"\u2193")),c.a.createElement("span",{className:"Type"===e.sorting&&"ascending"===e.order?"dropdown-item active":"dropdown-item",onClick:function(){return n("Type","ascending",e)}},c.a.createElement("span",null,"\u2191"))),c.a.createElement("li",null,c.a.createElement("span",{className:"Size"===e.sorting&&"descending"===e.order?"dropdown-item active":"dropdown-item",onClick:function(){return n("Size","descending",e)}},a.size,c.a.createElement("span",{className:"arrow-down"},"\u2193")),c.a.createElement("span",{className:"Size"===e.sorting&&"ascending"===e.order?"dropdown-item active":"dropdown-item",onClick:function(){return n("Size","ascending",e)}},c.a.createElement("span",null,"\u2191"))),c.a.createElement("li",null,c.a.createElement("span",{className:"Date"===e.sorting&&"descending"===e.order?"dropdown-item active":"dropdown-item",onClick:function(){return n("Date","descending",e)}},a.date,c.a.createElement("span",{className:"arrow-down"},"\u2193")),c.a.createElement("span",{className:"Date"===e.sorting&&"ascending"===e.order?"dropdown-item active":"dropdown-item",onClick:function(){return n("Date","ascending",e)}},c.a.createElement("span",null,"\u2191"))),c.a.createElement("li",null,c.a.createElement("span",{className:"Name"===e.sorting&&"descending"===e.order?"dropdown-item active":"dropdown-item",onClick:function(){return n("Name","descending",e)}},a.name,c.a.createElement("span",{className:"arrow-down"},"\u2193")),c.a.createElement("span",{className:"Name"===e.sorting&&"ascending"===e.order?"dropdown-item active":"dropdown-item",onClick:function(){return n("Name","ascending",e)}},c.a.createElement("span",null,"\u2191"))))))}),B=(a(109),function(e){var t=e.path,a=e.isActive,r=e.className,l=e.openDirectory,s=e.changeSorting,i=e.sorting,u=e.order,m=Object(o.d)((function(e){return e.menuCounters})).user,d=Object(R.g)();Object(n.useEffect)((function(){if(!m)return d.push("/login")}),[m]);var E=function(e){var n=t.split("/");if(a&&void 0!==e){var c=n.splice(0,e+4).join("/");l(c)}};return c.a.createElement("div",{className:r},c.a.createElement("div",{className:"clickable-wrapper"},c.a.createElement("span",{className:"clickable-path"},c.a.createElement("span",{className:"clickable",onClick:function(){return l(m.HOME)}},m.HOME),function(){var e=t.split("/");if(e.splice(0,3),t!==m.HOME)return e.map((function(e,t){return c.a.createElement("span",{className:"clickable",key:t,onClick:function(){return E(t)}},"\xa0/\xa0",e)}))}())),c.a.createElement(V,{changeSorting:s,sorting:i,order:u,isActive:a}))}),W=a(4),q=a(37),H=(a(113),a(43)),K=a.n(H),J=function(e){Object(L.a)(a,e);var t=Object(U.a)(a);function a(){var e;Object(x.a)(this,a);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return(e=t.call.apply(t,[this].concat(r))).componentDidMount=function(){document.addEventListener("keydown",e.openOnEnter)},e.componentWillUnmount=function(){document.removeEventListener("keydown",e.openOnEnter)},e.openOnEnter=function(t){var a=e.props,n=a.activeRow,c=a.data,r=c.name,l=c.type,o=a.isActiveList,s=a.modalVisible,i=a.openDirectory,u=a.cursor,m=a.download,d=a.path;!s&&n&&o&&13===t.keyCode&&(e.isArchive(r)||"l"===l?m():e.isFile(l)&&0!==u?e.changePath(d,r):i(r))},e.openItem=function(){var t=e.props,a=t.data,n=a.type,c=a.name,r=t.openDirectory,l=t.download,o=t.path;if(t.isActiveList)return e.isArchive(c)||"l"===n||c.match(".mp4")?l():e.isFile(n)?e.changePath(o,c):"d"===n?r(c):void 0},e.changePath=function(t,a){e.props.history.push({pathname:"/list/directory/preview/",search:"?path=".concat(t,"/").concat(a)})},e.selectRow=function(t){var a=e.props,n=a.data,c=n.name,r=n.permissions,l=n.type,o=a.selectMultiple,s=a.selectOnClick,i=a.cursor,u=a.activeRow;t.ctrlKey&&0!==i&&o(),u||s(i,c,r,l)},e.className=function(){var t=e.props,a=t.activeRow,n=t.selected;if(t.isActiveList){var c=a?"active":"";return c.length?c:n?"selected":""}var r=a?"inactive":"";return r.length?r:n?"inactive-selected":""},e.sizeFormatter=function(t,a){if(void 0===t||"d"===e.props.data.type)return null;if("0"===t)return c.a.createElement("span",{className:"value"},"0 ",c.a.createElement("span",{className:"unit"},"b"));var n=a<=0?0:a||2,r=Math.floor(Math.log(t)/Math.log(1024));return c.a.createElement("span",{className:"value"},parseFloat((t/Math.pow(1024,r)).toFixed(n))," ",c.a.createElement("span",{className:"unit"},["b","kb","Mb","GB"][r]))},e.dateFormatter=function(t){if(void 0===t)return null;var a=new Date(t),n=a.getDate(),r=e.props.session.i18n[["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()]];return c.a.createElement("span",{className:"date"},r," ",n)},e.timeFormatter=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=arguments.length>1?arguments[1]:void 0,a=K()(e).year(),n=K()().year();return a===n?t:a},e.glyph=function(){var t=e.props.data,a=t.type,n=t.name;return"d"===a?c.a.createElement(W.a,{icon:"folder-open",className:"folder-open"}):e.isFile(a)?e.isArchive(n)?c.a.createElement(W.a,{icon:"book",className:"archive"}):n.match(/png|jpg|jpeg|gif/g)?c.a.createElement(W.a,{icon:"image",className:"image"}):null!==n.match(".mp4")?c.a.createElement(W.a,{icon:"download",className:"download"}):n.match(".txt")?c.a.createElement(W.a,{icon:"file-alt",className:"file-alt"}):n.match(".js")?c.a.createElement(W.a,{icon:q.c,className:"js"}):n.match(".html")?c.a.createElement(W.a,{icon:q.b,className:"html5"}):n.match(".php")?c.a.createElement(W.a,{icon:q.d,className:"php"}):n.match(/.scss/i)?c.a.createElement(W.a,{icon:q.e,className:"sass"}):n.match(/.css/i)?c.a.createElement(W.a,{icon:q.a,className:"css3"}):c.a.createElement(W.a,{icon:"file",className:"file"}):"l"===a?c.a.createElement(W.a,{icon:"download",className:"download"}):void 0},e}return Object(T.a)(a,[{key:"isArchive",value:function(e){return e.match(/zip|tgz|tar.gz|gzip|tbz|tar.bz|gz|zip|tar|rar/g)}},{key:"isFile",value:function(e){return"f"===e}},{key:"render",value:function(){var e=this,t=this.props.data,a=t.name,n=t.owner,r=t.permissions,l=t.size,o=t.date,s=t.time;return c.a.createElement("li",{className:this.className(),onClick:this.selectRow,id:a},c.a.createElement("span",{className:"marker"}),this.glyph(),c.a.createElement("span",{className:"fName"},c.a.createElement("span",{className:"name",onClick:function(t){return e.openItem(t)}},0===this.props.cursor?"..":a)),c.a.createElement("span",{className:"fPermissions"},r),c.a.createElement("span",{className:"fOwner"},n),c.a.createElement("span",{className:"fSize"},this.sizeFormatter(l)),c.a.createElement("span",{className:"fDate"},this.dateFormatter(o)),c.a.createElement("span",{className:"fTime"},this.timeFormatter(o,s)))}}]),a}(n.Component);var z=Object(o.b)((function(e){return{session:e.session}}))(Object(R.i)(J)),Y=(a(114),function(e){Object(L.a)(a,e);var t=Object(U.a)(a);function a(e){var n;return Object(x.a)(this,a),(n=t.call(this,e)).UNSAFE_componentWillMount=function(){localStorage.getItem("".concat(n.props.list,"Sorting"))&&localStorage.getItem("".concat(n.props.list,"Order"))&&n.setState({sortingType:localStorage.getItem("".concat(n.props.list,"Sorting")),orderType:localStorage.getItem("".concat(n.props.list,"Order"))})},n.componentDidMount=function(){document.addEventListener("keydown",n.handleLiSelection),document.addEventListener("keydown",n.moveBackOnButton)},n.componentWillUnmount=function(){document.removeEventListener("keydown",n.handleLiSelection),document.removeEventListener("keydown",n.moveBackOnButton)},n.cacheSorting=function(){localStorage.setItem("".concat(n.props.list,"Sorting"),n.state.sortingType),localStorage.setItem("".concat(n.props.list,"Order"),n.state.orderType)},n.moveBackOnButton=function(e){8===e.keyCode&&!n.props.modalVisible&&n.props.isActive&&n.moveBack()},n.moveBack=function(){n.isHomeDirectory()||n.props.moveBack()},n.isHomeDirectory=function(){return n.props.path===n.props.rootDir},n.toggleActiveList=function(){var e=n.props,t=e.history,a=e.path,c=e.list,r=e.onClick,l=e.changePathAfterToggle;e.isActive||(r(c),l(a),t.push({pathname:"/list/directory/",search:"?path=".concat(a)}),n.cacheActiveWindowAndPaths(),n.passData())},n.cacheActiveWindowAndPaths=function(){localStorage.setItem("activeWindow",n.props.list),localStorage.setItem("".concat(n.props.list,"ListPath"),n.props.path),localStorage.setItem("".concat(n.props.list,"ListPath"),n.props.path)},n.isSelected=function(e){return-1!==n.state.itemsSelected.indexOf(e)},n.handleLiSelection=function(e){var t=n.props,a=t.isActive,c=t.modalVisible,r=t.changePath,l=t.path,o=n.state.cursor,s=n.getDataBySortingType().listing;if(a&&!c){if(40===e.keyCode){if(o===s.length-1)return;if(e.shiftKey){var i=s[o].name;n.addToSelection(i)}n.setState({cursor:o+1}),n.passData(),r(l)}if(38===e.keyCode){if(0===o)return;if(e.shiftKey){var u=s[o-1].name;n.addToSelection(u)}n.setState({cursor:o-1}),n.passData(),r(l)}}},n.resetData=function(){n.setState({cursor:0,itemsSelected:[]})},n.passData=function(){var e=n.props.passData,t=n.getDataBySortingType(),a=t.firstItem,c=t.listing;if(0===n.state.cursor){var r=a.name,l=a.permissions,o=a.type;e(n.state.cursor,r,l,o)}else{var s=c[n.state.cursor-1],i=s.name,u=s.permissions,m=s.type;e(n.state.cursor,i,u,m)}},n.openDirectory=function(e){var t=n.props,a=t.history,c=t.path,r=t.addToPath,l=t.openDirectory;a.push({pathname:"/list/directory/",search:"?path=".concat(c,"/").concat(e)}),r(e),l(),n.setState({cursor:0})},n.openCertainDirectory=function(e){var t=n.props,a=t.history,c=t.openCertainDirectory,r=t.changePath;n.isHomeDirectory()||(a.push({pathname:"/list/directory/",search:"?path=".concat(e)}),r(e),c())},n.changeSorting=function(e,t){n.setState({sortingType:e,orderType:t},(function(){return n.cacheSorting()}))},n.sortByType=function(e,t){return"descending"===n.state.orderType&&""!==e.name?e.type.localeCompare(t.type):"ascending"===n.state.orderType&&""!==t.name?t.type.localeCompare(e.type):void 0},n.sortBySize=function(e,t){return"descending"===n.state.orderType&&""!==e.name?e.size-t.size:"ascending"===n.state.orderType&&""!==t.name?t.size-e.size:void 0},n.sortByDate=function(e,t){return"descending"===n.state.orderType&&""!==e.name?new Date(e.date)-new Date(t.date):"ascending"===n.state.orderType&&""!==e.name?new Date(t.date)-new Date(e.date):void 0},n.sortByName=function(e,t){return"descending"===n.state.orderType&&""!==e.name?e.name.localeCompare(t.name):"ascending"===n.state.orderType&&""!==t.name?t.name.localeCompare(e.name):void 0},n.sortData=function(e,t){switch(n.state.sortingType){case"Type":return n.sortByType(e,t);case"Size":return n.sortBySize(e,t);case"Date":return n.sortByDate(e,t);case"Name":return n.sortByName(e,t);default:return n.sortByType(e,t)}},n.getDataBySortingType=function(){var e,t=[];return n.props.data.listing.forEach((function(a){""===a.name&&"d"===a.type?e=a:t.push(a)})),t="Type"!==n.state.sortingType?[].concat(Object(I.a)(t.filter((function(e){return"d"===e.type})).sort((function(e,t){return n.sortByName(e,t)}))),Object(I.a)(t.filter((function(e){return"f"===e.type})).sort((function(e,t){return n.sortData(e,t)})))):t.sort((function(e,t){return n.sortData(e,t)})),{firstItem:e,listing:t}},n.rows=function(){var e=n.props,t=e.isActive,a=e.modalVisible,r=e.path,l=e.download,o=n.state.cursor,s=n.getDataBySortingType(),i=s.listing,u=s.firstItem;if(i.length||u)return c.a.createElement(c.a.Fragment,null,c.a.createElement(z,{selectOnClick:function(e,t,a,c){n.setState({cursor:e}),n.props.passData(e,t,a,c)},openDirectory:n.moveBack,modalVisible:a,activeRow:0===o,isActiveList:t,cursor:0,data:u,path:r}),i.map((function(e,s){return c.a.createElement(z,{key:s+1,selectOnClick:function(e,t,a,c){n.setState({cursor:e}),n.props.passData(e,t,a,c)},selectMultiple:function(){return n.addToSelection(e.name)},selected:n.isSelected(e.name),openDirectory:n.openDirectory,modalVisible:a,activeRow:s+1===o,isActiveList:t,download:l,cursor:s+1,data:e,path:r})})))},n.state={orderType:"descending",sortingType:"Type",itemsSelected:[],listingItems:[],cursor:0},n}return Object(T.a)(a,[{key:"addToSelection",value:function(e){var t=this.state.itemsSelected,a=Object(I.a)(t),n=t.indexOf(e);if(-1!==n)a.splice(n,1);else{if(""===e)return;a.push(e)}this.setState({itemsSelected:a}),this.props.passSelection(a)}},{key:"render",value:function(){var e=this.props,t=e.isActive,a=e.path,n=e.loading;return c.a.createElement("div",{className:t?"list active":"list",onClick:this.toggleActiveList},c.a.createElement(B,{className:t?"active-path":"path",openDirectory:this.openCertainDirectory,changeSorting:this.changeSorting,sorting:this.state.sortingType,order:this.state.orderType,isActive:t,path:a}),c.a.createElement("div",{className:"list-container"},c.a.createElement("ul",null,n&&t?c.a.createElement(P,null):this.rows())))}}]),a}(n.Component)),G=(a(115),function(e){return c.a.createElement("div",{class:"progress upload",style:{overflow:"0"!==e.progress?"visible":"hidden"}},c.a.createElement("div",{class:"progress-bar",role:"progressbar",style:{width:"".concat(e.progress,"%")},"aria-valuenow":e.progress,"aria-valuemin":"0","aria-valuemax":"100"}))}),Q=a(35),X=(a(116),function(e){var t=Object(o.d)((function(e){return e.session})).i18n;Object(n.useEffect)((function(){return window.addEventListener("keyup",a),function(){return window.removeEventListener("keyup",a)}}),[e.reference]);var a=function(t){var a=document.querySelector("input:focus")||document.querySelector("textarea:focus");72!==t.keyCode||a||e.toggleHotkeys()};return c.a.createElement("div",{className:"hotkeys-list hide",ref:e.reference},c.a.createElement("div",{className:"head"},c.a.createElement("div",{className:"name"},t.Shortcuts),c.a.createElement("div",{className:"close",onClick:function(){return e.toggleHotkeys()}},c.a.createElement(W.a,{icon:"times"}))),c.a.createElement("div",{className:"body"},c.a.createElement("ul",null,c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"u"),c.a.createElement("span",{className:"description"},t.Upload)),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"n"),c.a.createElement("span",{className:"description"},t["New File"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"F6"),c.a.createElement("span",{className:"description"},t["New Folder"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"d"),c.a.createElement("span",{className:"description"},t.Download)),c.a.createElement("li",{className:"space-top"},c.a.createElement("span",{className:"name"},"F2 / Shift + F6"),c.a.createElement("span",{className:"description"},t.Rename)),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"m"),c.a.createElement("span",{className:"description"},t.Move)),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"F5"),c.a.createElement("span",{className:"description"},t.Copy)),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"F8 / Del"),c.a.createElement("span",{className:"description"},t.Delete)),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"F2"),c.a.createElement("span",{className:"description"},t["Save File (in text editor)"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"h"),c.a.createElement("span",{className:"description"},t["Display/Close shortcuts"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"Esc"),c.a.createElement("span",{className:"description"},t["Close Popup / Cancel"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"F10"),c.a.createElement("span",{className:"description"},t["Close Preview / Editor"]))),c.a.createElement("ul",null,c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"\u2191"),c.a.createElement("span",{className:"description"},t["Move Cursor Up"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"\u2193"),c.a.createElement("span",{className:"description"},t["Move Cursor Down"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"\u2190"),c.a.createElement("span",{className:"description"},t["Switch to Left Tab"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"\u2192"),c.a.createElement("span",{className:"description"},t["Switch to Right Tab"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"a"),c.a.createElement("span",{className:"description"},t.Archive)),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"Enter"),c.a.createElement("span",{className:"description"},t["Open File / Enter Directory"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"F3"),c.a.createElement("span",{className:"description"},t["Edit File"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"Backspace"),c.a.createElement("span",{className:"description"},t["Go to Parent Directory"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"Ctr + Click"),c.a.createElement("span",{className:"description"},t["Add File to the Current Selection"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"Shift + Cursor up/down"),c.a.createElement("span",{className:"description"},t["Select Bunch of Files"])))))}),Z=function(e){var t=Object(n.useState)(null),a=Object(A.a)(t,2),r=a[0],l=a[1],s=Object(o.d)((function(e){return e.session})).i18n,i=Object(n.useState)(null!==r&&!r.length),u=Object(A.a)(i,2),m=u[0],d=u[1];return c.a.createElement("div",{className:"modal-content"},c.a.createElement("div",{className:"modal-header"},c.a.createElement("h3",{className:"modal-title"},s["Create file"])),c.a.createElement("div",{className:"modal-body"},c.a.createElement("input",{type:"text",onChange:function(e){l(e.target.value)},ref:e.reference}),m&&c.a.createElement("small",{className:"error"},s["File name cannot be empty"])),c.a.createElement("div",{className:"modal-footer"},c.a.createElement("button",{type:"button",className:"btn btn-danger mr-auto",onClick:function(){e.close()}},s.Cancel),c.a.createElement("button",{type:"button",className:"btn btn-primary",onClick:function(){r?e.save():d(!0)}},s.Create)))},$=function(e){var t=Object(n.useState)(null),a=Object(A.a)(t,2),r=a[0],l=a[1],s=Object(o.d)((function(e){return e.session})).i18n,i=Object(n.useState)(null!==r&&!r.length),u=Object(A.a)(i,2),m=u[0],d=u[1];return c.a.createElement("div",{className:"modal-content"},c.a.createElement("div",{className:"modal-header"},c.a.createElement("h3",{className:"modal-title directory"},s["Create directory"])),c.a.createElement("div",{className:"modal-body"},c.a.createElement("input",{type:"text",onChange:function(e){l(e.target.value)},ref:e.reference}),m&&c.a.createElement("small",{className:"error"},s["Directory name cannot be empty"])),c.a.createElement("div",{className:"modal-footer"},c.a.createElement("button",{type:"button",className:"btn btn-danger mr-auto",onClick:function(){e.close()}},s.Cancel),c.a.createElement("button",{type:"button",className:"btn btn-primary",onClick:function(){r?e.save():d(!0)}},s.Create)))},ee=function(e){var t=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:"modal-content rename"},c.a.createElement("div",{className:"modal-header"},c.a.createElement("h3",{className:"modal-title rename"},t.Rename," ",c.a.createElement("span",{className:"quot"},'"',e.fName,'"'))),c.a.createElement("div",{className:"modal-body"},c.a.createElement("input",{type:"text",autoFocus:!0,defaultValue:e.fName,onChange:e.onChange,ref:e.reference})),c.a.createElement("div",{className:"modal-footer"},c.a.createElement("button",{type:"button",className:"btn btn-danger mr-auto",onClick:e.close},t.Cancel),c.a.createElement("button",{type:"button",className:"btn btn-primary",onClick:e.save},t.Rename)))},te=function(e){var t=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:"modal-content delete"},c.a.createElement("div",{className:"modal-header"},e.items>0?c.a.createElement("h3",null,t["Delete items"]," ",c.a.createElement("span",{className:"quot"},"(",e.items,")")," ?"):c.a.createElement("h3",null,t["Are you sure you want to delete"]," ",c.a.createElement("span",{className:"quot"},'"',e.fName,'"'),"?")),c.a.createElement("div",{className:"modal-footer lower"},c.a.createElement("button",{type:"button",className:"btn btn-danger mr-auto",onClick:e.close},t.Cancel),c.a.createElement("button",{type:"button",className:"btn btn-primary",onClick:e.save,autoFocus:!0},t.Delete)))},ae=function(e){var t=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:"modal-content nothing-selected"},c.a.createElement("div",{className:"header"},e.notAvailable?c.a.createElement("h3",null,t["Directory download not available in current version"]):c.a.createElement("h3",null,t["No file selected"])),c.a.createElement("div",{className:"modal-footer"},c.a.createElement("button",{type:"button",className:"btn btn-danger mr-auto",onClick:e.close},t.Close)))},ne=a(46),ce=a.n(ne),re={owner:{read:0,write:0,execute:0},group:{read:0,write:0,execute:0},others:{read:0,write:0,execute:0}},le=function(e){Object(L.a)(a,e);var t=Object(U.a)(a);function a(e){var n;return Object(x.a)(this,a),(n=t.call(this,e)).decodeSingleNumber=function(e){var t=parseInt(e,0);return{read:n.inArray(t,[4,5,6,7])?4:0,write:n.inArray(t,[2,3,6,7])?2:0,execute:n.inArray(t,[1,3,5,7])?1:0}},n.onChangeForm=function(e){var t=e.target,a=t.name.split("_"),c=Object(A.a)(a,2),r=c[0],l=c[1];n.setState({permissions:Object(u.a)(Object(u.a)({},n.state.permissions),{},Object(M.a)({},r,Object(u.a)(Object(u.a)({},n.state.permissions[r]),{},Object(M.a)({},l,t.checked?t.value:0))))},(function(e){n.inputRef.value=n.encode(),n.props.changePermissions(n.inputRef.value)}))},n.handleInputChange=function(e){var t=e.target.value;if(!n.isValid(t))return n.setState({inputInvalid:!0});n.setState({permissions:n.decode(t),inputInvalid:!1}),n.props.changePermissions(n.inputRef.value)},n.state={permissions:n.decode(n.props.permissions)||re,inputInvalid:!1},n}return Object(T.a)(a,[{key:"inArray",value:function(e,t){return!!~t.indexOf(e)}},{key:"isValid",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return 3===e.length&&"000"!==e&&!e.match(/[A-Za-z]/)&&void 0===e.split("").find((function(e){return parseInt(e,0)<0||parseInt(e,0)>7}))}},{key:"decode",value:function(e){if(!this.isValid(e))return null;var t=e.split("").map(this.decodeSingleNumber);return{owner:t[0],group:t[1],others:t[2]}}},{key:"encode",value:function(){var e=this;return["owner","group","others"].reduce((function(t,a){var n,c=e.state.permissions[a];return t+(n=c,Object.values(n).map((function(e){return parseInt(e,0)})).reduce((function(e,t){return e+t}),0))}),"")}},{key:"render",value:function(){var e=this,t=this.props.session.i18n,a=this.state.inputInvalid,n=this.props,r=n.close,l=n.save,o=n.fName,s=ce()({"form-control total":!0,error:a});return c.a.createElement("div",{className:"modal-content permissions"},c.a.createElement("div",{className:"modal-header"},c.a.createElement("h3",{className:"modal-title perms"},t["Change Rights"]," ",c.a.createElement("span",{className:"quot"},'"',o,'"'))),c.a.createElement("form",{name:"form",onChange:this.onChangeForm},c.a.createElement("div",null,c.a.createElement("label",null,c.a.createElement("input",{type:"checkbox",name:"owner_read",value:"4",checked:!!this.state.permissions.owner.read,id:"read"}),t["read by owner"]),c.a.createElement("label",null,c.a.createElement("input",{type:"checkbox",name:"owner_write",value:"2",checked:!!this.state.permissions.owner.write}),t["write by owner"]),c.a.createElement("label",null,c.a.createElement("input",{type:"checkbox",name:"owner_execute",value:"1",checked:!!this.state.permissions.owner.execute}),t["execute/search by owner"])),c.a.createElement("div",null,c.a.createElement("label",null,c.a.createElement("input",{type:"checkbox",name:"group_read",value:"4",checked:!!this.state.permissions.group.read,id:"read"}),t["read by group"]),c.a.createElement("label",null,c.a.createElement("input",{type:"checkbox",name:"group_write",value:"2",checked:!!this.state.permissions.group.write}),t["write by group"]),c.a.createElement("label",null,c.a.createElement("input",{type:"checkbox",name:"group_execute",value:"1",checked:!!this.state.permissions.group.execute}),t["execute/search by group"])),c.a.createElement("div",null,c.a.createElement("label",null,c.a.createElement("input",{type:"checkbox",name:"others_read",value:"4",checked:!!this.state.permissions.others.read,id:"read"}),t["read by others"]),c.a.createElement("label",null,c.a.createElement("input",{type:"checkbox",name:"others_write",value:"2",checked:!!this.state.permissions.others.write}),t["write by others"]),c.a.createElement("label",null,c.a.createElement("input",{type:"checkbox",name:"others_execute",value:"1",checked:!!this.state.permissions.others.execute}),t["execute/search by others"]))),c.a.createElement("input",{type:"text",className:s,defaultValue:this.encode(),ref:function(t){return e.inputRef=t},onChange:this.handleInputChange,maxLength:"3"}),c.a.createElement("div",{className:"modal-footer"},c.a.createElement("button",{type:"button",className:"btn btn-danger mr-auto",onClick:r},t.Cancel),c.a.createElement("button",{type:"button",className:"btn btn-primary",onClick:l,disabled:a},t.OK)))}}]),a}(n.Component);var oe=Object(o.b)((function(e){return{session:e.session}}))(le),se=function(e){var t=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:"modal-content"},c.a.createElement("div",{className:"modal-header"},e.items>0?c.a.createElement("h3",{className:"modal-title"},t["Move files"]," ",c.a.createElement("span",{className:"quot"},"(",e.items,")")," ",t.into,":"):c.a.createElement("h3",{className:"modal-title rename"},t.Move," ",c.a.createElement("span",{className:"quot"},'"',e.fName,'"')," ",t.into,":")),c.a.createElement("div",{className:"modal-body"},c.a.createElement("input",{type:"text",autoFocus:!0,defaultValue:e.path,onChange:e.onChange,ref:e.reference})),c.a.createElement("div",{className:"modal-footer"},c.a.createElement("button",{type:"button",className:"btn btn-danger mr-auto",onClick:e.close},t.Cancel),c.a.createElement("button",{type:"button",className:"btn btn-primary",onClick:e.save},t.Move)))},ie=function(e){var t=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:"modal-content"},c.a.createElement("div",{className:"modal-header"},e.items>0?c.a.createElement("h3",{className:"modal-title"},t.Compress," ",c.a.createElement("span",{className:"quot"},"(",e.items,")"),"?"):c.a.createElement("h3",{className:"modal-title rename"},t.Compress," ",c.a.createElement("span",{className:"quot"},'"',e.fName,'"'),"?")),c.a.createElement("div",{className:"modal-body"},c.a.createElement("input",{type:"text",autoFocus:!0,defaultValue:"".concat(e.path,"/").concat(e.fName,".tar.gz"),onBlur:e.onChange,ref:e.reference})),c.a.createElement("div",{className:"modal-footer"},c.a.createElement("button",{type:"button",className:"btn btn-danger mr-auto",onClick:e.close},t.Cancel),c.a.createElement("button",{type:"button",className:"btn btn-primary",onClick:e.save},t.Compress)))},ue=function(e){var t=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:"modal-content"},c.a.createElement("div",{className:"modal-header"},c.a.createElement("h3",{className:"modal-title rename"},t.Extract," ",c.a.createElement("span",{className:"quot"},'"',e.fName,'"'),t.into)),c.a.createElement("div",{className:"modal-body"},c.a.createElement("input",{type:"text",autoFocus:!0,defaultValue:e.path,onBlur:e.onChange,ref:e.reference})),c.a.createElement("div",{className:"modal-footer"},c.a.createElement("button",{type:"button",className:"btn btn-danger mr-auto",onClick:e.close},t.Cancel),c.a.createElement("button",{type:"button",className:"btn btn-primary",onClick:e.save},t.Extract)))},me=function(e){var t=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:"modal-content"},c.a.createElement("div",{className:"modal-header"},e.items>0?c.a.createElement("h3",{className:"modal-title"},t["Copy files"]," ",c.a.createElement("span",{className:"quot"},"(",e.items,")")," ",t.into,":"):c.a.createElement("h3",{className:"modal-title rename"},t.Copy," ",c.a.createElement("span",{className:"quot"},'"',e.fName,'"')," ",t.into,":")),c.a.createElement("div",{className:"modal-body"},c.a.createElement("input",{type:"text",autoFocus:!0,defaultValue:e.path,onChange:e.onChange,ref:e.reference})),c.a.createElement("div",{className:"modal-footer"},c.a.createElement("button",{type:"button",className:"btn btn-danger mr-auto",onClick:e.close},t.Cancel),c.a.createElement("button",{type:"button",className:"btn btn-primary",onClick:e.save},t.Copy)))},de=function(e){return c.a.createElement("div",{className:"modal-content replace"},c.a.createElement("div",{className:"modal-header"},e.files.length>1?c.a.createElement("div",null,c.a.createElement("h3",null,"These files already exist"),e.files.map((function(e){return c.a.createElement("span",{className:"quot"},'"',e.name,'" ')}))):c.a.createElement("div",null,c.a.createElement("h3",null,"This file already exists"),c.a.createElement("span",{className:"quot"},'"',e.files[0].name,'"'))),c.a.createElement("div",{className:"modal-footer"},c.a.createElement("button",{type:"button",className:"btn btn-primary mr-auto",onClick:e.close},"Cancel"),c.a.createElement("button",{type:"button",className:"btn btn-danger",onClick:function(){return e.replace(e.files)}},"Overwrite")))},Ee=(a(48),function(e){Object(n.useEffect)((function(){return window.addEventListener("click",s),document.addEventListener("keydown",t),function(){window.removeEventListener("click",s),document.removeEventListener("keydown",t)}}),[]);var t=function(e){27===e.keyCode?o():13===e.keyCode&&a()},a=function(){e.onClick(),e.onClose()},r=function(t){e.onChangePermissions(t)},l=function(t){e.onChangeValue(t.target.value)},o=function(){e.onClose()},s=function(t){var a=document.getElementById("modal");t.target===a&&e.onClose()};return c.a.createElement("div",null,c.a.createElement("div",{className:"modal",id:"modal"},function(){var t=e.type,n=e.reference,s=e.fName,i=e.permissions,u=e.items,m=e.path,d=e.files,E=e.notAvailable;switch(t){case"Copy":return c.a.createElement(me,{close:o,save:a,reference:n,onChange:l,name:t,fName:s,items:u,path:m});case"Move":return c.a.createElement(se,{close:o,save:a,reference:n,onChange:l,name:t,fName:s,items:u,path:m});case"Permissions":return c.a.createElement(oe,{close:o,save:a,changePermissions:r,fName:s,permissions:i});case"Extract":return c.a.createElement(ue,{close:o,save:a,reference:n,onChange:l,name:t,fName:s,path:m});case"Archive":return c.a.createElement(ie,{close:o,save:a,reference:n,onChange:l,items:u,name:t,fName:s,path:m});case"Rename":return c.a.createElement(ee,{close:o,save:a,reference:n,onChange:l,name:t,fName:s});case"Add directory":return c.a.createElement($,{close:o,save:a,reference:n});case"Delete":return c.a.createElement(te,{close:o,save:a,fName:s,items:u});case"Add file":return c.a.createElement(Z,{close:o,save:a,reference:n});case"Replace":return c.a.createElement(de,{close:o,replace:function(t){return a=t,e.onClick(a),void e.onClose();var a},files:d});case"Nothing selected":return c.a.createElement(ae,{close:o,notAvailable:E})}}()))}),pe=(a(117),a(118),a(5)),ve=function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(n.useRef)(),r=Object(n.useCallback)((function(e){return b(e)}),[e]);Object(n.useEffect)((function(){return document.addEventListener("keydown",r),function(){return document.removeEventListener("keydown",r)}}),[r]);var l=function(){e.openModal("Add file")},s=function(){e.openModal("Add directory")},i=function(){var t=e.selection,a=e.openModal,n=e.cursor;0===t.length?a(0===n?"Nothing selected":"Delete"):a("Delete",t.length)},u=function(){console.log(e),0===e.cursor?e.openModal("Nothing selected"):e.openModal("Rename")},m=function(){0===e.cursor?e.openModal("Nothing selected"):e.openModal("Permissions")},d=function(){var t=e.selection,a=e.openModal,n=e.cursor;0===t.length?a(0===n?"Nothing selected":"Move"):a("Move",t.length)},E=function(){var t=e.selection,a=e.openModal,n=e.cursor;0===t.length?a(0===n?"Nothing selected":"Archive"):a("Archive",t.length)},p=function(){0===e.cursor?e.openModal("Nothing selected"):e.openModal("Extract")},v=function(){var t=e.selection,a=e.openModal,n=e.cursor;0===t.length?a(0===n?"Nothing selected":"Copy"):a("Copy",t.length)},f=function(){0===e.cursor?e.openModal("Nothing selected"):"d"===e.itemType?e.openModal("Nothing selected",null,!0):e.download()},b=function(t){t.stopPropagation();var n=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(!e.modalVisible&&!n){if(t.shiftKey&&118===t.keyCode)return t.preventDefault(),void u();switch(t.keyCode){case 85:return t.preventDefault(),a.current.click();case 78:return t.preventDefault(),l();case 118:return t.preventDefault(),s();case 68:return t.preventDefault(),f();case 113:return t.preventDefault(),u();case 77:return t.preventDefault(),d();case 115:return t.preventDefault(),v();case 65:return t.preventDefault(),E();case 119:case 46:return t.preventDefault(),i();case 114:return t.preventDefault(),m()}}},h=e.name.match(/.zip|.tgz|.tar.gz|.gzip|.tbz|.tar.bz|.gz|.zip|.tar|.rar/g);return c.a.createElement("div",{className:"menu"},c.a.createElement("div",{className:"logo"},c.a.createElement(pe.b,{to:"/"},c.a.createElement("img",{src:"../../images/logo.png",alt:"Logo"}))),c.a.createElement("div",{className:"btn-group",role:"group","aria-label":"First group"},c.a.createElement("input",{type:"file",className:"upload",multiple:!0,onChange:function(t){0!==t.target.files.length&&e.upload(t.target.files)},ref:a}),c.a.createElement("button",{type:"button",className:"btn btn-light",id:"upload",onClick:function(){return a.current.click()}},t.UPLOAD),c.a.createElement("button",{type:"button",className:"btn btn-light big",onClick:l},t["NEW FILE"]),c.a.createElement("button",{type:"button",className:"btn btn-light small",onClick:l,title:t["NEW FILE"]},c.a.createElement(W.a,{icon:"file",className:"icon file"})),c.a.createElement("button",{type:"button",className:"btn btn-light big",onClick:s},t["NEW DIR"]),c.a.createElement("button",{type:"button",className:"btn btn-light small",onClick:s,title:t["NEW DIR"]},c.a.createElement(W.a,{icon:"folder",className:"icon folder-close"})),c.a.createElement("button",{type:"button",className:"btn btn-light big",onClick:f},t.DOWNLOAD),c.a.createElement("button",{type:"button",className:"btn btn-light small",onClick:f,title:t.DOWNLOAD},c.a.createElement(W.a,{icon:"download",className:"icon download"})),c.a.createElement("button",{type:"button",className:"btn btn-light big",onClick:u},t.RENAME),c.a.createElement("button",{type:"button",className:"btn btn-light small",onClick:u,title:t.RENAME},c.a.createElement(W.a,{icon:"italic",className:"icon italic"})),c.a.createElement("button",{type:"button",className:"btn btn-light big",onClick:m},t.RIGHTS),c.a.createElement("button",{type:"button",className:"btn btn-light small",onClick:m,title:t.RIGHTS},c.a.createElement(W.a,{icon:"user",className:"icon user"})),c.a.createElement("button",{type:"button",className:"btn btn-light big",onClick:v},t.COPY),c.a.createElement("button",{type:"button",className:"btn btn-light small",onClick:v,title:t.COPY},c.a.createElement(W.a,{icon:"copy",className:"icon copy"})),c.a.createElement("button",{type:"button",className:"btn btn-light big",onClick:d},t.MOVE),c.a.createElement("button",{type:"button",className:"btn btn-light small",onClick:d,title:t.MOVE},c.a.createElement(W.a,{icon:"paste",className:"icon paste"})),h?null:c.a.createElement("button",{type:"button",className:"btn btn-light big",onClick:E},t.ARCHIVE),h?null:c.a.createElement("button",{type:"button",className:"btn btn-light small",onClick:E,title:t.ARCHIVE},c.a.createElement(W.a,{icon:"book",className:"icon book"})),h?c.a.createElement("button",{type:"button",className:"btn btn-light big",onClick:p},t.EXTRACT):null,h?c.a.createElement("button",{type:"button",className:"btn btn-light small",onClick:p,title:t.EXTRACT},c.a.createElement(W.a,{icon:"box-open",className:"icon open"})):null,c.a.createElement("button",{type:"button",className:"btn btn-light big delete",onClick:i},t.DELETE),c.a.createElement("button",{type:"button",className:"btn btn-light small",onClick:i,title:t.DELETE},c.a.createElement(W.a,{icon:"trash",className:"icon trash"}))))},fe=a(6),be=a.n(fe),he=a(13),ge=a.n(he),Oe=window.location.origin+"/file_manager/fm_api.php?";function Ne(e){return be.a.get(e)}function je(e,t){return be.a.get("".concat(e,"dir=").concat(ke(t),"&action=cd"))}function ye(e){return be.a.get("".concat(Oe,"dir=%2F").concat(e,"&action=cd"))}function ke(e){return e.split("/").join("%2F")}function _e(e,t,a){if(!a.length)return!1;var n=a.map((function(a){return Ne("".concat(e,"item=").concat(t,"%2F").concat(a,"&dir=").concat(t,"&action=delete_files")).then((function(){}))}));return Promise.all(n)}function Se(e,t,a,n){if(!n.length)return!1;var c=n.map((function(n){return Ne("".concat(e,"item=").concat(t,"%2F").concat(n,"&target_name=").concat(a,"&action=move_file")).then((function(){}))}));return Promise.all(c)}function we(e,t,a,n){if(!n.length)return!1;var c=n.map((function(n){return Ne("".concat(e,"item=").concat(t,"%2F").concat(n,"&filename=").concat(n,"&dir=").concat(t,"&dir_target=").concat(a,"&action=copy_file")).then((function(){}))}));return Promise.all(c)}var Ae=a(8),Ce=(a(65),window.location.origin+"/file_manager/fm_api.php?"),De=function(e){Object(L.a)(a,e);var t=Object(U.a)(a);function a(e){var n;return Object(x.a)(this,a),(n=t.call(this,e)).UNSAFE_componentWillMount=function(){if(!n.props.session.userName)return n.props.history.push("/login");!function(e,t,a){var n=ge.a.parse(t.location.search,{ignoreQueryPrefix:!0});if(n.path)return localStorage.setItem("activeWindow","left"),localStorage.setItem("leftListPath",n.path),void localStorage.setItem("rightListPath",n.path);if(null===localStorage.getItem("lastUser")||e!==localStorage.getItem("lastUser"))return localStorage.setItem("lastUser",e),localStorage.setItem("activeWindow","left"),localStorage.setItem("leftListPath",a),void localStorage.setItem("rightListPath",a);if(null===localStorage.getItem("activeWindow")||null===localStorage.getItem("leftListPath")||null===localStorage.getItem("rightListPath")){var c=t.location.search.substring(6).split("/");localStorage.setItem("activeWindow","left"),localStorage.setItem("leftListPath",c),localStorage.setItem("rightListPath",a)}}(n.state.currentUser,n.props.history,n.props.menuCounters.user.HOME);var e="left"===localStorage.getItem("activeWindow")?localStorage.getItem("leftListPath"):"right"===localStorage.getItem("activeWindow")?localStorage.getItem("rightListPath"):void 0;n.setState({currentPath:e,currentUser:n.props.menuCounters.user.HOME,leftList:Object(u.a)(Object(u.a)({},n.state.leftList),{},{path:n.props.menuCounters.user.HOME}),rightList:Object(u.a)(Object(u.a)({},n.state.rightList),{},{path:n.props.menuCounters.user.HOME})}),n.changeDirectoryOnLoading()},n.componentDidMount=function(){window.addEventListener("keydown",n.switchActiveList),window.addEventListener("keydown",n.toggleActiveListOnTab),document.addEventListener("keydown",n.hotkeysListener),localStorage.getItem("activeWindow")&&n.setState({activeWindow:localStorage.getItem("activeWindow")})},n.componentWillUnmount=function(){window.removeEventListener("keydown",n.switchActiveList),window.removeEventListener("keydown",n.toggleActiveListOnTab),document.removeEventListener("keydown",n.hotkeysListener)},n.cachePaths=function(){localStorage.setItem("activeWindow",n.state.activeWindow),localStorage.setItem("leftListPath",n.state.leftList.path),localStorage.setItem("rightListPath",n.state.rightList.path)},n.setStateAsync=function(e){return new Promise((function(t){return n.setState(e,t)}))},n.changeDirectoryOnLoading=Object(F.a)(D.a.mark((function e(){return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return["leftList","rightList"].map(function(){var e=Object(F.a)(D.a.mark((function e(t){var a,c,r;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l=Ce,o="".concat(t,"Path"),be.a.get("".concat(l,"dir=").concat(ke(localStorage.getItem(o)),"&action=cd"));case 2:return a=e.sent,c=localStorage.getItem("".concat(t,"Path")),r=a.data.listing,e.next=7,n.setStateAsync(Object(M.a)({},t,{files:{listing:r},path:c}));case 7:case"end":return e.stop()}var l,o}),e)})));return function(t){return e.apply(this,arguments)}}()),e.next=3,n.setStateAsync({loading:!1});case 3:case"end":return e.stop()}}),e)}))),n.changeDirectory=function(){var e=n.state,t=e.leftList,a=e.rightList;Promise.all([je(Ce,t.path),je(Ce,a.path)]).then((function(e){var c=Object(A.a)(e,2),r=c[0],l=c[1],o=r.data.listing,s=l.data.listing;n.setState({leftList:Object(u.a)(Object(u.a)({},t),{},{files:{listing:o}}),rightList:Object(u.a)(Object(u.a)({},a),{},{files:{listing:s}}),loading:!1}),n.leftList.resetData(),n.rightList.resetData()}))},n.toggleActiveListOnTab=function(e){var t=n.state,a=t.activeWindow,c=t.rightList,r=t.leftList,l=t.currentPath;n.state.modalVisible||9===e.keyCode&&(e.preventDefault(),"left"===a?(n.setState({activeWindow:"right",currentPath:c.path}),n.rightList.passData()):(n.setState({activeWindow:"left",currentPath:r.path}),n.leftList.passData()),n.changeQuery(l),n.cachePaths())},n.passSelection=function(e){n.setState({itemsSelected:e})},n.toggleActiveList=function(e){n.setState({activeWindow:e})},n.switchActiveList=function(e){n.state.modalVisible||(39===e.keyCode?(n.setState({activeWindow:"right",currentPath:n.state.rightList.path}),n.changeQuery(n.state.currentPath),n.rightList.passData(),n.cachePaths()):37===e.keyCode&&(n.setState({activeWindow:"left",currentPath:n.state.leftList.path}),n.changeQuery(n.state.currentPath),n.leftList.passData(),n.cachePaths()))},n.validateAction=function(){var e=Object(F.a)(D.a.mark((function e(t){var a;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.setStateAsync({loading:!0});case 2:return e.next=4,Ne(t);case 4:(a=e.sent).data.result?n.changeDirectory():n.showError(a.data.message);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n.showError=function(e){Q.b.error(e,{position:"top-center",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),n.setState({loading:!1})},n.download=function(){var e=n.state,t=e.cursor,a=e.currentPath,c=e.itemName;0!==t&&window.open("/api/v1/download/file/?path="+a+"/"+c)},n.checkExistingFileName=function(e){var t=n.state,a=t.activeWindow,c=t.leftList,r=t.rightList,l=function(e,t,a,n){for(var c=[],r=[],l=[],o=0;o<e.length;o++)c.push(e[o]);if("left"===t)for(var s=0;s<c.length;s++)a.map((function(e){return e.name})).includes(c[s].name)?r.push(c[s]):l.push(c[s]);else for(var i=0;i<c.length;i++)n.map((function(e){return e.name})).includes(c[i].name)?r.push(c[i]):l.push(c[i]);return{existingFileNames:r,newFiles:l}}(e,a,c.files.listing,r.files.listing),o=l.existingFileNames,s=l.newFiles;0!==o.length?(n.modal("Replace",o),n.upload(s)):n.upload(e)},n.replaceFiles=function(e){for(var t=0;t<e.length;t++)n.validateAction("".concat(Ce,"item=").concat(ke(n.state.currentPath),"%2F").concat(e[t].name,"&dir=").concat(ke(n.state.currentPath),"&action=delete_files"));n.upload(e)},n.upload=function(e){var t=new FormData;if(0!==e.length){for(var a=0;a<e.length;a++)t.append("files[]",e[a],e[a].name);n.setState({loading:!0},(function(){be.a.post("".concat(window.location.origin,"/api/v1/upload/?dir=").concat(n.state.currentPath),t,{onUploadProgress:function(e){var t=Math.round(e.loaded/e.total*100);n.setState({uploadPercent:t})}}).then((function(){n.setState({uploadPercent:"0"}),n.changeDirectory()}))}))}},n.onDelete=Object(F.a)(D.a.mark((function e(){var t,a,c,r;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.state,a=t.itemsSelected,c=t.itemName,r=t.currentPath,!(a.length>0)){e.next=11;break}return e.next=4,n.setStateAsync({loading:!0});case 4:return e.next=6,_e(Ce,ke(r),a);case 6:return e.next=8,n.setStateAsync({itemsSelected:[]});case 8:n.changeDirectory(),e.next=12;break;case 11:n.validateAction("".concat(Ce,"item=").concat(ke(r),"%2F").concat(c,"&dir=").concat(ke(r),"&action=delete_files"));case 12:case"end":return e.stop()}}),e)}))),n.newFile=function(){var e=n.inputElement.value;n.validateAction("".concat(Ce,"filename=").concat(e,"&dir=").concat(ke(n.state.currentPath),"&action=create_file"))},n.newDir=function(){var e=n.inputElement.value;n.validateAction("".concat(Ce,"dirname=").concat(e,"&dir=").concat(ke(n.state.currentPath),"&action=create_dir"))},n.onRename=function(){var e=n.state,t=e.modalInputValue,a=e.itemType,c=e.itemName,r=e.currentPath,l=t;"f"===a?n.validateAction("".concat(Ce,"item=").concat(c,"&target_name=").concat(l,"&dir=").concat(ke(r),"&action=rename_file")):"d"===a&&n.validateAction("".concat(Ce,"item=").concat(c,"&target_name=").concat(l,"&dir=").concat(ke(r),"%2F&action=rename_directory"))},n.onChangePermissions=function(){var e=n.state.modalInputValue;n.validateAction("".concat(Ce,"dir=").concat(ke(n.state.currentPath),"%2F&item=").concat(n.state.itemName,"&permissions=").concat(e,"&action=chmod_item")),n.setState({itemPermissions:e})},n.archiveItem=function(){var e=n.inputElement.value;n.state.itemsSelected.length>0?n.setState({loading:!0},(function(){for(var t=[],a=0;a<n.state.itemsSelected.length;a++){var c="".concat(n.state.currentPath,"/");t.push(c+=n.state.itemsSelected[a])}n.validateAction("".concat(Ce,"items=").concat(t,"&dst_item=").concat(ke(e),"&action=pack_item")),n.setState({itemsSelected:[]})})):n.validateAction("".concat(Ce,"items=").concat(ke(n.state.currentPath),"%2F").concat(n.state.itemName,"&dst_item=").concat(ke(e),"&action=pack_item"))},n.extractItem=function(){var e=n.inputElement.value;n.validateAction("".concat(Ce,"item=").concat(ke(n.state.currentPath),"%2F").concat(n.state.itemName,"&filename=").concat(n.state.itemName,"&dir=").concat(ke(n.state.currentPath),"&dir_target=").concat(e,"&action=unpack_item"))},n.moveItem=Object(F.a)(D.a.mark((function e(){var t,a,c,r,l;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.state,a=t.currentPath,c=t.itemsSelected,r=t.itemName,l=n.inputElement.value,!(c.length>0)){e.next=12;break}return e.next=5,n.setStateAsync({loading:!0});case 5:return e.next=7,Se(Ce,ke(a),l,c);case 7:return e.next=9,n.setStateAsync({itemsSelected:[]});case 9:n.changeDirectory(),e.next=13;break;case 12:n.validateAction("".concat(Ce,"item=").concat(a,"%2F").concat(r,"&target_name=").concat(l,"&action=move_file"));case 13:case"end":return e.stop()}}),e)}))),n.copyItem=Object(F.a)(D.a.mark((function e(){var t,a,c,r,l;return D.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.state,a=t.currentPath,c=t.itemsSelected,r=t.itemName,l=n.inputElement.value,!(c.length>0)){e.next=12;break}return e.next=5,n.setStateAsync({loading:!0});case 5:return e.next=7,we(Ce,ke(a),l,c);case 7:return e.next=9,n.setStateAsync({itemsSelected:[]});case 9:n.changeDirectory(),e.next=13;break;case 12:n.validateAction("".concat(Ce,"item=").concat(a,"%2F").concat(r,"&filename=").concat(r,"&dir=").concat(a,"&dir_target=").concat(l,"&action=copy_file"));case 13:case"end":return e.stop()}}),e)}))),n.changeQuery=function(e){n.props.history.push({pathname:"/list/directory/",search:"?path=".concat(e)})},n.openDirectory=function(){n.setState({loading:!0},(function(){n.changeDirectory(),n.cachePaths()}))},n.openCertainDirectory=function(){n.setState({loading:!0},(function(){n.changeDirectory(),n.cachePaths()}))},n.moveBack=function(){var e,t=n.state.activeWindow,a=Object(u.a)({},n.state["".concat(t,"List")]);a.path=a.path.substring(0,a.path.lastIndexOf("/")),n.setState((e={},Object(M.a)(e,"".concat(t,"List"),a),Object(M.a)(e,"currentPath",a.path),e)),n.props.history.push({search:"?path=".concat(a.path)}),n.openDirectory()},n.addToPath=function(e){var t,a=n.state.activeWindow,c=Object(u.a)({},n.state["".concat(a,"List")]),r=c.path;c.path="".concat(r,"/").concat(e),n.setState((t={},Object(M.a)(t,"".concat(a,"List"),c),Object(M.a)(t,"currentPath",c.path),t))},n.changeInputValue=function(e){n.setState({modalInputValue:e})},n.changePathAfterToggle=function(e){n.setState({currentPath:e})},n.changePath=function(e){"left"===n.state.activeWindow?n.setState({leftList:{files:Object(u.a)({},n.state.leftList.files),path:e},currentPath:e}):n.setState({rightList:{files:Object(u.a)({},n.state.rightList.files),path:e},currentPath:e})},n.passData=function(e,t,a,c){n.setState({cursor:e,itemName:t,itemPermissions:a,itemType:c})},n.closeModal=function(){n.setState({modalVisible:!1})},n.hotkeysListener=function(e){n.state.modalVisible||72===e.keyCode&&n.hotkeys()},n.hotkeys=function(){"inactive"===n.state.hotkeysPanel?n.setState({hotkeysPanel:"active"}):n.setState({hotkeysPanel:"inactive"})},n.modal=function(e,t,a){var r=n.state,l=r.modalVisible,o=r.itemName,s=r.itemPermissions,i=r.currentPath;switch(e){case"Copy":return n.setState({modalWindow:c.a.createElement(Ee,{modalVisible:l,type:e,fName:o,path:i,onClick:n.copyItem,items:t,onClose:n.closeModal,onChangeValue:n.changeInputValue,reference:function(e){return n.inputElement=e}}),modalVisible:!0});case"Move":return n.setState({modalWindow:c.a.createElement(Ee,{modalVisible:l,type:e,fName:o,path:i,onClick:n.moveItem,items:t,onClose:n.closeModal,onChangeValue:n.changeInputValue,reference:function(e){return n.inputElement=e}}),modalVisible:!0});case"Extract":return n.setState({modalWindow:c.a.createElement(Ee,{modalVisible:l,type:e,fName:o,onClick:n.extractItem,onClose:n.closeModal,onChangeValue:n.changeInputValue,path:i,reference:function(e){return n.inputElement=e}}),modalVisible:!0});case"Archive":return n.setState({modalWindow:c.a.createElement(Ee,{modalVisible:l,type:e,fName:o,onClick:n.archiveItem,items:t,onClose:n.closeModal,onChangeValue:n.changeInputValue,path:i,reference:function(e){return n.inputElement=e}}),modalVisible:!0});case"Permissions":return n.setState({modalWindow:c.a.createElement(Ee,{modalVisible:l,type:e,fName:o,onClick:n.onChangePermissions,onClose:n.closeModal,onChangePermissions:n.changeInputValue,permissions:s}),modalVisible:!0});case"Rename":return n.setState({modalWindow:c.a.createElement(Ee,{modalVisible:l,type:e,fName:o,onChangeValue:n.changeInputValue,onClick:n.onRename,onClose:n.closeModal,reference:function(e){return n.inputElement=e}}),modalVisible:!0});case"Add directory":return n.setState({modalWindow:c.a.createElement(Ee,{modalVisible:l,type:e,onClick:n.newDir,onClose:n.closeModal,reference:function(e){return n.inputElement=e}}),modalVisible:!0});case"Add file":return n.setState({modalWindow:c.a.createElement(Ee,{modalVisible:l,type:e,onClick:n.newFile,onClose:n.closeModal,reference:function(e){return n.inputElement=e}}),modalVisible:!0});case"Delete":return n.setState({modalWindow:c.a.createElement(Ee,{modalVisible:l,type:e,fName:o,onClick:n.onDelete,onClose:n.closeModal,items:t}),modalVisible:!0});case"Nothing selected":return n.setState({modalWindow:c.a.createElement(Ee,{modalVisible:l,notAvailable:a,type:e,onClose:n.closeModal,onClick:n.closeModal}),modalVisible:!0});case"Replace":return n.setState({modalWindow:c.a.createElement(Ee,{modalVisible:l,type:e,files:t,onClick:function(e){return n.replaceFiles(e)},onClose:n.closeModal}),modalVisible:!0})}},n.state={leftList:{path:"",files:{listing:[]}},rightList:{path:"",files:{listing:[]}},currentPath:"",currentUser:"",activeWindow:"left",modalWindow:null,modalVisible:!1,cursor:0,itemName:"",itemPermissions:"",itemType:"",itemsSelected:[],modalInputValue:"",uploadPercent:"0",loading:!1},n}return Object(T.a)(a,[{key:"render",value:function(){var e=this,t=this.state,a=t.activeWindow,n=t.modalWindow,r=t.modalVisible,l=t.itemsSelected,o=t.itemName,s=t.loading,i=t.uploadPercent,u=t.itemType;return c.a.createElement("div",{className:"window"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,this.props.session.i18n["File Manager"])),"0"!==i&&c.a.createElement(G,{progress:i}),c.a.createElement(Q.a,null),c.a.createElement(ve,{onDelete:this.onDeleteFileHandler,modalVisible:r,download:this.download,openModal:this.modal,selection:l,itemType:u,upload:this.checkExistingFileName,cursor:this.state.cursor,name:o}),c.a.createElement("div",{className:"lists-container"},this.props.session.userName&&["left","right"].map((function(t){return c.a.createElement(Y,{changePathAfterToggle:e.changePathAfterToggle,openCertainDirectory:e.openCertainDirectory,isActive:a===t,openDirectory:e.openDirectory,passSelection:e.passSelection,data:e.state["".concat(t,"List")].files,onClick:e.toggleActiveList,changePath:e.changePath,modalVisible:r,addToPath:e.addToPath,cursor:e.state.cursor,passData:e.passData,rootDir:e.props.menuCounters.user.HOME,ref:function(a){return e["".concat(t,"List")]=a},download:e.download,moveBack:e.moveBack,path:e.state["".concat(t,"List")].path,history:e.props.history,loading:s,list:t})})),c.a.createElement("div",{className:"fixed-buttons fm"},c.a.createElement("div",{className:"hotkey-button"},c.a.createElement("button",{onClick:function(){return e.hotkeysList.classList.toggle("hide")}},c.a.createElement(W.a,{icon:"ellipsis-h"})))),c.a.createElement(X,{reference:function(t){return e.hotkeysList=t},toggleHotkeys:function(){return e.hotkeysList.classList.toggle("hide")}})),r&&n)}}]),a}(n.Component);var Me=Object(o.b)((function(e){return{session:e.session,menuCounters:e.menuCounters}}))(Object(R.i)(De)),Fe=a(94),xe=a.n(Fe),Te=(a(146),a(147),a(67),a(148),a(150),a(70),a(69),function(e){var t=e.close,a=e.name,r=Object(o.d)((function(e){return e.session})).i18n,l=Object(R.g)(),s=Object(n.useState)({code:"",loading:!1}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){document.addEventListener("keydown",v);var e="".concat(l.location.search.substring(6,l.location.search.lastIndexOf("/")),"/").concat(a);return d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),E(e).then((function(t){t.data.result?be.a.get("".concat(window.location.origin,"/api/v1/edit/file/?path=").concat(p(e))).then((function(e){if(e.data.error)return b(t.data.error);d(Object(u.a)(Object(u.a)({},m),{},{code:e.data.content,loading:!1}))})).catch((function(e){return console.error(e)})):console.error("Something went wrong with file type!")})).catch((function(e){return console.error(e)})),function(){document.removeEventListener("keydown",v)}}),[]);var E=function(e){return be.a.get("".concat(window.location.origin,"/file_manager/fm_api.php?dir=").concat(e,"&action=check_file_type"))},p=function(e){return e.split("/").join("%2F")},v=function(e){113===e.keyCode&&f()},f=function(){var e=new FormData,t=l.location.search.substring(6,l.location.search.lastIndexOf("/"));e.append("save","Save"),e.append("contents",m.code),d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),be.a.post("".concat(window.location.origin,"/api/v1/edit/file/?path=").concat(t,"%2F").concat(a),e).then((function(e){e.data.error?b(e.data.error):b("Saved successfully!"),d(Object(u.a)(Object(u.a)({},m),{},{loading:!1}))})).catch((function(e){return console.error(e)}))},b=function(e){Q.b.success(e,{position:"top-center",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0})},h={mode:function(){switch(a.split(".").pop()){case"js":case"jsx":return"javascript";case"php":return"php";case"css":case"scss":return"css";case"html":return"htmlmixed";default:return"markdown"}}(),lineNumbers:!0};return c.a.createElement("div",{className:"editor"},c.a.createElement(Q.a,null),c.a.createElement("div",{className:"panel-editor"},c.a.createElement("button",{type:"button",className:"btn btn-primary",onClick:f},r.Save),c.a.createElement("button",{type:"button",className:"btn btn-danger",onClick:t},r.Close)),m.loading?c.a.createElement(P,null):c.a.createElement(xe.a,{value:m.code,onChange:function(e){d(Object(u.a)(Object(u.a)({},m),{},{code:e}))},options:h,autoFocus:!0}))}),Le=(a(152),function(e){Object(L.a)(a,e);var t=Object(U.a)(a);function a(){var e;Object(x.a)(this,a);for(var n=arguments.length,r=new Array(n),l=0;l<n;l++)r[l]=arguments[l];return(e=t.call.apply(t,[this].concat(r))).state={activeSlide:0,photoGallery:[],loading:!1},e.imgClass=function(e){return e.match(/.gif/i)?"gif":"img"},e.encodePath=function(e){var t=e.split("/");return t.splice(t.length-1,1),t.splice(0,1),t.join("%2F")},e.formatPath=function(e){var t=e.split("/");return t.splice(t.length-1,1),t.join("/")},e.carouselIndicators=function(){return e.state.photoGallery.map((function(t,a){var n=ce()({"control-photo":!0,active:a===e.state.activeSlide});return c.a.createElement("div",{"data-target":"#photoGallery","data-slide-to":a,key:a,className:"indicator"},c.a.createElement("img",{src:"".concat(window.location.origin,"/api/v1/view/file/").concat(e.formatPath(e.props.path),"/").concat(t,"&raw=true"),alt:a,className:n}))}))},e.carouselPhotos=function(){return(e.state.photoGallery||[]).map((function(t,a){return c.a.createElement("div",{className:a===e.state.activeSlide?"carousel-item active":"carousel-item",key:a},c.a.createElement("div",{className:"d-flex align-items-center justify-content-center min-vh-100"},c.a.createElement("img",{className:e.imgClass(t),src:"".concat(window.location.origin,"/api/v1/view/file/").concat(e.formatPath(e.props.path),"/").concat(t,"&raw=true"),alt:a})))}))},e.setStateAsync=function(t){return new Promise((function(a){return e.setState(t,a)}))},e.setPhotoGallery=Object(F.a)(D.a.mark((function t(){var a,n;return D.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.setStateAsync({loading:!0});case 2:return t.next=4,ye(e.encodePath(e.props.path));case 4:return a=t.sent,n=Object(I.a)(e.state.photoGallery),a.data.listing.filter((function(e){return e.name.match(/.png|.jpg|.jpeg|.gif/g)&&!e.name.match(/.zip|.tgz|.tar.gz|.gzip|.tbz|.tar.bz|.gz|.zip|.tar|.rar/g)?n.push(e.name):null})),t.next=9,e.setStateAsync({photoGallery:n,loading:!1});case 9:e.setActiveImage();case 10:case"end":return t.stop()}}),t)}))),e.setActiveImage=function(){var t=e.props.activeImage,a=e.state.photoGallery.indexOf(t);e.setState({activeSlide:a})},e}return Object(T.a)(a,[{key:"componentDidMount",value:function(){this.setPhotoGallery()}},{key:"render",value:function(){return c.a.createElement("div",null,this.state.loading?c.a.createElement(P,null):c.a.createElement("div",{id:"photoGallery",className:"carousel slide","data-ride":"carousel"},c.a.createElement("span",{className:"close",onClick:this.props.close},"\xd7"),c.a.createElement("div",{className:"carousel-inner"},this.carouselPhotos()),c.a.createElement("div",{className:"carousel-indicators"},this.carouselIndicators()),c.a.createElement("a",{className:"carousel-control-prev",href:"#photoGallery",role:"button","data-slide":"prev"},c.a.createElement("span",{className:"carousel-control-prev-icon","aria-hidden":"true"}),c.a.createElement("span",{className:"sr-only"},"Previous")),c.a.createElement("a",{className:"carousel-control-next",href:"#photoGallery",role:"button","data-slide":"next"},c.a.createElement("span",{className:"carousel-control-next-icon","aria-hidden":"true"}),c.a.createElement("span",{className:"sr-only"},"Next"))))}}]),a}(n.Component)),Ue=(a(153),function(e){return c.a.createElement("div",{className:"video-preview"},c.a.createElement("span",{className:"close",onClick:e.closeModal},"\xd7"),c.a.createElement("video",{className:"video",autoPlay:!0,loop:!0,controls:!0},c.a.createElement("source",{src:"",type:"video/mp4"})))}),Ie=function(e){var t=Object(o.d)((function(e){return e.session})).userName,a=Object(R.g)();Object(n.useEffect)((function(){return t||a.push("/login"),document.addEventListener("keydown",r),function(){document.removeEventListener("keydown",r)}}),[]);var r=function(e){121===e.keyCode&&l()},l=function(){var e=a.location.search.substring(6,a.location.search.lastIndexOf("/"));a.push({pathname:"/list/directory",search:"?path=".concat(e)})};return c.a.createElement("div",null,function(){var e=a.location.search.split("/"),t=e[e.length-1];if("/list/directory/preview/"===a.location.pathname)return t.match(".mp4")?c.a.createElement(Ue,{closeModal:l}):t.match(/png|jpg|jpeg|gif/g)?c.a.createElement(Le,{closeModal:l,close:l,path:a.location.search,activeImage:t}):c.a.createElement(Te,{close:l,name:t})}())},Pe=a(42),Re=a(12),Ve=(a(154),a(155),function(e){return{type:"ADD_FOCUSED_ELEMENT",value:e}}),Be=function(e){return{type:"ADD_ACTIVE_ELEMENT",value:e}},We=a(11),qe=function(e){return localStorage.setItem("token",e)},He=function(){return localStorage.getItem("token")},Ke=window.location.origin,Je=function(e){var t=e.options,a=void 0===t?[]:t,n=e.id,r=e.name,l=e.title,s=e.optionalTitle,i=void 0===s?"":s,u=e.selected,m=void 0===u?"":u,d=e.onChange,E=void 0===d?function(){}:d,p=e.disabled,v=void 0!==p&&p,f=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement(c.a.Fragment,null,a?c.a.createElement("div",{className:"form-group select-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:n},l,c.a.createElement("span",null,i)),c.a.createElement("select",{className:"form-control",id:n,name:r,disabled:v,onChange:function(e){return E(e.target.value)}},v&&c.a.createElement("input",{type:"hidden",name:r,value:m||a[0]}),a.map((function(e,t){return c.a.createElement("option",{key:t,selected:m===e,value:e===f["Disable and Cancel Licence"]?"cancel":e},e)})))):null)},ze=function(e){var t=e.id,a=e.name,r=e.title,l=e.optionalTitle,o=void 0===l?"":l,s=e.type,i=void 0===s?"text":s,u=e.onChange,m=void 0===u?function(){}:u,d=e.value,E=void 0===d?"":d,p=e.disabled,v=void 0!==p&&p,f=Object(n.useState)(""),b=Object(A.a)(f,2),h=b[0],g=b[1];Object(n.useEffect)((function(){E&&g(E)}),[E]);return c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:t},r,c.a.createElement("span",null,o)),c.a.createElement("input",{type:i,name:a,id:t,onChange:function(e){g(e.target.value),m(e)},readOnly:v,value:h,className:"form-control"}))},Ye=function(e){var t=e.name,a=e.id,r=e.title,l=e.defaultChecked,o=void 0!==l&&l,s=e.onChange,i=void 0===s?function(){}:s,u=e.checked,m=Object(n.useState)(o),d=Object(A.a)(m,2),E=d[0],p=d[1];Object(n.useEffect)((function(){p(u)}),[u]);return c.a.createElement("div",{className:"form-group"},c.a.createElement("div",{className:"checkbox-wrapper"},c.a.createElement("input",{type:"checkbox",name:t,id:a,checked:E,onChange:function(e){p(e.target.checked),i(e.target.checked)},defaultChecked:o}),c.a.createElement("label",{htmlFor:a},r)))},Ge=(a(158),function(e){return c.a.createElement("div",{className:e.className},e.children)}),Qe=(a(71),function(e){var t=e.date,a=void 0===t?"":t,n=e.time,r=void 0===n?"":n,l=e.status,o=void 0===l?"":l,s=e.children;return c.a.createElement("div",{className:"edit-item"},c.a.createElement(Ge,{className:"l-col w-14"},function(){if(a.length>0){var e=new Date(a),t=e.getDate(),n=e.getMonth(),r=e.getFullYear();return c.a.createElement("div",{className:"date"},t," \xa0 ",["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n]," \xa0 ",r)}}(),c.a.createElement("div",{className:"time"},r),c.a.createElement("div",{className:"status uppercase"},o)),s)}),Xe=(a(159),function(e){var t=Object(n.useState)(185),a=Object(A.a)(t,2),r=a[0],l=a[1];Object(n.useEffect)((function(){return window.addEventListener("resize",o),document.addEventListener("scroll",s),function(){window.removeEventListener("resize",o),document.removeEventListener("scroll",s)}}),[]);var o=function(){document.documentElement.clientWidth<900?l(95):l(185)},s=function(){if(document.documentElement.clientWidth>900){var e=window.scrollY,t=Math.max(95,185-e);l(t)}};return c.a.createElement("div",{className:function(){var t=e.className;return"justify-right"===t?95===r?"toolbar t-shadow "+t:"toolbar "+t:95===r?"toolbar t-shadow":"toolbar"}(),style:function(){if(!e.mobile)return document.documentElement.clientWidth>900?{marginTop:r}:{marginTop:33}}(),id:"v-toolbar"},e.children)}),Ze=(a(160),window.location.origin),$e=function(){var e="/api/v1/login/index.php",t=He();return t&&(e+="?token=".concat(t)),be.a.get("".concat(Ze).concat(e))},et=function(){return function(e,t){return new Promise((function(t,a){$e().then((function(a){var n=a.data,c=n.data,r=n.token,l=n.panel;r&&qe(r),e({type:"REFRESH_COUNTERS",value:{user:c}}),e({type:"REFRESH_PANEL",value:{panel:l}}),t(r)})).catch((function(e){a(),console.error(e)}))}))}},tt=a(10),at=a.n(tt),nt=function(){var e=localStorage.getItem("token"),t=Object(o.d)((function(e){return e.session})).i18n,a=Object(R.g)(),r=Object(o.c)(),l=Object(n.useState)(""),s=Object(A.a)(l,2),i=s[0],m=s[1],d=Object(n.useState)(""),E=Object(A.a)(d,2),p=E[0],v=E[1],f=Object(n.useState)({data:{},loading:!1,dedicated:!1}),b=Object(A.a)(f,2),h=b[0],g=b[1];Object(n.useEffect)((function(){var e=ge.a.parse(a.location.search,{ignoreQueryPrefix:!0}).ip;r(Be("/list/ip/")),r({type:"REMOVE_FOCUSED_ELEMENT",value:""}),e&&(g(Object(u.a)(Object(u.a)({},h),{},{loading:!0})),O(e))}),[]);var O=function(e){(function(e){return be.a.get(Ke+"/api/v1/edit/ip/index.php",{params:{ip:e,token:He()}})})(e).then((function(e){g(Object(u.a)(Object(u.a)({},h),{},{data:e.data,dedicated:!e.data.dedicated,loading:!1}))})).catch((function(e){g(Object(u.a)(Object(u.a)({},h),{},{loading:!1})),console.error(e)}))},N=function(t){t.preventDefault();var a,n={},c=Object(We.a)(new FormData(t.target).entries());try{for(c.s();!(a=c.n()).done;){var l=Object(A.a)(a.value,2),o=l[0],s=l[1];n[o]=s}}catch(i){c.e(i)}finally{c.f()}n.token=e,n.save="save",n.v_ip=h.data.ip,0!==Object.keys(n).length&&n.constructor===Object&&(g(Object(u.a)(Object(u.a)({},h),{},{loading:!0})),function(e,t){var a=new FormData;for(var n in e)a.append(n,e[n]);return be.a.post(Ke+"/api/v1/edit/ip/index.php",a,{params:{ip:t,token:He()}})}(n,h.data.ip).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(m(a),v("")):r(et()).then((function(){m(""),v(n)}))}})).then((function(){return O(h.data.ip)})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template edit-ip"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.IP))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},t["Editing IP Address"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},i?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",i)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},p?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(p))))),c.a.createElement(Qe,{date:h.data.date,time:h.data.time,status:h.data.status},h.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return N(e)},id:"edit-ip"},c.a.createElement(ze,{id:"type",name:"v_ip",title:t["IP address"],value:h.data.ip,disabled:!0}),c.a.createElement(ze,{id:"type",name:"v_netmask",title:t.Netmask,value:h.data.netmask,disabled:!0}),c.a.createElement(ze,{id:"type",name:"v_interface",title:t.Interface,value:h.data.interface,disabled:!0}),c.a.createElement(Ye,{onChange:function(e){g(Object(u.a)(Object(u.a)({},h),{},{dedicated:e}))},name:"v_shared",id:"shared",title:t.Shared,defaultChecked:h.dedicated}),!h.dedicated&&c.a.createElement("div",{className:"dedicated-form-group"},c.a.createElement(Je,{options:h.data.users,selected:h.data.owner,title:t["Assigned user"],name:"v_owner",id:"owner"})),c.a.createElement(ze,{id:"type",name:"v_name",title:t["Assigned domain"],value:h.data.name,optionalTitle:t.optional}),c.a.createElement(ze,{id:"type",name:"v_nat",title:t["NAT IP association"],value:h.data.nat,optionalTitle:t.optional}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},t.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return a.push("/list/ip/")}},t.Back)))))},ct=(a(203),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})),r=a.i18n,l=a.userName,s=Object(o.c)(),i=Object(R.g)(),m=Object(n.useState)({loading:!1,dedicated:!0,okMessage:"",errorMessage:"",interfaces:[],users:[]}),d=Object(A.a)(m,2),E=d[0],p=d[1];Object(n.useEffect)((function(){s(Be("/list/ip/")),s({type:"REMOVE_FOCUSED_ELEMENT",value:""}),p(Object(u.a)(Object(u.a)({},E),{},{loading:!0})),f()}),[]);var v=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(p(Object(u.a)(Object(u.a)({},E),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.post(Ke+"/api/v1/add/ip/index.php",t)}(a).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?p(Object(u.a)(Object(u.a)({},E),{},{errorMessage:a,okMessage:n,loading:!1})):s(et()).then((function(){p(Object(u.a)(Object(u.a)({},E),{},{okMessage:n,errorMessage:"",loading:!1}))}))}})).catch((function(e){return console.error(e)})))},f=function(){be.a.get(Ke+"/api/v1/add/ip/index.php").then((function(e){p(Object(u.a)(Object(u.a)({},E),{},{interfaces:e.data.interfaces,users:e.data.users,loading:!1}))})).catch((function(e){return console.error(e)}))};return c.a.createElement("div",{className:"edit-template add-ip"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(r.IP))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},r["Adding Package"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},E.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",E.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},E.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",c.a.createElement("span",null,at()(E.okMessage))))),c.a.createElement(Qe,null,E.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return v(e)}},c.a.createElement("input",{type:"hidden",name:"ok",value:"add"}),c.a.createElement("input",{type:"hidden",name:"v_owner",value:l}),c.a.createElement("input",{type:"hidden",name:"token",value:t}),c.a.createElement(ze,{name:"v_ip",id:"ipAddress",title:r["IP address"]}),c.a.createElement(ze,{name:"v_netmask",id:"netmask",title:r.Netmask}),c.a.createElement(Je,{options:E.interfaces,name:"v_interface",id:"interfaces",title:r.Interface}),c.a.createElement(Ye,{onChange:function(e){p(Object(u.a)(Object(u.a)({},E),{},{dedicated:e}))},name:"v_shared",id:"shared",title:r.Shared,defaultChecked:E.dedicated}),E.dedicated?null:c.a.createElement("div",{className:"assigned-user"},c.a.createElement(Je,{options:E.users,name:"v_owner",id:"users",title:r["Assigned user"]})),c.a.createElement(ze,{name:"v_name",id:"name",title:r["Assigned domain"],optionalTitle:r.optional}),c.a.createElement(ze,{name:"v_nat",id:"nat",title:r["NAT IP association"],optionalTitle:r.optional}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},r.Add),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return i.push("/list/ip/")}},r.Back)))))}),rt=function(e){var t=e.id,a=e.name,n=e.defaultValue,r=void 0===n?"":n,l=e.title,o=e.optionalTitle,s=void 0===o?"":o,i=e.rows,u=void 0===i?"3":i,m=e.disabled,d=void 0!==m&&m,E=Object(w.a)(e,["id","name","defaultValue","title","optionalTitle","rows","disabled"]);return c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:t},l,c.a.createElement("span",null,s)),c.a.createElement("textarea",Object.assign({className:"form-control",id:t,rows:u,name:a,readOnly:d,defaultValue:r},E)))},lt=window.location.origin,ot=function(e){return be.a.get(lt+e,{params:{token:He()}})},st=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=new FormData;for(var n in e)a.append(n,e[n]);return be.a.post(lt+"/api/v1/edit/server/".concat(t,"/index.php"),a,{params:{token:He()}})},it=function(e){return be.a.get("".concat(lt,"/api/v1/edit/server/").concat(e,"/index.php"))},ut=["apache2","clamd","cron","crond","exim","exim4","fail2ban","iptables","mariadb","mysqld","named","php-fpm","php5-fpm","proftpd","spamassassin","spamd","vsftpd"],mt=(a(204),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(R.g)(),l=Object(o.c)(),s=Object(n.useState)(""),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)(""),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)(!0),h=Object(A.a)(b,2),g=h[0],O=h[1],N=Object(n.useState)({data:{},loading:!1,basicOptions:!0,advancedOptions:!1}),j=Object(A.a)(N,2),y=j[0],k=j[1];Object(n.useEffect)((function(){l(Be("/list/server/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),k(Object(u.a)(Object(u.a)({},y),{},{loading:!0})),_()}),[]);var _=function(){it("nginx").then((function(e){k(Object(u.a)(Object(u.a)({},y),{},{data:e.data,loading:!1}))})).catch((function(e){k(Object(u.a)(Object(u.a)({},y),{},{loading:!1})),console.error(e)}))},S=function(){k(Object(u.a)(Object(u.a)({},y),{},{advancedOptions:!y.advancedOptions,basicOptions:!y.basicOptions}))},w=function(e){var t=e.id,a=e.value;if(a){var n=new RegExp("(".concat(t,")(.+)(").concat(y.data[t],")"),"gm"),c=y.data.config.replace(n,"$1$2".concat(a));k(Object(u.a)(Object(u.a)({},y),{},{data:Object(u.a)(Object(u.a)({},y.data),{},Object(M.a)({config:c},t,a))}))}};return c.a.createElement("div",{className:"edit-template edit-nginx"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.SERVER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},a["Configuring Server"]," / ",y.data.service_name),c.a.createElement("div",{className:"link"},c.a.createElement(pe.b,{to:"/edit/server/php"},a.Configure," php.ini")),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",m)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},v?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(v))))),c.a.createElement(Qe,null,y.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(k(Object(u.a)(Object(u.a)({},y),{},{loading:!0})),a.v_config=y.data.config,a.v_restart=g?"yes":"no",st(a,"/nginx").then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(d(a),f("")):(d(""),f(n))}})).then((function(){return _()})).catch((function(e){return console.error(e)})))}(e)},id:"edit-mail"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:t}),!y.basicOptions&&c.a.createElement("button",{type:"button",onClick:function(){return S()}},a["Basic options"],y.basicOptions?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),y.basicOptions&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ze,{id:"worker_processes",title:"worker_processes",name:"v_worker_processes",onChange:function(e){return w(e.target)},value:y.data.worker_processes}),c.a.createElement(ze,{id:"worker_connections",title:"worker_connections",name:"v_worker_connections",onChange:function(e){return w(e.target)},value:y.data.worker_connections}),c.a.createElement(ze,{id:"client_max_body_size",title:"client_max_body_size",name:"v_client_max_body_size",onChange:function(e){return w(e.target)},value:y.data.client_max_body_size}),c.a.createElement(ze,{id:"send_timeout",title:"send_timeout",name:"v_send_timeout",onChange:function(e){return w(e.target)},value:y.data.send_timeout}),c.a.createElement(ze,{id:"proxy_connect_timeout",title:"proxy_connect_timeout",name:"v_proxy_connect_timeout",onChange:function(e){return w(e.target)},value:y.data.proxy_connect_timeout}),c.a.createElement(ze,{id:"proxy_send_timeout",title:"proxy_send_timeout",name:"v_proxy_send_timeout",onChange:function(e){return w(e.target)},value:y.data.proxy_send_timeout}),c.a.createElement(ze,{id:"proxy_read_timeout",title:"proxy_read_timeout",name:"v_proxy_read_timeout",onChange:function(e){return w(e.target)},value:y.data.proxy_read_timeout}),c.a.createElement(ze,{id:"gzip",title:"gzip",name:"v_gzip",onChange:function(e){return w(e.target)},value:y.data.gzip}),c.a.createElement(ze,{id:"gzip_comp_level",title:"gzip_comp_level",name:"v_gzip_comp_level",onChange:function(e){return w(e.target)},value:y.data.gzip_comp_level}),c.a.createElement(ze,{id:"charset",title:"charset",name:"v_charset",onChange:function(e){return w(e.target)},value:y.data.charset})),!y.advancedOptions&&c.a.createElement("button",{type:"button",onClick:function(){return S()}},a["Advanced options"],y.advancedOptions?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),c.a.createElement("br",null),c.a.createElement("br",null),y.advancedOptions&&c.a.createElement(c.a.Fragment,null,c.a.createElement(rt,{defaultValue:y.data.config,title:y.data.config_path,onChange:function(e){return k(Object(u.a)(Object(u.a)({},y),{},{data:Object(u.a)(Object(u.a)({},y.data),{},{config:e.target.value})}))},name:"v_config",id:"v_config",rows:"25"}),c.a.createElement("br",null),c.a.createElement(Ye,{title:a.restart,defaultChecked:!0,onChange:function(e){return O(e)},name:"v_restart",id:"restart"})),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return r.push("/list/server/")}},a.Back)))))}),dt=(a(205),function(){var e=localStorage.getItem("token"),t=Object(o.d)((function(e){return e.session})).i18n,a=Object(R.g)(),r=Object(o.c)(),l=Object(n.useState)(""),s=Object(A.a)(l,2),i=s[0],m=s[1],d=Object(n.useState)(""),E=Object(A.a)(d,2),p=E[0],v=E[1],f=Object(n.useState)({data:{},loading:!1}),b=Object(A.a)(f,2),h=b[0],g=b[1];Object(n.useEffect)((function(){r(Be("/list/server/")),r({type:"REMOVE_FOCUSED_ELEMENT",value:""}),g(Object(u.a)(Object(u.a)({},h),{},{loading:!0})),O()}),[]);var O=function(){it("postgresql").then((function(e){e.data.config||a.push("/list/server"),g(Object(u.a)(Object(u.a)({},h),{},{data:e.data,loading:!1}))})).catch((function(e){g(Object(u.a)(Object(u.a)({},h),{},{loading:!1})),console.error(e)}))};return c.a.createElement("div",{className:"edit-template edit-pgsql"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.SERVER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},t["Configuring Server"]," / ",h.data.service_name),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},i?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",i)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},p?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(p))))),c.a.createElement(Qe,null,h.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(g(Object(u.a)(Object(u.a)({},h),{},{loading:!0})),st(a,"/postgresql").then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;m(a||""),v(n||"")}})).then((function(){return O()})).catch((function(e){return console.error(e)})))}(e)},id:"edit-pgsql"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:e}),c.a.createElement(rt,{defaultValue:h.data.options,title:h.data.options_path,name:"v_options",id:"v_options",rows:"10"}),c.a.createElement("br",null),c.a.createElement(rt,{defaultValue:h.data.config,title:h.data.config_path,name:"v_config",id:"v_config",rows:"10"}),c.a.createElement("br",null),c.a.createElement(Ye,{title:t.restart,defaultChecked:!0,name:"v_restart",id:"restart"}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},t.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return a.push("/list/server/")}},t.Back)))))}),Et=window.location.origin,pt=(a(206),function(){var e=localStorage.getItem("token"),t=Object(o.d)((function(e){return e.session})).i18n,a=Object(R.g)(),r=Object(o.c)(),l=Object(n.useState)(""),s=Object(A.a)(l,2),i=s[0],m=s[1],d=Object(n.useState)(""),E=Object(A.a)(d,2),p=E[0],v=E[1],f=Object(n.useState)({data:{},loading:!1}),b=Object(A.a)(f,2),h=b[0],g=b[1];Object(n.useEffect)((function(){r(Be("/list/backup/")),r({type:"REMOVE_FOCUSED_ELEMENT",value:""}),g(Object(u.a)(Object(u.a)({},h),{},{loading:!0})),O()}),[]);var O=function(){be.a.get(Et+"".concat("/api/v1/edit/backup/exclusions/index.php")).then((function(e){g(Object(u.a)(Object(u.a)({},h),{},{data:e.data,loading:!1}))})).catch((function(e){return console.error(e)}))},N=function(t){t.preventDefault();var a,n={},c=Object(We.a)(new FormData(t.target).entries());try{for(c.s();!(a=c.n()).done;){var r=Object(A.a)(a.value,2),l=r[0],o=r[1];n[l]=o}}catch(s){c.e(s)}finally{c.f()}n.token=e,n.save="save",0!==Object.keys(n).length&&n.constructor===Object&&(g(Object(u.a)(Object(u.a)({},h),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.post(Et+"/api/v1/edit/backup/exclusions/index.php",t,{params:{token:He()}})}(n).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;m(a||""),v(n||"")}})).then((function(){return O()})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template edit-backup-exclusions"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.BACKUP))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},t["Editing Backup Exclusions"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},i?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",i)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},p?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(p))))),c.a.createElement(Qe,null,h.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return N(e)},id:"edit-backup-exclusions"},c.a.createElement(rt,{title:t["Web Domains"],defaultValue:h.data.web,name:"v_web",id:"v_web"}),c.a.createElement(rt,{title:t["Mail Domains"],defaultValue:h.data.mail,name:"v_mail",id:"v_mail"}),c.a.createElement(rt,{title:t.Databases,defaultValue:h.data.db,name:"v_db",id:"v_db"}),c.a.createElement(rt,{title:t["User Directories"],defaultValue:h.data.userdir,name:"v_userdir",id:"v_userdir"}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},t.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return a.push("/list/backup/exclusions")}},t.Back)))))}),vt=function(e){return{type:"ADD_CPANEL_FOCUSED_ELEMENT",value:e}},ft=(a(207),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a={usersList:[t.Date,t.Username,t.Disk,t.Bandwidth,t.Starred],webList:[t.Date,t.Domain,t["IP Addresses"],t.Disk,t.Bandwidth,t.Starred],dnsList:[t.Date,t.Expire,t.Domain,t["IP Addresses"],t.Records,t.Starred],mailList:[t.Date,t.Domain,t.Accounts,t.Disk,t.Starred],mailAccountList:[t.Date,t.Accounts,t.Disk,t.Starred],dbList:[t.Date,t.Database,t.Disk,t.User,t.Host,t.Starred],cronList:[t.Date,t.Command,t.Starred],packagesList:[t.Date,t["Package Name"],t.Starred],internetProtocolsList:[t.Date,t.IP,t.Netmask,t.Interface,t.Domain,t.Owner,t.Starred],firewallList:[t.Action,t.Protocol,t.Port,t["IP Addresses"],t.Comment,t.Starred],searchList:[t.Date,t.Name,t.Starred]},n=function(t,a){e.changeSorting(t,a)},r=function(t,a){return e.sorting===t&&e.order===a?"dropdown-item active":"dropdown-item"};return c.a.createElement("div",{className:"btn-group"},c.a.createElement("button",{className:"btn btn-sm btn-outline-secondary dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},t["sort by"],": ",c.a.createElement("b",null,e.sorting),"descending"===e.order?c.a.createElement("span",{className:"arrow-down"},"\u2193"):c.a.createElement("span",null,"\u2191")),c.a.createElement("div",{className:"dropdown-menu"},c.a.createElement("ul",{className:"dropdown-list"},function(){var t=e.list;return a[t].map((function(e,t){return c.a.createElement("li",{key:t},c.a.createElement("span",{className:r(e,"descending"),onClick:function(){return n(e,"descending")}},e,c.a.createElement("span",{className:"arrow-down"},"\u2193")),c.a.createElement("span",{className:r(e,"ascending"),onClick:function(){return n(e,"ascending")}},c.a.createElement("span",null,"\u2191")))}))}())))}),bt=(a(208),function(e){var t=Object(n.useState)(""),a=Object(A.a)(t,2),r=a[0],l=a[1],o=Object(n.useRef)(null),s=function(){if(r&&""!==r)return e.handleSearchTerm(r)};Object(n.useEffect)((function(){return window.addEventListener("keyup",i),function(){return window.removeEventListener("keyup",i)}}),[]);var i=function(e){if(70===e.keyCode)return o.current.focus()};return c.a.createElement("form",{onSubmit:function(e){e.preventDefault(),r&&s()}},c.a.createElement("div",{className:"search-input-form"},c.a.createElement("input",{type:"text",className:"form-control",onChange:function(e){return l(e.target.value)},ref:o}),c.a.createElement("button",{className:"btn btn-outline-secondary",type:"submit",onClick:function(){return s()}},c.a.createElement(W.a,{icon:"search"}))))}),ht=window.location.origin,gt=function(e,t){return be.a.get(ht+"/api/v1/add/favorite/index.php",{params:{v_unit_id:e,v_section:t}})},Ot=function(e,t){return be.a.get(ht+"/api/v1/delete/favorite/index.php",{params:{v_unit_id:e,v_section:t}})},Nt=(a(209),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(n.useState)({starred:!1}),r=Object(A.a)(a,2),l=r[0],s=r[1];Object(n.useEffect)((function(){e.hasOwnProperty("starred")&&s(Object(u.a)(Object(u.a)({},l),{},{starred:Boolean(e.starred)}))}),[e.starred]);var i=function(){e.checkItem()};return c.a.createElement("div",{className:function(){var t=l.starred,a=e.checked,n=e.outdated,c=e.suspended,r=e.stopped,o="list-item";return a&&(o+=" toggled"),t&&(o+=" starred"),n&&(o+=" outdated"),(c||r)&&(o+=" suspended"),e.focused&&(o+=" focused"),e.sysInfo&&(o+=" sys-info"),o}(),id:e.id},c.a.createElement(Ge,{className:"l-col w-14"},function(e){if(e){var t=new Date(e),a=t.getDate(),n=t.getMonth()+1,r=t.getFullYear();return c.a.createElement("div",{className:"date"},a," \xa0 ",["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n-1]," \xa0 ",r)}}(e.date),c.a.createElement("div",{className:"text-status"},c.a.createElement("div",{className:"checkbox"},c.a.createElement("input",{type:"checkbox",onChange:i,checked:e.checked})),e.leftNameText),c.a.createElement("div",{className:"star"},c.a.createElement("div",{className:"checkbox"},c.a.createElement("input",{type:"checkbox",onChange:i,checked:e.checked})),c.a.createElement("div",{onClick:function(){s(Object(u.a)(Object(u.a)({},l),{},{starred:!l.starred})),e.toggleFav(!l.starred)}},c.a.createElement(W.a,{icon:"star"}))),e.suspended&&c.a.createElement("div",{className:"suspended"},t.suspended),e.stopped&&c.a.createElement("div",{className:"stopped"},t.stopped)),e.children)}),jt=(a(210),function(e){var t=e.data,a=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement(Nt,{id:t.NAME,focused:t.FOCUSED,checked:t.isChecked,date:t.DATE,starred:t.STARRED,toggleFav:function(a){a?e.toggleFav(t.NAME,"add"):e.toggleFav(t.NAME,"delete")},checkItem:function(){e.checkItem(t.NAME)}},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},t.NAT?c.a.createElement(c.a.Fragment,null,t.NAT," ",c.a.createElement(W.a,{icon:"long-arrow-alt-right"})," ",t.NAME):t.NAME),c.a.createElement("br",null),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1 w-35"},c.a.createElement("div",{className:"ip"},c.a.createElement("span",{className:"stat"},t.NETMASK)),c.a.createElement("div",{className:"soa"},c.a.createElement("span",{className:"stat"},t.INTERFACE))),c.a.createElement(Ge,{className:"c-2 w-30"},c.a.createElement("div",null,a.Domains,": ",c.a.createElement("span",{className:"stat"},t.U_WEB_DOMAINS)),c.a.createElement("div",null,a.Status,": ",c.a.createElement("span",{className:"stat"},t.STATUS))),c.a.createElement(Ge,{className:"c-3 w-35"},c.a.createElement("div",null,a.Owner,": ",c.a.createElement("span",{className:"stat"},t.OWNER)),c.a.createElement("div",null,a.Users,": ",c.a.createElement("span",{className:"stat"},t.U_SYS_USERS.replace(/,/g,", ")))))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/edit/ip/?ip=".concat(t.NAME)},a.edit,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){e.handleModal(t.delete_conf,"/api/v1/delete/ip/?ip=".concat(t.NAME))}},a.Delete,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))}),yt=(a(211),function(e){var t=e.showLeftMenu,a=e.list,n=e.name,r=e.href,l=e.onClick,o=void 0===l?function(){}:l,s=function(){return"server"===a?c.a.createElement(W.a,{icon:"cog"}):"backup-details"===a?c.a.createElement(W.a,{icon:"play"}):c.a.createElement(W.a,{icon:"plus"})};return c.a.createElement("div",{className:t?"server"===a?"l-menu server-icon":"backup-details"===a?"l-menu backup-details-icon":"l-menu":"l-menu none"},r?c.a.createElement(pe.b,{to:r},s(),c.a.createElement("span",{className:"add"},n)):c.a.createElement("button",{onClick:o},s(),c.a.createElement("span",{className:"add"},n)))});a(212);var kt=function(e){var t=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:"input-group-prepend"},c.a.createElement("div",{className:"input-group-text"},c.a.createElement("input",{type:"checkbox",onChange:function(t){return function(e,t){e.toggleAll(t.target.checked)}(e,t)},"aria-label":"Checkbox for following text input",id:"checkbox",checked:e.toggled})),c.a.createElement("span",{className:"input-group-text"},c.a.createElement("label",{htmlFor:"checkbox"},t["toggle all"])))},_t=(a(213),function(e){var t=e.cronReports,a=Object(w.a)(e,["cronReports"]),r=Object(o.d)((function(e){return e.session})).i18n,l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{usersList:[{value:"rebuild",name:e.rebuild},{value:"rebuild web",name:e["rebuild web"]},{value:"rebuild dns",name:e["rebuild dns"]},{value:"rebuild mail",name:e["rebuild mail"]},{value:"rebuild db",name:e["rebuild db"]},{value:"rebuild cron",name:e["rebuild cron"]},{value:"update counters",name:e["update counters"]},{value:"suspend",name:e.suspend},{value:"unsuspend",name:e.unsuspend},{value:"delete",name:e.delete}],webList:[{value:"suspend",name:e.suspend},{value:"unsuspend",name:e.unsuspend},{value:"delete",name:e.delete}],dnsList:[{value:"suspend",name:e.suspend},{value:"unsuspend",name:e.unsuspend},{value:"delete",name:e.delete}],mailList:[{value:"suspend",name:e.suspend},{value:"unsuspend",name:e.unsuspend},{value:"delete",name:e.delete}],dbList:[{value:"suspend",name:e.suspend},{value:"unsuspend",name:e.unsuspend},{value:"delete",name:e.delete}],cronList:[{value:"add-cron-reports",name:e["turn on notifications"]},{value:"delete-cron-reports",name:e["turn off notifications"]},{value:"suspend",name:e.suspend},{value:"unsuspend",name:e.unsuspend},{value:"delete",name:e.delete}],backupList:[{value:"delete",name:e.delete}],packagesList:[{value:"delete",name:e.delete}],internetProtocolsList:[{value:"reread IP",name:e["reread IP"]},{value:"delete",name:e.delete}],updatesList:[{value:"update",name:e.update}],firewallList:[{value:"suspend",name:e.suspend},{value:"unsuspend",name:e.unsuspend},{value:"delete",name:e.delete}],serverList:[{value:"stop",name:e.stop},{value:"start",name:e.start},{value:"restart",name:e.restart}],backupDetailList:[{value:"restore",name:e.restore}],banList:[{value:"delete",name:e.delete}]}}(r),s=Object(n.useState)({usersList:l.usersList,webList:l.webList,dnsList:l.dnsList,mailList:l.mailList,dbList:l.dbList,cronList:l.cronList,backupList:l.backupList,packagesList:l.packagesList,internetProtocolsList:l.internetProtocolsList,statisticsList:[],updatesList:l.updatesList,firewallList:l.firewallList,serverList:l.serverList,backupDetailList:l.backupDetailList,banList:l.banList,selected:""}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){var e=a.list;d(Object(u.a)(Object(u.a)({},m),{},{list:e}))}),[]);var E=function(){return"statisticsList"===a.list?r["show per user"]:r["apply to selected"]};return c.a.createElement("div",{className:"select-wrapper"},c.a.createElement("select",{className:"custom-select",id:"inputGroupSelect04",onChange:function(e){d(Object(u.a)(Object(u.a)({},m),{},{selected:e.target.value}))}},c.a.createElement("option",{defaultValue:E(),value:E()},"statisticsList"===a.list?r["show per user"]:r["apply to selected"]),function(){var e=a.list,n=m[e];return"cronList"===e&&(n=t?n.filter((function(e,t){return 0!==t})):n.filter((function(e,t){return 1!==t}))),"statisticsList"===e?a.users.map((function(e,t){return c.a.createElement("option",{key:t,value:e},e)})):n.map((function(e,t){return c.a.createElement("option",{key:t,value:e.value},e.name)}))}()),c.a.createElement("div",{className:"input-group-append"},c.a.createElement("button",{className:"btn btn-outline-secondary",type:"button",onClick:function(){a.bulkAction(m.selected),d(Object(u.a)(Object(u.a)({},m),{},{selected:""}))}},c.a.createElement(W.a,{icon:"angle-right"}))))}),St=(a(214),function(e){var t=e.show,a=e.text,n=e.onSave,r=e.onCancel,l=e.showSaveButton,s=void 0===l||l,i=e.showCancelButton,u=void 0===i||i,m=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",null,c.a.createElement("div",{className:"modal fade ".concat(t?"show":""),id:"c-panel-modal",tabindex:"-1",role:"dialog","aria-labelledby":"exampleModalLabel","aria-hidden":"true",style:{display:t?"block":"none"}},c.a.createElement("div",{className:"modal-dialog",role:"document"},c.a.createElement("div",{className:"modal-content"},c.a.createElement("div",{className:"modal-header"},c.a.createElement("h5",{className:"modal-title",id:"exampleModalLabel"},m.Confirmation),c.a.createElement("button",{type:"button",onClick:function(){return r()},className:"close","data-dismiss":"modal","aria-label":"Close"},c.a.createElement("span",{"aria-hidden":"true"},"\xd7"))),c.a.createElement("div",{className:"modal-body"},a),c.a.createElement("div",{className:"modal-footer"},u?c.a.createElement("button",{onClick:function(){return r()},type:"button",className:"btn btn-secondary","data-dismiss":"modal"},m.Cancel):"",s?c.a.createElement("button",{onClick:function(){return n()},type:"button",className:"btn btn-primary"},m.OK):"")))))}),wt=(a(215),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)(!1),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1,actionUrl:""}),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({internetProtocols:[],ipFav:[],toggledAll:!1,sorting:t.Date,order:"descending",selection:[],totalAmount:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){return l(Be("/list/ip/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),C().then((function(){return d(!1)})),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",N),window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",N),window.removeEventListener("keydown",_)}}),[a,r,g.internetProtocols]);var N=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),k()):40===e.keyCode&&(e.preventDefault(),y())},j=function(e){e[0].FOCUSED=e[0].NAME,O(Object(u.a)(Object(u.a)({},g),{},{internetProtocols:e})),l(vt(e[0].NAME))},y=function(){var e=Object(I.a)(g.internetProtocols);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{internetProtocols:e})),l(vt(n.NAME))}}else j(e)},k=function(){var e=Object(I.a)(g.internetProtocols);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{internetProtocols:e})),l(vt(n.NAME))}}else j(e)},_=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a&&!t)switch(e.keyCode){case 8:return w();case 13:return S()}},S=function(){e.history.push("/edit/ip/?ip=".concat(a))},w=function(){var e=g.internetProtocols.filter((function(e){return e.NAME===a}))[0];U(e.delete_conf,"/api/v1/delete/ip/?ip=".concat(a))},C=function(){return d(!0),new Promise((function(e,t){be.a.get(Ke+"/api/v1/list/ip/index.php").then((function(t){O(Object(u.a)(Object(u.a)({},g),{},{internetProtocols:D(t.data.data),ipFav:t.data.ipFav,selection:[],totalAmount:t.data.totalAmount,toggledAll:!1})),e()})).catch((function(e){return console.error(e)}))}))},D=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].FOCUSED=a===n,t.push(e[n]);return t},M=function(e){var t=g.selection,a=g.internetProtocols,n=Object(I.a)(t),c=a,r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),O(Object(u.a)(Object(u.a)({},g),{},{internetProtocols:c,selection:n}))},F=function(e){var t=g.order,a=g.sorting,n=x(a);return"descending"===t?e.sort((function(e,t){return e[n]<t[n]?1:t[n]<e[n]?-1:0})):e.sort((function(e,t){return e[n]>t[n]?1:t[n]>e[n]?-1:0}))},x=function(e){var a=t.Date,n=t.IP,c=t.Domains,r=t.Netmask,l=t.Interface,o=t.Owner,s=t.Starred;switch(e){case a:return"DATE";case n:return"IP";case r:return"NETMASK";case l:return"INTERFACE";case c:return"U_WEB_DOMAINS";case o:return"OWNER";case s:return"STARRED"}},T=function(e,t){var a=g.ipFav;"add"===t?(a[e]=1,gt(e,"ip").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{ipFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"ip").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{ipFav:a}))})).catch((function(e){console.error(e)})))},L=function(e){var t=Object(I.a)(g.internetProtocols);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));O(Object(u.a)(Object(u.a)({},g),{},{internetProtocols:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));O(Object(u.a)(Object(u.a)({},g),{},{internetProtocols:c,selection:[],toggledAll:e}))}},U=function(e,t){f(Object(u.a)(Object(u.a)({},v),{},{visible:!0,text:e,actionUrl:t}))},R=function(){l(et()).then((function(){return d(!1)}))},V=function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"internetProtocols"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.IP))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{name:t["Add IP"],href:"/add/ip/",showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(kt,{toggleAll:L,toggled:g.toggledAll}),c.a.createElement(_t,{list:"internetProtocolsList",bulkAction:function(e){var t=g.selection;t.length&&e&&(d(!0),function(e,t){var a=new FormData;return a.append("action",e),a.append("token",He()),t.forEach((function(e){a.append("ip[]",e)})),be.a.post(Ke+"/api/v1/bulk/ip/",a)}(e,t).then((function(e){200===e.status&&(L(!1),C().then((function(){return R()})))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(ft,{changeSorting:function(e,t){O(Object(u.a)(Object(u.a)({},g),{},{sorting:e,order:t}))},sorting:g.sorting,order:g.order,list:"internetProtocolsList"}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"ip-wrapper"},m?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,function(){var e=g.internetProtocols,t=Object(u.a)({},g.ipFav),n=[];return e.forEach((function(e){e.FOCUSED=a===e.NAME,t[e.NAME]?e.STARRED=t[e.NAME]:e.STARRED=0,n.push(e)})),F(n).map((function(e,t){return c.a.createElement(jt,{data:e,key:t,toggleFav:T,checkItem:M,handleModal:U})}))}(),c.a.createElement("div",{className:"total"},g.totalAmount))),c.a.createElement(St,{onSave:function(){if(!v.actionUrl)return V();var e;V(),d(!0),(e=v.actionUrl,be.a.get(Ke+e,{params:{token:He()}})).then((function(e){if(e.data.error)return d(!1),U(e.data.error,"");C().then((function(){return R()}))})).catch((function(e){d(!1),console.error(e)}))},onCancel:V,show:v.visible,text:v.text}))}),At=window.location.origin,Ct="/api/v1/generate/ssl/index.php",Dt=function(e){return e?be.a.get(At+Ct,{params:{domain:e}}):be.a.get(At+Ct)},Mt=function(e){var t=e.defaultValue,a=e.onChange,r=void 0===a?function(){}:a,l=e.id,s=e.name,i=e.title,m=e.showGenerationButton,d=void 0===m||m,E=Object(w.a)(e,["defaultValue","onChange","id","name","title","showGenerationButton"]),p=Object(o.d)((function(e){return e.session})).i18n,v=Object(n.useState)({hidePassword:!1,generatedPassword:""}),f=Object(A.a)(v,2),b=f[0],h=f[1];Object(n.useEffect)((function(){t&&!b.generatedPassword&&h(Object(u.a)(Object(u.a)({},b),{},{generatedPassword:t}))}),[t]);var g=function(e){h(Object(u.a)(Object(u.a)({},b),{},{generatedPassword:e})),r(e)};return c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"password"},i||p.Password,d&&c.a.createElement(c.a.Fragment,null," / ",c.a.createElement("button",{type:"button",className:"generate-password",onClick:function(){return function(){for(var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",t="",a=0;a<10;a++){var n=Math.floor(Math.random()*e.length);t+=e.substr(n,1)}h(Object(u.a)(Object(u.a)({},b),{},{generatedPassword:t})),r(t)}()}},p.Generate))),c.a.createElement("div",{className:"password-wrapper"},c.a.createElement("input",Object.assign({type:b.hidePassword?"password":"text",className:"form-control",id:"password_".concat(l),name:s,value:b.generatedPassword,onChange:function(e){return g(e.target.value)}},E)),c.a.createElement("button",{type:"button",onClick:function(){h(Object(u.a)(Object(u.a)({},b),{},{hidePassword:!b.hidePassword}))}},b.hidePassword?c.a.createElement("span",{className:"eye-slash"},c.a.createElement(W.a,{icon:"eye-slash"})):c.a.createElement("span",{className:"eye"},c.a.createElement(W.a,{icon:"eye"})))))},Ft=(a(216),function(e){e.domain;var t=e.data,a=void 0===t?{}:t,r=e.onDeleteAdditionalFtp,l=e.prefixI18N,s=e.prePath,i=e.checked,m=(Object(w.a)(e,["domain","data","onDeleteAdditionalFtp","prefixI18N","prePath","checked"]),Object(o.d)((function(e){return e.session}))),d=m.i18n,E=m.userName,p=Object(n.useState)({username:a.v_ftp_user||"",path:a.v_ftp_path||""}),v=Object(A.a)(p,2),f=v[0],b=v[1];return function(){var e;return a.deleted?0===a.is_new?c.a.createElement(c.a.Fragment,null,c.a.createElement("input",{type:"hidden",name:"v_ftp_user[".concat(a.id,"][delete]"),value:"1"}),c.a.createElement("input",{type:"hidden",name:"v_ftp_user[".concat(a.id,"][is_new]"),value:a.is_new}),c.a.createElement("input",{type:"hidden",name:"v_ftp_user[".concat(a.id,"][v_ftp_user]"),value:a.v_ftp_user}),c.a.createElement("input",{type:"hidden",name:"v_ftp_user[".concat(a.id,"][v_ftp_password]"),value:a.v_ftp_password}),c.a.createElement("input",{type:"hidden",name:"v_ftp_user[".concat(a.id,"][v_ftp_path]"),value:a.v_ftp_path}),c.a.createElement("input",{type:"hidden",name:"v_ftp_user[".concat(a.id,"][v_ftp_pre_path]"),value:s})):c.a.createElement(c.a.Fragment,null):i?c.a.createElement("div",{className:"additional-ftp"},c.a.createElement("div",{className:"title"},c.a.createElement("input",{type:"hidden",name:"v_ftp_user[".concat(a.id,"][v_ftp_user]"),value:a.v_ftp_user}),c.a.createElement("input",{type:"hidden",name:"v_ftp_user[".concat(a.id,"][delete]"),value:"0"}),c.a.createElement("input",{type:"hidden",name:"v_ftp_user[".concat(a.id,"][is_new]"),value:a.is_new}),c.a.createElement("span",{className:"data.indexed-name"},d.FTP," #",a.id+1),c.a.createElement("span",null,"\xa0",c.a.createElement("button",{type:"button",onClick:function(){return r(a.id)}},"(",null!==(e=d.Delete)&&void 0!==e?e:"Delete",")"))),c.a.createElement("div",{className:"form-transform"},c.a.createElement("div",{className:"form-group username"},c.a.createElement("label",{htmlFor:"ftp_user_".concat(a.id)},d.Username),c.a.createElement("span",{className:"prefix-note"},l),c.a.createElement("div",{className:"input-wrapper"},c.a.createElement("input",{defaultValue:f.username,onChange:function(e){return b(Object(u.a)(Object(u.a)({},f),{},{username:e.target.value}))},type:"text",disabled:a.v_ftp_user,className:"form-control",id:"ftp_user_".concat(a.id),name:"v_ftp_user[".concat(a.id,"][v_ftp_user]")}),c.a.createElement("span",null,a.v_ftp_user?a.v_ftp_user:"".concat(E,"_").concat(f.username)))),c.a.createElement(Mt,{name:"v_ftp_user[".concat(a.id,"][v_ftp_password]"),id:a.id}),c.a.createElement("div",{className:"form-group"},c.a.createElement("input",{type:"hidden",name:"v_ftp_pre_path",value:s}),c.a.createElement("input",{type:"hidden",name:"v_ftp_user[".concat(a.id,"][v_ftp_path_prev]"),value:a.v_ftp_path}),c.a.createElement("label",{htmlFor:"path".concat(a.id)},d.Path),c.a.createElement("input",{type:"text",value:f.path,onChange:function(e){return b(Object(u.a)(Object(u.a)({},f),{},{path:0!==e.target.value.indexOf("/")?"/".concat(e.target.value):e.target.value}))},className:"form-control",id:"path".concat(a.id),name:"v_ftp_user[".concat(a.id,"][v_ftp_path]")}),c.a.createElement("span",{className:"path-note"},s,f.path)),1===a.is_new&&c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"sendLoginCredentialsToEmailAddress_".concat(a.id)},d["Send login credentials to email address"]),c.a.createElement("input",{type:"email",className:"form-control",id:"sendLoginCredentialsToEmailAddress_".concat(a.id),defaultValue:a.v_ftp_email,name:"v_ftp_user[".concat(a.id,"][v_ftp_email]")})))):c.a.createElement(c.a.Fragment,null)}()}),xt=(a(217),function(e){var t,a=e.checked,r=e.ftps,l=e.unCheckAdditionalFtpBox,s=e.prefixI18N,i=e.ftpUserPrePath,m=e.domain,d=(Object(w.a)(e,["checked","ftps","unCheckAdditionalFtpBox","prefixI18N","ftpUserPrePath","domain"]),Object(o.d)((function(e){return e.session})).i18n),E=Object(n.useState)({additionalFtp:[]}),p=Object(A.a)(E,2),v=p[0],f=p[1];Object(n.useEffect)((function(){if(r){var e=r.map((function(e,t){return e.deleted=!a,e.id=t,e}));f(Object(u.a)(Object(u.a)({},v),{},{additionalFtp:e}))}}),[a,r]);var b=function(e){var t=[];v.additionalFtp.forEach((function(a){a.id===e&&(a.deleted=!0),t.push(a)})),t.length||l(),f(Object(u.a)(Object(u.a)({},v),{},{additionalFtp:t}))};return c.a.createElement("div",null,v.additionalFtp.map((function(e){return c.a.createElement(Ft,{key:e.id,prefixI18N:s,data:e,checked:a,prePath:i,domain:m,onDeleteAdditionalFtp:function(e){return b(e)}})})),a&&c.a.createElement("button",{type:"button",onClick:function(){return function(){var e=v.additionalFtp.length,t=Object(I.a)(v.additionalFtp);t.push({id:e,deleted:!1,is_new:1}),f(Object(u.a)(Object(u.a)({},v),{},{additionalFtp:t}))}()}},null!==(t=d["Add one more FTP Account"])&&void 0!==t?t:"Add"))}),Tt=(a(218),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(n.useState)(!1),r=Object(A.a)(a,2),l=r[0],s=r[1];return c.a.createElement("div",{className:"ssl-support"},c.a.createElement("div",{className:"form-group"},c.a.createElement("div",{className:"checkbox-wrapper"},c.a.createElement("input",{type:"checkbox",name:"v_letsencrypt",id:"lets-encrypt",checked:l,onChange:function(){return s(!l)}}),c.a.createElement("label",{htmlFor:"lets-encrypt"},t["Lets Encrypt Support"])),c.a.createElement("span",{className:"lets-encrypt-span"},l?t["Your certificate will be automatically issued in 5 minutes"]:null)),c.a.createElement("input",{type:"hidden",value:"same",name:"v_ssl_home"}),c.a.createElement(rt,{id:"ssl-certificate",name:"v_ssl_crt",title:t["SSL Certificate"],disabled:l,optionalTitle:c.a.createElement(c.a.Fragment,null,"/ ",c.a.createElement("button",{type:"button",onClick:function(){return e.setModalVisible(!0)},className:"generate-csr"},t["Generate CSR"]))}),c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{htmlFor:"aliases"},t["SSL Key"]),c.a.createElement("textarea",{class:"form-control",id:"ssl_key",rows:"3",name:"v_ssl_key",defaultValue:e.sslKey,disabled:l})),c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{htmlFor:"aliases"},t["SSL Certificate Authority / Intermediate"]),c.a.createElement("textarea",{class:"form-control",id:"ssl_ca",rows:"3",name:"v_ssl_ca",disabled:l})))}),Lt=(a(219),function(e){var t=e.prefixI18N,a=e.prePath,r=Object(w.a)(e,["prefixI18N","prePath"]),l=Object(o.d)((function(e){return e.session})).i18n,s=Object(n.useState)({sslSupport:!1,additionalFtp:!1,statisticsAuthCheckbox:!1,statisticsAuth:!1}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){var e="www.".concat(r.domain);d(Object(u.a)(Object(u.a)({},m),{},{aliases:e}))}),[r.domain]);return c.a.createElement("div",{style:{transform:"translateX(3rem)"}},c.a.createElement("div",{className:"form-group"},c.a.createElement("div",{className:"checkbox-wrapper"},c.a.createElement("input",{type:"checkbox",name:"v_ssl",id:"ssl-support",checked:m.sslSupport,onChange:function(){return d(Object(u.a)(Object(u.a)({},m),{},{sslSupport:!m.sslSupport}))}}),c.a.createElement("label",{htmlFor:"ssl-support"},l["SSL Support"]))),function(){if(m.sslSupport)return c.a.createElement(Tt,{sslCertificate:r.sslCertificate,sslKey:r.sslKey,setModalVisible:function(e){return r.setModalVisible(e)}})}(),c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{htmlFor:"web-stats"},l["Web Statistics"]),c.a.createElement("select",{class:"form-control",id:"web-stats",name:"v_stats",onChange:function(e){return t=e.target.value,void d("none"!==t?Object(u.a)(Object(u.a)({},m),{},{statisticsAuth:!0}):Object(u.a)(Object(u.a)({},m),{},{statisticsAuth:!1,statisticsAuthCheckbox:!1}));var t}},r.webStats.map((function(e){return c.a.createElement("option",{value:e},e)})))),c.a.createElement("div",{className:"form-group statistics-authorization ".concat(m.statisticsAuth?"show":"hide")},c.a.createElement("div",{className:"checkbox-wrapper"},c.a.createElement("input",{type:"checkbox",name:"v_stats_auth",id:"stats-auth",checked:m.statisticsAuthCheckbox,onChange:function(){return d(Object(u.a)(Object(u.a)({},m),{},{statisticsAuthCheckbox:!m.statisticsAuthCheckbox}))}}),c.a.createElement("label",{htmlFor:"stats-auth"},l["Statistics Authorization"]))),c.a.createElement("div",{className:m.statisticsAuthCheckbox?"show web-stats-wrapper":"hide"},c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"stats-user"},l.Username),c.a.createElement("input",{type:"text",className:"form-control",id:"stats-user",name:"v_stats_user"})),c.a.createElement(Mt,{name:"v_stats_password"})),c.a.createElement(Ye,{onChange:function(e){return d(Object(u.a)(Object(u.a)({},m),{},{additionalFtp:e}))},name:"v_ftp",id:"add-ftp",checked:m.additionalFtp,title:l["Additional FTP Account"]}),c.a.createElement(xt,{checked:m.additionalFtp,prefixI18N:t,ftps:[{id:1,deleted:!1,is_new:1}],ftpUserPrePath:a,unCheckAdditionalFtpBox:function(){return d(Object(u.a)(Object(u.a)({},m),{},{additionalFtp:!1}))}}))}),Ut=(a(220),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=(Object(R.g)(),Object(o.c)()),l=Object(n.useState)(""),s=Object(A.a)(l,2),i=s[0],m=s[1],d=Object(n.useState)(""),E=Object(A.a)(d,2),p=E[0],v=E[1],f=Object(n.useState)({data:{},generatedData:{},loading:!1,domain:""}),b=Object(A.a)(f,2),h=b[0],g=b[1];Object(n.useEffect)((function(){var t=e.domain;r(Be("/list/web/")),r({type:"REMOVE_FOCUSED_ELEMENT",value:""}),t?O(t):O()}),[]);var O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";Dt(e).then((function(t){g(Object(u.a)(Object(u.a)({},h),{},{domain:e,generatedData:{},data:t.data,loading:!1}))})).catch((function(e){g(Object(u.a)(Object(u.a)({},h),{},{loading:!1})),console.error(e)}))},N=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}a.generate="generate",0!==Object.keys(a).length&&a.constructor===Object&&(g(Object(u.a)(Object(u.a)({},h),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.post(At+Ct,t,{params:{token:He()}})}(a).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg,c=t.crt,r=t.key,l=t.csr;a?(m(a),v(""),g(Object(u.a)(Object(u.a)({},h),{},{generatedData:{},loading:!1}))):(m(""),v(n),g(Object(u.a)(Object(u.a)({},h),{},{generatedData:{crt:c,key:r,csr:l},loading:!1})))}})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template edit-user"},c.a.createElement(Qe,{date:h.data.date,time:h.data.time,status:h.data.status},h.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return N(e)},id:"add-user"},c.a.createElement("input",{type:"hidden",name:"token",value:t}),Object.entries(h.generatedData).length?c.a.createElement(c.a.Fragment,null,c.a.createElement(rt,{id:"csr",name:"v_csr",title:a["SSL CSR"],defaultValue:h.generatedData.csr}),c.a.createElement(rt,{id:"crt",name:"v_crt",title:a["SSL Certificate"],defaultValue:h.generatedData.crt}),c.a.createElement(rt,{id:"v_key",name:"key",title:a["SSL Key"],defaultValue:h.generatedData.key}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"button",className:"add",onClick:function(){return e.prePopulateInputs(h.generatedData)}},a.Add),c.a.createElement("button",{type:"button",className:"back",onClick:e.closeModal},a.Back))):c.a.createElement(c.a.Fragment,null,c.a.createElement(ze,{id:"domain",name:"v_domain",title:a.Domain,value:h.data.domain}),c.a.createElement(ze,{id:"email",name:"v_email",title:a.Email,value:h.data.email}),c.a.createElement(ze,{id:"country",name:"v_country",title:a.Country,optionalTitle:"(".concat(a["2 letter code"],")"),value:h.data.country}),c.a.createElement(ze,{id:"state",name:"v_state",title:a["State / Province"],value:h.data.state}),c.a.createElement(ze,{id:"locality",name:"v_locality",title:a["City / Locality"],value:h.data.locality}),c.a.createElement(ze,{id:"org",name:"v_org",title:a.Organization,value:h.data.org}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Generate),c.a.createElement("button",{type:"button",className:"back",onClick:e.closeModal},a.Back))),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},i)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},c.a.createElement("span",null,at()(p))," ")))))}),It=function(e){var t,a,r,l=Object(o.d)((function(e){return e.session})),s=l.i18n,i=l.userName,m=Object(o.d)((function(e){return e.panel})).panel,d=Object(o.d)((function(e){return e.userSession})).session,E=Object(o.c)(),p=localStorage.getItem("token"),v=Object(n.useState)(!1),f=Object(A.a)(v,2),b=f[0],h=f[1],g=Object(R.g)(),O=Object(n.useState)({loading:!1,dnsSupport:!0,mailSupport:!0,proxySupport:!0,showAdvancedOptions:!1,okMessage:"",ssl_crt:"",ssl_key:"",domain:"",errorMessage:"",webStats:[],prefixI18N:"",prePath:"",aliases:"",proxy_ext:"",internetProtocols:[]}),N=Object(A.a)(O,2),j=N[0],y=N[1];Object(n.useEffect)((function(){E(Be("/list/web/")),E({type:"REMOVE_FOCUSED_ELEMENT",value:""}),y(Object(u.a)(Object(u.a)({},j),{},{loading:!0})),be.a.get(At+"/api/v1/add/web/index.php",{params:{token:He()}}).then((function(e){y(Object(u.a)(Object(u.a)({},j),{},{internetProtocols:k(e.data.ips),webStats:e.data.stats,prefixI18N:e.data.prefix,proxy_ext:e.data.proxy_ext,prePath:e.data.ftp_pre_path,loading:!1}))})).catch((function(e){y(Object(u.a)(Object(u.a)({},j),{},{loading:!1})),console.error(e)}))}),[]);var k=function(e){var t=[];for(var a in e)t.push(a);return t},_=function(e,t){y(Object(u.a)(Object(u.a)({},j),{},Object(M.a)({},e,t)))},S=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(y({loading:!0}),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.post(At+"/api/v1/add/web/index.php",t)}(a).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?y(Object(u.a)(Object(u.a)({},j),{},{errorMessage:a,okMessage:n,loading:!1})):E(et()).then((function(){y(Object(u.a)(Object(u.a)({},j),{},{okMessage:n,errorMessage:"",loading:!1}))}))}})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template add-web"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(s.WEB))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},s["Adding Domain"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},j.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",j.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},j.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",c.a.createElement("span",null,at()(j.okMessage))))),c.a.createElement(Qe,null,j.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return S(e)}},c.a.createElement("input",{type:"hidden",name:"ok",value:"add"}),c.a.createElement("input",{type:"hidden",name:"token",value:p}),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"domain"},s.Domain),c.a.createElement("input",{type:"text",className:"form-control",id:"domain",required:!0,name:"v_domain",onBlur:function(e){return t=e.target.value,void y(Object(u.a)(Object(u.a)({},j),{},{aliases:"www.".concat(t)}));var t}})),c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{htmlFor:"package"},s["IP Address"]),c.a.createElement("select",{class:"form-control",id:"ip",name:"v_ip"},j.internetProtocols.map((function(e){return c.a.createElement("option",{value:e},e)})))),c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{htmlFor:"aliases"},s.Aliases),c.a.createElement("textarea",{class:"form-control",id:"aliases",rows:"3",name:"v_aliases",defaultValue:j.aliases})),"0"!==m[i].DNS_DOMAINS&&c.a.createElement(Ye,{onChange:function(e){return _("dnsSupport",e)},name:"v_dns",id:"dns-support",title:null!==(t=s["DNS Support"])&&void 0!==t?t:"DNS Support",defaultChecked:j.dnsSupport}),"0"!==m[i].MAIL_DOMAINS&&c.a.createElement(Ye,{onChange:function(e){return _("mailSupport",e)},name:"v_mail",id:"mail-support",title:null!==(a=s["Mail Support"])&&void 0!==a?a:"Mail Support",defaultChecked:j.mailSupport}),d.PROXY_SYSTEM&&c.a.createElement(c.a.Fragment,null,c.a.createElement(Ye,{onChange:function(e){return _("proxySupport",e)},name:"v_proxy",id:"proxy",title:null!==(r=s["Proxy Support"])&&void 0!==r?r:"Proxy Support",defaultChecked:j.proxySupport}),j.proxySupport&&c.a.createElement("div",{style:{transform:"translateX(3rem)"}},c.a.createElement(rt,{id:"proxy-extensions",name:"v_proxy_ext",title:s["Proxy Extensions"],defaultValue:j.proxy_ext}))),c.a.createElement("div",{className:"form-group advanced-options-button"},c.a.createElement("button",{type:"button",onClick:function(){y(Object(u.a)(Object(u.a)({},j),{},{showAdvancedOptions:!j.showAdvancedOptions}))}},s["Advanced options"],j.showAdvancedOptions?c.a.createElement(W.a,{icon:"caret-down"}):c.a.createElement(W.a,{icon:"caret-up"}))),function(){if(j.showAdvancedOptions)return c.a.createElement(Lt,{prefixI18N:j.prefixI18N,setModalVisible:function(e){return h(e)},sslCertificate:j.ssl_crt,sslKey:j.ssl_key,domain:j.domain,webStats:j.webStats,prePath:j.prePath})}(),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},s.Add),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return g.push("/list/web/")}},s.Back)))),c.a.createElement("div",{className:"modal fade ".concat(b?"show":""),id:"c-panel-modal",tabindex:"-1",role:"dialog","aria-labelledby":"exampleModalLabel","aria-hidden":"true",style:{display:b?"block":"none"}},c.a.createElement("div",{className:"modal-dialog",role:"document"},c.a.createElement("div",{className:"modal-content"},c.a.createElement("div",{className:"modal-header"},c.a.createElement("h5",null,s["Generating CSR"]),c.a.createElement("button",{type:"button",onClick:function(){return h(!1)},className:"close","data-dismiss":"modal","aria-label":"Close"},c.a.createElement("span",{"aria-hidden":"true"},"\xd7"))),c.a.createElement(Ut,{domain:j.domain,closeModal:function(){return h(!1)},prePopulateInputs:function(e){var t=e.crt,a=e.key;y(Object(u.a)(Object(u.a)({},j),{},{ssl_crt:t,ssl_key:a})),h(!1)}})))))},Pt=(a(221),function(e){var t=e.id,a=e.title,r=e.name,l=e.defaultValue,o=void 0===l?"":l,s=e.optionalTitle,i=void 0===s?"":s,u=e.disabled,m=void 0!==u&&u,d=Object(n.useState)(""),E=Object(A.a)(d,2),p=E[0],v=E[1];return Object(n.useEffect)((function(){o&&v(o)}),[o]),c.a.createElement("div",{className:"form-group text-on-the-right"},c.a.createElement("label",{className:"label-wrapper",htmlFor:t},a,c.a.createElement("span",null,i||"")),c.a.createElement("div",{className:"input-wrapper"},c.a.createElement("input",{defaultValue:"admin_".concat(o),type:"text",className:"form-control",id:t,value:p,onChange:function(e){return v(e.target.value)},disabled:m,name:r}),c.a.createElement("span",null,c.a.createElement("i",null,"".concat(p)))))}),Rt=window.location.origin,Vt=["big5","dec8","cp850","hp8","koi8r","latin1","latin2","swe7","ascii","ujis","sjis","hebrew","tis620","euckr","koi8u","gb2312","greek","cp1250","gbk","latin5","armscii8","utf8","utf8mb4","ucs2","cp866","keybcs2","macce","macroman","cp852","latin7","cp1251","cp1256","cp1257","binary","geostd8","cp932","eucjpms"],Bt=(a(222),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})),r=a.i18n,l=a.userName,s=Object(R.g)(),i=Object(o.c)(),m=Object(n.useState)(""),d=Object(A.a)(m,2),E=d[0],p=d[1],v=Object(n.useState)(""),f=Object(A.a)(v,2),b=f[0],h=f[1],g=Object(n.useState)({data:{},loading:!1,databaseUserInputValue:""}),O=Object(A.a)(g,2),N=O[0],j=O[1];Object(n.useEffect)((function(){var e=ge.a.parse(s.location.search,{ignoreQueryPrefix:!0}).database;i(Be("/list/db/")),i({type:"REMOVE_FOCUSED_ELEMENT",value:""}),e&&(j(Object(u.a)(Object(u.a)({},N),{},{loading:!0})),y(e))}),[]);var y=function(e){(function(e){return be.a.get(Rt+"/api/v1/edit/db/index.php",{params:{database:e,token:He()}})})(e).then((function(e){j(Object(u.a)(Object(u.a)({},N),{},{data:e.data,databaseUserInputValue:e.data.dbuser.split("_").splice(1).join("_"),loading:!1}))})).catch((function(e){j(Object(u.a)(Object(u.a)({},N),{},{loading:!1})),console.error(e)}))},k=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],o=c[1];a[r]=o}}catch(s){n.e(s)}finally{n.f()}a.v_database=N.data.database,a.v_dbuser="".concat(l,"_").concat(N.databaseUserInputValue),0!==Object.keys(a).length&&a.constructor===Object&&(j(Object(u.a)(Object(u.a)({},N),{},{loading:!0})),function(e,t){var a=new FormData;for(var n in e)a.append(n,e[n]);return be.a.post(Rt+"/api/v1/edit/db/index.php",a,{params:{database:t,token:He()}})}(a,N.data.database).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(h(""),p(a)):i(et()).then((function(){h(n),p("")}))}})).then((function(){return y(N.data.database)})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template edit-db"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(r.DB))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},r["Editing Database"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},E?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",E)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},b?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(b))))),c.a.createElement(Qe,{date:N.data.date,time:N.data.time,status:N.data.status},N.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return k(e)},id:"edit-db"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:t}),c.a.createElement(Pt,{id:"database",name:"v_database",title:r.Database,defaultValue:N.data.database,disabled:!0}),c.a.createElement("div",{className:"form-group"},c.a.createElement("div",{className:"label-wrapper"},c.a.createElement("label",{htmlFor:"user"},r.User)),c.a.createElement("div",{className:"input-wrapper"},c.a.createElement("input",{type:"text",className:"form-control",id:"user",value:N.databaseUserInputValue,onChange:function(e){return t=e.target.value,void j(Object(u.a)(Object(u.a)({},N),{},{databaseUserInputValue:t}));var t},name:"v_dbuser"}),c.a.createElement("span",{className:"italic"},c.a.createElement("i",null,"".concat(l,"_").concat(N.databaseUserInputValue))))),c.a.createElement(Mt,{name:"v_password",defaultValue:N.data.password}),c.a.createElement(ze,{id:"type",name:"v_type",title:r.Type,value:N.data.type,disabled:!0}),c.a.createElement(ze,{id:"host",name:"v_host",title:r.Host,value:N.data.host,disabled:!0}),c.a.createElement(ze,{id:"charset",name:"v_charset",title:r.Charset,value:N.data.charset,disabled:!0}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},r.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return s.push("/list/db/")}},r.Back)))))}),Wt=window.location.origin,qt="/api/v1/add/firewall/banlist/index.php",Ht=function(e){return be.a.get(Wt+e,{params:{token:He()}})},Kt=(a(223),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(R.g)(),l=Object(o.c)(),s=Object(n.useState)(""),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)(""),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({data:{},loading:!1}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){var e=ge.a.parse(r.location.search,{ignoreQueryPrefix:!0}).rule;l(Be("/list/firewall/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),e&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),N(e))}),[]);var N=function(e){(function(e){return be.a.get(Wt+"/api/v1/edit/firewall/index.php",{params:{rule:e,token:He()}})})(e).then((function(e){O(Object(u.a)(Object(u.a)({},g),{},{data:e.data,loading:!1}))})).catch((function(e){O(Object(u.a)(Object(u.a)({},g),{},{loading:!1})),console.error(e)}))},j=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),function(e,t){var a=new FormData;for(var n in e)a.append(n,e[n]);return be.a.post(Wt+"/api/v1/edit/firewall/index.php",a,{params:{rule:t,token:He()}})}(a,g.data.rule).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;d(a||""),f(n||"")}})).then((function(){return N(g.data.rule)})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template edit-firewall"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.FIREWALL))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},a["Editing Firewall Rule"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",m)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},v?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(v))))),c.a.createElement(Qe,{date:g.data.date,time:g.data.time,status:g.data.status},g.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return j(e)},id:"edit-firewall"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:t}),c.a.createElement("div",{className:"form-group select-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:"action"},a.Action),c.a.createElement("select",{className:"form-control",id:"action",name:"v_action"},c.a.createElement("option",{selected:"DROP"===g.data.action,value:"DROP"},"DROP"),c.a.createElement("option",{selected:"ACCEPT"===g.data.action,value:"ACCEPT"},"ACCEPT"))),c.a.createElement("div",{className:"form-group select-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:"protocol"},a.Protocol),c.a.createElement("select",{className:"form-control",id:"protocol",name:"v_protocol"},c.a.createElement("option",{selected:"TCP"===g.data.protocol,value:"TCP"},a.TCP),c.a.createElement("option",{selected:"UDP"===g.data.protocol,value:"UDP"},a.UDP),c.a.createElement("option",{selected:"ICMP"===g.data.protocol,value:"ICMP"},a.ICMP))),c.a.createElement(ze,{optionalTitle:a["ranges are acceptable"],value:g.data.port,title:a.Port,name:"v_port",id:"port"}),c.a.createElement(ze,{optionalTitle:a["CIDR format is supported"],value:g.data.ip,title:a["IP address"],name:"v_ip",id:"ip"}),c.a.createElement(ze,{optionalTitle:a.optional,value:g.data.comment,title:a.Comment,name:"v_comment",id:"comment"}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return r.push("/list/firewall/")}},a.Back)))))}),Jt=(a(224),function(e){var t=Object(o.d)((function(e){return e.session})).i18n;Object(n.useEffect)((function(){return window.addEventListener("keyup",a),function(){return window.removeEventListener("keyup",a)}}),[e.reference]);var a=function(t){var a=document.querySelector("input:focus")||document.querySelector("textarea:focus");72!==t.keyCode||a||e.toggleHotkeys()};return c.a.createElement("div",{className:"hotkeys-list hide",ref:e.reference},c.a.createElement("div",{className:"head"},c.a.createElement("div",{className:"name"},t.Shortcuts),c.a.createElement("div",{className:"close",onClick:function(){return e.toggleHotkeys()}},c.a.createElement(W.a,{icon:"times"}))),c.a.createElement("div",{className:"body"},c.a.createElement("ul",null,c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"a"),c.a.createElement("span",{className:"description"},t["Add New object"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"Ctrl + Open"),c.a.createElement("span",{className:"description"},t["Save Form"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"Ctrl + Backspace"),c.a.createElement("span",{className:"description"},t["Cancel saving form"])),c.a.createElement("li",{className:"space-top"},c.a.createElement("span",{className:"name"},"1"),c.a.createElement("span",{className:"description"},t["Go to USER list"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"2"),c.a.createElement("span",{className:"description"},t["Go to WEB list"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"3"),c.a.createElement("span",{className:"description"},t["Go to DNS list"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"4"),c.a.createElement("span",{className:"description"},t["Go to MAIL list"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"5"),c.a.createElement("span",{className:"description"},t["Go to DB list"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"6"),c.a.createElement("span",{className:"description"},t["Go to CRON list"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"7"),c.a.createElement("span",{className:"description"},t["Go to BACKUP list"]))),c.a.createElement("ul",null,c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"f"),c.a.createElement("span",{className:"description"},t["Focus on search"])),c.a.createElement("li",{className:"space-top"},c.a.createElement("span",{className:"name"},"h"),c.a.createElement("span",{className:"description"},t["Display/Close shortcuts"])),c.a.createElement("li",{className:"space-top"},c.a.createElement("span",{className:"name"},"\u2190"),c.a.createElement("span",{className:"description"},t["Move backward through top menu"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"\u2192"),c.a.createElement("span",{className:"description"},t["Move forward through top menu"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"Enter"),c.a.createElement("span",{className:"description"},t["Enter focused element"])),c.a.createElement("li",{className:"space-top"},c.a.createElement("span",{className:"name"},"\u2191"),c.a.createElement("span",{className:"description"},t["Move up through elements list"])),c.a.createElement("li",null,c.a.createElement("span",{className:"name"},"\u2193"),c.a.createElement("span",{className:"description"},t["Move down through elements list"])))))}),zt=(a(225),Object(n.memo)((function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=localStorage.getItem("token"),r=Object(o.c)(),l=Object(R.g)(),s=Object(n.useState)({loading:!1,okMessage:"",errorMessage:"",dbTypes:[],dbHosts:[],dbCharsets:[],user:"",maxCharLength:"",databaseInputValue:"",databaseUserInputValue:"",prefixI18N:""}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){r(Be("/list/db/")),r({type:"REMOVE_FOCUSED_ELEMENT",value:""}),d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),be.a.get(Rt+"/api/v1/add/db/index.php").then((function(e){200===e.status&&d(Object(u.a)(Object(u.a)({},m),{},{dbCharsets:Vt,user:e.data.user,dbTypes:e.data.dbTypes,prefixI18N:e.data.prefixI18N,maxCharLength:e.data.maxCharLength,dbHosts:e.data.dbHosts,loading:!1}))})).catch((function(e){return console.err(e)}))}),[]);var E=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),l=c[0],o=c[1];a[l]=o}}catch(s){n.e(s)}finally{n.f()}a.v_database=m.databaseInputValue,a.v_dbuser=m.databaseUserInputValue,0!==Object.keys(a).length&&a.constructor===Object&&(d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.post(Rt+"/api/v1/add/db/index.php",t)}(a).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?d(Object(u.a)(Object(u.a)({},m),{},{errorMessage:a,okMessage:"",loading:!1})):r(et()).then((function(){d(Object(u.a)(Object(u.a)({},m),{},{okMessage:n,errorMessage:"",loading:!1}))}))}})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template add-db"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.DB))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},t["Adding database"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",m.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},m.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",c.a.createElement("span",null,at()(m.okMessage))))),c.a.createElement(Qe,null,m.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return E(e)}},c.a.createElement("input",{type:"hidden",name:"ok",value:"add"}),c.a.createElement("input",{type:"hidden",name:"token",value:a}),c.a.createElement("span",{className:"prefix"},at()(m.prefixI18N)),c.a.createElement("div",{className:"form-group database"},c.a.createElement("label",{htmlFor:"database"},t.Database),c.a.createElement("div",{className:"input-wrapper"},c.a.createElement("input",{type:"text",className:"form-control",id:"database",onChange:function(e){return t=e.target.value,void d(Object(u.a)(Object(u.a)({},m),{},{databaseInputValue:t}));var t},value:m.databaseInputValue,name:"v_database"}),c.a.createElement("span",{className:"italic"},"".concat(m.user,"_").concat(m.databaseInputValue)))),c.a.createElement("div",{className:"form-group"},c.a.createElement("div",{className:"label-wrapper"},c.a.createElement("label",{htmlFor:"user"},t.User),c.a.createElement("span",{className:"italic"},"(",m.maxCharLength,")")),c.a.createElement("div",{className:"input-wrapper"},c.a.createElement("input",{type:"text",className:"form-control",id:"user",value:m.databaseUserInputValue,onChange:function(e){return t=e.target.value,void d(Object(u.a)(Object(u.a)({},m),{},{databaseUserInputValue:t}));var t},name:"v_dbuser"}),c.a.createElement("span",{className:"italic"},"".concat(m.user,"_").concat(m.databaseUserInputValue)))),c.a.createElement(Mt,{name:"v_password"}),c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{htmlFor:"dbTypes"},t.Type),c.a.createElement("select",{class:"form-control",id:"dbTypes",name:"v_type"},m.dbTypes.map((function(e,t){return c.a.createElement("option",{key:t,value:e},e)})))),c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{htmlFor:"dbHosts"},t.Host),c.a.createElement("select",{class:"form-control",id:"dbHosts",name:"v_host"},m.dbHosts.map((function(e,t){return c.a.createElement("option",{key:t,value:e},e)})))),c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{htmlFor:"dbCharset"},t.Charset),c.a.createElement("select",{class:"form-control",id:"dbCharset",name:"v_charset"},m.dbCharsets.map((function(e,t){return c.a.createElement("option",{key:t,value:e,selected:"utf8"===e},e)})))),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"sendLoginCredentialsToEmailAddress"},t["Send login credentials to email address"]),c.a.createElement("input",{type:"email",className:"form-control",id:"sendLoginCredentialsToEmailAddress",name:"v_db_email"})),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},t.Add),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return l.push("/list/db/")}},t.Back)))))}))),Yt=(a(226),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(o.c)(),l=Object(R.g)(),s=Object(n.useState)({loading:!1,actions:["DROP","ACCEPT"],protocols:["TCP","UDP","ICMP"],okMessage:"",errorMessage:""}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){r(Be("/list/firewall/")),r({type:"REMOVE_FOCUSED_ELEMENT",value:""})}),[]);var E=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),l=c[0],o=c[1];a[l]=o}}catch(s){n.e(s)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.post(Wt+"/api/v1/add/firewall/index.php",t)}(a).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?d(Object(u.a)(Object(u.a)({},m),{},{errorMessage:a,okMessage:n,loading:!1})):r(et()).then((function(){d(Object(u.a)(Object(u.a)({},m),{},{okMessage:n,errorMessage:"",loading:!1}))}))}})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template add-firewall"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.FIREWALL))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},a["Adding Firewall Rule"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",m.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},m.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",c.a.createElement("span",null,at()(m.okMessage))))),c.a.createElement(Qe,null,c.a.createElement("form",{onSubmit:function(e){return E(e)}},c.a.createElement("input",{type:"hidden",name:"ok",value:"add"}),c.a.createElement("input",{type:"hidden",name:"token",value:t}),c.a.createElement(Je,{options:m.actions,name:"v_action",id:"action",title:a.Action}),c.a.createElement(Je,{options:m.protocols,name:"v_protocol",id:"protocol",title:a.Protocol}),c.a.createElement(ze,{name:"v_port",id:"port",title:a.Port,optionalTitle:a["ranges are acceptable"]}),c.a.createElement(ze,{name:"v_ip",id:"ip",title:a["IP address"],optionalTitle:a["CIDR format is supported"]}),c.a.createElement(ze,{name:"v_comment",id:"comment",title:a.Comment,optionalTitle:a.optional}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Add),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return l.push("/list/firewall/")}},a.Back)))))}),Gt=window.location.origin,Qt=function(e){return be.a.get(Gt+e,{params:{token:He()}})},Xt=function(e){var t,a,n,c,r,l,o,s,i,u,m,d,E,p,v,f,b,h,g,O,N,j,y,k,_,S,w,A,C,D,M,F;return{minutesRunCommandsOptions:[{name:null!==(t=e["every minute"])&&void 0!==t?t:"every minute",value:"*"},{name:null!==(a=e["every two minutes"])&&void 0!==a?a:"every two minutes",value:"*/2"},{name:"".concat(e.every||"every"," 5"),value:"*/5"},{name:"".concat(e.every||"every"," 10"),value:"*/10"},{name:"".concat(e.every||"every"," 15"),value:"*/15"},{name:"".concat(e.every||"every"," 30"),value:"*/30"}],hoursRunCommandsOptions:[{name:null!==(n=e["every hour"])&&void 0!==n?n:"every hour",value:"*"},{name:null!==(c=e["every two hours"])&&void 0!==c?c:"every two hours",value:"*/2"},{name:"".concat(e.every||"every"," 6"),value:"*/6"},{name:"".concat(e.every||"every"," 12"),value:"*/12"}],daysRunCommandsOptions:[{name:null!==(r=e["every day"])&&void 0!==r?r:"every day",value:"*"},{name:null!==(l=e["every odd day"])&&void 0!==l?l:"every odd day",value:"1-31/2"},{name:null!==(o=e["every even day"])&&void 0!==o?o:"every even day",value:"*/2"},{name:"".concat(e.every||"every"," 3"),value:"*/3"},{name:"".concat(e.every||"every"," 5"),value:"*/5"},{name:"".concat(e.every||"every"," 10"),value:"*/10"},{name:"".concat(e.every||"every"," 15"),value:"*/15"}],hoursOptions:[{name:"00",value:"0"},{name:"01",value:"1"},{name:"02",value:"2"},{name:"03",value:"3"},{name:"04",value:"4"},{name:"05",value:"5"},{name:"06",value:"6"},{name:"07",value:"7"},{name:"08",value:"8"},{name:"09",value:"9"},{name:"10",value:"10"},{name:"11",value:"11"},{name:"12",value:"12"},{name:"13",value:"13"},{name:"14",value:"14"},{name:"15",value:"15"},{name:"16",value:"16"},{name:"17",value:"17"},{name:"18",value:"18"},{name:"19",value:"19"},{name:"20",value:"20"},{name:"21",value:"21"},{name:"22",value:"22"},{name:"23",value:"23"}],hourlyMinutesOptions:[{name:"00",value:"0"},{name:"15",value:"15"},{name:"30",value:"30"},{name:"45",value:"45"}],dailyMinutesOptions:[{name:"00",value:"0"},{name:"01",value:"1"},{name:"02",value:"2"},{name:"05",value:"5"},{name:"10",value:"10"},{name:"15",value:"15"},{name:"20",value:"20"},{name:"25",value:"25"},{name:"30",value:"30"},{name:"35",value:"35"},{name:"40",value:"40"},{name:"45",value:"45"},{name:"50",value:"50"},{name:"55",value:"55"}],weeklyRunCommandOptions:[{name:null!==(s=e["every day"])&&void 0!==s?s:"every day",value:"*"},{name:null!==(i=e["weekdays (5 days)"])&&void 0!==i?i:"weekdays (5 days)",value:"1,2,3,4,5"},{name:null!==(u=e["weekend (2 days)"])&&void 0!==u?u:"weekend (2 days)",value:"0,6"},{name:null!==(m=e.Monday)&&void 0!==m?m:"Monday",value:"1"},{name:null!==(d=e.Tuesday)&&void 0!==d?d:"Tuesday",value:"2"},{name:null!==(E=e.Wednesday)&&void 0!==E?E:"Wednesday",value:"3"},{name:null!==(p=e.Thursday)&&void 0!==p?p:"Thursday",value:"4"},{name:null!==(v=e.Friday)&&void 0!==v?v:"Friday",value:"5"},{name:null!==(f=e.Saturday)&&void 0!==f?f:"Saturday",value:"6"},{name:null!==(b=e.Sunday)&&void 0!==b?b:"Sunday",value:"0"}],monthlyRunCommandOptions:[{name:null!==(h=e["every month"])&&void 0!==h?h:"every month",value:"*"},{name:null!==(g=e["every odd month"])&&void 0!==g?g:"every odd month",value:"1-11/2"},{name:null!==(O=e["every even month"])&&void 0!==O?O:"every even month",value:"*/2"},{name:"".concat(e.every||"every"," 3"),value:"*/3"},{name:"".concat(e.every||"every"," 6"),value:"*/6"},{name:null!==(N=e.Jan)&&void 0!==N?N:"Jan",value:"1"},{name:null!==(j=e.Feb)&&void 0!==j?j:"Feb",value:"2"},{name:null!==(y=e.Mar)&&void 0!==y?y:"Mar",value:"3"},{name:null!==(k=e.Apr)&&void 0!==k?k:"Apr",value:"4"},{name:null!==(_=e.May)&&void 0!==_?_:"May",value:"5"},{name:null!==(S=e.Jun)&&void 0!==S?S:"Jun",value:"6"},{name:null!==(w=e.Jul)&&void 0!==w?w:"Jul",value:"7"},{name:null!==(A=e.Aug)&&void 0!==A?A:"Aug",value:"8"},{name:null!==(C=e.Sep)&&void 0!==C?C:"Sep",value:"9"},{name:null!==(D=e.Oct)&&void 0!==D?D:"Oct",value:"10"},{name:null!==(M=e.Nov)&&void 0!==M?M:"Nov",value:"11"},{name:null!==(F=e.Dec)&&void 0!==F?F:"Dec",value:"12"}],dateOptions:[{name:"1",value:"1"},{name:"2",value:"2"},{name:"3",value:"3"},{name:"4",value:"4"},{name:"5",value:"5"},{name:"6",value:"6"},{name:"7",value:"7"},{name:"8",value:"8"},{name:"9",value:"9"},{name:"10",value:"10"},{name:"11",value:"11"},{name:"12",value:"12"},{name:"13",value:"13"},{name:"14",value:"14"},{name:"15",value:"15"},{name:"16",value:"16"},{name:"17",value:"17"},{name:"18",value:"18"},{name:"19",value:"19"},{name:"20",value:"20"},{name:"21",value:"21"},{name:"22",value:"22"},{name:"23",value:"23"},{name:"24",value:"24"},{name:"25",value:"25"},{name:"26",value:"26"},{name:"27",value:"27"},{name:"28",value:"28"},{name:"29",value:"29"},{name:"30",value:"30"},{name:"31",value:"31"}]}},Zt=function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(n.useState)({activeTab:""}),r=Object(A.a)(a,2),l=r[0],s=r[1];Object(n.useEffect)((function(){s(Object(u.a)(Object(u.a)({},l),{},{activeTab:e.activeTab}))}),[e]);return c.a.createElement("div",{class:"form-group run-command"},c.a.createElement("label",{htmlFor:"run-command"},t["Run Command"],":"),c.a.createElement("select",{className:"form-control",name:function(){switch(l.activeTab){case"1":return"h_min";case"2":return"h_hour";case"3":return"h_day";case"4":return"h_wday";case"5":return"h_month"}}()},function(){var e=Xt(t),a=e.daysRunCommandsOptions,n=e.hoursRunCommandsOptions,r=e.minutesRunCommandsOptions,o=e.monthlyRunCommandOptions,s=e.weeklyRunCommandOptions;switch(l.activeTab){case"1":return r.map((function(e){return c.a.createElement("option",{value:e.value},e.name)}));case"2":return n.map((function(e){return c.a.createElement("option",{value:e.value},e.name)}));case"3":return a.map((function(e){return c.a.createElement("option",{value:e.value},e.name)}));case"4":return s.map((function(e){return c.a.createElement("option",{value:e.value},e.name)}));case"5":return o.map((function(e){return c.a.createElement("option",{value:e.value},e.name)}))}}()))};function $t(){var e,t=Object(o.d)((function(e){return e.session})).i18n,a=Xt(t).hourlyMinutesOptions;return c.a.createElement("div",{className:"second-tab-selects"},c.a.createElement("input",{type:"hidden",name:"h_day",value:"*"}),c.a.createElement("input",{type:"hidden",name:"h_month",value:"*"}),c.a.createElement("input",{type:"hidden",name:"h_wday",value:"*"}),c.a.createElement("div",{className:"form-group minute"},c.a.createElement("label",{htmlFor:"run-command"},null!==(e=t.Minute)&&void 0!==e?e:"Minute",":"),c.a.createElement("select",{className:"form-control",name:"h_min"},a.map((function(e,t){return c.a.createElement("option",{key:t,value:e.value},e.name)})))))}function ea(){var e,t,a=Object(o.d)((function(e){return e.session})).i18n,n=Xt(a),r=n.dailyMinutesOptions,l=n.hoursOptions;return c.a.createElement("div",{className:"third-tab-selects"},c.a.createElement("input",{type:"hidden",name:"h_month",value:"*"}),c.a.createElement("input",{type:"hidden",name:"h_wday",value:"*"}),c.a.createElement("div",{className:"form-group hour"},c.a.createElement("label",{htmlFor:"run-command"},null!==(e=a.Hour)&&void 0!==e?e:"Hour",":"),c.a.createElement("select",{className:"form-control",name:"h_hour"},l.map((function(e,t){return c.a.createElement("option",{key:t,value:e.value},e.name)})))),c.a.createElement("div",{className:"form-group minute"},c.a.createElement("label",{htmlFor:"run-command"},null!==(t=a.Minute)&&void 0!==t?t:"Minute",":"),c.a.createElement("select",{className:"form-control",name:"h_min"},r.map((function(e,t){return c.a.createElement("option",{key:t,value:e.value},e.name)})))))}function ta(){var e,t,a=Object(o.d)((function(e){return e.session})).i18n,n=Xt(a),r=n.dailyMinutesOptions,l=n.hoursOptions;return c.a.createElement("div",{className:"fourth-tab-selects"},c.a.createElement("input",{type:"hidden",name:"h_month",value:"*"}),c.a.createElement("input",{type:"hidden",name:"h_day",value:"*"}),c.a.createElement("div",{className:"form-group hour"},c.a.createElement("label",{htmlFor:"run-command"},null!==(e=a.Hour)&&void 0!==e?e:"Hour",":"),c.a.createElement("select",{className:"form-control",name:"h_hour"},l.map((function(e,t){return c.a.createElement("option",{key:t,value:e.value},e.name)})))),c.a.createElement("div",{className:"form-group minute"},c.a.createElement("label",{htmlFor:"run-command"},null!==(t=a.Minute)&&void 0!==t?t:"Minute",":"),c.a.createElement("select",{className:"form-control",name:"h_min"},r.map((function(e,t){return c.a.createElement("option",{key:t,value:e.value},e.name)})))))}function aa(){var e,t,a,n=Object(o.d)((function(e){return e.session})).i18n,r=Xt(n),l=r.dailyMinutesOptions,s=r.hoursOptions,i=r.dateOptions;return c.a.createElement("div",{className:"fifth-tab-selects"},c.a.createElement("input",{type:"hidden",name:"h_wday",value:"*"}),c.a.createElement("div",{className:"form-group date"},c.a.createElement("label",{htmlFor:"run-command"},null!==(e=n.Date)&&void 0!==e?e:"Date",":"),c.a.createElement("select",{className:"form-control",name:"h_day"},i.map((function(e,t){return c.a.createElement("option",{key:t,value:e.value},e.name)})))),c.a.createElement("div",{className:"form-group hour"},c.a.createElement("label",{htmlFor:"run-command"},null!==(t=n.Hour)&&void 0!==t?t:"Hour",":"),c.a.createElement("select",{className:"form-control",name:"h_hour"},s.map((function(e,t){return c.a.createElement("option",{key:t,value:e.value},e.name)})))),c.a.createElement("div",{className:"form-group minute"},c.a.createElement("label",{htmlFor:"run-command"},null!==(a=n.Minute)&&void 0!==a?a:"Minute",":"),c.a.createElement("select",{className:"form-control",name:"h_min"},l.map((function(e,t){return c.a.createElement("option",{key:t,value:e.value},e.name)})))))}a(227);var na=function(e){var t=Object(n.useState)({activeTab:""}),a=Object(A.a)(t,2),r=a[0],l=a[1];Object(n.useEffect)((function(){l(Object(u.a)(Object(u.a)({},r),{},{activeTab:e.activeTab}))}),[e.activeTab]);return c.a.createElement("div",{className:"tab-".concat(r.activeTab)},function(){switch(r.activeTab){case"1":return c.a.createElement("div",null,c.a.createElement("input",{type:"hidden",name:"h_hour",value:"*"}),c.a.createElement("input",{type:"hidden",name:"h_day",value:"*"}),c.a.createElement("input",{type:"hidden",name:"h_month",value:"*"}),c.a.createElement("input",{type:"hidden",name:"h_wday",value:"*"}));case"2":return c.a.createElement($t,null);case"3":return c.a.createElement(ea,null);case"4":return c.a.createElement(ta,null);case"5":return c.a.createElement(aa,null)}}())},ca=(a(228),function(e){var t=Object(n.useRef)(null),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(R.g)(),l=Object(n.useState)({activeTab:"1"}),s=Object(A.a)(l,2),i=s[0],m=s[1];Object(n.useEffect)((function(){var e=ge.a.parse(r.location.search,{ignoreQueryPrefix:!0}).activeTab||"1";m(Object(u.a)(Object(u.a)({},i),{},{activeTab:e}))}),[r.location.search]);var d=function(e){return i.activeTab===e?"active":""},E=function(t){var a=e.job,n=e.mode;return"/".concat(n,"/cron/?").concat(a?"job=".concat(a,"&"):"","activeTab=").concat(t)};return c.a.createElement("div",{className:"cron-job-generator"},c.a.createElement("div",{className:"header"},c.a.createElement(pe.b,{to:E("1"),className:d("1")},a.Minutes),c.a.createElement(pe.b,{to:E("2"),className:d("2")},a.Hourly),c.a.createElement(pe.b,{to:E("3"),className:d("3")},a.Daily),c.a.createElement(pe.b,{to:E("4"),className:d("4")},a.Weekly),c.a.createElement(pe.b,{to:E("5"),className:d("5")},a.Monthly)),c.a.createElement("div",{className:"body"},c.a.createElement("form",{ref:t},c.a.createElement(Zt,{activeTab:i.activeTab}),c.a.createElement(na,{activeTab:i.activeTab}),c.a.createElement("div",{className:"form-actions"},c.a.createElement("button",{type:"button",onClick:function(){for(var a={},n=0;n<=4;n++){var c=t.current[n];a[c.name]=c.value}e.generatedCronJob(a)}},a.Generate)))))}),ra=(a(229),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(R.g)(),l=Object(o.c)(),s=Object(n.useState)(""),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)(""),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({data:{},loading:!1,generatedCronJob:{h_min:"*",h_hour:"*",h_day:"*",h_wday:"*",h_month:"*"}}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){var e=ge.a.parse(r.location.search,{ignoreQueryPrefix:!0}).job;l(Be("/list/cron/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),e&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),N(e))}),[]);var N=function(e){(function(e){return be.a.get(Gt+"/api/v1/edit/cron/index.php",{params:{job:e,token:He()}})})(e).then((function(e){O(Object(u.a)(Object(u.a)({},g),{},{generatedCronJob:Object(u.a)(Object(u.a)({},g.generatedCronJob),{},{h_min:e.data.min,h_hour:e.data.hour,h_day:e.data.day,h_wday:e.data.wday,h_month:e.data.month}),data:e.data,loading:!1}))})).catch((function(e){O(Object(u.a)(Object(u.a)({},g),{},{loading:!1})),console.error(e)}))},j=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],o=c[1];a[r]=o}}catch(s){n.e(s)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),function(e,t){var a=new FormData;for(var n in e)a.append(n,e[n]);return be.a.post(Gt+"/api/v1/edit/cron/index.php",a,{params:{job:t,token:He()}})}(a,g.data.job).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(f(""),d(a)):l(et()).then((function(){f(n),d("")}))}})).then((function(){return N(g.data.job)})).catch((function(e){return console.error(e)})))},y=function(e){var t=Object(u.a)(Object(u.a)({},g.generatedCronJob),{},Object(M.a)({},e.id,e.value));O(Object(u.a)(Object(u.a)({},g),{},{generatedCronJob:t}))};return c.a.createElement("div",{className:"edit-template edit-cron"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.CRON))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},a["Editing Cron Job"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",m)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},v?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(v))))),c.a.createElement(Qe,{date:g.data.date,time:g.data.time,status:g.data.status},g.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return j(e)},id:"edit-cron"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:t}),c.a.createElement(ze,{id:"command",name:"v_cmd",title:a.Command,value:g.data.cmd}),c.a.createElement("div",{className:"cron-form-body"},c.a.createElement("div",{className:"body-col-1"},c.a.createElement(ze,{value:g.generatedCronJob.h_min,onChange:y,title:a.Minute,name:"v_min",id:"h_min"}),c.a.createElement(ze,{value:g.generatedCronJob.h_hour,onChange:y,title:a.Hour,name:"v_hour",id:"h_hour"}),c.a.createElement(ze,{value:g.generatedCronJob.h_day,onChange:y,title:a.Day,name:"v_day",id:"h_day"}),c.a.createElement(ze,{value:g.generatedCronJob.h_month,onChange:y,title:a.Month,name:"v_month",id:"h_month"}),c.a.createElement(ze,{value:g.generatedCronJob.h_wday,title:a["Day of week"],onChange:y,name:"v_wday",id:"h_wday"})),c.a.createElement("div",{className:"body-col-2"},c.a.createElement(ca,{mode:"edit",job:g.data.job,generatedCronJob:function(e){O(Object(u.a)(Object(u.a)({},g),{},{generatedCronJob:e}))}}))),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return r.push("/list/cron/")}},a.Back)))))}),la=function(e){var t=Object(n.useState)({value:"",previousValue:""}),a=Object(A.a)(t,2),r=a[0],l=a[1];Object(n.useEffect)((function(){l(Object(u.a)(Object(u.a)({},r),{},{value:e.value}))}),[e.value]),Object(n.useEffect)((function(){l(Object(u.a)(Object(u.a)({},r),{},{value:e.value,previousValue:e.value}))}),[]);return c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:e.id},e.title,c.a.createElement("span",{className:"lowercase"},e.optionalTitle?"(".concat(e.optionalTitle,")"):"")),c.a.createElement("div",{className:"input-wrapper"},c.a.createElement("input",{type:"text",name:e.name,id:e.id,className:"form-control",onChange:function(e){var t=e.target.value;l(Object(u.a)(Object(u.a)({},r),{},{value:t,previousValue:t}))},value:r.value,readOnly:"unlimited"===r.value}),e.children))},oa=function(e){var t,a,r=Object(o.d)((function(e){return e.session})).i18n,l=Object(n.useState)({nameServersAmount:[],usersNS:[]}),s=Object(A.a)(l,2),i=s[0],m=s[1];Object(n.useEffect)((function(){if(e.usersNS){var t=e.usersNS.map((function(e,t){return t+1}));m(Object(u.a)(Object(u.a)({},i),{},{usersNS:e.usersNS,nameServersAmount:t}))}}),[e.usersNS]);var d=function(e){var t=Object(I.a)(i.nameServersAmount);t.splice(e-1,1),m(Object(u.a)(Object(u.a)({},i),{},{nameServersAmount:t}))};return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"form-group name-servers"},c.a.createElement("label",{htmlFor:"v_ns1"},null!==(t=r["Name servers"])&&void 0!==t?t:"Name servers"),i.nameServersAmount.map((function(e,t){var a;if(e<9)return c.a.createElement("div",{className:"name-server-input-wrapper",key:t},c.a.createElement("input",{type:"text",className:"form-control",id:"v_ns".concat(t+1),defaultValue:i.usersNS[t]||"",name:"v_ns".concat(t+1)}),c.a.createElement("button",{type:"button",className:t<2?"hide":"show delete",onClick:function(){return d(t)}},null!==(a=r.delete)&&void 0!==a?a:"Delete"))}))),c.a.createElement("button",{type:"button",className:8===i.nameServersAmount.length?"hide":"show optional",onClick:function(){return function(){var e=i.nameServersAmount.length,t=Object(I.a)(i.nameServersAmount);t.push(e+1),m(Object(u.a)(Object(u.a)({},i),{},{nameServersAmount:t}))}()}},null!==(a=r["Add one more Name Server"])&&void 0!==a?a:"Add one more Name Server"))},sa=window.location.origin,ia=function(){return be.a.get(sa+"/api/v1/list/package/index.php")},ua=(a(230),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(R.g)(),l=Object(o.c)(),s=Object(n.useState)(""),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)(""),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({data:{},loading:!1}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){var e=ge.a.parse(r.location.search,{ignoreQueryPrefix:!0});l(Be("/list/package/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),e.package&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),N(e.package))}),[]);var N=function(e){var t;(t=e,be.a.get(sa+"/api/v1/edit/package/index.php",{params:{package:t,token:He()}})).then((function(e){O(Object(u.a)(Object(u.a)({},g),{},{data:e.data,loading:!1}))})).catch((function(e){O(Object(u.a)(Object(u.a)({},g),{},{loading:!1})),console.error(e)}))},j=function(e){var t,a=g.data[e];t="quota"===e||"bandwidth"===e?"1000":"1",O(Object(u.a)(Object(u.a)({},g),{},{data:Object(u.a)(Object(u.a)({},g.data),{},Object(M.a)({},e,"unlimited"!==a?"unlimited":t))}))};return c.a.createElement("div",{className:"edit-template edit-package"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.PACKAGE))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},a["Editing Package"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",m)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},v?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(v))))),c.a.createElement(Qe,{date:g.data.date,time:g.data.time,status:g.data.status},g.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){e.preventDefault();var a,n={},c=Object(We.a)(new FormData(e.target).entries());try{for(c.s();!(a=c.n()).done;){var r=Object(A.a)(a.value,2),o=r[0],s=r[1];n[o]=s}}catch(i){c.e(i)}finally{c.f()}n.token=t,n.save="save",n.v_package=g.data.package,0!==Object.keys(n).length&&n.constructor===Object&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),function(e,t){var a=new FormData;for(var n in e)a.append(n,e[n]);return be.a.post(sa+"/api/v1/edit/package/index.php",a,{params:{package:t}})}(n,g.data.package).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(d(a),f("")):l(et()).then((function(){d(""),f(n)}))}})).then((function(){return N(g.data.package)})).catch((function(e){return console.error(e)})))},id:"edit-package"},c.a.createElement(ze,{id:"domain",name:"v_domain",title:a["Package Name"],value:g.data.package,disabled:!0}),c.a.createElement(Je,{optionalTitle:g.data.web_system,options:g.data.web_templates,selected:g.data.web_template,title:a["Web Template"],name:"v_web_template",id:"web-templates"}),g.data.web_backend&&c.a.createElement(Je,{optionalTitle:g.data.web_backend,options:g.data.backend_templates,selected:g.data.backend_template,title:a["Backend Template"],name:"v_backend_template",id:"backend-templates"}),g.data.proxy_system&&c.a.createElement(Je,{optionalTitle:g.data.proxy_system,options:g.data.proxy_templates,selected:g.data.proxy_template,title:a["Proxy Template"],name:"v_proxy_template",id:"proxy-templates"}),g.data.dns_system&&c.a.createElement(Je,{optionalTitle:g.data.dns_system,options:g.data.dns_templates,selected:g.data.dns_template,title:a["DNS Template"],name:"v_dns_template",id:"dns-templates"}),c.a.createElement(Je,{options:g.data.shells,selected:g.data.shell,title:a["SSH Access"],name:"v_shell",id:"ssh-access"}),c.a.createElement(la,{title:a["Web Domains"],id:"webDomains",name:"v_web_domains",value:g.data.web_domains},c.a.createElement("button",{type:"button",onClick:function(){return j("web_domains")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["Web Aliases"],optionalTitle:a["per domain"],id:"webAliases",name:"v_web_aliases",value:g.data.web_aliases},c.a.createElement("button",{type:"button",onClick:function(){return j("web_aliases")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["DNS Domains"],id:"dnsDomains",name:"v_dns_domains",value:g.data.dns_domains},c.a.createElement("button",{type:"button",onClick:function(){return j("dns_domains")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["DNS records"],optionalTitle:a["per domain"],id:"dnsRecords",name:"v_dns_records",value:g.data.dns_records},c.a.createElement("button",{type:"button",onClick:function(){return j("dns_records")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["Mail Domains"],id:"mailDomains",name:"v_mail_domains",value:g.data.mail_domains},c.a.createElement("button",{type:"button",onClick:function(){return j("mail_domains")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["Mail Accounts"],optionalTitle:a["per domain"],id:"mailAccounts",name:"v_mail_accounts",value:g.data.mail_accounts},c.a.createElement("button",{type:"button",onClick:function(){return j("mail_accounts")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a.Databases,id:"databases",name:"v_databases",value:g.data.databases},c.a.createElement("button",{type:"button",onClick:function(){return j("databases")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["Cron Jobs"],id:"cronJobs",name:"v_cron_jobs",value:g.data.cron_jobs},c.a.createElement("button",{type:"button",onClick:function(){return j("cron_jobs")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(ze,{name:"v_backups",id:"backups",value:g.data.backups,title:a.Backups}),c.a.createElement(la,{title:a.Quota,optionalTitle:a["in megabytes"],id:"quota",name:"v_disk_quota",value:g.data.disk_quota},c.a.createElement("button",{type:"button",onClick:function(){return j("disk_quota")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a.Bandwidth,optionalTitle:a["in megabytes"],id:"bandwidth",name:"v_bandwidth",value:g.data.bandwidth},c.a.createElement("button",{type:"button",onClick:function(){return j("bandwidth")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(oa,{usersNS:g.data.nameservers}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return r.push("/list/package/")}},a.Back)))))}),ma=(a(231),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(R.g)(),l=Object(o.c)(),s=Object(n.useState)(""),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)(""),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({data:{},loading:!1,errorMessage:"",okMessage:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){l(Be("/list/server/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),N()}),[]);var N=function(){it("httpd").then((function(e){O(Object(u.a)(Object(u.a)({},g),{},{data:e.data,loading:!1}))})).catch((function(e){O(Object(u.a)(Object(u.a)({},g),{},{loading:!1})),console.error(e)}))};return c.a.createElement("div",{className:"edit-template edit-httpd"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.SERVER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},c.a.createElement(pe.b,{to:"/edit/server/".concat(g.data.service_name)},a["Configuring Server"]," / ",g.data.service_name)),c.a.createElement("div",{className:"link"},c.a.createElement(pe.b,{to:"/edit/server/php"},a.Configure," php.ini")),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",m)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},v?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(v))))),c.a.createElement(Qe,null,g.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),st(a,"/httpd").then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(d(a),f("")):(d(""),f(n))}})).then((function(){return N()})).catch((function(e){return console.error(e)})))}(e)},id:"edit-httpd"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:t}),c.a.createElement(rt,{defaultValue:g.data.config,title:g.data.config_path,name:"v_config",id:"v_config",rows:"25"}),c.a.createElement("br",null),c.a.createElement(Ye,{title:a.restart,defaultChecked:!0,name:"v_restart",id:"restart"}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return r.push("/list/server/")}},a.Back)))))}),da=(a(232),function(e){var t,a,r,l,s,i,m,d,E=Object(o.d)((function(e){return e.session})).i18n,p=localStorage.getItem("token"),v=Object(R.g)(),f=Object(o.c)(),b=Object(n.useState)({loading:!1,okMessage:"",errorMessage:"",generatedCronJob:{h_min:"*",h_hour:"*",h_day:"*",h_wday:"*",h_month:"*"}}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){f(Be("/list/cron/")),f({type:"REMOVE_FOCUSED_ELEMENT",value:""})}),[]);var N=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.post(Gt+"/api/v1/add/cron/index.php",t)}(a).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?O(Object(u.a)(Object(u.a)({},g),{},{errorMessage:a,okMessage:n,loading:!1})):f(et()).then((function(){O(Object(u.a)(Object(u.a)({},g),{},{okMessage:n,errorMessage:"",loading:!1}))}))}})).catch((function(e){return console.error(e)})))},j=function(e){var t=Object(u.a)(Object(u.a)({},g.generatedCronJob),{},Object(M.a)({},e.id,e.value));O(Object(u.a)(Object(u.a)({},g),{},{generatedCronJob:t}))};return c.a.createElement("div",{className:"edit-template add-cron"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(E.CRON))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},E["Adding Cron Job"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},g.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",g.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},g.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",c.a.createElement("span",null,at()(g.okMessage))))),c.a.createElement(Qe,null,g.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return N(e)}},c.a.createElement("input",{type:"hidden",name:"ok",value:"add"}),c.a.createElement("input",{type:"hidden",name:"token",value:p}),c.a.createElement("div",{className:"form-group command"},c.a.createElement("label",{htmlFor:"command"},null!==(t=E.Command)&&void 0!==t?t:"Command"),c.a.createElement("input",{type:"text",className:"form-control",id:"command",name:"v_cmd"})),c.a.createElement("div",{className:"cron-form-body"},c.a.createElement("div",{className:"body-col-1"},c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"h_min"},null!==(a=E.Minute)&&void 0!==a?a:"Minute"),c.a.createElement("input",{type:"text",className:"form-control",id:"h_min",onChange:function(e){return j(e.target)},value:g.generatedCronJob.h_min,name:"v_min"})),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"h_hour"},null!==(r=E.Hour)&&void 0!==r?r:"Hour"),c.a.createElement("input",{type:"text",className:"form-control",id:"h_hour",onChange:function(e){return j(e.target)},value:g.generatedCronJob.h_hour,name:"v_hour"})),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"h_day"},null!==(l=E.Day)&&void 0!==l?l:"Day"),c.a.createElement("input",{type:"text",className:"form-control",id:"h_day",onChange:function(e){return j(e.target)},value:g.generatedCronJob.h_day,name:"v_day"})),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"h_month"},null!==(s=E.Month)&&void 0!==s?s:"Month"),c.a.createElement("input",{type:"text",className:"form-control",id:"h_month",onChange:function(e){return j(e.target)},value:g.generatedCronJob.h_month,name:"v_month"})),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"h_wday"},null!==(i=E["Day of week"])&&void 0!==i?i:"Days of week"),c.a.createElement("input",{type:"text",className:"form-control",id:"h_wday",onChange:function(e){return j(e.target)},value:g.generatedCronJob.h_wday,name:"v_wday"}))),c.a.createElement("div",{className:"body-col-2"},c.a.createElement(ca,{mode:"add",generatedCronJob:function(e){O(Object(u.a)(Object(u.a)({},g),{},{generatedCronJob:e}))}}))),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},null!==(m=E.Add)&&void 0!==m?m:"Add"),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return v.push("/list/cron/")}},null!==(d=E.Back)&&void 0!==d?d:"Back")))))}),Ea=(a(233),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(o.c)(),l=Object(R.g)(),s=Object(n.useState)({loading:!1,okMessage:"",errorMessage:"",webTemplates:[],webSystem:"",backendTemplates:[],backendSystem:"",proxySystem:"",proxyTemplates:[],dnsTemplates:[],dnsSystem:"",sshTemplates:[],usersNS:[],webDomains:"1",webAliases:"1",dnsDomains:"1",dnsRecords:"1",mailDomains:"1",mailAccounts:"1",databases:"1",cronJobs:"1",quota:"1000",bandwidth:"1000"}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){r(Be("/list/package/")),r({type:"REMOVE_FOCUSED_ELEMENT",value:""}),d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),E()}),[]);var E=function(){be.a.get(sa+"/api/v1/add/package/index.php").then((function(e){d(Object(u.a)(Object(u.a)({},m),{},{webTemplates:e.data.web_templates,webSystem:e.data.web_system,backendTemplates:e.data.backend_templates,backendSystem:e.data.web_backend,dnsTemplates:e.data.dns_templates,dnsSystem:e.data.dns_system,proxySystem:e.data.proxy_system,proxyTemplates:e.data.proxy_templates,sshTemplates:e.data.ssh_access,loading:!1}))})).catch((function(e){return console.err(e)}))},p=function(e){e.preventDefault();var a,n={},c=Object(We.a)(new FormData(e.target).entries());try{for(c.s();!(a=c.n()).done;){var l=Object(A.a)(a.value,2),o=l[0],s=l[1];n[o]=s}}catch(i){c.e(i)}finally{c.f()}n.token=t,n.ok="Add",0!==Object.keys(n).length&&n.constructor===Object&&(d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.post(sa+"/api/v1/add/package/index.php",t)}(n).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?d(Object(u.a)(Object(u.a)({},m),{},{errorMessage:a,okMessage:n,loading:!1})):r(et()).then((function(){d(Object(u.a)(Object(u.a)({},m),{},{okMessage:n,errorMessage:"",loading:!1}))}))}})).catch((function(e){return console.error(e)})))},v=function(e){var t,a=m[e];t="quota"===e||"bandwidth"===e?"1000":"1",d("unlimited"!==a?Object(u.a)(Object(u.a)({},m),{},Object(M.a)({},e,"unlimited")):Object(u.a)(Object(u.a)({},m),{},Object(M.a)({},e,t)))};return c.a.createElement("div",{className:"edit-template add-package"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.PACKAGE))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},a["Adding Package"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",m.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},m.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",c.a.createElement("span",null,at()(m.okMessage))))),c.a.createElement(Qe,null,m.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return p(e)}},c.a.createElement(ze,{name:"v_package",id:"packageName",title:a["Package Name"]}),c.a.createElement(Je,{options:m.webTemplates,name:"v_web_template",id:"webTemplates",title:a["Web Template"],optionalTitle:m.webSystem}),c.a.createElement(Je,{options:m.backendTemplates,name:"v_backend_template",id:"backendTemplates",title:a["Backend Template"],optionalTitle:m.backendSystem}),c.a.createElement(Je,{options:m.proxyTemplates,name:"v_proxy_template",id:"proxyTemplates",title:a["Proxy Template"],optionalTitle:m.proxySystem}),c.a.createElement(Je,{options:m.dnsTemplates,name:"v_dns_template",id:"dnsTemplates",title:a["DNS Template"],optionalTitle:m.dnsSystem}),c.a.createElement(Je,{options:m.sshTemplates,name:"v_shell",id:"shells",title:a["SSH Access"]}),c.a.createElement(la,{title:a["Web Domains"],id:"webDomains",name:"v_web_domains",value:m.webDomains},c.a.createElement("button",{type:"button",onClick:function(){return v("webDomains")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["Web Aliases"],optionalTitle:a["per domain"],id:"webAliases",name:"v_web_aliases",value:m.webAliases},c.a.createElement("button",{type:"button",onClick:function(){return v("webAliases")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["DNS Domains"],id:"dnsDomains",name:"v_dns_domains",value:m.dnsDomains},c.a.createElement("button",{type:"button",onClick:function(){return v("dnsDomains")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["DNS records"],optionalTitle:a["per domain"],id:"dnsRecords",name:"v_dns_records",value:m.dnsRecords},c.a.createElement("button",{type:"button",onClick:function(){return v("dnsRecords")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["Mail Domains"],id:"mailDomains",name:"v_mail_domains",value:m.mailDomains},c.a.createElement("button",{type:"button",onClick:function(){return v("mailDomains")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["Mail Accounts"],optionalTitle:a["per domain"],id:"mailAccounts",name:"v_mail_accounts",value:m.mailAccounts},c.a.createElement("button",{type:"button",onClick:function(){return v("mailAccounts")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a.Databases,id:"databases",name:"v_databases",value:m.databases},c.a.createElement("button",{type:"button",onClick:function(){return v("databases")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a["Cron Jobs"],id:"cronJobs",name:"v_cron_jobs",value:m.cronJobs},c.a.createElement("button",{type:"button",onClick:function(){return v("cronJobs")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(ze,{name:"v_backups",id:"backups",value:"1",title:a.Backups}),c.a.createElement(la,{title:a.Quota,optionalTitle:a["in megabytes"],id:"quota",name:"v_disk_quota",value:m.quota},c.a.createElement("button",{type:"button",onClick:function(){return v("quota")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(la,{title:a.Bandwidth,optionalTitle:a["in megabytes"],id:"bandwidth",name:"v_bandwidth",value:m.bandwidth},c.a.createElement("button",{type:"button",onClick:function(){return v("bandwidth")}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(oa,{usersNS:["ns1.example.ltd","ns2.example.ltd"]}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Add),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return l.push("/list/package/")}},a.Back)))))}),pa=function(e){var t=e.proxySystem,a=e.webSystem,n=e.webBackend,r=e.webBackendPool,l=e.visible,s=void 0!==l&&l,i=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:"server-web-option",style:{display:"".concat(s?"block":"none")}},t&&c.a.createElement(ze,{optionalTitle:c.a.createElement(pe.b,{to:"/edit/server/".concat(t)},i.configure),title:i["Proxy Server"]+" / ",name:"v_proxy_system",value:t,id:"proxy_system",disabled:!0}),a&&c.a.createElement(ze,{optionalTitle:c.a.createElement(pe.b,{to:"/edit/server/".concat(a)},i.configure),title:i["Web Server"]+" / ",name:"v_web_system",value:a,id:"web_system",disabled:!0}),n&&c.a.createElement(ze,{title:i["Backend Server"],name:"v_web_backend",value:n,id:"web_backend",disabled:!0}),r&&c.a.createElement(ze,{optionalTitle:c.a.createElement(pe.b,{to:"/edit/server/".concat(r)},i.configure),title:i["Backend Pool Mode"],name:"v_web_backend_pool",value:r,id:"web_backend_pool",disabled:!0}))},va=function(e){var t=e.dnsSystem,a=e.selected,n=e.dnsCluster,r=e.visible,l=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:"server-dns-option",style:{display:"".concat(r?"block":"none")}},c.a.createElement(ze,{optionalTitle:c.a.createElement(pe.b,{to:"/edit/server/".concat(t)},l.configure),title:l["DNS Server"]+" / ",name:"v_dns_system",value:t,id:"dns_system",disabled:!0}),c.a.createElement(Je,{title:l["DNS Cluster"],selected:a,options:[l.no,l.yes],name:"v_dns_cluster",id:"dns-cluster",disabled:!0}),"yes"===a&&c.a.createElement("div",{className:"hosts-wrapper"},Object.keys(n).map((function(e,t){return c.a.createElement(ze,{title:"".concat(l["DNS Server"]," #").concat(t+1),name:"v_dns_remote_host",id:"dns-remote-host",value:e,disabled:!0})}))))},fa=function(e){var t,a=e.data,r=e.visible,l=Object(o.d)((function(e){return e.session})).i18n,s=Object(o.d)((function(e){return e.userSession})).session,i=Object(n.useState)(a.lead||s.SFTPJAIL_KEY?"yes":"no"),u=Object(A.a)(i,2),m=u[0],d=u[1],E=Object(n.useState)(a.fm_lead||s.FILEMANAGER_KEY?"yes":"no"),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)("yes"===s.SOFTACULOUS?"yes":"no"),h=Object(A.a)(b,2),g=h[0],O=h[1];return c.a.createElement("div",{className:"server-plugins-option",style:{display:"".concat(r?"block":"none")}},c.a.createElement(ze,{title:l.Version,value:a.version,name:"v_version",id:"version",disabled:!0}),c.a.createElement("div",{className:"form-group select-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:"quota"},l["FileSystem Disk Quota"]),c.a.createElement("select",{className:"form-control",id:"quota",name:"v_quota"},c.a.createElement("option",{value:"no"},l.no),c.a.createElement("option",{value:"yes",selected:"yes"===a.disk_quota},l.yes))),c.a.createElement("br",null),c.a.createElement("div",{className:"form-group select-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:"firewall"},l.Firewall),c.a.createElement("select",{className:"form-control",id:"firewall",name:"v_firewall"},c.a.createElement("option",{value:"no"},l.no),c.a.createElement("option",{value:"yes",selected:"iptables"===a.firewall_system},l.yes))),c.a.createElement(Je,{title:l["Reseller Role"],options:[l.no],name:"v_reseller",id:"reseller",disabled:!0}),c.a.createElement(Je,{title:l["Backup Migration Manager"],options:[l.no],name:"v_backup_manager",id:"backup_manager",disabled:!0}),c.a.createElement("div",{className:"form-group select-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:"sftp"},l["SFTP Chroot"]),c.a.createElement("select",{className:"form-control",id:"sftp",name:"v_sftp",onChange:function(e){return d(e.target.value)}},s.SFTPJAIL_KEY?c.a.createElement("option",{value:"cancel"},l["Disable and Cancel Licence"]):c.a.createElement("option",{value:"no"},l.no),c.a.createElement("option",{value:"yes",selected:a.lead||s.SFTPJAIL_KEY},l.yes))),function(){if("yes"===m)return!a.sftp_license_key&&s.SFTPJAIL_KEY?c.a.createElement("div",{className:"sftp-module"},c.a.createElement("div",null,l["Restrict users so that they cannot use SSH and access only their home directory."]),c.a.createElement("div",{className:"license-description"},c.a.createElement("span",null,l["Licence Key"],":"),c.a.createElement(ze,{title:l["License Key"],value:a.licence_key,name:"v_sftp_licence",id:"sftp_licence"}))):c.a.createElement("div",{className:"sftp-module"},c.a.createElement(c.a.Fragment,null,c.a.createElement("span",null,l["Restrict users so that they cannot use SSH and access only their home directory."]),c.a.createElement("span",null,l["This is a commercial module, you would need to purchace license key to enable it."])),c.a.createElement("div",{className:"license-description"},c.a.createElement("span",null,l["Enter License Key"],":"),c.a.createElement(ze,{title:l.Version,name:"v_sftp_licence",id:"sftp_licence"})),c.a.createElement("div",{className:"buy-license"},c.a.createElement("a",{href:"https://vestacp.com/checkout/2co.php?product_id=6&referer=".concat(a.http_host)},l["Buy Licence"]," 3$ ",l.month),c.a.createElement("a",{href:"https://vestacp.com/checkout/2co.php?product_id=9&referer=".concat(a.http_host)},l["Buy Lifetime License"]," 18$")),c.a.createElement("span",null,"2Checkout.com Inc. (Ohio, USA) is a payment facilitator for goods and services provided by vestacp.com."))}(),c.a.createElement("br",null),c.a.createElement("div",{className:"form-group select-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:"filemanager"},l["File Manager"]),c.a.createElement("select",{className:"form-control",id:"filemanager",name:"v_filemanager",onChange:function(e){return f(e.target.value)}},s.FILEMANAGER_KEY?c.a.createElement("option",{value:"cancel"},l["Disable and Cancel Licence"]):c.a.createElement("option",{value:"no"},l.no),c.a.createElement("option",{value:"yes",selected:a.fm_lead||s.FILEMANAGER_KEY},l.yes))),function(){if("yes"===v)return!a.fm_license_key&&s.FILEMANAGER_KEY?c.a.createElement("div",{className:"fm-module"},c.a.createElement("div",null,l["Browse, copy, edit, view, and retrieve all of your web domain files using fully featured File Manager."]),c.a.createElement("div",{className:"license-description"},c.a.createElement("span",null,l["Licence Key"],":"),c.a.createElement(ze,{title:l["Licence Key"],value:a.fm_licence_key_option,name:"v_filemanager_licence",id:"filemanager_licence"}))):c.a.createElement("div",{className:"fm-module"},c.a.createElement(c.a.Fragment,null,c.a.createElement("span",null,l["Browse, copy, edit, view, and retrieve all of your web domain files using fully featured File Manager."]),c.a.createElement("span",null,l["This is a commercial module, you would need to purchace license key to enable it."])),c.a.createElement("div",{className:"license-description"},c.a.createElement("span",null,l["Enter License Key"],":"),c.a.createElement(ze,{title:l.Version,value:"",name:"v_filemanager_licence",id:"sftp_licence"})),c.a.createElement("div",{className:"buy-license"},c.a.createElement("a",{href:"https://vestacp.com/checkout/2co.php?product_id=7&referer=".concat(a.http_host),target:"_blank",rel:"noopener noreferrer"},l["Buy Licence"]," 3$ ",l.month),c.a.createElement("a",{href:"https://vestacp.com/checkout/2co.php?product_id=8&referer=".concat(a.http_host),target:"_blank",rel:"noopener noreferrer"},l["Buy Lifetime License"]," 28$")),c.a.createElement("span",null,"2Checkout.com Inc. (Ohio, USA) is a payment facilitator for goods and services provided by vestacp.com."))}(),c.a.createElement("br",null),c.a.createElement("div",{className:"form-group select-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:"softaculous"},null!==(t=l.Softaculous)&&void 0!==t?t:"Softaculous"),c.a.createElement("select",{className:"form-control",id:"softaculous",name:"v_softaculous",onChange:function(e){return O(e.target.value)}},c.a.createElement("option",{value:"no"},l.no),c.a.createElement("option",{value:"yes",selected:a.softaculous_lead||"yes"===s.SOFTACULOUS},l.yes))),function(){var e;if("yes"===g&&"yes"===s.SOFTACULOUS)return c.a.createElement("div",{className:"soft-module"},c.a.createElement("div",null,c.a.createElement("span",{style:{fontWeight:"bolder"}},l["* plugin installation will run in background"]),c.a.createElement("span",null,"Softaculous is a great Auto Installer having 426 great scripts, 1115 PHP Classes and we are still adding more. Softaculous is ideal for Web Hosting companies and it could give a significant boost to your sales. These scripts cover most of the uses a customer could ever have. We have covered a wide array of Categories so that everyone could find the required script one would need to power their Web Site.")),c.a.createElement("div",{className:"buy-license"},c.a.createElement("a",{href:"https://www.softaculous.com/softaculous/",target:"_blank",rel:"noopener noreferrer"},null!==(e=l["Get Premium License"])&&void 0!==e?e:"Get Premium License")))}())},ba=function(e){var t=e.data,a=e.visible,r=Object(o.d)((function(e){return e.session})).i18n,l=Object(n.useState)(!1),s=Object(A.a)(l,2),i=s[0],u=s[1],m=Object(n.useState)([]),d=Object(A.a)(m,2),E=d[0],p=d[1];return Object(n.useEffect)((function(){var e=t.ssl_domains;p(e?[""].concat(Object(I.a)(e)):[""])}),[]),c.a.createElement("div",{className:"server-ssl-option",style:{display:"".concat(a?"block":"none")}},c.a.createElement(Ye,{onChange:function(e){return u(e)},title:r["Use Web Domain SSL Certificate"],defaultChecked:t.vesta_certificate,name:"v_web_ssl_domain_checkbox",id:"web_ssl_domain_checkbox",checked:i}),i&&c.a.createElement("div",{className:"domain-group"},c.a.createElement(Je,{selected:t.vesta_certificate,name:"v_web_ssl_domain",title:r.Domain,options:E,id:"web_ssl_domain"})),c.a.createElement(rt,{title:r["SSL Certificate"],defaultValue:t.sys_ssl_crt,name:"v_sys_ssl_crt",id:"sys_ssl_crt"}),c.a.createElement(rt,{defaultValue:t.sys_ssl_key,id:"sys_ssl_key",name:"v_sys_ssl_key",title:r["SSL Key"]}),c.a.createElement("div",{className:"additional-info"},t.sys_ssl_subject&&c.a.createElement("div",null,c.a.createElement("span",null,r.SUBJECT,":"),c.a.createElement("span",null,t.sys_ssl_subject)),t.sys_ssl_aliases&&c.a.createElement("div",null,c.a.createElement("span",null,r.ALIASES,":"),c.a.createElement("span",null,t.sys_ssl_aliases)),t.sys_ssl_not_before&&c.a.createElement("div",null,c.a.createElement("span",null,r.NOT_BEFORE,":"),c.a.createElement("span",null,t.sys_ssl_not_before)),t.sys_ssl_not_after&&c.a.createElement("div",null,c.a.createElement("span",null,r.NOT_AFTER,":"),c.a.createElement("span",null,t.sys_ssl_not_after)),t.sys_ssl_signature&&c.a.createElement("div",null,c.a.createElement("span",null,r.SIGNATURE,":"),c.a.createElement("span",null,t.sys_ssl_signature)),t.sys_ssl_pub_key&&c.a.createElement("div",null,c.a.createElement("span",null,r.PUB_KEY,":"),c.a.createElement("span",null,t.sys_ssl_pub_key)),t.sys_ssl_issuer&&c.a.createElement("div",null,c.a.createElement("span",null,r.ISSUER,":"),c.a.createElement("span",null,t.sys_ssl_issuer))))},ha=function(e){var t=e.data,a=e.visible,n=Object(o.d)((function(e){return e.userSession.session})),r=n.DB_PMA_URL,l=n.DB_PGA_URL,s=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:"server-mail-option",style:{display:"".concat(a?"block":"none")}},c.a.createElement(Je,{optionalTitle:c.a.createElement(pe.b,{to:"/edit/server/mysql"},s.configure),title:s["MySQL Support"]+" / ",selected:t.mysql,options:[s.no,s.yes],name:"v_mysql",id:"mysql",disabled:!0}),"yes"===t.mysql&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ze,{title:s["phpMyAdmin URL"],value:r,name:"v_mysql_url",id:"mysql_url"}),function(){if(t.mysql_hosts.length)return t.mysql_hosts.map((function(e,t){return c.a.createElement("div",{className:"hosts"},c.a.createElement(ze,{title:"".concat(s.Host," #").concat(t+1),value:e.HOST,name:"v_mysql_host",id:"mysql_host",disabled:!0}),c.a.createElement(ze,{title:s.Password,name:"v_mysql_password",id:"mysql_password"}),c.a.createElement(ze,{title:s["Maximum Number Of Databases"],value:e.MAX_DB,name:"v_mysql_max",id:"mysql_max",disabled:!0}),c.a.createElement(ze,{title:s["Current Number Of Databases"],value:e.U_DB_BASES,name:"v_mysql_max",id:"current-databases",disabled:!0}))}))}()),c.a.createElement(Je,{optionalTitle:c.a.createElement(pe.b,{to:"/edit/server/postgresql"},s.configure),title:s["PostgreSQL Support"]+" / ",selected:t.pgsql,options:[s.no,s.yes],name:"v_pgsql",id:"pgsql",disabled:!0}),"yes"===t.pgsql&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ze,{title:s["phpPgAdmin URL"],value:l,name:"v_pgsql_url",id:"pgsql_url"}),t.pgsql_hosts.map((function(e,t){return c.a.createElement("div",{className:"hosts"},c.a.createElement(ze,{title:"".concat(s.Host," #").concat(t+1),value:e.HOST,name:"v_pgsql_host",id:"pgsql_host",disabled:!0}),c.a.createElement(ze,{title:s["Maximum Number Of Databases"],value:e.MAX_DB,name:"v_psql_max",id:"psql_max",disabled:!0}),c.a.createElement(ze,{title:s["Current Number Of Databases"],value:e.U_DB_BASES,name:"v_pgsql_max",id:"pgsql_current",disabled:!0}))}))))},ga=function(e){var t=e.data,a=e.visible,r=Object(o.d)((function(e){return e.session})).i18n,l=Object(n.useState)(!1),s=Object(A.a)(l,2),i=s[0],u=s[1];return c.a.createElement("div",{className:"server-dns-option",style:{display:"".concat(a?"block":"none")}},c.a.createElement(Je,{options:["no","yes"],title:r["Local backup"],selected:t.backup,name:"v_backup",id:"backup"}),c.a.createElement(Je,{options:["1","2","3","4","5","6","7","8","9"],title:r["Compression level"],selected:t.backup_gzip,name:"v_backup_gzip",id:"backup-gzip"}),c.a.createElement(ze,{title:r.Directory,value:t.backup_dir,name:"v_backup_dir",id:"v-backup-dir"}),c.a.createElement("button",{type:"button",onClick:function(){return u(!i)}},r["Remote backup"],i?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),i&&c.a.createElement("div",{style:{transform:"translateX(3rem)"}},c.a.createElement("br",null),c.a.createElement(Je,{selected:t.backup_type,options:t.protocols,title:r.Protocol,name:"v_backup_type",id:"backup_type"}),c.a.createElement(ze,{title:r.Host,value:t.backup_host,name:"v_backup_host",id:"backup_host"}),c.a.createElement(ze,{title:r.Username,value:t.backup_username,name:"v_backup_username",id:"backup_username"}),c.a.createElement(ze,{title:r.Password,value:t.backup_password,name:"v_backup_password",id:"backup_password"}),c.a.createElement(ze,{title:r.Directory,value:t.backup_bpath,name:"v_backup_bpath",id:"backup_bpath"})))},Oa=function(e){var t=e.data,a=e.visible,r=Object(o.d)((function(e){return e.userSession.session})).MAIL_URL,l=Object(o.d)((function(e){return e.session})).i18n,s=Object(n.useState)(!1),i=Object(A.a)(s,2),u=i[0],m=i[1];Object(n.useEffect)((function(){t.mail_certificate&&m(!0)}),[]);return c.a.createElement("div",{className:"server-mail-option",style:{display:"".concat(a?"block":"none")}},c.a.createElement(ze,{optionalTitle:c.a.createElement(pe.b,{to:"/edit/server/".concat(t.mail_system)},l.configure),title:l["MAIL Server"]+" / ",name:"v_mail_system",value:t.mail_system,id:"mail_system",disabled:!0}),t.antivirus_system&&c.a.createElement(ze,{optionalTitle:c.a.createElement(pe.b,{to:"/edit/server/".concat(t.antivirus_system)},l.configure),title:l.Antivirus+" / ",name:"v_antivirus_system",value:t.antivirus_system,id:"antivirus_system",disabled:!0}),t.antispam_system&&c.a.createElement(ze,{optionalTitle:c.a.createElement(pe.b,{to:"/edit/server/".concat(t.antispam_system)},l.configure),title:l["DNS Server"]+" / ",name:"v_antispam_system",value:t.antispam_system,id:"antispam_system",disabled:!0}),c.a.createElement(ze,{title:l["Webmail URL"],name:"v_mail_url",value:r,id:"mail-url"}),c.a.createElement("br",null),c.a.createElement("br",null),c.a.createElement(Ye,{onChange:function(e){return m(e)},title:l["Use Web Domain SSL Certificate"],name:"v_mail_ssl_domain_checkbox",id:"mail-ssl-domain-checkbox",checked:!!t.mail_certificate}),u&&c.a.createElement("div",{className:"mail-cert-info"},c.a.createElement(Je,{options:[""].concat(Object(I.a)(t.ssl_domains)),selected:t.mail_certificate,name:"v_mail_ssl_domain",title:l.Domain,id:"mail-ssl-domain"}),c.a.createElement("div",{className:"additional-info"},t.sys_ssl_subject&&c.a.createElement("div",null,c.a.createElement("span",null,l.SUBJECT,":"),c.a.createElement("span",null,t.sys_ssl_subject)),t.sys_ssl_aliases&&c.a.createElement("div",null,c.a.createElement("span",null,l.ALIASES,":"),c.a.createElement("span",null,t.sys_ssl_aliases)),t.sys_ssl_not_before&&c.a.createElement("div",null,c.a.createElement("span",null,l.NOT_BEFORE,":"),c.a.createElement("span",null,t.sys_ssl_not_before)),t.sys_ssl_not_after&&c.a.createElement("div",null,c.a.createElement("span",null,l.NOT_AFTER,":"),c.a.createElement("span",null,t.sys_ssl_not_after)),t.sys_ssl_signature&&c.a.createElement("div",null,c.a.createElement("span",null,l.SIGNATURE,":"),c.a.createElement("span",null,t.sys_ssl_signature)),t.sys_ssl_pub_key&&c.a.createElement("div",null,c.a.createElement("span",null,l.PUB_KEY,":"),c.a.createElement("span",null,t.sys_ssl_pub_key)),t.sys_ssl_issuer&&c.a.createElement("div",null,c.a.createElement("span",null,l.ISSUER,":"),c.a.createElement("span",null,t.sys_ssl_issuer)))))},Na=(a(234),window.location.origin),ja=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=new FormData;return a&&c.append("password",a),n&&c.append("password_confirm",n),e&&c.append("user",e),t&&c.append("code",t),be.a.post(Na+"/api/v1/reset/index.php",c)},ya=function(e,t){return function(a){return new Promise((function(n,c){(function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return t.append("token",He()),be.a.post("".concat(Ze,"/api/v1/login/index.php"),t)})({user:e,password:t}).then((function(e){var t=e.data,c=t.error,r=t.session,l=t.token,o=t.panel,s=t.data,i=t.user,u=t.i18n;l&&qe(l),a({type:"LOGIN",value:{token:l||"",i18n:u||{},userName:i,error:c}}),a({type:"REFRESH_PANEL",value:{panel:o}}),a({type:"REFRESH_COUNTERS",value:{user:s}}),a({type:"SET_USER_SESSION",value:r}),n(l)}),(function(e){c(e)}))}))}},ka=function(e){return function(t){return new Promise((function(a,n){(function(e){return be.a.get("".concat(Ze,"/api/v1/login/index.php"),{params:{loginas:e,token:He()}})})(e).then((function(e){var n=e.data,c=n.error,r=n.token,l=n.session,o=n.panel,s=n.data,i=n.user,u=n.i18n;r&&qe(r),t({type:"LOGIN",value:{userName:i,i18n:u,token:r,error:c}}),t({type:"REFRESH_PANEL",value:{panel:o}}),t({type:"REFRESH_COUNTERS",value:{user:s}}),t({type:"SET_USER_SESSION",value:l}),a(r)}),(function(e){console.error(e),n()}))}))}},_a=function(){return function(e,t){return new Promise((function(t,a){be.a.get("".concat(Ze,"/api/v1/logout/index.php")).then((function(a){var n=a.data,c=n.logout_response,r=n.error,l=n.userName,o=n.user,s=n.i18n,i=n.session,u=n.panel;"logged_out"===c?(localStorage.removeItem("token"),e({type:"LOGOUT",value:{userName:"",token:"",session:{},i18n:[],error:r}}),e({type:"REFRESH_PANEL",value:{panel:{}}}),e({type:"REFRESH_COUNTERS",value:{user:{}}}),e({type:"SET_USER_SESSION",value:{}}),t()):"logged_out_as"===c?(e({type:"LOGGED_OUT_AS",value:{userName:l,token:"",i18n:s,error:r}}),e({type:"REFRESH_PANEL",value:{panel:u}}),e({type:"REFRESH_COUNTERS",value:{user:o}}),e({type:"SET_USER_SESSION",value:i}),t()):t("Error while signing out: ".concat(c))}),(function(e){console.error(e),a()}))}))}},Sa=function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(o.d)((function(e){return e.userSession})).session,l=Object(R.g)(),s=Object(o.c)(),i=Object(n.useState)(""),m=Object(A.a)(i,2),d=m[0],E=m[1],p=Object(n.useState)(""),v=Object(A.a)(p,2),f=v[0],b=v[1],h=Object(n.useState)({data:{},loading:!1,webOption:!1,dnsOption:!1,mailOption:!1,backupOption:!1,sslOption:!1,pluginsOption:!1,dbOption:!1}),g=Object(A.a)(h,2),O=g[0],N=g[1];Object(n.useEffect)((function(){s(Be("/list/server/")),s({type:"REMOVE_FOCUSED_ELEMENT",value:""}),N(Object(u.a)(Object(u.a)({},O),{},{loading:!0})),j()}),[]);var j=function(){be.a.get(lt+"/api/v1/edit/server/index.php",{params:{token:He()}}).then((function(e){N(Object(u.a)(Object(u.a)({},O),{},{data:e.data,loading:!1}))})).catch((function(e){N(Object(u.a)(Object(u.a)({},O),{},{loading:!1})),console.error(e)}))},y=function(e){e.preventDefault();var a,n={},c=Object(We.a)(new FormData(e.target).entries());try{for(c.s();!(a=c.n()).done;){var l=Object(A.a)(a.value,2),o=l[0],i=l[1];n[o]=i}}catch(m){c.e(m)}finally{c.f()}n.v_backup_type&&(n.v_backup_type=n.v_backup_type.toLowerCase()),n.save="save",n.token=t,"no"!==n.v_softaculous||r.SOFTACULOUS||delete n.v_softaculous,0!==Object.keys(n).length&&n.constructor===Object&&(N(Object(u.a)(Object(u.a)({},O),{},{loading:!0})),st(n).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(E(a),b("")):(E(""),b(n))}})).then((function(){return s((function(e,t){return new Promise((function(t,a){$e().then((function(a){var n=a.data,c=n.session,r=n.token;r&&qe(r),e({type:"SET_USER_SESSION",value:c}),t(r)})).catch((function(e){a(),console.error(e)}))}))})).then((function(){return j()}))})).catch((function(e){return console.error(e)})))},k=function(e){N(Object(u.a)(Object(u.a)({},O),{},Object(M.a)({},e,!O[e])))};return c.a.createElement("div",{className:"edit-template edit-server"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.SERVER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},a["Configuring Server"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},d?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",d)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},f?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(f))))),c.a.createElement(Qe,null,O.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return y(e)},id:"edit-server"},c.a.createElement(ze,{value:O.data.hostname,title:a.Hostname,name:"v_hostname",id:"hostname"}),O.data.timezones&&c.a.createElement("div",{className:"form-group select-group"},c.a.createElement("label",{className:"label-wrapper",htmlFor:"timezone"},a["Time Zone"]),c.a.createElement("select",{className:"form-control",id:"timezone",name:"v_timezone"},Object.keys(O.data.timezones).map((function(e){var t=O.data.timezones[e];return c.a.createElement("option",{key:e,value:e,selected:O.data.timezone===e},t)})))),c.a.createElement(Je,{options:O.data.languages,selected:O.data.language,title:a["Default Language"],name:"v_language",id:"language"}),c.a.createElement("div",{className:"modules"},c.a.createElement("button",{type:"button",onClick:function(){return k("webOption")}},a.WEB,O.webOption?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),c.a.createElement(pa,{webBackendPool:O.data.web_backend_pool,proxySystem:O.data.proxy_system,webBackend:O.data.web_backend,webSystem:O.data.web_system,visible:O.webOption}),c.a.createElement("button",{type:"button",onClick:function(){return k("dnsOption")}},a.DNS,O.dnsOption?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),c.a.createElement(va,{selected:O.data.v_dns_cluster,dnsCluster:O.data.dns_cluster,dnsSystem:O.data.dns_system,visible:O.dnsOption}),c.a.createElement("button",{type:"button",onClick:function(){return k("mailOption")}},a.MAIL,O.mailOption?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),c.a.createElement(Oa,{data:O.data,visible:O.mailOption}),c.a.createElement("button",{type:"button",onClick:function(){return k("dbOption")}},a.DB,O.dbOption?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),c.a.createElement(ha,{data:O.data,visible:O.dbOption}),c.a.createElement("button",{type:"button",onClick:function(){return k("backupOption")}},a.BACKUP,O.backupOption?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),c.a.createElement(ga,{data:O.data,visible:O.backupOption}),c.a.createElement("button",{type:"button",onClick:function(){return k("sslOption")}},a["Vesta SSL"],O.sslOption?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),c.a.createElement(ba,{data:O.data,visible:O.sslOption}),c.a.createElement("button",{type:"button",onClick:function(){return k("pluginsOption")}},a["Vesta Control Panel Plugins"],O.pluginsOption?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),c.a.createElement(fa,{data:O.data,visible:O.pluginsOption})),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return l.push("/list/server/")}},a.Back)))))},wa=(a(235),function(){var e=localStorage.getItem("token"),t=Object(o.d)((function(e){return e.session})).i18n,a=Object(R.g)(),r=Object(o.c)(),l=Object(n.useState)(""),s=Object(A.a)(l,2),i=s[0],m=s[1],d=Object(n.useState)(""),E=Object(A.a)(d,2),p=E[0],v=E[1],f=Object(n.useState)({data:{},loading:!1}),b=Object(A.a)(f,2),h=b[0],g=b[1];Object(n.useEffect)((function(){r(Be("/list/server/")),r({type:"REMOVE_FOCUSED_ELEMENT",value:""}),g(Object(u.a)(Object(u.a)({},h),{},{loading:!0})),O()}),[]);var O=function(){it("dovecot").then((function(e){e.data.config||a.push("/list/server"),g(Object(u.a)(Object(u.a)({},h),{},{data:e.data,loading:!1}))})).catch((function(e){g(Object(u.a)(Object(u.a)({},h),{},{loading:!1})),console.error(e)}))};return c.a.createElement("div",{className:"edit-template edit-dovecot"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.SERVER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},t["Configuring Server"]," / ",h.data.service_name),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},i?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",i)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},p?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(p))))),c.a.createElement(Qe,null,h.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(g(Object(u.a)(Object(u.a)({},h),{},{loading:!0})),st(a,"/dovecot").then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;m(a||""),v(n||"")}})).then((function(){return O()})).catch((function(e){return console.error(e)})))}(e)},id:"edit-dovecot"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:e}),c.a.createElement(rt,{defaultValue:h.data.config,title:h.data.config_path,name:"v_config",id:"v_config",rows:"10"}),c.a.createElement("br",null),c.a.createElement(rt,{defaultValue:h.data.config1,title:h.data.config_path1,name:"v_config1",id:"v_config1",rows:"10"}),c.a.createElement("br",null),c.a.createElement(rt,{defaultValue:h.data.config2,title:h.data.config_path2,name:"v_config2",id:"v_config2",rows:"10"}),c.a.createElement("br",null),c.a.createElement(rt,{defaultValue:h.data.config3,title:h.data.config_path3,name:"v_config3",id:"v_config3",rows:"10"}),c.a.createElement("br",null),c.a.createElement(rt,{defaultValue:h.data.config4,title:h.data.config_path4,name:"v_config4",id:"v_config4",rows:"10"}),c.a.createElement("br",null),c.a.createElement(rt,{defaultValue:h.data.config5,title:h.data.config_path5,name:"v_config5",id:"v_config5",rows:"10"}),c.a.createElement("br",null),c.a.createElement(rt,{defaultValue:h.data.config6,title:h.data.config_path6,name:"v_config6",id:"v_config6",rows:"10"}),c.a.createElement("br",null),c.a.createElement(rt,{defaultValue:h.data.config7,title:h.data.config_path7,name:"v_config7",id:"v_config7",rows:"10"}),c.a.createElement("br",null),c.a.createElement(rt,{defaultValue:h.data.config8,title:h.data.config_path8,name:"v_config8",id:"v_config8",rows:"10"}),c.a.createElement("br",null),c.a.createElement(Ye,{title:t.restart,defaultChecked:!0,name:"v_restart",id:"restart"}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},t.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return a.push("/list/server/")}},t.Back)))))}),Aa=window.location.origin,Ca=function(){return be.a.get(Aa+"/api/v1/list/mail/index.php")},Da=function(e){return be.a.get(Aa+e,{params:{token:He()}})};a(236);function Ma(e){var t=e.webMail,a=e.hostName,r=e.domain,l=e.userName,s=void 0===l?"":l,i=e.password,m=Object(o.d)((function(e){return e.session})).i18n,d=Object(n.useState)(""),E=Object(A.a)(d,2),p=E[0],v=E[1],f=Object(n.useState)({imapHostName:a,smtpHostName:a,imapEncryption:m.STARTTLS,smtpEncryption:m.STARTTLS,imapPort:"143",smtpPort:"587"}),b=Object(A.a)(f,2),h=b[0],g=b[1];Object(n.useEffect)((function(){"hostname"===p?g(Object(u.a)(Object(u.a)({},h),{},{imapHostName:a,smtpHostName:a})):"domain"===p?g(Object(u.a)(Object(u.a)({},h),{},{imapHostName:r,smtpHostName:r})):"starttls"===p?g(Object(u.a)(Object(u.a)({},h),{},{imapPort:"143",imapEncryption:"STARTTLS",smtpPort:"587",smtpEncryption:"STARTTLS"})):"ssl"===p?g(Object(u.a)(Object(u.a)({},h),{},{imapPort:"993",imapEncryption:"SSL / TLS",smtpPort:"465",smtpEncryption:"SSL / TLS"})):"no_encryption"===p&&g(Object(u.a)(Object(u.a)({},h),{},{imapHostName:r,smtpHostName:r,imapPort:"143",smtpPort:"25",imapEncryption:m["No encryption"],smtpEncryption:m["No encryption"]}))}),[p]);return c.a.createElement("div",{className:"mail-info-block"},c.a.createElement("div",{class:"form-group select-group"},c.a.createElement("select",{class:"form-control",onChange:function(e){return v(e.target.value)}},function(e){return[{value:e["Use server hostname"],type:"hostname"},{value:e["Use domain hostname"],type:"domain"},{value:e["Use STARTTLS"],type:"starttls"},{value:e["Use SSL / TLS"],type:"ssl"},{value:e["No encryption"],type:"no_encryption"}]}(m).map((function(e){return c.a.createElement("option",{key:e.type,value:e.type},e.value)}))),c.a.createElement("div",{className:"details"},c.a.createElement("div",null,c.a.createElement("span",null,m.Username,":"),c.a.createElement("span",null,"".concat(s,"@").concat(r))),c.a.createElement("div",null,c.a.createElement("span",null,m.Password,":"),c.a.createElement("span",null,i||"******")),c.a.createElement("div",null,c.a.createElement("span",null,m["IMAP hostname"],":"),c.a.createElement("span",null,h.imapHostName)),c.a.createElement("div",null,c.a.createElement("span",null,m["IMAP port"],":"),c.a.createElement("span",null,h.imapPort)),c.a.createElement("div",null,c.a.createElement("span",null,m["IMAP security"],":"),c.a.createElement("span",null,h.imapEncryption)),c.a.createElement("div",null,c.a.createElement("span",null,m["IMAP auth method"],":"),c.a.createElement("span",null,m["Normal password"])),c.a.createElement("div",null,c.a.createElement("span",null,m["SMTP hostname"],":"),c.a.createElement("span",null,h.smtpHostName)),c.a.createElement("div",null,c.a.createElement("span",null,m["SMTP port"],":"),c.a.createElement("span",null,h.smtpPort)),c.a.createElement("div",null,c.a.createElement("span",null,m["SMTP security"],":"),c.a.createElement("span",null,h.smtpEncryption)),c.a.createElement("div",null,c.a.createElement("span",null,m["SMTP auth method"],":"),c.a.createElement("span",null,m["Normal password"])),c.a.createElement("div",null,c.a.createElement("span",null,m["Webmail URL"],":"),c.a.createElement("span",null,c.a.createElement(pe.b,{to:{pathname:"http://".concat(window.location.hostname).concat(t)},target:"_blank"},t))),c.a.createElement("input",{type:"hidden",name:"v_credentials",value:function(){var e="";return e+="".concat(m.Username,":").concat(s,"@").concat(r,"\n"),e+="".concat(m.Password,":").concat(i,"\n"),e+="".concat(m["IMAP hostname"],":").concat(h.imapHostName,"\n"),e+="".concat(m["IMAP port"],":").concat(h.imapPort,"\n"),e+="".concat(m["IMAP security"],":").concat(h.imapEncryption,"\n"),e+="".concat(m["IMAP auth method"],":").concat(m["Normal password"],"\n"),e+="".concat(m["SMTP hostname"],":").concat(h.smtpHostName,"\n"),e+="".concat(m["SMTP port"],":").concat(h.smtpPort,"\n"),e+="".concat(m["SMTP security"],":").concat(h.smtpEncryption,"\n"),e+="".concat(m["SMTP auth method"],":").concat(m["Normal password"],"\n"),e+="".concat(m["Webmail URL"],":","http://".concat(window.location.hostname).concat(t),"\n")}()}))))}function Fa(e){var t=Object(n.useState)(!1),a=Object(A.a)(t,2),r=a[0],l=a[1],s=localStorage.getItem("token"),i=Object(o.d)((function(e){return e.session})).i18n,m=Object(o.c)(),d=Object(R.g)(),E=Object(n.useState)(""),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)(""),h=Object(A.a)(b,2),g=h[0],O=h[1],N=Object(n.useState)({data:{},quotaValue:"",loading:!1,password:""}),j=Object(A.a)(N,2),y=j[0],k=j[1];Object(n.useEffect)((function(){m(Be("/list/mail/")),m({type:"REMOVE_FOCUSED_ELEMENT",value:""}),k(Object(u.a)(Object(u.a)({},y),{},{loading:!0})),S()}),[]);var _=function(t){t.preventDefault();var a,n={},c=Object(We.a)(new FormData(t.target).entries());try{for(c.s();!(a=c.n()).done;){var r=Object(A.a)(a.value,2),l=r[0],o=r[1];n[l]=o}}catch(s){c.e(s)}finally{c.f()}n.v_domain=e.domain,n.v_account=e.account,n.Password=n.v_password,0!==Object.keys(n).length&&n.constructor===Object&&(k(Object(u.a)(Object(u.a)({},y),{},{loading:!0})),function(e,t,a){var n=new FormData;for(var c in e)n.append(c,e[c]);return be.a.post("".concat(Aa).concat("/api/v1/edit/mail/index.php","?domain=").concat(t,"&account=").concat(a),n)}(n,e.domain,e.account).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(f(a),O(""),k(Object(u.a)(Object(u.a)({},y),{},{loading:!1}))):m(et()).then((function(){f(""),O(n),k(Object(u.a)(Object(u.a)({},y),{},{loading:!1}))}))}})).catch((function(e){return console.error(e)})))},S=function(){var t,a;k(Object(u.a)(Object(u.a)({},y),{},{loading:!0})),(t=e.domain,a=e.account,be.a.get("".concat(Aa).concat("/api/v1/edit/mail/index.php","?domain=").concat(t,"&account=").concat(a))).then((function(e){k(Object(u.a)(Object(u.a)({},y),{},{data:e.data,loading:!1})),l("yes"===e.data.autoreply)})).catch((function(e){return console.error(e)}))};return c.a.createElement("div",{className:"edit-template add-mail-account"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(i.MAIL))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},i["Editing Mail Account"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},v?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",v)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},g?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",c.a.createElement("span",null,at()(g))))),c.a.createElement(Qe,null,y.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return _(e)}},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:s}),c.a.createElement("div",{className:"r-1"},c.a.createElement("div",{className:"c-1"},c.a.createElement(ze,{title:i.Domain,value:e.domain,name:"v_domain",id:"domain",disabled:!0}),c.a.createElement(Mt,{name:"v_password",onChange:function(e){return k(Object(u.a)(Object(u.a)({},y),{},{password:e}))}}),c.a.createElement(la,{title:i.Quota,optionalTitle:i["in megabytes"],id:"quota",name:"v_quota",value:y.data.quota},c.a.createElement("button",{type:"button",onClick:function(){var e="unlimited"===y.data.quota?"1000":"unlimited";k(Object(u.a)(Object(u.a)({},y),{},{data:Object(u.a)(Object(u.a)({},y.data),{},{quota:e})}))}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(rt,{optionalTitle:"".concat(i["use local-part"]),defaultValue:y.data.aliases,title:i.Aliases,name:"v_aliases",id:"aliases"}),c.a.createElement(rt,{optionalTitle:"".concat(i["one or more email addresses"]),defaultValue:y.data.fwd,title:i["Forward to"],name:"v_fwd",id:"fwd"}),c.a.createElement(Ye,{title:i["Do not store forwarded mail"],defaultChecked:"yes"===y.data.fwd_only,name:"v_fwd_only",id:"fwd_only"}),c.a.createElement(Ye,{title:i.Autoreply,checked:r,onChange:function(e){return l(e)},name:"v_autoreply",id:"autoreply"}),r&&c.a.createElement("div",{style:{transform:"translateX(3rem)"}},c.a.createElement(rt,{defaultValue:y.data.autoreply_message,title:i.Message,name:"v_autoreply_message",id:"autoreply_message"})),c.a.createElement(ze,{title:i["Send login credentials to email address"],value:y.data.send_email,name:"v_credentials",id:"credentials"})),c.a.createElement("div",{className:"c-2"},c.a.createElement(Ma,{webMail:y.data.webmail,hostName:y.data.hostname,userName:e.account,password:y.password,domain:e.domain}))),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},i.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){d.push("/list/mail/?domain=".concat(e.domain))}},i.Back)))))}a(237);var xa=function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(R.g)(),l=Object(o.c)(),s=Object(n.useState)(""),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)(""),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({data:{},loading:!1}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){var e=ge.a.parse(r.location.search,{ignoreQueryPrefix:!0}).domain;l(Be("/list/mail/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),e&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),N(e))}),[]);var N=function(e){(function(e){return be.a.get(Aa+"/api/v1/edit/mail/index.php",{params:{domain:e,token:He()}})})(e).then((function(e){O(Object(u.a)(Object(u.a)({},g),{},{data:e.data,loading:!1}))})).catch((function(e){O(Object(u.a)(Object(u.a)({},g),{},{loading:!1})),console.error(e)}))},j=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],o=c[1];a[r]=o}}catch(s){n.e(s)}finally{n.f()}a.v_domain=g.data.domain,0!==Object.keys(a).length&&a.constructor===Object&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),function(e,t){var a=new FormData;for(var n in e)a.append(n,e[n]);return be.a.post(Aa+"/api/v1/edit/mail/index.php",a,{params:{domain:t,token:He()}})}(a,g.data.domain).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(d(a),f("")):l(et()).then((function(){d(""),f(n)}))}})).then((function(){return N(g.data.domain)})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template edit-mail"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.MAIL))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},a["Editing Mail Domain"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",m)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},v?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(v))))),c.a.createElement(Qe,{date:g.data.date,time:g.data.time,status:g.data.status},g.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return j(e)},id:"edit-mail"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:t}),c.a.createElement(ze,{id:"domain",name:"v_domain",title:a.Domain,value:g.data.domain,disabled:!0}),c.a.createElement(Ye,{name:"v_antispam",id:"antispam",title:a["AntiSpam Support"],defaultChecked:"yes"===g.data.antispam}),c.a.createElement(Ye,{name:"v_antivirus",id:"antivirus",title:a["AntiVirus Support"],defaultChecked:"yes"===g.data.antivirus}),c.a.createElement(Ye,{name:"v_dkim",id:"dkim",title:a["DKIM Support"],defaultChecked:"yes"===g.data.dkim}),c.a.createElement(ze,{id:"catchall",name:"v_catchall",title:a["Catchall email"],value:g.data.catchall}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return r.push("/list/mail/")}},a.Back)))))};function Ta(){var e=Object(o.d)((function(e){return e.session})).i18n,t=Object(R.g)(),a=ge.a.parse(t.location.search,{ignoreQueryPrefix:!0}),r=Object(n.useState)(!1),l=Object(A.a)(r,2),s=l[0],i=l[1];return Object(n.useEffect)((function(){a.domain&&a.account?i(!0):i(!1)}),[t.location]),c.a.createElement(c.a.Fragment,null,c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(e.MAIL))),s?c.a.createElement(Fa,{domain:a.domain,account:a.account}):c.a.createElement(xa,null))}a(238);var La=function(e){var t=e.serviceName,a=void 0===t?"":t,r=localStorage.getItem("token"),l=Object(o.d)((function(e){return e.session})).i18n,s=Object(R.g)(),i=Object(o.c)(),m=Object(n.useState)(""),d=Object(A.a)(m,2),E=d[0],p=d[1],v=Object(n.useState)(""),f=Object(A.a)(v,2),b=f[0],h=f[1],g=Object(n.useState)({data:{},loading:!1}),O=Object(A.a)(g,2),N=O[0],j=O[1];Object(n.useEffect)((function(){i(Be("/list/server/")),i({type:"REMOVE_FOCUSED_ELEMENT",value:""}),a||s.push("/list/server"),j(Object(u.a)(Object(u.a)({},N),{},{loading:!0})),y(a)}),[]);var y=function(e){it(e).then((function(e){var t=e.data.config;t&&!t.includes("file doesn't exist")||s.push("/list/server"),j(Object(u.a)(Object(u.a)({},N),{},{data:e.data,loading:!1}))})).catch((function(e){return console.error(e)}))};return c.a.createElement("div",{className:"edit-template edit-service"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(l.SERVER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},l["Configuring Server"]," / ",N.data.service_name),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},E?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",E)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},b?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(b))))),c.a.createElement(Qe,null,N.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault();var t,n={},c=Object(We.a)(new FormData(e.target).entries());try{for(c.s();!(t=c.n()).done;){var r=Object(A.a)(t.value,2),l=r[0],o=r[1];n[l]=o}}catch(s){c.e(s)}finally{c.f()}0!==Object.keys(n).length&&n.constructor===Object&&(j(Object(u.a)(Object(u.a)({},N),{},{loading:!0})),st(n,a).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;p(a||""),h(n||"")}})).then((function(){return y(a)})).catch((function(e){return console.error(e)})))}(e)},id:"edit-service"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:r}),c.a.createElement(rt,{defaultValue:N.data.config,title:N.data.config_path,name:"v_config",id:"v_config",rows:"18"}),c.a.createElement("br",null),c.a.createElement(Ye,{title:l.restart,defaultChecked:!0,name:"v_restart",id:"restart"}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},l.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return s.push("/list/server/")}},l.Back)))))};a(239);function Ua(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.c)(),r=localStorage.getItem("token"),l=Object(R.g)(),s=Object(n.useState)({data:{},advancedOptions:!1,autoreplyChecked:!1,quotaValue:"",loading:!1,password:"",userName:"",okMessage:"",errorMessage:""}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){a(Be("/list/mail/")),a({type:"REMOVE_FOCUSED_ELEMENT",value:""}),p()}),[]);var E=function(t){t.preventDefault();var n,c={},l=Object(We.a)(new FormData(t.target).entries());try{for(l.s();!(n=l.n()).done;){var o=Object(A.a)(n.value,2),s=o[0],i=o[1];c[s]=i}}catch(E){l.e(E)}finally{l.f()}c.ok_acc="add",c.token=r,c.v_domain=e.domain,c.v_password=m.password,c.v_quota||(c.v_quota=""),c.v_aliases||(c.v_aliases=""),c.v_fwd||(c.v_fwd=""),0!==Object.keys(c).length&&c.constructor===Object&&(d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),function(e,t){var a=new FormData;for(var n in e)a.append(n,e[n]);return be.a.post("".concat(Aa).concat("/api/v1/add/mail/index.php","?domain=").concat(t),a)}(c,e.domain).then((function(e){if(200===e.status){var t=e.data,n=t.error_msg,c=t.ok_msg;n?d(Object(u.a)(Object(u.a)({},m),{},{errorMessage:n,okMessage:c,loading:!1})):a(et()).then((function(){d(Object(u.a)(Object(u.a)({},m),{},{okMessage:c,errorMessage:"",loading:!1}))}))}})).catch((function(e){return console.error(e)})))},p=function(){d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),Ca().then((function(e){d(Object(u.a)(Object(u.a)({},m),{},{data:e.data,errorMessage:e.data.error_msg,okMessage:e.data.ok_msg,loading:!1}))})).catch((function(e){return console.error(e)}))};return c.a.createElement("div",{className:"edit-template add-mail-account"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.MAIL))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},t["Adding Mail Account"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",m.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},m.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",c.a.createElement("span",null,at()(m.okMessage))))),c.a.createElement(Qe,null,m.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return E(e)}},c.a.createElement("div",{className:"r-1"},c.a.createElement("div",{className:"c-1"},c.a.createElement(ze,{title:t.Domain,value:e.domain,name:"v_domain",id:"domain",disabled:!0}),c.a.createElement(ze,{title:t.Account,onChange:function(e){return d(Object(u.a)(Object(u.a)({},m),{},{userName:e.target.value}))},name:"v_account",id:"account"}),c.a.createElement(Mt,{name:"v_password",onChange:function(e){return d(Object(u.a)(Object(u.a)({},m),{},{password:e}))}})),c.a.createElement("div",{className:"c-2"},c.a.createElement(Ma,{webMail:m.data.webmail,hostName:m.data.hostname,userName:m.userName,password:m.password,domain:e.domain}))),c.a.createElement("div",{className:"r-2"},c.a.createElement("button",{type:"button",onClick:function(){d(Object(u.a)(Object(u.a)({},m),{},{advancedOptions:!m.advancedOptions}))}},t["Advanced options"],m.advancedOptions?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),m.advancedOptions&&c.a.createElement(c.a.Fragment,null,c.a.createElement(la,{title:t.Quota,optionalTitle:t["in megabytes"],id:"quota",name:"v_quota",value:m.quotaValue},c.a.createElement("button",{type:"button",onClick:function(){"unlimited"!==m.quotaValue?d(Object(u.a)(Object(u.a)({},m),{},{quotaValue:"unlimited"})):d(Object(u.a)(Object(u.a)({},m),{},{quotaValue:""}))}},c.a.createElement(W.a,{icon:"infinity"}))),c.a.createElement(rt,{optionalTitle:"".concat(t["use local-part"]),defaultValue:m.data.v_aliases,title:t.Aliases,name:"v_aliases",id:"aliases"}),c.a.createElement(rt,{optionalTitle:"".concat(t["one or more email addresses"]),defaultValue:m.data.forward,title:t["Forward to"],name:"v_fwd",id:"fwd"}),c.a.createElement(Ye,{title:t["Do not store forwarded mail"],name:"v_fwd_only",id:"fwd_only"})),c.a.createElement(ze,{title:t["Send login credentials to email address"],name:"v_send_email",id:"send_email"})),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},t.Add),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return l.push("/list/mail/?domain=".concat(e.domain))}},t.Back)))))}a(240);var Ia=function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.c)(),r=localStorage.getItem("token"),l=Object(R.g)(),s=Object(n.useState)({loading:!1,antiSpamChecked:!0,antiVirusChecked:!0,dkimChecked:!0,okMessage:"",errorMessage:""}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){a(Be("/list/mail/")),a({type:"REMOVE_FOCUSED_ELEMENT",value:""})}),[]);var E=function(e){e.preventDefault();var t,n={},c=Object(We.a)(new FormData(e.target).entries());try{for(c.s();!(t=c.n()).done;){var r=Object(A.a)(t.value,2),l=r[0],o=r[1];n[l]=o}}catch(s){c.e(s)}finally{c.f()}0!==Object.keys(n).length&&n.constructor===Object&&(d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.post(Aa+"/api/v1/add/mail/index.php",t)}(n).then((function(e){if(200===e.status){var t=e.data,n=t.error_msg,c=t.ok_msg;n?d(Object(u.a)(Object(u.a)({},m),{},{errorMessage:n,okMessage:c,loading:!1})):a(et()).then((function(){d(Object(u.a)(Object(u.a)({},m),{},{okMessage:c,errorMessage:"",loading:!1}))}))}})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template add-web"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.MAIL))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},t["Adding Mail Domain"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",m.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},m.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",c.a.createElement("span",null,at()(m.okMessage))))),c.a.createElement(Qe,null,m.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return E(e)}},c.a.createElement("input",{type:"hidden",name:"ok",value:"add"}),c.a.createElement("input",{type:"hidden",name:"token",value:r}),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"domain"},t.Domain),c.a.createElement("input",{type:"text",className:"form-control",id:"domain",name:"v_domain"})),c.a.createElement("div",{className:"form-group"},c.a.createElement("div",{className:"checkbox-wrapper"},c.a.createElement("input",{type:"checkbox",name:"v_antispam",id:"antispam-support",onChange:function(e){return d(Object(u.a)(Object(u.a)({},m),{},{antiSpamChecked:e.target.checked}))},checked:m.antiSpamChecked}),c.a.createElement("label",{htmlFor:"antispam-support"},t["AntiSpam Support"]))),c.a.createElement("div",{className:"form-group"},c.a.createElement("div",{className:"checkbox-wrapper"},c.a.createElement("input",{type:"checkbox",name:"v_antivirus",id:"antivirus-support",onChange:function(e){return d(Object(u.a)(Object(u.a)({},m),{},{antiVirusChecked:e.target.checked}))},checked:m.antiVirusChecked}),c.a.createElement("label",{htmlFor:"antivirus-support"},t["AntiVirus Support"]))),c.a.createElement("div",{className:"form-group"},c.a.createElement("div",{className:"checkbox-wrapper"},c.a.createElement("input",{type:"checkbox",name:"v_dkim",id:"dkim-support",onChange:function(e){return d(Object(u.a)(Object(u.a)({},m),{},{dkimChecked:e.target.checked}))},checked:m.dkimChecked}),c.a.createElement("label",{htmlFor:"dkim-support"},t["DKIM Support"]))),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},t.Add),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return l.push("/list/mail/")}},t.Back)))))};function Pa(){var e=Object(o.d)((function(e){return e.session})).i18n,t=Object(R.g)(),a=Object(n.useState)(!1),r=Object(A.a)(a,2),l=r[0],s=r[1];return Object(n.useEffect)((function(){var e=ge.a.parse(t.location.search,{ignoreQueryPrefix:!0});e.domain?s(e.domain):s("")}),[t.location]),c.a.createElement(c.a.Fragment,null,c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(e.MAIL))),l?c.a.createElement(Ua,{domain:l}):c.a.createElement(Ia,null))}var Ra=window.location.origin,Va=function(e){return be.a.get(Ra+e,{params:{token:He()}})},Ba=function(e,t,a){var n=new FormData;for(var c in e)n.append(c,e[c]);return be.a.post(Ra+"/api/v1/edit/dns/index.php",n,{params:{domain:t,record_id:a,token:He()}})},Wa=(a(241),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(R.g)(),l=Object(o.c)(),s=Object(n.useState)(""),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)(""),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({data:{},loading:!1}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){var e=ge.a.parse(r.location.search,{ignoreQueryPrefix:!0}).domain;l(Be("/list/dns/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),e&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),N(e))}),[]);var N=function(e){(function(e){return be.a.get(Ra+"/api/v1/edit/dns/index.php",{params:{domain:e,token:He()}})})(e).then((function(e){O(Object(u.a)(Object(u.a)({},g),{},{data:e.data,loading:!1}))})).catch((function(e){O(Object(u.a)(Object(u.a)({},g),{},{loading:!1})),console.error(e)}))};return c.a.createElement("div",{className:"edit-template edit-dns"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.DNS))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},a["Editing DNS Domain"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",m)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},v?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(v))))),c.a.createElement(Qe,{date:g.data.date,time:g.data.time,status:g.data.status},g.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],o=c[1];a[r]=o}}catch(s){n.e(s)}finally{n.f()}a.v_domain=g.data.domain,0!==Object.keys(a).length&&a.constructor===Object&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),Ba(a,g.data.domain).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(d(a),f("")):l(et()).then((function(){d(""),f(n)}))}})).then((function(){return N(g.data.domain)})).catch((function(e){return console.error(e)})))}(e)},id:"edit-dns"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:t}),c.a.createElement(ze,{id:"domain",name:"v_domain",title:a.Domain,value:g.data.domain,disabled:!0}),c.a.createElement(ze,{id:"ip",name:"v_ip",title:a["IP Address"],value:g.data.ip}),c.a.createElement(Je,{optionalTitle:g.data.dns_system,options:g.data.templates,selected:g.data.template,title:a.Template,name:"v_template",id:"templates"}),c.a.createElement(ze,{optionalTitle:g.data["YYYY-MM-DD"],title:a["Expiration Date"],value:g.data.exp,name:"v_exp",id:"exp"}),c.a.createElement(ze,{id:"soa",name:"v_soa",title:"SOA",value:g.data.soa}),c.a.createElement(ze,{id:"ttl",name:"v_ttl",title:"TTL",value:g.data.ttl}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return r.push("/list/dns/")}},a.Back)))))});function qa(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(o.c)(),l=Object(R.g)(),s=Object(n.useState)(""),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)(""),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({data:{},selectOptions:["A","AAAA","NS","CNAME","MX","TXT","SRV","DNSKEY","KEY","IPSECKEY","PTR","SPF","TLSA","CAA"],loading:!1}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){var t=e.domain,a=e.record_id;r(Be("/list/dns/")),r({type:"REMOVE_FOCUSED_ELEMENT",value:""}),t&&a&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),N(t,a))}),[]);var N=function(e,t){(function(e,t){return be.a.get("".concat(Ra).concat("/api/v1/edit/dns/index.php","?domain=").concat(e,"&record_id=").concat(t))})(e,t).then((function(e){O(Object(u.a)(Object(u.a)({},g),{},{data:e.data,loading:!1}))})).catch((function(e){return console.error(e)}))};return c.a.createElement("div",{className:"edit-template edit-dns-rec"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.DNS))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},a["Editing DNS Record"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",m)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},v?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(v))))),c.a.createElement(Qe,{date:g.data.date,time:g.data.time,status:g.data.status},g.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(t){return function(t){t.preventDefault();var a,n={},c=Object(We.a)(new FormData(t.target).entries());try{for(c.s();!(a=c.n()).done;){var l=Object(A.a)(a.value,2),o=l[0],s=l[1];n[o]=s}}catch(i){c.e(i)}finally{c.f()}n.v_domain=g.data.domain,n.v_record_id=e.record_id,n.v_type=g.data.type,0!==Object.keys(n).length&&n.constructor===Object&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),Ba(n,e.domain,e.record_id).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(f(""),d(a)):r(et()).then((function(){f(n),d("")}))}})).then((function(){return N(e.domain,e.record_id)})).catch((function(e){return console.error(e)})))}(t)},id:"edit-dns-rec"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:t}),c.a.createElement(ze,{title:a.Domain,value:e.domain,name:"v_domain",id:"domain",disabled:!0}),c.a.createElement(ze,{value:g.data.rec,title:a.Record,name:"v_record_id",id:"domain",disabled:!0}),c.a.createElement(Je,{options:g.selectOptions,selected:g.data.type,title:a.Type,name:"v_type",id:"type",disabled:!0}),c.a.createElement(ze,{title:a["IP or Value"],value:g.data.val,name:"v_val",id:"val"}),c.a.createElement(ze,{optionalTitle:"(".concat(a.optional,")"),value:g.data.priority,title:a.Priority,name:"v_priority",id:"priority"}),c.a.createElement(ze,{optionalTitle:"(".concat(a.internal,")"),title:a["Record Number"],value:g.data.record_id,name:"v_priority",id:"priority"}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return l.push("/list/dns?domain=".concat(e.domain))}},a.Back)))))}function Ha(){var e=Object(o.d)((function(e){return e.session})).i18n,t=Object(R.g)(),a=ge.a.parse(t.location.search,{ignoreQueryPrefix:!0}),r=Object(n.useState)(!1),l=Object(A.a)(r,2),s=l[0],i=l[1];return Object(n.useEffect)((function(){a.domain&&a.record_id?i(!0):i(!1)}),[t.location]),c.a.createElement(c.a.Fragment,null,c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(e.DNS))),s?c.a.createElement(qa,{domain:a.domain,record_id:a.record_id}):c.a.createElement(Wa,null))}a(242);var Ka=function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(n.useState)(e.letsEncrypt),r=Object(A.a)(a,2),l=r[0],s=r[1];Object(n.useEffect)((function(){s(e.letsEncrypt)}),[]);return c.a.createElement("div",{className:"ssl-support"},c.a.createElement(c.a.Fragment,null,c.a.createElement(Ye,{onChange:function(e){s(e)},name:"v_letsencrypt",id:"lets-encrypt",title:t["Lets Encrypt Support"],defaultChecked:l}),!e.letsEncrypt&&c.a.createElement("span",{className:"lets-encrypt-span"},l?t["Your certificate will be automatically issued in 5 minutes"]:null)),c.a.createElement("input",{type:"hidden",value:"same",name:"v_ssl_home"}),c.a.createElement(rt,{id:"ssl-certificate",name:"v_ssl_crt",title:t["SSL Certificate"],defaultValue:e.sslCertificate,disabled:l,optionalTitle:c.a.createElement(c.a.Fragment,null,"/ ",c.a.createElement("button",{type:"button",onClick:function(){return e.setModalVisible(!0)},className:"generate-csr"},t["Generate CSR"]))}),c.a.createElement(rt,{id:"ssl-key",name:"v_ssl_key",disabled:l,defaultValue:e.sslKey,title:t["SSL Key"]}),c.a.createElement(rt,{id:"ssl-ca",name:"v_ssl_ca",disabled:l,defaultValue:e.sslCertificateAuthority,title:t["SSL Certificate Authority / Intermediate"],optionalTitle:"( ".concat(t.optional," )")}),c.a.createElement("div",{className:"additional-info"},e.sslSubject.length>0&&c.a.createElement("div",null,c.a.createElement("span",null,t.SUBJECT,":"),c.a.createElement("span",null,e.sslSubject)),e.sslAliases.length>0&&c.a.createElement("div",null,c.a.createElement("span",null,t.ALIASES,":"),c.a.createElement("span",null,e.sslAliases)),e.sslNotBefore.length>0&&c.a.createElement("div",null,c.a.createElement("span",null,t.NOT_BEFORE,":"),c.a.createElement("span",null,e.sslNotBefore)),e.sslNotAfter.length>0&&c.a.createElement("div",null,c.a.createElement("span",null,t.NOT_AFTER,":"),c.a.createElement("span",null,e.sslNotAfter)),e.sslSignature.length>0&&c.a.createElement("div",null,c.a.createElement("span",null,t.SIGNATURE,":"),c.a.createElement("span",null,e.sslSignature)),e.sslPubKey.length>0&&c.a.createElement("div",null,c.a.createElement("span",null,t.PUB_KEY,":"),c.a.createElement("span",null,e.sslPubKey)),e.sslIssuer.length>0&&c.a.createElement("div",null,c.a.createElement("span",null,t.ISSUER,":"),c.a.createElement("span",null,e.sslIssuer))),c.a.createElement("br",null),c.a.createElement("br",null))},Ja=(a(243),function(e){var t,a,r=localStorage.getItem("token"),l=Object(o.d)((function(e){return e.session})).i18n,s=Object(o.d)((function(e){return e.userSession})).session,i=Object(R.g)(),m=Object(o.c)(),d=Object(n.useState)(""),E=Object(A.a)(d,2),p=E[0],v=E[1],f=Object(n.useState)(!1),b=Object(A.a)(f,2),h=b[0],g=b[1],O=Object(n.useState)(""),N=Object(A.a)(O,2),j=N[0],y=N[1],k=Object(n.useState)({data:{},domain:"",webStat:"",sslSupport:!1,letsEncrypt:!1,additionalFtp:!1,proxySupport:!1,statAuth:!1,loading:!1}),_=Object(A.a)(k,2),S=_[0],w=_[1];Object(n.useEffect)((function(){var e=ge.a.parse(i.location.search,{ignoreQueryPrefix:!0}).domain;m(Be("/list/web/")),m({type:"REMOVE_FOCUSED_ELEMENT",value:""}),e&&(w(Object(u.a)(Object(u.a)({},S),{},{loading:!0})),C(e))}),[]);var C=function(e){(function(e){return be.a.get(At+"/api/v1/edit/web/index.php",{params:{domain:e,token:He()}})})(e).then((function(t){w(Object(u.a)(Object(u.a)({},S),{},{domain:e,webStat:t.data.v_stats?t.data.v_stats:"none",sslSupport:"yes"===t.data.ssl,letsEncrypt:"yes"===t.data.letsencrypt,proxySupport:!!t.data.proxy,data:t.data,additionalFtp:!!t.data.ftp_user,statAuth:t.data.stats_user,loading:!1}))})).catch((function(e){return console.error(e)}))},D=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}a.v_domain=S.domain,"on"===a.v_ssl?a.v_ssl="yes":delete a.v_ssl,"on"===a.v_letsencrypt?a.v_letsencrypt="yes":delete a.v_letsencrypt,a.v_ssl_ca||delete a.v_ssl_ca,a.v_ssl_crt||delete a.v_ssl_crt,a.v_ssl_key||delete a.v_ssl_key,0!==Object.keys(a).length&&a.constructor===Object&&(w(Object(u.a)(Object(u.a)({},S),{},{loading:!0})),function(e,t){var a=new FormData;for(var n in e)a.append(n,e[n]);return be.a.post(At+"/api/v1/edit/web/index.php",a,{params:{domain:t,token:He()}})}(a,S.domain).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(v(a),y(""),w(Object(u.a)(Object(u.a)({},S),{},{loading:!1}))):m(et()).then((function(){v(""),y(n),C(S.domain)}))}})).catch((function(e){return console.error(e)})))},M=function(e){w(Object(u.a)(Object(u.a)({},S),{},{additionalFtp:e}))};return c.a.createElement("div",{className:"edit-template edit-web"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(l.WEB))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},l["Editing Domain"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},p?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",p)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},j?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(j))," "))),c.a.createElement(Qe,{date:S.data.date,time:S.data.time,status:S.data.status},S.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return D(e)},id:"add-web"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:r}),c.a.createElement(ze,{id:"domain",name:"v_domain",title:l.Domain,value:S.domain,disabled:!0}),c.a.createElement(Je,{options:function(e){var t=[];for(var a in e)t.push(a);return t}(S.data.ips),selected:S.data.ip,name:"v_ip",id:"ip",title:l["IP Address"]}),c.a.createElement(rt,{id:"proxy-aliases",name:"v_aliases",title:l.Aliases,defaultValue:S.data.aliases}),c.a.createElement(Je,{options:S.data.templates,selected:S.data.template,name:"v_template",id:"web-template",optionalTitle:S.data.web_system,title:l["Web Template"]}),s.WEB_BACKEND&&c.a.createElement(Je,{options:S.data.backend_templates,selected:S.data.backend_template||"default",name:"v_backend_template",id:"backend-template",optionalTitle:S.data.web_backend,title:l["Backend Template"]}),S.data.proxy_system&&c.a.createElement(c.a.Fragment,null,c.a.createElement(Ye,{onChange:function(e){w(Object(u.a)(Object(u.a)({},S),{},{proxySupport:e}))},name:"v_proxy",id:"proxy",title:null!==(t=l["Proxy Support"])&&void 0!==t?t:"Proxy Support",defaultChecked:S.proxySupport}),S.proxySupport&&c.a.createElement("div",{style:{transform:"translateX(3rem)"}},c.a.createElement(Je,{options:S.data.proxy_templates,selected:S.data.proxy_template||"default",optionalTitle:S.data.proxy_system,name:"v_proxy_template",id:"proxy_template",title:l["Proxy Template"]}),c.a.createElement(rt,{id:"proxy-extensions",name:"v_proxy_ext",title:l["Proxy Extensions"],defaultValue:S.data.proxy_ext}))),c.a.createElement(Ye,{onChange:function(e){w(Object(u.a)(Object(u.a)({},S),{},{sslSupport:e}))},name:"v_ssl",id:"ssl-support",title:null!==(a=l["SSL Support"])&&void 0!==a?a:"SSL Support",defaultChecked:S.sslSupport}),S.sslSupport&&c.a.createElement(Ka,{sslSubject:S.data.ssl_subject,sslAliases:S.data.ssl_aliases,sslNotBefore:S.data.ssl_not_before,sslNotAfter:S.data.ssl_not_after,sslSignature:S.data.ssl_signature,sslPubKey:S.data.ssl_pub_key,sslIssuer:S.data.ssl_issuer,sslCertificate:S.data.ssl_crt,sslKey:S.data.ssl_key,setModalVisible:function(e){return g(e)},sslCertificateAuthority:S.data.ssl_ca,domain:S.domain,sslHome:S.data.ssl_home,letsEncrypt:S.letsEncrypt}),c.a.createElement(Je,{options:S.data.stats,selected:S.webStat,title:l["Web Statistics"],onChange:function(e){w(Object(u.a)(Object(u.a)({},S),{},{webStat:e}))},name:"v_stats",id:"stats"}),"none"!==S.webStat&&c.a.createElement("div",{className:"web-stat-additional"},c.a.createElement(Ye,{onChange:function(e){w(Object(u.a)(Object(u.a)({},S),{},{statAuth:e}))},name:"v_stats_auth",id:"stat-auth",defaultChecked:S.data.stats_user,title:l["Statistics Authorization"]}),S.statAuth&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ze,{id:"domain",name:"v_stats_user",title:l.Username,value:S.data.stats_user}),c.a.createElement(Mt,{name:"v_stats_password"}))),c.a.createElement(Ye,{onChange:M,name:"v_ftp",id:"add-ftp",checked:S.additionalFtp,title:l["Additional FTP Account"]}),c.a.createElement(xt,{checked:S.additionalFtp,prefixI18N:S.data.prefixI18N,ftps:S.data.ftp_users,ftpUserPrePath:S.data.ftp_user_prepath,unCheckAdditionalFtpBox:function(){return M(!1)}}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},l.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return i.push("/list/web/")}},l.Back)))),c.a.createElement("div",{className:"modal fade ".concat(h?"show":""),id:"c-panel-modal",tabindex:"-1",role:"dialog","aria-labelledby":"exampleModalLabel","aria-hidden":"true",style:{display:h?"block":"none"}},c.a.createElement("div",{className:"modal-dialog",role:"document"},c.a.createElement("div",{className:"modal-content"},c.a.createElement("div",{className:"modal-header"},c.a.createElement("h5",null,l["Generating CSR"]),c.a.createElement("button",{type:"button",onClick:function(){return g(!1)},className:"close","data-dismiss":"modal","aria-label":"Close"},c.a.createElement("span",{"aria-hidden":"true"},"\xd7"))),c.a.createElement(Ut,{domain:S.domain,closeModal:function(){return g(!1)},prePopulateInputs:function(e){var t=e.crt,a=e.key;w(Object(u.a)(Object(u.a)({},S),{},{data:Object(u.a)(Object(u.a)({},S.data),{},{ssl_crt:t,ssl_key:a})})),g(!1)}})))))}),za=(a(244),function(e){var t=e.serviceName,a=void 0===t?"":t,r=localStorage.getItem("token"),l=Object(o.d)((function(e){return e.session})).i18n,s=Object(R.g)(),i=Object(o.c)(),m=Object(n.useState)(""),d=Object(A.a)(m,2),E=d[0],p=d[1],v=Object(n.useState)(""),f=Object(A.a)(v,2),b=f[0],h=f[1],g=Object(n.useState)(!0),O=Object(A.a)(g,2),N=O[0],j=O[1],y=Object(n.useState)({data:{},loading:!1,basicOptions:!0,advancedOptions:!1}),k=Object(A.a)(y,2),_=k[0],S=k[1];Object(n.useEffect)((function(){i(Be("/list/server/")),i({type:"REMOVE_FOCUSED_ELEMENT",value:""}),a||s.push("/list/server"),S(Object(u.a)(Object(u.a)({},_),{},{loading:!0})),w()}),[]);var w=function(){it(a).then((function(e){S(Object(u.a)(Object(u.a)({},_),{},{data:e.data,loading:!1}))})).catch((function(e){S(Object(u.a)(Object(u.a)({},_),{},{loading:!1})),console.error(e)}))},C=function(){S(Object(u.a)(Object(u.a)({},_),{},{advancedOptions:!_.advancedOptions,basicOptions:!_.basicOptions}))},D=function(e){var t=e.id,a=e.value;if(a){var n=new RegExp("(".concat(t,")(.+)(").concat(_.data[t],")"),"gm"),c=_.data.config.replace(n,"$1$2".concat(a));S(Object(u.a)(Object(u.a)({},_),{},{data:Object(u.a)(Object(u.a)({},_.data),{},Object(M.a)({config:c},t,a))}))}};return c.a.createElement("div",{className:"edit-template edit-php"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(l.SERVER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},c.a.createElement(pe.b,{to:"/edit/server/".concat(_.data.web_system)},l["Configuring Server"]," / ",_.data.web_system)),c.a.createElement("div",{className:"link"},c.a.createElement(pe.b,{to:"/edit/server/php"},l.Configure," php.ini")),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},E?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",E)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},b?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(b))))),c.a.createElement(Qe,null,_.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault();var t,n={},c=Object(We.a)(new FormData(e.target).entries());try{for(c.s();!(t=c.n()).done;){var r=Object(A.a)(t.value,2),l=r[0],o=r[1];n[l]=o}}catch(s){c.e(s)}finally{c.f()}0!==Object.keys(n).length&&n.constructor===Object&&(S(Object(u.a)(Object(u.a)({},_),{},{loading:!0})),n.v_config=_.data.config,n.v_restart=N?"yes":"no",st(n,"/".concat(a)).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;p(a||""),h(n||"")}})).then((function(){return w()})).catch((function(e){return console.error(e)})))}(e)},id:"edit-mail"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:r}),!_.basicOptions&&c.a.createElement("button",{type:"button",onClick:function(){return C()}},l["Basic options"],_.basicOptions?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),_.basicOptions&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ze,{id:"max_execution_time",title:"max_execution_time",name:"v_max_execution_time",onChange:function(e){return D(e.target)},value:parseInt(_.data.max_execution_time)}),c.a.createElement(ze,{id:"worker_connections",title:"worker_connections",name:"v_worker_connections",onChange:function(e){return D(e.target)},value:parseInt(_.data.max_input_time)}),c.a.createElement(ze,{id:"memory_limit",title:"memory_limit",name:"v_memory_limit",onChange:function(e){return D(e.target)},value:parseInt(_.data.memory_limit)}),c.a.createElement(ze,{id:"error_reporting",title:"error_reporting",name:"v_error_reporting",onChange:function(e){return D(e.target)},value:_.data.error_reporting}),c.a.createElement(ze,{id:"display_errors",title:"display_errors",name:"v_display_errors",onChange:function(e){return D(e.target)},value:_.data.display_errors}),c.a.createElement(ze,{id:"post_max_size",title:"post_max_size",name:"v_post_max_size",onChange:function(e){return D(e.target)},value:_.data.post_max_size}),c.a.createElement(ze,{id:"upload_max_filesize",title:"upload_max_filesize",name:"v_upload_max_filesize",onChange:function(e){return D(e.target)},value:_.data.upload_max_filesize})),!_.advancedOptions&&c.a.createElement("button",{type:"button",onClick:function(){return C()}},l["Advanced options"],_.advancedOptions?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),c.a.createElement("br",null),c.a.createElement("br",null),_.advancedOptions&&c.a.createElement(c.a.Fragment,null,c.a.createElement(rt,{onChange:function(e){return S(Object(u.a)(Object(u.a)({},_),{},{data:Object(u.a)(Object(u.a)({},_.data),{},{config:e.target.value})}))},defaultValue:_.data.config,title:_.data.config_path,name:"v_config",id:"v_config",rows:"25"}),c.a.createElement("br",null),c.a.createElement(Ye,{title:l.restart,defaultChecked:!0,onChange:function(e){return j(e)},name:"v_restart",id:"restart"})),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},l.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return s.push("/list/server/")}},l.Back)))))}),Ya=function(e){var t=e.data,a=Object(o.d)((function(e){return e.session})).i18n;localStorage.getItem("token");return c.a.createElement(Nt,{id:t.NAME,date:t.DATE,toggleFav:function(a){a?e.toggleFav(t.NAME,"add"):e.toggleFav(t.NAME,"delete")},checkItem:function(){e.checkItem(t.NAME)},starred:t.STARRED,focused:t.FOCUSED,checked:t.isChecked,suspended:"yes"===t.SUSPENDED},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},t.DATABASE),c.a.createElement("br",null),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",{className:"disk"},a.Disk,": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.U_DISK),a.mb),c.a.createElement("div",{className:"percent",style:{width:"".concat(t.U_DISK_PERCENT,"%")||!1}}))),c.a.createElement(Ge,{className:"c-2"},c.a.createElement("div",null,a.User,": ",c.a.createElement("span",{className:"stat"},t.DBUSER)),c.a.createElement("div",null,a.Charset,": ",c.a.createElement("span",{className:"stat"},t.CHARSET))),c.a.createElement(Ge,{className:"c-3"},c.a.createElement("div",null,a.Host,": ",c.a.createElement("span",{className:"stat"},t.HOST)),c.a.createElement("div",null,a.Type,": ",c.a.createElement("span",{className:"stat"},t.TYPE))))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/edit/db/?database=".concat(t.NAME)},a.edit,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-gray",onClick:function(){return function(){var a="yes"===t.SUSPENDED?"unsuspend":"suspend";e.handleModal(t.suspend_conf,"/api/v1/".concat(a,"/db/index.php?database=").concat(t.NAME))}()}},a[t.suspend_action],t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"S"):c.a.createElement(W.a,{icon:"yes"===t.SUSPENDED?"unlock":"lock"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){e.handleModal(t.delete_conf,"/api/v1/delete/db/index.php?database=".concat(t.NAME))}},a.Delete,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))},Ga=(a(245),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)(!1),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1,actionUrl:""}),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({databases:[],dbFav:[],toggledAll:!1,dbAdmin:"",dbAdminLink:"",db_myadmin_link:"",db_pgadmin_link:"",sorting:t.Date,order:"descending",selection:[],totalAmount:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){return l(Be("/list/db/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),D().then((function(){return d(!1)})),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",N),window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",N),window.removeEventListener("keydown",_)}}),[a,r,g.databases]);var N=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),k()):40===e.keyCode&&(e.preventDefault(),y())},j=function(e){e[0].FOCUSED=e[0].NAME,O(Object(u.a)(Object(u.a)({},g),{},{databases:e})),l(vt(e[0].NAME))},y=function(){var e=Object(I.a)(g.databases);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{databases:e})),l(vt(n.NAME))}}else j(e)},k=function(){var e=Object(I.a)(g.databases);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{databases:e})),l(vt(n.NAME))}}else j(e)},_=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a&&!t)switch(e.keyCode){case 8:return C();case 13:return S();case 83:return w()}},S=function(){e.history.push("/edit/database?domain=".concat(a))},w=function(){var e=g.databases.filter((function(e){return e.NAME===a}))[0],t="yes"===e.SUSPENDED?"unsuspend":"suspend";R(e.suspend_conf,"/api/v1/".concat(t,"/database/index.php?domain=").concat(a))},C=function(){var e=g.databases.filter((function(e){return e.NAME===a}))[0];R(e.delete_conf,"/api/v1/delete/database/index.php?domain=".concat(a))},D=function(){return d(!0),new Promise((function(e,t){be.a.get(Rt+"/api/v1/list/db/index.php").then((function(t){O(Object(u.a)(Object(u.a)({},g),{},{databases:M(t.data.data),dbAdmin:t.data.db_admin,dbAdminLink:t.data.db_admin_link,db_myadmin_link:t.data.db_myadmin_link,db_pgadmin_link:t.data.db_pgadmin_link,dbFav:t.data.dbFav,selection:[],toggledAll:!1,totalAmount:t.data.totalAmount})),e()})).catch((function(e){return console.error(e)}))}))},M=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].FOCUSED=a===n,t.push(e[n]);return t},F=function(e){var t=g.selection,a=g.databases,n=Object(I.a)(t),c=a,r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),O(Object(u.a)(Object(u.a)({},g),{},{databases:c,selection:n}))},x=function(e){var t=g.order,a=g.sorting,n=T(a);return"descending"===t?e.sort((function(e,t){return e[n]<t[n]?1:t[n]<e[n]?-1:0})):e.sort((function(e,t){return e[n]>t[n]?1:t[n]>e[n]?-1:0}))},T=function(e){var a=t.Date,n=t.Database,c=t.Disk,r=t.User,l=t.Host,o=t.Starred;switch(e){case a:return"DATE";case n:return"DATABASE";case c:return"U_DISK";case r:return"DBUSER";case l:return"HOST";case o:return"STARRED"}},L=function(e,t){var a=g.dbFav;"add"===t?(a[e]=1,gt(e,"db").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{dbFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"db").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{dbFav:a}))})).catch((function(e){console.error(e)})))},U=function(e){var t=Object(I.a)(g.databases);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));O(Object(u.a)(Object(u.a)({},g),{},{databases:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));O(Object(u.a)(Object(u.a)({},g),{},{databases:c,selection:[],toggledAll:e}))}},R=function(e,t){f(Object(u.a)(Object(u.a)({},v),{},{visible:!0,text:e,actionUrl:t}))},V=function(){l(et()).then((function(){return d(!1)}))},B=function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"databases"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.DB))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{name:"Add Database",href:"/add/db",showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},g.db_myadmin_link&&c.a.createElement(pe.b,{to:{pathname:g.db_myadmin_link},className:"button-extra",type:"submit",target:"_blank"},"phpMyAdmin"),g.db_pgadmin_link&&c.a.createElement(pe.b,{to:{pathname:g.db_pgadmin_link},className:"button-extra",type:"submit",target:"_blank"},"phpPgAdmin"),c.a.createElement(kt,{toggleAll:U,toggled:g.toggledAll}),c.a.createElement(_t,{list:"dbList",bulkAction:function(e){var t=g.selection;t.length&&e&&(d(!0),function(e,t){var a=new FormData;return a.append("action",e),a.append("token",He()),t.forEach((function(e){a.append("database[]",e)})),be.a.post(Rt+"/api/v1/bulk/db/",a)}(e,t).then((function(e){200===e.status&&(U(!1),D().then((function(){return V()})))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(ft,{changeSorting:function(e,t){O(Object(u.a)(Object(u.a)({},g),{},{sorting:e,order:t}))},sorting:g.sorting,order:g.order,list:"dbList"}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"mails-wrapper"},m?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,function(){var e=g.databases,t=[],n=Object(u.a)({},g.dbFav);return e.forEach((function(e){e.FOCUSED=a===e.NAME,n[e.NAME]?e.STARRED=n[e.NAME]:e.STARRED=0,t.push(e)})),x(t).map((function(e,t){return c.a.createElement(Ya,{data:e,key:t,toggleFav:L,checkItem:F,handleModal:R})}))}(),c.a.createElement("div",{className:"total"},g.totalAmount))),c.a.createElement(St,{onSave:function(){if(!v.actionUrl)return B();var e;B(),d(!0),(e=v.actionUrl,be.a.get(Rt+e,{params:{token:He()}})).then((function(e){if(e.data.error)return d(!1),R(e.data.error,"");D().then((function(){return V()}))})).catch((function(e){d(!1),console.error(e)}))},onCancel:B,show:v.visible,text:v.text}))}),Qa=(a(246),function(e){var t=e.data,a=Object(w.a)(e,["data"]),n=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement(Nt,{id:t.NAME,date:t.DATE,starred:t.STARRED,focused:t.FOCUSED,checked:t.isChecked,toggleFav:function(e){e?a.toggleFav(t.NAME,"add"):a.toggleFav(t.NAME,"delete")},checkItem:function(){a.checkItem(t.NAME)},suspended:"yes"===t.SUSPENDED},c.a.createElement(Ge,{className:"cron-jobs-list r-col w-85"},c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"cron-col"},c.a.createElement("div",null,c.a.createElement("span",{className:"stat"},t.ACTION))),c.a.createElement(Ge,{className:"cron-col"},c.a.createElement("div",null,c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.PROTOCOL)," / ",t.COMMENT))),c.a.createElement(Ge,{className:"cron-col"},c.a.createElement("div",null)),c.a.createElement(Ge,{className:"cron-col"},c.a.createElement("div",null,c.a.createElement("span",{className:"stat"},t.PORT))),c.a.createElement(Ge,{className:"cron-col"},c.a.createElement("div",null,c.a.createElement("span",{className:"stat"},t.IP))))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/edit/firewall/?rule=".concat(t.NAME)},n.edit,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-gray",onClick:function(){return function(){var e="yes"===t.SUSPENDED?"unsuspend":"suspend";a.handleModal(t.suspend_conf,"/api/v1/".concat(e,"/firewall/index.php?rule=").concat(t.NAME))}()}},n[t.suspend_action],t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"S"):c.a.createElement(W.a,{icon:"yes"===t.SUSPENDED?"unlock":"lock"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){a.handleModal(t.delete_conf,"/api/v1/delete/firewall/index.php?rule=".concat(t.NAME))}},n.Delete,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))}),Xa=(a(247),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)(!1),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1,actionUrl:""}),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({firewalls:[],firewallFav:[],selection:[],firewallExtension:"",toggledAll:!1,sorting:t.Action,order:"descending",totalAmount:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){return l(Be("/list/firewall/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),D().then((function(){return d(!1)})),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",N),window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",N),window.removeEventListener("keydown",_)}}),[a,r,g.firewalls]);var N=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),k()):40===e.keyCode&&(e.preventDefault(),y())},j=function(e){e[0].FOCUSED=e[0].NAME,O(Object(u.a)(Object(u.a)({},g),{},{firewalls:e})),l(vt(e[0].NAME))},y=function(){var e=Object(I.a)(g.firewalls);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{firewalls:e})),l(vt(n.NAME))}}else j(e)},k=function(){var e=Object(I.a)(g.firewalls);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{firewalls:e})),l(vt(n.NAME))}}else j(e)},_=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a&&!t)switch(e.keyCode){case 8:return C();case 13:return S();case 83:return w()}},S=function(){e.history.push("/edit/firewall?rule=".concat(a))},w=function(){var e=g.firewalls.filter((function(e){return e.NAME===a}))[0],t="yes"===e.SUSPENDED?"unsuspend":"suspend";R(e.suspend_conf,"/api/v1/".concat(t,"/firewall/index.php?rule=").concat(a))},C=function(){var e=g.firewalls.filter((function(e){return e.NAME===a}))[0];R(e.delete_conf,"/api/v1/delete/firewall/index.php?rule=".concat(a))},D=function(){return d(!0),new Promise((function(e,t){be.a.get(Wt+"/api/v1/list/firewall/index.php").then((function(t){O(Object(u.a)(Object(u.a)({},g),{},{firewalls:M(t.data.data),firewallFav:t.data.firewallFav,selection:[],firewallExtension:t.data.firewallExtension,totalAmount:t.data.totalAmount,toggledAll:!1})),e()})).catch((function(e){return console.error(e)}))}))},M=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].FOCUSED=a===n,t.push(e[n]);return t},F=function(e){var t=g.selection,a=g.firewalls,n=Object(I.a)(t),c=a,r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),O(Object(u.a)(Object(u.a)({},g),{},{firewalls:c,selection:n}))},x=function(e){var t=g.order,a=g.sorting,n=T(a);return"descending"===t?e.sort((function(e,t){return e[n]<t[n]?1:t[n]<e[n]?-1:0})):e.sort((function(e,t){return e[n]>t[n]?1:t[n]>e[n]?-1:0}))},T=function(e){var a=t.Action,n=t.Protocol,c=t.Port,r=t.Comment,l=t.Starred;switch(e){case a:return"ACTION";case n:return"PROTOCOL";case c:return"PORT";case t["IP address"]:return"IP";case r:return"COMMENT";case l:return"STARRED"}},L=function(e,t){var a=g.firewallFav;"add"===t?(a[e]=1,gt(e,"firewall").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{firewallFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"firewall").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{firewallFav:a}))})).catch((function(e){console.error(e)})))},U=function(e){if(e){var t=[],a=g.firewalls.map((function(e){return t.push(e.NAME),e.isChecked=!0,e}));O(Object(u.a)(Object(u.a)({},g),{},{firewalls:a,selection:t,toggledAll:e}))}else{var n=g.firewalls.map((function(e){return e.isChecked=!1,e}));O(Object(u.a)(Object(u.a)({},g),{},{firewalls:n,selection:[],toggledAll:e}))}},R=function(e,t){f(Object(u.a)(Object(u.a)({},v),{},{visible:!v.visible,text:e,actionUrl:t}))},V=function(){l(et()).then((function(){return d(!1)}))},B=function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!v.visible,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"firewalls"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.FIREWALL))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{href:"/add/firewall/",name:t["Add Rule"],showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(pe.b,{to:"/list/firewall/banlist/",className:"button-extra",type:"submit"},t["list fail2ban"]),c.a.createElement(kt,{toggleAll:U,toggled:g.toggledAll}),c.a.createElement(_t,{list:"firewallList",bulkAction:function(e){var t=g.selection;t.length&&e&&(d(!0),function(e,t){var a=new FormData;return a.append("action",e),a.append("token",He()),t.forEach((function(e){a.append("rule[]",e)})),be.a.post(Wt+"/api/v1/bulk/firewall/",a)}(e,t).then((function(e){200===e.status&&(U(!1),D().then((function(){return V()})))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(ft,{changeSorting:function(e,t){O(Object(u.a)(Object(u.a)({},g),{},{sorting:e,order:t}))},sorting:g.sorting,order:g.order,list:"firewallList"}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"firewalls-wrapper"},m?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,function(){var e=Object(u.a)({},g.firewallFav),t=Object(I.a)(g.firewalls);return t.forEach((function(t){t.FOCUSED=a===t.NAME,e[t.NAME]?t.STARRED=e[t.NAME]:t.STARRED=0})),x(t).map((function(e,t){return c.a.createElement(Qa,{data:e,key:t,toggleFav:L,checkItem:F,handleModal:R})}))}(),c.a.createElement("div",{className:"total"},g.totalAmount))),c.a.createElement(St,{onSave:function(){if(!v.actionUrl)return B();B(),d(!0),Ht(v.actionUrl).then((function(e){if(e.data.error)return d(!1),R(e.data.error,"");D().then((function(){return V()}))})).catch((function(e){d(!1),console.error(e)}))},onCancel:B,show:v.visible,text:v.text}))}),Za=window.location.origin,$a=(a(248),function(e){var t=localStorage.getItem("token"),a=Object(o.d)((function(e){return e.session})).i18n,r=Object(R.g)(),l=Object(o.c)(),s=Object(n.useState)(""),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)(""),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({data:{},loading:!1,username:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){var e=ge.a.parse(r.location.search,{ignoreQueryPrefix:!0}).user;l(Be("/list/user/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),e&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),N(e))}),[]);var N=function(e){var t;(t=e,be.a.get(Za+"/api/v1/edit/user/index.php",{params:{user:t,token:He()}})).then((function(t){O(Object(u.a)(Object(u.a)({},g),{},{username:e,data:t.data,loading:!1}))})).catch((function(e){O(Object(u.a)(Object(u.a)({},g),{},{loading:!1})),console.error(e)}))},j=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}a.v_username=g.username,0!==Object.keys(a).length&&a.constructor===Object&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),function(e,t){var a=new FormData;for(var n in e)a.append(n,e[n]);return be.a.post(Za+"/api/v1/edit/user/index.php",a,{params:{user:t,token:He()}})}(a,g.username).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?(d(a),f("")):(d(""),f(n))}})).then((function(){return N(g.username)})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template edit-user"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(a.USER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},a["Editing User"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",m)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},v?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(v))," "))),c.a.createElement(Qe,{date:g.data.date,time:g.data.time,status:g.data.status},g.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return j(e)},id:"add-user"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:t}),c.a.createElement(ze,{id:"username",name:"v_user",title:a.Username,value:g.username,disabled:!0}),c.a.createElement(Mt,{name:"v_password"}),c.a.createElement(ze,{id:"email",name:"v_email",title:a.Email,value:g.data.email}),c.a.createElement(Je,{options:function(e){var t=[];for(var a in e)t.push(a);return t}(g.data.packages),selected:g.data.package,name:"v_package",id:"packages",title:a.Package}),c.a.createElement(Je,{options:g.data.languages,selected:g.data.language,name:"v_language",id:"languages",title:a.Language}),c.a.createElement(ze,{id:"first-name",name:"v_fname",title:a["First Name"],value:g.data.fname}),c.a.createElement(ze,{id:"last-name",name:"v_lname",title:a["Last Name"],value:g.data.lname}),c.a.createElement(Je,{options:g.data.shells,selected:g.data.shell,name:"v_shell",id:"shell",title:a["SSH Access"]}),c.a.createElement(oa,{usersNS:g.data.nameservers}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},a.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return r.push("/list/user/")}},a.Back)))))}),en=(a(249),function(){var e=localStorage.getItem("token"),t=Object(o.d)((function(e){return e.session})).i18n,a=Object(R.g)(),r=Object(o.c)(),l=Object(n.useState)(""),s=Object(A.a)(l,2),i=s[0],m=s[1],d=Object(n.useState)(""),E=Object(A.a)(d,2),p=E[0],v=E[1],f=Object(n.useState)({data:{},loading:!1}),b=Object(A.a)(f,2),h=b[0],g=b[1];Object(n.useEffect)((function(){r(Be("/list/server/")),r({type:"REMOVE_FOCUSED_ELEMENT",value:""}),g(Object(u.a)(Object(u.a)({},h),{},{loading:!0})),O()}),[]);var O=function(){it("bind9").then((function(e){e.data.config.includes("Error")&&a.push("/list/server"),g(Object(u.a)(Object(u.a)({},h),{},{data:e.data,loading:!1}))})).catch((function(e){g(Object(u.a)(Object(u.a)({},h),{},{loading:!1})),console.error(e)}))};return c.a.createElement("div",{className:"edit-template edit-bind9"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.SERVER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},t["Configuring Server"]," / ",h.data.service_name),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},i?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",i)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},p?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(p))))),c.a.createElement(Qe,null,h.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(g(Object(u.a)(Object(u.a)({},h),{},{loading:!0})),st(a,"/bind9").then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;m(a||""),v(n||"")}})).then((function(){return O()})).catch((function(e){return console.error(e)})))}(e)},id:"edit-bind9"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:e}),c.a.createElement(rt,{defaultValue:h.data.options,title:h.data.options_path,name:"v_options",id:"v_options",rows:"10"}),c.a.createElement("br",null),c.a.createElement(rt,{defaultValue:h.data.config,title:h.data.config_path,name:"v_config",id:"v_config",rows:"10"}),c.a.createElement("br",null),c.a.createElement(Ye,{title:t.restart,defaultChecked:!0,name:"v_restart",id:"restart"}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},t.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return a.push("/list/server/")}},t.Back)))))}),tn=(a(250),function(e){var t=e.serviceName,a=void 0===t?"":t,r=localStorage.getItem("token"),l=Object(o.d)((function(e){return e.session})).i18n,s=Object(R.g)(),i=Object(o.c)(),m=Object(n.useState)(""),d=Object(A.a)(m,2),E=d[0],p=d[1],v=Object(n.useState)(""),f=Object(A.a)(v,2),b=f[0],h=f[1],g=Object(n.useState)(!0),O=Object(A.a)(g,2),N=O[0],j=O[1],y=Object(n.useState)({data:{},loading:!1,basicOptions:!0,advancedOptions:!1}),k=Object(A.a)(y,2),_=k[0],S=k[1];Object(n.useEffect)((function(){i(Be("/list/server/")),i({type:"REMOVE_FOCUSED_ELEMENT",value:""}),a||s.push("/list/server"),S(Object(u.a)(Object(u.a)({},_),{},{loading:!0})),w()}),[]);var w=function(){it("mysql").then((function(e){e.data.config.includes("Error")&&s.push("/list/server"),S(Object(u.a)(Object(u.a)({},_),{},{data:e.data,loading:!1}))})).catch((function(e){S(Object(u.a)(Object(u.a)({},_),{},{loading:!1})),console.error(e)}))},C=function(){S(Object(u.a)(Object(u.a)({},_),{},{advancedOptions:!_.advancedOptions,basicOptions:!_.basicOptions}))},D=function(e){var t=e.id,a=e.value;if(a){var n=new RegExp("(".concat(t,")(.+)(").concat(_.data[t],")"),"gm"),c=_.data.config.replace(n,"$1$2".concat(a));S(Object(u.a)(Object(u.a)({},_),{},{data:Object(u.a)(Object(u.a)({},_.data),{},Object(M.a)({config:c},t,a))}))}};return c.a.createElement("div",{className:"edit-template edit-mysql"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(l.SERVER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},l["Configuring Server"]," / ",_.data.service_name),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},E?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",E)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},b?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(b))))),c.a.createElement(Qe,null,_.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return function(e){e.preventDefault();var t,n={},c=Object(We.a)(new FormData(e.target).entries());try{for(c.s();!(t=c.n()).done;){var r=Object(A.a)(t.value,2),l=r[0],o=r[1];n[l]=o}}catch(s){c.e(s)}finally{c.f()}0!==Object.keys(n).length&&n.constructor===Object&&(S(Object(u.a)(Object(u.a)({},_),{},{loading:!0})),n.v_config=_.data.config,n.v_restart=N?"yes":"no",st(n,"/".concat(a)).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;p(a||""),h(n||"")}})).then((function(){return w()})).catch((function(e){return console.error(e)})))}(e)},id:"edit-mysql"},c.a.createElement("input",{type:"hidden",name:"save",value:"save"}),c.a.createElement("input",{type:"hidden",name:"token",value:r}),!_.basicOptions&&c.a.createElement("button",{type:"button",onClick:function(){return C()}},l["Basic options"],_.basicOptions?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),_.basicOptions&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ze,{id:"max_connections",title:"max_connections",name:"v_max_connections",onChange:function(e){return D(e.target)},value:_.data.max_connections}),c.a.createElement(ze,{id:"max_user_connections",title:"v_max_user_connections",name:"v_max_user_connections",onChange:function(e){return D(e.target)},value:_.data.max_user_connections}),c.a.createElement(ze,{id:"wait_timeout",title:"v_wait_timeout",name:"v_wait_timeout",onChange:function(e){return D(e.target)},value:_.data.wait_timeout}),c.a.createElement(ze,{id:"interactive_timeout",title:"v_interactive_timeout",name:"v_interactive_timeout",onChange:function(e){return D(e.target)},value:_.data.interactive_timeout}),c.a.createElement(ze,{id:"display_errors",title:"v_display_errors",name:"v_display_errors",onChange:function(e){return D(e.target)},value:_.data.max_allowed_packet})),!_.advancedOptions&&c.a.createElement("button",{type:"button",onClick:function(){return C()}},l["Advanced options"],_.advancedOptions?c.a.createElement(W.a,{icon:"caret-up"}):c.a.createElement(W.a,{icon:"caret-down"})),c.a.createElement("br",null),c.a.createElement("br",null),_.advancedOptions&&c.a.createElement(c.a.Fragment,null,c.a.createElement(rt,{defaultValue:_.data.config,title:_.data.config_path,onChange:function(e){return S(Object(u.a)(Object(u.a)({},_),{},{data:Object(u.a)(Object(u.a)({},_.data),{},{config:e.target.value})}))},name:"v_config",id:"v_config",rows:"25"}),c.a.createElement("br",null),c.a.createElement(Ye,{title:l.restart,defaultChecked:!0,onChange:function(e){return j(e)},name:"v_restart",id:"restart"})),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},l.Save),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return s.push("/list/server/")}},l.Back)))))}),an=window.location.origin,nn=(a(251),a(252),function(e){var t,a,r,l,s=Object(o.d)((function(e){return e.session})).i18n,i=Object(n.useState)({nameServersAmount:[],userNS:e.userNS}),m=Object(A.a)(i,2),d=m[0],E=m[1];Object(n.useEffect)((function(){if(e.userNS.length){var t=e.userNS.map((function(e,t){return t+1}));E(Object(u.a)(Object(u.a)({},d),{},{nameServersAmount:t}))}}),[]);var p=function(e){var t=Object(I.a)(d.nameServersAmount);t.splice(e-1,1),E(Object(u.a)(Object(u.a)({},d),{},{nameServersAmount:t}))};return c.a.createElement("div",null,c.a.createElement("div",{className:"form-group exp-date"},c.a.createElement("label",{htmlFor:"exp_date"},null!==(t=s["Expiration Date"])&&void 0!==t?t:"Expiration Date",c.a.createElement("span",{className:"optional"},"(",null!==(a=s["YYYY-MM-DD"])&&void 0!==a?a:"YYYY-MM-DD",")")),c.a.createElement("input",{type:"text",className:"form-control",id:"exp_date",required:!0,defaultValue:K()().add(1,"year").format("YYYY-MM-DD"),name:"v_exp"})),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"name_servers"},"TTL"),c.a.createElement("input",{type:"text",className:"form-control",id:"name_servers",required:!0,defaultValue:"14400",name:"v_ttl"})),c.a.createElement("div",{className:"form-group name-servers"},c.a.createElement("label",{htmlFor:"v_ns1"},null!==(r=s["Name servers"])&&void 0!==r?r:"Name servers"),d.nameServersAmount.map((function(e,t){var a;return c.a.createElement("div",{className:"name-server-input-wrapper",key:t},c.a.createElement("input",{type:"text",className:"form-control",id:"v_ns".concat(e),defaultValue:d.userNS[t]||"",name:"v_ns".concat(e)}),c.a.createElement("button",{type:"button",className:e<3?"hide":"show delete",onClick:function(){return p(e)}},null!==(a=s.delete)&&void 0!==a?a:"Delete"))}))),c.a.createElement("button",{type:"button",className:8===d.nameServersAmount.length?"hide":"show optional",onClick:function(){return function(){var e=d.nameServersAmount.length,t=Object(I.a)(d.nameServersAmount);t.push(e+1),E(Object(u.a)(Object(u.a)({},d),{},{nameServersAmount:t}))}()}},null!==(l=s["Add one more Name Server"])&&void 0!==l?l:"Add one more Name Server"))}),cn=function(e){var t,a,r,l,s,i,m=Object(o.d)((function(e){return e.session})).i18n,d=Object(o.c)(),E=localStorage.getItem("token"),p=Object(R.g)(),v=Object(n.useState)({loading:!1,showAdvancedOptions:!1,okMessage:"",domain:"",errorMessage:"",userNS:[]}),f=Object(A.a)(v,2),b=f[0],h=f[1];Object(n.useEffect)((function(){d(Be("/list/dns/")),d({type:"REMOVE_FOCUSED_ELEMENT",value:""}),h(Object(u.a)(Object(u.a)({},b),{},{loading:!0})),be.a.get(an+"/api/v1/list-user-ns.php").then((function(e){e.data.length&&h(Object(u.a)(Object(u.a)({},b),{},{userNS:e.data,loading:!1}))})).catch((function(e){return console.error(e)}))}),[]);var g=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(h(Object(u.a)(Object(u.a)({},b),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.post(Ra+"/api/v1/add/dns/index.php",t)}(a).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;a?h(Object(u.a)(Object(u.a)({},b),{},{errorMessage:a,okMessage:n,loading:!1})):d(et()).then((function(){h(Object(u.a)(Object(u.a)({},b),{},{okMessage:n,errorMessage:"",loading:!1}))}))}})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template add-dns"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(m.DNS))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},null!==(t=m["Adding DNS Domain"])&&void 0!==t?t:"Adding DNS Domain"),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},b.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",b.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},b.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",c.a.createElement("span",null,at()(b.okMessage))))),c.a.createElement(Qe,null,b.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return g(e)}},c.a.createElement("input",{type:"hidden",name:"ok",value:"add"}),c.a.createElement("input",{type:"hidden",name:"token",value:E}),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"domain"},null!==(a=m.Domain)&&void 0!==a?a:"Domain"),c.a.createElement("input",{type:"text",className:"form-control",id:"domain",required:!0,name:"v_domain"})),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"ip_address"},null!==(r=m["IP address"])&&void 0!==r?r:"IP address"),c.a.createElement("input",{type:"text",className:"form-control",id:"ip_address",required:!0,name:"v_ip"})),c.a.createElement("div",{className:"form-group advanced-options-button"},c.a.createElement("button",{type:"button",onClick:function(){h(Object(u.a)(Object(u.a)({},b),{},{showAdvancedOptions:!b.showAdvancedOptions}))}},null!==(l=m["Advanced options"])&&void 0!==l?l:"Advanced options",b.showAdvancedOptions?c.a.createElement(W.a,{icon:"caret-down"}):c.a.createElement(W.a,{icon:"caret-up"}))),function(){if(b.showAdvancedOptions)return c.a.createElement(nn,{prefixI18N:b.prefixI18N,userNS:b.userNS,domain:b.domain,webStats:b.webStats})}(),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},null!==(s=m.Add)&&void 0!==s?s:"Add"),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return p.push("/list/dns/")}},null!==(i=m.Back)&&void 0!==i?i:"Back")))))};a(253);function rn(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.c)(),r=localStorage.getItem("token"),l=Object(R.g)(),s=Object(n.useState)({data:{},selectOptions:["A","AAAA","NS","CNAME","MX","TXT","SRV","DNSKEY","KEY","IPSECKEY","PTR","SPF","TLSA","CAA"],loading:!1,okMessage:"",errorMessage:""}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){a(Be("/list/dns/")),a({type:"REMOVE_FOCUSED_ELEMENT",value:""})}),[]);var E=function(t){t.preventDefault();var n,c={},l=Object(We.a)(new FormData(t.target).entries());try{for(l.s();!(n=l.n()).done;){var o=Object(A.a)(n.value,2),s=o[0],i=o[1];c[s]=i}}catch(E){l.e(E)}finally{l.f()}c.ok_rec="add",c.token=r,c.v_domain=e.domain,0!==Object.keys(c).length&&c.constructor===Object&&(d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.post(Ra+"/api/v1/add/dns/index.php",t)}(c).then((function(e){if(200===e.status){var t=e.data,n=t.error_msg,c=t.ok_msg;n?d(Object(u.a)(Object(u.a)({},m),{},{errorMessage:n,okMessage:c,loading:!1})):a(et()).then((function(){d(Object(u.a)(Object(u.a)({},m),{},{okMessage:c,errorMessage:"",loading:!1}))}))}})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template add-dns-record"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.DNS))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},t["Adding DNS Record"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",m.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},m.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):"",c.a.createElement("span",null,at()(m.okMessage))))),c.a.createElement(Qe,null,m.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return E(e)}},c.a.createElement(ze,{title:t.Domain,value:e.domain,name:"v_domain",id:"domain",disabled:!0}),c.a.createElement(ze,{title:t.Record,name:"v_rec",id:"domain"}),c.a.createElement(Je,{options:m.selectOptions,title:t.Type,name:"v_type",id:"type"}),c.a.createElement(ze,{title:t["IP or Value"],name:"v_val",id:"val"}),c.a.createElement(ze,{optionalTitle:"(".concat(t.optional,")"),title:t.Priority,name:"v_priority",id:"priority"}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},t.Add),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return l.push("/list/dns/?domain=".concat(e.domain))}},t.Back)))))}function ln(){var e=Object(o.d)((function(e){return e.session})).i18n,t=Object(R.g)(),a=ge.a.parse(t.location.search,{ignoreQueryPrefix:!0}),r=Object(n.useState)(!1),l=Object(A.a)(r,2),s=l[0],i=l[1];return Object(n.useEffect)((function(){a.domain?i(!0):i(!1)}),[t.location]),c.a.createElement(c.a.Fragment,null,c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(e.DNS))),s?c.a.createElement(rn,{domain:a.domain}):c.a.createElement(cn,null))}a(254);function on(e){var t=e.data,a=e.checkItemFunc,n=void 0===a?function(){}:a,r=e.restoreSetting,l=void 0===r?function(){}:r,s=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement(Nt,{date:!1,id:t.NAME,focused:t.FOCUSED,checked:t.isChecked,checkItem:function(){n(t.NAME)}},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",{style:{textTransform:"uppercase"}},function(e){switch(e){case"WEB":return"WEB ".concat(s.domain);case"MAIL":return"MAIL ".concat(s.domain);case"DNS":return"DNS ".concat(s.domain);case"CRON":return s.cron;case"UDIR":return s["user dir"];default:return s.domain}}(t.type))),c.a.createElement(Ge,{className:"c-2"},c.a.createElement("b",null,t.name)),c.a.createElement(Ge,{className:"c-3"}),c.a.createElement(Ge,{className:"c-4"}),c.a.createElement(Ge,{className:"c-5"}))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement("button",{className:"link-restore",onClick:function(){return l(t.restoreLinkParams)}},s.restore,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"R"):c.a.createElement(W.a,{icon:"play"})))))}a(255);function sn(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)([]),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1}),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({loading:!1,backupDetails:[],toggledAll:!1,selection:[],totalAmount:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){return l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),w(),function(){return l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",N),window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",N),window.removeEventListener("keydown",_)}}),[a,r,m]);var N=function(t){65!==t.keyCode?(38!==t.keyCode&&40!==t.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===t.keyCode?(t.preventDefault(),k()):40===t.keyCode&&(t.preventDefault(),y())):S("?backup=".concat(e.backup))},j=function(e){e[0].FOCUSED=e[0].NAME,d(e),l(vt(e[0].NAME))},y=function(){var e=Object(I.a)(m);if(""!==a){var t=e[a+1];t&&(e[a].FOCUSED="",t.FOCUSED=t.NAME,document.getElementById(t.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(e),l(vt(t.NAME)))}else j(e)},k=function(){var e=Object(I.a)(m);if(""!==a){var t=e[a-1];t&&(e[a].FOCUSED="",t.FOCUSED=t.NAME,document.getElementById(t.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(e),l(vt(t.NAME)))}else j(e)},_=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a>0||""!==a&&!t)switch(e.keyCode){case 82:return S()}},S=function(e){(function(e){return be.a.get(Et+"".concat("/api/v1/schedule/restore/index.php").concat(e))})(e||m[a].restoreLinkParams).then((function(e){return F(e.data.message)})).catch((function(e){return console.error(e)}))},w=function(){var t;O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),(t=e.backup,be.a.get(Et+"".concat("/api/v1/list/backup/index.php","?backup=").concat(t))).then((function(t){C(t.data.data[e.backup]),O(Object(u.a)(Object(u.a)({},g),{},{totalAmount:t.data.totalAmount,selection:[],toggledAll:!1,loading:!1}))})).catch((function(e){return console.error(e)}))},C=function(t){var a=["WEB","DNS","MAIL","DB","UDIR","CRON"].reduce((function(a,n){return t[n].split(",").map((function(t){a.push({type:n,name:t,restoreLinkParams:"?backup=".concat(e.backup,"&type=").concat(n.toLowerCase(),"&object=").concat(t)})})),a}),[]);d(a)},D=function(e){var t=g.selection,a=Object(I.a)(t),n=Object(I.a)(m),c=a.indexOf(e),r=n.findIndex((function(t){return t.NAME===e}));n[r].isChecked=!n[r].isChecked,-1!==c?a.splice(n[e].name,1):a.push(n[e].name),O(Object(u.a)(Object(u.a)({},g),{},{selection:a})),d(n)},M=function(e){var t=Object(I.a)(m);if(e){var a=[],n=t.map((function(e){return a.push(e.name),e.isChecked=!0,e}));O(Object(u.a)(Object(u.a)({},g),{},{selection:a,toggledAll:e})),d(n)}else{var c=t.map((function(e){return e.isChecked=!1,e}));O(Object(u.a)(Object(u.a)({},g),{},{selection:[],toggledAll:e})),d(c)}},F=function(e){O(Object(u.a)(Object(u.a)({},g),{},{loading:!1})),f(Object(u.a)(Object(u.a)({},v),{},{visible:!0,text:e}))};return c.a.createElement("div",{className:"mail-accounts backups-restore-settings"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.BACKUP))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{name:t["Restore All"],list:"backup-details",onClick:function(){return S("?backup=".concat(e.backup))},showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(kt,{toggleAll:M,toggled:g.toggledAll}),c.a.createElement(_t,{list:"backupDetailList",bulkAction:function(t){var a=g.selection;a.length&&t&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),function(e,t,a){var n=new FormData;return n.append("token",He()),n.append("action",e),n.append("backup",a),t.forEach((function(e){n.append("udir[]",e)})),be.a.post(Et+"".concat("/api/v1/bulk/restore/index.php"),n)}(t,a,e.backup).then((function(e){200===e.status&&(F(e.data.message),M(!1))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),g.loading?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"mail-accounts-wrapper"},c.a.createElement("div",{className:"subtitle"},c.a.createElement("span",null,"".concat(t.Listing," ").concat(e.backup))),function(){var e=Object(I.a)(m),t=[];return e.forEach((function(e,n){e.NAME=n,e.FOCUSED=a===n,t.push(e)})),t.map((function(e,t){return c.a.createElement(on,{data:e,key:t,checkItemFunc:function(e){return D(e)},restoreSetting:S})}))}()),c.a.createElement("div",{className:"footer-actions-wrapper"},c.a.createElement("div",{className:"total"},g.totalAmount),c.a.createElement("div",{className:"back"},c.a.createElement(pe.b,{to:"/list/backup/"},t.Back)))),c.a.createElement(St,{onSave:function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!1,text:""}))},showCancelButton:!1,show:v.visible,text:v.text}))}a(256);var un=function(e){var t=e.data,a=Object(o.d)((function(e){return e.session})).i18n,n=localStorage.getItem("token");return c.a.createElement(Nt,{id:t.NAME,date:t.DATE,toggleFav:function(t){t?e.toggleFav(e.data.NAME,"add"):e.toggleFav(e.data.NAME,"delete")},checkItem:function(){e.checkItem(e.data.NAME)},focused:t.FOCUSED,starred:t.STARRED,checked:t.isChecked},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},t.NAME),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",null,a["Backup Size"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.SIZE),a.mb))),c.a.createElement(Ge,{className:"c-2"},c.a.createElement("div",null,a.Type,": ",c.a.createElement("span",{className:"stat"},t.TYPE))),c.a.createElement(Ge,{className:"c-3"},c.a.createElement("div",null,a["Run Time"],": ",c.a.createElement("span",{className:"stat"},t.RUNTIME," minute"))))),c.a.createElement("div",{className:"actions"},"no"===t.UPDATED&&c.a.createElement("div",null,c.a.createElement("a",{href:"/update/vesta/?pkg=".concat(t.NAME)},a.update," ",c.a.createElement(W.a,{icon:"wrench"}))),c.a.createElement("div",null,c.a.createElement("a",{className:"link-download",href:"/api/v1/download/backup/?backup=".concat(t.NAME,"&token=").concat(n)},a.download,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"D"):c.a.createElement(W.a,{icon:Re.r}))),c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-download",to:"/list/backup?backup=".concat(t.NAME)},a["configure restore settings"],t.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"list"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){e.handleModal(t.delete_conf,"/api/v1/delete/backup/?backup=".concat(t.NAME))}},a.Delete,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))},mn=(a(257),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)(!1),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1,actionUrl:""}),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({backups:[],backupFav:[],toggledAll:!1,selection:[],totalAmount:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){return l(Be("/list/backup/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),D().then((function(){return d(!1)})),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",N),window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",N),window.removeEventListener("keydown",_)}}),[a,r,g.backups]);var N=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),k()):40===e.keyCode&&(e.preventDefault(),y())},j=function(e){e[0].FOCUSED=e[0].NAME,O(Object(u.a)(Object(u.a)({},g),{},{backups:e})),l(vt(e[0].NAME))},y=function(){var e=Object(I.a)(g.backups);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{backups:e})),l(vt(n.NAME))}}else j(e)},k=function(){var e=Object(I.a)(g.backups);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{backups:e})),l(vt(n.NAME))}}else j(e)},_=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a&&!t)switch(e.keyCode){case 8:return C();case 13:return S();case 68:return w()}},S=function(){e.history.push("/list/backup?backup=".concat(a))},w=function(){window.open("/api/v1/download/backup?backup=".concat(a))},C=function(){var e=g.backups.filter((function(e){return e.NAME===a}))[0];L(e.delete_conf,"/api/v1/delete/cron/?job=".concat(a))},D=function(){return d(!0),new Promise((function(e,t){be.a.get(Et+"/api/v1/list/backup/index.php").then((function(t){O(Object(u.a)(Object(u.a)({},g),{},{backups:M(t.data.data),backupFav:t.data.backup_fav,totalAmount:t.data.totalAmount,selection:[],toggledAll:!1})),e()})).catch((function(e){return console.error(e)}))}))},M=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].isChecked=!1,e[n].FOCUSED=a===n,t.push(e[n]);return t},F=function(e){var t=g.selection,a=g.backups,n=Object(I.a)(t),c=Object(I.a)(a),r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),O(Object(u.a)(Object(u.a)({},g),{},{backups:c,selection:n}))},x=function(e,t){var a=g.backupFav;"add"===t?(a[e]=1,gt(e,"backup").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{backupFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"backup").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{backupFav:a}))})).catch((function(e){console.error(e)})))},T=function(e){var t=Object(I.a)(g.backups);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));O(Object(u.a)(Object(u.a)({},g),{},{backups:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));O(Object(u.a)(Object(u.a)({},g),{},{backups:c,selection:[],toggledAll:e}))}},L=function(e,t){d(!1),f(Object(u.a)(Object(u.a)({},v),{},{visible:!0,text:e,actionUrl:t}))},U=function(){l(et()).then((function(){return d(!1)}))},R=function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"backups"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.BACKUP))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",{className:"l-menu"},c.a.createElement("button",{onClick:function(){d(!0),be.a.get(Et+"/api/v1/schedule/backup/").then((function(e){e.data.error?L(e.data.error,""):L(e.data.ok,"")})).catch((function(e){return console.error(e)}))}},c.a.createElement(W.a,{icon:"plus"}),c.a.createElement("span",{className:"add"},t["Create Backup"]))),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(pe.b,{to:"/list/backup/exclusions",className:"button-extra",type:"submit"},t["backup exclusions"]),c.a.createElement(kt,{toggleAll:T,toggled:g.toggledAll}),c.a.createElement(_t,{list:"backupList",bulkAction:function(e){var t=g.selection;t.length&&e&&(d(!0),function(e,t){var a=new FormData;return a.append("action",e),a.append("token",He()),t.forEach((function(e){a.append("backup[]",e)})),be.a.post(Et+"/api/v1/bulk/backup/",a)}(e,t).then((function(e){200===e.status&&(T(!1),D().then((function(){return U()})))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"backups-wrapper"},m?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,function(){var e=g.backups,t=[],n=Object(u.a)({},g.backupFav);return e.forEach((function(e){e.FOCUSED=a===e.NAME,n[e.NAME]?e.STARRED=n[e.NAME]:e.STARRED=0,t.push(e)})),t.map((function(e,t){return c.a.createElement(un,{data:e,key:t,toggleFav:x,checkItem:F,handleModal:L})}))}(),c.a.createElement("div",{className:"total"},g.totalAmount))),c.a.createElement(St,{onSave:function(){if(!v.actionUrl)return R();var e;R(),d(!0),(e=v.actionUrl,be.a.get(Et+e,{params:{token:He()}})).then((function(e){if(e.data.error)return d(!1),L(e.data.error,"");D().then((function(){return U()}))})).catch((function(e){d(!1),console.error(e)}))},onCancel:R,show:v.visible,text:v.text}))});function dn(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(R.g)(),r=ge.a.parse(a.location.search,{ignoreQueryPrefix:!0}),l=Object(n.useState)(!1),s=Object(A.a)(l,2),i=s[0],u=s[1];return Object(n.useEffect)((function(){r.backup?u(!0):u(!1)}),[a.location]),c.a.createElement(c.a.Fragment,null,c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.DNS))),i?c.a.createElement(sn,{backup:r.backup}):c.a.createElement(mn,Object.assign({},e,{changeSearchTerm:e.changeSearchTerm})))}var En=function(){var e=Object(o.d)((function(e){return e.session})).i18n,t=localStorage.getItem("language"),a=Object(R.g)(),r=Object(o.c)(),l=Object(n.useState)({banIps:[],errorMessage:"",okMessage:"",loading:!1}),s=Object(A.a)(l,2),i=s[0],m=s[1];Object(n.useEffect)((function(){r(Be("/list/firewall/")),r({type:"REMOVE_FOCUSED_ELEMENT",value:""}),m(Object(u.a)(Object(u.a)({},i),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return be.a.get(Wt+qt,{params:{token:He()}})}().then((function(e){m(Object(u.a)(Object(u.a)({},i),{},{ip:e.data.ip,chain:e.data.chain,loading:!1}))}))}),[]);var d=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],l=c[1];a[r]=l}}catch(o){n.e(o)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(m(Object(u.a)(Object(u.a)({},i),{},{loading:!0})),function(e){var t=new FormData;for(var a in t.append("token",He()),e)t.append(a,e[a]);return be.a.post(Wt+qt,t,{params:{token:He()}})}(a).then((function(e){if(200===e.status){var t=e.data,a=t.error_msg,n=t.ok_msg;m(a?Object(u.a)(Object(u.a)({},i),{},{errorMessage:a,okMessage:"",loading:!1}):n?Object(u.a)(Object(u.a)({},i),{},{errorMessage:"",okMessage:n,loading:!1}):Object(u.a)(Object(u.a)({},i),{},{loading:!1}))}})).catch((function(e){return console.error(e)})))};return c.a.createElement("div",{className:"edit-template add-user"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(e.FIREWALL))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},e["Adding IP Address to Banlist"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},i.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",i.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},i.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(i.okMessage))," "))),c.a.createElement(Qe,null,i.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return d(e)},id:"add-user"},c.a.createElement("input",{type:"hidden",name:"ok",value:"add"}),c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{htmlFor:"chain"},e.Banlist),c.a.createElement("select",{class:"form-control",id:"chain",name:"v_chain"},["SSH","WEB","FTP","DNS","MAIL","DB","VESTA"].map((function(e,a){return c.a.createElement("option",{key:a,selected:t===e,value:e},e)})))),c.a.createElement("div",{className:"form-group exp-date"},c.a.createElement("label",{htmlFor:"ip"},e["IP address"],c.a.createElement("span",{className:"optional"},"(",e["CIDR format is supported"],")")),c.a.createElement("input",{type:"text",className:"form-control",id:"ip",required:!0,name:"v_ip"})),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},e.Add),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return a.push("/list/firewall/banlist")}},e.Back)))))},pn=(a(258),function(e){var t=e.data,a=Object(o.d)((function(e){return e.session})).i18n;localStorage.getItem("token");return c.a.createElement(Nt,{id:t.NAME,date:t.DATE,checkItem:function(){e.checkItem(e.data.NAME)},toggleFav:function(t){t?e.toggleFav(e.data.NAME,"add"):e.toggleFav(e.data.NAME,"delete")},focused:t.FOCUSED,starred:t.STARRED,checked:t.isChecked,suspended:"yes"===t.SUSPENDED},c.a.createElement(Ge,{className:"cron-jobs-list r-col w-85"},c.a.createElement("div",{className:"name"},t.CMD),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"cron-col"},c.a.createElement("div",null,a.Min," ",c.a.createElement("span",null,t.MIN))),c.a.createElement(Ge,{className:"cron-col"},c.a.createElement("div",null,a.Hour," ",c.a.createElement("span",null,t.HOUR))),c.a.createElement(Ge,{className:"cron-col"},c.a.createElement("div",null,a.Day," ",c.a.createElement("span",null,t.DAY))),c.a.createElement(Ge,{className:"cron-col"},c.a.createElement("div",null,a.Month," ",c.a.createElement("span",null,t.MONTH))),c.a.createElement(Ge,{className:"cron-col"},c.a.createElement("div",null,a["Day of week"]," ",c.a.createElement("span",null,t.WDAY))))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/edit/cron/?job=".concat(t.NAME)},a.edit,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-gray",onClick:function(){return function(){var a="yes"===t.SUSPENDED?"unsuspend":"suspend";e.handleModal(t.suspend_conf,"/api/v1/".concat(a,"/cron/index.php?job=").concat(t.NAME))}()}},a[t.suspend_action],t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"S"):c.a.createElement(W.a,{icon:"yes"===t.SUSPENDED?"unlock":"lock"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){e.handleModal(t.delete_conf,"/api/v1/delete/cron/index.php?job=".concat(t.NAME))}},a.Delete,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))}),vn=(a(259),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)(!1),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1,actionUrl:""}),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({cronJobs:[],cronFav:[],toggledAll:!1,cronReports:"",sorting:t.Date,order:"descending",selection:[],totalAmount:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){return l(Be("/list/cron/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),D().then((function(){return d(!1)})),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",N),window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",N),window.removeEventListener("keydown",_)}}),[a,r,g.cronJobs]);var N=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),k()):40===e.keyCode&&(e.preventDefault(),y())},j=function(e){e[0].FOCUSED=e[0].NAME,O(Object(u.a)(Object(u.a)({},g),{},{cronJobs:e})),l(vt(e[0].NAME))},y=function(){var e=Object(I.a)(g.cronJobs);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{cronJobs:e})),l(vt(n.NAME))}}else j(e)},k=function(){var e=Object(I.a)(g.cronJobs);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{cronJobs:e})),l(vt(n.NAME))}}else j(e)},_=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a&&!t)switch(e.keyCode){case 8:return C();case 13:return S();case 83:return w()}},S=function(){e.history.push("/edit/cron?job=".concat(a))},w=function(){var e=g.cronJobs.filter((function(e){return e.NAME===a}))[0],t="yes"===e.SUSPENDED?"unsuspend":"suspend";R(e.suspend_conf,"/api/v1/".concat(t,"/cron/index.php?job=").concat(a))},C=function(){var e=g.cronJobs.filter((function(e){return e.NAME===a}))[0];R(e.delete_conf,"/api/v1/delete/cron/index.php?job=".concat(a))},D=function(){return d(!0),new Promise((function(e,t){be.a.get(Gt+"/api/v1/list/cron/index.php").then((function(t){O(Object(u.a)(Object(u.a)({},g),{},{cronJobs:M(t.data.data),cronReports:t.data.cron_reports,cronFav:t.data.cron_fav,selection:[],toggledAll:!1,totalAmount:t.data.totalAmount})),e()})).catch((function(e){return console.error(e)}))}))},M=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].isChecked=!1,e[n].FOCUSED=a===n,t.push(e[n]);return t},F=function(e){var t=g.selection,a=g.cronJobs,n=Object(I.a)(t),c=a,r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),O(Object(u.a)(Object(u.a)({},g),{},{cronJobs:c,selection:n}))},x=function(e){var t=g.order,a=g.sorting,n=T(a);return"descending"===t?e.sort((function(e,t){return e[n]<t[n]?1:t[n]<e[n]?-1:0})):e.sort((function(e,t){return e[n]>t[n]?1:t[n]>e[n]?-1:0}))},T=function(e){var a=t.Date,n=t.Command,c=t.Starred;switch(e){case a:return"DATE";case n:return"CMD";case c:return"STARRED"}},L=function(e,t){var a=g.cronFav;"add"===t?(a[e]=1,gt(e,"cron").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{cronFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"cron").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{cronFav:a}))})).catch((function(e){console.error(e)})))},U=function(e){var t=Object(I.a)(g.cronJobs);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));O(Object(u.a)(Object(u.a)({},g),{},{cronJobs:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));O(Object(u.a)(Object(u.a)({},g),{},{cronJobs:c,selection:[],toggledAll:e}))}},R=function(e,t){f(Object(u.a)(Object(u.a)({},v),{},{visible:!g.modalVisible,text:e,actionUrl:t}))},V=function(){l(et()).then((function(){return d(!1)}))},B=function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!1,text:"",actionUrl:""}))},W=function(){var e=localStorage.getItem("token"),t="/api/v1/".concat("yes"===g.cronReports?"delete":"add","/cron/reports/?token=").concat(e);Qt(t).then((function(e){R(e.data.message,""),D().then((function(){return d(!1)}))})).catch((function(e){return console.error(e)}))};return c.a.createElement("div",{className:"cronJobs"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.CRON))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{name:t["Add Cron Job"],href:"/add/cron",showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement("button",{onClick:W,className:"button-extra",type:"submit"},"yes"===g.cronReports?t["turn off notifications"]:t["turn on notifications"]),c.a.createElement(kt,{toggleAll:U,toggled:g.toggledAll}),c.a.createElement(_t,{list:"cronList",bulkAction:function(e){var t=g.selection;if(e===("yes"===g.cronReports?"delete-cron-reports":"add-cron-reports"))return W();t.length&&e&&(d(!0),function(e,t){var a=new FormData;return a.append("action",e),a.append("token",He()),t.forEach((function(e){a.append("job[]",e)})),be.a.post(Gt+"/api/v1/bulk/cron/",a)}(e,t).then((function(e){200===e.status&&(U(!1),D().then((function(){return V()})))})).catch((function(e){return console.error(e)})))},cronReports:"yes"===g.cronReports}),c.a.createElement(ft,{changeSorting:function(e,t){O(Object(u.a)(Object(u.a)({},g),{},{sorting:e,order:t}))},sorting:g.sorting,order:g.order,list:"cronList"}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"cron-wrapper"},m?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,function(){var e=g.cronJobs,t=[],n=Object(u.a)({},g.cronFav);return e.forEach((function(e){e.FOCUSED=a===e.NAME,n[e.NAME]?e.STARRED=n[e.NAME]:e.STARRED=0,t.push(e)})),x(t).map((function(e,t){return c.a.createElement(pn,{data:e,key:t,toggleFav:L,checkItem:F,handleModal:R})}))}(),c.a.createElement("div",{className:"total"},g.totalAmount))),c.a.createElement(St,{showCancelButton:v.actionUrl,onCancel:B,onSave:function(){if(!v.actionUrl)return B();B(),d(!0),Qt(v.actionUrl).then((function(e){if(e.data.error)return d(!1),R(e.data.error,"");D().then((function(){return V()}))})).catch((function(e){d(!1),console.error(e)}))},show:v.visible,text:v.text}))}),fn=(a(260),function(e){var t=e.data,a=Object(o.d)((function(e){return e.session})).i18n,n=Object(o.d)((function(e){return e.userSession})).session;return c.a.createElement(Nt,{id:t.NAME,date:t.DATE,toggleFav:function(a){a?e.toggleFav(t.NAME,"add"):e.toggleFav(t.NAME,"delete")},checkItem:function(){e.checkItem(t.NAME)},starred:t.STARRED,focused:t.FOCUSED,checked:t.isChecked},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},t.NAME),c.a.createElement("div",null,t.FNAME," ",t.LNAME),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1 w-30"},c.a.createElement("div",null,a["Web Template"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.WEB_TEMPLATE))),n.PROXY_SYSTEM&&c.a.createElement("div",null,a["Proxy Template"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.PROXY_TEMPLATE))),c.a.createElement("div",null,a["DNS Template"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.DNS_TEMPLATE))),c.a.createElement("div",null,a["SSH Access"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.SHELL))),c.a.createElement("div",null,a["Web Domains"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.WEB_DOMAINS))),c.a.createElement("div",null,a["Web Aliases"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.WEB_ALIASES)))),c.a.createElement(Ge,{className:"c-2 w-35"},c.a.createElement("div",null,a["DNS domains"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.DNS_DOMAINS))),c.a.createElement("div",null,a["DNS records"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.DNS_RECORDS))),c.a.createElement("div",null,a["Mail Domains"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.MAIL_DOMAINS))),c.a.createElement("div",null,a["Mail Accounts"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.MAIL_ACCOUNTS))),c.a.createElement("div",null,a.Databases,": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.DATABASES))),c.a.createElement("div",null,a["Cron Jobs"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.CRON_JOBS)))),c.a.createElement(Ge,{className:"c-3 w-35"},c.a.createElement("div",null,c.a.createElement("span",null,a.Backups,":")," ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.BACKUPS))),c.a.createElement("div",null,c.a.createElement("span",null,a.Bandwidth,":")," ",c.a.createElement("span",null,c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.BANDWIDTH)," ",a.mb))),c.a.createElement("div",null,c.a.createElement("span",null,a.Disk,":")," ",c.a.createElement("span",null,c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.DISK_QUOTA)," ",a.mb))),c.a.createElement("div",{className:"ns"},c.a.createElement("span",null,a["Name Servers"],":")," ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.NS.split(",").map((function(e,t){return c.a.createElement("div",{key:t},e)})))))))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/edit/package/?package=".concat(t.NAME)},a.edit,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){e.handleModal(t.delete_conf,"/api/v1/delete/package/index.php?package=".concat(t.NAME))}},a.Delete,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))}),bn=(a(261),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)(!1),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1,actionUrl:""}),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({packages:[],packagesFav:[],toggledAll:!1,sorting:t.Date,order:"descending",selection:[],totalAmount:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){return l(Be("/list/package/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),C().then((function(){return d(!1)})),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",N),window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",N),window.removeEventListener("keydown",_)}}),[a,r,g.packages]);var N=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),k()):40===e.keyCode&&(e.preventDefault(),y())},j=function(e){e[0].FOCUSED=e[0].NAME,O(Object(u.a)(Object(u.a)({},g),{},{packages:e})),l(vt(e[0].NAME))},y=function(){var e=Object(I.a)(g.packages);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{packages:e})),l(vt(n.NAME))}}else j(e)},k=function(){var e=Object(I.a)(g.packages);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{packages:e})),l(vt(n.NAME))}}else j(e)},_=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a&&!t)switch(e.keyCode){case 8:return w();case 13:return S()}},S=function(){e.history.push("/edit/package/?package=".concat(a))},w=function(){var e=g.packages.filter((function(e){return e.NAME===a}))[0];U(e.delete_conf,"/api/v1/delete/package/index.php?package=".concat(a))},C=function(){return d(!0),new Promise((function(e,t){ia().then((function(t){O(Object(u.a)(Object(u.a)({},g),{},{packages:D(t.data.data),packagesFav:t.data.packagesFav,totalAmount:t.data.totalAmount,selection:[],toggledAll:!1})),e()})).catch((function(e){return console.error(e)}))}))},D=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].FOCUSED=a===n,t.push(e[n]);return t},M=function(e){var t=g.selection,a=g.packages,n=Object(I.a)(t),c=a,r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),O(Object(u.a)(Object(u.a)({},g),{},{packages:c,selection:n}))},F=function(e){var t=g.order,a=g.sorting,n=x(a);return"descending"===t?e.sort((function(e,t){return e[n]<t[n]?1:t[n]<e[n]?-1:0})):e.sort((function(e,t){return e[n]>t[n]?1:t[n]>e[n]?-1:0}))},x=function(e){var a=t.Date,n=t.Starred;switch(e){case a:return"DATE";case t["Package Name"]:return"NAME";case n:return"STARRED"}},T=function(e,t){var a=g.packagesFav;"add"===t?(a[e]=1,gt(e,"package").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{packagesFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"package").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{packagesFav:a}))})).catch((function(e){console.error(e)})))},L=function(e){var t=Object(I.a)(g.packages);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));O(Object(u.a)(Object(u.a)({},g),{},{packages:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));O(Object(u.a)(Object(u.a)({},g),{},{packages:c,selection:[],toggledAll:e}))}},U=function(e,t){f(Object(u.a)(Object(u.a)({},v),{},{visible:!v.visible,text:e,actionUrl:t}))},R=function(){l(et()).then((function(){return d(!1)}))},V=function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"packages"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.PACKAGE))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{name:t["Add Package"],href:"/add/package/",showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(kt,{toggleAll:L,toggled:g.toggledAll}),c.a.createElement(_t,{list:"packagesList",bulkAction:function(e){var t=g.selection;t.length&&e&&(d(!0),function(e,t){var a=new FormData;return a.append("action",e),a.append("token",He()),t.forEach((function(e){a.append("package[]",e)})),be.a.post(sa+"/api/v1/bulk/package/",a)}(e,t).then((function(e){200===e.status&&(L(!1),C().then((function(){return R()})))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(ft,{changeSorting:function(e,t){O(Object(u.a)(Object(u.a)({},g),{},{sorting:e,order:t}))},sorting:g.sorting,order:g.order,list:"packagesList"}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"packages-wrapper"},m?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,function(){var e=g.packages,t=Object(u.a)({},g.packagesFav),n=[];return e.forEach((function(e){e.FOCUSED=a===e.NAME,t[e.NAME]?e.STARRED=t[e.NAME]:e.STARRED=0,n.push(e)})),F(n).map((function(e,t){return c.a.createElement(fn,{data:e,key:t,toggleFav:T,checkItem:M,handleModal:U})}))}(),c.a.createElement("div",{className:"total"},g.totalAmount))),c.a.createElement(St,{onSave:function(){if(!v.actionUrl)return V();var e;V(),d(!0),(e=v.actionUrl,be.a.get(sa+e,{params:{token:He()}})).then((function(e){if(e.data.error)return d(!1),U(e.data.error,"");C().then((function(){return R()}))})).catch((function(e){d(!1),console.error(e)}))},onCancel:V,show:v.visible,text:v.text}))}),hn=window.location.origin,gn=(a(262),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.userSession})).session,r=Object(R.g)(),l=Object(o.c)(),s=Object(n.useState)({vEmail:"",vNotify:"",languages:[],packages:[],errorMessage:"",okMessage:"",loading:!1}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){l(Be("/list/user/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),Promise.all([E(),p()]).then((function(e){var t=Object(A.a)(e,2),a=t[0],n=t[1],c=v(a.data.data);d(Object(u.a)(Object(u.a)({},m),{},{packages:c,languages:n.data,loading:!1}))}))}),[]);var E=function(){return ia().catch((function(e){return console.error(e)}))},p=function(){return be.a.get(hn+"/api/v1/languages.php").catch((function(e){return console.error(e)}))},v=function(e){var t=[];for(var a in e)t.push(a);return t},f=function(e){e.preventDefault();var t,a={},n=Object(We.a)(new FormData(e.target).entries());try{for(n.s();!(t=n.n()).done;){var c=Object(A.a)(t.value,2),r=c[0],o=c[1];a[r]=o}}catch(s){n.e(s)}finally{n.f()}0!==Object.keys(a).length&&a.constructor===Object&&(d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),function(e){var t=new FormData;for(var a in e)t.append(a,e[a]);return t.append("token",He()),t.append("ok","Add"),be.a.post(Za+"/api/v1/add/user/index.php",t)}(a).then((function(e){var t=e.data,a=t.error_msg,n=t.ok_msg;a?d(Object(u.a)(Object(u.a)({},m),{},{errorMessage:a,okMessage:n,loading:!1})):l(et()).then((function(){d(Object(u.a)(Object(u.a)({},m),{},{okMessage:n,errorMessage:"",loading:!1}))}))})).catch((function(e){d(Object(u.a)(Object(u.a)({},m),{},{loading:!1})),console.error(e)})))};return c.a.createElement("div",{className:"edit-template add-user"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.USER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",null),c.a.createElement("div",{className:"search-toolbar-name"},t["Adding User"]),c.a.createElement("div",{className:"error"},c.a.createElement("span",{className:"error-message"},m.errorMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",m.errorMessage)),c.a.createElement("div",{className:"success"},c.a.createElement("span",{className:"ok-message"},m.okMessage?c.a.createElement(W.a,{icon:"long-arrow-alt-right"}):""," ",c.a.createElement("span",null,at()(m.okMessage))," "))),c.a.createElement(Qe,null,m.loading?c.a.createElement(P,null):c.a.createElement("form",{onSubmit:function(e){return f(e)},id:"add-user"},c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"username"},t.Username),c.a.createElement("input",{type:"text",className:"form-control",id:"username",name:"v_username"})),c.a.createElement(Mt,{name:"v_password"}),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"email"},t.Email," /",c.a.createElement("div",null,c.a.createElement("input",{type:"checkbox",id:"send-credentials",onChange:function(e){e.target.checked?m.vEmail&&d(Object(u.a)(Object(u.a)({},m),{},{vNotify:m.vEmail})):d(Object(u.a)(Object(u.a)({},m),{},{vNotify:""}))}}),c.a.createElement("label",{htmlFor:"send-credentials"},t["Send login credentials to email address"]))),c.a.createElement("input",{type:"email",name:"v_email",className:"form-control",id:"email",value:m.vEmail,onChange:function(e){return t=e.target.value,void d(Object(u.a)(Object(u.a)({},m),{},{vEmail:t}));var t},onBlur:function(){m.vNotify||d(Object(u.a)(Object(u.a)({},m),{},{vNotify:m.vEmail}))}})),c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{htmlFor:"package"},t.Package),c.a.createElement("select",{class:"form-control",id:"package",name:"v_package"},m.packages.map((function(e,t){return c.a.createElement("option",{key:t,value:e},e)})))),c.a.createElement("div",{class:"form-group"},c.a.createElement("label",{htmlFor:"language"},t.Language),c.a.createElement("select",{class:"form-control",id:"language",name:"v_language"},m.languages.map((function(e,t){return c.a.createElement("option",{key:t,selected:a.LANGUAGE===e,value:e},e)})))),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"firstName"},t["First Name"]),c.a.createElement("input",{type:"text",className:"form-control",id:"firstName",name:"v_fname"})),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"lastName"},t["Last Name"]),c.a.createElement("input",{type:"text",className:"form-control",id:"lastName",name:"v_lname"})),c.a.createElement("div",{className:"form-group"},c.a.createElement("label",{htmlFor:"sendLoginCredentialsToEmailAddress"},t["Send login credentials to email address"]),c.a.createElement("input",{type:"email",className:"form-control",id:"sendLoginCredentialsToEmailAddress",value:m.vNotify,onChange:function(e){return t=e.target.value,void d(Object(u.a)(Object(u.a)({},m),{},{vNotify:t}));var t},name:"v_notify"})),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{type:"submit",className:"add"},t.Add),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return r.push("/list/user/")}},t.Back)))))}),On=window.location.origin,Nn=(a(263),function(e){var t,a=e.data,n=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement(Nt,{date:!1,id:a.NAME,checkItem:function(){e.checkItem(e.data.NAME)},focused:a.FOCUSED,checked:a.isChecked,outdated:(t=a.UPDATED,"no"===t),leftNameText:function(e){return"no"===e?"OUTDATED":"UPDATED"}(a.UPDATED)},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},a.NAME),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",{className:"descr"},c.a.createElement("span",{className:"stat"},a.DESCR))),c.a.createElement(Ge,{className:"c-2"},c.a.createElement("div",null,n.Version,": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},a.VERSION)," ","(".concat(a.ARCH,")")))),c.a.createElement(Ge,{className:"c-3"},c.a.createElement("div",null,n.Release,": ",c.a.createElement("span",{className:"stat"},a.RELEASE))))))}),jn=(a(264),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)({updates:[],selection:[],autoUpdate:"",token:"",loading:!1,toggledAll:!1}),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1,actionUrl:""}),p=Object(A.a)(E,2),v=p[0],f=p[1];Object(n.useEffect)((function(){return l(Be("/list/updates/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),N(),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",b),function(){window.removeEventListener("keydown",b)}}),[a,r,m.updates]);var b=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),O()):40===e.keyCode&&(e.preventDefault(),g())},h=function(e){e[0].FOCUSED=e[0].NAME,d(Object(u.a)(Object(u.a)({},m),{},{updates:e})),l(vt(e[0].NAME))},g=function(){var e=Object(I.a)(m.updates);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(Object(u.a)(Object(u.a)({},m),{},{updates:e})),l(vt(n.NAME))}}else h(e)},O=function(){var e=Object(I.a)(m.updates);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(Object(u.a)(Object(u.a)({},m),{},{updates:e})),l(vt(n.NAME))}}else h(e)},N=function(){d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),be.a.get(On+"/api/v1/list/updates/index.php").then((function(e){d(Object(u.a)(Object(u.a)({},m),{},{selection:[],updates:j(e.data.data),autoUpdate:e.data.autoUpdate,loading:!1}))})).catch((function(e){return console.error(e)}))},j=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].FOCUSED=a===n,t.push(e[n]);return t},y=function(e){var t=Object(I.a)(m.selection),a=Object(I.a)(m.updates),n=t.indexOf(e),c=a.findIndex((function(t){return t.NAME===e}));a[c].isChecked=!a[c].isChecked,-1!==n?t.splice(n,1):t.push(e),d(Object(u.a)(Object(u.a)({},m),{},{updates:a,selection:t}))},k=function(e){var t=Object(I.a)(m.updates);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));d(Object(u.a)(Object(u.a)({},m),{},{updates:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));d(Object(u.a)(Object(u.a)({},m),{},{updates:c,selection:[],toggledAll:e}))}},_=function(e,t){d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),f(Object(u.a)(Object(u.a)({},v),{},{visible:!0,text:e,actionUrl:t}))},S=function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"statistics-list updates"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.UPDATES))),c.a.createElement(Xe,{mobile:!1,className:"justify-right"},c.a.createElement(yt,{name:"Add Cron Job",showLeftMenu:!1}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement("button",{onClick:function(){"Enabled"===m.autoUpdate?be.a.get("".concat(On).concat("/api/v1/delete/cron/autoupdate/"),{params:{token:He()}}).then((function(e){if(e.data.error)return d(Object(u.a)(Object(u.a)({},m),{},{loading:!1})),_(e.data.error,"");_(e.data.message,""),N()})).catch((function(e){d(Object(u.a)(Object(u.a)({},m),{},{loading:!1})),console.error(e)})):be.a.get("".concat(On).concat("/api/v1/add/cron/autoupdate/"),{params:{token:He()}}).then((function(e){if(e.data.error)return d(Object(u.a)(Object(u.a)({},m),{},{loading:!1})),_(e.data.error,"");_(e.data.message,""),N()})).catch((function(e){d(Object(u.a)(Object(u.a)({},m),{},{loading:!1})),console.error(e)}))},className:"button-extra"},"Enabled"===m.autoUpdate?t["disable autoupdate"]:t["enable autoupdate"]),c.a.createElement(kt,{toggleAll:k}),c.a.createElement(_t,{list:"updatesList",bulkAction:function(e){var t=m.selection;t.length&&"apply to selected"!==e&&function(e,t){var a=new FormData;return a.append("action",e),a.append("token",He()),t.forEach((function(e){a.append("pkg[]",e)})),be.a.post(On+"/api/v1/bulk/vesta/",a)}(e,t).then((function(e){if(k(!1),200===e.status){if(e.data.error)return d(Object(u.a)(Object(u.a)({},m),{},{loading:!1})),_(e.data.error,"");_(e.data.message,""),N()}})).catch((function(e){return console.error(e)}))}}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),m.loading?c.a.createElement(P,null):function(){var e=Object(I.a)(m.updates);return e.forEach((function(e){e.FOCUSED=a===e.NAME})),e.map((function(e,t){return c.a.createElement(Nn,{data:e,key:t,checkItem:y})}))}(),c.a.createElement(St,{onSave:S,onCancel:S,show:v.visible,text:v.text}))}),yn=(a(265),function(e){var t=e.data,a=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement(Nt,{id:t.NAME,focused:t.FOCUSED,sysInfo:t.HOSTNAME,checked:t.isChecked,checkItem:function(){e.checkItem(e.data.HOSTNAME)}},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},t.HOSTNAME),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",{className:"descr"},c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.OS," ",t.VERSION),"\xa0\xa0\xa0\xa0\xa0 ","(".concat(t.ARCH,")")))),c.a.createElement(Ge,{className:"c-2"},c.a.createElement("div",null,a["Load Average"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.LOADAVERAGE)))),c.a.createElement(Ge,{className:"c-3"},c.a.createElement("div",null,c.a.createElement("span",null,a.Uptime,": ",c.a.createElement("span",{className:"stat"},t.UPTIME)))))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-list",to:"/edit/server/"},a.configure,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"cogs"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-download restart",onClick:function(){return e.handleAction("/api/v1/restart/system/?hostname=".concat(t.NAME))}},a.restart,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"R"):c.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",class:"bi bi-arrow-repeat",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},c.a.createElement("path",{"fill-rule":"evenodd",d:"M2.854 7.146a.5.5 0 0 0-.708 0l-2 2a.5.5 0 1 0 .708.708L2.5 8.207l1.646 1.647a.5.5 0 0 0 .708-.708l-2-2zm13-1a.5.5 0 0 0-.708 0L13.5 7.793l-1.646-1.647a.5.5 0 0 0-.708.708l2 2a.5.5 0 0 0 .708 0l2-2a.5.5 0 0 0 0-.708z"}),c.a.createElement("path",{"fill-rule":"evenodd",d:"M8 3a4.995 4.995 0 0 0-4.192 2.273.5.5 0 0 1-.837-.546A6 6 0 0 1 14 8a.5.5 0 0 1-1.001 0 5 5 0 0 0-5-5zM2.5 7.5A.5.5 0 0 1 3 8a5 5 0 0 0 9.192 2.727.5.5 0 1 1 .837.546A6 6 0 0 1 2 8a.5.5 0 0 1 .501-.5z"}))))))}),kn=(a(266),function(e){var t=e.data,a=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement(Nt,{id:t.NAME,focused:t.FOCUSED,checked:t.isChecked,stopped:"stopped"===t.STATE,checkItem:function(){e.checkItem(t.NAME)}},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"server-name"},t.NAME),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",{className:"descr"},c.a.createElement("span",{className:"stat"},a[t.SYSTEM]))),c.a.createElement(Ge,{className:"c-1"}),c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",{className:"descr"},c.a.createElement("span",null,a.CPU,": ",c.a.createElement("span",{className:"stat"},t.CPU)))),c.a.createElement(Ge,{className:"c-2"},c.a.createElement("div",null,c.a.createElement("span",null,a.Memory,": ",c.a.createElement("span",{className:"stat"},t.MEM," ",a.mb)))),c.a.createElement(Ge,{className:"c-3"},c.a.createElement("div",null,c.a.createElement("span",null,a.Uptime,": ",c.a.createElement("span",{className:"stat"},t.RTIME)))),c.a.createElement(Ge,{className:"c-1"}))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-list",to:"/edit/server/".concat(t.NAME)},a.configure,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"cogs"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){return e.handleAction("/api/v1"+t.action_url)}},"running"===t.STATE?a.stop:a.start,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"S"):c.a.createElement(W.a,{icon:"running"===t.STATE?"stop":"play"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-download restart",onClick:function(){return e.handleAction("/api/v1/restart/service/?srv=".concat(t.NAME))}},a.restart,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"R"):c.a.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",class:"bi bi-arrow-repeat",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},c.a.createElement("path",{"fill-rule":"evenodd",d:"M2.854 7.146a.5.5 0 0 0-.708 0l-2 2a.5.5 0 1 0 .708.708L2.5 8.207l1.646 1.647a.5.5 0 0 0 .708-.708l-2-2zm13-1a.5.5 0 0 0-.708 0L13.5 7.793l-1.646-1.647a.5.5 0 0 0-.708.708l2 2a.5.5 0 0 0 .708 0l2-2a.5.5 0 0 0 0-.708z"}),c.a.createElement("path",{"fill-rule":"evenodd",d:"M8 3a4.995 4.995 0 0 0-4.192 2.273.5.5 0 0 1-.837-.546A6 6 0 0 1 14 8a.5.5 0 0 1-1.001 0 5 5 0 0 0-5-5zM2.5 7.5A.5.5 0 0 1 3 8a5 5 0 0 0 9.192 2.727.5.5 0 1 1 .837.546A6 6 0 0 1 2 8a.5.5 0 0 1 .501-.5z"}))))))}),_n=(a(267),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)(!1),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1,actionUrl:""}),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({servers:[],selection:[],toggledAll:!1,sorting:t.Action,order:"descending"}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){return l(Be("/list/server/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),D().then((function(){return d(!1)})),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",N),window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",N),window.removeEventListener("keydown",_)}}),[a,r,g.servers]);var N=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),k()):40===e.keyCode&&(e.preventDefault(),y())},j=function(e){e[0].FOCUSED=e[0].NAME,O(Object(u.a)(Object(u.a)({},g),{},{servers:e})),l(vt(e[0]))},y=function(){var e=Object(I.a)(g.servers);if(""!==a.NAME&&""!==a){var t=e.findIndex((function(e){return e.NAME===a.NAME}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{servers:e})),l(vt(n))}}else j(e)},k=function(){var e=Object(I.a)(g.servers);if(""!==a.NAME&&""!==a){var t=e.findIndex((function(e){return e.NAME===a.NAME}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{servers:e})),l(vt(n))}}else j(e)},_=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a.NAME&&!t)switch(e.keyCode){case 13:return S();case 82:return C();case 83:return w()}},S=function(){a.NAME!==g.servers[0].NAME?e.history.push("/edit/server/".concat(a.NAME)):e.history.push("/edit/server/")},w=function(){F("/api/v1"+a.action_url)},C=function(){F("/api/v1/restart/service/?srv=".concat(a.NAME))},D=function(){return d(!0),new Promise((function(e,t){be.a.get(lt+"/api/v1/list/server/index.php").then((function(t){O(Object(u.a)(Object(u.a)({},g),{},{selection:[],toggledAll:!1,servers:M(t.data.data,t.data.sys)})),e()})).catch((function(e){return console.error(e)}))}))},M=function(e,t){var n=[];for(var c in e)e[c].NAME=c,e[c].FOCUSED=a.NAME===c,n.push(e[c]);return n.splice(0,0,Object.values(t)[0]),n[0].NAME=n[0].HOSTNAME,n},F=function(e){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),e&&(d(!0),ot(e).then((function(e){e.data.error&&L(e.data.error),D().then((function(){return d(!1)}))})).catch((function(e){d(!1),console.error(e)})))},x=function(e){var t=Object(I.a)(g.servers);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));O(Object(u.a)(Object(u.a)({},g),{},{servers:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));O(Object(u.a)(Object(u.a)({},g),{},{servers:c,selection:[],toggledAll:e}))}},T=function(e){var t=g.selection,a=Object(I.a)(t),n=Object(I.a)(g.servers),c=a.indexOf(e),r=n.findIndex((function(t){return t.NAME===e}));n[r].isChecked=!n[r].isChecked,-1!==c?a.splice(c,1):a.push(e),O(Object(u.a)(Object(u.a)({},g),{},{servers:n,selection:a}))},L=function(e){f(Object(u.a)(Object(u.a)({},v),{},{visible:!0,text:e}))},U=function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!1,text:""}))};return c.a.createElement("div",{className:"servers-list"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.SERVER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{href:"/edit/server/",list:"server",name:t.configure,showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(pe.b,{to:"/list/server/service/?srv=cpu",className:"button-extra"},t["show: CPU / MEM / NET / DISK"]),c.a.createElement(kt,{toggleAll:x,toggled:g.toggledAll}),c.a.createElement(_t,{list:"serverList",bulkAction:function(e){var t=g.selection;t.length&&e&&(O(Object(u.a)(Object(u.a)({},g),{},{loading:!0})),function(e,t){var a=new FormData;return a.append("action",e),a.append("token",He()),t.forEach((function(e){a.append("service[]",e)})),be.a.post(lt+"/api/v1/bulk/service/",a)}(e,t).then((function(e){e.data.error&&L(e.data.error),x(!1),D().then((function(){return d(!1)}))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),m?c.a.createElement(P,null):c.a.createElement("div",{className:"servers-wrapper"},function(){var e=[];return g.servers.forEach((function(t){t.FOCUSED=a.NAME===t.NAME,e.push(t)})),e.map((function(e,t){return e.HOSTNAME?c.a.createElement(yn,{data:e,key:t,checkItem:T,handleAction:F}):c.a.createElement(kn,{data:e,key:t,checkItem:T,handleAction:F})}))}()),c.a.createElement(St,{onSave:function(){if(!v.actionUrl)return U();U(),d(!0),ot(v.actionUrl).then((function(e){if(e.data.error)return d(!1),L(e.data.error,"");D().then((function(){return d(!1)}))})).catch((function(e){d(!1),console.error(e)}))},onCancel:U,showCancelButton:!1,show:v.visible,text:v.text}))}),Sn=(a(268),function(e){var t=e.menuHeight;if(!e.mobile)return document.documentElement.clientWidth>900?t:45}),wn=function(e){var t=Object(o.d)((function(e){return e.mainNavigation})),a=t.activeElement,r=t.focusedElement,l=Object(o.d)((function(e){return e.session})),s=l.i18n,i=l.userName,u=Object(o.d)((function(e){return e.panel})).panel,m=Object(o.d)((function(e){return e.userSession})).session,d=Object(o.d)((function(e){return e.menuCounters})).user,E=Object(o.c)();Object(n.useEffect)((function(){d.LANGUAGE&&localStorage.setItem("language",d.LANGUAGE)}),[d]);var p,v=function(e,t){if("".concat(window.location.pathname).concat(window.location.search)===e)return t.preventDefault();E(Be(e))},f=function(e){return"stat ".concat(e===a&&"l-active"," ").concat(e===r&&"focus")};return u[i]?c.a.createElement("div",{className:"menu-wrapper"},c.a.createElement("div",{className:(p=e.menuHeight,35===p?"menu-stat shadow":"menu-stat"),style:{height:Sn(e)}},c.a.createElement("div",{className:f("/list/user/")},c.a.createElement(pe.b,{to:"/list/user/",onClick:function(e){return v("/list/user/",e)},onKeyPress:function(e){return e.preventDefault()}},c.a.createElement("h3",null,s.USER),c.a.createElement("div",{className:"stats"},m.look&&u[m.look]?c.a.createElement(c.a.Fragment,null,c.a.createElement("div",null,c.a.createElement("span",null,s.Disk,":"),c.a.createElement("span",null,c.a.createElement("span",{className:"value"},u[m.look].U_DISK,c.a.createElement("span",{className:"unit"},u[m.look].U_DISK_MEASURE)))),c.a.createElement("div",null,c.a.createElement("span",null,s.Bandwidth,":"),c.a.createElement("span",null,c.a.createElement("span",{className:"value"},u[m.look].U_BANDWIDTH,c.a.createElement("span",{className:"unit"},u[m.look].U_BANDWIDTH_MEASURE))))):c.a.createElement(c.a.Fragment,null,c.a.createElement("div",null,c.a.createElement("span",null,s.users,":")," ",c.a.createElement("span",null,d.U_USERS)),c.a.createElement("div",null,c.a.createElement("span",null,s.spnd,":")," ",c.a.createElement("span",null,d.SUSPENDED_USERS)))))),"0"!==u[i].WEB_DOMAINS&&c.a.createElement("div",{className:f("/list/web/")},c.a.createElement(pe.b,{to:"/list/web/",onClick:function(e){return v("/list/web/",e)},onKeyPress:function(e){return e.preventDefault()}},c.a.createElement("h3",null,s.WEB),c.a.createElement("div",{className:"stats"},c.a.createElement("div",null,c.a.createElement("span",null,s.domains,":")," ",c.a.createElement("span",null,d.U_WEB_DOMAINS)),c.a.createElement("div",null,c.a.createElement("span",null,s.aliases,":")," ",c.a.createElement("span",null,d.U_WEB_ALIASES)),c.a.createElement("div",null,c.a.createElement("span",null,s.spnd,":")," ",c.a.createElement("span",null,d.SUSPENDED_WEB))))),"0"!==u[i].DNS_DOMAINS&&c.a.createElement("div",{className:f("/list/dns/")},c.a.createElement(pe.b,{to:"/list/dns/",onClick:function(e){return v("/list/dns/",e)},onKeyPress:function(e){return e.preventDefault()}},c.a.createElement("h3",null,s.DNS),c.a.createElement("div",{className:"stats"},c.a.createElement("div",null,c.a.createElement("span",null,s.domains,":")," ",c.a.createElement("span",null,d.U_DNS_DOMAINS)),c.a.createElement("div",null,c.a.createElement("span",null,s.records,":")," ",c.a.createElement("span",null,d.U_DNS_RECORDS)),c.a.createElement("div",null,c.a.createElement("span",null,s.spnd,":")," ",c.a.createElement("span",null,d.SUSPENDED_DNS))))),"0"!==u[i].MAIL_DOMAINS&&c.a.createElement("div",{className:f("/list/mail/")},c.a.createElement(pe.b,{to:"/list/mail/",onClick:function(e){return v("/list/mail/",e)},onKeyPress:function(e){return e.preventDefault()}},c.a.createElement("h3",null,s.MAIL),c.a.createElement("div",{className:"stats"},c.a.createElement("div",null,c.a.createElement("span",null,s.domains,":")," ",c.a.createElement("span",null,d.U_MAIL_DOMAINS)),c.a.createElement("div",null,c.a.createElement("span",null,s.accounts,":")," ",c.a.createElement("span",null,d.U_MAIL_ACCOUNTS)),c.a.createElement("div",null,c.a.createElement("span",null,s.spnd,":")," ",c.a.createElement("span",null,d.SUSPENDED_MAIL))))),"0"!==u[i].DATABASES&&c.a.createElement("div",{className:f("/list/db/")},c.a.createElement(pe.b,{to:"/list/db/",onClick:function(e){return v("/list/db/",e)},onKeyPress:function(e){return e.preventDefault()}},c.a.createElement("h3",null,s.DB),c.a.createElement("div",{className:"stats"},c.a.createElement("div",null,c.a.createElement("span",null,s.databases,":")," ",c.a.createElement("span",null,d.U_DATABASES)),c.a.createElement("div",null,c.a.createElement("span",null,s.spnd,":")," ",c.a.createElement("span",null,d.SUSPENDED_DB))))),"0"!==u[i].CRON_JOBS&&c.a.createElement("div",{className:f("/list/cron/")},c.a.createElement(pe.b,{to:"/list/cron/",onClick:function(e){return v("/list/cron/",e)},onKeyPress:function(e){return e.preventDefault()}},c.a.createElement("h3",null,s.CRON),c.a.createElement("div",{className:"stats"},c.a.createElement("div",null,c.a.createElement("span",null,s.jobs,":")," ",c.a.createElement("span",null,d.U_CRON_JOBS)),c.a.createElement("div",null,c.a.createElement("span",null,s.spnd,":")," ",c.a.createElement("span",null,d.SUSPENDED_CRON))))),"0"!==u[i].BACKUPS&&c.a.createElement("div",{className:f("/list/backup/")+" last"},c.a.createElement(pe.b,{to:"/list/backup/",onClick:function(e){return v("/list/backup/",e)},onKeyPress:function(e){return e.preventDefault()}},c.a.createElement("h3",null,s.BACKUP),c.a.createElement("div",{className:"stats"},c.a.createElement("div",null,c.a.createElement("span",null,s.backups,":")," ",c.a.createElement("span",null,d.U_BACKUPS))))))):c.a.createElement(P,null)},An=(a(269),function(e){var t,a=Object(o.d)((function(e){return e.session})),n=a.i18n,r=a.userName,l=Object(o.d)((function(e){return e.userSession})).session,s=Object(o.d)((function(e){return e.mainNavigation})),i=s.activeElement,u=s.focusedElement,m=Object(o.c)(),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a="top-link";return e===i&&(a+=" active"),e===u&&(a+=" focus"),a+" ".concat(t)},E=function(e,t){if("".concat(window.location.pathname).concat(window.location.search)===e)return t.preventDefault();m(Be(e))};return c.a.createElement("div",{className:e.class},c.a.createElement("div",{className:"mobile-menu"},"admin"===r&&c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:d("/list/package/")},c.a.createElement(pe.b,{to:"/list/package/",onClick:function(e){return E("/list/package/",e)},onKeyPress:function(e){return e.preventDefault()}},n.Packages)),c.a.createElement("div",{className:d("/list/ip/")},c.a.createElement(pe.b,{to:"/list/ip/",onClick:function(e){return E("/list/ip/",e)},onKeyPress:function(e){return e.preventDefault()}},n.IP)),c.a.createElement("div",{className:d("/list/rrd/")},c.a.createElement(pe.b,{to:"/list/rrd/",onClick:function(e){return E("/list/rrd/",e)},onKeyPress:function(e){return e.preventDefault()}},n.Graphs))),c.a.createElement("div",{className:d("/list/stats/")},c.a.createElement(pe.b,{to:"/list/stats/",onClick:function(e){return E("/list/stats/",e)},onKeyPress:function(e){return e.preventDefault()}},n.Statistics)),c.a.createElement("div",{className:d("/list/log/")},c.a.createElement(pe.b,{to:"/list/log/",onClick:function(e){return E("/list/log/",e)},onKeyPress:function(e){return e.preventDefault()}},n.Log)),"admin"===r&&c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:d("/list/updates/")},c.a.createElement(pe.b,{to:"/list/updates/",onClick:function(e){return E("/list/updates/",e)},onKeyPress:function(e){return e.preventDefault()}},n.Updates)),l.FIREWALL_SYSTEM&&c.a.createElement("div",{className:d("/list/firewall/")},c.a.createElement(pe.b,{to:"/list/firewall/",onClick:function(e){return E("/list/firewall/",e)},onKeyPress:function(e){return e.preventDefault()}},n.Firewall))),l.FILEMANAGER_KEY&&c.a.createElement("div",{className:d("/list/directory/")},c.a.createElement(pe.b,{to:"/list/directory/"},n["File Manager"])),"yes"===l.SOFTACULOUS&&c.a.createElement("div",{className:d("/softaculous/")},c.a.createElement(pe.b,{to:"/softaculous/",target:"_blank"},null!==(t=n.Apps)&&void 0!==t?t:"Apps")),"admin"===r&&c.a.createElement("div",{className:d("/list/server/")},c.a.createElement(pe.b,{to:"/list/server/",onClick:function(e){return E("/list/server/",e)},onKeyPress:function(e){return e.preventDefault()}},n.Server))),c.a.createElement("div",{className:"mobile-stat-menu"},c.a.createElement(wn,{mobile:!0})))}),Cn=window.location.origin;function Dn(e){return c.a.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",id:"_24x24_On_Light_Notification","data-name":"24x24/On Light/Notification",xmlns:"http://www.w3.org/2000/svg"},c.a.createElement("rect",{id:"view-box",width:"24",height:"24",fill:"none"}),c.a.createElement("path",{id:"Shape",d:"M6,17v-.5H2.25A2.253,2.253,0,0,1,0,14.25v-.382a2.542,2.542,0,0,1,1.415-2.289A1.248,1.248,0,0,0,2.1,10.572l.446-4.91a6.225,6.225,0,0,1,12.4,0l.446,4.91a1.26,1.26,0,0,0,.686,1.005,2.547,2.547,0,0,1,1.418,2.29v.382a2.252,2.252,0,0,1-2.25,2.25H11.5V17A2.75,2.75,0,0,1,6,17Zm1.5,0A1.25,1.25,0,0,0,10,17v-.5H7.5ZM4.045,5.8,3.6,10.708A2.738,2.738,0,0,1,2.089,12.92a1.055,1.055,0,0,0-.589.949v.382A.751.751,0,0,0,2.25,15h13A.751.751,0,0,0,16,14.25v-.382a1.054,1.054,0,0,0-.586-.948A2.739,2.739,0,0,1,13.9,10.708L13.456,5.8a4.725,4.725,0,0,0-9.411,0Z",transform:"translate(3.25 2.25)",fill:"#f8b014"}))}function Mn(e){return c.a.createElement("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",id:"_24x24_On_Light_Notification-Alert","data-name":"24x24/On Light/Notification-Alert",xmlns:"http://www.w3.org/2000/svg"},c.a.createElement("rect",{id:"view-box",width:"24",height:"24",fill:"none"}),c.a.createElement("path",{id:"Shape",d:"M6,17v-.5H2.25A2.253,2.253,0,0,1,0,14.25v-.382a2.542,2.542,0,0,1,1.415-2.289A1.247,1.247,0,0,0,2.1,10.572l.446-4.91A6.227,6.227,0,0,1,10.618.286a5.477,5.477,0,0,0-.635,1.374A4.794,4.794,0,0,0,8.75,1.5,4.7,4.7,0,0,0,4.045,5.8L3.6,10.708A2.739,2.739,0,0,1,2.089,12.92a1.055,1.055,0,0,0-.589.949v.382A.751.751,0,0,0,2.25,15h13A.751.751,0,0,0,16,14.25v-.382a1.053,1.053,0,0,0-.586-.948A2.739,2.739,0,0,1,13.9,10.708l-.2-2.18a5.473,5.473,0,0,0,1.526.221l.166,1.822a1.26,1.26,0,0,0,.686,1.005,2.547,2.547,0,0,1,1.418,2.29v.382a2.252,2.252,0,0,1-2.25,2.25H11.5V17A2.75,2.75,0,0,1,6,17Zm1.5,0A1.25,1.25,0,0,0,10,17v-.5H7.5ZM15.047,6.744A3.486,3.486,0,0,1,13.5,6.28L13.456,5.8a4.7,4.7,0,0,0-1.648-3.185,3.5,3.5,0,0,1,.61-1.417A6.221,6.221,0,0,1,14.95,5.662l.1,1.081v0Z",transform:"translate(3.25 2.25)",fill:"#f8b014"}),c.a.createElement("path",{id:"Shape-2","data-name":"Shape",d:"M3.5,7A3.5,3.5,0,1,1,7,3.5,3.5,3.5,0,0,1,3.5,7Z",transform:"translate(15 2)",fill:"#f8b014"}))}a(270);var Fn=function(){var e=Object(o.d)((function(e){return e.session})).i18n,t=Object(o.d)((function(e){return e.notifications})).notifications,a=Object(o.c)(),r=Object(n.useState)(!1),l=Object(A.a)(r,2),s=l[0],i=l[1];Object(n.useEffect)((function(){t.length||u()}),[t]);var u=function(){i(!0),be.a.get(Cn+"/api/v1/list/notifications/index.php",{params:{ajax:1,token:He()}}).then((function(e){var t=[];for(var n in e.data.result)t.push(e.data.result[n]);a({type:"ADD_NOTIFICATIONS",value:t}),i(!1)})).catch((function(e){console.error(e),i(!1)}))},m=function(e){(function(e){return be.a.get(Cn+"/api/v1/delete/notification/index.php",{params:{delete:1,notification_id:e,token:He()}})})(e).then((function(){u()})).catch((function(e){return console.error(e)}))};return c.a.createElement("div",{className:"btn-group"},c.a.createElement("button",{type:"button",className:"btn btn-danger dropdown-toggle","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},c.a.createElement("div",{className:"bell"},t.length?c.a.createElement(Mn,null):c.a.createElement(Dn,null))),c.a.createElement("div",{className:"dropdown-menu"},s?"Loading":t.length?t.map((function(e){return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"dropdown-item"},c.a.createElement("span",{className:"title"},c.a.createElement("b",null,e.TOPIC)),c.a.createElement("span",{className:"delete-notification",onClick:function(){return m(e.ID)}})),c.a.createElement("div",null,at()(e.NOTICE)),c.a.createElement("div",{className:"dropdown-divider"}))})):c.a.createElement("div",{className:"dropdown-item",style:{cursor:"default",marginBottom:"10"}},c.a.createElement("span",{className:"title"},e["no notifications"]))))},xn=(a(271),function(e){var t,a=Object(o.d)((function(e){return e.session})),r=a.i18n,l=a.userName,s=Object(o.d)((function(e){return e.panel})).panel,i=Object(o.d)((function(e){return e.userSession})).session,m=Object(o.d)((function(e){return e.mainNavigation})),d=m.activeElement,E=m.focusedElement,p=Object(o.c)(),v=Object(n.useState)(!1),f=Object(A.a)(v,2),b=f[0],h=f[1],g=Object(n.useState)({smallNavigationClass:"small-navigation hidden"}),O=Object(A.a)(g,2),N=O[0],j=O[1],y=function(t){e.showTopNav(),"small-navigation hidden"===N.smallNavigationClass?j(Object(u.a)(Object(u.a)({},N),{},{smallNavigationClass:"small-navigation show"})):j(Object(u.a)(Object(u.a)({},N),{},{smallNavigationClass:"small-navigation hidden"}))},k=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a="top-link";return e===d&&(a+=" active"),e===E&&(a+=" focus"),a+" ".concat(t)},_=function(e,t){if("".concat(window.location.pathname).concat(window.location.search)===e)return t.preventDefault();p(Be(e))},S=function(){h(!0),p(_a()).then((function(){h(!1)}),(function(e){h(!1),console.error(e)}))},w=function(){if(s[l]&&"yes"===s[l].NOTIFICATIONS)return c.a.createElement(Fn,null)};return c.a.createElement("div",{className:"panel-wrapper"},b&&c.a.createElement(P,null),c.a.createElement("div",{className:"top-panel ".concat(i.look?"long-profile":"")},c.a.createElement("div",{className:"container left-menu"},c.a.createElement("div",{className:"logo"},c.a.createElement(pe.b,{to:"/list/user/",onClick:function(){return p(Be("/list/user/"))}},c.a.createElement("div",null,c.a.createElement("img",{src:"/images/white_logo.png",alt:"Logo"})))),"admin"===l&&c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:k("/list/package/")},c.a.createElement(pe.b,{to:"/list/package/",onClick:function(e){return _("/list/package/",e)},onKeyPress:function(e){return e.preventDefault()}},r.Packages)),c.a.createElement("div",{className:k("/list/ip/")},c.a.createElement(pe.b,{to:"/list/ip/",onClick:function(e){return _("/list/ip/",e)},onKeyPress:function(e){return e.preventDefault()}},r.IP)),c.a.createElement("div",{className:k("/list/rrd/")},c.a.createElement(pe.b,{to:"/list/rrd/",onClick:function(e){return _("/list/rrd/",e)},onKeyPress:function(e){return e.preventDefault()}},r.Graphs))),c.a.createElement("div",{className:k("/list/stats/")},c.a.createElement(pe.b,{to:"/list/stats/",onClick:function(e){return _("/list/stats/",e)},onKeyPress:function(e){return e.preventDefault()}},r.Statistics)),c.a.createElement("div",{className:k("/list/log/")},c.a.createElement(pe.b,{to:"/list/log/",onClick:function(e){return _("/list/log/",e)},onKeyPress:function(e){return e.preventDefault()}},r.Log)),"admin"===l&&c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:k("/list/updates/")},c.a.createElement(pe.b,{to:"/list/updates/",onClick:function(e){return _("/list/updates/",e)},onKeyPress:function(e){return e.preventDefault()}},r.Updates)),i.FIREWALL_SYSTEM&&c.a.createElement("div",{className:k("/list/firewall/")},c.a.createElement(pe.b,{to:"/list/firewall/",onClick:function(e){return _("/list/firewall/",e)},onKeyPress:function(e){return e.preventDefault()}},r.Firewall))),i.FILEMANAGER_KEY&&c.a.createElement("div",{className:k("/list/directory/")},c.a.createElement(pe.b,{to:"/list/directory/"},r["File Manager"])),"yes"===i.SOFTACULOUS&&c.a.createElement("div",{className:k("/softaculous/")},c.a.createElement(pe.b,{to:"/softaculous/",target:"_blank"},null!==(t=r.Apps)&&void 0!==t?t:"Apps")),"admin"===l&&c.a.createElement("div",{className:k("/list/server/")},c.a.createElement(pe.b,{to:"/list/server/",onClick:function(e){return _("/list/server/",e)},onKeyPress:function(e){return e.preventDefault()}},r.Server))),c.a.createElement("div",{className:"container profile-menu"},w(),c.a.createElement("div",{className:"edit-user"},c.a.createElement(pe.b,{to:"/edit/user?user=".concat(l)},i.look?c.a.createElement("div",{className:"long-username"},c.a.createElement("span",null,i.user),c.a.createElement(W.a,{icon:"long-arrow-alt-right"}),c.a.createElement("span",null,i.look)):l)),c.a.createElement("div",{className:"logout-button"},c.a.createElement("button",{onClick:S},r["Log out"])))),function(){if(document.documentElement.clientWidth<900)return c.a.createElement("div",{className:"top-panel small-device"},c.a.createElement("div",{className:"container left-menu"},c.a.createElement("div",{className:"logo"},c.a.createElement(pe.b,{to:"/list/user/",onClick:function(){return p(Be("/list/user/"))}},c.a.createElement("div",null,c.a.createElement("img",{src:"/images/white_logo.png",alt:"Logo"}))))),c.a.createElement("div",{className:"container hamburger",onClick:y},c.a.createElement("span",{className:"bar"}),c.a.createElement("span",{className:"bar"}),c.a.createElement("span",{className:"bar"})),c.a.createElement("div",{className:"container profile-menu"},w(),c.a.createElement("div",null,c.a.createElement(pe.b,{to:"/edit/user?user=".concat(l)},l)),c.a.createElement("div",null,c.a.createElement("button",{onClick:S},r["Log out"]))))}())}),Tn=(a(272),function(){var e=Object(R.g)(),t=Object(n.useState)(!0),a=Object(A.a)(t,2),r=a[0],l=a[1],s=Object(n.useState)({menuHeight:135,tabs:[],showTopNav:!1}),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(o.d)((function(e){return e.session})).userName,p=Object(o.d)((function(e){return e.userSession})).session,v=Object(o.d)((function(e){return e.menuCounters})).user,f=Object(o.d)((function(e){return e.mainNavigation})),b=f.activeElement,h=f.focusedElement,g=f.adminMenuTabs,O=f.userMenuTabs,N=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,j=Object(o.c)();Object(n.useEffect)((function(){if(!E||!Object.entries(v).length||!Object.entries(p).length)return e.push("/login");if(p.look){var t=e.location.pathname.split("/")[2];if("/add/user/"===e.location.pathname)return e.push("/");if(["package","ip","rrd","updates","firewall","server"].includes(t))return e.push("/")}var a=p.look?O:g;d(Object(u.a)(Object(u.a)({},m),{},{tabs:a})),l(!1)}),[E,v,e,p]);var y=Object(n.useCallback)((function(t){var a;if(!(document.querySelector("input:focus")||document.querySelector("textarea:focus")||document.querySelector("textarea:focus"))&&(37!==t.keyCode&&39!==t.keyCode||(N&&j({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),h?a=m.tabs.indexOf(h):(j(Ve(b)),a=m.tabs.indexOf(b))),-1!==a))if(37===t.keyCode){var n=k(m.tabs,a);j(Ve(n))}else if(39===t.keyCode){var c=_(m.tabs,a);j(Ve(c))}else 13===t.keyCode&&!N&&h&&h!==b&&(e.push({pathname:h}),j(Be(h)),j({type:"REMOVE_FOCUSED_ELEMENT",value:""}))}),[b,h,N]);Object(n.useEffect)((function(){return window.addEventListener("resize",S),window.addEventListener("keyup",y),window.addEventListener("scroll",w),function(){window.removeEventListener("resize",S),window.removeEventListener("keyup",y),window.removeEventListener("scroll",w)}}),[y]),Object(n.useEffect)((function(){j({type:"REMOVE_FOCUSED_ELEMENT",value:""})}),[b]),Object(n.useEffect)((function(){j(Be(e.location.pathname))}),[]);var k=function(e,t){return 0===t?e[e.length-1]:e[t-1]},_=function(e,t){return t===e.length-1?e[0]:e[t+1]},S=function(){document.documentElement.clientWidth<900?d(Object(u.a)(Object(u.a)({},m),{},{menuHeight:45})):d(Object(u.a)(Object(u.a)({},m),{},{menuHeight:135}))},w=function(){if(document.documentElement.clientWidth>900){var e=window.scrollY,t=Math.max(45,135-e);d(Object(u.a)(Object(u.a)({},m),{},{menuHeight:t}))}};return c.a.createElement("div",{className:"main-nav"},r?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,c.a.createElement(xn,{showTopNav:function(){var e=!m.showTopNav;d(Object(u.a)(Object(u.a)({},m),{},{showTopNav:e}))},visibleNav:m.showTopNav}),window.innerWidth>900?c.a.createElement("div",{className:m.showTopNav?"nav-wrapper show-nav":"nav-wrapper hide-nav"},c.a.createElement(wn,{menuHeight:m.menuHeight,mobile:!1})):c.a.createElement(An,{class:m.showTopNav?"mobile-top-nav-wrapper show":"mobile-top-nav-wrapper hide"})))}),Ln=(a(273),function(e){var t=e.data,a=e.focused,n=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:a?"statistic-item focused":"statistic-item",id:t.NAME},c.a.createElement(Ge,{className:"l-col w-15"}),c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"stats"},c.a.createElement("div",{className:"name"},t.NAME),c.a.createElement("div",{className:"exclusion-items"},function(){if(Array.isArray(t.ITEMS))return n["no exclusions"];for(var e in t.ITEMS)return c.a.createElement(c.a.Fragment,null,c.a.createElement("b",null,e)," \xa0 ",t.ITEMS[e],c.a.createElement("br",null))}()))))}),Un=function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)({exclusions:[],loading:!1,total:0}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){return l(Be("/list/backup/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),b(),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",E),function(){window.removeEventListener("keydown",E)}}),[a,r,m.exclusions]);var E=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),f()):40===e.keyCode&&(e.preventDefault(),v())},p=function(e){e[0].FOCUSED=e[0].NAME,d(Object(u.a)(Object(u.a)({},m),{},{exclusions:e})),l(vt(e[0].NAME))},v=function(){var e=Object(I.a)(m.exclusions);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(Object(u.a)(Object(u.a)({},m),{},{exclusions:e})),l(vt(n.NAME))}}else p(e)},f=function(){var e=Object(I.a)(m.exclusions);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(Object(u.a)(Object(u.a)({},m),{},{exclusions:e})),l(vt(n.NAME))}}else p(e)},b=function(){d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),be.a.get(Et+"".concat("/api/v1/list/backup/exclusions/index.php")).then((function(e){d({exclusions:h(e.data.data),loading:!1})})).catch((function(e){return console.error(e)}))},h=function(e){var t=[];for(var a in e)t.push({NAME:a,ITEMS:e[a]});return t};return c.a.createElement("div",{className:"exclusions-list"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.BACKUP))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{href:"/edit/backup/exclusions",list:"server",name:t.configure,showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"exclusions-wrapper"},m.loading?c.a.createElement(P,null):m.exclusions.map((function(e,t){return c.a.createElement(Ln,{data:e,key:t,focused:a===e.NAME})}))))};function In(e){var t,a,n=e.data,r=e.domain,l=Object(o.d)((function(e){return e.session})).i18n;localStorage.getItem("token");return c.a.createElement(Nt,{id:n.NAME,focused:n.FOCUSED,checked:n.isChecked,date:n.DATE,starred:n.STARRED,toggleFav:function(t){t?e.toggleFav(e.data.NAME,"add"):e.toggleFav(e.data.NAME,"delete")},checkItem:function(){e.checkItem(e.data.NAME)},suspended:"yes"===n.SUSPENDED},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},"".concat(n.NAME,"@").concat(r)),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",{className:"bandwidth"},l.Disk,c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},n.U_DISK),"\xa0",l.mb),c.a.createElement("div",{className:"percent",style:{width:"".concat(n.U_DISK_PERCENT,"%")||!1}}))),c.a.createElement(Ge,{className:"c-2"},c.a.createElement("div",null,l.Quota,": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},n.QUOTA),"\xa0 ",l.mb)),c.a.createElement("div",null,l["Forward to"],": ",c.a.createElement("span",{className:"stat email"},n.FWD))),c.a.createElement(Ge,{className:"c-3"},(t=l.Autoreply,"no"===(a=n.AUTOREPLY)?c.a.createElement("div",{className:"crossed"},t):c.a.createElement("div",null,t,": ",c.a.createElement("span",{className:"stat"},a)))))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/edit/mail/?domain=".concat(r,"&account=").concat(n.NAME)},l.edit,n.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-gray",onClick:function(){return function(){var t="yes"===n.SUSPENDED?"unsuspend":"suspend";e.handleModal(n.suspend_conf,"/api/v1/".concat(t,"/mail/index.php?domain=").concat(r,"&account=").concat(n.NAME))}()}},l[n.suspend_action],n.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"S"):c.a.createElement(W.a,{icon:"yes"===n.SUSPENDED?"unlock":"lock"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){e.handleModal(n.delete_conf,"/api/v1/delete/mail/index.php?domain=".concat(r,"&account=").concat(n.NAME))}},l.Delete,n.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))}a(274);function Pn(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)(!1),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1,actionUrl:""}),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({mailAccounts:[],mailAccountsFav:[],domain:e.domain,toggledAll:!1,sorting:t.Date,order:"descending",selection:[],totalAmount:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){return l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),D().then((function(){return d(!1)})),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",N),window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",N),window.removeEventListener("keydown",_)}}),[a,r,g.mailAccounts]);var N=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),k()):40===e.keyCode&&(e.preventDefault(),y())},j=function(e){e[0].FOCUSED=e[0].NAME,O(Object(u.a)(Object(u.a)({},g),{},{mailAccounts:e})),l(vt(e[0].NAME))},y=function(){var e=Object(I.a)(g.mailAccounts);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{mailAccounts:e})),l(vt(n.NAME))}}else j(e)},k=function(){var e=Object(I.a)(g.mailAccounts);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{mailAccounts:e})),l(vt(n.NAME))}}else j(e)},_=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a&&!t)switch(e.keyCode){case 8:return C();case 13:return S();case 83:return w()}},S=function(){e.history.push("/edit/mail?domain=".concat(e.domain,"&account=").concat(a))},w=function(){var t=g.mailAccounts.filter((function(e){return e.NAME===a}))[0],n="yes"===t.SUSPENDED?"unsuspend":"suspend";R(t.suspend_conf,"/api/v1/".concat(n,"/mail/index.php?domain=").concat(e.domain,"&account=").concat(a))},C=function(){var t=g.mailAccounts.filter((function(e){return e.NAME===a}))[0];R(t.delete_conf,"/api/v1/delete/mail/index.php?domain=".concat(e.domain,"&account=").concat(a))},D=function(){return d(!0),new Promise((function(t,a){var n;(n=e.domain,be.a.get("".concat(Aa).concat("/api/v1/list/mail/index.php","?domain=").concat(n))).then((function(e){O(Object(u.a)(Object(u.a)({},g),{},{mailAccounts:M(e.data.data),webMail:e.data.webmail,selection:[],toggledAll:!1,mailAccountsFav:e.data.mailAccountsFav,totalAmount:e.data.totalAmount})),t()})).catch((function(e){return console.error(e)}))}))},M=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].FOCUSED=a===n,t.push(e[n]);return t},F=function(e){var t=g.selection,a=g.mailAccounts,n=Object(I.a)(t),c=a,r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),O(Object(u.a)(Object(u.a)({},g),{},{mailAccounts:c,selection:n}))},x=function(e){var t=g.order,a=g.sorting,n=T(a);return"descending"===t?e.sort((function(e,t){return e[n]<t[n]?1:t[n]<e[n]?-1:0})):e.sort((function(e,t){return e[n]>t[n]?1:t[n]>e[n]?-1:0}))},T=function(e){var a=t.Date,n=t.Accounts,c=t.Disk,r=t.Starred;switch(e){case a:return"DATE";case n:return"ACCOUNTS";case c:return"U_DISK";case r:return"STARRED"}},L=function(e,t){var a=g.mailAccountsFav;"add"===t?(a[e]=1,gt(e,"mail_acc").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{mailAccountsFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"mail_acc").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{mailAccountsFav:a}))})).catch((function(e){console.error(e)})))},U=function(e){var t=Object(I.a)(g.mailAccounts);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));O(Object(u.a)(Object(u.a)({},g),{},{mailAccounts:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));O(Object(u.a)(Object(u.a)({},g),{},{mailAccounts:c,selection:[],toggledAll:e}))}},R=function(e,t){f(Object(u.a)(Object(u.a)({},v),{},{visible:!0,text:e,actionUrl:t}))},V=function(){l(et()).then((function(){return d(!1)}))},B=function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"mail-accounts"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.MAIL))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{name:t["Add Mail Account"],href:"/add/mail/?domain=".concat(e.domain),showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},g.webMail&&c.a.createElement("a",{href:g.webMail,className:"button-extra",type:"submit"},t["open webmail"]),c.a.createElement(kt,{toggleAll:U,toggled:g.toggledAll}),c.a.createElement(_t,{list:"mailList",bulkAction:function(t){var a=g.selection;a.length&&t&&(d(!0),function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=new FormData;return n.append("action",e),n.append("token",He()),n.append("domain",t),a.forEach((function(e){n.append("account[]",e)})),be.a.post(Aa+"/api/v1/bulk/mail/",n)}(t,e.domain,a).then((function(e){200===e.status&&(U(!1),D().then((function(){return V()})))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(ft,{changeSorting:function(e,t){O(Object(u.a)(Object(u.a)({},g),{},{sorting:e,order:t}))},sorting:g.sorting,order:g.order,list:"mailAccountList"}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),m?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"mail-accounts-wrapper"},c.a.createElement("div",{className:"subtitle"},c.a.createElement("span",null,"".concat(t.Listing," ").concat(g.domain))),function(){var e=g.mailAccounts,t=Object(u.a)({},g.mailAccountsFav),n=[];return e.forEach((function(e){e.FOCUSED=a===e.NAME,t[e.NAME]?e.STARRED=t[e.NAME]:e.STARRED=0,n.push(e)})),x(n).map((function(e,t){return c.a.createElement(In,{data:e,key:t,domain:g.domain,toggleFav:L,checkItem:F,handleModal:R})}))}()),c.a.createElement("div",{className:"footer-actions-wrapper"},c.a.createElement("div",{className:"total"},g.totalAmount),c.a.createElement("div",{className:"back"},c.a.createElement(pe.b,{to:"/list/mail/"},t.Back)))),c.a.createElement(St,{onSave:function(){if(!v.actionUrl)return B();B(),d(!0),Da(v.actionUrl).then((function(e){if(e.data.error)return d(!1),R(e.data.error,"");D().then((function(){return V()}))})).catch((function(e){d(!1),console.error(e)}))},onCancel:B,show:v.visible,text:v.text}))}a(275);var Rn=function(e){var t=e.data,a=Object(o.d)((function(e){return e.session})).i18n,n=(localStorage.getItem("token"),function(e,t){return"no"===t?c.a.createElement("div",{className:"crossed"},e):c.a.createElement("div",null,e,": ",c.a.createElement("span",{className:"stat"},t))});return c.a.createElement(Nt,{id:t.NAME,focused:t.FOCUSED,checked:t.isChecked,date:t.DATE,starred:t.STARRED,toggleFav:function(t){t?e.toggleFav(e.data.NAME,"add"):e.toggleFav(e.data.NAME,"delete")},checkItem:function(){e.checkItem(e.data.NAME)},suspended:"yes"===t.SUSPENDED},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},t.NAME),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",{className:"bandwidth"},a.Disk,c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.U_DISK),a.mb),c.a.createElement("div",{className:"percent",style:{width:"".concat(t.U_DISK_PERCENT,"%")||!1}}))),c.a.createElement(Ge,{className:"c-2"},n(a["AntiVirus Support"],t.ANTIVIRUS),n(a["DKIM Support"],t.DKIM)),c.a.createElement(Ge,{className:"c-3"},n(a["AntiSpam Support"],t.ANTISPAM),c.a.createElement("div",null,a["Catchall email"],": ",c.a.createElement("span",{className:"stat catchall-mail"},t.CATCHALL))))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-gray",to:"/list/mail/?domain=".concat(t.NAME)},t.list_accounts_button,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"L"):c.a.createElement(W.a,{icon:"list"}))),c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/add/mail/?domain=".concat(t.NAME)},a["add account"],t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"N"):c.a.createElement(W.a,{icon:"plus"}))),c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/edit/mail/?domain=".concat(t.NAME)},a.edit,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-gray",onClick:function(){return function(){var a="yes"===t.SUSPENDED?"unsuspend":"suspend";e.handleModal(t.suspend_conf,"/api/v1/".concat(a,"/mail/index.php?domain=").concat(t.NAME))}()}},a[t.suspend_action],t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"S"):c.a.createElement(W.a,{icon:"yes"===t.SUSPENDED?"unlock":"lock"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){e.handleModal(t.delete_conf,"/api/v1/delete/mail/index.php?domain=".concat(t.NAME))}},a.Delete,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))},Vn=(a(276),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)(!1),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1,actionUrl:""}),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({mails:[],mailFav:[],toggledAll:!1,webmail:"",sorting:t.Date,order:"descending",selection:[],totalAmount:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){return l(Be("/list/mail/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),F().then((function(){return d(!1)})),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",N),window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",N),window.removeEventListener("keydown",_)}}),[a,r,g.mails]);var N=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),k()):40===e.keyCode&&(e.preventDefault(),y())},j=function(e){e[0].FOCUSED=e[0].NAME,O(Object(u.a)(Object(u.a)({},g),{},{mails:e})),l(vt(e[0].NAME))},y=function(){var e=Object(I.a)(g.mails);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{mails:e})),l(vt(n.NAME))}}else j(e)},k=function(){var e=Object(I.a)(g.mails);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{mails:e})),l(vt(n.NAME))}}else j(e)},_=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a&&!t)switch(e.keyCode){case 8:return M();case 13:return C();case 76:return w();case 78:return S();case 83:return D()}},S=function(){e.history.push("/add/mail/?domain=".concat(a))},w=function(){e.history.push("/list/mail?domain=".concat(a,"&type=access"))},C=function(){e.history.push("/edit/mail?domain=".concat(a))},D=function(){var e=g.mails.filter((function(e){return e.NAME===a}))[0],t="yes"===e.SUSPENDED?"unsuspend":"suspend";B(e.suspend_conf,"/api/v1/".concat(t,"/mail/index.php?domain=").concat(a))},M=function(){var e=g.mails.filter((function(e){return e.NAME===a}))[0];B(e.delete_conf,"/api/v1/delete/mail/index.php?domain=".concat(a))},F=function(){return d(!0),new Promise((function(e,t){Ca().then((function(t){O(Object(u.a)(Object(u.a)({},g),{},{mails:x(t.data.data),webmail:t.data.webmail,mailFav:t.data.mailFav,selection:[],toggledAll:!1,totalAmount:t.data.totalAmount})),e()})).catch((function(e){return console.error(e)}))}))},x=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].FOCUSED=a===n,t.push(e[n]);return t},T=function(e){var t=g.selection,a=g.mails,n=Object(I.a)(t),c=a,r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),O(Object(u.a)(Object(u.a)({},g),{},{mails:c,selection:n}))},L=function(e){var t=g.order,a=g.sorting,n=U(a);return"descending"===t?e.sort((function(e,t){return e[n]<t[n]?1:t[n]<e[n]?-1:0})):e.sort((function(e,t){return e[n]>t[n]?1:t[n]>e[n]?-1:0}))},U=function(e){var a=t.Date,n=t.Domains,c=t.Accounts,r=t.Disk,l=t.Starred;switch(e){case a:return"DATE";case n:return"domain_account";case c:return"ACCOUNTS";case r:return"U_DISK";case l:return"STARRED"}},R=function(e,t){var a=g.mailFav;"add"===t?(a[e]=1,gt(e,"mail").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{mailFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"mail").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{mailFav:a}))})).catch((function(e){console.error(e)})))},V=function(e){var t=Object(I.a)(g.mails);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));O(Object(u.a)(Object(u.a)({},g),{},{mails:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));O(Object(u.a)(Object(u.a)({},g),{},{mails:c,selection:[],toggledAll:e}))}},B=function(e,t){f(Object(u.a)(Object(u.a)({},v),{},{visible:!0,text:e,actionUrl:t}))},W=function(){l(et()).then((function(){return d(!1)}))},q=function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"mails"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.MAIL))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{name:"Add Mail Domain",href:"/add/mail",showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},g.webmail&&c.a.createElement(pe.b,{to:{pathname:"http://".concat(window.location.hostname).concat(g.webmail)},target:"_blank",className:"button-extra",type:"submit"},t["open webmail"]),c.a.createElement(kt,{toggleAll:V,toggled:g.toggledAll}),c.a.createElement(_t,{list:"mailList",bulkAction:function(e){var t=g.selection;t.length&&e&&(d(!0),function(e,t){var a=new FormData;return a.append("action",e),a.append("token",He()),t.forEach((function(e){a.append("domain[]",e)})),be.a.post(Aa+"/api/v1/bulk/mail/",a)}(e,t).then((function(e){200===e.status&&(V(!1),F().then((function(){return W()})))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(ft,{changeSorting:function(e,t){O(Object(u.a)(Object(u.a)({},g),{},{sorting:e,order:t}))},sorting:g.sorting,order:g.order,list:"mailList"}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"mails-wrapper"},m?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,function(){var e=g.mails,t=Object(u.a)({},g.mailFav),n=[];return e.forEach((function(e){e.FOCUSED=a===e.NAME,t[e.NAME]?e.STARRED=t[e.NAME]:e.STARRED=0,n.push(e)})),L(n).map((function(e,t){return c.a.createElement(Rn,{data:e,key:t,toggleFav:R,checkItem:T,handleModal:B})}))}(),c.a.createElement("div",{className:"total"},g.totalAmount))),c.a.createElement(St,{onSave:function(){if(!v.actionUrl)return q();q(),d(!0),Da(v.actionUrl).then((function(e){if(e.data.error)return d(!1),B(e.data.error,"");F().then((function(){return W()}))})).catch((function(e){d(!1),console.error(e)}))},onCancel:q,show:v.visible,text:v.text}))});function Bn(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(n.useState)(""),r=Object(A.a)(a,2),l=r[0],s=r[1],i=Object(R.g)();return Object(n.useEffect)((function(){var e=ge.a.parse(i.location.search,{ignoreQueryPrefix:!0});e.domain?s(e.domain):s("")}),[i.location]),c.a.createElement(c.a.Fragment,null,c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.MAIL))),l?c.a.createElement(Pn,Object.assign({},e,{domain:l,changeSearchTerm:e.changeSearchTerm})):c.a.createElement(Vn,Object.assign({},e,{changeSearchTerm:e.changeSearchTerm})))}function Wn(e){var t=e.data,a=e.domain,n=e.handleModal,r=Object(w.a)(e,["data","domain","handleModal"]),l=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement(Nt,{id:t.NAME,date:t.DATE,toggleFav:function(e){e?r.toggleFav(t.NAME,"add"):r.toggleFav(t.NAME,"delete")},checkItem:function(){r.checkItem(t.NAME)},starred:t.STARRED,focused:t.FOCUSED,checked:t.isChecked,suspended:"yes"===t.SUSPENDED},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},t.dnsRecord),c.a.createElement("br",null),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("span",{className:"stat"},"".concat(t.RECORD.substring(0,12)).concat(t.RECORD.length>12?"...":""))),c.a.createElement(Ge,{className:"c-2"},c.a.createElement("span",{className:"stat"},t.TYPE)),c.a.createElement(Ge,{className:"c-3"},c.a.createElement("span",{className:"stat"},t.PRIORITY)),c.a.createElement(Ge,{className:"c-4 long-value"},c.a.createElement("span",{className:"stat"},t.VALUE)))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/edit/dns/?domain=".concat(a,"&record_id=").concat(t.ID)},l.edit,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-gray",onClick:function(){n(t.suspend_conf,"/api/v1/".concat(t.suspend_action,"/dns/?domain=").concat(a,"&record_id=").concat(t.ID))}},t.suspend_action,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"S"):c.a.createElement(W.a,{icon:"yes"===t.SUSPENDED?"unlock":"lock"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){n(t.delete_conf,"/api/v1/delete/dns/?domain=".concat(a,"&record_id=").concat(t.ID))}},l.Delete,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))}a(277);function qn(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(R.g)(),i=Object(n.useState)(!1),m=Object(A.a)(i,2),d=m[0],E=m[1],p=Object(n.useState)({text:"",visible:!1,actionUrl:""}),v=Object(A.a)(p,2),f=v[0],b=v[1],h=Object(n.useState)({dnsRecords:[],dnsRecordFav:[],domain:"",toggledAll:!1,sorting:t.Date,order:"descending",selection:[],totalAmount:""}),g=Object(A.a)(h,2),O=g[0],N=g[1];Object(n.useEffect)((function(){return l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),D().then((function(){return E(!1)})),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",j),window.addEventListener("keydown",S),function(){window.removeEventListener("keydown",j),window.removeEventListener("keydown",S)}}),[a,r,O.dnsRecords]);var j=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),_()):40===e.keyCode&&(e.preventDefault(),k())},y=function(e){e[0].FOCUSED=e[0].NAME,N(Object(u.a)(Object(u.a)({},O),{},{dnsRecords:e})),l(vt(e[0].NAME))},k=function(){var e=Object(I.a)(O.dnsRecords);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),N(Object(u.a)(Object(u.a)({},O),{},{dnsRecords:e})),l(vt(n.NAME))}}else y(e)},_=function(){var e=Object(I.a)(O.dnsRecords);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),N(Object(u.a)(Object(u.a)({},O),{},{dnsRecords:e})),l(vt(n.NAME))}}else y(e)},S=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a&&!t){if(13===e.keyCode)return w();if(8===e.keyCode)return C()}},w=function(){e.history.push("/edit/dns/?domain=".concat(a))},C=function(){var e=O.databases.filter((function(e){return e.NAME===a}))[0];L(e.delete_conf,"/api/v1/delete/database/?domain=".concat(a))},D=function(){var e=ge.a.parse(s.location.search,{ignoreQueryPrefix:!0});return E(!0),new Promise((function(t,a){var n;(n=e.domain||"",be.a.get("".concat(Ra).concat("/api/v1/list/dns/index.php","?domain=").concat(n))).then((function(a){N(Object(u.a)(Object(u.a)({},O),{},{dnsRecords:M(a.data.data),dnsRecordFav:a.data.dnsRecordsFav,totalAmount:a.data.totalAmount,domain:e.domain,toggledAll:!1,selection:[]})),t()})).catch((function(e){return console.error(e)}))}))},M=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].FOCUSED=a===n,t.push(e[n]);return t},F=function(e){var t=O.selection,a=O.dnsRecords,n=Object(I.a)(t),c=a,r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),N(Object(u.a)(Object(u.a)({},O),{},{dnsRecords:c,selection:n}))},x=function(e,t){var a=O.dnsRecordFav;"add"===t?(a[e]=1,gt(e,"dns_rec").then((function(){N(Object(u.a)(Object(u.a)({},O),{},{dnsRecordFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"dns_rec").then((function(){N(Object(u.a)(Object(u.a)({},O),{},{dnsRecordFav:a}))})).catch((function(e){console.error(e)})))},T=function(e){var t=Object(I.a)(O.dnsRecords);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));N(Object(u.a)(Object(u.a)({},O),{},{dnsRecords:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));N(Object(u.a)(Object(u.a)({},O),{},{dnsRecords:c,selection:[],toggledAll:e}))}},L=function(e,t){b(Object(u.a)(Object(u.a)({},f),{},{visible:!0,text:e,actionUrl:t}))},U=function(){l(et()).then((function(){return E(!1)}))},V=function(){b(Object(u.a)(Object(u.a)({},f),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"dns-records"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.DNS))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{name:t["Add DNS Record"],href:"/add/dns/?domain=".concat(O.domain),showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(kt,{toggleAll:T,toggled:O.toggledAll}),c.a.createElement(_t,{list:"dnsList",bulkAction:function(e){var t=O.selection;t.length&&e&&(E(!0),function(e,t,a){var n=new FormData;return n.append("action",e),n.append("token",He()),n.append("domain",a),t.forEach((function(e){n.append("record[]",e)})),be.a.post(Ra+"/api/v1/bulk/dns/",n)}(e,t,O.domain).then((function(e){200===e.status&&(T(!1),D().then((function(){return U()})))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),d?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"dns-records-wrapper"},c.a.createElement("div",{className:"subtitle"},c.a.createElement("span",null,"".concat(t.Listing," ").concat(O.domain))),function(){var e=O.dnsRecords,t=[],n=Object(u.a)({},O.dnsRecordFav);return e.forEach((function(e){e.FOCUSED=a===e.NAME,n[e.NAME]?e.STARRED=n[e.NAME]:e.STARRED=0,t.push(e)})),t.map((function(e,t){return c.a.createElement(Wn,{data:e,key:t,domain:O.domain,toggleFav:x,checkItem:F,handleModal:L})}))}()),c.a.createElement("div",{className:"footer-actions-wrapper"},c.a.createElement("div",{className:"total"},O.totalAmount),c.a.createElement("div",{className:"back"},c.a.createElement(pe.b,{to:"/list/dns/"},t.Back)))),c.a.createElement(St,{onSave:function(){if(!f.actionUrl)return V();V(),E(!0),Va(f.actionUrl).then((function(e){if(e.data.error)return E(!1),L(e.data.error,"");D().then((function(){return U()}))})).catch((function(e){E(!1),console.error(e)}))},onCancel:V,show:f.visible,text:f.text}))}a(278);var Hn=function(e){var t=e.data,a=Object(o.d)((function(e){return e.session})).i18n;localStorage.getItem("token");return c.a.createElement(Nt,{id:t.NAME,checked:t.isChecked,starred:t.STARRED,date:t.DATE,toggleFav:function(t){t?e.toggleFav(e.data.NAME,"add"):e.toggleFav(e.data.NAME,"delete")},checkItem:function(){e.checkItem(e.data.NAME)},suspended:"yes"===t.SUSPENDED,focused:t.FOCUSED},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},t.NAME," ",c.a.createElement("span",{className:"dns-records"},"/ ",t.RECORDS)),c.a.createElement("br",null),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1 w-35"},c.a.createElement("div",{className:"ip"},t.IP),c.a.createElement("div",{className:"soa"},c.a.createElement("span",{className:"stat"},t.SOA))),c.a.createElement(Ge,{className:"c-2 w-30"},c.a.createElement("div",null,a.TTL,": ",c.a.createElement("span",{className:"stat"},t.TTL)),c.a.createElement("div",null,a.Serial,": ",c.a.createElement("span",{className:"stat"},t.SERIAL))),c.a.createElement(Ge,{className:"c-3 w-35"},c.a.createElement("div",null,a.Template,": ",c.a.createElement("span",{className:"stat"},t.TPL)),c.a.createElement("div",null,a.Expire,": ",c.a.createElement("span",{className:"stat"},t.EXP))))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-gray",to:"/list/dns/?domain=".concat(t.NAME)},t.RECORDS_I18N,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"L"):c.a.createElement(W.a,{icon:"list"}))),c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/add/dns/?domain=".concat(t.NAME)},a["add record"],t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"N"):c.a.createElement(W.a,{icon:"plus"}))),c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/edit/dns/?domain=".concat(t.NAME)},a.edit,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-gray",onClick:function(){return function(){var a="yes"===t.SUSPENDED?"unsuspend":"suspend";e.handleModal(t.suspend_conf,"/api/v1/".concat(a,"/dns/index.php?domain=").concat(t.NAME))}()}},a[t.suspend_action],t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"S"):c.a.createElement(W.a,{icon:"yes"===t.SUSPENDED?"unlock":"lock"}))),c.a.createElement("div",null,c.a.createElement("button",{type:"button",className:"link-delete",onClick:function(){e.handleModal(t.delete_conf,"/api/v1/delete/dns/index.php?domain=".concat(t.NAME))}},a.Delete,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))},Kn=(a(279),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)(!1),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({text:"",visible:!1,actionUrl:""}),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({domainNameSystems:[],dnsFav:[],toggledAll:!1,sorting:t.Date,order:"descending",selection:[],totalAmount:""}),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){return l(Be("/list/dns/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),F().then((function(){return d(!1)})),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",N),window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",N),window.removeEventListener("keydown",_)}}),[a,r,g.domainNameSystems]);var N=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),k()):40===e.keyCode&&(e.preventDefault(),y())},j=function(e){e[0].FOCUSED=e[0].NAME,O(Object(u.a)(Object(u.a)({},g),{},{domainNameSystems:e})),l(vt(e[0].NAME))},y=function(){var e=Object(I.a)(g.domainNameSystems);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{domainNameSystems:e})),l(vt(n.NAME))}}else j(e)},k=function(){var e=Object(I.a)(g.domainNameSystems);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),O(Object(u.a)(Object(u.a)({},g),{},{domainNameSystems:e})),l(vt(n.NAME))}}else j(e)},_=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a&&!t)switch(e.keyCode){case 8:return M();case 13:return C();case 76:return w();case 78:return S();case 83:return D()}},S=function(){e.history.push("/add/dns/?domain=".concat(a))},w=function(){e.history.push("/list/dns?domain=".concat(a,"&type=access"))},C=function(){e.history.push("/edit/dns?domain=".concat(a))},D=function(){var e=g.domainNameSystems.filter((function(e){return e.NAME===a}))[0],t="yes"===e.SUSPENDED?"unsuspend":"suspend";B(e.suspend_conf,"/api/v1/".concat(t,"/dns/index.php?domain=").concat(a))},M=function(){var e=g.domainNameSystems.filter((function(e){return e.NAME===a}))[0];B(e.delete_conf,"/api/v1/delete/dns/index.php?domain=".concat(a))},F=function(){return d(!0),new Promise((function(e,t){be.a.get(Ra+"/api/v1/list/dns/index.php").then((function(t){O(Object(u.a)(Object(u.a)({},g),{},{domainNameSystems:x(t.data.data),dnsFav:t.data.dnsFav,selection:[],toggledAll:!1,totalAmount:t.data.totalAmount})),e()})).catch((function(e){return console.error(e)}))}))},x=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].RECORDS=Number(e[n].RECORDS),e[n].FOCUSED=a===n,t.push(e[n]);return t},T=function(e){var t=g.selection,a=g.domainNameSystems,n=Object(I.a)(t),c=a,r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),O(Object(u.a)(Object(u.a)({},g),{},{domainNameSystems:c,selection:n}))},L=function(e){var t=g.order,a=g.sorting,n=U(a);return"descending"===t?e.sort((function(e,t){var a=e[n],c=t[n];return a<c?1:c<a?-1:0})):e.sort((function(e,t){var a=e[n],c=t[n];return a>c?1:c>a?-1:0}))},U=function(e){var a=t.Date,n=t.Expire,c=t.Domain,r=t.IP,l=t.Records,o=t.Starred;switch(e){case a:return"DATE";case n:return"EXP";case c:return"NAME";case r:return"IP";case l:return"RECORDS";case o:return"STARRED"}},R=function(e,t){var a=g.dnsFav;"add"===t?(a[e]=1,gt(e,"dns").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{dnsFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"dns").then((function(){O(Object(u.a)(Object(u.a)({},g),{},{dnsFav:a}))})).catch((function(e){console.error(e)})))},V=function(e){var t=Object(I.a)(g.domainNameSystems);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));O(Object(u.a)(Object(u.a)({},g),{},{domainNameSystems:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));O(Object(u.a)(Object(u.a)({},g),{},{domainNameSystems:c,selection:[],toggledAll:e}))}},B=function(e,t){f(Object(u.a)(Object(u.a)({},v),{},{visible:!0,text:e,actionUrl:t}))},W=function(){l(et()).then((function(){return d(!1)}))},q=function(){f(Object(u.a)(Object(u.a)({},v),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"dns"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.DNS))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{name:t["Add DNS Domain"],href:"/add/dns",showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(kt,{toggleAll:V,toggled:g.toggledAll}),c.a.createElement(_t,{list:"dnsList",bulkAction:function(e){var t=g.selection;t.length&&e&&(d(!0),function(e,t){var a=new FormData;return a.append("action",e),a.append("token",He()),t.forEach((function(e){a.append("domain[]",e)})),be.a.post(Ra+"/api/v1/bulk/dns/",a)}(e,t).then((function(e){200===e.status&&(V(!1),F().then((function(){return W()})))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(ft,{changeSorting:function(e,t){O(Object(u.a)(Object(u.a)({},g),{},{sorting:e,order:t}))},sorting:g.sorting,order:g.order,list:"dnsList"}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"dns-wrapper"},m?c.a.createElement(P,null):function(){var e=g.domainNameSystems,t=Object(u.a)({},g.dnsFav),n=[];return e.forEach((function(e){e.FOCUSED=a===e.NAME,t[e.NAME]?e.STARRED=t[e.NAME]:e.STARRED=0,n.push(e)})),L(n).map((function(e,t){return c.a.createElement(Hn,{data:e,key:t,toggleFav:R,checkItem:T,handleModal:B})}))}()),c.a.createElement("div",{className:"total"},g.totalAmount),c.a.createElement(St,{onSave:function(){if(!v.actionUrl)return q();q(),d(!0),Va(v.actionUrl).then((function(e){if(e.data.error)return d(!1),B(e.data.error,"");F().then((function(){return W()}))})).catch((function(e){d(!1),console.error(e)}))},onCancel:q,show:v.visible,text:v.text}))});function Jn(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(R.g)(),r=ge.a.parse(a.location.search,{ignoreQueryPrefix:!0}),l=Object(n.useState)(!1),s=Object(A.a)(l,2),i=s[0],u=s[1];return Object(n.useEffect)((function(){r.domain?u(!0):u(!1)}),[a.location]),c.a.createElement(c.a.Fragment,null,c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.DNS))),i?c.a.createElement(qn,Object.assign({},e,{changeSearchTerm:e.changeSearchTerm})):c.a.createElement(Kn,Object.assign({},e,{changeSearchTerm:e.changeSearchTerm})))}var zn=window.location.origin,Yn=(a(280),function(e){var t=e.data,a=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:t.FOCUSED?"statistic-item focused":"statistic-item",id:t.NAME},c.a.createElement(Ge,{className:"l-col w-15"},function(e){var t=new Date(e),a=t.getDate(),n=t.getMonth(),r=t.getFullYear();return c.a.createElement("div",{className:"date"},a," \xa0 ",["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n]," \xa0 ",r)}(t.DATE)),c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},function(e){var t=new Date(e),a=t.getMonth(),n=t.getFullYear();return c.a.createElement("div",{className:"date"},["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a]," \xa0 ",n)}(t.DATE)),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",{className:"bandwidth"},a.Bandwidth,c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.U_BANDWIDTH),a.mb),c.a.createElement("div",{className:"percent",style:{width:"".concat(t.U_BANDWIDTH_PERCENT,"%")||!1}})),c.a.createElement("div",{className:"disk"},a.Disk,": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.U_DISK),a.mb),c.a.createElement("div",{className:"percent",style:{width:"".concat(t.U_DISK_PERCENT,"%")||!1}})),c.a.createElement("div",{className:"sub-disk-stats"},c.a.createElement("div",null,c.a.createElement("div",null,a.Web,": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.U_DISK_WEB),a.mb)),c.a.createElement("div",null,a.Mail,": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.U_DISK_MAIL),a.mb))),c.a.createElement("div",null,c.a.createElement("div",null,a.Databases,": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.U_DATABASES),a.mb)),c.a.createElement("div",null,a["User Directories"],": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},t.U_DISK_DIRS),a.mb))))),c.a.createElement(Ge,{className:"c-2"},c.a.createElement("div",null,c.a.createElement("span",null,a["Web Domains"],":")," ",c.a.createElement("span",{className:"stat"},t.U_WEB_DOMAINS)),c.a.createElement("div",null,c.a.createElement("span",null,a["SSL Domains"],":")," ",c.a.createElement("span",{className:"stat"},t.U_WEB_SSL)),c.a.createElement("div",null,c.a.createElement("span",null,a["Web Aliases"],":")," ",c.a.createElement("span",{className:"stat"},t.U_WEB_ALIASES)),c.a.createElement("div",null,c.a.createElement("span",null,a["DNS Domains"],":")," ",c.a.createElement("span",{className:"stat"},t.U_DNS_DOMAINS)),c.a.createElement("div",null,c.a.createElement("span",null,a["DNS records"],":")," ",c.a.createElement("span",{className:"stat"},t.U_DNS_RECORDS))),c.a.createElement(Ge,{className:"c-3"},c.a.createElement("div",null,c.a.createElement("span",null,a["Mail Domains"],":")," ",c.a.createElement("span",{className:"stat"},t.U_MAIL_DOMAINS)),c.a.createElement("div",null,c.a.createElement("span",null,a["Mail Accounts"],":")," ",c.a.createElement("span",{className:"stat"},t.U_MAIL_ACCOUNTS)),c.a.createElement("div",null,c.a.createElement("span",null,a.Databases,":")," ",c.a.createElement("span",{className:"stat"},t.U_DATABASES)),c.a.createElement("div",null,c.a.createElement("span",null,a["Cron Jobs"],":")," ",c.a.createElement("span",{className:"stat"},t.U_CRON_JOBS)),c.a.createElement("div",null,c.a.createElement("span",null,a["IP Addresses"],":")," ",c.a.createElement("span",{className:"stat"},t.IP_OWNED))))))}),Gn=(a(281),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)({statistics:[],users:[],totalAmount:"",loading:!1}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){return l(Be("/list/stats/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),b(),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",E),function(){window.removeEventListener("keydown",E)}}),[a,r,m.statistics]);var E=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),f()):40===e.keyCode&&(e.preventDefault(),v())},p=function(e){e[0].FOCUSED=e[0].NAME,d(Object(u.a)(Object(u.a)({},m),{},{statistics:e})),l(vt(e[0].NAME))},v=function(){var e=Object(I.a)(m.statistics);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(Object(u.a)(Object(u.a)({},m),{},{statistics:e})),l(vt(n.NAME))}}else p(e)},f=function(){var e=Object(I.a)(m.statistics);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(Object(u.a)(Object(u.a)({},m),{},{statistics:e})),l(vt(n.NAME))}}else p(e)},b=function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),d(Object(u.a)(Object(u.a)({},m),{},{loading:!0}));var e=window.location.search;(function(e){return be.a.get(zn+"/api/v1/list/stats/index.php?user="+e)})(e?e.split("=")[1]:"").then((function(e){d(Object(u.a)(Object(u.a)({},m),{},{statistics:h(e.data.data),users:e.data.users||[],totalAmount:e.data.totalAmount,loading:!1}))})).catch((function(e){return console.error(e)}))},h=function(e){var t=[];for(var n in e)e[n].DATE=n,e[n].NAME=n,e[n].FOCUSED=a===n,t.push(e[n]);return t};return c.a.createElement("div",{className:"statistics-list"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.STATS))),c.a.createElement(Xe,{mobile:!1,className:"justify-right"},c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(pe.b,{to:"/list/stats/",className:"button-extra",type:"submit"},t["Overall Statistics"]),c.a.createElement(_t,{list:"statisticsList",users:m.users,bulkAction:function(t){var a=""!==t?"?user=".concat(t):"";e.history.push({search:a}),b()}}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"statistics-wrapper"},m.loading?c.a.createElement(P,null):function(){var e=Object(I.a)(m.statistics);return e.forEach((function(e){e.FOCUSED=a===e.NAME})),e.map((function(e,t){return c.a.createElement(Yn,{data:e,key:t})}))}()),c.a.createElement("div",{className:"total"},m.totalAmount))}),Qn=(a(282),function(e){var t,a=e.data,n=e.toggleFav,r=e.handleModal,l=e.checkItem,s=e.logOut,i=e.logInAs,u=Object(o.d)((function(e){return e.session})),m=u.i18n,d=u.userName;return c.a.createElement(Nt,{id:a.NAME,date:a.DATE,checked:a.isChecked,starred:a.STARRED,toggleFav:function(e){n(a.NAME,e?"add":"delete")},checkItem:function(){l(a.NAME)},focused:a.FOCUSED,suspended:"yes"===a.SUSPENDED},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},a.NAME),c.a.createElement("div",null,a.FNAME," ",a.LNAME),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",{className:"bandwidth"},m.Bandwidth,c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},a.U_BANDWIDTH)," ",a.U_BANDWIDTH_MEASURE),c.a.createElement("div",{className:"percent",style:{width:"".concat(a.U_BANDWIDTH_PERCENT,"%")||!1}})),c.a.createElement("div",{className:"disk"},m.Disk,": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},a.U_DISK)," ",a.U_DISK_MEASURE),c.a.createElement("div",{className:"percent",style:{width:"".concat(a.U_DISK_PERCENT,"%")||!1}})),c.a.createElement("div",{className:"sub-disk-stats"},c.a.createElement("div",null,c.a.createElement("div",null,c.a.createElement("span",null,m.Web,":")," ",c.a.createElement("span",null,c.a.createElement("b",null,a.U_DISK_WEB)," ",a.U_DISK_WEB_MEASURE)),c.a.createElement("div",null,c.a.createElement("span",null,m.Mail,":")," ",c.a.createElement("span",null,c.a.createElement("b",null,a.U_DISK_MAIL)," ",a.U_DISK_MAIL_MEASURE))),c.a.createElement("div",null,c.a.createElement("div",null,c.a.createElement("span",null,m.Databases,":")," ",c.a.createElement("span",null,c.a.createElement("b",null,a.U_DATABASES)," ",a.U_DATABASES_MEASURE)),c.a.createElement("div",null,c.a.createElement("span",null,m["User Directories"],":")," ",c.a.createElement("span",null,c.a.createElement("b",null,a.U_DISK_DIRS)," ",a.U_DISK_DIRS_MEASURE))))),c.a.createElement(Ge,{className:"c-2"},c.a.createElement("div",null,c.a.createElement("span",null,m["Web Domains"],":")," ",c.a.createElement("span",null,c.a.createElement("b",null,a.U_WEB_DOMAINS)," / ",a.WEB_DOMAINS)),c.a.createElement("div",null,c.a.createElement("span",null,m["DNS Domains"],":")," ",c.a.createElement("span",null,c.a.createElement("b",null,a.U_DNS_DOMAINS)," / ",a.DNS_DOMAINS)),c.a.createElement("div",null,c.a.createElement("span",null,m["Mail Domains"],":")," ",c.a.createElement("span",null,c.a.createElement("b",null,a.U_MAIL_DOMAINS)," / ",a.MAIL_DOMAINS)),c.a.createElement("div",null,c.a.createElement("span",null,m.Databases,":")," ",c.a.createElement("span",null,c.a.createElement("b",null,a.U_DATABASES)," / ",a.DATABASES)),c.a.createElement("div",null,c.a.createElement("span",null,m["Cron Jobs"],":")," ",c.a.createElement("span",null,c.a.createElement("b",null,a.U_CRON_JOBS)," / ",a.CRON_JOBS)),c.a.createElement("div",null,c.a.createElement("span",null,m.Backups,":")," ",c.a.createElement("span",null,c.a.createElement("b",null,a.U_BACKUPS)," / ",a.BACKUPS))),c.a.createElement(Ge,{className:"c-3"},c.a.createElement("div",null,c.a.createElement("span",null,m.Email,":")," ",c.a.createElement("span",{className:"stat email"},a.CONTACT)),c.a.createElement("div",null,c.a.createElement("span",null,m.Package,":")," ",c.a.createElement("span",{className:"stat"},a.PACKAGE)),c.a.createElement("div",null,c.a.createElement("span",null,m["SSH Access"],":")," ",c.a.createElement("span",{className:"stat"},a.SHELL)),c.a.createElement("div",null,c.a.createElement("span",null,m["IP Addresses"],":")," ",c.a.createElement("span",{className:"stat"},a.IP_OWNED)),c.a.createElement("div",{className:"ns"},c.a.createElement("span",null,m["Name Servers"],":")," ",c.a.createElement("span",{className:"stat"},a.NS.split(",").map((function(e,t){return c.a.createElement("div",{key:t},e)}))))))),c.a.createElement("div",{className:"actions"},(t=a.NAME,d===t?c.a.createElement("div",null,c.a.createElement("button",{onClick:s},m["Log out"],a.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"L"):c.a.createElement(W.a,{icon:"user-lock"}))):c.a.createElement("div",null,c.a.createElement("button",{onClick:function(){return i(t)}},m["login as"]," ",t,a.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"L"):c.a.createElement(W.a,{icon:"user-lock"})))),c.a.createElement("div",null,c.a.createElement(pe.b,{to:"/edit/user?user=".concat(a.NAME)},m.edit,a.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-gray",onClick:function(){var e="yes"===a.SUSPENDED?"unsuspend":"suspend";r(a.spnd_conf,"/api/v1/".concat(e,"/user/index.php?user=").concat(a.NAME))}},a.spnd_action,a.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"S"):c.a.createElement(W.a,{icon:"yes"===a.SUSPENDED?"unlock":"lock"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){r(a.delete_conf,"/api/v1/delete/user/index.php?user=".concat(a.NAME))}},m.Delete,a.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))}),Xn=(a(283),function(e){var t=Object(o.d)((function(e){return e.session})),a=t.userName,r=t.i18n,l=Object(o.d)((function(e){return e.userSession})).session,s=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,i=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,m=Object(o.c)(),d=Object(R.g)(),E=Object(n.useState)(!1),p=Object(A.a)(E,2),v=p[0],f=p[1],b=Object(n.useState)({text:"",visible:!1,actionUrl:""}),h=Object(A.a)(b,2),g=h[0],O=h[1],N=Object(n.useState)({users:[],userFav:[],toggledAll:!1,sorting:r.Date,order:"descending",selection:[],totalAmount:""}),j=Object(A.a)(N,2),y=j[0],k=j[1];Object(n.useEffect)((function(){return m(Be("/list/user/")),m({type:"REMOVE_FOCUSED_ELEMENT",value:""}),m({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),S().then((function(){return f(!1)})),function(){m({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",x),window.addEventListener("keydown",w),window.addEventListener("keyup",_),function(){window.removeEventListener("keydown",x),window.removeEventListener("keydown",w),window.removeEventListener("keyup",_)}}),[s,i,y.users]);var _=function(e){if(!(document.querySelector("input:focus")||document.querySelector("textarea:focus"))&&65===e.keyCode)switch(d.location.pathname){case"/list/user/":return l.look?d.push("/add/web/"):d.push("/add/user/")}},S=function(){return f(!0),new Promise((function(e,t){be.a.get(Za+"/api/v1/list/user/index.php",{params:{token:He()}}).then((function(t){k(Object(u.a)(Object(u.a)({},y),{},{users:V(t.data.data),userFav:t.data.userFav,totalAmount:t.data.totalAmount,toggledAll:!1,selection:[]})),e()})).catch((function(e){return console.error(e)}))}))},w=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(s&&!t)switch(e.keyCode){case 76:return C();case 83:return M();case 8:return F();case 13:return D()}},C=function(){a===s?e.history.push("/logout"):e.history.push("/login/?loginas=".concat(s))},D=function(){e.history.push("/edit/user?user=".concat(s))},M=function(){var e=y.users.filter((function(e){return e.NAME===s}))[0],t="yes"===e.SUSPENDED?"unsuspend":"suspend";Y(e.spnd_conf,"/api/v1/".concat(t,"/user/index.php?user=").concat(s))},F=function(){var e=y.users.filter((function(e){return e.NAME===s}))[0];Y(e.delete_conf,"/api/v1/delete/user/index.php?user=".concat(s))},x=function(e){38!==e.keyCode&&40!==e.keyCode||i&&m({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),U()):40===e.keyCode&&(e.preventDefault(),L())},T=function(e){e[0].FOCUSED=e[0].NAME,k(Object(u.a)(Object(u.a)({},y),{},{users:e})),m(vt(e[0].NAME))},L=function(){var e=Object(I.a)(y.users);if(""!==s){var t=e.findIndex((function(e){return e.NAME===s}));if(t!==e.length-1){var a=e[t+1];e[t].FOCUSED="",a.FOCUSED=a.NAME,document.getElementById(a.NAME).scrollIntoView({behavior:"smooth",block:"center"}),k(Object(u.a)(Object(u.a)({},y),{},{users:e})),m(vt(a.NAME))}}else T(e)},U=function(){var e=Object(I.a)(y.users);if(""!==s){var t=e.findIndex((function(e){return e.NAME===s}));if(0!==t){var a=e[t-1];e[t].FOCUSED="",a.FOCUSED=a.NAME,document.getElementById(a.NAME).scrollIntoView({behavior:"smooth",block:"center"}),k(Object(u.a)(Object(u.a)({},y),{},{users:e})),m(vt(a.NAME))}}else T(e)},V=function(e){var t=[];for(var a in e)e[a].NAME=a,e[a].isChecked=!1,e[a].FOCUSED=s===a,t.push(e[a]);return t},B=function(){f(!0),m(_a()).then((function(){return f(!1)}))},W=function(e){f(!0),m(ka(e)).then((function(){return f(!1)}))},q=function(e){var t=y.selection,a=y.users,n=Object(I.a)(t),c=Object(I.a)(a),r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),k(Object(u.a)(Object(u.a)({},y),{},{users:c,selection:n}))},H=function(e){var t=K(y.sorting);return"descending"===y.order?e.sort((function(e,a){return e[t]<a[t]?1:a[t]<e[t]?-1:0})):e.sort((function(e,a){return e[t]>a[t]?1:a[t]>e[t]?-1:0}))},K=function(e){var t=r.Date,a=r.Username,n=r.Disk,c=r.Bandwidth,l=r.Starred;switch(e){case t:return"DATE";case a:return"NAME";case n:return"U_DISK";case c:return"U_BANDWIDTH";case l:return"STARRED"}},J=function(e,t){var a=y.userFav;"add"===t?(a[e]=1,gt(e,"user").then((function(){k(Object(u.a)(Object(u.a)({},y),{},{userFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"user").then((function(){k(Object(u.a)(Object(u.a)({},y),{},{userFav:a}))})).catch((function(e){console.error(e)})))},z=function(e){var t=Object(I.a)(y.users);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));k(Object(u.a)(Object(u.a)({},y),{},{users:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));k(Object(u.a)(Object(u.a)({},y),{},{users:c,selection:[],toggledAll:e}))}},Y=function(e,t){O(Object(u.a)(Object(u.a)({},g),{},{visible:!0,text:e,actionUrl:t}))},G=function(){m(et()).then((function(){return f(!1)}))},Q=function(){O(Object(u.a)(Object(u.a)({},g),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",null,c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(r.USER))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{name:l.look?r["Add Web Domain"]:r["Add User"],href:l.look?"/add/web/":"/add/user/",showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(kt,{toggleAll:z,toggled:y.toggledAll}),c.a.createElement(_t,{list:"usersList",bulkAction:function(e){y.selection.length&&e&&(f(!0),function(e,t){var a=new FormData;return a.append("token",He()),a.append("action",e),t.forEach((function(e){a.append("user[]",e)})),be.a.post(Za+"/api/v1/bulk/user/",a)}(e,y.selection).then((function(e){200===e.status&&(z(!1),S().then((function(){return G()})))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(ft,{changeSorting:function(e,t){k(Object(u.a)(Object(u.a)({},y),{},{sorting:e,order:t}))},sorting:y.sorting,order:y.order,list:"usersList"}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"users-wrapper"},v?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,function(){var e=Object(u.a)({},y.userFav),t=Object(I.a)(y.users);return t.forEach((function(t){t.FOCUSED=s===t.NAME,e[t.NAME]?t.STARRED=e[t.NAME]:t.STARRED=0})),H(t).map((function(e,t){return c.a.createElement(Qn,{data:e,key:t,toggleFav:J,checkItem:q,handleModal:Y,logOut:B,logInAs:W})}))}(),c.a.createElement("div",{className:"total"},y.totalAmount))),c.a.createElement(St,{onSave:function(){if(!g.actionUrl)return Q();var e;Q(),f(!0),(e=g.actionUrl,be.a.get(Za+e,{params:{token:He()}})).then((function(e){if(e.data.error)return f(!1),Y(e.data.error,"");S().then((function(){return G()}))})).catch((function(e){f(!1),console.error(e)}))},onCancel:Q,show:g.visible,text:g.text}))}),Zn=window.location.origin;function $n(e,t,a){return"/api/v1/list/rrd/image.php?/rrd/".concat(t,"/").concat(e,"-").concat(a,".png")}a(284);var ec=function(e){var t=Object(n.useState)(!0),a=Object(A.a)(t,2),r=a[0],l=a[1];Object(n.useEffect)((function(){var t=null;return r?t=setInterval(e.countDown,1e3):r||0===e.time||clearInterval(t),function(){return clearInterval(t)}}),[r,e.time]);return c.a.createElement("div",{className:"timer-wrapper"},c.a.createElement("button",{onClick:function(){l(!r)}},r?c.a.createElement(W.a,{icon:"pause"}):c.a.createElement(W.a,{icon:"play"})),c.a.createElement("div",{className:"circle-wrapper"},c.a.createElement("span",{className:"seconds"},e.time)))},tc=(a(285),function(e){var t=e.data,a=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement("div",{className:t.FOCUSED?"rrd-item focused":"rrd-item",id:t.NAME},c.a.createElement(Ge,{className:"l-col w-15"},function(e){var t=new Date(e),a=t.getDate(),n=t.getMonth(),r=t.getFullYear();return c.a.createElement("div",{className:"date"},a," \xa0 ",["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n]," \xa0 ",r)}(t.DATE)),c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},a[t.NAME]),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"w-100"},c.a.createElement("div",null,c.a.createElement("img",{src:$n(e.period,t.TYPE,t.RRD),alt:"img"}))))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement("a",{className:"link-download",href:$n(e.period,t.TYPE,t.RRD)},a.download,c.a.createElement(W.a,{icon:Re.r})))))}),ac=(a(286),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)([]),i=Object(A.a)(s,2),m=i[0],d=i[1],E=Object(n.useState)({period:"daily",periodI18N:t.Daily,time:15,loading:!1,total:0}),p=Object(A.a)(E,2),v=p[0],f=p[1];Object(n.useEffect)((function(){return l(Be("/list/rrd/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),N(),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",b),function(){window.removeEventListener("keydown",b)}}),[a,r,m]);var b=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),O()):40===e.keyCode&&(e.preventDefault(),g())},h=function(e){e[0].FOCUSED=e[0].NAME,d(e),l(vt(e[0].NAME))},g=function(){if(""!==a){var e=m.findIndex((function(e){return e.NAME===a}));if(e!==m.length-1){var t=m[e+1];m[e].FOCUSED="",t.FOCUSED=t.NAME,document.getElementById(t.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(m),l(vt(t.NAME))}}else h(m)},O=function(){if(""!==a){var e=m.findIndex((function(e){return e.NAME===a}));if(0!==e){var t=m[e-1];m[e].FOCUSED="",t.FOCUSED=t.NAME,document.getElementById(t.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(m),l(vt(t.NAME))}}else h(m)},N=function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),f(Object(u.a)(Object(u.a)({},v),{},{loading:!0})),be.a.get(Zn+"/api/v1/list/rrd/index.php").then((function(e){d(j(e.data.data)),f(Object(u.a)(Object(u.a)({},v),{},{time:15,loading:!1}))})).catch((function(e){return console.error(e)}))},j=function(e){var t=[];for(var n in e)e[n].NAME=e[n].TITLE,e[n].FOCUSED=a===n,t.push(e[n]);return t},y=function(e){return v.periodI18N===e?"period active":"period"},k=function(e){switch(e){case t.Daily:f(Object(u.a)(Object(u.a)({},v),{},{period:"daily",periodI18N:t.Daily,time:15}));break;case t.Weekly:f(Object(u.a)(Object(u.a)({},v),{},{period:"weekly",periodI18N:t.Weekly,time:15}));break;case t.Monthly:f(Object(u.a)(Object(u.a)({},v),{},{period:"monthly",periodI18N:t.Monthly,time:15}));break;case t.Yearly:f(Object(u.a)(Object(u.a)({},v),{},{period:"yearly",periodI18N:t.Yearly,time:15}))}};return c.a.createElement("div",{className:"rrd-list"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.RRD))),c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",{className:"periods-wrapper"},[t.Daily,t.Weekly,t.Monthly,t.Yearly].map((function(e){return c.a.createElement("div",{className:y(e),onClick:function(){return k(e)}},e)})),c.a.createElement(ec,{time:v.time,countDown:function(){0===v.time?N():f(Object(u.a)(Object(u.a)({},v),{},{time:v.time-1}))},data:v.rrds})),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})),c.a.createElement("div",{className:"rrd-wrapper"},v.loading?c.a.createElement(P,null):function(){var e=Object(I.a)(m);return e.forEach((function(e){e.FOCUSED=a===e.NAME})),e.map((function(e,t){return c.a.createElement(tc,{period:v.period,data:e,key:t})}))}()))}),nc=function(e){var t=e.data,a=Object(w.a)(e,["data"]),n=Object(o.d)((function(e){return e.session})).i18n;return c.a.createElement(Nt,{id:t.NAME,focused:t.FOCUSED,checked:t.isChecked,date:t.DATE,checkItem:function(){a.checkItem(t.NAME)}},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1 w-35"},c.a.createElement("div",null,c.a.createElement("b",null,t.DATE)," \xa0 ",t.TIME)),c.a.createElement(Ge,{className:"c-2 w-30"},c.a.createElement("div",null)),c.a.createElement(Ge,{className:"c-2 w-30"},c.a.createElement("div",null,c.a.createElement("b",null,t.CHAIN))),c.a.createElement(Ge,{className:"c-2 w-30"},c.a.createElement("div",null,c.a.createElement("b",null,t.NAME))))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){a.handleModal(t.delete_confirmation,"/api/v1/delete/firewall/banlist/?ip=".concat(t.NAME,"&chain=").concat(t.CHAIN))}},n.Delete,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))},cc=(a(287),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(R.g)(),r=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,l=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,s=Object(o.c)(),i=Object(n.useState)(!1),m=Object(A.a)(i,2),d=m[0],E=m[1],p=Object(n.useState)({text:"",visible:!1,actionUrl:""}),v=Object(A.a)(p,2),f=v[0],b=v[1],h=Object(n.useState)({banIps:[],selection:[],toggledAll:!1,sorting:t.Action,order:"descending",totalAmount:""}),g=Object(A.a)(h,2),O=g[0],N=g[1];Object(n.useEffect)((function(){return s(Be("/list/firewall/")),s({type:"REMOVE_FOCUSED_ELEMENT",value:""}),s({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),C().then((function(){return E(!1)})),function(){s({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",j),window.addEventListener("keydown",S),function(){window.removeEventListener("keydown",j),window.removeEventListener("keydown",S)}}),[r,l,O.banIps]);var j=function(e){38!==e.keyCode&&40!==e.keyCode||l&&s({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),_()):40===e.keyCode&&(e.preventDefault(),k())},y=function(e){e[0].FOCUSED=e[0].NAME,N(Object(u.a)(Object(u.a)({},O),{},{banIps:e})),s(vt(e[0].NAME))},k=function(){var e=Object(I.a)(O.banIps);if(""!==r.NAME){var t=e.findIndex((function(e){return e.NAME===r.NAME}));if(t!==e.length-1){var a=e[t+1];e[t].FOCUSED="",a.FOCUSED=a.NAME,document.getElementById(a.NAME).scrollIntoView({behavior:"smooth",block:"center"}),N(Object(u.a)(Object(u.a)({},O),{},{banIps:e})),s(vt(a.NAME))}}else y(e)},_=function(){var e=Object(I.a)(O.banIps);if(""!==r.NAME){var t=e.findIndex((function(e){return e.NAME===r.NAME}));if(0!==t){var a=e[t-1];e[t].FOCUSED="",a.FOCUSED=a.NAME,document.getElementById(a.NAME).scrollIntoView({behavior:"smooth",block:"center"}),N(Object(u.a)(Object(u.a)({},O),{},{banIps:e})),s(vt(a.NAME))}}else y(e)},S=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(r&&!t)switch(e.keyCode){case 8:return w()}},w=function(){var e=O.banIps.filter((function(e){return e.NAME===r.NAME}))[0];x(e.delete_conf,r.delete_url)},C=function(){return E(!0),new Promise((function(e,t){be.a.get(Wt+"/api/v1/list/firewall/banlist/index.php").then((function(t){N(Object(u.a)(Object(u.a)({},O),{},{banIps:D(t.data.data),totalAmount:t.data.total_amount,toggledAll:!1,selection:[]})),e()})).catch((function(e){return console.error(e)}))}))},D=function(e){var t=[];for(var a in e)e[a].NAME=a,e[a].FOCUSED=r.NAME===a,t.push(e[a]);return t},M=function(e){var t=O.selection,a=O.banIps,n=Object(I.a)(t),c=a,r=n.indexOf(e),l=c.findIndex((function(t){return t.NAME===e}));c[l].isChecked=!c[l].isChecked,-1!==r?n.splice(r,1):n.push(e),N(Object(u.a)(Object(u.a)({},O),{},{banIps:c,selection:n}))},F=function(e){if(e){var t=[],a=O.banIps.map((function(e){return t.push(e.NAME),e.isChecked=!0,e}));N(Object(u.a)(Object(u.a)({},O),{},{banIps:a,selection:t,toggledAll:e}))}else{var n=O.banIps.map((function(e){return e.isChecked=!1,e}));N(Object(u.a)(Object(u.a)({},O),{},{banIps:n,selection:[],toggledAll:e}))}},x=function(e,t){b(Object(u.a)(Object(u.a)({},f),{},{visible:!f.visible,text:e,actionUrl:t}))},T=function(){b(Object(u.a)(Object(u.a)({},f),{},{visible:!f.visible,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"firewalls"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.FIREWALL))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{href:"/add/firewall/banlist",name:t["Ban IP Address"],showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(kt,{toggleAll:F,toggled:O.toggledAll}),c.a.createElement(_t,{list:"banList",bulkAction:function(e){var t=O.selection;t.length&&e&&function(e,t,a){var n=new FormData;return n.append("action",e),n.append("token",He()),t.forEach((function(e){var t=a.find((function(t){return t.NAME===e}));n.append("ipchain[]","".concat(e,":").concat(t.CHAIN))})),be.a.post(Wt+"/api/v1/bulk/firewall/banlist/",n)}(e,t,O.banIps).then((function(e){200===e.status&&(F(!1),C().then((function(){return E(!1)})))})).catch((function(e){return console.error(e)}))}}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),d?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"banlist-wrapper"},function(){var e=Object(I.a)(O.banIps);return e.forEach((function(e){e.FOCUSED=r.NAME===e.NAME})),e.map((function(e,t){return c.a.createElement(nc,{data:e,key:t,checkItem:M,handleModal:x})}))}(),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("div",{className:"total"},O.totalAmount),c.a.createElement("button",{type:"button",className:"back",onClick:function(){return a.push("/list/firewall/")}},t.Back)))),c.a.createElement(St,{onSave:function(){if(!f.actionUrl)return T();T(),E(!0),Ht(f.actionUrl).then((function(e){if(e.data.error)return E(!1),x(e.data.error,"");C().then((function(){return E(!1)}))})).catch((function(e){E(!1),console.error(e)}))},onCancel:T,show:f.visible,text:f.text}))});a(288);function rc(e){var t,a,n=e.data,r=Object(o.d)((function(e){return e.session})).i18n,l=function(e,t){return"no"===t||""===t?c.a.createElement("div",{className:"crossed"},e):c.a.createElement("div",null,e,": ",c.a.createElement("span",{className:"stat"},t))};return c.a.createElement(Nt,{id:n.NAME,checked:n.isChecked,starred:n.STARRED,date:n.DATE,toggleFav:function(t){t?e.toggleFav(n.NAME,"add"):e.toggleFav(n.NAME,"delete")},checkItem:function(){e.checkItem(n.NAME)},suspended:"yes"===n.SUSPENDED,focused:n.FOCUSED},c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},c.a.createElement("div",null,n.NAME),c.a.createElement("div",null,c.a.createElement("span",{className:"dns-name-span"},n.ALIAS.replace(/,/g,", ")))),c.a.createElement("div",null,n.IP),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1 w-25"},c.a.createElement("div",{className:"bandwidth"},r.Bandwidth,c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},n.U_BANDWIDTH_SIZE),n.U_BANDWIDTH_MEASURE),c.a.createElement("div",{className:"percent",style:{width:"".concat(n.U_BANDWIDTH_PERCENT,"%")||!1}})),c.a.createElement("div",{className:"disk"},r.Disk,": ",c.a.createElement("span",null,c.a.createElement("span",{className:"stat"},n.U_DISK_SIZE),n.U_DISK_MEASURE),c.a.createElement("div",{className:"percent",style:{width:"".concat(n.U_DISK_PERCENT,"%")||!1}}))),c.a.createElement(Ge,{className:"c-2 w-45"},c.a.createElement("div",null,r["Web Template"],": ",c.a.createElement("span",{className:"stat"},n.TPL)),"no"===n.SSL?l(r["SSL Support"],""):l(r["SSL Support"],"yes"===n.LETSENCRYPT?r["Lets Encrypt"]:r[n.SSL]),l(r["Web Statistics"],n.WEB_STATS)),c.a.createElement(Ge,{className:"c-3 w-35"},void(n.PROXY_SYSTEM&&("no"===n.PROXY_SUPPORT?l(r["Proxy Support"],""):l(r["Proxy Support"],n.PROXY_SUPPORT))),n.PROXY_SYSTEM&&l(null!==(t=r["Proxy Template"])&&void 0!==t?t:"Proxy Template",n.PROXY),function(){var e,t;n.WEB_BACKEND&&("no"===n.BACKEND_SUPPORT?l(null!==(e=r["Backend Support"])&&void 0!==e?e:"Backend Support",""):l(null!==(t=r["Backend Support"])&&void 0!==t?t:"Backend Support",n.BACKEND_SUPPORT))}(),n.WEB_BACKEND&&l(null!==(a=r["Backend Template"])&&void 0!==a?a:"Backend Template",n.BACKEND),l(r["Additional FTP Account"],n.FTP)))),c.a.createElement("div",{className:"actions"},c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:"/edit/web?domain=".concat(n.NAME)},r.edit,n.FOCUSED?c.a.createElement("span",{className:"shortcut-button html-unicode"},"\u21a9"):c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-gray",to:"/list/web-log?domain=".concat(n.NAME,"&type=access")},r["view logs"],n.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"L"):c.a.createElement(W.a,{icon:"list"}))),n.STATS&&c.a.createElement("div",null,c.a.createElement("a",{className:"link-gray",href:"http://".concat(n.NAME,"/vstats/"),target:"_blank",rel:"noopener noreferrer"},r["open webstats"],n.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"L"):c.a.createElement(W.a,{icon:"list"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-gray",onClick:function(){var t="yes"===n.SUSPENDED?"unsuspend":"suspend";e.handleModal(n.spnd_confirmation,"/api/v1/".concat(t,"/web/index.php?domain=").concat(n.NAME))}},r[n.spnd_action],n.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"S"):c.a.createElement(W.a,{icon:"yes"===n.SUSPENDED?"unlock":"lock"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){e.handleModal(n.delete_confirmation,"/api/v1/delete/web/index.php?domain=".concat(n.NAME))}},r.Delete,n.FOCUSED?c.a.createElement("span",{className:"shortcut-button del"},"Del"):c.a.createElement(W.a,{icon:"times"})))))}a(289);var lc=function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.d)((function(e){return e.panel})).panel,s=Object(o.d)((function(e){return e.session})).userName,i=Object(o.c)(),m=Object(R.g)(),d=Object(n.useState)(!1),E=Object(A.a)(d,2),p=E[0],v=E[1],f=Object(n.useState)({text:"",visible:!1,actionUrl:""}),b=Object(A.a)(f,2),h=b[0],g=b[1],O=Object(n.useState)({webDomains:[],webFav:[],toggledAll:!1,sorting:t.Date,order:"descending",selection:[],totalAmount:""}),N=Object(A.a)(O,2),j=N[0],y=N[1];Object(n.useEffect)((function(){return"0"===l[s].WEB_DOMAINS?m.push("/"):(i(Be("/list/web/")),i({type:"REMOVE_FOCUSED_ELEMENT",value:""}),i({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),T().then((function(){return v(!1)})),function(){i({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})})}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",k),window.addEventListener("keydown",C),function(){window.removeEventListener("keydown",k),window.removeEventListener("keydown",C)}}),[a,r,j.webDomains]);var k=function(e){38!==e.keyCode&&40!==e.keyCode||r&&i({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),w()):40===e.keyCode&&(e.preventDefault(),S())},_=function(e){e[0].FOCUSED=e[0].NAME,y(Object(u.a)(Object(u.a)({},j),{},{webDomains:e})),i(vt(e[0].NAME))},S=function(){var e=Object(I.a)(j.webDomains);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),y(Object(u.a)(Object(u.a)({},j),{},{webDomains:e})),i(vt(n.NAME))}}else _(e)},w=function(){var e=Object(I.a)(j.webDomains);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),y(Object(u.a)(Object(u.a)({},j),{},{webDomains:e})),i(vt(n.NAME))}}else _(e)},C=function(e){var t=document.querySelector("input:focus")||document.querySelector("textarea:focus");if(a&&!t)switch(e.keyCode){case 76:return D();case 83:return F();case 8:return x();case 13:return M()}},D=function(){e.history.push("/list/web-log?domain=".concat(a,"&type=access"))},M=function(){e.history.push("/edit/web?domain=".concat(a))},F=function(){var e=j.webDomains.filter((function(e){return e.NAME===a}))[0],t="yes"===e.SUSPENDED?"unsuspend":"suspend";H(e.spnd_confirmation,"/api/v1/".concat(t,"/web/index.php?domain=").concat(a))},x=function(){var e=j.webDomains.filter((function(e){return e.NAME===a}))[0];H(e.delete_confirmation,"/api/v1/web/index.php?domain=".concat(a))},T=function(){return v(!0),new Promise((function(e,t){be.a.get(At+"/api/v1/list/web/index.php").then((function(t){y(Object(u.a)(Object(u.a)({},j),{},{webDomains:L(t.data.data),webFav:t.data.webFav,totalAmount:t.data.totalAmount,toggledAll:!1,selection:[]})),e()})).catch((function(e){return console.error(e)}))}))},L=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].FOCUSED=a===n,t.push(e[n]);return t},U=function(e){var t=Object(I.a)(j.selection),a=j.webDomains,n=t.indexOf(e),c=a.findIndex((function(t){return t.NAME===e}));a[c].isChecked=!a[c].isChecked,-1!==n?t.splice(n,1):t.push(e),y(Object(u.a)(Object(u.a)({},j),{},{webDomains:a,selection:t}))},V=function(e){var t=B(j.sorting);return"descending"===j.order?e.sort((function(e,a){return e[t]<a[t]?1:a[t]<e[t]?-1:0})):e.sort((function(e,a){return e[t]>a[t]?1:a[t]>e[t]?-1:0}))},B=function(e){var a=t.Date,n=t.Domain,c=t.Disk,r=t.Bandwidth,l=t.Starred;switch(e){case a:return"DATE";case n:return"ALIAS";case t["IP Addresses"]:return"IP";case c:return"U_DISK";case r:return"U_BANDWIDTH";case l:return"STARRED"}},W=function(e,t){var a=j.webFav;"add"===t?(a[e]=1,gt(e,"web").then((function(){y(Object(u.a)(Object(u.a)({},j),{},{webFav:a}))})).catch((function(e){console.error(e)}))):(a[e]=void 0,Ot(e,"web").then((function(){y(Object(u.a)(Object(u.a)({},j),{},{webFav:a}))})).catch((function(e){console.error(e)})))},q=function(e){var t=Object(I.a)(j.webDomains);if(e){var a=[],n=t.map((function(e){return a.push(e.NAME),e.isChecked=!0,e}));y(Object(u.a)(Object(u.a)({},j),{},{webDomains:n,selection:a,toggledAll:e}))}else{var c=t.map((function(e){return e.isChecked=!1,e}));y(Object(u.a)(Object(u.a)({},j),{},{webDomains:c,selection:[],toggledAll:e}))}},H=function(e,t){g(Object(u.a)(Object(u.a)({},h),{},{visible:!0,text:e,actionUrl:t}))},K=function(){i(et()).then((function(){return v(!1)}))},J=function(){g(Object(u.a)(Object(u.a)({},h),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"web"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.WEB))),c.a.createElement(Xe,{mobile:!1},c.a.createElement(yt,{name:t["Add Web Domain"],href:"/add/web/",showLeftMenu:!0}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(kt,{toggleAll:q,toggled:j.toggledAll}),c.a.createElement(_t,{list:"webList",bulkAction:function(e){j.selection.length&&e&&(v(!0),function(e,t){var a=new FormData;return a.append("action",e),a.append("token",He()),t.forEach((function(e){a.append("domain[]",e)})),be.a.post(At+"/api/v1/bulk/web/",a)}(e,j.selection).then((function(e){q(!1),T().then((function(){return K()}))})).catch((function(e){return console.error(e)})))}}),c.a.createElement(ft,{changeSorting:function(e,t){y(Object(u.a)(Object(u.a)({},j),{},{sorting:e,order:t}))},sorting:j.sorting,order:j.order,list:"webList"}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"web-domains-wrapper"},p?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,function(){var e=Object(u.a)({},j.webFav),t=Object(I.a)(j.webDomains);return t.forEach((function(t){t.FOCUSED=a===t.NAME,e[t.NAME]?t.STARRED=e[t.NAME]:t.STARRED=0})),V(t).map((function(e,t){return c.a.createElement(rc,{data:e,key:t,toggleFav:W,checkItem:U,handleModal:H})}))}(),c.a.createElement("div",{className:"total"},j.totalAmount))),c.a.createElement(St,{onSave:function(){if(!h.actionUrl)return J();var e;J(),v(!0),(e=h.actionUrl,be.a.get(At+e,{params:{token:He()}})).then((function(e){if(e.data.error)return v(!1),H(e.data.error,"");T().then((function(){return K()}))})).catch((function(e){v(!1),console.error(e)}))},onCancel:J,show:h.visible,text:h.text}))},oc=window.location.origin,sc=(a(290),function(e){var t=e.data,a=e.handleModal,n=Object(o.d)((function(e){return e.session})),r=n.i18n,l=n.userName,s=Object(o.c)(),i=Object(R.g)(),u=function(){s(_a()).then((function(){return i.push("/")}))};return c.a.createElement(Nt,{date:t.DATE,suspended:"yes"===t.SUSPENDED},c.a.createElement(Ge,{className:"search-list r-col w-85"},c.a.createElement("div",{className:"name"},t.RESULT),c.a.createElement("div",{className:"stats"},c.a.createElement(Ge,{className:"c-1"},c.a.createElement("div",{className:"object"},"user"===t.TYPE?r.USER:r[t.object])),c.a.createElement(Ge,{className:"c-2"},c.a.createElement("div",{className:"owner"},r.Owner,": ",c.a.createElement("span",null,t.USER))),c.a.createElement(Ge,{className:"c-3"},c.a.createElement("div",{className:"status"},r.Status,": ",c.a.createElement("span",null,t.status))))),c.a.createElement("div",{className:"actions"},function(){if("user"===t.TYPE)return l===t.USER?c.a.createElement("div",null,c.a.createElement("button",{onClick:u},r["Log out"],t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"L"):c.a.createElement(W.a,{icon:"user-lock"}))):c.a.createElement("div",null,c.a.createElement("button",{onClick:function(){return e=t.USER,void s(ka(e)).then((function(){return i.push("/")}));var e}},r["login as"]," ",t.USER,t.FOCUSED?c.a.createElement("span",{className:"shortcut-button"},"L"):c.a.createElement(W.a,{icon:"user-lock"})))}(),c.a.createElement("div",null,c.a.createElement(pe.b,{className:"link-edit",to:t.edit_link},r.edit," ",c.a.createElement(W.a,{icon:"pen"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-gray",onClick:function(){a(t.spnd_confirmation,"/api/v1/".concat("user"===t.TYPE?"".concat(t.spnd_action,"/user/index.php?user=").concat(t.USER):t.spnd_link))}},t.spnd_action,c.a.createElement(W.a,{icon:"yes"===t.SUSPENDED?"unlock":"lock"}))),c.a.createElement("div",null,c.a.createElement("button",{className:"link-delete",onClick:function(){a(t.delete_confirmation,"/api/v1/".concat("user"===t.TYPE?"/api/v1/delete/user/index.php?user=".concat(t.USER):t.delete_link))}},r.Delete,c.a.createElement(W.a,{icon:"times"})))))}),ic=(a(291),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(R.g)(),r=Object(o.c)(),l=Object(n.useState)(!1),s=Object(A.a)(l,2),i=s[0],m=s[1],d=Object(n.useState)({searchResults:[],totalAmount:"",sorting:t.Date,order:"descending",total:0}),E=Object(A.a)(d,2),p=E[0],v=E[1],f=Object(n.useState)({visible:!1,text:"",actionUrl:""}),b=Object(A.a)(f,2),h=b[0],g=b[1];Object(n.useEffect)((function(){var t=a.location.search;if(t){var n=t.split("=")[1];if(""===n)return a.push({pathname:"/list/user/",search:""});O(n).then((function(){return m(!1)}))}else{if(""===e.searchTerm)return a.push({pathname:"/list/user/",search:""});O(e.searchTerm).then((function(){return m(!1)}))}}),[]);var O=function(e){return m(!0),new Promise((function(t,a){var n;(n=e,be.a.get(oc+"/api/v1/search/?q="+n)).then((function(e){v(Object(u.a)(Object(u.a)({},p),{},{searchResults:e.data.data,totalAmount:e.data.total})),t()})).catch((function(e){return console.error(e)}))}))},N=function(e){var t=p.order,a=p.sorting,n=j(a);return"descending"===t?e.sort((function(e,t){return e[n]<t[n]?1:t[n]<e[n]?-1:0})):e.sort((function(e,t){return e[n]>t[n]?1:t[n]>e[n]?-1:0}))},j=function(e){var a=t.Date,n=t.Name;t.Starred;switch(e){case a:return"DATE";case n:return"RESULT"}},y=function(e,t){g(Object(u.a)(Object(u.a)({},h),{},{visible:!h.visible,text:e,actionUrl:t}))},k=function(){r(et()).then((function(){return m(!1)}))},_=function(){g(Object(u.a)(Object(u.a)({},h),{},{visible:!1,text:"",actionUrl:""}))};return c.a.createElement("div",{className:"logs-list"},c.a.createElement(Xe,{mobile:!1},c.a.createElement("div",{className:"search-toolbar-name"},t["Search Results"]),c.a.createElement("div",{className:"search-toolbar-right"},c.a.createElement(ft,{changeSorting:function(e,t){v(Object(u.a)(Object(u.a)({},p),{},{sorting:e,order:t}))},sorting:p.sorting,order:p.order,list:"searchList"}),c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}}))),c.a.createElement("div",{className:"statistics-wrapper"},i?c.a.createElement(P,null):c.a.createElement(c.a.Fragment,null,function(){var e=p.searchResults,t=[];for(var a in e)t.push(e[a]);return N(t).map((function(e,t){return c.a.createElement(sc,{data:e,key:t,handleModal:y})}))}(),c.a.createElement("div",{className:"total"},p.totalAmount))),c.a.createElement(St,{onSave:function(){if(!h.actionUrl)return _();var e;_(),m(!0),(e=h.actionUrl,be.a.get(oc+e,{params:{token:He()}})).then((function(e){if(e.data.error)return m(!1),y(e.data.error,"");O().then((function(){return k()}))})).catch((function(e){m(!1),console.error(e)}))},onCancel:_,show:h.visible,text:h.text}))}),uc=window.location.origin,mc=(a(292),function(e){var t=e.data;return c.a.createElement("div",{className:t.FOCUSED?"statistic-item focused":"statistic-item",id:t.NAME},c.a.createElement(Ge,{className:"l-col w-15"},function(e){var t=new Date(e),a=t.getDate(),n=t.getMonth(),r=t.getFullYear();return c.a.createElement("div",{className:"date"},a," \xa0 ",["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n]," \xa0 ",r)}(t.DATE),t.TIME),c.a.createElement(Ge,{className:"r-col w-85"},c.a.createElement("div",{className:"name"},t.CMD)))}),dc=(a(293),function(e){var t=Object(o.d)((function(e){return e.session})).i18n,a=Object(o.d)((function(e){return e.controlPanelContent})).controlPanelFocusedElement,r=Object(o.d)((function(e){return e.mainNavigation})).focusedElement,l=Object(o.c)(),s=Object(n.useState)({logs:[],totalAmount:"",loading:!1,total:0}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){return l(Be("/list/log/")),l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""}),b(),function(){l({type:"REMOVE_CPANEL_FOCUSED_ELEMENT",value:""})}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keydown",E),function(){window.removeEventListener("keydown",E)}}),[a,r,m.logs]);var E=function(e){38!==e.keyCode&&40!==e.keyCode||r&&l({type:"REMOVE_FOCUSED_ELEMENT",value:""}),38===e.keyCode?(e.preventDefault(),f()):40===e.keyCode&&(e.preventDefault(),v())},p=function(e){e[0].FOCUSED=e[0].NAME,d(Object(u.a)(Object(u.a)({},m),{},{logs:e})),l(vt(e[0].NAME))},v=function(){var e=Object(I.a)(m.logs);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(t!==e.length-1){var n=e[t+1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(Object(u.a)(Object(u.a)({},m),{},{logs:e})),l(vt(n.NAME))}}else p(e)},f=function(){var e=Object(I.a)(m.logs);if(""!==a){var t=e.findIndex((function(e){return e.NAME===a}));if(0!==t){var n=e[t-1];e[t].FOCUSED="",n.FOCUSED=n.NAME,document.getElementById(n.NAME).scrollIntoView({behavior:"smooth",block:"center"}),d(Object(u.a)(Object(u.a)({},m),{},{logs:e})),l(vt(n.NAME))}}else p(e)},b=function(){d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),be.a.get(uc+"/api/v1/list/log/index.php").then((function(e){d({logs:h(e.data.data),totalAmount:e.data.totalAmount,loading:!1})})).catch((function(e){return console.error(e)}))},h=function(e){var t=[];for(var n in e)e[n].NAME=n,e[n].FOCUSED=a===n,t.push(e[n]);return t};return c.a.createElement("div",{className:"logs-list"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.LOG))),c.a.createElement(Xe,{mobile:!1,className:"justify-right"},c.a.createElement(yt,{name:"Add Cron Job",showLeftMenu:!1}),c.a.createElement("div",{className:"r-menu"},c.a.createElement("div",{className:"input-group input-group-sm"},c.a.createElement(bt,{handleSearchTerm:function(t){return e.changeSearchTerm(t)}})))),c.a.createElement("div",{className:"logs-wrapper"},m.loading?c.a.createElement(P,null):function(){var e=Object(I.a)(m.logs);return e.forEach((function(e){e.FOCUSED=a===e.NAME})),e.map((function(e,t){return c.a.createElement(mc,{data:e,key:t})}))}()),c.a.createElement("div",{className:"total"},m.totalAmount))}),Ec=(a(294),function(e){var t=Object(o.d)((function(e){return e.session})).userName,a=Object(R.g)(),r=Object(n.useState)(""),l=Object(A.a)(r,2),s=l[0],i=l[1],u=Object(n.useState)(null),m=Object(A.a)(u,2),d=m[0],E=m[1],p=Object(n.useState)(!0),v=Object(A.a)(p,2),f=v[0],b=v[1],h=Object(o.c)();Object(n.useEffect)((function(){if(!t)return a.push("/login");b(!1)}),[t]),Object(n.useEffect)((function(){return h({type:"REMOVE_FOCUSED_ELEMENT",value:""}),window.addEventListener("keyup",g),window.addEventListener("keyup",O),function(){window.removeEventListener("keyup",g),window.removeEventListener("keyup",O)}}),[]);var g=function(e){if(!(document.querySelector("input:focus")||document.querySelector("textarea:focus")))switch(e.keyCode){case 49:return a.push("/list/user/");case 50:return a.push("/list/web/");case 51:return a.push("/list/dns/");case 52:return a.push("/list/mail/");case 53:return a.push("/list/db/");case 54:return a.push("/list/cron/");case 55:return a.push("/list/backup/")}},O=function(e){if(!(document.querySelector("input:focus")||document.querySelector("textarea:focus"))&&65===e.keyCode)switch(a.location.pathname){case"/list/web/":return a.push("/add/web/");case"/list/dns/":return a.push("/add/dns/");case"/list/mail/":return a.push("/add/mail/");case"/list/db/":return a.push("/add/db/");case"/list/cron/":return a.push("/add/cron/");case"/list/backup/exclusions":return a.push("/edit/backup/exclusions/");case"/list/package/":return a.push("/add/package/");case"/list/ip/":return a.push("/add/ip/");case"/list/firewall/":return a.push("/add/firewall/")}},N=function(e){i(e),a.push({pathname:"/search/",search:"?q=".concat(e)})};return c.a.createElement("div",null,c.a.createElement(Tn,null),c.a.createElement("div",{className:"content"},f?c.a.createElement(P,null):c.a.createElement(R.d,null,c.a.createElement(R.a,{from:"/",exact:!0,to:"/list/user/"}),c.a.createElement(R.b,{path:"/list/package",component:function(e){return c.a.createElement(bn,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/add/package",component:function(){return c.a.createElement(Ea,null)}}),c.a.createElement(R.b,{path:"/edit/package",component:function(){return c.a.createElement(ua,null)}}),c.a.createElement(R.b,{path:"/list/ip",component:function(e){return c.a.createElement(wt,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/add/ip",component:function(){return c.a.createElement(ct,null)}}),c.a.createElement(R.b,{path:"/edit/ip",component:function(){return c.a.createElement(nt,null)}}),c.a.createElement(R.b,{path:"/list/rrd",component:function(e){return c.a.createElement(ac,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/list/stats",component:function(e){return c.a.createElement(Gn,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/list/log",component:function(e){return c.a.createElement(dc,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/list/updates",component:function(e){return c.a.createElement(jn,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/list/firewall",exact:!0,component:function(e){return c.a.createElement(Xa,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/list/firewall/banlist",exact:!0,component:function(e){return c.a.createElement(cc,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/add/firewall/banlist",component:En}),c.a.createElement(R.b,{path:"/add/firewall",component:function(){return c.a.createElement(Yt,null)}}),c.a.createElement(R.b,{path:"/edit/firewall",component:function(){return c.a.createElement(Kt,null)}}),c.a.createElement(R.b,{path:"/list/server/",exact:!0,component:function(e){return c.a.createElement(_n,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/edit/server/",exact:!0,component:function(){return c.a.createElement(Sa,null)}}),c.a.createElement(R.b,{path:"/edit/server/nginx",exact:!0,component:function(){return c.a.createElement(mt,null)}}),c.a.createElement(R.b,{path:"/edit/server/php",exact:!0,component:function(){return c.a.createElement(za,{serviceName:"php"})}}),c.a.createElement(R.b,{path:"/edit/server/php-fpm",exact:!0,component:function(){return c.a.createElement(za,{serviceName:"php-fpm"})}}),c.a.createElement(R.b,{path:"/edit/server/php5-fpm",exact:!0,component:function(){return c.a.createElement(za,{serviceName:"php5-fpm"})}}),c.a.createElement(R.b,{path:"/edit/server/httpd",exact:!0,component:function(){return c.a.createElement(ma,null)}}),c.a.createElement(R.b,{path:"/edit/server/dovecot",exact:!0,component:function(){return c.a.createElement(wa,null)}}),c.a.createElement(R.b,{path:"/edit/server/bind9",exact:!0,component:function(){return c.a.createElement(en,null)}}),c.a.createElement(R.b,{path:"/edit/server/postgresql",exact:!0,component:function(){return c.a.createElement(dt,null)}}),c.a.createElement(R.b,{path:"/edit/server/mysql",exact:!0,component:function(){return c.a.createElement(tn,{serviceName:"mysql"})}}),c.a.createElement(R.b,{path:"/edit/server/mariadb",exact:!0,component:function(){return c.a.createElement(tn,{serviceName:"mariadb"})}}),c.a.createElement(R.b,{path:"/edit/server/mysqld",exact:!0,component:function(){return c.a.createElement(tn,{serviceName:"mysqld"})}}),!!ut.length&&ut.map((function(e,t){return"iptables"===e?c.a.createElement(R.a,{key:t,from:"/edit/server/iptables",exact:!0,to:"/list/firewall"}):c.a.createElement(R.b,{key:t,path:"/edit/server/".concat(e),exact:!0,component:function(){return c.a.createElement(La,{serviceName:e})}})})),c.a.createElement(R.b,{path:"/list/user",component:function(e){return c.a.createElement(Xn,Object.assign({changeSearchTerm:N},e))}}),c.a.createElement(R.b,{path:"/add/user",component:function(){return c.a.createElement(gn,null)}}),c.a.createElement(R.b,{path:"/edit/user",component:function(){return c.a.createElement($a,null)}}),c.a.createElement(R.b,{path:"/list/web",component:function(e){return c.a.createElement(lc,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/add/web",component:function(){return c.a.createElement(It,null)}}),c.a.createElement(R.b,{path:"/edit/web",component:function(){return c.a.createElement(Ja,null)}}),c.a.createElement(R.b,{path:"/list/dns",component:function(e){return c.a.createElement(Jn,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/add/dns",component:function(){return c.a.createElement(ln,null)}}),c.a.createElement(R.b,{path:"/edit/dns",component:function(){return c.a.createElement(Ha,null)}}),c.a.createElement(R.b,{path:"/list/mail",component:function(e){return c.a.createElement(Bn,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/add/mail",component:function(){return c.a.createElement(Pa,null)}}),c.a.createElement(R.b,{path:"/edit/mail",component:function(){return c.a.createElement(Ta,null)}}),c.a.createElement(R.b,{path:"/list/db",component:function(e){return c.a.createElement(Ga,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/add/db",component:function(){return c.a.createElement(zt,null)}}),c.a.createElement(R.b,{path:"/edit/db",component:function(){return c.a.createElement(Bt,null)}}),c.a.createElement(R.b,{path:"/list/cron",component:function(e){return c.a.createElement(vn,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{path:"/add/cron",component:function(){return c.a.createElement(da,null)}}),c.a.createElement(R.b,{path:"/edit/cron",component:function(){return c.a.createElement(ra,null)}}),c.a.createElement(R.b,{exact:!0,path:"/list/backup",component:function(e){return c.a.createElement(dn,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{exact:!0,path:"/list/backup/exclusions",component:function(e){return c.a.createElement(Un,Object.assign({},e,{changeSearchTerm:N}))}}),c.a.createElement(R.b,{exact:!0,path:"/edit/backup/exclusions",component:pt}),c.a.createElement(R.b,{path:"/search/",component:function(e){return c.a.createElement(ic,Object.assign({},e,{changeSearchTerm:N,searchTerm:s}))}}))),c.a.createElement("div",{className:"fixed-buttons"},c.a.createElement("div",{className:"hotkey-button"},c.a.createElement("button",{onClick:function(){return d.classList.toggle("hide")}},c.a.createElement(W.a,{icon:"ellipsis-h"}))),c.a.createElement("div",{className:"scroll-to-top"},c.a.createElement("button",{onClick:function(){window.scrollTo({top:0,behavior:"smooth"})}},c.a.createElement(W.a,{icon:"long-arrow-alt-up"})))),c.a.createElement(Jt,{reference:function(e){return E(e)},toggleHotkeys:function(){return d.classList.toggle("hide")}}))}),pc=a(95),vc=a.n(pc),fc=(a(297),function(e){var t=e.menuItems,a=void 0===t?[]:t,r=e.extraMenuItems,l=void 0===r?[]:r,s=Object(o.d)((function(e){return e.mainNavigation})),i=Object(n.useState)(!1),u=Object(A.a)(i,2),m=u[0],d=u[1],E=Object(o.d)((function(e){return e.session})),p=E.i18n,v=E.userName,f=Object(o.c)(),b=Object(R.g)(),h=function(e){var t="nav-link";return s.activeElement===e?t+" active":t},g=function(e,t){e.preventDefault(),b.push(t),f(Be(t))};return c.a.createElement("div",{className:"panel-wrapper"},m&&c.a.createElement(P,null),c.a.createElement("div",{className:"top-panel"},c.a.createElement("div",{className:"container left-menu"},c.a.createElement("div",{className:"logo"},c.a.createElement(pe.b,{to:"/list/user/"},c.a.createElement("div",{className:"logo-img"},c.a.createElement("img",{src:"/images/white_logo.png",alt:"Logo"})))),c.a.createElement(vc.a,null,function(){if(a.length)return a.map((function(e){var t=e.route,a=e.name;return c.a.createElement("div",{className:h(t),key:a},c.a.createElement("button",{onClick:function(e){return g(e,t)}},a))}))}(),function(){if(l.length)return l.map((function(e,t){var a=e.link,n=e.text,r=e.type;return c.a.createElement("div",{className:"nav-link",key:t},"download"===r?c.a.createElement("a",{href:"/api/v1".concat(a),target:"_blank",rel:"noopener noreferrer"},n):c.a.createElement(pe.b,{to:a,target:"_blank"},n))}))}())),c.a.createElement("div",{className:"container profile-menu"},c.a.createElement("div",null,c.a.createElement(pe.b,{to:"/edit/user?user=".concat(v)},v)),c.a.createElement("div",null,c.a.createElement("button",{className:"log-out",onClick:function(){d(!0),f(_a()).then((function(){b.push("/login/"),d(!1)}),(function(e){d(!1),console.error(e)}))}},p["Log out"])))))}),bc=(a(298),window.location.origin);function hc(){var e=Object(o.d)((function(e){return e.session})),t=e.i18n,a=e.userName,r=Object(R.g)(),l=Object(o.c)(),s=Object(o.d)((function(e){return e.mainNavigation})),i=Object(n.useState)(),m=Object(A.a)(i,2),d=m[0],E=m[1],p=Object(n.useState)({data:"",prefix:"",loading:!1}),v=Object(A.a)(p,2),f=v[0],b=v[1];Object(n.useEffect)((function(){a||r.push("/login/")}),[]),Object(n.useEffect)((function(){var e=ge.a.parse(r.location.search,{ignoreQueryPrefix:!0}),t=e.domain,a=e.type;if(!e&&!t&&!a)return r.goBack();E(t);var n="/list/web-log/?domain=".concat(t,"&type=").concat(a);h(n),l(Be("/list/web-log/?domain=".concat(t,"&type=").concat(a)))}),[s.activeElement]);var h=function(e){b(Object(u.a)(Object(u.a)({},f),{},{loading:!0})),function(e){return be.a.get(bc+"/api/v1"+e)}(e).then((function(e){e.data&&b(Object(u.a)(Object(u.a)({},f),{},{data:e.data.data,prefix:e.data.prefix,loading:!1}))})).catch((function(e){console.error(e),b(Object(u.a)(Object(u.a)({},f),{},{loading:!1}))}))},g=[{route:"/list/web-log/?domain=".concat(d,"&type=access"),name:t.AccessLog},{route:"/list/web-log/?domain=".concat(d,"&type=error"),name:t.ErrorLog}],O=[{link:"/download/web-log/?domain=".concat(null!==d&&void 0!==d?d:"","&type=access"),type:"download",text:t["Download AccessLog"]},{link:"/download/web-log/?domain=".concat(null!==d&&void 0!==d?d:"","&type=error"),type:"download",text:t["Download ErrorLog"]}];return c.a.createElement("div",{className:"web-logs"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.WEB))),c.a.createElement(fc,{menuItems:g,extraMenuItems:O}),c.a.createElement("div",{className:"content"},c.a.createElement("h6",null,c.a.createElement("b",null,f.prefix)),c.a.createElement("br",null),f.loading?c.a.createElement(P,null):c.a.createElement("pre",null,at()(f.data))))}a(299);var gc=function(e){var t=e.children;return c.a.createElement("div",{className:"login-layout"},t)};a(300);function Oc(){var e,t,a,r,l,s=Object(o.d)((function(e){return e.session})).i18n,i=Object(o.c)(),m=Object(R.g)(),d=Object(n.useState)(!1),E=Object(A.a)(d,2),p=E[0],v=E[1],f=Object(n.useState)({user:"",password:""}),b=Object(A.a)(f,2),h=b[0],g=b[1],O=Object(o.d)((function(e){return e.session})),N=Object(n.useState)(""),j=Object(A.a)(N,2),y=j[0],k=j[1];Object(n.useEffect)((function(){O.error?k(O.error):O.token&&O.userName&&m.push("/list/user/")}),[O]);var _=function(e){var t=e.target,a=t.value,n=t.name;g(Object(u.a)(Object(u.a)({},h),{},Object(M.a)({},n,a)))};return c.a.createElement("div",{className:"login-page"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(null!==(e=s.LOGIN)&&void 0!==e?e:"LOGIN"))),p&&c.a.createElement(P,null),c.a.createElement("div",{className:"login-form-wrapper"},c.a.createElement(gc,null,c.a.createElement("form",{onSubmit:function(e){e.preventDefault();var t=h.user,a=h.password;v(!0),i(ya(t,a)).then((function(e){v(!1)}))}},c.a.createElement("div",{className:"c1"},c.a.createElement(pe.b,{to:"/"},c.a.createElement("img",{src:"/images/logo.png",alt:"Logo"}))),c.a.createElement("div",{className:"c2"},c.a.createElement(ze,{onChange:_,title:null!==(t=s.Username)&&void 0!==t?t:"Username",value:h.user,name:"user",id:"user"}),c.a.createElement(ze,{onChange:_,title:null!==(a=s.Password)&&void 0!==a?a:"Password",value:h.password,optionalTitle:c.a.createElement(pe.b,{className:"forgot-password",tabIndex:"-1",to:"/reset"},null!==(r=s["forgot password"])&&void 0!==r?r:"forgot password"),name:"password",type:"password",id:"password"}),c.a.createElement("button",{type:"submit",disabled:p,className:p?"disabled":""},null!==(l=s["Log in"])&&void 0!==l?l:"Log in"),c.a.createElement("div",{className:"error-message"},y))),c.a.createElement("span",null,c.a.createElement("a",{href:"http://vestacp.com/"},"vestacp.com")))))}a(301);var Nc=function(){var e=Object(o.d)((function(e){return e.session})),t=e.i18n,a=e.userName,r=Object(o.c)(),l=Object(R.g)(),s=Object(n.useState)({data:"",loading:!1}),i=Object(A.a)(s,2),m=i[0],d=i[1];Object(n.useEffect)((function(){a||l.push("/login/")}),[a]),Object(n.useEffect)((function(){var e=ge.a.parse(l.location.search,{ignoreQueryPrefix:!0});return e.srv?p.find((function(t){return t.service===e.srv}))?(E(e.srv),void r(Be("/list/server/service/?srv=".concat(e.srv)))):(r(Be("/list/server/service/?srv=cpu")),void l.push("/list/server/service/?srv=cpu")):(E("cpu"),void r(Be("/list/server/service/?srv=cpu")))}),[l.location.search]);var E=function(e){var t;d(Object(u.a)(Object(u.a)({},m),{},{loading:!0})),(t=e,be.a.get("".concat(lt).concat("/api/v1/list/server/index.php","?").concat(t))).then((function(e){d(Object(u.a)(Object(u.a)({},m),{},{data:e.data.service_log,loading:!1}))})).catch((function(e){console.error(e),d(Object(u.a)(Object(u.a)({},m),{},{loading:!1}))}))},p=[{route:"/list/server/service/?srv=cpu",service:"cpu",name:t.CPU},{route:"/list/server/service/?srv=mem",service:"mem",name:t.MEMORY},{route:"/list/server/service/?srv=disk",service:"disk",name:t.DISK},{route:"/list/server/service/?srv=net",service:"net",name:t.NETWORK},{route:"/list/server/service/?srv=web",service:"web",name:t.WEB},{route:"/list/server/service/?srv=dns",service:"dns",name:t.DNS},{route:"/list/server/service/?srv=mail",service:"mail",name:t.MAIL},{route:"/list/server/service/?srv=db",service:"db",name:t.DB}];return c.a.createElement("div",{className:"service-info"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(t.SERVER))),c.a.createElement(fc,{menuItems:p}),c.a.createElement("div",{className:"content"},m.loading?c.a.createElement(P,null):c.a.createElement("pre",null,m.data&&at()(m.data))))};function jc(){var e=Object(o.d)((function(e){return e.session})).i18n,t=Object(o.c)(),a=Object(R.g)(),r=Object(n.useState)(!1),l=Object(A.a)(r,2),s=l[0],i=l[1],m=Object(n.useState)({action:"",user:"",code:""}),d=Object(A.a)(m,2),E=d[0],p=d[1],v=Object(o.d)((function(e){return e.session})),f=Object(R.h)(),b=Object(n.useState)(""),h=Object(A.a)(b,2),g=h[0],O=h[1];Object(n.useEffect)((function(){var e=ge.a.parse(f.search,{ignoreQueryPrefix:!0});p(Object(u.a)(Object(u.a)({},E),{},{action:e.action||"",user:e.user||"",code:e.code||""}))}),[]),Object(n.useEffect)((function(){v.error?O(v.error):v.token&&v.userName&&a.push("/list/user/")}),[v]);var N=function(e){var t=e.target,a=t.value,n=t.name;p(Object(u.a)(Object(u.a)({},E),{},Object(M.a)({},n,a)))},j=function(){E.user&&(i(!0),ja(E.user).then((function(e){O(e.data.error||""),p(Object(u.a)(Object(u.a)({},E),{},{action:"code"})),i(!1)})).catch((function(e){console.error(e),i(!1)})))},y=function(){p(Object(u.a)(Object(u.a)({},E),{},{action:"confirm"}))};return c.a.createElement("div",{className:"login-page"},c.a.createElement(Ae.a,null,c.a.createElement("title",null,"Vesta - ".concat(e["RESET PASSWORD"]))),s&&c.a.createElement(P,null),c.a.createElement("div",{className:"login-form-wrapper"},c.a.createElement(gc,null,c.a.createElement("form",{onSubmit:function(e){if(e.preventDefault(),E.code||E.user)if(E.action||!E.user)if("code"===E.action&&E.user&&E.code)y();else{i(!0);var n,c={user:E.user,code:E.code},r=Object(We.a)(new FormData(e.target).entries());try{for(r.s();!(n=r.n()).done;){var l=Object(A.a)(n.value,2),o=l[0],s=l[1];c[o]=s}}catch(u){r.e(u)}finally{r.f()}t(function(e){var t=e.user,a=void 0===t?"":t,n=e.code,c=void 0===n?"":n,r=e.password,l=void 0===r?"":r,o=e.password_confirm,s=void 0===o?"":o;return function(e){return new Promise((function(t,n){ja(a,c,l,s).then((function(a){var n=a.data,c=n.error,r=n.session,l=n.token,o=n.panel,s=n.user;e({type:"RESET_PASSWORD",value:{token:l,userName:s,error:c}}),e({type:"REFRESH_PANEL",value:{panel:o}}),e({type:"REFRESH_COUNTERS",value:{user:{}}}),e({type:"SET_USER_SESSION",value:r}),t(l)}),(function(e){n(e)}))}))}}(c)).then((function(e){e.error?O(e.error):(a.push("/login"),O("")),i(!1)}))}else j()}},c.a.createElement("div",{className:"c1"},c.a.createElement(pe.b,{to:"/"},c.a.createElement("img",{src:"/images/logo.png",alt:"Logo"}))),c.a.createElement("div",{className:"c2"},!E.action&&c.a.createElement(c.a.Fragment,null,c.a.createElement(ze,{onChange:N,title:e.Username,value:E.user,name:"user",id:"user"}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{className:"add",type:"button",onClick:j},e.Submit),c.a.createElement("button",{className:"back",type:"button",onClick:function(){return a.push("/login")}},e.Back))),"code"===E.action&&c.a.createElement(c.a.Fragment,null,c.a.createElement("span",null,at()(e.RESET_CODE_SENT)),c.a.createElement("br",null),c.a.createElement(ze,{onChange:N,title:e["Reset Code"],value:E.code,name:"code",id:"code"}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{className:"add",type:"button",onClick:y},e.Confirm),c.a.createElement("button",{className:"back",type:"button",onClick:function(){return p(Object(u.a)(Object(u.a)({},E),{},{action:"",code:"",user:""}))}},e.Back))),"confirm"===E.action&&c.a.createElement(c.a.Fragment,null,c.a.createElement(Mt,{name:"password",title:e["New Password"],showGenerationButton:!1,tabIndex:1}),c.a.createElement(Mt,{name:"password_confirm",title:e["Confirm Password"],showGenerationButton:!1,tabIndex:2}),c.a.createElement("div",{className:"buttons-wrapper"},c.a.createElement("button",{className:"add",type:"submit",style:{height:"31px"}},e.Reset),c.a.createElement("button",{className:"back",type:"button",onClick:function(){return p(Object(u.a)(Object(u.a)({},E),{},{action:"code",code:"",user:E.user}))}},e.Back))),c.a.createElement("div",{className:"error-message"},g))),c.a.createElement("span",null,c.a.createElement("a",{href:"http://vestacp.com/"},"vestacp.com")))))}Pe.b.add(Re.e,Re.l,Re.p,Re.q,Re.t,Re.u,Re.m,Re.s,Re.w,Re.M,Re.k,Re.B,Re.K,Re.f,Re.b,Re.c,Re.d,Re.F,Re.a,Re.H,Re.N,Re.D,Re.y,Re.J,Re.G,Re.i,Re.x,Re.O,Re.r,Re.C,Re.E,Re.j,Re.I,Re.L,Re.A,Re.n,Re.o,Re.z,Re.g,Re.h,Re.v,Re.E);var yc=function(){var e=Object(R.g)(),t=Object(o.c)(),a=Object(o.d)((function(e){return e.session})),r=Object(n.useState)(!0),l=Object(A.a)(r,2),s=l[0],i=l[1];Object(n.useEffect)((function(){Object.entries(a.i18n).length||t((function(e,t){return new Promise((function(t,a){$e().then((function(a){var n=a.data,c=n.user,r=n.data,l=n.session,o=n.panel,s=n.error,i=n.i18n,u=n.token;u&&qe(u),e({type:"CHECK_AUTH",value:{userName:c,i18n:i,token:u,error:s}}),e({type:"REFRESH_PANEL",value:{panel:o}}),e({type:"REFRESH_COUNTERS",value:{user:r}}),e({type:"SET_USER_SESSION",value:l}),t(u)})).catch((function(e){a(),console.error(e)}))}))})).then((function(e){i(!1)}),(function(t){return console.error(t),e.push("/login")}))}),[t,e,a]);var u=function(e){var t=e.authenticated,a=Object(w.a)(e,["authenticated"]);return c.a.createElement(R.b,Object.assign({},a,{render:function(e){return t?c.a.createElement(a.component,e):c.a.createElement(R.a,{to:"/login"})}}))};return c.a.createElement("div",{className:"App"},s?c.a.createElement(P,null):c.a.createElement(R.d,null,c.a.createElement(R.b,{path:"/login",exact:!0,component:Oc}),c.a.createElement(R.b,{path:"/reset",exact:!0,component:jc}),c.a.createElement(R.b,{path:"/list/directory/",exact:!0,component:Me}),c.a.createElement(R.b,{path:"/list/directory/preview/",exact:!0,component:Ie}),c.a.createElement(u,{path:"/list/server/service/",authenticated:a.userName,component:Nc}),c.a.createElement(u,{path:"/list/web-log/",exact:!0,authenticated:a.userName,component:hc}),c.a.createElement(u,{path:"/",authenticated:a.userName,loading:s,component:Ec})))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));l.a.render(c.a.createElement(o.a,{store:Object(i.createStore)(_,Object(s.composeWithDevTools)(Object(i.applyMiddleware)(S.a)))},c.a.createElement(pe.a,null,c.a.createElement(yc,null))),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}]),[[96,1,2]]]);
//# sourceMappingURL=main.a9be926e.chunk.js.map