/
analysis.bundled.js
17 lines (17 loc) · 426 KB
/
analysis.bundled.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
webpackJsonp([3,1],[function(e,t,i){(function(e,t){var n=i(1),s=n,a=i(30).GalaxyApp,o=i(62),r=i(95),l=i(94),c=i(31),d=i(25),h=i(136),u=i(135),p=i(84),f=i(77);Workflows=i(139),HistoryList=i(121),WorkflowsConfigureMenu=i(138),window.app=function(i,n){window.Galaxy=new a(i,n),Galaxy.debug("analysis app"),Galaxy.params=Galaxy.config.params;var g=e.View.extend({initialize:function(e){this.message=e.message||"Undefined Message",this.msg_status=e.type||"info",this.render()},render:function(){this.$el.html(t.escape(this.message)).addClass(this.msg_status+"message")}}),m=e.Router.extend({initialize:function(e,t){this.page=e,this.options=t},push:function(e,t){t=t||{},t.__identifer=Math.random().toString(36).substr(2),s.isEmptyObject(t)||(e+=e.indexOf("?")==-1?"?":"&",e+=s.param(t,!0)),this.navigate(e,{trigger:!0})},execute:function(e,t,i){Galaxy.debug("router execute:",e,t,i);var n=o.parse(t.pop());t.push(n),e&&(this.authenticate(t,i)?e.apply(this,t):this.loginRequired())},routes:{"(/)":"home","(/)root*":"home","(/)tours(/)(:tour_id)":"show_tours","(/)user(/)":"show_user","(/)user(/)(:form_id)":"show_user_form","(/)workflow(/)":"show_workflows","(/)pages(/)(:action_id)":"show_pages","(/)histories(/)(:action_id)":"show_histories","(/)workflow/configure_menu(/)":"show_configure_menu","(/)custom_builds":"show_custom_builds"},require_login:["show_user","show_user_form","show_workflows","show_configure_menu"],loginRequired:function(){this.page.display(new g({type:"error",message:"You must be logged in to make this request."}))},authenticate:function(e,t){return Galaxy.user&&Galaxy.user.id||this.require_login.indexOf(t)==-1},show_tours:function(e){e?p.giveTour(e):this.page.display(new p.ToursView)},show_user:function(){this.page.display(new h.View)},show_user_form:function(e){this.page.display(new h.Forms({form_id:e,user_id:Galaxy.params.id}))},show_histories:function(e){this.page.display(new HistoryList.View)},show_pages:function(e){this.page.display(new f({url_base:Galaxy.root+"page/list_published",dict_format:!0}))},show_workflows:function(){this.page.display(new Workflows.View)},show_configure_menu:function(){this.page.display(new WorkflowsConfigureMenu.View)},show_custom_builds:function(){var e=this,t=this.page.historyPanel.historyView;return t&&t.model&&t.model.id?void this.page.display(new u.View):void window.setTimeout(function(){e.show_custom_builds()},500)},home:function(e){e.tool_id||e.job_id?"upload1"===e.tool_id?(this.page.toolPanel.upload.show(),this._loadCenterIframe("welcome")):this._loadToolForm(e):e.workflow_id?this._loadCenterIframe("workflow/run?id="+e.workflow_id):e.m_c?this._loadCenterIframe(e.m_c+"/"+e.m_a):this._loadCenterIframe("welcome")},_loadToolForm:function(e){e.id=e.tool_id,this.page.display(new d.View(e))},_loadCenterIframe:function(e,t){t=t||Galaxy.root,e=t+e,this.page.$("#galaxy_main").prop("src",e)}});s(function(){Galaxy.page=new c.View(t.extend(i,{Left:r,Right:l,Router:m})),e.history.start({root:Galaxy.root,pushState:!0})})}}).call(t,i(3),i(2))},,,,,,,function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(23),i(57),i(22),i(53),i(12),i(8)],s=function(e,t,i,n,s,l,c){var d=a.View.extend({tagName:"label",initialize:function(e){this.model=e&&e.model||new a.Model(e),this.tagName=e.tagName||this.tagName,this.setElement(o("<"+this.tagName+"/>")),this.listenTo(this.model,"change",this.render,this),this.render()},title:function(e){this.model.set("title",e)},value:function(){return this.model.get("title")},render:function(){return this.$el.removeClass().addClass("ui-label").addClass(this.model.get("cls")).html(this.model.get("title")),this}}),h=a.View.extend({initialize:function(e){this.model=e&&e.model||new a.Model({message:null,status:"info",cls:"",persistent:!1,fade:!0}).set(e),this.listenTo(this.model,"change",this.render,this),this.render()},update:function(e){this.model.set(e)},render:function(){this.$el.removeClass().addClass("ui-message").addClass(this.model.get("cls"));var e=this.model.get("status");if(this.model.get("large")?this.$el.addClass(("success"==e&&"done"||"danger"==e&&"error"||e)+"messagelarge"):this.$el.addClass("alert").addClass("alert-"+e),this.model.get("message")){if(this.$el.html(this.messageForDisplay()),this.$el[this.model.get("fade")?"fadeIn":"show"](),this.timeout&&window.clearTimeout(this.timeout),!this.model.get("persistent")){var t=this;this.timeout=window.setTimeout(function(){t.model.set("message","")},3e3)}}else this.$el.fadeOut();return this},messageForDisplay:function(){return r.escape(this.model.get("message"))}}),u=h.extend({messageForDisplay:function(){return this.model.get("message")}}),p=a.View.extend({initialize:function(e){this.model=e&&e.model||new a.Model({type:"text",placeholder:"",disabled:!1,readonly:!1,visible:!0,cls:"",area:!1,color:null,style:null}).set(e),this.tagName=this.model.get("area")?"textarea":"input",this.setElement(o("<"+this.tagName+"/>")),this.listenTo(this.model,"change",this.render,this),this.render()},events:{input:"_onchange"},value:function(e){return void 0!==e&&this.model.set("value","string"==typeof e?e:""),this.model.get("value")},render:function(){var e=this;this.$el.removeClass().addClass("ui-"+this.tagName).addClass(this.model.get("cls")).addClass(this.model.get("style")).attr("id",this.model.id).attr("type",this.model.get("type")).attr("placeholder",this.model.get("placeholder")).css("color",this.model.get("color")||"").css("border-color",this.model.get("color")||"");var t=this.model.get("datalist");return o.isArray(t)&&t.length>0&&this.$el.autocomplete({source:function(t,i){i(e.model.get("datalist"))},change:function(){e._onchange()}}),this.model.get("value")!==this.$el.val()&&this.$el.val(this.model.get("value")),r.each(["readonly","disabled"],function(t){e.model.get(t)?e.$el.attr(t,!0):e.$el.removeAttr(t)}),this.$el[this.model.get("visible")?"show":"hide"](),this},_onchange:function(){this.value(this.$el.val()),this.model.get("onchange")&&this.model.get("onchange")(this.model.get("value"))}}),f=a.View.extend({initialize:function(e){this.model=e&&e.model||new a.Model(e),this.setElement(o("<div/>").append(this.$info=o("<div/>")).append(this.$hidden=o("<div/>"))),this.listenTo(this.model,"change",this.render,this),this.render()},value:function(e){return void 0!==e&&this.model.set("value",e),this.model.get("value")},render:function(){return this.$el.attr("id",this.model.id),this.$hidden.val(this.model.get("value")),this.model.get("info")?this.$info.show().text(this.model.get("info")):this.$info.hide(),this}}),g=a.View.extend({initialize:function(e){var t=this;this.model=e&&e.model||new a.Model(e),this.setElement(o("<div/>").append(this.$info=o("<div/>")).append(this.$file=o("<input/>").attr("type","file").addClass("ui-margin-bottom")).append(this.$text=o("<textarea/>").addClass("ui-textarea").attr("disabled",!0)).append(this.$wait=o("<i/>").addClass("fa fa-spinner fa-spin"))),this.listenTo(this.model,"change",this.render,this),this.$file.on("change",function(e){t._readFile(e)}),this.render()},value:function(e){return void 0!==e&&this.model.set("value",e),this.model.get("value")},render:function(){return this.$el.attr("id",this.model.id),this.model.get("info")?this.$info.show().text(this.model.get("info")):this.$info.hide(),this.model.get("value")?this.$text.text(this.model.get("value")).show():this.$text.hide(),this.model.get("wait")?this.$wait.show():this.$wait.hide(),this},_readFile:function(e){var t=this,i=e.target.files&&e.target.files[0];if(i){var n=new FileReader;n.onload=function(){t.model.set({wait:!1,value:this.result})},this.model.set({wait:!0,value:null}),n.readAsText(i)}}});return{Button:l.ButtonDefault,ButtonIcon:l.ButtonIcon,ButtonCheck:l.ButtonCheck,ButtonMenu:l.ButtonMenu,ButtonLink:l.ButtonLink,Input:p,Label:d,Message:h,UnescapedMessage:u,Upload:g,Modal:c,RadioButton:n.RadioButton,Checkbox:n.Checkbox,Radio:n.Radio,Select:t,Hidden:f,Slider:i,Drilldown:s}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},,function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(7)],s=function(e,t){var i=a.View.extend({visible:!1,initialize:function(i){var n=this;this.model=i&&i.model||new a.Model({id:e.uid(),cls:"ui-portlet",title:"",icon:"",buttons:null,body:null,scrollable:!0,nopadding:!1,operations:null,collapsible:!1,collapsible_button:!1,collapsed:!1,onchange_title:null}).set(i),this.setElement(this._template()),this.$body=this.$(".portlet-body"),this.$title_text=this.$(".portlet-title-text"),this.$title_icon=this.$(".portlet-title-icon"),this.$header=this.$(".portlet-header"),this.$content=this.$(".portlet-content"),this.$backdrop=this.$(".portlet-backdrop"),this.$buttons=this.$(".portlet-buttons"),this.$operations=this.$(".portlet-operations"),this.model.get("body")&&this.append(this.model.get("body")),this.collapsible_button=new t.ButtonIcon({icon:"fa-eye",tooltip:"Collapse/Expand",cls:"ui-button-icon-plain",onclick:function(){n[n.collapsed?"expand":"collapse"]()}}),this.render()},render:function(){var e=this,t=this.model.attributes;return this.$el.removeClass().addClass(t.cls).attr("id",t.id),this.$header[t.title?"show":"hide"](),this.$title_text.html(t.title),o.each([this.$content,this.$body],function(e){e[t.nopadding?"addClass":"removeClass"]("no-padding")}),t.icon?this.$title_icon.removeClass().addClass("portlet-title-icon fa").addClass(t.icon).show():this.$title_icon.hide(),this.$title_text[t.collapsible?"addClass":"removeClass"]("no-highlight collapsible").off(),t.collapsible&&(this.$title_text.on("click",function(){e[e.collapsed?"expand":"collapse"]()}),t.collapsed?this.collapse():this.expand()),this.$title_text.prop("disabled",!t.onchange_title),t.onchange_title&&this.$title_text.make_text_editable({on_finish:function(e){t.onchange_title(e)}}),t.buttons?(this.$buttons.empty().show(),r.each(this.model.get("buttons"),function(t,i){i.$el.prop("id",t),e.$buttons.append(i.$el)})):this.$buttons.hide(),this.$operations.empty,t.collapsible_button&&this.$operations.append(this.collapsible_button.$el),t.operations&&r.each(t.operations,function(t,i){i.$el.prop("id",t),e.$operations.append(i.$el)}),this},append:function(e){this.$body.append(e)},empty:function(){this.$body.empty()},header:function(){return this.$header},body:function(){return this.$body},show:function(){this.visible=!0,this.$el.fadeIn("fast")},hide:function(){this.visible=!1,this.$el.hide()},enableButton:function(e){this.$buttons.find("#"+e).prop("disabled",!1)},disableButton:function(e){this.$buttons.find("#"+e).prop("disabled",!0)},hideOperation:function(e){this.$operations.find("#"+e).hide()},showOperation:function(e){this.$operations.find("#"+e).show()},setOperation:function(e,t){this.$operations.find("#"+e).off("click").on("click",t)},title:function(e){return e&&this.$title_text.html(e),this.$title_text.html()},collapse:function(){this.collapsed=!0,this.$content.height("0%"),this.$body.hide(),this.collapsible_button.setIcon("fa-eye-slash")},expand:function(){this.collapsed=!1,this.$content.height("100%"),this.$body.fadeIn("fast"),this.collapsible_button.setIcon("fa-eye")},disable:function(){this.$backdrop.show()},enable:function(){this.$backdrop.hide()},_template:function(){return r("<div/>").append(r("<div/>").addClass("portlet-header").append(r("<div/>").addClass("portlet-operations")).append(r("<div/>").addClass("portlet-title").append(r("<i/>").addClass("portlet-title-icon")).append(r("<span/>").addClass("portlet-title-text")))).append(r("<div/>").addClass("portlet-content").append(r("<div/>").addClass("portlet-body")).append(r("<div/>").addClass("portlet-buttons"))).append(r("<div/>").addClass("portlet-backdrop"))}});return{View:i}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(8),i(26),i(13)],s=function(e,t,i){var n=a.Model.extend({}),s=a.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this.get("metadata")||this._set_metadata(),this.on("change",this._set_metadata,this)},_set_metadata:function(){var e=new n;o.each(o.keys(this.attributes),function(t){if(0===t.indexOf("metadata_")){var i=t.split("metadata_")[1];e.set(i,this.attributes[t]),delete this.attributes[t]}},this),this.set("metadata",e,{silent:!0})},get_metadata:function(e){return this.attributes.metadata.get(e)},urlRoot:Galaxy.root+"api/datasets"}),l=s.extend({defaults:o.extend({},s.prototype.defaults,{chunk_url:null,first_data_chunk:null,offset:0,at_eof:!1}),initialize:function(e){s.prototype.initialize.call(this),this.attributes.first_data_chunk&&(this.attributes.offset=this.attributes.first_data_chunk.offset),this.attributes.chunk_url=Galaxy.root+"dataset/display?dataset_id="+this.id,this.attributes.url_viz=Galaxy.root+"visualization"},get_next_chunk:function(){if(this.attributes.at_eof)return null;var e=this,t=r.Deferred();return r.getJSON(this.attributes.chunk_url,{offset:e.attributes.offset}).success(function(i){var n;""!==i.ck_data?(n=i,e.attributes.offset=i.offset):(e.attributes.at_eof=!0,n=null),t.resolve(n)}),t}}),c=a.Collection.extend({model:s}),d=a.View.extend({initialize:function(e){this.row_count=0,this.loading_chunk=!1,new p({model:e.model,$el:this.$el})},expand_to_container:function(){this.$el.height()<this.scroll_elt.height()&&this.attempt_to_fetch()},attempt_to_fetch:function(e){var t=this;!this.loading_chunk&&this.scrolled_to_bottom()&&(this.loading_chunk=!0,this.loading_indicator.show(),r.when(t.model.get_next_chunk()).then(function(e){e&&(t._renderChunk(e),t.loading_chunk=!1),t.loading_indicator.hide(),t.expand_to_container()}))},render:function(){this.loading_indicator=r("<div/>").attr("id","loading_indicator"),this.$el.append(this.loading_indicator);var e=r("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(e);var t=this.model.get_metadata("column_names"),i=r("<thead/>").appendTo(e),n=r("<tr/>").appendTo(i);if(t)n.append("<th>"+t.join("</th><th>")+"</th>");else for(var s=1;s<=this.model.get_metadata("columns");s++)n.append("<th>"+s+"</th>");var a=this,o=this.model.get("first_data_chunk");o?this._renderChunk(o):r.when(a.model.get_next_chunk()).then(function(e){a._renderChunk(e)}),this.scroll_elt.scroll(function(){a.attempt_to_fetch()})},scrolled_to_bottom:function(){return!1},_renderCell:function(e,t,i){var n=r("<td>").text(e),s=this.model.get_metadata("column_types");return void 0!==i?n.attr("colspan",i).addClass("stringalign"):s&&t<s.length&&("str"!==s[t]&&"list"!==s[t]||n.addClass("stringalign")),n},_renderRow:function(e){var t=e.split("\t"),i=r("<tr>"),n=this.model.get_metadata("columns");return this.row_count%2!==0&&i.addClass("dark_row"),t.length===n?o.each(t,function(e,t){i.append(this._renderCell(e,t))},this):t.length>n?(o.each(t.slice(0,n-1),function(e,t){i.append(this._renderCell(e,t))},this),i.append(this._renderCell(t.slice(n-1).join("\t"),n-1))):1===t.length?i.append(this._renderCell(e,0,n)):(o.each(t,function(e,t){i.append(this._renderCell(e,t))},this),o.each(o.range(n-t.length),function(){i.append(r("<td>"))})),this.row_count++,i},_renderChunk:function(e){var t=this.$el.find("table");o.each(e.ck_data.split("\n"),function(e,i){""!==e&&t.append(this._renderRow(e))},this)}}),h=d.extend({initialize:function(e){d.prototype.initialize.call(this,e),scroll_elt=o.find(this.$el.parents(),function(e){return"auto"===r(e).css("overflow")}),scroll_elt||(scroll_elt=window),this.scroll_elt=r(scroll_elt)},scrolled_to_bottom:function(){return this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0}}),u=d.extend({initialize:function(e){d.prototype.initialize.call(this,e),this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:e.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}}),p=a.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,file_ext:null,initialize:function(e){function t(e,t){for(var i=0;i<t.length;i++)if(t[i].match(e))return i;return-1}var n=parent.Galaxy;if(n&&n.modal&&(this.modal=n.modal),n&&n.frame&&(this.frame=n.frame),this.modal&&this.frame){var s=e.model,a=s.get("metadata");if(s.get("file_ext")){if(this.file_ext=s.get("file_ext"),"bed"==this.file_ext){if(!(a.get("chromCol")&&a.get("startCol")&&a.get("endCol")))return void console.log("TabularButtonTrackster : Bed-file metadata incomplete.");this.col.chrom=a.get("chromCol")-1,this.col.start=a.get("startCol")-1,this.col.end=a.get("endCol")-1}if("vcf"==this.file_ext&&(this.col.chrom=t("Chrom",a.get("column_names")),this.col.start=t("Pos",a.get("column_names")),this.col.end=null,this.col.chrom==-1||this.col.start==-1))return void console.log("TabularButtonTrackster : VCF-file metadata incomplete.");if(void 0!==this.col.chrom){if(!s.id)return void console.log("TabularButtonTrackster : Dataset identification is missing.");if(this.dataset_id=s.id,!s.get("url_viz"))return void console.log("TabularButtonTrackster : Url for visualization controller is missing.");this.url_viz=s.get("url_viz"),s.get("genome_build")&&(this.genome_build=s.get("genome_build"));var o=new i.IconButtonView({model:new i.IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(e.$el),this.$el.append(o.render().$el),this.hide()}}}},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(e){function t(e){return!isNaN(parseFloat(e))&&isFinite(e)}if(null!==this.col.chrom){var i=r(e.target).parent(),n=i.children().eq(this.col.chrom).html(),s=i.children().eq(this.col.start).html(),a=this.col.end?i.children().eq(this.col.end).html():s;if(!n.match("^#")&&""!==n&&t(s)){var o={dataset_id:this.dataset_id,gene_region:n+":"+s+"-"+a},l=i.offset(),c=l.left-10,d=l.top-r(window).scrollTop()+3;r("#btn_viz").css({position:"fixed",top:d+"px",left:c+"px"}),r("#btn_viz").off("click"),r("#btn_viz").click(this.create_trackster_action(this.url_viz,o,this.genome_build)),r("#btn_viz").show()}else r("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(e,t,i){var n=this;return function(){var s={};return i&&(s["f-dbkey"]=i),r.ajax({url:e+"/list_tracks?"+r.param(s),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(i){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:i,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide(),n.modal.$el.find("input[name=id]:checked").each(function(){var i=r(this).val();t.id=i,n.frame.add({title:"Trackster",type:"url",content:e+"/trackster?"+r.param(t)})})}}})},"View in new visualization":function(){n.modal.hide(),n.frame.add({title:"Trackster",type:"url",content:e+"/trackster?"+r.param(t)})}}})}}),!1}}}),f=function(e){e.model||(e.model=new l(e.dataset_config));var t=e.parent_elt,i=e.embedded;delete e.embedded,delete e.parent_elt,delete e.dataset_config;var n=i?new u(e):new h(e);return n.render(),t&&(t.append(n.$el),n.expand_to_container()),n};return{Dataset:s,TabularDataset:l,DatasetCollection:c,TabularDatasetChunkedView:d,createTabularDatasetChunkedView:f}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;n=[],s=function(){"use strict";var e={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};return e.READY_STATES=[e.OK,e.EMPTY,e.PAUSED,e.FAILED_METADATA,e.NOT_VIEWABLE,e.DISCARDED,e.ERROR],e.NOT_READY_STATES=[e.UPLOAD,e.QUEUED,e.RUNNING,e.SETTING_METADATA,e.NEW],e}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;(function(a,o){n=[i(4)],s=function(e){var t=a.View.extend({initialize:function(t){this.model=t&&t.model||new a.Model({id:e.uid(),title:"",floating:"right",icon:"",cls:"btn btn-default",wait:!1,wait_text:"Sending...",wait_cls:"btn btn-info",disabled:!1,percentage:-1}).set(t),this.setElement(o("<button/>").attr("type","button").append(this.$icon=o("<i/>")).append(this.$title=o("<span/>")).append(this.$progress=o("<div/>").append(this.$progress_bar=o("<div/>")))),this.listenTo(this.model,"change",this.render,this),this.render()},render:function(){var e=this,t=this.model.attributes;this.$el.removeClass().addClass("ui-button-default").addClass(t.disabled&&"disabled").attr("id",t.id).attr("disabled",t.disabled).css("float",t.floating).off("click").on("click",function(){o(".tooltip").hide(),t.onclick&&!e.disabled&&t.onclick()}).tooltip({title:t.tooltip,placement:"bottom"}),this.$progress.addClass("progress").css("display",t.percentage!==-1?"block":"none"),this.$progress_bar.addClass("progress-bar").css({width:t.percentage+"%"}),this.$icon.removeClass().addClass("icon fa"),this.$title.removeClass().addClass("title"),t.wait?(this.$el.addClass(t.wait_cls).prop("disabled",!0),this.$icon.addClass("fa-spinner fa-spin ui-margin-right"),this.$title.html(t.wait_text)):(this.$el.addClass(t.cls),this.$icon.addClass(t.icon),this.$title.html(t.title),t.icon&&t.title&&this.$icon.addClass("ui-margin-right"))},show:function(){this.$el.show()},hide:function(){this.$el.hide()},disable:function(){this.model.set("disabled",!0)},enable:function(){this.model.set("disabled",!1)},wait:function(){this.model.set("wait",!0)},unwait:function(){this.model.set("wait",!1)},setIcon:function(e){this.model.set("icon",e)}}),i=t.extend({initialize:function(t){this.model=t&&t.model||new a.Model({id:e.uid(),title:"",icon:"",cls:""}).set(t),this.setElement(o("<a/>").append(this.$icon=o("<span/>"))),this.listenTo(this.model,"change",this.render,this),this.render()},render:function(){var e=this.model.attributes;this.$el.removeClass().addClass(e.cls).attr({id:e.id,href:e.href||"javascript:void(0)",title:e.title,target:e.target||"_top",disabled:e.disabled}).tooltip({placement:"bottom"}).off("click").on("click",function(){e.onclick&&!e.disabled&&e.onclick()}),this.$icon.removeClass().addClass(e.icon)}}),n=a.View.extend({initialize:function(t){this.model=t&&t.model||new a.Model({id:e.uid(),title:"Select/Unselect all",icons:["fa-square-o","fa-minus-square-o","fa-check-square-o"],value:0,onchange:function(){}}).set(t),this.setElement(o("<div/>").append(this.$icon=o("<span/>")).append(this.$title=o("<span/>"))),this.listenTo(this.model,"change",this.render,this),this.render()},render:function(e){var t=this,e=this.model.attributes;this.$el.addClass("ui-button-check").off("click").on("click",function(){t.model.set("value",0===t.model.get("value")&&2||0),e.onclick&&e.onclick()}),this.$title.html(e.title),this.$icon.removeClass().addClass("icon fa ui-margin-right").addClass(e.icons[e.value])},value:function(e,t){return void 0!==e&&(t&&0!==e&&(e=e!==t&&1||2),this.model.set("value",e),this.model.get("onchange")(this.model.get("value"))),this.model.get("value")}}),s=t.extend({initialize:function(t){this.model=t&&t.model||new a.Model({id:e.uid(),title:"",floating:"right",icon:"",cls:"ui-button-icon",disabled:!1}).set(t),this.setElement(o("<div/>").append(this.$button=o("<div/>").append(this.$icon=o("<i/>")).append(this.$title=o("<span/>")))),this.listenTo(this.model,"change",this.render,this),this.render()},render:function(e){var e=this.model.attributes;this.$el.removeClass().addClass(e.cls).addClass(e.disabled&&"disabled").attr("disabled",e.disabled).attr("id",e.id).css("float",e.floating).off("click").on("click",function(){o(".tooltip").hide(),!e.disabled&&e.onclick&&e.onclick()}),this.$button.addClass("button").tooltip({title:e.tooltip,placement:"bottom"}),this.$icon.removeClass().addClass("icon fa").addClass(e.icon),this.$title.addClass("title").html(e.title),e.icon&&e.title&&this.$icon.addClass("ui-margin-right")}}),r=t.extend({$menu:null,initialize:function(e){this.model=e&&e.model||new a.Model({id:"",title:"",floating:"right",pull:"right",icon:null,onclick:null,cls:"ui-button-icon ui-button-menu",tooltip:"",target:"",href:"",onunload:null,visible:!0,tag:""}).set(e),this.collection=new a.Collection,this.setElement(o("<div/>").append(this.$root=o("<div/>").append(this.$icon=o("<i/>")).append(this.$title=o("<span/>")))),this.listenTo(this.model,"change",this.render,this),this.listenTo(this.collection,"change add remove reset",this.render,this),this.render()},render:function(){var e=this,t=this.model.attributes;this.$el.removeClass().addClass("dropdown").addClass(t.cls).attr("id",t.id).css({float:t.floating,display:t.visible&&this.collection.where({visible:!0}).length>0?"block":"none"}),this.$root.addClass("root button dropdown-toggle").attr("data-toggle","dropdown").tooltip({title:t.tooltip,placement:"bottom"}).off("click").on("click",function(e){o(".tooltip").hide(),e.preventDefault(),t.onclick&&t.onclick()}),this.$icon.removeClass().addClass("icon fa").addClass(t.icon),this.$title.removeClass().addClass("title").html(t.title),t.icon&&t.title&&this.$icon.addClass("ui-margin-right"),this.$menu&&this.$menu.remove(),this.collection.length>0&&(this.$menu=o("<ul/>").addClass("menu dropdown-menu").addClass("pull-"+e.model.get("pull")).attr("role","menu"),this.$el.append(this.$menu)),this.collection.each(function(t){var i=t.attributes;if(i.visible){var n=o("<a/>").addClass("dropdown-item").attr({href:i.href,target:i.target}).append(o("<i/>").addClass("fa").addClass(i.icon).css("display",i.icon?"inline-block":"none")).append(i.title).on("click",function(e){i.onclick&&(e.preventDefault(),i.onclick())});e.$menu.append(o("<li/>").append(n)),i.divider&&e.$menu.append(o("<li/>").addClass("divider"))}})},addMenu:function(t){this.collection.add(e.merge(t,{title:"",target:"",href:"",onclick:null,divider:!1,visible:!0,icon:null,cls:"button-menu btn-group"}))}});return{ButtonDefault:t,ButtonLink:i,ButtonIcon:s,ButtonCheck:n,ButtonMenu:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1))},function(e,t,i){var n,s;(function(i,a,o){n=[],s=function(){var e=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:{}}}),t=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 e=this.template(this.model.toJSON());return e.tooltip(this.model.get("tooltip_config")),this.$el.replaceWith(e),this.setElement(e),this},events:{click:"click"},click:function(e){return!a.isFunction(this.model.get("on_click"))||(this.model.get("on_click")(e),!1)},template:function(e){var t='title="'+e.title+'" class="icon-button';return e.is_menu_button&&(t+=" menu-button"),t+=" "+e.icon_class,e.enabled||(t+="_disabled"),t+='"',e.id&&(t+=' id="'+e.id+'"'),t+=' href="'+e.href+'"',e.target&&(t+=' target="'+e.target+'"'),e.visible||(t+=' style="display: none;"'),t=e.enabled?"<a "+t+"/>":"<span "+t+"/>",o(t)}}),n=i.Collection.extend({model:e}),s=i.View.extend({tagName:"div",initialize:function(){this.render()},render:function(){var e=this;return this.collection.each(function(t){var i=o("<a/>").attr("href","javascript:void(0)").attr("title",t.attributes.title).addClass("icon-button menu-button").addClass(t.attributes.icon_class).appendTo(e.$el).click(t.attributes.on_click);t.attributes.tooltip_config&&i.tooltip(t.attributes.tooltip_config);var n=t.get("options");n&&make_popupmenu(i,n)}),this}}),r=function(t,i){i||(i={});var o=new n(a.map(t,function(t){return new e(a.extend(t,i))}));return new s({collection:o})};return{IconButton:e,IconButtonView:t,IconButtonCollection:n,IconButtonMenuView:s,create_icon_buttons_menu:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4)],s=function(e){var t=a.View.extend({optionsDefault:{with_close:!0,title:null,placement:"top",container:"body",body:null},initialize:function(t){this.setElement(this._template()),this.uid=e.uid(),this.options=o.defaults(t||{},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(e){i.visible&&!r(i.options.container).is(e.target)&&!r(i.el).is(e.target)&&0===r(i.el).has(e.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 e=this;this.options.with_close?this.$close.on("click",function(){e.hide()}).show():this.$close.off().hide()},title:function(e){void 0!==e&&(this.options.title=e,this.$title.html(e))},show:function(){this.render(),this.$el.show(),this.visible=!0},hide:function(){this.$el.hide(),this.visible=!1},append:function(e){this.$body.append(e)},empty:function(){this.$body.empty()},remove:function(){r("body").off("mousedown."+this.uid),this.$el.remove()},_get_placement:function(e){var t=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(["top","bottom"].indexOf(e)!=-1)switch(left=o.left-t+(s+t)/2,e){case"top":r=o.top-i-5;break;case"bottom":r=o.top+a+5}else switch(r=o.top-i+(a+i)/2,e){case"right":left=o.left+s}return{top:r,left:left}},_get_width:function(e){return e.width()+parseInt(e.css("padding-left"))+parseInt(e.css("margin-left"))+parseInt(e.css("padding-right"))+parseInt(e.css("margin-right"))},_get_height:function(e){return e.height()+parseInt(e.css("padding-top"))+parseInt(e.css("padding-bottom"))},_template:function(e){return'<div class="ui-popover popover fade in"><div class="arrow"/><div class="popover-title"><div class="popover-title-label"/><div class="popover-close fa fa-times-circle"/></div><div class="popover-content"/></div>'}});return{View:t}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(4)],s=function(e){var t=a.View.extend({optionsDefault:{css:"",placeholder:"No data available",data:[],value:null,multiple:!1,minimumInputLength:0,initialData:""},initialize:function(t){if(this.options=e.merge(t,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(e){var t=this._getValue();void 0!==e&&this._setValue(e);var i=this._getValue();return i!=t&&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(e){this.select_data.push({id:e.id,text:e.text}),this._refresh()},del:function(e){var t=this._getIndex(e);t!=-1&&(this.select_data.splice(t,1),this._refresh())},remove:function(){this.$el.select2("destroy")},update:function(e){this.select_data=[];for(var t in e.data)this.select_data.push(e.data[t]);this._refresh()},_refresh:function(){if(this.options.multiple){var e={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(e)}else{var t=this._getValue(),e={data:this.select_data,containerCssClass:this.options.css,placeholder:this.options.placeholder,dropdownAutoWidth:!0};this.$el.select2(e),this._setValue(t)}},_getIndex:function(e){o.findIndex(this.select_data,{id:e})},_getValue:function(){return this.$el.select2("val")},_setValue:function(e){var t=this._getIndex(e);t==-1&&this.select_data.length>0&&(e=this.select_data[0].id),this.$el.select2("val",e)},_template:function(e){return'<input type="hidden" value="'+this.options.initialData+'"/>'}});return{View:t}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2))},function(e,t,i){var n,s,a;!function(o){s=[i(1)],n=o,a="function"==typeof n?n.apply(t,s):n,!(void 0!==a&&(e.exports=a))}(function(e){"use_strict";var t=e;t.fn.make_text_editable=function(e){var i="num_cols"in e?e.num_cols:30,n="num_rows"in e?e.num_rows:4,s="use_textarea"in e&&e.use_textarea,a="on_finish"in e?e.on_finish:null,o="help_text"in e?e.help_text:null,r=t(this);return r.addClass("editable-text").click(function(o){if(!(t(this).children(":input").length>0)){r.removeClass("editable-text");var l,c,d=function(e){r.find(":input").remove(),""!==e?r.text(e):r.html("<br>"),r.addClass("editable-text"),a&&a(e)},h="cur_text"in e?e.cur_text:r.text();s?(l=t("<textarea/>").attr({rows:n,cols:i}).text(t.trim(h)).keyup(function(e){27===e.keyCode&&d(h)}),c=t("<button/>").text("Done").click(function(){return d(l.val()),!1})):l=t("<input type='text'/>").attr({value:t.trim(h),size:i}).blur(function(){d(h)}).keyup(function(e){27===e.keyCode?t(this).trigger("blur"):13===e.keyCode&&d(t(this).val()),e.stopPropagation()}),r.text(""),r.append(l),c&&r.append(c),l.focus(),l.select(),o.stopPropagation()}}),o&&r.attr("title",o).tooltip(),r}})},function(e,t,i){var n,s,a;(function(i,o){!function(i,o){s=[],n=o,a="function"==typeof n?n.apply(t,s):n,!(void 0!==a&&(e.exports=a))}(this,function(){var e=function(e){e=e||{},e.tooltipConfig=e.tooltipConfig||{placement:"bottom"},e.classes=["icon-btn"].concat(e.classes||[]),e.disabled&&e.classes.push("disabled");var t=['<a class="',e.classes.join(" "),'"',e.title?' title="'+e.title+'"':"",!e.disabled&&e.target?' target="'+e.target+'"':"",' href="',!e.disabled&&e.href?e.href:"javascript:void(0);",'">','<span class="fa ',e.faIcon,'"></span>',"</a>"].join(""),n=i(t).tooltip(e.tooltipConfig);return o.isFunction(e.onclick)&&n.click(e.onclick),n};return e})}).call(t,i(1),i(2))},function(e,t,i){var n;(function(s,a){n=function(){function e(e){e+="";for(var t=/(\d+)(\d{3})/;t.test(e);)e=e.replace(t,"$1,$2");return e}var t=function(e){return"promise"in e},i=s.Model.extend({defaults:{ajax_settings:{},interval:1e3,success_fn:function(e){return!0}},go:function(){var e=a.Deferred(),t=this,i=t.get("ajax_settings"),n=t.get("success_fn"),s=t.get("interval"),o=function(){a.ajax(i).success(function(t){n(t)?e.resolve(t):setTimeout(o,s)})};return o(),e}}),n=function(e){e||(e="#ffffff"),"string"==typeof e&&(e=[e]);for(var t=0;t<e.length;t++)e[t]=parseInt(e[t].slice(1),16);var i,n,s,a,o,r,l,c,d,h,u,p=function(e,t,i){return(299*e+587*t+114*i)/1e3},f=function(e,t,i,n,s,a){return Math.max(e,n)-Math.min(e,n)+(Math.max(t,s)-Math.min(t,s))+(Math.max(i,a)-Math.min(i,a))},g=!1,m=0;do{for(i=Math.round(16777215*Math.random()),n=(16711680&i)>>16,s=(65280&i)>>8,a=255&i,d=p(n,s,a),g=!0,t=0;t<e.length;t++)if(o=e[t],r=(16711680&o)>>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||u<200){g=!1;break}m++}while(!g&&m<=10);return"#"+(16777216+i).toString(16).substr(1,6)};return{commatize:e,is_deferred:t,ServerStateDeferred:i,get_random_color:n}}.call(t,i,t,e),!(void 0!==n&&(e.exports=n))}).call(t,i(3),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(33),i(6),i(5)],s=function(e,t,i){e=e||window.BibtexParser;var n="citation",s=a.Model.extend(t.LoggableMixin).extend({_logNamespace:n,defaults:{content:""},initialize:function(){var t;try{t=e(this.attributes.content)}catch(e){return}if(t.errors.length){var i=t.errors.reduce(function(e,t){return e+"; "+t});this.log("Error parsing bibtex: "+i)}if(this._fields={},this.entry=o.first(t.entries),this.entry){var n=this.entry.Fields;for(var s in n){var a=n[s],r=s.toLowerCase();this._fields[r]=a}}},entryType:function(){return this.entry?this.entry.EntryType:void 0},fields:function(){return this._fields}}),r=a.Collection.extend(t.LoggableMixin).extend({_logNamespace:n,urlRoot:Galaxy.root+"api",partial:!0,model:s}),l=r.extend({url:function(){return this.urlRoot+"/histories/"+this.history_id+"/citations"}}),c=r.extend({url:function(){return this.urlRoot+"/tools/"+this.tool_id+"/citations"},partial:!1});return{Citation:s,HistoryCitationCollection:l,ToolCitationCollection:c}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(9),i(7),i(43),i(39)],s=function(e,t,i,n,s){return a.View.extend({initialize:function(e){this.model=new a.Model({initial_errors:!1,cls:"ui-portlet-limited",icon:null,always_refresh:!0,message_status:"warning"}).set(e),this.setElement("<div/>"),this.render()},update:function(e){var t=this;this.data.matchModel(e,function(e,i){var n=t.input_list[i];if(n&&n.options&&!o.isEqual(n.options,e.options)){n.options=e.options;var s=t.field_list[i];if(s.update){var a=[];if(["data","data_collection","drill_down"].indexOf(n.type)!=-1)a=n.options;else for(var r in e.options){var l=e.options[r];l.length>2&&a.push({label:l[0],value:l[1]})}s.update(a),s.trigger("change"),Galaxy.emit.debug("form-view::update()","Updating options for "+i)}}})},wait:function(e){for(var t in this.input_list){var i=this.field_list[t],n=this.input_list[t];n.is_dynamic&&i.wait&&i.unwait&&i[e?"wait":"unwait"]()}},highlight:function(e,t,i){var n=this.element_list[e];if(n&&(n.error(t||"Please verify this parameter."),this.portlet.expand(),this.trigger("expand",e),!i)){var s=this.$el.parents().filter(function(){return["auto","scroll"].indexOf(r(this).css("overflow"))!=-1}).first();s.animate({scrollTop:s.scrollTop()+n.$el.offset().top-120},500)}},errors:function(e){if(this.trigger("reset"),e&&e.errors){var t=this.data.matchResponse(e.errors);for(var i in this.element_list){this.element_list[i];t[i]&&this.highlight(i,t[i],!0)}}},render:function(){var e=this;this.off("change"),this.off("reset"),this.field_list={},this.input_list={},this.element_list={},this.data=new s.Manager(this),this._renderForm(),this.data.create(),this.model.get("initial_errors")&&this.errors(this.model.attributes);var t=this.data.checksum();return this.on("change",function(i){var n=e.input_list[i];if(!n||n.refresh_on_change||e.model.get("always_refresh")){var s=e.data.checksum();s!=t&&(t=s,e.model.get("onchange")&&e.model.get("onchange")())}}),this.on("reset",function(){o.each(e.element_list,function(e){e.reset()})}),this},_renderForm:function(){r(".tooltip").remove();var e=this.model.attributes;this.message=new i.UnescapedMessage,this.section=new n.View(this,{inputs:e.inputs}),this.portlet=new t.View({icon:e.icon,title:e.title,cls:e.cls,operations:e.operations,buttons:e.buttons,collapsible:e.collapsible,collapsed:e.collapsed,onchange_title:e.onchange_title}),this.portlet.append(this.message.$el),this.portlet.append(this.section.$el),this.$el.empty(),e.inputs&&this.$el.append(this.portlet.$el),e.message&&this.message.update({persistent:!0,status:e.message_status,message:e.message}),Galaxy.emit.debug("form-view::initialize()","Completed")}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(4),i(9),i(7)],s=function(e,t,i){var n=a.View.extend({initialize:function(e){var n=this;this.options=e,this.name=e.name||"element",this.multiple=e.multiple||!1,this.message=new i.Message,this.portlet=new t.View({cls:"ui-portlet-section"}),this.select=new i.Select.View({optional:e.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(e)),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(e){if(void 0!==e){if(this.portlet.empty(),o.isArray(e))for(var t in e){var i=e[t],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(t){var i=this;if(0===this.$('[id="'+t.id+'"]').length)if(e.isEmpty(t.id))this.message.update({message:"Please select a valid "+this.name+".",status:"danger"});else{var n=o(this._templateRow({id:t.id,name:t.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:"This "+this.name+" is already in the list."})},update:function(e){this.select.update(e)},_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(e){return'<div class="ui-list"><div class="ui-margin-top"><span class="ui-list-button"/><span class="ui-list-select"/></div><div class="ui-list-message"/><div class="ui-list-portlet"/></div>'},_templateRow:function(e){return'<div id="'+e.id+'" class="ui-list-id"><span class="ui-list-delete fa fa-trash"/><span class="ui-list-name">'+e.name+"</span></div>"}});return{View:n}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(12)],s=function(e,t){var i=a.View.extend({initialize:function(t){var i=this;this.model=t&&t.model||new a.Model({visible:!0,data:[],id:e.uid(),error_text:"No options available.",wait_text:"Please wait...",multiple:!1,optional:!1,onchange:function(){}}).set(t),this.listenTo(this.model,"change:value",this._changeValue,this),this.listenTo(this.model,"change:wait",this._changeWait,this),this.listenTo(this.model,"change:data",this._changeData,this),this.listenTo(this.model,"change:visible",this._changeVisible,this),this.on("change",function(){i.model.get("onchange")(i.value())}),this.render()},render:function(){var e=this;this.$el.empty().removeClass().addClass("ui-options").append(this.$message=o("<div/>")).append(this.$menu=o("<div/>").addClass("ui-options-menu")).append(this.$options=o(this._template())),this.all_button=null,this.model.get("multiple")&&(this.all_button=new t.ButtonCheck({onclick:function(){e.$("input").prop("checked",0!==e.all_button.value()),e.value(e._getValue()),e.trigger("change")}}),this.$menu.append(this.all_button.$el)),this._changeData(),this._changeWait(),this._changeVisible()},update:function(e){this.model.set("data",e)},_changeData:function(){var e=this;this.$options.empty(),this._templateOptions?this.$options.append(this._templateOptions(this.model.get("data"))):r.each(this.model.get("data"),function(t){e.$options.append(o(e._templateOption(t)).addClass("ui-option").tooltip({title:t.tooltip,placement:"bottom"}))});var e=this;this.$("input").on("change",function(){e.value(e._getValue()),e.trigger("change")}),this._changeValue(),this._changeWait()},_changeVisible:function(){this.$el[this.model.get("visible")?"show":"hide"]()},_changeWait:function(){this.model.get("wait")?0===this.length()&&(this._messageShow(this.model.get("wait_text"),"info"),this.$options.hide(),this.$menu.hide()):0===this.length()?(this._messageShow(this.model.get("error_text"),"danger"),this.$options.hide(),this.$menu.hide()):(this.$message.hide(),this.$options.css("display","inline-block"),this.$menu.show())},_changeValue:function(){this._setValue(this.model.get("value")),null!==this._getValue()||this.model.get("multiple")||this.model.get("optional")||this._setValue(this.first()),this.all_button&&this.all_button.value(o.isArray(this._getValue())?this._getValue().length:0,this.length())},value:function(e){return void 0!==e&&this.model.set("value",e),this._getValue()},first:function(){var e=this.$("input").first();return e.length>0?e.val():null},wait:function(){this.model.set("wait",!0)},unwait:function(){this.model.set("wait",!1)},length:function(){return this.$(".ui-option").length},_setValue:function(e){var t=this;if(void 0!==e&&(this.$("input").prop("checked",!1),null!==e)){var i=o.isArray(e)?e:[e];r.each(i,function(e){t.$('input[value="'+e+'"]').first().prop("checked",!0)})}},_getValue:function(){var t=[];return this.$(":checked").each(function(){t.push(o(this).val())}),e.isEmpty(t)?null:this.model.get("multiple")?t:t[0]},_messageShow:function(e,t){this.$message.show().removeClass().addClass("ui-message alert alert-"+t).html(e)},_template:function(){return o("<div/>").addClass("ui-options-list")}}),n=i.extend({_templateOption:function(t){var i=e.uid();return o("<div/>").addClass("ui-option").append(o("<input/>").attr({id:i,type:this.model.get("type"),name:this.model.id,value:t.value})).append(o("<label/>").addClass("ui-options-label").attr("for",i).html(t.label))}}),s={};s.View=n.extend({initialize:function(e){e.type="radio",n.prototype.initialize.call(this,e)}});var l={};l.View=n.extend({initialize:function(e){e.type="checkbox",e.multiple=!0,n.prototype.initialize.call(this,e)}});var c={};return c.View=i.extend({initialize:function(e){i.prototype.initialize.call(this,e)},_setValue:function(e){void 0!==e&&(this.$("input").prop("checked",!1),this.$("label").removeClass("active"),this.$('[value="'+e+'"]').prop("checked",!0).closest("label").addClass("active"))},_templateOption:function(e){var t=o("<label/>").addClass("btn btn-default");return e.icon&&t.append(o("<i/>").addClass("fa").addClass(e.icon).addClass(!e.label&&"no-padding")),t.append(o("<input/>").attr({type:"radio",name:this.model.id,value:e.value})),e.label&&t.append(e.label),t},_template:function(){return o("<div/>").addClass("btn-group ui-radiobutton").attr("data-toggle","buttons")}}),{Base:i,BaseIcons:n,Radio:s,RadioButton:c,Checkbox:l}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(12)],s=function(e,t){var i=a.View.extend({initialize:function(t){var i=this;this.data=[],this.data2=[],this.model=t&&t.model||new a.Model({id:e.uid(),cls:"ui-select",error_text:"No options available",empty_text:"Nothing selected",visible:!0,wait:!1,multiple:!1,searchable:!0,optional:!1,disabled:!1,onchange:function(){},value:null,selectall:!0,pagesize:20}).set(t),this.on("change",function(){i.model.get("onchange")&&i.model.get("onchange")(i.value())}),this.listenTo(this.model,"change:data",this._changeData,this),this.listenTo(this.model,"change:disabled",this._changeDisabled,this),this.listenTo(this.model,"change:wait",this._changeWait,this),this.listenTo(this.model,"change:visible",this._changeVisible,this),this.listenTo(this.model,"change:value",this._changeValue,this),this.listenTo(this.model,"change:multiple change:searchable change:cls change:id",this.render,this),this.render()},render:function(){var e=this;this.model.get("searchable")?this._renderSearchable():this._renderClassic(),this.$el.addClass(this.model.get("cls")).attr("id",this.model.get("id")),this.$select.empty().addClass("select").attr("id",this.model.get("id")+"_select").prop("multiple",this.model.get("multiple")).on("change",function(){e.value(e._getValue()),e.trigger("change")}),this._changeData(),this._changeWait(),this._changeVisible(),this._changeDisabled()},_renderClassic:function(){var e=this;this.$el.addClass(this.model.get("multiple")?"ui-select-multiple":"ui-select").append(this.$select=o("<select/>")).append(this.$dropdown=o("<div/>")).append(this.$resize=o("<div/>").append(this.$resize_icon=o("<i/>"))),this.model.get("multiple")?(this.$dropdown.hide(),this.$resize_icon.addClass("fa fa-angle-double-right fa-rotate-45").show(),this.$resize.removeClass().addClass("icon-resize").show().off("mousedown").on("mousedown",function(t){var i=t.pageY,n=e.$select.height();e.minHeight=e.minHeight||n,o("#dd-helper").show().on("mousemove",function(t){e.$select.height(Math.max(n+(t.pageY-i),e.minHeight))}).on("mouseup mouseleave",function(){o("#dd-helper").hide().off()})})):(this.$dropdown.show(),this.$resize.hide(),this.$resize_icon.hide())},_renderSearchable:function(){var e=this;this.$el.append(this.$select=o("<div/>")).append(this.$dropdown=o("<div/>")),this.$dropdown.hide(),this.model.get("multiple")||this.$dropdown.show().on("click",function(){e.$select.select2&&e.$select.select2("open")}),this.all_button=null,this.model.get("multiple")&&this.model.get("selectall")&&(this.all_button=new t.ButtonCheck({onclick:function(){var t=[];0!==e.all_button.value()&&r.each(e.model.get("data"),function(e){t.push(e.value)}),e.value(t),e.trigger("change")}}),this.$el.prepend(this.all_button.$el))},_match:function(e,t){return!e||""==e||String(t).toUpperCase().indexOf(e.toUpperCase())>=0},_changeData:function(){var e=this;this.data=[],!this.model.get("multiple")&&this.model.get("optional")&&this.data.push({value:"__null__",label:e.model.get("empty_text")}),r.each(this.model.get("data"),function(t){e.data.push(t)}),0==this.length()&&this.data.push({value:"__null__",label:this.model.get("error_text")}),this.model.get("searchable")?(this.data2=[],r.each(this.data,function(t,i){e.data2.push({order:i,id:t.value,text:t.label,tags:t.tags})}),this.$select.data("select2")&&this.$select.select2("destroy"),this.matched_tags={},this.$select.select2({data:e.data2,closeOnSelect:!this.model.get("multiple"),multiple:this.model.get("multiple"),query:function(t){e.matched_tags={};var i=e.model.get("pagesize"),n=r.filter(e.data2,function(i){var n=!1;return r.each(i.tags,function(i){e._match(t.term,i)&&(n=e.matched_tags[i]=!0)}),n||e._match(t.term,i.text)});t.callback({results:n.slice((t.page-1)*i,t.page*i),more:n.length>=t.page*i})},formatResult:function(t){return r.escape(t.text)+'<div class="ui-tags">'+r.reduce(t.tags,function(t,i){return e.matched_tags[i]?t+' <div class="label label-info">'+r.escape(i)+"</div>":t},"")+"</div>"}}),this.$(".select2-container .select2-search input").off("blur")):(this.$select.find("option").remove(),r.each(this.data,function(t){e.$select.append(o("<option/>").attr("value",t.value).html(r.escape(t.label)))})),this.model.set("disabled",0==this.length()),this._changeValue()},_changeDisabled:function(){this.model.get("searchable")?this.$select.select2(this.model.get("disabled")?"disable":"enable"):this.$select.prop("disabled",this.model.get("disabled"))},_changeWait:function(){this.$dropdown.removeClass().addClass("icon-dropdown fa").addClass(this.model.get("wait")?"fa-spinner fa-spin":"fa-caret-down")},_changeVisible:function(){this.$el[this.model.get("visible")?"show":"hide"](),this.$select[this.model.get("visible")?"show":"hide"]()},_changeValue:function(){if(this._setValue(this.model.get("value")),this.model.get("multiple")){if(this.all_button){var e=this._getValue();this.all_button.value(o.isArray(e)?e.length:0,this.length())}}else null!==this._getValue()||this.model.get("optional")||this._setValue(this.first())},value:function(e){return void 0!==e&&this.model.set("value",e),this._getValue()},first:function(){return this.data.length>0?this.data[0].value:null},exists:function(e){return r.findWhere(this.data,{value:e})},text:function(){var e=this._getValue(),t=this.exists(o.isArray(e)?e[0]:e);return t?t.label:""},show:function(){this.model.set("visible",!0)},hide:function(){this.model.set("visible",!1)},wait:function(){this.model.set("wait",!0)},unwait:function(){this.model.set("wait",!1)},disabled:function(){return this.model.get("disabled")},enable:function(){this.model.set("disabled",!1)},disable:function(){this.model.set("disabled",!0)},add:function(e,t){r.each(this.model.get("data"),function(t){t.keep&&!r.findWhere(e,{value:t.value})&&e.push(t)}),t&&e&&e.sort(t),this.model.set("data",e)},update:function(e){this.model.set("data",e)},setOnChange:function(e){this.model.set("onchange",e)},length:function(){return o.isArray(this.model.get("data"))?this.model.get("data").length:0},_setValue:function(e){var t=this;if(null!==e&&void 0!==e||(e="__null__"),this.model.get("multiple")?e=o.isArray(e)?e:[e]:o.isArray(e)&&(e=e.length>0?e[0]:"__null__"),this.model.get("searchable")){if(o.isArray(e))val=[],r.each(e,function(e){var i=r.findWhere(t.data2,{id:e});i&&val.push(i)}),e=val;else{var i=r.findWhere(this.data2,{id:e});e=i}this.$select.select2("data",e)}else this.$select.val(e)},_getValue:function(){var t=null;if(this.model.get("searchable")){var i=this.$select.select2("data");i&&(o.isArray(i)?(t=[],i.sort(function(e,t){return e.order-t.order}),r.each(i,function(e){t.push(e.id)})):t=i.id)}else t=this.$select.val();return e.isEmpty(t)?null:t}});return{View:i}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(i){n=[],s=function(){var e=i.Model.extend({defaults:{extension:"auto",genome:"?",url_paste:"",status:"init",info:null,file_name:"",file_mode:"",file_size:0,file_type:null,file_path:"",file_data:null,percentage:0,space_to_tab:!1,to_posix_lines:!0,enabled:!0},reset:function(e){this.clear().set(this.defaults).set(e)}}),t=i.Collection.extend({model:e});return{Model:e,Collection:t}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(7),i(8),i(49),i(28)],s=function(e,t,i,n,s){var l=a.View.extend({initialize:function(s){var a=this;this.modal=parent.Galaxy.modal||new i.View,this.form=new n(e.merge({listen_to_history:!0,always_refresh:!1,customize:function(e){var i=e.model.attributes;i.buttons={execute:execute_btn=new t.Button({icon:"fa-check",tooltip:"Execute: "+i.name+" ("+i.version+")",title:"Execute",cls:"ui-button btn btn-primary",floating:"clear",onclick:function(){execute_btn.wait(),e.portlet.disable(),a.submit(i,function(){execute_btn.unwait(),e.portlet.enable()})}})},i.job_id&&i.job_remap&&i.inputs.push({label:"Resume dependencies from this job",name:"rerun_remap_job_id",type:"select",display:"radio",ignore:"__ignore__",value:"__ignore__",options:[["Yes",i.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."})},postchange:function(t,i){var n={tool_id:i.model.get("id"),tool_version:i.model.get("version"),inputs:o.extend(!0,{},i.data.create())};i.wait(!0),Galaxy.emit.debug("tool-form::postchange()","Sending current state.",n),e.request({type:"POST",url:Galaxy.root+"api/tools/"+i.model.get("id")+"/build",data:n,success:function(e){i.update(e),i.wait(!1),Galaxy.emit.debug("tool-form::postchange()","Received new model.",e),t.resolve()},error:function(e){Galaxy.emit.debug("tool-form::postchange()","Refresh request failed.",e),t.reject()}})}},s)),this.deferred=this.form.deferred,this.setElement("<div/>"),this.$el.append(this.form.$el)},submit:function(t,i){var n=this,a={tool_id:t.id,tool_version:t.version,inputs:this.form.data.create()};if(this.form.trigger("reset"),!n.validate(a))return Galaxy.emit.debug("tool-form::submit()","Submission canceled. Validation failed."),void(i&&i());if(t.action!==Galaxy.root+"tool_runner/index"){var l=o("<form/>").attr({action:t.action,method:t.method,enctype:t.enctype});return r.each(a.inputs,function(e,t){l.append(o("<input/>").attr({name:t,value:e}))}),l.hide().appendTo("body").submit().remove(),void(i&&i())}Galaxy.emit.debug("tool-form::submit()","Validation complete.",a),e.request({type:"POST",url:Galaxy.root+"api/tools",data:a,success:function(e){if(i&&i(),n.$el.children().hide(),n.$el.append(n._templateSuccess(e)),e.jobs&&e.jobs.length>0){n.$el.append(o("<div/>",{id:"webhook-view"}));new s.WebhookView({urlRoot:Galaxy.root+"api/webhooks/tool"})}parent.Galaxy&&parent.Galaxy.currHistoryPanel&&parent.Galaxy.currHistoryPanel.refreshContents()},error:function(e){i&&i(),Galaxy.emit.debug("tool-form::submit","Submission failed.",e);var t=!1;if(e&&e.err_data){var s=n.form.data.matchResponse(e.err_data);for(var o in s){n.form.highlight(o,s[o]),t=!0;break}}t||n.modal.show({title:"Job submission failed",body:n._templateError(a,e&&e.err_msg),buttons:{Close:function(){n.modal.hide()}}})}})},validate:function(e){var t=e.inputs,i=-1,n=null;for(var s in t){var a=t[s],o=this.form.data.match(s),r=this.form.field_list[o],l=this.form.input_list[o];if(o&&l&&r){if(!l.optional&&null==a)return this.form.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.form.highlight(o,"Please select either dataset or dataset list fields for all batch mode fields."),!1;if(i===-1)i=c;else if(i!==c)return this.form.highlight(o,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+c+"</b> selection(s) while a previous field contains <b>"+i+"</b>."),!1}}else Galaxy.emit.debug("tool-form::validate()","Retrieving input objects failed.")}return!0},_templateSuccess:function(e){if(e.jobs&&e.jobs.length>0){var t=e.jobs.length,i=1==t?"1 job has":t+" jobs have",n=o("<div/>").addClass("donemessagelarge").append(o("<p/>").text(i+" been successfully added to the queue - resulting in the following datasets:"));return r.each(e.outputs,function(e){n.append(o("<p/>").addClass("messagerow").append(o("<b/>").text(e.hid+": "+e.name)))}),n.append(o("<p/>").append("<b/>").text("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.")),n}return this._templateError(e,"Invalid success response. No jobs found.")},_templateError:function(e,t){return o("<div/>").addClass("errormessagelarge").append(o("<p/>").text("The server could not complete the request. Please contact the Galaxy Team if this error persists. "+(t||""))).append(o("<pre/>").text(JSON.stringify(e,null,4)))}});return{View:l}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},,function(e,t,i){var n,s;(function(a,o){n=[i(4)],s=function(e){var t=a.View.extend({initialize:function(t){this.options=e.merge(t,{content:"No content available.",onchange:null,ondblclick:null,onconfirm:null,cls:"ui-table",selectable:!0,cls_tr:""}),this.setElement(this._template()),this.$thead=this.$("thead"),this.$tbody=this.$("tbody"),this.$tmessage=this.$("tmessage"),this.row=this._row(),this.row_count=0},events:{click:"_onclick",dblclick:"_ondblclick"},addHeader:function(e){this.row.append(o("<th/>").append(e))},appendHeader:function(){this.$thead.append(this.row),this.row=o("<tr/>")},add:function(e,t,i){var n=o("<td/>");t&&n.css("width",t),i&&n.css("text-align",i),this.row.append(n.append(e))},append:function(e,t){this._commit(e,t,!1)},prepend:function(e,t){this._commit(e,t,!0)},get:function(e){return this.$("#"+e)},del:function(e){var t=this.$tbody.find("#"+e);t.length>0&&(t.remove(),this.row_count--,this._refresh())},delAll:function(){this.$tbody.empty(),this.row_count=0,this._refresh()},value:function(e){if(this.options.selectable){this.before=this.$tbody.find(".current").attr("id"),void 0!==e&&(this.$tbody.find("tr").removeClass("current"),e&&this.$tbody.find("#"+e).addClass("current"));var t=this.$tbody.find(".current").attr("id");return void 0===t?null:(t!=this.before&&this.options.onchange&&this.options.onchange(e),t)}},size:function(){return this.$tbody.find("tr").length},_commit:function(e,t,i){this.del(e),this.row.attr("id",e),i?this.$tbody.prepend(this.row):this.$tbody.append(this.row),t&&(this.row.hide(),this.row.fadeIn()),this.row=this._row(),this.row_count++,this._refresh()},_row:function(){return o('<tr class="'+this.options.cls_tr+'"></tr>')},_onclick:function(e){var t=this.value(),i=o(e.target).closest("tr").attr("id");""!=i&&i&&t!=i&&(this.options.onconfirm?this.options.onconfirm(i):this.value(i))},_ondblclick:function(e){var t=this.value();t&&this.options.ondblclick&&this.options.ondblclick(t)},_refresh:function(){0==this.row_count?this.$tmessage.show():this.$tmessage.hide()},_template:function(){return'<div><table class="'+this.options.cls+'"><thead/><tbody/></table><tmessage>'+this.options.content+"</tmessage><div>"}});return{View:t}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1))},,,,,,function(e,t){function i(e){function t(e){s.push(e)}if("string"==typeof e){var n={},s=[],a=i.call(n,t);return a.parse(e),{entries:s,errors:a.getErrors()}}if("function"!=typeof e)throw"Invalid parser construction.";return this.STATES_={ENTRY_OR_JUNK:0,OBJECT_TYPE:1,ENTRY_KEY:2,KV_KEY:3,EQUALS:4,KV_VALUE:5},this.DATA_={},this.CALLBACK_=e,this.CHAR_=0,this.LINE_=1,this.CHAR_IN_LINE_=0,this.SKIPWS_=!0,this.SKIPCOMMENT_=!0,this.PARSETMP_={},this.SKIPTILLEOL_=!1,this.VALBRACES_=null,this.BRACETYPE_=null,this.BRACECOUNT_=0,this.STATE_=this.STATES_.ENTRY_OR_JUNK,this.ERRORS_=[],this.ENTRY_TYPES_={inproceedings:1,proceedings:2,article:3,techreport:4,misc:5,mastersthesis:6,book:7,phdthesis:8,incollection:9,unpublished:10,inbook:11,manual:12,periodical:13,booklet:14,masterthesis:15,conference:16,online:998,data:999},this.MACROS_={jan:"January",feb:"February",mar:"March",apr:"April",may:"May",jun:"June",jul:"July",aug:"August",sep:"September",oct:"October",nov:"November",dec:"December",Jan:"January",Feb:"February",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"August",Sep:"September",Oct:"October",Nov:"November",Dec:"December"},this.getErrors=function(){return this.ERRORS_},this.parse=function(e){for(var t=0;t<e.length;t++)this.processCharacter_(e[t])},this.error_=function(e){this.ERRORS_.push([this.LINE_,this.CHAR_IN_LINE_,this.CHAR_,e])},this.processEntry_=function(){var e=this.DATA_;if(e.Fields)for(var t in e.Fields){for(var i=e.Fields[t],n=0;n<this.CHARCONV_.length;n++){var s=this.CHARCONV_[n][0],a=this.CHARCONV_[n][1];i=i.replace(s,a)}i=i.replace(/[\n\r\t]/g," ").replace(/\s\s+/g," ").replace(/^\s+|\s+$/g,"");for(var o=i.length,r="",n=0;n<o;n++){var l=i[n],c=!1;"\\"==l&&n<o-1?l=i[++n]:"{"!=l&&"}"!=l||(c=!0),c||(r+=l)}e.Fields[t]=r}if("string"==e.ObjectType)for(var t in e.Fields)this.MACROS_[t]=e.Fields[t];else this.CALLBACK_(e)},this.processCharacter_=function(e){if(this.CHAR_++,this.CHAR_IN_LINE_++,"\n"==e&&(this.LINE_++,this.CHAR_IN_LINE_=1),this.SKIPTILLEOL_)return void("\n"==e&&(this.SKIPTILLEOL_=!1));if(this.SKIPCOMMENT_&&"%"==e)return void(this.SKIPTILLEOL_=!0);if(!this.SKIPWS_||!/\s/.test(e)){this.SKIPWS_=!1,this.SKIPCOMMENT_=!1,this.SKIPTILLEOL_=!1;for(var t=!0;t;)switch(t=!1,this.STATE_){case this.STATES_.ENTRY_OR_JUNK:"@"==e&&(this.STATE_=this.STATES_.OBJECT_TYPE,this.DATA_={ObjectType:""}),this.BRACETYPE_=null,this.SKIPWS_=!0,this.SKIPCOMMENT_=!0;break;case this.STATES_.OBJECT_TYPE:if(/[A-Za-z]/.test(e))this.DATA_.ObjectType+=e.toLowerCase(),this.SKIPWS_=!0,this.SKIPCOMMENT_=!0;else{var i=this.DATA_.ObjectType;"comment"==i?this.STATE_=this.STATES_.ENTRY_OR_JUNK:"string"==i?(this.DATA_.ObjectType=i,this.DATA_.Fields={},this.BRACETYPE_=e,this.BRACECOUNT_=1,this.STATE_=this.STATES_.KV_KEY,this.SKIPWS_=!0,this.SKIPCOMMENT_=!0,this.PARSETMP_={Key:""}):"preamble"==i?this.STATE_=this.STATES_.ENTRY_OR_JUNK:i in this.ENTRY_TYPES_?(this.DATA_.ObjectType="entry",this.DATA_.EntryType=i,this.DATA_.EntryKey="",this.STATE_=this.STATES_.ENTRY_KEY,t=!0):(this.error_('Unrecognized object type: "'+this.DATA_.ObjectType+'"'),this.STATE_=this.STATES_.ENTRY_OR_JUNK)}break;case this.STATES_.ENTRY_KEY:if(("{"===e||"("===e)&&null==this.BRACETYPE_){this.BRACETYPE_=e,this.BRACECOUNT_=1,this.SKIPWS_=!0,this.SKIPCOMMENT_=!0;
break}/[,%\s]/.test(e)?this.DATA_.EntryKey.length<1?(this.SKIPWS_=!0,this.SKIPCOMMENT_=!0):null==this.BRACETYPE_?(this.error_("No opening brace for object."),this.STATE_=this.STATES_.ENTRY_OR_JUNK):(this.SKIPWS_=!0,this.SKIPCOMMENT_=!0,t=!0,this.STATE_=this.STATES_.KV_KEY,this.PARSETMP_.Key="",this.DATA_.Fields={}):(this.DATA_.EntryKey+=e,this.SKIPWS_=!1,this.SKIPCOMMENT_=!1);break;case this.STATES_.KV_KEY:if("}"==e&&"{"==this.BRACETYPE_||")"==e&&"("==this.BRACETYPE_){this.processEntry_(),this.SKIPWS_=!0,this.SKIPCOMMENT_=!0,this.STATE_=this.STATES_.ENTRY_OR_JUNK;break}/[\-A-Za-z:]/.test(e)?(this.PARSETMP_.Key+=e,this.SKIPWS_=!1,this.SKIPCOMMENT_=!1):this.PARSETMP_.Key.length<1?(this.SKIPWS_=!0,this.SKIPCOMMENT_=!0):(this.SKIPWS_=!0,this.SKIPCOMMENT_=!0,this.STATE_=this.STATES_.EQUALS,t=!0);break;case this.STATES_.EQUALS:if("}"==e&&"{"==this.BRACETYPE_||")"==e&&"("==this.BRACETYPE_){this.error_('Key-value pair has key "'+this.PARSETMP_.Key+'", but no value.'),this.processEntry_(),this.SKIPWS_=!0,this.SKIPCOMMENT_=!0,this.STATE_=this.STATES_.ENTRY_OR_JUNK;break}"="==e&&(this.SKIPWS_=!0,this.SKIPCOMMENT_=!0,this.STATE_=this.STATES_.KV_VALUE,this.PARSETMP_.Value="",this.VALBRACES_={'"':[],"{":[]});break;case this.STATES_.KV_VALUE:var n=this.VALBRACES_,s=this.PARSETMP_.Value,a=!1;if('"'==e||"{"==e||"}"==e||","==e){if(","==e&&0===n['"'].length+n["{"].length){var o=this.PARSETMP_.Value.trim();o in this.MACROS_?this.PARSETMP_.Value=this.MACROS_[o]:this.error_("Reference to an undefined macro: "+o),a=!0}if('"'==e){if(0===n['"'].length+n["{"].length){n['"'].push(this.CHAR_),this.SKIPWS_=!1,this.SKIPCOMMENT_=!1;break}1!=n['"'].length||0!=n["{"].length||0!=s.length&&"\\"==s[s.length-1]||(a=!0)}if("{"==e&&(0!=s.length&&"\\"==s[s.length-1]||(n["{"].push(this.CHAR_),this.SKIPWS_=!1,this.SKIPCOMMENT_=!1)),"}"==e)if(0===n['"'].length+n["{"].length){var o=this.PARSETMP_.Value.trim();o in this.MACROS_?this.PARSETMP_.Value=this.MACROS_[o]:this.error_("Reference to an undefined macro: "+o),t=!0,a=!0}else 0!=s.length&&"\\"==s[s.length-1]||n["{"].length>0&&(n["{"].splice(n["{"].length-1,1),0==n["{"].length+n['"'].length&&(a=!0))}a?(this.SKIPWS_=!0,this.SKIPCOMMENT_=!0,this.STATE_=this.STATES_.KV_KEY,this.DATA_.Fields[this.PARSETMP_.Key]=this.PARSETMP_.Value,this.PARSETMP_={Key:""},this.VALBRACES_=null):this.PARSETMP_.Value+=e}}},this.CHARCONV_=[[/\\space /g," "],[/\\textdollar /g,"$"],[/\\textquotesingle /g,"'"],[/\\ast /g,"*"],[/\\textbackslash /g,"\\"],[/\\\^\{\}/g,"^"],[/\\textasciigrave /g,"`"],[/\\lbrace /g,"{"],[/\\vert /g,"|"],[/\\rbrace /g,"}"],[/\\textasciitilde /g,"~"],[/\\textexclamdown /g,"¡"],[/\\textcent /g,"¢"],[/\\textsterling /g,"£"],[/\\textcurrency /g,"¤"],[/\\textyen /g,"¥"],[/\\textbrokenbar /g,"¦"],[/\\textsection /g,"§"],[/\\textasciidieresis /g,"¨"],[/\\textcopyright /g,"©"],[/\\textordfeminine /g,"ª"],[/\\guillemotleft /g,"«"],[/\\lnot /g,"¬"],[/\\textregistered /g,"®"],[/\\textasciimacron /g,"¯"],[/\\textdegree /g,"°"],[/\\pm /g,"±"],[/\\textasciiacute /g,"´"],[/\\mathrm\{\\mu\}/g,"µ"],[/\\textparagraph /g,"¶"],[/\\cdot /g,"·"],[/\\c\{\}/g,"¸"],[/\\textordmasculine /g,"º"],[/\\guillemotright /g,"»"],[/\\textonequarter /g,"¼"],[/\\textonehalf /g,"½"],[/\\textthreequarters /g,"¾"],[/\\textquestiondown /g,"¿"],[/\\`\{A\}/g,"À"],[/\\'\{A\}/g,"Á"],[/\\\^\{A\}/g,"Â"],[/\\~\{A\}/g,"Ã"],[/\\"\{A\}/g,"Ä"],[/\\AA /g,"Å"],[/\\AE /g,"Æ"],[/\\c\{C\}/g,"Ç"],[/\\`\{E\}/g,"È"],[/\\'\{E\}/g,"É"],[/\\\^\{E\}/g,"Ê"],[/\\"\{E\}/g,"Ë"],[/\\`\{I\}/g,"Ì"],[/\\'\{I\}/g,"Í"],[/\\\^\{I\}/g,"Î"],[/\\"\{I\}/g,"Ï"],[/\\DH /g,"Ð"],[/\\~\{N\}/g,"Ñ"],[/\\`\{O\}/g,"Ò"],[/\\'\{O\}/g,"Ó"],[/\\\^\{O\}/g,"Ô"],[/\\~\{O\}/g,"Õ"],[/\\"\{O\}/g,"Ö"],[/\\texttimes /g,"×"],[/\\O /g,"Ø"],[/\\`\{U\}/g,"Ù"],[/\\'\{U\}/g,"Ú"],[/\\\^\{U\}/g,"Û"],[/\\"\{U\}/g,"Ü"],[/\\'\{Y\}/g,"Ý"],[/\\TH /g,"Þ"],[/\\ss /g,"ß"],[/\\`\{a\}/g,"à"],[/\\'\{a\}/g,"á"],[/\\\^\{a\}/g,"â"],[/\\~\{a\}/g,"ã"],[/\\"\{a\}/g,"ä"],[/\\aa /g,"å"],[/\\ae /g,"æ"],[/\\c\{c\}/g,"ç"],[/\\`\{e\}/g,"è"],[/\\'\{e\}/g,"é"],[/\\\^\{e\}/g,"ê"],[/\\"\{e\}/g,"ë"],[/\\`\{\\i\}/g,"ì"],[/\\'\{\\i\}/g,"í"],[/\\\^\{\\i\}/g,"î"],[/\\"\{\\i\}/g,"ï"],[/\\dh /g,"ð"],[/\\~\{n\}/g,"ñ"],[/\\`\{o\}/g,"ò"],[/\\'\{o\}/g,"ó"],[/\\\^\{o\}/g,"ô"],[/\\~\{o\}/g,"õ"],[/\\"\{o\}/g,"ö"],[/\\div /g,"÷"],[/\\o /g,"ø"],[/\\`\{u\}/g,"ù"],[/\\'\{u\}/g,"ú"],[/\\\^\{u\}/g,"û"],[/\\"\{u\}/g,"ü"],[/\\'\{y\}/g,"ý"],[/\\th /g,"þ"],[/\\"\{y\}/g,"ÿ"],[/\\=\{A\}/g,"Ā"],[/\\=\{a\}/g,"ā"],[/\\u\{A\}/g,"Ă"],[/\\u\{a\}/g,"ă"],[/\\k\{A\}/g,"Ą"],[/\\k\{a\}/g,"ą"],[/\\'\{C\}/g,"Ć"],[/\\'\{c\}/g,"ć"],[/\\\^\{C\}/g,"Ĉ"],[/\\\^\{c\}/g,"ĉ"],[/\\.\{C\}/g,"Ċ"],[/\\.\{c\}/g,"ċ"],[/\\v\{C\}/g,"Č"],[/\\v\{c\}/g,"č"],[/\\v\{D\}/g,"Ď"],[/\\v\{d\}/g,"ď"],[/\\DJ /g,"Đ"],[/\\dj /g,"đ"],[/\\=\{E\}/g,"Ē"],[/\\=\{e\}/g,"ē"],[/\\u\{E\}/g,"Ĕ"],[/\\u\{e\}/g,"ĕ"],[/\\.\{E\}/g,"Ė"],[/\\.\{e\}/g,"ė"],[/\\k\{E\}/g,"Ę"],[/\\k\{e\}/g,"ę"],[/\\v\{E\}/g,"Ě"],[/\\v\{e\}/g,"ě"],[/\\\^\{G\}/g,"Ĝ"],[/\\\^\{g\}/g,"ĝ"],[/\\u\{G\}/g,"Ğ"],[/\\u\{g\}/g,"ğ"],[/\\.\{G\}/g,"Ġ"],[/\\.\{g\}/g,"ġ"],[/\\c\{G\}/g,"Ģ"],[/\\c\{g\}/g,"ģ"],[/\\\^\{H\}/g,"Ĥ"],[/\\\^\{h\}/g,"ĥ"],[/\\Elzxh /g,"ħ"],[/\\~\{I\}/g,"Ĩ"],[/\\~\{\\i\}/g,"ĩ"],[/\\=\{I\}/g,"Ī"],[/\\=\{\\i\}/g,"ī"],[/\\u\{I\}/g,"Ĭ"],[/\\u\{\\i\}/g,"ĭ"],[/\\k\{I\}/g,"Į"],[/\\k\{i\}/g,"į"],[/\\.\{I\}/g,"İ"],[/\\i /g,"ı"],[/\\\^\{J\}/g,"Ĵ"],[/\\\^\{\\j\}/g,"ĵ"],[/\\c\{K\}/g,"Ķ"],[/\\c\{k\}/g,"ķ"],[/\\'\{L\}/g,"Ĺ"],[/\\'\{l\}/g,"ĺ"],[/\\c\{L\}/g,"Ļ"],[/\\c\{l\}/g,"ļ"],[/\\v\{L\}/g,"Ľ"],[/\\v\{l\}/g,"ľ"],[/\\L /g,"Ł"],[/\\l /g,"ł"],[/\\'\{N\}/g,"Ń"],[/\\'\{n\}/g,"ń"],[/\\c\{N\}/g,"Ņ"],[/\\c\{n\}/g,"ņ"],[/\\v\{N\}/g,"Ň"],[/\\v\{n\}/g,"ň"],[/\\NG /g,"Ŋ"],[/\\ng /g,"ŋ"],[/\\=\{O\}/g,"Ō"],[/\\=\{o\}/g,"ō"],[/\\u\{O\}/g,"Ŏ"],[/\\u\{o\}/g,"ŏ"],[/\\H\{O\}/g,"Ő"],[/\\H\{o\}/g,"ő"],[/\\OE /g,"Œ"],[/\\oe /g,"œ"],[/\\'\{R\}/g,"Ŕ"],[/\\'\{r\}/g,"ŕ"],[/\\c\{R\}/g,"Ŗ"],[/\\c\{r\}/g,"ŗ"],[/\\v\{R\}/g,"Ř"],[/\\v\{r\}/g,"ř"],[/\\'\{S\}/g,"Ś"],[/\\'\{s\}/g,"ś"],[/\\\^\{S\}/g,"Ŝ"],[/\\\^\{s\}/g,"ŝ"],[/\\c\{S\}/g,"Ş"],[/\\c\{s\}/g,"ş"],[/\\v\{S\}/g,"Š"],[/\\v\{s\}/g,"š"],[/\\c\{T\}/g,"Ţ"],[/\\c\{t\}/g,"ţ"],[/\\v\{T\}/g,"Ť"],[/\\v\{t\}/g,"ť"],[/\\~\{U\}/g,"Ũ"],[/\\~\{u\}/g,"ũ"],[/\\=\{U\}/g,"Ū"],[/\\=\{u\}/g,"ū"],[/\\u\{U\}/g,"Ŭ"],[/\\u\{u\}/g,"ŭ"],[/\\r\{U\}/g,"Ů"],[/\\r\{u\}/g,"ů"],[/\\H\{U\}/g,"Ű"],[/\\H\{u\}/g,"ű"],[/\\k\{U\}/g,"Ų"],[/\\k\{u\}/g,"ų"],[/\\\^\{W\}/g,"Ŵ"],[/\\\^\{w\}/g,"ŵ"],[/\\\^\{Y\}/g,"Ŷ"],[/\\\^\{y\}/g,"ŷ"],[/\\"\{Y\}/g,"Ÿ"],[/\\'\{Z\}/g,"Ź"],[/\\'\{z\}/g,"ź"],[/\\.\{Z\}/g,"Ż"],[/\\.\{z\}/g,"ż"],[/\\v\{Z\}/g,"Ž"],[/\\v\{z\}/g,"ž"],[/\\texthvlig /g,"ƕ"],[/\\textnrleg /g,"ƞ"],[/\\eth /g,"ƪ"],[/\\textdoublepipe /g,"ǂ"],[/\\'\{g\}/g,"ǵ"],[/\\Elztrna /g,"ɐ"],[/\\Elztrnsa /g,"ɒ"],[/\\Elzopeno /g,"ɔ"],[/\\Elzrtld /g,"ɖ"],[/\\Elzschwa /g,"ə"],[/\\varepsilon /g,"ɛ"],[/\\Elzpgamma /g,"ɣ"],[/\\Elzpbgam /g,"ɤ"],[/\\Elztrnh /g,"ɥ"],[/\\Elzbtdl /g,"ɬ"],[/\\Elzrtll /g,"ɭ"],[/\\Elztrnm /g,"ɯ"],[/\\Elztrnmlr /g,"ɰ"],[/\\Elzltlmr /g,"ɱ"],[/\\Elzltln /g,"ɲ"],[/\\Elzrtln /g,"ɳ"],[/\\Elzclomeg /g,"ɷ"],[/\\textphi /g,"ɸ"],[/\\Elztrnr /g,"ɹ"],[/\\Elztrnrl /g,"ɺ"],[/\\Elzrttrnr /g,"ɻ"],[/\\Elzrl /g,"ɼ"],[/\\Elzrtlr /g,"ɽ"],[/\\Elzfhr /g,"ɾ"],[/\\Elzrtls /g,"ʂ"],[/\\Elzesh /g,"ʃ"],[/\\Elztrnt /g,"ʇ"],[/\\Elzrtlt /g,"ʈ"],[/\\Elzpupsil /g,"ʊ"],[/\\Elzpscrv /g,"ʋ"],[/\\Elzinvv /g,"ʌ"],[/\\Elzinvw /g,"ʍ"],[/\\Elztrny /g,"ʎ"],[/\\Elzrtlz /g,"ʐ"],[/\\Elzyogh /g,"ʒ"],[/\\Elzglst /g,"ʔ"],[/\\Elzreglst /g,"ʕ"],[/\\Elzinglst /g,"ʖ"],[/\\textturnk /g,"ʞ"],[/\\Elzdyogh /g,"ʤ"],[/\\Elztesh /g,"ʧ"],[/\\textasciicaron /g,"ˇ"],[/\\Elzverts /g,"ˈ"],[/\\Elzverti /g,"ˌ"],[/\\Elzlmrk /g,"ː"],[/\\Elzhlmrk /g,"ˑ"],[/\\Elzsbrhr /g,"˒"],[/\\Elzsblhr /g,"˓"],[/\\Elzrais /g,"˔"],[/\\Elzlow /g,"˕"],[/\\textasciibreve /g,"˘"],[/\\textperiodcentered /g,"˙"],[/\\r\{\}/g,"˚"],[/\\k\{\}/g,"˛"],[/\\texttildelow /g,"˜"],[/\\H\{\}/g,"˝"],[/\\tone\{55\}/g,"˥"],[/\\tone\{44\}/g,"˦"],[/\\tone\{33\}/g,"˧"],[/\\tone\{22\}/g,"˨"],[/\\tone\{11\}/g,"˩"],[/\\cyrchar\\C/g,"̏"],[/\\Elzpalh /g,"̡"],[/\\Elzrh /g,"̢"],[/\\Elzsbbrg /g,"̪"],[/\\Elzxl /g,"̵"],[/\\Elzbar /g,"̶"],[/\\'\{A\}/g,"Ά"],[/\\'\{E\}/g,"Έ"],[/\\'\{H\}/g,"Ή"],[/\\'\{\}\{I\}/g,"Ί"],[/\\'\{\}O/g,"Ό"],[/\\mathrm\{'Y\}/g,"Ύ"],[/\\mathrm\{'\\Omega\}/g,"Ώ"],[/\\acute\{\\ddot\{\\iota\}\}/g,"ΐ"],[/\\Alpha /g,"Α"],[/\\Beta /g,"Β"],[/\\Gamma /g,"Γ"],[/\\Delta /g,"Δ"],[/\\Epsilon /g,"Ε"],[/\\Zeta /g,"Ζ"],[/\\Eta /g,"Η"],[/\\Theta /g,"Θ"],[/\\Iota /g,"Ι"],[/\\Kappa /g,"Κ"],[/\\Lambda /g,"Λ"],[/\\Xi /g,"Ξ"],[/\\Pi /g,"Π"],[/\\Rho /g,"Ρ"],[/\\Sigma /g,"Σ"],[/\\Tau /g,"Τ"],[/\\Upsilon /g,"Υ"],[/\\Phi /g,"Φ"],[/\\Chi /g,"Χ"],[/\\Psi /g,"Ψ"],[/\\Omega /g,"Ω"],[/\\mathrm\{\\ddot\{I\}\}/g,"Ϊ"],[/\\mathrm\{\\ddot\{Y\}\}/g,"Ϋ"],[/\\'\{\$\\alpha\$\}/g,"ά"],[/\\acute\{\\epsilon\}/g,"έ"],[/\\acute\{\\eta\}/g,"ή"],[/\\acute\{\\iota\}/g,"ί"],[/\\acute\{\\ddot\{\\upsilon\}\}/g,"ΰ"],[/\\alpha /g,"α"],[/\\beta /g,"β"],[/\\gamma /g,"γ"],[/\\delta /g,"δ"],[/\\epsilon /g,"ε"],[/\\zeta /g,"ζ"],[/\\eta /g,"η"],[/\\texttheta /g,"θ"],[/\\iota /g,"ι"],[/\\kappa /g,"κ"],[/\\lambda /g,"λ"],[/\\mu /g,"μ"],[/\\nu /g,"ν"],[/\\xi /g,"ξ"],[/\\pi /g,"π"],[/\\rho /g,"ρ"],[/\\varsigma /g,"ς"],[/\\sigma /g,"σ"],[/\\tau /g,"τ"],[/\\upsilon /g,"υ"],[/\\varphi /g,"φ"],[/\\chi /g,"χ"],[/\\psi /g,"ψ"],[/\\omega /g,"ω"],[/\\ddot\{\\iota\}/g,"ϊ"],[/\\ddot\{\\upsilon\}/g,"ϋ"],[/\\'\{o\}/g,"ό"],[/\\acute\{\\upsilon\}/g,"ύ"],[/\\acute\{\\omega\}/g,"ώ"],[/\\Pisymbol\{ppi022\}\{87\}/g,"ϐ"],[/\\textvartheta /g,"ϑ"],[/\\Upsilon /g,"ϒ"],[/\\phi /g,"ϕ"],[/\\varpi /g,"ϖ"],[/\\Stigma /g,"Ϛ"],[/\\Digamma /g,"Ϝ"],[/\\digamma /g,"ϝ"],[/\\Koppa /g,"Ϟ"],[/\\Sampi /g,"Ϡ"],[/\\varkappa /g,"ϰ"],[/\\varrho /g,"ϱ"],[/\\textTheta /g,"ϴ"],[/\\backepsilon /g,"϶"],[/\\cyrchar\\CYRYO /g,"Ё"],[/\\cyrchar\\CYRDJE /g,"Ђ"],[/\\cyrchar\{\\'\\CYRG\}/g,"Ѓ"],[/\\cyrchar\\CYRIE /g,"Є"],[/\\cyrchar\\CYRDZE /g,"Ѕ"],[/\\cyrchar\\CYRII /g,"І"],[/\\cyrchar\\CYRYI /g,"Ї"],[/\\cyrchar\\CYRJE /g,"Ј"],[/\\cyrchar\\CYRLJE /g,"Љ"],[/\\cyrchar\\CYRNJE /g,"Њ"],[/\\cyrchar\\CYRTSHE /g,"Ћ"],[/\\cyrchar\{\\'\\CYRK\}/g,"Ќ"],[/\\cyrchar\\CYRUSHRT /g,"Ў"],[/\\cyrchar\\CYRDZHE /g,"Џ"],[/\\cyrchar\\CYRA /g,"А"],[/\\cyrchar\\CYRB /g,"Б"],[/\\cyrchar\\CYRV /g,"В"],[/\\cyrchar\\CYRG /g,"Г"],[/\\cyrchar\\CYRD /g,"Д"],[/\\cyrchar\\CYRE /g,"Е"],[/\\cyrchar\\CYRZH /g,"Ж"],[/\\cyrchar\\CYRZ /g,"З"],[/\\cyrchar\\CYRI /g,"И"],[/\\cyrchar\\CYRISHRT /g,"Й"],[/\\cyrchar\\CYRK /g,"К"],[/\\cyrchar\\CYRL /g,"Л"],[/\\cyrchar\\CYRM /g,"М"],[/\\cyrchar\\CYRN /g,"Н"],[/\\cyrchar\\CYRO /g,"О"],[/\\cyrchar\\CYRP /g,"П"],[/\\cyrchar\\CYRR /g,"Р"],[/\\cyrchar\\CYRS /g,"С"],[/\\cyrchar\\CYRT /g,"Т"],[/\\cyrchar\\CYRU /g,"У"],[/\\cyrchar\\CYRF /g,"Ф"],[/\\cyrchar\\CYRH /g,"Х"],[/\\cyrchar\\CYRC /g,"Ц"],[/\\cyrchar\\CYRCH /g,"Ч"],[/\\cyrchar\\CYRSH /g,"Ш"],[/\\cyrchar\\CYRSHCH /g,"Щ"],[/\\cyrchar\\CYRHRDSN /g,"Ъ"],[/\\cyrchar\\CYRERY /g,"Ы"],[/\\cyrchar\\CYRSFTSN /g,"Ь"],[/\\cyrchar\\CYREREV /g,"Э"],[/\\cyrchar\\CYRYU /g,"Ю"],[/\\cyrchar\\CYRYA /g,"Я"],[/\\cyrchar\\cyra /g,"а"],[/\\cyrchar\\cyrb /g,"б"],[/\\cyrchar\\cyrv /g,"в"],[/\\cyrchar\\cyrg /g,"г"],[/\\cyrchar\\cyrd /g,"д"],[/\\cyrchar\\cyre /g,"е"],[/\\cyrchar\\cyrzh /g,"ж"],[/\\cyrchar\\cyrz /g,"з"],[/\\cyrchar\\cyri /g,"и"],[/\\cyrchar\\cyrishrt /g,"й"],[/\\cyrchar\\cyrk /g,"к"],[/\\cyrchar\\cyrl /g,"л"],[/\\cyrchar\\cyrm /g,"м"],[/\\cyrchar\\cyrn /g,"н"],[/\\cyrchar\\cyro /g,"о"],[/\\cyrchar\\cyrp /g,"п"],[/\\cyrchar\\cyrr /g,"р"],[/\\cyrchar\\cyrs /g,"с"],[/\\cyrchar\\cyrt /g,"т"],[/\\cyrchar\\cyru /g,"у"],[/\\cyrchar\\cyrf /g,"ф"],[/\\cyrchar\\cyrh /g,"х"],[/\\cyrchar\\cyrc /g,"ц"],[/\\cyrchar\\cyrch /g,"ч"],[/\\cyrchar\\cyrsh /g,"ш"],[/\\cyrchar\\cyrshch /g,"щ"],[/\\cyrchar\\cyrhrdsn /g,"ъ"],[/\\cyrchar\\cyrery /g,"ы"],[/\\cyrchar\\cyrsftsn /g,"ь"],[/\\cyrchar\\cyrerev /g,"э"],[/\\cyrchar\\cyryu /g,"ю"],[/\\cyrchar\\cyrya /g,"я"],[/\\cyrchar\\cyryo /g,"ё"],[/\\cyrchar\\cyrdje /g,"ђ"],[/\\cyrchar\{\\'\\cyrg\}/g,"ѓ"],[/\\cyrchar\\cyrie /g,"є"],[/\\cyrchar\\cyrdze /g,"ѕ"],[/\\cyrchar\\cyrii /g,"і"],[/\\cyrchar\\cyryi /g,"ї"],[/\\cyrchar\\cyrje /g,"ј"],[/\\cyrchar\\cyrlje /g,"љ"],[/\\cyrchar\\cyrnje /g,"њ"],[/\\cyrchar\\cyrtshe /g,"ћ"],[/\\cyrchar\{\\'\\cyrk\}/g,"ќ"],[/\\cyrchar\\cyrushrt /g,"ў"],[/\\cyrchar\\cyrdzhe /g,"џ"],[/\\cyrchar\\CYROMEGA /g,"Ѡ"],[/\\cyrchar\\cyromega /g,"ѡ"],[/\\cyrchar\\CYRYAT /g,"Ѣ"],[/\\cyrchar\\CYRIOTE /g,"Ѥ"],[/\\cyrchar\\cyriote /g,"ѥ"],[/\\cyrchar\\CYRLYUS /g,"Ѧ"],[/\\cyrchar\\cyrlyus /g,"ѧ"],[/\\cyrchar\\CYRIOTLYUS /g,"Ѩ"],[/\\cyrchar\\cyriotlyus /g,"ѩ"],[/\\cyrchar\\CYRBYUS /g,"Ѫ"],[/\\cyrchar\\CYRIOTBYUS /g,"Ѭ"],[/\\cyrchar\\cyriotbyus /g,"ѭ"],[/\\cyrchar\\CYRKSI /g,"Ѯ"],[/\\cyrchar\\cyrksi /g,"ѯ"],[/\\cyrchar\\CYRPSI /g,"Ѱ"],[/\\cyrchar\\cyrpsi /g,"ѱ"],[/\\cyrchar\\CYRFITA /g,"Ѳ"],[/\\cyrchar\\CYRIZH /g,"Ѵ"],[/\\cyrchar\\CYRUK /g,"Ѹ"],[/\\cyrchar\\cyruk /g,"ѹ"],[/\\cyrchar\\CYROMEGARND /g,"Ѻ"],[/\\cyrchar\\cyromegarnd /g,"ѻ"],[/\\cyrchar\\CYROMEGATITLO /g,"Ѽ"],[/\\cyrchar\\cyromegatitlo /g,"ѽ"],[/\\cyrchar\\CYROT /g,"Ѿ"],[/\\cyrchar\\cyrot /g,"ѿ"],[/\\cyrchar\\CYRKOPPA /g,"Ҁ"],[/\\cyrchar\\cyrkoppa /g,"ҁ"],[/\\cyrchar\\cyrthousands /g,"҂"],[/\\cyrchar\\cyrhundredthousands /g,"҈"],[/\\cyrchar\\cyrmillions /g,"҉"],[/\\cyrchar\\CYRSEMISFTSN /g,"Ҍ"],[/\\cyrchar\\cyrsemisftsn /g,"ҍ"],[/\\cyrchar\\CYRRTICK /g,"Ҏ"],[/\\cyrchar\\cyrrtick /g,"ҏ"],[/\\cyrchar\\CYRGUP /g,"Ґ"],[/\\cyrchar\\cyrgup /g,"ґ"],[/\\cyrchar\\CYRGHCRS /g,"Ғ"],[/\\cyrchar\\cyrghcrs /g,"ғ"],[/\\cyrchar\\CYRGHK /g,"Ҕ"],[/\\cyrchar\\cyrghk /g,"ҕ"],[/\\cyrchar\\CYRZHDSC /g,"Җ"],[/\\cyrchar\\cyrzhdsc /g,"җ"],[/\\cyrchar\\CYRZDSC /g,"Ҙ"],[/\\cyrchar\\cyrzdsc /g,"ҙ"],[/\\cyrchar\\CYRKDSC /g,"Қ"],[/\\cyrchar\\cyrkdsc /g,"қ"],[/\\cyrchar\\CYRKVCRS /g,"Ҝ"],[/\\cyrchar\\cyrkvcrs /g,"ҝ"],[/\\cyrchar\\CYRKHCRS /g,"Ҟ"],[/\\cyrchar\\cyrkhcrs /g,"ҟ"],[/\\cyrchar\\CYRKBEAK /g,"Ҡ"],[/\\cyrchar\\cyrkbeak /g,"ҡ"],[/\\cyrchar\\CYRNDSC /g,"Ң"],[/\\cyrchar\\cyrndsc /g,"ң"],[/\\cyrchar\\CYRNG /g,"Ҥ"],[/\\cyrchar\\cyrng /g,"ҥ"],[/\\cyrchar\\CYRPHK /g,"Ҧ"],[/\\cyrchar\\cyrphk /g,"ҧ"],[/\\cyrchar\\CYRABHHA /g,"Ҩ"],[/\\cyrchar\\cyrabhha /g,"ҩ"],[/\\cyrchar\\CYRSDSC /g,"Ҫ"],[/\\cyrchar\\cyrsdsc /g,"ҫ"],[/\\cyrchar\\CYRTDSC /g,"Ҭ"],[/\\cyrchar\\cyrtdsc /g,"ҭ"],[/\\cyrchar\\CYRY /g,"Ү"],[/\\cyrchar\\cyry /g,"ү"],[/\\cyrchar\\CYRYHCRS /g,"Ұ"],[/\\cyrchar\\cyryhcrs /g,"ұ"],[/\\cyrchar\\CYRHDSC /g,"Ҳ"],[/\\cyrchar\\cyrhdsc /g,"ҳ"],[/\\cyrchar\\CYRTETSE /g,"Ҵ"],[/\\cyrchar\\cyrtetse /g,"ҵ"],[/\\cyrchar\\CYRCHRDSC /g,"Ҷ"],[/\\cyrchar\\cyrchrdsc /g,"ҷ"],[/\\cyrchar\\CYRCHVCRS /g,"Ҹ"],[/\\cyrchar\\cyrchvcrs /g,"ҹ"],[/\\cyrchar\\CYRSHHA /g,"Һ"],[/\\cyrchar\\cyrshha /g,"һ"],[/\\cyrchar\\CYRABHCH /g,"Ҽ"],[/\\cyrchar\\cyrabhch /g,"ҽ"],[/\\cyrchar\\CYRABHCHDSC /g,"Ҿ"],[/\\cyrchar\\cyrabhchdsc /g,"ҿ"],[/\\cyrchar\\CYRpalochka /g,"Ӏ"],[/\\cyrchar\\CYRKHK /g,"Ӄ"],[/\\cyrchar\\cyrkhk /g,"ӄ"],[/\\cyrchar\\CYRNHK /g,"Ӈ"],[/\\cyrchar\\cyrnhk /g,"ӈ"],[/\\cyrchar\\CYRCHLDSC /g,"Ӌ"],[/\\cyrchar\\cyrchldsc /g,"ӌ"],[/\\cyrchar\\CYRAE /g,"Ӕ"],[/\\cyrchar\\cyrae /g,"ӕ"],[/\\cyrchar\\CYRSCHWA /g,"Ә"],[/\\cyrchar\\cyrschwa /g,"ә"],[/\\cyrchar\\CYRABHDZE /g,"Ӡ"],[/\\cyrchar\\cyrabhdze /g,"ӡ"],[/\\cyrchar\\CYROTLD /g,"Ө"],[/\\cyrchar\\cyrotld /g,"ө"],[/\\hspace\{0.6em\}/g," "],[/\\hspace\{1em\}/g," "],[/\\hspace\{0.33em\}/g," "],[/\\hspace\{0.25em\}/g," "],[/\\hspace\{0.166em\}/g," "],[/\\hphantom\{0\}/g," "],[/\\hphantom\{,\}/g," "],[/\\hspace\{0.167em\}/g," "],[/\\mkern1mu /g," "],[/\\textendash /g,"–"],[/\\textemdash /g,"—"],[/\\rule\{1em\}\{1pt\}/g,"―"],[/\\Vert /g,"‖"],[/\\Elzreapos /g,"‛"],[/\\textquotedblleft /g,"“"],[/\\textquotedblright /g,"”"],[/\\textdagger /g,"†"],[/\\textdaggerdbl /g,"‡"],[/\\textbullet /g,"•"],[/\\ldots /g,"…"],[/\\textperthousand /g,"‰"],[/\\textpertenthousand /g,"‱"],[/\\backprime /g,"‵"],[/\\guilsinglleft /g,"‹"],[/\\guilsinglright /g,"›"],[/\\mkern4mu /g," "],[/\\nolinebreak /g,""],[/\\ensuremath\{\\Elzpes\}/g,"₧"],[/\\mbox\{\\texteuro\} /g,"€"],[/\\dddot /g,"⃛"],[/\\ddddot /g,"⃜"],[/\\mathbb\{C\}/g,"ℂ"],[/\\mathscr\{g\}/g,"ℊ"],[/\\mathscr\{H\}/g,"ℋ"],[/\\mathfrak\{H\}/g,"ℌ"],[/\\mathbb\{H\}/g,"ℍ"],[/\\hslash /g,"ℏ"],[/\\mathscr\{I\}/g,"ℐ"],[/\\mathfrak\{I\}/g,"ℑ"],[/\\mathscr\{L\}/g,"ℒ"],[/\\mathscr\{l\}/g,"ℓ"],[/\\mathbb\{N\}/g,"ℕ"],[/\\cyrchar\\textnumero /g,"№"],[/\\wp /g,"℘"],[/\\mathbb\{P\}/g,"ℙ"],[/\\mathbb\{Q\}/g,"ℚ"],[/\\mathscr\{R\}/g,"ℛ"],[/\\mathfrak\{R\}/g,"ℜ"],[/\\mathbb\{R\}/g,"ℝ"],[/\\Elzxrat /g,"℞"],[/\\texttrademark /g,"™"],[/\\mathbb\{Z\}/g,"ℤ"],[/\\Omega /g,"Ω"],[/\\mho /g,"℧"],[/\\mathfrak\{Z\}/g,"ℨ"],[/\\ElsevierGlyph\{2129\}/g,"℩"],[/\\AA /g,"Å"],[/\\mathscr\{B\}/g,"ℬ"],[/\\mathfrak\{C\}/g,"ℭ"],[/\\mathscr\{e\}/g,"ℯ"],[/\\mathscr\{E\}/g,"ℰ"],[/\\mathscr\{F\}/g,"ℱ"],[/\\mathscr\{M\}/g,"ℳ"],[/\\mathscr\{o\}/g,"ℴ"],[/\\aleph /g,"ℵ"],[/\\beth /g,"ℶ"],[/\\gimel /g,"ℷ"],[/\\daleth /g,"ℸ"],[/\\textfrac\{1\}\{3\}/g,"⅓"],[/\\textfrac\{2\}\{3\}/g,"⅔"],[/\\textfrac\{1\}\{5\}/g,"⅕"],[/\\textfrac\{2\}\{5\}/g,"⅖"],[/\\textfrac\{3\}\{5\}/g,"⅗"],[/\\textfrac\{4\}\{5\}/g,"⅘"],[/\\textfrac\{1\}\{6\}/g,"⅙"],[/\\textfrac\{5\}\{6\}/g,"⅚"],[/\\textfrac\{1\}\{8\}/g,"⅛"],[/\\textfrac\{3\}\{8\}/g,"⅜"],[/\\textfrac\{5\}\{8\}/g,"⅝"],[/\\textfrac\{7\}\{8\}/g,"⅞"],[/\\leftarrow /g,"←"],[/\\uparrow /g,"↑"],[/\\rightarrow /g,"→"],[/\\downarrow /g,"↓"],[/\\leftrightarrow /g,"↔"],[/\\updownarrow /g,"↕"],[/\\nwarrow /g,"↖"],[/\\nearrow /g,"↗"],[/\\searrow /g,"↘"],[/\\swarrow /g,"↙"],[/\\nleftarrow /g,"↚"],[/\\nrightarrow /g,"↛"],[/\\arrowwaveright /g,"↜"],[/\\arrowwaveright /g,"↝"],[/\\twoheadleftarrow /g,"↞"],[/\\twoheadrightarrow /g,"↠"],[/\\leftarrowtail /g,"↢"],[/\\rightarrowtail /g,"↣"],[/\\mapsto /g,"↦"],[/\\hookleftarrow /g,"↩"],[/\\hookrightarrow /g,"↪"],[/\\looparrowleft /g,"↫"],[/\\looparrowright /g,"↬"],[/\\leftrightsquigarrow /g,"↭"],[/\\nleftrightarrow /g,"↮"],[/\\Lsh /g,"↰"],[/\\Rsh /g,"↱"],[/\\ElsevierGlyph\{21B3\}/g,"↳"],[/\\curvearrowleft /g,"↶"],[/\\curvearrowright /g,"↷"],[/\\circlearrowleft /g,"↺"],[/\\circlearrowright /g,"↻"],[/\\leftharpoonup /g,"↼"],[/\\leftharpoondown /g,"↽"],[/\\upharpoonright /g,"↾"],[/\\upharpoonleft /g,"↿"],[/\\rightharpoonup /g,"⇀"],[/\\rightharpoondown /g,"⇁"],[/\\downharpoonright /g,"⇂"],[/\\downharpoonleft /g,"⇃"],[/\\rightleftarrows /g,"⇄"],[/\\dblarrowupdown /g,"⇅"],[/\\leftrightarrows /g,"⇆"],[/\\leftleftarrows /g,"⇇"],[/\\upuparrows /g,"⇈"],[/\\rightrightarrows /g,"⇉"],[/\\downdownarrows /g,"⇊"],[/\\leftrightharpoons /g,"⇋"],[/\\rightleftharpoons /g,"⇌"],[/\\nLeftarrow /g,"⇍"],[/\\nLeftrightarrow /g,"⇎"],[/\\nRightarrow /g,"⇏"],[/\\Leftarrow /g,"⇐"],[/\\Uparrow /g,"⇑"],[/\\Rightarrow /g,"⇒"],[/\\Downarrow /g,"⇓"],[/\\Leftrightarrow /g,"⇔"],[/\\Updownarrow /g,"⇕"],[/\\Lleftarrow /g,"⇚"],[/\\Rrightarrow /g,"⇛"],[/\\rightsquigarrow /g,"⇝"],[/\\DownArrowUpArrow /g,"⇵"],[/\\forall /g,"∀"],[/\\complement /g,"∁"],[/\\partial /g,"∂"],[/\\exists /g,"∃"],[/\\nexists /g,"∄"],[/\\varnothing /g,"∅"],[/\\nabla /g,"∇"],[/\\in /g,"∈"],[/\\not\\in /g,"∉"],[/\\ni /g,"∋"],[/\\not\\ni /g,"∌"],[/\\prod /g,"∏"],[/\\coprod /g,"∐"],[/\\sum /g,"∑"],[/\\mp /g,"∓"],[/\\dotplus /g,"∔"],[/\\setminus /g,"∖"],[/\\circ /g,"∘"],[/\\bullet /g,"∙"],[/\\surd /g,"√"],[/\\propto /g,"∝"],[/\\infty /g,"∞"],[/\\rightangle /g,"∟"],[/\\angle /g,"∠"],[/\\measuredangle /g,"∡"],[/\\sphericalangle /g,"∢"],[/\\mid /g,"∣"],[/\\nmid /g,"∤"],[/\\parallel /g,"∥"],[/\\nparallel /g,"∦"],[/\\wedge /g,"∧"],[/\\vee /g,"∨"],[/\\cap /g,"∩"],[/\\cup /g,"∪"],[/\\int /g,"∫"],[/\\int\\!\\int /g,"∬"],[/\\int\\!\\int\\!\\int /g,"∭"],[/\\oint /g,"∮"],[/\\surfintegral /g,"∯"],[/\\volintegral /g,"∰"],[/\\clwintegral /g,"∱"],[/\\ElsevierGlyph\{2232\}/g,"∲"],[/\\ElsevierGlyph\{2233\}/g,"∳"],[/\\therefore /g,"∴"],[/\\because /g,"∵"],[/\\Colon /g,"∷"],[/\\ElsevierGlyph\{2238\}/g,"∸"],[/\\mathbin\{\{:\}\\!\\!\{\-\}\\!\\!\{:\}\}/g,"∺"],[/\\homothetic /g,"∻"],[/\\sim /g,"∼"],[/\\backsim /g,"∽"],[/\\lazysinv /g,"∾"],[/\\wr /g,"≀"],[/\\not\\sim /g,"≁"],[/\\ElsevierGlyph\{2242\}/g,"≂"],[/\\NotEqualTilde /g,"≂-00338"],[/\\simeq /g,"≃"],[/\\not\\simeq /g,"≄"],[/\\cong /g,"≅"],[/\\approxnotequal /g,"≆"],[/\\not\\cong /g,"≇"],[/\\approx /g,"≈"],[/\\not\\approx /g,"≉"],[/\\approxeq /g,"≊"],[/\\tildetrpl /g,"≋"],[/\\not\\apid /g,"≋-00338"],[/\\allequal /g,"≌"],[/\\asymp /g,"≍"],[/\\Bumpeq /g,"≎"],[/\\NotHumpDownHump /g,"≎-00338"],[/\\bumpeq /g,"≏"],[/\\NotHumpEqual /g,"≏-00338"],[/\\doteq /g,"≐"],[/\\not\\doteq/g,"≐-00338"],[/\\doteqdot /g,"≑"],[/\\fallingdotseq /g,"≒"],[/\\risingdotseq /g,"≓"],[/\\eqcirc /g,"≖"],[/\\circeq /g,"≗"],[/\\estimates /g,"≙"],[/\\ElsevierGlyph\{225A\}/g,"≚"],[/\\starequal /g,"≛"],[/\\triangleq /g,"≜"],[/\\ElsevierGlyph\{225F\}/g,"≟"],[/\\not =/g,"≠"],[/\\equiv /g,"≡"],[/\\not\\equiv /g,"≢"],[/\\leq /g,"≤"],[/\\geq /g,"≥"],[/\\leqq /g,"≦"],[/\\geqq /g,"≧"],[/\\lneqq /g,"≨"],[/\\lvertneqq /g,"≨-0FE00"],[/\\gneqq /g,"≩"],[/\\gvertneqq /g,"≩-0FE00"],[/\\ll /g,"≪"],[/\\NotLessLess /g,"≪-00338"],[/\\gg /g,"≫"],[/\\NotGreaterGreater /g,"≫-00338"],[/\\between /g,"≬"],[/\\not\\kern\-0.3em\\times /g,"≭"],[/\\not</g,"≮"],[/\\not>/g,"≯"],[/\\not\\leq /g,"≰"],[/\\not\\geq /g,"≱"],[/\\lessequivlnt /g,"≲"],[/\\greaterequivlnt /g,"≳"],[/\\ElsevierGlyph\{2274\}/g,"≴"],[/\\ElsevierGlyph\{2275\}/g,"≵"],[/\\lessgtr /g,"≶"],[/\\gtrless /g,"≷"],[/\\notlessgreater /g,"≸"],[/\\notgreaterless /g,"≹"],[/\\prec /g,"≺"],[/\\succ /g,"≻"],[/\\preccurlyeq /g,"≼"],[/\\succcurlyeq /g,"≽"],[/\\precapprox /g,"≾"],[/\\NotPrecedesTilde /g,"≾-00338"],[/\\succapprox /g,"≿"],[/\\NotSucceedsTilde /g,"≿-00338"],[/\\not\\prec /g,"⊀"],[/\\not\\succ /g,"⊁"],[/\\subset /g,"⊂"],[/\\supset /g,"⊃"],[/\\not\\subset /g,"⊄"],[/\\not\\supset /g,"⊅"],[/\\subseteq /g,"⊆"],[/\\supseteq /g,"⊇"],[/\\not\\subseteq /g,"⊈"],[/\\not\\supseteq /g,"⊉"],[/\\subsetneq /g,"⊊"],[/\\varsubsetneqq /g,"⊊-0FE00"],[/\\supsetneq /g,"⊋"],[/\\varsupsetneq /g,"⊋-0FE00"],[/\\uplus /g,"⊎"],[/\\sqsubset /g,"⊏"],[/\\NotSquareSubset /g,"⊏-00338"],[/\\sqsupset /g,"⊐"],[/\\NotSquareSuperset /g,"⊐-00338"],[/\\sqsubseteq /g,"⊑"],[/\\sqsupseteq /g,"⊒"],[/\\sqcap /g,"⊓"],[/\\sqcup /g,"⊔"],[/\\oplus /g,"⊕"],[/\\ominus /g,"⊖"],[/\\otimes /g,"⊗"],[/\\oslash /g,"⊘"],[/\\odot /g,"⊙"],[/\\circledcirc /g,"⊚"],[/\\circledast /g,"⊛"],[/\\circleddash /g,"⊝"],[/\\boxplus /g,"⊞"],[/\\boxminus /g,"⊟"],[/\\boxtimes /g,"⊠"],[/\\boxdot /g,"⊡"],[/\\vdash /g,"⊢"],[/\\dashv /g,"⊣"],[/\\top /g,"⊤"],[/\\perp /g,"⊥"],[/\\truestate /g,"⊧"],[/\\forcesextra /g,"⊨"],[/\\Vdash /g,"⊩"],[/\\Vvdash /g,"⊪"],[/\\VDash /g,"⊫"],[/\\nvdash /g,"⊬"],[/\\nvDash /g,"⊭"],[/\\nVdash /g,"⊮"],[/\\nVDash /g,"⊯"],[/\\vartriangleleft /g,"⊲"],[/\\vartriangleright /g,"⊳"],[/\\trianglelefteq /g,"⊴"],[/\\trianglerighteq /g,"⊵"],[/\\original /g,"⊶"],[/\\image /g,"⊷"],[/\\multimap /g,"⊸"],[/\\hermitconjmatrix /g,"⊹"],[/\\intercal /g,"⊺"],[/\\veebar /g,"⊻"],[/\\rightanglearc /g,"⊾"],[/\\ElsevierGlyph\{22C0\}/g,"⋀"],[/\\ElsevierGlyph\{22C1\}/g,"⋁"],[/\\bigcap /g,"⋂"],[/\\bigcup /g,"⋃"],[/\\diamond /g,"⋄"],[/\\cdot /g,"⋅"],[/\\star /g,"⋆"],[/\\divideontimes /g,"⋇"],[/\\bowtie /g,"⋈"],[/\\ltimes /g,"⋉"],[/\\rtimes /g,"⋊"],[/\\leftthreetimes /g,"⋋"],[/\\rightthreetimes /g,"⋌"],[/\\backsimeq /g,"⋍"],[/\\curlyvee /g,"⋎"],[/\\curlywedge /g,"⋏"],[/\\Subset /g,"⋐"],[/\\Supset /g,"⋑"],[/\\Cap /g,"⋒"],[/\\Cup /g,"⋓"],[/\\pitchfork /g,"⋔"],[/\\lessdot /g,"⋖"],[/\\gtrdot /g,"⋗"],[/\\verymuchless /g,"⋘"],[/\\verymuchgreater /g,"⋙"],[/\\lesseqgtr /g,"⋚"],[/\\gtreqless /g,"⋛"],[/\\curlyeqprec /g,"⋞"],[/\\curlyeqsucc /g,"⋟"],[/\\not\\sqsubseteq /g,"⋢"],[/\\not\\sqsupseteq /g,"⋣"],[/\\Elzsqspne /g,"⋥"],[/\\lnsim /g,"⋦"],[/\\gnsim /g,"⋧"],[/\\precedesnotsimilar /g,"⋨"],[/\\succnsim /g,"⋩"],[/\\ntriangleleft /g,"⋪"],[/\\ntriangleright /g,"⋫"],[/\\ntrianglelefteq /g,"⋬"],[/\\ntrianglerighteq /g,"⋭"],[/\\vdots /g,"⋮"],[/\\cdots /g,"⋯"],[/\\upslopeellipsis /g,"⋰"],[/\\downslopeellipsis /g,"⋱"],[/\\barwedge /g,"⌅"],[/\\perspcorrespond /g,"⌆"],[/\\lceil /g,"⌈"],[/\\rceil /g,"⌉"],[/\\lfloor /g,"⌊"],[/\\rfloor /g,"⌋"],[/\\recorder /g,"⌕"],[/\\mathchar"2208/g,"⌖"],[/\\ulcorner /g,"⌜"],[/\\urcorner /g,"⌝"],[/\\llcorner /g,"⌞"],[/\\lrcorner /g,"⌟"],[/\\frown /g,"⌢"],[/\\smile /g,"⌣"],[/\\langle /g,"〈"],[/\\rangle /g,"〉"],[/\\ElsevierGlyph\{E838\}/g,"⌽"],[/\\Elzdlcorn /g,"⎣"],[/\\lmoustache /g,"⎰"],[/\\rmoustache /g,"⎱"],[/\\textvisiblespace /g,"␣"],[/\\ding\{172\}/g,"①"],[/\\ding\{173\}/g,"②"],[/\\ding\{174\}/g,"③"],[/\\ding\{175\}/g,"④"],[/\\ding\{176\}/g,"⑤"],[/\\ding\{177\}/g,"⑥"],[/\\ding\{178\}/g,"⑦"],[/\\ding\{179\}/g,"⑧"],[/\\ding\{180\}/g,"⑨"],[/\\ding\{181\}/g,"⑩"],[/\\circledS /g,"Ⓢ"],[/\\Elzdshfnc /g,"┆"],[/\\Elzsqfnw /g,"┙"],[/\\diagup /g,"╱"],[/\\ding\{110\}/g,"■"],[/\\square /g,"□"],[/\\blacksquare /g,"▪"],[/\\fbox\{~~\}/g,"▭"],[/\\Elzvrecto /g,"▯"],[/\\ElsevierGlyph\{E381\}/g,"▱"],[/\\ding\{115\}/g,"▲"],[/\\bigtriangleup /g,"△"],[/\\blacktriangle /g,"▴"],[/\\vartriangle /g,"▵"],[/\\blacktriangleright /g,"▸"],[/\\triangleright /g,"▹"],[/\\ding\{116\}/g,"▼"],[/\\bigtriangledown /g,"▽"],[/\\blacktriangledown /g,"▾"],[/\\triangledown /g,"▿"],[/\\blacktriangleleft /g,"◂"],[/\\triangleleft /g,"◃"],[/\\ding\{117\}/g,"◆"],[/\\lozenge /g,"◊"],[/\\bigcirc /g,"○"],[/\\ding\{108\}/g,"●"],[/\\Elzcirfl /g,"◐"],[/\\Elzcirfr /g,"◑"],[/\\Elzcirfb /g,"◒"],[/\\ding\{119\}/g,"◗"],[/\\Elzrvbull /g,"◘"],[/\\Elzsqfl /g,"◧"],[/\\Elzsqfr /g,"◨"],[/\\Elzsqfse /g,"◪"],[/\\bigcirc /g,"◯"],[/\\ding\{72\}/g,"★"],[/\\ding\{73\}/g,"☆"],[/\\ding\{37\}/g,"☎"],[/\\ding\{42\}/g,"☛"],[/\\ding\{43\}/g,"☞"],[/\\rightmoon /g,"☾"],[/\\mercury /g,"☿"],[/\\venus /g,"♀"],[/\\male /g,"♂"],[/\\jupiter /g,"♃"],[/\\saturn /g,"♄"],[/\\uranus /g,"♅"],[/\\neptune /g,"♆"],[/\\pluto /g,"♇"],[/\\aries /g,"♈"],[/\\taurus /g,"♉"],[/\\gemini /g,"♊"],[/\\cancer /g,"♋"],[/\\leo /g,"♌"],[/\\virgo /g,"♍"],[/\\libra /g,"♎"],[/\\scorpio /g,"♏"],[/\\sagittarius /g,"♐"],[/\\capricornus /g,"♑"],[/\\aquarius /g,"♒"],[/\\pisces /g,"♓"],[/\\ding\{171\}/g,"♠"],[/\\diamond /g,"♢"],[/\\ding\{168\}/g,"♣"],[/\\ding\{170\}/g,"♥"],[/\\ding\{169\}/g,"♦"],[/\\quarternote /g,"♩"],[/\\eighthnote /g,"♪"],[/\\flat /g,"♭"],[/\\natural /g,"♮"],[/\\sharp /g,"♯"],[/\\ding\{33\}/g,"✁"],[/\\ding\{34\}/g,"✂"],[/\\ding\{35\}/g,"✃"],[/\\ding\{36\}/g,"✄"],[/\\ding\{38\}/g,"✆"],[/\\ding\{39\}/g,"✇"],[/\\ding\{40\}/g,"✈"],[/\\ding\{41\}/g,"✉"],[/\\ding\{44\}/g,"✌"],[/\\ding\{45\}/g,"✍"],[/\\ding\{46\}/g,"✎"],[/\\ding\{47\}/g,"✏"],[/\\ding\{48\}/g,"✐"],[/\\ding\{49\}/g,"✑"],[/\\ding\{50\}/g,"✒"],[/\\ding\{51\}/g,"✓"],[/\\ding\{52\}/g,"✔"],[/\\ding\{53\}/g,"✕"],[/\\ding\{54\}/g,"✖"],[/\\ding\{55\}/g,"✗"],[/\\ding\{56\}/g,"✘"],[/\\ding\{57\}/g,"✙"],[/\\ding\{58\}/g,"✚"],[/\\ding\{59\}/g,"✛"],[/\\ding\{60\}/g,"✜"],[/\\ding\{61\}/g,"✝"],[/\\ding\{62\}/g,"✞"],[/\\ding\{63\}/g,"✟"],[/\\ding\{64\}/g,"✠"],[/\\ding\{65\}/g,"✡"],[/\\ding\{66\}/g,"✢"],[/\\ding\{67\}/g,"✣"],[/\\ding\{68\}/g,"✤"],[/\\ding\{69\}/g,"✥"],[/\\ding\{70\}/g,"✦"],[/\\ding\{71\}/g,"✧"],[/\\ding\{73\}/g,"✩"],[/\\ding\{74\}/g,"✪"],[/\\ding\{75\}/g,"✫"],[/\\ding\{76\}/g,"✬"],[/\\ding\{77\}/g,"✭"],[/\\ding\{78\}/g,"✮"],[/\\ding\{79\}/g,"✯"],[/\\ding\{80\}/g,"✰"],[/\\ding\{81\}/g,"✱"],[/\\ding\{82\}/g,"✲"],[/\\ding\{83\}/g,"✳"],[/\\ding\{84\}/g,"✴"],[/\\ding\{85\}/g,"✵"],[/\\ding\{86\}/g,"✶"],[/\\ding\{87\}/g,"✷"],[/\\ding\{88\}/g,"✸"],[/\\ding\{89\}/g,"✹"],[/\\ding\{90\}/g,"✺"],[/\\ding\{91\}/g,"✻"],[/\\ding\{92\}/g,"✼"],[/\\ding\{93\}/g,"✽"],[/\\ding\{94\}/g,"✾"],[/\\ding\{95\}/g,"✿"],[/\\ding\{96\}/g,"❀"],[/\\ding\{97\}/g,"❁"],[/\\ding\{98\}/g,"❂"],[/\\ding\{99\}/g,"❃"],[/\\ding\{100\}/g,"❄"],[/\\ding\{101\}/g,"❅"],[/\\ding\{102\}/g,"❆"],[/\\ding\{103\}/g,"❇"],[/\\ding\{104\}/g,"❈"],[/\\ding\{105\}/g,"❉"],[/\\ding\{106\}/g,"❊"],[/\\ding\{107\}/g,"❋"],[/\\ding\{109\}/g,"❍"],[/\\ding\{111\}/g,"❏"],[/\\ding\{112\}/g,"❐"],[/\\ding\{113\}/g,"❑"],[/\\ding\{114\}/g,"❒"],[/\\ding\{118\}/g,"❖"],[/\\ding\{120\}/g,"❘"],[/\\ding\{121\}/g,"❙"],[/\\ding\{122\}/g,"❚"],[/\\ding\{123\}/g,"❛"],[/\\ding\{124\}/g,"❜"],[/\\ding\{125\}/g,"❝"],[/\\ding\{126\}/g,"❞"],[/\\ding\{161\}/g,"❡"],[/\\ding\{162\}/g,"❢"],[/\\ding\{163\}/g,"❣"],[/\\ding\{164\}/g,"❤"],[/\\ding\{165\}/g,"❥"],[/\\ding\{166\}/g,"❦"],[/\\ding\{167\}/g,"❧"],[/\\ding\{182\}/g,"❶"],[/\\ding\{183\}/g,"❷"],[/\\ding\{184\}/g,"❸"],[/\\ding\{185\}/g,"❹"],[/\\ding\{186\}/g,"❺"],[/\\ding\{187\}/g,"❻"],[/\\ding\{188\}/g,"❼"],[/\\ding\{189\}/g,"❽"],[/\\ding\{190\}/g,"❾"],[/\\ding\{191\}/g,"❿"],[/\\ding\{192\}/g,"➀"],[/\\ding\{193\}/g,"➁"],[/\\ding\{194\}/g,"➂"],[/\\ding\{195\}/g,"➃"],[/\\ding\{196\}/g,"➄"],[/\\ding\{197\}/g,"➅"],[/\\ding\{198\}/g,"➆"],[/\\ding\{199\}/g,"➇"],[/\\ding\{200\}/g,"➈"],[/\\ding\{201\}/g,"➉"],[/\\ding\{202\}/g,"➊"],[/\\ding\{203\}/g,"➋"],[/\\ding\{204\}/g,"➌"],[/\\ding\{205\}/g,"➍"],[/\\ding\{206\}/g,"➎"],[/\\ding\{207\}/g,"➏"],[/\\ding\{208\}/g,"➐"],[/\\ding\{209\}/g,"➑"],[/\\ding\{210\}/g,"➒"],[/\\ding\{211\}/g,"➓"],[/\\ding\{212\}/g,"➔"],[/\\ding\{216\}/g,"➘"],[/\\ding\{217\}/g,"➙"],[/\\ding\{218\}/g,"➚"],[/\\ding\{219\}/g,"➛"],[/\\ding\{220\}/g,"➜"],[/\\ding\{221\}/g,"➝"],[/\\ding\{222\}/g,"➞"],[/\\ding\{223\}/g,"➟"],[/\\ding\{224\}/g,"➠"],[/\\ding\{225\}/g,"➡"],[/\\ding\{226\}/g,"➢"],[/\\ding\{227\}/g,"➣"],[/\\ding\{228\}/g,"➤"],[/\\ding\{229\}/g,"➥"],[/\\ding\{230\}/g,"➦"],[/\\ding\{231\}/g,"➧"],[/\\ding\{232\}/g,"➨"],[/\\ding\{233\}/g,"➩"],[/\\ding\{234\}/g,"➪"],[/\\ding\{235\}/g,"➫"],[/\\ding\{236\}/g,"➬"],[/\\ding\{237\}/g,"➭"],[/\\ding\{238\}/g,"➮"],[/\\ding\{239\}/g,"➯"],[/\\ding\{241\}/g,"➱"],[/\\ding\{242\}/g,"➲"],[/\\ding\{243\}/g,"➳"],[/\\ding\{244\}/g,"➴"],[/\\ding\{245\}/g,"➵"],[/\\ding\{246\}/g,"➶"],[/\\ding\{247\}/g,"➷"],[/\\ding\{248\}/g,"➸"],[/\\ding\{249\}/g,"➹"],[/\\ding\{250\}/g,"➺"],[/\\ding\{251\}/g,"➻"],[/\\ding\{252\}/g,"➼"],[/\\ding\{253\}/g,"➽"],[/\\ding\{254\}/g,"➾"],[/\\longleftarrow /g,"⟵"],[/\\longrightarrow /g,"⟶"],[/\\longleftrightarrow /g,"⟷"],[/\\Longleftarrow /g,"⟸"],[/\\Longrightarrow /g,"⟹"],[/\\Longleftrightarrow /g,"⟺"],[/\\longmapsto /g,"⟼"],[/\\sim\\joinrel\\leadsto/g,"⟿"],[/\\ElsevierGlyph\{E212\}/g,"⤅"],[/\\UpArrowBar /g,"⤒"],[/\\DownArrowBar /g,"⤓"],[/\\ElsevierGlyph\{E20C\}/g,"⤣"],[/\\ElsevierGlyph\{E20D\}/g,"⤤"],[/\\ElsevierGlyph\{E20B\}/g,"⤥"],[/\\ElsevierGlyph\{E20A\}/g,"⤦"],[/\\ElsevierGlyph\{E211\}/g,"⤧"],[/\\ElsevierGlyph\{E20E\}/g,"⤨"],[/\\ElsevierGlyph\{E20F\}/g,"⤩"],[/\\ElsevierGlyph\{E210\}/g,"⤪"],[/\\ElsevierGlyph\{E21C\}/g,"⤳"],[/\\ElsevierGlyph\{E21D\}/g,"⤳-00338"],[/\\ElsevierGlyph\{E21A\}/g,"⤶"],[/\\ElsevierGlyph\{E219\}/g,"⤷"],[/\\Elolarr /g,"⥀"],[/\\Elorarr /g,"⥁"],[/\\ElzRlarr /g,"⥂"],[/\\ElzrLarr /g,"⥄"],[/\\Elzrarrx /g,"⥇"],[/\\LeftRightVector /g,"⥎"],[/\\RightUpDownVector /g,"⥏"],[/\\DownLeftRightVector /g,"⥐"],[/\\LeftUpDownVector /g,"⥑"],[/\\LeftVectorBar /g,"⥒"],[/\\RightVectorBar /g,"⥓"],[/\\RightUpVectorBar /g,"⥔"],[/\\RightDownVectorBar /g,"⥕"],[/\\DownLeftVectorBar /g,"⥖"],[/\\DownRightVectorBar /g,"⥗"],[/\\LeftUpVectorBar /g,"⥘"],[/\\LeftDownVectorBar /g,"⥙"],[/\\LeftTeeVector /g,"⥚"],[/\\RightTeeVector /g,"⥛"],[/\\RightUpTeeVector /g,"⥜"],[/\\RightDownTeeVector /g,"⥝"],[/\\DownLeftTeeVector /g,"⥞"],[/\\DownRightTeeVector /g,"⥟"],[/\\LeftUpTeeVector /g,"⥠"],[/\\LeftDownTeeVector /g,"⥡"],[/\\UpEquilibrium /g,"⥮"],[/\\ReverseUpEquilibrium /g,"⥯"],[/\\RoundImplies /g,"⥰"],[/\\ElsevierGlyph\{E214\}/g,"⥼"],[/\\ElsevierGlyph\{E215\}/g,"⥽"],[/\\Elztfnc /g,"⦀"],[/\\ElsevierGlyph\{3018\}/g,"⦅"],[/\\Elroang /g,"⦆"],[/\\ElsevierGlyph\{E291\}/g,"⦔"],[/\\Elzddfnc /g,"⦙"],[/\\Angle /g,"⦜"],[/\\Elzlpargt /g,"⦠"],[/\\ElsevierGlyph\{E260\}/g,"⦵"],[/\\ElsevierGlyph\{E61B\}/g,"⦶"],[/\\ElzLap /g,"⧊"],[/\\Elzdefas /g,"⧋"],[/\\LeftTriangleBar /g,"⧏"],[/\\NotLeftTriangleBar /g,"⧏-00338"],[/\\RightTriangleBar /g,"⧐"],[/\\NotRightTriangleBar /g,"⧐-00338"],[/\\ElsevierGlyph\{E372\}/g,"⧜"],[/\\blacklozenge /g,"⧫"],[/\\RuleDelayed /g,"⧴"],[/\\Elxuplus /g,"⨄"],[/\\ElzThr /g,"⨅"],[/\\Elxsqcup /g,"⨆"],[/\\ElzInf /g,"⨇"],[/\\ElzSup /g,"⨈"],[/\\ElzCint /g,"⨍"],[/\\clockoint /g,"⨏"],[/\\ElsevierGlyph\{E395\}/g,"⨐"],[/\\sqrint /g,"⨖"],[/\\ElsevierGlyph\{E25A\}/g,"⨥"],[/\\ElsevierGlyph\{E25B\}/g,"⨪"],[/\\ElsevierGlyph\{E25C\}/g,"⨭"],[/\\ElsevierGlyph\{E25D\}/g,"⨮"],[/\\ElzTimes /g,"⨯"],[/\\ElsevierGlyph\{E25E\}/g,"⨴"],[/\\ElsevierGlyph\{E25E\}/g,"⨵"],[/\\ElsevierGlyph\{E259\}/g,"⨼"],[/\\amalg /g,"⨿"],[/\\ElzAnd /g,"⩓"],[/\\ElzOr /g,"⩔"],[/\\ElsevierGlyph\{E36E\}/g,"⩕"],[/\\ElOr /g,"⩖"],[/\\perspcorrespond /g,"⩞"],[/\\Elzminhat /g,"⩟"],[/\\ElsevierGlyph\{225A\}/g,"⩣"],[/\\stackrel\{*\}\{=\}/g,"⩮"],[/\\Equal /g,"⩵"],[/\\leqslant /g,"⩽"],[/\\nleqslant /g,"⩽-00338"],[/\\geqslant /g,"⩾"],[/\\ngeqslant /g,"⩾-00338"],[/\\lessapprox /g,"⪅"],[/\\gtrapprox /g,"⪆"],[/\\lneq /g,"⪇"],[/\\gneq /g,"⪈"],[/\\lnapprox /g,"⪉"],[/\\gnapprox /g,"⪊"],[/\\lesseqqgtr /g,"⪋"],[/\\gtreqqless /g,"⪌"],[/\\eqslantless /g,"⪕"],[/\\eqslantgtr /g,"⪖"],[/\\Pisymbol\{ppi020\}\{117\}/g,"⪝"],[/\\Pisymbol\{ppi020\}\{105\}/g,"⪞"],[/\\NestedLessLess /g,"⪡"],[/\\NotNestedLessLess /g,"⪡-00338"],[/\\NestedGreaterGreater /g,"⪢"],[/\\NotNestedGreaterGreater /g,"⪢-00338"],[/\\preceq /g,"⪯"],[/\\not\\preceq /g,"⪯-00338"],[/\\succeq /g,"⪰"],[/\\not\\succeq /g,"⪰-00338"],[/\\precneqq /g,"⪵"],[/\\succneqq /g,"⪶"],[/\\precapprox /g,"⪷"],[/\\succapprox /g,"⪸"],[/\\precnapprox /g,"⪹"],[/\\succnapprox /g,"⪺"],[/\\subseteqq /g,"⫅"],[/\\nsubseteqq /g,"⫅-00338"],[/\\supseteqq /g,"⫆"],[/\\nsupseteqq/g,"⫆-00338"],[/\\subsetneqq /g,"⫋"],[/\\supsetneqq /g,"⫌"],[/\\ElsevierGlyph\{E30D\}/g,"⫫"],[/\\Elztdcol /g,"⫶"],[/\\ElsevierGlyph\{300A\}/g,"《"],[/\\ElsevierGlyph\{300B\}/g,"》"],[/\\ElsevierGlyph\{3018\}/g,"〘"],[/\\ElsevierGlyph\{3019\}/g,"〙"],[/\\openbracketleft /g,"〚"],[/\\openbracketright /g,"〛"]],
this}"undefined"!=typeof e&&e.exports&&(e.exports=i)},function(e,t,i){var n,s;(function(a){n=[i(6),i(19),i(5)],s=function(e,t,i){var n=a.View.extend({tagName:"div",className:"citations",render:function(){return this.$el.append("<p>"+this.formattedReference()+"</p>"),this},formattedReference:function(){var e=this.model,t=e.entryType(),i=e.fields(),n="",s=this._asSentence((i.author?i.author:"")+(i.year?" ("+i.year+")":""))+" ",a=i.title||"",o=i.pages?"pp. "+i.pages:"",r=i.address;if("article"==t){var l=(i.volume?i.volume:"")+(i.number?" ("+i.number+")":"")+(o?", "+o:"");n=s+this._asSentence(a)+(i.journal?"In <em>"+i.journal+", ":"")+this._asSentence(l)+this._asSentence(i.address)+"</em>"}else n="inproceedings"==t||"proceedings"==t?s+this._asSentence(a)+(i.booktitle?"In <em>"+i.booktitle+", ":"")+(o?o:"")+(r?", "+r:"")+".</em>":"mastersthesis"==t||"phdthesis"==t?s+this._asSentence(a)+(i.howpublished?i.howpublished+". ":"")+(i.note?i.note+".":""):"techreport"==t?s+this._asSentence(a)+this._asSentence(i.institution)+this._asSentence(i.number)+this._asSentence(i.type):"book"==t||"inbook"==t||"incollection"==t?s+" "+this._formatBookInfo(i):s+" "+this._asSentence(a)+this._asSentence(i.howpublished)+this._asSentence(i.note);var c="";i.doi&&(c="http://dx.doi.org/"+i.doi,n+='[<a href="'+c+'" target="_blank">doi:'+i.doi+"</a>]");var d=i.url||c;return d&&(n+='[<a href="'+d+'" target="_blank">Link</a>]'),n},_formatBookInfo:function(e){var t="";return e.chapter&&(t+=e.chapter+" in "),e.title&&(t+="<em>"+e.title+"</em>"),e.editor&&(t+=", Edited by "+e.editor+", "),e.publisher&&(t+=", "+e.publisher),e.pages&&(t+=", pp. "+e.pages),e.series&&(t+=", <em>"+e.series+"</em>"),e.volume&&(t+=", Vol."+e.volume),e.issn&&(t+=", ISBN: "+e.issn),t+"."},_asSentence:function(e){return e&&e.trim()?e+". ":""}}),s=a.View.extend({el:"#citations",initialize:function(){this.listenTo(this.collection,"add",this.renderCitation)},events:{"click .citations-to-bibtex":"showBibtex","click .citations-to-formatted":"showFormatted"},renderCitation:function(e){var t=new n({model:e});this.$(".citations-formatted").append(t.render().el);var i=this.$(".citations-bibtex-text");i.val(i.val()+"\n\r"+e.attributes.content)},render:function(){this.$el.html(this.citationsElement()),this.collection.each(function(e){this.renderCitation(e)},this),this.showFormatted()},showBibtex:function(){this.$(".citations-to-formatted").show(),this.$(".citations-to-bibtex").hide(),this.$(".citations-bibtex").show(),this.$(".citations-formatted").hide(),this.$(".citations-bibtex-text").select()},showFormatted:function(){this.$(".citations-to-formatted").hide(),this.$(".citations-to-bibtex").show(),this.$(".citations-bibtex").hide(),this.$(".citations-formatted").show()},partialWarningElement:function(){return this.collection.partial?['<div style="padding:5px 10px">',"<b>Warning: This is a experimental feature.</b> 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",' <a href="https://galaxyproject.org/citing-galaxy">cite Galaxy</a>.',"</div>"].join(""):""},citationsElement:function(){return['<div class="toolForm">','<div class="toolFormTitle">',i("Citations"),' <button type="button" class="btn btn-xs citations-to-bibtex" title="Show all in BibTeX format."><i class="fa fa-pencil-square-o"></i> Show BibTeX</button>',' <button type="button" class="btn btn-xs citations-to-formatted" title="Return to formatted citation list."><i class="fa fa-times"></i> Hide BibTeX</button>',"</div>",'<div class="toolFormBody" style="padding:5px 10px">',this.partialWarningElement(),'<span class="citations-formatted" style="word-wrap: break-word;"></span>',"</div>",'<div class="citations-bibtex toolFormBody" style="padding:5px 10px">','<textarea style="width: 100%; height: 500px;" class="citations-bibtex-text"></textarea>',"</div>","</div>"].join("")}});return{CitationView:n,CitationListView:s}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3))},function(e,t,i){var n,s;(function(a,o,r){n=[i(47),i(38),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=e.FoldoutListItemView,l=e.ListItemView,c=s.extend({className:s.prototype.className+" dataset-collection",id:function(){return["dataset_collection",this.model.get("id")].join("-")},initialize:function(e){this.linkTarget=e.linkTarget||"_blank",this.hasUser=e.hasUser,s.prototype.initialize.call(this,e)},_setUpListeners:function(){s.prototype._setUpListeners.call(this),this.listenTo(this.model,"change",function(e,t){a.has(e.changed,"deleted")?this.render():a.has(e.changed,"element_count")&&this.$("> .title-bar .subtitle").replaceWith(this._renderSubtitle())})},_renderSubtitle:function(){return o(this.templates.subtitle(this.model.toJSON(),this))},_getFoldoutPanelOptions:function(){var e=s.prototype._getFoldoutPanelOptions.call(this);return a.extend(e,{linkTarget:this.linkTarget,hasUser:this.hasUser})},$selector:function(){return this.$("> .selector")},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCListItemView("+e+")"}});c.prototype.templates=function(){var e=a.extend({},s.prototype.templates.warnings,{error:i.wrapTemplate(["<% if( model.error ){ %>",'<div class="errormessagesmall">',n("There was an error getting the data for this collection"),": <%- model.error %>","</div>","<% } %>"]),purged:i.wrapTemplate(["<% if( model.purged ){ %>",'<div class="purged-msg warningmessagesmall">',n("This collection has been deleted and removed from disk"),"</div>","<% } %>"]),deleted:i.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'<div class="deleted-msg warningmessagesmall">',n("This collection has been deleted"),"</div>","<% } %>"])}),t=i.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<div class="title">','<span class="name"><%- collection.element_identifier || collection.name %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"collection"),o=i.wrapTemplate(['<div class="subtitle">','<% var countText = collection.element_count? ( collection.element_count + " " ) : ""; %>','<% if( collection.collection_type === "list" ){ %>',n("a list of <%- countText %>datasets"),'<% } else if( collection.collection_type === "paired" ){ %>',n("a pair of datasets"),'<% } else if( collection.collection_type === "list:paired" ){ %>',n("a list of <%- countText %>dataset pairs"),'<% } else if( collection.collection_type === "list:list" ){ %>',n("a list of <%- countText %>dataset lists"),"<% } %>","</div>"],"collection");return a.extend({},s.prototype.templates,{warnings:e,titleBar:t,subtitle:o})}();var d=l.extend({className:l.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DCEListItemView.initialize:",e),l.prototype.initialize.call(this,e)},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCEListItemView("+e+")"}});d.prototype.templates=function(){var e=i.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<div class="title">','<span class="name"><%- element.element_identifier %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"element");return a.extend({},l.prototype.templates,{titleBar:e})}();var h=t.DatasetListItemView.extend({className:t.DatasetListItemView.prototype.className+" dataset-collection-element",initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log("DatasetDCEListItemView.initialize:",e),t.DatasetListItemView.prototype.initialize.call(this,e)},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):r.when()},toString:function(){var e=this.model?this.model+"":"(no model)";return"DatasetDCEListItemView("+e+")"}});h.prototype.templates=function(){var e=i.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="name"><%- element.element_identifier %></span>',"</div>","</div>"],"element");return a.extend({},t.DatasetListItemView.prototype.templates,{titleBar:e})}();var u=c.extend({className:c.prototype.className+" dataset-collection-element",_swapNewRender:function(e){c.prototype._swapNewRender.call(this,e);var t=this.model.get("state")||"ok";return this.$el.addClass("state-"+t),this.$el},toString:function(){var e=this.model?this.model+"":"(no model)";return"NestedDCDCEListItemView("+e+")"}});return{DCListItemView:c,DCEListItemView:d,DatasetDCEListItemView:h,NestedDCDCEListItemView:u}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(76),i(6),i(5)],s=function(e,t,i){"use strict";var n={defaults:{model_class:"DatasetCollectionElement",element_identifier:null,element_index:null,element_type:null},_mergeObject:function(e){return a.extend(e,e.object,{element_id:e.id}),delete e.object,e},constructor:function(e,t){e=this._mergeObject(e),this.idAttribute="element_id",o.Model.apply(this,arguments)},parse:function(e,t){var i=e;return i=this._mergeObject(i)}},s=o.Model.extend(t.LoggableMixin).extend(n).extend({_logNamespace:"collections"}),l=o.Collection.extend(t.LoggableMixin).extend({_logNamespace:"collections",model:s,toString:function(){return["DatasetCollectionElementCollection(",this.length,")"].join("")}}),c=e.DatasetAssociation.extend(t.mixin(n,{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({},e.DatasetAssociation.prototype.defaults,n.defaults),_downloadQueryParameters:function(){return"?to_ext="+this.get("file_ext")+"&hdca_id="+this.get("parent_hdca_id")+"&element_identifier="+this.get("element_identifier")},constructor:function(e,t){this.debug("\t DatasetDCE.constructor:",e,t),n.constructor.call(this,e,t)},hasDetails:function(){return this.elements&&this.elements.length},toString:function(){var e=this.get("element_identifier");return["DatasetDCE(",e,")"].join("")}})),d=l.extend({model:c,toString:function(){return["DatasetDCECollection(",this.length,")"].join("")}}),h=o.Model.extend(t.LoggableMixin).extend(t.SearchableModelMixin).extend({_logNamespace:"collections",defaults:{collection_type:null,deleted:!1},collectionClass:l,initialize:function(e,t){this.debug(this+"(DatasetCollection).initialize:",e,t,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 e=this.get("elements")||[];this.unset("elements",{silent:!0});var t=this;return a.each(e,function(e,i){a.extend(e,{parent_hdca_id:t.get("id")})}),this.elements=new this.collectionClass(e),this.elements},toJSON:function(){var e=o.Model.prototype.toJSON.call(this);return this.elements&&(e.elements=this.elements.toJSON()),e},inReadyState:function(){var e=this.get("populated");return this.isDeletedOrPurged()||e},hasDetails:function(){return 0!==this.elements.length},getVisibleContents:function(e){return this.elements},parse:function(e,t){var i=o.Model.prototype.parse.call(this,e,t);return i.create_time&&(i.create_time=new Date(i.create_time)),i.update_time&&(i.update_time=new Date(i.update_time)),i},delete:function(e){return this.get("deleted")?r.when():this.save({deleted:!0},e)},undelete:function(e){return!this.get("deleted")||this.get("purged")?r.when():this.save({deleted:!1},e)},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},searchAttributes:["name"],toString:function(){var e=[this.get("id"),this.get("name")||this.get("element_identifier")];return"DatasetCollection("+e.join(",")+")"}}),u=h.extend({collectionClass:d,toString:function(){return"List"+h.prototype.toString.call(this)}}),p=u.extend({toString:function(){return"Pair"+h.prototype.toString.call(this)}}),f=h.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedDCDCE(",e,")"].join("")}})),g=l.extend({model:f,toString:function(){return["NestedDCDCECollection(",this.length,")"].join("")}}),m=p.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedPairDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedPairDCDCE(",e,")"].join("")}})),v=g.extend({model:m,toString:function(){return["NestedPairDCDCECollection(",this.length,")"].join("")}}),_=h.extend({collectionClass:v,toString:function(){return["ListPairedDatasetCollection(",this.get("name"),")"].join("")}}),y=u.extend(t.mixin(n,{constructor:function(e,t){this.debug("\t NestedListDCDCE.constructor:",e,t),n.constructor.call(this,e,t)},toString:function(){var e=this.object?""+this.object:this.get("element_identifier");return["NestedListDCDCE(",e,")"].join("")}})),b=g.extend({model:y,toString:function(){return["NestedListDCDCECollection(",this.length,")"].join("")}}),w=h.extend({collectionClass:b,toString:function(){return["ListOfListsDatasetCollection(",this.get("name"),")"].join("")}});return{ListDatasetCollection:u,PairDatasetCollection:p,ListPairedDatasetCollection:_,ListOfListsDatasetCollection:w}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(3),i(1))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(44),i(11),i(6),i(73),i(8),i(91),i(5),i(88)],s=function(e,t,i,n,s,c,d){"use strict";function h(e,t){var i=e.toJSON(),n=m(i,{defaultHideSourceItems:t,creationFn:function(t,i,n){return t=t.map(function(e){return{id:e.id,name:e.name,src:"dataset"===e.history_content_type?"hda":"hdca"}}),e.createHDCA(t,"list",i,n)}});return n}var u="collections",p=a.View.extend(i.LoggableMixin).extend({_logNamespace:u,tagName:"li",className:"collection-element",initialize:function(e){this.element=e.element||{},this.selected=e.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(['<a class="name" title="',d("Click to rename"),'" href="javascript:void(0)">',"<%- element.name %>","</a>",'<button class="discard btn btn-sm" title="',d("Remove this dataset from the list"),'">',d("Discard"),"</button>"].join("")),select:function(e){this.$el.toggleClass("selected",e),this.trigger("select",{source:this,selected:this.$el.hasClass("selected")})},discard:function(){var e=this,t=this.$el.parent().width();this.$el.animate({"margin-right":t},"fast",function(){e.trigger("discard",{source:e}),e.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(e){e.stopPropagation(),this.select(e)},_clickName:function(e){e.stopPropagation(),e.preventDefault();var t=([d("Enter a new name for the element"),":\n(",d("Note that changing the name here will not rename the dataset"),")"].join(""),prompt(d("Enter a new name for the element")+":",this.element.name));t&&(this.element.name=t,this.render())},_clickDiscard:function(e){e.stopPropagation(),this.discard()},_dragstart:function(e){e.originalEvent&&(e=e.originalEvent),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify(this.element)),this.$el.addClass("dragging"),this.$el.parent().trigger("collection-element.dragstart",[this])},_dragend:function(e){this.$el.removeClass("dragging"),this.$el.parent().trigger("collection-element.dragend",[this])},_sendToParent:function(e){this.$el.parent().trigger(e)},toString:function(){return"DatasetCollectionElementView()"}}),f=a.View.extend(i.LoggableMixin).extend(n.CollectionCreatorMixin).extend({_logNamespace:u,elementViewClass:p,collectionClass:e.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 )"},footerSettings:{".hide-originals":"hideOriginals"},initialize:function(e){this.metric("ListCollectionCreator.initialize",e);var t=this;o.each(this.defaultAttributes,function(i,n){i=e[n]||i,t[n]=i}),t.initialElements=e.elements||[],this._setUpCommonSettings(e),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(e){e.hasOwnProperty("id")||(e.id=o.uniqueId())}),this.workingElements},_validateElements:function(){var e=this;return e.invalidElements=[],this.workingElements=this.workingElements.filter(function(t){var i=e._isElementInvalid(t);return i&&e.invalidElements.push({element:t,text:i}),!i}),this.workingElements},_isElementInvalid:function(e){if("dataset"!==e.history_content_type)return d("is not a dataset");var i=e.state===t.OK||o.contains(t.NOT_READY_STATES,e.state);return i?e.deleted||e.purged?d("has been deleted or purged"):null:d("has errored, is paused, or is not accessible")},_mangleDuplicateNames:function(){var e=900,t=1,i={};this.workingElements.forEach(function(n){for(var s=n.name;i.hasOwnProperty(s);)if(s=n.name+" ("+t+")",t+=1,t>=e)throw new Error("Safety hit in while loop - thats impressive");n.name=s,i[n.name]=!0})},_sortElements:function(e){},render:function(e,t){return this.workingElements.length<this.minElements?this._renderInvalid(e,t):(this.$el.empty().html(this.templates.main()),this._renderHeader(e),this._renderMiddle(e),this._renderFooter(e),this._addPluginComponents(),this.$(".collection-name").focus(),this.trigger("rendered",this),this)},_renderInvalid:function(e,t){return this.$el.empty().html(this.templates.invalidInitial({problems:this.invalidElements,elements:this.workingElements})),"function"==typeof this.oncancel&&this.$(".cancel-create.btn").show(),this.trigger("rendered",this),this},_renderHeader:function(e,t){var i=this.$(".header").empty().html(this.templates.header()).find(".help-content").prepend(r(this.templates.helpContent()));return this.invalidElements.length&&this._invalidElementsAlert(),i},_renderMiddle:function(e,t){var i=this.$(".middle").empty().html(this.templates.middle());return this._renderList(e),i},_addPluginComponents:function(){this.$(".help-content i").hoverhighlight(".collection-creator",this.highlightClr)},_invalidElementsAlert:function(){this._showAlert(this.templates.invalidElements({problems:this.invalidElements}),"alert-warning")},_disableNameAndCreate:function(e){e=!!o.isUndefined(e)||e,e&&(this.$(".collection-name").prop("disabled",!0),this.$(".create-collection").toggleClass("disabled",!0))},$list:function(){return this.$(".collection-elements")},_renderClearSelected:function(){o.size(this.selectedIds)?this.$(".collection-elements-controls > .clear-selected").show():this.$(".collection-elements-controls > .clear-selected").hide()},_renderList:function(e,t){var i=this,n=l("<div/>"),s=i.$list();o.each(this.elementViews,function(e){e.destroy(),i.removeElementView(e)}),i.workingElements.forEach(function(e){var t=i._createElementView(e);n.append(t.$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(e){var t=new this.elementViewClass({element:e,selected:o.has(this.selectedIds,e.id)});return this.elementViews.push(t),this._listenToElementView(t),t},_listenToElementView:function(e){var t=this;t.listenTo(e,{select:function(e){var i=e.source.element;e.selected?t.selectedIds[i.id]=!0:delete t.selectedIds[i.id],t.trigger("elements:select",e)},discard:function(e){t.trigger("elements:discard",e)}})},addElementView:function(e){},removeElementView:function(e){delete this.selectedIds[e.element.id],this._renderClearSelected(),this.elementViews=o.without(this.elementViews,e),this.stopListening(e)},_renderNoElementsLeft:function(){this._disableNameAndCreate(!0),this.$(".collection-elements").append(this.templates.noElementsLeft())},_elementToJSON:function(e){return e},createList:function(e){if(!this.workingElements.length){var t=d("No valid elements for final list")+". ";return t+='<a class="cancel-create" href="javascript:void(0);">'+d("Cancel")+"</a> ",t+=d("or"),t+=' <a class="reset" href="javascript:void(0);">'+d("start over")+"</a>.",void this._showAlert(t)}var i=this,n=this.workingElements.map(function(e){return i._elementToJSON(e)});return i.blocking=!0,i.creationFn(n,e,i.hideOriginals).always(function(){i.blocking=!1}).fail(function(e,t,n){i.trigger("error",{xhr:e,status:t,message:d("An error occurred while creating this collection")})}).done(function(e,t,n){i.trigger("collection:created",e,t,n),i.metric("collection:created",e),"function"==typeof i.oncreate&&i.oncreate.call(this,e,t,n)})},_setUpBehaviors:function(){return this.on("error",this._errorHandler),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("elements:select",function(e){this._renderClearSelected()}),this.on("elements:discard",function(e){var t=e.source.element;this.removeElementView(e.source),this.workingElements=o.without(this.workingElements,t),this.workingElements.length||this._renderNoElementsLeft()}),this},_errorHandler:function(e){this.error(e);var t=this;if(content=e.message||d("An error occurred"),e.xhr){var i=e.xhr,n=e.message;0===i.readyState&&0===i.status?content+=": "+d("Galaxy could not be reached and may be updating.")+d(" Try again in a few minutes."):i.responseJSON?content+=":<br /><pre>"+JSON.stringify(i.responseJSON)+"</pre>":content+=": "+n}t._showAlert(content,"alert-danger")},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .main-help":"_toggleHelp","click .header .alert button":"_hideAlert","click .reset":"reset","click .clear-selected":"clearSelectedElements","click .collection-elements":"clearSelectedElements","dragover .collection-elements":"_dragoverElements","drop .collection-elements":"_dropElements","collection-element.dragstart .collection-elements":"_elementDragstart","collection-element.dragend .collection-elements":"_elementDragend","change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","change .hide-originals":"_changeHideOriginals","click .cancel-create":"_cancelCreate","click .create-collection":"_clickCreate"},reset:function(){this._instanceSetUp(),this._elementsSetUp(),this.render()},clearSelectedElements:function(e){this.$(".collection-elements .collection-element").removeClass("selected"),this.$(".collection-elements-controls > .clear-selected").hide()},_dragoverElements:function(e){e.preventDefault();var t=this.$list();this._checkForAutoscroll(t,e.originalEvent.clientY);var i=this._getNearestElement(e.originalEvent.clientY);this.$(".element-drop-placeholder").remove();var n=r('<div class="element-drop-placeholder"></div>');i.length?i.before(n):t.append(n)},_checkForAutoscroll:function(e,t){var i=2,n=e.offset(),s=e.scrollTop(),a=t-n.top,o=n.top+e.outerHeight()-t;a>=0&&a<this.autoscrollDist?e.scrollTop(s-i):o>=0&&o<this.autoscrollDist&&e.scrollTop(s+i)},_getNearestElement:function(e){for(var t=4,i=this.$(".collection-elements li.collection-element").toArray(),n=0;n<i.length;n++){var s=r(i[n]),a=s.offset().top,o=Math.floor(s.outerHeight()/2)+t;if(a+o>e&&a-o<e)return s}return r()},_dropElements:function(e){e.originalEvent&&(e=e.originalEvent),e.preventDefault(),e.dataTransfer.dropEffect="move";var t=this._getNearestElement(e.clientY);return t.length?this.$dragging.insertBefore(t):this.$dragging.insertAfter(this.$(".collection-elements .collection-element").last()),this._syncOrderToDom(),!1},_syncOrderToDom:function(){var e=this,t=[];this.$(".collection-elements .collection-element").each(function(){var i=r(this).attr("data-element-id"),n=o.findWhere(e.workingElements,{id:i});n?t.push(n):console.error("missing element: ",i)}),this.workingElements=t,this._renderList()},_elementDragstart:function(e,t){t.select(!0),this.$dragging=this.$(".collection-elements .collection-element.selected")},_elementDragend:function(e,t){r(".element-drop-placeholder").remove(),this.$dragging=null},templates:o.extend({},n.CollectionCreatorMixin._creatorTemplates,{header:o.template(['<div class="main-help well clear">','<a class="more-help" href="javascript:void(0);">',d("More help"),"</a>",'<div class="help-content">','<a class="less-help" href="javascript:void(0);">',d("Less"),"</a>","</div>","</div>",'<div class="alert alert-dismissable">','<button type="button" class="close" data-dismiss="alert" ','title="',d("Close and show more help"),'" aria-hidden="true">×</button>','<span class="alert-message"></span>',"</div>"].join("")),middle:o.template(['<div class="collection-elements-controls">','<a class="reset" href="javascript:void(0);" ','title="',d("Undo all reordering and discards"),'">',d("Start over"),"</a>",'<a class="clear-selected" href="javascript:void(0);" ','title="',d("De-select all selected datasets"),'">',d("Clear selected"),"</a>","</div>",'<div class="collection-elements scroll-container flex-row">',"</div>"].join("")),footer:o.template(['<div class="attributes clear">','<div class="clear">','<label class="setting-prompt pull-right">',d("Hide original elements"),"?",'<input class="hide-originals pull-right" type="checkbox" />',"</label>","</div>",'<div class="clear">','<input class="collection-name form-control pull-right" ','placeholder="',d("Enter a name for your new collection"),'" />','<div class="collection-name-prompt pull-right">',d("Name"),":</div>","</div>","</div>",'<div class="actions clear vertically-spaced">','<div class="other-options pull-left">','<button class="cancel-create btn" tabindex="-1">',d("Cancel"),"</button>",'<div class="create-other btn-group dropup">','<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">',d("Create a different kind of collection"),' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">','<li><a href="#">',d("Create a <i>single</i> pair"),"</a></li>",'<li><a href="#">',d("Create a list of <i>unpaired</i> datasets"),"</a></li>","</ul>","</div>","</div>",'<div class="main-options pull-right">','<button class="create-collection btn btn-primary">',d("Create list"),"</button>","</div>","</div>"].join("")),helpContent:o.template(["<p>",d(["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("")),"</p>","<ul>","<li>",d(["Rename elements in the list by clicking on ",'<i data-target=".collection-element .name">the existing name</i>.'].join("")),"</li>","<li>",d(["Discard elements from the final created list by clicking on the ",'<i data-target=".collection-element .discard">"Discard"</i> button.'].join("")),"</li>","<li>",d(["Reorder the list by clicking and dragging elements. Select multiple elements by clicking on ",'<i data-target=".collection-element">them</i> and you can then move those selected by dragging the ',"entire group. Deselect them by clicking them again or by clicking the ",'the <i data-target=".clear-selected">"Clear selected"</i> link.'].join("")),"</li>","<li>",d(['Click the <i data-target=".reset">"Start over"</i> link to begin again as if you had just opened ',"the interface."].join("")),"</li>","<li>",d(['Click the <i data-target=".cancel-create">"Cancel"</i> button to exit the interface.'].join("")),"</li>","</ul><br />","<p>",d(['Once your collection is complete, enter a <i data-target=".collection-name">name</i> and ','click <i data-target=".create-collection">"Create list"</i>.'].join("")),"</p>"].join("")),invalidElements:o.template([d("The following selections could not be included due to problems:"),"<ul><% _.each( problems, function( problem ){ %>","<li><b><%- problem.element.name %></b>: <%- problem.text %></li>","<% }); %></ul>"].join("")),noElementsLeft:o.template(['<li class="no-elements-left-message">',d("No elements left! "),d("Would you like to "),'<a class="reset" href="javascript:void(0)">',d("start over"),"</a>?","</li>"].join("")),invalidInitial:o.template(['<div class="header flex-row no-flex">','<div class="alert alert-warning" style="display: block">','<span class="alert-message">',"<% if( _.size( problems ) ){ %>",d("The following selections could not be included due to problems"),":","<ul><% _.each( problems, function( problem ){ %>","<li><b><%- problem.element.name %></b>: <%- problem.text %></li>","<% }); %></ul>","<% } else if( _.size( elements ) < 1 ){ %>",d("No datasets were selected"),".","<% } %>","<br />",d("At least one element is needed for the collection"),". ",d("You may need to "),'<a class="cancel-create" href="javascript:void(0)">',d("cancel"),"</a> ",d("and reselect new elements"),".","</span>","</div>","</div>",'<div class="footer flex-row no-flex">','<div class="actions clear vertically-spaced">','<div class="other-options pull-left">','<button class="cancel-create btn" tabindex="-1">',d("Cancel"),"</button>","</div>","</div>","</div>"].join(""))}),toString:function(){return"ListCollectionCreator"}}),g=function(e,t,i){var n,a=l.Deferred(),r=Galaxy.modal||new s.View;return t=o.defaults(t||{},{elements:e,oncancel:function(){r.hide(),a.reject("cancelled")},oncreate:function(e,t){r.hide(),a.resolve(t)}}),n=new i(t),r.show({title:t.title||d("Create a collection"),body:n.$el,width:"80%",height:"100%",closing_events:!0}),n.render(),window._collectionCreator=n,a},m=function(e,t){return t=t||{},t.title=d("Create a collection from a list of datasets"),g(e,t,f)};return{DatasetCollectionElementView:p,ListCollectionCreator:f,collectionCreatorModal:g,listCollectionCreatorModal:m,createListCollection:h}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(47),i(11),i(17),i(6),i(5)],s=function(e,t,i,n,s){"use strict";var c="dataset",d=e.ListItemView,h=d.extend({_logNamespace:c,className:d.prototype.className+" dataset",id:function(){return["dataset",this.model.get("id")].join("-")},initialize:function(e){e.logger&&(this.logger=this.model.logger=e.logger),this.log(this+".initialize:",e),d.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank"},_setUpListeners:function(){d.prototype._setUpListeners.call(this);var e=this;return e.listenTo(e.model,{change:function(t){e.model.changedAttributes().state&&e.model.inReadyState()&&e.expanded&&!e.model.hasDetails()?e.model.fetch({silent:!0}).done(function(){e.render()}):a.has(t.changed,"tags")&&1===a.keys(t.changed).length?e.$(".nametags").html(e._renderNametags()):e.render()}})},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):o.when()},remove:function(e,t){var i=this;e=e||this.fxSpeed,this.$el.fadeOut(e,function(){r.View.prototype.remove.call(i),t&&t.call(i)})},_swapNewRender:function(e){return d.prototype._swapNewRender.call(this,e),this.model.has("state")&&this.$el.addClass("state-"+this.model.get("state")),
this.$el},_renderPrimaryActions:function(){return[this._renderDisplayButton()]},_renderDisplayButton:function(){var e=this.model.get("state");if(e===t.NOT_VIEWABLE||e===t.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(e===t.UPLOAD)n.disabled=!0,n.title=s("This dataset must finish uploading before it can be viewed");else if(e===t.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(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.addDataset(a.model.get("id")),e.preventDefault())}}return n.faIcon="fa-eye",i(n)},_renderDetails:function(){if(this.model.get("state")===t.NOT_VIEWABLE)return l(this.templates.noAccess(this.model.toJSON(),this));var e=d.prototype._renderDetails.call(this);return e.find(".actions .left").empty().append(this._renderSecondaryActions()),e.find(".summary").html(this._renderSummary()).prepend(this._renderDetailMessages()),e.find(".display-applications").html(this._renderDisplayApplications()),this._setUpBehaviors(e),e},_renderSummary:function(){var e=this.model.toJSON(),t=this.templates.summaries[e.state];return(t=t||this.templates.summaries.unknown)(e,this)},_renderDetailMessages:function(){var e=this,t=l('<div class="detail-messages"></div>'),i=e.model.toJSON();return a.each(e.templates.detailMessages,function(n){t.append(l(n(i,e)))}),t},_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 t.NOT_VIEWABLE:return[];case t.OK:case t.FAILED_METADATA:case t.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",onclick:function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add({title:"Dataset details",url:this.href}),e.preventDefault(),e.stopPropagation())}})},_renderDownloadButton:function(){return this.model.get("purged")||!this.model.hasData()?null:a.isEmpty(this.model.get("meta_files"))?l(['<a class="download-btn icon-btn" ','href="',this.model.urls.download,'" title="'+s("Download")+'" download>','<span class="fa fa-floppy-o"></span>',"</a>"].join("")):this._renderMetaFileDownloadButton()},_renderMetaFileDownloadButton:function(){var e=this.model.urls;return l(['<div class="metafile-dropdown dropdown">','<a class="download-btn icon-btn" href="javascript:void(0)" data-toggle="dropdown"',' title="'+s("Download")+'">','<span class="fa fa-floppy-o"></span>',"</a>",'<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">','<li><a href="'+e.download+'" download>',s("Download dataset"),"</a></li>",a.map(this.model.get("meta_files"),function(t){return['<li><a href="',e.meta_download+t.file_type,'">',s("Download")," ",t.file_type,"</a></li>"].join("")}).join("\n"),"</ul>","</div>"].join("\n"))},_renderNametags:function(){var e=a.template(["<% _.each(_.sortBy(_.uniq(tags), function(x) { return x }), function(tag){ %>",'<% if (tag.indexOf("name:") == 0){ %>','<span class="label label-info"><%- tag.slice(5) %></span>',"<% } %>","<% }); %>"].join(""));return e({tags:this.model.get("tags")})},events:a.extend(a.clone(d.prototype.events),{"click .display-btn":function(e){this.trigger("display",this,e)},"click .params-btn":function(e){this.trigger("params",this,e)},"click .download-btn":function(e){this.trigger("download",this,e)}}),toString:function(){var e=this.model?this.model+"":"(no model)";return"DatasetListItemView("+e+")"}});return h.prototype.templates=function(){var e=a.extend({},d.prototype.templates.warnings,{failed_metadata:n.wrapTemplate(['<% if( model.state === "failed_metadata" ){ %>','<div class="warningmessagesmall">',s("An error occurred setting the metadata for this dataset"),"</div>","<% } %>"]),error:n.wrapTemplate(["<% if( model.error ){ %>",'<div class="errormessagesmall">',s("There was an error getting the data for this dataset"),": <%- model.error %>","</div>","<% } %>"]),purged:n.wrapTemplate(["<% if( model.purged ){ %>",'<div class="purged-msg warningmessagesmall">',s("This dataset has been deleted and removed from disk"),"</div>","<% } %>"]),deleted:n.wrapTemplate(["<% if( model.deleted && !model.purged ){ %>",'<div class="deleted-msg warningmessagesmall">',s("This dataset has been deleted"),"</div>","<% } %>"])}),i=n.wrapTemplate(['<div class="details">','<div class="summary"></div>','<div class="actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !dataset.deleted && !dataset.purged ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="display-applications"></div>',"<% if( dataset.peek ){ %>",'<pre class="dataset-peek"><%= dataset.peek %></pre>',"<% } %>","<% } %>","</div>"],"dataset"),o=n.wrapTemplate(['<div class="details">','<div class="summary">',s("You do not have permission to view this dataset"),"</div>","</div>"],"dataset"),r={};r[t.OK]=r[t.FAILED_METADATA]=n.wrapTemplate(["<% if( dataset.misc_blurb ){ %>",'<div class="blurb">','<span class="value"><%- dataset.misc_blurb %></span>',"</div>","<% } %>","<% if( dataset.file_ext ){ %>",'<div class="datatype">','<label class="prompt">',s("format"),"</label>",'<span class="value"><%- dataset.file_ext %></span>',"</div>","<% } %>","<% if( dataset.metadata_dbkey ){ %>",'<div class="dbkey">','<label class="prompt">',s("database"),"</label>",'<span class="value">',"<%- dataset.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( dataset.misc_info ){ %>",'<div class="info">','<span class="value"><%- dataset.misc_info %></span>',"</div>","<% } %>"],"dataset"),r[t.NEW]=n.wrapTemplate(["<div>",s("This is a new dataset and not all of its data are available yet"),"</div>"],"dataset"),r[t.NOT_VIEWABLE]=n.wrapTemplate(["<div>",s("You do not have permission to view this dataset"),"</div>"],"dataset"),r[t.DISCARDED]=n.wrapTemplate(["<div>",s("The job creating this dataset was cancelled before completion"),"</div>"],"dataset"),r[t.QUEUED]=n.wrapTemplate(["<div>",s("This job is waiting to run"),"</div>"],"dataset"),r[t.RUNNING]=n.wrapTemplate(["<div>",s("This job is currently running"),"</div>"],"dataset"),r[t.UPLOAD]=n.wrapTemplate(["<div>",s("This dataset is currently uploading"),"</div>"],"dataset"),r[t.SETTING_METADATA]=n.wrapTemplate(["<div>",s("Metadata is being auto-detected"),"</div>"],"dataset"),r[t.PAUSED]=n.wrapTemplate(["<div>",s('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume'),"</div>"],"dataset"),r[t.ERROR]=n.wrapTemplate(["<% if( !dataset.purged ){ %>","<div><%- dataset.misc_blurb %></div>","<% } %>",'<span class="help-text">',s("An error occurred with this dataset"),":</span>",'<div class="job-error-text"><%- dataset.misc_info %></div>'],"dataset"),r[t.EMPTY]=n.wrapTemplate(["<div>",s("No data"),": <i><%- dataset.misc_blurb %></i></div>"],"dataset"),r.unknown=n.wrapTemplate(['<div>Error: unknown dataset state: "<%- dataset.state %>"</div>'],"dataset");var l={resubmitted:n.wrapTemplate(["<% if( model.resubmitted ){ %>",'<div class="resubmitted-msg infomessagesmall">',s("The job creating this dataset has been resubmitted"),"</div>","<% } %>"])},c=n.wrapTemplate(["<% _.each( apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%- link.target %>" href="<%- link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>"],"apps");return a.extend({},d.prototype.templates,{warnings:e,details:i,noAccess:o,summaries:r,detailMessages:l,displayApplications:c})}(),{DatasetListItemView:h}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(3),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4)],s=function(e){var t=a.Model.extend({initialize:function(e){this.app=e},checksum:function(){var e="",t=this;return this.app.section.$el.find(".section-row").each(function(){var i=o(this).attr("id"),n=t.app.field_list[i];n&&(e+=i+":"+JSON.stringify(n.value&&n.value())+":"+n.collapsed+";")}),e},create:function(){function e(e,t,i){n.flat_dict[e]=t,a[e]=i,n.app.element_list[t]&&n.app.element_list[t].$el.attr("tour_id",e)}function t(s,a){for(var o in a){var r=a[o];if(r.input){var l=r.input,c=s;switch(""!=s&&(c+="|"),c+=l.name,l.type){case"repeat":var d="section-",h=[],u=null;for(var p in r){var f=p.indexOf(d);f!=-1&&(f+=d.length,h.push(parseInt(p.substr(f))),u||(u=p.substr(0,f)))}h.sort(function(e,t){return e-t});var o=0;for(var g in h)t(c+"_"+o++,r[u+h[g]]);break;case"conditional":var m=n.app.field_list[l.id].value();e(c+"|"+l.test_param.name,l.id,m);var v=i(l,m);v!=-1&&t(c,a[l.id+"-section-"+v]);break;case"section":t(!l.flat&&c||"",r);break;default:var _=n.app.field_list[l.id];if(_&&_.value){var m=_.value();if((void 0===l.ignore||l.ignore!=m)&&(_.collapsed&&l.collapsible_value&&(m=l.collapsible_value),e(c,l.id,m),l.payload))for(var y in l.payload)e(y,l.id,l.payload[y])}}}}}var n=this,s={};this._iterate(this.app.section.$el,s);var a={};return this.flat_dict={},t("",s),a},match:function(e){return this.flat_dict&&this.flat_dict[e]},matchCase:function(e,t){return i(e,t)},matchModel:function(e,t){var i=this;n(e.inputs,function(e,n){i.flat_dict[n]&&t(e,i.flat_dict[n])})},matchResponse:function(e){function t(e,s){if("string"==typeof s){var a=n.flat_dict[e];a&&(i[a]=s)}else for(var o in s){var r=o;if(""!==e){var l="|";s instanceof Array&&(l="_"),r=e+l+r}t(r,s[o])}}var i={},n=this;return t("",e),i},_iterate:function(e,t){var i=this,n=o(e).children();n.each(function(){var e=this,n=o(e).attr("id");if(o(e).hasClass("section-row")){var s=i.app.input_list[n];t[n]=s&&{input:s}||{},i._iterate(e,t[n])}else i._iterate(e,t)})}}),i=function(e,t){"boolean"==e.test_param.type&&(t="true"==t?e.test_param.truevalue||"true":e.test_param.falsevalue||"false");for(var i in e.cases)if(e.cases[i].value==t)return i;return-1},n=function(e,t,s,a){a=o.extend(!0,{},a),r.each(e,function(e){e&&e.type&&e.name&&(a[e.name]=e)});for(var l in e){var c=e[l];c.name=c.name||l;var d=s?s+"|"+c.name:c.name;switch(c.type){case"repeat":r.each(c.cache,function(e,i){n(e,t,d+"_"+i,a)});break;case"conditional":if(c.test_param){t(c.test_param,d+"|"+c.test_param.name,a);var h=i(c,c.test_param.value);h!=-1?n(c.cases[h].inputs,t,d,a):Galaxy.emit.debug("form-data::visitInputs() - Invalid case for "+d+".")}else Galaxy.emit.debug("form-data::visitInputs() - Conditional test parameter missing for "+d+".");break;case"section":n(c.inputs,t,d,a);break;default:t(c,d,a)}}};return{Manager:t,visitInputs:n}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(i,a,o){n=[],s=function(){return i.View.extend({initialize:function(e,t){this.app=e,this.app_options=e.model?e.model.attributes:{},this.field=t&&t.field||new i.View,this.model=t&&t.model||new i.Model({text_enable:this.app_options.text_enable||"Enable",text_disable:this.app_options.text_disable||"Disable",cls_enable:this.app_options.cls_enable||"fa fa-caret-square-o-down",cls_disable:this.app_options.cls_disable||"fa fa-caret-square-o-up",always_refresh:this.app_options.always_refresh}).set(t),this.setElement(this._template()),this.$field=this.$(".ui-form-field"),this.$info=this.$(".ui-form-info"),this.$preview=this.$(".ui-form-preview"),this.$collapsible=this.$(".ui-form-collapsible"),this.$collapsible_text=this.$(".ui-form-collapsible-text"),this.$collapsible_icon=this.$(".ui-form-collapsible-icon"),this.$title=this.$(".ui-form-title"),this.$title_text=this.$(".ui-form-title-text"),this.$error_text=this.$(".ui-form-error-text"),this.$error=this.$(".ui-form-error"),this.$backdrop=this.$(".ui-form-backdrop"),this.$field.prepend(this.field.$el);var n=this.model.get("collapsible_value");this.field.collapsed=void 0!==n&&JSON.stringify(this.model.get("value"))==JSON.stringify(n),this.listenTo(this.model,"change",this.render,this),this.render();var s=this;this.$collapsible.on("click",function(){s.field.collapsed=!s.field.collapsed,e.trigger&&e.trigger("change"),s.render()}),this.field.model&&!this.model.get("always_refresh")&&this.listenTo(this.field.model,"change:value",function(){s.reset()})},backdrop:function(){this.model.set("backdrop",!0)},error:function(e){this.model.set("error_text",e)},reset:function(){!this.model.get("fixed")&&this.model.set("error_text",null)},render:function(){a(".tooltip").hide();var e=this.model.get("help",""),t=this.model.get("argument");t&&e.indexOf("("+t+")")==-1&&(e+=" ("+t+")"),this.$info.html(e),this.$el[this.model.get("hidden")?"hide":"show"](),this.$preview[this.field.collapsed&&this.model.get("collapsible_preview")||this.model.get("disabled")?"show":"hide"]().html(o.escape(this.model.get("text_value")));var i=this.model.get("error_text");if(this.$error[i?"show":"hide"](),this.$el[i?"addClass":"removeClass"]("ui-error"),this.$error_text.html(i),this.$backdrop[this.model.get("backdrop")?"show":"hide"](),this.field.collapsed||this.model.get("disabled")?this.$field.hide():this.$field.show(),this.field.model&&this.field.model.set({color:this.model.get("color"),style:this.model.get("style")}),this.model.get("disabled")||void 0===this.model.get("collapsible_value"))this.$title_text.show().text(this.model.get("label")),this.$collapsible.hide();else{var n=this.field.collapsed?"enable":"disable";this.$title_text.hide(),this.$collapsible.show(),this.$collapsible_text.text(this.model.get("label")),this.$collapsible_icon.removeClass().addClass("icon").addClass(this.model.get("cls_"+n)).attr("data-original-title",this.model.get("text_"+n)).tooltip({placement:"bottom"})}},_template:function(){return a("<div/>").addClass("ui-form-element").append(a("<div/>").addClass("ui-form-error ui-error").append(a("<span/>").addClass("fa fa-arrow-down")).append(a("<span/>").addClass("ui-form-error-text"))).append(a("<div/>").addClass("ui-form-title").append(a("<div/>").addClass("ui-form-collapsible").append(a("<i/>").addClass("ui-form-collapsible-icon")).append(a("<span/>").addClass("ui-form-collapsible-text"))).append(a("<span/>").addClass("ui-form-title-text"))).append(a("<div/>").addClass("ui-form-field").append(a("<span/>").addClass("ui-form-info")).append(a("<div/>").addClass("ui-form-backdrop"))).append(a("<div/>").addClass("ui-form-preview"))}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(7),i(54),i(56),i(55),i(52)],s=function(e,t,i,n,s,l){return a.Model.extend({types:{text:"_fieldText",password:"_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",upload:"_fieldUpload"},create:function(e){var t=this.types[e.type],i="function"==typeof this[t]?this[t].call(this,e):null;return i||(i=e.options?this._fieldSelect(e):this._fieldText(e),Galaxy.emit.debug("form-parameters::_addRow()","Auto matched field type ("+e.type+").")),void 0===e.value&&(e.value=null),i.value(e.value),i},_fieldData:function(e){return new i.View({id:"field-"+e.id,extensions:e.extensions,optional:e.optional,multiple:e.multiple,type:e.type,flavor:e.flavor,data:e.options,onchange:e.onchange})},_fieldSelect:function(e){if(e.is_workflow)return this._fieldText(e);"data_column"==e.type&&(e.error_text="Missing columns in referenced dataset.");var i=e.data;i||(i=[],o.each(e.options,function(e){i.push({label:e[0],value:e[1]})}));var n=t.Select;switch(e.display){case"checkboxes":n=t.Checkbox;break;case"radio":n=t.Radio;break;case"radiobutton":n=t.RadioButton}return new n.View({id:"field-"+e.id,data:i,error_text:e.error_text||"No options available",multiple:e.multiple,optional:e.optional,onchange:e.onchange,searchable:"workflow"!==e.flavor})},_fieldDrilldown:function(e){return e.is_workflow?this._fieldText(e):new t.Drilldown.View({id:"field-"+e.id,data:e.options,display:e.display,optional:e.optional,onchange:e.onchange})},_fieldText:function(i){if(i.options&&i.data)if(i.area=i.multiple,e.isEmpty(i.value))i.value=null;else if(r.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}return new t.Input({id:"field-"+i.id,type:i.type,area:i.area,readonly:i.readonly,placeholder:i.placeholder,datalist:i.datalist,onchange:i.onchange})},_fieldSlider:function(e){return new t.Slider.View({id:"field-"+e.id,precise:"float"==e.type,is_workflow:e.is_workflow,min:e.min,max:e.max,onchange:e.onchange})},_fieldHidden:function(e){return new t.Hidden({id:"field-"+e.id,info:e.info})},_fieldBoolean:function(e){return new t.RadioButton.View({id:"field-"+e.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}],onchange:e.onchange})},_fieldColor:function(e){return new l({id:"field-"+e.id,onchange:e.onchange})},_fieldLibrary:function(e){return new n.View({id:"field-"+e.id,optional:e.optional,multiple:e.multiple,onchange:e.onchange})},_fieldFtp:function(e){return new s.View({id:"field-"+e.id,optional:e.optional,multiple:e.multiple,onchange:e.onchange})},_fieldUpload:function(e){return new t.Upload({id:"field-"+e.id,onchange:e.onchange})}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(9),i(7)],s=function(e,t,i){var n=a.View.extend({initialize:function(t){this.list={},this.options=e.merge(t,{title:"Repeat",empty_text:"Not available.",max:null,min:null}),this.button_new=new i.ButtonIcon({icon:"fa-plus",title:"Insert "+this.options.title,tooltip:"Add new "+this.options.title+" block",floating:"clear",cls:"ui-button-icon form-repeat-add",onclick:function(){t.onnew&&t.onnew()}}),this.setElement(o("<div/>").append(this.$list=o("<div/>")).append(o("<div/>").append(this.button_new.$el)))},size:function(){return r.size(this.list)},add:function(e){if(!e.id||this.list[e.id])return void Galaxy.emit.debug("form-repeat::add()","Duplicate or invalid repeat block id.");var n=new i.ButtonIcon({icon:"fa-trash-o",tooltip:"Delete this repeat block",cls:"ui-button-icon-plain form-repeat-delete",onclick:function(){e.ondel&&e.ondel()}}),s=new t.View({id:e.id,title:"placeholder",cls:e.cls||"ui-portlet-repeat",operations:{button_delete:n}});s.append(e.$el),s.$el.addClass("section-row").hide(),this.list[e.id]=s,this.$list.append(s.$el.fadeIn("fast")),this.options.max>0&&this.size()>=this.options.max&&this.button_new.disable(),this._refresh()},del:function(e){return this.list[e]?(this.$list.find("#"+e).remove(),delete this.list[e],this.button_new.enable(),void this._refresh()):void Galaxy.emit.debug("form-repeat::del()","Invalid repeat block id.")},delAll:function(){for(var e in this.list)this.del(e)},hideOptions:function(){this.button_new.$el.hide(),r.each(this.list,function(e){e.hideOperation("button_delete")}),r.isEmpty(this.list)&&this.$el.append(o("<div/>").addClass("ui-form-info").html(this.options.empty_text))},_refresh:function(){var e=0;for(var t in this.list){var i=this.list[t];i.title(++e+": "+this.options.title),i[this.size()>this.options.min?"showOperation":"hideOperation"]("button_delete")}}});return{View:n}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(4),i(7),i(9),i(42),i(40),i(41)],s=function(e,t,i,n,s,c){var d=a.View.extend({initialize:function(e,t){this.app=e,this.inputs=t.inputs,this.parameters=new c,this.setElement(o("<div/>")),this.render()},render:function(){var e=this;this.$el.empty(),r.each(this.inputs,function(t){e.add(t)})},add:function(t){var i=l.extend(!0,{},t);switch(i.id=t.id=e.uid(),this.app.input_list[i.id]=i,i.type){case"conditional":this._addConditional(i);break;case"repeat":this._addRepeat(i);break;case"section":this._addSection(i);break;default:this._addRow(i)}},_addConditional:function(e){var t=this;e.test_param.id=e.id,this.app.model.get("sustain_conditionals")&&(e.test_param.disabled=!0);var i=this._addRow(e.test_param);i.model&&i.model.set("onchange",function(i){var n=t.app.data.matchCase(e,i);for(var s in e.cases){var a=e.cases[s],o=t.$("#"+e.id+"-section-"+s),r=!1;for(var l in a.inputs)if(!a.inputs[l].hidden){r=!0;break}s==n&&r?o.fadeIn("fast"):o.hide()}t.app.trigger("change")});for(var n in e.cases){var s=new d(this.app,{inputs:e.cases[n].inputs});this._append(s.$el.addClass("ui-form-section"),e.id+"-section-"+n)}i.trigger("change")},_addRepeat:function(e){function t(t){var n=e.id+"-section-"+a++,s=new d(i.app,{inputs:t});o.add({id:n,$el:s.$el,ondel:function(){o.del(n),i.app.trigger("change")}})}for(var i=this,a=0,o=new n.View({title:e.title||"Repeat",min:e.min,max:e.max,onnew:function(){t(e.inputs),i.app.trigger("change")}}),l=r.size(e.cache),c=0;c<Math.max(Math.max(l,e.min||0),e.default||0);c++)t(c<l?e.cache[c]:e.inputs);this.app.model.get("sustain_repeats")&&o.hideOptions();var h=new s(this.app,{label:e.title||e.name,help:e.help,field:o});this._append(h.$el,e.id)},_addSection:function(e){var t=new i.View({title:e.title||e.name,cls:"ui-portlet-section",collapsible:!0,collapsible_button:!0,collapsed:!e.expanded});t.append(new d(this.app,{inputs:e.inputs}).$el),t.append(o("<div/>").addClass("ui-form-info").html(e.help)),this.app.on("expand",function(e){t.$("#"+e).length>0&&t.expand()}),this._append(t.$el,e.id)},_addRow:function(e){var t=this,i=e.id;e.onchange=e.onchange||function(){t.app.trigger("change",i)};var n=this.parameters.create(e);this.app.field_list[i]=n;var a=new s(this.app,{name:e.name,label:e.hide_label?"":e.label||e.name,value:e.value,text_value:e.text_value,collapsible_value:e.collapsible_value,collapsible_preview:e.collapsible_preview,help:e.help,argument:e.argument,disabled:e.disabled,color:e.color,style:e.style,backdrop:e.backdrop,hidden:e.hidden,fixed:e.fixed,field:n});return this.app.element_list[i]=a,this._append(a.$el,e.id),n},_append:function(e,t){this.$el.append(e.addClass("section-row").attr("id",t))}});return{View:d}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2),i(1))},function(e,t,i){var n,s;(function(a){n=[i(36),i(81),i(5)],s=function(e,t,i){"use strict";function n(e){return function(t,i){return this.isNew()&&(i=i||{},i.url=this.urlRoot+this.get("history_id")+"/contents",t=t||{},t.type="dataset_collection"),e.call(this,t,i)}}var s=t.HistoryContentMixin,o=e.ListDatasetCollection,r=e.PairDatasetCollection,l=e.ListPairedDatasetCollection,c=e.ListOfListsDatasetCollection,d=o.extend(s).extend({defaults:a.extend(a.clone(o.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"list",model_class:"HistoryDatasetCollectionAssociation"}),save:n(o.prototype.save),toString:function(){return"History"+o.prototype.toString.call(this)}}),h=r.extend(s).extend({defaults:a.extend(a.clone(r.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"paired",model_class:"HistoryDatasetCollectionAssociation"}),save:n(r.prototype.save),toString:function(){return"History"+r.prototype.toString.call(this)}}),u=l.extend(s).extend({defaults:a.extend(a.clone(l.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"list:paired",model_class:"HistoryDatasetCollectionAssociation"}),save:n(l.prototype.save),toString:function(){return"History"+l.prototype.toString.call(this)}}),p=c.extend(s).extend({defaults:a.extend(a.clone(c.prototype.defaults),{history_content_type:"dataset_collection",collection_type:"list:list",model_class:"HistoryDatasetCollectionAssociation"}),save:n(c.prototype.save),toString:function(){return["HistoryListOfListsDatasetCollection(",this.get("name"),")"].join("")}});return{HistoryListDatasetCollection:d,HistoryPairDatasetCollection:h,HistoryListPairedDatasetCollection:u,HistoryListOfListsDatasetCollection:p}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(72),i(79),i(44),i(46),i(6),i(144)],s=function(e,t,i,n,s,l){"use strict";var c=e.PaginatedCollection,d=c.extend(s.LoggableMixin).extend({_logNamespace:"history",model:function(e,n){if("dataset"===e.history_content_type)return new t.HistoryDatasetAssociation(e,n);if("dataset_collection"===e.history_content_type){switch(e.collection_type){case"list":return new i.HistoryListDatasetCollection(e,n);case"paired":return new i.HistoryPairDatasetCollection(e,n);case"list:paired":return new i.HistoryListPairedDatasetCollection(e,n);case"list:list":return new i.HistoryListOfListsDatasetCollection(e,n)}var s="Unknown collection_type: "+e.collection_type;return console.warn(s,e),{validationError:s}}return{validationError:"Unknown history_content_type: "+e.history_content_type}},limitPerPage:500,limitPerProgressiveFetch:500,order:"hid",urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(e,t){t=t||{},c.prototype.initialize.call(this,e,t),this.history=t.history||null,this.setHistoryId(t.historyId||null),this.includeDeleted=t.includeDeleted||this.includeDeleted,this.includeHidden=t.includeHidden||this.includeHidden,this.model.prototype.idAttribute="type_id"},setHistoryId:function(e){this.historyId=e,this._setUpWebStorage()},_setUpWebStorage:function(e){if(this.historyId)return this.storage=new n.HistoryPrefs({id:n.HistoryPrefs.historyStorageKey(this.historyId)}),this.trigger("new-storage",this.storage,this),this.on({"include-deleted":function(e){this.storage.includeDeleted(e)},"include-hidden":function(e){this.storage.includeHidden(e)}}),this.includeDeleted=this.storage.includeDeleted()||!1,this.includeHidden=this.storage.includeHidden()||!1,this},comparators:a.extend(a.clone(c.prototype.comparators),{name:s.buildComparator("name",{ascending:!0}),"name-dsc":s.buildComparator("name",{ascending:!1}),hid:s.buildComparator("hid",{ascending:!1}),"hid-asc":s.buildComparator("hid",{ascending:!0})}),running:function(){return this.filter(function(e){return!e.inReadyState()})},runningAndActive:function(){return this.filter(function(e){return!e.inReadyState()&&e.get("visible")&&!e.get("deleted")})},getByHid:function(e){return this.findWhere({hid:e})},haveDetails:function(){return this.all(function(e){return e.hasDetails()})},hidden:function(){return this.filter(function(e){return e.hidden()})},deleted:function(){return this.filter(function(e){return e.get("deleted")})},visibleAndUndeleted:function(){return this.filter(function(e){return e.get("visible")&&!e.get("deleted")})},setIncludeDeleted:function(e,t){if(a.isBoolean(e)&&e!==this.includeDeleted){if(this.includeDeleted=e,a.result(t,"silent"))return;this.trigger("include-deleted",e,this)}},setIncludeHidden:function(e,t){if(a.isBoolean(e)&&e!==this.includeHidden){if(this.includeHidden=e,t=t||{},a.result(t,"silent"))return;this.trigger("include-hidden",e,this)}},fetch:function(e){if(e=e||{},this.historyId&&!e.details){var t=n.HistoryPrefs.get(this.historyId).toJSON();a.isEmpty(t.expandedIds)||(e.details=a.values(t.expandedIds).join(","))}return c.prototype.fetch.call(this,e)},_buildFetchData:function(e){return a.extend(c.prototype._buildFetchData.call(this,e),{v:"dev"})},_fetchParams:c.prototype._fetchParams.concat(["v","details"]),_buildFetchFilters:function(e){var t=c.prototype._buildFetchFilters.call(this,e)||{},i={};return this.includeDeleted||(i.deleted=!1,i.purged=!1),this.includeHidden||(i.visible=!0),a.defaults(t,i)},getTotalItemCount:function(){return this.history.contentsShown()},fetchUpdated:function(e,t){return e&&(t=t||{filters:{}},t.remove=!1,t.filters={"update_time-ge":e.toISOString(),visible:""}),this.fetch(t)},fetchDeleted:function(e){e=e||{};var t=this;return e.filters=a.extend(e.filters,{deleted:!0,purged:void 0}),e.remove=!1,t.trigger("fetching-deleted",t),t.fetch(e).always(function(){t.trigger("fetching-deleted-done",t)})},fetchHidden:function(e){e=e||{};var t=this;return e.filters=a.extend(e.filters,{visible:!1}),e.remove=!1,t.trigger("fetching-hidden",t),t.fetch(e).always(function(){t.trigger("fetching-hidden-done",t)})},fetchAllDetails:function(e){e=e||{};var t={details:"all"};return e.data=a.extend(e.data||{},t),this.fetch(e)},fetchCollectionCounts:function(e){return e=e||{},e.keys=["type_id","element_count"].join(","),e.filters=a.extend(e.filters||{},{history_content_type:"dataset_collection"}),e.remove=!1,this.fetch(e)},_filterAndUpdate:function(e,t){var i=this,n=i.model.prototype.idAttribute,s=[t];return i.fetch({filters:e,remove:!1}).then(function(e){return e=e.reduce(function(e,t,s){var a=i.get(t[n]);return a?e.concat(a):e},[]),i.ajaxQueue("save",s,e)})},ajaxQueue:function(e,t,i){return i=i||this.models,new l.AjaxQueue(i.slice().reverse().map(function(i,n){var s=a.isString(e)?i[e]:e;return function(){return s.apply(i,t)}})).deferred},progressivelyFetchDetails:function(e){function i(t){t=t||0;var o=a.extend(a.clone(e),{view:"summary",keys:c,limit:r,offset:t,reset:0===t,remove:!1});a.defer(function(){s.fetch.call(s,o).fail(n.reject).done(function(e){n.notify(e,r,t),e.length!==r?(s.allFetched=!0,n.resolve(e,r,t)):i(t+r)})})}e=e||{};var n=o.Deferred(),s=this,r=e.limitPerCall||s.limitPerProgressiveFetch,l=t.HistoryDatasetAssociation.prototype.searchAttributes,c=l.join(",");return i(),n},isCopyable:function(e){var t=["HistoryDatasetAssociation","HistoryDatasetCollectionAssociation"];return a.isObject(e)&&e.id&&a.contains(t,e.model_class)},copy:function(e){var t,i,n;a.isString(e)?(t=e,n="hda",i="dataset"):(t=e.id,n={HistoryDatasetAssociation:"hda",LibraryDatasetDatasetAssociation:"ldda",HistoryDatasetCollectionAssociation:"hdca"}[e.model_class]||"hda",i="hdca"===n?"dataset_collection":"dataset");var s=this,r=o.ajax(this.url(),{method:"POST",contentType:"application/json",data:JSON.stringify({content:t,source:n,type:i})}).done(function(e){s.add([e],{parse:!0})}).fail(function(e,a,o){s.trigger("error",s,r,{},"Error copying contents",{type:i,id:t,source:n})});return r},createHDCA:function(e,t,i,n,s){var a=this.model({history_content_type:"dataset_collection",collection_type:t,history_id:this.historyId,name:i,hide_source_items:n||!1,element_identifiers:e});return a.save(s)},haveSearchDetails:function(){return this.allFetched&&this.all(function(e){return a.has(e.attributes,"annotation")})},matches:function(e){return this.filter(function(t){return t.matches(e)})},clone:function(){var e=r.Collection.prototype.clone.call(this);return e.historyId=this.historyId,e},toString:function(){return["HistoryContents(",[this.historyId,this.length].join(),")"].join("")}});return{HistoryContents:d}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(3))},function(e,t,i){var n,s;(function(a){n=[i(6)],s=function(e){"use strict";var t=e.SessionStorageModel.extend({defaults:{expandedIds:{},show_deleted:!1,show_hidden:!1},addExpanded:function(e){var t=this.get("expandedIds");t[e.id]=e.get("id"),this.save("expandedIds",t)},removeExpanded:function(e){var t=this.get("expandedIds");delete t[e.id],this.save("expandedIds",t)},isExpanded:function(e){return a.result(this.get("expandedIds"),e,!1)},allExpanded:function(){return a.values(this.get("expandedIds"))},clearExpanded:function(){this.set("expandedIds",{})},includeDeleted:function(e){return a.isUndefined(e)||this.set("show_deleted",e),this.get("show_deleted")},includeHidden:function(e){return a.isUndefined(e)||this.set("show_hidden",e),this.get("show_hidden")},toString:function(){
return"HistoryPrefs("+this.id+")"}},{storageKeyPrefix:"history:",historyStorageKey:function(e){if(!e)throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+e);return t.storageKeyPrefix+e},get:function(e){return new t({id:t.historyStorageKey(e)})},clearAll:function(e){for(var i in sessionStorage)0===i.indexOf(t.storageKeyPrefix)&&sessionStorage.removeItem(i)}});return{HistoryPrefs:t}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(6),i(5)],s=function(e,t){"use strict";var i="list",n=a.View.extend(e.LoggableMixin).extend({_logNamespace:i,initialize:function(e){this.expanded=e.expanded||!1,this.log("\t expanded:",this.expanded),this.fxSpeed=void 0!==e.fxSpeed?e.fxSpeed:this.fxSpeed},fxSpeed:"fast",render:function(e){var t=this._buildNewRender();return this._setUpBehaviors(t),this._queueNewRender(t,e),this},_buildNewRender:function(){var e=o(this.templates.el(this.model.toJSON(),this));return this.expanded&&this.$details(e).replaceWith(this._renderDetails().show()),e},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;0===t?(i._swapNewRender(e),i.trigger("rendered",i)):o(i).queue("fx",[function(e){i.$el.fadeOut(t,e)},function(t){i._swapNewRender(e),t()},function(e){i.$el.fadeIn(t,e)},function(e){i.trigger("rendered",i),e()}])},_swapNewRender:function(e){return this.$el.empty().attr("class",r.isFunction(this.className)?this.className():this.className).append(e.children())},_setUpBehaviors:function(e){e=e||this.$el,e.find("[title]").tooltip({placement:"bottom"})},$details:function(e){return e=e||this.$el,e.find("> .details")},_renderDetails:function(){var e=o(this.templates.details(this.model.toJSON(),this));return this._setUpBehaviors(e),e},toggleExpanded:function(e){return e=void 0===e?!this.expanded:e,e?this.expand():this.collapse(),this},expand:function(){var e=this;return e._fetchModelDetails().always(function(){e._expand()})},_fetchModelDetails:function(){return this.model.hasDetails()?l.when():this.model.fetch()},_expand:function(){var e=this,t=e._renderDetails();e.$details().replaceWith(t),e.expanded=!0,e.$details().slideDown(e.fxSpeed,function(){e.trigger("expanded",e)})},collapse:function(){this.debug(this+"(ExpandableView).collapse");var e=this;e.expanded=!1,this.$details().slideUp(e.fxSpeed,function(){e.trigger("collapsed",e)})}}),s=n.extend(e.mixin(e.SelectableViewMixin,e.DraggableViewMixin,{tagName:"div",className:"list-item",initialize:function(t){n.prototype.initialize.call(this,t),e.SelectableViewMixin.initialize.call(this,t),e.DraggableViewMixin.initialize.call(this,t),this._setUpListeners()},_setUpListeners:function(){return this.on("selectable",function(e){e?this.$(".primary-actions").hide():this.$(".primary-actions").show()},this),this},_buildNewRender:function(){var e=n.prototype._buildNewRender.call(this);return e.children(".warnings").replaceWith(this._renderWarnings()),e.children(".title-bar").replaceWith(this._renderTitleBar()),e.children(".primary-actions").append(this._renderPrimaryActions()),e.find("> .title-bar .subtitle").replaceWith(this._renderSubtitle()),e},_swapNewRender:function(e){return n.prototype._swapNewRender.call(this,e),this.selectable&&this.showSelector(0),this.draggable&&this.draggableOn(),this.$el},_renderWarnings:function(){var e=this,t=o('<div class="warnings"></div>'),i=e.model.toJSON();return r.each(e.templates.warnings,function(n){t.append(o(n(i,e)))}),t},_renderTitleBar:function(){return o(this.templates.titleBar(this.model.toJSON(),this))},_renderPrimaryActions:function(){return[]},_renderSubtitle:function(){return o(this.templates.subtitle(this.model.toJSON(),this))},events:{"click .title-bar":"_clickTitleBar","keydown .title-bar":"_keyDownTitleBar","click .selector":"toggleSelect"},_clickTitleBar:function(e){e.stopPropagation(),e.altKey?(this.toggleSelect(e),this.selectable||this.showSelector()):this.toggleExpanded()},_keyDownTitleBar:function(e){var t=32,i=13;return!e||"keydown"!==e.type||e.keyCode!==t&&e.keyCode!==i||(this.toggleExpanded(),e.stopPropagation(),!1)},toString:function(){var e=this.model?this.model+"":"(no model)";return"ListItemView("+e+")"}}));s.prototype.templates=function(){var t=e.wrapTemplate(['<div class="list-element">','<div class="warnings"></div>','<div class="selector">','<span class="fa fa-2x fa-square-o"></span>',"</div>",'<div class="primary-actions"></div>','<div class="title-bar"></div>','<div class="details"></div>',"</div>"]),i={},n=e.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="name"><%- element.name %></span>',"</div>",'<div class="subtitle"></div>',"</div>"],"element"),s=e.wrapTemplate(['<div class="subtitle"></div>']),a=e.wrapTemplate(['<div class="details"></div>']);return{el:t,warnings:i,titleBar:n,subtitle:s,details:a}}();var c=s.extend({foldoutStyle:"foldout",foldoutPanelClass:null,initialize:function(e){"drilldown"===this.foldoutStyle&&(this.expanded=!1),this.foldoutStyle=e.foldoutStyle||this.foldoutStyle,this.foldoutPanelClass=e.foldoutPanelClass||this.foldoutPanelClass,s.prototype.initialize.call(this,e),this.foldout=this._createFoldoutPanel()},_renderDetails:function(){if("drilldown"===this.foldoutStyle)return o();var e=s.prototype._renderDetails.call(this);return this._attachFoldout(this.foldout,e)},_createFoldoutPanel:function(){var e=this.model,t=this._getFoldoutPanelClass(e),i=this._getFoldoutPanelOptions(e),n=new t(r.extend(i,{model:e}));return n},_getFoldoutPanelClass:function(){return this.foldoutPanelClass},_getFoldoutPanelOptions:function(){return{foldoutStyle:this.foldoutStyle,fxSpeed:this.fxSpeed}},_attachFoldout:function(e,t){return t=t||this.$("> .details"),this.foldout=e.render(0),e.$("> .controls").hide(),t.append(e.$el)},expand:function(){var e=this;return e._fetchModelDetails().always(function(){"foldout"===e.foldoutStyle?e._expand():"drilldown"===e.foldoutStyle&&e._expandByDrilldown()})},_expandByDrilldown:function(){var e=this;e.listenTo(e.foldout,"close",function(){e.trigger("collapsed:drilldown",e,e.foldout)}),e.trigger("expanded:drilldown",e,e.foldout)}});return c.prototype.templates=function(){var t=e.wrapTemplate(['<div class="details">',"</div>"],"collection");return r.extend({},s.prototype.templates,{details:t})}(),{ExpandableView:n,ListItemView:s,FoldoutListItemView:c}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(6),i(5)],s=function(e,t){var i=a.View.extend(e.LoggableMixin).extend(e.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(e){e.usePrompt===!1?this.label="":this.label='<label class="prompt">'+t("Tags")+"</label>",this.hiddenUntilActivated(e.$activator,e)},render:function(){var e=this;return this.$el.html(this._template()),this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return e._getTagsUsed()}}),this._setUpBehaviors(),this},_hashToName:function(e){return e.startsWith("#")?"name:"+e.slice(1):e},_nameToHash:function(e){return e.startsWith("name:")&&(e="#"+e.slice(5)),e},_template:function(){return[this.label,'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var e=this,t=this.model.get("tags");return!o.isArray(t)||o.isEmpty(t)?"":t.map(function(t){return o.escape(e._nameToHash(t))}).sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){var e=this;return o.map(Galaxy.user.get("tags_used"),e._nameToHash)},_setUpBehaviors:function(){var e=this;this.$input().on("change",function(t){t.val=o.map(t.val,e._hashToName),e.model.save({tags:t.val}),t.added&&e._addNewTagToTagsUsed(t.added.text+"")})},_addNewTagToTagsUsed:function(e){var t=Galaxy.user.get("tags_used");o.contains(t,e)||(t.push(e),t.sort(),Galaxy.user.set("tags_used",t))},remove:function(){this.$input.off(),this.stopListening(this.model),a.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});return{TagsEditor:i}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2))},function(e,t,i){var n,s;(function(a,o){n=[i(4),i(61),i(7),i(20),i(19),i(34)],s=function(e,t,i,n,s,r){return n.extend({initialize:function(e){var i=this;this.deferred=new t,n.prototype.initialize.call(this,e),this.model.get("inputs")?this._buildForm(this.model.attributes):this.deferred.execute(function(e){i._buildModel(e,i.model.attributes,!0)}),this.model.get("listen_to_history")&&parent.Galaxy&&parent.Galaxy.currHistoryPanel&&this.listenTo(parent.Galaxy.currHistoryPanel.collection,"change",function(){i.model.get("onchange")()}),this.$el.on("remove",function(){i.remove()})},remove:function(){var e=this;this.$el.hide(),this.deferred.execute(function(){n.prototype.remove.call(e),Galaxy.emit.debug("tool-form-base::remove()","Destroy view.")})},_buildForm:function(e){var t=this;this.model.set(e),this.model.set({title:e.title||"<b>"+e.name+"</b> "+e.description+" (Galaxy Version "+e.version+")",operations:!this.model.get("hide_operations")&&this._operations(),onchange:function(){t.deferred.reset(),t.deferred.execute(function(e){t.model.get("postchange")(e,t)})}}),this.model.get("customize")&&this.model.get("customize")(this),this.render(),this.model.get("collapsible")||this.$el.append(a("<div/>").addClass("ui-margin-top-large").append(this._footer()))},_buildModel:function(t,n,s){var o=this,r=this.model.attributes;r.version=n.version,r.id=n.id;var l="",c={};r.job_id?l=Galaxy.root+"api/jobs/"+r.job_id+"/build_for_rerun":(l=Galaxy.root+"api/tools/"+r.id+"/build",Galaxy.params&&Galaxy.params.tool_id==r.id&&(c=a.extend({},Galaxy.params),r.version&&(c.tool_version=r.version))),e.get({url:l,data:c,success:function(e){return e.display?(o._buildForm(e),!s&&o.message.update({status:"success",message:"Now you are using '"+r.name+"' version "+r.version+", id '"+r.id+"'.",persistent:!1}),Galaxy.emit.debug("tool-form-base::_buildModel()","Initial tool model ready.",e),void t.resolve()):void(window.location=Galaxy.root)},error:function(e,n){var s=e&&e.err_msg||"Uncaught error.";401==n?window.location=Galaxy.root+"user/login?"+a.param({redirect:Galaxy.root+"?tool_id="+r.id}):o.$el.is(":empty")?o.$el.prepend(new i.Message({message:s,status:"danger",persistent:!0,large:!0}).$el):Galaxy.modal&&Galaxy.modal.show({title:"Tool request failed",body:s,buttons:{Close:function(){Galaxy.modal.hide()}}}),Galaxy.emit.debug("tool-form-base::_buildModel()","Initial tool model request failed.",e),t.reject()}})},_operations:function(){var t=this,n=this.model.attributes,s=new i.ButtonMenu({icon:"fa-cubes",title:!n.narrow&&"Versions"||null,tooltip:"Select another tool version"});if(!n.sustain_version&&n.versions&&n.versions.length>1)for(var a in n.versions){var o=n.versions[a];o!=n.version&&s.addMenu({title:"Switch to "+o,version:o,icon:"fa-cube",onclick:function(){var e=n.id.replace(n.version,this.version),i=this.version;t.deferred.reset(),t.deferred.execute(function(n){t._buildModel(n,{id:e,version:i})})}})}else s.$el.hide();var r=new i.ButtonMenu({icon:"fa-caret-down",title:!n.narrow&&"Options"||null,tooltip:"View available options"});return n.biostar_url&&(r.addMenu({icon:"fa-question-circle",title:"Question?",onclick:function(){window.open(n.biostar_url+"/p/new/post/")}}),r.addMenu({icon:"fa-search",title:"Search",onclick:function(){window.open(n.biostar_url+"/local/search/page/?q="+n.name)}})),r.addMenu({icon:"fa-share",title:"Share",onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+Galaxy.root+"root?tool_id="+n.id)}}),Galaxy.user&&Galaxy.user.get("is_admin")&&(r.addMenu({icon:"fa-download",title:"Download",onclick:function(){window.location.href=Galaxy.root+"api/tools/"+n.id+"/download"}}),r.addMenu({icon:"fa-refresh",title:"Reload XML",onclick:function(){e.get({url:Galaxy.root+"api/tools/"+n.id+"/reload",success:function(e){t.message.update({persistent:!1,message:"Tool XML has been reloaded.",status:"success"})},error:function(e){t.message.update({persistent:!1,message:e.err_msg,status:"danger"})}})}})),n.requirements&&n.requirements.length>0&&r.addMenu({icon:"fa-info-circle",title:"Requirements",onclick:function(){!this.requirements_visible||t.portlet.collapsed?(this.requirements_visible=!0,t.portlet.expand(),t.message.update({persistent:!0,message:t._templateRequirements(n),status:"info"})):(this.requirements_visible=!1,t.message.update({message:""}))}}),n.sharable_url&&r.addMenu({icon:"fa-external-link",title:"See in Tool Shed",onclick:function(){window.open(n.sharable_url)}}),{menu:r,versions:s}},_footer:function(){var e=this.model.attributes,t=a("<div/>").append(this._templateHelp(e));if(e.citations){var i=a("<div/>"),n=new s.ToolCitationCollection;n.tool_id=e.id;var o=new r.CitationListView({el:i,collection:n});o.render(),n.fetch(),t.append(i)}return t},_templateHelp:function(e){var t=a("<div/>").addClass("ui-form-help").append(e.help);return t.find("a").attr("target","_blank"),t},_templateRequirements:function(e){var t=e.requirements.length;if(t>0){var i="This tool requires ";o.each(e.requirements,function(e,n){i+=e.name+(e.version?" (Version "+e.version+")":"")+(n<t-2?", ":n==t-2?" and ":"")});var n=a("<a/>").attr("target","_blank").attr("href","https://galaxyproject.org/tools/requirements/").text("here");return a("<span/>").append(i+". Click ").append(n).append(" for more information.")}return"No requirements found."}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(2))},function(e,t,i){var n,s;(function(a,o){n=[i(2),i(18),i(10),i(25)],s=function(e,t,i,n){"use strict";var s={hidden:!1,show:function(){this.set("hidden",!1)},hide:function(){this.set("hidden",!0)},toggle:function(){this.set("hidden",!this.get("hidden"))},is_visible:function(){return!this.attributes.hidden}},r=a.Model.extend({defaults:{name:null,label:null,type:null,value:null,html:null,num_samples:5},initialize:function(e){this.attributes.html=unescape(this.attributes.html)},copy:function(){return new r(this.toJSON())},set_value:function(e){this.set("value",e||"")}}),l=a.Collection.extend({model:r}),c=r.extend({}),d=r.extend({set_value:function(e){this.set("value",parseInt(e,10))},get_samples:function(){return d3.scale.linear().domain([this.get("min"),this.get("max")]).ticks(this.get("num_samples"))}}),h=d.extend({set_value:function(e){this.set("value",parseFloat(e))}}),u=r.extend({get_samples:function(){return e.map(this.get("options"),function(e){return e[0]})}});r.subModelTypes={integer:d,float:h,data:c,select:u};var p=a.Model.extend({defaults:{id:null,name:null,description:null,target:null,inputs:[],outputs:[]},urlRoot:Galaxy.root+"api/tools",initialize:function(t){this.set("inputs",new l(e.map(t.inputs,function(e){var t=r.subModelTypes[e.type]||r;return new t(e)})))},toJSON:function(){var e=a.Model.prototype.toJSON.call(this);return e.inputs=this.get("inputs").map(function(e){return e.toJSON()}),e},remove_inputs:function(e){var t=this,i=t.get("inputs").filter(function(t){return e.indexOf(t.get("type"))!==-1});t.get("inputs").remove(i)},copy:function(e){var t=new p(this.toJSON());if(e){var i=new a.Collection;t.get("inputs").each(function(e){e.get_samples()&&i.push(e)}),t.set("inputs",i)}return t},apply_search_results:function(t){return e.indexOf(t,this.attributes.id)!==-1?this.show():this.hide(),this.is_visible()},set_input_value:function(e,t){this.get("inputs").find(function(t){return t.get("name")===e}).set("value",t)},set_input_values:function(t){var i=this;e.each(e.keys(t),function(e){i.set_input_value(e,t[e])})},run:function(){return this._run()},rerun:function(e,t){return this._run({action:"rerun",target_dataset_id:e.id,regions:t})},get_inputs_dict:function(){var e={};return this.get("inputs").each(function(t){e[t.get("name")]=t.get("value")}),e},_run:function(n){var s=e.extend({tool_id:this.id,inputs:this.get_inputs_dict()},n),a=o.Deferred(),r=new t.ServerStateDeferred({ajax_settings:{url:this.urlRoot,data:JSON.stringify(s),dataType:"json",contentType:"application/json",type:"POST"},interval:2e3,success_fn:function(e){return"pending"!==e}});return o.when(r.go()).then(function(e){a.resolve(new i.DatasetCollection(e))}),a}});e.extend(p.prototype,s);var f=(a.View.extend({}),a.Collection.extend({model:p})),g=a.Model.extend(s),m=a.Model.extend({defaults:{elems:[],open:!1},clear_search_results:function(){e.each(this.attributes.elems,function(e){e.show()}),this.show(),this.set("open",!1)},apply_search_results:function(t){var i,n=!0;e.each(this.attributes.elems,function(e){e instanceof g?(i=e,i.hide()):e instanceof p&&e.apply_search_results(t)&&(n=!1,i&&i.show())}),n?this.hide():(this.show(),this.set("open",!0))}});e.extend(m.prototype,s);var v=a.Model.extend({defaults:{search_hint_string:"search tools",min_chars_for_search:3,clear_btn_url:"",visible:!0,query:"",results:null,clear_key:27},urlRoot:Galaxy.root+"api/tools",initialize:function(){this.on("change:query",this.do_search)},do_search:function(){var e=this.attributes.query;if(e.length<this.attributes.min_chars_for_search)return void this.set("results",null);var t=e;this.timer&&clearTimeout(this.timer),o("#search-clear-btn").hide(),o("#search-spinner").show();var i=this;this.timer=setTimeout(function(){"undefined"!=typeof ga&&ga("send","pageview",Galaxy.root+"?q="+t),o.get(i.urlRoot,{q:t},function(e){i.set("results",e),o("#search-spinner").hide(),o("#search-clear-btn").show()},"json")},400)},clear_search:function(){this.set("query",""),this.set("results",null)}});e.extend(v.prototype,s);var _=a.Model.extend({initialize:function(e){this.attributes.tool_search=e.tool_search,this.attributes.tool_search.on("change:results",this.apply_search_results,this),this.attributes.tools=e.tools,this.attributes.layout=new a.Collection(this.parse(e.layout))},parse:function(t){var i=this,n=function(t){var s=t.model_class;if(s.indexOf("Tool")===s.length-4)return i.attributes.tools.get(t.id);if("ToolSection"===s){var a=e.map(t.elems,n);return t.elems=a,new m(t)}return"ToolSectionLabel"===s?new g(t):void 0};return e.map(t,n)},clear_search_results:function(){this.get("layout").each(function(e){e instanceof m?e.clear_search_results():e.show()})},apply_search_results:function(){var e=this.get("tool_search").get("results");if(null===e)return void this.clear_search_results();var t=null;this.get("layout").each(function(i){i instanceof g?(t=i,t.hide()):i instanceof p?i.apply_search_results(e)&&t&&t.show():(t=null,i.apply_search_results(e))})}}),y=a.View.extend({initialize:function(){this.model.on("change:hidden",this.update_visible,this),this.update_visible()},update_visible:function(){this.model.attributes.hidden?this.$el.hide():this.$el.show()}}),b=y.extend({tagName:"div",render:function(){var e=o("<div/>");e.append(E.tool_link(this.model.toJSON()));var t=this.model.get("form_style",null);if("upload1"===this.model.id)e.find("a").on("click",function(e){e.preventDefault(),Galaxy.upload.show()});else if("regular"===t){var i=this;e.find("a").on("click",function(e){e.preventDefault(),Galaxy.router.push("/",{tool_id:i.model.id,version:i.model.get("version")})})}return this.$el.append(e),this}}),w=y.extend({tagName:"div",className:"toolPanelLabel",render:function(){return this.$el.append(o("<span/>").text(this.model.attributes.text)),this}}),x=y.extend({tagName:"div",className:"toolSectionWrapper",initialize:function(){y.prototype.initialize.call(this),this.model.on("change:open",this.update_open,this)},render:function(){this.$el.append(E.panel_section(this.model.toJSON()));var t=this.$el.find(".toolSectionBody");return e.each(this.model.attributes.elems,function(e){if(e instanceof p){var i=new b({model:e,className:"toolTitle"});i.render(),t.append(i.$el)}else if(e instanceof g){var n=new w({model:e});n.render(),t.append(n.$el)}}),this},events:{"click .toolSectionTitle > a":"toggle"},toggle:function(){this.model.set("open",!this.model.attributes.open)},update_open:function(){this.model.attributes.open?this.$el.children(".toolSectionBody").slideDown("fast"):this.$el.children(".toolSectionBody").slideUp("fast")}}),C=a.View.extend({tagName:"div",id:"tool-search",className:"bar",events:{click:"focus_and_select","keyup :input":"query_changed","change :input":"query_changed","click #search-clear-btn":"clear"},render:function(){return this.$el.append(E.tool_search(this.model.toJSON())),this.model.is_visible()||this.$el.hide(),o("#messagebox").is(":visible")&&this.$el.css("top","95px"),this.$el.find("[title]").tooltip(),this},focus_and_select:function(){this.$el.find(":input").focus().select()},clear:function(){return this.model.clear_search(),this.$el.find(":input").val(""),this.focus_and_select(),!1},query_changed:function(e){return this.model.attributes.clear_key&&this.model.attributes.clear_key===e.which?(this.clear(),!1):void this.model.set("query",this.$el.find(":input").val())}}),$=a.View.extend({tagName:"div",className:"toolMenu",initialize:function(){this.model.get("tool_search").on("change:results",this.handle_search_results,this)},render:function(){var e=this,t=new C({model:this.model.get("tool_search")});return t.render(),e.$el.append(t.$el),this.model.get("layout").each(function(t){if(t instanceof m){var i=new x({model:t});i.render(),e.$el.append(i.$el)}else if(t instanceof p){var n=new b({model:t,className:"toolTitleNoSection"});n.render(),e.$el.append(n.$el)}else if(t instanceof g){var s=new w({model:t});s.render(),e.$el.append(s.$el)}}),e.$el.find("a.tool-link").click(function(t){var i=o(this).attr("class").split(/\s+/)[0],n=e.model.get("tools").get(i);e.trigger("tool_link_click",t,n)}),this},handle_search_results:function(){var e=this.model.get("tool_search").get("results");e&&0===e.length?o("#search-no-results").show():o("#search-no-results").hide()}}),k=a.View.extend({className:"toolForm",render:function(){this.$el.children().remove(),this.$el.append(E.tool_form(this.model.toJSON()))}}),E=(a.View.extend({className:"toolMenuAndView",initialize:function(){this.tool_panel_view=new $({collection:this.collection}),this.tool_form_view=new k},render:function(){this.tool_panel_view.render(),this.tool_panel_view.$el.css("float","left"),this.$el.append(this.tool_panel_view.$el),this.tool_form_view.$el.hide(),this.$el.append(this.tool_form_view.$el);var e=this;this.tool_panel_view.on("tool_link_click",function(t,i){t.preventDefault(),e.show_tool(i)})},show_tool:function(e){var t=this;e.fetch().done(function(){t.tool_form_view.model=e,t.tool_form_view.render(),t.tool_form_view.$el.show(),o("#left").width("650px")})}}),{tool_search:e.template(['<input id="tool-search-query" class="search-query parent-width" name="query" ','placeholder="<%- search_hint_string %>" autocomplete="off" type="text" />','<a id="search-clear-btn" title="clear search (esc)"> </a>','<span id="search-spinner" class="search-spinner fa fa-spinner fa-spin"></span>'].join("")),panel_section:e.template(['<div class="toolSectionTitle" id="title_<%- id %>">','<a href="javascript:void(0)"><span><%- name %></span></a>',"</div>",'<div id="<%- id %>" class="toolSectionBody" style="display: none;">','<div class="toolSectionBg"></div>',"<div>"].join("")),tool_link:e.template(['<span class="labels">',"<% _.each( labels, function( label ){ %>",'<span class="label label-default label-<%- label %>">',"<%- label %>","</span>","<% }); %>","</span>",'<a class="<%- id %> tool-link" href="<%= link %>" target="<%- target %>" minsizehint="<%- min_width %>">',"<%- name %>","</a>"," <%- description %>"].join("")),tool_form:e.template(['<div class="toolFormTitle"><%- tool.name %> (version <%- tool.version %>)</div>','<div class="toolFormBody">',"<% _.each( tool.inputs, function( input ){ %>",'<div class="form-row">','<label for="<%- input.name %>"><%- input.label %>:</label>','<div class="form-row-input">',"<%= input.html %>","</div>",'<div class="toolParamHelp" style="clear: both;">',"<%- input.help %>","</div>",'<div style="clear: both;"></div>',"</div>","<% }); %>","</div>",'<div class="form-row form-actions">','<input type="submit" class="btn btn-primary" name="runtool_btn" value="Execute" />',"</div>",'<div class="toolHelp">','<div class="toolHelpBody"><% tool.help %></div>',"</div>"].join(""),{variable:"tool"})});return{ToolParameter:r,IntegerToolParameter:d,SelectToolParameter:u,Tool:p,ToolCollection:f,ToolSearch:v,ToolPanel:_,ToolPanelView:$,ToolFormView:k}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1))},function(e,t,i){var n,s;(function(i,a,o,r){n=[],s=function(){var e=i.View.extend({initialize:function(e,t){this.$button=e,this.$button.length||(this.$button=a("<div/>")),this.options=t||[],this.$button.data("popupmenu",this);var i=this;this.$button.click(function(e){return a(".popmenu-wrapper").remove(),i._renderAndShow(e),!1})},_renderAndShow:function(e){this.render(),this.$el.appendTo("body").css(this._getShownPosition(e)).show(),this._setUpCloseBehavior()},render:function(){if(this.$el.addClass("popmenu-wrapper").hide().css({position:"absolute"}).html(this.template(this.$button.attr("id"),this.options)),this.options.length){var e=this;this.$el.find("li").each(function(t,i){var n=e.options[t];n.func&&a(this).children("a.popupmenu-option").click(function(t){n.func.call(e,t,n),t.preventDefault()})})}return this},template:function(e,t){return['<ul id="',e,'-menu" class="dropdown-menu">',this._templateOptions(t),"</ul>"].join("")},_templateOptions:function(e){return e.length?o.map(e,function(e){if(e.divider)return'<li class="divider"></li>';if(e.header)return['<li class="head"><a href="javascript:void(0);">',e.html,"</a></li>"].join("");var t=e.href||"javascript:void(0);",i=e.target?' target="'+e.target+'"':"",n=e.checked?'<span class="fa fa-check"></span>':"";return['<li><a class="popupmenu-option" href="',t,'"',i,">",n,e.html,"</a></li>"].join("")}).join(""):"<li>(no options)</li>"},_getShownPosition:function(e){var t=this.$el.width(),i=e.pageX-t/2;return i=Math.min(i,a(document).scrollLeft()+a(window).width()-t-5),i=Math.max(i,a(document).scrollLeft()+5),{top:e.pageY,left:i}},_setUpCloseBehavior:function(){function e(e){if(a(document).off("click.close_popup"),window&&window.parent!==window)try{a(window.parent.document).off("click.close_popup")}catch(e){}else try{a("iframe#galaxy_main").contents().off("click.close_popup")}catch(e){}t.remove()}var t=this;if(a("html").one("click.close_popup",e),window&&window.parent!==window)try{a(window.parent.document).find("html").one("click.close_popup",e)}catch(e){}else try{a("iframe#galaxy_main").contents().one("click.close_popup",e)}catch(e){}},addItem:function(e,t){return t=t>=0?t:this.options.length,this.options.splice(t,0,e),this},removeItem:function(e){return e>=0&&this.options.splice(e,1),this},findIndexByHtml:function(e){for(var t=0;t<this.options.length;t++)if(o.has(this.options[t],"html")&&this.options[t].html===e)return t;return null},findItemByHtml:function(e){return this.options[this.findIndexByHtml(e)]},toString:function(){return"PopupMenu"}});return e.create=function(t,i){return new e(t,i)},e.make_popupmenu=function(t,i){var n=[];return o.each(i,function(e,t){var i={html:t};null===e?i.header=!0:"function"===r.type(e)&&(i.func=e),n.push(i)}),new e(a(t),n)},e.convertLinksToOptions=function(e,t){e=a(e),t=t||"a";var i=[];return e.find(t).each(function(e,t){var n={},s=a(e);if(n.html=s.text(),s.attr("href")){var o=s.attr("href"),r=s.attr("target"),l=s.attr("confirm");n.func=function(){if(!l||confirm(l))switch(r){case"_parent":window.parent.location=o;break;case"_top":window.top.location=o;break;default:window.location=o}}}i.push(n)}),i},e.fromExistingDom=function(t,i,n){t=a(t),i=a(i);var s=e.convertLinksToOptions(i,n);return i.remove(),new e(t,s)},e.make_popup_menus=function(t,i,n){t=t||document,i=i||"div[popupmenu]",n=n||function(e,t){return"#"+e.attr("popupmenu")};var s=[];return a(t).find(i).each(function(){var i=a(this),o=a(t).find(n(i,t));s.push(e.fromDom(o,i)),o.addClass("popup")}),s},e}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(4)],s=function(e){return a.View.extend({colors:{standard:["c00000","ff0000","ffc000","ffff00","92d050","00b050","00b0f0","0070c0","002060","7030a0"],base:["ffffff","000000","eeece1","1f497d","4f81bd","c0504d","9bbb59","8064a2","4bacc6","f79646"],theme:[["f2f2f2","7f7f7f","ddd9c3","c6d9f0","dbe5f1","f2dcdb","ebf1dd","e5e0ec","dbeef3","fdeada"],["d8d8d8","595959","c4bd97","8db3e2","b8cce4","e5b9b7","d7e3bc","ccc1d9","b7dde8","fbd5b5"],["bfbfbf","3f3f3f","938953","548dd4","95b3d7","d99694","c3d69b","b2a2c7","92cddc","fac08f"],["a5a5a5","262626","494429","17365d","366092","953734","76923c","5f497a","31859b","e36c09"],["7f7f7e","0c0c0c","1d1b10","0f243e","244061","632423","4f6128","3f3151","205867","974806"]]},initialize:function(t){this.options=e.merge(t,{}),this.setElement(this._template()),this.$panel=this.$(".ui-color-picker-panel"),this.$view=this.$(".ui-color-picker-view"),this.$value=this.$(".ui-color-picker-value"),this.$header=this.$(".ui-color-picker-header"),this._build(),this.visible=!1,this.value(this.options.value),this.$boxes=this.$(".ui-color-picker-box");var i=this;this.$boxes.on("click",function(){i.value(o(this).css("background-color")),i.$header.trigger("click")}),this.$header.on("click",function(){i.visible=!i.visible,i.visible?i.$view.fadeIn("fast"):i.$view.fadeOut("fast")})},value:function(e){return void 0!==e&&null!==e&&(this.$value.css("background-color",e),this.$(".ui-color-picker-box").empty(),this.$(this._getValue()).html(this._templateCheck()),this.options.onchange&&this.options.onchange(e)),this._getValue()},_getValue:function(){function e(e){return("0"+parseInt(e).toString(16)).slice(-2)}var t=this.$value.css("background-color");return t=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/),t?"#"+e(t[1])+e(t[2])+e(t[3]):null},_build:function(){this._content({colors:this.colors.base});for(var e in this.colors.theme){var t={};0==e?t.bottom=!0:e!=this.colors.theme.length-1?(t.top=!0,t.bottom=!0):t.top=!0,t.colors=this.colors.theme[e],this._content(t)}this._content({colors:this.colors.standard})},_content:function(e){var t=e.colors,i=o(this._templateContent()),n=i.find(".line");this.$panel.append(i);for(var s in t){var a=o(this._templateBox(t[s]));e.top&&(a.css("border-top","none"),a.css("border-top-left-radius","0px"),a.css("border-top-right-radius","0px")),e.bottom&&(a.css("border-bottom","none"),a.css("border-bottom-left-radius","0px"),a.css("border-bottom-right-radius","0px")),n.append(a)}return i},_templateCheck:function(){return'<div class="ui-color-picker-check fa fa-check"/>'},_templateContent:function(){return'<div class="ui-color-picker-content"><div class="line"/></div>'},_templateBox:function(e){return'<div id="'+e+'" class="ui-color-picker-box" style="background-color: #'+e+';"/>'},_template:function(){return'<div class="ui-color-picker"><div class="ui-color-picker-header"><div class="ui-color-picker-value"/><div class="ui-color-picker-label">Select a color</div></div><div class="ui-color-picker-view ui-input"><div class="ui-color-picker-panel"/></div>'}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1))},function(e,t,n){var s,a;(function(o,r){s=[n(4),n(22)],a=function(e,t){var n=t.BaseIcons.extend({initialize:function(e){e.type=e.display||"checkbox",e.multiple="checkbox"==e.type,t.BaseIcons.prototype.initialize.call(this,e)},_setValue:function(e){if(t.BaseIcons.prototype._setValue.call(this,e),void 0!==e&&null!==e&&this.header_index){var i=this,n=o.isArray(e)?e:[e];r.each(n,function(e){var t=i.header_index[e];r.each(t,function(e){i._setState(e,!0)})})}},_setState:function(e,t){var i=this.$(".button-"+e),n=this.$(".subgroup-"+e);i.data("is_expanded",t),t?(n.show(),i.removeClass("fa-plus-square").addClass("fa-minus-square")):(n.hide(),i.removeClass("fa-minus-square").addClass("fa-plus-square"))},_templateOptions:function(){function t(e,t){var i=e.find(".button-"+t);i.on("click",function(){s._setState(t,!i.data("is_expanded"));
})}function n(a,r,l){l=l||[];for(i in r){var c=r[i],d=c.options&&c.options.length>0,h=l.slice(0);s.header_index[c.value]=h.slice(0);var u=o("<div/>");if(d){var p=e.uid(),f=o("<span/>").addClass("button-"+p).addClass("ui-drilldown-button fa fa-plus-square"),g=o("<div/>").addClass("subgroup-"+p).addClass("ui-drilldown-subgroup");u.append(o("<div/>").append(f).append(s._templateOption({label:c.name,value:c.value}))),h.push(p),n(g,c.options,h),u.append(g),t(u,p)}else u.append(s._templateOption({label:c.name,value:c.value}));a.append(u)}}var s=this;this.header_index={};var a=o("<div/>");return n(a,this.model.get("data")),a},_template:function(){return o("<div/>").addClass("ui-options-list drilldown-container").attr("id",this.model.id)}});return{View:n}}.apply(t,s),!(void 0!==a&&(e.exports=a))}).call(t,n(1),n(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(7),i(23)],s=function(e,t,i){var n={DISABLED:"disabled",ENABLED:"enabled",LINKED:"linked"},s={data:[{src:"hda",icon:"fa-file-o",tooltip:"Single dataset",multiple:!1,batch:n.DISABLED},{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:n.LINKED},{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:n.LINKED}],data_multiple:[{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:n.DISABLED},{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collections",multiple:!0,batch:n.DISABLED}],data_collection:[{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:n.DISABLED}],workflow_data:[{src:"hda",icon:"fa-file-o",tooltip:"Single dataset",multiple:!1,batch:n.DISABLED}],workflow_data_multiple:[{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:n.DISABLED}],workflow_data_collection:[{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:n.DISABLED}],module_data:[{src:"hda",icon:"fa-file-o",tooltip:"Single dataset",multiple:!1,batch:n.DISABLED},{src:"hda",icon:"fa-files-o",tooltip:"Multiple datasets",multiple:!0,batch:n.ENABLED}],module_data_collection:[{src:"hdca",icon:"fa-folder-o",tooltip:"Dataset collection",multiple:!1,batch:n.DISABLED},{src:"hdca",icon:"fa-folder",tooltip:"Multiple collections",multiple:!0,batch:n.ENABLED}]},l=a.View.extend({initialize:function(e){var i=this;this.model=e&&e.model||new a.Model({src_labels:{hda:"dataset",hdca:"dataset collection"},pagelimit:100,statustimer:1e3}).set(e),this.setElement(o("<div/>").addClass("ui-select-content")),this.button_product=new t.RadioButton.View({value:"false",data:[{icon:"fa fa-chain",value:"false",tooltip:"Linked inputs will be run in matched order with other datasets e.g. use this for matching forward and reverse reads."},{icon:"fa fa-chain-broken",value:"true",tooltip:"Unlinked dataset inputs will be run against *all* other inputs."}]});var n=o("<div/>").addClass("ui-form-info").append(o("<i/>").addClass("fa fa-sitemap")).append(o("<span/>").html("This is a batch mode input field. Separate jobs will be triggered for each dataset selection."));this.$batch={linked:n.clone(),enabled:n.clone().append(o("<div/>").append(o("<div/>").addClass("ui-form-title").html("Batch options:")).append(this.button_product.$el)).append(o("<div/>").css("clear","both"))},this.$el.on("dragenter",function(e){this.lastenter=e.target,i.$el.addClass("ui-dragover")}).on("dragover",function(e){e.preventDefault()}).on("dragleave",function(e){this.lastenter===e.target&&i.$el.removeClass("ui-dragover")}).on("drop",function(e){i._handleDrop(e)}),this.history={},this.listenTo(this.model,"change:data",this._changeData,this),this.listenTo(this.model,"change:wait",this._changeWait,this),this.listenTo(this.model,"change:current",this._changeCurrent,this),this.listenTo(this.model,"change:value",this._changeValue,this),this.listenTo(this.model,"change:type change:optional change:multiple change:extensions",this._changeType,this),this.render(),this.on("change",function(){e.onchange&&e.onchange(i.value())})},render:function(){this._changeType(),this._changeValue(),this._changeWait()},wait:function(){this.model.set("wait",!0)},unwait:function(){this.model.set("wait",!1)},update:function(e){this.model.set("data",e)},value:function(e){void 0!==e&&this.model.set("value",e);var t=this.model.get("current");if(this.config[t]){var i=this.fields[t].value();if(null!==i&&(i=o.isArray(i)?i:[i],i.length>0)){var n=this._batch({values:[]});for(var s in i){var a=this.history[i[s]+"_"+this.config[t].src];if(!a)return Galaxy.emit.debug("ui-select-content::value()","Requested details not found for '"+i[s]+"'."),null;n.values.push(a)}return n.values.sort(function(e,t){return e.hid-t.hid}),n}}else Galaxy.emit.debug("ui-select-content::value()","Invalid value/source '"+e+"'.");return null},_changeCurrent:function(){var e=this;r.each(this.fields,function(t,i){e.model.get("current")==i?(t.$el.show(),r.each(e.$batch,function(t,n){t[e.config[i].batch==n?"show":"hide"]()}),e.button_type.value(i)):t.$el.hide()})},_changeType:function(){var n=this,a=(this.model.get("flavor")?this.model.get("flavor")+"_":"")+String(this.model.get("type"))+(this.model.get("multiple")?"_multiple":"");s[a]?this.config=s[a]:(this.config=s.data,Galaxy.emit.debug("ui-select-content::_changeType()","Invalid configuration/type id '"+a+"'."));var o=n.model.get("data"),l=e.textify(this.model.get("extensions")),c=this.model.get("src_labels");this.fields=[],this.button_data=[],r.each(this.config,function(e,t){n.button_data.push({value:t,icon:e.icon,tooltip:e.tooltip}),n.fields.push(new i.View({optional:n.model.get("optional"),multiple:e.multiple,searchable:!e.multiple||o&&o[e.src]&&o[e.src].length>n.model.get("pagelimit"),selectall:!1,error_text:"No "+(l?l+" ":"")+(c[e.src]||"content")+" available.",onchange:function(){n.trigger("change")}}))}),this.button_type=new t.RadioButton.View({value:this.model.get("current"),data:this.button_data,onchange:function(e){n.model.set("current",e),n.trigger("change")}}),this.$el.empty();var d=0;this.fields.length>1&&(this.$el.append(this.button_type.$el),d=Math.max(0,36*this.fields.length)+"px"),r.each(this.fields,function(e){n.$el.append(e.$el.css({"margin-left":d}))}),r.each(this.$batch,function(e,t){n.$el.append(e.css({"margin-left":d}))}),this.model.set("current",0),this._changeCurrent(),this._changeData()},_changeWait:function(){var e=this;r.each(this.fields,function(t){t[e.model.get("wait")?"wait":"unwait"]()})},_changeData:function(){var e=this.model.get("data"),t=this,i={};r.each(e,function(e,n){i[n]=[],r.each(e,function(e){i[n].push({hid:e.hid,keep:e.keep,label:e.hid+": "+e.name,value:e.id,tags:e.tags}),t.history[e.id+"_"+n]=e})}),r.each(this.config,function(e,n){i[e.src]&&t.fields[n].add(i[e.src],function(e,t){return t.hid-e.hid})})},_changeValue:function(){var e=this.model.get("value");if(e&&e.values&&e.values.length>0){var t=[];r.each(e.values,function(e){t.push(e.id)});for(var i=e.values[0].src,n=e.values.length>1,s=0;s<this.config.length;s++){var a=this.fields[s],o=this.config[s];if(o.src==i&&[n,!0].indexOf(o.multiple)!==-1){this.model.set("current",s),a.value(t);break}}}else r.each(this.fields,function(e){e.value(null)})},_handleDrop:function(e){try{var t=this.model.get("data"),i=this.model.get("current"),n=this.config[i],s=this.fields[i],a=JSON.parse(e.originalEvent.dataTransfer.getData("text"))[0],o=a.id,l="dataset"==a.history_content_type?"hda":"hdca",c={id:o,src:l};if(t&&r.findWhere(t[l],c)){if(n.src==l){var d=s.value();d&&n.multiple?d.indexOf(o)==-1&&d.push(o):d=o,s.value(d)}else this.model.set("value",{values:[c]}),this.model.trigger("change:value");this.trigger("change"),this._handleDropStatus("success")}else this._handleDropStatus("danger")}catch(e){this._handleDropStatus("danger")}},_handleDropStatus:function(e){var t=this;this.$el.removeClass("ui-dragover").addClass("ui-dragover-"+e),setTimeout(function(){t.$el.removeClass("ui-dragover-"+e)},this.model.get("statustimer"))},_batch:function(e){e.batch=!1;var t=this.model.get("current"),i=this.config[t];if("hdca"==i.src&&!i.multiple){var s=this.history[this.fields[t].value()+"_hdca"];s&&s.map_over_type&&(e.batch=!0)}return i.batch!=n.LINKED&&i.batch!=n.ENABLED||(e.batch=!0,i.batch==n.ENABLED&&"true"===this.button_product.value()&&(e.product=!0)),e}});return{View:l}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a){n=[i(4),i(21)],s=function(e,t){var i=a.View.extend({initialize:function(i){var n=this;this.ftpfile_list=new t.View({name:"file",optional:i.optional,multiple:i.multiple,onchange:function(){i.onchange&&i.onchange(n.value())}}),this.setElement(this.ftpfile_list.$el),e.get({url:Galaxy.root+"api/remote_files",success:function(e){var t=[];for(var i in e)t.push({value:e[i].path,label:e[i].path});n.ftpfile_list.update(t)}})},value:function(e){return this.ftpfile_list.value(e)}});return{View:i}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3))},function(e,t,i){var n,s;(function(a){n=[i(4),i(7),i(27),i(21)],s=function(e,t,i,n){var s=a.Collection.extend({url:Galaxy.root+"api/libraries?deleted=false"}),o=a.Collection.extend({initialize:function(){var e=this;this.config=new a.Model({library_id:null}),this.config.on("change",function(){e.fetch({reset:!0})})},url:function(){return Galaxy.root+"api/libraries/"+this.config.get("library_id")+"/contents"}}),r=a.View.extend({initialize:function(e){var i=this;this.libraries=new s,this.datasets=new o,this.options=e,this.library_select=new t.Select.View({onchange:function(e){i.datasets.config.set("library_id",e)}}),this.dataset_list=new n.View({name:"dataset",optional:e.optional,multiple:e.multiple,onchange:function(){i.trigger("change")}}),this.libraries.on("reset",function(){var e=[];i.libraries.each(function(t){e.push({value:t.id,label:t.get("name")})}),i.library_select.update(e)}),this.datasets.on("reset",function(){var e=[],t=i.library_select.text();null!==t&&i.datasets.each(function(t){"file"===t.get("type")&&e.push({value:t.id,label:t.get("name")})}),i.dataset_list.update(e)}),this.on("change",function(){e.onchange&&e.onchange(i.value())}),this.setElement(this._template()),this.$(".library-select").append(this.library_select.$el),this.$el.append(this.dataset_list.$el),this.libraries.fetch({reset:!0,success:function(){i.library_select.trigger("change"),void 0!==i.options.value&&i.value(i.options.value)}})},value:function(e){return this.dataset_list.value(e)},_template:function(){return'<div class="ui-select-library"><div class="library ui-margin-bottom"><span class="library-title">Select Library</span><span class="library-select"/></div></div>'}});return{View:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3))},function(e,t,i){var n,s;(function(a,o){n=[i(4)],s=function(e){var t=a.View.extend({initialize:function(t){var i=this;this.model=t&&t.model||new a.Model({id:e.uid(),min:null,max:null,step:null,precise:!1,split:1e4,value:null,onchange:function(){}}).set(t),this.setElement(this._template()),this.$el.attr("id",this.model.id),this.$text=this.$(".ui-form-slider-text"),this.$slider=this.$(".ui-form-slider-element");var n=[];this.$text.on("change",function(){i.value(o(this).val())}).on("keyup",function(e){n[e.which]=!1}).on("keydown",function(e){var t=e.which;n[t]=!0,i.model.get("is_workflow")&&n[16]&&52==t?(i.value("$"),event.preventDefault()):8==t||9==t||13==t||37==t||39==t||t>=48&&t<=57&&!n[16]||t>=96&&t<=105||(190==t||110==t)&&o(this).val().indexOf(".")==-1&&i.model.get("precise")||(189==t||109==t)&&o(this).val().indexOf("-")==-1||i._isParameter(o(this).val())||n[91]||n[17]||event.preventDefault()});var s=this.model.attributes;this.has_slider=null!==s.max&&null!==s.min&&s.max>s.min;var r=s.step;r||(r=s.precise&&this.has_slider?(s.max-s.min)/s.split:1),this.has_slider?(this.$text.addClass("ui-form-slider-left"),this.$slider.slider({min:s.min,max:s.max,step:r}).on("slide",function(e,t){i.value(t.value)})):this.$slider.hide(),this.listenTo(this.model,"change",this.render,this),this.render()},render:function(){var e=this.model.get("value");this.has_slider&&this.$slider.slider("value",e),e!==this.$text.val()&&this.$text.val(e)},value:function(e){var t=this.model.attributes;return void 0!==e&&(null===e||""===e||this._isParameter(e)||(isNaN(e)&&(e=0),!t.precise&&(e=Math.round(e)),null!==t.max&&(e=Math.min(e,t.max)),null!==t.min&&(e=Math.max(e,t.min))),this.model.set("value",e),this.model.trigger("change"),t.onchange(e)),this.model.get("value")},_isParameter:function(e){return this.model.get("is_workflow")&&"$"===String(e).substring(0,1)},_template:function(){return'<div class="ui-form-slider"><input class="ui-form-slider-text" type="text"/><div class="ui-form-slider-element"/></div>'}});return{View:t}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4)],s=function(e){return a.View.extend({initialize:function(t){var i=this;this.options=e.merge(t,{class_add:"upload-icon-button fa fa-square-o",class_remove:"upload-icon-button fa fa-check-square-o",class_partial:"upload-icon-button fa fa-minus-square-o",collection:null,onchange:function(){},onadd:function(){},onremove:function(){}}),this.collection=this.options.collection,this.setElement(this._template()),this.rows=[],e.get({url:Galaxy.root+"api/remote_files",success:function(e){i._fill(e)},error:function(){i._fill()}})},_fill:function(t){if(t&&t.length>0){this.$(".upload-ftp-content").html(o(this._templateTable()));var i=0;for(index in t)this.rows.push(this._add(t[index])),i+=t[index].size;if(this.$(".upload-ftp-number").html(t.length+" files"),this.$(".upload-ftp-disk").html(e.bytesToString(i,!0)),this.collection){var n=this;this.$("._has_collection").show(),this.$select_all=this.$(".upload-selectall").addClass(this.options.class_add),this.$select_all.on("click",function(){var e=n.$select_all.hasClass(n.options.class_add);for(index in t){var i=t[index],s=n._find(i);(!s&&e||s&&!e)&&n.rows[index].trigger("click")}}),this._refresh()}}else this.$(".upload-ftp-content").html(o(this._templateInfo()));this.$(".upload-ftp-wait").hide()},_add:function(e){var t=this,i=o(this._templateRow(e)),n=i.find(".icon");return this.$("tbody").append(i),this.collection?(n.addClass(this._find(e)?this.options.class_remove:this.options.class_add),i.on("click",function(){var i=t._find(e);n.removeClass(),i?(t.options.onremove(i),n.addClass(t.options.class_add)):(t.options.onadd(e),n.addClass(t.options.class_remove)),t._refresh()})):i.on("click",function(){t.options.onchange(e)}),i},_refresh:function(){var e=this.collection.where({file_mode:"ftp",enabled:!0});this.$select_all.removeClass(),0==e.length?this.$select_all.addClass(this.options.class_add):this.$select_all.addClass(e.length==this.rows.length?this.options.class_remove:this.options.class_partial)},_find:function(e){var t=this.collection.findWhere({file_path:e.path,file_mode:"ftp",enabled:!0});return t&&t.get("id")},_templateRow:function(t){return'<tr class="upload-ftp-row"><td class="_has_collection" style="display: none;"><div class="icon"/></td><td class="ftp-name">'+r.escape(t.path)+'</td><td class="ftp-size">'+e.bytesToString(t.size)+'</td><td class="ftp-time">'+t.ctime+"</td></tr>"},_templateTable:function(){return'<span style="whitespace: nowrap; float: left;">Available files: </span><span style="whitespace: nowrap; float: right;"><span class="upload-icon fa fa-file-text-o"/><span class="upload-ftp-number"/> <span class="upload-icon fa fa-hdd-o"/><span class="upload-ftp-disk"/></span><table class="grid" style="float: left;"><thead><tr><th class="_has_collection" style="display: none;"><div class="upload-selectall"></th><th>Name</th><th>Size</th><th>Created</th></tr></thead><tbody/></table>'},_templateInfo:function(){return'<div class="upload-ftp-warning warningmessage">Your FTP directory does not contain any files.</div>'},_template:function(){return'<div class="upload-ftp"><div class="upload-ftp-wait fa fa-spinner fa-spin"/><div class="upload-ftp-help">This Galaxy server allows you to upload files via FTP. To upload some files, log in to the FTP server at <strong>'+this.options.ftp_upload_site+'</strong> using your Galaxy credentials (email address and password).</div><div class="upload-ftp-content"/><div>'}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4)],s=function(e){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(e){this.model=e.model,this.setElement(o("<div/>").addClass("upload-settings")),this.$el.append(o("<div/>").addClass("upload-settings-cover")),this.$el.append(o("<table/>").addClass("upload-settings-table ui-table-striped").append("<tbody/>")),this.$cover=this.$(".upload-settings-cover"),this.$table=this.$(".upload-settings-table > tbody"),this.listenTo(this.model,"change",this.render,this),this.model.trigger("change")},render:function(){var e=this;this.$table.empty(),r.each(this.options.parameters,function(t){var i=o("<div/>").addClass("upload-"+t.id+" upload-icon-button fa").addClass(e.model.get(t.id)&&e.options.class_check||e.options.class_uncheck).on("click",function(){e.model.get("enabled")&&e.model.set(t.id,!e.model.get(t.id))});e.$table.append(o("<tr/>").append(o("<td/>").append(i)).append(o("<td/>").append(t.title)))}),this.$cover[this.model.get("enabled")&&"hide"||"show"]()}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},,function(e,t,i){var n,s;(function(a,o){n=[i(4)],s=function(e){return a.Model.extend({initialize:function(){this.active={},this.last=null},execute:function(t){var i=this,n=e.uid(),s=t.length>0;this.active[n]=!0;var a=o.Deferred();a.promise().always(function(){delete i.active[n],s&&Galaxy.emit.debug("deferred::execute()",this.state().charAt(0).toUpperCase()+this.state().slice(1)+" "+n)}),o.when(this.last).always(function(){i.active[n]?(s&&Galaxy.emit.debug("deferred::execute()","Running "+n),t(a),!s&&a.resolve()):a.reject()}),this.last=a.promise()},reset:function(){Galaxy.emit.debug("deferred::execute()","Reset");for(var e in this.active)this.active[e]=!1},ready:function(){return o.isEmptyObject(this.active)}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1))},,function(e,t,i){(function(e,t){!function(i){e.event.props.push("dataTransfer"),i.uploadpost=function(t){var n=i.extend({},{data:{},success:function(){},error:function(){},progress:function(){},url:null,maxfilesize:2048,error_filesize:"File exceeds 2GB. Please use a FTP client.",error_default:"Please make sure the file is available.",error_server:"Upload request failed.",error_login:"Uploads require you to log in."},t),s=n.data;if(s.error_message)return void n.error(s.error_message);var a=new FormData;for(var o in s.payload)a.append(o,s.payload[o]);var r=0;for(var o in s.files){var l=s.files[o];a.append(l.name,l.file,l.file.name),r+=l.file.size}return r>1048576*n.maxfilesize?void n.error(n.error_filesize):(xhr=new XMLHttpRequest,xhr.open("POST",n.url,!0),xhr.setRequestHeader("Accept","application/json"),xhr.setRequestHeader("Cache-Control","no-cache"),xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),xhr.onreadystatechange=function(){if(xhr.readyState==xhr.DONE){var t=null;if(xhr.responseText)try{t=e.parseJSON(xhr.responseText)}catch(e){t=xhr.responseText}if(xhr.status<200||xhr.status>299){var i=xhr.statusText;403==xhr.status?i=n.error_login:0==xhr.status?i=n.error_server:i||(i=n.error_default),n.error(i+" ("+xhr.status+")")}else n.success(t)}},xhr.upload.addEventListener("progress",function(e){e.lengthComputable&&n.progress(Math.round(100*e.loaded/e.total))},!1),Galaxy.emit.debug("uploadbox::uploadpost()","Posting following data.",n),void xhr.send(a))},i.fn.uploadinput=function(e){var t=this,n=i.extend({},{ondragover:function(){},ondragleave:function(){},onchange:function(){},multiple:!1},e),s=i('<input type="file" style="display: none" '+(n.multiple&&"multiple"||"")+"/>");return t.append(s.change(function(e){n.onchange(e.target.files),i(this).val("")})),t.on("drop",function(e){n.ondragleave(e),e.dataTransfer&&(n.onchange(e.dataTransfer.files),e.preventDefault())}),t.on("dragover",function(e){e.preventDefault(),n.ondragover(e)}),t.on("dragleave",function(e){e.stopPropagation(),n.ondragleave(e)}),{dialog:function(){s.trigger("click")}}},i.fn.uploadbox=function(e){function n(e){if(e&&e.length&&!m){var i=f;return t.each(e,function(e,i){"new"!==e.mode&&t.filter(p,function(t){return t.name===e.name&&t.size===e.size}).length&&(e.duplicate=!0)}),t.each(e,function(e){if(!e.duplicate){var t=String(f++);p[t]=e,u.announce(t,p[t]),g++}}),i}}function s(e){p[e]&&(delete p[e],g--)}function a(){if(0==g||v)return v=!1,m=!1,void u.complete();m=!0;var e=-1;for(var t in p){e=t;break}p[e];s(e),i.uploadpost({url:u.url,data:u.initialize(e),success:function(t){u.success(e,t),a()},error:function(t){u.error(e,t),a()},progress:function(t){u.progress(e,t)}})}function o(){_.dialog()}function r(e){for(e in p)s(e)}function l(){m||(m=!0,a())}function c(){v=!0}function d(e){return u=i.extend({},u,e)}function h(){return window.File&&window.FormData&&window.XMLHttpRequest&&window.FileList}var u=i.extend({},{dragover:function(){},dragleave:function(){},announce:function(e){},initialize:function(e){},progress:function(e,t){},success:function(e,t){},error:function(e,t){alert(t)},complete:function(){}},e),p={},f=0,g=0,m=!1,v=!1,_=i(this).uploadinput({multiple:!0,onchange:function(e){n(e)},ondragover:e.ondragover,ondragleave:e.ondragleave});return{select:o,add:n,remove:s,start:l,stop:c,reset:r,configure:d,compatible:h}}}(e)}).call(t,i(1),i(2))},,,,,,,,function(e,t,i){var n,s;(function(a,o){n=[i(6),i(5),i(16)],s=function(e,t){var i=a.View.extend(e.LoggableMixin).extend(e.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(e){e=e||{},this.tooltipConfig=e.tooltipConfig||{placement:"bottom"},this.listenTo(this.model,"change:annotation",function(){this.render()}),this.hiddenUntilActivated(e.$activator,e)},render:function(){var e=this;return this.$el.html(this._template()),this.$annotation().make_text_editable({use_textarea:!0,on_finish:function(t){e.$annotation().text(t),e.model.save({annotation:t},{silent:!0}).fail(function(){e.$annotation().text(e.model.previous("annotation"))})}}),this},_template:function(){var e=this.model.get("annotation");return['<label class="prompt">',t("Annotation"),"</label>",'<div class="annotation">',o.escape(e),"</div>"].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off(),this.stopListening(this.model),a.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",this.model+"",")"].join("")}});return{AnnotationEditor:i}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2))},function(e,t,i){var n,s;(function(a){n=[i(2),i(3),i(6)],s=function(e,t,i){"use strict";var n=t.Collection.extend({initialize:function(e,i){t.Collection.prototype.initialize.call(this,e,i),this.setOrder(i.order||this.order,{silent:!0})},_setUpListeners:function(){return this.on({"changed-order":this.sort})},fetch:function(e){return e=this._buildFetchOptions(e),t.Collection.prototype.fetch.call(this,e)},_buildFetchOptions:function(t){t=e.clone(t)||{};var i=this;t.traditional=!0,t.data=t.data||i._buildFetchData(t);var n=this._buildFetchFilters(t);return e.isEmpty(n)||e.extend(t.data,this._fetchFiltersToAjaxData(n)),t},_buildFetchData:function(t){var i={};return this.order&&(i.order=this.order),e.defaults(e.pick(t,this._fetchParams),i)},_fetchParams:["order","limit","offset","view","keys"],_buildFetchFilters:function(t){return e.clone(t.filters||{})},_fetchFiltersToAjaxData:function(t){var i={q:[],qv:[]};return e.each(t,function(e,t){void 0!==e&&""!==e&&(e===!0&&(e="True"),e===!1&&(e="False"),null===e&&(e="None"),i.q.push(t),i.qv.push(e))}),i},reset:function(e,i){return this.allFetched=!1,t.Collection.prototype.reset.call(this,e,i)},order:null,comparators:{update_time:i.buildComparator("update_time",{ascending:!1}),"update_time-asc":i.buildComparator("update_time",{ascending:!0}),create_time:i.buildComparator("create_time",{ascending:!1}),"create_time-asc":i.buildComparator("create_time",{ascending:!0})},setOrder:function(t,i){i=i||{};var n=this,s=n.comparators[t];if(e.isUndefined(s))throw new Error("unknown order: "+t);if(s!==n.comparator){n.order;return n.order=t,n.comparator=s,i.silent||n.trigger("changed-order",i),n}}}),s=n.extend({limitPerPage:500,initialize:function(e,t){n.prototype.initialize.call(this,e,t),this.currentPage=t.currentPage||0},getTotalItemCount:function(){return this.length},shouldPaginate:function(){return this.getTotalItemCount()>=this.limitPerPage},getLastPage:function(){return Math.floor(this.getTotalItemCount()/this.limitPerPage)},getPageCount:function(){return this.getLastPage()+1},getPageLimitOffset:function(e){return e=this.constrainPageNum(e),{limit:this.limitPerPage,offset:e*this.limitPerPage}},constrainPageNum:function(e){return Math.max(0,Math.min(e,this.getLastPage()))},fetchPage:function(t,i){var n=this;return t=n.constrainPageNum(t),n.currentPage=t,i=e.defaults(i||{},n.getPageLimitOffset(t)),n.trigger("fetching-more"),n.fetch(i).always(function(){n.trigger("fetching-more-done")})},fetchCurrentPage:function(e){return this.fetchPage(this.currentPage,e)},fetchPrevPage:function(e){return this.fetchPage(this.currentPage-1,e)},fetchNextPage:function(e){return this.fetchPage(this.currentPage+1,e)}}),o=n.extend({limitOnFirstFetch:null,limitPerFetch:100,initialize:function(e,t){n.prototype.initialize.call(this,e,t),this.limitOnFirstFetch=t.limitOnFirstFetch||this.limitOnFirstFetch,this.limitPerFetch=t.limitPerFetch||this.limitPerFetch,this.allFetched=!1,this.lastFetched=t.lastFetched||0},_buildFetchOptions:function(e){return e.remove=e.remove||!1,n.prototype._buildFetchOptions.call(this,e)},fetchFirst:function(t){return t=t?e.clone(t):{},this.allFetched=!1,this.lastFetched=0,this.fetchMore(e.defaults(t,{reset:!0,limit:this.limitOnFirstFetch}))},fetchMore:function(t){t=e.clone(t||{});var i=this;if(!t.reset&&i.allFetched)return a.when();t.offset=t.reset?0:t.offset||i.lastFetched;var n=t.limit=t.limit||i.limitPerFetch||null;return i.trigger("fetching-more"),i.fetch(t).always(function(){i.trigger("fetching-more-done")}).done(function(t){var s=e.isArray(t)?t.length:0;i.lastFetched+=s,(!n||s<n)&&(i.allFetched=!0,i.trigger("all-fetched",this))})},fetchAll:function(t){t=t||{};var i=this;return t=e.pick(t,"silent"),t.filters={},i.fetch(t).done(function(e){i.allFetched=!0,i.trigger("all-fetched",i)})}});return{ControlledFetchCollection:n,PaginatedCollection:s,InfinitelyScrollingCollection:o}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1))},function(e,t,i){var n,s;(function(i){n=[],s=function(){var e={_validationWarning:function(e,t){var i="validation-warning";"name"===e&&(e=this.$(".collection-name").add(this.$(".collection-name-prompt")),this.$(".collection-name").focus().select()),t?(e=e||this.$("."+i),e.removeClass(i)):e.addClass(i)},_changeHideOriginals:function(e){this.hideOriginals=this.$(".hide-originals").prop("checked")},_changeName:function(e){this._validationWarning("name",!!this._getName())},_nameCheckForEnter:function(e){13!==e.keyCode||this.blocking||this._clickCreate()},_getName:function(){return i.escape(this.$(".collection-name").val())},_clickMoreHelp:function(e){e.stopPropagation(),this.$(".main-help").addClass("expanded"),this.$(".more-help").hide()},_clickLessHelp:function(e){e.stopPropagation(),this.$(".main-help").removeClass("expanded"),this.$(".more-help").show()},_toggleHelp:function(e){e.stopPropagation(),this.$(".main-help").toggleClass("expanded"),this.$(".more-help").toggle()},_showAlert:function(e,t){t=t||"alert-danger",this.$(".main-help").hide(),this.$(".header .alert").attr("class","alert alert-dismissable").addClass(t).show().find(".alert-message").html(e)},_hideAlert:function(e){this.$(".main-help").show(),this.$(".header .alert").hide()},_cancelCreate:function(e){"function"==typeof this.oncancel&&this.oncancel.call(this)},_clickCreate:function(e){var t=this._getName();t?this.blocking||this.createList(t):this._validationWarning("name")},_setUpCommonSettings:function(e){this.hideOriginals=e.defaultHideSourceItems||!1},_renderFooter:function(e,t){var n=this,s=this.$(".footer").empty().html(this.templates.footer());return i.each(this.footerSettings,function(e,t){this.$(t).prop("checked",n[e])}),"function"==typeof this.oncancel&&this.$(".cancel-create.btn").show(),s},_creatorTemplates:{main:i.template(['<div class="header flex-row no-flex"></div>','<div class="middle flex-row flex-row-container"></div>','<div class="footer flex-row no-flex"></div>'].join(""))}};return{CollectionCreatorMixin:e}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a){n=[i(83),i(36),i(35),i(6),i(5)],s=function(e,t,i,n,s){"use strict";var o="collections",r=e.ModelListPanel,l=r.extend({_logNamespace:o,className:r.prototype.className+" dataset-collection-panel",DatasetDCEViewClass:i.DatasetDCEListItemView,NestedDCDCEViewClass:i.NestedDCDCEListItemView,modelCollectionKey:"elements",initialize:function(e){r.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank",this.hasUser=e.hasUser,this.panelStack=[],this.parentName=e.parentName,this.foldoutStyle=e.foldoutStyle||"foldout",this.downloadUrl=this.model.attributes.url+"/download"},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;i.log("_queueNewRender:",e,t),i._swapNewRender(e),i.trigger("rendered",i)},_filterCollection:function(){return this.model.getVisibleContents()},_getItemViewClass:function(e){switch(e.get("element_type")){case"hda":return this.DatasetDCEViewClass;case"dataset_collection":return this.NestedDCDCEViewClass}throw new TypeError("Unknown element type:",e.get("element_type"))},_getItemViewOptions:function(e){var t=r.prototype._getItemViewOptions.call(this,e);return a.extend(t,{linkTarget:this.linkTarget,hasUser:this.hasUser,foldoutStyle:this.foldoutStyle})},_setUpItemViewListeners:function(e){var t=this;return r.prototype._setUpItemViewListeners.call(t,e),t.listenTo(e,{"expanded:drilldown":function(e,t){this._expandDrilldownPanel(t)},"collapsed:drilldown":function(e,t){this._collapseDrilldownPanel(t)}}),this},_expandDrilldownPanel:function(e){this.panelStack.push(e),this.$("> .controls").add(this.$list()).hide(),e.parentName=this.model.get("name"),this.$el.append(e.render().$el)},_collapseDrilldownPanel:function(e){this.panelStack.pop(),this.render()},events:{"click .navigation .back":"close"},close:function(e){this.remove(),this.trigger("close")},toString:function(){return"CollectionView("+(this.model?this.model.get("name"):"")+")"}});l.prototype.templates=function(){var e=n.wrapTemplate(['<div class="controls">','<div class="navigation">','<a class="back" href="javascript:void(0)">','<span class="fa fa-icon fa-angle-left"></span>',s("Back to "),"<%- view.parentName %>","</a>","</div>",'<div class="title">','<div class="name"><%- collection.name || collection.element_identifier %></div>','<div class="subtitle">','<% if( collection.collection_type === "list" ){ %>',s("a list of datasets"),'<% } else if( collection.collection_type === "paired" ){ %>',s("a pair of datasets"),'<% } else if( collection.collection_type === "list:paired" ){ %>',s("a list of paired datasets"),'<% } else if( collection.collection_type === "list:list" ){ %>',s("a list of dataset lists"),"<% } %>","</div>","</div>",'<div class="tags-display"></div>','<div class="actions">','<a class="download-btn icon-btn" ','href="<%- view.downloadUrl %>','" title="" download="" data-original-title="Download Collection">','<span class="fa fa-floppy-o"></span>',"</a>","</div>","</div>"],"collection");return a.extend(a.clone(r.prototype.templates),{controls:e})}();var c=l.extend({DatasetDCEViewClass:i.DatasetDCEListItemView,
toString:function(){return"ListCollectionView("+(this.model?this.model.get("name"):"")+")"}}),d=c.extend({toString:function(){return"PairCollectionView("+(this.model?this.model.get("name"):"")+")"}}),h=l.extend({NestedDCDCEViewClass:i.NestedDCDCEListItemView.extend({foldoutPanelClass:d}),toString:function(){return"ListOfPairsCollectionView("+(this.model?this.model.get("name"):"")+")"}}),u=l.extend({NestedDCDCEViewClass:i.NestedDCDCEListItemView.extend({foldoutPanelClass:d}),toString:function(){return"ListOfListsCollectionView("+(this.model?this.model.get("name"):"")+")"}});return{CollectionView:l,ListCollectionView:c,PairCollectionView:d,ListOfPairsCollectionView:h,ListOfListsCollectionView:u}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a,o){n=[i(11),i(38),i(48),i(71),i(17),i(6),i(5)],s=function(e,t,i,n,s,r,l){"use strict";var c=t.DatasetListItemView,d=c.extend({initialize:function(e){c.prototype.initialize.call(this,e),this.hasUser=e.hasUser,this.purgeAllowed=e.purgeAllowed||!1,this.tagsEditorShown=e.tagsEditorShown||!1,this.annotationEditorShown=e.annotationEditorShown||!1},_renderPrimaryActions:function(){var t=c.prototype._renderPrimaryActions.call(this);return this.model.get("state")===e.NOT_VIEWABLE?t:c.prototype._renderPrimaryActions.call(this).concat([this._renderEditButton(),this._renderDeleteButton()])},_renderEditButton:function(){if(this.model.get("state")===e.DISCARDED||!this.model.get("accessible"))return null;var t=this.model.get("purged"),i=this.model.get("deleted"),n={title:l("Edit attributes"),href:this.model.urls.edit,target:this.linkTarget,faIcon:"fa-pencil",classes:"edit-btn"};return i||t?(n.disabled=!0,t?n.title=l("Cannot edit attributes of datasets removed from disk"):i&&(n.title=l("Undelete dataset to edit attributes"))):a.contains([e.UPLOAD,e.NEW],this.model.get("state"))&&(n.disabled=!0,n.title=l("This dataset is not yet editable")),s(n)},_renderDeleteButton:function(){if(!this.model.get("accessible"))return null;var e=this,t=this.model.isDeletedOrPurged();return s({title:l(t?"Dataset is already deleted":"Delete"),disabled:t,faIcon:"fa-times",classes:"delete-btn",onclick:function(){e.$el.find(".icon-btn.delete-btn").trigger("mouseout"),e.model.delete()}})},_renderDetails:function(){var t=c.prototype._renderDetails.call(this),i=this.model.get("state");return!this.model.isDeletedOrPurged()&&a.contains([e.OK,e.FAILED_METADATA],i)&&(this._renderTags(t),this._renderAnnotation(t),this._makeDbkeyEditLink(t)),this._setUpBehaviors(t),t},_renderToolHelpButton:function(){var e=this.model.attributes.dataset_id,t=this.model.attributes.creating_job,i=this,n=function(t){var n='<div id="thdiv-'+e+'" class="toolhelp">';t.name&&t.help?(n+="<strong>Tool help for "+t.name+"</strong><hr/>",n+=t.help):n+="<strong>Tool help is unavailable for this dataset.</strong><hr/>",n+="</div>",i.$el.find(".details").append(o.parseHTML(n))},a=function(e){o.ajax({url:Galaxy.root+"api/tools/"+e.tool_id+"/build"}).done(function(e){n(e)}).fail(function(){n({})})};return null===Galaxy.user.id?null:s({title:"Tool Help",classes:"icon-btn",href:"#",faIcon:"fa-question",onclick:function(){i.$el.find(".toolhelp").length>0?i.$el.find(".toolhelp").toggle():o.ajax({url:Galaxy.root+"api/jobs/"+t}).done(function(e){a(e)}).fail(function(){console.log('Failed at recovering job information from the Galaxy API for job id "'+t+'".')})}})},_renderSecondaryActions:function(){var t=c.prototype._renderSecondaryActions.call(this);switch(this.model.get("state")){case e.UPLOAD:case e.NOT_VIEWABLE:return t;case e.ERROR:return t.unshift(this._renderErrButton()),t.concat([this._renderRerunButton(),this._renderToolHelpButton()]);case e.OK:case e.FAILED_METADATA:return t.concat([this._renderRerunButton(),this._renderVisualizationsButton(),this._renderToolHelpButton()])}return t.concat([this._renderRerunButton(),this._renderToolHelpButton()])},_renderErrButton:function(){return s({title:l("View or report this error"),href:this.model.urls.report_error,classes:"report-error-btn",target:this.linkTarget,faIcon:"fa-bug"})},_renderRerunButton:function(){var e=this.model.get("creating_job");if(this.model.get("rerunnable"))return s({title:l("Run this job again"),href:this.model.urls.rerun,classes:"rerun-btn",target:this.linkTarget,faIcon:"fa-refresh",onclick:function(t){t.preventDefault(),Galaxy.router.push("/",{job_id:e})}})},_renderVisualizationsButton:function(){var e=this.model.get("visualizations");if(this.model.isDeletedOrPurged()||!this.hasUser||!this.model.hasData()||a.isEmpty(e))return null;if(!a.isObject(e[0]))return this.warn("Visualizations have been switched off"),null;var t=o(this.templates.visualizations(e,this));return t.find('[target="galaxy_main"]').attr("target",this.linkTarget),this._addScratchBookFn(t.find(".visualization-link").addBack(".visualization-link")),t},_addScratchBookFn:function(e){e.click(function(e){Galaxy.frame&&Galaxy.frame.active&&(Galaxy.frame.add({title:"Visualization",url:o(this).attr("href")}),e.preventDefault(),e.stopPropagation())})},_renderTags:function(e){if(this.hasUser){var t=this;this.tagsEditor=new i.TagsEditor({model:this.model,el:e.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.tagsEditorShown=!0},onhide:function(){t.tagsEditorShown=!1},$activator:s({title:l("Edit dataset tags"),classes:"tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".actions .right"))}),this.tagsEditorShown&&this.tagsEditor.toggle(!0)}},_renderAnnotation:function(e){if(this.hasUser){var t=this;this.annotationEditor=new n.AnnotationEditor({model:this.model,el:e.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.annotationEditorShown=!0},onhide:function(){t.annotationEditorShown=!1},$activator:s({title:l("Edit dataset annotation"),classes:"annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".actions .right"))}),this.annotationEditorShown&&this.annotationEditor.toggle(!0)}},_makeDbkeyEditLink:function(e){if("?"===this.model.get("metadata_dbkey")&&!this.model.isDeletedOrPurged()){var t=o('<a class="value">?</a>').attr("href",this.model.urls.edit).attr("target",this.linkTarget);e.find(".dbkey .value").replaceWith(t)}},events:a.extend(a.clone(c.prototype.events),{"click .undelete-link":"_clickUndeleteLink","click .purge-link":"_clickPurgeLink","click .edit-btn":function(e){this.trigger("edit",this,e)},"click .delete-btn":function(e){this.trigger("delete",this,e)},"click .rerun-btn":function(e){this.trigger("rerun",this,e)},"click .report-err-btn":function(e){this.trigger("report-err",this,e)},"click .visualization-btn":function(e){this.trigger("visualize",this,e)},"click .dbkey a":function(e){this.trigger("edit",this,e)}}),_clickUndeleteLink:function(e){return this.model.undelete(),!1},_clickPurgeLink:function(e){return confirm(l("This will permanently remove the data in your dataset. Are you sure?"))&&this.model.purge(),!1},toString:function(){var e=this.model?this.model+"":"(no model)";return"HDAEditView("+e+")"}});return d.prototype.templates=function(){var e=a.extend({},c.prototype.templates.warnings,{failed_metadata:r.wrapTemplate(['<% if( dataset.state === "failed_metadata" ){ %>','<div class="failed_metadata-warning warningmessagesmall">',l("An error occurred setting the metadata for this dataset"),'<br /><a href="<%- dataset.urls.edit %>" target="<%- view.linkTarget %>">',l("Set it manually or retry auto-detection"),"</a>","</div>","<% } %>"],"dataset"),deleted:r.wrapTemplate(["<% if( dataset.deleted && !dataset.purged ){ %>",'<div class="deleted-msg warningmessagesmall">',l("This dataset has been deleted"),'<br /><a class="undelete-link" href="javascript:void(0);">',l("Undelete it"),"</a>","<% if( view.purgeAllowed ){ %>",'<br /><a class="purge-link" href="javascript:void(0);">',l("Permanently remove it from disk"),"</a>","<% } %>","</div>","<% } %>"],"dataset")}),t=r.wrapTemplate(["<% if( visualizations.length === 1 ){ %>",'<a class="visualization-link icon-btn" href="<%- visualizations[0].href %>"',' target="<%- visualizations[0].target %>" title="',l("Visualize in"),' <%- visualizations[0].html %>">','<span class="fa fa-bar-chart-o"></span>',"</a>","<% } else { %>",'<div class="visualizations-dropdown dropdown icon-btn">','<a data-toggle="dropdown" title="',l("Visualize"),'">','<span class="fa fa-bar-chart-o"></span>',"</a>",'<ul class="dropdown-menu" role="menu">',"<% _.each( visualizations, function( visualization ){ %>",'<li><a class="visualization-link" href="<%- visualization.href %>"',' target="<%- visualization.target %>">',"<%- visualization.html %>","</a></li>","<% }); %>","</ul>","</div>","<% } %>"],"visualizations");return a.extend({},c.prototype.templates,{warnings:e,visualizations:t})}(),{DatasetListItemEdit:d}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(11),i(6),i(5)],s=function(e,t,i){"use strict";var n="dataset",s=t.SearchableModelMixin,l=a.Model.extend(t.LoggableMixin).extend(t.mixin(s,{_logNamespace:n,defaults:{state:e.NEW,deleted:!1,purged:!1,name:"(unnamed dataset)",accessible:!0,data_type:"",file_ext:"",file_size:0,meta_files:[],misc_blurb:"",misc_info:"",tags:[]},initialize:function(t,i){this.debug(this+"(Dataset).initialize",t,i),
//!! this state is not in trans.app.model.Dataset.states - set it here -
this.get("accessible")||this.set("state",e.NOT_VIEWABLE),this.urls=this._generateUrls(),this._setUpListeners()},_generateUrls:function(){var e=this.get("id");if(!e)return{};var t={purge:"datasets/"+e+"/purge_async",display:"datasets/"+e+"/display/?preview=True",edit:"datasets/"+e+"/edit",download:"datasets/"+e+"/display"+this._downloadQueryParameters(),report_error:"dataset/errors?id="+e,rerun:"tool_runner/rerun?id="+e,show_params:"datasets/"+e+"/show_params",visualization:"visualization",meta_download:"dataset/get_metadata_file?hda_id="+e+"&metadata_name="};return o.each(t,function(e,i){t[i]=Galaxy.root+e}),this.urls=t,t},_downloadQueryParameters:function(){return"?to_ext="+this.get("file_ext")},_setUpListeners:function(){this.on("change:state",function(e,t){this.log(this+" has changed state:",e,t),this.inReadyState()&&this.trigger("state:ready",e,t,this.previous("state"))}),this.on("change:id change:file_ext",function(e){this._generateUrls()})},toJSON:function(){var e=a.Model.prototype.toJSON.call(this);return o.extend(e,{urls:this.urls})},isDeletedOrPurged:function(){return this.get("deleted")||this.get("purged")},inReadyState:function(){var t=o.contains(e.READY_STATES,this.get("state"));return this.isDeletedOrPurged()||t},hasDetails:function(){return!this.get("accessible")||this.has("annotation")},hasData:function(){return this.get("file_size")>0},fetch:function(e){var t=this;return a.Model.prototype.fetch.call(this,e).always(function(){t._generateUrls()})},parse:function(e,t){var i=a.Model.prototype.parse.call(this,e,t);return i.create_time&&(i.create_time=new Date(i.create_time)),i.update_time&&(i.update_time=new Date(i.update_time)),i},save:function(e,t){return t=t||{},t.wait=!!o.isUndefined(t.wait)||t.wait,a.Model.prototype.save.call(this,e,t)},delete:function(e){return this.get("deleted")?r.when():this.save({deleted:!0},e)},undelete:function(e){return!this.get("deleted")||this.get("purged")?r.when():this.save({deleted:!1},e)},purge:function(e){if(this.get("purged"))return r.when();e=e||{},e.url=this.urls.purge;var t=this,n=r.ajax(e);return n.done(function(e,i,n){t.set({deleted:!0,purged:!0})}),n.fail(function(n,s,a){var o=i("Unable to purge dataset"),r="Removal of datasets by users is not allowed in this Galaxy instance";n.responseJSON&&n.responseJSON.error?o=n.responseJSON.error:n.responseText.indexOf(r)!==-1&&(o=r),n.responseText=o,t.trigger("error",t,n,e,i(o),{error:o})}),n},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var e=this.get("id")||"";return this.get("name")&&(e='"'+this.get("name")+'",'+e),"Dataset("+e+")"}})),c=a.Collection.extend(t.LoggableMixin).extend({_logNamespace:n,model:l,urlRoot:Galaxy.root+"api/datasets",url:function(){return this.urlRoot},ids:function(){return this.map(function(e){return e.get("id")})},notReady:function(){return this.filter(function(e){return!e.inReadyState()})},haveDetails:function(){return this.all(function(e){return e.hasDetails()})},ajaxQueue:function(e,t){var i=r.Deferred(),n=this.length,s=[];if(!n)return i.resolve([]),i;var a=this.chain().reverse().map(function(o,r){return function(){var l=e.call(o,t);l.done(function(e){i.notify({curr:r,total:n,response:e,model:o})}),l.always(function(e){s.push(e),a.length?a.shift()():i.resolve(s)})}}).value();return a.shift()(),i},matches:function(e){return this.filter(function(t){return t.matches(e)})},toString:function(){return["DatasetAssociationCollection(",this.length,")"].join("")}});return{DatasetAssociation:l,DatasetAssociationCollection:c}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r,l){a.ajaxSettings.traditional=!0,n=[i(4),i(116),i(117),i(51)],s=function(e,t,i,n){return o.View.extend({grid:null,initialize:function(t){this.dict_format=t.dict_format;var i=this;window.add_tag_to_grid_filter=function(e,t){var n=e+(void 0!==t&&""!==t?":"+t:""),s=r("#advanced-search").is(":visible");s||(r("#standard-search").slideToggle("fast"),r("#advanced-search").slideToggle("fast")),i.add_filter_condition("tags",n)},this.dict_format?(this.setElement("<div/>"),t.url_base&&!t.items?e.get({url:t.url_base,success:function(e){i.init_grid(e)}}):this.init_grid(t)):(this.setElement("#grid-container"),this.init_grid(t)),t.use_panels&&r("#center").css({padding:"10px",overflow:"auto"})},handle_refresh:function(e){e&&r.inArray("history",e)>-1&&top.Galaxy&&top.Galaxy.currHistoryPanel&&top.Galaxy.currHistoryPanel.loadCurrentHistory()},init_grid:function(e){this.grid=new t(e);var n=this.grid.attributes;this.handle_refresh(n.refresh_frames);var s=this.grid.get("url_base");if(s=s.replace(/^.*\/\/[^\/]+/,""),this.grid.set("url_base",s),this.$el.html(i.grid(n)),this.$el.find("#grid-table-header").html(i.header(n)),this.$el.find("#grid-table-body").html(i.body(n)),this.$el.find("#grid-table-footer").html(i.footer(n)),n.message){this.$el.find("#grid-message").html(i.message(n));var a=this;n.use_hide_message&&setTimeout(function(){a.$el.find("#grid-message").html("")},5e3)}this.init_grid_elements(),this.init_grid_controls(),init_refresh_on_change()},init_grid_controls:function(){var e=this;this.$el.find(".operation-button").each(function(){r(this).off(),r(this).click(function(){return e.submit_operation(this),!1})}),this.$el.find("input[type=text]").each(function(){r(this).off(),r(this).click(function(){r(this).select()}).keyup(function(){r(this).css("font-style","normal")})}),this.$el.find(".sort-link").each(function(){r(this).off(),r(this).click(function(){return e.set_sort_condition(r(this).attr("sort_key")),!1})}),this.$el.find(".text-filter-form").each(function(){r(this).off(),r(this).submit(function(){var t=r(this).attr("column_key"),i=r("#input-"+t+"-filter"),n=i.val();return i.val(""),e.add_filter_condition(t,n),!1})}),this.$el.find(".text-filter-val > a").each(function(){r(this).off(),r(this).click(function(){return r(this).parent().remove(),e.remove_filter_condition(r(this).attr("filter_key"),r(this).attr("filter_val")),!1})}),this.$el.find(".categorical-filter > a").each(function(){r(this).off(),r(this).click(function(){return e.set_categorical_filter(r(this).attr("filter_key"),r(this).attr("filter_val")),!1})}),this.$el.find(".advanced-search-toggle").each(function(){r(this).off(),r(this).click(function(){return e.$el.find("#standard-search").slideToggle("fast"),e.$el.find("#advanced-search").slideToggle("fast"),!1})}),this.$el.find("#check_all").off(),this.$el.find("#check_all").on("click",function(){e.check_all_items()})},init_grid_elements:function(){this.$el.find(".grid").each(function(){var e=r(this).find("input.grid-row-select-checkbox"),t=r(this).find("span.grid-selected-count"),i=function(){t.text(r(e).filter(":checked").length)};r(e).each(function(){r(this).change(i)}),i()}),0!==this.$el.find(".community_rating_star").length&&this.$el.find(".community_rating_star").rating({});var e=this.grid.attributes,t=this;this.$el.find(".page-link > a").each(function(){r(this).click(function(){return t.set_page(r(this).attr("page_num")),!1})}),this.$el.find(".use-target").each(function(){r(this).click(function(e){return t.execute({href:r(this).attr("href"),target:r(this).attr("target")}),!1})});var i=e.items.length;if(0!=i)for(var s in e.items){var a=e.items[s],o=this.$el.find("#grid-"+s+"-popup");o.off();var l=new n(o);for(var c in e.operations){var d=e.operations[c],h=d.label,u=a.operation_config[h];a.encode_id;if(u.allowed&&d.allow_popup){var p={html:d.label,href:u.url_args,target:u.target,confirmation_text:d.confirm};p.func=function(e){e.preventDefault();var i=r(e.target).html(),n=this.findItemByHtml(i);t.execute(n)},l.addItem(p)}}}},add_filter_condition:function(e,t){if(""===t)return!1;this.grid.add_filter(e,t,!0);var n=r(i.filter_element(e,t)),s=this;n.click(function(){r(this).remove(),s.remove_filter_condition(e,t)});var a=this.$el.find("#"+e+"-filtering-criteria");a.append(n),this.go_page_one(),this.execute()},remove_filter_condition:function(e,t){this.grid.remove_filter(e,t),this.go_page_one(),this.execute()},set_sort_condition:function(e){var t=this.grid.get("sort_key"),i=e;t.indexOf(e)!==-1&&"-"!==t.substring(0,1)&&(i="-"+e),this.$el.find(".sort-arrow").remove();var n="-"==i.substring(0,1)?"↑":"↓",s=r("<span>"+n+"</span>").addClass("sort-arrow");this.$el.find("#"+e+"-header").append(s),this.grid.set("sort_key",i),this.go_page_one(),this.execute()},set_categorical_filter:function(e,t){var i=this.grid.get("categorical_filters")[e],n=this.grid.get("filters")[e],s=this;this.$el.find("."+e+"-filter").each(function(){var a=r.trim(r(this).text()),o=i[a],l=o[e];if(l==t)r(this).empty(),r(this).addClass("current-filter"),r(this).append(a);else if(l==n){r(this).empty();var c=r('<a href="#">'+a+"</a>");c.click(function(){s.set_categorical_filter(e,l)}),r(this).removeClass("current-filter"),r(this).append(c)}}),this.grid.add_filter(e,t),this.go_page_one(),this.execute()},set_page:function(e){var t=this;this.$el.find(".page-link").each(function(){var i,n=r(this).attr("id"),s=parseInt(n.split("-")[2],10),a=t.grid.get("cur_page");if(s===e)i=r(this).children().text(),r(this).empty(),r(this).addClass("inactive-link"),r(this).text(i);else if(s===a){i=r(this).text(),r(this).empty(),r(this).removeClass("inactive-link");var o=r('<a href="#">'+i+"</a>");o.click(function(){t.set_page(s)}),r(this).append(o)}}),"all"===e?this.grid.set("cur_page",e):this.grid.set("cur_page",parseInt(e,10)),this.execute()},submit_operation:function(e,t){var i=r(e).val(),n=this.$el.find('input[name="id"]:checked').length;if(!n>0)return!1;var s=l.findWhere(this.grid.attributes.operations,{label:i});s&&!t&&(t=s.confirm||"");var a=[];return this.$el.find("input[name=id]:checked").each(function(){a.push(r(this).val())}),this.execute({operation:i,id:a,confirmation_text:t}),!0},check_all_items:function(){var e,t=document.getElementById("check_all"),i=document.getElementsByTagName("input"),n=0;if(t.checked===!0)for(e=0;e<i.length;e++)i[e].name.indexOf("id")!==-1&&(i[e].checked=!0,n++);else for(e=0;e<i.length;e++)i[e].name.indexOf("id")!==-1&&(i[e].checked=!1);this.init_grid_elements()},go_page_one:function(){var e=this.grid.get("cur_page");null!==e&&void 0!==e&&"all"!==e&&this.grid.set("cur_page",1)},execute:function(e){var t=null,i=null,n=null,s=null,a=null;if(e&&(i=e.href,n=e.operation,t=e.id,s=e.confirmation_text,a=e.target,void 0!==i&&i.indexOf("operation=")!=-1)){var o=i.split("?");if(o.length>1)for(var r=o[1],l=r.split("&"),c=0;c<l.length;c++)l[c].indexOf("operation")!=-1?(n=l[c].split("=")[1],n=n.replace(/\+/g," ")):l[c].indexOf("id")!=-1&&(t=l[c].split("=")[1])}return n&&t?!(s&&""!=s&&"None"!=s&&"null"!=s&&!confirm(s))&&(n=n.toLowerCase(),this.grid.set({operation:n,item_ids:t}),this.grid.can_async_op(n)||this.dict_format?this.update_grid():this.go_to(a,i),!1):i?(this.go_to(a,i),!1):(this.grid.get("async")||this.dict_format?this.update_grid():this.go_to(a,i),!1)},go_to:function(e,t){var i=this.grid.get("async");switch(this.grid.set("async",!1),advanced_search=this.$el.find("#advanced-search").is(":visible"),this.grid.set("advanced_search",advanced_search),t||(t=this.grid.get("url_base")+"?"+r.param(this.grid.get_url_data())),this.grid.set({operation:void 0,item_ids:void 0,async:i}),e){case"inbound":var n=r(".grid-header").closest(".inbound");if(0!==n.length)return void n.load(t);break;case"top":window.top.location=t;break;default:window.location=t}},update_grid:function(){var e=this.grid.get("operation")?"POST":"GET";this.$el.find(".loading-elt-overlay").show();var t=this;r.ajax({type:e,url:t.grid.get("url_base"),data:t.grid.get_url_data(),error:function(e){alert("Grid refresh failed")},success:function(e){var i=t.grid.get("embedded"),n=t.grid.get("insert"),s=t.dict_format?e.embedded_grid||e:r.parseJSON(e);s.embedded=i,s.insert=n,t.init_grid(s),t.$el.find(".loading-elt-overlay").hide()},complete:function(){t.grid.set({operation:void 0,item_ids:void 0})}})}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a){n=[i(38),i(6),i(5)],s=function(e,t,i){"use strict";var n=e.DatasetListItemView,s=n.extend({className:n.prototype.className+" history-content",initialize:function(e,t){n.prototype.initialize.call(this,e,t)},toString:function(){var e=this.model?this.model+"":"(no model)";return"HDAListItemView("+e+")"}});return s.prototype.templates=function(){var e=t.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="hid"><%- dataset.hid %></span> ','<span class="name"><%- dataset.name %></span>',"</div>","</br>",'<span class="nametags">',"<% _.each(_.sortBy(_.uniq(dataset.tags), function(x) { return x }), function(tag){ %>",'<% if (tag.indexOf("name:") == 0){ %>','<span class="label label-info"><%- tag.slice(5) %></span>',"<% } %>","<% }); %>","</span>","</div>"],"dataset"),s=a.extend({},n.prototype.templates.warnings,{hidden:t.wrapTemplate(["<% if( !dataset.visible ){ %>",'<div class="hidden-msg warningmessagesmall">',i("This dataset has been hidden"),"</div>","<% } %>"],"dataset")});return a.extend({},n.prototype.templates,{titleBar:e,warnings:s})}(),{HDAListItemView:s}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a){n=[i(76),i(81),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=e.DatasetAssociation,o=t.HistoryContentMixin,r=s.extend(i.mixin(o,{defaults:a.extend({},s.prototype.defaults,o.defaults,{history_content_type:"dataset",model_class:"HistoryDatasetAssociation"})}));return{HistoryDatasetAssociation:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a){n=[i(11),i(35),i(74),i(6),i(5)],s=function(e,t,i,n,s){"use strict";var o=t.DCListItemView,r=o.extend({className:o.prototype.className+" history-content",_setUpListeners:function(){o.prototype._setUpListeners.call(this),this.listenTo(this.model,{"change:tags change:populated change:visible":function(e,t){this.render()}})},_getFoldoutPanelClass:function(){switch(this.model.get("collection_type")){case"list":return i.ListCollectionView;case"paired":return i.PairCollectionView;case"list:paired":return i.ListOfPairsCollectionView;case"list:list":return i.ListOfListsCollectionView}throw new TypeError("Uknown collection_type: "+this.model.get("collection_type"))},_swapNewRender:function(t){o.prototype._swapNewRender.call(this,t);var i=this.model.get("populated")?e.OK:e.RUNNING;return this.$el.addClass("state-"+i),this.$el},toString:function(){var e=this.model?this.model+"":"(no model)";return"HDCAListItemView("+e+")"}});return r.prototype.templates=function(){var e=a.extend({},o.prototype.templates.warnings,{hidden:n.wrapTemplate(["<% if( !collection.visible ){ %>",'<div class="hidden-msg warningmessagesmall">',s("This collection has been hidden"),"</div>","<% } %>"],"collection")}),t=n.wrapTemplate(['<div class="title-bar clear" tabindex="0">','<span class="state-icon"></span>','<div class="title">','<span class="hid"><%- collection.hid %></span> ','<span class="name"><%- collection.name %></span>',"</div>",'<div class="subtitle"></div>','<span class="nametags">',"<% _.each(_.sortBy(_.uniq(collection.tags), function(x) { return x }), function(tag){ %>",'<% if (tag.indexOf("name:") == 0){ %>','<span class="label label-info"><%- tag.slice(5) %></span>',"<% } %>","<% }); %>","</span>","</div>"],"collection");return a.extend({},o.prototype.templates,{warnings:e,titleBar:t})}(),{HDCAListItemView:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2))},function(e,t,i){var n,s;(function(a){n=[i(11),i(6),i(5)],s=function(e,t,i){"use strict";var n={defaults:{history_id:null,history_content_type:null,hid:null,visible:!0},idAttribute:"type_id",hidden:function(){return!this.get("visible")},isVisible:function(e,t){var i=!0;return e||!this.get("deleted")&&!this.get("purged")||(i=!1),t||this.get("visible")||(i=!1),i},urlRoot:Galaxy.root+"api/histories/",url:function(){var e=this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id");return e},hide:function(e){return this.get("visible")?this.save({visible:!1},e):a.when()},unhide:function(e){return this.get("visible")?a.when():this.save({visible:!0},e)},toString:function(){return[this.get("type_id"),this.get("hid"),this.get("name")].join(":")}};return{HistoryContentMixin:n}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(45),i(46),i(72),i(4),i(6),i(5)],s=function(e,t,i,n,s,c){"use strict";var d=a.Model.extend(s.LoggableMixin).extend(s.mixin(s.SearchableModelMixin,{_logNamespace:"history",UPDATE_DELAY:4e3,defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",deleted:!1,contents_active:{},contents_states:{}},urlRoot:Galaxy.root+"api/histories",contentsClass:e.HistoryContents,searchAttributes:["name","annotation","tags"],searchAliases:{title:"name",tag:"tags"},initialize:function(e,t){t=t||{},this.logger=t.logger||null,this.log(this+".initialize:",e,t),this.contents=new this.contentsClass([],{history:this,historyId:this.get("id"),order:t.order}),this._setUpListeners(),this._setUpCollectionListeners(),this.updateTimeoutId=null},_setUpListeners:function(){return this.on({error:function(e,t,i,n,s){this.clearUpdateTimeout()},"change:id":function(e,t){this.contents&&(this.contents.historyId=t)}})},_setUpCollectionListeners:function(){return this.contents?this.listenTo(this.contents,{error:function(){this.trigger.apply(this,o.makeArray(arguments))}}):this},contentsShown:function(){var e=this.get("contents_active"),t=e.active||0;return t+=this.contents.includeDeleted?e.deleted:0,t+=this.contents.includeHidden?e.hidden:0},nice_size:function(){var e=this.get("size");return e?n.bytesToString(e,!0,2):c("(empty)")},toJSON:function(){return r.extend(a.Model.prototype.toJSON.call(this),{nice_size:this.nice_size()})},get:function(e){return"nice_size"===e?this.nice_size():a.Model.prototype.get.apply(this,arguments)},ownedByCurrUser:function(){return!(!Galaxy||!Galaxy.user)&&(!Galaxy.user.isAnonymous()&&Galaxy.user.id===this.get("user_id"))},numOfUnfinishedJobs:function(){var e=this.get("non_ready_jobs");return e?e.length:0},numOfUnfinishedShownContents:function(){return this.contents.runningAndActive().length||0},_fetchContentRelatedAttributes:function(){var e=["size","non_ready_jobs","contents_active","hid_counter"];return this.fetch({data:l.param({keys:e.join(",")})})},refresh:function(e){e=e||{};var t=this,i=t.lastUpdateTime;this.contents.allFetched=!1;var n=0!==t.contents.currentPage?function(){return t.contents.fetchPage(t.contents.currentPage)}:function(){return t.contents.fetchUpdated(i)};return n().done(function(i,n,s){var a;try{a=new Date(s.getResponseHeader("Date"))}catch(e){}t.lastUpdateTime=a||new Date,t.checkForUpdates(e)})},checkForUpdates:function(e){function t(){n.clearUpdateTimeout(),n.updateTimeoutId=setTimeout(function(){n.refresh(e)},i)}e=e||{};var i=this.UPDATE_DELAY,n=this;if(n.id){var s=this.numOfUnfinishedShownContents();s>0?t():n._fetchContentRelatedAttributes().done(function(e){n.numOfUnfinishedJobs()>0?t():n.trigger("ready")})}},clearUpdateTimeout:function(){this.updateTimeoutId&&(clearTimeout(this.updateTimeoutId),this.updateTimeoutId=null)},parse:function(e,t){var i=a.Model.prototype.parse.call(this,e,t);return i.create_time&&(i.create_time=new Date(i.create_time)),i.update_time&&(i.update_time=new Date(i.update_time)),i},fetchWithContents:function(e,t){e=e||{};var i=this;return e.view="dev-detailed",this.fetch(e).then(function(e){return i.contents.history=i,i.contents.setHistoryId(e.id),i.fetchContents(t)})},fetchContents:function(e){e=e||{};var t=this;return t.lastUpdateTime=new Date,t.contents.fetchCurrentPage(e)},_delete:function(e){return this.get("deleted")?o.when():this.save({deleted:!0},e)},purge:function(e){return this.get("purged")?o.when():this.save({deleted:!0,purged:!0},e)},undelete:function(e){return this.get("deleted")?this.save({deleted:!1},e):o.when()},copy:function(e,t,i){if(e=void 0===e||e,!this.id)throw new Error("You must set the history ID before copying it.");var n={history_id:this.id};e&&(n.current=!0),t&&(n.name=t),i||(n.all_datasets=!1),n.view="dev-detailed";var s=this,a=o.post(this.urlRoot,n);return e?a.then(function(e){var t=new d(e);return t.setAsCurrent().done(function(){s.trigger("copied",s,e)})}):a.done(function(e){s.trigger("copied",s,e)})},setAsCurrent:function(){var e=this,t=o.getJSON(Galaxy.root+"history/set_as_current?id="+this.id);return t.done(function(){e.trigger("set-as-current",e)}),t},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}})),h=i.InfinitelyScrollingCollection,u=h.extend(s.LoggableMixin).extend({_logNamespace:"history",model:d,order:"update_time",limitOnFirstFetch:10,limitPerFetch:10,initialize:function(e,t){t=t||{},this.log("HistoryCollection.initialize",e,t),h.prototype.initialize.call(this,e,t),this.includeDeleted=t.includeDeleted||!1,this.currentHistoryId=t.currentHistoryId,this.setUpListeners()},urlRoot:Galaxy.root+"api/histories",url:function(){return this.urlRoot},setUpListeners:function(){return this.on({"change:deleted":function(e){this.debug("change:deleted",this.includeDeleted,e.get("deleted")),!this.includeDeleted&&e.get("deleted")&&this.remove(e)},copied:function(e,t){this.setCurrent(new d(t,[]))},"set-as-current":function(e){var t=this.currentHistoryId;this.trigger("no-longer-current",t),this.currentHistoryId=e.id}})},_buildFetchData:function(e){return r.extend(h.prototype._buildFetchData.call(this,e),{view:"dev-detailed"})},_buildFetchFilters:function(e){var t=h.prototype._buildFetchFilters.call(this,e)||{},i={};return this.includeDeleted?i.deleted=null:(i.deleted=!1,i.purged=!1),r.defaults(t,i)},fetchFirst:function(e){var t=this,i=l.when();return this.currentHistoryId&&(i=h.prototype.fetchFirst.call(t,{silent:!0,limit:1,filters:{purged:"",deleted:"","encoded_id-in":this.currentHistoryId}})),i.then(function(){return e=e||{},e.offset=0,t.fetchMore(e)})},comparators:r.extend(r.clone(h.prototype.comparators),{name:s.buildComparator("name",{ascending:!0}),"name-dsc":s.buildComparator("name",{ascending:!1}),size:s.buildComparator("size",{ascending:!1}),"size-asc":s.buildComparator("size",{ascending:!0})}),sort:function(e){e=e||{};var t=e.silent,i=this.remove(this.get(this.currentHistoryId));return h.prototype.sort.call(this,r.defaults({silent:!0},e)),this.unshift(i,{silent:!0}),t||this.trigger("sort",this,e),this},create:function(e,t,i,n){var s=this,a=o.getJSON(Galaxy.root+"history/create_new_current");return a.done(function(e){s.setCurrent(new d(e,[],i||{}))})},setCurrent:function(e,t){return t=t||{},this.unshift(e,t),this.currentHistoryId=e.get("id"),t.silent||this.trigger("new-current",e,this),this},toString:function(){return"HistoryCollection("+this.length+",current:"+this.currentHistoryId+")"}});return{History:d,HistoryCollection:u}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(47),i(142),i(6),i(5),i(89)],s=function(e,t,i,n){"use strict";var s="list",l=a.View.extend(i.LoggableMixin).extend({_logNamespace:s,viewClass:e.ListItemView,collectionClass:a.Collection,tagName:"div",className:"list-panel",fxSpeed:"fast",emptyMsg:n("This list is empty"),noneFoundMsg:n("No matching items found"),searchPlaceholder:n("search"),initialize:function(e,t){e=e||{},e.logger&&(this.logger=e.logger),this.log(this+".initialize:",e),this.fxSpeed=o.has(e,"fxSpeed")?e.fxSpeed:this.fxSpeed,this.filters=[],this.searchFor=e.searchFor||"",this.selecting=void 0===e.selecting||e.selecting,this.selected=e.selected||[],this.lastSelected=null,this.dragItems=e.dragItems||!1,this.viewClass=e.viewClass||this.viewClass,this.views=[],this.collection=e.collection||this._createDefaultCollection(),this.filters=e.filters||[],this.$scrollContainer=e.$scrollContainer||this.$scrollContainer,this.title=e.title||"",this.subtitle=e.subtitle||"",this._setUpListeners()},_setUpListeners:function(){return this.off(),this.on({error:function(e,t,i,n,s){console.error(e,t,i,n,s)},loading:function(){this._showLoadingIndicator("loading...",40)},"loading-done":function(){this._hideLoadingIndicator(40)}}),this.once("rendered",function(){this.trigger("rendered:initial",this)}),this._setUpCollectionListeners(),this._setUpViewListeners(),this},_createDefaultCollection:function(){return new this.collectionClass([])},_setUpCollectionListeners:function(){return this.log(this+"._setUpCollectionListeners",this.collection),this.stopListening(this.collection),this.listenTo(this.collection,{error:function(e,t,i,n,s){this.trigger("error",e,t,i,n,s)},update:function(e,t){var i=t.changes;return t.renderAll||i.added.length+i.removed.length>1?this.renderItems():1===i.added.length?this.addItemView(o.first(i.added),e,t):1===i.removed.length?this.removeItemView(o.first(i.removed),e,t):void 0}}),this},_setUpViewListeners:function(){this.log(this+"._setUpViewListeners"),this.on({"view:selected":function(e,t){if(t&&t.shiftKey&&this.lastSelected){var i=this.viewFromModelId(this.lastSelected);i&&this.selectRange(e,i)}else t&&t.altKey&&!this.selecting&&this.showSelectors();this.selected.push(e.model.id),this.lastSelected=e.model.id},"view:de-selected":function(e,t){this.selected=o.without(this.selected,e.model.id)}})},render:function(e){this.log(this+".render",e);var t=this._buildNewRender();return this._setUpBehaviors(t),this._queueNewRender(t,e),this},_buildNewRender:function(){this.debug(this+"(ListPanel)._buildNewRender");var e=r(this.templates.el({},this));return this._renderControls(e),this._renderTitle(e),this._renderSubtitle(e),this._renderSearch(e),this.renderItems(e),e},_renderControls:function(e){this.debug(this+"(ListPanel)._renderControls");var t=r(this.templates.controls({},this));return e.find(".controls").replaceWith(t),t},_renderTitle:function(e){},_renderSubtitle:function(e){},_queueNewRender:function(e,t){t=void 0===t?this.fxSpeed:t;var i=this;i.log("_queueNewRender:",e,t),r(i).queue("fx",[function(e){i.$el.fadeOut(t,e)},function(t){i._swapNewRender(e),t()},function(e){i.$el.fadeIn(t,e)},function(e){i.trigger("rendered",i),e()}])},_swapNewRender:function(e){return this.$el.empty().attr("class",this.className).append(e.children()),this.selecting&&this.showSelectors(0),this},_setUpBehaviors:function(e){return e=e||this.$el,this.$controls(e).find("[title]").tooltip(),this._renderMultiselectActionMenu(e),this},_renderMultiselectActionMenu:function(e){e=e||this.$el;var t=e.find(".list-action-menu"),i=this.multiselectActions();if(!i.length)return t.empty();var s=r(['<div class="list-action-menu btn-group">','<button class="list-action-menu-btn btn btn-default dropdown-toggle" data-toggle="dropdown">',n("For all selected"),"...","</button>",'<ul class="dropdown-menu pull-right" role="menu">',"</ul>","</div>"].join("")),a=i.map(function(e){var t=['<li><a href="javascript:void(0);">',e.html,"</a></li>"].join("");return r(t).click(function(t){return t.preventDefault(),e.func(t)})});return s.find("ul").append(a),t.replaceWith(s),s},multiselectActions:function(){return[]},$scrollContainer:function(e){return(e||this.$el).parent().parent()},$controls:function(e){return(e||this.$el).find("> .controls")},$list:function(e){return(e||this.$el).find("> .list-items")},$messages:function(e){return(e||this.$el).find("> .controls .messages")},$emptyMessage:function(e){return(e||this.$el).find("> .empty-message")},renderItems:function(e){e=e||this.$el;var t=this;t.log(this+".renderItems",e);var i=t.$list(e);t.freeViews();var n=t._filterCollection();return t.views=n.map(function(e){var i=t._createItemView(e);return i}),i.empty(),t.views.length&&t._attachItems(e),t._renderEmptyMessage(e).toggle(!t.views.length),t.trigger("views:ready",t.views),t.views},_filterCollection:function(){var e=this;return e.collection.filter(o.bind(e._filterItem,e))},_filterItem:function(e){var t=this;return o.every(t.filters.map(function(t){return t.call(e)}))&&(!t.searchFor||e.matchesAll(t.searchFor))},_createItemView:function(e){var t=this._getItemViewClass(e),i=o.extend(this._getItemViewOptions(e),{model:e}),n=new t(i);return this._setUpItemViewListeners(n),n},_destroyItemView:function(e){this.stopListening(e),this.views=o.without(this.views,e)},_destroyItemViews:function(e){var t=this;return t.views.forEach(function(e){t.stopListening(e)}),t.views=[],t},freeViews:function(){return this._destroyItemViews()},_getItemViewClass:function(e){return this.viewClass},_getItemViewOptions:function(e){return{fxSpeed:this.fxSpeed,expanded:!1,selectable:this.selecting,selected:o.contains(this.selected,e.id),draggable:this.dragItems}},_setUpItemViewListeners:function(e){var t=this;return this.listenTo(e,"all",function(){var e=Array.prototype.slice.call(arguments,0);e[0]="view:"+e[0],t.trigger.apply(t,e)}),this.listenTo(e,"draggable:dragstart",function(e,t){var i={},n=this.getSelectedModels();i=n.length?n.toJSON():[t.model.toJSON()],e.dataTransfer.setData("text",JSON.stringify(i))},this),t},_attachItems:function(e){var t=this;return this.$list(e).append(this.views.map(function(e){return t._renderItemView$el(e)})),this},_renderItemView$el:function(e){return e.render(0).$el},_renderEmptyMessage:function(e){this.debug("_renderEmptyMessage",e,this.searchFor);var t=this.searchFor?this.noneFoundMsg:this.emptyMsg;return this.$emptyMessage(e).text(t)},expandAll:function(){o.each(this.views,function(e){e.expand()})},collapseAll:function(){o.each(this.views,function(e){e.collapse()})},addItemView:function(e,t,i){var n=this,s=n._filterCollection().indexOf(e);if(s!==-1){var a=n._createItemView(e);return r(a).queue("fx",[function(e){n.$emptyMessage().is(":visible")?n.$emptyMessage().fadeOut(n.fxSpeed,e):e()},function(e){n._attachView(a,s),e()}]),a}},_attachView:function(e,t,i){i=!!o.isUndefined(i)||i,t=t||0;var n=this;return n.views.splice(t,0,e),n._insertIntoListAt(t,n._renderItemView$el(e).hide()),n.trigger("view:attached",e),i?e.$el.slideDown(n.fxSpeed,function(){n.trigger("view:attached:rendered")}):(e.$el.show(),n.trigger("view:attached:rendered")),e},_insertIntoListAt:function(e,t){var i=this.$list();return 0===e?i.prepend(t):i.children().eq(e-1).after(t),t},removeItemView:function(e,t,i){var n=this,s=o.find(n.views,function(t){return t.model===e});if(s)return n.views=o.without(n.views,s),n.trigger("view:removed",s),r({}).queue("fx",[function(e){s.$el.fadeOut(n.fxSpeed,e)},function(e){s.remove(),n.trigger("view:removed:rendered"),n.views.length?e():n._renderEmptyMessage().fadeIn(n.fxSpeed,e)}]),s},viewFromModelId:function(e){return o.find(this.views,function(t){return t.model.id===e})},viewFromModel:function(e){return e?this.viewFromModelId(e.id):void 0},viewsWhereModel:function(e){return this.views.filter(function(t){return o.isMatch(t.model.attributes,e)})},viewRange:function(e,t){if(e===t)return e?[e]:[];var i=this.views.indexOf(e),n=this.views.indexOf(t);return i===-1||n===-1?i===n?[]:i===-1?[t]:[e]:i<n?this.views.slice(i,n+1):this.views.slice(n,i+1)},_renderSearch:function(e){return e.find(".controls .search-input").searchInput({placeholder:this.searchPlaceholder,initialVal:this.searchFor,onfirstsearch:o.bind(this._firstSearch,this),onsearch:o.bind(this.searchItems,this),onclear:o.bind(this.clearSearch,this)}),e},_firstSearch:function(e){return this.log("onFirstSearch",e),this.searchItems(e)},searchItems:function(e,t){if(this.log("searchItems",e,this.searchFor,t),!t&&this.searchFor===e)return this;this.searchFor=e,this.renderItems(),this.trigger("search:searching",e,this);var i=this.$("> .controls .search-query");return i.val()!==e&&i.val(e),this},clearSearch:function(e){return this.searchFor="",this.trigger("search:clear",this),this.$("> .controls .search-query").val(""),this.renderItems(),this},THROTTLE_SELECTOR_FX_AT:20,
showSelectors:function(e){e=void 0!==e?e:this.fxSpeed,this.selecting=!0,this.$(".list-actions").slideDown(e),e=this.views.length>=this.THROTTLE_SELECTOR_FX_AT?0:e,o.each(this.views,function(t){t.showSelector(e)})},hideSelectors:function(e){e=void 0!==e?e:this.fxSpeed,this.selecting=!1,this.$(".list-actions").slideUp(e),e=this.views.length>=this.THROTTLE_SELECTOR_FX_AT?0:e,o.each(this.views,function(t){t.hideSelector(e)}),this.selected=[],this.lastSelected=null},toggleSelectors:function(){this.selecting?this.hideSelectors():this.showSelectors()},selectAll:function(e){o.each(this.views,function(t){t.select(e)})},deselectAll:function(e){this.lastSelected=null,o.each(this.views,function(t){t.deselect(e)})},selectRange:function(e,t){var i=this.viewRange(e,t);return o.each(i,function(e){e.select()}),i},getSelectedViews:function(){return o.filter(this.views,function(e){return e.selected})},getSelectedModels:function(){return new this.collection.constructor(o.map(this.getSelectedViews(),function(e){return e.model}))},_showLoadingIndicator:function(e,i,n){this.debug("_showLoadingIndicator",this.indicator,e,i,n),i=void 0!==i?i:this.fxSpeed,this.indicator||(this.indicator=new t(this.$el),this.debug("\t created",this.indicator)),this.$el.is(":visible")?(this.$el.fadeOut(i),this.indicator.show(e,i,n)):this.indicator.show(0,n)},_hideLoadingIndicator:function(e,t){this.debug("_hideLoadingIndicator",this.indicator,e,t),e=void 0!==e?e:this.fxSpeed,this.indicator&&this.indicator.hide(e,t)},scrollPosition:function(){return this.$scrollContainer().scrollTop()},scrollTo:function(e,t){return t=t||0,this.$scrollContainer().animate({scrollTop:e},t),this},scrollToTop:function(e){return this.scrollTo(0,e)},scrollToItem:function(e,t){return e?this:this},scrollToId:function(e,t){return this.scrollToItem(this.viewFromModelId(e),t)},events:{"click .select-all":"selectAll","click .deselect-all":"deselectAll"},toString:function(){return"ListPanel("+this.collection+")"}});l.prototype.templates=function(){var e=i.wrapTemplate(["<div>",'<div class="controls"></div>','<div class="list-items"></div>','<div class="empty-message infomessagesmall"></div>',"</div>"]),t=i.wrapTemplate(['<div class="controls">','<div class="title">','<div class="name"><%- view.title %></div>',"</div>",'<div class="subtitle"><%- view.subtitle %></div>','<div class="actions"></div>','<div class="messages"></div>','<div class="search">','<div class="search-input"></div>',"</div>",'<div class="list-actions">','<div class="btn-group">','<button class="select-all btn btn-default"','data-mode="select">',n("All"),"</button>",'<button class="deselect-all btn btn-default"','data-mode="select">',n("None"),"</button>","</div>",'<div class="list-action-menu btn-group">',"</div>","</div>","</div>"]);return{el:e,controls:t}}();var c=l.extend({modelCollectionKey:"contents",initialize:function(e){l.prototype.initialize.call(this,e),this.selecting=void 0!==e.selecting&&e.selecting,this.setModel(this.model,e)},setModel:function(e,t){if(t=t||{},this.debug(this+".setModel:",e,t),this.freeModel(),this.freeViews(),e){var i=this.model?this.model.get("id"):null;this.model=e,this.logger&&(this.model.logger=this.logger),this._setUpModelListeners(),this.stopListening(this.collection),this.collection=this.model[this.modelCollectionKey]||t.collection||this._createDefaultCollection(),this._setUpCollectionListeners(),i&&e.get("id")!==i&&this.trigger("new-model",this)}return this},freeModel:function(){return this.model&&this.stopListening(this.model),this},_setUpModelListeners:function(){return this.log(this+"._setUpModelListeners",this.model),this.listenTo(this.model,"error",function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("error"),this.trigger.apply(this,e)},this),this.logger&&this.listenTo(this.model,"all",function(e){this.info(this+"(model)",e,arguments)}),this},_renderControls:function(e){this.debug(this+"(ModelListPanel)._renderControls");var t=this.model?this.model.toJSON():{},i=r(this.templates.controls(t,this));return e.find(".controls").replaceWith(i),i},toString:function(){return"ModelListPanel("+this.model+")"}});return c.prototype.templates=function(){var e=i.wrapTemplate(['<div class="controls">','<div class="title">','<div class="name"><%- model.name %></div>',"</div>",'<div class="subtitle"><%- view.subtitle %></div>','<div class="actions"></div>','<div class="messages"></div>','<div class="search">','<div class="search-input"></div>',"</div>",'<div class="list-actions">','<div class="btn-group">','<button class="select-all btn btn-default"','data-mode="select">',n("All"),"</button>",'<button class="deselect-all btn btn-default"','data-mode="select">',n("None"),"</button>","</div>",'<div class="list-action-menu btn-group">',"</div>","</div>","</div>"]);return o.extend(o.clone(l.prototype.templates),{controls:e})}(),{ListPanel:l,ModelListPanel:c}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},,function(e,t,i){var n,s;(function(a,o){n=[i(5)],s=function(e){"use strict";function t(t,i,n){return Galaxy.modal.show({title:i,body:t,closing_events:!0,buttons:{Ok:function(){Galaxy.modal.hide()}}}),Galaxy.modal.$el.addClass("error-modal"),n&&(Galaxy.modal.$(".error-details").add(Galaxy.modal.$('button:contains("Details")')).remove(),a("<div/>").addClass("error-details").hide().appendTo(Galaxy.modal.$(".modal-content")).append([a("<p/>").text(h),a("<pre/>").text(JSON.stringify(n,null," "))]),a('<button id="button-1" class="pull-left">'+e("Details")+"</button>").appendTo(Galaxy.modal.$(".buttons")).click(function(){Galaxy.modal.$(".error-details").toggle()})),Galaxy.modal}function i(i,n,s){if(i){if(i=e(i),n=e(n)||e("Error:"),window.Galaxy&&Galaxy.modal)return t(i,n,s);alert(n+"\n\n"+i),console.log("error details:",JSON.stringify(s))}}function n(){return i(e("You appear to be offline. Please check your connection and try again."),e("Offline?"))}function s(){return i(e("Galaxy is currently unreachable. Please try again in a few minutes.")+" "+c,e("Cannot connect to Galaxy"))}function r(t,n,s,a,o){a=a||d,a+=" "+c,o=o||e("An error occurred");var r=l(t,n,s);return i(a,o,r)}function l(e,t,i){return{raven:o.result(window.Raven,"lastEventId"),userAgent:navigator.userAgent,onLine:navigator.onLine,version:o.result(Galaxy.config,"version_major"),xhr:o.omit(t,o.functions(t)),options:o.omit(i,"xhr"),url:o.result(Galaxy.lastAjax,"url"),data:o.result(Galaxy.lastAjax,"data"),model:o.result(e,"toJSON",e+""),user:o.omit(o.result(Galaxy.user,"toJSON"),"email")}}var c=e("Please contact a Galaxy administrator if the problem persists."),d=e("An error occurred while updating information with the server."),h=e("The following information can assist the developers in finding the source of the error:");return{errorModal:i,offlineErrorModal:n,badGatewayErrorModal:s,ajaxErrorModal:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(2))},,,function(e,t,i){var n,s,a;(function(i,o){!function(i){s=[],n=i,a="function"==typeof n?n.apply(t,s):n,!(void 0!==a&&(e.exports=a))}(function(){i.fn.extend({hoverhighlight:function(e,t){return e=e||"body",this.length?(o(this).each(function(){var i=o(this),n=i.data("target");n&&i.mouseover(function(i){o(n,e).css({background:t})}).mouseout(function(e){o(n).css({background:""})})}),this):this}})})}).call(t,i(1),i(1))},function(e,t,i){var n,s,a;(function(i,o){!function(i){s=[],n=i,a="function"==typeof n?n.apply(t,s):n,!(void 0!==a&&(e.exports=a))}(function(){function e(e,n){function s(e){var t=i(this).parent().children("input");t.val("").trigger("searchInput.clear").blur(),n.onclear()}function a(e,t){return t?(i(this).trigger("search.search",t),void("function"==typeof n.onfirstsearch&&g?(g=!1,n.onfirstsearch(t)):n.onsearch(t))):s()}function r(){return['<input type="text" name="',n.name,'" placeholder="',n.placeholder,'" ','class="search-query ',n.classes,'" ',"/>"].join("")}function l(){return i(r()).focus(function(e){i(this).select()}).keyup(function(e){if(e.preventDefault(),e.stopPropagation(),e.which===u&&n.escWillClear)s.call(this,e);else{var t=i(this).val();(e.which===p||n.minSearchLen&&t.length>=n.minSearchLen)&&a.call(this,e,t)}}).val(n.initialVal)}function c(){return i(['<span class="search-clear fa fa-times-circle" ','title="',t("clear search (esc)"),'"></span>'].join("")).tooltip({placement:"bottom"}).click(function(e){s.call(this,e)})}function d(){return i(['<span class="search-loading fa fa-spinner fa-spin" ','title="',t("loading..."),'"></span>'].join("")).hide().tooltip({placement:"bottom"})}function h(){f.find(".search-loading").toggle(),f.find(".search-clear").toggle()}var u=27,p=13,f=i(e),g=!0,m={initialVal:"",name:"search",placeholder:"search",classes:"",onclear:function(){},onfirstsearch:null,onsearch:function(e){},minSearchLen:0,escWillClear:!0,oninit:function(){}};return"string"===o.type(n)?("toggle-loading"===n&&h(),f):("object"===o.type(n)&&(n=o.extend(!0,{},m,n)),f.addClass("search-input").prepend([l(),c(),d()]))}var t=window._l||function(e){return e};o.fn.extend({searchInput:function(t){return this.each(function(){return e(this,t)})}})})}).call(t,i(1),i(1))},,function(e,t,i){var n,s;n=[],s=function(){function e(e,t){var i=/(-?[0-9\.]+)/g,n=e.toString().toLowerCase()||"",s=t.toString().toLowerCase()||"",a=String.fromCharCode(0),o=n.replace(i,a+"$1"+a).split(a),r=s.replace(i,a+"$1"+a).split(a),l=new Date(n).getTime(),c=l?new Date(s).getTime():null;if(c){if(l<c)return-1;if(l>c)return 1}for(var d,h,u=0,p=Math.max(o.length,r.length);u<p;u++){if(d=parseFloat(o[u])||o[u],h=parseFloat(r[u])||r[u],d<h)return-1;if(d>h)return 1}return 0}return e}.apply(t,n),!(void 0!==s&&(e.exports=s))},,,function(e,t,i){(function(t){var n=i(7),s=i(125);CurrentHistoryView=i(122).CurrentHistoryView,_l=i(5);var a=t.View.extend({initialize:function(e,i){var s=this;this.userIsAnonymous=Galaxy.user.isAnonymous(),this.allow_user_dataset_purge=i.config.allow_user_dataset_purge,this.root=i.root,this.historyView=new CurrentHistoryView({className:CurrentHistoryView.prototype.className+" middle",purgeAllowed:this.allow_user_dataset_purge,linkTarget:"galaxy_main"}),Galaxy.currHistoryPanel=this.historyView,Galaxy.currHistoryPanel.listenToGalaxy(Galaxy),this.buttonRefresh=new n.ButtonLink({id:"history-refresh-button",title:"Refresh history",cls:"panel-header-button",icon:"fa fa-refresh",onclick:function(){s.historyView.loadCurrentHistory()}}),this.buttonOptions=new n.ButtonLink({id:"history-options-button",title:"History options",cls:"panel-header-button",target:"galaxy_main",icon:"fa fa-cog",href:this.root+"root/history_options"}),this.buttonViewMulti=new n.ButtonLink({id:"history-view-multi-button",title:"View all histories",cls:"panel-header-button",icon:"fa fa-columns",href:this.root+"history/view_multiple"}),this.model=new t.Model({cls:"history-right-panel",title:_l("History"),buttons:[this.buttonRefresh,this.buttonOptions,this.buttonViewMulti]}),this.setElement(this._template()),this.historyView.setElement(this.$el),this.historyView.connectToQuotaMeter(Galaxy.quotaMeter),this.historyView.loadCurrentHistory(),Galaxy.listenTo(this.historyView,"history-size-change",function(){Galaxy.user.fetch({url:Galaxy.user.urlRoot()+"/"+(Galaxy.user.id||"current")})})},render:function(){this.optionsMenu=s(this.buttonOptions.$el,{anonymous:this.userIsAnonymous,purgeAllowed:this.allow_user_dataset_purge,root:this.root}),this.buttonViewMulti.$el[this.userIsAnonymous?"hide":"show"]()},_template:function(e){return['<div id="current-history-panel" class="history-panel middle"/>'].join("")},toString:function(){return"historyPanel"}});e.exports=a}).call(t,i(3))},function(e,t,i){(function(t,n){var s=i(50),a=i(134),o=i(5),r=t.View.extend({initialize:function(e,i){var n=i.config;this.root=i.root,this.stored_workflow_menu_entries=n.stored_workflow_menu_entries||[];var r=new s.ToolSearch({hidden:!1}),l=new s.ToolCollection(n.toolbox);this.tool_panel=new s.ToolPanel({tool_search:r,tools:l,layout:n.toolbox_in_panel}),this.tool_panel_view=new s.ToolPanelView({model:this.tool_panel}),this.upload_button=new a({nginx_upload_path:n.nginx_upload_path,ftp_upload_site:n.ftp_upload_site,default_genome:n.default_genome,default_extension:n.default_extension}),Galaxy.upload=this.upload_button,this.model=new t.Model({title:o("Tools"),buttons:[this.upload_button]}),this.setElement(this._template())},render:function(){var e=this;this.tool_panel.get("layout").size()>0&&(this.$el.prepend(this.tool_panel_view.$el),this.tool_panel_view.render()),e.$("#internal-workflows").append(e._templateAllWorkflow({title:o("All workflows"),href:"workflow"})),n.each(this.stored_workflow_menu_entries,function(t){e.$("#internal-workflows").append(e._templateTool({title:t.stored_workflow.name,href:"workflow/run?id="+t.encoded_stored_workflow_id}))})},_templateTool:function(e){return['<div class="toolTitle">','<a href="',this.root,e.href,'" target="galaxy_main">',e.title,"</a>","</div>"].join("")},_templateAllWorkflow:function(e){return['<div class="toolTitle">','<a href="',Galaxy.root,e.href,'">',e.title,"</a>","</div>"].join("")},_template:function(){return['<div class="toolMenuContainer">','<div class="toolMenu" style="display: none">','<div id="search-no-results" style="display: none; padding-top: 5px">',"<em><strong>",o("Search did not match any tools."),"</strong></em>","</div>","</div>",'<div class="toolSectionPad"/>','<div class="toolSectionPad"/>','<div class="toolSectionTitle" id="title_XXinternalXXworkflow">',"<span>",o("Workflows"),"</span>","</div>",'<div id="internal-workflows" class="toolSectionBody">','<div class="toolSectionBg"/>',"</div>","</div>"].join("")},toString:function(){return"toolPanel"}});e.exports=r}).call(t,i(3),i(2))},,,,,,,,,,,,,,,,,function(e,t,i){var n,s;(function(a,o){n=[i(35),i(75),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=e.DCListItemView,r=s.extend({initialize:function(e){s.prototype.initialize.call(this,e)},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCListItemEdit("+e+")"}}),l=e.DCEListItemView,c=l.extend({initialize:function(e){l.prototype.initialize.call(this,e)},toString:function(){var e=this.model?this.model+"":"(no model)";return"DCEListItemEdit("+e+")"}}),d=t.DatasetListItemEdit.extend({initialize:function(e){t.DatasetListItemEdit.prototype.initialize.call(this,e)},_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):a.when()},_renderDeleteButton:function(){return null},toString:function(){var e=this.model?this.model+"":"(no model)";return"DatasetDCEListItemEdit("+e+")"}});d.prototype.templates=function(){return o.extend({},t.DatasetListItemEdit.prototype.templates,{titleBar:e.DatasetDCEListItemView.prototype.templates.titleBar})}();var h=e.NestedDCDCEListItemView.extend({toString:function(){var e=this.model?this.model+"":"(no model)";return"NestedDCDCEListItemEdit("+e+")"}});return{DCListItemEdit:r,DCEListItemEdit:c,DatasetDCEListItemEdit:d,NestedDCDCEListItemEdit:h}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(2))},function(e,t,i){var n,s;n=[i(74),i(36),i(112),i(6),i(48),i(17),i(5),i(16)],s=function(e,t,i,n,s,a,o){"use strict";var r=e.CollectionView,l=r.extend({DatasetDCEViewClass:i.DatasetDCEListItemEdit,NestedDCDCEViewClass:i.NestedDCDCEListItemEdit,initialize:function(e){r.prototype.initialize.call(this,e)},_setUpBehaviors:function(e){if(e=e||this.$el,r.prototype._setUpBehaviors.call(this,e),this.model&&Galaxy.user&&!Galaxy.user.isAnonymous()){this.tagsEditorShown=!0;var t=this,i="> .controls .name";e.find(i).attr("title",o("Click to rename collection")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(e){var n=t.model.get("name");e&&e!==n?(t.$el.find(i).text(e),t.model.save({name:e}).fail(function(){t.$el.find(i).text(t.model.previous("name"))})):t.$el.find(i).text(n)}}),this.tagsEditor=new s.TagsEditor({model:this.model,el:e.find(".tags-display"),onshowFirstTime:function(){this.render()},usePrompt:!1}),this.tagsEditor.toggle(!0)}},toString:function(){return"CollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),c=l.extend({DatasetDCEViewClass:i.DatasetDCEListItemEdit,toString:function(){return"ListCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),d=c.extend({toString:function(){return"PairCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),h=d.extend({_setUpBehaviors:function(e){r.prototype._setUpBehaviors.call(this,e)},toString:function(){return"NestedPairCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),u=l.extend({NestedDCDCEViewClass:i.NestedDCDCEListItemEdit.extend({foldoutPanelClass:h}),toString:function(){return"ListOfPairsCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}}),p=l.extend({NestedDCDCEViewClass:i.NestedDCDCEListItemEdit.extend({foldoutPanelClass:h}),toString:function(){return"ListOfListsCollectionViewEdit("+(this.model?this.model.get("name"):"")+")"}});return{CollectionViewEdit:l,ListCollectionViewEdit:c,PairCollectionViewEdit:d,ListOfPairsCollectionViewEdit:u,ListOfListsCollectionViewEdit:p}}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;(function(a,o,r,l){n=[i(146),i(91),i(73),i(6),i(5),i(88)],s=function(e,t,i,n,s){"use strict";function c(e){function t(){return i.length||(i=[new RegExp(this.filters[0]),new RegExp(this.filters[1])]),i}e=e||{},e.createPair=e.createPair||function(e){e=e||{};var t=e.listA.splice(e.indexA,1)[0],i=e.listB.splice(e.indexB,1)[0],n=e.listB.indexOf(t),s=e.listA.indexOf(i);return n!==-1&&e.listB.splice(n,1),s!==-1&&e.listA.splice(s,1),this._pair(t,i,{silent:!0})};var i=[];return e.preprocessMatch=e.preprocessMatch||function(e){var i=t.call(this);return o.extend(e,{matchTo:e.matchTo.name.replace(i[0],""),possible:e.possible.name.replace(i[1],"")})},function(t){this.debug("autopair _strategy ---------------------------"),t=t||{};var i,n=t.listA,s=t.listB,a=0,o={score:0,index:null},r=[];for(this.debug("starting list lens:",n.length,s.length),this.debug("bestMatch (starting):",JSON.stringify(o,null," "));a<n.length;){var l=n[a];for(o.score=0,i=0;i<s.length;i++){var c=s[i];if(this.debug(a+":"+l.name),this.debug(i+":"+c.name),n[a]!==s[i]&&(o=e.match.call(this,e.preprocessMatch.call(this,{matchTo:l,possible:c,index:i,bestMatch:o})),this.debug("bestMatch:",JSON.stringify(o,null," ")),1===o.score)){this.debug("breaking early due to perfect match");break}}var d=e.scoreThreshold.call(this);if(this.debug("scoreThreshold:",d),this.debug("bestMatch.score:",o.score),o.score>=d?r.push(e.createPair.call(this,{listA:n,indexA:a,listB:s,indexB:o.index})):a+=1,!n.length||!s.length)return r}return this.debug("paired:",JSON.stringify(r,null," ")),this.debug("autopair _strategy ---------------------------"),r}}function d(e,t){var i=e.toJSON();return f(i,{historyId:e.historyId,defaultHideSourceItems:t})}var h="collections",u=a.View.extend(n.LoggableMixin).extend({_logNamespace:h,tagName:"li",className:"dataset paired",initialize:function(e){this.pair=e.pair||{}},template:o.template(['<span class="forward-dataset-name flex-column"><%- pair.forward.name %></span>','<span class="pair-name-column flex-column">','<span class="pair-name"><%- pair.name %></span>',"</span>",'<span class="reverse-dataset-name flex-column"><%- pair.reverse.name %></span>'].join("")),render:function(){return this.$el.attr("draggable",!0).data("pair",this.pair).html(this.template({pair:this.pair})).addClass("flex-column-container"),this},events:{dragstart:"_dragstart",dragend:"_dragend",dragover:"_sendToParent",drop:"_sendToParent"},_dragstart:function(e){e.currentTarget.style.opacity="0.4",e.originalEvent&&(e=e.originalEvent),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",JSON.stringify(this.pair)),this.$el.parent().trigger("pair.dragstart",[this])},_dragend:function(e){e.currentTarget.style.opacity="1.0",this.$el.parent().trigger("pair.dragend",[this])},_sendToParent:function(e){this.$el.parent().trigger(e)},toString:function(){return"PairView("+this.pair.name+")"}}),p=a.View.extend(n.LoggableMixin).extend(i.CollectionCreatorMixin).extend({_logNamespace:h,className:"list-of-pairs-collection-creator collection-creator flex-row-container",initialize:function(e){this.metric("PairedCollectionCreator.initialize",e),e=o.defaults(e,{datasets:[],filters:this.DEFAULT_FILTERS,automaticallyPair:!0,strategy:"lcs",matchPercentage:.9,twoPassAutopairing:!0}),this.initialList=e.datasets,this.historyId=e.historyId,this.filters=this.commonFilters[e.filters]||this.commonFilters[this.DEFAULT_FILTERS],o.isArray(e.filters)&&(this.filters=e.filters),this.automaticallyPair=e.automaticallyPair,this.strategy=this.strategies[e.strategy]||this.strategies[this.DEFAULT_STRATEGY],o.isFunction(e.strategy)&&(this.strategy=e.strategy),this.matchPercentage=e.matchPercentage,this.twoPassAutopairing=e.twoPassAutopairing,this.removeExtensions=!0,this.oncancel=e.oncancel,this.oncreate=e.oncreate,this.autoscrollDist=e.autoscrollDist||24,this.unpairedPanelHidden=!1,this.pairedPanelHidden=!1,this.$dragging=null,this.blocking=!1,this._setUpCommonSettings(e),this._setUpBehaviors(),this._dataSetUp()},commonFilters:{illumina:["_1","_2"],Rs:["_R1","_R2"]},DEFAULT_FILTERS:"illumina",strategies:{simple:"autopairSimple",lcs:"autopairLCS",levenshtein:"autopairLevenshtein"},DEFAULT_STRATEGY:"lcs",_dataSetUp:function(){this.paired=[],this.unpaired=[],this.selectedIds=[],this._sortInitialList(),this._ensureIds(),this.unpaired=this.initialList.slice(0),this.automaticallyPair&&(this.autoPair(),this.once("rendered:initial",function(){this.trigger("autopair")}))},_sortInitialList:function(){this._sortDatasetList(this.initialList)},_sortDatasetList:function(e){return e.sort(function(e,i){return t(e.name,i.name)}),e},_ensureIds:function(){return this.initialList.forEach(function(e){e.hasOwnProperty("id")||(e.id=o.uniqueId())}),this.initialList},_splitByFilters:function(){function e(e,t){return t.test(e.name)}var t=this.filters.map(function(e){return new RegExp(e)}),i=[[],[]];return this.unpaired.forEach(function(n){t.forEach(function(t,s){e(n,t)&&i[s].push(n)})}),i},_addToUnpaired:function(e){var i=function(n,s){if(n===s)return n;var a=Math.floor((s-n)/2)+n,o=t(e.name,this.unpaired[a].name);if(o<0)return i(n,a);if(o>0)return i(a+1,s);for(;this.unpaired[a]&&this.unpaired[a].name===e.name;)a++;return a}.bind(this);this.unpaired.splice(i(0,this.unpaired.length),0,e)},autoPair:function(e){var t=this._splitByFilters(),i=[];return this.twoPassAutopairing&&(i=this.autopairSimple({listA:t[0],listB:t[1]}),t=this._splitByFilters()),e=e||this.strategy,t=this._splitByFilters(),i=i.concat(this[e].call(this,{listA:t[0],listB:t[1]}))},autopairSimple:c({scoreThreshold:function(){return 1},match:function(e){return e=e||{},e.matchTo===e.possible?{index:e.index,score:1}:e.bestMatch}}),autopairLevenshtein:c({scoreThreshold:function(){return this.matchPercentage},match:function(t){t=t||{};var i=e(t.matchTo,t.possible),n=1-i/Math.max(t.matchTo.length,t.possible.length);return n>t.bestMatch.score?{index:t.index,score:n}:t.bestMatch}}),autopairLCS:c({scoreThreshold:function(){return this.matchPercentage},match:function(e){e=e||{};var t=this._naiveStartingAndEndingLCS(e.matchTo,e.possible).length,i=t/Math.max(e.matchTo.length,e.possible.length);return i>e.bestMatch.score?{index:e.index,score:i}:e.bestMatch}}),_naiveStartingAndEndingLCS:function(e,t){for(var i="",n="",s=0,a=0;s<e.length&&s<t.length&&e[s]===t[s];)i+=e[s],s+=1;if(s===e.length)return e;if(s===t.length)return t;for(s=e.length-1,a=t.length-1;s>=0&&a>=0&&e[s]===t[a];)n=[e[s],n].join(""),s-=1,a-=1;return i+n},_pair:function(e,t,i){i=i||{},this.debug("_pair:",e,t);var n=this._createPair(e,t,i.name);return this.paired.push(n),this.unpaired=o.without(this.unpaired,e,t),i.silent||this.trigger("pair:new",n),n},_createPair:function(e,t,i){if(!e||!t||e===t)throw new Error("Bad pairing: "+[JSON.stringify(e),JSON.stringify(t)]);return i=i||this._guessNameForPair(e,t),{forward:e,name:i,reverse:t}},_guessNameForPair:function(e,t,i){i=void 0!==i?i:this.removeExtensions;var n=e.name,s=t.name,a=this._naiveStartingAndEndingLCS(n.replace(new RegExp(this.filters[0]),""),s.replace(new RegExp(this.filters[1]),""));if(i){var o=a.lastIndexOf(".");if(o>0){var r=a.slice(o,a.length);a=a.replace(r,""),n=n.replace(r,""),s=s.replace(r,"")}}return a||n+" & "+s},_unpair:function(e,t){if(t=t||{},!e)throw new Error("Bad pair: "+JSON.stringify(e));return this.paired=o.without(this.paired,e),this._addToUnpaired(e.forward),this._addToUnpaired(e.reverse),t.silent||this.trigger("pair:unpair",[e]),e},unpairAll:function(){for(var e=[];this.paired.length;)e.push(this._unpair(this.paired[0],{silent:!0}));this.trigger("pair:unpair",e)},_pairToJSON:function(e,t){return t=t||"hda",{collection_type:"paired",src:"new_collection",name:e.name,element_identifiers:[{name:"forward",id:e.forward.id,src:t},{name:"reverse",id:e.reverse.id,src:t}]}},createList:function(e){var t=this,i=Galaxy.root+"api/histories/"+this.historyId+"/contents/dataset_collections",n={type:"dataset_collection",collection_type:"list:paired",hide_source_items:t.hideOriginals||!1,name:o.escape(e||t.$(".collection-name").val()),element_identifiers:t.paired.map(function(e){return t._pairToJSON(e)})};return t.blocking=!0,r.ajax(i,{type:"POST",contentType:"application/json",dataType:"json",data:JSON.stringify(n)}).always(function(){t.blocking=!1}).fail(function(e,i,n){t._ajaxErrHandler(e,i,n)}).done(function(e,i,n){t.trigger("collection:created",e,i,n),t.metric("collection:created",e),"function"==typeof t.oncreate&&t.oncreate.call(this,e,i,n)})},_ajaxErrHandler:function(e,t,i){this.error(e,t,i);var n=s("An error occurred while creating this collection");e&&(n+=0===e.readyState&&0===e.status?": "+s("Galaxy could not be reached and may be updating.")+s(" Try again in a few minutes."):e.responseJSON?"<br /><pre>"+JSON.stringify(e.responseJSON)+"</pre>":": "+i),creator._showAlert(n,"alert-danger")},render:function(e,t){return this.$el.empty().html(this.templates.main()),this._renderHeader(e),this._renderMiddle(e),this._renderFooter(e),this._addPluginComponents(),this.trigger("rendered",this),this},_renderHeader:function(e,t){var i=this.$(".header").empty().html(this.templates.header()).find(".help-content").prepend(l(this.templates.helpContent()));return this._renderFilters(),i},_renderFilters:function(){return this.$(".forward-column .column-header input").val(this.filters[0]).add(this.$(".reverse-column .column-header input").val(this.filters[1]))},_renderMiddle:function(e,t){var i=this.$(".middle").empty().html(this.templates.middle());return this.unpairedPanelHidden?this.$(".unpaired-columns").hide():this.pairedPanelHidden&&this.$(".paired-columns").hide(),this._renderUnpaired(),this._renderPaired(),i},_renderUnpaired:function(e,t){var i,n,a=this,o=[],r=this._splitByFilters();return this.$(".forward-column .title").text([r[0].length,s("unpaired forward")].join(" ")),this.$(".forward-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-r[0].length)),this.$(".reverse-column .title").text([r[1].length,s("unpaired reverse")].join(" ")),this.$(".reverse-column .unpaired-info").text(this._renderUnpairedDisplayStr(this.unpaired.length-r[1].length)),this.$(".unpaired-columns .column-datasets").empty(),this.$(".autopair-link").toggle(0!==this.unpaired.length),0===this.unpaired.length?void this._renderUnpairedEmpty():(n=r[1].map(function(e,t){return void 0!==r[0][t]&&r[0][t]!==e&&o.push(a._renderPairButton()),a._renderUnpairedDataset(e)}),i=r[0].map(function(e){return a._renderUnpairedDataset(e)}),i.length||n.length?(this.$(".unpaired-columns .forward-column .column-datasets").append(i).add(this.$(".unpaired-columns .paired-column .column-datasets").append(o)).add(this.$(".unpaired-columns .reverse-column .column-datasets").append(n)),void this._adjUnpairedOnScrollbar()):void this._renderUnpairedNotShown())},_renderUnpairedDisplayStr:function(e){return["(",e," ",s("filtered out"),")"].join("")},_renderUnpairedDataset:function(e){return l("<li/>").attr("id","dataset-"+e.id).addClass("dataset unpaired").attr("draggable",!0).addClass(e.selected?"selected":"").append(l("<span/>").addClass("dataset-name").text(e.name)).data("dataset",e)},_renderPairButton:function(){return l("<li/>").addClass("dataset unpaired").append(l("<span/>").addClass("dataset-name").text(s("Pair these datasets")))},_renderUnpairedEmpty:function(){var e=l('<div class="empty-message"></div>').text("("+s("no remaining unpaired datasets")+")");return this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(e),e},_renderUnpairedNotShown:function(){var e=l('<div class="empty-message"></div>').text("("+s("no datasets were found matching the current filters")+")");return this.$(".unpaired-columns .paired-column .column-datasets").empty().prepend(e),e},_adjUnpairedOnScrollbar:function(){var e=this.$(".unpaired-columns").last(),t=this.$(".unpaired-columns .reverse-column .dataset").first();if(t.length){var i=e.offset().left+e.outerWidth(),n=t.offset().left+t.outerWidth(),s=Math.floor(i)-Math.floor(n);this.$(".unpaired-columns .forward-column").css("margin-left",s>0?s:0)}},_renderPaired:function(e,t){if(this.$(".paired-column-title .title").text([this.paired.length,s("paired")].join(" ")),this.$(".unpair-all-link").toggle(0!==this.paired.length),0===this.paired.length)return void this._renderPairedEmpty();this.$(".remove-extensions-link").show(),this.$(".paired-columns .column-datasets").empty();var i=this;this.paired.forEach(function(e,t){var n=new u({pair:e});i.$(".paired-columns .column-datasets").append(n.render().$el).append(['<button class="unpair-btn">','<span class="fa fa-unlink" title="',s("Unpair"),'"></span>',"</button>"].join(""))})},_renderPairedEmpty:function(){var e=l('<div class="empty-message"></div>').text("("+s("no paired datasets yet")+")");return this.$(".paired-columns .column-datasets").empty().prepend(e),e},footerSettings:{".hide-originals":"hideOriginals",".remove-extensions":"removeExtensions"},_addPluginComponents:function(){this._chooseFiltersPopover(".choose-filters-link"),this.$(".help-content i").hoverhighlight(".collection-creator","rgba( 64, 255, 255, 1.0 )")},_chooseFiltersPopover:function(e){function t(e,t){return['<button class="filter-choice btn" ','data-forward="',e,'" data-reverse="',t,'">',s("Forward"),": ",e,", ",s("Reverse"),": ",t,"</button>"].join("")}var i=l(o.template(['<div class="choose-filters">','<div class="help">',s("Choose from the following filters to change which unpaired reads are shown in the display"),":</div>",o.values(this.commonFilters).map(function(e){return t(e[0],e[1])}).join(""),"</div>"].join(""))({}));return this.$(e).popover({container:".collection-creator",placement:"bottom",html:!0,content:i})},_validationWarning:function(e,t){var i="validation-warning";"name"===e&&(e=this.$(".collection-name").add(this.$(".collection-name-prompt")),this.$(".collection-name").focus().select()),t?(e=e||this.$("."+i),e.removeClass(i)):e.addClass(i)},_setUpBehaviors:function(){return this.once("rendered",function(){this.trigger("rendered:initial",this)}),this.on("pair:new",function(){this._renderUnpaired(),this._renderPaired(),this.$(".paired-columns").scrollTop(8e6)}),this.on("pair:unpair",function(e){this._renderUnpaired(),this._renderPaired(),this.splitView()}),this.on("filter-change",function(){this.filters=[this.$(".forward-unpaired-filter input").val(),this.$(".reverse-unpaired-filter input").val()],this.metric("filter-change",this.filters),this._renderFilters(),this._renderUnpaired()}),this.on("autopair",function(){this._renderUnpaired(),this._renderPaired();var e,t=null;this.paired.length?(t="alert-success",e=this.paired.length+" "+s("pairs created"),this.unpaired.length||(e+=": "+s("all datasets have been successfully paired"),this.hideUnpaired(),this.$(".collection-name").focus())):e=s(["Could not automatically create any pairs from the given dataset names.","You may want to choose or enter different filters and try auto-pairing again.","Close this message using the X on the right to view more help."].join(" ")),
this._showAlert(e,t)}),this},events:{"click .more-help":"_clickMoreHelp","click .less-help":"_clickLessHelp","click .main-help":"_toggleHelp","click .header .alert button":"_hideAlert","click .forward-column .column-title":"_clickShowOnlyUnpaired","click .reverse-column .column-title":"_clickShowOnlyUnpaired","click .unpair-all-link":"_clickUnpairAll","change .forward-unpaired-filter input":function(e){this.trigger("filter-change")},"focus .forward-unpaired-filter input":function(e){l(e.currentTarget).select()},"click .autopair-link":"_clickAutopair","click .choose-filters .filter-choice":"_clickFilterChoice","click .clear-filters-link":"_clearFilters","change .reverse-unpaired-filter input":function(e){this.trigger("filter-change")},"focus .reverse-unpaired-filter input":function(e){l(e.currentTarget).select()},"click .forward-column .dataset.unpaired":"_clickUnpairedDataset","click .reverse-column .dataset.unpaired":"_clickUnpairedDataset","click .paired-column .dataset.unpaired":"_clickPairRow","click .unpaired-columns":"clearSelectedUnpaired","mousedown .unpaired-columns .dataset":"_mousedownUnpaired","click .paired-column-title":"_clickShowOnlyPaired","mousedown .flexible-partition-drag":"_startPartitionDrag","click .paired-columns .dataset.paired":"selectPair","click .paired-columns":"clearSelectedPaired","click .paired-columns .pair-name":"_clickPairName","click .unpair-btn":"_clickUnpair","dragover .paired-columns .column-datasets":"_dragoverPairedColumns","drop .paired-columns .column-datasets":"_dropPairedColumns","pair.dragstart .paired-columns .column-datasets":"_pairDragstart","pair.dragend .paired-columns .column-datasets":"_pairDragend","change .remove-extensions":function(e){this.toggleExtensions()},"change .collection-name":"_changeName","keydown .collection-name":"_nameCheckForEnter","change .hide-originals":"_changeHideOriginals","click .cancel-create":"_cancelCreate","click .create-collection":"_clickCreate"},_clickShowOnlyUnpaired:function(e){this.$(".paired-columns").is(":visible")?this.hidePaired():this.splitView()},_clickShowOnlyPaired:function(e){this.$(".unpaired-columns").is(":visible")?this.hideUnpaired():this.splitView()},hideUnpaired:function(e,t){this.unpairedPanelHidden=!0,this.pairedPanelHidden=!1,this._renderMiddle(e,t)},hidePaired:function(e,t){this.unpairedPanelHidden=!1,this.pairedPanelHidden=!0,this._renderMiddle(e,t)},splitView:function(e,t){return this.unpairedPanelHidden=this.pairedPanelHidden=!1,this._renderMiddle(e,t),this},_clickUnpairAll:function(e){this.metric("unpairAll"),this.unpairAll()},_clickAutopair:function(e){var t=this.autoPair();this.metric("autopair",t.length,this.unpaired.length),this.trigger("autopair")},_clickFilterChoice:function(e){var t=l(e.currentTarget);this.$(".forward-unpaired-filter input").val(t.data("forward")),this.$(".reverse-unpaired-filter input").val(t.data("reverse")),this._hideChooseFilters(),this.trigger("filter-change")},_hideChooseFilters:function(){this.$(".choose-filters-link").popover("hide"),this.$(".popover").css("display","none")},_clearFilters:function(e){this.$(".forward-unpaired-filter input").val(""),this.$(".reverse-unpaired-filter input").val(""),this.trigger("filter-change")},_clickUnpairedDataset:function(e){return e.stopPropagation(),this.toggleSelectUnpaired(l(e.currentTarget))},toggleSelectUnpaired:function(e,t){t=t||{};var i=e.data("dataset"),n=void 0!==t.force?t.force:!e.hasClass("selected");return e.length&&void 0!==i?(n?(e.addClass("selected"),t.waitToPair||this.pairAllSelected()):e.removeClass("selected"),e):e},pairAllSelected:function(e){e=e||{};var t=this,i=[],n=[],s=[];return t.$(".unpaired-columns .forward-column .dataset.selected").each(function(){i.push(l(this).data("dataset"))}),t.$(".unpaired-columns .reverse-column .dataset.selected").each(function(){n.push(l(this).data("dataset"))}),i.length=n.length=Math.min(i.length,n.length),i.forEach(function(e,i){try{s.push(t._pair(e,n[i],{silent:!0}))}catch(e){t.error(e)}}),s.length&&!e.silent&&this.trigger("pair:new",s),s},clearSelectedUnpaired:function(){this.$(".unpaired-columns .dataset.selected").removeClass("selected")},_mousedownUnpaired:function(e){if(e.shiftKey){var t=this,i=l(e.target).addClass("selected"),n=function(e){t.$(e.target).filter(".dataset").addClass("selected")};i.parent().on("mousemove",n),l(document).one("mouseup",function(e){i.parent().off("mousemove",n),t.pairAllSelected()})}},_clickPairRow:function(e){var t=l(e.currentTarget).index(),i=l(".unpaired-columns .forward-column .dataset").eq(t).data("dataset"),n=l(".unpaired-columns .reverse-column .dataset").eq(t).data("dataset");this._pair(i,n)},_startPartitionDrag:function(e){function t(e){n.$(".flexible-partition-drag").css("color",""),l("body").css("cursor","").unbind("mousemove",i)}function i(e){var t=e.pageY-s;n.adjPartition(t)||l("body").trigger("mouseup"),n._adjUnpairedOnScrollbar(),s+=t}var n=this,s=e.pageY;l("body").css("cursor","ns-resize"),n.$(".flexible-partition-drag").css("color","black"),l("body").mousemove(i),l("body").one("mouseup",t)},adjPartition:function(e){var t=this.$(".unpaired-columns"),i=this.$(".paired-columns"),n=parseInt(t.css("height"),10),s=parseInt(i.css("height"),10);n=Math.max(10,n+e),s-=e;var a=e<0;if(a){if(this.unpairedPanelHidden)return!1;if(n<=10)return this.hideUnpaired(),!1}else this.unpairedPanelHidden&&(t.show(),this.unpairedPanelHidden=!1);if(a)this.pairedPanelHidden&&(i.show(),this.pairedPanelHidden=!1);else{if(this.pairedPanelHidden)return!1;if(s<=15)return this.hidePaired(),!1}return t.css({height:n+"px",flex:"0 0 auto"}),!0},selectPair:function(e){e.stopPropagation(),l(e.currentTarget).toggleClass("selected")},clearSelectedPaired:function(e){this.$(".paired-columns .dataset.selected").removeClass("selected")},_clickPairName:function(e){e.stopPropagation();var t=l(e.currentTarget),i=t.parent().parent(),n=i.index(".dataset.paired"),s=this.paired[n],a=prompt("Enter a new name for the pair:",s.name);a&&(s.name=a,s.customizedName=!0,t.text(s.name))},_clickUnpair:function(e){var t=Math.floor(l(e.currentTarget).index(".unpair-btn"));this._unpair(this.paired[t])},_dragoverPairedColumns:function(e){e.preventDefault();var t=this.$(".paired-columns .column-datasets");this._checkForAutoscroll(t,e.originalEvent.clientY);var i=this._getNearestPairedDatasetLi(e.originalEvent.clientY);l(".element-drop-placeholder").remove();var n=l('<div class="element-drop-placeholder"></div>');i.length?i.before(n):t.append(n)},_checkForAutoscroll:function(e,t){var i=2,n=e.offset(),s=e.scrollTop(),a=t-n.top,o=n.top+e.outerHeight()-t;a>=0&&a<this.autoscrollDist?e.scrollTop(s-i):o>=0&&o<this.autoscrollDist&&e.scrollTop(s+i)},_getNearestPairedDatasetLi:function(e){for(var t=4,i=this.$(".paired-columns .column-datasets li").toArray(),n=0;n<i.length;n++){var s=l(i[n]),a=s.offset().top,o=Math.floor(s.outerHeight()/2)+t;if(a+o>e&&a-o<e)return s}return l()},_dropPairedColumns:function(e){e.preventDefault(),e.dataTransfer.dropEffect="move";var t=this._getNearestPairedDatasetLi(e.originalEvent.clientY);return t.length?this.$dragging.insertBefore(t):this.$dragging.insertAfter(this.$(".paired-columns .unpair-btn").last()),this._syncPairsToDom(),!1},_syncPairsToDom:function(){var e=[];this.$(".paired-columns .dataset.paired").each(function(){e.push(l(this).data("pair"))}),this.paired=e,this._renderPaired()},_pairDragstart:function(e,t){t.$el.addClass("selected");var i=this.$(".paired-columns .dataset.selected");this.$dragging=i},_pairDragend:function(e,t){l(".element-drop-placeholder").remove(),this.$dragging=null},toggleExtensions:function(e){var t=this;t.removeExtensions=void 0!==e?e:!t.removeExtensions,o.each(t.paired,function(e){e.customizedName||(e.name=t._guessNameForPair(e.forward,e.reverse))}),t._renderPaired(),t._renderFooter()},_printList:function(e){var t=this;o.each(e,function(i){e===t.paired&&t._printPair(i)})},_printPair:function(e){this.debug(e.forward.name,e.reverse.name,": ->",e.name)},toString:function(){return"PairedCollectionCreator"},templates:o.extend({},i.CollectionCreatorMixin._creatorTemplates,{header:o.template(['<div class="main-help well clear">','<a class="more-help" href="javascript:void(0);">',s("More help"),"</a>",'<div class="help-content">','<a class="less-help" href="javascript:void(0);">',s("Less"),"</a>","</div>","</div>",'<div class="alert alert-dismissable">','<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>','<span class="alert-message"></span>',"</div>",'<div class="column-headers vertically-spaced flex-column-container">','<div class="forward-column flex-column column">','<div class="column-header">','<div class="column-title">','<span class="title">',s("Unpaired forward"),"</span>",'<span class="title-info unpaired-info"></span>',"</div>",'<div class="unpaired-filter forward-unpaired-filter pull-left">','<input class="search-query" placeholder="',s("Filter this list"),'" />',"</div>","</div>","</div>",'<div class="paired-column flex-column no-flex column">','<div class="column-header">','<a class="choose-filters-link" href="javascript:void(0)">',s("Choose filters"),"</a>",'<a class="clear-filters-link" href="javascript:void(0);">',s("Clear filters"),"</a><br />",'<a class="autopair-link" href="javascript:void(0);">',s("Auto-pair"),"</a>","</div>","</div>",'<div class="reverse-column flex-column column">','<div class="column-header">','<div class="column-title">','<span class="title">',s("Unpaired reverse"),"</span>",'<span class="title-info unpaired-info"></span>',"</div>",'<div class="unpaired-filter reverse-unpaired-filter pull-left">','<input class="search-query" placeholder="',s("Filter this list"),'" />',"</div>","</div>","</div>","</div>"].join("")),middle:o.template(['<div class="unpaired-columns flex-column-container scroll-container flex-row">','<div class="forward-column flex-column column">','<ol class="column-datasets"></ol>',"</div>",'<div class="paired-column flex-column no-flex column">','<ol class="column-datasets"></ol>',"</div>",'<div class="reverse-column flex-column column">','<ol class="column-datasets"></ol>',"</div>","</div>",'<div class="flexible-partition">','<div class="flexible-partition-drag" title="',s("Drag to change"),'"></div>','<div class="column-header">','<div class="column-title paired-column-title">','<span class="title"></span>',"</div>",'<a class="unpair-all-link" href="javascript:void(0);">',s("Unpair all"),"</a>","</div>","</div>",'<div class="paired-columns flex-column-container scroll-container flex-row">','<ol class="column-datasets"></ol>',"</div>"].join("")),footer:o.template(['<div class="attributes clear">','<div class="clear">','<label class="setting-prompt pull-right">',s("Hide original elements"),"?",'<input class="hide-originals pull-right" type="checkbox" />',"</label>",'<label class="setting-prompt pull-right">',s("Remove file extensions from pair names"),"?",'<input class="remove-extensions pull-right" type="checkbox" />',"</label>","</div>",'<div class="clear">','<input class="collection-name form-control pull-right" ','placeholder="',s("Enter a name for your new list"),'" />','<div class="collection-name-prompt pull-right">',s("Name"),":</div>","</div>","</div>",'<div class="actions clear vertically-spaced">','<div class="other-options pull-left">','<button class="cancel-create btn" tabindex="-1">',s("Cancel"),"</button>",'<div class="create-other btn-group dropup">','<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">',s("Create a different kind of collection"),' <span class="caret"></span>',"</button>",'<ul class="dropdown-menu" role="menu">','<li><a href="#">',s("Create a <i>single</i> pair"),"</a></li>",'<li><a href="#">',s("Create a list of <i>unpaired</i> datasets"),"</a></li>","</ul>","</div>","</div>",'<div class="main-options pull-right">','<button class="create-collection btn btn-primary">',s("Create list"),"</button>","</div>","</div>"].join("")),helpContent:o.template(["<p>",s(["Collections of paired datasets are ordered lists of dataset pairs (often forward and reverse reads). ","These collections 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, choose which datasets are paired, ","and re-order the final collection."].join("")),"</p>","<p>",s(['Unpaired datasets are shown in the <i data-target=".unpaired-columns">unpaired section</i> ',"(hover over the underlined words to highlight below). ",'Paired datasets are shown in the <i data-target=".paired-columns">paired section</i>.',"<ul>To pair datasets, you can:","<li>Click a dataset in the ",'<i data-target=".unpaired-columns .forward-column .column-datasets,','.unpaired-columns .forward-column">forward column</i> ',"to select it then click a dataset in the ",'<i data-target=".unpaired-columns .reverse-column .column-datasets,','.unpaired-columns .reverse-column">reverse column</i>.',"</li>",'<li>Click one of the "Pair these datasets" buttons in the ','<i data-target=".unpaired-columns .paired-column .column-datasets,','.unpaired-columns .paired-column">middle column</i> ',"to pair the datasets in a particular row.","</li>",'<li>Click <i data-target=".autopair-link">"Auto-pair"</i> ',"to have your datasets automatically paired based on name.","</li>","</ul>"].join("")),"</p>","<p>",s(["<ul>You can filter what is shown in the unpaired sections by:","<li>Entering partial dataset names in either the ",'<i data-target=".forward-unpaired-filter input">forward filter</i> or ','<i data-target=".reverse-unpaired-filter input">reverse filter</i>.',"</li>","<li>Choosing from a list of preset filters by clicking the ",'<i data-target=".choose-filters-link">"Choose filters" link</i>.',"</li>","<li>Entering regular expressions to match dataset names. See: ",'<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions"',' target="_blank">MDN\'s JavaScript Regular Expression Tutorial</a>. ',"Note: forward slashes (\\) are not needed.","</li>","<li>Clearing the filters by clicking the ",'<i data-target=".clear-filters-link">"Clear filters" link</i>.',"</li>","</ul>"].join("")),"</p>","<p>",s(["To unpair individual dataset pairs, click the ",'<i data-target=".unpair-btn">unpair buttons ( <span class="fa fa-unlink"></span> )</i>. ','Click the <i data-target=".unpair-all-link">"Unpair all" link</i> to unpair all pairs.'].join("")),"</p>","<p>",s(['You can include or remove the file extensions (e.g. ".fastq") from your pair names by toggling the ','<i data-target=".remove-extensions-prompt">"Remove file extensions from pair names?"</i> control.'].join("")),"</p>","<p>",s(['Once your collection is complete, enter a <i data-target=".collection-name">name</i> and ','click <i data-target=".create-collection">"Create list"</i>. ',"(Note: you do not have to pair all unpaired datasets to finish.)"].join("")),"</p>"].join(""))})}),f=function(e,t){var i,n=r.Deferred();if(t=o.defaults(t||{},{datasets:e,oncancel:function(){Galaxy.modal.hide(),n.reject("cancelled")},oncreate:function(e,t){Galaxy.modal.hide(),n.resolve(t)}}),!window.Galaxy||!Galaxy.modal)throw new Error("Galaxy or Galaxy.modal not found");return i=new p(t),Galaxy.modal.show({title:"Create a collection of paired datasets",body:i.$el,width:"80%",height:"800px",closing_events:!0}),i.render(),window.creator=i,n};return{PairedCollectionCreator:p,pairedCollectionCreatorModal:f,createListOfPairsCollection:d}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(37),i(44),i(6),i(5)],s=function(e,t,i,n){"use strict";function s(e,t){var i=e.toJSON(),n=u(i,{defaultHideSourceItems:t,creationFn:function(t,i,n){return t=[{name:"forward",src:"hda",id:t[0].id},{name:"reverse",src:"hda",id:t[1].id}],e.createHDCA(t,"paired",i,n)}});return n}var l="collections",c=a.View.extend(i.LoggableMixin).extend({_logNamespace:l,tagName:"li",className:"collection-element",initialize:function(e){this.element=e.element||{},this.identifier=e.identifier},render:function(){return this.$el.attr("data-element-id",this.element.id).html(this.template({identifier:this.identifier,element:this.element})),this},template:o.template(['<span class="identifier"><%- identifier %></span>','<span class="name"><%- element.name %></span>'].join("")),destroy:function(){this.off(),this.$el.remove()},toString:function(){return"DatasetCollectionElementView()"}}),d=e.ListCollectionCreator,h=d.extend({elementViewClass:c,collectionClass:t.HistoryPairDatasetCollection,className:"pair-collection-creator collection-creator flex-row-container",_mangleDuplicateNames:function(){},render:function(e,t){return 2===this.workingElements.length?d.prototype.render.call(this,e,t):this._renderInvalid(e,t)},_renderList:function(e,t){var i=this,n=r("<div/>"),s=i.$list();o.each(this.elementViews,function(e){e.destroy(),i.removeElementView(e)}),n.append(i._createForwardElementView().$el),n.append(i._createReverseElementView().$el),s.empty().append(n.children()),o.invoke(i.elementViews,"render")},_createForwardElementView:function(){return this._createElementView(this.workingElements[0],{identifier:"forward"})},_createReverseElementView:function(){return this._createElementView(this.workingElements[1],{identifier:"reverse"})},_createElementView:function(e,t){var i=new this.elementViewClass(o.extend(t,{element:e}));return this.elementViews.push(i),i},swap:function(){this.workingElements=[this.workingElements[1],this.workingElements[0]],this._renderList()},events:o.extend(o.clone(d.prototype.events),{"click .swap":"swap"}),templates:o.extend(o.clone(d.prototype.templates),{middle:o.template(['<div class="collection-elements-controls">','<a class="swap" href="javascript:void(0);" title="',n("Swap forward and reverse datasets"),'">',n("Swap"),"</a>","</div>",'<div class="collection-elements scroll-container flex-row">',"</div>"].join("")),helpContent:o.template(["<p>",n(["Pair collections are permanent collections containing two datasets: one forward and one reverse. ","Often these are forward and reverse reads. The pair collections can be passed to tools and ","workflows in order to have analyses done on both datasets. This interface allows ","you to create a pair, name it, and swap which is forward and which reverse."].join("")),"</p>","<ul>","<li>",n(['Click the <i data-target=".swap">"Swap"</i> link to make your forward dataset the reverse ',"and the reverse dataset forward."].join("")),"</li>","<li>",n(['Click the <i data-target=".cancel-create">"Cancel"</i> button to exit the interface.'].join("")),"</li>","</ul><br />","<p>",n(['Once your collection is complete, enter a <i data-target=".collection-name">name</i> and ','click <i data-target=".create-collection">"Create list"</i>.'].join("")),"</p>"].join("")),invalidInitial:o.template(['<div class="header flex-row no-flex">','<div class="alert alert-warning" style="display: block">','<span class="alert-message">',"<% if( _.size( problems ) ){ %>",n("The following selections could not be included due to problems"),"<ul><% _.each( problems, function( problem ){ %>","<li><b><%- problem.element.name %></b>: <%- problem.text %></li>","<% }); %></ul>","<% } else if( _.size( elements ) === 0 ){ %>",n("No datasets were selected"),".","<% } else if( _.size( elements ) === 1 ){ %>",n("Only one dataset was selected"),": <%- elements[0].name %>","<% } else if( _.size( elements ) > 2 ){ %>",n("Too many datasets were selected"),': <%- _.pluck( elements, "name" ).join( ", ") %>',"<% } %>","<br />",n("Two (and only two) elements are needed for the pair"),". ",n("You may need to "),'<a class="cancel-create" href="javascript:void(0)">',n("cancel"),"</a> ",n("and reselect new elements"),".","</span>","</div>","</div>",'<div class="footer flex-row no-flex">','<div class="actions clear vertically-spaced">','<div class="other-options pull-left">','<button class="cancel-create btn" tabindex="-1">',n("Cancel"),"</button>","</div>","</div>","</div>"].join(""))}),toString:function(){return"PairCollectionCreator"}}),u=function(t,i){return i=i||{},i.title=n("Create a collection from a pair of datasets"),e.collectionCreatorModal(t,i,h)};return{PairCollectionCreator:h,pairCollectionCreatorModal:u,createPairCollection:s}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(i,a,o){n=[],s=function(){return i.Model.extend({defaults:{url_base:"",async:!1,async_ops:[],categorical_filters:[],filters:{},sort_key:null,show_item_checkboxes:!1,advanced_search:!1,cur_page:1,num_pages:1,operation:void 0,item_ids:void 0},can_async_op:function(e){return a.indexOf(this.attributes.async_ops,e)!==-1},add_filter:function(e,t,i){if(i){var n,s=this.attributes.filters[e];if(null===s||void 0===s)n=t;else if("string"==typeof s)if("All"==s)n=t;else{var a=[];a[0]=s,a[1]=t,n=a}else n=s,n.push(t);this.attributes.filters[e]=n}else this.attributes.filters[e]=t},remove_filter:function(e,t){var i=this.attributes.filters[e];if(null===i||void 0===i)return!1;if("string"==typeof i)this.attributes.filters[e]="";else{var n=a.indexOf(i,t);n!==-1&&(i[n]="")}},get_url_data:function(){var e={async:this.attributes.async,sort:this.attributes.sort_key,page:this.attributes.cur_page,show_item_checkboxes:this.attributes.show_item_checkboxes,advanced_search:this.attributes.advanced_search};this.attributes.operation&&(e.operation=this.attributes.operation),this.attributes.item_ids&&(e.id=this.attributes.item_ids);var t=this;return a.each(a.pairs(t.attributes.filters),function(t){e["f-"+t[0]]=t[1]}),e},get_url:function(e){return this.get("url_base")+"?"+o.param(this.get_url_data())+"&"+o.param(e)}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,n){var s,a;(function(o){s=[n(4)],a=function(e){return{grid:function(e){var t="";return t=e.embedded?this.grid_header(e)+this.grid_table(e):'<div class="loading-elt-overlay"></div><table><tr><td width="75%">'+this.grid_header(e)+'</td><td></td><td></td></tr><tr><td width="100%" id="grid-message" valign="top"></td><td></td><td></td></tr></table>'+this.grid_table(e),e.info_text&&(t+='<br><div class="toolParamHelp" style="clear: both;">'+e.info_text+"</div>"),t},grid_table:function(e){return'<form method="post" onsubmit="return false;"><table id="grid-table" class="grid"><thead id="grid-table-header"></thead><tbody id="grid-table-body"></tbody><tfoot id="grid-table-footer"></tfoot></table></form>'},grid_header:function(e){var t='<div class="grid-header">';if(e.embedded||(t+="<h2>"+e.title+"</h2>"),e.global_actions){t+='<ul class="manage-table-actions">';var n=e.global_actions.length>=3;n&&(t+='<li><a class="action-button" id="popup-global-actions" class="menubutton">Actions</a></li><div popupmenu="popup-global-actions">');for(i in e.global_actions){var s=e.global_actions[i];t+='<li><a class="action-button use-target" target="'+s.target+'" href="'+s.url_args+'" onclick="return false;" >'+s.label+"</a></li>"}n&&(t+="</div>"),t+="</ul>"}return e.insert&&(t+=e.insert),t+=this.grid_filters(e),t+="</div>"},header:function(e){var t="<tr>";e.show_item_checkboxes&&(t+="<th>",e.items.length>0&&(t+='<input type="checkbox" id="check_all" name=select_all_checkbox value="true"><input type="hidden" name=select_all_checkbox value="true">'),t+="</th>");for(var i in e.columns){var n=e.columns[i];n.visible&&(t+='<th id="'+n.key+'-header">',t+=n.href?'<a href="'+n.href+'" class="sort-link" sort_key="'+n.key+'">'+n.label+"</a>":n.label,t+='<span class="sort-arrow">'+n.extra+"</span></th>")}return t+="</tr>"},body:function(e){var t="",i=0,n=e.items.length;0==n&&(t+='<tr><td colspan="100"><em>No Items</em></td></tr>',i=1);for(var s in e.items){var a=e.items[s],r=a.encode_id;t+="<tr ",e.current_item_id==a.id&&(t+='class="current"'),t+=">",e.show_item_checkboxes&&(t+='<td style="width: 1.5em;"><input type="checkbox" name="id" value="'+r+'" id="'+r+'" class="grid-row-select-checkbox" /></td>');for(j in e.columns){var l=e.columns[j];if(l.visible){var c="";l.nowrap&&(c='style="white-space:nowrap;"');var d=a.column_config[l.label],h=d.link,u=d.value,p=d.target;"string"===o.type(u)&&(u=u.replace(/\/\//g,"/"));var f="",g="";l.attach_popup&&(f="grid-"+s+"-popup",g="menubutton",""!=h&&(g+=" split"),g+=" popup"),t+="<td "+c+">",h?(0!=e.operations.length&&(t+='<div id="'+f+'" class="'+g+'" style="float: left;">'),t+='<a class="menubutton-label use-target" target="'+p+'" href="'+h+'" onclick="return false;">'+u+"</a>",0!=e.operations.length&&(t+="</div>")):t+='<div id="'+f+'" class="'+g+'"><label id="'+l.label_id_prefix+r+'" for="'+r+'">'+(u||"")+"</label></div>",t+="</td>"}}t+="</tr>",i++}return t},footer:function(e){var t="";if(e.use_paging&&e.num_pages>1){var n=e.num_page_links,s=e.cur_page_num,a=e.num_pages,o=n/2,r=s-o,l=0;r<=0&&(r=1,l=o-(s-r));var c=o+l,d=s+c;d<=a?max_offset=0:(d=a,max_offset=c-(d+1-s)),0!=max_offset&&(r-=max_offset,r<1&&(r=1)),t+='<tr id="page-links-row">',e.show_item_checkboxes&&(t+="<td></td>"),t+='<td colspan="100"><span id="page-link-container">Page:',r>1&&(t+='<span class="page-link" id="page-link-1"><a href="javascript:void(0);" page_num="1" onclick="return false;">1</a></span> ...');for(var h=r;h<d+1;h++)t+=h==e.cur_page_num?'<span class="page-link inactive-link" id="page-link-'+h+'">'+h+"</span>":'<span class="page-link" id="page-link-'+h+'"><a href="javascript:void(0);" onclick="return false;" page_num="'+h+'">'+h+"</a></span>";d<a&&(t+='...<span class="page-link" id="page-link-'+a+'"><a href="javascript:void(0);" onclick="return false;" page_num="'+a+'">'+a+"</a></span>"),t+="</span>",t+='<span class="page-link" id="show-all-link-span"> | <a href="javascript:void(0);" onclick="return false;" page_num="all">Show All</a></span></td></tr>'}if(e.show_item_checkboxes){t+='<tr><input type="hidden" id="operation" name="operation" value=""><td></td><td colspan="100">For <span class="grid-selected-count"></span> selected items: ';for(i in e.operations){var u=e.operations[i];u.allow_multiple&&(t+='<input type="button" value="'+u.label+'" class="operation-button action-button"> ')}t+="</td></tr>"}var p=!1;for(i in e.operations)if(e.operations[i].global_operation){p=!0;break}if(p){t+='<tr><td colspan="100">';for(i in e.operations){var u=e.operations[i];u.global_operation&&(t+='<a class="action-button" href="'+u.global_operation+'">'+u.label+"</a>")}t+="</td></tr>"}return e.legend&&(t+='<tr><td colspan="100">'+e.legend+"</td></tr>"),t},message:function(e){return'<p><div class="'+e.status+'message transient-message">'+e.message+'</div><div style="clear: both"></div></p>'},grid_filters:function(e){var t=e.default_filter_dict,i=e.filters,n="none";e.advanced_search&&(n="block");var s=!1;for(var a in e.columns){var o=e.columns[a];if("advanced"==o.filterable){var r=o.key,l=i[r],c=t[r];l&&c&&l!=c&&(n="block"),s=!0}}var d="block";"block"==n&&(d="none");var h='<div id="standard-search" style="display: '+d+';"><table><tr><td style="padding: 0;"><table>';for(var a in e.columns){var o=e.columns[a];"standard"==o.filterable&&(h+=this.grid_column_filter(e,o))}h+="</table></td></tr><tr><td>",s&&(h+='<a href="" class="advanced-search-toggle">Advanced Search</a>'),h+="</td></tr></table></div>",h+='<div id="advanced-search" style="display: '+n+'; margin-top: 5px; border: 1px solid #ccc;"><table><tr><td style="text-align: left" colspan="100"><a href="" class="advanced-search-toggle">Close Advanced Search</a></td></tr>';for(var a in e.columns){var o=e.columns[a];"advanced"==o.filterable&&(h+=this.grid_column_filter(e,o))}return h+="</table></div>"},grid_column_filter:function(e,t){var i=(e.default_filter_dict,e.filters),n=t.label,s=t.key;"advanced"==t.filterable&&(n=n.toLowerCase());var a="<tr>";if("advanced"==t.filterable&&(a+='<td align="left" style="padding-left: 10px">'+n+":</td>"),a+='<td style="padding-bottom: 1px;">',t.is_text){a+='<form class="text-filter-form" column_key="'+s+'" action="'+e.url+'" method="get" >';for(h in e.columns){var r=e.columns[h],l=i[r.key];l&&"All"!=l&&(r.is_text&&(l=JSON.stringify(l)),a+='<input type="hidden" id="'+r.key+'" name="f-'+r.key+'" value="'+l+'"/>')}a+='<span id="'+s+'-filtering-criteria">';var c=i[s];if(c){var d=o.type(c);if("string"==d&&"All"!=c&&(a+=this.filter_element(s,c)),"array"==d)for(var h in c){var u=c[h],p=c;p=p.slice(h),a+=this.filter_element(s,u)}}a+="</span>";var f="";if("standard"==t.filterable){f=t.label.toLowerCase();var g=f.length;g<20&&(g=20),g+=4}a+='<span class="search-box"><input class="search-box-input" id="input-'+s+'-filter" name="f-'+s+'" type="text" placeholder="'+f+'" size="'+g+'"/><button type="submit" style="background: transparent; border: none; padding: 4px; margin: 0px;"><i class="fa fa-search"></i></button></span></form>'}else{a+='<span id="'+s+'-filtering-criteria">';var m=!1;for(cf_label in e.categorical_filters[s]){var v=e.categorical_filters[s][cf_label],_="",y="";for(key in v)_=key,y=v[key];m&&(a+=" | "),m=!0;var u=i[s];a+=u&&v[s]&&u==y?'<span class="categorical-filter '+s+'-filter current-filter">'+cf_label+"</span>":'<span class="categorical-filter '+s+'-filter"><a href="javascript:void(0);" filter_key="'+_+'" filter_val="'+y+'">'+cf_label+"</a></span>"}a+="</span>"}return a+="</td></tr>"},filter_element:function(t,i){return i=e.sanitize(i),'<span class="text-filter-val">'+i+'<a href="javascript:void(0);" filter_key="'+t+'" filter_val="'+i+'"><i class="fa fa-times" style="padding-left: 5px; padding-bottom: 6px;"/></a></span>'}}}.apply(t,s),!(void 0!==a&&(e.exports=a))}).call(t,n(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(8),i(85),i(5)],s=function(e,t,i){"use strict";var n={defaultName:a.template("Copy of '<%- name %>'"),title:a.template(i("Copying history")+' "<%- name %>"'),submitLabel:i("Copy"),errorMessage:i("History could not be copied."),progressive:i("Copying history"),activeLabel:i("Copy only the active, non-deleted datasets"),allLabel:i("Copy all datasets including deleted ones"),anonWarning:i("As an anonymous user, unless you login or register, you will lose your current history ")+i("after copying this history. "),_template:a.template(["<% if( isAnon ){ %>",'<div class="warningmessage">',"<%- anonWarning %>",i("You can"),' <a href="/user/login">',i("login here"),"</a> ",i("or")," ",' <a href="/user/create">',i("register here"),"</a>.","</div>","<% } %>","<form>",'<label for="copy-modal-title">',i("Enter a title for the new history"),":","</label><br />",'<input id="copy-modal-title" class="form-control" style="width: 100%" value="<%= name %>" />','<p class="invalid-title bg-danger" style="color: red; margin: 8px 0px 8px 0px; display: none">',i("Please enter a valid history title"),"</p>","<% if( allowAll ){ %>","<br />","<p>",i("Choose which datasets from the original history to include:"),"</p>",'<input name="copy-what" type="radio" id="copy-non-deleted" value="copy-non-deleted" ','<% if( copyWhat === "copy-non-deleted" ){ print( "checked" ); } %>/>','<label for="copy-non-deleted"> <%- activeLabel %></label>',"<br />",'<input name="copy-what" type="radio" id="copy-all" value="copy-all" ','<% if( copyWhat === "copy-all" ){ print( "checked" ); } %>/>','<label for="copy-all"> <%- allLabel %></label>',"<% } %>","</form>"].join("")),_showAjaxIndicator:function(){var e='<p><span class="fa fa-spinner fa-spin"></span> '+this.progressive+"...</p>";this.modal.$(".modal-body").empty().append(e).css({"margin-top":"8px"})},dialog:function(e,n,s){function l(){var i=e.$("#copy-modal-title").val();if(!i)return void e.$(".invalid-title").show();var s="copy-all"===e.$('input[name="copy-what"]:checked').val();e.$("button").prop("disabled",!0),c._showAjaxIndicator(),n.copy(!0,i,s).done(function(e){d.resolve(e)}).fail(function(e,a,o){var r={name:i,copyAllDatasets:s};t.ajaxErrorModal(n,e,r,c.errorMessage),d.rejectWith(d,arguments)}).done(function(){g&&e.hide()})}s=s||{};var c=this,d=o.Deferred(),h=s.nameFn||this.defaultName,u=h({name:n.get("name")
}),p=s.allDatasets?"copy-all":"copy-non-deleted",f=!!a.isUndefined(s.allowAll)||s.allowAll,g=!!a.isUndefined(s.autoClose)||s.autoClose;this.modal=e;var m=s.closing_callback;return e.show(a.extend(s,{title:this.title({name:n.get("name")}),body:r(c._template({name:u,isAnon:Galaxy.user.isAnonymous(),allowAll:f,copyWhat:p,activeLabel:this.activeLabel,allLabel:this.allLabel,anonWarning:this.anonWarning})),buttons:a.object([[i("Cancel"),function(){e.hide()}],[this.submitLabel,l]]),height:"auto",closing_events:!0,closing_callback:function(e){e&&d.reject({cancelled:!0}),m&&m(e)}})),e.$("#copy-modal-title").focus().select(),e.$("#copy-modal-title").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),l())}),d}},s=a.extend({},n,{defaultName:a.template("imported: <%- name %>"),title:a.template(i("Importing history")+' "<%- name %>"'),submitLabel:i("Import"),errorMessage:i("History could not be imported."),progressive:i("Importing history"),activeLabel:i("Import only the active, non-deleted datasets"),allLabel:i("Import all datasets including deleted ones"),anonWarning:i("As an anonymous user, unless you login or register, you will lose your current history ")+i("after importing this history. ")}),l=function(t,i){i=i||{};var a=window.parent.Galaxy.modal||new e.View({});return i.useImport?s.dialog(a,t,i):n.dialog(a,t,i)};return l}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(75),i(78),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=e.DatasetListItemEdit,r=s.extend({className:s.prototype.className+" history-content",_fetchModelDetails:function(){var e=this;return e.model.inReadyState()&&!e.model.hasDetails()?e.model.fetch({silent:!0}):e.model.has("rerunnable")?a.when():e.model.fetch({silent:!0,data:{keys:["rerunnable","creating_job"].join(",")}})},events:o.extend(o.clone(s.prototype.events),{"click .unhide-link":function(e){return this.model.unhide(),!1}}),toString:function(){var e=this.model?this.model+"":"(no model)";return"HDAListItemEdit("+e+")"}});return r.prototype.templates=function(){var e=o.extend({},s.prototype.templates.warnings,{hidden:i.wrapTemplate(["<% if( !dataset.visible ){ %>",'<div class="hidden-msg warningmessagesmall">',n("This dataset has been hidden"),'<br /><a class="unhide-link" a href="javascript:void(0);">',n("Unhide it"),"</a>","</div>","<% } %>"],"dataset")});return o.extend({},s.prototype.templates,{titleBar:t.HDAListItemView.prototype.templates.titleBar,warnings:e})}(),{HDAListItemEdit:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(2))},function(e,t,i){var n,s;n=[i(80),i(113),i(17),i(5)],s=function(e,t,i,n){"use strict";var s=e.HDCAListItemView,a=s.extend({_getFoldoutPanelClass:function(){switch(this.model.get("collection_type")){case"list":return t.ListCollectionViewEdit;case"paired":return t.PairCollectionViewEdit;case"list:paired":return t.ListOfPairsCollectionViewEdit;case"list:list":return t.ListOfListsCollectionViewEdit}throw new TypeError("Uknown collection_type: "+this.model.get("collection_type"))},_renderPrimaryActions:function(){return this.log(this+"._renderPrimaryActions"),s.prototype._renderPrimaryActions.call(this).concat([this._renderDeleteButton()])},_renderDeleteButton:function(){var e=this,t=this.model.get("deleted");return i({title:n(t?"Dataset collection is already deleted":"Delete"),classes:"delete-btn",faIcon:"fa-times",disabled:t,onclick:function(){e.$el.find(".icon-btn.delete-btn").trigger("mouseout"),e.model.delete()}})},toString:function(){var e=this.model?this.model+"":"(no model)";return"HDCAListItemEdit("+e+")"}});return{HDCAListItemEdit:a}}.apply(t,n),!(void 0!==s&&(e.exports=s))},function(e,t,i){var n,s;(function(a,o){n=[i(4),i(77)],s=function(e,t){var i=a.View.extend({initialize:function(t){var i=this;this.setElement(o("<div/>")),this.model=new a.Model,e.get({url:Galaxy.root+"history/list",success:function(e){e.dict_format=!0,i.model.set(e),i.render()}})},render:function(){var e=new t(this.model.attributes);this.$el.empty().append(e.$el)}});return{View:i}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(82),i(123),i(6),i(5)],s=function(e,t,i,n){"use strict";var s=i.SessionStorageModel.extend({defaults:{tagsEditorShown:!1,annotationEditorShown:!1,scrollPosition:0},toString:function(){return"HistoryViewPrefs("+JSON.stringify(this.toJSON())+")"}});s.storageKey=function(){return"history-panel"};var l=t.HistoryViewEdit,c=l.extend({className:l.prototype.className+" current-history-panel",HDCAViewClass:l.prototype.HDCAViewClass.extend({foldoutStyle:"drilldown"}),emptyMsg:[n("This history is empty"),". ",n("You can "),'<a class="uploader-link" href="javascript:void(0)">',n("load your own data"),"</a>",n(" or "),'<a class="get-data-link" href="javascript:void(0)">',n("get data from an external source"),"</a>"].join(""),initialize:function(e){e=e||{},this.preferences=new s(a.extend({id:s.storageKey()},a.pick(e,a.keys(s.prototype.defaults)))),l.prototype.initialize.call(this,e),this.panelStack=[],this.currentContentId=e.currentContentId||null},_setUpListeners:function(){l.prototype._setUpListeners.call(this);var e=this;this.on("new-model",function(){e.preferences.set("scrollPosition",0)})},loadCurrentHistory:function(){return this.loadHistory(null,{url:Galaxy.root+"history/current_history_json"})},switchToHistory:function(e,t){return Galaxy.user.isAnonymous()?(this.trigger("error",n("You must be logged in to switch histories"),n("Anonymous user")),o.when()):this.loadHistory(e,{url:Galaxy.root+"history/set_as_current?id="+e})},createNewHistory:function(e){return Galaxy.user.isAnonymous()?(this.trigger("error",n("You must be logged in to create histories"),n("Anonymous user")),o.when()):this.loadHistory(null,{url:Galaxy.root+"history/create_new_current"})},setModel:function(e,t,i){return l.prototype.setModel.call(this,e,t,i),this.model&&this.model.id&&(this.log("checking for updates"),this.model.checkForUpdates()),this},_setUpModelListeners:function(){return l.prototype._setUpModelListeners.call(this),this.listenTo(this.model,{"change:nice_size change:size":function(){this.trigger("history-size-change",this,this.model,arguments)},"change:id":function(){this.once("loading-done",function(){this.model.checkForUpdates()})}})},_setUpCollectionListeners:function(){l.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,"state:ready",function(e,t,i){e.get("visible")||this.collection.storage.includeHidden()||this.removeItemView(e)})},_setUpBehaviors:function(e){e=e||this.$el;var t=this;return l.prototype._setUpBehaviors.call(t,e),this._debouncedScrollCaptureHandler||(this._debouncedScrollCaptureHandler=a.debounce(function(){t.$el.is(":visible")&&t.preferences.set("scrollPosition",o(this).scrollTop())},40)),t.$scrollContainer(e).off("scroll",this._debouncedScrollCaptureHandler).on("scroll",this._debouncedScrollCaptureHandler),t},_buildNewRender:function(){if(!this.model)return o();var e=l.prototype._buildNewRender.call(this);return e.find(".search").prependTo(e.find("> .controls")),this._renderQuotaMessage(e),e},_renderQuotaMessage:function(e){return e=e||this.$el,o(this.templates.quotaMsg({},this)).prependTo(e.find(".messages"))},_renderTags:function(e){var t=this;l.prototype._renderTags.call(t,e),t.preferences.get("tagsEditorShown")&&t.tagsEditor.toggle(!0),t.listenTo(t.tagsEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("tagsEditorShown",e.hidden)})},_renderAnnotation:function(e){var t=this;l.prototype._renderAnnotation.call(t,e),t.preferences.get("annotationEditorShown")&&t.annotationEditor.toggle(!0),t.listenTo(t.annotationEditor,"hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(e){t.preferences.set("annotationEditorShown",e.hidden)})},_swapNewRender:function(e){l.prototype._swapNewRender.call(this,e);var t=this;return a.delay(function(){var e=t.preferences.get("scrollPosition");e&&t.scrollTo(e,0)},10),this},_attachItems:function(e){l.prototype._attachItems.call(this,e);var t=this;return t.currentContentId&&t._setCurrentContentById(t.currentContentId),this},addItemView:function(e,t,i){var n=l.prototype.addItemView.call(this,e,t,i);return n&&this.panelStack.length?this._collapseDrilldownPanel():n},_setUpItemViewListeners:function(e){var t=this;return l.prototype._setUpItemViewListeners.call(t,e),t.listenTo(e,{"expanded:drilldown":function(e,t){this._expandDrilldownPanel(t)},"collapsed:drilldown":function(e,t){this._collapseDrilldownPanel(t)}})},setCurrentContent:function(e){this.$(".history-content.current-content").removeClass("current-content"),e?(e.$el.addClass("current-content"),this.currentContentId=e.model.id):this.currentContentId=null},_setCurrentContentById:function(e){var t=this.viewFromModelId(e)||null;this.setCurrentContent(t)},_expandDrilldownPanel:function(e){this.panelStack.push(e),this.$controls().add(this.$list()).hide(),e.parentName=this.model.get("name"),e.delegateEvents().render().$el.appendTo(this.$el)},_collapseDrilldownPanel:function(e){this.panelStack.pop(),this.$controls().add(this.$list()).show()},events:a.extend(a.clone(l.prototype.events),{"click .uploader-link":function(e){Galaxy.upload.show(e)},"click .get-data-link":function(e){var t=o(".toolMenuContainer");t.parent().scrollTop(0),t.find('span:contains("Get Data")').click()}}),listenToGalaxy:function(e){this.listenTo(e,{"galaxy_main:load":function(e){var t=e.fullpath,i=null,n={display:/datasets\/([a-f0-9]+)\/display/,edit:/datasets\/([a-f0-9]+)\/edit/,report_error:/dataset\/errors\?id=([a-f0-9]+)/,rerun:/tool_runner\/rerun\?id=([a-f0-9]+)/,show_params:/datasets\/([a-f0-9]+)\/show_params/};a.find(n,function(e,n){return i=a.result(t.match(e),1)}),this._setCurrentContentById(i?"dataset-"+i:null)},"center-panel:load":function(e){this._setCurrentContentById()}})},connectToQuotaMeter:function(e){return e?(this.listenTo(e,"quota:over",this.showQuotaMessage),this.listenTo(e,"quota:under",this.hideQuotaMessage),this.on("rendered rendered:initial",function(){e&&e.isOverQuota()&&this.showQuotaMessage()}),this):this},clearMessages:function(e){var t=a.isUndefined(e)?this.$messages().children('[class$="message"]'):o(e.currentTarget);return t=t.not(".quota-message"),t.fadeOut(this.fxSpeed,function(){o(this).remove()}),this},showQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")&&e.slideDown(this.fxSpeed)},hideQuotaMessage:function(){var e=this.$(".quota-message");e.is(":hidden")||e.slideUp(this.fxSpeed)},unhideHidden:function(){var e=this;return confirm(n("Really unhide all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{visible:!0}).done(function(){e.model.contents.includeHidden||e.renderItems()}):r.when()},deleteHidden:function(){var e=this;return confirm(n("Really delete all hidden datasets?"))?e.model.contents._filterAndUpdate({visible:!1,deleted:"",purged:""},{deleted:!0,visible:!0}):r.when()},toString:function(){return"CurrentHistoryView("+(this.model?this.model.get("name"):"")+")"}});return c.prototype.templates=function(){var e=i.wrapTemplate(['<div class="quota-message errormessage">',n("You are over your disk quota"),". ",n("Tool execution is on hold until your disk usage drops below your allocated quota"),".","</div>"],"history");return a.extend(a.clone(l.prototype.templates),{quotaMsg:e})}(),{CurrentHistoryView:c}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(124),i(45),i(11),i(79),i(119),i(120),i(48),i(71),i(37),i(115),i(114),i(17),i(51),i(6),i(5),i(16)],s=function(e,t,i,n,s,l,c,d,h,u,p,f,g,m,v){"use strict";var _=e.HistoryView,y=_.extend({HDAViewClass:s.HDAListItemEdit,HDCAViewClass:l.HDCAListItemEdit,initialize:function(e){e=e||{},_.prototype.initialize.call(this,e),this.tagsEditor=null,this.dragItems=!0,this.annotationEditor=null,this.purgeAllowed=e.purgeAllowed||!1,this.annotationEditorShown=e.annotationEditorShown||!1,this.tagsEditorShown=e.tagsEditorShown||!1},_setUpListeners:function(){return _.prototype._setUpListeners.call(this),this.on({"droptarget:drop":function(e,t){this.dataDropped(t),this.dropTargetOff()},"view:attached view:removed":function(){this._renderCounts()},"search:loading-progress":this._renderSearchProgress,"search:searching":this._renderSearchFindings})},_setUpModelListeners:function(){return _.prototype._setUpModelListeners.call(this),this.listenTo(this.model,"change:size",this.updateHistoryDiskSize),this},_setUpCollectionListeners:function(){return _.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,{"change:deleted":this._handleItemDeletedChange,"change:visible":this._handleItemVisibleChange,"change:purged":function(e){this.model.fetch()},"fetching-deleted":function(e){this.$("> .controls .deleted-count").html("<i>"+v("loading...")+"</i>")},"fetching-hidden":function(e){this.$("> .controls .hidden-count").html("<i>"+v("loading...")+"</i>")},"fetching-deleted-done fetching-hidden-done":this._renderCounts}),this},_buildNewRender:function(){var e=_.prototype._buildNewRender.call(this);return this.model?(Galaxy&&Galaxy.user&&Galaxy.user.id&&Galaxy.user.id===this.model.get("user_id")&&(this._renderTags(e),this._renderAnnotation(e)),e):e},updateHistoryDiskSize:function(){this.$(".history-size").text(this.model.get("nice_size"))},renderItems:function(e){var t=_.prototype.renderItems.call(this,e);return this.searchFor||this._renderCounts(e),t},_renderCounts:function(e){e=e instanceof a?e:this.$el;var t=this.templates.counts(this.model.toJSON(),this);return e.find("> .controls .subtitle").html(t)},_renderTags:function(e){var t=this;this.tagsEditor=new c.TagsEditor({model:this.model,el:e.find(".controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.toggleHDATagEditors(!0,t.fxSpeed)},onhide:function(){t.toggleHDATagEditors(!1,t.fxSpeed)},$activator:f({title:v("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".controls .actions"))})},_renderAnnotation:function(e){var t=this;this.annotationEditor=new d.AnnotationEditor({model:this.model,el:e.find(".controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){t.toggleHDAAnnotationEditors(!0,t.fxSpeed)},onhide:function(){t.toggleHDAAnnotationEditors(!1,t.fxSpeed)},$activator:f({title:v("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".controls .actions"))})},_setUpBehaviors:function(e){if(e=e||this.$el,_.prototype._setUpBehaviors.call(this,e),this.model&&Galaxy.user&&!Galaxy.user.isAnonymous()&&Galaxy.user.id===this.model.get("user_id")){var t=this,i="> .controls .name";e.find(i).attr("title",v("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(e){var n=t.model.get("name");e&&e!==n?(t.$el.find(i).text(e),t.model.save({name:e}).fail(function(){t.$el.find(i).text(t.model.previous("name"))})):t.$el.find(i).text(n)}})}},multiselectActions:function(){var e=this,t=[{html:v("Hide datasets"),func:function(){var t=n.HistoryDatasetAssociation.prototype.hide;e.getSelectedModels().ajaxQueue(t)}},{html:v("Unhide datasets"),func:function(){var t=n.HistoryDatasetAssociation.prototype.unhide;e.getSelectedModels().ajaxQueue(t)}},{html:v("Delete datasets"),func:function(){var t=n.HistoryDatasetAssociation.prototype.delete;e.getSelectedModels().ajaxQueue(t)}},{html:v("Undelete datasets"),func:function(){var t=n.HistoryDatasetAssociation.prototype.undelete;e.getSelectedModels().ajaxQueue(t)}}];return e.purgeAllowed&&t.push({html:v("Permanently delete datasets"),func:function(){if(confirm(v("This will permanently remove the data in your datasets. Are you sure?"))){var t=n.HistoryDatasetAssociation.prototype.purge;e.getSelectedModels().ajaxQueue(t)}}}),t=t.concat(e._collectionActions())},_collectionActions:function(){var e=this;return[{html:v("Build Dataset List"),func:function(){e.buildCollection("list")}},{html:v("Build Dataset Pair"),func:function(){e.buildCollection("paired")}},{html:v("Build List of Dataset Pairs"),func:function(){e.buildCollection("list:paired")}}]},buildCollection:function(e,t,i){var n,s=this,t=t||s.getSelectedModels(),i=i||!1;"list"==e?n=h.createListCollection:"paired"==e?n=u.createPairCollection:"list:paired"==e?n=p.createListOfPairsCollection:console.warn("Unknown collectionType encountered "+e),n(t,i).done(function(){s.model.refresh()})},_getItemViewOptions:function(e){var t=_.prototype._getItemViewOptions.call(this,e);return o.extend(t,{purgeAllowed:this.purgeAllowed,tagsEditorShown:this.tagsEditor&&!this.tagsEditor.hidden,annotationEditorShown:this.annotationEditor&&!this.annotationEditor.hidden}),t},_handleItemDeletedChange:function(e){e.get("deleted")?this._handleItemDeletion(e):this._handleItemUndeletion(e),this._renderCounts()},_handleItemDeletion:function(e){var t=this.model.get("contents_active");t.deleted+=1,t.active-=1,this.model.contents.includeDeleted||this.removeItemView(e),this.model.set("contents_active",t)},_handleItemUndeletion:function(e){var t=this.model.get("contents_active");t.deleted-=1,this.model.contents.includeDeleted||(t.active-=1),this.model.set("contents_active",t)},_handleItemVisibleChange:function(e){e.hidden()?this._handleItemHidden(e):this._handleItemUnhidden(e),this._renderCounts()},_handleItemHidden:function(e){var t=this.model.get("contents_active");t.hidden+=1,t.active-=1,this.model.contents.includeHidden||this.removeItemView(e),this.model.set("contents_active",t)},_handleItemUnhidden:function(e){var t=this.model.get("contents_active");t.hidden-=1,this.model.contents.includeHidden||(t.active-=1),this.model.set("contents_active",t)},toggleHDATagEditors:function(e,t){o.each(this.views,function(i){i.tagsEditor&&i.tagsEditor.toggle(e,t)})},toggleHDAAnnotationEditors:function(e,t){o.each(this.views,function(i){i.annotationEditor&&i.annotationEditor.toggle(e,t)})},events:o.extend(o.clone(_.prototype.events),{"click .show-selectors-btn":"toggleSelectors","click .toggle-deleted-link":function(e){this.toggleShowDeleted()},"click .toggle-hidden-link":function(e){this.toggleShowHidden()}}),_renderSearchProgress:function(e,t){var i=e+t;return this.$("> .controls .subtitle").html(["<i>",v("Searching "),i,"/",this.model.contentsShown(),"</i>"].join(""))},_renderSearchFindings:function(){return this.$("> .controls .subtitle").html([v("Found"),this.views.length].join(" ")),this},dropTargetOn:function(){if(this.dropTarget)return this;this.dropTarget=!0;var e={dragenter:o.bind(this.dragenter,this),dragover:o.bind(this.dragover,this),dragleave:o.bind(this.dragleave,this),drop:o.bind(this.drop,this)},t=this._renderDropTarget();this.$list().before([this._renderDropTargetHelp(),t]);for(var i in e)e.hasOwnProperty(i)&&t.on(i,e[i]);return this},_renderDropTarget:function(){return this.$(".history-drop-target").remove(),r("<div/>").addClass("history-drop-target")},_renderDropTargetHelp:function(){return this.$(".history-drop-target-help").remove(),r("<div/>").addClass("history-drop-target-help").text(v("Drag datasets here to copy them to the current history"))},dropTargetOff:function(){if(!this.dropTarget)return this;this.dropTarget=!1;var e=this.$(".history-drop-target").get(0);for(var t in this._dropHandlers)this._dropHandlers.hasOwnProperty(t)&&e.off(t,this._dropHandlers[t]);return this.$(".history-drop-target").remove(),this.$(".history-drop-target-help").remove(),this},dropTargetToggle:function(){return this.dropTarget?this.dropTargetOff():this.dropTargetOn(),this},dragenter:function(e){e.preventDefault(),e.stopPropagation(),this.$(".history-drop-target").css("border","2px solid black")},dragover:function(e){e.preventDefault(),e.stopPropagation()},dragleave:function(e){e.preventDefault(),e.stopPropagation(),this.$(".history-drop-target").css("border","1px dashed black")},drop:function(e){e.preventDefault();var t=this,i=e.originalEvent.dataTransfer,n=i.getData("text");i.dropEffect="move";try{n=JSON.parse(n)}catch(e){t.warn("error parsing JSON from drop:",n)}return t.trigger("droptarget:drop",e,n,t),!1},dataDropped:function(e){var t=this;return o.isObject(e)&&"HistoryDatasetAssociation"===e.model_class&&e.id?0!==t.contents.currentPage?t.contents.fetchPage(0).then(function(){return t.model.contents.copy(e.id)}):t.model.contents.copy(e.id):a.when()},toString:function(){return"HistoryViewEdit("+(this.model?this.model.get("name"):"")+")"}});return y.prototype.templates=function(){var e=m.wrapTemplate(["<% var shown = Math.max( view.views.length, history.contents_active.active ) %>","<% if( shown ){ %>",'<span class="shown-count">',"<%- shown %> ",v("shown"),"</span>","<% } %>","<% if( history.contents_active.deleted ){ %>",'<span class="deleted-count">',"<% if( view.model.contents.includeDeleted ){ %>",'<a class="toggle-deleted-link" href="javascript:void(0);">',v("hide deleted"),"</a>","<% } else { %>","<%- history.contents_active.deleted %> ",'<a class="toggle-deleted-link" href="javascript:void(0);">',v("deleted"),"</a>","<% } %>","</span>","<% } %>","<% if( history.contents_active.hidden ){ %>",'<span class="hidden-count">',"<% if( view.model.contents.includeHidden ){ %>",'<a class="toggle-hidden-link" href="javascript:void(0);">',v("hide hidden"),"</a>","<% } else { %>","<%- history.contents_active.hidden %> ",'<a class="toggle-hidden-link" href="javascript:void(0);">',v("hidden"),"</a>","<% } %>","</span>","<% } %>"],"history");return o.extend(o.clone(_.prototype.templates),{counts:e})}(),{HistoryViewEdit:y}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(2),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(83),i(82),i(45),i(46),i(78),i(80),i(86),i(85),i(17),i(6),i(5),i(89)],s=function(e,t,i,n,s,r,l,c,d,h,u){"use strict";var p=e.ModelListPanel,f=p.extend({_logNamespace:"history",HDAViewClass:s.HDAListItemView,HDCAViewClass:r.HDCAListItemView,collectionClass:i.HistoryContents,modelCollectionKey:"contents",tagName:"div",className:p.prototype.className+" history-panel",emptyMsg:u("This history is empty"),noneFoundMsg:u("No matching datasets found"),searchPlaceholder:u("search datasets"),FETCH_COLLECTION_COUNTS_DELAY:2e3,initialize:function(e){p.prototype.initialize.call(this,e),this.linkTarget=e.linkTarget||"_blank"},_createDefaultCollection:function(){return new this.collectionClass([],{history:this.model})},freeModel:function(){return p.prototype.freeModel.call(this),this.model&&this.model.clearUpdateTimeout(),this},_setUpListeners:function(){p.prototype._setUpListeners.call(this),this.on({error:function(e,t,i,n,s){this.errorHandler(e,t,i,n,s)},"loading-done":function(){var e=this;a.delay(function(){e.model.contents.fetchCollectionCounts()},e.FETCH_COLLECTION_COUNTS_DELAY)},"views:ready view:attached view:removed":function(e){this._renderSelectButton()},"view:attached":function(e){this.scrollTo(0)}})},loadHistory:function(e,i,n){n=a.extend(n||{silent:!0}),this.info("loadHistory:",e,i,n);var s=this;return s.setModel(new t.History({id:e})),n.silent=!0,s.trigger("loading"),s.model.fetchWithContents(i,n).always(function(){s.render(),s.trigger("loading-done")})},refreshContents:function(e){return this.model?this.model.refresh(e):o.when()},_setUpCollectionListeners:function(){return p.prototype._setUpCollectionListeners.call(this),this.listenTo(this.collection,{"fetching-more":function(){this._toggleContentsLoadingIndicator(!0),this.$emptyMessage().hide()},"fetching-more-done":function(){this._toggleContentsLoadingIndicator(!1)}})},_showLoadingIndicator:function(e,t,i){var n=o('<div class="loading-indicator"/>');this.$el.html(n.text(e).slideDown(a.isUndefined(t)?this.fxSpeed:t))},_hideLoadingIndicator:function(e){this.$(".loading-indicator").slideUp(a.isUndefined(e)?this.fxSpeed+200:e,function(){o(this).remove()})},_buildNewRender:function(){var e=p.prototype._buildNewRender.call(this);return this._renderSelectButton(e),e},_renderSelectButton:function(e){if(e=e||this.$el,!this.multiselectActions().length)return null;if(!this.views.length)return this.hideSelectors(),e.find(".controls .actions .show-selectors-btn").remove(),null;var t=e.find(".controls .actions .show-selectors-btn");return t.length?t:d({title:u("Operations on multiple datasets"),classes:"show-selectors-btn",faIcon:"fa-check-square-o"}).prependTo(e.find(".controls .actions"))},_renderEmptyMessage:function(e){var t=this,i=t.$emptyMessage(e),n=t.model.get("contents_active").active<=0;return n?i.empty().append(t.emptyMsg).show():t.searchFor&&t.model.contents.haveSearchDetails()&&!t.views.length?i.empty().append(t.noneFoundMsg).show():(i.hide(),o())},$scrollContainer:function(e){return this.$list(e)},_toggleContentsLoadingIndicator:function(e){e?this.$list().html('<div class="contents-loading-indicator"><span class="fa fa-2x fa-spinner fa-spin"/></div>'):this.$list().find(".contents-loading-indicator").remove()},renderItems:function(e){e=e||this.$el;var t=this,i=t.$list(e);o(".tooltip").remove(),i.empty(),t.views=[];var n=t._filterCollection();return n.length?(t._renderPagination(e),t.views=t._renderSomeItems(n,i)):e.find("> .controls .list-pagination").empty(),t._renderEmptyMessage(e).toggle(!n.length),t.trigger("views:ready",t.views),t.views},_renderPagination:function(e){var t=e.find("> .controls .list-pagination");return this.searchFor||!this.model.contents.shouldPaginate()?t.empty():(t.html(this.templates.pagination({current:this.model.contents.currentPage+1,last:this.model.contents.getLastPage()+1},this)),t.find("select.pages").tooltip(),t)},_renderSomeItems:function(e,t){var i=this,n=[];return t.append(e.map(function(e){var t=i._createItemView(e);return n.push(t),i._renderItemView$el(t)})),n},_filterItem:function(e){var t=this,i=t.model.contents;return(i.includeHidden||!e.hidden())&&(i.includeDeleted||!e.isDeletedOrPurged())&&p.prototype._filterItem.call(t,e)},_getItemViewClass:function(e){var t=e.get("history_content_type");switch(t){case"dataset":return this.HDAViewClass;case"dataset_collection":return this.HDCAViewClass}throw new TypeError("Unknown history_content_type: "+t)},_getItemViewOptions:function(e){var t=p.prototype._getItemViewOptions.call(this,e);return a.extend(t,{linkTarget:this.linkTarget,expanded:this.model.contents.storage.isExpanded(e.id),hasUser:this.model.ownedByCurrUser()})},_setUpItemViewListeners:function(e){var t=this;return p.prototype._setUpItemViewListeners.call(t,e),t.listenTo(e,{expanded:function(e){t.model.contents.storage.addExpanded(e.model)},collapsed:function(e){t.model.contents.storage.removeExpanded(e.model)}})},collapseAll:function(){this.model.contents.storage.clearExpanded(),p.prototype.collapseAll.call(this)},getSelectedModels:function(){var e=p.prototype.getSelectedModels.call(this);return e.historyId=this.collection.historyId,e},events:a.extend(a.clone(p.prototype.events),{"click .show-selectors-btn":"toggleSelectors","click > .controls .prev":"_clickPrevPage","click > .controls .next":"_clickNextPage","change > .controls .pages":"_changePageSelect","click .messages [class$=message]":"clearMessages"}),_clickPrevPage:function(e){this.model.clearUpdateTimeout(),this.model.contents.fetchPrevPage()},_clickNextPage:function(e){this.model.clearUpdateTimeout(),this.model.contents.fetchNextPage()},_changePageSelect:function(e){this.model.clearUpdateTimeout();var t=o(e.currentTarget).val();this.model.contents.fetchPage(t)},toggleShowDeleted:function(e,t){e=void 0!==e?e:!this.model.contents.includeDeleted;var i=this,n=i.model.contents;return n.setIncludeDeleted(e,t),i.trigger("show-deleted",e),n.fetchCurrentPage({renderAll:!0}),e},toggleShowHidden:function(e,t,i){e=void 0!==e?e:!this.model.contents.includeHidden;var n=this,s=n.model.contents;return s.setIncludeHidden(e,i),n.trigger("show-hidden",e),s.fetchCurrentPage({renderAll:!0}),e},_firstSearch:function(e){var t=this,i="> .controls .search-input";if(this.log("onFirstSearch",e),t.model.contents.haveSearchDetails())return void t.searchItems(e);t.$(i).searchInput("toggle-loading"),t.searchFor=e;t.model.contents.progressivelyFetchDetails({silent:!0}).progress(function(e,i,n){t.renderItems(),t.trigger("search:loading-progress",i,n)}).always(function(){t.$el.find(i).searchInput("toggle-loading")}).done(function(){t.searchItems(e,"force")})},clearSearch:function(e){var t=this;return t.searchFor?(t.searchFor="",t.trigger("search:clear",t),t.$("> .controls .search-query").val(""),t.model.contents.fetchCurrentPage({silent:!0}).done(function(){t.renderItems()}),t):t},errorHandler:function(e,t,i){if(!t||0!==t.status||0!==t.readyState){if(this.error(e,t,i),a.isString(e)&&a.isString(t)){var n=e,s=t;return c.errorModal(n,s,i)}return t&&502===t.status?c.badGatewayErrorModal():c.ajaxErrorModal(e,t,i)}},clearMessages:function(e){var t=a.isUndefined(e)?this.$messages().children('[class$="message"]'):o(e.currentTarget);return t.fadeOut(this.fxSpeed,function(){o(this).remove()}),this},scrollToHid:function(e){return this.scrollToItem(a.first(this.viewsWhereModel({hid:e})))},ordinalIndicator:function(e){var t=e+"";switch(t.charAt(t.length-1)){case"1":return t+"st";case"2":return t+"nd";case"3":return t+"rd";default:return t+"th"}},toString:function(){return"HistoryView("+(this.model?this.model.get("name"):"")+")"}});return f.prototype.templates=function(){var e=h.wrapTemplate(["<div>",'<div class="controls"></div>','<ul class="list-items"></ul>','<div class="empty-message infomessagesmall"></div>',"</div>"]),t=h.wrapTemplate(['<div class="controls">','<div class="title">','<div class="name"><%- history.name %></div>',"</div>",'<div class="subtitle"></div>','<div class="history-size"><%- history.nice_size %></div>','<div class="actions"></div>','<div class="messages">',"<% if( history.deleted && history.purged ){ %>",'<div class="deleted-msg warningmessagesmall">',u("This history has been purged and deleted"),"</div>","<% } else if( history.deleted ){ %>",'<div class="deleted-msg warningmessagesmall">',u("This history has been deleted"),"</div>","<% } else if( history.purged ){ %>",'<div class="deleted-msg warningmessagesmall">',u("This history has been purged"),"</div>","<% } %>","<% if( history.message ){ %>",'<div class="<%= history.message.level || "info" %>messagesmall">',"<%= history.message.text %>","</div>","<% } %>","</div>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="search">','<div class="search-input"></div>',"</div>",'<div class="list-actions">','<div class="btn-group">','<button class="select-all btn btn-default"','data-mode="select">',u("All"),"</button>",'<button class="deselect-all btn btn-default"','data-mode="select">',u("None"),"</button>","</div>",'<div class="list-action-menu btn-group">',"</div>","</div>",'<div class="list-pagination form-inline"></div>',"</div>"],"history"),i=h.wrapTemplate(['<button class="prev" <%- pages.current === 1 ? "disabled" : "" %>>previous</button>','<select class="pages form-control" ','title="',u("Click to open and select a page. Begin typing a page number to select it"),'">',"<% _.range( 1, pages.last + 1 ).forEach( function( i ){ %>",'<option value="<%- i - 1 %>" <%- i === pages.current ? "selected" : "" %>>',"<%- view.ordinalIndicator( i ) %> of <%- pages.last %> pages","</option>","<% }); %>","</select>",'<button class="next" <%- pages.current === pages.last ? "disabled" : "" %>>next</button>'],"pages");return a.extend(a.clone(p.prototype.templates),{el:e,controls:t,pagination:i})}(),{HistoryView:f}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(2),i(1))},function(e,t,i){var n,s;(function(a,o){n=[i(51),i(118),i(6),i(5),i(28)],s=function(e,t,i,n,s){"use strict";function r(e,t,i){return o.clone(l).filter(function(n){return!(e&&!n.anon)&&(!(!t&&n.purge)&&(n.href&&(n.href=i+n.href,n.target="galaxy_main"),n.confirm&&(n.func=function(){confirm(n.confirm)&&(galaxy_main.location=n.href)}),!0))})}var l=[{html:n("History Lists"),header:!0},{html:n("Saved Histories"),href:"history/list"},{html:n("Histories Shared with Me"),
href:"history/list_shared"},{html:n("Current History"),header:!0,anon:!0},{html:n("Create New"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.createNewHistory()}},{html:n("Copy History"),func:function(){t(Galaxy.currHistoryPanel.model).done(function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:n("Share or Publish"),href:"history/sharing"},{html:n("Show Structure"),href:"history/display_structured",anon:!0},{html:n("Extract Workflow"),href:"workflow/build_from_current_history"},{html:n("Delete"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm(n("Really delete the current history?"))&&(galaxy_main.window.location.href="history/delete?id="+Galaxy.currHistoryPanel.model.id)}},{html:n("Delete Permanently"),purge:!0,anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm(n("Really delete the current history permanently? This cannot be undone."))&&(galaxy_main.window.location.href="history/delete?purge=True&id="+Galaxy.currHistoryPanel.model.id)}},{html:n("Dataset Actions"),header:!0,anon:!0},{html:n("Copy Datasets"),href:"dataset/copy_datasets"},{html:n("Dataset Security"),href:"root/history_set_default_permissions"},{html:n("Resume Paused Jobs"),href:"history/resume_paused_jobs?current=True",anon:!0},{html:n("Collapse Expanded Datasets"),func:function(){Galaxy&&Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.collapseAll()}},{html:n("Unhide Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm(n("Really unhide all hidden datasets?"))&&a.post(Galaxy.root+"history/adjust_hidden",{user_action:"unhide"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:n("Delete Hidden Datasets"),anon:!0,func:function(){Galaxy&&Galaxy.currHistoryPanel&&confirm(n("Really delete all hidden datasets?"))&&a.post(Galaxy.root+"history/adjust_hidden",{user_action:"delete"},function(){Galaxy.currHistoryPanel.loadCurrentHistory()})}},{html:n("Purge Deleted Datasets"),confirm:n("Really delete all deleted datasets permanently? This cannot be undone."),href:"history/purge_deleted_datasets",purge:!0,anon:!0},{html:n("Downloads"),header:!0},{html:n("Export Tool Citations"),href:"history/citations",anon:!0},{html:n("Export History to File"),href:"history/export_archive?preview=True",anon:!0},{html:n("Other Actions"),header:!0},{html:n("Import from File"),href:"history/import_archive"}];s.add({url:"api/webhooks/history-menu/all",async:!1,callback:function(e){var t=[];a.each(e.models,function(e,i){var s=i.toJSON();s.activate&&t.push({html:n(s.config.title),anon:!0})}),t.length>0&&(t.unshift({html:n("Webhooks"),header:!0}),a.merge(l,t))}});var c=function(t,i){i=i||{};var n=void 0===i.anonymous||i.anonymous,s=i.purgeAllowed||!1,a=r(n,s,Galaxy.root);return new e(t,a)};return c}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1),i(2))},function(e,t,i){var n,s;(function(a,o){n=[i(4)],s=function(e){var t=a.View.extend({initialize:function(e){this.collection=new a.Collection,this.model=e&&e.model||new a.Model({onchange:null,visible:!0}).set(e),this.setElement(o(this._template())),this.$nav=this.$(".tab-navigation"),this.$content=this.$(".tab-content"),this.$el.on("click",function(){o(".tooltip").hide()}),this.render(),this.listenTo(this.model,"change",this.render,this),this.listenTo(this.collection,"add",this._add,this),this.listenTo(this.collection,"remove",this._remove,this),this.listenTo(this.collection,"change",this._change,this),this.listenTo(this.collection,"reset",this._reset,this),this.listenTo(this.collection,"add remove reset",this.render,this)},render:function(){var e=this.model.get("current");e=this.$("#"+e).length>0?e:this.first(),e&&(this.$nav.children().removeClass("active"),this.$content.children().removeClass("active"),this.$("#tab-"+e).addClass("active"),this.$("#"+e).addClass("active")),this.$el[this.model.get("visible")?"fadeIn":"fadeOut"]("fast"),this.$nav[this.size()>1?"show":"hide"]()},current:function(){return this.model.get("current")},show:function(e){e&&(this.model.set({current:e,visible:!0}),this.model.get("onchange")&&this.model.get("onchange")(e))},hide:function(){this.model.set("visible",!1)},first:function(){var e=this.collection.first();return e&&e.id},size:function(){return this.collection.length},add:function(e){this.collection.add(e)},del:function(e){this.collection.remove(e)},delAll:function(){this.collection.reset()},showTab:function(e){this.collection.get(e).set("hidden",!1)},hideTab:function(e){this.collection.get(e).set("hidden",!0)},_add:function(e){var t=this,i=e.attributes;this.$content.append(o("<div/>").attr("id",i.id).addClass("tab-pane").append(i.$el)),this.$nav.append(o(this._template_tab(i)).show().tooltip({title:i.tooltip,placement:"bottom",container:t.$el}).on("click",function(e){e.preventDefault(),t.show(i.id)})),1==this.size()&&this.show(i.id)},_remove:function(e){this.$("#tab-"+e.id).remove(),this.$("#"+e.id).remove()},_reset:function(){this.$nav.empty(),this.$content.empty()},_change:function(e){this.$("#tab-"+e.id)[e.get("hidden")?"hide":"show"]()},_template:function(){return o("<div/>").addClass("ui-tabs tabbable tabs-left").append(o("<ul/>").addClass("tab-navigation nav nav-tabs")).append(o("<div/>").addClass("tab-content"))},_template_tab:function(e){var t=o("<li/>").addClass("tab-element").attr("id","tab-"+e.id).append(o("<a/>").attr("id","tab-title-link-"+e.id)),i=t.find("a");return e.icon&&i.append(o("<i/>").addClass("tab-icon fa").addClass(e.icon)),i.append(o("<span/>").attr("id","tab-title-text-"+e.id).addClass("tab-title-text").append(e.title)),t}});return{View:t}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(24),i(59),i(14),i(15)],s=function(e,t,i,n,s){return a.View.extend({status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template(t.model)),this.$mode=this.$(".upload-mode"),this.$title=this.$(".upload-title-extended"),this.$text=this.$(".upload-text"),this.$size=this.$(".upload-size"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$text_content=this.$(".upload-text-content"),this.$symbol=this.$(".upload-symbol"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.settings=new n.View({title:"Upload configuration",container:this.$(".upload-settings"),placement:"bottom"});this.app.select_genome.value(),this.app.select_extension.value();this.$symbol.on("click",function(){i._removeRow()}),this.$text_content.on("change input",function(e){i.model.set({url_paste:o(e.target).val(),file_size:o(e.target).val().length})}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()}),this.listenTo(this.model,"remove",function(){i.remove()}),this.app.collection.on("reset",function(){i.remove()})},render:function(){var t=this.model.attributes;this.$title.html(r.escape(t.file_name)),this.$size.html(e.bytesToString(t.file_size)),this.$mode.removeClass().addClass("upload-mode").addClass("text-primary"),"new"==t.file_mode?(this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$mode.addClass("fa fa-edit")):"local"==t.file_mode?this.$mode.addClass("fa fa-laptop"):"ftp"==t.file_mode&&this.$mode.addClass("fa fa-folder-open-o")},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("<strong>Failed: </strong>"+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$progress_bar.css({width:e+"%"}),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$symbol.removeClass().addClass("upload-symbol").addClass(this.status_classes[e]),this.model.set("enabled","init"==e);var t=this.model.get("enabled");this.$text_content.attr("disabled",!t),"success"==e&&(this.$el.addClass("success"),this.$percentage.html("100%")),"error"==e&&(this.$el.addClass("danger"),this.$info_progress.hide())},_refreshFileSize:function(){this.$size.html(e.bytesToString(this.model.get("file_size")))},_removeRow:function(){["init","success","error"].indexOf(this.model.get("status"))!==-1&&this.app.collection.remove(this.model)},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new i(this).$el),this.settings.show())},_template:function(e){return'<tr id="upload-row-'+e.id+'" class="upload-row"><td><div class="upload-text-column"><div class="upload-mode"/><div class="upload-title-extended"/><div class="upload-text"><div class="upload-text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.</div><textarea class="upload-text-content form-control"/></div></div></td><td><div class="upload-size"/></td><td><div class="upload-info"><div class="upload-info-text"/><div class="upload-info-progress progress"><div class="upload-progress-bar progress-bar progress-bar-success"/><div class="upload-percentage">0%</div></div></div></td><td><div class="upload-symbol '+this.status_classes.init+'"/></td></tr>'}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(24),i(127),i(58),i(14),i(15),i(7),i(37),i(63)],s=function(e,t,i,n,s,l,c,d){return a.View.extend({upload_size:0,collection:new t.Collection,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ui_button=e.ui_button,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.btnLocal=new c.Button({id:"btn-local",title:"Choose local files",onclick:function(){t.uploadbox.select()},icon:"fa fa-laptop"}),this.btnFtp=new c.Button({id:"btn-ftp",title:"Choose FTP files",onclick:function(){t._eventFtp()},icon:"fa fa-folder-open-o"}),this.btnCreate=new c.Button({id:"btn-new",title:"Paste/Fetch data",onclick:function(){t._eventCreate()},icon:"fa fa-edit"}),this.btnStart=new c.Button({id:"btn-start",title:"Start",onclick:function(){t._eventStart()}}),this.btnBuild=new c.Button({id:"btn-build",title:"Build",onclick:function(){t._eventBuild()}}),this.btnStop=new c.Button({id:"btn-stop",title:"Pause",onclick:function(){t._eventStop()}}),this.btnReset=new c.Button({id:"btn-reset",title:"Reset",onclick:function(){t._eventReset()}}),this.btnClose=new c.Button({id:"btn-close",title:"Close",onclick:function(){t.app.modal.hide()}}),o.each([this.btnLocal,this.btnFtp,this.btnCreate,this.btnStop,this.btnReset,this.btnStart,this.btnBuild,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.uploadbox=this.$(".upload-box").uploadbox({url:this.app.options.nginx_upload_path,announce:function(e,i){t._eventAnnounce(e,i)},initialize:function(e){return t.app.toData([t.collection.get(e)],t.history_id)},progress:function(e,i){t._eventProgress(e,i)},success:function(e,i){t._eventSuccess(e,i)},error:function(e,i){t._eventError(e,i)},complete:function(){t._eventComplete()},ondragover:function(){t.$(".upload-box").addClass("highlight")},ondragleave:function(){t.$(".upload-box").removeClass("highlight")}}),console.log(this.list_extensions),this.ftp=new s.View({title:"FTP files",container:this.btnFtp.$el}),this.select_extension=new l.View({css:"upload-footer-selection-compressed",container:this.$(".upload-footer-extension"),data:o.filter(this.list_extensions,function(e){return!e.composite_files}),value:this.options.default_extension,onchange:function(e){t.updateExtension(e)}}),this.collectionType="list",this.select_collection=new l.View({css:"upload-footer-selection-compressed",container:this.$(".upload-footer-collection-type"),data:[{id:"list",text:"List"},{id:"paired",text:"Paired"},{id:"list:paired",text:"List of Pairs"}],value:"list",onchange:function(e){t.updateCollectionType(e)}}),this.$(".upload-footer-extension-info").on("click",function(e){t.showExtensionInfo({$el:r(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new l.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome,onchange:function(e){t.updateGenome(e)}}),this.collection.on("remove",function(e){t._eventRemove(e)}),this._updateScreen()},_eventAnnounce:function(e,n){this.counter.announce++;var s=new t.Model({id:e,file_name:n.name,file_size:n.size,file_mode:n.mode||"local",file_path:n.path,file_data:n,extension:this.select_extension.value(),genome:this.select_genome.value()});this.collection.add(s);var a=new i(this,{model:s});this.$(".upload-table > tbody:first").append(a.$el),this._updateScreen(),a.render()},_eventProgress:function(e,t){var i=this.collection.get(e);i.set("percentage",t),this.ui_button.model.set("percentage",this._uploadPercentage(t,i.get("file_size")))},_eventSuccess:function(e,t){var i=o.pluck(t.outputs,"hid"),n=this.collection.get(e);n.set({percentage:100,status:"success",hids:i}),this.ui_button.model.set("percentage",this._uploadPercentage(100,n.get("file_size"))),this.upload_completed+=100*n.get("file_size"),this.counter.announce--,this.counter.success++,this._updateScreen(),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"error",info:t}),this.ui_button.model.set({percentage:this._uploadPercentage(100,i.get("file_size")),status:"danger"}),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.error++,this._updateScreen()},_eventComplete:function(){this.collection.each(function(e){"queued"==e.get("status")&&e.set("status","init")}),this.counter.running=0,this._updateScreen()},_eventBuild:function(){var e=[];o.forEach(this.collection.models,function(t){e.push.apply(e,t.get("hids"))});var t=o.map(e,function(e){return Galaxy.currHistoryPanel.collection.getByHid(e)}),i=new Galaxy.currHistoryPanel.collection.constructor(t);i.historyId=Galaxy.currHistoryPanel.collection.historyId,Galaxy.currHistoryPanel.buildCollection(this.collectionType,i,!0),this.counter.running=0,this._updateScreen(),this._eventReset(),this.app.modal.hide()},_eventRemove:function(e){var t=e.get("status");"success"==t?this.counter.success--:"error"==t?this.counter.error--:this.counter.announce--,this.uploadbox.remove(e.id),this._updateScreen()},showExtensionInfo:function(e){var t=this,i=e.$el,n=e.extension,a=e.title,r=o.findWhere(t.list_extensions,{id:n});this.extension_popup&&this.extension_popup.remove(),this.extension_popup=new s.View({placement:e.placement||"bottom",container:i}),this.extension_popup.title(a),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(r)),this.extension_popup.show()},_eventFtp:function(){if(this.ftp.visible)this.ftp.hide();else{this.ftp.empty();var e=this;this.ftp.append(new n({collection:this.collection,ftp_upload_site:this.ftp_upload_site,onadd:function(t){e.uploadbox.add([{mode:"ftp",name:t.path,size:t.size,path:t.path}])},onremove:function(t){e.collection.remove(t)}}).$el),this.ftp.show()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(!(0==this.counter.announce||this.counter.running>0)){var e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){"init"==t.get("status")&&(t.set("status","queued"),e.upload_size+=t.get("file_size"))}),this.ui_button.model.set({percentage:0,status:"success"}),this.counter.running=this.counter.announce,this.history_id=this.app.currentHistory(),this.uploadbox.start(),this._updateScreen()}},_eventStop:function(){this.counter.running>0&&(this.ui_button.model.set("status","info"),r(".upload-top-info").html("Queue will pause after completing the current file..."),this.uploadbox.stop())},_eventReset:function(){0==this.counter.running&&(this.collection.reset(),this.counter.reset(),this.uploadbox.reset(),this.select_extension.value(this.options.default_extension),this.select_genome.value(this.options.default_genome),this.ui_button.model.set("percentage",0),this._updateScreen())},updateExtension:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("extension")!=i.options.default_extension&&t||n.set("extension",e)})},updateCollectionType:function(e){this.collectionType=e},updateGenome:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("genome")!=i.options.default_genome&&t||n.set("genome",e)})},_updateScreen:function(){var e="";e=0==this.counter.announce?this.uploadbox.compatible()?" ":"Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.":0==this.counter.running?"You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":"Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",this.$(".upload-top-info").html(e);var t=0==this.counter.running&&this.counter.announce+this.counter.success+this.counter.error>0,i=0==this.counter.running&&this.counter.announce>0,n=0==this.counter.running&&0==this.counter.announce&&this.counter.success>0&&0==this.counter.error,s=0==this.counter.running,a=this.counter.announce+this.counter.success+this.counter.error>0;this.btnReset[t?"enable":"disable"](),this.btnStart[i?"enable":"disable"](),this.btnStart.$el[i?"addClass":"removeClass"]("btn-primary"),this.btnBuild[n?"enable":"disable"](),this.btnBuild.$el[n?"addClass":"removeClass"]("btn-primary"),this.btnStop[this.counter.running>0?"enable":"disable"](),this.btnLocal[s?"enable":"disable"](),this.btnFtp[s?"enable":"disable"](),this.btnCreate[s?"enable":"disable"](),this.btnFtp.$el[this.ftp_upload_site?"show":"hide"](),this.$(".upload-table")[a?"show":"hide"](),this.$(".upload-helper")[a?"hide":"show"]()},_uploadPercentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (<a href="'+e.description_url+'" target="_blank">read more</a>)'),t}return"There is no description available for this file extension."},_template:function(){return'<div class="upload-view-default"><div class="upload-top"><h6 class="upload-top-info"/></div><div class="upload-box"><div class="upload-helper"><i class="fa fa-files-o"/>Drop files here</div><table class="upload-table ui-table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Status</th><th/></tr></thead><tbody/></table></div><div class="upload-footer"><span class="upload-footer-title-compressed">Collection Type:</span><span class="upload-footer-collection-type"/><span class="upload-footer-title-compressed">File Type:</span><span class="upload-footer-extension"/><span class="upload-footer-extension-info upload-icon-button fa fa-search"/> <span class="upload-footer-title-compressed">Genome (set all):</span><span class="upload-footer-genome"/></div><div class="upload-buttons"/></div>'}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(59),i(58),i(14),i(7),i(15),i(63)],s=function(e,t,i,n,s,l){return a.View.extend({status_classes:{init:"upload-mode fa fa-exclamation text-primary",ready:"upload-mode fa fa-check text-success",running:"upload-mode fa fa-spinner fa-spin",success:"upload-mode fa fa-check",error:"upload-mode fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template()),this.$source=this.$(".upload-source"),this.$settings=this.$(".upload-settings"),this.$status=this.$(".upload-status"),this.$text=this.$(".upload-text"),this.$text_content=this.$(".upload-text-content"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$file_name=this.$(".upload-file-name"),this.$file_desc=this.$(".upload-file-desc"),this.$file_size=this.$(".upload-file-size"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.uploadinput=this.$el.uploadinput({ondragover:function(){i.model.get("enabled")&&i.$el.addClass("warning")},ondragleave:function(){i.$el.removeClass("warning")},onchange:function(e){"running"!=i.model.get("status")&&e&&e.length>0&&(i.model.reset({file_data:e[0],file_name:e[0].name,file_size:e[0].size,file_mode:e[0].mode||"local"}),i._refreshReady())}}),this.button_menu=new s.ButtonMenu({icon:"fa-caret-down",title:"Select",pull:"left"}),this.$source.append(this.button_menu.$el),this.button_menu.addMenu({icon:"fa-laptop",title:"Choose local file",onclick:function(){i.uploadinput.dialog()}}),this.app.ftp_upload_site&&this.button_menu.addMenu({icon:"fa-folder-open-o",title:"Choose FTP file",onclick:function(){i._showFtp()}}),this.button_menu.addMenu({icon:"fa-edit",title:"Paste/Fetch data",onclick:function(){i.model.reset({file_mode:"new",file_name:"New File"})}}),this.ftp=new n.View({title:"Choose FTP file:",container:this.$source.find(".ui-button-menu"),placement:"right"}),this.settings=new n.View({title:"Upload configuration",container:this.$settings,placement:"bottom"}),this.$text_content.on("change input",function(e){i.model.set({url_paste:o(e.target).val(),file_size:o(e.target).val().length}),i._refreshReady()}),this.$settings.on("click",function(e){i._showSettings()}).on("mousedown",function(e){e.preventDefault()}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:file_name",function(){i._refreshFileName()}),this.listenTo(this.model,"change:file_mode",function(){i._refreshMode()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()}),this.listenTo(this.model,"remove",function(){i.remove()}),this.app.collection.on("reset",function(){i.remove()})},render:function(){this.$el.attr("id","upload-row-"+this.model.id),this.$file_name.html(r.escape(this.model.get("file_name")||"-")),this.$file_desc.html(this.model.get("file_desc")||"Unavailable"),this.$file_size.html(e.bytesToString(this.model.get("file_size"))),this.$status.removeClass().addClass(this.status_classes.init)},remove:function(){a.View.prototype.remove.apply(this)},_refreshReady:function(){this.app.collection.each(function(e){e.set("status",e.get("file_size")>0&&"ready"||"init")})},_refreshMode:function(){var e=this.model.get("file_mode");"new"==e?(this.height=this.$el.height(),this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$text_content.val("").trigger("keyup")):(this.$el.height(this.height),this.$text.hide())},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("<strong>Failed: </strong>"+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));0!=e?this.$progress_bar.css({width:e+"%"}):(this.$progress_bar.addClass("no-transition"),this.$progress_bar.css({width:"0%"}),this.$progress_bar[0].offsetHeight,this.$progress_bar.removeClass("no-transition")),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$status.removeClass().addClass(this.status_classes[e]),this.model.set("enabled","running"!=e),this.$text_content.attr("disabled",!this.model.get("enabled")),this.$el.removeClass("success danger warning"),"running"!=e&&"ready"!=e||this.model.set("percentage",0),this.$source.find(".button")["running"==e?"addClass":"removeClass"]("disabled"),"success"==e&&(this.$el.addClass("success"),this.model.set("percentage",100),this.$percentage.html("100%")),"error"==e?(this.$el.addClass("danger"),this.model.set("percentage",0),this.$info_progress.hide(),this.$info_text.show()):(this.$info_progress.show(),this.$info_text.hide())},_refreshFileName:function(){this.$file_name.html(this.model.get("file_name")||"-")},_refreshFileSize:function(){this.$file_size.html(e.bytesToString(this.model.get("file_size")))},_showFtp:function(){if(this.ftp.visible)this.ftp.hide();else{var e=this;this.ftp.empty(),this.ftp.append(new i({ftp_upload_site:this.app.ftp_upload_site,onchange:function(t){e.ftp.hide(),"running"!=e.model.get("status")&&t&&(e.model.reset({file_mode:"ftp",file_name:t.path,file_size:t.size,file_path:t.path}),e._refreshReady())}}).$el),this.ftp.show()}},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new t(this).$el),this.settings.show())},_template:function(){return'<tr class="upload-row"><td><div class="upload-source"/><div class="upload-text-column"><div class="upload-text"><div class="upload-text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.</div><textarea class="upload-text-content form-control"/></div></div></td><td><div class="upload-status"/></td><td><div class="upload-file-desc upload-title"/></td><td><div class="upload-file-name upload-title"/></td><td><div class="upload-file-size upload-size"/></td><td><div class="upload-settings upload-icon-button fa fa-gear"/></td><td><div class="upload-info"><div class="upload-info-text"/><div class="upload-info-progress progress"><div class="upload-progress-bar progress-bar progress-bar-success"/><div class="upload-percentage">0%</div></div></div></td></tr>'}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(24),i(129),i(14),i(15),i(7)],s=function(e,t,i,n,s,l){return a.View.extend({collection:new t.Collection,initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.btnStart=new l.Button({title:"Start",onclick:function(){t._eventStart()}}),this.btnClose=new l.Button({title:"Close",onclick:function(){t.app.modal.hide()}}),o.each([this.btnStart,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.select_extension=new s.View({css:"upload-footer-selection",container:this.$(".upload-footer-extension"),data:o.filter(this.list_extensions,function(e){return e.composite_files}),onchange:function(e){t.collection.reset();var i=o.findWhere(t.list_extensions,{id:e});i&&i.composite_files&&o.each(i.composite_files,function(e){t.collection.add({id:t.collection.size(),file_desc:e.description||e.name})})}}),this.$(".upload-footer-extension-info").on("click",function(e){t._showExtensionInfo({$el:r(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new s.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome}),this.listenTo(this.collection,"add",function(e){t._eventAnnounce(e)}),this.listenTo(this.collection,"change add",function(){t.render()}),this.select_extension.options.onchange(this.select_extension.value()),this.render()},render:function(){var e=this.collection.first();e&&"running"==e.get("status")?(this.select_genome.disable(),this.select_extension.disable()):(this.select_genome.enable(),this.select_extension.enable()),this.collection.where({status:"ready"}).length==this.collection.length&&this.collection.length>0?(this.btnStart.enable(),this.btnStart.$el.addClass("btn-primary")):(this.btnStart.disable(),this.btnStart.$el.removeClass("btn-primary")),this.$(".upload-table")[this.collection.length>0?"show":"hide"]()},_eventAnnounce:function(e){var t=new i(this,{model:e});this.$(".upload-table > tbody:first").append(t.$el),this.$(".upload-table")[this.collection.length>0?"show":"hide"](),t.render()},_eventStart:function(){var e=this;this.collection.each(function(t){t.set({genome:e.select_genome.value(),extension:e.select_extension.value()})}),r.uploadpost({url:this.app.options.nginx_upload_path,data:this.app.toData(this.collection.filter()),success:function(t){e._eventSuccess(t)},error:function(t){e._eventError(t)},progress:function(t){e._eventProgress(t)}})},_eventProgress:function(e){this.collection.each(function(t){t.set("percentage",e)})},_eventSuccess:function(e){this.collection.each(function(e){e.set("status","success")}),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e){this.collection.each(function(t){t.set({status:"error",info:e})})},_showExtensionInfo:function(e){var t=e.$el,i=e.extension,s=e.title,a=o.findWhere(this.list_extensions,{id:i});this.extension_popup&&this.extension_popup.remove(),this.extension_popup=new n.View({placement:e.placement||"bottom",container:t,destroy:!0}),this.extension_popup.title(s),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(a)),this.extension_popup.show()},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (<a href="'+e.description_url+'" target="_blank">read more</a>)'),t}return"There is no description available for this file extension."},_template:function(){return'<div class="upload-view-composite"><div class="upload-footer"><span class="upload-footer-title">Composite Type:</span><span class="upload-footer-extension"/><span class="upload-footer-extension-info upload-icon-button fa fa-search"/> <span class="upload-footer-title">Genome/Build:</span><span class="upload-footer-genome"/></div><div class="upload-box"><table class="upload-table ui-table-striped" style="display: none;"><thead><tr><th/><th/><th>Description</th><th>Name</th><th>Size</th><th>Settings</th><th>Status</th></tr></thead><tbody/></table></div><div class="upload-buttons"/></div>'}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(24),i(59),i(14),i(15)],s=function(e,t,i,n,s){return a.View.extend({status_classes:{init:"upload-icon-button fa fa-trash-o",queued:"upload-icon fa fa-spinner fa-spin",running:"upload-icon fa fa-spinner fa-spin",success:"upload-icon-button fa fa-check",error:"upload-icon-button fa fa-exclamation-triangle"},initialize:function(e,t){var i=this;this.app=e,this.model=t.model,this.setElement(this._template(t.model)),this.$mode=this.$(".upload-mode"),this.$title=this.$(".upload-title"),this.$text=this.$(".upload-text"),this.$size=this.$(".upload-size"),this.$info_text=this.$(".upload-info-text"),this.$info_progress=this.$(".upload-info-progress"),this.$text_content=this.$(".upload-text-content"),this.$settings=this.$(".upload-settings"),this.$symbol=this.$(".upload-symbol"),this.$progress_bar=this.$(".upload-progress-bar"),this.$percentage=this.$(".upload-percentage"),this.settings=new n.View({title:"Upload configuration",container:this.$(".upload-settings"),placement:"bottom"});var a=this.app.select_genome.value(),r=this.app.select_extension.value();this.select_genome=new s.View({css:"upload-genome",data:i.app.list_genomes,container:this.$(".upload-genome"),value:a,onchange:function(e){i.model.set("genome",e)}}),this.select_extension=new s.View({
css:"upload-extension",data:i.app.list_extensions,container:this.$(".upload-extension"),value:r,onchange:function(e){i.model.set("extension",e)}}),this.model.set({genome:a,extension:r}),this.$symbol.on("click",function(){i._removeRow()}),this.$(".upload-extension-info").on("click",function(e){i.app.showExtensionInfo({$el:o(e.target),title:i.select_extension.text(),extension:i.select_extension.value()})}).on("mousedown",function(e){e.preventDefault()}),this.$settings.on("click",function(e){i._showSettings()}).on("mousedown",function(e){e.preventDefault()}),this.$text_content.on("change input",function(e){i.model.set({url_paste:o(e.target).val(),file_size:o(e.target).val().length})}),this.listenTo(this.model,"change:percentage",function(){i._refreshPercentage()}),this.listenTo(this.model,"change:status",function(){i._refreshStatus()}),this.listenTo(this.model,"change:info",function(){i._refreshInfo()}),this.listenTo(this.model,"change:genome",function(){i._refreshGenome()}),this.listenTo(this.model,"change:extension",function(){i._refreshExtension()}),this.listenTo(this.model,"change:file_size",function(){i._refreshFileSize()}),this.listenTo(this.model,"remove",function(){i.remove()}),this.app.collection.on("reset",function(){i.remove()})},render:function(){var t=this.model.attributes;this.$title.html(r.escape(t.file_name)),this.$size.html(e.bytesToString(t.file_size)),this.$mode.removeClass().addClass("upload-mode").addClass("text-primary"),"new"==t.file_mode?(this.$text.css({width:this.$el.width()-16+"px",top:this.$el.height()-8+"px"}).show(),this.$el.height(this.$el.height()-8+this.$text.height()+16),this.$mode.addClass("fa fa-edit")):"local"==t.file_mode?this.$mode.addClass("fa fa-laptop"):"ftp"==t.file_mode&&this.$mode.addClass("fa fa-folder-open-o")},remove:function(){this.select_genome.remove(),this.select_extension.remove(),a.View.prototype.remove.apply(this)},_refreshExtension:function(){this.select_extension.value(this.model.get("extension"))},_refreshGenome:function(){this.select_genome.value(this.model.get("genome"))},_refreshInfo:function(){var e=this.model.get("info");e?this.$info_text.html("<strong>Failed: </strong>"+e).show():this.$info_text.hide()},_refreshPercentage:function(){var e=parseInt(this.model.get("percentage"));this.$progress_bar.css({width:e+"%"}),this.$percentage.html(100!=e?e+"%":"Adding to history...")},_refreshStatus:function(){var e=this.model.get("status");this.$symbol.removeClass().addClass("upload-symbol").addClass(this.status_classes[e]),this.model.set("enabled","init"==e);var t=this.model.get("enabled");this.$text_content.attr("disabled",!t),t?(this.select_genome.enable(),this.select_extension.enable()):(this.select_genome.disable(),this.select_extension.disable()),"success"==e&&(this.$el.addClass("success"),this.$percentage.html("100%")),"error"==e&&(this.$el.addClass("danger"),this.$info_progress.hide())},_refreshFileSize:function(){this.$size.html(e.bytesToString(this.model.get("file_size")))},_removeRow:function(){["init","success","error"].indexOf(this.model.get("status"))!==-1&&this.app.collection.remove(this.model)},_showSettings:function(){this.settings.visible?this.settings.hide():(this.settings.empty(),this.settings.append(new i(this).$el),this.settings.show())},_template:function(e){return'<tr id="upload-row-'+e.id+'" class="upload-row"><td><div class="upload-text-column"><div class="upload-mode"/><div class="upload-title"/><div class="upload-text"><div class="upload-text-info">You can tell Galaxy to download data from web by entering URL in this box (one per line). You can also directly paste the contents of a file.</div><textarea class="upload-text-content form-control"/></div></div></td><td><div class="upload-size"/></td><td><div class="upload-extension" style="float: left;"/>  <div class="upload-extension-info upload-icon-button fa fa-search"/></td><td><div class="upload-genome"/></td><td><div class="upload-settings upload-icon-button fa fa-gear"/></td><td><div class="upload-info"><div class="upload-info-text"/><div class="upload-info-progress progress"><div class="upload-progress-bar progress-bar progress-bar-success"/><div class="upload-percentage">0%</div></div></div></td><td><div class="upload-symbol '+this.status_classes.init+'"/></td></tr>'}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(a,o,r){n=[i(4),i(24),i(131),i(58),i(14),i(15),i(7),i(63)],s=function(e,t,i,n,s,l,c){return a.View.extend({upload_size:0,collection:new t.Collection,counter:{announce:0,success:0,error:0,running:0,reset:function(){this.announce=this.success=this.error=this.running=0}},initialize:function(e){var t=this;this.app=e,this.options=e.options,this.list_extensions=e.list_extensions,this.list_genomes=e.list_genomes,this.ui_button=e.ui_button,this.ftp_upload_site=e.currentFtp(),this.setElement(this._template()),this.btnLocal=new c.Button({id:"btn-local",title:"Choose local file",onclick:function(){t.uploadbox.select()},icon:"fa fa-laptop"}),this.btnFtp=new c.Button({id:"btn-ftp",title:"Choose FTP file",onclick:function(){t._eventFtp()},icon:"fa fa-folder-open-o"}),this.btnCreate=new c.Button({id:"btn-new",title:"Paste/Fetch data",onclick:function(){t._eventCreate()},icon:"fa fa-edit"}),this.btnStart=new c.Button({id:"btn-start",title:"Start",onclick:function(){t._eventStart()}}),this.btnStop=new c.Button({id:"btn-stop",title:"Pause",onclick:function(){t._eventStop()}}),this.btnReset=new c.Button({id:"btn-reset",title:"Reset",onclick:function(){t._eventReset()}}),this.btnClose=new c.Button({id:"btn-close",title:"Close",onclick:function(){t.app.modal.hide()}}),o.each([this.btnLocal,this.btnFtp,this.btnCreate,this.btnStop,this.btnReset,this.btnStart,this.btnClose],function(e){t.$(".upload-buttons").prepend(e.$el)}),this.uploadbox=this.$(".upload-box").uploadbox({url:this.app.options.nginx_upload_path,announce:function(e,i){t._eventAnnounce(e,i)},initialize:function(e){return t.app.toData([t.collection.get(e)],t.history_id)},progress:function(e,i){t._eventProgress(e,i)},success:function(e,i){t._eventSuccess(e,i)},error:function(e,i){t._eventError(e,i)},complete:function(){t._eventComplete()},ondragover:function(){t.$(".upload-box").addClass("highlight")},ondragleave:function(){t.$(".upload-box").removeClass("highlight")}}),this.ftp=new s.View({title:"FTP files",container:this.btnFtp.$el}),this.select_extension=new l.View({css:"upload-footer-selection",container:this.$(".upload-footer-extension"),data:o.filter(this.list_extensions,function(e){return!e.composite_files}),value:this.options.default_extension,onchange:function(e){t.updateExtension(e)}}),this.$(".upload-footer-extension-info").on("click",function(e){t.showExtensionInfo({$el:r(e.target),title:t.select_extension.text(),extension:t.select_extension.value(),placement:"top"})}).on("mousedown",function(e){e.preventDefault()}),this.select_genome=new l.View({css:"upload-footer-selection",container:this.$(".upload-footer-genome"),data:this.list_genomes,value:this.options.default_genome,onchange:function(e){t.updateGenome(e)}}),this.collection.on("remove",function(e){t._eventRemove(e)}),this._updateScreen()},_eventAnnounce:function(e,n){this.counter.announce++;var s=new t.Model({id:e,file_name:n.name,file_size:n.size,file_mode:n.mode||"local",file_path:n.path,file_data:n});this.collection.add(s);var a=new i(this,{model:s});this.$(".upload-table > tbody:first").append(a.$el),this._updateScreen(),a.render()},_eventProgress:function(e,t){var i=this.collection.get(e);i.set("percentage",t),this.ui_button.model.set("percentage",this._uploadPercentage(t,i.get("file_size")))},_eventSuccess:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"success"}),this.ui_button.model.set("percentage",this._uploadPercentage(100,i.get("file_size"))),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.success++,this._updateScreen(),Galaxy.currHistoryPanel.refreshContents()},_eventError:function(e,t){var i=this.collection.get(e);i.set({percentage:100,status:"error",info:t}),this.ui_button.model.set({percentage:this._uploadPercentage(100,i.get("file_size")),status:"danger"}),this.upload_completed+=100*i.get("file_size"),this.counter.announce--,this.counter.error++,this._updateScreen()},_eventComplete:function(){this.collection.each(function(e){"queued"==e.get("status")&&e.set("status","init")}),this.counter.running=0,this._updateScreen()},_eventRemove:function(e){var t=e.get("status");"success"==t?this.counter.success--:"error"==t?this.counter.error--:this.counter.announce--,this.uploadbox.remove(e.id),this._updateScreen()},showExtensionInfo:function(e){var t=this,i=e.$el,n=e.extension,a=e.title,r=o.findWhere(t.list_extensions,{id:n});this.extension_popup&&this.extension_popup.remove(),this.extension_popup=new s.View({placement:e.placement||"bottom",container:i}),this.extension_popup.title(a),this.extension_popup.empty(),this.extension_popup.append(this._templateDescription(r)),this.extension_popup.show()},_eventFtp:function(){if(this.ftp.visible)this.ftp.hide();else{this.ftp.empty();var e=this;this.ftp.append(new n({collection:this.collection,ftp_upload_site:this.ftp_upload_site,onadd:function(t){e.uploadbox.add([{mode:"ftp",name:t.path,size:t.size,path:t.path}])},onremove:function(t){e.collection.remove(t)}}).$el),this.ftp.show()}},_eventCreate:function(){this.uploadbox.add([{name:"New File",size:0,mode:"new"}])},_eventStart:function(){if(!(0==this.counter.announce||this.counter.running>0)){var e=this;this.upload_size=0,this.upload_completed=0,this.collection.each(function(t){"init"==t.get("status")&&(t.set("status","queued"),e.upload_size+=t.get("file_size"))}),this.ui_button.model.set({percentage:0,status:"success"}),this.counter.running=this.counter.announce,this.history_id=this.app.currentHistory(),this.uploadbox.start(),this._updateScreen()}},_eventStop:function(){this.counter.running>0&&(this.ui_button.model.set("status","info"),r(".upload-top-info").html("Queue will pause after completing the current file..."),this.uploadbox.stop())},_eventReset:function(){0==this.counter.running&&(this.collection.reset(),this.counter.reset(),this.uploadbox.reset(),this.select_extension.value(this.options.default_extension),this.select_genome.value(this.options.default_genome),this.ui_button.model.set("percentage",0),this._updateScreen())},updateExtension:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("extension")!=i.options.default_extension&&t||n.set("extension",e)})},updateGenome:function(e,t){var i=this;this.collection.each(function(n){"init"!=n.get("status")||n.get("genome")!=i.options.default_genome&&t||n.set("genome",e)})},_updateScreen:function(){var e="";e=0==this.counter.announce?this.uploadbox.compatible()?" ":"Browser does not support Drag & Drop. Try Firefox 4+, Chrome 7+, IE 10+, Opera 12+ or Safari 6+.":0==this.counter.running?"You added "+this.counter.announce+" file(s) to the queue. Add more files or click 'Start' to proceed.":"Please wait..."+this.counter.announce+" out of "+this.counter.running+" remaining.",this.$(".upload-top-info").html(e);var t=0==this.counter.running&&this.counter.announce+this.counter.success+this.counter.error>0,i=0==this.counter.running&&this.counter.announce>0,n=0==this.counter.running,s=this.counter.announce+this.counter.success+this.counter.error>0;this.btnReset[t?"enable":"disable"](),this.btnStart[i?"enable":"disable"](),this.btnStart.$el[i?"addClass":"removeClass"]("btn-primary"),this.btnStop[this.counter.running>0?"enable":"disable"](),this.btnLocal[n?"enable":"disable"](),this.btnFtp[n?"enable":"disable"](),this.btnCreate[n?"enable":"disable"](),this.btnFtp.$el[this.ftp_upload_site?"show":"hide"](),this.$(".upload-table")[s?"show":"hide"](),this.$(".upload-helper")[s?"hide":"show"]()},_uploadPercentage:function(e,t){return(this.upload_completed+e*t)/this.upload_size},_templateDescription:function(e){if(e.description){var t=e.description;return e.description_url&&(t+=' (<a href="'+e.description_url+'" target="_blank">read more</a>)'),t}return"There is no description available for this file extension."},_template:function(){return'<div class="upload-view-default"><div class="upload-top"><h6 class="upload-top-info"/></div><div class="upload-box"><div class="upload-helper"><i class="fa fa-files-o"/>Drop files here</div><table class="upload-table ui-table-striped" style="display: none;"><thead><tr><th>Name</th><th>Size</th><th>Type</th><th>Genome</th><th>Settings</th><th>Status</th><th/></tr></thead><tbody/></table></div><div class="upload-footer"><span class="upload-footer-title">Type (set all):</span><span class="upload-footer-extension"/><span class="upload-footer-extension-info upload-icon-button fa fa-search"/> <span class="upload-footer-title">Genome (set all):</span><span class="upload-footer-genome"/></div><div class="upload-buttons"/></div>'}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(2),i(1))},function(e,t,i){var n,s;(function(i,a){n=[],s=function(){var e=i.View.extend({initialize:function(e){var t=this;this.model=e&&e.model||new i.Model({icon:"fa-upload",tooltip:"Download from URL or upload files from disk",label:"Load Data",percentage:0,status:"",onunload:function(){},onclick:function(){}}).set(e),this.setElement(this._template()),this.$progress=this.$(".progress-bar"),this.listenTo(this.model,"change",this.render,this),this.render(),a(window).on("beforeunload",function(){return t.model.get("onunload")()})},render:function(){var e=this.model.attributes;this.$el.off("click").on("click",function(t){e.onclick(t)}).tooltip({title:this.model.get("tooltip"),placement:"bottom"}),this.$progress.removeClass().addClass("progress-bar").addClass("progress-bar-notransition").addClass(""!=e.status&&"progress-bar-"+e.status).css({width:e.percentage+"%"})},_template:function(){return'<div class="upload-button"><div class="progress"><div class="progress-bar"/><a class="panel-header-button" href="javascript:void(0)" id="tool-panel-upload-button"><span class="fa fa-upload"/></a></div></div>'}});return{View:e}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1))},function(e,t,i){var n,s;(function(a){n=[i(4),i(8),i(126),i(133),i(132),i(130),i(128)],s=function(e,t,i,n,s,o,r){return a.View.extend({options:{nginx_upload_path:"",ftp_upload_site:"n/a",default_genome:"?",default_extension:"auto",height:500,width:900,auto:{id:"auto",text:"Auto-detect",description:"This system will try to detect the file type automatically. If your file is not detected properly as one of the known formats, it most likely means that it has some format problems (e.g., different number of columns on different rows). You can still coerce the system to set your data to the format you think it should be. You can also upload compressed files, which will automatically be decompressed."}},list_extensions:[],list_genomes:[],initialize:function(t){var i=this;this.options=e.merge(t,this.options),this.ui_button=new n.View({onclick:function(e){e.preventDefault(),i.show()},onunload:function(){var e=i.ui_button.model.get("percentage",0);if(e>0&&e<100)return"Several uploads are queued."}}),this.setElement(this.ui_button.$el);var i=this;e.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(e){for(key in e)i.list_extensions.push({id:e[key].extension,text:e[key].extension,description:e[key].description,description_url:e[key].description_url,composite_files:e[key].composite_files});i.list_extensions.sort(function(e,t){var i=e.text&&e.text.toLowerCase(),n=t.text&&t.text.toLowerCase();return i>n?1:i<n?-1:0}),i.options.datatypes_disable_auto||i.list_extensions.unshift(i.options.auto)}}),e.get({url:Galaxy.root+"api/genomes",success:function(e){for(key in e)i.list_genomes.push({id:e[key][1],text:e[key][0]});i.list_genomes.sort(function(e,t){return e.id==i.options.default_genome?-1:t.id==i.options.default_genome?1:e.text>t.text?1:e.text<t.text?-1:0})}})},show:function(){var e=this;return Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.model?(this.current_user=Galaxy.user.id,this.modal||(this.tabs=new i.View,this.default_view=new s(this),this.tabs.add({id:"regular",title:"Regular",$el:this.default_view.$el}),this.composite_view=new o(this),this.tabs.add({id:"composite",title:"Composite",$el:this.composite_view.$el}),this.collection_view=new r(this),this.tabs.add({id:"collection",title:"Collection",$el:this.collection_view.$el}),this.modal=new t.View({title:"Download from web or upload from disk",body:this.tabs.$el,height:this.options.height,width:this.options.width,closing_events:!0,title_separator:!1})),void this.modal.show()):void window.setTimeout(function(){e.show()},500)},currentHistory:function(){return this.current_user&&Galaxy.currHistoryPanel.model.get("id")},currentFtp:function(){return this.current_user&&this.options.ftp_upload_site},toData:function(e,t){var i={payload:{tool_id:"upload1",history_id:t||this.currentHistory(),inputs:{}},files:[],error_message:null};if(e&&e.length>0){var n={};n.dbkey=e[0].get("genome",null),n.file_type=e[0].get("extension",null);for(var s in e){var a=e[s];if(a.set("status","running"),!(a.get("file_size")>0)){i.error_message="Upload content incomplete.",a.set("status","error"),a.set("info",i.error_message);break}var o="files_"+s+"|";switch(n[o+"type"]="upload_dataset",n[o+"space_to_tab"]=a.get("space_to_tab")&&"Yes"||null,n[o+"to_posix_lines"]=a.get("to_posix_lines")&&"Yes"||null,a.get("file_mode")){case"new":n[o+"url_paste"]=a.get("url_paste");break;case"ftp":n[o+"ftp_files"]=a.get("file_path");break;case"local":i.files.push({name:o+"file_data",file:a.get("file_data")})}}i.payload.inputs=JSON.stringify(n)}return i}})}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3))},function(e,t,i){var n,s;(function(a,o){n=[i(4),i(7),i(20),i(27)],s=function(e,t,i,n){var s=a.Collection.extend({comparator:function(e,t){return e=e.get("name"),t=t.get("name"),e>t?1:e<t?-1:0}}),r=a.View.extend({initialize:function(e){var i=this,r=Galaxy.currHistoryPanel&&Galaxy.currHistoryPanel.model.id;this.model=new a.Model,this.model.url=Galaxy.root+"api/histories/"+r+"/custom_builds_metadata",this.collection=new s,this.collection.url=Galaxy.root+"api/users/"+Galaxy.user.id+"/custom_builds",this.message=new t.Message({}),this.installed_builds=new t.Select.View({optional:!0,onchange:function(){i.installed_builds.value(null)},empty_text:"List of available builds:",error_text:"No system installed builds available."}),this.table=new n.View({cls:"grid",selectable:!1}),this.table.addHeader("Name"),this.table.addHeader("Key"),this.table.addHeader("Number of chroms/contigs"),this.table.addHeader(""),this.table.appendHeader(),this.setElement(o("<div/>").append(o("<h4/>").text("Current Custom Builds")).append(this.table.$el).append(this.$installed=o("<div/>").append(o("<h4/>").text("System Installed Builds").addClass("ui-margin-top")).append(this.installed_builds.$el)).append(o("<h4/>").text("Add a Custom Build").addClass("ui-margin-top")).append(o("<span/>").addClass("ui-column").append(o("<div/>").addClass("ui-column-left").append(this.message.$el).append(this.$form=o("<div/>").addClass("ui-margin-top"))).append(this.$help=o("<div/>").addClass("ui-column-right")))),this.listenTo(this.collection,"add remove reset",function(){i._renderTable()}),this.listenTo(this.model,"change",function(){i._renderForm()}),this.collection.fetch(),this.model.fetch()},render:function(){this._renderTable(),this._renderForm()},_renderTable:function(){var e=this;this.table.delAll(),this.collection.sort(),this.collection.each(function(i){e.table.add(i.id),e.table.add(i.get("name")),e.table.add(void 0!==i.get("count")?i.get("count"):"Processing..."),e.table.add(new t.ButtonIcon({icon:"fa-trash-o",cls:"ui-button-icon-plain",tooltip:"Delete custom build.",onclick:function(){i.destroy()}}).$el),e.table.append(i.id)})},_renderForm:function(){var e=this,n="fasta",s=new i({inputs:[{type:"text",name:"name",label:"Name",help:"Specify a build name e.g. Hamster."},{type:"text",name:"id",label:"Key",help:"Specify a build key e.g. hamster_v1."},{name:"len",type:"conditional",test_param:{name:"type",label:"Definition",help:"Provide the data source.",type:"select",value:n,data:[{value:"fasta",label:"FASTA-file from history"},{value:"file",label:"Len-file from disk"},{value:"text",label:"Len-file by copy/paste"}]},cases:[{value:"fasta",inputs:[{type:"select",name:"value",label:"FASTA-file",data:this.model.get("fasta_hdas")}]},{value:"file",inputs:[{type:"upload",name:"value",label:"Len-file",data:this.model.get("len_hdas")}]},{value:"text",inputs:[{type:"text",area:!0,name:"value",label:"Edit/Paste"}]}]}],buttons:{save:new t.Button({icon:"fa-save",tooltip:"Create new Build",title:"Save",cls:"ui-button btn btn-primary",floating:"clear",onclick:function(){var t=s.data.create();t.id&&t.name?e.collection.create(t,{wait:!0,success:function(t){t.get("message")?e.message.update({message:t.get("message"),status:"warning"}):e.message.update({message:"Successfully added a new custom build.",status:"success"})},error:function(t,i){var n=i&&i.responseJSON&&i.responseJSON.err_msg;e.message.update({message:n||"Failed to create custom build.",status:"danger"})}}):e.message.update({message:"All inputs are required.",status:"danger"})}})},onchange:function(){var t=s.data.match("len|type");if(t){var i=s.field_list[t];e._renderHelp(i.value())}}});this.$form.empty().append(s.$el);var a=this.model.get("installed_builds");a&&a.length?(this.$installed.show(),this.installed_builds.update(this.model.get("installed_builds"))):this.$installed.hide(),this._renderHelp(n)},_renderHelp:function(e){this.$help.empty().addClass("alert alert-info").html("fasta"==e?this._templateFasta():this._templateLen())},_templateLen:function(){return"<h4>Length Format</h4><p>The length format is two-column, separated by whitespace, of the form:<pre>chrom/contig length of chrom/contig</pre></p><p>For example, the first few entries of <em>mm9.len</em> are as follows:<pre>chr1 197195432\nchr2 181748087\nchr3 159599783\nchr4 155630120\nchr5 152537259</pre></p><p>Trackster uses this information to populate the select box for chrom/contig, andto set the maximum basepair of the track browser. You may either upload a .len fileof this format (Len File option), or directly enter the information into the box (Len Entry option).</p>"},_templateFasta:function(){return"<h4>FASTA format</h4><p>This is a multi-fasta file from your current history that provides the genomesequences for each chromosome/contig in your build.</p><p>Here is a snippet from an example multi-fasta file:<pre>>chr1\nATTATATATAAGACCACAGAGAGAATATTTTGCCCGG...\n\n>chr2\nGGCGGCCGCGGCGATATAGAACTACTCATTATATATA...\n\n...</pre></p>"}});return{View:r}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1))},function(e,t,i){var n,s;(function(a,o,r){n=[i(20),i(7)],s=function(e,t){var i=a.Model.extend({initialize:function(e){e=e||{},e.user_id=e.user_id||Galaxy.user.id,this.set({user_id:e.user_id,information:{title:"Manage information",description:"Edit your email, addresses and custom parameters or change your username.",url:"api/users/"+e.user_id+"/information/inputs",icon:"fa-user"},password:{title:"Change password",description:"Allows you to change your login credentials.",icon:"fa-unlock-alt",url:"api/users/"+e.user_id+"/password/inputs",submit_title:"Save password"},communication:{title:"Change communication settings",description:"Enable or disable the communication feature to chat with other users.",url:"api/users/"+e.user_id+"/communication/inputs",icon:"fa-comments-o"},permissions:{title:"Set dataset permissions for new histories",description:"Grant others default access to newly created histories. Changes made here will only affect histories created after these settings have been stored.",url:"api/users/"+e.user_id+"/permissions/inputs",icon:"fa-users",submit_title:"Save permissions"},api_key:{title:"Manage API key",description:"Access your current API key or create a new one.",url:"api/users/"+e.user_id+"/api_key/inputs",icon:"fa-key",submit_title:"Create a new key",submit_icon:"fa-check"},toolbox_filters:{title:"Manage Toolbox filters",description:"Customize your Toolbox by displaying or omitting sets of Tools.",url:"api/users/"+e.user_id+"/toolbox_filters/inputs",icon:"fa-filter",submit_title:"Save filters"},openids:{title:"Manage OpenIDs",description:"Associate OpenIDs with your account.",icon:"fa-openid",onclick:function(){window.location.href=Galaxy.root+"user/openid_manage?cntrller=user&use_panels=True"}},custom_builds:{title:"Manage custom builds",description:"Add or remove custom builds using history datasets.",icon:"fa-cubes",onclick:function(){window.location.href=Galaxy.root+"custom_builds"}},logout:{title:"Sign out",description:"Click here to sign out of all sessions.",icon:"fa-sign-out",onclick:function(){Galaxy.modal.show({title:"Sign out",body:"Do you want to continue and sign out of all active sessions?",buttons:{Cancel:function(){Galaxy.modal.hide()},"Sign out":function(){window.location.href=Galaxy.root+"user/logout"}}})}}})}}),n=a.View.extend({initialize:function(){this.model=new i,this.message=new t.Message,this.setElement("<div/>"),this.render()},render:function(){var e=this,t=Galaxy.config;o.getJSON(Galaxy.root+"api/users/"+Galaxy.user.id,function(i){e.$preferences=o("<div/>").addClass("ui-panel").append(e.message.$el).append(o("<h2/>").append("User preferences")).append(o("<p/>").append("You are logged in as <strong>"+r.escape(i.email)+"</strong>.")).append(e.$table=o("<table/>").addClass("ui-panel-table")),t.use_remote_user||(e._addLink("information"),e._addLink("password")),t.enable_communication_server&&e._addLink("communication"),e._addLink("custom_builds"),e._addLink("permissions"),e._addLink("api_key"),t.has_user_tool_filters&&e._addLink("toolbox_filters"),t.enable_openid&&!t.use_remote_user&&e._addLink("openids"),e._addLink("logout"),e.$preferences.append(e._templateFooter(i)),e.$el.empty().append(e.$preferences)})},_addLink:function(e){var t=this.model.get(e),i=o(this._templateLink(t)),n=i.find("a");t.onclick?n.on("click",function(){t.onclick()}):n.attr("href",Galaxy.root+"user/"+e),this.$table.append(i)},_templateLink:function(e){return'<tr><td><div class="ui-panel-icon fa '+e.icon+'"></td><td><a class="ui-panel-anchor" href="javascript:void(0)">'+e.title+'</a><div class="ui-form-info">'+e.description+"</div></td></tr>"},_templateFooter:function(e){return'<p class="ui-panel-footer">You are using <strong>'+e.nice_total_disk_usage+"</strong> of disk space in this Galaxy instance. "+(Galaxy.config.enable_quotas?"Your disk quota is: <strong>"+e.quota+"</strong>. ":"")+'Is your usage more than expected? See the <a href="https://galaxyproject.org/learn/managing-datasets/" target="_blank">documentation</a> for tips on how to find all of the data in your account.</p>'}}),s=a.View.extend({initialize:function(e){this.model=new i(e),this.page=this.model.get(e.form_id),this.setElement("<div/>"),this.render()},render:function(){var i=this;o.ajax({url:Galaxy.root+this.page.url,type:"GET"}).done(function(n){var s=o.extend({},i.page,n),a=new e({title:s.title,icon:s.icon,inputs:s.inputs,operations:{submit:new t.ButtonIcon({tooltip:s.submit_tooltip,title:s.submit_title||"Save settings",icon:s.submit_icon||"fa-save",onclick:function(){i._submit(a,s)}})}});i.$el.empty().append(a.$el)}).fail(function(e){i.$el.empty().append(new t.Message({message:"Failed to load resource "+i.page.url+".",status:"danger",persistent:!0}).$el)})},_submit:function(e,t){o.ajax({url:Galaxy.root+t.url,data:JSON.stringify(e.data.create()),type:"PUT",contentType:"application/json"}).done(function(t){e.data.matchModel(t,function(t,i){e.field_list[i].value(t.value)}),e.message.update({message:t.message,status:"success"})}).fail(function(t){e.message.update({message:t.responseJSON.err_msg,status:"danger"})})}});return{View:n,Forms:s}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},,function(e,t,i){var n,s;(function(i,a,o){n=[],s=function(){var e=i.View.extend({initialize:function(e){this.setElement("<div/>"),this.render()},render:function(){var e=this;a.getJSON(Galaxy.root+"api/workflows/menu/",function(t){var i=t.workflows,n=t.ids_in_menu,s=null;e.$el.empty().append(e._templateConfigWorkflowHeader()),s=e.$el.find(".configure-workflows"),s.append(e._templateActionButtons()),i.length>0?(s.append(e._templateConfigureWorkflow(e,i,n)),e.save_workflow_menu(e),e.make_checked(e,n),e.register_check_uncheck_all(e)):s.append(e._templateNoWorkflow())})},register_check_uncheck_all:function(e){var t=e.$el.find(".check-all-wf"),i=e.$el.find(".uncheck-all-wf");t.click(function(t){e.check_uncheck_all(e,!0)}),i.click(function(t){e.check_uncheck_all(e,!1)})},check_uncheck_all:function(e,t){a.each(e.$el.find(".wf-config-item"),function(){var e=a(this)[0];e.checked=t})},make_checked:function(e,t){a.each(e.$el.find(".wf-config-item"),function(){var e=a(this)[0];o.each(t,function(t){parseInt(e.value)===t&&(e.checked=!0)})})},save_workflow_menu:function(e){var t=e.$el.find(".wf-save-menu");t.click(function(t){var i=[];a.each(e.$el.find(".wf-config-item"),function(){var e=a(this)[0];(e.checked||"true"===e.checked)&&i.push(parseInt(e.value))}),a.ajax({type:"PUT",url:Galaxy.root+"api/workflows/menu/",data:JSON.stringify({workflow_ids:i}),contentType:"application/json"}).done(function(e){window.location=Galaxy.root+"workflow?status="+e.status+"&message="+e.message})})},_templateActionButtons:function(){return'<ul class="manage-table-actions"><li><a class="fa fa-check-square-o wf-action check-all-wf" title="Select all workflows" href="#"></a></li><li><a class="fa fa-square-o wf-action uncheck-all-wf" title="Unselect all workflows" href="#"></a></li></ul>'},_templateConfigureWorkflow:function(e,t,i){var n="",s="";return n+='<table class="table colored"><thead><tr class="header"><th class="wf-td">Name</th><th class="wf-td">Owner</th><th class="wf-td"># of Steps</th><th class="wf-td">Show in menu</th></tr></thead>',o.each(t,function(t){s=s+'<tr><td class="wf-td">'+o.escape(t.name)+"</td><td>"+(t.owner===Galaxy.user.attributes.username?"You":t.owner)+'</td><td class="wf-td">'+t.number_of_steps+'</td><td class="wf-td">'+e._templateInputCheckbox(e,t,i)+"</td></tr>"}),n=n+'<tbody class="workflow-config-menu">'+s+"</tbody></table>",n=n+'<a class="action-button wf-save-menu wf-action fa fa-floppy-o" href="#" title="Save"><span>Save</span></a><a class="action-button wf-back wf-action fa fa-arrow-left" href="'+Galaxy.root+'workflow" title="Back to workflow"><span>Back to workflow</span></a>'},_templateNoWorkflow:function(){return'<div class="wf-nodata"> You do not have any accessible workflows. </div>'},_templateInputCheckbox:function(e,t){return'<input type="checkbox" class="wf-config-item" name="workflow_ids" value="'+t.id+'" />'},_templateConfigWorkflowHeader:function(){return'<div class="page-container"><div class="configure-workflows wf"><h2>Configure workflow menu</h2></div></div>'}});return{View:e}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},function(e,t,i){var n,s;(function(i,a,o){n=[],s=function(){var e=i.View.extend({initialize:function(){this.setElement("<div/>"),this.render()},render:function(){var e=this,t=3;a.getJSON(Galaxy.root+"api/workflows/",function(i){var n=null;e.$el.empty().append(e._templateHeader()),e.build_messages(e),n=e.$el.find(".user-workflows"),n.append(e._templateActionButtons()),i.length>0?(n.append(e._templateWorkflowTable(e,i)),e.adjust_actiondropdown(n),o.each(i,function(t){e.confirm_delete(e,t)}),e.search_workflow(e,e.$el.find(".search-wf"),e.$el.find(".workflow-search tr"),t)):n.append(e._templateNoWorkflow())})},build_messages:function(e){var t=e.$el.find(".response-message"),i=e.get_querystring("status"),n=e.get_querystring("message");n&&null!==n&&""!==n?(t.addClass(i+"message"),t.html("<p>"+o.escape(n)+"</p>")):t.html("");
},confirm_delete:function(e,t){var i=e.$el.find(".link-confirm-"+t.id),n=e.$el.find(".link-confirm-shared-"+t.id);i.click(function(){return confirm("Are you sure you want to delete workflow '"+t.name+"'?")}),n.click(function(){return confirm("Are you sure you want to remove the shared workflow '"+t.name+"'?")})},search_workflow:function(e,t,i,n){t.on("keyup",function(){var e=a(this).val();if(e.length>=n){var t=new RegExp(e,"i");i.hide(),i.filter(function(){return t.test(a(this).text())}).show()}else i.show()})},get_querystring:function(e){return decodeURIComponent(window.location.search.replace(new RegExp("^(?:.*[&\\?]"+encodeURIComponent(e).replace(/[\.\+\*]/g,"\\$&")+"(?:\\=([^&]*))?)?.*$","i"),"$1"))},adjust_actiondropdown:function(e){e.on("show.bs.dropdown",function(){e.css("overflow","inherit")}),e.on("hide.bs.dropdown",function(){e.css("overflow","auto")})},_templateNoWorkflow:function(){return'<div class="wf-nodata"> You have no workflows. </div>'},_templateActionButtons:function(){return'<ul class="manage-table-actions"><li><input class="search-wf form-control" type="text" autocomplete="off" placeholder="search for workflow..."></li><li><a class="action-button fa fa-plus wf-action" id="new-workflow" title="Create new workflow" href="'+Galaxy.root+'workflow/create"></a></li><li><a class="action-button fa fa-upload wf-action" id="import-workflow" title="Upload or import workflow" href="'+Galaxy.root+'workflow/import_workflow"></a></li></ul>'},_templateWorkflowTable:function(e,t){var i="",n="";return i+='<table class="table colored"><thead><tr class="header"><th>Name</th><th>Owner</th><th># of Steps</th><th>Published</th></tr></thead>',o.each(t,function(t){n=n+'<tr><td><div class="dropdown"><button class="menubutton" type="button" data-toggle="dropdown">'+o.escape(t.name)+'<span class="caret"></span></button>'+e._templateActions(t)+"</div></td><td>"+(t.owner===Galaxy.user.attributes.username?"You":t.owner)+"</td><td>"+t.number_of_steps+"</td><td>"+(t.published?"Yes":"No")+"</td></tr>"}),i+'<tbody class="workflow-search">'+n+"</tbody></table>"},_templateActions:function(e){return e.owner===Galaxy.user.attributes.username?'<ul class="dropdown-menu action-dpd"><li><a href="'+Galaxy.root+"workflow/editor?id="+e.id+'">Edit</a></li><li><a href="'+Galaxy.root+"workflow/run?id="+e.id+'" target="galaxy_main">Run</a></li><li><a href="'+Galaxy.root+"workflow/sharing?id="+e.id+'">Share or Download</a></li><li><a href="'+Galaxy.root+"workflow/copy?id="+e.id+'">Copy</a></li><li><a href="'+Galaxy.root+"workflow/rename?id="+e.id+'">Rename</a></li><li><a href="'+Galaxy.root+"workflow/display_by_id?id="+e.id+'">View</a></li><li><a class="link-confirm-'+e.id+'" href="'+Galaxy.root+"workflow/delete?id="+e.id+'">Delete</a></li></ul>':'<ul class="dropdown-menu action-dpd"><li><a href="'+Galaxy.root+"workflow/display_by_username_and_slug?username="+e.owner+"&slug="+e.slug+'">View</a></li><li><a href="'+Galaxy.root+"workflow/run?id="+e.id+'" target="galaxy_main">Run</a></li><li><a href="'+Galaxy.root+"workflow/copy?id="+e.id+'">Copy</a></li><li><a class="link-confirm-shared-'+e.id+'" href="'+Galaxy.root+"workflow/sharing?unshare_me=True&id="+e.id+'">Remove</a></li></ul>'},_templateHeader:function(){return'<div class="page-container"><div class="user-workflows wf"><div class="response-message"></div><h2>Your workflows</h2></div><div class="other-options wf"><h2>Other options</h2><a class="action-button fa fa-cog wf-action" href="'+Galaxy.root+'workflow/configure_menu" title="Configure your workflow menu"><span>Configure your workflow menu</span></a></div></div>'}});return{View:e}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(3),i(1),i(2))},,,function(e,t,i){var n,s,a;(function(i,o){!function(i,o){s=[],n=o,a="function"==typeof n?n.apply(t,s):n,!(void 0!==a&&(e.exports=a))}(this,function(){function e(e,t){function n(){var i=['<div class="loading-indicator">','<div class="loading-indicator-text">','<span class="fa fa-spinner fa-spin fa-lg"></span>','<span class="loading-indicator-message">loading...</span>',"</div>","</div>"].join("\n"),n=o(i).hide().css(t.css||{position:"fixed"}),s=n.children(".loading-indicator-text");return t.cover?(n.css({"z-index":2,top:e.css("top"),bottom:e.css("bottom"),left:e.css("left"),right:e.css("right"),opacity:.5,"background-color":"white","text-align":"center"}),s=n.children(".loading-indicator-text").css({"margin-top":"20px"})):(s=n.children(".loading-indicator-text").css({margin:"12px 0px 0px 10px",opacity:"0.85",color:"grey"}),s.children(".loading-indicator-message").css({margin:"0px 8px 0px 0px","font-style":"italic"})),n}var s=this;return t=i.extend({cover:!1},t||{}),s.show=function(t,i,a){return t=t||"loading...",i=i||"fast",e.parent().find(".loading-indicator").remove(),s.$indicator=n().insertBefore(e),s.message(t),s.$indicator.fadeIn(i,a),s},s.message=function(e){s.$indicator.find("i").text(e)},s.hide=function(e,t){return e=e||"fast",s.$indicator&&s.$indicator.length?s.$indicator.fadeOut(e,function(){s.$indicator.remove(),t&&t()}):t&&t(),s},s}return e})}).call(t,i(1),i(1))},,function(e,t,i){var n,s;(function(i){n=[],s=function(){function e(e){var t=this;return t.deferred=i.Deferred(),t.queue=[],t.responses=[],t.numToProcess=0,t.running=!1,t.init(e||[]),t.start(),t}function t(t){var i=this;return i.names={},e.call(this,t),i}return e.prototype.init=function(e){var t=this;e.forEach(function(e){t.add(e)})},e.prototype.add=function(e){var t=this,i=this.queue.length;return this.numToProcess+=1,this.queue.push(function(){var n=i,s=e();s.done(function(e){t.deferred.notify({curr:n,total:t.numToProcess,response:e})}),s.always(function(e){t.responses.push(e),t.queue.length?t.queue.shift()():t.stop()})}),this},e.prototype.start=function(){return this.queue.length&&(this.running=!0,this.queue.shift()()),this},e.prototype.stop=function(e,t){return this.running=!1,this.queue=[],e?this.deferred.reject(t):this.deferred.resolve(this.responses),this.numToProcess=0,this.deferred=i.Deferred(),this},e.prototype.done=function(e){return this.deferred.done(e)},e.prototype.fail=function(e){return this.deferred.fail(e)},e.prototype.always=function(e){return this.deferred.always(e)},e.prototype.progress=function(e){return this.deferred.progress(e)},e.create=function(t){return new e(t).deferred},t.prototype=new e,t.prototype.constructor=t,t.prototype.add=function(t){if(!t.hasOwnProperty("name")||!t.hasOwnProperty("fn"))throw new Error('NamedAjaxQueue.add requires an object with both "name" and "fn": '+JSON.stringify(t));if(!this.names.hasOwnProperty(t.name))return this.names[t.name]=!0,e.prototype.add.call(this,t.fn)},t.prototype.clear=function(){return this.names={},this},t.create=function(e){return new t(e).deferred},{AjaxQueue:e,NamedAjaxQueue:t}}.apply(t,n),!(void 0!==s&&(e.exports=s))}).call(t,i(1))},,function(e,t,i){var n,s;n=[],s=function(){function e(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;var i,n=[];for(i=0;i<=t.length;i++)n[i]=[i];var s;for(s=0;s<=e.length;s++)n[0][s]=s;for(i=1;i<=t.length;i++)for(s=1;s<=e.length;s++)t.charAt(i-1)===e.charAt(s-1)?n[i][s]=n[i-1][s-1]:n[i][s]=Math.min(n[i-1][s-1]+1,Math.min(n[i][s-1]+1,n[i-1][s]+1));return n[t.length][e.length]}return e}.apply(t,n),!(void 0!==s&&(e.exports=s))}]);
//# sourceMappingURL=analysis.bundled.js.map