define("domReady",[],function(){function e(){if(!g){g=!0;d&&clearInterval(d);var b=a;if(g&&b.length){a=[];var h;for(h=0;h<b.length;h+=1)b[h](n)}}}function f(h){g?h(n):a.push(h);return f}var l,c,d,b="undefined"!==typeof window&&window.document,g=!b,n=b?document:null,a=[];if(b){if(document.addEventListener)document.addEventListener("DOMContentLoaded",e,!1),window.addEventListener("load",e,!1);else if(window.attachEvent){window.attachEvent("onload",e);c=document.createElement("div");try{l=null===window.frameElement}catch(h){}c.doScroll&&
l&&window.external&&(d=setInterval(function(){try{c.doScroll(),e()}catch(a){}},30))}"complete"===document.readyState&&e()}f.version="2.0.1";f.load=function(a,h,b,c){c.isBuild?b(null):f(b)};return f});
(function(e,f){"function"===typeof define&&define.amd?define("orion/Deferred",f):"object"===typeof exports?module.exports=f():(e.orion=e.orion||{},e.orion.Deferred=f())})(this,function(){function e(){for(var c;c=d.shift();)c();b=!1}function f(c){d.push(c);b||(b=!0,g())}function l(b){return function(a){b(a)}}function c(){function b(){for(var a;a=e.shift();){var k=a.deferred,h="fulfilled"===p?"resolve":"reject";a=a[h];if("function"===typeof a)try{var c=a(g),u=c&&("object"===typeof c||"function"===typeof c)&&
c.then;if("function"===typeof u)if(c===k.promise)k.reject(new TypeError);else{var d=c.cancel;"function"===typeof d?k._parentCancel=d.bind(c):delete k._parentCancel;u.call(c,l(k.resolve),l(k.reject),l(k.progress))}else k.resolve(c)}catch(m){k.reject(m)}else k[h](g)}}function a(a){delete m._parentCancel;p="rejected";g=a;e.length&&f(b)}function h(d){function k(a){return function(k){(!p||"assumed"===p)&&a(k)}}delete m._parentCancel;try{var v=d&&("object"===typeof d||"function"===typeof d)&&d.then;if("function"===
typeof v)if(d===m)a(new TypeError);else{p="assumed";var r=d&&d.cancel;if("function"!==typeof r){var u=new c;d=u.promise;try{v(u.resolve,u.reject,u.progress)}catch(l){u.reject(l)}r=d.cancel;v=d.then}g=d;v.call(d,k(h),k(a));m._parentCancel=r.bind(d)}else p="fulfilled",g=d,e.length&&f(b)}catch(x){k(a)(x)}}function d(){var b=m._parentCancel;b?(delete m._parentCancel,b()):p||(b=Error("Cancel"),b.name="Cancel",a(b))}var g,p,e=[],m=this;this.resolve=function(a){p||h(a);return m};this.reject=function(b){p||
a(b);return m};this.progress=function(a){p||e.forEach(function(k){if(k.progress)try{k.progress(a)}catch(b){}});return m.promise};this.cancel=function(){m._parentCancel?setTimeout(d,0):d();return m};this.then=function(a,k,d){var h=new c;h._parentCancel=m.promise.cancel;e.push({resolve:a,reject:k,progress:d,deferred:h});("fulfilled"===p||"rejected"===p)&&f(b);return h.promise};this.promise={then:m.then,cancel:m.cancel}}var d=[],b=!1,g=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var b=
process.nextTick;return function(){b(e)}}if("function"===typeof MutationObserver){var a=document.createElement("div");(new MutationObserver(e)).observe(a,{attributes:!0});return function(){a.setAttribute("class","_tick")}}return function(){setTimeout(e,0)}}();c.all=function(b,a){function h(a,k){e||(g[a]=k,0===--f&&m.resolve(g))}function d(b,k){if(!e){if(a)try{h(b,a(k));return}catch(c){k=c}m.reject(k)}}var f=b.length,g=[],e=!1,m=new c;m.then(void 0,function(){e=!0;b.forEach(function(a){a.cancel&&a.cancel()})});
0===f?m.resolve(g):b.forEach(function(a,k){a.then(h.bind(void 0,k),d.bind(void 0,k))});return m.promise};c.when=function(b,a,d,f){var g;b&&"function"===typeof b.then||(g=new c,g.resolve(b),b=g.promise);return b.then(a,d,f)};return c});
define("orion/xhr",["orion/Deferred"],function(e){function f(f,c,d,b){var g="undefined"!==typeof d.response?d.response:d.responseText,e;try{e=d.status}catch(a){e=0}f={args:c,response:g,responseText:"string"===typeof g?g:null,status:e,url:f,xhr:d};"undefined"!==typeof b&&(f.error=b);return f}return function(l,c,d){d=d||{};var b=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,g=new e,n=d.headers||{},a=d.log||!1,h;"undefined"===typeof n["X-Requested-With"]&&(n["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof d.data&&("POST"===l||"PUT"===l))h=d.data;var r=!1,t=!1;g.promise.then(void 0,function(a){r=!0;!t&&a instanceof Error&&"Cancel"===a.name&&b.abort()});b.onabort=function(){t=!0;if(!r){var a=Error("Cancel");a.name="Cancel";g.reject(a)}};b.onload=function(){var h=f(c,d,b);200<=b.status&&400>b.status?g.resolve(h):(g.reject(h),a&&"undefined"!==typeof console&&console.log(Error(b.statusText)))};b.onerror=function(){var h=f(c,d,b);g.reject(h);a&&"undefined"!==typeof console&&console.log(Error(b.statusText))};
b.onprogress=function(a){a.xhr=b;g.progress(a)};try{b.open(l,c,!0);"string"===typeof d.responseType&&(b.responseType=d.responseType);if("number"===typeof d.timeout)if("number"===typeof b.timeout)b.timeout=d.timeout,b.addEventListener("timeout",function(a){g.reject(f(c,d,b,"Timeout exceeded"))});else{var p=setTimeout(function(){g.reject(f(c,d,b,"Timeout exceeded"))},d.timeout);g.promise.then(clearTimeout.bind(null,p),clearTimeout.bind(null,p))}Object.keys(n).forEach(function(a){b.setRequestHeader(a,
n[a])});b.send(h||null)}catch(y){g.reject(f(c,d,b,y))}return g.promise}});
define("orion/PageUtil",[],function(){var e=/^http[s]?/i;return{hash:function(){var f=window.location.href.split("#")[1];return f?"#"+f:""},matchResourceParameters:function(f){f=f||window.location.toString();var e={resource:""},c=f.indexOf("#");if(-1!==c&&(f=f.substring(c+1),0!==f.length)){f=f.split(",");e.resource=decodeURIComponent(f[0]);for(c=1;c<f.length;c++){var d=/([^=]*)(=?)(.*)/.exec(f[c]),b=decodeURIComponent(d[1]||""),d=decodeURIComponent(d[3]||"");""!==b&&"resource"!==b&&(e[b]=d)}}return e},
validateURLScheme:function(f,l){var c=f;if(-1===f.indexOf("://")){var d=document.createElement("a");d.href=f;c=d.href}d=!1;if(d=l?l.some(function(b){return RegExp("^"+b+":","i").test(c)}):e.test(c))return f;console.log("Illegal URL Scheme: '"+f+"'");return""}}});
define("orion/util",[],function(){var e=navigator.userAgent,f=-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident")?document.documentMode:void 0,l=parseFloat(e.split("Firefox/")[1]||e.split("Minefield/")[1])||void 0,c=-1!==e.indexOf("Opera")?parseFloat(e.split("Version/")[1]):void 0,d=parseFloat(e.split("Chrome/")[1])||void 0,b=-1!==e.indexOf("Safari")&&!d,g=parseFloat(e.split("WebKit/")[1])||void 0,n=-1!==e.indexOf("Android"),a=-1!==e.indexOf("iPad"),e=-1!==e.indexOf("iPhone"),h=a||e,r=-1!==navigator.platform.indexOf("Mac"),
t=-1!==navigator.platform.indexOf("Win"),p=-1!==navigator.platform.indexOf("Linux"),y="ontouchstart"in document.createElement("input");return{formatMessage:function(a){var b=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,h){return b[(h<<0)+1]})},createElement:function(a,b){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",b):a.createElement(b)},isIE:f,isFirefox:l,isOpera:c,isChrome:d,isSafari:b,isWebkit:g,isAndroid:n,isIPad:a,isIPhone:e,isIOS:h,isMac:r,isWindows:t,
isLinux:p,isTouch:y,platformDelimiter:t?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(e){function f(a,b){b||(b=document);return b.querySelectorAll(a)}function l(a){var b=a.tabIndex;0===b&&e.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(0<=l(a))return a;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++){var d=c(a.childNodes[b]);if(d)return d}return null}function d(a){if(0<=
l(a))return a;if(a.hasChildNodes())for(var b=a.childNodes.length-1;0<=b;b--){var c=d(a.childNodes[b]);if(c)return c}return null}function b(a,d){if(3===a.nodeType){var c=g.exec(a.nodeValue);c&&1<c.length&&d(a,c)}if(a.hasChildNodes())for(c=0;c<a.childNodes.length;c++)b(a.childNodes[c],d)}var g=/\$\{([^\}]+)\}/,n=null;return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:f,$$array:function(a,b){return Array.prototype.slice.call(f(a,b))},node:function(a){var b=a;"string"===typeof a&&(b=
document.getElementById(a));return b},contains:function(a,b){if(!a||!b)return!1;if(a===b)return!0;var d=a.compareDocumentPosition(b);return Boolean(d&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:d,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,d){b(a,function(a,b){a.parentNode.replaceChild(document.createTextNode(d[b[1]]||b[1]),a)})},processDOMNodes:function(a,d){b(a,function(a,b){var c=d[b[1]];if(c){var f=document.createRange(),e=b.index;f.setStart(a,e);f.setEnd(a,e+b[0].length);f.deleteContents();f.insertNode(c)}})},addAutoDismiss:function(a,b){function d(a){n.forEach(function(b){var d=!1,c=b.excludeNodes.some(function(b){return document.body.contains(b)?(d=!0,b.contains(a.target)):
!1});if(d&&!c)try{b.dismiss(a)}catch(f){"undefined"!==typeof console&&console&&console.error(f&&f.message)}});n=n.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===n&&(n=[],document.addEventListener("click",d,!0),e.isIOS&&document.addEventListener("touchend",function(a){function b(){a.target.removeEventListener("click",b)}0===a.touches.length&&a.target.addEventListener("click",b)},!1));n.push({excludeNodes:a,dismiss:b})},setFramesEnabled:function(a){for(var b=
document.getElementsByTagName("iframe"),d=0;d<b.length;d++)b[d].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){n=n.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}}});
(function(){var e=function(){function a(b){return Array.isArray?Array.isArray(b):-1!=b.constructor.toString().indexOf("Array")}function b(a,k,d,f){function e(b){for(var k=0;k<b.length;k++)if(b[k].win===a)return!0;return!1}var g=!1;if("*"===k)for(var h in c){if(c.hasOwnProperty(h)&&"*"!==h&&"object"==typeof c[h][d]&&(g=e(c[h][d])))break}else c["*"]&&c["*"][d]&&(g=e(c["*"][d])),!g&&c[k]&&c[k][d]&&(g=e(c[k][d]));if(g)throw"A channel is already bound to the same window which overlaps with origin '"+k+
"' and has scope '"+d+"'";"object"!=typeof c[k]&&(c[k]={});"object"!=typeof c[k][d]&&(c[k][d]=[]);c[k][d].push({win:a,handler:f})}var d=Math.floor(1000001*Math.random()),c={},f={},e=function(a){try{var b=JSON.parse(a.data);if("object"!=typeof b||null===b)throw"malformed";}catch(k){return}var d=a.source;a=a.origin;var e,g,h;if("string"==typeof b.method){var q=b.method.split("::");2==q.length?(e=q[0],h=q[1]):h=b.method}"undefined"!=typeof b.id&&(g=b.id);if("string"==typeof h){g=!1;if(c[a]&&c[a][e])for(q=
0;q<c[a][e].length;q++)if(c[a][e][q].win===d){c[a][e][q].handler(a,h,b);g=!0;break}if(!g&&c["*"]&&c["*"][e])for(q=0;q<c["*"][e].length;q++)if(c["*"][e][q].win===d){c["*"][e][q].handler(a,h,b);break}}else"undefined"!=typeof g&&f[g]&&f[g](a,h,b)};window.addEventListener?window.addEventListener("message",e,!1):window.attachEvent&&window.attachEvent("onmessage",e);return{build:function(e){var g=function(a){if(e.debugOutput&&window.console&&window.console.log){try{"string"!=typeof a&&(a=JSON.stringify(a))}catch(b){}console.log("["+
n+"] "+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("object"!=typeof e)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 h=!1;if("string"==
typeof e.origin){var x;"*"===e.origin?h=!0:null!==(x=e.origin.match(/^https?:\/\/(?:[-a-zA-Z0-9_\.])+(?::\d+)?/))&&(e.origin=x[0].toLowerCase(),h=!0)}if(!h)throw"Channel.build() called with an invalid origin";if("undefined"!=typeof e.scope){if("string"!=typeof e.scope)throw"scope, when specified, must be a string";if(1<e.scope.split("::").length)throw"scope may not contain double colons: '::'";}var n=function(){for(var a="",b=0;5>b;b++)a+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(62*
Math.random()));return a}(),l={},m={},q={},w=!1,B=[],L=function(a,b,k){var d=!1,c=!1;return{origin:b,invoke:function(b,d){if(!q[a])throw"attempting to invoke a callback of a nonexistent transaction: "+a;for(var c=!1,e=0;e<k.length;e++)if(b===k[e]){c=!0;break}if(!c)throw"request supports no such callback '"+b+"'";r({id:a,callback:b,params:d})},error:function(b,k){c=!0;if(!q[a])throw"error called for nonexistent message: "+a;delete q[a];r({id:a,error:b,message:k})},complete:function(b){c=!0;if(!q[a])throw"complete called for nonexistent message: "+
a;delete q[a];r({id:a,result:b})},delayReturn:function(a){"boolean"==typeof a&&(d=!0===a);return d},completed:function(){return c}}},p=function(a,b,k){return window.setTimeout(function(){if(m[a]){var d="timeout ("+b+"ms) exceeded on method '"+k+"'";(1,m[a].error)("timeout_error",d);delete m[a];delete f[a]}},b)},D=function(b,d,c){if("function"==typeof e.gotMessageObserver)try{e.gotMessageObserver(b,c)}catch(h){g("gotMessageObserver() raised an exception: "+h.toString())}if(c.id&&d){if(l[d]){var w=
L(c.id,b,c.callbacks?c.callbacks:[]);q[c.id]={};try{if(c.callbacks&&a(c.callbacks)&&0<c.callbacks.length)for(b=0;b<c.callbacks.length;b++){for(var B=c.callbacks[b],x=c.params,v=B.split("/"),n=0;n<v.length-1;n++){var u=v[n];"object"!=typeof x[u]&&(x[u]={});x=x[u]}x[v[v.length-1]]=function(){var a=B;return function(b){return w.invoke(a,b)}}()}var p=l[d](w,c.params);!w.delayReturn()&&!w.completed()&&w.complete(p)}catch(s){d="runtime_error";c=null;"string"==typeof s?c=s:"object"==typeof s&&(s&&a(s)&&
2==s.length?(d=s[0],c=s[1]):"string"==typeof s.error&&(d=s.error,s.message?"string"==typeof s.message?c=s.message:s=s.message:c=""));if(null===c)try{c=JSON.stringify(s),"undefined"==typeof c&&(c=s.toString())}catch(r){c=s.toString()}w.error(d,c)}}}else c.id&&c.callback?!m[c.id]||!m[c.id].callbacks||!m[c.id].callbacks[c.callback]?g("ignoring invalid callback, id:"+c.id+" ("+c.callback+")"):m[c.id].callbacks[c.callback](c.params):c.id?m[c.id]?(c.error?(1,m[c.id].error)(c.error,c.message):void 0!==c.result?
(1,m[c.id].success)(c.result):(1,m[c.id].success)(),delete m[c.id],delete f[c.id]):g("ignoring invalid response: "+c.id):d&&l[d]&&l[d](null,c.params)};b(e.window,e.origin,"string"==typeof e.scope?e.scope:"",D);var E=function(a){"string"==typeof e.scope&&e.scope.length&&(a=[e.scope,a].join("::"));return a},r=function(a,b){if(!a)throw"postMessage called with null message";g((w?"post  ":"queue ")+" message: "+JSON.stringify(a));if(!b&&!w)B.push(a);else{if("function"==typeof e.postMessageObserver)try{e.postMessageObserver(e.origin,
a)}catch(c){g("postMessageObserver() raised an exception: "+c.toString())}e.window.postMessage(JSON.stringify(a),e.origin)}},t={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||"string"!=typeof a)throw"'method' argument to bind must be string";if(!b||"function"!=typeof b)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||"string"!=typeof a.method)throw"'method' argument to call must be string";if(!a.success||"function"!=typeof a.success)throw"'success' callback missing from call";var b={},c=[],k=function(a,d){if("object"==typeof d)for(var e in d)if(d.hasOwnProperty(e)){var q=a+(a.length?"/":"")+e;"function"==typeof d[e]?(b[q]=d[e],c.push(q),delete d[e]):"object"==typeof d[e]&&k(q,d[e])}};k("",a.params);var e={id:d,method:E(a.method),params:a.params};c.length&&(e.callbacks=c);a.timeout&&p(d,a.timeout,
E(a.method));m[d]={callbacks:b,error:a.error,success:a.success};f[d]=D;d++;r(e)},notify:function(a){if(!a)throw"missing arguments to notify function";if(!a.method||"string"!=typeof a.method)throw"'method' argument to notify must be string";r({method:E(a.method),params:a.params})},destroy:function(){for(var a=e.window,b=e.origin,d="string"==typeof e.scope?e.scope:"",k=c[b][d],f=0;f<k.length;f++)k[f].win===a&&k.splice(f,1);0===c[b][d].length&&delete c[b][d];window.removeEventListener?window.removeEventListener("message",
D,!1):window.detachEvent&&window.detachEvent("onmessage",D);w=!1;l={};q={};m={};e.origin=null;B=[];g("channel destroyed");n=""}};t.bind("__ready",function(a,b){g("ready msg received");if(w)throw"received ready message while in ready state.  help!";"ping"===b?n+="-R":n+="-L";t.unbind("__ready");w=!0;g("ready msg accepted.");for("ping"===b&&t.notify({method:"__ready",params:"pong"});B.length;)r(B.pop());"function"==typeof e.onReady&&e.onReady(t)});setTimeout(function(){},0);return t}}}();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-1!=a.indexOf("Fennec/")||-1!=a.indexOf("Firefox/")&&-1!=a.indexOf("Android")}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;"Microsoft Internet Explorer"===navigator.appName&&null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1));
return 8<=a}();return window.JSON&&window.JSON.stringify&&window.JSON.parse&&window.postMessage?{open:function(f,g){function h(a){try{var b=JSON.parse(a.data);if("ready"===b.a)r.postMessage(w,p);else if("error"===b.a)g&&(g(b.d),g=null);else if("response"===b.a){a=window;var c=h;a.detachEvent?a.detachEvent("onmessage",c):a.removeEventListener&&a.removeEventListener("message",c,!1);a=window;c=m;a.detachEvent?a.detachEvent("onunload",c):a.removeEventListener&&a.removeEventListener("unload",c,!1);m();
g&&(g(null,b.d),g=null)}}catch(d){}}function m(){l&&document.body.removeChild(l);l=void 0;if(q)try{q.close()}catch(a){r.postMessage(d,p)}q=r=void 0}if(!g)throw"missing required callback argument";var n;f.url||(n="missing required 'url' parameter");f.relay_url||(n="missing required 'relay_url' parameter");n&&setTimeout(function(){g(n)},0);f.window_name||(f.window_name=null);if(!f.window_features||b())f.window_features=void 0;var l,p=a(f.url);if(p!==a(f.relay_url))return setTimeout(function(){g("invalid arguments: origin of url and relay_url must match")},
0);var r;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),r=l.contentWindow);var q=window.open(f.url,f.window_name,f.window_features);r||(r=q);var w=JSON.stringify({a:"request",d:f.params});c(window,"unload",m);c(window,"message",h);return{close:m,focus:function(){if(q)try{q.focus()}catch(a){}}}}}:{open:function(a,b,c,d){setTimeout(function(){d("unsupported browser")},0)}}}();
var f=function(){var a=window,b=navigator,c;return{setTestEnv:function(c,d){b=c;a=d},isSupported:function(){var d;d=-1;"Microsoft Internet Explorer"==b.appName&&null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(b.userAgent)&&(d=parseFloat(RegExp.$1));if(!(d=-1<d&&8>d?"BAD_IE_VERSION":void 0)){var e;a:{try{if("localStorage"in a&&null!==a.localStorage)a.localStorage.setItem("test","true"),a.localStorage.removeItem("test");else{e="LOCALSTORAGE_NOT_SUPPORTED";break a}}catch(f){e="LOCALSTORAGE_DISABLED";break a}e=
void 0}e||(e=a.postMessage?void 0:"POSTMESSAGE_NOT_SUPPORTED",e||(e=!window.JSON||!window.JSON.stringify||!window.JSON.parse?"JSON_NOT_SUPPORTED":void 0));d=e}c=d;return!c},getNoSupportReason:function(){return c}}}();navigator.id||(navigator.id={});if(!navigator.id.request||navigator.id._shimmed){var l=navigator.userAgent,c=-1!=l.indexOf("Fennec/")||-1!=l.indexOf("Firefox/")&&-1!=l.indexOf("Android")?void 0:"menubar\x3d0,location\x3d1,resizable\x3d1,scrollbars\x3d1,status\x3d0,dialog\x3d1,minimizable\x3d1,width\x3d700,height\x3d375",
d,b={login:null,logout:null,ready:null},g=void 0,n=function(a){!0!==a;if(void 0===g)g=a;else if(g!=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()";},a,h=f.isSupported(),r=function(){if(h)try{if(!a){var c=window.document,d=c.createElement("iframe");d.style.display="none";c.body.appendChild(d);d.src="https://login.persona.org/communication_iframe";a=e.build({window:d.contentWindow,
origin:"https://login.persona.org",scope:"mozid_ni",onReady:function(){a.call({method:"loaded",success:function(){b.ready&&b.ready()},error:function(){}})}});a.bind("logout",function(a,c){b.logout&&b.logout()});a.bind("login",function(a,c){b.login&&b.login(c)})}}catch(f){a=void 0}},t=function(a){try{console.warn(a)}catch(b){}},p=function(a,b){if("undefined"!=typeof a[b])return t(b+" has been deprecated"),!0},y=function(a,b,c){if("undefined"!=typeof a[b]&&"undefined"!=typeof a[c])throw"you cannot supply *both* "+
b+" and "+c;p(a,b)&&(a[c]=a[b],delete a[b])},m=function(c){if("object"==typeof c){if(c.onlogin&&"function"!=typeof c.onlogin||c.onlogout&&"function"!=typeof c.onlogout||c.onready&&"function"!=typeof c.onready)throw"non-function where function expected in parameters to navigator.id.watch()";if(!c.onlogin)throw"'onlogin' is a required argument to navigator.id.watch()";if(!c.onlogout)throw"'onlogout' is a required argument to navigator.id.watch()";b.login=c.onlogin||null;b.logout=c.onlogout||null;b.ready=
c.onready||null;r();y(c,"loggedInEmail","loggedInUser");"undefined"!=typeof c.loggedInUser&&a&&a.notify({method:"loggedInUser",params:c.loggedInUser})}},z=function(e){p(e,"requiredEmail");y(e,"tosURL","termsOfService");y(e,"privacyURL","privacyPolicy");e.termsOfService&&!e.privacyPolicy&&t("termsOfService ignored unless privacyPolicy also defined");e.privacyPolicy&&!e.termsOfService&&t("privacyPolicy ignored unless termsOfService also defined");if(d)try{d.focus()}catch(g){}else if(f.isSupported())a&&
a.notify({method:"dialog_running"}),d=WinChan.open({url:"https://login.persona.org/sign_in",relay_url:"https://login.persona.org/relay",window_features:c,window_name:"__persona_dialog",params:{method:"get",params:e}},function(c,f){a&&(!c&&f&&f.email&&a.notify({method:"loggedInUser",params:f.email}),a.notify({method:"dialog_complete"}));d=void 0;if(!c&&f&&f.assertion)try{b.login&&b.login(f.assertion)}catch(g){}if("client closed window"===c||!f)e&&e.oncancel&&e.oncancel(),delete e.oncancel});else{var h=
"unsupported_dialog";"LOCALSTORAGE_DISABLED"===f.getNoSupportReason()&&(h="cookies_disabled");d=window.open("https://login.persona.org/"+h,null,c)}};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||{};n(!1);a.returnTo||(a.returnTo=document.location.pathname);return z(a)},watch:function(a){if(this!=navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");n(!1);m(a)},logout:function(b){if(this!=
navigator.id)throw Error("all navigator.id calls must be made on the navigator.id object");r();a&&a.notify({method:"logout"});"function"==typeof b&&setTimeout(b,0)},get:function(a,c){var d={};c=c||{};d.privacyPolicy=c.privacyPolicy||void 0;d.termsOfService=c.termsOfService||void 0;d.privacyURL=c.privacyURL||void 0;d.tosURL=c.tosURL||void 0;p(c,"silent")?a&&setTimeout(function(){a(null)},0):(n(!0),m({onlogin:function(b){a&&(a(b),a=null)},onlogout:function(){}}),d.oncancel=function(){a&&(a(null),a=
null);b.login=b.logout=b.ready=null},z(d))},getVerifiedEmail:function(a){t("navigator.id.getVerifiedEmail has been deprecated");n(!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(e,f,l,c){function d(a){a=RegExp("[\\?\x26]"+a+"\x3d([^\x26#]*)").exec(window.location.href);if(null!==a)return a[1]}function b(a){var b="",c,d,e,f,g,h=0;for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<a.length;)c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".indexOf(a.charAt(h++)),d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".indexOf(a.charAt(h++)),
f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".indexOf(a.charAt(h++)),g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d".indexOf(a.charAt(h++)),c=c<<2|d>>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b+=String.fromCharCode(c),64!==f&&(b+=String.fromCharCode(d)),64!==g&&(b+=String.fromCharCode(e));b=b.replace(/\r\n/g,"\n");a="";for(f=0;f<b.length;f++)g=b.charCodeAt(f),128>g?a+=String.fromCharCode(g):(127<g&&2048>g?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 g(a){"undefined"!==typeof a&&(document.getElementById("errorMessage").textContent=a);document.getElementById("errorWin").style.visibility=""}function n(){document.getElementById("errorMessage").textContent="\u00a0";document.getElementById("errorWin").style.visibility="hidden"}function a(){var a;if(""===document.getElementById("reset").value&&""===document.getElementById("resetEmail").value)g("Provide username or email to reset.");
else{var b=new XMLHttpRequest;b.onreadystatechange=function(){n();if(4===b.readyState)if(200===b.status)a=JSON.parse(b.responseText),a.Message?g(a.Message):g();else{try{if(a=JSON.parse(b.responseText),a.Message){g(a.Message);return}}catch(c){}g(b.statusText)}};b.open("POST","../useremailconfirmation",!0);b.setRequestHeader("Content-type","application/x-www-form-urlencoded");b.setRequestHeader("Orion-Version","1");b.send("{login\x3d'"+document.getElementById("reset").value+"', email\x3d'"+document.getElementById("resetEmail").value+
"'}");g("Sending password reset confirmation...")}}function h(){var a=/[\?&]redirect=([^&#]*)/.exec(window.location.href);return null===a?null:a[1]}function r(){var a=h();null!==a&&(a=decodeURIComponent(a),l.validateURLScheme(a))?window.location=a:window.close()}function t(a){if(""!==a&&null!==a){var b=h();return null!==b&&l.validateURLScheme(decodeURIComponent(b))?"../login/openid?openid\x3d"+encodeURIComponent(a)+"\x26redirect\x3d"+b:"../login/openid?openid\x3d"+encodeURIComponent(a)}}function p(a){var b=
!1;if("click"===a.type||13===a.keyCode)b=!0;a.stopPropagation();return b}function y(a){p(a)&&(I=!0,navigator.id.request())}function m(a){navigator.id.watch({loggedInUser:null,onlogin:function(a){I&&f("POST","../login/persona",{headers:{"Content-type":"application/x-www-form-urlencoded","Orion-Version":"1"},data:"assertion\x3d"+encodeURIComponent(a)}).then(function(){r()},function(a){g(JSON.parse(a.responseText).error)})},onlogout:function(){}})}function z(a,b){a||(a=document.getElementById("login").value.trim(),
b=document.getElementById("password").value);if(0<a.length&&0<b.length){var c=new XMLHttpRequest;c.onreadystatechange=function(){if(4===c.readyState)if(200!==c.status&&-1!==window.location.href.indexOf("http")){var a=JSON.parse(c.responseText);g(a.error)}else r()};var d="login\x3d"+encodeURIComponent(a)+"\x26password\x3d"+encodeURIComponent(b);c.open("POST","../login/form",!0);c.setRequestHeader("Content-type","application/x-www-form-urlencoded");c.setRequestHeader("Orion-Version","1");c.send(d)}}
function k(){if(document.getElementById("create_password").value!==document.getElementById("create_passwordRetype").value)return g("Passwords don't match!"),!1;n();return!0}function v(){document.getElementById("newUserHeaderShown").style.visibility="hidden";document.getElementById("orionOpen").style.visibility="";if(C||A)document.getElementById("orionRegister").style.visibility="";document.getElementById("registerButton").focus()}function s(){if(k()){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,c=document.getElementById("create_password").value,d=document.getElementById("create_email").value;a.onreadystatechange=function(){if(4===a.readyState)if(200!==a.status&&-1!==window.location.href.indexOf("http")){if(a.responseText){var d=JSON.parse(a.responseText);g(d.Message);201===a.status&&v()}}else z(b,c)};d="login\x3d"+encodeURIComponent(b)+
"\x26password\x3d"+encodeURIComponent(c)+"\x26email\x3d"+encodeURIComponent(d);a.open("POST","../users",!0);a.setRequestHeader("Content-type","application/x-www-form-urlencoded");a.setRequestHeader("Orion-Version","1");a.send(d)}else document.getElementById("create_password").setAttribute("aria-invalid","true"),document.getElementById("create_passwordRetype").setAttribute("aria-invalid","true")}function u(a){p(a)&&(!C&&A?window.open(A):(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 J(){document.getElementById("orionLoginForm").style.visibility="hidden";!C&&!A&&(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 x(){document.getElementById("orionLoginForm").style.visibility="";document.getElementById("newUserHeaderShown").style.display="";document.getElementById("orionReset").style.visibility="hidden"}function F(a){p(a)&&(c.stop(a),document.getElementById("orionOpen").style.visibility="hidden",document.getElementById("orionRegister").style.visibility=
"hidden",document.getElementById("orionLoginForm").style.visibility="",document.getElementById("login").focus())}function G(){document.getElementById("orionLoginForm").style.visibility="hidden";document.getElementById("orionOpen").style.visibility="";if(C||A)document.getElementById("orionRegister").style.visibility="";document.getElementById("orionLogin").focus();n()}function K(a){p(a)&&a.srcElement.click()}var C,A,H,I=!1;e(function(){m(document.getElementById("personaLogin"));var e=d("error");e&&
(e=b(e),g(e));var h=new XMLHttpRequest;h.onreadystatechange=function(){if(4===h.readyState&&200===h.status){var a=JSON.parse(h.responseText);C=a.CanAddUsers;H=a.ForceEmail;document.getElementById("create_email").setAttribute("aria-required",H);A=a.RegistrationURI;!C&&!A&&(document.getElementById("orionRegister").style.visibility="hidden");document.getElementById("login-window").style.display="";document.getElementById("orionLogin").focus()}};h.open("POST","../login/canaddusers",!0);h.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");h.setRequestHeader("Orion-Version","1");h.send();var l=new XMLHttpRequest;l.onreadystatechange=function(){4===l.readyState&&200===l.status&&!1===JSON.parse(l.responseText).emailConfigured&&(document.getElementById("resetUserLink").style.display="none")};l.open("POST","../useremailconfirmation/cansendemails",!0);l.setRequestHeader("Content-type","application/x-www-form-urlencoded");l.setRequestHeader("Orion-Version","1");l.send();f("GET","../server-status.json",
{timeout:15E3}).then(function(a){a=JSON.parse(a.response).messages;if(0<a.length){var b=new Date,c=new Date(a[0].startdate);c.setHours(0,0,0,0);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(a){});document.getElementById("login").addEventListener("keypress",function(a){a.keyCode===c.KEY.ENTER&&(z(),c.stop(a))});document.getElementById("password").addEventListener("keypress",
function(a){a.keyCode===c.KEY.ENTER&&(z(),c.stop(a))});document.getElementById("loginButton").addEventListener("click",function(){z()});document.getElementById("orionLoginForm").addEventListener("keyup",function(a){a.keyCode===c.KEY.ESCAPE&&(G(),c.stop(a))});document.getElementById("resetUserLink").addEventListener("click",J);document.getElementById("reset").addEventListener("keypress",function(b){b.keyCode===c.KEY.ENTER&&(a(),c.stop(b))});document.getElementById("resetEmail").addEventListener("keypress",
function(b){b.keyCode===c.KEY.ENTER&&(a(),c.stop(b))});document.getElementById("registerButton").addEventListener("click",u);document.getElementById("registerButton").addEventListener("keydown",u);document.getElementById("create_password").addEventListener("keyup",function(a){a.keyCode===c.KEY.ENTER?s():k()});document.getElementById("create_passwordRetype").addEventListener("keyup",function(a){a.keyCode===c.KEY.ENTER?s():k()});document.getElementById("newUserHeaderShown").addEventListener("keyup",
function(a){a.keyCode===c.KEY.ESCAPE&&v()});document.getElementById("createButton").addEventListener("click",s);document.getElementById("cancelLoginButton").addEventListener("click",G);document.getElementById("newUserHeaderShown").onkeyup=function(a){a.keyCode===c.KEY.ESCAPE&&v()};document.getElementById("hideRegisterButton").addEventListener("click",v);document.getElementById("googleLogin").href=t("https://www.google.com/accounts/o8/id");document.getElementById("googleLogin").addEventListener("keydown",
K);document.getElementById("orionLogin").addEventListener("click",F);document.getElementById("orionLogin").onkeydown=F;document.getElementById("personaLogin").onclick=y;document.getElementById("personaLogin").onkeydown=y;document.getElementById("cancelResetButton").onclick=x;document.getElementById("sendResetButton").onclick=a})});
//@ sourceMappingURL=built-LoginWindow.js.map