export const __webpack_esm_id__=38529;export const __webpack_esm_ids__=[38529,79064];export const __webpack_esm_modules__={38529(e,t,n){n(79064);var o=n(22723);function s(e,t,n,s,a,l){const r=[];e.isValid=a.isValid(),e.ok=()=>{const e=a.getClusterView();e.hasCluster()?t.close((0,o.cloneDeep)(e.getUpdateActions())):t.close((0,o.cloneDeep)(e.getUpdateActions().clusterConfiguration))},e.cancel=()=>{e.isChanged?l.openSimpleModal({title:n.instant("common.warning"),message:n.instant("page.leave.pristine.warning"),warning:!0}).result.then(()=>{t.dismiss("cancel")}):t.dismiss("cancel")};r.push(a.onClusterValidityChanged(t=>{e.isValid=t})),r.push(a.onClusterViewChanged(()=>{if(!e.hasCluster&&0===a.getAttached().length){const e=a.getLocalNode();a.addLocation(e)}e.isChanged=a.isChanged()})),e.$on("$destroy",()=>{r.forEach(e=>e()),a.setClusterView(void 0)}),a.setClusterView(s.clusterModel),e.hasCluster=s.clusterModel.hasCluster}angular.module("graphdb.framework.clustermanagement.controllers.edit-cluster-nodes-modal",["graphdb.framework.clustermanagement.services.cluster-context"]).controller("EditClusterNodesModalController",s),s.$inject=["$scope","$uibModalInstance","$translate","data","ClusterContextService","ModalService"]},79064(e,t,n){var o=n(22723),s=n(8981);function a(e){let t,n,a=!1;const r=()=>t,i=()=>a,d=e=>{if(!e)throw new Error("Invalid location");t.addToCluster(e),u()},c=e=>{if(!e)throw new Error("Invalid node");t.deleteFromCluster(e),u()},u=()=>{g(l.CLUSTER_VIEW_UPDATED,r())},g=(t,n)=>{e.emitSync(t,n)},C=(t,n)=>e.subscribeSync(t,e=>n(e));return{emit:g,subscribe:C,getClusterView:r,onClusterViewChanged:e=>(t&&angular.isFunction(e)&&e(r()),C(l.CLUSTER_VIEW_UPDATED,t=>e(t))),setClusterView:e=>{if(!e)return t=void 0,a=!1,void(n=void 0);t=new s.do((0,o.cloneDeep)(e)),u()},addLocation:d,updateClusterValidity:e=>{a=e,g(l.CLUSTER_VALID_UPDATED,i())},isValid:i,onClusterValidityChanged:e=>(t&&angular.isFunction(e)&&e(i()),C(l.CLUSTER_VALID_UPDATED,t=>e(t))),emitUpdateClusterView:u,deleteFromCluster:c,restoreNode:e=>{if(!e)throw new Error("Invalid node");t.restoreFromDeletion(e),u()},replace:(e,t)=>{c(e),d(t)},setPendingReplace:e=>{n=(0,o.cloneDeep)(e)},getPendingReplace:()=>n,getDeleteFromCluster:()=>t.getDeleteFromCluster(),getAvailable:()=>t.getAvailable(),getAvailableNodeEndpoints:()=>t.getAvailableNodeEndpoints(),getAttached:()=>t.getAttached(),hasValidNodesCount:()=>t.hasValidNodesCount(),canDeleteNode:()=>t.canDeleteNode(),findByEndpoint:(e,n)=>t.findByEndpoint(e,n),getLocalNode:()=>t.getLocalNode(),getViewModel:()=>t.getViewModel(),hasCluster:()=>t.hasCluster(),getClusterConfiguration:()=>t.getClusterConfiguration(),isChanged:()=>t.isChanged()}}angular.module("graphdb.framework.clustermanagement.services.cluster-context",[]).factory("ClusterContextService",a),a.$inject=["EventEmitterService"];const l={CLUSTER_VIEW_UPDATED:"cluster_view_updated",CLUSTER_VALID_UPDATED:"cluster_valid_updated"}}};
//# sourceMappingURL=38529.4f3430bef961dc4cd834.bundle.js.map