(function(c,a){"function"===typeof define&&define.amd?define("orion/Deferred",a):"object"===typeof exports?module.exports=a():(c.orion=c.orion||{},c.orion.Deferred=a())})(this,function(){function c(){for(var a;a=d.shift();)a();n=!1}function a(a){d.push(a);n||(n=!0,p())}function b(a){return function(b){a(b)}}function l(){function c(){for(var e;e=g.shift();){var a=e.deferred,k="fulfilled"===h?"resolve":"reject";e=e[k];if("function"===typeof e)try{var d=e(q),r=d&&("object"===typeof d||"function"===typeof d)&&
d.then;if("function"===typeof r)if(d===a.promise)a.reject(new TypeError);else{var f=d.cancel;"function"===typeof f?a._parentCancel=f.bind(d):delete a._parentCancel;r.call(d,b(a.resolve),b(a.reject),b(a.progress))}else a.resolve(d)}catch(l){a.reject(l)}else a[k](q)}}function d(e){delete f._parentCancel;h="rejected";q=e;g.length&&a(c)}function n(e){function b(e){return function(a){(!h||"assumed"===h)&&e(a)}}delete f._parentCancel;try{var k=e&&("object"===typeof e||"function"===typeof e)&&e.then;if("function"===
typeof k)if(e===f)d(new TypeError);else{h="assumed";var r=e&&e.cancel;if("function"!==typeof r){var p=new l;e=p.promise;try{k(p.resolve,p.reject,p.progress)}catch(y){p.reject(y)}r=e.cancel;k=e.then}q=e;k.call(e,b(n),b(d));f._parentCancel=r.bind(e)}else h="fulfilled",q=e,g.length&&a(c)}catch(v){b(d)(v)}}function r(){var e=f._parentCancel;e?(delete f._parentCancel,e()):h||(e=Error("Cancel"),e.name="Cancel",d(e))}var q,h,g=[],f=this;this.resolve=function(e){h||n(e);return f};this.reject=function(e){h||
d(e);return f};this.progress=function(e){h||g.forEach(function(a){if(a.progress)try{a.progress(e)}catch(k){}});return f.promise};this.cancel=function(){f._parentCancel?setTimeout(r,0):r();return f};this.then=function(e,d,k){var b=new l;b._parentCancel=f.promise.cancel;g.push({resolve:e,reject:d,progress:k,deferred:b});("fulfilled"===h||"rejected"===h)&&a(c);return b.promise};this.promise={then:f.then,cancel:f.cancel}}var d=[],n=!1,p=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var a=
process.nextTick;return function(){a(c)}}if("function"===typeof MutationObserver){var d=document.createElement("div");(new MutationObserver(c)).observe(d,{attributes:!0});return function(){d.setAttribute("class","_tick")}}return function(){setTimeout(c,0)}}();l.all=function(a,d){function b(e,a){g||(h[e]=a,0===--c&&f.resolve(h))}function r(e,a){if(!g){if(d)try{b(e,d(a));return}catch(k){a=k}f.reject(a)}}var c=a.length,h=[],g=!1,f=new l;f.then(void 0,function(){g=!0;a.forEach(function(a){a.cancel&&a.cancel()})});
0===c?f.resolve(h):a.forEach(function(a,d){a.then(b.bind(void 0,d),r.bind(void 0,d))});return f.promise};l.when=function(a,d,b,c){var q;a&&"function"===typeof a.then||(q=new l,q.resolve(a),a=q.promise);return a.then(d,b,c)};return l});
define("orion/PageUtil",[],function(){var c=/^http[s]?/i;return{hash:function(){var a=window.location.href.split("#")[1];return a?"#"+a:""},matchResourceParameters:function(a){a=a||window.location.toString();var b={resource:""},c=a.indexOf("#");if(-1!==c&&(a=a.substring(c+1),0!==a.length)){a=a.split(",");b.resource=decodeURIComponent(a[0]);for(c=1;c<a.length;c++){var d=/([^=]*)(=?)(.*)/.exec(a[c]),n=decodeURIComponent(d[1]||""),d=decodeURIComponent(d[3]||"");""!==n&&"resource"!==n&&(b[n]=d)}}return b},
validateURLScheme:function(a,b){var l=a;if(-1===a.indexOf("://")){var d=document.createElement("a");d.href=a;l=d.href}d=!1;if(d=b?b.some(function(a){return RegExp("^"+a+":","i").test(l)}):c.test(l))return a;console.log("Illegal URL Scheme: '"+a+"'");return""}}});
define("orion/URITemplate",[],function(){function c(a){this._text=a}function a(a){return a.replace("%25","%")}function b(d,b){if("U"===b)return encodeURIComponent(d).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===b)return encodeURI(d).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(w,a);if("U+R-,"===b)return encodeURI(d).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function l(a,d,c){for(var g=
[],f=0;f<a.length;f++)"undefined"!==typeof a[f]&&g.push(b(a[f],d));return g.join(c)}function d(a,d,c,g){for(var f=Object.keys(a),e=[],l=0;l<f.length;l++)"undefined"!==typeof a[f[l]]&&e.push(b(f[l],d)+c+b(a[f[l]],d));return e.join(g)}function n(a){if(0===a.length)throw Error("Invalid Expression: 0 length expression");(this._operator=s[a[0]])?a=a.substring(1):this._operator=s.NUL;for(var d=[],b=a.split(","),c=0;c<b.length;c++){var f=b[c].match(u);if(null===f)throw Error("Bad VarSpec: "+a);d.push({name:f[1],
explode:!!f[2],prefix:f[3]?parseInt(f[3],10):-1})}this._varSpecList=d}function p(a){for(var d=[],b=0,g=a.indexOf("{",b);-1!==g;){d.push(new c(a.substring(b,g)));b=a.indexOf("}",g+1);if(-1===b)throw Error("Invalid template: "+a);d.push(new n(a.substring(g+1,b)));b+=1;g=a.indexOf("{",b)}d.push(new c(a.substring(b)));this._templateComponents=d}var s={NUL:{first:"",sep:",",named:!1,ifemp:"",allow:"U"},"+":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R"},".":{first:".",sep:",",named:!1,ifemp:"",allow:"U"},
"/":{first:"/",sep:"/",named:!1,ifemp:"",allow:"U"},";":{first:";",sep:";",named:!0,ifemp:"",allow:"U"},"?":{first:"?",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"\x26":{first:"\x26",sep:"\x26",named:!0,ifemp:"\x3d",allow:"U"},"#":{first:"#",sep:",",named:!1,ifemp:"",allow:"U+R"},",":{first:"",sep:",",named:!1,ifemp:"",allow:"U+R-,"}},u=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,w=/%25[0-9A-F][0-9A-F]/g;c.prototype={expand:function(a){return encodeURI(this._text)}};
n.prototype={expand:function(a){for(var c=[],h=0;h<this._varSpecList.length;h++){var g=this._varSpecList[h],f=g.name,e=a[f],x=typeof e;if("undefined"!==x&&null!==e){var k=0===c.length?this._operator.first:this._operator.sep;if("string"===x)this._operator.named&&(k+=b(f,"U+R"),k+=0===e.length?this._operator.ifemp:"\x3d"),-1!==g.prefix&&g.prefix<e.length&&(e=e.substring(0,g.prefix)),k+=b(e,this._operator.allow);else if(Array.isArray(e)){if(0===e.length)continue;g.explode?k+=l(e,this._operator.allow,
this._operator.sep):(g=l(e,this._operator.allow,","),this._operator.named&&(k+=b(f,"U+R"),k+=0===g.length?this._operator.ifemp:"\x3d"),k+=g)}else if("object"===x){if(0===Object.keys(e).length)continue;g.explode?k+=d(e,this._operator.allow,"\x3d",this._operator.sep):(g=d(e,this._operator.allow,",",","),this._operator.named&&(k+=b(f,"U+R"),k+=0===g.length?this._operator.ifemp:"\x3d"),k+=g)}else throw Error("bad param type: "+f+" : "+x);c.push(k)}}return c.join("")}};p.prototype={expand:function(a){for(var d=
[],b=0;b<this._templateComponents.length;b++)d.push(this._templateComponents[b].expand(a));return d.join("")}};return p});
define("orion/i18nUtil",["require","orion/Deferred"],function(c,a){function b(a){if(a=localStorage.getItem("orion/messageBundle/"+a))if(a=JSON.parse(a),a._expires&&a._expires>(new Date).getTime())return delete a._expires,a;return null}var l={};return{getMessageBundle:function(d){function n(a){a?c(["i18n!"+d],function(a){if(a){var b=d;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+b,JSON.stringify(a));delete a._expires}s.resolve(a)}):p(Error(d))}function p(a){s.reject(a)}
if(l[d])return l[d];var s=new a;l[d]=s;var u=b(d);if(u)return s.resolve(u),s;try{c([d],n,p)}catch(w){c(["orion/i18n!"+d],n,p)}return s},formatMessage:function(a){var b=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,d){return b[(d<<0)+1]})}}});
define("orion/objects",[],function(){function c(a){for(var b=1;b<arguments.length;b++){var c=arguments[b],d;for(d in c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d])}return a}return{clone:function(a){if(Array.isArray(a))return Array.prototype.slice.call(a);var b=Object.create(Object.getPrototypeOf(a));c(b,a);return b},mixin:c,toArray:function(a){return Array.isArray(a)?a:[a]}}});
(function(){function c(m){if("string"!==typeof m)throw new TypeError;}function a(m){return m?m.split("\x26"):[]}function b(m){return 0===m.length?"":m.join("\x26")}function l(m){var a=/([^=]*)(?:=?)(.*)/.exec(m);m=a[1]?decodeURIComponent(a[1]):"";a=a[2]?decodeURIComponent(a[2]):"";return[m,a]}function d(a){var b=encodeURIComponent(a[0]);a[1]&&(b+="\x3d"+encodeURIComponent(a[1]));return b}function n(m,b){var e="",d=[],c=0;return{next:function(){e!==m.query&&(e=m.query,d=a(e));if(c<d.length){var k=
l(d[c++]);switch(b){case "keys":return k[0];case "values":return k[1];case "keys+values":return[k[0],k[1]];default:throw new TypeError;}}throw C;}}}function p(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function s(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function u(a){var b=[];a.split("/").forEach(function(a){".."===a?b.pop():"."!==a&&b.push(a)});return b.join("/")}function w(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function r(a,b){if("string"!==
typeof a)throw new TypeError;a=w(a);var d=f.exec(a);if(!d)return null;var c={};c.scheme=d[1]||"";if(c.scheme&&!x.test(c.scheme))return null;var t=d[2];if(t&&(t=e.exec(t),c.userinfo=t[1],c.host=t[2],c.port=t[3],c.port&&!k.test(c.port)))return null;c.path=d[3];c.query=d[4];c.fragment=d[5];!c.scheme&&b&&(c.scheme=b.scheme,!c.host&&b.host&&(c.userinfo=b.userinfo,c.host=b.host,c.port=b.port,c.pathRelative=!0));c.pathRelative&&(c.path?"/"!==c.path[0]&&(d=/^(.*\/)[^\/]*$/.exec(b.path)[1]||"/",c.path=d+c.path):
c.path=b.path);c.scheme&&(c.scheme=c.scheme.toLowerCase());c.port&&(c.port=s(c.port));c.host&&c.path&&(c.path=u(c.path));return c}function q(a,c){var b;if(c){c=c.href||c;b=r(c);if(!b||!b.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:b})}b=r(a,b);if(!b)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:b,writable:!0});var d=new p(this);Object.defineProperty(this,"query",{get:function(){return this._url?
d:null},enumerable:!0})}try{var h;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(h=new window.URL("http://www.w3.org?q")).protocol&&h.query)return}catch(g){}var f=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,e=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,x=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,k=/^\d*$/,z=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,A=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,y=/^([^?#\s]*)$/,v=/^([^\s]*)$/,t=/^\S*$/,B=/([^:]*):?(.*)/,C="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),D={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(p.prototype,{get:{value:function(m){c(m);var b;a(this._url.query).some(function(a){a=l(a);if(a[0]===m)return b=a[1],!0});return b},enumerable:!0},set:{value:function(m,e){c(m);c(e);var t=a(this._url.query);t.some(function(a,c){var b=l(a);if(b[0]===m)return b[1]=e,t[c]=d(b),!0})||t.push(d([m,e]));this._url.query=b(t)},enumerable:!0},has:{value:function(m){c(m);
return a(this._url.query).some(function(a){if(l(a)[0]===m)return!0})},enumerable:!0},"delete":{value:function(m){c(m);var d=a(this._url.query),e=d.filter(function(a){return l(a)[0]!==m});return e.length!==d.length?(this._url.query=b(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,c){if("function"!==typeof a)throw new TypeError;var b=n(this._url,"keys+values");try{for(;;){var d=b.next();a.call(c,d[1],d[0],this)}}catch(e){if(e!==C)throw e;
}},enumerable:!0},keys:{value:function(){return n(this._url,"keys")},enumerable:!0},values:{value:function(){return n(this._url,"values")},enumerable:!0},items:{value:function(){return n(this._url,"keys+values")}},size:{get:function(){return a(this._url.query).length},enumerable:!0},getAll:{value:function(m){c(m);var b=[];a(this._url.query).forEach(function(a){a=l(a);a[0]===m&&b.push(a[1])});return b},enumerable:!0},append:{value:function(m,e){c(m);c(e);var t=a(this._url.query);t.push(d([m,e]));this._url.query=
b(t)},enumerable:!0}});Object.defineProperties(q.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var b=a.scheme?a.scheme+":":"";a.host&&(b+="//",a.userinfo&&(b+=a.userinfo+"@"),b+=a.host,a.port&&(b+=":"+a.port));b+=a.path;a.query&&(b+="?"+a.query);a.fragment&&(b+="#"+a.fragment);a=b}else a=this._input;return a},set:function(a){c(a);this._input=a;this._url=r(this._input,this._baseURL)},enumerable:!0},origin:{get:function(){return this._url&&this._url.host?this.protocol+"//"+this.host:
""},enumerable:!0},protocol:{get:function(){return this._url?this._url.scheme+":":":"},set:function(a){c(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||x.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){c(a);this._url&&(this._url.userinfo=a)}},username:{get:function(){if(!this._url)return"";var a=B.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){c(a);if(this._url){var b=
B.exec(this._userinfo);a=[encodeURIComponent(a||"")];b[2]&&a.push(b[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=B.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){c(a);if(this._url){var b=[B.exec(this._userinfo)[1]||""];a&&b.push(encodeURIComponent(a));this._userinfo=b.join(":")}},enumerable:!0},host:{get:function(){var a="";this._url&&this._url.host&&(a+=this._url.host,this._url.port&&(a+=":"+this._url.port));return a},
set:function(a){c(a);if(this._url&&(a=A.exec(a)))this._url.host=a[1],this._url.port=s(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){c(a);this._url&&z.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===D[this.protocol]&&(a="");return a},set:function(a){c(a);this._url&&k.exec(a)&&(this._url.port=s(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){c(a);
this._url&&y.exec(a)&&(this._url.host&&a&&"/"!==a[0]&&(a="/"+a),this._url.path=a?u(a):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){c(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),v.exec(a)&&(this._url.query=a))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){c(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),t.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((h=window.URL||window.webkitURL)&&h.createObjectURL)Object.defineProperty(q,"createObjectURL",{value:h.createObjectURL.bind(h),enumerable:!1}),Object.defineProperty(q,"revokeObjectURL",{value:h.revokeObjectURL.bind(h),enumerable:!1});window.URL=q})();define("orion/URL-shim",[],function(){});
define("orion/PageLinks","require orion/Deferred orion/PageUtil orion/URITemplate orion/i18nUtil orion/objects orion/URL-shim".split(" "),function(c,a,b,l,d,n,p){function s(){return c.toUrl?(new URL(c.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function u(a){var b={};a.getPropertyKeys().forEach(function(c){"objectClass"!==c&&"service.names"!==c&&"service.id"!==c&&"__plugin__"!==c&&(b[c]=a.getProperty(c))});return b}function w(a){return d.getMessageBundle(a.nls).then(function(b){a.textContent=
a.nameKey?b[a.nameKey]:a.name;return a},function(b){a.textContent=a.nameKey||a.name;return a})}function r(c,d){var k=c.getServiceReferences(d||"orion.page.link"),f=b.matchResourceParameters(window.location.href),g={OrionHome:s(),Location:f.resource},h=[];k.forEach(function(c){c=u(c);if(c.uriTemplate&&(c.nls||c.name)){var d=(new l(c.uriTemplate)).expand(g),d=b.validateURLScheme(d);c.href=d;c.nls?h.push(w(c)):(c.textContent=c.name,h.push((new a).resolve(c)))}});return a.all(h)}function q(a){var b=this.categories=
Object.create(null);a.forEach(function(a){b[a.id]=a})}function h(a){this.allPageLinks=a;this.allPageLinks.sort(g)}function g(a,b){var c=a.textContent&&a.textContent.toLowerCase(),d=b.textContent&&b.textContent.toLowerCase();return c<d?-1:c>d?1:0}var f;n.mixin(q.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});n.mixin(h.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var b=a.href;a=
a.textContent;var c=document.createElement("a");c.href=b;c.target="_self";c.classList.add("targetSelector");c.textContent=a;return c})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(b){var c;return!f?(c=[],b.getServiceReferences("orion.page.link.category").forEach(function(b){b=u(b);if(b.id&&(b.name||b.nameKey))b.nls?c.push(w(b)):(b.textContent=b.name,c.push((new a).resolve(b)))}),a.all(c).then(function(a){return f=new q(a)})):(new a).resolve(f)},getPageLinksInfo:function(a,
b){return r(a,b).then(function(a){return new h(a)})},getOrionHome:s}});
(function(c,a){"function"===typeof define&&define.amd?define("orion/plugin",["orion/Deferred"],a):"object"===typeof exports?module.exports=a(require("orion/Deferred")):(c.orion=c.orion||{},c.orion.PluginProvider=a(c.orion.Deferred))})(this,function(c){function a(a,c){this.__objectId=a;this.__methods=c}return function(b){function l(a){g&&("undefined"===typeof ArrayBuffer&&(a=JSON.stringify(a)),g===self?g.postMessage(a):g.postMessage(a,"*"))}function d(){var a=[];Object.keys(y).forEach(function(b){var c=
y[b];a.push({serviceId:b,names:c.names,methods:c.methods,properties:c.properties})});return{headers:q||{},services:a}}function n(a,b){if(b&&b instanceof XMLHttpRequest){var c,d;try{c=b.status,d=b.statusText}catch(e){c=0,d=""}return{status:c||0,statusText:d}}return b}function p(a){var b=a?JSON.parse(JSON.stringify(a,n)):a;a instanceof Error&&(b.__isError=!0,b.message=b.message||a.message,b.name=b.name||a.name);return b}function s(b){if(!g)return(new c).reject(Error("plugin not connected"));b.id=String(f++);
var d=new c;z[b.id]=d;d.then(null,function(a){h&&a instanceof Error&&"Cancel"===a.name&&v({requestId:b.id,method:"cancel",params:a.message?[a.message]:[]})});var k=Object.prototype.toString;b.params.forEach(function(c,f){if("[object Object]"===k.call(c)&&!(c instanceof a)){var g,h;for(g in c)"[object Function]"===k.call(c[g])&&(h=h||[],h.push(g));if(h){var l=e++;A[l]=c;g=function(){delete A[l]};d.then(g,g);b.params[f]=new a(l,h)}}});v(b);return d.promise}function u(a,b){a||0===a?v({id:a,result:null,
error:b}):console.log(b)}function w(a,b,c,d){d.forEach(function(a,b){if(a&&"undefined"!==typeof a.__objectId){var c={};a.__methods.forEach(function(b){c[b]=function(){return s({objectId:a.__objectId,method:b,params:Array.prototype.slice.call(arguments)})}});d[b]=c}});var e=void 0===typeof a?null:{id:a,result:null,error:null};try{var f=c.apply(b,d);e&&(f&&"function"===typeof f.then?(k[a]=f,f.then(function(b){delete k[a];e.result=b;v(e)},function(b){k[a]&&(delete k[a],e.error=p(b),v(e))},function(){v({responseId:a,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(e.result=f,v(e)))}catch(g){e&&(e.error=p(g),v(e))}}function r(a){if(!(a.source!==g&&"undefined"!==typeof window)){a="string"!==typeof a.data?a.data:JSON.parse(a.data);try{if(a.method){var b=a.method,c=a.params||[];if("serviceId"in a){var d=y[a.serviceId];d||u(a.id,"service not found");d=d.implementation;b in d?w(a.id,d,d[b],c):u(a.id,"method not found")}else if("objectId"in a){var e=A[a.objectId];e||u(a.id,"object not found");!b in
e?w(a.id,e,e[b],c):u(a.id,"method not found")}else if("requestId"in a){var f=k[a.requestId];f&&"cancel"===b&&f.cancel&&f.cancel.apply(f,c)}else if("responseId"in a){var h=z[a.responseId];h&&"progress"===b&&h.progress&&h.progress.apply(h,c)}else throw Error("Bad method: "+a.method);}else{var l=z[String(a.id)];delete z[String(a.id)];a.error?l.reject(a.error):l.resolve(a.result)}}catch(n){console.log("Plugin._messageHandler "+n)}}}var q=b,h=!1,g=null,f=0,e=0,x=0,k={},z={},A={},y={},v=l;this.updateHeaders=
function(a){if(h)throw Error("Cannot update headers. Plugin Provider is connected");q=a};this.registerServiceProvider=this.registerService=function(a,b,c){if(h)throw Error("Cannot register service. Plugin Provider is connected");"string"===typeof a?a=[a]:Array.isArray(a)||(a=[]);var d=null,e=[];for(d in b)"function"===typeof b[d]&&e.push(d);y[x++]={names:a,methods:e,implementation:b,properties:c||{},listeners:{}}};this.connect=function(a,b){if(!h){if("undefined"===typeof window)g=self;else if(window!==
window.parent)g=window.parent;else if(null!==window.opener)g=window.opener;else{b&&b("No valid plugin target");return}addEventListener("message",r,!1);var c={method:"plugin",params:[d()]};l(c);h=!0}a&&a()};this.disconnect=function(){h&&(removeEventListener("message",r),g=null,h=!1)}}});
define("built-pageLinksPlugin.js",["require","orion/PageLinks","orion/plugin","orion/URITemplate"],function(c,a,b,l){var d={};b=new b({name:"Orion Page Links",version:"1.0",description:"This plugin provides the top-level page links for Orion."});b.registerService("orion.page.link.category",null,{id:"edit",nameKey:"Editor",nls:"orion/nls/messages",imageClass:"core-sprite-edit",order:10});b.registerService("orion.page.link.category",null,{id:"search",nameKey:"Search",nls:"orion/nls/messages",imageClass:"core-sprite-search",
order:30});b.registerService("orion.page.link.category",null,{id:"shell",nameKey:"Shell",nls:"orion/nls/messages",imageClass:"core-sprite-shell",order:40});b.registerService("orion.page.link",null,{nameKey:"EditorLinkWorkspace",nls:"orion/nls/messages",tooltip:"Edit code",category:"edit","default":!0,uriTemplate:"{+OrionHome}/edit/edit.html"});b.registerService("orion.page.link",d,{nameKey:"ShellLinkWorkspace",id:"orion.shell",nls:"orion/nls/messages",category:"shell","default":!0,uriTemplate:"{+OrionHome}/shell/shellPage.html"});
b.registerService("orion.page.link",d,{nameKey:"Search",id:"orion.Search",nls:"orion/nls/messages",category:"search","default":!0,order:10,uriTemplate:"{+OrionHome}/search/search.html"});b.registerService("orion.page.link.related",null,{id:"orion.editFromMetadata",nameKey:"EditorRelatedLink",nls:"orion/nls/messages",tooltip:"Open Editor page",category:"edit",order:1,validationProperties:[{source:"ChildrenLocation|ContentLocation",variableName:"EditorLocation",replacements:[{pattern:"\\?depth\x3d1$",
replacement:""}]}],uriTemplate:"{+OrionHome}/edit/edit.html#{,EditorLocation}"});b.registerService("orion.page.link.related",null,{id:"orion.editParent",nameKey:"EditorRelatedLinkParent",nls:"orion/nls/messages",category:"edit",order:3,validationProperties:[{source:"Parents[0]:Location",variableName:"EditorLocation",replacements:[{pattern:"\\?depth\x3d1$",replacement:""}]}],uriTemplate:"{+OrionHome}/edit/edit.html#{,EditorLocation}"});b.registerService("orion.page.link.related",null,{id:"orion.editProjectRoot",
nameKey:"EditorRelatedLinkProj",nls:"orion/nls/messages",category:"edit",order:5,validationProperties:[{source:"Parents[-1]:Location",variableName:"EditorLocation",replacements:[{pattern:"\\?depth\x3d1$",replacement:""}]}],uriTemplate:"{+OrionHome}/edit/edit.html#{,EditorLocation}"});b.registerService("orion.page.link.user",null,{id:"orion.help",nameKey:"Help",nls:"orion/widgets/nls/messages",uriTemplate:c.toUrl("help/index.jsp"),category:"user.0"});b.registerService("orion.page.link.user",null,{id:"orion.report.bug",
nameKey:"Report a Bug",nls:"orion/widgets/nls/messages",uriTemplate:"https://bugs.eclipse.org/bugs/enter_bug.cgi?product\x3dOrion\x26component\x3dClient\x26version\x3d5.0",category:"user.0"});b.registerService("orion.page.link.user",null,{id:"orion.settings",nameKey:"Settings",nls:"orion/widgets/nls/messages",uriTemplate:"{+OrionHome}/settings/settings.html",category:"user.1"});c=document.createElement("a");c.href="./contentTemplates/helloWorld.zip";d=document.createElement("a");d.href="./contentTemplates/pluginHelloWorld.zip";
b.registerService("orion.core.content",null,{id:"orion.content.html5",nameKey:"Sample HTML5 Site",nls:"orion/nls/messages",descriptionKey:"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.",contentURITemplate:c.href});b.registerService("orion.core.content",null,{id:"orion.content.plugin",nameKey:"Sample Orion Plugin",nls:"orion/nls/messages",descriptionKey:"Generate a sample plugin for integrating with Orion.",contentURITemplate:d.href});b.registerService("orion.core.setting",
null,{settings:[{pid:"nav.config",nls:"orion/settings/nls/messages",nameKey:"Navigation",category:"general",categoryKey:"General",properties:[{id:"links.newtab",nameKey:"Links",type:"boolean",defaultValue:!1,options:[{value:!0,labelKey:"Open in new tab"},{value:!1,labelKey:"Open in same tab"}]}]}]});b.registerService("orion.core.getplugins",null,{uri:decodeURIComponent((new l("http://orion-plugins.googlecode.com/git/index.html#?target\x3d{InstallTarget}\x26version\x3d{Version}\x26OrionHome\x3d{OrionHome}")).expand({Version:"5.0",
InstallTarget:a.getOrionHome()+"/settings/settings.html",OrionHome:a.getOrionHome()}))});b.registerService("orion.page.getstarted",null,{data:[{label:"Add",image:"../images/add.png",secondaryImage:"../images/add-large-dulled.png",alt:"Add Content",media:"../media/Create.gif"},{label:"Modify",image:"../images/modify.png",secondaryImage:"../images/gear-large-dulled.png",alt:"Modify Content",media:"../media/Modify.gif"},{label:"Manage",image:"../images/manage.png",secondaryImage:"../images/hamburger-large-dulled.png",
alt:"Manage Content",media:"../media/Manage.gif"}]});b.connect()});
//@ sourceMappingURL=built-pageLinksPlugin.js.map