(()=>{function e(t,r,o,e,n,i,a,c,s,u,p){var g=this,l="c8y_IsDeviceGroup",d=[];function y(e){return o.when((e=>((e=angular.copy(e))[l]={},e.type=e.groupType.type,delete e.groupType,e))(e)).then(i.createConfirm).then(n.getResData).then(h)}function h(e){return c.addGroupNavigation(e),e}function f(e){e=p.getString('Group "{{name}}" created.',e);return s.success(e)}function m(t,e){var r=o.when();return _.forEach(e,function(e){var n=_.partial(i.addChildAsset,t,e);r=r.then(n).then(function(){d.push(e)})}),r}_.assign(r,{title:u("Create group"),forms:{},alreadyAssignedDevices:d,newGroup:{groupType:e.getDeviceGroupType()},create:function(e){var n=r.newGroup,e=_.partialRight(m,e);o.when(y(n)).then(e).then(g.close).then(_.partial(f,n)).then(function(){t.$broadcast("c8yGroupCreateAndAssign::created")})},invalidName:function(){return n.invalid(r.forms,"newGroupForm","name")},dismiss:g.dismiss,c8yConfig:a})}e.$inject=["$rootScope","$scope","$q","c8yGroupTypesConfig","c8yBase","c8yInventory","c8yConfig","groupTypesHierarchyNavigator","c8yAlert","gettext","gettextCatalog"],angular.module("c8y.ui").component("c8yGroupCreateAndAssignModal",{templateUrl:":::PLUGIN_PATH:::/ui/groups/views/group-create-and-assign.html",controller:e,controllerAs:"vm",bindings:{dismiss:"&",close:"&"}})})();