function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,e){var t;if(r)return"string"==typeof r?_arrayLikeToArray(r,e):"Map"===(t="Object"===(t={}.toString.call(r).slice(8,-1))&&r.constructor?r.constructor.name:t)||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,e):void 0}function _arrayLikeToArray(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,a=Array(e);t<e;t++)a[t]=r[t];return a}function _iterableToArrayLimit(r,e){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var a,n,i,o,l=[],u=!0,y=!1;try{if(i=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;u=!1}else for(;!(u=(a=i.call(t)).done)&&(l.push(a.value),l.length!==e);u=!0);}catch(r){y=!0,n=r}finally{try{if(!u&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(y)throw n}}return l}}function _arrayWithHoles(r){if(Array.isArray(r))return r}angular.module("c8y.ui").directive("c8yBinaryOut",function(){var i=/^data:.+;base64,(.*)$/;return{scope:{c8yBinaryOut:"&"},link:function(n,r){r.bind("change",function(a){var r=new FileReader;r.onload=function(r){var e,t=_slicedToArray(a.target.files,1)[0],r=r.target.result.match(i);null!==r&&(e=_slicedToArray(r,2)[1],n.$apply(function(){var r=new Blob([],{type:t.type,size:t.size});r.name=t.name,r.data=e,r.c8y_IsBinary=!0,n.c8yBinaryOut({$binary:r})}))},a.target.files[0]&&r.readAsDataURL(a.target.files[0])})}}});