(()=>{function e(t,n,o,i,e,a){var r=this;function l(e){return r.saving=!0,e.finally(function(){r.saving=!1}),e}function s(e){return"SUPPORT"===e.name&&!r.isTopTenant}_.assign(r,{$onInit:function(){(()=>{var e=r.id,n=r.duplicateId;("new"===e?i.newInventoryRole(n):o.detail(e).then(t.getResData)).then(function(e){r.role=e})})()},$onChanges:function(e){e.isTopTenant&&(r.permissionScopes=(()=>{var e=n.SCOPES.values();return _.reject(e,s)})())},STRINGS:i.STRINGS,helpLink:a.getUserGuideLink(i.STRINGS.LINKS.ROLES_INVENTORY),onSaveName:function(e){return l(i.saveInventoryRoleName(r.role,e))},cancel:i.list,save:function(){return l(i.saveInventoryRole(r.role))},getRoleName:e.getName})}e.$inject=["c8yBase","c8yPermissions","c8yRoles","c8yRolesUi","c8yPropertyValueTransformService","c8yDocs"],angular.module("c8y.roles").component("c8yRoleDetailInventory",{templateUrl:":::PLUGIN_PATH:::/detail/roleDetailInventory.html",bindings:{id:"<",duplicateId:"<",isTopTenant:"<",tabName:"<"},controllerAs:"vm",controller:e})})();