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

/*******************************************************************************
 * @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
 * 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
 ******************************************************************************/

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

 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) 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
*/
define("domReady",[],function(){function i(){if(!c){c=!0;d&&clearInterval(d);var a=e;if(c&&a.length){e=[];var l;for(l=0;l<a.length;l+=1)a[l](b)}}}function j(a){c?a(b):e.push(a);return j}var g,f,d,a=typeof window!=="undefined"&&window.document,c=!a,b=a?document:null,e=[];if(a){if(document.addEventListener)document.addEventListener("DOMContentLoaded",i,!1),window.addEventListener("load",i,!1);else if(window.attachEvent){window.attachEvent("onload",i);f=document.createElement("div");try{g=window.frameElement===
null}catch(l){}f.doScroll&&g&&window.external&&(d=setInterval(function(){try{f.doScroll(),i()}catch(b){}},30))}document.readyState==="complete"&&i()}j.version="2.0.1";j.load=function(b,a,e,l){l.isBuild?e(null):j(e)};return j});
(function(i,j){typeof define==="function"&&define.amd?define("orion/Deferred",j):typeof exports==="object"?module.exports=j():(i.orion=i.orion||{},i.orion.Deferred=j())})(this,function(){function i(){for(var a;a=c.shift()||b.shift();)a();e=!1}function j(a,d){(d?b:c).push(a);e||(e=!0,d?setTimeout(i,0):i())}function g(b){return function(){b.apply(null,arguments)}}function f(){}function d(){var b=Error("Cancel");b.name="Cancel";return b}function a(){function b(){for(var a;a=n.shift();){var d=a.deferred,
l=c==="resolved"?"resolve":"reject";if(typeof a[l]==="function")try{var h=a[l](e);h&&typeof h.then==="function"?(d.cancel=h.cancel||f,h.then(g(d.resolve),g(d.reject),d.progress)):d.resolve(h)}catch(r){d.reject(r)}else d[l](e)}}var e,c,n=[],k=this;this.reject=function(a){c||(c="rejected",e=a,n.length&&j(b));return k.promise};this.resolve=function(a){c||(c="resolved",e=a,n.length&&j(b));return k.promise};this.progress=function(b){c||n.forEach(function(a){a.progress&&a.progress(b)});return k.promise};
this.cancel=function(){c||k.reject(d())};this.then=function(e,d,f){var e={resolve:e,reject:d,progress:f,deferred:new a},h=e.deferred,r=!1,g=function(){r||(r=!0,j(function(){var b=h.cancel===g?k.cancel:h.cancel;typeof b==="function"&&b()},!0))};h.cancel=g;n.push(e);c&&j(b,!0);return h.promise};this.promise=Object.create(Object.prototype,{then:{value:k.then},cancel:{get:function(){return k.cancel},set:function(b){k.cancel=b}}})}var c=[],b=[],e=!1;a.all=function(b,e){function d(h,b){j||(g[h]=b,--f===
0&&i.resolve(g))}function c(h,b){if(!j){if(e)try{d(h,e(b));return}catch(a){b=a}i.reject(b)}}var f=b.length,g=[],j=!1,i=new a;i.then(null,function(){j=!0;b.forEach(function(h){h.cancel&&h.cancel()})});f===0?i.resolve(g):b.forEach(function(h,b){h.then(d.bind(null,b),c.bind(null,b))});return i.promise};a.when=function(b,e,d,c){var g;if(!(b&&typeof b.then==="function"))g=new a,g.resolve(b),b=g.promise;return b.then(e,d,c)};return a});
define("orion/xhr",["orion/Deferred"],function(i){function j(g,f,d,a){var c=typeof d.response!=="undefined"?d.response:d.responseText,b;try{b=d.status}catch(e){b=0}g={args:f,response:c,responseText:typeof c==="string"?c:null,status:b,url:g,xhr:d};if(typeof a!=="undefined")g.error=a;return g}return function(g,f,d){var d=d||{},a=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,c=new i,b=d.headers||{},e=d.log||!1,l;typeof b["X-Requested-With"]==="undefined"&&(b["X-Requested-With"]="XMLHttpRequest");
if(typeof d.data!=="undefined"&&(g==="POST"||g==="PUT"))l=d.data;a.onprogress=function(b){b.xhr=a;c.progress(b)};a.onreadystatechange=function(){if(a.readyState===4){var b=j(f,d,a),g=a.status;200<=g&&g<400?c.resolve(b):(e&&typeof console!=="undefined"&&console.log(Error(a.statusText)),c.reject(b))}};try{a.open(g,f,!0);if(typeof d.responseType==="string")a.responseType=d.responseType;if(typeof d.timeout==="number")if(typeof a.timeout==="number")a.timeout=d.timeout,a.addEventListener("timeout",function(){c.reject(j(f,
d,a,"Timeout exceeded"))});else{var s=setTimeout(function(){c.reject(j(f,d,a,"Timeout exceeded"))},d.timeout);c.then(clearTimeout.bind(null,s),clearTimeout.bind(null,s))}Object.keys(b).forEach(function(e){a.setRequestHeader(e,b[e])});a.send(l)}catch(t){c.reject(j(f,d,a,t))}return c.promise}});
define("orion/PageUtil",[],function(){var i=/^(?:[a-zA-Z0-9-_.!~*'()#;,\/?:@&=+$\[\]]|%[0-9A-F][0-9A-F])*$/,j=/^http[s]?/i;return{matchResourceParameters:function(g){var g=g||window.location.toString(),f={resource:""},d=g.indexOf("#");if(d!==-1&&(g=g.substring(d+1),g.length!==0)){g=g.split(",");Object.defineProperty(f,"resourceRaw",{value:g[0]});f.resource=decodeURIComponent(g[0]);if(!f.resource.match(i))f.resource=encodeURI(f.resource).replace(/%5B/g,"[").replace(/%5D/g,"]");for(d=1;d<g.length;d++){var a=
/([^=]*)(=?)(.*)/.exec(g[d]),c=decodeURIComponent(a[1]||""),a=decodeURIComponent(a[3]||"");c!==""&&c!=="resource"&&(f[c]=a)}}return f},validateURLScheme:function(g,f){var d=g;if(g.indexOf("://")===-1){var a=document.createElement("a");a.href=g;d=a.href}a=!1;return(a=f?f.some(function(a){return RegExp("^"+a+":","i").test(d)}):j.test(d))?g:(console.log("Illegal URL Scheme: '"+g+"'"),"")}}});
define("orion/webui/littlelib",[],function(){function i(b,a){a||(a=document);return a.querySelectorAll(b)}function j(b,a){var d=b.compareDocumentPosition(a);return b===a||Boolean(d&16)}function g(b){if(b.tabIndex>=0)return b;if(b.hasChildNodes())for(var a=0;a<b.childNodes.length;a++){var d=g(b.childNodes[a]);if(d)return d}return null}function f(b){if(b.tabIndex>=0)return b;if(b.hasChildNodes())for(var a=b.childNodes.length-1;a>=0;a--){var d=f(b.childNodes[a]);if(d)return d}return null}function d(b,
e){if(b.nodeType===3){var c=a.exec(b.nodeValue);c&&c.length>1&&e(b,c)}if(b.hasChildNodes())for(c=0;c<b.childNodes.length;c++)d(b.childNodes[c],e)}var a=/\$\{([^\}]+)\}/,c=[];return{$:function(b,a){a||(a=document);return a.querySelector(b)},$$:i,$$array:function(b,a){return Array.prototype.slice.call(i(b,a))},node:function(b){var a=b;typeof b==="string"&&(a=document.getElementById(b));return a},contains:j,bounds:function(b){b=b.getBoundingClientRect();return{left:b.left+document.body.scrollLeft,top:b.top+
document.body.scrollTop,width:b.width,height:b.height}},empty:function(b){for(;b.hasChildNodes();)b.removeChild(b.firstChild)},firstTabbable:g,lastTabbable:f,stop:function(b){window.document.all?b.keyCode=0:(b.preventDefault(),b.stopPropagation())},processTextNodes:function(b,a){d(b,function(b,d){b.parentNode.replaceChild(document.createTextNode(a[d[1]]||d[1]),b)})},processDOMNodes:function(b,a){d(b,function(b,d){var c=a[d[1]];if(c){var g=document.createRange(),f=d.index;g.setStart(b,f);g.setEnd(b,
f+d[0].length);g.deleteContents();g.insertNode(c)}})},addAutoDismiss:function(b,a){c.length===0&&document.addEventListener("click",function(b){for(var a=[],d=0;d<c.length;d++){var g=c[d].dismiss,e=!1,f;if(c[d].excludeNodes.every(function(a){return a&&(e=document.compareDocumentPosition(document,a)!==1)&&j(a,b.target)?(f=a,!1):!0})){try{g()}catch(i){typeof console!=="undefined"&&console&&console.error(i&&i.message)}e=document.compareDocumentPosition(document,f)!==1}e&&a.push(c[d])}c=a},!0);c.push({excludeNodes:b,
dismiss:a})},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}}});
(function(){var i=function(){function b(a){return Array.isArray?Array.isArray(a):a.constructor.toString().indexOf("Array")!=-1}function a(b,h,d,g){function e(a){for(var h=0;h<a.length;h++)if(a[h].win===b)return!0;return!1}var f=!1;if(h==="*")for(var p in c){if(c.hasOwnProperty(p)&&p!=="*"&&typeof c[p][d]=="object"&&(f=e(c[p][d])))break}else c["*"]&&c["*"][d]&&(f=e(c["*"][d])),!f&&c[h]&&c[h][d]&&(f=e(c[h][d]));if(f)throw"A channel is already bound to the same window which overlaps with origin '"+h+
"' and has scope '"+d+"'";typeof c[h]!="object"&&(c[h]={});typeof c[h][d]!="object"&&(c[h][d]=[]);c[h][d].push({win:b,handler:g})}var d=Math.floor(Math.random()*1000001),c={},g={},e=function(a){try{var b=JSON.parse(a.data);if(typeof b!="object"||b===null)throw"malformed";}catch(h){return}var d=a.source,a=a.origin,e,f,p;if(typeof b.method=="string"){var m=b.method.split("::");m.length==2?(e=m[0],p=m[1]):p=b.method}typeof b.id!="undefined"&&(f=b.id);if(typeof p=="string"){f=!1;if(c[a]&&c[a][e])for(m=
0;m<c[a][e].length;m++)if(c[a][e][m].win===d){c[a][e][m].handler(a,p,b);f=!0;break}if(!f&&c["*"]&&c["*"][e])for(m=0;m<c["*"][e].length;m++)if(c["*"][e][m].win===d){c["*"][e][m].handler(a,p,b);break}}else typeof f!="undefined"&&g[f]&&g[f](a,p,b)};window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent&&window.attachEvent("onmessage",e);return{build:function(e){var f=function(a){if(e.debugOutput&&window.console&&window.console.log){try{typeof a!="string"&&(a=JSON.stringify(a))}catch(b){}console.log("["+
i+"] "+a)}};if(!window.postMessage)throw"jschannel cannot run this browser, no postMessage";if(!window.JSON||!window.JSON.stringify||!window.JSON.parse)throw"jschannel cannot run this browser, no JSON parsing/serialization";if(typeof e!="object")throw"Channel build invoked without a proper object argument";if(!e.window||!e.window.postMessage)throw"Channel.build() called without a valid window argument";if(window===e.window)throw"target window is same as present window -- not allowed";var p=!1;if(typeof e.origin==
"string"){var j;e.origin==="*"?p=!0:null!==(j=e.origin.match(/^https?:\/\/(?:[-a-zA-Z0-9_\.])+(?::\d+)?/))&&(e.origin=j[0].toLowerCase(),p=!0)}if(!p)throw"Channel.build() called with an invalid origin";if(typeof e.scope!="undefined"){if(typeof e.scope!="string")throw"scope, when specified, must be a string";if(e.scope.split("::").length>1)throw"scope may not contain double colons: '::'";}var i=function(){for(var a="",b=0;b<5;b++)a+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(Math.random()*
62));return a}(),l={},o={},m={},q=!1,w=[],J=function(a,b,h){var d=!1,e=!1;return{origin:b,invoke:function(b,e){if(!m[a])throw"attempting to invoke a callback of a nonexistent transaction: "+a;for(var d=!1,c=0;c<h.length;c++)if(b===h[c]){d=!0;break}if(!d)throw"request supports no such callback '"+b+"'";n({id:a,callback:b,params:e})},error:function(b,h){e=!0;if(!m[a])throw"error called for nonexistent message: "+a;delete m[a];n({id:a,error:b,message:h})},complete:function(b){e=!0;if(!m[a])throw"complete called for nonexistent message: "+
a;delete m[a];n({id:a,result:b})},delayReturn:function(a){typeof a=="boolean"&&(d=a===!0);return d},completed:function(){return e}}},K=function(a,b,h){return window.setTimeout(function(){o[a]&&((0,o[a].error)("timeout_error","timeout ("+b+"ms) exceeded on method '"+h+"'"),delete o[a],delete g[a])},b)},B=function(a,d,c){if(typeof e.gotMessageObserver=="function")try{e.gotMessageObserver(a,c)}catch(p){f("gotMessageObserver() raised an exception: "+p.toString())}if(c.id&&d){if(l[d]){var q=J(c.id,a,c.callbacks?
c.callbacks:[]);m[c.id]={};try{if(c.callbacks&&b(c.callbacks)&&c.callbacks.length>0)for(a=0;a<c.callbacks.length;a++){for(var w=c.callbacks[a],j=c.params,r=w.split("/"),i=0;i<r.length-1;i++){var y=r[i];typeof j[y]!="object"&&(j[y]={});j=j[y]}j[r[r.length-1]]=function(){var a=w;return function(b){return q.invoke(a,b)}}()}var n=l[d](q,c.params);!q.delayReturn()&&!q.completed()&&q.complete(n)}catch(k){d="runtime_error";c=null;typeof k=="string"?c=k:typeof k=="object"&&(k&&b(k)&&k.length==2?(d=k[0],c=
k[1]):typeof k.error=="string"&&(d=k.error,k.message?typeof k.message=="string"?c=k.message:k=k.message:c=""));if(c===null)try{c=JSON.stringify(k),typeof c=="undefined"&&(c=k.toString())}catch(B){c=k.toString()}q.error(d,c)}}}else c.id&&c.callback?!o[c.id]||!o[c.id].callbacks||!o[c.id].callbacks[c.callback]?f("ignoring invalid callback, id:"+c.id+" ("+c.callback+")"):o[c.id].callbacks[c.callback](c.params):c.id?o[c.id]?(c.error?(0,o[c.id].error)(c.error,c.message):c.result!==void 0?(0,o[c.id].success)(c.result):
(0,o[c.id].success)(),delete o[c.id],delete g[c.id]):f("ignoring invalid response: "+c.id):d&&l[d]&&l[d](null,c.params)};a(e.window,e.origin,typeof e.scope=="string"?e.scope:"",B);var C=function(a){typeof e.scope=="string"&&e.scope.length&&(a=[e.scope,a].join("::"));return a},n=function(a,b){if(!a)throw"postMessage called with null message";f((q?"post  ":"queue ")+" message: "+JSON.stringify(a));if(!b&&!q)w.push(a);else{if(typeof e.postMessageObserver=="function")try{e.postMessageObserver(e.origin,
a)}catch(c){f("postMessageObserver() raised an exception: "+c.toString())}e.window.postMessage(JSON.stringify(a),e.origin)}},k={unbind:function(a){if(l[a]){if(delete l[a])return!0;throw"can't delete method: "+a;}return!1},bind:function(a,b){if(!a||typeof a!="string")throw"'method' argument to bind must be string";if(!b||typeof b!="function")throw"callback missing from bind params";if(l[a])throw"method '"+a+"' is already bound!";l[a]=b;return this},call:function(a){if(!a)throw"missing arguments to call function";
if(!a.method||typeof a.method!="string")throw"'method' argument to call must be string";if(!a.success||typeof a.success!="function")throw"'success' callback missing from call";var b={},c=[],h=function(a,d){if(typeof d=="object")for(var e in d)if(d.hasOwnProperty(e)){var m=a+(a.length?"/":"")+e;typeof d[e]=="function"?(b[m]=d[e],c.push(m),delete d[e]):typeof d[e]=="object"&&h(m,d[e])}};h("",a.params);var e={id:d,method:C(a.method),params:a.params};c.length&&(e.callbacks=c);a.timeout&&K(d,a.timeout,
C(a.method));o[d]={callbacks:b,error:a.error,success:a.success};g[d]=B;d++;n(e)},notify:function(a){if(!a)throw"missing arguments to notify function";if(!a.method||typeof a.method!="string")throw"'method' argument to notify must be string";n({method:C(a.method),params:a.params})},destroy:function(){for(var a=e.window,b=e.origin,d=typeof e.scope=="string"?e.scope:"",h=c[b][d],g=0;g<h.length;g++)h[g].win===a&&h.splice(g,1);c[b][d].length===0&&delete c[b][d];window.removeEventListener?window.removeEventListener("message",
B,!1):window.detachEvent&&window.detachEvent("onmessage",B);q=!1;l={};m={};o={};e.origin=null;w=[];f("channel destroyed");i=""}};k.bind("__ready",function(a,b){f("ready msg received");if(q)throw"received ready message while in ready state.  help!";for(b==="ping"?i+="-R":i+="-L",k.unbind("__ready"),q=!0,f("ready msg accepted."),b==="ping"&&k.notify({method:"__ready",params:"pong"});w.length;)n(w.pop());typeof e.onReady=="function"&&e.onReady(k)});setTimeout(function(){},0);return k}}}();WinChan=function(){function a(b){/^https?:\/\//.test(b)||
(b=window.location.href);var c=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(b);return c?c[1]:b}function b(){try{var a=navigator.userAgent;return a.indexOf("Fennec/")!=-1||a.indexOf("Firefox/")!=-1&&a.indexOf("Android")!=-1}catch(c){}return!1}function c(a,b,d){a.attachEvent?a.attachEvent("on"+b,d):a.addEventListener&&a.addEventListener(b,d,!1)}var d="die",e=function(){var a=-1;navigator.appName==="Microsoft Internet Explorer"&&/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)!=null&&(a=parseFloat(RegExp.$1));
return a>=8}();return window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage?{open:function(f,g){function j(a){try{var b=JSON.parse(a.data);if(b.a==="ready")o.postMessage(q,n);else if(b.a==="error")g&&(g(b.d),g=null);else if(b.a==="response"){var a=window,c=j;a.detachEvent?a.detachEvent("onmessage",c):a.removeEventListener&&a.removeEventListener("message",c,!1);a=window;c=i;a.detachEvent?a.detachEvent("onunload",c):a.removeEventListener&&a.removeEventListener("unload",c,!1);i();
g&&(g(null,b.d),g=null)}}catch(d){}}function i(){l&&document.body.removeChild(l);l=void 0;if(m)try{m.close()}catch(a){o.postMessage(d,n)}m=o=void 0}if(!g)throw"missing required callback argument";var k;f.url||(k="missing required 'url' parameter");f.relay_url||(k="missing required 'relay_url' parameter");k&&setTimeout(function(){g(k)},0);f.window_name||(f.window_name=null);if(!f.window_features||b())f.window_features=void 0;var l,n=a(f.url);if(n!==a(f.relay_url))return setTimeout(function(){g("invalid arguments: origin of url and relay_url must match")},
0);var o;e&&(l=document.createElement("iframe"),l.setAttribute("src",f.relay_url),l.style.display="none",l.setAttribute("name","__winchan_relay_frame"),document.body.appendChild(l),o=l.contentWindow);var m=window.open(f.url,f.window_name,f.window_features);o||(o=m);var q=JSON.stringify({a:"request",d:f.params});c(window,"unload",i);c(window,"message",j);return{close:i,focus:function(){if(m)try{m.focus()}catch(a){}}}}}:{open:function(a,b,c,d){setTimeout(function(){d("unsupported browser")},0)}}}();
var j=function(){var a=window,b=navigator,c;return{setTestEnv:function(c,d){b=c;a=d},isSupported:function(){var d;var e;e=-1;b.appName=="Microsoft Internet Explorer"&&/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(b.userAgent)!=null&&(e=parseFloat(RegExp.$1));e>-1&&e<8&&(d="BAD_IE_VERSION");if(!d){var f;try{"localStorage"in a&&a.localStorage!==null?(a.localStorage.setItem("test","true"),a.localStorage.removeItem("test")):f="LOCALSTORAGE_NOT_SUPPORTED"}catch(g){f="LOCALSTORAGE_DISABLED"}if(!f){var j;a.postMessage||
(j="POSTMESSAGE_NOT_SUPPORTED");j||(j=!window.JSON||!window.JSON.stringify||!window.JSON.parse?"JSON_NOT_SUPPORTED":void 0);f=j}d=f}c=d;return!c},getNoSupportReason:function(){return c}}}();navigator.id||(navigator.id={});if(!navigator.id.request||navigator.id._shimmed){var g=navigator.userAgent,f=g.indexOf("Fennec/")!=-1||g.indexOf("Firefox/")!=-1&&g.indexOf("Android")!=-1?void 0:"menubar=0,location=1,resizable=1,scrollbars=1,status=0,dialog=1,minimizable=1,width=700,height=375",d,a={login:null,
logout:null,ready:null},c=void 0,b=function(a){if(c===void 0)c=a;else if(c!=a)throw"you cannot combine the navigator.id.watch() API with navigator.id.getVerifiedEmail() or navigator.id.get()this site should instead use navigator.id.request() and navigator.id.watch()";},e,l=j.isSupported(),s=function(){if(l)try{if(!e){var b=window.document,c=b.createElement("iframe");c.style.display="none";b.body.appendChild(c);c.src="https://login.persona.org/communication_iframe";e=i.build({window:c.contentWindow,
origin:"https://login.persona.org",scope:"mozid_ni",onReady:function(){e.call({method:"loaded",success:function(){a.ready&&a.ready()},error:function(){}})}});e.bind("logout",function(){a.logout&&a.logout()});e.bind("login",function(b,c){a.login&&a.login(c)})}}catch(d){e=void 0}},t=function(a){return typeof a!="undefined"},n=function(a){try{console.warn(a)}catch(b){}},k=function(a,b){if(t(a[b]))return n(b+" has been deprecated"),!0},A=function(a,b,c){if(t(a[b])&&t(a[c]))throw"you cannot supply *both* "+
b+" and "+c;k(a,b)&&(a[c]=a[b],delete a[b])},u=function(b){if(typeof b=="object"){if(b.onlogin&&typeof b.onlogin!="function"||b.onlogout&&typeof b.onlogout!="function"||b.onready&&typeof b.onready!="function")throw"non-function where function expected in parameters to navigator.id.watch()";if(!b.onlogin)throw"'onlogin' is a required argument to navigator.id.watch()";if(!b.onlogout)throw"'onlogout' is a required argument to navigator.id.watch()";a.login=b.onlogin||null;a.logout=b.onlogout||null;a.ready=
b.onready||null;s();A(b,"loggedInEmail","loggedInUser");typeof b.loggedInUser!="undefined"&&e&&e.notify({method:"loggedInUser",params:b.loggedInUser})}},x=function(b){k(b,"requiredEmail");A(b,"tosURL","termsOfService");A(b,"privacyURL","privacyPolicy");b.termsOfService&&!b.privacyPolicy&&n("termsOfService ignored unless privacyPolicy also defined");b.privacyPolicy&&!b.termsOfService&&n("privacyPolicy ignored unless termsOfService also defined");if(d)try{d.focus()}catch(c){}else if(j.isSupported())e&&
e.notify({method:"dialog_running"}),d=WinChan.open({url:"https://login.persona.org/sign_in",relay_url:"https://login.persona.org/relay",window_features:f,window_name:"__persona_dialog",params:{method:"get",params:b}},function(c,f){e&&(!c&&f&&f.email&&e.notify({method:"loggedInUser",params:f.email}),e.notify({method:"dialog_complete"}));d=void 0;if(!c&&f&&f.assertion)try{a.login&&a.login(f.assertion)}catch(g){}if(c==="client closed window"||!f)b&&b.oncancel&&b.oncancel(),delete b.oncancel});else{var g=
"unsupported_dialog";j.getNoSupportReason()==="LOCALSTORAGE_DISABLED"&&(g="cookies_disabled");d=window.open("https://login.persona.org/"+g,null,f)}};navigator.id={request:function(a){if(this!=navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");a=a||{};b(!1);a.returnTo||(a.returnTo=document.location.pathname);return x(a)},watch:function(a){if(this!=navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");b(!1);u(a)},logout:function(a){if(this!=
navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");s();e&&e.notify({method:"logout"});typeof a=="function"&&setTimeout(a,0)},get:function(c,d){var e={};d=d||{};e.privacyPolicy=d.privacyPolicy||void 0;e.termsOfService=d.termsOfService||void 0;e.privacyURL=d.privacyURL||void 0;e.tosURL=d.tosURL||void 0;k(d,"silent")?c&&setTimeout(function(){c(null)},0):(b(!0),u({onlogin:function(a){c&&(c(a),c=null)},onlogout:function(){}}),e.oncancel=function(){c&&(c(null),c=
null);a.login=a.logout=a.ready=null},x(e))},getVerifiedEmail:function(a){n("navigator.id.getVerifiedEmail has been deprecated");b(!0);navigator.id.get(a)},_shimmed:!0}}})();define("persona/include",function(){});
define('built-LoginWindow.js',["domReady","orion/xhr","orion/PageUtil","orion/webui/littlelib","persona/include"],function(i,j,g,f){function d(a){a=RegExp("[\\?&]"+a+"=([^&#]*)").exec(window.location.href);return a===null?void 0:a[1]}function a(a){for(var b="",c,d,e,f,g,h=0,a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<a.length;)c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),
f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a.charAt(h++)),c=c<<2|d>>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b+=String.fromCharCode(c),f!==64&&(b+=String.fromCharCode(d)),g!==64&&(b+=String.fromCharCode(e));b=b.replace(/\r\n/g,"\n");a="";for(f=0;f<b.length;f++)g=b.charCodeAt(f),g<128?a+=String.fromCharCode(g):(g>127&&g<2048?a+=String.fromCharCode(g>>6|192):(a+=String.fromCharCode(g>>
12|224),a+=String.fromCharCode(g>>6&63|128)),a+=String.fromCharCode(g&63|128));return a}function c(a){if(typeof a!=="undefined")document.getElementById("errorMessage").textContent=a;document.getElementById("errorWin").style.visibility=""}function b(){document.getElementById("errorMessage").textContent="\u00a0";document.getElementById("errorWin").style.visibility="hidden"}function e(){var a;if(document.getElementById("reset").value===""&&document.getElementById("resetEmail").value==="")c("Provide username or email to reset.");
else{var d=new XMLHttpRequest;d.onreadystatechange=function(){b();if(d.readyState===4)if(d.status===200)a=JSON.parse(d.responseText),a.Message?c(a.Message):c();else{try{if(a=JSON.parse(d.responseText),a.Message){c(a.Message);return}}catch(e){}c(d.statusText)}};d.open("POST","../useremailconfirmation",!0);d.setRequestHeader("Content-type","application/x-www-form-urlencoded");d.setRequestHeader("Orion-Version","1");d.send("{login='"+document.getElementById("reset").value+"', email='"+document.getElementById("resetEmail").value+
"'}");c("Sending password reset confirmation...")}}function l(){var a=/[\?&]redirect=([^&#]*)/.exec(window.location.href);return a===null?null:a[1]}function s(){var a=l();if(a!==null&&(a=decodeURIComponent(a),g.validateURLScheme(a))){window.location=decodeURIComponent(a);return}window.close()}function t(a){if(a!==""&&a!==null){var b=l();return b!==null&&g.validateURLScheme(decodeURIComponent(b))?"../login/openid?openid="+encodeURIComponent(a)+"&redirect="+b:"../login/openid?openid="+encodeURIComponent(a)}}
function n(a){var b=!1;if(a.type==="click"||a.keyCode===13)b=!0;a.stopPropagation();return b}function k(a){n(a)&&(o=!0,navigator.id.request())}function A(){navigator.id.watch({loggedInUser:null,onlogin:function(a){o&&j("POST","../login/persona",{headers:{"Content-type":"application/x-www-form-urlencoded","Orion-Version":"1"},data:"assertion="+encodeURIComponent(a)}).then(function(){s()},function(a){c(JSON.parse(a.responseText).error)})},onlogout:function(){}})}function u(a,b){if(!a)a=document.getElementById("login").value,
b=document.getElementById("password").value;if(a.length>0&&b.length>0){var d=new XMLHttpRequest;d.onreadystatechange=function(){if(d.readyState===4)if(d.status!==200&&window.location.href.indexOf("http")!==-1){var a=JSON.parse(d.responseText);c(a.error)}else s()};var e="login="+encodeURIComponent(a)+"&password="+encodeURIComponent(b);d.open("POST","../login/form",!0);d.setRequestHeader("Content-type","application/x-www-form-urlencoded");d.setRequestHeader("Orion-Version","1");d.send(e)}}function x(){if(document.getElementById("create_password").value!==
document.getElementById("create_passwordRetype").value)return c("Passwords don't match!"),!1;b();return!0}function h(){document.getElementById("newUserHeaderShown").style.visibility="hidden";document.getElementById("orionOpen").style.visibility="";if(z||v)document.getElementById("orionRegister").style.visibility="";document.getElementById("registerButton").focus()}function r(){if(x()){document.getElementById("create_password").setAttribute("aria-invalid","false");document.getElementById("create_passwordRetype").setAttribute("aria-invalid",
"false");var a=new XMLHttpRequest,b=document.getElementById("create_login").value,d=document.getElementById("create_password").value,e=document.getElementById("create_email").value;a.onreadystatechange=function(){if(a.readyState===4)if(a.status!==200&&window.location.href.indexOf("http")!==-1){if(a.responseText){var e=JSON.parse(a.responseText);c(e.Message);a.status===201&&h()}}else u(b,d)};e="login="+encodeURIComponent(b)+"&password="+encodeURIComponent(d)+"&email="+encodeURIComponent(e);a.open("POST",
"../users",!0);a.setRequestHeader("Content-type","application/x-www-form-urlencoded");a.setRequestHeader("Orion-Version","1");a.send(e)}else document.getElementById("create_password").setAttribute("aria-invalid","true"),document.getElementById("create_passwordRetype").setAttribute("aria-invalid","true")}function y(a){if(n(a))!z&&v?window.open(v):(document.getElementById("orionOpen").style.visibility="hidden",document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("orionLoginForm").style.visibility=
"hidden",document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("newUserHeaderShown").style.visibility="",document.getElementById("create_login").focus())}function G(){document.getElementById("orionLoginForm").style.visibility="hidden";if(!z&&!v)document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("orionReset").style.height="212px";document.getElementById("newUserHeaderShown").style.display="none";document.getElementById("orionReset").style.visibility=
"";document.getElementById("reset").focus()}function I(){document.getElementById("orionLoginForm").style.visibility="";document.getElementById("newUserHeaderShown").style.display="";document.getElementById("orionReset").style.visibility="hidden"}function p(){window.open("/mixloginstatic/ServerStatus.html")}function D(a){if(n(a))a.stopPropagation(),document.getElementById("orionOpen").style.visibility="hidden",document.getElementById("orionRegister").style.visibility="hidden",document.getElementById("orionLoginForm").style.visibility=
"",document.getElementById("login").focus()}function E(){document.getElementById("orionLoginForm").style.visibility="hidden";document.getElementById("orionOpen").style.visibility="";if(z||v)document.getElementById("orionRegister").style.visibility="";document.getElementById("orionLogin").focus();b()}function H(a){n(a)&&a.srcElement.click()}var z,v,F,o=!1;i(function(){A(document.getElementById("personaLogin"));var b=d("error");b&&(b=a(b),c(b));var g=new XMLHttpRequest;g.onreadystatechange=function(){if(g.readyState===
4&&g.status===200){var a=JSON.parse(g.responseText);z=a.CanAddUsers;F=a.ForceEmail;document.getElementById("create_email").setAttribute("aria-required",F);v=a.RegistrationURI;if(!z&&!v)document.getElementById("orionRegister").style.visibility="hidden";document.getElementById("login-window").style.display="";document.getElementById("orionLogin").focus()}};g.open("POST","../login/canaddusers",!0);g.setRequestHeader("Content-type","application/x-www-form-urlencoded");g.setRequestHeader("Orion-Version",
"1");g.send();var i=new XMLHttpRequest;i.onreadystatechange=function(){if(i.readyState===4&&i.status===200&&JSON.parse(i.responseText).emailConfigured===!1)document.getElementById("resetUserLink").style.display="none"};i.open("POST","../useremailconfirmation/cansendemails",!0);i.setRequestHeader("Content-type","application/x-www-form-urlencoded");i.setRequestHeader("Orion-Version","1");i.send();j("GET","../server-status.json",{timeout:15E3}).then(function(a){a=JSON.parse(a.response).messages;if(a.length>
0){var b=new Date,c=new Date(a[0].startdate);c.setHours(0,0,0,0);if(!(c>b)&&(c=new Date(a[0].enddate),c.setHours(23,59,59),!(c<=b)))document.getElementById("orionInfoArea").style.visibility="",document.getElementById("orionInfoMessage").textContent=a[0].title}},function(){});document.getElementById("login").addEventListener("keypress",function(a){a.keyCode===f.KEY.ENTER&&(u(),f.stop(a))});document.getElementById("password").addEventListener("keypress",function(a){a.keyCode===f.KEY.ENTER&&(u(),f.stop(a))});
document.getElementById("loginButton").addEventListener("click",function(){u()});document.getElementById("orionLoginForm").addEventListener("keyup",function(a){a.keyCode===f.KEY.ESCAPE&&(E(),f.stop(a))});document.getElementById("orionInfoArea").addEventListener("click",p);document.getElementById("orionInfoArea").onclick=p;document.getElementById("resetUserLink").addEventListener("click",G);document.getElementById("reset").addEventListener("keypress",function(a){a.keyCode===f.KEY.ENTER&&(e(),f.stop(a))});
document.getElementById("resetEmail").addEventListener("keypress",function(a){a.keyCode===f.KEY.ENTER&&(e(),f.stop(a))});document.getElementById("registerButton").addEventListener("click",y);document.getElementById("registerButton").addEventListener("keydown",y);document.getElementById("create_password").addEventListener("keyup",function(a){a.keyCode===f.KEY.ENTER?r():x()});document.getElementById("create_passwordRetype").addEventListener("keyup",function(a){a.keyCode===f.KEY.ENTER?r():x()});document.getElementById("newUserHeaderShown").addEventListener("keyup",
function(a){a.keyCode===f.KEY.ESCAPE&&h()});document.getElementById("createButton").addEventListener("click",r);document.getElementById("cancelLoginButton").addEventListener("click",E);document.getElementById("newUserHeaderShown").onkeyup=function(a){a.keyCode===f.KEY.ESCAPE&&h()};document.getElementById("hideRegisterButton").addEventListener("click",h);document.getElementById("googleLoginLink").href=t("https://www.google.com/accounts/o8/id");document.getElementById("googleLogin").addEventListener("keydown",
H);document.getElementById("orionLoginLink").addEventListener("click",D);document.getElementById("orionLogin").onkeydown=D;document.getElementById("personaLogin").onclick=k;document.getElementById("personaLogin").onkeydown=k;document.getElementById("cancelResetButton").onclick=I;document.getElementById("sendResetButton").onclick=e})});