export const __webpack_esm_id__=64073;export const __webpack_esm_ids__=[64073];export const __webpack_esm_modules__={64073(e,t,o){var n=o(8981);function i(e,t,o,i,a,r,d){return{restrict:"E",templateUrl:"js/angular/clustermanagement/templates/cluster-nodes-configuration.html",link:o=>{const i=[];o.rowHeights={},o.editedNodeIndex=void 0,o.allSuggestions=[],o.loader=!1,o.errors=[],o.addNewLocation=!1,o.hasCluster=!1,o.addNode=()=>{o.addNewLocation=!0,o.newLocation=new n.aZ,t(function(){const e=document.querySelector("input[name='location']");e&&e.focus()},0)},o.filterSuggestions=e=>{const t=e.endpoint&&e.endpoint.toLowerCase();t?(o.suggestions=o.allSuggestions.filter(e=>e.toLowerCase().includes(t)),o.showDropdown=!0):(o.suggestions=[],o.showDropdown=!1)},o.selectSuggestion=(e,t)=>{e.endpoint=t,o.suggestions=[],o.showDropdown=!1},o.hideSuggestions=()=>{t(()=>{o.showDropdown=!1},200)},o.handleKeydown=function(e,t,n){"Enter"===e.key&&t?(e.preventDefault(),o.saveNode(n)):"Escape"===e.key&&o.cancel()},o.saveNode=e=>{const t=r.getAvailable(!0);var o,i;o=r.findByEndpoint(t,e)||new n.aZ(e),(i=r.getPendingReplace())?r.replace(i,o):r.addLocation(o),a()},o.deleteNode=(t,o)=>{d.openSimpleModal({title:e.instant("location.confirm.detach"),message:e.instant("location.confirm.detach.warning",{uri:o.endpoint}),warning:!0}).result.then(()=>{r.deleteFromCluster(o.item)})},o.replaceNode=(t,n)=>{d.openSimpleModal({title:e.instant("location.change.confirm"),message:e.instant("location.change.confirm.warning"),warning:!0}).result.then(()=>{r.setPendingReplace(n.item),o.editedNodeIndex=t})},o.isClusterConfigurationValid=()=>{const e=void 0===o.editedNodeIndex,t=!1===o.addNewLocation,n=r.hasValidNodesCount(),i=o.form.$valid;return e&&t&&n&&i},o.setLoader=(e,n)=>{t.cancel(o.loaderTimeout),e?o.loaderTimeout=t(()=>{o.loader=e,o.loaderMessage=n},300):o.loader=!1},o.getAdvancedOptionsClass=()=>{const e=document.getElementById("advancedOptions");if(e){const t=e.getAttribute("aria-expanded");if(t&&"true"===t)return"ri-arrow-down-s-line"}return"ri-arrow-right-s-line"},o.cancel=()=>{o.editedNodeIndex=void 0,o.addNewLocation=!1,a(),r.emitUpdateClusterView()},o.restoreNode=e=>{r.restoreNode(e.item)};const a=()=>{r.setPendingReplace(void 0),o.editedNodeIndex=void 0,o.addNewLocation=!1},s=o.$watchGroup(["editedNodeIndex","addNewLocation","clusterConfiguration.electionMinTimeout","clusterConfiguration.electionRangeTimeout","clusterConfiguration.heartbeatInterval","clusterConfiguration.messageSizeKB","clusterConfiguration.verificationTimeout","clusterConfiguration.transactionLogMaximumSizeGB"],(e,t)=>{const n=o.isClusterConfigurationValid();r.updateClusterValidity(n)});i.push(s),i.push(r.onClusterViewChanged(e=>{o.hasCluster=r.hasCluster(),o.viewModel=r.getViewModel(),o.clusterNodesEndpoints=o.viewModel.map(e=>e.endpoint),o.clusterConfiguration=r.getClusterConfiguration(),o.allSuggestions=r.getAvailableNodeEndpoints(),o.canDeleteNode=r.canDeleteNode()})),o.$on("$destroy",()=>{i.forEach(e=>e())})}}}angular.module("graphdb.framework.clustermanagement.directives.cluster-nodes-configuration",[]).directive("clusterNodesConfiguration",i),i.$inject=["$translate","$timeout","productInfo","toastr","RemoteLocationsService","ClusterContextService","ModalService"]}};
//# sourceMappingURL=64073.4e1d4e5900f7fda826a1.bundle.js.map