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

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

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

/*

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

 Contributors:
 IBM Corporation - initial API and implementation
*/
(function(a,g){typeof define==="function"&&define.amd?define("orion/Deferred",g):typeof exports==="object"?module.exports=g():(a.orion=a.orion||{},a.orion.Deferred=g())})(this,function(){function a(){for(var c;c=i.shift();)c();r=!1}function g(c){i.push(c);r||(r=!0,setTimeout(a,0))}function s(c){return function(){c.apply(void 0,arguments)}}function m(){function c(){for(var b;b=e.shift();){var a=b.deferred,d=f==="fulfilled"?"resolve":"reject";if(typeof b[d]==="function")try{var c=(0,b[d])(j),k=c&&(typeof c===
"object"||typeof c==="function")&&c.then;if(typeof k==="function")if(c===a.promise)a.reject(new TypeError);else{var g=c.cancel;typeof g==="function"?a._protected(i).parentCancel=g.bind(c):delete a._protected(i).parentCancel;k.call(c,s(a.resolve),s(a.reject),s(a.progress))}else a.resolve(c)}catch(m){a.reject(m)}else a[d](j)}}function a(b){delete k.parentCancel;f="rejected";j=b;e.length&&g(c)}function q(b){function t(h){return function(b){p||(p=!0,h(b))}}var p=!1;delete k.parentCancel;try{var l=b&&
(typeof b==="object"||typeof b==="function")&&b.then;if(typeof l==="function")if(b===d)a(new TypeError);else{f="assumed";var i=b&&b.cancel;if(typeof i!=="function"){var n=new m,b=n.promise;try{l(n.resolve,n.reject,n.progress)}catch(o){n.reject(o)}i=b.cancel;l=b.then}j=b;l.call(b,t(q),t(a));k.parentCancel=i.bind(b)}else f="fulfilled",j=b,e.length&&g(c)}catch(h){t(a)(h)}}function l(){var b=k.parentCancel;if(b)delete k.parentCancel,b();else if(!f)b=Error("Cancel"),b.name="Cancel",a(b)}var j,f,e=[],d=
this,k={};Object.defineProperty(this,"_protected",{value:function(b){if(b!==i)throw Error("protected");return k}});this.resolve=function(b){f||q(b);return d};this.reject=function(b){f||a(b);return d};this.progress=function(b){f||e.forEach(function(a){if(a.progress)try{a.progress(b)}catch(c){}});return d.promise};this.cancel=function(){k.parentCancel?setTimeout(l,0):l();return d};this.then=function(b,a,k){b={resolve:b,reject:a,progress:k,deferred:new m};e.push(b);b.deferred._protected(i).parentCancel=
d.promise.cancel.bind(d);(f==="fulfilled"||f==="rejected")&&g(c);return b.deferred.promise};this.promise={then:d.then,cancel:d.cancel}}var i=[],r=!1;m.all=function(a,g){function i(a,b){e||(f[a]=b,--j===0&&d.resolve(f))}function l(a,b){if(!e){if(g)try{i(a,g(b));return}catch(c){b=c}d.reject(b)}}var j=a.length,f=[],e=!1,d=new m;d.then(void 0,function(){e=!0;a.forEach(function(a){a.cancel&&a.cancel()})});j===0?d.resolve(f):a.forEach(function(a,b){a.then(i.bind(void 0,b),l.bind(void 0,b))});return d.promise};
m.when=function(a,g,i,l){var j;if(!(a&&typeof a.then==="function"))j=new m,j.resolve(a),a=j.promise;return a.then(g,i,l)};return m});
(function(a,g){typeof define==="function"&&define.amd?define("orion/plugin",["orion/Deferred"],g):typeof exports==="object"?module.exports=g(require("orion/Deferred")):(a.orion=a.orion||{},a.orion.PluginProvider=g(a.orion.Deferred))})(this,function(a){function g(a,g){this.__objectId=a;this.__methods=g}return function(s){function m(h){d&&(typeof ArrayBuffer==="undefined"&&(h=JSON.stringify(h)),d===self?d.postMessage(h):d.postMessage(h,"*"))}function i(){var h=[];Object.keys(n).forEach(function(a){var b=
n[a];h.push({serviceId:a,names:b.names,methods:b.methods,properties:b.properties})});return{headers:f||{},services:h}}function r(h,a){if(a&&a instanceof XMLHttpRequest){var b,d;try{b=a.status,d=a.statusText}catch(c){b=0,d=""}return{status:b||0,statusText:d}}return a}function c(h){var a=h?JSON.parse(JSON.stringify(h,r)):h;if(h instanceof Error)a.__isError=!0,a.message=a.message||h.message,a.name=a.name||h.name;return a}function w(h){if(!d)return(new a).reject(Error("plugin not connected"));h.id=String(k++);
var c=new a;u[h.id]=c;c.then(null,function(a){e&&a instanceof Error&&a.name==="Cancel"&&o({requestId:h.id,method:"cancel",params:a.message?[a.message]:[]})});var i=Object.prototype.toString;h.params.forEach(function(a,d){if(i.call(a)==="[object Object]"&&!(a instanceof g)){var e,f;for(e in a)i.call(a[e])==="[object Function]"&&(f=f||[],f.push(e));if(f){var j=b++;v[j]=a;e=function(){delete v[j]};c.then(e,e);h.params[d]=new g(j,f)}}});o(h);return c.promise}function q(a,b){a||a===0?o({id:a,result:null,
error:b}):console.log(b)}function l(a,b,d,g){g.forEach(function(a,b){if(a&&typeof a.__objectId!=="undefined"){var h={};a.__methods.forEach(function(b){h[b]=function(){return w({objectId:a.__objectId,method:b,params:Array.prototype.slice.call(arguments)})}});g[b]=h}});var e=typeof a===void 0?null:{id:a,result:null,error:null};try{var f=d.apply(b,g);if(e)f&&typeof f.then==="function"?(p[a]=f,f.then(function(b){delete p[a];e.result=b;o(e)},function(b){if(p[a])delete p[a],e.error=c(b),o(e)},function(){o({responseId:a,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(e.result=f,o(e))}catch(i){if(e)e.error=c(i),o(e)}}function j(a){if(a.source===d){a=typeof a.data!=="string"?a.data:JSON.parse(a.data);try{if(a.method){var b=a.method,e=a.params||[];if("serviceId"in a){var c=n[a.serviceId];c||q(a.id,"service not found");c=c.implementation;b in c?l(a.id,c,c[b],e):q(a.id,"method not found")}else if("objectId"in a){var f=v[a.objectId];f||q(a.id,"object not found");!b in f?l(a.id,f,f[b],e):q(a.id,"method not found")}else if("requestId"in
a){var g=p[a.requestId];g&&b==="cancel"&&g.cancel&&g.cancel.apply(g,e)}else if("responseId"in a){var i=u[a.responseId];i&&b==="progress"&&i.progress&&i.progress.apply(i,e)}else throw Error("Bad method: "+a.method);}else{var j=u[String(a.id)];delete u[String(a.id)];a.error?j.reject(a.error):j.resolve(a.result)}}catch(k){console.log("Plugin._messageHandler "+k)}}}var f=s,e=!1,d=null,k=0,b=0,t=0,p={},u={},v={},n={},o=m;this.updateHeaders=function(a){if(e)throw Error("Cannot update headers. Plugin Provider is connected");
f=a};this.registerServiceProvider=this.registerService=function(a,b,c){if(e)throw Error("Cannot register service. Plugin Provider is connected");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var d=null,f=[];for(d in b)typeof b[d]==="function"&&f.push(d);n[t++]={names:a,methods:f,implementation:b,properties:c||{},listeners:{}}};this.connect=function(a,b){if(!e){if(typeof window==="undefined")d=self;else if(window!==window.parent)d=window.parent;else if(window.opener!==null)d=window.opener;else{b&&
b("No valid plugin target");return}addEventListener("message",j,!1);var c={method:"plugin",params:[i()]};m(c);e=!0}a&&a()};this.disconnect=function(){e&&(removeEventListener("message",j),d=null,e=!1)}}});
define('built-shellPagePlugin.js',["orion/plugin"],function(a){a=new a({name:"Orion Shell Page Service",version:"1.0",description:"This plugin integrates access to Orion's Shell page into other Orion pages."});a.registerService("orion.navigate.command",{},{nameKey:"Shell",id:"eclipse.shell.open",tooltipKey:"Open Shell page",nls:"orion/shell/nls/messages",validationProperties:[{source:"ChildrenLocation|ContentLocation",variableName:"ShellLocation",replacements:[{pattern:"\\?depth=1$",replacement:""}]}],
uriTemplate:"{+OrionHome}/shell/shellPage.html#{,ShellLocation}",forceSingleItem:!0});a.registerService("orion.page.link.related",null,{id:"eclipse.shell.open"});a.registerService("orion.page.link.related",null,{nameKey:"Shell",id:"eclipse.shell.open",tooltipKey:"Open Shell page",nls:"orion/shell/nls/messages",validationProperties:[{source:"NoTarget"}],uriTemplate:"{+OrionHome}/shell/shellPage.html#",forceSingleItem:!0});a.connect()});