function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}define("tpl!taoTaskQueue/component/listing/tpl/element",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var stack1,helper,options,buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing;return buffer+="
\n
\n
\n \n
\n
\n
\n
",(helper=helpers.taskLabel)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.taskLabel,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"
\n
",(helper=helpers.time)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.time,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"
\n
\n
\n \n
\n
\n \n \n \n \n
\n
",buffer})}),define("css!taoTaskQueue/component/listing/css/element",[],function(){}),define("taoTaskQueue/component/listing/element",["jquery","lodash","i18n","moment","ui/component","ui/hider","tpl!taoTaskQueue/component/listing/tpl/element","css!taoTaskQueue/component/listing/css/element"],function($,_,__,moment,component,hider,elementTpl){'use strict';var _defaults={},_allowedStatus=["in_progress","failed","completed"],_categoryMap={import:"import",export:"export",delivery_comp:"delivery",transfer:"connect",create:"magicwand",update:"edit",delete:"bin"},_statusIcon={in_progress:"property-advanced",completed:"result-ok",failed:"result-nok"},getLabelString=function(data){return data.taskLabel},getFormattedTime=function(from,elapsed){return moment.unix(from).from(moment.unix(parseInt(from,10)+parseInt(elapsed,10)))},getTimeString=function(data){switch(data.status){case"created":case"in_progress":return __("Started %s",getFormattedTime(data.createdAt,data.createdAtElapsed));case"completed":return __("Completed %s",getFormattedTime(data.updatedAt,data.updatedAtElapsed));case"failed":return __("Failed %s",getFormattedTime(data.updatedAt,data.updatedAtElapsed));default:return"";}},getIcon=function(data){var icon;if(!_.isPlainObject(data))throw new Error("invalid data");return icon=data.category&&_categoryMap[data.category]?_categoryMap[data.category]:data.status&&_statusIcon[data.status]?_statusIcon[data.status]:_statusIcon.in_progress,"icon-"+icon},taskElementApi={getId:function(){if(this.data&&this.data.id)return this.data.id},getStatus:function(){if(this.data&&this.data.status)return this.data.status},getData:function(){return this.data},update:function(data){var $container=this.getElement();return _.assign(this.data||{},data),$container.find(".shape > span").removeAttr("class").addClass(getIcon(this.data)),$container.find(".label").html(getLabelString(this.data)),$container.find(".time").html(getTimeString(this.data)),this.setStatus(this.data.status),hider.toggle($container.find(".action-bottom [data-role=\"download\"]"),this.data.hasFile),hider.toggle($container.find(".action-bottom [data-role=\"redirect\"]"),!!this.data.redirectUrl),this.trigger("update"),this},highlight:function(){var $container=this.getElement();return $container.addClass("highlight"),_.delay(function(){$container.removeClass("highlight")},500),this},setStatus:function(status){var self=this;if(!status)throw new Error("status should not be empty");if(-1!==["created"].indexOf(status)&&(status="in_progress"),-1===_allowedStatus.indexOf(status))throw new Error("unknown status "+status);return this.is(status)||(_.forEach(_.without(_allowedStatus,status),function(st){self.setState(st,!1)}),this.setState(status,!0)),this}};return function(config,data){var initConfig=_.defaults(config||{},_defaults);return component(taskElementApi).setTemplate(elementTpl).on("init",function(){this.data=data||{}}).on("render",function(){var self=this,$component=this.getElement();this.update(data),$component.find("[data-role=\"download\"]").click(function(){self.trigger("download")}),$component.find("[data-role=\"remove\"]").click(function(){self.trigger("remove")}),$component.find("[data-role=\"report\"]").click(function(){self.trigger("report")}),$component.find("[data-role=\"redirect\"]").click(function(){self.trigger("redirect")})}).init(initConfig)}}),define("tpl!taoTaskQueue/component/listing/tpl/report",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var helper,options,buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;return buffer+="
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n "+escapeExpression((helper=helpers.__||depth0&&depth0.__,options={hash:{},data:data},helper?helper.call(depth0,"No report available",options):helperMissing.call(depth0,"__","No report available",options)))+"\n
\n
",buffer})}),define("css!taoTaskQueue/component/listing/css/report",[],function(){}),define("taoTaskQueue/component/listing/report",["jquery","lodash","i18n","moment","ui/component","ui/hider","ui/report","tpl!taoTaskQueue/component/listing/tpl/report","css!taoTaskQueue/component/listing/css/report"],function($,_,__,moment,component,hider,reportFactory,elementTpl){'use strict';var _defaults={},reportElementApi={update:function(data){var $component=this.getElement();$component.find(".label").html(data.taskLabel),data.report&&_.isArray(data.report.children)&&data.report.children.length?(this.setState("noreport",!1),reportFactory({replace:!0},data.report.children[0]).render($component.find(".detail-body"))):this.setState("noreport",!0)}};return function(config,data){var initConfig=_.defaults(config||{},_defaults);return component(reportElementApi).setTemplate(elementTpl).on("render",function(){var self=this,$component=this.getElement();this.update(data),$component.find("[data-role=\"close\"]").click(function(){self.trigger("close")})}).init(initConfig)}}),define("tpl!taoTaskQueue/component/listing/tpl/list",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var stack1,helper,options,buffer="",escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing;return buffer+="
\n
\n
\n
",(helper=helpers.title)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.title,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"
\n
",(helper=helpers.emptyText)?stack1=helper.call(depth0,{hash:{},data:data}):(helper=depth0&&depth0.emptyText,stack1="function"===_typeof(helper)?helper.call(depth0,{hash:{},data:data}):helper),buffer+=escapeExpression(stack1)+"
\n \n \n
\n
\n
",buffer})}),define("tpl!taoTaskQueue/component/listing/tpl/elementWrapper",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var stack1,helper,buffer="",escapeExpression=this.escapeExpression;return buffer+="
  • ",buffer})}),define("css!taoTaskQueue/component/listing/css/list",[],function(){}),define("taoTaskQueue/component/listing/list",["jquery","lodash","i18n","ui/component","taoTaskQueue/component/listing/element","tpl!taoTaskQueue/component/listing/tpl/list","tpl!taoTaskQueue/component/listing/tpl/elementWrapper","css!taoTaskQueue/component/listing/css/list"],function($,_,__,component,listElementFactory,listTpl,elementWrapperTpl){'use strict';var _defaults={title:"Task List",emptyText:__("The list is currently empty.")},listApi={removeElement:function(listElement){return listElement.destroy(),this.getElement().find("ul li[data-id=\""+listElement.getId()+"\"]").remove(),this},insertElement:function(listElement){var id=listElement.getId(),$li=$(elementWrapperTpl({id:id}));return this.getElement().find("ul").prepend($li),listElement.render($li),this},setDetail:function(detailElement,show){return detailElement.render(this.getElement().find(".view-detail")),show&&this.setState("detail-view",!0),this},hideDetail:function(){return this.setState("detail-view",!1),this},scrollToTop:function(){return this.getElement().find(".task-list").get(0).scrollTo(0,0),this},animateInsertion:function(listElement){var $listElement=listElement.getElement(),$container=$listElement.parent();return $container.addClass("inserting"),$listElement.addClass("new-element"),_.delay(function(){$container.removeClass("inserting"),_.delay(function(){$listElement.removeClass("new-element")},400)},100),this}};return function(config){var initConfig=_.defaults(config||{},_defaults);return component(listApi).setTemplate(listTpl).on("render",function(){var self=this;this.getElement().find(".clear-all").on("click",function(e){e.preventDefault(),self.trigger("clearall")})}).init(initConfig)}}),define("tpl!taoTaskQueue/component/manager/tpl/manager",["handlebars"],function(hb){return hb.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"],helpers=this.merge(helpers,Handlebars.helpers),data=data||{};var helper,options,buffer="",helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;return buffer+="
    \n
    ",buffer})}),define("css!taoTaskQueue/component/manager/css/manager",[],function(){}),define("taoTaskQueue/component/manager/manager",["jquery","lodash","i18n","layout/loading-bar","ui/hider","ui/component","ui/badge/badge","ui/component/alignable","ui/animable/absorbable/absorbable","ui/animable/pulsable/pulsable","taoTaskQueue/component/listing/element","taoTaskQueue/component/listing/report","taoTaskQueue/component/listing/list","tpl!taoTaskQueue/component/manager/tpl/manager","css!taoTaskQueue/component/manager/css/manager"],function($,_,__,loadingBar,hider,component,badgeFactory,makeAlignable,makeAbsorbable,makePulsable,listElementFactory,reportElementFactory,taskListFactory,managerTpl){'use strict';var getBadgeDataFromStatus=function(tasksStatuses){var total=0,data={loading:!1};if(tasksStatuses)return tasksStatuses.numberOfTasksInProgress&&(total+=parseInt(tasksStatuses.numberOfTasksInProgress,10),data.type="info",data.loading=0