diff --git a/client/galaxy/scripts/galaxy.pages.js b/client/galaxy/scripts/galaxy.pages.js index d5cca10e0cb..1188ded5dd2 100644 --- a/client/galaxy/scripts/galaxy.pages.js +++ b/client/galaxy/scripts/galaxy.pages.js @@ -444,10 +444,11 @@ WYMeditor.editor.prototype.dialog = function(dialogType, dialogFeatures, bodyHtm if ($("#make-importable:checked").val() != null) make_importable = true; grid.$("input[name=id]:checked").each(function() { + var elt = $(this); // Get item ID and name. - var item_id = $(this).val(); + var item_id = elt.val(); // Use ':first' because there are many labels in table; the first one is the item name. - var item_name = $(`label[for='${item_id}']:first`).text(); + var item_name = elt.closest('td').next('td').find('label').text(); if (make_importable) make_item_importable(item_info.controller, item_id, item_info.singular); diff --git a/lib/galaxy/webapps/galaxy/controllers/page.py b/lib/galaxy/webapps/galaxy/controllers/page.py index 943dd0da10f..0ee76ece236 100644 --- a/lib/galaxy/webapps/galaxy/controllers/page.py +++ b/lib/galaxy/webapps/galaxy/controllers/page.py @@ -72,6 +72,23 @@ _cp1252 = { } +PAGE_MAXRAW = 10**15 + + +def _get_page_identifiers(item_id, app): + # Assume if item id is integer and less than 10**15, it's unencoded. + try: + decoded_id = int(item_id) + if decoded_id >= PAGE_MAXRAW: + raise ValueError("Identifier larger than maximum expected raw int, must be already encoded.") + encoded_id = app.security.encode_id(item_id) + except ValueError: + # It's an encoded id. + encoded_id = item_id + decoded_id = app.security.decode_id(item_id) + return (encoded_id, decoded_id) + + def format_bool(b): if b: return "yes" @@ -620,7 +637,11 @@ class PageController(BaseUIController, SharableMixin, id = self.decode_id(id) page = trans.sa_session.query(model.Page).get(id) assert page.user == trans.user - return trans.fill_template("page/editor.mako", page=page) + content = page.latest_revision.content + processor = _PageContentProcessor(trans, _placeholderRenderForEdit) + processor.feed(content) + content = unicodify(processor.output(), 'utf-8') + return trans.fill_template("page/editor.mako", page=page, content=content) @web.expose @web.require_login("use Galaxy pages") @@ -707,6 +728,10 @@ class PageController(BaseUIController, SharableMixin, # Sanitize content content = sanitize_html(content) + processor = _PageContentProcessor(trans, _placeholderRenderForSave) + processor.feed(content) + # Output is string, so convert to unicode for saving. + content = unicodify(processor.output(), 'utf-8') # Add a new revision to the page with the provided content. page_revision = model.PageRevision() @@ -901,12 +926,10 @@ class PageController(BaseUIController, SharableMixin, def get_item(self, trans, id): return self.get_page(trans, id) - def _get_embedded_history_html(self, trans, id): + def _get_embedded_history_html(self, trans, decoded_id): """ Returns html suitable for embedding in another page. """ - # TODO: should be moved to history controller and/or called via ajax from the template - decoded_id = self.decode_id(id) # histories embedded in pages are set to importable when embedded, check for access here history = self.history_manager.get_accessible(decoded_id, trans.user, current_history=trans.history) @@ -929,11 +952,11 @@ class PageController(BaseUIController, SharableMixin, content_dicts=contents) return filled - def _get_embedded_visualization_html(self, trans, id): + def _get_embedded_visualization_html(self, trans, encoded_id): """ Returns html suitable for embedding visualizations in another page. """ - visualization = self.get_visualization(trans, id, False, True) + visualization = self.get_visualization(trans, encoded_id, False, True) visualization.annotation = self.get_item_annotation_str(trans.sa_session, visualization.user, visualization) if not visualization: return None @@ -955,11 +978,11 @@ class PageController(BaseUIController, SharableMixin, def _get_embed_html(self, trans, item_class, item_id): """ Returns HTML for embedding an item in a page. """ item_class = self.get_class(item_class) + encoded_id, decoded_id = _get_page_identifiers(item_id, trans.app) if item_class == model.History: - return self._get_embedded_history_html(trans, item_id) + return self._get_embedded_history_html(trans, decoded_id) elif item_class == model.HistoryDatasetAssociation: - decoded_id = self.decode_id(item_id) dataset = self.hda_manager.get_accessible(decoded_id, trans.user) dataset = self.hda_manager.error_if_uploading(dataset) @@ -969,14 +992,62 @@ class PageController(BaseUIController, SharableMixin, return trans.fill_template("dataset/embed.mako", item=dataset, item_data=data) elif item_class == model.StoredWorkflow: - workflow = self.get_stored_workflow(trans, item_id, False, True) + workflow = self.get_stored_workflow(trans, encoded_id, False, True) workflow.annotation = self.get_item_annotation_str(trans.sa_session, workflow.user, workflow) if workflow: self.get_stored_workflow_steps(trans, workflow) return trans.fill_template("workflow/embed.mako", item=workflow, item_data=workflow.latest_workflow.steps) elif item_class == model.Visualization: - return self._get_embedded_visualization_html(trans, item_id) + return self._get_embedded_visualization_html(trans, encoded_id) elif item_class == model.Page: pass + + +PLACEHOLDER_TEMPLATE = '''

Embedded Galaxy {class_shorthand} - '{item_name}'

[Do not edit this block; Galaxy will fill it in with the annotated {class_shorthand} when it is displayed]

''' + +# This is a mapping of the id portion of page contents to the cssclass/shortname. +PAGE_CLASS_MAPPING = { + 'History': 'History', + 'HistoryDatasetAssociation': 'Dataset', + 'StoredWorkflow': 'Workflow', + 'Visualization': 'Visualization' +} + + +def _placeholderRenderForEdit(trans, item_class, item_id): + return _placeholderRenderForSave(trans, item_class, item_id, encode=True) + + +def _placeholderRenderForSave(trans, item_class, item_id, encode=False): + encoded_item_id, decoded_item_id = _get_page_identifiers(item_id, trans.app) + item_name = '' + if item_class == 'History': + history = trans.sa_session.query(trans.model.History).get(decoded_item_id) + history = managers.base.security_check(trans, history, False, True) + item_name = history.name + elif item_class == 'HistoryDatasetAssociation': + hda = trans.sa_session.query(trans.model.HistoryDatasetAssociation).get(decoded_item_id) + hda = managers.base.security_check(trans, hda , False, True) + item_name = hda.name + elif item_class == 'StoredWorkflow': + wf = trans.sa_session.query(trans.model.StoredWorkflow).get(decoded_item_id) + wf = managers.base.security_check(trans, wf, False, True) + item_name = wf.name + elif item_class == 'Visualization': + visualization = trans.sa_session.query(trans.model.Visualization).get(decoded_item_id) + visualization = managers.base.security_check(trans, visualization, False, True) + item_name = visualization.title + class_shorthand = PAGE_CLASS_MAPPING[item_class] + if encode: + item_id = encoded_item_id + else: + item_id = decoded_item_id + return PLACEHOLDER_TEMPLATE.format( + item_class=item_class, + class_shorthand=class_shorthand, + class_shorthand_lower=class_shorthand.lower(), + item_id=item_id, + item_name=item_name + ) diff --git a/scripts/pages_identifier_conversion.py b/scripts/pages_identifier_conversion.py new file mode 100644 index 00000000000..b7139e8e77d --- /dev/null +++ b/scripts/pages_identifier_conversion.py @@ -0,0 +1,57 @@ +import argparse +import difflib +import logging +import os +import sys + +sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'lib'))) + +import galaxy +import galaxy.app +import galaxy.config +from galaxy.objectstore import build_object_store_from_config +from galaxy.util import unicodify +from galaxy.util.bunch import Bunch +from galaxy.util.script import app_properties_from_args, populate_config_args +from galaxy.web.security import SecurityHelper +from galaxy.webapps.galaxy.controllers.page import _PageContentProcessor, _placeholderRenderForSave + + +def main(argv): + parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('-k', '--secret-key', help='Key to convert pages with', default='') + parser.add_argument('-d', '--dry-run', help='No changes, just test it.', action='store_true') + populate_config_args(parser) + args = parser.parse_args() + properties = app_properties_from_args(args) + config = galaxy.config.Configuration(**properties) + secret = args.secret_key or config.id_secret + security_helper = SecurityHelper(id_secret=secret) + object_store = build_object_store_from_config(config) + if not config.database_connection: + print("The database connection is empty. If you are using the default value, please uncomment that in your galaxy.yml") + + model = galaxy.config.init_models_from_config(config, object_store=object_store) + session = model.context.current + pagerevs = session.query(model.PageRevision).all() + mock_trans = Bunch(app=Bunch(security=security_helper), model=model, user_is_admin=lambda: True, sa_session=session) + for p in pagerevs: + try: + processor = _PageContentProcessor(mock_trans, _placeholderRenderForSave) + processor.feed(p.content) + newcontent = unicodify(processor.output(), 'utf-8') + if p.content != newcontent: + if not args.dry_run: + p.content = unicodify(processor.output(), 'utf-8') + session.add(p) + session.flush() + else: + print("Modifying revision %s." % p.id) + print(difflib.unified_diff(p.content, newcontent)) + except Exception: + logging.exception("Error parsing page, rolling changes back and skipping revision %s. Please report this error." % p.id) + session.rollback() + + +if __name__ == '__main__': + main(sys.argv) diff --git a/static/scripts/bundled/extended.bundled.js b/static/scripts/bundled/extended.bundled.js index 88a63efb325..f0dbdad9562 100644 --- a/static/scripts/bundled/extended.bundled.js +++ b/static/scripts/bundled/extended.bundled.js @@ -46,5 +46,5 @@ s=n,l=t("
",{css:{position:"absolute",top:"-200px",left:i?"0px":"-1000px", // the check will work anyway, as when moving the node will be loaded first and checked again if(v === 'i' && !ins.is_loaded(p)) { } */ -f=!0,p=0,_=o.data.nodes.length;p<_;p++)if(g=o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node",m=u,"move_node"===g&&"a"===M&&o.data.origin&&o.data.origin===w&&d===w.get_parent(o.data.nodes[p])&&(v=w.get_node(d),m>t.inArray(o.data.nodes[p],v.children)&&(m-=1)),!(f=f&&(w&&w.settings&&w.settings.dnd&&!1===w.settings.dnd.check_while_dragging||w.check(g,o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[p]):o.data.nodes[p],d,m,{dnd:!0,ref:w.get_node(x.parent()),pos:M,is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin})))){w&&w.last_error&&(n=w.last_error());break}if(f)return"i"===M&&x.parent().is(".jstree-closed")&&w.settings.dnd.open_timeout&&(i=setTimeout(function(t,e){return function(){t.open_node(e)}}(w,x),w.settings.dnd.open_timeout)),e={ins:w,par:d,pos:"i"!==M||"last"!==y||0!==u||w.is_loaded(b)?u:"last"},r.css({left:s+"px",top:l+"px"}).show(),o.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok"),n={},h=!0,!1}),!0===h))return}else{for(f=!0,p=0,_=o.data.nodes.length;p<_&&(f=f&&w.check(o.data.origin&&(o.data.origin.settings.dnd.always_copy||o.data.origin.settings.dnd.copy&&(o.event.metaKey||o.event.ctrlKey))?"copy_node":"move_node",o.data.origin&&o.data.origin!==w?o.data.origin.get_node(o.data.nodes[p]):o.data.nodes[p],"#","last",{dnd:!0,ref:w.get_node("#"),pos:"i",is_multi:o.data.origin&&o.data.origin!==w,is_foreign:!o.data.origin}));p++);if(f)return e={ins:w,par:"#",pos:"last"},r.hide(),void o.helper.find(".jstree-icon:eq(0)").removeClass("jstree-er").addClass("jstree-ok")}e=!1,o.helper.find(".jstree-icon").removeClass("jstree-ok").addClass("jstree-er"),r.hide()}}).bind("dnd_scroll.vakata",function(t,n){n&&n.data&&n.data.jstree&&(r.hide(),e=!1,n.helper.find(".jstree-icon:eq(0)").removeClass("jstree-ok").addClass("jstree-er"))}).bind("dnd_stop.vakata",function(a,o){if(i&&clearTimeout(i),o&&o.data&&o.data.jstree){r.hide();var s,l,c=[];if(e){for(s=0,l=o.data.nodes.length;s
").html(r).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),t(document).bind("mousemove touchmove",t.vakata.dnd.drag),t(document).bind("mouseup touchend",t.vakata.dnd.stop),!1},drag:function(n){if("touchmove"===n.type&&n.originalEvent&&n.originalEvent.changedTouches&&n.originalEvent.changedTouches[0]&&(n.pageX=n.originalEvent.changedTouches[0].pageX,n.pageY=n.originalEvent.changedTouches[0].pageY,n.target=document.elementFromPoint(n.originalEvent.changedTouches[0].pageX-window.pageXOffset,n.originalEvent.changedTouches[0].pageY-window.pageYOffset)),e.is_down){if(!e.is_drag){if(!(Math.abs(n.pageX-e.init_x)>(e.is_touch?t.vakata.dnd.settings.threshold_touch:t.vakata.dnd.settings.threshold)||Math.abs(n.pageY-e.init_y)>(e.is_touch?t.vakata.dnd.settings.threshold_touch:t.vakata.dnd.settings.threshold)))return;e.helper&&(e.helper.appendTo("body"),e.helper_w=e.helper.outerWidth()),e.is_drag=!0,t.vakata.dnd._trigger("start",n)}var i=!1,r=!1,a=!1,o=!1,s=!1,l=!1,c=!1,d=!1,u=!1,h=!1;return e.scroll_t=0,e.scroll_l=0,e.scroll_e=!1,t(t(n.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return/^auto|scroll$/.test(t(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var i=t(this),r=i.offset();if(this.scrollHeight>this.offsetHeight&&(r.top+i.height()-n.pageYthis.offsetWidth&&(r.left+i.width()-n.pageXo&&n.pageY-co&&o-(n.pageY-c)l&&n.pageX-dl&&l-(n.pageX-d)a&&(u=a-50),s&&h+e.helper_w>s&&(h=s-(e.helper_w+2)),e.helper.css({left:h+"px",top:u+"px"})),t.vakata.dnd._trigger("move",n),!1}},stop:function(n){if("touchend"===n.type&&n.originalEvent&&n.originalEvent.changedTouches&&n.originalEvent.changedTouches[0]&&(n.pageX=n.originalEvent.changedTouches[0].pageX,n.pageY=n.originalEvent.changedTouches[0].pageY,n.target=document.elementFromPoint(n.originalEvent.changedTouches[0].pageX-window.pageXOffset,n.originalEvent.changedTouches[0].pageY-window.pageYOffset)),e.is_drag)t.vakata.dnd._trigger("stop",n);else if("touchend"===n.type&&n.target===e.target){var i=setTimeout(function(){t(n.target).click()},100);t(n.target).one("click",function(){i&&clearTimeout(i)})}return t.vakata.dnd._clean(),!1}}}(t),t.jstree.defaults.search={ajax:!1,fuzzy:!1,case_sensitive:!1,show_only_matches:!1,close_opened_onclear:!0,search_leaves_only:!1,search_callback:!1},t.jstree.plugins.search=function(e,n){this.bind=function(){n.bind.call(this),this._data.search.str="",this._data.search.dom=t(),this._data.search.res=[],this._data.search.opn=[],this.element.on("before_open.jstree",t.proxy(function(e,n){var i,r,a=this._data.search.res,o=[],s=t();if(a&&a.length&&(this._data.search.dom=t(this.element[0].querySelectorAll("#"+t.map(a,function(e){return-1!=="0123456789".indexOf(e[0])?"\\3"+e[0]+" "+e.substr(1).replace(t.jstree.idregex,"\\$&"):e.replace(t.jstree.idregex,"\\$&")}).join(", #"))),this._data.search.dom.children(".jstree-anchor").addClass("jstree-search"),this.settings.search.show_only_matches&&this._data.search.res.length)){for(i=0,r=a.length;i32&&(n.fuzzy=!1),n.fuzzy&&(i=1<=p;l--)if(m=r[e.charAt(l-1)],g[l]=0===o?(g[l+1]<<1|1)&m:(g[l+1]<<1|1)&m|(f[l+1]|f[l])<<1|1|f[l+1],g[l]&i&&(x=a(o,l-1))<=y){if(y=x,b=l-1,k.push(b),!(b>s))break;p=Math.max(1,2*s-b)}if(a(o+1,s)>y)break;f=g}return{isMatch:b>=0,score:x}},!0===e?{search:o}:o(e)}}(t),t.jstree.defaults.sort=function(t,e){return this.get_text(t)>this.get_text(e)?1:-1},t.jstree.plugins.sort=function(e,n){this.bind=function(){n.bind.call(this),this.element.on("model.jstree",t.proxy(function(t,e){this.sort(e.parent,!0)},this)).on("rename_node.jstree create_node.jstree",t.proxy(function(t,e){this.sort(e.parent||e.node.parent,!1),this.redraw_node(e.parent||e.node.parent,!0)},this)).on("move_node.jstree copy_node.jstree",t.proxy(function(t,e){this.sort(e.parent,!1),this.redraw_node(e.parent,!0)},this))},this.sort=function(e,n){var i,r;if((e=this.get_node(e))&&e.children&&e.children.length&&(e.children.sort(t.proxy(this.settings.sort,this)),n))for(i=0,r=e.children_d.length;ie.ttl)&&(e&&e.state&&(e=e.state),e&&t.isFunction(this.settings.state.filter)&&(e=this.settings.state.filter.call(this,e)),!!e&&(this.element.one("set_state.jstree",function(n,i){i.instance.trigger("restore_state",{state:t.extend(!0,{},e)})}),this.set_state(e),!0))},this.clear_state=function(){return t.vakata.storage.del(this.settings.state.key)}},function(t,e){t.vakata.storage={set:function(t,e){return window.localStorage.setItem(t,e)},get:function(t){return window.localStorage.getItem(t)},del:function(t){return window.localStorage.removeItem(t)}}}(t),t.jstree.defaults.types={"#":{},default:{}},t.jstree.plugins.types=function(n,i){this.init=function(t,n){var r,a;if(n&&n.types&&n.types.default)for(r in n.types)if("default"!==r&&"#"!==r&&n.types.hasOwnProperty(r))for(a in n.types.default)n.types.default.hasOwnProperty(a)&&n.types[r][a]===e&&(n.types[r][a]=n.types.default[a]);i.init.call(this,t,n),this._model.data["#"].type="#"},this.refresh=function(t,e){i.refresh.call(this,t,e),this._model.data["#"].type="#"},this.bind=function(){this.element.on("model.jstree",t.proxy(function(t,n){var i,r,a=this._model.data,o=n.nodes,s=this.settings.types,l="default";for(i=0,r=o.length;i .jstree-ocl",t.proxy(function(e){e.stopImmediatePropagation();var n=t.Event("click",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});t(e.currentTarget).closest(".jstree-node").children(".jstree-anchor:eq(0)").trigger(n).focus()},this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",t.proxy(function(t){return t.stopImmediatePropagation(),this.hover_node(t.currentTarget),!1},this)).on("mouseleave.jstree",".jstree-node",t.proxy(function(t){this.dehover_node(t.currentTarget)},this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),n.teardown.call(this)},this.redraw_node=function(e,i,r){if(e=n.redraw_node.call(this,e,i,r)){var a=p.cloneNode(!0);-1!==t.inArray(e.id,this._data.core.selected)&&(a.className+=" jstree-wholerow-clicked"),e.insertBefore(a,e.childNodes[0])}return e}}}})},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=t.Model.extend({urlRoot:Galaxy.root+"api/groups"}),i=t.Collection.extend({url:Galaxy.root+"api/groups",model:n});e.default={Group:n,Groups:i}}).call(e,n(2))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t){Galaxy.user||(Galaxy.user=new L.default.User(t.user_json)),Galaxy.masthead||(Galaxy.masthead=new E.default.View(t),Galaxy.modal=new I.default.View,(0,h.default)("#masthead").replaceWith(Galaxy.masthead.render().$el))}function a(t){new A.default.GalaxyApp(t)}function o(t){new v.default.GalaxyApp(t)}function s(t){new b.default.GalaxyApp(t)}function l(t){new g.default(t)}function c(t){new S.default.GalaxyApp(t)}function d(t){var e=new W.default.HistoryCollection([],{includeDeleted:t.includingDeleted,order:t.order,limitOnFirstFetch:t.limit,limitPerFetch:t.limit,currentHistoryId:t.current_history_id}),n=new q.default.MultiPanelColumns({el:(0,h.default)("#center").get(0),histories:e});e.fetchFirst({silent:!0}).done(function(){n.createColumns(),n.render(0)})}Object.defineProperty(e,"__esModule",{value:!0}),e.bundleEntries=void 0,e.mastheadEntry=r,e.adminToolshedEntry=a,e.tracksterEntry=o,e.circsterEntry=s,e.workflowEntry=l,e.libraryEntry=c,e.multiHistoryEntry=d;var u=n(0),h=i(u);n(193);var f=n(70),p=i(f),_=n(716),g=i(_),m=n(61),v=i(m),y=n(725),b=i(y),w=n(726),x=i(w),k=n(727),M=i(k),C=n(728),S=i(C),T=n(738),A=i(T),j=n(73),E=i(j),O=n(60),L=i(O),N=n(17),I=i(N),P=n(746),D=i(P),R=n(14),z=i(R),$=n(144),W=i($),G=n(748),V=i(G),H=n(57),F=i(H),Y=n(754),q=i(Y),U=n(157),B=i(U),X=n(755),J=i(X),Q=n(143),K=i(Q),Z=n(179),tt=i(Z),et=n(145),nt=i(et),it=n(71),rt=i(it),at=n(756),ot=i(at),st=n(759),lt=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(st),ct=n(760),dt=i(ct);window.Galaxy&&void 0===window.Galaxy.debug&&(0,rt.default)(window.Galaxy,"GalaxyApp");var ut=e.bundleEntries={library:c,masthead:r,workflow:l,trackster:o,circster:s,adminToolshed:a,pages:D.default,phyloviz:x.default.PhylovizView,createTabularDatasetChunkedView:z.default.createTabularDatasetChunkedView,multiHistory:d,history:B.default.historyEntry,History:W.default.History,HistoryContents:F.default.HistoryContents,SweepsterVisualization:M.default.SweepsterVisualization,SweepsterVisualizationView:M.default.SweepsterVisualizationView,HistoryCopyDialog:K.default,HistoryViewAnnotated:J.default,Trackster:v.default,StructureView:V.default,HDAListItemEdit:tt.default,HDAModel:nt.default,GalaxyApp:p.default,LegacyGridView:ot.default,run_stats:lt,ToolshedGroups:dt.default};window.bundleEntries=ut},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}function o(e){var n=t("#galaxy_tools").contents();if(0===n.length&&(n=t(document),t(this).removeClass("search_active"),n.find(".toolTitle").removeClass("search_match"),n.find(".toolSectionBody").hide(),n.find(".toolTitle").show(),n.find(".toolPanelLabel").show(),n.find(".toolSectionWrapper").each(function(){"recently_used_wrapper"!==t(this).attr("id")?t(this).show():t(this).hasClass("user_pref_visible")&&t(this).show()}),n.find("#search-no-results").hide(),n.find("#search-spinner").hide(),e)){n.find("#tool-search-query").val("search tools")}}function s(e,n){var i=y.default[n];if(i){var r=t(' ').addClass(i);e.before(r)}}Object.defineProperty(e,"__esModule",{value:!0});var l=n(3),c=a(l),d=n(5),u=a(d),h=n(717),f=a(h),p=n(718),_=a(p),g=n(719),m=a(g),v=n(216),y=a(v),b=n(724),w=a(b),x=n(10),k=a(x),M=n(229),C=a(M),S=n(20);!function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);e.default=t}(S);n(19),window.workflow_globals=window.workflow_globals||{},e.default=i.View.extend({initialize:function(e){function n(){var e=t('

');window.show_modal("Save As a New Workflow",e,{OK:function(){var e=t("#workflow_rename").val().length>0?t("#workflow_rename").val():"SavedAs_"+l.workflow.name,n=t("#wf_annotation").val().length>0?t("#wf_annotation").val():"";t.ajax({url:l.urls.workflow_save_as,type:"POST",data:{workflow_name:e,workflow_annotation:n,workflow_data:function(){return JSON.stringify(l.workflow.to_simple())}}}).done(function(t){window.onbeforeunload=void 0,window.location=Galaxy.root+"workflow/editor?id="+t,hide_modal()}).fail(function(){hide_modal(),alert("Saving this workflow failed. Please contact this site's administrator.")})},Cancel:hide_modal})}function i(){l.workflow.layout(),l.workflow.fit_canvas_to_nodes(),l.scroll_to_nodes(),l.canvas_manager.draw_overview()}function a(){t.jStorage.set("overview-off",!1),t("#overview-border").css("right","0px"),t("#close-viewport").css("background-position","0px 0px")}function s(){t.jStorage.set("overview-off",!0),t("#overview-border").css("right","20000px"),t("#close-viewport").css("background-position","12px 0px")}var l=window.workflow_globals.app=this;this.options=e,this.urls=e&&e.urls||{};var c=function(){if(l.workflow.check_changes_in_active_form(),workflow&&l.workflow.has_changes){var t=function(){window.onbeforeunload=void 0,window.document.location=l.urls.workflow_index};window.show_modal("Close workflow editor","There are unsaved changes to your workflow which will be lost.",{Cancel:hide_modal,"Save Changes":function(){d(null,t)}},{"Don't Save":t})}else window.document.location=l.urls.workflow_index},d=function(e,n){if(show_message("Saving workflow","progress"),l.workflow.check_changes_in_active_form(),!l.workflow.has_changes)return hide_modal(),void(n&&n());l.workflow.rectify_workflow_outputs(),u.default.request({url:Galaxy.root+"api/workflows/"+l.options.id,type:"PUT",data:{workflow:l.workflow.to_simple()},success:function(e){var i=t("
").text(e.message);if(e.errors){i.addClass("warningmark");var r=t("
    ");t.each(e.errors,function(e,n){t("
  • ").text(n).appendTo(r)}),i.append(r)}else i.addClass("donemark");l.workflow.name=e.name,l.workflow.has_changes=!1,l.workflow.stored=!0,l.showWorkflowParameters(),e.errors?window.show_modal("Saving workflow",i,{Ok:hide_modal}):(n&&n(),hide_modal())},error:function(t){window.show_modal("Saving workflow failed.",t.err_msg,{Ok:hide_modal})}})};t("#tool-search-query").click(function(){t(this).focus(),t(this).select()}).keyup(function(){if(t(this).css("font-style","normal"),this.value.length<3)o(!1);else if(this.value!=this.lastValue){t(this).addClass("search_active");var e=this.value;this.timer&&clearTimeout(this.timer),t("#search-spinner").show(),this.timer=setTimeout(function(){t.get(l.urls.tool_search,{q:e},function(e){if(t("#search-no-results").hide(),t(".toolSectionWrapper").hide(),t(".toolSectionWrapper").find(".toolTitle").hide(),0!=e.length){var n=t.map(e,function(t,e){return"link-"+t});t(n).each(function(e,n){t("[id='"+n+"']").parent().addClass("search_match"),t("[id='"+n+"']").parent().show().parent().parent().show().parent().show()}),t(".toolPanelLabel").each(function(){for(var e=t(this),n=e.next(),i=!0;0!==n.length&&n.hasClass("toolTitle");){if(n.is(":visible")){i=!1;break}n=n.next()}i&&e.hide()})}else t("#search-no-results").show();t("#search-spinner").hide()},"json")},400)}this.lastValue=this.value}),this.canvas_manager=window.workflow_globals.canvas_manager=new _.default(this,t("#canvas-viewport"),t("#overview")),this.reset(),this.datatypes=JSON.parse(t.ajax({url:Galaxy.root+"api/datatypes",async:!1}).responseText),this.datatypes_mapping=JSON.parse(t.ajax({url:Galaxy.root+"api/datatypes/mapping",async:!1}).responseText),this.ext_to_type=this.datatypes_mapping.ext_to_class_name,this.type_to_type=this.datatypes_mapping.class_to_classes,this._workflowLoadAjax(l.options.id,{success:function(t){l.reset(),l.workflow.from_simple(t,!0),l.workflow.has_changes=!1,l.workflow.fit_canvas_to_nodes(),l.scroll_to_nodes(),l.canvas_manager.draw_overview();var e="";r.each(t.steps,function(n,i){var a="";n.errors&&(a+="
  • "+n.errors+"
  • "),r.each(t.upgrade_messages[i],function(t){a+="
  • "+t+"
  • "}),a&&(e+="
  • Step "+(parseInt(i,10)+1)+": "+l.workflow.nodes[i].name+"
      "+a+"
  • ")}),e?window.show_modal("Issues loading this workflow","Please review the following issues, possibly resulting from tool upgrades or changes.

      "+e+"

    ",{Continue:hide_modal}):hide_modal(),l.showWorkflowParameters()},beforeSubmit:function(t){show_message("Loading workflow","progress")}}),window.make_popupmenu&&make_popupmenu(t("#workflow-options-button"),{Save:d,"Save As":n,Run:function(){window.location=Galaxy.root+"workflows/run?id="+l.options.id},"Edit Attributes":function(){l.workflow.clear_active_node()},"Auto Re-layout":i,Close:c});var h=t.jStorage.get("overview-size");void 0!==h&&t("#overview-border").css({width:h,height:h}),t.jStorage.get("overview-off")?s():a(),t("#overview-border").bind("dragend",function(e,n){var i=t(this).offsetParent(),r=i.offset(),a=Math.max(i.width()-(n.offsetX-r.left),i.height()-(n.offsetY-r.top));t.jStorage.set("overview-size",a+"px")}),t("#close-viewport").click(function(){"0px"===t("#overview-border").css("right")?s():a()}),window.onbeforeunload=function(){if(workflow&&l.workflow.has_changes)return"There are unsaved changes to your workflow which will be lost."},this.options.workflows.length>0&&t("#left").find(".toolMenu").append(this._buildToolPanelWorkflows()),t("div.toolSectionBody").hide(),t("div.toolSectionTitle > span").wrap("");var f=null;t("div.toolSectionTitle").each(function(){var e=t(this).next("div.toolSectionBody");t(this).click(function(){e.is(":hidden")?(f&&f.slideUp("fast"),f=e,e.slideDown("fast")):(e.slideUp("fast"),f=null)})}),(0,C.default)("workflow-name","workflow-name",l.urls.rename_async,"new_name"),t("#workflow-tag").click(function(){return t(".tag-area").click(),!1}),(0,C.default)("workflow-annotation","workflow-annotation",l.urls.annotate_async,"new_annotation",25,!0,4)},_buildToolPanelWorkflows:function(){var e=this,n=t('
    ');return r.each(this.options.workflows,function(i){if(i.id!==e.options.id){var r=new k.default.ButtonIcon({icon:"fa fa-copy",cls:"ui-button-icon-plain",tooltip:(0,c.default)("Copy and insert individual steps"),onclick:function(){i.step_count<2?e.copy_into_workflow(i.id,i.name):Galaxy.modal.show({title:(0,c.default)("Warning"),body:"This will copy "+i.step_count+" new steps into your workflow.",buttons:{Cancel:function(){Galaxy.modal.hide()},Copy:function(){Galaxy.modal.hide(),e.copy_into_workflow(i.id,i.name)}}})}}),a=t("").attr("href","#").html(i.name).on("click",function(){e.add_node_for_subworkflow(i.latest_id,i.name)});n.find(".toolSectionBg").append(t("
    ").addClass("toolTitle").append(a).append(r.$el))}}),n},copy_into_workflow:function(e){var n=this;this._workflowLoadAjax(e,{success:function(e){n.workflow.from_simple(e,!1);var i="";t.each(e.upgrade_messages,function(e,r){i+="
  • Step "+(parseInt(e,10)+1)+": "+n.workflow.nodes[e].name+"
      ",t.each(r,function(t,e){i+="
    • "+e+"
    • "}),i+="
  • "}),i?window.show_modal("Subworkflow embedded with changes","Problems were encountered loading this workflow (possibly a result of tool upgrades). Please review the following parameters and then save.
      "+i+"
    ",{Continue:hide_modal}):hide_modal()},beforeSubmit:function(t){show_message("Importing workflow","progress")}})},reset:function(){this.workflow&&this.workflow.remove_all(),this.workflow=window.workflow_globals.workflow=new f.default(this,t("#canvas-container"))},scroll_to_nodes:function(){var e,n,i=t("#canvas-viewport"),r=t("#canvas-container");n=r.width()"+n+"";return e+=""},showWorkflowParameters:function(){var e=/\$\{.+?\}/g,n=[],i=t("#workflow-parameters-container"),r=t("#workflow-parameters-box"),a="",o=[];t.each(this.workflow.nodes,function(i,r){r.config_form&&r.config_form.inputs&&u.default.deepeach(r.config_form.inputs,function(t){if("string"==typeof t.value){var n=t.value.match(e);n&&(o=o.concat(n))}}),r.post_job_actions&&t.each(r.post_job_actions,function(n,i){i.action_arguments&&t.each(i.action_arguments,function(t,n){var i=n.match(e);i&&(o=o.concat(i))})}),o&&t.each(o,function(e,i){-1===t.inArray(i,n)&&n.push(i)})}),n&&0!==n.length?(t.each(n,function(t,e){a+="
    "+e.substring(2,e.length-1)+"
    "}),i.html(a),r.show()):(i.html(a),r.hide())},showAttributes:function(){t(".right-content").hide(),t("#edit-attributes").show()},showForm:function(e,n){var i="right-content",r=i+"-"+n.id,a=t("#"+i);if(e&&0==a.find("#"+r).length){var o=t('
    ');if(e.node=n,e.workflow=this.workflow,e.datatypes=this.datatypes,e.icon=y.default[n.type],e.cls="ui-portlet-narrow",n){var s="tool"==n.type?"Tool":"Default";o.append(new w.default[s](e).form.$el),a.append(o)}else Galaxy.emit.debug("workflow-view::initialize()","Node not found in workflow.")}t("."+i).hide(),a.find("#"+r).show(),a.show(),a.scrollTop()},isSubType:function(t,e){return t=this.ext_to_type[t],e=this.ext_to_type[e],this.type_to_type[t]&&e in this.type_to_type[t]},prebuildNode:function(e,n,i){var r=this,a=t("
    "),o=t("
    "+n+"
    ");s(o.find(".nodeTitle"),e),a.append(o),a.css("left",t(window).scrollLeft()+20),a.css("top",t(window).scrollTop()+20),a.append(t("
    "));var l=new m.default(this,{element:a});l.type=e,l.content_id=i;var c="
    loading tool info...
    ";a.find(".toolFormBody").append(c);var d=t("
    ");"subworkflow"!==e&&d.append(t("
    ").addClass("fa-icon-button fa fa-files-o node-clone").click(function(t){l.clone()})),d.append(t("
    ").addClass("fa-icon-button fa fa-times node-destroy").click(function(t){l.destroy()})),a.appendTo("#canvas-container");var u=t("#canvas-container").position(),h=t("#canvas-container").parent(),f=a.width(),p=a.height();return a.css({left:-u.left+h.width()/2-f/2,top:-u.top+h.height()/2-p/2}),d.prependTo(a.find(".toolFormTitle")),f+=d.width()+10,a.css("width",f),a.bind("dragstart",function(){r.workflow.activate_node(l)}).bind("dragend",function(){r.workflow.node_changed(this),r.workflow.fit_canvas_to_nodes(),r.canvas_manager.draw_overview()}).bind("dragclickonly",function(){r.workflow.activate_node(l)}).bind("drag",function(e,n){var i=t(this).offsetParent().offset(),r=n.offsetX-i.left,a=n.offsetY-i.top;t(this).css({left:r,top:a}),t(this).find(".terminal").each(function(){this.terminal.redraw()})}),l}})}).call(e,n(0),n(2),n(1))},function(t,e,n){"use strict";(function(t){function i(t,e){this.app=t,this.canvas_container=e,this.id_counter=0,this.nodes={},this.name=null,this.has_changes=!1,this.active_form_has_changes=!1,this.workflowOutputLabels={}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(410),a=function(t){return t&&t.__esModule?t:{default:t}}(r),o=n(20),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(o);t.extend(i.prototype,{canLabelOutputWith:function(t){return!t||!(t in this.workflowOutputLabels)},registerOutputLabel:function(t){t&&(this.workflowOutputLabels[t]=!0)},unregisterOutputLabel:function(t){t&&delete this.workflowOutputLabels[t]},updateOutputLabel:function(t,e){t&&this.unregisterOutputLabel(t),this.canLabelOutputWith(e)||s.warning("Workflow contains duplicate workflow output labels "+e+". This must be fixed before it can be saved."),e&&this.registerOutputLabel(e)},attemptUpdateOutputLabel:function(t,e,n){return!!this.canLabelOutputWith(n)&&(t.labelWorkflowOutput(e,n),t.nodeView.redrawWorkflowOutputs(),!0)},create_node:function(t,e,n){var i=this.app.prebuildNode(t,e,n);return this.add_node(i),this.fit_canvas_to_nodes(),this.app.canvas_manager.draw_overview(),this.activate_node(i),i},add_node:function(t){t.id=this.id_counter,t.element.attr("id","wf-node-step-"+t.id),t.element.attr("node-label",t.label),this.id_counter++,this.nodes[t.id]=t,this.has_changes=!0,t.workflow=this},remove_node:function(t){this.active_node==t&&this.clear_active_node(),delete this.nodes[t.id],this.has_changes=!0},remove_all:function(){var e=this;t.each(this.nodes,function(t,n){n.destroy(),e.remove_node(n)})},rectify_workflow_outputs:function(){var e=!1,n=!1;if(t.each(this.nodes,function(i,r){r.workflow_outputs&&r.workflow_outputs.length>0&&(e=!0),t.each(r.post_job_actions,function(t,e){"HideDatasetAction"===e.action_type&&(n=!0)})}),!1!==e||!1!==n){var i=this;t.each(this.nodes,function(n,r){if("tool"===r.type){var a=!1;null===r.post_job_actions&&(r.post_job_actions={},a=!0);var o=[];t.each(r.post_job_actions,function(t,e){"HideDatasetAction"==e.action_type&&o.push(t)}),o.length>0&&t.each(o,function(t,e){a=!0,delete r.post_job_actions[e]}),e&&t.each(r.output_terminals,function(t,e){if(!0==!r.isWorkflowOutput(e.name)){a=!0;var n={action_type:"HideDatasetAction",output_name:e.name,action_arguments:{}};r.post_job_actions["HideDatasetAction"+e.name]=null,r.post_job_actions["HideDatasetAction"+e.name]=n}}),i.active_node==r&&!0===a&&i.reload_active_node()}})}},to_simple:function(){var e={};return t.each(this.nodes,function(n,i){var r={};t.each(i.input_terminals,function(e,n){r[n.name]=null;var i=[];t.each(n.connectors,function(t,e){if(e.handle1){var a={id:e.handle1.node.id,output_name:e.handle1.name},o=n.attributes.input.input_subworkflow_step_id;void 0!==o&&(a.input_subworkflow_step_id=o),i[t]=a,r[n.name]=i}})});var a={};i.post_job_actions&&t.each(i.post_job_actions,function(t,e){var n={action_type:e.action_type,output_name:e.output_name,action_arguments:e.action_arguments};a[e.action_type+e.output_name]=null,a[e.action_type+e.output_name]=n}),i.workflow_outputs||(i.workflow_outputs=[]);var o={id:i.id,type:i.type,content_id:i.content_id,tool_version:i.config_form.version,tool_state:i.tool_state,errors:i.errors,input_connections:r,position:t(i.element).position(),annotation:i.annotation,post_job_actions:i.post_job_actions,uuid:i.uuid,label:i.label,workflow_outputs:i.workflow_outputs};e[i.id]=o}),{steps:e}},from_simple:function(e,n){var i=void 0===n||n,r=this,o=0;i?r.name=e.name:o=Object.keys(r.nodes).length;var s=o,l=!1;t.each(e.steps,function(e,n){var a=r.app.prebuildNode(n.type,n.name,n.content_id);i||(n.uuid=null,t.each(n.workflow_outputs,function(t,e){e.uuid=null})),a.init_field_data(n),n.position&&a.element.css({top:n.position.top,left:n.position.left}),a.id=parseInt(n.id)+o,a.element.attr("id","wf-node-step-"+a.id),a.element.attr("node-label",n.label),r.nodes[a.id]=a,s=Math.max(s,parseInt(e)+o),l||(a.workflow_outputs.length>0?l=!0:t.each(a.post_job_actions||[],function(t,e){"HideDatasetAction"===e.action_type&&(l=!0)}))}),r.id_counter=s+1,t.each(e.steps,function(e,n){var i=r.nodes[parseInt(e)+o];t.each(n.input_connections,function(e,n){n&&(t.isArray(n)||(n=[n]),t.each(n,function(t,n){var s=r.nodes[parseInt(n.id)+o],l=new a.default;l.connect(s.output_terminals[n.output_name],i.input_terminals[e]),l.redraw()}))}),l&&t.each(i.output_terminals,function(e,n){if(void 0===i.post_job_actions["HideDatasetAction"+n.name]){i.addWorkflowOutput(n.name);t(i.element).find(".callout."+n.name).find("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small.png"),r.has_changes=!0}})})},check_changes_in_active_form:function(){this.active_form_has_changes&&(this.has_changes=!0,t("#right-content").find("form").submit(),this.active_form_has_changes=!1)},reload_active_node:function(){if(this.active_node){var t=this.active_node;this.clear_active_node(),this.activate_node(t)}},clear_active_node:function(){this.active_node&&(this.active_node.make_inactive(),this.active_node=null),document.activeElement.blur(),this.app.showAttributes()},activate_node:function(t){this.active_node!=t&&(this.check_changes_in_active_form(),this.clear_active_node(),this.app.showForm(t.config_form,t),t.make_active(),this.active_node=t)},node_changed:function(t,e){this.has_changes=!0,this.active_node==t&&e&&(this.check_changes_in_active_form(),this.app.showForm(t.config_form,t)),this.app.showWorkflowParameters()},layout:function(){this.check_changes_in_active_form(),this.has_changes=!0;var e={},n={};t.each(this.nodes,function(t,i){void 0===e[t]&&(e[t]=0),void 0===n[t]&&(n[t]=[])}),t.each(this.nodes,function(i,r){t.each(r.input_terminals,function(i,a){t.each(a.connectors,function(t,i){var a=i.handle1.node;e[r.id]+=1,n[a.id].push(r.id)})})});for(var i=[];;){var r=[];for(var a in e)0===e[a]&&r.push(a);if(0===r.length)break;i.push(r);for(var o in r){var s=r[o];delete e[s];for(var l in n[s])e[n[s][l]]-=1}}if(!e.length){var c=this.nodes,d=80;t.each(i,function(e,n){n.sort(function(e,n){return t(c[e].element).position().top-t(c[n].element).position().top});var i=0,r=30;t.each(n,function(e,n){var a=c[n],o=t(a.element);t(o).css({top:r,left:d}),i=Math.max(i,t(o).width()),r+=t(o).height()+30}),d+=i+80}),t.each(c,function(t,e){e.redraw()})}},bounds_for_all_nodes:function(){var e,n=1/0,i=-1/0,r=1/0,a=-1/0;return t.each(this.nodes,function(o,s){var l=t(s.element);e=l.position(),n=Math.min(n,e.left),i=Math.max(i,e.left+l.width()),r=Math.min(r,e.top),a=Math.max(a,e.top+l.width())}),{xmin:n,xmax:i,ymin:r,ymax:a}},fit_canvas_to_nodes:function(){function e(t,e){return Math.ceil(t/e)*e}function n(t,e){if(t3*e){return-(t-(Math.ceil(t%e/e)+1)*e)}return 0}var i=this.bounds_for_all_nodes(),r=this.canvas_container.position(),a=this.canvas_container.parent(),o=n(i.xmin,100),s=n(i.ymin,100);o=Math.max(o,r.left),s=Math.max(s,r.top);var l=r.left-o,c=r.top-s,d=e(i.xmax+100,100)+o,u=e(i.ymax+100,100)+s;d=Math.max(d,-l+a.width()),u=Math.max(u,-c+a.height()),this.canvas_container.css({left:l,top:c,width:d,height:u}),this.canvas_container.children().each(function(){var e=t(this).position();t(this).css("left",e.left+o),t(this).css("top",e.top+s)})}}),e.default=i}).call(e,n(0))},function(t,e,n){"use strict";(function(t){function n(t,e,n){this.app=t,this.cv=e,this.cc=this.cv.find("#canvas-container"),this.overview=n,this.oc=n.find("#overview-canvas"),this.ov=n.find("#overview-viewport"),this.init_drag(),this.init_copy_paste()}function i(t){this.panel=t}Object.defineProperty(e,"__esModule",{value:!0}),t.extend(n.prototype,{init_drag:function(){var e=this,n=function(t,n){t=Math.min(t,e.cv.width()/2),t=Math.max(t,-e.cc.width()+e.cv.width()/2),n=Math.min(n,e.cv.height()/2),n=Math.max(n,-e.cc.height()+e.cv.height()/2),e.cc.css({left:t,top:n}),e.cv.css({"background-position-x":t,"background-position-y":n}),e.update_viewport_overlay()};this.cc.each(function(){this.scroll_panel=new i(this)});var r,a;this.cv.bind("click",function(){document.activeElement.blur()}).bind("dragstart",function(){var n=t(this).offset(),i=e.cc.position();a=i.top-n.top,r=i.left-n.left}).bind("drag",function(t,e){n(e.offsetX+r,e.offsetY+a)}).bind("dragend",function(){e.app.workflow.fit_canvas_to_nodes(),e.draw_overview()}),this.overview.click(function(t){if(e.overview.hasClass("blockaclick"))e.overview.removeClass("blockaclick");else{var i=e.cc.width(),r=e.cc.height(),a=e.oc.width(),o=e.oc.height(),s=t.pageX-e.oc.offset().left-e.ov.width()/2,l=t.pageY-e.oc.offset().top-e.ov.height()/2;n(-s/a*i,-l/o*r),e.app.workflow.fit_canvas_to_nodes(),e.draw_overview()}}),this.ov.bind("drag",function(t,i){var r=e.cc.width(),a=e.cc.height(),o=e.oc.width(),s=e.oc.height(),l=i.offsetX-e.overview.offset().left,c=i.offsetY-e.overview.offset().top;n(-l/o*r,-c/s*a)}).bind("dragend",function(){e.overview.addClass("blockaclick"),e.app.workflow.fit_canvas_to_nodes(),e.draw_overview()}),t("#overview-border").bind("drag",function(n,i){var r=t(this).offsetParent(),a=r.offset(),o=Math.max(r.width()-(i.offsetX-a.left),r.height()-(i.offsetY-a.top));t(this).css({width:o,height:o}),e.draw_overview()}),t("#overview-border div").bind("drag",function(){})},init_copy_paste:function(){var t=this;document.addEventListener("copy",function(e){""===window.getSelection().toString()&&(t.app.workflow.active_node&&"subworkflow"!==t.app.workflow.active_node.type&&e.clipboardData.setData("application/json",JSON.stringify({nodeId:t.app.workflow.active_node.id})),e.preventDefault())}),document.addEventListener("paste",function(e){if(document.activeElement&&"textarea"!==document.activeElement.type&&"text"!==document.activeElement.type){var n;try{n=JSON.parse(e.clipboardData.getData("application/json")).nodeId}catch(t){}n&&t.app.workflow.nodes.hasOwnProperty(n)&&t.app.workflow.nodes[n].clone(),e.preventDefault()}})},update_viewport_overlay:function(){var t=this.cc,e=this.cv,n=this.oc,i=this.ov,r=t.width(),a=t.height(),o=n.width(),s=n.height(),l=t.position();i.css({left:-l.left/r*o,top:-l.top/a*s,width:e.width()/r*o-2,height:e.height()/a*s-2})},draw_overview:function(){var e,n,i,r,a=t("#overview-canvas"),o=a.parent().parent().width(),s=a.get(0).getContext("2d"),l=t("#canvas-container").width(),c=t("#canvas-container").height(),d=this.cv.width(),u=this.cv.height();l0&&(s.fillStyle="#E8A92D",s.strokeStyle="#E8A92D"),s.fillRect(d,u,h,f),s.strokeRect(d,u,h,f)}),this.update_viewport_overlay()}}),t.extend(i.prototype,{test:function(e,n){var i=this;clearTimeout(this.timeout);var r=e.pageX,a=e.pageY,o=t(this.panel),s=o.position(),l=o.width(),c=o.height(),d=o.parent(),u=d.width(),h=d.height(),f=d.offset(),p=f.left,_=f.top,g=p+d.width(),m=_+d.height(),v=-(l-u/2),y=-(c-h/2),b=u/2,w=h/2,x=!1,k=0;r-5g?s.left>v&&(k=Math.min(23,s.left-v),o.css("left",s.left-k),x=!0):a-5<_?s.topm&&s.top>y&&(k=Math.min(23,s.top-v),o.css("top",s.top-k+"px"),x=!0),x&&(n(),this.timeout=setTimeout(function(){i.test(e,n)},50))},stop:function(){clearTimeout(this.timeout)}}),e.default=n}).call(e,n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(5),s=a(o),l=n(720),c=a(l),d=t.Model.extend({initialize:function(t,e){this.app=t,this.element=e.element,this.input_terminals={},this.output_terminals={},this.errors={},this.workflow_outputs=[]},getWorkflowOutput:function(t){return i.findWhere(this.workflow_outputs,{output_name:t})},isWorkflowOutput:function(t){return void 0!==this.getWorkflowOutput(t)},removeWorkflowOutput:function(t){for(;this.isWorkflowOutput(t);){var e=this.getWorkflowOutput(t);this.workflow_outputs.splice(i.indexOf(this.workflow_outputs,e),1)}},addWorkflowOutput:function(t,e){if(!this.isWorkflowOutput(t)){var n={output_name:t};return e&&(n.label=e),this.workflow_outputs.push(n),!0}return!1},labelWorkflowOutput:function(t,e){var n=!1,i=null;if(this.isWorkflowOutput(t)){var r=this.getWorkflowOutput(t);i=r.label,r.label=e,n=i!=e}else n=this.addWorkflowOutput(t,e);return n&&(this.app.workflow.updateOutputLabel(i,e),this.markChanged(),this.nodeView.redrawWorkflowOutputs()),n},connectedOutputTerminals:function(){return this._connectedTerminals(this.output_terminals)},_connectedTerminals:function(t){var e=[];return r.each(t,function(t,n){n.connectors.length>0&&e.push(n)}),e},hasConnectedOutputTerminals:function(){var t=this.output_terminals;for(var e in t)if(t[e].connectors.length>0)return!0;return!1},connectedMappedInputTerminals:function(){return this._connectedMappedTerminals(this.input_terminals)},hasConnectedMappedInputTerminals:function(){var t=this.input_terminals;for(var e in t){var n=t[e];if(n.connectors.length>0&&n.isMappedOver())return!0}return!1},_connectedMappedTerminals:function(t){var e=[];return r.each(t,function(t,n){n.mapOver().isCollection&&n.connectors.length>0&&e.push(n)}),e},mappedInputTerminals:function(){return this._mappedTerminals(this.input_terminals)},_mappedTerminals:function(t){var e=[];return r.each(t,function(t,n){n.mapOver().isCollection&&e.push(n)}),e},hasMappedOverInputTerminals:function(){var t=!1;return i.each(this.input_terminals,function(e){e.mapOver().isCollection&&(t=!0)}),t},redraw:function(){r.each(this.input_terminals,function(t,e){e.redraw()}),r.each(this.output_terminals,function(t,e){e.redraw()})},clone:function(){var t=this,e={name:this.name,label:this.label,annotation:this.annotation,post_job_actions:this.post_job_actions},n=this.app.workflow.create_node(this.type,this.name,this.content_id);s.default.request({type:"POST",url:Galaxy.root+"api/workflows/build_module",data:{type:this.type,tool_id:this.content_id,tool_state:this.tool_state},success:function(i){var r=Object.assign({},i,e);n.init_field_data(r),n.update_field_data(r),t.app.workflow.activate_node(n)}})},destroy:function(){r.each(this.input_terminals,function(t,e){e.destroy()}),r.each(this.output_terminals,function(t,e){e.destroy()}),this.app.workflow.remove_node(this),r(this.element).remove()},make_active:function(){r(this.element).addClass("toolForm-active")},make_inactive:function(){var t=this.element.get(0);!function(e){e.removeChild(t),e.appendChild(t)}(t.parentNode),r(t).removeClass("toolForm-active")},set_tool_version:function(){"tool"===this.type&&this.config_form&&(this.tool_version=this.config_form.version,this.content_id=this.config_form.id)},init_field_data:function(t){t.type&&(this.type=t.type),this.name=t.name,this.config_form=t.config_form,this.set_tool_version(),this.tool_state=t.tool_state,this.errors=t.errors,this.tooltip=t.tooltip?t.tooltip:"",this.annotation=t.annotation,this.post_job_actions=t.post_job_actions?t.post_job_actions:{},this.label=t.label,this.uuid=t.uuid,this.workflow_outputs=t.workflow_outputs?t.workflow_outputs:[];var e=this,n=new c.default({el:this.element[0],node:e});e.nodeView=n,r.each(t.data_inputs,function(t,e){n.addDataInput(e)}),t.data_inputs.length>0&&t.data_outputs.length>0&&n.addRule(),r.each(t.data_outputs,function(t,e){n.addDataOutput(e)}),n.render(),this.app.workflow.node_changed(this,!0)},update_field_data:function(t){var e=this,n=e.nodeView,a=[];if(r.each(n.outputViews,function(e,n){var r=n.output.name,o=t.data_outputs,s=!1;i.each(o,function(t){t.name==r&&(s=!0)}),!1===s&&a.push(r)}),i.each(a,function(t){i.each(n.outputViews[t].terminalElement.terminal.connectors,function(t){t&&t.destroy()}),n.outputViews[t].remove(),delete n.outputViews[t],delete e.output_terminals[t]}),r.each(e.workflow_outputs,function(t,n){n&&!e.output_terminals[n.output_name]&&e.workflow_outputs.splice(t,1)}),r.each(t.data_outputs,function(t,i){n.outputViews[i.name]?(e.output_terminals[i.name].datatypes=i.extensions,e.output_terminals[i.name].destroyInvalidConnections()):n.addDataOutput(i)}),this.tool_state=t.tool_state,this.config_form=t.config_form,this.set_tool_version(),this.errors=t.errors,this.annotation=t.annotation,this.label=t.label,"post_job_actions"in t){var o=t.post_job_actions;this.post_job_actions=o||{}}e.nodeView.renderToolErrors();var s=n.$("div.inputs"),l=n.newInputsDiv(),c={};i.each(t.data_inputs,function(t){var n=e.nodeView.addDataInput(t,l);c[t.name]=n}),i.each(i.difference(i.values(n.terminalViews),i.values(c)),function(t){t.el.terminal.destroy()}),n.terminalViews=c,e.nodeView.render(),1==t.data_outputs.length&&"collection_type"in t.data_outputs[0]&&n.updateDataOutput(t.data_outputs[0]),s.replaceWith(l),"workflow_outputs"in t&&(this.workflow_outputs=t.workflow_outputs?t.workflow_outputs:[]),this.markChanged(),this.redraw()},error:function(t){var e=r(this.element).find(".toolFormBody");e.find("div").remove();var n="
    "+t+"
    ";this.config_form=n,e.html(n),this.app.workflow.node_changed(this)},markChanged:function(){this.app.workflow.node_changed(this)}});e.default=d}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=n(1),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(a),s=n(721),l=r(s),c=n(723),d=r(c);e.default=t.View.extend({initialize:function(t){this.node=t.node,this.output_width=Math.max(150,this.$el.width()),this.tool_body=this.$el.find(".toolFormBody"),this.tool_body.find("div").remove(),this.newInputsDiv().appendTo(this.tool_body),this.terminalViews={},this.outputViews={}},render:function(){this.renderToolLabel(),this.renderToolErrors(),this.$el.css("width",Math.min(250,Math.max(this.$el.width(),this.output_width)))},renderToolLabel:function(){this.$(".nodeTitle").text(this.node.label||this.node.name),this.$el.attr("node-label",this.node.label)},renderToolErrors:function(){this.node.errors?this.$el.addClass("tool-node-error"):this.$el.removeClass("tool-node-error")},newInputsDiv:function(){return i("
    ").addClass("inputs")},updateMaxWidth:function(t){this.output_width=Math.max(this.output_width,t)},addRule:function(){this.tool_body.append(i("
    ").addClass("rule"))},addDataInput:function(t,e){var n=!0;e||(e=this.$(".inputs"),n=!1);var i=this.terminalViews[t.name],r="dataset_collection"==t.input_type?l.default.InputCollectionTerminalView:l.default.InputTerminalView;if(!i||i instanceof r||(i.el.terminal.destroy(),i=null),i){var a=i.el.terminal;a.update(t),a.destroyInvalidConnections()}else i=new r({node:this.node,input:t});this.terminalViews[t.name]=i;var o=i.el,s=new d.default.DataInputView({terminalElement:o,input:t,nodeView:this,skipResize:n}),c=s.$el;return e.append(c.prepend(i.terminalElements())),i},addDataOutput:function(t){var e=t.collection?l.default.OutputCollectionTerminalView:l.default.OutputTerminalView,n=new e({node:this.node,output:t}),i=new d.default.DataOutputView({output:t,terminalElement:n.el,nodeView:this});this.outputViews[t.name]=i,this.tool_body.append(i.$el.append(n.terminalElements()))},redrawWorkflowOutputs:function(){o.each(this.outputViews,function(t){t.redrawWorkflowOutput()})},updateDataOutput:function(t){this.node.output_terminals[t.name].update(t)}})}).call(e,n(2),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(722),s=a(o),l=n(410),c=a(l);window.workflow_globals=window.workflow_globals||{};var d=t.View.extend({tagName:"div",className:"fa-icon-button fa fa-folder-o",initialize:function(t){this.$el.tooltip({delay:500,title:"Run tool in parallel over collection"}),this.model.bind("change",i.bind(this.render,this))},render:function(){this.model.mapOver.isCollection?this.$el.show():this.$el.hide()}}),u=d.extend({events:{click:"onClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave"},onMouseEnter:function(t){var e=this.model;!e.terminal.connected()&&e.mapOver.isCollection&&this.$el.css("color","red")},onMouseLeave:function(t){this.$el.css("color","black")},onClick:function(t){var e=this.model;!e.terminal.connected()&&e.mapOver.isCollection&&e.terminal.resetMapping()}}),h=t.View.extend({setupMappingView:function(t){var e=new this.terminalMappingClass({terminal:t}),n=new this.terminalMappingViewClass({model:e});n.render(),t.terminalMappingView=n,this.terminalMappingView=n},terminalElements:function(){return this.terminalMappingView?[this.terminalMappingView.el,this.el]:[this.el]}}),f=h.extend({className:"terminal input-terminal",initialize:function(t){var e=t.node,n=t.input,i=n.name,r="node-"+e.cid+"-input-"+i,a=this.terminalForInput(n);a.multiple||this.setupMappingView(a),this.el.terminal=a,this.$el.attr("input-name",i),this.$el.attr("id",r),this.id=r,a.node=e,a.name=i,e.input_terminals[i]=a},events:{dropinit:"onDropInit",dropstart:"onDropStart",dropend:"onDropEnd",drop:"onDrop",hover:"onHover"},onDropInit:function(t,e){var n=this.el.terminal;return r(e.drag).hasClass("output-terminal")&&n.canAccept(e.drag.terminal)},onDropStart:function(t,e){e.proxy.terminal&&(e.proxy.terminal.connectors[0].inner_color="#BBFFBB")},onDropEnd:function(t,e){e.proxy.terminal&&(e.proxy.terminal.connectors[0].inner_color="#FFFFFF")},onDrop:function(t,e){var n=this.el.terminal;new c.default(e.drag.terminal,n).redraw()},onHover:function(){var t=this.el,e=t.terminal;if(e.connectors.length>0){var n=r("
    ").css({display:"none"}).appendTo("body").append(r("
    ").append(r("
    ").addClass("fa-icon-button fa fa-times").click(function(){r.each(e.connectors,function(t,e){e&&e.destroy()}),n.remove()}))).bind("mouseleave",function(){r(this).remove()});n.css({top:r(t).offset().top-2,left:r(t).offset().left-n.width(),"padding-right":r(t).width()}).show()}}}),p=f.extend({terminalMappingClass:s.default.TerminalMapping,terminalMappingViewClass:u,terminalForInput:function(t){return new s.default.InputTerminal({element:this.el,input:t})}}),_=f.extend({terminalMappingClass:s.default.TerminalMapping,terminalMappingViewClass:u,terminalForInput:function(t){return new s.default.InputCollectionTerminal({element:this.el,input:t})}}),g=h.extend({className:"terminal output-terminal",initialize:function(t){var e=t.node,n=t.output,i=n.name,r="node-"+e.cid+"-output-"+i,a=this.terminalForOutput(n);this.setupMappingView(a),this.el.terminal=a,this.$el.attr("output-name",i),this.$el.attr("id",r),a.node=e,a.name=i,e.output_terminals[i]=a},events:{drag:"onDrag",dragstart:"onDragStart",dragend:"onDragEnd"},onDrag:function(t,e){var n=function(){var t=r(e.proxy).offsetParent().offset(),n=e.offsetX-t.left,i=e.offsetY-t.top;r(e.proxy).css({left:n,top:i}),e.proxy.terminal.redraw(),window.workflow_globals.canvas_manager.update_viewport_overlay()};n(),r("#canvas-container").get(0).scroll_panel.test(t,n)},onDragStart:function(t,e){r(e.available).addClass("input-terminal-active"),window.workflow_globals.workflow.check_changes_in_active_form();var n=r('
    ').appendTo("#canvas-container").get(0);n.terminal=new s.default.OutputTerminal({element:n});var i=new c.default;return i.dragging=!0,i.connect(this.el.terminal,n.terminal),n},onDragEnd:function(t,e){var n=e.proxy.terminal.connectors[0];n&&n.destroy(),r(e.proxy).remove(),r(e.available).removeClass("input-terminal-active"),r("#canvas-container").get(0).scroll_panel.stop()}}),m=g.extend({terminalMappingClass:s.default.TerminalMapping,terminalMappingViewClass:d,terminalForOutput:function(t){var e=t.extensions;return new s.default.OutputTerminal({element:this.el,datatypes:e})}}),v=g.extend({terminalMappingClass:s.default.TerminalMapping,terminalMappingViewClass:d,terminalForOutput:function(t){var e=t.collection_type,n=t.collection_type_source;return new s.default.OutputCollectionTerminal({element:this.el,collection_type:e,collection_type_source:n,datatypes:t.extensions})}});e.default={InputTerminalView:p,OutputTerminalView:m,InputCollectionTerminalView:_,OutputCollectionTerminalView:v}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){this.collectionType=t,this.isCollection=!0,this.rank=t.split(":").length}Object.defineProperty(e,"__esModule",{value:!0});var o=n(20),s=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(o);window.workflow_globals=window.workflow_globals||{};var l={isCollection:!1,canMatch:function(){return!1},canMapOver:function(){return!1},toString:function(){return"NullCollectionType[]"},append:function(t){return t},equal:function(t){return t===this}},c={isCollection:!0,canMatch:function(t){return l!==t},canMapOver:function(){return!1},toString:function(){return"AnyCollectionType[]"},append:function(){return c},equal:function(t){return t===this}};t.extend(a.prototype,{append:function(t){return t===l?this:t===c?t:new a(this.collectionType+":"+t.collectionType)},canMatch:function(t){return t!==l&&(t===c||t.collectionType==this.collectionType)},canMapOver:function(t){if(t===l)return!1;if(t===c)return!1;if(this.rank<=t.rank)return!1;var e=t.collectionType;return this._endsWith(this.collectionType,e)},effectiveMapOver:function(t){var e=t.collectionType;return new a(this.collectionType.substring(0,this.collectionType.length-e.length-1))},equal:function(t){return t.collectionType==this.collectionType},toString:function(){return"CollectionType["+this.collectionType+"]"},_endsWith:function(t,e){return-1!==t.indexOf(e,t.length-e.length)}});var d=i.Model.extend({initialize:function(t){this.mapOver=t.mapOver||l,this.terminal=t.terminal,this.terminal.terminalMapping=this},disableMapOver:function(){this.setMapOver(l)},setMapOver:function(t){this.mapOver=t,this.trigger("change")}}),u=i.Model.extend({initialize:function(t){this.element=t.element,this.connectors=[]},connect:function(t){this.connectors.push(t),this.node&&this.node.markChanged()},disconnect:function(e){this.connectors.splice(t.inArray(e,this.connectors),1),this.node&&(this.node.markChanged(),this.resetMappingIfNeeded())},redraw:function(){t.each(this.connectors,function(t,e){e.redraw()})},destroy:function(){t.each(this.connectors.slice(),function(t,e){e.destroy()})},destroyInvalidConnections:function(){r.each(this.connectors,function(t){t&&t.destroyIfInvalid()})},setMapOver:function(t){this.multiple||this.mapOver().equal(t)||(this.terminalMapping.setMapOver(t),r.each(this.node.output_terminals,function(e){e.setMapOver(t)}))},mapOver:function(){return this.terminalMapping?this.terminalMapping.mapOver:l},isMappedOver:function(){return this.terminalMapping&&this.terminalMapping.mapOver.isCollection},resetMapping:function(){this.terminalMapping.disableMapOver()},resetMappingIfNeeded:function(){}}),h=u.extend({initialize:function(t){u.prototype.initialize.call(this,t),this.datatypes=t.datatypes},resetMappingIfNeeded:function(){this.node.hasConnectedOutputTerminals()||this.node.hasConnectedMappedInputTerminals()||r.each(this.node.mappedInputTerminals(),function(t){t.resetMappingIfNeeded()}),!this.node.hasMappedOverInputTerminals()&&this.resetMapping()},resetMapping:function(){this.terminalMapping.disableMapOver(),r.each(this.connectors,function(t){var e=t.handle2;e&&(e.resetMappingIfNeeded(),t.destroyIfInvalid())})}}),f=u.extend({initialize:function(t){u.prototype.initialize.call(this,t),this.update(t.input)},canAccept:function(t){return!this._inputFilled()&&this.attachable(t)},resetMappingIfNeeded:function(){this.mapOver().isCollection&&((this.node.hasConnectedMappedInputTerminals()||!this.node.hasConnectedOutputTerminals())&&this.resetMapping())},resetMapping:function(){this.terminalMapping.disableMapOver(),this.node.hasMappedOverInputTerminals()||r.each(this.node.output_terminals,function(t){t.resetMapping()})},connected:function(){return 0!==this.connectors.length},_inputFilled:function(){return!!this.connected()&&(!this.multiple||!!this._collectionAttached())},_collectionAttached:function(){if(this.connected()){var t=this.connectors[0].handle1;return!!t&&!!(t.isCollection||t.isMappedOver()||t.datatypes.indexOf("input_collection")>0)}return!1},_mappingConstraints:function(){if(!this.node)return[];var t=this.mapOver();if(t.isCollection)return[t];var e=[];return this.node.hasConnectedOutputTerminals()?e.push(r.first(r.values(this.node.output_terminals)).mapOver()):r.each(this.node.connectedMappedInputTerminals(),function(t){e.push(t.mapOver())}),e},_producesAcceptableDatatype:function(t){for(var e in this.datatypes){var n=this.datatypes[e];if("input"==n)return!0;var i=[];if(i=i.concat(t.datatypes),t.node.post_job_actions)for(var r in t.node.post_job_actions){var a=t.node.post_job_actions[r];"ChangeDatatypeAction"!=a.action_type||""!==a.output_name&&a.output_name!=t.name||!a.action_arguments||i.push(a.action_arguments.newtype)}for(var o in i){var s=i[o];if("input"==s||"_sniff_"==s||"input_collection"==s||window.workflow_globals.app.isSubType(i[o],n))return!0}}return!1},_otherCollectionType:function(t){var e=l;t.isCollection&&(e=t.collectionType);var n=t.mapOver();return n.isCollection&&(e=n.append(e)),e}}),p=f.extend({update:function(t){this.datatypes=t.extensions,this.multiple=t.multiple,this.collection=!1},connect:function(t){f.prototype.connect.call(this,t);var e=t.handle1;if(e){var n=this._otherCollectionType(e);n.isCollection&&this.setMapOver(n)}},attachable:function(t){var e=this._otherCollectionType(t),n=this.mapOver();if(e.isCollection){if(this.multiple)return!(this.connected()&&!this._collectionAttached())&&(1==e.rank&&this._producesAcceptableDatatype(t));if(n.isCollection&&n.canMatch(e))return this._producesAcceptableDatatype(t);return!!this._mappingConstraints().every(r.bind(e.canMatch,e))&&this._producesAcceptableDatatype(t)}return!n.isCollection&&this._producesAcceptableDatatype(t)}}),_=f.extend({update:function(t){this.multiple=!1,this.collection=!0,this.datatypes=t.extensions;var e=[];t.collection_types?r.each(t.collection_types,function(t){e.push(new a(t))}):e.push(c),this.collectionTypes=e},connect:function(t){f.prototype.connect.call(this,t);var e=t.handle1;if(e){var n=this._effectiveMapOver(e);this.setMapOver(n)}},_effectiveMapOver:function(t){var e=this.collectionTypes,n=this._otherCollectionType(t);if(!r.some(e,function(t){return t.canMatch(n)}))for(var i in e){var a=e[i];if(n.canMapOver(a)){var o=n.effectiveMapOver(a);if(o!=l)return o}}return l},_effectiveCollectionTypes:function(){var t=this.mapOver();return r.map(this.collectionTypes,function(e){return t.append(e)})},attachable:function(t){var e=this._otherCollectionType(t);if(e.isCollection){var n=this._effectiveCollectionTypes(),i=this.mapOver();if(r.some(n,function(t){return t.canMatch(e)}))return this._producesAcceptableDatatype(t);if(i.isCollection)return!1;if(r.some(this.collectionTypes,function(t){return e.canMapOver(t)})){var a=this._effectiveMapOver(t);if(!a.isCollection)return!1;if(this._mappingConstraints().every(a.canMatch))return this._producesAcceptableDatatype(t)}}return!1}}),g=u.extend({initialize:function(t){if(u.prototype.initialize.call(this,t),this.datatypes=t.datatypes,t.collection_type)this.collectionType=new a(t.collection_type);else{t.collection_type_source||console.log("Warning: No collection type or collection type source defined."),this.collectionType=c}this.isCollection=!0},update:function(t){var e;if(t.collection_type)e=new a(t.collection_type);else{t.collection_type_source||console.log("Warning: No collection type or collection type source defined."),e=c}e.collectionType!=this.collectionType.collectionType&&r.each(this.connectors,function(t){s.warning("Destroying a connection because collection type has changed."),t.destroy()}),this.collectionType=e}});e.default={InputTerminal:p,OutputTerminal:h,InputCollectionTerminal:_,OutputCollectionTerminal:g,TerminalMapping:d,CollectionTypeDescription:a,NULL_COLLECTION_TYPE_DESCRIPTION:l,ANY_COLLECTION_TYPE_DESCRIPTION:c}}).call(e,n(0),n(2),n(1))},function(t,e,n){"use strict";(function(t,n){Object.defineProperty(e,"__esModule",{value:!0}),window.workflow_globals=window.workflow_globals||{};var i=t.View.extend({className:"form-row dataRow input-data-row",initialize:function(t){this.input=t.input,this.nodeView=t.nodeView,this.terminalElement=t.terminalElement,this.$el.attr("name",this.input.name).html(this.input.label),t.skipResize||(this.$el.css({position:"absolute",left:-1e3,top:-1e3,display:"none"}),n("body").append(this.el),this.nodeView.updateMaxWidth(this.$el.outerWidth()),this.$el.css({position:"",left:"",top:"",display:""}),this.$el.remove())}}),r=t.View.extend({className:"form-row dataRow",initialize:function(t){this.output=t.output,this.terminalElement=t.terminalElement,this.nodeView=t.nodeView;var e=this.output,i=e.name,r=this.nodeView.node;if(e.extensions.indexOf("input")>=0||e.extensions.indexOf("input_collection")>=0||(i=i+" ("+e.extensions.join(", ")+")"),this.$el.html(i),this.calloutView=null,["tool","subworkflow"].indexOf(r.type)>=0){var o=new a({label:i,output:e,node:r});this.calloutView=o,this.$el.append(o.el),this.$el.hover(function(){o.hoverImage()},function(){o.resetImage()})}this.$el.css({position:"absolute",left:-1e3,top:-1e3,display:"none"}),n("body").append(this.el),this.nodeView.updateMaxWidth(this.$el.outerWidth()+17),this.$el.css({position:"",left:"",top:"",display:""}).detach()},redrawWorkflowOutput:function(){this.calloutView&&this.calloutView.resetImage()}}),a=t.View.extend({tagName:"div",initialize:function(t){this.label=t.label,this.node=t.node,this.output=t.output;var e=this,i=this.node;this.$el.attr("class","callout "+this.label).css({display:"none"}).append(n("
    ").append(n("").attr("src",Galaxy.root+"static/images/fugue/asterisk-small-outline.png").click(function(){var t=e.output.name;i.isWorkflowOutput(t)?(i.removeWorkflowOutput(t),e.$("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small-outline.png")):(i.addWorkflowOutput(t),e.$("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small.png")),window.workflow_globals.workflow.has_changes=!0,window.workflow_globals.canvas_manager.draw_overview()}))).tooltip({delay:500,title:"Mark dataset as a workflow output. All unmarked datasets will be hidden."}),this.$el.css({top:"50%",margin:"-8px 0px 0px 0px",right:8}),this.$el.show(),this.resetImage()},resetImage:function(){this.node.isWorkflowOutput(this.output.name)?this.$("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small.png"):this.$("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small-outline.png")},hoverImage:function(){this.$("img").attr("src",Galaxy.root+"static/images/fugue/asterisk-small-yellow.png")}});e.default={DataInputView:i,DataOutputView:r}}).call(e,n(2),n(0))},function(t,e,n){"use strict";(function(t,i){function r(t){return t&&t.__esModule?t:{default:t}}function a(t){var e=t.model.attributes,n=e.workflow,i=e.node;e.inputs.unshift({type:"text",name:"__annotation",label:"Annotation",fixed:!0,value:i.annotation,area:!0,help:"Add an annotation or notes to this step. Annotations are available when a workflow is viewed."}),e.inputs.unshift({type:"text",name:"__label",label:"Label",value:i.label,help:(0,d.default)("Add a step label."),fixed:!0,onchange:function(e){var r=!1;for(var a in n.nodes){var o=n.nodes[a];if(o.label&&o.label==e&&o.id!=i.id){r=!0;break}}var s=t.data.match("__label");t.element_list[s].model.set("error_text",r&&"Duplicate label. Please fix this before saving the workflow."),t.trigger("change")}})}function o(t,e,n,i){var r=i.node.post_job_actions;e=e||[],e.push(t);for(var a in t.inputs){var s=t.inputs[a];if(s.action){if(s.name="pja__"+n+"__"+s.action,s.pja_arg&&(s.name+="__"+s.pja_arg),s.payload)for(var l in s.payload)s.payload[s.name+"__"+l]=s.payload[l],delete s.payload[l];var c=r[s.action+n];if(c){for(var d in e)e[d].expanded=!0;s.pja_arg?s.value=c.action_arguments&&c.action_arguments[s.pja_arg]||s.value:s.value="true"}}s.inputs&&o(s,e.slice(0),n,i)}}function s(t,e){var n=[],i=[],r=e.datatypes,a=e.node,s=e.workflow;for(var l in r)n.push({0:r[l],1:r[l]});for(l in a.input_terminals)i.push(a.input_terminals[l].name);n.sort(function(t,e){return t.label>e.label?1:t.labelhere
    for more information. Valid inputs are: '+i.join(", ")+"."},{action:"ChangeDatatypeAction",pja_arg:"newtype",label:"Change datatype",type:"select",ignore:"__empty__",value:"__empty__",options:n,help:"This action will change the datatype of the output to the indicated value."},{action:"TagDatasetAction",pja_arg:"tags",label:"Add Tags",type:"text",value:"",ignore:"",help:"This action will set tags for the dataset."},{action:"RemoveTagDatasetAction",pja_arg:"tags",label:"Remove Tags",type:"text",value:"",ignore:"",help:"This action will remove tags for the dataset."},{title:(0,d.default)("Assign columns"),type:"section",flat:!0,inputs:[{action:"ColumnSetAction",pja_arg:"chromCol",label:"Chrom column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"startCol",label:"Start column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"endCol",label:"End column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"strandCol",label:"Strand column",type:"integer",value:"",ignore:""},{action:"ColumnSetAction",pja_arg:"nameCol",label:"Name column",type:"integer",value:"",ignore:""}],help:"This action will set column assignments in the output dataset. Blank fields are ignored."}]};return o(u,[],t,e),u}function l(t){var e=t.model.attributes,n=e.inputs,i=e.node,r=i.post_job_actions,a=i.output_terminals&&Object.keys(i.output_terminals)[0];if(a){n.push({name:"pja__"+a+"__EmailAction",label:"Email notification",type:"boolean",value:String(Boolean(r["EmailAction"+a])),ignore:"false",help:(0,d.default)("An email notification will be sent when the job has completed."),payload:{host:window.location.host}}),n.push({name:"pja__"+a+"__DeleteIntermediatesAction",label:"Output cleanup",type:"boolean",value:String(Boolean(r["DeleteIntermediatesAction"+a])),ignore:"false",help:"Upon completion of this step, delete non-starred outputs from completed workflow steps if they are no longer required as inputs."});for(var o in i.output_terminals)n.push(s(o,e))}}Object.defineProperty(e,"__esModule",{value:!0});var c=n(3),d=r(c),u=n(5),h=r(u),f=n(26),p=r(f),_=n(55),g=r(_),m=t.View.extend({initialize:function(t){var e=this,n=t.node;this.form=new p.default(h.default.merge(t,{onchange:function(){h.default.request({type:"POST",url:Galaxy.root+"api/workflows/build_module",data:{id:n.id,type:n.type,content_id:n.content_id,inputs:e.form.data.create()},success:function(t){n.update_field_data(t)}})}})),a(this.form),this.form.render()}}),v=t.View.extend({initialize:function(t){var e=this,n=t.node;this.form=new g.default(h.default.merge(t,{text_enable:"Set in Advance",text_disable:"Set at Runtime",narrow:!0,initial_errors:!0,cls:"ui-portlet-narrow",initialmodel:function(t,n){e._customize(n),t.resolve()},buildmodel:function(t,e){e.model.get("postchange")(t,e)},postchange:function(t,r){var a=r.model.attributes,o={tool_id:a.id,tool_version:a.version,type:"tool",inputs:i.extend(!0,{},r.data.create())};Galaxy.emit.debug("tool-form-workflow::postchange()","Sending current state.",o),h.default.request({type:"POST",url:Galaxy.root+"api/workflows/build_module",data:o,success:function(i){r.model.set(i.config_form),e._customize(r),r.update(i.config_form),r.errors(i.config_form),n.update_field_data(i),Galaxy.emit.debug("tool-form-workflow::postchange()","Received new model.",i),t.resolve()},error:function(e){Galaxy.emit.debug("tool-form-workflow::postchange()","Refresh request failed.",e),t.reject()}})}}))},_customize:function(t){var e=t.model.attributes;h.default.deepeach(e.inputs,function(t){t.type&&(-1!=["data","data_collection"].indexOf(t.type)?(t.type="hidden",t.info="Data input '"+t.name+"' ("+h.default.textify(t.extensions)+")",t.value={__class__:"RuntimeValue"}):t.fixed||(t.collapsible_value={__class__:"RuntimeValue"},t.is_workflow=t.options&&0===t.options.length||-1!=["integer","float"].indexOf(t.type)))}),h.default.deepeach(e.inputs,function(t){"conditional"===t.type&&(t.test_param.collapsible_value=void 0)}),l(t),a(t)}});e.default={Default:m,Tool:v}}).call(e,n(2),n(0))},function(t,e,n){"use strict";(function(t,i){function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(1),c=r(l),d=n(224),u=r(d),h=n(15),f=a(h),p=n(5),_=a(p),g=n(33),m=a(g),v=n(31),y=a(v);n(150);var b=t.Model.extend({is_visible:function(t,e){var n=t.getBoundingClientRect(),r=i("svg")[0].getBoundingClientRect();return!(n.right<0||n.left>r.right||n.bottom<0||n.top>r.bottom)}}),w={drawTicks:function(t,e,n,i,r){var a=t.append("g").selectAll("g").data(e).enter().append("g").selectAll("g").data(n).enter().append("g").attr("class","tick").attr("transform",function(t){return"rotate("+(180*t.angle/Math.PI-90)+")translate("+t.radius+",0)"}),o=[],s=[],l=function(t){return t.angle>Math.PI?"end":null};return r?(o=[0,0,0,-4],s=[4,0,"",".35em"],l=null):(o=[1,0,4,0],s=[0,4,".35em",""]),a.append("line").attr("x1",o[0]).attr("y1",o[1]).attr("x2",o[2]).attr("y1",o[3]).style("stroke","#000"),a.append("text").attr("x",s[0]).attr("y",s[1]).attr("dx",s[2]).attr("dy",s[3]).attr("text-anchor",l).attr("transform",i).text(function(t){return t.label})},formatNum:function(t,e){if(void 0===e&&(e=2),null===t)return null;var n=null;if(Math.abs(t)<1)n=t.toPrecision(e);else{var i=Math.round(t.toPrecision(e));t=Math.abs(t),t<1e3?n=i:t<1e6?n=Math.round((i/1e3).toPrecision(3)).toFixed(0)+"K":t<1e9&&(n=Math.round((i/1e6).toPrecision(3)).toFixed(0)+"M")}return n}},x=t.Model.extend({}),k=t.View.extend({className:"circster",initialize:function(t){this.genome=t.genome,this.label_arc_height=50,this.scale=1,this.circular_views=null,this.chords_views=null,this.model.get("drawables").on("add",this.add_track,this),this.model.get("drawables").on("remove",this.remove_track,this);var e=this.model.get("config");e.get("arc_dataset_height").on("change:value",this.update_track_bounds,this),e.get("track_gap").on("change:value",this.update_track_bounds,this)},get_circular_tracks:function(){return this.model.get("drawables").filter(function(t){return"DiagonalHeatmapTrack"!==t.get("track_type")})},get_chord_tracks:function(){return this.model.get("drawables").filter(function(t){return"DiagonalHeatmapTrack"===t.get("track_type")})},get_tracks_bounds:function(){var t=this.get_circular_tracks(),e=this.model.get("config").get_value("arc_dataset_height"),n=this.model.get("config").get_value("track_gap"),i=Math.min(this.$el.width(),this.$el.height())-20,r=i/2-t.length*(e+n)+n-this.label_arc_height,a=u.range(r,i/2,e+n);return c.map(a,function(t){return[t,t+e]})},render:function(){var t=this,e=t.$el.width(),n=t.$el.height(),i=this.get_circular_tracks(),r=this.get_chord_tracks(),a=t.model.get("config").get_value("total_gap"),o=this.get_tracks_bounds(),s=u.select(t.$el[0]).append("svg").attr("width",e).attr("height",n).attr("pointer-events","all").append("svg:g").call(u.behavior.zoom().on("zoom",function(){var e=d.event.scale;s.attr("transform","translate("+d.event.translate+") scale("+e+")"),t.scale!==e&&(t.zoom_drag_timeout&&clearTimeout(t.zoom_drag_timeout),t.zoom_drag_timeout=setTimeout(function(){},400))})).attr("transform","translate("+e/2+","+n/2+")").append("svg:g").attr("class","tracks");this.circular_views=i.map(function(e,n){var i=new T({el:s.append("g")[0],track:e,radius_bounds:o[n],genome:t.genome,total_gap:a});return i.render(),i}),this.chords_views=r.map(function(e){var n=new A({el:s.append("g")[0],track:e,radius_bounds:o[0],genome:t.genome,total_gap:a});return n.render(),n});var l=this.circular_views[this.circular_views.length-1].radius_bounds[1],c=[l,l+this.label_arc_height];this.label_track_view=new C({el:s.append("g")[0],track:new x,radius_bounds:c,genome:t.genome,total_gap:a}),this.label_track_view.render()},add_track:function(t){var e=this.model.get("config").get_value("total_gap");if("DiagonalHeatmapTrack"===t.get("track_type")){var n=this.circular_views[0].radius_bounds,i=new A({el:u.select("g.tracks").append("g")[0],track:t,radius_bounds:n,genome:this.genome,total_gap:e});i.render(),this.chords_views.push(i)}else{var r=this.get_tracks_bounds();c.each(this.circular_views,function(t,e){t.update_radius_bounds(r[e])}),c.each(this.chords_views,function(t){t.update_radius_bounds(r[0])});var a=this.circular_views.length,o=new T({el:u.select("g.tracks").append("g")[0],track:t,radius_bounds:r[a],genome:this.genome,total_gap:e});o.render(),this.circular_views.push(o)}},remove_track:function(t,e,n){var i=this.circular_views[n.index];this.circular_views.splice(n.index,1),i.$el.remove();var r=this.get_tracks_bounds();c.each(this.circular_views,function(t,e){t.update_radius_bounds(r[e])})},update_track_bounds:function(){var t=this.get_tracks_bounds();c.each(this.circular_views,function(e,n){e.update_radius_bounds(t[n])}),c.each(this.chords_views,function(e){e.update_radius_bounds(t[0])})}}),M=t.View.extend({tagName:"g",initialize:function(t){this.bg_stroke="#ddd",this.loading_bg_fill="#ffc",this.bg_fill="#ddd",this.total_gap=t.total_gap,this.track=t.track,this.radius_bounds=t.radius_bounds,this.genome=t.genome,this.chroms_layout=this._chroms_layout(),this.data_bounds=[],this.scale=1,this.parent_elt=u.select(this.$el[0])},get_fill_color:function(){var t=this.track.get("config").get_value("block_color");return t||(t=this.track.get("config").get_value("color")),t},render:function(){var t=this.parent_elt,e=this.chroms_layout,n=u.svg.arc().innerRadius(this.radius_bounds[0]).outerRadius(this.radius_bounds[1]),r=t.selectAll("g").data(e).enter().append("svg:g"),a=r.append("path").attr("d",n).attr("class","chrom-background").style("stroke",this.bg_stroke).style("fill",this.loading_bg_fill);a.append("title").text(function(t){return t.data.chrom});var o=this,s=o.track.get("data_manager"),l=!s||s.data_is_ready();i.when(l).then(function(){i.when(o._render_data(t)).then(function(){a.style("fill",o.bg_fill),o.render_labels()})})},render_labels:function(){},update_radius_bounds:function(t){this.radius_bounds=t;var e=u.svg.arc().innerRadius(this.radius_bounds[0]).outerRadius(this.radius_bounds[1]);this.parent_elt.selectAll("g>path.chrom-background").transition().duration(1e3).attr("d",e),this._transition_chrom_data(),this._transition_labels()},update_scale:function(t){var e=this.scale;if(this.scale=t,!(t<=e)){var n=this,r=new b;return this.parent_elt.selectAll("path.chrom-data").filter(function(t,e){return r.is_visible(this)}).each(function(e,r){var a,o=u.select(this),s=o.attr("chrom"),l=n.genome.get_chrom_region(s),d=n.track.get("data_manager");d.can_get_more_detailed_data(l)&&(a=n.track.get("data_manager").get_more_detailed_data(l,"Coverage",0,t),i.when(a).then(function(t){o.remove(),n._update_data_bounds();var e=c.find(n.chroms_layout,function(t){return t.data.chrom===s}),i=n.get_fill_color();n._render_chrom_data(n.parent_elt,e,t).style("stroke",i).style("fill",i)}))}),n}},_transition_chrom_data:function(){var t=this.track,e=this.chroms_layout,n=this.parent_elt.selectAll("g>path.chrom-data");if(n[0].length>0){var r=this;i.when(t.get("data_manager").get_genome_wide_data(this.genome)).then(function(i){var a=c.reject(c.map(i,function(t,n){var i=null,a=r._get_path_function(e[n],t);return a&&(i=a(t.data)),i}),function(t){return null===t}),o=t.get("config").get_value("color");n.each(function(t,e){u.select(this).transition().duration(1e3).style("stroke",o).style("fill",o).attr("d",a[e])})})}},_transition_labels:function(){},_update_data_bounds:function(t){this.data_bounds=t||this.get_data_bounds(this.track.get("data_manager").get_genome_wide_data(this.genome)),this._transition_chrom_data()},_render_data:function(t){var e=this,n=this.chroms_layout,r=this.track,a=i.Deferred();return i.when(r.get("data_manager").get_genome_wide_data(this.genome)).then(function(i){e.data_bounds=e.get_data_bounds(i),r.get("config").set_value("min_value",e.data_bounds[0],{silent:!0}),r.get("config").set_value("max_value",e.data_bounds[1],{silent:!0});var o=c.zip(n,i);c.each(o,function(n){var i=n[0],r=n[1];return e._render_chrom_data(t,i,r)});var s=e.get_fill_color();e.parent_elt.selectAll("path.chrom-data").style("stroke",s).style("fill",s),a.resolve(t)}),a},_render_chrom_data:function(t,e,n){},_get_path_function:function(t,e){},_chroms_layout:function(){var t=this.genome.get_chroms_info(),e=u.layout.pie().value(function(t){return t.len}).sort(null),n=e(t),i=2*Math.PI*this.total_gap/t.length;return c.map(n,function(t,e){var n=t.endAngle-i;return t.endAngle=n>t.startAngle?n:t.startAngle,t})}}),C=M.extend({initialize:function(t){M.prototype.initialize.call(this,t),this.innerRadius=this.radius_bounds[0],this.radius_bounds[0]=this.radius_bounds[1],this.bg_stroke="#fff",this.bg_fill="#fff",this.min_arc_len=.05},_render_data:function(t){var e=this,n=t.selectAll("g");n.selectAll("path").attr("id",function(t){return"label-"+t.data.chrom}),n.append("svg:text").filter(function(t){return t.endAngle-t.startAngle>e.min_arc_len}).attr("text-anchor","middle").append("svg:textPath").attr("class","chrom-label").attr("xlink:href",function(t){return"#label-"+t.data.chrom}).attr("startOffset","25%").text(function(t){return t.data.chrom});var i=function(t){var n=(t.endAngle-t.startAngle)/t.value,i=u.range(0,t.value,25e6).map(function(i,r){return{radius:e.innerRadius,angle:i*n+t.startAngle,label:0===r?0:r%3?null:e.formatNum(i)}});return i.length<4&&(i[i.length-1].label=e.formatNum(Math.round((i[i.length-1].angle-t.startAngle)/n))),i},r=function(t){return t.angle>Math.PI?"rotate(180)translate(-16)":null},a=c.filter(this.chroms_layout,function(t){return t.endAngle-t.startAngle>e.min_arc_len});this.drawTicks(this.parent_elt,a,i,r)}});c.extend(C.prototype,w);var S=M.extend({initialize:function(t){M.prototype.initialize.call(this,t);var e=this.track.get("config");e.get("min_value").on("change:value",this._update_min_max,this),e.get("max_value").on("change:value",this._update_min_max,this),e.get("color").on("change:value",this._transition_chrom_data,this)},_update_min_max:function(){var t=this.track.get("config"),e=[t.get_value("min_value"),t.get_value("max_value")];this._update_data_bounds(e),this.parent_elt.selectAll(".min_max").text(function(t,n){return e[n]})},_quantile:function(t,e){return t.sort(u.ascending),u.quantile(t,e)},_render_chrom_data:function(t,e,n){var i=this._get_path_function(e,n);return i?t.datum(n.data).append("path").attr("class","chrom-data").attr("chrom",e.data.chrom).attr("d",i):null},_get_path_function:function(t,e){if("string"==typeof e||!e.data||0===e.data.length)return null;var n=u.scale.linear().domain(this.data_bounds).range(this.radius_bounds).clamp(!0),i=u.scale.linear().domain([0,e.data.length]).range([t.startAngle,t.endAngle]),r=u.svg.line.radial().interpolate("linear").radius(function(t){return n(t[1])}).angle(function(t,e){return i(e)});return u.svg.area.radial().interpolate(r.interpolate()).innerRadius(n(0)).outerRadius(r.radius()).angle(r.angle())},render_labels:function(){var t=this,e=function(){return"rotate(90)"},n=this.drawTicks(this.parent_elt,[this.chroms_layout[0]],this._data_bounds_ticks_fn(),e,!0).classed("min_max",!0);c.each(n,function(e){i(e).click(function(){new m.default.ConfigSettingCollectionView({collection:t.track.get("config")}).render_in_modal("Configure Track")})})},_transition_labels:function(){if(0!==this.data_bounds.length){var t=this,e=c.filter(this.chroms_layout,function(t){return t.endAngle-t.startAngle>.08}),n=c.filter(e,function(t,e){return e%3==0}),i=c.flatten(c.map(n,function(e){return t._data_bounds_ticks_fn()(e)}));this.parent_elt.selectAll("g.tick").data(i).transition().attr("transform",function(t){return"rotate("+(180*t.angle/Math.PI-90)+")translate("+t.radius+",0)"})}},_data_bounds_ticks_fn:function(){var t=this;return function(e){return[{radius:t.radius_bounds[0],angle:e.startAngle,label:t.formatNum(t.data_bounds[0])},{radius:t.radius_bounds[1],angle:e.startAngle,label:t.formatNum(t.data_bounds[1])}]}},get_data_bounds:function(t){}});c.extend(S.prototype,w);var T=S.extend({get_data_bounds:function(t){var e=c.flatten(c.map(t,function(t){return t?c.map(t.data,function(t){return parseInt(t[1],10)||0}):0}));return[c.min(e),this._quantile(e,.98)||c.max(e)]}}),A=M.extend({render:function(){var t=this;i.when(t.track.get("data_manager").data_is_ready()).then(function(){i.when(t.track.get("data_manager").get_genome_wide_data(t.genome)).then(function(e){var n=[],i=t.genome.get_chroms_info();c.each(e,function(e,r){var a=i[r].chrom,o=c.map(e.data,function(e){var n=t._get_region_angle(a,e[1]),i=t._get_region_angle(e[3],e[4]);return{source:{startAngle:n,endAngle:n+.01},target:{startAngle:i,endAngle:i+.01}}});n=n.concat(o)}),t.parent_elt.append("g").attr("class","chord").selectAll("path").data(n).enter().append("path").style("fill",t.get_fill_color()).attr("d",u.svg.chord().radius(t.radius_bounds[0])).style("opacity",1)})})},update_radius_bounds:function(t){this.radius_bounds=t,this.parent_elt.selectAll("path").transition().attr("d",u.svg.chord().radius(this.radius_bounds[0]))},_get_region_angle:function(t,e){var n=c.find(this.chroms_layout,function(e){return e.data.chrom===t});return n.endAngle-(n.endAngle-n.startAngle)*(n.data.len-e)/n.data.len}}),j=t.View.extend({initialize:function(){_.default.cssLoadFile("static/style/circster.css");var t=new f.default.Genome(window.galaxy_config.app.genome),e=new f.default.GenomeVisualization(window.galaxy_config.app.viz_config);e.get("config").add([{key:"arc_dataset_height",label:"Arc Dataset Height",type:"int",value:25,view:"circster"},{key:"track_gap",label:"Gap Between Tracks",type:"int",value:5,view:"circster"},{key:"total_gap",label:"Gap [0-1]",type:"float",value:.4,view:"circster",hidden:!0}]),new k({el:i("#center .unified-panel-body"),genome:t,model:e}).render(),i("#center .unified-panel-header-inner").append(window.galaxy_config.app.viz_config.title+" "+window.galaxy_config.app.viz_config.dbkey);var n=y.default.create_icon_buttons_menu([{icon_class:"plus-button",title:(0,s.default)("Add tracks"),on_click:function(){f.default.select_datasets({dbkey:e.get("dbkey")},function(t){e.add_tracks(t)})}},{icon_class:"gear",title:(0,s.default)("Settings"),on_click:function(){new m.default.ConfigSettingCollectionView({collection:e.get("config")}).render_in_modal("Configure Visualization")}},{icon_class:"disk--arrow",title:(0,s.default)("Save"),on_click:function(){Galaxy.modal.show({title:(0,s.default)("Saving..."),body:"progress"}),i.ajax({url:Galaxy.root+"visualization/save",type:"POST",dataType:"json",data:{id:e.get("vis_id"),title:e.get("title"),dbkey:e.get("dbkey"),type:"trackster",vis_json:JSON.stringify(e)}}).success(function(t){Galaxy.modal.hide(),e.set("vis_id",t.vis_id)}).error(function(){Galaxy.modal.show({title:(0,s.default)("Could Not Save"),body:"Could not save visualization. Please try again later.",buttons:{Cancel:function(){Galaxy.modal.hide()}}})})}},{icon_class:"cross-circle",title:(0,s.default)("Close"),on_click:function(){window.top.location=Galaxy.root+"visualizations/list"}}],{tooltip_config:{placement:"bottom"}});n.$el.attr("style","float: right"),i("#center .unified-panel-header-inner").append(n.$el),i(".menu-button").tooltip({placement:"bottom"})}});e.default={GalaxyApp:j}}).call(e,n(2),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}function o(){function t(e,n,i,r){var a=e.children,d=0,u=e.dist||l;return u=u>1?1:u,e.dist=u,e.y0=null!==r?r.y0+u*o:c,a?(a.forEach(function(r){r.parent=e,d+=t(r,n,i,e)}),e.x0=d/a.length):(e.x0=s*i,s+=1),e.x=e.x0,e.y=e.y0,e.x0}var e=this,n=d.layout.hierarchy().sort(null).value(null),i=360,r="Linear",a=18,o=200,s=0,l=.5,c=50;return e.leafHeight=function(t){return void 0===t?a:(a=t,e)},e.layoutMode=function(t){return void 0===t?r:(r=t,e)},e.layoutAngle=function(t){return void 0===t?i:isNaN(t)||t<0||t>360?e:(i=t,e)},e.separation=function(t){return void 0===t?o:(o=t,e)},e.links=function(t){return d.layout.tree().links(t)},e.nodes=function(o,l){"[object Array]"===toString.call(o)&&(o=o[0]);var c=n.call(e,o,l),d=[],u=0,h=0;return window._d=o,window._nodes=c,c.forEach(function(t){u=t.depth>u?t.depth:u,d.push(t)}),d.forEach(function(t){t.children||(h+=1,t.depth=u)}),a="Circular"===r?i/h:a,s=0,t(d[0],u,a,null),d},e}Object.defineProperty(e,"__esModule",{value:!0});var s=n(3),l=a(s),c=n(192),d=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(c),u=n(15),h=a(u),f=n(14),p=a(f),_=n(31),g=a(_),m=t.View.extend({className:"UserMenuBase",isAcceptableValue:function(t,e,n){var i=t.val(),r=t.attr("displayLabel")||t.attr("id").replace("phyloViz","");return function(t){return!isNaN(parseFloat(t))&&isFinite(t)}(i)?i>n?(alert(r+" is too large."),!1):!(i":"")+"Dist: "+t.dist+"
    Annotation1: "+e+(t.bootstrap?"
    Confidence level: "+Math.round(100*t.bootstrap):""):""}).tooltip({placement:"top",trigger:"hover"})}}),b=y.extend({initialize:function(t){var e=this;e.margins=t.margins,e.layoutMode="Linear",e.stdInit(t),e.layout(),e.updateAndRender(e.model.root)},layout:function(){var t=this;t.tree=(new o).layoutMode("Linear"),t.diagonal=d.svg.diagonal().projection(function(t){return[t.y,t.x]})},renderNodes:function(t){var e=this,n=e.model.get("fontSize")+"px";e.tree.separation(e.model.get("separation")).leafHeight(e.model.get("leafHeight"));var i=e.tree.separation(e.model.get("separation")).nodes(e.model.root),r=e.vis.selectAll("g.node").data(i,function(t){return t.name+t.id||(t.id=++e.i)});e.nodes=i,e.duration=500;var a=r.enter().append("svg:g").attr("class","node").on("dblclick",function(){d.event.stopPropagation()}).on("click",function(t){if(d.event.altKey)e.selectNode(t);else{if(t.children&&0===t.children.length)return;e.model.toggle(t),e.updateAndRender(t)}});"[object Array]"===toString.call(t)&&(t=t[0]),a.attr("transform",function(e){return"translate("+t.y0+","+t.x0+")"}),a.append("svg:circle").attr("r",1e-6).style("fill",function(t){return t._children?"lightsteelblue":"#fff"}),a.append("svg:text").attr("class","nodeLabel").attr("x",function(t){return t.children||t._children?-10:10}).attr("dy",".35em").attr("text-anchor",function(t){return t.children||t._children?"end":"start"}).style("fill-opacity",1e-6);var o=r.transition().duration(500);o.attr("transform",function(t){return"translate("+t.y+","+t.x+")"}),o.select("circle").attr("r",e.defaults.nodeRadius).style("fill",function(t){return t._children?"lightsteelblue":"#fff"}),o.select("text").style("fill-opacity",1).style("font-size",n).text(function(t){return t.name&&""!==t.name?t.name:t.bootstrap?Math.round(100*t.bootstrap):""});var s=r.exit().transition().duration(500).remove();s.select("circle").attr("r",1e-6),s.select("text").style("fill-opacity",1e-6),i.forEach(function(t){t.x0=t.x,t.y0=t.y})}}),w=t.View.extend({className:"phyloviz",initialize:function(t){var e=this;e.MIN_SCALE=.05,e.MAX_SCALE=5,e.MAX_DISPLACEMENT=500,e.margins=[10,60,10,80],e.width=r("#PhyloViz").width(),e.height=r("#PhyloViz").height(),e.radius=e.width,e.data=t.data,r(window).resize(function(){e.width=r("#PhyloViz").width(),e.height=r("#PhyloViz").height(),e.render()}),e.phyloTree=new v(t.config),e.phyloTree.root=e.data,e.zoomFunc=d.behavior.zoom().scaleExtent([e.MIN_SCALE,e.MAX_SCALE]),e.zoomFunc.translate(e.phyloTree.get("translate")),e.zoomFunc.scale(e.phyloTree.get("scaleFactor")),e.navMenu=new x(e),e.settingsMenu=new k({phyloTree:e.phyloTree}),e.nodeSelectionView=new M({phyloTree:e.phyloTree}),e.search=new C,setTimeout(function(){e.zoomAndPan()},1e3)},render:function(){var t=this;r("#PhyloViz").empty(),t.mainSVG=d.select("#PhyloViz").append("svg:svg").attr("width",t.width).attr("height",t.height).attr("pointer-events","all").call(t.zoomFunc.on("zoom",function(){t.zoomAndPan()})),t.boundingRect=t.mainSVG.append("svg:rect").attr("class","boundingRect").attr("width",t.width).attr("height",t.height).attr("stroke","black").attr("fill","white"),t.vis=t.mainSVG.append("svg:g").attr("class","vis"),t.layoutOptions={model:t.phyloTree,width:t.width,height:t.height,vis:t.vis,margins:t.margins},r("#title").text("Phylogenetic Tree from "+t.phyloTree.get("title")+":");new b(t.layoutOptions)},zoomAndPan:function(t){var e,n;void 0!==t&&(e=t.zoom,n=t.translate);var i=this,r=i.zoomFunc.scale(),a=i.zoomFunc.translate(),o="",s="";switch(e){case"reset":r=1,a=[0,0];break;case"+":r*=1.1;break;case"-":r*=.9;break;default:"number"==typeof e?r=e:null!==d.event&&(r=d.event.scale)}if(!(ri.MAX_SCALE)){if(i.zoomFunc.scale(r),o="translate("+i.margins[3]+","+i.margins[0]+") scale("+r+")",null!==d.event)s="translate("+d.event.translate+")";else{if(void 0!==n){var l=n.split(",")[0],c=n.split(",")[1];isNaN(l)||isNaN(c)||(a=[a[0]+parseFloat(l),a[1]+parseFloat(c)])}i.zoomFunc.translate(a),s="translate("+a+")"}i.phyloTree.set("scaleFactor",r),i.phyloTree.set("translate",a),i.vis.attr("transform",s+o)}},reloadViz:function(){var t=this,e=r("#phylovizNexSelector :selected").val();r.getJSON(t.phyloTree.get("dataset").url(),{tree_index:e,data_type:"raw_data"},function(e){t.data=e.data,t.config=e,t.render()})}}),x=t.View.extend({initialize:function(t){var e=this;e.phylovizView=t,r("#panelHeaderRightBtns").empty(),r("#phyloVizNavBtns").empty(),r("#phylovizNexSelector").off(),e.initNavBtns(),e.initRightHeaderBtns(),r("#phylovizNexSelector").off().on("change",function(){e.phylovizView.reloadViz()})},initRightHeaderBtns:function(){var t=this,e=g.default.create_icon_buttons_menu([{icon_class:"gear",title:(0,l.default)("PhyloViz Settings"),on_click:function(){r("#SettingsMenu").show(),t.settingsMenu.updateUI()}},{icon_class:"disk",title:(0,l.default)("Save visualization"),on_click:function(){var e=r("#phylovizNexSelector option:selected").text();e&&t.phylovizView.phyloTree.set("title",e),t.phylovizView.phyloTree.save()}},{icon_class:"chevron-expand",title:"Search / Edit Nodes",on_click:function(){r("#nodeSelectionView").show()}},{icon_class:"information",title:(0,l.default)("Phyloviz Help"),on_click:function(){window.open("https://galaxyproject.org/learn/visualization/phylogenetic-tree/")}}],{tooltip_config:{placement:"bottom"}});r("#panelHeaderRightBtns").append(e.$el)},initNavBtns:function(){var t=this,e=g.default.create_icon_buttons_menu([{icon_class:"zoom-in",title:(0,l.default)("Zoom in"),on_click:function(){t.phylovizView.zoomAndPan({zoom:"+"})}},{icon_class:"zoom-out",title:(0,l.default)("Zoom out"),on_click:function(){t.phylovizView.zoomAndPan({zoom:"-"})}},{icon_class:"arrow-circle",title:"Reset Zoom/Pan",on_click:function(){t.phylovizView.zoomAndPan({zoom:"reset"})}}],{tooltip_config:{placement:"bottom"}});r("#phyloVizNavBtns").append(e.$el)}}),k=m.extend({className:"Settings",initialize:function(t){var e=this;e.phyloTree=t.phyloTree,e.el=r("#SettingsMenu"),e.inputs={separation:r("#phyloVizTreeSeparation"),leafHeight:r("#phyloVizTreeLeafHeight"),fontSize:r("#phyloVizTreeFontSize")},r("#settingsCloseBtn").off().on("click",function(){e.el.hide()}),r("#phylovizResetSettingsBtn").off().on("click",function(){e.resetToDefaults()}),r("#phylovizApplySettingsBtn").off().on("click",function(){e.apply()})},apply:function(){var t=this;t.isAcceptableValue(t.inputs.separation,50,2500)&&t.isAcceptableValue(t.inputs.leafHeight,5,30)&&t.isAcceptableValue(t.inputs.fontSize,5,20)&&r.each(t.inputs,function(e,n){t.phyloTree.set(e,n.val())})},updateUI:function(){var t=this;r.each(t.inputs,function(e,n){n.val(t.phyloTree.get(e))})},resetToDefaults:function(){r(".tooltip").remove();var t=this;r.each(t.phyloTree.defaults,function(e,n){t.phyloTree.set(e,n)}),t.updateUI()},render:function(){}}),M=m.extend({className:"Settings",initialize:function(t){var e=this;e.el=r("#nodeSelectionView"),e.phyloTree=t.phyloTree,e.UI={enableEdit:r("#phylovizEditNodesCheck"),saveChanges:r("#phylovizNodeSaveChanges"),cancelChanges:r("#phylovizNodeCancelChanges"),name:r("#phyloVizSelectedNodeName"),dist:r("#phyloVizSelectedNodeDist"),annotation:r("#phyloVizSelectedNodeAnnotation")},e.valuesOfConcern={name:null,dist:null,annotation:null},r("#nodeSelCloseBtn").off().on("click",function(){e.el.hide()}),e.UI.saveChanges.off().on("click",function(){e.updateNodes()}),e.UI.cancelChanges.off().on("click",function(){e.cancelChanges()}),function(t){t.fn.enable=function(e){return t(this).each(function(){e?t(this).removeAttr("disabled"):t(this).attr("disabled","disabled")})}}(i),e.UI.enableEdit.off().on("click",function(){e.toggleUI()})},toggleUI:function(){var t=this,e=t.UI.enableEdit.is(":checked");e||t.cancelChanges(),r.each(t.valuesOfConcern,function(n,i){t.UI[n].enable(e)}),e?(t.UI.saveChanges.show(),t.UI.cancelChanges.show()):(t.UI.saveChanges.hide(),t.UI.cancelChanges.hide())},cancelChanges:function(){var t=this,e=t.phyloTree.get("selectedNode");e&&r.each(t.valuesOfConcern,function(n,i){t.UI[n].val(e[n])})},updateNodes:function(){var t=this,e=t.phyloTree.get("selectedNode");if(e){if(!t.isAcceptableValue(t.UI.dist,0,1)||t.hasIllegalJsonCharacters(t.UI.name)||t.hasIllegalJsonCharacters(t.UI.annotation))return;r.each(t.valuesOfConcern,function(n,i){e[n]=t.UI[n].val()}),t.phyloTree.set("nodeAttrChangedTime",new Date)}else alert("No node selected")}}),C=m.extend({initialize:function(){var t=this;r("#phyloVizSearchBtn").on("click",function(){var e=r("#phyloVizSearchTerm"),n=r("#phyloVizSearchCondition").val().split("-"),i=n[0],a=n[1];t.hasIllegalJsonCharacters(e),"dist"===i&&t.isAcceptableValue(e,0,1),t.searchTree(i,a,e.val())})},searchTree:function(t,e,n){d.selectAll("g.node").classed("searchHighlight",function(i){var r=i[t];if(void 0!==r&&null!==r)if("dist"===t)switch(e){case"greaterEqual":return r>=+n;case"lesserEqual":return r<=+n;default:return}else if("name"===t||"annotation"===t)return-1!==r.toLowerCase().indexOf(n.toLowerCase())})}});e.default={PhylovizView:w}}).call(e,n(2),n(0),n(0))},function(t,e,n){"use strict";(function(t,i){function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(1),c=r(l),d=n(192),u=r(d),h=n(18),f=(a(h),n(15)),p=a(f),_=n(62),g=a(_),m=n(54),v=a(m),y=n(14),b=a(y),w=n(33),x=a(w),k=n(31),M=a(k),C=t.Model.extend({defaults:{inputs:null,values:null}}),S=t.Model.extend({defaults:{tool:null,tree_data:null},initialize:function(t){var e=this;this.get("tool").get("inputs").each(function(t){t.on("change:min change:max change:num_samples",function(t){t.get("in_ptree")&&e.set_tree_data()},e),t.on("change:in_ptree",function(t){t.get("in_ptree")?e.add_param(t):e.remove_param(t),e.set_tree_data()},e)}),t.config&&c.each(t.config,function(t){var n=e.get("tool").get("inputs").find(function(e){return e.get("name")===t.name});e.add_param(n),n.set(t)})},add_param:function(t){t.get("ptree_index")||(t.set("in_ptree",!0),t.set("ptree_index",this.get_tree_params().length))},remove_param:function(t){t.set("in_ptree",!1),t.set("ptree_index",null),c(this.get_tree_params()).each(function(t,e){t.set("ptree_index",e+1)})},set_tree_data:function(){var t=c.map(this.get_tree_params(),function(t){return{param:t,samples:t.get_samples()}}),e=0;this.set("tree_data",{name:"Root",id:e++,children:0!==t.length?function t(n,i){var r=n[i],a=r.param,o=(a.get("label"),r.samples);return n.length-1===i?c.map(o,function(t){return{id:e++,name:t,param:a,value:t}}):c.map(o,function(r){return{id:e++,name:r,param:a,value:r,children:t(n,i+1)}})}(t,0):null})},get_tree_params:function(){return c(this.get("tool").get("inputs").where({in_ptree:!0})).sortBy(function(t){return t.get("ptree_index")})},get_num_leaves:function(){return this.get_tree_params().reduce(function(t,e){return t*e.get_samples().length},1)},get_node_settings:function(t){var e=this.get("tool").get_inputs_dict(),n=t.parent;if(n)for(;0!==n.depth;)e[n.param.get("name")]=n.value,n=n.parent;var i=this,r=function t(e,n){return e.param&&(n[e.param.get("name")]=e.value),e.children?c.flatten(c.map(e.children,function(e){return t(e,c.clone(n))})):new C({inputs:i.get("tool").get("inputs"),values:n})}(t,e);return c.isArray(r)||(r=[r]),r},get_connected_nodes:function(t){for(var e=[],n=t.parent;n;)e.push(n),n=n.parent;return c.flatten([e,function t(e){return e.children?c.flatten([e,c.map(e.children,function(e){return t(e)})]):e}(t)])},get_leaf:function(t){for(var e=this.get("tree_data");e.children;)e=function(e){return c.find(e,function(e){return t[e.param.get("name")]===e.value})}(e.children);return e},toJSON:function(){return this.get_tree_params().map(function(t){return{name:t.get("name"),min:t.get("min"),max:t.get("max"),num_samples:t.get("num_samples")}})}}),T=t.Model.extend({defaults:{track:null,mode:"Pack",settings:null,regions:null},initialize:function(t){if(this.set("regions",t.regions),t.track){var e=c.extend({data_url:Galaxy.root+"dummy1",converted_datasets_state_url:Galaxy.root+"dummy2"},t.track);this.set("track",g.default.object_from_template(e,{},null))}},same_settings:function(t){var e=this.get("settings"),n=t.get("settings");for(var i in e)if(!n[i]||e[i]!==n[i])return!1;return!0},toJSON:function(){return{track:this.get("track").to_dict(),settings:this.get("settings"),regions:this.get("regions")}}}),A=t.Collection.extend({model:T}),j=p.default.Visualization.extend({defaults:c.extend({},p.default.Visualization.prototype.defaults,{dataset:null,tool:null,parameter_tree:null,regions:null,tracks:null,default_mode:"Pack"}),initialize:function(t){this.set("dataset",new b.default.Dataset(t.dataset)),this.set("tool",new v.default.Tool(t.tool)),this.set("regions",new p.default.GenomeRegionCollection(t.regions)),this.set("tracks",new A(t.tracks));var e=this.get("tool");this.set("tool_with_samplable_inputs",e),e.remove_inputs(["data","hidden_data","conditional","text"]),this.set("parameter_tree",new S({tool:e,config:t.tree_config}))},add_track:function(t){this.get("tracks").add(t)},toJSON:function(){return{id:this.get("id"),title:"Parameter exploration for dataset '"+this.get("dataset").get("name")+"'",type:"sweepster",dataset_id:this.get("dataset").id,tool_id:this.get("tool").id,regions:this.get("regions").toJSON(),tree_config:this.get("parameter_tree").toJSON(),tracks:this.get("tracks").toJSON()}}}),E=t.View.extend({tagName:"tr",TILE_LEN:250,initialize:function(t){this.canvas_manager=t.canvas_manager,this.render(),this.model.on("change:track change:mode",this.draw_tiles,this)},render:function(){var t=this.model.get("settings"),e=t.get("values"),n=i("").addClass("settings").appendTo(this.$el),r=i("
    ").addClass("track-info").hide().appendTo(n);r.append(i("
    ").css("font-weight","bold").text("Track Settings")),t.get("inputs").each(function(t){r.append(t.get("label")+": "+e[t.get("name")]+"
    ")});var a=this,o=(i("','\'" href="#library/<%- library.get("id") %>/permissions">','','','','" class="fa fa-ban fa-lg">','',"",""].join(""))}});e.default={LibraryRowView:s}}).call(e,n(2),n(0),n(1))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(20),c=a(l),d=n(59),u=a(d),h=t.View.extend({el:"#center",defaults:{search_term:""},events:{"click #create_new_library_btn":"createLibraryFromModal","click #include_deleted_chk":"includeDeletedChecked","click #exclude_restricted_chk":"excludeRestrictedChecked","click .page_size_prompt":"showPageSizePrompt","keyup .library-search-input":"searchLibraries"},initialize:function(t){this.options=i.defaults(this.options||{},t,this.defaults),this.render()},render:function(){var t=this.templateToolBar(),e=!1,n=!0;Galaxy.user&&(e=Galaxy.user.isAdmin(),n=Galaxy.user.isAnonymous()),this.$el.html(t({admin_user:e,anon_user:n})),e&&(this.$el.find("#include_deleted_chk")[0].checked=Galaxy.libraries.preferences.get("with_deleted"),this.$el.find("#exclude_restricted_chk")[0].checked=Galaxy.libraries.preferences.get("without_restricted"))},renderPaginator:function(t){this.options=i.extend(this.options,t);var e=this.templatePaginator();this.$el.find(".library-paginator").html(e({show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_libraries_count:this.options.total_libraries_count,libraries_shown:this.options.libraries_shown,library_page_size:Galaxy.libraries.preferences.get("library_page_size")}))},createLibraryFromModal:function(t){t.preventDefault(),t.stopPropagation();var e=this;this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:(0,s.default)("Create New Library"),body:this.templateNewLibraryInModal(),buttons:{Create:function(){e.createNewLibrary()},Close:function(){e.modal.hide()}}})},createNewLibrary:function(){var t=this.serializeNewLibrary();if(this.validateNewLibrary(t)){var e=new u.default.Library,n=this;e.save(t,{success:function(t){Galaxy.libraries.libraryListView.collection.add(t),n.modal.hide(),n.clearLibraryModal(),Galaxy.libraries.libraryListView.render(),c.default.success("Library created.")},error:function(t,e){void 0!==e.responseJSON?c.default.error(e.responseJSON.err_msg):c.default.error("An error occured.")}})}else c.default.error("Library's name is missing.");return!1},showPageSizePrompt:function(t){t.preventDefault();var e=prompt("How many libraries per page do you want to see?",Galaxy.libraries.preferences.get("library_page_size"));null!=e&&e==parseInt(e)&&(Galaxy.libraries.preferences.set({library_page_size:parseInt(e)}),Galaxy.libraries.libraryListView.render({show_page:1}))},clearLibraryModal:function(){r("input[name='Name']").val(""),r("input[name='Description']").val(""),r("input[name='Synopsis']").val("")},serializeNewLibrary:function(){return{name:r("input[name='Name']").val(),description:r("input[name='Description']").val(),synopsis:r("input[name='Synopsis']").val()}},validateNewLibrary:function(t){return""!==t.name},includeDeletedChecked:function(t){t.target.checked?(Galaxy.libraries.preferences.set({with_deleted:!0}),Galaxy.libraries.libraryListView.fetchDeleted()):(Galaxy.libraries.preferences.set({with_deleted:!1}),Galaxy.libraries.libraryListView.render())},excludeRestrictedChecked:function(t){t.target.checked?Galaxy.libraries.preferences.set({without_restricted:!0}):Galaxy.libraries.preferences.set({without_restricted:!1}),Galaxy.libraries.libraryListView.render()},searchLibraries:function(t){var e=r(".library-search-input").val();this.options.search_term=e,Galaxy.libraries.libraryListView.searchLibraries(e)},templateToolBar:function(){return i.template(['
    ','
    ','DATA LIBRARIES','
    ','
    ','',"<% if(admin_user === true) { %>",'
    ','','',"
    ",'
    ','','',"
    ",'',"<% } %>","
    ",'','',"","
    ",'
    ',"
    "].join(""))},templatePaginator:function(){return i.template(['",'',' <%- libraries_shown %> libraries shown (change)',"",''," <%- total_libraries_count %> total",""].join(""))},templateNewLibraryInModal:function(){return i.template(['
    ',"
    ",'','','',"
    ","
    "].join(""))}});e.default={LibraryToolbarView:h}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r,a){function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var s=n(3),l=o(s),c=n(5),d=o(c),u=n(20),h=o(u),f=n(59),p=o(f),_=n(39),g=o(_),m=n(85),v=o(m),y=n(190),b=o(y),w=n(191),x=o(w),k=n(153),M=o(k);n(412);var C=t.View.extend({el:"#center",events:{"click .toolbtn-create-folder":"createFolderFromModal","click .toolbtn-bulk-import":"importToHistoryModal","click .include-deleted-datasets-chk":"checkIncludeDeleted","click .toolbtn-bulk-delete":"deleteSelectedItems","click .toolbtn-show-locinfo":"showLocInfo","click .page-size-prompt":"showPageSizePrompt","click .toolbtn-collection-import":"showCollectionSelect"},defaults:{can_add_library_item:!1,contains_file_or_folder:!1,chain_call_control:{total_number:0,failed_number:0},disabled_jstree_element:"folders"},modal:null,jstree:null,histories:null,select_genome:null,select_extension:null,list_extensions:[],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_genomes:[],initialize:function(t){this.options=i.defaults(t||{},this.defaults),this.fetchExtAndGenomes(),this.render()},render:function(t){this.options=i.extend(this.options,t);var e=this.templateToolBar(),n={id:this.options.id,is_admin:!1,is_anonym:!0,multiple_add_dataset_options:!1};Galaxy.user&&(n.is_admin=Galaxy.user.isAdmin(),n.is_anonym=Galaxy.user.isAnonymous(),null===Galaxy.config.user_library_import_dir&&!1===Galaxy.config.allow_library_path_paste&&null===Galaxy.config.library_import_dir||(n.multiple_add_dataset_options=!0)),this.$el.html(e(n))},renderPaginator:function(t){this.options=i.extend(this.options,t);var e=this.templatePaginator();r("body").find(".folder-paginator").html(e({id:this.options.id,show_page:parseInt(this.options.show_page),page_count:parseInt(this.options.page_count),total_items_count:this.options.total_items_count,items_shown:this.options.items_shown,folder_page_size:Galaxy.libraries.preferences.get("folder_page_size")}))},configureElements:function(t){this.options=i.extend(this.options,t),!0===this.options.can_add_library_item?r(".add-library-items").show():r(".add-library-items").hide(),!0===this.options.contains_file_or_folder&&Galaxy.user?Galaxy.user.isAnonymous()?(r(".dataset-manipulation").show(),r(".logged-dataset-manipulation").hide()):(r(".logged-dataset-manipulation").show(),r(".dataset-manipulation").show()):(r(".logged-dataset-manipulation").hide(),r(".dataset-manipulation").hide()),this.$el.find('[data-toggle="tooltip"]').tooltip({trigger:"hover"})},createFolderFromModal:function(t){var e=this;t.preventDefault(),t.stopPropagation();var n=this.templateNewFolderInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:(0,l.default)("Create New Folder"),body:n(),buttons:{Create:function(){e.createNewFolderEvent()},Close:function(){Galaxy.modal.hide()}}})},createNewFolderEvent:function(){var e=this.serializeNewFolder();if(this.validateNewFolder(e)){var n,i=new p.default.FolderAsModel,r=t.history.fragment.split("/");n=r.indexOf("page")>-1?r[r.length-3]:r[r.length-1],i.url=i.urlRoot+n,i.save(e,{success:function(t){Galaxy.modal.hide(),h.default.success("Folder created."),t.set({type:"folder"}),Galaxy.libraries.folderListView.collection.add(t)},error:function(t,e){Galaxy.modal.hide(),void 0!==e.responseJSON?h.default.error(e.responseJSON.err_msg):h.default.error("An error occurred.")}})}else h.default.error("Folder's name is missing.");return!1},serializeNewFolder:function(){return{name:r("input[name='Name']").val(),description:r("input[name='Description']").val()}},validateNewFolder:function(t){return""!==t.name},importToHistoryModal:function(t){var e=this;t.preventDefault();var n=this.findCheckedRows(),i=this.templateImportIntoHistoryModal();if(0===n.length)h.default.info("You must select some datasets first.");else{this.fetchUserHistories().done(function(){e.modal=Galaxy.modal,e.modal.show({closing_events:!0,title:(0,l.default)("Import into History"),body:i({histories:e.histories.models}),buttons:{Import:function(){e.importAllIntoHistory()},Close:function(){Galaxy.modal.hide()}}})}).fail(function(t,e){void 0!==e.responseJSON?h.default.error(e.responseJSON.err_msg):h.default.error("An error occurred.")})}},fetchUserHistories:function(){return this.histories=new p.default.GalaxyHistories,this.histories.fetch()},importAllIntoHistory:function(){var t=this;this.modal.disableButton("Import");var e=this.modal.$("input[name=history_name]").val();if(""!==e)this.createNewHistory(e).done(function(e){t.processImportToHistory(e.id,e.name)}).fail(function(t,e,n){h.default.error("An error occurred.")}).always(function(){t.modal.enableButton("Import")});else{var n=r("select[name=import_to_history] option:selected").val(),i=r("select[name=import_to_history] option:selected").text();this.processImportToHistory(n,i),this.modal.enableButton("Import")}},createNewHistory:function(t){return r.post(Galaxy.root+"api/histories",{name:t})},processImportToHistory:function(t,e){for(var n=this.findCheckedItems(),i=[],r=n.dataset_ids.length-1;r>=0;r--){var o=n.dataset_ids[r],s=new p.default.HistoryItem;s.url=s.urlRoot+t+"/contents",s.content=o,s.source="library",i.push(s)}for(var l=n.folder_ids.length-1;l>=0;l--){var c=n.folder_ids[l],s=new p.default.HistoryItem;s.url=s.urlRoot+t+"/contents",s.content=c,s.source="library_folder",i.push(s)}this.initChainCallControl({length:i.length,action:"to_history",history_name:e}),a.getJSON(Galaxy.root+"history/set_as_current?id="+t),this.chainCallImportingIntoHistory(i,e)},updateProgress:function(){this.progress+=this.progressStep,r(".progress-bar-import").width(Math.round(this.progress)+"%");var t=Math.round(this.progress)+"% Complete";r(".completion_span").text(t)},download:function(t){var e=this.findCheckedItems(),n=Galaxy.root+"api/libraries/datasets/download/"+t,i={ld_ids:e.dataset_ids,folder_ids:e.folder_ids};this.processDownload(n,i,"get")},processDownload:function(t,e,n){if(t&&e){e="string"==typeof e?e:r.param(e);var i="";r.each(e.split("&"),function(){var t=this.split("=");i+=''}),r('
    '+i+"
    ").appendTo("body").submit().remove(),h.default.info("Your download will begin soon.")}else h.default.error("An error occurred.")},addFilesFromHistoryModal:function(){var t=this;this.histories=new p.default.GalaxyHistories,this.histories.fetch().done(function(){t.modal=Galaxy.modal;var e=t.templateAddFilesFromHistory();t.modal.show({closing_events:!0,title:(0,l.default)("Adding datasets from your history"),body:e({histories:t.histories.models}),buttons:{Add:function(){t.addAllDatasetsFromHistory()},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+t.id,{trigger:!0})}}),t.fetchAndDisplayHistoryContents(t.histories.models[0].id),r("#dataset_add_bulk").change(function(e){t.fetchAndDisplayHistoryContents(e.target.value)})}).fail(function(t,e){void 0!==e.responseJSON?h.default.error(e.responseJSON.err_msg):h.default.error("An error occurred.")})},importFilesFromPathModal:function(){var t=this;this.modal=Galaxy.modal;var e=this.templateImportPathModal();this.modal.show({closing_events:!0,title:(0,l.default)("Please enter paths to import"),body:e({}),buttons:{Import:function(){t.importFromPathsClicked(t)},Close:function(){Galaxy.modal.hide()}},closing_callback:function(){Galaxy.libraries.library_router.navigate("folders/"+t.id,{trigger:!0})}}),this.renderSelectBoxes()},fetchExtAndGenomes:function(){var t=this;d.default.get({url:Galaxy.root+"api/datatypes?extension_only=False",success:function(e){t.list_extensions=[];for(var n in e)t.list_extensions.push({id:e[n].extension,text:e[n].extension,description:e[n].description,description_url:e[n].description_url});t.list_extensions.sort(function(t,e){return t.id>e.id?1:t.ide.id?1:t.id=0;d--){var u=l[d].trim();0!==u.length&&c.push(u)}this.initChainCallControl({length:c.length,action:"adding_datasets"}),this.chainCallImportingFolders({paths:c,preserve_dirs:t,link_data:e,space_to_tab:n,to_posix_lines:i,source:"admin_path",file_type:o,tag_using_filenames:a,dbkey:s})}else h.default.info("Please enter a path relative to Galaxy root.")},initChainCallControl:function(t){var e;switch(t.action){case"adding_datasets":e=this.templateAddingDatasetsProgressBar(),this.modal.$el.find(".modal-body").html(e({folder_name:this.options.folder_name}));break;case"deleting_datasets":e=this.templateDeletingItemsProgressBar(),this.modal.$el.find(".modal-body").html(e());break;case"to_history":e=this.templateImportIntoHistoryProgressBar(),this.modal.$el.find(".modal-body").html(e({history_name:t.history_name}));break;default:Galaxy.emit.error("Wrong action specified.","datalibs")}this.progress=0,this.progressStep=100/t.length,this.options.chain_call_control.total_number=t.length,this.options.chain_call_control.failed_number=0},importFromJstreePath:function(t,e){var n=r("#jstree_browser").jstree().get_selected(!0),a=i.filter(n,function(t){return 0==t.state.disabled}),o=this.modal.$el.find(".preserve-checkbox").is(":checked"),s=this.modal.$el.find(".link-checkbox").is(":checked"),l=this.modal.$el.find(".spacetab-checkbox").is(":checked"),c=this.modal.$el.find(".posix-checkbox").is(":checked"),d=this.select_extension.value(),u=this.select_genome.value(),f=this.modal.$el.find(".tag-files").is(":checked"),p=a[0].type,_=[];if(a.length<1)h.default.info("Please select some items first.");else{this.modal.disableButton("Import");for(var g=a.length-1;g>=0;g--)void 0!==a[g].li_attr.full_path&&_.push(a[g].li_attr.full_path);if(this.initChainCallControl({length:_.length,action:"adding_datasets"}),"folder"===p){var m=e.source+"_folder";this.chainCallImportingFolders({paths:_,preserve_dirs:o,link_data:s,space_to_tab:l,to_posix_lines:c,source:m,file_type:d,dbkey:u,tag_using_filenames:f})}else if("file"===p){var m=e.source+"_file";this.chainCallImportingUserdirFiles({paths:_,file_type:d,dbkey:u,link_data:s,space_to_tab:l,to_posix_lines:c,source:m,tag_using_filenames:f})}}},fetchAndDisplayHistoryContents:function(t){var e=this;new p.default.HistoryContents({id:t}).fetch({success:function(n){var i=e.templateHistoryContents();e.histories.get(t).set({contents:n}),e.modal.$el.find(".library_selected_history_content").html(i({history_contents:n.models.reverse()})),e.modal.$el.find(".history-import-select-all").bind("click",function(){r(".library_selected_history_content [type=checkbox]").prop("checked",!0)}),e.modal.$el.find(".history-import-unselect-all").bind("click",function(){r(".library_selected_history_content [type=checkbox]").prop("checked",!1)})},error:function(t,e){void 0!==e.responseJSON?h.default.error(e.responseJSON.err_msg):h.default.error("An error occurred.")}})},addAllDatasetsFromHistory:function(){var t=this.modal.$el.find(".library_selected_history_content").find(":checked"),e=[],n=[],i=[];if(t.length<1)h.default.info("You must select some datasets first.");else{this.modal.disableButton("Add"),t.each(function(){var t=r(this).closest("li").data("id");if(t){var i=r(this).closest("li").data("name");e.push(t),n.push(i)}});for(var a=e.length-1;a>=0;a--){var o=e[a],s=new p.default.Item;s.url=Galaxy.root+"api/folders/"+this.options.id+"/contents","collection"===n[a]?s.set({from_hdca_id:o}):s.set({from_hda_id:o}),i.push(s)}this.initChainCallControl({length:i.length,action:"adding_datasets"}),this.chainCallAddingHdas(i)}},chainCallImportingIntoHistory:function(t,e){var n=this,i=t.pop();if(void 0===i)return 0===this.options.chain_call_control.failed_number?h.default.success("Selected datasets imported into history. Click this to start analyzing it.","",{onclick:function(){window.location=Galaxy.root}}):this.options.chain_call_control.failed_number===this.options.chain_call_control.total_number?h.default.error("There was an error and no datasets were imported into history."):this.options.chain_call_control.failed_number=0;s--){var c=new p.default.Item({id:t[s]});o.push(c)}for(var d=e.length-1;d>=0;d--){var u=new p.default.FolderAsModel({id:e[d]});o.push(u)}this.options.chain_call_control.total_number=a,this.chainCallDeletingItems(o)}},showLocInfo:function(){var t=this,e=null;null!==Galaxy.libraries.libraryListView?(e=Galaxy.libraries.libraryListView.collection.get(this.options.parent_library_id),this.showLocInfoModal(e)):(e=new p.default.Library({id:this.options.parent_library_id}),e.fetch({success:function(){t.showLocInfoModal(e)},error:function(t,e){void 0!==e.responseJSON?h.default.error(e.responseJSON.err_msg):h.default.error("An error occurred.")}}))},showLocInfoModal:function(t){var e=this.templateLocInfoInModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:(0,l.default)("Location Details"),body:e({library:t,options:this.options}),buttons:{Close:function(){Galaxy.modal.hide()}}})},showImportModal:function(t){switch(t.source){case"history":this.addFilesFromHistoryModal();break;case"importdir":this.importFilesFromGalaxyFolderModal({source:"importdir"});break;case"path":this.importFilesFromPathModal();break;case"userdir":this.importFilesFromGalaxyFolderModal({source:"userdir"});break;default:Galaxy.libraries.library_router.back(),h.default.error("Invalid import source.")}},showPageSizePrompt:function(t){t.preventDefault();var e=prompt("How many items per page do you want to see?",Galaxy.libraries.preferences.get("folder_page_size"));null!=e&&e==parseInt(e)&&(Galaxy.libraries.preferences.set({folder_page_size:parseInt(e)}),Galaxy.libraries.folderListView.render({id:this.options.id,show_page:1}))},findCheckedRows:function(){return r("#folder_list_body").find(":checked")},findCheckedItems:function(){var t=[],e=[];return this.findCheckedRows().each(function(){var n=r(this).closest("tr").data("id").toString();"F"==n.substring(0,1)?t.push(n):e.push(n)}),{folder_ids:t,dataset_ids:e}},showCollectionSelect:function(t){var e=this;t.preventDefault();var n=this.findCheckedItems(),i=this.templateCollectionSelectModal();this.modal=Galaxy.modal,this.modal.show({closing_events:!0,title:"Create History Collection from Datasets",body:i({selected_datasets:n.dataset_ids.length}),buttons:{Continue:function(){e.showColectionBuilder(n.dataset_ids)},Close:function(){Galaxy.modal.hide()}}}),this.prepareCollectionTypeSelect(),this.prepareHistoryTypeSelect()},prepareCollectionTypeSelect:function(){var t=this;this.collectionType="list",this.select_collection_type=new g.default.View({css:"library-collection-type-select",container:this.modal.$el.find(".library-collection-type-select"),data:[{id:"list",text:"List"},{id:"paired",text:"Paired"},{id:"list:paired",text:"List of Pairs"},{id:"rules",text:"From Rules"}],value:"list",onchange:function(e){t.updateCollectionType(e)}})},prepareHistoryTypeSelect:function(){var t=this;this.fetchUserHistories().done(function(){for(var e=[],n=t.histories.length-1;n>=0;n--)e.unshift({id:t.histories.models[n].id,text:t.histories.models[n].get("name")});t.select_collection_history=new g.default.View({css:"library-collection-history-select",container:t.modal.$el.find(".library-collection-history-select"),data:e,value:e[0].id})})},updateCollectionType:function(t){this.collectionType=t},showColectionBuilder:function(e){var n=this,i=[],r=this.modal.$('input[type="radio"]:checked').val();if("selection"===r)for(var a=e.length-1;a>=0;a--){var o={},s=Galaxy.libraries.folderListView.folder_container.get("folder").get(e[a]);o.id=e[a],o.name=s.get("name"),o.deleted=s.get("deleted"),o.state=s.get("state"),i.push(o)}else"folder"===r&&(i=new t.Collection(Galaxy.libraries.folderListView.folder_container.get("folder").where({type:"file"})).toJSON());var l=this.modal.$("input[name=history_name]").val();if(""!==l)this.createNewHistory(l).done(function(t){h.default.success("History created"),n.collectionImport(i,t.id,t.name)}).fail(function(t,e,n){h.default.error("An error occurred.")});else{var c=this.select_collection_history.value(),d=this.select_collection_history.text();this.collectionImport(i,c,d)}},collectionImport:function(t,e,n){var i=this,r="Creating Collection in "+n,a=void 0,o=void 0;if("list"===this.collectionType)a=v.default.ListCollectionCreator,o=function(t,n,r){return t=t.map(function(t){return{id:t.id,name:t.name,src:"ldda"}}),i.createHDCA(t,i.collectionType,n,r,e)},v.default.collectionCreatorModal(t,{creationFn:o,title:r,defaultHideSourceItems:!0},a);else if("paired"===this.collectionType)a=b.default.PairCollectionCreator,o=function(t,n,r){return t=[{name:"forward",src:"ldda",id:t[0].id},{name:"reverse",src:"ldda",id:t[1].id}],i.createHDCA(t,i.collectionType,n,r,e)},v.default.collectionCreatorModal(t,{creationFn:o,title:r,defaultHideSourceItems:!0},a);else if("list:paired"===this.collectionType){var s=t.map(function(t){return{id:t.id,name:t.name,src:"ldda"}});x.default.pairedCollectionCreatorModal(s,{historyId:e,title:r,defaultHideSourceItems:!0})}else if("rules"===this.collectionType){var l=function(t,n,r,a){return i.createHDCA(t,n,r,a,e)};v.default.ruleBasedCollectionCreatorModal(t,"library_datasets","collections",{creationFn:l,defaultHideSourceItems:!0})}},createHDCA:function(t,e,n,i,r,a){return new M.default.HistoryDatasetCollection({history_content_type:"dataset_collection",collection_type:e,history_id:r,name:n,hide_source_items:i||!1,element_identifiers:t}).save(a)},templateToolBar:function(){return i.template(['
    ','
    ','DATA LIBRARIES',"
    ",'
    ','",'","<% if(multiple_add_dataset_options) { %>",'","<% } else { %>",'","<% } %>",'",'",'",'','","",'','','","","","
    ","
    ","
    ",'
    ','
    ',"
    "].join(""))},templateLocInfoInModal:function(){return i.template(["
    ",'',"",'',"","","","","",'',"",'<% if(library.get("description") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("synopsis") !== "") { %>',"","",'',"","<% } %>",'<% if(library.get("create_time_pretty") !== "") { %>',"","",'',"","<% } %>","","",'',"","","
    library
    name<%- library.get("name") %>
    description<%- library.get("description") %>
    synopsis<%- library.get("synopsis") %>
    created"><%- library.get("create_time_pretty") %>
    id<%- library.get("id") %>
    ",'',"",'',"","","","","","","",'<% if(options.folder_description !== "") { %>',"","","","","<% } %>","","","","","","
    folder
    name<%- options.folder_name %>
    description<%- options.folder_description %>
    id<%- options.id %>
    ","
    "].join(""))},templateNewFolderInModal:function(){return i.template(['
    ',"
    ",'','',"
    ","
    "].join(""))},templateImportIntoHistoryModal:function(){return i.template(["
    ",'
    ',"Select history: ",'","
    ",'
    ',"or create new: ",'',"
    ","
    "].join(""))},templateImportIntoHistoryProgressBar:function(){return i.template(['
    ',"Importing selected items to history <%= _.escape(history_name) %>","
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateAddingDatasetsProgressBar:function(){return i.template(['
    ',"Adding selected datasets to library folder <%= _.escape(folder_name) %>","
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateDeletingItemsProgressBar:function(){return i.template(['
    ',"
    ",'
    ','
    ','0% Complete',"
    ","
    "].join(""))},templateBrowserModal:function(){return i.template(['
    ','
    ','",'","
    ",'
    All files you select will be imported into the current folder ignoring their folder structure.
    ','','
    ','",'",'",'","
    ",'",'","
    ",'
    ',"
    ","
    ","

    You can set extension type and genome for all imported datasets at once:

    ","
    ",'Type: ','Genome: ',"
    ","
    ","
    ",'","
    ","
    "].join(""))},templateImportPathModal:function(){return i.template(['
    ','
    All files within the given folders and their subfolders will be imported into the current folder.
    ','
    ','",'","
    ",'",'","
    ",'',"
    ","

    You can set extension type and genome for all imported datasets at once:

    ","
    ",'Type: ','Genome: ',"
    ","
    ",'","
    ","
    "].join(""))},templateAddFilesFromHistory:function(){return i.template(['
    ',"
    ","1. Select history: ",'","
    ","
    ",'
    ',"
    ","
    "].join(""))},templateHistoryContents:function(){return i.template(["

    2. Choose the datasets to import:

    ","
    ",'",'","
    ","
    ","
      ","<% _.each(history_contents, function(history_item) { %>",'<% if (history_item.get("deleted") != true ) { %>','<% var item_name = history_item.get("name") %>','<% if (history_item.get("type") === "collection") { %>','<% var collection_type = history_item.get("collection_type") %>','<% if (collection_type === "list") { %>','
    • " data-name="<%= _.escape(history_item.get("type")) %>">',"
    • ","<% } else { %>",'
    • ','','<%= _.escape(history_item.get("hid")) %>: ','<%= item_name.length > 75 ? _.escape("...".concat(item_name.substr(-75))) : _.escape(item_name) %> (Dataset Collection of type <%= _.escape(collection_type) %> not supported.)',"","
    • ","<% } %>",'<% } else if (history_item.get("visible") === true && history_item.get("state") === "ok") { %>','
    • " data-name="<%= _.escape(history_item.get("type")) %>">','","
    • ","<% } %>","<% } %>","<% }); %>","
    "].join(""))},templatePaginator:function(){return i.template(['",'',' <%- items_shown %> items shown (change)',"",''," <%- total_items_count %> total",""].join(""))},templateCollectionSelectModal:function(){return i.template(["
    ",'
    ',"

    Which datasets?

    ",'
    ','",'","
    ","
    ",'
    ',"

    Collection type

    ",'',"
    Which type to choose?
    ","
      ","
    • ","List: Generic collection which groups any number of datasets into a set; similar to file system folder.","
    • ","
    • ","Paired: Simple collection containing exactly two sequence datasets; one reverse and the other forward.","
    • ","
    • ","List of Pairs: Advanced collection containing any number of Pairs; imagine as Pair-type collections inside of a List-type collection.","
    • ","
    • ","From Rules: Use Galaxy's rule builder to describe collections. This is more of an advanced feature that allows building any number of collections or any type.","
    • ","
    ","
    ",'
    ',"

    Select history

    ",''," or create new: ",'',"
    ","
    "].join(""))}});e.default={FolderToolbarView:C}}).call(e,n(2),n(1),n(0),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(20),s=a(o),l=n(59),c=a(l),d=n(39),u=a(d),h=t.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(t){this.options=i.extend(this.options,t),this.options.id&&this.fetchLibrary()},fetchLibrary:function(t){this.options=i.extend(this.options,t),this.model=new c.default.Library({id:this.options.id});var e=this;this.model.fetch({success:function(){e.options.show_permissions&&e.showPermissions()},error:function(t,e){void 0!==e.responseJSON?s.default.error(e.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):s.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(t){this.options=i.extend(this.options,t),r(".tooltip").remove(),void 0!==this.options.fetched_permissions&&(0===this.options.fetched_permissions.access_library_role_list.length?this.model.set({is_unrestricted:!0}):this.model.set({is_unrestricted:!1}));var e=!1;Galaxy.user&&(e=Galaxy.user.isAdmin());var n=this.templateLibraryPermissions();this.$el.html(n({library:this.model,is_admin:e}));var a=this;r.get(Galaxy.root+"api/libraries/"+a.id+"/permissions?scope=current").done(function(t){a.prepareSelectBoxes({fetched_permissions:t})}).fail(function(){s.default.error("An error occurred while attempting to fetch library permissions.")}),r('#center [data-toggle="tooltip"]').tooltip({trigger:"hover"}),r("#center").css("overflow","auto")},_serializeRoles:function(t){for(var e=[],n=0;n=0;n--)e.push(t[n].id);return e},savePermissions:function(t){var e=this,n=this._extractIds(this.accessSelectObject.$el.select2("data")),i=this._extractIds(this.addSelectObject.$el.select2("data")),a=this._extractIds(this.manageSelectObject.$el.select2("data")),o=this._extractIds(this.modifySelectObject.$el.select2("data"));r.post(Galaxy.root+"api/libraries/"+e.id+"/permissions?action=set_permissions",{"access_ids[]":n,"add_ids[]":i,"manage_ids[]":a,"modify_ids[]":o}).done(function(t){e.showPermissions({fetched_permissions:t}),s.default.success("Permissions saved.")}).fail(function(){s.default.error("An error occurred while attempting to set library permissions.")})},templateLibraryPermissions:function(){return i.template(['
    ',"","

    ",'Library: <%= _.escape(library.get("name")) %>',"

    ",'
    ',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any library on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
    ",'
    ',"

    Library permissions

    ","

    Roles that can access the library

    ",'
    ','
    ',"User with any of these roles can access this library. If there are no access roles set on the library it is considered unrestricted.","
    ","

    Roles that can manage permissions on this library

    ",'
    ','
    ',"User with any of these roles can manage permissions on this library (includes giving access).","
    ","

    Roles that can add items to this library

    ",'
    ','
    ',"User with any of these roles can add items to this library (folders and datasets).","
    ","

    Roles that can modify this library

    ",'
    ','
    ',"User with any of these roles can modify this library (name, synopsis, etc.).","
    ",'","
    ","
    "].join(""))}});e.default={LibraryView:h}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(20),s=a(o),l=n(59),c=a(l),d=n(39),u=a(d),h=t.View.extend({el:"#center",model:null,options:{},events:{"click .toolbtn_save_permissions":"savePermissions"},initialize:function(t){this.options=i.extend(this.options,t),this.options.id&&this.fetchFolder()},fetchFolder:function(t){this.options=i.extend(this.options,t),this.model=new c.default.FolderAsModel({id:this.options.id});var e=this;this.model.fetch({success:function(){e.options.show_permissions&&e.showPermissions()},error:function(t,e){void 0!==e.responseJSON?s.default.error(e.responseJSON.err_msg+" Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}}):s.default.error("An error occurred. Click this to go back.","",{onclick:function(){Galaxy.libraries.library_router.back()}})}})},showPermissions:function(t){this.options=i.extend(this.options,t),r(".tooltip").remove();var e=!1;Galaxy.user&&(e=Galaxy.user.isAdmin());var n=this.templateFolderPermissions();this.$el.html(n({folder:this.model,is_admin:e}));var a=this;r.get(Galaxy.root+"api/folders/"+a.id+"/permissions?scope=current").done(function(t){a.prepareSelectBoxes({fetched_permissions:t})}).fail(function(){s.default.error("An error occurred while attempting to fetch folder permissions.")}),r('#center [data-toggle="tooltip"]').tooltip({trigger:"hover"}),r("#center").css("overflow","auto")},_serializeRoles:function(t){for(var e=[],n=0;n=0;n--)e.push(t[n].id);return e},savePermissions:function(t){var e=this,n=this._extractIds(this.addSelectObject.$el.select2("data")),i=this._extractIds(this.manageSelectObject.$el.select2("data")),a=this._extractIds(this.modifySelectObject.$el.select2("data"));r.post(Galaxy.root+"api/folders/"+e.id+"/permissions?action=set_permissions",{"add_ids[]":n,"manage_ids[]":i,"modify_ids[]":a}).done(function(t){e.showPermissions({fetched_permissions:t}),s.default.success("Permissions saved.")}).fail(function(){s.default.error("An error occurred while attempting to set folder permissions.")})},templateFolderPermissions:function(){return i.template(['
    ',"","

    ",'Folder: <%= _.escape(folder.get("name")) %>',"

    ",'
    ',"<% if (is_admin) { %>","You are logged in as an administrator therefore you can manage any folder on this Galaxy instance. Please make sure you understand the consequences.","<% } else { %>","You can assign any number of roles to any of the following permission types. However please read carefully the implications of such actions.","<% }%>","
    ",'
    ',"

    Folder permissions

    ","

    ","Roles that can manage permissions on this folder","

    ",'
    ','
    ',"User with any of these roles can manage permissions on this folder.","
    ","

    ","Roles that can add items to this folder","

    ",'
    ','
    ',"User with any of these roles can add items to this folder (folders and datasets).","
    ","

    ","Roles that can modify this folder","

    ",'
    ','
    ',"User with any of these roles can modify this folder (name, etc.).","
    ",'","
    ","
    "].join(""))}});e.default={FolderView:h}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t){function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=n(739),a=i(r),o=n(740),s=i(o),l=n(741),c=i(l),d=n(742),u=i(d),h=n(743),f=i(h),p=n(744),_=i(p),g=n(745),m=i(g),v=t.Router.extend({initialize:function(){this.routesHit=0,t.history.on("route",function(){this.routesHit++},this),this.bind("route",this.trackPageview)},routes:{"":"toolsheds",sheds:"toolsheds",queue:"queue",workflows:"workflows","status/r/:repositories":"status",status:"status","categories/s/:tool_shed":"categories","category/s/:tool_shed/c/:cateory_id":"repositories","repository/s/:tool_shed/r/:repository_id":"repository"},back:function(){this.routesHit>1?window.history.back():this.navigate("#",{trigger:!0,replace:!0})}}),y=t.View.extend({app_config:{known_views:["toolsheds","queue","status","categories","repositories","repoository"]},initialize:function(){Galaxy.admintoolshedapp=this,this.admin_toolshed_router=new v,this.admin_toolshed_router.on("route:queue",function(){Galaxy.admintoolshedapp.adminRepoQueueView?Galaxy.admintoolshedapp.adminRepoQueueView.reDraw():Galaxy.admintoolshedapp.adminRepoQueueView=new f.default.RepoQueueView}),this.admin_toolshed_router.on("route:toolsheds",function(){Galaxy.admintoolshedapp.adminShedListView?Galaxy.admintoolshedapp.adminShedListView.reDraw():Galaxy.admintoolshedapp.adminShedListView=new a.default.ShedListView}),this.admin_toolshed_router.on("route:categories",function(t){Galaxy.admintoolshedapp.adminShedCategoriesView?Galaxy.admintoolshedapp.adminShedCategoriesView.reDraw({tool_shed:t.replace(/\//g,"%2f")}):Galaxy.admintoolshedapp.adminShedCategoriesView=new s.default.CategoryView({tool_shed:t.replace(/\//g,"%2f")})}),this.admin_toolshed_router.on("route:repositories",function(t,e){Galaxy.admintoolshedapp.adminShedCategoryView?Galaxy.admintoolshedapp.adminShedCategoryView.reDraw({tool_shed:t.replace(/\//g,"%2f"),category_id:e}):Galaxy.admintoolshedapp.adminShedCategoryView=new c.default.Category({tool_shed:t.replace(/\//g,"%2f"),category_id:e})}),this.admin_toolshed_router.on("route:repository",function(t,e){Galaxy.admintoolshedapp.adminRepositoryView?Galaxy.admintoolshedapp.adminRepositoryView.reDraw({tool_shed:t.replace(/\//g,"%2f"),repository_id:e}):Galaxy.admintoolshedapp.adminRepositoryView=new u.default.RepoDetails({tool_shed:t.replace(/\//g,"%2f"),repository_id:e})}),this.admin_toolshed_router.on("route:status",function(t){Galaxy.admintoolshedapp.adminRepoStatusView?Galaxy.admintoolshedapp.adminRepoStatusView.reDraw({repositories:t.split("|")}):Galaxy.admintoolshedapp.adminRepoStatusView=new _.default.RepoStatus({repositories:t.split("|")})}),this.admin_toolshed_router.on("route:workflows",function(){Galaxy.admintoolshedapp.adminWorkflowsView?Galaxy.admintoolshedapp.adminWorkflowsView.reDraw():Galaxy.admintoolshedapp.adminWorkflowsView=new m.default.Workflows}),t.history.start({pushState:!1})}});e.default={GalaxyApp:y}}).call(e,n(2))},function(t,e,n){"use strict";(function(t,i){function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),o=r(a),s=n(147),l=r(s),c=n(148),d=r(c),u=t.View.extend({defaults:{tool_sheds:[{url:"https://toolshed.g2.bx.psu.edu/",name:"Galaxy Main Tool Shed"}]},initialize:function(t){this.options=i.defaults(this.options||{},this.defaults),this.model=new l.default.ShedsCollection,this.listenTo(this.model,"sync",this.render),this.model.fetch()},el:"#center",render:function(t){this.options=i.defaults(this.options||{},t,this.defaults);var e=this.templateToolshedList;this.$el.html(e({title:(0,o.default)("Configured Galaxy Tool Sheds"),tool_sheds:this.model.models,queue:d.default.queueLength()}))},reDraw:function(t){this.$el.empty(),this.render(t)},templateToolshedList:i.template(['
    ','
    <%= title %>
    ','',"
    ",'
    ','
    ','',"<% _.each(tool_sheds, function(shed) { %>",'',"","","<% }); %>","
    ",'","
    ","
    ",'
    ',"
    "].join(""))});e.default={ShedListView:u}}).call(e,n(2),n(1))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(147),s=a(o),l=n(148),c=a(l);n(69);var d=t.View.extend({el:"#center",defaults:{tool_shed:"https://toolshed.g2.bx.psu.edu/"},initialize:function(t){var e=t.tool_shed.replace(/\//g,"%2f");this.options=i.defaults(this.options||t,this.defaults),this.model=new s.default.Categories,this.listenTo(this.model,"sync",this.render),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.model.tool_shed=e,this.model.fetch()},render:function(t){this.options=i.extend(this.options,t),this.options.categories=this.model.models,this.options.queue=c.default.queueLength();var e=this.templateCategoryList;this.$el.html(e(this.options)),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var e=this;r("#search_box").autocomplete({source:function(t,n){var i=e.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:t.term,tool_shed_url:i};r.post(a,o,function(t){console.log(t);var e=c.default.shedParser(t);n(e)})},minLength:3,select:function(n,i){var r=i.item.value,a=(Galaxy.root,e.model.tool_shed,"repository/s/"+e.model.tool_shed+"/r/"+r);t.history.navigate(a,{trigger:!0,replace:!0})}})},reDraw:function(t){this.$el.empty(),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.initialize(t)},templateCategoryList:i.template(['",'
    ','
    Categories in <%= tool_shed.replace(/%2f/g, "/") %>
    ','',"
    ",'
    ','",'
    ','','',"","","","","","","<% _.each(categories, function(category) { %>","","",'','',"","<% }); %>","
    NameDescriptionRepositories
    ",'"><%= category.get("name") %>',"<%= category.get("description") %><%= category.get("repositories") %>
    ","
    ","
    "].join(""))});e.default={CategoryView:d}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(147),s=a(o),l=n(148),c=a(l);n(69);var d=t.View.extend({el:"#center",initialize:function(t){this.model=new s.default.CategoryCollection,this.listenTo(this.model,"sync",this.render);var e=t.tool_shed.replace(/\//g,"%2f");this.model.url+="?tool_shed_url="+e+"&category_id="+t.category_id,this.model.tool_shed=e,this.model.category=t.category_id,this.model.fetch()},render:function(t){this.options=i.extend(this.options,t);var e=this.templateCategoryContents;this.$el.html(e({category:this.model.models[0],tool_shed:this.model.tool_shed,queue:c.default.queueLength()})),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var e=this;r("#search_box").autocomplete({source:function(t,n){var i=e.model.tool_shed.replace(/%2f/g,"/"),a=Galaxy.root+"api/tool_shed/search",o={term:t.term,tool_shed_url:i};r.post(a,o,function(t){var e=c.default.shedParser(t);n(e)})},minLength:3,select:function(n,i){var r=i.item.value,a="repository/s/"+e.model.tool_shed+"/r/"+r;t.history.navigate(a,{trigger:!0,replace:!0})}})},reDraw:function(t){this.$el.empty(),this.initialize(t)},templateCategoryContents:i.template(['",'
    ','
    Repositories in <%= category.get("name") %>
    ','',"
    ",'
    ','",'
    ','','',"",'','',"",'',"","",'<% _.each(category.get("repositories"), function(repository) { %>',"","","","","","","<% }); %>","
    OwnerNameSynopsisType
    <%= repository.owner %>",'","<%= repository.description %><%= repository.type %>
    ","
    ","
    "].join(""))});e.default={Category:d}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(147),s=a(o),l=n(412),c=(a(l),n(5)),d=a(c),u=n(17),h=a(u),f=n(26),p=a(f),_=n(148),g=a(_),m=t.View.extend({el:"#center",initialize:function(t){this.options=i.defaults(this.options||{},this.defaults),this.model=new s.default.RepositoryCollection,this.listenTo(this.model,"sync",this.render);var e=t.tool_shed.replace(/\//g,"%2f");this.model.url+="?tool_shed_url="+e+"&repository_id="+t.repository_id,this.model.tool_shed_url=t.tool_shed.replace(/%2f/g,"/"),this.model.tool_shed=e,this.model.category=t.repository_id,this.model.fetch()},render:function(t){var e=this.templateRepoDetails,n=this.model.models[0];this.options={repository:n.get("repository"),tool_shed:this.model.tool_shed,queue:g.default.queueLength()};var a=Object.keys(this.options.repository.metadata).sort(function(t,e){return parseInt(t.split(":")[0]-e.split(":")[0])}),o={},s=this.options.repository.metadata;a.forEach(function(t){o[t]=s[t]}),this.options.repository.metadata=o,this.options.current_changeset=this.options.current_changeset||a[a.length-1],this.options.current_metadata=this.options.repository.metadata[this.options.current_changeset],this.options.current_metadata.tool_shed_url=this.model.tool_shed_url,this.options.tools=this.options.current_metadata.tools,this.options.repository_dependencies_template=this.templateRepoDependencies,this.options.repository_dependency_template=this.templateRepoDependency,this.options.tps_template_global_select=this.templateGlobalSectionSelect,this.options.tps_template_tool_select=this.templateToolSectionSelect,this.options.tps_select_options=this.templatePanelSelectOptions,this.options.tool_dependencies=n.get("tool_dependencies"),this.options.shed_tool_conf=this.templateShedToolConf({shed_tool_confs:n.get("shed_conf")}),this.options.panel_section_dict=n.get("panel_section_dict"),this.options.api_url=Galaxy.root+"api/tool_shed_repositories/install?async=True",this.options=i.extend(this.options,t),this.$el.html(e(this.options)),this.checkInstalled(this.options.current_metadata),this.bindEvents(),r("#center").css("overflow","auto")},bindEvents:function(){var t=this;r("#changeset").on("change",function(){t.options.current_changeset=r("#changeset").find("option:selected").text(),t.options.current_metadata=t.options.repository.metadata[t.options.current_changeset],t.checkInstalled(t.options.current_metadata),t.reDraw(t.options)}),r("#tool_panel_section_select").on("change",function(){t.tpsSelection()}),r("#install_repository").on("click",function(e){r("#repository_installation");e.preventDefault();var n={};n.repositories=JSON.stringify([[r("#install_repository").attr("data-tsrid"),r("#changeset").find("option:selected").val()]]),n.tool_shed_repository_ids=JSON.stringify([r("#install_repository").attr("data-tsrid")]),n.tool_shed_url=t.model.tool_shed_url,n.install_tool_dependencies=r("#install_tool_dependencies").val(),n.install_repository_dependencies=r("#install_repository_dependencies").val(),n.install_resolver_dependencies=r("#install_resolver_dependencies").val();t.panelSelect(n);n.tool_panel_section=JSON.stringify(t.panelSelect(n)),n.shed_tool_conf=r("select[name='shed_tool_conf']").find("option:selected").val(),n.changeset=r("#changeset").find("option:selected").val();var i=r("#repository_installation").attr("action");t.prepareInstall(n,i)}),r("#queue_install").on("click",function(e){t.options.current_changeset=r("#changeset").find("option:selected").text(),t.options.current_metadata=t.options.repository.metadata[t.options.current_changeset];var n=(t.options.current_changeset,{});i.each(Object.keys(t.options.current_metadata),function(e){n[e]||(n[e]=t.options.current_metadata[e])}),n.install_tool_dependencies=r("#install_tool_dependencies").val(),n.install_repository_dependencies=r("#install_repository_dependencies").val(),n.install_resolver_dependencies=r("#install_resolver_dependencies").val(),n.tool_panel_section=JSON.stringify(t.panelSelect({})),n.shed_tool_conf=r("select[name='shed_tool_conf']").find("option:selected").val(),n.tool_shed_url=t.model.tool_shed_url,"/"==n.tool_shed_url.substr(-1)&&(n.tool_shed_url=n.tool_shed_url.substr(0,n.tool_shed_url.length-1)),g.default.addToQueue(n),t.checkInstalled(n)}),r(".tool_panel_section_picker").on("change",function(){r(this).find("option:selected").val()==r("#tool_panel_section_select").find("option:selected").val()?r(this).attr("default","active"):r(this).removeAttr("default")}),r(function(){r("#repository_dependencies").jstree()}),r(".tool_form").on("click",function(){var e=r(this).attr("data-guid"),n=(r(this).attr("data-clean"),r(this).attr("data-name")),i=r(this).attr("data-desc"),a=t.model.tool_shed_url,o=r("#repository_details").attr("data-tsrid"),s=r("#changeset").find("option:selected").val(),l=Galaxy.root+"api/tool_shed/tool_json",c={guid:e,tool_shed_url:a,tsr_id:o,changeset:s};r.get(l,c,function(t){t.cls="ui-portlet-plain";var e=new p.default(t);d.default.deepeach(t.inputs,function(t){t.type&&-1!=["data","data_collection"].indexOf(t.type)&&(t.type="hidden",t.info="Data input '"+t.name+"' ("+d.default.textify(t.extensions)+")")});var r=new h.default.View,a=""+n+" "+i;r.show({closing_events:!0,title:a,body:e.$el,buttons:{Close:function(){r.hide()}}})})})},checkInstalled:function(t){var e=this,n={name:t.name,owner:t.owner},i=!1;e.repoQueued(t);r.get(Galaxy.root+"api/tool_shed_repositories",n,function(n){for(var a=0;a','
    Repository information for <%= repository.name %> from <%= repository.owner %>
    ','',"
    ",'
    ','
    ','','','
    ','
    Changeset
    ','
    ','",'','','
    Please select a revision and review the settings below before installing.
    ',"
    ","
    ","<%= shed_tool_conf %>","<% if (current_metadata.has_repository_dependencies) { %>",'
    Repository dependencies for <%= current_changeset %>
    ','
    ','

    ','','',"

    ","<% current_metadata.repository_dependency_template = repository_dependency_template; %>",'
    ','","<%= repository_dependencies_template(current_metadata) %>","
    ","
    ","<% } %>","<% if (current_metadata.includes_tool_dependencies) { %>",'
    Tool dependencies
    ','
    ','

    ','','',"

    ",'

    ','','',"

    ",'
    ','",'',"",'','',"","","","",'',"<% _.each(tool_dependencies[current_changeset], function(dependency) { %>",'','","","","","<% }); %>","","
    NameVersionType
    ',"<%= dependency.name %><%= dependency.version %><%= dependency.type %>
    ","
    ","
    ","<% } %>","<% if (current_metadata.includes_tools_for_display_in_tool_panel) { %>",'
    Tools – click the name to preview the tool and use the pop-up menu to inspect all metadata
    ','
    ','
    ','',"",'','',"","","","",'',"<% _.each(current_metadata.tools, function(tool) { %>",'','","",'','","","<% }); %>","","
    NameDescriptionVersion<%= tps_template_global_select({tps: panel_section_dict, tps_select_options: tps_select_options}) %>
    ','","<%= tool.description %><%= tool.version %>',"<%= tps_template_tool_select({tool: tool, tps: panel_section_dict, tps_select_options: tps_select_options}) %>","
    ","
    ","
    ","<% } %>","
    ","
    "].join("")),templateRepoDependencies:i.template(['
    Repository Dependencies
    ','
    ',"
      ","
    • Repository installation requires the following","<% if (has_repository_dependencies) { %>","<% _.each(repository_dependencies, function(dependency) { %>","<% dependency.repository_dependency_template = repository_dependency_template; %>","<%= repository_dependency_template(dependency) %>","<% }); %>","<% } %>","
    • ","
    ","
    "].join("")),templateRepoDependency:i.template(['
  • ',"Repository <%= repository.name %> revision <%= changeset_revision %> owned by <%= repository.owner %>","<% if (has_repository_dependencies) { %>",'
      ',"<% _.each(repository_dependencies, function(dependency) { %>","<% dependency.repository_dependency_template = repository_dependency_template; %>","<%= repository_dependency_template(dependency) %>","<% }); %>","
    ","<% } %>","
  • "].join("")),templateShedToolConf:i.template(['
    Shed tool configuration file:
    ','
    ','
    ','",'
    Select the file whose tool_path setting you want used for installing repositories.
    ',"
    ","
    "].join("")),templateToolDependency:i.template(["<% if (has_repository_dependencies) { %>","<% _.each(repository_dependencies, function(dependency) { %>","<% if (dependency.includes_tool_dependencies) { %>","<% dependency.tool_dependency_template = tool_dependency_template %>","<%= tool_dependency_template(dependency) %>","<% } %>","<% }); %>","<% } %>"].join("")),templateGlobalSectionCreate:i.template(['
    ','
    ','','','
    ',"Add a new tool panel section to contain the installed tools (optional).","
    ","
    ","
    "].join("")),templateGlobalSectionSelect:i.template(['
    ','
    Tool Panel Section
    ','
    ','
    ','",'','
    ',"Select an existing tool panel section to contain the installed tools (optional).","
    ","
    ","
    ","
    "].join("")),templateToolSectionCreate:i.template(['
    ','','',"
    "].join("")),templateToolSectionSelect:i.template(['
    ','",'','
    ',"
    "].join("")),templatePanelSelectOptions:i.template(["<% _.each(sections, function(section) { %>",'',"<% }); %>"].join(""))});e.default={RepoDetails:m}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(147),c=a(l),d=n(148),u=a(d),h=t.View.extend({el:"#center",defaults:[{}],initialize:function(t){var e=this;this.model=new c.default.RepoQueue,this.listenTo(this.model,"sync",this.render),this.model.fetch(),e.render()},render:function(t){var e=this,n=e.templateRepoQueue,r=e.model.models;e.$el.html(n({title:(0,s.default)("Repository Installation Queue"),repositories:r,queue:u.default.queueLength()})),i("#center").css("overflow","auto"),e.bindEvents()},bindEvents:function(){var e=this;i(".install_one").on("click",function(){var t=e.loadFromQueue(i(this).attr("data-repokey"));e.installFromQueue(t,i(this).attr("data-repokey"))}),i(".remove_one").on("click",function(){var t=i(this).attr("data-repokey"),e=JSON.parse(localStorage.repositories);if(e.hasOwnProperty(t)){var n=e[t].repository.id;delete e[t],i("#queued_repository_"+n).remove()}localStorage.repositories=JSON.stringify(e)}),i("#clear_queue").on("click",function(){localStorage.repositories="{}"}),i("#from_workflow").on("click",function(){t.history.navigate("workflows",{trigger:!0,replace:!0})})},installFromQueue:function(e,n){var r=Object();r.install_tool_dependencies=e.install_tool_dependencies,r.install_repository_dependencies=e.install_repository_dependencies,r.install_resolver_dependencies=e.install_resolver_dependencies,r.tool_panel_section=e.tool_panel_section,r.shed_tool_conf=e.shed_tool_conf,r.repositories=JSON.stringify([[e.repository.id,e.changeset_revision]]),r.tool_shed_repository_ids=JSON.stringify([e.repository.id]),r.tool_shed_url=n.split("|")[0],r.changeset=e.changeset_revision;var a=Galaxy.root+"api/tool_shed_repositories/install?async=True";if(i("#queued_repository_"+e.repository.id).remove(),localStorage.repositories){void 0===n&&(n=u.default.queueKey(e));var o=JSON.parse(localStorage.repositories);o.hasOwnProperty(n)&&(delete o[n],localStorage.repositories=JSON.stringify(o))}i.post(a,r,function(e){var n=JSON.parse(e),r=n.repositories,a="status/r/"+r.join("|");i.post(Galaxy.root+"admin_toolshed/install_repositories",n,function(t){console.log("Initializing repository installation succeeded")}),t.history.navigate(a,{trigger:!0,replace:!0})})},loadFromQueue:function(t){var e=JSON.parse(localStorage.repositories);if(e.hasOwnProperty(t))return e[t]},reDraw:function(t){this.$el.empty(),this.initialize(t),this.model.fetch(),this.render(t)},templateRepoQueue:r.template(['
    ','
    <%= title %>
    ','',"
    ",'
    ','','',"",'','','','','','',"","","","<% _.each(repositories, function(repository) { %>",'">','','','','','",'","","<% }); %>","","
    NameOwnerRevisionToolShedInstall
    <%= repository.get("repository").name %><%= repository.get("repository").owner %><%= repository.get("changeset_revision") %><%= repository.get("tool_shed_url") %>','" type="submit" id="install_repository_<%= repository.get("id") %>" name="install_repository" value="Install now" />',"','" type="submit" id="unqueue_repository_<%= repository.get("id") %>" name="unqueue_repository" value="Remove from queue" />',"
    ",'',"
    "].join(""))});e.default={RepoQueueView:h}}).call(e,n(2),n(0),n(1))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(147),c=a(l),d=n(148),u=a(d),h=t.View.extend({el:"#center",initialize:function(t){this.options=i.defaults(this.options||[{}],t,this.defaults),this.model=new c.default.RepoStatus,this.listenTo(this.model,"sync",this.render),this.model.url+="?repositories="+this.options.repositories.join("|"),this.model.fetch(),this.timer=setInterval(function(t){var e=["installed","error"],n=!0;i.some(t.model.models,function(t){repo_id=t.get("id");var i=t.get("status").toLowerCase();if(-1===e.indexOf(i))return n=!1,!0}),n?clearInterval(t.timer):t.model.fetch()},2e3,this)},close:function(){clearInterval(this.timer)},render:function(t){this.options=i.extend(this.options,t);var e=this.templateRepoStatus;this.$el.html(e({title:(0,s.default)("Repository Status"),repositories:this.model.models,queue:u.default.queueLength()})),r("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){},reDraw:function(t){this.$el.empty(),this.initialize(t)},templateRepoStatus:i.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','',"","",'',"<% _.each(repositories, function(repository) { %>","","","","","","","","<% }); %>","",'',"
    NameDescriptionOwnerRevisionInstallation Status
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    ",'
    ','","
    ","
    "].join(""))});e.default={RepoStatus:h}}).call(e,n(2),n(1),n(0))},function(t,e,n){"use strict";(function(t,i,r){function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),s=a(o),l=n(147),c=a(l),d=n(148),u=a(d),h=t.View.extend({el:"#center",defaults:[{}],initialize:function(t){var e=this;this.model=new c.default.WorkflowTools,this.listenTo(this.model,"sync",this.render),this.model.fetch(),e.render()},render:function(t){var e=this,n=e.templateWorkflows,r=e.model.models;e.$el.html(n({title:(0,s.default)("Workflows Missing Tools"),workflows:r,queue:u.default.queueLength()})),i("#center").css("overflow","auto"),e.bindEvents()},bindEvents:function(){var e,n=this;i(".show_wf_repo").on("click",function(){var n=i(this).attr("data-toolids"),r=i(this).attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:n};i.get(a,o,function(n){e=n.repository.id;var i="repository/s/"+r.replace(/:/g,"%3a").replace(/\//g,"%2f")+"/r/"+n.repository.id;t.history.navigate(i,{trigger:!0,replace:!0})})}),i(".queue_wf_repo").on("click",function(){var t=i(this),n=t.attr("data-toolids"),r=t.attr("data-shed"),a=Galaxy.root+"api/tool_shed/repository",o={tool_ids:n};i.get(a,o,function(n){e=n.repository.id,o={tool_shed_url:r,repository_id:e},i.get(a,o,function(e){var n=Object.keys(e.repository.metadata),i=n[0],a=e.repository.metadata[i];a.tool_shed_url=r,u.default.addToQueue(a),t.remove()})})}),i("#from_workflow").on("click",n.loadWorkflows)},reDraw:function(t){this.$el.empty(),this.initialize(t)},templateWorkflows:r.template(['
    ','
    <%= title %>
    ','',"
    ",'",'','',"",'','','','','','',"","","","<% _.each(workflows, function(workflow) { %>","",'",'",'','','','","","<% }); %>","",""].join(""))});e.default={Workflows:h}}).call(e,n(2),n(0),n(1))},function(t,e,n){"use strict";(function(t){function i(t){return t&&t.__esModule?t:{default:t}}function r(t){var e,n,i,r;switch(t){case h.ITEM_HISTORY:e="History",n="Histories",i="history",r="History";break;case h.ITEM_DATASET:e="Dataset",n="Datasets",i="dataset",r="HistoryDatasetAssociation";break;case h.ITEM_WORKFLOW:e="Workflow",n="Workflows",i="workflow",r="StoredWorkflow";break;case h.ITEM_PAGE:e="Page",n="Pages",i="page",r="Page";break;case h.ITEM_VISUALIZATION:e="Visualization",n="Visualizations",i="visualization",r="Visualization"}var a="list_"+n.toLowerCase()+"_for_selection";return{singular:e,plural:n,controller:i,iclass:r,list_ajax_url:list_objects_url.replace("LIST_ACTION",a)}}function a(e,n,i){var r=set_accessible_url.replace("ITEM_CONTROLLER",e);t.ajax({type:"POST",url:r,data:{id:n,accessible:"True"},error:function(){alert("Making "+i+" accessible failed")}})}function o(){t(document).ajaxError(function(t,e){var n=e.responseText||e.statusText||"Could not connect to server";return show_modal("Server error",n,{"Ignore error":hide_modal}),!1}),t("[name=page_content]").wymeditor({skin:"galaxy",basePath:editor_base_path,iframeBasePath:iframe_base_path,boxHtml:"
    WorkflowsTool IDsShedNameOwnerActions
    ','
      ','<% _.each(workflow.get("workflows"), function(name) { %>','
    • <%= name %>
    • ',"<% }); %>","
    ","
    ','
      ','<% _.each(workflow.get("tools"), function(tool) { %>','
    • <%= tool %>
    • ',"<% }); %>","
    ","
    <%= workflow.get("shed") %><%= workflow.get("repository") %><%= workflow.get("owner") %>','
      ','
    • ','" data-owner="<%= workflow.get("owner") %>" data-repo="<%= workflow.get("repository") %>" data-toolids="<%= workflow.get("tools").join(",") %>" value="Show Repository" />
    • ',"
    ","
    "+u.TOOLS+"
    "+u.IFRAME+u.STATUS+"
    ",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:(0,l.default)("Superscript"),css:"wym_tools_superscript"},{name:"Subscript",title:(0,l.default)("Subscript"),css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"}]});var e=t.wymeditors(0),n=function(n){show_modal("Saving page","progress"),t.ajax({url:save_url,type:"POST",data:{id:page_id,content:e.xhtml(),annotations:JSON.stringify(new Object),_:"true"},success:function(){n()}})};t("#save-button").click(function(){n(function(){hide_modal()})}),t("#close-button").click(function(){window.document.location=page_list_url});var i=t("");t(".wym_area_top").append(i);var r={};t.each(e._options.containersItems,function(t,n){var i=n.name;r[n.title.replace("_"," ")]=function(){e.container(i)}}),make_popupmenu(i,r);var a=t("").addClass("galaxy-page-editor-button");t(".wym_area_top").append(a),make_popupmenu(a,{"Insert History Link":function(){e.dialog(h.DIALOG_HISTORY_LINK)},"Insert Dataset Link":function(){e.dialog(h.DIALOG_DATASET_LINK)},"Insert Workflow Link":function(){e.dialog(h.DIALOG_WORKFLOW_LINK)},"Insert Page Link":function(){e.dialog(h.DIALOG_PAGE_LINK)},"Insert Visualization Link":function(){e.dialog(h.DIALOG_VISUALIZATION_LINK)}});var o=t("").addClass("galaxy-page-editor-button");t(".wym_area_top").append(o),make_popupmenu(o,{"Embed History":function(){e.dialog(h.DIALOG_EMBED_HISTORY)},"Embed Dataset":function(){e.dialog(h.DIALOG_EMBED_DATASET)},"Embed Workflow":function(){e.dialog(h.DIALOG_EMBED_WORKFLOW)},"Embed Visualization":function(){e.dialog(h.DIALOG_EMBED_VISUALIZATION)}})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var s=n(3),l=i(s);n(149),n(226),n(747),n(225);var c=n(24),d=i(c),u=window.WYMeditor,h={ITEM_HISTORY:"item_history",ITEM_DATASET:"item_dataset",ITEM_WORKFLOW:"item_workflow",ITEM_PAGE:"item_page",ITEM_VISUALIZATION:"item_visualization",DIALOG_HISTORY_LINK:"link_history",DIALOG_DATASET_LINK:"link_dataset",DIALOG_WORKFLOW_LINK:"link_workflow",DIALOG_PAGE_LINK:"link_page",DIALOG_VISUALIZATION_LINK:"link_visualization",DIALOG_EMBED_HISTORY:"embed_history",DIALOG_EMBED_DATASET:"embed_dataset",DIALOG_EMBED_WORKFLOW:"embed_workflow",DIALOG_EMBED_PAGE:"embed_page",DIALOG_EMBED_VISUALIZATION:"embed_visualization"};u.editor.prototype.dialog=function(e,n,i){function o(){t("#set_link_id").click(function(){t("#link_attribute_label").text("ID/Name");var e=t(".wym_href");e.addClass("wym_id").removeClass("wym_href"),c&&e.val(t(c).attr("id")),t(this).remove()})}var s=this,l=s.uniqueStamp(),c=s.selected();if(e==u.DIALOG_LINK){c&&(t(s._options.hrefSelector).val(t(c).attr(u.HREF)),t(s._options.srcSelector).val(t(c).attr(u.SRC)),t(s._options.titleSelector).val(t(c).attr(u.TITLE)),t(s._options.altSelector).val(t(c).attr(u.ALT)));var f,p;c&&(f=t(c).attr("href"),void 0==f&&(f=""),void 0==(p=t(c).attr("title"))&&(p="")),show_modal("Create Link","

    ",{"Make link":function(){var e=t(s._options.hrefSelector).val()||"",n=t(".wym_id").val()||"",i=t(s._options.titleSelector).val()||"";if(e||n){s._exec(u.CREATE_LINK,l);var r=t("a[href="+l+"]",s._doc.body);r.attr(u.HREF,e).attr(u.TITLE,i).attr("id",n),0===r.text().indexOf("wym-")&&r.text(i)}hide_modal()},Cancel:function(){hide_modal()}},{},o)}if(e==u.DIALOG_IMAGE)return s._selected_image&&(t(s._options.dialogImageSelector+" "+s._options.srcSelector).val(t(s._selected_image).attr(u.SRC)),t(s._options.dialogImageSelector+" "+s._options.titleSelector).val(t(s._selected_image).attr(u.TITLE)),t(s._options.dialogImageSelector+" "+s._options.altSelector).val(t(s._selected_image).attr(u.ALT))),void show_modal("Image","



    ",{Insert:function(){var e=t(s._options.srcSelector).val();e.length>0&&(s._exec(u.INSERT_IMAGE,l),t("img[src$="+l+"]",s._doc.body).attr(u.SRC,e).attr(u.TITLE,t(s._options.titleSelector).val()).attr(u.ALT,t(s._options.altSelector).val())),hide_modal()},Cancel:function(){hide_modal()}});if(e==u.DIALOG_TABLE&&show_modal("Table","


    ",{Insert:function(){var e=t(s._options.rowsSelector).val(),n=t(s._options.colsSelector).val();if(e>0&&n>0){var i=s._doc.createElement(u.TABLE),r=null,a=t(s._options.captionSelector).val();i.createCaption().innerHTML=a;for(var o=0;o").append(g.$el).append(t("
    ").append('').append("Make the selected "+_.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Insert:function(){var e=!1;null!=t("#make-importable:checked").val()&&(e=!0);new Array;g.$("input[name=id]:checked").each(function(){var n=t(this).val();e&&a(_.controller,n,_.singular);var i=get_name_and_link_url+n,r=i.replace("ITEM_CONTROLLER",_.controller);t.getJSON(r,function(e){s._exec(u.CREATE_LINK,l);var i=t("a[href="+l+"]",s._doc.body).text();""==i||i==l?s.insert(""+_.singular+" '"+e.name+"'"):t("a[href="+l+"]",s._doc.body).attr(u.HREF,e.link).attr(u.TITLE,_.singular+n)})}),Galaxy.modal.hide()},Close:function(){Galaxy.modal.hide()}}})}if(e==h.DIALOG_EMBED_HISTORY||e==h.DIALOG_EMBED_DATASET||e==h.DIALOG_EMBED_WORKFLOW||e==h.DIALOG_EMBED_PAGE||e==h.DIALOG_EMBED_VISUALIZATION){var _;switch(e){case h.DIALOG_EMBED_HISTORY:_=r(h.ITEM_HISTORY);break;case h.DIALOG_EMBED_DATASET:_=r(h.ITEM_DATASET);break;case h.DIALOG_EMBED_WORKFLOW:_=r(h.ITEM_WORKFLOW);break;case h.DIALOG_EMBED_PAGE:_=r(h.ITEM_PAGE);break;case h.DIALOG_EMBED_VISUALIZATION:_=r(h.ITEM_VISUALIZATION)}var g=new d.default({url_base:_.list_ajax_url,embedded:!0});Galaxy.modal.show({title:"Insert Link to "+_.singular,body:t("
    ").append(g.$el).append(t("
    ").append('').append("Make the selected "+_.plural.toLowerCase()+" accessible so that they can viewed by everyone.")),closing_events:!0,buttons:{Embed:function(){var e=!1;null!=t("#make-importable:checked").val()&&(e=!0),g.$("input[name=id]:checked").each(function(){var n=t(this).val(),i=t("label[for='"+n+"']:first").text();e&&a(_.controller,n,_.singular);var r=_.iclass+"-"+n,o=["
    ","

    ","Embedded Galaxy ",_.singular," '",i,"'","

    ","

    ","[Do not edit this block; Galaxy will fill it in with the annotated ",_.singular.toLowerCase()," when it is displayed.]","

    ","
    "].join("");s.insert(o)}),Galaxy.modal.hide()},Close:function(){Galaxy.modal.hide()}}})}}}).call(e,n(0))},function(module,exports,__webpack_require__){(function(jQuery,$){if(!WYMeditor)var WYMeditor={};!function(){if(window.console&&console.firebug)WYMeditor.console=window.console;else{var t=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];WYMeditor.console={};for(var e=0;e
    "+WYMeditor.TOOLS+"
    "+WYMeditor.CONTAINERS+WYMeditor.CLASSES+"
    "+WYMeditor.HTML+WYMeditor.IFRAME+WYMeditor.STATUS+"
    "+WYMeditor.LOGO+"
    ",logoHtml:"WYMeditor",iframeHtml:"
    ",editorStyles:[],toolsHtml:"

    {Tools}

      "+WYMeditor.TOOLS_ITEMS+"
    ",toolsItemHtml:"
  • "+WYMeditor.TOOL_TITLE+"
  • ",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"},{name:"Paste",title:"Paste_From_Word",css:"wym_tools_paste"},{name:"ToggleHtml",title:"HTML",css:"wym_tools_html"},{name:"Preview",title:"Preview",css:"wym_tools_preview"}],containersHtml:"

    {Containers}

      "+WYMeditor.CONTAINERS_ITEMS+"
    ",containersItemHtml:"
  • "+WYMeditor.CONTAINER_TITLE+"
  • ",containersItems:[{name:"P",title:"Paragraph",css:"wym_containers_p"},{name:"H1",title:"Heading_1",css:"wym_containers_h1"},{name:"H2",title:"Heading_2",css:"wym_containers_h2"},{name:"H3",title:"Heading_3",css:"wym_containers_h3"},{name:"H4",title:"Heading_4",css:"wym_containers_h4"},{name:"H5",title:"Heading_5",css:"wym_containers_h5"},{name:"H6",title:"Heading_6",css:"wym_containers_h6"},{name:"PRE",title:"Preformatted",css:"wym_containers_pre"},{name:"BLOCKQUOTE",title:"Blockquote",css:"wym_containers_blockquote"},{name:"TH",title:"Table_Header",css:"wym_containers_th"}],classesHtml:"

    {Classes}

      "+WYMeditor.CLASSES_ITEMS+"
    ",classesItemHtml:"
  • "+WYMeditor.CLASS_TITLE+"
  • ",classesItems:[],statusHtml:"

    {Status}

    ",htmlHtml:"

    {Source_Code}

    ",boxSelector:".wym_box",toolsSelector:".wym_tools",toolsListSelector:" ul",containersSelector:".wym_containers",classesSelector:".wym_classes",htmlSelector:".wym_html",iframeSelector:".wym_iframe iframe",iframeBodySelector:".wym_iframe",statusSelector:".wym_status",toolSelector:".wym_tools a",containerSelector:".wym_containers a",classSelector:".wym_classes a",htmlValSelector:".wym_html_val",hrefSelector:".wym_href",srcSelector:".wym_src",titleSelector:".wym_title",altSelector:".wym_alt",textSelector:".wym_text",rowsSelector:".wym_rows",colsSelector:".wym_cols",captionSelector:".wym_caption",summarySelector:".wym_summary",submitSelector:".wym_submit",cancelSelector:".wym_cancel",previewSelector:"",dialogTypeSelector:".wym_dialog_type",dialogLinkSelector:".wym_dialog_link",dialogImageSelector:".wym_dialog_image",dialogTableSelector:".wym_dialog_table",dialogPasteSelector:".wym_dialog_paste",dialogPreviewSelector:".wym_dialog_preview",updateSelector:".wymupdate",updateEvent:"click",dialogFeatures:"menubar=no,titlebar=no,toolbar=no,resizable=no,width=560,height=300,top=0,left=0",dialogFeaturesPreview:"menubar=no,titlebar=no,toolbar=no,resizable=no,scrollbars=yes,width=560,height=300,top=0,left=0",dialogHtml:""+WYMeditor.DIALOG_TITLE+"