(()=>{function e(t,s){function a(e,t,n,a,o){var l=a.length;function r(){e.doneAbs=l-a.length,e.done=e.doneAbs/l*100}function i(){t.close("fail")}e.total=l,e.title=o||n("Batch operations"),function e(){var n=a.shift();return n?s.when(n()).then(r).then(e,i):(t.close("complete"),!0)}(),r()}return a.$inject=["$scope","$uibModalInstance","gettext","operations","title"],{run:function(e,n){return 0===e.length?{result:s.when("complete")}:t.open({template:'\n          <div class="body" style="padding:20px">\n            <h4 style="text-center" id="modal-title">{{title | translate}} <small>{{doneAbs}} / {{total}}</small></h4>\n            <div class="progress progress-striped active" style="margin:0" id="modal-body">\n              <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="{{done}}" aria-valuemin="0" aria-valuemax="100" ng-style="{width: done + \'%\'}">\n                <span class="sr-only">{{done}}%</span>\n              </div>\n            </div>\n          </div>\n        ',controller:a,ariaLabelledBy:"modal-title",ariaDescribedBy:"modal-body",resolve:{operations:function(){return e},title:function(){return n}}})}}}e.$inject=["$uibModal","$q"],angular.module("c8y.ui").factory("c8yBatchOp",e)})();