(()=>{function n(e){var i=this;function a(){i.isDetailOpen=!i.isDetailOpen}function t(){i.mapping=_.cloneDeep(i.serverMapping)||{}}function n(){var n=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e={},t=i.resource.id;return e[t]=_.assign({resourceID:t},i.mapping),n?i.onUpdate({mapping:e}).then(a):i.onUpdate({mapping:e})}_.assign(i,{$onChanges:function(n){n.serverMapping&&t()},toggleDetail:a,helpTexts:e.helpTexts,save:n,$onInit:function(){e.getCustomActions().then(function(n){i.customActions=n})},showValidation:function(){return(()=>{var n=_.get(i.resource,"operations");return!!n&&("W"===n||"RW"===n)})()&&(()=>{var n=_.get(i.resource,"dataType");return!!n&&!_.isUndefined(e.Validation.ResourceDataType[n])})()},validationAvailable:function(){var n=_.get(i.mapping,"validation.arg");if(n)return 0<n.length;return!1},cancel:function(){a(),t()},updateSkipIfEmptyValues:function(){n(!1)}})}n.$inject=["c8yLwm2m"],angular.module("c8y.lwm2m").component("c8yLwm2mResource",{templateUrl:":::PLUGIN_PATH:::/lwm2mResource.html",controllerAs:"vm",controller:n,bindings:{resource:"<",serverMapping:"<mapping",onUpdate:"&"}})})();