/*

 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) 2014 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(){function c(a){if("string"!==typeof a)throw new TypeError;}function f(a){return a?a.split("\x26"):[]}function q(a){return 0===a.length?"":a.join("\x26")}function h(a){var b=/([^=]*)(?:=?)(.*)/.exec(a);a=b[1]?decodeURIComponent(b[1]):"";b=b[2]?decodeURIComponent(b[2]):"";return[a,b]}function n(a){var b=encodeURIComponent(a[0]);a[1]&&(b+="\x3d"+encodeURIComponent(a[1]));return b}function p(a,b){var e="",d=[],c=0;return{next:function(){e!==a.query&&(e=a.query,d=f(e));if(c<d.length){var g=
h(d[c++]);switch(b){case "keys":return g[0];case "values":return g[1];case "keys+values":return[g[0],g[1]];default:throw new TypeError;}}throw u;}}}function l(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function m(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function g(a){var b=[];a.split("/").forEach(function(a){".."===a?b.pop():"."!==a&&b.push(a)});return b.join("/")}function x(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function t(a,b){if("string"!==
typeof a)throw new TypeError;a=x(a);var e=y.exec(a);if(!e)return null;var d={};d.scheme=e[1]||"";if(d.scheme&&!v.test(d.scheme))return null;var c=e[2];if(c&&(c=z.exec(c),d.userinfo=c[1],d.host=c[2],d.port=c[3],d.port&&!w.test(d.port)))return null;d.path=e[3];d.query=e[4];d.fragment=e[5];!d.scheme&&b&&(d.scheme=b.scheme,!d.host&&b.host&&(d.userinfo=b.userinfo,d.host=b.host,d.port=b.port,d.pathRelative=!0));d.pathRelative&&(d.path?"/"!==d.path[0]&&(e=/^(.*\/)[^\/]*$/.exec(b.path)[1]||"/",d.path=e+d.path):
d.path=b.path);d.scheme&&(d.scheme=d.scheme.toLowerCase());d.port&&(d.port=m(d.port));d.host&&d.path&&(d.path=g(d.path));return d}function r(a,b){var e;if(b){b=b.href||b;e=t(b);if(!e||!e.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:e})}e=t(a,e);if(!e)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:e,writable:!0});var d=new l(this);Object.defineProperty(this,"query",{get:function(){return this._url?
d:null},enumerable:!0})}try{var k;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(k=new window.URL("http://www.w3.org?q")).protocol&&k.query)return}catch(G){}var y=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,z=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,v=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,w=/^\d*$/,A=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,B=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,C=/^([^?#\s]*)$/,D=/^([^\s]*)$/,E=/^\S*$/,s=/([^:]*):?(.*)/,u="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),F={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(l.prototype,{get:{value:function(a){c(a);var b;f(this._url.query).some(function(e){e=h(e);if(e[0]===a)return b=e[1],!0});return b},enumerable:!0},set:{value:function(a,b){c(a);c(b);var e=f(this._url.query);e.some(function(d,c){var g=h(d);if(g[0]===a)return g[1]=b,e[c]=n(g),!0})||e.push(n([a,b]));this._url.query=q(e)},enumerable:!0},has:{value:function(a){c(a);
return f(this._url.query).some(function(b){if(h(b)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){c(a);var b=f(this._url.query),e=b.filter(function(b){return h(b)[0]!==a});return e.length!==b.length?(this._url.query=q(e),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,b){if("function"!==typeof a)throw new TypeError;var e=p(this._url,"keys+values");try{for(;;){var d=e.next();a.call(b,d[1],d[0],this)}}catch(c){if(c!==u)throw c;
}},enumerable:!0},keys:{value:function(){return p(this._url,"keys")},enumerable:!0},values:{value:function(){return p(this._url,"values")},enumerable:!0},items:{value:function(){return p(this._url,"keys+values")}},size:{get:function(){return f(this._url.query).length},enumerable:!0},getAll:{value:function(a){c(a);var b=[];f(this._url.query).forEach(function(e){e=h(e);e[0]===a&&b.push(e[1])});return b},enumerable:!0},append:{value:function(a,b){c(a);c(b);var e=f(this._url.query);e.push(n([a,b]));this._url.query=
q(e)},enumerable:!0}});Object.defineProperties(r.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=t(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||v.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=s.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){c(a);if(this._url){var b=
s.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=s.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){c(a);if(this._url){var b=[s.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=B.exec(a)))this._url.host=a[1],this._url.port=m(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){c(a);this._url&&A.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===F[this.protocol]&&(a="");return a},set:function(a){c(a);this._url&&w.exec(a)&&(this._url.port=m(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(a){c(a);
this._url&&C.exec(a)&&(this._url.host&&(a&&"/"!==a[0])&&(a="/"+a),this._url.path=a?g(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)),D.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)),E.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((k=window.URL||window.webkitURL)&&k.createObjectURL)Object.defineProperty(r,"createObjectURL",{value:k.createObjectURL.bind(k),enumerable:!1}),Object.defineProperty(r,"revokeObjectURL",{value:k.revokeObjectURL.bind(k),enumerable:!1});window.URL=r})();define("orion/URL-shim",function(){});
define("javascript/plugins/javascriptPluginLoader",["orion/URL-shim"],function(c){function f(c){"undefined"!==typeof console&&console&&console.log(c)}function q(c){var f=c.data;f&&(f.method||f.id)&&l&&l.postMessage(c.data,"*")}function h(c){c.source===l&&m.postMessage(c.data)}c=localStorage.getItem("jstools.worker");var n=!1;try{n=null===c?!1:!!JSON.parse(c)}catch(p){"undefined"!==typeof console&&console&&console.log(p)}if(n){var l;(l=window!==window.parent?window.parent:window.opener)||console.log(Error("No valid plugin target"));
addEventListener("message",h);var m=new Worker((new URL("javascriptWorker.js",window.location.href)).href);m.addEventListener("message",q);m.addEventListener("error",f)}else require(["javascript/plugins/javascriptPlugin"])});
//@ sourceMappingURL=javascriptPluginLoader.js.map