/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2011, 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors: IBM Corporation - initial API and implementation
 *******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

/**
 * @license RequireJS text 2.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/text for details
 */

/*******************************************************************************
 * @license
 * Copyright (c) 2012, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010,2012 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: IBM Corporation - initial API and implementation
 ******************************************************************************/

/*******************************************************************************
 * @license
 * Copyright (c) 2010, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials are made 
 * available under the terms of the Eclipse Public License v1.0 
 * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
 * 
 * Contributors: 
 *		Felipe Heidrich (IBM Corporation) - initial API and implementation
 *		Silenio Quarti (IBM Corporation) - initial API and implementation
 ******************************************************************************/

/*

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation
 RequireJS text 2.0.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/requirejs/text for details

 Copyright (c) 2012, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010,2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: IBM Corporation - initial API and implementation

 Copyright (c) 2010, 2013 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors: 
 Felipe Heidrich (IBM Corporation) - initial API and implementation
 Silenio Quarti (IBM Corporation) - initial API and implementation

 Copyright (c) 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation

 Copyright (c) 2011, 2012 IBM Corporation and others.
 All rights reserved. This program and the accompanying materials are made 
 available under the terms of the Eclipse Public License v1.0 
 (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
 License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 

 Contributors:
 IBM Corporation - initial API and implementation
*/
(function(d,b){typeof define==="function"&&define.amd?define("orion/Deferred",b):typeof exports==="object"?module.exports=b():(d.orion=d.orion||{},d.orion.Deferred=b())})(this,function(){function d(){for(var c;c=a.shift();)c();f=!1}function b(c){a.push(c);f||(f=!0,setTimeout(d,0))}function h(a){return function(){a.apply(void 0,arguments)}}function c(){function e(){for(var c;c=k.shift();){var b=c.deferred,e=j==="fulfilled"?"resolve":"reject";if(typeof c[e]==="function")try{var g=(0,c[e])(r),f=g&&(typeof g===
"object"||typeof g==="function")&&g.then;if(typeof f==="function")if(g===b.promise)b.reject(new TypeError);else{var n=g.cancel;typeof n==="function"?b._protected(a).parentCancel=n.bind(g):delete b._protected(a).parentCancel;f.call(g,h(b.resolve),h(b.reject),h(b.progress))}else b.resolve(g)}catch(o){b.reject(o)}else b[e](r)}}function f(a){delete v.parentCancel;j="rejected";r=a;k.length&&b(e)}function g(a){function d(a){return function(A){w||(w=!0,a(A))}}var w=!1;delete v.parentCancel;try{var h=a&&
(typeof a==="object"||typeof a==="function")&&a.then;if(typeof h==="function")if(a===m)f(new TypeError);else{j="assumed";var t=a&&a.cancel;if(typeof t!=="function"){var n=new c,a=n.promise;try{h(n.resolve,n.reject,n.progress)}catch(o){n.reject(o)}t=a.cancel;h=a.then}r=a;h.call(a,d(g),d(f));v.parentCancel=t.bind(a)}else j="fulfilled",r=a,k.length&&b(e)}catch(A){d(f)(A)}}function d(){var a=v.parentCancel;if(a)delete v.parentCancel,a();else if(!j)a=Error("Cancel"),a.name="Cancel",f(a)}var r,j,k=[],m=
this,v={};Object.defineProperty(this,"_protected",{value:function(b){if(b!==a)throw Error("protected");return v}});this.resolve=function(a){j||g(a);return m};this.reject=function(a){j||f(a);return m};this.progress=function(a){j||k.forEach(function(b){if(b.progress)try{b.progress(a)}catch(c){}});return m.promise};this.cancel=function(){v.parentCancel?setTimeout(d,0):d();return m};this.then=function(g,f,d){g={resolve:g,reject:f,progress:d,deferred:new c};k.push(g);g.deferred._protected(a).parentCancel=
m.promise.cancel.bind(m);(j==="fulfilled"||j==="rejected")&&b(e);return g.deferred.promise};this.promise={then:m.then,cancel:m.cancel}}var a=[],f=!1;c.all=function(a,b){function g(a,b){k||(j[a]=b,--d===0&&m.resolve(j))}function f(a,c){if(!k){if(b)try{g(a,b(c));return}catch(e){c=e}m.reject(c)}}var d=a.length,j=[],k=!1,m=new c;m.then(void 0,function(){k=!0;a.forEach(function(a){a.cancel&&a.cancel()})});d===0?m.resolve(j):a.forEach(function(a,b){a.then(g.bind(void 0,b),f.bind(void 0,b))});return m.promise};
c.when=function(a,b,g,f){var d;if(!(a&&typeof a.then==="function"))d=new c,d.resolve(a),a=d.promise;return a.then(b,g,f)};return c});
(function(d,b){typeof define==="function"&&define.amd?define("orion/plugin",["orion/Deferred"],b):typeof exports==="object"?module.exports=b(require("orion/Deferred")):(d.orion=d.orion||{},d.orion.PluginProvider=b(d.orion.Deferred))})(this,function(d){function b(b,c){this.__objectId=b;this.__methods=c}return function(h){function c(a){m&&(typeof ArrayBuffer==="undefined"&&(a=JSON.stringify(a)),m===self?m.postMessage(a):m.postMessage(a,"*"))}function a(){var a=[];Object.keys(n).forEach(function(b){var c=
n[b];a.push({serviceId:b,names:c.names,methods:c.methods,properties:c.properties})});return{headers:j||{},services:a}}function f(a,b){if(b&&b instanceof XMLHttpRequest){var c,n;try{c=b.status,n=b.statusText}catch(i){c=0,n=""}return{status:c||0,statusText:n}}return b}function e(a){var b=a?JSON.parse(JSON.stringify(a,f)):a;if(a instanceof Error)b.__isError=!0,b.message=b.message||a.message,b.name=b.name||a.name;return b}function p(a){if(!m)return(new d).reject(Error("plugin not connected"));a.id=String(v++);
var c=new d;x[a.id]=c;c.then(null,function(b){k&&b instanceof Error&&b.name==="Cancel"&&o({requestId:a.id,method:"cancel",params:b.message?[b.message]:[]})});var n=Object.prototype.toString;a.params.forEach(function(g,i){if(n.call(g)==="[object Object]"&&!(g instanceof b)){var l,o;for(l in g)n.call(g[l])==="[object Function]"&&(o=o||[],o.push(l));if(o){var e=z++;t[e]=g;l=function(){delete t[e]};c.then(l,l);a.params[i]=new b(e,o)}}});o(a);return c.promise}function g(a,b){a||a===0?o({id:a,result:null,
error:b}):console.log(b)}function w(a,b,c,n){n.forEach(function(a,i){if(a&&typeof a.__objectId!=="undefined"){var b={};a.__methods.forEach(function(i){b[i]=function(){return p({objectId:a.__objectId,method:i,params:Array.prototype.slice.call(arguments)})}});n[i]=b}});var i=typeof a===void 0?null:{id:a,result:null,error:null};try{var g=c.apply(b,n);if(i)g&&typeof g.then==="function"?(s[a]=g,g.then(function(b){delete s[a];i.result=b;o(i)},function(b){if(s[a])delete s[a],i.error=e(b),o(i)},function(){o({responseId:a,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(i.result=g,o(i))}catch(f){if(i)i.error=e(f),o(i)}}function r(a){if(a.source===m){a=typeof a.data!=="string"?a.data:JSON.parse(a.data);try{if(a.method){var b=a.method,c=a.params||[];if("serviceId"in a){var o=n[a.serviceId];o||g(a.id,"service not found");o=o.implementation;b in o?w(a.id,o,o[b],c):g(a.id,"method not found")}else if("objectId"in a){var i=t[a.objectId];i||g(a.id,"object not found");!b in i?w(a.id,i,i[b],c):g(a.id,"method not found")}else if("requestId"in
a){var e=s[a.requestId];e&&b==="cancel"&&e.cancel&&e.cancel.apply(e,c)}else if("responseId"in a){var f=x[a.responseId];f&&b==="progress"&&f.progress&&f.progress.apply(f,c)}else throw Error("Bad method: "+a.method);}else{var k=x[String(a.id)];delete x[String(a.id)];a.error?k.reject(a.error):k.resolve(a.result)}}catch(d){console.log("Plugin._messageHandler "+d)}}}var j=h,k=!1,m=null,v=0,z=0,y=0,s={},x={},t={},n={},o=c;this.updateHeaders=function(a){if(k)throw Error("Cannot update headers. Plugin Provider is connected");
j=a};this.registerServiceProvider=this.registerService=function(a,b,c){if(k)throw Error("Cannot register service. Plugin Provider is connected");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var g=null,i=[];for(g in b)typeof b[g]==="function"&&i.push(g);n[y++]={names:a,methods:i,implementation:b,properties:c||{},listeners:{}}};this.connect=function(b,n){if(!k){if(typeof window==="undefined")m=self;else if(window!==window.parent)m=window.parent;else if(window.opener!==null)m=window.opener;else{n&&
n("No valid plugin target");return}addEventListener("message",r,!1);var g={method:"plugin",params:[a()]};c(g);k=!0}b&&b()};this.disconnect=function(){k&&(removeEventListener("message",r),m=null,k=!1)}}});
define("orion/util",[],function(){var d=navigator.userAgent,b=d.indexOf("MSIE")!==-1||d.indexOf("Trident")!==-1?document.documentMode:void 0,h=parseFloat(d.split("Firefox/")[1]||d.split("Minefield/")[1])||void 0,c=d.indexOf("Opera")!==-1?parseFloat(d.split("Version/")[1]):void 0,a=parseFloat(d.split("Chrome/")[1])||void 0,f=d.indexOf("Safari")!==-1&&!a,e=parseFloat(d.split("WebKit/")[1])||void 0,p=d.indexOf("Android")!==-1,g=d.indexOf("iPad")!==-1,d=d.indexOf("iPhone")!==-1,w=g||d,r=navigator.platform.indexOf("Mac")!==
-1,j=navigator.platform.indexOf("Win")!==-1,k=navigator.platform.indexOf("Linux")!==-1,m="ontouchstart"in document.createElement("input");return{formatMessage:function(a){var b=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,c){return b[(c<<0)+1]})},createElement:function(a,b){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",b):a.createElement(b)},isIE:b,isFirefox:h,isOpera:c,isChrome:a,isSafari:f,isWebkit:e,isAndroid:p,isIPad:g,isIPhone:d,isIOS:w,isMac:r,isWindows:j,
isLinux:k,isTouch:m,platformDelimiter:j?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(d){function b(a,b){b||(b=document);return b.querySelectorAll(a)}function h(a){var b=a.tabIndex;b===0&&d.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[a.nodeName.toLowerCase()]&&!a.attributes.tabIndex&&(b=-1);return b}function c(a){if(h(a)>=0)return a;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++){var e=c(a.childNodes[b]);if(e)return e}return null}function a(b){if(h(b)>=
0)return b;if(b.hasChildNodes())for(var c=b.childNodes.length-1;c>=0;c--){var e=a(b.childNodes[c]);if(e)return e}return null}function f(a,b){if(a.nodeType===3){var c=e.exec(a.nodeValue);c&&c.length>1&&b(a,c)}if(a.hasChildNodes())for(c=0;c<a.childNodes.length;c++)f(a.childNodes[c],b)}var e=/\$\{([^\}]+)\}/,p=null;return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:b,$$array:function(a,c){return Array.prototype.slice.call(b(a,c))},node:function(a){var b=a;typeof a==="string"&&(b=document.getElementById(a));
return b},contains:function(a,b){if(!a||!b)return!1;if(a===b)return!0;var c=a.compareDocumentPosition(b);return Boolean(c&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.documentElement.scrollLeft,top:a.top+document.documentElement.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:c,lastTabbable:a,stop:function(a){if(window.document.all)a.keyCode=0;a.preventDefault&&(a.preventDefault(),a.stopPropagation())},
processTextNodes:function(a,b){f(a,function(a,c){a.parentNode.replaceChild(document.createTextNode(b[c[1]]||c[1]),a)})},processDOMNodes:function(a,b){f(a,function(a,c){var e=b[c[1]];if(e){var f=document.createRange(),d=c.index;f.setStart(a,d);f.setEnd(a,d+c[0].length);f.deleteContents();f.insertNode(e)}})},addAutoDismiss:function(a,b){function c(a){p.forEach(function(b){var c=!1,e=b.excludeNodes.some(function(b){return document.body.contains(b)?(c=!0,b.contains(a.target)):!1});if(c&&!e)try{b.dismiss(a)}catch(f){typeof console!==
"undefined"&&console&&console.error(f&&f.message)}});p=p.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}p===null&&(p=[],document.addEventListener("click",c,!0),d.isIOS&&document.addEventListener("touchend",function(a){function b(){a.target.removeEventListener("click",b)}a.touches.length===0&&a.target.addEventListener("click",b)},!1));p.push({excludeNodes:a,dismiss:b})},setFramesEnabled:function(a){for(var b=document.getElementsByTagName("iframe"),c=
0;c<b.length;c++)b[c].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){p=p.filter(function(b){return a!==b.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("orion/EventTarget",[],function(){function d(){this._namedListeners={}}d.prototype={dispatchEvent:function(b){if(!b.type)throw Error("unspecified type");var d=this._namedListeners[b.type];d&&d.forEach(function(c){try{typeof c==="function"?c(b):c.handleEvent(b)}catch(a){typeof console!=="undefined"&&console.log(a)}});return!b.defaultPrevented},addEventListener:function(b,d){if(typeof d==="function"||d.handleEvent)this._namedListeners[b]=this._namedListeners[b]||[],this._namedListeners[b].push(d)},
removeEventListener:function(b,d){var c=this._namedListeners[b];if(c)for(var a=0;a<c.length;a++)if(c[a]===d){c.length===1?delete this._namedListeners[b]:c.splice(a,1);break}}};d.prototype.constructor=d;d.attach=function(b){var h=new d;b.dispatchEvent=h.dispatchEvent.bind(h);b.addEventListener=h.addEventListener.bind(h);b.removeEventListener=h.removeEventListener.bind(h)};return d});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(d,b,h){function c(a){h.attach(this);this._init(a)}c.prototype={_init:function(a){this._dropdownNode=b.node(a.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=a.populate;this._selectionClass=a.selectionClass;this._parentDropdown=a.parentDropdown;this._positioningNode=a.positioningNode;if(!this._parentDropdown)for(var c=this._dropdownNode.parentNode;c&&document!==c;){if(c.classList&&
c.classList.contains("dropdownMenu")){this._parentDropdown=c.dropdown;break}c=c.parentNode}this._triggerNode=a.triggerNode?a.triggerNode:b.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!a.skipTriggerEventListeners){var e=this;this._triggerNode.addEventListener("click",function(a){e.toggle(a)&&b.stop(a)},!1);this._triggerNode.tagName.toLowerCase()==="span"&&this._triggerNode.addEventListener("keydown",function(a){if(a.keyCode===
b.KEY.ENTER||a.keyCode===b.KEY.SPACE)e.toggle(),b.stop(a)},!1)}this._dropdownNode.addEventListener("keydown",this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(a){var c=this;a.addEventListener("click",function(a){c.toggle(a)&&b.stop(a)},!1)},toggle:function(a){return this.isVisible()?this.close():this.open(a)},isVisible:function(){return this._isVisible},open:function(a){var c=!1;if(!this.isVisible()){this.dispatchEvent({type:"triggered",dropdown:this,event:a});b.setFramesEnabled(!1);this._populate&&
(this.empty(),this._populate(this._dropdownNode));var e=this.getItems();if(e.length>0){if(!this._hookedAutoDismiss)this._boundAutoDismiss?b.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),c=b.$$array(".dropdownSubMenu",this._dropdownNode),b.addAutoDismiss([this._triggerNode].concat(c),this._boundAutoDismiss),this._hookedAutoDismiss=!0;this._triggerNode.classList.add("dropdownTriggerOpen");this._selectionClass&&this._triggerNode.classList.add(this._selectionClass);
this._dropdownNode.classList.add("dropdownMenuOpen");this._isVisible=!0;this._positionDropdown(a);e[0].focus();c=!0;this._parentDropdown&&this._parentDropdown.submenuOpen(this)}}return c},_autoDismiss:function(a){if(this.close(!1)&&this._dropdownNode.contains(a.target))for(a=this._parentDropdown;a;)a.close(!1),a=a._parentDropdown},_positionDropdown:function(){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+
"px";else{var a=b.bounds(this._dropdownNode),c=b.bounds(document.body);if(a.left+a.width>c.left+c.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-a.width+"px";else{var e=b.bounds(this._boundingNode(this._triggerNode)),d=b.bounds(this._triggerNode);this._dropdownNode.style.left=d.left-e.left-a.width+d.width+"px"}a=a.top+a.height-(c.top+c.height);if(0<a)this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-a)+"px"}},_boundingNode:function(a){var b=
window.getComputedStyle(a,null);return b===null?a:b.getPropertyValue("position")==="absolute"||!a.parentNode||a===document.body?a:this._boundingNode(a.parentNode)},close:function(a){var c=!1;if(this.isVisible())this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),b.setFramesEnabled(!0),a&&this._triggerNode.focus(),this._isVisible=!1,c=!0;return c},getItems:function(){var a=
[],c=this;b.$$array("li:not(.dropdownSeparator) > .dropdownMenuItem",this._dropdownNode,!0).forEach(function(b){b.parentNode.parentNode===c._dropdownNode&&a.push(b)});a.forEach(function(a){if(!a._hasDropdownMouseover)a.addEventListener("mouseover",function(d){a.dropdown?a.dropdown.open(d):(c._closeSelectedSubmenu(),b.stop(d))}),a._hasDropdownMouseover=!0});return a},empty:function(){var a=this;b.$$array("li",this._dropdownNode).forEach(function(b){b.parentNode===a._dropdownNode&&b.parentNode.removeChild(b)});
this._hookedAutoDismiss=!1},_dropdownKeyDown:function(a){if(a.keyCode===b.KEY.UP||a.keyCode===b.KEY.DOWN||a.keyCode===b.KEY.RIGHT||a.keyCode===b.KEY.ENTER||a.keyCode===b.KEY.LEFT){var c=this.getItems(),e=document.activeElement;if(c.length&&c.length>0&&e){var d=c.indexOf(e);d<0&&(d=c.indexOf(e.parentNode));d>=0&&(a.keyCode===b.KEY.UP&&d>0?(d--,c[d].focus()):a.keyCode===b.KEY.DOWN&&d<c.length-1?(d++,c[d].focus()):a.keyCode===b.KEY.ENTER||a.keyCode===b.KEY.RIGHT?e.classList.contains("dropdownTrigger")&&
e.dropdown&&e.dropdown.open():a.keyCode===b.KEY.LEFT&&e.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&this.close(!0),b.stop(a))}}else a.keyCode===b.KEY.ESCAPE&&(this.close(!0),b.stop(a))},submenuOpen:function(a){if(a!==this._selectedSubmenu)this._closeSelectedSubmenu(),this._selectedSubmenu=a},_closeSelectedSubmenu:function(){for(var a=this._selectedSubmenu;a;)a.close(),a=a._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&b.removeAutoDismiss(this._boundAutoDismiss)}};
c.prototype.constructor=c;return{Dropdown:c}});
define("text",["module"],function(d){var b,h,c=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],a=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,f=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,e=typeof location!=="undefined"&&location.href,p=e&&location.protocol&&location.protocol.replace(/\:/,""),g=e&&location.hostname,w=e&&(location.port||void 0),r=[],j=d.config&&d.config()||{};b={version:"2.0.5",strip:function(b){if(b){var b=b.replace(a,""),c=b.match(f);c&&(b=c[1])}else b="";return b},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:j.createXhr||function(){var a,b,d;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(b=0;b<3;b+=1){d=c[b];try{a=new ActiveXObject(d)}catch(e){}if(a){c=[d];break}}return a},parseName:function(a){var b,
c,d=!1,e=a.indexOf(".");b=a.indexOf("./")===0||a.indexOf("../")===0;e!==-1&&(!b||e>1)?(b=a.substring(0,e),c=a.substring(e+1,a.length)):b=a;a=c||b;e=a.indexOf("!");e!==-1&&(d=a.substring(e+1)==="strip",a=a.substring(0,e),c?c=a:b=a);return{moduleName:b,ext:c,strip:d}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,d,e){var f,g;f=b.xdRegExp.exec(a);if(!f)return!0;a=f[2];f=f[3];f=f.split(":");g=f[1];f=f[0];return(!a||a===c)&&(!f||f.toLowerCase()===d.toLowerCase())&&(!g&&!f||g===e)},finishLoad:function(a,
c,d,e){d=c?b.strip(d):d;j.isBuild&&(r[a]=d);e(d)},load:function(a,c,d,f){if(f.isBuild&&!f.inlineText)d();else{j.isBuild=f.isBuild;var h=b.parseName(a),f=h.moduleName+(h.ext?"."+h.ext:""),s=c.toUrl(f),x=j.useXhr||b.useXhr;!e||x(s,p,g,w)?b.get(s,function(c){b.finishLoad(a,h.strip,c,d)},function(a){d.error&&d.error(a)}):c([f],function(a){b.finishLoad(h.moduleName+"."+h.ext,h.strip,a,d)})}},write:function(a,c,d){if(r.hasOwnProperty(c)){var e=b.jsEscape(r[c]);d.asModule(a+"!"+c,"define(function () { return '"+
e+"';});\n")}},writeFile:function(a,c,d,e,f){var c=b.parseName(c),g=c.ext?"."+c.ext:"",h=c.moduleName+g,p=d.toUrl(c.moduleName+g)+".js";b.load(h,d,function(){var c=function(a){return e(p,a)};c.asModule=function(a,b){return e.asModule(a,p,b)};b.write(a,h,c,f)},f)}};if(j.env==="node"||!j.env&&typeof process!=="undefined"&&process.versions&&process.versions.node)h=require.nodeRequire("fs"),b.get=function(a,b){var c=h.readFileSync(a,"utf8");c.indexOf("\ufeff")===0&&(c=c.substring(1));b(c)};else if(j.env===
"xhr"||!j.env&&b.createXhr())b.get=function(a,c,d,e){var f=b.createXhr(),g;f.open("GET",a,!0);if(e)for(g in e)e.hasOwnProperty(g)&&f.setRequestHeader(g.toLowerCase(),e[g]);if(j.onXhr)j.onXhr(f,a);f.onreadystatechange=function(){var b;if(f.readyState===4)b=f.status,b>399&&b<600?(b=Error(a+" HTTP status: "+b),b.xhr=f,d(b)):c(f.responseText)};f.send(null)};else if(j.env==="rhino"||!j.env&&typeof Packages!=="undefined"&&typeof java!=="undefined")b.get=function(a,b){var c,d,e=new java.io.File(a),f=java.lang.System.getProperty("line.separator"),
e=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(e),"utf-8")),g="";try{c=new java.lang.StringBuffer;(d=e.readLine())&&d.length()&&d.charAt(0)===65279&&(d=d.substring(1));for(d!==null&&c.append(d);(d=e.readLine())!==null;)c.append(f),c.append(d);g=String(c.toString())}finally{e.close()}b(g)};return b});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'<button class="dropdownTrigger">${ButtonText}<\!--span class="dropdownArrowDown core-sprite-openarrow"></span--\></button><ul class="dropdownMenu"></ul>'});
define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'<button class="dropdownTrigger dropdownDefaultButton">${ButtonText}<span class="dropdownArrowDown core-sprite-openarrow"></span></button><ul class="dropdownMenu"></ul>'});define("text!orion/webui/submenutriggerbutton.html",[],function(){return'<li class="dropdownSubMenu"><span class="dropdownTrigger dropdownMenuItem" role="menuitem" tabindex="0"><span class="dropdownCommandName">${ButtonText}</span><span class="dropdownArrowRight core-sprite-closedarrow"></span></span><ul class="dropdownMenu"></ul></li>'});
define("text!orion/webui/checkedmenuitem.html",[],function(){return'<li><label class="dropdownMenuItem"><input class="checkedMenuItem" role="menuitem" type="checkbox" />${ItemText}</label></li>'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(d,b){function h(b){this._init(b)}h.prototype={_init:function(c){this._node=b.node(c.node);if(!this._node)throw"no dom node for tooltip found";this._position=c.position||["right","above","below","left"];this._text=c.text;this._hideDelay=c.hideDelay===void 0?200:c.hideDelay;this._tailSize=c.tailSize||10;this._trigger=c.trigger||"mouseover";this._afterShowing=c.afterShowing;this._afterHiding=c.afterHiding;var a=this;if(this._trigger===
"click")this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(c){c.target===a._node&&(a.show(),b.stop(c))},!1);else if(this._trigger==="mouseover"){this._showDelay=c.showDelay===void 0?500:c.showDelay;c=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(c){b.contains(a._node,c.target)&&(a.show(),b.stop(c))},!1);this._leaveHandler=function(c){b.contains(a._node,c.target)&&a.hide()};for(var d=0;d<c.length;d++)this._node.addEventListener(c[d],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text)this._tipTextContent=document.createElement("div"),this._tipTextContent.classList.add("textContent"),this._tipInner.appendChild(this._tipTextContent),this._tipTextContent.appendChild(document.createTextNode(this._text));this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var c=this;b.addAutoDismiss([this._tip,this._node],function(){c.hide()});if(this._trigger==="mouseover")this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(){if(c._timeout)window.clearTimeout(c._timeout),c._timeout=null;c._tip.addEventListener("mouseout",function(a){b.contains(c._tip,a.target)&&(c.hide(),b.stop(a))},
!1)},!1)}return this._tip},_positionTip:function(c,a){this._makeTipNode();c==="left"?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var d=this._node,e;for(e=b.bounds(d);d&&!e.width&&!e.height;d=d.parentNode)e=b.bounds(d);var d=b.bounds(this._tipInner),h;switch(c){case "above":h=e.top-d.height-this._tailSize-1;e=e.left-this._tailSize;break;case "below":h=e.top+e.height+this._tailSize+1;e=e.left-this._tailSize;break;case "left":h=e.top-this._tailSize/2;e=e.left-d.width-
this._tailSize-1;break;default:h=e.top-this._tailSize/2,e=e.left+e.width+this._tailSize+1}var g=b.bounds(document.documentElement);if(h+d.height>g.height)if(a)h=g.height-d.height-1;else return!1;if(e+d.width>g.width)if(a)e=g.width-d.width-1;else return!1;if(e<0)if(a)e=4;else return!1;if(h<0)if(a)h=4;else return!1;if(this._tail&&this._tail.previousPosition!==c)this._tip.removeChild(this._tail),this._tail=null;if(!this._tail){this._tail=document.createElement("span");this._tail.classList.add("tooltipTailFrom"+
c);c==="above"||c==="left"?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner);if(c==="left")this._tail.style.left=d.width+"px";this._tail.previousPosition=c}this._tip.style.top=h+"px";this._tip.style.left=e+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing")){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;this._showDelay?this._timeout=
window.setTimeout(this._showImmediately.bind(this),this._showDelay):this._showImmediately()}},_showImmediately:function(){for(var b=!1,a=0;!b&&a<this._position.length;)b=this._positionTip(this._position[a]),a++;b||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(b){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip&&this._tip.classList.contains("tooltipShowing")){if(b===void 0)b=
this._hideDelay;var a=this;this._timeout=window.setTimeout(function(){a._tip.classList.remove("tooltipShowing");a._tip.removeAttribute("style");a._afterHiding&&a._afterHiding()},b)}},destroy:function(){if(this._timeout)window.clearTimeout(this._timeout),this._timeout=null;if(this._tip)document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null;if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",
this._mouseoverHandler,!1);for(var b=["mouseout","click"],a=0;a<b.length;a++)this._node.removeEventListener(b[a],this._leaveHandler,!1)}}};h.prototype.constructor=h;return{Tooltip:h}});
define("orion/commands","orion/util,orion/webui/littlelib,orion/webui/dropdown,text!orion/webui/dropdowntriggerbutton.html,text!orion/webui/dropdowntriggerbuttonwitharrow.html,text!orion/webui/submenutriggerbutton.html,text!orion/webui/checkedmenuitem.html,orion/webui/tooltip".split(","),function(d,b,h,c,a,f,e,p){function g(a){var b=a.invocation;if(b){var c=a.command;if(c.hrefCallback)return a=c.hrefCallback.call(b.handler||window,b),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;else if(b.commandRegistry)return b.commandRegistry._invoke(b),
!0;else if(c.onClick||c.callback)return window.setTimeout(function(){(c.onClick||c.callback).call(b.handler||window,b)},0),!0}return!1}function w(a,c){for(var d in c)if(c[d]&&c[d].keyBinding&&c[d].command&&c[d].keyBinding.match(a)){var e=c[d],f=e.keyBinding;if((!f.domScope||b.contains(b.node(f.domScope),a.target))&&g(e)){b.stop(a);break}}}function r(){var a={};if(x){var b,c,d;c=Object.keys(t);for(b=0;b<c.length;b++)d=c[b],a[d]=t[d];var e=x();c=Object.keys(e);for(b=0;b<c.length;b++)d=c[b],a[d]=e[d]}else a=
t;return a}function j(a){w(a,r())}function k(a,b){a=a||window.event;if(function(a){if(d.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.ctrlKey)return!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(a.keyCode===65||a.keyCode===67||a.keyCode===86||a.keyCode===88||a.keyCode===90)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return a["char"].length>0;else if(a.charCode||a.keyCode)switch(a=
a.charCode||a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return a>=32&&a<112||a>123}return!1}(a)){if(a.target.contentEditable==="true")return;var c=a.target.nodeName.toLowerCase();if(c==="input")switch(a.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if(c==="textarea")return}b?b(a):j(a)}function m(){this._init()}
function v(a,b,c){b.classList.add("commandImage");var d;a.imageClass?a.addImageClassToElement?b.classList.add(a.imageClass):(d=document.createElement("span"),b.appendChild(d),d.classList.add(a.spriteClass),d.classList.add(a.imageClass)):(d=new Image,d.alt=a.name,d.name=c,d.id=c,d.src=a.image,b.appendChild(d));return d}function z(a,b){var c=document.createElement("span");c.classList.add("dropdownKeyBinding");c.appendChild(document.createTextNode(b));a.appendChild(c)}function y(a,b,c,d,e){this.commandRegistry=
e;this.handler=a;this.items=b;this.userData=c;this.command=d;if(d.parameters)this.parameters=d.parameters.makeCopy();this.id=d.id}function s(a){this._init(a)}var x=null,t={};m.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(c){return k(c,function(c){var d=a.proxy,e=a.bindings;if(e&&d)for(var f=0;f<e.length;f++)e[f].match(c)&&(d.processKey({type:c.type,keyCode:c.keyCode,altKey:c.altKey,
ctrlKey:c.ctrlKey,metaKey:c.metaKey,shiftKey:c.shiftKey}),b.stop(c))})})}};window.document.addEventListener("keydown",k,!1);y.prototype={collectsParameters:function(){return this.commandRegistry&&this.commandRegistry.collectsParameters()},makeCopy:function(a){var b=new y(this.handler,this.items,this.userData,this.command,this.commandRegistry);b.domNode=this.domNode;b.domParent=this.domParent;if(a)b.parameters=a.makeCopy();else if(this.parameters)b.parameters=this.parameters.makeCopy();return b}};
y.prototype.constructor=y;s.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;this.positioningNode=a.positioningNode;this.image=a.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.selectionClass=
a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,c,d,e,f){var d=this.getChoices(c,d,e),g=d.some(function(a){return a.checked});d.forEach(function(i){if(i.name){var d=document.createElement("li");a.appendChild(d);var e=document.createElement("span");e.tabIndex=0;e.role="menuitem";e.classList.add("dropdownMenuItem");if(g){var u=document.createElement("span");u.classList.add("check");
u.appendChild(document.createTextNode(i.checked?"\u25cf":""));e.appendChild(u)}u=document.createTextNode(i.name);e.appendChild(u);d.appendChild(e);e.choice=i;e.addEventListener("click",function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1);e.addEventListener("keydown",function(a){(a.keyCode===b.KEY.ENTER||a.keyCode===b.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1)}else f._generateMenuSeparator(a)})},getChoices:function(a,b,c){return this.choiceCallback?
this.choiceCallback.call(b,a,c):null},makeChoiceCallback:function(a,b){return function(c){a.callback&&a.callback.call(a,b,c)}},hasImage:function(){return this.imageClass||this.image!=="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"}};s.prototype.constructor=s;return{Command:s,CommandInvocation:y,createDropdownMenu:function(d,e,f,g,j,p,i,l,q){d=b.node(d);if(!d)throw"no parent node was specified";
var u=document.createRange();u.selectNode(d);u=q?u.createContextualFragment(a):u.createContextualFragment(c);b.processTextNodes(u,{ButtonText:e});d.appendChild(u);var d=d.lastChild,k;q?(q=d.previousSibling,k=q.lastChild):q=d.previousSibling;g?q.classList.add(g):(q.classList.add("orionButton"),q.classList.add("commandButton"));if(j){if(!p)q.textContent="",q.setAttribute("aria-label",e);v({spriteClass:"commandSprite",imageClass:j},q,e);q.classList.add("orionButton")}q.dropdown=new h.Dropdown({dropdown:d,
populate:f,selectionClass:i,skipTriggerEventListeners:!!k,positioningNode:l});d.dropdown=q.dropdown;return{menuButton:q,menu:d,dropdown:q.dropdown,dropdownArrow:k}},createCheckedMenuItem:function(a,c,d,f){a=b.node(a);if(!a)throw"no parent node was specified";var g=document.createRange();g.selectNode(a);g=g.createContextualFragment(e);b.processTextNodes(g,{ItemText:c});a.appendChild(g);a=b.$(".checkedMenuItem",a.lastChild);a.checked=d;a.addEventListener("change",f,!1);return a},createCommandItem:function(a,
b,c,d,e,f,i){var l,f=f||!b.name&&b.hasImage();if(b.hrefCallback)l=document.createElement("a"),l.id=d,f&&b.hasImage()?v(b,l,d):(l.className="commandLink",l.appendChild(document.createTextNode(b.name))),i=b.hrefCallback.call(c.handler,c),i.then?i.then(function(a){l.href=a}):l.href=i?i:"#";else{l=document.createElement("button");l.className="orionButton";f?b.hasImage()?(v(b,l,d),b.name&&l.setAttribute("aria-label",b.name)):(l.classList.add("commandButton"),l.classList.add("commandMissingImageButton"),
l.appendChild(document.createTextNode(b.name))):(l.classList.add("commandButton"),d=document.createTextNode(b.name),l.appendChild(d));var g=i||b.callback;if(g)b.onClick=g,l.addEventListener("click",function(){g.call(c.handler,c)},!1)}a.nodeName.toLowerCase()==="ul"?(i=document.createElement("li"),a.appendChild(i),a=i):l.classList.add("commandMargins");a.appendChild(l);if(b.tooltip)l.commandTooltip=new p.Tooltip({node:l,text:b.tooltip,position:["above","below","right","left"]});e&&(t[b.id]={keyBinding:e,
command:b,invocation:c});return l},createCommandMenuItem:function(a,c,d,e,f,g){var i,l=a.dropdown;if(c.hrefCallback){i=document.createElement("a");var q=document.createElement("span");q.appendChild(document.createTextNode(c.name));q.classList.add("dropdownCommandName");i.appendChild(q);f=c.hrefCallback.call(d.handler,d);f.then?f.then(function(a){i.href=a}):i.href=f?f:"#";i.addEventListener("keydown",function(a){(a.keyCode===b.KEY.ENTER||a.keyCode===b.KEY.SPACE)&&i.click()},!1)}else{i=document.createElement("span");
i.tabIndex=0;q=document.createElement("span");q.appendChild(document.createTextNode(c.name));q.classList.add("dropdownCommandName");i.appendChild(q);var u=f||c.callback;if(u)c.onClick=u,i.addEventListener("click",function(){l.close(!0);u.call(d.handler,d)},!1),i.addEventListener("keydown",function(a){if(a.keyCode===b.KEY.ENTER||a.keyCode===b.KEY.SPACE)a.preventDefault(),i.click()},!1)}i.className="dropdownMenuItem";i.role="menuitem";if(c.tooltip)i.commandTooltip=new p.Tooltip({node:i,text:c.tooltip,
position:["above","below","right","left"]});g&&z(i,g);g=document.createElement("li");a.appendChild(g);g.appendChild(i);e&&(t[c.id]={keyBinding:e,command:c,invocation:d});return i},executeBinding:g,setKeyBindingProvider:function(a){x=a},localKeyBindings:t,CommandsProxy:m,getKeyBindings:r,processKey:j,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",_testMethodProcessKey:w}});
define("orion/keyBinding",["orion/util"],function(d){function b(b,a,d,e,h,g){this.type=g||"keydown";this.keyCode=typeof b==="string"&&this.type==="keydown"?b.toUpperCase().charCodeAt(0):b;this.mod1=a!==void 0&&a!==null?a:!1;this.mod2=d!==void 0&&d!==null?d:!1;this.mod3=e!==void 0&&e!==null?e:!1;this.mod4=h!==void 0&&h!==null?h:!1}function h(b){this.keys=b}b.prototype={getKeys:function(){return[this]},match:function(b,a){if(a!==void 0){if(a!==0)return!1}else if(b instanceof Array){if(b.length>1)return!1;
b=b[0]}return b.type!==this.type?!1:this.keyCode===b.keyCode||this.keyCode===String.fromCharCode(d.isOpera?b.which:b.charCode!==void 0?b.charCode:b.keyCode)?this.mod1!==(d.isMac?b.metaKey:b.ctrlKey)?!1:this.type==="keydown"&&this.mod2!==b.shiftKey?!1:this.mod3!==b.altKey?!1:d.isMac&&this.mod4!==b.ctrlKey?!1:!0:!1},equals:function(b){return!b?!1:this.keyCode!==b.keyCode?!1:this.mod1!==b.mod1?!1:this.mod2!==b.mod2?!1:this.mod3!==b.mod3?!1:this.mod4!==b.mod4?!1:this.type!==b.type?!1:!0}};h.prototype=
{getKeys:function(){return this.keys.slice(0)},match:function(b,a){var d=this.keys;if(a!==void 0)return a>d.length?!1:d[a].match(b)?a===d.length-1?!0:a+1:!1;else{b instanceof Array||(b=[b]);if(b.length>d.length)return!1;var e;for(e=0;e<b.length;e++)if(!d[e].match(b[e]))return!1;return e===d.length?!0:e}},equals:function(b){if(!b.keys)return!1;if(b.keys.length!==this.keys.length)return!1;for(var a=0;a<b.keys.length;a++)if(!b.keys[a].equals(this.keys[a]))return!1;return!0}};return{KeyBinding:b,KeyStroke:b,
KeySequence:h}});
(function(){function d(a){if(typeof a!=="string")throw new TypeError;}function b(a){return a?a.split("&"):[]}function h(a){return a.length===0?"":a.join("&")}function c(a){var b=/([^=]*)(?:=?)(.*)/.exec(a),a=b[1]?decodeURIComponent(b[1]):"",b=b[2]?decodeURIComponent(b[2]):"";return[a,b]}function a(a){var b=encodeURIComponent(a[0]);a[1]&&(b+="="+encodeURIComponent(a[1]));return b}function f(a,d){var e="",f=[],g=0;return{next:function(){if(e!==a.query)e=a.query,f=b(e);if(g<f.length){var h=c(f[g++]);
switch(d){case "keys":return h[0];case "values":return h[1];case "keys+values":return[h[0],h[1]];default:throw new TypeError;}}throw C;}}}function e(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function p(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function g(a){var b=[];a.split("/").forEach(function(a){a===".."?b.pop():a!=="."&&b.push(a)});return b.join("/")}function w(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function r(a,b){if(typeof a!==
"string")throw new TypeError;var a=w(a),c=v.exec(a);if(!c)return null;var d={};d.scheme=c[1]||"";if(d.scheme&&!y.test(d.scheme))return null;var e=c[2];if(e&&(e=z.exec(e),d.userinfo=e[1],d.host=e[2],d.port=e[3],d.port&&!s.test(d.port)))return null;d.path=c[3];d.query=c[4];d.fragment=c[5];if(!d.scheme&&b&&(d.scheme=b.scheme,!d.host&&b.host))d.userinfo=b.userinfo,d.host=b.host,d.port=b.port,d.pathRelative=!0;if(d.pathRelative)if(d.path){if(d.path[0]!=="/")c=/^(.*\/)[^\/]*$/.exec(b.path)[1]||"/",d.path=
c+d.path}else d.path=b.path;if(d.scheme)d.scheme=d.scheme.toLowerCase();if(d.port)d.port=p(d.port);if(d.host&&d.path)d.path=g(d.path);return d}function j(a,b){var c;if(b){b=b.href||b;c=r(b);if(!c||!c.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:c})}c=r(a,c);if(!c)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:c,writable:!0});var d=new e(this);Object.defineProperty(this,"query",{get:function(){return this._url?
d:null},enumerable:!0})}try{var k;if(typeof window.URL==="function"&&window.URL.length!==0&&(k=new window.URL("http://www.w3.org?q")).protocol==="http:"&&k.query)return}catch(m){}var v=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,z=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,y=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,s=/^\d*$/,x=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,t=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,n=/^([^?#\s]*)$/,o=/^([^\s]*)$/,A=/^\S*$/,B=/([^:]*):?(.*)/,C=typeof StopIteration!==
"undefined"?StopIteration:Error("Stop Iteration"),D={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(e.prototype,{get:{value:function(a){d(a);var e;b(this._url.query).some(function(b){b=c(b);if(b[0]===a)return e=b[1],!0});return e},enumerable:!0},set:{value:function(e,f){d(e);d(f);var g=b(this._url.query);g.some(function(b,d){var h=c(b);if(h[0]===e)return h[1]=f,g[d]=a(h),!0})||g.push(a([e,f]));this._url.query=h(g)},enumerable:!0},has:{value:function(a){d(a);
return b(this._url.query).some(function(b){if(c(b)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){d(a);var e=b(this._url.query),f=e.filter(function(b){return c(b)[0]!==a});return f.length!==e.length?(this._url.query=h(f),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,b){if(typeof a!=="function")throw new TypeError;var c=f(this._url,"keys+values");try{for(;;){var d=c.next();a.call(b,d[1],d[0],this)}}catch(e){if(e!==C)throw e;
}},enumerable:!0},keys:{value:function(){return f(this._url,"keys")},enumerable:!0},values:{value:function(){return f(this._url,"values")},enumerable:!0},items:{value:function(){return f(this._url,"keys+values")}},size:{get:function(){return b(this._url.query).length},enumerable:!0},getAll:{value:function(a){d(a);var e=[];b(this._url.query).forEach(function(b){b=c(b);b[0]===a&&e.push(b[1])});return e},enumerable:!0},append:{value:function(c,e){d(c);d(e);var f=b(this._url.query);f.push(a([c,e]));this._url.query=
h(f)},enumerable:!0}});Object.defineProperties(j.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var b=a.scheme?a.scheme+":":"";a.host&&(b+="//",a.userinfo&&(b+=a.userinfo+"@"),b+=a.host,a.port&&(b+=":"+a.port));b+=a.path;a.query&&(b+="?"+a.query);a.fragment&&(b+="#"+a.fragment);a=b}else a=this._input;return a},set:function(a){d(a);this._input=a;this._url=r(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(a){d(a);if(this._url&&(a=a.slice(-1)===":"?a.substring(0,a.length-1):a,a===""||y.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){d(a);if(this._url)this._url.userinfo=a}},username:{get:function(){if(!this._url)return"";var a=B.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){d(a);if(this._url){var b=
B.exec(this._userinfo),a=[encodeURIComponent(a||"")];b[2]&&a.push(b[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=B.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){d(a);if(this._url){var b=[B.exec(this._userinfo)[1]||""];a&&b.push(encodeURIComponent(a));this._userinfo=b.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){d(a);if(this._url&&(a=t.exec(a)))this._url.host=a[1],this._url.port=p(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){d(a);if(this._url&&x.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===D[this.protocol]&&(a="");return a},set:function(a){d(a);if(this._url&&s.exec(a))this._url.port=p(a)},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){d(a);
if(this._url&&n.exec(a))this._url.host&&a&&a[0]!=="/"&&(a="/"+a),this._url.path=a?g(a):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){d(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),o.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){d(a);if(this._url&&(a&&a[0]==="#"&&(a=a.substring(1)),A.exec(a)))this._url.fragment=a},enumerable:!0}});
if((k=window.URL||window.webkitURL)&&k.createObjectURL)Object.defineProperty(j,"createObjectURL",{value:k.createObjectURL.bind(k),enumerable:!1}),Object.defineProperty(j,"revokeObjectURL",{value:k.revokeObjectURL.bind(k),enumerable:!1});window.URL=j})();define("orion/URL-shim",function(){});
define('built-imageViewerPlugin.js',"orion/plugin,orion/Deferred,orion/commands,orion/keyBinding,orion/webui/littlelib,orion/URL-shim".split(","),function(d,b,h,c,a){var f=new h.CommandsProxy,d=new d({name:"Orion Image Viewer Plugin",version:"1.0",description:"This plugin provides viewer for image files."});d.registerService("orion.edit.editor",{setBlob:function(b){var c=document.createElement("img"),d=URL.createObjectURL(b);c.src=d;c.onload=function(){URL.revokeObjectURL(d)};b=document.getElementById("imagecontent");
a.empty(b);b.appendChild(c)},setTextModel:function(a){f.setProxy(a);return new b},onChanged:function(){},registerKeys:function(a){var b=[];a.forEach(function(a){b.push(new c.KeyBinding(a.keyCode,a.mod1,a.mod2,a.mod3,a.mod4))});f.setKeyBindings(b)}},{id:"orion.viewer.image","default":!0,nameKey:"Orion Image Viewer",nls:"orion/nls/messages",uriTemplate:"../edit/edit.html#{,Location,params*},editor=orion.viewer.image"});d.registerService("orion.navigate.openWith",{},{editor:"orion.viewer.image",contentType:"image/gif,image/jpeg,image/ico,image/png,image/tiff,image/svg".split(",")});
d.connect()});