/*******************************************************************************
 * @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) 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, 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
 *******************************************************************************/

/******************************************************************************* 
 * @license
 * Copyright (c) 2011, 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
 ******************************************************************************/

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

/*

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

 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) 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, 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) 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
*/
(function(e,g){typeof define==="function"&&define.amd?define("orion/Deferred",g):typeof exports==="object"?module.exports=g():(e.orion=e.orion||{},e.orion.Deferred=g())})(this,function(){function e(){for(var d;d=h.shift();)d();i=!1}function g(d){h.push(d);i||(i=!0,setTimeout(e,0))}function f(d){return function(){d.apply(void 0,arguments)}}function j(){function d(){for(var a;a=l.shift();){var b=a.deferred,c=m==="fulfilled"?"resolve":"reject";if(typeof a[c]==="function")try{var d=(0,a[c])(k),g=d&&(typeof d===
"object"||typeof d==="function")&&d.then;if(typeof g==="function")if(d===b.promise)b.reject(new TypeError);else{var e=d.cancel;typeof e==="function"?b._protected(h).parentCancel=e.bind(d):delete b._protected(h).parentCancel;g.call(d,f(b.resolve),f(b.reject),f(b.progress))}else b.resolve(d)}catch(o){b.reject(o)}else b[c](k)}}function b(a){delete o.parentCancel;m="rejected";k=a;l.length&&g(d)}function a(c){function f(a){return function(c){h||(h=!0,a(c))}}var h=!1;delete o.parentCancel;try{var i=c&&
(typeof c==="object"||typeof c==="function")&&c.then;if(typeof i==="function")if(c===e)b(new TypeError);else{m="assumed";var q=c&&c.cancel;if(typeof q!=="function"){var r=new j,c=r.promise;try{i(r.resolve,r.reject,r.progress)}catch(s){r.reject(s)}q=c.cancel;i=c.then}k=c;i.call(c,f(a),f(b));o.parentCancel=q.bind(c)}else m="fulfilled",k=c,l.length&&g(d)}catch(x){f(b)(x)}}function c(){var a=o.parentCancel;if(a)delete o.parentCancel,a();else if(!m)a=Error("Cancel"),a.name="Cancel",b(a)}var k,m,l=[],e=
this,o={};Object.defineProperty(this,"_protected",{value:function(a){if(a!==h)throw Error("protected");return o}});this.resolve=function(c){m||a(c);return e};this.reject=function(a){m||b(a);return e};this.progress=function(a){m||l.forEach(function(c){if(c.progress)try{c.progress(a)}catch(b){}});return e.promise};this.cancel=function(){o.parentCancel?setTimeout(c,0):c();return e};this.then=function(a,c,b){a={resolve:a,reject:c,progress:b,deferred:new j};l.push(a);a.deferred._protected(h).parentCancel=
e.promise.cancel.bind(e);(m==="fulfilled"||m==="rejected")&&g(d);return a.deferred.promise};this.promise={then:e.then,cancel:e.cancel}}var h=[],i=!1;j.all=function(d,b){function a(a,c){g||(f[a]=c,--k===0&&e.resolve(f))}function c(c,d){if(!g){if(b)try{a(c,b(d));return}catch(k){d=k}e.reject(d)}}var k=d.length,f=[],g=!1,e=new j;e.then(void 0,function(){g=!0;d.forEach(function(a){a.cancel&&a.cancel()})});k===0?e.resolve(f):d.forEach(function(b,d){b.then(a.bind(void 0,d),c.bind(void 0,d))});return e.promise};
j.when=function(d,b,a,c){var k;if(!(d&&typeof d.then==="function"))k=new j,k.resolve(d),d=k.promise;return d.then(b,a,c)};return j});
(function(e,g){typeof define==="function"&&define.amd?define("orion/plugin",["orion/Deferred"],g):typeof exports==="object"?module.exports=g(require("orion/Deferred")):(e.orion=e.orion||{},e.orion.PluginProvider=g(e.orion.Deferred))})(this,function(e){function g(f,g){this.__objectId=f;this.__methods=g}return function(f){function j(a){p&&(typeof ArrayBuffer==="undefined"&&(a=JSON.stringify(a)),p===self?p.postMessage(a):p.postMessage(a,"*"))}function h(){var a=[];Object.keys(r).forEach(function(c){var b=
r[c];a.push({serviceId:c,names:b.names,methods:b.methods,properties:b.properties})});return{headers:m||{},services:a}}function i(a,c){if(c&&c instanceof XMLHttpRequest){var b,d;try{b=c.status,d=c.statusText}catch(k){b=0,d=""}return{status:b||0,statusText:d}}return c}function d(a){var c=a?JSON.parse(JSON.stringify(a,i)):a;if(a instanceof Error)c.__isError=!0,c.message=c.message||a.message,c.name=c.name||a.name;return c}function b(a){if(!p)return(new e).reject(Error("plugin not connected"));a.id=String(o++);
var c=new e;n[a.id]=c;c.then(null,function(c){l&&c instanceof Error&&c.name==="Cancel"&&s({requestId:a.id,method:"cancel",params:c.message?[c.message]:[]})});var b=Object.prototype.toString;a.params.forEach(function(d,k){if(b.call(d)==="[object Object]"&&!(d instanceof g)){var f,e;for(f in d)b.call(d[f])==="[object Function]"&&(e=e||[],e.push(f));if(e){var l=w++;q[l]=d;f=function(){delete q[l]};c.then(f,f);a.params[k]=new g(l,e)}}});s(a);return c.promise}function a(a,c){a||a===0?s({id:a,result:null,
error:c}):console.log(c)}function c(a,c,k,v){v.forEach(function(a,c){if(a&&typeof a.__objectId!=="undefined"){var d={};a.__methods.forEach(function(c){d[c]=function(){return b({objectId:a.__objectId,method:c,params:Array.prototype.slice.call(arguments)})}});v[c]=d}});var f=typeof a===void 0?null:{id:a,result:null,error:null};try{var g=k.apply(c,v);if(f)g&&typeof g.then==="function"?(u[a]=g,g.then(function(c){delete u[a];f.result=c;s(f)},function(c){if(u[a])delete u[a],f.error=d(c),s(f)},function(){s({responseId:a,
method:"progress",params:Array.prototype.slice.call(arguments)})})):(f.result=g,s(f))}catch(e){if(f)f.error=d(e),s(f)}}function k(b){if(b.source===p){b=typeof b.data!=="string"?b.data:JSON.parse(b.data);try{if(b.method){var d=b.method,k=b.params||[];if("serviceId"in b){var v=r[b.serviceId];v||a(b.id,"service not found");v=v.implementation;d in v?c(b.id,v,v[d],k):a(b.id,"method not found")}else if("objectId"in b){var f=q[b.objectId];f||a(b.id,"object not found");!d in f?c(b.id,f,f[d],k):a(b.id,"method not found")}else if("requestId"in
b){var g=u[b.requestId];g&&d==="cancel"&&g.cancel&&g.cancel.apply(g,k)}else if("responseId"in b){var e=n[b.responseId];e&&d==="progress"&&e.progress&&e.progress.apply(e,k)}else throw Error("Bad method: "+b.method);}else{var l=n[String(b.id)];delete n[String(b.id)];b.error?l.reject(b.error):l.resolve(b.result)}}catch(h){console.log("Plugin._messageHandler "+h)}}}var m=f,l=!1,p=null,o=0,w=0,t=0,u={},n={},q={},r={},s=j;this.updateHeaders=function(a){if(l)throw Error("Cannot update headers. Plugin Provider is connected");
m=a};this.registerServiceProvider=this.registerService=function(a,c,b){if(l)throw Error("Cannot register service. Plugin Provider is connected");typeof a==="string"?a=[a]:Array.isArray(a)||(a=[]);var d=null,k=[];for(d in c)typeof c[d]==="function"&&k.push(d);r[t++]={names:a,methods:k,implementation:c,properties:b||{},listeners:{}}};this.connect=function(a,c){if(!l){if(typeof window==="undefined")p=self;else if(window!==window.parent)p=window.parent;else if(window.opener!==null)p=window.opener;else{c&&
c("No valid plugin target");return}addEventListener("message",k,!1);var b={method:"plugin",params:[h()]};j(b);l=!0}a&&a()};this.disconnect=function(){l&&(removeEventListener("message",k),p=null,l=!1)}}});
define("orion/xhr",["orion/Deferred"],function(e){function g(f,g,e,i){var d=typeof e.response!=="undefined"?e.response:e.responseText,b;try{b=e.status}catch(a){b=0}f={args:g,response:d,responseText:typeof d==="string"?d:null,status:b,url:f,xhr:e};if(typeof i!=="undefined")f.error=i;return f}return function(f,j,h){var h=h||{},i=arguments.length>3&&arguments[3]?arguments[3]:new XMLHttpRequest,d=new e,b=h.headers||{},a=h.log||!1,c;typeof b["X-Requested-With"]==="undefined"&&(b["X-Requested-With"]="XMLHttpRequest");
if(typeof h.data!=="undefined"&&(f==="POST"||f==="PUT"))c=h.data;var k=!1,m=!1;d.promise.then(void 0,function(a){k=!0;!m&&a instanceof Error&&a.name==="Cancel"&&i.abort()});i.onabort=function(){m=!0;if(!k){var a=Error("Cancel");a.name="Cancel";d.reject(a)}};i.onload=function(){var c=g(j,h,i);200<=i.status&&i.status<400?d.resolve(c):(d.reject(c),a&&typeof console!=="undefined"&&console.log(Error(i.statusText)))};i.onerror=function(){var c=g(j,h,i);d.reject(c);a&&typeof console!=="undefined"&&console.log(Error(i.statusText))};
i.onprogress=function(a){a.xhr=i;d.progress(a)};try{i.open(f,j,!0);if(typeof h.responseType==="string")i.responseType=h.responseType;if(typeof h.timeout==="number")if(typeof i.timeout==="number")i.timeout=h.timeout,i.addEventListener("timeout",function(){d.reject(g(j,h,i,"Timeout exceeded"))});else{var l=setTimeout(function(){d.reject(g(j,h,i,"Timeout exceeded"))},h.timeout);d.promise.then(clearTimeout.bind(null,l),clearTimeout.bind(null,l))}Object.keys(b).forEach(function(a){i.setRequestHeader(a,
b[a])});i.send(c||null)}catch(p){d.reject(g(j,h,i,p))}return d.promise}});
define("orion/EventTarget",[],function(){function e(){this._namedListeners={}}e.prototype={dispatchEvent:function(g){if(!g.type)throw Error("unspecified type");var f=this._namedListeners[g.type];f&&f.forEach(function(f){try{typeof f==="function"?f(g):f.handleEvent(g)}catch(e){typeof console!=="undefined"&&console.log(e)}});return!g.defaultPrevented},addEventListener:function(e,f){if(typeof f==="function"||f.handleEvent)this._namedListeners[e]=this._namedListeners[e]||[],this._namedListeners[e].push(f)},
removeEventListener:function(e,f){var j=this._namedListeners[e];if(j)for(var h=0;h<j.length;h++)if(j[h]===f){j.length===1?delete this._namedListeners[e]:j.splice(h,1);break}}};e.prototype.constructor=e;e.attach=function(g){var f=new e;g.dispatchEvent=f.dispatchEvent.bind(f);g.addEventListener=f.addEventListener.bind(f);g.removeEventListener=f.removeEventListener.bind(f)};return e});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(e,g){function f(b,a,c){this._properties=c||{};this._properties["service.id"]=b;this._properties.objectClass=a;this._properties["service.names"]=a}function j(b,a,c){this._serviceId=b;this._serviceReference=a;this._internalRegistry=c}function h(b,a){function c(c){return function(){var d;try{if(!a())throw Error("Service was unregistered");var k=b[c].apply(b,Array.prototype.slice.call(arguments));if(k&&typeof k.then==="function")return k;
else d=new e,d.resolve(k)}catch(f){d=new e,d.reject(f)}return d.promise}}for(var d in b)typeof b[d]==="function"&&(this[d]=c(d))}function i(b,a){this.type=b;this.serviceReference=a}function d(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new g;var b=this;this._internalRegistry={isRegistered:function(a){return b._entries[a]?!0:!1},unregisterService:function(a){var c=b._entries[a];if(!c)throw Error("Service has already been unregistered: "+a);var d=c.reference;b._serviceEventTarget.dispatchEvent(new i("unregistering",
d));b._entries[a]=null;d.getProperty("objectClass").forEach(function(a){for(var c=b._namedReferences[a],f=0;f<c.length;f++)if(c[f]===d){c.length===1?delete b._namedReferences[a]:c.splice(f,1);break}})},modifyService:function(a){var c=b._entries[a];if(!c)throw Error("Service not found while trying to send modified event: "+a);b._serviceEventTarget.dispatchEvent(new i("modified",c.reference))}}}f.prototype={getPropertyKeys:function(){var b=[],a;for(a in this._properties)this._properties.hasOwnProperty(a)&&
b.push(a);return b},getProperty:function(b){return this._properties[b]}};f.prototype.constructor=f;j.prototype={unregister:function(){this._internalRegistry.unregisterService(this._serviceId)},getReference:function(){if(!this._internalRegistry.isRegistered(this._serviceId))throw Error("Service has already been unregistered: "+this._serviceId);return this._serviceReference},setProperties:function(b){var a=this._serviceReference._properties;this._serviceReference._properties=b||{};b["service.id"]=this._serviceId;
b.objectClass=a.objectClass;b["service.names"]=a["service.names"];this._internalRegistry.modifyService(this._serviceId)}};j.prototype.constructor=j;d.prototype={getService:function(b){var a;if(typeof b==="string")(b=this._namedReferences[b])&&b.some(function(c){a=this._entries[c.getProperty("service.id")].service;return!!a},this);else if(b=this._entries[b.getProperty("service.id")])a=b.service;return a||null},getServiceReferences:function(b){if(b)return this._namedReferences[b]?this._namedReferences[b]:
[];var a=[];this._entries.forEach(function(c){c&&a.push(c.reference)});return a},registerService:function(b,a,c){if(typeof a==="undefined"||a===null)throw Error("invalid service");typeof b==="string"?b=[b]:Array.isArray(b)||(b=[]);var d=this._entries.length,e=new f(d,b,c),g=this._namedReferences;b.forEach(function(a){g[a]=g[a]||[];g[a].push(e)});b=new h(a,this._internalRegistry.isRegistered.bind(null,d));this._entries.push({reference:e,service:b});b=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new i("registered",
e));return new j(d,e,b)},addEventListener:function(b,a){this._serviceEventTarget.addEventListener(b,a)},removeEventListener:function(b,a){this._serviceEventTarget.removeEventListener(b,a)}};d.prototype.constructor=d;return{ServiceRegistry:d}});
define("orion/operation",["orion/xhr","orion/Deferred"],function(e,g){function f(g,i,d,b){e("GET",g,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){a=a.response?JSON.parse(a.response):null;i.progress(a);!a.type||a.type==="loadstart"||a.type==="progress"?setTimeout(function(){f(g,i,d,b)},2E3):(a.type==="error"||a.type==="abort"?i.reject(b?b(a):a.Result):i.resolve(d?d(a):a.Result.JsonData),a.Location||e("DELETE",g,{headers:{"Orion-Version":"1"},timeout:15E3}))},function(a){var c=a;if(a.responseText!==
void 0){c=a.responseText;try{c=JSON.parse(a.responseText)}catch(b){}}c.Message!==void 0?(c.HttpCode=c.HttpCode===void 0?a.status:c.HttpCode,c.Severity=c.Severity===void 0?"Error":c.Severity,i.reject(c)):i.reject({Severity:"Error",Message:c,HttpCode:a.status})})}function j(f,g){g.then(null,function(d){d instanceof Error&&d.name==="Cancel"&&e("PUT",f,{headers:{"Orion-Version":"1"},data:JSON.stringify({abort:!0}),timeout:15E3})})}return{handle:function(e,i,d){var b=new g;j(e,b);f(e,b,i,d);return b}}});
define("orion/git/gitClient",["require","orion/xhr","orion/Deferred","orion/operation"],function(e,g,f,j){var h=h||{};h.GitService=function(){function h(d){if(d)this._serviceRegistry=d,this._serviceRegistration=d.registerService("orion.git.provider",this),this._sshService=d.getService("orion.net.ssh")}h.prototype={checkGitService:function(){},cloneGitRepository:function(d,b,a,c,k,h,l,i,o,j,t){var u=this,n={};if(d)n.Name=d;if(a)n.Path=a;if(b)n.GitUrl=b;n.Location=c;if(k)n.GitSshUsername=k;if(h)n.GitSshPassword=
h;if(l)n.GitSshKnownHost=l;if(i)n.GitSshPrivateKey=i;if(o)n.GitSshPassphrase=o;if(j){if(j.GitMail)n.GitMail=j.GitMail;if(j.GitName)n.GitName=j.GitName}if(t)n.initProject=t;var d=e.toUrl("gitapi/clone/._"),d=d.substring(0,d.length-2),q=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(n)}).then(function(a){u._getGitServiceResponse(q,a)},function(a){u._handleGitServiceResponseError(q,a)});return q},removeGitRepository:function(d){var b=
this,a=new f;g("DELETE",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)});return a},getGitStatus:function(d){var b=this,a=new f;g("GET",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)});return a},stage:function(d){var b=
this,a=new f;g("PUT",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)});return a},stageMultipleFiles:function(d,b){var a=this,c=new f;g("PUT",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b})}).then(function(b){a._getGitServiceResponse(c,b)},function(b){a._handleGitServiceResponseError(c,
b)});return c},unstageAll:function(d,b){var a=this,c=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Reset:b})}).then(function(b){a._getGitServiceResponse(c,b)},function(b){a._handleGitServiceResponseError(c,b)});return c},unstage:function(d,b){var a=this,c=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b})}).then(function(b){a._getGitServiceResponse(c,
b)},function(b){a._handleGitServiceResponseError(c,b)});return c},checkoutPath:function(d,b){var a=this,c=new f;g("PUT",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Path:b,RemoveUntracked:"true"})}).then(function(b){a._getGitServiceResponse(c,b)},function(b){a._handleGitServiceResponseError(c,b)});return c},commitAll:function(d,b,a){var c=this,e=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,
handleAs:"json",data:a}).then(function(a){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)});return e},getGitClone:function(d){var b=this,a=new f;g("GET",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)});return a},getGitCloneConfig:function(d){var b=this,a=new f;g("GET",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)});return a},getGitBranch:function(d){var b=this,a=new f;g("GET",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)});return a},getGitRemote:function(d){var b=this,a=new f;g("GET",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)});return a},checkoutBranch:function(d,b){var a=this,c=new f;g("PUT",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Branch:b})}).then(function(b){a._getGitServiceResponse(c,b)},function(b){a._handleGitServiceResponseError(c,b)});return c},resetIndex:function(d,b){var a=this,c=new f;g("POST",d,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Commit:b,Reset:"HARD"})}).then(function(b){a._getGitServiceResponse(c,b)},function(b){a._handleGitServiceResponseError(c,b)});return c},addBranch:function(d,b,a){var c=this,e={};if(b)e.Name=b;if(a)e.Branch=a;var h=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(e)}).then(function(a){c._getGitServiceResponse(h,a)},function(a){c._handleGitServiceResponseError(h,
a)});return h},removeBranch:function(d){var b=this,a=new f;g("DELETE",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)});return a},addRemote:function(d,b,a){var c=this,e=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Remote:b,RemoteURI:a})}).then(function(a){c._getGitServiceResponse(e,
a)},function(a){c._handleGitServiceResponseError(e,a)});return e},removeRemote:function(d){var b=this,a=new f;g("DELETE",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)});return a},doGitLog:function(d){var b=this,a=new f;g("GET",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,
c)},function(c){b._handleGitServiceResponseError(a,c)});return a},getDiff:function(d,b){var a=this,c=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:b})}).then(function(b){a._getGitServiceResponse(c,b)},function(b){a._handleGitServiceResponseError(c,b)});return c},doFetch:function(d,b,a,c,e,h,l){var i=this,j=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",
data:JSON.stringify({Fetch:"true",Force:b,GitSshUsername:a,GitSshPassword:c,GitSshKnownHost:e,GitSshPrivateKey:h,GitSshPassphrase:l})}).then(function(a){i._getGitServiceResponse(j,a)},function(a){i._handleGitServiceResponseError(j,a)});return j},doPull:function(d,b,a,c,e,h,l){var i=this,j=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Pull:"true",Force:b,GitSshUsername:a,GitSshPassword:c,GitSshKnownHost:e,GitSshPrivateKey:h,
GitSshPassphrase:l})}).then(function(a){i._getGitServiceResponse(j,a)},function(a){i._handleGitServiceResponseError(j,a)});return j},doMerge:function(d,b,a){var c=this,e=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Merge:b,Squash:a})}).then(function(a){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)});return e},doCherryPick:function(d,b){var a=this,c=new f;g("POST",d,{headers:{"Orion-Version":"1",
"Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({"Cherry-Pick":b})}).then(function(b){a._getGitServiceResponse(c,b)},function(b){a._handleGitServiceResponseError(c,b)});return c},doRevert:function(d,b){var a=this,c=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Revert:b})}).then(function(b){a._getGitServiceResponse(c,b)},function(b){a._handleGitServiceResponseError(c,b)});return c},doRebase:function(d,
b,a){var c=this,e={};e.Rebase=b;if(a)e.Operation=a;var h=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify(e)}).then(function(a){c._getGitServiceResponse(h,a)},function(a){c._handleGitServiceResponseError(h,a)});return h},doPush:function(d,b,a,c,e,h,l,i,j){var w=this,t=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({PushSrcRef:b,PushTags:a,
Force:c,GitSshUsername:e,GitSshPassword:h,GitSshKnownHost:l,GitSshPrivateKey:i,GitSshPassphrase:j})}).then(function(a){w._getGitServiceResponse(t,a)},function(a){w._handleGitServiceResponseError(t,a)});return t},getLog:function(d,b){var a=this,c=new f,e=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({New:b})}).then(function(a){e.resolve(a.xhr.getResponseHeader("Location"))},function(b){a._handleGitServiceResponseError(c,
b)});e.then(function(b){g("GET",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(b){a._getGitServiceResponse(c,b)},function(b){a._handleGitServiceResponseError(c,b)})});return c},getDefaultRemoteBranch:function(d){var b=this,a=new f,c=new f;g("GET",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(a){b._getGitServiceResponse(c,a)},function(c){b._handleGitServiceResponseError(a,c)});
c.then(function(c){g("GET",c.Children[0].Location,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)})});return a},doAddTag:function(d,b){var a=this,c=new f;g("PUT",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Name:b})}).then(function(b){a._getGitServiceResponse(c,b)},function(b){a._handleGitServiceResponseError(c,
b)});return c},doRemoveTag:function(d){var b=this,a=new f;g("DELETE",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)});return a},checkoutTag:function(d,b,a){var c=this,e=new f;g("PUT",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Tag:b,Branch:a})}).then(function(a){c._getGitServiceResponse(e,
a)},function(a){c._handleGitServiceResponseError(e,a)});return e},addCloneConfigurationProperty:function(d,b,a){var c=this,e=new f;g("POST",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({Key:b,Value:a})}).then(function(a){c._getGitServiceResponse(e,a)},function(a){c._handleGitServiceResponseError(e,a)});return e},editCloneConfigurationProperty:function(d,b){var a=this,c=new f;g("PUT",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},
timeout:15E3,handleAs:"json",data:JSON.stringify({Value:b})}).then(function(b){a._getGitServiceResponse(c,b)},function(b){a._handleGitServiceResponseError(c,b)});return c},deleteCloneConfigurationProperty:function(d){var b=this,a=new f;g("DELETE",d,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json"}).then(function(c){b._getGitServiceResponse(a,c)},function(c){b._handleGitServiceResponseError(a,c)});return a},sendCommitReviewRequest:function(d,b,a,c,e,h){var l=
this,i=new f;g("POST",b,{headers:{"Orion-Version":"1","Content-Type":"charset=UTF-8"},timeout:15E3,handleAs:"json",data:JSON.stringify({ReviewReqCommit:d,ReviewReqUrl:c,ReviewReqNotifyLogin:a,ReviewReqAuthorName:e,ReviewMessage:h})}).then(function(a){l._getGitServiceResponse(i,a)},function(a){l._handleGitServiceResponseError(i,a)});return i},_getGitServiceResponse:function(d,b){var a=b.response?JSON.parse(b.response):null;if(b.xhr&&b.xhr.status===202){var c=j.handle(a.Location);c.then(d.resolve,function(b){b.failedOperation=
a.Location;d.reject(b)},d.progress);d.then(null,function(a){c.reject(a)})}else d.resolve(a)},_handleGitServiceResponseError:function(d,b){d.reject(b)}};return h}();return h});
define("orion/ssh/sshTools",[],function(){var e=e||{};e.SshService=function(){function e(f){if(f)this._serviceRegistry=f,this._serviceRegistration=f.registerService("orion.net.ssh",this)}e.prototype={_KNOWN_HOSTS:"known_hosts",addKnownHosts:function(e,g){g||(g="");var h=localStorage.getItem(g+this._KNOWN_HOSTS);h?h.indexOf(e)<0&&localStorage.setItem(g+this._KNOWN_HOSTS,h+"\n"+e):localStorage.setItem(g+this._KNOWN_HOSTS,e)},clearKnownhosts:function(e){e||(e="");localStorage.removeItem(e+this._KNOWN_HOSTS)},
getKnownHosts:function(e){e||(e="");return localStorage.getItem(e+this._KNOWN_HOSTS)}};return e}();return e});
define("orion/i18nUtil",["require","orion/Deferred"],function(e,g){function f(e){if(e=localStorage.getItem("orion/messageBundle/"+e))if(e=JSON.parse(e),e._expires&&e._expires>(new Date).getTime())return delete e._expires,e;return null}var j={};return{getMessageBundle:function(h){function i(){e(["i18n!"+h],function(a){if(a){var b=h;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+b,JSON.stringify(a));delete a._expires}d.resolve(a)})}if(j[h])return j[h];var d=new g;j[h]=
d;var b=f(h);if(b)return d.resolve(b),d;try{e([h],i)}catch(a){e(["orion/i18n!"+h],i)}return d},formatMessage:function(e){var f=arguments;return e.replace(/\$\{([^\}]+)\}/g,function(d,b){return f[(b<<0)+1]})}}});
(function(){function e(a){if(typeof a!=="string")throw new TypeError;}function g(a){return a?a.split("&"):[]}function f(a){return a.length===0?"":a.join("&")}function j(a){var b=/([^=]*)(?:=?)(.*)/.exec(a),a=b[1]?decodeURIComponent(b[1]):"",b=b[2]?decodeURIComponent(b[2]):"";return[a,b]}function h(a){var b=encodeURIComponent(a[0]);a[1]&&(b+="="+encodeURIComponent(a[1]));return b}function i(a,b){var c="",d=[],e=0;return{next:function(){if(c!==a.query)c=a.query,d=g(c);if(e<d.length){var f=j(d[e++]);
switch(b){case "keys":return f[0];case "values":return f[1];case "keys+values":return[f[0],f[1]];default:throw new TypeError;}}throw y;}}}function d(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function b(a){var b=[];a.split("/").forEach(function(a){a===".."?b.pop():a!=="."&&b.push(a)});return b.join("/")}function a(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function c(c,d){if(typeof c!=="string")throw new TypeError;var c=a(c),e=p.exec(c);
if(!e)return null;var f={};f.scheme=e[1]||"";if(f.scheme&&!w.test(f.scheme))return null;var g=e[2];if(g&&(g=o.exec(g),f.userinfo=g[1],f.host=g[2],f.port=g[3],f.port&&!t.test(f.port)))return null;f.path=e[3];f.query=e[4];f.fragment=e[5];if(!f.scheme&&d&&(f.scheme=d.scheme,!f.host&&d.host))f.userinfo=d.userinfo,f.host=d.host,f.port=d.port,f.pathRelative=!0;if(f.pathRelative)if(f.path){if(f.path[0]!=="/")e=/^(.*\/)[^\/]*$/.exec(d.path)[1]||"/",f.path=e+f.path}else f.path=d.path;if(f.scheme)f.scheme=
f.scheme.toLowerCase();if(f.port)f.port=/[1-9]\d*$/.exec(f.port)[0];if(f.host&&f.path)f.path=b(f.path);return f}function k(a,b){var e;if(b){b=b.href||b;e=c(b);if(!e||!e.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:e})}e=c(a,e);if(!e)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:e,writable:!0});var f=new d(this);Object.defineProperty(this,"query",{get:function(){return this._url?f:null},enumerable:!0})}
try{var m;if(typeof window.URL==="function"&&window.URL.length!==0&&(m=new window.URL("http://www.w3.org?q")).protocol==="http:"&&m.query)return}catch(l){}var p=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,o=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,w=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,t=/^\d*$/,u=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,n=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,q=/^([^?#\s]*)$/,r=/^([^\s]*)$/,s=/^\S*$/,x=/([^:]*):?(.*)/,y=typeof StopIteration!=="undefined"?
StopIteration:Error("Stop Iteration"),z={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(d.prototype,{get:{value:function(a){e(a);var b;g(this._url.query).some(function(c){c=j(c);if(c[0]===a)return b=c[1],!0});return b},enumerable:!0},set:{value:function(a,b){e(a);e(b);var c=g(this._url.query);c.some(function(d,e){var f=j(d);if(f[0]===a)return f[1]=b,c[e]=h(f),!0})||c.push(h([a,b]));this._url.query=f(c)},enumerable:!0},has:{value:function(a){e(a);
return g(this._url.query).some(function(b){if(j(b)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){e(a);var b=g(this._url.query),c=b.filter(function(b){return j(b)[0]!==a});return c.length!==b.length?(this._url.query=f(c),!0):!1},enumerable:!0},clear:{value:function(){this._url.query=""},enumerable:!0},forEach:{value:function(a,b){if(typeof a!=="function")throw new TypeError;var c=i(this._url,"keys+values");try{for(;;){var d=c.next();a.call(b,d[1],d[0],this)}}catch(e){if(e!==y)throw e;
}},enumerable:!0},keys:{value:function(){return i(this._url,"keys")},enumerable:!0},values:{value:function(){return i(this._url,"values")},enumerable:!0},items:{value:function(){return i(this._url,"keys+values")}},size:{get:function(){return g(this._url.query).length},enumerable:!0},getAll:{value:function(a){e(a);var b=[];g(this._url.query).forEach(function(c){c=j(c);c[0]===a&&b.push(c[1])});return b},enumerable:!0},append:{value:function(a,b){e(a);e(b);var c=g(this._url.query);c.push(h([a,b]));this._url.query=
f(c)},enumerable:!0}});Object.defineProperties(k.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){e(a);this._input=a;this._url=c(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){e(a);if(this._url&&(a=a.slice(-1)===":"?a.substring(0,a.length-1):a,w.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){e(a);if(this._url)this._url.userinfo=a}},username:{get:function(){if(!this._url)return"";var a=x.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){e(a);if(this._url){var b=
x.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=x.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){e(a);if(this._url){var b=[x.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){e(a);if(this._url&&(a=n.exec(a)))this._url.host=a[1],this._url.port=/[1-9]\d*$/.exec(a[2])[0]},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){e(a);if(this._url&&u.exec(a))this._url.host=a},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===z[this.protocol]&&(a="");return a},set:function(a){e(a);if(this._url&&t.exec(a))this._url.port=/[1-9]\d*$/.exec(a)[0]},enumerable:!0},pathname:{get:function(){return this._url?
this._url.path:""},set:function(a){e(a);if(this._url&&q.exec(a))this._url.host&&a&&a[0]!=="/"&&(a="/"+a),this._url.path=a?b(a):""},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){e(a);if(this._url&&(a&&a[0]==="?"&&(a=a.substring(1)),r.exec(a)))this._url.query=a},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){e(a);if(this._url&&(a&&a[0]==="#"&&(a=a.substring(1)),s.exec(a)))this._url.fragment=
a},enumerable:!0}});window.URL&&window.URL.createObjectURL&&(Object.defineProperty(k,"createObjectURL",{value:window.URL.createObjectURL.bind(window.URL),enumerable:!1}),Object.defineProperty(k,"revokeObjectURL",{value:window.URL.revokeObjectURL.bind(window.URL),enumerable:!1}));window.URL=k})();define("orion/URL-shim",function(){});
define("domReady",[],function(){function e(){if(!d){d=!0;h&&clearInterval(h);var c=a;if(d&&c.length){a=[];var e;for(e=0;e<c.length;e+=1)c[e](b)}}}function g(c){d?c(b):a.push(c);return g}var f,j,h,i=typeof window!=="undefined"&&window.document,d=!i,b=i?document:null,a=[];if(i){if(document.addEventListener)document.addEventListener("DOMContentLoaded",e,!1),window.addEventListener("load",e,!1);else if(window.attachEvent){window.attachEvent("onload",e);j=document.createElement("div");try{f=window.frameElement===
null}catch(c){}j.doScroll&&f&&window.external&&(h=setInterval(function(){try{j.doScroll(),e()}catch(a){}},30))}document.readyState==="complete"&&e()}g.version="2.0.1";g.load=function(a,b,c,d){d.isBuild?c(null):g(c)};return g});
define('built-gitPlugin.js',"orion/plugin,orion/xhr,orion/serviceregistry,orion/git/gitClient,orion/ssh/sshTools,orion/i18nUtil,orion/Deferred,orion/URL-shim,domReady!".split(","),function(e,g,f,j,h,i,d){function b(a){var b=a,c={};a.indexOf("://")>0&&(b=a.substring(a.indexOf("://")+3));a=b.split("/");c.serverName=a[0];if(c.serverName.indexOf("@"))c.serverName=c.serverName.substring(c.serverName.indexOf("@")+1);c.repoName=a[a.length-1];if(c.repoName.indexOf(".git")>0)c.repoName=c.repoName.substring(0,
c.repoName.lastIndexOf(".git"));return c}function a(a){return a.indexOf("@")>0&&a.indexOf("ssh://")>=0?a.substring(0,a.indexOf("ssh://")+6)+a.substring(a.indexOf("@")+1):a}var c=document.createElement("a");c.href="../mixloginstatic/LoginWindow.html";var f=new f.ServiceRegistry,k=new j.GitService(f),m=new h.SshService(f),e=new e({name:"Orion Git Support",version:"1.0",description:"This plugin provides Git Support to the Orion File Service.",login:c.href});e.registerService("orion.page.link",{},{nameKey:"Repositories",
id:"orion.git.repositories",nls:"git/nls/gitmessages",uriTemplate:"{+OrionHome}/git/git-repository.html#"});e.registerService("orion.navigate.command",{},{nameKey:"Git Status",id:"eclipse.git.status",tooltipKey:"Go to Git Status",nls:"git/nls/gitmessages",validationProperties:[{source:"Git:StatusLocation",variableName:"GitStatusLocation"},{source:"Directory",match:!0}],uriTemplate:"{+OrionHome}/git/git-status.html#{,GitStatusLocation}",forceSingleItem:!0});e.registerService("orion.navigate.command",
{},{nameKey:"Git Log",id:"eclipse.git.log",tooltipKey:"Go to Git Log",nls:"git/nls/gitmessages",validationProperties:[{source:"Git:CommitLocation",variableName:"GitLogLocation"}],uriTemplate:"{+OrionHome}/git/git-log.html#{,GitLogLocation}?page=1",forceSingleItem:!0});e.registerService("orion.navigate.command",{},{nameKey:"Git Remote",id:"eclipse.git.remote",tooltipKey:"Go to Git Remote",nls:"git/nls/gitmessages",validationProperties:[{source:"Git:DefaultRemoteBranchLocation",variableName:"GitRemoteLocation"}],
uriTemplate:"{+OrionHome}/git/git-log.html#{,GitRemoteLocation}?page=1",forceSingleItem:!0});e.registerService("orion.core.content",null,{id:"orion.content.gitClone",nls:"git/nls/gitmessages",nameKey:"Clone Git Repository",descriptionKey:"Go to the Orion repositories page to provide a git repository URL. Once the repository is created, it will appear in the Navigator.",uriTemplate:"{+OrionHome}/git/git-repository.html#,cloneGitRepository=URL"});e.registerService("orion.page.link.related",null,{id:"eclipse.git.status"});
e.registerService("orion.page.link.related",null,{nameKey:"Git Status",id:"eclipse.git.status2",tooltipKey:"Go to Git Status",nls:"git/nls/gitmessages",validationProperties:[{source:"StatusLocation|Clone:StatusLocation",variableName:"GitStatusLocation"}],uriTemplate:"{+OrionHome}/git/git-status.html#{,GitStatusLocation}"});e.registerService("orion.page.link.related",null,{id:"eclipse.git.log"});e.registerService("orion.page.link.related",null,{nameKey:"Active Branch Log",id:"eclipse.orion.git.switchToCurrentLocal",
tooltipKey:"Show the log for the active local branch",nls:"git/nls/gitmessages",validationProperties:[{source:"Clone:ActiveBranch",variableName:"GitBranchLocation"},{source:"toRef:Type",match:"RemoteTrackingBranch"}],uriTemplate:"{+OrionHome}/git/git-log.html#{,GitBranchLocation}?page=1",forceSingleItem:!0});e.registerService("orion.page.link.related",null,{nameKey:"Remote Branch Log",id:"eclipse.orion.git.switchToRemote2",tooltipKey:"Show the log for the corresponding remote tracking branch",nls:"git/nls/gitmessages",
validationProperties:[{source:"toRef:RemoteLocation:0:Children:0:CommitLocation",variableName:"GitRemoteLocation"}],uriTemplate:"{+OrionHome}/git/git-log.html#{,GitRemoteLocation}?page=1",forceSingleItem:!0});e.registerService("orion.page.link.related",null,{nameKey:"Git Repository",id:"eclipse.git.repository2",tooltipKey:"Go to the git repository",nls:"git/nls/gitmessages",validationProperties:[{source:"CloneLocation",variableName:"GitCloneLocation"},{source:"Type",match:"Commit"}],uriTemplate:"{+OrionHome}/git/git-repository.html#{,GitCloneLocation}"});
e.registerService("orion.page.link.related",null,{id:"eclipse.git.repository",nameKey:"Git Repository",tooltipKey:"Go to the git repository",nls:"git/nls/gitmessages",validationProperties:[{source:"Git:CloneLocation",variableName:"GitRepoLocation"}],uriTemplate:"{+OrionHome}/git/git-repository.html#{,GitRepoLocation}"});e.registerService("orion.page.link.related",null,{id:"orion.git.gotoEclipseGit",nameKey:"Show Repository in eclipse.org",tooltipKey:"Show this repository in eclipse.org",nls:"git/nls/gitmessages",
validationProperties:[{source:"GitUrl|Clone:GitUrl",match:"git.eclipse.org/gitroot",variableName:"EclipseGitLocation",variableMatchPosition:"after"}],uriTemplate:"http://git.eclipse.org/c{+EclipseGitLocation}"});e.registerService("orion.page.link.related",null,{id:"orion.git.gotoGithub",nameKey:"Show Repository in GitHub",nls:"git/nls/gitmessages",tooltipKey:"Show this repository in GitHub",validationProperties:[{source:"GitUrl|Clone:GitUrl",match:"github.com.*.git",variableName:"GitHubLocation",
variableMatchPosition:"only",replacements:[{pattern:":",replacement:"/"},{pattern:".git$",replacement:""}]}],uriTemplate:"https://{+GitHubLocation}"});e.registerServiceProvider("orion.page.link.related",null,{id:"orion.git.gotoGithubCommit",nameKey:"Show Commit in GitHub",nls:"git/nls/gitmessages",tooltipKey:"Show this commit in GitHub",validationProperties:[{source:"GitUrl",match:"github.com.*.git",variableName:"GitHubLocation",variableMatchPosition:"only",replacements:[{pattern:":",replacement:"/"},
{pattern:".git$",replacement:""}]},{source:"Type",match:"Commit"},{source:"Name",variableName:"commitName"}],uriTemplate:"https://{+GitHubLocation}/commit/{+commitName}"});e.registerServiceProvider("orion.page.link.related",null,{id:"orion.git.gotoEclipseGitCommit",nameKey:"Show Commit in eclipse.org",nls:"git/nls/gitmessages",tooltipKey:"Show this commit in eclipse.org",validationProperties:[{source:"GitUrl",match:"git.eclipse.org/gitroot",variableName:"EclipseGitLocation",variableMatchPosition:"after"},
{source:"Type",match:"Commit"},{source:"Name",variableName:"commitName"}],uriTemplate:"http://git.eclipse.org/c{+EclipseGitLocation}/commit/?id={+commitName}"});c.href="../../gitapi/diff/";e.registerService("orion.core.diff",{getDiffContent:function(a){a=new URL(a,window.location);a.query.set("parts","diff");return g("GET",a.href,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){return a.responseText})},getDiffFileURI:function(a){a=new URL(a,window.location);a.query.set("parts","uris");
return g("GET",a.href,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(a){return JSON.parse(a.responseText)})}},{pattern:c.href});e.registerService("orion.project.handler",{paramsToDependencyDescription:function(b){return{Type:"git",Location:a(b.url)}},_cloneRepository:function(c,e,f,g){var h=new d,j=m.getKnownHosts();k.cloneGitRepository(null,c,null,f,e.sshuser,e.sshpassword,j,null,null,null,g).then(function(c){k.getGitClone(c.Location).then(function(c){c.Children&&(c=c.Children[0]);var d=
b(c.GitUrl);g?h.resolve({ContentLocation:c.ContentLocation}):h.resolve({Type:"git",Location:a(c.GitUrl),Name:(d.repoName||c.Name)+" at "+d.serverName})},h.reject,h.progress)}.bind(this),function(a){try{if(a&&a.status!==void 0)try{a=JSON.parse(a.responseText)}catch(b){a={Message:"Problem while performing the action"}}}catch(d){h.reject(a);return}if(a.JsonData){if(a.JsonData.HostKey){confirm(i.formatMessage("Would you like to add ${0} key for host ${1} to continue operation? Key fingerpt is ${2}.",
a.JsonData.KeyType,a.JsonData.Host,a.JsonData.HostFingerprint))?(m.addKnownHosts(a.JsonData.Host+" "+a.JsonData.KeyType+" "+a.JsonData.HostKey),this._cloneRepository(c,e,f)):h.reject(a);return}if(a.JsonData.Host){a.retry=!0;a.addParamethers=[{id:"sshuser",type:"text",name:"Ssh User:"},{id:"sshpassword",type:"password",name:"Ssh Password:"}];h.reject(a);return}}h.reject(a)}.bind(this),h.progress);return h},initDependency:function(b,c,d){return this._cloneRepository(a(b.Location||c.url),c,d.WorkspaceLocation)},
initProject:function(b,c){return this._cloneRepository(a(b.url),b,c.WorkspaceLocation,!0)},getDependencyDescription:function(c){if(!c.Git)return null;var e=new d;k.getGitClone(c.Git.CloneLocation).then(function(c){c.Children&&(c=c.Children[0]);if(c.GitUrl){var d=b(c.GitUrl);e.resolve({Type:"git",Location:a(c.GitUrl),Name:(d.repoName||c.Name)+" at "+d.serverName})}},e.reject,e.progress);return e},getAdditionalProjectProperties:function(a){if(!a.Git)return null;var b=new d;k.getGitClone(a.Git.CloneLocation).then(function(c){c.Children&&
(c=c.Children[0]);b.resolve([{name:"Git",children:[{name:"Git Url",value:c.GitUrl},{name:"Git Status",value:"Git Status",href:"{+OrionHome}/git/git-status.html#"+a.Git.StatusLocation}]}])},b.reject,b.progress);return b}},{id:"orion.git.projecthandler",type:"git",addParamethers:[{id:"url",type:"url",name:"Url:"}],addDependencyName:"Add Git Repository",addDependencyTooltip:"Clone git repository and add it to this project",addProjectName:"Create a project from a Git Repository",addProjectTooltip:"Clone a Git Repository and add it as a project",
actionComment:"Cloning ${url}",validationProperties:[{source:"Git"}]});e.connect()});