(()=>{function n(o,n){var a=this;function e(){n.downloadAndSaveAs({id:a.binaryId},a.details.length).then(function(){a.close({$value:"close"})})}_.assign(a,{$onInit:function(){_.assign(a,{binaryId:_.get(a.resolve,"binaryId"),downloadBtnEnabled:!1,download:e,cancel:function(){a.dismiss({$value:"cancel"})}}),(n=>o.detail(n,void 0,{silentError:!0}).then(function(n){return n.data}).then(function(n){return a.downloadBtnEnabled=!0,n}).catch(function(n){a.downloadBtnEnabled=!1,a.errorData=_.get(n,"data")}))(a.binaryId).then(function(n){a.details=n})}})}n.$inject=["c8yInventory","c8yBinary"],angular.module("c8y.binaryFileDownload").component("binaryFileDownload",{controller:n,controllerAs:"vm",templateUrl:":::PLUGIN_PATH:::/binary-file-download.html",bindings:{resolve:"<",close:"&",dismiss:"&"}})})();