/*******************************************************************************
 * @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 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
 * Copyright (c) 2010, 2011 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, 2011 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 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 domReady 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/requirejs for details
 */
/*******************************************************************************
 * @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
 ******************************************************************************/
/*

 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 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) 2010, 2011 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, 2011 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 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 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/requirejs for details

 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
*/
(function(){var l=this;if(!l.define)l.define=function(k){l.orion=l.orion||{};l.orion.Deferred=k();delete l.define}})();
define("orion/Deferred",[],function(){function l(c){if(m)i?(n.next={notify:c,next:null},n=n.next):n=i={notify:c,next:null};else{m=!0;do{for(;c;){c();if(h)i?n.next=h:i=h,n=f;i?(h=i.next,f=n,c=i.notify,i=n=null):c=null}m=!1}while(m)}}function k(){function c(){for(;b;){var c=b;b=b.next;var e=c.deferred;if(c[a])try{var o=c[a](d);o&&typeof o.then==="function"?o.then(e.resolve,e.reject,e.update):e.resolve(o)}catch(f){e.reject(f)}else e[a](d)}b=g=null}var d,a,b,g;this.resolve=function(b){if(a)throw Error("'"+
a+"' already called");a="resolve";d=b;l(c)};this.reject=function(b){if(a)throw Error("'"+a+"' already called");a="reject";d=b;l(c)};this.update=this.progress=this.notify=function(a){for(var c=b;c;){if(c.update)try{c.update(a)}catch(o){}c=c.next}};this.then=function(d,e,o){d={resolve:d,reject:e,update:o,deferred:new k};b?g.next=d:b=d;g=d;a&&l(c);return d.deferred.promise};this.promise={then:this.then};this.state=function(){return a||"wait"};this.all=function(b,c){function o(b,c){a||(f[b]=c,--g===0&&
s.resolve(f))}function d(b,g){if(!a){if(c)try{o(b,c(g));return}catch(j){g=j}s.reject(g)}}var g=b.length,f=[],s=this;g===0?this.resolve(f):b.forEach(function(a,b){a.then(o.bind(null,b),d.bind(null,b))});return this.promise}}var i,n,h,f,m=!1;k.when=function(c,d,a,b){var g;if(!(c&&typeof c.then==="function"))g=new k,g.resolve(c),c=g.promise;return c.then(d,a,b)};return k});
define("orion/serviceregistry",["orion/Deferred"],function(l){function k(c,d,a){this.serviceId=c;this.name=d;this.properties=a}function i(c,d,a){this.serviceId=c;this.serviceReference=d;this.internalRegistry=a}function n(c,d,a,b){return function(){var g;if(c.isRegistered(d)){try{var j=a[b].apply(a,Array.prototype.slice.call(arguments));if(j&&typeof j.then==="function")return j;else g=new l,g.resolve(j)}catch(e){g=new l,g.reject(e)}return g.promise}throw Error("Service was unregistered");}}function h(c,
d,a){this.serviceId=c;this.implementation=d;this.internalRegistry=a;for(var b in d)typeof d[b]==="function"&&(this[b]=n(a,c,d,b))}function f(){this._namedlisteners={}}function m(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new f;var c=this;this.internalRegistry={isRegistered:function(d){return c._entries[d]?!0:!1},unregisterService:function(d){var a=c._entries[d];if(a){for(var b=a.reference,g=c._namedReferences[b.getName()],j=0;j<g.length;j++)if(g[j]===b){g.length===1?delete c._namedReferences[b.getName()]:
g.splice(j,1);break}c._entries[d]=null;c._serviceEventTarget.dispatchEvent("serviceRemoved",b,a.service)}},dispatchEvent:function(d,a){var b=c._entries[d];b&&b.eventTarget.dispatchEvent.apply(b.eventTarget,[a].concat(Array.prototype.slice.call(arguments,2)))},addEventListener:function(d,a,b){(d=c._entries[d])&&d.eventTarget.addEventListener(a,b)},removeEventListener:function(d,a,b){(d=c._entries[d])&&d.eventTarget.removeEventListener(a,b)}}}k.prototype={getServiceId:function(){return this.serviceId},
getName:function(){return this.name},getPropertyNames:function(){var c=[],d;for(d in this.properties)this.properties.hasOwnProperty(d)&&c.push(d);return c},getProperty:function(c){return this.properties[c]}};k.prototype.constructor=k;i.prototype={unregister:function(){this.internalRegistry.unregisterService(this.serviceId)},dispatchEvent:function(c){this.internalRegistry.dispatchEvent.apply(this.internalRegistry,[this.serviceId,c].concat(Array.prototype.slice.call(arguments,1)))},getServiceReference:function(){return this.serviceReference}};
i.prototype.constructor=i;h.prototype={addEventListener:function(c,d){this.internalRegistry.addEventListener(this.serviceId,c,d)},removeEventListener:function(c,d){this.internalRegistry.removeEventListener(this.serviceId,c,d)}};h.prototype.constructor=h;f.prototype={dispatchEvent:function(c){var d=this._namedlisteners[c];if(d)for(var a=0;a<d.length;a++)try{var b=Array.prototype.slice.call(arguments,1);d[a].apply(null,b)}catch(g){console.log(g)}},addEventListener:function(c,d){this._namedlisteners[c]=
this._namedlisteners[c]||[];this._namedlisteners[c].push(d)},removeEventListener:function(c,d){var a=this._namedlisteners[c];if(a)for(var b=0;b<a.length;b++)if(a[b]===d){a.length===1?delete this._namedlisteners[c]:a.splice(b,1);break}}};f.prototype.constructor=f;m.prototype={getService:function(c){var d;if(typeof c==="string"){if(this._namedReferences[c])for(var a=0;a<this._namedReferences[c].length;a++)if(d=this._entries[this._namedReferences[c][a].getServiceId()].service)break}else d=this._entries[c.getServiceId()].service;
return d},getServiceReferences:function(c){if(c)return this._namedReferences[c]?this._namedReferences[c]:[];for(var c=[],d=0;d<this._entries.length;d++)this._entries[d]&&c.push(this._entries[d].reference);return c},registerService:function(c,d,a){var b=this._entries.length,a=new k(b,c,a),d=new h(b,d,this.internalRegistry);this._namedReferences[c]=this._namedReferences[c]||[];this._namedReferences[c].push(a);this._entries.push({reference:a,service:d,eventTarget:new f});this._serviceEventTarget.dispatchEvent("serviceAdded",
a,d);return new i(b,a,this.internalRegistry)},addEventListener:function(c,d){this._serviceEventTarget.addEventListener(c,d)},removeEventListener:function(c,d){this._serviceEventTarget.removeEventListener(c,d)}};m.prototype.constructor=m;return{ServiceReference:k,ServiceRegistration:i,Service:h,EventTarget:f,ServiceRegistry:m}});
define("orion/xhr",["orion/Deferred"],function(l){function k(i){return encodeURIComponent(i).replace(/[!'()*]/g,function(i){return"%"+i.charCodeAt(0).toString(16).toUpperCase()})}return function(i,n,h){var h=h||{},f=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,m=new l,c=h.headers||{},d=h.log||!1,a,b;typeof c["X-Requested-With"]==="undefined"&&(c["X-Requested-With"]="XMLHttpRequest");if(h.query&&typeof h.query==="object"){var g=h.query,j=Object.keys(g),e=[];for(b=0;b<j.length;b++){var o=
j[b],q=g[o];e.push(k(o)+"="+k(q))}e.length&&(g=n.split("#"),g[0]+=(g[0].indexOf("?")===-1?"?":"&")+e.join("&"),n=g.join("#"))}if(typeof h.data!=="undefined"&&(i==="POST"||i==="PUT"))a=h.data;if(typeof h.responseType==="string")f.responseType=h.responseType;f.onreadystatechange=function(){if(f.readyState===4){var a=f.status,b=typeof f.response!=="undefined"?f.response:f.responseText,b={args:h,response:b,responseText:typeof b==="string"?b:null,status:a,url:n,xhr:f};200<=a&&a<400?m.resolve(b):(d&&console&&
console.log(Error(f.statusText)),m.reject(b))}};try{f.open(i,n,!0);if(typeof h.timeout==="number")f.timeout=h.timeout,f.addEventListener("timeout",function(a){m.reject("Timeout exceeded: "+a)});var r=Object.keys(c);for(b=0;b<r.length;b++){var p=r[b];f.setRequestHeader(p,c[p])}f.send(a)}catch(s){m.reject(s)}return m}});
define("orion/es5shim",[],function(){if(!Function.prototype.bind)Function.prototype.bind=function(l){var k=this,i=Array.prototype.slice.call(arguments,1);return i.length?function(){return arguments.length?k.apply(l,i.concat(Array.prototype.slice.call(arguments))):k.apply(l,i)}:function(){return arguments.length?k.apply(l,arguments):k.call(l)}}});
define("orion/preferences",["require","orion/Deferred","orion/xhr","orion/es5shim"],function(l,k,i){function n(a,b){this._name=a;this._providers=b;this._flushPending=!1;this._cached=null;this._stores=[];this._dirty=[]}function h(a,b){return{get:function(c,d){if(b===0)return null;var e=localStorage.getItem(a+c);if(e===null)return null;e=JSON.parse(e);return d||b===-1||e._expires&&e._expires>(new Date).getTime()?(delete e._expires,e):null},set:function(c,d){if(b!==0){if(b!==-1)d._expires=(new Date).getTime()+
1E3*b;if(Object.keys(d).length===0)localStorage.removeItem(a+c);else{var e=JSON.stringify(d);localStorage.setItem(a+c,e);delete d._expires}}},remove:function(b){localStorage.removeItem(a+b)}}}function f(a){this._currentPromises={};this._cache=new h("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var b=a.getServiceReferences("orion.core.preference.provider");if(b.length>0)this._service=a.getService(b[0])}return!!this._service}}function m(a){this._location=
a;this._currentPromise=null;this._cache=new h("/orion/preferences/default",3600)}function c(){this._cache=new h("/orion/preferences/local",-1)}function d(a,b){this._userProvider=new f(a);this._localProvider=new c;b=b||"defaults.pref";b.indexOf("://")===-1&&(b=l.toUrl(b));this._defaultsProvider=new m(b);this._serviceRegistration=a.registerService("orion.core.preference",this)}n.prototype={_flush:function(){for(var a=[],b=0;b<this._stores.length;++b){var c=this._stores[b];this._dirty.indexOf(c)!==-1&&
a.push(this._providers[b].put(this._name,c))}this._dirty=[];return(new k).all(a)},_scheduleFlush:function(a){this._dirty.indexOf(a)===-1&&this._dirty.push(a);if(!this._flushPending)this._flushPending=!0,window.setTimeout(function(){if(this._flushPending)this._flushPending=!1,this._flush()}.bind(this),0)},_getCached:function(){if(!this._cached){this._cached={};for(var a=0;a<this._stores.length;++a){var b=this._stores[a],c;for(c in b)b.hasOwnProperty(c)&&typeof this._cached[c]==="undefined"&&(this._cached[c]=
b[c])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,b){if(this._stores.length!==0){var c=this._stores[0];if(c[a]!==b)c[a]=b,this._cached=null,this._scheduleFlush(c)}},remove:function(a){for(var b=0;b<this._stores.length;++b){var c=this._stores[b];if(c.hasOwnProperty(a))return delete c[a],this._cached=null,this._scheduleFlush(c),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]=
{},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var b=this,c=[],d=0;d<this._providers.length;++d)c.push(this._providers[d].get(this._name,a).then(function(a){return function(c){b._stores[a]=c}}(d)));return(new k).all(c).then(function(){b._cached=null;b._getCached()})},flush:function(){this._flush()}};f.prototype={get:function(a,b){if(this._currentPromises[a])return this._currentPromises[a];var c=new k,
d=null;b?this._cache.remove(a):d=this._cache.get(a);if(d!==null)c.resolve(d);else{this._currentPromises[a]=c;var e=this;this._service.get(a).then(function(b){e._cache.set(a,b);delete e._currentPromises[a];c.resolve(b)},function(b){b.status===404?(b={},e._cache.set(a,b),delete e._currentPromises[a],c.resolve(b)):(delete e._currentPromises[a],c.resolve(e._cache.get(a,!0)||{}))})}return c},put:function(a,b){this._cache.set(a,b);return this._service.put(a,b)}};m.prototype={get:function(a,b){if(this._currentPromise)return this._currentPromise;
var c=new k,d=null;b?this._cache.remove(a):d=this._cache.get(a);if(d!==null)c.resolve(d);else{this._currentPromise=c;var e=this;i("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(b){b=JSON.parse(b.response);e._cache.set(a,b[a]||{});e._currentPromise=null;c.resolve(b[a]||{})},function(b){b.xhr.status===401||b.xhr.status===404?(e._cache.set(a,{}),e._currentPromise=null,c.resolve({})):(e._currentPromise=null,b=e._cache.get(a,!0),b!==null?c.resolve(b[a]||{}):c.resolve({}))})}return c},
put:function(){var a=new k;a.resolve();return a}};c.prototype={get:function(a){var b=new k,a=this._cache.get(a);a!==null?b.resolve(a):b.resolve({});return b},put:function(a,b){var c=new k;this._cache.set(a,b);c.resolve();return c}};d.DEFAULT_SCOPE=1;d.LOCAL_SCOPE=2;d.USER_SCOPE=4;d.prototype={listenForChangedSettings:function(a){window.addEventListener("storage",a,!1);return"/orion/preferences/local/settings"},getPreferences:function(a,b){if(!b||typeof b!=="number"||b>7||b<1)b=d.DEFAULT_SCOPE|d.LOCAL_SCOPE|
d.USER_SCOPE;var c=[];d.USER_SCOPE&b&&this._userProvider.available()&&c.push(this._userProvider);d.LOCAL_SCOPE&b&&c.push(this._localProvider);d.DEFAULT_SCOPE&b&&c.push(this._defaultsProvider);var f=new n(a,c);return f.sync().then(function(){return f})},getSetting:function(a,b,c){for(var d,e=0;e<a.length;e++)if(a[e].label===b)for(var o=0;o<a[e].data.length;o++)if(a[e].data[o].label===c){d=a[e].data[o].value;break}return d}};return{PreferencesService:d}});
define("orion/pluginregistry",["orion/Deferred","orion/serviceregistry","orion/es5shim"],function(l,k){var i=i||{};i.Plugin=function(i,h,f){function k(a,b,c){if(!g)throw Error("plugin not connected");var d=q++,o=new l;r[String(d)]=o;f.postMessage({id:d,serviceId:a,method:b,params:c},g);return o.promise}function c(a){var c={};a.methods&&a.methods.forEach(function(d){c[d]=function(){var c=Array.prototype.slice.call(arguments);return o?k(a.serviceId,d,c):b._load().then(function(){return k(a.serviceId,
d,c)})}});return c}function d(){var a=h.services;a&&a.forEach(function(a){var b=c(a);p[a.serviceId]=f.registerService(a.type,b,a.properties)})}function a(a){var c,g;try{if(a.method)if("plugin"===a.method){if(h){if(JSON.stringify(h)!==JSON.stringify(a.params[0])){for(var q in p)p.hasOwnProperty(q)&&(p[q].unregister(),delete p[q]);h=a.params[0];d();f.updatePlugin(b)}}else h=a.params[0],d();o||(o=!0,f.dispatchEvent("pluginLoaded",b),j.resolve(b));e&&(e.resolve(b),e=null)}else"dispatchEvent"===a.method?
(c=p[a.serviceId],c.dispatchEvent.apply(c,a.params)):"progress"===a.method?(g=r[String(a.requestId)],g.update.apply(g,a.params)):(o||j.reject(Error("Load timeout for plugin: "+i)),e&&(e.reject(Error("Load timeout for plugin: "+i)),e=null));else g=r[String(a.id)],delete r[String(a.id)],a.error?g.reject(a.error):g.resolve(a.result)}catch(k){console.log(k)}}var b=this,g=null,j=new l,e=null,o=!1,q=0,r={},p={};this.getLocation=function(){return i};this.getData=function(){return h};this.uninstall=function(){for(var a in p)p.hasOwnProperty(a)&&
(p[a].unregister(),delete p[a]);g&&(f.disconnect(g),g=null);f.uninstallPlugin(this)};this.getServiceReferences=function(){var a=[],b;for(b in p)p.hasOwnProperty(b)&&a.push(p[b].getServiceReference());return a};this.update=function(){if(!o)return this._load();e===null&&(e=new l,f.disconnect(g),g=f.connect(i,a));return e.promise};this._load=function(c,d){g||(g=f.connect(i,a,d),j.then(null,function(){c||(h={},f.updatePlugin(b))}));return j.promise};if(typeof i!=="string")throw Error("invalid url:"+i);
h&&d()};i.PluginRegistry=function(n,h,f){function m(a){if(a.indexOf("://")===-1){var b=document.createElement("a");b.href=a;return b.href}return a}function c(b){b.getData()._expires=(new Date).getTime()+36E5;a["plugin."+b.getLocation()]=JSON.stringify(b.getData())}function d(a){var c=null,a=m(a);b.some(function(b){if(a===b.getLocation())return c=b,!0});return c}var a=h||localStorage||{},b=[],g=[],j=new k.EventTarget;addEventListener("message",function(a){var b=a.source;g.some(function(c){if(b===c.target){if(typeof c.useStructuredClone===
"undefined")c.useStructuredClone=typeof a.data!=="string";c.handler(c.useStructuredClone?a.data:JSON.parse(a.data));return!0}})},!1);var e={registerService:n.registerService.bind(n),connect:function(a,b,c){function d(){b({method:"timeout"})}var e={handler:b,url:a},i=setTimeout(d,c||15E3);if(a.match(/\.js$/)&&typeof Worker!=="undefined"){var h=new Worker(a);h.onmessage=function(a){if(typeof e.useStructuredClone==="undefined")e.useStructuredClone=typeof a.data!=="string";e.handler(e.useStructuredClone?
a.data:JSON.parse(a.data))};e.target=h;e.close=function(){h.terminate()}}else{var j=document.createElement("iframe");j.id=a;j.name=a;if(!f)j.style.display="none",j.style.visibility="hidden";j.src=a;j.onload=function(){clearTimeout(i);setTimeout(d,5E3)};j.sandbox="allow-scripts allow-same-origin";document.body.appendChild(j);e.target=j.contentWindow;e.close=function(){document.body.removeChild(j)}}g.push(e);return e},disconnect:function(a){for(var b=0;b<g.length;b++)if(a===g[b]){g.splice(b,1);try{a.close()}catch(c){}break}},
uninstallPlugin:function(c){delete a["plugin."+c.getLocation()];for(var d=0;d<b.length;d++)if(c===b[d]){b.splice(d,1);j.dispatchEvent("pluginRemoved",c);break}},updatePlugin:function(a){c(a);j.dispatchEvent("pluginUpdated",a)},postMessage:function(a,b){b.target.postMessage(b.useStructuredClone?a:JSON.stringify(a),b.url)},dispatchEvent:function(a,b){try{j.dispatchEvent(a,b)}catch(c){console&&console.log(c)}}};this.startup=function(c){var g=[];c.forEach(function(c){var c=m(c),f="plugin."+c,j=a[f]?JSON.parse(a[f]):
null;j&&j._expires&&j._expires>(new Date).getTime()?d(c)===null&&(delete j._expires,b.push(new i.Plugin(c,j,e))):(a[f]="{}",c=new i.Plugin(c,{},e),b.push(c),g.push(c._load(!1,5E3)))});return(new l).all(g,function(){})};this.shutdown=function(){g.forEach(function(a){try{a.close()}catch(b){}})};this.installPlugin=function(a,g){var a=m(a),f=new l,h=d(a);if(h)if(h.getData())f.resolve(h);else{var k=function(b){b.getLocation()===a&&(f.resolve(b),j.removeEventListener("pluginAdded",k))};j.addEventListener("pluginAdded",
k)}else h=new i.Plugin(a,g,e),b.push(h),h.getData()?(c(h),j.dispatchEvent("pluginAdded",h),f.resolve(h)):h._load(!0).then(function(){c(h);j.dispatchEvent("pluginAdded",h);f.resolve(h)},function(a){f.reject(a)});return f.promise};this.getPlugins=function(){var a=[];b.forEach(function(b){b.getData()&&a.push(b)});return a};this.getPlugin=function(a){return(a=d(a))&&a.getData()?a:null};this.addEventListener=function(a,b){j.addEventListener(a,b)};this.removeEventListener=function(a,b){j.removeEventListener(a,
b)}};return i});
define("orion/bootstrap",["require","orion/Deferred","orion/serviceregistry","orion/preferences","orion/pluginregistry"],function(l,k,i,n,h){var f;return{startup:function(){if(f)return f;f=new k;var m=new i.ServiceRegistry,c=new n.PreferencesService(m),d=new h.PluginRegistry(m);return c.getPreferences("/plugins").then(function(a){for(var a=a.keys(),b=0;b<a.length;++b)a[b].indexOf("://")===-1&&(a[b]=l.toUrl(a[b]));return d.startup(a)}).then(function(){if(m.getServiceReferences("orion.core.preference.provider").length>0)return c.getPreferences("/plugins",
c.USER_SCOPE).then(function(a){for(var a=a.keys(),b=0;b<a.length;++b)a[b].indexOf("://")===-1&&(a[b]=l.toUrl(a[b]));return d.startup(a)})}).then(function(){var a=m.getService("orion.core.auth");a&&a.getUser().then(function(b){b||a.getAuthForm(window.location.href).then(function(a){window.location=a})})}).then(function(){var a={serviceRegistry:m,preferences:c,pluginRegistry:d};f.resolve(a);return a})}}});
define("domReady",[],function(){function l(a){for(var b=0,c;c=a[b];b++)c(m)}function k(){var b=c,e=d;f&&(b.length&&(c=[],l(b)),a.resourcesDone&&e.length&&(d=[],l(e)))}function i(){f||(f=!0,g&&clearInterval(g),k())}function n(a){f?a(m):c.push(a);return n}var h=typeof window!=="undefined"&&window.document,f=!h,m=h?document:null,c=[],d=[],a=requirejs||require||{},b=a.resourcesReady,g;if("resourcesReady"in a)a.resourcesReady=function(a){b&&b(a);a&&k()};h&&(document.addEventListener?(document.addEventListener("DOMContentLoaded",
i,!1),window.addEventListener("load",i,!1)):window.attachEvent&&(window.attachEvent("onload",i),self===self.top&&(g=setInterval(function(){try{document.body&&(document.documentElement.doScroll("left"),i())}catch(a){}},30))),document.readyState==="complete"&&i());n.withResources=function(b){f&&a.resourcesDone?b(m):d.push(b);return n};n.version="1.0.0";n.load=function(a,b,c,d){d.isBuild?c(null):n(c)};return n});
define("index",["orion/bootstrap","domReady!"],function(l){l.startup().then(function(){window.location="navigate/table.html"})});