(()=>{function n(o){var e,t,l=this,a={DOWNLOAD:"download",UPLOAD:"upload"};function i(n,e){(t=_.map(l.availableControls?l.availableControls.split(","):[],_.trim)).length||(l.enableDownload&&t.push(a.DOWNLOAD),l.enableUpload&&t.push(a.UPLOAD)),o.canDownload(e)?_.pull(t,a.UPLOAD):_.pull(t,a.DOWNLOAD)}_.assign(l,{$onInit:function(){l.show=o.doesContainBinary(l.event),i(0,l.event)},$onChanges:function(n){n.event&&i(0,n.event.currentValue)},download:function(){o.downloadAndSaveAs(l.event)},onNewImageSelected:function(n){e=n.target.files[0]},upload:function(){o.upload(e,l.event)},checkControlAvailable:function(n){return _.isEmpty(_.get(l.event,"c8y_IsIncompleteBinary"))&&_.includes(t,n)}})}n.$inject=["eventsBinaryService"],angular.module("c8y.eventsBinary").component("c8yEventBinaryActions",{templateUrl:":::PLUGIN_PATH:::/components/eventBinaryActions/eventBinaryActions.html",bindings:{event:"<",availableControls:"@",enableDownload:"<?",enableUpload:"<?"},controller:n,controllerAs:"vm"})})();