(function(){function k(d,e,b,f,a,l){e[d]&&(b.push(d),(!0===e[d]||1===e[d])&&f.push(a+d+"/"+l))}function m(d,e,b,f,a){e=f+e+"/"+a;require._fileExists(d.toUrl(e+".js"))&&b.push(e)}function g(d,e,b){for(var f in e)e.hasOwnProperty(f)&&(!d.hasOwnProperty(f)||b)?d[f]=e[f]:"object"===typeof e[f]&&g(d[f],e[f],b)}var e=/(^.*(^|\/)nls(\/|$))([^\/]*)\/?([^\/]*)/;define("i18n",["module"],function(d){var n=d.config?d.config():{},n=n||{};return{version:"2.0.1+",load:function(b,f,a,l){l=l||{};l.locale&&(n.locale=
l.locale);var c=e.exec(b),h=c[1],d=c[4],p=c[5],s=d.split("-"),t=[],r={},u,D="";c[5]?(h=c[1],b=h+p):(p=c[4],d=n.locale,d||(d=n.locale="undefined"===typeof navigator?"root":(navigator.language||navigator.userLanguage||"root").toLowerCase()),s=d.split("-"));if(l.isBuild){t.push(b);m(f,"root",t,h,p);for(u=0;u<s.length;u++)l=s[u],D+=(D?"-":"")+l,m(f,D,t,h,p);f(t,function(){a()})}else f([b],function(l){var c=[],b;k("root",l,c,t,h,p);for(u=0;u<s.length;u++)b=s[u],D+=(D?"-":"")+b,k(D,l,c,t,h,p);f(t,function(){var b,
d,q;for(b=c.length-1;-1<b&&c[b];b--){q=c[b];d=l[q];if(!0===d||1===d)d=f(h+q+"/"+p);g(r,d)}a(r)})})}}})})();
define("orion/i18n",[],function(){return{load:function(k,m,g,e){e=e||{};var d=/(^.*(?:^|\/)nls(?:\/|$))([^\/]*)\/?([^\/]*)/,n=d.exec(k);if(n){if(!m.defined||m.defined(k))try{g(m(k));return}catch(b){}if(e.isBuild||e.isTest)g({});else if(m.specified&&!m.specified("orion/bootstrap"))g({});else{var f=n[1],a=n[3]?n[2]:"",l=n[3]||n[2];m(["orion/bootstrap"],function(c){c.startup().then(function(c){var b=c.serviceRegistry;c=b.getServiceReferences("orion.i18n.message");if(a)c.some(function(a){return k===a.getProperty("name")?
(b.getService(a).getMessageBundle().then(function(a){g(a)},function(){g({})}),!0):!1})||g({});else{var p={},s;c.forEach(function(c){var h=c.getProperty("name");if((n=d.exec(h))&&f===n[1]&&l===(n[3]||n[2]))if(a=n[3]?n[2]:""){if((c=e.locale||("undefined"!==typeof navigator?navigator.language||navigator.userLanguage:null))&&0===c.toLowerCase().indexOf(a.toLowerCase()))p[a]=!0,(!m.specified||!m.specified(h))&&define(h,["orion/i18n!"+h],function(a){return a})}else s=c});!m.specified||!m.specified(k)?s?
b.getService(s).getMessageBundle().then(function(a){Object.keys(p).forEach(function(l){"undefined"===typeof a[l]&&(a[l]=p[l])});define(k,[],a);g(a)},function(){define(k,[],p);g(p)}):(define(k,[],p),g(p)):g(p)}})})}}else g(null)}}});
define("orion/sites/nls/root/messages",{OK:"OK","Name:":"Name:",Path:"Path","Mount at (server path)":"Mount at (server path)","Mappings:":"Mappings:","Hostname hint:":"Hostname hint:","Status:":"Status:","Not a valid name":"Not a valid name","Not a valid hostname":"Not a valid hostname","Convert to Self-Hosting":"Convert to Self-Hosting","Enable the site configuration to launch an Orion server running your local client code":"Enable the site configuration to launch an Orion server running your local client code",
Save:"Save","Save the site configuration":"Save the site configuration","Choose folder...":"Choose folder\u2026",ConvertToSelfHostingTitle:"Locate Required Folders",SelectRequiredFoldersSingle:"Locate the following required folder in your workspace.",SelectRequiredFolders:"Locate the following required folders in your workspace.",LocateFolderTitle:"Locate ${0}",FolderPrompt:"${0} (${1}):",orionClientLabel:"Orion client repository","Loading...":"Loading...",Add:"Add","Add a directory mapping to the site configuration":"Add a directory mapping to the site configuration",
"There are unsaved changes. Do you still want to navigate away?":"There are unsaved changes. Do you still want to navigate away?","There are unsaved changes.":"There are unsaved changes.","Service method missing: ":"Service method missing: ","No Matching SiteService for ":"No Matching SiteService for ",Create:"Create","Create a new site configuration":"Create a new site configuration",Edit:"Edit","Edit the site configuration":"Edit the site configuration",Delete:"Delete","Delete the site configuration":"Delete the site configuration",
ConfirmDeleteSingle:"Are you sure you want to delete the site configuration '${0}'?",ConfirmDeleteMultiple:"Are you sure you want to delete these ${0} site configurations?",ViewOnSiteTitle:"View on Site",ViewOnSiteCaption:"Choose a site configuration to view '${0}' on.","Add to site":"Add to site","Add the file to this site":"Add the file to this site",View:"View","View the file on the site":"View the file on the site",Started:"Started at ${0}",Unknown:"Unknown",Name:"Name",Actions:"Actions",Status:"Status",
URL:"URL","New Site":"New Site",WorkspaceFile:"Workspace file: ${0}",WorkspaceFolder:"Workspace folder: ${0}",WorkspaceResourceNotFound:"Workspace resource not found: ${0}",ExternalLinkTo:"External link to ${0}","Move Up":"Move Up","Move Down":"Move Down",HostHint:"HostHint",Start:"Start",Stop:"Stop","Optional; used to determine the URL where a started site can be accessed.":"Optional; used to determine the URL where a started site can be accessed.","Changes you make here won't affect the running site.":"Changes you make here won't affect the running site.",
Stopped:"Stopped",Sites:"Sites",Mappings:"Mappings","SitesExplorer.NoSitesText":"You have no sites. Click ${0} to create a site."});define("orion/sites/nls/messages",["orion/i18n!orion/sites/nls/messages","orion/sites/nls/root/messages"],function(k,m){var g={root:m};Object.keys(k).forEach(function(e){"undefined"===typeof g[e]&&(g[e]=k[e])});return g});
(function(k,m){"function"===typeof define&&define.amd?define("orion/Deferred",m):"object"===typeof exports?module.exports=m():(k.orion=k.orion||{},k.orion.Deferred=m())})(this,function(){function k(){for(var f;f=d.shift();)f();n=!1}function m(f){d.push(f);n||(n=!0,b())}function g(f){return function(a){f(a)}}function e(){function f(){for(var a;a=d.shift();){var l=a.deferred,c="fulfilled"===b?"resolve":"reject";a=a[c];if("function"===typeof a)try{var f=a(h),e=f&&("object"===typeof f||"function"===typeof f)&&
f.then;if("function"===typeof e)if(f===l.promise)l.reject(new TypeError);else{var s=f.cancel;"function"===typeof s?l._parentCancel=s.bind(f):delete l._parentCancel;e.call(f,g(l.resolve),g(l.reject),g(l.progress))}else l.resolve(f)}catch(n){l.reject(n)}else l[c](h)}}function a(a){delete s._parentCancel;b="rejected";h=a;d.length&&m(f)}function l(c){function r(a){return function(l){(!b||"assumed"===b)&&a(l)}}delete s._parentCancel;try{var u=c&&("object"===typeof c||"function"===typeof c)&&c.then;if("function"===
typeof u)if(c===s)a(new TypeError);else{b="assumed";var g=c&&c.cancel;if("function"!==typeof g){var n=new e;c=n.promise;try{u(n.resolve,n.reject,n.progress)}catch(k){n.reject(k)}g=c.cancel;u=c.then}h=c;u.call(c,r(l),r(a));s._parentCancel=g.bind(c)}else b="fulfilled",h=c,d.length&&m(f)}catch(z){r(a)(z)}}function c(){var l=s._parentCancel;l?(delete s._parentCancel,l()):b||(l=Error("Cancel"),l.name="Cancel",a(l))}var h,b,d=[],s=this;this.resolve=function(a){b||l(a);return s};this.reject=function(l){b||
a(l);return s};this.progress=function(a){b||d.forEach(function(l){if(l.progress)try{l.progress(a)}catch(c){}});return s.promise};this.cancel=function(){s._parentCancel?setTimeout(c,0):c();return s};this.then=function(a,l,c){var h=new e;h._parentCancel=s.promise.cancel;d.push({resolve:a,reject:l,progress:c,deferred:h});("fulfilled"===b||"rejected"===b)&&m(f);return h.promise};this.promise={then:s.then,cancel:s.cancel}}var d=[],n=!1,b=function(){if("undefined"!==typeof process&&"function"===typeof process.nextTick){var f=
process.nextTick;return function(){f(k)}}if("function"===typeof MutationObserver){var a=document.createElement("div");(new MutationObserver(k)).observe(a,{attributes:!0});return function(){a.setAttribute("class","_tick")}}return function(){setTimeout(k,0)}}();e.all=function(f,a){function l(a,l){d||(b[a]=l,0===--h&&s.resolve(b))}function c(c,h){if(!d){if(a)try{l(c,a(h));return}catch(f){h=f}s.reject(h)}}var h=f.length,b=[],d=!1,s=new e;s.then(void 0,function(){d=!0;f.forEach(function(a){a.cancel&&a.cancel()})});
0===h?s.resolve(b):f.forEach(function(a,h){a.then(l.bind(void 0,h),c.bind(void 0,h))});return s.promise};e.when=function(f,a,l,c){var h;f&&"function"===typeof f.then||(h=new e,h.resolve(f),f=h.promise);return f.then(a,l,c)};return e});
define("orion/EventTarget",[],function(){function k(){this._namedListeners={}}k.prototype={dispatchEvent:function(k){if(!k.type)throw Error("unspecified type");var g=this._namedListeners[k.type];g&&g.forEach(function(e){try{"function"===typeof e?e(k):e.handleEvent(k)}catch(d){"undefined"!==typeof console&&console.log(d)}});return!k.defaultPrevented},addEventListener:function(k,g){if("function"===typeof g||g.handleEvent)this._namedListeners[k]=this._namedListeners[k]||[],this._namedListeners[k].push(g)},
removeEventListener:function(k,g){var e=this._namedListeners[k];if(e)for(var d=0;d<e.length;d++)if(e[d]===g){1===e.length?delete this._namedListeners[k]:e.splice(d,1);break}}};k.prototype.constructor=k;k.attach=function(m){var g=new k;m.dispatchEvent=g.dispatchEvent.bind(g);m.addEventListener=g.addEventListener.bind(g);m.removeEventListener=g.removeEventListener.bind(g)};return k});
define("orion/serviceregistry",["orion/Deferred","orion/EventTarget"],function(k,m){function g(f,a,l){this._properties=l||{};this._properties["service.id"]=f;this._properties.objectClass=a;this._properties["service.names"]=a}function e(f,a,l){this._serviceId=f;this._serviceReference=a;this._internalRegistry=l}function d(f,a){function l(l){return function(){var c;try{if(!a())throw Error("Service was unregistered");var b=f[l].apply(f,Array.prototype.slice.call(arguments));if(b&&"function"===typeof b.then)return b;
c=new k;c.resolve(b)}catch(d){c=new k,c.reject(d)}return c.promise}}for(var c in f)"function"===typeof f[c]&&(this[c]=l(c))}function n(f,a){this.type=f;this.serviceReference=a}function b(){this._entries=[];this._namedReferences={};this._serviceEventTarget=new m;var f=this;this._internalRegistry={isRegistered:function(a){return f._entries[a]?!0:!1},unregisterService:function(a){var l=f._entries[a];if(!l)throw Error("Service has already been unregistered: "+a);var c=l.reference;f._serviceEventTarget.dispatchEvent(new n("unregistering",
c));f._entries[a]=null;c.getProperty("objectClass").forEach(function(a){for(var l=f._namedReferences[a],b=0;b<l.length;b++)if(l[b]===c){1===l.length?delete f._namedReferences[a]:l.splice(b,1);break}})},modifyService:function(a){var l=f._entries[a];if(!l)throw Error("Service not found while trying to send modified event: "+a);f._serviceEventTarget.dispatchEvent(new n("modified",l.reference))}}}g.prototype={getPropertyKeys:function(){var f=[],a;for(a in this._properties)this._properties.hasOwnProperty(a)&&
f.push(a);return f},getProperty:function(f){return this._properties[f]}};g.prototype.constructor=g;e.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(f){var a=this._serviceReference._properties;this._serviceReference._properties=f||{};f["service.id"]=this._serviceId;
f.objectClass=a.objectClass;f["service.names"]=a["service.names"];this._internalRegistry.modifyService(this._serviceId)}};e.prototype.constructor=e;b.prototype={getService:function(f){var a;if("string"===typeof f)(f=this._namedReferences[f])&&f.some(function(l){a=this._entries[l.getProperty("service.id")].service;return!!a},this);else if(f=this._entries[f.getProperty("service.id")])a=f.service;return a||null},getServiceReferences:function(f){if(f)return this._namedReferences[f]?this._namedReferences[f]:
[];var a=[];this._entries.forEach(function(l){l&&a.push(l.reference)});return a},registerService:function(f,a,l){if("undefined"===typeof a||null===a)throw Error("invalid service");"string"===typeof f?f=[f]:Array.isArray(f)||(f=[]);var c=this._entries.length,h=new g(c,f,l),b=this._namedReferences;f.forEach(function(a){b[a]=b[a]||[];b[a].push(h)});f=new d(a,this._internalRegistry.isRegistered.bind(null,c));this._entries.push({reference:h,service:f});f=this._internalRegistry;this._serviceEventTarget.dispatchEvent(new n("registered",
h));return new e(c,h,f)},addEventListener:function(b,a){this._serviceEventTarget.addEventListener(b,a)},removeEventListener:function(b,a){this._serviceEventTarget.removeEventListener(b,a)}};b.prototype.constructor=b;return{ServiceRegistry:b}});
define("orion/xhr",["orion/Deferred"],function(k){function m(g,e,d,n){var b="undefined"!==typeof d.response?d.response:d.responseText,f;try{f=d.status}catch(a){f=0}g={args:e,response:b,responseText:"string"===typeof b?b:null,status:f,url:g,xhr:d};"undefined"!==typeof n&&(g.error=n);return g}return function(g,e,d){d=d||{};var n=3<arguments.length&&arguments[3]?arguments[3]:new XMLHttpRequest,b=new k,f=d.headers||{},a=d.log||!1,l;"undefined"===typeof f["X-Requested-With"]&&(f["X-Requested-With"]="XMLHttpRequest");
if("undefined"!==typeof d.data&&("POST"===g||"PUT"===g))l=d.data;var c=!1,h=!1;b.promise.then(void 0,function(a){c=!0;!h&&a instanceof Error&&"Cancel"===a.name&&n.abort()});n.onabort=function(){h=!0;if(!c){var a=Error("Cancel");a.name="Cancel";b.reject(a)}};n.onload=function(){var l=m(e,d,n);200<=n.status&&400>n.status?b.resolve(l):(b.reject(l),a&&"undefined"!==typeof console&&console.log(Error(n.statusText)))};n.onerror=function(){var l=m(e,d,n);b.reject(l);a&&"undefined"!==typeof console&&console.log(Error(n.statusText))};
n.onprogress=function(a){a.xhr=n;b.progress(a)};try{n.open(g,e,!0);"string"===typeof d.responseType&&(n.responseType=d.responseType);if("number"===typeof d.timeout)if("number"===typeof n.timeout)n.timeout=d.timeout,n.addEventListener("timeout",function(a){b.reject(m(e,d,n,"Timeout exceeded"))});else{var q=setTimeout(function(){b.reject(m(e,d,n,"Timeout exceeded"))},d.timeout);b.promise.then(clearTimeout.bind(null,q),clearTimeout.bind(null,q))}Object.keys(f).forEach(function(a){n.setRequestHeader(a,
f[a])});n.send(l||null)}catch(p){b.reject(m(e,d,n,p))}return b.promise}});
define("orion/preferences",["require","orion/Deferred","orion/xhr"],function(k,m,g){function e(a,c){this._name=a;this._providers=c;this._flushPending=!1;this._cached=null;this._stores=[];this._pendingDeletes=[];this._dirty=[]}function d(a,c){return{get:function(h,b){if(0===c)return null;var f=localStorage.getItem(a+h);if(null===f)return null;f=JSON.parse(f);return b||-1===c||f._expires&&f._expires>(new Date).getTime()?(delete f._expires,f):null},set:function(h,b){if(0!==c)if(-1!==c&&(b._expires=(new Date).getTime()+
1E3*c),0===Object.keys(b).length)localStorage.removeItem(a+h);else{var f=JSON.stringify(b);localStorage.setItem(a+h,f);delete b._expires}},remove:function(c){localStorage.removeItem(a+c)}}}function n(a){this._currentPromises={};this._cache=new d("/orion/preferences/user",3600);this._service=null;this.available=function(){if(!this._service){var c=a.getServiceReferences("orion.core.preference.provider");0<c.length&&(this._service=a.getService(c[0]))}return!!this._service}}function b(a){this._location=
a;this._currentPromise=null;this._cache=new d("/orion/preferences/default",3600)}function f(){this._cache=new d("/orion/preferences/local",-1)}function a(a,c){this._userProvider=new n(a);this._localProvider=new f;c=c||"defaults.pref";-1===c.indexOf("://")&&(c=k.toUrl(c));this._defaultsProvider=new b(c);this._serviceRegistration=a.registerService("orion.core.preference",this)}e.prototype={_flush:function(){for(var a=[],c=0;c<this._stores.length;++c){var h=this._stores[c];-1!==this._dirty.indexOf(h)&&
a.push(this._providers[c].put(this._name,h));if(this._pendingDeletes[c]&&0<this._pendingDeletes[c].length){for(h=0;h<this._pendingDeletes[c].length;h++)a.push(this._providers[c].remove(this._name,this._pendingDeletes[c][h]));delete this._pendingDeletes[c]}}this._dirty=[];return m.all(a)},_scheduleFlush:function(a){a&&-1===this._dirty.indexOf(a)&&this._dirty.push(a);this._flushPending||(this._flushPending=!0,window.setTimeout(function(){this._flushPending&&(this._flushPending=!1,this._flush())}.bind(this),
0))},_getCached:function(){if(!this._cached){this._cached={};for(var a=0;a<this._stores.length;++a){var c=this._stores[a],h;for(h in c)c.hasOwnProperty(h)&&"undefined"===typeof this._cached[h]&&(this._cached[h]=c[h])}}return this._cached},keys:function(){return Object.keys(this._getCached())},get:function(a){return this._getCached()[a]},put:function(a,c){if(0!==this._stores.length){var h=this._stores[0];h[a]!==c&&(h[a]=c,this._cached=null,this._scheduleFlush(h))}},remove:function(a){for(var c=0;c<
this._stores.length;++c){var h=this._stores[c];if(h.hasOwnProperty(a))return delete h[a],this._pendingDeletes[c]||(this._pendingDeletes[c]=[]),this._pendingDeletes[c].push(a),this._cached=null,this._scheduleFlush(),!0}return!1},clear:function(){for(var a=0;a<this._stores.length;++a)this._stores[a]={},this._scheduleFlush(this._stores[a]);this._cached=null},sync:function(a){if(this._flushPending)return this._flushPending=!1,this._flush();for(var c=this,h=[],b=0;b<this._providers.length;++b)h.push(this._providers[b].get(this._name,
a).then(function(a){return function(l){c._stores[a]=l}}(b)));return m.all(h).then(function(){c._cached=null;c._getCached()})},flush:function(){this._flush()}};n.prototype={get:function(a,c){if(this._currentPromises[a])return this._currentPromises[a];var h=new m,b=null;c?this._cache.remove(a):b=this._cache.get(a);if(null!==b)h.resolve(b);else{this._currentPromises[a]=h;var f=this;this._service.get(a).then(function(c){f._cache.set(a,c);delete f._currentPromises[a];h.resolve(c)},function(c){404===c.status?
(c={},f._cache.set(a,c),delete f._currentPromises[a],h.resolve(c)):(delete f._currentPromises[a],h.resolve(f._cache.get(a,!0)||{}))})}return h},put:function(a,c){this._cache.set(a,c);return this._service.put(a,c)},remove:function(a,c){var h=this._cache.get(a);delete h[c];this._cache.set(a,h);return this._service.remove(a,c)}};b.prototype={get:function(a,c){if(this._currentPromise)return this._currentPromise;var h=new m,b=null;c?this._cache.remove(a):b=this._cache.get(a);if(null!==b)h.resolve(b);else{this._currentPromise=
h;var f=this;g("GET",this._location,{headers:{"Orion-Version":"1"},timeout:15E3}).then(function(c){c=JSON.parse(c.response);f._cache.set(a,c[a]||{});f._currentPromise=null;h.resolve(c[a]||{})},function(c){401===c.xhr.status||404===c.xhr.status?(f._cache.set(a,{}),f._currentPromise=null,h.resolve({})):(f._currentPromise=null,c=f._cache.get(a,!0),null!==c?h.resolve(c[a]||{}):h.resolve({}))})}return h},put:function(a,c){var h=new m;h.resolve();return h},remove:function(a,c){var h=this._cache.get(a);
delete h[c];this.put(a,h)}};f.prototype={get:function(a){var c=new m;a=this._cache.get(a);null!==a?c.resolve(a):c.resolve({});return c},put:function(a,c){var h=new m;this._cache.set(a,c);h.resolve();return h},remove:function(a,c){var h=this._cache.get(a);delete h[c];this.put(a,h)}};a.DEFAULT_SCOPE=1;a.LOCAL_SCOPE=2;a.USER_SCOPE=4;a.prototype={listenForChangedSettings:function(b,c,h){if(!c||"number"!==typeof c||7<c||1>c)h=c,c=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;window.addEventListener("storage",
h,!1);return 0!==(a.USER_SCOPE&c)?"/orion/preferences/user"+b:0!==(a.LOCAL_SCOPE&c)?"/orion/preferences/local"+b:"/orion/preferences/default"+b},getPreferences:function(b,c){if(!c||"number"!==typeof c||7<c||1>c)c=a.DEFAULT_SCOPE|a.LOCAL_SCOPE|a.USER_SCOPE;var h=[];a.USER_SCOPE&c&&this._userProvider.available()&&h.push(this._userProvider);a.LOCAL_SCOPE&c&&h.push(this._localProvider);a.DEFAULT_SCOPE&c&&h.push(this._defaultsProvider);var f=new e(b,h);return f.sync().then(function(){return f})},getSetting:function(a,
c,b){for(var f,d=0;d<a.length;d++)if(a[d].label===c)for(var e=0;e<a[d].data.length;e++)if(a[d].data[e].label===b){f=a[d].data[e].value;break}return f}};return{PreferencesService:a}});
(function(){function k(a){if("string"!==typeof a)throw new TypeError;}function m(a){return a?a.split("\x26"):[]}function g(a){return 0===a.length?"":a.join("\x26")}function e(a){var c=/([^=]*)(?:=?)(.*)/.exec(a);a=c[1]?decodeURIComponent(c[1]):"";c=c[2]?decodeURIComponent(c[2]):"";return[a,c]}function d(a){var c=encodeURIComponent(a[0]);a[1]&&(c+="\x3d"+encodeURIComponent(a[1]));return c}function n(a,c){var b="",h=[],f=0;return{next:function(){b!==a.query&&(b=a.query,h=m(b));if(f<h.length){var l=
e(h[f++]);switch(c){case "keys":return l[0];case "values":return l[1];case "keys+values":return[l[0],l[1]];default:throw new TypeError;}}throw C;}}}function b(a){Object.defineProperty(this,"_url",{get:function(){return a._url}})}function f(a){return a?/[1-9]\d*$/.exec(a)[0]:""}function a(a){var c=[];a.split("/").forEach(function(a){".."===a?c.pop():"."!==a&&c.push(a)});return c.join("/")}function l(a){return a.replace(/\s/g,function(a){return"%"+a.charCodeAt(0).toString(16)})}function c(c,b){if("string"!==
typeof c)throw new TypeError;c=l(c);var h=s.exec(c);if(!h)return null;var d={};d.scheme=h[1]||"";if(d.scheme&&!r.test(d.scheme))return null;var e=h[2];if(e&&(e=t.exec(e),d.userinfo=e[1],d.host=e[2],d.port=e[3],d.port&&!u.test(d.port)))return null;d.path=h[3];d.query=h[4];d.fragment=h[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]&&(h=/^(.*\/)[^\/]*$/.exec(b.path)[1]||"/",d.path=h+d.path):
d.path=b.path);d.scheme&&(d.scheme=d.scheme.toLowerCase());d.port&&(d.port=f(d.port));d.host&&d.path&&(d.path=a(d.path));return d}function h(a,h){var f;if(h){h=h.href||h;f=c(h);if(!f||!f.scheme)throw new SyntaxError;Object.defineProperty(this,"_baseURL",{value:f})}f=c(a,f);if(!f)throw new SyntaxError;Object.defineProperty(this,"_input",{value:a,writable:!0});Object.defineProperty(this,"_url",{value:f,writable:!0});var l=new b(this);Object.defineProperty(this,"query",{get:function(){return this._url?
l:null},enumerable:!0})}try{var q;if("function"===typeof window.URL&&0!==window.URL.length&&"http:"===(q=new window.URL("http://www.w3.org?q")).protocol&&q.query)return}catch(p){}var s=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/,t=/^(?:(.*)@)?(\[[^\]]*\]|[^:]*)(?::(.*))?$/,r=/^([a-zA-Z](?:[a-zA-Z0-9+-.])*)$/,u=/^\d*$/,D=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)$/,v=/^(\[[^\]\/?#\s]*\]|[^:\/?#\s]*)(?::(\d*))?$/,E=/^([^?#\s]*)$/,z=/^([^\s]*)$/,w=/^\S*$/,A=/([^:]*):?(.*)/,C="undefined"!==
typeof StopIteration?StopIteration:Error("Stop Iteration"),J={"ftp:":"21","gopher:":"70","http:":"80","https:":"443","ws:":"80","wss:":"443"};Object.defineProperties(b.prototype,{get:{value:function(a){k(a);var c;m(this._url.query).some(function(h){h=e(h);if(h[0]===a)return c=h[1],!0});return c},enumerable:!0},set:{value:function(a,c){k(a);k(c);var h=m(this._url.query);h.some(function(b,f){var l=e(b);if(l[0]===a)return l[1]=c,h[f]=d(l),!0})||h.push(d([a,c]));this._url.query=g(h)},enumerable:!0},has:{value:function(a){k(a);
return m(this._url.query).some(function(c){if(e(c)[0]===a)return!0})},enumerable:!0},"delete":{value:function(a){k(a);var c=m(this._url.query),h=c.filter(function(c){return e(c)[0]!==a});return h.length!==c.length?(this._url.query=g(h),!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 h=n(this._url,"keys+values");try{for(;;){var b=h.next();a.call(c,b[1],b[0],this)}}catch(f){if(f!==C)throw f;
}},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 m(this._url.query).length},enumerable:!0},getAll:{value:function(a){k(a);var c=[];m(this._url.query).forEach(function(h){h=e(h);h[0]===a&&c.push(h[1])});return c},enumerable:!0},append:{value:function(a,c){k(a);k(c);var h=m(this._url.query);h.push(d([a,c]));this._url.query=
g(h)},enumerable:!0}});Object.defineProperties(h.prototype,{href:{get:function(){var a;if(this._url){a=this._url;var c=a.scheme?a.scheme+":":"";a.host&&(c+="//",a.userinfo&&(c+=a.userinfo+"@"),c+=a.host,a.port&&(c+=":"+a.port));c+=a.path;a.query&&(c+="?"+a.query);a.fragment&&(c+="#"+a.fragment);a=c}else a=this._input;return a},set:function(a){k(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){k(a);if(this._url&&(a=":"===a.slice(-1)?a.substring(0,a.length-1):a,""===a||r.test(a)))this._url.scheme=a.toLowerCase()},enumerable:!0},_userinfo:{get:function(){return this._url?this._url.userinfo:""},set:function(a){k(a);this._url&&(this._url.userinfo=a)}},username:{get:function(){if(!this._url)return"";var a=A.exec(this._userinfo);return decodeURIComponent(a[1]||"")},set:function(a){k(a);if(this._url){var c=
A.exec(this._userinfo);a=[encodeURIComponent(a||"")];c[2]&&a.push(c[2]);this._userinfo=a.join(":")}},enumerable:!0},password:{get:function(){if(!this._url)return"";var a=A.exec(this._userinfo);return decodeURIComponent(a[2]||"")},set:function(a){k(a);if(this._url){var c=[A.exec(this._userinfo)[1]||""];a&&c.push(encodeURIComponent(a));this._userinfo=c.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){k(a);if(this._url&&(a=v.exec(a)))this._url.host=a[1],this._url.port=f(a[2])},enumerable:!0},hostname:{get:function(){return this._url?this._url.host:""},set:function(a){k(a);this._url&&D.exec(a)&&(this._url.host=a)},enumerable:!0},port:{get:function(){var a=this._url?this._url.port||"":"";a&&a===J[this.protocol]&&(a="");return a},set:function(a){k(a);this._url&&u.exec(a)&&(this._url.port=f(a))},enumerable:!0},pathname:{get:function(){return this._url?this._url.path:""},set:function(c){k(c);
this._url&&E.exec(c)&&(this._url.host&&c&&"/"!==c[0]&&(c="/"+c),this._url.path=c?a(c):"")},enumerable:!0},search:{get:function(){return this._url&&this._url.query?"?"+this._url.query:""},set:function(a){k(a);this._url&&(a&&"?"===a[0]&&(a=a.substring(1)),z.exec(a)&&(this._url.query=a))},enumerable:!0},hash:{get:function(){return this._url&&this._url.fragment?"#"+this._url.fragment:""},set:function(a){k(a);this._url&&(a&&"#"===a[0]&&(a=a.substring(1)),w.exec(a)&&(this._url.fragment=a))},enumerable:!0}});
if((q=window.URL||window.webkitURL)&&q.createObjectURL)Object.defineProperty(h,"createObjectURL",{value:q.createObjectURL.bind(q),enumerable:!1}),Object.defineProperty(h,"revokeObjectURL",{value:q.revokeObjectURL.bind(q),enumerable:!1});window.URL=h})();define("orion/URL-shim",[],function(){});
define("orion/pluginregistry",["orion/Deferred","orion/EventTarget","orion/URL-shim"],function(k,m,g){function e(a,c){var h=Object.keys(a),b=Object.keys(c);if(h.length!==b.length)return!1;h.sort();b.sort();for(var f=0,l=h.length;f<l;f++){var d=h[f];if(d!==b[f])return!1;var e=a[d],d=c[d];if(e!==d&&JSON.stringify(e)!==JSON.stringify(d))return!1}return!0}function d(a){if(-1===a.indexOf("://"))try{return(new URL(a,location.href)).href}catch(c){}return a}function n(a){var c=null,h={key:function(h){return(c=
c||Object.keys(a))[h]},getItem:function(c){return a[c]},setItem:function(h,b){a[h]=b;c=null},removeItem:function(h){delete a[h];c=null},clear:function(){(c=c||Object.keys(a)).forEach(function(c){delete a[c]}.bind(this));c=null}};Object.defineProperty(h,"length",{get:function(){return(c=c||Object.keys(a)).length}});return h}function b(a,c){if(c&&c instanceof XMLHttpRequest){var h,b;try{h=c.status,b=c.statusText}catch(f){h=0,b=""}return{status:h||0,statusText:b}}return c}function f(a){var c=a?JSON.parse(JSON.stringify(a,
b)):a;a instanceof Error&&(c.__isError=!0,c.message=c.message||a.message,c.name=c.name||a.name);return c}function a(a,c){this.type=a;this.plugin=c}function l(a,c){this.__objectId=a;this.__methods=c}function c(c,h,b){function d(a){L&&b.postMessage(a,L)}function r(a){if(!L)return(new k).reject(Error("plugin not connected"));a.id=String(Y++);var c=new k;Q[a.id]=c;c.then(null,function(c){"active"===y&&c instanceof Error&&"Cancel"===c.name&&d({requestId:a.id,method:"cancel",params:c.message?[c.message]:
[]})});var h=Object.prototype.toString;a.params.forEach(function(b,f){if("[object Object]"===h.call(b)&&!(b instanceof l)){var d,e;for(d in b)"[object Function]"===h.call(b[d])&&(e=e||[],e.push(d));if(e){var r=V++;S[r]=b;d=function(){delete S[r]};c.then(d,d);a.params[f]=new l(r,e)}}});b.postMessage(a,L);return c.promise}function u(a,c){a||0===a?d({id:a,result:null,error:c}):console.log(c)}function g(a,c,h,b){b.forEach(function(a,c){if(a&&"undefined"!==typeof a.__objectId){var h={};a.__methods.forEach(function(c){h[c]=
function(){return r({objectId:a.__objectId,method:c,params:Array.prototype.slice.call(arguments)})}});b[c]=h}});var l=void 0===typeof a?null:{id:a,result:null,error:null};try{var e=h.apply(c,b);l&&(e&&"function"===typeof e.then?(P[a]=e,e.then(function(c){delete P[a];l.result=c;d(l)},function(c){P[a]&&(delete P[a],l.error=f(c),d(l))},function(){d({responseId:a,method:"progress",params:Array.prototype.slice.call(arguments)})})):(l.result=e,d(l)))}catch(q){l&&(l.error=f(q),d(l))}}function n(a){try{if(a.method){var c=
a.method,h=a.params||[];if("serviceId"in a){var f=X[a.serviceId];f||u(a.id,"service not found");c in f?g(a.id,f,f[c],h):u(a.id,"method not found")}else if("objectId"in a){var l=S[a.objectId];l||u(a.id,"object not found");c in l?g(a.id,l,l[c],h):u(a.id,"method not found")}else if("requestId"in a){var d=P[a.requestId];d&&"cancel"===c&&d.cancel&&d.cancel.apply(d,h)}else if("responseId"in a){var e=Q[a.responseId];e&&"progress"===c&&e.progress&&e.progress.apply(e,h)}else if("plugin"===a.method){var r=
a.params[0];R({headers:r.headers,services:r.services}).then(function(){H&&H.resolve(C)})}else if("timeout"===a.method)H&&H.reject(a.error);else throw Error("Bad method: "+a.method);}else{var q=Q[String(a.id)];delete Q[String(a.id)];if(a.error){var p=b.handleServiceError(C,a.error);q.reject(p)}else q.resolve(a.result)}}catch(t){console.log("Plugin._messageHandler "+t)}}function E(a){var c={};if(a.methods&&(a.methods.forEach(function(h){c[h]=function(){var c={serviceId:a.serviceId,method:h,params:Array.prototype.slice.call(arguments)};
return"active"===y?r(c):C.start({"transient":!0}).then(function(){return r(c)})}}),c.addEventListener&&c.removeEventListener)){var h=new m,b=V++;S[b]={handleEvent:h.dispatchEvent.bind(h)};var f=new l(b,["handleEvent"]),d=c.addEventListener;c.addEventListener=function(a,c){h._namedListeners[a]||d(a,f);h.addEventListener(a,c)};var e=c.removeEventListener;c.removeEventListener=function(a,c){h.removeEventListener(a,c);h._namedListeners[a]||e(a,f)}}return c}function z(a){var h=JSON.parse(JSON.stringify(a.properties));
h.__plugin__=c;a=a.names||a.type||[];Array.isArray(a)||(a=[a]);h.objectClass=a;return h}function w(a){var c=E(a),h=z(a),h=b.registerService(a.names||a.type,c,h);I[a.serviceId]={registration:h,proxy:c}}function A(){b.persist(c,{created:J,headers:G,services:x,autostart:B,lastModified:K})}var C=this;h=h||{};var J=h.created||(new Date).getTime(),G=h.headers||{},x=h.services||[],B=h.autostart,K=h.lastModified||0,y="installed",F,H,L,T,I={},Y=0,V=0,P={},Q={},S={},X={},R;this._persist=A;this._resolve=function(){y=
"resolved";b.dispatchEvent(new a("resolved",C))};this._getAutostart=function(){return B};this._getCreated=function(){return J};this.getLocation=function(){return c};this.getHeaders=function(){return JSON.parse(JSON.stringify(G))};this.getName=function(){var a=this.getHeaders();return a?a.name||"":null};this.getVersion=function(){var a=this.getHeaders();return a?a.version||"0.0.0":null};this.getLastModified=function(){return K};this.getServiceReferences=function(){var a=[];Object.keys(I).forEach(function(c){a.push(I[c].registration.getReference())});
return a};this.setParent=function(a){return T!==a?(T=a,C.stop({"transient":!0}).then(function(){if("started"===B)return C.start({"transient":!0});if("lazy"===B)return C.start({lazy:!0,"transient":!0})})):(new k).resolve()};this.getState=function(){return y};this.start=function(h){if("uninstalled"===y)return(new k).reject(Error("Plugin is uninstalled"));if(F)return F.promise.then(this.start.bind(this,h));if("active"===y)return(new k).resolve();if(!h||!h.transient){var f=h&&h.lazy?"lazy":"started";
f!==B&&(B=f,A())}f=b.getState();if("starting"!==f&&"active"!==f)return h.transient?(new k).reject(Error("start transient error")):(new k).resolve();if("installed"===y)try{this._resolve()}catch(l){return(new k).reject(l)}"resolved"===y&&x.forEach(function(a){w(a)});if(h&&h.lazy)return"starting"!==y&&(y="starting",b.dispatchEvent(new a("lazy activation",C))),(new k).resolve();var d=new k;F=d;y="starting";b.dispatchEvent(new a("starting",C));H=new k;L=b.connect(c,n,T);H.then(function(){H=null;y="active";
b.dispatchEvent(new a("started",C));F=null;d.resolve()},function(){H=null;y="stopping";b.dispatchEvent(new a("stopping",C));Object.keys(I).forEach(function(a){I[a].registration.unregister();delete I[a]});b.disconnect(L);L=null;y="resolved";F=null;b.dispatchEvent(new a("stopped",C));d.reject(Error("plugin activation error"))});return d.promise};this.stop=function(c){if("uninstalled"===y)return(new k).reject(Error("Plugin is uninstalled"));if(F)return F.promise.then(this.stop.bind(this,c));if((!c||
!c.transient)&&"stopped"!==B)B="stopped",A();if("active"!==y&&"starting"!==y)return(new k).resolve();F=c=new k;y="stopping";b.dispatchEvent(new a("stopping",C));Object.keys(I).forEach(function(a){I[a].registration.unregister();delete I[a]});L&&(b.disconnect(L),L=null);y="resolved";F=null;b.dispatchEvent(new a("stopped",C));c.resolve();return c.promise};R=function(h){if("uninstalled"===y)return(new k).reject(Error("Plugin is uninstalled"));if(!h)return 0===K&&(K=(new Date).getTime(),A()),b.loadManifest(c).then(R);
var f=G,l=x,d=B;G=h.headers||{};x=h.services||{};B=h.autostart||B;h.lastModified?K=h.lastModified:(K=(new Date).getTime(),A());if(e(G,f)&&e(x,l)&&B===d)return(new k).resolve();if("active"===y||"starting"===y){var r=[];Object.keys(x).forEach(function(a){var c=x[a];r.push(a);var h=I[a];if(h){if(e(c.methods,Object.keys(h.proxy))){a=z(c);var b=h.registration.getReference(),f={};b.getPropertyKeys().forEach(function(a){f[a]=b.getProperty(a)});e(a,f)||h.registration.setProperties(a);return}h.registration.unregister();
delete I[a]}w(c)});Object.keys(I).forEach(function(a){-1===r.indexOf(a)&&(I[a].registration.unregister(),delete I[a])})}"active"===y&&(b.disconnect(L),H=new k,L=b.connect(c,n,T),H.then(function(){H=null},function(){H=null;y="stopping";b.dispatchEvent(new a("stopping"),C);Object.keys(I).forEach(function(a){I[a].registration.unregister();delete I[a]});b.disconnect(L);L=null;y="resolved";b.dispatchEvent(new a("stopped",C))}));return(new k).resolve()};this.update=function(c){return R(c).then(function(){b.dispatchEvent(new a("updated",
C))})};this.uninstall=function(){if("uninstalled"===y)return(new k).reject(Error("Plugin is uninstalled"));if("active"===y||"starting"===y||"stopping"===y)return this.stop().then(this.uninstall.bind(this),this.uninstall.bind(this));b.removePlugin(this);y="uninstalled";b.dispatchEvent(new a("uninstalled",C));return(new k).resolve()}}var h=/^http[s]?/i;return{Plugin:c,PluginRegistry:function(b,f){function l(a){var c=a.source;v.some(function(h){if(c===h.target){try{var b;if("undefined"===typeof h.useStructuredClone){var f=
"string"!==typeof a.data;b=f?a.data:JSON.parse(a.data);h.useStructuredClone=f}else b=h.useStructuredClone?a.data:JSON.parse(a.data);h.handler(b)}catch(l){}return!0}})}f=f||{};var e=f.storage||localStorage;e.getItem||(e=n(e));var r="installed",u,g=[],v=[],E=new m,z={},w={registerService:b.registerService.bind(b),connect:function(a,c,h,b){function f(a){a=Error(a);a.name="timeout";c({method:"timeout",error:a})}var l={handler:c,url:a},d=setTimeout(f.bind(null,"Load timeout for: "+a),b||15E3),e=document.createElement("iframe");
e.name=a+"_"+(new Date).getTime();e.src=a;e.onload=function(){clearTimeout(d);d=setTimeout(f.bind(null,"Plugin handshake timeout for: "+a),5E3)};e.sandbox="allow-scripts allow-same-origin";e.style.width=e.style.height="100%";e.frameBorder=0;(h||u).appendChild(e);l.target=e.contentWindow;l.close=function(){clearTimeout(d);if(e){var a=e.parentNode;a&&a.removeChild(e);e=null}};v.push(l);return l},disconnect:function(a){for(var c=0;c<v.length;c++)if(a===v[c]){v.splice(c,1);try{a.close()}catch(h){}break}},
removePlugin:function(a){for(var c=0;c<g.length;c++)if(a===g[c]){g.splice(c,1);break}e.removeItem("plugin."+a.getLocation())},persist:function(a,c){e.setItem("plugin."+a,JSON.stringify(c))},postMessage:function(a,c){c.target.postMessage(c.useStructuredClone?a:JSON.stringify(a),c.url)},dispatchEvent:function(a){try{E.dispatchEvent(a)}catch(c){console&&console.log("PluginRegistry.dispatchEvent "+c)}},loadManifest:function(a){var c=new k,h=w.connect(a,function(a){h&&a.method&&("manifest"===a.method||
"plugin"===a.method?(a=a.params[0],w.disconnect(h),h=null,c.resolve(a)):"timeout"===a.method&&(w.disconnect(h),h=null,c.reject(a.error)))});return c.promise},getState:function(){return r},handleServiceError:function(a,c){if(c&&401===c.status){var b=a.getHeaders(),f=a.getName()||a.getLocation(),l=document.createElement("span");l.appendChild(document.createTextNode("Authentication required for: "+f+"."));b.login&&(l.appendChild(document.createTextNode(" ")),f=document.createElement("a"),f.target="_blank",
f.textContent="Login",f.href=b.login,h.test(f.href)?(l.appendChild(f),l.appendChild(document.createTextNode(" and re-try the request."))):console.log("Illegal Login URL: "+b.login));return{Severity:"Error",HTML:!0,Message:(new XMLSerializer).serializeToString(l)}}if(c.__isError){var d=c;c=Error(d.message);Object.keys(d).forEach(function(a){c[a]=d[a]});delete c.__isError}return c}};this.getLocation=function(){return"System"};this.getHeaders=function(){return{}};this.getName=function(){return"System"};
this.getVersion=function(){return"0.0.0"};this.getLastModified=function(){return 0};this.getState=w.getState;this.init=function(){if(!("starting"===r||"active"===r||"stopping"===r)){addEventListener("message",l,!1);for(var a=[],h=0,b=e.length;h<b;h++)a.push(e.key(h));a.forEach(function(a){if(0===a.indexOf("plugin.")){var h=a.substring(7);a=JSON.parse(e.getItem(a));a.created&&g.push(new c(h,a,w))}});g.sort(function(a,c){return a._getCreated()<c._getCreated()?-1:1});f.parent?u=f.parent:(u=document.createElement("div"),
f.visible||(u.style.display="none",u.style.visibility="hidden"),document.body.appendChild(u));f.plugins&&Object.keys(f.plugins).forEach(function(a){a=d(a);if(!this.getPlugin(a)){var h=f.plugins[a];"object"!==typeof h&&(h={});h.autostart=h.autostart||f.defaultAutostart||"lazy";g.push(new c(a,h,w))}}.bind(this));r="starting"}};this.start=function(){"starting"!==r&&this.init();if("starting"!==r)return(new k).reject("Cannot start framework. Framework is already "+r+".");var a=[],c=(new Date).getTime();
g.forEach(function(h){var b=h._getAutostart();0===h.getLastModified()?a.push(h.update().then(function(){if("started"===b)return h.start({"transient":!0});if("lazy"===b)return h.start({lazy:!0,"transient":!0});h._resolve()})):"started"===b?a.push(h.start({"transient":!0})):"lazy"===b?(a.push(h.start({lazy:!0,"transient":!0})),c>h.getLastModified()+864E5&&h.update()):h._resolve()});return k.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){r="active"})};this.stop=function(){if("starting"!==
r&&"active"!==r)return(new k).reject("Cannot stop registry. Registry is already "+r+".");r="stopping";var a=[];g.forEach(function(c){a.push(c.stop({"transient":!0}))});return k.all(a,function(a){console.log("PluginRegistry.stop "+a)}).then(function(){if(!f.parent){var a=u.parentNode;a&&a.removeChild(u)}u=null;removeEventListener("message",l);r="resolved"})};this.update=function(){this.stop().then(this.start.bind(this))};this.uninstall=function(){return(new k).reject("Cannot uninstall registry")};
this.installPlugin=function(h,b){h=d(h);var f=this.getPlugin(h);if(f)return(new k).resolve(f);if(z[h])return z[h];if(b)return f=new c(h,b,w),g.push(f),f._persist(),w.dispatchEvent(new a("installed",f)),(new k).resolve(f);var l=w.loadManifest(h).then(function(b){f=new c(h,b,w);g.push(f);f._persist();delete z[h];w.dispatchEvent(new a("installed",f));return f},function(a){delete z[h];throw a;});return z[h]=l};this.getPlugins=function(){return g.slice()};this.getPlugin=function(a){var c=null;a=d(a);g.some(function(h){if(a===
h.getLocation())return c=h,!0});return c};this.addEventListener=E.addEventListener.bind(E);this.removeEventListener=E.removeEventListener.bind(E);this.resolvePlugins=function(){var a=!0;g.forEach(function(c){a=a&&c._resolve()});return a}}}});
define("orion/serviceTracker",[],function(){function k(e,d){function n(c){var h=c.getProperty("service.id"),b=this.addingService(c);b&&(f[h]=c,a[h]=b)}function b(c){var h=c.getProperty("service.id"),b=a[h];delete f[h];delete a[h];this.removedService(c,b)}this.serviceRegistry=e;var f={},a={},l=m,c,h;this.close=function(){if(l!==g)throw"Already closed";l=m;e.removeEventListener("registered",c);e.removeEventListener("unregistering",h);h=c=null;var a=this;this.getServiceReferences().forEach(function(c){b.call(a,
c)});if("function"===typeof this.onClose)this.onClose()};this.getServiceReferences=function(){var a=Object.keys(f);return!a.length?null:a.map(function(a){return f[a]})};this.open=function(){if(l!==m)throw"Already open";l=g;var a=this;c=function(c){if(-1!==c.serviceReference.getProperty("objectClass").indexOf(d)&&(n.call(a,c.serviceReference),"function"===typeof a.onServiceAdded))return a.onServiceAdded(c.serviceReference,a.serviceRegistry.getService(c.serviceReference))};h=function(c){-1!==c.serviceReference.getProperty("objectClass").indexOf(d)&&
b.call(a,c.serviceReference)};e.addEventListener("registered",c);e.addEventListener("unregistering",h);e.getServiceReferences(d).forEach(function(c){n.call(a,c);if("function"===typeof a.onServiceAdded)return a.onServiceAdded(c,e.getService(c))});if("function"===typeof this.onOpen)this.onOpen()}}var m=0,g=1;k.prototype={addingService:function(e){return this.serviceRegistry.getService(e)},onOpen:null,onClose:null,onServiceAdded:null,removedService:function(e,d){}};return k});
define("orion/objects",[],function(){function k(k){for(var g=1;g<arguments.length;g++){var e=arguments[g],d;for(d in e)Object.prototype.hasOwnProperty.call(e,d)&&(k[d]=e[d])}return k}return{clone:function(m){if(Array.isArray(m))return Array.prototype.slice.call(m);var g=Object.create(Object.getPrototypeOf(m));k(g,m);return g},mixin:k,toArray:function(k){return Array.isArray(k)?k:[k]}}});
define("orion/config",["orion/Deferred","orion/serviceTracker","orion/objects"],function(k,m,g){var e,d,n,b,f,a="pid";e=function(c,h,b){function f(a,c,b){c.forEach(function(f,l){try{var d=a[l].getProperty("__plugin__"),e=d&&h.getPlugin(d);(!d||e&&"active"===e.getState())&&c[l].updated(b)}catch(r){"undefined"!==typeof console&&console.log(r)}})}m.call(this,c,"orion.cm.managedservice");var l={},d={},e=function(h){var f=[];h.plugin.getServiceReferences().forEach(function(h){if(-1!==h.getProperty("objectClass").indexOf("orion.cm.managedservice")){var l=
h.getProperty(a);h=c.getService(h);l&&h&&(l=(l=b._find(l))&&l.getProperties(),f.push(h.updated(l)))}});return k.all(f)};this.addingService=function(h){var b=h.getProperty(a),f=c.getService(h);if(!b||!f)return null;l[b]||(l[b]=[]);d[b]||(d[b]=[]);l[b].push(h);d[b].push(f);return f};this.onServiceAdded=function(c,h){var l=c.getProperty(a),l=b._find(l);f([c],[h],l&&l.getProperties())};this.onOpen=function(){h.addEventListener("started",e)};this.onClose=function(){h.removeEventListener("started",e)};
this.notifyUpdated=function(a){var c=a.getPid();f(l[c]||[],d[c]||[],a.getProperties())};this.notifyDeleted=function(a){a=a.getPid();f(l[a]||[],d[a]||[],null)};this.removedService=function(c,h){var b=c.getProperty(a),f=l[b],e=d[b];1<f.length?f.splice(f.indexOf(c),1):delete l[b];1<e.length?e.splice(e.indexOf(h),1):delete d[b]}};d=function(){function a(c,f,l){this.store=new n(this,l);this.configAdmin=new b(this,this.store);this.tracker=new e(c,f,this.store)}a.prototype={getConfigurationAdmin:function(){var a=
this;return this.configAdmin._init().then(function(c){a.tracker.open();return c})},notifyDeleted:function(a){this.tracker.notifyDeleted(a)},notifyUpdated:function(a){this.tracker.notifyUpdated(a)}};return a}();b=function(){function a(c,b){this.factory=c;this.store=b}a.prototype={_init:function(){var a=this;return this.store._init().then(function(){return a})},getConfiguration:function(a){return this.store.get(a)},listConfigurations:function(){return this.store.list()}};return a}();var l="/cm/configurations";
n=function(){function c(c,b){this.factory=c;this.prefsService=b;this.configs=Object.create(null);this.pref=null;var d=this;this.initPromise=this.prefsService.getPreferences(l).then(function(c){d.pref=c;c.keys().forEach(function(h){if(!d.configs[h]){var b=c.get(h);"object"===typeof b&&null!==b&&0<Object.keys(b).length&&(b[a]=h,d.configs[h]=new f(d.factory,d,b))}})})}c.prototype={_init:function(){return this.initPromise},_find:function(a){return this.configs[a]||null},get:function(a){var c=this._find(a);
c||(c=new f(this.factory,this,a),this.configs[a]=c);return c},list:function(){var a=this,c=[];this.pref.keys().forEach(function(b){(b=a._find(b))&&null!==b.getProperties()&&c.push(b)});return c},remove:function(a){this.pref.remove(a);delete this.configs[a]},save:function(a,c){this.pref.put(a,c.getProperties(!0)||{})}};return c}();f=function(){function c(c,h){h=g.clone(h);delete h[a];c.properties=h}function h(h,b,f){this.factory=h;this.store=b;if(null!==f&&"object"===typeof f)this.pid=f[a],c(this,
f);else if("string"===typeof f)this.pid=f,this.properties=null;else throw Error("Invalid pid/properties "+f);}h.prototype={_checkRemoved:function(){if(this._removed)throw Error("Configuration was removed");},getPid:function(){this._checkRemoved();return this.pid},getProperties:function(c){this._checkRemoved();var h=null;this.properties&&(h=g.clone(this.properties),c||(h[a]=this.pid));return h},remove:function(){this._checkRemoved();this.factory.notifyDeleted(this);this.store.remove(this.pid);this._removed=
!0},update:function(a){this._checkRemoved();c(this,a);this.store.save(this.pid,this);this.factory.notifyUpdated(this)},toString:function(){return"[ConfigImpl pid: "+this.pid+", properties: "+JSON.stringify(this.properties)+"]"}};return h}();return{ConfigurationAdminFactory:d}});
define("orion/bootstrap","require orion/Deferred orion/serviceregistry orion/preferences orion/pluginregistry orion/config".split(" "),function(k,m,g,e,d,n){var b;return{startup:function(){if(b)return b;b=new m;var f=new g.ServiceRegistry,a=new e.PreferencesService(f);return a.getPreferences("/plugins").then(function(l){var c={plugins:{}};l.keys().forEach(function(a){var h=k.toUrl(a);c.plugins[h]=l[a]});var h=new d.PluginRegistry(f,c);return h.start().then(function(){if(0<f.getServiceReferences("orion.core.preference.provider").length)return a.getPreferences("/plugins",
a.USER_SCOPE).then(function(a){var c=[];a.keys().forEach(function(a){a=k.toUrl(a);h.getPlugin(a)||c.push(h.installPlugin(a,{autostart:"lazy"}).then(function(a){return a.update().then(function(){return a.start({lazy:!0})})}))});return m.all(c,function(a){console.log(a)})})}).then(function(){return(new n.ConfigurationAdminFactory(f,h,a)).getConfigurationAdmin().then(f.registerService.bind(f,"orion.cm.configadmin"))}).then(function(){var a=f.getService("orion.core.auth");if(a){var c=a.getUser().then(function(c){if(c)localStorage.setItem("lastLogin",
(new Date).getTime());else return a.getAuthForm(window.location.href).then(function(a){setTimeout(function(){window.location=a},0)})}),h=localStorage.getItem("lastLogin");if(!h||h<(new Date).getTime()-9E5)return c}}).then(function(){var c={serviceRegistry:f,preferences:a,pluginRegistry:h};b.resolve(c);return c})})}}});
define("orion/nls/root/messages",{Navigator:"Navigator",Sites:"Sites",Shell:"Shell",ShellLinkWorkspace:"Workspace Shell","Get Plugins":"Get Plugins",Global:"Global",Editor:"Editor",EditorRelatedLink:"Show Current Folder",EditorRelatedLinkParent:"Show Enclosing Folder",EditorLinkWorkspace:"Show Workspace",EditorRelatedLinkProj:"Show Project","Filter bindings":"Filter bindings","Orion Editor":"Orion Editor","Orion Image Viewer":"Orion Image Viewer","Orion Markdown Viewer":"Orion Markdown Viewer","Orion JSON Editor":"Orion JSON Editor",
"View on Site":"View on Site","View this file or folder on a web site hosted by Orion":"View this file or folder on a web site hosted by Orion.","Show a list of all the keybindings on this page":"Show a list of all the keybindings on this page","Show Keys":"Show Keys","Hide or show the page banner and footer":"Hide or show the page banner and footer","Toggle banner and footer":"Toggle banner and footer","Choose a file by name and open an editor on it":"Choose a file by name and open an editor on it",
"Find File Named...":"Find File Named...","System Configuration Details":"System Configuration Details","System Config Tooltip":"Go to the System Configuration Details page","Background Operations":"Background Operations","Background Operations Tooltip":"Go to the Background Operations page","Operation status is unknown":"Operation status is unknown","Unknown item":"Unknown item","Can't search: no search service is available":"Can't search: no search service is available","could not find banner parent, id was ":"could not find banner parent, id was ",
Related:"Related",Options:"Options",FAQ:"FAQ","Report a Bug":"Bugs","Privacy Policy":"Privacy","Terms of Use":"Terms","Copyright Agent":"Copyright","Orion Logo":"Orion Logo","Orion is in Beta. Please try it out but BEWARE your data may be lost.":"2014-04-02_22-01-33","LOG: ":"LOG: ",View:"View","no parent":"no parent","no tree model":"no tree model","no renderer":"no renderer","could not find table row ":"could not find table row ","Resource is out of sync with the server. Do you want to save it anyway?":"Resource is out of sync with the server. Do you want to save it anyway?",
Operations:"Operations","Operations running":"Operations running","Some operations finished with warning":"Some operations finished with warning","Some operations finished with error":"Some operations finished with error","no service registry":"no service registry",Tasks:"Tasks",Close:"Close","Expand all":"Expand all","Collapse all":"Collapse all",Search:"Search","Advanced search":"Advanced search",Submit:"Submit",More:"More","Saved searches":"Saved searches","Recent searches":"Recent searches","Regular expression":"Regular expression",
"Search options":"Search options","Global search":"Global search","Orion Home":"Orion Home","Close notification":"Close notification","Operations - Press spacebar to show current operations":"Operations - Press spacebar to show current operations","Type a keyword or wild card to search in root":"Type a keyword or wild card to search in root","Toggle side panel":"Toggle side panel","Open or close the side panel":"Open or close the side panel",Projects:"Projects","Toggle Sidebar":"Toggle Sidebar","Sample HTML5 Site":"Sample HTML5 Site",
"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.":"Generate an HTML5 'Hello World' website, including JavaScript, HTML, and CSS files.","Sample Orion Plugin":"Sample Orion Plugin","Generate a sample plugin for integrating with Orion.":"Generate a sample plugin for integrating with Orion.",Browser:"Web Browser",OutlineProgress:"Getting outline for ${0} from ${1}",UnknownError:"An unknown error occurred.",UnknownWarning:"An unknown warning occurred.",Filter:"Filter (* \x3d any string, ? \x3d any character)",
"To view the browser's context menu, trigger the context menu again.":"To view the browser's context menu, trigger the context menu again.",Edit:"Edit",CentralNavTooltip:"Toggle Navigation Menu"});define("orion/nls/messages",["orion/i18n!orion/nls/messages","orion/nls/root/messages"],function(k,m){var g={root:m};Object.keys(k).forEach(function(e){"undefined"===typeof g[e]&&(g[e]=k[e])});return g});
define("orion/util",[],function(){var k=navigator.userAgent,m=-1!==k.indexOf("MSIE")||-1!==k.indexOf("Trident")?document.documentMode:void 0,g=parseFloat(k.split("Firefox/")[1]||k.split("Minefield/")[1])||void 0,e=-1!==k.indexOf("Opera")?parseFloat(k.split("Version/")[1]):void 0,d=parseFloat(k.split("Chrome/")[1])||void 0,n=-1!==k.indexOf("Safari")&&!d,b=parseFloat(k.split("WebKit/")[1])||void 0,f=-1!==k.indexOf("Android"),a=-1!==k.indexOf("iPad"),k=-1!==k.indexOf("iPhone"),l=a||k,c=-1!==navigator.platform.indexOf("Mac"),
h=-1!==navigator.platform.indexOf("Win"),q=-1!==navigator.platform.indexOf("Linux"),p="ontouchstart"in document.createElement("input");return{formatMessage:function(a){var c=arguments;return a.replace(/\$\{([^\}]+)\}/g,function(a,h){return c[(h<<0)+1]})},createElement:function(a,c){return a.createElementNS?a.createElementNS("http://www.w3.org/1999/xhtml",c):a.createElement(c)},isIE:m,isFirefox:g,isOpera:e,isChrome:d,isSafari:n,isWebkit:b,isAndroid:f,isIPad:a,isIPhone:k,isIOS:l,isMac:c,isWindows:h,
isLinux:q,isTouch:p,platformDelimiter:h?"\r\n":"\n"}});
define("orion/webui/littlelib",["orion/util"],function(k){function m(a,b){b||(b=document);return b.querySelectorAll(a)}function g(a){var b=a.tabIndex;0===b&&k.isIE&&!{a:!0,body:!0,button:!0,frame:!0,iframe:!0,img:!0,input:!0,isindex:!0,object:!0,select:!0,textarea:!0}[a.nodeName.toLowerCase()]&&!a.attributes.tabIndex&&(b=-1);return b}function e(a){if(0<=g(a))return a;if(a.hasChildNodes())for(var b=0;b<a.childNodes.length;b++){var c=e(a.childNodes[b]);if(c)return c}return null}function d(a){if(0<=
g(a))return a;if(a.hasChildNodes())for(var b=a.childNodes.length-1;0<=b;b--){var c=d(a.childNodes[b]);if(c)return c}return null}function n(a,f){if(3===a.nodeType){var c=b.exec(a.nodeValue);c&&1<c.length&&f(a,c)}if(a.hasChildNodes())for(c=0;c<a.childNodes.length;c++)n(a.childNodes[c],f)}var b=/\$\{([^\}]+)\}/,f=null;return{$:function(a,b){b||(b=document);return b.querySelector(a)},$$:m,$$array:function(a,b){return Array.prototype.slice.call(m(a,b))},node:function(a){var b=a;"string"===typeof a&&(b=
document.getElementById(a));return b},contains:function(a,b){if(!a||!b)return!1;if(a===b)return!0;var c=a.compareDocumentPosition(b);return Boolean(c&16)},bounds:function(a){a=a.getBoundingClientRect();return{left:a.left+document.documentElement.scrollLeft,top:a.top+document.documentElement.scrollTop,width:a.width,height:a.height}},empty:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},firstTabbable:e,lastTabbable:d,stop:function(a){window.document.all&&(a.keyCode=0);a.preventDefault&&
(a.preventDefault(),a.stopPropagation())},processTextNodes:function(a,b){n(a,function(a,h){a.parentNode.replaceChild(document.createTextNode(b[h[1]]||h[1]),a)})},processDOMNodes:function(a,b){n(a,function(a,h){var f=b[h[1]];if(f){var d=document.createRange(),e=h.index;d.setStart(a,e);d.setEnd(a,e+h[0].length);d.deleteContents();d.insertNode(f)}})},addAutoDismiss:function(a,b){function c(a){f.forEach(function(c){var b=!1,f=c.excludeNodes.some(function(c){return document.body.contains(c)?(b=!0,c.contains(a.target)):
!1});if(b&&!f)try{c.dismiss(a)}catch(d){"undefined"!==typeof console&&console&&console.error(d&&d.message)}});f=f.filter(function(a){return a.excludeNodes.some(function(a){return document.body.contains(a)})})}null===f&&(f=[],document.addEventListener("click",c,!0),k.isIOS&&document.addEventListener("touchend",function(a){function c(){a.target.removeEventListener("click",c)}0===a.touches.length&&a.target.addEventListener("click",c)},!1));f.push({excludeNodes:a,dismiss:b})},setFramesEnabled:function(a){for(var b=
document.getElementsByTagName("iframe"),c=0;c<b.length;c++)b[c].parentNode.style.pointerEvents=a?"":"none"},removeAutoDismiss:function(a){f=f.filter(function(b){return a!==b.dismiss})},KEY:{BKSPC:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DEL:46}}});
define("text",["module"],function(k){var m,g,e=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],d=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,n=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,b="undefined"!==typeof location&&location.href,f=b&&location.protocol&&location.protocol.replace(/\:/,""),a=b&&location.hostname,l=b&&(location.port||void 0),c=[],h=k.config&&k.config()||{};m={version:"2.0.5",strip:function(a){if(a){a=a.replace(d,"");var c=a.match(n);c&&(a=c[1])}else a="";return a},
jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:h.createXhr||function(){var a,c,h;if("undefined"!==typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!==typeof ActiveXObject)for(c=0;3>c;c+=1){h=e[c];try{a=new ActiveXObject(h)}catch(b){}if(a){e=[h];break}}return a},parseName:function(a){var c,
h,b=!1,f=a.indexOf(".");c=0===a.indexOf("./")||0===a.indexOf("../");-1!==f&&(!c||1<f)?(c=a.substring(0,f),h=a.substring(f+1,a.length)):c=a;a=h||c;f=a.indexOf("!");-1!==f&&(b="strip"===a.substring(f+1),a=a.substring(0,f),h?h=a:c=a);return{moduleName:c,ext:h,strip:b}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,h,b){var f,d;f=m.xdRegExp.exec(a);if(!f)return!0;a=f[2];f=f[3];f=f.split(":");d=f[1];f=f[0];return(!a||a===c)&&(!f||f.toLowerCase()===h.toLowerCase())&&(!d&&!f||d===b)},finishLoad:function(a,
b,f,d){f=b?m.strip(f):f;h.isBuild&&(c[a]=f);d(f)},load:function(c,d,e,t){if(t.isBuild&&!t.inlineText)e();else{h.isBuild=t.isBuild;var r=m.parseName(c);t=r.moduleName+(r.ext?"."+r.ext:"");var g=d.toUrl(t),n=h.useXhr||m.useXhr;!b||n(g,f,a,l)?m.get(g,function(a){m.finishLoad(c,r.strip,a,e)},function(a){e.error&&e.error(a)}):d([t],function(a){m.finishLoad(r.moduleName+"."+r.ext,r.strip,a,e)})}},write:function(a,h,b,f){c.hasOwnProperty(h)&&(f=m.jsEscape(c[h]),b.asModule(a+"!"+h,"define(function () { return '"+
f+"';});\n"))},writeFile:function(a,c,h,b,f){c=m.parseName(c);var d=c.ext?"."+c.ext:"",l=c.moduleName+d,e=h.toUrl(c.moduleName+d)+".js";m.load(l,h,function(c){c=function(a){return b(e,a)};c.asModule=function(a,c){return b.asModule(a,e,c)};m.write(a,l,c,f)},f)}};if("node"===h.env||!h.env&&"undefined"!==typeof process&&process.versions&&process.versions.node)g=require.nodeRequire("fs"),m.get=function(a,c){var h=g.readFileSync(a,"utf8");0===h.indexOf("\ufeff")&&(h=h.substring(1));c(h)};else if("xhr"===
h.env||!h.env&&m.createXhr())m.get=function(a,c,b,f){var d=m.createXhr(),l;d.open("GET",a,!0);if(f)for(l in f)f.hasOwnProperty(l)&&d.setRequestHeader(l.toLowerCase(),f[l]);if(h.onXhr)h.onXhr(d,a);d.onreadystatechange=function(h){4===d.readyState&&(h=d.status,399<h&&600>h?(h=Error(a+" HTTP status: "+h),h.xhr=d,b(h)):c(d.responseText))};d.send(null)};else if("rhino"===h.env||!h.env&&"undefined"!==typeof Packages&&"undefined"!==typeof java)m.get=function(a,c){var h,b,f=new java.io.File(a),d=java.lang.System.getProperty("line.separator"),
f=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),"utf-8")),l="";try{h=new java.lang.StringBuffer;(b=f.readLine())&&b.length()&&65279===b.charAt(0)&&(b=b.substring(1));for(null!==b&&h.append(b);null!==(b=f.readLine());)h.append(d),h.append(b);l=String(h.toString())}finally{f.close()}c(l)};return m});define("text!orion/banner/slideout.html",[],function(){return'\x3cdiv id\x3d"slideContainer" class\x3d"slideParameters slideContainer"\x3e\n\t\x3cspan id\x3d"pageCommandParameters" class\x3d"layoutLeft parameters"\x3e\x3c/span\x3e\n\t\x3cspan id\x3d"pageCommandDismiss" class\x3d"layoutRight parametersDismiss"\x3e\x3c/span\x3e\n\x3c/div\x3e'});
define("orion/commonHTMLFragments",["require","orion/webui/littlelib","text!orion/banner/slideout.html"],function(k,m,g){return{slideoutHTMLFragment:function(e){var d=document.createElement("div");d.innerHTML=g;var n=m.$("#slideContainer",d);n.id=e+n.id;n=m.$("#pageCommandParameters",d);n.id=e+n.id;n=m.$("#pageCommandDismiss",d);n.id=e+n.id;return d.innerHTML}}});
define("orion/keyBinding",["orion/util"],function(k){function m(e,d,g,b,f,a){this.type=a||"keydown";this.keyCode="string"===typeof e&&"keydown"===this.type?e.toUpperCase().charCodeAt(0):e;this.mod1=void 0!==d&&null!==d?d:!1;this.mod2=void 0!==g&&null!==g?g:!1;this.mod3=void 0!==b&&null!==b?b:!1;this.mod4=void 0!==f&&null!==f?f:!1}function g(e){this.keys=e}m.prototype={getKeys:function(){return[this]},match:function(e,d){if(void 0!==d){if(0!==d)return!1}else if(e instanceof Array){if(1<e.length)return!1;
e=e[0]}return e.type!==this.type?!1:this.keyCode===e.keyCode||this.keyCode===String.fromCharCode(k.isOpera?e.which:void 0!==e.charCode?e.charCode:e.keyCode)?this.mod1!==(k.isMac?e.metaKey:e.ctrlKey)||"keydown"===this.type&&this.mod2!==e.shiftKey||this.mod3!==e.altKey||k.isMac&&this.mod4!==e.ctrlKey?!1:!0:!1},equals:function(e){return!e||this.keyCode!==e.keyCode||this.mod1!==e.mod1||this.mod2!==e.mod2||this.mod3!==e.mod3||this.mod4!==e.mod4||this.type!==e.type?!1:!0}};g.prototype={getKeys:function(){return this.keys.slice(0)},
match:function(e,d){var g=this.keys;if(void 0!==d)return d>g.length?!1:g[d].match(e)?d===g.length-1?!0:d+1:!1;e instanceof Array||(e=[e]);if(e.length>g.length)return!1;var b;for(b=0;b<e.length;b++)if(!g[b].match(e[b]))return!1;return b===g.length?!0:b},equals:function(e){if(!e.keys||e.keys.length!==this.keys.length)return!1;for(var d=0;d<e.keys.length;d++)if(!e.keys[d].equals(this.keys[d]))return!1;return!0}};return{KeyBinding:m,KeyStroke:m,KeySequence:g}});
define("orion/webui/dropdown",["require","orion/webui/littlelib","orion/EventTarget"],function(k,m,g){function e(b){g.attach(this);this._init(b)}function d(b,f){var a=document.createElement(void 0===f?"span":f);a.tabIndex=0;a.className="dropdownMenuItem";a.role="menuitem";var d=document.createElement("span");d.appendChild(document.createTextNode(b));d.classList.add("dropdownCommandName");a.appendChild(d);d=document.createElement("li");d.appendChild(a);return d}function n(){var b=document.createElement("li");
b.classList.add("dropdownSeparator");return b}e.prototype={_init:function(b){this._dropdownNode=m.node(b.dropdown);if(!this._dropdownNode)throw"no dom node for dropdown found";this._populate=b.populate;this._selectionClass=b.selectionClass;this._parentDropdown=b.parentDropdown;this._positioningNode=b.positioningNode;if(!this._parentDropdown)for(var f=this._dropdownNode.parentNode;f&&document!==f;){if(f.classList&&f.classList.contains("dropdownMenu")){this._parentDropdown=f.dropdown;break}f=f.parentNode}this._dropdownNode.tabIndex=
0;this._triggerNode=b.triggerNode?b.triggerNode:m.$(".dropdownTrigger",this._dropdownNode.parentNode);if(!this._triggerNode)throw"no dom node for dropdown trigger found";if(!b.skipTriggerEventListeners){var a=this;this._triggerNode.addEventListener("click",function(b){a.toggle(b)&&m.stop(b)},!1);"span"===this._triggerNode.tagName.toLowerCase()&&this._triggerNode.addEventListener("keydown",function(b){if(b.keyCode===m.KEY.ENTER||b.keyCode===m.KEY.SPACE)a.toggle(),m.stop(b)},!1)}this._dropdownNode.addEventListener("keydown",
this._dropdownKeyDown.bind(this),!1)},addTriggerNode:function(b){var f=this;b.addEventListener("click",function(a){f.toggle(a)&&m.stop(a)},!1)},toggle:function(b){return this.isVisible()?this.close():this.open(b)},isVisible:function(){return this._isVisible},open:function(b){var f=!1;this.isVisible()||(this.dispatchEvent({type:"triggered",dropdown:this,event:b}),m.setFramesEnabled(!1),this._populate&&(this.empty(),this._populate(this._dropdownNode)),0<this.getItems().length&&(this._hookedAutoDismiss||
(this._boundAutoDismiss?m.removeAutoDismiss(this._boundAutoDismiss):this._boundAutoDismiss=this._autoDismiss.bind(this),f=m.$$array(".dropdownSubMenu",this._dropdownNode),m.addAutoDismiss([this._triggerNode].concat(f),this._boundAutoDismiss),this._hookedAutoDismiss=!0),this._triggerNode.classList.add("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.add(this._selectionClass),this._dropdownNode.classList.add("dropdownMenuOpen"),this._isVisible=!0,this._positionDropdown(b),this._dropdownNode.focus(),
f=!0,this._parentDropdown&&this._parentDropdown.submenuOpen(this)));return f},_autoDismiss:function(b){if(this.close(!1)&&this._dropdownNode.contains(b.target))for(b=this._parentDropdown;b;)b.close(!1),b=b._parentDropdown},_positionDropdown:function(b){this._dropdownNode.style.left="";this._dropdownNode.style.top="";if(this._positioningNode)this._dropdownNode.style.left=this._positioningNode.offsetLeft+"px";else{b=m.bounds(this._dropdownNode);var f=m.bounds(document.body);if(b.left+b.width>f.left+
f.width)if(this._triggerNode.classList.contains("dropdownMenuItem"))this._dropdownNode.style.left=-b.width+"px";else{var a=m.bounds(this._boundingNode(this._triggerNode)),d=m.bounds(this._triggerNode);this._dropdownNode.style.left=d.left-a.left-b.width+d.width+"px"}b=b.top+b.height-(f.top+f.height);0<b&&(this._dropdownNode.style.top=Math.floor(this._dropdownNode.style.top-b)+"px")}},_boundingNode:function(b){var f=window.getComputedStyle(b,null);return null===f||"absolute"===f.getPropertyValue("position")||
!b.parentNode||b===document.body?b:this._boundingNode(b.parentNode)},close:function(b){var f=!1;this.isVisible()&&(this._triggerNode.classList.remove("dropdownTriggerOpen"),this._selectionClass&&this._triggerNode.classList.remove(this._selectionClass),this._dropdownNode.classList.remove("dropdownMenuOpen"),m.setFramesEnabled(!0),b&&this._triggerNode.focus(),this._isVisible=!1,this._selectedItem&&(this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=null),f=!0);return f},
getItems:function(){var b=[],f=this;m.$$array("li:not(.dropdownSeparator) \x3e .dropdownMenuItem",this._dropdownNode,!0).forEach(function(a){a.parentNode.parentNode===f._dropdownNode&&b.push(a)});b.forEach(function(a){a._hasDropdownMouseover||(a.addEventListener("mouseover",function(b){a.dropdown?a.dropdown.open(b):(f._closeSelectedSubmenu(),m.stop(b));f._selectItem(a)}),a._hasDropdownMouseover=!0)});return b},empty:function(){var b=this;m.$$array("li",this._dropdownNode).forEach(function(f){f.parentNode===
b._dropdownNode&&f.parentNode.removeChild(f)});this._hookedAutoDismiss=!1},_dropdownKeyDown:function(b){if(b.keyCode===m.KEY.UP||b.keyCode===m.KEY.DOWN||b.keyCode===m.KEY.RIGHT||b.keyCode===m.KEY.ENTER||b.keyCode===m.KEY.LEFT){var f=this.getItems();if(f.length&&0<f.length){if(this._selectedItem){var a=f.indexOf(this._selectedItem);0>a&&(a=f.indexOf(this._selectedItem.parentNode));0<=a&&(b.keyCode===m.KEY.UP&&0<a?(a--,this._selectItem(f[a])):b.keyCode===m.KEY.DOWN&&a<f.length-1?(a++,this._selectItem(f[a])):
b.keyCode===m.KEY.ENTER||b.keyCode===m.KEY.RIGHT?this._selectedItem.classList.contains("dropdownTrigger")&&this._selectedItem.dropdown?(this._selectedItem.dropdown.open(),this._selectedItem.dropdown._selectItem()):b.keyCode===m.KEY.ENTER&&this._selectedItem.click():b.keyCode===m.KEY.LEFT&&this._selectedItem.parentNode.parentNode.classList.contains("dropdownMenuOpen")&&(this.close(!0),this._parentDropdown&&this._parentDropdown._dropdownNode.focus()))}else this._selectItem(f[0]);m.stop(b)}}else b.keyCode===
m.KEY.ESCAPE&&(this.close(!0),m.stop(b))},_selectItem:function(b){if(b=b||this.getItems()[0])this._selectedItem&&this._selectedItem.classList.remove("dropdownMenuItemSelected"),this._selectedItem=b,this._selectedItem.classList.add("dropdownMenuItemSelected");document.activeElement!==this._dropdownNode&&this._dropdownNode.focus()},submenuOpen:function(b){b!==this._selectedSubmenu&&(this._closeSelectedSubmenu(),this._selectedSubmenu=b)},_closeSelectedSubmenu:function(){for(var b=this._selectedSubmenu;b;)b.close(),
b=b._selectedSubmenu},destroy:function(){this.empty();this._boundAutoDismiss&&m.removeAutoDismiss(this._boundAutoDismiss)},appendMenuItem:function(b,f){var a=d(b,f);this._dropdownNode.appendChild(a);return a},appendSeparator:function(){var b=n();this._dropdownNode.appendChild(b);return b}};e.prototype.constructor=e;return{Dropdown:e,appendKeyBindingString:function(b,f){var a=document.createElement("span");a.classList.add("dropdownKeyBinding");a.appendChild(document.createTextNode(f));b.appendChild(a)},
createMenuItem:d,createSeparator:n}});define("text!orion/webui/dropdowntriggerbutton.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger"\x3e${ButtonText}\x3c!--span class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span--\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});define("text!orion/webui/dropdowntriggerbuttonwitharrow.html",[],function(){return'\x3cbutton class\x3d"dropdownTrigger dropdownDefaultButton"\x3e${ButtonText}\x3cspan class\x3d"dropdownArrowDown core-sprite-openarrow"\x3e\x3c/span\x3e\x3c/button\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e'});
define("text!orion/webui/submenutriggerbutton.html",[],function(){return'\x3cli class\x3d"dropdownSubMenu"\x3e\x3cspan class\x3d"dropdownTrigger dropdownMenuItem" role\x3d"menuitem" tabindex\x3d"0"\x3e\x3cspan class\x3d"dropdownCommandName"\x3e${ButtonText}\x3c/span\x3e\x3cspan class\x3d"dropdownArrowRight core-sprite-closedarrow"\x3e\x3c/span\x3e\x3c/span\x3e\x3cul class\x3d"dropdownMenu"\x3e\x3c/ul\x3e\x3c/li\x3e'});define("text!orion/webui/checkedmenuitem.html",[],function(){return'\x3cli\x3e\x3clabel class\x3d"dropdownMenuItem"\x3e\x3cinput class\x3d"checkedMenuItem" role\x3d"menuitem" type\x3d"checkbox" /\x3e${ItemText}\x3c/label\x3e\x3c/li\x3e'});
define("orion/webui/tooltip",["require","orion/webui/littlelib"],function(k,m){function g(e){this._init(e)}g.prototype={_init:function(e){this._node=m.node(e.node);if(!this._node)throw"no dom node for tooltip found";this._position=e.position||["right","above","below","left"];this._text=e.text;this._hideDelay=void 0===e.hideDelay?200:e.hideDelay;this._tailSize=e.tailSize||10;this._trigger=e.trigger||"mouseover";this._afterShowing=e.afterShowing;this._afterHiding=e.afterHiding;var d=this;if("click"===
this._trigger)this._showDelay=0,this._node.addEventListener("click",this._clickHandler=function(b){b.target===d._node&&(d.show(),m.stop(b))},!1);else if("mouseover"===this._trigger){this._showDelay=void 0===e.showDelay?500:e.showDelay;e=["mouseout","click"];this._node.addEventListener("mouseover",this._mouseoverHandler=function(b){m.contains(d._node,b.target)&&(d.show(),m.stop(b))},!1);this._leaveHandler=function(b){m.contains(d._node,b.target)&&d.hide()};for(var g=0;g<e.length;g++)this._node.addEventListener(e[g],
this._leaveHandler,!1)}},_makeTipNode:function(){if(!this._tip){this._tip=document.createElement("span");this._tip.classList.add("tooltipContainer");this._tipInner=document.createElement("div");this._tipInner.classList.add("tooltip");if(this._text){this._tipTextContent=document.createElement("div");this._tipTextContent.classList.add("textContent");this._tipInner.appendChild(this._tipTextContent);var e=document.createTextNode(this._text);this._tipTextContent.appendChild(e)}this._tip.appendChild(this._tipInner);
document.body.appendChild(this._tip);var d=this;m.addAutoDismiss([this._tip,this._node],function(){d.hide()});"mouseover"===this._trigger&&(this._tipInner.role="tooltip",this._tipInner.id="tooltip"+(new Date).getTime().toString(),this._node.setAttribute("aria-describedby",this._tipInner.id),this._tip.addEventListener("mouseover",function(e){d._timeout&&(window.clearTimeout(d._timeout),d._timeout=null);d._tip.addEventListener("mouseout",function(b){m.contains(d._tip,b.target)&&(d.hide(),m.stop(b))},
!1)},!1))}return this._tip},_positionTip:function(e,d){this._makeTipNode();"left"===e?this._tipInner.classList.add("left"):this._tipInner.classList.remove("left");var g=this._node,b;for(b=m.bounds(g);g&&!b.width&&!b.height;g=g.parentNode)b=m.bounds(g);var g=m.bounds(this._tipInner),f;switch(e){case "above":f=b.top-g.height-this._tailSize-1;b=b.left-this._tailSize;break;case "below":f=b.top+b.height+this._tailSize+1;b=b.left-this._tailSize;break;case "left":f=b.top-this._tailSize/2;b=b.left-g.width-
this._tailSize-1;break;default:f=b.top-this._tailSize/2,b=b.left+b.width+this._tailSize+1}var a=m.bounds(document.documentElement);if(f+g.height>a.height)if(d)f=a.height-g.height-1;else return!1;if(b+g.width>a.width)if(d)b=a.width-g.width-1;else return!1;if(0>b)if(d)b=4;else return!1;if(0>f)if(d)f=4;else return!1;this._tail&&this._tail.previousPosition!==e&&(this._tip.removeChild(this._tail),this._tail=null);this._tail||(this._tail=document.createElement("span"),this._tail.classList.add("tooltipTailFrom"+
e),"above"===e||"left"===e?this._tip.appendChild(this._tail):this._tip.insertBefore(this._tail,this._tipInner),"left"===e&&(this._tail.style.left=g.width+"px"),this._tail.previousPosition=e);this._tip.style.top=f+"px";this._tip.style.left=b+"px";return!0},contentContainer:function(){this._makeTipNode();return this._tipInner},show:function(){if(!this._tip||!this._tip.classList.contains("tooltipShowing"))this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null),this._showDelay?this._timeout=
window.setTimeout(this._showImmediately.bind(this),this._showDelay):this._showImmediately()},_showImmediately:function(){for(var e=!1,d=0;!e&&d<this._position.length;)e=this._positionTip(this._position[d]),d++;e||this._positionTip(this._position[0],!0);this._tip.classList.add("tooltipShowing");this._afterShowing&&this._afterShowing()},hide:function(e){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);if(this._tip&&this._tip.classList.contains("tooltipShowing")){void 0===e&&(e=
this._hideDelay);var d=this;this._timeout=window.setTimeout(function(){d._tip.classList.remove("tooltipShowing");d._tip.removeAttribute("style");d._afterHiding&&d._afterHiding()},e)}},destroy:function(){this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null);this._tip&&(document.body.removeChild(this._tip),this._tail=this._tipTextContent=this._tipInner=this._tip=null);if(this._node){this._node.removeEventListener("click",this._clickHandler,!1);this._node.removeEventListener("mouseover",
this._mouseoverHandler,!1);for(var e=["mouseout","click"],d=0;d<e.length;d++)this._node.removeEventListener(e[d],this._leaveHandler,!1)}}};g.prototype.constructor=g;return{Tooltip:g}});
define("orion/commands","orion/util orion/webui/littlelib orion/webui/dropdown text!orion/webui/dropdowntriggerbutton.html text!orion/webui/dropdowntriggerbuttonwitharrow.html text!orion/webui/submenutriggerbutton.html text!orion/webui/checkedmenuitem.html orion/webui/tooltip".split(" "),function(k,m,g,e,d,n,b,f){function a(a){var c=a.invocation;if(c){var h=a.command;if(h.hrefCallback)return a=h.hrefCallback.call(c.handler||window,c),a.then?a.then(function(a){window.open(a)}):window.open(a),!0;if(c.commandRegistry)return c.commandRegistry._invoke(c),
!0;if(h.onClick||h.callback)return window.setTimeout(function(){(h.onClick||h.callback).call(c.handler||window,c)},0),!0}return!1}function l(c,h){for(var b in h)if(h[b]&&h[b].keyBinding&&h[b].command&&h[b].keyBinding.match(c)){var f=h[b],d=f.keyBinding;if((!d.domScope||m.contains(m.node(d.domScope),c.target))&&a(f)){m.stop(c);break}}}function c(){var a={};if(u){var c,h,b;h=Object.keys(D);for(c=0;c<h.length;c++)b=h[c],a[b]=D[b];var f=u();h=Object.keys(f);for(c=0;c<h.length;c++)b=h[c],a[b]=f[b]}else a=
D;return a}function h(a){l(a,c())}function q(a,c){a=a||window.event;if(function(a){if(k.isMac){if(a.metaKey&&!a.altKey)return!a.shiftKey&&!a.ctrlKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.ctrlKey)return!1}else{if(a.ctrlKey&&!a.altKey)return!a.shiftKey&&(65===a.keyCode||67===a.keyCode||86===a.keyCode||88===a.keyCode||90===a.keyCode)?!0:!1;if(a.altKey&&!a.ctrlKey)return!1}if(a["char"])return 0<a["char"].length;if(a.charCode||a.keyCode)switch(a=a.charCode||
a.keyCode,a){case 8:case 9:case 13:case 46:return!0;default:return 32<=a&&112>a||123<a}return!1}(a)){if("true"===a.target.contentEditable)return;var b=a.target.nodeName.toLowerCase();if("input"===b)switch(a.target.type.toLowerCase()){case "text":case "password":case "search":case "color":case "date":case "datetime":case "datetime-local":case "email":case "month":case "number":case "range":case "tel":case "time":case "url":case "week":return}else if("textarea"===b)return}c?c(a):h(a)}function p(){this._init()}
function s(a,c,h){c.classList.add("commandImage");var b;a.imageClass?a.addImageClassToElement?c.classList.add(a.imageClass):(b=document.createElement("span"),c.appendChild(b),b.classList.add(a.spriteClass),b.classList.add(a.imageClass)):(b=new Image,b.alt=a.name,b.name=h,b.id=h,b.src=a.image,c.appendChild(b));return b}function t(a,c,h,b,f){this.commandRegistry=f;this.handler=a;this.items=c;this.userData=h;this.command=b;b.parameters&&(this.parameters=b.parameters.makeCopy());this.id=b.id}function r(a){this._init(a)}
var u=null,D={};p.prototype={setProxy:function(a){this.proxy=a},setKeyBindings:function(a){this.bindings=a},_init:function(){var a=this;document.addEventListener("keydown",function(c){return q(c,function(c){var b=a.proxy,h=a.bindings;if(h&&b)for(var f=0;f<h.length;f++)h[f].match(c)&&(b.processKey({type:c.type,keyCode:c.keyCode,altKey:c.altKey,ctrlKey:c.ctrlKey,metaKey:c.metaKey,shiftKey:c.shiftKey}),m.stop(c))})})}};window.document.addEventListener("keydown",q,!1);t.prototype={collectsParameters:function(){return this.commandRegistry&&
this.commandRegistry.collectsParameters()},makeCopy:function(a){var c=new t(this.handler,this.items,this.userData,this.command,this.commandRegistry);c.domNode=this.domNode;c.domParent=this.domParent;a?c.parameters=a.makeCopy():this.parameters&&(c.parameters=this.parameters.makeCopy());return c}};t.prototype.constructor=t;r.prototype={_init:function(a){this.id=a.id;this.name=a.name;this.tooltip=a.tooltip;this.callback=a.callback;this.hrefCallback=a.hrefCallback;this.choiceCallback=a.choiceCallback;
this.positioningNode=a.positioningNode;this.image=a.image||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC";this.imageClass=a.imageClass;this.addImageClassToElement=a.addImageClassToElement;this.selectionClass=a.selectionClass;this.spriteClass=a.spriteClass||"commandSprite";this.visibleWhen=a.visibleWhen;this.parameters=a.parameters;this.isEditor=a.isEditor},populateChoicesMenu:function(a,c,b,h,
f){b=this.getChoices(c,b,h);var d=b.some(function(a){return a.checked});b.forEach(function(b){if(b.name){var h=document.createElement("li");a.appendChild(h);var l=document.createElement("span");l.tabIndex=0;l.role="menuitem";l.classList.add("dropdownMenuItem");if(d){var e=document.createElement("span");e.classList.add("check");e.appendChild(document.createTextNode(b.checked?"\u25cf":""));l.appendChild(e)}e=document.createTextNode(b.name);l.appendChild(e);h.appendChild(l);l.choice=b;l.addEventListener("click",
function(a){a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1);l.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&a.target.choice&&a.target.choice.callback.call(a.target.choice,c)},!1)}else f._generateMenuSeparator(a)})},getChoices:function(a,c,b){return this.choiceCallback?this.choiceCallback.call(c,a,b):null},makeChoiceCallback:function(a,c){return function(b){a.callback&&a.callback.call(a,c,b)}},hasImage:function(){return this.imageClass||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC"!==this.image}};r.prototype.constructor=r;return{Command:r,CommandInvocation:t,createDropdownMenu:function(a,c,b,h,f,l,r,q,p){a=m.node(a);if(!a)throw"no parent node was specified";var t=document.createRange();t.selectNode(a);t=p?t.createContextualFragment(d):t.createContextualFragment(e);m.processTextNodes(t,{ButtonText:c});a.appendChild(t);a=a.lastChild;
var u;p?(p=a.previousSibling,u=p.lastChild):p=a.previousSibling;h?p.classList.add(h):(p.classList.add("orionButton"),p.classList.add("commandButton"));f&&(l||(p.textContent="",p.setAttribute("aria-label",c)),s({spriteClass:"commandSprite",imageClass:f},p,c),p.classList.add("orionButton"));p.dropdown=new g.Dropdown({dropdown:a,populate:b,selectionClass:r,skipTriggerEventListeners:!!u,positioningNode:q});a.dropdown=p.dropdown;return{menuButton:p,menu:a,dropdown:p.dropdown,dropdownArrow:u}},createCheckedMenuItem:function(a,
c,h,f){a=m.node(a);if(!a)throw"no parent node was specified";var d=document.createRange();d.selectNode(a);d=d.createContextualFragment(b);m.processTextNodes(d,{ItemText:c});a.appendChild(d);a=m.$(".checkedMenuItem",a.lastChild);a.checked=h;a.addEventListener("change",f,!1);return a},createCommandItem:function(a,c,b,h,d,l,e){var r;l=l||!c.name&&c.hasImage();if(c.hrefCallback)r=document.createElement("a"),r.id=h,l&&c.hasImage()?s(c,r,h):(r.className="commandLink",r.appendChild(document.createTextNode(c.name))),
e=c.hrefCallback.call(b.handler,b),e.then?e.then(function(a){r.href=a}):r.href=e?e:"#";else{r=document.createElement("button");r.className="orionButton";l?c.hasImage()?(s(c,r,h),c.name&&r.setAttribute("aria-label",c.name)):(r.classList.add("commandButton"),r.classList.add("commandMissingImageButton"),r.appendChild(document.createTextNode(c.name))):(r.classList.add("commandButton"),h=document.createTextNode(c.name),r.appendChild(h));var q=e||c.callback;q&&(c.onClick=q,r.addEventListener("click",function(a){q.call(b.handler,
b)},!1))}"ul"===a.nodeName.toLowerCase()?(e=document.createElement("li"),a.appendChild(e),a=e):r.classList.add("commandMargins");a.appendChild(r);c.tooltip&&(r.commandTooltip=new f.Tooltip({node:r,text:c.tooltip,position:["above","below","right","left"]}));d&&(D[c.id]={keyBinding:d,command:c,invocation:b});return r},createCommandMenuItem:function(a,c,b,h,d,l){var e,r,q=a.dropdown;if(c.hrefCallback)r=g.createMenuItem(c.name,"a"),e=r.firstElementChild,d=c.hrefCallback.call(b.handler,b),d.then?d.then(function(a){e.href=
a}):e.href=d?d:"#",e.addEventListener("keydown",function(a){(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)&&e.click()},!1);else{r=g.createMenuItem(c.name);e=r.firstElementChild;var p=d||c.callback;p&&(c.onClick=p,e.addEventListener("click",function(a){q.close(!0);p.call(b.handler,b)},!1),e.addEventListener("keydown",function(a){if(a.keyCode===m.KEY.ENTER||a.keyCode===m.KEY.SPACE)a.preventDefault(),e.click()},!1))}c.tooltip&&(e.commandTooltip=new f.Tooltip({node:e,text:c.tooltip,position:["above",
"below","right","left"]}));l&&g.appendKeyBindingString(e,l);a.appendChild(r);h&&(D[c.id]={keyBinding:h,command:c,invocation:b});return e},executeBinding:a,setKeyBindingProvider:function(a){u=a},localKeyBindings:D,CommandsProxy:p,getKeyBindings:c,processKey:h,NO_IMAGE:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA1BMVEUAAACnej3aAAAAAXRSTlMAQObYZgAAAAtJREFUCNdjIBEAAAAwAAFletZ8AAAAAElFTkSuQmCC",_testMethodProcessKey:l}});
define("orion/explorers/navigationUtils",[],function(){function k(g,e,d,k){!m&&g&&(g.push({domNode:e}),e.tabIndex=-1,e.style.outline="none")}var m=-1!==navigator.userAgent.indexOf("iPad");return{addNavGrid:function(g,e,d){g&&(g=g.getGridNavHolder(e,!0))&&k(g,d)},generateNavGrid:k,removeNavGrid:function(g,e){if(g)for(var d=0;d<g.length;d++)if(g[d].domNode===e){g.splice(d,1);break}}}});
define("orion/PageUtil",[],function(){var k=/^http[s]?/i;return{hash:function(){var k=window.location.href.split("#")[1];return k?"#"+k:""},matchResourceParameters:function(k){k=k||window.location.toString();var g={resource:""},e=k.indexOf("#");if(-1!==e&&(k=k.substring(e+1),0!==k.length)){k=k.split(",");g.resource=decodeURIComponent(k[0]);for(e=1;e<k.length;e++){var d=/([^=]*)(=?)(.*)/.exec(k[e]),n=decodeURIComponent(d[1]||""),d=decodeURIComponent(d[3]||"");""!==n&&"resource"!==n&&(g[n]=d)}}return g},
validateURLScheme:function(m,g){var e=m;if(-1===m.indexOf("://")){var d=document.createElement("a");d.href=m;e=d.href}d=!1;if(d=g?g.some(function(d){return RegExp("^"+d+":","i").test(e)}):k.test(e))return m;console.log("Illegal URL Scheme: '"+m+"'");return""}}});
define("orion/uiUtils",["orion/webui/littlelib"],function(k){function m(e){var d="",g=-1!==navigator.platform.indexOf("Mac");g?(e.mod4&&(d+="\u2303"),e.mod3&&(d+="\u2325"),e.mod2&&(d+="\u21e7"),e.mod1&&(d+="\u2318")):(e.mod1&&(d+="Ctrl+"),e.mod2&&(d+="Shift+"),e.mod3&&(d+="Alt+"));if(e.alphaKey)return d+e.alphaKey;if("keypress"===e.type)return d+e.keyCode;for(var b in k.KEY)if(typeof("number"===k.KEY[b])&&k.KEY[b]===e.keyCode){if(g)switch(k.KEY[b]){case k.KEY.BKSPC:b="\u232b";break;case k.KEY.TAB:b=
"\u21e5";break;case k.KEY.ENTER:b="\u23ce";break;case k.KEY.ESCAPE:b="\u238b";break;case k.KEY.SPACE:b="\u2423";break;case k.KEY.PAGEUP:b="\u21de";break;case k.KEY.PAGEDOWN:b="\u21df";break;case k.KEY.END:b="\u21f2";break;case k.KEY.HOME:b="\u21f1";break;case k.KEY.DEL:b="\u2326"}switch(k.KEY[b]){case k.KEY.DOWN:b="\u2193";break;case k.KEY.UP:b="\u2191";break;case k.KEY.RIGHT:b="\u2192";break;case k.KEY.LEFT:b="\u2190"}return d+b}var f;switch(e.keyCode){case 59:f=e.mod2?":":";";break;case 61:f=e.mod2?
"+":"\x3d";break;case 188:f=e.mod2?"\x3c":",";break;case 190:f=e.mod2?"\x3e":".";break;case 191:f=e.mod2?"?":"/";break;case 192:f=e.mod2?"~":"`";break;case 219:f=e.mod2?"{":"[";break;case 220:f=e.mod2?"|":"\\";break;case 221:f=e.mod2?"}":"]";break;case 222:f=e.mod2?'"':"'"}return f?d+f:112<=e.keyCode&&123>=e.keyCode?d+"F"+(e.keyCode-111):d+String.fromCharCode(e.keyCode)}function g(e){var d=-1!==window.navigator.platform.indexOf("Mac");return d&&e.metaKey||!d&&e.ctrlKey}return{getUserKeyString:function(e){var d=
"";e=e.getKeys();for(var g=0;g<e.length;g++)0!==g&&(d+=" "),d+=m(e[g]);return d},getUserText:function(e){var d=e.id,g=e.refNode,b=e.hideRefNode,f=e.initialText,a=e.onComplete,l=e.onEditDestroy,c=e.selectTo,h=e.isInitialValid;e=e.insertAsChild;var q=!1,p=function(c){return function(e){if(!q){var p=k.node(d),s=p.value;p&&(c&&e.keyCode===k.KEY.ESCAPE?(b&&(g.style.display="inline"),q=!0,p.parentNode.removeChild(p),l&&l()):c&&e.keyCode!==k.KEY.ENTER||(0===s.length||!h&&s===f?b&&(g.style.display="inline"):
(a(s),b&&g.parentNode&&(g.style.display="inline")),q=!0,p.parentNode&&p.parentNode.removeChild(p),l&&l()))}}},s=document.createElement("input");s.id=d;s.value=f||"";e?g.appendChild(s):g.parentNode.insertBefore(s,g.nextSibling);s.classList.add("userEditBoxPrompt");b&&(g.style.display="none");s.addEventListener("keydown",p(!0),!1);s.addEventListener("blur",p(!1),!1);window.setTimeout(function(){s.focus();if(f){var a=k.node(d),b=c?f.indexOf(c):-1;0<b?a.createTextRange?(a=a.createTextRange(),a.collapse(!0),
a.moveStart("character",0),a.moveEnd("character",b),a.select()):a.setSelectionRange?a.setSelectionRange(0,b):void 0!==a.selectionStart&&(a.selectionStart=0,a.selectionEnd=b):a.select()}},0)},openInNewWindow:g,followLink:function(e,d){d&&g(d)?window.open(e):window.location=e},createButton:function(e,d){var g=document.createElement("button");g.className="orionButton commandButton commandMargins";g.addEventListener("click",function(b){d();k.stop(b)},!1);e&&g.appendChild(document.createTextNode(e));return g},
createDropdownButton:function(e,d,g){},isFormElement:function(e){switch(e.tagName.toLowerCase()){case "button":case "fieldset":case "form":case "input":case "keygen":case "label":case "legend":case "meter":case "optgroup":case "output":case "progress":case "select":case "textarea":return!0}return!1}}});
define("orion/commandRegistry","orion/commands orion/explorers/navigationUtils orion/PageUtil orion/uiUtils orion/webui/littlelib orion/webui/dropdown orion/webui/tooltip text!orion/webui/checkedmenuitem.html text!orion/webui/dropdowntriggerbutton.html text!orion/webui/submenutriggerbutton.html".split(" "),function(k,m,g,e,d,n,b,f,a,l){function c(a){this._commandList={};this._contributionsByScopeId={};this._activeBindings={};this._urlBindings={};this._pendingBindings={};this._init(a);this._parameterCollector=
null}function h(a,c){this.token=a;this.parameterName=c}function q(a,c,b){this.event=a;this.handler=c;this.capture=b||!1}function p(a,c,b,h,f,d){this.name=a;this.type=c;this.label=b;this.value=h;this.lines=f||1;this.eventListeners=Array.isArray(d)?d:d?[d]:[]}function s(a,c,b){this._storeParameters(a);this._hasOptionalParameters=c&&c.hasOptionalParameters;this._options=c;this.optionsRequested=!1;this.getParameters=b;this.clientCollect=c&&c.clientCollect}c.prototype={_init:function(a){this._selectionService=
a.selection;var c=this;k.setKeyBindingProvider(function(){return c._activeBindings})},processURL:function(a){for(var c in this._urlBindings)if(this._urlBindings[c]&&this._urlBindings[c].urlBinding&&this._urlBindings[c].command){var b=this._urlBindings[c].urlBinding.match(a);if(b){var h=this._urlBindings[c],f=h.command,d=h.invocation;if(d&&d.parameters&&f.callback){d.parameters.setValue(b.parameterName,b.parameterValue);var l=this;window.setTimeout(function(){l._invoke(d)},0);break}}}},findCommand:function(a){return this._commandList[a]},
runCommand:function(a,c,b,h){c?(a=this._commandList[a])&&(a.visibleWhen?a.visibleWhen(c):1)&&a.callback&&this._invoke(new k.CommandInvocation(b,c,null,a,this),h):(c=this._urlBindings[a])&&c.command&&c.command.callback&&this._invoke(c.invocation,h)},getSelectionService:function(){return this._selectionService},setParameterCollector:function(a){this._parameterCollector=a},openParameterCollector:function(a,c,b){this._parameterCollector&&(this._parameterCollector.close(),this._parameterCollector.open(a,
c,b))},confirm:function(a,c,b,h,f,d){var l=!1;if(this._parameterCollector&&!f){var e=this;this._parameterCollector.close();if(this._parameterCollector.open(a,function(a,f){var d=document.createElement("span");d.classList.add("parameterPrompt");d.textContent=c;a.appendChild(d);d=document.createElement("button");d.addEventListener("click",function(a){l=!0;e._parameterCollector.close()},!1);f.appendChild(d);d.appendChild(document.createTextNode(b));d.className="dismissButton";var q=document.createElement("button");
q.addEventListener("click",function(a){l=!1;e._parameterCollector.close()},!1);f.appendChild(q);q.appendChild(document.createTextNode(h));q.className="dismissButton";return d},function(){d(l)}))return}l=window.confirm(c);d(l)},closeParameterCollector:function(){this._parameterCollector&&this._parameterCollector.close()},collectsParameters:function(){return this._parameterCollector},_invoke:function(a,c){return this._collectAndInvoke(a.makeCopy(c),!1)},_collectAndInvoke:function(a,c){if(a)if(this._parameterCollector&&
a.parameters&&a.parameters.hasParameters()&&(c||a.parameters.shouldCollectParameters())){var h=!1;a.parameters.updateParameters(a);if(a.parameters.shouldCollectParameters()&&(h=this._parameterCollector.collectParameters(a),!h)){var f=new b.Tooltip({node:a.domNode,afterHiding:function(){this.destroy()},trigger:"click",position:["below","right","above","left"]}),h=f.contentContainer();h.classList.add("parameterPopup");var d=window.document.activeElement,l=this._parameterCollector.getFillFunction(a,
function(){d&&d.focus();f.destroy()})(h);f.show();window.setTimeout(function(){l.focus();l.select()},0);h=!0}h||a.command.callback.call(a.handler||window,a)}else a.command.callback.call(a.handler||window,a);else window.console.log("Client attempted to invoke command without an available (rendered) command invocation")},collectParameters:function(a){this._collectAndInvoke(a,!0)},showKeyBindings:function(a){function c(a){return function(){k.executeBinding(a)}}var b={},h,f,d=[],l;for(l in this._activeBindings)(f=
this._activeBindings[l])&&f.keyBinding&&f.command&&(f.command.name||f.command.tooltip)&&d.push(f);d.sort(function(a,c){return(a.command.name||a.command.tooltip).localeCompare(c.command.name||c.command.tooltip)});for(l=0;l<d.length;l++)f=d[l],f.keyBinding.scopeName?(b[f.keyBinding.scopeName]||(b[f.keyBinding.scopeName]=[]),b[f.keyBinding.scopeName].push(f)):(h=e.getUserKeyString(f.keyBinding),a.createItem(h,f.command.name||f.command.tooltip,c(f)));for(var q in b)b[q].length&&0<b[q].length&&(a.createHeader(q),
b[q].forEach(function(b){h=e.getUserKeyString(b.keyBinding);a.createItem(h,b.command.name||b.command.tooltip,c(b))}))},addCommand:function(a){this._commandList[a.id]=a;var c=this._pendingBindings[a.id];if(c){var b=this;c.forEach(function(c){b._addBinding(a,c.type,c.binding,c.bindingOnly)});delete this._pendingBindings[a.id]}},addCommandGroup:function(a,c,b,h,f,d,l,e,q,g){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];f&&(a=this._createEntryForPath(a,
f));a[c]?(h&&(a[c].title=h),b&&(a[c].position=b),l&&(a[c].imageClass=l),e&&(a[c].tooltip=e),q&&(a[c].selectionClass=q),!0===g?a[c].pretendDefaultActionId=!0:a[c].defaultActionId=g,a[c].emptyGroupMessage=d):(a[c]={title:h,position:b,emptyGroupMessage:d,imageClass:l,tooltip:e,selectionClass:q,defaultActionId:!0===g?null:g,pretendDefaultActionId:!0===g,children:{}},a.sortedContributions=null)},_createEntryForPath:function(a,c){c&&c.split("/").forEach(function(c){1<c.length&&(a[c]||(a[c]={position:0,
children:{}},a.sortedContributions=null),a=a[c].children)});return a},registerSelectionService:function(a,c){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});this._contributionsByScopeId[a].localSelectionService=c},registerCommandContribution:function(a,c,b,h,f,d,l){this._contributionsByScopeId[a]||(this._contributionsByScopeId[a]={});a=this._contributionsByScopeId[a];h&&(a=this._createEntryForPath(a,h));a[c]={position:b};d&&((b=this._commandList[c])?this._addBinding(b,"key",
d,f):this._addPendingBinding(c,"key",d,f));l&&((b=this._commandList[c])?this._addBinding(b,"url",l,f):this._addPendingBinding(c,"url",l,f));a.sortedContributions=null},unregisterCommandContribution:function(a,c,b){if(this._contributionsByScopeId[a]){delete this._commandList[c];delete this._activeBindings[c];delete this._urlBindings[c];delete this._pendingBindings[c];var h=this._contributionsByScopeId[a];b&&b.split("/").forEach(function(a){1<a.length&&h[a]&&(h=h[a].children)});delete h[c];h.sortedContributions=
null}},_addBinding:function(a,c,b,h){if(!a.id)throw Error("No command id: "+a);"key"===c?this._activeBindings[a.id]={command:a,keyBinding:b,bindingOnly:h}:"url"===c&&(this._urlBindings[a.id]={command:a,urlBinding:b,bindingOnly:h})},_addPendingBinding:function(a,c,b,h){this._pendingBindings[a]=this._pendingBindings[a]||[];this._pendingBindings[a].push({type:c,binding:b,bindingOnly:h})},_checkForTrailingSeparator:function(a,c,b){var h;if("tool"===c||"button"===c)if((h=0<a.childNodes.length?a.childNodes[a.childNodes.length-
1]:null)&&h.classList.contains("commandSeparator"))return b?(a.removeChild(h),!1):!0;if("menu"===c&&(a=d.$$array("li \x3e *",a),0<a.length&&a[a.length-1].classList.contains("dropdownSeparator")))if(h=a[a.length-1],b)h.parentNode.parentNode.removeChild(h.parentNode);else return!0;return!1},renderCommands:function(a,c,b,h,f,l,e){if("string"!==typeof a)throw"a scope id for rendering must be specified";c=d.node(c);if(!c)throw"no parent";var q=this._contributionsByScopeId[a];if(!b&&q){b=q.localSelectionService||
this._selectionService;var g=this;b&&b.getSelections(function(b){g.renderCommands(a,c,b,h,f,l)})}else q&&(this._render(q,c,b,h,f||"button",l,e),this._checkForTrailingSeparator(c,f,!0))},destroy:function(a){a=d.node(a);if(!a)throw"no parent";for(;a.hasChildNodes();){var c=a.firstChild;c.commandTooltip&&c.commandTooltip.destroy();c.emptyGroupTooltip&&c.emptyGroupTooltip.destroy();this.destroy(c);a.removeChild(c)}},_render:function(a,c,h,f,d,l,q){var g=a.sortedContributions;if(!g){var g=[],p=!1,s;for(s in a)if(Object.prototype.hasOwnProperty.call(a,
s)){var n=a[s];n&&"number"===typeof n.position&&(n.id=s,g.push(n),p=!0)}p&&(g.sort(function(a,c){return a.position-c.position}),a.sortedContributions=g)}var G=0,x=this;g.forEach(function(a){var g;a.imageClass||(a.imageClass=null);if(a.children&&0<Object.getOwnPropertyNames(a.children).length){var p=a.children;if("tool"===d||"button"===d)if(a.title){var s;a.defaultActionId&&((p=x._commandList[a.defaultActionId])&&(p.visibleWhen?p.visibleWhen(h):1)?(s=new k.CommandInvocation(f,h,l,p,x),s.domParent=
c):a.pretendDefaultActionId=!0);p=x._createDropdownMenu(c,a.title,null,null,a.imageClass,a.tooltip,a.selectionClass,null,s,a.pretendDefaultActionId);q&&m.generateNavGrid(q,p.menuButton);p&&(x._render(a.children,p.menu,h,f,"menu",l,q),x._checkForTrailingSeparator(p.menu,"menu",!0),0===p.menu.childNodes.length?a.emptyGroupMessage?p.menuButton.emptyGroupTooltip||(p.menuButton.emptyGroupTooltip=new b.Tooltip({node:p.menuButton,text:a.emptyGroupMessage,trigger:"click",position:["below","right","above",
"left"]})):(q&&m.removeNavGrid(q,p.menuButton),a=function(a){a&&a.parentNode&&a.parentNode.removeChild(a)},a(p.menu),a(p.menuButton),a(p.destroyButton)):p.menuButton.style.visibility="visible")}else{var n;0<c.childNodes.length&&!x._checkForTrailingSeparator(c,d)&&(n=x.generateSeparatorImage(c));x._render(p,c,h,f,d,l,q);0<c.childNodes.length&&c.childNodes[c.childNodes.length-1]!==n&&(n=x.generateSeparatorImage(c))}else if(a.title){if(a=x._createDropdownMenu(c,a.title,!0,null,null,a.imageClass))x._render(p,
a.menu,h,f,"menu",l,q),x._checkForTrailingSeparator(a.menu,"menu",!0),0===a.menu.childNodes.length&&a.destroyButton&&c.removeChild(a.destroyButton)}else 0<c.childNodes.length&&x._generateMenuSeparator(c),x._render(p,c,h,f,d,l,q),x._generateMenuSeparator(c)}else{var t=x._commandList[a.id],p=t?!0:!1;s=a=null;if(t){g=new k.CommandInvocation(f,h,l,t,x);g.domParent=c;n=!1;try{n=p&&(t.visibleWhen?t.visibleWhen(h):!0)}catch(A){throw console.log(A),A;}x._activeBindings[t.id]&&x._activeBindings[t.id].keyBinding&&
(a=x._activeBindings[t.id],a.invocation=n?g:null,a.bindingOnly&&(p=!1));x._urlBindings[t.id]&&x._urlBindings[t.id].urlBinding&&(s=x._urlBindings[t.id],s.invocation=n?g:null,s.bindingOnly&&(p=!1));p=p&&n}p&&(t.choiceCallback?("tool"===d||"button"===d?(a=c,p=!1,"ul"===c.nodeName.toLowerCase()&&(a=document.createElement("li"),c.appendChild(a))):(a=c,p=!0),x._createDropdownMenu(a,t.name,p,function(a){t.populateChoicesMenu(a,h,f,l,x)}.bind(t),t.imageClass,t.tooltip||t.title,t.selectionClass,t.positioningNode)):
(g.handler=g.handler||this,g.domParent=c,p=function(a){x._invoke(g)},"menu"===d?(s=null,a&&a.keyBinding&&(s=e.getUserKeyString(a.keyBinding)),a=k.createCommandMenuItem(c,t,g,null,p,s)):(a=d+t.id+G,a=k.createCommandItem(c,t,g,a,null,"tool"===d,p)),m.generateNavGrid(q,a),g.domNode=a,G++))}})},_createDropdownMenu:function(a,c,h,f,e,p,q,g,s,m){a=d.node(a);if(!a||!d.contains(document.body,a))return null;var J,G,x=a;if(h)p=document.createRange(),p.selectNode(a),p=p.createContextualFragment(l),d.processTextNodes(p,
{ButtonText:c}),a.appendChild(p),G=a.lastChild,e=G.lastChild,c=e.previousSibling,c.dropdown=new n.Dropdown({dropdown:e,populate:f,parentDropdown:a.dropdown}),e.dropdown=c.dropdown;else{"ul"===a.nodeName.toLowerCase()&&(x=document.createElement("li"),a.appendChild(x),G=x);a=null;e&&(a="dropdownButtonWithIcon",p=p||c);p=e?p||c:p;var B=k.createDropdownMenu(x,c,f,a,e,!1,q,g,s||m);J=B.dropdownArrow;c=B.menuButton;if(J){s&&(s.domNode=B.menuButton);var K=this;c.onclick=function(a){var c=d.bounds(J);a.clientX>=
c.left&&B.dropdown?B.dropdown.toggle(a):K._invoke(s)};B.dropdown&&(c.onkeydown=function(a){d.KEY.DOWN===a.keyCode&&(B.dropdown.toggle(a),d.stop(a))})}e=B.menu;var y;(f=s&&s.command&&(s.command.tooltip||s.command.name))?y=s.command.tooltip||s.command.name:f&&(y=p);y&&(c.commandTooltip=new b.Tooltip({node:c,text:y,position:["above","below","right","left"]}))}return{menuButton:c,menu:e,dropdown:c.dropdown,destroyButton:G,dropdownArrow:J}},_generateMenuSeparator:function(a){if(!this._checkForTrailingSeparator(a,
"menu")){var c=document.createElement("li");c.classList.add("dropdownSeparator");var b=document.createElement("span");b.classList.add("dropdownSeparator");c.appendChild(b);a.appendChild(c)}},generateSeparatorImage:function(a){var c;c="ul"===a.nodeName.toLowerCase()?document.createElement("li"):document.createElement("span");a.appendChild(c);c.classList.add("core-sprite-sep");c.classList.add("imageSprite");c.classList.add("commandSeparator");return c}};c.prototype.constructor=c;h.prototype={match:function(a){a=
g.matchResourceParameters(a);return"undefined"!==typeof a[this.token]?(this.parameterValue=a[this.token],this):null}};h.prototype.constructor=h;q.prototype.constructor=q;p.prototype={optionsRequested:function(){return this.optionsRequested}};p.prototype.constructor=p;s.prototype={_storeParameters:function(a){this.parameterTable=null;if(a){var c=this.parameterTable={};a.forEach(function(a){c[a.name]=a})}},updateParameters:function(a){"function"===typeof this.getParameters&&this._storeParameters(this.getParameters(a))},
hasParameters:function(){return null!==this.parameterTable},shouldCollectParameters:function(){return!this.clientCollect&&this.hasParameters()},parameterNamed:function(a){return this.parameterTable[a]},valueFor:function(a){return(a=this.parameterTable[a])?a.value:null},setValue:function(a,c){var b=this.parameterTable[a];b&&(b.value=c)},forEach:function(a){for(var c in this.parameterTable)this.parameterTable[c].type&&this.parameterTable[c].name&&a(this.parameterTable[c])},makeCopy:function(){var a=
[];this.forEach(function(c){c=new p(c.name,c.type,c.label,c.value,c.lines,c.eventListeners);a.push(c)});var c=new s(a,this._options,this.getParameters);c.clientCollect=this.clientCollect;return c},hasOptionalParameters:function(){return this._hasOptionalParameters}};s.prototype.constructor=s;return{CommandRegistry:c,URLBinding:h,ParametersDescription:s,CommandParameter:p,CommandEventListener:q}});
define("orion/parameterCollectors",["i18n!orion/nls/messages","require","orion/webui/littlelib"],function(k,m,g){function e(d,e){this._activeContainer=null;this._getElementsFunction=d;this._toolbarLayoutFunction=e}e.prototype={close:function(){if(this._activeElements){this._activeElements.parameterArea&&g.empty(this._activeElements.parameterArea);this._activeElements.slideContainer&&this._activeElements.slideContainer.classList.remove("slideContainerActive");this._activeElements.dismissArea&&g.empty(this._activeElements.dismissArea);
this._activeElements.commandNode&&this._activeElements.commandNode.classList.remove("activeCommand");this._toolbarLayoutFunction(this._activeElements);if(this._activeElements.onClose)this._activeElements.onClose();this._oldFocusNode&&(this._oldFocusNode.focus(),this._oldFocusNode=null)}this._activeElements=null},open:function(d,e,b){"string"===typeof d&&(d=g.node(d));if(this._activeElements&&this._activeElements.slideContainer&&this._activeElements.commandNode===d)return this._activeElements.focusNode&&
this._activeElements.focusNode.focus(),!0;this.close();this._activeElements=null;if((this._activeElements=this._getElementsFunction(d))&&this._activeElements.parameterArea&&this._activeElements.slideContainer){this._activeElements.onClose=b;var f=e(this._activeElements.parameterArea,this._activeElements.dismissArea);if(!f)return!1;this._activeElements.focusNode=f;d=g.$$array("#closebox",this._activeElements.dismissArea||this._activeElements.parameterArea);if(0===d.length){e=this._activeElements.dismissArea||
this._activeElements.parameterArea;d=document.createElement("button");d.id="closebox";d.className="imageSprite core-sprite-close dismissButton";d.title=k.Close;e.appendChild(d);var a=this;d.addEventListener("click",function(b){a.close()},!1)}this._activeElements.slideContainer.classList.add("slideContainerActive");this._toolbarLayoutFunction(this._activeElements);f&&(this._oldFocusNode=window.document.activeElement,window.setTimeout(function(){f.focus();f.select&&f.select()},0));this._activeElements.commandNode&&
this._activeElements.commandNode.classList.add("activeCommand");return!0}return!1},_collectAndCall:function(d,e){g.$$array("input",e).forEach(function(b){"checkbox"===b.type?d.parameters.setValue(b.parameterName,b.checked):"button"!==b.type&&d.parameters.setValue(b.parameterName,b.value.trim())});g.$$array("textArea",e).forEach(function(b){d.parameters.setValue(b.parameterName,b.value.trim())});d.command.callback&&d.command.callback.call(d.handler,d)},collectParameters:function(d){return d.parameters?
(d.domNode&&d.domNode.classList.add("commandMarker"),this.open(d.domNode||d.domParent,this.getFillFunction(d))):!1},getFillFunction:function(d,e){var b=this;return function(f,a){var l=null,c=function(){e&&e();b.close()},h=function(a){a.keyCode===g.KEY.ENTER&&b._collectAndCall(d,f);if(a.keyCode===g.KEY.ESCAPE||a.keyCode===g.KEY.ENTER)c(),g.stop(a)};d.parameters.forEach(function(a){var b=null;a.label&&(b=document.createElement("label"),b.classList.add("parameterInput"),b.setAttribute("for",a.name+"parameterCollector"),
b.textContent=a.label,f.appendChild(b));var e=a.name+"parameterCollector",p,b=b||f;"text"===a.type&&"number"===typeof a.lines&&1<a.lines?(p=document.createElement("textarea"),p.rows=a.lines,p.type="textarea",p.id=e,b.appendChild(p),h=function(a){a.keyCode===g.KEY.ESCAPE&&(c(),g.stop(a))}):"boolean"===a.type?(p=document.createElement("input"),p.type="checkbox",p.id=e,b.appendChild(p),a.value&&(p.checked=!0)):(p=document.createElement("input"),p.type=a.type,p.id=e,b.appendChild(p),a.value&&(p.value=
a.value));p.classList.add("parameterInput");p.setAttribute("speech","speech");p.setAttribute("x-webkit-speech","x-webkit-speech");p.parameterName=a.name;l||(l=p);0<a.eventListeners.length&&a.eventListeners.forEach(function(a){p.addEventListener(a.event,function(c){return a.handler(c,d)},a.capture)});p.addEventListener("keydown",h,!1)});var q=a;q||(q=document.createElement("span"),q.classList.add("layoutRight"),q.classList.add("parametersDismiss"),f.appendChild(q));var p=function(a,c){var b=document.createElement("button");
c.appendChild(b);a&&b.appendChild(document.createTextNode(a));b.classList.add("dismissButton");return b};d.parameters.hasOptionalParameters()&&(d.parameters.optionsRequested=!1,p(k.More,q).addEventListener("click",function(){d.parameters.optionsRequested=!0;b._collectAndCall(d,f);c()},!1));p(k.Submit,q).addEventListener("click",function(){b._collectAndCall(d,f);c()},!1);q=p(null,q);q.id="closebox";q.classList.add("imageSprite");q.classList.add("core-sprite-close");q.title=k.Close;q.addEventListener("click",
function(a){c()},!1);return l}}};e.prototype.constructor=e;return{CommandParameterCollector:e}});define("orion/regex",[],function(){return{escape:function(k){return k.replace(/([\\$\^*\/+?\.\(\)|{}\[\]])/g,"\\$\x26")},parse:function(k){return(k=/^\s*\/(.+)\/([gim]{0,3})\s*$/.exec(k))?{pattern:k[1],flags:k[2]}:null}}});
define("orion/contentTypes",[],function(){function k(a,c){if("string"!==typeof a)return null;for(var b=a&&a.split(".").pop(),f=null,d=0;d<c.length;d++){var e=c[d],g;g=f;var r=e,k=b,n=0<=r.filename.indexOf(a),m;m=k.toLowerCase();m=-1!==r.extension.indexOf(m);if(n||m){if(!(m=!g))n&&(k=k.toLowerCase(),n=-1!==g.extension.indexOf(k)),m=n;m&&(g=r)}g===e&&(f=e)}return f}function m(a){return null===a||"undefined"===typeof a?[]:Array.isArray(a)?a:[a]}function g(a){return m(a).map(function(a){return String.prototype.toLowerCase.call(a)})}
function e(a){return{id:a.id,name:a.name,image:a.image,imageClass:a.imageClass,"extends":a["extends"],extension:g(a.extension),filename:m(a.filename)}}function d(a){var c=Object.create(null);a.map(e).forEach(function(a){Object.prototype.hasOwnProperty.call(c,a.id)||(c[a.id]=a)});return c}function n(l){if(l&&l.registerService){this.serviceRegistry=l;for(var c=l.getServiceReferences(f).concat(l.getServiceReferences(a)),h=[],e=0;e<c.length;e++)for(var p=m(c[e].getProperty("contentTypes")),g=0;g<p.length;g++)h.push(p[g]);
this.map=d(h);l.registerService(b,this)}else if(Array.isArray(l))this.serviceRegistry=null,this.map=d(l);else throw Error("Invalid parameter");}var b="orion.core.contentTypeRegistry",f="orion.core.contenttype",a="orion.file.contenttype";n.prototype={getContentTypes:function(){var a=this.getContentTypesMap(),c=[],b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&c.push(a[b]);return c},getContentTypesMap:function(){return this.map},getFileContentType:function(a){return k(a.Name,this.getContentTypes())},
getFilenameContentType:function(a){return k(a,this.getContentTypes())},getContentType:function(a){return this.map[a]||null},isExtensionOf:function(a,c){a="string"===typeof a?this.getContentType(a):a;c="string"===typeof c?this.getContentType(c):c;if(!a||!c)return!1;if(a.id===c.id)return!0;for(var b=a,f={};b&&(b=this.getContentType(b["extends"]));){if(b.id===c.id)return!0;if(f[b.id])throw Error("Cycle: "+b.id);f[b.id]=!0}return!1},isSomeExtensionOf:function(a,c){for(var b=0;b<c.length;b++)if(this.isExtensionOf(a,
c[b]))return!0;return!1}};return{ContentTypeRegistry:n,getFilenameContentType:k}});
define("orion/URITemplate",[],function(){function k(a){this._text=a}function m(a){return a.replace("%25","%")}function g(a,b){if("U"===b)return encodeURIComponent(a).replace(/[!'()*]/g,function(a){return"%"+a.charCodeAt(0).toString(16).toUpperCase()});if("U+R"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(l,m);if("U+R-,"===b)return encodeURI(a).replace(/%5B/g,"[").replace(/%5D/g,"]").replace(/,/g,"%2C");throw Error("Unknown allowed character set: "+b);}function e(a,b,f){for(var d=
[],l=0;l<a.length;l++)"undefined"!==typeof a[l]&&d.push(g(a[l],b));return d.join(f)}function d(a,b,f,d){for(var l=Object.keys(a),e=[],r=0;r<l.length;r++)"undefined"!==typeof a[l[r]]&&e.push(g(l[r],b)+f+g(a[l[r]],b));return e.join(d)}function n(c){if(0===c.length)throw Error("Invalid Expression: 0 length expression");(this._operator=f[c[0]])?c=c.substring(1):this._operator=f.NUL;for(var b=[],d=c.split(","),l=0;l<d.length;l++){var e=d[l].match(a);if(null===e)throw Error("Bad VarSpec: "+c);b.push({name:e[1],
explode:!!e[2],prefix:e[3]?parseInt(e[3],10):-1})}this._varSpecList=b}function b(a){for(var b=[],f=0,d=a.indexOf("{",f);-1!==d;){b.push(new k(a.substring(f,d)));f=a.indexOf("}",d+1);if(-1===f)throw Error("Invalid template: "+a);b.push(new n(a.substring(d+1,f)));f+=1;d=a.indexOf("{",f)}b.push(new k(a.substring(f)));this._templateComponents=b}var f={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-,"}},a=/^((?:(?:[a-zA-Z0-9_])|(?:%[0-9A-F][0-9A-F]))(?:(?:[a-zA-Z0-9_.])|(?:%[0-9A-F][0-9A-F]))*)(?:(\*)|:([0-9]+))?$/,l=/%25[0-9A-F][0-9A-F]/g;k.prototype={expand:function(a){return encodeURI(this._text)}};
n.prototype={expand:function(a){for(var b=[],f=0;f<this._varSpecList.length;f++){var l=this._varSpecList[f],k=l.name,n=a[k],r=typeof n;if("undefined"!==r&&null!==n){var m=0===b.length?this._operator.first:this._operator.sep;if("string"===r)this._operator.named&&(m+=g(k,"U+R"),m+=0===n.length?this._operator.ifemp:"\x3d"),-1!==l.prefix&&l.prefix<n.length&&(n=n.substring(0,l.prefix)),m+=g(n,this._operator.allow);else if(Array.isArray(n)){if(0===n.length)continue;l.explode?m+=e(n,this._operator.allow,
this._operator.sep):(l=e(n,this._operator.allow,","),this._operator.named&&(m+=g(k,"U+R"),m+=0===l.length?this._operator.ifemp:"\x3d"),m+=l)}else if("object"===r){if(0===Object.keys(n).length)continue;l.explode?m+=d(n,this._operator.allow,"\x3d",this._operator.sep):(l=d(n,this._operator.allow,",",","),this._operator.named&&(m+=g(k,"U+R"),m+=0===l.length?this._operator.ifemp:"\x3d"),m+=l)}else throw Error("bad param type: "+k+" : "+r);b.push(m)}}return b.join("")}};b.prototype={expand:function(a){for(var b=
[],f=0;f<this._templateComponents.length;f++)b.push(this._templateComponents[f].expand(a));return b.join("")}};return b});
define("orion/i18nUtil",["require","orion/Deferred"],function(k,m){function g(d){if(d=localStorage.getItem("orion/messageBundle/"+d))if(d=JSON.parse(d),d._expires&&d._expires>(new Date).getTime())return delete d._expires,d;return null}var e={};return{getMessageBundle:function(d){function n(a){a?k(["i18n!"+d],function(a){if(a){var c=d;a._expires=(new Date).getTime()+9E5;localStorage.setItem("orion/messageBundle/"+c,JSON.stringify(a));delete a._expires}f.resolve(a)}):b(Error(d))}function b(a){f.reject(a)}
if(e[d])return e[d];var f=new m;e[d]=f;var a=g(d);if(a)return f.resolve(a),f;try{k([d],n,b)}catch(l){k(["orion/i18n!"+d],n,b)}return f},formatMessage:function(d){var e=arguments;return d.replace(/\$\{([^\}]+)\}/g,function(b,f){return e[(f<<0)+1]})}}});
define("orion/PageLinks","require orion/Deferred orion/PageUtil orion/URITemplate orion/i18nUtil orion/objects orion/URL-shim".split(" "),function(k,m,g,e,d,n,b){function f(){return k.toUrl?(new URL(k.toUrl("orion/../"),window.location.href)).href.slice(0,-1):(new URL("/",window.location.href)).href.slice(0,-1)}function a(a){var c={};a.getPropertyKeys().forEach(function(b){"objectClass"!==b&&"service.names"!==b&&"service.id"!==b&&"__plugin__"!==b&&(c[b]=a.getProperty(b))});return c}function l(a){return d.getMessageBundle(a.nls).then(function(c){a.textContent=
a.nameKey?c[a.nameKey]:a.name;return a},function(c){a.textContent=a.nameKey||a.name;return a})}function c(c,b){var h=c.getServiceReferences(b||"orion.page.link"),d=g.matchResourceParameters(window.location.href),p={OrionHome:f(),Location:d.resource},q=[];h.forEach(function(c){c=a(c);if(c.uriTemplate&&(c.nls||c.name)){var b=(new e(c.uriTemplate)).expand(p),b=g.validateURLScheme(b);c.href=b;c.nls?q.push(l(c)):(c.textContent=c.name,q.push((new m).resolve(c)))}});return m.all(q)}function h(a){var c=this.categories=
Object.create(null);a.forEach(function(a){c[a.id]=a})}function q(a){this.allPageLinks=a;this.allPageLinks.sort(p)}function p(a,c){var b=a.textContent&&a.textContent.toLowerCase(),h=c.textContent&&c.textContent.toLowerCase();return b<h?-1:b>h?1:0}var s;n.mixin(h.prototype,{getCategoryIDs:function(){return Object.keys(this.categories)},getCategory:function(a){return this.categories[a]||null}});n.mixin(q.prototype,{createLinkElements:function(){return this.allPageLinks.map(function(a){var c=a.href;a=
a.textContent;var b=document.createElement("a");b.href=c;b.target="_self";b.classList.add("targetSelector");b.textContent=a;return b})},getAllLinks:function(){return this.allPageLinks}});return{getCategoriesInfo:function(c){var b;return!s?(b=[],c.getServiceReferences("orion.page.link.category").forEach(function(c){c=a(c);if(c.id&&(c.name||c.nameKey))c.nls?b.push(l(c)):(c.textContent=c.name,b.push((new m).resolve(c)))}),m.all(b).then(function(a){return s=new h(a)})):(new m).resolve(s)},getPageLinksInfo:function(a,
b){return c(a,b).then(function(a){return new q(a)})},getOrionHome:f}});
define("orion/edit/nls/root/messages",{Editor:"Editor",switchEditor:"Switch Editor",Fetching:"Fetching: ${0}",confirmUnsavedChanges:"There are unsaved changes.  Do you still want to navigate away?",searchFiles:"Search Files...",searchTerm:"Enter search term:",unsavedChanges:"There are unsaved changes.",unsavedAutoSaveChanges:"Please stay on the page until Auto Save is complete.",Save:"Save",Saved:"Saved",Blame:"Blame",BlameTooltip:"Show blame annotations",saveOutOfSync:"Resource is out of sync with the server. Do you want to save it anyway?",
loadOutOfSync:"Resource is out of sync with the server. Do you want to load it anyway? This will overwrite your local changes.",ReadingMetadata:"Reading metadata of ${0}",ReadingMetadataError:"Can not get metadata of ${0}",Reading:"Reading ${0}",readonly:"Read Only.",saveFile:"Save this file",gotoLine:"Go to Line...",gotoLineTooltip:"Go to specified line number",gotoLinePrompt:"Go to line:",Undo:"Undo",Redo:"Redo",Find:"Find...",noResponse:"No response from server.  Check your internet connection and try again.",
savingFile:"Saving file ${0}",running:"Running ${0}","Saving...":"Saving...",View:"View",SidePanel:"Side Panel",SidePanelTooltip:"Choose what to show in the side panel.",Actions:"Actions",Navigator:"Navigator",FolderNavigator:"Folder Navigator",Project:"Project",New:"New",File:"File",Edit:"Edit",Tools:"Tools",Add:"Add",noActions:"There are no actions for the current selection.",NoFile:"Use the ${0} to create new files and folders. Click a file to start coding.",LocalEditorSettings:"Local Editor Settings",
NoProject:"${0} is not a project. To convert it to a project use ${1}.",NoProjects:"There are no projects in your workspace. Use the ${0} menu to create projects.",disconnected:"(disconnected)",ChooseFS:"Choose Filesystem",ChooseFSTooltip:"Choose the filesystem you want to view.",FSTitle:"${0} (${1})",Deploy:"Deploy","Deploy As":"Deploy As",Import:"Import",Export:"Export",OpenWith:"Open With",OpenRelated:"Open Related",Dependency:"Dependency",UnnamedCommand:"Unnamed"});
define("orion/edit/nls/messages",["orion/i18n!orion/edit/nls/messages","orion/edit/nls/root/messages"],function(k,m){var g={root:m};Object.keys(k).forEach(function(e){"undefined"===typeof g[e]&&(g[e]=k[e])});return g});
define("orion/extensionCommands","require orion/Deferred orion/commands orion/regex orion/contentTypes orion/URITemplate orion/i18nUtil orion/URL-shim orion/PageLinks i18n!orion/edit/nls/messages".split(" "),function(k,m,g,e,d,n,b,f,a,l){function c(a){var c={};a.getPropertyKeys().forEach(function(b){c[b]=a.getProperty(b)});return c}var h={},q=a.getOrionHome();h._cloneItemWithoutChildren=function r(a){if(null===a||"object"!==typeof a)return a;var c=a.constructor(),b;for(b in a)"children"!==b&&"Children"!==
b&&(c[b]=r(a[b]));return c};h._getOpenWithNavCommandExtensions=function(a,c){function b(a,c){for(var h=a.getServiceReferences("orion.navigate.openWith"),f=[],d=[],l=0;l<h.length;l++){var e=h[l];if(e.getProperty("editor")===c.id){var p=e.getProperty("contentType");p instanceof Array?f=f.concat(p):f.push(p||"*/*");e=e.getProperty("excludedContentTypes");e instanceof Array?d=d.concat(e):null!==e&&"undefined"!==typeof e&&d.push(e)}}0===f.length&&(f=null);0===d.length&&(d=null);return{contentTypes:f,excludedContentTypes:d}}
for(var h=function(){for(var c=a.getServiceReferences("orion.edit.editor"),b=[],h=0;h<c.length;h++){var f=c[h],d=f.getProperty("id");b.push({id:d,"default":f.getProperty("default")||!1,name:f.getProperty("name"),nameKey:f.getProperty("nameKey"),nls:f.getProperty("nls"),uriTemplate:f.getProperty("orionTemplate")||f.getProperty("uriTemplate"),validationProperties:f.getProperty("validationProperties")||[]})}return b}(),f=[],d=0;d<h.length;d++){var l=h[d],e=b(a,l);f.push({properties:{name:l.name||l.id,
nameKey:l.nameKey,id:"eclipse.openWithCommand."+l.id,contentType:e.contentTypes,excludedContentTypes:e.excludedContentTypes,uriTemplate:l.uriTemplate,nls:l.nls,forceSingleItem:!0,isEditor:l["default"]?"default":"editor",validationProperties:l.validationProperties},service:{}})}return f};h._makeValidator=function(a,c,b,h){function f(a,c,b,h,d){var l=!1,e;if("!"===c.charAt(0))return"undefined"===typeof a[c.substring(1)];if("undefined"!==typeof a[c]){if("undefined"===typeof b)e=a[c],l=!0;else if("string"===
typeof b){if(!typeof("string"===a[c]))return!1;if(h.variableName){if(b=RegExp(b).exec(a[c]))l=b[0],e="before"===h.variableMatchPosition?a[c].substring(0,b.index):"after"===h.variableMatchPosition?a[c].substring(b.index+l.length):"only"===h.variableMatchPosition?l:a[c],l=!0}else return RegExp(b).test(a[c])}else a[c]===b&&(e=a[c],l=!0);c=h.variableName;h=h.replacements;if(l&&c&&(d[c]=e,d.itemCached=a,h)){if("string"!==typeof e)return window.console.log("Cannot replace "+c+", value is not a string: "+
e),l;for(a=0;a<h.length;a++){e=!1;if(h[a].pattern){b=h[a].pattern;var p=h[a].replacement||"";d[c]=d[c].replace(RegExp(b),p).replace(RegExp(b),p)}else e=!0;e&&window.console.log("Invalid replacements specified in validation property.  "+h[a])}}return l}return!1}function l(a,c,b,h){var d=b.match,e,p;if(0<=(e=c.indexOf("["))){if(0>(p=c.indexOf("]")))return!1;var g=c.substring(0,e),q;if(!(q=a[g])||!Array.isArray(q))return!1;e=c.substring(e+1,p);e=parseInt(e,10);if(isNaN(e))return!1;0>e&&(e+=q.length);
c=c.substring(p+1);c=g+":"+String(e)+c}return 0<=c.indexOf("|")?(e=c.substring(0,c.indexOf("|")),c=c.substring(c.indexOf("|")+1),l(a,e,b,h)?!0:l(a,c,b,h)):0<=c.indexOf(":")?(e=c.substring(0,c.indexOf(":")),c=c.substring(c.indexOf(":")+1),a[e]?l(a[e],c,b,h):!1):f(a,c,d,b,h)}function e(c,b,h){if(h.info.validationProperties)for(var f=0;f<h.info.validationProperties.length;f++){var p=h.info.validationProperties[f];if("undefined"!==typeof p.source){if(!l(c,p.source,p,h))return!1}else return window.console.log("Invalid validationProperties in "+
a.id+".  No source property specified."),!1}var f=!0,g=b?d.getFilenameContentType(c.Name,b):null,g=g||{id:"application/octet-stream"};h.info.excludedContentTypes&&b&&(f=h.info.excludedContentTypes.every(function(a){a=a.replace(/([*?])/g,".$1");return-1!==g.id.search(a)?!1:!0}));f&&h.info.contentType&&b&&(f=h.info.contentType.some(function(a){a=a.replace(/([*?])/g,".$1");return-1!==g.id.search(a)?!0:!1}));return f}return{info:a,validationFunction:function(a){"function"===typeof h&&(a=h.call(this,a));
if(a){if(Array.isArray(a)){if((this.info.forceSingleItem||this.info.uriTemplate)&&1!==a.length||1>a.length)return!1}else a=[a];for(var c=0;c<a.length;c++)if(!e(a[c],b,this))return!1;return!0}return!1},generatesURI:function(){return!!this.info.uriTemplate},getURI:function(a){if(this.info.uriTemplate){var c={},b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&(c[b]=a[b]);if(this.info.validationProperties)for(b=0;b<this.info.validationProperties.length;b++){var h=this.info.validationProperties[b];
h.source&&h.variableName&&(this.itemCached===a&&this[h.variableName]||l(a,h.source,h,this),a[h.variableName]?window.console.log("Variable name "+h.variableName+" in the extension "+this.info.id+" conflicts with an existing property in the item metadata."):c[h.variableName]=this[h.variableName])}c.OrionHome=q;return(new n(this.info.uriTemplate)).expand(c)}return null}}};var p=l.UnnamedCommand;h._createCommandOptions=function(a,c,f,d,l,e){function g(b,p){var q=h._makeValidator(a,f,d,e);b.visibleWhen=
q.validationFunction.bind(q);if(l)if(q.generatesURI.bind(q)())b.hrefCallback=function(a){a=Array.isArray(a.items)?a.items[0]:a.items;return q.getURI.bind(q)(a)};else{var k=a;b.callback=function(a){var d;if(k.forceSingleItem)a=Array.isArray(a.items)?a.items[0]:a.items,d=h._cloneItemWithoutChildren(a);else if(Array.isArray(a.items)){d=[];for(var l=0;l<a.items.length;l++)d.push(h._cloneItemWithoutChildren(a.items[l]))}else d=h._cloneItemWithoutChildren(a.items);if(f)var e=f.getService("orion.page.progress");
c.run?e?e.progress(c.run(d),"Running command: "+b.name):c.run(d):f&&(e?e.progress(f.getService(c).run(d),"Running command: "+b.name):f.getService(c).run(d))}}p.resolve(b)}var q=new m;if(a.nls){var k=function(c){var b;c?(b=a.tooltipKey&&c[a.tooltipKey],c=a.nameKey&&c[a.nameKey]||a.name||p,b=b||a.tooltip||""):(c=a.name||a.nameKey||p,b=a.tooltip||a.tooltipKey||"");g({name:c,image:a.image,id:a.id||a.name,tooltip:b,isEditor:a.isEditor,showGlobally:a.showGlobally},q)};b.getMessageBundle(a.nls).then(k,k.bind(this,
null))}else g({name:a.name,image:a.image,id:a.id||a.name,tooltip:a.tooltip,isEditor:a.isEditor,showGlobally:a.showGlobally},q);return q};h.getOpenWithCommand=function(a,c,b){var f;a=b||h.getOpenWithCommands(a);for(b=0;b<a.length;b++)if(a[b].visibleWhen(c)){var d="default"===a[b].isEditor;if(!f||d)if(f=a[b],d)break}return f};h.getOpenWithCommands=function(a){var c=[],b;for(b in a._commandList){var h=a._commandList[b];h.isEditor&&c.push(h)}return c};var s;h.createAndPlaceFileCommandsExtension=function(a,
c,b,f,d,e){return h.createFileCommands(a,null,e?"all":void 0,!!e,c).then(function(a){d&&0<a.length&&(c.addCommandGroup(b,"eclipse.openWith",1E3,l.OpenWith,d,null,null,null,"dropdownSelection"),c.addCommandGroup(b,"eclipse.fileCommandExtensions",1E3,l.OpenRelated,d));a.forEach(function(a){var h=null;d&&(h=a.isEditor?d+"/eclipse.openWith":d+"/eclipse.fileCommandExtensions");c.registerCommandContribution(b,a.id,f,h)});return{}})};h.createFileCommands=function(a,c,b,f,d){b=void 0===b?"global":b;f=void 0===
f?!0:f;var l=[];h._cachedFileCommands||h._createCachedFileCommands(a);("all"===b||"global"===b)&&h._cachedFileCommands.forEach(function(a){var c=a.properties;("all"===b||c.forceSingleItem&&c.showGlobally)&&l.push(a)});return m.when(function(){var b=a.getService("orion.core.contentTypeRegistry")||c;return s||m.when(b.getContentTypes(),function(a){return s=a})}(),function(){f&&(h._cachedOpenWithExtensions||(h._cachedOpenWithExtensions=h._getOpenWithNavCommandExtensions(a,s)),l=l.concat(h._cachedOpenWithExtensions),
d._addedOpenWithCommands=f);var c=l.map(function(c){var b=c.properties;c=c.service;var f=d.findCommand(b.id||b.name);return f?(new m).resolve(f):h._createCommandOptions(b,c,a,s,!0).then(function(a){a=new g.Command(a);d.addCommand(a);return a})});return m.all(c,function(a){return{_error:a}}).then(function(a){return a})})};h._createCachedFileCommands=function(a){var b=a.getServiceReferences("orion.navigate.command");h._cachedFileCommands=[];for(var f=0;f<b.length;f++)if("orion.navigateFromMetadata"!==
b[f].getProperty("id")){var d=a.getService(b[f]),l=c(b[f]);h._cachedFileCommands.push({properties:l,service:d})}};h.getFileCommandIds=function(){var a=[];if(h._cachedFileCommands)h._cachedFileCommands.length&&(a=h._cachedFileCommands.map(function(a){return a.properties.id}));else throw"extensionCommandUtils._cachedFileCommands is not initialized";return a};h.createOpenWithCommands=function(a,c,b){return b&&b._addedOpenWithCommands?(new m).resolve(h.getOpenWithCommands(b)):h.createFileCommands(a,c,
"none",!0,b)};return h});
define("orion/breadcrumbs",["require","orion/webui/littlelib"],function(k,m){function g(e){this._init(e)}g.prototype={_init:function(e){var d=m.node(e.container);if(!d)throw"no parent container";this._container=d;d.classList.remove("currentLocation");this._id=e.id||"eclipse.breadcrumbs";this._resource=e.resource||null;this._rootSegmentName=e.rootSegmentName;this._workspaceRootSegmentName=e.workspaceRootSegmentName;this._workspaceRootURL=e.workspaceRootURL;this._makeHref=e.makeHref;this._makeFinalHref=
e.makeFinalHref;this._maxLength=e.maxLength;this.path="";this.measure();this.render()},getNavigatorWorkspaceRootSegment:function(){if(this._workspaceRootSegmentName){var e;if(this._resource&&this._resource.Parents&&!this._resource.skip){e=document.createElement("a");var d=this._workspaceRootURL?this._workspaceRootURL:"";this._makeHref?this._makeHref(e,d):e.href=k.toUrl("edit/edit.html")+"#"+d}else e=document.createElement("span");m.empty(e);e.appendChild(document.createTextNode(this._workspaceRootSegmentName));
return e}return null},MAX_LENGTH:500,INCLUDE_FIRST_SECTION:!0,segments:[],buildSegment:function(e){var d=document.createElement("a");d.classList.add("breadcrumb");d.appendChild(document.createTextNode(e));return d},addSegmentHref:function(e,d){this._makeHref?this._makeHref(e,d.Location,d):e.href=k.toUrl("edit/edit.html")+"#"+d.ChildrenLocation},buildSegments:function(e,d){if(this._resource.Parents){var g=this._resource.Parents.slice(0),b,f;g&&(g=g.slice(0),"reverse"===d&&(g=g.reverse().slice(0)),
g.forEach(function(a){a.skip||(e?(f=e,e=null):f=a.Name,b=this.buildSegment(f),this.path+=a.Name,this.addSegmentHref(b,a),b.include=!1,this.segments.push(b))}.bind(this)))}},addDivider:function(){var e=document.createElement("span");e.appendChild(document.createTextNode(" / "));this.path+="/";e.classList.add("breadcrumbSeparator");this.append(e)},refresh:function(){(this.crumbs=m.node(this._id))?m.empty(this.crumbs):(this.crumbs=document.createElement("span"),this.crumbs.id=this._id,this._container.appendChild(this.crumbs),
this.dirty=document.createElement("span"),this.dirty.id="dirty",this.dirty.className="modifiedFileMarker",this._container.appendChild(this.dirty));this.crumbs.style.width="auto";this.crumbs.style.visibility="visible";this.crumbs.parentNode.className="currentLocation";this.crumbs.parentNode.style.width="auto"},append:function(e){this.crumbs.appendChild(e)},addTitle:function(e,d){var g=d||document.title;0===this.crumbs.childNodes.length&&(e=document.createElement("span"),e.appendChild(document.createTextNode(g)),
e.classList.add("breadcrumb"),e.classList.add("currentLocation"),this.append(e))},finalSegment:function(e,d){if(!this._resource.skip){var g;g=d?d:this._resource.Name;this._makeFinalHref?(e=this.buildSegment(g),this.addSegmentHref(e,this._resource)):(e=document.createElement("span"),e.appendChild(document.createTextNode(g)));e.classList.add("currentLocation");this.path+=this._resource.Name;this.append(e)}},firstSegment:function(e){e&&(this.append(e),this._resource&&this._resource.Parents&&!this._resource.skip?
(e.classList.add("breadcrumb"),this.addDivider()):(this._resource.skip||(e.href=""),e.classList.add("currentLocation")))},drawSegments:function(){this._resource.Parents&&this.segments.slice(0).forEach(function(e){!0===e.include&&(this.append(e),this.addDivider())}.bind(this))},measureSegments:function(){this.INCLUDE_FIRST_SECTION=!0;if(this._resource.Parents){var e=this.segments.slice(0).reverse();e.forEach(function(d){this.append(d);this.addDivider();this.crumbs.offsetWidth<this.MAX_LENGTH?d.include=
!0:this.INCLUDE_FIRST_SECTION=!1}.bind(this));this.segments=e.reverse()}},measure:function(){var e=this._container;e.style.width="auto";this.MAX_LENGTH=this._maxLength?this._maxLength:e.offsetWidth;this.refresh();this.segments=[];this.crumbs.style.visibility="hidden";var e=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;d?this.addTitle(e,d):(this.finalSegment(e,d),this._resource&&this._resource.Parents&&(this.buildSegments(d,"reverse"),this.measureSegments(),this.firstSegment(e)),
this.crumbs.offsetWidth>=this.MAX_LENGTH&&(this.INCLUDE_FIRST_SECTION=!1))},render:function(){this.refresh();var e=this.getNavigatorWorkspaceRootSegment(),d=this._rootSegmentName;d?this.addTitle(e,d):(!0===this.INCLUDE_FIRST_SECTION&&this.firstSegment(e),this._resource&&this._resource.Parents&&(this.drawSegments(),this.finalSegment(e,d)));this.crumbs.parentNode.style.width=this.crumbs.offsetWidth+20+"px"}};g.prototype.constructor=g;return{BreadCrumbs:g}});
define("orion/webui/splitter",["require","orion/EventTarget","orion/webui/littlelib"],function(k,m,g){function e(d){m.attach(this);this._init(d)}e.prototype={_init:function(d){this._tracking=null;this._animationDelay=501;this._closeReversely=d.closeReversely;this.$node=g.node(d.node);if(!this.$node)throw"no dom node for splitter found";this.$sideNode=g.node(d.sidePanel);if(!this.$sideNode)throw"no dom node for side panel found";this.$mainNode=g.node(d.mainPanel);if(!this.$mainNode)throw"no dom node for main panel found";
this._vertical=d.vertical;this._prefix="/orion/splitter/"+(this.$node.id||document.body.id||"");d.toggle&&(this._thumb=document.createElement("div"),this.$node.appendChild(this._thumb),this._thumb.classList.add("splitThumb"),this._thumb.classList.add(this._vertical?"splitVerticalThumbLayout":"splitThumbLayout"));this._closeByDefault="closed"===this.$node.getAttribute("data-initial-state");"undefined"!==typeof d.closeByDefault&&(this._closeByDefault=d.closeByDefault);this._initializeFromStoredSettings();
this._closed?(this._closed=!1,this._thumbDown(!0,!0)):this._adjustToSplitPosition();this.$node.style.visibility="visible";this.$mainNode.style.display="block";this.$sideNode.style.display="block";this.$node.addEventListener("mousedown",this._mouseDown.bind(this),!1);window.addEventListener("mouseup",this._mouseUp.bind(this),!1);window.addEventListener("resize",this._resize.bind(this),!1)},isClosed:function(){return this._closed},toggleSidePanel:function(){this._thumbDown()},openSidePanel:function(){this._closed||
this._thumbDown()},addResizeListener:function(d){this.addEventListener("resize",function(e){d(e.node)})},_initializeFromStoredSettings:function(){var d=localStorage.getItem(this._prefix+"/toggleState");this._closed="string"===typeof d?"closed"===d:this._closeByDefault;var d=g.bounds(this.$node.parentNode),e=g.bounds(this.$node),b;this._vertical?(b=localStorage.getItem(this._prefix+"/yPosition"))?(this._splitTop=parseInt(b,10),this._splitTop>d.top+d.height-e.height&&(this._splitTop=d.top+d.height/
2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitTop=0):(b=localStorage.getItem(this._prefix+"/xPosition"))?(this._splitLeft=parseInt(b,10),this._splitLeft>d.left+d.width-e.width&&(this._splitLeft=d.left+d.width/2)):this._closeByDefault&&(this._initialSplit=this._getSplitPosition(),this._splitLeft=0)},_getSplitPosition:function(){var d=g.bounds(this.$node),e=g.bounds(this.$node.parentNode);return this.vertical?d.top-e.top:d.left-e.left},_adjustToSplitPosition:function(d){var e=
g.bounds(this.$node),b=g.bounds(this.$node.parentNode);if(this._vertical){this._splitHeight=e.height;if(d||!this._splitTop)this._splitTop=e.top,localStorage.setItem(this._prefix+"/yPosition",this._splitTop);d=this._splitTop;"relative"===this.$node.parentNode.style.position&&(d=this._splitTop-b.top);this.$sideNode.style.height=d+"px";this.$sideNode.style.display="block";this.$node.style.top=d+"px"}else{this._splitWidth=e.width;if(d||!this._splitLeft)this._splitLeft=e.left,localStorage.setItem(this._prefix+
"/xPosition",this._splitLeft);d=this._splitLeft;"relative"===this.$node.parentNode.style.position&&(d=this._splitLeft-b.left);this.$sideNode.style.width=d+"px";this.$sideNode.style.display="block";this.$node.style.left=d+"px"}this._resize()},_resize:function(d,e,b){d=d||0;var f=g.bounds(this.$node.parentNode),a=g.bounds(this.$node);this._vertical?(void 0===b&&(b=a.top-f.top),b+=a.height,this.$mainNode.style.top=b+"px"):(void 0===e&&(e=a.left-f.left),e+=a.width,this.$mainNode.style.left=e+"px");var l=
this;window.setTimeout(function(){l._notifyResizeListeners(l.$mainNode);l._notifyResizeListeners(l.$sideNode)},d)},_notifyResizeListeners:function(d){this.dispatchEvent({type:"resize",node:d})},_notifyToggleListeners:function(){this.dispatchEvent({type:"toggle",closed:this._closed})},_thumbDown:function(d,e){d||this._addAnimation();var b=this._splitTop,f=this._splitLeft;if(this._closed)this._closed=!1,!this._splitLeft&&!this._splitTop&&"number"===typeof this._initialSplit&&(b=f=this._initialSplit);
else if(this._closed=!0,this._closeReversely){var a=g.bounds(this.$node.parentNode),l=g.bounds(this.$node);this._vertical?b=a.height-l.height:f=a.width-l.width}else b=f=0;this._vertical?(this.$sideNode.style.height=b+"px",this.$node.style.top=b+"px"):(this.$sideNode.style.width=f+"px",this.$node.style.left=f+"px");this._resize(this._animationDelay,f,b);d||this._removeAnimation();e||localStorage.setItem(this._prefix+"/toggleState",this._closed?"closed":null);var c=this;window.setTimeout(function(){c._notifyToggleListeners()},
this._animationDelay)},_removeAnimation:function(){var d=this;window.setTimeout(function(){d.$sideNode.classList.remove(d._vertical?"sidePanelVerticalLayoutAnimation":"sidePanelLayoutAnimation");d.$mainNode.classList.remove(d._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");d.$node.classList.remove(d._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},this._animationDelay)},_addAnimation:function(){this.$sideNode.classList.add(this._vertical?"sidePanelVerticalLayoutAnimation":
"sidePanelLayoutAnimation");this.$mainNode.classList.add(this._vertical?"mainPanelVerticalLayoutAnimation":"mainPanelLayoutAnimation");this.$node.classList.add(this._vertical?"splitVerticalLayoutAnimation":"splitLayoutAnimation")},_mouseDown:function(d){if(d.target===this._thumb)return g.stop(d),this._thumbDown();this._tracking||(this.$node.classList.add("splitTracking"),this.$mainNode.classList.add("panelTracking"),this.$sideNode.classList.add("panelTracking"),this._tracking=this._mouseMove.bind(this),
window.addEventListener("mousemove",this._tracking),g.setFramesEnabled(!1),g.stop(d))},_mouseMove:function(d){if(this._tracking){var e=g.bounds(this.$node.parentNode);if(this._vertical){this._splitTop=d.clientY;this._splitTop<e.top+5?this._splitTop=e.top+5:this._splitTop>e.top+e.height-5&&(this._splitTop=e.top+e.height-5);var b=this._splitTop,b=this._splitTop-e.top;this.$node.style.top=b+"px"}else this._splitLeft=d.clientX,this._splitLeft<e.left+5?this._splitLeft=e.left+5:this._splitLeft>e.left+e.width-
5&&(this._splitLeft=e.left+e.width-5),b=this._splitLeft-2*e.left,this.$node.style.left=b+"px";this._adjustToSplitPosition(!0);g.stop(d)}},_mouseUp:function(d){this._tracking&&(g.setFramesEnabled(!0),window.removeEventListener("mousemove",this._tracking),this._tracking=null,this.$node.classList.remove("splitTracking"),this.$mainNode.classList.remove("panelTracking"),this.$sideNode.classList.remove("panelTracking"),g.stop(d))}};e.prototype.constructor=e;return{Splitter:e}});
define("orion/keyAssist",["i18n!orion/nls/messages","orion/webui/littlelib","orion/util"],function(k,m,g){function e(d){this.commandRegistry=d.commandRegistry;this.create();this._filterString="";this._providers=[]}e.prototype={addProvider:function(d){this._providers.push(d)},create:function(){var d=this._keyAssistDiv=document.createElement("div");d.id="keyAssist";d.style.display="none";d.classList.add("keyAssistFloat");d.setAttribute("role","menu");var e=this._keyAssistInput=document.createElement("input");
e.classList.add("keyAssistInput");e.type="text";e.placeholder=k["Filter bindings"];d.appendChild(e);var b=this._keyAssistContents=document.createElement("div");b.classList.add("keyAssistContents");if(g.isIOS||g.isAndroid)b.style.overflowY="auto";d.appendChild(b);var f=this._keyAssistTable=document.createElement("table");f.tabIndex=0;f.classList.add("keyAssistList");b.appendChild(f);document.body.appendChild(d);e.addEventListener("keydown",function(a){this._keyDown(a)}.bind(this));f.addEventListener("keydown",
function(a){this._keyDown(a)}.bind(this));e.addEventListener("input",function(a){this.filterChanged()}.bind(this));b.addEventListener(g.isFirefox?"DOMMouseScroll":"mousewheel",function(a){this._scrollWheel(a)}.bind(this));document.addEventListener("keydown",function(a){a.keyCode===m.KEY.ESCAPE&&this.hide()}.bind(this));m.addAutoDismiss([d],function(){this.hide()}.bind(this))},createContents:function(){m.empty(this._keyAssistTable);this._selectedIndex=-1;this._selectedRow=null;for(var d=this._idCount=
this._keyAssistContents.scrollTop=0;d<this._providers.length;d++)this._providers[d].showKeyBindings(this);this.createHeader(k.Global);this.commandRegistry.showKeyBindings(this)},createItem:function(d,e,b){if(this._filterString){var f=this._filterString.toLowerCase(),a;f!==this._filterString?(f=this._filterString,a=function(a){return a}):a=function(a){return a.toLowerCase()};if(-1===a(e).indexOf(f)&&-1===a(d).indexOf(f)&&-1===a(this._lastHeader).indexOf(f))return}var l=this._keyAssistTable.insertRow(-1);
l.id="keyAssist-keyBinding-"+this._idCount++;l.setAttribute("role","menuitem");l._execute=b;l.classList.add("keyAssistItem");l.addEventListener("click",function(a){this._selectedRow=l;this.execute();a.preventDefault()}.bind(this));b=l.insertCell(-1);b.classList.add("keyAssistName");b.appendChild(document.createTextNode(e));b=l.insertCell(-1);b.classList.add("keyAssistAccel");b.appendChild(document.createTextNode(d))},createHeader:function(d){this._lastHeader=d;var e=this._keyAssistTable.insertRow(-1);
e.classList.add("keyAssistSection");var e=e.insertCell(-1),b=document.createElement("h2");b.appendChild(document.createTextNode(d));e.appendChild(b)},execute:function(){window.setTimeout(function(){this.hide();var d=this._selectedRow;this._selectedRow=null;d&&d._execute&&d._execute()}.bind(this),0)},filterChanged:function(){this._timeout&&window.clearTimeout(this._timeout);this._timeout=window.setTimeout(function(){this._timeout=null;var d=this._keyAssistInput.value;this._filterString!==d&&(this._filterString=
d,this.createContents())}.bind(this),100)},hide:function(){if(this.isVisible()){var d=document.activeElement,e=this._keyAssistDiv,d=e===d||0!==(e.compareDocumentPosition(d)&16);e.style.display="none";d&&1!==document.compareDocumentPosition(this._previousActiveElement)&&this._previousActiveElement.focus();this._previousActiveElement=null}},isVisible:function(){return"block"===this._keyAssistDiv.style.display},removeProvider:function(d){d=this._providers.indexOf(d);-1!==d&&this._providers.splice(d,
1)},select:function(d){var e=this._keyAssistTable.querySelectorAll(".keyAssistItem");if(0===e.length)this._selectedIndex=-1;else{var b=this._selectedIndex,b=(b+(d?1:-1))%e.length;0>b&&(b=e.length-1);-1!==this._selectedIndex&&(d=e[this._selectedIndex],d.classList.remove("selected"),this._selectedRow=null);this._selectedIndex=b;if(-1!==this._selectedIndex){this._selectedRow=d=e[this._selectedIndex];d.classList.add("selected");this._keyAssistTable.setAttribute("aria-activedescendant",d.id);this._keyAssistTable.focus();
var e=d.getBoundingClientRect(),f=this._keyAssistContents,a=f.getBoundingClientRect();d.offsetTop<f.scrollTop?0===b?f.scrollTop=0:d.scrollIntoView(!0):e.bottom>a.bottom&&d.scrollIntoView(!1)}}},show:function(){this.isVisible()||(this._previousActiveElement=document.activeElement,this.createContents(),this._keyAssistContents.style.height=Math.floor(0.75*this._keyAssistDiv.parentNode.clientHeight)+"px",this._keyAssistDiv.style.display="block",this._keyAssistInput.value=this._filterString,this._keyAssistInput.focus(),
this._keyAssistInput.select())},_keyDown:function(d){if(40===d.keyCode)this.select(!0);else if(38===d.keyCode)this.select(!1);else if(13===d.keyCode)this.execute();else return;d.preventDefault()},_scrollWheel:function(d){var e=0,e=g.isIE||g.isOpera?-d.wheelDelta:g.isFirefox?40*d.detail:-d.wheelDeltaY,b=this._keyAssistContents,f=b.scrollTop;b.scrollTop+=e;if(f!==b.scrollTop)return d.preventDefault&&d.preventDefault(),!1}};return{KeyAssistPanel:e}});
define("orion/widgets/themes/ThemePreferences",[],function(){function k(k,g){this._preferences=k;this._themeData=g;var e=g.getThemeStorageInfo();this._themeVersion=e.version;var d=k.listenForChangedSettings(e.storage,2,function(e){e.key===d&&this.apply()}.bind(this))}k.prototype={_initialize:function(k,g,e){var d,n;void 0===this._themeVersion||e.get("version")===this._themeVersion?(d=e.get(k.styleset),(n=e.get("selected"))&&(n=JSON.parse(n))):n=d=null;d||(d=g.getStyles(),e.put(k.styleset,JSON.stringify(d)));
if(!n||void 0===n[k.selectedKey])n=n||{},n[k.selectedKey]=k.defaultTheme,e.put("selected",JSON.stringify(n));e.put("version",this._themeVersion)},apply:function(){this.setTheme()},getTheme:function(k){var g=this._themeData,e=g.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(d){this._initialize(e,g,d);var n=JSON.parse(d.get("selected"));d=JSON.parse(d.get(e.styleset));var b;if(d)for(var f=0;f<d.length;f++)if(d[f].name===n[e.selectedKey]){b=d[f];break}k({style:b,styles:d})}.bind(this))},
setTheme:function(k,g){var e=this._themeData,d=e.getThemeStorageInfo();this._preferences.getPreferences(d.storage,2).then(function(n){this._initialize(d,e,n);var b=JSON.parse(n.get("selected"));k||(k=b[d.selectedKey]);b[d.selectedKey]=k;n.put("selected",JSON.stringify(b));g?n.put(d.styleset,JSON.stringify(g)):g=JSON.parse(n.get(d.styleset));for(var f=0;f<g.length;f++)if(g[f].name===b[d.selectedKey]){e.processSettings(g[f]);break}n.put("version",this._themeVersion)}.bind(this))},setFontSize:function(k){var g=
this._themeData,e=g.getThemeStorageInfo();this._preferences.getPreferences(e.storage,2).then(function(d){this._initialize(e,g,d);var n=JSON.parse(d.get("selected")),b=JSON.parse(d.get(e.styleset)),f;if(b)for(var a=0;a<b.length;a++)b[a].fontSize=k,b[a].name===n[e.selectedKey]&&(f=b[a]);d.put(e.styleset,JSON.stringify(b));g.processSettings(f)}.bind(this))}};return{ThemePreferences:k}});
define("orion/settings/nls/root/messages",{"Plugin Description":"Plugin Description",Create:"Create","Loading...":"Loading...","Label:":"Label:",Title:"Title",Plugins:"Plugins","User Profile":"User Profile",Git:"Git","Git Settings":"Git Settings",General:"General",Navigation:"Navigation",Links:"Links","Open in same tab":"Open in same tab","Open in new tab":"Open in new tab",Font:"Font",Family:"Family","Sans Serif":"Sans Serif",Serif:"Serif",Size:"Size","8pt":"8pt","9pt":"9pt","10pt":"10pt","12pt":"12pt",
Color:"Color",Background:"Background",Strings:"Strings","String Types":"String Types",blue:"blue",Weight:"Weight",Normal:"Normal",Bold:"Bold",Comments:"Comments","Comment Types":"Comment Types",green:"green",Keywords:"Keywords","Keyword Types":"Keyword Types",darkred:"darkred",Categories:"Categories",Username:"Username","Full Name":"Full Name","Email Address":"Email Address","Email Confirmed":"Email Confirmed",Account:"Account","Current Password":"Current Password","New Password":"New Password","Verify Password":"Verify Password",
Password:"Password",OpenId:"OpenId",AOL:"AOL",Yahoo:"Yahoo",Google:"Google",Unlink:"Unlink",Link:"Link",Unlinked:"Unlinked",Linked:"Linked","Linked Accounts":"Linked Accounts","Git Email Address":"Git Email Address","Git Username":"Git Username","Git Credentials Storage":"Git Credentials Storage",Update:"Update","Update Profile Settings":"Update Profile Settings","Update Git User Settings":"Update Git User Settings","Update Git Credentials":"Update Git Credentials","User profile data successfully updated.":"User profile data successfully updated.",
"Git user data successfully updated.":"Git user data successfully updated.","Git Credentials successfully updated.":"Git Credentials successfully updated.","Edit Plugin JavaScript":"Edit Plugin JavaScript","Install Plugin":"Install Plugin","Plugin Name:":"Plugin Name:","Author Name:":"Author Name:","Licence:":"Licence:","Description:":"Description:","A plugin for Eclipse Orion":"A plugin for Eclipse Orion","Plugin Link":"Plugin Link",Install:"Install","Install a plugin by specifying its URL":"Install a plugin by specifying its URL",
"Plugin URL:":"Plugin URL:",Disable:"Disable",DisableTooltip:"Disable the plugin",Enable:"Enable",EnableTooltip:"Enable the plugin","Reload all":"Reload all","Reload all installed plugins":"Reload all installed plugins","Create a new Orion Plugin":"Create a new Orion Plugin","Find More Orion Plugins":"Find More Orion Plugins","Get Plugins":"Get Plugins",Reload:"Reload","Reload the plugin":"Reload the plugin",Delete:"Delete","Delete this plugin from the configuration":"Delete this plugin from the configuration",
"Type a plugin url here ...":"Type a plugin url here ...","Installed ":"Installed ","Installing ":"Installing ","Already installed":"Already installed"," plugin":" plugin","Reloaded ":"Reloaded ","Uninstalled ":"Uninstalled ","Are you sure you want to uninstall '":"Are you sure you want to uninstall '",Services:"Services",Value:"Value","JavaScript Object":"JavaScript Object","click here, then check javascript console to drill down":"click here, then check javascript console to drill down",Item:"Item",
"Git Config":"Git Config","Clear Git Credentials":"Clear Git Credentials","Enable Storage":"Enable Storage","Please be aware that your credentials will be stored persistently in the browser.":"Please be aware that your credentials will be stored persistently in the browser.","Do you wish to enable the Key Storage?":"Do you wish to enable the Key Storage?",general:"General",validation:"Validation","Deleted git credentials for ${0}":"Deleted git credentials for ${0}",Editor:"Editor",editorSettings:"Settings",
EditorThemes:"Themes",Import:"Import","Import a theme":"Import a theme",Export:"Export","Export a theme":"Export a theme","Theme name:":"Theme name:",yourTheme:"yourTheme",fileManagement:"File Management",typing:"Typing",autoSave:"Auto Save",autoSaveTimeout:"Save interval (ms)",autoLoad:"Auto Load",saveDiffs:"Save file as diffs",trimTrailingWhiteSpace:"Trim Trailing Whitespace on Save",Restore:"Restore Defaults",Default:"Default",keys:"Keys",tabs:"Tabs",tabSize:"Tab Size",expandTab:"Insert spaces for tabs",
smoothScrolling:"Smooth Scrolling",scrollAnimation:"Scrolling Animation",scrollAnimationTimeout:"Scrolling Duration (ms)",keyBindings:"Key Bindings",rulers:"Rulers",annotationRuler:"Show Annotation Ruler",lineNumberRuler:"Show Line Number Ruler",foldingRuler:"Show Folding Ruler",overviewRuler:"Show Overview Ruler",whitespaces:"White Spaces",wrapping:"Wrapping",wordWrap:"Word Wrap",showMargin:"Show Margin",marginOffset:"Margin Column",showTabs:"Show Tabs",showSpaces:"Show Spaces",autoSaveTimeoutInvalid:"Invalid save interval.",
scrollAnimationTimeoutInvalid:"Invalid scrolling duration.",tabSizeInvalid:"Invalid tab size.",localSettingsTooltip:"Toggle whether this setting is shown in the local editor settings drop down.",editorSettingsInfo:"Use the ${0} and ${1} to toggle whether a given setting is shown in the local editor settings drop down ${2}.",autoPairParentheses:"Autopair (Parentheses)",autoPairBraces:"Autopair {Braces}",autoPairSquareBrackets:"Autopair [Square] Brackets",autoPairAngleBrackets:"Autopair \x3cAngle\x3e Brackets",
autoPairQuotations:'Autopair "Strings"',autoCompleteComments:"Autocomplete /** Block Comments */",smartIndentation:"Smart Indentation",sourceControl:"Source Control",showBlame:"Show Blame",languageTools:"Language Tools",showOccurrences:"Show Occurrences",contentAssistAutoTrigger:"Show Content Assist automatically","Editor preferences updated":"Editor preferences updated","Editor defaults restored":"Editor defaults restored",Theme:"Theme","Font Size":"Font Size","New Theme Name:":"New Theme Name:",
"Font Size:":"Font Size:","UI Theme":"UI Theme","Navigation Bar":"Navigation Bar","Navigation Text":"Navigation Text","Search Box":"Search Box","Tool Panel":"Tool Panel","Selection Bar":"Selection Bar",Location:"Location",Content:"Content","Main Panel":"Main Panel",Button:"Button","Button Text":"Button Text","Section Text":"Section Text","Side Panel":"Side Panel","Line Color":"Line Color","Line Numbers":"Line Numbers",Foreground:"Foreground","Current Line":"Current Line","HTML Attribute":"HTML Attribute",
"Overview Ruler":"Overview Ruler","HTML Tag":"HTML Tag","Annotation Ruler":"Annotation Ruler","Show Guide":"Show Guide","Check Guide":"Check Guide",Cancel:"Cancel","Revert Theme":"Revert Theme","Update Theme":"Update Theme","Theme:":"Theme:",clickDiagram:"Click diagram to style.",clickUpdate:"Click Update button to save preview.","CSS Class Name":"CSS Class Name","CSS Attribute":"CSS Attribute","CSS Value":"CSS Value","CSS Text":"CSS Text","COLOR:":"Color:","NEW COLOR:":"New Color:",Ok:"Ok","OR HEX:":"Or Hex: "});
define("orion/settings/nls/messages",["orion/i18n!orion/settings/nls/messages","orion/settings/nls/root/messages"],function(k,m){var g={root:m};Object.keys(k).forEach(function(e){"undefined"===typeof g[e]&&(g[e]=k[e])});return g});
define("orion/editor/eventTarget",[],function(){function k(){}k.addMixin=function(m){var g=k.prototype,e;for(e in g)g.hasOwnProperty(e)&&(m[e]=g[e])};k.prototype={addEventListener:function(k,g,e){this._eventTypes||(this._eventTypes={});var d=this._eventTypes[k];d||(d=this._eventTypes[k]={level:0,listeners:[]});d.listeners.push({listener:g,useCapture:e})},dispatchEvent:function(k){var g=k.type;this._dispatchEvent("pre"+g,k);this._dispatchEvent(g,k);this._dispatchEvent("post"+g,k)},_dispatchEvent:function(k,
g){var e=this._eventTypes?this._eventTypes[k]:null;if(e){var d=e.listeners;try{if(e.level++,d)for(var n=0,b=d.length;n<b;n++)if(d[n]){var f=d[n].listener;"function"===typeof f?f.call(this,g):f.handleEvent&&"function"===typeof f.handleEvent&&f.handleEvent(g)}}finally{if(e.level--,e.compact&&0===e.level){for(n=d.length-1;0<=n;n--)d[n]||d.splice(n,1);0===d.length&&delete this._eventTypes[k];e.compact=!1}}}},isListening:function(k){return!this._eventTypes?!1:void 0!==this._eventTypes[k]},removeEventListener:function(k,
g,e){if(this._eventTypes){var d=this._eventTypes[k];if(d){for(var n=d.listeners,b=0,f=n.length;b<f;b++){var a=n[b];if(a&&a.listener===g&&a.useCapture===e){0!==d.level?(n[b]=null,d.compact=!0):n.splice(b,1);break}}0===n.length&&delete this._eventTypes[k]}}}};return{EventTarget:k}});
define("orion/editor/textTheme",["require","orion/editor/eventTarget","orion/util"],function(k,m,g){function e(d){d=d||{};this._document=d.document||document}var d={};e.getTheme=function(g){g=g||"default";var b=d[g];b||(b=d[g]=new e);return b};e.prototype={getThemeClass:function(){return this._themeClass},setThemeClass:function(d,b){var f=this,a=f._themeClass;f._themeClass=d;this._load(d,b,function(){f.onThemeChanged({type:"ThemeChanged",oldValue:a,newValue:f.getThemeClass()})})},onThemeChanged:function(d){return this.dispatchEvent(d)},
buildStyleSheet:function(d,b){function f(b,c,h){c&&(a.push("."+d+" ."+b+" {"),a.push("\t"+(h?"background-color":"color")+": "+c+";"),a.push("}"))}var a=[];a.push("");a.push("."+d+" {");b.fontFamily&&a.push("\tfont-family: "+b.fontFamily+";");b.fontSize&&a.push("\tfont-size: "+b.fontSize+";");b.fontSize&&a.push("\tcolor: "+b.text+";");a.push("}");a.push("."+d+".textview {");b.background&&a.push("\tbackground-color: "+b.background+";");a.push("}");f("ruler.annotations",b.annotationRuler,!0);f("ruler.lines",
b.annotationRuler,!0);f("ruler.folding",b.annotationRuler,!0);f("ruler.overview",b.overviewRuler,!0);f("rulerLines",b.lineNumber,!1);f("rulerLines.even",b.lineNumberEven,!1);f("rulerLines.odd",b.lineNumberOdd,!1);f("annotationLine.currentLine",b.currentLine,!0);f("entity-name-tag",b.keyword,!1);f("entity-other-attribute-name",b.attribute,!1);f("string-quoted",b.string,!1);f("meta.annotation.currentLine",b.currentLine,!0);f("keyword",b.keyword,!1);f("string",b.string,!1);f("comment",b.comment,!1);
f("comment.block.documentation",b.comment,!1);f("keyword.other.documentation.markup",b.comment,!1);return a.join("\n")},_createStyle:function(d,b,f,a){var e=this._document;d="orion-theme-"+d;var c=e.getElementById(d);if(c){if(a||c.firstChild.data===b)return;c.removeChild(c.firstChild);c.appendChild(e.createTextNode(b))}else a?(c=g.createElement(e,"link"),c.rel="stylesheet",c.type="text/css",c.href=b,c.addEventListener("load",function(){f()})):(c=g.createElement(e,"style"),c.appendChild(e.createTextNode(b))),
c.id=d,(e.getElementsByTagName("head")[0]||e.documentElement).appendChild(c);a||f()},_load:function(d,b,f){if(d)if("string"===typeof b)this._createStyle(d,b,f);else if(b=b.href,".css"!==b.substring(b.length-4)&&(b+=".css"),/^\//.test(b)||/[a-zA-Z0-9]+:\/\//i.test(b)||!k.toUrl)this._createStyle(d,b,f,!0);else{var a=this;k(["text!"+b],function(b){a._createStyle(d,b,f,!1)})}else f()}};m.EventTarget.addMixin(e.prototype);return{TextTheme:e}});
define("orion/widgets/themes/ThemeClass",[],function(){function k(k){this.attributes=[];this.element=document.createElement("div");this.style=this.element.style;this.className=k;this.classString="."+k+"{ "}k.prototype.className=null;k.prototype.classString=void 0;k.prototype.style=void 0;k.prototype.closeString=" }\n";k.prototype.toString=function(){return this.classString=this.classString+this.style.cssText+this.closeString};return{ThemeClass:k}});
define("orion/widgets/themes/container/ThemeSheetWriter",["orion/widgets/themes/ThemeClass"],function(k){function m(){}m.prototype.navbar="white";m.prototype.button="#777777";m.prototype.location="#EFEFEF";m.prototype.selection="#cedce7";m.prototype.sidepanel="#F7F7F7";m.prototype.mainpanel="white";m.prototype.navtext="#bfbfbf";m.prototype.content="#3087B3";m.prototype.search="#444";m.prototype.toolpanel="white";m.prototype.writeNavigationStyle=function(){var g="",e=[],d=new k.ThemeClass("orionPage");
d.style.backgroundColor="#fdfdfd";d.style.width="100%";d.style.height="100%";e.push(d);d=new k.ThemeClass("topRowBanner");d.style.margin="0";d.style.border="0";d.style.backgroundColor=this.navbar;d.style.height="16px";d.style.padding="10px";d.style.paddingLeft="6px";d.style.paddingRight="2px";d.style.borderBottom="none";d.style.boxShadow="0 2px 2px 0 rgba(0, 0, 0, 0.1),0 1px 0 0 rgba(0, 0, 0, 0.1)";d.style.zIndex="100";e.push(d);d=new k.ThemeClass("a");d.style.textDecoration="none";d.style.color=
this.content;e.push(d);d=new k.ThemeClass("navlink");d.style.display="inline-block";d.style.padding="2px";d.style.color=this.content;d.style.verticalAlign="bottom";e.push(d);d=new k.ThemeClass("primaryNav");d.style.color=this.navtext;d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.paddingTop="0";d.style.verticalAlign="baseline";e.push(d);d=new k.ThemeClass("primaryNav a");d.style.fontSize="8pt";d.style.color=this.navtext;d.style.marginRight="6px";d.style.marginLeft="6px";d.style.verticalAlign=
"baseline";d.style.textDecoration="none";e.push(d);d=new k.ThemeClass("primaryNav a:hover");d.style.color="#bfbfbf";d.style.cursor="hand";d.style.color="white";d.style.fontWeight="normal";e.push(d);for(var m in e)g+=e[m].toString();return g};m.prototype.writeLocationStyle=function(){var g="",e=[],d=new k.ThemeClass("titleArea");d.style.margin="0";d.style.paddingTop="5px";d.style.border="0";d.style.background=this.location;d.style.background="-webkit-gradient(linear, left top, left bottom, color-stop(0%,"+
this.location+"), color-stop(100%,"+this.location+"))";d.style.borderBottom="1px solid "+this.location;d.style.minHeight="20px";e.push(d);d=new k.ThemeClass("breadcrumb");d.style.fontSize="8pt";d.style.textDecoration="none";d.style.color="#f1f1f2;";d.style.paddingTop="2px";e.push(d);d=new k.ThemeClass("a.breadcrumb:hover");d.style.textDecoration="none";d.style.borderBottom="1px dotted";d.style.color="#F58B0F";d.style.cursor="pointer";e.push(d);d=new k.ThemeClass("breadcrumbSeparator");d.style.fontSize=
"8pt";d.style.textDecoration="none";d.style.color=this.separator;d.style.fontWeight="bold";e.push(d);d=new k.ThemeClass("currentLocation");d.style.fontWeight="bold";d.style.fontSize="8pt";d.style.color=this.breadcrumb;d.style.textDecoration="none";d.style.textWrap="normal";d.style.lineHeight="10pt";e.push(d);d=new k.ThemeClass("a.currentLocation:hover");d.style.fontWeight="bold";d.style.fontSize="10pt";d.style.color="#666666";d.style.textDecoration="none";d.style.borderBottom="0";e.push(d);d=new k.ThemeClass("navlinkonpage");
d.style.color=this.content;d.style.verticalAlign="middle";e.push(d);this.bannerProgress&&(d=new k.ThemeClass("topRowBanner .progressPane_running"),d.style.borderColor=this.bannerProgress,e.push(d));for(var m in e)g+=e[m].toString();return g};m.prototype.writeButtonStyle=function(){var g="",e=[],d=new k.ThemeClass("commandButton");d.style.color="#666";d.style.border="1px solid #dedede";d.style.backgroundColor="#ddd";d.style.textAlign="center";d.style.verticalAlign="middle";d.style.cursor="pointer";
d.style.display="inline-block";d.style.padding="4px 6px";d.style.borderRadius="3px";d.style.lineHeight="12px";d.style.fontSize="9pt";d.style.userSelect="none";e.push(d);d=new k.ThemeClass("commandButton:over");d.style.backgroundColor="#e6e6e6";d.style.border="1px solid #808080";e.push(d);d=new k.ThemeClass("commandMenu");d.style.color="#222";d.style.display="inline-block";d.style.verticalAlign="baseline";d.style.margin="0";d.style.fontSize="8pt";d.style.fontWeight="normal";d.style.border="1px solid #dedede";
d.style.backgroundColor="#efefef";d.style.cursor="pointer";d.style.borderRadius="1px";e.push(d);d=new k.ThemeClass("commandMenuItem");d.style.border="0";d.style.padding="0";d.style.margin="0";e.push(d);for(var m in e)g+=e[m].toString();return g};m.prototype.writeMainStyle=function(){var g="",e=[],d=new k.ThemeClass("searchbox");d.style.backgroundImage="url(../images/core_sprites.png)";d.style.backgroundRepeat="no-repeat";d.style.backgroundPosition="4px -297px";d.style.width="12px";d.style.height=
"12px";d.style.backgroundColor=this.search;d.style.border="1px solid "+this.search;d.style.fontSize="11px";d.style.width="15em";d.style.height="16px";d.style.borderRadius="10px";d.style.color="#999";d.style.padding="0";d.style.paddingLeft="20px";d.style.marginLeft="5px";d.style.marginTop="6px !important";d.style.font="7pt Lucida Sans Unicode,Lucida Grande,Verdana,Arial,Helvetica,Myriad,Tahoma,clean,sans-serif !important";e.push(d);d=new k.ThemeClass("searchbox:focus");d.style.color="white";d.style.outline=
"none";e.push(d);d=new k.ThemeClass("checkedRow");d.style.cssText="background-color:"+this.selection+" !important;";e.push(d);d=new k.ThemeClass("navbar-item-selected");d.style.background=this.selection;d.style.color=this.content;e.push(d);d=new k.ThemeClass("auxpane");d.style.border="0";d.style.background=this.sidepanel;e.push(d);d=new k.ThemeClass("mainpane");d.style.background=this.mainpanel;d.style.border=0;e.push(d);d=new k.ThemeClass("mainToolbar");d.style.background=this.toolpanel;e.push(d);
for(var m in e)g+=e[m].toString();return g};m.prototype.render=function(g){console.log(this.writeNavigationStyle());console.log(this.writeLocationStyle());console.log(this.writeMainStyle());console.log(this.writeButtonStyle())};m.prototype.getSheet=function(g){g.navbar.value?(this.navbar=g.navbar.value,this.button=g.button.value,this.location=g.location.value,this.selection=g.selection.value,this.sidepanel=g.sidepanel.value,this.mainpanel=g.mainpanel.value,this.navtext=g.navtext.value,this.search=
g.search.value,this.content=g.content.value,this.toolpanel=g.toolpanel.value,this.bannerProgress=g.bannerProgress.value):(this.navbar=g.navbar,this.button=g.button,this.location=g.location,this.selection=g.selection,this.sidepanel=g.sidepanel,this.mainpanel=g.mainpanel,this.navtext=g.navtext,this.search=g.search,this.content=g.content,this.toolpanel=g.toolpanel,this.bannerProgress=g.bannerProgress);return this.writeNavigationStyle()+this.writeLocationStyle()+this.writeMainStyle()+this.writeButtonStyle()};
return{ThemeSheetWriter:m}});
define("orion/widgets/themes/container/ThemeData",["i18n!orion/settings/nls/messages","orion/editor/textTheme","orion/widgets/themes/container/ThemeSheetWriter"],function(k,m,g){function e(){}function d(){this.styles=[];var b=new e;b.name="Orion";b.navbar="white";b.button="#EFEFEF";b.location="#efefef";b.selection="FEC";b.sidepanel="#FBFBFB";b.mainpanel="white";b.toolpanel="white";b.navtext="#bfbfbf";b.content="#3087B3";b.search="#444";b.breadcrumb="#3087B3";b.separator="#333";b.bannerProgress="whitesmoke";
this.styles.push(b);b=new e;b.name="Orion2014";b.navbar="white";b.button="#EFEFEF";b.location="#EFEFEF";b.selection="FEC";b.sidepanel="#EEEEEE";b.mainpanel="#EEEEEE";b.toolpanel="#EEEEEE";b.navtext="#BFBFBF";b.content="#333333";b.search="#444444";b.breadcrumb="#333333";b.separator="#333333";b.bannerProgress="orange";this.styles.push(b);b=new e;b.name="Green Zone";b.navbar="seagreen";b.button="lavender";b.location="darkseagreen";b.selection="moccasin";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel=
"white";b.navtext="#FBFBFB";b.content="darkgreen";b.search="darkgreen";b.breadcrumb="#3087B3";b.separator="seagreen";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name="Pretty In Pink";b.navbar="plum";b.button="lavender";b.location="pink";b.selection="lavender";b.sidepanel="seashell";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumorchid";b.search="violet";b.breadcrumb="#3087B3";b.separator="plum";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name=
"Blue Monday";b.navbar="cornflowerblue";b.button="lavender";b.location="skyblue";b.selection="lavender";b.sidepanel="aliceblue";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="royalblue";b.search="royalblue";b.breadcrumb="#3087B3";b.separator="cornflowerblue";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name="Vanilla Skies";b.navbar="sandybrown";b.button="lemmonchiffon";b.location="cornsilk";b.selection="lemonchiffon";b.sidepanel="white";b.mainpanel="white";b.toolpanel=
"white";b.navtext="lemonchiffon";b.content="chocolate";b.search="moccasin";b.breadcrumb="#3087B3";b.separator="sandybrown";b.bannerProgress="#F2F2F2";this.styles.push(b);b=new e;b.name="Beetlejuice";b.navbar="indigo";b.button="slateblue";b.location="darkslateblue";b.selection="silver";b.sidepanel="lavender";b.mainpanel="white";b.toolpanel="white";b.navtext="#FBFBFB";b.content="mediumslateblue";b.search="#444";b.breadcrumb="#3087B3";b.separator="indigo";b.bannerProgress="#F2F2F2";this.styles.push(b);
b=new e;b.name="Red";b.navbar="#CD2127";b.button="#777777";b.location="#D85F56";b.selection="lightcoral";b.sidepanel="#EFDAB2";b.mainpanel="#FDFADD";b.toolpanel="#FDFADD";b.navtext="#FBFBFB";b.content="darkred";b.search="#D85F56";b.breadcrumb="darkred";b.separator="#CD2127";b.bannerProgress="#F2F2F2";this.styles.push(b)}function n(){return this.styles}e.prototype.name="Orion";e.prototype.navbar="#404648";e.prototype.button="#EFEFEF";e.prototype.location="#333";e.prototype.breadcrumb="#3087B3";e.prototype.separator=
"#333";e.prototype.selection="FEC";e.prototype.sidepanel="#FBFBFB";e.prototype.mainpanel="white";e.prototype.toolpanel="white";e.prototype.navtext="#bfbfbf";e.prototype.content="#3087B3";e.prototype.search="#444";e.prototype.bannerProgress="white";d.prototype.styles=[];d.prototype.getStyles=n;d.prototype.getThemeStorageInfo=function(){return{storage:"/themes",styleset:"styles",defaultTheme:"Orion2014",selectedKey:"selected",version:"5.0"}};d.prototype.getViewData=function(){var b={top:10,left:10,
width:350,height:350};b.shapes=[{type:"RECTANGLE",name:k["Navigation Bar"],x:10,y:10,width:350,height:32,family:"navbar",fill:"#333",order:1},{type:"TEXT",name:k["Navigation Text"],label:"UserName",x:290,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif"},{type:"ROUNDRECTANGLE",name:k["Search Box"],x:215,y:20,width:70,height:12,family:"search",fill:"#444",order:3},{type:"RECTANGLE",name:k["Tool Panel"],x:150,y:71,width:209,height:30,family:"toolpanel",fill:"white",order:4},{type:"RECTANGLE",
name:k["Selection Bar"],x:155,y:133,width:200,height:20,family:"selection",fill:"#FEC",order:7},{type:"RECTANGLE",name:k.Location,x:10,y:42,width:350,height:29,family:"location",fill:"#efefef",order:8},{type:"TEXT",name:k["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},{type:"TEXT",name:k.Content,label:"Breadcrumb",x:15,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"TEXT",name:k.Content,label:"/",x:78,y:60,family:"content",
fill:"#3087B3",font:"8pt sans-serif",order:9},{type:"TEXT",name:k.Content,label:"Location",x:84,y:60,family:"content",fill:"#3087B3",font:"8pt sans-serif"},{type:"RECTANGLE",name:k["Main Panel"],x:150,y:101,width:209,height:258,family:"mainpanel",fill:"white",order:6},{type:"ROUNDRECTANGLE",name:k.Button,x:155,y:76,width:37,height:20,family:"button",fill:"#EFEFEF",order:11},{type:"TEXT",name:k["Button Text"],label:"Button",x:158,y:90,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"TRIANGLE",
name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:k["Section Text"],label:"Section",x:30,y:94,family:"navbar",fill:"#333",font:"8pt sans-serif"},{type:"LINE",name:k["Line Color"],x1:150,y1:101,x2:360,y2:101,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:k["Line Color"],x1:150,y1:71,x2:150,y2:360,linewidth:2,fill:"#DEDEDE"},{type:"LINE",name:k["Line Color"],
x1:20,y1:100,x2:140,y2:100,linewidth:2,fill:"#DEDEDE"},{type:"RECTANGLE",name:k["Side Panel"],x:10,y:71,width:140,height:289,family:"sidepanel",fill:"#FBFBFB",order:12},{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"},{type:"TEXT",name:k["Navigation Text"],label:"Navigator",x:60,y:30,family:"navtext",fill:"#bfbfbf",font:"8pt sans-serif",order:2},
{type:"TRIANGLE",name:"userMenu",x1:353,y1:24,x2:347,y2:24,x3:350,y3:29,family:"userMenu",fill:"#BFBFBF"},{type:"TRIANGLE",name:"userMenu",x1:20,y1:88,x2:26,y2:88,x3:23,y3:93,family:"userMenu",fill:"#BFBFBF"}];for(var f=0;3>f;f++)b.shapes.push({type:"TEXT",name:k.Content,label:"org.eclipse.orion.content",x:170,y:127+20*f,fill:"#3087B3",family:"content"});for(f=0;3>f;f++)b.shapes.push({type:"TEXT",name:k.Content,label:"Item",x:25,y:115+20*f,fill:"#3087B3",family:"content"});for(f=0;3>f;f++)b.shapes.push({type:"TRIANGLE",
name:"twisty",x1:160,y1:121+20*f,x2:165,y2:124+20*f,x3:160,y3:127+20*f,family:"navbar",fill:"#333"});b.shapes.push({type:"IMAGE",name:"logo",x:15,y:18,source:"../../images/orion-transparent.png",family:"logo"});return b};d.prototype.processSettings=function(b){var f=new g.ThemeSheetWriter;(new m.TextTheme.getTheme("orionTheme")).setThemeClass("orionTheme",f.getSheet(b))};return{ThemeData:d,getStyles:n}});
define("orion/widgets/nls/root/messages",{"no input":"no input","no output":"no output","Choose a Folder":"Choose a Folder",OK:"OK",Profile:"Profile","Sign out":"Sign out","N/A":"N/A","logged in since ":"logged in since ","Sign in":"Sign in","Authentication required!":"Authentication required!","Name:":"Name:","Plug-ins":"Plug-ins"," \x3cNo available services or timed out, check URL and try reloading\x3e":" \x3cNo available services or timed out, check URL and try reloading\x3e",Properties:"Properties",
" (Service Id: ":" (Service Id: ",Services:"Services","SFTP Transfer":"SFTP Transfer","Remote host:":"Remote host:","Port:":"SFTP Port:","Remote path:":"Remote path:","User name:":"User name:","Password:":"Password:","Start Transfer":"Start Transfer","Location:":"Location:","orion.sftpConnections":"orion.sftpConnections","Drag a file here":"Drag a file here","unzip zips":"Unzip *.zip files","or if you prefer":"(or upload a file using the buttons below)",Upload:"Upload","Browse...":"Browse...","Import a file or zip":"Import a file or zip",
"Missing required argument: searchRenderer":"Missing required argument: searchRenderer","Missing required argument: favService":"Missing required argument: favService","Find File Named":"Find File Named","Type the name of a file to open (? \x3d any character, * \x3d any string):":"Type the name of a file to open (? \x3d any character, * \x3d any string):",Search:"Search","FileName FolderName":"FileName FolderName(Optional)","Searching...":"Searching...","Searching for occurrences of":'Searching for occurrences of: "${0}"',
name:"name","orion.widgets.UserMenu":"orion.widgets.UserMenu",test:"test","Sign Out":"Sign Out","Sign Out ":"Sign Out ","\x3c/a\x3e":"\x3c/a\x3e","\x3e":"\x3e","Sign In To ":"Sign In To ","Sign In":"Sign In",Help:"Help","Report a Bug":"Report a Bug","Keyboard Shortcuts":"Keyboard Shortcuts",Settings:"Settings","View profile of ":"View profile of ",Profiles:"Profiles","Information Needed":"Information Needed",Cancel:"Cancel","If the same file exists in both the source and destination:":"If the same file exists in both the source and destination:",
"Cancel the transfer":"Cancel the transfer","Always overwrite destination":"Always overwrite destination","Overwrite if source is newer":"Overwrite if source is newer",New:"New","Building file skeleton...":"Building file skeleton...",Add:"Add","Upload...":"Upload...","For a list of available commands type '${0}'.":"For a list of available commands type '${0}'.","Main Pages":"Main Pages","Related Links":"Related Links"});
define("orion/widgets/nls/messages",["orion/i18n!orion/widgets/nls/messages","orion/widgets/nls/root/messages"],function(k,m){var g={root:m};Object.keys(k).forEach(function(e){"undefined"===typeof g[e]&&(g[e]=k[e])});return g});
define("orion/widgets/userAssistance/UATaskPanel",["orion/webui/littlelib"],function(k){function m(g,e,d){this.elements=d;this.taskPanel=document.createElement("div");this.taskPanel.className="UAContainer";this.taskPanel.innerHTML='\x3cheader class\x3d"UAHeader"\x3eDevelop software from within the cloud\x3c/header\x3e';this.elementNode=document.createElement("div");this.switchesContainer=document.createElement("div");this.switches=document.createElement("span");this.radioButtons=[];this.elementNode.className=
"UAContainer-body";this.taskPanel.appendChild(this.elementNode);this.switchesContainer.className="UAContainer-switch-body";this.switches.className="UAContainer-switches";this.switchesContainer.innerHTML="";this.switchesContainer.appendChild(this.switches);this.taskPanel.appendChild(this.switchesContainer);!0===e?(this.container=document.createElement("div"),this.container.className="UAModal",this.container.appendChild(this.taskPanel),this.backdrop=document.createElement("div"),this.backdrop.className=
"UAModalBackground",document.body.appendChild(this.backdrop),document.body.appendChild(this.container),k.addAutoDismiss([this.container],this.destroy.bind(this))):g.appendChild(this.taskPanel);this.chosenSwitch=this.createSwitch(null,!0);this.chosenSwitch.firstChild.className="chosenCircle";this.initialize();this.elements.forEach(this.createSwitch.bind(this))}m.prototype.elementNode=null;m.prototype.switchesContainer=null;m.prototype.switches=null;m.prototype.radioButtons=null;m.prototype.chosenSwitch=
null;m.prototype.addElement=function(g){var e=document.createElement("span");e.className="UAContainer-icon";e.innerHTML='\x3cspan class\x3d"workingSpan"\x3e\x3cimg src\x3d"'+g.image+'" id\x3d"'+g.label+'ImageNode" alt\x3d"'+g.alt+'" height\x3d"64" width\x3d"64"\x3e\x3c/span\x3e\x3cspan class\x3d"UAIcon-label"\x3e\x3cspan class\x3d"UALabel" id\x3d"'+g.label+'LabelNode" \x3e'+g.label+"\x3c/span\x3e\x3c/span\x3e";e.onmouseover=function(){document.getElementById(g.label+"ImageNode").src=g.secondaryImage;
document.getElementById(g.label+"LabelNode").className="UALabel-live";e.className="UAContainer-icon-live"};e.onmouseout=function(){document.getElementById(g.label+"ImageNode").src=g.image;document.getElementById(g.label+"LabelNode").className="UALabel";e.className="UAContainer-icon"};var d=this;e.onclick=function(){d.showMedia(g)};this.elementNode.appendChild(e)};m.prototype.clearElements=function(){this.elementNode.innerHTML=""};m.prototype.showMedia=function(g){this.clearElements();this.addElement(g);
var e=document.createElement("span");e.className="UAContainer-media";e.innerHTML='\x3cdiv\x3e\x3c/div\x3e\x3cdiv\x3e\x3c/div\x3e\x3cspan class\x3d"mediaSpan"\x3e\x3cimg src\x3d"'+g.media+'" alt\x3d"'+g.alt+'" height\x3d"300" width\x3d"400"\x3e\x3c/span\x3e';this.elementNode.appendChild(e);setTimeout(function(){e.style.opacity=1},100);g=document.getElementById(g.label+"switch");this.chosenSwitch.firstChild.className="circle";this.chosenSwitch=g.parentNode;g.className="chosenCircle"};m.prototype.createSwitch=
function(g){var e;e=g?g.label+"switch":"indexSwitch";var d=document.createElement("span");d.className="workingSpan";d.innerHTML='\x3cdiv class\x3d"circle" id \x3d"'+e+'"\x3e\x3c/div\x3e';var k=this;d.onclick=g?function(){k.showMedia(g)}:function(){k.initialize();k.chosenSwitch.firstChild.className="circle";k.chosenSwitch=d;k.chosenSwitch.firstChild.className="chosenCircle"};this.switches.appendChild(d);return this.radioButtons[this.radioButtons.length]=d};m.prototype.initialize=function(){this.clearElements();
this.elements.forEach(this.addElement.bind(this))};m.prototype.destroy=function(){document.body.removeChild(this.backdrop);document.body.removeChild(this.container)};return m});
define("orion/webui/dialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/uiUtils"],function(k,m,g,e){function d(){}var n=null;d.prototype={DISABLED:"disabled",CONTAINERTEMPLATE:'\x3cdiv class\x3d"dialog" role\x3d"dialog"\x3e\x3cdiv class\x3d"dialogTitle"\x3e\x3cspan id\x3d"title" class\x3d"dialogTitleText layoutLeft"\x3e\x3c/span\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" id\x3d"closeDialog"\x3e\x3c/button\x3e\x3c/div\x3e\x3cdiv id\x3d"dialogContent" class\x3d"dialogContent layoutBlock"\x3e\x3c/div\x3e\x3cdiv id\x3d"buttons" class\x3d"dialogButtons"\x3e\x3c/div\x3e\x3c/div\x3e',_initialize:function(){var b=
document.body;this.$frameParent=b;this.$$modalExclusions=this.$$modalExclusions||[];var f=document.createRange();f.selectNode(b);f=f.createContextualFragment(this.CONTAINERTEMPLATE);b.appendChild(f);this.$frame=b.lastChild;this.title&&g.$("#title",this.$frame).appendChild(document.createTextNode(this.title));this.$close=g.$("#closeDialog",this.$frame);var a=this;this.$close.addEventListener("click",function(b){a.hide()},!1);this.$parent=g.$(".dialogContent",this.$frame);f=document.createRange();f.selectNode(this.$parent);
b=f.createContextualFragment(this.TEMPLATE);this.messages&&g.processTextNodes(b,this.messages);this.$parent.appendChild(b);this.$buttonContainer=g.$(".dialogButtons",this.$frame);this._makeButtons();this.$frame.addEventListener("keydown",function(b){b.keyCode===g.KEY.ESCAPE?a.hide():b.keyCode===g.KEY.ENTER&&"function"===typeof a._defaultCallback&&a._defaultCallback()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent);this.modal&&this._makeModal()},
_makeButtons:function(){if(this.$buttonContainer&&Array.isArray(this.buttons)){var b=this;this.buttons.forEach(function(f){var a=e.createButton(f.text,f.callback);f.id&&(a.id=f.id,b["$"+a.id]=a);f.isDefault&&(b._defaultCallback=f.callback,b._defaultButton=a);b.$buttonContainer.appendChild(a)})}},_makeModal:function(b){var f=this;this.$frame.addEventListener("blur",function(a){f.$lastFocusedElement=a.target},!0);this._modalListener=function(a){var c=!g.contains(f.$frame,a.target);if(c)for(var b=0;b<
f.$$modalExclusions.length;b++)if(g.contains(f.$$modalExclusions[b],a.target)){c=!1;break}c&&(window.setTimeout(function(){(f.$lastFocusedElement||f.$parent).focus()},0),g.stop(a))};this.$frameParent.addEventListener("focus",this._modalListener,!0);this.$frameParent.addEventListener("click",this._modalListener,!0);b=this.$frameParent.childNodes;var a=!1;this._addedBackdrop=[];for(var d=0;d<b.length;d++){for(var c=0;c<this.$$modalExclusions.length;c++)if(g.contains(this.$$modalExclusions[c],b[d])){a=
!0;break}!a&&b[d]!==f.$frame&&b[d].classList&&!b[d].classList.contains("tooltipContainer")&&(c=b[d],c.classList.contains("modalBackdrop")||(c.classList.add("modalBackdrop"),this._addedBackdrop.push(c)))}(b=g.lastTabbable(this.$buttonContainer)||g.lastTabbable(this.$parent))&&b.addEventListener("keydown",function(a){if(a.keyCode===g.KEY.TAB){var c=f._getFirstFocusField();c&&c!==a.target&&c.focus();g.stop(a)}},!1)},_addChildDialog:function(b){this.$$modalExclusions.push(b.$frame||b.$parent)},_inModalExclusion:function(b){return this.$$modalExclusions.some(function(f){return b.$frame===
f||b.$parent===f})},_bindElements:function(b){for(var f=0;f<b.childNodes.length;f++){var a=b.childNodes[f];a.id&&(this["$"+a.id]=a);this._bindElements(a)}},hide:function(b){!b&&n===this&&(n=null);"function"===typeof this._beforeHiding&&this._beforeHiding();this._modalListener&&(this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0));this.$frame.classList.remove("dialogShowing");g.setFramesEnabled(!0);"function"===
typeof this._afterHiding&&this._afterHiding();var f=this;this.keepAlive||window.setTimeout(function(){f.destroy()},0)},show:function(b){if(this.modal)if(n){if(!n._inModalExclusion(this)){this.hide(!0);return}}else n=this;"function"===typeof this._beforeShowing&&this._beforeShowing();g.setFramesEnabled(!1);var f=g.bounds(this.$frame),a=g.bounds(document.documentElement),d;b?(d=g.bounds(b),b=d.top+d.height+4,d=d.left+4,b+f.height>a.height&&(b=Math.max(0,a.height-f.height-4)),d+f.width>a.width&&(d=Math.max(0,
a.width-f.width-4))):(d=Math.max(0,(a.width-f.width)/2),b=Math.max(0,(a.height-f.height)/2));this.$lastFocusedElement=document.activeElement;this.$frame.style.top=b+"px";this.$frame.style.left=d+"px";this.$frame.classList.add("dialogShowing");"function"===typeof this._afterShowing&&this._afterShowing();this.customFocus||this._getFirstFocusField().focus()},_getFirstFocusField:function(){return g.firstTabbable(this.$parent)||this._defaultButton||g.firstTabbable(this.$buttonContainer)||this.$close},
destroy:function(){this.$frame&&(n===this&&(n=null),g.setFramesEnabled(!0),this._addedBackdrop&&0<this._addedBackdrop.length&&this._addedBackdrop.forEach(function(b){b.classList.remove("modalBackdrop")}),this.$frameParent.removeEventListener("focus",this._modalListener,!0),this.$frameParent.removeEventListener("click",this._modalListener,!0),this.$frameParent.removeChild(this.$frame),this.$parent=this.$frame=void 0)}};d.prototype.constructor=d;return{Dialog:d}});
define("orion/widgets/UserMenu","i18n!orion/widgets/nls/messages require orion/webui/littlelib orion/PageLinks orion/widgets/userAssistance/UATaskPanel orion/webui/dialog orion/webui/dropdown".split(" "),function(k,m,g,e,d,n,b){function f(a){this._displaySignOut=!0;this._init(a)}f.prototype={_init:function(a){this._dropdownNode=g.node(a.dropdownNode);if(!this._dropdownNode)throw"no dom node for dropdown found";this._dropdown=a.dropdown;this._serviceRegistry=a.serviceRegistry;this.authenticatedServices=
{};this.unauthenticatedServices={};this._noSeparator=a.noSeparator;this._dropDownItemClass=a.dropDownItemClass;this._keyAssistClass=a.keyAssistClass;void 0!==a.signOut&&(this._displaySignOut=a.signOut)},isSingleService:function(){return 1===this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},hasServices:function(){return 0<this.length(this.unauthenticatedServices)+this.length(this.authenticatedServices)},length:function(a){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;
return b},_makeMenuItem:function(a,f){var c=b.createMenuItem(a).firstElementChild;"string"===typeof this._dropDownItemClass&&""!==this._dropDownItemClass&&c.classList.add(this._dropDownItemClass);c.addEventListener("click",f,!1);c.addEventListener("keydown",function(a){(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)&&f()},!1);return c},_renderAuthenticatedService:function(a,b){var c=this,h=this.authenticatedServices[a].authService;if(h&&h.logout&&this._displaySignOut){var f=this._makeMenuItem(k["Sign Out"],
function(){h.logout().then(function(){c.addUserItem(a,h,c.authenticatedServices[a].label);localStorage.removeItem(a);localStorage.removeItem("lastLogin");for(var b=localStorage.length-1;0<=b;b--){var f=localStorage.key(b);f&&0===f.indexOf("/orion/preferences/user")&&localStorage.removeItem(f)}h.getAuthForm(window.location.href).then(function(a){window.location=a})})});this._dropdownNode.appendChild(f.parentNode)}},renderServices:function(){function a(a){c[a]||(c[a]=f.createDocumentFragment());return c[a]}
var f=document,c=[],h=this._serviceRegistry;e.getPageLinksInfo(h,"orion.page.link.user").then(function(d){this._dropdown?this._dropdown.empty():this._dropdownNode&&g.empty(this._dropdownNode);d.getAllLinks().forEach(function(c){var b,h;if(c.category&&(h=/user\.(\d+)/.exec(c.category)))b=parseInt(h[1],10);if("number"!==typeof b||isNaN(b))b=1;b=a(b);h=f.createElement("li");var d=f.createElement("a");d.role="menuitem";"string"===typeof this._dropDownItemClass?""!==this._dropDownItemClass&&d.classList.add(this._dropDownItemClass):
d.classList.add("dropdownMenuItem");d.href=c.href;d.textContent=c.textContent;h.appendChild(d);b.appendChild(h);d.addEventListener("keydown",function(a){(a.keyCode===g.KEY.ENTER||a.keyCode===g.KEY.SPACE)&&d.click()},!1)}.bind(this));this.keyAssistFunction&&(d=this._makeMenuItem(k["Keyboard Shortcuts"],this.keyAssistFunction),"string"===typeof this._keyAssistClass?""!==this._keyAssistClass&&d.classList.add(this._keyAssistClass):d.classList.add("key-assist-menuitem"),d=d.parentNode,a(0).appendChild(d));
if(d=h.getServiceReferences("orion.page.getstarted")[0])d=d.getProperty("data"),d=this._makeMenuItem("Getting Started",this.getStartedDialog.bind(this,d)).parentNode,a(0).appendChild(d);var e=this;c.sort(function(a,c){return a-c}).forEach(function(a,h){if(h<c.length-1&&!this._noSeparator){var f=b.createSeparator();a.appendChild(f)}e._dropdownNode.appendChild(a)}.bind(this));if(this.isSingleService())for(var s in this.authenticatedServices)this.authenticatedServices.hasOwnProperty(s)&&this._renderAuthenticatedService(s,
0)}.bind(this))},getStartedDialog:function(a){new d(null,!0,a)},setKeyAssist:function(a){this.keyAssistFunction=a;this.renderServices()},addUserItem:function(a,b,c,h){h?(this.unauthenticatedServices[a]&&delete this.unauthenticatedServices[a],this.authenticatedServices[a]={authService:b,label:c,data:h}):(this.authenticatedServices[a]&&delete this.authenticatedServices[a],this.unauthenticatedServices[a]=this.unauthenticatedServices[a]?{authService:b,label:c,pending:this.unauthenticatedServices[a].pending}:
{authService:b,label:c});this.renderServices()}};f.prototype.constructor=f;return{UserMenu:f}});
define("orion/crawler/nls/root/messages",{"Searching file:":"Searching file:","is not supported in this file system":"is not supported in this file system","${0} files found out of ${1}":"${0} files found out of ${1}","The search term on this location will not use indexed files.":"The search term on this location will not use indexed files.","It will take longer time. Do you want to proceed?":"It will take longer time. Do you want to proceed?","Search cancelled by user":"Search cancelled by user",
Cancel:"Cancel"});define("orion/crawler/nls/messages",["orion/i18n!orion/crawler/nls/messages","orion/crawler/nls/root/messages"],function(k,m){var g={root:m};Object.keys(k).forEach(function(e){"undefined"===typeof g[e]&&(g[e]=k[e])});return g});
define("orion/searchUtils","i18n!orion/nls/messages require orion/regex orion/commandRegistry orion/PageUtil orion/URITemplate".split(" "),function(k,m,g,e,d,n){function b(a,b,c){var h="";c&&(h="^");if(h=g.parse("/"+h+a.searchStr+"/"))c=h.pattern,h=h.flags,-1===h.indexOf("i")&&!b.caseSensitive&&(h+="i"),a.regExp={pattern:c,flags:h},a.wildCard=!0}var f={ALL_FILE_TYPE:"*.*",doSearch:function(a,b,c,h){if(a){var d=!0;"*"===c&&(c="");""===c&&(d=h&&h.type!==f.ALL_FILE_TYPE);d&&(""!==c&&f.addRecentSearch(b,
c,h?h.regEx:!1),a=a.createSearchParams(c,!1,!1,h),a=f.generateSearchHref(a),window.location=a)}else window.alert(k["Can't search: no search service is available"])},generateSearchHelper:function(a,d){var c=a.keyword,h=c,e={};a.fileType&&a.fileType!==f.ALL_FILE_TYPE&&""===c&&(h="*."+a.fileType);if(a.regEx)e.searchStr=c,b(e,a,d);else{var g=-1<c.indexOf("*"),k=-1<c.indexOf("?");g&&(c=c.split("*").join(".*"));k&&(c=c.split("?").join("."));!g&&!k&&!a.nameSearch?(e.searchStr=a.caseSensitive?c.split("\\").join(""):
c.split("\\").join("").toLowerCase(),e.wildCard=!1):(e.searchStr=a.caseSensitive?c:c.toLowerCase(),b(e,a,d),e.wildCard=!0)}e.searchStrLength=e.searchStr.length;return{params:a,inFileQuery:e,displayedSearchTerm:h}},convertSearchParams:function(a){void 0!==a.rows&&(a.rows=parseInt(a.rows,10));void 0!==a.start&&(a.start=parseInt(a.start,10));"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());
"string"===typeof a.nameSearch&&(a.nameSearch="true"===a.nameSearch.toLowerCase())},copySearchParams:function(a,b){var c={},h;for(h in a)if(void 0!==a[h]&&null!==a[h]&&(b||"replace"!==h))c[h]=a[h];return c},generateSearchHref:function(a){var b=m.toUrl("search/search.html");a=f.copySearchParams(a,!0);var c=a.resource;a.resource=void 0;return"undefined"!==typeof a.keyword?(new n(b+"#{,resource,params*}")).expand({resource:c,params:a}):(new n(b+"#{,resource}")).expand({resource:c})},generateFindURLBinding:function(a,
b,c,h,f){a={find:b.searchStr,regEx:b.wildCard?!0:void 0,caseSensitive:a.caseSensitive?!0:void 0,replaceWith:"string"===typeof h?h:void 0,atLine:"number"===typeof c?c:void 0};return f?a:","+(new n("{,params*}")).expand({params:a})},convertFindURLBinding:function(a){"string"===typeof a.regEx&&(a.regEx="true"===a.regEx.toLowerCase());"string"===typeof a.caseSensitive&&(a.caseSensitive="true"===a.caseSensitive.toLowerCase());"string"===typeof a.atLine&&(a.atLine=parseInt(a.atLine,10))},replaceRegEx:function(a,
b,c){return a.replace(RegExp(b.pattern,b.flags),c)},replaceStringLiteral:function(a,b,c){b=g.parse("/"+b+"/gim");return f.replaceRegEx(a,b,c)},searchOnelineLiteral:function(a,b,c){var h;h=0;for(var f=!1,d=[];!(h=b.indexOf(a.searchStr,h),0>h);){d.push({startIndex:h,length:a.searchStrLength});f=!0;if(c)break;h+=a.searchStrLength}return f?d:null},findRegExp:function(a,b,c,f){if(!b)return null;c=c||"";c+=(-1===c.indexOf("g")?"g":"")+(-1===c.indexOf("m")?"m":"");var d=null;return(d=RegExp(b,c).exec(a.substring(f)))&&
{startIndex:d.index+f,length:d[0].length}},searchOnelineRegEx:function(a,b,c){for(var h=0,d=!1,e=[];;)if(h=f.findRegExp(b,a.regExp.pattern,a.regExp.flags,h)){e.push(h);d=!0;if(c)break;h=h.startIndex+h.length}else break;return d?e:null},generateNewContents:function(a,b,c,h,d,e){if(h&&b){a||(c.contents=[]);for(var g=0;g<b.length;g++){for(var k=b[g],r=!1,m=!1,n=[],v,E=0,z=0;z<h.children.length;z++)if(h.children[z].lineNumber-1===g){E=z;for(r=0;r<h.children[z].matches.length;r++)!1!==h.children[z+r].checked&&
n.push(r);m=0<n.length;v=h.children[z].matches;r=!0;break}if(r){if(m){n=f.replaceCheckedMatches(k,d,v,n,e);k=n.replacedStr;for(r=0;r<h.children[E].matches.length;r++)h.children[E+r].newMatches=n.newMatches}else for(r=0;r<h.children[E].matches.length;r++)h.children[E+r].newMatches=h.children[E+r].matches;a?c.contents[g]=k:c.contents.push(k)}else a||c.contents.push(k)}}},generateMatchContext:function(a,b,c){var f=[],d=2*a+1,e;b.length<=d?(e=0,a=b.length-1):(e=c-a,0>e?(e=0,a=e+d-1):(a=c+a,a>b.length-
1&&(a=b.length-1,e=a-d+1)));for(d=e;d<=a;d++)f.push({context:b[d],current:d===c});return f},splitFile:function(a){for(var b=0,c=0,f=0,d=0,e=[];;){-1!==b&&b<=f&&(b=a.indexOf("\r",f));-1!==c&&c<=f&&(c=a.indexOf("\n",f));if(-1===c&&-1===b){e.push(a.substring(d));break}var g=1;-1!==b&&-1!==c?b+1===c?(g=2,f=c+1):f=(b<c?b:c)+1:f=-1!==b?b+1:c+1;e.push(a.substring(d,f-g));d=f}return e},searchWithinFile:function(a,b,c,h,d,e){c=f.splitFile(c);d&&(b.contents=c);if(b){b.children=[];for(var g=h=0;g<c.length;g++){var k=
c[g];if(k&&0<k.length){var r=e?k:k.toLowerCase();if(r=a.wildCard?f.searchOnelineRegEx(a,r):f.searchOnelineLiteral(a,r)){var m,n=g+1;if(d)for(var v=0;v<r.length;v++)m=v+1,m={parent:b,checked:b.checked,type:"detail",matches:r,lineNumber:n,matchNumber:m,name:k,location:b.location+"-"+n+"-"+m},b.children.push(m);else m={parent:b,context:f.generateMatchContext(2,c,g),checked:b.checked,type:"detail",matches:r,lineNumber:n,name:k,location:b.location+"-"+n},b.children.push(m);h+=r.length}}}b.totalMatches=
h}},replaceCheckedMatches:function(a,b,c,f,d){for(var e=0,g="",k=[],r=0;r<c.length;r++){e!==c[r].startIndex&&(g+=a.substring(e,c[r].startIndex));c[r].length&&(d=c[r].length);for(var e=!1,m=0;m<f.length;m++)if(f[m]===r){e=!0;break}e?(k.push({startIndex:g.length,length:b.length}),g+=b):(k.push({startIndex:g.length,length:d}),g+=a.substring(c[r].startIndex,c[r].startIndex+d));e=c[r].startIndex+d}e<a.length&&(g+=a.substring(e));return{replacedStr:g,newMatches:k}},fullPathNameByMeta:function(a){var b=
a.length,c="";if(0<b)for(b-=1;-1<b;b--)c=c+(""===c?"":"/")+a[b].Name;return c},path2FolderName:function(a,b,c){return a.substring(0,a.length-b.length-(c?0:1))},_storeRecentSearch:function(a,b,c,f){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("recentSearch",b);c&&window.setTimeout(function(){c.dispatchEvent({type:"inputDataListChanged",deleting:f})}.bind(this),20)})},addRecentSearch:function(a,b,c){"string"===typeof b&&b&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(h){var d;
h=h.get("recentSearch");"string"===typeof h&&(h=JSON.parse(h));if(h){for(d in h)if(h[d].name===b)return;20<=h.length&&h.splice(19,h.length-20+1)}else h=[];h.splice(0,0,{name:b,regEx:c});f._storeRecentSearch(a,h)})},removeRecentSearch:function(a,b,c){"string"===typeof b&&b&&a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(h){var d;h=h.get("recentSearch");"string"===typeof h&&(h=JSON.parse(h));if(h)for(d in h)if(h[d].name===b){h.splice(d,1);f._storeRecentSearch(a,
h,c,!0);break}})},getSearches:function(a,b,c){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a=a.get(b);"string"===typeof a&&(a=JSON.parse(a));a&&c&&c(a)})},getMixedSearches:function(a,b,c,d){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){var e=a.get("recentSearch");"string"===typeof e&&(e=JSON.parse(e));b&&(a=a.get("search"),"string"===typeof a&&(a=JSON.parse(a)),a&&a.forEach(function(a){if(c){var b=f.parseQueryStr(a.query);
e.some(function(a){return b.searchStrTitle===a.name})||e.push({name:b.searchStrTitle,label:a.name})}else e.push({name:null,label:a.name,value:a.query})}));e&&d&&d(e)})},getOpenSearchPref:function(a,b){a.getService("orion.core.preference").getPreferences("/cm/configurations").then(function(a){a=a.get("nav.config");b(a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?!0:!1:!1)})},setOpenSearchPref:function(a,b){a.getService("orion.core.preference").getPreferences("/window/favorites").then(function(a){a.put("openSearchPref",
{openInNewTab:b})})}};return f});
define("orion/crawler/searchCrawler","i18n!orion/crawler/nls/messages require orion/i18nUtil orion/searchUtils orion/contentTypes orion/Deferred".split(" "),function(k,m,g,e,d,n){function b(b,a,d,c){this.registry=b;this.fileClient=a;this.fileLocations=[];this.fileSkeleton=[];this._totalCounter=this._hitCounter=0;this._searchOnName=c&&c.searchOnName;this._buildSkeletonOnly=c&&c.buildSkeletonOnly;this._fetchChildrenCallBack=c&&c.fetchChildrenCallBack;this._searchParams=d;this.searchHelper=this._searchOnName||
this._buildSkeletonOnly?null:e.generateSearchHelper(d);this._location=c&&c.location;this._childrenLocation=c&&c.childrenLocation?c.childrenLocation:this._location;this._reportOnCancel=c&&c.reportOnCancel;this._cancelled=!1;this._statusService=this.registry.getService("orion.page.message");this._progressService=this.registry.getService("orion.page.progress");this._statusService&&this._statusService.setCancelFunction(function(){this._cancelFileContentsSearch()}.bind(this))}b.prototype.search=function(b){var a=
this.registry.getService("orion.core.contentTypeRegistry");this._onSearchComplete=b;this._cancelled=!1;this._deferredArray=[];a.getContentTypes().then(function(a){this.contentTypesCache=a;var c=this;this._visitRecursively(this._childrenLocation).then(function(){(!c._cancelled||c._reportOnCancel)&&c._reportResult();c._cancelled&&c._HandleStatus({name:"Cancel"})}.bind(c),function(a){c._reportResult();c._HandleStatus(a)}.bind(c))}.bind(this))};b.prototype.searchName=function(b,a){b&&(this._searchParams=
b,this.searchHelper=e.generateSearchHelper(b,!0));a&&(this.onSearchNameComplete=a);var d=[];this._cancelled=!1;this._deferredArray=[];this._sort(this.fileSkeleton);if(0<this.fileSkeleton.length){for(var c=0;c<this.fileSkeleton.length;c++){var h=this.fileSkeleton[c].Name.toLowerCase();if(this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,h,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,h,!0))if(d.push(this.fileSkeleton[c]),d.length>=this.searchHelper.params.rows)break}this.onSearchNameComplete({response:{numFound:d.length,
docs:d}})}else this.onSearchNameComplete({response:{numFound:0,docs:[]}})};b.prototype.buildSkeleton=function(b,a){this._buildingSkeleton=!0;var d=this.registry.getService("orion.core.contentTypeRegistry");this._cancelled=!1;this._deferredArray=[];var c=this;b();d.getContentTypes().then(function(b){c.contentTypesCache=b;c._visitRecursively(c._childrenLocation).then(function(){c._buildingSkeleton=!1;a();c.searchHelper&&!c._buildSkeletonOnly&&c.searchName()})})};b.prototype._sort=function(b){b.sort(function(a,
b){var c,f;if("Path asc"===this._searchParams.sort){c=a.Location&&a.Location.toLowerCase();c=e.path2FolderName(c,a.Name&&a.Name.toLowerCase(),!0);f=b.Location&&b.Location.toLowerCase();f=e.path2FolderName(f,b.Name&&b.Name.toLowerCase(),!0);if(c<f)return-1;if(c>f)return 1}return this._sortOnNameSingle(a,b)}.bind(this))};b.prototype._HandleStatus=function(b){this._statusService&&"Cancel"===b.name&&(console.log("Crawling search cancelled. Deferred array length : "+this._deferredArray.length),this._statusService.setProgressResult({Message:k["Search cancelled by user"],
Severity:"Warning"}))};b.prototype._reportResult=function(){this._sort(this.fileLocations);this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}})};b.prototype._sortOnNameSingle=function(b,a){var d=b.Name&&b.Name.toLowerCase(),c=a.Name&&a.Name.toLowerCase();return d<c?-1:d>c?1:0};b.prototype._onFileType=function(b){return this.searchHelper.params.fileType?this.searchHelper.params.fileType===e.ALL_FILE_TYPE?!0:0<=b.extension.indexOf(this.searchHelper.params.fileType):
!0};b.prototype._visitRecursively=function(b){var a=[],e=this;this._fetchChildrenCallBack&&this._fetchChildrenCallBack(b);return(e._progressService?this._progressService.progress(e.fileClient.fetchChildren(b),"Crawling search for children of "+b):e.fileClient.fetchChildren(b)).then(function(c){for(var b=0;b<c.length;b++)if(void 0!==c[b].Directory&&!1===c[b].Directory)if(e._searchOnName)a.push(e._buildSingleSkeleton(c[b]));else if(e._buildSkeletonOnly)a.push(e._buildSingleSkeleton(c[b]));else{if(!e._cancelled){var f=
d.getFilenameContentType(c[b].Name,e.contentTypesCache);if(f&&("text/plain"===f["extends"]||"text/plain"===f.id)&&e._onFileType(f))f=e._sniffSearch(c[b]),a.push(f),e._deferredArray.push(f)}}else if(c[b].Location)if(e._cancelled)break;else f=e._visitRecursively(c[b].ChildrenLocation),a.push(f),e._deferredArray.push(f);return n.all(a)})};b.prototype._hitOnceWithinFile=function(b){b=this._searchParams.caseSensitive?b:b.toLowerCase();return this.searchHelper.inFileQuery.wildCard?e.searchOnelineRegEx(this.searchHelper.inFileQuery,
b,!0):e.searchOnelineLiteral(this.searchHelper.inFileQuery,b,!0)};b.prototype._reportSingleHit=function(b){this._cancelled||(b.LastModified=b.LocalTimeStamp,this.fileLocations.push(b),this._hitCounter++,this._sort(this.fileLocations),this._onSearchComplete({response:{numFound:this.fileLocations.length,docs:this.fileLocations}},!0))};b.prototype._cancelFileContentsSearch=function(){(this._cancelled=!0)&&this._deferredArray.forEach(function(b){b.cancel()})};b.prototype._sniffSearch=function(b){this._totalCounter++;
var a=this;if(!this._cancelled)if(""===this.searchHelper.params.keyword)this._reportSingleHit(b),this._statusService&&this._statusService.setProgressResult({Message:g.formatMessage(k["${0} files found out of ${1}"],this._hitCounter,this._totalCounter)});else return(a._progressService?a._progressService.progress(a.fileClient.read(b.Location),"Reading file "+b.Location):a.fileClient.read(b.Location)).then(function(d){a._hitOnceWithinFile(d)&&a._reportSingleHit(b);a._statusService&&a._statusService.setProgressResult({Message:g.formatMessage(k["${0} files found out of ${1}"],
a._hitCounter,a._totalCounter)},k.Cancel)},function(a){a&&a.message&&"cancel"!==a.message.toLowerCase()&&console.error("Error loading file content: "+a.message)})};b.prototype._buildSingleSkeleton=function(b){this._totalCounter++;this.fileSkeleton.push(b);this.searchHelper&&!this._buildSkeletonOnly&&0===this._totalCounter%100&&this.searchName();b=new n;b.resolve(this._totalCounter);return b};b.prototype.constructor=b;return{SearchCrawler:b}});
define("orion/webui/dialogs/OpenResourceDialog","i18n!orion/widgets/nls/messages orion/crawler/searchCrawler orion/contentTypes require orion/webui/littlelib orion/util orion/webui/dialog".split(" "),function(k,m,g,e,d,n,b){function f(a){this._init(a)}f.prototype=new b.Dialog;f.prototype.TEMPLATE='\x3cdiv role\x3d"search"\x3e\x3cdiv\x3e\x3clabel id\x3d"fileNameMessage" for\x3d"fileName"\x3e${Type the name of a file to open (? \x3d any character, * \x3d any string):}\x3c/label\x3e\x3c/div\x3e\x3cdiv\x3e\x3cinput id\x3d"fileName" type\x3d"text" class\x3d"setting-control" style\x3d"width:90%;"/\x3e\x3c/div\x3e\x3cdiv id\x3d"progress" style\x3d"padding: 2px 0 0; width: 100%;"\x3e\x3cimg src\x3d"'+
e.toUrl("../../../images/progress_running.gif")+'" class\x3d"progressPane_running_dialog" id\x3d"crawlingProgress"\x3e\x3c/img\x3e\x3c/div\x3e\x3cdiv id\x3d"results" style\x3d"max-height:250px; height:auto; overflow-y:auto;" aria-live\x3d"off"\x3e\x3c/div\x3e\x3cdiv id\x3d"statusbar"\x3e\x3c/div\x3e\x3c/div\x3e';f.prototype._init=function(a){this.title=a.title||k["Find File Named"];this.modal=!0;this.messages=k;this._searcher=a.searcher;this._progress=a.progress;this._onHide=a.onHide;this._contentTypeService=
new g.ContentTypeRegistry(this._searcher.registry);if(!this._searcher)throw Error("Missing required argument: searcher");this._searchDelay=a.searchDelay||500;this._time=0;this._searcher.setCrawler(null);this._forceUseCrawler=!1;this._initialText=a.initialText;this._message=a.message;this._nameSearch=!0;void 0!==a.nameSearch&&(this._nameSearch=a.nameSearch);this._searchOnRoot=!0;this._fileService=this._searcher.getFileService();if(!this._fileService)throw Error(k["Missing required argument: fileService"]);
this._searchRenderer=a.searchRenderer;if(!this._searchRenderer||"function"!==typeof this._searchRenderer.makeRenderFunction)throw Error(k["Missing required argument: searchRenderer"]);this._initialize()};f.prototype._bindToDom=function(a){var b=this;b.$crawlingProgress.style.display="none";this._nameSearch?this.$fileName.setAttribute("placeholder",k["FileName FolderName"]):this.$fileName.setAttribute("placeholder",k.Search);this.$fileName.addEventListener("input",function(a){b._time=+new Date;b._timeoutId&&
clearTimeout(b._timeoutId);b._timeoutId=setTimeout(b.checkSearch.bind(b),0)},!1);this.$fileName.addEventListener("keydown",function(a){if(a.keyCode===d.KEY.ENTER){var f=d.$("a",b.$results);f&&(d.stop(a),(n.isMac?a.metaKey:a.ctrlKey)?window.open(f.href):(window.location.href=f.href,b.hide()))}},!1);a.addEventListener("keydown",function(a){var f,e,g;if(a.keyCode===d.KEY.DOWN||a.keyCode===d.KEY.UP)f=d.$$array("a",b.$results),e=document.activeElement,g=f.indexOf(e),a.keyCode===d.KEY.DOWN?0<=g?(e.classList.remove("treeIterationCursor"),
f=g<f.length-1?f[g+1]:f[0],f.focus(),f.classList.add("treeIterationCursor")):0<f.length&&(f=f[0],f.focus(),f.classList.add("treeIterationCursor")):0<=g?(e.classList.remove("treeIterationCursor"),e=b.$fileName,f=0<g?f[g-1]:e,f.focus(),0<g&&f.classList.add("treeIterationCursor")):0<f.length&&(f[f.length-1].focus(),f[f.length-1].classList.add("treeIterationCursor")),d.stop(a)});a.addEventListener("mouseup",function(a){a.target.focus()},!1);setTimeout(function(){if(b._forceUseCrawler||!b._fileService.getService(b._searcher.getSearchLocation()).search){var a=
b._searchOnRoot?b._searcher.getSearchRootLocation():b._searcher.getChildrenLocation(),a=new m.SearchCrawler(b._searcher.registry,b._fileService,"",{searchOnName:!0,location:a});b._searcher.setCrawler(a);a.buildSkeleton(function(){b.$crawlingProgress.style.display="inline";b.$progress.appendChild(document.createTextNode(k["Building file skeleton..."]))},function(){b.$crawlingProgress.style.display="none";b.$progress.removeChild(b.$progress.lastChild)})}},0);this._message&&(this.$fileNameMessage.removeChild(this.$fileNameMessage.firstChild),
this.$fileNameMessage.appendChild(document.createTextNode(this._message)));this._initialText&&(this.$fileName.value=this._initialText,this.doSearch())};f.prototype.checkSearch=function(){clearTimeout(this._timeoutId);var a=(new Date).getTime();a-this._time>this._searchDelay?(this._time=a,this.doSearch()):this._timeoutId=setTimeout(this.checkSearch.bind(this),50)};f.prototype._detectFolderKeyword=function(a){var b,c=a,f=null;if(this._nameSearch&&(b=/(\S+)\s*(.*)/,(a=b.exec(a))&&3===a.length))a[1]&&
(c=a[1]),a[2]&&(f=a[2]);return{keyword:c,folderKeyword:f}};f.prototype.doSearch=function(){var a=this.$fileName.value;if(a){var b=this._detectFolderKeyword(a),c=this._searcher.createSearchParams(b.keyword,this._nameSearch,this._searchOnRoot),f=this._searchRenderer.makeRenderFunction(this._contentTypeService,this.$results,!1,this.decorateResult.bind(this));this.currentSearch=f;var e=document.createElement("div");e.appendChild(document.createTextNode(this._nameSearch?k["Searching..."]:n.formatMessage(k["Searching for occurrences of"],
a)));d.empty(this.$results);this.$results.appendChild(e);this._searcher.search(c,b.folderKeyword,function(){f===this.currentSearch&&f.apply(null,arguments)}.bind(this))}};f.prototype.decorateResult=function(a){function b(a){0===a.button&&!a.ctrlKey&&!a.metaKey&&c.hide()}var c=this;a=d.$$array("a",a);for(var f=0;f<a.length;f++)a[f].addEventListener("click",b,!1)};f.prototype._beforeHiding=function(){clearTimeout(this._timeoutId)};f.prototype._afterHiding=function(){this._onHide&&this._onHide()};f.prototype.constructor=
f;return{OpenResourceDialog:f}});define("text!orion/banner/banner.html",[],function(){return'\x3cheader id\x3d"banner" role\x3d"banner"\x3e\n\t\x3c!-- Requires some js code to bind the home link, link to progress image, and binding NLS variables  --\x3e\n\n\t\x3cdiv id\x3d"staticBanner" class\x3d"layoutBlock topRowBanner"\x3e \x3c!-- primaryNav --\x3e\n\t\t\x3cdiv id\x3d"centralNavigationArea" style\x3d"position:absolute;left:0;top:0;width:39px;height:36px; z-index:1;border-right:1px solid #ddd;"\x3e\x3c/div\x3e\n\n\t\t\x3c!-- Static "Home" link. TODO delete this --\x3e\n\t\t\x3ca id\x3d"home" class\x3d"layoutLeft "\x3e\x3c/a\x3e\n\n\t\t\x3c!-- Left banner component: hamburger --\x3e\n\t\t\x3cnav id\x3d"primaryNav" class\x3d"bannerLeftArea" style\x3d"z-index:2;" role\x3d"navigation"\x3e\n\t\t\t\t\x3cbutton class\x3d"centralNavigation commandSprite core-sprite-hamburger" type\x3d"button"id\x3d"centralNavigation"\x3e\x3c/button\x3e\n\t\t\x3c/nav\x3e\n\n\t\t\x3c!-- Middle banner component: Breadcrumb bar --\x3e\n\t\t\x3cdiv class\x3d"clear navigationBreadcrumb bannerMiddleArea" \x3e\n\t\t\t\x3cdiv id\x3d"location" class\x3d"currentLocation"\x3e\x3c/div\x3e\n\t\t\x3c/div\x3e\n\n\t\t\x3c!-- Right banner component: user identity --\x3e\n\t\t\x3cdiv class\x3d"bannerRightArea" style\x3d"z-index:2;"\x3e\n\t\t\t\x3c!-- Global commands support. --\x3e\n\t\t\t\x3cdiv id\x3d"globalActions" class\x3d"spacingLeft layoutLeft"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- Search. TODO delete this --\x3e\n\t\t\t\x3cinput type\x3d"text" id\x3d"search" autocomplete\x3d"off" class\x3d"layoutLeft spacingLeft searchbox" role\x3d"search" style\x3d"display:none;"\x3e\n\t\t\t\x3cdiv id\x3d"searchOptions" class\x3d"layoutLeft" style\x3d"padding-top:1px;display:none;"\x3e\x3c/div\x3e\n\n\t\t\t\x3c!-- User identity menu and Progress --\x3e\n\t\t\t\x3cdiv id\x3d"userMenu" class\x3d"spacingRight layoutRight" style\x3d"color:#ccc;line-height:16px;"\x3e\n\t\t\t\t\x3cdiv id\x3d"progressPane" class\x3d"progressWatch" tabindex\x3d"0" role\x3d"progressbar"\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchButton" class\x3d"watchButton"\x3e\x3c/div\x3e\n\t\t\t\t\t\x3cdiv id\x3d"watchBody" class\x3d"watchBody"\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longMinute"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hand longHour"\x3e\n\t\t\t\t\t\t\t\x3cspan class\x3d"darkSide"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\t\n\t\t\t\t\x3cdiv style\x3d"position: absolute;right: 0px;top:0;width: 39px;height:36px; z-index:-50;border-left: 1px solid #ddd;"\x3e\x3c/div\x3e\n\t\t\t\t\x3cspan id\x3d"userTrigger" tabindex\x3d"0" role\x3d"button" class\x3d"dropdownTrigger" style\x3d"z-index:2;"\x3e\n\t\t\t\t\x3c/span\x3e\n\t\t\t\t\x3cul id\x3d"userDropdown" class\x3d"dropdownMenu" role\x3d"menu"\x3e\x3c/ul\x3e\n\t\t\t\x3c/div\x3e\n\t\t\x3c/div\x3e\n\t\x3c/div\x3e\n\n\t\x3c!-- IDE notification messages go in here --\x3e\n\t\x3cdiv id\x3d"notificationArea" class\x3d"notificationHide"\x3e\n\t\t\x3cdiv class\x3d"layoutLeft" id\x3d"notifications" aria-live\x3d"assertive" aria-atomic\x3d"true"\x3e\x3c/div\x3e\n\t\t\x3cdiv class\x3d"layoutRight"\x3e\x3cbutton aria-label\x3d"Close" class\x3d"dismissButton layoutRight core-sprite-close imageSprite" type\x3d"button" id\x3d"closeNotifications"\x3e\x3c/span\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\x3c/header\x3e'});
define("text!orion/banner/footer.html",[],function(){return'\x3c!--\n\x3cfooter id\x3d"footerContent" class\x3d"layoutBlock footerLayout" role\x3d"contentinfo"\x3e\n\t\x3cdiv class\x3d"logoFooter commandSprite core-sprite-orion-logo"\x3e\x3c/div\x3e\n\t\x3cdiv class\x3d"footerBlock"\x3e${Orion is in Beta. Please try it out but BEWARE your data may be lost.}\x3c/div\x3e\n\t\x3cdiv class\x3d"footerRightBlock"\x3e\n\t\t\x3cul\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"https://bugs.eclipse.org/bugs/enter_bug.cgi?product\x3dOrion\x26version\x3d5.0" target\x3d"_blank"\x3e${Report a Bug}\x3c/a\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/privacy.php" target\x3d"_blank"\x3e${Privacy Policy}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/termsofuse.php" target\x3d"_blank"\x3e${Terms of Use}\x3c/a\x3e\x3c/li\x3e\n\t\t\t\x3cli\x3e\x3ca href\x3d"http://www.eclipse.org/legal/copyright.php" target\x3d"_blank"\x3e${Copyright Agent}\x3c/a\x3e\x3c/li\x3e\n\t\t\x3c/ul\x3e\n\t\x3c/div\x3e\n\x3c/footer\x3e\n--\x3e'});
define("text!orion/banner/toolbar.html",[],function(){return'\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"pageActions"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"selectionTools"\x3e\x3c/ul\x3e\n\x3cul class\x3d"layoutLeft commandList pageActions" id\x3d"navActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutLeft" style\x3d"padding-left:7px;padding-right:7px;margin-top:2px;" id\x3d"filterBox" style\x3d"visibility: hidden;"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"settingsActions"\x3e\x3c/ul\x3e\n\x3cdiv class\x3d"layoutRight status" id\x3d"statusPane" role\x3d"status" aria-live\x3d"off"\x3e\x3c/div\x3e\n\x3cul class\x3d"layoutRight commandList pageActions" id\x3d"pageNavigationActions"\x3e\x3c/ul\x3e'});
define("orion/widgets/input/DropDownMenu",["orion/objects","orion/webui/littlelib"],function(k,m){function g(e,d,g){if(e=m.node(e))this._parent=e;else throw Error("Parent node of dropdown menu not found");this.options=g=g||{};this.navDropDownId=this._parent.id+"_navdropdown";this.selectionClass=g.selectionClass;e=document.createElement("div");e.classList.add("dropdownMenu");e.classList.add("dropdownMenuOpen");e.id=this.navDropDownId;e.style.display="none";this._parent.appendChild(e);this._dropdownMenu=
e;if(d=m.node(d))this._triggerNode=d;else throw"Trigger node of dropdown menu not found";"hidden"===this._triggerNode.style.visibility&&(this._triggerNode.style.visibility="visible");g.noClick||(this._triggerNode.onclick=this.click.bind(this));this._dropdownMenu.addEventListener("keydown",function(b){b.keyCode===m.KEY.ESCAPE&&this.clearPanel()}.bind(this))}k.mixin(g.prototype,{click:function(){"none"===this._dropdownMenu.style.display?this.updateContent(this.getContentNode(),function(){m.setFramesEnabled(!1);
this._dropdownMenu.style.display="";this._positionDropdown();this.selectionClass&&this._triggerNode.classList.add(this.selectionClass);this.handle=m.addAutoDismiss([this._triggerNode,this._dropdownMenu],this.clearPanel.bind(this));if(this.options.onShow)this.options.onShow()}.bind(this)):this.clearPanel()},clearPanel:function(){if(this.isVisible()&&(this._dropdownMenu.style.display="none",m.setFramesEnabled(!0),this.selectionClass&&this._triggerNode.classList.remove(this.selectionClass),this.options.onHide))this.options.onHide()},
addContent:function(e){this._dropdownMenu.innerHTML=e},getContentNode:function(){return this._dropdownMenu},updateContent:function(e,d){d()},_positionDropdown:function(){this._dropdownMenu.style.right="";var e=m.bounds(this._dropdownMenu),d=m.bounds(document.body);e.left+e.width>d.left+d.width&&(e=m.bounds(this._boundingNode(this._triggerNode)),d=m.bounds(this._triggerNode),this._dropdownMenu.style.right=e.width-(d.left-e.left+d.width)+"px")},_boundingNode:function(e){var d=window.getComputedStyle(e,
null);return null===d||"absolute"===d.getPropertyValue("position")||!e.parentNode||e===document.body?e:this._boundingNode(e.parentNode)},isDestroyed:function(){return!this._dropdownMenu.parentNode},isVisible:function(){return"none"!==this._dropdownMenu.style.display&&!this.isDestroyed()},focus:function(){this._dropdownMenu.focus()},destroy:function(){this._parent&&(m.setFramesEnabled(!0),m.empty(this._parent),this._parent=this.select=null)}});return g});define("orion/customGlobalCommands",[],function(){return{}});
define("orion/navigate/nls/root/messages",{"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.":"Click one of the tasks below to create an Orion folder.  You can upload, import, or generate files.","Toggle Left Pane":"Toggle Left Pane","Open or close the left pane":"Open or close the left pane",Navigator:"Navigator","Strings Xtrnalizr":"Strings Xtrnalizr","Externalize Strings from JavaScript files in this folder":"Externalize strings from JavaScript files in this folder.",
"Choose a Folder":"Choose a Folder","Copy of ${0}":"Copy of ${0}","Enter a new name for '${0}'":"Enter a new name for '${0}'","Choose folder...":"Choose folder...",Rename:"Rename","Rename the selected files or folders":"Rename the selected files or folders","Compare with each other":"Compare with each other","Compare the selected 2 files with each other":"Compare the selected 2 files with each other","Compare with...":"Compare with...","Compare the selected folder with a specified folder":"Compare the selected folder with a specified folder",
Delete:"Delete","Unknown item":"Unknown item","Are you sure you want to delete these ${0} items?":"Are you sure you want to delete these ${0} items?","Are you sure you want to delete '${0}'?":"Are you sure you want to delete '${0}'?","Export as zip":"Zip","Create a zip file of the folder contents and download it":"Create a zip file of the folder contents and download it","New File":"File","Create a new file":"Create a new file","Name:":"Name:","New Folder":"Folder","Folder name:":"Folder name:","Create a new folder":"Create a new folder",
"Creating folder":"Creating folder",Folder:"Folder","Create an empty folder":"Create an empty folder","Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.":"Create an empty folder on the Orion server.  You can import, upload, or create content in the editor.","Sample HTML5 Site":"Sample HTML5 Site","Generate a sample":"Generate a sample",'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.':'Generate an HTML5 "Hello World" website, including JavaScript, HTML, and CSS files.',
"Creating a folder for ${0}":"Creating a folder for ${0}","SFTP Import":"SFTP Import","Import content from SFTP":"Import content from SFTP","Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.":"Import content from an SFTP location into an Orion folder.  You will be prompted for the SFTP location and credentials.","Imported Content":"Imported Content","Upload a Zip":"Upload a Zip","Upload content from a local zip file":"Upload content from a local zip file",
"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.":"Upload content from a local zip file into an Orion folder.  You will be prompted for the local zip file.","Uploaded Content":"Uploaded Content","Creating an upload folder for ":"Creating an upload folder for ","Clone Git Repository":"Clone Git Repository","Clone a git repository":"Clone a git repository","Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.":"Go to the Orion repositories page to provide a git repository URL.  Once the repository is created, it will appear in the Navigator.",
"Link to Server":"Link to Server","Link to existing content on the server":"Link to existing content on the server","Create a folder that links to an existing folder on the server.":"Create a folder that links to an existing folder on the server.","Server path:":"Server path:","The name and server location were not specified.":"The name and server location were not specified.","Go Up":"Go Up","Move up to the parent folder":"Move up to the parent folder","Go Into":"Go Into","Move into the selected folder":"Move into the selected folder",
"Import local file...":"File System","Copy files and folders from your local file system":"Copy files and folders from your local file system","SFTP from...":"SFTP","Copy files and folders from a specified SFTP connection":"Copy files and folders from a specified SFTP connection","Importing from ${0}":"Importing from ${0}","SFTP to...":"SFTP","Copy files and folders to a specified SFTP location":"Copy files and folders to a specified SFTP location",Exporting:"Exporting to ${0}","Pasting ${0}":"Pasting ${0}",
"Copy to":"Copy to","Move to":"Move to","Copying ${0}":"Copying ${0}","Moving ${0}":"Moving ${0}","Renaming ${0}":"Renaming ${0}","Deleting ${0}":"Deleting ${0}","Creating ${0}":"Creating ${0}","Linking to ${0}":"Linking to ${0}","Move files and folders to a new location":"Move files and folders to a new location",Cut:"Cut",Copy:"Copy","Fetching children of ":"Fetching children of ",Paste:"Paste","Cannot paste into the Workspace root":"Cannot paste into the Workspace root","Open With":"Open With",
"Loading ":"Loading ",New:"New",File:"File",Actions:"Actions","Orion Content":"Orion Content"," is not supported in this file system":" is not supported in this file system","Create new content":"Create new content","Import from HTTP...":"HTTP","File URL:":"File URL:","Copy a file from a URL and optionally unzip it":"Copy a file from a URL and optionally unzip it","Unzip *.zip files:":"Unzip *.zip files:","Extracted from:":"Extracted from:","Did not drop ${0}.  Folder drop is not supported in this browser.":"Did not drop ${0}.  Folder drop is not supported in this browser.",
"You cannot copy files directly into the workspace.  Create a folder first.":"You cannot copy files directly into the workspace.  Create a folder first.","Unzip ${0}?":"Unzip ${0}?",NoFile:"Use the ${0} menu to create new files and folders. Click a file to start coding."});define("orion/navigate/nls/messages",["orion/i18n!orion/navigate/nls/messages","orion/navigate/nls/root/messages"],function(k,m){var g={root:m};Object.keys(k).forEach(function(e){"undefined"===typeof g[e]&&(g[e]=k[e])});return g});
define("orion/fileClient",["i18n!orion/navigate/nls/messages","orion/Deferred","orion/i18nUtil"],function(k,m,g){function e(b,f,a){if(!b[f])throw f+k[" is not supported in this file system"];return b[f].apply(b,a)}function d(b,f,a,l){if(!b.readBlob)throw k["source file service does not support binary read"];if(!a.writeBlob)throw k["target file service does not support binary write"];if("/"!==f[f.length-1])return e(b,"readBlob",[f]).then(function(c){return e(a,"writeBlob",[l,c])});var c=l.substring(0,
l.length-1),h=decodeURIComponent(c.substring(c.lastIndexOf("/")+1)),c=c.substring(0,c.lastIndexOf("/")+1);return e(a,"createFolder",[c,h]).then(function(){},function(){}).then(function(){return e(b,"fetchChildren",[f]).then(function(c){for(var f=[],h=0;h<c.length;++h){var e=c[h].Location,g=e;c[h].Directory&&(g=e.substring(0,e.length-1));g=decodeURIComponent(g.substring(g.lastIndexOf("/")+1));g=l+encodeURIComponent(g);c[h].Directory&&(g+="/");f[h]=d(b,e,a,g)}return m.all(f)})})}function n(b,f){function a(a){var c=
new m;c.reject(k["No Matching FileService for location:"]+a);return c}var d=b.getServiceReferences("orion.core.file"),c=d;if(f)for(var c=[],h=0;h<d.length;++h)f(d[h])&&c.push(d[h]);for(var e=[],p=[],s=[],n=[],r={fetchChildren:function(){var a=new m;a.resolve(n);return a},createWorkspace:function(){var a=new m;a.reject(k["no file service"]);return a},loadWorkspaces:function(){var a=new m;a.reject(k["no file service"]);return a},loadWorkspace:function(a){var c=new m;window.setTimeout(function(){c.resolve({Directory:!0,
Length:0,LocalTimeStamp:0,Name:k["File Servers"],Location:"/",Children:n,ChildrenLocation:"/"})},100);return c},search:a,createProject:a,createFolder:a,createFile:a,deleteFile:a,moveFile:a,copyFile:a,read:a,write:a},d=0;d<c.length;++d)n[d]={Directory:!0,Length:0,LocalTimeStamp:0,Location:c[d].getProperty("top"),ChildrenLocation:c[d].getProperty("top"),Name:c[d].getProperty("Name")},h=c[d].getProperty("pattern")||c[d].getProperty("top").replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"^"!==h[0]&&(h=
"^"+h),e[d]=RegExp(h),p[d]=b.getService(c[d]),s[d]=c[d].getProperty("Name"),c[d].getProperty("NameKey")&&c[d].getProperty("nls")&&g.getMessageBundle(c[d].getProperty("nls")).then(function(a,b){n[a].Name=b[c[a].getProperty("NameKey")];s[a]=b[c[a].getProperty("NameKey")]}.bind(this,d));this._getServiceIndex=function(a){if("/"===a)return-1;if(!a||a.length&&0===a.length)return p[0]?0:-1;for(var c=0;c<e.length;++c)if(e[c].test(a))return c;throw k["No Matching FileService for location:"]+a;};this._getService=
function(a){a=this._getServiceIndex(a);return-1===a?r:p[a]};this._getServiceName=function(a){a=this._getServiceIndex(a);return-1===a?r.Name:s[a]};this._getServiceRootURL=function(a){a=this._getServiceIndex(a);return-1===a?r.Location:n[a].Location}}n.prototype={getService:function(b){return this._getService(b)},fileServiceName:function(b){return this._getServiceName(b)},fileServiceRootURL:function(b){return this._getServiceRootURL(b)},fetchChildren:function(b){return e(this._getService(b),"fetchChildren",
arguments)},createWorkspace:function(b){return e(this._getService(),"createWorkspace",arguments)},loadWorkspaces:function(){return e(this._getService(),"loadWorkspaces",arguments)},loadWorkspace:function(b){return e(this._getService(b),"loadWorkspace",arguments)},createProject:function(b,f,a,d){return e(this._getService(b),"createProject",arguments)},createFolder:function(b,f){return e(this._getService(b),"createFolder",arguments)},createFile:function(b,f){return e(this._getService(b),"createFile",
arguments)},deleteFile:function(b){return e(this._getService(b),"deleteFile",arguments)},moveFile:function(b,f,a){var l=this._getService(b),c=this._getService(f);if(l===c)return e(l,"moveFile",arguments);var h="/"===b[b.length-1],g=f;"/"!==g[g.length-1]&&(g+="/");if(a)g+=encodeURIComponent(a);else{var p=b;h&&(p=p.substring(0,p.length-1));g+=p.substring(p.lastIndexOf("/")+1)}h&&"/"!==g[g.length-1]&&(g+="/");return d(l,b,c,g).then(function(){return e(l,"deleteFile",[b])})},copyFile:function(b,f,a){var l=
this._getService(b),c=this._getService(f);if(l===c)return e(l,"copyFile",arguments);var h="/"===b[b.length-1],g=f;"/"!==g[g.length-1]&&(g+="/");if(a)g+=encodeURIComponent(a);else{var p=b;h&&(p=p.substring(0,p.length-1));g+=p.substring(p.lastIndexOf("/")+1)}h&&"/"!==g[g.length-1]&&(g+="/");return d(l,b,c,g)},read:function(b,f){return e(this._getService(b),"read",arguments)},readBlob:function(b){return e(this._getService(b),"readBlob",arguments)},write:function(b,f,a){return e(this._getService(b),"write",
arguments)},remoteImport:function(b,f){return e(this._getService(b),"remoteImport",arguments)},remoteExport:function(b,f){return e(this._getService(b),"remoteExport",arguments)},search:function(b){return e(this._getService(b.resource),"search",arguments)}};n.prototype.constructor=n;return{FileClient:n}});
define("orion/webui/SideMenu","orion/commands orion/objects orion/webui/littlelib orion/PageLinks orion/PageUtil orion/URITemplate orion/URL-shim orion/util".split(" "),function(k,m,g,e,d,n,b,f){function a(a,c){this.parentNode=g.node(a);this.contentNode=g.node(c);if(!this.parentNode)throw Error("Missing parentNode");this.menuitems=Object.create(null);this.categories=this.links=null;this.anchor=document.createElement("ul");this.anchor.classList.add("sideMenuList");this.parentNode.appendChild(this.anchor);
this.anchor.addEventListener("click",this._handleEvent.bind(this));this.anchor.addEventListener("touchstart",this._handleEvent.bind(this));this.anchor.addEventListener("focus",this._handleEvent.bind(this),!0);g.addAutoDismiss([this.anchor],this._expandMenu.bind(this,null))}function l(a){return!a.isRelatedLink}function c(a,c){var b=a.order,f=c.order;return b<f?-1:f<b?1:0}function h(a,c){var b=a.source.order,f=c.source.order,b="number"===typeof b?b:100,f="number"===typeof f?f:100;return b===f?a.textContent.localeCompare(c.textContent):
b<f?-1:1}var q=f.isTouch;m.mixin(a.prototype,{LOCAL_STORAGE_NAME:"sideMenuNavigation",OPEN_STATE:"open",CLOSED_STATE:"closed",DEFAULT_STATE:"open",SIDE_MENU_OPEN_WIDTH:"40px",TRANSITION_DURATION_MS:301,addMenuItem:function(a,c,b){var f=this.anchor;a=this.createListItem(a,c);b&&a.classList.add("sideMenuItemActive");f.appendChild(a);this.menuitems[c]=a},setSideMenu:function(){var a=this.getDisplayState(),c=this.parentNode;c&&(a===this.CLOSED_STATE&&(this.setPageContentLeft("0"),this._timeout&&(window.clearTimeout(this._timeout),
this._timeout=null),this._timeout=window.setTimeout(function(){c.style.display="none"},this.TRANSITION_DURATION_MS),c.classList.add("animating")),a===this.OPEN_STATE&&(this._timeout&&(window.clearTimeout(this._timeout),this._timeout=null),c.classList.remove("animating"),c.style.display="block",c.style.width=this.SIDE_MENU_OPEN_WIDTH,this.setPageContentLeft(this.SIDE_MENU_OPEN_WIDTH)))},setPageContentLeft:function(a){var c=this.contentNode;c&&(c.style.left=a)},toggleSideMenu:function(){var a=this.getDisplayState(),
c=this.contentNode;c&&c.classList.add("content-fixedHeight-animation");a=a===this.OPEN_STATE?this.CLOSED_STATE:this.OPEN_STATE;a===this.DEFAULT_STATE?localStorage.removeItem(this.LOCAL_STORAGE_NAME):localStorage.setItem(this.LOCAL_STORAGE_NAME,a);this.setSideMenu()},clearMenuItems:function(){this.menuitems=[];g.empty(this.anchor)},getMenuItems:function(){var a=this.menuitems;return Object.keys(a).map(function(c){return a[c]})},getMenuItem:function(a){return this.menuitems[a]},getDisplayState:function(){var a=
localStorage.getItem(this.LOCAL_STORAGE_NAME);a||(a=this.DEFAULT_STATE);return a},createListItem:function(a,c){var b=document.createElement("li");b.className=a;b.classList.add("sideMenuItem");b.categoryId=c;return b},setCategories:function(a){this.categories=a;this.links=Object.create(null)},setPageLinks:function(a){this.pageLinks=a;var c=this,b=a.createLinkElements();a.getAllLinks().forEach(function(a,f){var d=b[f];d.source=a;c._getLinksBin(a.category).push(d)});this._renderLinks()},setRelatedLinks:function(a,
c){this.relatedLinks=a;var b=this;Object.keys(this.links).forEach(function(a){var c=b._getLinksBin(a);b.links[a]=c.filter(l)});var f=document.createDocumentFragment();a.forEach(function(a){var c=a.relatedLink,d=b._getLinksBin(c.category);a=k.createCommandMenuItem(f,a.command,a.invocation);a.classList.remove("dropdownMenuItem");a.isRelatedLink=!0;a.source=c;d.push(a)});this._renderLinks(c)},_getLinksBin:function(a){if(a){var c=this.links;c[a]=c[a]||[];return c[a]}return[]},_sort:function(){var a=this.links;
Object.keys(a).forEach(function(c){a[c].sort(h)})},_renderCategories:function(){var a=this.categories,b=this,f=new URL(window.location.href),h=d.matchResourceParameters();h.OrionHome=e.getOrionHome();var l=!1;this.clearMenuItems();a.getCategoryIDs().map(function(c){return a.getCategory(c)}).sort(c).forEach(function(a){var c=b._getLinksBin(a.id);c.length&&(l?b.addMenuItem(a.imageClass,a.id,!1):(c=c.some(function(a){if(!a.source.uriTemplate)return!1;a=new n(a.source.uriTemplate);a=new URL(a.expand(h),
window.location);return a.protocol===f.protocol&&a.host===f.host&&a.hostname===f.hostname&&a.port===f.port&&a.pathname===f.pathname&&a.search===f.search?l=!0:!1}),b.addMenuItem(a.imageClass,a.id,c)))})},_renderLinks:function(a){a=a||[];this._sort();this._renderCategories();var c=this,b=window.location.href;Object.keys(this.menuitems).forEach(function(f){var d=c.getMenuItem(f);if(d){for(var h=c._getLinksBin(f).slice(),h=h.filter(function(c){var f=c.source;return 0<=a.indexOf(f.id)||!f.default&&!f.force&&
c.href===b?!1:!0}),h=h.filter(function(a){a=a.source;return!(1<h.length&&a.default&&!a.force)}),e=h.length-1;0<e;e--)h[e].href===h[e-1].href&&h.splice(e,1);if(h.length){d.appendChild(c._createCategoryElement(f,d,h[0]));var l=document.createElement("ul");l.className="sideMenuSubMenu";h.forEach(function(a){var c=document.createElement("li");c.className="sideMenuSubMenuItem";var b=document.createElement("a");b.href=a;b.className="sideMenuSubMenuItemLink";var f=document.createElement("span");f.innerHTML=
a.innerHTML;f.className="sideMenuSubMenuItemSpan";b.appendChild(f);c.appendChild(b);l.appendChild(c)});d.appendChild(l)}}})},_createCategoryElement:function(a,c,b){a=this.categories.getCategory(a);var f;q?(f=document.createElement("button"),f.type="button"):(f=document.createElement("a"),f.href=b.href);f.className+=a.imageClass;f.classList.add("submenu-trigger");f.tabIndex="0";c.classList.remove(a.imageClass);return f},_handleEvent:function(a){var c=a.target;a="focus"===a.type;if("A"!==c.tagName||
a)c.classList.contains("submenu-trigger")&&(q||a)&&this._expandMenu(g.$(".sideMenuSubMenu",c.parentNode))},_expandMenu:function(a){this.getMenuItems().forEach(function(c){c=g.$(".sideMenuSubMenu",c);a!==c&&c.classList.remove("expanded")});a&&a.classList.toggle("expanded")}});return a});
define("orion/globalCommands","i18n!orion/nls/messages require orion/commonHTMLFragments orion/keyBinding orion/EventTarget orion/commandRegistry orion/commands orion/parameterCollectors orion/extensionCommands orion/uiUtils orion/keyBinding orion/breadcrumbs orion/webui/littlelib orion/webui/splitter orion/webui/dropdown orion/webui/tooltip orion/contentTypes orion/URITemplate orion/keyAssist orion/PageUtil orion/widgets/themes/ThemePreferences orion/widgets/themes/container/ThemeData orion/Deferred orion/widgets/UserMenu orion/PageLinks orion/webui/dialogs/OpenResourceDialog text!orion/banner/banner.html text!orion/banner/footer.html text!orion/banner/toolbar.html orion/widgets/input/DropDownMenu orion/util orion/customGlobalCommands orion/fileClient orion/webui/SideMenu orion/objects".split(" "),function(k,
m,g,e,d,n,b,f,a,l,c,h,q,p,s,t,r,u,D,v,E,z,w,A,C,J,G,x,B,K,y,F,H,L,T){function I(a,c){if(a.getLabel)return a.getLabel();var b=new w;b.resolve(c.properties.name);return b}function Y(a){q.node("progressPane").setAttribute("aria-label",k["Operations - Press spacebar to show current operations"]);(a=a.getService("orion.page.progress"))&&a.init.bind(a)("progressPane")}function V(a,c){var b=a.getServiceReferences("orion.core.auth");ba=[];var f=O.createMenuGenerator.apply(this,arguments);if(f)for(var d=0;d<
b.length;d++){var h=b[d],e=a.getService(h);I(e,h).then(function(a){e.getKey().then(function(c){ba.push(c);e.getUser().then(function(b){f.addUserItem(c,e,a,b)},function(b,d){f.addUserItem(c,e,a,d)});window.addEventListener("storage",function(b){aa[c]!==localStorage.getItem(c)&&(aa[c]=localStorage.getItem(c),e.getUser().then(function(b){f.addUserItem(c,e,a,b)},function(b){f.addUserItem(c,e,a)}))},!1)})})}}function P(a){return a}function Q(c,f,d,h,e){function l(){if(n)return n;var a=c.getService("orion.core.contentTypeRegistry");
a||(a=new r.ContentTypeRegistry(c),a=c.getService("orion.core.contentTypeRegistry"));return a.getContentTypes().then(function(a){return n=a})}function g(a){for(var c={},b=a.getPropertyKeys(),f,d=0;d<b.length;d++)f=b[d],c[f]=a.getProperty(f);return c}function k(a,c){var b=null;a.some(function(a){return c===a.getProperty("id")?!!(b=a):!1});return b}function p(a){var c=a.command;return!c.visibleWhen||c.visibleWhen(f)?(a.invocation=new b.CommandInvocation(f,f,null,c,h),(new w).resolve(a)):"function"===
typeof e?(s||(s=e()),w.when(s,function(d){if(d&&f===ca&&(!c.visibleWhen||c.visibleWhen(d)))return a.invocation=new b.CommandInvocation(d,d,null,c,h),a})):(new w).resolve()}function q(a,c,f){return f?(new w).resolve({relatedLink:a,command:f}):c.then(function(c){return{relatedLink:a,command:new b.Command(c)}})}var m=arguments,n,s,t=c&&c.getServiceReferences("orion.page.link.related");if(t&&0!==t.length){var u=this;w.when(l(),function(){if(O.beforeGenerateRelatedLinks.apply(u,m)){var b=c.getServiceReferences("orion.navigate.command"),
f=[];t.forEach(function(d){var e=g(d);if(e.id){var l;if((e.nls&&e.nameKey||e.name)&&e.uriTemplate)l=a._createCommandOptions(e,d,c,n,!0),f.push(q(e,l,null));else if(l=k(b,e.id)){var p=g(l);d={};T.mixin(d,p,e);(e=h.findCommand(e.id))?f.push(q(d,null,e)):(l=a._createCommandOptions(p,l,c,n,!0),f.push(q(d,l,null)))}}});w.all(f,P).then(function(a){a.sort(function(a,c){return a.command.name.localeCompare(c.command.name)});return w.all(a.map(p),P).then(function(c){var b=[];c=c.filter(function(c,f){if(c)return!0;
b.push(a[f]);return!1});O.addRelatedLinkCommands.call(u,h,c,b,d);O.afterGenerateRelatedLinks.apply(u,m)})})}})}}function S(a){var c=q.node("globalActions");c&&(a.destroy(c),a.renderCommands(c.id,c,{},{},"tool"))}function X(a){var c=window.getComputedStyle(a,null);return null===c||"absolute"===c.getPropertyValue("position")||!a.parentNode||a===document.body?a:X(a.parentNode)}function R(a){var c={},b=null;"string"===typeof a&&(a=q.node(a));a||(a=q.node("pageActions"));for(var f=a;f&&f.classList;){if(f.classList.contains("toolComposite")){b=
f;break}f=f.parentNode}a.classList.contains("commandMarker")&&(c.commandNode=a);b&&(c.slideContainer=q.$(".slideParameters",b),c.parameterArea=q.$(".parameters",b),c.dismissArea=q.$(".parametersDismiss",b),c.notifications=q.$("#notificationArea",b),b.parentNode&&(c.toolbarTarget=q.$(".toolbarTarget",b.parentNode),c.toolbarTarget&&(a=q.bounds(c.toolbarTarget),f=q.bounds(X(c.toolbarTarget.parentNode)),c.toolbarTargetY=a.top-f.top,c.toolbar=b)));return c}function $(a){if(a=a.slideContainer)if(a.style.left=
"",a.style.top="",a.classList.contains("slideContainerActive")){var c=q.bounds(a),b=q.bounds(a.parentNode);a.style.left=(b.width-c.width)/2+"px";a.style.top="0"}}n=function(a){var c=document.createElement("a");c.href=a;return c.href}(m.toUrl("auth/NotifyAuthentication.html"));var aa={},N=null,O={createMenuGenerator:F.createMenuGenerator||function(a,c){if(q.node("userMenu")){var b=q.node("userDropdown"),f=new s.Dropdown({dropdown:b}),b=new A.UserMenu({dropdownNode:b,dropdown:f,serviceRegistry:a}),
f=q.node("userTrigger");new t.Tooltip({node:f,text:k.Options,position:["below","left"]});f=document.getElementById("userTrigger");f.className+=" imageSprite core-sprite-silhouette";b.setKeyAssist(c);return b}},beforeGenerateRelatedLinks:F.beforeGenerateRelatedLinks||function(a,c,b,f,d){return!0},addRelatedLinkCommands:F.addRelatedLinkCommands||function(a,c,b,f){this.sideMenu&&this.sideMenu.setRelatedLinks(c,f)},afterGenerateRelatedLinks:F.afterGenerateRelatedLinks||function(a,c,b,f,d){},afterSetPageTarget:F.afterSetPageTarget||
function(a){},generateNavigationMenu:F.generateNavigationMenu||function(a,c,b,f,d,h,e){if(a=q.node("sideMenu"))c=q.node("centralNavigation"),new t.Tooltip({node:c,text:k.CentralNavTooltip,position:["right"]}),N=this.sideMenu=new L(a,q.node("pageContent")),c.addEventListener("click",N.toggleSideMenu.bind(N)),(a=q.node("sideMenuToggle"))&&a.addEventListener("click",N.toggleSideMenu.bind(N))},afterGenerateNavigationMenu:F.afterGenerateNavigationMenu||function(a,c,b,f,d,h,e){},afterGenerateBanner:F.afterGenerateBanner||
function(a,c,b,f,d,h,e){}},ba=[],ca,Z=[],M,W=null,U=null,da=new d;return{generateBanner:function(a,c,d,h,l,r,n,s){function t(a){a.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";for(var c=q.$$array(".targetSelector"),b=0;b<c.length;b++)c[b].target=a}},{pid:"nav.config"})}(new E.ThemePreferences(h,new z.ThemeData)).apply();var u=q.node(a);if(!u)throw k["could not find banner parent, id was "]+a;var v=document.createRange();
v.selectNode(u);v=v.createContextualFragment(G);q.processTextNodes(v,k);u.firstChild?u.insertBefore(v,u.firstChild):u.appendChild(v);u=q.node("home");u.href=m.toUrl("edit/edit.html");u.setAttribute("aria-label",k["Orion Home"]);q.node("progressPane").src=b.NO_IMAGE;if(u=q.node("pageToolbar"))u.classList.add("toolbarLayout"),u.innerHTML=B+g.slideoutHTMLFragment("mainToolbar");(u=q.node("closeNotifications"))&&u.setAttribute("aria-label",k["Close notification"]);if(17>=y.isFirefox&&(u=q.node("staticBanner")))u.style.width=
"100%",u.style.MozBoxSizing="border-box";if(u=q.node("footer"))u.innerHTML=x,q.processTextNodes(u,k);d.setParameterCollector(new f.CommandParameterCollector(R,$));document.addEventListener("keydown",function(a){a.keyCode===q.KEY.ESCAPE&&(a=c.getService("orion.page.message"))&&a.setProgressMessage("")},!1);O.generateNavigationMenu.apply(this,arguments);O.afterGenerateNavigationMenu.apply(this,arguments);u=C.getCategoriesInfo(c);v=C.getPageLinksInfo(c,"orion.page.link");w.all([u,v]).then(function(a){if(N){var c=
a[1];N.setCategories(a[0]);N.setPageLinks(c);N.setSideMenu()}});if(u=q.$(".split")){var v=q.$(".sidePanelLayout"),A=q.$(".mainPanelLayout");v&&A&&(W={side:v,main:A},W.splitter=new p.Splitter({node:u,sidePanel:v,mainPanel:A,toggle:!0,closeByDefault:s}),u=new b.Command({name:k["Toggle side panel"],tooltip:k["Open or close the side panel"],id:"orion.toggleSidePane",callback:function(){W.splitter.toggleSidePanel()}}),d.addCommand(u),d.registerCommandContribution("pageActions","orion.toggleSidePane",1,
null,!0,new e.KeyBinding("l",y.isMac?!1:!0,!0,!1,y.isMac?!0:!1)))}var F=!1,H=function(a,c){if(!F){var b=c.getService("orion.page.progress"),f=new J.OpenResourceDialog({searcher:a,progress:b,searchRenderer:a.defaultRenderer,onHide:function(){F=!1}});window.setTimeout(function(){F=!0;f.show()},0)}},u=new b.Command({name:k["Find File Named..."],tooltip:k["Choose a file by name and open an editor on it"],id:"orion.openResource",callback:function(a){H(l,c)}});d.addCommand(u);d.registerCommandContribution("globalActions",
"orion.openResource",100,null,!0,new e.KeyBinding("f",!0,!0));u=new b.Command({name:k["Toggle banner and footer"],tooltip:k["Hide or show the page banner and footer"],id:"orion.toggleTrim",callback:function(){var a=q.node("banner"),c=q.node("footer"),b=q.node("sideMenu"),f=q.$(".content-fixedHeight"),d="hidden"===a.style.visibility;d?(a.style.visibility="visible",c.style.visibility="visible",f.classList.remove("content-fixedHeight-maximized"),b&&b.classList.remove("sideMenu-maximized")):(a.style.visibility=
"hidden",c.style.visibility="hidden",f.classList.add("content-fixedHeight-maximized"),b&&b.classList.add("sideMenu-maximized"));da.dispatchEvent({type:"toggleTrim",maximized:!d});return!0}});d.addCommand(u);d.registerCommandContribution("globalActions","orion.toggleTrim",100,null,!0,new e.KeyBinding("m",!0,!0));u=new b.Command({name:k["System Configuration Details"],tooltip:k["System Config Tooltip"],id:"orion.configDetailsPage",hrefCallback:function(){return m.toUrl("help/about.html")}});d.addCommand(u);
d.registerCommandContribution("globalActions","orion.configDetailsPage",100,null,!0,new e.KeyBinding(112,!0,!0));u=new b.Command({name:k["Background Operations"],tooltip:k["Background Operations Tooltip"],id:"orion.backgroundOperations",hrefCallback:function(){return m.toUrl("operations/list.html")}});d.addCommand(u);d.registerCommandContribution("globalActions","orion.backgroundOperations",100,null,!0,new e.KeyBinding("o",!0,!0));U=new D.KeyAssistPanel({commandRegistry:d});u=new b.Command({name:k["Show Keys"],
tooltip:k["Show a list of all the keybindings on this page"],id:"orion.keyAssist",callback:function(){U.isVisible()?U.hide():U.show();return!0}});d.addCommand(u);d.registerCommandContribution("globalActions","orion.keyAssist",100,null,!0,new e.KeyBinding(191,!1,!0));S(d);V(c,u.callback);Y(c);window.addEventListener("hashchange",function(){d.processURL(window.location.href)},!1);window.setTimeout(function(){t(c)},0);O.afterGenerateBanner.apply(this,arguments)},getToolbarElements:R,getMainSplitter:function(){return W},
getKeyAssist:function(){return U},getGlobalEventTarget:function(){return da},layoutToolbarElements:$,setPageTarget:function(a){var c,b,f=a.breadcrumbRootName,d=a.serviceRegistry;a.target?(a.searchService&&a.searchService.setLocationByMetaData(a.target),a.fileService&&!a.breadcrumbTarget&&!a.staticBreadcrumb&&(b=(f?f+" ":"")+a.fileService.fileServiceName(a.target.Location),f=null),c=a.name||a.target.Name,ca=a.target,Q.call(this,d,a.target,Z,a.commandService,a.makeAlternate)):(a.breadcrumbTarget||(f=
f||a.task||a.name),c=a.name,Q.call(this,d,{NoTarget:""},Z,a.commandService,a.makeAlternate));(M=a.title)||(M=c?c+" - "+a.task:a.task);window.document.title=M;O.afterSetPageTarget.apply(this,arguments);if(c=a.breadCrumbContainer?q.node(a.breadCrumbContainer):q.node("location"))if(q.empty(c),a.staticBreadcrumb)new h.BreadCrumbs({container:c,rootSegmentName:f});else{var e=d&&new H.FileClient(d),d=a.breadcrumbTarget||a.target,e=e&&d&&d.Location?e.fileServiceRootURL(d.Location):null;new h.BreadCrumbs({container:c,
resource:d,rootSegmentName:f,workspaceRootSegmentName:b,workspaceRootURL:e,makeFinalHref:a.makeBreadcrumFinalLink,makeHref:a.makeBreadcrumbLink})}},setDirtyIndicator:function(a){M&&("*"===M.charAt(0)&&!a&&(M=M.substring(1)),a&&"*"!==M.charAt(0)&&(M="*"+M),window.document.title=M);var c=q.node("dirty");c&&(c.textContent=a?"*":"")},setPageCommandExclusions:function(a){Z=a},notifyAuthenticationSite:n}});
define("orion/urlUtils",["orion/PageUtil","orion/URL-shim"],function(k){return{detectValidURL:function(m){for(var g=/\[([^\]]*)\]\(([^\)]+)\)/g,e=g.exec(m),d=[],n=0;e;){if(3===e.length&&0<e[2].length){var b=new URL(e[2]);":"!==b.protocol&&k.validateURLScheme(b.href)&&(e.index>n&&d.push({segmentStr:m.substring(n,e.index)}),d.push({segmentStr:0<e[1].length?e[1]:e[2],urlStr:e[2]}),n=e.index+e[0].length)}e=g.exec(m)}if(0===n)return null;n<m.length-1&&d.push({segmentStr:m.substring(n)});return d},processURLSegments:function(k,
g){g.forEach(function(e){if(e.urlStr){var d=document.createElement("a");d.href=e.urlStr;d.appendChild(document.createTextNode(e.segmentStr))}else d=document.createElement("span"),d.textContent=e.segmentStr;k.appendChild(d)})}}});
define("orion/status",["i18n!orion/nls/messages","orion/webui/littlelib","orion/globalCommands","orion/urlUtils"],function(k,m,g,e){function d(b,f,a,d,c){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.message",this);this._operationsClient=f;this.notificationContainerDomId=c;this.domId=a;this.progressDomId=d||a;this._hookedClose=!1;this._timer=null;this._clickToDisMiss=!0;this._cancelMsg=null}var n;d.prototype={_init:function(){var b=m.node("closeNotifications");if(b&&
!this._hookedClose){b.style.cursor="pointer";this._hookedClose=!0;var f=m.node(this.notificationContainerDomId);m.addAutoDismiss([f],function(){this._clickToDisMiss&&this.close()}.bind(this));b.addEventListener("click",function(){this.close()}.bind(this));f.addEventListener("click",function(a){a&&a.target&&"a"===a.target.nodeName.toLowerCase()&&(a=m.$$("a",f))&&a.length&&1===a.length&&this.close()}.bind(this))}},close:function(){window.clearTimeout(this._timer);var b=m.node("closeNotifications");
this._cancelMsg&&this._cancelFunc&&b?(b.innerHTML="",b.classList.remove("cancelButton"),b.classList.add("dismissButton"),b.classList.add("core-sprite-close"),b.classList.add("imageSprite"),this._cancelFunc(),this._cancelMsg=null):this.setProgressMessage("")},_getNotifierElements:function(){this._notifierElements||(this._notifierElements=g.getToolbarElements(this.notificationContainerDomId));return this._notifierElements},setMessage:function(b,f,a){this._init();this.currentMessage=b;var d=m.node(this.domId);
if("boolean"===typeof a){var c=d.getAttribute("aria-live");d.setAttribute("aria-live",a?"polite":"off");window.setTimeout(function(){b===this.currentMessage&&(m.empty(d),d.appendChild(document.createTextNode(b)),window.setTimeout(function(){d.setAttribute("aria-live",c)},100))}.bind(this),100)}else m.empty(d),d.appendChild(document.createTextNode(b));"number"===typeof f&&window.setTimeout(function(){b===this.currentMessage&&(m.empty(d),d.appendChild(document.createTextNode("")))}.bind(this),f)},setErrorMessage:function(b){this._clickToDisMiss=
!0;this.currentMessage=b;this._init();var f=b.responseText||b.message||b;if("string"===typeof f)try{f=JSON.parse(f)}catch(a){}b=f.Message||f;var d="red";if(f.Severity)switch(f.Severity){case "Warning":d="#FFCC00";break;case "Error":d="red";break;case "Info":case "Ok":d="green"}f=document.createElement("span");f.style.color=d;f.appendChild(document.createTextNode(b));b=m.node(this.domId);m.empty(b);b.appendChild(f)},setProgressMessage:function(b){this._clickToDisMiss=!1;this._init();this.currentMessage=
b;var f=document.createElement("span");f.classList.add("progressIcon");var a=m.node(this.progressDomId);m.empty(a);a.appendChild(f);a.appendChild(document.createTextNode(b));f=m.node(this.notificationContainerDomId);f.classList.remove("notificationHide");if(b&&0<b.length)f.classList.add("progressNormal"),f.classList.add("notificationShow");else{if(this._progressMonitors&&0<this._progressMonitors.length)return this._renderOngoingMonitors();f.classList.remove("notificationShow");f.classList.add("notificationHide")}},
setCancelFunction:function(b){this._cancelFunc=b},setProgressResult:function(b,f){this._clickToDisMiss=!1;this._cancelMsg=f;this.currentMessage=b;var a=b.responseText||b;if("string"===typeof a)try{a=JSON.parse(a)}catch(d){}this._init();var c=a.Message||a.toString(),h=k.UnknownError,g="core-sprite-information",p="progressNormal",n=document.createElement("span");n.classList.add("imageSprite");n.classList.add("progressIcon");var t=[];if(a.Severity)switch(a.Severity){case "Warning":h=k.UnknownWarning;
g="core-sprite-warning";p="progressWarning";t.push("progressInfo");t.push("progressError");t.push("progressNormal");this._clickToDisMiss=!0;break;case "Error":g="core-sprite-error";p="progressError";t.push("progressWarning");t.push("progressInfo");t.push("progressNormal");this._clickToDisMiss=!0;break;default:p="progressNormal",t.push("progressWarning"),t.push("progressError"),t.push("progressNormal")}t.push("notificationHide");n.classList.add(g);var r=m.node(this.progressDomId),g=m.node(this.notificationContainerDomId);
m.empty(r);r.appendChild(n);c===Object.prototype.toString()&&(c=h);a.HTML?(a=document.createElement("span"),a.innerHTML=c,r.appendChild(a)):((h=e.detectValidURL(c))?(c=document.createDocumentFragment(),e.processURLSegments(c,h),Array.prototype.forEach.call(m.$$("a",c),function(a){a.target="_blank"})):("Warning"!==a.Severity&&"Error"!==a.Severity&&!f&&(this._timer&&window.clearTimeout(this._timer),this._timer=window.setTimeout(function(){this.setProgressMessage("");this._timer=null}.bind(this),5E3)),
c=document.createTextNode(c)),r.appendChild(c));if(p&&this.progressDomId!==this.domId){g.classList.add(p);for(p=0;p<t.length;p++)g.classList.remove(t[p])}g.classList.add("notificationShow");if(t=m.node("closeNotifications"))this._cancelMsg?(t.classList.add("cancelButton"),t.classList.remove("dismissButton"),t.classList.remove("core-sprite-close"),t.classList.remove("imageSprite"),t.innerHTML=this._cancelMsg):(t.innerHTML="",t.classList.remove("cancelButton"),t.classList.add("dismissButton"),t.classList.add("core-sprite-close"),
t.classList.add("imageSprite"))},showWhile:function(b,f){var a=this;if(f){a.setProgressMessage(f);var d=function(){f===a.currentMessage&&a.setProgressMessage("")};b.then(d,d)}return b},_lastProgressId:0,_progressMonitors:{length:0},createProgressMonitor:function(b,f){return new n(this,++this._lastProgressId,b,f)},_renderOngoingMonitors:function(){if(0<this._progressMonitors.length){var b="",f=!0,a;for(a in this._progressMonitors)this._progressMonitors[a].status&&(f||(b+=", "),b+=this._progressMonitors[a].status,
f=!1);this.setProgressMessage(b)}else this.setProgressMessage("")},_beginProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._progressMonitors.length++;this._renderOngoingMonitors()},_workedProgressMonitor:function(b){this._progressMonitors[b.progressId]=b;this._renderOngoingMonitors()},_doneProgressMonitor:function(b){delete this._progressMonitors[b.progressId];this._progressMonitors.length--;b.status?this.setProgressResult(b.status):this._renderOngoingMonitors()}};d.prototype.constructor=
d;n=function(b,f,a,d){this.statusService=b;this.progressId=f;if(a){this.deferred=a;this.begin(d);var c=this;a.then(function(a,b){c.done.bind(c)()},function(a,b){c.done.bind(c)()})}};n.prototype.begin=function(b){this.status=b;this.statusService._beginProgressMonitor(this)};n.prototype.done=function(b){this.status=b;this.statusService._doneProgressMonitor(this)};n.prototype.worked=function(b){this.status=b;this.statusService._workedProgressMonitor(this)};n.prototype.constructor=n;return{StatusReportingService:d,
ProgressMonitor:n}});
define("orion/operations/nls/root/messages",{More:"More","No Matching OperationService for location:":"No Matching OperationService for location:","No operations services registered.":"No operations services registered.","could not find toolbar ":"could not find toolbar ","Remove Completed":"Remove Completed","Remove all completed operations":"Remove all completed operations",Remove:"Remove","Remove operations from the operations list.":"Remove operations from the operations list.",Cancel:"Cancel",
"Cancel operations from the operations list.":"Cancel operations from the operations list.","Operation resulted in a warning.":"Operation resulted in a warning.","Operation resulted in an error.":"Operation resulted in an error.","Operation is running.":"Operation is running.","Operation is canceled.":"Operation is canceled.","Operation failed.":"Operation failed.",Name:"Name",Actions:"Actions",Status:"Status",Scheduled:"Scheduled"});
define("orion/operations/nls/messages",["orion/i18n!orion/operations/nls/messages","orion/operations/nls/root/messages"],function(k,m){var g={root:m};Object.keys(k).forEach(function(e){"undefined"===typeof g[e]&&(g[e]=k[e])});return g});
define("orion/webui/popupdialog",["i18n!orion/widgets/nls/messages","require","orion/webui/littlelib","orion/webui/tooltip"],function(k,m,g,e){function d(){}d.prototype={_initialize:function(d,b,f,a,l){this._tooltip=new e.Tooltip({node:d,hideDelay:l||0,afterShowing:this._afterShowingFunction(b).bind(this),afterHiding:f,trigger:a?a:"click"});this.$parent=this._tooltip.contentContainer();this.$parent.role="dialog";d=document.createRange();d.selectNode(this.$parent);d=d.createContextualFragment(this.TEMPLATE);
this.messages&&g.processTextNodes(d,k);this.$parent.appendChild(d);var c=this._tooltip;this.$parent.addEventListener("keydown",function(a){a.keyCode===g.KEY.ESCAPE&&c.hide()},!1);this._bindElements(this.$parent);"function"===typeof this._bindToDom&&this._bindToDom(this.$parent)},_bindElements:function(d){for(var b=0;b<d.childNodes.length;b++){var f=d.childNodes[b];f.id&&(this["$"+f.id]=f);this._bindElements(f)}},_afterShowingFunction:function(d){return function(){d&&d.bind(this)();if(!this.customFocus){var b=
g.firstTabbable(this.$parent);b&&b.focus()}}},hide:function(){this._tooltip.hide()},show:function(){this._tooltip.show()}};d.prototype.constructor=d;return{PopupDialog:d}});
define("orion/operationsCommands",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/commands"],function(k,m,g,e){var d={};(function(){var m=!1;d.updateNavTools=function(b,f,a,d,c,h){var e=g.node(d);if(e)f.destroy(e);else throw k["could not find toolbar "]+d;f.renderCommands(d,e,h,a,"button");if(c&&(d=g.node(c)))f.destroy(d),f.renderCommands(c,d,null,a,"button");m||(m=!0,b.getService("orion.page.selection").addEventListener("selectionChanged",function(b){var d=g.node(c);
d&&(f.destroy(d),f.renderCommands(c,d,b.selections,a,"button"))}))};d.createOperationsCommands=function(b,d,a){function l(a){return!a.operation||!a.operation.type?!1:"loadstart"===a.operation.type||"progress"===a.operation.type}var c=new e.Command({name:k["Remove Completed"],tooltip:k["Remove all completed operations"],id:"eclipse.removeCompletedOperations",callback:function(c){a.removeCompletedOperations().then(function(a){d.loadOperations.bind(d)()})},visibleWhen:function(a){return!0}});b.addCommand(c);
c=new e.Command({name:k.Remove,tooltip:k["Remove operations from the operations list."],imageClass:"core-sprite-delete",id:"eclipse.removeOperation",callback:function(c){c=Array.isArray(c.items)?c.items:[c.items];for(var b=0;b<c.length;b++){var e=c[b];a.removeOperation.bind(a)(e.Location).then(function(){d.loadOperations.bind(d)()},function(){d.loadOperations.bind(d)()})}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return!l(a);for(var c in a)if(l(a[c]))return!1;return!0}});b.addCommand(c);
c=new e.Command({name:k.Cancel,tooltip:k["Cancel operations from the operations list."],imageClass:"core-sprite-stop",id:"eclipse.cancelOperation",callback:function(a){a=Array.isArray(a.items)?a.items:[a.items];for(var c=0;c<a.length;c++){var b=a[c];b.deferred&&b.deferred.cancel()}},visibleWhen:function(a){if(!Array.isArray(a)||0===a.length)return l(a)&&(a.operation&&a.operation.cancelable?!0:!1);for(var c in a)if(!l(a[c])||!a[c].operation||!a[c].operation.cancelable)return!1;return!0}});b.addCommand(c)}})();
return d});
define("orion/webui/dialogs/OperationsDialog",["i18n!orion/operations/nls/messages","require","orion/webui/littlelib","orion/webui/popupdialog","orion/operationsCommands"],function(k,m,g,e,d){function n(b){this._options=b}n.prototype=new e.PopupDialog;n.prototype.TEMPLATE='\x3ctable style\x3d"width: 360px;"\x3e\x3ctr\x3e\x3ctd\x3e\x3ch2\x3eRecent operations\x3c/h2\x3e\x3c/td\x3e\x3ctd style\x3d"text-align: right;"\x3e\x3ca id\x3d"allOperationsLink" class\x3d"navlinkonpage"\x3eAll Operations\x3c/a\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3cdiv id\x3d"operationsExist"\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"myOperationsListEmpty"\x3eNo operations running on this page.\x3c/div\x3e\x3ctable id\x3d"myOperationsList" style\x3d"display: none;"\x3e\x3c/table\x3e\x3c/div\x3e\x3cdiv style\x3d"padding-left: 7px" id\x3d"operationsDontExist"\x3eNo operations running.\x3c/div\x3e';n.prototype._init=
function(b){this._myOperations=[];this._operationsDeferreds=[];this._commandService=b.commandRegistry;d.createOperationsCommands(this._commandService);this._commandService.registerCommandContribution("operationsDialogItems","eclipse.cancelOperation",1);this._initialize(b.triggerNode)};n.prototype._bindToDom=function(b){this.$allOperationsLink.href=m.toUrl("operations/list.html");this._setOperationsVisibility()};n.prototype.setOperations=function(b,d){this._myOperations||this._init(this._options);
this._myOperations=[];this._operationsDeferreds=[];if(b)for(var a in b)this._myOperations.push(b[a]),this._operationsDeferreds.push(d[a]);this._renderOperations()};n.prototype.parseProgressResult=function(b){if(!b)return{};b=b.responseText||b;try{b=JSON.parse(b)}catch(d){}var a={Message:b.Message||b,Severity:b.Severity};b.DetailedMessage&&b.DetailedMessage!==a.Message&&(a.DetailedMessage=b.DetailedMessage);return a};n.prototype._renderOperations=function(){this._renderOperationsTable(this.$myOperationsList,
this._myOperations,this._operationsDeferreds)};n.prototype._renderOperationsTable=function(b,d,a){g.empty(b);for(var e=0;e<d.length;e++){var c=d[e],h=document.createElement("tr"),q=document.createElement("td");q.style.paddingLeft="5px";q.style.paddingRight="5px";q.textContent=c.Name;h.appendChild(q);var p=document.createElement("div");q.appendChild(p);q=document.createElement("span");q.style.paddingRight="5px";q.classList.add("imageSprite");switch(c.type){case "Warning":q.classList.add("core-sprite-warning");
q.setAttribute("aria-label",k["Operation resulted in a warning."]);break;case "error":q.classList.add("core-sprite-error");q.setAttribute("aria-label",k["Operation resulted in an error."]);break;case "loadstart":case "progress":q.classList.add("core-sprite-start");q.setAttribute("aria-label",k["Operation is running."]);break;case "abort":q.classList.add("core-sprite-stop");q.setAttribute("aria-label",k["Operation is canceled."]);break;case "load":case "loadend":q.classList.add("core-sprite-ok"),q.setAttribute("aria-label",
"Operation ok.")}p.appendChild(q);q=document.createElement("span");q.classList.add("operationStatus");q.textContent=c.Name;p.appendChild(q);if(c.error){var m=c.error.Message||c.error;c.error.DetailedMessage&&""!==c.error.DetailedMessage&&(m+=": "+c.error.DetailedMessage);q.textContent=m;q.classList.remove("operationStatus");q.classList.add("operationError")}this._commandService.renderCommands("operationsDialogItems",p,{operation:c,deferred:a[e]},this,"tool");b.appendChild(h)}this._setOperationsVisibility()};
n.prototype._setOperationsVisibility=function(){this.$myOperationsList.style.display=0<this._myOperations.length?"":"none";this.$myOperationsListEmpty.style.display=0<this._myOperations.length?"none":"";this.$operationsDontExist.style.display=0<this._myOperations.length?"none":"";this.$operationsExist.style.display=0<this._myOperations.length?"":"none"};n.prototype.constructor=n;return{OperationsDialog:n}});
define("orion/progress",["i18n!orion/nls/messages","require","orion/Deferred","orion/webui/littlelib","orion/webui/dialogs/OperationsDialog"],function(k,m,g,e,d){function n(b,a){if(!this._progressPane){this._progressPane=e.node(b);this._operationsDialog=new d.OperationsDialog({triggerNode:this._progressPane,commandRegistry:a});var l=this;this._progressPane.addEventListener("keydown",function(a){(" "===a.charOrCode||a.keyCode===e.KEY.ENTER)&&l._operationsDialog.show()});this._progressPane.addEventListener("click",
function(a){l._operationsDialog.show()});this._operationsDialog.setOperations(null,null)}}function b(b,a,d,c){this._serviceRegistry=b;this._serviceRegistration=b.registerService("orion.page.progress",this);this._commandRegistry=d;this._operationsClient=a;this._operations={};this._operationDeferrds={};this._operationsIndex=0;this._lastIconClass=this._lastOperation=null;this._progressMonitorClass=c}n.prototype={_switchIconTo:function(b){this._lastIconClass&&this._progressPane.classList.remove(this._lastIconClass);
this._lastIconClass=b;this._progressPane.classList.add(this._lastIconClass)},generateOperationsInfo:function(b,a){var d={},c;for(c in b)b[c].progressMonitor||(d[c]=b[c]);if(this._isEmpty(d))this._switchIconTo("progressPane_empty"),this._progressPane.title=k.Operations,this._progressPane.alt=k.Operations,this._progressPane.hasAttribute("aria-valuetext")&&this._progressPane.removeAttribute("aria-valuetext");else{var e="";for(c in d){var g=d[c];if(g.type&&("loadstart"===g.type||"progress"===g.type)){e=
"running";break}}""===e&&null!=this._lastOperation&&this._lastOperation.type&&"error"===this._lastOperation.type&&"error"==e;switch(e){case "running":this._progressPane.title=k["Operations running"];this._progressPane.alt=k["Operations running"];this._progressPane.setAttribute("aria-valuetext",k["Operations running"]);this._switchIconTo("running");break;case "warning":this._progressPane.title=k["Some operations finished with warning"];this._progressPane.alt=k["Some operations finished with warning"];
this._progressPane.setAttribute("aria-valuetext",k["Some operations finished with warning"]);this._switchIconTo("warning");break;case "error":this._progressPane.title=k["Some operations finished with error"];this._progressPane.alt=k["Some operations finished with error"];this._progressPane.setAttribute("aria-valuetext",k["Some operations finished with error"]);this._switchIconTo("error");break;default:this._progressPane.title=k.Operations,this._progressPane.alt=k.Operations,this._progressPane.hasAttribute("aria-valuetext")&&
this._progressPane.removeAttribute("aria-valuetext"),this._switchIconTo("progressPane_empty")}}this._operationsDialog.setOperations(d,a)},_isEmpty:function(b){for(var a in b)return!1;return!0}};n.prototype.constructor=n;b.prototype={init:function(b){this._progressMonitorClass||(this._progressMonitorTool=new n(b,this._commandRegistry))},progress:function(b,a,d){var c=this,e=this._operationsIndex++;!d&&this._progressMonitorClass&&(d=new this._progressMonitorClass,d.begin(a));b.then(function(g){c._operations[e]&&
(g=c._operations[e],a&&(g.Name=a),c._lastOperation=g,g.type="loadend",d&&(g.progressMonitor=d),c.writeOperation.bind(c)(e,g,b),g.Location||c._removeOperationFromTheList.bind(c)(e))},function(g){if(c._operations[e]){var k=c._operations[e];a&&(k.Name=a);d&&(k.progressMonitor=d);c._lastOperation=k;k.type=g.canceled?"abort":"error";k.error=g;c.writeOperation.bind(c)(e,k,b);k.Location||c._removeOperationFromTheList.bind(c)(e)}},function(g){a&&(g.Name=a);d&&(g.progressMonitor=d);c.writeOperation.bind(c)(e,
g,b)});return b},removeOperation:function(b){for(var a in this._operations)if(this._operations[a].Location&&this._operations[a].Location===b){this._removeOperationFromTheList(a);break}this._operationsClient.removeOperation.bind(this._operationsClient)(b)},_removeOperationFromTheList:function(b){var a=this._operations[b].progressMonitor;delete this._operations[b];delete this._operationDeferrds[b];a?a.done():this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},
removeCompletedOperations:function(){for(var b in this._operations){var a=this._operations[b];a.type&&"loadstart"!==a.type&&"progress"!==a.type&&((a=this._operations[b].progressMonitor)&&a.done(),delete this._operations[b],delete this._operationDeferrds[b])}this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)},setProgressResult:function(b){this._serviceRegistry.getService("orion.page.message").setProgressResult(b)},showWhile:function(b,a,d){a&&this._serviceRegistry.getService("orion.page.message").setProgressMessage(a);
var c=this;b.then(function(a){c._serviceRegistry.getService("orion.page.message").setProgressMessage("")},function(a){d?c._serviceRegistry.getService("orion.page.message").setProgressMessage(""):c.setProgressResult.bind(c)(a);return a});return this.progress(b,a)},writeOperation:function(b,a,d){this._operations[b]=a;this._operationDeferrds[b]=d;a.Location&&this._serviceRegistry.getService("orion.core.preference").getPreferences("/operations").then(function(c){c.put(a.Location,{Name:a.Name,expires:a.expires})});
a.progressMonitor?a.progressMonitor.progress(a.Name):this._progressMonitorTool.generateOperationsInfo(this._operations,this._operationDeferrds)}};b.prototype.constructor=b;return{ProgressService:b}});
define("orion/operationsClient",["i18n!orion/operations/nls/messages","orion/Deferred"],function(k,m){function g(b,d,a){return b[d].apply(b,a)}function e(b){this._location=b}function d(){var b=new m;b.reject(k["No Matching OperationService for location:"]+this._location);return b}function n(b){this._services=[];this._patterns=[];this._operationListeners=[];this._currentLongpollingIds=[];this._preferenceService=b.getService("orion.core.preference");for(var d=b.getServiceReferences("orion.core.operation"),
a=0;a<d.length;a++){var g=b.getService(d[a]);this._services[a]=g;g=d[a].getProperty("pattern")||".*";"^"!==g[0]&&(g="^"+g);this._patterns[a]=RegExp(g)}this._getService=function(a){if(!a)return this._services[0];for(var b=0;b<this._patterns.length;++b)if(this._patterns[b].test(a))return this._services[b];this._operations.remove(a);return new e(a)}}e.prototype={getOperation:d,getOperations:d,removeCompletedOperations:d,removeOperation:d,cancelOperation:d};e.prototype.constructor=e;n.prototype={getOperations:function(){var b=
new m;if(this._operations)return b.resolve(this._operations),b;var d=this;this._preferenceService.getPreferences("/operations").then(function(a){d._operations=a;b.resolve(d._operations)});return b},getOperation:function(b){return g(this._getService(b),"getOperation",arguments)},removeCompletedOperations:function(){for(var b=[],d=this,a=0;a<this._services.length;a++){var e=this._patterns[a],c=new m;b[a]=c.promise;g(this._services[a],"removeCompletedOperations").then(function(a){return function(c){Array.isArray(c)&&
d.getOperations.bind(d)().then(function(b){for(var d=b.keys(),f=0;f<d.length;f++){var g=d[f];e.test(g)&&0>c.indexOf(g)&&b.remove(g)}a.resolve()})}}(c),function(a){return function(c){a.reject(c)}}(c))}return m.all(b)},removeOperation:function(b){var d=this;return g(this._getService(b),"removeOperation",arguments).then(function(a){d.getOperations.bind(d)().then(function(a){a.remove(b)})},function(a){return a},function(a){return a})}};n.prototype.constructor=n;return{OperationsClient:n}});
define("orion/search/nls/root/messages",{"Find:":"Find:","Find With":"Find With","ReplaceWith:":"ReplaceWith:","Replace With":"Replace With","Show all":"Show all","Wrap search":"Wrap search","Incremental search":"Incremental search","Whole Word":"Whole Word","Regular expression":"Regular expression","Find after replace":"Find after replace",Options:"Options","Find next match":"Find next match","Find previous match":"Find previous match",Next:"Next",Previous:"Previous",Replace:"Replace","Replace All":"Replace All",
"Search ${0}":"Search ${0}","Type a keyword or wild card to search in ":"Type a keyword or wild card to search in ","Search failed.":"Search failed.","No matches found for ${0}":"No matches found for ${0}","Searching...":"Searching...","Resource has been changed by others.":"Resource has been changed by others.","Failed to write file.":"Failed to write file.",Results:"Results","Files ${0} of ${1} matching ${2}":"Files ${0} of ${1} matching ${2}","Replace ${0} with ${1} for files ${2} of ${3}":"Replace ${0} with ${1} for files ${2} of ${3}",
Location:"Location","Click to compare":"Click to compare",'Search again in this folder with "${0}"':'Search again in this folder with "${0}"',"Files replaced":"Files replaced",Status:"Status","${0} out of ${1}  matches replaced.":"${0} out of ${1}  matches replaced.","Replace all matches with...":"Replace all matches with...","Apply Changes":"Apply Changes","Replace all selected matches":"Replace all selected matches","Hide Compare":"Hide Compare","Hide compare view of changes":"Hide compare view of changes",
"Show Compare":"Show Compare","Show compare view of changes":"Show compare view of changes","Show All":"Show All","Show all the results in one page":"Show all the results in one page","\x3c Previous Page":"\x3c Previous Page","Show previous page of search result":"Show previous page of search result","Next Page \x3e":"Next Page \x3e","Show next page of search result":"Show next page of search result","Next result":"Next result","Previous result":"Previous result","Expand all results":"Expand all results",
"Collapse all results":"Collapse all results","Writing files...":"Writing files...","Preparing preview...":"Preparing preview...","Replaced File (${0})":"Replaced File (${0})","Original File (${0})":"Original File (${0})","Sort by Name":"Sort by Name","Compare changes":"Compare changes","Search Results":"Search Results","Replace All Matches":"Replace All Matches","No matches":"No matches",Rename:"Rename","My Saved Searches":"My Saved Searches","Save frequently used searches by choosing ${0} shown above.":"Save frequently used searches by choosing ${0} shown above.",
"Save frequently used searches by clicking on the ${0} button above.":"Save frequently used searches by clicking on the ${0} button above.","Files that contain:":"Files that contain:",Search:"Search","All types":"All types","File type":"File type","All ${0} files":"All ${0} files","${0} is already saved":"${0} is already saved","Type a search term":"Type a search term","Type a replace term":"Type a replace term","Case sensitive":"Case sensitive","Sort by":"Sort by","File name":"File name","Path name":"Path name",
Save:"Save","Type a name for the search":"Type a name for the search","Save the current search":"Save the current search","Type filter text":"Type filter text","Scope Search":"Scope Search","Open in Search page for this directory":"Open the Search page for this folder.","${0}. Try your search again.":"${0}. Try your search again.","Click or use delete key to delete the search term":"Click or use delete key to delete the search term","${0} matches":"${0} matches","Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"Regular expression is off. You can click here or use options to turn it on for replacement - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",
"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.":"Regular expression is on. You can click here or use options to turn it off - e.g. when the option is on you can replace \x3ctd([\\s\\S]*?)\x3c/td\x3e with \x3cspan$1\x3c/span\x3e.",root:"root",Scope:"Scope"});
define("orion/search/nls/messages",["orion/i18n!orion/search/nls/messages","orion/search/nls/root/messages"],function(k,m){var g={root:m};Object.keys(k).forEach(function(e){"undefined"===typeof g[e]&&(g[e]=k[e])});return g});
define("orion/webui/treetable",["i18n!orion/nls/messages","orion/webui/littlelib"],function(k,m){function g(e){this._init(e)}g.prototype={_init:function(e){var d=e.parent,g=this,d=m.node(d);if(!d)throw k["no parent"];if(!e.model)throw k["no tree model"];if(!e.renderer)throw k["no renderer"];this._parent=d;this._treeModel=e.model;this._onComplete=e.onComplete;this._renderer=e.renderer;this._showRoot=void 0===e.showRoot?!1:e.showRoot;this._indent=void 0===e.indent?16:e.indent;this._onCollapse=e.onCollapse;
this._labelColumnIndex=void 0===e.labelColumnIndex?0:e.labelColumnIndex;this._id=void 0===e.id?"treetable":e.id;this._tableStyle=e.tableStyle;this._tableElement=e.tableElement||"table";this._tableBodyElement=e.tableBodyElement||"tbody";this._tableRowElement=e.tableRowElement||"tr";this._root=this._treeModel.getRoot(function(b){g._showRoot?(b._depth=0,g._generate([b],0)):g._treeModel.getChildren(b,function(b){g.destroyed||g._generate(b,0)})})},destroy:function(){this.destroyed=!0},_generate:function(e,
d){m.empty(this._parent);var g=document.createElement("div");this._renderer.wrapperCallback&&this._renderer.wrapperCallback(g);var b=document.createElement(this._tableElement);this._renderer.tableCallback&&this._renderer.tableCallback(b);b.id=this._id;this._tableStyle&&b.classList.add(this._tableStyle);this._renderer.initTable(b,this);this._bodyElement=document.createElement(this._tableBodyElement);this._renderer.bodyCallback&&this._renderer.bodyCallback(this._bodyElement);this._bodyElement.id=this._id+
"tbody";0===e.length?this._renderer.emptyCallback&&this._renderer.emptyCallback(this._bodyElement):this._generateChildren(e,d);b.appendChild(this._bodyElement);g.appendChild(b);this._parent.appendChild(g);this._rowsChanged();this._onComplete&&this._onComplete(this)},_generateChildren:function(e,d,g){for(var b=0;b<e.length;b++){var f=document.createElement(this._tableRowElement);f.id=this._treeModel.getId(e[b]);f._depth=d;f._item=e[b];this._renderer.render(e[b],f);f.childNodes[this._labelColumnIndex].style.paddingLeft=
this._indent*d+"px";this._renderer.rowCallback&&this._renderer.rowCallback(f,e[b]);g?(this._bodyElement.insertBefore(f,g.nextSibling),g&&(g=f)):this._bodyElement.appendChild(f)}},_rowsChanged:function(){this._renderer.rowsChanged&&this._renderer.rowsChanged()},getSelected:function(){return this._renderer.getSelected()},refresh:function(e,d,g){var b=this._treeModel.getId(e),f;if(b===this._id)this._removeChildRows(b),this._generateChildren(d,0),this._rowsChanged();else{var a=m.node(b);a?(a._item=e,
a&&(g||a._expanded)?(this._removeChildRows(b),d?(a._expanded=!0,this._renderer.updateExpandVisuals(a,!0),this._generateChildren(d,a._depth+1,a),this._rowsChanged()):(f=this,this._renderer.updateExpandVisuals(a,"progress"),d=this._treeModel.getChildren(a._item,function(b){f.destroyed||(f._renderer.updateExpandVisuals(a,!0),a._expanded||(a._expanded=!0,f._generateChildren(b,a._depth+1,a),f._rowsChanged()))}))):this._renderer.updateExpandVisuals(a,!1)):console.log(k["could not find table row "]+b)}},
getItem:function(e){var d=m.node(e);return d&&d._item?d._item:e},toggle:function(e){var d=m.node(e);d&&(d._expanded?this.collapse(e):this.expand(e))},isExpanded:function(e){e="string"===typeof e?e:this._treeModel.getId(e);return(e=m.node(e))?e._expanded:!1},expand:function(e,d,g){e="string"===typeof e?e:this._treeModel.getId(e);var b=m.node(e);if(b){var f=this;b._expanded?d&&d.apply(f,g):(this._renderer.updateExpandVisuals(b,"progress"),this._treeModel.getChildren(b._item,function(a){f.destroyed||
(f._renderer.updateExpandVisuals(b,!0),b._expanded||(b._expanded=!0,f._generateChildren(a,b._depth+1,b),f._rowsChanged()),d&&d.apply(f,g))}))}},_removeChildRows:function(e){for(var d=e===this._id,g=!1,b=-1,f=[],a=m.$$array(".treeTableRow",this._parent),l=0;l<a.length;l++){var c=a[l];if(g)break;d?c._depth>b?f.push(c):g=!0:c.id===e&&(d=!0,b=c._depth)}for(e=0;e<f.length;e++)d=f[e],d.parentNode.removeChild(d)},collapse:function(e){e="string"===typeof e?e:this._treeModel.getId(e);var d=m.node(e);if(d){if(!d._expanded)return;
d._expanded=!1;this._renderer.updateExpandVisuals(d,!1);this._removeChildRows(e);this._rowsChanged()}this._onCollapse&&this._onCollapse(d._item)},getIndent:function(){return this._indent}};g.prototype.constructor=g;return{TableTree:g}});
define("orion/treeModelIterator",[],function(){var k={};k.TreeModelIterator=function(){function k(g,e){this.firstLevelChildren=g;this.reset();this._init(e)}k.prototype={_init:function(g){g&&(this.isExpanded=g.isExpanded,this.isExpandable=g.isExpandable,this.forceExpandFunc=g.forceExpandFunc,this.getChildrenFunc=g.getChildrenFunc)},topLevel:function(g){return g.parent?g.parent===this.root:!0},_getChildren:function(g){return"function"===typeof this.getChildrenFunc?this.getChildrenFunc(g):g?g.children:
null},_expanded:function(g){if(!g)return!0;var e=this._getChildren(g),e=e&&0<e.length;this.isExpanded&&e&&(e=this.isExpanded(g));return e},_expandable:function(g){return!g?!0:this.isExpandable?this.isExpandable(g):!1},_diveIn:function(g){return this._expanded(g)?(g=this._getChildren(g),this.setCursor(g[0]),this.cursor()):null},_drillToLast:function(g){return this._expanded(g)?(g=this._getChildren(g),this._drillToLast(g[g.length-1])):g},_forward:function(g){if(!this._cursor)return null;var e=this._diveIn(this._cursor);
if(!e){if(g&&this._expandable(this._cursor)&&this.forceExpandFunc){var d=this;return this.forceExpandFunc(this._cursor,"first",function(e){e&&d.setCursor(e)})}(e=this._findSibling(this._cursor,!0))&&this.setCursor(e)}return e},_backward:function(g){if(!this._cursor)return null;var e=this._findSibling(this._cursor,!1);e&&e!==this._cursor.parent&&(e=this._drillToLast(e));if(g&&e&&this._expandable(e)&&this.forceExpandFunc&&e!==this._cursor.parent){var d=this;return this.forceExpandFunc(e,"last",function(e){e&&
d.setCursor(e)})}e&&this.setCursor(e);return e},_findSibling:function(g,e){for(var d=this.topLevel(g),k=this._getChildren(g.parent),k=d?this.firstLevelChildren:k,b=0;b<k.length;b++)if(k[b]===g)return 0===b&&!e?d?null:g.parent:b===k.length-1&&e?d?null:this._findSibling(g.parent,e):e?k[b+1]:k[b-1];return null},_inParentChain:function(g,e){for(var d=g.parent;d;){if(d===e)return!0;d=d.parent}return!1},_getTopLevelParent:function(g){if(this.topLevel(g))return g;for(g=g.parent;g;){if(this.topLevel(g))return g;
g=g.parent}return null},_onCollapse:function(g){return this._expanded(g.parent)?g:this._onCollapse(g.parent)},_scan:function(g,e,d){this.setCursor(e);var k=[];for(k.push(e);;){if(this.iterate(g))k.push(this.cursor());else break;if(d===this.cursor())return k}return null},setCursor:function(g){this._prevCursor=this._cursor;this._cursor=g},setTree:function(g){this.firstLevelChildren=g;0<this.firstLevelChildren.length&&(this.root=this.firstLevelChildren[0].parent)},scan:function(g,e){var d=this.cursor(),
k=this._scan(!0,g,e);k||(k=this._scan(!1,g,e));this.setCursor(d);return k},iterate:function(g,e){return g?this._forward(e):this._backward(e)},iterateOnTop:function(g,e){var d=this._findSibling(this._getTopLevelParent(this.cursor()),g);d?this.setCursor(d):e&&0<this.firstLevelChildren.length&&this.setCursor(g?this.firstLevelChildren[0]:this.firstLevelChildren[this.firstLevelChildren.length-1])},collapse:function(g){return!this._cursor?null:this._inParentChain(this._cursor,g)?(this.setCursor(g),this._cursor):
null},reset:function(){this.root=this._prevCursor=this._cursor=null;0<this.firstLevelChildren.length&&(this._cursor=this.firstLevelChildren[0],this.root=this.firstLevelChildren[0].parent)},cursorMoved:function(){return this._cursor!==this._prevCursor},cursor:function(){return this._cursor},prevCursor:function(){return this._prevCursor}};return k}();return k});
define("orion/explorers/explorerNavHandler",["orion/webui/littlelib","orion/treeModelIterator","orion/uiUtils"],function(k,m,g){var e={},d=-1!==navigator.userAgent.indexOf("iPad"),n=-1!==window.navigator.platform.indexOf("Mac");e.ExplorerNavHandler=function(){function b(b,a,d){this.explorer=b;this.model=this.explorer.model;this._navDict=a;this._listeners=[];this._selections=[];this._currentColumn=0;b=this._getEventListeningDiv();b.tabIndex=0;b.classList.add("selectionModelContainer");var c=this;this._modelIterator=
new m.TreeModelIterator([],{isExpanded:this.isExpanded.bind(this),getChildrenFunc:d.getChildrenFunc,isExpandable:this.explorer.renderer.isExpandable?function(a){return c.explorer.renderer.isExpandable(a)}:function(a){return c.isExpandable(a)},forceExpandFunc:this.explorer.forceExpandFunc?function(a,b,d){return c.explorer.forceExpandFunc(a,b,d)}:void 0});this._init(d);(!d||!1!==d.setFocus)&&b.focus();d=function(a){if(g.isFormElement(a.target)||c.explorer.preventDefaultFunc&&c.explorer.preventDefaultFunc(a,
c._modelIterator.cursor()))return!0;if(a.keyCode===k.KEY.DOWN)return c.onDownArrow(a);if(a.keyCode===k.KEY.UP)return c.onUpArrow(a);if(a.keyCode===k.KEY.RIGHT)return c.onRightArrow(a);if(a.keyCode===k.KEY.LEFT)return c.onLeftArrow(a);if(a.keyCode===k.KEY.SPACE)return c.onSpace(a);if(a.keyCode===k.KEY.ENTER)return c.onEnter(a)};b.addEventListener("keydown",d,!1);this._listeners.push({type:"keydown",listener:d});d=function(a){if(c.explorer.onFocus)c.explorer.onFocus(!1);else c.toggleCursor(null,!1)};
b.addEventListener("blur",d,!1);this._listeners.push({type:"blur",listener:d});d=function(a){if(c.explorer.onFocus)c.explorer.onFocus(!0);else c.toggleCursor(null,!0)};b.addEventListener("focus",d,!1);this._listeners.push({type:"focus",listener:d});this._parentDiv=b}b.prototype={destroy:function(){this._parentDiv.classList.remove("selectionModelContainer");this.removeListeners()},_init:function(b){this._linearGridMove=!1;b&&(this._selectionPolicy=b.selectionPolicy,this.gridClickSelectionPolicy=b.gridClickSelectionPolicy||
"none",this.preventDefaultFunc=b.preventDefaultFunc,this.postDefaultFunc=b.postDefaultFunc)},_ctrlKeyOn:function(b){return n?b.metaKey:b.ctrlKey},removeListeners:function(){if(this._listeners)for(var b=0;b<this._listeners.length;b++)this._parentDiv.removeEventListener(this._listeners[b].type,this._listeners[b].listener,!1)},focus:function(){var b=this._getEventListeningDiv();b&&b.focus()},_getEventListeningDiv:function(b){return this.explorer.keyEventListeningDiv&&"function"===typeof this.explorer.keyEventListeningDiv?
this.explorer.keyEventListeningDiv(b):k.node(this.explorer._parentId)},isExpandable:function(b){return!b?!1:k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)))?!0:!1},isExpanded:function(b){return!b?!1:this.explorer.myTree.isExpanded(this.model.getId(b))},refreshSelection:function(b,a){var d=this;this.explorer.selection&&this.explorer.selection.getSelections(function(c){d._clearSelection(a);for(var e=0;e<c.length;e++)d._selections.push(c[e]);0<d._selections.length?d.cursorOn(d._selections[0],
!0,!1,b):d.cursorOn(null,!1,!1,b);d._shiftSelectionAnchor&&0<=d._inSelection(d._shiftSelectionAnchor)||(d._shiftSelectionAnchor=null)})},refreshModel:function(b,a,d,c){this._currentColumn=0;this.topIterationNodes=[];this.model=a;this._navDict=b;this.model.getTopIterationNodes?this.topIterationNodes=this.model.getTopIterationNodes():d&&(this.topIterationNodes=d);this._modelIterator.setTree(this.topIterationNodes);!c&&this.explorer.selection&&(this.toggleCursor(this._modelIterator.cursor(),!1),this._modelIterator.reset());
this.refreshSelection(!0)},getTopLevelNodes:function(){return this._modelIterator.firstLevelChildren},_inSelection:function(b){b=this.model.getId(b);for(var a=0;a<this._selections.length;a++)if(b===this.model.getId(this._selections[a]))return a;return-1},_clearSelection:function(b){if(b)for(b=0;b<this._selections.length;b++)this._checkRow(this._selections[b],!0);this._selections=[]},getSelectionPolicy:function(){return this._selectionPolicy},setSelectionPolicy:function(b){this._selectionPolicy!==
b&&(("readonlySelection"===this._selectionPolicy||"readonlySelection"===b)&&this._toggleSelectionClass("disabledRow","readonlySelection"===b),this._selectionPolicy=b,"cursorOnly"===this._selectionPolicy&&this._clearSelection(!0))},setSelection:function(b,a,d){"readonlySelection"!==this._selectionPolicy&&("cursorOnly"===this._selectionPolicy?a&&this.explorer.renderer._useCheckboxSelection&&this._checkRow(b,!0):this._isRowSelectable(b)&&(!a||"singleSelection"===this._selectionPolicy?(this._clearSelection(!0),
this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b):(a=this._inSelection(b),0<=a?(this._checkRow(b,!0),this._selections.splice(a,1)):(this._checkRow(b,!1),this._selections.push(b),this._lastSelection=b)),d&&(this._shiftSelectionAnchor=this._lastSelection),this.explorer.selection&&(this.explorer.renderer.storeSelections(),this.explorer.selection.setSelections(this._selections))))},moveColumn:function(b,a){b||(b=this.currentModel());var d=this._getGridChildren(b);if(d&&1<d.length||
0===a&&d){0!==a&&this.toggleCursor(b,!1);var c=this._currentColumn,e=!0,c=c+a;0>c?(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!1)?b=this.currentModel():e=!1),c=e?d.length-1:this._currentColumn):c>=d.length&&(this._linearGridMove&&0!==a&&(this._modelIterator.iterate(!0)?b=this.currentModel():e=!1),c=e?0:this._currentColumn);this._currentColumn=c;0!==a&&this.toggleCursor(b,!0);return!0}return!1},_getGridChildren:function(b){return this._navDict?this._navDict.getGridNavHolder(b):null},
getCurrentGrid:function(b){b||(b=this.currentModel());return(b=this._getGridChildren(b))&&0<b.length?b[this._currentColumn]:null},getAriaContainerElement:function(b){for(var a=this._parentDiv,d;b&&b!==a&&"grid"!==(d=b.getAttribute("role"))&&"tree"!==d&&"treegrid"!==d;)b=b.parentNode;return b===a?null:b},toggleCursor:function(b,a){var d=this.getRowDiv(b),c=this.getCurrentGrid(b);c?(d&&(a?d.classList.add("treeIterationCursorRow"):d.classList.remove("treeIterationCursorRow")),c.domNode&&(d=this.getAriaContainerElement(c.domNode),
a?(c.domNode.classList.add("treeIterationCursor"),d&&d.setAttribute("aria-activedescendant",c.domNode.id)):c.domNode.classList.remove("treeIterationCursor"))):d&&(a?d.classList.add("treeIterationCursorRow_Dotted"):d.classList.remove("treeIterationCursorRow_Dotted"))},currentModel:function(){return this._modelIterator.cursor()},cursorOn:function(b,a,d,c){var e,g;if(b||a){if(g===this._modelIterator.cursor())return;e=this._modelIterator.cursor();g=b;this._modelIterator.setCursor(g)}else e=this._modelIterator.prevCursor(),
g=this._modelIterator.cursor();if(e!==g||a)if(this.toggleCursor(e,!1),!a||g){this.moveColumn(null,0);this.toggleCursor(g,!0);if((b=this.getRowDiv())&&!c){c=b.parentNode;for(a=document.documentElement;c&&c!==a;){var k=window.getComputedStyle(c,null);if(!k)break;k=k.getPropertyValue("overflow-y");if("auto"===k||"scroll"===k)break;c=c.parentNode}c&&(a=!0,b.offsetTop<=c.scrollTop?(a=!1,void 0===d&&(d=!1)):b.offsetTop+b.offsetHeight>=c.scrollTop+c.clientHeight&&(a=!1,void 0===d&&(d=!0)),a||b.scrollIntoView(!d))}if(this.explorer.onCursorChanged)this.explorer.onCursorChanged(e,
g)}},getSelection:function(){return this._selections},getSelectionIds:function(){for(var b=[],a=0;a<this._selections.length;a++)b.push(this.model.getId(this._selections[a]));return b},getRowDiv:function(b){b=b?b:this._modelIterator.cursor();if(!b)return null;b=this.model.getId(b);var a=this._navDict.getValue(b);return a&&a.rowDomNode?a.rowDomNode:k.node(b)},iterate:function(b,a,d,c){var e=null;if(this.topIterationNodes&&0!==this.topIterationNodes.length)if(c){c=this.currentModel();for((e=this._modelIterator.iterate(b,
a))&&this._setCursorOnItem(b,d);e&&e.isNotSelectable;)(e=this._modelIterator.iterate(b,a))&&this._setCursorOnItem(b,d);e||(this.cursorOn(c,!0,!1,!0),this._setCursorOnItem(b,d))}else this._modelIterator.iterate(b,a)&&this._setCursorOnItem(b,d)},_toggleSelectionClass:function(b,a){this._selections.forEach(function(d){(d=this.getRowDiv(d))&&(a?d.classList.add(b):d.classList.remove(b))}.bind(this))},_setCursorOnItem:function(b,a){this.cursorOn(null,!1,b);if(a){var d=this._inSelection(this._modelIterator.prevCursor()),
c=this._inSelection(this._modelIterator.cursor());0<=d&&0<=c?this.setSelection(this._modelIterator.prevCursor(),!0):this.setSelection(this.currentModel(),!0)}},_checkRow:function(b,a){if(this.explorer.renderer._useCheckboxSelection&&"singleSelection"!==this._selectionPolicy){var d=this.getRowDiv(b);if(d){var c=k.node(this.explorer.renderer.getCheckBoxId(d.id)),e=a?!c.checked:!0;if(e!==c.checked)this.explorer.renderer.onCheck(d,c,e,!0)}}else this._select(b,a)},_select:function(b,a){b||(b=this._modelIterator.cursor());
var d=this.getRowDiv(b);d&&(0>this._inSelection(b)?d.classList.add("checkedRow"):d.classList.remove("checkedRow"))},_onModelGrid:function(b,a){var d=this._getGridChildren(b);if(d)for(var c=0;c<d.length;c++)if(a.target===d[c].domNode)return!0;return!1},onClick:function(b,a){if("readonlySelection"===this._selectionPolicy||this.isDisabled(this.getRowDiv(b)))k.stop(a);else{var e=k.node(this.explorer.renderer.expandCollapseImageId(this.model.getId(b)));if(a.target!==e&&!("none"===this.gridClickSelectionPolicy&&
this._onModelGrid(b,a)))if(this.cursorOn(b,!0,!1,!0),d)this.setSelection(b,!0);else if(this._ctrlKeyOn(a))this.setSelection(b,!0,!0);else if(a.shiftKey&&this._shiftSelectionAnchor){if(e=this._modelIterator.scan(this._shiftSelectionAnchor,b)){this._clearSelection(!0);for(var c=0;c<e.length;c++)this.setSelection(e[c],!0)}}else this.setSelection(b,!1,!0)}},onCollapse:function(b){this._modelIterator.collapse(b)&&this.cursorOn()},onUpArrow:function(b){this.iterate(!1,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&
!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},onDownArrow:function(b){this.iterate(!0,!1,b.shiftKey,!0);!this._ctrlKeyOn(b)&&!b.shiftKey&&this.setSelection(this.currentModel(),!1,!0);b.preventDefault();return!1},_shouldMoveColumn:function(b){var a=this.currentModel(),d=this._getGridChildren(a);return d&&1<d.length?this.isExpandable(a)?this._ctrlKeyOn(b):!0:!1},onLeftArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,-1),b.preventDefault(),
!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&this.isExpanded(a))return this.explorer.myTree.collapse(a),b.preventDefault(),!0;this._modelIterator.topLevel(a)?this.explorer.scopeUp&&"function"===typeof this.explorer.scopeUp&&this.explorer.scopeUp():(this.cursorOn(a.parent),this.setSelection(a.parent,!1,!0))},onRightArrow:function(b){if(this._shouldMoveColumn(b))return this.moveColumn(null,1),b.preventDefault(),!0;var a=this._modelIterator.cursor();if(!a)return!1;if(this.isExpandable(a)&&
!this.isExpanded(a))return this.explorer.myTree.expand(a),this.explorer.postUserExpand&&this.explorer.postUserExpand(this.model.getId(a)),b.preventDefault(),!1},_isRowSelectable:function(b){return this.explorer.isRowSelectable?this.explorer.isRowSelectable(b):!0},onSpace:function(b){this.setSelection(this.currentModel(),!0,!0);b.preventDefault()},onEnter:function(b){var a=this.getCurrentGrid(this._modelIterator.cursor());if(a)if(a.widget)if("function"===typeof a.onClick)a.onClick();else"function"===
typeof a.widget.focus&&a.widget.focus();else{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,this._ctrlKeyOn(b),!1,!1,!1,0,null);a.domNode.dispatchEvent(d)}else if(a=this._modelIterator.cursor())if(this.explorer.renderer.getRowActionElement&&(d=this.explorer.renderer.getRowActionElement(this.model.getId(a)),d.href&&(this._ctrlKeyOn(b)?window.open(d.href):window.location.href=d.href)),this.explorer.renderer.performRowAction)return this.explorer.renderer.performRowAction(b,
a),b.preventDefault(),!1},setIsNotSelectable:function(b,a){b.isNotSelectable=a},disableItem:function(b){var a=this.getRowDiv(b);this.isExpandable(b)&&this.isExpanded(b)&&(this._modelIterator.collapse(b),this.explorer.myTree.toggle(a.id));a.classList.remove("checkedRow");a.classList.add("disabledNavRow");this.setIsNotSelectable(b,!0)},isDisabled:function(b){return b.classList.contains("disabledNavRow")},enableItem:function(b){var a=this.getRowDiv(b);a&&(a.classList.remove("disabledNavRow"),this.setIsNotSelectable(b,
!1))}};return b}();e.ExplorerNavDict=function(){function b(b){this._dict={};this._model=b}b.prototype={addRow:function(b,a){var d=this._model.getId(b);this._dict[d]={model:b,rowDomNode:a}},getValue:function(b){return this._dict[b]},getGridNavHolder:function(b,a){if(!b)return null;var d=this._model.getId(b);return this._dict[d]?(!this._dict[d].gridChildren&&a&&(this._dict[d].gridChildren=[]),this._dict[d].gridChildren):null},initGridNavHolder:function(b){if(!b)return null;b=this._model.getId(b);this._dict[b]&&
(this._dict[b].gridChildren=null)}};return b}();return e});
define("orion/explorers/explorer","i18n!orion/nls/messages require orion/webui/littlelib orion/webui/treetable orion/explorers/explorerNavHandler orion/commands".split(" "),function(k,m,g,e,d,n){var b={};b.Explorer=function(){function b(a,d,c,e){this.registry=a;this.renderer=c;this.selection=d;this.commandService=e;this.renderer&&(this.renderer.explorer=this);this.myTree=null}b.prototype={destroy:function(){this._navHandler&&this._navHandler.destroy();this.model&&this.model.destroy();this.myTree&&
this.myTree.destroy();this.destroyed=!0},changedItem:function(a,b){this.myTree&&this.myTree.refresh.bind(this.myTree)(a,b,!0)},updateCommands:function(a){this.myTree&&this.myTree._renderer.updateCommands.bind(this.myTree._renderer)(a)},makeNewItemPlaceHolder:function(a,b,c,d){a=this.getRow(a);if(c)return a=a.childNodes[c],a.appendChild(document.createElement("br")),d=document.createElement("span"),d.id=b+"placeHolderRow",a.appendChild(d),{tempNode:d,refNode:d};if(a){var e=document.createElement("tr");
e.id=b+"placeHolderRow";c=document.createElement("td");c.id=b+"placeHolderCol";e.appendChild(c);d?(a.parentNode.insertBefore(e,a.nextSibling),a=parseInt(a.firstChild.style.paddingLeft),c.style.paddingLeft=this.myTree.getIndent()+a+"px"):a.appendChild(e);d=g.node(b+"placeHolderRow");a=g.node(b+"placeHolderCol");if(d&&a)return{tempNode:d,refNode:a}}return null},getRow:function(a){if(a=this.model.getId(a))return g.node(a)},collapseAll:function(){for(var a=this._navHandler.getTopLevelNodes(),b=0;b<a.length;b++)this.myTree.collapse(a[b])},
expandAll:function(a){if(a)this._expandRecursively(a);else if(this._navHandler){a=this._navHandler.getTopLevelNodes();for(var b=0;b<a.length;b++)this._expandRecursively(a[b])}},_expandRecursively:function(a){if(this._navHandler&&this._navHandler.isExpandable(a)){var b=this;this.myTree.expand(a,function(){b.model.getChildren(a,function(a){if(!(void 0===a||null===a))for(var d=a.length,e=0;e<d;e++)b._expandRecursively(a[e])})})}},createTree:function(a,b,c){a="string"===typeof a?a:a.id||a;this.selection&&
this.selection.setSelections([]);this.getNavHandler()&&this.getNavHandler()._clearSelection();var f=a+"innerTree",k=g.node(f);k&&g.empty(k);b&&(b.rootId=f);this.model=b;this._parentId=a;this._treeOptions=c;if(!c||c&&!c.noSelection)this.selectionPolicy=c?c.selectionPolicy:"",this._navDict=new d.ExplorerNavDict(this.model);this.myTree=new e.TableTree({id:f,model:b,parent:a,onComplete:c?c.onComplete:void 0,labelColumnIndex:this.renderer.getLabelColumnIndex(),renderer:this.renderer,showRoot:c?!!c.showRoot:
!1,indent:c?c.indent:void 0,onCollapse:c?c.onCollapse:void 0,navHandlerFactory:c?c.navHandlerFactory:void 0,tableElement:c?c.tableElement:void 0,tableBodyElement:c?c.tableBodyElement:void 0,tableRowElement:c?c.tableRowElement:void 0});this.renderer._initializeUIState();"cursorOnly"===this.selectionPolicy&&this.initNavHandler()},getNavHandler:function(){return this._navHandler},getNavDict:function(){return this._navDict},refreshSelection:function(){if(this.selection){var a=this.getNavHandler(),b=[];
if(a&&this.getNavDict())for(var c=a.getSelection(),d=0;d<c.length;d++){var e=a.getRowDiv(c[d]);e&&e.parentNode&&(e=this.getNavDict().getValue(this.model.getId(c[d])),e.model&&b.push(e.model))}this.selection.setSelections(b)}},getRootPath:function(){return this.model&&this.model.root?this.model.root.Location:null},initNavHandler:function(){var a=this._treeOptions;if(!a||a&&!a.noSelection){this.getNavHandler()||(this._navHandler=a&&a.navHandlerFactory&&"function"===typeof a.navHandlerFactory.createNavHandler?
a.navHandlerFactory.createNavHandler(this,this._navDict,a):new d.ExplorerNavHandler(this,this._navDict,{getChildrenFunc:a?a.getChildrenFunc:null,setFocus:a&&a.setFocus,selectionPolicy:a?a.selectionPolicy:null}));var b=this;this.model.getRoot(function(c){c instanceof Array?b.getNavHandler().refreshModel(b.getNavDict(),b.model,c):c.children&&c.children instanceof Array&&b.getNavHandler().refreshModel(b.getNavDict(),b.model,c.children);a&&a.setFocus&&b.getNavHandler().cursorOn(null,!1,!1,!0)})}},_lastHash:null,
checkbox:!1};return b}();b.createExplorerCommands=function(b,a){function d(b){return"function"===typeof b.getItemCount&&0<b.getItemCount()?a?a(b):!0:!1}var c=new n.Command({tooltip:k["Expand all"],imageClass:"core-sprite-expandAll",id:"orion.explorer.expandAll",groupId:"orion.explorerGroup",visibleWhen:function(a){return d(a)},callback:function(a){a.items.expandAll()}}),e=new n.Command({tooltip:k["Collapse all"],imageClass:"core-sprite-collapseAll",id:"orion.explorer.collapseAll",groupId:"orion.explorerGroup",
visibleWhen:function(a){return d(a)},callback:function(a){a.items.collapseAll()}});b.addCommand(c);b.addCommand(e)};b.ExplorerModel=function(){function b(a,d,c){this.rootPath=a;this.fetchItems=d;this.idPrefix=c||""}b.prototype={destroy:function(){this.destroyed=!0},getRoot:function(a){var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;a(c)})},getChildren:function(a,b){a.Children?b(a.Children):a.ChildrenLocation?this.fetchItems(a.ChildrenLocation).then(function(c){a.Children=c;b(c)}):
b([])},getId:function(a){if(a.Location===this.root.Location)return this.rootId;a=a.Location.replace(/[\\\/]/g,"");for(var b=this.idPrefix,c=0;c<a.length;c++)b=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(c):b+a[c];return b}};return b}();b.ExplorerFlatModel=function(){function d(a,b,c){this.rootPath=a;this.fetchItems=b;this.root=c}d.prototype=new b.ExplorerModel;d.prototype.getRoot=function(a){if(this.root)a(this.root);else{var b=this;this.fetchItems(this.rootPath).then(function(c){b.root=c;
a(c)})}};d.prototype.getChildren=function(a,b){a===this.root?b(this.root):b([])};return d}();b.ExplorerRenderer=function(){function b(a,d){this.explorer=d;this._init(a);this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._progressImageClass="core-sprite-progress";this._twistieSpriteClass="modelDecorationSprite"}b.prototype={_init:function(a){a&&(this._useCheckboxSelection=void 0===a.checkbox?!1:a.checkbox,this.selectionPolicy=a.singleSelection?"singleSelection":
"",this._cachePrefix=a.cachePrefix,this.getCheckedFunc=a.getCheckedFunc,this.onCheckedFunc=a.onCheckedFunc,this._highlightSelection=!0,this._treeTableClass=a.treeTableClass||"treetable",!1===a.highlightSelection&&(this._highlightSelection=!1),this.actionScopeId||(this.actionScopeId=a.actionScopeId),this.commandService||(this.commandService=a.commandService))},getLabelColumnIndex:function(){return this.explorer.checkbox?1:0},initTable:function(a,b){this.tableTree=b;this.tableNode=a;g.empty(a);this._treeTableClass&&
a.classList.add(this._treeTableClass);this.renderTableHeader(a)},getActionsColumn:function(a,b,c,d,e){c=c||"tool";var f=document.createElement("td");f.id=b.id+"actionswrapper";d&&f.classList.add(d);this.actionScopeId&&this.commandService?this.commandService.renderCommands(this.actionScopeId,f,a,this.explorer,c,null,e&&this.explorer.getNavDict()?this.explorer.getNavDict().getGridNavHolder(a,!0):null):window.console.log("Warning, no command service or action scope was specified.  No commands rendered.");
return f},initCheckboxColumn:function(a){if(this._useCheckboxSelection)return document.createElement("th")},getCheckboxColumn:function(a,b){if(this._useCheckboxSelection){var c=document.createElement("td"),d=document.createElement("span");d.id=this.getCheckBoxId(b.id);d.classList.add("core-sprite-check");d.classList.add("selectionCheckmarkSprite");d.rowId=b.id;this.getCheckedFunc&&(d.checked=this.getCheckedFunc(a),d.checked?(this._highlightSelection&&b.classList.add("checkedRow"),d.classList.add("core-sprite-check_on")):
(this._highlightSelection&&b.classList.remove("checkedRow"),d.classList.remove("core-sprite-check_on")));c.appendChild(d);var e=this;d.addEventListener("click",function(a){e.onCheck(b,a.target,a.target.checked?!1:!0,!0)},!1);return c}},getCheckBoxId:function(a){return a+"selectedState"},onCheck:function(a,b,c,d,e){(b.checked=c)?b.classList.add("core-sprite-check_on"):b.classList.remove("core-sprite-check_on");if(this.onCheckedFunc)this.onCheckedFunc(b.rowId,c,d);this.explorer.getNavHandler()&&e&&
this.explorer.getNavHandler().setSelection(this.explorer.getNavDict().getValue(a.id).model,!0)},storeSelections:function(){if(this.explorer.getNavHandler()){var a=this.explorer.getNavHandler().getSelectionIds(),b=this._getUIStatePreferencePath();b&&window.sessionStorage&&(window.sessionStorage[b+"selection"]=JSON.stringify(a))}},_restoreSelections:function(a){var b=this.explorer.getNavDict(),c=this.explorer.getNavHandler();if(c&&b&&"cursorOnly"!==c.getSelectionPolicy()&&(a=window.sessionStorage[a+
"selection"],"string"===typeof a&&(a=0<a.length?JSON.parse(a):null),a)){for(var d=[],c=0;c<a.length;c++){var e=b.getValue(a[c]);if(e&&e.rowDomNode&&e.model&&(d.push(e.model),this._highlightSelection&&e.rowDomNode.classList.add("checkedRow"),e=g.node(this.getCheckBoxId(e.rowDomNode.id))))e.checked=!0,e.classList.add("core-sprite-check_on")}this.explorer.selection&&(this.explorer.selection.setSelections(d),this.explorer.getNavHandler()&&this.explorer.getNavHandler().refreshSelection())}},_storeExpansions:function(a){window.sessionStorage[a+
"expanded"]=JSON.stringify(this._expanded)},_restoreExpansions:function(a){var b=!1,c=window.sessionStorage[a+"expanded"];"string"===typeof c&&(c=0<c.length?JSON.parse(c):null);var d;if(c)for(d=0;d<c.length;d++)if(g.node(c[d])){this._expanded.push(c[d]);var e=this;this.tableTree.expand(c[d],function(){e._restoreSelections(a)});b=!0}return!b},_getUIStatePreferencePath:function(){if(this.explorer){var a=this.explorer.getRootPath();if(this._cachePrefix&&a)return a=a.replace(/[^\.\:\-\_0-9A-Za-z]/g,""),
"/"+this._cachePrefix+"/"+a+"/uiState"}return null},expandCollapseImageId:function(a){return a+"__expand"},updateExpandVisuals:function(a,b){var c=g.node(this.expandCollapseImageId(a.id));c&&(c.classList.remove(this._expandImageClass),c.classList.remove(this._collapseImageClass),c.classList.remove(this._progressImageClass),c.classList.add("progress"===b?this._progressImageClass:b?this._expandImageClass:this._collapseImageClass))},getExpandImage:function(a,b,c,d){var e=document.createElement("span");
e.id=this.expandCollapseImageId(a.id);b.appendChild(e);e.classList.add(this._twistieSpriteClass);e.classList.add(this._collapseImageClass);if(c){var f=document.createElement("span");b.appendChild(f);f.classList.add(d||"imageSprite");f.classList.add(c)}var g=this;e.onclick=function(b){if(!g.explorer.getNavHandler().isDisabled(a)){g.tableTree.toggle(a.id);if(g.tableTree.isExpanded(a.id))g._expanded.push(a.id),g.explorer.postUserExpand&&g.explorer.postUserExpand(a.id);else for(var c in g._expanded)if(g._expanded[c]===
a.id){g._expanded.splice(c,1);break}(b=g._getUIStatePreferencePath())&&window.sessionStorage&&g._storeExpansions(b)}};return e},render:function(a,b){b.classList.add("navRow");this.renderRow(a,b)},rowsChanged:function(){"cursorOnly"!==this.explorer.selectionPolicy&&(this.explorer.refreshSelection(),this.explorer.initNavHandler());(g.$(".sectionTreeTable",this.tableNode.parentNode)||g.$(".treetable",this.tableNode.parentNode))&&g.$$array(".treeTableRow",this.tableNode).forEach(function(a,b){var c=!(b%
2)?"darkSectionTreeTableRow":"lightSectionTreeTableRow",d="darkSectionTreeTableRow"===c?"lightSectionTreeTableRow":"darkSectionTreeTableRow";a.classList.add(c);a.classList.remove(d)})},updateCommands:function(){if(this.commandService)for(var a=g.$$array(".treeTableRow"),b=0;b<a.length;b++){var c=a[b],d=g.node(c.id+"actionswrapper");this.commandService.destroy(d);this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,d,c._item,this.explorer,"tool")}},_initializeUIState:function(){this._expanded=
[];var a=this._getUIStatePreferencePath();a&&window.sessionStorage&&this._restoreExpansions(a)&&this._restoreSelections(a)}};return b}();b.SelectionRenderer=function(){function d(a,b){this._init(a);this.explorer=b}d.prototype=new b.ExplorerRenderer;d.prototype.renderTableHeader=function(a){var b=document.createElement("thead"),c=document.createElement("tr");b.classList.add("navTableHeading");this._useCheckboxSelection&&c.appendChild(this.initCheckboxColumn(a));for(var d=0,e=this.getCellHeaderElement(d);e;)0<
e.innerHTML.length&&e.classList.add("navColumn"),c.appendChild(e),e=this.getCellHeaderElement(++d);b.appendChild(c);0<d&&a.appendChild(b)};d.prototype.renderRow=function(a,b){b.verticalAlign="baseline";b.classList.add("treeTableRow");"cursorOnly"!==this.explorer.selectionPolicy&&b.classList.add("selectableNavRow");var c=this.explorer.getNavDict();if(c){c.addRow(a,b);var d=this;b.addEventListener("click",function(b){if(d.explorer.getNavHandler())d.explorer.getNavHandler().onClick(a,b)},!1)}if(c=this.getCheckboxColumn(a,
b))c.classList.add("checkColumn"),b.appendChild(c);for(var c=0,e=this.getCellElement(c,a,b);e;)b.appendChild(e),0===c?this.getPrimColumnStyle?e.classList.add(this.getPrimColumnStyle(a)):e.classList.add("navColumn"):this.getSecondaryColumnStyle?e.classList.add(this.getSecondaryColumnStyle()):e.classList.add("secondaryColumn"),e=this.getCellElement(++c,a,b)};d.prototype.getCellHeaderElement=function(a){};d.prototype.getCellElement=function(a,b,c){};return d}();b.SimpleFlatModel=function(){function d(a,
b,c){this.items=a;this.getKey=c;this.idPrefix=b;this.root={children:a}}d.prototype=new b.ExplorerModel;d.prototype.getRoot=function(a){a(this.root)};d.prototype.getId=function(a){a=this.getKey(a).replace(/[\\\/]/g,"");for(var b="",c=0;c<a.length;c++)b=a[c].match(/[^\.\:\-\_0-9A-Za-z]/g)?b+a.charCodeAt(c):b+a[c];return this.idPrefix+b};d.prototype.getChildren=function(a,b){a===this.root?b(this.items):b([])};return d}();return b});
define("orion/explorers/navigatorRenderer","i18n!orion/navigate/nls/messages orion/Deferred orion/explorers/explorer orion/explorers/navigationUtils orion/extensionCommands orion/objects orion/URITemplate orion/webui/littlelib".split(" "),function(k,m,g,e,d,n,b,f){function a(a){switch(a&&a.id){case "image/jpeg":case "image/png":case "image/gif":case "image/ico":case "image/tiff":case "image/svg":return!0}return!1}function l(c,e,f,g,k,l,v,E,z){e=n.clone(e);var w;if(e.Directory)w=document.createElement("a"),
w.className="navlinkonpage",w.href=!c?h:(new b(c+"#{,resource,params*}")).expand({resource:e.ChildrenLocation}),e.Name&&w.appendChild(document.createTextNode(e.Name));else{k||(k=d.getOpenWithCommands(f));w=document.createElement("a");w.className="navlink targetSelector";l&&"object"===typeof l&&Object.keys(l).forEach(function(a){w[a]=l[a]});var A=null,C=null;if(A=E?E.holderDom:w)C=document.createElement("span"),C.className="core-sprite-file modelDecorationSprite thumbnail",A.appendChild(C);e.Name&&
w.appendChild(document.createTextNode(e.Name));var J=e.Location;v&&"object"===typeof v&&(e.params={},n.mixin(e.params,v));(c=d.getOpenWithCommand(f,e,k))&&(J=c.hrefCallback({items:e}));m.when(g.getFileContentType(e),function(b){if(A){var c=A,d=C;if(b){var f,h=b.imageClass,g=b.image;h?(f=document.createElement("span"),f.className+=h,f.classList.add("thumbnail")):g&&(f=document.createElement("img"),f.src=g,f.classList.add("thumbnail"));f&&c.replaceChild(f,d)}}w.href=J;z&&"function"===typeof z.updateFileNode&&
z.updateFileNode(e,w,a(b))})}w.addEventListener("click",function(){q=e}.bind(this),!1);return w}function c(a,b,c,d){this.explorer=b;this.commandService=c;this.contentTypeService=d;this.openWithCommands=null;this.actionScopeId=a.actionScopeId;this._init(a);this.target="_self"}var h=new b("#{,resource,params*}"),q;c.prototype=new g.SelectionRenderer;c.prototype.wrapperCallback=function(a){a.setAttribute("role","tree")};c.prototype.tableCallback=function(a){a.setAttribute("aria-label",k.Navigator);a.setAttribute("role",
"presentation")};c.prototype.rowCallback=function(a,b){a.setAttribute("role","treeitem")};c.prototype.emptyCallback=function(a){var b=document.createElement("tr"),c=document.createElement("td");c.colSpan=this.oneColumn?1:3;var d=document.createElement("div");d.classList.add("noFile");d.textContent=k.NoFile;var e=document.createElement("span");e.appendChild(document.createTextNode(k.File));f.processDOMNodes(d,[e]);c.appendChild(d);b.appendChild(c);a.appendChild(b)};c.prototype.getCellHeaderElement=
function(a){if(this.oneColumn&&0!==a)return null;switch(a){case 0:case 1:case 2:document.createElement("th").style.height="8px"}};c.prototype.setTarget=function(a){this.target=a};c.prototype.getFolderImage=function(a){if(!this.showFolderImage)return null;a=document.createElement("span");a.className="core-sprite-folder modelDecorationSprite";return a};c.prototype.createFolderNode=function(a){var b;this.showFolderLinks?(b=l(this.folderLink||"",a,this.commandService,this.contentTypeService),(a=this.getFolderImage(a))&&
b.insertBefore(a,b.firstChild)):(b=document.createElement("span"),b.textContent=a.Name);return b};c.prototype.updateFileNode=function(a,b,c){};c.prototype.showFolderLinks=!0;c.prototype.getCellElement=function(a,b,c){switch(a){case 0:a=document.createElement("td");var f=document.createElement("span");f.id=c.id+"MainCol";f.setAttribute("role","presentation");a.appendChild(f);a.setAttribute("role","presentation");f.className="mainNavColumn";var h;b.Directory?(this.getExpandImage(c,f),h=this.createFolderNode(b),
f.appendChild(h),this.explorer._makeDropTarget(b,h),this.explorer._makeDropTarget(b,c)):(this.openWithCommands||(this.openWithCommands=d.getOpenWithCommands(this.commandService)),h=l("",b,this.commandService,this.contentTypeService,this.openWithCommands,{target:this.target},null,null,this),f.appendChild(h));h&&(h.id=c.id+"NameLink",1===h.nodeType&&(e.addNavGrid(this.explorer.getNavDict(),b,h),h.setAttribute("role","link"),h.setAttribute("tabindex","-1")));this.actionScopeId&&this.commandService.renderCommands(this.actionScopeId,
f,b,this.explorer,"tool",null,!0);return a;case 1:if(this.oneColumn)return null;c=document.createElement("td");b.LocalTimeStamp&&(c.textContent=(new Date(b.LocalTimeStamp)).toLocaleString());return c;case 2:if(this.oneColumn)return null;c=document.createElement("td");!b.Directory&&"number"===typeof b.Length&&(b=parseInt(b.Length,10)/1024,c.textContent=Math.ceil(b).toLocaleString()+" KB");c.style.textAlign="right";return c}};c.prototype.constructor=c;return{NavigatorRenderer:c,isImage:a,getClickedItem:function(){return q},
createLink:l}});
define("orion/searchClient","i18n!orion/search/nls/messages require orion/webui/littlelib orion/i18nUtil orion/searchUtils orion/crawler/searchCrawler orion/explorers/navigatorRenderer orion/extensionCommands orion/Deferred".split(" "),function(k,m,g,e,d,n,b,f,a){function l(a,b){this.serviceRegistry=a;this.commandRegistry=b;this.openWithCommands=null}function c(a){this.registry=a.serviceRegistry;this._commandService=a.commandService;this._fileService=a.fileService;this.defaultRenderer=new l(this.registry,
this._commandService);this._fileService||console.error("No file service on search client")}l.prototype.makeRenderFunction=function(c,l,p,n,t){var r=this.serviceRegistry,u=this.commandRegistry;this.openWithCommands=this.openWithCommands||f.createOpenWithCommands(r,c,u);var D=this;return function(f,r,z,w){a.when(D.openWithCommands,function(a){if(z)g.empty(l),a=document.createElement("div"),a.appendChild(document.createTextNode(k["Search failed."])),l.appendChild(a),"function"===typeof n&&n(l);else{var D=
function(){function a(b,c){var d=c.folderName?c.folderName:c.path,e=document.createElement("span");e.id=d.replace(/[^a-zA-Z0-9_\.:\-]/g,"");e.appendChild(document.createTextNode(" - "+d+" "));b.appendChild(e)}var b={};return function(c,d){var e=d.name;if(b.hasOwnProperty(e)){a(c,d);var f=b[e];"function"===typeof f&&(b[e]=null,f())}else b[e]=function(){a(c,d)}}}(),J=!1;g.empty(l);if(f&&0<f.length){var G=document.createElement("table");G.setAttribute("role","presentation");for(var x=0;x<f.length;x++){var B=
f[x],K;J||(J=!0,p&&(K=G.insertRow(0).insertCell(0),K.textContent=p));K=G.insertRow(-1).insertCell(0);K.colspan=2;t&&t(K);var y={Name:B.name,Directory:B.directory,Location:B.path||B.location},F=null;"number"===typeof B.LineNumber&&(F={},F.line=B.LineNumber);if(w&&w.keyword&&!w.nameSearch){var H=d.generateSearchHelper(w),F=F||{};F.find=H.inFileQuery.searchStr;F.regEx=H.inFileQuery.wildCard?!0:void 0}y=b.createLink(m.toUrl("edit/edit.html"),y,u,c,a,{"aria-describedby":(B.folderName?B.folderName:B.path).replace(/[^a-zA-Z0-9_\.:\-]/g,
""),style:{verticalAlign:"middle"}},F);B.LineNumber&&y.appendChild(document.createTextNode(" (Line "+B.LineNumber+")"));K.appendChild(y);D(K,B)}l.appendChild(G);"function"===typeof n&&n(l)}!J&&r&&(a=e.formatMessage(k["No matches found for ${0}"],r),g.empty(l),l.appendChild(document.createTextNode(a)),"function"===typeof n&&n(l))}})}};c.prototype={search:function(a,b,c){var e=function(a){for(var c=[],e=0;e<a.response.docs.length;e++){var f=a.response.docs[e],h=f.Location,g=d.path2FolderName(f.Path?
f.Path:f.Location,f.Name),k=g?g:h;(b?0<=k.indexOf(b):1)&&c.push({name:f.Name,path:h,folderName:g,directory:f.Directory,lineNumber:f.LineNumber})}return c};if(this._crawler&&a.nameSearch)this._crawler.searchName(a,function(b){c(e(b),a.keyword,null,a)});else try{this.registry.getService("orion.page.progress").progress(this._fileService.search(a),"Searching "+a.keyword).then(function(b){var d=a.keyword,d=d.substring(d.indexOf("}")+1),d=d.substring(d.indexOf(":")+1);c(e(b),d,null,a)},function(a){c(null,
null,a,null)})}catch(f){"string"===typeof f&&-1<f.indexOf("search")&&this._crawler?this._crawler.searchName(a,function(b){c(e(b),null,null,a)}):"string"===typeof f&&-1<f.indexOf("search")&&!a.nameSearch?(new n.SearchCrawler(this.registry,this._fileService,a,{childrenLocation:this.getChildrenLocation()})).search(function(b){c(e(b),null,null,a)}):this.registry.getService("orion.page.message").setErrorMessage(f)}},getFileService:function(){return this._fileService},setCrawler:function(a){this._crawler=
a},handleError:function(a,b){console.error(a);g.empty(b);b.appendChild(document.createTextNode(a));return a},setLocationByMetaData:function(a,b){var c="",d=null;this._searchRootLocation=this._fileService.fileServiceRootURL(a.Location);b&&a&&a.Parents&&0<a.Parents.length?d="last"===b.index?a.Parents[a.Parents.length-1]:a.Parents[0]:a&&a.Directory&&a.Location&&a.Parents&&(d=a);d?(this.setLocationbyURL(d.Location),c=d.Name,this._childrenLocation=d.ChildrenLocation):a&&(this.setLocationbyURL(this._searchRootLocation),
c=this._fileService.fileServiceName(a.Location),this._childrenLocation=a.ChildrenLocation);d=g.node("search");c||(c="");if(d&&d.placeholder){d.value="";var f=e.formatMessage(k["Search ${0}"],c);d.placeholder=30<f.length?f.substring(0,27)+"...":e.formatMessage(k["Search ${0}"],c)}d&&d.title&&(d.title=k["Type a keyword or wild card to search in "]+c)},setLocationbyURL:function(a){this._searchLocation=a},setRootLocationbyURL:function(a){this._searchRootLocation=a},setChildrenLocationbyURL:function(a){this._childrenLocation=
a},getSearchLocation:function(){return this._searchLocation?this._searchLocation:this._fileService.fileServiceRootURL()},getSearchRootLocation:function(){return this._searchRootLocation?this._searchRootLocation:this._fileService.fileServiceRootURL()},getChildrenLocation:function(){return this._childrenLocation?this._childrenLocation:this._fileService.fileServiceRootURL()},createSearchParams:function(a,b,c,d){c=c?this.getSearchRootLocation():this.getSearchLocation();return b?{resource:c,sort:"NameLower asc",
rows:100,start:0,nameSearch:!0,keyword:a}:{resource:c,sort:d&&d.sort?d.sort:"Path asc",rows:d&&d.rows?d.rows:40,start:0,caseSensitive:d?d.caseSensitive:void 0,regEx:d?d.regEx:void 0,fileType:d?d.fileType:void 0,keyword:a,replace:d?d.replace:void 0}}};c.prototype.constructor=c;return{Searcher:c}});
define("orion/dialogs",[],function(){function k(k){this._serviceRegistry=k;this._serviceRegistration=k.registerService("orion.page.dialog",this)}k.prototype={confirm:function(k,g){g(window.confirm(k))},openFiles:function(k){}};k.prototype.constructor=k;return{DialogService:k}});
define("orion/sites/siteClient",["i18n!orion/sites/nls/messages","require","orion/Deferred","orion/fileClient"],function(k,m,g,e){function d(a,b,d){var e=a[b],f=new g;if("function"!==typeof e)throw k["Service method missing: "]+b;e.apply(a,d).then(function(a){f.resolve(a)},function(a){f.reject(a)});return f}function n(a,b){return new e.FileClient(a,function(a){return(a=a.getProperty("top"))&&0===a.indexOf(b)})}function b(a,b,d){this._serviceRegistry=a;this._siteService=b;this._selfHost=d.getProperty("canSelfHost");
this._selfHostConfig=d.getProperty("selfHostingConfig");this._sitePattern=d.getProperty("sitePattern");this._filePattern=d.getProperty("filePattern");this._name=d.getProperty("name");this._id=d.getProperty("id");this._getService=function(){return this._siteService};this._getFilePattern=function(){return this._filePattern};this._getFileClient=function(){return n(this._serviceRegistry,this._getFilePattern())};this._canSelfHost=function(){return this._selfHost}}function f(a,b){a[b]=function(){return d(this._getService(),
b,Array.prototype.slice.call(arguments))}}function a(a,c,d){for(var e=a.getServiceReferences("orion.site"),f=[],g=[],m=[],r=0;r<e.length;r++){var n=e[r].getProperty(c),n="^"!==n[0]?"^"+n:n;f.push(e[r]);g.push(RegExp(n));m.push(a.getService(e[r]))}a:if("/"===d)c=-1;else if(!d||d.length&&0===d.length)c=0;else{for(e=0;e<g.length;e++)if(g[e].test(d)){c=e;break a}throw k["No Matching SiteService for "]+c+": "+d;}return new b(a,m[c],f[c])}b.prototype={getSelfHostingConfig:function(){return this._selfHostConfig},
isFileMapped:function(a,b){if(!a){var d=new g;d.resolve(!1);return d}return this.getURLOnSite(a,b).then(function(a){return null!==a})},mapOnSiteAndStart:function(a,b,d){function e(d,h,k){return f.isFileMapped(a,b).then(function(a){a||k.push({Source:d,Target:h,FriendlyPath:d});a=new g;a.resolve();return a})}var f=this,k="/"+b.Name,m;if(a)"started"===a.HostingStatus.Status&&(a.HostingStatus.Status="stopped"),m=f.toInternalForm(b.Location).then(function(b){return e(k,b,a.Mappings).then(function(){return f.updateSiteConfiguration(a.Location,
a).then(function(a){return f.updateSiteConfiguration(a.Location,{HostingStatus:{Status:"started"}})})})});else{var r=b.Name+" site";m=f.toInternalForm(b.Location).then(function(a){var b=[];return e(k,a,b).then(function(){return f.createSiteConfiguration(r,d,b,null,{Status:"started"}).then(function(a){return a})})})}return m.then(function(a){return f.getURLOnSite(a,b)})}};"createSiteConfiguration getSiteConfigurations deleteSiteConfiguration loadSiteConfiguration updateSiteConfiguration toFileLocation toInternalForm getMappingObject getMappingProposals updateMappingsDisplayStrings parseInternalForm isSelfHostingSite convertToSelfHosting getURLOnSite".split(" ").forEach(function(a){f(b.prototype,
a)});b.prototype.constructor=b;return{forLocation:function(b,c){return a(b,"pattern",c)},forFileLocation:function(b,c){return a(b,"filePattern",c)},getFileClient:n,SiteClient:b}});
define("orion/fileUtils",["require","i18n!orion/nls/messages","orion/URL-shim"],function(k,m){var g;g=k.toUrl?(new URL(k.toUrl("workspace"),window.location.href)).href:(new URL("/",window.location.href)).href;return{makeRelative:function(e){if(!e)return e;var d=window.location.protocol+"//"+window.location.host;return 0===e.indexOf(d)?e.substring(d.length):e},isAtRoot:function(e){return!e?!1:"/workspace"===e?!0:0===(new URL(e,window.location.href)).href.indexOf(g)}}});
define("orion/sites/siteUtils",["require","orion/fileUtils","orion/URITemplate"],function(k,m,g){return{generateEditSiteHref:function(e){var d=k.toUrl("sites/site.html");return(new g(d+"#{,resource,params*}")).expand({resource:m.makeRelative(e.Location)})}}});
define("orion/sites/siteCommands","i18n!orion/sites/nls/messages require orion/commandRegistry orion/commands orion/sites/siteUtils orion/sites/siteClient orion/Deferred orion/i18nUtil".split(" "),function(k,m,g,e,d,n,b,f){function a(a){return a instanceof Array?a:[a]}function l(a){return function(b){if(b instanceof Array&&1===b.length&&!(a instanceof Array))return b[0]}}var c=e.Command,h=f.formatMessage;return{createSiteServiceCommands:function(a,b,c){c=c||{};var f=new e.Command({name:k.Create,tooltip:k["Create a new site configuration"],
id:"orion.site.create",parameters:new g.ParametersDescription([new g.CommandParameter("name","text",k.Name)]),visibleWhen:function(a){return!0},callback:function(b){var e=b.items,f=a.getService(e),e=n.getFileClient(a,e.getProperty("filePattern")),h=b.parameters&&b.parameters.valueFor("name");b=a.getService("orion.page.progress");(b?b.progress(e.loadWorkspaces(),"Loading workspaces"):e.loadWorkspaces()).then(function(a){(a=a&&a[0]&&a[0].Id)&&h&&f.createSiteConfiguration(h,a).then(function(a){c.createCallback(d.generateEditSiteHref(a),
a)},c.errorCallback)})}});b.addCommand(f)},createSiteCommands:function(e,f){var g=e.getService("orion.page.dialog"),m=e.getService("orion.page.progress"),r=new c({name:k.Edit,tooltip:k["Edit the site configuration"],imageClass:"core-sprite-edit",id:"orion.site.edit",visibleWhen:function(a){a instanceof Array&&1===a.length&&(a=a[0]);return a.HostingStatus},hrefCallback:function(a){return d.generateEditSiteHref(a.items instanceof Array?a.items[0]:a.items)}});f.addCommand(r);r=new c({name:k.Start,tooltip:k["Start the site"],
imageClass:"core-sprite-start",id:"orion.site.start",visibleWhen:function(b){return a(b).some(function(a){return a.HostingStatus&&"stopped"===a.HostingStatus.Status})},callback:function(c){var d=a(c.items),f=c.userData;if(f.site&&1<d.length)throw Error("userData.site requires a single site configuration to act upon");d=d.map(function(a){var b=f.site||{};b.HostingStatus={Status:"started"};a=a.Location;return n.forLocation(e,a).updateSiteConfiguration(a,b)});m.showWhile(b.all(d)).then(l(c.items)).then(f.startCallback,
f.errorCallback)}});f.addCommand(r);var u=function(a,b){var c=a?b:{};c.HostingStatus={Status:"stopped"};var d=b.Location;return n.forLocation(e,d).updateSiteConfiguration(d,c)},r=new c({name:k.Stop,tooltip:k["Stop the site"],imageClass:"core-sprite-stop",id:"orion.site.stop",visibleWhen:function(b){return a(b).some(function(a){return a.HostingStatus&&"started"===a.HostingStatus.Status})},callback:function(c){var d=a(c.items),e=c.userData;if(e.site&&1<d.length)throw Error("userData.site requires a single site configuration to act upon");
d=d||[e.site];d=d.map(u.bind(null,!!e.site));m.showWhile(b.all(d)).then(l(c.items)).then(e.stopCallback,e.errorCallback)}});f.addCommand(r);r=new c({name:k.Delete,tooltip:k["Delete the site configuration"],imageClass:"core-sprite-delete",id:"orion.site.delete",visibleWhen:function(b){return 0<a(b).length},callback:function(c){var d=a(c.items),f=c.userData,m=1===d.length?h(k.ConfirmDeleteSingle,d[0].Name):h(k.ConfirmDeleteMultiple,d.length);g.confirm(m,function(a){a&&(a=d.map(function(a){var c=a.HostingStatus&&
"stopped"!==a.HostingStatus.Status?u(!1,a):a;return b.when(c).then(function(){var b=a.Location;return n.forLocation(e,b).deleteSiteConfiguration(b)})}),b.all(a).then(l(c.items)).then(f.deleteCallback,f.errorCallback))})}});f.addCommand(r)},createViewOnSiteCommands:function(a,b,d){var e=a.getService("orion.core.file");b.addCommand(new c({name:k["Add to site"],tooltip:k["Add the file to this site"],id:"orion.site.add-to",imageClass:"core-sprite-add",visibleWhen:function(a){return!a.IsFileRunningOn},
callback:function(b){var c=b.userData.file,d=b.items.SiteConfiguration,f=a.getService("orion.page.progress");return(f?f.progress(e.loadWorkspaces(),"Loading workspaces"):e.loadWorkspaces()).then(function(b){return n.forFileLocation(a,c.Location).mapOnSiteAndStart(d,c,b[0].Id)}).then(b.userData.addToCallback,b.userData.errorCallback)}}));b.addCommand(new c({name:k.View,tooltip:k["View the file on the site"],id:"orion.site.view-on-link",visibleWhen:function(a){return a.IsFileRunningOn},hrefCallback:function(b){var c=
b.userData.file;b=b.items.SiteConfiguration;return n.forFileLocation(a,c.Location).getURLOnSite(b,c)}}))}}});
define("orion/selection",["orion/EventTarget","orion/Deferred"],function(k,m){function g(e,d){d||(d="orion.page.selection");this._serviceRegistry=e;k.attach(this);this._serviceRegistration=e.registerService(d,this);this._selections=null}g.prototype={getSelection:function(e){var d=this._getSingleSelection();"function"===typeof e&&e(d);return d},getSelections:function(e){var d=Array.isArray(this._selections)?this._selections.slice():[];"function"===typeof e&&e(d);return d},_getSingleSelection:function(){return this._selections&&
0<this._selections.length?this._selections[0]:null},setSelections:function(e){var d=this._selections;Array.isArray(e)?this._selections=0<e.length?e.slice():null:this._selections=e?[e]:null;d!==this._selections&&this.dispatchEvent({type:"selectionChanged",selection:this._getSingleSelection(),selections:this._selections})}};g.prototype.constructor=g;return{Selection:g}});
define("orion/section","orion/webui/littlelib orion/selection orion/commandRegistry orion/commonHTMLFragments orion/objects orion/selection".split(" "),function(k,m,g,e,d,n){function b(a,b){var c=this;this._expandImageClass="core-sprite-openarrow";this._collapseImageClass="core-sprite-closedarrow";this._twistieSpriteClass="modelDecorationSprite";if(!b.id)throw Error("Missing required argument: id");this.id=b.id;if(!b.title)throw Error("Missing required argument: title");var d=b.useAuxStyle?["sectionWrapper",
"sectionWrapperAux","toolComposite"]:["sectionWrapper","toolComposite"];this.domNode=document.createElement("div");a.appendChild(this.domNode);for(var f=0;f<d.length;f++)this.domNode.classList.add(d[f]);this.domNode.id=b.id;b.canHide&&(this.twistie=document.createElement("span"),this.twistie.classList.add("modelDecorationSprite"),this.twistie.classList.add("layoutLeft"),this.twistie.classList.add("sectionTitleTwistie"),this.domNode.style.cursor="pointer",this.domNode.appendChild(this.twistie),this.domNode.tabIndex=
0,this.domNode.addEventListener("click",function(a){(a.target===c.titleNode||a.target===c.twistie||a.target===c.domNode)&&c._changeExpandedState()},!1),this.domNode.addEventListener("keydown",function(a){a.keyCode===k.KEY.ENTER&&(a.target===c.domNode||a.target===c.titleNode||a.target===c.twistie)&&c._changeExpandedState()},!1));if(b.iconClass){var g=document.createElement("span");g.classList.add("sectionIcon");this.domNode.appendChild(g);d=Array.isArray(b.iconClass)?b.iconClass:[b.iconClass];d.forEach(function(a){g.classList.add(a)})}b.headerClass&&
(d=Array.isArray(b.headerClass)?b.headerClass:[b.headerClass],d.forEach(function(a){this.domNode.classList.add(a)}.bind(this)));this.titleNode=document.createElement("div");this.titleNode.id=b.id+"Title";this.titleNode.classList.add("sectionAnchor");this.titleNode.classList.add("sectionTitle");this.titleNode.classList.add("layoutLeft");this.domNode.appendChild(this.titleNode);this.titleNode.textContent=b.title;"function"===typeof b.getItemCount&&(d=document.createElement("div"),d.classList.add("layoutLeft"),
d.classList.add("sectionItemCount"),this.domNode.appendChild(d),d.textContent=b.getItemCount(this));this._progressNode=document.createElement("div");this._progressNode.id=b.id+"Progress";this._progressNode.classList.add("sectionProgress");this._progressNode.classList.add("sectionTitle");this._progressNode.classList.add("layoutLeft");this._progressNode.style.visibility="hidden";this._progressNode.textContent="...";this.domNode.appendChild(this._progressNode);d=document.createElement("div");d.id=b.id+
"FilterSearchBox";this.domNode.appendChild(d);this._toolActionsNode=document.createElement("div");this._toolActionsNode.id=b.id+"ToolActionsArea";this._toolActionsNode.classList.add("layoutRight");this._toolActionsNode.classList.add("sectionActions");this.domNode.appendChild(this._toolActionsNode);this.actionsNode=document.createElement("ul");this.actionsNode.id=b.id+"ActionArea";this.actionsNode.classList.add("layoutRight");this.actionsNode.classList.add("commandList");this.actionsNode.classList.add("sectionActions");
this.domNode.appendChild(this.actionsNode);this.selectionNode=document.createElement("ul");this.selectionNode.id=b.id+"SelectionArea";this.selectionNode.classList.add("layoutRight");this.selectionNode.classList.add("commandList");this.selectionNode.classList.add("sectionActions");this.domNode.appendChild(this.selectionNode);b.slideout&&(d=e.slideoutHTMLFragment(b.id),f=document.createRange(),f.selectNode(this.domNode),d=f.createContextualFragment(d),this.domNode.appendChild(d));this._contentParent=
document.createElement("div");this._contentParent.id=this.id+"Content";this._contentParent.role="region";this._contentParent.classList.add("sectionTable");this._contentParent.setAttribute("aria-labelledby",this.titleNode.id);a.appendChild(this._contentParent);b.content&&this.setContent(b.content);"function"===typeof b.onExpandCollapse&&(this._onExpandCollapse=b.onExpandCollapse);this._preferenceService=b.preferenceService;this._collapse();if(this._preferenceService){var m=this;this._preferenceService.getPreferences("/window/views").then(function(a){a=
a.get(m.id);void 0===a?b.hidden||m._expand():a&&m._expand();m._updateExpandedState(!1)})}else b.hidden||this._expand(),this._updateExpandedState(!1);this._commandService=b.commandService;this._lastMonitor=0;this._loading={}}function f(a){this._section=a;this._id=++a._lastMonitor}b.prototype={setTitle:function(a){this.titleNode.textContent=a},getHeaderElement:function(a){return this.domNode},getTitleElement:function(a){return this.titleNode},getActionElement:function(a){return this._toolActionsNode},
setContent:function(a){"string"===typeof a?this._contentParent.innerHTML=a:(this._contentParent.innerHTML="",this._contentParent.appendChild(a))},getContentElement:function(){return this._contentParent},embedExplorer:function(a,b,c){this._contentParent.innerHTML="";a.parent||(a.parent=b);this._contentParent.appendChild(a.parent);a.section=this;d.mixin(a,{createActionSections:function(){this.actionsSections&&this.actionsSections.forEach(function(a){if(!k.node(a)){var b=document.createElement("ul");
b.id=a;b.classList.add("commandList");b.classList.add("layoutRight");this.section.actionsNode.appendChild(b)}}.bind(this))},getCommandsVisible:function(){return"hidden"!==this.section.actionsNode.style.visibility},setCommandsVisible:function(a,b){this.section.actionsNode.style.visibility=a?"":"hidden";void 0===b&&(b=a?null:"cursorOnly");this.renderer.selectionPolicy=b;var c=this.getNavHandler();c&&c.setSelectionPolicy(b);a?this.updateCommands():this.actionsSections&&this.actionsSections.forEach(function(a){k.node(a)&&
this.commandRegistry.destroy(a)}.bind(this))},destroy:function(){Object.getPrototypeOf(this).destroy.call(this);var a=this;this.actionsSections&&(this.actionsSections.forEach(function(b){delete a[b]}),delete this.actionsSections)},updateCommands:function(a){this.section.actionsNode&&this.getCommandsVisible()&&(this.createActionSections(),Object.getPrototypeOf(this).updateCommands.call(this,a))},loaded:function(){var a=this;!this.selection&&!c&&(this.serviceRegistry||this.registry?(this.selection=
new n.Selection(this.serviceRegistry||this.registry,this.parent.id+"Selection"),this.selection.addEventListener("selectionChanged",function(b){a.updateCommands(b.selections)})):window.console.error("Could not create a Selection for the explorer because of lack of serviceRegistry"));var b=this.registerCommands();!b||!b.then?a.updateCommands():b.then(function(){a.updateCommands()})}});a.renderer&&(a.renderer.section=this,d.mixin(a.renderer,{getCellHeaderElement:function(a){(a=Object.getPrototypeOf(this).getCellHeaderElement.call(this,
a))&&this.section.setTitle(a.innerHTML);return null}}))},createProgressMonitor:function(){return new f(this)},_setMonitorMessage:function(a,b){this._progressNode.style.visibility="visible";this._loading[a]=b;var c="",d;for(d in this._loading)""!==c&&(c+="\n"),c+=this._loading[d];this._progressNode.title=c},_monitorDone:function(a){delete this._loading[a];a="";for(var b in this._loading)""!==a&&(a+="\n"),a+=this._loading[b];this._progressNode.title=a;""===a&&(this._progressNode.style.visibility="hidden")},
_changeExpandedState:function(){this.hidden?this._expand():this._collapse();this._updateExpandedState(!0)},_updateExpandedState:function(a){var b=!this.hidden,c=this.twistie,d=this.id;c&&(c.classList.add(b?this._expandImageClass:this._collapseImageClass),c.classList.remove(b?this._collapseImageClass:this._expandImageClass));this._preferenceService&&a&&this._preferenceService.getPreferences("/window/views").then(function(a){a.put(d,b)});this._onExpandCollapse&&this._onExpandCollapse(b,this)},_expand:function(){this._contentParent.classList.remove("sectionClosed");
this.domNode.classList.remove("sectionClosed");this.hidden=!1},_collapse:function(){this.hidden=!0;this._contentParent.classList.add("sectionClosed");this.domNode.classList.add("sectionClosed")}};b.prototype.constructor=b;f.prototype={begin:function(a){this.status=a;this._section._setMonitorMessage(this.id,a)},worked:function(a){this.status=a;this._section._setMonitorMessage(this.id,a)},done:function(a){this.status=a;this._section._monitorDone(this.id)}};f.prototype.constructor=f;return{Section:b}});
define("orion/sites/siteMappingsTable","i18n!orion/sites/nls/messages orion/commands orion/explorers/explorer orion/i18nUtil orion/Deferred orion/webui/littlelib orion/EventTarget".split(" "),function(k,m,g,e,d,n,b){function f(a,b){for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d])}function a(a){return a.replace(/[\r\n\t]/g,"")}var l={};l.Model=function(){function a(b,c,d){this.rootPath=b;this.fetchItems=c;this.items=d}a.prototype=new g.ExplorerFlatModel;f(a.prototype,{getId:function(a){return a===this.root?
this.rootId:"mapping_"+this.items.indexOf(a)}});return a}();l.Renderer=function(){function a(b,c){this._init(b);this.options=b;this.explorer=c;this.commandService=b.commandService}a.prototype=new g.SelectionRenderer;f(a.prototype,{getCellHeaderElement:function(a){switch(a){case 0:return a=document.createElement("th"),a.textContent=" ",a.classList.add("isValidColumn"),a;case 1:return a=document.createElement("th"),a.textContent=k.Path,a;case 2:return a=document.createElement("th"),a.textContent=k["Mount at (server path)"],
a;case 3:return a=document.createElement("th"),a.textContent=k.Actions,a}},getCellElement:function(a,b,c){var d;switch(a){case 0:return this.getIsValidCell(a,b,c);case 1:return a=document.createElement("td"),c=document.createElement("input"),c.classList.add("pathInput"),c.value="undefined"!==typeof b.FriendlyPath?b.FriendlyPath:b.Target,d=function(a){this.options.onchange(b,"FriendlyPath",a.target.value,a)}.bind(this),c.onchange=d,c.onkeyup=d,a.appendChild(c),a;case 2:return a=document.createElement("td"),
c=document.createElement("input"),c.classList.add("serverPathInput"),c.value=b.Source,d=function(a){this.options.onchange(b,"Source",a.target.value,a)}.bind(this),c.onchange=d,c.onkeyup=d,a.appendChild(c),a;case 3:return this.getActionsColumn(b,c)}},getIsValidCell:function(a,b,c){a=b.Target;var d=document.createElement("td"),f,g;if(/^\//.test(a)){var l=this;this.options.siteClient.toFileLocation(a).then(function(a){f=a;var b=document.createElement("span");b.classList.add("validating");n.empty(d);
d.appendChild(b);b.textContent="\u2026";b=l.options.fileClient._getService(a).read(a,!0);l.options.progress&&l.options.progress.progress(b,"Reading metadata of "+a);b.then(function(a){var b=a&&a.Directory;a=b?"core-sprite-folder":"core-sprite-file";b=b?k.WorkspaceFolder:k.WorkspaceFile;g=document.createElement("a");g.href=f;g.target="_new";var c=document.createElement("span");c.className+="imageSprite "+a;c.title=e.formatMessage(b,f);g.appendChild(c);n.empty(d);d.appendChild(g)},function(a){g=document.createElement("a");
g.href=f;g.target="_new";a=document.createElement("span");a.className+="imageSprite core-sprite-error";a.title=e.formatMessage(k.WorkspaceResourceNotFound,f);g.appendChild(a);n.empty(d);d.appendChild(g)})})}else f=a,g=document.createElement("a"),g.href=f,g.target="_new",n.empty(d),a=document.createElement("span"),a.className+="imageSprite core-sprite-link",a.title=e.formatMessage(k.ExternalLinkTo,f),g.appendChild(a),d.appendChild(g);d.classList.add("isValidCell");return d}});return a}();l.MappingsTable=
function(){function c(a){this.registry=a.serviceRegistry;this.commandService=a.commandRegistry;this.registerCommands();this.siteClient=a.siteClient;this.parentId=a.parentId;this.selection=a.selection;this.renderer=new l.Renderer({checkbox:!1,onchange:this.fieldChanged.bind(this),siteConfiguration:a.siteConfiguration,siteClient:a.siteClient,fileClient:a.fileClient,commandService:this.commandService,progress:a.serviceRegistry.getService("orion.page.progress"),actionScopeId:"siteMappingCommand"},this);
this.myTree=null;this._setSiteConfiguration(a.siteConfiguration);this.setDirty(!1)}c.prototype=Object.create(g.Explorer.prototype);b.attach(c.prototype);f(c.prototype,{_setSiteConfiguration:function(a){this.siteConfiguration=a;this.refresh()},refresh:function(){var a=function(){return(new d).resolve(this.siteConfiguration.Mappings)}.bind(this),b=this;this.siteClient.updateMappingsDisplayStrings(this.siteConfiguration).then(function(c){b.siteConfiguration.Mappings=c.Mappings;b.createTree(b.parentId,
new l.Model(null,a,b.siteConfiguration.Mappings))})},render:function(){this.changedItem(this.siteConfiguration.Mappings,this.siteConfiguration.Mappings)},renderItemRow:function(a,b){if("FriendlyPath"===b){var c=document.getElementById(this.myTree._treeModel.getId(a)),d=n.$(".isValidCell",c),e=n.$$array("td",c).indexOf(d),c=this.renderer.getIsValidCell(e,a,c);d.parentNode.replaceChild(c,d)}},registerCommands:function(){var a=new m.Command({name:k.Delete,imageClass:"core-sprite-delete",id:"orion.site.mappings.remove",
visibleWhen:function(a){return"Source"in a||"Target"in a||"FriendlyPath"in a},callback:function(a){this.deleteMapping(a.items);this.render();this.setDirty(!0)}.bind(this)});this.commandService.addCommand(a);this.commandService.registerCommandContribution("siteMappingCommand","orion.site.mappings.remove",0);a=new m.Command({name:k["Move Up"],imageClass:"core-sprite-move-up",id:"orion.site.mappings.moveUp",visibleWhen:function(a){return"Source"in a||"Target"in a||"FriendlyPath"in a}.bind(this),callback:function(a){var b=
this.getItemIndex(a.items);if(0!==b){var c=this.siteConfiguration.Mappings[b-1];this.siteConfiguration.Mappings[b-1]=a.items;this.siteConfiguration.Mappings[b]=c;this.render();this.setDirty(!0)}}.bind(this)});this.commandService.addCommand(a);this.commandService.registerCommandContribution("siteMappingCommand","orion.site.mappings.moveUp",1);a=new m.Command({name:k["Move Down"],imageClass:"core-sprite-move-down",id:"orion.site.mappings.moveDown",visibleWhen:function(a){return"Source"in a||"Target"in
a||"FriendlyPath"in a}.bind(this),callback:function(a){var b=this.getItemIndex(a.items);if(b!==this.siteConfiguration.Mappings.length-1){var c=this.siteConfiguration.Mappings[b+1];this.siteConfiguration.Mappings[b+1]=a.items;this.siteConfiguration.Mappings[b]=c;this.render();this.setDirty(!0)}}.bind(this)});this.commandService.addCommand(a);this.commandService.registerCommandContribution("siteMappingCommand","orion.site.mappings.moveDown",2)},getItemIndex:function(a){return this.siteConfiguration.Mappings.indexOf(a)},
_addMapping:function(b){var c=b.Source,d=b.Target,e=b.FriendlyPath;b.Source=a("string"===typeof c?c:this.getNextMountPoint(e));b.Target=a("string"===typeof d?d:"/");this.mappingExists(c,d)||this.siteConfiguration.Mappings.push(b)},addMapping:function(a){this._addMapping(a);this.render();this.setDirty(!0)},addMappings:function(a){for(var b=0;b<a.length;b++)this.addMapping(a[b]);this.render();this.setDirty(!0)},mappingExists:function(a,b){"object"===typeof a&&"undefined"===typeof b&&(b=a.Target,a=a.Source);
for(var c=this.siteConfiguration.Mappings,d=0;d<c.length;d++)if(c[d].Source===a&&c[d].Target===b)return!0;return!1},getNextMountPoint:function(a){for(var b=this.siteConfiguration.Mappings,c=!1,d=0;d<b.length;d++)if("/"===b[d].Source){c=!0;break}if(!c)return"/";if(!a)return"/web/somePath";a=a.split("/");for(d=a.length-1;0<=d;d--)if(!/\s+/.test(a[d]))return"/"+a[d];return"/web/somePath"},deleteMapping:function(a){a=this.siteConfiguration.Mappings.indexOf(a);-1!==a&&this.siteConfiguration.Mappings.splice(a,
1)},deleteAllMappings:function(){this.siteConfiguration.Mappings.splice(0,this.siteConfiguration.Mappings.length)},fieldChanged:function(b,c,d,e){d=a(d);if(b[c]!==d&&(b[c]=d,"FriendlyPath"===c)){var f=d,g=this;this.siteClient.parseInternalForm(this.siteConfiguration,f).then(function(a){b.Target=a||f;g.renderItemRow(b,c);g.setDirty(!0)})}},setDirty:function(a){this._isDirty=a;this.dispatchEvent({type:"dirty",value:a})},isDirty:function(){return this._isDirty}});return c}();return l});
define("orion/explorers/explorer-table","i18n!orion/navigate/nls/messages orion/Deferred orion/webui/littlelib orion/i18nUtil orion/fileUtils orion/explorers/explorer orion/EventTarget orion/objects orion/util".split(" "),function(k,m,g,e,d,n,b,f,a){function l(a,b,c,d,e,f){this.registry=a;this.root=b;this.fileClient=c;this.idPrefix=d||"";this.excludeFiles=!!e;this.excludeFolders=!!f}function c(a){b.attach(this);this.registry=a.serviceRegistry;this.treeRoot=a.treeRoot;this.selection=a.selection;this.fileClient=
a.fileClient;this.excludeFiles=a.excludeFiles;this.excludeFolders=a.excludeFolders;this.navHandlerFactory=a.navHandlerFactory;this.parentId=a.parentId;this.renderer=a.rendererFactory(this);this.dragAndDrop=a.dragAndDrop;this.setFocus=a.setFocus;this.myTree=this.model=null;this._hookedDrag=this.checkbox=!1;var c=a.modelEventDispatcher?a.modelEventDispatcher:new b;this.modelEventDispatcher=c;var d=this;this._modelListeners={};"copy copyMultiple create delete deleteMultiple import move moveMultiple".split(" ").forEach(function(a){c.addEventListener(a,
d._modelListeners[a]=d.modelHandler[a].bind(d))});this._clickListener=function(a){if("A"===a.target.tagName){for(a=a.target;a&&!a._item;)a=a.parentNode;if(a&&a._item)d.onLinkClick({type:"linkClick",item:a._item})}};(a=g.node(this.parentId))&&a.addEventListener("click",this._clickListener);var e=this.renderer;this.registry&&this.registry.registerService("orion.cm.managedservice",{updated:function(a){a=a&&"undefined"!==a["links.newtab"]?a["links.newtab"]?"_blank":"_self":"_self";e.setTarget&&e.setTarget(a)}},
{pid:"nav.config"})}l.prototype=new n.ExplorerModel;f.mixin(l.prototype,{getRoot:function(a){a(this.root)},processParent:function(a,b){var c=a.Projects?[]:[a].concat(a.Parents||[]);if(this.excludeFiles||this.excludeFolders){var d=[],e;for(e in b)if(!(b[e].Directory?this.excludeFolders:this.excludeFiles))d.push(b[e]),b[e].parent=a,b[e].Parents||(b[e].Parents=c);b=d}else for(d in b)b[d].parent=a,b[d].Parents||(b[d].Parents=c);a.children=b;a.children.sort(function(a,b){var c=a.Directory;if(c!==b.Directory)return c?
-1:1;var c=a.Name&&a.Name.toLowerCase(),d=b.Name&&b.Name.toLowerCase();return c<d?-1:c>d?1:0});return b},getChildren:function(a,b){var c=this;if(a.children)b(a.children);else if(void 0!==a.Directory&&!1===a.Directory)b([]);else if(a.Children)b(c.processParent(a,a.Children));else if(a.Location){var d=null;this.registry&&(d=this.registry.getService("orion.page.progress"));(d?d.progress(this.fileClient.fetchChildren(a.ChildrenLocation),k["Fetching children of "]+a.Name):this.fileClient.fetchChildren(a.ChildrenLocation)).then(function(d){c.destroyed||
b(c.processParent(a,d))},function(){b([])})}else b([])},hasChildren:function(){var a=!1;this.root.Children&&(a=0<this.root.Children.length);return a}});l.prototype.constructor=l;var h,q;c.prototype=Object.create(n.Explorer.prototype);f.mixin(c.prototype,{destroy:function(){var a=this;Object.keys(this._modelListeners).forEach(function(b){a.modelEventDispatcher.removeEventListener(b,a._modelListeners[b])});var b=g.node(this.parentId);b&&b.removeEventListener("click",this._clickListener);n.Explorer.prototype.destroy.call(this)},
onLinkClick:function(a){this.dispatchEvent(a)},onModelCreate:function(a){return this.changedItem(a.parent,!0)},onModelCopy:function(a){var b=this,c={};(a.items||[a]).forEach(function(a){a=(a=a.parent)||b.treeRoot;c[a.Location]=a});return m.all(Object.keys(c).map(function(a){return b.changedItem(c[a],!0)}))},onModelMove:function(a){var b=this,c={};(a.items||[a]).forEach(function(a){var d=b.treeRoot;if((d.Location||d.ContentLocation)===a.oldValue.Location){var e=b.treeRoot;a=a.newValue;a=a.ChildrenLocation?
a:this.fileClient.read(a.ContentLocation,!0);return m.when(a,function(a){b.dispatchEvent({type:"rootMoved",oldValue:e,newValue:a});b.loadResourceList(a)})}d=(d=a.oldValue.parent)||b.treeRoot;c[d.Location]=d;d=(d=a.parent)||b.treeRoot;c[d.Location]=d;a.oldValue.Directory&&a.newValue&&b.isExpanded(a.oldValue)&&(c[a.newValue.Location]=a.newValue)});return m.all(Object.keys(c).map(function(a){return b.changedItem(c[a],!0)}))},onModelDelete:function(a){a=a.items||[a];var b=this,c=b.treeRoot,d;if(a.some(function(a){if(a.oldValue.Location===
(c.Location||c.ContentLocation)){if(a.oldValue.Location!==(a.parent.Location||a.parent.ContentLocation))d=a.parent;return!0}return!1}))return this.loadResourceList(d);var e={};a.forEach(function(a){a=a.parent;e[a.Location]=a});return m.all(Object.keys(e).map(function(a){return b.changedItem(e[a],!0)}))},modelHandler:{copy:function(a){if(!a.count)return this.onModelCopy(a)},copyMultiple:function(a){return this.onModelCopy(a)},create:function(a){return this.onModelCreate(a)},"delete":function(a){if(!a.count)return this.onModelDelete(a)},
deleteMultiple:function(a){return this.onModelDelete(a)},"import":function(a){return this.changedItem(a.target,!0)},move:function(a){if(!a.count)return this.onModelMove(a)},moveMultiple:function(a){return this.onModelMove(a)}},_makeDropTarget:function(b,c,f){if(this.dragAndDrop){var l=this,m=this.dragAndDrop,n=function(a){h=a.target};f&&(this._oldDragStart&&c.removeEventListener("dragstart",this._oldDragStart,!1),this._oldDragStart=n);c.addEventListener("dragstart",n,!1);n=function(a){h=null};f&&
(this._oldDragEnd&&c.removeEventListener("dragend",this._oldDragEnd,!1),this._oldDragEnd=n);c.addEventListener("dragend",n,!1);n=function(a){c.classList.remove("dragOver");a.preventDefault();a.stopPropagation()};f&&(this._oldDragLeave&&c.removeEventListener("dragleave",this._oldDragLeave,!1),this._oldDragLeave=n);c.addEventListener("dragleave",n,!1);n=function(b){if(h)q=b.dataTransfer.dropEffect=(a.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!a.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===
b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect="copy";c.classList.add("dragOver");g.stop(b)};f&&(this._oldDragEnter&&c.removeEventListener("dragenter",this._oldDragEnter,!1),this._oldDragEnter=n);c.addEventListener("dragenter",n,!1);n=function(b){if(h)q=b.dataTransfer.dropEffect=(a.isMac?b.altKey:b.ctrlKey)?"copy":"move";else if(!a.isIE&&("all"===b.dataTransfer.effectAllowed||"uninitialized"===b.dataTransfer.effectAllowed||0<=b.dataTransfer.effectAllowed.indexOf("copy")))b.dataTransfer.dropEffect=
"copy";g.stop(b)};f&&!this._oldDragOver&&(c.addEventListener("dragover",n,!1),this._oldDragOver=n);var v=null,E=null;l.registry&&(v=l.registry.getService("orion.page.progress"),E=l.registry.getService("orion.page.message"));var z=function(a){if(E){var b=null,b="string"===typeof a?{Severity:"Error",Message:a}:a&&a.error?{Severity:"Error",Message:a.error}:a;E.setProgressResult(b)}else window.console.log(a)},w=function(a,c,f,g,h,l,m){!f.Location&&f.fileMetadata&&(f=f.fileMetadata);c=c||"";if(a.isFile)d.isAtRoot(f.Location)?
z(k["You cannot copy files directly into the workspace.  Create a folder first."]):a.file(function(a){h(f,a,g,a.name.indexOf(".zip")===a.name.length-4&&window.confirm(e.formatMessage(k["Unzip ${0}?"],a.name)))});else if(a.isDirectory){var n=a.createReader(),r=function(b){n.readEntries(function(d){for(var e=0;e<d.length;e++)w(d[e],c+a.name+"/",b,g,h,l,!0)})};d.isAtRoot(f.Location)?(v?v.progress(l.createProject(f.ChildrenLocation,a.name),e.formatMessage(k["Creating ${0}"],a.name)):l.createProject(f.ChildrenLocation,
a.name)).then(function(a){g.loadResourceList(g.treeRoot.Path,!0);(v?v.progress(l.read(a.ContentLocation,!0),k["Loading "]+a.name):l.read(a.ContentLocation,!0)).then(function(a){r(a)},z)},z):(v?v.progress(l.createFolder(f.Location,a.name),e.formatMessage(k["Creating ${0}"],a.name)):l.createFolder(f.Location,a.name)).then(function(a){var c=g.modelEventDispatcher;m||c.dispatchEvent({type:"create",parent:b,newValue:a});r(a)},z)}},n=function(a){var f;c.classList.remove("dragOver");if(h){f=l.fileClient;
for(var n=h,t;n;){if(n._item){t=n._item;break}n=n.parentNode}if(!t)return;var D="copy"===q,n=D?f.copyFile:f.moveFile;(v?v.showWhile(n.apply(f,[t.Location,b.Location]),e.formatMessage(k[D?"Copying ${0}":"Moving ${0}"],t.Location)):n.apply(f,[t.Location,b.Location])).then(function(a){l.modelEventDispatcher.dispatchEvent({type:D?"copy":"move",oldValue:t,newValue:a,parent:b})},z)}else if(a.dataTransfer.items&&0<a.dataTransfer.items.length)for(f=0;f<a.dataTransfer.items.length;f++)n=null,"function"===
typeof a.dataTransfer.items[f].getAsEntry?n=a.dataTransfer.items[f].getAsEntry():"function"===typeof a.dataTransfer.items[f].webkitGetAsEntry&&(n=a.dataTransfer.items[f].webkitGetAsEntry()),n&&w(n,null,b,l,m,l.fileClient);else if(a.dataTransfer.files&&0<a.dataTransfer.files.length)for(f=0;f<a.dataTransfer.files.length;f++)n=a.dataTransfer.files[f],!n.size&&!n.type?z(e.formatMessage(k["Did not drop ${0}.  Folder drop is not supported in this browser."],n.name)):d.isAtRoot(b.Location)?z(k["You cannot copy files directly into the workspace.  Create a folder first."]):
m(b,n,l,n.name.indexOf(".zip")===n.name.length-4&&window.confirm(e.formatMessage(k["Unzip ${0}?"],n.name)));g.stop(a)};f&&(this._oldDrop&&c.removeEventListener("drop",this._oldDrop,!1),this._oldDrop=n);c.addEventListener("drop",n,!1)}},createModel:function(){return new l(this.registry,this.treeRoot,this.fileClient,this.parentId,this.excludeFiles,this.excludeFolders)},changedItem:function(a,b){if(this.treeRoot&&this.treeRoot.Location===a.Location)return this.loadResourceList(this.treeRoot,b);var c=
this,d=new m;a.children=a.Children=null;this.model.getChildren(a,function(e){c.getNavHandler();c.myTree.refresh.bind(c.myTree)(a,e,b);d.resolve(e)});return d},showItem:function(a,b){var c=new m;if(!a||!this.model||!this.myTree||!this.myTree.showRoot&&a.Location===this.treeRoot.Location)return c.reject();var d=this.getRow(a);if(d)c.resolve(d._item||a);else return a.Parents&&0<a.Parents.length?(a.Parents[0].Parents=a.Parents.slice(1),this.expandItem(a.Parents[0],b).then(function(b){var c=this.getRow(a);
return!c?this.changedItem(b,!0).then(function(){var b=this.getRow(a);return b?b._item:(new m).reject()}.bind(this)):c._item||a}.bind(this))):void 0===b||b?this.reroot(a):c.reject();return c},expandItem:function(a,b){var c=new m;this.showItem(a,b).then(function(a){this.myTree.isExpanded(a)?c.resolve(a):this.myTree.expand(this.model.getId(a),function(){c.resolve(a)})}.bind(this),c.reject);return c},reveal:function(a,b){return this.showItem(a,b).then(function(a){var b=this.getNavHandler();b&&(b.cursorOn(a,
!0),b.setSelection(a));return a}.bind(this))},reroot:function(a){return(new m).reject()},isExpanded:function(a){a=this.model.getId(a);return this.renderer.tableTree.isExpanded(a)},getNameNode:function(a){if(a=this.model.getId(a))return g.node(a+"NameLink")},scopeUp:function(){},scopeDown:function(a){},loadResourceList:function(a,b,c){a&&"object"===typeof a&&(a=a.ChildrenLocation||a.ContentLocation);a=d.makeRelative(a);if(!b&&a===this._lastPath)return(new m).resolve(this.treeRoot);this._lastPath=a;
var e=this;return b||a!==this.treeRoot.Path?this.load(this.fileClient.loadWorkspace(a),k["Loading "]+a).then(function(b){e.treeRoot.Path=a;"function"===typeof c&&c();e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new m).resolve(e.treeRoot)},function(a){e.treeRoot.Path=null;e.dispatchEvent({type:"rootChanged",root:e.treeRoot});return(new m).reject(a)}):(new m).resolve(e.treeRoot)},load:function(a,b,c){var d=g.node(this.parentId),e=g.node("progress");e||(e=document.createElement("div"),
e.id="progress",g.empty(d),d.appendChild(e));g.empty(e);var f=setTimeout(function(){g.empty(e);e.appendChild(document.createTextNode(b))},500),h=this;return m.when(a,function(a){clearTimeout(f);if(!h.destroyed){h.treeRoot={};for(var b in a)h.treeRoot[b]=a[b];h.model=h.createModel();h.dragAndDrop&&(h._hookedDrag?h._makeDropTarget(h.treeRoot,d,!0):(a=(a=d&&("draggable"in d||"ondragstart"in d&&"ondrop"in d))&&!(!window.File||!window.FileList||!window.FileReader),h._hookedDrag=!0,a?h._makeDropTarget(h.treeRoot,
d,!0):(h.dragAndDrop=null,window.console.log("Local file drag and drop is not supported in this browser."))));var e=new m;h.createTree(h.parentId,h.model,{onComplete:function(a){e.resolve(a)},navHandlerFactory:h.navHandlerFactory,setFocus:"undefined"===typeof h.setFocus?!0:h.setFocus,selectionPolicy:h.renderer.selectionPolicy,onCollapse:function(a){if(h.getNavHandler())h.getNavHandler().onCollapse(a)}});return e.then(function(){if("function"===typeof c)try{c()}catch(a){h.registry&&h.registry.getService("orion.page.message").setErrorMessage(a)}if("function"===
typeof h.onchange)h.onchange(h.treeRoot);return h.treeRoot})}},function(a){clearTimeout(f);h.registry&&h.registry.getService("orion.page.message").setProgressResult(a);return(new m).reject(a)})},onchange:function(a){}});c.prototype.constructor=c;return{FileExplorer:c,FileModel:l}});
define("orion/webui/dialogs/DirectoryPrompterDialog","i18n!orion/widgets/nls/messages orion/webui/littlelib orion/webui/dialog orion/fileUtils orion/selection orion/explorers/navigationUtils orion/explorers/explorer orion/explorers/explorer-table".split(" "),function(k,m,g,e,d,n,b,f){function a(a,b){this.explorer=b;this._init(a)}function l(a){this._init(a)}a.prototype=new b.SelectionRenderer;a.prototype.constructor=a;a.prototype.getLabelColumnIndex=function(){return 0};a.prototype.getCellElement=
function(a,b,d){a=document.createElement("td");d.appendChild(a);var e=document.createElement("span");e.id=d.id+"navSpan";a.appendChild(e);e.className="mainNavColumn singleNavColumn";this.getExpandImage(d,e);e.appendChild(document.createTextNode(b.Name))};l.prototype=new g.Dialog;l.prototype.TEMPLATE='\x3cdiv id\x3d"message" style\x3d"width: 25em; padding-bottom: 5px;"\x3e\x3c/div\x3e\x3cdiv id\x3d"directoryTree" class\x3d"explorerTreeClass" style\x3d"width:25em; min-height: 25em; max-height:30em; height: auto; overflow-y: auto;"\x3e\x3c/div\x3e';
l.prototype._init=function(a){this.title=a.title||k["Choose a Folder"];this.modal=!0;this.buttons=[{text:k.OK,isDefault:!0,callback:this.done.bind(this)}];this.customFocus=!0;this._fileClient=a.fileClient;this._serviceRegistry=a.serviceRegistry;this._message=a.message||"";this._func=a.func;this._initialize()};l.prototype._bindToDom=function(a){this.loadFolderList("/");this._message?this.$message.appendChild(document.createTextNode(this._message)):this.$message.style.display="none";this.$directoryTree.focus()};
l.prototype.loadFolderList=function(b){b=e.makeRelative(b);this.selection=new d.Selection(this._serviceRegistry,"orion.directoryPrompter.selection");this.explorer=new f.FileExplorer({treeRoot:{children:[]},selection:this.selection,serviceRegistry:this._serviceRegistry,fileClient:this._fileClient,parentId:"directoryTree",excludeFiles:!0,rendererFactory:function(b){return new a({checkbox:!1,singleSelection:!0,treeTableClass:"directoryPrompter"},b)}});this.explorer.loadResourceList(b,!0,null)};l.prototype.done=
function(){this.selection.getSelection(function(a){this.hide();this._func(a)}.bind(this))};l.prototype.constructor=l;return{DirectoryPrompterDialog:l}});define("text!orion/sites/templates/SiteEditor.html",[],function(){return'\x3cdiv class\x3d"siteEditor"\x3e\n\t\x3cdiv class\x3d"sectionTable" role\x3d"region"\x3e\n\t\t\x3cform id\x3d"siteForm" class\x3d"siteForm sectionTableItem"\x3e\n\t\t\t\x3cdiv class\x3d"siteEditorTable"\x3e\n\t\t\t\t\x3cdiv\x3e\n\t\t\t\t\t\x3cdiv class\x3d"header"\x3e\n\t\t\t\t\t\t\x3clabel class\x3d"siteConfigNameLabel"\x3e${Name:}\x3c/label\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\t\x3cdiv class\x3d"cell"\x3e\n\t\t\t\t\t\t\x3cinput class\x3d"siteConfigName" required\x3d"required" pattern\x3d"\\s*\\S+\\s*" value\x3d""\x3e\n\t\t\t\t\t\t\x3cdiv class\x3d"nameInvalid"\x3e${Not a valid name}\x3c/div\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\t\n\t\t\t\t\x3cdiv\x3e\n\t\t\t\t\t\x3cdiv class\x3d"header"\x3e\n\t\t\t\t\t\t\x3clabel class\x3d"hostHintLabel"\x3e${Hostname hint:}\x3c/label\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\t\x3cdiv class\x3d"cell"\x3e\n\t\t\t\t\t\t\x3cinput class\x3d"hostHint" required\x3d"required" pattern\x3d"^(?:\\s*|[A-Za-z0-9-_]+)$" value\x3d""\x3e\n\t\t\t\t\t\t\x3cem\x3e${Optional; used to determine the URL where a started site can be accessed.}\x3c/em\x3e\n\t\t\t\t\t\t\x3cdiv class\x3d"hostInvalid"\x3e${Not a valid hostname}\x3c/div\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\t\n\t\t\t\t\x3cdiv\x3e\n\t\t\t\t\t\x3cdiv class\x3d"header"\x3e\n\t\t\t\t\t\t\x3clabel class\x3d"hostingStatusLabel"\x3e${Status:}\x3c/label\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\t\x3cdiv class\x3d"cell hostingStatusArea"\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"hostingStatus"\x3e\x3c/span\x3e\n\t\t\t\t\t\t\x3cspan class\x3d"siteStartedWarning"\x3e\n\t\t\t\t\t\t\t\x3cem\x3e${Changes you make here won\'t affect the running site.}\x3c/em\x3e\n\t\t\t\t\t\t\x3c/span\x3e\n\t\t\t\t\t\x3c/div\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\x3c/div\x3e\n\t\t\x3c/form\x3e\n\t\x3c/div\x3e\n\n\t\x3cdiv class\x3d"siteEditorTable"\x3e\n\t\t\x3cdiv class\x3d"mappingsGridTable"\x3e\x3c/div\x3e\n\n\t\t\x3cdiv class\x3d"convertToolbar"\x3e\x3c/div\x3e\n\t\x3c/div\x3e\n\n\x3c/div\x3e'});
define("text!orion/sites/templates/ConvertToSelfHostingDialog.html",[],function(){return'\x3cdiv\x3e\n\t\x3cstyle\x3e\n\t.form {\n\t\twidth: auto;\n\t\tlist-style-type: none; \n\t\tpadding: 0; \n\t\tmargin: 0;\n\t\t-webkit-padding-start: 0;\n\t\t-webkit-margin-before: 0;\n\t}\n\t.form li {\n\t\tmargin: 0;\n\t}\n\t.msg {\n\t\tclear: both;\n\t\twidth: 25em;\n\t}\n\t.pad1 { padding: 8px 0 0 0; }\n\t.pad2 { padding: 20px 0 0 0; }\n\t.browseButton { margin: 0 5px 0 5px; }\n\t.folderName {\n\t\tfont-weight: bold;\n\t}\n\t.field {\n\t\tfloat: left;\n\t\twidth: 6em;\n\t}\n\t.col { float: left; }\n\t.okButton {\n\t\tfloat: right;\n\t\tclear: both;\n\t}\n\t\x3c/style\x3e\n\t\x3cdiv\x3e\n\t\t\x3cul class\x3d"form"\x3e\n\t\t\t\x3cli class\x3d"msg" id\x3d"selectRequired"\x3e\n\t\t\t\t\x3cdiv\x3e${LabelSelectRequired}\x3c/div\x3e\n\t\t\t\x3c/li\x3e\n\n\t\t\t\x3c!-- Elements are dynamically added here for each required folder. Each folder follows this pattern: --\x3e\n\t\t\t\x3c!--\n\t\t\t\x3cli class\x3d"msg pad2"\x3e\x3cdiv class\x3d"col"\x3eorion.client - Orion client repository:\x3c/div\x3e\x3c/li\x3e\n\t\t\t\x3cli class\x3d"pad1"\x3e\n\t\t\t\t\x3cdiv class\x3d"col"\x3e\n\t\t\t\t\t\x3cbutton class\x3d"browseButton commandButton" type\x3d"button"\x3eBrowse...\x3c/button\x3e\n\t\t\t\t\t\x3cspan class\x3d"folderText"\x3eimpress.js\x3c/span\x3e\n\t\t\t\t\x3c/div\x3e\n\t\t\t\x3c/li\x3e\n\t\t\t--\x3e\n\t\t\x3c/ul\x3e\n\t\x3c/div\x3e\n\x3c/div\x3e'});
define("orion/sites/SiteEditor","i18n!orion/sites/nls/messages i18n!orion/widgets/nls/messages orion/commands orion/Deferred orion/section orion/objects orion/sites/siteMappingsTable orion/i18nUtil orion/webui/littlelib orion/EventTarget orion/webui/dialogs/DirectoryPrompterDialog orion/webui/dialog text!orion/sites/templates/SiteEditor.html text!orion/sites/templates/ConvertToSelfHostingDialog.html".split(" "),function(k,m,g,e,d,n,b,f,a,l,c,h,q,p){var s=function(a){this.options=a=a||{};n.mixin(this,
a);this._init(a)};s.prototype=new h.Dialog;n.mixin(s.prototype,{TEMPLATE:p,_init:function(a){this.title=a.title||k["Convert to Self-Hosting"];this.buttons=[{text:k.OK,callback:this.okButtonClicked.bind(this)}];this.modal=!0;this.folders=this.selfHostingConfig.folders;this.messages={};n.mixin(this.messages,k);this.messages.LabelSelectRequired=1===this.folders.length?k.SelectRequiredFoldersSingle:k.SelectRequiredFolders;this._initialize()},_bindToDom:function(){this.$okButton=this.$buttonContainer.firstChild;
this.$okButton.classList.add("disabled");this.browseButtons=[];this.folderTexts=[];this.appendFolderElements();this.updateValidity()},appendFolderElements:function(){var b=this,c=document.createDocumentFragment();this.folders.forEach(function(d,e){var f=document.createElement("li");f.className="msg pad2";var g=document.createElement("div");g.textContent=k.FolderPrompt;var h=document.createElement("span");h.className="folderName";h.textContent=d.name;a.processDOMNodes(g,[h,document.createTextNode(d.label)]);
f.appendChild(g);c.appendChild(f);f=document.createElement("li");f.className="pad1";g=document.createElement("div");g.className="col";h=document.createElement("button");h.className="browseButton commandButton";h.textContent=m["Browse..."];h.type="button";var l=document.createElement("span");l.className="folderText";g.appendChild(h);g.appendChild(l);f.appendChild(g);b.browseButtons.push(h);b.folderTexts.push(l);c.appendChild(f);h.addEventListener("click",b.showChooseFolderDialog.bind(b,e))});b.$selectRequired.parentNode.appendChild(c,
null)},showChooseFolderDialog:function(a){a=new c.DirectoryPrompterDialog({title:f.formatMessage(k.LocateFolderTitle,this.folders[a].name),serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,func:this.onFolderChosen.bind(this,a)});this._addChildDialog(a);a.show()},onFolderChosen:function(a,b){this.folders[a].folder=b;this.folderTexts[a].textContent=b?b.Name:"";this.updateValidity()},isValid:function(){return this.folders.every(function(a){return a.folder})},updateValidity:function(){this.isValid()?
this.$okButton.classList.remove("disabled"):this.$okButton.classList.add("disabled")},okButtonClicked:function(){this.isValid()&&(this.hide(),"function"===typeof this.options.func&&this.options.func(this.folders))}});var t="/";h=function(a,b){a=a||{};n.mixin(this,a);this.options=a;this.checkOptions(this.options,"serviceRegistry fileClient siteClient commandService statusService progressService".split(" "));this._fileClient=this.options.fileClient;this._siteClient=this.options.siteClient;this._commandService=
this.options.commandService;this._statusService=this.options.statusService;this._progressService=this.options.progressService;this._commandsContainer=this.options.commandsContainer;this.options.location&&this.load(this.options.location);this.node=b||document.createElement("div")};l.attach(h.prototype);n.mixin(h.prototype,{_siteConfiguration:null,_modelListeners:null,mappings:null,_mappingProposals:null,_isSelfHostingSite:!1,_isDirty:!1,_autoSaveTimer:null,show:function(){this.createElements();this.postCreate()},
createElements:function(){this.node.innerHTML=q;a.processTextNodes(this.node,k);this.siteForm=a.$(".siteForm",this.node);this.name=a.$(".siteConfigName",this.node);this.name.id=this.id+"_name";this.nameInvalid=a.$(".nameInvalid",this.node);this.hostHint=a.$(".hostHint",this.node);this.hostHint.id=this.id+"_hostHint";this.hostInvalid=a.$(".hostInvalid",this.node);this.hostingStatus=a.$(".hostingStatus",this.node);this.siteStartedWarning=a.$(".siteStartedWarning",this.node);this.mappingsPlaceholder=
a.$(".mappingsGridTable");this.mappingsPlaceholder.id=this.id+"_mappingsPlaceholder";this.convertToolbar=a.$(".convertToolbar");this.convertToolbar.id=this.id+"_convertToolbar";a.$(".siteConfigNameLabel",this.node).htmlFor=name.id;a.$(".hostHintLabel",this.node).htmlFor=this.hostHint.id},postCreate:function(){var a=this;this.name.addEventListener("input",function(b){a.name.checkValidity()?(a.name.classList.remove("invalid"),a.nameInvalid.classList.remove("visible")):(a.name.classList.add("invalid"),
a.nameInvalid.classList.add("visible"))});this.hostHint.addEventListener("change",function(b){a.hostHint.checkValidity()?(a.hostHint.classList.remove("invalid"),a.hostInvalid.classList.remove("visible")):(a.hostHint.classList.add("invalid"),a.hostInvalid.classList.add("visible"))});var b=this;e.when(this.siteClient._canSelfHost(),function(a){var c=new g.Command({name:k["Convert to Self-Hosting"],tooltip:k["Enable the site configuration to launch an Orion server running your local client code"],imageClass:"core-sprite-add",
id:"orion.site.convert",visibleWhen:function(c){return!!c.Location&&a&&!b._isSelfHostingSite},callback:b.convertToSelfHostedSite.bind(b)});b._commandService.addCommand(c)});this._autoSaveTimer=setTimeout(this.autoSave.bind(this),8E3)},checkOptions:function(a,b){for(var c=0;c<b.length;c++)if("undefined"===typeof a[b[c]])throw Error("options."+b[c]+" is required");},_makeAddMenuChoices:function(a,b,d){function e(a){f.getSiteConfiguration().Mappings.some(function(a){return a.Source===t})||(a.Source=
t);f.mappings.addMapping(a)}b=Array.isArray(b)?b[0]:b;a=a.sort(function(a,b){return a.FriendlyPath.toLowerCase().localeCompare(b.FriendlyPath.toLowerCase())});var f=this,g=function(a){e(this.mapping)};b=a.map(function(a){return{name:a.FriendlyPath,imageClass:"core-sprite-folder",mapping:a,callback:g}});0<a.length&&b.push({});b.push({name:k["Choose folder..."],imageClass:"core-sprite-folder",callback:function(){(new c.DirectoryPrompterDialog({serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,
func:function(a){a&&this._siteClient.getMappingObject(this.getSiteConfiguration(),a.Location,a.Name).then(function(a){g.call({mapping:a})})}.bind(this)})).show()}.bind(this)});b.push({name:k.URL,imageClass:"core-sprite-link",callback:function(){e({Source:"/web/somePath",Target:"http://",FriendlyPath:"http://"})}});return b},convertToSelfHostedSite:function(a,b){var c=this._siteClient.getSelfHostingConfig(),d=[];c.folders.forEach(function(a){a.nls&&d.push(f.getMessageBundle(a.nls).then(function(b){a.label=
b[a.labelKey]||a.label||a.labelKey}))});e.all(d,function(a){return a}).then(function(){var a=this;(new s({serviceRegistry:this.serviceRegistry,fileClient:this.fileClient,siteClient:this._siteClient,selfHostingConfig:c,func:function(b){b=b.map(function(a){return a.folder.Location});a._siteClient.convertToSelfHosting(a.getSiteConfiguration(),b).then(function(b){a.mappings.deleteAllMappings();a.mappings.addMappings(b.Mappings);a.save()})}})).show()}.bind(this))},load:function(a){var b=new e;this._busyWhile(b,
"Loading...");this._siteClient.loadSiteConfiguration(a).then(function(a){this._setSiteConfiguration(a);this.setDirty(!1);b.resolve(a)}.bind(this),function(a){b.reject(a)});return b},_setSiteConfiguration:function(a){this._detachListeners();this._siteConfiguration=a;if(!this._mappingProposals){var b=this._commandService;this._mappingProposals=this._siteClient.getMappingProposals(a).then(function(a){a=new g.Command({name:k.Add,tooltip:k["Add a directory mapping to the site configuration"],id:"orion.site.mappings.add",
visibleWhen:function(a){return!0},choiceCallback:this._makeAddMenuChoices.bind(this,a)});b.addCommand(a);a=this.titleWrapper.actionsNode;b.registerCommandContribution(a.id,"orion.site.mappings.add",1);b.renderCommands(a.id,a,this.mappings,this,"button")}.bind(this))}this._refreshCommands();this._refreshFields()},setDirty:function(a){this._isDirty=a;this.dispatchEvent({type:"dirty",value:a})},isDirty:function(){return this._isDirty},_refreshCommands:function(){function a(b){c._onError(b)}function b(a){c._setSiteConfiguration(a);
c.setDirty(!1)}var c=this;this._siteClient.isSelfHostingSite(this.getSiteConfiguration()).then(function(d){c._isSelfHostingSite=d;c._commandService.destroy(c._commandsContainer);c._commandService.renderCommands(c._commandsContainer.id,c._commandsContainer,c._siteConfiguration,{},"button",{site:c._siteConfiguration,startCallback:b,stopCallback:b,errorCallback:a})})},_refreshFields:function(){this.name.setAttribute("value",this._siteConfiguration.Name);this.hostHint.setAttribute("value",this._siteConfiguration.HostHint);
this.mappings?this.mappings._setSiteConfiguration(this._siteConfiguration):(this.titleWrapper=new d.Section(document.getElementById(this.mappingsPlaceholder.id),{id:"workingDirectorySection",title:k.Mappings,content:'\x3cdiv id\x3d"mappingsNode"/\x3e',canHide:!0}),this.mappings=new b.MappingsTable({serviceRegistry:this.serviceRegistry,siteClient:this._siteClient,fileClient:this._fileClient,commandRegistry:this._commandService,selection:null,parentId:"mappingsNode",siteConfiguration:this._siteConfiguration}));
var c=this._siteConfiguration.HostingStatus;if(c&&"started"===c.Status){this.siteStartedWarning.style.display="block";this.hostingStatus.textContent=k.Started;var e=document.createElement("a");e.href=c.URL;e.target="_new";e.textContent=c.URL;a.processDOMNodes(this.hostingStatus,[e])}else c&&"stopped"===c.Status&&(this.siteStartedWarning.style.display="none",this.hostingStatus.textContent=k.Stopped);setTimeout(function(){this._attachListeners(this._siteConfiguration)}.bind(this),0)},_attachListeners:function(a){function b(d,
e){function f(b){b=d.value;var g=a[e];a[e]=b;c.setDirty(g!==b||c.isDirty())}d.addEventListener("input",f);c._modelListeners.push({target:d,type:"input",listener:f})}this._detachListeners();this._modelListeners=this._modelListeners||[];var c=this;b(this.name,k.Name);b(this.hostHint,k.HostHint);var d=function(a){c.setDirty(a.value)};this.mappings.addEventListener("dirty",d);this._modelListeners.push({target:this.mappings,type:"dirty",listener:d})},_detachListeners:function(){if(this._modelListeners){for(var a=
0;a<this._modelListeners.length;a++){var b=this._modelListeners[a];b.target.removeEventListener(b.type,b.listener)}this._modelListeners.splice(0)}},getSiteConfiguration:function(){return this._siteConfiguration},getResource:function(){return this._siteConfiguration&&this._siteConfiguration.Location},save:function(a){a="undefined"===typeof a?!0:a;var b=this._siteConfiguration,c=b.HostingStatus;delete b.HostingStatus;var d=this,e=this._siteClient.updateSiteConfiguration(b.Location,b).then(function(e){d.setDirty(!1);
if(a)return d._setSiteConfiguration(e),e;b.HostingStatus=c;d._refreshCommands();return b});this._busyWhile(e);return!0},autoSave:function(){this.isDirty()&&this.save(!1);setTimeout(this.autoSave.bind(this),8E3)},_busyWhile:function(a,b){a.then(this._onSuccess.bind(this),this._onError.bind(this));this.progressService.showWhile(a,b)},_onSuccess:function(a){this.onSuccess(a)},_onError:function(a){this._statusService.setErrorMessage(a);this.onError(a)},onSuccess:function(a){this.dispatchEvent({type:"success",
deferred:a})},onError:function(a){this.dispatchEvent({type:"error",deferred:a})}});return h});
define("built-site.js","require i18n!orion/sites/nls/messages orion/bootstrap orion/status orion/progress orion/commandRegistry orion/fileClient orion/operationsClient orion/searchClient orion/dialogs orion/globalCommands orion/sites/siteClient orion/sites/siteCommands orion/PageUtil orion/sites/SiteEditor".split(" "),function(k,m,g,e,d,n,b,f,a,l,c,h,q,p,s){g.startup().then(function(b){var g=b.serviceRegistry,u=b.preferences;new l.DialogService(g);var D=new f.OperationsClient(g);b=new e.StatusReportingService(g,
D,"statusPane","notifications","notificationArea");var v=new n.CommandRegistry({}),D=new d.ProgressService(g,D,v),E=p.matchResourceParameters().resource,E=h.forLocation(g,E),z=E._getFileClient(),w=new a.Searcher({serviceRegistry:g,commandService:v,fileService:z});c.generateBanner("orion-site",g,v,u,w);var A,C=function(){var a=A&&A.getSiteConfiguration();if(A&&a){var b={Parents:[]};b.Name=a.Name;b.Parents[0]={};b.Parents[0].Name=m.Sites;b.Parents[0].Location="";c.setPageTarget({task:"Edit Site",target:a,
breadcrumbTarget:b,makeBreadcrumbLink:function(a,b){a.href=k.toUrl("sites/sites.html")},serviceRegistry:g,searchService:w,fileService:z,commandService:v});c.setDirtyIndicator(A.isDirty())}},u=function(){var a=p.matchResourceParameters().resource;a&&a!==A.getResource()&&(!A.isDirty()||confirm(m["There are unsaved changes. Do you still want to navigate away?"]))&&A.load(a).then(function(){C()})};window.addEventListener("hashchange",u);A=new s({serviceRegistry:g,fileClient:z,siteClient:E,commandService:v,
statusService:b,progressService:D,commandsContainer:document.getElementById("pageActions"),id:"site-editor"});document.getElementById("site").appendChild(A.node);A.show();A.addEventListener("success",C);A.addEventListener("dirty",C);u();window.onbeforeunload=function(){if(A.isDirty())return m["There are unsaved changes."]};q.createSiteCommands(g,v);v.registerCommandContribution("pageActions","orion.site.start",1);v.registerCommandContribution("pageActions","orion.site.stop",2);v.registerCommandContribution("pageActions",
"orion.site.convert",3)})});
//@ sourceMappingURL=built-site.js.map