"}});return{View:e}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(i,o,a){n=[],s=function(){var t=i.Model.extend({defaults:{title:"",icon_class:"",on_click:null,menu_options:null,is_menu_button:!0,id:null,href:null,target:null,enabled:!0,visible:!0,tooltip_config:{}}}),e=i.View.extend({initialize:function(){this.model.attributes.tooltip_config={placement:"bottom"},this.model.bind("change",this.render,this)},render:function(){this.$el.tooltip("hide");var t=this.template(this.model.toJSON());return t.tooltip(this.model.get("tooltip_config")),this.$el.replaceWith(t),this.setElement(t),this},events:{click:"click"},click:function(t){return o.isFunction(this.model.get("on_click"))?(this.model.get("on_click")(t),!1):!0},template:function(t){var e='title="'+t.title+'" class="icon-button';return t.is_menu_button&&(e+=" menu-button"),e+=" "+t.icon_class,t.enabled||(e+="_disabled"),e+='"',t.id&&(e+=' id="'+t.id+'"'),e+=' href="'+t.href+'"',t.target&&(e+=' target="'+t.target+'"'),t.visible||(e+=' style="display: none;"'),e=t.enabled?"":"",a(e)}}),n=i.Collection.extend({model:t}),s=i.View.extend({tagName:"div",initialize:function(){this.render()},render:function(){var t=this;return this.collection.each(function(e){var i=a("").attr("href","javascript:void(0)").attr("title",e.attributes.title).addClass("icon-button menu-button").addClass(e.attributes.icon_class).appendTo(t.$el).click(e.attributes.on_click);e.attributes.tooltip_config&&i.tooltip(e.attributes.tooltip_config);var n=e.get("options");n&&make_popupmenu(i,n)}),this}}),r=function(e,i){i||(i={});var a=new n(o.map(e,function(e){return new t(o.extend(e,i))}));return new s({collection:a})};return{IconButton:t,IconButtonView:e,IconButtonCollection:n,IconButtonMenuView:s,create_icon_buttons_menu:r}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1))},function(t,e,i){var n,s,o;!function(a){s=[i(1)],n=a,o="function"==typeof n?n.apply(e,s):n,!(void 0!==o&&(t.exports=o))}(function(t){"use_strict";var e=t;e.fn.make_text_editable=function(t){var i="num_cols"in t?t.num_cols:30,n="num_rows"in t?t.num_rows:4,s="use_textarea"in t?t.use_textarea:!1,o="on_finish"in t?t.on_finish:null,a="help_text"in t?t.help_text:null,r=e(this);return r.addClass("editable-text").click(function(a){if(!(e(this).children(":input").length>0)){r.removeClass("editable-text");var l,c,d=function(t){r.find(":input").remove(),""!==t?r.text(t):r.html(" "),r.addClass("editable-text"),o&&o(t)},h="cur_text"in t?t.cur_text:r.text();s?(l=e("").attr({rows:n,cols:i}).text(e.trim(h)).keyup(function(t){27===t.keyCode&&d(h)}),c=e("").text("Done").click(function(){return d(l.val()),!1})):l=e("").attr({value:e.trim(h),size:i}).blur(function(){d(h)}).keyup(function(t){27===t.keyCode?e(this).trigger("blur"):13===t.keyCode&&d(e(this).val()),t.stopPropagation()}),r.text(""),r.append(l),c&&r.append(c),l.focus(),l.select(),a.stopPropagation()}}),a&&r.attr("title",a).tooltip(),r}})},function(t,e,i){var n;(function(s,o){n=function(){function t(t){t+="";for(var e=/(\d+)(\d{3})/;e.test(t);)t=t.replace(e,"$1,$2");return t}var e=function(t){return"promise"in t},i=s.Model.extend({defaults:{ajax_settings:{},interval:1e3,success_fn:function(t){return!0}},go:function(){var t=o.Deferred(),e=this,i=e.get("ajax_settings"),n=e.get("success_fn"),s=e.get("interval"),a=function(){o.ajax(i).success(function(e){n(e)?t.resolve(e):setTimeout(a,s)})};return a(),t}}),n=function(t){t||(t="#ffffff"),"string"==typeof t&&(t=[t]);for(var e=0;e>16,s=(65280&i)>>8,o=255&i,d=p(n,s,o),g=!0,e=0;e>16,l=(65280&a)>>8,c=255&a,h=p(r,l,c),u=f(n,s,o,r,l,c),Math.abs(d-h)<40||200>u){g=!1;break}m++}while(!g&&10>=m);return"#"+(16777216+i).toString(16).substr(1,6)};return{commatize:t,is_deferred:e,ServerStateDeferred:i,get_random_color:n}}.call(e,i,e,t),!(void 0!==n&&(t.exports=n))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(o){n=[i(32),i(6),i(5)],s=function(t,e,i){t=t||window.BibtexParser;var n="citation",s=o.Model.extend(e.LoggableMixin).extend({_logNamespace:n,initialize:function(){var e=this.get("content"),i=t(e).entries[0];this.entry=i,this._fields={};var n=i.Fields;for(var s in n){var o=n[s],a=s.toLowerCase();this._fields[a]=o}},entryType:function(){return this.entry.EntryType},fields:function(){return this._fields}}),a=o.Collection.extend(e.LoggableMixin).extend({_logNamespace:n,urlRoot:Galaxy.root+"api",partial:!0,model:s}),r=a.extend({url:function(){return this.urlRoot+"/histories/"+this.history_id+"/citations"}}),l=a.extend({url:function(){return this.urlRoot+"/tools/"+this.tool_id+"/citations"},partial:!1});return{Citation:s,HistoryCitationCollection:r,ToolCitationCollection:l}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;n=[i(4),i(7),i(49),i(23)],s=function(t,e,i,n){var s=i.extend({initialize:function(n){var s=this;i.prototype.initialize.call(this,t.merge({customize:function(t){t.buttons={execute:execute_btn=new e.Button({icon:"fa-check",tooltip:"Execute: "+t.name+" ("+t.version+")",
-title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){execute_btn.wait(),s.portlet.disable(),s.submit(t,function(){execute_btn.unwait(),s.portlet.enable()})}})},t.job_id&&t.job_remap&&(t.inputs.rerun_remap_job_id={label:"Resume dependencies from this job",name:"rerun_remap_job_id",type:"select",display:"radio",ignore:"__ignore__",value:"__ignore__",options:[["Yes",t.job_id],["No","__ignore__"]],help:"The previous run of this tool failed and other tools were waiting for it to finish successfully. Use this option to resume those tools using the new output(s) of this tool run."})}},n))},submit:function(e,i){var s=this,o={tool_id:e.id,tool_version:e.version,inputs:this.data.create()};return this.trigger("reset"),s.validate(o)?(Galaxy.emit.debug("tool-form::submit()","Validation complete.",o),void t.request({type:"POST",url:Galaxy.root+"api/tools",data:o,success:function(t){i&&i(),s.$el.empty().append(n.success(t)),parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.refreshContents()},error:function(t){if(i&&i(),Galaxy.emit.debug("tool-form::submit","Submission failed.",t),t&&t.err_data){var e=s.data.matchResponse(t.err_data);for(var a in e){s.highlight(a,e[a]);break}}else s.modal.show({title:"Job submission failed",body:t&&t.err_msg||n.error(o),buttons:{Close:function(){s.modal.hide()}}})}})):(Galaxy.emit.debug("tool-form::submit()","Submission canceled. Validation failed."),void(i&&i()))},validate:function(t){var e=t.inputs,i=-1,n=null;for(var s in e){var o=e[s],a=this.data.match(s),r=this.field_list[a],l=this.input_list[a];if(a&&l&&r){if(!l.optional&&null==o)return this.highlight(a),!1;if(o&&o.batch){var c=o.values.length,d=c>0&&o.values[0]&&o.values[0].src;if(d)if(null===n)n=d;else if(n!==d)return this.highlight(a,"Please select either dataset or dataset list fields for all batch mode fields."),!1;if(-1===i)i=c;else if(i!==c)return this.highlight(a,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains "+c+" selection(s) while a previous field contains "+i+"."),!1}}else Galaxy.emit.debug("tool-form::validate()","Retrieving input objects failed.")}return!0}});return{View:s}}.apply(e,n),!(void 0!==s&&(t.exports=s))},function(t,e,i){var n,s;(function(i){n=[],s=function(){return{help:function(t){var e=i("").addClass("ui-form-help").append(t.help);return e.find("a").attr("target","_blank"),e},success:function(t){if(!t.jobs||!t.jobs.length)return this.error(t);var e=t.jobs.length,i="";i=1==e?"1 job has":e+" jobs have";var n='
'+i+" been successfully added to the queue - resulting in the following datasets:
";for(var s in t.outputs)n+='
'+t.outputs[s].hid+": "+t.outputs[s].name+"
";return n+="
You can check the status of queued jobs and view the resulting data by refreshing the History pane. When the job has been run the status will change from 'running' to 'finished' if completed successfully or 'error' if problems were encountered.
"},error:function(t){return'
The server could not complete the request. Please contact the Galaxy Team if this error persists.
"},requirements:function(t){var e="This tool requires ";for(var i in t.requirements){var n=t.requirements[i];e+=n.name,n.version&&(e+=" (Version "+n.version+")"),ihere for more information.'}}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(1))},function(t,e,i){var n,s;(function(o,a){n=[i(4),i(11),i(7)],s=function(t,e,i){var n=o.View.extend({initialize:function(t){var n=this;this.options=t,this.name=t.name||"element",this.multiple=t.multiple||!1,this.message=new i.Message({cls:"ui-margin-top"}),this.portlet=new e.View({cls:"ui-portlet-section"}),this.select=new i.Select.View({optional:t.optional}),this.button=new i.ButtonIcon({icon:"fa fa-sign-in",floating:"left",tooltip:"Insert new "+this.name,onclick:function(){n.add({id:n.select.value(),name:n.select.text()})}}),this.setElement(this._template(t)),this.$(".ui-list-message").append(this.message.$el),this.$(".ui-list-portlet").append(this.portlet.$el),this.$(".ui-list-button").append(this.button.$el),this.$(".ui-list-select").append(this.select.$el)},value:function(t){if(void 0!==t){if(this.portlet.empty(),a.isArray(t))for(var e in t){var i=t[e],n=null,s=null;"string"!=a.type(i)?(n=i.id,s=i.name):n=s=i,null!=n&&this.add({id:n,name:s})}this._refresh()}var o=[];return this.$(".ui-list-id").each(function(){o.push({id:a(this).prop("id"),name:a(this).find(".ui-list-name").html()})}),0==o.length?null:o},add:function(e){var i=this;if(0===this.$('[id="'+e.id+'"]').length)if(t.validate(e.id)){var n=a(this._templateRow({id:e.id,name:e.name}));n.on("click",function(){n.remove(),i._refresh()}),n.on("mouseover",function(){n.addClass("portlet-highlight")}),n.on("mouseout",function(){n.removeClass("portlet-highlight")}),this.portlet.append(n),this._refresh()}else this.message.update({message:"Please select a valid "+this.name+".",status:"danger"});else this.message.update({message:"This "+this.name+" is already in the list."})},update:function(t){this.select.update(t)},_refresh:function(){this.$(".ui-list-id").length>0?(!this.multiple&&this.button.disable(),this.$(".ui-list-portlet").show()):(this.button.enable(),this.$(".ui-list-portlet").hide()),this.options.onchange&&this.options.onchange()},_template:function(t){return'
'},_templateRow:function(t){return'
'+t.name+"
"}});return{View:n}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(o,a){n=[i(4),i(16)],s=function(t,e){var i=o.View.extend({initialize:function(i){var n=this;this.options=t.merge(i,{visible:!0,data:[],id:t.uid(),error_text:"No options available.",wait_text:"Please wait...",multiple:!1}),this.setElement(''),this.$message=a(""),this.$options=a(this._template(i)),this.$menu=a(''),this.$el.append(this.$message),this.$el.append(this.$menu),this.$el.append(this.$options),this.options.multiple&&(this.all_button=new e.ButtonCheck({onclick:function(){n.$("input").prop("checked",0!==n.all_button.value()),n.trigger("change")}}),this.$menu.append(this.all_button.$el)),this.options.visible||this.$el.hide(),this.update(this.options.data),void 0!==this.options.value&&this.value(this.options.value),this.on("change",function(){this.options.onchange&&this.options.onchange(this.value())})},update:function(t){var e=this._getValue();if(this.$options.empty(),this._templateOptions)this.$options.append(this._templateOptions(t));else for(var i in t){var n=a(this._templateOption(t[i]));n.addClass("ui-option"),n.tooltip({title:t[i].tooltip,placement:"bottom"}),this.$options.append(n)}var s=this;this.$("input").on("change",function(){s.value(s._getValue()),s.trigger("change")}),this.value(e),this.unwait()},value:function(t){if(void 0!==t&&(this.$("input").prop("checked",!1),null!==t)){t instanceof Array||(t=[t]);for(var e in t)this.$('input[value="'+t[e]+'"]').first().prop("checked",!0)}var i=this._getValue();if(this.all_button){var n=i;n=n instanceof Array?n.length:0,this.all_button.value(n,this._size())}return i},exists:function(t){if(void 0!==t){t instanceof Array||(t=[t]);for(var e in t)if(this.$('input[value="'+t[e]+'"]').length>0)return!0}return!1},first:function(){var t=this.$("input").first();return t.length>0?t.val():null},wait:function(){0==this._size()&&(this._messageShow(this.options.wait_text,"info"),this.$options.hide(),this.$menu.hide())},unwait:function(){var t=this._size();0==t?(this._messageShow(this.options.error_text,"danger"),this.$options.hide(),this.$menu.hide()):(this._messageHide(),this.$options.css("display","inline-block"),this.$menu.show())},_getValue:function(){var e=[];return this.$(":checked").each(function(){e.push(a(this).val())}),t.validate(e)?this.options.multiple?e:e[0]:null},_size:function(){return this.$(".ui-option").length},_messageShow:function(t,e){this.$message.show(),this.$message.removeClass(),this.$message.addClass("ui-message alert alert-"+e),this.$message.html(t)},_messageHide:function(){this.$message.hide()},_template:function(){return''}}),n=i.extend({_templateOption:function(e){var i=t.uid();return'"}}),s={};s.View=n.extend({initialize:function(t){t.type="radio",n.prototype.initialize.call(this,t)}});var r={};r.View=n.extend({initialize:function(t){t.multiple=!0,t.type="checkbox",n.prototype.initialize.call(this,t)}});var l={};return l.View=i.extend({initialize:function(t){i.prototype.initialize.call(this,t)},value:function(t){return void 0!==t&&(this.$("input").prop("checked",!1),this.$("label").removeClass("active"),this.$('[value="'+t+'"]').prop("checked",!0).closest("label").addClass("active")),this._getValue()},_templateOption:function(t){var e="fa "+t.icon;t.label||(e+=" no-padding");var i='"},_template:function(){return''}}),{Base:i,BaseIcons:n,Radio:s,RadioButton:l,Checkbox:r}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s,o;(function(i,a){!function(i,a){s=[],n=a,o="function"==typeof n?n.apply(e,s):n,!(void 0!==o&&(t.exports=o))}(this,function(){var t=function(t){t=t||{},t.tooltipConfig=t.tooltipConfig||{placement:"bottom"},t.classes=["icon-btn"].concat(t.classes||[]),t.disabled&&t.classes.push("disabled");var e=['','',""].join(""),n=i(e).tooltip(t.tooltipConfig);return a.isFunction(t.onclick)&&n.click(t.onclick),n};return t})}).call(e,i(1),i(3))},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t,e,i){this.helpers=t||{},this.partials=e||{},this.decorators=i||{},l.registerDefaultHelpers(this),c.registerDefaultDecorators(this)}e.__esModule=!0,e.HandlebarsEnvironment=s;var o=i(8),a=i(9),r=n(a),l=i(70),c=i(68),d=i(78),h=n(d),u="4.0.5";e.VERSION=u;var p=7;e.COMPILER_REVISION=p;var f={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};e.REVISION_CHANGES=f;var g="[object Object]";s.prototype={constructor:s,logger:h["default"],log:h["default"].log,registerHelper:function(t,e){if(o.toString.call(t)===g){if(e)throw new r["default"]("Arg not supported with multiple helpers");o.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(o.toString.call(t)===g)o.extend(this.partials,t);else{if("undefined"==typeof e)throw new r["default"]('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(o.toString.call(t)===g){if(e)throw new r["default"]("Arg not supported with multiple decorators");o.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]}};var m=h["default"].log;e.log=m,e.createFrame=o.createFrame,e.logger=h["default"]},,function(t,e,i){var n,s;(function(o,a,r){n=[i(4)],s=function(t){var e=o.View.extend({optionsDefault:{with_close:!0,title:null,placement:"top",container:"body",body:null},initialize:function(e){this.setElement(this._template()),this.uid=t.uid(),this.options=a.defaults(e||{},this.optionsDefault),this.options.container.parent().append(this.el),this.$title=this.$(".popover-title-label"),this.$close=this.$(".popover-close"),this.$body=this.$(".popover-content"),this.options.body&&this.append(this.options.body);var i=this;r("body").on("mousedown."+this.uid,function(t){i.visible&&!r(i.options.container).is(t.target)&&!r(i.el).is(t.target)&&0===r(i.el).has(t.target).length&&i.hide()})},render:function(){this.$title.html(this.options.title),this.$el.removeClass().addClass("ui-popover popover fade in").addClass(this.options.placement),this.$el.css(this._get_placement(this.options.placement));var t=this;this.options.with_close?this.$close.on("click",function(){t.hide()}).show():this.$close.off().hide()},title:function(t){void 0!==t&&(this.options.title=t,this.$title.html(t))},show:function(){this.render(),this.$el.show(),this.visible=!0},hide:function(){this.$el.hide(),this.visible=!1},append:function(t){this.$body.append(t)},empty:function(){this.$body.empty()},remove:function(){r("body").off("mousedown."+this.uid),this.$el.remove()},_get_placement:function(t){var e=this._get_width(this.$el),i=this.$el.height(),n=this.options.container,s=this._get_width(n),o=this._get_height(n),a=n.position(),r=left=0;if(-1!=["top","bottom"].indexOf(t))switch(left=a.left-e+(s+e)/2,t){case"top":r=a.top-i-5;break;case"bottom":r=a.top+o+5}else switch(r=a.top-i+(o+i)/2,t){case"right":left=a.left+s}return{top:r,left:left}},_get_width:function(t){return t.width()+parseInt(t.css("padding-left"))+parseInt(t.css("margin-left"))+parseInt(t.css("padding-right"))+parseInt(t.css("margin-right"))},_get_height:function(t){return t.height()+parseInt(t.css("padding-top"))+parseInt(t.css("padding-bottom"))},_template:function(t){return'
'}});return{View:e}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1))},function(t,e,i){var n,s;(function(o){n=[i(4)],s=function(t){var e=o.View.extend({optionsDefault:{css:"",placeholder:"No data available",data:[],value:null,multiple:!1,minimumInputLength:0,initialData:""},initialize:function(e){if(this.options=t.merge(e,this.optionsDefault),this.setElement(this._template(this.options)),!this.options.container)return void console.log("ui-select::initialize() : container not specified.");if(this.options.container.append(this.$el),this.select_data=this.options.data,this._refresh(),!this.options.multiple){this.options.value&&this._setValue(this.options.value);var i=this;this.options.onchange&&this.$el.on("change",function(){i.options.onchange(i.value())})}},value:function(t){var e=this._getValue();void 0!==t&&this._setValue(t);var i=this._getValue();return i!=e&&this.options.onchange&&this.options.onchange(i),i},text:function(){return this.$el.select2("data").text},disabled:function(){return!this.$el.select2("enable")},enable:function(){this.$el.select2("enable",!0)},disable:function(){this.$el.select2("enable",!1)},add:function(t){this.select_data.push({id:t.id,text:t.text}),this._refresh()},del:function(t){var e=this._getIndex(t);-1!=e&&(this.select_data.splice(e,1),this._refresh())},remove:function(){this.$el.select2("destroy")},update:function(t){this.select_data=[];for(var e in t.data)this.select_data.push(t.data[e]);this._refresh()},_refresh:function(){if(this.options.multiple){var t={multiple:this.options.multiple,containerCssClass:this.options.css,placeholder:this.options.placeholder,minimumInputLength:this.options.minimumInputLength,ajax:this.options.ajax,dropdownCssClass:this.options.dropdownCssClass,escapeMarkup:this.options.escapeMarkup,formatResult:this.options.formatResult,formatSelection:this.options.formatSelection,initSelection:this.options.initSelection,initialData:this.options.initialData};this.$el.select2(t)}else{var e=this._getValue(),t={data:this.select_data,containerCssClass:this.options.css,placeholder:this.options.placeholder,dropdownAutoWidth:!0};this.$el.select2(t),this._setValue(e)}},_getIndex:function(t){for(var e in this.select_data)if(this.select_data[e].id==t)return e;return-1},_getValue:function(){return this.$el.select2("val")},_setValue:function(t){var e=this._getIndex(t);-1==e&&this.select_data.length>0&&(t=this.select_data[0].id),this.$el.select2("val",t)},_template:function(t){return''}});return{View:e}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;(function(o,a,r){n=[i(4)],s=function(t){var e=o.View.extend({optionsDefault:{title_new:"",operations:null,onnew:null,max:null,onchange:null},initialize:function(e){this.visible=!1,this.$nav=null,this.$content=null,this.first_tab=null,this.current_id=null,this.options=t.merge(e,this.optionsDefault);var i=a(this._template(this.options));this.$nav=i.find(".tab-navigation"),this.$content=i.find(".tab-content"),this.setElement(i),this.list={};var n=this;if(this.options.operations&&a.each(this.options.operations,function(t,e){e.$el.prop("id",t),n.$nav.find(".operations").append(e.$el)}),this.options.onnew){var s=a(this._template_tab_new(this.options));this.$nav.append(s),s.tooltip({title:"Add a new tab",placement:"bottom",container:n.$el}),s.on("click",function(t){s.tooltip("hide"),n.options.onnew()})}},size:function(){return r.size(this.list)},current:function(){return this.$el.find(".tab-pane.active").attr("id")},add:function(t){var e=this,i=t.id,n=a(this._template_tab(t)),s=a(this._template_tab_content(t));if(this.list[i]=t.ondel?!0:!1,this.options.onnew?this.$nav.find("#new-tab").before(n):this.$nav.append(n),s.append(t.$el),this.$content.append(s),1==this.size()&&(n.addClass("active"),s.addClass("active"),this.first_tab=i),this.options.max&&this.size()>=this.options.max&&this.$el.find("#new-tab").hide(),t.ondel){var o=n.find("#delete");o.tooltip({title:"Delete this tab",placement:"bottom",container:e.$el}),o.on("click",function(){return o.tooltip("destroy"),e.$el.find(".tooltip").remove(),t.ondel(),!1})}n.on("click",function(n){n.preventDefault(),t.onclick?t.onclick():e.show(i)}),this.current_id||(this.current_id=i)},del:function(t){this.$el.find("#tab-"+t).remove(),this.$el.find("#"+t).remove(),this.first_tab==t&&(this.first_tab=null),null!=this.first_tab&&this.show(this.first_tab),this.list[t]&&delete this.list[t],this.size()
',"Warning: This is a experimental feature. Most Galaxy tools will not annotate"," citations explicitly at this time. When writing up your analysis, please manually"," review your histories and find all references"," that should be cited in order to completely describe your work. Also, please remember to",' cite Galaxy.',"
"],"element");return o.extend({},e.DatasetListItemView.prototype.templates,{titleBar:t})}();var u=c.extend({className:c.prototype.className+" dataset-collection-element",_swapNewRender:function(t){c.prototype._swapNewRender.call(this,t);var e=this.model.get("state")||"ok";return this.$el.addClass("state-"+e),this.$el},toString:function(){var t=this.model?this.model+"":"(no model)";return"NestedDCDCEListItemView("+t+")"}});return{DCListItemView:c,DCEListItemView:d,DatasetDCEListItemView:h,NestedDCDCEListItemView:u}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3),i(1),i(1))},function(t,e,i){var n,s;(function(o,a,r){n=[i(95),i(6),i(5)],s=function(t,e,i){var n="collections",s={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(t){return o.extend(t,t.object,{element_id:t.id}),delete t.object,t},constructor:function(t,e){t=this._mergeObject(t),this.idAttribute="element_id",a.Model.apply(this,arguments)},parse:function(t,e){var i=t;return i=this._mergeObject(i)}},l=a.Model.extend(e.LoggableMixin).extend(s).extend({_logNamespace:n}),c=a.Collection.extend(e.LoggableMixin).extend({_logNamespace:n,model:l,initialize:function(t,e){this.debug(this+"(DCECollection).initialize:",t,e),e=e||{}},toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),d=t.DatasetAssociation.extend(e.mixin(s,{url:function(){return this.has("history_id")?Galaxy.root+"api/histories/"+this.get("history_id")+"/contents/"+this.get("id"):(console.warn("no endpoint for non-hdas within a collection yet"),Galaxy.root+"api/datasets")},defaults:o.extend({},t.DatasetAssociation.prototype.defaults,s.defaults),constructor:function(t,e){this.debug(" DatasetDCE.constructor:",t,e),s.constructor.call(this,t,e)},initialize:function(e,i){this.debug(this+"(DatasetDCE).initialize:",e,i),t.DatasetAssociation.prototype.initialize.call(this,e,i)},hasDetails:function(){return o.has(this.attributes,"annotation")},toString:function(){var t=this.get("element_identifier");return["DatasetDCE(",t,")"].join("")}})),h=c.extend({model:d,initialize:function(t,e){this.debug(this+"(DatasetDCECollection).initialize:",t,e),c.prototype.initialize.call(this,t,e)},toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),u=a.Model.extend(e.LoggableMixin).extend(e.SearchableModelMixin).extend({_logNamespace:n,defaults:{collection_type:null,deleted:!1},collectionClass:c,initialize:function(t,e){this.debug(this+"(DatasetCollection).initialize:",t,e,this),this.elements=this._createElementsModel(),this.on("change:elements",function(){this.log("change:elements"),this.elements=this._createElementsModel()})},_createElementsModel:function(){this.debug(this+"._createElementsModel",this.collectionClass,this.get("elements"),this.elements);var t=this.get("elements")||[];return this.unset("elements",{silent:!0}),this.elements=new this.collectionClass(t),this.elements},toJSON:function(){var t=a.Model.prototype.toJSON.call(this);return this.elements&&(t.elements=this.elements.toJSON()),t},inReadyState:function(){var t=this.get("populated");return this.isDeletedOrPurged()||t},hasDetails:function(){return this.debug("hasDetails:",this.elements.length),0!==this.elements.length},getVisibleContents:function(t){return this.elements},"delete":function(t){return this.get("deleted")?r.when():this.save({deleted:!0},t)},undelete:function(t){return!this.get("deleted")||this.get("purged")?r.when():this.save({deleted:!1},t)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name"],toString:function(){var t=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+t.join(",")+")"}}),p=u.extend({collectionClass:h,initialize:function(t,e){this.debug(this+"(ListDatasetCollection).initialize:",t,e),u.prototype.initialize.call(this,t,e)},toString:function(){return["ListDatasetCollection(",this.get("name"),")"].join("")}}),f=p.extend({initialize:function(t,e){this.debug(this+"(PairDatasetCollection).initialize:",t,e),p.prototype.initialize.call(this,t,e)},toString:function(){return["PairDatasetCollection(",this.get("name"),")"].join("")}}),g=u.extend(e.mixin(s,{constructor:function(t,e){this.debug(" NestedDCDCE.constructor:",t,e),s.constructor.call(this,t,e)},toString:function(){var t=this.object?""+this.object:this.get("element_identifier");return["NestedDCDCE(",t,")"].join("")}})),m=c.extend({model:g,initialize:function(t,e){this.debug(this+"(NestedDCDCECollection).initialize:",t,e),c.prototype.initialize.call(this,t,e)},toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}}),v=f.extend(e.mixin(s,{constructor:function(t,e){this.debug(" NestedPairDCDCE.constructor:",t,e),s.constructor.call(this,t,e)},toString:function(){var t=this.object?""+this.object:this.get("element_identifier");return["NestedPairDCDCE(",t,")"].join("")}})),_=m.extend({model:v,initialize:function(t,e){this.debug(this+"(NestedPairDCDCECollection).initialize:",t,e),m.prototype.initialize.call(this,t,e)},toString:function(){return["NestedPairDCDCECollection(",this.length,")"].join("")}}),y=u.extend({collectionClass:_,initialize:function(t,e){this.debug(this+"(ListPairedDatasetCollection).initialize:",t,e),u.prototype.initialize.call(this,t,e)},toString:function(){return["ListPairedDatasetCollection(",this.get("name"),")"].join("")}});return{ListDatasetCollection:p,PairDatasetCollection:f,ListPairedDatasetCollection:y}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3),i(2),i(1))},function(t,e,i){var n,s;(function(o,a,r,l){n=[i(45),i(15),i(6),i(10),i(110),i(5),i(107)],s=function(t,e,i,n,s,c){function d(t){var e=t.toJSON(),i=g(e,{creationFn:function(e,i){return e=e.map(function(t){return{id:t.id,name:t.name,src:"dataset"===t.history_content_type?"hda":"hdca"}}),t.createHDCA(e,"list",i)}});return i}var h="collections",u=o.View.extend(i.LoggableMixin).extend({_logNamespace:h,tagName:"li",className:"collection-element",initialize:function(t){this.element=t.element||{},this.selected=t.selected||!1},render:function(){return this.$el.attr("data-element-id",this.element.id).attr("draggable",!0).html(this.template({element:this.element})),this.selected&&this.$el.addClass("selected"),this},template:a.template(['',"<%- element.name %>","",'"].join("")),select:function(t){this.$el.toggleClass("selected",t),this.trigger("select",{source:this,selected:this.$el.hasClass("selected")})},discard:function(){var t=this,e=this.$el.parent().width();this.$el.animate({"margin-right":e},"fast",function(){t.trigger("discard",{source:t}),t.destroy()})},destroy:function(){this.off(),this.$el.remove()},events:{click:"_click","click .name":"_clickName","click .discard":"_clickDiscard",dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_click:function(t){t.stopPropagation(),this.select(t)},_clickName:function(t){t.stopPropagation(),t.preventDefault();var e=([c("Enter a new name for the element"),":\n(",c("Note that changing the name here will not rename the dataset"),")"].join(""),prompt(c("Enter a new name for the element")+":",this.element.name));e&&(this.element.name=e,this.render())},_clickDiscard:function(t){t.stopPropagation(),this.discard()},_dragstart:function(t){t.originalEvent&&(t=t.originalEvent),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",JSON.stringify(this.element)),this.$el.addClass("dragging"),this.$el.parent().trigger("collection-element.dragstart",[this])},_dragend:function(t){this.$el.removeClass("dragging"),this.$el.parent().trigger("collection-element.dragend",[this])},_sendToParent:function(t){this.$el.parent().trigger(t)},toString:function(){return"DatasetCollectionElementView()"}}),p=o.View.extend(i.LoggableMixin).extend({_logNamespace:h,elementViewClass:u,collectionClass:t.HistoryListDatasetCollection,className:"list-collection-creator collection-creator flex-row-container",minElements:1,defaultAttributes:{creationFn:function(){throw new TypeError("no creation fn for creator")},oncreate:function(){},oncancel:function(){},autoscrollDist:24,highlightClr:"rgba( 64, 255, 255, 1.0 )"},initialize:function(t){this.metric("ListCollectionCreator.initialize",t);var e=this;a.each(this.defaultAttributes,function(i,n){i=t[n]||i,e[n]=i}),e.initialElements=t.elements||[],this._instanceSetUp(),this._elementsSetUp(),this._setUpBehaviors()},_instanceSetUp:function(){this.selectedIds={},this.$dragging=null,this.blocking=!1},_elementsSetUp:function(){this.invalidElements=[],this.workingElements=[],this.elementViews=[],this.workingElements=this.initialElements.slice(0),this._ensureElementIds(),this._validateElements(),this._mangleDuplicateNames(),this._sortElements()},_ensureElementIds:function(){return this.workingElements.forEach(function(t){t.hasOwnProperty("id")||(t.id=a.uniqueId())}),this.workingElements},_validateElements:function(){var t=this;return t.invalidElements=[],this.workingElements=this.workingElements.filter(function(e){var i=t._isElementInvalid(e);return i&&t.invalidElements.push({element:e,text:i}),!i}),this.workingElements},_isElementInvalid:function(t){return"dataset"!==t.history_content_type?c("is not a dataset"):t.state!==e.OK?c(a.contains(e.NOT_READY_STATES,t.state)?"hasn't finished running yet":"has errored, is paused, or is not accessible"):t.deleted||t.purged?c("has been deleted or purged"):null},_mangleDuplicateNames:function(){var t=900,e=1,i={};this.workingElements.forEach(function(n){for(var s=n.name;i.hasOwnProperty(s);)if(s=n.name+" ("+e+")",e+=1,e>=t)throw new Error("Safety hit in while loop - thats impressive");n.name=s,i[n.name]=!0})},_sortElements:function(t){},render:function(t,e){return this.workingElements.length .clear-selected").show():this.$(".collection-elements-controls > .clear-selected").hide()},_renderList:function(t,e){var i=this,n=l(""),s=i.$list();a.each(this.elementViews,function(t){t.destroy(),i.removeElementView(t)}),i.workingElements.forEach(function(t){var e=i._createElementView(t);n.append(e.$el)}),i._renderClearSelected(),s.empty().append(n.children()),a.invoke(i.elementViews,"render"),s.height()>s.css("max-height")?s.css("border-width","1px 0px 1px 0px"):s.css("border-width","0px")},_createElementView:function(t){var e=new this.elementViewClass({element:t,selected:a.has(this.selectedIds,t.id)});return this.elementViews.push(e),this._listenToElementView(e),e},_listenToElementView:function(t){var e=this;e.listenTo(t,{select:function(t){var i=t.source.element;t.selected?e.selectedIds[i.id]=!0:delete e.selectedIds[i.id],e.trigger("elements:select",t)},discard:function(t){e.trigger("elements:discard",t)}})},addElementView:function(t){},removeElementView:function(t){delete this.selectedIds[t.element.id],this._renderClearSelected(),this.elementViews=a.without(this.elementViews,t),this.stopListening(t)},_renderNoElementsLeft:function(){this._disableNameAndCreate(!0),this.$(".collection-elements").append(this.templates.noElementsLeft())},_elementToJSON:function(t){return t},createList:function(t){if(!this.workingElements.length){var e=c("No valid elements for final list")+". ";return e+=''+c("Cancel")+" ",e+=c("or"),e+=' '+c("start over")+".",void this._showAlert(e)}var i=this,n=this.workingElements.map(function(t){return i._elementToJSON(t)});return i.blocking=!0,i.creationFn(n,t).always(function(){i.blocking=!1}).fail(function(t,e,n){i.trigger("error",{xhr:t,status:e,message:c("An error occurred while creating this collection")})}).done(function(t,e,n){i.trigger("collection:created",t,e,n),i.metric("collection:created",t),"function"==typeof i.oncreate&&i.oncreate.call(this,t,e,n)})},_setUpBehaviors:function(){return this.on("error",this._errorHandler),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("elements:select",function(t){this._renderClearSelected()}),this.on("elements:discard",function(t){var e=t.source.element;this.removeElementView(t.source),this.workingElements=a.without(this.workingElements,e),this.workingElements.length||this._renderNoElementsLeft()}),this},_errorHandler:function(t){this.error(t);var e=this;if(content=t.message||c("An error occurred"),t.xhr){var i=t.xhr,n=t.message;0===i.readyState&&0===i.status?content+=": "+c("Galaxy could not be reached and may be updating.")+c(" Try again in a few minutes."):i.responseJSON?content+=":
",c(["Collections of datasets are permanent, ordered lists of datasets that can be passed to tools and ","workflows in order to have analyses done on each member of the entire group. This interface allows ","you to create a collection and re-order the final collection."].join("")),"
","
","
",c(["Rename elements in the list by clicking on ",'the existing name.'].join("")),"
","
",c(["Discard elements from the final created list by clicking on the ",'"Discard" button.'].join("")),"
","
",c(["Reorder the list by clicking and dragging elements. Select multiple elements by clicking on ",'them and you can then move those selected by dragging the ',"entire group. Deselect them by clicking them again or by clicking the ",'the "Clear selected" link.'].join("")),"
","
",c(['Click the "Start over" link to begin again as if you had just opened ',"the interface."].join("")),"
","
",c(['Click the "Cancel" button to exit the interface.'].join("")),"
","
","
",c(['Once your collection is complete, enter a name and ','click "Create list".'].join("")),"
"].join("")),invalidElements:a.template([c("The following selections could not be included due to problems:"),"
','',"<% if( _.size( problems ) ){ %>",c("The following selections could not be included due to problems"),":","
<% _.each( problems, function( problem ){ %>","
<%- problem.element.name %>: <%- problem.text %>
","<% }); %>
","<% } else if( _.size( elements ) < 1 ){ %>",c("No datasets were selected"),".","<% } %>"," ",c("At least one element is needed for the collection"),". ",c("You may need to "),'',c("cancel")," ",c("and reselect new elements"),".","","
","
",'"].join(""))},toString:function(){return"ListCollectionCreator"}}),f=function(t,e,i){var s,o=l.Deferred(),r=Galaxy.modal||new n.View;return e=a.defaults(e||{},{elements:t,oncancel:function(){r.hide(),o.reject("cancelled")},oncreate:function(t,e){r.hide(),o.resolve(e)}}),s=new i(e),r.show({title:e.title||c("Create a collection"),body:s.$el,width:"80%",height:"100%",closing_events:!0}),s.render(),window._collectionCreator=s,o},g=function(t,e){return e=e||{},e.title=c("Create a collection from a list of datasets"),f(t,e,p)};return{DatasetCollectionElementView:u,ListCollectionCreator:p,collectionCreatorModal:f,listCollectionCreatorModal:g,createListCollection:d}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1),i(1))},function(t,e,i){var n,s;(function(o,a,r,l){n=[i(48),i(15),i(26),i(6),i(5)],s=function(t,e,i,n,s){var c="dataset",d=t.ListItemView,h=d.extend({_logNamespace:c,className:d.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(t){t.logger&&(this.logger=this.model.logger=t.logger),this.log(this+".initialize:",t),d.prototype.initialize.call(this,t),this.linkTarget=t.linkTarget||"_blank"},_setUpListeners:function(){d.prototype._setUpListeners.call(this),
-this.model.on("change",function(t,e){this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()?this.model.fetch():this.render()},this)},_fetchModelDetails:function(){var t=this;return t.model.inReadyState()&&!t.model.hasDetails()?t.model.fetch({silent:!0}):o.when()},remove:function(t,e){var i=this;t=t||this.fxSpeed,this.$el.fadeOut(t,function(){a.View.prototype.remove.call(i),e&&e.call(i)})},render:function(t){return d.prototype.render.call(this,t)},_swapNewRender:function(t){return d.prototype._swapNewRender.call(this,t),this.model.has("state")&&this.$el.addClass("state-"+this.model.get("state")),this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var t=this.model.get("state");if(t===e.NOT_VIEWABLE||t===e.DISCARDED||!this.model.get("accessible"))return null;var n={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged"))n.disabled=!0,n.title=s("Cannot display datasets removed from disk");else if(t===e.UPLOAD)n.disabled=!0,n.title=s("This dataset must finish uploading before it can be viewed");else if(t===e.NEW)n.disabled=!0,n.title=s("This dataset is not yet viewable");else{n.title=s("View data"),n.href=this.model.urls.display;var o=this;n.onclick=function(t){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.addDataset(o.model.get("id")),t.preventDefault())}}return n.faIcon="fa-eye",i(n)},_renderDetails:function(){if(this.model.get("state")===e.NOT_VIEWABLE)return r(this.templates.noAccess(this.model.toJSON(),this));var t=d.prototype._renderDetails.call(this);return t.find(".actions .left").empty().append(this._renderSecondaryActions()),t.find(".summary").html(this._renderSummary()).prepend(this._renderDetailMessages()),t.find(".display-applications").html(this._renderDisplayApplications()),this._setUpBehaviors(t),t},_renderSummary:function(){var t=this.model.toJSON(),e=this.templates.summaries[t.state];return(e=e||this.templates.summaries.unknown)(t,this)},_renderDetailMessages:function(){var t=this,e=r(''),i=t.model.toJSON();return l.each(t.templates.detailMessages,function(n){e.append(r(n(i,t)))}),e},_renderDisplayApplications:function(){return this.model.isDeletedOrPurged()?"":[this.templates.displayApplications(this.model.get("display_apps"),this),this.templates.displayApplications(this.model.get("display_types"),this)].join("")},_renderSecondaryActions:function(){switch(this.debug("_renderSecondaryActions"),this.model.get("state")){case e.NOT_VIEWABLE:return[];case e.OK:case e.FAILED_METADATA:case e.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return i({title:s("View details"),classes:"params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_renderDownloadButton:function(){return this.model.get("purged")||!this.model.hasData()?null:l.isEmpty(this.model.get("meta_files"))?r(['','',""].join("")):this._renderMetaFileDownloadButton()},_renderMetaFileDownloadButton:function(){var t=this.model.urls;return r(['
"}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;(function(o,a){n=[i(4),i(7),i(43),i(56),i(55),i(52)],s=function(t,e,i,n,s,r){return o.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},initialize:function(t,e){this.app=t},create:function(t){void 0===t.value&&(t.value=null),void 0===t.default_value&&(t.default_value=t.value);var e=null,i=this.types[t.type];return i&&"function"==typeof this[i]&&(e=this[i].call(this,t)),e||(this.app.incompatible=!0,e=t.options?this._fieldSelect(t):this._fieldText(t),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+t.type+").")),void 0!==t.value&&e.value(t.value),e},_fieldData:function(t){var e=this;return new i.View(this.app,{id:"field-"+t.id,extensions:t.extensions,optional:t.optional,multiple:t.multiple,type:t.type,data:t.options,onchange:function(){e.app.trigger("change")}})},_fieldSelect:function(t){if(t.is_workflow)return this._fieldText(t);"data_column"==t.type&&(t.error_text="Missing columns in referenced dataset.");var i=[];for(var n in t.options){var s=t.options[n];i.push({label:s[0],value:s[1]})}var o=e.Select;switch(t.display){case"checkboxes":o=e.Checkbox;break;case"radio":o=e.Radio}var a=this;return new o.View({id:"field-"+t.id,data:i,error_text:t.error_text||"No options available",optional:t.optional&&null===t.default_value,multiple:t.multiple,optional:t.optional,searchable:t.searchable,onchange:function(){a.app.trigger("change")}})},_fieldDrilldown:function(t){if(t.is_workflow)return this._fieldText(t);var i=this;return new e.Drilldown.View({id:"field-"+t.id,data:t.options,display:t.display,onchange:function(){i.app.trigger("change")}})},_fieldText:function(i){if(i.options)if(i.area=i.multiple,t.validate(i.value)){if(a.isArray(i.value)){var n="";for(var s in i.value){if(n+=String(i.value[s]),!i.multiple)break;n+="\n"}i.value=n}}else i.value=null;var o=this;return new e.Input({id:"field-"+i.id,area:i.area,onchange:function(t){i.onchange?i.onchange(t):o.app.trigger("change")}})},_fieldSlider:function(t){var i=this;return new e.Slider.View({id:"field-"+t.id,precise:"float"==t.type,is_workflow:t.is_workflow,min:t.min,max:t.max,onchange:function(){i.app.trigger("change")}})},_fieldHidden:function(t){return new e.Hidden({id:"field-"+t.id,info:t.info})},_fieldBoolean:function(t){var i=this;return new e.RadioButton.View({id:"field-"+t.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){i.app.trigger("change")}})},_fieldColor:function(t){var e=this;return new r({id:"field-"+t.id,onchange:function(){e.app.trigger("change")}})},_fieldLibrary:function(t){var e=this;return new n.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:function(){e.app.trigger("change")}})},_fieldFtp:function(t){var e=this;return new s.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:function(){e.app.trigger("change")}})}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(o,a,r){n=[i(4),i(17),i(11),i(7)],s=function(t,e,i,n){var s=o.View.extend({initialize:function(i){this.options=t.merge(i,{title:"Section",empty_text:"Not available.",max:null,min:null}),this.setElement(""),this.button_new=new n.ButtonIcon({icon:"fa-plus",title:"Insert "+this.options.title_new,tooltip:"Add new "+this.options.title_new+" block",floating:"clear",onclick:function(){i.onnew&&i.onnew()}}),this.table=new e.View({cls:"ui-table-plain",content:""}),this.$el.append(this.table.$el),this.$el.append(a("").append(this.button_new.$el)),this.list={},this.n=0},size:function(){return this.n},add:function(t){if(!t.id||this.list[t.id])return void Galaxy.emit.debug("form-repeat::add()","Duplicate repeat block id.");this.n++;var e=new n.ButtonIcon({icon:"fa-trash-o",tooltip:"Delete this repeat block",cls:"ui-button-icon-plain",onclick:function(){t.ondel&&t.ondel()}}),s=new i.View({id:t.id,title:"placeholder",cls:"ui-portlet-repeat",operations:{button_delete:e}});s.append(t.$el),s.$el.addClass("section-row"),this.list[t.id]=s,this.table.add(s.$el),this.table.append("row_"+t.id,!0),this.options.max>0&&this.n>=this.options.max&&this.button_new.disable(),this._refresh()},del:function(t){if(!this.list[t])return void Galaxy.emit.debug("form-repeat::del()","Invalid repeat block id.");this.n--;var e=this.table.get("row_"+t);e.remove(),delete this.list[t],this.button_new.enable(),this._refresh()},hideOptions:function(){this.button_new.$el.hide(),r.each(this.list,function(t){t.hideOperation("button_delete")}),r.isEmpty(this.list)&&this.$el.append(a("").addClass("ui-form-info").html(this.options.empty_text))},_refresh:function(){var t=0;for(var e in this.list){var i=this.list[e];i.title(++t+": "+this.options.title),this.n>this.options.min?i.showOperation("button_delete"):i.hideOperation("button_delete")}}});return{View:s}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3))},function(t,e,i){var n,s;(function(o,a,r,l){n=[i(4),i(17),i(7),i(11),i(41),i(39),i(40)],s=function(t,e,i,n,s,c,d){var h=o.View.extend({initialize:function(t,i){this.app=t,this.inputs=i.inputs,i.cls="ui-table-plain",i.cls_tr="section-row",this.table=new e.View(i),this.parameters=new d(t,i),this.setElement(this.table.$el),this.render()},render:function(){this.table.delAll();for(var t in this.inputs)this.add(this.inputs[t])},add:function(e){var i=a.extend(!0,{},e);i.id=e.id=t.uid(),this.app.input_list[i.id]=i;var n=i.type;switch(n){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(t){var e=this;t.test_param.id=t.id,this.app.options.sustain_conditionals&&(t.test_param.disabled=!0);var i=this._addRow(t.test_param);i.options.onchange=function(i){var n=e.app.data.matchCase(t,i);for(var s in t.cases){var o=t.cases[s],a=t.id+"-section-"+s,r=e.table.get(a),l=!1;for(var c in o.inputs)if(!o.inputs[c].hidden){l=!0;break}s==n&&l?r.fadeIn("fast"):r.hide()}e.app.trigger("change")};for(var n in t.cases){var s=t.id+"-section-"+n,o=new h(this.app,{inputs:t.cases[n].inputs});o.$el.addClass("ui-table-section"),this.table.add(o.$el),this.table.append(s)}i.trigger("change")},_addRepeat:function(t){function e(e){var s=t.id+"-section-"+n++,a=new h(i.app,{inputs:e});o.add({id:s,$el:a.$el,ondel:function(){o.del(s),i.app.trigger("change")}})}for(var i=this,n=0,o=new s.View({title:t.title||"Repeat",title_new:t.title||"",min:t.min,max:t.max,onnew:function(){e(t.inputs),i.app.trigger("change")}}),a=t.min,l=r.size(t.cache),d=0;dd?t.cache[d]:t.inputs,e(u)}this.app.options.sustain_repeats&&o.hideOptions();var p=new c(this.app,{label:t.title||t.name,help:t.help,field:o});this.table.add(p.$el),this.table.append(t.id)},_addSection:function(t){var e=this,s=new h(e.app,{inputs:t.inputs}),o=new i.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"}),a=new n.View({title:t.title||t.name,cls:"ui-portlet-section",collapsible:!0,collapsed:!0,operations:{button_visible:o}});a.append(s.$el),a.append(l("").addClass("ui-form-info").html(t.help)),a.setOperation("button_visible",function(){a.collapsed?a.expand():a.collapse()}),a.on("expanded",function(){o.setIcon("fa-eye")}),a.on("collapsed",function(){o.setIcon("fa-eye-slash")}),this.app.on("expand",function(t){a.$("#"+t).length>0&&a.expand()}),t.expanded&&a.expand(),this.table.add(a.$el),this.table.append(t.id)},_addRow:function(t){var e=t.id,i=this.parameters.create(t);this.app.field_list[e]=i;var n=new c(this.app,{name:t.name,label:t.label||t.name,value:t.value,default_value:t.default_value,text_value:t.text_value||t.value,collapsible_value:t.collapsible_value,collapsible_preview:t.collapsible_preview,help:t.help,argument:t.argument,disabled:t.disabled,field:i});return this.app.element_list[e]=n,this.table.add(n.$el),this.table.append(e),t.hidden&&this.table.get(e).hide(),i}});return{View:h}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3),i(1))},function(t,e,i){var n,s;(function(o,a,r){n=[i(4),i(7),i(31)],s=function(t,e,i){var n=o.View.extend({initialize:function(i,n){this.app=i,this.options=n,this.history={};var s=this;this.setElement(''),this.list={};var o=[];"data_collection"==n.type?this.mode="collection":n.multiple?this.mode="multiple":this.mode="single",this.current=this.mode,this.list={};var l=t.textify(n.extensions),c="No dataset available.";l&&(c="No "+l+" dataset available.");var d="No dataset list available.";if(l&&(d="No "+l+" dataset collection available."),"single"==this.mode&&(o.push({icon:"fa-file-o",value:"single",tooltip:"Single dataset"}),this.select_single=new e.Select.View({optional:n.optional,error_text:c,onchange:function(){s.trigger("change")}}),this.list.single={field:this.select_single,type:"hda"}),("single"==this.mode||"multiple"==this.mode)&&(o.push({icon:"fa-files-o",value:"multiple",tooltip:"Multiple datasets"}),this.select_multiple=new e.Select.View({multiple:!0,searchable:!1,optional:n.optional,error_text:c,onchange:function(){s.trigger("change")}}),this.list.multiple={field:this.select_multiple,type:"hda"}),"single"==this.mode||"multiple"==this.mode||"collection"==this.mode){o.push({icon:"fa-folder-o",value:"collection",tooltip:"Dataset collection"});var h="multiple"==this.mode;this.select_collection=new e.Select.View({error_text:d,multiple:h,searchable:!1,optional:n.optional,onchange:function(){s.trigger("change")}}),this.list.collection={field:this.select_collection,type:"hdca"}}this.button_type=new e.RadioButton.View({value:this.current,data:o,onchange:function(t){s.current=t,s.refresh(),s.trigger("change")}}),this.$batch=a(this.template_batch());var u=r.size(this.list),p=0;u>1&&(this.$el.append(this.button_type.$el),p=Math.max(0,35*r.size(this.list))+"px");for(var f in this.list)this.$el.append(this.list[f].field.$el.css({"margin-left":p}));this.$el.append(this.$batch.css({"margin-left":p})),this.update(n.data),void 0!==this.options.value&&this.value(this.options.value),this.refresh(),this.on("change",function(){n.onchange&&n.onchange(s.value())})},wait:function(){for(var t in this.list)this.list[t].field.wait()},unwait:function(){for(var t in this.list)this.list[t].field.unwait()},update:function(t){function e(t,e){if(t){var n=[];for(var s in e){var o=e[s];n.push({label:o.hid+": "+o.name,value:o.id}),i.history[o.id+"_"+o.src]=o}t.update(n)}}var i=this;e(this.select_single,t.hda),e(this.select_multiple,t.hda),e(this.select_collection,t.hdca)},value:function(t){if(void 0!==t)if(t&&t.values)try{var e=[];for(var i in t.values)e.push(t.values[i].id);t&&t.values.length>0&&"hdca"==t.values[0].src?(this.current="collection",this.select_collection.value(e)):"multiple"==this.mode?(this.current="multiple",this.select_multiple.value(e)):(this.current="single",this.select_single.value(e[0]))}catch(n){Galaxy.emit.debug("tools-select-content::value()","Skipped.")}else for(var i in this.list)this.list[i].field.value(null);this.refresh();var s=this._select().value();if(null===s)return null;if(s instanceof Array||(s=[s]),0===s.length)return null;var o={batch:this._batch(),values:[]};for(var i in s){var a=this.history[s[i]+"_"+this.list[this.current].type];if(!a)return null;o.values.push(a)}return o.values.sort(function(t,e){return t.hid-e.hid}),o},refresh:function(){this.button_type.value(this.current);for(var t in this.list){var e=this.list[t].field.$el;this.current==t?e.show():e.hide()}this._batch()?this.$batch.show():this.$batch.hide()},_select:function(){return this.list[this.current].field},_batch:function(){if("collection"==this.current){var t=this.history[this._select().value()+"_hdca"];if(t&&t.map_over_type)return!0}return"single"!=this.current&&"single"==this.mode?!0:!1},template_batch:function(){return'
This is a batch mode input field. A separate job will be triggered for each dataset.
"},useData:!0})},function(t,e,i){var n=i(12);t.exports=(n["default"]||n).template({1:function(t,e,i,n,s){var o=t.lambda,a=t.escapeExpression;return''+a(o(e,e))+" "},compiler:[7,">= 4.0.0"],main:function(t,e,i,n,s){var o,a,r=null!=e?e:{},l=i.helperMissing,c="function",d=t.escapeExpression;return''+(null!=(o=i.each.call(r,null!=e?e.labels:e,{name:"each",hash:{},fn:t.program(1,s,0),inverse:t.noop,data:s}))?o:"")+'\n'+d((a=null!=(a=i.name||(null!=e?e.name:e))?a:l,typeof a===c?a.call(r,{name:"name",hash:{},data:s}):a))+"\n"+d((a=null!=(a=i.description||(null!=e?e.description:e))?a:l,typeof a===c?a.call(r,{name:"description",hash:{},data:s}):a))+"\n"},useData:!0})},function(t,e,i){var n=i(12);t.exports=(n["default"]||n).template({compiler:[7,">= 4.0.0"],main:function(t,e,i,n,s){var o,a=null!=e?e:{},r=i.helperMissing,l="function",c=t.escapeExpression;return'\n\n\n'},useData:!0})},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function o(){var t=new r.HandlebarsEnvironment;return p.extend(t,r),t.SafeString=c["default"],t.Exception=h["default"],t.Utils=p,t.escapeExpression=p.escapeExpression,t.VM=g,t.template=function(e){return g.template(e,t)},t}e.__esModule=!0;var a=i(27),r=s(a),l=i(81),c=n(l),d=i(9),h=n(d),u=i(8),p=s(u),f=i(80),g=s(f),m=i(79),v=n(m),_=o();_.create=o,v["default"](_),_["default"]=_,e["default"]=_,t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){a["default"](t)}e.__esModule=!0,e.registerDefaultDecorators=s;var o=i(69),a=n(o)},function(t,e,i){"use strict";e.__esModule=!0;var n=i(8);e["default"]=function(t){t.registerDecorator("inline",function(t,e,i,s){var o=t;return e.partials||(e.partials={},o=function(s,o){var a=i.partials;i.partials=n.extend({},a,e.partials);var r=t(s,o);return i.partials=a,r}),e.partials[s.args[0]]=s.fn,o})},t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){a["default"](t),l["default"](t),d["default"](t),u["default"](t),f["default"](t),m["default"](t),_["default"](t)}e.__esModule=!0,e.registerDefaultHelpers=s;var o=i(71),a=n(o),r=i(72),l=n(r),c=i(73),d=n(c),h=i(74),u=n(h),p=i(75),f=n(p),g=i(76),m=n(g),v=i(77),_=n(v)},function(t,e,i){"use strict";e.__esModule=!0;var n=i(8);e["default"]=function(t){t.registerHelper("blockHelperMissing",function(e,i){var s=i.inverse,o=i.fn;if(e===!0)return o(this);if(e===!1||null==e)return s(this);if(n.isArray(e))return e.length>0?(i.ids&&(i.ids=[i.name]),t.helpers.each(e,i)):s(this);if(i.data&&i.ids){var a=n.createFrame(i.data);a.contextPath=n.appendContextPath(i.data.contextPath,i.name),i={data:a}}return o(e,i)})},t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var s=i(8),o=i(9),a=n(o);e["default"]=function(t){t.registerHelper("each",function(t,e){function i(e,i,o){c&&(c.key=e,c.index=i,c.first=0===i,c.last=!!o,d&&(c.contextPath=d+e)),l+=n(t[e],{data:c,blockParams:s.blockParams([t[e],e],[d+e,null])})}if(!e)throw new a["default"]("Must pass iterator to #each");var n=e.fn,o=e.inverse,r=0,l="",c=void 0,d=void 0;if(e.data&&e.ids&&(d=s.appendContextPath(e.data.contextPath,e.ids[0])+"."),s.isFunction(t)&&(t=t.call(this)),e.data&&(c=s.createFrame(e.data)),t&&"object"==typeof t)if(s.isArray(t))for(var h=t.length;h>r;r++)r in t&&i(r,r,r===t.length-1);else{var u=void 0;for(var p in t)t.hasOwnProperty(p)&&(void 0!==u&&i(u,r-1),u=p,r++);void 0!==u&&i(u,r-1,!0)}return 0===r&&(l=o(this)),l})},t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var s=i(9),o=n(s);e["default"]=function(t){t.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new o["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},t.exports=e["default"]},function(t,e,i){"use strict";e.__esModule=!0;var n=i(8);e["default"]=function(t){t.registerHelper("if",function(t,e){return n.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||n.isEmpty(t)?e.inverse(this):e.fn(this)}),t.registerHelper("unless",function(e,i){return t.helpers["if"].call(this,e,{fn:i.inverse,inverse:i.fn,hash:i.hash})})},t.exports=e["default"]},function(t,e){"use strict";e.__esModule=!0,e["default"]=function(t){t.registerHelper("log",function(){for(var e=[void 0],i=arguments[arguments.length-1],n=0;n=0?e:parseInt(t,10)}return t},log:function(t){if(t=s.lookupLevel(t),"undefined"!=typeof console&&s.lookupLevel(s.level)<=t){var e=s.methodMap[t];console[e]||(e="log");for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;i>o;o++)n[o-1]=arguments[o];console[e].apply(console,n)}}};e["default"]=s,t.exports=e["default"]},function(t,e){(function(i){"use strict";e.__esModule=!0,e["default"]=function(t){var e="undefined"!=typeof i?i:window,n=e.Handlebars;t.noConflict=function(){return e.Handlebars===t&&(e.Handlebars=n),t}},t.exports=e["default"]}).call(e,function(){return this}())},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function o(t){var e=t&&t[0]||1,i=v.COMPILER_REVISION;if(e!==i){if(i>e){var n=v.REVISION_CHANGES[i],s=v.REVISION_CHANGES[e];throw new m["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+s+").")}throw new m["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")}}function a(t,e){function i(i,n,s){s.hash&&(n=f.extend({},n,s.hash),s.ids&&(s.ids[0]=!0)),i=e.VM.resolvePartial.call(this,i,n,s);var o=e.VM.invokePartial.call(this,i,n,s);if(null==o&&e.compile&&(s.partials[s.name]=e.compile(i,t.compilerOptions,e),o=s.partials[s.name](n,s)),null!=o){if(s.indent){for(var a=o.split("\n"),r=0,l=a.length;l>r&&(a[r]||r+1!==l);r++)a[r]=s.indent+a[r];o=a.join("\n")}return o}throw new m["default"]("The partial "+s.name+" could not be compiled when running in runtime-only mode")}function n(e){function i(e){return""+t.main(s,e,s.helpers,s.partials,a,l,r)}var o=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=o.data;n._setup(o),!o.partial&&t.useData&&(a=h(e,a));var r=void 0,l=t.useBlockParams?[]:void 0;return t.useDepths&&(r=o.depths?e!==o.depths[0]?[e].concat(o.depths):o.depths:[e]),(i=u(t.main,i,s,o.depths||[],a,l))(e,o)}if(!e)throw new m["default"]("No environment passed to template");if(!t||!t.main)throw new m["default"]("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var s={strict:function(t,e){if(!(e in t))throw new m["default"]('"'+e+'" not defined in '+t);return t[e]},lookup:function(t,e){for(var i=t.length,n=0;i>n;n++)if(t[n]&&null!=t[n][e])return t[n][e]},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:f.escapeExpression,invokePartial:i,fn:function(e){var i=t[e];return i.decorator=t[e+"_d"],i},programs:[],program:function(t,e,i,n,s){var o=this.programs[t],a=this.fn(t);return e||s||n||i?o=r(this,t,a,e,i,n,s):o||(o=this.programs[t]=r(this,t,a)),o},data:function(t,e){for(;t&&e--;)t=t._parent;return t},merge:function(t,e){var i=t||e;return t&&e&&t!==e&&(i=f.extend({},e,t)),i},noop:e.VM.noop,compilerInfo:t.compiler};return n.isTop=!0,n._setup=function(i){i.partial?(s.helpers=i.helpers,s.partials=i.partials,s.decorators=i.decorators):(s.helpers=s.merge(i.helpers,e.helpers),t.usePartial&&(s.partials=s.merge(i.partials,e.partials)),(t.usePartial||t.useDecorators)&&(s.decorators=s.merge(i.decorators,e.decorators)))},n._child=function(e,i,n,o){if(t.useBlockParams&&!n)throw new m["default"]("must pass block params");if(t.useDepths&&!o)throw new m["default"]("must pass parent depths");return r(s,e,t[e],i,0,n,o)},n}function r(t,e,i,n,s,o,a){function r(e){var s=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=a;return a&&e!==a[0]&&(r=[e].concat(a)),i(t,e,t.helpers,t.partials,s.data||n,o&&[s.blockParams].concat(o),r)}return r=u(i,r,t,a,n,o),r.program=e,r.depth=a?a.length:0,r.blockParams=s||0,r}function l(t,e,i){return t?t.call||i.name||(i.name=t,t=i.partials[t]):t="@partial-block"===i.name?i.data["partial-block"]:i.partials[i.name],t}function c(t,e,i){i.partial=!0,i.ids&&(i.data.contextPath=i.ids[0]||i.data.contextPath);var n=void 0;if(i.fn&&i.fn!==d&&(i.data=v.createFrame(i.data),n=i.data["partial-block"]=i.fn,n.partials&&(i.partials=f.extend({},i.partials,n.partials))),void 0===t&&n&&(t=n),void 0===t)throw new m["default"]("The partial "+i.name+" could not be found");return t instanceof Function?t(e,i):void 0}function d(){return""}function h(t,e){return e&&"root"in e||(e=e?v.createFrame(e):{},e.root=t),e}function u(t,e,i,n,s,o){if(t.decorator){var a={};e=t.decorator(e,a,i,n&&n[0],s,o,n),f.extend(e,a)}return e}e.__esModule=!0,e.checkRevision=o,e.template=a,e.wrapProgram=r,e.resolvePartial=l,e.invokePartial=c,e.noop=d;var p=i(8),f=s(p),g=i(9),m=n(g),v=i(27)},function(t,e){"use strict";function i(t){this.string=t}e.__esModule=!0,i.prototype.toString=i.prototype.toHTML=function(){return""+this.string},e["default"]=i,t.exports=e["default"]},,,,,,,,,,,function(t,e,i){var n,s;(function(o,a){n=[i(6),i(5),i(19)],s=function(t,e){var i=o.View.extend(t.LoggableMixin).extend(t.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(t){t=t||{},this.tooltipConfig=t.tooltipConfig||{placement:"bottom"},this.listenTo(this.model,"change:annotation",function(){this.render()}),this.hiddenUntilActivated(t.$activator,t)},render:function(){var t=this;return this.$el.html(this._template()),this.$el.find("[title]").tooltip(this.tooltipConfig),this.$annotation().make_text_editable({use_textarea:!0,on_finish:function(e){t.$annotation().text(e),t.model.save({annotation:e},{silent:!0}).fail(function(){t.$annotation().text(t.model.previous("annotation"))})}}),this},_template:function(){var t=this.model.get("annotation");return['",'
This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at '+this.options.ftp_upload_site+' using your Galaxy credentials (email address and password).
'}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(o,a,r){n=[i(4)],s=function(t){return o.View.extend({options:{class_check:"fa-check-square-o",class_uncheck:"fa-square-o",parameters:[{id:"space_to_tab",title:"Convert spaces to tabs"},{id:"to_posix_lines",title:"Use POSIX standard"}]},initialize:function(t){this.model=t.model,this.setElement(a("").addClass("upload-settings")),this.$el.append(a("").addClass("upload-settings-cover")),this.$el.append(a("
"}});return{View:e}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(i,a,o){n=[],s=function(){var t=i.Model.extend({defaults:{title:"",icon_class:"",on_click:null,menu_options:null,is_menu_button:!0,id:null,href:null,target:null,enabled:!0,visible:!0,tooltip_config:{}}}),e=i.View.extend({initialize:function(){this.model.attributes.tooltip_config={placement:"bottom"},this.model.bind("change",this.render,this)},render:function(){this.$el.tooltip("hide");var t=this.template(this.model.toJSON());return t.tooltip(this.model.get("tooltip_config")),this.$el.replaceWith(t),this.setElement(t),this},events:{click:"click"},click:function(t){return a.isFunction(this.model.get("on_click"))?(this.model.get("on_click")(t),!1):!0},template:function(t){var e='title="'+t.title+'" class="icon-button';return t.is_menu_button&&(e+=" menu-button"),e+=" "+t.icon_class,t.enabled||(e+="_disabled"),e+='"',t.id&&(e+=' id="'+t.id+'"'),e+=' href="'+t.href+'"',t.target&&(e+=' target="'+t.target+'"'),t.visible||(e+=' style="display: none;"'),e=t.enabled?"":"",o(e)}}),n=i.Collection.extend({model:t}),s=i.View.extend({tagName:"div",initialize:function(){this.render()},render:function(){var t=this;return this.collection.each(function(e){var i=o("").attr("href","javascript:void(0)").attr("title",e.attributes.title).addClass("icon-button menu-button").addClass(e.attributes.icon_class).appendTo(t.$el).click(e.attributes.on_click);e.attributes.tooltip_config&&i.tooltip(e.attributes.tooltip_config);var n=e.get("options");n&&make_popupmenu(i,n)}),this}}),r=function(e,i){i||(i={});var o=new n(a.map(e,function(e){return new t(a.extend(e,i))}));return new s({collection:o})};return{IconButton:t,IconButtonView:e,IconButtonCollection:n,IconButtonMenuView:s,create_icon_buttons_menu:r}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1))},function(t,e,i){var n,s,a;!function(o){s=[i(1)],n=o,a="function"==typeof n?n.apply(e,s):n,!(void 0!==a&&(t.exports=a))}(function(t){"use_strict";var e=t;e.fn.make_text_editable=function(t){var i="num_cols"in t?t.num_cols:30,n="num_rows"in t?t.num_rows:4,s="use_textarea"in t?t.use_textarea:!1,a="on_finish"in t?t.on_finish:null,o="help_text"in t?t.help_text:null,r=e(this);return r.addClass("editable-text").click(function(o){if(!(e(this).children(":input").length>0)){r.removeClass("editable-text");var l,c,d=function(t){r.find(":input").remove(),""!==t?r.text(t):r.html(" "),r.addClass("editable-text"),a&&a(t)},h="cur_text"in t?t.cur_text:r.text();s?(l=e("").attr({rows:n,cols:i}).text(e.trim(h)).keyup(function(t){27===t.keyCode&&d(h)}),c=e("").text("Done").click(function(){return d(l.val()),!1})):l=e("").attr({value:e.trim(h),size:i}).blur(function(){d(h)}).keyup(function(t){27===t.keyCode?e(this).trigger("blur"):13===t.keyCode&&d(e(this).val()),t.stopPropagation()}),r.text(""),r.append(l),c&&r.append(c),l.focus(),l.select(),o.stopPropagation()}}),o&&r.attr("title",o).tooltip(),r}})},function(t,e,i){var n;(function(s,a){n=function(){function t(t){t+="";for(var e=/(\d+)(\d{3})/;e.test(t);)t=t.replace(e,"$1,$2");return t}var e=function(t){return"promise"in t},i=s.Model.extend({defaults:{ajax_settings:{},interval:1e3,success_fn:function(t){return!0}},go:function(){var t=a.Deferred(),e=this,i=e.get("ajax_settings"),n=e.get("success_fn"),s=e.get("interval"),o=function(){a.ajax(i).success(function(e){n(e)?t.resolve(e):setTimeout(o,s)})};return o(),t}}),n=function(t){t||(t="#ffffff"),"string"==typeof t&&(t=[t]);for(var e=0;e>16,s=(65280&i)>>8,a=255&i,d=p(n,s,a),g=!0,e=0;e>16,l=(65280&o)>>8,c=255&o,h=p(r,l,c),u=f(n,s,a,r,l,c),Math.abs(d-h)<40||200>u){g=!1;break}m++}while(!g&&10>=m);return"#"+(16777216+i).toString(16).substr(1,6)};return{commatize:t,is_deferred:e,ServerStateDeferred:i,get_random_color:n}}.call(e,i,e,t),!(void 0!==n&&(t.exports=n))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(a){n=[i(32),i(6),i(5)],s=function(t,e,i){t=t||window.BibtexParser;var n="citation",s=a.Model.extend(e.LoggableMixin).extend({_logNamespace:n,initialize:function(){var e=this.get("content"),i=t(e).entries[0];this.entry=i,this._fields={};var n=i.Fields;for(var s in n){var a=n[s],o=s.toLowerCase();this._fields[o]=a}},entryType:function(){return this.entry.EntryType},fields:function(){return this._fields}}),o=a.Collection.extend(e.LoggableMixin).extend({_logNamespace:n,urlRoot:Galaxy.root+"api",partial:!0,model:s}),r=o.extend({url:function(){return this.urlRoot+"/histories/"+this.history_id+"/citations"}}),l=o.extend({url:function(){return this.urlRoot+"/tools/"+this.tool_id+"/citations"},partial:!1});return{Citation:s,HistoryCitationCollection:r,ToolCitationCollection:l}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;n=[i(4),i(7),i(49),i(23)],s=function(t,e,i,n){var s=i.extend({initialize:function(n){var s=this;i.prototype.initialize.call(this,t.merge({customize:function(t){t.buttons={execute:execute_btn=new e.Button({icon:"fa-check",tooltip:"Execute: "+t.name+" ("+t.version+")",title:"Execute",cls:"btn btn-primary",floating:"clear",onclick:function(){execute_btn.wait(),s.portlet.disable(),s.submit(t,function(){execute_btn.unwait(),s.portlet.enable()})}})},t.job_id&&t.job_remap&&(t.inputs.rerun_remap_job_id={label:"Resume dependencies from this job",name:"rerun_remap_job_id",type:"select",display:"radio",ignore:"__ignore__",value:"__ignore__",options:[["Yes",t.job_id],["No","__ignore__"]],help:"The previous run of this tool failed and other tools were waiting for it to finish successfully. Use this option to resume those tools using the new output(s) of this tool run."})}},n))},submit:function(e,i){var s=this,a={tool_id:e.id,tool_version:e.version,inputs:this.data.create()};return this.trigger("reset"),s.validate(a)?(Galaxy.emit.debug("tool-form::submit()","Validation complete.",a),void t.request({
+type:"POST",url:Galaxy.root+"api/tools",data:a,success:function(t){i&&i(),s.$el.empty().append(n.success(t)),parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.refreshContents()},error:function(t){if(i&&i(),Galaxy.emit.debug("tool-form::submit","Submission failed.",t),t&&t.err_data){var e=s.data.matchResponse(t.err_data);for(var o in e){s.highlight(o,e[o]);break}}else s.modal.show({title:"Job submission failed",body:t&&t.err_msg||n.error(a),buttons:{Close:function(){s.modal.hide()}}})}})):(Galaxy.emit.debug("tool-form::submit()","Submission canceled. Validation failed."),void(i&&i()))},validate:function(t){var e=t.inputs,i=-1,n=null;for(var s in e){var a=e[s],o=this.data.match(s),r=this.field_list[o],l=this.input_list[o];if(o&&l&&r){if(!l.optional&&null==a)return this.highlight(o),!1;if(a&&a.batch){var c=a.values.length,d=c>0&&a.values[0]&&a.values[0].src;if(d)if(null===n)n=d;else if(n!==d)return this.highlight(o,"Please select either dataset or dataset list fields for all batch mode fields."),!1;if(-1===i)i=c;else if(i!==c)return this.highlight(o,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains "+c+" selection(s) while a previous field contains "+i+"."),!1}}else Galaxy.emit.debug("tool-form::validate()","Retrieving input objects failed.")}return!0}});return{View:s}}.apply(e,n),!(void 0!==s&&(t.exports=s))},function(t,e,i){var n,s;(function(i){n=[],s=function(){return{help:function(t){var e=i("").addClass("ui-form-help").append(t.help);return e.find("a").attr("target","_blank"),e},success:function(t){if(!t.jobs||!t.jobs.length)return this.error(t);var e=t.jobs.length,i="";i=1==e?"1 job has":e+" jobs have";var n='
'+i+" been successfully added to the queue - resulting in the following datasets:
";for(var s in t.outputs)n+='
'+t.outputs[s].hid+": "+t.outputs[s].name+"
";return n+="
You can check the status of queued jobs and view the resulting data by refreshing the History pane. When the job has been run the status will change from 'running' to 'finished' if completed successfully or 'error' if problems were encountered.
"},error:function(t){return'
The server could not complete the request. Please contact the Galaxy Team if this error persists.
"},requirements:function(t){var e="This tool requires ";for(var i in t.requirements){var n=t.requirements[i];e+=n.name,n.version&&(e+=" (Version "+n.version+")"),ihere for more information.'}}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(1))},function(t,e,i){var n,s;(function(a,o){n=[i(4),i(11),i(7)],s=function(t,e,i){var n=a.View.extend({initialize:function(t){var n=this;this.options=t,this.name=t.name||"element",this.multiple=t.multiple||!1,this.message=new i.Message({cls:"ui-margin-top"}),this.portlet=new e.View({cls:"ui-portlet-section"}),this.select=new i.Select.View({optional:t.optional}),this.button=new i.ButtonIcon({icon:"fa fa-sign-in",floating:"left",tooltip:"Insert new "+this.name,onclick:function(){n.add({id:n.select.value(),name:n.select.text()})}}),this.setElement(this._template(t)),this.$(".ui-list-message").append(this.message.$el),this.$(".ui-list-portlet").append(this.portlet.$el),this.$(".ui-list-button").append(this.button.$el),this.$(".ui-list-select").append(this.select.$el)},value:function(t){if(void 0!==t){if(this.portlet.empty(),o.isArray(t))for(var e in t){var i=t[e],n=null,s=null;"string"!=o.type(i)?(n=i.id,s=i.name):n=s=i,null!=n&&this.add({id:n,name:s})}this._refresh()}var a=[];return this.$(".ui-list-id").each(function(){a.push({id:o(this).prop("id"),name:o(this).find(".ui-list-name").html()})}),0==a.length?null:a},add:function(e){var i=this;if(0===this.$('[id="'+e.id+'"]').length)if(t.validate(e.id)){var n=o(this._templateRow({id:e.id,name:e.name}));n.on("click",function(){n.remove(),i._refresh()}),n.on("mouseover",function(){n.addClass("portlet-highlight")}),n.on("mouseout",function(){n.removeClass("portlet-highlight")}),this.portlet.append(n),this._refresh()}else this.message.update({message:"Please select a valid "+this.name+".",status:"danger"});else this.message.update({message:"This "+this.name+" is already in the list."})},update:function(t){this.select.update(t)},_refresh:function(){this.$(".ui-list-id").length>0?(!this.multiple&&this.button.disable(),this.$(".ui-list-portlet").show()):(this.button.enable(),this.$(".ui-list-portlet").hide()),this.options.onchange&&this.options.onchange()},_template:function(t){return'
'},_templateRow:function(t){return'
'+t.name+"
"}});return{View:n}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(a,o){n=[i(4),i(16)],s=function(t,e){var i=a.View.extend({initialize:function(i){var n=this;this.options=t.merge(i,{visible:!0,data:[],id:t.uid(),error_text:"No options available.",wait_text:"Please wait...",multiple:!1}),this.setElement(''),this.$message=o(""),this.$options=o(this._template(i)),this.$menu=o(''),this.$el.append(this.$message),this.$el.append(this.$menu),this.$el.append(this.$options),this.options.multiple&&(this.all_button=new e.ButtonCheck({onclick:function(){n.$("input").prop("checked",0!==n.all_button.value()),n.trigger("change")}}),this.$menu.append(this.all_button.$el)),this.options.visible||this.$el.hide(),this.update(this.options.data),void 0!==this.options.value&&this.value(this.options.value),this.on("change",function(){this.options.onchange&&this.options.onchange(this.value())})},update:function(t){var e=this._getValue();if(this.$options.empty(),this._templateOptions)this.$options.append(this._templateOptions(t));else for(var i in t){var n=o(this._templateOption(t[i]));n.addClass("ui-option"),n.tooltip({title:t[i].tooltip,placement:"bottom"}),this.$options.append(n)}var s=this;this.$("input").on("change",function(){s.value(s._getValue()),s.trigger("change")}),this.value(e),this.unwait()},value:function(t){if(void 0!==t&&(this.$("input").prop("checked",!1),null!==t)){t instanceof Array||(t=[t]);for(var e in t)this.$('input[value="'+t[e]+'"]').first().prop("checked",!0)}var i=this._getValue();if(this.all_button){var n=i;n=n instanceof Array?n.length:0,this.all_button.value(n,this._size())}return i},exists:function(t){if(void 0!==t){t instanceof Array||(t=[t]);for(var e in t)if(this.$('input[value="'+t[e]+'"]').length>0)return!0}return!1},first:function(){var t=this.$("input").first();return t.length>0?t.val():null},wait:function(){0==this._size()&&(this._messageShow(this.options.wait_text,"info"),this.$options.hide(),this.$menu.hide())},unwait:function(){var t=this._size();0==t?(this._messageShow(this.options.error_text,"danger"),this.$options.hide(),this.$menu.hide()):(this._messageHide(),this.$options.css("display","inline-block"),this.$menu.show())},_getValue:function(){var e=[];return this.$(":checked").each(function(){e.push(o(this).val())}),t.validate(e)?this.options.multiple?e:e[0]:null},_size:function(){return this.$(".ui-option").length},_messageShow:function(t,e){this.$message.show(),this.$message.removeClass(),this.$message.addClass("ui-message alert alert-"+e),this.$message.html(t)},_messageHide:function(){this.$message.hide()},_template:function(){return''}}),n=i.extend({_templateOption:function(e){var i=t.uid();return'"}}),s={};s.View=n.extend({initialize:function(t){t.type="radio",n.prototype.initialize.call(this,t)}});var r={};r.View=n.extend({initialize:function(t){t.multiple=!0,t.type="checkbox",n.prototype.initialize.call(this,t)}});var l={};return l.View=i.extend({initialize:function(t){i.prototype.initialize.call(this,t)},value:function(t){return void 0!==t&&(this.$("input").prop("checked",!1),this.$("label").removeClass("active"),this.$('[value="'+t+'"]').prop("checked",!0).closest("label").addClass("active")),this._getValue()},_templateOption:function(t){var e="fa "+t.icon;t.label||(e+=" no-padding");var i='"},_template:function(){return''}}),{Base:i,BaseIcons:n,Radio:s,RadioButton:l,Checkbox:r}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s,a;(function(i,o){!function(i,o){s=[],n=o,a="function"==typeof n?n.apply(e,s):n,!(void 0!==a&&(t.exports=a))}(this,function(){var t=function(t){t=t||{},t.tooltipConfig=t.tooltipConfig||{placement:"bottom"},t.classes=["icon-btn"].concat(t.classes||[]),t.disabled&&t.classes.push("disabled");var e=['','',""].join(""),n=i(e).tooltip(t.tooltipConfig);return o.isFunction(t.onclick)&&n.click(t.onclick),n};return t})}).call(e,i(1),i(3))},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t,e,i){this.helpers=t||{},this.partials=e||{},this.decorators=i||{},l.registerDefaultHelpers(this),c.registerDefaultDecorators(this)}e.__esModule=!0,e.HandlebarsEnvironment=s;var a=i(8),o=i(9),r=n(o),l=i(70),c=i(68),d=i(78),h=n(d),u="4.0.5";e.VERSION=u;var p=7;e.COMPILER_REVISION=p;var f={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};e.REVISION_CHANGES=f;var g="[object Object]";s.prototype={constructor:s,logger:h["default"],log:h["default"].log,registerHelper:function(t,e){if(a.toString.call(t)===g){if(e)throw new r["default"]("Arg not supported with multiple helpers");a.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(a.toString.call(t)===g)a.extend(this.partials,t);else{if("undefined"==typeof e)throw new r["default"]('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(a.toString.call(t)===g){if(e)throw new r["default"]("Arg not supported with multiple decorators");a.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]}};var m=h["default"].log;e.log=m,e.createFrame=a.createFrame,e.logger=h["default"]},,function(t,e,i){var n,s;(function(a,o,r){n=[i(4)],s=function(t){var e=a.View.extend({optionsDefault:{with_close:!0,title:null,placement:"top",container:"body",body:null},initialize:function(e){this.setElement(this._template()),this.uid=t.uid(),this.options=o.defaults(e||{},this.optionsDefault),this.options.container.parent().append(this.el),this.$title=this.$(".popover-title-label"),this.$close=this.$(".popover-close"),this.$body=this.$(".popover-content"),this.options.body&&this.append(this.options.body);var i=this;r("body").on("mousedown."+this.uid,function(t){i.visible&&!r(i.options.container).is(t.target)&&!r(i.el).is(t.target)&&0===r(i.el).has(t.target).length&&i.hide()})},render:function(){this.$title.html(this.options.title),this.$el.removeClass().addClass("ui-popover popover fade in").addClass(this.options.placement),this.$el.css(this._get_placement(this.options.placement));var t=this;this.options.with_close?this.$close.on("click",function(){t.hide()}).show():this.$close.off().hide()},title:function(t){void 0!==t&&(this.options.title=t,this.$title.html(t))},show:function(){this.render(),this.$el.show(),this.visible=!0},hide:function(){this.$el.hide(),this.visible=!1},append:function(t){this.$body.append(t)},empty:function(){this.$body.empty()},remove:function(){r("body").off("mousedown."+this.uid),this.$el.remove()},_get_placement:function(t){var e=this._get_width(this.$el),i=this.$el.height(),n=this.options.container,s=this._get_width(n),a=this._get_height(n),o=n.position(),r=left=0;if(-1!=["top","bottom"].indexOf(t))switch(left=o.left-e+(s+e)/2,t){case"top":r=o.top-i-5;break;case"bottom":r=o.top+a+5}else switch(r=o.top-i+(a+i)/2,t){case"right":left=o.left+s}return{top:r,left:left}},_get_width:function(t){return t.width()+parseInt(t.css("padding-left"))+parseInt(t.css("margin-left"))+parseInt(t.css("padding-right"))+parseInt(t.css("margin-right"))},_get_height:function(t){return t.height()+parseInt(t.css("padding-top"))+parseInt(t.css("padding-bottom"))},_template:function(t){return'
'}});return{View:e}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1))},function(t,e,i){var n,s;(function(a){n=[i(4)],s=function(t){var e=a.View.extend({optionsDefault:{css:"",placeholder:"No data available",data:[],value:null,multiple:!1,minimumInputLength:0,initialData:""},initialize:function(e){if(this.options=t.merge(e,this.optionsDefault),this.setElement(this._template(this.options)),!this.options.container)return void console.log("ui-select::initialize() : container not specified.");if(this.options.container.append(this.$el),this.select_data=this.options.data,this._refresh(),!this.options.multiple){this.options.value&&this._setValue(this.options.value);var i=this;this.options.onchange&&this.$el.on("change",function(){i.options.onchange(i.value())})}},value:function(t){var e=this._getValue();void 0!==t&&this._setValue(t);var i=this._getValue();return i!=e&&this.options.onchange&&this.options.onchange(i),i},text:function(){return this.$el.select2("data").text},disabled:function(){return!this.$el.select2("enable")},enable:function(){this.$el.select2("enable",!0)},disable:function(){this.$el.select2("enable",!1)},add:function(t){this.select_data.push({id:t.id,text:t.text}),this._refresh()},del:function(t){var e=this._getIndex(t);-1!=e&&(this.select_data.splice(e,1),this._refresh())},remove:function(){this.$el.select2("destroy")},update:function(t){this.select_data=[];for(var e in t.data)this.select_data.push(t.data[e]);this._refresh()},_refresh:function(){if(this.options.multiple){var t={multiple:this.options.multiple,containerCssClass:this.options.css,placeholder:this.options.placeholder,minimumInputLength:this.options.minimumInputLength,ajax:this.options.ajax,dropdownCssClass:this.options.dropdownCssClass,escapeMarkup:this.options.escapeMarkup,formatResult:this.options.formatResult,formatSelection:this.options.formatSelection,initSelection:this.options.initSelection,initialData:this.options.initialData};this.$el.select2(t)}else{var e=this._getValue(),t={data:this.select_data,containerCssClass:this.options.css,placeholder:this.options.placeholder,dropdownAutoWidth:!0};this.$el.select2(t),this._setValue(e)}},_getIndex:function(t){for(var e in this.select_data)if(this.select_data[e].id==t)return e;return-1},_getValue:function(){return this.$el.select2("val")},_setValue:function(t){var e=this._getIndex(t);-1==e&&this.select_data.length>0&&(t=this.select_data[0].id),this.$el.select2("val",t)},_template:function(t){return''}});return{View:e}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;(function(a,o,r){n=[i(4)],s=function(t){var e=a.View.extend({optionsDefault:{title_new:"",operations:null,onnew:null,max:null,onchange:null},initialize:function(e){this.visible=!1,this.$nav=null,this.$content=null,this.first_tab=null,this.current_id=null,this.options=t.merge(e,this.optionsDefault);var i=o(this._template(this.options));this.$nav=i.find(".tab-navigation"),this.$content=i.find(".tab-content"),this.setElement(i),this.list={};var n=this;if(this.options.operations&&o.each(this.options.operations,function(t,e){e.$el.prop("id",t),n.$nav.find(".operations").append(e.$el)}),this.options.onnew){var s=o(this._template_tab_new(this.options));this.$nav.append(s),s.tooltip({title:"Add a new tab",placement:"bottom",container:n.$el}),s.on("click",function(t){s.tooltip("hide"),n.options.onnew()})}},size:function(){return r.size(this.list)},current:function(){return this.$el.find(".tab-pane.active").attr("id")},add:function(t){var e=this,i=t.id,n=o(this._template_tab(t)),s=o(this._template_tab_content(t));if(this.list[i]=t.ondel?!0:!1,this.options.onnew?this.$nav.find("#new-tab").before(n):this.$nav.append(n),s.append(t.$el),this.$content.append(s),1==this.size()&&(n.addClass("active"),s.addClass("active"),this.first_tab=i),this.options.max&&this.size()>=this.options.max&&this.$el.find("#new-tab").hide(),t.ondel){var a=n.find("#delete");a.tooltip({title:"Delete this tab",placement:"bottom",container:e.$el}),a.on("click",function(){return a.tooltip("destroy"),e.$el.find(".tooltip").remove(),t.ondel(),!1})}n.on("click",function(n){n.preventDefault(),t.onclick?t.onclick():e.show(i)}),this.current_id||(this.current_id=i)},del:function(t){this.$el.find("#tab-"+t).remove(),this.$el.find("#"+t).remove(),this.first_tab==t&&(this.first_tab=null),null!=this.first_tab&&this.show(this.first_tab),this.list[t]&&delete this.list[t],this.size()
',"Warning: This is a experimental feature. Most Galaxy tools will not annotate"," citations explicitly at this time. When writing up your analysis, please manually"," review your histories and find all references"," that should be cited in order to completely describe your work. Also, please remember to",' cite Galaxy.',"
"],"element");return a.extend({},e.DatasetListItemView.prototype.templates,{titleBar:t})}();var u=c.extend({className:c.prototype.className+" dataset-collection-element",_swapNewRender:function(t){c.prototype._swapNewRender.call(this,t);var e=this.model.get("state")||"ok";return this.$el.addClass("state-"+e),this.$el},toString:function(){var t=this.model?this.model+"":"(no model)";return"NestedDCDCEListItemView("+t+")"}});return{DCListItemView:c,DCEListItemView:d,DatasetDCEListItemView:h,NestedDCDCEListItemView:u}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3),i(1),i(1))},function(t,e,i){var n,s;(function(a,o,r){n=[i(95),i(6),i(5)],s=function(t,e,i){var n="collections",s={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(t){return a.extend(t,t.object,{element_id:t.id}),delete t.object,t},constructor:function(t,e){t=this._mergeObject(t),this.idAttribute="element_id",o.Model.apply(this,arguments)},parse:function(t,e){var i=t;return i=this._mergeObject(i)}},l=o.Model.extend(e.LoggableMixin).extend(s).extend({_logNamespace:n}),c=o.Collection.extend(e.LoggableMixin).extend({_logNamespace:n,model:l,initialize:function(t,e){this.debug(this+"(DCECollection).initialize:",t,e),e=e||{}},toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),d=t.DatasetAssociation.extend(e.mixin(s,{url:function(){return this.has("history_id")?Galaxy.root+"api/histories/"+this.get("history_id")+"/contents/"+this.get("id"):(console.warn("no endpoint for non-hdas within a collection yet"),Galaxy.root+"api/datasets")},defaults:a.extend({},t.DatasetAssociation.prototype.defaults,s.defaults),constructor:function(t,e){this.debug(" DatasetDCE.constructor:",t,e),s.constructor.call(this,t,e)},initialize:function(e,i){this.debug(this+"(DatasetDCE).initialize:",e,i),t.DatasetAssociation.prototype.initialize.call(this,e,i)},hasDetails:function(){return a.has(this.attributes,"annotation")},toString:function(){var t=this.get("element_identifier");return["DatasetDCE(",t,")"].join("")}})),h=c.extend({model:d,initialize:function(t,e){this.debug(this+"(DatasetDCECollection).initialize:",t,e),c.prototype.initialize.call(this,t,e)},toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),u=o.Model.extend(e.LoggableMixin).extend(e.SearchableModelMixin).extend({_logNamespace:n,defaults:{collection_type:null,deleted:!1},collectionClass:c,initialize:function(t,e){this.debug(this+"(DatasetCollection).initialize:",t,e,this),this.elements=this._createElementsModel(),this.on("change:elements",function(){this.log("change:elements"),this.elements=this._createElementsModel()})},_createElementsModel:function(){this.debug(this+"._createElementsModel",this.collectionClass,this.get("elements"),this.elements);var t=this.get("elements")||[];return this.unset("elements",{silent:!0}),this.elements=new this.collectionClass(t),this.elements},toJSON:function(){var t=o.Model.prototype.toJSON.call(this);return this.elements&&(t.elements=this.elements.toJSON()),t},inReadyState:function(){var t=this.get("populated");return this.isDeletedOrPurged()||t},hasDetails:function(){return this.debug("hasDetails:",this.elements.length),0!==this.elements.length},getVisibleContents:function(t){return this.elements},"delete":function(t){return this.get("deleted")?r.when():this.save({deleted:!0},t)},undelete:function(t){return!this.get("deleted")||this.get("purged")?r.when():this.save({deleted:!1},t)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name"],toString:function(){var t=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+t.join(",")+")"}}),p=u.extend({collectionClass:h,initialize:function(t,e){this.debug(this+"(ListDatasetCollection).initialize:",t,e),u.prototype.initialize.call(this,t,e)},toString:function(){return["ListDatasetCollection(",this.get("name"),")"].join("")}}),f=p.extend({initialize:function(t,e){this.debug(this+"(PairDatasetCollection).initialize:",t,e),p.prototype.initialize.call(this,t,e)},toString:function(){return["PairDatasetCollection(",this.get("name"),")"].join("")}}),g=u.extend(e.mixin(s,{constructor:function(t,e){this.debug(" NestedDCDCE.constructor:",t,e),s.constructor.call(this,t,e)},toString:function(){var t=this.object?""+this.object:this.get("element_identifier");return["NestedDCDCE(",t,")"].join("")}})),m=c.extend({model:g,initialize:function(t,e){this.debug(this+"(NestedDCDCECollection).initialize:",t,e),c.prototype.initialize.call(this,t,e)},toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}}),v=f.extend(e.mixin(s,{constructor:function(t,e){this.debug(" NestedPairDCDCE.constructor:",t,e),s.constructor.call(this,t,e)},toString:function(){var t=this.object?""+this.object:this.get("element_identifier");return["NestedPairDCDCE(",t,")"].join("")}})),_=m.extend({model:v,initialize:function(t,e){this.debug(this+"(NestedPairDCDCECollection).initialize:",t,e),m.prototype.initialize.call(this,t,e)},toString:function(){return["NestedPairDCDCECollection(",this.length,")"].join("")}}),y=u.extend({collectionClass:_,initialize:function(t,e){this.debug(this+"(ListPairedDatasetCollection).initialize:",t,e),u.prototype.initialize.call(this,t,e)},toString:function(){return["ListPairedDatasetCollection(",this.get("name"),")"].join("")}});return{ListDatasetCollection:p,PairDatasetCollection:f,ListPairedDatasetCollection:y}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(3),i(2),i(1))},function(t,e,i){var n,s;(function(a,o,r,l){n=[i(45),i(15),i(6),i(10),i(110),i(5),i(107)],s=function(t,e,i,n,s,c){function d(t){var e=t.toJSON(),i=g(e,{creationFn:function(e,i){return e=e.map(function(t){return{id:t.id,name:t.name,src:"dataset"===t.history_content_type?"hda":"hdca"}}),t.createHDCA(e,"list",i)}});return i}var h="collections",u=a.View.extend(i.LoggableMixin).extend({_logNamespace:h,tagName:"li",className:"collection-element",initialize:function(t){this.element=t.element||{},this.selected=t.selected||!1},render:function(){return this.$el.attr("data-element-id",this.element.id).attr("draggable",!0).html(this.template({element:this.element})),this.selected&&this.$el.addClass("selected"),this},template:o.template(['',"<%- element.name %>","",'"].join("")),select:function(t){this.$el.toggleClass("selected",t),this.trigger("select",{source:this,selected:this.$el.hasClass("selected")})},discard:function(){var t=this,e=this.$el.parent().width();this.$el.animate({"margin-right":e},"fast",function(){t.trigger("discard",{source:t}),t.destroy()})},destroy:function(){this.off(),this.$el.remove()},events:{click:"_click","click .name":"_clickName","click .discard":"_clickDiscard",dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_click:function(t){t.stopPropagation(),this.select(t)},_clickName:function(t){t.stopPropagation(),t.preventDefault();var e=([c("Enter a new name for the element"),":\n(",c("Note that changing the name here will not rename the dataset"),")"].join(""),prompt(c("Enter a new name for the element")+":",this.element.name));e&&(this.element.name=e,this.render())},_clickDiscard:function(t){t.stopPropagation(),this.discard()},_dragstart:function(t){t.originalEvent&&(t=t.originalEvent),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",JSON.stringify(this.element)),this.$el.addClass("dragging"),this.$el.parent().trigger("collection-element.dragstart",[this])},_dragend:function(t){this.$el.removeClass("dragging"),this.$el.parent().trigger("collection-element.dragend",[this])},_sendToParent:function(t){this.$el.parent().trigger(t)},toString:function(){return"DatasetCollectionElementView()"}}),p=a.View.extend(i.LoggableMixin).extend({_logNamespace:h,elementViewClass:u,collectionClass:t.HistoryListDatasetCollection,className:"list-collection-creator collection-creator flex-row-container",minElements:1,defaultAttributes:{creationFn:function(){throw new TypeError("no creation fn for creator")},oncreate:function(){},oncancel:function(){},autoscrollDist:24,highlightClr:"rgba( 64, 255, 255, 1.0 )"},initialize:function(t){this.metric("ListCollectionCreator.initialize",t);var e=this;o.each(this.defaultAttributes,function(i,n){i=t[n]||i,e[n]=i}),e.initialElements=t.elements||[],this._instanceSetUp(),this._elementsSetUp(),this._setUpBehaviors()},_instanceSetUp:function(){this.selectedIds={},this.$dragging=null,this.blocking=!1},_elementsSetUp:function(){this.invalidElements=[],this.workingElements=[],this.elementViews=[],this.workingElements=this.initialElements.slice(0),this._ensureElementIds(),this._validateElements(),this._mangleDuplicateNames(),this._sortElements()},_ensureElementIds:function(){return this.workingElements.forEach(function(t){t.hasOwnProperty("id")||(t.id=o.uniqueId())}),this.workingElements},_validateElements:function(){var t=this;return t.invalidElements=[],this.workingElements=this.workingElements.filter(function(e){var i=t._isElementInvalid(e);return i&&t.invalidElements.push({element:e,text:i}),!i}),this.workingElements},_isElementInvalid:function(t){return"dataset"!==t.history_content_type?c("is not a dataset"):t.state!==e.OK?c(o.contains(e.NOT_READY_STATES,t.state)?"hasn't finished running yet":"has errored, is paused, or is not accessible"):t.deleted||t.purged?c("has been deleted or purged"):null},_mangleDuplicateNames:function(){var t=900,e=1,i={};this.workingElements.forEach(function(n){for(var s=n.name;i.hasOwnProperty(s);)if(s=n.name+" ("+e+")",e+=1,e>=t)throw new Error("Safety hit in while loop - thats impressive");n.name=s,i[n.name]=!0})},_sortElements:function(t){},render:function(t,e){return this.workingElements.length .clear-selected").show():this.$(".collection-elements-controls > .clear-selected").hide()},_renderList:function(t,e){var i=this,n=l(""),s=i.$list();o.each(this.elementViews,function(t){t.destroy(),i.removeElementView(t)}),i.workingElements.forEach(function(t){var e=i._createElementView(t);n.append(e.$el)}),i._renderClearSelected(),s.empty().append(n.children()),o.invoke(i.elementViews,"render"),s.height()>s.css("max-height")?s.css("border-width","1px 0px 1px 0px"):s.css("border-width","0px")},_createElementView:function(t){var e=new this.elementViewClass({element:t,selected:o.has(this.selectedIds,t.id)});return this.elementViews.push(e),this._listenToElementView(e),e},_listenToElementView:function(t){var e=this;e.listenTo(t,{select:function(t){var i=t.source.element;t.selected?e.selectedIds[i.id]=!0:delete e.selectedIds[i.id],e.trigger("elements:select",t)},discard:function(t){e.trigger("elements:discard",t)}})},addElementView:function(t){},removeElementView:function(t){delete this.selectedIds[t.element.id],this._renderClearSelected(),this.elementViews=o.without(this.elementViews,t),this.stopListening(t)},_renderNoElementsLeft:function(){this._disableNameAndCreate(!0),this.$(".collection-elements").append(this.templates.noElementsLeft())},_elementToJSON:function(t){return t},createList:function(t){if(!this.workingElements.length){var e=c("No valid elements for final list")+". ";return e+=''+c("Cancel")+" ",e+=c("or"),e+=' '+c("start over")+".",void this._showAlert(e)}var i=this,n=this.workingElements.map(function(t){return i._elementToJSON(t)});return i.blocking=!0,i.creationFn(n,t).always(function(){i.blocking=!1}).fail(function(t,e,n){i.trigger("error",{xhr:t,status:e,message:c("An error occurred while creating this collection")})}).done(function(t,e,n){i.trigger("collection:created",t,e,n),i.metric("collection:created",t),"function"==typeof i.oncreate&&i.oncreate.call(this,t,e,n)})},_setUpBehaviors:function(){return this.on("error",this._errorHandler),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("elements:select",function(t){this._renderClearSelected()}),this.on("elements:discard",function(t){var e=t.source.element;this.removeElementView(t.source),this.workingElements=o.without(this.workingElements,e),this.workingElements.length||this._renderNoElementsLeft()}),this},_errorHandler:function(t){this.error(t);var e=this;if(content=t.message||c("An error occurred"),t.xhr){var i=t.xhr,n=t.message;0===i.readyState&&0===i.status?content+=": "+c("Galaxy could not be reached and may be updating.")+c(" Try again in a few minutes."):i.responseJSON?content+=":
",c(["Collections of datasets are permanent, ordered lists of datasets that can be passed to tools and ","workflows in order to have analyses done on each member of the entire group. This interface allows ","you to create a collection and re-order the final collection."].join("")),"
","
","
",c(["Rename elements in the list by clicking on ",'the existing name.'].join("")),"
","
",c(["Discard elements from the final created list by clicking on the ",'"Discard" button.'].join("")),"
","
",c(["Reorder the list by clicking and dragging elements. Select multiple elements by clicking on ",'them and you can then move those selected by dragging the ',"entire group. Deselect them by clicking them again or by clicking the ",'the "Clear selected" link.'].join("")),"
","
",c(['Click the "Start over" link to begin again as if you had just opened ',"the interface."].join("")),"
","
",c(['Click the "Cancel" button to exit the interface.'].join("")),"
","
","
",c(['Once your collection is complete, enter a name and ','click "Create list".'].join("")),"
"].join("")),invalidElements:o.template([c("The following selections could not be included due to problems:"),"
','',"<% if( _.size( problems ) ){ %>",c("The following selections could not be included due to problems"),":","
<% _.each( problems, function( problem ){ %>","
<%- problem.element.name %>: <%- problem.text %>
","<% }); %>
","<% } else if( _.size( elements ) < 1 ){ %>",c("No datasets were selected"),".","<% } %>"," ",c("At least one element is needed for the collection"),". ",c("You may need to "),'',c("cancel")," ",c("and reselect new elements"),".","","
","
",'"].join(""))},toString:function(){return"ListCollectionCreator"}}),f=function(t,e,i){var s,a=l.Deferred(),r=Galaxy.modal||new n.View;return e=o.defaults(e||{},{elements:t,oncancel:function(){r.hide(),a.reject("cancelled")},oncreate:function(t,e){r.hide(),a.resolve(e)}}),s=new i(e),r.show({title:e.title||c("Create a collection"),body:s.$el,width:"80%",height:"100%",closing_events:!0}),s.render(),window._collectionCreator=s,a},g=function(t,e){return e=e||{},e.title=c("Create a collection from a list of datasets"),f(t,e,p)};return{DatasetCollectionElementView:u,ListCollectionCreator:p,collectionCreatorModal:f,listCollectionCreatorModal:g,createListCollection:d}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(3),i(1),i(1))},function(t,e,i){var n,s;(function(a,o,r,l){n=[i(48),i(15),i(26),i(6),i(5)],s=function(t,e,i,n,s){var c="dataset",d=t.ListItemView,h=d.extend({_logNamespace:c,className:d.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(t){t.logger&&(this.logger=this.model.logger=t.logger),this.log(this+".initialize:",t),d.prototype.initialize.call(this,t),this.linkTarget=t.linkTarget||"_blank"},_setUpListeners:function(){d.prototype._setUpListeners.call(this),
+this.model.on("change",function(t,e){this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()?this.model.fetch():this.render()},this)},_fetchModelDetails:function(){var t=this;return t.model.inReadyState()&&!t.model.hasDetails()?t.model.fetch({silent:!0}):a.when()},remove:function(t,e){var i=this;t=t||this.fxSpeed,this.$el.fadeOut(t,function(){o.View.prototype.remove.call(i),e&&e.call(i)})},render:function(t){return d.prototype.render.call(this,t)},_swapNewRender:function(t){return d.prototype._swapNewRender.call(this,t),this.model.has("state")&&this.$el.addClass("state-"+this.model.get("state")),this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var t=this.model.get("state");if(t===e.NOT_VIEWABLE||t===e.DISCARDED||!this.model.get("accessible"))return null;var n={target:this.linkTarget,classes:"display-btn"};if(this.model.get("purged"))n.disabled=!0,n.title=s("Cannot display datasets removed from disk");else if(t===e.UPLOAD)n.disabled=!0,n.title=s("This dataset must finish uploading before it can be viewed");else if(t===e.NEW)n.disabled=!0,n.title=s("This dataset is not yet viewable");else{n.title=s("View data"),n.href=this.model.urls.display;var a=this;n.onclick=function(t){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.addDataset(a.model.get("id")),t.preventDefault())}}return n.faIcon="fa-eye",i(n)},_renderDetails:function(){if(this.model.get("state")===e.NOT_VIEWABLE)return r(this.templates.noAccess(this.model.toJSON(),this));var t=d.prototype._renderDetails.call(this);return t.find(".actions .left").empty().append(this._renderSecondaryActions()),t.find(".summary").html(this._renderSummary()).prepend(this._renderDetailMessages()),t.find(".display-applications").html(this._renderDisplayApplications()),this._setUpBehaviors(t),t},_renderSummary:function(){var t=this.model.toJSON(),e=this.templates.summaries[t.state];return(e=e||this.templates.summaries.unknown)(t,this)},_renderDetailMessages:function(){var t=this,e=r(''),i=t.model.toJSON();return l.each(t.templates.detailMessages,function(n){e.append(r(n(i,t)))}),e},_renderDisplayApplications:function(){return this.model.isDeletedOrPurged()?"":[this.templates.displayApplications(this.model.get("display_apps"),this),this.templates.displayApplications(this.model.get("display_types"),this)].join("")},_renderSecondaryActions:function(){switch(this.debug("_renderSecondaryActions"),this.model.get("state")){case e.NOT_VIEWABLE:return[];case e.OK:case e.FAILED_METADATA:case e.ERROR:return[this._renderDownloadButton(),this._renderShowParamsButton()]}return[this._renderShowParamsButton()]},_renderShowParamsButton:function(){return i({title:s("View details"),classes:"params-btn",href:this.model.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_renderDownloadButton:function(){return this.model.get("purged")||!this.model.hasData()?null:l.isEmpty(this.model.get("meta_files"))?r(['','',""].join("")):this._renderMetaFileDownloadButton()},_renderMetaFileDownloadButton:function(){var t=this.model.urls;return r(['
"}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2))},function(t,e,i){var n,s;(function(a,o){n=[i(4),i(7),i(43),i(56),i(55),i(52)],s=function(t,e,i,n,s,r){return a.Model.extend({types:{text:"_fieldText",select:"_fieldSelect",data_column:"_fieldSelect",genomebuild:"_fieldSelect",data:"_fieldData",data_collection:"_fieldData",integer:"_fieldSlider","float":"_fieldSlider","boolean":"_fieldBoolean",drill_down:"_fieldDrilldown",color:"_fieldColor",hidden:"_fieldHidden",hidden_data:"_fieldHidden",baseurl:"_fieldHidden",library_data:"_fieldLibrary",ftpfile:"_fieldFtp"},initialize:function(t,e){this.app=t},create:function(t){void 0===t.value&&(t.value=null),void 0===t.default_value&&(t.default_value=t.value);var e=null,i=this.types[t.type];return i&&"function"==typeof this[i]&&(e=this[i].call(this,t)),e||(this.app.incompatible=!0,e=t.options?this._fieldSelect(t):this._fieldText(t),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+t.type+").")),void 0!==t.value&&e.value(t.value),e},_fieldData:function(t){var e=this;return new i.View(this.app,{id:"field-"+t.id,extensions:t.extensions,optional:t.optional,multiple:t.multiple,type:t.type,data:t.options,onchange:function(){e.app.trigger("change")}})},_fieldSelect:function(t){if(t.is_workflow)return this._fieldText(t);"data_column"==t.type&&(t.error_text="Missing columns in referenced dataset.");var i=[];for(var n in t.options){var s=t.options[n];i.push({label:s[0],value:s[1]})}var a=e.Select;switch(t.display){case"checkboxes":a=e.Checkbox;break;case"radio":a=e.Radio}var o=this;return new a.View({id:"field-"+t.id,data:i,error_text:t.error_text||"No options available",optional:t.optional&&null===t.default_value,multiple:t.multiple,optional:t.optional,searchable:t.searchable,onchange:function(){o.app.trigger("change")}})},_fieldDrilldown:function(t){if(t.is_workflow)return this._fieldText(t);var i=this;return new e.Drilldown.View({id:"field-"+t.id,data:t.options,display:t.display,onchange:function(){i.app.trigger("change")}})},_fieldText:function(i){if(i.options)if(i.area=i.multiple,t.validate(i.value)){if(o.isArray(i.value)){var n="";for(var s in i.value){if(n+=String(i.value[s]),!i.multiple)break;n+="\n"}i.value=n}}else i.value=null;var a=this;return new e.Input({id:"field-"+i.id,area:i.area,onchange:function(t){i.onchange?i.onchange(t):a.app.trigger("change")}})},_fieldSlider:function(t){var i=this;return new e.Slider.View({id:"field-"+t.id,precise:"float"==t.type,is_workflow:t.is_workflow,min:t.min,max:t.max,onchange:function(){i.app.trigger("change")}})},_fieldHidden:function(t){return new e.Hidden({id:"field-"+t.id,info:t.info})},_fieldBoolean:function(t){var i=this;return new e.RadioButton.View({id:"field-"+t.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:function(){i.app.trigger("change")}})},_fieldColor:function(t){var e=this;return new r({id:"field-"+t.id,onchange:function(){e.app.trigger("change")}})},_fieldLibrary:function(t){var e=this;return new n.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:function(){e.app.trigger("change")}})},_fieldFtp:function(t){var e=this;return new s.View({id:"field-"+t.id,optional:t.optional,multiple:t.multiple,onchange:function(){e.app.trigger("change")}})}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(a,o,r){n=[i(4),i(17),i(11),i(7)],s=function(t,e,i,n){var s=a.View.extend({initialize:function(i){this.options=t.merge(i,{title:"Section",empty_text:"Not available.",max:null,min:null}),this.setElement(""),this.button_new=new n.ButtonIcon({icon:"fa-plus",title:"Insert "+this.options.title_new,tooltip:"Add new "+this.options.title_new+" block",floating:"clear",onclick:function(){i.onnew&&i.onnew()}}),this.table=new e.View({cls:"ui-table-plain",content:""}),this.$el.append(this.table.$el),this.$el.append(o("").append(this.button_new.$el)),this.list={},this.n=0},size:function(){return this.n},add:function(t){if(!t.id||this.list[t.id])return void Galaxy.emit.debug("form-repeat::add()","Duplicate repeat block id.");this.n++;var e=new n.ButtonIcon({icon:"fa-trash-o",tooltip:"Delete this repeat block",cls:"ui-button-icon-plain",onclick:function(){t.ondel&&t.ondel()}}),s=new i.View({id:t.id,title:"placeholder",cls:"ui-portlet-repeat",operations:{button_delete:e}});s.append(t.$el),s.$el.addClass("section-row"),this.list[t.id]=s,this.table.add(s.$el),this.table.append("row_"+t.id,!0),this.options.max>0&&this.n>=this.options.max&&this.button_new.disable(),this._refresh()},del:function(t){if(!this.list[t])return void Galaxy.emit.debug("form-repeat::del()","Invalid repeat block id.");this.n--;var e=this.table.get("row_"+t);e.remove(),delete this.list[t],this.button_new.enable(),this._refresh()},hideOptions:function(){this.button_new.$el.hide(),r.each(this.list,function(t){t.hideOperation("button_delete")}),r.isEmpty(this.list)&&this.$el.append(o("").addClass("ui-form-info").html(this.options.empty_text))},_refresh:function(){var t=0;for(var e in this.list){var i=this.list[e];i.title(++t+": "+this.options.title),this.n>this.options.min?i.showOperation("button_delete"):i.hideOperation("button_delete")}}});return{View:s}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3))},function(t,e,i){var n,s;(function(a,o,r,l){n=[i(4),i(17),i(7),i(11),i(41),i(39),i(40)],s=function(t,e,i,n,s,c,d){var h=a.View.extend({initialize:function(t,i){this.app=t,this.inputs=i.inputs,i.cls="ui-table-plain",i.cls_tr="section-row",this.table=new e.View(i),this.parameters=new d(t,i),this.setElement(this.table.$el),this.render()},render:function(){this.table.delAll();for(var t in this.inputs)this.add(this.inputs[t])},add:function(e){var i=o.extend(!0,{},e);i.id=e.id=t.uid(),this.app.input_list[i.id]=i;var n=i.type;switch(n){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(t){var e=this;t.test_param.id=t.id,this.app.options.sustain_conditionals&&(t.test_param.disabled=!0);var i=this._addRow(t.test_param);i.options.onchange=function(i){var n=e.app.data.matchCase(t,i);for(var s in t.cases){var a=t.cases[s],o=t.id+"-section-"+s,r=e.table.get(o),l=!1;for(var c in a.inputs)if(!a.inputs[c].hidden){l=!0;break}s==n&&l?r.fadeIn("fast"):r.hide()}e.app.trigger("change")};for(var n in t.cases){var s=t.id+"-section-"+n,a=new h(this.app,{inputs:t.cases[n].inputs});a.$el.addClass("ui-table-section"),this.table.add(a.$el),this.table.append(s)}i.trigger("change")},_addRepeat:function(t){function e(e){var s=t.id+"-section-"+n++,o=new h(i.app,{inputs:e});a.add({id:s,$el:o.$el,ondel:function(){a.del(s),i.app.trigger("change")}})}for(var i=this,n=0,a=new s.View({title:t.title||"Repeat",title_new:t.title||"",min:t.min,max:t.max,onnew:function(){e(t.inputs),i.app.trigger("change")}}),o=t.min,l=r.size(t.cache),d=0;dd?t.cache[d]:t.inputs,e(u)}this.app.options.sustain_repeats&&a.hideOptions();var p=new c(this.app,{label:t.title||t.name,help:t.help,field:a});this.table.add(p.$el),this.table.append(t.id)},_addSection:function(t){var e=this,s=new h(e.app,{inputs:t.inputs}),a=new i.ButtonIcon({icon:"fa-eye-slash",tooltip:"Show/hide section",cls:"ui-button-icon-plain"}),o=new n.View({title:t.title||t.name,cls:"ui-portlet-section",collapsible:!0,collapsed:!0,operations:{button_visible:a}});o.append(s.$el),o.append(l("").addClass("ui-form-info").html(t.help)),o.setOperation("button_visible",function(){o.collapsed?o.expand():o.collapse()}),o.on("expanded",function(){a.setIcon("fa-eye")}),o.on("collapsed",function(){a.setIcon("fa-eye-slash")}),this.app.on("expand",function(t){o.$("#"+t).length>0&&o.expand()}),t.expanded&&o.expand(),this.table.add(o.$el),this.table.append(t.id)},_addRow:function(t){var e=t.id,i=this.parameters.create(t);this.app.field_list[e]=i;var n=new c(this.app,{name:t.name,label:t.label||t.name,value:t.value,default_value:t.default_value,text_value:t.text_value||t.value,collapsible_value:t.collapsible_value,collapsible_preview:t.collapsible_preview,help:t.help,argument:t.argument,disabled:t.disabled,field:i});return this.app.element_list[e]=n,this.table.add(n.$el),this.table.append(e),t.hidden&&this.table.get(e).hide(),i}});return{View:h}}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1),i(3),i(1))},function(t,e,i){var n,s;(function(a,o,r){n=[i(4),i(7),i(31)],s=function(t,e,i){var n=a.View.extend({initialize:function(i,n){this.app=i,this.options=n,this.history={};var s=this;this.setElement(''),this.list={};var a=[];"data_collection"==n.type?this.mode="collection":n.multiple?this.mode="multiple":this.mode="single",this.current=this.mode,this.list={};var l=t.textify(n.extensions),c="No dataset available.";l&&(c="No "+l+" dataset available.");var d="No dataset list available.";if(l&&(d="No "+l+" dataset collection available."),"single"==this.mode&&(a.push({icon:"fa-file-o",value:"single",tooltip:"Single dataset"}),this.select_single=new e.Select.View({optional:n.optional,error_text:c,onchange:function(){s.trigger("change")}}),this.list.single={field:this.select_single,type:"hda"}),("single"==this.mode||"multiple"==this.mode)&&(a.push({icon:"fa-files-o",value:"multiple",tooltip:"Multiple datasets"}),this.select_multiple=new e.Select.View({multiple:!0,searchable:!1,optional:n.optional,error_text:c,onchange:function(){s.trigger("change")}}),this.list.multiple={field:this.select_multiple,type:"hda"}),"single"==this.mode||"multiple"==this.mode||"collection"==this.mode){a.push({icon:"fa-folder-o",value:"collection",tooltip:"Dataset collection"});var h="multiple"==this.mode;this.select_collection=new e.Select.View({error_text:d,multiple:h,searchable:!1,optional:n.optional,onchange:function(){s.trigger("change")}}),this.list.collection={field:this.select_collection,type:"hdca"}}this.button_type=new e.RadioButton.View({value:this.current,data:a,onchange:function(t){s.current=t,s.refresh(),s.trigger("change")}}),this.$batch=o(this.template_batch());var u=r.size(this.list),p=0;u>1&&(this.$el.append(this.button_type.$el),p=Math.max(0,35*r.size(this.list))+"px");for(var f in this.list)this.$el.append(this.list[f].field.$el.css({"margin-left":p}));this.$el.append(this.$batch.css({"margin-left":p})),this.update(n.data),void 0!==this.options.value&&this.value(this.options.value),this.refresh(),this.on("change",function(){n.onchange&&n.onchange(s.value())})},wait:function(){for(var t in this.list)this.list[t].field.wait()},unwait:function(){for(var t in this.list)this.list[t].field.unwait()},update:function(t){function e(t,e){if(t){var n=[];for(var s in e){var a=e[s];n.push({label:a.hid+": "+a.name,value:a.id}),i.history[a.id+"_"+a.src]=a}t.update(n)}}var i=this;e(this.select_single,t.hda),e(this.select_multiple,t.hda),e(this.select_collection,t.hdca)},value:function(t){if(void 0!==t)if(t&&t.values)try{var e=[];for(var i in t.values)e.push(t.values[i].id);t&&t.values.length>0&&"hdca"==t.values[0].src?(this.current="collection",this.select_collection.value(e)):"multiple"==this.mode?(this.current="multiple",this.select_multiple.value(e)):(this.current="single",this.select_single.value(e[0]))}catch(n){Galaxy.emit.debug("tools-select-content::value()","Skipped.")}else for(var i in this.list)this.list[i].field.value(null);this.refresh();var s=this._select().value();if(null===s)return null;if(s instanceof Array||(s=[s]),0===s.length)return null;var a={batch:this._batch(),values:[]};for(var i in s){var o=this.history[s[i]+"_"+this.list[this.current].type];if(!o)return null;a.values.push(o)}return a.values.sort(function(t,e){return t.hid-e.hid}),a},refresh:function(){this.button_type.value(this.current);for(var t in this.list){var e=this.list[t].field.$el;this.current==t?e.show():e.hide()}this._batch()?this.$batch.show():this.$batch.hide()},_select:function(){return this.list[this.current].field},_batch:function(){if("collection"==this.current){var t=this.history[this._select().value()+"_hdca"];if(t&&t.map_over_type)return!0}return"single"!=this.current&&"single"==this.mode?!0:!1},template_batch:function(){return'
This is a batch mode input field. A separate job will be triggered for each dataset.
"},useData:!0})},function(t,e,i){var n=i(12);t.exports=(n["default"]||n).template({1:function(t,e,i,n,s){var a=t.lambda,o=t.escapeExpression;return''+o(a(e,e))+" "},compiler:[7,">= 4.0.0"],main:function(t,e,i,n,s){var a,o,r=null!=e?e:{},l=i.helperMissing,c="function",d=t.escapeExpression;return''+(null!=(a=i.each.call(r,null!=e?e.labels:e,{name:"each",hash:{},fn:t.program(1,s,0),inverse:t.noop,data:s}))?a:"")+'\n'+d((o=null!=(o=i.name||(null!=e?e.name:e))?o:l,typeof o===c?o.call(r,{name:"name",hash:{},data:s}):o))+"\n"+d((o=null!=(o=i.description||(null!=e?e.description:e))?o:l,typeof o===c?o.call(r,{name:"description",hash:{},data:s}):o))+"\n"},useData:!0})},function(t,e,i){var n=i(12);t.exports=(n["default"]||n).template({compiler:[7,">= 4.0.0"],main:function(t,e,i,n,s){var a,o=null!=e?e:{},r=i.helperMissing,l="function",c=t.escapeExpression;return'\n\n\n'},useData:!0})},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function a(){var t=new r.HandlebarsEnvironment;return p.extend(t,r),t.SafeString=c["default"],t.Exception=h["default"],t.Utils=p,t.escapeExpression=p.escapeExpression,t.VM=g,t.template=function(e){return g.template(e,t)},t}e.__esModule=!0;var o=i(27),r=s(o),l=i(81),c=n(l),d=i(9),h=n(d),u=i(8),p=s(u),f=i(80),g=s(f),m=i(79),v=n(m),_=a();_.create=a,v["default"](_),_["default"]=_,e["default"]=_,t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){o["default"](t)}e.__esModule=!0,e.registerDefaultDecorators=s;var a=i(69),o=n(a)},function(t,e,i){"use strict";e.__esModule=!0;var n=i(8);e["default"]=function(t){t.registerDecorator("inline",function(t,e,i,s){var a=t;return e.partials||(e.partials={},a=function(s,a){var o=i.partials;i.partials=n.extend({},o,e.partials);var r=t(s,a);return i.partials=o,r}),e.partials[s.args[0]]=s.fn,a})},t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){o["default"](t),l["default"](t),d["default"](t),u["default"](t),f["default"](t),m["default"](t),_["default"](t)}e.__esModule=!0,e.registerDefaultHelpers=s;var a=i(71),o=n(a),r=i(72),l=n(r),c=i(73),d=n(c),h=i(74),u=n(h),p=i(75),f=n(p),g=i(76),m=n(g),v=i(77),_=n(v)},function(t,e,i){"use strict";e.__esModule=!0;var n=i(8);e["default"]=function(t){t.registerHelper("blockHelperMissing",function(e,i){var s=i.inverse,a=i.fn;if(e===!0)return a(this);if(e===!1||null==e)return s(this);if(n.isArray(e))return e.length>0?(i.ids&&(i.ids=[i.name]),t.helpers.each(e,i)):s(this);if(i.data&&i.ids){var o=n.createFrame(i.data);o.contextPath=n.appendContextPath(i.data.contextPath,i.name),i={data:o}}return a(e,i)})},t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var s=i(8),a=i(9),o=n(a);e["default"]=function(t){t.registerHelper("each",function(t,e){function i(e,i,a){c&&(c.key=e,c.index=i,c.first=0===i,c.last=!!a,d&&(c.contextPath=d+e)),l+=n(t[e],{data:c,blockParams:s.blockParams([t[e],e],[d+e,null])})}if(!e)throw new o["default"]("Must pass iterator to #each");var n=e.fn,a=e.inverse,r=0,l="",c=void 0,d=void 0;if(e.data&&e.ids&&(d=s.appendContextPath(e.data.contextPath,e.ids[0])+"."),s.isFunction(t)&&(t=t.call(this)),e.data&&(c=s.createFrame(e.data)),t&&"object"==typeof t)if(s.isArray(t))for(var h=t.length;h>r;r++)r in t&&i(r,r,r===t.length-1);else{var u=void 0;for(var p in t)t.hasOwnProperty(p)&&(void 0!==u&&i(u,r-1),u=p,r++);void 0!==u&&i(u,r-1,!0)}return 0===r&&(l=a(this)),l})},t.exports=e["default"]},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var s=i(9),a=n(s);e["default"]=function(t){t.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new a["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},t.exports=e["default"]},function(t,e,i){"use strict";e.__esModule=!0;var n=i(8);e["default"]=function(t){t.registerHelper("if",function(t,e){return n.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||n.isEmpty(t)?e.inverse(this):e.fn(this)}),t.registerHelper("unless",function(e,i){return t.helpers["if"].call(this,e,{fn:i.inverse,inverse:i.fn,hash:i.hash})})},t.exports=e["default"]},function(t,e){"use strict";e.__esModule=!0,e["default"]=function(t){t.registerHelper("log",function(){for(var e=[void 0],i=arguments[arguments.length-1],n=0;n=0?e:parseInt(t,10)}return t},log:function(t){if(t=s.lookupLevel(t),"undefined"!=typeof console&&s.lookupLevel(s.level)<=t){var e=s.methodMap[t];console[e]||(e="log");for(var i=arguments.length,n=Array(i>1?i-1:0),a=1;i>a;a++)n[a-1]=arguments[a];console[e].apply(console,n)}}};e["default"]=s,t.exports=e["default"]},function(t,e){(function(i){"use strict";e.__esModule=!0,e["default"]=function(t){var e="undefined"!=typeof i?i:window,n=e.Handlebars;t.noConflict=function(){return e.Handlebars===t&&(e.Handlebars=n),t}},t.exports=e["default"]}).call(e,function(){return this}())},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e["default"]=t,e}function a(t){var e=t&&t[0]||1,i=v.COMPILER_REVISION;if(e!==i){if(i>e){var n=v.REVISION_CHANGES[i],s=v.REVISION_CHANGES[e];throw new m["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+s+").")}throw new m["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")}}function o(t,e){function i(i,n,s){s.hash&&(n=f.extend({},n,s.hash),s.ids&&(s.ids[0]=!0)),i=e.VM.resolvePartial.call(this,i,n,s);var a=e.VM.invokePartial.call(this,i,n,s);if(null==a&&e.compile&&(s.partials[s.name]=e.compile(i,t.compilerOptions,e),a=s.partials[s.name](n,s)),null!=a){if(s.indent){for(var o=a.split("\n"),r=0,l=o.length;l>r&&(o[r]||r+1!==l);r++)o[r]=s.indent+o[r];a=o.join("\n")}return a}throw new m["default"]("The partial "+s.name+" could not be compiled when running in runtime-only mode")}function n(e){function i(e){return""+t.main(s,e,s.helpers,s.partials,o,l,r)}var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=a.data;n._setup(a),!a.partial&&t.useData&&(o=h(e,o));var r=void 0,l=t.useBlockParams?[]:void 0;return t.useDepths&&(r=a.depths?e!==a.depths[0]?[e].concat(a.depths):a.depths:[e]),(i=u(t.main,i,s,a.depths||[],o,l))(e,a)}if(!e)throw new m["default"]("No environment passed to template");if(!t||!t.main)throw new m["default"]("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var s={strict:function(t,e){if(!(e in t))throw new m["default"]('"'+e+'" not defined in '+t);return t[e]},lookup:function(t,e){for(var i=t.length,n=0;i>n;n++)if(t[n]&&null!=t[n][e])return t[n][e]},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:f.escapeExpression,invokePartial:i,fn:function(e){var i=t[e];return i.decorator=t[e+"_d"],i},programs:[],program:function(t,e,i,n,s){var a=this.programs[t],o=this.fn(t);return e||s||n||i?a=r(this,t,o,e,i,n,s):a||(a=this.programs[t]=r(this,t,o)),a},data:function(t,e){for(;t&&e--;)t=t._parent;return t},merge:function(t,e){var i=t||e;return t&&e&&t!==e&&(i=f.extend({},e,t)),i},noop:e.VM.noop,compilerInfo:t.compiler};return n.isTop=!0,n._setup=function(i){i.partial?(s.helpers=i.helpers,s.partials=i.partials,s.decorators=i.decorators):(s.helpers=s.merge(i.helpers,e.helpers),t.usePartial&&(s.partials=s.merge(i.partials,e.partials)),(t.usePartial||t.useDecorators)&&(s.decorators=s.merge(i.decorators,e.decorators)))},n._child=function(e,i,n,a){if(t.useBlockParams&&!n)throw new m["default"]("must pass block params");if(t.useDepths&&!a)throw new m["default"]("must pass parent depths");return r(s,e,t[e],i,0,n,a)},n}function r(t,e,i,n,s,a,o){function r(e){var s=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=o;return o&&e!==o[0]&&(r=[e].concat(o)),i(t,e,t.helpers,t.partials,s.data||n,a&&[s.blockParams].concat(a),r)}return r=u(i,r,t,o,n,a),r.program=e,r.depth=o?o.length:0,r.blockParams=s||0,r}function l(t,e,i){return t?t.call||i.name||(i.name=t,t=i.partials[t]):t="@partial-block"===i.name?i.data["partial-block"]:i.partials[i.name],t}function c(t,e,i){i.partial=!0,i.ids&&(i.data.contextPath=i.ids[0]||i.data.contextPath);var n=void 0;if(i.fn&&i.fn!==d&&(i.data=v.createFrame(i.data),n=i.data["partial-block"]=i.fn,n.partials&&(i.partials=f.extend({},i.partials,n.partials))),void 0===t&&n&&(t=n),void 0===t)throw new m["default"]("The partial "+i.name+" could not be found");return t instanceof Function?t(e,i):void 0}function d(){return""}function h(t,e){return e&&"root"in e||(e=e?v.createFrame(e):{},e.root=t),e}function u(t,e,i,n,s,a){if(t.decorator){var o={};e=t.decorator(e,o,i,n&&n[0],s,a,n),f.extend(e,o)}return e}e.__esModule=!0,e.checkRevision=a,e.template=o,e.wrapProgram=r,e.resolvePartial=l,e.invokePartial=c,e.noop=d;var p=i(8),f=s(p),g=i(9),m=n(g),v=i(27)},function(t,e){"use strict";function i(t){this.string=t}e.__esModule=!0,i.prototype.toString=i.prototype.toHTML=function(){return""+this.string},e["default"]=i,t.exports=e["default"]},,,,,,,,,,,function(t,e,i){var n,s;(function(a,o){n=[i(6),i(5),i(19)],s=function(t,e){var i=a.View.extend(t.LoggableMixin).extend(t.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(t){t=t||{},this.tooltipConfig=t.tooltipConfig||{placement:"bottom"},this.listenTo(this.model,"change:annotation",function(){this.render()}),this.hiddenUntilActivated(t.$activator,t)},render:function(){var t=this;return this.$el.html(this._template()),this.$el.find("[title]").tooltip(this.tooltipConfig),this.$annotation().make_text_editable({use_textarea:!0,on_finish:function(e){t.$annotation().text(e),t.model.save({annotation:e},{silent:!0}).fail(function(){t.$annotation().text(t.model.previous("annotation"))})}}),this},_template:function(){var t=this.model.get("annotation");return['",'
This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at '+this.options.ftp_upload_site+' using your Galaxy credentials (email address and password).
'}})}.apply(e,n),!(void 0!==s&&(t.exports=s))}).call(e,i(2),i(1))},function(t,e,i){var n,s;(function(a,o,r){n=[i(4)],s=function(t){return a.View.extend({options:{class_check:"fa-check-square-o",class_uncheck:"fa-square-o",parameters:[{id:"space_to_tab",title:"Convert spaces to tabs"},{id:"to_posix_lines",title:"Use POSIX standard"}]},initialize:function(t){this.model=t.model,this.setElement(o("").addClass("upload-settings")),this.$el.append(o("").addClass("upload-settings-cover")),this.$el.append(o("